Power store abstract type
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
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.
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.