diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm index 073c1b8fe40..604ee33150c 100644 --- a/code/game/machinery/cryo.dm +++ b/code/game/machinery/cryo.dm @@ -5,7 +5,7 @@ density = 1 anchored = 1.0 layer = 2.8 - + var/on = 0 var/temperature_archived var/mob/living/carbon/occupant = null @@ -68,7 +68,7 @@ * ui_interact is currently defined for /atom/movable * * @param user /mob The mob who is interacting with this ui - * @param ui_key string A string key to use for this ui. Allows for multiple unique uis on one obj/mob (defaut value "main") + * @param ui_key string A string key to use for this ui. Allows for multiple unique uis on one obj/mob (defaut value "main") * @param ui /datum/nanoui This parameter is passed by the nanoui process() proc when updating an open ui * * @return nothing @@ -79,7 +79,7 @@ return // this is the data which will be sent to the ui - var/data[0] + var/data[0] data["isOperating"] = on data["hasOccupant"] = occupant ? 1 : 0 @@ -115,7 +115,7 @@ else if(air_contents.temperature > 225) data["cellTemperatureStatus"] = "average" - data["isBeakerLoaded"] = beaker ? 1 : 0 + data["isBeakerLoaded"] = beaker ? 1 : 0 /* // Removing beaker contents list from front-end, replacing with a total remaining volume var beakerContents[0] if(beaker && beaker.reagents && beaker.reagents.reagent_list.len) @@ -130,12 +130,12 @@ if (beaker.reagents && beaker.reagents.reagent_list.len) for(var/datum/reagent/R in beaker.reagents.reagent_list) data["beakerVolume"] += R.volume - + if (!ui) // no ui has been passed, so we'll search for one { ui = nanomanager.get_open_ui(user, src, ui_key) - } - if (!ui) + } + if (!ui) // the ui does not exist, so we'll create a new one ui = new(user, src, ui_key, "cryo.tmpl", "Cryo Cell Control System", 520, 410) // When the UI is first opened this is the data it will use @@ -159,7 +159,7 @@ if(href_list["switchOn"]) on = 1 update_icon() - + if(href_list["switchOff"]) on = 0 update_icon() @@ -168,12 +168,12 @@ if(beaker) beaker.loc = get_step(loc, SOUTH) beaker = null - + if(href_list["ejectOccupant"]) if(!occupant || isslime(usr) || ispAI(usr)) return 0 // don't update UIs attached to this object go_out() - + add_fingerprint(usr) return 1 // update UIs attached to this object @@ -298,6 +298,7 @@ // M.metabslow = 1 add_fingerprint(usr) update_icon() + M.ExtinguishMob() return 1 /obj/machinery/atmospherics/unary/cryo_cell/verb/move_eject() diff --git a/code/game/objects/items/weapons/cigs_lighters.dm b/code/game/objects/items/weapons/cigs_lighters.dm index dff332f2a6f..162e4f71e97 100644 --- a/code/game/objects/items/weapons/cigs_lighters.dm +++ b/code/game/objects/items/weapons/cigs_lighters.dm @@ -154,12 +154,15 @@ CIGARETTE PACKETS ARE IN FANCY.DM /obj/item/clothing/mask/cigarette/process() var/turf/location = get_turf(src) + var/mob/living/M = loc + if(isliving(loc)) + M.IgniteMob() smoketime-- if(smoketime < 1) new type_butt(location) processing_objects.Remove(src) if(ismob(loc)) - var/mob/living/M = loc +// var/mob/living/M = loc M << "Your [name] goes out." M.u_equip(src) //un-equip it so the overlays can update M.update_inv_wear_mask(0) @@ -378,6 +381,9 @@ CIGARETTE PACKETS ARE IN FANCY.DM /obj/item/weapon/lighter/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob) + if(!isliving(M)) + return + M.IgniteMob() if(!istype(M, /mob)) return diff --git a/code/game/objects/items/weapons/extinguisher.dm b/code/game/objects/items/weapons/extinguisher.dm index 57fda1bbcab..cf12afad832 100644 --- a/code/game/objects/items/weapons/extinguisher.dm +++ b/code/game/objects/items/weapons/extinguisher.dm @@ -10,7 +10,7 @@ w_class = 3.0 throw_speed = 2 throw_range = 10 - force = 10.0 + force = 10 m_amt = 90 attack_verb = list("slammed", "whacked", "bashed", "thunked", "battered", "bludgeoned", "thrashed") var/max_water = 50 @@ -122,6 +122,9 @@ for(var/atom/atm in get_turf(W)) if(!W) return 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) diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/weapons/tools.dm index e34a53a17eb..d5d9706fccf 100644 --- a/code/game/objects/items/weapons/tools.dm +++ b/code/game/objects/items/weapons/tools.dm @@ -244,7 +244,7 @@ location.hotspot_expose(700, 5) -/obj/item/weapon/weldingtool/afterattack(obj/O as obj, mob/user as mob) +/obj/item/weapon/weldingtool/afterattack(atom/O as obj|mob, mob/user as mob) if (istype(O, /obj/structure/reagent_dispensers/fueltank) && get_dist(src,O) <= 1 && !src.welding) O.reagents.trans_to(src, max_fuel) user << "\blue Welder refueled" @@ -262,6 +262,10 @@ var/turf/location = get_turf(user) if (istype(location, /turf)) location.hotspot_expose(700, 50, 1) + + if(isliving(O)) + var/mob/living/L = O + L.IgniteMob() return diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index 1f08c112306..af2ccf63935 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -205,71 +205,77 @@ /obj/machinery/shower/proc/wash(atom/movable/O as obj|mob) if(!on) return - if(iscarbon(O)) - var/mob/living/carbon/M = O - if(M.r_hand) - M.r_hand.clean_blood() - if(M.l_hand) - M.l_hand.clean_blood() - if(M.back) - if(M.back.clean_blood()) - M.update_inv_back(0) - if(ishuman(M)) - var/mob/living/carbon/human/H = M - var/washgloves = 1 - var/washshoes = 1 - var/washmask = 1 - var/washears = 1 - var/washglasses = 1 + if(isliving(O)) + var/mob/living/L = O + L.ExtinguishMob() + L.fire_stacks = -20 //Douse ourselves with water to avoid fire more easily + L << "You've been drenched in water!" + if(iscarbon(O)) + var/mob/living/carbon/M = O + if(M.r_hand) + M.r_hand.clean_blood() + if(M.l_hand) + M.l_hand.clean_blood() + if(M.back) + if(M.back.clean_blood()) + M.update_inv_back(0) + if(ishuman(M)) + var/mob/living/carbon/human/H = M + var/washgloves = 1 + var/washshoes = 1 + var/washmask = 1 + var/washears = 1 + var/washglasses = 1 - if(H.wear_suit) - washgloves = !(H.wear_suit.flags_inv & HIDEGLOVES) - washshoes = !(H.wear_suit.flags_inv & HIDESHOES) + if(H.wear_suit) + washgloves = !(H.wear_suit.flags_inv & HIDEGLOVES) + washshoes = !(H.wear_suit.flags_inv & HIDESHOES) - if(H.head) - washmask = !(H.head.flags_inv & HIDEMASK) - washglasses = !(H.head.flags_inv & HIDEEYES) - washears = !(H.head.flags_inv & HIDEEARS) + if(H.head) + washmask = !(H.head.flags_inv & HIDEMASK) + washglasses = !(H.head.flags_inv & HIDEEYES) + washears = !(H.head.flags_inv & HIDEEARS) - if(H.wear_mask) - if (washears) - washears = !(H.wear_mask.flags_inv & HIDEEARS) - if (washglasses) - washglasses = !(H.wear_mask.flags_inv & HIDEEYES) + if(H.wear_mask) + if (washears) + washears = !(H.wear_mask.flags_inv & HIDEEARS) + if (washglasses) + washglasses = !(H.wear_mask.flags_inv & HIDEEYES) + + if(H.head) + if(H.head.clean_blood()) + H.update_inv_head(0) + if(H.wear_suit) + if(H.wear_suit.clean_blood()) + H.update_inv_wear_suit(0) + else if(H.w_uniform) + if(H.w_uniform.clean_blood()) + H.update_inv_w_uniform(0) + if(H.gloves && washgloves) + if(H.gloves.clean_blood()) + H.update_inv_gloves(0) + if(H.shoes && washshoes) + if(H.shoes.clean_blood()) + H.update_inv_shoes(0) + if(H.wear_mask && washmask) + if(H.wear_mask.clean_blood()) + H.update_inv_wear_mask(0) + if(H.glasses && washglasses) + if(H.glasses.clean_blood()) + H.update_inv_glasses(0) + if(H.ears && washears) + if(H.ears.clean_blood()) + H.update_inv_ears(0) + if(H.belt) + if(H.belt.clean_blood()) + H.update_inv_belt(0) + else + if(M.wear_mask) //if the mob is not human, it cleans the mask without asking for bitflags + if(M.wear_mask.clean_blood()) + M.update_inv_wear_mask(0) - if(H.head) - if(H.head.clean_blood()) - H.update_inv_head(0) - if(H.wear_suit) - if(H.wear_suit.clean_blood()) - H.update_inv_wear_suit(0) - else if(H.w_uniform) - if(H.w_uniform.clean_blood()) - H.update_inv_w_uniform(0) - if(H.gloves && washgloves) - if(H.gloves.clean_blood()) - H.update_inv_gloves(0) - if(H.shoes && washshoes) - if(H.shoes.clean_blood()) - H.update_inv_shoes(0) - if(H.wear_mask && washmask) - if(H.wear_mask.clean_blood()) - H.update_inv_wear_mask(0) - if(H.glasses && washglasses) - if(H.glasses.clean_blood()) - H.update_inv_glasses(0) - if(H.ears && washears) - if(H.ears.clean_blood()) - H.update_inv_ears(0) - if(H.belt) - if(H.belt.clean_blood()) - H.update_inv_belt(0) else - if(M.wear_mask) //if the mob is not human, it cleans the mask without asking for bitflags - if(M.wear_mask.clean_blood()) - M.update_inv_wear_mask(0) - else - O.clean_blood() + O.clean_blood() if(isturf(loc)) var/turf/tile = loc diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm index 8f888806b88..c2eb527ccca 100644 --- a/code/modules/mob/living/carbon/alien/alien.dm +++ b/code/modules/mob/living/carbon/alien/alien.dm @@ -86,14 +86,15 @@ // Aliens are now weak to fire. //After then, it reacts to the surrounding atmosphere based on your thermal protection - if(loc_temp > bodytemperature) - //Place is hotter than we are - var/thermal_protection = heat_protection //This returns a 0 - 1 value, which corresponds to the percentage of protection based on what you're wearing and what you're exposed to. - if(thermal_protection < 1) - bodytemperature += (1-thermal_protection) * ((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR) - else - bodytemperature += 1 * ((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR) - // bodytemperature -= max((loc_temp - bodytemperature / BODYTEMP_AUTORECOVERY_DIVISOR), BODYTEMP_AUTORECOVERY_MINIMUM) + if(!on_fire) // If you're on fire, ignore local air temperature + if(loc_temp > bodytemperature) + //Place is hotter than we are + var/thermal_protection = heat_protection //This returns a 0 - 1 value, which corresponds to the percentage of protection based on what you're wearing and what you're exposed to. + if(thermal_protection < 1) + bodytemperature += (1-thermal_protection) * ((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR) + else + bodytemperature += 1 * ((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR) + // bodytemperature -= max((loc_temp - bodytemperature / BODYTEMP_AUTORECOVERY_DIVISOR), BODYTEMP_AUTORECOVERY_MINIMUM) // +/- 50 degrees from 310.15K is the 'safe' zone, where no damage is dealt. if(bodytemperature > 360.15) @@ -141,6 +142,12 @@ radiation -= 3 adjustToxLoss(3) +/mob/living/carbon/alien/handle_fire()//Aliens on fire code + if(..()) + return + bodytemperature += BODYTEMP_HEATING_MAX //If you're on fire, you heat up! + return + /mob/living/carbon/alien/IsAdvancedToolUser() return has_fine_manipulation diff --git a/code/modules/mob/living/carbon/alien/humanoid/life.dm b/code/modules/mob/living/carbon/alien/humanoid/life.dm index 7d2cc2ba2a2..3b292fe41a9 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/life.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/life.dm @@ -53,6 +53,8 @@ //stuff in the stomach handle_stomach() + //Handle being on fire + handle_fire() //Status updates, death etc. handle_regular_status_updates() diff --git a/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm b/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm index 57d0300b39d..6a47bbe43f7 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm @@ -4,7 +4,8 @@ #define X_L_HAND_LAYER 3 #define X_R_HAND_LAYER 4 #define TARGETED_LAYER 5 -#define X_TOTAL_LAYERS 5 +#define X_FIRE_LAYER 6 +#define X_TOTAL_LAYERS 6 ///////////////////////////////// /mob/living/carbon/alien/humanoid @@ -49,6 +50,7 @@ update_inv_pockets(0) update_hud() update_icons() + update_fire() /mob/living/carbon/alien/humanoid/update_hud() @@ -58,7 +60,20 @@ // else client.screen -= hud_used.other //Not used client.screen |= contents - +/mob/living/carbon/alien/humanoid/update_fire() + overlays -= overlays_lying[X_FIRE_LAYER] + overlays -= overlays_standing[X_FIRE_LAYER] + if(on_fire) + overlays_lying[X_FIRE_LAYER] = image("icon"='icons/mob/OnFire.dmi', "icon_state"="Lying", "layer"= -X_FIRE_LAYER) + overlays_standing[X_FIRE_LAYER] = image("icon"='icons/mob/OnFire.dmi', "icon_state"="Standing", "layer"= -X_FIRE_LAYER) + if(src.lying) + overlays += overlays_lying[X_FIRE_LAYER] + else + overlays += overlays_standing[X_FIRE_LAYER] + return + else + overlays_lying[X_FIRE_LAYER] = null + overlays_standing[X_FIRE_LAYER] = null /mob/living/carbon/alien/humanoid/update_inv_wear_suit(var/update_icons=1) if(wear_suit) @@ -151,4 +166,5 @@ #undef X_L_HAND_LAYER #undef X_R_HAND_LAYER #undef TARGETED_LAYER +#undef X_FIRE_LAYER #undef X_TOTAL_LAYERS diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm index e074d9caae8..a80d37fcc44 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -221,13 +221,18 @@ msg += "" + if(fire_stacks > 0) + msg += "[t_He] [t_is] covered in something flammable.\n" + if(fire_stacks < 0) + msg += "[t_He] looks a little soaked.\n" + if(nutrition < 100) msg += "[t_He] [t_is] severely malnourished.\n" else if(nutrition >= 500) - /*if(usr.nutrition < 100) + if(usr.nutrition < 100) msg += "[t_He] [t_is] plump and delicious looking - Like a fat little piggy. A tasty piggy.\n" - else*/ - msg += "[t_He] [t_is] quite chubby.\n" + else + msg += "[t_He] [t_is] quite chubby.\n" msg += "" diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 3a6012853e4..b628abe0098 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -90,6 +90,9 @@ handle_virus_updates() + //Check if we're on fire + handle_fire() + //stuff in the stomach handle_stomach() @@ -557,18 +560,19 @@ // log_debug("Adjusting to atmosphere.") //After then, it reacts to the surrounding atmosphere based on your thermal protection - if(loc_temp < BODYTEMP_COLD_DAMAGE_LIMIT) //Place is colder than we are - var/thermal_protection = get_cold_protection(loc_temp) //This returns a 0 - 1 value, which corresponds to the percentage of protection based on what you're wearing and what you're exposed to. - if(thermal_protection < 1) - var/amt = min((1-thermal_protection) * ((loc_temp - bodytemperature) / BODYTEMP_COLD_DIVISOR), BODYTEMP_COOLING_MAX) - // log_debug("[loc_temp] is Cold. Cooling by [amt]") - bodytemperature += amt - else if (loc_temp > BODYTEMP_HEAT_DAMAGE_LIMIT) //Place is hotter than we are - var/thermal_protection = get_heat_protection(loc_temp) //This returns a 0 - 1 value, which corresponds to the percentage of protection based on what you're wearing and what you're exposed to. - if(thermal_protection < 1) - var/amt = min((1-thermal_protection) * ((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR), BODYTEMP_HEATING_MAX) - // log_debug("[loc_temp] is Heat. Heating up by [amt]") - bodytemperature += amt + if(!on_fire) //If you're on fire, you do not heat up or cool down based on surrounding gases + if(loc_temp < BODYTEMP_COLD_DAMAGE_LIMIT) //Place is colder than we are + var/thermal_protection = get_cold_protection(loc_temp) //This returns a 0 - 1 value, which corresponds to the percentage of protection based on what you're wearing and what you're exposed to. + if(thermal_protection < 1) + var/amt = min((1-thermal_protection) * ((loc_temp - bodytemperature) / BODYTEMP_COLD_DIVISOR), BODYTEMP_COOLING_MAX) + // log_debug("[loc_temp] is Cold. Cooling by [amt]") + bodytemperature += amt + else if (loc_temp > BODYTEMP_HEAT_DAMAGE_LIMIT) //Place is hotter than we are + var/thermal_protection = get_heat_protection(loc_temp) //This returns a 0 - 1 value, which corresponds to the percentage of protection based on what you're wearing and what you're exposed to. + if(thermal_protection < 1) + var/amt = min((1-thermal_protection) * ((loc_temp - bodytemperature) / BODYTEMP_HEAT_DIVISOR), BODYTEMP_HEATING_MAX) + // log_debug("[loc_temp] is Heat. Heating up by [amt]") + bodytemperature += amt // +/- 50 degrees from 310.15K is the 'safe' zone, where no damage is dealt. if(bodytemperature > BODYTEMP_HEAT_DAMAGE_LIMIT) @@ -628,6 +632,16 @@ pl_effects() return + ///FIRE CODE + handle_fire() + if(..()) + return + var/thermal_protection = get_heat_protection(30000) //If you don't have fire suit level protection, you get a temperature increase + if((1 - thermal_protection) > 0.0001) + bodytemperature += BODYTEMP_HEATING_MAX + return + //END FIRE CODE + /* proc/adjust_body_temperature(current, loc_temp, boost) var/temperature = current diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index cafc29923da..a426e654d08 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -119,7 +119,8 @@ Please contact me on #coderbus IRC. ~Carn x #define R_HAND_LAYER 20 #define TAIL_LAYER 21 //bs12 specific. this hack is probably gonna come back to haunt me #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 @@ -129,6 +130,20 @@ Please contact me on #coderbus IRC. ~Carn x var/icon/race_icon var/icon/deform_icon + +/mob/living/carbon/human/proc/apply_overlay(cache_index) + var/image/I = lying ? overlays_lying[cache_index] : overlays_standing[cache_index] + if(I) + overlays += I + +/mob/living/carbon/human/proc/remove_overlay(cache_index) + if(overlays_lying[cache_index]) + overlays -= overlays_lying[cache_index] + overlays_lying[cache_index] = null + if(overlays_standing[cache_index]) + overlays -= overlays_standing[cache_index] + overlays_standing[cache_index] = null + //UPDATES OVERLAYS FROM OVERLAYS_LYING/OVERLAYS_STANDING //this proc is messy as I was forced to include some old laggy cloaking code to it so that I don't break cloakers //I'll work on removing that stuff by rewriting some of the cloaking stuff at a later date. @@ -457,6 +472,15 @@ proc/get_damage_icon_part(damage_state, body_part) overlays_standing[TARGETED_LAYER] = null if(update_icons) update_icons() +/mob/living/carbon/human/update_fire() + + remove_overlay(FIRE_LAYER) + if(on_fire) + overlays_lying[FIRE_LAYER] = image("icon"='icons/mob/OnFire.dmi', "icon_state"="Lying", "layer"=-FIRE_LAYER) + overlays_standing[FIRE_LAYER] = image("icon"='icons/mob/OnFire.dmi', "icon_state"="Standing", "layer"=-FIRE_LAYER) + + apply_overlay(FIRE_LAYER) + /* --------------------------------------- */ //For legacy support. @@ -486,7 +510,7 @@ proc/get_damage_icon_part(damage_state, body_part) update_icons() //Hud Stuff update_hud() - + update_fire() /* --------------------------------------- */ //vvvvvv UPDATE_INV PROCS vvvvvv @@ -896,4 +920,5 @@ proc/get_damage_icon_part(damage_state, body_part) #undef R_HAND_LAYER #undef TAIL_LAYER #undef TARGETED_LAYER +#undef FIRE_LAYER #undef TOTAL_LAYERS diff --git a/code/modules/mob/living/carbon/monkey/examine.dm b/code/modules/mob/living/carbon/monkey/examine.dm index 869482b13f4..5cbb5c6c7ce 100644 --- a/code/modules/mob/living/carbon/monkey/examine.dm +++ b/code/modules/mob/living/carbon/monkey/examine.dm @@ -32,6 +32,10 @@ msg += "It has minor burns.\n" else msg += "It has severe burns!\n" + if (src.fire_stacks > 0) + msg += "It's covered in something flammable.\n" + if (src.fire_stacks < 0) + msg += "It's soaked in water.\n" if (src.stat == UNCONSCIOUS) msg += "It isn't responding to anything around it; it seems to be asleep.\n" msg += "" diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm index f2b589e38bd..366f5bfaad4 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -55,6 +55,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() @@ -380,10 +383,11 @@ var/turf/heat_turf = get_turf(src) environment_heat_capacity = heat_turf.heat_capacity - if((environment.temperature > (T0C + 50)) || (environment.temperature < (T0C + 10))) - var/transfer_coefficient = 1 + if(!on_fire) + if((environment.temperature > (T0C + 50)) || (environment.temperature < (T0C + 10))) + var/transfer_coefficient = 1 - handle_temperature_damage(HEAD, environment.temperature, environment_heat_capacity*transfer_coefficient) + handle_temperature_damage(HEAD, environment.temperature, environment_heat_capacity*transfer_coefficient) if(stat==2) bodytemperature += 0.1*(environment.temperature - bodytemperature)*environment_heat_capacity/(environment_heat_capacity + 270000) @@ -657,3 +661,11 @@ proc/handle_changeling() if(mind && mind.changeling) mind.changeling.regenerate() + + ///FIRE CODE + handle_fire() + if(..()) + return + adjustFireLoss(6) + return + //END FIRE CODE \ 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 660f7f4b839..37ccb2185a3 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 7 +#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() update_icons() //Hud Stuff update_hud() @@ -115,6 +117,21 @@ overlays_standing[TARGETED_LAYER] = null if(update_icons) update_icons() +/mob/living/carbon/monkey/update_fire() + overlays -= overlays_lying[M_FIRE_LAYER] + overlays -= overlays_standing[M_FIRE_LAYER] + if(on_fire) + overlays_lying[M_FIRE_LAYER] = image("icon"='icons/mob/OnFire.dmi', "icon_state"="Lying", "layer"= -M_FIRE_LAYER) + overlays_standing[M_FIRE_LAYER] = image("icon"='icons/mob/OnFire.dmi', "icon_state"="Standing", "layer"= -M_FIRE_LAYER) + if(src.lying) + overlays += overlays_lying[M_FIRE_LAYER] + else + overlays += overlays_standing[M_FIRE_LAYER] + return + else + overlays_lying[M_FIRE_LAYER] = null + overlays_standing[M_FIRE_LAYER] = null + //Monkey Overlays Indexes//////// #undef M_MASK_LAYER #undef M_BACK_LAYER @@ -122,5 +139,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 94a50e804d1..0dfdbbfa5ef 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -287,6 +287,8 @@ ear_deaf = 0 ear_damage = 0 heal_overall_damage(1000, 1000) + fire_stacks = 0 + on_fire = 0 buckled = initial(src.buckled) if(iscarbon(src)) var/mob/living/carbon/C = src @@ -297,6 +299,7 @@ dead_mob_list -= src living_mob_list += src stat = CONSCIOUS + update_fire() regenerate_icons() ..() return diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 6a1c11587ec..f8ff70bb3d3 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -127,4 +127,42 @@ return 0 -// End BS12 momentum-transfer code. \ No newline at end of file +// End BS12 momentum-transfer code. + +//Mobs on Fire +/mob/living/proc/IgniteMob() + if(fire_stacks > 0) + on_fire = 1 + update_fire() + +/mob/living/proc/ExtinguishMob() + if(on_fire) + on_fire = 0 + fire_stacks = 0 + 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++ //If we've doused ourselves in water to avoid fire, dry off slowly + fire_stacks = min(0, fire_stacks)//So we dry ourselves back to default, nonflammable. + if(!on_fire) + return 1 + var/datum/gas_mixture/G = loc.return_air() // Check if we're standing in an oxygenless environment + 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) + location.hotspot_expose(700, 50, 1) + +/mob/living/fire_act() + adjust_fire_stacks(5) + if(fire_stacks > 9 && !on_fire) + IgniteMob() + +//Mobs on Fire end \ 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 fa86a33b687..16449e8719e 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -35,6 +35,8 @@ var/tod = null // Time of death var/update_slimes = 1 + 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 var/silent = null //Can't talk. Value goes down every life proc. var/specialsauce = 0 //Has this person consumed enough special sauce? IF so they're a ticking time bomb of death. var/implanting = 0 //Used for the mind-slave implant \ No newline at end of file diff --git a/code/modules/mob/living/silicon/robot/death.dm b/code/modules/mob/living/silicon/robot/death.dm index 1d6b787c51c..fef353eec6d 100644 --- a/code/modules/mob/living/silicon/robot/death.dm +++ b/code/modules/mob/living/silicon/robot/death.dm @@ -61,7 +61,7 @@ see_in_dark = 8 see_invisible = SEE_INVISIBLE_LEVEL_TWO updateicon() - + update_fire() tod = worldtime2text() //weasellos time of death patch if(mind) mind.store_memory("Time of death: [tod]", 0) diff --git a/code/modules/mob/living/silicon/robot/examine.dm b/code/modules/mob/living/silicon/robot/examine.dm index 2a9886dee1e..f6bef71393b 100644 --- a/code/modules/mob/living/silicon/robot/examine.dm +++ b/code/modules/mob/living/silicon/robot/examine.dm @@ -18,6 +18,10 @@ msg += "It looks slightly charred.\n" else msg += "It looks severely burnt and heat-warped!\n" + if (src.fire_stacks < 0) + msg += "It's covered in water.\n" + if (src.fire_stacks > 0) + msg += "It's coated in something flammable.\n" msg += "" if(opened) diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm index c5d18dccd2b..e71f073130a 100644 --- a/code/modules/mob/living/silicon/robot/life.dm +++ b/code/modules/mob/living/silicon/robot/life.dm @@ -19,6 +19,7 @@ process_killswitch() process_locks() update_canmove() + handle_fire() /mob/living/silicon/robot/proc/clamp_values() @@ -305,4 +306,24 @@ /mob/living/silicon/robot/update_canmove() if(paralysis || stunned || weakened || buckled || lockcharge) canmove = 0 else canmove = 1 - return canmove \ No newline at end of file + return canmove + +//Robots on fire +/mob/living/silicon/robot/handle_fire() + if(..()) + return + adjustFireLoss(3) + return + +/mob/living/silicon/robot/update_fire() + overlays -= image("icon"='icons/mob/OnFire.dmi', "icon_state"="Standing") + if(on_fire) + overlays += image("icon"='icons/mob/OnFire.dmi', "icon_state"="Standing") + update_icons() + return + +/mob/living/silicon/robot/fire_act() + if(!on_fire) //Silicons don't gain stacks from hotspots, but hotspots can ignite them + IgniteMob() + +//Robots on fire \ No newline at end of file diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index f1fe4b401c5..217b08520f7 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -1021,6 +1021,9 @@ icon_state = base_icon return +/mob/living/silicon/robot/proc/updatefire() + return + //Call when target overlay should be added/removed /mob/living/silicon/robot/update_targeted() if(!targeted_by && target_locked) diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 915c11063fb..200f40637b2 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -462,3 +462,6 @@ if (M.occupant) return 0 return 1 + +/mob/living/simple_animal/update_fire() + return \ No newline at end of file diff --git a/code/modules/mob/screen.dm b/code/modules/mob/screen.dm index 7e65b4048e2..919067dc99e 100644 --- a/code/modules/mob/screen.dm +++ b/code/modules/mob/screen.dm @@ -663,6 +663,7 @@ if(resisting) for(var/mob/O in viewers(usr, null)) O.show_message(text("\red [] resists!", L), 1) + return //unbuckling yourself @@ -753,9 +754,19 @@ BD.attack_hand(usr) C.open() - //breaking out of handcuffs + //Stop drop and roll & Handcuffs else if(iscarbon(L)) var/mob/living/carbon/CM = L + if(CM.on_fire && CM.canmove) + CM.fire_stacks -= 5 + CM.weakened = 5 + CM.visible_message("[CM] rolls on the floor, trying to put themselves out!", \ + "You stop, drop, and roll!") + 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/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm index 85899907d40..4e52a5be7a1 100644 --- a/code/modules/reagents/Chemistry-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents.dm @@ -259,6 +259,14 @@ datum if(!cube.wrapped) cube.Expand() return + reaction_mob(var/mob/living/M, var/method=TOUCH, var/volume)//Splashing people with water can help put them out! + if(!istype(M, /mob/living)) + return + if(method == TOUCH) + M.adjust_fire_stacks(-(volume / 10)) + if(M.fire_stacks <= 0) + M.ExtinguishMob() + return lube name = "Space Lube" @@ -1169,7 +1177,12 @@ datum reagent_state = LIQUID color = "#660000" // rgb: 102, 0, 0 - + 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 reaction_obj(var/obj/O, var/volume) var/turf/the_turf = get_turf(O) if(!the_turf) @@ -1317,6 +1330,12 @@ datum napalm.trace_gases += fuel T.assume_air(napalm) 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 leporazine name = "Leporazine" @@ -1861,6 +1880,12 @@ datum else 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 */ ammonia name = "Ammonia" diff --git a/icons/mob/OnFire.dmi b/icons/mob/OnFire.dmi new file mode 100644 index 00000000000..52c6ad88a1c Binary files /dev/null and b/icons/mob/OnFire.dmi differ diff --git a/icons/mob/uniform_fat.dmi b/icons/mob/uniform_fat.dmi index c887239f1ff..42f6a95dfb8 100644 Binary files a/icons/mob/uniform_fat.dmi and b/icons/mob/uniform_fat.dmi differ