Skip to content

Interrupted abilities do not reroll their hit chance #1232

@Iridar

Description

@Iridar

As you know, when most abilities activate, they generate two game states, interrupt one and non-interrupt one.

The interrupt game state exists so that other abilities have a chance to interrupt the ability activation, prime example being Covering Fire Overwatch.

For my Class Rework, I decided to make Suppression shot preemtpive reaction fire, so that if a suppressed unit attempts to activate an offensive ability without movement, they get interrupted by the suppression shot, potentially killing them, though if they survive, the interrupted ability is resumed and plays out as normal.

However, Suppression Shot normally removes the suppression effect from the target, and I had a concern that it would happen too early, since technically the suppression shot happens before the interrupted ability gets activated "for real".

So I've done some digging and apparently the hit chance for an ability is generated during the interrupt step.

So if the interrupting ability makes any changes to interrupted unit's hit-chance related stats, it will have no effect on the hit chance of the interrupted ability.

Which means, for example, that Accurate Covering Fire mod couldn't have possibly worked all this time.

Here's some log output as proof. Note how the -150 Aim penalty that I set for Accurate Covering Fire is absent in Standard Shot's hit chance calculation, and how its calulated before the hit chance for overwatch shot.

[0220.62] XCom_HitRolls: ===InternalRollForAbilityHit===
[0220.62] XCom_HitRolls: Attacker ID: 1887
[0220.62] XCom_HitRolls: Target ID: 1304
[0220.62] XCom_HitRolls: Ability: Fire Weapon (StandardShot)
[0220.62] XCom_HitRolls: =GetHitChance=
[0220.62] XCom_HitRolls: Modifying eHit_Success +0 (Fire Weapon), New hit chance: 0
[0220.62] XCom_HitRolls: Modifying eHit_Crit +0 (Fire Weapon), New hit chance: 0
[0220.62] XCom_HitRolls: Modifying eHit_Success +70 (Aim), New hit chance: 70
[0220.62] XCom_HitRolls: Modifying eHit_Success +0 (Flanking Target), New hit chance: 70
[0220.62] XCom_HitRolls: Modifying eHit_Success +0 (Weapon Accuracy), New hit chance: 70
[0220.62] XCom_HitRolls: Modifying eHit_Success +0 (Defense), New hit chance: 70
[0220.62] XCom_HitRolls: Modifying eHit_Success +0 (Weapon Range), New hit chance: 70
[0220.62] XCom_HitRolls: Modifying eHit_Graze +90 (Dodge), New hit chance: 70
[0220.62] XCom_HitRolls: Modifying eHit_Crit +0 (Character Skill), New hit chance: 70
[0220.63] XCom_HitRolls: Modifying eHit_Crit +0 (Weapon Crit), New hit chance: 70
[0220.63] XCom_HitRolls: Modifying eHit_Crit +33 (Flanking Target), New hit chance: 70
[0220.63] XCom_HitRolls: ==FinalizeHitChance==

[0220.63] XCom_HitRolls: Starting values...
[0220.63] XCom_HitRolls: eHit_Success: 70
[0220.63] XCom_HitRolls: eHit_Crit: 33
[0220.63] XCom_HitRolls: eHit_Graze: 90
[0220.63] XCom_HitRolls: eHit_Miss: 0
[0220.63] XCom_HitRolls: eHit_LightningReflexes: 0
[0220.63] XCom_HitRolls: eHit_Untouchable: 0
[0220.63] XCom_HitRolls: eHit_CounterAttack: 0
[0220.63] XCom_HitRolls: eHit_Parry: 0
[0220.63] XCom_HitRolls: eHit_Deflect: 0
[0220.63] XCom_HitRolls: eHit_Reflect: 0
[0220.63] XCom_HitRolls: Calculated values...
[0220.63] XCom_HitRolls: eHit_Success: -26
[0220.63] XCom_HitRolls: eHit_Crit: 33
[0220.63] XCom_HitRolls: eHit_Graze: 63
[0220.63] XCom_HitRolls: eHit_Miss: 30
[0220.63] XCom_HitRolls: eHit_LightningReflexes: 0
[0220.63] XCom_HitRolls: eHit_Untouchable: 0
[0220.63] XCom_HitRolls: eHit_CounterAttack: 0
[0220.63] XCom_HitRolls: eHit_Parry: 0
[0220.63] XCom_HitRolls: eHit_Deflect: 0
[0220.63] XCom_HitRolls: eHit_Reflect: 0
[0220.63] XCom_HitRolls: Final hit chance (success + crit + graze) = 70
[0220.63] XCom_HitRolls: =InternalRollForAbilityHit=
[0220.63] XCom_HitRolls: Final hit chance: 70
[0220.64] XCom_HitRolls: Random roll: 67
[0220.64] XCom_HitRolls: Checking table eHit_Success (-26)...
[0220.64] XCom_HitRolls: Checking table eHit_Crit (7)...
[0220.64] XCom_HitRolls: Checking table eHit_Graze (70)...
[0220.64] XCom_HitRolls: MATCH!
[0220.64] XCom_HitRolls: =GetModifiedHitChanceForCurrentDifficulty=
[0220.64] XCom_HitRolls: Aim Assisted hit chance: 60
[0220.64] XCom_HitRolls: *** AIM ASSIST forcing an Alien HIT to become a MISS!
[0220.64] XCom_HitRolls: ***HIT eHit_Miss
[0220.65] XCom_HitRolls: ===InternalRollForAbilityHit===
[0220.65] XCom_HitRolls: Attacker ID: 1297
[0220.65] XCom_HitRolls: Target ID: 1887
[0220.65] XCom_HitRolls: Ability: Overwatch Shot (OverwatchShot)
[0220.65] XCom_HitRolls: =GetHitChance=
[0220.65] XCom_HitRolls: Modifying eHit_Success +0 (Overwatch Shot), New hit chance: 0
[0220.65] XCom_HitRolls: Modifying eHit_Crit +0 (Overwatch Shot), New hit chance: 0
[0220.65] XCom_HitRolls: Modifying eHit_Success +80 (Aim), New hit chance: 80
[0220.65] XCom_HitRolls: Modifying eHit_Success +0 (Weapon Accuracy), New hit chance: 80
[0220.65] XCom_HitRolls: Modifying eHit_Success +0 (Defense), New hit chance: 80
[0220.65] XCom_HitRolls: Modifying eHit_Success +23 (Weapon Range), New hit chance: 103
[0220.66] XCom_HitRolls: Modifying eHit_Graze +0 (Dodge), New hit chance: 103
[0220.66] XCom_HitRolls: Modifying eHit_Crit +0 (Character Skill), New hit chance: 103
[0220.66] XCom_HitRolls: Modifying eHit_Crit +0 (Weapon Crit), New hit chance: 103
[0220.66] XCom_HitRolls: Modifying eHit_Crit +50 (Flanking Target), New hit chance: 103
[0220.66] XCom_HitRolls: Modifying eHit_Crit -50 (Reaction Fire), New hit chance: 103
[0220.66] XCom_HitRolls: Modifying eHit_Success -30 (Overwatch Shot), New hit chance: 73
[0220.66] XCom_HitRolls: Modifying eHit_Success +0 (Return Fire), New hit chance: 73
[0220.66] XCom_HitRolls: Modifying eHit_Success +0 (Covering Fire), New hit chance: 73
[0220.66] XCom_HitRolls: Modifying eHit_Success +0 (), New hit chance: 73
[0220.66] XCom_HitRolls: ==FinalizeHitChance==

