mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Makes showers wash away touching reagents
Also moves reagent permeability to it's own proc, and makes splash_mob respect copy
This commit is contained in:
@@ -225,6 +225,12 @@
|
||||
if(M.back)
|
||||
if(M.back.clean_blood())
|
||||
M.update_inv_back(0)
|
||||
|
||||
//flush away reagents on the skin
|
||||
if(M.touching)
|
||||
var/remove_amount = M.touching.maximum_volume * M.reagent_permeability() //take off your suit first
|
||||
M.touching.remove_any(remove_amount)
|
||||
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
var/washgloves = 1
|
||||
|
||||
@@ -444,4 +444,41 @@ emp_act
|
||||
if(!istype(wear_suit,/obj/item/clothing/suit/space)) return
|
||||
var/obj/item/clothing/suit/space/SS = wear_suit
|
||||
var/penetrated_dam = max(0,(damage - SS.breach_threshold))
|
||||
if(penetrated_dam) SS.create_breaches(damtype, penetrated_dam)
|
||||
if(penetrated_dam) SS.create_breaches(damtype, penetrated_dam)
|
||||
|
||||
/mob/living/human/reagent_permeability()
|
||||
var/perm = 0
|
||||
|
||||
var/list/perm_by_part = list(
|
||||
"head" = THERMAL_PROTECTION_HEAD,
|
||||
"upper_torso" = THERMAL_PROTECTION_UPPER_TORSO,
|
||||
"lower_torso" = THERMAL_PROTECTION_LOWER_TORSO,
|
||||
"legs" = THERMAL_PROTECTION_LEG_LEFT + THERMAL_PROTECTION_LEG_RIGHT,
|
||||
"feet" = THERMAL_PROTECTION_FOOT_LEFT + THERMAL_PROTECTION_FOOT_RIGHT,
|
||||
"arms" = THERMAL_PROTECTION_ARM_LEFT + THERMAL_PROTECTION_ARM_RIGHT,
|
||||
"hands" = THERMAL_PROTECTION_HAND_LEFT + THERMAL_PROTECTION_HAND_RIGHT
|
||||
)
|
||||
|
||||
for(var/obj/item/clothing/C in src.get_equipped_items())
|
||||
if(C.permeability_coefficient == 1 || !C.body_parts_covered)
|
||||
continue
|
||||
if(C.body_parts_covered & HEAD)
|
||||
perm_by_part["head"] *= C.permeability_coefficient
|
||||
if(C.body_parts_covered & UPPER_TORSO)
|
||||
perm_by_part["upper_torso"] *= C.permeability_coefficient
|
||||
if(C.body_parts_covered & LOWER_TORSO)
|
||||
perm_by_part["lower_torso"] *= C.permeability_coefficient
|
||||
if(C.body_parts_covered & LEGS)
|
||||
perm_by_part["legs"] *= C.permeability_coefficient
|
||||
if(C.body_parts_covered & FEET)
|
||||
perm_by_part["feet"] *= C.permeability_coefficient
|
||||
if(C.body_parts_covered & ARMS)
|
||||
perm_by_part["arms"] *= C.permeability_coefficient
|
||||
if(C.body_parts_covered & HANDS)
|
||||
perm_by_part["hands"] *= C.permeability_coefficient
|
||||
|
||||
for(var/part in perm_by_part)
|
||||
perm += perm_by_part[part]
|
||||
|
||||
return perm
|
||||
|
||||
|
||||
@@ -247,3 +247,6 @@
|
||||
//Scale quadratically so that single digit numbers of fire stacks don't burn ridiculously hot.
|
||||
//lower limit of 700 K, same as matches and roughly the temperature of a cool flame.
|
||||
return max(2.25*round(FIRESUIT_MAX_HEAT_PROTECTION_TEMPERATURE*(fire_stacks/FIRE_MAX_FIRESUIT_STACKS)**2), 700)
|
||||
|
||||
/mob/living/proc/reagent_permeability()
|
||||
return 1
|
||||
|
||||
@@ -296,9 +296,7 @@
|
||||
touch(target) //First, handle mere touch effects
|
||||
|
||||
if(ismob(target))
|
||||
//warning("[my_atom] is trying to transfer reagents to [target], which is a mob, using trans_to()")
|
||||
//return trans_to_mob(target, amount, multiplier, copy)
|
||||
return splash_mob(target, amount)
|
||||
return splash_mob(target, amount, copy)
|
||||
if(isturf(target))
|
||||
return trans_to_turf(target, amount, multiplier, copy)
|
||||
if(isobj(target))
|
||||
@@ -369,41 +367,12 @@
|
||||
// Attempts to place a reagent on the mob's skin.
|
||||
// Reagents are not guaranteed to transfer to the target.
|
||||
// Do not call this directly, call trans_to() instead.
|
||||
/datum/reagents/proc/splash_mob(var/mob/target, var/amount = 1, var/clothes = 1)
|
||||
var/perm = 0
|
||||
|
||||
//this all seems very human-specific
|
||||
var/list/L = list(
|
||||
"head" = THERMAL_PROTECTION_HEAD,
|
||||
"upper_torso" = THERMAL_PROTECTION_UPPER_TORSO,
|
||||
"lower_torso" = THERMAL_PROTECTION_LOWER_TORSO,
|
||||
"legs" = THERMAL_PROTECTION_LEG_LEFT + THERMAL_PROTECTION_LEG_RIGHT,
|
||||
"feet" = THERMAL_PROTECTION_FOOT_LEFT + THERMAL_PROTECTION_FOOT_RIGHT,
|
||||
"arms" = THERMAL_PROTECTION_ARM_LEFT + THERMAL_PROTECTION_ARM_RIGHT,
|
||||
"hands" = THERMAL_PROTECTION_HAND_LEFT + THERMAL_PROTECTION_HAND_RIGHT
|
||||
)
|
||||
|
||||
if(clothes)
|
||||
for(var/obj/item/clothing/C in target.get_equipped_items())
|
||||
if(C.permeability_coefficient == 1 || C.body_parts_covered == 0)
|
||||
continue
|
||||
if(C.body_parts_covered & HEAD)
|
||||
L["head"] *= C.permeability_coefficient
|
||||
if(C.body_parts_covered & UPPER_TORSO)
|
||||
L["upper_torso"] *= C.permeability_coefficient
|
||||
if(C.body_parts_covered & LOWER_TORSO)
|
||||
L["lower_torso"] *= C.permeability_coefficient
|
||||
if(C.body_parts_covered & LEGS)
|
||||
L["legs"] *= C.permeability_coefficient
|
||||
if(C.body_parts_covered & FEET)
|
||||
L["feet"] *= C.permeability_coefficient
|
||||
if(C.body_parts_covered & ARMS)
|
||||
L["arms"] *= C.permeability_coefficient
|
||||
if(C.body_parts_covered & HANDS)
|
||||
L["hands"] *= C.permeability_coefficient
|
||||
for(var/t in L)
|
||||
perm += L[t]
|
||||
return trans_to_mob(target, amount, CHEM_TOUCH, perm)
|
||||
/datum/reagents/proc/splash_mob(var/mob/target, var/amount = 1, var/copy = 0)
|
||||
var/perm = 1
|
||||
if(isliving(target)) //will we ever even need to tranfer reagents to non-living mobs?
|
||||
var/mob/living/L = target
|
||||
perm = L.reagent_permeability()
|
||||
return trans_to_mob(target, amount, CHEM_TOUCH, perm, copy)
|
||||
|
||||
/datum/reagents/proc/trans_to_mob(var/mob/target, var/amount = 1, var/type = CHEM_BLOOD, var/multiplier = 1, var/copy = 0) // Transfer after checking into which holder...
|
||||
if(!target || !istype(target))
|
||||
|
||||
17
code/modules/reagents/Chemistry-Metabolism.dm
Normal file
17
code/modules/reagents/Chemistry-Metabolism.dm
Normal file
@@ -0,0 +1,17 @@
|
||||
/datum/reagents/metabolism
|
||||
var/metabolism_type
|
||||
|
||||
/datum/reagents/metabolism/New(var/max = 100, var/met_type, mob/living/carbon/parent_mob)
|
||||
..()
|
||||
metabolism_type = met_type
|
||||
my_atom = parent_mob
|
||||
|
||||
/datum/reagents/proc/metabolize(var/alien)
|
||||
if(!iscarbon(my_atom))
|
||||
return
|
||||
var/mob/living/carbon/C = my_atom
|
||||
if(!C || !istype(C))
|
||||
return
|
||||
for(var/datum/reagent/current in reagent_list)
|
||||
current.on_mob_life(C, alien, metabolism_type)
|
||||
update_total()
|
||||
Reference in New Issue
Block a user