Skip to content

Commit

Permalink
[Port] Food Buffs from the chef (BeeStation#11770)
Browse files Browse the repository at this point in the history
* it begins

* Maltodextrin be gone.

* Update screen_alert.dmi

* dsajhasdbkhjsad

* Update snacks.dm

* aaaa

* maps

* trait is now added to food

* hyhhh

* hmmmh

* handcrafted meals

* mmmmmmmmm

* mmmmmmmmmmmmmmmmm

* aaaa

* Update _food_effect.dm

* Update CentCom.dmm
  • Loading branch information
XeonMations authored Dec 3, 2024
1 parent 4b1fefd commit bec842f
Show file tree
Hide file tree
Showing 90 changed files with 1,142 additions and 421 deletions.
2 changes: 1 addition & 1 deletion _maps/RandomRooms/10x5/sk_rdm151_ratburger.dmm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion _maps/RandomRooms/5x3/rdm_mad_pete.dmm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion _maps/RandomRuins/SpaceRuins/Fast_Food.dmm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion _maps/holodeck/workshop/donut.dmm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion _maps/map_files/BoxStation/BoxStation.dmm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion _maps/map_files/CorgStation/CorgStation.dmm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion _maps/map_files/Deltastation/DeltaStation2.dmm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion _maps/map_files/FlandStation/FlandStation.dmm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion _maps/map_files/KiloStation/KiloStation.dmm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion _maps/map_files/MetaStation/MetaStation.dmm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions _maps/map_files/RadStation/RadStation.dmm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion _maps/map_files/generic/CentCom.dmm

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion beestation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,6 @@
#include "code\datums\profiling.dm"
#include "code\datums\progressbar.dm"
#include "code\datums\radiation_wave.dm"
#include "code\datums\recipe.dm"
#include "code\datums\ref.dm"
#include "code\datums\ruins.dm"
#include "code\datums\saymode.dm"
Expand Down Expand Up @@ -957,6 +956,7 @@
#include "code\datums\mocking\client.dm"
#include "code\datums\mood_events\drink_events.dm"
#include "code\datums\mood_events\drug_events.dm"
#include "code\datums\mood_events\food_events.dm"
#include "code\datums\mood_events\generic_negative_events.dm"
#include "code\datums\mood_events\generic_neutral_events.dm"
#include "code\datums\mood_events\generic_positive_events.dm"
Expand Down Expand Up @@ -997,6 +997,11 @@
#include "code\datums\status_effects\gas.dm"
#include "code\datums\status_effects\neutral.dm"
#include "code\datums\status_effects\status_effect.dm"
#include "code\datums\status_effects\food\_food_effect.dm"
#include "code\datums\status_effects\food\chilling.dm"
#include "code\datums\status_effects\food\grant_trait.dm"
#include "code\datums\status_effects\food\haste.dm"
#include "code\datums\status_effects\food\speech.dm"
#include "code\datums\traits\_quirk.dm"
#include "code\datums\traits\negative_quirk.dm"
#include "code\datums\traits\neutral_quirk.dm"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
#define COMSIG_GRILL_FOOD "item_grill_food"

// Baking foods (oven)
//Called when an object is inserted into an oven (atom/oven, mob/baker)
#define COMSIG_ITEM_OVEN_PLACED_IN "item_placed_in_oven"
//Called when an object is in an oven
#define COMSIG_ITEM_BAKED "item_baked"
#define COMPONENT_HANDLED_BAKING (1<<0)
Expand Down
67 changes: 62 additions & 5 deletions code/__DEFINES/food.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,68 @@ DEFINE_BITFIELD(foodtypes, list(
#define DRINK_VERYGOOD 4
#define DRINK_FANTASTIC 5

#define FOOD_QUALITY_NORMAL 1
#define FOOD_QUALITY_NICE 2
#define FOOD_QUALITY_GOOD 3
#define FOOD_QUALITY_VERYGOOD 4
#define FOOD_QUALITY_FANTASTIC 5
#define FOOD_QUALITY_AMAZING 6
#define FOOD_QUALITY_TOP 7

#define FOOD_COMPLEXITY_0 0
#define FOOD_COMPLEXITY_1 1
#define FOOD_COMPLEXITY_2 2
#define FOOD_COMPLEXITY_3 3
#define FOOD_COMPLEXITY_4 4
#define FOOD_COMPLEXITY_5 5

/// Labels for food quality
GLOBAL_LIST_INIT(food_quality_description, list(
FOOD_QUALITY_NORMAL = "okay",
FOOD_QUALITY_NICE = "nice",
FOOD_QUALITY_GOOD = "good",
FOOD_QUALITY_VERYGOOD = "very good",
FOOD_QUALITY_FANTASTIC = "fantastic",
FOOD_QUALITY_AMAZING = "amazing",
FOOD_QUALITY_TOP = "godlike",
))

/// Mood events for food quality
GLOBAL_LIST_INIT(food_quality_events, list(
FOOD_QUALITY_NORMAL = /datum/mood_event/food,
FOOD_QUALITY_NICE = /datum/mood_event/food/nice,
FOOD_QUALITY_GOOD = /datum/mood_event/food/good,
FOOD_QUALITY_VERYGOOD = /datum/mood_event/food/verygood,
FOOD_QUALITY_FANTASTIC = /datum/mood_event/food/fantastic,
FOOD_QUALITY_AMAZING = /datum/mood_event/food/amazing,
FOOD_QUALITY_TOP = /datum/mood_event/food/top,
))

/// Weighted lists of crafted food buffs randomly given according to crafting_complexity unless the food has a specific buff
GLOBAL_LIST_INIT(food_buffs, list(
FOOD_COMPLEXITY_1 = list(
/datum/status_effect/food/haste = 1,
),
FOOD_COMPLEXITY_2 = list(
/datum/status_effect/food/haste = 1,
),
FOOD_COMPLEXITY_3 = list(
/datum/status_effect/food/haste = 1,
),
FOOD_COMPLEXITY_4 = list(
/datum/status_effect/food/haste = 1,
),
FOOD_COMPLEXITY_5 = list(
/datum/status_effect/food/haste = 1,
),
))

/// Food quality change according to species diet
#define DISLIKED_FOOD_QUALITY_CHANGE -2
#define LIKED_FOOD_QUALITY_CHANGE 2
/// Threshold for food to give a toxic reaction
#define TOXIC_FOOD_QUALITY_THRESHOLD -8

/// Food is "in a container", not in a code sense, but in a literal sense (canned foods)
#define FOOD_IN_CONTAINER (1<<0)
/// Finger food can be eaten while walking / running around
Expand All @@ -76,11 +138,6 @@ DEFINE_BITFIELD(food_types, list(

#define STOP_SERVING_BREAKFAST (15 MINUTES)

///Amount of reagents you start with on crafted food excluding the used parts
#define CRAFTED_FOOD_BASE_REAGENT_MODIFIER 0.7
///Modifier of reagents you get when crafting food from the parts used
#define CRAFTED_FOOD_INGREDIENT_REAGENT_MODIFIER 0.5

#define IS_EDIBLE(O) (O.GetComponent(/datum/component/edible))

///Food trash flags
Expand Down
2 changes: 2 additions & 0 deletions code/__DEFINES/traits/declarations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_T_RAY_VISIBLE "t-ray-visible" // Visible on t-ray scanners if the atom/var/level == 1
/// If this item's been fried
#define TRAIT_FOOD_FRIED "food_fried"
/// If this item's been made by a chef instead of spawned by the map or admins
#define TRAIT_FOOD_CHEF_MADE "food_made_by_chef"
#define TRAIT_NO_TELEPORT "no-teleport" //you just can't
#define TRAIT_STARGAZED "stargazed" //Affected by a stargazer
#define TRAIT_DOOR_PRYER "door-pryer" //Item can be used on airlocks to pry them open (even when powered)
Expand Down
1 change: 1 addition & 0 deletions code/_globalvars/traits/_traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_DRIED" = TRAIT_DRIED,
"TRAIT_CUSTOMIZABLE_REAGENT_HOLDER" = TRAIT_CUSTOMIZABLE_REAGENT_HOLDER,
"TRAIT_ODD_CUSTOMIZABLE_FOOD_INGREDIENT" = TRAIT_ODD_CUSTOMIZABLE_FOOD_INGREDIENT,
"TRAIT_FOOD_CHEF_MADE" = TRAIT_FOOD_CHEF_MADE,
),
/obj = list(
"TRAIT_FROZEN" = TRAIT_FROZEN
Expand Down
16 changes: 15 additions & 1 deletion code/datums/components/bakeable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
///Time spent baking so far
var/current_bake_time = 0

/// REF() to the mind which placed us in an oven
var/who_baked_us


/datum/component/bakeable/Initialize(bake_result, required_bake_time, positive_result, use_large_steam_sprite)
. = ..()
Expand All @@ -33,12 +36,20 @@
src.positive_result = positive_result

/datum/component/bakeable/RegisterWithParent()
RegisterSignal(parent, COMSIG_ITEM_OVEN_PLACED_IN, PROC_REF(on_baking_start))
RegisterSignal(parent, COMSIG_ITEM_BAKED, PROC_REF(OnBake))
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, PROC_REF(OnExamine))

/datum/component/bakeable/UnregisterFromParent()
. = ..()
UnregisterSignal(parent, list(COMSIG_ITEM_BAKED, COMSIG_PARENT_EXAMINE))
UnregisterSignal(parent, list(COMSIG_ITEM_OVEN_PLACED_IN, COMSIG_ITEM_BAKED, COMSIG_PARENT_EXAMINE))

/// Signal proc for [COMSIG_ITEM_OVEN_PLACED_IN] when baking starts (parent enters an oven)
/datum/component/bakeable/proc/on_baking_start(datum/source, atom/used_oven, mob/baker)
SIGNAL_HANDLER

if(baker && baker.mind)
who_baked_us = REF(baker.mind)

///Ran every time an item is baked by something
/datum/component/bakeable/proc/OnBake(datum/source, atom/used_oven, delta_time = 1)
Expand All @@ -58,7 +69,10 @@
var/atom/original_object = parent
var/obj/item/plate/oven_tray/used_tray = original_object.loc
var/atom/baked_result = new bake_result(used_tray)
original_object.reagents?.trans_to(baked_result, original_object.reagents.total_volume)

if(who_baked_us)
ADD_TRAIT(baked_result, TRAIT_FOOD_CHEF_MADE, who_baked_us)

if(original_object.custom_materials)
baked_result.set_custom_materials(original_object.custom_materials, 1)
Expand Down
3 changes: 3 additions & 0 deletions code/datums/components/crafting/_recipes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,6 @@
*/
/datum/crafting_recipe/proc/check_requirements(mob/user, list/collected_requirements)
return TRUE

/datum/crafting_recipe/proc/on_craft_completion(mob/user, atom/result)
return
7 changes: 6 additions & 1 deletion code/datums/components/crafting/crafting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,11 @@
if(!check_tools(a, R, contents))
return "missing tool."
var/list/parts = del_reqs(R, a)
var/atom/movable/I = new R.result (get_turf(a.loc))
var/atom/movable/I
if(ispath(R.result, /obj/item/food))
I = new R.result (get_turf(a.loc))
else
I = new R.result (get_turf(a.loc))
I.CheckParts(parts, R)
if(send_feedback)
SSblackbox.record_feedback("tally", "object_crafted", 1, I.type)
Expand All @@ -217,6 +221,7 @@
else
result.forceMove(user.drop_location())
to_chat(user, "<span class='notice'>[TR.name] constructed.</span>")
TR.on_craft_completion(user, result)
else
to_chat(user, "<span class='warning'>Construction failed[result]</span>")
busy = FALSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,10 @@
/datum/crafting_recipe/food/New()
real_parts = parts.Copy()
parts |= reqs


/datum/crafting_recipe/food/on_craft_completion(mob/user, atom/result)
SHOULD_CALL_PARENT(TRUE)
. = ..()
if(istype(result) && !isnull(user.mind))
ADD_TRAIT(result, TRAIT_FOOD_CHEF_MADE, REF(user.mind))
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@
reqs = list(
/obj/item/food/patty/plain = 1, // we have no horse meat sadly
/obj/item/food/grown/chili = 2,
/datum/reagent/consumable/cooking_oil = 20,
/datum/reagent/consumable/nutriment/fat/oil = 20,
/obj/item/food/grown/nettle/death = 2, // closest thing to "grass of death"
/obj/item/food/cheese/wedge = 4,
/obj/item/food/bun = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,19 +139,19 @@
)
subcategory = CAT_CAKE

/datum/crafting_recipe/food/bscccake
name = "blackberry and strawberry chocolate cake"
result = /obj/item/food/cake/bscc
/datum/crafting_recipe/food/berry_chocolate_cake
name = "strawberry chocolate cake"
result = /obj/item/food/cake/berry_chocolate_cake
reqs = list(
/obj/item/food/cake/plain = 1,
/obj/item/food/chocolatebar = 2,
/obj/item/food/grown/berries = 5
)
subcategory = CAT_CAKE

/datum/crafting_recipe/food/bscvcake
/datum/crafting_recipe/food/berry_vanilla_cake
name = "blackberry and strawberry vanilla cake"
result = /obj/item/food/cake/bsvc
result = /obj/item/food/cake/berry_vanilla_cake
reqs = list(
/obj/item/food/cake/plain = 1,
/obj/item/food/grown/berries = 5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
subcategory = CAT_EGG

/datum/crafting_recipe/food/omelette
name = "Omelette"
name = "Omelette du fromage"
result = /obj/item/food/omelette
reqs = list(
/obj/item/food/egg = 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,16 @@
)
subcategory = CAT_PASTRY

/datum/crafting_recipe/food/jupitercupcake
name = "Jupiter-cup-cake"
reqs = list(
/obj/item/food/pastrybase = 1,
/obj/item/food/grown/mushroom/jupitercup = 1,
/datum/reagent/consumable/caramel = 3,
)
result = /obj/item/food/jupitercupcake
category = CAT_PASTRY

/datum/crafting_recipe/food/honeybun
name = "Honey bun"
result = /obj/item/food/honeybun
Expand Down
Loading

0 comments on commit bec842f

Please sign in to comment.