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

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.itemslists your items withready,cooldown,chargesandrunning.- One item per turn. The result arrives in
state.events:itemUsed, oritemFailedwith the reason (missing,passive,empty,cooldownorenergy). - 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.
Nitro+5% speed. useItem: 2 s at 1.6× speed and double acceleration (cooldown 10 s, 6 energy).
Repair kituseItem: recovers 12 health right away (2 uses, cooldown 1 s, 8 energy).
Bubble shielduseItem: for 3 s ignores another 60% of the damage from shots, punches and explosions (cooldown 15 s, 15 energy).
MineuseItem: drops a mine where the robot is. It arms in 1 s and explodes when an opponent gets close: 20 damage in a radius of 4 (3 uses, cooldown 1 s).