Strategy Charges File Changes Additional Items Mod XCOM:EU - 2012

From Nexus Mods Wiki
Jump to: navigation, search

Overview

This contains the file changes to show the correct number of charges in the strategy game:

  • In the Barracks/Loadout screen, the number of item icons that show in the soldier's inventory slot
  • In the ItemCard, the number of charges displayed


Back to Additional Items Mod

Details

The number of charges for each item (for display in the strategy game) are set via the function XGSoldierUI.GetItemCharges. The function has a boolean parameter that indicates whether the number of charges is to be used for display in the loadout menu or for an ItemCard.

The difference is that items without any charges such as SCOPEs and Nanofiber Vests, have to return 1 to display 1 icon in the Loadout UI, but return 0 for the ItemCard.

This hex change implements the following changes:

  • Sets number of Arc Thrower charges to 1 unless the soldier has the "Repair" perk, in which case the soldier receives 4 charges
  • Adds a case for item 83 (First Aid Kit) to return 3 charges if the soldier has the "Field Medic" perk
  • Adds cases for items 92, 94, 96, and 89 to return 0 for ItemCard and 1 for Loadout
    • 92 = eItem_SectoidGrenade : intended to function as Laser Sight (+5 Aim)
    • 94 = eItem_MutonGrenade : intended to function as Alien Trophy (+10 Will)
    • 96 = eItem_ThinManGrenade : intended to funcation as Ceramic Plating (+1 HP)
    • 89 = eItem_PlaceholderGrenade0 : currently unused

File Changes

This hex change is applied to the XComStrategyGame.upk


GetItemCharges

XGSoldierUI.GetItemCharges
original: 17 40 00 00 AB 1F 00 00 00 00 00 00 13 40 00 00 00 00 00 00 00 00 00 00 17 40 00 00 00 00 00 00 37 05 00 00 E7 8E 00 00 BB 01 00 00 47 01 00 00 49 02 00 28 15 49 02 00 28 15 07 20 00 9A 38 3A 00 17 40 00 00 38 3A 24 00 16 04 25 05 17 40 00 00 00 00 17 40 00 00 0A 38 00 24 55 0A C5 00 24 58 07 C2 00 19 01 79 3F 00 00 0C 00 97 45 00 00 00 1B 1B 11 00 00 00 00 00 00 2C 18 16 04 19 19 2E 92 FE FF FF 19 12 20 FD FE FF FF 0A 00 3B FB FF FF 00 1C 92 FD FF FF 16 09 00 25 FB FF FF 00 01 25 FB FF FF 09 00 01 FB FF FF 00 01 01 FB FF FF 02 00 01 FB FF FF 00 2C 02 06 AE 01 0A 52 01 24 4C 07 4F 01 19 01 79 3F 00 00 0C 00 97 45 00 00 00 1B 1B 11 00 00 00 00 00 00 2C 30 16 04 19 19 2E 92 FE FF FF 19 12 20 FD FE FF FF 0A 00 3B FB FF FF 00 1C 92 FD FF FF 16 09 00 25 FB FF FF 00 01 25 FB FF FF 09 00 01 FB FF FF 00 01 01 FB FF FF 02 00 01 FB FF FF 00 2C 03 06 AE 01 0A 6D 01 24 63 04 45 2D 00 16 40 00 00 01 00 26 02 00 2C 02 06 AE 01 0A 85 01 24 50 04 45 2D 00 16 40 00 00 01 00 26 02 00 2C 02 0A 8A 01 24 4E 0A 8F 01 24 4F 0A 94 01 24 52 0A AB 01 24 51 04 45 2D 00 15 40 00 00 01 00 25 01 00 26 0A FF FF 04 26 04 3A 14 40 00 00 53
new: 17 40 00 00 AB 1F 00 00 00 00 00 00 13 40 00 00 00 00 00 00 00 00 00 00 17 40 00 00 00 00 00 00 37 05 00 00 E7 8E 00 00 7B 01 00 00 47 01 00 00 49 02 00 28 15 49 02 00 28 15 07 20 00 9A 38 3A 00 17 40 00 00 38 3A 24 00 16 04 25 05 17 40 00 00 00 00 17 40 00 00 0A 62 00 24 50 07 5F 00 19 01 79 3F 00 00 0C 00 97 45 00 00 00 1B 1B 11 00 00 00 00 00 00 2C 67 16 04 2C 04 06 44 01 0A 67 00 24 55 0A 96 00 24 58 07 93 00 19 01 79 3F 00 00 0C 00 97 45 00 00 00 1B 1B 11 00 00 00 00 00 00 2C 18 16 04 2C 02 06 44 01 0A C5 00 24 53 07 C2 00 19 01 79 3F 00 00 0C 00 97 45 00 00 00 1B 1B 11 00 00 00 00 00 00 2C 30 16 04 2C 03 06 44 01 0A F4 00 24 4C 07 F1 00 19 01 79 3F 00 00 0C 00 97 45 00 00 00 1B 1B 11 00 00 00 00 00 00 2C 30 16 04 2C 03 06 44 01 0A 0C 01 24 63 04 45 2D 00 16 40 00 00 01 00 26 02 00 2C 02 0A 11 01 24 5C 0A 16 01 24 5E 0A 1B 01 24 60 0A 20 01 24 59 0A 25 01 24 4F 0A 2A 01 24 52 0A 41 01 24 51 04 45 2D 00 15 40 00 00 01 00 25 01 00 26 0A FF FF 04 26 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 53

