diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 0e121e1481..20d1a907a5 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -105,6 +105,7 @@ var/friendly = "nuzzles" // What mobs do to people when they aren't really hostile var/attack_sound = null // Sound to play when I attack var/environment_smash = 0 // How much environment damage do I do when I hit stuff? + var/melee_miss_chance = 40 // percent chance to miss a melee attack. //Special attacks var/spattack_prob = 0 // Chance of the mob doing a special attack (0 for never) @@ -1117,9 +1118,18 @@ /mob/living/simple_animal/proc/PunchTarget() if(!Adjacent(target_mob)) return + sleep(rand(8) + 8) if(isliving(target_mob)) var/mob/living/L = target_mob - L.attack_generic(src,rand(melee_damage_lower,melee_damage_upper),attacktext) + + if(prob(melee_miss_chance)) + src.attack_log += text("\[[time_stamp()]\] attacked [L.name] ([L.ckey])") + L.attack_log += text("\[[time_stamp()]\] was attacked by [src.name] ([src.ckey])") + src.visible_message("[src] misses [L]!") + src.do_attack_animation(src) + return L + else + L.attack_generic(src,rand(melee_damage_lower,melee_damage_upper),attacktext) return L if(istype(target_mob,/obj/mecha)) var/obj/mecha/M = target_mob