Files
Bubberstation/code/game/objects/items/candle.dm
ShizCalev 1a32f60cf4 [ready] adds unit test for missing inhand icons. fixes a bunch of missing inhand icons (#70037)
fix: Fixed a bunch of missing inhand icons.
fix: Fixed cables in electrical toolboxes not randomizing their colors.
fix: Fixed the wrong colored icon showing when trying to make cable cuffs out of cables.
fix: The collectable SWAT helmet is now using the proper icon again!
refactor: Pipecleaners and power cables now share a unified color system, so they're once again available in ALL the same colors.
imageadd: Updated the screwdriver belt overlay to represent the newer sprite.
imageadd: Added a bunch of new inhand icons. Special thanks to Twaticus for doing the helmets! <3
fix: Wirecutters now have an icon when inside a belt again!
admin: Added a new omnitool subtype that allows you to spawn all items in a typepath!
fix: Explorer gaskmasks now properly reflect their adjusted state when held.
fix: Fixed balaclavas having the wrong icon when pulled up.
fix: Fixed the base energy sword (admin spawn only) being invisible.
fix: The rainbow energy sword is now a little bit more rainbowy!
fix: Fixed an tk exploit with orange handcuffed shoes.
fix: The traitor outfit in the select equipment panel is now actually functional!
2022-10-04 10:20:24 -07:00

83 lines
1.7 KiB
Plaintext

#define CANDLE_LUMINOSITY 2
/obj/item/candle
name = "red candle"
desc = "In Greek myth, Prometheus stole fire from the Gods and gave it to \
humankind. The jewelry he kept for himself."
icon = 'icons/obj/candle.dmi'
icon_state = "candle1"
inhand_icon_state = null
w_class = WEIGHT_CLASS_TINY
light_color = LIGHT_COLOR_FIRE
heat = 1000
/// How many seconds it burns for
var/wax = 2000
var/lit = FALSE
var/infinite = FALSE
var/start_lit = FALSE
/obj/item/candle/Initialize(mapload)
. = ..()
if(start_lit)
light()
/obj/item/candle/update_icon_state()
icon_state = "candle[(wax > 800) ? ((wax > 1500) ? 1 : 2) : 3][lit ? "_lit" : ""]"
return ..()
/obj/item/candle/attackby(obj/item/W, mob/user, params)
var/msg = W.ignition_effect(src, user)
if(msg)
light(msg)
else
return ..()
/obj/item/candle/fire_act(exposed_temperature, exposed_volume)
if(!lit)
light() //honk
return ..()
/obj/item/candle/get_temperature()
return lit * heat
/obj/item/candle/proc/light(show_message)
if(!lit)
lit = TRUE
if(show_message)
usr.visible_message(show_message)
set_light(CANDLE_LUMINOSITY)
START_PROCESSING(SSobj, src)
update_appearance()
/obj/item/candle/proc/put_out_candle()
if(!lit)
return
lit = FALSE
update_appearance()
set_light(0)
return TRUE
/obj/item/candle/extinguish()
put_out_candle()
return ..()
/obj/item/candle/process(delta_time)
if(!lit)
return PROCESS_KILL
if(!infinite)
wax -= delta_time
if(wax <= 0)
new /obj/item/trash/candle(loc)
qdel(src)
update_appearance()
open_flame()
/obj/item/candle/attack_self(mob/user)
if(put_out_candle())
user.visible_message(span_notice("[user] snuffs [src]."))
/obj/item/candle/infinite
infinite = TRUE
start_lit = TRUE
#undef CANDLE_LUMINOSITY