From b61a4d837fc8319dce3228d6e5222d0a929fa137 Mon Sep 17 00:00:00 2001 From: DJSnapshot Date: Fri, 25 Jul 2014 16:56:56 -0700 Subject: [PATCH] fix to allow non-humans to be stunned like they should be. Gosh. (Also, clumsy check and making harmbaton actually work) Conflicts: code/game/objects/items/weapons/stunbaton.dm --- code/game/objects/items/weapons/stunbaton.dm | 51 +++++++++++++------- 1 file changed, 34 insertions(+), 17 deletions(-) diff --git a/code/game/objects/items/weapons/stunbaton.dm b/code/game/objects/items/weapons/stunbaton.dm index 37784f59a49..d448770cd1e 100644 --- a/code/game/objects/items/weapons/stunbaton.dm +++ b/code/game/objects/items/weapons/stunbaton.dm @@ -106,38 +106,55 @@ /obj/item/weapon/melee/baton/attack(mob/M, mob/user) if(status && (M_CLUMSY in user.mutations) && prob(50)) - user << "You accidentally hit yourself with [src]!" - user.Weaken(stunforce*3) + user << "span class='danger'>You accidentally hit yourself with the [src]!" + user.Weaken(30) deductcharge(hitcost) return + if(isrobot(M)) ..() return - if(!isliving(M)) - return - var/mob/living/L = M + var/mob/living/carbon/human/H = M - if(user.a_intent == "harm") - ..() - playsound(loc, "swing_hit", 50, 1, -1) + if(user.a_intent == "hurt") + if(!..()) return + H.visible_message("[M] has been beaten with the [src] by [user]!") + + user.attack_log += "\[[time_stamp()]\] Beat [H.name] ([H.ckey]) with [src.name]" + H.attack_log += "\[[time_stamp()]\] Beaten by [user.name] ([user.ckey]) with [src.name]" + msg_admin_attack("[user.name] ([user.ckey]) beat [H.name] ([H.ckey]) with [src.name] (JMP)") + + playsound(src.loc, "swing_hit", 50, 1, -1) else if(!status) - L.visible_message("[L] has been prodded with [src] by [user]. Luckily it was off.") + H.visible_message("[H] has been prodded with [src] by [user]. Luckily it was off.") return + var/stunroll = (rand(1,100)) + if(status) - user.lastattacked = L - L.lastattacker = user + user.lastattacked = H + H.lastattacker = user + if(user == H) // Attacking yourself can't miss + stunroll = 100 + if(stunroll < 40) + H.visible_message("\red [user] misses [H] with \the [src]!") + msg_admin_attack("[key_name(user)] attempted to stun [key_name(H)] with the [src].") + return + H.Stun(stunforce) + H.Weaken(stunforce) + H.apply_effect(STUTTER, stunforce) - L.Stun(stunforce) - L.Weaken(stunforce) - L.apply_effect(STUTTER, stunforce) - - L.visible_message("[L] has been stunned with [src] by [user]!") + H.visible_message("[H] has been stunned with [src] by [user]!") playsound(loc, 'sound/weapons/Egloves.ogg', 50, 1, -1) + msg_admin_attack("[key_name(user)] stunned [key_name(H)] with the [src].") + + user.attack_log += "\[[time_stamp()]\] Stunned [H.name] ([H.ckey]) with [src.name]" + H.attack_log += "\[[time_stamp()]\] Stunned by [user.name] ([user.ckey]) with [src.name]" + if(isrobot(loc)) var/mob/living/silicon/robot/R = loc if(R && R.cell) @@ -224,4 +241,4 @@ else if(!bcell) icon_state = "stunprod_nocell" else - icon_state = "stunprod" \ No newline at end of file + icon_state = "stunprod"