Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalizing drying racks and adding jerky. #9320

Merged
merged 7 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion code/__defines/color.dm
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
#define COLOR_DARK_TEAL "#2db5b5"
#define COLOR_LIGHT_VIOLET "#e7bfff"
#define COLOR_SAN_MARINO_BLUE "#4b75ab"
#define COLOR_FIRE_ORANGE "#ff9933"

#define PIPE_COLOR_GREY "#808080"
#define PIPE_COLOR_RED "#ff0000"
Expand Down Expand Up @@ -168,4 +169,4 @@
#define COLOR_WEBHOOK_DEFAULT 0x8bbbd5 // "#8bbbd5"
#define COLOR_WEBHOOK_GOOD 0x2ECC71 // "#2ECC71"
#define COLOR_WEBHOOK_POOR 0xE67E22 // "#E67E22"
#define COLOR_WEBHOOK_BAD 0xE74C3C // "#E74C3C"
#define COLOR_WEBHOOK_BAD 0xE74C3C // "#E74C3C"
2 changes: 1 addition & 1 deletion code/__defines/materials.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#define MAT_WOOD "wood"
#define MAT_LOG "log"
#define MAT_SIFWOOD "alien wood"
Spookerton marked this conversation as resolved.
Show resolved Hide resolved
#define MAT_SIFLOG "alien log"
#define MAT_SIFLOG "sifwood log"
#define MAT_STEELHULL "steel hull"
#define MAT_PLASTEEL "plasteel"
#define MAT_PLASTEELHULL "plasteel hull"
Expand Down
10 changes: 5 additions & 5 deletions code/datums/components/crafting/recipes/archery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/datum/crafting_recipe/shortbow
name = "Shortbow"
result = /obj/item/gun/launcher/crossbow/bow
reqs = list(list(/obj/item/stack/material/wood = 10),
reqs = list(list(/obj/item/stack/material/fuel/wood = 10),
list(/obj/item/stack/material/cloth = 5))
time = 120
category = CAT_WEAPONRY
Expand All @@ -14,7 +14,7 @@
/datum/crafting_recipe/arrow_sandstone
name = "Wood Arrow (Sandstone Tip)"
result = /obj/item/arrow/wood
reqs = list(list(/obj/item/stack/material/wood = 2),
reqs = list(list(/obj/item/stack/material/fuel/wood = 2),
list(/obj/item/stack/material/sandstone = 2))
time = 2 SECONDS
category = CAT_WEAPONRY
Expand All @@ -23,7 +23,7 @@
/datum/crafting_recipe/arrow_marble
name = "Wood Arrow (Marble Tip)"
result = /obj/item/arrow/wood
reqs = list(list(/obj/item/stack/material/wood = 2),
reqs = list(list(/obj/item/stack/material/fuel/wood = 2),
list(/obj/item/stack/material/marble = 2))
time = 2 SECONDS
category = CAT_WEAPONRY
Expand All @@ -32,7 +32,7 @@
/datum/crafting_recipe/arrow_chitin
name = "Wood Arrow (Chitin Tip)"
result = /obj/item/arrow/wood/chitin
reqs = list(list(/obj/item/stack/material/wood = 2),
reqs = list(list(/obj/item/stack/material/fuel/wood = 2),
list(/obj/item/stack/material/chitin = 2),
list(/obj/item/stack/material/cloth = 1))
time = 3 SECONDS
Expand Down Expand Up @@ -73,7 +73,7 @@
/datum/crafting_recipe/arrow_wood_material
name = "Wood Arrow (Crude Tip)"
result = /obj/item/material/arrow/crude
reqs = list(list(/obj/item/stack/material/wood = 2),
reqs = list(list(/obj/item/stack/material/fuel/wood = 2),
list(/obj/item/material/knife/machete/hatchet/stone = 1),
list(/obj/item/stack/material/cloth = 1))
parts = list(
Expand Down
17 changes: 16 additions & 1 deletion code/datums/looping_sounds/item_sounds.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,19 @@

/datum/looping_sound/small_motor/get_sound(starttime)
speed = clamp(speed, 1, 3)
return ..(starttime, mid_sounds[speed])
return ..(starttime, mid_sounds[speed])

// Fire crackles were originally sourced from freesound.org and cut
// up/faded in Audacity but I have lost the original source link. :(
/datum/looping_sound/fire_crackles
start_sound = 'sound/ambience/firecrackle01.ogg'
start_length = 10
mid_sounds = list(
'sound/ambience/firecrackle02.ogg',
'sound/ambience/firecrackle03.ogg',
'sound/ambience/firecrackle04.ogg',
'sound/ambience/firecrackle05.ogg'
)
mid_length = 10
end_sound = 'sound/ambience/firecrackle06.ogg'
volume = 10
2 changes: 1 addition & 1 deletion code/game/gamemodes/cult/cultify/obj.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
new /obj/structure/cult/pylon(loc)
..()

/obj/item/stack/material/wood/cultify()
/obj/item/stack/material/fuel/wood/cultify()
return

/obj/item/book/cultify()
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/wall_frames.dm
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
icon = 'icons/obj/stationobjs.dmi'
icon_state = "nboard00"
refund_amt = 4
refund_type = /obj/item/stack/material/wood
refund_type = /obj/item/stack/material/fuel/wood
build_machine_type = /obj/structure/noticeboard

/obj/item/frame/mirror
Expand Down
4 changes: 3 additions & 1 deletion code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,9 @@
size = "bulky"
if(ITEMSIZE_HUGE)
size = "huge"
return ..(user, "", "It is a [size] item.")
. = ..(user, "", "It is a [size] item.")
if(drying_wetness > 0 && drying_wetness != initial(drying_wetness))
. += "\The [src] is [get_dryness_text()]."

/obj/item/attack_hand(mob/living/user as mob)
if (!user) return
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/weapons/tools/weldingtool.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
usesound = 'sound/items/Welder2.ogg'
var/change_icons = TRUE
var/flame_intensity = 2 //how powerful the emitted light is when used.
var/flame_color = "#FF9933" // What color the welder light emits when its on. Default is an orange-ish color.
var/flame_color = COLOR_FIRE_ORANGE // What color the welder light emits when its on. Default is an orange-ish color.
var/eye_safety_modifier = 0 // Increasing this will make less eye protection needed to stop eye damage. IE at 1, sunglasses will fully protect.
var/burned_fuel_for = 0 // Keeps track of how long the welder's been on, used to gradually empty the welder if left one, without RNG.
var/always_process = FALSE // If true, keeps the welder on the process list even if it's off. Used for when it needs to regenerate fuel.
Expand Down
73 changes: 73 additions & 0 deletions code/game/objects/items_drying.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// Stubs/vars for use with the drying rack.
/obj/item
// Reduced when exposed to high temperatures or put on a drying rack. When hitting zero, the item transitions to a dried state.
var/drying_wetness
// Temperature threshold for fire_act() to dry the object, in degrees Kelvin.
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

/obj/item/proc/get_dried_product()
return new dried_type(loc)

/obj/item/stack/get_dried_product()
if(ispath(dried_type, /obj/item/stack))
return new dried_type(loc, amount)
return ..()

// 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 || !is_dryable())
return

if(drying_wetness > 0)
drying_wetness -= drying_power
if(drying_wetness > 0)
return

var/obj/item/thing = get_dried_product()
if(!thing)
return

if(color && dried_product_takes_color)
thing.color = color
if(isturf(loc) && !silent)
visible_message(SPAN_NOTICE("\The [src] [gender == PLURAL ? "are" : "is"] dry!"))
if(thing != src)
qdel(src)
return thing

// Returns a string used in drying rack examine().
/obj/item/proc/get_dryness_text(var/obj/rack)
var/moistness = drying_wetness / initial(drying_wetness)
if(moistness > 0.65)
return "wet"
if(moistness > 0.35)
return "damp"
if(moistness)
return "almost dry"
return "dry"

// Returns an icon_state used by drying rack update_icon().
/obj/item/proc/get_drying_overlay(var/obj/rack)
var/drying_state = get_drying_state(rack)
if(!drying_state || !color)
return drying_state
var/image/drying_overlay = image('icons/obj/drying_rack.dmi', drying_state)
drying_overlay.color = color
drying_overlay.appearance_flags |= KEEP_APART | RESET_COLOR
return drying_overlay

/obj/item/proc/get_drying_state(var/obj/rack)
return

/obj/item/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
..()
if(exposed_temperature >= drying_threshold_temperature)
dry_out(drying_power = rand(2, 4), fire_exposed = TRUE, silent = TRUE)
4 changes: 2 additions & 2 deletions code/game/objects/random/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,8 @@
/obj/item/stack/material/glass{amount = 10},
/obj/item/stack/material/glass/reinforced{amount = 10},
/obj/item/stack/material/plastic{amount = 10},
/obj/item/stack/material/wood{amount = 10},
/obj/item/stack/material/wood/sif{amount = 10},
/obj/item/stack/material/fuel/wood{amount = 10},
/obj/item/stack/material/fuel/wood/sif{amount = 10},
/obj/item/stack/material/cardboard{amount = 10},
/obj/item/stack/rods{amount = 10},
/obj/item/stack/material/sandstone{amount = 10},
Expand Down
Loading