XCOM Squadsight Aim Penalty Adjust To Hit Hex Changes

From Nexus Mods Wiki
Jump to: navigation, search

Overview

This contains the hex changes to the function XGAbility_Targeted.AdjustToHit in XcomGame.upk.

This change supports the additional of an aim penalty when using Squadsight.

XCOM_Squadsight_Aim_Penalty_Mod

Hex Change

XGAbility_Targeted.AdjustToHit
original: 07 5E 03 84 2D 01 D2 7B 00 00 18 81 00 99 19 19 19 2E 64 2D 00 00 19 12 20 4F FE FF FF 0A 00 D8 F9 FF FF 00 1C F6 FB FF FF 16 09 00 98 F9 FF FF 00 01 98 F9 FF FF 09 00 71 2D 00 00 00 01 71 2D 00 00 09 00 A3 9C 00 00 00 01 A3 9C 00 00 09 00 B2 9F 00 00 00 01 B2 9F 00 00 2C 02 16 16 04 00 C6 7C 00 00 07 24 04 82 82 19 01 E6 7B 00 00 0A 00 B5 32 00 00 00 1B DB 3D 00 00 00 00 00 00 16 18 23 00 81 19 1B 38 34 00 00 00 00 00 00 16 0A 00 B5 32 00 00 00 1B DB 3D 00 00 00 00 00 00 16 16 16 18 0D 00 97 00 C6 7C 00 00 25 16 16 0F 00 C3 7C 00 00 91 00 C6 7C 00 00 2C 05 16 07 21 04 99 00 C6 7C 00 00 2C 32 16 0F 00 C4 7C 00 00 90 19 19 01 E6 7B 00 00 0A 00 EB B2 00 00 00 1B 0A 34 00 00 00 00 00 00 16 09 00 DB 93 00 00 00 01 DB 93 00 00 2C 0F 16 06 B2 04 07 B2 04 82 81 19 01 E6 7B 00 00 0A 00 B5 32 00 00 00 1B DB 3D 00 00 00 00 00 00 16 16 18 21 00 19 1B 38 34 00 00 00 00 00 00 16 0A 00 B5 32 00 00 00 1B DB 3D 00 00 00 00 00 00 16 16 0F 00 C3 7C 00 00 90 8F 19 19 1B 38 34 00 00 00 00 00 00 16 0A 00 EB B2 00 00 00 1B 0A 34 00 00 00 00 00 00 16 09 00 DC 93 00 00 00 01 DC 93 00 00 16 2C 0A 16 07 F9 04 97 19 19 00 C1 7C 00 00 0A 00 56 94 00 00 00 1B C5 34 00 00 00 00 00 00 16 0A 00 40 AC 00 00 00 1B 95 33 00 00 00 00 00 00 16 2C 04 16 0F 00 C3 7C 00 00 25 0F 00 C2 7C 00 00 FB 92 92 00 C6 7C 00 00 00 C3 7C 00 00 16 00 C4 7C 00 00 16 26 2C 5F 16
new: 0F 01 1A BC 00 00 AC E1 D8 19 01 E6 7B 00 00 0A 00 D7 32 00 00 00 1B FE 32 00 00 00 00 00 00 16 19 1B 38 34 00 00 00 00 00 00 16 0A 00 D7 32 00 00 00 1B FE 32 00 00 00 00 00 00 16 16 16 38 3F 2C 40 16 0F 00 C2 7C 00 00 00 C6 7C 00 00 07 CD 03 B1 01 1A BC 00 00 38 3F 1A 2C 0A 19 01 E6 7B 00 00 09 00 0D 31 00 00 00 01 0D 31 00 00 16 A1 00 C2 7C 00 00 F9 93 93 90 2C 05 F9 36 19 1B 38 34 00 00 00 00 00 00 16 09 00 9A 30 00 00 00 01 9A 30 00 00 2C 05 16 16 2C 19 16 38 44 AB 1E CD CC 8C 3F AF 01 1A BC 00 00 38 3F 1A 2C 0A 19 01 E6 7B 00 00 09 00 0D 31 00 00 00 01 0D 31 00 00 16 16 16 2C 05 16 16 0F 00 C2 7C 00 00 FA 00 C2 7C 00 00 2C 01 16 0B 0B 0B 0B 0B 0B 00 C6 7C 00 00 00 C6 7C 00 00 00 C6 7C 00 00 00 C6 7C 00 00 00 C6 7C 00 00 00 C6 7C 00 00 00 C6 7C 00 00 00 C6 7C 00 00 00 C6 7C 00 00 00 C6 7C 00 00 00 C6 7C 00 00 00 C6 7C 00 00 00 C6 7C 00 00 00 C6 7C 00 00 00 C6 7C 00 00 00 C6 7C 00 00 00 C6 7C 00 00 00 C6 7C 00 00 00 C6 7C 00 00 00 C6 7C 00 00 00 C6 7C 00 00 00 C6 7C 00 00 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B

Decompiled Code

Original Code

	TODO:

New Code

        m_fDistanceToTarget = VSize(m_kUnit.GetLocation() - GetPrimaryTarget().GetLocation()) / float(64);
        iAdjustedHitChance = iHitChance;
        // End:0x3CD
        if(m_fDistanceToTarget > float(m_kUnit.m_aCurrentStats[10]))
        {
            iAdjustedHitChance += Min(((5 * Min(GetPrimaryTarget().m_arrEnemiesSeenBy.Length, 5)) - 25) - int(1.10 * (m_fDistanceToTarget - float(m_kUnit.m_aCurrentStats[10]))), 5);
        }
        iAdjustedHitChance = Max(iAdjustedHitChance, 1);                                                
        iHitChance
        iHitChance
        iHitChance
        iHitChance
        iHitChance
        iHitChance
        iHitChance
        iHitChance
        iHitChance
        iHitChance
        iHitChance
        iHitChance
        iHitChance
        iHitChance
        iHitChance
        iHitChance
        iHitChance
        iHitChance
        iHitChance
        iHitChance
        iHitChance
        iHitChance                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
    }
  

References

Referred to by this article:

That refer to this article:

  • <none>