Fix Silent Death bonus for critical hits

This commit is contained in:
Alexander Batalov 2022-08-14 22:46:28 +03:00
parent 8700d0c601
commit df4382f2e0
1 changed files with 10 additions and 0 deletions

View File

@ -3845,6 +3845,16 @@ static int attackCompute(Attack* attack)
switch (roll) { switch (roll) {
case ROLL_CRITICAL_SUCCESS: case ROLL_CRITICAL_SUCCESS:
damageMultiplier = attackComputeCriticalHit(attack); damageMultiplier = attackComputeCriticalHit(attack);
// SFALL: Fix Silent Death bonus not being applied to critical hits.
if ((attackType == ATTACK_TYPE_MELEE || attackType == ATTACK_TYPE_UNARMED) && attack->attacker == gDude) {
if (perkHasRank(gDude, PERK_SILENT_DEATH)
&& !_is_hit_from_front(gDude, attack->defender)
&& dudeHasState(DUDE_STATE_SNEAKING)
&& gDude != attack->defender->data.critter.combat.whoHitMe) {
damageMultiplier *= 2;
}
}
// FALLTHROUGH // FALLTHROUGH
case ROLL_SUCCESS: case ROLL_SUCCESS:
attack->attackerFlags |= DAM_HIT; attack->attackerFlags |= DAM_HIT;