From d83796f208c5edada950f6e580b004396cf1f2ee Mon Sep 17 00:00:00 2001 From: Geeves Date: Mon, 1 Mar 2021 17:42:34 +0200 Subject: [PATCH] Ling Space Adaption (#10982) --- code/game/gamemodes/changeling/helpers/_framework.dm | 1 + code/game/gamemodes/changeling/helpers/_store.dm | 7 +++++++ .../changeling/implements/powers/resources.dm | 6 ++++++ code/modules/mob/living/carbon/breathe.dm | 6 +++++- code/modules/mob/living/carbon/human/human.dm | 5 ++--- code/modules/mob/living/carbon/human/human_helpers.dm | 10 +++++++++- code/modules/mob/living/carbon/human/life.dm | 2 +- code/modules/mob/mob_helpers.dm | 8 ++++++-- html/changelogs/geeves-ling_space_adaption.yml | 6 ++++++ 9 files changed, 43 insertions(+), 8 deletions(-) create mode 100644 html/changelogs/geeves-ling_space_adaption.yml diff --git a/code/game/gamemodes/changeling/helpers/_framework.dm b/code/game/gamemodes/changeling/helpers/_framework.dm index 8c0a05608a1..69b946a76e4 100644 --- a/code/game/gamemodes/changeling/helpers/_framework.dm +++ b/code/game/gamemodes/changeling/helpers/_framework.dm @@ -10,6 +10,7 @@ var/global/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","E var/chem_recharge_rate = 0.5 var/chem_storage = 50 var/sting_range = 1 + var/space_adapted = FALSE var/changelingID = "Changeling" var/geneticdamage = 0 var/isabsorbing = 0 diff --git a/code/game/gamemodes/changeling/helpers/_store.dm b/code/game/gamemodes/changeling/helpers/_store.dm index b07c6e3a03c..b8a56777964 100644 --- a/code/game/gamemodes/changeling/helpers/_store.dm +++ b/code/game/gamemodes/changeling/helpers/_store.dm @@ -175,6 +175,13 @@ var/list/datum/power/changeling/powerinstances = list() isVerb = FALSE verbpath = /mob/proc/changeling_engorgedglands +/datum/power/changeling/space_adaption + name = "UPGRADE: Space Adaption" + desc = "Our body chemistry changes to become resistant to the effects of low pressure, and we no longer have the need to breathe." + genomecost = 5 + isVerb = FALSE + verbpath = /mob/proc/changeling_spaceadaption + /datum/power/changeling/rapid_regeneration name = "Rapid Regeneration" desc = "We evolve the ability to rapidly regenerate, negating the need for stasis." diff --git a/code/game/gamemodes/changeling/implements/powers/resources.dm b/code/game/gamemodes/changeling/implements/powers/resources.dm index fa7b613fad8..fe2f5b9badc 100644 --- a/code/game/gamemodes/changeling/implements/powers/resources.dm +++ b/code/game/gamemodes/changeling/implements/powers/resources.dm @@ -10,6 +10,12 @@ changeling.chem_storage += 50 return TRUE +//removes the need to breathe, removes effects of very low pressure +/mob/proc/changeling_spaceadaption() + var/datum/changeling/changeling = mind.antag_datums[MODE_CHANGELING] + changeling.space_adapted = TRUE + return TRUE + // HIVE MIND UPLOAD/DOWNLOAD DNA var/list/datum/absorbed_dna/hivemind_bank = list() diff --git a/code/modules/mob/living/carbon/breathe.dm b/code/modules/mob/living/carbon/breathe.dm index 63ce8f01acc..cbc30a15a97 100644 --- a/code/modules/mob/living/carbon/breathe.dm +++ b/code/modules/mob/living/carbon/breathe.dm @@ -21,7 +21,11 @@ return from.trans_to_holder(target,amount,multiplier,copy) //complete transfer /mob/living/carbon/proc/breathe(var/volume_needed = BREATH_VOLUME) - if(species && (species.flags & NO_BREATHE)) return + if(species && (species.flags & NO_BREATHE)) + return + var/datum/changeling/changeling = get_antag_datum(MODE_CHANGELING) + if(changeling?.space_adapted) + return volume_needed *= (species?.breath_vol_mul || 1) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index db4609b8ae4..b5a781e4ffd 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1851,9 +1851,8 @@ /mob/living/carbon/human/need_breathe() if(!(mNobreath in mutations) && species.breathing_organ && species.has_organ[species.breathing_organ]) - return 1 - else - return 0 + return TRUE + return FALSE //Get fluffy numbers /mob/living/carbon/human/proc/blood_pressure() diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index 423d41913b9..7cf342d7955 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -279,4 +279,12 @@ set_death_time(CREW, world.time) /mob/living/carbon/human/get_contained_external_atoms() - . = ..() - organs \ No newline at end of file + . = ..() - organs + +/mob/living/carbon/human/proc/pressure_resistant() + if(COLD_RESISTANCE in mutations) + return TRUE + var/datum/changeling/changeling = get_antag_datum(MODE_CHANGELING) + if(changeling?.space_adapted) + return TRUE + return FALSE \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index a373aa2f35e..129e09721b8 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -427,7 +427,7 @@ else if(adjusted_pressure >= species.hazard_low_pressure) pressure_alert = -1 else - if(!(COLD_RESISTANCE in mutations)) + if(!pressure_resistant()) var/list/obj/item/organ/external/organs = get_damageable_organs() for(var/obj/item/organ/external/O in organs) if(QDELETED(O)) diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index c6716c4ec1e..bb0844d244c 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -1206,7 +1206,11 @@ proc/is_blind(A) sdisabilities &= ~DEAF /mob/proc/get_antag_datum(var/antag_role) - return + if(!mind) + return + var/datum/D = mind.antag_datums[antag_role] + if(D) + return D /mob/dump_contents() for(var/thing in get_contained_external_atoms()) @@ -1223,4 +1227,4 @@ proc/is_blind(A) var/obj/item/grab/G = thing if(G.state >= GRAB_NECK) return TRUE - return FALSE \ No newline at end of file + return FALSE diff --git a/html/changelogs/geeves-ling_space_adaption.yml b/html/changelogs/geeves-ling_space_adaption.yml new file mode 100644 index 00000000000..e256a761001 --- /dev/null +++ b/html/changelogs/geeves-ling_space_adaption.yml @@ -0,0 +1,6 @@ +author: Geeves + +delete-after: True + +changes: + - rscadd: "Gave lings the ability to upgrade space adaption for 5 genome points, removing their need to breathe, and nullifying the damage taken from low pressure." \ No newline at end of file