Shotgun Consistency (#17769)

This commit is contained in:
Geeves
2023-11-27 23:21:38 +00:00
committed by GitHub
parent 04a3f73515
commit a30ae9af30
3 changed files with 25 additions and 3 deletions
+13 -3
View File
@@ -92,11 +92,21 @@
if(target_mob.lying && target_mob != original && prob(prone_chance))
continue
//pellet hits spread out across different zones, but 'aim at' the targeted zone with higher probability
//whether the pellet actually hits the def_zone or a different zone should still be determined by the parent using get_zone_with_miss_chance().
// pellet hits spread out across different zones, but 'aim at' the targeted zone with higher probability
// whether the pellet actually hits the def_zone or a different zone should still be determined by the parent using get_zone_with_miss_chance().
var/old_zone = def_zone
def_zone = ran_zone(def_zone, spread)
if (..()) hits++
// relatively hacky way of basing a shotgun pellet's likelihood of hitting on the first pellet of the burst while not affecting shrapnel explosions.
if (base_spread > 0)
if (i == 1)
if (..())
hits++
else
return 0
else if (..(target_mob, distance, -100))
hits++
else if (..())
hits++
def_zone = old_zone //restore the original zone the projectile was aimed at
pellets -= hits //each hit reduces the number of pellets left