Fixes some stupid airlock sleeps (#75961)

## About The Pull Request

[A common problem with explosions is an overabundance of
sleeping](https://github.com/tgstation/tgstation/commit/6499077a09469ff401c224c0510bc184c663b118)

In an attempt to solve this issue, let's not continue to sleep and do
work in door closing if the door is already deleted

(This is caused by firelocks activating due to other adjacent objects
deleting, triggering an atmos update, and closing the firelocks before
they get bombed. I don't have a elegant way of resolving that core
problem, so let's just minimize the impact)

[Nukes a stupid sleep loop in airlock
code](https://github.com/tgstation/tgstation/commit/5b16360520526d6f5aa3b511049456b74f33f430)

When an airlock was depowered, it would enter a sleep loop, decrementing
its delay by 1 second every well, one second, so long as it had the
right wires flipped
This is very stupid

Instead, let's use signals off wire changes and a combo of timer and
remaining time var to do this with JUST a timer

Most of the changes here are just swapping over wires to a setter to
make signal registration work\

## Why It's Good For The Game

Less sleeping around explosions means less dropped ticks after a bomb
goes off. Good just in general
Also this excises dumb boomer code and adds some hooks for other devs to
use (we should use wires more man)
This commit is contained in:
LemonInTheDark
2023-06-18 19:18:48 -07:00
committed by GitHub
parent 1acba97c07
commit 830d2e50b4
32 changed files with 211 additions and 100 deletions
+8
View File
@@ -17,6 +17,14 @@
/// Until a condition is true, sleep
#define UNTIL(X) while(!(X)) stoplag()
/// Sleep if we haven't been deleted
/// Otherwise, return
#define SLEEP_NOT_DEL(time) \
if(QDELETED(src)) { \
return; \
} \
sleep(time);
#ifdef EXPERIMENT_515_DONT_CACHE_REF
/// Takes a datum as input, returns its ref string
#define text_ref(datum) ref(datum)
+4
View File
@@ -1,3 +1,7 @@
/// from base of /datum/wires/proc/cut : (wire)
#define COMSIG_CUT_WIRE(wire) "cut_wire [wire]"
#define COMSIG_MEND_WIRE(wire) "mend_wire [wire]"
//retvals for attempt_wires_interaction
#define WIRE_INTERACTION_FAIL 0
#define WIRE_INTERACTION_SUCCESSFUL 1
+4 -1
View File
@@ -116,7 +116,8 @@
randomize()
/datum/wires/proc/repair()
cut_wires.Cut()//a negative times a negative equals a positive
for(var/wire in cut_wires)
cut(wire) // I KNOW I KNOW OK
/datum/wires/proc/get_wire(color)
return colors[color]
@@ -155,9 +156,11 @@
/datum/wires/proc/cut(wire)
if(is_cut(wire))
cut_wires -= wire
SEND_SIGNAL(src, COMSIG_MEND_WIRE(wire), wire)
on_cut(wire, mend = TRUE)
else
cut_wires += wire
SEND_SIGNAL(src, COMSIG_CUT_WIRE(wire), wire)
on_cut(wire, mend = FALSE)
/datum/wires/proc/cut_color(color)
+4
View File
@@ -623,6 +623,10 @@
/atom/proc/HasProximity(atom/movable/proximity_check_mob as mob|obj)
return
/// Sets the wire datum of an atom
/atom/proc/set_wires(datum/wires/new_wires)
wires = new_wires
/**
* React to an EMP of the given severity
*
+1 -1
View File
@@ -24,7 +24,7 @@
/obj/machinery/autolathe/Initialize(mapload)
AddComponent(/datum/component/material_container, SSmaterials.materials_by_category[MAT_CATEGORY_ITEM_MATERIAL], 0, MATCONTAINER_EXAMINE, _after_insert = CALLBACK(src, PROC_REF(AfterMaterialInsert)))
. = ..()
wires = new /datum/wires/autolathe(src)
set_wires(new /datum/wires/autolathe(src))
if(!GLOB.autounlock_techwebs[/datum/techweb/autounlocking/autolathe])
GLOB.autounlock_techwebs[/datum/techweb/autounlocking/autolathe] = new /datum/techweb/autounlocking/autolathe
stored_research = GLOB.autounlock_techwebs[/datum/techweb/autounlocking/autolathe]
+156 -64
View File
@@ -97,26 +97,37 @@
///The type of door frame to drop during deconstruction
var/assemblytype = /obj/structure/door_assembly
var/security_level = 0 //How much are wires secured
var/aiControlDisabled = AI_WIRE_NORMAL //If 1, AI control is disabled until the AI hacks back in and disables the lock. If 2, the AI has bypassed the lock. If -1, the control is enabled but the AI had bypassed it earlier, so if it is disabled again the AI would have no trouble getting back in.
var/hackProof = FALSE // if true, this door can't be hacked by the AI
var/secondsMainPowerLost = 0 //The number of seconds until power is restored.
var/secondsBackupPowerLost = 0 //The number of seconds until power is restored.
var/spawnPowerRestoreRunning = FALSE
var/lights = TRUE // bolt lights show by default
/// How much are wires secured
var/security_level = 0
/// If 1, AI control is disabled until the AI hacks back in and disables the lock. If 2, the AI has bypassed the lock. If -1, the control is enabled but the AI had bypassed it earlier, so if it is disabled again the AI would have no trouble getting back in.
var/aiControlDisabled = AI_WIRE_NORMAL
/// If true, this door can't be hacked by the AI
var/hackProof = FALSE
/// Timer id, active when we are actively waiting for the main power to be restored
var/main_power_timer = 0
/// Paired with main_power_timer. Records its remaining time when something happens to interrupt power regen
var/main_power_time
/// Timer id, active when we are actively waiting for the backup power to be restored
var/backup_power_timer = 0
/// Paired with backup_power_timer. Records its remaining time when something happens to interrupt power regen
var/backup_power_time
/// Bolt lights show by default
var/lights = TRUE
var/aiDisabledIdScanner = FALSE
var/aiHacking = FALSE
var/closeOtherId //Cyclelinking for airlocks that aren't on the same x or y coord as the target.
/// Cyclelinking for airlocks that aren't on the same x or y coord as the target.
var/closeOtherId
var/obj/machinery/door/airlock/closeOther
var/list/obj/machinery/door/airlock/close_others = list()
var/obj/item/electronics/airlock/electronics
COOLDOWN_DECLARE(shockCooldown)
var/obj/item/note //Any papers pinned to the airlock
/// Any papers pinned to the airlock
var/obj/item/note
/// The seal on the airlock
var/obj/item/seal
var/detonated = FALSE
var/abandoned = FALSE
///Controls if the door closes quickly or not. FALSE = the door autocloses in 1.5 seconds, TRUE = 8 seconds - see autoclose_in()
/// Controls if the door closes quickly or not. FALSE = the door autocloses in 1.5 seconds, TRUE = 8 seconds - see autoclose_in()
var/normalspeed = TRUE
var/cutAiWire = FALSE
var/autoname = FALSE
@@ -126,20 +137,25 @@
var/boltUp = 'sound/machines/boltsup.ogg'
var/boltDown = 'sound/machines/boltsdown.ogg'
var/noPower = 'sound/machines/doorclick.ogg'
var/previous_airlock = /obj/structure/door_assembly //what airlock assembly mineral plating was applied to
var/airlock_material //material of inner filling; if its an airlock with glass, this should be set to "glass"
/// What airlock assembly mineral plating was applied to
var/previous_airlock = /obj/structure/door_assembly
/// Material of inner filling; if its an airlock with glass, this should be set to "glass"
var/airlock_material
var/overlays_file = 'icons/obj/doors/airlocks/station/overlays.dmi'
var/note_overlay_file = 'icons/obj/doors/airlocks/station/overlays.dmi' //Used for papers and photos pinned to the airlock
/// Used for papers and photos pinned to the airlock
var/note_overlay_file = 'icons/obj/doors/airlocks/station/overlays.dmi'
var/cyclelinkeddir = 0
var/obj/machinery/door/airlock/cyclelinkedairlock
var/shuttledocked = 0
var/delayed_close_requested = FALSE // TRUE means the door will automatically close the next time it's opened.
var/air_tight = FALSE //TRUE means density will be set as soon as the door begins to close
/// TRUE means the door will automatically close the next time it's opened.
var/delayed_close_requested = FALSE
/// TRUE means density will be set as soon as the door begins to close
var/air_tight = FALSE
var/prying_so_hard = FALSE
///Logging for door electrification.
/// Logging for door electrification.
var/shockedby
///How many seconds remain until the door is no longer electrified. -1/MACHINE_ELECTRIFIED_PERMANENT = permanently electrified until someone fixes it.
/// How many seconds remain until the door is no longer electrified. -1/MACHINE_ELECTRIFIED_PERMANENT = permanently electrified until someone fixes it.
var/secondsElectrified = MACHINE_NOT_ELECTRIFIED
flags_1 = HTML_USE_INITAL_ICON_1
@@ -147,7 +163,7 @@
/obj/machinery/door/airlock/Initialize(mapload)
. = ..()
wires = set_wires()
set_wires(get_wires())
if(glass)
airlock_material = "glass"
if(security_level > AIRLOCK_SECURITY_IRON)
@@ -317,7 +333,7 @@
return ((aiControlDisabled == AI_WIRE_DISABLED) && (!hackProof) && (!isAllPowerCut()));
/obj/machinery/door/airlock/hasPower()
return ((!secondsMainPowerLost || !secondsBackupPowerLost) && !(machine_stat & NOPOWER))
return ((!remaining_main_outage() || !remaining_backup_outage()) && !(machine_stat & NOPOWER))
/obj/machinery/door/airlock/requiresID()
return !(wires.is_cut(WIRE_IDSCAN) || aiDisabledIdScanner)
@@ -326,51 +342,127 @@
if((wires.is_cut(WIRE_POWER1) || wires.is_cut(WIRE_POWER2)) && (wires.is_cut(WIRE_BACKUP1) || wires.is_cut(WIRE_BACKUP2)))
return TRUE
/obj/machinery/door/airlock/proc/regainMainPower()
if(secondsMainPowerLost > 0)
secondsMainPowerLost = 0
update_appearance()
/// Returns the amount of time we have to wait before main power comes back
/// Assuming it was actively regenerating
/// Returns 0 if it is active
/obj/machinery/door/airlock/proc/remaining_main_outage()
if(main_power_timer)
return timeleft(main_power_timer)
return main_power_time
/obj/machinery/door/airlock/proc/handlePowerRestore()
var/cont = TRUE
while (cont)
sleep(1 SECONDS)
if(QDELETED(src))
return
cont = FALSE
if(secondsMainPowerLost>0)
if(!wires.is_cut(WIRE_POWER1) && !wires.is_cut(WIRE_POWER2))
secondsMainPowerLost -= 1
cont = TRUE
if(secondsBackupPowerLost>0)
if(!wires.is_cut(WIRE_BACKUP1) && !wires.is_cut(WIRE_BACKUP2))
secondsBackupPowerLost -= 1
cont = TRUE
spawnPowerRestoreRunning = FALSE
update_appearance()
/// Returns the amount of time we have to wait before backup power comes back
/// Assuming it was actively regenerating
/// Returns 0 if it is active
/obj/machinery/door/airlock/proc/remaining_backup_outage()
if(backup_power_timer)
return timeleft(backup_power_timer)
return backup_power_time
/obj/machinery/door/airlock/proc/set_main_outage(delay)
// Clear out the timer so we don't accidentially take from it later
if(main_power_timer)
deltimer(main_power_timer)
main_power_timer = null
var/old_time = main_power_time
main_power_time = delay
handle_main_power()
if(!!old_time != !!delay)
update_appearance()
/obj/machinery/door/airlock/proc/set_backup_outage(delay)
// Clear out the timer so we don't accidentially take from it later
if(backup_power_timer)
deltimer(backup_power_timer)
backup_power_timer = null
var/old_time = backup_power_time
backup_power_time = delay
handle_backup_power()
if(!!old_time != !!delay)
update_appearance()
/// Call to update our main power outage timer
/// Will trigger a proper timer if we're actively restoring power, if not we'll dump the remaining time in a var on the airlock
/obj/machinery/door/airlock/proc/handle_main_power()
if(main_power_time <= 0)
deltimer(main_power_timer)
main_power_timer = null
return
// If we can, we'll start a timer that hits when we're done
if(!wires.is_cut(WIRE_POWER1) && !wires.is_cut(WIRE_POWER2))
if(!main_power_timer || timeleft(main_power_timer) != main_power_time)
main_power_timer = addtimer(CALLBACK(src, PROC_REF(regainMainPower)), main_power_time, TIMER_UNIQUE|TIMER_OVERRIDE|TIMER_STOPPABLE|TIMER_DELETE_ME)
// Otherwise, we'll ensure the timer matches main_power_time
else if(main_power_timer)
main_power_time = timeleft(main_power_timer)
deltimer(main_power_timer)
main_power_timer = null
/// Call to update our backup power outage timer
/// Will trigger a proper timer if we're actively restoring power, if not we'll dump the remaining time in a var on the airlock
/obj/machinery/door/airlock/proc/handle_backup_power()
if(backup_power_time <= 0)
deltimer(backup_power_timer)
backup_power_timer = null
return
// If we can, we'll start a timer that hits when we're done
if(!wires.is_cut(WIRE_BACKUP1) && !wires.is_cut(WIRE_BACKUP2))
if(!backup_power_timer || timeleft(backup_power_timer) != backup_power_time)
backup_power_timer = addtimer(CALLBACK(src, PROC_REF(regainBackupPower)), backup_power_time, TIMER_UNIQUE|TIMER_OVERRIDE|TIMER_STOPPABLE|TIMER_DELETE_ME)
// Otherwise, we'll ensure the timer matches backup_power_time
else if(backup_power_timer)
backup_power_time = timeleft(backup_power_timer)
deltimer(backup_power_timer)
backup_power_timer = null
// Alright, we're gonna do a meme here
/obj/machinery/door/airlock/set_wires(datum/wires/new_wires)
if(wires)
UnregisterSignal(wires, list(
COMSIG_CUT_WIRE(WIRE_POWER1),
COMSIG_CUT_WIRE(WIRE_POWER2),
COMSIG_CUT_WIRE(WIRE_BACKUP1),
COMSIG_CUT_WIRE(WIRE_BACKUP2),
COMSIG_MEND_WIRE(WIRE_POWER1),
COMSIG_MEND_WIRE(WIRE_POWER2),
COMSIG_MEND_WIRE(WIRE_BACKUP1),
COMSIG_MEND_WIRE(WIRE_BACKUP2),
))
. = ..()
if(new_wires)
RegisterSignals(new_wires, list(
COMSIG_CUT_WIRE(WIRE_POWER1),
COMSIG_CUT_WIRE(WIRE_POWER2),
COMSIG_CUT_WIRE(WIRE_BACKUP1),
COMSIG_CUT_WIRE(WIRE_BACKUP2),
COMSIG_MEND_WIRE(WIRE_POWER1),
COMSIG_MEND_WIRE(WIRE_POWER2),
COMSIG_MEND_WIRE(WIRE_BACKUP1),
COMSIG_MEND_WIRE(WIRE_BACKUP2),
), PROC_REF(power_wires_changed))
/// If our power wires have changed, then our backup/main power regen may have failed, so let's just check in yeah?
/obj/machinery/door/airlock/proc/power_wires_changed(datum/source, wire)
SIGNAL_HANDLER
handle_main_power()
handle_backup_power()
/obj/machinery/door/airlock/proc/regainMainPower()
set_main_outage(0 SECONDS)
/obj/machinery/door/airlock/proc/loseMainPower()
if(secondsMainPowerLost <= 0)
secondsMainPowerLost = 60
if(secondsBackupPowerLost < 10)
secondsBackupPowerLost = 10
if(!spawnPowerRestoreRunning)
spawnPowerRestoreRunning = TRUE
INVOKE_ASYNC(src, PROC_REF(handlePowerRestore))
update_appearance()
if(!remaining_main_outage())
set_main_outage(60 SECONDS)
if(remaining_backup_outage() < 10 SECONDS)
set_backup_outage(10 SECONDS)
/obj/machinery/door/airlock/proc/loseBackupPower()
if(secondsBackupPowerLost < 60)
secondsBackupPowerLost = 60
if(!spawnPowerRestoreRunning)
spawnPowerRestoreRunning = TRUE
INVOKE_ASYNC(src, PROC_REF(handlePowerRestore))
update_appearance()
if(remaining_backup_outage() < 60 SECONDS)
set_backup_outage(60 SECONDS)
/obj/machinery/door/airlock/proc/regainBackupPower()
if(secondsBackupPowerLost > 0)
secondsBackupPowerLost = 0
update_appearance()
set_backup_outage(0 SECONDS)
// shock user with probability prb (if all connections & power are working)
// returns TRUE if shocked, FALSE otherwise
@@ -1476,10 +1568,10 @@
var/list/data = list()
var/list/power = list()
power["main"] = secondsMainPowerLost ? 0 : 2 // boolean
power["main_timeleft"] = secondsMainPowerLost
power["backup"] = secondsBackupPowerLost ? 0 : 2 // boolean
power["backup_timeleft"] = secondsBackupPowerLost
power["main"] = remaining_main_outage() ? 0 : 2 // boolean
power["main_timeleft"] = remaining_main_outage()
power["backup"] = remaining_backup_outage() ? 0 : 2 // boolean
power["backup_timeleft"] = remaining_backup_outage()
data["power"] = power
data["shock"] = secondsElectrified == MACHINE_NOT_ELECTRIFIED ? 2 : 0
@@ -1517,14 +1609,14 @@
return
switch(action)
if("disrupt-main")
if(!secondsMainPowerLost)
if(remaining_main_outage())
loseMainPower()
update_appearance()
else
to_chat(usr, span_warning("Main power is already offline."))
. = TRUE
if("disrupt-backup")
if(!secondsBackupPowerLost)
if(remaining_backup_outage())
loseBackupPower()
update_appearance()
else
@@ -1629,7 +1721,7 @@
* Returns a new /datum/wires/ with the appropriate wire layout based on the airlock_wires
* of the area the airlock is in.
*/
/obj/machinery/door/airlock/proc/set_wires()
/obj/machinery/door/airlock/proc/get_wires()
var/area/source_area = get_area(src)
return source_area?.airlock_wires ? new source_area.airlock_wires(src) : new /datum/wires/airlock(src)
+4 -4
View File
@@ -382,10 +382,10 @@
use_power(active_power_usage)
do_animate("opening")
set_opacity(0)
sleep(0.5 SECONDS)
SLEEP_NOT_DEL(0.5 SECONDS)
set_density(FALSE)
flags_1 &= ~PREVENT_CLICK_UNDER_1
sleep(0.5 SECONDS)
SLEEP_NOT_DEL(0.5 SECONDS)
layer = initial(layer)
update_appearance()
set_opacity(0)
@@ -419,10 +419,10 @@
do_animate("closing")
layer = closingLayer
sleep(0.5 SECONDS)
SLEEP_NOT_DEL(0.5 SECONDS)
set_density(TRUE)
flags_1 |= PREVENT_CLICK_UNDER_1
sleep(0.5 SECONDS)
SLEEP_NOT_DEL(0.5 SECONDS)
update_appearance()
if(visible && !glass)
set_opacity(1)
+1 -1
View File
@@ -16,7 +16,7 @@
/obj/machinery/ecto_sniffer/Initialize(mapload)
. = ..()
wires = new/datum/wires/ecto_sniffer(src)
set_wires(new/datum/wires/ecto_sniffer(src))
/obj/machinery/ecto_sniffer/attack_ghost(mob/user)
. = ..()
+1 -1
View File
@@ -99,7 +99,7 @@
/obj/machinery/modular_shield_generator/Initialize(mapload)
. = ..()
wires = new /datum/wires/modular_shield_generator(src)
set_wires(new /datum/wires/modular_shield_generator(src))
if(mapload && active && anchored)
activate_shields()
+1 -1
View File
@@ -58,7 +58,7 @@
/obj/machinery/roulette/Initialize(mapload)
. = ..()
jackpot_loop = new(src, FALSE)
wires = new /datum/wires/roulette(src)
set_wires(new /datum/wires/roulette(src))
/obj/machinery/roulette/Destroy()
QDEL_NULL(jackpot_loop)
+2 -2
View File
@@ -49,7 +49,7 @@
/obj/machinery/scanner_gate/Initialize(mapload)
. = ..()
wires = new /datum/wires/scanner_gate(src)
set_wires(new /datum/wires/scanner_gate(src))
set_scanline("passive")
var/static/list/loc_connections = list(
COMSIG_ATOM_ENTERED = PROC_REF(on_entered),
@@ -58,7 +58,7 @@
/obj/machinery/scanner_gate/Destroy()
qdel(wires)
wires = null
set_wires(null)
. = ..()
/obj/machinery/scanner_gate/examine(mob/user)
+1 -1
View File
@@ -172,7 +172,7 @@
. = ..()
set_access()
wires = new /datum/wires/suit_storage_unit(src)
set_wires(new /datum/wires/suit_storage_unit(src))
if(suit_type)
suit = new suit_type(src)
if(helmet_type)
+1 -1
View File
@@ -99,7 +99,7 @@
/obj/machinery/syndicatebomb/Initialize(mapload)
. = ..()
wires = new /datum/wires/syndicatebomb(src)
set_wires(new /datum/wires/syndicatebomb(src))
if(payload)
payload = new payload(src)
update_appearance()
@@ -91,7 +91,7 @@
VAR_PRIVATE/should_update_icon = FALSE
/obj/item/radio/Initialize(mapload)
wires = new /datum/wires/radio(src)
set_wires(new /datum/wires/radio(src))
secure_radio_connections = list()
. = ..()
@@ -32,7 +32,7 @@
AddElement(/datum/element/empprotection, EMP_PROTECT_WIRES)
create_reagents(casing_holder_volume)
stage_change() // If no argument is set, it will change the stage to the current stage, useful for stock grenades that start READY.
wires = new /datum/wires/explosive/chem_grenade(src)
set_wires(new /datum/wires/explosive/chem_grenade(src))
/obj/item/grenade/chem_grenade/Destroy(force)
QDEL_NULL(wires)
+2 -2
View File
@@ -27,11 +27,11 @@
. = ..()
AddElement(/datum/element/empprotection, EMP_PROTECT_WIRES)
plastic_overlay = mutable_appearance(icon, "[inhand_icon_state]2", HIGH_OBJ_LAYER)
wires = new /datum/wires/explosive/c4(src)
set_wires(new /datum/wires/explosive/c4(src))
/obj/item/grenade/c4/Destroy()
qdel(wires)
wires = null
set_wires(null)
target = null
return ..()
@@ -85,7 +85,7 @@ GLOBAL_LIST_EMPTY_TYPED(air_alarms, /obj/machinery/airalarm)
/obj/machinery/airalarm/Initialize(mapload, ndir, nbuild)
. = ..()
wires = new /datum/wires/airalarm(src)
set_wires(new /datum/wires/airalarm(src))
if(ndir)
setDir(ndir)
@@ -51,7 +51,7 @@
/obj/machinery/microwave/Initialize(mapload)
. = ..()
wires = new /datum/wires/microwave(src)
set_wires(new /datum/wires/microwave(src))
create_reagents(100)
soundloop = new(src, FALSE)
update_appearance(UPDATE_ICON)
+3 -3
View File
@@ -221,7 +221,7 @@
if(open && !bomb)
if(!user.transferItemToLoc(I, src))
return
wires = new /datum/wires/explosive/pizza(src)
set_wires(new /datum/wires/explosive/pizza(src))
register_bomb(I)
balloon_alert(user, "bomb placed")
update_appearance()
@@ -300,7 +300,7 @@
/obj/item/pizzabox/proc/unprocess()
STOP_PROCESSING(SSobj, src)
qdel(wires)
wires = null
set_wires(null)
update_appearance()
/obj/item/pizzabox/bomb/Initialize(mapload)
@@ -309,7 +309,7 @@
var/randompizza = pick(subtypesof(/obj/item/food/pizza))
pizza = new randompizza(src)
register_bomb(new /obj/item/bombcore/miniature/pizza(src))
wires = new /datum/wires/explosive/pizza(src)
set_wires(new /datum/wires/explosive/pizza(src))
/obj/item/pizzabox/bomb/armed
bomb_timer = 5
@@ -235,7 +235,7 @@ GLOBAL_LIST_EMPTY(security_officer_distribution)
/obj/item/radio/headset/headset_sec/alt/department/Initialize(mapload)
. = ..()
wires = new/datum/wires/radio(src)
set_wires(new/datum/wires/radio(src))
secure_radio_connections = list()
recalculateChannels()
+2 -2
View File
@@ -245,13 +245,13 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
/obj/item/gibtonite/Destroy()
qdel(wires)
wires = null
set_wires(null)
return ..()
/obj/item/gibtonite/attackby(obj/item/I, mob/user, params)
if(!wires && isigniter(I))
user.visible_message(span_notice("[user] attaches [I] to [src]."), span_notice("You attach [I] to [src]."))
wires = new /datum/wires/explosive/gibtonite(src)
set_wires(new /datum/wires/explosive/gibtonite(src))
attacher = key_name(user)
qdel(I)
add_overlay("Gibtonite_igniter")
@@ -14,7 +14,7 @@
roleplay_emotes = list(/datum/emote/silicon/buzz, /datum/emote/silicon/buzz2, /datum/emote/living/beep), \
roleplay_callback = CALLBACK(src, PROC_REF(untip_roleplay)))
wires = new /datum/wires/robot(src)
set_wires(new /datum/wires/robot(src))
AddElement(/datum/element/empprotection, EMP_PROTECT_WIRES)
AddElement(/datum/element/ridable, /datum/component/riding/creature/cyborg)
RegisterSignal(src, COMSIG_PROCESS_BORGCHARGER_OCCUPANT, PROC_REF(charge))
@@ -68,7 +68,7 @@
if(prob(0.666) && mapload)
new /mob/living/simple_animal/bot/mulebot/paranormal(loc)
return INITIALIZE_HINT_QDEL
wires = new /datum/wires/mulebot(src)
set_wires(new /datum/wires/mulebot(src))
// Doing this hurts my soul, but simplebot access reworks are for another day.
var/datum/id_trim/job/cargo_trim = SSid_access.trim_singletons_by_path[/datum/id_trim/job/cargo_technician]
+1 -1
View File
@@ -105,7 +105,7 @@
complexity_max = theme.complexity_max
ui_theme = theme.ui_theme
charge_drain = theme.charge_drain
wires = new /datum/wires/mod(src)
set_wires(new /datum/wires/mod(src))
if(length(req_access))
locked = TRUE
new_core?.install(src)
+1 -1
View File
@@ -61,7 +61,7 @@ GLOBAL_VAR_INIT(nt_fax_department, pick("NT HR Department", "NT Legal Department
fax_id = assign_random_name()
if (!fax_name)
fax_name = "Unregistered fax " + fax_id
wires = new /datum/wires/fax(src)
set_wires(new /datum/wires/fax(src))
register_context()
special_networks["nanotrasen"]["fax_name"] = GLOB.nt_fax_department
+1 -1
View File
@@ -175,7 +175,7 @@
name = "\improper [get_area_name(area, TRUE)] APC"
//Initialize its electronics
wires = new /datum/wires/apc(src)
set_wires(new /datum/wires/apc(src))
alarm_manager = new(src)
AddElement(/datum/element/atmos_sensitive, mapload)
// for apcs created during map load make them fully functional
+1 -1
View File
@@ -60,7 +60,7 @@
/obj/machinery/power/emitter/Initialize(mapload)
. = ..()
RefreshParts()
wires = new /datum/wires/emitter(src)
set_wires(new /datum/wires/emitter(src))
if(welded)
if(!anchored)
set_anchored(TRUE)
+1 -1
View File
@@ -36,7 +36,7 @@
/obj/machinery/power/energy_accumulator/tesla_coil/Initialize(mapload)
. = ..()
wires = new /datum/wires/tesla_coil(src)
set_wires(new /datum/wires/tesla_coil(src))
/obj/machinery/power/energy_accumulator/tesla_coil/RefreshParts()
. = ..()
+1 -1
View File
@@ -334,7 +334,7 @@ GLOBAL_LIST_EMPTY(conveyors_by_id)
update_appearance()
LAZYADD(GLOB.conveyors_by_id[id], src)
wires = new /datum/wires/conveyor(src)
set_wires(new /datum/wires/conveyor(src))
AddComponent(/datum/component/usb_port, list(
/obj/item/circuit_component/conveyor_switch,
))
+1 -1
View File
@@ -22,7 +22,7 @@
. = ..()
if(!CONFIG_GET(flag/no_default_techweb_link) && !stored_research)
connect_techweb(SSresearch.science_tech)
wires = new /datum/wires/rnd(src)
set_wires(new /datum/wires/rnd(src))
/obj/machinery/rnd/Destroy()
if(stored_research)
+1 -1
View File
@@ -206,7 +206,7 @@
circuit = null
build_inv = TRUE
. = ..()
wires = new /datum/wires/vending(src)
set_wires(new /datum/wires/vending(src))
if(SStts.tts_enabled)
var/static/vendor_voice_by_type = list()
+1 -1
View File
@@ -35,7 +35,7 @@
return TRUE
return isAdminGhostAI(user)
/obj/machinery/door/airlock/shell/set_wires()
/obj/machinery/door/airlock/shell/get_wires()
return new /datum/wires/airlock/shell(src)
/obj/item/circuit_component/airlock