From a3662a908850533cebc636b64f7d12a5e2f40dc2 Mon Sep 17 00:00:00 2001 From: GinjaNinja32 Date: Fri, 15 May 2015 00:06:47 +0100 Subject: [PATCH] Fixes, improvements, suggestions. --- code/modules/materials/materials.dm | 2 +- code/modules/tables/flipping.dm | 2 +- code/modules/tables/interactions.dm | 1 + code/modules/tables/tables.dm | 27 ++++++++++++++++++++++----- 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/code/modules/materials/materials.dm b/code/modules/materials/materials.dm index c46ca8e764..c791a8b560 100644 --- a/code/modules/materials/materials.dm +++ b/code/modules/materials/materials.dm @@ -109,7 +109,7 @@ var/list/name_to_material icon_colour = "#666666" /material/steel/holographic - name = "holographic [DEFAULT_WALL_MATERIAL]" + name = "holographic " + DEFAULT_WALL_MATERIAL display_name = DEFAULT_WALL_MATERIAL stack_type = null diff --git a/code/modules/tables/flipping.dm b/code/modules/tables/flipping.dm index 43697a938c..670edd01d8 100644 --- a/code/modules/tables/flipping.dm +++ b/code/modules/tables/flipping.dm @@ -92,7 +92,7 @@ var/obj/structure/table/T = locate() in get_step(src,D) if(T && T.flipped == 0 && material && T.material && T.material.name == material.name) T.flip(direction) - take_damage(rand(5, 20)) + take_damage(rand(5, 10)) update_connections(1) update_icon() diff --git a/code/modules/tables/interactions.dm b/code/modules/tables/interactions.dm index 4ada40596e..7eed01c237 100644 --- a/code/modules/tables/interactions.dm +++ b/code/modules/tables/interactions.dm @@ -84,6 +84,7 @@ M.apply_damage(8,def_zone = "head") visible_message("[G.assailant] slams [G.affecting]'s face against \the [src]!") playsound(src.loc, 'sound/weapons/tablehit1.ogg', 50, 1) + take_damage(rand(1,5)) else user << "You need a better grip to do that!" return diff --git a/code/modules/tables/tables.dm b/code/modules/tables/tables.dm index 0414fe238a..c5a1abc9c9 100644 --- a/code/modules/tables/tables.dm +++ b/code/modules/tables/tables.dm @@ -18,6 +18,7 @@ var/can_reinforce = 1 var/can_plate = 1 + var/manipulating = 0 var/material/material = null var/material/reinforced = null @@ -131,6 +132,7 @@ var/obj/item/weapon/weldingtool/F = W if(F.welding) user << "You begin reparing damage to \the [src]." + playsound(src.loc, 'sound/items/Welder.ogg', 50, 1) if(!do_after(user, 20) || !F.remove_fuel(1, user)) return user.visible_message("\The [user] repairs some damage to \the [src].", @@ -192,37 +194,52 @@ if(!istype(M)) user << "You cannot [verb]e \the [src] with \the [S]." return null + + if(manipulating) return M + manipulating = 1 user << "You begin [verb]ing \the [src] with [M.display_name]." if(!do_after(user, 20) || !S.use(1)) + manipulating = 0 return null user.visible_message("\The [user] [verb]es \the [src] with [M.display_name].", "You finish [verb]ing \the [src].") + manipulating = 0 return M // Returns the material to set the table to. -/obj/structure/table/proc/common_material_remove(mob/user, material/M, delay, what, type_holding) +/obj/structure/table/proc/common_material_remove(mob/user, material/M, delay, what, type_holding, sound) if(!M.stack_type) user << "You are unable to remove the [what] from this table!" return M + if(manipulating) return M + manipulating = 1 user.visible_message("\The [user] begins removing the [type_holding] holding \the [src]'s [M.display_name] [what] in place.", "You begin removing the [type_holding] holding \the [src]'s [M.display_name] [what] in place.") + if(sound) + playsound(src.loc, sound, 50, 1) if(!do_after(user, 40)) + manipulating = 0 return M user.visible_message("\The [user] removes the [M.display_name] [what] from \the [src].", "You remove the [M.display_name] [what] from \the [src].") new M.stack_type(src.loc) + manipulating = 0 return null /obj/structure/table/proc/remove_reinforced(obj/item/weapon/screwdriver/S, mob/user) - reinforced = common_material_remove(user, reinforced, 40, "reinforcements", "screws") + reinforced = common_material_remove(user, reinforced, 40, "reinforcements", "screws", 'sound/items/Screwdriver.ogg') /obj/structure/table/proc/remove_material(obj/item/weapon/wrench/W, mob/user) - material = common_material_remove(user, material, 20, "plating", "bolts") + material = common_material_remove(user, material, 20, "plating", "bolts", 'sound/items/Ratchet.ogg') /obj/structure/table/proc/dismantle(obj/item/weapon/wrench/W, mob/user) + if(manipulating) return + manipulating = 1 user.visible_message("\The [user] begins dismantling \the [src].", "You begin dismantling \the [src].") + playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) if(!do_after(user, 20)) + manipulating = 0 return user.visible_message("\The [user] dismantles \the [src].", "You dismantle \the [src].") @@ -276,7 +293,7 @@ var/tabledirs = 0 for(var/direction in list(turn(dir,90), turn(dir,-90)) ) var/obj/structure/table/T = locate(/obj/structure/table ,get_step(src,direction)) - if (T && T.flipped == 1 && T.dir == src.dir && T.material.name == material.name) + if (T && T.flipped == 1 && T.dir == src.dir && material && T.material && T.material.name == material.name) type++ tabledirs |= direction @@ -353,7 +370,7 @@ for(var/obj/structure/table/T in oview(src, 1)) var/T_dir = get_dir(src, T) if(T_dir in blocked_dirs) continue - if(material.name == T.material.name && flipped == T.flipped) + if(material && T.material && material.name == T.material.name && flipped == T.flipped) connection_dirs |= T_dir if(propagate) spawn(0)