From 731600a21f1fcb537e12ed20d09a1c3c17063ea7 Mon Sep 17 00:00:00 2001 From: Fox-McCloud Date: Fri, 29 Jul 2016 17:07:25 -0400 Subject: [PATCH] tweaks --- code/game/objects/items/candle.dm | 137 +++++++++++----------- code/game/objects/items/weapons/cigs.dm | 14 ++- code/modules/mob/living/living_defense.dm | 2 +- 3 files changed, 80 insertions(+), 73 deletions(-) diff --git a/code/game/objects/items/candle.dm b/code/game/objects/items/candle.dm index 2b4ba234300..f0c3ee84e98 100644 --- a/code/game/objects/items/candle.dm +++ b/code/game/objects/items/candle.dm @@ -1,85 +1,90 @@ /obj/item/candle name = "red candle" - desc = "a 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" item_state = "candle1" w_class = 1 - - light_color = "#E09D37" - var/wax = 200 var/lit = 0 - proc - light(var/flavor_text = "\red [usr] lights the [name].") + var/infinite = 0 + var/start_lit = 0 + light_color = "#E09D37" + +/obj/item/candle/New() + ..() + if(start_lit) + // No visible message + light(show_message = 0) + +/obj/item/candle/update_icon() + var/i + if(wax>150) + i = 1 + else if(wax>80) + i = 2 + else i = 3 + icon_state = "candle[i][lit ? "_lit" : ""]" - update_icon() - var/i - if(wax>150) - i = 1 - else if(wax>80) - i = 2 - else i = 3 - icon_state = "candle[i][lit ? "_lit" : ""]" +/obj/item/candle/attackby(obj/item/weapon/W, mob/user, params) + ..() + if(istype(W, /obj/item/weapon/weldingtool)) + var/obj/item/weapon/weldingtool/WT = W + if(WT.isOn()) //Badasses dont get blinded by lighting their candle with a welding tool + light("[user] casually lights [src] with [WT], what a badass.") + else if(istype(W, /obj/item/weapon/lighter)) + var/obj/item/weapon/lighter/L = W + if(L.lit) + light("After some fiddling, [user] manages to light [src] with [L].") + else if(istype(W, /obj/item/weapon/match)) + var/obj/item/weapon/match/M = W + if(M.lit) + light("[user] lights [src] with [M]") + else if(istype(W, /obj/item/candle)) + var/obj/item/candle/C = W + if(C.lit) + light("[user] tilts [C] and lights [src] with it.") - attackby(obj/item/weapon/W as obj, mob/user as mob, params) - ..() - if(istype(W, /obj/item/weapon/weldingtool)) - var/obj/item/weapon/weldingtool/WT = W - if(WT.isOn()) //Badasses dont get blinded by lighting their candle with a welding tool - light("\red [user] casually lights the [name] with [W], what a badass.") - else if(istype(W, /obj/item/weapon/lighter)) - var/obj/item/weapon/lighter/L = W - if(L.lit) - light() - else if(istype(W, /obj/item/weapon/match)) - var/obj/item/weapon/match/M = W - if(M.lit) - light() - else if(istype(W, /obj/item/candle)) - var/obj/item/candle/C = W - if(C.lit) - light() +/obj/item/candle/fire_act() + if(!lit) + light() //honk - - fire_act() - if(!lit) - light() //honk - - light(var/flavor_text = "\red [usr] lights the [name].") - 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) - processing_objects.Add(src) - - - process() - if(!lit) - return - wax-- - if(!wax) - new/obj/item/trash/candle(src.loc) - if(istype(src.loc, /mob)) - var/mob/M = src.loc - M.unEquip(src, 1) //src is being deleted anyway - qdel(src) +/obj/item/candle/proc/light(show_message) + if(!lit) + lit = 1 + if(show_message) + usr.visible_message(show_message) + set_light(CANDLE_LUM) + processing_objects.Add(src) update_icon() - if(istype(loc, /turf)) //start a fire if possible - var/turf/T = loc - T.hotspot_expose(700, 5) - attack_self(mob/user as mob) - if(lit) - lit = 0 - update_icon() - set_light(0) +/obj/item/candle/process() + if(!lit) + return + if(!infinite) + wax-- + if(!wax) + new/obj/item/trash/candle(src.loc) + if(istype(src.loc, /mob)) + var/mob/M = src.loc + M.unEquip(src, 1) //src is being deleted anyway + qdel(src) + update_icon() + if(isturf(loc)) //start a fire if possible + var/turf/T = loc + T.hotspot_expose(700, 5) + + +/obj/item/candle/attack_self(mob/user) + if(lit) + user.visible_message("[user] snuffs out [src].") + lit = 0 + update_icon() + set_light(0) /obj/item/candle/eternal desc = "A candle. This one seems to have an odd quality about the wax." - wax = 10000 \ No newline at end of file + infinite = 1 \ No newline at end of file diff --git a/code/game/objects/items/weapons/cigs.dm b/code/game/objects/items/weapons/cigs.dm index 6f56b07ca77..8449e17a9db 100644 --- a/code/game/objects/items/weapons/cigs.dm +++ b/code/game/objects/items/weapons/cigs.dm @@ -113,7 +113,7 @@ LIGHTERS ARE IN LIGHTERS.DM to_chat(user, "[src] is full.") -/obj/item/clothing/mask/cigarette/proc/light(var/flavor_text = "[usr] lights the [name].") +/obj/item/clothing/mask/cigarette/proc/light(flavor_text = null) if(!src.lit) src.lit = 1 damtype = "fire" @@ -139,8 +139,9 @@ LIGHTERS ARE IN LIGHTERS.DM reagents.handle_reactions() icon_state = icon_on item_state = icon_on - var/turf/T = get_turf(src) - T.visible_message(flavor_text) + if(flavor_text) + var/turf/T = get_turf(src) + T.visible_message(flavor_text) set_light(2, 0.25, "#E38F46") processing_objects.Add(src) @@ -324,14 +325,15 @@ LIGHTERS ARE IN LIGHTERS.DM ..() reagents.add_reagent("nicotine", chem_volume) -/obj/item/clothing/mask/cigarette/pipe/light(var/flavor_text = "[usr] lights the [name].") +/obj/item/clothing/mask/cigarette/pipe/light(flavor_text = null) if(!src.lit) src.lit = 1 damtype = "fire" icon_state = icon_on item_state = icon_on - var/turf/T = get_turf(src) - T.visible_message(flavor_text) + if(flavor_text) + var/turf/T = get_turf(src) + T.visible_message(flavor_text) processing_objects.Add(src) /obj/item/clothing/mask/cigarette/pipe/process() diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index bbd3fee69c9..50576bcecad 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -186,7 +186,7 @@ ExtinguishMob() return var/datum/gas_mixture/G = loc.return_air() // Check if we're standing in an oxygenless environment - if(!G.oxygen || G.oxygen < 1) + if(G.oxygen < 1) ExtinguishMob() //If there's no oxygen in the tile we're on, put out the fire return var/turf/location = get_turf(src)