Skip to content

Commit

Permalink
Gives botany plants a new formula for calculating bite size, fixes sw…
Browse files Browse the repository at this point in the history
…allowing watermelons whole (tgstation#58795)

About The Pull Request

This PR gives botany plants a new formula for getting the size of their bites.

The formula is (potency / 20) * (max_volume / 100) * (modifier) + 1.

This brings your average 100 potency plant to a bite size of 6 units per bite. [(5 * 1 * 1) + 1] - For reference, a Tomato has 14 units of reagents with default genes at 100 potency, so this means a tomato is eaten in 3 bites.

This PR also goes through and audits all the plant's bite modifiers to bring them in line with the new formula. This makes the bite modifier actually a bite modifier instead of some weird constant var that lies about what it actually does.

Fixes tgstation#55527
Why It's Good For The Game

Currently, all plants are eaten in a single bite. Including watermelons and the dank weeds. This is bad.

image

This PR brings them all in line so you no longer swallow watermelons whole, so you stop accidentally getting fat.
I also audited all the plants so their relative bitesizes make sense with the new formula. Only apples and potatos are eaten in 1 bite. Plants with more reagents naturally should now have larger bitesizes, and plants with less reagents have smaller bitesizes. Balance is restored.
Changelog

🆑 Melbert
fix: You no longer eat all botany plants plants in 1 bite. Apples and Potatos retain their unique 1 bite behavior.
code: Botany plants use a new formula for calculating bite size. All botany plants have had their bite modifier adjusted to match.
/🆑
  • Loading branch information
MrMelbert authored May 9, 2021
1 parent 1efd3aa commit 72fec84
Show file tree
Hide file tree
Showing 31 changed files with 62 additions and 49 deletions.
20 changes: 17 additions & 3 deletions code/modules/hydroponics/grown.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
// Data from the seeds carry over to these grown foods
// ***********************************************************

// A few defines for use in calculating our plant's bite size.
/// When calculating bite size, potency is multiplied by this number.
#define BITE_SIZE_POTENCY_MULTIPLIER 0.05
/// When calculating bite size, max_volume is multiplied by this number.
#define BITE_SIZE_VOLUME_MULTIPLIER 0.01

// Base type. Subtypes are found in /grown dir. Lavaland-based subtypes can be found in mining/ash_flora.dm
/obj/item/food/grown
icon = 'icons/obj/hydroponics/harvest.dmi'
Expand All @@ -13,8 +19,8 @@
var/obj/item/seeds/seed = null
///Name of the plant
var/plantname = ""
/// If set, bitesize = 1 + round(reagents.total_volume / bite_consumption_mod)
var/bite_consumption_mod = 0
/// The modifier applied to the plant's bite size. If a plant has a large amount of reagents naturally, this should be increased to match.
var/bite_consumption_mod = 1
///the splat it makes when it splats lol
var/splat_type = /obj/effect/decal/cleanable/food/plant_smudge

Expand Down Expand Up @@ -49,6 +55,11 @@
for(var/datum/plant_gene/trait/trait in seed.genes)
trait.on_new_plant(src, loc)

// Set our default bitesize: bite size = 1 + (potency * 0.05) * (max_volume * 0.01) * modifier
// A 100 potency, non-densified plant = 1 + (5 * 1 * modifier) = 6u bite size
// For reference, your average 100 potency tomato has 14u of reagents - So, with no modifier it is eaten in 3 bites
bite_consumption = 1 + round(max((seed.potency * BITE_SIZE_POTENCY_MULTIPLIER), 1) * (max_volume * BITE_SIZE_VOLUME_MULTIPLIER) * bite_consumption_mod)

. = ..() //Only call it here because we want all the genes and shit to be applied before we add edibility. God this code is a mess.

seed.prepare_result(src)
Expand All @@ -63,7 +74,7 @@
eat_time = eat_time,\
tastes = tastes,\
eatverbs = eatverbs,\
bite_consumption = bite_consumption_mod ? 1 + round(max_volume / bite_consumption_mod) : bite_consumption,\
bite_consumption = bite_consumption,\
microwaved_type = microwaved_type,\
junkiness = junkiness)

Expand Down Expand Up @@ -105,3 +116,6 @@
juice_results[juice_results[i]] = nutriment
reagents.del_reagent(/datum/reagent/consumable/nutriment)
reagents.del_reagent(/datum/reagent/consumable/nutriment/vitamin)

