You can no longer cheese open shocked doors (#21573)

* You can no longer cheese open shocked doors

* Update code/game/machinery/doors/airlock.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>

* TRUE // FALSE // MAYBE

---------

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
This commit is contained in:
Qwertytoforty
2023-07-17 15:20:23 +01:00
committed by GitHub
co-authored by Luc
parent 8aceaeba5d
commit fb0dc75943
+14 -7
View File
@@ -77,7 +77,6 @@ GLOBAL_LIST_EMPTY(airlock_emissive_underlays)
var/aiHacking = FALSE
var/obj/machinery/door/airlock/closeOther
var/closeOtherId
var/justzap = FALSE
var/obj/item/airlock_electronics/electronics
var/shockCooldown = FALSE //Prevents multiple shocks from happening
var/obj/item/note //Any papers pinned to the airlock
@@ -192,11 +191,8 @@ GLOBAL_LIST_EMPTY(airlock_emissive_underlays)
/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(isElectrified())
if(!justzap)
if(shockCooldown <= world.time)
if(shock(user, 100))
justzap = TRUE
spawn (10)
justzap = FALSE
return
else
return
@@ -312,14 +308,25 @@ GLOBAL_LIST_EMPTY(airlock_emissive_underlays)
if(shockCooldown > world.time)
return FALSE //Already shocked someone recently?
if(..())
shockCooldown = world.time + 2 SECONDS
shockCooldown = world.time + 1 SECONDS //Time must be lowered from 2 seconds due to bump, bump was only 1 second.
return TRUE
else
return FALSE
//Checks if the user can get shocked and shocks him if it can. Returns TRUE if it happened
/obj/machinery/door/airlock/proc/shock_user(mob/user, prob)
return (!issilicon(user) && isElectrified() && shock(user, prob))
var/output = !issilicon(user) && isElectrified() && shock(user, prob)
if(output)
return TRUE //We got shocked, end of story
if(issilicon(user))
return FALSE //Borgs don't get door shocked
if(ishuman(user) && isElectrified()) //We don't want people without insulated gloves able to open doors.
var/mob/living/carbon/human/H = user
if(H.gloves)
var/obj/item/clothing/gloves/G = H.gloves
if(G.siemens_coefficient == 0)
return FALSE
return TRUE
/obj/machinery/door/airlock/toggle_polarization()
polarized_on = !polarized_on