[MIRROR] some sleep cleanup (#11576)

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
Co-authored-by: C.L. <killer65311@gmail.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-09-06 22:21:45 -07:00
committed by GitHub
parent 4e0cff2289
commit a05bac2e8b
10 changed files with 74 additions and 70 deletions

View File

@@ -5,7 +5,7 @@
layer = ABOVE_WINDOW_LAYER
desc = "A remote control switch for something."
var/id = null
var/active = 0
var/active = FALSE
anchored = TRUE
use_power = USE_POWER_IDLE
idle_power_usage = 2

View File

@@ -14,10 +14,8 @@
var/in_range = range(src,range)
for(var/obj/structure/window/reinforced/polarized/W in in_range)
if(W.id == src.id || !W.id)
spawn(0)
W.toggle()
W.toggle()
for(var/obj/machinery/door/D in in_range)
if(D.icon_tinted)
if(D.id_tint == src.id || !D.id_tint)
spawn(0)
D.toggle()
D.toggle()

View File

@@ -51,8 +51,7 @@
icon_state = "doorctrl1"
desiredstate = !desiredstate
trigger(user)
spawn(15)
update_icon()
addtimer(CALLBACK(src, TYPE_PROC_REF(/atom, update_icon)), 1.5 SECONDS, TIMER_DELETE_ME|TIMER_UNIQUE)
/obj/machinery/button/remote/proc/trigger()
return
@@ -97,13 +96,11 @@
if(D.id_tag == id)
if(specialfunctions & OPEN)
if(D.density)
spawn(0)
D.open()
return
D.open()
return
else
spawn(0)
D.close()
return
D.close()
return
if(desiredstate == 1)
if(specialfunctions & IDSCAN)
D.set_idscan(0)
@@ -141,13 +138,11 @@
for(var/obj/machinery/door/blast/M in GLOB.machines)
if(M.id == id)
if(M.density)
spawn(0)
M.open()
return
M.open()
return
else
spawn(0)
M.close()
return
M.close()
return
//CHOMP Add start
/obj/machinery/button/remote/blast_door/bear
@@ -206,32 +201,36 @@
icon = 'icons/obj/objects.dmi'
icon_state = "launcherbtt"
/obj/machinery/button/remote/driver/trigger(mob/user as mob)
active = 1
/obj/machinery/button/remote/driver/trigger(mob/user)
if(active)
return
active = TRUE
update_icon()
for(var/obj/machinery/door/blast/M in GLOB.machines)
if(M.id == id)
M.open()
return
addtimer(CALLBACK(src, PROC_REF(trigger_step_one)), 2 SECONDS, TIMER_DELETE_ME|TIMER_UNIQUE)
sleep(20)
/obj/machinery/button/remote/driver/proc/trigger_step_one()
PRIVATE_PROC(TRUE)
for(var/obj/machinery/mass_driver/M in GLOB.machines)
if(M.id == id)
M.drive()
addtimer(CALLBACK(src, PROC_REF(trigger_step_two)), 5 SECONDS, TIMER_DELETE_ME|TIMER_UNIQUE)
sleep(50)
/obj/machinery/button/remote/driver/proc/trigger_step_two()
PRIVATE_PROC(TRUE)
for(var/obj/machinery/door/blast/M in GLOB.machines)
if(M.id == id)
M.close()
return
icon_state = "launcherbtt"
active = FALSE
update_icon()
return
/obj/machinery/button/remote/driver/update_icon()
if(!active || (stat & NOPOWER))
@@ -250,9 +249,8 @@
/obj/machinery/button/remote/shields/trigger(var/mob/user)
for(var/obj/machinery/shield_gen/SG in GLOB.machines)
if(SG.id == id)
spawn(0)
if(SG?.anchored)
SG.toggle()
if(SG?.anchored)
SG.toggle()
/obj/machinery/button/remote/airlock/release
icon = 'icons/obj/door_release.dmi'

View File

@@ -83,16 +83,19 @@
// Parameters: None
// Description: Opens the door. No checks are done inside this proc.
/obj/machinery/door/blast/proc/force_open()
src.operating = 1
operating = TRUE
playsound(src, open_sound, 100, 1)
flick(icon_state_opening, src)
src.density = FALSE
density = FALSE
update_nearby_tiles()
src.update_icon()
src.set_opacity(0)
sleep(15)
src.layer = open_layer
src.operating = 0
update_icon()
set_opacity(0)
addtimer(CALLBACK(src, PROC_REF(complete_force_open)), 1.5 SECONDS, TIMER_DELETE_ME|TIMER_UNIQUE)
/obj/machinery/door/blast/proc/complete_force_open()
PRIVATE_PROC(TRUE)
layer = open_layer
operating = FALSE
// Proc: force_close()
// Parameters: None
@@ -102,19 +105,22 @@
var/turf/T = get_turf(src)
var/list/yeet_turfs = T.CardinalTurfs(TRUE)
src.operating = 1
operating = TRUE
playsound(src, close_sound, 100, 1)
src.layer = closed_layer
layer = closed_layer
flick(icon_state_closing, src)
src.density = TRUE
density = TRUE
update_nearby_tiles()
src.update_icon()
if(src.istransparent)
src.set_opacity(0)
update_icon()
if(istransparent)
set_opacity(0)
else
src.set_opacity(1)
sleep(15)
src.operating = 0
set_opacity(1)
addtimer(CALLBACK(src, PROC_REF(complete_force_close), yeet_turfs), 1.5 SECONDS, TIMER_DELETE_ME|TIMER_UNIQUE)
/obj/machinery/door/blast/proc/complete_force_close(list/yeet_turfs)
PRIVATE_PROC(TRUE)
operating = FALSE
// Blast door crushing.
for(var/turf/turf in locs)

View File

@@ -144,6 +144,5 @@
for(var/obj/machinery/door/D in range(src,range))
if(D.icon_tinted && (D.id_tint == src.id || !D.id_tint))
spawn(0)
D.toggle()
return
D.toggle()
return

View File

@@ -149,17 +149,19 @@
use_power(5)
active = 1
if(active)
return
active = TRUE
icon_state = "launcheract"
for(var/obj/machinery/flasher/M in GLOB.machines)
if(M.id == id)
spawn()
M.flash()
M.flash()
sleep(50)
addtimer(CALLBACK(src, PROC_REF(finish_trigger)), 5 SECONDS, TIMER_DELETE_ME|TIMER_UNIQUE)
/obj/machinery/button/flasher/proc/finish_trigger()
PRIVATE_PROC(TRUE)
icon_state = "launcherbtt"
active = 0
return
active = FALSE

View File

@@ -76,8 +76,7 @@
for(var/obj/machinery/holosign/M in GLOB.machines)
if(M.id == id)
spawn(0)
M.toggle()
return
M.toggle()
return
return

View File

@@ -118,14 +118,17 @@
name = "ignition switch"
desc = "A remote control switch for a mounted igniter."
/obj/machinery/button/ignition/attack_hand(mob/user as mob)
/obj/machinery/button/ignition/attack_hand(mob/user)
if(..())
return
use_power(5)
active = 1
if(active)
return
active = TRUE
icon_state = "launcheract"
for(var/obj/machinery/sparker/M in GLOB.machines)
@@ -139,9 +142,10 @@
M.on = !(M.on)
M.icon_state = text("igniter[]", M.on)
sleep(50)
addtimer(CALLBACK(src, PROC_REF(finish_trigger)), 5 SECONDS, TIMER_DELETE_ME|TIMER_UNIQUE)
/obj/machinery/button/ignition/proc/finish_trigger()
PRIVATE_PROC(TRUE)
icon_state = "launcherbtt"
active = 0
return
active = FALSE

View File

@@ -67,8 +67,7 @@
for(var/obj/machinery/neonsign/M in GLOB.machines)
if(M.id == id)
spawn(0)
M.toggle()
return
M.toggle()
return
return

View File

@@ -670,9 +670,8 @@
for(var/obj/structure/window/reinforced/polarized/W in range(src,range))
if (W.id == src.id || !W.id)
spawn(0)
W.toggle()
return
W.toggle()
return
/obj/machinery/button/windowtint/power_change()
..()