Overall fix for projectile falloff

Aims to fix the overall issue of damageless projectiles not working under the new falloff code.  Also fixed some weird indentation in the original version of the range() code.
This commit is contained in:
AzuleUtama
2018-11-23 10:23:38 +00:00
parent 713754b76c
commit 4bea51027b
+11 -9
View File
@@ -62,15 +62,17 @@
return ..()
/obj/item/projectile/proc/Range()
range--
if(damage && tile_dropoff)
damage = max(0, damage - tile_dropoff) // decrement projectile damage based on dropoff value for each tile it moves
if(stamina && tile_dropoff_s)
stamina = max(0, stamina - tile_dropoff_s) // as above, but with stamina
if(range <= 0 && loc)
on_range()
if(!damage && !stamina && !nodamage)
on_range()
range--
if(damage && tile_dropoff)
damage = max(0, damage - tile_dropoff) // decrement projectile damage based on dropoff value for each tile it moves
if(stamina && tile_dropoff_s)
stamina = max(0, stamina - tile_dropoff_s) // as above, but with stamina
if(range <= 0 && loc)
on_range()
if(!damage && !stamina)
if(tile_dropoff || tile_dropoff_s) // does the projectile have falloff to start with
on_range()
/obj/item/projectile/proc/on_range() //if we want there to be effects when they reach the end of their range
qdel(src)