Jump to content

Merit-based class assignment restoration project


Amphibious

Recommended Posts

I want to rewrite the following function:

 

// kSoldier.m_kChar.aStats[7] = class'XGTacticalGameCore'.default.ROOKIE_STARTING_WILL + Rand(11);
0F 1A 2C 07 35 <XComGame.XGTacticalGameCoreNativeBase.TCharacter.aStats> <XComGame.XGTacticalGameCoreNativeBase.TCharacter> 00 01 19 00 <.kSoldier> 09 00 <XGStrategySoldier.m_kChar> 00 01 <XGStrategySoldier.m_kChar>
92 12 20 <Class.XComGame.XGTacticalGameCore> 09 00 <XComGame.XGTacticalGameCoreNativeBase.ROOKIE_STARTING_WILL> 00 02 <XComGame.XGTacticalGameCoreNativeBase.ROOKIE_STARTING_WILL> A7 2C 0B 16 16

 

 

to be kSoldier.m_kChar.aStats[7] = class'XGTacticalGameCore'.default.ROOKIE_STARTING_WILL + 2 * Rand(6);

 

However I'm not sure about order of operators and not to break other stuff.

 

Does this look right?

 

// kSoldier.m_kChar.aStats[7] = class'XGTacticalGameCore'.default.ROOKIE_STARTING_WILL + 2 x Rand(6);
0F 1A 2C 07 35 <XComGame.XGTacticalGameCoreNativeBase.TCharacter.aStats> <XComGame.XGTacticalGameCoreNativeBase.TCharacter> 00 01 19 00 <.kSoldier> 09 00 <XGStrategySoldier.m_kChar> 00 01 <XGStrategySoldier.m_kChar>
92 90 A7 2C 06 16 16 12 20 <Class.XComGame.XGTacticalGameCore> 09 00 <XComGame.XGTacticalGameCoreNativeBase.ROOKIE_STARTING_WILL> 00 02 <XComGame.XGTacticalGameCoreNativeBase.ROOKIE_STARTING_WILL> 16

 

6

Link to comment
Share on other sites

I can't see multiplication by 2 in your code:

92 // +
    90 // *
        A7 2C 06 16 // Rand(6)
    16 // end *
    12 20 <Class.XComGame.XGTacticalGameCore> 09 00 <XComGame.XGTacticalGameCoreNativeBase.ROOKIE_STARTING_WILL> 00 02 <XComGame.XGTacticalGameCoreNativeBase.ROOKIE_STARTING_WILL>
16 // end +
Edited by wghost81
Link to comment
Share on other sites

Hmm, you're right. It strang ethe game didn't crash then. I altered the code, could you please test it out if you have the time. It seems everything is ok (no crashes) but I'm not sure if it works actually.

 

 

UPK_FILE=XComStrategyGame.upk


OBJECT=XGFacility_Barracks.GetLeastCommonClass:AUTO

[REPLACEMENT_CODE]
// iClasses[0] = 0;
0F 10 2C 00 00 <.iClasses> 2C 00
// iClasses[1] = 0;
0F 10 2C 01 00 <.iClasses> 2C 00
// iClasses[2] = 0;
0F 10 2C 02 00 <.iClasses> 2C 00
// iClasses[3] = 0;
0F 10 2C 03 00 <.iClasses> 2C 00
// iClasses[4] = 0;
0F 10 2C 04 00 <.iClasses> 2C 00

// I = 0;
0F 00 <.I> 2C 00

