Blast Doors will YEET you out of them to prevent repeated crushing.

Emags will double the range and speed at which you are YOTED.
This commit is contained in:
Rykka
2020-07-28 02:55:16 -04:00
parent e44cd29ec9
commit ae9cda220d
2 changed files with 14 additions and 2 deletions

View File

@@ -1085,6 +1085,7 @@ About the new airlock wires panel:
SetWeakened(5)
var/turf/T = get_turf(src)
T.add_blood(src)
return 1
/mob/living/carbon/airlock_crush(var/crush_damage)
. = ..()

View File

@@ -28,6 +28,7 @@
var/open_sound = 'sound/machines/blastdooropen.ogg'
var/close_sound = 'sound/machines/blastdoorclose.ogg'
var/damage = BLAST_DOOR_CRUSH_DAMAGE
var/multiplier = 1 // The multiplier for how powerful our YEET is.
closed_layer = ON_WINDOW_LAYER // Above airlocks when closed
var/id = 1.0
@@ -65,9 +66,13 @@
SSradiation.resistance_cache.Remove(get_turf(src))
return
// Has to be in here, comment at the top is older than the emag_act code on doors proper
// Proc: emag_act()
// Description: Emag action to allow blast doors to double their yeet distance and speed.
/obj/machinery/door/blast/emag_act()
return -1
if(!emagged)
emagged = 1
multiplier = 2 // Haha emag go yeet
return 1
// Blast doors are triggered remotely, so nobody is allowed to physically influence it.
/obj/machinery/door/blast/allowed(mob/M)
@@ -92,6 +97,10 @@
// Parameters: None
// Description: Closes the door. No checks are done inside this proc.
/obj/machinery/door/blast/proc/force_close()
// Blast door turf checks. We do this before the door closes to prevent it from failing after the door is closed, because obv a closed door will block any adjacency checks.
var/turf/T = get_turf(src)
var/list/yeet_turfs = T.CardinalTurfs(TRUE)
src.operating = 1
playsound(src, close_sound, 100, 1)
src.layer = closed_layer
@@ -107,6 +116,8 @@
for(var/turf/turf in locs)
for(var/atom/movable/AM in turf)
if(AM.airlock_crush(damage))
if(LAZYLEN(yeet_turfs))
AM.throw_at(get_edge_target_turf(src, get_dir(src, pick(yeet_turfs))), (rand(1,3) * multiplier), (rand(2,4) * multiplier)) // YEET.
take_damage(damage*0.2)
// Proc: force_toggle()