Azymoove Help

Items and abilities

Up to 3 items per robot: passive bonuses and abilities your code triggers.

Items and abilities

Declare up to 3 items in the class, without repeats. They cost points from the same budget as the parts (12). Every item improves the robot while equipped (more health, energy, range…), and some also have an ability your code triggers with useItem.

class Hunter extends Robot {
  constructor() { super({ items: ["nitro", "repair_kit", "antenna"] }); }
  run() {
    while (true) {
      const state = this.scan();
      if (state.me.health < 40 && this.canUse("repair_kit")) this.useItem("repair_kit");
      else if (state.scanned.length && this.canUse("nitro")) this.useItem("nitro");
    }
  }
}

In Ruby: super(items: ["nitro", "repair_kit"]), use_item :nitro, can_use?(:nitro). In Python: super().__init__(items=["nitro", "repair_kit"]), self.use_item("nitro"), self.can_use("nitro"). In Lua: Robot.init(self, {items = {"nitro"}}), self:use_item("nitro"), self:can_use("nitro").

Rules

  • state.me.items lists your items with ready, cooldown, charges and running.
  • One item per turn. The result arrives in state.events: itemUsed, or itemFailed with the reason (missing, passive, empty, cooldown or energy).
  • Whoever steps on a mine or is hit by an EMP pulse gets hitByItem.
  • The mystery box can give a temporary single-use item (reward: "item").
  • In battle, the item dims while it recharges, with a ring that fills up, and turns grey when out of uses.
  • Helpers (the Drone) are not items, but they share the 3 slots. See Helpers.