mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-07-13 01:02:43 +01:00
Fixes/tweaks from testing bonfires and cooking.
This commit is contained in:
@@ -4,6 +4,10 @@
|
||||
desc = "yummy"
|
||||
icon = 'icons/obj/food.dmi'
|
||||
icon_state = null
|
||||
center_of_mass = list("x"=16, "y"=16)
|
||||
w_class = ITEMSIZE_SMALL
|
||||
force = 0
|
||||
|
||||
var/bitesize = 1
|
||||
var/bitecount = 0
|
||||
var/trash = null
|
||||
@@ -23,9 +27,18 @@
|
||||
var/package = FALSE // If this has a wrapper on it. If true, it will print a message and ask you to remove it
|
||||
var/package_trash // Packaged meals drop this trash type item when opened, if set
|
||||
var/package_open_state// Packaged meals switch to this state when opened, if set
|
||||
center_of_mass = list("x"=16, "y"=16)
|
||||
w_class = ITEMSIZE_SMALL
|
||||
force = 0
|
||||
|
||||
// Halfassed version of Crabs' cooking system on Cit, should
|
||||
// be folded into that if it is ported to Polaris.
|
||||
|
||||
/// What object type the food cooks into.
|
||||
var/backyard_grilling_product = /obj/item/reagent_containers/food/snacks/badrecipe
|
||||
/// How many SSobj ticks it takes for the food to cook.
|
||||
var/backyard_grilling_rawness = 30
|
||||
/// The message shown when the food cooks.
|
||||
var/backyard_grilling_announcement = "smokes and chars!"
|
||||
/// The span class used for the message above. Burned food defaults to SPAN_DANGER.
|
||||
var/backyard_grilling_span = "notice"
|
||||
|
||||
/obj/item/reagent_containers/food/snacks/Initialize()
|
||||
. = ..()
|
||||
@@ -57,47 +70,37 @@
|
||||
return "almost dried"
|
||||
return "dehydrated"
|
||||
|
||||
/obj/item/reagent_containers/food/snacks/dry_out(var/obj/rack, var/drying_power = 1, var/fire_exposed = FALSE, var/silent = FALSE)
|
||||
/obj/item/reagent_containers/food/snacks/proc/get_backyard_grilling_text(var/obj/rack)
|
||||
var/moistness = backyard_grilling_rawness / initial(backyard_grilling_rawness)
|
||||
if(moistness > 0.65)
|
||||
return "uncooked"
|
||||
if(moistness > 0.35)
|
||||
return "half-cooked"
|
||||
if(moistness)
|
||||
return "nearly cooked"
|
||||
return "cooked"
|
||||
|
||||
// If it's a direct fire, cook the food instead.
|
||||
if(fire_exposed)
|
||||
return grill(rack)
|
||||
/obj/item/reagent_containers/food/snacks/examine(mob/user)
|
||||
. = ..()
|
||||
if(backyard_grilling_rawness > 0 && backyard_grilling_rawness != initial(backyard_grilling_rawness))
|
||||
. += "\The [src] is [get_backyard_grilling_text()]."
|
||||
|
||||
// Otherwise, try to dry it out.
|
||||
if(!dried_type || dry)
|
||||
return null
|
||||
if(dried_type == type)
|
||||
/obj/item/reagent_containers/food/snacks/get_dried_product()
|
||||
if(dried_type == type && !dry)
|
||||
dry = TRUE
|
||||
name = "dried [name]"
|
||||
color = "#aaaaaa"
|
||||
if(rack && !silent)
|
||||
rack.visible_message(SPAN_NOTICE("\The [src] is dry!"))
|
||||
return src
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/item/reagent_containers/food/snacks
|
||||
|
||||
// Halfassed version of Crabs' cooking system on Cit, should
|
||||
// be folded into that if it is ported to Polaris.
|
||||
|
||||
/// How many SSobj ticks of cooking the food has experienced.
|
||||
var/backyard_grilling_progress = 0
|
||||
/// What object type the food cooks into.
|
||||
var/backyard_grilling_product = /obj/item/reagent_containers/food/snacks/badrecipe
|
||||
/// How many SSobj ticks it takes for the food to cook.
|
||||
var/backyard_grilling_threshold = 10
|
||||
/// The message shown when the food cooks.
|
||||
var/backyard_grilling_announcement = "smokes and chars!"
|
||||
/// The span class used for the message above. Burned food defaults to SPAN_DANGER.
|
||||
var/backyard_grilling_span = "notice"
|
||||
/obj/item/reagent_containers/food/snacks/dry_out(var/obj/rack, var/drying_power = 1, var/fire_exposed = FALSE, var/silent = FALSE)
|
||||
return fire_exposed ? grill(rack) : ..()
|
||||
|
||||
/obj/item/reagent_containers/food/snacks/proc/grill(var/atom/heat_source)
|
||||
if(!backyard_grilling_product || !backyard_grilling_threshold)
|
||||
if(!backyard_grilling_product || backyard_grilling_rawness <= 0)
|
||||
return null
|
||||
backyard_grilling_progress++
|
||||
if(backyard_grilling_progress >= backyard_grilling_threshold)
|
||||
backyard_grilling_progress = 0
|
||||
backyard_grilling_rawness--
|
||||
if(backyard_grilling_rawness <= 0)
|
||||
var/obj/item/food = new backyard_grilling_product
|
||||
food.dropInto(loc)
|
||||
if(backyard_grilling_announcement)
|
||||
@@ -916,7 +919,8 @@
|
||||
filling_color = "#FFDEFE"
|
||||
center_of_mass = list("x"=17, "y"=13)
|
||||
bitesize = 2
|
||||
drying_wetness = 20
|
||||
drying_wetness = 60
|
||||
|
||||
dried_type = /obj/item/reagent_containers/food/snacks/jerky/fish
|
||||
backyard_grilling_product = /obj/item/reagent_containers/food/snacks/grilledfish
|
||||
backyard_grilling_announcement = "steams gently."
|
||||
@@ -1033,7 +1037,7 @@
|
||||
bitesize = 6
|
||||
backyard_grilling_product = /obj/item/reagent_containers/food/snacks/xenomeat/spidermeat/charred
|
||||
backyard_grilling_announcement = "smokes as the poison burns away."
|
||||
drying_wetness = 20
|
||||
drying_wetness = 60
|
||||
dried_type = /obj/item/reagent_containers/food/snacks/jerky/spider/poison
|
||||
|
||||
/obj/item/reagent_containers/food/snacks/xenomeat/spidermeat/add_venom()
|
||||
@@ -1044,9 +1048,8 @@
|
||||
name = "charred spider meat"
|
||||
desc = "A slab of green meat with char lines. The poison has been burned out of it."
|
||||
color = COLOR_LIGHT_RED
|
||||
drying_wetness = null
|
||||
dried_type = null
|
||||
backyard_grilling_product = /obj/item/reagent_containers/food/snacks/badrecipe
|
||||
dried_product_takes_color = FALSE
|
||||
dried_type = /obj/item/reagent_containers/food/snacks/jerky/spider
|
||||
|
||||
/obj/item/reagent_containers/food/snacks/xenomeat/spidermeat/charred/add_venom()
|
||||
@@ -1094,9 +1097,9 @@
|
||||
|
||||
/obj/item/reagent_containers/food/snacks/donkpocket/grill(var/atom/heat_source)
|
||||
|
||||
backyard_grilling_progress++
|
||||
if(backyard_grilling_progress >= backyard_grilling_threshold)
|
||||
backyard_grilling_progress = 0
|
||||
backyard_grilling_rawness--
|
||||
if(backyard_grilling_rawness <= 0)
|
||||
backyard_grilling_rawness = initial(backyard_grilling_rawness)
|
||||
|
||||
// We're already warm, so we burn.
|
||||
if(warm)
|
||||
@@ -1696,9 +1699,10 @@
|
||||
center_of_mass = list("x"=16, "y"=12)
|
||||
bitesize = 2
|
||||
backyard_grilling_product = null
|
||||
backyard_grilling_rawness = 10
|
||||
|
||||
/obj/item/reagent_containers/food/snacks/badrecipe/grill(var/atom/heat_source)
|
||||
if(!backyard_grilling_progress) // Smoke on our first grill
|
||||
if(backyard_grilling_rawness <= 0) // Smoke on our first grill
|
||||
// Produce nasty smoke.
|
||||
var/datum/effect_system/smoke_spread/bad/burntfood/smoke = new /datum/effect_system/smoke_spread/bad/burntfood
|
||||
playsound(src, 'sound/effects/smoke.ogg', 20, 1)
|
||||
@@ -1709,8 +1713,8 @@
|
||||
var/obj/machinery/firealarm/FA = locate() in get_area(src)
|
||||
if(FA)
|
||||
FA.alarm()
|
||||
backyard_grilling_progress++
|
||||
if(backyard_grilling_progress >= backyard_grilling_threshold)
|
||||
backyard_grilling_rawness--
|
||||
if(backyard_grilling_rawness <= 0)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/reagent_containers/food/snacks/badrecipe/Initialize()
|
||||
@@ -8184,6 +8188,6 @@
|
||||
nutriment_desc = list("flaky grilled fish" = 5)
|
||||
|
||||
/obj/item/reagent_containers/food/snacks/grilledfish/sivian
|
||||
desc = "A lightly grilled fish fillet. This one is blue; it's probably an illegally fished native species."
|
||||
desc = "A lightly grilled fish fillet. This one is blue, so you can expect a visit from the Sif Department of Fisheries."
|
||||
icon_state = "grilledsiffish"
|
||||
nutriment_desc = list("flaky grilled fish" = 5, "a mild, musky aftertaste" = 1)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
health = 180
|
||||
filling_color = "#FF1C1C"
|
||||
center_of_mass = list("x"=16, "y"=14)
|
||||
drying_wetness = 20
|
||||
drying_wetness = 60
|
||||
dried_type = /obj/item/reagent_containers/food/snacks/jerky/meat
|
||||
|
||||
/obj/item/reagent_containers/food/snacks/meat/get_drying_state()
|
||||
@@ -46,7 +46,7 @@
|
||||
center_of_mass = list("x"=17, "y"=20)
|
||||
backyard_grilling_product = /obj/item/reagent_containers/food/snacks/cutlet
|
||||
backyard_grilling_announcement = "sizzles as it is grilled through."
|
||||
drying_wetness = 10
|
||||
drying_wetness = 30
|
||||
dried_type = /obj/item/reagent_containers/food/snacks/jerky/cutlet
|
||||
|
||||
/obj/item/reagent_containers/food/snacks/rawcutlet/Initialize()
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
slot_flags = SLOT_HOLSTER
|
||||
drop_sound = 'sound/items/drop/herb.ogg'
|
||||
pickup_sound = 'sound/items/pickup/herb.ogg'
|
||||
drying_wetness = 20
|
||||
drying_wetness = 45
|
||||
|
||||
var/plantname
|
||||
var/datum/seed/seed
|
||||
@@ -40,7 +40,7 @@
|
||||
name = "[seed.seed_name]"
|
||||
trash = seed.get_trash_type()
|
||||
backyard_grilling_product = seed.backyard_grilling_product
|
||||
backyard_grilling_threshold = seed.backyard_grilling_threshold
|
||||
backyard_grilling_rawness = seed.backyard_grilling_rawness
|
||||
backyard_grilling_announcement = seed.backyard_grilling_announcement
|
||||
|
||||
update_icon()
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
var/force_layer
|
||||
|
||||
// Backyard grilling vars. Not passed through genetics.
|
||||
var/backyard_grilling_threshold = 5
|
||||
var/backyard_grilling_rawness = 20
|
||||
var/backyard_grilling_product = /obj/item/reagent_containers/food/snacks/badrecipe
|
||||
var/backyard_grilling_announcement = "smokes and chars!"
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
destruction_desc = "splinters"
|
||||
sheet_singular_name = "plank"
|
||||
sheet_plural_name = "planks"
|
||||
var/drying_rack_type = /obj/structure/drying_rack/wood
|
||||
|
||||
/datum/material/wood/generate_recipes()
|
||||
..()
|
||||
@@ -42,7 +43,7 @@
|
||||
new /datum/stack_recipe("coilgun stock", /obj/item/coilgun_assembly, 5, pass_stack_color = TRUE, recycle_material = "[name]"),
|
||||
new /datum/stack_recipe("crude fishing rod", /obj/item/material/fishing_rod/built, 8, time = 10 SECONDS, pass_stack_color = TRUE, recycle_material = "[name]"),
|
||||
new /datum/stack_recipe("noticeboard", /obj/structure/noticeboard, 1, recycle_material = "[name]"),
|
||||
new /datum/stack_recipe("drying rack", /obj/structure/drying_rack, 3, one_per_turf = TRUE, time = 20, on_floor = TRUE, supplied_material = "[name]"),
|
||||
new /datum/stack_recipe("drying rack", drying_rack_type, 3, one_per_turf = TRUE, time = 20, on_floor = TRUE, supplied_material = "[name]"),
|
||||
new /datum/stack_recipe("roofing tile", /obj/item/stack/tile/roofing, 3, 4, 20, recycle_material = "[name]"),
|
||||
new /datum/stack_recipe("shovel", /obj/item/shovel/wood, 2, time = 10, on_floor = TRUE, supplied_material = "[name]")
|
||||
)
|
||||
@@ -52,6 +53,7 @@
|
||||
stack_type = /obj/item/stack/material/fuel/wood/sif
|
||||
icon_colour = "#0099cc" // Cyan-ish
|
||||
stack_origin_tech = list(TECH_MATERIAL = 2, TECH_BIO = 2) // Alien wood would presumably be more interesting to the analyzer.
|
||||
drying_rack_type = /obj/structure/drying_rack/sifwood
|
||||
|
||||
/datum/material/wood/sif/generate_recipes()
|
||||
..()
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
no_variants = FALSE
|
||||
max_amount = 20
|
||||
stacktype = "wetleather"
|
||||
drying_wetness = 30
|
||||
drying_wetness = 120
|
||||
dried_type = /obj/item/stack/material/leather
|
||||
|
||||
/obj/item/stack/wetleather/get_drying_state(var/obj/rack)
|
||||
|
||||
@@ -1,10 +1,20 @@
|
||||
/obj/structure/drying_rack
|
||||
name = "drying rack"
|
||||
desc = "A rack used to stretch leather out and hold it taut during the tanning process."
|
||||
desc = "A rack used to hold meat or vegetables for drying, or to stretch leather out and hold it taut during the tanning process."
|
||||
icon = 'icons/obj/drying_rack.dmi'
|
||||
icon_state = "rack"
|
||||
var/dismantle_product = /obj/item/stack/material/steel
|
||||
var/dismantle_amount = 3
|
||||
var/obj/item/drying
|
||||
|
||||
/obj/structure/drying_rack/wood
|
||||
icon_state = "rack_wooden"
|
||||
dismantle_product = /obj/item/stack/material/fuel/wood
|
||||
|
||||
/obj/structure/drying_rack/sifwood
|
||||
icon_state = "rack_wooden_sif"
|
||||
dismantle_product = /obj/item/stack/material/fuel/wood/sif
|
||||
|
||||
/obj/structure/drying_rack/Initialize()
|
||||
. = ..()
|
||||
START_PROCESSING(SSobj, src) // SSObj fires ~every 2s , starting from wetness 30 takes ~1m
|
||||
@@ -36,13 +46,28 @@
|
||||
if(drying_state)
|
||||
add_overlay(drying_state)
|
||||
|
||||
/obj/structure/drying_rack/attackby(var/obj/item/I, var/mob/user)
|
||||
if(istype(I) && I.is_dryable() && !istype(I, /obj/item/stack/material/fuel))
|
||||
if(user.unEquip(I))
|
||||
I.forceMove(src)
|
||||
drying = I
|
||||
/obj/structure/drying_rack/attackby(var/obj/item/W, var/mob/user)
|
||||
|
||||
if(W.is_wrench())
|
||||
playsound(src, W.usesound, 75, 1)
|
||||
visible_message(SPAN_NOTICE("\The [user] begins dismantling \the [src]."))
|
||||
if(do_after(user, 5 SECONDS * W.toolspeed))
|
||||
visible_message(SPAN_NOTICE("\The [user] dismantles \the [src]."))
|
||||
if(drying)
|
||||
drying.dropInto(loc)
|
||||
drying = null
|
||||
if(dismantle_product && dismantle_amount)
|
||||
new dismantle_product(loc, dismantle_amount)
|
||||
qdel(src)
|
||||
return TRUE
|
||||
|
||||
if(!drying && W.is_dryable() && !istype(W, /obj/item/stack/material/fuel))
|
||||
if(user.unEquip(W))
|
||||
W.forceMove(src)
|
||||
drying = W
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/structure/drying_rack/attack_hand(var/mob/user)
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
drop_sound = 'sound/items/drop/wooden.ogg'
|
||||
pickup_sound = 'sound/items/pickup/wooden.ogg'
|
||||
no_variants = FALSE
|
||||
drying_wetness = 50
|
||||
drying_wetness = 120
|
||||
dried_type = /obj/item/stack/material/fuel/wood/dried
|
||||
bonfire_fuel_time = 3 MINUTES
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
description_info = "Use inhand to craft things, or use a sharp and edged object on this to convert it into two wooden planks."
|
||||
drop_sound = 'sound/items/drop/wooden.ogg'
|
||||
pickup_sound = 'sound/items/pickup/wooden.ogg'
|
||||
drying_wetness = 80
|
||||
drying_wetness = 180
|
||||
dried_type = /obj/item/stack/material/fuel/log/dried
|
||||
bonfire_fuel_time = 4 MINUTES
|
||||
var/plank_type = /obj/item/stack/material/fuel/wood
|
||||
|
||||
Reference in New Issue
Block a user