Files
Aurora.3/code/game/objects/items/weapons/candle.dm
T
Alberyk 02913f3dc1 Custom items 16/05 (#4749)
Adds the following items:

Unathi Purple Dress - Ilaeza Marwani - burgerbb
Unathi Purple Boots - Ilaeza Marwani - burgerbb
Unathi Arm Warmers - Ilaeza Marwani - burgerbb
Clan Marwani Emblem - Ilaeza Marwani - burgerbb
Adhomian Divination Cards Deck - Klavdiya Tikhomirov - alberyk
Moon Shaped Amulet - Klavdiya Tikhomirov - alberyk
Spark Gloves - Lunea Discata - tishinastalker
Kitting Needles - Fernando Gonzales - resilynn
2018-05-16 21:34:21 +03:00

69 lines
1.8 KiB
Plaintext

/obj/item/weapon/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/candle.dmi'
icon_state = "candle1"
item_state = "candle1"
w_class = 1
light_color = "#E09D37"
var/wax = 2000
/obj/item/weapon/flame/candle/New()
wax = rand(800, 1000) // Enough for 27-33 minutes. 30 minutes on average.
..()
/obj/item/weapon/flame/candle/update_icon()
var/i
if(wax > 1500)
i = 1
else if(wax > 800)
i = 2
else i = 3
icon_state = "candle[i][lit ? "_lit" : ""]"
/obj/item/weapon/flame/candle/attackby(obj/item/weapon/W as obj, mob/user as mob)
..()
if(iswelder(W))
var/obj/item/weapon/weldingtool/WT = W
if(WT.isOn()) //Badasses dont get blinded by lighting their candle with a welding tool
light("<span class='notice'>\The [user] casually lights the [name] with [W].</span>")
else if(isflamesource(W))
light()
else if(istype(W, /obj/item/weapon/flame/candle))
var/obj/item/weapon/flame/candle/C = W
if(C.lit)
light()
/obj/item/weapon/flame/candle/proc/light(var/flavor_text = "<span class='notice'>\The [usr] lights the [name].</span>")
if(!src.lit)
src.lit = 1
//src.damtype = "fire"
for(var/mob/O in viewers(usr, null))
O.show_message(flavor_text, 1)
set_light(CANDLE_LUM)
START_PROCESSING(SSprocessing, src)
/obj/item/weapon/flame/candle/process()
if(!lit)
return
wax--
if(!wax)
new/obj/item/trash/candle(src.loc)
if(istype(src.loc, /mob))
src.dropped()
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/weapon/flame/candle/attack_self(mob/user as mob)
if(lit)
lit = 0
update_icon()
set_light(0)