Skip to content

Commit

Permalink
Merge pull request #37 from Very-Soft/food
Browse files Browse the repository at this point in the history
Foob
  • Loading branch information
Very-Soft authored Mar 16, 2024
2 parents a46be0f + d0a7794 commit 489eba8
Show file tree
Hide file tree
Showing 8 changed files with 247 additions and 13 deletions.
2 changes: 1 addition & 1 deletion code/__defines/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@
#define EXAMINE_SKIPLEGS 0x0080
#define EXAMINE_SKIPFEET 0x0100

#define MAX_NUTRITION 6000 //VOREStation Edit
#define MAX_NUTRITION 50000 //VOREStation Edit

#define FAKE_INVIS_ALPHA_THRESHOLD 127 // If something's alpha var is at or below this number, certain things will pretend it is invisible.

Expand Down
8 changes: 4 additions & 4 deletions code/modules/food/drinkingglass/shaker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
/obj/item/weapon/reagent_containers/food/drinks/glass2/fitnessflask/proteinshake/Initialize()
. = ..()
cut_overlays()
reagents.add_reagent("nutriment", 30)
reagents.add_reagent("nutriment", 5)
reagents.add_reagent("iron", 10)
reagents.add_reagent("protein", 35)
reagents.add_reagent("water", 25)
reagents.add_reagent("protein", 12)
reagents.add_reagent("water", 73)

/obj/item/weapon/reagent_containers/food/drinks/glass2/fitnessflask/proteinshake/update_icon()
return
return
2 changes: 1 addition & 1 deletion code/modules/food/food/snacks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
/obj/item/weapon/reagent_containers/food/snacks/Initialize()
. = ..()
if(nutriment_amt)
reagents.add_reagent("nutriment",(nutriment_amt*2),nutriment_desc)
reagents.add_reagent("nutriment",nutriment_amt,nutriment_desc)

//Placeholder for effect that trigger on eating that aren't tied to reagents.
/obj/item/weapon/reagent_containers/food/snacks/proc/On_Consume(var/mob/living/M)
Expand Down
6 changes: 6 additions & 0 deletions code/modules/mob/living/carbon/carbon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -548,3 +548,9 @@
if(src.wear_mask) //if the mob is not human, it cleans the mask without asking for bitflags
if(src.wear_mask.clean_blood())
src.update_inv_wear_mask(0)

/mob/living/carbon/proc/food_preference(var/allergen_type)

if(allergen_type in species.food_preference)
return species.food_preference_bonus
return 0
2 changes: 2 additions & 0 deletions code/modules/mob/living/carbon/human/species/species_vr.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
var/can_climb = FALSE
var/climbing_delay = 1.5 // We climb with a quarter delay

var/list/food_preference = list()
var/food_preference_bonus = 0

/datum/species/proc/give_numbing_bite() //Holy SHIT this is hacky, but it works. Updating a mob's attacks mid game is insane.
unarmed_attacks = list()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -774,3 +774,229 @@
/datum/trait/neutral/synth_cosmetic_pain/apply(var/datum/species/S,var/mob/living/carbon/human/H, var/trait_prefs = null)
..()
H.verbs |= /mob/living/carbon/human/proc/toggle_pain_module

/datum/trait/neutral/food_pref
name = "Food Preference - Carnivore"
desc = "You prefer to eat meat, and gain extra nutrition for doing so!"
cost = 0
custom_only = FALSE
can_take = ORGANICS
var_changes = list("food_preference_bonus" = 20)
excludes = list(
/datum/trait/neutral/food_pref,
/datum/trait/neutral/food_pref/herbivore,
/datum/trait/neutral/food_pref/beanivore,
/datum/trait/neutral/food_pref/omnivore,
/datum/trait/neutral/food_pref/fungivore,
/datum/trait/neutral/food_pref/piscivore,
/datum/trait/neutral/food_pref/granivore,
/datum/trait/neutral/food_pref/cocoavore,
/datum/trait/neutral/food_pref/glycovore,
/datum/trait/neutral/food_pref/lactovore,
/datum/trait/neutral/food_pref/coffee,
/datum/trait/neutral/food_pref/stimulant
)
var/list/our_allergens = list(ALLERGEN_MEAT)

