Skip to content

bIndirectFire hits aren't guaranteed #1213

@Iridar

Description

@Iridar

Related code

When an ability's hit is supposed to be guaranteed, current code just adds 100 to hit chance, and then chugs along merrily, potentially adding negative hit modifiers from other sources, such as Defense from a Smoke Grenade making grenades no longer guaranteed:

[0448.59] XCom_HitRolls: ===InternalRollForAbilityHit===
[0448.59] XCom_HitRolls: Attacker ID: 3115
[0448.59] XCom_HitRolls: Target ID: 2376
[0448.59] XCom_HitRolls: Ability: Throw Grenade (ThrowGrenade)
[0448.59] XCom_HitRolls: =GetHitChance=
[0448.59] XCom_HitRolls: Modifying eHit_Success +100 (Throw Grenade), New hit chance: 100
[0448.59] XCom_HitRolls: Modifying eHit_Success +0 (Throw Grenade), New hit chance: 100
[0448.59] XCom_HitRolls: Modifying eHit_Crit +0 (Throw Grenade), New hit chance: 100
[0448.59] XCom_HitRolls: Modifying eHit_Success -20 (Defensive Smoke), New hit chance: 80
[0448.59] XCom_HitRolls: ==FinalizeHitChance==

[0448.59] XCom_HitRolls: Starting values...
[0448.59] XCom_HitRolls: eHit_Success: 80
[0448.59] XCom_HitRolls: eHit_Crit: 0
[0448.59] XCom_HitRolls: eHit_Graze: 0
[0448.59] XCom_HitRolls: eHit_Miss: 0
[0448.59] XCom_HitRolls: eHit_LightningReflexes: 0
[0448.59] XCom_HitRolls: eHit_Untouchable: 0
[0448.59] XCom_HitRolls: eHit_CounterAttack: 0
[0448.59] XCom_HitRolls: eHit_Parry: 0
[0448.59] XCom_HitRolls: eHit_Deflect: 0
[0448.59] XCom_HitRolls: eHit_Reflect: 0
[0448.59] XCom_HitRolls: Calculated values...
[0448.59] XCom_HitRolls: eHit_Success: 80
[0448.59] XCom_HitRolls: eHit_Crit: 0
[0448.59] XCom_HitRolls: eHit_Graze: 0
[0448.59] XCom_HitRolls: eHit_Miss: 20
[0448.59] XCom_HitRolls: eHit_LightningReflexes: 0
[0448.59] XCom_HitRolls: eHit_Untouchable: 0
[0448.59] XCom_HitRolls: eHit_CounterAttack: 0
[0448.59] XCom_HitRolls: eHit_Parry: 0
[0448.59] XCom_HitRolls: eHit_Deflect: 0
[0448.59] XCom_HitRolls: eHit_Reflect: 0
[0448.59] XCom_HitRolls: Final hit chance (success + crit + graze) = 80
[0448.59] XCom_HitRolls: =InternalRollForAbilityHit=
[0448.59] XCom_HitRolls: Final hit chance: 80
[0448.59] XCom_HitRolls: Random roll: 95
[0448.59] XCom_HitRolls: Checking table eHit_Success (80)...
[0448.59] XCom_HitRolls: Checking table eHit_Crit (80)...
[0448.59] XCom_HitRolls: Checking table eHit_Graze (80)...
[0448.59] XCom_HitRolls: ***MISS eHit_Miss

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions