Skip to content

Commit

Permalink
Can't Thatch This | Adds Thatch, coming from drying grass, to allow f…
Browse files Browse the repository at this point in the history
…or players to make thatch floors + Bonus fixes to primitive storage structures (#2112)

* Adds thatch as a result of drying grass, usable to make thatch patches

* Fixes a few bugs with what drops from primitive storage structures + decapitalizes their names

* weapon -> item_to_check

* Addresses more review comments

* Fixes it being able to move things you shouldn't be able to move with shelves

Co-authored-by: GoldenAlpharex <[email protected]>
  • Loading branch information
Steals-The-PRs and GoldenAlpharex authored Feb 26, 2024
1 parent 673f490 commit 40f4232
Show file tree
Hide file tree
Showing 8 changed files with 124 additions and 39 deletions.
2 changes: 2 additions & 0 deletions code/game/objects/structures/tables_racks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,8 @@
if(O.loc != src.loc)
step(O, get_dir(O, src))

return TRUE // NOVA EDIT - Ensuring that this proc works properly when used to check things

/obj/structure/rack/attackby(obj/item/W, mob/living/user, params)
var/list/modifiers = params2list(params)
if (W.tool_behaviour == TOOL_WRENCH && !(obj_flags & NO_DECONSTRUCTION) && LAZYACCESS(modifiers, RIGHT_CLICK))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ GLOBAL_LIST_INIT(skyrat_wood_recipes, list(
new/datum/stack_recipe("large wooden mortar", /obj/structure/large_mortar, 10, time = 3 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE, category = CAT_TOOLS),
new/datum/stack_recipe("wooden cutting board", /obj/item/cutting_board, 5, time = 2 SECONDS, check_density = FALSE, category = CAT_TOOLS),
new/datum/stack_recipe("wooden shelf", /obj/structure/rack/wooden, 2, time = 2 SECONDS, one_per_turf = TRUE, on_solid_ground = FALSE, category = CAT_STRUCTURE),
new/datum/stack_recipe("seed shelf", /obj/machinery/smartfridge/seedshelf, 10, time = 2 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE, category = CAT_STRUCTURE),
new/datum/stack_recipe("produce bin", /obj/machinery/smartfridge/producebin, 10, time = 2 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE, category = CAT_STRUCTURE),
new/datum/stack_recipe("produce display", /obj/machinery/smartfridge/producedisplay, 10, time = 2 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE, category = CAT_STRUCTURE),
new/datum/stack_recipe("ration shelf", /obj/machinery/smartfridge/rationshelf, 10, time = 2 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE, category = CAT_STRUCTURE),
new/datum/stack_recipe("seed shelf", /obj/machinery/smartfridge/seed_shelf, 10, time = 2 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE, category = CAT_STRUCTURE),
new/datum/stack_recipe("produce bin", /obj/machinery/smartfridge/produce_bin, 10, time = 2 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE, category = CAT_STRUCTURE),
new/datum/stack_recipe("produce display", /obj/machinery/smartfridge/produce_display, 10, time = 2 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE, category = CAT_STRUCTURE),
new/datum/stack_recipe("ration shelf", /obj/machinery/smartfridge/ration_shelf, 10, time = 2 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE, category = CAT_STRUCTURE),
new/datum/stack_recipe("storage barrel", /obj/structure/closet/crate/wooden/storage_barrel, 4, time = 2 SECONDS, one_per_turf = TRUE, on_solid_ground = FALSE, category = CAT_STRUCTURE),
new/datum/stack_recipe("worm barrel", /obj/structure/wormfarm, 5, time = 2 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE, category = CAT_TOOLS),
new/datum/stack_recipe("gutlunch trough", /obj/structure/ore_container/gutlunch_trough, 5, time = 2 SECONDS, one_per_turf = TRUE, on_solid_ground = TRUE, category = CAT_STRUCTURE),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

/obj/structure/rack/wooden/MouseDrop_T(obj/object, mob/user, params)
. = ..()
if(!.)
return

var/list/modifiers = params2list(params)
if(!LAZYACCESS(modifiers, ICON_X) || !LAZYACCESS(modifiers, ICON_Y))
return
Expand All @@ -20,7 +23,7 @@
user.balloon_alert_to_viewers("disassembling...")
if(!tool.use_tool(src, user, 2 SECONDS, volume = 100))
return
new /obj/item/stack/sheet/mineral/clay(drop_location(), 5)

deconstruct(TRUE)
return ITEM_INTERACT_SUCCESS

Expand All @@ -43,21 +46,22 @@
user.balloon_alert_to_viewers("disassembling...")
if(!tool.use_tool(src, user, 2 SECONDS, volume = 100))
return
new /obj/item/stack/sheet/mineral/clay(drop_location(), 5)

deconstruct(TRUE)
return ITEM_INTERACT_SUCCESS

/obj/structure/closet/crate/wooden/storage_barrel/deconstruct(disassembled = TRUE)
new /obj/item/stack/sheet/mineral/wood(drop_location(), 4)
return ..()

/obj/machinery/smartfridge/producebin
name = "Produce Bin"
desc = "A wooden hamper, used to hold plant products and try keep them safe from pests."
/obj/machinery/smartfridge/produce_bin
name = "produce bin"
desc = "A wooden hamper, used to hold plant products and try to keep them safe from pests."
icon_state = "producebin"
icon = 'modular_nova/modules/primitive_structures/icons/storage.dmi'
resistance_flags = FLAMMABLE
base_build_path = /obj/machinery/smartfridge/producebin
obj_flags = parent_type::obj_flags | NO_DECONSTRUCTION
base_build_path = /obj/machinery/smartfridge/produce_bin
base_icon_state = "produce"
use_power = NO_POWER_USE
light_power = 0
Expand All @@ -67,28 +71,36 @@
can_atmos_pass = ATMOS_PASS_YES
visible_contents = TRUE

/obj/machinery/smartfridge/producebin/accept_check(obj/item/weapon)
return (istype(weapon, /obj/item/food/grown))
/obj/machinery/smartfridge/produce_bin/accept_check(obj/item/item_to_check)
var/static/list/accepted_items = list(
/obj/item/food/grown,
/obj/item/grown,
/obj/item/graft,
)

return is_type_in_list(item_to_check, accepted_items)

/obj/machinery/smartfridge/producebin/structure_examine()
/obj/machinery/smartfridge/produce_bin/structure_examine()
. = span_info("The whole rack can be [EXAMINE_HINT("pried")] apart.")


/obj/machinery/smartfridge/producebin/crowbar_act(mob/living/user, obj/item/tool)
/obj/machinery/smartfridge/produce_bin/crowbar_act(mob/living/user, obj/item/tool)
user.balloon_alert_to_viewers("disassembling...")
if(!tool.use_tool(src, user, 2 SECONDS, volume = 100))
return

new /obj/item/stack/sheet/mineral/wood(drop_location(), 10)
deconstruct(TRUE)
return ITEM_INTERACT_SUCCESS

/obj/machinery/smartfridge/seedshelf
name = "Seedshelf"
desc = "A wooden shelf, used to hold seeds preventing them from germinating early."
/obj/machinery/smartfridge/seed_shelf
name = "seed shelf"
desc = "A wooden shelf, used to hold seeds, preventing them from germinating early."
icon_state = "seedshelf"
icon = 'modular_nova/modules/primitive_structures/icons/storage.dmi'
resistance_flags = FLAMMABLE
base_build_path = /obj/machinery/smartfridge/seedshelf
obj_flags = parent_type::obj_flags | NO_DECONSTRUCTION
base_build_path = /obj/machinery/smartfridge/seed_shelf
base_icon_state = "seed"
use_power = NO_POWER_USE
light_power = 0
Expand All @@ -98,27 +110,29 @@
can_atmos_pass = ATMOS_PASS_YES
visible_contents = TRUE

/obj/machinery/smartfridge/seedshelf/accept_check(obj/item/weapon)
return istype(weapon, /obj/item/seeds)
/obj/machinery/smartfridge/seed_shelf/accept_check(obj/item/item_to_check)
return istype(item_to_check, /obj/item/seeds)

/obj/machinery/smartfridge/seedshelf/structure_examine()
/obj/machinery/smartfridge/seed_shelf/structure_examine()
. = span_info("The whole rack can be [EXAMINE_HINT("pried")] apart.")

/obj/machinery/smartfridge/seedshelf/crowbar_act(mob/living/user, obj/item/tool)
/obj/machinery/smartfridge/seed_shelf/crowbar_act(mob/living/user, obj/item/tool)
user.balloon_alert_to_viewers("disassembling...")
if(!tool.use_tool(src, user, 2 SECONDS, volume = 100))
return

new /obj/item/stack/sheet/mineral/wood(drop_location(), 10)
deconstruct(TRUE)
return ITEM_INTERACT_SUCCESS

/obj/machinery/smartfridge/rationshelf
name = "Ration shelf"
desc = "A wooden shelf, used to store food... preferably preserved."
/obj/machinery/smartfridge/ration_shelf
name = "ration shelf"
desc = "A wooden shelf, used to store food... Preferably preserved."
icon_state = "rationshelf"
icon = 'modular_nova/modules/primitive_structures/icons/storage.dmi'
resistance_flags = FLAMMABLE
base_build_path = /obj/machinery/smartfridge/rationshelf
obj_flags = parent_type::obj_flags | NO_DECONSTRUCTION
base_build_path = /obj/machinery/smartfridge/ration_shelf
base_icon_state = "ration"
use_power = NO_POWER_USE
light_power = 0
Expand All @@ -128,27 +142,29 @@
can_atmos_pass = ATMOS_PASS_YES
visible_contents = TRUE

/obj/machinery/smartfridge/rationshelf/accept_check(obj/item/weapon)
return (IS_EDIBLE(weapon) || (istype(weapon,/obj/item/reagent_containers/cup/bowl) && length(weapon.reagents?.reagent_list)))
/obj/machinery/smartfridge/ration_shelf/accept_check(obj/item/item_to_check)
return (IS_EDIBLE(item_to_check) || (istype(item_to_check,/obj/item/reagent_containers/cup/bowl) && length(item_to_check.reagents?.reagent_list)))

/obj/machinery/smartfridge/rationshelf/structure_examine()
/obj/machinery/smartfridge/ration_shelf/structure_examine()
. = span_info("The whole rack can be [EXAMINE_HINT("pried")] apart.")

/obj/machinery/smartfridge/rationshelf/crowbar_act(mob/living/user, obj/item/tool)
/obj/machinery/smartfridge/ration_shelf/crowbar_act(mob/living/user, obj/item/tool)
user.balloon_alert_to_viewers("disassembling...")
if(!tool.use_tool(src, user, 2 SECONDS, volume = 100))
return

new /obj/item/stack/sheet/mineral/wood(drop_location(), 10)
deconstruct(TRUE)
return ITEM_INTERACT_SUCCESS

/obj/machinery/smartfridge/producedisplay
name = "Produce display"
/obj/machinery/smartfridge/produce_display
name = "produce display"
desc = "A wooden table with awning, used to display produce items."
icon_state = "producedisplay"
icon = 'modular_nova/modules/primitive_structures/icons/storage.dmi'
resistance_flags = FLAMMABLE
base_build_path = /obj/machinery/smartfridge/producedisplay
obj_flags = parent_type::obj_flags | NO_DECONSTRUCTION
base_build_path = /obj/machinery/smartfridge/produce_display
base_icon_state = "nonfood"
use_power = NO_POWER_USE
light_power = 0
Expand All @@ -158,16 +174,23 @@
can_atmos_pass = ATMOS_PASS_YES
visible_contents = TRUE

/obj/machinery/smartfridge/producedisplay/accept_check(obj/item/weapon)
return (istype(weapon, /obj/item/grown) || istype(weapon, /obj/item/bouquet) || istype(weapon, /obj/item/clothing/head/costume/garland))
/obj/machinery/smartfridge/produce_display/accept_check(obj/item/item_to_check)
var/static/list/accepted_items = list(
/obj/item/grown,
/obj/item/bouquet,
/obj/item/clothing/head/costume/garland,
)

/obj/machinery/smartfridge/producedisplay/structure_examine()
return is_type_in_list(item_to_check, accepted_items)

/obj/machinery/smartfridge/produce_display/structure_examine()
. = span_info("The whole rack can be [EXAMINE_HINT("pried")] apart.")

/obj/machinery/smartfridge/producedisplay/crowbar_act(mob/living/user, obj/item/tool)
/obj/machinery/smartfridge/produce_display/crowbar_act(mob/living/user, obj/item/tool)
user.balloon_alert_to_viewers("disassembling...")
if(!tool.use_tool(src, user, 2 SECONDS, volume = 100))
return

new /obj/item/stack/sheet/mineral/wood(drop_location(), 10)
deconstruct(TRUE)
return ITEM_INTERACT_SUCCESS
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,65 @@
baseturfs = /turf/open/openspace/icemoon
initial_gas_mix = "ICEMOON_ATMOS"
icon_state = "grass-255"
icon = 'modular_nova/modules/primitive_structures/icons/roofing.dmi'
smooth_icon = 'modular_nova/modules/primitive_structures/icons/roofing.dmi'
icon = 'modular_nova/modules/primitive_structures/icons/thatch.dmi'
smooth_icon = 'modular_nova/modules/primitive_structures/icons/thatch.dmi'


/turf/open/floor/grass/thatch
name = "thatch patch"
desc = "A collection of various dried greens, not so green anymore, that makes a passable floor material"
icon_state = "grass-255"
base_icon_state = "grass"
icon = 'modular_nova/modules/primitive_structures/icons/thatch.dmi'
damaged_dmi = 'icons/turf/damaged.dmi'
floor_tile = /obj/item/stack/tile/grass/thatch
bullet_bounce_sound = null
smoothing_flags = SMOOTH_BITMASK
smoothing_groups = SMOOTH_GROUP_TURF_OPEN + SMOOTH_GROUP_FLOOR_GRASS
canSmoothWith = SMOOTH_GROUP_FLOOR_GRASS + SMOOTH_GROUP_CLOSED_TURFS
layer = HIGH_TURF_LAYER
/// Icon used for smoothing
var/smooth_icon = 'modular_nova/modules/primitive_structures/icons/thatch.dmi'


/turf/open/floor/grass/thatch/Initialize(mapload)
. = ..()
if(smoothing_flags)
var/matrix/translation = new
translation.Translate(-9, -9)
transform = translation
icon = smooth_icon


/turf/open/floor/grass/thatch/broken_states()
return list("grass_damaged")


/turf/open/floor/grass/thatch/burnt_states()
return list("grass_damaged")


/obj/item/stack/tile/grass/thatch
name = "thatch tile"
singular_name = "thatch floor tile"
desc = "A patch of thatch like in those old-school barns."
icon_state = "tile_thatch"
inhand_icon_state = "tile-thatch"
icon = 'modular_nova/modules/primitive_structures/icons/thatch_obj.dmi'
lefthand_file = 'modular_nova/modules/primitive_structures/icons/tile_lefthand.dmi'
righthand_file = 'modular_nova/modules/primitive_structures/icons/tile_righthand.dmi'
resistance_flags = FLAMMABLE
turf_type = /turf/open/floor/grass/thatch
merge_type = /obj/item/stack/tile/grass/thatch


/obj/item/food/grown/grass/thatch
name = "thatch"
desc = "Yellow and dry."
icon = 'modular_nova/modules/primitive_structures/icons/thatch_obj.dmi'
icon_state = "thatch_clump"
stacktype = /obj/item/stack/tile/grass/thatch


/obj/item/food/grown/grass/make_dryable()
AddElement(/datum/element/dryable, /obj/item/food/grown/grass/thatch)
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 40f4232

Please sign in to comment.