Skip to content

Commit

Permalink
Merge pull request #4600 from MistakeNot4892/feature/divider
Browse files Browse the repository at this point in the history
Adding Doe's room dividers.
  • Loading branch information
out-of-phaze authored Dec 7, 2024
2 parents 8a7982e + 88d1e57 commit be1e02c
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
48 changes: 48 additions & 0 deletions code/game/objects/structures/divider.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/obj/structure/divider
name = "room divider"
desc = "A thin, somewhat flimsy folding room divider."
icon = 'icons/obj/structures/divider.dmi'
icon_state = ICON_STATE_WORLD + "-closed"
material = /decl/material/solid/organic/wood/bamboo
color = /decl/material/solid/organic/wood/bamboo::color
material_alteration = MAT_FLAG_ALTERATION_NAME | MAT_FLAG_ALTERATION_DESC | MAT_FLAG_ALTERATION_COLOR
var/extended = FALSE

/obj/structure/divider/extended
icon_state = ICON_STATE_WORLD
extended = TRUE

/obj/structure/divider/wood
material = /decl/material/solid/organic/wood/oak
color = /decl/material/solid/organic/wood/oak::color

/obj/structure/divider/extended/wood
material = /decl/material/solid/organic/wood/oak
color = /decl/material/solid/organic/wood/oak::color

/obj/structure/divider/attack_hand(mob/user)
if(user.check_intent(I_FLAG_HELP) && user.check_dexterity(DEXTERITY_SIMPLE_MACHINES, silent = TRUE))
extended = !extended
if(material.dooropen_noise)
playsound(loc, material.dooropen_noise, 50, 1)
update_divider()
visible_message(SPAN_NOTICE("\The [user] [extended ? "extends" : "collapses"] \the [src]."))
return TRUE
. = ..()

/obj/structure/divider/Initialize()
. = ..()
update_divider()

/obj/structure/divider/proc/update_divider()
anchored = extended
density = extended
opacity = extended || (material.opacity < 0.5)
update_icon()

/obj/structure/divider/on_update_icon()
. = ..()
if(extended)
icon_state = ICON_STATE_WORLD
else
icon_state = ICON_STATE_WORLD + "-closed"
5 changes: 5 additions & 0 deletions code/modules/crafting/stack_recipes/recipes_planks.dm
Original file line number Diff line number Diff line change
Expand Up @@ -222,3 +222,8 @@
/decl/stack_recipe/planks/furniture/gravemarker
result_type = /obj/item/gravemarker
difficulty = MAT_VALUE_NORMAL_DIY

/decl/stack_recipe/planks/furniture/divider
result_type = /obj/structure/divider
difficulty = MAT_VALUE_HARD_DIY

Binary file added icons/obj/structures/divider.dmi
Binary file not shown.
1 change: 1 addition & 0 deletions nebula.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1440,6 +1440,7 @@
#include "code\game\objects\structures\curtains.dm"
#include "code\game\objects\structures\defensive_barrier.dm"
#include "code\game\objects\structures\displaycase.dm"
#include "code\game\objects\structures\divider.dm"
#include "code\game\objects\structures\dogbed.dm"
#include "code\game\objects\structures\door_assembly.dm"
#include "code\game\objects\structures\double_sign.dm"
Expand Down

0 comments on commit be1e02c

Please sign in to comment.