robot_energy_storage
# The robot_energy_storage datum
Used to handle robot stack items, such as metal, wood, nanopaste, etc.
To make things simple, the default `cost` of using 1 item from a borg stack, is 1.
So then for example, when we have a `max_energy` of 50, the borg can use 50 of that item before it runs out.
The `recharge_rate` will be affected by the charge rate of a borg recharger, depending on the level of parts. By default it is 1.
This amount will be given every 2 seconds. So at round start, rechargers will give 1 energy back every 2 seconds, to each stack the borg has.
Vars | |
energy | Current amount of energy. |
---|---|
max_energy | The max amount of energy the stack can hold at once. |
name | The name of the energy storage. |
recharge_rate | The amount of energy the stack will regain while charging. |
statpanel_name | The name that will be displayed in the status panel. |
Procs | |
add_charge | Called whenever the cyborg is recharging and gains charge on its stack, or when clicking on other same-type stacks in the world. |
use_charge | Called whenever the cyborg uses one of its stacks. Subtract the amount used from this datum's energy variable. |
Var Details
energy
Current amount of energy.
max_energy
The max amount of energy the stack can hold at once.
name
The name of the energy storage.
recharge_rate
The amount of energy the stack will regain while charging.
statpanel_name
The name that will be displayed in the status panel.
Proc Details
add_charge
Called whenever the cyborg is recharging and gains charge on its stack, or when clicking on other same-type stacks in the world.
Arguments:
- amount - the number to add to the
energy
var.
use_charge
Called whenever the cyborg uses one of its stacks. Subtract the amount used from this datum's energy
variable.
Arguments:
- amount - the number to subtract from the
energy
var.