// if(I < m_arrSoldiers.Length) {
[#ForeachSoldier_WHILE]
07 [@ForeachSoldier_END] 96 00 <.I> 36 01 <@m_arrSoldiers> 16

// if(!m_arrSoldiers.IsATank()) {
07 [@NotSHIV_END] 81 19 10 00 <.I> 01 <@m_arrSoldiers> 0A 00 <XGStrategySoldier.IsATank.ReturnValue> 00 1B <IsATank> 16 16
// if(m_arrSoldiers.GetClass() < 5) {
07 [@RookieClassOption_END] 96 19 10 00 <.I> 01 <@m_arrSoldiers> 0A 00 <XGStrategySoldier.GetClass.ReturnValue> 00 1B <GetClass> 16 2C 05 16

// ++ iClasses[m_arrSoldiers.GetClass()];
A5 10 38 3A 19 10 00 <.I> 01 <@m_arrSoldiers> 0A 00 <XGStrategySoldier.GetClass.ReturnValue> 00 1B <GetClass> 16 00 <.iClasses> 16

// }
[#RookieClassOption_END]

// }
[#NotSHIV_END]

// ++ I;
A5 00 <.I> 16

06 [@ForeachSoldier_WHILE]
// }
[#ForeachSoldier_END]

// best = 999;
0F 00 <.best> 1D E7 03 00 00

// bestClass = 0;
0F 00 <.bestClass> 2C 00

// I = 1;
0F 00 <.I> 2C 01

// if(I < 5) {
[#ForeachClass1_WHILE]
07 [@ForeachClass1_END] 96 00 <.I> 2C 05 16

// if (m_arrClassWaitingList.Find(I) != -1) {
07 [@FoundClassInList_False] 9B 46 01 <@m_arrClassWaitingList> 0A 00 00 <.I> 16 1D FF FF FF FF 16

// if (iClasses < best) {
07 [@LargestClass_END] 96 10 00 <.I> 00 <.iClasses> 00 <.best> 16

// best = iClasses
0F 00 <.best> 10 00 <.I> 00 <.iClasses>

// bestClass = I;
0F 00 <.bestClass> 00 <.I>

// }
[#LargestClass_END]

06 [@FoundClassInList_END]

// } else {
[#FoundClassInList_False]

// iClasses = -1;
0F 10 00 <.I> 00 <.iClasses> 1D FF FF FF FF

// }
[#FoundClassInList_END]


// ++ I;
A5 00 <.I> 16

06 [@ForeachClass1_WHILE]
// }
[#ForeachClass1_END]

// if (bestClass > 0) {
07 [@FoundClassToDrop_END] 97 00 <.bestClass> 2C 00 16

// best += (m_arrSoldiers.Length / 10);
A1 00 <.best> 91 36 01 <@m_arrSoldiers> 2C 0A 16 16

// I = 1;
0F 00 <.I> 2C 01

// if(I < 5) {
[#ForeachClass2_WHILE]
07 [@ForEachClass2_END] 96 00 <.I> 2C 05 16

// if (iClasses > best) {
07 [@LargestClass2_END] 97 10 00 <.I> 00 <.iClasses> 00 <.best> 16

// m_arrClassWaitingList.RemoveItem(I);
56 01 <@m_arrClassWaitingList> 03 00 00 <.I> 16

// }
[#LargestClass2_END]

// ++ I;
A5 00 <.I> 16

06 [@ForeachClass2_WHILE]
// }
[#ForEachClass2_END]

// }
[#FoundClassToDrop_END]

// return 4;
04 2C 04

// return ReturnValue;
04 3A <XGFacility_Barracks.GetLeastCommonClass.ReturnValue>

// EOS
53


OBJECT=XGFacility_Barracks.DEMOAddNewSoldiers:AUTO

[REPLACEMENT_CODE]
// m_arrClassWaitingList.Length = 0;
0F 36 01 <@m_arrClassWaitingList> 2C 00

// kSoldier = GetSoldierByID(iNumSoldiers)
0F 00 <.kSoldier> 1B <GetSoldierByID> 00 <.iNumSoldiers> 16

// if (kSoldier != none) {
07 [@SoldierFound_END] 77 00 <.kSoldier> 2A 16

// if (kSoldier.m_kChar.aStats[1] > 70) {
07 [@Aim68] 97 1A 2C 01 35 <XComGame.XGTacticalGameCoreNativeBase.TCharacter.aStats> <XComGame.XGTacticalGameCoreNativeBase.TCharacter> 00 01 19 00 <.kSoldier> 09 00 <XGStrategySoldier.m_kChar> 00 01 <XGStrategySoldier.m_kChar> 2C 46 16

// if (kSoldier.m_kChar.aStats[3] > 11) {
07 [@Aim76_Mid] 97 1A 2C 03 35 <XComGame.XGTacticalGameCoreNativeBase.TCharacter.aStats> <XComGame.XGTacticalGameCoreNativeBase.TCharacter> 00 01 19 00 <.kSoldier> 09 00 <XGStrategySoldier.m_kChar> 00 01 <XGStrategySoldier.m_kChar> 2C 0B 16

// m_arrClassWaitingList.add(1);
55 01 <@m_arrClassWaitingList> 03 00 2C 01 16
// m_arrClassWaitingList.add(1);
55 01 <@m_arrClassWaitingList> 03 00 2C 01 16
// m_arrClassWaitingList.add(1);
55 01 <@m_arrClassWaitingList> 03 00 2C 01 16
// m_arrClassWaitingList.add(4);
55 01 <@m_arrClassWaitingList> 03 00 2C 04 16
// m_arrClassWaitingList.add(4);
55 01 <@m_arrClassWaitingList> 03 00 2C 04 16

06 [@Aim76_END]
// } else if (kSoldier.m_kChar.aStats[3] == 11) {
[#Aim76_Mid]
07 [@Aim76_Low] 9A 1A 2C 03 35 <XComGame.XGTacticalGameCoreNativeBase.TCharacter.aStats> <XComGame.XGTacticalGameCoreNativeBase.TCharacter> 00 01 19 00 <.kSoldier> 09 00 <XGStrategySoldier.m_kChar> 00 01 <XGStrategySoldier.m_kChar> 2C 0B 16

// m_arrClassWaitingList.add(1);
55 01 <@m_arrClassWaitingList> 03 00 2C 01 16
// m_arrClassWaitingList.add(1);
55 01 <@m_arrClassWaitingList> 03 00 2C 01 16
// m_arrClassWaitingList.add(2);
55 01 <@m_arrClassWaitingList> 03 00 2C 02 16

06 [@Aim76_END]
// } else {
[#Aim76_Low]
// m_arrClassWaitingList.Length = 1;
0F 36 01 <@m_arrClassWaitingList> 2C 01
// m_arrClassWaitingList[0] = 1;
0F 10 25 01 <@m_arrClassWaitingList> 2C 01
// }
[#Aim76_END]

// }
06 [@Aim_END]

// else if (kSoldier.m_kChar.aStats[1] > 62) {
[#Aim68]
07 [@Aim60] 97 1A 2C 01 35 <XComGame.XGTacticalGameCoreNativeBase.TCharacter.aStats> <XComGame.XGTacticalGameCoreNativeBase.TCharacter> 00 01 19 00 <.kSoldier> 09 00 <XGStrategySoldier.m_kChar> 00 01 <XGStrategySoldier.m_kChar> 2C 3E 16
// if (kSoldier.m_kChar.aStats[3] == 13) {
07 [@Aim68_Mid] 9A 1A 2C 03 35 <XComGame.XGTacticalGameCoreNativeBase.TCharacter.aStats> <XComGame.XGTacticalGameCoreNativeBase.TCharacter> 00 01 19 00 <.kSoldier> 09 00 <XGStrategySoldier.m_kChar> 00 01 <XGStrategySoldier.m_kChar> 2C 0D 16

// m_arrClassWaitingList.add(1);
55 01 <@m_arrClassWaitingList> 03 00 2C 01 16
// m_arrClassWaitingList.add(2);
55 01 <@m_arrClassWaitingList> 03 00 2C 02 16
// m_arrClassWaitingList.add(2);
55 01 <@m_arrClassWaitingList> 03 00 2C 02 16
// m_arrClassWaitingList.add(4);
55 01 <@m_arrClassWaitingList> 03 00 2C 04 16
// m_arrClassWaitingList.add(4);
55 01 <@m_arrClassWaitingList> 03 00 2C 04 16
// m_arrClassWaitingList.add(4);
55 01 <@m_arrClassWaitingList> 03 00 2C 04 16

06 [@Aim68_END]
// } else if (kSoldier.m_kChar.aStats[3] < 13) {
[#Aim68_Mid]
07 [@Aim68_Low] 96 1A 2C 03 35 <XComGame.XGTacticalGameCoreNativeBase.TCharacter.aStats> <XComGame.XGTacticalGameCoreNativeBase.TCharacter> 00 01 19 00 <.kSoldier> 09 00 <XGStrategySoldier.m_kChar> 00 01 <XGStrategySoldier.m_kChar> 2C 0D 16

// m_arrClassWaitingList.add(1);
55 01 <@m_arrClassWaitingList> 03 00 2C 01 16
// m_arrClassWaitingList.add(2);
55 01 <@m_arrClassWaitingList> 03 00 2C 02 16
// m_arrClassWaitingList.add(2);
55 01 <@m_arrClassWaitingList> 03 00 2C 02 16
// m_arrClassWaitingList.add(4);
55 01 <@m_arrClassWaitingList> 03 00 2C 04 16
// m_arrClassWaitingList.add(4);
55 01 <@m_arrClassWaitingList> 03 00 2C 04 16

06 [@Aim68_END]
// } else {
[#Aim68_Low]
// m_arrClassWaitingList.Length = 1;
0F 36 01 <@m_arrClassWaitingList> 2C 01
// m_arrClassWaitingList[0] = 2;
0F 10 25 01 <@m_arrClassWaitingList> 2C 02
// }
[#Aim68_END]

// }
06 [@Aim_END]

// else if (kSoldier.m_kChar.aStats[1] > 54) {
[#Aim60]
07 [@AimOther] 97 1A 2C 01 35 <XComGame.XGTacticalGameCoreNativeBase.TCharacter.aStats> <XComGame.XGTacticalGameCoreNativeBase.TCharacter> 00 01 19 00 <.kSoldier> 09 00 <XGStrategySoldier.m_kChar> 00 01 <XGStrategySoldier.m_kChar> 2C 36 16
// if (kSoldier.m_kChar.aStats[3] > 11) {
07 [@Aim60_Mid] 97 1A 2C 03 35 <XComGame.XGTacticalGameCoreNativeBase.TCharacter.aStats> <XComGame.XGTacticalGameCoreNativeBase.TCharacter> 00 01 19 00 <.kSoldier> 09 00 <XGStrategySoldier.m_kChar> 00 01 <XGStrategySoldier.m_kChar> 2C 0B 16

// m_arrClassWaitingList.add(2);
55 01 <@m_arrClassWaitingList> 03 00 2C 02 16
// m_arrClassWaitingList.add(2);
55 01 <@m_arrClassWaitingList> 03 00 2C 02 16
// m_arrClassWaitingList.add(3);
55 01 <@m_arrClassWaitingList> 03 00 2C 03 16
// m_arrClassWaitingList.add(4);
55 01 <@m_arrClassWaitingList> 03 00 2C 04 16
// m_arrClassWaitingList.add(4);
55 01 <@m_arrClassWaitingList> 03 00 2C 04 16

06 [@Aim60_END]
// } else if (kSoldier.m_kChar.aStats[3] == 11) {
[#Aim60_Mid]
07 [@Aim60_Low] 9A 1A 2C 03 35 <XComGame.XGTacticalGameCoreNativeBase.TCharacter.aStats> <XComGame.XGTacticalGameCoreNativeBase.TCharacter> 00 01 19 00 <.kSoldier> 09 00 <XGStrategySoldier.m_kChar> 00 01 <XGStrategySoldier.m_kChar> 2C 0B 16

// m_arrClassWaitingList.add(2);
55 01 <@m_arrClassWaitingList> 03 00 2C 02 16
// m_arrClassWaitingList.add(2);
55 01 <@m_arrClassWaitingList> 03 00 2C 02 16
// m_arrClassWaitingList.add(2);
55 01 <@m_arrClassWaitingList> 03 00 2C 02 16
// m_arrClassWaitingList.add(3);
55 01 <@m_arrClassWaitingList> 03 00 2C 03 16
// m_arrClassWaitingList.add(4);
55 01 <@m_arrClassWaitingList> 03 00 2C 04 16
// m_arrClassWaitingList.add(4);
55 01 <@m_arrClassWaitingList> 03 00 2C 04 16

06 [@Aim60_END]
// } else {
[#Aim60_Low]
// m_arrClassWaitingList.Length = 1;
0F 36 01 <@m_arrClassWaitingList> 2C 01
// m_arrClassWaitingList[0] = 3;
0F 10 25 01 <@m_arrClassWaitingList> 2C 03
// }
[#Aim60_END]

// }
06 [@Aim_END]

// else {
[#AimOther]
// if (kSoldier.m_kChar.aStats[3] > 12) {
07 [@AimOther_Low] 97 1A 2C 03 35 <XComGame.XGTacticalGameCoreNativeBase.TCharacter.aStats> <XComGame.XGTacticalGameCoreNativeBase.TCharacter> 00 01 19 00 <.kSoldier> 09 00 <XGStrategySoldier.m_kChar> 00 01 <XGStrategySoldier.m_kChar> 2C 0C 16

// m_arrClassWaitingList.add(3);
55 01 <@m_arrClassWaitingList> 03 00 2C 03 16
// m_arrClassWaitingList.add(3);
55 01 <@m_arrClassWaitingList> 03 00 2C 03 16
// m_arrClassWaitingList.add(4);
55 01 <@m_arrClassWaitingList> 03 00 2C 04 16

06 [@AimOther_END]
// } else {
[#AimOther_Low]

// m_arrClassWaitingList.add(2);
55 01 <@m_arrClassWaitingList> 03 00 2C 02 16
// m_arrClassWaitingList.add(2);
55 01 <@m_arrClassWaitingList> 03 00 2C 02 16
// m_arrClassWaitingList.add(3);
55 01 <@m_arrClassWaitingList> 03 00 2C 03 16
// m_arrClassWaitingList.add(3);
55 01 <@m_arrClassWaitingList> 03 00 2C 03 16
// m_arrClassWaitingList.add(3);
55 01 <@m_arrClassWaitingList> 03 00 2C 03 16

// }
[#AimOther_END]

// }
[#Aim_END]

// if (m_arrClassWaitingList.length > 1) {
07 [@EmptyWaitingList_END] 97 36 01 <@m_arrClassWaitingList> 2C 01 16
// GetLeastCommonClass();
1B <GetLeastCommonClass> 16
// }
[#EmptyWaitingList_END]

// }
[#SoldierFound_END]



// return
04 0B

// EOS
53


OBJECT=XGFacility_Barracks.PickAClass:AUTO

[REPLACEMENT_CODE]
// chosenClass = 0;
0F 00 <.chosenClass> 2C 00

// if(!IsOptionEnabled(2)) {
07 [@SwNce_END] 81 1B <IsOptionEnabled> 24 02 16 16

// chosenClass = NeverGiven();
0F 00 <.chosenClass> 1B <NeverGiven> 16

// }
[#SwNce_END]

// if(chosenClass == 0) {
07 [@NoChosenClass_END] 9A 00 <.chosenClass> 2C 00 16

// if(m_arrClassWaitingList.Length == 0) {
07 [@EmptyWaitingList_END] 9A 36 01 <@m_arrClassWaitingList> 2C 00 16
// CreateClassWaitingList();
1C <@CreateClassWaitingList> 16
// }
[#EmptyWaitingList_END]

// I = Rand(m_arrClassWaitingList.Length);
0F 00 <.I> A7 36 01 <@m_arrClassWaitingList> 16

// chosenClass = m_arrClassWaitingList;
0F 00 <.chosenClass> 10 00 <.I> 01 <@m_arrClassWaitingList>

// m_arrClassWaitingList.length = 0;
0F 36 01 <@m_arrClassWaitingList> 2C 00
// }
[#NoChosenClass_END]

// return chosenClass;
04 00 <.chosenClass>

// return ReturnValue;
04 3A <XGFacility_Barracks.PickAClass.ReturnValue>

// EOS
53


OBJECT=XGStrategySoldier.LevelUp:AUTO

[REPLACEMENT_CODE]
0B 0B

// if(m_kSoldier.iRank == 0) {
07 [@Rank0_END] 9A 35 <XComGame.XGTacticalGameCoreNativeBase.TSoldier.iRank> <XComGame.XGTacticalGameCoreNativeBase.TSoldier> 00 00 01 <@m_kSoldier> 25 16
// if(eClass == 0) {
07 [@Rank0_NoClass_END] 9A 38 3A 00 <.eClass> 38 3A 24 00 16

//if(IsOptionEnabled(2)) {
07 [@SwNce_END] 1B <IsOptionEnabled> 24 02 16
// BARRACKS().DEMOAddNewSoldiers(m_kSoldier.iID);
19 1B <BARRACKS> 16 26 00 <NullRef> 00
1B <DEMOAddNewSoldiers>
35 <XComGame.XGTacticalGameCoreNativeBase.TSoldier.iID> <XComGame.XGTacticalGameCoreNativeBase.TSoldier> 00 00 01 <@m_kSoldier>
16
//}
[#SwNce_END]

// eClass = BARRACKS().PickAClass();
0F 00 <.eClass> 19 1B <BARRACKS> 16 0A 00 <XGFacility_Barracks.PickAClass.ReturnValue> 00 1B <PickAClass> 16

// }
[#Rank0_NoClass_END]
// SetSoldierClass(eClass);
1B <SetSoldierClass> 00 <.eClass> 16
// }
[#Rank0_END]

// m_kSoldier.iRank += 1;
A1 35 <XComGame.XGTacticalGameCoreNativeBase.TSoldier.iRank> <XComGame.XGTacticalGameCoreNativeBase.TSoldier> 00 01 01 <@m_kSoldier> 26 16

// if(m_kSoldier.iRank == 3) {
07 [@Rank3_END] 9A 35 <XComGame.XGTacticalGameCoreNativeBase.TSoldier.iRank> <XComGame.XGTacticalGameCoreNativeBase.TSoldier> 00 00 01 <@m_kSoldier> 2C 03 16
// BARRACKS().GenerateNewNickname(self);
19 1B <BARRACKS> 16 0B 00 <NullRef> 00 1B <GenerateNewNickname> 17 16
// }
[#Rank3_END]

// if(m_kSoldier.iRank == 7) {
07 [@Rank7_END] 9A 35 <XComGame.XGTacticalGameCoreNativeBase.TSoldier.iRank> <XComGame.XGTacticalGameCoreNativeBase.TSoldier> 00 00 01 <@m_kSoldier> 2C 07 16
// Achieve(29);
1B <Achieve> 24 1D 16
// }
[#Rank7_END]

// LevelUpStats(statsString);
1B <LevelUpStats> 48 <.statsString> 16

// if(m_kSoldier.iXP < TACTICAL().GetXPRequired(GetRank())) {
07 [@XPRequired_END]
96
35 <XComGame.XGTacticalGameCoreNativeBase.TSoldier.iXP> <XComGame.XGTacticalGameCoreNativeBase.TSoldier> 00 00 01 <@m_kSoldier>
19 1B <TACTICAL> 16 14 00 <XComGame.XGTacticalGameCore.GetXPRequired.ReturnValue> 00
1B <GetXPRequired> 1B <GetRank> 16 16
16
// m_kSoldier.iXP = TACTICAL().GetXPRequired(GetRank());
0F 35 <XComGame.XGTacticalGameCoreNativeBase.TSoldier.iXP> <XComGame.XGTacticalGameCoreNativeBase.TSoldier> 00 01 01 <@m_kSoldier>
19 1B <TACTICAL> 16 14 00 <XComGame.XGTacticalGameCore.GetXPRequired.ReturnValue> 00
1B <GetXPRequired> 1B <GetRank> 16
16
// }
[#XPRequired_END]

// BARRACKS().ReorderRanks();
19 1B <BARRACKS> 16 0A 00 <NullRef> 00 1B <ReorderRanks> 16

// if(m_kSoldier.iRank > BARRACKS().m_iHighestRank) {
07 [@HighRank_END]
97
35 <XComGame.XGTacticalGameCoreNativeBase.TSoldier.iRank> <XComGame.XGTacticalGameCoreNativeBase.TSoldier> 00 00 01 <@m_kSoldier>
19 1B <BARRACKS> 16 09 00 <XGFacility_Barracks.m_iHighestRank> 00 01 <XGFacility_Barracks.m_iHighestRank>
16

// BARRACKS().m_iHighestRank = m_kSoldier.iRank;
0F 19 1B <BARRACKS> 16 09 00 <XGFacility_Barracks.m_iHighestRank> 00 01 <XGFacility_Barracks.m_iHighestRank>
35 <XComGame.XGTacticalGameCoreNativeBase.TSoldier.iRank> <XComGame.XGTacticalGameCoreNativeBase.TSoldier> 00 00 01 <@m_kSoldier>

// if(m_kSoldier.iRank == 7) {
07 [@HighRank_Rank7_END] 9A 35 <XComGame.XGTacticalGameCoreNativeBase.TSoldier.iRank> <XComGame.XGTacticalGameCoreNativeBase.TSoldier> 00 00 01 <@m_kSoldier> 2C 07 16
// STAT_SetStat(15, Game().GetDays());
1B <STAT_SetStat>
24 0F
19 1B <Game> 16 0A 00 <XGStrategy.GetDays.ReturnValue> 00 1B <GetDays> 16
16
// }
[#HighRank_Rank7_END]
// }
[#HighRank_END]

// if(IsAugmented()) {
07 [@Augmented_END] 1B <IsAugmented> 16
// if(m_kSoldier.iRank > BARRACKS().m_iHighestMecRank) {
07 [@HighMecRank_END]
97
35 <XComGame.XGTacticalGameCoreNativeBase.TSoldier.iRank> <XComGame.XGTacticalGameCoreNativeBase.TSoldier> 00 00 01 <@m_kSoldier>
19 1B <BARRACKS> 16 09 00 <XGFacility_Barracks.m_iHighestMecRank> 00 01 <XGFacility_Barracks.m_iHighestMecRank>
16

// BARRACKS().m_iHighestMecRank = m_kSoldier.iRank;
0F
19 1B <BARRACKS> 16 09 00 <XGFacility_Barracks.m_iHighestMecRank> 00 01 <XGFacility_Barracks.m_iHighestMecRank>
35 <XComGame.XGTacticalGameCoreNativeBase.TSoldier.iRank> <XComGame.XGTacticalGameCoreNativeBase.TSoldier> 00 00 01 <@m_kSoldier>
// }
[#HighMecRank_END]
// }
[#Augmented_END]

// if((STAT_GetStat(95)) < BARRACKS().GetNumVeterans()) {
07 [@NumVets_END]
96
1B <STAT_GetStat> 24 5F 16
19 1B <BARRACKS> 16 0A 00 <XGFacility_Barracks.GetNumVeterans.ReturnValue> 00 1B <GetNumVeterans> 16
16

// STAT_SetStat(95, BARRACKS().GetNumVeterans());
1B <STAT_SetStat>
24 5F
19 1B <BARRACKS> 16 0A 00 <XGFacility_Barracks.GetNumVeterans.ReturnValue> 00 1B <GetNumVeterans> 16
16
// }
[#NumVets_END]

// return;
04 0B

//EOS
53


OBJECT=XGFundingCouncil.RewardSoldier:AUTO

[bEFORE_CODE]
// iClass = BARRACKS().PickAClass();
0F 00 <.iClass> 38 3A 19 1B <BARRACKS> 16 0A 00 <XGFacility_Barracks.PickAClass.ReturnValue> 00 1B <PickAClass> 16

[AFTER_CODE]
// iClass = BARRACKS().PickRewardSoldierClass();
0F 00 <.iClass> 38 3A 19 1B <BARRACKS> 16 0A 00 <XGFacility_Barracks.PickRewardSoldierClass.ReturnValue> 00 1B <PickRewardSoldierClass> 16


OBJECT=XGFacility_Barracks.CreateSoldier:AUTO

[REPLACEMENT_CODE]
49 02 00 28 15

// kSoldier = Spawn(class'XGStrategySoldier');
0F 00 <.kSoldier> 1C <Engine.Actor.Spawn> 20 <Class.XGStrategySoldier> 4A 4A 4A 4A 4A 4A 4A 16

// kSoldier.m_kSoldier = m_kCharGen.CreateTSoldier(,, iCountry);
0F 19 00 <.kSoldier> 09 00 <XGStrategySoldier.m_kSoldier> 00 01 <XGStrategySoldier.m_kSoldier>
19 01 <@m_kCharGen> 16 00 <XComGame.XGCharacterGenerator.CreateTSoldier.ReturnValue> 00
1B <CreateTSoldier> 4A 00 <.iCountry> 4A 4A 16

// kSoldier.m_kSoldier.bBlueshirt = bBlueshirt;
14 2D 35 <XComGame.XGTacticalGameCoreNativeBase.TSoldier.bBlueshirt> <XComGame.XGTacticalGameCoreNativeBase.TSoldier> 00 01
19 00 <.kSoldier> 09 00 <XGStrategySoldier.m_kSoldier> 00 01 <XGStrategySoldier.m_kSoldier>
2D 00 <.bBlueshirt>

// kSoldier.m_kChar = TACTICAL().GetTCharacter(2);
0F 19 00 <.kSoldier> 09 00 <XGStrategySoldier.m_kChar> 00 01 <XGStrategySoldier.m_kChar>
19 1B <TACTICAL> 16 0C 00 <XComGame.XGTacticalGameCoreNativeBase.GetTCharacter.ReturnValue> 00
1B <GetTCharacter> 2C 02 16

// RandomizeStats(kSoldier);
1B <RandomizeStats> 00 <.kSoldier> 16

//if(IsOptionEnabled(2)) {
07 [@SwNce_END] 1B <IsOptionEnabled> 24 02 16

// switch (eClass) {
05 <.eClass> 00 00 <.eClass>
// case 1:
0A [@PreCreatedSoldier_2] 26
// kSoldier.m_kChar.aStats[1] = (class'XGTacticalGameCore'.default.ROOKIE_AIM + 11) + Rand(5);
0F 1A 26 35 <XComGame.XGTacticalGameCoreNativeBase.TCharacter.aStats> <XComGame.XGTacticalGameCoreNativeBase.TCharacter> 00 01 19 00 <.kSoldier> 09 00 <XGStrategySoldier.m_kChar> 00 01 <XGStrategySoldier.m_kChar>
92 92 12 20 <Class.XComGame.XGTacticalGameCore> 09 00 <XComGame.XGTacticalGameCoreNativeBase.ROOKIE_AIM> 00 02 <XComGame.XGTacticalGameCoreNativeBase.ROOKIE_AIM> 2C 0B 16 A7 2C 05 16 16

// break;
06 [@PreCreatedSoldier_END]
// case 2:
[#PreCreatedSoldier_2]
0A [@PreCreatedSoldier_3] 2C 02
// kSoldier.m_kChar.aStats[1] = class'XGTacticalGameCore'.default.ROOKIE_AIM + Rand(11);
0F 1A 2C 01 35 <XComGame.XGTacticalGameCoreNativeBase.TCharacter.aStats> <XComGame.XGTacticalGameCoreNativeBase.TCharacter> 00 01 19 00 <.kSoldier> 09 00 <XGStrategySoldier.m_kChar> 00 01 <XGStrategySoldier.m_kChar>
92 12 20 <Class.XComGame.XGTacticalGameCore> 09 00 <XComGame.XGTacticalGameCoreNativeBase.ROOKIE_AIM> 00 02 <XComGame.XGTacticalGameCoreNativeBase.ROOKIE_AIM> A7 2C 0B 16 16

// kSoldier.m_kChar.aStats[7] = class'XGTacticalGameCore'.default.ROOKIE_STARTING_WILL + 2 x Rand(6);
0F 1A 2C 07 35 <XComGame.XGTacticalGameCoreNativeBase.TCharacter.aStats> <XComGame.XGTacticalGameCoreNativeBase.TCharacter> 00 01 19 00 <.kSoldier> 09 00 <XGStrategySoldier.m_kChar> 00 01 <XGStrategySoldier.m_kChar>
92 12 20 <Class.XComGame.XGTacticalGameCore> 09 00 <XComGame.XGTacticalGameCoreNativeBase.ROOKIE_STARTING_WILL> 00 02 <XComGame.XGTacticalGameCoreNativeBase.ROOKIE_STARTING_WILL> 90 2C 02 A7 2C 06 16 16 16

// break;
06 [@PreCreatedSoldier_END]
// case 3:
[#PreCreatedSoldier_3]
0A [@PreCreatedSoldier_4] 2C 03
// kSoldier.m_kChar.aStats[3] = class'XGTacticalGameCore'.default.ROOKIE_MOBILITY + 1 ;
0F 1A 2C 03 35 <XComGame.XGTacticalGameCoreNativeBase.TCharacter.aStats> <XComGame.XGTacticalGameCoreNativeBase.TCharacter> 00 01 19 00 <.kSoldier> 09 00 <XGStrategySoldier.m_kChar> 00 01 <XGStrategySoldier.m_kChar>
92 12 20 <Class.XComGame.XGTacticalGameCore> 09 00 <XComGame.XGTacticalGameCoreNativeBase.ROOKIE_MOBILITY> 00 02 <XComGame.XGTacticalGameCoreNativeBase.ROOKIE_MOBILITY> 26 16

// kSoldier.m_kChar.aStats[7] = class'XGTacticalGameCore'.default.ROOKIE_STARTING_WILL + 2 x Rand(6);
0F 1A 2C 07 35 <XComGame.XGTacticalGameCoreNativeBase.TCharacter.aStats> <XComGame.XGTacticalGameCoreNativeBase.TCharacter> 00 01 19 00 <.kSoldier> 09 00 <XGStrategySoldier.m_kChar> 00 01 <XGStrategySoldier.m_kChar>
92 12 20 <Class.XComGame.XGTacticalGameCore> 09 00 <XComGame.XGTacticalGameCoreNativeBase.ROOKIE_STARTING_WILL> 00 02 <XComGame.XGTacticalGameCoreNativeBase.ROOKIE_STARTING_WILL> 90 2C 02 A7 2C 06 16 16 16

// break;
06 [@PreCreatedSoldier_END]
// case 4:
[#PreCreatedSoldier_4]
0A [@PreCreatedSoldier_Default] 2C 04
// kSoldier.m_kChar.aStats[3] = class'XGTacticalGameCore'.default.ROOKIE_MOBILITY + 1 ;
0F 1A 2C 03 35 <XComGame.XGTacticalGameCoreNativeBase.TCharacter.aStats> <XComGame.XGTacticalGameCoreNativeBase.TCharacter> 00 01 19 00 <.kSoldier> 09 00 <XGStrategySoldier.m_kChar> 00 01 <XGStrategySoldier.m_kChar>
92 12 20 <Class.XComGame.XGTacticalGameCore> 09 00 <XComGame.XGTacticalGameCoreNativeBase.ROOKIE_MOBILITY> 00 02 <XComGame.XGTacticalGameCoreNativeBase.ROOKIE_MOBILITY> 26 16

// break;
06 [@PreCreatedSoldier_END]
// default:
[#PreCreatedSoldier_Default]
0A FF FF
// break;
06 [@PreCreatedSoldier_END]
// }
[#PreCreatedSoldier_END]

//}
[#SwNce_END]

// STORAGE().AutoEquip(kSoldier);
19 1B <STORAGE> 16 13 00 <NullRef> 00 1B <AutoEquip> 00 <.kSoldier> 16

// I = 0;
0F 00 <.I> 25

[#SoldierLevel_WHILE]
// while (I < iSoldierLevel) {
07 [@SoldierLevel_END] 96 00 <.I> 00 <.iSoldierLevel> 16

// kSoldier.LevelUp(eClass);
19 00 <.kSoldier> 14 00 <NullRef> 00 1B <LevelUp> 00 <.eClass> 4A 16

// ++I;
A5 00 <.I> 16

// [Loop Continue]
06 [@SoldierLevel_WHILE]
// }
[#SoldierLevel_END]

// AddNewSoldier(kSoldier,, bBlueshirt);
1B <AddNewSoldier> 00 <.kSoldier> 4A 2D 00 <.bBlueshirt> 16

// return kSoldier;
04 00 <.kSoldier>

04 3A <XGFacility_Barracks.CreateSoldier.ReturnValue>

//EOS
53

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...