Skip to content

Commit

Permalink
Water (and other cleaner reagents) now extinguishes lit items such as…
Browse files Browse the repository at this point in the history
… candles, cigarettes, etc (vgstation-coders#35931)

* extinguish

* extinguish

* lighters and welding tools too
  • Loading branch information
DeityLink authored Feb 9, 2024
1 parent 099f23a commit b8c32cd
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 13 deletions.
9 changes: 5 additions & 4 deletions code/ZAS/Fire.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 7 additions & 0 deletions code/game/objects/items/candle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 28 additions & 0 deletions code/game/objects/items/weapons/cigs_lighters.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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("<span class='notice'>\The [name] goes out.</span>")

/obj/item/weapon/match/examine(mob/user)
..()
switch(lit)
Expand Down Expand Up @@ -307,6 +314,20 @@ MATCHBOXES ARE ALSO IN FANCY.DM
return
light("<span class='danger'>The raging fire sets \the [src] alight.</span>")

/obj/item/clothing/mask/cigarette/extinguish()
..()
if(lit)
if (ismob(loc))
loc.visible_message("<span class='notice'>[loc]'s [name] goes out.</span>","<span class='notice'>Your [name] goes out.</span>")
else
visible_message("<span class='notice'>\The [name] goes out.</span>")
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
Expand Down Expand Up @@ -1020,6 +1041,13 @@ MATCHBOXES ARE ALSO IN FANCY.DM
"<span class='notice'>You quietly shut off \the [src].</span>")
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
Expand Down
20 changes: 14 additions & 6 deletions code/game/objects/items/weapons/tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -551,12 +551,20 @@
to_chat(usr, "<span class='notice'>You switch the [src] off.</span>")
else
visible_message("<span class='notice'>\The [src] shuts off!</span>")
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
Expand Down
4 changes: 1 addition & 3 deletions code/modules/reagents/reagents/reagents_basic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()
Expand Down

0 comments on commit b8c32cd

Please sign in to comment.