Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newfood Atomization: Splits Pastries.dm into 4, converts to newfood #9937

Merged
merged 10 commits into from
Oct 30, 2023
2 changes: 1 addition & 1 deletion _maps/RandomRooms/5x3/sk_rdm071_pubbykitchen.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/5x4/sk_rdm021_boxdinner.dmm

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

12 changes: 6 additions & 6 deletions _maps/RandomRuins/LavaRuins/lavaland_surface_animal_hospital.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/derelict6.dmm

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

6 changes: 3 additions & 3 deletions _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.

6 changes: 3 additions & 3 deletions _maps/shuttles/emergency/emergency_luxury.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/shuttles/emergency/emergency_zeta.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/shuttles/whiteship/whiteship_box.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/shuttles/whiteship/whiteship_delta.dmm

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

5 changes: 4 additions & 1 deletion beestation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1400,7 +1400,11 @@
#include "code\game\objects\items\food\burgers.dm"
#include "code\game\objects\items\food\cake.dm"
#include "code\game\objects\items\food\dough.dm"
#include "code\game\objects\items\food\donkpockets.dm"
#include "code\game\objects\items\food\donuts.dm"
#include "code\game\objects\items\food\mexican.dm"
#include "code\game\objects\items\food\pancakes.dm"
#include "code\game\objects\items\food\pastries.dm"
#include "code\game\objects\items\food\pizza.dm"
#include "code\game\objects\items\food\spaghetti.dm"
#include "code\game\objects\items\grenades\_grenade.dm"
Expand Down Expand Up @@ -2547,7 +2551,6 @@
#include "code\modules\food_and_drinks\food\snacks_frozen.dm"
#include "code\modules\food_and_drinks\food\snacks_meat.dm"
#include "code\modules\food_and_drinks\food\snacks_other.dm"
#include "code\modules\food_and_drinks\food\snacks_pastry.dm"
#include "code\modules\food_and_drinks\food\snacks_pie.dm"
#include "code\modules\food_and_drinks\food\snacks_salad.dm"
#include "code\modules\food_and_drinks\food\snacks_sandwichtoast.dm"
Expand Down
5 changes: 5 additions & 0 deletions code/__DEFINES/food.dm
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,8 @@
#define CRAFTED_FOOD_INGREDIENT_REAGENT_MODIFIER 0.5

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

///Food preference enums
#define FOOD_LIKED 1
#define FOOD_DISLIKED 2
#define FOOD_TOXIC 3
21 changes: 15 additions & 6 deletions code/controllers/subsystem/traumas.dm
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ SUBSYSTEM_DEF(traumas)
/obj/item/gun/magic/staff, /obj/item/gun/magic/wand,
/obj/item/nullrod, /obj/item/clothing/under/rank/civilian/chaplain)),

