Skip to content

Commit b302a8e

Browse files
Fixes/tweaks from testing bonfires and cooking.
1 parent e272246 commit b302a8e

File tree

13 files changed

+118
-82
lines changed

13 files changed

+118
-82
lines changed

code/game/objects/items_drying.dm

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
var/drying_threshold_temperature = 500
77
// If set to a type, drying this item will convert it to that type.
88
var/dried_type
9+
// Set if colour should be passed to dried product.
10+
var/dried_product_takes_color = TRUE
911

1012
/obj/item/proc/is_dryable()
1113
return drying_wetness > 0
@@ -20,17 +22,23 @@
2022

2123
// Returns null for no change, or an instance for a successful drying.
2224
/obj/item/proc/dry_out(var/obj/rack, var/drying_power = 1, var/fire_exposed = FALSE, var/silent = FALSE)
23-
if(!dried_type)
25+
26+
if(!dried_type || !is_dryable())
2427
return
28+
2529
if(drying_wetness > 0)
2630
drying_wetness -= drying_power
2731
if(drying_wetness > 0)
2832
return
33+
2934
var/obj/item/thing = get_dried_product()
30-
if(color)
35+
if(!thing)
36+
return
37+
38+
if(color && dried_product_takes_color)
3139
thing.color = color
32-
if(!silent && rack)
33-
rack.visible_message(SPAN_NOTICE("The [src] is dry!"))
40+
if(isturf(loc) && !silent)
41+
visible_message(SPAN_NOTICE("\The [src] [gender == PLURAL ? "are" : "is"] dry!"))
3442
if(thing != src)
3543
qdel(src)
3644
return thing

code/game/objects/structures/wood_fire.dm

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -202,19 +202,12 @@
202202
if(burning)
203203

204204
// Draw our actual fire icon.
205-
var/fire_state
206-
if(fuel_amount >= 10)
207-
fire_state = "[base_icon_state]_intense"
208-
else if(fuel_amount >= 5)
209-
fire_state = "[base_icon_state]_hot"
210-
else
211-
fire_state = "[base_icon_state]_warm"
212-
var/image/I = image(icon, fire_state)
205+
var/image/I = image(icon, ((fuel_amount >= 5) ? "[base_icon_state]_hot" : "[base_icon_state]_warm"))
213206
I.appearance_flags = RESET_COLOR | KEEP_APART
214207
add_overlay(I)
215208

216209
// If we're capable of burning buckled mobs (usually via a stake),
217-
// draw a second intense fire overlay and offset it to cover the mob.
210+
// draw an intense fire overlay and offset it to cover the mob.
218211
if(fire_is_burning_mobs())
219212
I = image(icon, "[base_icon_state]_intense")
220213
I.pixel_y = 13
@@ -274,14 +267,13 @@
274267
thing.dry_out(src, max(1, 3 - get_dist(thing, src)), on_top_of_fire)
275268

276269
// If we're cooking food, play a food cooking souond.
277-
if(grilling)
278-
if(grill_loop)
279-
if(locate(/obj/item/reagent_containers/food/snacks) in contents)
280-
if(!grill_loop.started)
281-
grill_loop.start(src)
282-
else
283-
if(grill_loop.started)
284-
grill_loop.stop(src)
270+
if(grill_loop)
271+
if(grilling)
272+
if(!grill_loop.started)
273+
grill_loop.start(src)
274+
else
275+
if(grill_loop.started)
276+
grill_loop.stop(src)
285277

286278
// If we're low enough, don't burn anything or put out
287279
// any significant heat, they need to refuel the fire.
@@ -386,4 +378,9 @@
386378

387379
/obj/structure/wood_fire/fireplace/stove/get_fuel_overlay(var/fuel_amount)
388380
. = ..()
389-
LAZYADD(., "[base_icon_state]_cover")
381+
if(!.)
382+
. = "[base_icon_state]_cover"
383+
else if(islist(.))
384+
. += "[base_icon_state]_cover"
385+
else
386+
. = list(., "[base_icon_state]_cover")

code/modules/food/food/snacks.dm

