Smoke changes

- Changes smoke so that it immediately affects all mobs in its area of
effect, smoke clouds are purely visual.
- Any mobs in the area of effect of a smoke reaction will be affected by
the smoke's touch reaction, and have all reagents in the smoke container
transferred into them.
- Smoke clouds are no longer opaque.
- Mixing 10u potassium, 10u sugar, and 10u phosphorus or higher will
cause an area of effect with a radius of 3 from the point of reaction.
Any less will have a radius of 2.
- Same with heating 10u smoke powder.
- Smoke powder reaction now only yields 1 powder instead of 3.
- Vent clog event has a radius 3 area of effect.

Fixes and uncommenting

- Uncomments honey turf reaction.
- Uncomments synthflesh turf reaction.
- Adds list for reagents to not copy via smoke (or more specifically,
delete when a smoke reaction happens without copying). This includes
sugar, phosphorus, potassium, and the smoke "reagent" produced in a
smoke reaction.
This commit is contained in:
DZD
2015-04-07 17:41:19 -04:00
parent 52ec26a52f
commit 810d626700
9 changed files with 55 additions and 125 deletions
+10 -23
View File
@@ -404,7 +404,7 @@ steam.start() -- spawns the effect
/obj/effect/effect/chem_smoke
name = "smoke"
opacity = 1
opacity = 0
anchored = 0.0
mouse_opacity = 0
var/amount = 6.0
@@ -415,28 +415,12 @@ steam.start() -- spawns the effect
/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")||reagents.has_reagent("synthflesh")||reagents.has_reagent("firefighting_foam")||reagents.has_reagent("honey"))//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
@@ -488,11 +472,18 @@ steam.start() -- spawns the effect
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.")
start()
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.wear_mask && (C.internals != null || C.wear_mask.flags & BLOCK_GAS_SMOKE_EFFECT)))
chemholder.reagents.copy_to(C, chemholder.reagents.total_volume)
qdel(smokeholder)
for(i=0, i<src.number, i++)
if(src.total_smoke > 20)
return
@@ -508,16 +499,12 @@ steam.start() -- spawns the effect
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)
+15 -15
View File
@@ -848,7 +848,7 @@ var/global/list/obj/item/device/pda/PDAs = list()
empulse(P.loc, 3, 6, 1)
message += "Your [P] emits a wave of electromagnetic energy!"
if(i>=25 && i<=40) //Smoke
var/datum/effect/effect/system/chem_smoke_spread/S = new /datum/effect/effect/system/chem_smoke_spread
var/datum/effect/effect/system/harmless_smoke_spread/S = new /datum/effect/effect/system/harmless_smoke_spread //Why was this chem_smoke_spread when there are no chems involved?
S.attach(P.loc)
S.set_up(P, 10, 0, P.loc)
playsound(P.loc, 'sound/effects/smoke.ogg', 50, 1, -3)
@@ -884,9 +884,9 @@ var/global/list/obj/item/device/pda/PDAs = list()
message += "It melts in a puddle of plastic."
else
message += "Your [P] shatters in a thousand pieces!"
JFLOG("[M]'s PDA Detonated >>> [message]")
if(M && isliving(M))
message = "\red" + message
M.show_message(message, 1)
@@ -1402,26 +1402,26 @@ var/global/list/obj/item/device/pda/PDAs = list()
A.emp_act(severity)
/**
*
*
* JFLOG
*
*
* These functions as well as all the log statements are being used to gather user data for how
* people are using the PDA files with the intent of revising them based on this data.
*
* They are being added on 28/03/2015 and the intent is to remove them in two weeks. If you're
* reading this and it's substantially past that point, you should remove anything marked with
* 'JFLOG'.
*
* All changes should be contained to PDA.dm except the creation function which is contained in
* people are using the PDA files with the intent of revising them based on this data.
*
* They are being added on 28/03/2015 and the intent is to remove them in two weeks. If you're
* reading this and it's substantially past that point, you should remove anything marked with
* 'JFLOG'.
*
* All changes should be contained to PDA.dm except the creation function which is contained in
* job_controller.dm.
*
* - Jack Fractal
*
* - Jack Fractal
**/
/obj/item/device/pda/proc/JFLOG_DescribeSelf()
return "([src]|[cartridge ? cartridge.name : "None"])"
/obj/item/device/pda/proc/JFLOG(message as text)
if (config)
log_pda("[JFLOG_DescribeSelf()] >>> [message]")
+1 -1
View File
@@ -32,5 +32,5 @@
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()
smoke.start(3)
R.delete() //GC the reagents
@@ -54,15 +54,6 @@
breath = loc.remove_air(breath_moles)
// Handle chem smoke effect -- Doohl
for(var/obj/effect/effect/chem_smoke/smoke in view(1, src))
if(smoke.reagents.total_volume)
smoke.reagents.reaction(src, INGEST)
spawn(5)
if(smoke)
smoke.reagents.copy_to(src, 10) // I dunno, maybe the reagents enter the blood stream through the lungs?
break // If they breathe in the nasty stuff once, no need to continue checking
else //Still give containing object the chance to interact
if(istype(loc, /obj/))
@@ -369,28 +369,6 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
if(prob(5))
rupture_lung()
// Handle chem smoke effect -- Doohl
var/block = 0
if(wear_mask)
if(wear_mask.flags & BLOCK_GAS_SMOKE_EFFECT)
block = 1
if(glasses)
if(glasses.flags & BLOCK_GAS_SMOKE_EFFECT)
block = 1
if(head)
if(head.flags & BLOCK_GAS_SMOKE_EFFECT)
block = 1
if(!block)
for(var/obj/effect/effect/chem_smoke/smoke in view(1, src))
if(smoke.reagents.total_volume)
smoke.reagents.reaction(src, INGEST)
spawn(5)
if(smoke)
smoke.reagents.copy_to(src, 10) // I dunno, maybe the reagents enter the blood stream through the lungs?
break // If they breathe in the nasty stuff once, no need to continue checking
else //Still give containing object the chance to interact
if(istype(loc, /obj/))
var/obj/location_as_object = loc
@@ -250,21 +250,6 @@
var/breath_moles = environment.total_moles()*BREATH_PERCENTAGE
breath = loc.remove_air(breath_moles)
// Handle chem smoke effect -- Doohl
var/block = 0
if(wear_mask)
if(istype(wear_mask, /obj/item/clothing/mask/gas))
block = 1
if(!block)
for(var/obj/effect/effect/chem_smoke/smoke in view(1, src))
if(smoke.reagents.total_volume)
smoke.reagents.reaction(src, INGEST)
spawn(5)
if(smoke)
smoke.reagents.copy_to(src, 10) // I dunno, maybe the reagents enter the blood stream through the lungs?
break // If they breathe in the nasty stuff once, no need to continue checking
else //Still give containing object the chance to interact
+2 -2
View File
@@ -119,12 +119,12 @@ datum/reagent/honey/on_mob_life(var/mob/living/M as mob)
M.reagents.add_reagent("sugar", 0.8)
..()
return
/* //Commenting this out until smoke is rewritten, otherwise, this spam so much honeycomb it's not funny
datum/reagent/honey/reaction_turf(var/turf/T, var/volume)
src = null
if(volume >= 5)
new /obj/item/weapon/reagent_containers/food/snacks/honeycomb(T)
return */
return
/datum/reagent/mugwort
name = "Mugwort"
+1 -2
View File
@@ -94,13 +94,12 @@ datum/reagent/synthflesh/reaction_mob(var/mob/living/M, var/method=TOUCH, var/vo
..()
return
/* //again, not until smoke rewrite--so many gibs,aghh!
datum/reagent/synthflesh/reaction_turf(var/turf/T, var/volume) //let's make a mess!
src = null
if(volume >= 5)
new /obj/effect/decal/cleanable/blood/gibs(T)
playsound(T, 'sound/effects/splat.ogg', 50, 1, -3)
return */
return
datum/reagent/charcoal
name = "Charcoal"
+26 -36
View File
@@ -260,50 +260,40 @@
name = "smoke_powder"
id = "smoke_powder"
result = "smoke_powder"
required_reagents = list("stabilizing_agent" = 1, "potassium" = 1, "sugar" = 1, "phosphorus" = 1)
result_amount = 1
/datum/chemical_reaction/smoke
name = "smoke"
id = "smoke"
result = null
required_reagents = list("potassium" = 1, "sugar" = 1, "phosphorus" = 1)
result_amount = 3
result_amount = 1
/datum/chemical_reaction/smoke/on_reaction(var/datum/reagents/holder, var/created_volume)
var/forbidden_reagents = list(id, "sugar", "phosphorus", "potassium") //Do not transfer this stuff through smoke.
for(var/f_reagent in forbidden_reagents)
if(holder.has_reagent(f_reagent))
holder.remove_reagent(f_reagent, holder.get_reagent_amount(f_reagent))
var/location = get_turf(holder.my_atom)
var/datum/effect/effect/system/chem_smoke_spread/S = new /datum/effect/effect/system/chem_smoke_spread
S.attach(location)
playsound(location, 'sound/effects/smoke.ogg', 50, 1, -3)
spawn(0)
if(S)
S.set_up(holder, 10, 0, location)
S.start(created_volume >= 10 ? 3 : 2)
if(holder && holder.my_atom)
holder.clear_reagents()
return
/datum/chemical_reaction/smoke_powder_smoke
/datum/chemical_reaction/smoke/smoke_powder
name = "smoke_powder_smoke"
id = "smoke_powder_smoke"
result = null
required_reagents = list("smoke_powder" = 1)
required_temp = 374
secondary = 1
/datum/chemical_reaction/smoke_powder_smoke/on_reaction(var/datum/reagents/holder, var/created_volume)
var/location = get_turf(holder.my_atom)
var/datum/effect/effect/system/chem_smoke_spread/S = new /datum/effect/effect/system/chem_smoke_spread
S.attach(location)
playsound(location, 'sound/effects/smoke.ogg', 50, 1, -3)
spawn(0)
if(S)
S.set_up(holder, 10, 0, location)
S.start()
sleep(10)
S.start()
if(holder && holder.my_atom)
holder.clear_reagents()
return
/datum/chemical_reaction/smoke_powder/on_reaction(var/datum/reagents/holder, var/created_volume)
if(holder.has_reagent("stabilizing_agent"))
return
holder.remove_reagent("smoke_powder", created_volume)
var/location = get_turf(holder.my_atom)
var/datum/effect/effect/system/chem_smoke_spread/S = new /datum/effect/effect/system/chem_smoke_spread
S.attach(location)
playsound(location, 'sound/effects/smoke.ogg', 50, 1, -3)
spawn(0)
if(S)
S.set_up(holder, 10, 0, location)
S.start()
sleep(10)
S.start()
if(holder && holder.my_atom)
holder.clear_reagents()
return
result_amount = 1
/datum/reagent/sonic_powder
name = "Sonic Powder"