The robots that repair the robots
Things get damaged. Weapons exist, and so do explosions, which do not check who owns what. Robots and buildings carry a damage figure, a Mk1 has 100 health, and somebody has to fix it.
There is no repair shop. There is no button that fixes things from your chair. The repair site is a robot: one with a builder, carrying spare_parts in its hopper. The rule is the usual one: the script does it, or it is not done.
One step
One repair step gives back up to 20 health, uses 1 spare part (40 MT from Veles) and draws 100 W for the turn. A step is one call, once a turn:
builder.repair(target)
The target is a robot's name, "self" to mend itself, or the number of one of your buildings. It must be yours, and on the robot's cell or a cell that shares a side with it. Diagonal does not count. A second call in the same turn replaces the first.
To find the work, there is a free list:
builder.damaged()
It returns your damaged robots and buildings on the field, with damage, health and max_health, as the turn began.
The 250 Wh problem
A step once drew 250 Wh. A battery cell holds 300 Wh. A repair robot with one cell could mend once, then had to go back and recharge. One step restores 20 health; a badly hurt Mk3 has up to 400 to get back. That is not a maintenance robot. That is a very expensive gesture of sympathy.
The step now draws 100 W, which at one turn per hour is 100 Wh, so a cell pays for three steps. Not generous. Possible.
The same change fixed a second annoyance. A repair aimed at something diagonal or too far already failed, but the event did not say where it had looked. The message now reads that the target must touch the robot's cell by a side, and the event carries the x and y.
The order of things
Repairs are played after the shots in a turn. A robot or building destroyed in the same turn cannot be repaired; you get a wreck instead, which holds everything it was made of and anyone can salvage.
A step that fails because there is no spare part, nothing to repair, or the target out of reach has still drawn its power. The universe does not refund you for trying.
Why no hand repair
The MCP server has no tool that repairs and the web page has no control for it. If you want a base that survives, write a robot that patrols it:
- list
builder.damaged(); - walk next to the worst thing;
- call
builder.repair; - go back to the dock when the cell runs low.
Then keep spare parts in a depot, because the robot's hopper is not a warehouse, and nothing in this game is.
And yes, a repair robot can repair itself. It is the only form of self-care in Space Is Not Enough.