mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 02:34:00 +00:00
makes benches a subtype of tables
This commit is contained in:
17
code/modules/tables/bench.dm
Normal file
17
code/modules/tables/bench.dm
Normal file
@@ -0,0 +1,17 @@
|
||||
/obj/structure/table/bench
|
||||
name = "bench frame"
|
||||
icon = 'icons/obj/bench.dmi'
|
||||
icon_state = "frame"
|
||||
desc = "It's a bench, for putting things on. Or standing on, if you really want to."
|
||||
can_reinforce = 0
|
||||
flipped = -1
|
||||
density = 0
|
||||
|
||||
/obj/structure/table/bench/update_desc()
|
||||
if(material)
|
||||
name = "[material.display_name] bench"
|
||||
else
|
||||
name = "bench frame"
|
||||
|
||||
/obj/structure/table/bench/CanPass(atom/movable/mover)
|
||||
return 1
|
||||
@@ -10,6 +10,8 @@
|
||||
return 1
|
||||
if(istype(mover) && mover.checkpass(PASSTABLE))
|
||||
return 1
|
||||
if(locate(/obj/structure/table/bench) in get_turf(mover))
|
||||
return 0
|
||||
if(locate(/obj/structure/table) in get_turf(mover))
|
||||
return 1
|
||||
return 0
|
||||
@@ -136,7 +138,8 @@
|
||||
user << "<span class='warning'>There's nothing to put \the [W] on! Try adding plating to \the [src] first.</span>"
|
||||
return
|
||||
|
||||
user.drop_item(src.loc)
|
||||
if(item_place)
|
||||
user.drop_item(src.loc)
|
||||
return
|
||||
|
||||
/obj/structure/table/attack_tk() // no telehulk sorry
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
|
||||
var/list/connections = list("nw0", "ne0", "sw0", "se0")
|
||||
|
||||
var/item_place = 1 //allows items to be placed on the table, but not on benches.
|
||||
|
||||
/obj/structure/table/proc/update_material()
|
||||
var/old_maxhealth = maxhealth
|
||||
if(!material)
|
||||
@@ -217,7 +219,7 @@
|
||||
// Returns the material to set the table to.
|
||||
/obj/structure/table/proc/common_material_remove(mob/user, material/M, delay, what, type_holding, sound)
|
||||
if(!M.stack_type)
|
||||
user << "<span class='warning'>You are unable to remove the [what] from this table!</span>"
|
||||
user << "<span class='warning'>You are unable to remove the [what] from this [src]!</span>"
|
||||
return M
|
||||
|
||||
if(manipulating) return M
|
||||
|
||||
@@ -3,9 +3,6 @@
|
||||
for(var/obj/structure/table/T in view(src, 1))
|
||||
T.update_connections()
|
||||
T.update_icon()
|
||||
for(var/obj/structure/bench/T in view(src, 1))
|
||||
T.update_connections()
|
||||
T.update_icon()
|
||||
|
||||
/obj/structure/window/Destroy()
|
||||
var/oldloc = loc
|
||||
@@ -13,9 +10,6 @@
|
||||
for(var/obj/structure/table/T in view(oldloc, 1))
|
||||
T.update_connections()
|
||||
T.update_icon()
|
||||
for(var/obj/structure/bench/T in view(oldloc, 1))
|
||||
T.update_connections()
|
||||
T.update_icon()
|
||||
loc=oldloc
|
||||
..()
|
||||
|
||||
@@ -24,8 +18,5 @@
|
||||
. = ..()
|
||||
if(loc != oldloc)
|
||||
for(var/obj/structure/table/T in view(oldloc, 1) | view(loc, 1))
|
||||
T.update_connections()
|
||||
T.update_icon()
|
||||
for(var/obj/structure/bench/T in view(oldloc, 1) | view(loc, 1))
|
||||
T.update_connections()
|
||||
T.update_icon()
|
||||
Reference in New Issue
Block a user