mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-26 21:48:21 +01:00
Nutrition Refactor (#12389)
This commit is contained in:
committed by
variableundefined
parent
082dcc9910
commit
86e6d85093
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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, "<span class='notice'>You feel vigorous.</span>")
|
||||
metabolism_efficiency = 1.25
|
||||
else if(nutrition < NUTRITION_LEVEL_STARVING + 50)
|
||||
if(metabolism_efficiency != 0.8)
|
||||
to_chat(src, "<span class='notice'>You feel sluggish.</span>")
|
||||
metabolism_efficiency = 0.8
|
||||
else
|
||||
if(metabolism_efficiency == 1.25)
|
||||
to_chat(src, "<span class='notice'>You no longer feel vigorous.</span>")
|
||||
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, "<span class='notice'>You feel vigorous.</span>")
|
||||
metabolism_efficiency = 1.25
|
||||
else if(nutrition < NUTRITION_LEVEL_STARVING + 50)
|
||||
if(metabolism_efficiency != 0.8)
|
||||
to_chat(src, "<span class='notice'>You feel sluggish.</span>")
|
||||
metabolism_efficiency = 0.8
|
||||
else
|
||||
if(metabolism_efficiency == 1.25)
|
||||
to_chat(src, "<span class='notice'>You no longer feel vigorous.</span>")
|
||||
metabolism_efficiency = 1
|
||||
|
||||
if(drowsyness)
|
||||
AdjustDrowsy(-1)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 <span class='danger'>Wooden Golem</span>, 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)
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -171,7 +171,7 @@
|
||||
H.update_body()
|
||||
H.updatehealth()
|
||||
H.UpdateDamageIcon()
|
||||
H.nutrition -= SLIMEPERSON_HUNGERCOST
|
||||
H.adjust_nutrition(-SLIMEPERSON_HUNGERCOST)
|
||||
H.visible_message("<span class='notice'>[H] finishes regrowing [H.p_their()] missing [new_limb]!</span>", "<span class='notice'>You finish regrowing your [limb_select]</span>")
|
||||
else
|
||||
to_chat(H, "<span class='warning'>You need to hold still in order to regrow a limb!</span>")
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user