Smoke rework caused endless loops, reverted.

This commit is contained in:
alex-gh
2014-04-08 01:47:56 +02:00
parent 521ad31671
commit cfbfa0e993
38 changed files with 517 additions and 446 deletions
+1 -1
View File
@@ -161,7 +161,7 @@ obj/machinery/atmospherics/pipe
proc/burst()
src.visible_message("\red \bold [src] bursts!");
playsound(get_turf(src), 'sound/effects/bang.ogg', 25, 1)
var/datum/effect/effect/system/smoke_spread/smoke = new
var/datum/effect/effect/system/harmless_smoke_spread/smoke = new
smoke.set_up(1,0, src.loc, 0)
smoke.start()
qdel(src)
+1 -1
View File
@@ -148,7 +148,7 @@
if(!block)
for(var/obj/effect/effect/smoke/chem/smoke in view(1, src))
for(var/obj/effect/effect/chem_smoke/smoke in view(1, src))
if(smoke.reagents.total_volume)
smoke.reagents.reaction(src, INGEST)
spawn(5)
+1 -1
View File
@@ -191,7 +191,7 @@
for(var/x in verbs)
verbs -= x
set_broken()
var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread()
var/datum/effect/effect/system/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread()
smoke.set_up(5, 0, src)
smoke.start()
return
+1 -1
View File
@@ -66,6 +66,6 @@
P.set_up(10,location)
P.start()
spawn(5)
var/datum/effect/effect/system/smoke_spread/S = new/datum/effect/effect/system/smoke_spread()
var/datum/effect/effect/system/harmless_smoke_spread/S = new/datum/effect/effect/system/harmless_smoke_spread()
S.set_up(5,0,location,null)
S.start()
+2 -2
View File
@@ -175,11 +175,11 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin
sparks.start()
if(smoke_spread)
if(smoke_spread == 1)
var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread()
var/datum/effect/effect/system/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread()
smoke.set_up(smoke_amt, 0, location) //no idea what the 0 is
smoke.start()
else if(smoke_spread == 2)
var/datum/effect/effect/system/smoke_spread/bad/smoke = new /datum/effect/effect/system/smoke_spread/bad()
var/datum/effect/effect/system/bad_smoke_spread/smoke = new /datum/effect/effect/system/bad_smoke_spread()
smoke.set_up(smoke_amt, 0, location) //no idea what the 0 is
smoke.start()
+1 -1
View File
@@ -103,7 +103,7 @@
/mob/living/simple_animal/hostile/blobspore/Die()
// On death, create a small smoke of harmful gas (s-Acid)
var/datum/effect/effect/system/smoke_spread/chem/S = new
var/datum/effect/effect/system/chem_smoke_spread/S = new
var/turf/location = get_turf(src)
// Create the reagents to put into the air, s-acid is yellow and stings a little
@@ -57,7 +57,7 @@ Not sure why this would be useful (it's not) but whatever. Ninjas need their smo
if(!ninjacost(,2))
var/mob/living/carbon/human/U = affecting
U << "\blue There are <B>[s_bombs]</B> smoke bombs remaining."
var/datum/effect/effect/system/smoke_spread/bad/smoke = new /datum/effect/effect/system/smoke_spread/bad()
var/datum/effect/effect/system/bad_smoke_spread/smoke = new /datum/effect/effect/system/bad_smoke_spread()
smoke.set_up(10, 0, U.loc)
smoke.start()
playsound(U.loc, 'sound/effects/bamf.ogg', 50, 2)
+1 -1
View File
@@ -54,7 +54,7 @@
if(candidates.len)
src.used = 1
var/client/C = pick(candidates)
new /obj/effect/effect/smoke(H.loc)
new /obj/effect/effect/harmless_smoke(H.loc)
var/mob/living/carbon/human/M = new/mob/living/carbon/human(H.loc)
M.key = C.key
M << "<B>You are the [H.real_name]'s apprentice! You are bound by magic contract to follow their orders and help them in accomplishing their goals."
+1 -1
View File
@@ -30,7 +30,7 @@
for(var/x in verbs)
verbs -= x
set_broken()
var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread()
var/datum/effect/effect/system/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread()
smoke.set_up(5, 0, src)
smoke.start()
return
+1 -1
View File
@@ -14,7 +14,7 @@
var/smoke = 5
var/smoke_ready = 1
var/smoke_cooldown = 100
var/datum/effect/effect/system/smoke_spread/smoke_system = new
var/datum/effect/effect/system/harmless_smoke_spread/smoke_system = new
operation_req_access = list(access_cent_specops)
wreckage = /obj/effect/decal/mecha_wreckage/marauder
add_req_access = 0
+1 -1
View File
@@ -27,7 +27,7 @@
/obj/effect/anomaly/proc/anomalyNeutralize()
new /obj/effect/effect/smoke/bad(loc)
new /obj/effect/effect/bad_smoke(loc)
for(var/atom/movable/O in src)
O.loc = src.loc
-246
View File
@@ -1,246 +0,0 @@
/////////////////////////////////////////////
// Chem smoke
/////////////////////////////////////////////
/obj/effect/effect/smoke/chem
icon = 'icons/effects/chemsmoke.dmi'
opacity = 0
time_to_live = 300
pass_flags = PASSTABLE | PASSGRILLE | PASSGLASS //PASSGLASS is fine here, it's just so the visual effect can "flow" around glass
/obj/effect/effect/smoke/chem/New()
..()
var/datum/reagents/R = new/datum/reagents(500)
reagents = R
R.my_atom = src
return
/datum/effect/effect/system/smoke_spread/chem
smoke_type = /obj/effect/effect/smoke/chem
var/obj/chemholder
var/range
var/list/targetTurfs
var/list/wallList
var/floorArea
/datum/effect/effect/system/smoke_spread/chem/New()
..()
chemholder = new/obj()
var/datum/reagents/R = new/datum/reagents(500)
chemholder.reagents = R
R.my_atom = chemholder
//------------------------------------------
//Sets up the chem smoke effect
//
// Calculates the max range smoke can travel, then gets all turfs in that view range.
// Culls the selected turfs to a (roughly) circle shape, then calls smokeFlow() to make
// sure the smoke can actually path to the turfs. This culls any turfs it can't reach.
//------------------------------------------
/datum/effect/effect/system/smoke_spread/chem/set_up(var/datum/reagents/carry = null, n = 10, c = 0, loca, direct)
range = n * 0.3
cardinals = c
carry.copy_to(chemholder, carry.total_volume)
if(istype(loca, /turf/))
location = loca
else
location = get_turf(loca)
targetTurfs = new()
//build affected area list
for(var/turf/T in view(range, location))
//cull turfs to circle
if(cheap_pythag(T.x - location.x, T.y - location.y) <= range)
targetTurfs += T
//make secondary list for reagents that affect walls
if(chemholder.reagents.has_reagent("thermite") || chemholder.reagents.has_reagent("plantbgone"))
wallList = new()
//pathing check
smokeFlow(location, targetTurfs, wallList)
floorArea = targetTurfs.len
//Admin messaging
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>"
if(carry.my_atom.fingerprintslast)
var/mob/M = get_mob_by_key(carry.my_atom.fingerprintslast)
var/more = ""
if(M)
more = "(<A HREF='?_src_=holder;adminmoreinfo=\ref[M]'>?</a>)"
message_admins("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
message_admins("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.")
//------------------------------------------
//Runs the chem smoke effect
//
// Spawns damage over time loop for each reagent held in the cloud.
// Applies reagents to walls that affect walls (only thermite and plant-b-gone at the moment).
// Also calculates target locations to spawn the visual smoke effect on, so the whole area
// is covered fairly evenly.
//------------------------------------------
/datum/effect/effect/system/smoke_spread/chem/start()
//reagent application
if(chemholder.reagents.reagent_list.len)
for(var/datum/reagent/R in chemholder.reagents.reagent_list)
var/proba = 100
var/runs = 5
//dilute the reagents according to affected area
R.volume /= floorArea / 4
chemholder.reagents.update_total()
//apply wall affecting reagents to walls
if(R.id in list("thermite", "plantbgone"))
for(var/turf/T in wallList)
R.reaction_turf(T, R.volume)
//reagents that should be applied to turfs in a random pattern
if(R.id == "carbon")
proba = 75
else if(R.id in list("blood", "radium", "uranium"))
proba = 25
spawn(0)
for(var/i = 0, i < runs, i++)
for(var/turf/T in targetTurfs)
if(prob(proba))
R.reaction_turf(T, R.volume)
for(var/atom/A in T.contents)
if(istype(A, /obj/effect/effect/smoke/chem)) //skip the item if it is chem smoke
continue
else if(istype(A, /mob))
var/dist = cheap_pythag(T.x - location.x, T.y - location.y)
if(!dist)
dist = 1
R.reaction_mob(A, volume = R.volume / dist)
else if(istype(A, /obj))
R.reaction_obj(A, R.volume)
sleep(30)
//build smoke icon
var/color = mix_color_from_reagents(chemholder.reagents.reagent_list)
var/icon/I
if(color)
I = icon('icons/effects/chemsmoke.dmi')
I += color
else
I = icon('icons/effects/96x96.dmi', "smoke")
//distance between each smoke cloud
var/const/arcLength = 2.3559
//calculate positions for smoke coverage - then spawn smoke
for(var/i = 0, i < range, i++)
var/radius = i * 1.5
if(!radius)
spawn(0)
spawnSmoke(location, I, 1)
continue
var/offset = 0
var/points = round((radius * 2 * PI) / arcLength)
var/angle = round(ToDegrees(arcLength / radius), 1)
if(!IsInteger(radius))
offset = 45 //degrees
for(var/j = 0, j < points, j++)
var/a = (angle * j) + offset
var/x = round(radius * cos(a) + location.x, 1)
var/y = round(radius * sin(a) + location.y, 1)
var/turf/T = locate(x,y,location.z)
if(T in targetTurfs)
var/dist = cheap_pythag(T.x - location.x, T.y - location.y)
if(!dist)
dist = 1
spawn(0)
spawnSmoke(T, I, dist)
//------------------------------------------
// Randomizes and spawns the smoke effect.
// Also handles deleting the smoke once the effect is finished.
//------------------------------------------
/datum/effect/effect/system/smoke_spread/chem/proc/spawnSmoke(var/turf/T, var/icon/I, var/dist = 1)
var/obj/effect/effect/smoke/chem/smoke = new(location)
chemholder.reagents.copy_to(smoke, chemholder.reagents.total_volume / dist, safety = 1) //copy reagents to the smoke so mob/breathe() can handle inhaling the reagents
smoke.icon = I
smoke.layer = 6
smoke.dir = pick(cardinal)
smoke.pixel_x = -32 + rand(-8,8)
smoke.pixel_y = -32 + rand(-8,8)
walk_to(smoke, T)
smoke.opacity = 1 //switching opacity on after the smoke has spawned, and then
sleep(150+rand(0,20)) // turning it off before it is deleted results in cleaner
smoke.opacity = 0 // lighting and view range updates
fadeOut(smoke)
smoke.delete()
//------------------------------------------
// Fades out the smoke smoothly using it's alpha variable.
//------------------------------------------
/datum/effect/effect/system/smoke_spread/chem/proc/fadeOut(var/atom/A, var/frames = 16)
var/step = A.alpha / frames
for(var/i = 0, i < frames, i++)
A.alpha -= step
sleep(world.tick_lag)
return
//------------------------------------------
// Smoke pathfinder. Uses a flood fill method based on zones to
// quickly check what turfs the smoke (airflow) can actually reach.
//------------------------------------------
/datum/effect/effect/system/smoke_spread/chem/proc/smokeFlow()
var/list/pending = new()
var/list/complete = new()
pending += location
while(pending.len)
for(var/turf/simulated/current in pending)
for(var/D in cardinal)
var/turf/simulated/target = get_step(current, D)
if(wallList)
if(istype(target, /turf/simulated/wall))
if(!(target in wallList))
wallList += target
continue
if(!target.zone)
continue
if(target in pending)
continue
if(target in complete)
continue
if(!(target in targetTurfs))
continue
pending += target
pending -= current
complete += current
targetTurfs = complete
return
+450 -109
View File
@@ -21,6 +21,15 @@ would spawn and follow the beaker, even if it is carried or thrown.
flags = TABLEPASS
mouse_opacity = 0
/obj/effect/effect/smoke
name = "smoke"
icon = 'icons/effects/water.dmi'
icon_state = "smoke"
opacity = 1
anchored = 0.0
mouse_opacity = 0
var/amount = 8.0
/obj/effect/proc/delete()
loc = null
if(reagents)
@@ -216,172 +225,504 @@ steam.start() -- spawns the effect
/////////////////////////////////////////////
/obj/effect/effect/smoke
/obj/effect/effect/harmless_smoke
name = "smoke"
icon_state = "smoke"
opacity = 1
anchored = 0.0
mouse_opacity = 0
var/amount = 6.0
var/time_to_live = 100
//Remove this bit to use the old smoke
icon = 'icons/effects/96x96.dmi'
pixel_x = -32
pixel_y = -32
/obj/effect/effect/smoke/New()
/obj/effect/effect/harmless_smoke/New()
..()
spawn (time_to_live)
spawn (100)
delete()
return
/obj/effect/effect/smoke/Crossed(mob/living/carbon/M as mob )
/obj/effect/effect/harmless_smoke/Move()
..()
if(istype(M))
affect(M)
return
/datum/effect/effect/system/harmless_smoke_spread
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--
/obj/effect/effect/smoke/proc/affect(var/mob/living/carbon/M)
if (istype(M))
return 0
if (M.internal != null && M.wear_mask && (M.wear_mask.flags & MASKINTERNALS))
return 0
return 1
/////////////////////////////////////////////
// Bad smoke
/////////////////////////////////////////////
/obj/effect/effect/smoke/bad
time_to_live = 200
/obj/effect/effect/bad_smoke
name = "smoke"
icon_state = "smoke"
opacity = 1
anchored = 0.0
mouse_opacity = 0
var/amount = 6.0
//Remove this bit to use the old smoke
icon = 'icons/effects/96x96.dmi'
pixel_x = -32
pixel_y = -32
/obj/effect/effect/smoke/bad/Move()
/obj/effect/effect/bad_smoke/New()
..()
spawn (200+rand(10,30))
delete()
return
/obj/effect/effect/bad_smoke/Move()
..()
for(var/mob/living/carbon/M in get_turf(src))
affect(M)
if (M.internal != null && M.wear_mask && (M.wear_mask.flags & MASKINTERNALS))
else
M.drop_item()
M.adjustOxyLoss(1)
if (M.coughedtime != 1)
M.coughedtime = 1
M.emote("cough")
spawn ( 20 )
M.coughedtime = 0
return
/obj/effect/effect/smoke/bad/affect(var/mob/living/carbon/M)
if (!..())
return 0
M.drop_item()
M.adjustOxyLoss(1)
if (M.coughedtime != 1)
M.coughedtime = 1
M.emote("cough")
spawn ( 20 )
M.coughedtime = 0
/obj/effect/effect/smoke/bad/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
/obj/effect/effect/bad_smoke/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
if(air_group || (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 )
..()
if(istype(M, /mob/living/carbon))
if (M.internal != null && M.wear_mask && (M.wear_mask.flags & MASKINTERNALS))
return
else
M.drop_item()
M.adjustOxyLoss(1)
if (M.coughedtime != 1)
M.coughedtime = 1
M.emote("cough")
spawn ( 20 )
M.coughedtime = 0
return
/datum/effect/effect/system/bad_smoke_spread
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--
/////////////////////////////////////////////
// Chem smoke
/////////////////////////////////////////////
/obj/effect/effect/chem_smoke
name = "smoke"
opacity = 1
anchored = 0.0
mouse_opacity = 0
var/amount = 6.0
icon = 'icons/effects/chemsmoke.dmi'
pixel_x = -32
pixel_y = -32
/obj/effect/effect/chem_smoke/New()
..()
var/datum/reagents/R = new/datum/reagents(500)
reagents = R
R.my_atom = src
spawn (200+rand(10,30))
delete()
return
/obj/effect/effect/chem_smoke/Move()
..()
for(var/atom/A in view(2, src))
if(reagents.has_reagent("radium")||reagents.has_reagent("uranium")||reagents.has_reagent("carbon")||reagents.has_reagent("thermite"))//Prevents unholy radium spam by reducing the number of 'greenglows' down to something reasonable -Sieve
if(prob(5))
reagents.reaction(A)
else
reagents.reaction(A)
return
/obj/effect/effect/chem_smoke/Crossed(mob/living/carbon/M as mob )
..()
reagents.reaction(M)
return
/datum/effect/effect/system/chem_smoke_spread
var/total_smoke = 0 // To stop it being spammed and lagging!
var/direction
var/obj/chemholder
New()
..()
chemholder = new/obj()
var/datum/reagents/R = new/datum/reagents(500)
chemholder.reagents = R
R.my_atom = chemholder
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)
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>"
if(carry.my_atom.fingerprintslast)
var/mob/M = get_mob_by_key(carry.my_atom.fingerprintslast)
var/more = ""
if(M)
more = "(<A HREF='?_src_=holder;adminmoreinfo=\ref[M]'>?</a>)"
message_admins("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
message_admins("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.")
start()
var/i = 0
var/color = mix_color_from_reagents(chemholder.reagents.reagent_list)
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(chemholder.reagents.total_volume != 1) // can't split 1 very well
chemholder.reagents.copy_to(smoke, chemholder.reagents.total_volume / number) // copy reagents to each smoke, divide evenly
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--
// Goon compat.
/datum/effect/effect/system/chem_smoke_spread/fart
set_up(var/mob/M, n = 5, c = 0, loca, direct)
if(n > 20)
n = 20
number = n
cardinals = c
chemholder.reagents.add_reagent("space_drugs", rand(1,10))
if(istype(loca, /turf/))
location = loca
else
location = get_turf(loca)
if(direct)
direction = direct
var/contained = "\[[chemholder.reagents.get_reagent_ids()]\]"
var/area/A = get_area(location)
var/where = "[A.name] | [location.x], [location.y]"
var/whereLink=formatJumpTo(location,where)
var/more = "(<A HREF='?_src_=holder;adminmoreinfo=\ref[M]'>?</a>)"
message_admins("[M][more] produced a toxic fart in ([whereLink])[contained].", 0, 1)
log_game("[M][more] produced a toxic fart in ([where])[contained].")
/////////////////////////////////////////////
// Sleep smoke
/////////////////////////////////////////////
/obj/effect/effect/smoke/sleepy
/obj/effect/effect/sleep_smoke
name = "smoke"
icon_state = "smoke"
opacity = 1
anchored = 0.0
mouse_opacity = 0
var/amount = 6.0
//Remove this bit to use the old smoke
icon = 'icons/effects/96x96.dmi'
pixel_x = -32
pixel_y = -32
/obj/effect/effect/smoke/sleepy/Move()
/obj/effect/effect/sleep_smoke/New()
..()
spawn (200+rand(10,30))
delete()
return
/obj/effect/effect/sleep_smoke/Move()
..()
for(var/mob/living/carbon/M in get_turf(src))
affect(M)
if (M.internal != null && M.wear_mask && (M.wear_mask.flags & MASKINTERNALS))
// if (M.wear_suit, /obj/item/clothing/suit/wizrobe && (M.hat, /obj/item/clothing/head/wizard) && (M.shoes, /obj/item/clothing/shoes/sandal)) // I'll work on it later
else
M.drop_item()
M:sleeping += 1
if (M.coughedtime != 1)
M.coughedtime = 1
M.emote("cough")
spawn ( 20 )
M.coughedtime = 0
return
/obj/effect/effect/smoke/sleepy/affect(mob/living/carbon/M as mob )
if (!..())
return 0
/obj/effect/effect/sleep_smoke/Crossed(mob/living/carbon/M as mob )
..()
if(istype(M, /mob/living/carbon))
if (M.internal != null && M.wear_mask && (M.wear_mask.flags & MASKINTERNALS))
// if (M.wear_suit, /obj/item/clothing/suit/wizrobe && (M.hat, /obj/item/clothing/head/wizard) && (M.shoes, /obj/item/clothing/shoes/sandal)) // Work on it later
return
else
M.drop_item()
M:sleeping += 1
if (M.coughedtime != 1)
M.coughedtime = 1
M.emote("cough")
spawn ( 20 )
M.coughedtime = 0
return
/datum/effect/effect/system/sleep_smoke_spread
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/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--
M.drop_item()
M:sleeping += 1
if (M.coughedtime != 1)
M.coughedtime = 1
M.emote("cough")
spawn ( 20 )
M.coughedtime = 0
/////////////////////////////////////////////
// Mustard Gas
/////////////////////////////////////////////
/obj/effect/effect/smoke/mustard
/obj/effect/effect/mustard_gas
name = "mustard gas"
icon_state = "mustard"
opacity = 1
anchored = 0.0
mouse_opacity = 0
var/amount = 6.0
/obj/effect/effect/smoke/mustard/Move()
/obj/effect/effect/mustard_gas/New()
..()
for(var/mob/living/carbon/human/R in get_turf(src))
affect(R)
/obj/effect/effect/smoke/mustard/affect(var/mob/living/carbon/human/R)
if (!..())
return 0
if (R.wear_suit != null)
return 0
R.burn_skin(0.75)
if (R.coughedtime != 1)
R.coughedtime = 1
R.emote("gasp")
spawn (20)
R.coughedtime = 0
R.updatehealth()
spawn (100)
del(src)
return
/////////////////////////////////////////////
// Smoke spread
/////////////////////////////////////////////
/obj/effect/effect/mustard_gas/Move()
..()
for(var/mob/living/carbon/human/R in get_turf(src))
if (R.internal != null && usr.wear_mask && (R.wear_mask.flags & MASKINTERNALS) && 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)))
else
R.burn_skin(0.75)
if (R.coughedtime != 1)
R.coughedtime = 1
R.emote("gasp")
spawn (20)
R.coughedtime = 0
R.updatehealth()
return
/datum/effect/effect/system/smoke_spread
/obj/effect/effect/mustard_gas/Crossed(mob/living/carbon/human/R as mob )
..()
if (istype(R, /mob/living/carbon/human))
if (R.internal != null && usr.wear_mask && (R.wear_mask.flags & MASKINTERNALS) && 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.burn_skin(0.75)
if (R.coughedtime != 1)
R.coughedtime = 1
R.emote("gasp")
spawn (20)
R.coughedtime = 0
R.updatehealth()
return
/datum/effect/effect/system/mustard_gas_spread
var/total_smoke = 0 // To stop it being spammed and lagging!
var/direction
var/smoke_type = /obj/effect/effect/smoke
/datum/effect/effect/system/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
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/effect/system/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/smoke/smoke = new smoke_type(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(smoke.time_to_live*0.75+rand(10,30))
if (smoke) smoke.delete()
src.total_smoke--
/datum/effect/effect/system/smoke_spread/bad
smoke_type = /obj/effect/effect/smoke/bad
/datum/effect/effect/system/smoke_spread/sleepy
smoke_type = /obj/effect/effect/smoke/sleepy
/datum/effect/effect/system/smoke_spread/mustard
smoke_type = /obj/effect/effect/smoke/mustard
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)
del(smoke)
src.total_smoke--
/////////////////////////////////////////////
@@ -37,7 +37,7 @@
user << "<span class='notice'>\The [src] is full.</span>"
return
reagents.remove_reagent(25,"water")
var/datum/effect/effect/system/smoke_spread/bad/smoke = new /datum/effect/effect/system/smoke_spread/bad()
var/datum/effect/effect/system/bad_smoke_spread/smoke = new /datum/effect/effect/system/bad_smoke_spread()
smoke.set_up(5, 0, user.loc)
smoke.start()
playsound(user.loc, 'sound/effects/bamf.ogg', 50, 2)
@@ -7,11 +7,11 @@
item_state = "flashbang"
flags = FPRINT | TABLEPASS
slot_flags = SLOT_BELT
var/datum/effect/effect/system/smoke_spread/bad/smoke
var/datum/effect/effect/system/bad_smoke_spread/smoke
New()
..()
src.smoke = new /datum/effect/effect/system/smoke_spread/bad
src.smoke = new /datum/effect/effect/system/bad_smoke_spread
src.smoke.attach(src)
prime()
+1 -1
View File
@@ -55,7 +55,7 @@
if(!((user == loc || (in_range(src, user) && istype(src.loc, /turf)))))
return
var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread()
var/datum/effect/effect/system/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread()
smoke.set_up(5, 0, user.loc)
smoke.attach(user)
smoke.start()
+2 -2
View File
@@ -31,11 +31,11 @@
s.start()
if(entersmoke)
var/datum/effect/effect/system/smoke_spread/s = new /datum/effect/effect/system/smoke_spread
var/datum/effect/effect/system/harmless_smoke_spread/s = new /datum/effect/effect/system/harmless_smoke_spread
s.set_up(4, 1, src, 0)
s.start()
if(exitsmoke)
var/datum/effect/effect/system/smoke_spread/s = new /datum/effect/effect/system/smoke_spread
var/datum/effect/effect/system/harmless_smoke_spread/s = new /datum/effect/effect/system/harmless_smoke_spread
s.set_up(4, 1, dest, 0)
s.start()
+1 -1
View File
@@ -30,7 +30,7 @@
R.my_atom = vent
R.add_reagent(pick(gunk), 50)
var/datum/effect/effect/system/smoke_spread/chem/smoke = new
var/datum/effect/effect/system/chem_smoke_spread/smoke = new
smoke.set_up(R, rand(1, 2), 0, vent, 0, silent = 1)
playsound(vent.loc, 'sound/effects/smoke.ogg', 50, 1, -3)
smoke.start()
@@ -130,7 +130,7 @@
breath = loc.remove_air(breath_moles)
// Handle chem smoke effect -- Doohl
for(var/obj/effect/effect/smoke/chem/smoke in view(1, src))
for(var/obj/effect/effect/chem_smoke/smoke in view(1, src))
if(smoke.reagents.total_volume)
smoke.reagents.reaction(src, INGEST)
spawn(5)
@@ -103,7 +103,7 @@
breath = loc.remove_air(breath_moles)
// Handle chem smoke effect -- Doohl
for(var/obj/effect/effect/smoke/chem/smoke in view(1, src))
for(var/obj/effect/effect/chem_smoke/smoke in view(1, src))
if(smoke.reagents.total_volume)
smoke.reagents.reaction(src, INGEST)
spawn(5)
+1 -1
View File
@@ -395,7 +395,7 @@
if(!block)
for(var/obj/effect/effect/smoke/chem/smoke in view(1, src))
for(var/obj/effect/effect/chem_smoke/smoke in view(1, src))
if(smoke.reagents.total_volume)
smoke.reagents.reaction(src, INGEST)
spawn(5)
@@ -134,7 +134,6 @@
heal_overall_damage(rads,rads)
adjustOxyLoss(-(rads))
adjustToxLoss(-(rads))
updatehealth()
return
if (radiation > 100)
@@ -148,7 +147,6 @@
radiation--
if(prob(25))
adjustToxLoss(1)
updatehealth()
if(50 to 74)
radiation -= 2
@@ -158,7 +156,6 @@
Weaken(3)
src << "\red You feel weak."
emote("collapse")
updatehealth()
if(75 to 100)
radiation -= 3
@@ -257,7 +254,8 @@
block = 1
if(!block)
for(var/obj/effect/effect/smoke/chem/smoke in view(1, src))
for(var/obj/effect/effect/chem_smoke/smoke in view(1, src))
if(smoke.reagents.total_volume)
smoke.reagents.reaction(src, INGEST)
spawn(5)
@@ -483,12 +481,9 @@
else
dizziness = max(0, dizziness - 1)
updatehealth()
return //TODO: DEFERRED
proc/handle_regular_status_updates()
updatehealth()
if(stat == DEAD) //DEAD. BROWN BREAD. SWIMMING WITH THE SPESS CARP
blinded = 1
@@ -92,7 +92,7 @@
//smoke, water and steam calms us down
var/calming = 0
var/list/calmers = list(/obj/effect/effect/smoke/chem, \
var/list/calmers = list(/obj/effect/effect/chem_smoke, \
/obj/effect/effect/water, \
/obj/effect/effect/foam, \
/obj/effect/effect/steam, \
@@ -79,7 +79,7 @@
New()
..()
var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread()
var/datum/effect/effect/system/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread()
smoke.set_up(5, 0, src.loc)
smoke.start()
visible_message("\red <B>The [src] warps in!</B>")
-5
View File
@@ -319,7 +319,6 @@ This function completely restores a damaged organ to perfect condition.
perma_injury = 0
update_germs()
update_icon()
return
//Updating germ levels. Handles organ germ levels and necrosis.
@@ -451,10 +450,6 @@ This function completely restores a damaged organ to perfect condition.
var/n_is = damage_state_text()
if (n_is != damage_state)
damage_state = n_is
if(status & ORGAN_DESTROYED)
owner.update_body(1)
else
owner.UpdateDamageIcon(1)
return 1
return 0
+1 -1
View File
@@ -1009,7 +1009,7 @@
cell.corrupt()
src.malfhack = 1
update_icon()
var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread()
var/datum/effect/effect/system/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread()
smoke.set_up(3, 0, src.loc)
smoke.attach(src)
smoke.start()
+2 -2
View File
@@ -274,7 +274,7 @@
for(var/mob/M in viewers(src))
M.show_message("\red The [src.name] is making strange noises!", 3, "\red You hear sizzling electronics.", 2)
sleep(10*pick(4,5,6,7,10,14))
var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread()
var/datum/effect/effect/system/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread()
smoke.set_up(3, 0, src.loc)
smoke.attach(src)
smoke.start()
@@ -292,7 +292,7 @@
emp_act(2)
if(prob(5)) //smoke only
world << "\red SMES smoke in [src.loc.loc]"
var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread()
var/datum/effect/effect/system/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread()
smoke.set_up(3, 0, src.loc)
smoke.attach(src)
smoke.start()
+1 -1
View File
@@ -106,7 +106,7 @@
/obj/item/weapon/gun/magic/wand/teleport/zap_self(mob/living/user as mob)
do_teleport(user, user, 10)
var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread()
var/datum/effect/effect/system/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread()
smoke.set_up(10, 0, user.loc)
smoke.start()
charges--
+1 -1
View File
@@ -87,7 +87,7 @@
if(!stuff.anchored && stuff.loc)
teleammount++
do_teleport(stuff, stuff, 10)
var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread()
var/datum/effect/effect/system/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread()
smoke.set_up(max(round(10 - teleammount),1), 0, stuff.loc) //Smoke drops off if a lot of stuff is moved for the sake of sanity
smoke.start()
+28 -43
View File
@@ -39,32 +39,31 @@ datum
var/datum/reagent/self = src
src = null //of the reagent to the mob on TOUCHING it.
if(self.holder) //for catching rare runtimes
if(!istype(self.holder.my_atom, /obj/effect/effect/smoke/chem))
// If the chemicals are in a smoke cloud, do not try to let the chemicals "penetrate" into the mob's system (balance station 13) -- Doohl
if(!istype(self.holder.my_atom, /obj/effect/effect/chem_smoke))
// If the chemicals are in a smoke cloud, do not try to let the chemicals "penetrate" into the mob's system (balance station 13) -- Doohl
if(method == TOUCH)
if(method == TOUCH)
var/chance = 1
var/block = 0
var/chance = 1
var/block = 0
for(var/obj/item/clothing/C in M.get_equipped_items())
if(C.permeability_coefficient < chance) chance = C.permeability_coefficient
if(istype(C, /obj/item/clothing/suit/bio_suit))
// bio suits are just about completely fool-proof - Doohl
// kind of a hacky way of making bio suits more resistant to chemicals but w/e
if(prob(75))
block = 1
for(var/obj/item/clothing/C in M.get_equipped_items())
if(C.permeability_coefficient < chance) chance = C.permeability_coefficient
if(istype(C, /obj/item/clothing/suit/bio_suit))
// bio suits are just about completely fool-proof - Doohl
// kind of a hacky way of making bio suits more resistant to chemicals but w/e
if(prob(75))
block = 1
if(istype(C, /obj/item/clothing/head/bio_hood))
if(prob(75))
block = 1
if(istype(C, /obj/item/clothing/head/bio_hood))
if(prob(75))
block = 1
chance = chance * 100
chance = chance * 100
if(prob(chance) && !block)
if(M.reagents)
M.reagents.add_reagent(self.id,self.volume/2)
if(prob(chance) && !block)
if(M.reagents)
M.reagents.add_reagent(self.id,self.volume/2)
return 1
reaction_obj(var/obj/O, var/volume) //By default we transfer a small part of the reagent to the object
@@ -791,12 +790,7 @@ datum
reaction_turf(var/turf/T, var/volume)
src = null
if(!istype(T, /turf/space))
var/obj/effect/decal/cleanable/dirt/dirtoverlay = locate(/obj/effect/decal/cleanable/dirt, T)
if (!dirtoverlay)
dirtoverlay = new/obj/effect/decal/cleanable/dirt(T)
dirtoverlay.alpha = volume*30
else
dirtoverlay.alpha = min(dirtoverlay.alpha+volume*30, 255)
new /obj/effect/decal/cleanable/dirt(T)
chlorine
name = "Chlorine"
@@ -1091,9 +1085,7 @@ datum
src = null
if(volume >= 3)
if(!istype(T, /turf/space))
var/obj/effect/decal/cleanable/greenglow/glow = locate(/obj/effect/decal/cleanable/greenglow, T)
if(!glow)
new /obj/effect/decal/cleanable/greenglow(T)
new /obj/effect/decal/cleanable/greenglow(T)
return
@@ -1132,9 +1124,9 @@ datum
src = null
if(volume >= 5)
if(istype(T, /turf/simulated/wall))
var/turf/simulated/wall/W = T
W.thermite = 1
W.overlays += image('icons/effects/effects.dmi',icon_state = "#673910")
T:thermite = 1
T.overlays.Cut()
T.overlays = image('icons/effects/effects.dmi',icon_state = "thermite")
return
on_mob_life(var/mob/living/M as mob)
@@ -1289,10 +1281,7 @@ datum
src = null
if(volume >= 3)
if(!istype(T, /turf/space))
var/obj/effect/decal/cleanable/greenglow/glow = locate(/obj/effect/decal/cleanable/greenglow, T)
if(!glow)
new /obj/effect/decal/cleanable/greenglow(T)
return
new /obj/effect/decal/cleanable/greenglow(T)
aluminum
name = "Aluminum"
@@ -1351,6 +1340,7 @@ datum
O.clean_blood()
reaction_turf(var/turf/T, var/volume)
if(volume >= 1)
T.overlays.Cut()
T.clean_blood()
for(var/obj/effect/decal/cleanable/C in src)
del(C)
@@ -2402,16 +2392,11 @@ datum
victim.Weaken(5)
//victim.Paralyse(10)
//victim.drop_item()
on_mob_life(var/mob/living/M as mob)
if(!M) M = holder.my_atom
if(prob(5))
M.visible_message("<span class='warning'>[M] [pick("dry heaves!","coughs!","splutters!")]</span>")
return
frostoil
name = "Frost Oil"
id = "frostoil"
description = "A special oil that noticably chills the body. Extracted from Ice Peppers."
description = "A special oil that noticably chills the body. Extraced from Icepeppers."
reagent_state = LIQUID
color = "#B31008" // rgb: 139, 166, 233
@@ -2473,7 +2458,7 @@ datum
hot_coco
name = "Hot Chocolate"
id = "hot_coco"
description = "Made with love! And cocoa beans."
description = "Made with love! And coco beans."
reagent_state = LIQUID
nutriment_factor = 2 * REAGENTS_METABOLISM
color = "#403010" // rgb: 64, 48, 16
+3 -1
View File
@@ -448,12 +448,14 @@ datum
secondary = 1
on_reaction(var/datum/reagents/holder, var/created_volume)
var/location = get_turf(holder.my_atom)
var/datum/effect/effect/system/smoke_spread/chem/S = new /datum/effect/effect/system/smoke_spread/chem
var/datum/effect/effect/system/chem_smoke_spread/S = new /datum/effect/effect/system/chem_smoke_spread
S.attach(location)
S.set_up(holder, 10, 0, location)
playsound(location, 'sound/effects/smoke.ogg', 50, 1, -3)
spawn(0)
S.start()
sleep(10)
S.start()
holder.clear_reagents()
return
+1 -1
View File
@@ -218,7 +218,7 @@
return
Bumped(var/atom/movable/AM) //Go straight into the chute
if(istype(AM, /obj/item/projectile) || istype(AM, /obj/effect)) return
if(istype(AM, /obj/item/projectile)) return
switch(dir)
if(NORTH)
if(AM.loc.y != src.loc.y+1) return
@@ -37,7 +37,7 @@ datum/chemical_reaction/coolant
explode()
/obj/structure/reagent_dispensers/coolanttank/proc/explode()
var/datum/effect/effect/system/smoke_spread/S = new /datum/effect/effect/system/smoke_spread
var/datum/effect/effect/system/harmless_smoke_spread/S = new /datum/effect/effect/system/harmless_smoke_spread
//S.attach(src)
S.set_up(5, 0, src.loc)
+1 -1
View File
@@ -95,7 +95,7 @@
playsound(src.loc, 'sound/effects/bang.ogg', 25, 1)
var/turf/T = get_turf(src)
if(T)
var/datum/effect/effect/system/smoke_spread/smoke = new
var/datum/effect/effect/system/harmless_smoke_spread/smoke = new
smoke.set_up(3, 0, src.loc)
smoke.attach(src)
smoke.start()
+2 -2
View File
@@ -318,7 +318,7 @@
if(T.y>world.maxy-4 || T.y<4) continue
turfs += T
if(!turfs.len) turfs += pick(/turf in orange(6))
var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread()
var/datum/effect/effect/system/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread()
smoke.set_up(10, 0, usr.loc)
smoke.start()
var/turf/picked = pick(turfs)
@@ -360,7 +360,7 @@
usr.say("SCYAR NILA [uppertext(A)]")
var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread()
var/datum/effect/effect/system/harmless_smoke_spread/smoke = new /datum/effect/effect/system/harmless_smoke_spread()
smoke.set_up(5, 0, usr.loc)
smoke.attach(usr)
smoke.start()