From 1bb6a7bdb19e283052be555145aa3e5bff2349d9 Mon Sep 17 00:00:00 2001 From: Chinsky Date: Fri, 4 Jan 2013 08:36:41 +0400 Subject: [PATCH] Added ability to bash people against the windows --- code/game/objects/structures/window.dm | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 8d0074d0f6a..8a9bb8d0868 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -209,6 +209,30 @@ /obj/structure/window/attackby(obj/item/weapon/W as obj, mob/user as mob) if(!istype(W)) return//I really wish I did not need this + + if (istype(W, /obj/item/weapon/grab) && get_dist(src,user)<2) + var/obj/item/weapon/grab/G = W + if (istype(G.affecting, /mob/living)) + var/mob/living/M = G.affecting + var/state = G.state + del(W) //gotta delete it here because if window breaks, it won't get deleted + switch (state) + if(1) + M.apply_damage(10) + hit(10) + visible_message("\red [user] slams [M] against \the [src]!") + if(2) + M.Weaken(2) + M.apply_damage(15) + hit(25) + visible_message("\red [user] bashes [M] against \the [src]!") + if(3) + M.Weaken(10) + M.apply_damage(25) + hit(50) + visible_message("\red [user] crushes [M] against \the [src]!") + return + if (istype(W, /obj/item/weapon/screwdriver)) if(reinf && state >= 1) state = 3 - state @@ -438,4 +462,4 @@ /obj/structure/window/reinforced/tinted/frosted icon_state = "fwindow" - name = "frosted window" + name = "frosted window"