-
-
Notifications
You must be signed in to change notification settings - Fork 444
/
Copy pathfood.dm
71 lines (65 loc) · 3.16 KB
/
food.dm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
////////////////////////////////////////////////////////////////////////////////
/// Food.
////////////////////////////////////////////////////////////////////////////////
/// Note: When adding food items with dummy parents, make sure to add
/// the parent to the exclusion list in code/__HELPERS/unsorted.dm's
/// get_random_food proc.
////////////////////////////////////////////////////////////////////////////////
#define STOP_SERVING_BREAKFAST (15 MINUTES)
/obj/item/reagent_containers/food
possible_transfer_amounts = list()
volume = 50 //Sets the default container amount for all food items.
reagent_flags = INJECTABLE
resistance_flags = FLAMMABLE
fryable = TRUE
var/foodtype = NONE
var/last_check_time
///Will this food turn into badrecipe on a grill? Don't use this for everything; preferably mostly for food that is made on a grill to begin with so it burns after some time
var/burns_on_grill = FALSE
///Will this food turn into badrecipe in an oven? Don't use this for everything; preferably mostly for food that is made in an oven to begin with so it burns after some time
var/burns_in_oven = FALSE
/obj/item/reagent_containers/food/Initialize(mapload)
. = ..()
if(!mapload)
pixel_x = rand(-5, 5)
pixel_y = rand(-5, 5)
MakeGrillable()
MakeBakeable()
///This proc handles grillable components, overwrite if you want different grill results etc.
/obj/item/reagent_containers/food/proc/MakeGrillable()
if(burns_on_grill)
AddComponent(/datum/component/grillable, /obj/item/reagent_containers/food/snacks/badrecipe, rand(20 SECONDS, 30 SECONDS), FALSE)
return
///This proc handles bakeable components, overwrite if you want different bake results etc.
/obj/item/reagent_containers/food/proc/MakeBakeable()
if(burns_in_oven)
AddComponent(/datum/component/bakeable, /obj/item/reagent_containers/food/snacks/badrecipe, rand(25 SECONDS, 40 SECONDS), FALSE)
return
/obj/item/reagent_containers/food/proc/checkLiked(fraction, mob/M)
if(last_check_time + 50 < world.time)
. = TRUE
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(!HAS_TRAIT(H, TRAIT_AGEUSIA))
if(foodtype & H.dna.species.toxic_food)
to_chat(H,span_warning("What the hell was that thing?!"))
H.adjust_disgust(25 + 30 * fraction)
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "toxic_food", /datum/mood_event/disgusting_food)
else if(foodtype & H.dna.species.disliked_food)
to_chat(H,span_notice("That didn't taste very good..."))
H.adjust_disgust(11 + 15 * fraction)
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "gross_food", /datum/mood_event/gross_food)
else if(foodtype & H.dna.species.liked_food)
to_chat(H,span_notice("I love this taste!"))
H.adjust_disgust(-5 + -2.5 * fraction)
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "fav_food", /datum/mood_event/favorite_food)
else
if(foodtype & H.dna.species.toxic_food)
to_chat(H, span_warning("You don't feel so good..."))
H.adjust_disgust(25 + 30 * fraction)
if((foodtype & BREAKFAST) && world.time - SSticker.round_start_time < STOP_SERVING_BREAKFAST)
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "breakfast", /datum/mood_event/breakfast)
last_check_time = world.time
else
return FALSE
#undef STOP_SERVING_BREAKFAST