forked from tgstation/tgstation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
brewing.dm
290 lines (232 loc) · 7.24 KB
/
brewing.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
//This dm file includes some food processing machines:
// - I. Mill
// - II. Fermenter
// - III. Still
// - IV. Squeezer
// - V. Centrifuge
// I. The mill is intended to be loaded with produce and returns ground up items. For example: Wheat should become flour and grapes should become raisins.
/obj/machinery/mill
var/list/obj/item/weapon/reagent_containers/food/input = list()
var/list/obj/item/weapon/reagent_containers/food/output = list()
var/obj/item/weapon/reagent_containers/food/milled_item
var/busy = 0
var/progress = 0
var/error = 0
name = "\improper Mill"
desc = "It is a machine that grinds produce."
icon_state = "autolathe"
density = 1
anchored = 1
use_power = 1
idle_power_usage = 10
active_power_usage = 1000
/obj/machinery/mill/process()
if(error)
return
if(!busy)
use_power = 1
if(input.len)
milled_item = input[1]
input -= milled_item
progress = 0
busy = 1
use_power = 2
return
progress++
if(progress < 10) //Edit this value to make milling faster or slower
return //Not done yet.
switch(milled_item.type)
if(/obj/item/weapon/reagent_containers/food/snacks/grown/wheat) //Wheat becomes flour
var/obj/item/weapon/reagent_containers/food/drinks/flour/F = new(src)
output += F
if(/obj/item/weapon/reagent_containers/food/drinks/flour) //Flour is still flour
var/obj/item/weapon/reagent_containers/food/drinks/flour/F = new(src)
output += F
else
error = 1
del(milled_item)
busy = 0
/obj/machinery/mill/attackby(var/obj/item/weapon/W as obj, mob/user as mob)
if(istype(W,/obj/item/weapon/reagent_containers/food))
user.u_equip(W)
W.loc = src
input += W
else
..()
/obj/machinery/mill/attack_hand(var/mob/user as mob)
for(var/obj/item/weapon/reagent_containers/food/F in output)
F.loc = src.loc
output -= F
// II. The fermenter is intended to be loaded with food items and returns medium-strength alcohol items, sucha s wine and beer.
/obj/machinery/fermenter
var/list/obj/item/weapon/reagent_containers/food/input = list()
var/list/obj/item/weapon/reagent_containers/food/output = list()
var/obj/item/weapon/reagent_containers/food/fermenting_item
var/water_level = 0
var/busy = 0
var/progress = 0
var/error = 0
name = "\improper Fermenter"
desc = "It is a machine that ferments produce into alcoholic drinks."
icon_state = "autolathe"
density = 1
anchored = 1
use_power = 1
idle_power_usage = 10
active_power_usage = 500
/obj/machinery/fermenter/process()
if(error)
return
if(!busy)
use_power = 1
if(input.len)
fermenting_item = input[1]
input -= fermenting_item
progress = 0
busy = 1
use_power = 2
return
if(!water_level)
return
water_level--
progress++
if(progress < 10) //Edit this value to make milling faster or slower
return //Not done yet.
switch(fermenting_item.type)
if(/obj/item/weapon/reagent_containers/food/drinks/flour) //Flour is still flour
var/obj/item/weapon/reagent_containers/food/drinks/beer/B = new(src)
output += B
else
error = 1
del(fermenting_item)
busy = 0
/obj/machinery/fermenter/attackby(var/obj/item/weapon/W as obj, mob/user as mob)
if(istype(W,/obj/item/weapon/reagent_containers/food))
user.u_equip(W)
W.loc = src
input += W
else
..()
/obj/machinery/fermenter/attack_hand(var/mob/user as mob)
for(var/obj/item/weapon/reagent_containers/food/F in output)
F.loc = src.loc
output -= F
// III. The still is a machine that is loaded with food items and returns hard liquor, such as vodka.
/obj/machinery/still
var/list/obj/item/weapon/reagent_containers/food/input = list()
var/list/obj/item/weapon/reagent_containers/food/output = list()
var/obj/item/weapon/reagent_containers/food/destilling_item
var/busy = 0
var/progress = 0
var/error = 0
name = "\improper Still"
desc = "It is a machine that produces hard liquor from alcoholic drinks."
icon_state = "autolathe"
density = 1
anchored = 1
use_power = 1
idle_power_usage = 10
active_power_usage = 10000
/obj/machinery/still/process()
if(error)
return
if(!busy)
use_power = 1
if(input.len)
destilling_item = input[1]
input -= destilling_item
progress = 0
busy = 1
use_power = 2
return
progress++
if(progress < 10) //Edit this value to make distilling faster or slower
return //Not done yet.
switch(destilling_item.type)
if(/obj/item/weapon/reagent_containers/food/drinks/beer) //Flour is still flour
var/obj/item/weapon/reagent_containers/food/drinks/bottle/vodka/V = new(src)
output += V
else
error = 1
del(destilling_item)
busy = 0
/obj/machinery/still/attackby(var/obj/item/weapon/W as obj, mob/user as mob)
if(istype(W,/obj/item/weapon/reagent_containers/food))
user.u_equip(W)
W.loc = src
input += W
else
..()
/obj/machinery/still/attack_hand(var/mob/user as mob)
for(var/obj/item/weapon/reagent_containers/food/F in output)
F.loc = src.loc
output -= F
// IV. The squeezer is intended to destroy inserted food items, but return some of the reagents they contain.
/obj/machinery/squeezer
var/list/obj/item/weapon/reagent_containers/food/input = list()
var/obj/item/weapon/reagent_containers/food/squeezed_item
var/water_level = 0
var/busy = 0
var/progress = 0
var/error = 0
name = "\improper Squeezer"
desc = "It is a machine that squeezes extracts from produce."
icon_state = "autolathe"
density = 1
anchored = 1
use_power = 1
idle_power_usage = 10
active_power_usage = 500
// V. The centrifuge spins inserted food items. It is intended to squeeze out the reagents that are common food catalysts (enzymes currently)
/obj/machinery/centrifuge
var/list/obj/item/weapon/reagent_containers/food/input = list()
var/list/obj/item/weapon/reagent_containers/food/output = list()
var/obj/item/weapon/reagent_containers/food/spinning_item
var/busy = 0
var/progress = 0
var/error = 0
var/enzymes = 0
var/water = 0
name = "\improper Centrifuge"
desc = "It is a machine that spins produce."
icon_state = "autolathe"
density = 1
anchored = 1
use_power = 1
idle_power_usage = 10
active_power_usage = 10000
/obj/machinery/centrifuge/process()
if(error)
return
if(!busy)
use_power = 1
if(input.len)
spinning_item = input[1]
input -= spinning_item
progress = 0
busy = 1
use_power = 2
return
progress++
if(progress < 10) //Edit this value to make milling faster or slower
return //Not done yet.
var/transfer_enzymes = spinning_item.reagents.get_reagent_amount("enzyme")
if(transfer_enzymes)
enzymes += transfer_enzymes
spinning_item.reagents.remove_reagent("enzyme",transfer_enzymes)
output += spinning_item
busy = 0
/obj/machinery/centrifuge/attackby(var/obj/item/weapon/W as obj, mob/user as mob)
if(istype(W,/obj/item/weapon/reagent_containers/food))
user.u_equip(W)
W.loc = src
input += W
else
..()
/obj/machinery/centrifuge/attack_hand(var/mob/user as mob)
for(var/obj/item/weapon/reagent_containers/food/F in output)
F.loc = src.loc
output -= F
while(enzymes >= 50)
enzymes -= 50
new/obj/item/weapon/reagent_containers/food/condiment/enzyme(src.loc)