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

Reworks Curtains #28163

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e25e9bc
Reworks Curtains
Alecksohs Jan 28, 2025
d61bdef
Update code/game/objects/structures/curtains.dm
Alecksohs Jan 28, 2025
a06f2c8
New Overlay Code
Alecksohs Jan 28, 2025
347998d
Merge branch 'master' into CurtainRework
Alecksohs Jan 28, 2025
e745761
Merge branch 'master' into CurtainRework
Alecksohs Jan 29, 2025
2e73856
Merge branch 'master' into CurtainRework
Alecksohs Feb 6, 2025
5a1686b
THE BEGINNING OF HELL
Alecksohs Feb 6, 2025
a0f56ee
Interact with Atom on mountable
Alecksohs Feb 6, 2025
4751b81
Fixes return, looks mergable.
Alecksohs Feb 6, 2025
f63e81c
Update code/game/objects/structures/curtains.dm
Alecksohs Feb 10, 2025
31e2821
Update code/game/objects/structures/curtains.dm
Alecksohs Feb 10, 2025
c18984d
Update code/game/objects/structures/curtains.dm
Alecksohs Feb 10, 2025
a72bf72
Update code/game/objects/structures/curtains.dm
Alecksohs Feb 10, 2025
ebad2d5
Update code/game/objects/structures/curtains.dm
Alecksohs Feb 10, 2025
d9ab1fc
Update code/game/objects/structures/curtains.dm
Alecksohs Feb 10, 2025
50cb7d2
Update code/game/objects/structures/curtains.dm
Alecksohs Feb 10, 2025
5c8e25e
Update code/game/objects/structures/curtains.dm
Alecksohs Feb 10, 2025
2789ba2
Update code/game/objects/structures/curtains.dm
Alecksohs Feb 10, 2025
d72503f
Update code/game/objects/structures/curtains.dm
Alecksohs Feb 10, 2025
12b0fce
Update code/game/objects/structures/curtains.dm
Alecksohs Feb 10, 2025
f702ff5
Update code/game/objects/structures/curtains.dm
Alecksohs Feb 10, 2025
96b7db6
Update code/game/objects/structures/curtains.dm
Alecksohs Feb 10, 2025
5d564bf
Update code/game/objects/structures/curtains.dm
Alecksohs Feb 10, 2025
51d3e84
Merge branch 'master' into CurtainRework
Alecksohs Feb 12, 2025
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
16 changes: 8 additions & 8 deletions code/game/objects/items/mountable_frames/mountables.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
/turf/simulated/wall
)
var/allow_floor_mounting = FALSE
new_attack_chain = TRUE


/obj/item/mounted/afterattack__legacy__attackchain(atom/A, mob/user, proximity_flag)
if(is_type_in_list(A, buildon_types))
if(try_build(A, user, proximity_flag))
return do_build(A, user)
/obj/item/mounted/interact_with_atom(atom/target, mob/living/user, list/modifiers)
. = ..()
if(is_type_in_list(target, buildon_types))
if(try_build(target, user))
do_build(target, user)
return ITEM_INTERACT_COMPLETE
..()

/obj/item/mounted/proc/try_build(turf/on_wall, mob/user, proximity_flag) //checks
/obj/item/mounted/proc/try_build(turf/on_wall, mob/user) //checks
if(!on_wall || !user)
return FALSE
if(!proximity_flag) //if we aren't next to the turf
return FALSE

