diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm index cfffe2f1..d6c23031 100644 --- a/code/game/machinery/cryo.dm +++ b/code/game/machinery/cryo.dm @@ -121,13 +121,13 @@ data["beakerVolume"] += R.volume // update the ui if it exists, returns null if no ui is passed/found - ui = nanomanager.try_update_ui(user, src, ui_key, ui, data) + ui = nanomanager.try_update_ui(user, src, ui_key, ui, data) if (!ui) // the ui does not exist, so we'll create a new() one // for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm 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 - ui.set_initial_data(data) + ui.set_initial_data(data) // open the new ui window ui.open() // auto update every Master Controller tick @@ -280,6 +280,7 @@ M << "\blue You feel a cold liquid surround you. Your skin starts to freeze up." occupant = M // M.metabslow = 1 + M.ExtinguishMob() add_fingerprint(usr) update_icon() return 1 diff --git a/code/game/objects/items/weapons/cigs_lighters.dm b/code/game/objects/items/weapons/cigs_lighters.dm index 8a9093fe..723f7726 100644 --- a/code/game/objects/items/weapons/cigs_lighters.dm +++ b/code/game/objects/items/weapons/cigs_lighters.dm @@ -159,6 +159,9 @@ 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) die() @@ -439,6 +442,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 dc595239..9c0856ae 100644 --- a/code/game/objects/items/weapons/extinguisher.dm +++ b/code/game/objects/items/weapons/extinguisher.dm @@ -5,12 +5,12 @@ icon_state = "fire_extinguisher0" item_state = "fire_extinguisher" hitsound = 'sound/weapons/smash.ogg' - flags = FPRINT | TABLEPASS | CONDUCT + flags = FPRINT | USEDELAY | TABLEPASS | CONDUCT throwforce = 10 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 @@ -24,7 +24,7 @@ icon_state = "miniFE0" item_state = "miniFE" hitsound = null //it is much lighter, after all. - flags = FPRINT | TABLEPASS + flags = FPRINT | USEDELAY | TABLEPASS throwforce = 2 w_class = 2.0 force = 3.0 @@ -117,13 +117,16 @@ for(var/b=0, b<5, b++) step_towards(W,my_target) if(!W) return + if(!W.reagents) return W.reagents.reaction(get_turf(W)) 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) - W.delete() if((istype(usr.loc, /turf/space)) || (usr.lastarea.has_gravity == 0)) user.inertia_dir = get_dir(target, user) diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/weapons/tools.dm index 0b81564e..eb922967 100644 --- a/code/game/objects/items/weapons/tools.dm +++ b/code/game/objects/items/weapons/tools.dm @@ -245,7 +245,7 @@ location.hotspot_expose(700, 5) -/obj/item/weapon/weldingtool/afterattack(obj/O as obj, mob/user as mob, proximity) +/obj/item/weapon/weldingtool/afterattack(obj/O as obj|mob, mob/user as mob, proximity) if(!proximity) return if (istype(O, /obj/structure/reagent_dispensers/fueltank) && get_dist(src,O) <= 1 && !src.welding) O.reagents.trans_to(src, max_fuel) @@ -282,6 +282,11 @@ 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 60b7d200..ed5bf1d2 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -153,7 +153,7 @@ if(I.type == /obj/item/device/analyzer) user << "The water temperature seems to be [watertemp]." if(istype(I, /obj/item/weapon/wrench)) - user << "You begin to adjust the temperature valve with \the [I]." + user << "You begin to adjust the temperature valve with the [I]." if(do_after(user, 50)) switch(watertemp) if("normal") @@ -162,8 +162,7 @@ watertemp = "boiling" if("boiling") watertemp = "normal" - user.visible_message("[user] adjusts the shower with \the [I].", "You adjust the shower with \the [I].") - add_fingerprint(user) + user.visible_message("[user] adjusts the shower with the [I].", "You adjust the shower with the [I].") /obj/machinery/shower/update_icon() //this is terribly unreadable, but basically it makes the shower mist up overlays.Cut() //once it's been on for a while, in addition to handling the water overlay. @@ -206,76 +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.l_ear && washears) - if(H.l_ear.clean_blood()) - H.update_inv_ears(0) - if(H.r_ear && washears) - if(H.r_ear.clean_blood()) - H.update_inv_ears(0) - if(H.belt) - if(H.belt.clean_blood()) - H.update_inv_belt(0) - H.clean_blood(washshoes) 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) - M.clean_blood() - else - O.clean_blood() + O.clean_blood() if(isturf(loc)) var/turf/tile = loc @@ -323,39 +323,29 @@ anchored = 1 var/busy = 0 //Something's being washed at the moment -/obj/structure/sink/attack_hand(mob/user as mob) - if (hasorgans(user)) - var/datum/organ/external/temp = user:organs_by_name["r_hand"] - if (user.hand) - temp = user:organs_by_name["l_hand"] - if(temp && !temp.is_usable()) - user << "You try to move your [temp.display_name], but cannot!" - return - - if(isrobot(user) || isAI(user)) - return - - if(!Adjacent(user)) +/obj/structure/sink/attack_hand(mob/M as mob) + if(isrobot(M) || isAI(M)) return if(busy) - user << "\red Someone's already washing here." + M << "\red Someone's already washing here." return + var/turf/location = M.loc + if(!isturf(location)) return usr << "\blue You start washing your hands." busy = 1 sleep(40) busy = 0 - if(!Adjacent(user)) return //Person has moved away from the sink + if(M.loc != location) return //Person has moved away from the sink - user.clean_blood() - if(ishuman(user)) - user:update_inv_gloves() + M.clean_blood() + if(ishuman(M)) + M:update_inv_gloves() for(var/mob/V in viewers(src, null)) - V.show_message("\blue [user] washes their hands using \the [src].") - + V.show_message("\blue [M] washes their hands using \the [src].") /obj/structure/sink/attackby(obj/item/O as obj, mob/user as mob) if(busy) @@ -365,7 +355,7 @@ if (istype(O, /obj/item/weapon/reagent_containers)) var/obj/item/weapon/reagent_containers/RG = O RG.reagents.add_reagent("water", min(RG.volume - RG.reagents.total_volume, RG.amount_per_transfer_from_this)) - user.visible_message("\blue [user] fills \the [RG] using \the [src].","\blue You fill \the [RG] using \the [src].") + user.visible_message("\blue [user] fills the [RG] using \the [src].","\blue You fill the [RG] using \the [src].") return else if (istype(O, /obj/item/weapon/melee/baton)) @@ -424,4 +414,4 @@ /obj/structure/sink/puddle/attackby(obj/item/O as obj, mob/user as mob) icon_state = "puddle-splash" ..() - icon_state = "puddle" + icon_state = "puddle" \ No newline at end of file diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm index 272a9186..5602158a 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 061e6cdc..33d73f08 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 caa3d8be..e175ac9b 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,7 +50,7 @@ update_inv_pockets(0) update_hud() update_icons() - + update_fire() /mob/living/carbon/alien/humanoid/update_hud() //TODO @@ -58,7 +59,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 +165,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 b1919d82..69af9ce2 100644 --- a/code/modules/mob/living/carbon/human/examine.dm +++ b/code/modules/mob/living/carbon/human/examine.dm @@ -227,6 +227,11 @@ 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) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 3223a39c..c1146fe5 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -95,6 +95,9 @@ handle_virus_updates() + //check if we're on fire + handle_fire() + //stuff in the stomach handle_stomach() @@ -656,16 +659,19 @@ stabilize_temperature_from_calories() //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) - 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) - 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) @@ -730,6 +736,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 0d332e35..52576d03 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -128,15 +128,31 @@ Please contact me on #coderbus IRC. ~Carn x #define L_HAND_LAYER 21 #define R_HAND_LAYER 22 #define TARGETED_LAYER 23 //BS12: Layer for the target overlay from weapon targeting system +#define FIRE_LAYER 23 //If you're on fire #define TOTAL_LAYERS 23 ////////////////////////////////// /mob/living/carbon/human var/list/overlays_standing[TOTAL_LAYERS] + var/list/overlays_lying[TOTAL_LAYERS] var/previous_damage_appearance // store what the body last looked like, so we only have to update it if something changed 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. @@ -506,6 +522,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. @@ -535,7 +560,7 @@ proc/get_damage_icon_part(damage_state, body_part) update_icons() //Hud Stuff update_hud() - + update_fire() /* --------------------------------------- */ //vvvvvv UPDATE_INV PROCS vvvvvv @@ -889,4 +914,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/examine.dm b/code/modules/mob/living/carbon/monkey/examine.dm index 299f17bd..1123858f 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 eefd3bad..a4ba1849 100644 --- a/code/modules/mob/living/carbon/monkey/life.dm +++ b/code/modules/mob/living/carbon/monkey/life.dm @@ -59,6 +59,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() @@ -414,10 +417,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) @@ -688,3 +692,11 @@ proc/handle_changeling() if(mind && mind.changeling) mind.changeling.regenerate() + + ///FIRE CODE + handle_fire() + if(..()) + return + adjustFireLoss(6) + return + //END FIRE CODE diff --git a/code/modules/mob/living/carbon/monkey/update_icons.dm b/code/modules/mob/living/carbon/monkey/update_icons.dm index ab049b55..cefcb680 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,9 +20,11 @@ update_inv_r_hand(0) update_inv_l_hand(0) update_inv_handcuffed(0) + update_fire() update_icons() //Hud Stuff update_hud() + return /mob/living/carbon/monkey/update_icons() @@ -95,6 +98,7 @@ if(update_icons) update_icons() + /mob/living/carbon/monkey/update_hud() if (client) client.screen |= contents @@ -109,6 +113,22 @@ 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 @@ -116,5 +136,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 3611a2ae..c149f0f3 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -295,6 +295,8 @@ ear_deaf = 0 ear_damage = 0 heal_overall_damage(getBruteLoss(), getFireLoss()) + fire_stacks = 0 + on_fire = 0 // restore all of a human's blood if(ishuman(src)) @@ -313,6 +315,9 @@ // restore us to conciousness stat = CONSCIOUS + //checks if we are on fire. + update_fire() + // make the icons look correct regenerate_icons() @@ -619,9 +624,19 @@ BD.attack_hand(usr) C.open() - //breaking out of handcuffs + //breaking out of handcuffs and stop, drop, and roll 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/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm index 0fdab79c..f124fd37 100644 --- a/code/modules/mob/living/living_defense.dm +++ b/code/modules/mob/living/living_defense.dm @@ -124,6 +124,44 @@ // 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 + //Why did I place it here? //Remind me to place this somewhere else //I sware this uses less memory diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index 1500b614..4531188b 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -37,4 +37,6 @@ 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. diff --git a/code/modules/mob/living/silicon/robot/death.dm b/code/modules/mob/living/silicon/robot/death.dm index bf1b033f..b0da6f10 100644 --- a/code/modules/mob/living/silicon/robot/death.dm +++ b/code/modules/mob/living/silicon/robot/death.dm @@ -62,6 +62,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 ef5372db..39851507 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 2cd09e52..6bf5fa9b 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() @@ -324,3 +325,23 @@ if(paralysis || stunned || weakened || buckled || lockcharge) canmove = 0 else canmove = 1 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 cfc0ad86..9f1eba57 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -1014,6 +1014,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 bed6a20e..9643a4e9 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -445,6 +445,9 @@ return (0) return (1) +/mob/living/simple_animal/update_fire() + return + //Call when target overlay should be added/removed /mob/living/simple_animal/update_targeted() if(!targeted_by && target_locked) diff --git a/code/modules/reagents/Chemistry-Reagents.dm b/code/modules/reagents/Chemistry-Reagents.dm index 062458fa..c4a3e539 100644 --- a/code/modules/reagents/Chemistry-Reagents.dm +++ b/code/modules/reagents/Chemistry-Reagents.dm @@ -262,6 +262,15 @@ 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 + water/holywater name = "Holy Water" @@ -929,7 +938,12 @@ datum color = "#660000" // rgb: 102, 0, 0 overdose = REAGENTS_OVERDOSE - + 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) @@ -1625,6 +1639,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 toxin/lexorin name = "Lexorin" diff --git a/icons/mob/OnFire.dmi b/icons/mob/OnFire.dmi new file mode 100644 index 00000000..52c6ad88 Binary files /dev/null and b/icons/mob/OnFire.dmi differ