[0220.66] XCom_HitRolls: Starting values...
[0220.66] XCom_HitRolls: eHit_Success: 73
[0220.66] XCom_HitRolls: eHit_Crit: 0
[0220.66] XCom_HitRolls: eHit_Graze: 0
[0220.66] XCom_HitRolls: eHit_Miss: 0
[0220.66] XCom_HitRolls: eHit_LightningReflexes: 0
[0220.66] XCom_HitRolls: eHit_Untouchable: 0
[0220.66] XCom_HitRolls: eHit_CounterAttack: 0
[0220.66] XCom_HitRolls: eHit_Parry: 0
[0220.66] XCom_HitRolls: eHit_Deflect: 0
[0220.66] XCom_HitRolls: eHit_Reflect: 0
[0220.66] XCom_HitRolls: Calculated values...
[0220.66] XCom_HitRolls: eHit_Success: 73
[0220.66] XCom_HitRolls: eHit_Crit: 0
[0220.66] XCom_HitRolls: eHit_Graze: 0
[0220.66] XCom_HitRolls: eHit_Miss: 27
[0220.66] XCom_HitRolls: eHit_LightningReflexes: 0
[0220.66] XCom_HitRolls: eHit_Untouchable: 0
[0220.66] XCom_HitRolls: eHit_CounterAttack: 0
[0220.66] XCom_HitRolls: eHit_Parry: 0
[0220.66] XCom_HitRolls: eHit_Deflect: 0
[0220.66] XCom_HitRolls: eHit_Reflect: 0
[0220.67] XCom_HitRolls: Final hit chance (success + crit + graze) = 73
[0220.67] XCom_HitRolls: =InternalRollForAbilityHit=
[0220.67] XCom_HitRolls: Final hit chance: 73
[0220.67] XCom_HitRolls: Random roll: 72
[0220.67] XCom_HitRolls: Checking table eHit_Success (73)...
[0220.67] XCom_HitRolls: MATCH!
[0220.67] XCom_HitRolls: ***HIT eHit_Success
[0220.67] XCom_HitRolls: ===CalculateDamageAmount===
[0220.67] XCom_HitRolls: Attacker ID: 1297 With Item ID: 1298 Target ID: 1887
[0220.67] XCom_HitRolls: bIgnoreBaseDamage:'False' DamageTag:'None'
[0220.67] XCom_HitRolls: Weapon damage: 3 Potential spread: 0
[0220.67] XCom_HitRolls: Damage with spread: 3
[0220.67] XCom_HitRolls: Rolled for PlusOne off BaseDamage, succeeded. Damage: 4
[0220.67] XCom_HitRolls:   RollArmorMitigation  
[0220.67] XCom_HitRolls:   Total Mitigation: 0
[0220.67] XCom_HitRolls: Total Damage: 4
[0220.67] XCom_HitRolls: ===CalculateDamageAmount===
[0220.67] XCom_HitRolls: Attacker ID: 1887 With Item ID: 1888 Target ID: 1304
[0220.67] XCom_HitRolls: bIgnoreBaseDamage:'True' DamageTag:'Miss'
[0220.67] XCom_HitRolls: Weapon damage: 0 Potential spread: 0
[0220.67] XCom_HitRolls: Damage with spread: 0
[0220.67] XCom_HitRolls:   RollArmorMitigation  
[0220.67] XCom_HitRolls:   Total Mitigation: 0
[0220.67] XCom_HitRolls: Total Damage: 0

Metadata

Metadata

Assignees

No one assigned

    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