Lit update (#9247)

Lit cigarettes now count as flame sources.
Changed the isflamesource proc from a general proc to an obj/item proc. It is tidier and will be easier to add future flame sources this way.
Removed some hardcoded flame stuff (Such as igniting rags and paper), which depending on an item being a type instead of just being something that could produce a flame. They now check to see if an item counts as a flame source.
Found leftover clown BS while updating paper burning code and killed it off.
This commit is contained in:
Doxxmedearly
2020-07-04 00:52:12 +03:00
committed by GitHub
parent 546b70652e
commit 16801b2abb
14 changed files with 51 additions and 59 deletions
+4
View File
@@ -859,3 +859,7 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
if(user)
attack_self(user)
return TRUE
//Override this for items that can be flame sources.
/obj/item/proc/isFlameSource()
return FALSE
+1 -1
View File
@@ -31,7 +31,7 @@
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 [W]."))
else if(isflamesource(W))
else if(W.isFlameSource())
light()
to_chat(user, span("notice", "\The [user] lights \the [name]."))
else if(istype(W, /obj/item/flame/candle))
@@ -16,20 +16,8 @@ CIGARETTE PACKETS ARE IN FANCY.DM
/obj/item/flame
var/lit = 0
/proc/isflamesource(A)
var/obj/item/I = A
if(I.iswelder())
var/obj/item/weldingtool/WT = A
return (WT.isOn())
else if(istype(I, /obj/item/flame))
var/obj/item/flame/F = I
return (F.lit)
else if(istype(I, /obj/item/device/assembly/igniter))
return 1
else if(istype(I, /obj/item/clothing/gloves/fluff/lunea_gloves))
var/obj/item/clothing/gloves/fluff/lunea_gloves/F = I
return (F.lit)
return 0
/obj/item/flame/isFlameSource()
return lit
///////////
//MATCHES//
@@ -103,6 +91,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
var/icon_off
var/type_butt = null
var/chem_volume = 15 //Size of a syringe
var/genericmes = "USER lights NAME with FLAME"
var/matchmes = "USER lights NAME with FLAME"
var/lightermes = "USER lights NAME with FLAME"
var/zippomes = "USER lights NAME with FLAME"
@@ -206,7 +195,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
/obj/item/clothing/mask/smokable/attackby(obj/item/W as obj, mob/user as mob)
..()
if(isflamesource(W))
if(W.isFlameSource())
var/text = matchmes
if(istype(W, /obj/item/flame/match))
text = matchmes
@@ -218,11 +207,16 @@ CIGARETTE PACKETS ARE IN FANCY.DM
text = weldermes
else if(istype(W, /obj/item/device/assembly/igniter))
text = ignitermes
text = replacetext(text, "USER", "[user]")
text = replacetext(text, "NAME", "[name]")
text = replacetext(text, "FLAME", "[W.name]")
else
text = genericmes
text = replacetext(text, "USER", "\the [user]")
text = replacetext(text, "NAME", "\the [name]")
text = replacetext(text, "FLAME", "\the [W.name]")
light(text)
/obj/item/clothing/mask/smokable/isFlameSource()
return lit
/obj/item/clothing/mask/smokable/cigarette
name = "cigarette"
desc = "A roll of tobacco and nicotine."
@@ -18,7 +18,7 @@
if(WT.isOn())
activate(user)
else if(isflamesource(W))
else if(W.isFlameSource())
activate(user)
else if(istype(W, /obj/item/flame/candle))
+3
View File
@@ -464,6 +464,9 @@
/obj/item/weldingtool/proc/isOn()
return src.welding
/obj/item/weldingtool/isFlameSource()
return isOn()
//Sets the welding state of the welding tool. If you see W.welding = 1 anywhere, please change it to W.setWelding(1)
//so that the welding tool updates accordingly
/obj/item/weldingtool/proc/setWelding(var/set_welding, var/mob/M)