mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-10 18:02:57 +00:00
Merge pull request #3553 from Citadel-Station-13/upstream-merge-31969
[MIRROR] Gets rids of spawns in airlock code
This commit is contained in:
@@ -246,14 +246,16 @@
|
|||||||
note = null
|
note = null
|
||||||
update_icon()
|
update_icon()
|
||||||
|
|
||||||
|
/obj/machinery/door/airlock/proc/unzap() //for addtimer
|
||||||
|
justzap = FALSE
|
||||||
|
|
||||||
/obj/machinery/door/airlock/bumpopen(mob/living/user) //Airlocks now zap you when you 'bump' them open when they're electrified. --NeoFite
|
/obj/machinery/door/airlock/bumpopen(mob/living/user) //Airlocks now zap you when you 'bump' them open when they're electrified. --NeoFite
|
||||||
if(!issilicon(usr))
|
if(!issilicon(usr))
|
||||||
if(src.isElectrified())
|
if(isElectrified())
|
||||||
if(!src.justzap)
|
if(!justzap)
|
||||||
if(src.shock(user, 100))
|
if(shock(user, 100))
|
||||||
src.justzap = TRUE
|
justzap = TRUE
|
||||||
spawn (10)
|
addtimer(CALLBACK(src, .proc/unzap), 10)
|
||||||
justzap = FALSE
|
|
||||||
return
|
return
|
||||||
else /*if(src.justzap)*/
|
else /*if(src.justzap)*/
|
||||||
return
|
return
|
||||||
@@ -325,33 +327,34 @@
|
|||||||
if(src.secondsMainPowerLost > 0)
|
if(src.secondsMainPowerLost > 0)
|
||||||
src.secondsMainPowerLost = 0
|
src.secondsMainPowerLost = 0
|
||||||
|
|
||||||
/obj/machinery/door/airlock/proc/loseMainPower()
|
/obj/machinery/door/airlock/proc/handlePowerRestore()
|
||||||
if(src.secondsMainPowerLost <= 0)
|
var/cont = TRUE
|
||||||
src.secondsMainPowerLost = 60
|
while (cont)
|
||||||
if(src.secondsBackupPowerLost < 10)
|
sleep(10)
|
||||||
src.secondsBackupPowerLost = 10
|
if(QDELETED(src))
|
||||||
if(!src.spawnPowerRestoreRunning)
|
return
|
||||||
spawnPowerRestoreRunning = TRUE
|
cont = FALSE
|
||||||
spawn(0)
|
if(secondsMainPowerLost>0)
|
||||||
var/cont = 1
|
if(!wires.is_cut(WIRE_POWER1) && !wires.is_cut(WIRE_POWER2))
|
||||||
while (cont)
|
secondsMainPowerLost -= 1
|
||||||
sleep(10)
|
updateDialog()
|
||||||
if(QDELETED(src))
|
cont = TRUE
|
||||||
return
|
if(secondsBackupPowerLost>0)
|
||||||
cont = 0
|
if(!wires.is_cut(WIRE_BACKUP1) && !wires.is_cut(WIRE_BACKUP2))
|
||||||
if(secondsMainPowerLost>0)
|
secondsBackupPowerLost -= 1
|
||||||
if(!wires.is_cut(WIRE_POWER1) && !wires.is_cut(WIRE_POWER2))
|
updateDialog()
|
||||||
secondsMainPowerLost -= 1
|
cont = TRUE
|
||||||
updateDialog()
|
spawnPowerRestoreRunning = FALSE
|
||||||
cont = 1
|
updateDialog()
|
||||||
|
|
||||||
if(secondsBackupPowerLost>0)
|
/obj/machinery/door/airlock/proc/loseMainPower()
|
||||||
if(!wires.is_cut(WIRE_BACKUP1) && !wires.is_cut(WIRE_BACKUP2))
|
if(secondsMainPowerLost <= 0)
|
||||||
secondsBackupPowerLost -= 1
|
secondsMainPowerLost = 60
|
||||||
updateDialog()
|
if(secondsBackupPowerLost < 10)
|
||||||
cont = 1
|
secondsBackupPowerLost = 10
|
||||||
spawnPowerRestoreRunning = FALSE
|
if(!spawnPowerRestoreRunning)
|
||||||
updateDialog()
|
spawnPowerRestoreRunning = TRUE
|
||||||
|
INVOKE_ASYNC(src, .proc/handlePowerRestore)
|
||||||
|
|
||||||
/obj/machinery/door/airlock/proc/loseBackupPower()
|
/obj/machinery/door/airlock/proc/loseBackupPower()
|
||||||
if(src.secondsBackupPowerLost < 60)
|
if(src.secondsBackupPowerLost < 60)
|
||||||
@@ -792,6 +795,13 @@
|
|||||||
..()
|
..()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
/obj/machinery/door/airlock/proc/electrified_loop()
|
||||||
|
while (secondsElectrified > 0)
|
||||||
|
secondsElectrified--
|
||||||
|
if(secondsElectrified <= 0)
|
||||||
|
set_electrified(NOT_ELECTRIFIED)
|
||||||
|
updateUsrDialog()
|
||||||
|
sleep(10)
|
||||||
|
|
||||||
/obj/machinery/door/airlock/Topic(href, href_list, var/nowindow = 0)
|
/obj/machinery/door/airlock/Topic(href, href_list, var/nowindow = 0)
|
||||||
// If you add an if(..()) check you must first remove the var/nowindow parameter.
|
// If you add an if(..()) check you must first remove the var/nowindow parameter.
|
||||||
@@ -936,13 +946,7 @@
|
|||||||
shockedby += "\[[time_stamp()]\][usr](ckey:[usr.ckey])"
|
shockedby += "\[[time_stamp()]\][usr](ckey:[usr.ckey])"
|
||||||
add_logs(usr, src, "electrified")
|
add_logs(usr, src, "electrified")
|
||||||
set_electrified(30)
|
set_electrified(30)
|
||||||
spawn(10)
|
addtimer(CALLBACK(src, .proc/electrified_loop), 10)
|
||||||
while (secondsElectrified > 0)
|
|
||||||
secondsElectrified--
|
|
||||||
if(secondsElectrified <= 0)
|
|
||||||
set_electrified(NOT_ELECTRIFIED)
|
|
||||||
updateUsrDialog()
|
|
||||||
sleep(10)
|
|
||||||
if(6)
|
if(6)
|
||||||
//electrify door indefinitely
|
//electrify door indefinitely
|
||||||
if(wires.is_cut(WIRE_SHOCK))
|
if(wires.is_cut(WIRE_SHOCK))
|
||||||
@@ -1266,19 +1270,11 @@
|
|||||||
if(!beingcrowbarred) //being fireaxe'd
|
if(!beingcrowbarred) //being fireaxe'd
|
||||||
var/obj/item/twohanded/fireaxe/F = I
|
var/obj/item/twohanded/fireaxe/F = I
|
||||||
if(F.wielded)
|
if(F.wielded)
|
||||||
spawn(0)
|
INVOKE_ASYNC(src, (density ? .proc/open : .proc/close), 2)
|
||||||
if(density)
|
|
||||||
open(2)
|
|
||||||
else
|
|
||||||
close(2)
|
|
||||||
else
|
else
|
||||||
to_chat(user, "<span class='warning'>You need to be wielding the fire axe to do that!</span>")
|
to_chat(user, "<span class='warning'>You need to be wielding the fire axe to do that!</span>")
|
||||||
else
|
else
|
||||||
spawn(0)
|
INVOKE_ASYNC(src, (density ? .proc/open : .proc/close), 2)
|
||||||
if(density)
|
|
||||||
open(2)
|
|
||||||
else
|
|
||||||
close(2)
|
|
||||||
|
|
||||||
if(istype(I, /obj/item/crowbar/power))
|
if(istype(I, /obj/item/crowbar/power))
|
||||||
if(isElectrified())
|
if(isElectrified())
|
||||||
|
|||||||
Reference in New Issue
Block a user