mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-22 11:38:12 +01:00
Update assemblies to modern coding standards
This commit is contained in:
@@ -14,14 +14,14 @@
|
||||
|
||||
|
||||
/obj/item/device/assembly/timer/activate()
|
||||
if(!..()) return 0//Cooldown check
|
||||
if(!..())
|
||||
return FALSE
|
||||
|
||||
timing = !timing
|
||||
|
||||
update_icon()
|
||||
return 0
|
||||
|
||||
|
||||
/obj/item/device/assembly/timer/toggle_secure()
|
||||
secured = !secured
|
||||
if(secured)
|
||||
@@ -32,27 +32,25 @@
|
||||
update_icon()
|
||||
return secured
|
||||
|
||||
/obj/item/device/assembly/timer/proc/set_state(var/state)
|
||||
if(state && !timing) //Not running, starting though
|
||||
START_PROCESSING(SSobj, src)
|
||||
else if(timing && !state) //Running, stopping though
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
timing = state
|
||||
|
||||
/obj/item/device/assembly/timer/proc/timer_end()
|
||||
if(!secured) return 0
|
||||
if(!secured)
|
||||
return 0
|
||||
pulse(0)
|
||||
if(!holder)
|
||||
visible_message("[bicon(src)] *beep* *beep*", "*beep* *beep*")
|
||||
cooldown = 2
|
||||
spawn(10)
|
||||
process_cooldown()
|
||||
return
|
||||
|
||||
|
||||
/obj/item/device/assembly/timer/process()
|
||||
if(timing && (time > 0))
|
||||
time--
|
||||
if(timing && time <= 0)
|
||||
timing = 0
|
||||
if(timing && time-- <= 0)
|
||||
set_state(0)
|
||||
timer_end()
|
||||
time = 10
|
||||
return
|
||||
|
||||
|
||||
/obj/item/device/assembly/timer/update_icon()
|
||||
overlays.Cut()
|
||||
@@ -87,7 +85,8 @@
|
||||
return
|
||||
|
||||
if(href_list["time"])
|
||||
timing = text2num(href_list["time"])
|
||||
var/new_timing = text2num(href_list["time"])
|
||||
set_state(new_timing)
|
||||
update_icon()
|
||||
|
||||
if(href_list["tp"])
|
||||
|
||||
Reference in New Issue
Block a user