From c2ac804dc090fe2724f2a25db7c0ee735d80bc59 Mon Sep 17 00:00:00 2001 From: Anewbe Date: Sun, 15 Jan 2017 17:42:05 -0600 Subject: [PATCH] Implements the vacuum traversal part of the plasmastun --- code/modules/projectiles/projectile.dm | 6 ++++++ code/modules/projectiles/projectile/energy.dm | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/code/modules/projectiles/projectile.dm b/code/modules/projectiles/projectile.dm index 484c1e01636..750164a2602 100644 --- a/code/modules/projectiles/projectile.dm +++ b/code/modules/projectiles/projectile.dm @@ -65,6 +65,8 @@ var/tracer_type var/impact_type + var/vacuum_traversal = 1 //Determines if the projectile can exist in vacuum, if false, the projectile will be deleted if it enters vacuum. + var/datum/plot_vector/trajectory // used to plot the path of the projectile var/datum/vector_loc/location // current location of the projectile in pixel space var/matrix/effect_transform // matrix to rotate and scale projectile effects - putting it here so it doesn't @@ -300,6 +302,10 @@ qdel(src) // if it's left the world... kill it return + if (is_below_sound_pressure(get_turf(src)) && !vacuum_traversal) //Deletes projectiles that aren't supposed to bein vacuum if they leave pressurised areas + qdel(src) + return + before_move() Move(location.return_turf()) diff --git a/code/modules/projectiles/projectile/energy.dm b/code/modules/projectiles/projectile/energy.dm index 4da01215d96..c45ea1917b6 100644 --- a/code/modules/projectiles/projectile/energy.dm +++ b/code/modules/projectiles/projectile/energy.dm @@ -142,7 +142,7 @@ damage = 5 agony = 70 damage_type = BURN -// vacuum_traversal = 0 //Projectile disappears in empty space, TODO: Implement this + vacuum_traversal = 0 //Projectile disappears in empty space /obj/item/projectile/energy/plasmastun/proc/bang(var/mob/living/carbon/M)