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) /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/H = M
var/mob/living/carbon/human/U = user
if(istype(H)) if(istype(H))
for(var/obj/item/protection in list(H.head, H.wear_mask, H.glasses)) for(var/obj/item/protection in list(H.head, H.wear_mask, H.glasses))
if(protection && (protection.body_parts_covered & EYES)) 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>" user << "<span class='warning'>You cannot locate any eyes on [M]!</span>"
return 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>" 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>" 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 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()? // Should this all be in Touch()?
if(istype(H)) 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)) if(H != src && check_shields(0, null, H, H.zone_sel.selecting, H.name))
H.do_attack_animation(src) H.do_attack_animation(src)
return 0 return 0
@@ -189,6 +196,11 @@
were made for projectiles. were made for projectiles.
TODO: proc for melee combat miss chances depending on organ? 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)) if(prob(80))
hit_zone = ran_zone(hit_zone) hit_zone = ran_zone(hit_zone)
if(prob(15) && hit_zone != BP_TORSO) // Missed! if(prob(15) && hit_zone != BP_TORSO) // Missed!

View File

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

View File

@@ -0,0 +1,36 @@
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# wip (For works in progress)
# tweak
# soundadd
# sounddel
# rscadd (general adding of nice things)
# rscdel (general deleting of nice things)
# imageadd
# imagedel
# maptweak
# spellcheck (typo fixes)
# experiment
#################################
# Your name.
author: Anewbe
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True
# Any changes you've made. See valid prefix list above.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
changes:
- bugfix: "Flashes should now properly affect accuracy in hand-to-hand."