Decompiled Code

XGSoldierUI.GetItemCharges

Original Code
noexport function int GetItemCharges(XComGame.XGGameData.EItemType eItem, optional bool bForce1_for_NonGrenades, optional bool bForItemCardDisplay)
{
	bForce1_for_NonGrenades = false;
	bForItemCardDisplay = false;
	// End:0x20 Loop:False
	if(eItem == 0)
	{
		return 0;
	}
	// ObjectIndex:16407 BlockSize:0
	switch(eItem)
	{
		// End:0x38
		case 85:
		// End:0xc5
		case 88:
			// End:0xc2 Loop:False
			if(m_kSoldier.HasPerk(24))
			{
				return XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.2;
			}
			// End:0x1ae
			break;
		// End:0x152
		case 76:
			// End:0x14f Loop:False
			if(m_kSoldier.HasPerk(48))
			{
				return XComGameReplicationInfo(class'Engine'.static.GetCurrentWorldInfo().GRI).m_kGameCore.3;
			}
			// End:0x1ae
			break;
		// End:0x16d
		case 99:
			return ((bForce1_for_NonGrenades) ? 1 : 2);
			// End:0x1ae
			break;
		// End:0x185
		case 80:
			return ((bForce1_for_NonGrenades) ? 1 : 2);
		// End:0x18a
		case 78:
		// End:0x18f
		case 79:
		// End:0x194
		case 82:
		// End:0x1ab
		case 81:
			return ((bForItemCardDisplay) ? 0 : 1);
		// End:0xffff
		default:
			return 1;
	}
}

New Code
 
function int GetItemCharges(XComGame.XGGameData.EItemType eItem, optional bool bForce1_for_NonGrenades, optional bool bForItemCardDisplay)
{
    bForce1_for_NonGrenades = false;
    bForItemCardDisplay = false;
    // End:0x20
    if(eItem == 0)
    {
        return 0;
    }
    switch(eItem)
    {
        // End:0x62
        case 80:
            // End:0x5F
            if(m_kSoldier.HasPerk(103))
            {
                return 4;
            }
            // End:0x144
            break;
        // End:0x67
        case 85:
        // End:0x96
        case 88:
            // End:0x93
            if(m_kSoldier.HasPerk(24))
            {
                return 2;
            }
            // End:0x144
            break;
        // End:0xC5
        case 83:
            // End:0xC2
            if(m_kSoldier.HasPerk(48))
            {
                return 3;
            }
            // End:0x144
            break;
        // End:0xF4
        case 76:
            // End:0xF1
            if(m_kSoldier.HasPerk(48))
            {
                return 3;
            }
            // End:0x144
            break;
        // End:0x10C
        case 99:
            return ((bForce1_for_NonGrenades) ? 1 : 2);
        // End:0x111
        case 92:
        // End:0x116
        case 94:
        // End:0x11B
        case 96:
        // End:0x120
        case 89:
        // End:0x125
        case 79:
        // End:0x12A
        case 82:
        // End:0x141
        case 81:
            return ((bForItemCardDisplay) ? 0 : 1);
        // End:0xFFFF
        default:
            return 1;
    }                                                                                                                                                                                                                    
}
 


References

Referred to by this article:

That refer to this article:

  • <none>