From 4374e46cdd57bb7db09d753bd1c8cb6268d98b04 Mon Sep 17 00:00:00 2001 From: phil235 Date: Wed, 24 Dec 2014 23:50:20 +0100 Subject: [PATCH] Fixes being able to smash grille/newscaster/mirror/lights with holo esword. --- code/game/machinery/newscaster.dm | 28 +++++++------------------- code/game/objects/structures/grille.dm | 2 ++ code/game/objects/structures/mirror.dm | 2 ++ code/modules/power/lighting.dm | 2 ++ 4 files changed, 13 insertions(+), 21 deletions(-) diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm index 85fc2a42869..f9e55ea906e 100644 --- a/code/game/machinery/newscaster.dm +++ b/code/game/machinery/newscaster.dm @@ -786,18 +786,6 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co /obj/machinery/newscaster/attackby(obj/item/I as obj, mob/living/user as mob) -/* if (istype(I, /obj/item/weapon/card/id) || istype(I, /obj/item/device/pda) ) //Name verification for channels or messages - if(src.screen == 4 || src.screen == 5) - if( istype(I, /obj/item/device/pda) ) - var/obj/item/device/pda/P = I - if(P.id) - src.scanned_user = "[P.id.registered_name] ([P.id.assignment])" - src.screen=2 - else - var/obj/item/weapon/card/id/T = I - src.scanned_user = text("[T.registered_name] ([T.assignment])") - src.screen=2*/ //Obsolete after autorecognition - if(istype(I, /obj/item/weapon/wrench)) user << "Now [anchored ? "un" : ""]securing [name]" playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1) @@ -809,26 +797,24 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co if (src.isbroken) playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 100, 1) - for (var/mob/O in hearers(5, src.loc)) - O.show_message("[user.name] further abuses the shattered [src.name].") + src.loc.audible_message("[user.name] further abuses the shattered [src.name].", null, 5 ) else if(istype(I, /obj/item/weapon) ) user.do_attack_animation(src) var/obj/item/weapon/W = I + if(W.damtype == STAMINA) + return if(W.force <15) - for (var/mob/O in hearers(5, src.loc)) - O.show_message("[user.name] hits the [src.name] with the [W.name] with no visible effect." ) - playsound(src.loc, 'sound/effects/Glasshit.ogg', 100, 1) + src.loc.audible_message("[user.name] hits the [src.name] with the [W.name] with no visible effect.", null , 5 ) + playsound(src.loc, 'sound/effects/Glasshit.ogg', 100, 1) else src.hitstaken++ if(src.hitstaken==3) - for (var/mob/O in hearers(5, src.loc)) - O.show_message("[user.name] smashes the [src.name]!" ) + src.loc.audible_message("[user.name] smashes the [src.name]!", null, 5 ) src.isbroken=1 playsound(src.loc, 'sound/effects/Glassbr3.ogg', 100, 1) else - for (var/mob/O in hearers(5, src.loc)) - O.show_message("[user.name] forcefully slams the [src.name] with the [I.name]!" ) + src.loc.audible_message("[user.name] forcefully slams the [src.name] with the [I.name]!", null, 5 ) playsound(src.loc, 'sound/effects/Glasshit.ogg', 100, 1) else user << "This does nothing." diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index fdb8eea13d1..03926ff7a2e 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -192,6 +192,8 @@ health -= W.force * 0.1 else if(!shock(user, 70)) switch(W.damtype) + if(STAMINA) + return if(BURN) playsound(loc, 'sound/items/welder.ogg', 80, 1) else diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm index 2b0a63b8499..b191c23aeef 100644 --- a/code/game/objects/structures/mirror.dm +++ b/code/game/objects/structures/mirror.dm @@ -58,6 +58,8 @@ /obj/structure/mirror/attackby(obj/item/I as obj, mob/living/user as mob) user.do_attack_animation(src) + if(I.damtype == STAMINA) + return if(shattered) playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1) return diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index 232791722cc..56621b6353c 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -370,6 +370,8 @@ else if(status != LIGHT_BROKEN && status != LIGHT_EMPTY) user.do_attack_animation(src) + if(W.damtype == STAMINA) + return if(prob(1+W.force * 5)) user.visible_message("[user.name] smashed the light!", \