apc
Vars | |
aidisabled | Is the AI locked from using the APC |
---|---|
alarm_manager | Represents a signel source of power alarms for this apc |
area | Reference to our area |
areastring | Mapper helper to tie an apc to another area |
auto_name | Automatically name the APC after the area is in |
away_general_access | Used for apc helper called away_general_access to make apc's required access away_general_access. |
beenhit | used for counting how many times it has been hit, used for Aliens at the moment |
cell | Reference to our internal cell |
cell_10k | Used for apc helper called cell_10k to install 10k cell into apc. |
cell_5k | Used for apc helper called cell_5k to install 5k cell into apc. |
cell_type | Type of cell we start with |
chargemode | Can the APC charge? |
charging | State of the apc charging (not charging, charging, fully charged) |
coverlocked | Is the apc cover locked? |
cut_AI_wire | Used for apc helper called cut_AI_wire to make apc's wore responsible for ai connectione mended. |
emergency_lights | Should the emergency lights be on? |
environ | State of the environmental channel (off, auto off, on, auto on) |
equipment | State of the equipment channel (off, auto off, on, auto on) |
failure_timer | Time to allow the APC to regain some power and to turn the channels back online |
force_update | Forces an update on the power use to ensure that the apc has enough power |
full_charge | Used for apc helper called full_charge to make apc's charge at 100% meter. |
hacked_flicker_counter | Counter for displaying the hacked overlay to mobs within view |
has_electronics | State of the electronics inside (missing, installed, secured) |
icon_update_needed | Used to stop process from updating the icons too much |
last_charging | Previous state of charging, to detect the change |
last_nightshift_switch | Time when the nightshift where turned on last, to prevent spamming |
lastused_charge | Total amount of power put into the battery |
lastused_environ | Amount of power used by the environmental channel |
lastused_equip | Amount of power used by the equipment channel |
lastused_light | Amount of power used by the lighting channel |
lastused_total | Total amount of power used by the three channels |
light_on_range | Range of the light emitted when on |
lighting | State of the lighting channel (off, auto off, on, auto on) |
locked | Is the apc interface locked? |
long_term_power | buffer state that makes apcs not shut off channels immediately as long as theres some power left, effect visible in apcs only slowly losing power |
low_power_nightshift_lights | Tracks if lights channel was set to nightshift / reduced power usage mode automatically due to low power. |
main_status | State of the apc external power (no power, low power, has power) |
malfai | Reference to our ai hacker |
malfhack | Is the apc hacked by a malf ai? |
nightshift_lights | Should the nighshift lights be on? |
no_charge | Used for apc helper called no_charge to make apc's charge at 0% meter. |
occupier | Reference to the shunted ai inside |
offset_old | Offsets the object by APC_PIXEL_OFFSET (defined in apc_defines.dm) pixels in the direction we want it placed in. This allows the APC to be embedded in a wall, yet still inside an area (like mapping). |
opened | State of the cover (closed, opened, removed) |
operating | Is the apc working |
overload | used for the Blackout malf module |
remote_control_user | Reference to our remote control |
shorted | Is the APC shorted and not working? |
start_charge | Initial cell charge % |
syndicate_access | Used for apc helper called syndicate_access to make apc's required access syndicate_access. |
terminal | Reference to our cable terminal |
transfer_in_progress | Is there an AI being transferred out of us? |
unlocked | Used for apc helper called unlocked to make apc unlocked. |
update_overlay | Stores the flag for the overlays |
update_state | Stores the flags for the icon state |
Procs | |
AICtrlClick | Toggle APC power settings |
AICtrlShiftClick | Toggle APC environment settings (atmos) |
AIShiftClick | Toggle APC lighting settings |
add_load | Adds load (energy) to the terminal's grid. |
ai_click_alt | Toggle APC equipment settings |
autoset | Returns the new status value for an APC channel. |
avail | Returns the amount of energy the terminal's grid has. |
available_energy | Returns the surplus energy from the terminal's grid and the cell. |
cable_act | Called when we interact with the APC with a cable, attempts to wire the APC and create a terminal |
can_place_terminal | Checks if we can place a terminal on the APC |
cell_act | Called when we interact with the APC with a cell, attempts to insert it |
charge | Returns the cell's current charge. |
check_updates | Checks for what icon updates we will need to handle |
disconnect_remote_access | Disconnects anyone using this APC via an APC control console and locks the interface. arguments: mute - whether the APC should announce the disconnection locally |
early_process | APC early processing. This gets processed after any other machine on the powernet does. This adds up the total static power usage for the apc's area, then draw that power usage from the grid or APC cell. |
electronics_act | Called when we interact with the APC with APC electronics, attempts to install the board |
ethereal_interact | Special behavior for when an ethereal interacts with an APC. |
fork_outlet_act | Called when we interact with the APC with an item with which we can get shocked when we stuff it into an APC |
give_away_general_access | Used for away_general_access apc helper, which set apc's required access to away_general_access. |
give_syndicate_access | Used for syndicate_access apc helper, which sets apc's required access to syndicate_access. |
install_cell_10k | Used for cell_10k apc helper, which installs 10k cell into apc. |
install_cell_5k | Used for cell_5k apc helper, which installs 5k cell into apc. |
pseudocircuit_act | Called when we interact with the APC with an electroadaptive pseudocircuit, used by cyborgs to install a board or weak cell |
set_full_charge | Used for full_charge apc helper, which sets apc charge to 100%. |
set_hacked_hud | Applies hacked overlay for malf AIs |
set_no_charge | Used for no_charge apc helper, which sets apc charge to 0%. |
setsubsystem | Used by external forces to set the APCs channel status's. |
surplus | Returns the surplus energy from the terminal's grid. |
time_to_charge | Returns the amount of time it will take the APC at its current trickle charge rate to reach a charge level. If the APC is functionally not charging, returns null. |
unlock | Used for unlocked apc helper, which unlocks the apc. |
wallframe_act | Called when we interact with the APC with and APC frame, used for replacing a damaged cover/frame |
Var Details
aidisabled
Is the AI locked from using the APC
alarm_manager
Represents a signel source of power alarms for this apc
area
Reference to our area
areastring
Mapper helper to tie an apc to another area
auto_name
Automatically name the APC after the area is in
away_general_access
Used for apc helper called away_general_access to make apc's required access away_general_access.
beenhit
used for counting how many times it has been hit, used for Aliens at the moment
cell
Reference to our internal cell
cell_10k
Used for apc helper called cell_10k to install 10k cell into apc.
cell_5k
Used for apc helper called cell_5k to install 5k cell into apc.
cell_type
Type of cell we start with
chargemode
Can the APC charge?
charging
State of the apc charging (not charging, charging, fully charged)
coverlocked
Is the apc cover locked?
cut_AI_wire
Used for apc helper called cut_AI_wire to make apc's wore responsible for ai connectione mended.
emergency_lights
Should the emergency lights be on?
environ
State of the environmental channel (off, auto off, on, auto on)
equipment
State of the equipment channel (off, auto off, on, auto on)
failure_timer
Time to allow the APC to regain some power and to turn the channels back online
force_update
Forces an update on the power use to ensure that the apc has enough power
full_charge
Used for apc helper called full_charge to make apc's charge at 100% meter.
hacked_flicker_counter
Counter for displaying the hacked overlay to mobs within view
has_electronics
State of the electronics inside (missing, installed, secured)
icon_update_needed
Used to stop process from updating the icons too much
last_charging
Previous state of charging, to detect the change
last_nightshift_switch
Time when the nightshift where turned on last, to prevent spamming
lastused_charge
Total amount of power put into the battery
lastused_environ
Amount of power used by the environmental channel
lastused_equip
Amount of power used by the equipment channel
lastused_light
Amount of power used by the lighting channel
lastused_total
Total amount of power used by the three channels
light_on_range
Range of the light emitted when on
lighting
State of the lighting channel (off, auto off, on, auto on)
locked
Is the apc interface locked?
long_term_power
buffer state that makes apcs not shut off channels immediately as long as theres some power left, effect visible in apcs only slowly losing power
low_power_nightshift_lights
Tracks if lights channel was set to nightshift / reduced power usage mode automatically due to low power.
main_status
State of the apc external power (no power, low power, has power)
malfai
Reference to our ai hacker
malfhack
Is the apc hacked by a malf ai?
nightshift_lights
Should the nighshift lights be on?
no_charge
Used for apc helper called no_charge to make apc's charge at 0% meter.
occupier
Reference to the shunted ai inside
offset_old
Offsets the object by APC_PIXEL_OFFSET (defined in apc_defines.dm) pixels in the direction we want it placed in. This allows the APC to be embedded in a wall, yet still inside an area (like mapping).
opened
State of the cover (closed, opened, removed)
operating
Is the apc working
overload
used for the Blackout malf module
remote_control_user
Reference to our remote control
shorted
Is the APC shorted and not working?
start_charge
Initial cell charge %
syndicate_access
Used for apc helper called syndicate_access to make apc's required access syndicate_access.
terminal
Reference to our cable terminal
transfer_in_progress
Is there an AI being transferred out of us?
unlocked
Used for apc helper called unlocked to make apc unlocked.
update_overlay
Stores the flag for the overlays
update_state
Stores the flags for the icon state
Proc Details
AICtrlClick
Toggle APC power settings
AICtrlShiftClick
Toggle APC environment settings (atmos)
AIShiftClick
Toggle APC lighting settings
add_load
Adds load (energy) to the terminal's grid.
ai_click_alt
Toggle APC equipment settings
autoset
Returns the new status value for an APC channel.
// val 0=off, 1=off(auto) 2=on 3=on(auto) // on 0=off, 1=on, 2=autooff TODO: Make this use bitflags instead. It should take at most three lines, but it's out of scope for now.
Arguments:
- val: The current status of the power channel.
- APC_CHANNEL_OFF: The APCs channel has been manually set to off. This channel will not automatically change.
- APC_CHANNEL_AUTO_OFF: The APCs channel is running on automatic and is currently off. Can be automatically set to APC_CHANNEL_AUTO_ON.
- APC_CHANNEL_ON: The APCs channel has been manually set to on. This will be automatically changed only if the APC runs completely out of power or is disabled.
- APC_CHANNEL_AUTO_ON: The APCs channel is running on automatic and is currently on. Can be automatically set to APC_CHANNEL_AUTO_OFF.
- on: An enum dictating how to change the channel's status.
- AUTOSET_FORCE_OFF: The APC forces the channel to turn off. This includes manually set channels.
- AUTOSET_ON: The APC allows automatic channels to turn back on.
- AUTOSET_OFF: The APC turns automatic channels off.
avail
Returns the amount of energy the terminal's grid has.
available_energy
Returns the surplus energy from the terminal's grid and the cell.
cable_act
Called when we interact with the APC with a cable, attempts to wire the APC and create a terminal
can_place_terminal
Checks if we can place a terminal on the APC
cell_act
Called when we interact with the APC with a cell, attempts to insert it
charge
Returns the cell's current charge.
check_updates
Checks for what icon updates we will need to handle
disconnect_remote_access
Disconnects anyone using this APC via an APC control console and locks the interface. arguments: mute - whether the APC should announce the disconnection locally
early_process
APC early processing. This gets processed after any other machine on the powernet does. This adds up the total static power usage for the apc's area, then draw that power usage from the grid or APC cell.
electronics_act
Called when we interact with the APC with APC electronics, attempts to install the board
ethereal_interact
Special behavior for when an ethereal interacts with an APC.
fork_outlet_act
Called when we interact with the APC with an item with which we can get shocked when we stuff it into an APC
give_away_general_access
Used for away_general_access apc helper, which set apc's required access to away_general_access.
give_syndicate_access
Used for syndicate_access apc helper, which sets apc's required access to syndicate_access.
install_cell_10k
Used for cell_10k apc helper, which installs 10k cell into apc.
install_cell_5k
Used for cell_5k apc helper, which installs 5k cell into apc.
pseudocircuit_act
Called when we interact with the APC with an electroadaptive pseudocircuit, used by cyborgs to install a board or weak cell
set_full_charge
Used for full_charge apc helper, which sets apc charge to 100%.
set_hacked_hud
Applies hacked overlay for malf AIs
set_no_charge
Used for no_charge apc helper, which sets apc charge to 0%.
setsubsystem
Used by external forces to set the APCs channel status's.
Arguments:
- val: The desired value of the subsystem:
- 1: Manually sets the APCs channel to be APC_CHANNEL_OFF.
- 2: Manually sets the APCs channel to be APC_CHANNEL_AUTO_ON. If the APC doesn't have any power this defaults to APC_CHANNEL_OFF instead.
- 3: Sets the APCs channel to be APC_CHANNEL_AUTO_ON. If the APC doesn't have enough power this defaults to APC_CHANNEL_AUTO_OFF instead.
surplus
Returns the surplus energy from the terminal's grid.
time_to_charge
Returns the amount of time it will take the APC at its current trickle charge rate to reach a charge level. If the APC is functionally not charging, returns null.
unlock
Used for unlocked apc helper, which unlocks the apc.
wallframe_act
Called when we interact with the APC with and APC frame, used for replacing a damaged cover/frame