Added getters/setters for species pressure bounds, made vox space immunity a toggle.

This commit is contained in:
MistakeNot4892
2022-10-15 01:16:33 +11:00
parent 9be056c8bf
commit c08e59fde7
5 changed files with 100 additions and 27 deletions

View File

@@ -7,8 +7,7 @@
if (istype(loc, /turf/space)) if (istype(loc, /turf/space))
return ..() - 1 return ..() - 1
if(species.slowdown) . += species.get_slowdown(src)
. += species.slowdown
if(force_max_speed) if(force_max_speed)
return ..() + HUMAN_LOWEST_SLOWDOWN return ..() + HUMAN_LOWEST_SLOWDOWN

View File

@@ -167,11 +167,12 @@
var/pressure_difference var/pressure_difference
// First get the absolute pressure difference. // First get the absolute pressure difference.
if(pressure < species.safe_pressure) // We are in an underpressure. var/species_safe_pressure = species.get_safe_pressure(src)
pressure_difference = species.safe_pressure - pressure if(pressure < species_safe_pressure) // We are in an underpressure.
pressure_difference = species_safe_pressure - pressure
else //We are in an overpressure or standard atmosphere. else //We are in an overpressure or standard atmosphere.
pressure_difference = pressure - species.safe_pressure pressure_difference = pressure - species_safe_pressure
if(pressure_difference < 5) // If the difference is small, don't bother calculating the fraction. if(pressure_difference < 5) // If the difference is small, don't bother calculating the fraction.
pressure_difference = 0 pressure_difference = 0
@@ -184,10 +185,10 @@
// The difference is always positive to avoid extra calculations. // The difference is always positive to avoid extra calculations.
// Apply the relative difference on a standard atmosphere to get the final result. // Apply the relative difference on a standard atmosphere to get the final result.
// The return value will be the adjusted_pressure of the human that is the basis of pressure warnings and damage. // The return value will be the adjusted_pressure of the human that is the basis of pressure warnings and damage.
if(pressure < species.safe_pressure) if(pressure < species_safe_pressure)
return species.safe_pressure - pressure_difference return species_safe_pressure - pressure_difference
else else
return species.safe_pressure + pressure_difference return species_safe_pressure + pressure_difference
/mob/living/carbon/human/handle_disabilities() /mob/living/carbon/human/handle_disabilities()
..() ..()
@@ -729,7 +730,7 @@
else else
loc_temp = environment.temperature loc_temp = environment.temperature
if(adjusted_pressure < species.warning_high_pressure && adjusted_pressure > species.warning_low_pressure && abs(loc_temp - bodytemperature) < 20 && bodytemperature < species.heat_level_1 && bodytemperature > species.cold_level_1) if(adjusted_pressure < species.get_warning_high_pressure(src) && adjusted_pressure > species.get_warning_low_pressure(src) && abs(loc_temp - bodytemperature) < 20 && bodytemperature < species.heat_level_1 && bodytemperature > species.cold_level_1)
clear_alert("pressure") clear_alert("pressure")
return // Temperatures are within normal ranges, fuck all this processing. ~Ccomp return // Temperatures are within normal ranges, fuck all this processing. ~Ccomp
@@ -798,15 +799,16 @@
if(status_flags & GODMODE) if(status_flags & GODMODE)
return 1 //godmode return 1 //godmode
if(adjusted_pressure >= species.hazard_high_pressure) var/species_hazard_high_pressure = species.get_hazard_high_pressure(src)
var/pressure_damage = min( ( (adjusted_pressure / species.hazard_high_pressure) -1 )*PRESSURE_DAMAGE_COEFFICIENT , MAX_HIGH_PRESSURE_DAMAGE) if(adjusted_pressure >= species_hazard_high_pressure)
var/pressure_damage = min( ( (adjusted_pressure / species_hazard_high_pressure) -1 )*PRESSURE_DAMAGE_COEFFICIENT , MAX_HIGH_PRESSURE_DAMAGE)
take_overall_damage(brute=pressure_damage, used_weapon = "High Pressure") take_overall_damage(brute=pressure_damage, used_weapon = "High Pressure")
throw_alert("pressure", /obj/screen/alert/highpressure, 2) throw_alert("pressure", /obj/screen/alert/highpressure, 2)
else if(adjusted_pressure >= species.warning_high_pressure) else if(adjusted_pressure >= species.get_warning_high_pressure(src))
throw_alert("pressure", /obj/screen/alert/highpressure, 1) throw_alert("pressure", /obj/screen/alert/highpressure, 1)
else if(adjusted_pressure >= species.warning_low_pressure) else if(adjusted_pressure >= species.get_warning_low_pressure(src))
clear_alert("pressure") clear_alert("pressure")
else if(adjusted_pressure >= species.hazard_low_pressure) else if(adjusted_pressure >= species.get_hazard_low_pressure(src))
throw_alert("pressure", /obj/screen/alert/lowpressure, 1) throw_alert("pressure", /obj/screen/alert/lowpressure, 1)
else else
if( !(COLD_RESISTANCE in mutations)) if( !(COLD_RESISTANCE in mutations))
@@ -814,7 +816,7 @@
if(getOxyLoss() < 55) // 12 OxyLoss per 4 ticks when wearing internals; unconsciousness in 16 ticks, roughly half a minute if(getOxyLoss() < 55) // 12 OxyLoss per 4 ticks when wearing internals; unconsciousness in 16 ticks, roughly half a minute
var/pressure_dam = 3 // 16 OxyLoss per 4 ticks when no internals present; unconsciousness in 13 ticks, roughly twenty seconds var/pressure_dam = 3 // 16 OxyLoss per 4 ticks when no internals present; unconsciousness in 13 ticks, roughly twenty seconds
// (Extra 1 oxyloss from failed breath) // (Extra 1 oxyloss from failed breath)
// Being in higher pressure decreases the damage taken, down to a minimum of (species.hazard_low_pressure / ONE_ATMOSPHERE) at species.hazard_low_pressure // Being in higher pressure decreases the damage taken, down to a minimum of (species.get_hazard_low_pressure(src) / ONE_ATMOSPHERE) at species.get_hazard_low_pressure(src)
pressure_dam *= (ONE_ATMOSPHERE - adjusted_pressure) / ONE_ATMOSPHERE pressure_dam *= (ONE_ATMOSPHERE - adjusted_pressure) / ONE_ATMOSPHERE
if(wear_suit && wear_suit.min_pressure_protection && head && head.min_pressure_protection) if(wear_suit && wear_suit.min_pressure_protection && head && head.min_pressure_protection)

