Power store abstract type ![code/modules/power/power_store.dm 10](git.png)
Abstract type for a stock part that holds power.
Vars | |
cell_size_prefix | The size icon overlay prefix. |
---|---|
charge | Current charge in cell units |
charge_light_type | What charge lige sprite to use, null if no light |
chargerate | How much power is given per second in a recharger. |
connector_type | What connector sprite to use when in a cell charger, null if no connectors |
corrupted | If the power cell was damaged by an explosion, chance for it to become corrupted and function the same as rigged. |
empty | Does the cell start without any charge? |
grown_battery | If it's a grown that acts as a battery, add a wire overlay to it. |
maxcharge | Maximum charge in cell units |
rating_base | Standard cell charge used for rating |
ratingdesc | If true, the cell will state it's maximum charge in it's description |
rigged | If the cell has been booby-trapped by injecting it with plasma. Chance on use() to explode. |
Procs | |
change | Changes the charge of the cell. Args: |
charge | Returns the current charge of the cell. |
give | Recharge the cell. Args: |
max_charge | Returns the maximum charge of the cell. |
on_magic_charge | Signal proc for COMSIG_ITEM_MAGICALLY_CHARGED |
on_reagents_del | Handles properly detaching signal hooks. |
percent | Returns the percentage of the cell's charge. |
use | Use power from the cell. Args: |
used_charge | Returns the amount of charge used on the cell. |
Var Details
cell_size_prefix ![code/modules/power/power_store.dm 13](git.png)
The size icon overlay prefix.
charge ![code/modules/power/power_store.dm 15](git.png)
Current charge in cell units
charge_light_type ![code/modules/power/power_store.dm 31](git.png)
What charge lige sprite to use, null if no light
chargerate ![code/modules/power/power_store.dm 25](git.png)
How much power is given per second in a recharger.
connector_type ![code/modules/power/power_store.dm 33](git.png)
What connector sprite to use when in a cell charger, null if no connectors
corrupted ![code/modules/power/power_store.dm 23](git.png)
If the power cell was damaged by an explosion, chance for it to become corrupted and function the same as rigged.
empty ![code/modules/power/power_store.dm 35](git.png)
Does the cell start without any charge?
grown_battery ![code/modules/power/power_store.dm 29](git.png)
If it's a grown that acts as a battery, add a wire overlay to it.
maxcharge ![code/modules/power/power_store.dm 19](git.png)
Maximum charge in cell units
rating_base ![code/modules/power/power_store.dm 17](git.png)
Standard cell charge used for rating
ratingdesc ![code/modules/power/power_store.dm 27](git.png)
If true, the cell will state it's maximum charge in it's description
rigged ![code/modules/power/power_store.dm 21](git.png)
If the cell has been booby-trapped by injecting it with plasma. Chance on use() to explode.
Proc Details
change
Changes the charge of the cell. Args:
- amount: The energy to give to the cell (can be negative). Returns: The energy that was given to the cell (can be negative).
charge
Returns the current charge of the cell.
give
Recharge the cell. Args:
- amount: The amount of energy to give to the cell in joules. Returns: The power given to the cell in joules.
max_charge
Returns the maximum charge of the cell.
on_magic_charge
Signal proc for COMSIG_ITEM_MAGICALLY_CHARGED
If we, or the item we're located in, is subject to the charge spell, gain some charge back
on_reagents_del
Handles properly detaching signal hooks.
percent
Returns the percentage of the cell's charge.
use
Use power from the cell. Args:
- used: Amount of power in joules to use.
- force: If true, uses the remaining power from the cell if there isn't enough power to supply the demand. Returns: The power used from the cell in joules.
used_charge
Returns the amount of charge used on the cell.