Fixes/tweaks from testing bonfires and cooking.

This commit is contained in:
MistakeNot4892
2024-01-18 23:03:39 +11:00
parent e272246877
commit 8bb0fbcd1a
13 changed files with 122 additions and 84 deletions
+12 -4
View File
@@ -6,6 +6,8 @@
var/drying_threshold_temperature = 500
// If set to a type, drying this item will convert it to that type.
var/dried_type
// Set if colour should be passed to dried product.
var/dried_product_takes_color = TRUE
/obj/item/proc/is_dryable()
return drying_wetness > 0
@@ -20,17 +22,23 @@
// Returns null for no change, or an instance for a successful drying.
/obj/item/proc/dry_out(var/obj/rack, var/drying_power = 1, var/fire_exposed = FALSE, var/silent = FALSE)
if(!dried_type)
if(!dried_type || !is_dryable())
return
if(drying_wetness > 0)
drying_wetness -= drying_power
if(drying_wetness > 0)
return
var/obj/item/thing = get_dried_product()
if(color)
if(!thing)
return
if(color && dried_product_takes_color)
thing.color = color
if(!silent && rack)
rack.visible_message(SPAN_NOTICE("The [src] is dry!"))
if(isturf(loc) && !silent)
visible_message(SPAN_NOTICE("\The [src] [gender == PLURAL ? "are" : "is"] dry!"))
if(thing != src)
qdel(src)
return thing
+19 -20
View File
@@ -27,9 +27,11 @@
return ..()
/obj/structure/wood_fire/proc/get_upgrade_options()
if(grill || can_buckle)
return null
if(!grill)
LAZYADD(., "Grill")
else if(!can_buckle)
if(!can_buckle)
LAZYADD(., "Stake")
/obj/structure/wood_fire/proc/try_build_feature(var/mob/user, var/obj/item/stack/rods/rods)
@@ -202,19 +204,12 @@
if(burning)
// Draw our actual fire icon.
var/fire_state
if(fuel_amount >= 10)
fire_state = "[base_icon_state]_intense"
else if(fuel_amount >= 5)
fire_state = "[base_icon_state]_hot"
else
fire_state = "[base_icon_state]_warm"
var/image/I = image(icon, fire_state)
var/image/I = image(icon, ((fuel_amount >= 5) ? "[base_icon_state]_hot" : "[base_icon_state]_warm"))
I.appearance_flags = RESET_COLOR | KEEP_APART
add_overlay(I)
// If we're capable of burning buckled mobs (usually via a stake),
// draw a second intense fire overlay and offset it to cover the mob.
// draw an intense fire overlay and offset it to cover the mob.
if(fire_is_burning_mobs())
I = image(icon, "[base_icon_state]_intense")
I.pixel_y = 13
@@ -263,7 +258,7 @@
// See if we can dry out anything around us, or cook any food.
var/grilling = FALSE
for(var/obj/item/thing in view(2, src))
for(var/obj/item/thing in view(1, src))
var/on_top_of_fire = thing.loc == loc
if(on_top_of_fire)
if(!grilling && istype(thing, /obj/item/reagent_containers/food/snacks))
@@ -274,14 +269,13 @@
thing.dry_out(src, max(1, 3 - get_dist(thing, src)), on_top_of_fire)
// If we're cooking food, play a food cooking souond.
if(grilling)
if(grill_loop)
if(locate(/obj/item/reagent_containers/food/snacks) in contents)
if(!grill_loop.started)
grill_loop.start(src)
else
if(grill_loop.started)
grill_loop.stop(src)
if(grill_loop)
if(grilling)
if(!grill_loop.started)
grill_loop.start(src)
else
if(grill_loop.started)
grill_loop.stop(src)
// If we're low enough, don't burn anything or put out
// any significant heat, they need to refuel the fire.
@@ -386,4 +380,9 @@
/obj/structure/wood_fire/fireplace/stove/get_fuel_overlay(var/fuel_amount)
. = ..()
LAZYADD(., "[base_icon_state]_cover")
if(!.)
. = "[base_icon_state]_cover"
else if(islist(.))
. += "[base_icon_state]_cover"
else
. = list(., "[base_icon_state]_cover")