View File

@@ -14,6 +14,7 @@
/datum/unarmed_attack/claws/strong, /datum/unarmed_attack/claws/strong,
/datum/unarmed_attack/bite/strong /datum/unarmed_attack/bite/strong
) )
rarity_value = 5 rarity_value = 5
blurb = "The Vox are the broken remnants of a once-proud race, now reduced to little more than \ blurb = "The Vox are the broken remnants of a once-proud race, now reduced to little more than \
scavenging vermin who prey on isolated stations, ships or planets to keep their own ancient arkships \ scavenging vermin who prey on isolated stations, ships or planets to keep their own ancient arkships \
@@ -40,9 +41,6 @@
male_sneeze_sound = 'sound/voice/shrieksneeze.ogg' male_sneeze_sound = 'sound/voice/shrieksneeze.ogg'
female_sneeze_sound = 'sound/voice/shrieksneeze.ogg' female_sneeze_sound = 'sound/voice/shrieksneeze.ogg'
warning_low_pressure = 50
hazard_low_pressure = 0
cold_level_1 = 210 //Default 260 cold_level_1 = 210 //Default 260
cold_level_2 = 150 //Default 200 cold_level_2 = 150 //Default 200
cold_level_3 = 90 //Default 120 cold_level_3 = 90 //Default 120
@@ -98,6 +96,8 @@
default_emotes = list( default_emotes = list(
/decl/emote/audible/vox_shriek /decl/emote/audible/vox_shriek
) )
inherent_verbs = list(/mob/living/carbon/human/proc/toggle_vox_pressure_seal)
var/list/current_pressure_toggle = list()
/datum/species/vox/get_random_name(var/gender) /datum/species/vox/get_random_name(var/gender)
var/datum/language/species_language = GLOB.all_languages[default_language] var/datum/language/species_language = GLOB.all_languages[default_language]
@@ -106,3 +106,57 @@
/datum/species/vox/equip_survival_gear(var/mob/living/carbon/human/H, var/extendedtank = 0,var/comprehensive = 0) /datum/species/vox/equip_survival_gear(var/mob/living/carbon/human/H, var/extendedtank = 0,var/comprehensive = 0)
. = ..() . = ..()
H.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/vox(H), slot_wear_mask) H.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/vox(H), slot_wear_mask)
/datum/species/vox/get_slowdown(var/mob/living/carbon/human/H)
if(current_pressure_toggle["\ref[H]"])
return 1.5
return ..()
/datum/species/vox/get_warning_low_pressure(var/mob/living/carbon/human/H)
if(current_pressure_toggle["\ref[H]"])
return 50
return ..()
/datum/species/vox/get_hazard_low_pressure(var/mob/living/carbon/human/H)
if(current_pressure_toggle["\ref[H]"])
return 0
return ..()
/mob/living/carbon/human/proc/toggle_vox_pressure_seal()
set name = "Toggle Vox Pressure Seal"
set category = "Abilities"
set src = usr
if(!istype(species, /datum/species/vox))
verbs -= /mob/living/carbon/human/proc/toggle_vox_pressure_seal
return
if(incapacitated(INCAPACITATION_KNOCKOUT))
to_chat(src, SPAN_WARNING("You are in no state to do that."))
return
var/datum/gender/G = gender_datums[get_visible_gender()]
visible_message(SPAN_NOTICE("\The [src] begins flexing and realigning [G.his] scaling..."))
if(!do_after(src, 2 SECONDS, src, FALSE))
visible_message(
SPAN_NOTICE("\The [src] ceases adjusting [G.his] scaling."),
self_message = SPAN_WARNING("You must remain still to seal or unseal your scaling."))
return
if(incapacitated(INCAPACITATION_KNOCKOUT))
to_chat(src, SPAN_WARNING("You are in no state to do that."))
return
// TODO: maybe add cold and heat thresholds to this.
var/my_ref = "\ref[src]"
var/datum/species/vox/kikiki = species
if((kikiki.current_pressure_toggle[my_ref] = !kikiki.current_pressure_toggle[my_ref]))
visible_message(
SPAN_NOTICE("\The [src]'s scaling flattens and smooths out."),
self_message = SPAN_NOTICE("You flatten your scaling and inflate internal bladders, protecting yourself against low pressure at the cost of dexterity.")
)
else
visible_message(
SPAN_NOTICE("\The [src]'s scaling bristles roughly."),
self_message = SPAN_NOTICE("You bristle your scaling and deflate your internal bladders, restoring mobility but leaving yourself vulnerable to low pressure.")
)

