StarOS: combat
See the overview. Safe fields (Haven's fields among them) refuse weapons fire, and so does a fresh claim beacon around its owner.
Weapons
| module | range | damage | per shot |
|---|---|---|---|
laser |
6 | 30 | 400 Wh |
railgun |
12 | 80 | 1 200 Wh and 1 slug from the hopper |
Each has fire(dx, dy), fire_at(robot_name) and the attributes range, damage, energy_wh. fire_at naming no other robot on the field is a script error, as is fire(0, 0). Rock, buildings and robots block the line. Every shot of a turn lands at once, on start-of-turn positions.
Defense
| member | meaning |
|---|---|
armor.left() |
damage the plates can still absorb (40 a plate, then spent) |
shield.on(), shield.off() |
from the next turn; absorbs 60 a turn, draws 150 W |
shield.is_on() |
is it switched on |
jammer.range |
5; the jammer draws 200 W and hides the robot from nearby enemy lidars |
Turrets
Every robot has turret.fire(id, dx, dy, weapon="laser"): fire your own turret id, aiming from the turret. At most 8 shots a turn. The turret's network pays.
def tick():
if not shield.is_on():
shield.on()