From 95e4f53258e7696fc43ff692956555f8305d9a03 Mon Sep 17 00:00:00 2001 From: Chinsky Date: Thu, 15 Jan 2015 23:47:07 +0300 Subject: [PATCH 1/4] Ported TG's code for burny mobs, by ergoslavi. --- code/game/machinery/cryo.dm | 1 + .../objects/items/weapons/cigs_lighters.dm | 7 ++++ .../objects/items/weapons/extinguisher.dm | 7 +++- code/game/objects/items/weapons/tools.dm | 5 ++- code/game/objects/structures/watercloset.dm | 5 +++ .../mob/living/carbon/human/examine.dm | 5 ++- code/modules/mob/living/carbon/human/life.dm | 25 +++++++++++++ .../mob/living/carbon/human/update_icons.dm | 12 +++++- code/modules/mob/living/carbon/monkey/life.dm | 9 +++++ .../mob/living/carbon/monkey/update_icons.dm | 11 +++++- code/modules/mob/living/living.dm | 15 +++++++- code/modules/mob/living/living_defense.dm | 35 ++++++++++++++++++ code/modules/mob/living/living_defines.dm | 5 ++- code/modules/reagents/Chemistry-Reagents.dm | 25 ++++++++++++- icons/mob/OnFire.dmi | Bin 0 -> 1845 bytes 15 files changed, 158 insertions(+), 9 deletions(-) create mode 100644 icons/mob/OnFire.dmi diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm index 32543822b9..7d10bd9a6f 100644 --- a/code/game/machinery/cryo.dm +++ b/code/game/machinery/cryo.dm @@ -288,6 +288,7 @@ M.client.eye = src M.stop_pulling() M.loc = src + M.ExtinguishMob() if(M.health > -100 && (M.health < 0 || M.sleeping)) M << "\blue You feel a cold liquid surround you. Your skin starts to freeze up." occupant = M diff --git a/code/game/objects/items/weapons/cigs_lighters.dm b/code/game/objects/items/weapons/cigs_lighters.dm index 4d09a26bcf..cc05de93a7 100644 --- a/code/game/objects/items/weapons/cigs_lighters.dm +++ b/code/game/objects/items/weapons/cigs_lighters.dm @@ -31,6 +31,9 @@ CIGARETTE PACKETS ARE IN FANCY.DM attack_verb = list("burnt", "singed") /obj/item/weapon/flame/match/process() + if(isliving(loc)) + var/mob/living/M = loc + M.IgniteMob() var/turf/location = get_turf(src) smoketime-- if(smoketime < 1) @@ -162,6 +165,9 @@ CIGARETTE PACKETS ARE IN FANCY.DM /obj/item/clothing/mask/cigarette/process() + if(isliving(loc)) + var/mob/living/M = loc + M.IgniteMob() var/turf/location = get_turf(src) smoketime-- if(smoketime < 1) @@ -444,6 +450,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM /obj/item/weapon/flame/lighter/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob) if(!istype(M, /mob)) return + M.IgniteMob() if(istype(M.wear_mask, /obj/item/clothing/mask/cigarette) && user.zone_sel.selecting == "mouth" && lit) var/obj/item/clothing/mask/cigarette/cig = M.wear_mask diff --git a/code/game/objects/items/weapons/extinguisher.dm b/code/game/objects/items/weapons/extinguisher.dm index f6758e53e6..3ba9e2971c 100644 --- a/code/game/objects/items/weapons/extinguisher.dm +++ b/code/game/objects/items/weapons/extinguisher.dm @@ -13,7 +13,7 @@ force = 10.0 matter = list("metal" = 90) attack_verb = list("slammed", "whacked", "bashed", "thunked", "battered", "bludgeoned", "thrashed") - + var/spray_particles = 6 var/spray_amount = 2 //units of liquid per particle var/max_water = 120 @@ -124,7 +124,7 @@ R.my_atom = W if(!W || !src) return src.reagents.trans_to(W, spray_amount) - + for(var/b=0, b<5, b++) step_towards(W,my_target) if(!W || !W.reagents) return @@ -135,6 +135,9 @@ if(!W.reagents) break W.reagents.reaction(atm) + if(isliving(atm)) //For extinguishing mobs on fire + var/mob/living/M = atm + M.ExtinguishMob() if(W.loc == my_target) break sleep(2) W.delete() diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/weapons/tools.dm index 62793f0b2c..f2a504bb50 100644 --- a/code/game/objects/items/weapons/tools.dm +++ b/code/game/objects/items/weapons/tools.dm @@ -259,6 +259,9 @@ if (src.welding) remove_fuel(1) var/turf/location = get_turf(user) + if(isliving(O)) + var/mob/living/L = O + L.IgniteMob() if (istype(location, /turf)) location.hotspot_expose(700, 50, 1) return @@ -531,4 +534,4 @@ if(!resolved && tool && target) tool.afterattack(target,user,1) if(tool) - tool.loc = src*/ + tool.loc = src*/ diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index 33235ae124..e77f1e602c 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -211,6 +211,11 @@ /obj/machinery/shower/proc/wash(atom/movable/O as obj|mob) if(!on) return + if(isliving(O)) + var/mob/living/L = O + L.ExtinguishMob() + L.fire_stacks = -20 //Douse ourselves with water to avoid fire more easily + if(iscarbon(O)) var/mob/living/carbon/M = O if(M.r_hand) diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index 777c17fdbc..e93bdf0c79 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -219,7 +219,10 @@ usr << "[t_He] has no pulse[src.client ? "" : " and [t_his] soul has departed"]..." else usr << "[t_He] has a pulse!" - + if(fire_stacks) + msg += "[t_He] [t_is] covered in some liquid.\n" + if(fire_stacks) + msg += "[t_He] [t_is] on fire!.\n" msg += "" if(nutrition < 100) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 0f13a6dbfd..44908eed00 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -112,6 +112,9 @@ //Handle temperature/pressure differences between body and environment handle_environment(environment) //Optimized a good bit. + //Check if we're on fire + handle_fire() + //Status updates, death etc. handle_regular_status_updates() //Optimized a bit update_canmove() @@ -784,6 +787,8 @@ if (abs(body_temperature_difference) < 0.5) return //fuck this precision + if (on_fire) + return //too busy for pesky convection if(bodytemperature < species.cold_level_1) //260.15 is 310.15 - 50, the temperature where you start to feel effects. if(nutrition >= 2) //If we are very, very cold we'll use up quite a bit of nutriment to heat us up. @@ -1774,5 +1779,25 @@ speech_problem_flag = 1 return stuttering +/mob/living/carbon/human/handle_fire() + if(..()) + return + var/thermal_protection = 0 //Simple check to estimate how protected we are against multiple temperatures + if(wear_suit) + if(wear_suit.max_heat_protection_temperature >= FIRESUIT_MAX_HEAT_PROTECTION_TEMPERATURE) + thermal_protection += (wear_suit.max_heat_protection_temperature*0.7) + if(head) + if(head.max_heat_protection_temperature >= FIRE_HELMET_MAX_HEAT_PROTECTION_TEMPERATURE) + thermal_protection += (head.max_heat_protection_temperature*THERMAL_PROTECTION_HEAD) + thermal_protection = round(thermal_protection) + if(thermal_protection >= FIRESUIT_MAX_HEAT_PROTECTION_TEMPERATURE) + return + if(thermal_protection >= FIRESUIT_MAX_HEAT_PROTECTION_TEMPERATURE) + bodytemperature += 11 + return + else + bodytemperature += BODYTEMP_HEATING_MAX + return + #undef HUMAN_MAX_OXYLOSS #undef HUMAN_CRIT_MAX_OXYLOSS diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index cc053f219d..6d609026e5 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -127,7 +127,8 @@ Please contact me on #coderbus IRC. ~Carn x #define L_HAND_LAYER 20 #define R_HAND_LAYER 21 #define TARGETED_LAYER 22 //BS12: Layer for the target overlay from weapon targeting system -#define TOTAL_LAYERS 22 +#define FIRE_LAYER 23 //If you're on fire +#define TOTAL_LAYERS 23 ////////////////////////////////// /mob/living/carbon/human @@ -508,6 +509,7 @@ proc/get_damage_icon_part(damage_state, body_part) update_inv_handcuffed(0) update_inv_legcuffed(0) update_inv_pockets(0) + update_fire(0) UpdateDamageIcon() update_icons() //Hud Stuff @@ -911,6 +913,13 @@ proc/get_damage_icon_part(damage_state, body_part) if(update_icons) update_icons() +/mob/living/carbon/human/update_fire(var/update_icons=1) + overlays_standing[FIRE_LAYER] = null + if(on_fire) + overlays_standing[FIRE_LAYER] = image("icon"='icons/mob/OnFire.dmi', "icon_state"="Standing", "layer"=-FIRE_LAYER) + + if(update_icons) update_icons() + // Used mostly for creating head items /mob/living/carbon/human/proc/generate_head_icon() //gender no longer matters for the mouth, although there should probably be seperate base head icons. @@ -969,4 +978,5 @@ proc/get_damage_icon_part(damage_state, body_part) #undef L_HAND_LAYER #undef R_HAND_LAYER #undef TARGETED_LAYER +#undef FIRE_LAYER #undef TOTAL_LAYERS diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm index 20b80c9c89..016f57f18f 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -57,6 +57,9 @@ if(environment) // More error checking -- TLE handle_environment(environment) + //Check if we're on fire + handle_fire() + //Status updates, death etc. handle_regular_status_updates() update_canmove() @@ -629,3 +632,9 @@ proc/handle_changeling() if(mind && mind.changeling) mind.changeling.regenerate() + +/mob/living/carbon/monkey/handle_fire() + if(..()) + return + adjustFireLoss(6) + return \ No newline at end of file diff --git a/code/modules/mob/living/carbon/monkey/update_icons.dm b/code/modules/mob/living/carbon/monkey/update_icons.dm index 284f9e288f..ec69d454f6 100644 --- a/code/modules/mob/living/carbon/monkey/update_icons.dm +++ b/code/modules/mob/living/carbon/monkey/update_icons.dm @@ -5,7 +5,8 @@ #define M_L_HAND_LAYER 4 #define M_R_HAND_LAYER 5 #define TARGETED_LAYER 6 -#define M_TOTAL_LAYERS 6 +#define M_FIRE_LAYER 6 +#define M_TOTAL_LAYERS 7 ///////////////////////////////// /mob/living/carbon/monkey @@ -19,6 +20,7 @@ update_inv_r_hand(0) update_inv_l_hand(0) update_inv_handcuffed(0) + update_fire(0) update_icons() //Hud Stuff update_hud() @@ -109,6 +111,12 @@ overlays_standing[TARGETED_LAYER] = null if(update_icons) update_icons() +/mob/living/carbon/monkey/update_fire(var/update_icons=1) + if(on_fire) + overlays_standing[M_FIRE_LAYER] = image("icon"='icons/mob/OnFire.dmi', "icon_state"="Standing", "layer"= -M_FIRE_LAYER) + else + overlays_standing[M_FIRE_LAYER] = null + if(update_icons) update_icons() //Monkey Overlays Indexes//////// #undef M_MASK_LAYER #undef M_BACK_LAYER @@ -116,5 +124,6 @@ #undef M_L_HAND_LAYER #undef M_R_HAND_LAYER #undef TARGETED_LAYER +#undef M_FIRE_LAYER #undef M_TOTAL_LAYERS diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index b9f898ab5d..18a93203d1 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -281,6 +281,8 @@ C.legcuffed = initial(C.legcuffed) hud_updateflag |= 1 << HEALTH_HUD hud_updateflag |= 1 << STATUS_HUD + ExtinguishMob() + fire_stacks = 0 /mob/living/proc/rejuvenate() @@ -628,9 +630,20 @@ BD.attack_hand(usr) C.open() - //breaking out of handcuffs + //drop && roll or breaking out of handcuffs else if(iscarbon(L)) var/mob/living/carbon/CM = L + if(CM.on_fire && CM.canmove) + CM.fire_stacks -= 5 + CM.Weaken(3) + CM.visible_message("[CM] rolls on the floor, trying to put themselves out!", \ + "You stop, drop, and roll!") + sleep(30) + if(fire_stacks <= 0) + CM.visible_message("[CM] has successfully extinguished themselves!", \ + "You extinguish yourself.") + ExtinguishMob() + return if(CM.handcuffed && CM.canmove && (CM.last_special <= world.time)) CM.next_move = world.time + 100 CM.last_special = world.time + 100 diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 1afd5b5325..e7a542f49f 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -191,3 +191,38 @@ src.visible_message("[user] has [attack_message] [src]!") spawn(1) updatehealth() return 1 + +/mob/living/proc/IgniteMob() + if(fire_stacks > 0 && !on_fire) + on_fire = 1 + src.AddLuminosity(3) + update_fire() + +/mob/living/proc/ExtinguishMob() + if(on_fire) + on_fire = 0 + fire_stacks = 0 + src.AddLuminosity(-3) + update_fire() + +/mob/living/proc/update_fire() + return + +/mob/living/proc/adjust_fire_stacks(add_fire_stacks) //Adjusting the amount of fire_stacks we have on person + fire_stacks = Clamp(fire_stacks + add_fire_stacks, min = -20, max = 20) + +/mob/living/proc/handle_fire() + if(fire_stacks < 0) + fire_stacks = max(0, fire_stacks++) //If we've doused ourselves in water to avoid fire, dry off slowly + if(!on_fire) + return 1 + var/datum/gas_mixture/G = loc.return_air() // Check if we're standing in an oxygenless environment + if(G.gas["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) + location.hotspot_expose(700, 50, 1) + +/mob/living/fire_act() + adjust_fire_stacks(0.5) + IgniteMob() \ No newline at end of file diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index 3c1c8a935c..82cf38067c 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -37,4 +37,7 @@ var/tod = null // Time of death var/update_slimes = 1 - var/silent = null //Can't talk. Value goes down every life proc. \ No newline at end of file + var/silent = null //Can't talk. Value goes down every life proc. + + var/on_fire = 0 //The "Are we on fire?" var + var/fire_stacks = 0 //Tracks how many stacks of fire we have on, max is usually 20 diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm index 6fd9de29f7..e295c5e3af 100644 --- a/code/modules/reagents/Chemistry-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents.dm @@ -258,10 +258,15 @@ datum if(!cube.wrapped) cube.Expand() - reaction_mob(var/mob/M, var/method=TOUCH, var/volume) + reaction_mob(var/mob/living/M, var/method=TOUCH, var/volume) if (istype(M, /mob/living/carbon/slime)) var/mob/living/carbon/slime/S = M S.apply_water() + if(method == TOUCH && isliving(M)) + M.adjust_fire_stacks(-(volume / 10)) + if(M.fire_stacks <= 0) + M.ExtinguishMob() + return water/holywater name = "Holy Water" @@ -933,6 +938,12 @@ datum M.adjustToxLoss(1) ..() return + reaction_mob(var/mob/living/M, var/method=TOUCH, var/volume)//Splashing people with welding fuel to make them easy to ignite! + if(!istype(M, /mob/living)) + return + if(method == TOUCH) + M.adjust_fire_stacks(volume / 10) + return space_cleaner name = "Space cleaner" @@ -1615,6 +1626,12 @@ datum src = null T.assume_gas("volatile_fuel", volume, T20C) return + reaction_mob(var/mob/living/M, var/method=TOUCH, var/volume)//Splashing people with plasma is stronger than fuel! + if(!istype(M, /mob/living)) + return + if(method == TOUCH) + M.adjust_fire_stacks(volume / 5) + return toxin/lexorin name = "Lexorin" @@ -3287,6 +3304,12 @@ datum usr << "It wasn't enough..." return + reaction_mob(var/mob/living/M, var/method=TOUCH, var/volume)//Splashing people with ethanol isn't quite as good as fuel. + if(!istype(M, /mob/living)) + return + if(method == TOUCH) + M.adjust_fire_stacks(volume / 15) + return ethanol/beer name = "Beer" id = "beer" diff --git a/icons/mob/OnFire.dmi b/icons/mob/OnFire.dmi new file mode 100644 index 0000000000000000000000000000000000000000..8bf6e2c7749edd55c903e98d06314dad2297ee16 GIT binary patch literal 1845 zcmV-52g>+~P)V=-0C=2J zR&a84_w-Y6@%7{?OD!tS%+FJ>RWQ*r;NmRLOex6#a*U0*I5Sc+(=$pSoZ^zil2jm5 zDYzstFC{ZCU5Se`C9|j)q>qa;ttc@!6~s0Lil*iyRsxxZI#7tv>zPeEaeK7*tiU6`?OikQf~RXb?yz%>bT~L} z@1o+TvehB-J5hT9@3QYRc8kw%klz@D=jM$rdWY}WM6>6-oCK%%OCw}mZq%0*X!#Sr z?jsq!;*)4GtrM4`LGb)0It9-a%|{0Mvp{3!VCY+t*OuBH|w0pOX#Pm@n8Cj!64)|Mu@Lj$Wr>nGbP zozd$yr`v}2P%qwVgEa98?9)%!yk;Rqu=jdiO><5-RNdu86CWRve@MQx4{5OjLYIoy z3TStHbsXk7hIYYM_FjHIsD~PO@A2zV$iI<;@!ssLz3&iCZlg?c?sF8(%VYdtjZp4s z_U#YV0l9iVz$tZ#;Ke*|fe_?2jMQtY`4V~yAa@OovO8ff=BENVLRAGvh(YYy0Z*`oxb z1G^1c)z!Z6L~Cko(o0n<-@{1{ir0jc-jjMTZBgV>sQBQr7h7>>={@1V(2LyM@{Rc1 z9}h47!1WvjLoY_gm>N)ekqtS?45b$%K2_f3vwAVd|LVjG)%9X#5*E+VEWFXATFm!O zYE1qrP_pST*b9KNm+-`HeG)+hT7Mx%b<9mg{TCr=$lz0(Z=2kxcbQ)gA6_l)1L zfbR^w7t8LEA2aoT1Wuk}S8!e+-;4^o3X?34L47{9{bdDix)Xa2eTuYmu4FW>#YL++ z!B@Ig%d-Z)4!TFo-ZskNhw6iPE#-Tg9w0kca^`r2UGI4$Ux_zkgxbXpQf=`)M7|~H z-anE)z&8Y4X4}^YS#MMr`H{3TpVfPB@c%H*%dg9!PmFg9vfa&`zFmG6hw(%5YG*5# zQawV+&yDb*d(78@iQn>1x*vmVGPsY(@BOdLL$&lCH(T*Res9GWcl})*A4I!CM(p znc1svS6EARd~&c>doI7MjjfPx23Ed~PYz1Y5!ZW9{W&1>6te*lpg}O~P-Y*MI)Sdq!pU zQoiX5N*0KR)@v;qy|FOd{T%{&fTk;PwHfRawgQyCxz3z>iML|zk#^oNc!9v z_B$vDNS+R8&i4g+uQ;C+VJ zh3fgF7@w@3Pm1x$>iMJwzji(;+HYKq)AGv-yYHZWKB?kY&L>qPs+~`&USeN@ON{Vw Date: Fri, 16 Jan 2015 11:30:24 +0300 Subject: [PATCH 2/4] Fixed a few derps, added spinning --- .../mob/living/carbon/human/examine.dm | 2 +- code/modules/mob/living/carbon/human/life.dm | 3 --- .../mob/living/carbon/human/update_icons.dm | 4 ++-- code/modules/mob/living/living.dm | 21 ++++++++++++++++++- 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index e93bdf0c79..1ecd1479a6 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -221,7 +221,7 @@ usr << "[t_He] has a pulse!" if(fire_stacks) msg += "[t_He] [t_is] covered in some liquid.\n" - if(fire_stacks) + if(on_fire) msg += "[t_He] [t_is] on fire!.\n" msg += "" diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 44908eed00..cee6fe6e4e 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1790,11 +1790,8 @@ if(head.max_heat_protection_temperature >= FIRE_HELMET_MAX_HEAT_PROTECTION_TEMPERATURE) thermal_protection += (head.max_heat_protection_temperature*THERMAL_PROTECTION_HEAD) thermal_protection = round(thermal_protection) - if(thermal_protection >= FIRESUIT_MAX_HEAT_PROTECTION_TEMPERATURE) - return if(thermal_protection >= FIRESUIT_MAX_HEAT_PROTECTION_TEMPERATURE) bodytemperature += 11 - return else bodytemperature += BODYTEMP_HEATING_MAX return diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 6d609026e5..19736bad3f 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -126,8 +126,8 @@ Please contact me on #coderbus IRC. ~Carn x #define LEGCUFF_LAYER 19 #define L_HAND_LAYER 20 #define R_HAND_LAYER 21 -#define TARGETED_LAYER 22 //BS12: Layer for the target overlay from weapon targeting system -#define FIRE_LAYER 23 //If you're on fire +#define FIRE_LAYER 22 //If you're on fire +#define TARGETED_LAYER 23 //BS12: Layer for the target overlay from weapon targeting system #define TOTAL_LAYERS 23 ////////////////////////////////// diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 18a93203d1..8aa07aafc4 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -636,6 +636,7 @@ if(CM.on_fire && CM.canmove) CM.fire_stacks -= 5 CM.Weaken(3) + CM.spin(32,2) CM.visible_message("[CM] rolls on the floor, trying to put themselves out!", \ "You stop, drop, and roll!") sleep(30) @@ -854,4 +855,22 @@ return 1 /mob/living/proc/slip(var/slipped_on,stun_duration=8) - return 0 \ No newline at end of file + return 0 + +/mob/living/carbon/proc/spin(spintime, speed) + spawn() + var/D = dir + while(spintime >= speed) + sleep(speed) + switch(D) + if(NORTH) + D = EAST + if(SOUTH) + D = WEST + if(EAST) + D = SOUTH + if(WEST) + D = NORTH + set_dir(D) + spintime -= speed + return \ No newline at end of file From 1f869ebe1a6a067f20a5a757f81bc01b7ab06c70 Mon Sep 17 00:00:00 2001 From: mwerezak Date: Sat, 31 Jan 2015 16:31:07 -0500 Subject: [PATCH 3/4] Mob fire adjustments Temperature increase caused by being on fire is now affected by get_heat_protection(). If a mob is on fire but it's fire_stack <= 0 then it gets extinguished, just in case. --- code/modules/mob/living/carbon/human/life.dm | 19 ++++++----------- code/modules/mob/living/living_defense.dm | 22 ++++++++++++++++---- code/setup.dm | 6 ++++++ 3 files changed, 30 insertions(+), 17 deletions(-) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index cee6fe6e4e..7eff352ea9 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1782,19 +1782,12 @@ /mob/living/carbon/human/handle_fire() if(..()) return - var/thermal_protection = 0 //Simple check to estimate how protected we are against multiple temperatures - if(wear_suit) - if(wear_suit.max_heat_protection_temperature >= FIRESUIT_MAX_HEAT_PROTECTION_TEMPERATURE) - thermal_protection += (wear_suit.max_heat_protection_temperature*0.7) - if(head) - if(head.max_heat_protection_temperature >= FIRE_HELMET_MAX_HEAT_PROTECTION_TEMPERATURE) - thermal_protection += (head.max_heat_protection_temperature*THERMAL_PROTECTION_HEAD) - thermal_protection = round(thermal_protection) - if(thermal_protection >= FIRESUIT_MAX_HEAT_PROTECTION_TEMPERATURE) - bodytemperature += 11 - else - bodytemperature += BODYTEMP_HEATING_MAX - return + + var/burn_temperature = fire_burn_temperature() + var/thermal_protection = get_heat_protection(burn_temperature) + + if (thermal_protection < 1 && bodytemperature < burn_temperature) + bodytemperature += round(BODYTEMP_HEATING_MAX*(1-thermal_protection), 1) #undef HUMAN_MAX_OXYLOSS #undef HUMAN_CRIT_MAX_OXYLOSS diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index e7a542f49f..1be8ea4ac9 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -209,20 +209,34 @@ return /mob/living/proc/adjust_fire_stacks(add_fire_stacks) //Adjusting the amount of fire_stacks we have on person - fire_stacks = Clamp(fire_stacks + add_fire_stacks, min = -20, max = 20) + fire_stacks = Clamp(fire_stacks + add_fire_stacks, min = FIRE_MIN_STACKS, max = FIRE_MAX_STACKS) /mob/living/proc/handle_fire() if(fire_stacks < 0) fire_stacks = max(0, fire_stacks++) //If we've doused ourselves in water to avoid fire, dry off slowly + if(!on_fire) return 1 + else if(fire_stacks <= 0) + ExtinguishMob() //Fire's been put out. + return 1 + var/datum/gas_mixture/G = loc.return_air() // Check if we're standing in an oxygenless environment if(G.gas["oxygen"] < 1) ExtinguishMob() //If there's no oxygen in the tile we're on, put out the fire - return + return 1 + var/turf/location = get_turf(src) - location.hotspot_expose(700, 50, 1) + location.hotspot_expose(fire_burn_temperature(), 50, 1) /mob/living/fire_act() adjust_fire_stacks(0.5) - IgniteMob() \ No newline at end of file + IgniteMob() + +//Finds the effective temperature that the mob is burning at. +/mob/living/proc/fire_burn_temperature() + if (fire_stacks <= 0) + return 0 + + //Scale quadratically so that single digit numbers of fire stacks don't burn ridiculously hot. + return round(FIRESUIT_MAX_HEAT_PROTECTION_TEMPERATURE*(fire_stacks/FIRE_MAX_FIRESUIT_STACKS)**2) diff --git a/code/setup.dm b/code/setup.dm index 4332480676..f34cb373ca 100644 --- a/code/setup.dm +++ b/code/setup.dm @@ -68,6 +68,12 @@ #define SHOE_MIN_COLD_PROTECTION_TEMPERATURE 2.0 //For gloves #define SHOE_MAX_HEAT_PROTECTION_TEMPERATURE 1500 //For gloves +//Fire +#define FIRE_MIN_STACKS -20 +#define FIRE_MAX_STACKS 25 +//If the number of stacks goes above this firesuits won't protect you anymore. If not you can walk around while on fire like a badass. +#define FIRE_MAX_FIRESUIT_STACKS 20 + #define THROWFORCE_SPEED_DIVISOR 5 //The throwing speed value at which the throwforce multiplier is exactly 1. #define THROWNOBJ_KNOCKBACK_SPEED 15 //The minumum speed of a thrown object that will cause living mobs it hits to be knocked back. #define THROWNOBJ_KNOCKBACK_DIVISOR 2 //Affects how much speed the mob is knocked back with From 71b19d5d8f2e7bca5d410a09dd8bf54858169628 Mon Sep 17 00:00:00 2001 From: Chinsky Date: Tue, 3 Feb 2015 18:44:26 +0300 Subject: [PATCH 4/4] Stupid typo & missing constants --- code/modules/clothing/head/misc_special.dm | 2 +- code/modules/mob/living/living_defines.dm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm index 22f9295b82..5eb7e0c65b 100644 --- a/code/modules/clothing/head/misc_special.dm +++ b/code/modules/clothing/head/misc_special.dm @@ -159,4 +159,4 @@ desc = "You can hear the distant sounds of rhythmic electronica." icon_state = "richard" body_parts_covered = HEAD|FACE - flags = FPRINT|TABLEPASS|HEADCOVERSEYES|HEADCOVERSMOUTH|BLOCKHAIR \ No newline at end of file + flags = HEADCOVERSEYES|HEADCOVERSMOUTH|BLOCKHAIR \ No newline at end of file diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index d265e8fc15..a9cbcbe0dd 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -40,4 +40,4 @@ var/silent = null // Can't talk. Value goes down every life proc. var/mob_size // Used by lockers. var/on_fire = 0 //The "Are we on fire?" var - var/fire_st + var/fire_stacks