mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-14 16:44:33 +01:00
Nutrient Split and Diet Flag
Adds Protein and Plant-matter reagents, nutritional values of 15 Reduces nutritional value of Nutriment to 12, down from 15 Adds new flag defines for racial diets, and new dietflags var to species (must be set manually in the species definition, otherwise it will be null) Assigns each species their respective diet's flag: - Carnivores: Unathi, Slime People - Omnivores: Human, Tajaran, Kidan, Vox, IPC, Shadowpeople, Golems, Plasmaman, Nucleation, Vox Armalis - Herbivores: Skrell, Diona, Grey, Wryn Adds checks to all nutrient on_mob_life procs to handle simple_animals versus carbon/human mobs - Simple animals will heal from any nutrient source, but don't gain nutritional value since they don't appear to deplete it Adds check to Nutriment on_mob_life proc to ensure that the diet for a species has been set - Failure to set a diet flag will prevent the species from benefitting from ANY nutrients, while metabolizing the reagents normally - This is largely for ensuring the species is properly defined Adds checks to Protein and Plant-matter on_mob_life procs to handle incompatible diets - Ingesting Protein does not benefit Herbivores, but will metabolize out of the body normally -Ingesting Plant-matter does not benefit Carnivores, but will metabolize out of the body normally
This commit is contained in:
@@ -1485,10 +1485,31 @@ datum
|
||||
/////////////////////////Food Reagents////////////////////////////
|
||||
// Part of the food code. Nutriment is used instead of the old "heal_amt" code. Also is where all the food
|
||||
// condiments, additives, and such go.
|
||||
nutriment
|
||||
nutriment // Pure nutriment, universally digestable and thus slightly less effective
|
||||
name = "Nutriment"
|
||||
id = "nutriment"
|
||||
description = "All the vitamins, minerals, and carbohydrates the body needs in pure form."
|
||||
description = "A questionable mixture of various pure nutrients commonly found in processed foods."
|
||||
reagent_state = SOLID
|
||||
nutriment_factor = 12 * REAGENTS_METABOLISM
|
||||
color = "#664330" // rgb: 102, 67, 48
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(!M) M = holder.my_atom
|
||||
if(!(M.mind in ticker.mode.vampires))
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(H.species && H.species.dietflags) //Make sure the species has it's dietflag set, otherwise it can't digest any nutrients
|
||||
H.nutrition += nutriment_factor // For hunger and fatness
|
||||
if(prob(50)) M.heal_organ_damage(1,0)
|
||||
if(istype(M,/mob/living/simple_animal)) //Any nutrients can heal simple animals
|
||||
if(prob(50)) M.heal_organ_damage(1,0)
|
||||
..()
|
||||
return
|
||||
|
||||
protein // Meat-based protein, digestable by carnivores and omnivores, worthless to herbivores
|
||||
name = "Protein"
|
||||
id = "protein"
|
||||
description = "Various essential proteins and fats commonly found in animal flesh and blood."
|
||||
reagent_state = SOLID
|
||||
nutriment_factor = 15 * REAGENTS_METABOLISM
|
||||
color = "#664330" // rgb: 102, 67, 48
|
||||
@@ -1496,8 +1517,34 @@ datum
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(!M) M = holder.my_atom
|
||||
if(!(M.mind in ticker.mode.vampires))
|
||||
M.nutrition += nutriment_factor // For hunger and fatness
|
||||
if(prob(50)) M.heal_organ_damage(1,0)
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(H.species && H.species.dietflags && !(H.species.dietflags & DIET_HERB)) //Make sure the species has it's dietflag set, otherwise it can't digest any nutrients
|
||||
H.nutrition += nutriment_factor // For hunger and fatness
|
||||
if(prob(50)) M.heal_organ_damage(1,0)
|
||||
if(istype(M,/mob/living/simple_animal)) //Any nutrients can heal simple animals
|
||||
if(prob(50)) M.heal_organ_damage(1,0)
|
||||
..()
|
||||
return
|
||||
|
||||
plantmatter // Plant-based biomatter, digestable by herbivores and omnivores, worthless to carnivores
|
||||
name = "Plant-matter"
|
||||
id = "plantmatter"
|
||||
description = "Vitamin-rich fibers and natural sugars commonly found in fresh produce."
|
||||
reagent_state = SOLID
|
||||
nutriment_factor = 15 * REAGENTS_METABOLISM
|
||||
color = "#664330" // rgb: 102, 67, 48
|
||||
|
||||
on_mob_life(var/mob/living/M as mob)
|
||||
if(!M) M = holder.my_atom
|
||||
if(!(M.mind in ticker.mode.vampires))
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(H.species && H.species.dietflags && !(H.species.dietflags & DIET_CARN)) //Make sure the species has it's dietflag set, otherwise it can't digest any nutrients
|
||||
H.nutrition += nutriment_factor // For hunger and fatness
|
||||
if(prob(50)) M.heal_organ_damage(1,0)
|
||||
if(istype(M,/mob/living/simple_animal)) //Any nutrients can heal simple animals
|
||||
if(prob(50)) M.heal_organ_damage(1,0)
|
||||
..()
|
||||
return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user