Merge pull request #2134 from Neerti/7/14/2016_accuracy_penalties

Adds accuracy penalties for certain detrimental states.
This commit is contained in:
EmperorJon
2016-07-16 17:04:38 +01:00
committed by GitHub
2 changed files with 18 additions and 1 deletions

View File

@@ -154,7 +154,16 @@ emp_act
if(user == src) // Attacking yourself can't miss
return target_zone
var/hit_zone = get_zone_with_miss_chance(target_zone, src)
// 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)
accuracy_penalty += 75
if(user.eye_blurry)
accuracy_penalty += 15
if(user.confused)
accuracy_penalty += 30
var/hit_zone = get_zone_with_miss_chance(target_zone, src, accuracy_penalty)
if(!hit_zone)
visible_message("<span class='danger'>\The [user] misses [src] with \the [I]!</span>")

View File

@@ -333,6 +333,14 @@
P.accuracy = accuracy + acc_mod
P.dispersion = dispersion
// Certain statuses make it harder to aim, blindness especially. Same chances as melee, however guns accuracy uses multiples of 15.
if(user.confused)
accuracy -= 2
if(user.eye_blind)
accuracy -= 5
if(user.eye_blurry)
accuracy -= 1
//accuracy bonus from aiming
if (aim_targets && (target in aim_targets))
//If you aim at someone beforehead, it'll hit more often.