Hands should now be affected by the flash accuracy penalties

This commit is contained in:
Anewbe
2017-01-02 20:26:37 -06:00
parent 3605ee231e
commit 47f6946794
4 changed files with 69 additions and 8 deletions

View File

@@ -449,6 +449,7 @@ var/list/global/slot_flags_enumeration = list(
/obj/item/proc/eyestab(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
var/mob/living/carbon/human/H = M
var/mob/living/carbon/human/U = user
if(istype(H))
for(var/obj/item/protection in list(H.head, H.wear_mask, H.glasses))
if(protection && (protection.body_parts_covered & EYES))
@@ -460,6 +461,13 @@ var/list/global/slot_flags_enumeration = list(
user << "<span class='warning'>You cannot locate any eyes on [M]!</span>"
return
var/hit_zone = get_zone_with_miss_chance(U.zone_sel.selecting, M, U.get_accuracy_penalty(U))
if(!hit_zone)
U.do_attack_animation(M)
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
visible_message("\red <B>[U] attempts to stab [M] in the eyes, but misses!</B>")
return
user.attack_log += "\[[time_stamp()]\]<font color='red'> Attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])</font>"
M.attack_log += "\[[time_stamp()]\]<font color='orange'> Attacked by [user.name] ([user.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])</font>"
msg_admin_attack("[user.name] ([user.ckey]) attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)") //BS12 EDIT ALG

View File

@@ -22,6 +22,13 @@
// Should this all be in Touch()?
if(istype(H))
var/hit_zone = get_zone_with_miss_chance(H.zone_sel.selecting, src, get_accuracy_penalty(H))
if(!hit_zone)
H.do_attack_animation(src)
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
visible_message("\red <B>[H] attempts to punch [src], but misses!</B>")
return 0
if(H != src && check_shields(0, null, H, H.zone_sel.selecting, H.name))
H.do_attack_animation(src)
return 0
@@ -189,6 +196,11 @@
were made for projectiles.
TODO: proc for melee combat miss chances depending on organ?
*/
if(!hit_zone)
attack_message = "[H] attempted to strike [src], but missed!"
miss_type = 1
if(prob(80))
hit_zone = ran_zone(hit_zone)
if(prob(15) && hit_zone != BP_TORSO) // Missed!

View File

@@ -151,13 +151,7 @@ emp_act
O.emp_act(severity)
..()
/mob/living/carbon/human/resolve_item_attack(obj/item/I, mob/living/user, var/target_zone)
if(check_neckgrab_attack(I, user, target_zone))
return null
if(user == src) // Attacking yourself can't miss
return target_zone
/mob/living/carbon/human/proc/get_accuracy_penalty(mob/living/user)
// Certain statuses make it harder to score a hit. These are the same as gun accuracy, however melee doesn't use multiples of 15.
var/accuracy_penalty = 0
if(user.eye_blind)
@@ -167,9 +161,20 @@ emp_act
if(user.confused)
accuracy_penalty += 45
var/hit_zone = get_zone_with_miss_chance(target_zone, src, accuracy_penalty)
return accuracy_penalty
/mob/living/carbon/human/resolve_item_attack(obj/item/I, mob/living/user, var/target_zone)
if(check_neckgrab_attack(I, user, target_zone))
return null
if(user == src) // Attacking yourself can't miss
return target_zone
var/hit_zone = get_zone_with_miss_chance(target_zone, src, get_accuracy_penalty(user))
if(!hit_zone)
user.do_attack_animation(src)
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
visible_message("<span class='danger'>\The [user] misses [src] with \the [I]!</span>")
return null