Patches frying oil splashing not accounting mobs' impermeability. (#44128)

About The Pull Request

Reagents' TOUCH reactions are very stupid game design wise and do not account impermeability by default unlike VAPOR, yet both are pretty much interchangeably used.
But not going to fix it today and debate how features and gameplay mechanics branched off this crooked fallacy should be adjusted. So forgive me for lines 134 and 135.

Nevertheless this should stop splashed frying oil from bypassing bio impermeability and thus every sort of protection. Plus message spam reduction.
Also slighty raised the damage cap of sizzling cooking oil to partially counter the mild bio protection gained from the average crewmember's attire.
Why It's Good For The Game

I have used the pneumatic cannon deepfrying meme before, it requires some time and welding spamclicking, but it's pretty much a victory against anyone if the shots hit.
Changelog

cl
fix: Fixes splashed cooking oil bypassing any sort of mob impermeability. Also cut off message/sound spam from being repeatedly splashed within a minimal delay.
balance: Upped the cooking oil damage cap from 35 to 38 to account the mild bio protection of the average crewmember's attire. Also made hot deep fryer swirlies account the user's head covering gear's impermeability.
refactor: Standarized monkeys/humans get_permeability_coefficient().
/cl
This commit is contained in:
Ghom
2019-06-01 08:53:04 +12:00
committed by oranges
parent fece355125
commit e26d78b2b9
8 changed files with 36 additions and 43 deletions
@@ -148,7 +148,8 @@ God bless America.
var/mob/living/carbon/C = user.pulling
user.visible_message("<span class = 'danger'>[user] dunks [C]'s face in [src]!</span>")
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)
@@ -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)
+11
View File
@@ -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()
@@ -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)
. = ..()
@@ -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
+3 -2
View File
@@ -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()
@@ -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("<span class='warning'>The boiling oil sizzles as it covers [M]!</span>", \
"<span class='userdanger'>You're covered in boiling oil!</span>")
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("<span class='warning'>The boiling oil sizzles as it covers [M]!</span>", \
"<span class='userdanger'>You're covered in boiling oil!</span>")
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)