diff --git a/_maps/map_files/cyberiad/cyberiad.dmm b/_maps/map_files/cyberiad/cyberiad.dmm index 4ceeafc579b..71a5dd8e0cd 100644 --- a/_maps/map_files/cyberiad/cyberiad.dmm +++ b/_maps/map_files/cyberiad/cyberiad.dmm @@ -18858,7 +18858,7 @@ /area/crew_quarters/dorms) "aTE" = ( /obj/structure/chair/sofa/corner{ - dir = 1 + dir = 4 }, /obj/structure/window/reinforced{ dir = 1; diff --git a/code/datums/mutable_appearance.dm b/code/datums/mutable_appearance.dm index 1904ab0ff81..038471ec365 100644 --- a/code/datums/mutable_appearance.dm +++ b/code/datums/mutable_appearance.dm @@ -10,7 +10,7 @@ // And yes this does have to be in the constructor, BYOND ignores it if you set it as a normal var // Helper similar to image() -/proc/mutable_appearance(icon, icon_state = "", layer = FLOAT_LAYER, plane = FLOAT_PLANE, alpha = 255, appearance_flags = NONE) +/proc/mutable_appearance(icon, icon_state = "", layer = FLOAT_LAYER, plane = FLOAT_PLANE, alpha = 255, appearance_flags = NONE, color) var/mutable_appearance/MA = new() MA.icon = icon MA.icon_state = icon_state @@ -18,6 +18,8 @@ MA.plane = plane MA.alpha = alpha MA.appearance_flags |= appearance_flags + if(color) + MA.color = color return MA /mutable_appearance/clean/New() diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm index 7f18521a615..ade5532b75f 100644 --- a/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -31,6 +31,11 @@ GLOBAL_LIST_INIT(metal_recipes, list( new /datum/stack_recipe("sofa (right)", /obj/structure/chair/sofa/corp/right, 1, one_per_turf = TRUE, on_floor = TRUE), \ new /datum/stack_recipe("sofa (corner)", /obj/structure/chair/sofa/corp/corner, 1, one_per_turf = TRUE, on_floor = TRUE), \ )), \ + new /datum/stack_recipe_list("benches", list( \ + new /datum/stack_recipe("bench (middle)", /obj/structure/chair/sofa/bench, 1, one_per_turf = TRUE, on_floor = TRUE), \ + new /datum/stack_recipe("bench (left)", /obj/structure/chair/sofa/bench/left, 1, one_per_turf = TRUE, on_floor = TRUE), \ + new /datum/stack_recipe("bench (right)", /obj/structure/chair/sofa/bench/right, 1, one_per_turf = TRUE, on_floor = TRUE), \ + )), \ new /datum/stack_recipe("barber chair", /obj/structure/chair/barber, one_per_turf = 1, on_floor = 1), new /datum/stack_recipe("wheelchair", /obj/structure/chair/wheelchair, 15, one_per_turf = 1, on_floor = 1), new /datum/stack_recipe("bed", /obj/structure/bed, 2, one_per_turf = 1, on_floor = 1), @@ -42,6 +47,7 @@ GLOBAL_LIST_INIT(metal_recipes, list( )), new /datum/stack_recipe_list("comfy chairs", list( + new /datum/stack_recipe("corporate comfy chair", /obj/structure/chair/comfy/corp, 2, one_per_turf = 1, on_floor = 1), new /datum/stack_recipe("beige comfy chair", /obj/structure/chair/comfy/beige, 2, one_per_turf = 1, on_floor = 1), new /datum/stack_recipe("black comfy chair", /obj/structure/chair/comfy/black, 2, one_per_turf = 1, on_floor = 1), new /datum/stack_recipe("brown comfy chair", /obj/structure/chair/comfy/brown, 2, one_per_turf = 1, on_floor = 1), @@ -188,10 +194,16 @@ GLOBAL_LIST_INIT(wood_recipes, list( new /datum/stack_recipe("wood table frame", /obj/structure/table_frame/wood, 2, time = 10), \ new /datum/stack_recipe("wooden chair", /obj/structure/chair/wood, 3, time = 10, one_per_turf = 1, on_floor = 1), new /datum/stack_recipe_list("pews", list( - new /datum/stack_recipe("pew (middle)", /obj/structure/chair/sofa/pew, 1, one_per_turf = TRUE, on_floor = TRUE), - new /datum/stack_recipe("pew (left)", /obj/structure/chair/sofa/pew/left, 1, one_per_turf = TRUE, on_floor = TRUE), - new /datum/stack_recipe("pew (right)", /obj/structure/chair/sofa/pew/right, 1, one_per_turf = TRUE, on_floor = TRUE), + new /datum/stack_recipe("pew (middle)", /obj/structure/chair/sofa/pew, 5, one_per_turf = TRUE, on_floor = TRUE), + new /datum/stack_recipe("pew (left)", /obj/structure/chair/sofa/pew/left, 5, one_per_turf = TRUE, on_floor = TRUE), + new /datum/stack_recipe("pew (right)", /obj/structure/chair/sofa/pew/right, 5, one_per_turf = TRUE, on_floor = TRUE), )), \ + new /datum/stack_recipe_list("bamboo benches", list( + new /datum/stack_recipe("bamboo bench (middle)", /obj/structure/chair/sofa/bamboo, 2, one_per_turf = TRUE, on_floor = TRUE), + new /datum/stack_recipe("bamboo bench (left)", /obj/structure/chair/sofa/bamboo/left, 2, one_per_turf = TRUE, on_floor = TRUE), + new /datum/stack_recipe("bamboo bench (right)", /obj/structure/chair/sofa/bamboo/right, 2, one_per_turf = TRUE, on_floor = TRUE), + )), \ + new /datum/stack_recipe("bamboo stool", /obj/structure/chair/stool/bamboo, 2, time = 10, one_per_turf = 1, on_floor = 1), new /datum/stack_recipe("wooden barricade", /obj/structure/barricade/wooden, 5, time = 50, one_per_turf = 1, on_floor = 1), new /datum/stack_recipe("bookcase", /obj/structure/bookcase, 5, time = 50, one_per_turf = 1, on_floor = 1), new /datum/stack_recipe("dresser", /obj/structure/dresser, 30, time = 50, one_per_turf = 1, on_floor = 1), diff --git a/code/game/objects/structures/stool_bed_chair_nest/bed.dm b/code/game/objects/structures/stool_bed_chair_nest/bed.dm index 5d1c2fbcf45..8346b6d0b88 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm @@ -14,6 +14,7 @@ desc = "This is used to lie in, sleep in or strap on." icon = 'icons/obj/objects.dmi' icon_state = "bed" + dir = SOUTH can_buckle = TRUE anchored = TRUE buckle_lying = TRUE @@ -61,7 +62,6 @@ new buildstacktype(loc, buildstackamount) ..() - /* * Roller beds */ diff --git a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm index c37d43c0a9e..459592e296c 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm @@ -18,6 +18,8 @@ var/movable = FALSE // For mobility checks var/propelled = FALSE // Check for fire-extinguisher-driven chairs var/comfort = 0 + /// Used to handle rotation properly, should only be 1, 4, or 8 + var/possible_dirs = 4 /obj/structure/chair/narsie_act() if(prob(20)) @@ -95,6 +97,9 @@ buckled_mob.setDir(direction) /obj/structure/chair/proc/handle_layer() + if(possible_dirs == 8) // We don't want chairs with corner dirs to sit over mobs, it is handled by armrests + layer = OBJ_LAYER + return if(has_buckled_mobs() && dir == NORTH) layer = ABOVE_MOB_LAYER else @@ -118,14 +123,14 @@ set src in oview(1) if(GLOB.configuration.general.ghost_interaction) - setDir(turn(dir, 90)) + setDir(turn(dir, (360 / possible_dirs))) //90 for 4 possible dirs, 45 for 8. handle_rotation() return if(usr.incapacitated()) return - setDir(turn(dir, 90)) + setDir(turn(dir, (360 / possible_dirs))) handle_rotation() /obj/structure/chair/AltClick(mob/user) @@ -171,13 +176,17 @@ item_chair = null var/image/armrest = null +/obj/structure/chair/comfy/corp + color = null + icon_state = "comfychair_corp" + /obj/structure/chair/comfy/Initialize(mapload) armrest = GetArmrest() armrest.layer = ABOVE_MOB_LAYER return ..() /obj/structure/chair/comfy/proc/GetArmrest() - return mutable_appearance('icons/obj/chairs.dmi', "comfychair_armrest") + return mutable_appearance('icons/obj/chairs.dmi', "[icon_state]_armrest") /obj/structure/chair/comfy/Destroy() QDEL_NULL(armrest) @@ -270,16 +279,34 @@ /obj/structure/chair/sofa name = "sofa" icon_state = "sofamiddle" + color = rgb(141,70,0) //this sprite and benches support coloring currently anchored = TRUE item_chair = null buildstackamount = 1 var/image/armrest = null + var/colorable = TRUE /obj/structure/chair/sofa/Initialize(mapload) armrest = GetArmrest() armrest.layer = ABOVE_MOB_LAYER return ..() +/obj/structure/chair/sofa/attacked_by(obj/item/I, mob/living/user) + . = ..() + if(!colorable) + return + if(istype(I, /obj/item/toy/crayon)) + var/obj/item/toy/crayon/C = I + var/new_color = C.colour + var/list/hsl = rgb2hsl(hex2num(copytext(new_color, 2, 4)), hex2num(copytext(new_color, 4, 6)), hex2num(copytext(new_color, 6, 8))) + hsl[3] = max(hsl[3], 0.4) + var/list/rgb = hsl2rgb(arglist(hsl)) + color = "#[num2hex(rgb[1], 2)][num2hex(rgb[2], 2)][num2hex(rgb[3], 2)]" + if(color) + cut_overlay(armrest) + armrest = GetArmrest() + update_armrest() + /obj/structure/chair/sofa/proc/GetArmrest() return mutable_appearance('icons/obj/chairs.dmi', "[icon_state]_armrest") @@ -309,11 +336,14 @@ /obj/structure/chair/sofa/corner icon_state = "sofacorner" + possible_dirs = 8 /obj/structure/chair/sofa/corp name = "sofa" desc = "Soft and cushy." icon_state = "corp_sofamiddle" + color = null + colorable = FALSE /obj/structure/chair/sofa/corp/left icon_state = "corp_sofaend_left" @@ -323,12 +353,15 @@ /obj/structure/chair/sofa/corp/corner icon_state = "corp_sofacorner" + possible_dirs = 8 /obj/structure/chair/sofa/pew name = "pew" desc = "Rigid and uncomfortable, perfect for keeping you awake and alert." icon_state = "pewmiddle" buildstacktype = /obj/item/stack/sheet/wood + color = null + colorable = FALSE /obj/structure/chair/sofa/pew/left icon_state = "pewend_left" @@ -336,6 +369,61 @@ /obj/structure/chair/sofa/pew/right icon_state = "pewend_right" +/obj/structure/chair/sofa/bench + name = "Bench" + desc = "You sit in this. Either by will or force." + icon_state = "bench_middle_mapping" + base_icon_state = "bench_middle" + ///icon for the cover seat + var/image/cover + ///cover seat color + var/cover_color = rgb(255,255,255) + color = null + colorable = FALSE + +/obj/structure/chair/sofa/bench/Initialize(mapload) + icon_state = base_icon_state //so the rainbow seats for mapper clarity are not in-game + GetCover() + return ..() + +/obj/structure/chair/sofa/bench/proc/GetCover() + if(cover) + cut_overlay(cover) + cover = mutable_appearance('icons/obj/chairs.dmi', "[icon_state]_cover", color = cover_color) //this supports colouring, but not the base bench + add_overlay(cover) + +/obj/structure/chair/sofa/bench/handle_layer() + return + +/obj/structure/chair/sofa/bench/attacked_by(obj/item/I, mob/living/user) + . = ..() + if(istype(I, /obj/item/toy/crayon)) + var/obj/item/toy/crayon/C = I + cover_color = C.colour + if(cover_color) + GetCover() + +/obj/structure/chair/sofa/bench/left + icon_state = "bench_left_mapping" + base_icon_state = "bench_left" + +/obj/structure/chair/sofa/bench/right + icon_state = "bench_right_mapping" + base_icon_state = "bench_right" + +/obj/structure/chair/sofa/bamboo + name = "Bamboo Bench" + desc = "Not the most comfortable, but vegan!" + icon_state = "bamboo_sofamiddle" + color = null + colorable = FALSE + +/obj/structure/chair/sofa/bamboo/left + icon_state = "bamboo_sofaend_left" + +/obj/structure/chair/sofa/bamboo/right + icon_state = "bamboo_sofaend_right" + /obj/structure/chair/stool name = "stool" desc = "Apply butt." @@ -349,6 +437,12 @@ icon_state = "bar" item_chair = /obj/item/chair/stool/bar +/obj/structure/chair/stool/bamboo + name = "bamboo stool" + desc = "Not the most comfortable, but vegan!" + icon_state = "bamboo_stool" + item_chair = /obj/item/chair/stool/bamboo + /obj/item/chair name = "chair" desc = "Bar brawl essential." @@ -388,6 +482,13 @@ item_state = "stool_bar" origin_type = /obj/structure/chair/stool/bar +/obj/item/chair/stool/bamboo + name = "bamboo stool" + desc = "Not the most comfortable, but vegan!" + item_state = "bamboo_stool" + icon_state = "bamboo_stool_toppled" + origin_type = /obj/structure/chair/stool/bamboo + /obj/item/chair/attack_self(mob/user) plant(user) diff --git a/icons/obj/chairs.dmi b/icons/obj/chairs.dmi index 7486f0e9859..59968a94abb 100644 Binary files a/icons/obj/chairs.dmi and b/icons/obj/chairs.dmi differ diff --git a/icons/obj/objects.dmi b/icons/obj/objects.dmi index 9eeb75e182b..f3a2cfb95da 100644 Binary files a/icons/obj/objects.dmi and b/icons/obj/objects.dmi differ