/datum/trait/neutral/food_pref/apply(datum/species/S, mob/living/carbon/human/H, trait_prefs)
. = ..()
for(var/a in our_allergens)
S.food_preference |= a

/datum/trait/neutral/food_pref/herbivore
name = "Food Preference - Herbivore"
desc = "You prefer to eat fruits and vegitables, and gain extra nutrition for doing so!"
excludes = list(
/datum/trait/neutral/food_pref,
/datum/trait/neutral/food_pref/beanivore,
/datum/trait/neutral/food_pref/omnivore,
/datum/trait/neutral/food_pref/fungivore,
/datum/trait/neutral/food_pref/piscivore,
/datum/trait/neutral/food_pref/granivore,
/datum/trait/neutral/food_pref/cocoavore,
/datum/trait/neutral/food_pref/glycovore,
/datum/trait/neutral/food_pref/lactovore,
/datum/trait/neutral/food_pref/coffee,
/datum/trait/neutral/food_pref/stimulant
)
our_allergens = list(ALLERGEN_VEGETABLE,ALLERGEN_FRUIT)

/datum/trait/neutral/food_pref/beanivore
name = "Food Preference - Legumovore"
desc = "You prefer to eat bean related foods, such as tofu, and gain extra nutrition for doing so!"
excludes = list(
/datum/trait/neutral/food_pref,
/datum/trait/neutral/food_pref/herbivore,
/datum/trait/neutral/food_pref/omnivore,
/datum/trait/neutral/food_pref/fungivore,
/datum/trait/neutral/food_pref/piscivore,
/datum/trait/neutral/food_pref/granivore,
/datum/trait/neutral/food_pref/cocoavore,
/datum/trait/neutral/food_pref/glycovore,
/datum/trait/neutral/food_pref/lactovore,
/datum/trait/neutral/food_pref/coffee,
/datum/trait/neutral/food_pref/stimulant
)
our_allergens = list(ALLERGEN_BEANS)

/datum/trait/neutral/food_pref/omnivore
name = "Food Preference - Omnivore"
desc = "You prefer to eat meat and vegitables, and gain extra nutrition for doing so!"
excludes = list(
/datum/trait/neutral/food_pref,
/datum/trait/neutral/food_pref/herbivore,
/datum/trait/neutral/food_pref/beanivore,
/datum/trait/neutral/food_pref/fungivore,
/datum/trait/neutral/food_pref/piscivore,
/datum/trait/neutral/food_pref/granivore,
/datum/trait/neutral/food_pref/cocoavore,
/datum/trait/neutral/food_pref/glycovore,
/datum/trait/neutral/food_pref/lactovore,
/datum/trait/neutral/food_pref/coffee,
/datum/trait/neutral/food_pref/stimulant
)
our_allergens = list(ALLERGEN_VEGETABLE,ALLERGEN_MEAT)

/datum/trait/neutral/food_pref/fungivore
name = "Food Preference - Fungivore"
desc = "You prefer to eat mushrooms and fungus, and gain extra nutrition for doing so!"
excludes = list(
/datum/trait/neutral/food_pref,
/datum/trait/neutral/food_pref/herbivore,
/datum/trait/neutral/food_pref/beanivore,
/datum/trait/neutral/food_pref/omnivore,
/datum/trait/neutral/food_pref/piscivore,
/datum/trait/neutral/food_pref/granivore,
/datum/trait/neutral/food_pref/cocoavore,
/datum/trait/neutral/food_pref/glycovore,
/datum/trait/neutral/food_pref/lactovore,
/datum/trait/neutral/food_pref/coffee,
/datum/trait/neutral/food_pref/stimulant
)
our_allergens = list(ALLERGEN_FUNGI)