Lines changed: 48 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
desc = "yummy"
55
icon = 'icons/obj/food.dmi'
66
icon_state = null
7+
center_of_mass = list("x"=16, "y"=16)
8+
w_class = ITEMSIZE_SMALL
9+
force = 0
10+
711
var/bitesize = 1
812
var/bitecount = 0
913
var/trash = null
@@ -23,9 +27,18 @@
2327
var/package = FALSE // If this has a wrapper on it. If true, it will print a message and ask you to remove it
2428
var/package_trash // Packaged meals drop this trash type item when opened, if set
2529
var/package_open_state// Packaged meals switch to this state when opened, if set
26-
center_of_mass = list("x"=16, "y"=16)
27-
w_class = ITEMSIZE_SMALL
28-
force = 0
30+
31+
// Halfassed version of Crabs' cooking system on Cit, should
32+
// be folded into that if it is ported to Polaris.
33+
34+
/// What object type the food cooks into.
35+
var/backyard_grilling_product = /obj/item/reagent_containers/food/snacks/badrecipe
36+
/// How many SSobj ticks it takes for the food to cook.
37+
var/backyard_grilling_rawness = 30
38+
/// The message shown when the food cooks.
39+
var/backyard_grilling_announcement = "smokes and chars!"
40+
/// The span class used for the message above. Burned food defaults to SPAN_DANGER.
41+
var/backyard_grilling_span = "notice"
2942

3043
/obj/item/reagent_containers/food/snacks/Initialize()
3144
. = ..()
@@ -57,47 +70,37 @@
5770
return "almost dried"
5871
return "dehydrated"
5972

60-
/obj/item/reagent_containers/food/snacks/dry_out(var/obj/rack, var/drying_power = 1, var/fire_exposed = FALSE, var/silent = FALSE)
73+
/obj/item/reagent_containers/food/snacks/proc/get_backyard_grilling_text(var/obj/rack)
74+
var/moistness = backyard_grilling_rawness / initial(backyard_grilling_rawness)
75+
if(moistness > 0.65)
76+
return "uncooked"
77+
if(moistness > 0.35)
78+
return "half-cooked"
79+
if(moistness)
80+
return "nearly cooked"
81+
return "cooked"
6182

62-
// If it's a direct fire, cook the food instead.
63-
if(fire_exposed)
64-
return grill(rack)
83+
/obj/item/reagent_containers/food/snacks/examine(mob/user)
84+
. = ..()
85+
if(backyard_grilling_rawness > 0 && backyard_grilling_rawness != initial(backyard_grilling_rawness))
86+
. += "\The [src] is [get_backyard_grilling_text()]."
6587

66-
// Otherwise, try to dry it out.
67-
if(!dried_type || dry)
68-
return null
69-
if(dried_type == type)
88+
/obj/item/reagent_containers/food/snacks/get_dried_product()
89+
if(dried_type == type && !dry)
7090
dry = TRUE
7191
name = "dried [name]"
7292
color = "#aaaaaa"
73-
if(rack && !silent)
74-
rack.visible_message(SPAN_NOTICE("\The [src] is dry!"))
7593
return src
76-
7794
return ..()
7895

79-
/obj/item/reagent_containers/food/snacks
80-
81-
// Halfassed version of Crabs' cooking system on Cit, should
82-
// be folded into that if it is ported to Polaris.
83-
84-
/// How many SSobj ticks of cooking the food has experienced.
85-
var/backyard_grilling_progress = 0
86-
/// What object type the food cooks into.
87-
var/backyard_grilling_product = /obj/item/reagent_containers/food/snacks/badrecipe
88-
/// How many SSobj ticks it takes for the food to cook.
89-
var/backyard_grilling_threshold = 10
90-
/// The message shown when the food cooks.
91-
var/backyard_grilling_announcement = "smokes and chars!"
92-
/// The span class used for the message above. Burned food defaults to SPAN_DANGER.
93-
var/backyard_grilling_span = "notice"
96+
/obj/item/reagent_containers/food/snacks/dry_out(var/obj/rack, var/drying_power = 1, var/fire_exposed = FALSE, var/silent = FALSE)
97+
return fire_exposed ? grill(rack) : ..()
9498