#undef BITE_SIZE_POTENCY_MULTIPLIER
#undef BITE_SIZE_VOLUME_MULTIPLIER
2 changes: 1 addition & 1 deletion code/modules/hydroponics/grown/ambrosia.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
desc = "This is a plant."
icon_state = "ambrosiavulgaris"
slot_flags = ITEM_SLOT_HEAD
bite_consumption_mod = 2
bite_consumption_mod = 3
foodtypes = VEGETABLES
tastes = list("ambrosia" = 1)

Expand Down
2 changes: 1 addition & 1 deletion code/modules/hydroponics/grown/apple.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
name = "apple"
desc = "It's a little piece of Eden."
icon_state = "apple"
bite_consumption = 100 // Always eat the apple in one bite
bite_consumption_mod = 100 // Always eat apples in one bite
foodtypes = FRUIT
juice_results = list(/datum/reagent/consumable/applejuice = 0)
tastes = list("apple" = 1)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/hydroponics/grown/banana.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
icon_state = "banana"
inhand_icon_state = "banana"
trash_type = /obj/item/grown/bananapeel
bite_consumption = 5
bite_consumption_mod = 3
foodtypes = FRUIT
juice_results = list(/datum/reagent/consumable/banana = 0)
distill_reagent = /datum/reagent/consumable/ethanol/bananahonk
Expand Down
2 changes: 0 additions & 2 deletions code/modules/hydroponics/grown/beans.dm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
desc = "It's pretty bland, but oh the possibilities..."
gender = PLURAL
icon_state = "soybeans"
bite_consumption_mod = 2
foodtypes = VEGETABLES
grind_results = list(/datum/reagent/consumable/soymilk = 0)
tastes = list("soy" = 1)
Expand All @@ -47,7 +46,6 @@
name = "koibean"
desc = "Something about these seems fishy."
icon_state = "koibeans"
bite_consumption_mod = 2
foodtypes = VEGETABLES
tastes = list("koi" = 1)
wine_power = 40
5 changes: 4 additions & 1 deletion code/modules/hydroponics/grown/berries.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
desc = "Nutritious!"
icon_state = "berrypile"
gender = PLURAL
bite_consumption_mod = 2
foodtypes = FRUIT
juice_results = list(/datum/reagent/consumable/berryjuice = 0)
tastes = list("berry" = 1)
Expand All @@ -47,6 +46,7 @@
name = "bunch of poison-berries"
desc = "Taste so good, you might die!"
icon_state = "poisonberrypile"
bite_consumption_mod = 3
foodtypes = FRUIT | TOXIC
juice_results = list(/datum/reagent/consumable/poisonberryjuice = 0)
tastes = list("poison-berry" = 1)
Expand All @@ -72,6 +72,7 @@
name = "bunch of death-berries"
desc = "Taste so good, you will die!"
icon_state = "deathberrypile"
bite_consumption_mod = 3
foodtypes = FRUIT | TOXIC
tastes = list("death-berry" = 1)
distill_reagent = null
Expand All @@ -97,6 +98,7 @@
seed = /obj/item/seeds/berry/glow
name = "bunch of glow-berries"
desc = "Nutritious!"
bite_consumption_mod = 3
icon_state = "glowberrypile"
foodtypes = FRUIT
tastes = list("glow-berry" = 1)
Expand Down Expand Up @@ -234,5 +236,6 @@
seed = /obj/item/seeds/grape/green
name = "bunch of green grapes"
icon_state = "greengrapes"
bite_consumption_mod = 3
tastes = list("green grape" = 1)
distill_reagent = /datum/reagent/consumable/ethanol/cognac
3 changes: 2 additions & 1 deletion code/modules/hydroponics/grown/cannabis.dm
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
name = "cannabis leaf"
desc = "Recently legalized in most galaxies."
icon_state = "cannabis"
bite_consumption_mod = 2
bite_consumption_mod = 4
foodtypes = VEGETABLES //i dont really know what else weed could be to be honest
tastes = list("cannabis" = 1)
wine_power = 20
Expand Down Expand Up @@ -119,5 +119,6 @@
name = "omega cannabis leaf"
desc = "You feel dizzy looking at it. What the fuck?"
icon_state = "ocannabis"
bite_consumption_mod = 2 // Ingesting like 40 units of drugs in 1 bite at 100 potency
max_volume = 420
wine_power = 90
8 changes: 4 additions & 4 deletions code/modules/hydroponics/grown/cereals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
desc = "Sigh... wheat... a-grain?"
gender = PLURAL
icon_state = "wheat"
bite_consumption_mod = 2
bite_consumption_mod = 0.5 // Chewing on wheat grains?
foodtypes = GRAIN
grind_results = list(/datum/reagent/consumable/flour = 0)
tastes = list("wheat" = 1)
Expand All @@ -42,7 +42,7 @@
desc = "Eat oats, do squats."
gender = PLURAL
icon_state = "oat"
bite_consumption_mod = 2
bite_consumption_mod = 0.5
foodtypes = GRAIN
grind_results = list(/datum/reagent/consumable/flour = 0)
tastes = list("oat" = 1)
Expand All @@ -66,7 +66,7 @@
desc = "Rice to meet you."
gender = PLURAL
icon_state = "rice"
bite_consumption_mod = 2
bite_consumption_mod = 0.5
foodtypes = GRAIN
grind_results = list(/datum/reagent/consumable/rice = 0)
tastes = list("rice" = 1)
Expand All @@ -87,7 +87,7 @@
desc = "Some blood-drenched wheat stalks. You can crush them into what passes for meat if you squint hard enough."
icon_state = "meatwheat"
gender = PLURAL
bite_consumption_mod = 2
bite_consumption_mod = 0.5
seed = /obj/item/seeds/wheat/meat
foodtypes = MEAT | GRAIN
grind_results = list(/datum/reagent/consumable/flour = 0, /datum/reagent/blood = 0)
Expand Down
5 changes: 3 additions & 2 deletions code/modules/hydroponics/grown/chili.dm
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
name = "chilly pepper"
desc = "It's a mutant strain of chili."
icon_state = "icepepper"
bite_consumption_mod = 2
bite_consumption_mod = 5
foodtypes = FRUIT
wine_power = 30

