Skip to content

Commit

Permalink
simplified
Browse files Browse the repository at this point in the history
  • Loading branch information
fira committed Oct 26, 2023
1 parent 8645360 commit 8f0884c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
3 changes: 0 additions & 3 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,3 @@ var/list/default_xeno_onmob_icons = list(
#define EXTREMITY_LIMBS list("l_leg","l_foot","r_leg","r_foot","l_arm","l_hand","r_arm","r_hand")
#define CORE_LIMBS list("chest","head","groin")


/// Overall percentage miss chance if you were to target a random body part, averaged from entries in global list base_miss_chance
#define MOB_OVERALL_MISS_CHANCE 15
2 changes: 1 addition & 1 deletion code/modules/mob/mob_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

//TODO: Integrate defence zones and targeting body parts with the actual organ system, move these into organ definitions.

/// The base miss chance for the different defence zones (see also MOB_OVERALL_MISS_CHANCE)
/// The base miss chance for the different defence zones
var/list/global/base_miss_chance = list(
"head" = 10,
"chest" = 0,
Expand Down
8 changes: 3 additions & 5 deletions code/modules/projectiles/projectile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -476,12 +476,10 @@
// At present, Xenos have no inherent effects or localized damage stemming from limb targeting
// Therefore we exempt the shooter from direct hit accuracy penalties as well,
// simply to avoid them from resetting target to chest every time they want to shoot a xeno
if(isxeno(L))
if(!direct_hit)
hit_chance -= MOB_OVERALL_MISS_CHANCE // Averaged miss chance across all limbs
// else treat this as a chest shot (0 penalty) regardless of aim for the pupose of hit rolls
else // For all other normal people we just apply per-limb hit penalty

if(!direct_hit || !isxeno(L)) // For normal people or direct hits we apply the limb accuracy penalty
hit_chance -= base_miss_chance[def_zone]
// else for direct hits on xenos, we skip it, pretending it's a chest shot with zero penalty

#if DEBUG_HIT_CHANCE
to_world(SPAN_DEBUG("([L]) Hit chance: [hit_chance] | Roll: [hit_roll]"))
Expand Down

0 comments on commit 8f0884c

Please sign in to comment.