From c8b89a6e21c68b2dc0e9bd5aea797cf3acbd3098 Mon Sep 17 00:00:00 2001 From: itseasytosee <55666666+itseasytosee@users.noreply.github.com> Date: Mon, 5 Sep 2022 21:16:41 -0500 Subject: [PATCH] Stomach get_availability() now checks for NO_HUNGER instead of broken trait that no mobs have. (#69674) * Organtraits * spellcheck * etheral * plasma change * plasma p2 * appendix * appendix fix * Improvments --- code/__DEFINES/DNA.dm | 2 +- code/game/objects/items/devices/scanners/health_analyzer.dm | 2 +- code/modules/mob/living/carbon/human/species.dm | 2 +- .../mob/living/carbon/human/species_types/plasmamen.dm | 3 +-- .../mob/living/carbon/human/species_types/skeletons.dm | 2 +- code/modules/surgery/organs/_organ.dm | 4 +++- code/modules/surgery/organs/appendix.dm | 2 +- code/modules/surgery/organs/lungs.dm | 1 + code/modules/surgery/organs/stomach/_stomach.dm | 4 +++- code/modules/surgery/organs/stomach/stomach_ethereal.dm | 3 +-- 10 files changed, 14 insertions(+), 11 deletions(-) diff --git a/code/__DEFINES/DNA.dm b/code/__DEFINES/DNA.dm index ab43c592c51..b4bc1882322 100644 --- a/code/__DEFINES/DNA.dm +++ b/code/__DEFINES/DNA.dm @@ -96,7 +96,7 @@ #define BLOOD_CLANS 21 /// Stops species from spawning with tongue. Doesn't actually make the species able to talk with no tongue #define NO_TONGUE 22 - +#define NOAPPENDIX 23 //organ slots #define ORGAN_SLOT_ADAMANTINE_RESONATOR "adamantine_resonator" diff --git a/code/game/objects/items/devices/scanners/health_analyzer.dm b/code/game/objects/items/devices/scanners/health_analyzer.dm index 4b5ecdafc8b..bd5be4f616b 100644 --- a/code/game/objects/items/devices/scanners/health_analyzer.dm +++ b/code/game/objects/items/devices/scanners/health_analyzer.dm @@ -277,7 +277,7 @@ missing_organs += "lungs" if(!(TRAIT_NOMETABOLISM in the_dudes_species.species_traits) && !humantarget.getorganslot(ORGAN_SLOT_LIVER)) missing_organs += "liver" - if(!(NOSTOMACH in the_dudes_species.species_traits) && !humantarget.getorganslot(ORGAN_SLOT_STOMACH)) + if(!(TRAIT_NOHUNGER in the_dudes_species.species_traits) && !humantarget.getorganslot(ORGAN_SLOT_STOMACH)) missing_organs += "stomach" if(!(NO_TONGUE in the_dudes_species.species_traits) && !humantarget.getorganslot(ORGAN_SLOT_TONGUE)) missing_organs += "tongue" diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 119c60596ee..8738d2a2431 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -201,7 +201,7 @@ GLOBAL_LIST_EMPTY(features_by_species) var/gib_anim = "gibbed-h" - //Do NOT remove by setting to null. use OR make a RESPECTIVE TRAIT (removing stomach? add the NOSTOMACH trait to your species) + //Do NOT remove by setting to null. use OR make an ASSOCIATED TRAIT. //why does it work this way? because traits also disable the downsides of not having an organ, removing organs but not having the trait will make your species die ///Replaces default brain with a different organ diff --git a/code/modules/mob/living/carbon/human/species_types/plasmamen.dm b/code/modules/mob/living/carbon/human/species_types/plasmamen.dm index 07d56e8c45e..1a98954eb41 100644 --- a/code/modules/mob/living/carbon/human/species_types/plasmamen.dm +++ b/code/modules/mob/living/carbon/human/species_types/plasmamen.dm @@ -5,14 +5,13 @@ say_mod = "rattles" sexes = 0 meat = /obj/item/stack/sheet/mineral/plasma - species_traits = list(NOBLOOD,NOTRANSSTING, HAS_BONE) + species_traits = list(NOBLOOD, NOTRANSSTING, HAS_BONE, NOAPPENDIX) // plasmemes get hard to wound since they only need a severe bone wound to dismember, but unlike skellies, they can't pop their bones back into place inherent_traits = list( TRAIT_GENELESS, TRAIT_HARDLY_WOUNDED, TRAIT_RADIMMUNE, TRAIT_RESISTCOLD, - TRAIT_NOHUNGER, ) inherent_biotypes = MOB_HUMANOID|MOB_MINERAL diff --git a/code/modules/mob/living/carbon/human/species_types/skeletons.dm b/code/modules/mob/living/carbon/human/species_types/skeletons.dm index 5b1d7e32555..f18d7581627 100644 --- a/code/modules/mob/living/carbon/human/species_types/skeletons.dm +++ b/code/modules/mob/living/carbon/human/species_types/skeletons.dm @@ -5,7 +5,7 @@ say_mod = "rattles" sexes = 0 meat = /obj/item/food/meat/slab/human/mutant/skeleton - species_traits = list(NOBLOOD, HAS_BONE, NOTRANSSTING, NOEYESPRITES, NO_DNA_COPY) + species_traits = list(NOBLOOD, HAS_BONE, NOTRANSSTING, NOEYESPRITES, NO_DNA_COPY, NOAPPENDIX) inherent_traits = list( TRAIT_CAN_USE_FLIGHT_POTION, TRAIT_EASYDISMEMBER, diff --git a/code/modules/surgery/organs/_organ.dm b/code/modules/surgery/organs/_organ.dm index 1665747bf95..ae0c9aaccdd 100644 --- a/code/modules/surgery/organs/_organ.dm +++ b/code/modules/surgery/organs/_organ.dm @@ -284,7 +284,9 @@ INITIALIZE_IMMEDIATE(/obj/item/organ) * returns whether the species should innately have this organ. * * regenerate organs works with generic organs, so we need to get whether it can accept certain organs just by what this returns. - * This is set to return true or false, depending on if a species has a specific organless trait. stomach for example checks if the species has NOSTOMACH and return based on that. + * This is set to return true or false, depending on if a species has a trait that would nulify the purpose of the organ. + * For example, lungs won't be given if you have NO_BREATH, stomachs check for NO_HUNGER, and livers check for NO_METABOLISM. + * If you want a carbon to have a trait that normally blocks an organ but still want the organ. Attach the trait to the organ using the organ_traits var * Arguments: * owner_species - species, needed to return whether the species has an organ specific trait */ diff --git a/code/modules/surgery/organs/appendix.dm b/code/modules/surgery/organs/appendix.dm index 38c5da586eb..554929babdb 100644 --- a/code/modules/surgery/organs/appendix.dm +++ b/code/modules/surgery/organs/appendix.dm @@ -70,7 +70,7 @@ /obj/item/organ/internal/appendix/get_availability(datum/species/owner_species) - return !(TRAIT_NOHUNGER in owner_species.inherent_traits) + return !((TRAIT_NOHUNGER in owner_species.inherent_traits) || (NOAPPENDIX in owner_species.species_traits)) /obj/item/organ/internal/appendix/Remove(mob/living/carbon/organ_owner, special = FALSE) REMOVE_TRAIT(organ_owner, TRAIT_DISEASELIKE_SEVERITY_MEDIUM, type) diff --git a/code/modules/surgery/organs/lungs.dm b/code/modules/surgery/organs/lungs.dm index 6e4a516a21c..ea25d7f8502 100644 --- a/code/modules/surgery/organs/lungs.dm +++ b/code/modules/surgery/organs/lungs.dm @@ -540,6 +540,7 @@ name = "plasma filter" desc = "A spongy rib-shaped mass for filtering plasma from the air." icon_state = "lungs-plasma" + organ_traits = list(TRAIT_NOHUNGER) // A fresh breakfast of plasma is a great start to any morning. safe_oxygen_min = 0 //We don't breathe this safe_plasma_min = 4 //We breathe THIS! diff --git a/code/modules/surgery/organs/stomach/_stomach.dm b/code/modules/surgery/organs/stomach/_stomach.dm index 9832b805324..19d6752cad7 100644 --- a/code/modules/surgery/organs/stomach/_stomach.dm +++ b/code/modules/surgery/organs/stomach/_stomach.dm @@ -206,7 +206,7 @@ human.remove_movespeed_modifier(/datum/movespeed_modifier/hunger) /obj/item/organ/internal/stomach/get_availability(datum/species/owner_species) - return !(NOSTOMACH in owner_species.inherent_traits) + return !((TRAIT_NOHUNGER in owner_species.inherent_traits) || (NOSTOMACH in owner_species.species_traits)) /obj/item/organ/internal/stomach/proc/handle_disgust(mob/living/carbon/human/disgusted, delta_time, times_fired) var/old_disgust = disgusted.old_disgust @@ -266,6 +266,7 @@ /obj/item/organ/internal/stomach/bone desc = "You have no idea what this strange ball of bones does." metabolism_efficiency = 0.025 //very bad + organ_traits = list(TRAIT_NOHUNGER) /// How much [BRUTE] damage milk heals every second var/milk_brute_healing = 2.5 /// How much [BURN] damage milk heals every second @@ -288,6 +289,7 @@ /obj/item/organ/internal/stomach/bone/plasmaman name = "digestive crystal" icon_state = "stomach-p" + organ_traits = list() desc = "A strange crystal that is responsible for metabolizing the unseen energy force that feeds plasmamen." metabolism_efficiency = 0.06 milk_burn_healing = 0 diff --git a/code/modules/surgery/organs/stomach/stomach_ethereal.dm b/code/modules/surgery/organs/stomach/stomach_ethereal.dm index ebb9164b500..1750bb55ae2 100644 --- a/code/modules/surgery/organs/stomach/stomach_ethereal.dm +++ b/code/modules/surgery/organs/stomach/stomach_ethereal.dm @@ -2,6 +2,7 @@ name = "biological battery" icon_state = "stomach-p" //Welp. At least it's more unique in functionaliy. desc = "A crystal-like organ that stores the electric charge of ethereals." + organ_traits = list(TRAIT_NOHUNGER) // We have our own hunger mechanic. ///basically satiety but electrical var/crystal_charge = ETHEREAL_CHARGE_FULL ///used to keep ethereals from spam draining power sources @@ -16,12 +17,10 @@ . = ..() RegisterSignal(owner, COMSIG_PROCESS_BORGCHARGER_OCCUPANT, .proc/charge) RegisterSignal(owner, COMSIG_LIVING_ELECTROCUTE_ACT, .proc/on_electrocute) - ADD_TRAIT(owner, TRAIT_NOHUNGER, REF(src)) /obj/item/organ/internal/stomach/ethereal/Remove(mob/living/carbon/carbon, special = FALSE) UnregisterSignal(owner, COMSIG_PROCESS_BORGCHARGER_OCCUPANT) UnregisterSignal(owner, COMSIG_LIVING_ELECTROCUTE_ACT) - REMOVE_TRAIT(owner, TRAIT_NOHUNGER, REF(src)) owner.clear_mood_event("charge") carbon.clear_alert(ALERT_ETHEREAL_CHARGE)