/datum/trait/neutral/food_pref/piscivore
name = "Food Preference - Piscivore"
desc = "You prefer to eat fish, and gain extra nutrition for doing so!"
excludes = list(
/datum/trait/neutral/food_pref,
/datum/trait/neutral/food_pref/herbivore,
/datum/trait/neutral/food_pref/beanivore,
/datum/trait/neutral/food_pref/omnivore,
/datum/trait/neutral/food_pref/fungivore,
/datum/trait/neutral/food_pref/granivore,
/datum/trait/neutral/food_pref/cocoavore,
/datum/trait/neutral/food_pref/glycovore,
/datum/trait/neutral/food_pref/lactovore,
/datum/trait/neutral/food_pref/coffee,
/datum/trait/neutral/food_pref/stimulant
)
our_allergens = list(ALLERGEN_FISH)

/datum/trait/neutral/food_pref/granivore
name = "Food Preference - Granivore"
desc = "You prefer to eat grains and seeds, and gain extra nutrition for doing so!"
excludes = list(
/datum/trait/neutral/food_pref,
/datum/trait/neutral/food_pref/herbivore,
/datum/trait/neutral/food_pref/beanivore,
/datum/trait/neutral/food_pref/omnivore,
/datum/trait/neutral/food_pref/fungivore,
/datum/trait/neutral/food_pref/piscivore,
/datum/trait/neutral/food_pref/cocoavore,
/datum/trait/neutral/food_pref/glycovore,
/datum/trait/neutral/food_pref/lactovore,
/datum/trait/neutral/food_pref/coffee,
/datum/trait/neutral/food_pref/stimulant
)
our_allergens = list(ALLERGEN_GRAINS,ALLERGEN_SEEDS)

/datum/trait/neutral/food_pref/cocoavore
name = "Food Preference - Cocoavore"
desc = "You prefer to eat chocolate, and gain extra nutrition for doing so!"
excludes = list(
/datum/trait/neutral/food_pref,
/datum/trait/neutral/food_pref/herbivore,
/datum/trait/neutral/food_pref/beanivore,
/datum/trait/neutral/food_pref/omnivore,
/datum/trait/neutral/food_pref/fungivore,
/datum/trait/neutral/food_pref/piscivore,
/datum/trait/neutral/food_pref/granivore,
/datum/trait/neutral/food_pref/glycovore,
/datum/trait/neutral/food_pref/lactovore,
/datum/trait/neutral/food_pref/coffee,
/datum/trait/neutral/food_pref/stimulant
)
our_allergens = list(ALLERGEN_CHOCOLATE)

/datum/trait/neutral/food_pref/glycovore
name = "Food Preference - Glycovore"
desc = "You prefer to eat sugar, and gain extra nutrition for doing so!"
excludes = list(
/datum/trait/neutral/food_pref,
/datum/trait/neutral/food_pref/herbivore,
/datum/trait/neutral/food_pref/beanivore,
/datum/trait/neutral/food_pref/omnivore,
/datum/trait/neutral/food_pref/fungivore,
/datum/trait/neutral/food_pref/piscivore,
/datum/trait/neutral/food_pref/granivore,
/datum/trait/neutral/food_pref/cocoavore,
/datum/trait/neutral/food_pref/lactovore,
/datum/trait/neutral/food_pref/coffee,
/datum/trait/neutral/food_pref/stimulant
)
our_allergens = list(ALLERGEN_SUGARS)

/datum/trait/neutral/food_pref/lactovore
name = "Food Preference - Lactovore"
desc = "You prefer to eat and drink things with milk in them, and gain extra nutrition for doing so!"
excludes = list(
/datum/trait/neutral/food_pref,
/datum/trait/neutral/food_pref/herbivore,
/datum/trait/neutral/food_pref/beanivore,
/datum/trait/neutral/food_pref/omnivore,
/datum/trait/neutral/food_pref/fungivore,
/datum/trait/neutral/food_pref/piscivore,
/datum/trait/neutral/food_pref/granivore,
/datum/trait/neutral/food_pref/cocoavore,
/datum/trait/neutral/food_pref/glycovore,
/datum/trait/neutral/food_pref/coffee,
/datum/trait/neutral/food_pref/stimulant
)
our_allergens = list(ALLERGEN_DAIRY)

