Ostibot
Ostibot

Game Rules

Core Game Mechanics

Game Structure

  • The game consists of multiple rounds (2 rounds, nbRounds).
  • Each team starts with a certain amount of gold (3 gold, startingGold).
  • Teams change order at the end of each round.
  • The game ends when all rounds are completed.
  • The team with the most gold wins.
  • Each team has 300 seconds (timeout) to make their move each turn.

Adventurers

  • 3 adventurers spawn automatically per team per round (adventurersPerRound) from spawner tiles.
  • Adventurers have 120 HP (adventurerHp) and deal 20 base damage (adventurerDamage).
  • Escaped adventurers respawn first with their equipment (see Escaped Adventurers below).

Equipment System

  • Adventurers have 3 equipment slots: weapon, armor, accessory.
  • Adventurers also have an inventory to hold items.
  • Equipment is bought during the shop phase and can be equipped/unequipped.
  • Items can be transferred between adventurers during the shop phase.
  • Items are sold at 50% of their purchase price.
  • When an adventurer dies, all equipped and inventory items drop on the ground.
  • Dropped items can be picked up by walking over them (added to inventory).
  • At the end of the game, escaped adventurers' remaining equipment is auto-sold at 50% price.

Weapons (boost damage)

ItemCostBonus
Rusty Sword2 gold+5 damage
Steel Blade5 gold+10 damage
Enchanted Axe10 gold+20 damage

Armor (damage reduction)

ItemCostBonus
Leather Vest2 gold-5 damage taken
Chainmail5 gold-10 damage taken
Plate Armor10 gold-15 damage taken

Armor only reduces combat damage from other adventurers. Does NOT reduce spike, corruption, or block damage.

Accessories (utility)

ItemCostBonus
Scout's Binocular2 gold+5 vision
Speed Boots5 gold+2 vision
Big Boots4 goldSpike immunity

Consumables

ItemCostEffect
Health Potion3 goldHeals 80 HP
Greater Health Potion6 goldHeals 160 HP

Consumables are used during the turn phase via the use action. Healing is capped at max HP (120).

Escaped Adventurers

  • When an adventurer escapes through a portal, their equipment is saved.
  • Next round, escaped adventurers respawn first at team spawners with their equipment.
  • This allows building up well-equipped adventurers across rounds.

Movement and Combat

  • Adventurers can move to adjacent tiles each turn.
  • When moving to a friendly adventurer, all gold is transferred to the other adventurer.
  • When moving to an entity, you hit it for the adventurer's damage (base 20 + weapon bonus).
  • When hitting an enemy adventurer, damage is reduced by the target's armor (damage reduction, min 0).
  • If an adventurer hits a wall or spawner, they take 20 damage (blockDamage).
  • If an adventurer hits a health tile and has enough gold, they restore all HP.
  • If an adventurer hits a health tile and doesn't have enough gold, they take 20 damage (blockDamage).
  • Adventurers that don't act in a turn stay idle.

Vision

  • Base vision is 5 tiles (visionLength), increased by accessories.
  • Each adventurer uses their own vision stat.
  • Team spawner tiles also provide 5-tile vision radius.
  • Walls and doors block line of sight.
  • Teams can't see entities behind walls or doors.

Map Spawners

  • Maps use digit characters (1-9) to define per-team spawners.
  • 1 = Team 1 spawners, 2 = Team 2 spawners, etc.
  • Each team typically has 3 spawner tiles.

Corruption

  • Corruption is a game mechanic that gradually makes the map filled with fire.
  • It starts at turn 30 (corruptionStartAt).
  • Every 4 turns (corruptionSpreadSpeed), corruption spreads to adjacent cells.
  • Corruption deals 20 damage (corruptionDamage) to entities at the end of turn.
  • Corruption damage bypasses equipment and armor — it damages adventurer HP directly.
  • Corruption can open portals by burning them to 0 HP.
  • Dropped items on the ground survive corruption.
  • When corruption starts:
    • All spawners are destroyed and replaced by corruption.
    • Corruption spreads to adjacent cells every few turns.
    • The corruption continues to spread until the end of the game.
    • This forces players to take a portal.

Special Tiles

  • Spikes: Deal 20 damage (spikeDamage) when an adventurer steps on them. Spike damage bypasses equipment. Can be avoided with Big Boots (spike immunity).
  • Ice: When an adventurer steps on ice, they slide in the direction they were moving.
  • Treadmills: When an adventurer steps on a treadmill, they are moved in the treadmill's direction.
  • Portals:
    • Have 100 HP (portalHp).
    • Need to be hit until 0 HP to open it.
    • Portals are the only way to escape the map.
    • When an adventurer escapes through a portal:
      • The adventurer's gold is added to the team's total gold.
      • The adventurer's equipment is saved for next round respawn.
      • The portal is removed once an adventurer uses it.

Collectibles

  • Chests:
    • Have 100 HP (chestHp).
    • Drop 12 gold (chestGold) when broken.
  • Vases:
    • Have 40 HP (vaseHp).
    • Drop 3 gold (vaseGold) when broken.
  • Doors:
    • Have 40 HP (doorHp).
    • Doors block line of sight.
  • Gold:
    • Can be picked up when walked on.
    • Dropped when adventurers die.
    • Any gold left on the map at the end of a round is lost.
  • Items:
    • Dropped items appear on the ground when an adventurer dies.
    • Can be picked up by walking over them (added to inventory).

Healing

  • Healing tiles cost 2 gold (healCost).
  • Restores adventurer to full HP (120).

Bot Interface

Your bot exports a script object with two functions:

script.shop(input) — Shop Phase

Called once at the start of each round, before any turns. Buy, sell, equip, and manage items here.

Input:

  • you: Your team ID
  • rules: Current game rules
  • teams: List of all teams
  • adventurers: Your team's adventurers (with their equipment and inventory)
  • round: Current round number
  • teamsGold: Gold amount for each team
  • state: Your bot's persistent state (optional)

Return:

  • actions: Array of shop actions, each one of:
    • { buy: { adventurerId, itemType, equip? } } — Buy an item (optionally auto-equip if slot is empty)
    • { sell: { adventurerId, itemId } } — Sell an item from inventory (50% refund)
    • { equip: { adventurerId, itemId } } — Equip an item from inventory to its slot
    • { unequip: { adventurerId, itemId } } — Unequip an item back to inventory
    • { transfer: { from, to, itemId } } — Transfer an item between adventurers' inventories
  • state: Optional state to persist

If shop is not defined or returns an invalid response, no actions are taken.

script.play(input) — Turn Phase

Called every turn during the round.

Input:

  • you: Your team ID
  • rules: Current game rules
  • teams: List of all teams
  • gameState: Current game state (visible entities only)
  • state: Your bot's persistent state (optional)

Return:

  • actions: Array of actions (one per adventurer; only the first action per adventurer per turn is processed, duplicates are rejected), each with:
    • adventurerId: ID of the adventurer
    • move: { direction, reason? } — Move in a direction ("UP", "DOWN", "LEFT", "RIGHT")
    • use: { itemId, reason? } — Use a consumable or equip an item from inventory
  • error: Optional error message if something went wrong.
  • state: Optional state to persist for next turn

Vision Rules:

  • Your bot can only see entities within the adventurer's vision stat (base 5, increased by accessories).
  • Walls and doors block vision.

Game Modes

The game has several predefined rule sets:

  1. Default: Standard rules
  2. SemiFinal: 3 rounds
  3. Final: 4 rounds