9599
/obj/item/reagent_containers/food/snacks/proc/grill(var/atom/heat_source)
96-
if(!backyard_grilling_product || !backyard_grilling_threshold)
100+
if(!backyard_grilling_product || backyard_grilling_rawness <= 0)
97101
return null
98-
backyard_grilling_progress++
99-
if(backyard_grilling_progress >= backyard_grilling_threshold)
100-
backyard_grilling_progress = 0
102+
backyard_grilling_rawness--
103+
if(backyard_grilling_rawness <= 0)
101104
var/obj/item/food = new backyard_grilling_product
102105
food.dropInto(loc)
103106
if(backyard_grilling_announcement)
@@ -916,7 +919,8 @@
916919
filling_color = "#FFDEFE"
917920
center_of_mass = list("x"=17, "y"=13)
918921
bitesize = 2
919-
drying_wetness = 20
922+
drying_wetness = 60
923+
920924
dried_type = /obj/item/reagent_containers/food/snacks/jerky/fish
921925
backyard_grilling_product = /obj/item/reagent_containers/food/snacks/grilledfish
922926
backyard_grilling_announcement = "steams gently."
@@ -1033,7 +1037,7 @@
10331037
bitesize = 6
10341038
backyard_grilling_product = /obj/item/reagent_containers/food/snacks/xenomeat/spidermeat/charred
10351039
backyard_grilling_announcement = "smokes as the poison burns away."
1036-
drying_wetness = 20
1040+
drying_wetness = 60
10371041
dried_type = /obj/item/reagent_containers/food/snacks/jerky/spider/poison
10381042

10391043
/obj/item/reagent_containers/food/snacks/xenomeat/spidermeat/add_venom()
@@ -1044,9 +1048,8 @@
10441048
name = "charred spider meat"
10451049
desc = "A slab of green meat with char lines. The poison has been burned out of it."
10461050
color = COLOR_LIGHT_RED
1047-
drying_wetness = null
1048-
dried_type = null
10491051
backyard_grilling_product = /obj/item/reagent_containers/food/snacks/badrecipe
1052+
dried_product_takes_color = FALSE
10501053
dried_type = /obj/item/reagent_containers/food/snacks/jerky/spider
10511054

10521055
/obj/item/reagent_containers/food/snacks/xenomeat/spidermeat/charred/add_venom()
@@ -1094,9 +1097,9 @@
10941097

10951098
/obj/item/reagent_containers/food/snacks/donkpocket/grill(var/atom/heat_source)
10961099

1097-
backyard_grilling_progress++
1098-
if(backyard_grilling_progress >= backyard_grilling_threshold)
1099-
backyard_grilling_progress = 0
1100+
backyard_grilling_rawness--
1101+
if(backyard_grilling_rawness <= 0)
1102+
backyard_grilling_rawness = initial(backyard_grilling_rawness)
11001103

11011104
// We're already warm, so we burn.
11021105
if(warm)
@@ -1696,9 +1699,10 @@
16961699
center_of_mass = list("x"=16, "y"=12)
16971700
bitesize = 2
16981701
backyard_grilling_product = null
1702+
backyard_grilling_rawness = 10
16991703

17001704
/obj/item/reagent_containers/food/snacks/badrecipe/grill(var/atom/heat_source)
1701-
if(!backyard_grilling_progress) // Smoke on our first grill
1705+
if(backyard_grilling_rawness <= 0) // Smoke on our first grill
17021706
// Produce nasty smoke.
17031707
var/datum/effect_system/smoke_spread/bad/burntfood/smoke = new /datum/effect_system/smoke_spread/bad/burntfood
17041708
playsound(src, 'sound/effects/smoke.ogg', 20, 1)
@@ -1709,8 +1713,8 @@
17091713
var/obj/machinery/firealarm/FA = locate() in get_area(src)
17101714
if(FA)
17111715
FA.alarm()
1712-
backyard_grilling_progress++
1713-
if(backyard_grilling_progress >= backyard_grilling_threshold)
1716+
backyard_grilling_rawness--
1717+
if(backyard_grilling_rawness <= 0)
17141718
qdel(src)
17151719

17161720
/obj/item/reagent_containers/food/snacks/badrecipe/Initialize()
@@ -8184,6 +8188,6 @@
81848188
nutriment_desc = list("flaky grilled fish" = 5)
81858189

81868190
/obj/item/reagent_containers/food/snacks/grilledfish/sivian
8187-
desc = "A lightly grilled fish fillet. This one is blue; it's probably an illegally fished native species."
8191+
desc = "A lightly grilled fish fillet. This one is blue, so you can expect a visit from the Sif Department of Fisheries."
81888192
icon_state = "grilledsiffish"
81898193
nutriment_desc = list("flaky grilled fish" = 5, "a mild, musky aftertaste" = 1)