/datum/trait/neutral/food_pref/coffee
name = "Food Preference - Coffee Dependant"
desc = "You can get by on coffee alone if you have to, and you like it that way."
excludes = list(
/datum/trait/neutral/food_pref,
/datum/trait/neutral/food_pref/herbivore,
/datum/trait/neutral/food_pref/beanivore,
/datum/trait/neutral/food_pref/omnivore,
/datum/trait/neutral/food_pref/fungivore,
/datum/trait/neutral/food_pref/piscivore,
/datum/trait/neutral/food_pref/granivore,
/datum/trait/neutral/food_pref/cocoavore,
/datum/trait/neutral/food_pref/glycovore,
/datum/trait/neutral/food_pref/lactovore,
/datum/trait/neutral/food_pref/stimulant
)
our_allergens = list(ALLERGEN_COFFEE)

/datum/trait/neutral/food_pref/stimulant
name = "Food Preference - Stimulant Dependant"
desc = "You can get by on caffine alone if you have to, and you like it that way."
excludes = list(
/datum/trait/neutral/food_pref,
/datum/trait/neutral/food_pref/herbivore,
/datum/trait/neutral/food_pref/beanivore,
/datum/trait/neutral/food_pref/omnivore,
/datum/trait/neutral/food_pref/fungivore,
/datum/trait/neutral/food_pref/piscivore,
/datum/trait/neutral/food_pref/granivore,
/datum/trait/neutral/food_pref/cocoavore,
/datum/trait/neutral/food_pref/glycovore,
/datum/trait/neutral/food_pref/lactovore,
/datum/trait/neutral/food_pref/coffee
)
our_allergens = list(ALLERGEN_STIMULANT)
11 changes: 7 additions & 4 deletions code/modules/reagents/reagents/food_drinks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@
if(!M.isSynthetic())
if(!(M.species.allergens & allergen_type)) //assuming it doesn't cause a horrible reaction, we'll be ok!
M.heal_organ_damage(0.5 * removed, 0)
M.adjust_nutrition((nutriment_factor * removed) * M.species.organic_food_coeff)
M.adjust_nutrition(((nutriment_factor + M.food_preference(allergen_type)) * removed) * M.species.organic_food_coeff)
M.add_chemical_effect(CE_BLOODRESTORE, 4 * removed)
else
M.adjust_nutrition((nutriment_factor * removed) * M.species.synthetic_food_coeff)
M.adjust_nutrition(((nutriment_factor + M.food_preference(allergen_type)) * removed) * M.species.synthetic_food_coeff)

//VOREStation Edits Stop

Expand Down Expand Up @@ -957,7 +957,8 @@

/datum/reagent/drink/affect_ingest(var/mob/living/carbon/M, var/alien, var/removed)
if(!(M.species.allergens & allergen_type))
M.adjust_nutrition(nutrition * removed)
var/bonus = M.food_preference(allergen_type)
M.adjust_nutrition((nutrition + bonus) * removed)
M.dizziness = max(0, M.dizziness + adj_dizzy)
M.drowsyness = max(0, M.drowsyness + adj_drowsy)
M.AdjustSleeping(adj_sleepy)
Expand Down Expand Up @@ -1655,7 +1656,7 @@
taste_description = "creamy chocolate"
reagent_state = LIQUID
color = "#403010"
nutrition = 2
nutrition = 5
adj_temp = 5

glass_name = "hot chocolate"
Expand Down Expand Up @@ -2585,6 +2586,8 @@
if(M.species.robo_ethanol_drunk || !(M.isSynthetic()))
if(alien == IS_DIONA)
return
M.adjust_nutrition((M.food_preference(allergen_type) / 2) * removed)

M.jitteriness = max(M.jitteriness - 3, 0)

/datum/reagent/ethanol/beer/lite
Expand Down
3 changes: 0 additions & 3 deletions code/modules/reagents/reagents/food_drinks_vr.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/datum/reagent/nutriment
nutriment_factor = 10

/datum/reagent/toxin/meatcolony
name = "A colony of meat cells"
id = "meatcolony"
Expand Down

0 comments on commit 489eba8

Please sign in to comment.