Makes foam less garbage

only took me 6 months and phil saying I can't make any new PRs until it's fixed

foam now only divides by 7, and it won't apply the reagent's effects unless the lifetime is a multiple of 7
This commit is contained in:
Iamgoofball
2016-10-21 10:07:44 -07:00
committed by GitHub
parent 3d894741dd
commit 8c77f30770
@@ -13,6 +13,7 @@
animate_movement = 0
var/metal = 0
var/lifetime = 40
var/reagent_divisor = 7
/obj/effect/particle_effect/foam/metal
@@ -53,7 +54,7 @@
kill_foam()
return
var/fraction = 1/initial(lifetime)
var/fraction = 1/initial(reagent_divisor)
for(var/obj/O in range(0,src))
if(O.type == src.type)
continue
@@ -61,14 +62,16 @@
var/turf/T = O.loc
if(T.intact && O.level == 1) //hidden under the floor
continue
reagents.reaction(O, VAPOR, fraction)
if(lifetime % reagent_divisor)
reagents.reaction(O, VAPOR, fraction)
var/hit = 0
for(var/mob/living/L in range(0,src))
hit += foam_mob(L)
if(hit)
lifetime++ //this is so the decrease from mobs hit and the natural decrease don't cumulate.
var/T = get_turf(src)
reagents.reaction(T, VAPOR, fraction)
if(lifetime % reagent_divisor)
reagents.reaction(T, VAPOR, fraction)
if(--amount < 0)
return
@@ -79,8 +82,9 @@
return 0
if(!istype(L))
return 0
var/fraction = 1/initial(lifetime)
reagents.reaction(L, VAPOR, fraction)
var/fraction = 1/initial(reagent_divisor)
if(lifetime % reagent_divisor)
reagents.reaction(L, VAPOR, fraction)
lifetime--
return 1