"aliens" = typecacheof(list(/obj/item/clothing/mask/facehugger, /obj/item/organ/body_egg/alien_embryo,
"aliens" = typecacheof(list(/obj/item/clothing/mask/facehugger, /obj/item/organ/body_egg/alien_embryo,
/obj/structure/alien, /obj/item/toy/toy_xeno,
/obj/item/clothing/suit/armor/abductor, /obj/item/abductor, /obj/item/gun/energy/alien,
/obj/item/abductor/baton, /obj/item/radio/headset/abductor, /obj/item/scalpel/alien, /obj/item/hemostat/alien,
Expand All @@ -130,11 +130,20 @@ SUBSYSTEM_DEF(traumas)
/obj/machinery/abductor, /obj/item/crowbar/abductor, /obj/item/screwdriver/abductor, /obj/item/weldingtool/abductor,
/obj/item/wirecutters/abductor, /obj/item/wrench/abductor, /obj/item/stack/sheet/mineral/abductor)),

"birds" = typecacheof(list(/obj/item/clothing/mask/gas/plaguedoctor, /obj/item/reagent_containers/food/snacks/cracker,
/obj/item/clothing/suit/chickensuit, /obj/item/clothing/head/chicken,
/obj/item/clothing/suit/toggle/owlwings, /obj/item/clothing/under/costume/owl, /obj/item/clothing/mask/gas/owl_mask,
/obj/item/clothing/under/costume/griffin, /obj/item/clothing/shoes/griffin, /obj/item/clothing/head/griffin,
/obj/item/clothing/head/helmet/space/freedom, /obj/item/clothing/suit/space/freedom)),
"birds" = typecacheof(list(
/obj/item/clothing/mask/gas/plaguedoctor,
/obj/item/food/cracker,
/obj/item/clothing/suit/chickensuit,
/obj/item/clothing/head/chicken,
/obj/item/clothing/suit/toggle/owlwings,
/obj/item/clothing/under/costume/owl,
/obj/item/clothing/mask/gas/owl_mask,
/obj/item/clothing/under/costume/griffin,
/obj/item/clothing/shoes/griffin,
/obj/item/clothing/head/griffin,
/obj/item/clothing/head/helmet/space/freedom,
/obj/item/clothing/suit/space/freedom
)),

"anime" = typecacheof(list(/obj/item/clothing/under/costume/schoolgirl, /obj/item/katana, /obj/item/reagent_containers/food/snacks/sashimi, /obj/item/reagent_containers/food/snacks/chawanmushi,
/obj/item/reagent_containers/food/drinks/bottle/sake, /obj/item/throwing_star, /obj/item/clothing/head/kitty/genuine, /obj/item/clothing/suit/space/space_ninja,
Expand Down
42 changes: 33 additions & 9 deletions code/datums/components/food/edible.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ Behavior that's still missing from this component that original food items had t
var/datum/callback/after_eat
///Callback to be ran for when you finish eating something
var/datum/callback/on_consume
///Callback to be ran for when the code check if the food is liked, allowing for unique overrides for special foods like donuts with cops.
var/datum/callback/check_liked
///Last time we checked for food likes
var/last_check_time
///The initial reagents of this food when it is made
Expand All @@ -50,7 +52,8 @@ Behavior that's still missing from this component that original food items had t
///The type of atom this creates when the object is microwaved.
var/microwaved_type

/datum/component/edible/Initialize(list/initial_reagents,
/datum/component/edible/Initialize(
list/initial_reagents,
food_flags = NONE,
foodtypes = NONE,
volume = 50,
Expand All @@ -63,8 +66,10 @@ Behavior that's still missing from this component that original food items had t
datum/callback/pre_eat,
datum/callback/on_compost,
datum/callback/after_eat,
datum/callback/on_consume
)
datum/callback/on_consume,
datum/callback/check_liked,
)

if(!isatom(parent))
return COMPONENT_INCOMPATIBLE

Expand Down Expand Up @@ -97,6 +102,7 @@ Behavior that's still missing from this component that original food items had t
src.initial_reagents = string_assoc_list(initial_reagents)
src.tastes = string_assoc_list(tastes)
src.microwaved_type = microwaved_type
src.check_liked = check_liked

var/atom/owner = parent

Expand All @@ -109,20 +115,23 @@ Behavior that's still missing from this component that original food items had t
else
owner.reagents.add_reagent(rid, amount)

/datum/component/edible/InheritComponent(datum/component/C,
/datum/component/edible/InheritComponent(
datum/component/C,
i_am_original,
list/initial_reagents,
food_flags = NONE,
foodtypes = NONE,
volume = 50,
eat_time = 30,
eat_time = 10,
list/tastes,
list/eatverbs = list("bite","chew","nibble","gnaw","gobble","chomp"),
bite_consumption = 2,
microwaved_type,
datum/callback/pre_eat,
datum/callback/on_compost,
datum/callback/after_eat,
datum/callback/on_consume
datum/callback/on_consume,
datum/callback/check_liked,
)

. = ..()
Expand Down Expand Up @@ -423,16 +432,31 @@ Behavior that's still missing from this component that original food items had t
if(foodtypes & tongue.toxic_food)
to_chat(human_eater, "<span class='warning'>You don't feel so good...</span>")
human_eater.adjust_disgust(25 + 30 * fraction)
else
return // Later checks are irrelevant if you have ageusia

var/food_taste_reaction

if(check_liked) //Callback handling; use this as an override for special food like donuts
food_taste_reaction = check_liked.Invoke(fraction, human_eater)

if(!food_taste_reaction)
if(foodtypes & tongue.toxic_food)
food_taste_reaction = FOOD_TOXIC
else if(foodtypes & tongue.disliked_food)
food_taste_reaction = FOOD_DISLIKED
else if(foodtypes & tongue.liked_food)
food_taste_reaction = FOOD_LIKED

switch(food_taste_reaction)
if(FOOD_TOXIC)
to_chat(human_eater,"<span class='warning'>What the hell was that thing?!</span>")
human_eater.adjust_disgust(25 + 30 * fraction)
SEND_SIGNAL(human_eater, COMSIG_ADD_MOOD_EVENT, "toxic_food", /datum/mood_event/disgusting_food)
else if(foodtypes & tongue.disliked_food)
if(FOOD_DISLIKED)
to_chat(human_eater,"<span class='notice'>That didn't taste very good...</span>")
human_eater.adjust_disgust(11 + 15 * fraction)
SEND_SIGNAL(human_eater, COMSIG_ADD_MOOD_EVENT, "gross_food", /datum/mood_event/gross_food)
else if(foodtypes & tongue.liked_food)
if(FOOD_LIKED)
to_chat(human_eater,"<span class='notice'>I love this taste!</span>")
human_eater.adjust_disgust(-5 + -2.5 * fraction)
SEND_SIGNAL(human_eater, COMSIG_ADD_MOOD_EVENT, "fav_food", /datum/mood_event/favorite_food)
Expand Down
2 changes: 1 addition & 1 deletion code/datums/recipe.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
/datum/recipe
var/list/reagents_list // example: = list(/datum/reagent/consumable/berryjuice = 5) // do not list same reagent twice
var/list/items // example: =list(/obj/item/crowbar, /obj/item/welder) // place /foo/bar before /foo
var/result //example: = /obj/item/reagent_containers/food/snacks/donut
var/result //example: = /obj/item/food/donut
var/time = 100 // 1/10 part of second


Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/fat_sucker.dm
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
qdel(src)
return
if(nutrients >= nutrient_to_meat * 2)
C.put_in_hands(new /obj/item/reagent_containers/food/snacks/cookie (), TRUE)
C.put_in_hands(new /obj/item/food/cookie, del_on_fail = TRUE)
while(nutrients >= nutrient_to_meat)
nutrients -= nutrient_to_meat
new C.type_of_meat (drop_location())
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/syndicatebomb.dm
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@
qdel(src)

/obj/item/bombcore/badmin/summon
var/summon_path = /obj/item/reagent_containers/food/snacks/cookie
var/summon_path = /obj/item/food/cookie
var/amt_summon = 1

/obj/item/bombcore/badmin/summon/detonate()
Expand Down
20 changes: 10 additions & 10 deletions code/game/objects/effects/spawners/mailspawner.dm
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@

/obj/effect/spawner/mail/donut/Initialize()
var/static/list/mail_donut= pick(
/obj/item/reagent_containers/food/snacks/donut/berry,
/obj/item/reagent_containers/food/snacks/donut/apple,
/obj/item/reagent_containers/food/snacks/donut/caramel,
/obj/item/reagent_containers/food/snacks/donut/choco,
/obj/item/reagent_containers/food/snacks/donut/matcha,)
/obj/item/food/donut/berry,
/obj/item/food/donut/apple,
/obj/item/food/donut/caramel,
/obj/item/food/donut/choco,
/obj/item/food/donut/matcha,)
new mail_donut(loc)
return ..()

Expand All @@ -113,11 +113,11 @@

/obj/effect/spawner/mail/rdonut/Initialize()
var/static/list/mail_rdonut= pick(
/obj/item/reagent_containers/food/snacks/donut/meat,
/obj/item/reagent_containers/food/snacks/donut/trumpet,
/obj/item/reagent_containers/food/snacks/donut/blumpkin,
/obj/item/reagent_containers/food/snacks/donut/bungo,
/obj/item/reagent_containers/food/snacks/donut/chaos,)
/obj/item/food/donut/meat,
/obj/item/food/donut/trumpet,
/obj/item/food/donut/blumpkin,
/obj/item/food/donut/bungo,
/obj/item/food/donut/chaos,)
new mail_rdonut(loc)
return ..()

Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/RSF.dm
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ RSF
var/turf/T = get_turf(A)
playsound(src.loc, 'sound/machines/click.ogg', 10, 1)
to_chat(user, "Fabricating Cookie..")
var/obj/item/reagent_containers/food/snacks/cookie/S = new /obj/item/reagent_containers/food/snacks/cookie(T)
var/obj/item/food/cookie/S = new /obj/item/food/cookie(T)
if(toxin)
S.reagents.add_reagent(/datum/reagent/toxin/chloralhydrate, 10)
if (iscyborg(user))
Expand Down
Loading
Loading