diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index cb7e9b02042..b1810c95981 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -136,6 +136,7 @@ #define TRAIT_BOOZE_SLIDER "booze-slider" #define TRAIT_UNINTELLIGIBLE_SPEECH "unintelligible-speech" #define TRAIT_UNSTABLE "unstable" +#define TRAIT_OIL_FRIED "oil_fried" //non-mob traits #define TRAIT_PARALYSIS "paralysis" //Used for limb-based paralysis, where replacing the limb will fix it diff --git a/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm b/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm index 30b2ff5abb2..ad1993133b4 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm @@ -148,7 +148,8 @@ God bless America. var/mob/living/carbon/C = user.pulling user.visible_message("[user] dunks [C]'s face in [src]!") reagents.reaction(C, TOUCH) - C.apply_damage(min(30, reagents.total_volume), BURN, BODY_ZONE_HEAD) + var/permeability = 1 - C.get_permeability_protection(list(HEAD)) + C.apply_damage(min(30 * permeability, reagents.total_volume), BURN, BODY_ZONE_HEAD) reagents.remove_any((reagents.total_volume/2)) C.Paralyze(60) user.changeNext_move(CLICK_CD_MELEE) diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm index 7382e747ac3..5881f40e405 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm @@ -88,7 +88,7 @@ else return initial(pixel_x) -/mob/living/carbon/alien/humanoid/get_permeability_protection() +/mob/living/carbon/alien/humanoid/get_permeability_protection(list/target_zones) return 0.8 /mob/living/carbon/alien/humanoid/alien_evolve(mob/living/carbon/alien/humanoid/new_xeno) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 86cf9184941..a8fa0266b4e 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -616,6 +616,17 @@ else . += INFINITY +/mob/living/carbon/get_permeability_protection(list/target_zones = list(HANDS = 0, CHEST = 0, GROIN = 0, LEGS = 0, FEET = 0, ARMS = 0, HEAD = 0)) + for(var/obj/item/I in get_equipped_items()) + for(var/zone in target_zones) + if(I.body_parts_covered & zone) + target_zones[zone] = max(1 - I.permeability_coefficient, target_zones[zone]) + var/protection = 0 + for(var/zone in target_zones) + protection += target_zones[zone] + protection *= INVERSE(target_zones.len) + return protection + //this handles hud updates /mob/living/carbon/update_damage_hud() diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index 8bf25832ee1..5dfec65aa9a 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -134,26 +134,6 @@ return ..() -/mob/living/carbon/human/get_permeability_protection() - var/list/prot = list("hands"=0, "chest"=0, "groin"=0, "legs"=0, "feet"=0, "arms"=0, "head"=0) - for(var/obj/item/I in get_equipped_items()) - if(I.body_parts_covered & HANDS) - prot["hands"] = max(1 - I.permeability_coefficient, prot["hands"]) - if(I.body_parts_covered & CHEST) - prot["chest"] = max(1 - I.permeability_coefficient, prot["chest"]) - if(I.body_parts_covered & GROIN) - prot["groin"] = max(1 - I.permeability_coefficient, prot["groin"]) - if(I.body_parts_covered & LEGS) - prot["legs"] = max(1 - I.permeability_coefficient, prot["legs"]) - if(I.body_parts_covered & FEET) - prot["feet"] = max(1 - I.permeability_coefficient, prot["feet"]) - if(I.body_parts_covered & ARMS) - prot["arms"] = max(1 - I.permeability_coefficient, prot["arms"]) - if(I.body_parts_covered & HEAD) - prot["head"] = max(1 - I.permeability_coefficient, prot["head"]) - var/protection = (prot["head"] + prot["arms"] + prot["feet"] + prot["legs"] + prot["groin"] + prot["chest"] + prot["hands"])/7 - return protection - /mob/living/carbon/human/can_use_guns(obj/item/G) . = ..() diff --git a/code/modules/mob/living/carbon/monkey/monkey.dm b/code/modules/mob/living/carbon/monkey/monkey.dm index 1797c3d7944..349872ba312 100644 --- a/code/modules/mob/living/carbon/monkey/monkey.dm +++ b/code/modules/mob/living/carbon/monkey/monkey.dm @@ -151,15 +151,6 @@ return threatcount -/mob/living/carbon/monkey/get_permeability_protection() - var/protection = 0 - if(head) - protection = 1 - head.permeability_coefficient - if(wear_mask) - protection = max(1 - wear_mask.permeability_coefficient, protection) - protection = protection/7 //the rest of the body isn't covered. - return protection - /mob/living/carbon/monkey/IsVocal() if(!getorganslot(ORGAN_SLOT_LUNGS)) return 0 diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 7e8a5f76898..01e1e782912 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -902,7 +902,7 @@ return 1 //used in datum/reagents/reaction() proc -/mob/living/proc/get_permeability_protection() +/mob/living/proc/get_permeability_protection(list/target_zones) return 0 /mob/living/proc/harvest(mob/living/user) //used for extra objects etc. in butchering @@ -1008,7 +1008,8 @@ /mob/living/proc/fakefire() return - +/mob/living/proc/unfry_mob() //Callback proc to tone down spam from multiple sizzling frying oil dipping. + REMOVE_TRAIT(src, TRAIT_OIL_FRIED, "cooking_oil_react") //Mobs on Fire /mob/living/proc/IgniteMob() diff --git a/code/modules/reagents/chemistry/reagents/food_reagents.dm b/code/modules/reagents/chemistry/reagents/food_reagents.dm index 563859ff2fb..adc7aa382ee 100755 --- a/code/modules/reagents/chemistry/reagents/food_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/food_reagents.dm @@ -107,7 +107,6 @@ nutriment_factor = 7 * REAGENTS_METABOLISM //Not very healthy on its own metabolization_rate = 10 * REAGENTS_METABOLISM var/fry_temperature = 450 //Around ~350 F (117 C) which deep fryers operate around in the real world - var/boiling //Used in mob life to determine if the oil kills, and only on touch application /datum/reagent/consumable/cooking_oil/reaction_obj(obj/O, reac_volume) if(holder && holder.chem_temp >= fry_temperature) @@ -120,18 +119,27 @@ /datum/reagent/consumable/cooking_oil/reaction_mob(mob/living/M, method = TOUCH, reac_volume, show_message = 1, touch_protection = 0) if(!istype(M)) return + var/boiling = FALSE if(holder && holder.chem_temp >= fry_temperature) boiling = TRUE - if(method == VAPOR || method == TOUCH) //Directly coats the mob, and doesn't go into their bloodstream - if(boiling) - M.visible_message("The boiling oil sizzles as it covers [M]!", \ - "You're covered in boiling oil!") + if(method != VAPOR && method != TOUCH) //Directly coats the mob, and doesn't go into their bloodstream + return ..() + if(!boiling) + return TRUE + var/oil_damage = ((holder.chem_temp / fry_temperature) * 0.33) //Damage taken per unit + if(method == TOUCH) + oil_damage *= 1 - M.get_permeability_protection() + var/FryLoss = round(min(38, oil_damage * reac_volume)) + if(!HAS_TRAIT(M, TRAIT_OIL_FRIED)) + M.visible_message("The boiling oil sizzles as it covers [M]!", \ + "You're covered in boiling oil!") + if(FryLoss) M.emote("scream") - playsound(M, 'sound/machines/fryer/deep_fryer_emerge.ogg', 25, TRUE) - var/oil_damage = (holder.chem_temp / fry_temperature) * 0.33 //Damage taken per unit - M.adjustFireLoss(min(35, oil_damage * reac_volume)) //Damage caps at 35 - else - ..() + playsound(M, 'sound/machines/fryer/deep_fryer_emerge.ogg', 25, TRUE) + ADD_TRAIT(M, TRAIT_OIL_FRIED, "cooking_oil_react") + addtimer(CALLBACK(M, /mob/living/proc/unfry_mob), 3) + if(FryLoss) + M.adjustFireLoss(FryLoss) return TRUE /datum/reagent/consumable/cooking_oil/reaction_turf(turf/open/T, reac_volume)