New benches, colourable sofas (#17985)

* new benches, colourable sofas, directional beds

* removes bench corners

* slight sprite tweak

* inverse corners!

* removes rotatable beds due to mob jank and bedsheets

* fixes that one freaking always wrong cyberiad sofa

* make things use the in-built spraycan menu
This commit is contained in:
S34N
2022-06-20 21:00:12 +01:00
committed by GitHub
parent 66901439b6
commit 10d0e2f230
7 changed files with 124 additions and 9 deletions
@@ -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),
@@ -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
*/
@@ -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)