From 694628ff2edfc3cbf9eea58cfb7d1a3263e2606c Mon Sep 17 00:00:00 2001 From: MistakeNot4892 Date: Sun, 15 Dec 2024 15:28:20 +1100 Subject: [PATCH] Moved various fire procs to /atom level as stubs, consistent name/setter/getter use. --- code/_helpers/washing.dm | 6 +- code/game/atoms_fires.dm | 21 ++++ code/game/machinery/igniter.dm | 18 ++-- code/game/objects/items/flame/_flame.dm | 32 +++---- .../items/flame/flame_fuelled_lighter.dm | 2 +- .../game/objects/items/flame/flame_matches.dm | 2 +- code/game/objects/items/flame/flame_torch.dm | 2 +- .../objects/items/weapons/flamethrower.dm | 2 +- .../objects/items/weapons/material/ashtray.dm | 2 +- .../game/objects/items/weapons/tanks/tanks.dm | 4 +- .../items/weapons/tools/weldingtool.dm | 4 +- code/game/objects/structures/wall_sconce.dm | 4 + code/modules/ZAS/Fire.dm | 2 +- code/modules/clothing/head/misc_special.dm | 12 +-- code/modules/clothing/masks/chewable.dm | 4 +- code/modules/clothing/masks/smokable.dm | 18 ++-- code/modules/detectivework/tools/rag.dm | 48 +++++----- code/modules/materials/_materials.dm | 2 +- .../liquids/materials_liquid_water.dm | 8 +- code/modules/mob/living/human/examine.dm | 7 +- .../mob/living/human/human_attackhand.dm | 2 +- code/modules/mob/living/human/life.dm | 4 +- code/modules/mob/living/living.dm | 36 +++---- code/modules/mob/living/living_attackhand.dm | 22 ++--- code/modules/mob/living/living_defense.dm | 91 +----------------- code/modules/mob/living/living_defines.dm | 4 +- code/modules/mob/living/living_fires.dm | 96 +++++++++++++++++++ code/modules/mob/living/silicon/robot/life.dm | 6 +- .../hostile/retaliate/exoplanet.dm | 4 +- .../organs/external/_external_damage.dm | 2 +- code/modules/projectiles/projectile/beams.dm | 6 +- .../modules/projectiles/projectile/special.dm | 4 +- .../reagent_containers/drinks/bottle.dm | 16 ++-- .../modules/spells/targeted/ethereal_jaunt.dm | 2 +- mods/gamemodes/cult/runes.dm | 7 +- mods/species/serpentid/datum/species.dm | 4 +- nebula.dme | 2 + 37 files changed, 268 insertions(+), 240 deletions(-) create mode 100644 code/game/atoms_fires.dm create mode 100644 code/modules/mob/living/living_fires.dm diff --git a/code/_helpers/washing.dm b/code/_helpers/washing.dm index 487afbd8700..0bb0169a3d1 100644 --- a/code/_helpers/washing.dm +++ b/code/_helpers/washing.dm @@ -2,8 +2,8 @@ if(!istype(washing)) return var/mob/living/L = washing - if(L.on_fire) + if(L.is_on_fire()) L.visible_message("A cloud of steam rises up as the water hits \the [L]!") - L.ExtinguishMob() - L.fire_stacks = -20 //Douse ourselves with water to avoid fire more easily + L.extinguish_fire() + L.adjust_fire_intensity(-20) //Douse ourselves with water to avoid fire more easily washing.clean() diff --git a/code/game/atoms_fires.dm b/code/game/atoms_fires.dm new file mode 100644 index 00000000000..c70cc007cb8 --- /dev/null +++ b/code/game/atoms_fires.dm @@ -0,0 +1,21 @@ +// Stubs for atom fire system, TODO. +/atom/proc/set_fire_intensity(amount) + return + +/atom/proc/get_fire_intensity() + return 0 + +/atom/proc/adjust_fire_intensity(amount) + return + +/atom/proc/can_ignite() + return FALSE + +/atom/proc/ignite_fire() + return + +/atom/proc/extinguish_fire(mob/user, no_message = FALSE) + return + +/atom/proc/is_on_fire() + return FALSE diff --git a/code/game/machinery/igniter.dm b/code/game/machinery/igniter.dm index f086a33332b..47f7eab5211 100644 --- a/code/game/machinery/igniter.dm +++ b/code/game/machinery/igniter.dm @@ -40,7 +40,7 @@ /obj/machinery/igniter/interface_interact(mob/user) if(!CanInteract(user, DefaultTopicState())) return FALSE - ignite() + toggle_igniter() visible_message(SPAN_NOTICE("\The [user] toggles \the [src].")) return TRUE @@ -51,7 +51,7 @@ location.hotspot_expose(1000,500,1) return 1 -/obj/machinery/igniter/proc/ignite() +/obj/machinery/igniter/proc/toggle_igniter() use_power_oneoff(2000) on = !on if(on) @@ -73,7 +73,7 @@ /decl/public_access/public_method/igniter_toggle name = "igniter toggle" desc = "Toggle the igniter on or off." - call_proc = TYPE_PROC_REF(/obj/machinery/igniter, ignite) + call_proc = TYPE_PROC_REF(/obj/machinery/igniter, toggle_igniter) /decl/stock_part_preset/radio/receiver/igniter frequency = BUTTON_FREQ @@ -133,19 +133,15 @@ return ..() /obj/machinery/sparker/attack_ai() - if (anchored) - return ignite() - else - return + return anchored ? create_sparks() : null -/obj/machinery/sparker/proc/ignite() +/obj/machinery/sparker/proc/create_sparks() if (stat & NOPOWER) return if (disable || (last_spark && world.time < last_spark + 50)) return - flick("[base_state]-spark", src) spark_at(src, amount=2, cardinal_only = TRUE) src.last_spark = world.time @@ -159,13 +155,13 @@ if(stat & (BROKEN|NOPOWER)) ..(severity) return - ignite() + create_sparks() ..(severity) /decl/public_access/public_method/sparker_spark name = "spark" desc = "Creates sparks to ignite nearby gases." - call_proc = TYPE_PROC_REF(/obj/machinery/sparker, ignite) + call_proc = TYPE_PROC_REF(/obj/machinery/sparker, create_sparks) /decl/stock_part_preset/radio/receiver/sparker frequency = BUTTON_FREQ diff --git a/code/game/objects/items/flame/_flame.dm b/code/game/objects/items/flame/_flame.dm index 1078285da3b..bee61f2c54c 100644 --- a/code/game/objects/items/flame/_flame.dm +++ b/code/game/objects/items/flame/_flame.dm @@ -56,7 +56,7 @@ loc.update_icon() /obj/item/flame/Destroy() - extinguish(null, TRUE) + snuff_out(null, TRUE) return ..() /obj/item/flame/proc/get_available_scents() @@ -115,7 +115,7 @@ return ..() -/obj/item/flame/proc/extinguish(var/mob/user, var/no_message) +/obj/item/flame/proc/snuff_out(mob/user, no_message = FALSE) if(!lit) return FALSE lit = FALSE @@ -147,7 +147,7 @@ return TRUE if(lit && can_manually_extinguish) - extinguish(user) + snuff_out(user) return TRUE return ..() @@ -175,7 +175,7 @@ else check_depth = FLUID_SHALLOW if(fluids.total_volume >= check_depth) - extinguish(no_message = TRUE) + snuff_out(no_message = TRUE) /obj/item/flame/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume) . = ..() @@ -206,31 +206,21 @@ other.light(user) /obj/item/flame/attackby(obj/item/used_item, mob/user) - if(!user.check_intent(I_FLAG_HARM) && !can_manually_light && (used_item.isflamesource() || used_item.get_heat() > T100C)) light(user) return TRUE - return ..() /obj/item/flame/Process() - if((!waterproof && submerged()) || !expend_fuel(_fuel_spend_amt)) - extinguish() + snuff_out() return PROCESS_KILL - update_icon() - if(istype(loc, /obj/structure/wall_sconce)) - loc.update_icon() - - // TODO: generalized ignition proc - if(isliving(loc)) - var/mob/living/M = loc - M.IgniteMob() - - var/turf/location = get_turf(src) - if(location) - location.hotspot_expose(get_heat(), w_class) + if(loc) + loc.ignite_fire() + var/turf/my_turf = get_turf(src) + if(my_turf) + my_turf.hotspot_expose(get_heat(), w_class) /obj/item/flame/dropped(var/mob/user) //If dropped, put ourselves out @@ -239,7 +229,7 @@ var/turf/location = loc if(istype(location)) location.hotspot_expose(700, 5) - extinguish() + snuff_out() return ..() /obj/item/flame/spark_act(obj/effect/sparks/sparks) diff --git a/code/game/objects/items/flame/flame_fuelled_lighter.dm b/code/game/objects/items/flame/flame_fuelled_lighter.dm index 7719c082a6f..2e1e6903bc2 100644 --- a/code/game/objects/items/flame/flame_fuelled_lighter.dm +++ b/code/game/objects/items/flame/flame_fuelled_lighter.dm @@ -33,7 +33,7 @@ user.visible_message(SPAN_NOTICE("After a few attempts, \the [user] manages to light \the [src], burning their finger in the process.")) playsound(src.loc, "light_bic", 100, 1, -4) -/obj/item/flame/fuelled/lighter/extinguish(var/mob/user, var/no_message) +/obj/item/flame/fuelled/lighter/snuff_out(mob/user, no_message = FALSE) if(!no_message && user) no_message = TRUE . = ..() diff --git a/code/game/objects/items/flame/flame_matches.dm b/code/game/objects/items/flame/flame_matches.dm index ebaead8790b..41300c9d1e0 100644 --- a/code/game/objects/items/flame/flame_matches.dm +++ b/code/game/objects/items/flame/flame_matches.dm @@ -23,7 +23,7 @@ /obj/item/flame/match/light(mob/user, no_message) . = !burnt && ..() -/obj/item/flame/match/extinguish(var/mob/user, var/no_message) +/obj/item/flame/match/snuff_out(mob/user, no_message = FALSE) . = ..() if(. && !burnt) _fuel = 0 diff --git a/code/game/objects/items/flame/flame_torch.dm b/code/game/objects/items/flame/flame_torch.dm index 66aac1847d6..26f616a4a47 100644 --- a/code/game/objects/items/flame/flame_torch.dm +++ b/code/game/objects/items/flame/flame_torch.dm @@ -50,7 +50,7 @@ update_icon() -/obj/item/flame/torch/extinguish(var/mob/user, var/no_message) +/obj/item/flame/torch/snuff_out(mob/user, no_message = FALSE) . = ..() if(. && _fuel <= 0 && !burnt) burnt = TRUE diff --git a/code/game/objects/items/weapons/flamethrower.dm b/code/game/objects/items/weapons/flamethrower.dm index 61ddcccfbae..cc1018b1639 100644 --- a/code/game/objects/items/weapons/flamethrower.dm +++ b/code/game/objects/items/weapons/flamethrower.dm @@ -296,7 +296,7 @@ target.create_fire(tank.air_contents.temperature * 2 + 400) target.hotspot_expose(1000, 100) for(var/mob/living/M in target) - M.IgniteMob(1) + M.ignite_fire() // slightly weird looking initialize cuz it has to do some stuff first /obj/item/flamethrower/full/Initialize() diff --git a/code/game/objects/items/weapons/material/ashtray.dm b/code/game/objects/items/weapons/material/ashtray.dm index fe6ac6673c9..41b4cae00d9 100644 --- a/code/game/objects/items/weapons/material/ashtray.dm +++ b/code/game/objects/items/weapons/material/ashtray.dm @@ -34,7 +34,7 @@ var/obj/item/clothing/mask/smokable/cigarette/cig = W if (cig.lit == 1) visible_message(SPAN_NOTICE("\The [user] crushes \the [cig] in \the [src], putting it out.")) - W = cig.extinguish(no_message = 1) + W = cig.extinguish_fire(no_message = TRUE) else if (cig.lit == 0) to_chat(user, SPAN_NOTICE("You place \the [cig] in \the [src] without even smoking it. Why would you do that?")) else diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm index 35c99e1d7dc..68f46f69269 100644 --- a/code/game/objects/items/weapons/tanks/tanks.dm +++ b/code/game/objects/items/weapons/tanks/tanks.dm @@ -553,7 +553,7 @@ var/global/list/global/tank_gauge_cache = list() return ..() /obj/item/tankassemblyproxy/receive_signal() //This is mainly called by the sensor through sense() to the holder, and from the holder to here. - tank.ignite() //boom (or not boom if you made shijwtty mix) + tank.cause_explosion() //boom (or not boom if you made shijwtty mix) /obj/item/tank/proc/assemble_bomb(W,user) //Bomb assembly proc. This turns assembly+tank into a bomb var/obj/item/assembly_holder/S = W @@ -573,7 +573,7 @@ var/global/list/global/tank_gauge_cache = list() update_icon(TRUE) -/obj/item/tank/proc/ignite() //This happens when a bomb is told to explode +/obj/item/tank/proc/cause_explosion() //This happens when a bomb is told to explode var/obj/item/assembly_holder/assy = proxyassembly.assembly var/ign = assy.a_right var/obj/item/other = assy.a_left diff --git a/code/game/objects/items/weapons/tools/weldingtool.dm b/code/game/objects/items/weapons/tools/weldingtool.dm index 4a95497c9aa..3b9c293256e 100644 --- a/code/game/objects/items/weapons/tools/weldingtool.dm +++ b/code/game/objects/items/weapons/tools/weldingtool.dm @@ -192,7 +192,7 @@ var/turf/location = get_turf(user) if(isliving(O)) var/mob/living/L = O - L.IgniteMob() + L.ignite_fire() else if(isatom(O)) O.handle_external_heating(WELDING_TOOL_HOTSPOT_TEMP_ACTIVE, src, user) if (isturf(location)) @@ -243,7 +243,7 @@ var/mob/living/L = loc if(!(src in L.get_held_items())) fuel_usage = max(fuel_usage, 2) - L.IgniteMob() + L.ignite_fire() else if(isturf(loc)) var/turf/location = get_turf(src) location.hotspot_expose(WELDING_TOOL_HOTSPOT_TEMP_IDLE, 5) //a bit colder when idling diff --git a/code/game/objects/structures/wall_sconce.dm b/code/game/objects/structures/wall_sconce.dm index 5a3dd0a38a2..c1211712b3c 100644 --- a/code/game/objects/structures/wall_sconce.dm +++ b/code/game/objects/structures/wall_sconce.dm @@ -58,6 +58,10 @@ QDEL_NULL(light_source) return ..() +/obj/structure/wall_sconce/ignite_fire() + . = ..() + update_icon() + /obj/structure/wall_sconce/physically_destroyed() if(light_source) light_source.dropInto(loc) diff --git a/code/modules/ZAS/Fire.dm b/code/modules/ZAS/Fire.dm index c961aed56c7..10ecd938f69 100644 --- a/code/modules/ZAS/Fire.dm +++ b/code/modules/ZAS/Fire.dm @@ -17,7 +17,7 @@ If it gains pressure too slowly, it may leak or just rupture instead of explodin return simulated /turf/proc/hotspot_expose(exposed_temperature, exposed_volume, soh = 0) - if(locate(/obj/fire) in src) + if((locate(/obj/fire) in src) || !simulated) return 1 var/datum/gas_mixture/air_contents = return_air() diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm index 19e0a6c4aca..01d01335e58 100644 --- a/code/modules/clothing/head/misc_special.dm +++ b/code/modules/clothing/head/misc_special.dm @@ -204,7 +204,7 @@ icon = 'icons/clothing/head/cakehat.dmi' body_parts_covered = SLOT_HEAD item_flags = null - var/is_on_fire = FALSE + VAR_PRIVATE/_on_fire = FALSE /obj/item/clothing/head/cakehat/equipped(mob/user, slot) . = ..() @@ -217,7 +217,7 @@ /obj/item/clothing/head/cakehat/on_update_icon(mob/user) . = ..() z_flags &= ~ZMM_MANGLE_PLANES - if(is_on_fire && check_state_in_icon("[icon_state]-flame", icon)) + if(is_on_fire() && check_state_in_icon("[icon_state]-flame", icon)) if(plane == HUD_PLANE) add_overlay("[icon_state]-flame") else @@ -230,7 +230,7 @@ return emissive_overlay(overlay.icon, "[overlay.icon_state]-flame") /obj/item/clothing/head/cakehat/apply_additional_mob_overlays(mob/living/user_mob, bodytype, image/overlay, slot, bodypart, use_fallback_if_icon_missing = TRUE) - if(overlay && is_on_fire) + if(overlay && is_on_fire()) var/image/I = get_mob_flame_overlay(overlay, bodytype) if(I) overlay.overlays += I @@ -241,7 +241,7 @@ return ..() /obj/item/clothing/head/cakehat/Process() - if(!is_on_fire) + if(!is_on_fire()) STOP_PROCESSING(SSobj, src) return var/turf/location = loc @@ -255,9 +255,9 @@ /obj/item/clothing/head/cakehat/attack_self(mob/user) . = ..() if(!.) - is_on_fire = !is_on_fire + _on_fire = !_on_fire update_icon() - if(is_on_fire) + if(is_on_fire()) atom_damage_type = BURN START_PROCESSING(SSobj, src) else diff --git a/code/modules/clothing/masks/chewable.dm b/code/modules/clothing/masks/chewable.dm index 594eb26b6aa..84d490148fb 100644 --- a/code/modules/clothing/masks/chewable.dm +++ b/code/modules/clothing/masks/chewable.dm @@ -51,7 +51,7 @@ /obj/item/clothing/mask/chewable/Process() chew(1) if(chewtime < 1) - extinguish() + extinguish_fire() /obj/item/clothing/mask/chewable/tobacco name = "wad" @@ -72,7 +72,7 @@ desc = "A disgusting spitwad." icon = 'icons/clothing/mask/chewables/chew_spit.dmi' -/obj/item/clothing/mask/chewable/proc/extinguish(var/mob/user, var/no_message) +/obj/item/clothing/mask/chewable/extinguish_fire(mob/user, no_message = FALSE) STOP_PROCESSING(SSobj, src) if(type_butt) var/obj/item/trash/cigbutt/butt = new type_butt(get_turf(src)) diff --git a/code/modules/clothing/masks/smokable.dm b/code/modules/clothing/masks/smokable.dm index e36a224c787..9d5c9cf1a9f 100644 --- a/code/modules/clothing/masks/smokable.dm +++ b/code/modules/clothing/masks/smokable.dm @@ -82,7 +82,7 @@ if (src == user.get_equipped_item(slot_wear_mask_str) && user.internal) environment = user.internal.return_air() if(environment.get_by_flag(XGM_GAS_OXIDIZER) < gas_consumption) - extinguish() + extinguish_fire() else environment.remove_by_flag(XGM_GAS_OXIDIZER, gas_consumption) environment.adjust_gas(/decl/material/gas/carbon_dioxide, 0.5*gas_consumption,0) @@ -91,7 +91,7 @@ /obj/item/clothing/mask/smokable/Process() var/turf/location = get_turf(src) if(submerged() || smoketime < 1) - extinguish() + extinguish_fire() return smoke(1) if(location) @@ -126,7 +126,7 @@ var/turf/location = get_turf(src) if(location) location.hotspot_expose(700, 5) - extinguish(no_message = TRUE) + extinguish_fire(no_message = TRUE) /obj/item/clothing/mask/smokable/proc/light(var/flavor_text = "[usr] lights \the [src].") if(QDELETED(src)) @@ -152,7 +152,7 @@ smoke_amount = reagents.total_volume / smoketime START_PROCESSING(SSobj, src) -/obj/item/clothing/mask/smokable/proc/extinguish(var/mob/user, var/no_message) +/obj/item/clothing/mask/smokable/extinguish_fire(mob/user, no_message = FALSE) lit = FALSE atom_damage_type = BRUTE STOP_PROCESSING(SSobj, src) @@ -182,7 +182,7 @@ return ..() /obj/item/clothing/mask/smokable/use_on_mob(mob/living/target, mob/living/user, animate = TRUE) - if(target.on_fire) + if(target.is_on_fire()) user.do_attack_animation(target) light(SPAN_NOTICE("\The [user] coldly lights the \the [src] with the burning body of \the [target].")) return TRUE @@ -221,7 +221,7 @@ if(is_processing) set_scent_by_reagents(src) -/obj/item/clothing/mask/smokable/extinguish(var/mob/user, var/no_message) +/obj/item/clothing/mask/smokable/extinguish_fire(mob/user, no_message = FALSE) ..() remove_extension(src, /datum/extension/scent) if (type_butt) @@ -384,7 +384,7 @@ user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) return TRUE - if(!lit && target.on_fire) + if(!lit && target.is_on_fire()) user.do_attack_animation(target) light(target, user) return TRUE @@ -412,7 +412,7 @@ /obj/item/clothing/mask/smokable/cigarette/attack_self(var/mob/user) if(lit == 1) user.visible_message(SPAN_NOTICE("[user] calmly drops and treads on the lit [src], putting it out instantly.")) - extinguish(no_message = 1) + extinguish_fire(no_message = TRUE) return ..() //////////// @@ -530,7 +530,7 @@ set_scent_by_reagents(src) update_icon() -/obj/item/clothing/mask/smokable/pipe/extinguish(var/mob/user, var/no_message) +/obj/item/clothing/mask/smokable/pipe/extinguish_fire(mob/user, no_message) ..() new /obj/effect/decal/cleanable/ash(get_turf(src)) if(ismob(loc)) diff --git a/code/modules/detectivework/tools/rag.dm b/code/modules/detectivework/tools/rag.dm index 5487388845d..3ed5186e6b8 100644 --- a/code/modules/detectivework/tools/rag.dm +++ b/code/modules/detectivework/tools/rag.dm @@ -13,8 +13,8 @@ material = /decl/material/solid/organic/cloth material_alteration = MAT_FLAG_ALTERATION_NAME - var/on_fire = 0 - var/burn_time = 20 //if the rag burns for too long it turns to ashes + VAR_PRIVATE/_on_fire = 0 + VAR_PRIVATE/burn_time = 20 //if the rag burns for too long it turns to ashes /obj/item/chems/glass/rag/Initialize() . = ..() @@ -28,20 +28,23 @@ STOP_PROCESSING(SSobj, src) //so we don't continue turning to ash while gc'd . = ..() +/obj/item/chems/glass/rag/is_on_fire() + return _on_fire + /obj/item/chems/glass/rag/attack_self(mob/user) - if(on_fire && user.try_unequip(src)) + if(is_on_fire() && user.try_unequip(src)) user.visible_message(SPAN_NOTICE("\The [user] stamps out [src]."), SPAN_NOTICE("You stamp out [src].")) - extinguish() + extinguish_fire() else remove_contents(user) /obj/item/chems/glass/rag/attackby(obj/item/W, mob/user) if(W.isflamesource()) - if(on_fire) + if(is_on_fire()) to_chat(user, SPAN_WARNING("\The [src] is already blazing merrily!")) return TRUE - ignite() - if(on_fire) + ignite_fire() + if(is_on_fire()) visible_message(SPAN_DANGER("\The [user] lights \the [src] with \the [W].")) else to_chat(user, SPAN_WARNING("You attempt to light \the [src] with \the [W], but it doesn't seem to be flammable.")) @@ -50,7 +53,7 @@ return ..() /obj/item/chems/glass/rag/update_name() - if(on_fire) + if(is_on_fire()) name_prefix = "burning" else if(reagents && reagents.total_volume) name_prefix = "damp" @@ -60,7 +63,7 @@ /obj/item/chems/glass/rag/on_update_icon() . = ..() - icon_state = "rag[on_fire? "lit" : ""]" + icon_state = "rag[is_on_fire()? "lit" : ""]" var/obj/item/chems/drinks/bottle/B = loc if(istype(B)) B.update_icon() @@ -93,14 +96,14 @@ /obj/item/chems/glass/rag/use_on_mob(mob/living/target, mob/living/user, animate = TRUE) - if(on_fire) + if(is_on_fire()) user.visible_message( SPAN_DANGER("\The [user] hits \the [target] with \the [src]!"), SPAN_DANGER("You hit \the [target] with \the [src]!") ) user.do_attack_animation(target) admin_attack_log(user, target, "used \the [src] (ignited) to attack", "was attacked using \the [src] (ignited)", "attacked with \the [src] (ignited)") - target.IgniteMob() + target.ignite_fire() return TRUE if(reagents.total_volume) @@ -150,7 +153,7 @@ update_name() return - if(!on_fire && istype(A) && (src in user)) + if(!is_on_fire() && istype(A) && (src in user)) if(ATOM_IS_OPEN_CONTAINER(A) && !(A in user)) remove_contents(user, A) else if(!ismob(A)) //mobs are handled in use_on_mob() - this prevents us from wiping down people while smothering them. @@ -159,7 +162,7 @@ /obj/item/chems/glass/rag/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume) if(exposed_temperature >= 50 + T0C) - ignite() + ignite_fire() if(exposed_temperature >= 900 + T0C) new /obj/effect/decal/cleanable/ash(get_turf(src)) qdel(src) @@ -168,7 +171,7 @@ //rag must have a minimum of 2 units welder fuel and at least 80% of the reagents must be welder fuel. //maybe generalize flammable reagents someday -/obj/item/chems/glass/rag/proc/can_ignite() +/obj/item/chems/glass/rag/can_ignite() var/total_fuel = 0 var/total_volume = 0 if(reagents) @@ -178,21 +181,21 @@ total_fuel += REAGENT_VOLUME(reagents, rtype) * R.accelerant_value . = (total_fuel >= 2 && total_fuel >= total_volume*0.5) -/obj/item/chems/glass/rag/proc/ignite() - if(on_fire) +/obj/item/chems/glass/rag/ignite_fire() + if(is_on_fire()) return if(!can_ignite()) return START_PROCESSING(SSobj, src) set_light(2, 1, "#e38f46") - on_fire = 1 + _on_fire = TRUE update_name() update_icon() -/obj/item/chems/glass/rag/proc/extinguish() +/obj/item/chems/glass/rag/extinguish_fire(mob/user, no_message = FALSE) STOP_PROCESSING(SSobj, src) set_light(0) - on_fire = 0 + _on_fire = FALSE //rags sitting around with 1 second of burn time left is dumb. //ensures players always have a few seconds of burn time left when they light their rag @@ -206,12 +209,11 @@ /obj/item/chems/glass/rag/Process() if(!can_ignite()) visible_message("\The [src] burns out.") - extinguish() + extinguish_fire() //copied from matches - if(isliving(loc)) - var/mob/living/M = loc - M.IgniteMob() + if(loc) + loc.ignite_fire() var/turf/location = get_turf(src) if(location) location.hotspot_expose(700, 5) diff --git a/code/modules/materials/_materials.dm b/code/modules/materials/_materials.dm index 4b12ce62dee..8a6a4d3b1ae 100644 --- a/code/modules/materials/_materials.dm +++ b/code/modules/materials/_materials.dm @@ -746,7 +746,7 @@ INITIALIZE_IMMEDIATE(/obj/effect/gas_overlay) // This doesn't apply to skin contact - this is for, e.g. extinguishers and sprays. The difference is that reagent is not directly on the mob's skin - it might just be on their clothing. /decl/material/proc/touch_mob(var/mob/living/M, var/amount, var/datum/reagents/holder) if(accelerant_value != FUEL_VALUE_NONE && amount && istype(M)) - M.fire_stacks += floor((amount * accelerant_value)/FLAMMABLE_LIQUID_DIVISOR) + M.adjust_fire_intensity(floor((amount * accelerant_value)/FLAMMABLE_LIQUID_DIVISOR)) #undef FLAMMABLE_LIQUID_DIVISOR /decl/material/proc/touch_turf(var/turf/T, var/amount, var/datum/reagents/holder) // Cleaner cleaning, lube lubbing, etc, all go here diff --git a/code/modules/materials/definitions/liquids/materials_liquid_water.dm b/code/modules/materials/definitions/liquids/materials_liquid_water.dm index 76caa77b46f..e9ca35c6c78 100644 --- a/code/modules/materials/definitions/liquids/materials_liquid_water.dm +++ b/code/modules/materials/definitions/liquids/materials_liquid_water.dm @@ -87,11 +87,11 @@ /decl/material/liquid/water/touch_mob(var/mob/living/M, var/amount, var/datum/reagents/holder) ..() if(istype(M)) - var/needed = M.fire_stacks * 10 + var/needed = M.get_fire_intensity() * 10 if(amount > needed) - M.fire_stacks = 0 - M.ExtinguishMob() + M.set_fire_intensity(0) + M.extinguish_fire() holder.remove_reagent(type, needed) else - M.adjust_fire_stacks(-(amount / 10)) + M.adjust_fire_intensity(-(amount / 10)) holder.remove_reagent(type, amount) diff --git a/code/modules/mob/living/human/examine.dm b/code/modules/mob/living/human/examine.dm index 389e209440c..ddcaa27e09f 100644 --- a/code/modules/mob/living/human/examine.dm +++ b/code/modules/mob/living/human/examine.dm @@ -83,12 +83,13 @@ else msg += "[use_He] [use_is] looking a bit damp.\n" - if(fire_stacks > 0) + var/fire_level = get_fire_intensity() + if(fire_level > 0) msg += "[use_He] [use_is] looking highly flammable!\n" - else if(fire_stacks < 0) + else if(fire_level < 0) msg += "[use_He] [use_is] looking rather damp.\n" - if(on_fire) + if(is_on_fire()) msg += "[use_He] [use_is] on fire!.\n" var/ssd_msg = species.get_ssd(src) diff --git a/code/modules/mob/living/human/human_attackhand.dm b/code/modules/mob/living/human/human_attackhand.dm index e88990677b4..83b036ada13 100644 --- a/code/modules/mob/living/human/human_attackhand.dm +++ b/code/modules/mob/living/human/human_attackhand.dm @@ -99,7 +99,7 @@ if(user == src) check_self_injuries() return TRUE - if(ishuman(user) && (is_asystole() || (status_flags & FAKEDEATH) || failed_last_breath) && !on_fire && !(user.get_target_zone() == BP_R_ARM || user.get_target_zone() == BP_L_ARM)) + if(ishuman(user) && (is_asystole() || (status_flags & FAKEDEATH) || failed_last_breath) && !is_on_fire() && !(user.get_target_zone() == BP_R_ARM || user.get_target_zone() == BP_L_ARM)) if (performing_cpr) performing_cpr = FALSE else diff --git a/code/modules/mob/living/human/life.dm b/code/modules/mob/living/human/life.dm index b6a065fc2f7..1bb84a587db 100644 --- a/code/modules/mob/living/human/life.dm +++ b/code/modules/mob/living/human/life.dm @@ -258,7 +258,7 @@ return /mob/living/human/get_bodytemperature_difference() - if (on_fire) + if (is_on_fire()) return 0 //too busy for pesky metabolic regulation return ..() @@ -490,7 +490,7 @@ // Apply a fire overlay if we're burning. var/crit_markers = get_ui_icon(client?.prefs?.UI_style, UI_ICON_CRIT_MARKER) - if(on_fire) + if(is_on_fire()) health_images += image(crit_markers, "burning") // Show a general pain/crit indicator if needed. diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 7bab0e45da2..df4f9b1c97d 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -312,8 +312,8 @@ default behaviour is: BITSET(hud_updateflag, HEALTH_HUD) BITSET(hud_updateflag, STATUS_HUD) BITSET(hud_updateflag, LIFE_HUD) - ExtinguishMob() - fire_stacks = 0 + extinguish_fire() + set_fire_intensity(0) var/obj/item/cuffs = get_equipped_item(slot_handcuffed_str) if (cuffs) try_unequip(cuffs, get_turf(src)) @@ -551,8 +551,8 @@ default behaviour is: spawn() escape_buckle() return TRUE //drop && roll - else if(on_fire) - fire_stacks = max(0, fire_stacks-1.2) + else if(is_on_fire()) + set_fire_intensity(max(0, get_fire_intensity()-1.2)) SET_STATUS_MAX(src, STAT_WEAK, 3) spin(32,2) var/decl/pronouns/pronouns = get_pronouns() @@ -561,12 +561,12 @@ default behaviour is: SPAN_NOTICE("You stop, drop, and roll!") ) sleep(3 SECONDS) - if(fire_stacks <= 0) + if(get_fire_intensity() <= 0) visible_message( SPAN_NOTICE("\The [src] successfully extinguishes [pronouns.him][pronouns.self]!"), SPAN_NOTICE("You extinguish yourself.") ) - ExtinguishMob() + extinguish_fire() return TRUE //Breaking out of a structure? @@ -1079,17 +1079,19 @@ default behaviour is: ADJ_STATUS(src, STAT_STUN, -3) ADJ_STATUS(src, STAT_WEAK, -3) - if(fire_stacks >= target.fire_stacks + 3) - target.fire_stacks += 1 - fire_stacks -= 1 - else if(target.fire_stacks >= fire_stacks + 3) - fire_stacks += 1 - target.fire_stacks -= 1 - - if(on_fire && !target.on_fire) - target.IgniteMob() - else if(!on_fire && target.on_fire) - IgniteMob() + var/fire_level = get_fire_intensity() + var/target_fire_level = target.get_fire_intensity() + if(fire_level >= target_fire_level + 3) + target.adjust_fire_intensity(1) + adjust_fire_intensity(-1) + else if(target_fire_level >= fire_level + 3) + adjust_fire_intensity(1) + target.adjust_fire_intensity(-1) + + if(is_on_fire() && !target.is_on_fire()) + target.ignite_fire() + else if(!is_on_fire() && target.is_on_fire()) + ignite_fire() /mob/living/proc/jump_layer_shift() jumping = TRUE diff --git a/code/modules/mob/living/living_attackhand.dm b/code/modules/mob/living/living_attackhand.dm index e7a7ae239f9..055b82d84bf 100644 --- a/code/modules/mob/living/living_attackhand.dm +++ b/code/modules/mob/living/living_attackhand.dm @@ -52,11 +52,11 @@ // Returns TRUE if further interactions should be halted, FALSE otherwise. /mob/living/proc/try_extinguish(mob/living/user) - if (!on_fire || !istype(user)) + if (!is_on_fire() || !istype(user)) return FALSE playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1) - if (user.on_fire) + if (user.is_on_fire()) user.visible_message( SPAN_WARNING("\The [user] tries to pat out \the [src]'s flames, but to no avail!"), SPAN_WARNING("You try to pat out [src]'s flames, but to no avail! Put yourself out first!") @@ -71,25 +71,25 @@ if(!do_mob(user, src, 15)) return TRUE - fire_stacks -= 0.5 - if (prob(10) && (user.fire_stacks <= 0)) - user.fire_stacks += 1 - user.IgniteMob() - if (user.on_fire) + adjust_fire_intensity(-0.5) + if (prob(10) && (user.get_fire_intensity() <= 0)) + user.adjust_fire_intensity(1) + user.ignite_fire() + if (user.is_on_fire()) user.visible_message( SPAN_DANGER("The fire spreads from \the [src] to \the [user]!"), SPAN_DANGER("The fire spreads to you as well!") ) return TRUE - fire_stacks -= 0.5 //Less effective than stop, drop, and roll - also accounting for the fact that it takes half as long. - if (fire_stacks <= 0) + adjust_fire_intensity(-0.5) //Less effective than stop, drop, and roll - also accounting for the fact that it takes half as long. + if (get_fire_intensity() <= 0) user.visible_message( SPAN_NOTICE("\The [user] successfully pats out \the [src]'s flames."), SPAN_NOTICE("You successfully pat out \the [src]'s flames.") ) - ExtinguishMob() - fire_stacks = 0 + extinguish_fire() + set_fire_intensity(0) return TRUE diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 97fe9281e2c..a74526afdd4 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -291,91 +291,6 @@ user.do_attack_animation(src) return 1 -/mob/living/proc/can_ignite() - return fire_stacks > 0 && !on_fire - -/mob/living/proc/IgniteMob() - if(can_ignite()) - on_fire = TRUE - set_light(4, l_color = COLOR_ORANGE) - update_fire() - -/mob/living/proc/ExtinguishMob() - if(on_fire) - on_fire = FALSE - fire_stacks = 0 - set_light(0) - update_fire() - -/mob/living/proc/update_fire(var/update_icons=1) - if(on_fire) - var/decl/bodytype/mob_bodytype = get_bodytype() - var/image/standing = overlay_image(mob_bodytype?.get_ignited_icon(src) || 'icons/mob/OnFire.dmi', mob_bodytype?.get_ignited_icon_state(src) || "Generic_mob_burning", RESET_COLOR) - set_current_mob_overlay(HO_FIRE_LAYER, standing, update_icons) - else - set_current_mob_overlay(HO_FIRE_LAYER, null, update_icons) - -/mob/living/proc/adjust_fire_stacks(add_fire_stacks) //Adjusting the amount of fire_stacks we have on person - fire_stacks = clamp(fire_stacks + add_fire_stacks, FIRE_MIN_STACKS, FIRE_MAX_STACKS) - -/mob/living/proc/handle_fire() - if(fire_stacks < 0) - fire_stacks = min(0, ++fire_stacks) //If we've doused ourselves in water to avoid fire, dry off slowly - - if(!on_fire) - return TRUE - else if(fire_stacks <= 0) - ExtinguishMob() //Fire's been put out. - return TRUE - - fire_stacks = max(0, fire_stacks - 0.2) //I guess the fire runs out of fuel eventually - - var/datum/gas_mixture/G = loc.return_air() // Check if we're standing in an oxygenless environment - if(G.get_by_flag(XGM_GAS_OXIDIZER) < 1) - ExtinguishMob() //If there's no oxygen in the tile we're on, put out the fire - return TRUE - - var/turf/location = get_turf(src) - location.hotspot_expose(fire_burn_temperature(), 50, 1) - - var/burn_temperature = fire_burn_temperature() - var/thermal_protection = get_heat_protection(burn_temperature) - - if (thermal_protection < 1 && bodytemperature < burn_temperature) - bodytemperature += round(BODYTEMP_HEATING_MAX*(1-thermal_protection), 1) - - var/species_heat_mod = 1 - - var/protected_limbs = get_heat_protection_flags(burn_temperature) - - if(burn_temperature < get_mob_temperature_threshold(HEAT_LEVEL_2)) - species_heat_mod = 0.5 - else if(burn_temperature < get_mob_temperature_threshold(HEAT_LEVEL_3)) - species_heat_mod = 0.75 - - burn_temperature -= get_mob_temperature_threshold(HEAT_LEVEL_1) - - if(burn_temperature < 1) - return - - if(has_external_organs()) - for(var/obj/item/organ/external/E in get_external_organs()) - if(!(E.body_part & protected_limbs) && prob(20)) - E.take_external_damage(burn = round(species_heat_mod * log(10, (burn_temperature + 10)), 0.1), used_weapon = "fire") - else // fallback for simplemobs - take_damage(round(species_heat_mod * log(10, (burn_temperature + 10))), 0.1, BURN, DAM_DISPERSED) - -/mob/living/proc/increase_fire_stacks(exposed_temperature) - if(fire_stacks <= 4 || fire_burn_temperature() < exposed_temperature) - adjust_fire_stacks(2) - -/mob/living/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume) - //once our fire_burn_temperature has reached the temperature of the fire that's giving fire_stacks, stop adding them. - //allow fire_stacks to go up to 4 for fires cooler than 700 K, since are being immersed in flame after all. - increase_fire_stacks(exposed_temperature) - IgniteMob() - return ..() - /mob/living/proc/get_cold_protection() return 0 @@ -384,12 +299,12 @@ //Finds the effective temperature that the mob is burning at. /mob/living/proc/fire_burn_temperature() - if (fire_stacks <= 0) + var/fire_level = get_fire_intensity() + if (fire_level <= 0) return 0 - //Scale quadratically so that single digit numbers of fire stacks don't burn ridiculously hot. //lower limit of 700 K, same as matches and roughly the temperature of a cool flame. - return max(2.25*round(FIRESUIT_MAX_HEAT_PROTECTION_TEMPERATURE*(fire_stacks/FIRE_MAX_FIRESUIT_STACKS)**2), 700) + return max(2.25*round(FIRESUIT_MAX_HEAT_PROTECTION_TEMPERATURE*(fire_level/FIRE_MAX_FIRESUIT_STACKS)**2), 700) /mob/living/proc/reagent_permeability() return 1 diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index 8d8270d0854..4d894ca4fa9 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -29,8 +29,8 @@ var/mob/living/cameraFollow = null var/list/datum/action/actions = list() - var/on_fire = 0 //The "Are we on fire?" var - var/fire_stacks + VAR_PRIVATE/_on_fire = 0 //The "Are we on fire?" var + VAR_PRIVATE/_fire_intensity var/ticks_since_last_successful_breath = 0 //if we failed to breathe last tick var/failed_last_breath = 0 //This is used to determine if the mob failed a breath. If they did fail a brath, they will attempt to breathe each tick, otherwise just once per 4 ticks. diff --git a/code/modules/mob/living/living_fires.dm b/code/modules/mob/living/living_fires.dm new file mode 100644 index 00000000000..5711910fe86 --- /dev/null +++ b/code/modules/mob/living/living_fires.dm @@ -0,0 +1,96 @@ +/mob/living/is_on_fire() + return _on_fire + +/mob/living/set_fire_intensity(amount) + _fire_intensity = amount + +/mob/living/get_fire_intensity() + return _fire_intensity + +//Adjusting the amount of fire stacks we have on person +/mob/living/adjust_fire_intensity(amount) + _fire_intensity = clamp(_fire_intensity + amount, FIRE_MIN_STACKS, FIRE_MAX_STACKS) + +/mob/living/can_ignite() + return get_fire_intensity() > 0 && !is_on_fire() + +/mob/living/ignite_fire() + if(can_ignite()) + _on_fire = TRUE + set_light(4, l_color = COLOR_ORANGE) + update_fire() + +/mob/living/extinguish_fire(mob/user, no_message = FALSE) + if(is_on_fire()) + _on_fire = FALSE + set_fire_intensity(0) + set_light(0) + update_fire() + +/mob/living/proc/update_fire(var/update_icons=1) + if(is_on_fire()) + var/decl/bodytype/mob_bodytype = get_bodytype() + var/image/standing = overlay_image(mob_bodytype?.get_ignited_icon(src) || 'icons/mob/OnFire.dmi', mob_bodytype?.get_ignited_icon_state(src) || "Generic_mob_burning", RESET_COLOR) + set_current_mob_overlay(HO_FIRE_LAYER, standing, update_icons) + else + set_current_mob_overlay(HO_FIRE_LAYER, null, update_icons) + +/mob/living/proc/handle_fire() + var/fire_level = get_fire_intensity() + if(fire_level < 0) + set_fire_intensity(min(0, ++fire_level)) //If we've doused ourselves in water to avoid fire, dry off slowly + fire_level = get_fire_intensity() + + if(!is_on_fire()) + return TRUE + if(fire_level <= 0) + extinguish_fire() //Fire's been put out. + return TRUE + + set_fire_intensity(max(0, fire_level - 0.2)) //I guess the fire runs out of fuel eventually + + var/datum/gas_mixture/G = loc.return_air() // Check if we're standing in an oxygenless environment + if(G.get_by_flag(XGM_GAS_OXIDIZER) < 1) + extinguish_fire() //If there's no oxygen in the tile we're on, put out the fire + return TRUE + + var/turf/location = get_turf(src) + location.hotspot_expose(fire_burn_temperature(), 50, 1) + + var/burn_temperature = fire_burn_temperature() + var/thermal_protection = get_heat_protection(burn_temperature) + + if (thermal_protection < 1 && bodytemperature < burn_temperature) + bodytemperature += round(BODYTEMP_HEATING_MAX*(1-thermal_protection), 1) + + var/species_heat_mod = 1 + + var/protected_limbs = get_heat_protection_flags(burn_temperature) + + if(burn_temperature < get_mob_temperature_threshold(HEAT_LEVEL_2)) + species_heat_mod = 0.5 + else if(burn_temperature < get_mob_temperature_threshold(HEAT_LEVEL_3)) + species_heat_mod = 0.75 + + burn_temperature -= get_mob_temperature_threshold(HEAT_LEVEL_1) + + if(burn_temperature < 1) + return + + if(has_external_organs()) + for(var/obj/item/organ/external/E in get_external_organs()) + if(!(E.body_part & protected_limbs) && prob(20)) + E.take_external_damage(burn = round(species_heat_mod * log(10, (burn_temperature + 10)), 0.1), used_weapon = "fire") + else // fallback for simplemobs + take_damage(round(species_heat_mod * log(10, (burn_temperature + 10))), 0.1, BURN, DAM_DISPERSED) + +/mob/living/proc/increase_fire_intensity(exposed_temperature) + if(get_fire_intensity() <= 4 || fire_burn_temperature() < exposed_temperature) + adjust_fire_intensity(2) + +/mob/living/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume) + //once our fire_burn_temperature has reached the temperature of the fire that's giving fire intensity, stop adding them. + //allow fire intensity to go up to 4 for fires cooler than 700 K, since are being immersed in flame after all. + increase_fire_intensity(exposed_temperature) + ignite_fire() + return ..() \ No newline at end of file diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index a8da2261da4..4e2bc0fe3cf 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -258,12 +258,12 @@ /mob/living/silicon/robot/update_fire() overlays -= image("icon"='icons/mob/OnFire.dmi', "icon_state"="Standing") - if(on_fire) + if(is_on_fire()) overlays += image("icon"='icons/mob/OnFire.dmi', "icon_state"="Standing") //Silicons don't gain stacks from hotspots, but hotspots can ignite them -/mob/living/silicon/increase_fire_stacks(exposed_temperature) +/mob/living/silicon/increase_fire_intensity(exposed_temperature) return /mob/living/silicon/can_ignite() - return !on_fire + return !is_on_fire() diff --git a/code/modules/mob/living/simple_animal/hostile/retaliate/exoplanet.dm b/code/modules/mob/living/simple_animal/hostile/retaliate/exoplanet.dm index 0541018c1de..d8443751980 100644 --- a/code/modules/mob/living/simple_animal/hostile/retaliate/exoplanet.dm +++ b/code/modules/mob/living/simple_animal/hostile/retaliate/exoplanet.dm @@ -188,8 +188,8 @@ /mob/living/simple_animal/hostile/beast/charbaby/apply_attack_effects(mob/living/target) . = ..() if(prob(10)) - target.adjust_fire_stacks(1) - target.IgniteMob() + target.adjust_fire_intensity(1) + target.ignite_fire() /mob/living/simple_animal/hostile/beast/shantak/lava desc = "A vaguely canine looking beast. It looks as though its fur is made of stone wool." diff --git a/code/modules/organs/external/_external_damage.dm b/code/modules/organs/external/_external_damage.dm index d1c38e68b5b..0d185bbe9ae 100644 --- a/code/modules/organs/external/_external_damage.dm +++ b/code/modules/organs/external/_external_damage.dm @@ -89,7 +89,7 @@ if(laser) created_wound = createwound(LASER, burn) if(prob(40)) - owner.IgniteMob() + owner.ignite_fire() else created_wound = createwound(BURN, burn) diff --git a/code/modules/projectiles/projectile/beams.dm b/code/modules/projectiles/projectile/beams.dm index d9cde61e7df..dc643dcdc3b 100644 --- a/code/modules/projectiles/projectile/beams.dm +++ b/code/modules/projectiles/projectile/beams.dm @@ -354,9 +354,9 @@ ..() if(isliving(target)) var/mob/living/L = target - L.adjust_fire_stacks(rand(2,4)) - if(L.fire_stacks >= 3) - L.IgniteMob() + L.adjust_fire_intensity(rand(2,4)) + if(L.get_fire_intensity() >= 3) + L.ignite_fire() /obj/item/projectile/beam/pop icon_state = "bluelaser" diff --git a/code/modules/projectiles/projectile/special.dm b/code/modules/projectiles/projectile/special.dm index 01404109510..d648f6d70c3 100644 --- a/code/modules/projectiles/projectile/special.dm +++ b/code/modules/projectiles/projectile/special.dm @@ -206,5 +206,5 @@ if(isliving(target)) var/mob/living/L = target to_chat(target, SPAN_WARNING("You feel a wave of heat wash over you!")) - L.adjust_fire_stacks(rand(5,8)) - L.IgniteMob() \ No newline at end of file + L.adjust_fire_intensity(rand(5,8)) + L.ignite_fire() \ No newline at end of file diff --git a/code/modules/reagents/reagent_containers/drinks/bottle.dm b/code/modules/reagents/reagent_containers/drinks/bottle.dm index 6c93e2c79a2..242cd0583be 100644 --- a/code/modules/reagents/reagent_containers/drinks/bottle.dm +++ b/code/modules/reagents/reagent_containers/drinks/bottle.dm @@ -41,7 +41,7 @@ /obj/item/chems/drinks/bottle/proc/smash_check(var/distance) if(!material?.is_brittle()) return 0 - if(rag && rag.on_fire) // Molotovs should be somewhat reliable, they're a pain to make. + if(rag?.is_on_fire()) // Molotovs should be somewhat reliable, they're a pain to make. return TRUE if(!smash_duration) return 0 @@ -68,13 +68,13 @@ if(rag) rag.dropInto(T) while(T) + if(!rag || QDELETED(src) || !HasBelow(T.z) || !T.is_open()) + break rag.forceMove(T) - if(rag.on_fire) + if(rag.is_on_fire()) T.hotspot_expose(700, 5) for(var/mob/living/M in T.contents) - M.IgniteMob() - if(!rag || QDELETED(src) || !HasBelow(T.z) || !T.is_open()) - break + M.ignite_fire() T = GetBelow(T) rag = null @@ -148,7 +148,7 @@ . = ..() underlays.Cut() if(rag) - var/underlay_image = image(icon='icons/obj/drinks.dmi', icon_state=rag.on_fire? "[rag_underlay]_lit" : rag_underlay) + var/underlay_image = image(icon='icons/obj/drinks.dmi', icon_state=rag.is_on_fire()? "[rag_underlay]_lit" : rag_underlay) underlays += underlay_image set_light(rag.light_range, 0.1, rag.light_color) else @@ -178,8 +178,8 @@ if(reagents) user.visible_message(SPAN_NOTICE("The contents of \the [src] splash all over [target]!")) reagents.splash(target, reagents.total_volume) - if(rag && rag.on_fire && istype(target)) - target.IgniteMob() + if(rag?.is_on_fire() && istype(target)) + target.ignite_fire() //Finally, smash the bottle. This kills (qdel) the bottle. var/obj/item/broken_bottle/B = smash(target.loc, target) diff --git a/code/modules/spells/targeted/ethereal_jaunt.dm b/code/modules/spells/targeted/ethereal_jaunt.dm index fdccd1ce64d..55a0ed83359 100644 --- a/code/modules/spells/targeted/ethereal_jaunt.dm +++ b/code/modules/spells/targeted/ethereal_jaunt.dm @@ -31,7 +31,7 @@ animation.anchored = TRUE animation.icon = 'icons/mob/mob.dmi' animation.layer = FLY_LAYER - target.ExtinguishMob() + target.extinguish_fire() if(target.buckled) target.buckled = null jaunt_disappear(animation, target) diff --git a/mods/gamemodes/cult/runes.dm b/mods/gamemodes/cult/runes.dm index 11fd2e328ed..161d225a648 100644 --- a/mods/gamemodes/cult/runes.dm +++ b/mods/gamemodes/cult/runes.dm @@ -481,8 +481,8 @@ if(casters.len < 3) break //T.turf_animation('icons/effects/effects.dmi', "rune_sac") - victim.fire_stacks = max(2, victim.fire_stacks) - victim.IgniteMob() + victim.set_fire_intensity(max(2, victim.get_fire_intensity())) + victim.ignite_fire() var/dam_amt = 2 + length(casters) victim.take_organ_damage(dam_amt, dam_amt) // This is to speed up the process and also damage mobs that don't take damage from being on fire, e.g. borgs if(ishuman(victim)) @@ -505,10 +505,9 @@ to_chat(victim, SPAN_OCCULT("The Geometer of Blood claims your body.")) victim.dust() if(victim) - victim.ExtinguishMob() // Technically allows them to put the fire out by sacrificing them and stopping immediately, but I don't think it'd have much effect + victim.extinguish_fire() // Technically allows them to put the fire out by sacrificing them and stopping immediately, but I don't think it'd have much effect victim = null - /obj/effect/rune/drain cultname = "blood drain" strokes = 3 diff --git a/mods/species/serpentid/datum/species.dm b/mods/species/serpentid/datum/species.dm index e58789252fc..86d5ae09208 100644 --- a/mods/species/serpentid/datum/species.dm +++ b/mods/species/serpentid/datum/species.dm @@ -84,8 +84,8 @@ #undef SERPENTID_FLIGHT_PRESSURE_THRESHOLD /decl/species/serpentid/handle_environment_special(var/mob/living/human/H) - if(!H.on_fire && H.fire_stacks < 2) - H.fire_stacks += 0.2 + if(!H.is_on_fire() && H.get_fire_intensity() < 2) + H.adjust_fire_intensity(0.2) return /decl/species/serpentid/handle_fall_special(var/mob/living/human/H, var/turf/landing) diff --git a/nebula.dme b/nebula.dme index 354c22a8b18..95b6436de7a 100644 --- a/nebula.dme +++ b/nebula.dme @@ -739,6 +739,7 @@ #include "code\game\atom_material.dm" #include "code\game\atoms.dm" #include "code\game\atoms_damage.dm" +#include "code\game\atoms_fires.dm" #include "code\game\atoms_fluids.dm" #include "code\game\atoms_init.dm" #include "code\game\atoms_layering.dm" @@ -2862,6 +2863,7 @@ #include "code\modules\mob\living\living_dreams.dm" #include "code\modules\mob\living\living_eating.dm" #include "code\modules\mob\living\living_electrocution.dm" +#include "code\modules\mob\living\living_fires.dm" #include "code\modules\mob\living\living_genetics.dm" #include "code\modules\mob\living\living_give.dm" #include "code\modules\mob\living\living_grabs.dm"