mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-25 22:19:30 +01:00
electrified airlock fixes (#52699)
* Airlock zap fixes * cleanup * jaws of life * removed redundant just_zap var, handled by cooldown checks. * comments * cleanup healper
This commit is contained in:
@@ -66,7 +66,6 @@
|
||||
var/aiHacking = FALSE
|
||||
var/closeOtherId //Cyclelinking for airlocks that aren't on the same x or y coord as the target.
|
||||
var/obj/machinery/door/airlock/closeOther
|
||||
var/justzap = FALSE
|
||||
var/obj/item/electronics/airlock/electronics
|
||||
COOLDOWN_DECLARE(shockCooldown)
|
||||
var/obj/item/note //Any papers pinned to the airlock
|
||||
@@ -305,21 +304,13 @@
|
||||
|
||||
/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(shock(user, 100))
|
||||
justzap = TRUE
|
||||
addtimer(VARSET_CALLBACK(src, justzap, FALSE) , 10)
|
||||
return
|
||||
else
|
||||
if(isElectrified() && shock(user, 100))
|
||||
return
|
||||
else if(user.hallucinating() && iscarbon(user) && prob(1) && !operating)
|
||||
var/mob/living/carbon/C = user
|
||||
if(!C.wearing_shock_proof_gloves())
|
||||
new /datum/hallucination/shock(C)
|
||||
return
|
||||
else if(user.hallucinating() && ishuman(user) && prob(1) && !operating)
|
||||
var/mob/living/carbon/human/H = user
|
||||
if(H.gloves)
|
||||
var/obj/item/clothing/gloves/G = H.gloves
|
||||
if(G.siemens_coefficient)//not insulated
|
||||
new /datum/hallucination/shock(H)
|
||||
return
|
||||
if (cyclelinkedairlock)
|
||||
if (!shuttledocked && !emergency && !cyclelinkedairlock.shuttledocked && !cyclelinkedairlock.emergency && allowed(user))
|
||||
if(cyclelinkedairlock.operating)
|
||||
@@ -329,9 +320,7 @@
|
||||
..()
|
||||
|
||||
/obj/machinery/door/airlock/proc/isElectrified()
|
||||
if(secondsElectrified != MACHINE_NOT_ELECTRIFIED)
|
||||
return TRUE
|
||||
return FALSE
|
||||
return (secondsElectrified != MACHINE_NOT_ELECTRIFIED)
|
||||
|
||||
/obj/machinery/door/airlock/proc/canAIControl(mob/user)
|
||||
return ((aiControlDisabled != 1) && !isAllPowerCut())
|
||||
@@ -721,9 +710,9 @@
|
||||
attack_ai(user)
|
||||
|
||||
/obj/machinery/door/airlock/attack_animal(mob/user)
|
||||
. = ..()
|
||||
if(isElectrified())
|
||||
shock(user, 100)
|
||||
if(isElectrified() && shock(user, 100))
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/machinery/door/airlock/attack_paw(mob/user)
|
||||
return attack_hand(user)
|
||||
@@ -733,9 +722,8 @@
|
||||
if(.)
|
||||
return
|
||||
if(!(issilicon(user) || isAdminGhostAI(user)))
|
||||
if(isElectrified())
|
||||
if(shock(user, 100))
|
||||
return
|
||||
if(isElectrified() && shock(user, 100))
|
||||
return
|
||||
|
||||
if(ishuman(user) && prob(40) && density)
|
||||
var/mob/living/carbon/human/H = user
|
||||
@@ -791,9 +779,8 @@
|
||||
|
||||
/obj/machinery/door/airlock/attackby(obj/item/C, mob/user, params)
|
||||
if(!issilicon(user) && !isAdminGhostAI(user))
|
||||
if(isElectrified())
|
||||
if(shock(user, 75))
|
||||
return
|
||||
if(isElectrified() && shock(user, 75))
|
||||
return
|
||||
add_fingerprint(user)
|
||||
|
||||
if(panel_open)
|
||||
@@ -997,9 +984,9 @@
|
||||
return
|
||||
if(hasPower())
|
||||
if(forced)
|
||||
if(isElectrified())
|
||||
shock(user,100)//it's like sticking a forck in a power socket
|
||||
return
|
||||
var/check_electrified = isElectrified() //setting this so we can check if the mob got shocked during the do_after below
|
||||
if(check_electrified && shock(user,100))
|
||||
return //it's like sticking a fork in a power socket
|
||||
|
||||
if(!density)//already open
|
||||
return
|
||||
@@ -1009,6 +996,9 @@
|
||||
playsound(src, 'sound/machines/airlock_alien_prying.ogg', 100, TRUE) //is it aliens or just the CE being a dick?
|
||||
prying_so_hard = TRUE
|
||||
if(do_after(user, time_to_open, TRUE, src))
|
||||
if(check_electrified && shock(user,100))
|
||||
prying_so_hard = FALSE
|
||||
return
|
||||
open(2)
|
||||
if(density && !open(2))
|
||||
to_chat(user, "<span class='warning'>Despite your attempts, [src] refuses to open.</span>")
|
||||
@@ -1177,9 +1167,8 @@
|
||||
loseBackupPower()
|
||||
|
||||
/obj/machinery/door/airlock/attack_alien(mob/living/carbon/alien/humanoid/user)
|
||||
if(isElectrified())
|
||||
if(isElectrified() && shock(user, 100)) //Mmm, fried xeno!
|
||||
add_fingerprint(user)
|
||||
shock(user, 100) //Mmm, fried xeno!
|
||||
return
|
||||
if(!density) //Already open
|
||||
return ..()
|
||||
|
||||
@@ -322,7 +322,7 @@
|
||||
|
||||
if(victim.wearing_shock_proof_gloves())
|
||||
SEND_SIGNAL(victim, COMSIG_LIVING_SHOCK_PREVENTED, power_source, source, siemens_coeff, dist_check)
|
||||
return FALSE //to avoid spamming with insulated glvoes on
|
||||
return FALSE //to avoid spamming with insulated gloves on
|
||||
|
||||
var/list/powernet_info = get_powernet_info_from_source(power_source)
|
||||
if (!powernet_info)
|
||||
|
||||
Reference in New Issue
Block a user