From b8c32cd8e8c9e33dbaac7635d7d278c693dba520 Mon Sep 17 00:00:00 2001 From: DeityLink Date: Fri, 9 Feb 2024 15:30:56 +0100 Subject: [PATCH] Water (and other cleaner reagents) now extinguishes lit items such as candles, cigarettes, etc (#35931) * extinguish * extinguish * lighters and welding tools too --- code/ZAS/Fire.dm | 9 +++--- code/game/atoms.dm | 2 ++ code/game/objects/items/candle.dm | 7 +++++ .../objects/items/weapons/cigs_lighters.dm | 28 +++++++++++++++++++ code/game/objects/items/weapons/tools.dm | 20 +++++++++---- .../reagents/reagents/reagents_basic.dm | 4 +-- 6 files changed, 57 insertions(+), 13 deletions(-) diff --git a/code/ZAS/Fire.dm b/code/ZAS/Fire.dm index 3dbac6106165..dedb2ffec527 100644 --- a/code/ZAS/Fire.dm +++ b/code/ZAS/Fire.dm @@ -86,10 +86,11 @@ Attach to transfer valve and open. BOOM. qdel(src) /atom/proc/extinguish() - on_fire=0 - if(fire_overlay) - overlays -= fire_overlay - QDEL_NULL(firelightdummy) + if (on_fire) + on_fire=0 + if(fire_overlay) + overlays -= fire_overlay + QDEL_NULL(firelightdummy) /atom/proc/ignite(var/temperature) on_fire=1 diff --git a/code/game/atoms.dm b/code/game/atoms.dm index e7157eeb8698..85b3c333e811 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -543,6 +543,8 @@ its easier to just keep the beam vertical. clean_blood() if (cleanliness >= CLEANLINESS_BLEACH) color = "" + if (cleanliness >= CLEANLINESS_WATER)//I mean, not sure why we'd ever add a rank below water but, futur-proofing and all that jazz + extinguish()//Fire.dm //Called on every object in a shuttle which rotates /atom/proc/map_element_rotate(var/angle) diff --git a/code/game/objects/items/candle.dm b/code/game/objects/items/candle.dm index f985efc9c1ca..bf8467f84387 100644 --- a/code/game/objects/items/candle.dm +++ b/code/game/objects/items/candle.dm @@ -35,6 +35,13 @@ lit = 0 light("",TRUE) +/obj/item/candle/extinguish() + ..() + if(lit) + lit = 0 + update_icon() + set_light(0) + /obj/item/candle/update_icon() overlays.len = 0 dynamic_overlay["[HAND_LAYER]-[GRASP_LEFT_HAND]"] = null diff --git a/code/game/objects/items/weapons/cigs_lighters.dm b/code/game/objects/items/weapons/cigs_lighters.dm index 97e4a66d8ffa..395d6d788ea5 100644 --- a/code/game/objects/items/weapons/cigs_lighters.dm +++ b/code/game/objects/items/weapons/cigs_lighters.dm @@ -61,6 +61,13 @@ MATCHBOXES ARE ALSO IN FANCY.DM lit = 1 update_brightness() +/obj/item/weapon/match/extinguish() + ..() + if (lit) + lit = -1 + update_brightness() + visible_message("\The [name] goes out.") + /obj/item/weapon/match/examine(mob/user) ..() switch(lit) @@ -307,6 +314,20 @@ MATCHBOXES ARE ALSO IN FANCY.DM return light("The raging fire sets \the [src] alight.") +/obj/item/clothing/mask/cigarette/extinguish() + ..() + if(lit) + if (ismob(loc)) + loc.visible_message("[loc]'s [name] goes out.","Your [name] goes out.") + else + visible_message("\The [name] goes out.") + var/turf/T = get_turf(src) + var/atom/new_butt = new type_butt(T) + transfer_fingerprints_to(new_butt) + lit = 0 //Needed for proper update + update_brightness() + qdel(src) + /obj/item/clothing/mask/cigarette/is_hot() if(lit) return source_temperature @@ -1020,6 +1041,13 @@ MATCHBOXES ARE ALSO IN FANCY.DM "You quietly shut off \the [src].") update_brightness() +/obj/item/weapon/lighter/extinguish() + ..() + if (lit) + fueltime = null + lit = 0 + update_brightness() + /obj/item/weapon/lighter/is_hot() if(lit) return source_temperature diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/weapons/tools.dm index 05f4ceb473ba..432c42275fe2 100644 --- a/code/game/objects/items/weapons/tools.dm +++ b/code/game/objects/items/weapons/tools.dm @@ -551,12 +551,20 @@ to_chat(usr, "You switch the [src] off.") else visible_message("\The [src] shuts off!") - playsound(src,'sound/effects/zzzt.ogg',20,1) - set_light(0) - src.force = 3 - src.damtype = "brute" - update_icon() - src.welding = 0 + shut_off() + +/obj/item/tool/weldingtool/extinguish() + ..() + if (welding) + shut_off() + +/obj/item/tool/weldingtool/proc/shut_off() + playsound(src,'sound/effects/zzzt.ogg',20,1) + set_light(0) + force = 3 + damtype = "brute" + update_icon() + welding = 0 //Decides whether or not to damage a player's eyes based on what they're wearing as protection //Note: This should probably be moved to mob diff --git a/code/modules/reagents/reagents/reagents_basic.dm b/code/modules/reagents/reagents/reagents_basic.dm index 66cc26fd1a46..544275612343 100644 --- a/code/modules/reagents/reagents/reagents_basic.dm +++ b/code/modules/reagents/reagents/reagents_basic.dm @@ -326,7 +326,7 @@ if(O.invisibility) O.make_visible(INVISIBLESPRAY) - O.clean_act(CLEANLINESS_WATER) + O.clean_act(CLEANLINESS_WATER)//removes glue and extinguishes fire if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/monkeycube)) var/obj/item/weapon/reagent_containers/food/snacks/monkeycube/cube = O @@ -338,8 +338,6 @@ else if(istype(O, /obj/item/weapon/book/manual/snow)) var/obj/item/weapon/book/manual/snow/S = O S.trigger() - else if(O.on_fire) // For extinguishing objects on fire - O.extinguish() else if(O.molten) // Molten shit. O.molten=0 O.solidify()