Expand All @@ -77,8 +77,9 @@
name = "ghost chili"
desc = "It seems to be vibrating gently."
icon_state = "ghostchilipepper"
bite_consumption_mod = 5
var/mob/living/carbon/human/held_mob
bite_consumption_mod = 4
bite_consumption_mod = 2
foodtypes = FRUIT
wine_power = 50

Expand Down
3 changes: 1 addition & 2 deletions code/modules/hydroponics/grown/citrus.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
name = "citrus"
desc = "It's so sour, your face will twist."
icon_state = "lime"
bite_consumption_mod = 2
foodtypes = FRUIT
wine_power = 30

Expand Down Expand Up @@ -106,7 +105,6 @@
name = "Combustible Lemon"
desc = "Made for burning houses down."
icon_state = "firelemon"
bite_consumption_mod = 2
foodtypes = FRUIT
wine_power = 70

Expand Down Expand Up @@ -176,6 +174,7 @@
name = "extradimensional orange"
desc = "You can hardly wrap your head around this thing."
icon_state = "orang"
bite_consumption_mod = 2
juice_results = list(/datum/reagent/consumable/orangejuice = 0)
distill_reagent = /datum/reagent/toxin/mindbreaker
tastes = list("polygons" = 1, "bluespace" = 1, "the true nature of reality" = 1)
Expand Down
3 changes: 3 additions & 0 deletions code/modules/hydroponics/grown/cocoa_vanilla.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
name = "vanilla pod"
desc = "Fattening... Mmmmm... vanilla."
icon_state = "vanillapod"
bite_consumption_mod = 2
foodtypes = FRUIT
tastes = list("vanilla" = 1)
distill_reagent = /datum/reagent/consumable/vanilla //Takes longer, but you can get even more vanilla from it.
Expand Down Expand Up @@ -75,6 +76,7 @@
name = "bungo fruit"
desc = "A strange fruit, tough leathery skin protects its juicy flesh and large poisonous seed."
icon_state = "bungo"
bite_consumption_mod = 2
trash_type = /obj/item/food/grown/bungopit
foodtypes = FRUIT
juice_results = list(/datum/reagent/consumable/bungojuice = 0)
Expand All @@ -85,6 +87,7 @@
seed = /obj/item/seeds/cocoapod/bungotree
name = "bungo pit"
icon_state = "bungopit"
bite_consumption_mod = 5
desc = "A large seed, it is said to be potent enough to be able to stop a mans heart."
w_class = WEIGHT_CLASS_TINY
throwforce = 5
Expand Down
2 changes: 0 additions & 2 deletions code/modules/hydroponics/grown/eggplant.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
name = "eggplant"
desc = "Maybe there's a chicken inside?"
icon_state = "eggplant"
bite_consumption_mod = 2
foodtypes = FRUIT
wine_power = 20

