mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 03:27:05 +01:00
Office Chair Overlapping Tweak + Slightly better layer logic for chairs (1 line lol) (#27844)
* Add Office Chair to the Armrest system, tiny refactor of armrest system.
* Implicit armrest null from DrSmail
Co-authored-by: Drsmail <60036448+Drsmail@users.noreply.github.com>
Signed-off-by: Tojo <32783144+Alecksohs@users.noreply.github.com>
* Update code/game/objects/structures/stool_bed_chair_nest/chairs.dm
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: Tojo <32783144+Alecksohs@users.noreply.github.com>
* Update code/game/objects/structures/stool_bed_chair_nest/chairs.dm
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: Tojo <32783144+Alecksohs@users.noreply.github.com>
* Update code/game/objects/structures/stool_bed_chair_nest/chairs.dm
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: Tojo <32783144+Alecksohs@users.noreply.github.com>
* Yeah so I impulsively ported the entirety of this system without knowing what it did
* Revert "Yeah so I impulsively ported the entirety of this system without knowing what it did"
This reverts commit d4edb72a3b.
---------
Signed-off-by: Tojo <32783144+Alecksohs@users.noreply.github.com>
Co-authored-by: Drsmail <60036448+Drsmail@users.noreply.github.com>
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
This commit is contained in:
@@ -21,6 +21,8 @@
|
||||
var/comfort = 0
|
||||
/// Used to handle rotation properly, should only be 1, 4, or 8
|
||||
var/possible_dirs = 4
|
||||
/// Will it set to the layer above the player or not? Use with Armrests.
|
||||
var/uses_armrest = FALSE
|
||||
|
||||
/obj/structure/chair/examine(mob/user)
|
||||
. = ..()
|
||||
@@ -111,7 +113,7 @@
|
||||
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)
|
||||
if(has_buckled_mobs() && dir == NORTH && !uses_armrest)
|
||||
layer = ABOVE_MOB_LAYER
|
||||
else
|
||||
layer = OBJ_LAYER
|
||||
@@ -247,6 +249,8 @@
|
||||
movable = TRUE
|
||||
item_chair = null
|
||||
buildstackamount = 5
|
||||
var/image/armrest
|
||||
uses_armrest = TRUE
|
||||
|
||||
/obj/structure/chair/comfy/shuttle
|
||||
name = "shuttle seat"
|
||||
@@ -278,6 +282,34 @@
|
||||
/obj/structure/chair/office/dark
|
||||
icon_state = "officechair_dark"
|
||||
|
||||
/obj/structure/chair/office/proc/get_armrest()
|
||||
return mutable_appearance('icons/obj/chairs.dmi', "[icon_state]_armrest")
|
||||
|
||||
/obj/structure/chair/office/Initialize(mapload)
|
||||
armrest = get_armrest()
|
||||
armrest.layer = ABOVE_MOB_LAYER
|
||||
return ..()
|
||||
|
||||
/obj/structure/chair/office/Destroy()
|
||||
QDEL_NULL(armrest)
|
||||
return ..()
|
||||
|
||||
/obj/structure/chair/office/post_buckle_mob(mob/living/M)
|
||||
. = ..()
|
||||
update_armrest()
|
||||
|
||||
/obj/structure/chair/office/post_unbuckle_mob(mob/living/M)
|
||||
. = ..()
|
||||
update_armrest()
|
||||
|
||||
/obj/structure/chair/office/proc/update_armrest()
|
||||
if(has_buckled_mobs())
|
||||
add_overlay(armrest)
|
||||
else
|
||||
cut_overlay(armrest)
|
||||
|
||||
|
||||
|
||||
/obj/structure/chair/barber
|
||||
icon_state = "barber_chair"
|
||||
buildstackamount = 1
|
||||
|
||||
Reference in New Issue
Block a user