makes benches a subtype of tables

This commit is contained in:
SinTwo
2016-06-29 17:52:27 -04:00
parent c7db22b985
commit a7aa2a7f33
7 changed files with 26 additions and 351 deletions

View 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

View File

@@ -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

View File

@@ -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

View File

@@ -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()