Expand All @@ -43,6 +42,5 @@
desc = "There MUST be a chicken inside."
icon_state = "eggyplant"
trash_type = /obj/item/food/egg
bite_consumption_mod = 2
foodtypes = MEAT
distill_reagent = /datum/reagent/consumable/ethanol/eggnog
9 changes: 4 additions & 5 deletions code/modules/hydroponics/grown/flowers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
desc = "Long-used as a symbol of rest, peace, and death."
icon_state = "poppy"
slot_flags = ITEM_SLOT_HEAD
bite_consumption_mod = 3
bite_consumption_mod = 2
foodtypes = VEGETABLES | GROSS
distill_reagent = /datum/reagent/consumable/ethanol/vermouth

Expand Down Expand Up @@ -80,7 +80,7 @@
name = "spaceman's trumpet"
desc = "A vivid flower that smells faintly of freshly cut grass. Touching the flower seems to stain the skin some time after contact, yet most other surfaces seem to be unaffected by this phenomenon."
icon_state = "spacemanstrumpet"
bite_consumption_mod = 3
bite_consumption_mod = 2
foodtypes = VEGETABLES

// Geranium
Expand Down Expand Up @@ -146,7 +146,7 @@
desc = "\"I'll sweeten thy sad grave: thou shalt not lack the flower that's like thy face, pale primrose, nor the azured hare-bell, like thy veins; no, nor the leaf of eglantine, whom not to slander, out-sweeten'd not thy breath.\""
icon_state = "harebell"
slot_flags = ITEM_SLOT_HEAD
bite_consumption_mod = 3
bite_consumption_mod = 2
distill_reagent = /datum/reagent/consumable/ethanol/vermouth

// Sunflower
Expand Down Expand Up @@ -211,7 +211,6 @@
desc = "Store in a location at least 50 yards away from werewolves."
icon_state = "moonflower"
slot_flags = ITEM_SLOT_HEAD
bite_consumption_mod = 2
distill_reagent = /datum/reagent/consumable/ethanol/absinthe //It's made from flowers.

// Novaflower
Expand Down Expand Up @@ -311,7 +310,7 @@
lefthand_file = 'icons/mob/inhands/misc/food_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/food_righthand.dmi'
slot_flags = ITEM_SLOT_HEAD|ITEM_SLOT_MASK
bite_consumption_mod = 3
bite_consumption_mod = 2
foodtypes = VEGETABLES | GROSS

/obj/item/food/grown/rose/Initialize(mapload, obj/item/seeds/new_seed)
Expand Down
1 change: 0 additions & 1 deletion code/modules/hydroponics/grown/garlic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,5 @@
name = "garlic"
desc = "Delicious, but with a potentially overwhelming odor."
icon_state = "garlic"
bite_consumption_mod = 2
tastes = list("garlic" = 1)
wine_power = 10
3 changes: 2 additions & 1 deletion code/modules/hydroponics/grown/grass_carpet.dm
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
name = "grass"
desc = "Green and lush."
icon_state = "grassclump"
bite_consumption_mod = 2
bite_consumption_mod = 0.5 // Grazing on grass
var/stacktype = /obj/item/stack/tile/grass
var/tile_coefficient = 0.02 // 1/50
wine_power = 15
Expand Down Expand Up @@ -59,6 +59,7 @@
name = "fairygrass"
desc = "Blue, glowing, and smells fainly of mushrooms."
icon_state = "fairygrassclump"
bite_consumption_mod = 1
stacktype = /obj/item/stack/tile/fairygrass

// Carpet
Expand Down
1 change: 0 additions & 1 deletion code/modules/hydroponics/grown/kudzu.dm
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@
name = "kudzu pod"
desc = "<I>Pueraria Virallis</I>: An invasive species with vines that rapidly creep and wrap around whatever they contact."
icon_state = "kudzupod"
bite_consumption_mod = 2
foodtypes = VEGETABLES | GROSS
tastes = list("kudzu" = 1)
wine_power = 20
4 changes: 2 additions & 2 deletions code/modules/hydroponics/grown/melon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
name = "watermelon"
desc = "It's full of watery goodness."
icon_state = "watermelon"
bite_consumption_mod = 2
w_class = WEIGHT_CLASS_NORMAL
bite_consumption_mod = 3
foodtypes = FRUIT
juice_results = list(/datum/reagent/consumable/watermelonjuice = 0)
wine_power = 40
Expand Down Expand Up @@ -58,10 +58,10 @@
name = "holymelon"
desc = "The water within this melon has been blessed by some deity that's particularly fond of watermelon."
icon_state = "holymelon"
bite_consumption_mod = 2
wine_power = 70 //Water to wine, baby.
wine_flavor = "divinity"


/obj/item/food/grown/holymelon/make_dryable()
return //No drying

Expand Down
Loading

0 comments on commit 72fec84

Please sign in to comment.