/
condiment.dm
355 lines (300 loc) · 14.1 KB
/
condiment.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
///////////////////////////////////////////////Condiments
//Notes by Darem: The condiments food-subtype is for stuff you don't actually eat but you use to modify existing food. They all
// leave empty containers when used up and can be filled/re-filled with other items. Formatting for first section is identical
// to mixed-drinks code. If you want an object that starts pre-loaded, you need to make it in addition to the other code.
//Food items that aren't eaten normally and leave an empty container behind.
/obj/item/reagent_containers/food/condiment
name = "Condiment Container"
desc = "Just your average condiment container."
icon = 'icons/obj/food/food.dmi'
icon_state = "emptycondiment"
atom_flags = ATOM_FLAG_OPEN_CONTAINER
possible_transfer_amounts = "1;5;10"
center_of_mass = "x=16;y=6"
volume = 50
var/list/starting_reagents
var/static/list/special_bottles = list(
/datum/reagent/nutriment/ketchup = /obj/item/reagent_containers/food/condiment/ketchup,
/datum/reagent/nutriment/barbecue = /obj/item/reagent_containers/food/condiment/barbecue,
/datum/reagent/capsaicin = /obj/item/reagent_containers/food/condiment/capsaicin,
/datum/reagent/enzyme = /obj/item/reagent_containers/food/condiment/enzyme,
/datum/reagent/nutriment/soysauce = /obj/item/reagent_containers/food/condiment/soysauce,
/datum/reagent/frostoil = /obj/item/reagent_containers/food/condiment/frostoil,
/datum/reagent/sodiumchloride = /obj/item/reagent_containers/food/condiment/small/saltshaker,
/datum/reagent/blackpepper = /obj/item/reagent_containers/food/condiment/small/peppermill,
/datum/reagent/nutriment/cornoil = /obj/item/reagent_containers/food/condiment/cornoil,
/datum/reagent/sugar = /obj/item/reagent_containers/food/condiment/sugar,
/datum/reagent/nutriment/mayo = /obj/item/reagent_containers/food/condiment/mayo,
/datum/reagent/nutriment/vinegar = /obj/item/reagent_containers/food/condiment/vinegar,
/datum/reagent/oliveoil = /obj/item/reagent_containers/food/condiment/small/oliveoil
)
/obj/item/reagent_containers/food/condiment/use_tool(obj/item/W, mob/living/user, list/click_params)
if(istype(W, /obj/item/pen) || istype(W, /obj/item/device/flashlight/pen))
var/label = sanitizeSafe(input(user, "Enter a label for [name]", "Label", label_text), MAX_NAME_LEN)
if (!label)
return TRUE
AddLabel(label, user)
return TRUE
return ..()
/obj/item/reagent_containers/food/condiment/attack_self(mob/user as mob)
return
/obj/item/reagent_containers/food/condiment/use_before(mob/M as mob, mob/user as mob)
. = FALSE
if (!istype(M))
return FALSE
if (standard_feed_mob(user, M))
return TRUE
/obj/item/reagent_containers/food/condiment/use_after(obj/target, mob/living/user, click_parameters)
if(standard_dispenser_refill(user, target) || standard_pour_into(user, target))
return TRUE
if(istype(target, /obj/item/reagent_containers/food/snacks)) // These are not opencontainers but we can transfer to them
if(!reagents || !reagents.total_volume)
to_chat(user, SPAN_NOTICE("There is no condiment left in \the [src]."))
return TRUE
if(!target.reagents.get_free_space())
to_chat(user, SPAN_NOTICE("You can't add more condiment to \the [target]."))
return TRUE
var/trans = reagents.trans_to_obj(target, amount_per_transfer_from_this)
to_chat(user, SPAN_NOTICE("You add [trans] units of the condiment to \the [target]."))
return TRUE
/obj/item/reagent_containers/food/condiment/feed_sound(mob/user)
playsound(user.loc, 'sound/items/drink.ogg', rand(10, 50), 1)
/obj/item/reagent_containers/food/condiment/self_feed_message(mob/user)
to_chat(user, SPAN_NOTICE("You swallow some of contents of \the [src]."))
/obj/item/reagent_containers/food/condiment/Initialize()
. = ..()
for(var/R in starting_reagents)
reagents.add_reagent(R, starting_reagents[R])
/obj/item/reagent_containers/food/condiment/on_reagent_change()
var/reagent = reagents.get_master_reagent_type()
if(reagent in special_bottles)
var/obj/item/reagent_containers/food/condiment/special_bottle = special_bottles[reagent]
SetName(initial(special_bottle.name))
desc = initial(special_bottle.desc)
icon_state = initial(special_bottle.icon_state)
center_of_mass = initial(special_bottle.center_of_mass)
else
SetName(initial(name))
desc = initial(desc)
center_of_mass = initial(center_of_mass)
if(length(reagents.reagent_list) > 0)
icon_state = "mixedcondiments"
else
icon_state = "emptycondiment"
/obj/item/reagent_containers/food/condiment/enzyme
name = "universal enzyme"
desc = "Used in cooking various dishes."
icon_state = "enzyme"
starting_reagents = list(/datum/reagent/enzyme = 50)
/obj/item/reagent_containers/food/condiment/barbecue
name = "barbecue sauce"
desc = "Barbecue sauce, it's labeled 'sweet and spicy'"
icon_state = "barbecue"
starting_reagents = list(/datum/reagent/nutriment/barbecue = 50)
/obj/item/reagent_containers/food/condiment/sugar
name = "sugar"
desc = "Cavities in a bottle."
starting_reagents = list(/datum/reagent/sugar = 50)
/obj/item/reagent_containers/food/condiment/ketchup
name = "ketchup"
desc = "Tomato, but more liquid, stronger, better."
icon_state = "ketchup"
starting_reagents = list(/datum/reagent/nutriment/ketchup = 50)
/obj/item/reagent_containers/food/condiment/cornoil
name = "corn oil"
desc = "A delicious oil used in cooking. Made from corn."
icon_state = "oliveoil"
starting_reagents = list(/datum/reagent/nutriment/cornoil = 50)
/obj/item/reagent_containers/food/condiment/vinegar
name = "vinegar"
icon_state = "vinegar"
desc = "As acidic as it gets in the kitchen."
starting_reagents = list(/datum/reagent/nutriment/vinegar = 50)
/obj/item/reagent_containers/food/condiment/mayo
name = "mayonnaise"
icon_state = "mayo"
desc = "Mayonnaise, used for centuries to make things edible."
starting_reagents = list(/datum/reagent/nutriment/mayo = 50)
/obj/item/reagent_containers/food/condiment/frostoil
name = "coldsauce"
desc = "Leaves the tongue numb in its passage."
icon_state = "coldsauce"
starting_reagents = list(/datum/reagent/frostoil = 50)
/obj/item/reagent_containers/food/condiment/capsaicin
name = "hotsauce"
desc = "You can almost TASTE the stomach ulcers now!"
icon_state = "hotsauce"
starting_reagents = list(/datum/reagent/capsaicin = 50)
/obj/item/reagent_containers/food/condiment/small
possible_transfer_amounts = "1;20"
amount_per_transfer_from_this = 1
volume = 20
/obj/item/reagent_containers/food/condiment/small/on_reagent_change()
return
/obj/item/reagent_containers/food/condiment/small/saltshaker
name = "salt shaker"
desc = "Salt. From space oceans, presumably."
icon_state = "saltshakersmall"
center_of_mass = "x=16;y=9"
starting_reagents = list(/datum/reagent/sodiumchloride = 20)
/obj/item/reagent_containers/food/condiment/small/peppermill
name = "pepper mill"
desc = "Often used to flavor food or make people sneeze."
icon_state = "peppermillsmall"
center_of_mass = "x=16;y=8"
starting_reagents = list(/datum/reagent/blackpepper = 20)
/obj/item/reagent_containers/food/condiment/small/sugar
name = "sugar"
desc = "Sweetness in a bottle."
icon_state = "sugarsmall"
center_of_mass = "x=17;y=9"
starting_reagents = list(/datum/reagent/sugar = 20)
//MRE condiments and drinks.
/obj/item/reagent_containers/food/condiment/small/packet
icon_state = "packet_small"
w_class = ITEM_SIZE_TINY
possible_transfer_amounts = "1;5;10"
amount_per_transfer_from_this = 1
volume = 10
/obj/item/reagent_containers/food/condiment/small/packet/salt
name = "salt packet"
desc = "Contains 5u of table salt."
icon_state = "packet_small_white"
starting_reagents = list(/datum/reagent/sodiumchloride = 5)
/obj/item/reagent_containers/food/condiment/small/packet/pepper
name = "pepper packet"
desc = "Contains 5u of black pepper."
icon_state = "packet_small_black"
starting_reagents = list(/datum/reagent/blackpepper = 5)
/obj/item/reagent_containers/food/condiment/small/packet/sugar
name = "sugar packet"
desc = "Contains 5u of refined sugar."
icon_state = "packet_small_white"
starting_reagents = list(/datum/reagent/sugar = 5)
/obj/item/reagent_containers/food/condiment/small/packet/jelly
name = "jelly packet"
desc = "Contains 10u of cherry jelly. Best used for spreading on crackers."
starting_reagents = list(/datum/reagent/nutriment/cherryjelly = 10)
icon_state = "packet_medium"
/obj/item/reagent_containers/food/condiment/small/packet/honey
name = "honey packet"
desc = "Contains 10u of honey."
starting_reagents = list(/datum/reagent/sugar = 10)
icon_state = "packet_medium"
/obj/item/reagent_containers/food/condiment/small/packet/capsaicin
name = "hot sauce packet"
desc = "Contains 5u of hot sauce. Enjoy in moderation."
icon_state = "packet_small_red"
starting_reagents = list(/datum/reagent/capsaicin = 5)
/obj/item/reagent_containers/food/condiment/small/packet/ketchup
name = "ketchup packet"
desc = "Contains 5u of ketchup."
icon_state = "packet_small_red"
starting_reagents = list(/datum/reagent/nutriment/ketchup = 5)
/obj/item/reagent_containers/food/condiment/small/packet/mayo
name = "mayonnaise packet"
desc = "Contains 5u of mayonnaise."
icon_state = "packet_small_white"
starting_reagents = list(/datum/reagent/nutriment/mayo = 5)
/obj/item/reagent_containers/food/condiment/small/packet/soy
name = "soy sauce packet"
desc = "Contains 5u of soy sauce."
icon_state = "packet_small_black"
starting_reagents = list(/datum/reagent/nutriment/soysauce = 5)
/obj/item/reagent_containers/food/condiment/small/packet/coffee
name = "instant coffee powder packet"
desc = "Contains 5u of instant coffee powder. Mix with 25u of water."
starting_reagents = list(/datum/reagent/nutriment/coffee/instant = 5)
/obj/item/reagent_containers/food/condiment/small/packet/tea
name = "instant tea powder packet"
desc = "Contains 5u of instant black tea powder. Mix with 25u of water."
starting_reagents = list(/datum/reagent/nutriment/tea/instant = 5)
/obj/item/reagent_containers/food/condiment/small/packet/cocoa
name = "cocoa powder packet"
desc = "Contains 5u of cocoa powder. Mix with 25u of water and heat."
starting_reagents = list(/datum/reagent/nutriment/coco = 5)
/obj/item/reagent_containers/food/condiment/small/packet/grape
name = "grape juice powder packet"
desc = "Contains 5u of powdered grape juice. Mix with 15u of water."
starting_reagents = list(/datum/reagent/nutriment/instantjuice/grape = 5)
/obj/item/reagent_containers/food/condiment/small/packet/orange
name = "orange juice powder packet"
desc = "Contains 5u of powdered orange juice. Mix with 15u of water."
starting_reagents = list(/datum/reagent/nutriment/instantjuice/orange = 5)
/obj/item/reagent_containers/food/condiment/small/packet/watermelon
name = "watermelon juice powder packet"
desc = "Contains 5u of powdered watermelon juice. Mix with 15u of water."
starting_reagents = list(/datum/reagent/nutriment/instantjuice/watermelon = 5)
/obj/item/reagent_containers/food/condiment/small/packet/apple
name = "apple juice powder packet"
desc = "Contains 5u of powdered apple juice. Mix with 15u of water."
starting_reagents = list(/datum/reagent/nutriment/instantjuice/apple = 5)
/obj/item/reagent_containers/food/condiment/small/packet/protein
name = "protein powder packet"
desc = "Contains 10u of powdered protein. Mix with 20u of water."
icon_state = "packet_medium"
starting_reagents = list(/datum/reagent/nutriment/protein = 10)
/obj/item/reagent_containers/food/condiment/small/packet/crayon
name = "crayon powder packet"
desc = "Contains 10u of powdered crayon. Mix with 30u of water."
starting_reagents = list(/datum/reagent/crayon_dust = 10)
/obj/item/reagent_containers/food/condiment/small/packet/crayon/red
starting_reagents = list(/datum/reagent/crayon_dust/red = 10)
/obj/item/reagent_containers/food/condiment/small/packet/crayon/orange
starting_reagents = list(/datum/reagent/crayon_dust/orange = 10)
/obj/item/reagent_containers/food/condiment/small/packet/crayon/yellow
starting_reagents = list(/datum/reagent/crayon_dust/yellow = 10)
/obj/item/reagent_containers/food/condiment/small/packet/crayon/green
starting_reagents = list(/datum/reagent/crayon_dust/green = 10)
/obj/item/reagent_containers/food/condiment/small/packet/crayon/blue
starting_reagents = list(/datum/reagent/crayon_dust/blue = 10)
/obj/item/reagent_containers/food/condiment/small/packet/crayon/purple
starting_reagents = list(/datum/reagent/crayon_dust/purple = 10)
/obj/item/reagent_containers/food/condiment/small/packet/crayon/grey
starting_reagents = list(/datum/reagent/crayon_dust/grey = 10)
/obj/item/reagent_containers/food/condiment/small/packet/crayon/brown
starting_reagents = list(/datum/reagent/crayon_dust/brown = 10)
//End of MRE stuff.
/obj/item/reagent_containers/food/condiment/flour
name = "flour sack"
desc = "A big bag of flour. Good for baking!"
icon = 'icons/obj/food/food.dmi'
icon_state = "flour"
item_state = "flour"
randpixel = 10
starting_reagents = list(/datum/reagent/nutriment/flour = 50)
/obj/item/reagent_containers/food/condiment/flour/on_reagent_change()
return
/obj/item/reagent_containers/food/condiment/salt
name = "big bag of salt"
desc = "A nonsensically large bag of salt. Carefully refined from countless shifts."
icon = 'icons/obj/food/food.dmi'
icon_state = "salt"
item_state = "flour"
randpixel = 10
volume = 500
w_class = ITEM_SIZE_LARGE
starting_reagents = list(/datum/reagent/sodiumchloride = 500)
/obj/item/reagent_containers/food/condiment/salt/on_reagent_change()
return
/obj/item/reagent_containers/food/condiment/mint
name = "mint essential oil"
desc = "A small bottle of the essential oil of some kind of mint plant."
icon = 'icons/obj/food/food.dmi'
icon_state = "coldsauce"
starting_reagents = list(/datum/reagent/nutriment/mint = 15)
/obj/item/reagent_containers/food/condiment/mint/on_reagent_change()
return
/obj/item/reagent_containers/food/condiment/soysauce
name = "soy sauce"
desc = "A dark, salty, savoury flavoring."
icon_state = "soysauce"
amount_per_transfer_from_this = 1
volume = 20
starting_reagents = list(/datum/reagent/nutriment/soysauce = 20)
/obj/item/reagent_containers/food/condiment/small/oliveoil
name = "olive oil"
desc = "Used in food preparation and flavoring."
icon_state = "oliveoilsmall"
center_of_mass = "x=16;y=8"
starting_reagents = list(/datum/reagent/oliveoil = 20)