allow overwatch shots to ignore cover

rohan
Oct 19, 2022, 9:06 AM
GO25CRKMI7TO2OPHWXXNMN3Y46FSYLABLGFADE45P275ZMHQEF7AC

Dependencies

  • [2] WWMGBP4L merge with Highlander 1.24.0
  • [3] 6GNTEDE4 use real LOS functions to determine Far Cover (automatically accounts for roof edge protection)
  • [4] CBG5GWG7 peeking over an overhang doesn't work - add a little height to the firing location
  • [5] JSCVVDFD remove commented code and excess tabs
  • [6] ZC7RMRAE simpler no-line-of-sight which also accounts for existing cover, higher resolution far cover
  • [7] VHVL5HH4 simplify far cover by starting at only the peek tile
  • [8] Q5WQ6EMV replace good angle malus with existing far cover
  • [9] X4IR7ZAH baseline from krumiro's [WotC] RW Realistic Aiming Angles
  • [*] UA2L2WYU use correct config file

Change contents

  • edit in RWRealisticAimingAnglesHL/Src/RWRealisticAimingAnglesHL/Classes/Override_X2AbilityToHitCalc_StandardAim.uc at line 42
    [4.22843]
    [4.22845]
    var config bool OVERWATCH_BYPASS_COVER;
    var config array<name> OVERWATCH_ABILITIES;
    var config array<name> MOVEMENT_ABILITY;
  • edit in RWRealisticAimingAnglesHL/Src/RWRealisticAimingAnglesHL/Classes/Override_X2AbilityToHitCalc_StandardAim.uc at line 537
    [4.46388]
    [2.2402]
    // ========================================
    // From -bg-'s EU Aim Rolls mod
    // ========================================
    local XComGameState LastGameState;
    local bool isRunningOverwatch;
    local XComGameStateContext_Ability LastAbilityContext;
  • edit in RWRealisticAimingAnglesHL/Src/RWRealisticAimingAnglesHL/Classes/Override_X2AbilityToHitCalc_StandardAim.uc at line 576
    [4.47536]
    [4.47536]
    // ========================================
    // From -bg-'s EU Aim Rolls mod
    // ========================================
    // Check if it's overwatch
    if (default.OVERWATCH_ABILITIES.Find(kAbility.GetMyTemplateName()) != INDEX_NONE)
    {
    // Check if target is moving
    // Is interrupt state, so using same game state
    LastGameState = History.GetGameStateFromHistory(History.GetCurrentHistoryIndex());
    LastAbilityContext = XComGameStateContext_Ability(LastGameState.GetContext());
    if (LastAbilityContext != none)
    if (default.MOVEMENT_ABILITY.Find(LastAbilityContext.InputContext.AbilityTemplateName) != INDEX_NONE)
    isRunningOverwatch = true;
    }
  • edit in RWRealisticAimingAnglesHL/Src/RWRealisticAimingAnglesHL/Classes/Override_X2AbilityToHitCalc_StandardAim.uc at line 695
    [4.53857]
    [4.53857]
    `log("TargetState.CanTakeCover():"@TargetState.CanTakeCover()@", isRunningOverwatch:"@isRunningOverwatch, true, 'XCom_HitRolls');
  • replacement in RWRealisticAimingAnglesHL/Src/RWRealisticAimingAnglesHL/Classes/Override_X2AbilityToHitCalc_StandardAim.uc at line 699
    [4.53887][4.53887:53925]()
    if (TargetState.CanTakeCover())
    [4.53887]
    [4.53925]
    if (TargetState.CanTakeCover()
    // ========================================
    // From -bg-'s EU Aim Rolls mod
    // ========================================
    && (!OVERWATCH_BYPASS_COVER || !isRunningOverwatch))
  • replacement in RWRealisticAimingAnglesHL/Src/RWRealisticAimingAnglesHL/Classes/Override_X2AbilityToHitCalc_StandardAim.uc at line 769
    [3.409][3.409:548]()
    if (default.AllowFarCoverToGiveSomeCoverProtection || default.GiveHitChanceZeroWhenTargetableEnemiesAreInsteadNotTrulyInLineOfSight)
    [3.409]
    [3.548]
    if ((default.AllowFarCoverToGiveSomeCoverProtection || default.GiveHitChanceZeroWhenTargetableEnemiesAreInsteadNotTrulyInLineOfSight)
    // ========================================
    // From -bg-'s EU Aim Rolls mod
    // ========================================
    && (!OVERWATCH_BYPASS_COVER || !isRunningOverwatch))
  • edit in RWRealisticAimingAnglesHL/Config/XComRWRealisticAimingAnglesHL.ini at line 79
    [11.11766]
    ; ========================================
    ; From -bg-'s EU Aim Rolls mod
    ; ========================================
    ; ===Overwatch ignore cover functionality=== (You may add OVERWATCH_ABILITY and MOVEMENT_ABILITY in your own mods to make them have an effect here)
    +OVERWATCH_BYPASS_COVER=false ; Set to true to cause overwatch shots to ignore cover
    ; Note OVERWATCH_ABILITIES are the abilities that is used to fire the shot and damage, not the ability to prime the overwatch.
    +OVERWATCH_ABILITIES=OverwatchShot
    +OVERWATCH_ABILITIES=SuppressionShot
    +OVERWATCH_ABILITIES=LongWatchShot
    +OVERWATCH_ABILITIES=KillZoneShot
    +OVERWATCH_ABILITIES=PistolOverwatchShot
    ; Movement abilities are names of abilities that will cause overwatches to ignore cover if said ability is used to trigger overwatch
    +MOVEMENT_ABILITY=StandardMove
    +MOVEMENT_ABILITY=StunLance ; StunLance is added because the whole movement part also count as this ability.
    +MOVEMENT_ABILITY=SwordSlice
    +MOVEMENT_ABILITY=SKULLJACKAbility
    +MOVEMENT_ABILITY=SKULLMINEAbility
    ; ======= WOTC NEW SKILLS ========
    +MOVEMENT_ABILITY=Rend
    +MOVEMENT_ABILITY=ArcWave
    +MOVEMENT_ABILITY=ChosenKidnapMove
    +MOVEMENT_ABILITY=ChosenExtractKnowledgeMove
    +MOVEMENT_ABILITY=PartingSilk
    +MOVEMENT_ABILITY=SpectralStunLance
    +MOVEMENT_ABILITY=Shadowbind
    +MOVEMENT_ABILITY=ShadowbindM2
    +MOVEMENT_ABILITY=ShadowbindMP