From 5e5a7358451193e24ff18e0228152e25d922e598 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mieszko=20J=C4=99drzejczak?= Date: Tue, 19 Apr 2016 20:37:49 +0200 Subject: [PATCH 1/5] Lightbulbs don't burn anymore. --- code/modules/power/lighting.dm | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index 3890b433eaf..574502df928 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -455,12 +455,8 @@ else if(TK in user.mutations) to_chat(user, "You telekinetically remove the light [fitting].") else - to_chat(user, "You try to remove the light [fitting], but you burn your hand on it!") - - var/obj/item/organ/external/affecting = H.get_organ("[user.hand ? "l" : "r" ]_hand") - if(affecting.take_damage( 0, 5 )) // 5 burn damage - H.UpdateDamageIcon() - H.updatehealth() + to_chat(user, "You try to remove the light [fitting], but it's too hot! You should get some better gloves.") + //no light burning return // if burned, don't remove the light else to_chat(user, "You remove the light [fitting].") From 36ae2782bb2f405565b07ec506d3a34123381353 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mieszko=20J=C4=99drzejczak?= Date: Wed, 20 Apr 2016 22:52:48 +0200 Subject: [PATCH 2/5] Lighters burn only your hand and lightbulbs don't burn at all --- code/game/objects/items/weapons/lighters.dm | 7 ++++++- code/modules/power/lighting.dm | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/code/game/objects/items/weapons/lighters.dm b/code/game/objects/items/weapons/lighters.dm index 3f19d6a494b..0444324af96 100644 --- a/code/game/objects/items/weapons/lighters.dm +++ b/code/game/objects/items/weapons/lighters.dm @@ -46,7 +46,12 @@ user.visible_message("After a few attempts, [user] manages to light the [src].") else to_chat(user, "You burn yourself while lighting the lighter.") - user.adjustFireLoss(5) + var/mob/living/M = user + if(ishuman(M)) + var/mob/living/carbon/human/H = M + var/obj/item/organ/external/affecting = H.get_organ("[user.hand ? "l" : "r" ]_hand") + if(affecting.take_damage( 0, 1 )) //INFERNO + H.UpdateDamageIcon() user.visible_message("After a few attempts, [user] manages to light the [src], they however burn their finger in the process.") set_light(2) diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index 574502df928..9b2d3bfb81e 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -455,7 +455,7 @@ else if(TK in user.mutations) to_chat(user, "You telekinetically remove the light [fitting].") else - to_chat(user, "You try to remove the light [fitting], but it's too hot! You should get some better gloves.") + to_chat(user, "You try to remove the light [fitting], but it's too hot!") //no light burning return // if burned, don't remove the light else From a24b14ed35a51eb4877a83dbbd1ced049580f41b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mieszko=20J=C4=99drzejczak?= Date: Wed, 20 Apr 2016 23:16:46 +0200 Subject: [PATCH 3/5] Fixesssss --- code/game/objects/items/weapons/lighters.dm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/game/objects/items/weapons/lighters.dm b/code/game/objects/items/weapons/lighters.dm index 0444324af96..27f103177c8 100644 --- a/code/game/objects/items/weapons/lighters.dm +++ b/code/game/objects/items/weapons/lighters.dm @@ -50,8 +50,9 @@ if(ishuman(M)) var/mob/living/carbon/human/H = M var/obj/item/organ/external/affecting = H.get_organ("[user.hand ? "l" : "r" ]_hand") - if(affecting.take_damage( 0, 1 )) //INFERNO + if(affecting.take_damage( 0, 5 )) //INFERNO H.UpdateDamageIcon() + H.updatehealth() user.visible_message("After a few attempts, [user] manages to light the [src], they however burn their finger in the process.") set_light(2) From 6c21db14334f189b128b3dba12730723d667bdb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mieszko=20J=C4=99drzejczak?= Date: Wed, 27 Apr 2016 12:10:48 +0200 Subject: [PATCH 4/5] Adds different interactions on different intents --- code/modules/power/lighting.dm | 103 ++++++++++++++++++++++----------- 1 file changed, 69 insertions(+), 34 deletions(-) diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index 9b2d3bfb81e..bfe415f9a4a 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -148,6 +148,7 @@ // this is used to calc the probability the light burns out var/rigged = 0 // true if rigged to explode + var/last_clicked = 0 // for attacking cooldown // the smaller bulb light fixture @@ -435,52 +436,86 @@ if(status == LIGHT_EMPTY) to_chat(user, "There is no [fitting] in this light.") return + if(user.a_intent == "help") + if(on) + to_chat(user, "This light [fitting] feels hot!") + else + to_chat(user, "The light [fitting] feels cold.") + return + + if(world.time - last_clicked < 10) //makes the whole thing impossible to spam + return + last_clicked = world.time + + if(user.a_intent == "disarm" || user.a_intent == "grab") //trying to grab the bulb // make it burn hands if not wearing fire-insulated gloves - if(on) - var/prot = 0 - var/mob/living/carbon/human/H = user + if(on) + var/prot = 0 + var/mob/living/carbon/human/H = user - if(istype(H)) + if(istype(H)) - if(H.gloves) - var/obj/item/clothing/gloves/G = H.gloves - if(G.max_heat_protection_temperature) - prot = (G.max_heat_protection_temperature > 360) + if(H.gloves) + var/obj/item/clothing/gloves/G = H.gloves + if(G.max_heat_protection_temperature) + prot = (G.max_heat_protection_temperature > 360) + else + prot = 1 + + if(prot > 0 || (RESIST_HEAT in user.mutations)) + to_chat(user, "You remove the light [fitting]") + else if(TK in user.mutations) + to_chat(user, "You telekinetically remove the light [fitting].") + else + to_chat(user, "You try to remove the light [fitting], but you burn your hand on it!") + + var/obj/item/organ/external/affecting = H.get_organ("[user.hand ? "l" : "r" ]_hand") + if(affecting.take_damage( 0, 5 )) // 5 burn damage + H.UpdateDamageIcon() + H.updatehealth() + return // if burned, don't remove the light else - prot = 1 - - if(prot > 0 || (RESIST_HEAT in user.mutations)) - to_chat(user, "You remove the light [fitting]") - else if(TK in user.mutations) - to_chat(user, "You telekinetically remove the light [fitting].") - else - to_chat(user, "You try to remove the light [fitting], but it's too hot!") - //no light burning - return // if burned, don't remove the light - else - to_chat(user, "You remove the light [fitting].") + to_chat(user, "You remove the light [fitting].") - // create a light tube/bulb item and put it in the user's hand - var/obj/item/weapon/light/L = new light_type() - L.status = status - L.rigged = rigged - L.brightness_range = brightness_range - L.brightness_power = brightness_power - L.brightness_color = brightness_color + // create a light tube/bulb item and put it in the user's hand + var/obj/item/weapon/light/L = new light_type() + L.status = status + L.rigged = rigged + L.brightness_range = brightness_range + L.brightness_power = brightness_power + L.brightness_color = brightness_color // light item inherits the switchcount, then zero it - L.switchcount = switchcount - switchcount = 0 + L.switchcount = switchcount + switchcount = 0 - L.update() - L.add_fingerprint(user) + L.update() + L.add_fingerprint(user) - user.put_in_active_hand(L) //puts it in our active hand + user.put_in_active_hand(L) //puts it in our active hand + + status = LIGHT_EMPTY + update() + + if(user.a_intent == "harm") //hitting the bulb + user.do_attack_animation(src) + if(prob(10)) //10% chance to break a light with bare hands + to_chat(user, "You hit the light, and it smashes!") + for(var/mob/M in viewers(src)) + if(M == user) + continue + M.show_message("[user.name] smashed the light!", 3, "You hear a tinkle of breaking glass", 2) + if(on) + electrocute_mob(user, get_area(src), src, 0.3) + broken() + else + user.visible_message("[user.name] hits the light.") + playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1) + + return - status = LIGHT_EMPTY - update() // break the light and make sparks if was on From ef13110610d9dda6fdfe02a6967ebba49c539a6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mieszko=20J=C4=99drzejczak?= Date: Wed, 27 Apr 2016 15:07:30 +0200 Subject: [PATCH 5/5] Permanently dooms everyone and basically kills the universe. --- code/modules/power/lighting.dm | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index bfe415f9a4a..a2074de5041 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -148,7 +148,6 @@ // this is used to calc the probability the light burns out var/rigged = 0 // true if rigged to explode - var/last_clicked = 0 // for attacking cooldown // the smaller bulb light fixture @@ -443,10 +442,6 @@ to_chat(user, "The light [fitting] feels cold.") return - if(world.time - last_clicked < 10) //makes the whole thing impossible to spam - return - last_clicked = world.time - if(user.a_intent == "disarm" || user.a_intent == "grab") //trying to grab the bulb // make it burn hands if not wearing fire-insulated gloves @@ -500,6 +495,7 @@ update() if(user.a_intent == "harm") //hitting the bulb + user.changeNext_move(CLICK_CD_MELEE) user.do_attack_animation(src) if(prob(10)) //10% chance to break a light with bare hands to_chat(user, "You hit the light, and it smashes!")