code/modules/food/food/snacks/meat.dm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
health = 180
66
filling_color = "#FF1C1C"
77
center_of_mass = list("x"=16, "y"=14)
8-
drying_wetness = 20
8+
drying_wetness = 60
99
dried_type = /obj/item/reagent_containers/food/snacks/jerky/meat
1010

1111
/obj/item/reagent_containers/food/snacks/meat/get_drying_state()
@@ -46,7 +46,7 @@
4646
center_of_mass = list("x"=17, "y"=20)
4747
backyard_grilling_product = /obj/item/reagent_containers/food/snacks/cutlet
4848
backyard_grilling_announcement = "sizzles as it is grilled through."
49-
drying_wetness = 10
49+
drying_wetness = 30
5050
dried_type = /obj/item/reagent_containers/food/snacks/jerky/cutlet
5151

5252
/obj/item/reagent_containers/food/snacks/rawcutlet/Initialize()

code/modules/hydroponics/grown.dm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
slot_flags = SLOT_HOLSTER
1010
drop_sound = 'sound/items/drop/herb.ogg'
1111
pickup_sound = 'sound/items/pickup/herb.ogg'
12-
drying_wetness = 20
12+
drying_wetness = 45
1313

1414
var/plantname
1515
var/datum/seed/seed
@@ -40,7 +40,7 @@
4040
name = "[seed.seed_name]"
4141
trash = seed.get_trash_type()
4242
backyard_grilling_product = seed.backyard_grilling_product
43-
backyard_grilling_threshold = seed.backyard_grilling_threshold
43+
backyard_grilling_rawness = seed.backyard_grilling_rawness
4444
backyard_grilling_announcement = seed.backyard_grilling_announcement
4545

4646
update_icon()

code/modules/hydroponics/seed.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
var/force_layer
2929

3030
// Backyard grilling vars. Not passed through genetics.
31-
var/backyard_grilling_threshold = 5
31+
var/backyard_grilling_rawness = 20
3232
var/backyard_grilling_product = /obj/item/reagent_containers/food/snacks/badrecipe
3333
var/backyard_grilling_announcement = "smokes and chars!"
3434

code/modules/materials/materials/organic/wood.dm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
destruction_desc = "splinters"
2121
sheet_singular_name = "plank"
2222
sheet_plural_name = "planks"
23+
var/drying_rack_type = /obj/structure/drying_rack/wood
2324

2425
/datum/material/wood/generate_recipes()
2526
..()
@@ -42,7 +43,7 @@
4243
new /datum/stack_recipe("coilgun stock", /obj/item/coilgun_assembly, 5, pass_stack_color = TRUE, recycle_material = "[name]"),
4344
new /datum/stack_recipe("crude fishing rod", /obj/item/material/fishing_rod/built, 8, time = 10 SECONDS, pass_stack_color = TRUE, recycle_material = "[name]"),
4445
new /datum/stack_recipe("noticeboard", /obj/structure/noticeboard, 1, recycle_material = "[name]"),
45-
new /datum/stack_recipe("drying rack", /obj/structure/drying_rack, 3, one_per_turf = TRUE, time = 20, on_floor = TRUE, supplied_material = "[name]"),
46+
new /datum/stack_recipe("drying rack", drying_rack_type, 3, one_per_turf = TRUE, time = 20, on_floor = TRUE, supplied_material = "[name]"),
4647
new /datum/stack_recipe("roofing tile", /obj/item/stack/tile/roofing, 3, 4, 20, recycle_material = "[name]"),
4748
new /datum/stack_recipe("shovel", /obj/item/shovel/wood, 2, time = 10, on_floor = TRUE, supplied_material = "[name]")
4849
)
@@ -52,6 +53,7 @@
5253
stack_type = /obj/item/stack/material/fuel/wood/sif
5354
icon_colour = "#0099cc" // Cyan-ish
5455
stack_origin_tech = list(TECH_MATERIAL = 2, TECH_BIO = 2) // Alien wood would presumably be more interesting to the analyzer.
56+
drying_rack_type = /obj/structure/drying_rack/sifwood
5557

5658
/datum/material/wood/sif/generate_recipes()
5759
..()

code/modules/materials/sheets/organic/tanning/leather_wet.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
no_variants = FALSE
1212
max_amount = 20
1313
stacktype = "wetleather"
14-
drying_wetness = 30
14+
drying_wetness = 120
1515
dried_type = /obj/item/stack/material/leather
1616

1717
/obj/item/stack/wetleather/get_drying_state(var/obj/rack)

0 commit comments

Comments
 (0)