Fix Sharshooter bonus

This commit is contained in:
Alexander Batalov 2022-08-06 17:07:07 +03:00
parent 5c8f7c4b00
commit 02e83a1989
1 changed files with 5 additions and 4 deletions

View File

@ -4230,6 +4230,11 @@ static int attackDetermineToHit(Object* attacker, int tile, Object* defender, in
int perception = critterGetStat(attacker, STAT_PERCEPTION);
// SFALL: Fix Sharpshooter.
if (attacker == gDude) {
perception += 2 * perkGetRank(gDude, PERK_SHARPSHOOTER);
}
if (defender != NULL) {
modifier = objectGetDistanceBetweenTiles(attacker, tile, defender, defender->tile);
} else {
@ -4250,10 +4255,6 @@ static int attackDetermineToHit(Object* attacker, int tile, Object* defender, in
modifier = -2 * perception;
}
if (attacker == gDude) {
modifier -= 2 * perkGetRank(gDude, PERK_SHARPSHOOTER);
}
if (modifier >= 0) {
if ((attacker->data.critter.combat.results & DAM_BLIND) != 0) {
modifier *= -12;