Infiltration Kit & Overpressure Protection (#11674)

This commit is contained in:
Geeves
2021-04-23 22:22:50 -03:00
committed by GitHub
parent 82bdf4cde2
commit fcbeefe7af
24 changed files with 193 additions and 43 deletions
+6
View File
@@ -399,6 +399,12 @@ var/list/slot_equipment_priority = list( \
drop_from_inventory(entry)
qdel(entry)
/mob/proc/get_covering_equipped_items(var/body_parts)
. = list()
for(var/entry in get_equipped_items())
var/obj/item/I = entry
if(I.body_parts_covered & body_parts)
. += I
/mob/living/carbon/human/proc/equipOutfit(outfit, visualsOnly = FALSE)
var/datum/outfit/O = null
@@ -145,7 +145,7 @@
var/damage_mod = 1
//presumably, if they are wearing a helmet that stops pressure effects, then it probably covers the throat as well
var/obj/item/clothing/head/helmet = get_equipped_item(slot_head)
if(istype(helmet) && (helmet.body_parts_covered & HEAD) && (helmet.flags & STOPPRESSUREDAMAGE))
if(istype(helmet) && (helmet.body_parts_covered & HEAD) && (helmet.min_pressure_protection == 0))
var/datum/component/armor/armor_component = helmet.GetComponent(/datum/component/armor)
if(armor_component)
damage_mod -= armor_component.get_blocked(BRUTE, damage_flags, W.armor_penetration, W.force*1.5)
@@ -149,7 +149,7 @@ emp_act
/mob/living/carbon/human/proc/check_head_airtight_coverage()
var/list/clothing = list(head, wear_mask, wear_suit)
for(var/obj/item/clothing/C in clothing)
if((C.body_parts_covered & HEAD) && (C.item_flags & (AIRTIGHT|STOPPRESSUREDAMAGE)))
if((C.body_parts_covered & HEAD) && (C.item_flags & (AIRTIGHT)))
return TRUE
return FALSE
+14 -15
View File
@@ -104,22 +104,21 @@
if(!InStasis())
..()
// Calculate how vulnerable the human is to under- and overpressure.
// Returns 0 (equals 0 %) if sealed in an undamaged suit, 1 if unprotected (equals 100%).
// Calculate how vulnerable the human is to the current pressure.
// Returns 0 (equals 0 %) if sealed in an undamaged suit that's rated for the pressure, 1 if unprotected (equals 100%).
// Suitdamage can modifiy this in 10% steps.
/mob/living/carbon/human/get_pressure_weakness()
var/pressure_adjustment_coefficient = 1 // Assume no protection at first.
if(wear_suit && (wear_suit.item_flags & STOPPRESSUREDAMAGE) && head && (head.item_flags & STOPPRESSUREDAMAGE)) // Complete set of pressure-proof suit worn, assume fully sealed.
pressure_adjustment_coefficient = 0
// Handles breaches in your space suit. 10 suit damage equals a 100% loss of pressure protection.
if(istype(wear_suit,/obj/item/clothing/suit/space))
var/obj/item/clothing/suit/space/S = wear_suit
if(S.can_breach && S.damage)
pressure_adjustment_coefficient += S.damage * 0.1
pressure_adjustment_coefficient = min(1,max(pressure_adjustment_coefficient,0)) // So it isn't less than 0 or larger than 1.
/mob/living/carbon/human/get_pressure_weakness(pressure)
var/pressure_adjustment_coefficient = 0
var/list/zones = list(HEAD, UPPER_TORSO, LOWER_TORSO, LEGS, FEET, ARMS, HANDS)
for(var/zone in zones)
var/list/covers = get_covering_equipped_items(zone)
var/zone_exposure = 1
for(var/obj/item/clothing/C in covers)
zone_exposure = min(zone_exposure, C.get_pressure_weakness(pressure,zone))
if(zone_exposure >= 1)
return 1
pressure_adjustment_coefficient = max(pressure_adjustment_coefficient, zone_exposure)
pressure_adjustment_coefficient = Clamp(pressure_adjustment_coefficient, 0, 1) // So it isn't less than 0 or larger than 1.
return pressure_adjustment_coefficient
+1
View File
@@ -1089,6 +1089,7 @@
/mob/proc/get_pressure_weakness()
return 1
/mob/living/proc/flash_strong_pain()
return