if(!allow_floor_mounting)
if(!(get_dir(on_wall, user) in GLOB.cardinal))
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/items/stacks/rods.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ GLOBAL_LIST_INIT(rod_recipes, list (
new /datum/stack_recipe("grille", /obj/structure/grille, 2, time = 1 SECONDS, one_per_turf = TRUE, on_floor_or_lattice = TRUE),
new /datum/stack_recipe("table frame", /obj/structure/table_frame, 2, time = 1 SECONDS, one_per_turf = TRUE, on_floor = TRUE),
new /datum/stack_recipe("catwalk tile", /obj/item/stack/tile/catwalk, 2, 4, 20),
new /datum/stack_recipe("curtain rod", /obj/item/mounted/curtain/curtain_fixture, 2, 1, 20),
null,
new /datum/stack_recipe_list("railings...", list(
new /datum/stack_recipe("railing", /obj/structure/railing, 3, time = 1 SECONDS, one_per_turf = TRUE, on_floor = TRUE),
Expand Down
144 changes: 134 additions & 10 deletions code/game/objects/structures/curtains.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,122 @@
layer = SHOWER_CLOSED_LAYER
opacity = TRUE
density = FALSE
var/image/overlay = null
new_attack_chain = TRUE
var/assembled = FALSE
var/overlay_color = "#ffffff"
var/overlay_alpha = 255


/obj/structure/curtain/Initialize(mapload)
. = ..()
if(opacity)
icon_state = "closed"
overlay = image("closed_overlay")
overlay.color = overlay_color
overlay.alpha = overlay_alpha
add_overlay(overlay)
layer = SHOWER_CLOSED_LAYER
else
icon_state = "open"
overlay = image("open_overlay")
overlay.color = overlay_color
overlay.alpha = overlay_alpha
add_overlay(overlay)
layer = SHOWER_OPEN_LAYER

/obj/structure/curtain/open
icon_state = "open"
layer = SHOWER_OPEN_LAYER
opacity = FALSE

/obj/item/mounted/curtain/curtain_fixture
icon_state = "handheld"
icon = 'icons/obj/curtain.dmi'
name = "\improper curtain rod assembly"
new_attack_chain = TRUE

/obj/item/mounted/curtain/curtain_fixture/interact_with_atom(atom/target, mob/living/user, list/modifiers)
. = ..()
if(!istype(target,/obj/structure/window) && !istype(target,/turf/simulated/wall/))
return
var/on_wall = get_turf(target)
to_chat(user, "<span class='notice'>You begin attaching [src] to the [on_wall].</span>")
playsound(get_turf(src), 'sound/machines/click.ogg', 75, TRUE)
if(!do_after(user, 3 SECONDS, target = on_wall))
return
var/obj/structure/curtain/assembly/new_curtain = new /obj/structure/curtain/assembly(on_wall)
new_curtain.fingerprints = src.fingerprints
new_curtain.fingerprintshidden = src.fingerprintshidden
new_curtain.fingerprintslast = src.fingerprintslast

user.visible_message("<span class='notice'>[user] attaches the [src] to the [on_wall].</span>", \
"<span class='notice'>You attach the [src] to the [on_wall].</span>")
qdel(src)

/obj/item/mounted/curtain/curtain_fixture/activate_self(mob/user)
. = ..()
to_chat(user, "<span class='notice'>You begin attaching [src] to the ceiling.</span>")
playsound(get_turf(src), 'sound/machines/click.ogg', 75, TRUE)
if(!do_after(user, 3 SECONDS, target = get_turf(user)))
return
var/obj/structure/curtain/assembly/new_curtain = new /obj/structure/curtain/assembly(get_turf(user))
new_curtain.fingerprints = src.fingerprints
new_curtain.fingerprintshidden = src.fingerprintshidden
new_curtain.fingerprintslast = src.fingerprintslast

user.visible_message("<span class='notice'>[user] attaches the [src] to the ceiling.</span>", \
"<span class='notice'>You attach the [src] to the ceiling.</span>")
qdel(src)


Alecksohs marked this conversation as resolved.
Show resolved Hide resolved

/obj/structure/curtain/assembly
icon_state = "assembly0"
name = "Curtain Rod"
opacity = FALSE
density = FALSE
desc = "A curtain assembly! It needs a <b>material</b>."

/obj/structure/curtain/assembly/examine(mob/user)
. = ..()
. += "<span class='notice'>Alt-Click to take it down.</span>"

/obj/structure/curtain/assembly/AltClick(mob/user)
if(user.incapacitated())
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return
if(!Adjacent(user))
return
// TODO: turn back into assembly item
new /obj/item/mounted/curtain/curtain_fixture(get_turf(user))
playsound(loc, 'sound/effects/salute.ogg' , 75, TRUE)
qdel(src)

/obj/structure/curtain/assembly/item_interaction(mob/living/user, obj/item/used, list/modifiers)
if(istype(used, /obj/item/stack/sheet/cloth)) // Are we putting the cloth onto the assembly on the wall?
var/obj/item/stack/sheet/cloth/cloth_used = used
if(!cloth_used.use(2))
to_chat(user, "<span class='warning'> You need two sheets of cloth to hang the curtains.</span>")
return ITEM_INTERACT_COMPLETE

var/obj/structure/curtain/new_curtain = new /obj/structure/curtain/(loc, 1)
new_curtain.assembled = TRUE
playsound(loc, used.drop_sound, 75, TRUE) // Play a generic cloth sound.
qdel(src)

return ITEM_INTERACT_COMPLETE

/obj/structure/curtain/attack_hand(mob/user)
playsound(get_turf(loc), "rustle", 15, TRUE, -5)
toggle()
..()
/obj/structure/curtain/attack_robot(mob/living/user)
. = ..()
playsound(get_turf(loc), "rustle", 15, TRUE, -5)
toggle()
..()
Alecksohs marked this conversation as resolved.
Show resolved Hide resolved


/obj/structure/curtain/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
switch(damage_type)
Expand All @@ -33,11 +138,20 @@

/obj/structure/curtain/proc/toggle()
set_opacity(!opacity)
cut_overlays()
if(opacity)
icon_state = "closed"
overlay = image("closed_overlay")
overlay.color = overlay_color
overlay.alpha = overlay_alpha
add_overlay(overlay)
layer = SHOWER_CLOSED_LAYER
else
icon_state = "open"
overlay = image("open_overlay")
overlay.color = overlay_color
overlay.alpha = overlay_alpha
add_overlay(overlay)
layer = SHOWER_OPEN_LAYER

/obj/structure/curtain/item_interaction(mob/living/user, obj/item/used, list/modifiers)
Expand Down Expand Up @@ -68,39 +182,49 @@
. = TRUE
if(!I.tool_start_check(src, user, 0))
return
if(assembled)
WIRECUTTER_ATTEMPT_DISMANTLE_MESSAGE
if(I.use_tool(src,user, 5 SECONDS, volume = I.tool_volume))
WIRECUTTER_DISMANTLE_SUCCESS_MESSAGE
var/obj/structure/curtain/assembly/new_assembly = new /obj/structure/curtain/assembly(loc, 1)
new_assembly.assembled = TRUE
var/obj/item/stack/sheet/cloth/dropped_cloth = new /obj/item/stack/sheet/cloth(loc, 2)
qdel(src)
return
return

WIRECUTTER_ATTEMPT_DISMANTLE_MESSAGE
if(I.use_tool(src, user, 50, volume = I.tool_volume))
if(I.use_tool(src, user, 5 SECONDS, volume = I.tool_volume))
WIRECUTTER_DISMANTLE_SUCCESS_MESSAGE
deconstruct()

/obj/structure/curtain/deconstruct(disassembled = TRUE)
new /obj/item/stack/sheet/cloth(loc, 2)
new /obj/item/stack/sheet/plastic(loc, 2)
new /obj/item/stack/rods(loc, 1)
qdel(src)

/obj/structure/curtain/black
name = "black curtain"
color = "#222222"
overlay_color = "#222222"

/obj/structure/curtain/medical
name = "plastic curtain"
color = "#B8F5E3"
alpha = 200
overlay_color = "#B8F5E3"
overlay_alpha = 200

/obj/structure/curtain/open/shower
name = "shower curtain"
color = "#ACD1E9"
alpha = 200
overlay_color = "#7aa6c4"
overlay_alpha = 200

/obj/structure/curtain/open/shower/engineering
color = "#FFA500"
overlay_color = "#FFA500"

/obj/structure/curtain/open/shower/security
color = "#AA0000"
overlay_color = "#AA0000"

/obj/structure/curtain/open/shower/centcom
color = "#000066"
overlay_color = "#000066"

#undef SHOWER_OPEN_LAYER
#undef SHOWER_CLOSED_LAYER
9 changes: 0 additions & 9 deletions code/modules/crafting/recipes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -689,15 +689,6 @@
/obj/item/stack/sheet/mineral/gold = 1)
category = CAT_MISC

/datum/crafting_recipe/showercurtain
name = "Shower Curtains"
result = list(/obj/structure/curtain)
time = 20
reqs = list(/obj/item/stack/sheet/cloth = 2,
/obj/item/stack/sheet/plastic = 2,
/obj/item/stack/rods = 1)
category = CAT_MISC

/datum/crafting_recipe/chemical_payload
name = "Chemical Payload (C4)"
result = list(/obj/item/bombcore/chemical)
Expand Down
Binary file modified icons/obj/curtain.dmi
Binary file not shown.
Loading