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 00000000000..15965e0fede Binary files /dev/null and b/icons/obj/bench.dmi differ 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"