diff --git a/code/__DEFINES/genetics.dm b/code/__DEFINES/genetics.dm index 6afa76a02b0..c8916e31f40 100644 --- a/code/__DEFINES/genetics.dm +++ b/code/__DEFINES/genetics.dm @@ -165,4 +165,5 @@ #define NOZOMBIE 20 #define NO_GERMS 21 #define NO_DECAY 22 -#define PIERCEIMMUNE 23 \ No newline at end of file +#define PIERCEIMMUNE 23 +#define NO_HUNGER 24 \ No newline at end of file diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index 25540dd4965..0a551570472 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -67,8 +67,8 @@ // Taste sensitivity - lower is more sensitive // Represents the minimum portion of total taste the mob can sense #define TASTE_SENSITIVITY_NORMAL 15 -#define TASTE_SENSITIVITY_SHARP 7.5 -#define TASTE_SENSITIVITY_DULL 20 +#define TASTE_SENSITIVITY_SHARP 10 +#define TASTE_SENSITIVITY_DULL 25 #define TASTE_SENSITIVITY_NO_TASTE 101 // Reagent type flags, defines the types of mobs this reagent will affect diff --git a/code/datums/diseases/advance/symptoms/weight.dm b/code/datums/diseases/advance/symptoms/weight.dm index 1378df4d05e..98b940f2b83 100644 --- a/code/datums/diseases/advance/symptoms/weight.dm +++ b/code/datums/diseases/advance/symptoms/weight.dm @@ -36,4 +36,4 @@ Bonus else to_chat(M, "[pick("So hungry...", "You'd kill someone for a bite of food...", "Hunger cramps seize you...")]") M.overeatduration = max(M.overeatduration - 100, 0) - M.nutrition = max(M.nutrition - 100, 0) \ No newline at end of file + M.adjust_nutrition(-100) \ No newline at end of file diff --git a/code/datums/diseases/food_poisoning.dm b/code/datums/diseases/food_poisoning.dm index 2e7d083455b..4df31ec57d9 100644 --- a/code/datums/diseases/food_poisoning.dm +++ b/code/datums/diseases/food_poisoning.dm @@ -63,7 +63,7 @@ if(affected_mob.nutrition > 10) affected_mob.visible_message("[affected_mob] vomits on the floor profusely!") affected_mob.fakevomit(no_text = 1) - affected_mob.nutrition -= rand(3,5) + affected_mob.adjust_nutrition(-rand(3,5)) else to_chat(affected_mob, "Your stomach lurches painfully!") affected_mob.visible_message("[affected_mob] gags and retches!") diff --git a/code/datums/diseases/tuberculosis.dm b/code/datums/diseases/tuberculosis.dm index 9aad7ff6d17..9a305c758e3 100644 --- a/code/datums/diseases/tuberculosis.dm +++ b/code/datums/diseases/tuberculosis.dm @@ -52,7 +52,7 @@ if(prob(3)) to_chat(affected_mob, "[pick("Your stomach silently rumbles...", "Your stomach seizes up and falls limp, muscles dead and lifeless.", "You could eat a crayon")]") affected_mob.overeatduration = max(affected_mob.overeatduration - 100, 0) - affected_mob.nutrition = max(affected_mob.nutrition - 100, 0) + affected_mob.adjust_nutrition(-100) if(prob(15)) to_chat(affected_mob, "[pick("You feel uncomfortably hot...", "You feel like unzipping your jumpsuit", "You feel like taking off some clothes...")]") affected_mob.bodytemperature += 40 diff --git a/code/datums/spells/cluwne.dm b/code/datums/spells/cluwne.dm index 09f98994f1e..6a87419886c 100644 --- a/code/datums/spells/cluwne.dm +++ b/code/datums/spells/cluwne.dm @@ -18,7 +18,7 @@ idiot_brain.insert(src, make_cluwne = 0) idiot_brain.dna = dna.Clone() setBrainLoss(80) - nutrition = 9000 + set_nutrition(9000) overeatduration = 9000 Confused(30) if(mind) @@ -44,7 +44,7 @@ /mob/living/carbon/human/proc/makeAntiCluwne() to_chat(src, "You don't feel very funny.") adjustBrainLoss(-120) - nutrition = NUTRITION_LEVEL_STARVING + set_nutrition(NUTRITION_LEVEL_STARVING) overeatduration = 0 SetConfused(0) SetJitter(0) diff --git a/code/game/gamemodes/changeling/powers/absorb.dm b/code/game/gamemodes/changeling/powers/absorb.dm index b5ad5ab9f8a..16251722632 100644 --- a/code/game/gamemodes/changeling/powers/absorb.dm +++ b/code/game/gamemodes/changeling/powers/absorb.dm @@ -58,7 +58,7 @@ changeling.absorb_dna(target, user) if(user.nutrition < NUTRITION_LEVEL_WELL_FED) - user.nutrition = min((user.nutrition + target.nutrition), NUTRITION_LEVEL_WELL_FED) + user.set_nutrition(min((user.nutrition + target.nutrition), NUTRITION_LEVEL_WELL_FED)) if(target.mind)//if the victim has got a mind diff --git a/code/game/gamemodes/devil/devilinfo.dm b/code/game/gamemodes/devil/devilinfo.dm index 419034a9e1f..89d997831a3 100644 --- a/code/game/gamemodes/devil/devilinfo.dm +++ b/code/game/gamemodes/devil/devilinfo.dm @@ -162,7 +162,7 @@ var/global/list/lawlorify = list ( if(soulsOwned.Find(soul)) return soulsOwned += soul - owner.current.nutrition = NUTRITION_LEVEL_FULL + owner.current.set_nutrition(NUTRITION_LEVEL_FULL) to_chat(owner.current, "You feel satiated as you received a new soul.") update_hud() switch(SOULVALUE) diff --git a/code/game/gamemodes/vampire/vampire.dm b/code/game/gamemodes/vampire/vampire.dm index d696543cbdf..ac5ddc92f98 100644 --- a/code/game/gamemodes/vampire/vampire.dm +++ b/code/game/gamemodes/vampire/vampire.dm @@ -314,9 +314,9 @@ You are weak to holy things and starlight. Don't go into space and avoid the Cha var/mob/living/carbon/human/V = owner if(!H.ckey && !H.player_ghosted)//Only runs if there is no ckey and the body has not being ghosted while alive to_chat(V, "Feeding on [H] reduces your thirst, but you get no usable blood from them.") - V.nutrition = min(NUTRITION_LEVEL_WELL_FED, V.nutrition + 5) + V.set_nutrition(min(NUTRITION_LEVEL_WELL_FED, V.nutrition + 5)) else - V.nutrition = min(NUTRITION_LEVEL_WELL_FED, V.nutrition + (blood / 2)) + V.set_nutrition(min(NUTRITION_LEVEL_WELL_FED, V.nutrition + (blood / 2))) draining = null diff --git a/code/game/gamemodes/wizard/spellbook.dm b/code/game/gamemodes/wizard/spellbook.dm index 75c15c633bc..69bcfeb4a7a 100644 --- a/code/game/gamemodes/wizard/spellbook.dm +++ b/code/game/gamemodes/wizard/spellbook.dm @@ -861,10 +861,7 @@ /obj/item/spellbook/oneuse/smoke/recoil(mob/user as mob) ..() to_chat(user, "Your stomach rumbles...") - if(user.nutrition) - user.nutrition -= 200 - if(user.nutrition <= 0) - user.nutrition = 0 + user.adjust_nutrition(-200) /obj/item/spellbook/oneuse/blind spell = /obj/effect/proc_holder/spell/targeted/trigger/blind diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm index c9d7f10302a..695e01103ea 100644 --- a/code/game/machinery/computer/arcade.dm +++ b/code/game/machinery/computer/arcade.dm @@ -367,7 +367,7 @@ if(food <= 0) dat += "
You ran out of food and starved." if(emagged) - user.nutrition = 0 //yeah you pretty hongry + user.set_nutrition(0) //yeah you pretty hongry to_chat(user, "Your body instantly contracts to that of one who has not eaten in months. Agonizing cramps seize you as you fall to the floor.") if(fuel <= 0) dat += "
You ran out of fuel, and drift, slowly, into a star." @@ -467,7 +467,7 @@ sleep(30) atom_say("[M] violently throws up!") playsound(loc, 'sound/effects/splat.ogg', 50, 1) - M.nutrition -= 50 //lose a lot of food + M.adjust_nutrition(-50) //lose a lot of food var/turf/location = usr.loc if(istype(location, /turf/simulated)) location.add_vomit_floor(TRUE) diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm index c15aed3b757..00f88f51c6a 100644 --- a/code/game/machinery/rechargestation.dm +++ b/code/game/machinery/rechargestation.dm @@ -164,7 +164,7 @@ else if(istype(occupant, /mob/living/carbon/human)) var/mob/living/carbon/human/H = occupant if(H.get_int_organ(/obj/item/organ/internal/cell) && H.nutrition < 450) - H.nutrition = min(H.nutrition+recharge_speed_nutrition, 450) + H.set_nutrition(min(H.nutrition + recharge_speed_nutrition, 450)) if(repairs) H.heal_overall_damage(repairs, repairs, TRUE, 0, 1) diff --git a/code/game/objects/items/crayons.dm b/code/game/objects/items/crayons.dm index 1f7ad5c132b..4d27e5d175b 100644 --- a/code/game/objects/items/crayons.dm +++ b/code/game/objects/items/crayons.dm @@ -111,7 +111,7 @@ return playsound(loc, 'sound/items/eatfood.ogg', 50, 0) to_chat(user, "You take a [huffable ? "huff" : "bite"] of the [name]. Delicious!") - user.nutrition += 5 + user.adjust_nutrition(5) if(uses) uses -= 5 if(uses <= 0) diff --git a/code/game/objects/items/weapons/soap.dm b/code/game/objects/items/weapons/soap.dm index 912212d19c7..20cd0eb1e28 100644 --- a/code/game/objects/items/weapons/soap.dm +++ b/code/game/objects/items/weapons/soap.dm @@ -31,7 +31,7 @@ if(muncher && isdrask(muncher)) to_chat(user, "You take a bite of the [name]. Delicious!") playsound(user.loc, 'sound/items/eatfood.ogg', 50, 0) - user.nutrition += 2 + user.adjust_nutrition(2) else if(istype(target,/obj/effect/decal/cleanable)) user.visible_message("[user] begins to scrub \the [target.name] out with [src].") if(do_after(user, cleanspeed, target = target) && target) diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm index 24b49ad3781..754091a30db 100644 --- a/code/modules/admin/topic.dm +++ b/code/modules/admin/topic.dm @@ -1934,7 +1934,7 @@ H.reagents.add_reagent("ice", 40) logmsg = "cold." if("Hunger") - H.nutrition = NUTRITION_LEVEL_CURSED + H.set_nutrition(NUTRITION_LEVEL_CURSED) logmsg = "starvation." if("Cluwne") H.makeCluwne() diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm index 25ae26da3ad..2d3adacefbf 100644 --- a/code/modules/hydroponics/hydroponics.dm +++ b/code/modules/hydroponics/hydroponics.dm @@ -991,12 +991,12 @@ /obj/machinery/hydroponics/attack_animal(mob/living/user) if(istype(user, /mob/living/simple_animal/diona)) if(weedlevel > 0) - user.nutrition += weedlevel * 15 + user.adjust_nutrition(weedlevel * 15) adjustWeeds(-10) update_icon() visible_message("[user] begins rooting through [src], ripping out weeds and eating them noisily.","You begin rooting through [src], ripping out weeds and eating them noisily.") else if(nutrilevel < 10) - user.nutrition -= ((10 - nutrilevel) * 5) + user.adjust_nutrition(-((10 - nutrilevel) * 5)) adjustNutri(10) update_icon() visible_message("[user] secretes a trickle of green liquid from its tail, refilling [src]'s nutrient tray.","You secrete a trickle of green liquid from your tail, refilling [src]'s nutrient tray.") diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index de52fe192da..a56a63bb858 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -26,9 +26,9 @@ . = ..() if(.) if(nutrition && stat != DEAD) - nutrition -= hunger_drain / 10 + adjust_nutrition(-(hunger_drain * 0.1)) if(m_intent == MOVE_INTENT_RUN) - nutrition -= hunger_drain / 10 + adjust_nutrition(-(hunger_drain * 0.1)) if((FAT in mutations) && m_intent == MOVE_INTENT_RUN && bodytemperature <= 360) bodytemperature += 2 @@ -110,7 +110,7 @@ else if(T) T.add_vomit_floor() - nutrition -= lost_nutrition + adjust_nutrition(-lost_nutrition) if(stun) adjustToxLoss(-3) T = get_step(T, dir) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 0a860b6019f..0019aefbad3 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1900,6 +1900,16 @@ Eyes need to have significantly high darksight to shine unless the mob has the X .["Make superhero"] = "?_src_=vars;makesuper=[UID()]" . += "---" +/mob/living/carbon/human/adjust_nutrition(change) + if(NO_HUNGER in dna.species.species_traits) + return FALSE + return ..() + +/mob/living/carbon/human/set_nutrition(change) + if(NO_HUNGER in dna.species.species_traits) + return FALSE + return ..() + /mob/living/carbon/human/proc/special_post_clone_handling() if(mind && mind.assigned_role == "Cluwne") //HUNKE your suffering never stops makeCluwne() diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index bc3e1fdb3bd..2643d1f3102 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -597,54 +597,55 @@ if(status_flags & GODMODE) return 0 //godmode - //The fucking FAT mutation is the greatest shit ever. It makes everyone so hot and bothered. - if(CAN_BE_FAT in dna.species.species_traits) - if(FAT in mutations) - if(overeatduration < 100) - becomeSlim() - else - if(overeatduration > 500) - becomeFat() - - // nutrition decrease - if(nutrition > 0 && stat != DEAD) - // THEY HUNGER - var/hunger_rate = hunger_drain - if(satiety > 0) - satiety-- - if(satiety < 0) - satiety++ - if(prob(round(-satiety/40))) - Jitter(5) - hunger_rate = 3 * hunger_drain - nutrition = max(0, nutrition - hunger_rate) - - if(nutrition > NUTRITION_LEVEL_FULL) - if(overeatduration < 600) //capped so people don't take forever to unfat - overeatduration++ - - else - if(overeatduration > 1) - if(OBESITY in mutations) - overeatduration -= 1 // Those with obesity gene take twice as long to unfat + if(!(NO_HUNGER in dna.species.species_traits)) + //The fucking FAT mutation is the greatest shit ever. It makes everyone so hot and bothered. + if(CAN_BE_FAT in dna.species.species_traits) + if(FAT in mutations) + if(overeatduration < 100) + becomeSlim() else - overeatduration -= 2 + if(overeatduration > 500) + becomeFat() - //metabolism change - if(nutrition > NUTRITION_LEVEL_FAT) - metabolism_efficiency = 1 - else if(nutrition > NUTRITION_LEVEL_FED && satiety > 80) - if(metabolism_efficiency != 1.25) - to_chat(src, "You feel vigorous.") - metabolism_efficiency = 1.25 - else if(nutrition < NUTRITION_LEVEL_STARVING + 50) - if(metabolism_efficiency != 0.8) - to_chat(src, "You feel sluggish.") - metabolism_efficiency = 0.8 - else - if(metabolism_efficiency == 1.25) - to_chat(src, "You no longer feel vigorous.") - metabolism_efficiency = 1 + // nutrition decrease + if(nutrition > 0 && stat != DEAD) + // THEY HUNGER + var/hunger_rate = hunger_drain + if(satiety > 0) + satiety-- + if(satiety < 0) + satiety++ + if(prob(round(-satiety/40))) + Jitter(5) + hunger_rate = 3 * hunger_drain + adjust_nutrition(-hunger_rate) + + if(nutrition > NUTRITION_LEVEL_FULL) + if(overeatduration < 600) //capped so people don't take forever to unfat + overeatduration++ + + else + if(overeatduration > 1) + if(OBESITY in mutations) + overeatduration -= 1 // Those with obesity gene take twice as long to unfat + else + overeatduration -= 2 + + //metabolism change + if(nutrition > NUTRITION_LEVEL_FAT) + metabolism_efficiency = 1 + else if(nutrition > NUTRITION_LEVEL_FED && satiety > 80) + if(metabolism_efficiency != 1.25) + to_chat(src, "You feel vigorous.") + metabolism_efficiency = 1.25 + else if(nutrition < NUTRITION_LEVEL_STARVING + 50) + if(metabolism_efficiency != 0.8) + to_chat(src, "You feel sluggish.") + metabolism_efficiency = 0.8 + else + if(metabolism_efficiency == 1.25) + to_chat(src, "You no longer feel vigorous.") + metabolism_efficiency = 1 if(drowsyness) AdjustDrowsy(-1) diff --git a/code/modules/mob/living/carbon/human/species/_species.dm b/code/modules/mob/living/carbon/human/species/_species.dm index d3ce27a4704..1e753279059 100644 --- a/code/modules/mob/living/carbon/human/species/_species.dm +++ b/code/modules/mob/living/carbon/human/species/_species.dm @@ -814,6 +814,8 @@ H.healthdoll.cached_healthdoll_overlays = new_overlays /datum/species/proc/handle_hud_icons_nutrition(mob/living/carbon/human/H) + if(NO_HUNGER in species_traits) + return FALSE if(H.mind && H.mind.vampire && (H.mind in SSticker.mode.vampires)) //Vampires switch(H.nutrition) if(NUTRITION_LEVEL_FULL to INFINITY) diff --git a/code/modules/mob/living/carbon/human/species/abductor.dm b/code/modules/mob/living/carbon/human/species/abductor.dm index 64c5a4aa0b3..33b94cbabe0 100644 --- a/code/modules/mob/living/carbon/human/species/abductor.dm +++ b/code/modules/mob/living/carbon/human/species/abductor.dm @@ -11,13 +11,14 @@ "liver" = /obj/item/organ/internal/liver, "kidneys" = /obj/item/organ/internal/kidneys, "brain" = /obj/item/organ/internal/brain/abductor, - "appendix" = /obj/item/organ/internal/appendix, "eyes" = /obj/item/organ/internal/eyes/abductor //3 darksight. ) - species_traits = list(NO_BLOOD, NO_BREATHE, VIRUSIMMUNE, NOGUNS, NO_EXAMINE) + species_traits = list(NO_BLOOD, NO_BREATHE, VIRUSIMMUNE, NOGUNS, NO_HUNGER, NO_EXAMINE) dies_at_threshold = TRUE + taste_sensitivity = TASTE_SENSITIVITY_NO_TASTE + clothing_flags = HAS_UNDERWEAR | HAS_UNDERSHIRT | HAS_SOCKS dietflags = DIET_OMNI reagent_tag = PROCESS_ORG diff --git a/code/modules/mob/living/carbon/human/species/diona.dm b/code/modules/mob/living/carbon/human/species/diona.dm index 40fc2b001df..48664341623 100644 --- a/code/modules/mob/living/carbon/human/species/diona.dm +++ b/code/modules/mob/living/carbon/human/species/diona.dm @@ -91,9 +91,9 @@ H.clear_alert("nolight") else H.throw_alert("nolight", /obj/screen/alert/nolight) - H.nutrition += light_amount * 10 + H.adjust_nutrition(light_amount * 10) if(H.nutrition > NUTRITION_LEVEL_ALMOST_FULL) - H.nutrition = NUTRITION_LEVEL_ALMOST_FULL + H.set_nutrition(NUTRITION_LEVEL_ALMOST_FULL) if(light_amount > 0.2 && !H.suiciding) //if there's enough light, heal if(!pod && H.health <= 0) return diff --git a/code/modules/mob/living/carbon/human/species/golem.dm b/code/modules/mob/living/carbon/human/species/golem.dm index 4b816f7ab5d..a7f27a5753f 100644 --- a/code/modules/mob/living/carbon/human/species/golem.dm +++ b/code/modules/mob/living/carbon/human/species/golem.dm @@ -341,8 +341,7 @@ heat_level_2 = 340 heat_level_3 = 400 - dietflags = 0 //Regenerate nutrition in light, no diet necessary - taste_sensitivity = TASTE_SENSITIVITY_NO_TASTE + dietflags = DIET_HERB // Plants eat...plants? info_text = "As a Wooden Golem, you have plant-like traits: you take damage from extreme temperatures, can be set on fire, and have lower armor than a normal golem. You regenerate when in the light and wither in the darkness." prefix = "Wooden" @@ -361,9 +360,9 @@ H.clear_alert("nolight") else H.throw_alert("nolight", /obj/screen/alert/nolight) - H.nutrition += light_amount * 10 + H.adjust_nutrition(light_amount * 10) if(H.nutrition > NUTRITION_LEVEL_ALMOST_FULL) - H.nutrition = NUTRITION_LEVEL_ALMOST_FULL + H.set_nutrition(NUTRITION_LEVEL_ALMOST_FULL) if(light_amount > 0.2 && !H.suiciding) //if there's enough light, heal H.adjustBruteLoss(-1) H.adjustFireLoss(-1) diff --git a/code/modules/mob/living/carbon/human/species/plasmaman.dm b/code/modules/mob/living/carbon/human/species/plasmaman.dm index e4ba4349202..d925e2ef1d9 100644 --- a/code/modules/mob/living/carbon/human/species/plasmaman.dm +++ b/code/modules/mob/living/carbon/human/species/plasmaman.dm @@ -1,4 +1,4 @@ -/datum/species/plasmaman // /vg/ +/datum/species/plasmaman name = "Plasmaman" name_plural = "Plasmamen" icobase = 'icons/mob/human_races/r_plasmaman_sb.dmi' @@ -6,12 +6,14 @@ dangerous_existence = TRUE //So so much //language = "Clatter" - species_traits = list(IS_WHITELISTED, RADIMMUNE, NO_BLOOD, NOTRANSSTING) + species_traits = list(IS_WHITELISTED, RADIMMUNE, NO_BLOOD, NO_HUNGER, NOTRANSSTING) forced_heartattack = TRUE // Plasmamen have no blood, but they should still get heart-attacks skinned_type = /obj/item/stack/sheet/mineral/plasma // We're low on plasma, R&D! *eyes plasmaman co-worker intently* dietflags = DIET_OMNI reagent_tag = PROCESS_ORG + taste_sensitivity = TASTE_SENSITIVITY_NO_TASTE //skeletons can't taste anything + butt_sprite = "plasma" breathid = "tox" @@ -34,7 +36,6 @@ "liver" = /obj/item/organ/internal/liver/plasmaman, "kidneys" = /obj/item/organ/internal/kidneys/plasmaman, "brain" = /obj/item/organ/internal/brain/plasmaman, - "appendix" = /obj/item/organ/internal/appendix, "eyes" = /obj/item/organ/internal/eyes/plasmaman ) diff --git a/code/modules/mob/living/carbon/human/species/shadowling.dm b/code/modules/mob/living/carbon/human/species/shadowling.dm index f65aedb530b..d05c358ce73 100644 --- a/code/modules/mob/living/carbon/human/species/shadowling.dm +++ b/code/modules/mob/living/carbon/human/species/shadowling.dm @@ -9,7 +9,7 @@ blood_color = "#555555" flesh_color = "#222222" - species_traits = list(NO_BLOOD, NO_BREATHE, RADIMMUNE, NOGUNS, NO_EXAMINE) //Can't use guns due to muzzle flash + species_traits = list(NO_BLOOD, NO_BREATHE, RADIMMUNE, NOGUNS, NO_HUNGER, NO_EXAMINE) //Can't use guns due to muzzle flash burn_mod = 1.5 //1.5x burn damage, 2x is excessive heatmod = 1.5 @@ -24,7 +24,6 @@ if(!H.weakeyes) H.weakeyes = 1 //Makes them more vulnerable to flashes and flashbangs var/light_amount = 0 - H.nutrition = NUTRITION_LEVEL_WELL_FED //i aint never get hongry if(isturf(H.loc)) var/turf/T = H.loc light_amount = T.get_lumcount() * 10 @@ -60,7 +59,7 @@ blood_color = "#CCCCCC" flesh_color = "#AAAAAA" - species_traits = list(NO_BLOOD, NO_BREATHE, RADIMMUNE, NO_EXAMINE) + species_traits = list(NO_BLOOD, NO_BREATHE, RADIMMUNE, NO_HUNGER, NO_EXAMINE) burn_mod = 1.1 heatmod = 1.1 @@ -68,7 +67,6 @@ if(!H.weakeyes) H.weakeyes = 1 //Makes them more vulnerable to flashes and flashbangs var/light_amount = 0 - H.nutrition = NUTRITION_LEVEL_WELL_FED //i aint never get hongry if(isturf(H.loc)) var/turf/T = H.loc light_amount = T.get_lumcount() * 10 diff --git a/code/modules/mob/living/carbon/human/species/skeleton.dm b/code/modules/mob/living/carbon/human/species/skeleton.dm index 2ce5839123b..af779483666 100644 --- a/code/modules/mob/living/carbon/human/species/skeleton.dm +++ b/code/modules/mob/living/carbon/human/species/skeleton.dm @@ -10,10 +10,12 @@ blood_color = "#FFFFFF" flesh_color = "#E6E6C6" - species_traits = list(NO_BREATHE, NO_BLOOD, RADIMMUNE, VIRUSIMMUNE, PIERCEIMMUNE) + species_traits = list(NO_BREATHE, NO_BLOOD, RADIMMUNE, VIRUSIMMUNE, NO_HUNGER, PIERCEIMMUNE) dies_at_threshold = TRUE skinned_type = /obj/item/stack/sheet/bone + taste_sensitivity = TASTE_SENSITIVITY_NO_TASTE //skeletons can't taste anything + dietflags = DIET_OMNI reagent_tag = PROCESS_ORG diff --git a/code/modules/mob/living/carbon/human/species/slime.dm b/code/modules/mob/living/carbon/human/species/slime.dm index 37b38de361c..0b4080d6851 100644 --- a/code/modules/mob/living/carbon/human/species/slime.dm +++ b/code/modules/mob/living/carbon/human/species/slime.dm @@ -171,7 +171,7 @@ H.update_body() H.updatehealth() H.UpdateDamageIcon() - H.nutrition -= SLIMEPERSON_HUNGERCOST + H.adjust_nutrition(-SLIMEPERSON_HUNGERCOST) H.visible_message("[H] finishes regrowing [H.p_their()] missing [new_limb]!", "You finish regrowing your [limb_select]") else to_chat(H, "You need to hold still in order to regrow a limb!") diff --git a/code/modules/mob/living/carbon/human/species/unathi.dm b/code/modules/mob/living/carbon/human/species/unathi.dm index 7ab0f9cbec9..6240e2673bd 100644 --- a/code/modules/mob/living/carbon/human/species/unathi.dm +++ b/code/modules/mob/living/carbon/human/species/unathi.dm @@ -19,6 +19,7 @@ clothing_flags = HAS_UNDERWEAR | HAS_UNDERSHIRT | HAS_SOCKS bodyflags = HAS_TAIL | HAS_HEAD_ACCESSORY | HAS_BODY_MARKINGS | HAS_HEAD_MARKINGS | HAS_SKIN_COLOR | HAS_ALT_HEADS | TAIL_WAGGING dietflags = DIET_CARN + taste_sensitivity = TASTE_SENSITIVITY_SHARP cold_level_1 = 280 //Default 260 - Lower is better cold_level_2 = 220 //Default 200 @@ -110,7 +111,7 @@ name_plural = "Ash Walkers" blurb = "These reptillian creatures appear to be related to the Unathi, but seem significantly less evolved. \ - They roam the wastes of Lavaland, worshipping a dead city and capturing unsuspecting miners." + They roam the wastes of Lavaland, worshipping a dead city and capturing unsuspecting miners." language = "Sinta'unathi" default_language = "Sinta'unathi" diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm index c5cbbc0b1d3..a9263f58ea2 100644 --- a/code/modules/mob/living/carbon/life.dm +++ b/code/modules/mob/living/carbon/life.dm @@ -253,7 +253,7 @@ continue if(times_fired % 3 == 1) M.adjustBruteLoss(5) - nutrition += 10 + adjust_nutrition(10) //this updates all special effects: stunned, sleeping, weakened, druggy, stuttering, etc.. /mob/living/carbon/handle_status_effects() diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index f659b4198d1..ea3db60383d 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -427,7 +427,7 @@ radiation = 0 SetDruggy(0) SetHallucinate(0) - nutrition = NUTRITION_LEVEL_FED + 50 + set_nutrition(NUTRITION_LEVEL_FED + 50) bodytemperature = 310 CureBlind() CureNearsighted() diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 4e8da45a155..8e35233be06 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1398,3 +1398,11 @@ var/list/slot_equipment_priority = list( \ suffix = "_8" S.icon_state = "[initial(S.icon_state)][suffix]" + +///Adjust the nutrition of a mob +/mob/proc/adjust_nutrition(change) + nutrition = max(0, nutrition + change) + +///Force set the mob nutrition +/mob/proc/set_nutrition(change) + nutrition = max(0, change) \ No newline at end of file diff --git a/code/modules/mob/transform_procs.dm b/code/modules/mob/transform_procs.dm index 565f5f2fd23..5154f19fda7 100644 --- a/code/modules/mob/transform_procs.dm +++ b/code/modules/mob/transform_procs.dm @@ -154,7 +154,7 @@ var/list/babies = list() for(var/i=1,i<=number,i++) var/mob/living/carbon/slime/M = new/mob/living/carbon/slime(loc) - M.nutrition = round(nutrition/number) + M.set_nutrition(round(nutrition / number)) step_away(M,src) babies += M new_slime = pick(babies) diff --git a/code/modules/projectiles/projectile/special.dm b/code/modules/projectiles/projectile/special.dm index 41646c114af..06ab5c9a61b 100644 --- a/code/modules/projectiles/projectile/special.dm +++ b/code/modules/projectiles/projectile/special.dm @@ -171,7 +171,7 @@ if(ishuman(target)) //These rays make plantmen fat. var/mob/living/carbon/human/H = M if(IS_PLANT in H.dna.species.species_traits) - H.nutrition = min(H.nutrition+30, NUTRITION_LEVEL_FULL) + H.set_nutrition(min(H.nutrition+30, NUTRITION_LEVEL_FULL)) else if(iscarbon(target)) M.show_message("The radiation beam dissipates harmlessly through your body.") else diff --git a/code/modules/reagents/chemistry/reagents/food.dm b/code/modules/reagents/chemistry/reagents/food.dm index 4d6303f490c..afc4c4f2f8f 100644 --- a/code/modules/reagents/chemistry/reagents/food.dm +++ b/code/modules/reagents/chemistry/reagents/food.dm @@ -16,7 +16,7 @@ if(ishuman(M)) var/mob/living/carbon/human/H = M if(H.can_eat(diet_flags)) //Make sure the species has it's dietflag set, otherwise it can't digest any nutrients - H.nutrition += nutriment_factor // For hunger and fatness + H.adjust_nutrition(nutriment_factor) // For hunger and fatness return ..() /datum/reagent/consumable/nutriment // Pure nutriment, universally digestable and thus slightly less effective @@ -838,13 +838,16 @@ color = "#63DE63" taste_description = "burned food" -/datum/reagent/questionmark/reaction_mob(mob/living/M, method=TOUCH, volume) - if(method == INGEST) - M.Stun(2, FALSE) - M.Weaken(2, FALSE) - M.update_canmove() - to_chat(M, "Ugh! Eating that was a terrible idea!") - M.ForceContractDisease(new /datum/disease/food_poisoning(0)) +/datum/reagent/questionmark/reaction_mob(mob/living/carbon/human/H, method = TOUCH, volume) + if(istype(H) && method == INGEST) + if(H.dna.species.taste_sensitivity < TASTE_SENSITIVITY_NO_TASTE) // If you can taste it, then you know how awful it is. + H.Stun(2, FALSE) + H.Weaken(2, FALSE) + H.update_canmove() + to_chat(H, "Ugh! Eating that was a terrible idea!") + if(NO_HUNGER in H.dna.species.species_traits) //If you don't eat, then you can't get food poisoning + return + H.ForceContractDisease(new /datum/disease/food_poisoning(0)) /datum/reagent/msg name = "Monosodium glutamate" diff --git a/code/modules/reagents/chemistry/reagents/toxins.dm b/code/modules/reagents/chemistry/reagents/toxins.dm index df67e3ae5da..f232d2d2066 100644 --- a/code/modules/reagents/chemistry/reagents/toxins.dm +++ b/code/modules/reagents/chemistry/reagents/toxins.dm @@ -874,8 +874,8 @@ to_chat(M, "Your stomach grumbles painfully!") else if(prob(60)) - var/fat_to_burn = max(round(M.nutrition/100,1), 5) - M.nutrition = max(0, M.nutrition-fat_to_burn) + var/fat_to_burn = max(round(M.nutrition / 100, 1), 5) + M.adjust_nutrition(-fat_to_burn) M.overeatduration = 0 return ..() | update_flags diff --git a/code/modules/research/xenobiology/xenobiology.dm b/code/modules/research/xenobiology/xenobiology.dm index 81ca4bfeb9b..1dd4f05eb97 100644 --- a/code/modules/research/xenobiology/xenobiology.dm +++ b/code/modules/research/xenobiology/xenobiology.dm @@ -151,7 +151,7 @@ return M.docile = 1 - M.nutrition = 700 + M.set_nutrition(700) to_chat(M, "You absorb the potion and feel your intense desire to feed melt away.") to_chat(user, "You feed the slime the potion, removing its hunger and calming it.") being_used = 1 diff --git a/code/modules/surgery/organs/augments_arms.dm b/code/modules/surgery/organs/augments_arms.dm index 9342b3afd29..44f27b5deb4 100644 --- a/code/modules/surgery/organs/augments_arms.dm +++ b/code/modules/surgery/organs/augments_arms.dm @@ -337,11 +337,11 @@ break A.charging = 1 if(A.cell.charge >= 500) - H.nutrition += 50 + H.adjust_nutrition(50) A.cell.charge -= 500 to_chat(H, "You siphon off some of the stored charge for your own use.") else - H.nutrition += A.cell.charge/10 + H.adjust_nutrition(A.cell.charge * 0.1) A.cell.charge = 0 to_chat(H, "You siphon off the last of \the [A]'s charge.") break diff --git a/code/modules/surgery/organs/augments_internal.dm b/code/modules/surgery/organs/augments_internal.dm index 71a06d8e013..8f80b4e58e3 100644 --- a/code/modules/surgery/organs/augments_internal.dm +++ b/code/modules/surgery/organs/augments_internal.dm @@ -229,7 +229,7 @@ if(owner.nutrition <= hunger_threshold) synthesizing = 1 to_chat(owner, "You feel less hungry...") - owner.nutrition += 50 + owner.adjust_nutrition(50) spawn(50) synthesizing = 0 diff --git a/code/modules/surgery/organs/organ_internal.dm b/code/modules/surgery/organs/organ_internal.dm index 4f859ea2e2b..7527ed19f92 100644 --- a/code/modules/surgery/organs/organ_internal.dm +++ b/code/modules/surgery/organs/organ_internal.dm @@ -285,7 +285,7 @@ /obj/item/organ/internal/honktumor/cursed/on_life() //No matter what you do, no matter who you are, no matter where you go, you're always going to be a fat, stuttering dimwit. ..() owner.setBrainLoss(80) - owner.nutrition = 9000 + owner.set_nutrition(9000) owner.overeatduration = 9000 diff --git a/code/modules/surgery/organs/subtypes/kidan.dm b/code/modules/surgery/organs/subtypes/kidan.dm index 3778a7204cc..b87531ac337 100644 --- a/code/modules/surgery/organs/subtypes/kidan.dm +++ b/code/modules/surgery/organs/subtypes/kidan.dm @@ -41,7 +41,7 @@ owner.visible_message("[owner] fades to dark.") return - owner.nutrition = max(owner.nutrition - KIDAN_LANTERN_HUNGERCOST, KIDAN_LANTERN_HUNGERCOST) + owner.set_nutrition(max(owner.nutrition - KIDAN_LANTERN_HUNGERCOST, KIDAN_LANTERN_HUNGERCOST)) var/new_light = calculate_glow(KIDAN_LANTERN_LIGHT)