mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-20 12:29:23 +01:00
Fixes pointblank shots being able to miss. (#14486)
This commit is contained in:
@@ -355,7 +355,7 @@ emp_act
|
||||
if (O.throw_source)
|
||||
var/distance = get_dist(O.throw_source, loc)
|
||||
miss_chance = 15 * (distance - 2)
|
||||
zone = get_zone_with_miss_chance(zone, src, miss_chance, ranged_attack=1)
|
||||
zone = get_zone_with_miss_chance(zone, src, miss_chance, 1)
|
||||
|
||||
if(zone && O.thrower != src)
|
||||
var/shield_check = check_shields(throw_damage, O, thrower, zone, "[O]")
|
||||
|
||||
@@ -314,7 +314,7 @@ var/list/global/organ_rel_size = list(
|
||||
// Emulates targetting a specific body part, and miss chances
|
||||
// May return null if missed
|
||||
// miss_chance_mod may be negative.
|
||||
/proc/get_zone_with_miss_chance(zone, var/mob/target, var/miss_chance_mod = 0, var/ranged_attack=0)
|
||||
/proc/get_zone_with_miss_chance(zone, var/mob/target, var/miss_chance_mod = 0, var/ranged_attack=0, var/point_blank = FALSE)
|
||||
zone = check_zone(zone)
|
||||
|
||||
if(!ranged_attack)
|
||||
@@ -325,6 +325,8 @@ var/list/global/organ_rel_size = list(
|
||||
for(var/obj/item/grab/G in target.grabbed_by)
|
||||
if(G.state >= GRAB_AGGRESSIVE)
|
||||
return zone
|
||||
if(point_blank)
|
||||
return zone //Point blank shots don't miss.
|
||||
|
||||
var/miss_chance = 10
|
||||
if (zone in base_miss_chance)
|
||||
|
||||
@@ -193,7 +193,7 @@
|
||||
|
||||
//roll to-hit
|
||||
miss_modifier = max(15*(distance-1) - round(25*accuracy) + miss_modifier, 0)
|
||||
hit_zone = get_zone_with_miss_chance(def_zone, target_mob, miss_modifier, ranged_attack=(distance > 1 || original != target_mob)) //if the projectile hits a target we weren't originally aiming at then retain the chance to miss
|
||||
hit_zone = get_zone_with_miss_chance(def_zone, target_mob, miss_modifier, (distance > 1 || original != target_mob), point_blank) //if the projectile hits a target we weren't originally aiming at then retain the chance to miss
|
||||
|
||||
var/result = PROJECTILE_FORCE_MISS
|
||||
if(hit_zone)
|
||||
|
||||
Reference in New Issue
Block a user