mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-29 06:57:42 +01:00
Merge pull request #7832 from Fox-McCloud/lungsss
Breathing is Now Handled on Lungs
This commit is contained in:
@@ -1785,7 +1785,7 @@
|
||||
H.gene_stability = 100
|
||||
logmsg = "permanent regeneration."
|
||||
if("Super Powers")
|
||||
var/list/default_genes = list(REGENERATEBLOCK, NOBREATHBLOCK, COLDBLOCK)
|
||||
var/list/default_genes = list(REGENERATEBLOCK, BREATHLESSBLOCK, COLDBLOCK)
|
||||
for(var/gene in default_genes)
|
||||
H.dna.SetSEState(gene, 1)
|
||||
genemutcheck(H, gene, null, MUTCHK_FORCED)
|
||||
|
||||
@@ -59,7 +59,7 @@ var/global/sent_honksquad = 0
|
||||
new_honksquad.key = pick(commandos)
|
||||
commandos -= new_honksquad.key
|
||||
new_honksquad.internal = new_honksquad.s_store
|
||||
new_honksquad.update_internals_hud_icon(1)
|
||||
new_honksquad.update_action_buttons_icon()
|
||||
|
||||
//So they don't forget their code or mission.
|
||||
new_honksquad.mind.store_memory("<B>Mission:</B> <span class='warning'>[input].</span>")
|
||||
|
||||
@@ -88,7 +88,7 @@ var/global/sent_syndicate_infiltration_team = 0
|
||||
if(!spawn_sit_mgmt || theguy.key != key)
|
||||
new_syndicate_infiltrator.key = theguy.key
|
||||
new_syndicate_infiltrator.internal = new_syndicate_infiltrator.s_store
|
||||
new_syndicate_infiltrator.update_internals_hud_icon(1)
|
||||
new_syndicate_infiltrator.update_action_buttons_icon()
|
||||
infiltrators -= theguy
|
||||
to_chat(new_syndicate_infiltrator, "<span class='danger'>You are a [!syndicate_leader_selected?"Infiltrator":"<B>Lead Infiltrator</B>"] in the service of the Syndicate. \nYour current mission is: <B>[input]</B></span>")
|
||||
to_chat(new_syndicate_infiltrator, "<span class='notice'>You are equipped with an uplink implant to help you achieve your objectives. ((activate it via button in top left of screen))</span>")
|
||||
@@ -119,7 +119,7 @@ var/global/sent_syndicate_infiltration_team = 0
|
||||
var/mob/living/carbon/human/syndimgmtmob = create_syndicate_infiltrator(L, 1, 100, 1)
|
||||
syndimgmtmob.key = key
|
||||
syndimgmtmob.internal = syndimgmtmob.s_store
|
||||
syndimgmtmob.update_internals_hud_icon(1)
|
||||
syndimgmtmob.update_action_buttons_icon()
|
||||
syndimgmtmob.faction += "syndicate"
|
||||
syndimgmtmob.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal(src), slot_glasses)
|
||||
syndimgmtmob.equip_to_slot_or_del(new /obj/item/clothing/suit/space/hardsuit/syndi/elite, slot_wear_suit)
|
||||
|
||||
@@ -361,7 +361,7 @@ client/proc/one_click_antag()
|
||||
|
||||
new_syndicate_commando.key = theghost.key
|
||||
new_syndicate_commando.internal = new_syndicate_commando.s_store
|
||||
new_syndicate_commando.update_internals_hud_icon(1)
|
||||
new_syndicate_commando.update_action_buttons_icon()
|
||||
|
||||
//So they don't forget their code or mission.
|
||||
|
||||
|
||||
@@ -410,7 +410,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
if("Death Commando")//Leaves them at late-join spawn.
|
||||
new_character.equip_death_commando()
|
||||
new_character.internal = new_character.s_store
|
||||
new_character.update_internals_hud_icon(1)
|
||||
new_character.update_action_buttons_icon()
|
||||
else//They may also be a cyborg or AI.
|
||||
switch(new_character.mind.assigned_role)
|
||||
if("Cyborg")//More rigging to make em' work and check if they're traitor.
|
||||
|
||||
@@ -64,7 +64,7 @@ var/global/sent_strike_team = 0
|
||||
new_commando.key = pick(commandos)
|
||||
commandos -= new_commando.key
|
||||
new_commando.internal = new_commando.s_store
|
||||
new_commando.update_internals_hud_icon(1)
|
||||
new_commando.update_action_buttons_icon()
|
||||
|
||||
//So they don't forget their code or mission.
|
||||
if(nuke_code)
|
||||
|
||||
@@ -71,7 +71,7 @@ var/global/sent_syndicate_strike_team = 0
|
||||
new_syndicate_commando.key = pick(commandos)
|
||||
commandos -= new_syndicate_commando.key
|
||||
new_syndicate_commando.internal = new_syndicate_commando.s_store
|
||||
new_syndicate_commando.update_internals_hud_icon(1)
|
||||
new_syndicate_commando.update_action_buttons_icon()
|
||||
|
||||
//So they don't forget their code or mission.
|
||||
if(nuke_code)
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
to_chat(user, "<B>Your wish is granted, but at a terrible cost...</B>")
|
||||
to_chat(user, "The Wish Granter punishes you for your selfishness, claiming your soul and warping your body to match the darkness in your heart.")
|
||||
user.mutations.Add(LASER)
|
||||
user.mutations.Add(RESIST_COLD)
|
||||
user.mutations.Add(COLDRES)
|
||||
user.mutations.Add(XRAY)
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/human = user
|
||||
|
||||
@@ -333,9 +333,9 @@ BLIND // can't see anything
|
||||
if(adjusted_flags)
|
||||
slot_flags = adjusted_flags
|
||||
if(ishuman(user) && H.internal && !H.get_organ_slot("breathing_tube") && user.wear_mask == src) /*If the user was wearing the mask providing internals on their face at the time it was adjusted, turn off internals.
|
||||
Otherwise, they adjusted it while it was in their hands or some such so we won't be needing to turn off internals.*/
|
||||
H.update_internals_hud_icon(0)
|
||||
Otherwise, they adjusted it while it was in their hands or some such so we won't be needing to turn off internals.*/
|
||||
H.internal = null
|
||||
H.update_action_buttons_icon()
|
||||
if(flags_inv & HIDEFACE) //Means that only things like bandanas and balaclavas will be affected since they obscure the identity of the wearer.
|
||||
flags_inv &= ~HIDEFACE /*Done after the above to avoid having to do a check for initial(src.flags_inv == HIDEFACE).
|
||||
This reveals the user's face since the bandana will now be going on their head.*/
|
||||
|
||||
@@ -136,7 +136,7 @@
|
||||
user.visible_message("[user] places \the [src] against [M]'s chest and listens attentively.", "You place \the [src] against [M]'s chest...")
|
||||
var/obj/item/organ/internal/H = M.get_int_organ(/obj/item/organ/internal/heart)
|
||||
var/obj/item/organ/internal/L = M.get_int_organ(/obj/item/organ/internal/lungs)
|
||||
if((H && M.pulse) || (L && !(NO_BREATH in M.mutations) && !(NO_BREATH in M.species.species_traits)))
|
||||
if((H && M.pulse) || (L && !(BREATHLESS in M.mutations) && !(NO_BREATHE in M.species.species_traits)))
|
||||
var/color = "notice"
|
||||
if(H)
|
||||
var/heart_sound
|
||||
|
||||
@@ -149,7 +149,7 @@ Gunshots/explosions/opening doors/less rare audio (done)
|
||||
qdel(src)
|
||||
Expand()
|
||||
if((get_turf(target) in flood_turfs) && !target.internal)
|
||||
target.hallucinate("fake_alert", "tox_in_air")
|
||||
target.hallucinate("fake_alert", "too_much_tox")
|
||||
next_expand = world.time + FAKE_FLOOD_EXPAND_TIME
|
||||
|
||||
/obj/effect/hallucination/fake_flood/proc/Expand()
|
||||
@@ -890,12 +890,12 @@ var/list/non_fakeattack_weapons = list(/obj/item/weapon/gun/projectile, /obj/ite
|
||||
sleep(rand(100,250))
|
||||
hal_screwyhud = SCREWYHUD_NONE
|
||||
if("fake_alert")
|
||||
var/alert_type = pick("oxy","not_enough_tox","not_enough_co2","too_much_oxy","too_much_co2","tox_in_air","newlaw","nutrition","charge","weightless","fire","locked","hacked","temp","pressure")
|
||||
var/alert_type = pick("not_enough_oxy","not_enough_tox","not_enough_co2","too_much_oxy","too_much_co2","too_much_tox","newlaw","nutrition","charge","weightless","fire","locked","hacked","temp","pressure")
|
||||
if(specific)
|
||||
alert_type = specific
|
||||
switch(alert_type)
|
||||
if("oxy")
|
||||
throw_alert("oxy", /obj/screen/alert/oxy, override = TRUE)
|
||||
if("not_enough_oxy")
|
||||
throw_alert("not_enough_oxy", /obj/screen/alert/not_enough_oxy, override = TRUE)
|
||||
if("not_enough_tox")
|
||||
throw_alert("not_enough_tox", /obj/screen/alert/not_enough_tox, override = TRUE)
|
||||
if("not_enough_co2")
|
||||
@@ -904,8 +904,8 @@ var/list/non_fakeattack_weapons = list(/obj/item/weapon/gun/projectile, /obj/ite
|
||||
throw_alert("too_much_oxy", /obj/screen/alert/too_much_oxy, override = TRUE)
|
||||
if("too_much_co2")
|
||||
throw_alert("too_much_co2", /obj/screen/alert/too_much_co2, override = TRUE)
|
||||
if("tox_in_air")
|
||||
throw_alert("tox_in_air", /obj/screen/alert/tox_in_air, override = TRUE)
|
||||
if("too_much_tox")
|
||||
throw_alert("too_much_tox", /obj/screen/alert/too_much_tox, override = TRUE)
|
||||
if("nutrition")
|
||||
if(prob(50))
|
||||
throw_alert("nutrition", /obj/screen/alert/fat, override = TRUE)
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
var/leap_on_click = 0
|
||||
var/custom_pixel_x_offset = 0 //for admin fuckery.
|
||||
var/custom_pixel_y_offset = 0
|
||||
pass_flags = PASSTABLE
|
||||
pressure_resistance = 100 //100 kPa difference required to push
|
||||
throw_pressure_limit = 120 //120 kPa difference required to throw
|
||||
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
/mob/living/carbon/alien/humanoid
|
||||
oxygen_alert = 0
|
||||
toxins_alert = 0
|
||||
fire_alert = 0
|
||||
pass_flags = PASSTABLE
|
||||
|
||||
|
||||
/mob/living/carbon/alien/humanoid/Life()
|
||||
. = ..()
|
||||
update_icons()
|
||||
|
||||
@@ -4,15 +4,16 @@
|
||||
|
||||
if(!breath || (breath.total_moles() == 0))
|
||||
//Aliens breathe in vaccuum
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
var/toxins_used = 0
|
||||
var/tox_detect_threshold = 0.02
|
||||
var/breath_pressure = (breath.total_moles() * R_IDEAL_GAS_EQUATION * breath.temperature) / BREATH_VOLUME
|
||||
|
||||
//Partial pressure of the toxins in our breath
|
||||
var/Toxins_pp = (breath.toxins / breath.total_moles()) * breath_pressure
|
||||
|
||||
if(Toxins_pp) // Detect toxins in air
|
||||
if(Toxins_pp > tox_detect_threshold) // Detect toxins in air
|
||||
adjustPlasma(breath.toxins*250)
|
||||
throw_alert("alien_tox", /obj/screen/alert/alien_tox)
|
||||
|
||||
@@ -28,8 +29,6 @@
|
||||
//BREATH TEMPERATURE
|
||||
handle_breath_temperature(breath)
|
||||
|
||||
return 1
|
||||
|
||||
/mob/living/carbon/alien/update_sight()
|
||||
if(!client)
|
||||
return
|
||||
|
||||
@@ -668,7 +668,7 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
|
||||
if(do_mob(usr, src, POCKET_STRIP_DELAY))
|
||||
if(internal)
|
||||
internal = null
|
||||
update_internals_hud_icon(0)
|
||||
update_action_buttons_icon()
|
||||
else
|
||||
var/no_mask2
|
||||
if(!get_organ_slot("breathing_tube"))
|
||||
@@ -679,7 +679,7 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
|
||||
to_chat(usr, "<span class='warning'>[src] is not wearing a suitable mask or helmet!</span>")
|
||||
return
|
||||
internal = ITEM
|
||||
update_internals_hud_icon(1)
|
||||
update_action_buttons_icon()
|
||||
|
||||
visible_message("<span class='danger'>[usr] [internal ? "opens" : "closes"] the valve on [src]'s [ITEM].</span>", \
|
||||
"<span class='userdanger'>[usr] [internal ? "opens" : "closes"] the valve on [src]'s [ITEM].</span>")
|
||||
@@ -1061,10 +1061,6 @@ so that different stomachs can handle things in different ways VB*/
|
||||
|
||||
return FALSE
|
||||
|
||||
/mob/living/carbon/proc/update_internals_hud_icon(internal_state = 0)
|
||||
if(hud_used && hud_used.internals)
|
||||
hud_used.internals.icon_state = "internal[internal_state]"
|
||||
|
||||
//to recalculate and update the mob's total tint from tinted equipment it's wearing.
|
||||
/mob/living/carbon/proc/update_tint()
|
||||
if(!tinted_weldhelh)
|
||||
|
||||
@@ -23,12 +23,8 @@
|
||||
|
||||
var/wetlevel = 0 //how wet the mob is
|
||||
|
||||
var/oxygen_alert = 0
|
||||
var/toxins_alert = 0
|
||||
var/co2_alert = 0
|
||||
var/fire_alert = 0
|
||||
var/failed_last_breath = FALSE //This is used to determine if the mob failed a breath. If they did fail a brath, they will attempt to breathe each tick, otherwise just once per 4 ticks.
|
||||
var/list/active_effect = list()
|
||||
|
||||
var/failed_last_breath = 0 //This is used to determine if the mob failed a breath. If they did fail a brath, they will attempt to breathe each tick, otherwise just once per 4 ticks.
|
||||
var/co2overloadtime = null
|
||||
|
||||
blood_volume = BLOOD_VOLUME_NORMAL
|
||||
|
||||
@@ -1306,36 +1306,6 @@
|
||||
src.custom_pain("You feel a stabbing pain in your chest!", 1)
|
||||
L.damage = L.min_bruised_damage
|
||||
|
||||
/*
|
||||
/mob/living/carbon/human/verb/simulate()
|
||||
set name = "sim"
|
||||
//set background = 1
|
||||
|
||||
var/damage = input("Wound damage","Wound damage") as num
|
||||
|
||||
var/germs = 0
|
||||
var/tdamage = 0
|
||||
var/ticks = 0
|
||||
while(germs < 2501 && ticks < 100000 && round(damage/10)*20)
|
||||
diary << "VIRUS TESTING: [ticks] : germs [germs] tdamage [tdamage] prob [round(damage/10)*20]"
|
||||
ticks++
|
||||
if(prob(round(damage/10)*20))
|
||||
germs++
|
||||
if(germs == 100)
|
||||
to_chat(world, "Reached stage 1 in [ticks] ticks")
|
||||
if(germs > 100)
|
||||
if(prob(10))
|
||||
damage++
|
||||
germs++
|
||||
if(germs == 1000)
|
||||
to_chat(world, "Reached stage 2 in [ticks] ticks")
|
||||
if(germs > 1000)
|
||||
damage++
|
||||
germs++
|
||||
if(germs == 2500)
|
||||
to_chat(world, "Reached stage 3 in [ticks] ticks")
|
||||
to_chat(world, "Mob took [tdamage] tox damage")
|
||||
*/
|
||||
//returns 1 if made bloody, returns 0 otherwise
|
||||
|
||||
/mob/living/carbon/human/clean_blood(var/clean_feet)
|
||||
@@ -1441,10 +1411,6 @@
|
||||
|
||||
maxHealth = species.total_health
|
||||
|
||||
toxins_alert = 0
|
||||
oxygen_alert = 0
|
||||
fire_alert = 0
|
||||
|
||||
if(species.language)
|
||||
add_language(species.language)
|
||||
|
||||
|
||||
@@ -152,7 +152,7 @@
|
||||
update_head_accessory()
|
||||
if(internal && !get_organ_slot("breathing_tube"))
|
||||
internal = null
|
||||
update_internals_hud_icon(0)
|
||||
update_action_buttons_icon()
|
||||
wear_mask_update(I, toggle_off = FALSE)
|
||||
sec_hud_set_ID()
|
||||
update_inv_wear_mask()
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
/mob/living/carbon/human/Life()
|
||||
fire_alert = 0 //Reset this here, because both breathe() and handle_environment() have a chance to set it.
|
||||
life_tick++
|
||||
|
||||
voice = GetVoice()
|
||||
@@ -239,61 +238,38 @@
|
||||
chest.add_autopsy_data("Radiation Poisoning", autopsy_damage)
|
||||
|
||||
/mob/living/carbon/human/breathe()
|
||||
if(!species.breathe(src))
|
||||
..()
|
||||
|
||||
if((NO_BREATH in mutations) || (NO_BREATHE in species.species_traits) || reagents.has_reagent("lexorin"))
|
||||
adjustOxyLoss(-5)
|
||||
oxygen_alert = 0
|
||||
toxins_alert = 0
|
||||
return
|
||||
if(istype(loc, /obj/machinery/atmospherics/unary/cryo_cell))
|
||||
return
|
||||
/mob/living/carbon/human/check_breath(datum/gas_mixture/breath)
|
||||
|
||||
var/datum/gas_mixture/environment
|
||||
if(loc)
|
||||
environment = loc.return_air()
|
||||
var/obj/item/organ/internal/L = get_organ_slot("lungs")
|
||||
|
||||
var/datum/gas_mixture/breath
|
||||
if(!L || L && (L.status & ORGAN_DEAD))
|
||||
if(health >= config.health_threshold_crit)
|
||||
adjustOxyLoss(HUMAN_MAX_OXYLOSS + 1)
|
||||
else
|
||||
adjustOxyLoss(HUMAN_CRIT_MAX_OXYLOSS)
|
||||
|
||||
if(health <= config.health_threshold_crit)
|
||||
AdjustLoseBreath(1)
|
||||
failed_last_breath = TRUE
|
||||
|
||||
if(losebreath > 0)
|
||||
AdjustLoseBreath(-1)
|
||||
if(prob(10))
|
||||
emote("gasp")
|
||||
if(istype(loc, /obj/))
|
||||
var/obj/loc_as_obj = loc
|
||||
loc_as_obj.handle_internal_lifeform(src, 0)
|
||||
if(species)
|
||||
var/datum/species/S = species
|
||||
|
||||
if(S.breathid == "o2")
|
||||
throw_alert("not_enough_oxy", /obj/screen/alert/not_enough_oxy)
|
||||
else if(S.breathid == "tox")
|
||||
throw_alert("not_enough_tox", /obj/screen/alert/not_enough_tox)
|
||||
else if(S.breathid == "co2")
|
||||
throw_alert("not_enough_co2", /obj/screen/alert/not_enough_co2)
|
||||
else if(S.breathid == "n2")
|
||||
throw_alert("not_enough_nitro", /obj/screen/alert/not_enough_nitro)
|
||||
|
||||
return FALSE
|
||||
else
|
||||
breath = get_breath_from_internal(BREATH_VOLUME)
|
||||
|
||||
if(!breath)
|
||||
if(isobj(loc)) //Breathe from loc as object
|
||||
var/obj/loc_as_obj = loc
|
||||
breath = loc_as_obj.handle_internal_lifeform(src, BREATH_MOLES)
|
||||
|
||||
else if(isturf(loc)) //Breathe from loc as turf
|
||||
var/breath_moles = 0
|
||||
if(environment)
|
||||
breath_moles = environment.total_moles()*BREATH_PERCENTAGE
|
||||
|
||||
breath = loc.remove_air(breath_moles)
|
||||
|
||||
if(!is_lung_ruptured()) // THIS FUCKING EXCERPT, THIS LITTLE FUCKING EXCERPT, SNOWFLAKED
|
||||
if(!breath || breath.total_moles() < BREATH_MOLES / 5 || breath.total_moles() > BREATH_MOLES * 5) // RIGHT IN THE CENTER OF THE FUCKING BREATHE PROC
|
||||
if(prob(5)) // IT IS THE ONLY FUCKING REASONS HUMAN OVERRIDE breathe()
|
||||
rupture_lung() // GOD FUCKING DAMNIT
|
||||
|
||||
else //Breathe from loc as obj again
|
||||
if(istype(loc, /obj/))
|
||||
var/obj/loc_as_obj = loc
|
||||
loc_as_obj.handle_internal_lifeform(src,0)
|
||||
|
||||
check_breath(breath)
|
||||
|
||||
if(breath)
|
||||
loc.assume_air(breath)
|
||||
|
||||
if(istype(L, /obj/item/organ/internal/lungs))
|
||||
var/obj/item/organ/internal/lungs/lun = L
|
||||
lun.check_breath(breath, src)
|
||||
|
||||
// USED IN DEATHWHISPERS
|
||||
/mob/living/carbon/human/proc/isInCrit()
|
||||
@@ -324,45 +300,13 @@
|
||||
|
||||
if(null_internals) //something wants internals gone
|
||||
internal = null //so do it
|
||||
|
||||
update_action_buttons_icon()
|
||||
|
||||
if(internal) //check for hud updates every time this is called
|
||||
update_internals_hud_icon(1)
|
||||
return internal.remove_air_volume(volume_needed) //returns the valid air
|
||||
else
|
||||
update_internals_hud_icon(0)
|
||||
|
||||
return null
|
||||
|
||||
/mob/living/carbon/human/check_breath(var/datum/gas_mixture/breath)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
|
||||
if(!breath || (breath.total_moles() == 0) || suiciding)
|
||||
var/oxyloss = 0
|
||||
if(suiciding)
|
||||
oxyloss = 2
|
||||
adjustOxyLoss(oxyloss)//If you are suiciding, you should die a little bit faster
|
||||
failed_last_breath = 1
|
||||
oxygen_alert = max(oxygen_alert, 1)
|
||||
return 0
|
||||
if(health > 0)
|
||||
oxyloss = HUMAN_MAX_OXYLOSS
|
||||
adjustOxyLoss(oxyloss)
|
||||
failed_last_breath = 1
|
||||
else
|
||||
oxyloss = HUMAN_CRIT_MAX_OXYLOSS
|
||||
adjustOxyLoss(oxyloss)
|
||||
failed_last_breath = 1
|
||||
|
||||
var/obj/item/organ/external/affected = get_organ("chest")
|
||||
affected.add_autopsy_data("Suffocation", oxyloss)
|
||||
throw_alert("oxy", /obj/screen/alert/oxy)
|
||||
|
||||
return 0
|
||||
|
||||
return species.handle_breath(breath, src)
|
||||
|
||||
/mob/living/carbon/human/handle_environment(datum/gas_mixture/environment)
|
||||
if(!environment)
|
||||
return
|
||||
@@ -391,7 +335,7 @@
|
||||
if(bodytemperature > species.heat_level_1)
|
||||
//Body temperature is too hot.
|
||||
if(status_flags & GODMODE) return 1 //godmode
|
||||
var/mult = species.hot_env_multiplier
|
||||
var/mult = species.heatmod
|
||||
|
||||
if(bodytemperature >= species.heat_level_1 && bodytemperature <= species.heat_level_2)
|
||||
throw_alert("temp", /obj/screen/alert/hot, 1)
|
||||
@@ -413,7 +357,7 @@
|
||||
return 1
|
||||
|
||||
if(!istype(loc, /obj/machinery/atmospherics/unary/cryo_cell))
|
||||
var/mult = species.cold_env_multiplier
|
||||
var/mult = species.coldmod
|
||||
if(bodytemperature >= species.cold_level_2 && bodytemperature <= species.cold_level_1)
|
||||
throw_alert("temp", /obj/screen/alert/cold, 1)
|
||||
take_overall_damage(burn=mult*COLD_DAMAGE_LEVEL_1, used_weapon = "Low Body Temperature")
|
||||
@@ -436,7 +380,7 @@
|
||||
if(status_flags & GODMODE) return 1 //godmode
|
||||
|
||||
if(adjusted_pressure >= species.hazard_high_pressure)
|
||||
if(!(RESIST_HEAT in mutations))
|
||||
if(!(HEATRES in mutations))
|
||||
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")
|
||||
throw_alert("pressure", /obj/screen/alert/highpressure, 2)
|
||||
@@ -449,7 +393,7 @@
|
||||
else if(adjusted_pressure >= species.hazard_low_pressure)
|
||||
throw_alert("pressure", /obj/screen/alert/lowpressure, 1)
|
||||
else
|
||||
if(RESIST_COLD in mutations)
|
||||
if(COLDRES in mutations)
|
||||
clear_alert("pressure")
|
||||
else
|
||||
take_overall_damage(brute=LOW_PRESSURE_DAMAGE, used_weapon = "Low Pressure")
|
||||
@@ -460,7 +404,7 @@
|
||||
/mob/living/carbon/human/handle_fire()
|
||||
if(..())
|
||||
return
|
||||
if(RESIST_HEAT in mutations)
|
||||
if(HEATRES in mutations)
|
||||
return
|
||||
if(on_fire)
|
||||
var/thermal_protection = get_thermal_protection()
|
||||
@@ -524,7 +468,7 @@
|
||||
|
||||
/mob/living/carbon/human/proc/get_heat_protection(temperature) //Temperature is the temperature you're being exposed to.
|
||||
|
||||
if(RESIST_HEAT in mutations)
|
||||
if(HEATRES in mutations)
|
||||
return 1
|
||||
|
||||
var/thermal_protection_flags = get_heat_protection_flags(temperature)
|
||||
@@ -585,7 +529,7 @@
|
||||
|
||||
/mob/living/carbon/human/proc/get_cold_protection(temperature)
|
||||
|
||||
if(RESIST_COLD in mutations)
|
||||
if(COLDRES in mutations)
|
||||
return 1 //Fully protected from the cold.
|
||||
|
||||
temperature = max(temperature, 2.7) //There is an occasional bug where the temperature is miscalculated in ares with a small amount of gas on them, so this is necessary to ensure that that bug does not affect this calculation. Space's temperature is 2.7K and most suits that are intended to protect against any cold, protect down to 2.0K.
|
||||
|
||||
@@ -86,9 +86,14 @@
|
||||
return real_name
|
||||
|
||||
/mob/living/carbon/human/IsVocal()
|
||||
// how do species that don't breathe talk? magic, that's what.
|
||||
var/breathes = (!(NO_BREATHE in species.species_traits))
|
||||
var/obj/item/organ/internal/L = get_organ_slot("lungs")
|
||||
if((breathes && !L) || breathes && L && (L.status & ORGAN_DEAD))
|
||||
return FALSE
|
||||
if(mind)
|
||||
return !mind.miming
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/mob/living/carbon/human/proc/SetSpecialVoice(var/new_voice)
|
||||
if(new_voice)
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
eyes = "blank_eyes"
|
||||
has_organ = list(
|
||||
"heart" = /obj/item/organ/internal/heart,
|
||||
"lungs" = /obj/item/organ/internal/lungs,
|
||||
"liver" = /obj/item/organ/internal/liver,
|
||||
"kidneys" = /obj/item/organ/internal/kidneys,
|
||||
"brain" = /obj/item/organ/internal/brain,
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
heat_level_1 = 999999999
|
||||
heat_level_2 = 999999999
|
||||
heat_level_3 = 999999999
|
||||
heat_level_3_breathe = 999999999
|
||||
|
||||
blood_color = "#515573"
|
||||
flesh_color = "#137E8F"
|
||||
|
||||
@@ -14,8 +14,7 @@
|
||||
|
||||
butt_sprite = "plasma"
|
||||
|
||||
breath_type = "plasma"
|
||||
poison_type = null //Certainly isn't plasma.
|
||||
breathid = "tox"
|
||||
|
||||
heat_level_1 = 350 // Heat damage level 1 above this point.
|
||||
heat_level_2 = 400 // Heat damage level 2 above this point.
|
||||
@@ -29,6 +28,16 @@
|
||||
"realizes the existential problem of being made out of plasma!",
|
||||
"shows their true colors, which happens to be the color of plasma!")
|
||||
|
||||
has_organ = list(
|
||||
"heart" = /obj/item/organ/internal/heart,
|
||||
"lungs" = /obj/item/organ/internal/lungs/plasmaman,
|
||||
"liver" = /obj/item/organ/internal/liver,
|
||||
"kidneys" = /obj/item/organ/internal/kidneys,
|
||||
"brain" = /obj/item/organ/internal/brain,
|
||||
"appendix" = /obj/item/organ/internal/appendix,
|
||||
"eyes" = /obj/item/organ/internal/eyes
|
||||
)
|
||||
|
||||
/datum/species/plasmaman/say_filter(mob/M, message, datum/language/speaking)
|
||||
if(copytext(message, 1, 2) != "*")
|
||||
message = replacetext(message, "s", stutter("ss"))
|
||||
@@ -146,109 +155,7 @@
|
||||
H.equip_or_collect(new /obj/item/weapon/plasmensuit_cartridge(H), slot_in_backpack) //Two refill cartridges for their suit. Can fit in boxes.
|
||||
to_chat(H, "<span class='notice'>You are now running on plasma internals from the [H.s_store] in your [tank_slot_name]. You must breathe plasma in order to survive, and are extremely flammable.</span>")
|
||||
H.internal = H.get_item_by_slot(tank_slot)
|
||||
H.update_internals_hud_icon(1)
|
||||
|
||||
// Plasmamen are so fucking different that they need their own proc.
|
||||
/datum/species/plasmaman/handle_breath(var/datum/gas_mixture/breath, var/mob/living/carbon/human/H)
|
||||
var/safe_plasma_min = 16 // Minimum safe partial pressure of PLASMA, in kPa
|
||||
//var/safe_oxygen_max = 140 // Maximum safe partial pressure of PLASMA, in kPa (Not used for now)
|
||||
var/safe_co2_max = 10 // Yes it's an arbitrary value who cares?
|
||||
var/SA_para_min = 1
|
||||
var/SA_sleep_min = 5
|
||||
var/plasma_used = 0
|
||||
var/nitrogen_used = 0
|
||||
var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
|
||||
|
||||
// Partial pressure of plasma
|
||||
var/Toxins_pp = (breath.toxins/breath.total_moles())*breath_pressure
|
||||
// And CO2, lets say a PP of more than 10 will be bad (It's a little less really, but eh, being passed out all round aint no fun)
|
||||
var/CO2_pp = (breath.carbon_dioxide/breath.total_moles())*breath_pressure // Tweaking to fit the hacky bullshit I've done with atmo -- TLE
|
||||
|
||||
if(Toxins_pp < safe_plasma_min)
|
||||
if(prob(20))
|
||||
H.emote("gasp")
|
||||
if(Toxins_pp > 0)
|
||||
var/ratio = safe_plasma_min/Toxins_pp
|
||||
H.adjustOxyLoss(min(5*ratio, HUMAN_MAX_OXYLOSS)) // Don't fuck them up too fast (space only does HUMAN_MAX_OXYLOSS after all!)
|
||||
H.failed_last_breath = 1
|
||||
plasma_used = breath.toxins*ratio/6
|
||||
else
|
||||
H.adjustOxyLoss(HUMAN_MAX_OXYLOSS)
|
||||
H.failed_last_breath = 1
|
||||
H.oxygen_alert = max(H.oxygen_alert, 1)
|
||||
|
||||
else // We're in safe limits
|
||||
H.failed_last_breath = 0
|
||||
H.adjustOxyLoss(-5)
|
||||
plasma_used = breath.toxins/6
|
||||
H.oxygen_alert = 0
|
||||
|
||||
breath.toxins -= plasma_used
|
||||
breath.nitrogen -= nitrogen_used
|
||||
breath.carbon_dioxide += plasma_used
|
||||
|
||||
//CO2 does not affect failed_last_breath. So if there was enough oxygen in the air but too much co2, this will hurt you, but only once per 4 ticks, instead of once per tick.
|
||||
if(CO2_pp > safe_co2_max)
|
||||
if(!H.co2overloadtime) // If it's the first breath with too much CO2 in it, lets start a counter, then have them pass out after 12s or so.
|
||||
H.co2overloadtime = world.time
|
||||
else if(world.time - H.co2overloadtime > 120)
|
||||
H.Paralyse(3)
|
||||
H.adjustOxyLoss(3) // Lets hurt em a little, let them know we mean business
|
||||
if(world.time - H.co2overloadtime > 300) // They've been in here 30s now, lets start to kill them for their own good!
|
||||
H.adjustOxyLoss(8)
|
||||
if(prob(20)) // Lets give them some chance to know somethings not right though I guess.
|
||||
H.emote("cough")
|
||||
|
||||
else
|
||||
H.co2overloadtime = 0
|
||||
|
||||
if(breath.trace_gases.len) // If there's some other shit in the air lets deal with it here.
|
||||
for(var/datum/gas/sleeping_agent/SA in breath.trace_gases)
|
||||
var/SA_pp = (SA.moles/breath.total_moles())*breath_pressure
|
||||
if(SA_pp > SA_para_min) // Enough to make us paralysed for a bit
|
||||
H.Paralyse(3) // 3 gives them one second to wake up and run away a bit!
|
||||
if(SA_pp > SA_sleep_min) // Enough to make us sleep as well
|
||||
H.AdjustSleeping(8, bound_lower = 0, bound_upper = 10)
|
||||
else if(SA_pp > 0.15) // There is sleeping gas in their lungs, but only a little, so give them a bit of a warning
|
||||
if(prob(20))
|
||||
H.emote(pick("giggle", "laugh"))
|
||||
SA.moles = 0
|
||||
|
||||
if(abs(310.15 - breath.temperature) > 50) // Hot air hurts :(
|
||||
if(H.status_flags & GODMODE)
|
||||
return 1 //godmode
|
||||
if(breath.temperature < cold_level_1)
|
||||
if(prob(20))
|
||||
to_chat(src, "<span class='warning'>You feel your face freezing and an icicle forming in your lungs!</span>")
|
||||
else if(breath.temperature > heat_level_1)
|
||||
if(prob(20))
|
||||
to_chat(src, "<span class='warning'>You feel your face burning and a searing heat in your lungs!</span>")
|
||||
|
||||
switch(breath.temperature)
|
||||
if(-INFINITY to cold_level_3)
|
||||
H.apply_damage(COLD_GAS_DAMAGE_LEVEL_3, BURN, "head", used_weapon = "Excessive Cold")
|
||||
H.fire_alert = max(H.fire_alert, 1)
|
||||
|
||||
if(cold_level_3 to cold_level_2)
|
||||
H.apply_damage(COLD_GAS_DAMAGE_LEVEL_2, BURN, "head", used_weapon = "Excessive Cold")
|
||||
H.fire_alert = max(H.fire_alert, 1)
|
||||
|
||||
if(cold_level_2 to cold_level_1)
|
||||
H.apply_damage(COLD_GAS_DAMAGE_LEVEL_1, BURN, "head", used_weapon = "Excessive Cold")
|
||||
H.fire_alert = max(H.fire_alert, 1)
|
||||
|
||||
if(heat_level_1 to heat_level_2)
|
||||
H.apply_damage(HEAT_GAS_DAMAGE_LEVEL_1, BURN, "head", used_weapon = "Excessive Heat")
|
||||
H.fire_alert = max(H.fire_alert, 2)
|
||||
|
||||
if(heat_level_2 to heat_level_3)
|
||||
H.apply_damage(HEAT_GAS_DAMAGE_LEVEL_2, BURN, "head", used_weapon = "Excessive Heat")
|
||||
H.fire_alert = max(H.fire_alert, 2)
|
||||
|
||||
if(heat_level_3 to INFINITY)
|
||||
H.apply_damage(HEAT_GAS_DAMAGE_LEVEL_3, BURN, "head", used_weapon = "Excessive Heat")
|
||||
H.fire_alert = max(H.fire_alert, 2)
|
||||
return 1
|
||||
H.update_action_buttons_icon()
|
||||
|
||||
/datum/species/plasmaman/handle_life(var/mob/living/carbon/human/H)
|
||||
if(!istype(H.wear_suit, /obj/item/clothing/suit/space/eva/plasmaman) || !istype(H.head, /obj/item/clothing/head/helmet/space/eva/plasmaman))
|
||||
@@ -264,6 +171,7 @@
|
||||
if(istype(P))
|
||||
P.Extinguish(H)
|
||||
H.update_fire()
|
||||
..()
|
||||
|
||||
/datum/species/plasmaman/handle_reagents(var/mob/living/carbon/human/H, var/datum/reagent/R)
|
||||
if(R.id == "plasma")
|
||||
|
||||
@@ -70,4 +70,5 @@
|
||||
H.throw_alert("lightexposure", /obj/screen/alert/lightexposure)
|
||||
else if(light_amount < 2) //heal in the dark
|
||||
H.heal_overall_damage(1,1)
|
||||
H.clear_alert("lightexposure")
|
||||
H.clear_alert("lightexposure")
|
||||
..()
|
||||
@@ -32,7 +32,6 @@
|
||||
heat_level_1 = 999999999
|
||||
heat_level_2 = 999999999
|
||||
heat_level_3 = 999999999
|
||||
heat_level_3_breathe = 999999999
|
||||
|
||||
suicide_messages = list(
|
||||
"is snapping their own bones!",
|
||||
|
||||
@@ -26,20 +26,15 @@
|
||||
var/slowdown = 0 // Passive movement speed malus (or boost, if negative)
|
||||
var/silent_steps = 0 // Stops step noises
|
||||
|
||||
var/breath_type = "oxygen" // Non-oxygen gas breathed, if any.
|
||||
var/poison_type = "plasma" // Poisonous air.
|
||||
var/exhale_type = "carbon_dioxide" // Exhaled gas type.
|
||||
|
||||
var/cold_level_1 = 260 // Cold damage level 1 below this point.
|
||||
var/cold_level_2 = 200 // Cold damage level 2 below this point.
|
||||
var/cold_level_3 = 120 // Cold damage level 3 below this point.
|
||||
var/cold_env_multiplier = 1 // Damage multiplier for being in a cold environment
|
||||
var/coldmod = 1 // Damage multiplier for being in a cold environment
|
||||
|
||||
var/heat_level_1 = 360 // Heat damage level 1 above this point.
|
||||
var/heat_level_2 = 400 // Heat damage level 2 above this point.
|
||||
var/heat_level_3 = 460 // Heat damage level 3 above this point; used for body temperature
|
||||
var/hot_env_multiplier = 1 // Damage multiplier for being in a hot environment
|
||||
var/heat_level_3_breathe = 1000 // Heat damage level 3 above this point; used for breathed air temperature
|
||||
var/heatmod = 1 // Damage multiplier for being in a hot environment
|
||||
|
||||
var/body_temperature = 310.15 //non-IS_SYNTHETIC species will try to stabilize at this temperature. (also affects temperature processing)
|
||||
var/reagent_tag //Used for metabolizing reagents.
|
||||
@@ -56,19 +51,6 @@
|
||||
var/warning_low_pressure = WARNING_LOW_PRESSURE // Low pressure warning.
|
||||
var/hazard_low_pressure = HAZARD_LOW_PRESSURE // Dangerously low pressure.
|
||||
|
||||
var/list/atmos_requirements = list(
|
||||
"min_oxy" = 16,
|
||||
"max_oxy" = 0,
|
||||
"min_nitro" = 0,
|
||||
"max_nitro" = 0,
|
||||
"min_tox" = 0,
|
||||
"max_tox" = 0.005,
|
||||
"min_co2" = 0,
|
||||
"max_co2" = 10,
|
||||
"sa_para" = 1,
|
||||
"sa_sleep" = 5
|
||||
)
|
||||
|
||||
var/brute_mod = 1 // Physical damage reduction/amplification
|
||||
var/burn_mod = 1 // Burn damage reduction/amplification
|
||||
var/tox_mod = 1 // Toxin damage reduction/amplification
|
||||
@@ -94,6 +76,8 @@
|
||||
|
||||
var/list/species_traits = list()
|
||||
|
||||
var/breathid = "o2"
|
||||
|
||||
var/clothing_flags = 0 // Underwear and socks.
|
||||
var/exotic_blood
|
||||
var/bodyflags = 0
|
||||
@@ -211,171 +195,9 @@
|
||||
for(var/obj/item/organ/external/O in H.bodyparts)
|
||||
O.owner = H
|
||||
|
||||
/datum/species/proc/handle_breath(var/datum/gas_mixture/breath, var/mob/living/carbon/human/H)
|
||||
var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
|
||||
|
||||
var/O2_used = 0
|
||||
var/N2_used = 0
|
||||
var/Tox_used = 0
|
||||
var/CO2_used = 0
|
||||
|
||||
//Partial pressure of the O2 in our breath
|
||||
var/O2_pp = (breath.oxygen/breath.total_moles()) * breath_pressure
|
||||
// Partial pressure of Nitrogen
|
||||
var/N2_pp = (breath.nitrogen/breath.total_moles()) * breath_pressure
|
||||
// Partial pressure of plasma
|
||||
var/Tox_pp = (breath.toxins/breath.total_moles()) * breath_pressure
|
||||
// Partial pressure of CO2
|
||||
var/CO2_pp = (breath.carbon_dioxide/breath.total_moles()) * breath_pressure
|
||||
|
||||
if(O2_pp < atmos_requirements["min_oxy"])
|
||||
if(prob(20))
|
||||
H.emote("gasp")
|
||||
|
||||
H.failed_last_breath = 1
|
||||
if(O2_pp > 0)
|
||||
var/ratio = atmos_requirements["min_oxy"] / O2_pp
|
||||
H.adjustOxyLoss(min(5 * ratio, HUMAN_MAX_OXYLOSS))
|
||||
else
|
||||
H.adjustOxyLoss(HUMAN_MAX_OXYLOSS)
|
||||
H.throw_alert("oxy", /obj/screen/alert/oxy)
|
||||
else if(atmos_requirements["max_oxy"] && O2_pp > atmos_requirements["max_oxy"])
|
||||
var/ratio = (breath.oxygen / atmos_requirements["max_oxy"]) * 1000
|
||||
H.adjustToxLoss(Clamp(ratio, MIN_PLASMA_DAMAGE, MAX_PLASMA_DAMAGE))
|
||||
H.throw_alert("oxy", /obj/screen/alert/too_much_oxy)
|
||||
else
|
||||
H.clear_alert("oxy")
|
||||
if(atmos_requirements["min_oxy"]) //species breathes this gas, so, they got their air
|
||||
H.failed_last_breath = 0
|
||||
H.adjustOxyLoss(-5)
|
||||
O2_used = breath.oxygen / 6
|
||||
|
||||
if(N2_pp < atmos_requirements["min_nitro"])
|
||||
if(prob(20))
|
||||
H.emote("gasp")
|
||||
|
||||
H.failed_last_breath = 1
|
||||
if(N2_pp > 0)
|
||||
var/ratio = atmos_requirements["min_nitro"] / N2_pp
|
||||
H.adjustOxyLoss(min(5 * ratio, HUMAN_MAX_OXYLOSS))
|
||||
else
|
||||
H.adjustOxyLoss(HUMAN_MAX_OXYLOSS)
|
||||
H.throw_alert("nitro", /obj/screen/alert/nitro)
|
||||
else if(atmos_requirements["max_nitro"] && N2_pp > atmos_requirements["max_nitro"])
|
||||
var/ratio = (breath.nitrogen / atmos_requirements["max_nitro"]) * 1000
|
||||
H.adjustToxLoss(Clamp(ratio, MIN_PLASMA_DAMAGE, MAX_PLASMA_DAMAGE))
|
||||
H.throw_alert("nitro", /obj/screen/alert/too_much_nitro)
|
||||
else
|
||||
H.clear_alert("nitro")
|
||||
if(atmos_requirements["min_nitro"]) //species breathes this gas, so they got their air
|
||||
H.failed_last_breath = 0
|
||||
H.adjustOxyLoss(-5)
|
||||
N2_used = breath.nitrogen / 6
|
||||
|
||||
if(Tox_pp < atmos_requirements["min_tox"])
|
||||
if(prob(20))
|
||||
H.emote("gasp")
|
||||
|
||||
H.failed_last_breath = 1
|
||||
if(Tox_pp > 0)
|
||||
var/ratio = atmos_requirements["min_tox"] / Tox_pp
|
||||
H.adjustOxyLoss(min(5 * ratio, HUMAN_MAX_OXYLOSS))
|
||||
else
|
||||
H.adjustOxyLoss(HUMAN_MAX_OXYLOSS)
|
||||
H.throw_alert("tox_in_air", /obj/screen/alert/not_enough_tox)
|
||||
else if(atmos_requirements["max_tox"] && Tox_pp > atmos_requirements["max_tox"])
|
||||
var/ratio = (breath.toxins / atmos_requirements["max_tox"]) * 10
|
||||
if(H.reagents)
|
||||
H.reagents.add_reagent("plasma", Clamp(ratio, MIN_PLASMA_DAMAGE, MAX_PLASMA_DAMAGE))
|
||||
H.throw_alert("tox_in_air", /obj/screen/alert/tox_in_air)
|
||||
else
|
||||
H.clear_alert("tox_in_air")
|
||||
if(atmos_requirements["min_tox"]) //species breathes this gas, so, they got their air
|
||||
H.failed_last_breath = 0
|
||||
H.adjustOxyLoss(-5)
|
||||
Tox_used = breath.toxins / 6
|
||||
|
||||
if(CO2_pp < atmos_requirements["min_co2"])
|
||||
if(prob(20))
|
||||
H.emote("gasp")
|
||||
|
||||
H.failed_last_breath = 1
|
||||
if(CO2_pp)
|
||||
var/ratio = atmos_requirements["min_co2"] / CO2_pp
|
||||
H.adjustOxyLoss(min(5 * ratio, HUMAN_MAX_OXYLOSS))
|
||||
else
|
||||
H.adjustOxyLoss(HUMAN_MAX_OXYLOSS)
|
||||
H.throw_alert("co2", /obj/screen/alert/not_enough_co2)
|
||||
else if(atmos_requirements["max_co2"] && CO2_pp > atmos_requirements["max_co2"])
|
||||
if(!H.co2overloadtime) // If it's the first breath with too much CO2 in it, lets start a counter, then have them pass out after 12s or so.
|
||||
H.co2overloadtime = world.time
|
||||
else if(world.time - H.co2overloadtime > 120)
|
||||
H.Paralyse(5)
|
||||
H.adjustOxyLoss(3) // Lets hurt em a little, let them know we mean business
|
||||
if(world.time - H.co2overloadtime > 300) // They've been in here 30s now, lets start to kill them for their own good!
|
||||
H.adjustOxyLoss(8)
|
||||
if(prob(20)) // Lets give them some chance to know somethings not right though I guess.
|
||||
H.emote("cough")
|
||||
else
|
||||
H.clear_alert("co2")
|
||||
H.co2overloadtime = 0
|
||||
if(atmos_requirements["min_co2"]) //species breathes this gas, so they got their air
|
||||
H.failed_last_breath = 0
|
||||
H.adjustOxyLoss(-5)
|
||||
CO2_used = breath.carbon_dioxide / 6
|
||||
|
||||
breath.oxygen -= O2_used
|
||||
breath.nitrogen -= N2_used
|
||||
breath.toxins -= Tox_used
|
||||
breath.carbon_dioxide -= CO2_used
|
||||
breath.carbon_dioxide += O2_used
|
||||
|
||||
|
||||
if(breath.trace_gases.len) // If there's some other shit in the air lets deal with it here.
|
||||
for(var/datum/gas/sleeping_agent/SA in breath.trace_gases)
|
||||
var/SA_pp = (SA.moles / breath.total_moles()) * breath_pressure
|
||||
if(SA_pp > atmos_requirements["sa_para"]) // Enough to make us paralysed for a bit
|
||||
H.Paralyse(3) // 3 gives them one second to wake up and run away a bit!
|
||||
if(SA_pp > atmos_requirements["sa_sleep"]) // Enough to make us sleep as well
|
||||
// This value is large because breaths are taken only once every 4 life ticks.
|
||||
H.AdjustSleeping(8, bound_lower = 0, bound_upper = 10)
|
||||
else if(SA_pp > 0.01) // There is sleeping gas in their lungs, but only a little, so give them a bit of a warning
|
||||
if(prob(20))
|
||||
H.emote(pick("giggle", "laugh"))
|
||||
|
||||
handle_temperature(breath, H)
|
||||
return 1
|
||||
|
||||
/datum/species/proc/handle_temperature(datum/gas_mixture/breath, var/mob/living/carbon/human/H) // called by human/life, handles temperatures
|
||||
if(abs(310.15 - breath.temperature) > 50) // Hot air hurts :(
|
||||
if(H.status_flags & GODMODE) return 1 //godmode
|
||||
if(breath.temperature < cold_level_1)
|
||||
if(prob(20))
|
||||
to_chat(H, "<span class='warning'>You feel your face freezing and an icicle forming in your lungs!</span>")
|
||||
else if(breath.temperature > heat_level_1)
|
||||
if(prob(20))
|
||||
to_chat(H, "<span class='warning'>You feel your face burning and a searing heat in your lungs!</span>")
|
||||
|
||||
|
||||
|
||||
switch(breath.temperature)
|
||||
if(-INFINITY to cold_level_3)
|
||||
H.apply_damage(cold_env_multiplier*COLD_GAS_DAMAGE_LEVEL_3, BURN, "head", used_weapon = "Excessive Cold")
|
||||
|
||||
if(cold_level_3 to cold_level_2)
|
||||
H.apply_damage(cold_env_multiplier*COLD_GAS_DAMAGE_LEVEL_2, BURN, "head", used_weapon = "Excessive Cold")
|
||||
|
||||
if(cold_level_2 to cold_level_1)
|
||||
H.apply_damage(cold_env_multiplier*COLD_GAS_DAMAGE_LEVEL_1, BURN, "head", used_weapon = "Excessive Cold")
|
||||
|
||||
if(heat_level_1 to heat_level_2)
|
||||
H.apply_damage(hot_env_multiplier*HEAT_GAS_DAMAGE_LEVEL_1, BURN, "head", used_weapon = "Excessive Heat")
|
||||
|
||||
if(heat_level_2 to heat_level_3_breathe)
|
||||
H.apply_damage(hot_env_multiplier*HEAT_GAS_DAMAGE_LEVEL_2, BURN, "head", used_weapon = "Excessive Heat")
|
||||
|
||||
if(heat_level_3_breathe to INFINITY)
|
||||
H.apply_damage(hot_env_multiplier*HEAT_GAS_DAMAGE_LEVEL_3, BURN, "head", used_weapon = "Excessive Heat")
|
||||
/datum/species/proc/breathe(mob/living/carbon/human/H)
|
||||
if((NO_BREATHE in species_traits) || (BREATHLESS in H.mutations))
|
||||
return TRUE
|
||||
|
||||
////////////////
|
||||
// MOVE SPEED //
|
||||
@@ -477,7 +299,9 @@
|
||||
// For special snowflake species effects
|
||||
// (Slime People changing color based on the reagents they consume)
|
||||
/datum/species/proc/handle_life(var/mob/living/carbon/human/H)
|
||||
return 1
|
||||
if((NO_BREATHE in species_traits) || (BREATHLESS in H.mutations))
|
||||
H.setOxyLoss(0)
|
||||
H.SetLoseBreath(0)
|
||||
|
||||
/datum/species/proc/handle_dna(var/mob/living/carbon/C, var/remove) //Handles DNA mutations, as that doesn't work at init. Make sure you call genemutcheck on any blocks changed here
|
||||
return
|
||||
|
||||
@@ -50,7 +50,6 @@
|
||||
heat_level_1 = 380 //Default 360 - Higher is better
|
||||
heat_level_2 = 420 //Default 400
|
||||
heat_level_3 = 480 //Default 460
|
||||
heat_level_3_breathe = 1100 //Default 1000
|
||||
|
||||
flesh_color = "#34AF10"
|
||||
reagent_tag = PROCESS_ORG
|
||||
@@ -106,7 +105,6 @@
|
||||
heat_level_1 = 340
|
||||
heat_level_2 = 380
|
||||
heat_level_3 = 440
|
||||
heat_level_3_breathe = 900
|
||||
|
||||
primitive_form = "Farwa"
|
||||
|
||||
@@ -276,24 +274,10 @@
|
||||
cold_level_2 = 50
|
||||
cold_level_3 = 0
|
||||
|
||||
atmos_requirements = list(
|
||||
"min_oxy" = 0,
|
||||
"max_oxy" = 1,
|
||||
"min_nitro" = 16,
|
||||
"max_nitro" = 0,
|
||||
"min_tox" = 0,
|
||||
"max_tox" = 0.005,
|
||||
"min_co2" = 0,
|
||||
"max_co2" = 10,
|
||||
"sa_para" = 1,
|
||||
"sa_sleep" = 5
|
||||
)
|
||||
breathid = "n2"
|
||||
|
||||
eyes = "vox_eyes_s"
|
||||
|
||||
breath_type = "nitrogen"
|
||||
poison_type = "oxygen"
|
||||
|
||||
species_traits = list(NO_SCAN, IS_WHITELISTED, NOTRANSSTING)
|
||||
clothing_flags = HAS_SOCKS
|
||||
dietflags = DIET_OMNI
|
||||
@@ -326,7 +310,7 @@
|
||||
|
||||
has_organ = list(
|
||||
"heart" = /obj/item/organ/internal/heart,
|
||||
"lungs" = /obj/item/organ/internal/lungs,
|
||||
"lungs" = /obj/item/organ/internal/lungs/vox,
|
||||
"liver" = /obj/item/organ/internal/liver/vox,
|
||||
"kidneys" = /obj/item/organ/internal/kidneys,
|
||||
"brain" = /obj/item/organ/internal/brain,
|
||||
@@ -368,7 +352,7 @@
|
||||
H.equip_or_collect(new /obj/item/weapon/tank/emergency_oxygen/vox(H), slot_l_hand)
|
||||
to_chat(H, "<span class='notice'>You are now running on nitrogen internals from the [H.l_hand] in your hand. Your species finds oxygen toxic, so you must breathe nitrogen only.</span>")
|
||||
H.internal = H.l_hand
|
||||
H.update_internals_hud_icon(1)
|
||||
H.update_action_buttons_icon()
|
||||
|
||||
/datum/species/vox/handle_post_spawn(var/mob/living/carbon/human/H)
|
||||
updatespeciescolor(H)
|
||||
@@ -438,14 +422,11 @@
|
||||
heat_level_1 = 2000
|
||||
heat_level_2 = 3000
|
||||
heat_level_3 = 4000
|
||||
heat_level_3_breathe = 4000
|
||||
|
||||
brute_mod = 0.2
|
||||
burn_mod = 0.2
|
||||
|
||||
eyes = "blank_eyes"
|
||||
breath_type = "nitrogen"
|
||||
poison_type = "oxygen"
|
||||
|
||||
species_traits = list(NO_SCAN, NO_BLOOD, NO_PAIN, IS_WHITELISTED)
|
||||
bodyflags = HAS_TAIL
|
||||
@@ -461,7 +442,7 @@
|
||||
|
||||
has_organ = list(
|
||||
"heart" = /obj/item/organ/internal/heart,
|
||||
"lungs" = /obj/item/organ/internal/lungs,
|
||||
"lungs" = /obj/item/organ/internal/lungs/vox,
|
||||
"liver" = /obj/item/organ/internal/liver,
|
||||
"kidneys" = /obj/item/organ/internal/kidneys,
|
||||
"brain" = /obj/item/organ/internal/brain,
|
||||
@@ -538,7 +519,7 @@
|
||||
cold_level_1 = 280
|
||||
cold_level_2 = 240
|
||||
cold_level_3 = 200
|
||||
cold_env_multiplier = 3
|
||||
coldmod = 3
|
||||
|
||||
oxy_mod = 0
|
||||
brain_mod = 2.5
|
||||
@@ -593,7 +574,7 @@
|
||||
E.sync_colour_to_human(H)
|
||||
H.update_hair(0)
|
||||
H.update_body()
|
||||
return ..()
|
||||
..()
|
||||
|
||||
#undef SLIMEPERSON_COLOR_SHIFT_TRIGGER
|
||||
#undef SLIMEPERSON_ICON_UPDATE_PERIOD
|
||||
@@ -789,7 +770,6 @@
|
||||
heat_level_1 = 300
|
||||
heat_level_2 = 340
|
||||
heat_level_3 = 400
|
||||
heat_level_3_breathe = 700
|
||||
|
||||
blurb = "Commonly referred to (erroneously) as 'plant people', the Dionaea are a strange space-dwelling collective \
|
||||
species hailing from Epsilon Ursae Minoris. Each 'diona' is a cluster of numerous cat-sized organisms called nymphs; \
|
||||
@@ -877,6 +857,7 @@
|
||||
H.adjustFireLoss(-(light_amount/4))
|
||||
if(H.nutrition < NUTRITION_LEVEL_STARVING+50)
|
||||
H.take_overall_damage(10,0)
|
||||
..()
|
||||
|
||||
/datum/species/machine
|
||||
name = "Machine"
|
||||
@@ -1012,13 +993,12 @@
|
||||
cold_level_1 = -1 //Default 260 - Lower is better
|
||||
cold_level_2 = -1 //Default 200
|
||||
cold_level_3 = -1 //Default 120
|
||||
cold_env_multiplier = -1
|
||||
coldmod = -1
|
||||
|
||||
heat_level_1 = 300 //Default 360 - Higher is better
|
||||
heat_level_2 = 340 //Default 400
|
||||
heat_level_3 = 400 //Default 460
|
||||
heat_level_3_breathe = 600 //Default 1000
|
||||
hot_env_multiplier = 2
|
||||
heatmod = 2
|
||||
|
||||
flesh_color = "#a3d4eb"
|
||||
reagent_tag = PROCESS_ORG
|
||||
@@ -1032,40 +1012,4 @@
|
||||
"metabolic strainer" = /obj/item/organ/internal/liver/drask,
|
||||
"eyes" = /obj/item/organ/internal/eyes/drask, //5 darksight.
|
||||
"brain" = /obj/item/organ/internal/brain/drask
|
||||
)
|
||||
|
||||
/datum/species/drask/handle_temperature(datum/gas_mixture/breath, var/mob/living/carbon/human/H)
|
||||
if( abs(310.15 - breath.temperature) > 50)
|
||||
if(H.status_flags & GODMODE) return 1 //godmode
|
||||
if(breath.temperature < 260)
|
||||
if(prob(20))
|
||||
to_chat(H, "<span class='notice'> You feel an invigorating coldness in your lungs!</span>")
|
||||
if(breath.temperature > heat_level_1)
|
||||
if(prob(20))
|
||||
to_chat(H, "<span class='warning'>You feel your face burning and a searing heat in your lungs!</span>")
|
||||
|
||||
switch(breath.temperature)
|
||||
|
||||
if(-INFINITY to 60)
|
||||
H.adjustFireLoss(cold_env_multiplier*COLD_GAS_DAMAGE_LEVEL_3*0.5) //3 points healed, applied every 4 ticks
|
||||
H.adjustBruteLoss(cold_env_multiplier*COLD_GAS_DAMAGE_LEVEL_3)
|
||||
H.throw_alert("temp", /obj/screen/alert/cold/drask, 3)
|
||||
|
||||
if(61 to 200)
|
||||
H.adjustFireLoss(cold_env_multiplier*COLD_GAS_DAMAGE_LEVEL_2*0.5) //1.5 healed every 4 ticks
|
||||
H.adjustBruteLoss(cold_env_multiplier*COLD_GAS_DAMAGE_LEVEL_2)
|
||||
H.throw_alert("temp", /obj/screen/alert/cold/drask, 2)
|
||||
|
||||
if(201 to 260)
|
||||
H.adjustFireLoss(cold_env_multiplier*COLD_GAS_DAMAGE_LEVEL_1*0.5) //0.5 healed every 4 ticks
|
||||
H.adjustBruteLoss(cold_env_multiplier*COLD_GAS_DAMAGE_LEVEL_1)
|
||||
H.throw_alert("temp", /obj/screen/alert/cold/drask, 1)
|
||||
|
||||
if(heat_level_1 to heat_level_2)
|
||||
H.apply_damage(hot_env_multiplier*HEAT_GAS_DAMAGE_LEVEL_1, BURN, "head", used_weapon = "Excessive Heat")
|
||||
|
||||
if(heat_level_2 to heat_level_3_breathe)
|
||||
H.apply_damage(hot_env_multiplier*HEAT_GAS_DAMAGE_LEVEL_2, BURN, "head", used_weapon = "Excessive Heat")
|
||||
|
||||
if(heat_level_3_breathe to INFINITY)
|
||||
H.apply_damage(hot_env_multiplier*HEAT_GAS_DAMAGE_LEVEL_3, BURN, "head", used_weapon = "Excessive Heat")
|
||||
)
|
||||
@@ -539,7 +539,7 @@ var/global/list/damage_icon_parts = list()
|
||||
if(LASER)
|
||||
standing.overlays += "lasereyes_s"
|
||||
add_image = 1
|
||||
if((RESIST_COLD in mutations) && (RESIST_HEAT in mutations))
|
||||
if((COLDRES in mutations) && (HEATRES in mutations))
|
||||
standing.underlays -= "cold[fat]_s"
|
||||
standing.underlays -= "fire[fat]_s"
|
||||
standing.underlays += "coldfire[fat]_s"
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
//Start of a breath chain, calls breathe()
|
||||
/mob/living/carbon/handle_breathing()
|
||||
if(mob_master.current_cycle%4==2 || failed_last_breath)
|
||||
if(mob_master.current_cycle % 4 == 2 || failed_last_breath)
|
||||
breathe() //Breathe per 4 ticks, unless suffocating
|
||||
else
|
||||
if(istype(loc, /obj/))
|
||||
@@ -40,8 +40,6 @@
|
||||
return
|
||||
if(istype(loc, /obj/machinery/atmospherics/unary/cryo_cell))
|
||||
return
|
||||
if(NO_BREATH in mutations)
|
||||
return // No breath mutation means no breathing.
|
||||
|
||||
var/datum/gas_mixture/environment
|
||||
if(loc)
|
||||
@@ -52,6 +50,7 @@
|
||||
if(health <= config.health_threshold_crit)
|
||||
AdjustLoseBreath(1)
|
||||
|
||||
//Suffocate
|
||||
if(losebreath > 0)
|
||||
AdjustLoseBreath(-1)
|
||||
if(prob(10))
|
||||
@@ -75,7 +74,6 @@
|
||||
breath_moles = environment.total_moles()*BREATH_PERCENTAGE
|
||||
|
||||
breath = loc.remove_air(breath_moles)
|
||||
|
||||
else //Breathe from loc as obj again
|
||||
if(istype(loc, /obj/))
|
||||
var/obj/loc_as_obj = loc
|
||||
@@ -90,14 +88,18 @@
|
||||
//Third link in a breath chain, calls handle_breath_temperature()
|
||||
/mob/living/carbon/proc/check_breath(datum/gas_mixture/breath)
|
||||
if(status_flags & GODMODE)
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
var/lungs = get_organ_slot("lungs")
|
||||
if(!lungs)
|
||||
adjustOxyLoss(2)
|
||||
|
||||
//CRIT
|
||||
if(!breath || (breath.total_moles() == 0))
|
||||
if(!breath || (breath.total_moles() == 0) || !lungs)
|
||||
adjustOxyLoss(1)
|
||||
failed_last_breath = 1
|
||||
throw_alert("oxy", /obj/screen/alert/oxy)
|
||||
return 0
|
||||
failed_last_breath = TRUE
|
||||
throw_alert("not_enough_oxy", /obj/screen/alert/not_enough_oxy)
|
||||
return FALSE
|
||||
|
||||
var/safe_oxy_min = 16
|
||||
var/safe_co2_max = 10
|
||||
@@ -117,20 +119,20 @@
|
||||
if(prob(20))
|
||||
emote("gasp")
|
||||
if(O2_partialpressure > 0)
|
||||
var/ratio = safe_oxy_min/O2_partialpressure
|
||||
var/ratio = 1 - O2_partialpressure/safe_oxy_min
|
||||
adjustOxyLoss(min(5*ratio, 3))
|
||||
failed_last_breath = 1
|
||||
oxygen_used = breath.oxygen*ratio/6
|
||||
failed_last_breath = TRUE
|
||||
oxygen_used = breath.oxygen*ratio
|
||||
else
|
||||
adjustOxyLoss(3)
|
||||
failed_last_breath = 1
|
||||
throw_alert("oxy", /obj/screen/alert/oxy)
|
||||
failed_last_breath = TRUE
|
||||
throw_alert("not_enough_oxy", /obj/screen/alert/not_enough_oxy)
|
||||
|
||||
else //Enough oxygen
|
||||
failed_last_breath = 0
|
||||
failed_last_breath = FALSE
|
||||
adjustOxyLoss(-5)
|
||||
oxygen_used = breath.oxygen/6
|
||||
clear_alert("oxy")
|
||||
oxygen_used = breath.oxygen
|
||||
clear_alert("not_enough_oxy")
|
||||
|
||||
breath.oxygen -= oxygen_used
|
||||
breath.carbon_dioxide += oxygen_used
|
||||
@@ -146,17 +148,17 @@
|
||||
adjustOxyLoss(8)
|
||||
if(prob(20))
|
||||
emote("cough")
|
||||
|
||||
else
|
||||
co2overloadtime = 0
|
||||
|
||||
//TOXINS/PLASMA
|
||||
if(Toxins_partialpressure > safe_tox_max)
|
||||
var/ratio = (breath.toxins/safe_tox_max) * 10
|
||||
if(reagents)
|
||||
reagents.add_reagent("plasma", Clamp(ratio, MIN_PLASMA_DAMAGE, MAX_PLASMA_DAMAGE))
|
||||
throw_alert("tox_in_air", /obj/screen/alert/tox_in_air)
|
||||
adjustToxLoss(Clamp(ratio, MIN_TOXIC_GAS_DAMAGE, MAX_TOXIC_GAS_DAMAGE))
|
||||
throw_alert("too_much_tox", /obj/screen/alert/too_much_tox)
|
||||
else
|
||||
clear_alert("tox_in_air")
|
||||
clear_alert("too_much_tox")
|
||||
|
||||
//TRACE GASES
|
||||
if(breath.trace_gases.len)
|
||||
@@ -173,7 +175,7 @@
|
||||
//BREATH TEMPERATURE
|
||||
handle_breath_temperature(breath)
|
||||
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
//Fourth and final link in a breath chain
|
||||
/mob/living/carbon/proc/handle_breath_temperature(datum/gas_mixture/breath)
|
||||
@@ -189,12 +191,9 @@
|
||||
internal = null //turn off internals
|
||||
|
||||
if(internal)
|
||||
update_internals_hud_icon(1)
|
||||
return internal.remove_air_volume(volume_needed)
|
||||
else
|
||||
update_internals_hud_icon(0)
|
||||
|
||||
return
|
||||
update_action_buttons_icon()
|
||||
|
||||
/mob/living/carbon/handle_diseases()
|
||||
for(var/thing in viruses)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
var/name
|
||||
var/desc
|
||||
var/class
|
||||
var/list/default_genes = list(REGEN, NO_BREATH, RESIST_COLD)
|
||||
var/list/default_genes = list(REGEN, BREATHLESS, COLDRES)
|
||||
var/list/default_spells = list()
|
||||
|
||||
/datum/superheroes/proc/create(var/mob/living/carbon/human/H)
|
||||
|
||||
@@ -169,7 +169,7 @@
|
||||
icon_dead = "Syndicat_dead"
|
||||
icon_resting = "Syndicat_rest"
|
||||
gender = FEMALE
|
||||
flags = NO_BREATHE
|
||||
mutations = list(BREATHLESS)
|
||||
faction = list("syndicate")
|
||||
gold_core_spawnable = CHEM_MOB_SPAWN_INVALID
|
||||
eats_mice = 0
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
emote_see = list("shakes its head", "shivers")
|
||||
desc = "It's a corgi."
|
||||
set_light(0)
|
||||
flags &= ~NO_BREATHE
|
||||
mutations.Remove(BREATHLESS)
|
||||
atmos_requirements = default_atmos_requirements
|
||||
minbodytemp = initial(minbodytemp)
|
||||
inventory_head.loc = src.loc
|
||||
@@ -365,7 +365,7 @@
|
||||
name = "Space Explorer [real_name]"
|
||||
desc = "That's one small step for a corgi. One giant yap for corgikind."
|
||||
valid = 1
|
||||
flags |= NO_BREATHE
|
||||
mutations.Add(BREATHLESS)
|
||||
atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0)
|
||||
minbodytemp = 0
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
icon_living = "Syndifox"
|
||||
icon_dead = "Syndifox_dead"
|
||||
icon_resting = "Syndifox_rest"
|
||||
flags = NO_BREATHE
|
||||
mutations = list(BREATHLESS)
|
||||
faction = list("syndicate")
|
||||
gold_core_spawnable = CHEM_MOB_SPAWN_INVALID
|
||||
atmos_requirements = list("min_oxy" = 0, "max_oxy" = 0, "min_tox" = 0, "max_tox" = 0, "min_co2" = 0, "max_co2" = 0, "min_n2" = 0, "max_n2" = 0)
|
||||
|
||||
@@ -11,9 +11,6 @@
|
||||
var/icon_resting = ""
|
||||
var/icon_gib = null //We only try to show a gibbing animation if this exists.
|
||||
|
||||
var/oxygen_alert = 0
|
||||
var/toxins_alert = 0
|
||||
var/fire_alert = 0
|
||||
var/healable = 1
|
||||
|
||||
var/list/speak = list()
|
||||
@@ -201,7 +198,7 @@
|
||||
|
||||
var/areatemp = get_temperature(environment)
|
||||
|
||||
if(abs(areatemp - bodytemperature) > 40 && !(flags & NO_BREATHE))
|
||||
if(abs(areatemp - bodytemperature) > 40 && !(BREATHLESS in mutations))
|
||||
var/diff = areatemp - bodytemperature
|
||||
diff = diff / 5
|
||||
bodytemperature += diff
|
||||
@@ -213,21 +210,23 @@
|
||||
|
||||
if(atmos_requirements["min_oxy"] && oxy < atmos_requirements["min_oxy"])
|
||||
atmos_suitable = 0
|
||||
throw_alert("oxy", /obj/screen/alert/oxy)
|
||||
throw_alert("not_enough_oxy", /obj/screen/alert/not_enough_oxy)
|
||||
else if(atmos_requirements["max_oxy"] && oxy > atmos_requirements["max_oxy"])
|
||||
atmos_suitable = 0
|
||||
throw_alert("oxy", /obj/screen/alert/too_much_oxy)
|
||||
throw_alert("too_much_oxy", /obj/screen/alert/too_much_oxy)
|
||||
else
|
||||
clear_alert("oxy")
|
||||
clear_alert("not_enough_oxy")
|
||||
clear_alert("too_much_oxy")
|
||||
|
||||
if(atmos_requirements["min_tox"] && tox < atmos_requirements["min_tox"])
|
||||
atmos_suitable = 0
|
||||
throw_alert("tox_in_air", /obj/screen/alert/not_enough_tox)
|
||||
throw_alert("not_enough_tox", /obj/screen/alert/not_enough_tox)
|
||||
else if(atmos_requirements["max_tox"] && tox > atmos_requirements["max_tox"])
|
||||
atmos_suitable = 0
|
||||
throw_alert("tox_in_air", /obj/screen/alert/tox_in_air)
|
||||
throw_alert("too_much_tox", /obj/screen/alert/too_much_tox)
|
||||
else
|
||||
clear_alert("tox_in_air")
|
||||
clear_alert("too_much_tox")
|
||||
clear_alert("not_enough_tox")
|
||||
|
||||
if(atmos_requirements["min_n2"] && n2 < atmos_requirements["min_n2"])
|
||||
atmos_suitable = 0
|
||||
|
||||
@@ -448,7 +448,7 @@
|
||||
else
|
||||
prot = 1
|
||||
|
||||
if(prot > 0 || (RESIST_HEAT in user.mutations))
|
||||
if(prot > 0 || (HEATRES in user.mutations))
|
||||
to_chat(user, "You remove the light [fitting]")
|
||||
else if(TK in user.mutations)
|
||||
to_chat(user, "You telekinetically remove the light [fitting].")
|
||||
|
||||
@@ -278,8 +278,8 @@ var/list/non_simple_animals = typecacheof(list(/mob/living/carbon/human/monkey,/
|
||||
switch(upgrade_type)
|
||||
if(VAULT_SPACEIMMUNE)
|
||||
to_chat(H, "<span class='notice'>You suddenly don't feel the need to breathe anymore. You also don't feel any cold anymore.</span>")
|
||||
grant_power(H, NOBREATHBLOCK, NO_BREATH)
|
||||
grant_power(H, FIREBLOCK, RESIST_COLD)
|
||||
grant_power(H, BREATHLESSBLOCK, BREATHLESS)
|
||||
grant_power(H, FIREBLOCK, COLDRES)
|
||||
if(VAULT_XRAY)
|
||||
to_chat(H, "<span class='notice'>You can suddenly see through walls.</span>")
|
||||
grant_power(H, XRAYBLOCK, XRAY)
|
||||
|
||||
@@ -0,0 +1,329 @@
|
||||
/obj/item/organ/internal/lungs
|
||||
name = "lungs"
|
||||
icon_state = "lungs"
|
||||
parent_organ = "chest"
|
||||
slot = "lungs"
|
||||
organ_tag = "lungs"
|
||||
gender = PLURAL
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
|
||||
//Breath damage
|
||||
|
||||
var/safe_oxygen_min = 16 // Minimum safe partial pressure of O2, in kPa
|
||||
var/safe_oxygen_max = 0
|
||||
var/safe_nitro_min = 0
|
||||
var/safe_nitro_max = 0
|
||||
var/safe_co2_min = 0
|
||||
var/safe_co2_max = 10 // Yes it's an arbitrary value who cares?
|
||||
var/safe_toxins_min = 0
|
||||
var/safe_toxins_max = 0.05
|
||||
var/SA_para_min = 1 //Sleeping agent
|
||||
var/SA_sleep_min = 5 //Sleeping agent
|
||||
|
||||
var/oxy_breath_dam_min = MIN_TOXIC_GAS_DAMAGE
|
||||
var/oxy_breath_dam_max = MAX_TOXIC_GAS_DAMAGE
|
||||
var/oxy_damage_type = OXY
|
||||
var/nitro_breath_dam_min = MIN_TOXIC_GAS_DAMAGE
|
||||
var/nitro_breath_dam_max = MAX_TOXIC_GAS_DAMAGE
|
||||
var/nitro_damage_type = OXY
|
||||
var/co2_breath_dam_min = MIN_TOXIC_GAS_DAMAGE
|
||||
var/co2_breath_dam_max = MAX_TOXIC_GAS_DAMAGE
|
||||
var/co2_damage_type = OXY
|
||||
var/tox_breath_dam_min = MIN_TOXIC_GAS_DAMAGE
|
||||
var/tox_breath_dam_max = MAX_TOXIC_GAS_DAMAGE
|
||||
var/tox_damage_type = TOX
|
||||
|
||||
var/cold_message = "your face freezing and an icicle forming"
|
||||
var/cold_level_1_threshold = 260
|
||||
var/cold_level_2_threshold = 200
|
||||
var/cold_level_3_threshold = 120
|
||||
var/cold_level_1_damage = COLD_GAS_DAMAGE_LEVEL_1 //Keep in mind with gas damage levels, you can set these to be negative, if you want someone to heal, instead.
|
||||
var/cold_level_2_damage = COLD_GAS_DAMAGE_LEVEL_2
|
||||
var/cold_level_3_damage = COLD_GAS_DAMAGE_LEVEL_3
|
||||
var/cold_damage_type = BURN
|
||||
|
||||
var/hot_message = "your face burning and a searing heat"
|
||||
var/heat_level_1_threshold = 360
|
||||
var/heat_level_2_threshold = 400
|
||||
var/heat_level_3_threshold = 1000
|
||||
var/heat_level_1_damage = HEAT_GAS_DAMAGE_LEVEL_1
|
||||
var/heat_level_2_damage = HEAT_GAS_DAMAGE_LEVEL_2
|
||||
var/heat_level_3_damage = HEAT_GAS_DAMAGE_LEVEL_3
|
||||
var/heat_damage_type = BURN
|
||||
|
||||
/obj/item/organ/internal/lungs/insert(mob/living/carbon/M, special = 0, dont_remove_slot = 0)
|
||||
..()
|
||||
for(var/thing in list("oxy", "tox", "co2", "nitro"))
|
||||
M.clear_alert("not_enough_[thing]")
|
||||
M.clear_alert("too_much_[thing]")
|
||||
|
||||
/obj/item/organ/internal/lungs/remove(mob/living/carbon/M, special = 0)
|
||||
for(var/thing in list("oxy", "tox", "co2", "nitro"))
|
||||
M.clear_alert("not_enough_[thing]")
|
||||
M.clear_alert("too_much_[thing]")
|
||||
return ..()
|
||||
|
||||
/obj/item/organ/internal/lungs/on_life()
|
||||
if(germ_level > INFECTION_LEVEL_ONE)
|
||||
if(prob(5))
|
||||
owner.emote("cough") //respitory tract infection
|
||||
|
||||
if(is_bruised())
|
||||
if(prob(2))
|
||||
owner.custom_emote(1, "coughs up blood!")
|
||||
owner.bleed(1)
|
||||
if(prob(4))
|
||||
owner.custom_emote(1, "gasps for air!")
|
||||
owner.AdjustLoseBreath(5)
|
||||
|
||||
/obj/item/organ/internal/lungs/proc/check_breath(datum/gas_mixture/breath, mob/living/carbon/human/H)
|
||||
if((H.status_flags & GODMODE))
|
||||
return
|
||||
|
||||
if(!breath || (breath.total_moles() == 0))
|
||||
if(H.health >= config.health_threshold_crit)
|
||||
H.adjustOxyLoss(HUMAN_MAX_OXYLOSS)
|
||||
else
|
||||
H.adjustOxyLoss(HUMAN_CRIT_MAX_OXYLOSS)
|
||||
|
||||
H.failed_last_breath = TRUE
|
||||
if(safe_oxygen_min)
|
||||
H.throw_alert("not_enough_oxy", /obj/screen/alert/not_enough_oxy)
|
||||
else if(safe_toxins_min)
|
||||
H.throw_alert("not_enough_tox", /obj/screen/alert/not_enough_tox)
|
||||
else if(safe_co2_min)
|
||||
H.throw_alert("not_enough_co2", /obj/screen/alert/not_enough_co2)
|
||||
else if(safe_nitro_min)
|
||||
H.throw_alert("not_enough_nitro", /obj/screen/alert/not_enough_nitro)
|
||||
return FALSE
|
||||
|
||||
var/gas_breathed = 0
|
||||
|
||||
//Partial pressures in our breath
|
||||
var/O2_pp = breath.get_breath_partial_pressure(breath.oxygen)
|
||||
var/N2_pp = breath.get_breath_partial_pressure(breath.nitrogen)
|
||||
var/Toxins_pp = breath.get_breath_partial_pressure(breath.toxins)
|
||||
var/CO2_pp = breath.get_breath_partial_pressure(breath.carbon_dioxide)
|
||||
|
||||
|
||||
//-- OXY --//
|
||||
|
||||
//Too much oxygen! //Yes, some species may not like it.
|
||||
if(safe_oxygen_max)
|
||||
if(O2_pp > safe_oxygen_max)
|
||||
var/ratio = (breath.oxygen/safe_oxygen_max) * 10
|
||||
H.apply_damage_type(Clamp(ratio, oxy_breath_dam_min, oxy_breath_dam_max), oxy_damage_type)
|
||||
H.throw_alert("too_much_oxy", /obj/screen/alert/too_much_oxy)
|
||||
else
|
||||
H.clear_alert("too_much_oxy")
|
||||
|
||||
//Too little oxygen!
|
||||
if(safe_oxygen_min)
|
||||
if(O2_pp < safe_oxygen_min)
|
||||
gas_breathed = handle_too_little_breath(H, O2_pp, safe_oxygen_min, breath.oxygen)
|
||||
H.throw_alert("not_enough_oxy", /obj/screen/alert/not_enough_oxy)
|
||||
else
|
||||
H.failed_last_breath = FALSE
|
||||
H.adjustOxyLoss(-5)
|
||||
gas_breathed = breath.oxygen
|
||||
H.clear_alert("not_enough_oxy")
|
||||
|
||||
//Exhale
|
||||
breath.oxygen -= gas_breathed
|
||||
breath.carbon_dioxide += gas_breathed
|
||||
gas_breathed = 0
|
||||
|
||||
//-- Nitrogen --//
|
||||
|
||||
//Too much nitrogen!
|
||||
if(safe_nitro_max)
|
||||
if(N2_pp > safe_nitro_max)
|
||||
var/ratio = (breath.nitrogen/safe_nitro_max) * 10
|
||||
H.apply_damage_type(Clamp(ratio, nitro_breath_dam_min, nitro_breath_dam_max), nitro_damage_type)
|
||||
H.throw_alert("too_much_nitro", /obj/screen/alert/too_much_nitro)
|
||||
else
|
||||
H.clear_alert("too_much_nitro")
|
||||
|
||||
//Too little nitrogen!
|
||||
if(safe_nitro_min)
|
||||
if(N2_pp < safe_nitro_min)
|
||||
gas_breathed = handle_too_little_breath(H, N2_pp, safe_nitro_min, breath.nitrogen)
|
||||
H.throw_alert("nitro", /obj/screen/alert/not_enough_nitro)
|
||||
else
|
||||
H.failed_last_breath = FALSE
|
||||
H.adjustOxyLoss(-5)
|
||||
gas_breathed = breath.nitrogen
|
||||
H.clear_alert("nitro")
|
||||
|
||||
//Exhale
|
||||
breath.nitrogen -= gas_breathed
|
||||
breath.carbon_dioxide += gas_breathed
|
||||
gas_breathed = 0
|
||||
|
||||
//-- CO2 --//
|
||||
|
||||
//CO2 does not affect failed_last_breath. So if there was enough oxygen in the air but too much co2, this will hurt you, but only once per 4 ticks, instead of once per tick.
|
||||
if(safe_co2_max)
|
||||
if(CO2_pp > safe_co2_max)
|
||||
if(!H.co2overloadtime) // If it's the first breath with too much CO2 in it, lets start a counter, then have them pass out after 12s or so.
|
||||
H.co2overloadtime = world.time
|
||||
else if(world.time - H.co2overloadtime > 120)
|
||||
H.Paralyse(3)
|
||||
H.apply_damage_type(3, co2_damage_type) // Lets hurt em a little, let them know we mean business
|
||||
if(world.time - H.co2overloadtime > 300) // They've been in here 30s now, lets start to kill them for their own good!
|
||||
H.apply_damage_type(8, co2_damage_type)
|
||||
H.throw_alert("too_much_co2", /obj/screen/alert/too_much_co2)
|
||||
if(prob(20)) // Lets give them some chance to know somethings not right though I guess.
|
||||
H.emote("cough")
|
||||
|
||||
else
|
||||
H.co2overloadtime = 0
|
||||
H.clear_alert("too_much_co2")
|
||||
|
||||
//Too little CO2!
|
||||
if(safe_co2_min)
|
||||
if(CO2_pp < safe_co2_min)
|
||||
gas_breathed = handle_too_little_breath(H, CO2_pp, safe_co2_min, breath.carbon_dioxide)
|
||||
H.throw_alert("not_enough_co2", /obj/screen/alert/not_enough_co2)
|
||||
else
|
||||
H.failed_last_breath = FALSE
|
||||
H.adjustOxyLoss(-5)
|
||||
gas_breathed = breath.carbon_dioxide
|
||||
H.clear_alert("not_enough_co2")
|
||||
|
||||
//Exhale
|
||||
breath.carbon_dioxide -= gas_breathed
|
||||
breath.oxygen += gas_breathed
|
||||
gas_breathed = 0
|
||||
|
||||
|
||||
//-- TOX --//
|
||||
|
||||
//Too much toxins!
|
||||
if(safe_toxins_max)
|
||||
if(Toxins_pp > safe_toxins_max)
|
||||
var/ratio = (breath.toxins/safe_toxins_max) * 10
|
||||
H.apply_damage_type(Clamp(ratio, tox_breath_dam_min, tox_breath_dam_max), tox_damage_type)
|
||||
H.throw_alert("too_much_tox", /obj/screen/alert/too_much_tox)
|
||||
else
|
||||
H.clear_alert("too_much_tox")
|
||||
|
||||
|
||||
//Too little toxins!
|
||||
if(safe_toxins_min)
|
||||
if(Toxins_pp < safe_toxins_min)
|
||||
gas_breathed = handle_too_little_breath(H, Toxins_pp, safe_toxins_min, breath.toxins)
|
||||
H.throw_alert("not_enough_tox", /obj/screen/alert/not_enough_tox)
|
||||
else
|
||||
H.failed_last_breath = FALSE
|
||||
H.adjustOxyLoss(-5)
|
||||
gas_breathed = breath.toxins
|
||||
H.clear_alert("not_enough_tox")
|
||||
|
||||
//Exhale
|
||||
breath.toxins -= gas_breathed
|
||||
breath.carbon_dioxide += gas_breathed
|
||||
gas_breathed = 0
|
||||
|
||||
|
||||
//-- TRACES --//
|
||||
|
||||
if(breath.trace_gases.len) // If there's some other shit in the air lets deal with it here.
|
||||
for(var/datum/gas/sleeping_agent/SA in breath.trace_gases)
|
||||
var/SA_pp = breath.get_breath_partial_pressure(SA.moles)
|
||||
if(SA_pp > SA_para_min)
|
||||
H.Paralyse(3) // 3 gives them one second to wake up and run away a bit!
|
||||
if(SA_pp > SA_sleep_min) // Enough to make us sleep as well
|
||||
H.AdjustSleeping(8, bound_lower = 0, bound_upper = 10)
|
||||
else if(SA_pp > 0.01) // There is sleeping gas in their lungs, but only a little, so give them a bit of a warning
|
||||
if(prob(20))
|
||||
H.emote(pick("giggle", "laugh"))
|
||||
|
||||
handle_breath_temperature(breath, H)
|
||||
|
||||
return TRUE
|
||||
|
||||
|
||||
/obj/item/organ/internal/lungs/proc/handle_too_little_breath(mob/living/carbon/human/H = null, breath_pp = 0, safe_breath_min = 0, true_pp = 0)
|
||||
. = 0
|
||||
if(!H || !safe_breath_min) //the other args are either: Ok being 0 or Specifically handled.
|
||||
return FALSE
|
||||
|
||||
if(prob(20))
|
||||
H.emote("gasp")
|
||||
if(breath_pp > 0)
|
||||
var/ratio = safe_breath_min/breath_pp
|
||||
H.adjustOxyLoss(min(5*ratio, HUMAN_MAX_OXYLOSS)) // Don't fuck them up too fast (space only does HUMAN_MAX_OXYLOSS after all!
|
||||
H.failed_last_breath = TRUE
|
||||
. = true_pp*ratio/6
|
||||
else
|
||||
H.adjustOxyLoss(HUMAN_MAX_OXYLOSS)
|
||||
H.failed_last_breath = TRUE
|
||||
|
||||
|
||||
/obj/item/organ/internal/lungs/proc/handle_breath_temperature(datum/gas_mixture/breath, mob/living/carbon/human/H) // called by human/life, handles temperatures
|
||||
var/breath_temperature = breath.temperature
|
||||
|
||||
var/species_traits = list()
|
||||
if(H && H.species && H.species.species_traits)
|
||||
species_traits = H.species.species_traits
|
||||
|
||||
if(!(COLDRES in H.mutations) && !(RESISTCOLD in species_traits)) // COLD DAMAGE
|
||||
var/cold_modifier = H.species.coldmod
|
||||
if(breath_temperature < cold_level_3_threshold)
|
||||
H.apply_damage_type(cold_level_3_damage*cold_modifier, cold_damage_type)
|
||||
if(breath_temperature > cold_level_3_threshold && breath_temperature < cold_level_2_threshold)
|
||||
H.apply_damage_type(cold_level_2_damage*cold_modifier, cold_damage_type)
|
||||
if(breath_temperature > cold_level_2_threshold && breath_temperature < cold_level_1_threshold)
|
||||
H.apply_damage_type(cold_level_1_damage*cold_modifier, cold_damage_type)
|
||||
if(breath_temperature < cold_level_1_threshold)
|
||||
if(prob(20))
|
||||
to_chat(H, "<span class='warning'>You feel [cold_message] in your [name]!</span>")
|
||||
|
||||
if(!(HEATRES in H.mutations) && !(RESISTHOT in species_traits)) // HEAT DAMAGE
|
||||
var/heat_modifier = H.species.heatmod
|
||||
if(breath_temperature > heat_level_1_threshold && breath_temperature < heat_level_2_threshold)
|
||||
H.apply_damage_type(heat_level_1_damage*heat_modifier, heat_damage_type)
|
||||
if(breath_temperature > heat_level_2_threshold && breath_temperature < heat_level_3_threshold)
|
||||
H.apply_damage_type(heat_level_2_damage*heat_modifier, heat_damage_type)
|
||||
if(breath_temperature > heat_level_3_threshold)
|
||||
H.apply_damage_type(heat_level_3_damage*heat_modifier, heat_damage_type)
|
||||
if(breath_temperature > heat_level_1_threshold)
|
||||
if(prob(20))
|
||||
to_chat(H, "<span class='warning'>You feel [hot_message] in your [name]!</span>")
|
||||
|
||||
/obj/item/organ/internal/lungs/prepare_eat()
|
||||
var/obj/S = ..()
|
||||
S.reagents.add_reagent("salbutamol", 5)
|
||||
return S
|
||||
|
||||
/obj/item/organ/internal/lungs/plasmaman
|
||||
name = "plasma filter"
|
||||
desc = "A spongy rib-shaped mass for filtering plasma from the air."
|
||||
icon_state = "lungs-plasma"
|
||||
species = "Plasmaman"
|
||||
|
||||
safe_oxygen_min = 0 //We don't breath this
|
||||
safe_toxins_min = 16 //We breathe THIS!
|
||||
safe_toxins_max = 0
|
||||
|
||||
/obj/item/organ/internal/lungs/vox
|
||||
name = "Vox lungs"
|
||||
desc = "They're filled with dust....wow."
|
||||
species = "Vox"
|
||||
|
||||
safe_oxygen_min = 0 //We don't breathe this
|
||||
safe_oxygen_max = 1 //This is toxic to us
|
||||
safe_nitro_min = 16 //We breathe THIS!
|
||||
oxy_damage_type = TOX //And it poisons us
|
||||
|
||||
/obj/item/organ/internal/lungs/drask
|
||||
icon = 'icons/obj/surgery_drask.dmi'
|
||||
species = "Drask"
|
||||
|
||||
cold_message = "an invigorating coldness"
|
||||
cold_level_3_threshold = 60
|
||||
cold_level_1_damage = -COLD_GAS_DAMAGE_LEVEL_1 //They heal when the air is cold
|
||||
cold_level_2_damage = -COLD_GAS_DAMAGE_LEVEL_2
|
||||
cold_level_3_damage = -COLD_GAS_DAMAGE_LEVEL_3
|
||||
cold_damage_type = BRUTE //more specifically they heal brute
|
||||
@@ -1,5 +1,3 @@
|
||||
var/list/organ_cache = list()
|
||||
|
||||
/obj/item/organ
|
||||
name = "organ"
|
||||
icon = 'icons/obj/surgery.dmi'
|
||||
|
||||
@@ -267,35 +267,6 @@
|
||||
H.adjustFireLoss(-cursed_heart.heal_burn)
|
||||
H.adjustOxyLoss(-cursed_heart.heal_oxy)
|
||||
|
||||
/obj/item/organ/internal/lungs
|
||||
name = "lungs"
|
||||
icon_state = "lungs"
|
||||
gender = PLURAL
|
||||
organ_tag = "lungs"
|
||||
parent_organ = "chest"
|
||||
slot = "lungs"
|
||||
vital = 1
|
||||
|
||||
//Insert something neat here.
|
||||
///obj/item/organ/internal/lungs/remove(mob/living/carbon/M, special = 0)
|
||||
// owner.losebreath += 10
|
||||
//insert oxy damage extream here.
|
||||
// . = ..()
|
||||
|
||||
|
||||
/obj/item/organ/internal/lungs/on_life()
|
||||
if(germ_level > INFECTION_LEVEL_ONE)
|
||||
if(prob(5))
|
||||
owner.emote("cough") //respitory tract infection
|
||||
|
||||
if(is_bruised())
|
||||
if(prob(2))
|
||||
owner.custom_emote(1, "coughs up blood!")
|
||||
owner.bleed(1)
|
||||
if(prob(4))
|
||||
owner.custom_emote(1, "gasps for air!")
|
||||
owner.AdjustLoseBreath(5)
|
||||
|
||||
/obj/item/organ/internal/kidneys
|
||||
name = "kidneys"
|
||||
icon_state = "kidneys"
|
||||
|
||||
@@ -12,10 +12,6 @@
|
||||
parent_organ = "head"
|
||||
species = "Drask"
|
||||
|
||||
/obj/item/organ/internal/lungs/drask
|
||||
icon = 'icons/obj/surgery_drask.dmi'
|
||||
species = "Drask"
|
||||
|
||||
/obj/item/organ/internal/liver/drask
|
||||
name = "metabolic strainer"
|
||||
icon = 'icons/obj/surgery_drask.dmi'
|
||||
|
||||
@@ -206,7 +206,7 @@
|
||||
|
||||
for(var/mob/living/carbon/human/H in view(2, E.loc))//germs from people
|
||||
if(AStar(E.loc, H.loc, /turf/proc/Distance, 2, simulated_only = 0))
|
||||
if((!(NO_BREATH in H.mutations) || !(NO_BREATH in H.species.species_traits)) && !H.wear_mask) //wearing a mask helps preventing people from breathing cooties into open incisions
|
||||
if((!(BREATHLESS in H.mutations) || !(NO_BREATHE in H.species.species_traits)) && !H.wear_mask) //wearing a mask helps preventing people from breathing cooties into open incisions
|
||||
germs += H.germ_level * 0.25
|
||||
|
||||
for(var/obj/effect/decal/cleanable/M in view(2, E.loc))//germs from messes
|
||||
|
||||
Reference in New Issue
Block a user