diff --git a/code/__DEFINES/atmospherics.dm b/code/__DEFINES/atmospherics.dm index 1e7f98ecb53..376fcd45559 100644 --- a/code/__DEFINES/atmospherics.dm +++ b/code/__DEFINES/atmospherics.dm @@ -61,8 +61,8 @@ #define PLASMA_MINIMUM_OXYGEN_NEEDED 2 #define PLASMA_MINIMUM_OXYGEN_PLASMA_RATIO 30 #define PLASMA_OXYGEN_FULLBURN 10 -#define MIN_PLASMA_DAMAGE 1 -#define MAX_PLASMA_DAMAGE 10 +#define MIN_TOXIC_GAS_DAMAGE 1 +#define MAX_TOXIC_GAS_DAMAGE 10 #define MOLES_PLASMA_VISIBLE 0.5 //Moles in a standard cell after which plasma is visible // Pressure limits. diff --git a/code/__DEFINES/genetics.dm b/code/__DEFINES/genetics.dm index 4cbe2a9e5f1..aba6e6baea9 100644 --- a/code/__DEFINES/genetics.dm +++ b/code/__DEFINES/genetics.dm @@ -25,7 +25,7 @@ // Generic mutations: #define TK 1 -#define RESIST_COLD 2 +#define COLDRES 2 #define XRAY 3 #define HULK 4 #define CLUMSY 5 @@ -42,13 +42,13 @@ #define PLANT 30 // Other Mutations: -#define NO_BREATH 100 // no need to breathe +#define BREATHLESS 100 // no breathing #define REMOTE_VIEW 101 // remote viewing #define REGEN 102 // health regen #define RUN 103 // no slowdown #define REMOTE_TALK 104 // remote talking #define MORPH 105 // changing appearance -#define RESIST_HEAT 106 // heat resistance +#define HEATRES 106 // heat resistance #define HALLUCINATE 107 // hallucinations #define FINGERPRINTS 108 // no fingerprints #define NO_SHOCK 109 // insulated hands @@ -140,3 +140,6 @@ #define NOGUNS 12 #define NOTRANSSTING 13 #define VIRUSIMMUNE 14 +#define NOCRITDAMAGE 15 +#define RESISTHOT 16 +#define RESISTCOLD 17 \ No newline at end of file diff --git a/code/_globalvars/genetics.dm b/code/_globalvars/genetics.dm index 3ff80f3376c..7c22e69f355 100644 --- a/code/_globalvars/genetics.dm +++ b/code/_globalvars/genetics.dm @@ -18,7 +18,7 @@ var/MONKEYBLOCK = 50 // Monkey block will always be the DNA_SE_LENGTH var/BLOCKADD = 0 var/DIFFMUT = 0 -var/NOBREATHBLOCK = 0 +var/BREATHLESSBLOCK = 0 var/REMOTEVIEWBLOCK = 0 var/REGENERATEBLOCK = 0 var/INCREASERUNBLOCK = 0 diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm index 9e32705fc90..0fb97f4dc46 100644 --- a/code/_onclick/hud/alert.dm +++ b/code/_onclick/hud/alert.dm @@ -105,21 +105,20 @@ //Gas alerts -/obj/screen/alert/oxy +/obj/screen/alert/not_enough_oxy name = "Choking (No O2)" - desc = "You're not getting enough oxygen. Find some good air before you pass out! \ -The box in your backpack has an oxygen tank and breath mask in it." - icon_state = "oxy" + desc = "You're not getting enough oxygen. Find some good air before you pass out! The box in your backpack has an oxygen tank and breath mask in it." + icon_state = "not_enough_oxy" /obj/screen/alert/too_much_oxy name = "Choking (O2)" desc = "There's too much oxygen in the air, and you're breathing it in! Find some good air before you pass out!" icon_state = "too_much_oxy" -/obj/screen/alert/nitro +/obj/screen/alert/not_enough_nitro name = "Choking (No N)" desc = "You're not getting enough nitrogen. Find some good air before you pass out!" - icon_state = "nitro" + icon_state = "not_enough_nitro" /obj/screen/alert/too_much_nitro name = "Choking (N)" @@ -141,11 +140,10 @@ The box in your backpack has an oxygen tank and breath mask in it." desc = "You're not getting enough plasma. Find some good air before you pass out!" icon_state = "not_enough_tox" -/obj/screen/alert/tox_in_air +/obj/screen/alert/too_much_tox name = "Choking (Plasma)" - desc = "There's highly flammable, toxic plasma in the air and you're breathing it in. Find some fresh air. \ -The box in your backpack has an oxygen tank and gas mask in it." - icon_state = "tox_in_air" + desc = "There's highly flammable, toxic plasma in the air and you're breathing it in. Find some fresh air. The box in your backpack has an oxygen tank and gas mask in it." + icon_state = "too_much_tox" //End gas alerts diff --git a/code/_onclick/hud/hud.dm b/code/_onclick/hud/hud.dm index f4b43516cd0..10de5275352 100644 --- a/code/_onclick/hud/hud.dm +++ b/code/_onclick/hud/hud.dm @@ -36,8 +36,6 @@ var/obj/screen/movable/action_button/hide_toggle/hide_actions_toggle var/action_buttons_hidden = 0 - var/obj/screen/internals - /mob/proc/create_mob_hud() if(client && !hud_used) hud_used = new /datum/hud(src) @@ -81,7 +79,6 @@ alien_plasma_display = null vampire_blood_display = null nightvisionicon = null - internals = null mymob = null return ..() diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm index fbba17c7b6b..ecd7cb3de52 100644 --- a/code/_onclick/hud/human.dm +++ b/code/_onclick/hud/human.dm @@ -319,9 +319,6 @@ mymob.throw_icon.alpha = ui_alpha hotkeybuttons += mymob.throw_icon - internals = new /obj/screen/internals() - infodisplay += internals - mymob.healths = new /obj/screen/healths() infodisplay += mymob.healths diff --git a/code/_onclick/hud/monkey.dm b/code/_onclick/hud/monkey.dm index ae0fb3e1263..6541c5bfdab 100644 --- a/code/_onclick/hud/monkey.dm +++ b/code/_onclick/hud/monkey.dm @@ -102,9 +102,6 @@ mymob.throw_icon.alpha = ui_alpha hotkeybuttons += mymob.throw_icon - internals = new /obj/screen/internals() - infodisplay += internals - mymob.healths = new /obj/screen/healths() infodisplay += mymob.healths diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index d184f765eac..977b68ae5a3 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -90,107 +90,6 @@ icon = 'icons/mob/screen_robot.dmi' screen_loc = ui_borg_intents -/obj/screen/internals - name = "toggle internals" - icon_state = "internal0" - screen_loc = ui_internal - -/obj/screen/internals/Click() - if(!iscarbon(usr)) - return - var/mob/living/carbon/C = usr - if(C.incapacitated()) - return - - if(C.internal) - C.internal = null - to_chat(C, "No longer running on internals.") - icon_state = "internal0" - else - var/no_mask = FALSE - if(!C.get_organ_slot("breathing_tube")) - if(!C.wear_mask || !(C.wear_mask.flags & AIRTIGHT)) - if(ishuman(C)) - var/mob/living/carbon/human/H = C - if(!H.head || !(H.head.flags & AIRTIGHT)) - no_mask = TRUE - - if(no_mask) - to_chat(C, "You are not wearing a suitable mask or helmet.") - return - - var/list/nicename = null - var/list/tankcheck = null - var/breathes = "oxygen" - var/list/contents = list() - var/from = "on" - - if(ishuman(C)) - var/mob/living/carbon/human/H = C - breathes = H.species.breath_type - nicename = list("suit", "back", "belt", "right hand", "left hand", "left pocket", "right pocket") - tankcheck = list(H.s_store, C.back, H.belt, C.r_hand, C.l_hand, H.l_store, H.r_store) - else - nicename = list("right hand", "left hand", "back") - tankcheck = list(C.r_hand, C.l_hand, C.back) - - // Rigs are a fucking pain since they keep an air tank in nullspace. - if(istype(C.back,/obj/item/weapon/rig)) - var/obj/item/weapon/rig/rig = C.back - if(rig.air_supply) - from = "in" - nicename |= "hardsuit" - tankcheck |= rig.air_supply - - for(var/i = 1, i < tankcheck.len + 1, ++i) - if(istype(tankcheck[i], /obj/item/weapon/tank)) - var/obj/item/weapon/tank/t = tankcheck[i] - switch(breathes) - if("nitrogen") - if(t.air_contents.nitrogen && !t.air_contents.oxygen) - contents.Add(t.air_contents.nitrogen) - else - contents.Add(0) - if("oxygen") - if(t.air_contents.oxygen && !t.air_contents.toxins) - contents.Add(t.air_contents.oxygen) - else - contents.Add(0) - if("carbon dioxide") - if(t.air_contents.carbon_dioxide && !t.air_contents.toxins) - contents.Add(t.air_contents.carbon_dioxide) - else - contents.Add(0) - if("plasma") - if(t.air_contents.toxins) - contents.Add(t.air_contents.toxins) - else - contents.Add(0) - else - //no tank so we set contents to 0 - contents.Add(0) - - //Alright now we know the contents of the tanks so we have to pick the best one. - var/best = 0 - var/bestcontents = 0 - for(var/i=1, i < contents.len + 1 , ++i) - if(!contents[i]) - continue - if(contents[i] > bestcontents) - best = i - bestcontents = contents[i] - //We've determined the best container now we set it as our internals - if(best) - to_chat(C, "You are now running on internals from [tankcheck[best]] [from] your [nicename[best]].") - C.internal = tankcheck[best] - - if(C.internal) - icon_state = "internal1" - else - to_chat(C, "You don't have a[breathes == "oxygen" ? "n oxygen" : addtext(" ",breathes)] tank.") - - C.update_action_buttons_icon() - /obj/screen/mov_intent name = "run/walk toggle" icon_state = "running" diff --git a/code/game/dna/genes/goon_powers.dm b/code/game/dna/genes/goon_powers.dm index d3625deab58..c5c5b6a21a5 100644 --- a/code/game/dna/genes/goon_powers.dm +++ b/code/game/dna/genes/goon_powers.dm @@ -154,7 +154,7 @@ to_chat(user, "This will only work on normal organic beings.") return - if(RESIST_COLD in C.mutations) + if(COLDRES in C.mutations) C.visible_message("A cloud of fine ice crystals engulfs [C.name], but disappears almost instantly!") return var/handle_suit = 0 diff --git a/code/game/dna/genes/powers.dm b/code/game/dna/genes/powers.dm index 27c82a1d20f..656be0d4cb9 100644 --- a/code/game/dna/genes/powers.dm +++ b/code/game/dna/genes/powers.dm @@ -7,11 +7,11 @@ activation_messages=list("You feel no need to breathe.") deactivation_messages=list("You feel the need to breathe, once more.") instability = GENE_INSTABILITY_MODERATE - mutation=NO_BREATH + mutation = BREATHLESS activation_prob=25 /datum/dna/gene/basic/nobreath/New() - block=NOBREATHBLOCK + block = BREATHLESSBLOCK /datum/dna/gene/basic/regenerate @@ -48,7 +48,7 @@ activation_messages=list("Your skin is icy to the touch.") deactivation_messages=list("Your skin no longer feels icy to the touch.") instability = GENE_INSTABILITY_MODERATE - mutation=RESIST_HEAT + mutation = HEATRES /datum/dna/gene/basic/heat_resist/New() block=COLDBLOCK @@ -61,7 +61,7 @@ activation_messages=list("Your body is filled with warmth.") deactivation_messages=list("Your body is no longer filled with warmth.") instability = GENE_INSTABILITY_MODERATE - mutation=RESIST_COLD + mutation = COLDRES /datum/dna/gene/basic/cold_resist/New() block=FIREBLOCK diff --git a/code/game/gamemodes/nuclear/nuclear.dm b/code/game/gamemodes/nuclear/nuclear.dm index 8b0565c432e..b68736f90b8 100644 --- a/code/game/gamemodes/nuclear/nuclear.dm +++ b/code/game/gamemodes/nuclear/nuclear.dm @@ -269,7 +269,7 @@ proc/issyndicate(mob/living/M as mob) synd_mob.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/syndicate(synd_mob), slot_wear_mask) synd_mob.equip_to_slot_or_del(new /obj/item/weapon/tank/nitrogen(synd_mob), slot_l_hand) synd_mob.internal = synd_mob.l_hand - synd_mob.update_internals_hud_icon(1) + synd_mob.update_action_buttons_icon() var/obj/item/weapon/implant/explosive/E = new/obj/item/weapon/implant/explosive(synd_mob) E.implant(synd_mob) diff --git a/code/game/gamemodes/setupgame.dm b/code/game/gamemodes/setupgame.dm index c785c511304..7c69b02eda1 100644 --- a/code/game/gamemodes/setupgame.dm +++ b/code/game/gamemodes/setupgame.dm @@ -50,7 +50,7 @@ NERVOUSBLOCK = getAssignedBlock("NERVOUS", numsToAssign) // Bay muts - NOBREATHBLOCK = getAssignedBlock("NOBREATH", numsToAssign, DNA_HARD_BOUNDS, good=1) + BREATHLESSBLOCK = getAssignedBlock("BREATHLESS", numsToAssign, DNA_HARD_BOUNDS, good=1) REMOTEVIEWBLOCK = getAssignedBlock("REMOTEVIEW", numsToAssign, DNA_HARDER_BOUNDS, good=1) REGENERATEBLOCK = getAssignedBlock("REGENERATE", numsToAssign, DNA_HARDER_BOUNDS, good=1) INCREASERUNBLOCK = getAssignedBlock("INCREASERUN", numsToAssign, DNA_HARDER_BOUNDS, good=1) diff --git a/code/game/gamemodes/shadowling/shadowling.dm b/code/game/gamemodes/shadowling/shadowling.dm index 1e4671998e8..4134ca054fe 100644 --- a/code/game/gamemodes/shadowling/shadowling.dm +++ b/code/game/gamemodes/shadowling/shadowling.dm @@ -308,11 +308,15 @@ Made by Xhuis species_traits = list(NO_BLOOD, NO_BREATHE, RADIMMUNE, NOGUNS) //Can't use guns due to muzzle flash burn_mod = 1.5 //1.5x burn damage, 2x is excessive oxy_mod = 0 - hot_env_multiplier = 1.5 + heatmod = 1.5 silent_steps = 1 grant_vision_toggle = 0 + has_organ = list( + "brain" = /obj/item/organ/internal/brain, + "eyes" = /obj/item/organ/internal/eyes) + /datum/species/shadow/ling/handle_life(var/mob/living/carbon/human/H) if(!H.weakeyes) H.weakeyes = 1 //Makes them more vulnerable to flashes and flashbangs @@ -341,6 +345,7 @@ Made by Xhuis H.adjustCloneLoss(-1) H.SetWeakened(0) H.SetStunned(0) + ..() /datum/species/shadow/ling/lesser //Empowered thralls. Obvious, but powerful @@ -355,7 +360,7 @@ Made by Xhuis species_traits = list(NO_BLOOD, NO_BREATHE, RADIMMUNE) burn_mod = 1.1 oxy_mod = 0 - hot_env_multiplier = 1.1 + heatmod = 1.1 /datum/species/shadow/ling/lesser/handle_life(var/mob/living/carbon/human/H) if(!H.weakeyes) @@ -374,6 +379,7 @@ Made by Xhuis H.adjustToxLoss(-5) H.adjustBrainLoss(-25) H.adjustCloneLoss(-1) + ..() /datum/game_mode/proc/update_shadow_icons_added(datum/mind/shadow_mind) var/datum/atom_hud/antag/shadow_hud = huds[ANTAG_HUD_SHADOW] diff --git a/code/game/machinery/poolcontroller.dm b/code/game/machinery/poolcontroller.dm index 6e1e1c0e97a..01ae0546f19 100644 --- a/code/game/machinery/poolcontroller.dm +++ b/code/game/machinery/poolcontroller.dm @@ -93,7 +93,7 @@ if(drownee && (drownee.lying || deep_water)) //Mob lying down or water is deep (determined by controller) if(drownee.internal) return //Has internals, no drowning - if((NO_BREATHE in drownee.species.species_traits) || (NO_BREATHE in drownee.mutations)) + if((NO_BREATHE in drownee.species.species_traits) || (BREATHLESS in drownee.mutations)) return //doesn't breathe, no drowning if(drownee.get_species() == "Skrell" || drownee.get_species() == "Neara") return //fish things don't drown diff --git a/code/game/objects/items/weapons/dna_injector.dm b/code/game/objects/items/weapons/dna_injector.dm index 59b5f487044..fa8be176590 100644 --- a/code/game/objects/items/weapons/dna_injector.dm +++ b/code/game/objects/items/weapons/dna_injector.dm @@ -251,23 +251,23 @@ ..() /obj/item/weapon/dnainjector/nobreath - name = "DNA-Injector (No Breath)" + name = "DNA-Injector (Breathless)" desc = "Hold your breath and count to infinity." datatype = DNA2_BUF_SE value = 0xFFF //block = 2 New() - block = NOBREATHBLOCK + block = BREATHLESSBLOCK ..() /obj/item/weapon/dnainjector/antinobreath - name = "DNA-Injector (Anti-No Breath)" + name = "DNA-Injector (Anti-Breathless)" desc = "Hold your breath and count to 100." datatype = DNA2_BUF_SE value = 0x001 //block = 2 New() - block = NOBREATHBLOCK + block = BREATHLESSBLOCK ..() /obj/item/weapon/dnainjector/remoteview diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm index 27cbff53547..19c4661c707 100644 --- a/code/game/objects/items/weapons/tanks/tanks.dm +++ b/code/game/objects/items/weapons/tanks/tanks.dm @@ -51,7 +51,6 @@ if(C.internal == src) to_chat(C, "You close \the [src] valve.") C.internal = null - C.update_internals_hud_icon(0) else var/can_open_valve = 0 if(C.get_organ_slot("breathing_tube")) @@ -71,7 +70,6 @@ if(!silent) to_chat(C, "You open \the [src] valve.") C.internal = src - C.update_internals_hud_icon(1) else if(!silent) to_chat(C, "You are not wearing a suitable mask or helmet.") diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index e3cb19fb6e9..597cc2b3ae2 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -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) diff --git a/code/modules/admin/verbs/honksquad.dm b/code/modules/admin/verbs/honksquad.dm index b437476eb32..ebb4d799d39 100644 --- a/code/modules/admin/verbs/honksquad.dm +++ b/code/modules/admin/verbs/honksquad.dm @@ -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("Mission: [input].") diff --git a/code/modules/admin/verbs/infiltratorteam_syndicate.dm b/code/modules/admin/verbs/infiltratorteam_syndicate.dm index 4c6d5248a6e..e3ff37dc0fa 100644 --- a/code/modules/admin/verbs/infiltratorteam_syndicate.dm +++ b/code/modules/admin/verbs/infiltratorteam_syndicate.dm @@ -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, "You are a [!syndicate_leader_selected?"Infiltrator":"Lead Infiltrator"] in the service of the Syndicate. \nYour current mission is: [input]") to_chat(new_syndicate_infiltrator, "You are equipped with an uplink implant to help you achieve your objectives. ((activate it via button in top left of screen))") @@ -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) diff --git a/code/modules/admin/verbs/one_click_antag.dm b/code/modules/admin/verbs/one_click_antag.dm index d4734e92b53..78b1b84a595 100644 --- a/code/modules/admin/verbs/one_click_antag.dm +++ b/code/modules/admin/verbs/one_click_antag.dm @@ -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. diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 6caae2b84bd..27b6c38a469 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -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. diff --git a/code/modules/admin/verbs/striketeam.dm b/code/modules/admin/verbs/striketeam.dm index 83e8d617210..b2a803cfdb7 100644 --- a/code/modules/admin/verbs/striketeam.dm +++ b/code/modules/admin/verbs/striketeam.dm @@ -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) diff --git a/code/modules/admin/verbs/striketeam_syndicate.dm b/code/modules/admin/verbs/striketeam_syndicate.dm index da6d981a890..744db24ab85 100644 --- a/code/modules/admin/verbs/striketeam_syndicate.dm +++ b/code/modules/admin/verbs/striketeam_syndicate.dm @@ -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) diff --git a/code/modules/awaymissions/mission_code/wildwest.dm b/code/modules/awaymissions/mission_code/wildwest.dm index 465e2a3056f..5effa505d7a 100644 --- a/code/modules/awaymissions/mission_code/wildwest.dm +++ b/code/modules/awaymissions/mission_code/wildwest.dm @@ -78,7 +78,7 @@ to_chat(user, "Your wish is granted, but at a terrible cost...") 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 diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index 94b9e50d37b..ec20cd0cdc5 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -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.*/ diff --git a/code/modules/clothing/under/accessories/accessory.dm b/code/modules/clothing/under/accessories/accessory.dm index 65a47cc8338..2237ce8d7db 100644 --- a/code/modules/clothing/under/accessories/accessory.dm +++ b/code/modules/clothing/under/accessories/accessory.dm @@ -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 diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm index 64bb91a9db4..d180bb9c2ac 100644 --- a/code/modules/flufftext/Hallucination.dm +++ b/code/modules/flufftext/Hallucination.dm @@ -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) diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm index ae67c3d78fd..b304c663929 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm @@ -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 diff --git a/code/modules/mob/living/carbon/alien/humanoid/life.dm b/code/modules/mob/living/carbon/alien/humanoid/life.dm index 580ec3af3cf..a13fce956da 100644 --- a/code/modules/mob/living/carbon/alien/humanoid/life.dm +++ b/code/modules/mob/living/carbon/alien/humanoid/life.dm @@ -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() diff --git a/code/modules/mob/living/carbon/alien/life.dm b/code/modules/mob/living/carbon/alien/life.dm index 80585fad863..d3ecc9e3e1c 100644 --- a/code/modules/mob/living/carbon/alien/life.dm +++ b/code/modules/mob/living/carbon/alien/life.dm @@ -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 diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 06110242eba..5cf6df7fe60 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -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, "[src] is not wearing a suitable mask or helmet!") return internal = ITEM - update_internals_hud_icon(1) + update_action_buttons_icon() visible_message("[usr] [internal ? "opens" : "closes"] the valve on [src]'s [ITEM].", \ "[usr] [internal ? "opens" : "closes"] the valve on [src]'s [ITEM].") @@ -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) diff --git a/code/modules/mob/living/carbon/carbon_defines.dm b/code/modules/mob/living/carbon/carbon_defines.dm index 4de6b16a687..7ed39d78382 100644 --- a/code/modules/mob/living/carbon/carbon_defines.dm +++ b/code/modules/mob/living/carbon/carbon_defines.dm @@ -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 diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 1984cd379be..4029be62d0d 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -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) diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm index c95bb0bd243..92afc310791 100644 --- a/code/modules/mob/living/carbon/human/inventory.dm +++ b/code/modules/mob/living/carbon/human/inventory.dm @@ -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() diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 8c2106f2303..fe210b697d1 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -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. diff --git a/code/modules/mob/living/carbon/human/say.dm b/code/modules/mob/living/carbon/human/say.dm index 63982b86948..d9d1c9723d7 100644 --- a/code/modules/mob/living/carbon/human/say.dm +++ b/code/modules/mob/living/carbon/human/say.dm @@ -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) diff --git a/code/modules/mob/living/carbon/human/species/abductor.dm b/code/modules/mob/living/carbon/human/species/abductor.dm index 75b19395dad..3e1bb968c81 100644 --- a/code/modules/mob/living/carbon/human/species/abductor.dm +++ b/code/modules/mob/living/carbon/human/species/abductor.dm @@ -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, diff --git a/code/modules/mob/living/carbon/human/species/golem.dm b/code/modules/mob/living/carbon/human/species/golem.dm index 3fbf0a4d8c1..c289ba3a19e 100644 --- a/code/modules/mob/living/carbon/human/species/golem.dm +++ b/code/modules/mob/living/carbon/human/species/golem.dm @@ -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" diff --git a/code/modules/mob/living/carbon/human/species/plasmaman.dm b/code/modules/mob/living/carbon/human/species/plasmaman.dm index 9a5e05723a9..28f92654100 100644 --- a/code/modules/mob/living/carbon/human/species/plasmaman.dm +++ b/code/modules/mob/living/carbon/human/species/plasmaman.dm @@ -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, "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.") 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, "You feel your face freezing and an icicle forming in your lungs!") - else if(breath.temperature > heat_level_1) - if(prob(20)) - to_chat(src, "You feel your face burning and a searing heat in your lungs!") - - 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") diff --git a/code/modules/mob/living/carbon/human/species/shadow.dm b/code/modules/mob/living/carbon/human/species/shadow.dm index 6a48cda5811..7480d7e3a66 100644 --- a/code/modules/mob/living/carbon/human/species/shadow.dm +++ b/code/modules/mob/living/carbon/human/species/shadow.dm @@ -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") \ No newline at end of file + H.clear_alert("lightexposure") + ..() \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/species/skeleton.dm b/code/modules/mob/living/carbon/human/species/skeleton.dm index eef78948f7a..d207dc20703 100644 --- a/code/modules/mob/living/carbon/human/species/skeleton.dm +++ b/code/modules/mob/living/carbon/human/species/skeleton.dm @@ -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!", diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 7a1c147a927..d59a2e15a39 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -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, "You feel your face freezing and an icicle forming in your lungs!") - else if(breath.temperature > heat_level_1) - if(prob(20)) - to_chat(H, "You feel your face burning and a searing heat in your lungs!") - - - - 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 diff --git a/code/modules/mob/living/carbon/human/species/station.dm b/code/modules/mob/living/carbon/human/species/station.dm index 0d5b14db6c2..b895ed0fdd4 100644 --- a/code/modules/mob/living/carbon/human/species/station.dm +++ b/code/modules/mob/living/carbon/human/species/station.dm @@ -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, "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.") 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, " You feel an invigorating coldness in your lungs!") - if(breath.temperature > heat_level_1) - if(prob(20)) - to_chat(H, "You feel your face burning and a searing heat in your lungs!") - - 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") + ) \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 90ee068486f..e06edd7fcaf 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -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" diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index 5e09625a776..15938e39ef2 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -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) diff --git a/code/modules/mob/living/carbon/superheroes.dm b/code/modules/mob/living/carbon/superheroes.dm index 1c44c307cb7..f98b2563f08 100644 --- a/code/modules/mob/living/carbon/superheroes.dm +++ b/code/modules/mob/living/carbon/superheroes.dm @@ -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) diff --git a/code/modules/mob/living/simple_animal/friendly/cat.dm b/code/modules/mob/living/simple_animal/friendly/cat.dm index 5f977bfd508..501bfd1e798 100644 --- a/code/modules/mob/living/simple_animal/friendly/cat.dm +++ b/code/modules/mob/living/simple_animal/friendly/cat.dm @@ -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 diff --git a/code/modules/mob/living/simple_animal/friendly/corgi.dm b/code/modules/mob/living/simple_animal/friendly/corgi.dm index a6d61aba1da..727318ac2c7 100644 --- a/code/modules/mob/living/simple_animal/friendly/corgi.dm +++ b/code/modules/mob/living/simple_animal/friendly/corgi.dm @@ -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 diff --git a/code/modules/mob/living/simple_animal/friendly/fox.dm b/code/modules/mob/living/simple_animal/friendly/fox.dm index a31c1cb099f..6edfc6f42c9 100644 --- a/code/modules/mob/living/simple_animal/friendly/fox.dm +++ b/code/modules/mob/living/simple_animal/friendly/fox.dm @@ -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) diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index fc331fb74b9..82a9778ab47 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -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 diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index deda65c3f5c..98a34066749 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -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].") diff --git a/code/modules/station_goals/dna_vault.dm b/code/modules/station_goals/dna_vault.dm index 977899a3195..70a5d522678 100644 --- a/code/modules/station_goals/dna_vault.dm +++ b/code/modules/station_goals/dna_vault.dm @@ -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, "You suddenly don't feel the need to breathe anymore. You also don't feel any cold anymore.") - 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, "You can suddenly see through walls.") grant_power(H, XRAYBLOCK, XRAY) diff --git a/code/modules/surgery/organs/lungs.dm b/code/modules/surgery/organs/lungs.dm new file mode 100644 index 00000000000..b730c4d559b --- /dev/null +++ b/code/modules/surgery/organs/lungs.dm @@ -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, "You feel [cold_message] in your [name]!") + + 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, "You feel [hot_message] in your [name]!") + +/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 \ No newline at end of file diff --git a/code/modules/surgery/organs/organ.dm b/code/modules/surgery/organs/organ.dm index a5ad0fabe91..f43438417d5 100644 --- a/code/modules/surgery/organs/organ.dm +++ b/code/modules/surgery/organs/organ.dm @@ -1,5 +1,3 @@ -var/list/organ_cache = list() - /obj/item/organ name = "organ" icon = 'icons/obj/surgery.dmi' diff --git a/code/modules/surgery/organs/organ_internal.dm b/code/modules/surgery/organs/organ_internal.dm index 2446db5a3f3..90932612438 100644 --- a/code/modules/surgery/organs/organ_internal.dm +++ b/code/modules/surgery/organs/organ_internal.dm @@ -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" diff --git a/code/modules/surgery/organs/subtypes/drask.dm b/code/modules/surgery/organs/subtypes/drask.dm index 6e1e6662d0a..9c204cd92f3 100644 --- a/code/modules/surgery/organs/subtypes/drask.dm +++ b/code/modules/surgery/organs/subtypes/drask.dm @@ -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' diff --git a/code/modules/surgery/surgery.dm b/code/modules/surgery/surgery.dm index f5d49f100d2..56da8f031e3 100644 --- a/code/modules/surgery/surgery.dm +++ b/code/modules/surgery/surgery.dm @@ -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 diff --git a/icons/mob/screen_alert.dmi b/icons/mob/screen_alert.dmi index 297f9a9aae2..aa3916b07d6 100644 Binary files a/icons/mob/screen_alert.dmi and b/icons/mob/screen_alert.dmi differ diff --git a/icons/mob/screen_gen.dmi b/icons/mob/screen_gen.dmi index 8ca8456ea39..4110876e272 100644 Binary files a/icons/mob/screen_gen.dmi and b/icons/mob/screen_gen.dmi differ diff --git a/icons/mob/screen_ninja.dmi b/icons/mob/screen_ninja.dmi index bbbf743533e..0f527241e0d 100644 Binary files a/icons/mob/screen_ninja.dmi and b/icons/mob/screen_ninja.dmi differ diff --git a/icons/obj/surgery.dmi b/icons/obj/surgery.dmi index cccdb4d16fb..a47c56cba87 100644 Binary files a/icons/obj/surgery.dmi and b/icons/obj/surgery.dmi differ diff --git a/paradise.dme b/paradise.dme index 13fed4dee9a..99bfb2cab03 100644 --- a/paradise.dme +++ b/paradise.dme @@ -2139,6 +2139,7 @@ #include "code\modules\surgery\organs\blood.dm" #include "code\modules\surgery\organs\body_egg.dm" #include "code\modules\surgery\organs\helpers.dm" +#include "code\modules\surgery\organs\lungs.dm" #include "code\modules\surgery\organs\organ.dm" #include "code\modules\surgery\organs\organ_external.dm" #include "code\modules\surgery\organs\organ_icon.dm"