-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1dc9de3
commit db7bf91
Showing
14 changed files
with
123 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,64 @@ | ||
// Stubs/vars for use with the drying rack. | ||
/obj/item | ||
var/drying_threshold_temperature = 500 // Kelvin, checked in fire_act() | ||
var/dried_type // If set to a type, drying this item will convert it to that type. | ||
// 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 | ||
|
||
/obj/item/proc/is_dryable() | ||
return !isnull(dried_type) | ||
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) | ||
if(dried_type) | ||
. = new dried_type(loc) | ||
/obj/item/proc/dry_out(var/obj/rack, var/drying_power = 1, var/fire_exposed = FALSE, var/silent = FALSE) | ||
if(!dried_type) | ||
return | ||
if(drying_wetness > 0) | ||
drying_wetness -= drying_power | ||
if(drying_wetness > 0) | ||
return | ||
var/obj/item/thing = get_dried_product() | ||
if(color) | ||
thing.color = color | ||
if(!silent && rack) | ||
rack.visible_message(SPAN_NOTICE("The [src] 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) | ||
if(drying_wetness > 20) | ||
return "wet" | ||
if(drying_wetness > 10) | ||
return "damp" | ||
if(drying_wetness) | ||
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() | ||
dry_out(drying_power = rand(2, 4), fire_exposed = TRUE, silent = TRUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// TODO | ||
/obj/item/reagent_containers/food/snacks/fishjerky | ||
name = "dried fish" | ||
|
||
/obj/item/reagent_containers/food/snacks/fishjerky/get_drying_state() | ||
return "fish_dried" | ||
|
||
/obj/item/reagent_containers/food/snacks/meatjerky | ||
name = "dried meat" | ||
|
||
/obj/item/reagent_containers/food/snacks/meatjerky/get_drying_state() | ||
return "meat_dried" | ||
|
||
/obj/item/reagent_containers/food/snacks/meatjerky/cutlet/get_drying_state() | ||
return "meat_dried_small" | ||
|
||
/obj/item/reagent_containers/food/snacks/spiderjerky | ||
name = "dried spider meat" | ||
|
||
/obj/item/reagent_containers/food/snacks/spiderjerky/get_drying_state() | ||
return "meat_dried" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters