Skip to content

Commit

Permalink
saturation tweaks (TauCetiStation#13271)
Browse files Browse the repository at this point in the history
* 111

* фикс того что куклы появлялись сразу очень голодными

* изменение порога замедления от голода

* нужно слишком долго ничего не есть, чтобы получить замедление

* Update mood.dm
  • Loading branch information
simb11 authored Aug 7, 2024
1 parent bf72d4a commit f7eab0d
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 17 deletions.
12 changes: 6 additions & 6 deletions code/__DEFINES/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,13 @@
#define TK_MANA_PER_W_CLASS(cl) (2**cl)

//Nutrition levels for humans.
#define NUTRITION_LEVEL_FAT 600
#define NUTRITION_LEVEL_FAT 660
#define NUTRITION_LEVEL_FULL 550
#define NUTRITION_LEVEL_WELL_FED 450
#define NUTRITION_LEVEL_NORMAL 400
#define NUTRITION_LEVEL_FED 350
#define NUTRITION_LEVEL_HUNGRY 250
#define NUTRITION_LEVEL_STARVING 150
#define NUTRITION_LEVEL_WELL_FED 440
#define NUTRITION_LEVEL_NORMAL 330
#define NUTRITION_LEVEL_FED 220
#define NUTRITION_LEVEL_HUNGRY 110
#define NUTRITION_LEVEL_STARVING 50

#define NUTRITION_PERCENT_MAX 120
#define NUTRITION_PERCENT_ZERO 0
Expand Down
8 changes: 5 additions & 3 deletions code/datums/components/mood.dm
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,13 @@
/datum/component/mood/proc/HandleNutrition()
var/mob/living/L = parent

switch(L.nutrition)
if(NUTRITION_LEVEL_FULL to INFINITY)
var/fullness = L.get_satiation()

switch(fullness)
if(NUTRITION_LEVEL_FAT to INFINITY)
add_event(null, "nutrition", /datum/mood_event/fat)

if(NUTRITION_LEVEL_WELL_FED to NUTRITION_LEVEL_FULL)
if(NUTRITION_LEVEL_WELL_FED to NUTRITION_LEVEL_FAT)
add_event(null, "nutrition", /datum/mood_event/wellfed)

if( NUTRITION_LEVEL_FED to NUTRITION_LEVEL_WELL_FED)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/dead/new_player/new_player.dm
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@
new_character.dna.ready_dna(new_character)
new_character.dna.UpdateSE()
new_character.dna.original_character_name = new_character.real_name
new_character.nutrition = rand(NUTRITION_LEVEL_HUNGRY, NUTRITION_LEVEL_WELL_FED)
new_character.nutrition = rand(NUTRITION_LEVEL_FED, NUTRITION_LEVEL_WELL_FED)
var/old_base_metabolism = new_character.get_metabolism_factor()
new_character.metabolism_factor.Set(old_base_metabolism * rand(9, 11) * 0.1)

Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/human/human_movement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
if(health_deficiency >= 40)
tally += health_deficiency / 25

var/hungry = 500 - get_satiation()
if(hungry >= 350) // Slow down if nutrition <= 150
var/hungry = NUTRITION_LEVEL_FULL - get_satiation()
if(hungry >= NUTRITION_LEVEL_NORMAL) // Slow down if nutrition <= 40%
tally += hungry / 250 // 1,4 - 2

if(shock_stage >= 10)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,7 @@ var/global/list/tourette_bad_words= list(

/mob/living/carbon/human/handle_nutrition()
. = ..()
if(nutrition > NUTRITION_LEVEL_WELL_FED)
if(nutrition > NUTRITION_LEVEL_FAT)
if(overeatduration < 600) //capped so people don't take forever to unfat
overeatduration++
else
Expand Down
8 changes: 4 additions & 4 deletions code/modules/reagents/reagent_containers/food/snacks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@
if(HAS_TRAIT(C, TRAIT_PICKY_EATER) && src.food_type != VERY_TASTY_FOOD)
to_chat(C, "<span class='rose'>You can't eat this horrible, nasty and cheap food!</span>")
return FALSE
else if(fullness > (550 * (1 + M.overeatduration / 2000))) // The more you eat - the more you can eat
else if(fullness > (NUTRITION_LEVEL_FAT * (1 + M.overeatduration / 2000) + 100)) // The more you eat - the more you can eat
to_chat(C, "<span class='rose'>You cannot force any more of [src] to go down your throat.</span>")
return FALSE
else if(fullness > 350)
else if(fullness > NUTRITION_LEVEL_NORMAL)
to_chat(C, "<span class='notice'>You unwillingly chew a bit of [src].</span>")
else if(fullness > 150)
else if(fullness > NUTRITION_LEVEL_FED)
to_chat(C, "<span class='notice'>You take a bite of [src].</span>")
else if(fullness > 50)
else if(fullness > NUTRITION_LEVEL_HUNGRY)
to_chat(C, "<span class='notice'>You hungrily begin to eat [src].</span>")
else
to_chat(C, "<span class='rose'>You hungrily chew out a piece of [src] and gobble it!</span>")
Expand Down

0 comments on commit f7eab0d

Please sign in to comment.