From 41d48a4ab96d6b0de58d9186fb18019059a0a806 Mon Sep 17 00:00:00 2001 From: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com> Date: Sat, 24 Feb 2024 18:14:21 -0500 Subject: [PATCH] Can't Thatch This | Adds Thatch, coming from drying grass, to allow for players to make thatch floors + Bonus fixes to primitive storage structures (#1067) * 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 --- code/game/objects/structures/tables_racks.dm | 2 + .../items/stacks/sheets/sheet_types.dm | 8 +- .../code/storage_structures.dm | 89 +++++++++++------- .../code/totally_thatch_roof.dm | 64 ++++++++++++- .../icons/{roofing.dmi => thatch.dmi} | Bin .../primitive_structures/icons/thatch_obj.dmi | Bin 0 -> 643 bytes .../icons/tile_lefthand.dmi | Bin 0 -> 308 bytes .../icons/tile_righthand.dmi | Bin 0 -> 309 bytes 8 files changed, 124 insertions(+), 39 deletions(-) rename modular_nova/modules/primitive_structures/icons/{roofing.dmi => thatch.dmi} (100%) create mode 100644 modular_nova/modules/primitive_structures/icons/thatch_obj.dmi create mode 100644 modular_nova/modules/primitive_structures/icons/tile_lefthand.dmi create mode 100644 modular_nova/modules/primitive_structures/icons/tile_righthand.dmi diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index debd4d81bc3..f919b14ff2c 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -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)) diff --git a/modular_nova/master_files/code/game/objects/items/stacks/sheets/sheet_types.dm b/modular_nova/master_files/code/game/objects/items/stacks/sheets/sheet_types.dm index 19b97785f9d..babf0041f7c 100644 --- a/modular_nova/master_files/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/modular_nova/master_files/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -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), diff --git a/modular_nova/modules/primitive_structures/code/storage_structures.dm b/modular_nova/modules/primitive_structures/code/storage_structures.dm index ea4d9616108..4d33a3f387a 100644 --- a/modular_nova/modules/primitive_structures/code/storage_structures.dm +++ b/modular_nova/modules/primitive_structures/code/storage_structures.dm @@ -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 @@ -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 @@ -43,7 +46,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 @@ -51,13 +54,14 @@ 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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/modular_nova/modules/primitive_structures/code/totally_thatch_roof.dm b/modular_nova/modules/primitive_structures/code/totally_thatch_roof.dm index aa3b1883ce7..904df404489 100644 --- a/modular_nova/modules/primitive_structures/code/totally_thatch_roof.dm +++ b/modular_nova/modules/primitive_structures/code/totally_thatch_roof.dm @@ -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) diff --git a/modular_nova/modules/primitive_structures/icons/roofing.dmi b/modular_nova/modules/primitive_structures/icons/thatch.dmi similarity index 100% rename from modular_nova/modules/primitive_structures/icons/roofing.dmi rename to modular_nova/modules/primitive_structures/icons/thatch.dmi diff --git a/modular_nova/modules/primitive_structures/icons/thatch_obj.dmi b/modular_nova/modules/primitive_structures/icons/thatch_obj.dmi new file mode 100644 index 0000000000000000000000000000000000000000..e6d19554945b3de421cf74270aa02b6b6029b9ab GIT binary patch literal 643 zcmV-}0(||6P)`L_|eJMKm-tJ3BioD=RZIGcYhP zI5;>jFE3d>0MP&d00DGTPE!Ct=GbNc004`6R9JLGWpiV4X>fFDZ*Bkpc$`yKaB_9` z^iy#0_2eo`Eh^5;&r`5fFwryM;w;ZhDainGjE%TBGg33tGfE(w;*!LYR3KBSBr_*9 zz9b{DBsoKgi!&v&s2C_}$ia2qD(~Zd+~D_kTrM zvf54q(+e*vquC4gd>mK+uJQi@fBb(%Ro&FhZQCxI`mXDjF(J|u5i{GD2yt-L0xT>r z${excNooW{zW3{kjDn-k+(I>p(GDb9y8u=(qw0B{;@MpZ6AOh0GBR6PtQpx(8HF$pD>@F9zf-h0f4XFZW#8L*6xeINy4}3J((v9k z+r=s>Nba4#v=uA$K zU|rl0<`BRz)s5XpEr3%{`3+ag+yz`Mb2dsVuF+{Y=D@5}z^Zjal;e_+| BYheHY literal 0 HcmV?d00001 diff --git a/modular_nova/modules/primitive_structures/icons/tile_righthand.dmi b/modular_nova/modules/primitive_structures/icons/tile_righthand.dmi new file mode 100644 index 0000000000000000000000000000000000000000..3546b59d19ec73c2bd3adb5eef7992bc93441a06 GIT binary patch literal 309 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0J3?w7mbKU|e{s5m4*8>L*6xeIt+h)7H((u*o zW|OU-+<;PyB|(0{3=Yq3qyaevRUr{2E~&-IMVSR9nfZAP3>9;N!wQN@zkdlX`1tjS zmbb3fxija3H-s8oG=A_%=e&>RNrs}H-W?XkLB^Mjy%gp=nsj7Rh(hp66=U_#?JCL} zRVmdKI;Vst08M3U AKL7v# literal 0 HcmV?d00001