View File

@@ -113,3 +113,21 @@
/datum/species/proc/get_vision_flags(var/mob/living/carbon/human/H) /datum/species/proc/get_vision_flags(var/mob/living/carbon/human/H)
return vision_flags return vision_flags
/datum/species/proc/get_hazard_high_pressure(var/mob/living/carbon/human/H)
return hazard_high_pressure
/datum/species/proc/get_warning_high_pressure(var/mob/living/carbon/human/H)
return warning_high_pressure
/datum/species/proc/get_warning_low_pressure(var/mob/living/carbon/human/H)
return warning_low_pressure
/datum/species/proc/get_hazard_low_pressure(var/mob/living/carbon/human/H)
return hazard_low_pressure
/datum/species/proc/get_safe_pressure(var/mob/living/carbon/human/H)
return safe_pressure
/datum/species/proc/get_slowdown(var/mob/living/carbon/human/H)
return slowdown

View File

@@ -225,7 +225,7 @@ var/global/datum/species/shapeshifter/promethean/prometheans
var/datum/gas_mixture/environment = T.return_air() var/datum/gas_mixture/environment = T.return_air()
var/pressure = environment.return_pressure() var/pressure = environment.return_pressure()
var/affecting_pressure = H.calculate_affecting_pressure(pressure) var/affecting_pressure = H.calculate_affecting_pressure(pressure)
if(affecting_pressure <= hazard_low_pressure) // Dangerous low pressure stops the regeneration of physical wounds. Body is focusing on keeping them intact rather than sealing. if(affecting_pressure <= get_hazard_low_pressure(H)) // Dangerous low pressure stops the regeneration of physical wounds. Body is focusing on keeping them intact rather than sealing.
regen_brute = FALSE regen_brute = FALSE
regen_burn = FALSE regen_burn = FALSE