Files
Aurora.3/code/game/objects/items/weapons/candle.dm
T
hazelratandGitHub ef006612dd Stuff burns for longer (#19761)
This makes candles, matches, and cigarettes burn for longer than they
currently do. Matches burn for twice as long, candles for about +1/3 as
long, and cigarettes around twice as long.

Code note: I don't see any problems with this for matches and candles,
but there's a comment in the current code warning strictly not to lower
the smokable burn_rate below 0.01, see the changes. I haven't been able
to hunt down exactly why this is, and it seems like the burn_rate for
the parent type was already lowered down to 0.006 a few years ago by a
previous PR intended to extend cigarette burn times. From what I can
tell reagents are still being absorbed below 0.01 by having the
cigarette on your mask slot, so if there is a serious issue with this it
can be removed under review, but I'm not certain what it would be. I've
removed every subtype modification to burn_rate, which seems to have
been left a setting substantially higher than the parent, causing pipes
and cigars in live to seem to burn out very quickly - like in a little
over a minute.
2024-08-13 21:47:40 +00:00

80 lines
2.2 KiB
Plaintext

/obj/item/flame/candle
name = "red candle"
desc = "A small pillar candle. Its specially-formulated fuel-oxidizer wax mixture allows continued combustion in airless environments."
icon = 'icons/obj/storage/fancy/candle.dmi'
icon_state = "candle1"
item_state = "candle1"
drop_sound = 'sound/items/drop/gloves.ogg'
pickup_sound = 'sound/items/pickup/gloves.ogg'
w_class = WEIGHT_CLASS_TINY
light_color = "#E09D37"
var/wax = 3200
var/start_lit = FALSE
/obj/item/flame/candle/Initialize()
. = ..()
wax = rand(2800, 3400)
if(start_lit)
light()
/obj/item/flame/candle/update_icon()
var/i
if(wax > 2000)
i = 1
else if(wax > 1200)
i = 2
else i = 3
icon_state = "candle[i][lit ? "_lit" : ""]"
/obj/item/flame/candle/attackby(obj/item/attacking_item, mob/user)
..()
if(attacking_item.iswelder())
var/obj/item/weldingtool/WT = attacking_item
if(WT.isOn()) //Badasses dont get blinded by lighting their candle with a welding tool
light()
to_chat(user, SPAN_NOTICE("\The [user] casually lights \the [name] with [attacking_item]."))
else if(attacking_item.isFlameSource())
light()
to_chat(user, SPAN_NOTICE("\The [user] lights \the [name]."))
else if(istype(attacking_item, /obj/item/flame/candle))
var/obj/item/flame/candle/C = attacking_item
if(C.lit)
light()
to_chat(user, SPAN_NOTICE("\The [user] lights \the [name]."))
/obj/item/flame/candle/proc/light()
if(!src.lit)
src.lit = 1
playsound(src.loc, 'sound/items/cigs_lighters/cig_light.ogg', 50, 1)
//src.damtype = "fire"
set_light(CANDLE_LUM)
update_icon()
START_PROCESSING(SSprocessing, src)
/obj/item/flame/candle/process(mob/user)
if(!lit)
return
update_icon()
wax--
if(!wax)
new /obj/item/trash/candle(src.loc)
if(istype(src.loc, /mob))
src.dropped(user)
to_chat(user, SPAN_NOTICE("The candle burns out."))
playsound(src.loc, 'sound/items/cigs_lighters/cig_snuff.ogg', 50, 1)
STOP_PROCESSING(SSprocessing, src)
qdel(src)
update_icon()
if(istype(loc, /turf)) //start a fire if possible
var/turf/T = loc
T.hotspot_expose(700, 5)
/obj/item/flame/candle/attack_self(mob/user as mob)
if(lit)
lit = 0
to_chat(user, SPAN_NOTICE("You snuff out the flame."))
playsound(src.loc, 'sound/items/cigs_lighters/cig_snuff.ogg', 50, 1)
update_icon()
set_light(0)