From 15094b8b1215ef895b0c6fa47a83fbe157087103 Mon Sep 17 00:00:00 2001 From: DragonTrance Date: Tue, 23 Feb 2021 13:46:07 -0700 Subject: [PATCH 1/6] enjoy being fat with quirks! --- code/datums/components/mood.dm | 3 ++- code/modules/food_and_drinks/food/snacks.dm | 6 ++++-- hyperstation/code/datums/traits/good.dm | 7 +++++++ hyperstation/code/datums/traits/neutral.dm | 11 +++++++++++ 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/code/datums/components/mood.dm b/code/datums/components/mood.dm index dbce0072..b5df5431 100644 --- a/code/datums/components/mood.dm +++ b/code/datums/components/mood.dm @@ -293,7 +293,8 @@ /datum/component/mood/proc/HandleNutrition(mob/living/L) switch(L.nutrition) if(NUTRITION_LEVEL_FULL to INFINITY) - add_event(null, "nutrition", /datum/mood_event/fat) + if(!L.has_quirk(/datum/quirk/fat_enjoyer)) + add_event(null, "nutrition", /datum/mood_event/fat) if(NUTRITION_LEVEL_WELL_FED to NUTRITION_LEVEL_FULL) add_event(null, "nutrition", /datum/mood_event/wellfed) if( NUTRITION_LEVEL_FED to NUTRITION_LEVEL_WELL_FED) diff --git a/code/modules/food_and_drinks/food/snacks.dm b/code/modules/food_and_drinks/food/snacks.dm index be09a91d..0055727b 100644 --- a/code/modules/food_and_drinks/food/snacks.dm +++ b/code/modules/food_and_drinks/food/snacks.dm @@ -109,14 +109,16 @@ All foods are distributed among various categories. Use common sense. user.visible_message("[user] takes a [eatverb] from \the [src].", "You take a [eatverb] from \the [src].") else if(fullness > 500 && fullness < 600) user.visible_message("[user] unwillingly takes a [eatverb] of a bit of \the [src].", "You unwillingly take a [eatverb] of a bit of \the [src].") - else if(fullness > (600 * (1 + M.overeatduration / 2000))) // The more you eat - the more you can eat + else if(fullness > (600 * (1 + M.overeatduration / 2000))\ + || (M.has_quirk(/datum/quirk/fat_enjoyer) && fullness < 780 * (1 + M.overeatduration / 2000))) // The more you eat - the more you can eat user.visible_message("[user] cannot force any more of \the [src] to go down [user.p_their()] throat!", "You cannot force any more of \the [src] to go down your throat!") return 0 if(HAS_TRAIT(M, TRAIT_VORACIOUS)) M.changeNext_move(CLICK_CD_MELEE * 0.5) //nom nom nom else if(!isbrain(M)) //If you're feeding it to someone else. - if(fullness <= (600 * (1 + M.overeatduration / 1000))) + if(fullness <= (600 * (1 + M.overeatduration / 1000))\ + || (M.has_quirk(/datum/quirk/fat_enjoyer) && fullness <= 780 * (1 + M.overeatduration / 1000))) M.visible_message("[user] attempts to feed [M] [src].", \ "[user] attempts to feed [M] [src].") else diff --git a/hyperstation/code/datums/traits/good.dm b/hyperstation/code/datums/traits/good.dm index 672d8719..253b88b0 100644 --- a/hyperstation/code/datums/traits/good.dm +++ b/hyperstation/code/datums/traits/good.dm @@ -57,3 +57,10 @@ /datum/quirk/xenospeaker/remove() if(quirk_holder) quirk_holder.remove_language(/datum/language/ratvar) + +/datum/quirk/fat_enjoyer + name = "Fat Enjoyer" + desc = "You don't particularly mind being fat compared to some people, and have grown used to feeling a bit plump." + value = 1 + gain_text = "You enjoy fat more than some people." + lose_text = "Your views towards being overweight has changed." diff --git a/hyperstation/code/datums/traits/neutral.dm b/hyperstation/code/datums/traits/neutral.dm index ba031c25..cad4e5be 100644 --- a/hyperstation/code/datums/traits/neutral.dm +++ b/hyperstation/code/datums/traits/neutral.dm @@ -34,3 +34,14 @@ mob_trait = TRAIT_HEAT gain_text = "You body burns with the desire to be bred." lose_text = "You feel more in control of your body and thoughts." + +/datum/quirk/overweight + name = "Overweight" + desc = "You're particularly fond of food, and join the round being overweight." + value = 0 + gain_text = "You feel a bit chubby!" + //no lose_text cause why would there be? + +/datum/quirk/overweight/on_spawn() + var/mob/living/M = quirk_holder + M.nutrition = rand(NUTRITION_LEVEL_FAT + NUTRITION_LEVEL_START_MIN, NUTRITION_LEVEL_FAT + NUTRITION_LEVEL_START_MAX) From ab941f04067230e223fc215b840ce7591e7844b5 Mon Sep 17 00:00:00 2001 From: DragonTrance Date: Tue, 23 Feb 2021 13:50:43 -0700 Subject: [PATCH 2/6] forgot one thing --- hyperstation/code/datums/traits/neutral.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/hyperstation/code/datums/traits/neutral.dm b/hyperstation/code/datums/traits/neutral.dm index cad4e5be..cb10529b 100644 --- a/hyperstation/code/datums/traits/neutral.dm +++ b/hyperstation/code/datums/traits/neutral.dm @@ -45,3 +45,4 @@ /datum/quirk/overweight/on_spawn() var/mob/living/M = quirk_holder M.nutrition = rand(NUTRITION_LEVEL_FAT + NUTRITION_LEVEL_START_MIN, NUTRITION_LEVEL_FAT + NUTRITION_LEVEL_START_MAX) + ADD_TRAIT(M, TRAIT_FAT, OBESITY) From b37e1db35e26779d7d5b52f1543e98e0bb4a8a81 Mon Sep 17 00:00:00 2001 From: DragonTrance Date: Tue, 23 Feb 2021 13:55:15 -0700 Subject: [PATCH 3/6] a --- hyperstation/code/datums/traits/neutral.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/hyperstation/code/datums/traits/neutral.dm b/hyperstation/code/datums/traits/neutral.dm index cb10529b..2402a26d 100644 --- a/hyperstation/code/datums/traits/neutral.dm +++ b/hyperstation/code/datums/traits/neutral.dm @@ -45,4 +45,5 @@ /datum/quirk/overweight/on_spawn() var/mob/living/M = quirk_holder M.nutrition = rand(NUTRITION_LEVEL_FAT + NUTRITION_LEVEL_START_MIN, NUTRITION_LEVEL_FAT + NUTRITION_LEVEL_START_MAX) + M.overeatduration = 100 ADD_TRAIT(M, TRAIT_FAT, OBESITY) From 5740825e1b234164dda4af9857b42d2ce125d33a Mon Sep 17 00:00:00 2001 From: DragonTrance Date: Tue, 23 Feb 2021 14:04:34 -0700 Subject: [PATCH 4/6] only start fat --- code/datums/components/mood.dm | 3 +-- code/modules/food_and_drinks/food/snacks.dm | 6 ++---- hyperstation/code/datums/traits/good.dm | 7 ------- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/code/datums/components/mood.dm b/code/datums/components/mood.dm index b5df5431..dbce0072 100644 --- a/code/datums/components/mood.dm +++ b/code/datums/components/mood.dm @@ -293,8 +293,7 @@ /datum/component/mood/proc/HandleNutrition(mob/living/L) switch(L.nutrition) if(NUTRITION_LEVEL_FULL to INFINITY) - if(!L.has_quirk(/datum/quirk/fat_enjoyer)) - add_event(null, "nutrition", /datum/mood_event/fat) + add_event(null, "nutrition", /datum/mood_event/fat) if(NUTRITION_LEVEL_WELL_FED to NUTRITION_LEVEL_FULL) add_event(null, "nutrition", /datum/mood_event/wellfed) if( NUTRITION_LEVEL_FED to NUTRITION_LEVEL_WELL_FED) diff --git a/code/modules/food_and_drinks/food/snacks.dm b/code/modules/food_and_drinks/food/snacks.dm index 0055727b..be09a91d 100644 --- a/code/modules/food_and_drinks/food/snacks.dm +++ b/code/modules/food_and_drinks/food/snacks.dm @@ -109,16 +109,14 @@ All foods are distributed among various categories. Use common sense. user.visible_message("[user] takes a [eatverb] from \the [src].", "You take a [eatverb] from \the [src].") else if(fullness > 500 && fullness < 600) user.visible_message("[user] unwillingly takes a [eatverb] of a bit of \the [src].", "You unwillingly take a [eatverb] of a bit of \the [src].") - else if(fullness > (600 * (1 + M.overeatduration / 2000))\ - || (M.has_quirk(/datum/quirk/fat_enjoyer) && fullness < 780 * (1 + M.overeatduration / 2000))) // The more you eat - the more you can eat + else if(fullness > (600 * (1 + M.overeatduration / 2000))) // The more you eat - the more you can eat user.visible_message("[user] cannot force any more of \the [src] to go down [user.p_their()] throat!", "You cannot force any more of \the [src] to go down your throat!") return 0 if(HAS_TRAIT(M, TRAIT_VORACIOUS)) M.changeNext_move(CLICK_CD_MELEE * 0.5) //nom nom nom else if(!isbrain(M)) //If you're feeding it to someone else. - if(fullness <= (600 * (1 + M.overeatduration / 1000))\ - || (M.has_quirk(/datum/quirk/fat_enjoyer) && fullness <= 780 * (1 + M.overeatduration / 1000))) + if(fullness <= (600 * (1 + M.overeatduration / 1000))) M.visible_message("[user] attempts to feed [M] [src].", \ "[user] attempts to feed [M] [src].") else diff --git a/hyperstation/code/datums/traits/good.dm b/hyperstation/code/datums/traits/good.dm index 253b88b0..672d8719 100644 --- a/hyperstation/code/datums/traits/good.dm +++ b/hyperstation/code/datums/traits/good.dm @@ -57,10 +57,3 @@ /datum/quirk/xenospeaker/remove() if(quirk_holder) quirk_holder.remove_language(/datum/language/ratvar) - -/datum/quirk/fat_enjoyer - name = "Fat Enjoyer" - desc = "You don't particularly mind being fat compared to some people, and have grown used to feeling a bit plump." - value = 1 - gain_text = "You enjoy fat more than some people." - lose_text = "Your views towards being overweight has changed." From cd3ca2b8d1bc41eed7d3df2f3120bb0a1359a0d7 Mon Sep 17 00:00:00 2001 From: DragonTrance Date: Tue, 23 Feb 2021 17:19:06 -0700 Subject: [PATCH 5/6] sorting thirst code + not-water replenishes hydration --- code/__DEFINES/mobs.dm | 9 +++++++++ code/datums/components/mood.dm | 10 ++++++---- code/modules/mob/living/blood.dm | 4 ++-- code/modules/mob/living/carbon/carbon_movement.dm | 2 +- code/modules/mob/living/carbon/human/species.dm | 11 +++++++++-- code/modules/mob/mob.dm | 1 + code/modules/reagents/chemistry/reagents.dm | 1 + .../reagents/chemistry/reagents/drink_reagents.dm | 3 --- .../reagents/chemistry/reagents/food_reagents.dm | 1 - .../reagents/chemistry/reagents/other_reagents.dm | 7 +------ code/modules/surgery/organs/stomach.dm | 3 ++- 11 files changed, 32 insertions(+), 20 deletions(-) diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index c7284dc4..a0aa5e6b 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -158,6 +158,15 @@ #define NUTRITION_LEVEL_START_MIN 250 #define NUTRITION_LEVEL_START_MAX 400 +//Hyperstation Thirst +#define THIRST_LEVEL_THRESHOLD 800 //Set to 0 to stop clamping +#define THIRST_LEVEL_QUENCHED 450 +#define THIRST_LEVEL_THIRSTY 250 +#define THIRST_LEVEL_PARCHED 150 + +#define THIRST_LEVEL_START_MIN 250 +#define THIRST_LEVEL_START_MAX 400 + //Disgust levels for humans #define DISGUST_LEVEL_MAXEDOUT 150 #define DISGUST_LEVEL_DISGUSTED 75 diff --git a/code/datums/components/mood.dm b/code/datums/components/mood.dm index dbce0072..4cda20f1 100644 --- a/code/datums/components/mood.dm +++ b/code/datums/components/mood.dm @@ -306,14 +306,16 @@ add_event(null, "nutrition", /datum/mood_event/starving) /datum/component/mood/proc/HandleThirst(mob/living/L) + if(THIRST_LEVEL_THRESHOLD) + L.thirst = clamp(L.thirst, 0, THIRST_LEVEL_THRESHOLD) switch(L.thirst) - if(NUTRITION_LEVEL_WELL_FED to INFINITY) + if(THIRST_LEVEL_QUENCHED to INFINITY) add_event(null, "thirst", /datum/mood_event/quenched) - if(NUTRITION_LEVEL_HUNGRY to NUTRITION_LEVEL_WELL_FED) + if(THIRST_LEVEL_THIRSTY to THIRST_LEVEL_QUENCHED) clear_event(null, "thirst") - if(NUTRITION_LEVEL_STARVING to NUTRITION_LEVEL_HUNGRY) + if(THIRST_LEVEL_PARCHED to THIRST_LEVEL_THIRSTY) add_event(null, "thirst", /datum/mood_event/thirsty) - if(0 to NUTRITION_LEVEL_STARVING) + if(0 to THIRST_LEVEL_PARCHED) add_event(null, "thirst", /datum/mood_event/dehydrated) #undef MINOR_INSANITY_PEN diff --git a/code/modules/mob/living/blood.dm b/code/modules/mob/living/blood.dm index 4b04639b..a5e55ea5 100644 --- a/code/modules/mob/living/blood.dm +++ b/code/modules/mob/living/blood.dm @@ -44,7 +44,7 @@ //Blood regeneration if there is some space if(blood_volume < (BLOOD_VOLUME_NORMAL * blood_ratio) && !HAS_TRAIT(src, TRAIT_NOHUNGER)) var/nutrition_ratio = 0 - var/thirst_ratio = 1 + //thirst_ratio = 1 //Uncomment if something fancy gets added switch(nutrition) if(0 to NUTRITION_LEVEL_STARVING) nutrition_ratio = 0.2 @@ -61,7 +61,7 @@ if(satiety > 80) nutrition_ratio *= 1.25 nutrition = max(0, nutrition - nutrition_ratio * HUNGER_FACTOR) - thirst = max(0, thirst - thirst_ratio * THIRST_FACTOR) + thirst = max(0, thirst - 0.8 * THIRST_FACTOR) blood_volume = min((BLOOD_VOLUME_NORMAL * blood_ratio), blood_volume + 0.5 * nutrition_ratio) //Effects of bloodloss diff --git a/code/modules/mob/living/carbon/carbon_movement.dm b/code/modules/mob/living/carbon/carbon_movement.dm index 93d3e1db..fcf85505 100644 --- a/code/modules/mob/living/carbon/carbon_movement.dm +++ b/code/modules/mob/living/carbon/carbon_movement.dm @@ -44,4 +44,4 @@ thirst -= THIRST_FACTOR/12 if(m_intent == MOVE_INTENT_RUN) nutrition -= HUNGER_FACTOR/5 - thirst -= THIRST_FACTOR/5 //running around depleats thirst more so. \ No newline at end of file + thirst -= THIRST_FACTOR/5 diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 643161bd..5f84c597 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1243,7 +1243,6 @@ GLOBAL_LIST_EMPTY(roundstart_races) if (H.nutrition > 0 && H.stat != DEAD && !HAS_TRAIT(H, TRAIT_NOHUNGER)) // THEY HUNGER var/hunger_rate = HUNGER_FACTOR - var/thirst_rate = THIRST_FACTOR var/datum/component/mood/mood = H.GetComponent(/datum/component/mood) if(mood && mood.sanity > SANITY_DISTURBED) hunger_rate *= max(0.5, 1 - 0.002 * mood.sanity) //0.85 to 0.75 @@ -1262,7 +1261,6 @@ GLOBAL_LIST_EMPTY(roundstart_races) hunger_rate = 3 * HUNGER_FACTOR hunger_rate *= H.physiology.hunger_mod H.nutrition = max(0, H.nutrition - hunger_rate) - H.thirst = max(0, H.thirst - thirst_rate) if (H.nutrition > NUTRITION_LEVEL_FULL) @@ -1298,6 +1296,14 @@ GLOBAL_LIST_EMPTY(roundstart_races) if(0 to NUTRITION_LEVEL_STARVING) H.throw_alert("nutrition", /obj/screen/alert/starving) +/datum/species/proc/handle_thirst(mob/living/carbon/human/H) + if(HAS_TRAIT(src, TRAIT_NOTHIRST)) + return + + //Put more things here if you plan on adding more things. I know this proc is a bit empty at the moment + H.thirst -= THIRST_FACTOR + + switch(H.thirst) if(NUTRITION_LEVEL_HUNGRY to INFINITY) H.clear_alert("thirst") @@ -1306,6 +1312,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) if(0 to NUTRITION_LEVEL_STARVING) H.throw_alert("thirst", /obj/screen/alert/dehydrated) + /datum/species/proc/update_health_hud(mob/living/carbon/human/H) return 0 diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index af91754b..4f1afd3d 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -36,6 +36,7 @@ var/datum/atom_hud/alternate_appearance/AA = v AA.onNewMob(src) nutrition = rand(NUTRITION_LEVEL_START_MIN, NUTRITION_LEVEL_START_MAX) + thirst = rand(NUTRITION_LEVEL_START_MIN, NUTRITION_LEVEL_START_MAX) . = ..() update_config_movespeed() update_movespeed(TRUE) diff --git a/code/modules/reagents/chemistry/reagents.dm b/code/modules/reagents/chemistry/reagents.dm index 61d32c29..89bd36a4 100644 --- a/code/modules/reagents/chemistry/reagents.dm +++ b/code/modules/reagents/chemistry/reagents.dm @@ -81,6 +81,7 @@ GLOBAL_LIST_INIT(name2reagent, build_name2reagent()) current_cycle++ if(holder) holder.remove_reagent(type, metabolization_rate * M.metabolism_efficiency) //By default it slowly disappears. + M.thirst += hydration return //called when a mob processes chems when dead. diff --git a/code/modules/reagents/chemistry/reagents/drink_reagents.dm b/code/modules/reagents/chemistry/reagents/drink_reagents.dm index 853a0000..d250f025 100644 --- a/code/modules/reagents/chemistry/reagents/drink_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/drink_reagents.dm @@ -3,9 +3,6 @@ ///////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////// DRINKS BELOW, Beer is up there though, along with cola. Cap'n Pete's Cuban Spiced Rum//////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////// -/datum/reagent/water/ - hydration = 10 * REAGENTS_METABOLISM - /datum/reagent/consumable/orangejuice name = "Orange Juice" description = "Both delicious AND rich in Vitamin C, what more do you need?" diff --git a/code/modules/reagents/chemistry/reagents/food_reagents.dm b/code/modules/reagents/chemistry/reagents/food_reagents.dm index b5384f8a..bb200cdc 100644 --- a/code/modules/reagents/chemistry/reagents/food_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/food_reagents.dm @@ -18,7 +18,6 @@ /datum/reagent/consumable/on_mob_life(mob/living/carbon/M) current_cycle++ M.nutrition += nutriment_factor - M.thirst += hydration holder.remove_reagent(type, metabolization_rate) /datum/reagent/consumable/reaction_mob(mob/living/M, method=TOUCH, reac_volume) diff --git a/code/modules/reagents/chemistry/reagents/other_reagents.dm b/code/modules/reagents/chemistry/reagents/other_reagents.dm index 4e8671b3..c319899e 100644 --- a/code/modules/reagents/chemistry/reagents/other_reagents.dm +++ b/code/modules/reagents/chemistry/reagents/other_reagents.dm @@ -258,12 +258,7 @@ glass_name = "glass of water" glass_desc = "The father of all refreshments." shot_glass_icon_state = "shotglassclear" - hydration = 5 * REAGENTS_METABOLISM - -//hydration -/datum/reagent/water/on_mob_life(mob/living/carbon/M) - M.thirst += hydration - ..() + hydration = 10 * REAGENTS_METABOLISM /* * Water reaction to turf diff --git a/code/modules/surgery/organs/stomach.dm b/code/modules/surgery/organs/stomach.dm index 1d1aa3d6..256b2c3c 100644 --- a/code/modules/surgery/organs/stomach.dm +++ b/code/modules/surgery/organs/stomach.dm @@ -23,6 +23,7 @@ var/mob/living/carbon/human/H = owner if(!(organ_flags & ORGAN_FAILING)) H.dna.species.handle_digestion(H) + H.dna.species.handle_thirst(H) handle_disgust(H) Nutri = locate(/datum/reagent/consumable/nutriment) in H.reagents.reagent_list @@ -99,4 +100,4 @@ /obj/item/organ/stomach/ipc name = "ipc stomach" - icon_state = "stomach-ipc" \ No newline at end of file + icon_state = "stomach-ipc" From 87204ff739b3d4bf8524c611eb5149cf0252811b Mon Sep 17 00:00:00 2001 From: DragonTrance Date: Tue, 23 Feb 2021 17:36:44 -0700 Subject: [PATCH 6/6] Update species.dm --- code/modules/mob/living/carbon/human/species.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 5f84c597..058dfd86 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1305,11 +1305,11 @@ GLOBAL_LIST_EMPTY(roundstart_races) switch(H.thirst) - if(NUTRITION_LEVEL_HUNGRY to INFINITY) + if(THIRST_LEVEL_THIRSTY to INFINITY) H.clear_alert("thirst") - if(NUTRITION_LEVEL_STARVING to NUTRITION_LEVEL_HUNGRY) + if(THIRST_LEVEL_PARCHED to THIRST_LEVEL_THIRSTY) H.throw_alert("thirst", /obj/screen/alert/thirsty) - if(0 to NUTRITION_LEVEL_STARVING) + if(0 to THIRST_LEVEL_PARCHED) H.throw_alert("thirst", /obj/screen/alert/dehydrated)