Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nutrition cleanup & Shivering cost reduction #8195

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion code/__DEFINES/chemistry.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,12 @@
#define ALCOHOL_METABOLISM AMOUNT_PER_TIME(1, 5 SECONDS)
#define RAPID_METABOLISM AMOUNT_PER_TIME(1, 2 SECONDS)

// Factor of how fast mob nutrition decreases
/// How fast mob nutrition normally decreases
#define HUNGER_FACTOR 0.05
/// Additional mob nutrition cost when regenerating blood
#define BLOOD_NUTRITION_COST 0.25
/// Additional mob nutrition cost when cold
#define COLD_NUTRITION_COST 1

// Nutrition levels
#define NUTRITION_MAX 550
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

if(!(species.flags & IS_SYNTHETIC))
//Nutrition decrease
if(nutrition > 0 && stat != 2)
nutrition = max (0, nutrition - HUNGER_FACTOR)
if(stat != DEAD)
nutrition = max(0, nutrition - HUNGER_FACTOR)


handle_trace_chems()
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/human/life/life_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
return //Fuck this precision

if(bodytemperature < species.cold_level_1) //260.15 is 310.15 - 50, the temperature where you start to feel effects.
if(nutrition >= 2) //If we are very, very cold we'll use up quite a bit of nutriment to heat us up.
nutrition -= 2
if(nutrition >= COLD_NUTRITION_COST) //If we are very, very cold we'll use up quite a bit of nutriment to heat us up.
nutrition -= COLD_NUTRITION_COST
var/recovery_amt = max((body_temperature_difference / BODYTEMP_AUTORECOVERY_DIVISOR), BODYTEMP_AUTORECOVERY_MINIMUM)
bodytemperature += recovery_amt
recalculate_move_delay = TRUE
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/carbon/human/species/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

if(stat != DEAD && bodytemperature >= 170) //Dead or cryosleep people do not pump the blood.
//Blood regeneration if there is some space
if(blood_volume < max_blood && nutrition >= 1)
if(blood_volume < max_blood && nutrition >= BLOOD_NUTRITION_COST)
blood_volume += 0.1 // regenerate blood VERY slowly
nutrition -= 0.25
nutrition -= BLOOD_NUTRITION_COST
else if(blood_volume > max_blood)
blood_volume -= 0.1 // The reverse in case we've gotten too much blood in our body
if(blood_volume > limit_blood)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
/datum/chem_property/positive/musclestimulating/process(mob/living/M, potency = 1)
M.reagent_move_delay_modifier -= POTENCY_MULTIPLIER_VLOW * potency
M.recalculate_move_delay = TRUE
M.nutrition = max (0, M.nutrition - 0.5 * HUNGER_FACTOR)
M.nutrition = max(0, M.nutrition - 0.5 * HUNGER_FACTOR)
if(prob(10))
M.emote(pick("twitch","blink_r","shiver"))

Expand Down
Loading