From f7e49c5883f1a4782b5abbff0eb4319c7a12f519 Mon Sep 17 00:00:00 2001 From: Penelope Haze Date: Sat, 2 Sep 2023 09:25:42 -0500 Subject: [PATCH] Port benches from Polaris Fix table stepping check Fix placing items on tables --- code/game/objects/structures/benches.dm | 50 ++++++++++++++++++++++++ code/game/objects/structures/tables.dm | 11 +++++- icons/obj/bench.dmi | Bin 0 -> 7749 bytes nebula.dme | 1 + 4 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 code/game/objects/structures/benches.dm create mode 100644 icons/obj/bench.dmi diff --git a/code/game/objects/structures/benches.dm b/code/game/objects/structures/benches.dm new file mode 100644 index 00000000000..a47875bdc83 --- /dev/null +++ b/code/game/objects/structures/benches.dm @@ -0,0 +1,50 @@ +/obj/structure/table/bench + name = "bench frame" + icon = 'icons/obj/bench.dmi' + icon_state = "solid_preview" + desc = "It's a bench, for putting things on. Or standing on, if you really want to." + top_surface_noun = "seat" + can_flip = FALSE + can_place_items = FALSE + density = FALSE + mob_offset = 0 + +/obj/structure/table/bench/reinforce_table() + return FALSE + +/obj/structure/table/bench/update_material_name(override_name) + if(reinf_material) + name = "[reinf_material.solid_name] bench" + else if(material) + name = "[material.solid_name] bench frame" + else + name = "bench frame" + +/obj/structure/table/bench/CanPass(atom/movable/mover) + return TRUE + +/obj/structure/table/bench/frame + icon_state = "frame" + reinf_material = null + +/obj/structure/table/bench/steel + icon_state = "solid_preview" + color = COLOR_GRAY40 + reinf_material = /decl/material/solid/metal/steel + +/obj/structure/table/bench/wooden + icon_state = "solid_preview" + color = WOOD_COLOR_GENERIC + material = /decl/material/solid/wood + reinf_material = /decl/material/solid/wood + +/obj/structure/table/bench/padded + icon_state = "padded_preview" + material = /decl/material/solid/metal/steel + reinf_material = /decl/material/solid/metal/steel + felted = TRUE + +/obj/structure/table/bench/glass + color = COLOR_DEEP_SKY_BLUE + alpha = 77 + reinf_material = /decl/material/solid/glass \ No newline at end of file diff --git a/code/game/objects/structures/tables.dm b/code/game/objects/structures/tables.dm index ce8a41b5217..ef6052f7f15 100644 --- a/code/game/objects/structures/tables.dm +++ b/code/game/objects/structures/tables.dm @@ -11,6 +11,8 @@ atom_flags = ATOM_FLAG_NO_TEMP_CHANGE | ATOM_FLAG_CLIMBABLE layer = TABLE_LAYER throwpass = TRUE + // Note that mob_offset also determines whether you can walk from one table to another without climbing. + // TODO: add 1px step-up? mob_offset = 12 handle_generic_blending = TRUE maxhealth = 10 @@ -30,6 +32,9 @@ var/felted = 0 var/list/connections + /// Whether items can be placed on this table via clicking. + var/can_place_items = TRUE + /obj/structure/table/clear_connections() connections = null @@ -200,7 +205,7 @@ . = ..() // Finally we can put the object onto the table. - if(!. && !isrobot(user) && W.loc == user && user.try_unequip(W, src.loc)) + if(!. && can_place_items && !isrobot(user) && W.loc == user && user.try_unequip(W, src.loc)) auto_align(W, click_params) return TRUE @@ -353,6 +358,8 @@ return FALSE if(istype(additional_reinf_material) && (!istype(other.additional_reinf_material) || additional_reinf_material.type != other.additional_reinf_material.type)) return FALSE + if(mob_offset != other.mob_offset) + return FALSE return TRUE // set propagate if you're updating a table that should update tables around it too, for example if it's a new table or something important has changed (like material). @@ -419,7 +426,7 @@ if(istype(mover) && mover.checkpass(PASS_FLAG_TABLE)) return 1 var/obj/structure/table/T = (locate() in get_turf(mover)) - return (T && !T.is_flipped) + return T && !T.is_flipped && (mob_offset <= T.mob_offset) //checks if projectile 'P' from turf 'from' can hit whatever is behind the table. Returns 1 if it can, 0 if bullet stops. /obj/structure/table/proc/check_cover(obj/item/projectile/P, turf/from) diff --git a/icons/obj/bench.dmi b/icons/obj/bench.dmi new file mode 100644 index 0000000000000000000000000000000000000000..15965e0fede1134d199f69005fd8ebe58b352986 GIT binary patch literal 7749 zcmbVR2~<*P--pb~Hk&D})S_jYrYyB7b1A{e%+!j;wMZm$%B@jz$&JMt%gU5?O-)Qw zQUWr?1yh_XsZ4Q6$rY1a3DE>mw)`pWZD>+4N`r{HJvYQLMR+Gq4Lu7BMZ+#1GmZ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gq=y;@IZe=lHk4&F-(1;kn`6c^HIU!{` zPua4<@6*7*Z#_{(x}^#_0uCCT91{@{F)=!NMJ}+AlM40$4)4Hb76a<_Jkp5dm3MZQ zr;WPh8T;0U^zZ*-GS7}(l~bmEOzexU=-$!VSaK{)PJP#Z06-#vl7MT()qa&@%boq- zmRZ8R+jGGX0C~BKU?0t{F)#Lx@_n#YNb!4)7|sRAWT3hWD7)>_CX8Nn(YiJ;Mp7A|N9O$=rhL~3G&cdi z*LH(Vl_O%mC~_bXzI+TaMQz$wkYKQb#-aGEz z*w~Wle}KX3>@={dEaMP_VnW8CYH8I?NB!`DH~%i+Yaar3HY#~#u;6L0WXb_4BJ1fC zYzfXaJu7TGyW|h5m269caK3 zklb5|UX4T*k&1zEJY@Ixe9GjamA~HbcAx?-YWml|+CchvN2fpIl95*!J&pd1ukXyA zytie^6QO?r!he_m-5ClRrp9$&w5G9ga^~nO2HtQ-$+4ZZ04x~39B|S4PE0tdgrA=Y z{;D+kYO`*_140g^LY23i6x9qAsJS(GL1h0lFJJcudmFqSfKxdl;NT0&5>93z?6^4} z1+ebnx-@WFtWZRc(FA{H>|2j-Glzee(_TMmH#yQ(UI_ktbEkp;z=apYCra*d{o6JV zRmW@F5xw0vvo)7e8F5o*gmVe8@6a^n{!TvXPD3FB(-_-a^pDP3Fv3EmqCiRj9I zbYs<#O}f{y#*pzPE2|h$YLgoNBjks-P>+tb-tqBJFd^TzYG-Uf^MKxHoUST&z@E&)f!-ugAGCslE^ET(U6>d!)1pKqNJ+Pa$ I>*(440TcK;y#N3J literal 0 HcmV?d00001 diff --git a/nebula.dme b/nebula.dme index d00fa6cec17..8f8adad6495 100644 --- a/nebula.dme +++ b/nebula.dme @@ -1261,6 +1261,7 @@ #include "code\game\objects\structures\barricade.dm" #include "code\game\objects\structures\barsign.dm" #include "code\game\objects\structures\bedsheet_bin.dm" +#include "code\game\objects\structures\benches.dm" #include "code\game\objects\structures\bookcase.dm" #include "code\game\objects\structures\catwalk.dm" #include "code\game\objects\structures\charge_pylon.dm"