mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-07-20 20:52:52 +01:00
Adding dried meat.
This commit is contained in:
@@ -11,42 +11,20 @@
|
||||
no_variants = FALSE
|
||||
max_amount = 20
|
||||
stacktype = "wetleather"
|
||||
var/wetness = 30 //Reduced when exposed to high temperautres
|
||||
|
||||
/obj/item/stack/wetleather/is_dryable()
|
||||
return wetness > 0
|
||||
drying_wetness = 30
|
||||
dried_type = /obj/item/stack/material/leather
|
||||
|
||||
/obj/item/stack/wetleather/get_drying_state(var/obj/rack)
|
||||
if(wetness)
|
||||
return "leather_wet"
|
||||
return "leather_dry"
|
||||
return (drying_wetness > 0 ? "leather_wet" : "leather_dry")
|
||||
|
||||
/obj/item/stack/wetleather/examine(var/mob/user)
|
||||
. = ..()
|
||||
. += description_info
|
||||
. += "\The [src] is [get_dryness_text()]."
|
||||
|
||||
/obj/item/stack/wetleather/get_dryness_text(var/obj/rack)
|
||||
if(wetness > 20)
|
||||
return "wet"
|
||||
if(wetness > 10)
|
||||
return "damp"
|
||||
if(wetness)
|
||||
return "almost dry"
|
||||
return ..()
|
||||
|
||||
/obj/item/stack/wetleather/transfer_to(obj/item/stack/S, var/tamount=null, var/type_verified)
|
||||
. = ..()
|
||||
if(.) // If it transfers any, do a weighted average of the wetness
|
||||
var/obj/item/stack/wetleather/W = S
|
||||
var/oldamt = W.amount - .
|
||||
W.wetness = round(((oldamt * W.wetness) + (. * wetness)) / W.amount)
|
||||
|
||||
/obj/item/stack/wetleather/dry_out(var/obj/rack, var/drying_power = 1)
|
||||
if(wetness <= 0)
|
||||
return null
|
||||
wetness -= drying_power
|
||||
if(wetness <= 0)
|
||||
. = new /obj/item/stack/material/leather(loc, amount)
|
||||
rack?.visible_message(SPAN_NOTICE("The [src] is dry!"))
|
||||
qdel(src)
|
||||
W.drying_wetness = round(((oldamt * W.drying_wetness) + (. * drying_wetness)) / W.amount)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/obj/structure/drying_rack
|
||||
name = "drying rack"
|
||||
desc = "A rack used to stretch leather out and hold it taut during the tanning process."
|
||||
icon = 'icons/obj/kitchen.dmi'
|
||||
icon_state = "spike"
|
||||
icon = 'icons/obj/drying_rack.dmi'
|
||||
icon_state = "rack"
|
||||
var/obj/item/drying
|
||||
|
||||
/obj/structure/drying_rack/Initialize()
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
/obj/structure/drying_rack/update_icon()
|
||||
cut_overlays()
|
||||
var/drying_state = drying?.get_drying_state(src)
|
||||
var/drying_state = drying?.get_drying_overlay(src)
|
||||
if(drying_state)
|
||||
add_overlay(drying_state)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user