[no gbp] Reworked sparks to not be so immensely destructive in benign circumstances (#84193)

## About The Pull Request

So sparks were laying waste to every department that had sparks as a
little pizzazz particle effect, which turned out to be seemingly every
single department, and also just a bunch of random shit we had laying
around. That wasn't really the goal so I've reworked them, for now,
until I'm able to more comprehensively address how we handle things that
are combustible vs things that are actually dangerously flammable, which
we don't differentiate for now.

Sparks now send a signal to whatever thing is touching those sparks.
Right now I've specifically made pools of welding fuel, things made of
plasma, people covered in flammables, and cigarettes respond to this
signal. Sparks that touch objects with reagents in them will heat those
reagents marginally (approximately 40kelvin increase from 300 kelvin
underneath a popped lightbulb). There is also another signal
'HAZARDOUS_SPARKS' but as of this PR it is not used.

If you walk into sparks or get showered by them, the sparks will also
interact with any of your visible equipment (outerwear and held items),
but to reiterate, nothing besides the above stated items have
interactions with sparks... for now...
## Why It's Good For The Game

I won't apologize for being hilarious but turning departments into
fields of burnt boxes, tables, vegetables, and crates wasn't really the
intent.
Addresses #84169 and similar
## Changelog
🆑 Bisar
balance: Sparks have been heavily adjusted; they only affect items made
of plasma, pools of welding fuel, flammable people, cigarettes, and
items that contain reagents... for now. Their long-standing behavior of
igniting flammable gas has been untouched.
/🆑
This commit is contained in:
Joshua Kidder
2024-06-23 16:40:14 +01:00
committed by GitHub
parent 01aa16ac11
commit fa3f591138
6 changed files with 48 additions and 27 deletions
@@ -57,6 +57,7 @@
*/
/obj/effect/particle_effect/sparks/proc/affect_location(turf/location, just_initialized = FALSE)
location.hotspot_expose(1000,100)
SEND_SIGNAL(location, COMSIG_ATOM_TOUCHED_SPARKS, src) // for plasma floors; other floor types only have to worry about the mysterious HAZARDOUS sparks
if(just_initialized)
for(var/atom/movable/singed in location)
sparks_touched(src, singed)
@@ -67,43 +68,27 @@
* This is invoked by the signals sent by every atom when they're crossed or crossing something. It
* signifies that something has been touched by sparks, and should be affected by possible pyrotechnic affects..
* datum/source - Can either be the spark itself or an object that just walked into it
* mob/living/singed_mob - The mob that was touched by the spark
* mob/living/singed - What was touched by the spark
*/
/obj/effect/particle_effect/sparks/proc/sparks_touched(datum/source, atom/movable/singed)
/obj/effect/particle_effect/sparks/proc/sparks_touched(datum/source, atom/singed)
SIGNAL_HANDLER
SEND_SIGNAL(singed, COMSIG_ATOM_TOUCHED_SPARKS, src)
if(isobj(singed))
var/obj/singed_obj = singed
if(singed_obj.reagents)
var/datum/reagents/reagents = singed_obj.reagents // heat up things that contain reagents before we check to see if they burn
if(singed.reagents)
var/datum/reagents/reagents = singed.reagents // heat up things that contain reagents before we check to see if they burn
reagents?.expose_temperature(1000) // we set this at 1000 because that's the max reagent temp for a chem heater, higher temps require more than sparks
if(singed_obj.custom_materials && (GET_MATERIAL_REF(/datum/material/plasma) in singed_obj.custom_materials))
singed_obj.fire_act(FIRE_MINIMUM_TEMPERATURE_TO_SPREAD,100)
return // if it's made of plasma we just start burning no matter what, even furniture (see right below)
if(isstructure(singed_obj) || ismachinery(singed_obj)) // don't ignite furniture even if it's flammable, leave that to actual fires
return
if(singed_obj.resistance_flags & FLAMMABLE && !(singed_obj.resistance_flags & ON_FIRE)) //only fire_act flammable objects instead of burning EVERYTHING
if(isitem(singed_obj))
var/obj/item/singed_item = singed_obj
var/ignite_chance = 120 // base chance applies to anything under WEIGHT_CLASS_NORMAL, so burn everything flammable that's small/tiny
if(singed_item.w_class > WEIGHT_CLASS_SMALL)
var/ignite_chance_penalty = (singed_item.w_class * 2 + round(singed_item.w_class * 0.5)) * 10 // size penalties to ignite chance: normal = 70, bulky = 100,
ignite_chance -= ignite_chance_penalty // the bigger the item, the less likely it is to ignite
if(prob(ignite_chance))
singed_item.fire_act(FIRE_MINIMUM_TEMPERATURE_TO_SPREAD,100)
return
else
singed_obj.fire_act(FIRE_MINIMUM_TEMPERATURE_TO_SPREAD,100)
return
if(isliving(singed))
var/mob/living/singed_living = singed
if(singed_living.fire_stacks)
singed_living.ignite_mob(FALSE) //ignite the mob, silent = FALSE (You're set on fire!)
return
if(ishuman(singed))
var/mob/living/carbon/human/singed_human = singed
for(var/obj/item/anything in singed_human.get_visible_items())
sparks_touched(src, anything)
/datum/effect_system/spark_spread
effect_type = /obj/effect/particle_effect/sparks
/datum/effect_system/spark_spread/quantum
effect_type = /obj/effect/particle_effect/sparks/quantum