removed excessive spacing, removed var/ in proc args, used some ishelpers, absolute pathing for everything

This commit is contained in:
uraniummeltdown
2017-11-01 15:56:13 +04:00
parent 9e71ddd208
commit 4814e3e3d7
6 changed files with 395 additions and 409 deletions
@@ -5,7 +5,6 @@ it needs to create more trails.A beaker could have a steam_trail_follow system s
would spawn and follow the beaker, even if it is carried or thrown.
*/
/obj/effect/effect
name = "effect"
icon = 'icons/effects/effects.dmi'
@@ -25,7 +24,7 @@ would spawn and follow the beaker, even if it is carried or thrown.
/obj/effect/proc/delete()
qdel(src)
/datum/effect/proc/fadeOut(var/atom/A, var/frames = 16)
/datum/effect/proc/fadeOut(atom/A, frames = 16)
if(A.alpha == 0) //Handle already transparent case
return
if(frames == 0)
@@ -43,20 +42,20 @@ would spawn and follow the beaker, even if it is carried or thrown.
var/atom/holder
var/setup = 0
Destroy()
holder = null
location = null
return ..()
/datum/effect/system/Destroy()
holder = null
location = null
return ..()
proc/set_up(n = 3, c = 0, turf/loc)
if(n > 10)
n = 10
number = n
cardinals = c
location = loc
setup = 1
/datum/effect/system/proc/set_up(n = 3, c = 0, turf/loc)
if(n > 10)
n = 10
number = n
cardinals = c
location = loc
setup = 1
proc/attach(atom/atom)
holder = atom
/datum/effect/system/proc/attach(atom/atom)
holder = atom
proc/start()
/datum/effect/system/proc/start()
@@ -16,8 +16,7 @@
var/expand = 1
var/metal = 0
/obj/structure/foam/New(loc, var/ismetal=0)
/obj/structure/foam/New(loc, ismetal=0)
..(loc)
icon_state = "[ismetal ? "m":""]foam"
if(!ismetal && reagents)
@@ -63,10 +62,8 @@
if(--amount < 0)
return
for(var/direction in cardinal)
var/turf/T = get_step(src,direction)
if(!T)
continue
@@ -96,12 +93,11 @@
spawn(5)
qdel(src)
/obj/structure/foam/Crossed(var/atom/movable/AM)
/obj/structure/foam/Crossed(atom/movable/AM)
if(metal)
return
if(istype(AM, /mob/living/carbon))
if(iscarbon(AM))
var/mob/living/carbon/M = AM
if(M.slip("foam", 5, 2))
if(reagents)
@@ -113,7 +109,6 @@
var/fraction = 5 / reagents.total_volume
reagents.reaction(M, TOUCH, fraction)
/datum/effect/system/foam_spread
var/amount = 5 // the size of the foam spread.
var/list/carried_reagents // the IDs of reagents present when the foam was mixed
@@ -121,7 +116,7 @@
var/temperature = T0C
var/list/banned_reagents = list("smoke_powder", "fluorosurfactant", "stimulants")
/datum/effect/system/foam_spread/set_up(amt=5, loca, var/datum/reagents/carry = null, var/metalfoam = 0)
/datum/effect/system/foam_spread/set_up(amt=5, loca, datum/reagents/carry = null, metalfoam = 0)
amount = min(round(amt/5, 1), 7)
if(istype(loca, /turf/))
location = loca
@@ -168,7 +163,6 @@
// wall formed by metal foams
// dense and opaque, but easy to break
/obj/structure/foamedmetal
icon = 'icons/effects/effects.dmi'
icon_state = "metalfoam"
@@ -199,7 +193,6 @@
else
icon_state = "ironfoam"
/obj/structure/foamedmetal/ex_act(severity)
qdel(src)
@@ -210,7 +203,7 @@
if(metal==MFOAM_ALUMINUM || prob(50))
qdel(src)
/obj/structure/foamedmetal/attack_hand(var/mob/user)
/obj/structure/foamedmetal/attack_hand(mob/user)
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src)
if((HULK in user.mutations) || (prob(75 - metal*25)))
@@ -219,7 +212,7 @@
else
to_chat(user, "<span class='notice'>You hit the metal foam but bounce off it.</span>")
/obj/structure/foamedmetal/attackby(var/obj/item/I, var/mob/user, params)
/obj/structure/foamedmetal/attackby(obj/item/I, mob/user, params)
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src)
if(istype(I, /obj/item/weapon/grab))
@@ -35,7 +35,7 @@
I.dir = src.holder.dir
flick("ion_fade", I)
I.icon_state = ""
spawn( 20 )
spawn(20)
if(I)
I.delete()
src.oldposition = T
@@ -98,9 +98,11 @@
flick("ion_fade", II)
I.icon_state = ""
II.icon_state = ""
spawn( 20 )
if(I) I.delete()
if(II) II.delete()
spawn(20)
if(I)
I.delete()
if(II)
II.delete()
spawn(2)
if(src.on)
src.processing = 1
@@ -113,64 +115,65 @@
var/flashing = 0 // does explosion creates flash effect?
var/flashing_factor = 0 // factor of how powerful the flash effect relatively to the explosion
set_up (amt, loc, flash = 0, flash_fact = 0)
amount = amt
if(istype(loc, /turf/))
location = loc
else
location = get_turf(loc)
/datum/effect/system/reagents_explosion/set_up(amt, loc, flash = 0, flash_fact = 0)
amount = amt
if(istype(loc, /turf/))
location = loc
else
location = get_turf(loc)
flashing = flash
flashing_factor = flash_fact
flashing = flash
flashing_factor = flash_fact
return
/datum/effect/system/reagents_explosion/start()
if(amount <= 2)
var/datum/effect/system/spark_spread/s = new /datum/effect/system/spark_spread
s.set_up(2, 1, location)
s.start()
for(var/mob/M in viewers(5, location))
to_chat(M, "<span class='warning'>The solution violently explodes.</span>")
for(var/mob/M in viewers(1, location))
if(prob(50 * amount))
to_chat(M, "<span class='warning'>The explosion knocks you down.</span>")
M.Weaken(rand(1,5))
return
else
var/devastation = -1
var/heavy = -1
var/light = -1
var/flash = -1
start()
if(amount <= 2)
var/datum/effect/system/spark_spread/s = new /datum/effect/system/spark_spread
s.set_up(2, 1, location)
s.start()
// Clamp all values to MAX_EXPLOSION_RANGE
if(round(amount/12) > 0)
devastation = min (MAX_EX_DEVESTATION_RANGE, devastation + round(amount/12))
for(var/mob/M in viewers(5, location))
to_chat(M, "<span class='warning'>The solution violently explodes.</span>")
for(var/mob/M in viewers(1, location))
if(prob (50 * amount))
to_chat(M, "<span class='warning'>The explosion knocks you down.</span>")
M.Weaken(rand(1,5))
return
else
var/devastation = -1
var/heavy = -1
var/light = -1
var/flash = -1
if(round(amount/6) > 0)
heavy = min (MAX_EX_HEAVY_RANGE, heavy + round(amount/6))
// Clamp all values to MAX_EXPLOSION_RANGE
if(round(amount/12) > 0)
devastation = min (MAX_EX_DEVESTATION_RANGE, devastation + round(amount/12))
if(round(amount/3) > 0)
light = min (MAX_EX_LIGHT_RANGE, light + round(amount/3))
if(round(amount/6) > 0)
heavy = min (MAX_EX_HEAVY_RANGE, heavy + round(amount/6))
if(flash && flashing_factor)
flash += (round(amount/4) * flashing_factor)
if(round(amount/3) > 0)
light = min (MAX_EX_LIGHT_RANGE, light + round(amount/3))
for(var/mob/M in viewers(8, location))
to_chat(M, "<span class='warning'>The solution violently explodes.</span>")
if(flash && flashing_factor)
flash += (round(amount/4) * flashing_factor)
explosion(location, devastation, heavy, light, flash)
for(var/mob/M in viewers(8, location))
to_chat(M, "<span class='warning'>The solution violently explodes.</span>")
/datum/effect/system/reagents_explosion/proc/holder_damage(atom/holder)
if(holder)
var/dmglevel = 4
explosion(location, devastation, heavy, light, flash)
if(round(amount/8) > 0)
dmglevel = 1
else if(round(amount/4) > 0)
dmglevel = 2
else if(round(amount/2) > 0)
dmglevel = 3
proc/holder_damage(var/atom/holder)
if(holder)
var/dmglevel = 4
if(round(amount/8) > 0)
dmglevel = 1
else if(round(amount/4) > 0)
dmglevel = 2
else if(round(amount/2) > 0)
dmglevel = 3
if(dmglevel<4) holder.ex_act(dmglevel)
if(dmglevel<4)
holder.ex_act(dmglevel)
@@ -27,7 +27,7 @@
/obj/effect/effect/harmless_smoke/New()
..()
spawn (100)
spawn(100)
delete()
return
@@ -39,42 +39,40 @@
var/total_smoke = 0 // To stop it being spammed and lagging!
var/direction
set_up(n = 5, c = 0, loca, direct)
if(n > 10)
n = 10
number = n
cardinals = c
if(istype(loca, /turf/))
location = loca
else
location = get_turf(loca)
if(direct)
direction = direct
start()
var/i = 0
for(i=0, i<src.number, i++)
if(src.total_smoke > 20)
return
spawn(0)
if(holder)
src.location = get_turf(holder)
var/obj/effect/effect/harmless_smoke/smoke = new /obj/effect/effect/harmless_smoke(src.location)
src.total_smoke++
var/direction = src.direction
if(!direction)
if(src.cardinals)
direction = pick(cardinal)
else
direction = pick(alldirs)
for(i=0, i<pick(0,1,1,1,2,2,2,3), i++)
sleep(10)
step(smoke,direction)
spawn(75+rand(10,30))
smoke.delete()
src.total_smoke--
/datum/effect/system/harmless_smoke_spread/set_up(n = 5, c = 0, loca, direct)
if(n > 10)
n = 10
number = n
cardinals = c
if(istype(loca, /turf/))
location = loca
else
location = get_turf(loca)
if(direct)
direction = direct
/datum/effect/system/harmless_smoke_spread/start()
var/i = 0
for(i=0, i<src.number, i++)
if(src.total_smoke > 20)
return
spawn(0)
if(holder)
src.location = get_turf(holder)
var/obj/effect/effect/harmless_smoke/smoke = new /obj/effect/effect/harmless_smoke(src.location)
src.total_smoke++
var/direction = src.direction
if(!direction)
if(src.cardinals)
direction = pick(cardinal)
else
direction = pick(alldirs)
for(i=0, i<pick(0,1,1,1,2,2,2,3), i++)
sleep(10)
step(smoke,direction)
spawn(75+rand(10,30))
smoke.delete()
src.total_smoke--
/////////////////////////////////////////////
// Bad smoke
@@ -94,7 +92,7 @@
/obj/effect/effect/bad_smoke/New()
..()
spawn (200+rand(10,30))
spawn(200+rand(10,30))
delete()
return
@@ -108,22 +106,21 @@
if(M.coughedtime != 1)
M.coughedtime = 1
M.emote("cough")
spawn ( 20 )
spawn(20)
M.coughedtime = 0
return
/obj/effect/effect/bad_smoke/CanPass(atom/movable/mover, turf/target, height=0)
if(height==0) return 1
if(height==0)
return 1
if(istype(mover, /obj/item/projectile/beam))
var/obj/item/projectile/beam/B = mover
B.damage = (B.damage/2)
return 1
/obj/effect/effect/bad_smoke/Crossed(mob/living/carbon/M as mob )
/obj/effect/effect/bad_smoke/Crossed(mob/living/carbon/M)
..()
if(istype(M, /mob/living/carbon))
if(iscarbon(M))
if(M.internal != null && M.wear_mask && (M.wear_mask.flags & AIRTIGHT))
return
else
@@ -132,7 +129,7 @@
if(M.coughedtime != 1)
M.coughedtime = 1
M.emote("cough")
spawn ( 20 )
spawn(20)
M.coughedtime = 0
return
@@ -140,47 +137,45 @@
var/total_smoke = 0 // To stop it being spammed and lagging!
var/direction
set_up(n = 5, c = 0, loca, direct)
if(n > 20)
n = 20
number = n
cardinals = c
if(istype(loca, /turf/))
location = loca
else
location = get_turf(loca)
if(direct)
direction = direct
start()
var/i = 0
for(i=0, i<src.number, i++)
if(src.total_smoke > 20)
return
spawn(0)
if(holder)
src.location = get_turf(holder)
var/obj/effect/effect/bad_smoke/smoke = new /obj/effect/effect/bad_smoke(src.location)
src.total_smoke++
var/direction = src.direction
if(!direction)
if(src.cardinals)
direction = pick(cardinal)
else
direction = pick(alldirs)
for(i=0, i<pick(0,1,1,1,2,2,2,3), i++)
sleep(10)
step(smoke,direction)
spawn(150+rand(10,30))
smoke.delete()
src.total_smoke--
/datum/effect/system/bad_smoke_spread/set_up(n = 5, c = 0, loca, direct)
if(n > 20)
n = 20
number = n
cardinals = c
if(istype(loca, /turf/))
location = loca
else
location = get_turf(loca)
if(direct)
direction = direct
/datum/effect/system/bad_smoke_spread/start()
var/i = 0
for(i=0, i<src.number, i++)
if(src.total_smoke > 20)
return
spawn(0)
if(holder)
src.location = get_turf(holder)
var/obj/effect/effect/bad_smoke/smoke = new /obj/effect/effect/bad_smoke(src.location)
src.total_smoke++
var/direction = src.direction
if(!direction)
if(src.cardinals)
direction = pick(cardinal)
else
direction = pick(alldirs)
for(i=0, i<pick(0,1,1,1,2,2,2,3), i++)
sleep(10)
step(smoke,direction)
spawn(150+rand(10,30))
smoke.delete()
src.total_smoke--
/////////////////////////////////////////////
// Chem smoke
/////////////////////////////////////////////
/obj/effect/effect/chem_smoke
name = "smoke"
opacity = 0
@@ -194,7 +189,7 @@
/obj/effect/effect/chem_smoke/New()
..()
spawn (200+rand(10,30))
spawn(200+rand(10,30))
delete()
return
@@ -208,103 +203,101 @@
chemholder.reagents = R
R.my_atom = chemholder
/datum/effect/system/chem_smoke_spread
var/total_smoke = 0 // To stop it being spammed and lagging!
var/direction
var/obj/chemholder
Destroy()
QDEL_NULL(chemholder)
return ..()
/datum/effect/system/chem_smoke_spread/New()
..()
chemholder = new/obj()
var/datum/reagents/R = new/datum/reagents(500)
chemholder.reagents = R
R.my_atom = chemholder
New()
..()
chemholder = new/obj()
var/datum/reagents/R = new/datum/reagents(500)
chemholder.reagents = R
R.my_atom = chemholder
/datum/effect/system/chem_smoke_spread/Destroy()
QDEL_NULL(chemholder)
return ..()
set_up(var/datum/reagents/carry = null, n = 5, c = 0, loca, direct, silent = 0)
if(n > 20)
n = 20
number = n
cardinals = c
carry.copy_to(chemholder, carry.total_volume)
/datum/effect/system/chem_smoke_spread/set_up(datum/reagents/carry = null, n = 5, c = 0, loca, direct, silent = 0)
if(n > 20)
n = 20
number = n
cardinals = c
carry.copy_to(chemholder, carry.total_volume)
if(istype(loca, /turf/))
location = loca
else
location = get_turf(loca)
if(direct)
direction = direct
if(!silent)
var/contained = ""
for(var/reagent in carry.reagent_list)
contained += " [reagent] "
if(contained)
contained = "\[[contained]\]"
var/area/A = get_area(location)
if(istype(loca, /turf/))
location = loca
else
location = get_turf(loca)
if(direct)
direction = direct
if(!silent)
var/contained = ""
for(var/reagent in carry.reagent_list)
contained += " [reagent] "
if(contained)
contained = "\[[contained]\]"
var/area/A = get_area(location)
var/where = "[A.name] | [location.x], [location.y]"
var/whereLink = "<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[location.x];Y=[location.y];Z=[location.z]'>[where]</a>"
var/where = "[A.name] | [location.x], [location.y]"
var/whereLink = "<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[location.x];Y=[location.y];Z=[location.z]'>[where]</a>"
if(carry && carry.my_atom)
if(carry.my_atom.fingerprintslast)
var/mob/M = get_mob_by_key(carry.my_atom.fingerprintslast)
var/more = ""
if(M)
more = " "
msg_admin_attack("A chemical smoke reaction has taken place in ([whereLink])[contained]. Last associated key is [carry.my_atom.fingerprintslast][more].", 0, 1)
log_game("A chemical smoke reaction has taken place in ([where])[contained]. Last associated key is [carry.my_atom.fingerprintslast].")
else
msg_admin_attack("A chemical smoke reaction has taken place in ([whereLink]). No associated key.", 0, 1)
log_game("A chemical smoke reaction has taken place in ([where])[contained]. No associated key.")
if(carry && carry.my_atom)
if(carry.my_atom.fingerprintslast)
var/mob/M = get_mob_by_key(carry.my_atom.fingerprintslast)
var/more = ""
if(M)
more = " "
msg_admin_attack("A chemical smoke reaction has taken place in ([whereLink])[contained]. Last associated key is [carry.my_atom.fingerprintslast][more].", 0, 1)
log_game("A chemical smoke reaction has taken place in ([where])[contained]. Last associated key is [carry.my_atom.fingerprintslast].")
else
msg_admin_attack("A chemical smoke reaction has taken place in ([whereLink]). No associated key. CODERS: carry.my_atom may be null.", 0, 1)
log_game("A chemical smoke reaction has taken place in ([where])[contained]. No associated key. CODERS: carry.my_atom may be null.")
msg_admin_attack("A chemical smoke reaction has taken place in ([whereLink]). No associated key.", 0, 1)
log_game("A chemical smoke reaction has taken place in ([where])[contained]. No associated key.")
else
msg_admin_attack("A chemical smoke reaction has taken place in ([whereLink]). No associated key. CODERS: carry.my_atom may be null.", 0, 1)
log_game("A chemical smoke reaction has taken place in ([where])[contained]. No associated key. CODERS: carry.my_atom may be null.")
start(effect_range = 2)
var/i = 0
/datum/effect/system/chem_smoke_spread/start(effect_range = 2)
var/i = 0
var/color = mix_color_from_reagents(chemholder.reagents.reagent_list)
var/obj/effect/effect/chem_smoke/smokeholder = new /obj/effect/effect/chem_smoke(src.location)
for(var/atom/A in view(effect_range, smokeholder))
chemholder.reagents.reaction(A)
if(iscarbon(A))
var/mob/living/carbon/C = A
if(C.can_breathe_gas())
chemholder.reagents.copy_to(C, chemholder.reagents.total_volume)
qdel(smokeholder)
for(i=0, i<src.number, i++)
if(src.total_smoke > 20)
return
spawn(0)
if(holder)
src.location = get_turf(holder)
var/obj/effect/effect/chem_smoke/smoke = new /obj/effect/effect/chem_smoke(src.location)
src.total_smoke++
var/direction = src.direction
if(!direction)
if(src.cardinals)
direction = pick(cardinal)
else
direction = pick(alldirs)
if(color)
smoke.icon += color // give the smoke color, if it has any to begin with
var/color = mix_color_from_reagents(chemholder.reagents.reagent_list)
var/obj/effect/effect/chem_smoke/smokeholder = new /obj/effect/effect/chem_smoke(src.location)
for(var/atom/A in view(effect_range, smokeholder))
chemholder.reagents.reaction(A)
if(iscarbon(A))
var/mob/living/carbon/C = A
if(C.can_breathe_gas())
chemholder.reagents.copy_to(C, chemholder.reagents.total_volume)
qdel(smokeholder)
for(i=0, i<src.number, i++)
if(src.total_smoke > 20)
return
spawn(0)
if(holder)
src.location = get_turf(holder)
var/obj/effect/effect/chem_smoke/smoke = new /obj/effect/effect/chem_smoke(src.location)
src.total_smoke++
var/direction = src.direction
if(!direction)
if(src.cardinals)
direction = pick(cardinal)
else
// if no color, just use the old smoke icon
smoke.icon = 'icons/effects/96x96.dmi'
smoke.icon_state = "smoke"
for(i=0, i<pick(0,1,1,1,2,2,2,3), i++)
sleep(10)
step(smoke,direction)
spawn(150+rand(10,30))
if(smoke) smoke.delete()
src.total_smoke--
direction = pick(alldirs)
if(color)
smoke.icon += color // give the smoke color, if it has any to begin with
else
// if no color, just use the old smoke icon
smoke.icon = 'icons/effects/96x96.dmi'
smoke.icon_state = "smoke"
for(i=0, i<pick(0,1,1,1,2,2,2,3), i++)
sleep(10)
step(smoke,direction)
spawn(150+rand(10,30))
if(smoke)
smoke.delete()
src.total_smoke--
/////////////////////////////////////////////
// Sleep smoke
@@ -325,7 +318,7 @@
/obj/effect/effect/sleep_smoke/New()
..()
spawn (200+rand(10,30))
spawn(200+rand(10,30))
delete()
return
@@ -345,7 +338,7 @@
M.coughedtime = 0
return
/obj/effect/effect/sleep_smoke/Crossed(mob/living/carbon/M as mob )
/obj/effect/effect/sleep_smoke/Crossed(mob/living/carbon/M)
..()
if(istype(M, /mob/living/carbon))
if(M.internal != null && M.wear_mask && (M.wear_mask.flags & AIRTIGHT))
@@ -366,47 +359,45 @@
var/total_smoke = 0 // To stop it being spammed and lagging!
var/direction
set_up(n = 5, c = 0, loca, direct)
if(n > 20)
n = 20
number = n
cardinals = c
if(istype(loca, /turf/))
location = loca
else
location = get_turf(loca)
if(direct)
direction = direct
/datum/effect/system/sleep_smoke_spread/set_up(n = 5, c = 0, loca, direct)
if(n > 20)
n = 20
number = n
cardinals = c
if(istype(loca, /turf/))
location = loca
else
location = get_turf(loca)
if(direct)
direction = direct
start()
var/i = 0
for(i=0, i<src.number, i++)
if(src.total_smoke > 20)
return
spawn(0)
if(holder)
src.location = get_turf(holder)
var/obj/effect/effect/sleep_smoke/smoke = new /obj/effect/effect/sleep_smoke(src.location)
src.total_smoke++
var/direction = src.direction
if(!direction)
if(src.cardinals)
direction = pick(cardinal)
else
direction = pick(alldirs)
for(i=0, i<pick(0,1,1,1,2,2,2,3), i++)
sleep(10)
step(smoke,direction)
spawn(150+rand(10,30))
smoke.delete()
src.total_smoke--
/datum/effect/system/sleep_smoke_spread/start()
var/i = 0
for(i=0, i<src.number, i++)
if(src.total_smoke > 20)
return
spawn(0)
if(holder)
src.location = get_turf(holder)
var/obj/effect/effect/sleep_smoke/smoke = new /obj/effect/effect/sleep_smoke(src.location)
src.total_smoke++
var/direction = src.direction
if(!direction)
if(src.cardinals)
direction = pick(cardinal)
else
direction = pick(alldirs)
for(i=0, i<pick(0,1,1,1,2,2,2,3), i++)
sleep(10)
step(smoke,direction)
spawn(150+rand(10,30))
smoke.delete()
src.total_smoke--
/////////////////////////////////////////////
// Mustard Gas
/////////////////////////////////////////////
/obj/effect/effect/mustard_gas
name = "mustard gas"
icon_state = "mustard"
@@ -417,7 +408,7 @@
/obj/effect/effect/mustard_gas/New()
..()
spawn (100)
spawn(100)
qdel(src)
return
@@ -430,21 +421,21 @@
if(R.coughedtime != 1)
R.coughedtime = 1
R.emote("gasp")
spawn (20)
spawn(20)
R.coughedtime = 0
R.updatehealth()
return
/obj/effect/effect/mustard_gas/Crossed(mob/living/carbon/human/R as mob )
/obj/effect/effect/mustard_gas/Crossed(mob/living/carbon/human/R)
..()
if(istype(R, /mob/living/carbon/human))
if(ishuman(R))
if(R.internal != null && usr.wear_mask && (R.wear_mask.flags & AIRTIGHT) && R.wear_suit != null && !istype(R.wear_suit, /obj/item/clothing/suit/storage/labcoat) && !istype(R.wear_suit, /obj/item/clothing/suit/straight_jacket) && !istype(R.wear_suit, /obj/item/clothing/suit/straight_jacket && !istype(R.wear_suit, /obj/item/clothing/suit/armor)))
return
R.adjustFireLoss(0.75)
if(R.coughedtime != 1)
R.coughedtime = 1
R.emote("gasp")
spawn (20)
spawn(20)
R.coughedtime = 0
R.updatehealth()
return
@@ -453,37 +444,37 @@
var/total_smoke = 0 // To stop it being spammed and lagging!
var/direction
set_up(n = 5, c = 0, loca, direct)
if(n > 20)
n = 20
number = n
cardinals = c
if(istype(loca, /turf/))
location = loca
else
location = get_turf(loca)
if(direct)
direction = direct
/datum/effect/system/mustard_gas_spread/set_up(n = 5, c = 0, loca, direct)
if(n > 20)
n = 20
number = n
cardinals = c
if(istype(loca, /turf/))
location = loca
else
location = get_turf(loca)
if(direct)
direction = direct
start()
var/i = 0
for(i=0, i<src.number, i++)
if(src.total_smoke > 20)
return
spawn(0)
if(holder)
src.location = get_turf(holder)
var/obj/effect/effect/mustard_gas/smoke = new /obj/effect/effect/mustard_gas(src.location)
src.total_smoke++
var/direction = src.direction
if(!direction)
if(src.cardinals)
direction = pick(cardinal)
else
direction = pick(alldirs)
for(i=0, i<pick(0,1,1,1,2,2,2,3), i++)
sleep(10)
step(smoke,direction)
spawn(100)
qdel(smoke)
src.total_smoke--
/datum/effect/system/mustard_gas_spread/start()
var/i = 0
for(i=0, i<src.number, i++)
if(src.total_smoke > 20)
return
spawn(0)
if(holder)
src.location = get_turf(holder)
var/obj/effect/effect/mustard_gas/smoke = new /obj/effect/effect/mustard_gas(src.location)
src.total_smoke++
var/direction = src.direction
if(!direction)
if(src.cardinals)
direction = pick(cardinal)
else
direction = pick(alldirs)
for(i=0, i<pick(0,1,1,1,2,2,2,3), i++)
sleep(10)
step(smoke,direction)
spawn(100)
qdel(smoke)
src.total_smoke--
@@ -11,7 +11,6 @@
icon_state = "sparks"
anchored = 1.0
mouse_opacity = 0
var/amount = 6.0
/obj/effect/effect/sparks/New()
@@ -39,37 +38,37 @@
/datum/effect/system/spark_spread
var/total_sparks = 0 // To stop it being spammed and lagging!
set_up(n = 3, c = 0, loca)
if(n > 10)
n = 10
number = n
cardinals = c
if(istype(loca, /turf/))
location = loca
else
location = get_turf(loca)
/datum/effect/system/spark_spread/set_up(n = 3, c = 0, loca)
if(n > 10)
n = 10
number = n
cardinals = c
if(istype(loca, /turf/))
location = loca
else
location = get_turf(loca)
start()
var/i = 0
for(i=0, i<src.number, i++)
if(src.total_sparks > 20)
return
spawn(0)
if(holder)
src.location = get_turf(holder)
var/obj/effect/effect/sparks/sparks = new /obj/effect/effect/sparks(src.location)
src.total_sparks++
var/direction
if(src.cardinals)
direction = pick(cardinal)
else
direction = pick(alldirs)
for(i=0, i<pick(1,2,3), i++)
sleep(5)
step(sparks,direction)
spawn(20)
qdel(sparks)
src.total_sparks--
/datum/effect/system/spark_spread/start()
var/i = 0
for(i=0, i<src.number, i++)
if(src.total_sparks > 20)
return
spawn(0)
if(holder)
src.location = get_turf(holder)
var/obj/effect/effect/sparks/sparks = new /obj/effect/effect/sparks(src.location)
src.total_sparks++
var/direction
if(src.cardinals)
direction = pick(cardinal)
else
direction = pick(alldirs)
for(i=0, i<pick(1,2,3), i++)
sleep(5)
step(sparks,direction)
spawn(20)
qdel(sparks)
src.total_sparks--
//////////////////////////////////
//////SPARKLE FIREWORKS
@@ -3,15 +3,15 @@
name = "water"
icon = 'icons/effects/effects.dmi'
icon_state = "extinguish"
var/life = 15.0
mouse_opacity = 0
var/life = 15.0
/obj/effect/effect/water/New()
..()
//var/turf/T = src.loc
//if(istype(T, /turf))
// T.firelevel = 0 //TODO: FIX
spawn( 70 )
spawn(70)
delete()
return
return
@@ -58,30 +58,30 @@ steam.start() -- spawns the effect
/datum/effect/system/steam_spread
set_up(n = 3, c = 0, turf/loc)
if(n > 10)
n = 10
number = n
cardinals = c
location = loc
/datum/effect/system/steam_spread/set_up(n = 3, c = 0, turf/loc)
if(n > 10)
n = 10
number = n
cardinals = c
location = loc
start()
var/i = 0
for(i=0, i<src.number, i++)
spawn(0)
if(holder)
src.location = get_turf(holder)
var/obj/effect/effect/steam/steam = new /obj/effect/effect/steam(src.location)
var/direction
if(src.cardinals)
direction = pick(cardinal)
else
direction = pick(alldirs)
for(i=0, i<pick(1,2,3), i++)
sleep(5)
step(steam,direction)
spawn(20)
if(steam) steam.delete()
/datum/effect/system/steam_spread/start()
var/i = 0
for(i=0, i<src.number, i++)
spawn(0)
if(holder)
src.location = get_turf(holder)
var/obj/effect/effect/steam/steam = new /obj/effect/effect/steam(src.location)
var/direction
if(src.cardinals)
direction = pick(cardinal)
else
direction = pick(alldirs)
for(i=0, i<pick(1,2,3), i++)
sleep(5)
step(steam,direction)
spawn(20)
if(steam) steam.delete()
/////////////////////////////////////////////
//////// Attach a steam trail to an object (eg. a reacting beaker) that will follow it
@@ -93,39 +93,40 @@ steam.start() -- spawns the effect
var/processing = 1
var/on = 1
Destroy()
oldposition = null
return ..()
/datum/effect/system/steam_trail_follow/Destroy()
oldposition = null
return ..()
set_up(atom/atom)
attach(atom)
oldposition = get_turf(atom)
/datum/effect/system/steam_trail_follow/set_up(atom/atom)
attach(atom)
oldposition = get_turf(atom)
start()
if(!src.on)
src.on = 1
src.processing = 1
if(src.processing)
src.processing = 0
spawn(0)
if(src.number < 3)
var/obj/effect/effect/steam/I = new /obj/effect/effect/steam(src.oldposition)
src.number++
src.oldposition = get_turf(holder)
I.dir = src.holder.dir
spawn(10)
if(I) I.delete()
src.number--
spawn(2)
if(src.on)
src.processing = 1
src.start()
else
spawn(2)
if(src.on)
src.processing = 1
src.start()
proc/stop()
/datum/effect/system/steam_trail_follow/start()
if(!src.on)
src.on = 1
src.processing = 1
if(src.processing)
src.processing = 0
src.on = 0
spawn(0)
if(src.number < 3)
var/obj/effect/effect/steam/I = new /obj/effect/effect/steam(src.oldposition)
src.number++
src.oldposition = get_turf(holder)
I.dir = src.holder.dir
spawn(10)
if(I)
I.delete()
src.number--
spawn(2)
if(src.on)
src.processing = 1
src.start()
else
spawn(2)
if(src.on)
src.processing = 1
src.start()
/datum/effect/system/steam_trail_follow/proc/stop()
src.processing = 0
src.on = 0