mirror of
https://github.com/1dot13/source.git
synced 2026-09-16 14:47:17 +02:00
- external feeding checks for invalid gridno
- reordered xmls - new feature: class specific gun and item choices allows finetuning of a soldier's equipment WARNING! This exe needs GameDir revision >= 1584, as xmls have been reordered! More info under http://www.bears-pit.com/board/ubbthreads.php/topics/313782/Re_New_feature_Class_specific_.html#Post313782 git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5764 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -1642,6 +1642,9 @@ void LoadGameExternalOptions()
|
|||||||
gGameExternalOptions.usAttachmentDropRate = iniReader.ReadInteger("Item Property Settings","ATTACHMENT_DROP_RATE",10, 0, 100);
|
gGameExternalOptions.usAttachmentDropRate = iniReader.ReadInteger("Item Property Settings","ATTACHMENT_DROP_RATE",10, 0, 100);
|
||||||
gGameExternalOptions.iMaxEnemyAttachments = iniReader.ReadInteger("Item Property Settings","MAX_ENEMY_ATTACHMENTS",6, 2, MAX_ATTACHMENTS);
|
gGameExternalOptions.iMaxEnemyAttachments = iniReader.ReadInteger("Item Property Settings","MAX_ENEMY_ATTACHMENTS",6, 2, MAX_ATTACHMENTS);
|
||||||
|
|
||||||
|
// Flugente: class specific gun choice
|
||||||
|
gGameExternalOptions.fSoldierClassSpecificItemTables = iniReader.ReadBoolean("Item Property Settings","SOLDIERCLASS_SPECIFIC_ITEM_TABLES", TRUE);
|
||||||
|
|
||||||
//################# Strategic Enemy AI Settings ##################
|
//################# Strategic Enemy AI Settings ##################
|
||||||
|
|
||||||
// WDS - New AI
|
// WDS - New AI
|
||||||
|
|||||||
@@ -714,6 +714,9 @@ typedef struct
|
|||||||
UINT32 usAttachmentDropRate;
|
UINT32 usAttachmentDropRate;
|
||||||
INT16 iMaxEnemyAttachments;
|
INT16 iMaxEnemyAttachments;
|
||||||
|
|
||||||
|
// Flugente: class specific gun/item choice
|
||||||
|
BOOLEAN fSoldierClassSpecificItemTables;
|
||||||
|
|
||||||
//** ddd
|
//** ddd
|
||||||
//enable ext mouse key
|
//enable ext mouse key
|
||||||
BOOLEAN fExtMouseKeyEnabled;
|
BOOLEAN fExtMouseKeyEnabled;
|
||||||
|
|||||||
@@ -457,13 +457,62 @@ BOOLEAN LoadExternalGameplayData(STR directoryName)
|
|||||||
strcat(fileName, ATTACHMENTSLOTSFILENAME);
|
strcat(fileName, ATTACHMENTSLOTSFILENAME);
|
||||||
SGP_THROW_IFFALSE(ReadInAttachmentSlotsStats(fileName),ATTACHMENTSLOTSFILENAME);
|
SGP_THROW_IFFALSE(ReadInAttachmentSlotsStats(fileName),ATTACHMENTSLOTSFILENAME);
|
||||||
|
|
||||||
|
// Flugente: created separate gun and item choices for different soldier classes - read in different xmls
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
strcat(fileName, ENEMYGUNCHOICESFILENAME);
|
strcat(fileName, ENEMYGUNCHOICESFILENAME);
|
||||||
SGP_THROW_IFFALSE(ReadInExtendedArmyGunChoicesStats (fileName),ENEMYGUNCHOICESFILENAME);
|
SGP_THROW_IFFALSE(ReadInExtendedArmyGunChoicesStats(gExtendedArmyGunChoices[SOLDIER_CLASS_NONE], fileName), ENEMYGUNCHOICESFILENAME);
|
||||||
|
|
||||||
|
strcpy(fileName, directoryName);
|
||||||
|
strcat(fileName, GUNCHOICESFILENAME_ENEMY_ADMIN);
|
||||||
|
SGP_THROW_IFFALSE(ReadInExtendedArmyGunChoicesStats(gExtendedArmyGunChoices[SOLDIER_CLASS_ADMINISTRATOR], fileName), GUNCHOICESFILENAME_ENEMY_ADMIN);
|
||||||
|
|
||||||
|
strcpy(fileName, directoryName);
|
||||||
|
strcat(fileName, GUNCHOICESFILENAME_ENEMY_REGULAR);
|
||||||
|
SGP_THROW_IFFALSE(ReadInExtendedArmyGunChoicesStats(gExtendedArmyGunChoices[SOLDIER_CLASS_ARMY], fileName), GUNCHOICESFILENAME_ENEMY_REGULAR);
|
||||||
|
|
||||||
|
strcpy(fileName, directoryName);
|
||||||
|
strcat(fileName, GUNCHOICESFILENAME_ENEMY_ELITE);
|
||||||
|
SGP_THROW_IFFALSE(ReadInExtendedArmyGunChoicesStats(gExtendedArmyGunChoices[SOLDIER_CLASS_ELITE], fileName), GUNCHOICESFILENAME_ENEMY_ELITE);
|
||||||
|
|
||||||
|
strcpy(fileName, directoryName);
|
||||||
|
strcat(fileName, GUNCHOICESFILENAME_MILITIA_GREEN);
|
||||||
|
SGP_THROW_IFFALSE(ReadInExtendedArmyGunChoicesStats(gExtendedArmyGunChoices[SOLDIER_CLASS_GREEN_MILITIA], fileName), GUNCHOICESFILENAME_MILITIA_GREEN);
|
||||||
|
|
||||||
|
strcpy(fileName, directoryName);
|
||||||
|
strcat(fileName, GUNCHOICESFILENAME_MILITIA_REGULAR);
|
||||||
|
SGP_THROW_IFFALSE(ReadInExtendedArmyGunChoicesStats(gExtendedArmyGunChoices[SOLDIER_CLASS_REG_MILITIA], fileName), GUNCHOICESFILENAME_MILITIA_REGULAR);
|
||||||
|
|
||||||
|
strcpy(fileName, directoryName);
|
||||||
|
strcat(fileName, GUNCHOICESFILENAME_MILITIA_ELITE);
|
||||||
|
SGP_THROW_IFFALSE(ReadInExtendedArmyGunChoicesStats(gExtendedArmyGunChoices[SOLDIER_CLASS_ELITE_MILITIA], fileName), GUNCHOICESFILENAME_MILITIA_ELITE);
|
||||||
|
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
strcat(fileName, ENEMYITEMCHOICESFILENAME);
|
strcat(fileName, ENEMYITEMCHOICESFILENAME);
|
||||||
SGP_THROW_IFFALSE(ReadInArmyItemChoicesStats(fileName),ENEMYITEMCHOICESFILENAME);
|
SGP_THROW_IFFALSE(ReadInArmyItemChoicesStats(gArmyItemChoices[SOLDIER_CLASS_NONE], fileName),ENEMYITEMCHOICESFILENAME);
|
||||||
|
|
||||||
|
strcpy(fileName, directoryName);
|
||||||
|
strcat(fileName, ITEMCHOICESFILENAME_ENEMY_ADMIN);
|
||||||
|
SGP_THROW_IFFALSE(ReadInArmyItemChoicesStats(gArmyItemChoices[SOLDIER_CLASS_ADMINISTRATOR], fileName),ITEMCHOICESFILENAME_ENEMY_ADMIN);
|
||||||
|
|
||||||
|
strcpy(fileName, directoryName);
|
||||||
|
strcat(fileName, ITEMCHOICESFILENAME_ENEMY_REGULAR);
|
||||||
|
SGP_THROW_IFFALSE(ReadInArmyItemChoicesStats(gArmyItemChoices[SOLDIER_CLASS_ARMY], fileName),ITEMCHOICESFILENAME_ENEMY_REGULAR);
|
||||||
|
|
||||||
|
strcpy(fileName, directoryName);
|
||||||
|
strcat(fileName, ITEMCHOICESFILENAME_ENEMY_ELITE);
|
||||||
|
SGP_THROW_IFFALSE(ReadInArmyItemChoicesStats(gArmyItemChoices[SOLDIER_CLASS_ELITE], fileName),ITEMCHOICESFILENAME_ENEMY_ELITE);
|
||||||
|
|
||||||
|
strcpy(fileName, directoryName);
|
||||||
|
strcat(fileName, ITEMCHOICESFILENAME_MILITIA_GREEN);
|
||||||
|
SGP_THROW_IFFALSE(ReadInArmyItemChoicesStats(gArmyItemChoices[SOLDIER_CLASS_GREEN_MILITIA], fileName),ITEMCHOICESFILENAME_MILITIA_GREEN);
|
||||||
|
|
||||||
|
strcpy(fileName, directoryName);
|
||||||
|
strcat(fileName, ITEMCHOICESFILENAME_MILITIA_REGULAR);
|
||||||
|
SGP_THROW_IFFALSE(ReadInArmyItemChoicesStats(gArmyItemChoices[SOLDIER_CLASS_REG_MILITIA], fileName),ITEMCHOICESFILENAME_MILITIA_REGULAR);
|
||||||
|
|
||||||
|
strcpy(fileName, directoryName);
|
||||||
|
strcat(fileName, ITEMCHOICESFILENAME_MILITIA_ELITE);
|
||||||
|
SGP_THROW_IFFALSE(ReadInArmyItemChoicesStats(gArmyItemChoices[SOLDIER_CLASS_ELITE_MILITIA], fileName),ITEMCHOICESFILENAME_MILITIA_ELITE);
|
||||||
|
|
||||||
strcpy(fileName, directoryName);
|
strcpy(fileName, directoryName);
|
||||||
strcat(fileName, IMPITEMCHOICESFILENAME);
|
strcat(fileName, IMPITEMCHOICESFILENAME);
|
||||||
|
|||||||
@@ -67,7 +67,8 @@ UINT32 guiMortarsRolledByTeam = 0;
|
|||||||
// };
|
// };
|
||||||
|
|
||||||
|
|
||||||
ARMY_GUN_CHOICE_TYPE gExtendedArmyGunChoices[ARMY_GUN_LEVELS];// =
|
// Flugente: created separate gun choices for different soldier classes
|
||||||
|
ARMY_GUN_CHOICE_TYPE gExtendedArmyGunChoices[SOLDIER_GUN_CHOICE_SELECTIONS][ARMY_GUN_LEVELS];// =
|
||||||
//{ // INDEX CLASS #CHOICES
|
//{ // INDEX CLASS #CHOICES
|
||||||
// { /* 0 - lo pistols */ 6, SW38, BARRACUDA, DESERTEAGLE, GLOCK_17, M1911, BERETTA_92F,-1,-1,-1,-1 ,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 ,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 },
|
// { /* 0 - lo pistols */ 6, SW38, BARRACUDA, DESERTEAGLE, GLOCK_17, M1911, BERETTA_92F,-1,-1,-1,-1 ,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 ,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 },
|
||||||
// { /* 1 - hi pist/shtgn */ 6, GLOCK_18, BERETTA_93R, P7M8, M870, M950 ,FIVE7,-1,-1,-1,-1 ,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 },
|
// { /* 1 - hi pist/shtgn */ 6, GLOCK_18, BERETTA_93R, P7M8, M870, M950 ,FIVE7,-1,-1,-1,-1 ,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 },
|
||||||
@@ -82,7 +83,8 @@ ARMY_GUN_CHOICE_TYPE gExtendedArmyGunChoices[ARMY_GUN_LEVELS];// =
|
|||||||
// { /* 10- rocket rifle */ 5, ROCKET_RIFLE, AUTO_ROCKET_RIFLE , RPK74, HK21E, MINIMI , -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
|
// { /* 10- rocket rifle */ 5, ROCKET_RIFLE, AUTO_ROCKET_RIFLE , RPK74, HK21E, MINIMI , -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
|
||||||
//};
|
//};
|
||||||
|
|
||||||
ARMY_GUN_CHOICE_TYPE gArmyItemChoices[MAX_ITEM_TYPES];
|
// Flugente: created separate gun choices for different soldier classes
|
||||||
|
ARMY_GUN_CHOICE_TYPE gArmyItemChoices[SOLDIER_GUN_CHOICE_SELECTIONS][MAX_ITEM_TYPES];
|
||||||
|
|
||||||
void RandomlyChooseWhichItemsAreDroppable( SOLDIERCREATE_STRUCT *pp, INT8 bSoldierClass );
|
void RandomlyChooseWhichItemsAreDroppable( SOLDIERCREATE_STRUCT *pp, INT8 bSoldierClass );
|
||||||
void EquipTank( SOLDIERCREATE_STRUCT *pp );
|
void EquipTank( SOLDIERCREATE_STRUCT *pp );
|
||||||
@@ -93,10 +95,10 @@ void ChooseBombsForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8 bBombClas
|
|||||||
// Headrock: Added function definition for LBE chooser
|
// Headrock: Added function definition for LBE chooser
|
||||||
void ChooseLBEsForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8 bLBEClass );
|
void ChooseLBEsForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8 bLBEClass );
|
||||||
|
|
||||||
UINT16 PickARandomItem(UINT8 typeIndex);
|
UINT16 PickARandomItem(UINT8 typeIndex, INT8 bSoldierClass);
|
||||||
UINT16 PickARandomItem(UINT8 typeIndex, UINT8 maxCoolness);
|
UINT16 PickARandomItem(UINT8 typeIndex, INT8 bSoldierClass, UINT8 maxCoolness);
|
||||||
UINT16 PickARandomItem(UINT8 typeIndex, UINT8 maxCoolness, BOOLEAN getMatchingCoolness);
|
UINT16 PickARandomItem(UINT8 typeIndex, INT8 bSoldierClass, UINT8 maxCoolness, BOOLEAN getMatchingCoolness);
|
||||||
UINT16 PickARandomAttachment(UINT8 typeIndex, UINT16 usBaseItem, UINT8 maxCoolness, BOOLEAN getMatchingCoolness);
|
UINT16 PickARandomAttachment(UINT8 typeIndex, INT8 bSoldierClass, UINT16 usBaseItem, UINT8 maxCoolness, BOOLEAN getMatchingCoolness);
|
||||||
|
|
||||||
|
|
||||||
void InitArmyGunTypes(void)
|
void InitArmyGunTypes(void)
|
||||||
@@ -114,7 +116,7 @@ void InitArmyGunTypes(void)
|
|||||||
//if (gGameOptions.fGunNut)
|
//if (gGameOptions.fGunNut)
|
||||||
//{
|
//{
|
||||||
// use table of extended gun choices
|
// use table of extended gun choices
|
||||||
pGunChoiceTable = &(gExtendedArmyGunChoices[0]);
|
pGunChoiceTable = &(gExtendedArmyGunChoices[SOLDIER_CLASS_NONE][0]);
|
||||||
//}
|
//}
|
||||||
//else
|
//else
|
||||||
//{
|
//{
|
||||||
@@ -160,9 +162,9 @@ INT8 GetWeaponClass( UINT16 usGun )
|
|||||||
{
|
{
|
||||||
for (uiGunLevel = 0; uiGunLevel < ARMY_GUN_LEVELS; uiGunLevel++)
|
for (uiGunLevel = 0; uiGunLevel < ARMY_GUN_LEVELS; uiGunLevel++)
|
||||||
{
|
{
|
||||||
for ( uiLoop = 0; uiLoop < gExtendedArmyGunChoices[ uiGunLevel ].ubChoices; uiLoop++ )
|
for ( uiLoop = 0; uiLoop < gExtendedArmyGunChoices[SOLDIER_CLASS_NONE][ uiGunLevel ].ubChoices; uiLoop++ )
|
||||||
{
|
{
|
||||||
if ( gExtendedArmyGunChoices[ uiGunLevel ].bItemNo[ uiLoop ] == usGun )
|
if ( gExtendedArmyGunChoices[SOLDIER_CLASS_NONE][ uiGunLevel ].bItemNo[ uiLoop ] == usGun )
|
||||||
{
|
{
|
||||||
return( (INT8) uiGunLevel );
|
return( (INT8) uiGunLevel );
|
||||||
}
|
}
|
||||||
@@ -191,9 +193,9 @@ void MarkAllWeaponsOfSameGunClassAsDropped( UINT16 usWeapon )
|
|||||||
if ( bGunClass != -1 )
|
if ( bGunClass != -1 )
|
||||||
{
|
{
|
||||||
// then mark EVERY gun in that class as dropped
|
// then mark EVERY gun in that class as dropped
|
||||||
for ( uiLoop = 0; uiLoop < gExtendedArmyGunChoices[ bGunClass ].ubChoices; uiLoop++ )
|
for ( uiLoop = 0; uiLoop < gExtendedArmyGunChoices[SOLDIER_CLASS_NONE][ bGunClass ].ubChoices; uiLoop++ )
|
||||||
{
|
{
|
||||||
gStrategicStatus.fWeaponDroppedAlready[ gExtendedArmyGunChoices[ bGunClass ].bItemNo[ uiLoop ] ] = TRUE;
|
gStrategicStatus.fWeaponDroppedAlready[ gExtendedArmyGunChoices[SOLDIER_CLASS_NONE][ bGunClass ].bItemNo[ uiLoop ] ] = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -998,7 +1000,7 @@ void ChooseWeaponForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8 bWeaponC
|
|||||||
{
|
{
|
||||||
usGunIndex = pp->Inv[ i ].usItem;
|
usGunIndex = pp->Inv[ i ].usItem;
|
||||||
ubChanceStandardAmmo = 100 - (bWeaponClass * -9); // weapon class is negative!
|
ubChanceStandardAmmo = 100 - (bWeaponClass * -9); // weapon class is negative!
|
||||||
usAmmoIndex = RandomMagazine( usGunIndex, ubChanceStandardAmmo, max(Item[usGunIndex].ubCoolness, HighestPlayerProgressPercentage() / 10 + 3));
|
usAmmoIndex = RandomMagazine( usGunIndex, ubChanceStandardAmmo, max(Item[usGunIndex].ubCoolness, HighestPlayerProgressPercentage() / 10 + 3), pp->ubSoldierClass);
|
||||||
|
|
||||||
if ( usAmmoIndex <= 0 )
|
if ( usAmmoIndex <= 0 )
|
||||||
usAmmoIndex = DefaultMagazine(usGunIndex);
|
usAmmoIndex = DefaultMagazine(usGunIndex);
|
||||||
@@ -1035,7 +1037,7 @@ void ChooseWeaponForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8 bWeaponC
|
|||||||
|
|
||||||
|
|
||||||
// the weapon class here ranges from 1 to 11, so subtract 1 to get a gun level
|
// the weapon class here ranges from 1 to 11, so subtract 1 to get a gun level
|
||||||
usGunIndex = SelectStandardArmyGun( (UINT8) (bWeaponClass - 1));
|
usGunIndex = SelectStandardArmyGun( (UINT8) (bWeaponClass - 1), pp->ubSoldierClass );
|
||||||
|
|
||||||
// Flugente: random items
|
// Flugente: random items
|
||||||
UINT16 newitemfromrandom = 0;
|
UINT16 newitemfromrandom = 0;
|
||||||
@@ -1095,11 +1097,11 @@ void ChooseWeaponForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8 bWeaponC
|
|||||||
if(UsingNewAttachmentSystem()==false){
|
if(UsingNewAttachmentSystem()==false){
|
||||||
if ( Weapon[usGunIndex].ubWeaponType == GUN_SN_RIFLE )
|
if ( Weapon[usGunIndex].ubWeaponType == GUN_SN_RIFLE )
|
||||||
{
|
{
|
||||||
usScopeIndex = PickARandomAttachment(SCOPE,usGunIndex,bAttachClass,TRUE);
|
usScopeIndex = PickARandomAttachment(SCOPE, pp->ubSoldierClass, usGunIndex,bAttachClass,TRUE);
|
||||||
if ( usScopeIndex == 0 )
|
if ( usScopeIndex == 0 )
|
||||||
{
|
{
|
||||||
// find any one that works
|
// find any one that works
|
||||||
usScopeIndex = PickARandomAttachment(SCOPE,usGunIndex,bAttachClass,FALSE);
|
usScopeIndex = PickARandomAttachment(SCOPE, pp->ubSoldierClass, usGunIndex,bAttachClass,FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1115,7 +1117,7 @@ void ChooseWeaponForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8 bWeaponC
|
|||||||
|
|
||||||
//Choose attachment
|
//Choose attachment
|
||||||
if( bAttachClass && ( fAttachment ))
|
if( bAttachClass && ( fAttachment ))
|
||||||
usAttachIndex = PickARandomAttachment(ATTACHMENTS,usGunIndex,bAttachClass,FALSE);
|
usAttachIndex = PickARandomAttachment(ATTACHMENTS, pp->ubSoldierClass, usGunIndex,bAttachClass,FALSE);
|
||||||
|
|
||||||
if( ValidItemAttachment(&(pp->Inv[ HANDPOS ]),usAttachIndex,TRUE,FALSE))
|
if( ValidItemAttachment(&(pp->Inv[ HANDPOS ]),usAttachIndex,TRUE,FALSE))
|
||||||
{
|
{
|
||||||
@@ -1129,7 +1131,7 @@ void ChooseWeaponForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8 bWeaponC
|
|||||||
|
|
||||||
//check for chance of second attachment
|
//check for chance of second attachment
|
||||||
if ( ( bAttachClass - Item[usAttachIndex].ubCoolness ) > 0 && Random(2) )
|
if ( ( bAttachClass - Item[usAttachIndex].ubCoolness ) > 0 && Random(2) )
|
||||||
usAttachIndex2 = PickARandomAttachment(ATTACHMENTS,usGunIndex,bAttachClass,FALSE);
|
usAttachIndex2 = PickARandomAttachment(ATTACHMENTS, pp->ubSoldierClass, usGunIndex,bAttachClass,FALSE);
|
||||||
|
|
||||||
|
|
||||||
if( ValidItemAttachment(&(pp->Inv[ HANDPOS ]),usAttachIndex2,TRUE,FALSE))
|
if( ValidItemAttachment(&(pp->Inv[ HANDPOS ]),usAttachIndex2,TRUE,FALSE))
|
||||||
@@ -1156,16 +1158,16 @@ void ChooseWeaponForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8 bWeaponC
|
|||||||
//When using NAS, we want more attachments.
|
//When using NAS, we want more attachments.
|
||||||
if ( Weapon[usGunIndex].ubWeaponType == GUN_SN_RIFLE )
|
if ( Weapon[usGunIndex].ubWeaponType == GUN_SN_RIFLE )
|
||||||
{
|
{
|
||||||
usScopeIndex = PickARandomAttachment(SCOPE,usGunIndex,bAttachClass,TRUE);
|
usScopeIndex = PickARandomAttachment(SCOPE, pp->ubSoldierClass, usGunIndex,bAttachClass,TRUE);
|
||||||
if ( usScopeIndex == 0 )
|
if ( usScopeIndex == 0 )
|
||||||
{
|
{
|
||||||
// find any one that works
|
// find any one that works
|
||||||
usScopeIndex = PickARandomAttachment(SCOPE,usGunIndex,bAttachClass,FALSE);
|
usScopeIndex = PickARandomAttachment(SCOPE, pp->ubSoldierClass, usGunIndex,bAttachClass,FALSE);
|
||||||
}
|
}
|
||||||
//Guns should have a fairly good chance of having a scope. Even when they're not sniper rifles.
|
//Guns should have a fairly good chance of having a scope. Even when they're not sniper rifles.
|
||||||
//They're likely to be crappier, though.
|
//They're likely to be crappier, though.
|
||||||
} else if (Chance(75) && fAttachment){
|
} else if (Chance(75) && fAttachment){
|
||||||
usScopeIndex = PickARandomAttachment(SCOPE,usGunIndex,bAttachClass-1,FALSE);
|
usScopeIndex = PickARandomAttachment(SCOPE, pp->ubSoldierClass, usGunIndex,bAttachClass-1,FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ValidItemAttachmentSlot(&(pp->Inv[ HANDPOS ]),usScopeIndex, TRUE,FALSE) )
|
if( ValidItemAttachmentSlot(&(pp->Inv[ HANDPOS ]),usScopeIndex, TRUE,FALSE) )
|
||||||
@@ -1199,7 +1201,7 @@ void ChooseWeaponForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8 bWeaponC
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (fRandomPassed)
|
if (fRandomPassed)
|
||||||
usAttachIndex = PickARandomAttachment(ATTACHMENTS,usGunIndex,bAttachClass,fGetMatchingCoolness);
|
usAttachIndex = PickARandomAttachment(ATTACHMENTS, pp->ubSoldierClass, usGunIndex,bAttachClass,fGetMatchingCoolness);
|
||||||
|
|
||||||
if(!usAttachIndex){
|
if(!usAttachIndex){
|
||||||
continue;
|
continue;
|
||||||
@@ -1246,7 +1248,7 @@ void ChooseWeaponForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8 bWeaponC
|
|||||||
// break;
|
// break;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
usAmmoIndex = RandomMagazine( &pp->Inv[HANDPOS], ubChanceStandardAmmo, max(Item[usGunIndex].ubCoolness, HighestPlayerProgressPercentage() / 10 + 3 ));
|
usAmmoIndex = RandomMagazine( &pp->Inv[HANDPOS], ubChanceStandardAmmo, max(Item[usGunIndex].ubCoolness, HighestPlayerProgressPercentage() / 10 + 3 ), pp->ubSoldierClass);
|
||||||
|
|
||||||
if ( usAmmoIndex <= 0 )
|
if ( usAmmoIndex <= 0 )
|
||||||
usAmmoIndex = DefaultMagazine(usGunIndex);
|
usAmmoIndex = DefaultMagazine(usGunIndex);
|
||||||
@@ -1377,7 +1379,7 @@ void ChooseGrenadesForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8 bGrena
|
|||||||
if ( count > bGrenades )
|
if ( count > bGrenades )
|
||||||
count = bGrenades;
|
count = bGrenades;
|
||||||
|
|
||||||
usItem = PickARandomItem ( GRENADE , bGrenadeClass, FALSE );
|
usItem = PickARandomItem ( GRENADE, pp->ubSoldierClass, bGrenadeClass, FALSE );
|
||||||
if ( usItem > 0 && count > 0 )
|
if ( usItem > 0 && count > 0 )
|
||||||
{
|
{
|
||||||
CreateItems( usItem, (INT8)(ubBaseQuality + Random( ubQualityVariation )), count, &gTempObject );
|
CreateItems( usItem, (INT8)(ubBaseQuality + Random( ubQualityVariation )), count, &gTempObject );
|
||||||
@@ -1604,7 +1606,7 @@ void ChooseArmourForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8 bHelmetC
|
|||||||
//search for a non-empty class with items we need
|
//search for a non-empty class with items we need
|
||||||
for(i=bHelmetClass;i<=10;i++)
|
for(i=bHelmetClass;i<=10;i++)
|
||||||
{
|
{
|
||||||
usHelmetItem = PickARandomItem(HELMET,i );
|
usHelmetItem = PickARandomItem(HELMET, pp->ubSoldierClass, i );
|
||||||
//if we find a non-empty class change to that and break
|
//if we find a non-empty class change to that and break
|
||||||
if(usHelmetItem > 0)
|
if(usHelmetItem > 0)
|
||||||
{
|
{
|
||||||
@@ -1616,7 +1618,7 @@ void ChooseArmourForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8 bHelmetC
|
|||||||
//search for a non-empty class with items we need
|
//search for a non-empty class with items we need
|
||||||
for(i=bVestClass;i<=10;i++)
|
for(i=bVestClass;i<=10;i++)
|
||||||
{
|
{
|
||||||
usVestItem = PickARandomItem(VEST,i );
|
usVestItem = PickARandomItem(VEST, pp->ubSoldierClass, i );
|
||||||
//if we find a non-empty class change to that and break
|
//if we find a non-empty class change to that and break
|
||||||
if(usVestItem > 0)
|
if(usVestItem > 0)
|
||||||
{
|
{
|
||||||
@@ -1628,7 +1630,7 @@ void ChooseArmourForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8 bHelmetC
|
|||||||
//search for a non-empty class with items we need
|
//search for a non-empty class with items we need
|
||||||
for(i=bLeggingsClass;i<=10;i++)
|
for(i=bLeggingsClass;i<=10;i++)
|
||||||
{
|
{
|
||||||
usLeggingsItem = PickARandomItem(LEGS,i );
|
usLeggingsItem = PickARandomItem(LEGS, pp->ubSoldierClass, i );
|
||||||
//if we find a non-empty class change to that and break
|
//if we find a non-empty class change to that and break
|
||||||
if(usLeggingsItem > 0)
|
if(usLeggingsItem > 0)
|
||||||
{
|
{
|
||||||
@@ -1643,7 +1645,7 @@ void ChooseArmourForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8 bHelmetC
|
|||||||
//Choose helmet
|
//Choose helmet
|
||||||
if( bHelmetClass )
|
if( bHelmetClass )
|
||||||
{
|
{
|
||||||
if(!gGameExternalOptions.fSoldiersWearAnyArmour) usHelmetItem = PickARandomItem(HELMET,bHelmetClass );
|
if(!gGameExternalOptions.fSoldiersWearAnyArmour) usHelmetItem = PickARandomItem(HELMET, pp->ubSoldierClass, bHelmetClass );
|
||||||
if ( usHelmetItem > 0 && Item[usHelmetItem].usItemClass == IC_ARMOUR && !(pp->Inv[ HELMETPOS ].fFlags & OBJECT_NO_OVERWRITE) && Armour[ Item[usHelmetItem].ubClassIndex ].ubArmourClass == ARMOURCLASS_HELMET )
|
if ( usHelmetItem > 0 && Item[usHelmetItem].usItemClass == IC_ARMOUR && !(pp->Inv[ HELMETPOS ].fFlags & OBJECT_NO_OVERWRITE) && Armour[ Item[usHelmetItem].ubClassIndex ].ubArmourClass == ARMOURCLASS_HELMET )
|
||||||
{
|
{
|
||||||
CreateItem( usHelmetItem, (INT8)(70+Random(31)), &(pp->Inv[ HELMETPOS ]) );
|
CreateItem( usHelmetItem, (INT8)(70+Random(31)), &(pp->Inv[ HELMETPOS ]) );
|
||||||
@@ -1652,7 +1654,7 @@ void ChooseArmourForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8 bHelmetC
|
|||||||
// roll to see if he gets an attachment, too. Higher chance the higher his entitled helmet class is
|
// roll to see if he gets an attachment, too. Higher chance the higher his entitled helmet class is
|
||||||
if (( INT8 ) Random( 100 ) < ( 15 * ( bHelmetClass - Item[usHelmetItem].ubCoolness ) ) )
|
if (( INT8 ) Random( 100 ) < ( 15 * ( bHelmetClass - Item[usHelmetItem].ubCoolness ) ) )
|
||||||
{
|
{
|
||||||
UINT16 usAttachment = PickARandomAttachment(ARMOURATTACHMENT,usHelmetItem, bHelmetClass, FALSE);
|
UINT16 usAttachment = PickARandomAttachment(ARMOURATTACHMENT, pp->ubSoldierClass, usHelmetItem, bHelmetClass, FALSE);
|
||||||
if ( usAttachment > 0 )
|
if ( usAttachment > 0 )
|
||||||
{
|
{
|
||||||
CreateItem( usAttachment, (INT8)(70+Random(31)), &gTempObject );
|
CreateItem( usAttachment, (INT8)(70+Random(31)), &gTempObject );
|
||||||
@@ -1716,7 +1718,7 @@ void ChooseArmourForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8 bHelmetC
|
|||||||
//Choose vest
|
//Choose vest
|
||||||
if( bVestClass )
|
if( bVestClass )
|
||||||
{
|
{
|
||||||
if(!gGameExternalOptions.fSoldiersWearAnyArmour) usVestItem = PickARandomItem(VEST,bVestClass );
|
if(!gGameExternalOptions.fSoldiersWearAnyArmour) usVestItem = PickARandomItem(VEST, pp->ubSoldierClass, bVestClass );
|
||||||
if ( usVestItem > 0 && Item[usVestItem].usItemClass == IC_ARMOUR && !(pp->Inv[ VESTPOS ].fFlags & OBJECT_NO_OVERWRITE) && Armour[ Item[usVestItem].ubClassIndex ].ubArmourClass == ARMOURCLASS_VEST )
|
if ( usVestItem > 0 && Item[usVestItem].usItemClass == IC_ARMOUR && !(pp->Inv[ VESTPOS ].fFlags & OBJECT_NO_OVERWRITE) && Armour[ Item[usVestItem].ubClassIndex ].ubArmourClass == ARMOURCLASS_VEST )
|
||||||
{
|
{
|
||||||
CreateItem( usVestItem, (INT8)(70+Random(31)), &(pp->Inv[ VESTPOS ]) );
|
CreateItem( usVestItem, (INT8)(70+Random(31)), &(pp->Inv[ VESTPOS ]) );
|
||||||
@@ -1725,7 +1727,7 @@ void ChooseArmourForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8 bHelmetC
|
|||||||
// roll to see if he gets a CERAMIC PLATES, too. Higher chance the higher his entitled vest class is
|
// roll to see if he gets a CERAMIC PLATES, too. Higher chance the higher his entitled vest class is
|
||||||
if (( INT8 ) Random( 100 ) < ( 15 * ( bVestClass - Item[usVestItem].ubCoolness ) ) )
|
if (( INT8 ) Random( 100 ) < ( 15 * ( bVestClass - Item[usVestItem].ubCoolness ) ) )
|
||||||
{
|
{
|
||||||
UINT16 usAttachment = PickARandomAttachment(ARMOURATTACHMENT,usVestItem, bVestClass, FALSE);
|
UINT16 usAttachment = PickARandomAttachment(ARMOURATTACHMENT, pp->ubSoldierClass, usVestItem, bVestClass, FALSE);
|
||||||
if ( usAttachment > 0 )
|
if ( usAttachment > 0 )
|
||||||
{
|
{
|
||||||
CreateItem( usAttachment, (INT8)(70+Random(31)), &gTempObject );
|
CreateItem( usAttachment, (INT8)(70+Random(31)), &gTempObject );
|
||||||
@@ -1810,7 +1812,7 @@ void ChooseArmourForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8 bHelmetC
|
|||||||
//Choose Leggings
|
//Choose Leggings
|
||||||
if( bLeggingsClass )
|
if( bLeggingsClass )
|
||||||
{
|
{
|
||||||
if(!gGameExternalOptions.fSoldiersWearAnyArmour) usLeggingsItem = PickARandomItem(LEGS,bLeggingsClass );
|
if(!gGameExternalOptions.fSoldiersWearAnyArmour) usLeggingsItem = PickARandomItem(LEGS, pp->ubSoldierClass, bLeggingsClass );
|
||||||
if ( usLeggingsItem > 0 && Item[usLeggingsItem].usItemClass == IC_ARMOUR && !(pp->Inv[ LEGPOS ].fFlags & OBJECT_NO_OVERWRITE) && Armour[ Item[usLeggingsItem].ubClassIndex ].ubArmourClass == ARMOURCLASS_LEGGINGS )
|
if ( usLeggingsItem > 0 && Item[usLeggingsItem].usItemClass == IC_ARMOUR && !(pp->Inv[ LEGPOS ].fFlags & OBJECT_NO_OVERWRITE) && Armour[ Item[usLeggingsItem].ubClassIndex ].ubArmourClass == ARMOURCLASS_LEGGINGS )
|
||||||
{
|
{
|
||||||
CreateItem( usLeggingsItem, (INT8)(70+Random(31)), &(pp->Inv[ LEGPOS ]) );
|
CreateItem( usLeggingsItem, (INT8)(70+Random(31)), &(pp->Inv[ LEGPOS ]) );
|
||||||
@@ -1819,7 +1821,7 @@ void ChooseArmourForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8 bHelmetC
|
|||||||
// roll to see if he gets an attachment, too. Higher chance the higher his entitled Leggings class is
|
// roll to see if he gets an attachment, too. Higher chance the higher his entitled Leggings class is
|
||||||
if (( INT8 ) Random( 100 ) < ( 15 * ( bLeggingsClass - Item[usLeggingsItem].ubCoolness ) ) )
|
if (( INT8 ) Random( 100 ) < ( 15 * ( bLeggingsClass - Item[usLeggingsItem].ubCoolness ) ) )
|
||||||
{
|
{
|
||||||
UINT16 usAttachment = PickARandomAttachment(ARMOURATTACHMENT,usLeggingsItem, bLeggingsClass, FALSE);
|
UINT16 usAttachment = PickARandomAttachment(ARMOURATTACHMENT, pp->ubSoldierClass, usLeggingsItem, bLeggingsClass, FALSE);
|
||||||
if ( usAttachment > 0 )
|
if ( usAttachment > 0 )
|
||||||
{
|
{
|
||||||
CreateItem( usAttachment, (INT8)(70+Random(31)), &gTempObject );
|
CreateItem( usAttachment, (INT8)(70+Random(31)), &gTempObject );
|
||||||
@@ -1937,7 +1939,7 @@ void ChooseSpecialWeaponsForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8
|
|||||||
|
|
||||||
if ( bKnifeClass )
|
if ( bKnifeClass )
|
||||||
{
|
{
|
||||||
usKnifeIndex = PickARandomItem(KNIVES,bKnifeClass);
|
usKnifeIndex = PickARandomItem(KNIVES, pp->ubSoldierClass, bKnifeClass);
|
||||||
|
|
||||||
if( usKnifeIndex > 0 )
|
if( usKnifeIndex > 0 )
|
||||||
{
|
{
|
||||||
@@ -1964,7 +1966,7 @@ void ChooseSpecialWeaponsForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8
|
|||||||
}
|
}
|
||||||
else if (fGrenadeLauncher)
|
else if (fGrenadeLauncher)
|
||||||
{
|
{
|
||||||
itemGrenadeLauncher = PickARandomItem ( GRENADELAUNCHER );
|
itemGrenadeLauncher = PickARandomItem ( GRENADELAUNCHER, pp->ubSoldierClass );
|
||||||
// give grenade launcher
|
// give grenade launcher
|
||||||
if ( itemGrenadeLauncher > 0 )
|
if ( itemGrenadeLauncher > 0 )
|
||||||
{
|
{
|
||||||
@@ -1977,7 +1979,7 @@ void ChooseSpecialWeaponsForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8
|
|||||||
if (fLAW)
|
if (fLAW)
|
||||||
{
|
{
|
||||||
// give rocket launcher
|
// give rocket launcher
|
||||||
itemLAW = PickARandomItem (SINGLESHOTROCKETLAUNCHER);
|
itemLAW = PickARandomItem (SINGLESHOTROCKETLAUNCHER, pp->ubSoldierClass );
|
||||||
if ( itemLAW > 0 )
|
if ( itemLAW > 0 )
|
||||||
{
|
{
|
||||||
CreateItem( itemLAW, (INT8)(50 + Random( 51 )), &gTempObject );
|
CreateItem( itemLAW, (INT8)(50 + Random( 51 )), &gTempObject );
|
||||||
@@ -1988,7 +1990,7 @@ void ChooseSpecialWeaponsForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8
|
|||||||
if (fRPG)
|
if (fRPG)
|
||||||
{
|
{
|
||||||
// give rpg
|
// give rpg
|
||||||
itemRPG = PickARandomItem (ROCKETLAUNCHER);
|
itemRPG = PickARandomItem (ROCKETLAUNCHER, pp->ubSoldierClass);
|
||||||
if ( itemRPG > 0 )
|
if ( itemRPG > 0 )
|
||||||
{
|
{
|
||||||
CreateItem( itemRPG, (INT8)(50 + Random( 51 )), &gTempObject );
|
CreateItem( itemRPG, (INT8)(50 + Random( 51 )), &gTempObject );
|
||||||
@@ -2003,7 +2005,7 @@ void ChooseSpecialWeaponsForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8
|
|||||||
Assert( IsAutoResolveActive() || ( gbWorldSectorZ == 0 ) );
|
Assert( IsAutoResolveActive() || ( gbWorldSectorZ == 0 ) );
|
||||||
|
|
||||||
// give mortar
|
// give mortar
|
||||||
itemMortar = PickARandomItem (MORTARLAUNCHER);
|
itemMortar = PickARandomItem (MORTARLAUNCHER, pp->ubSoldierClass);
|
||||||
if ( itemMortar > 0 )
|
if ( itemMortar > 0 )
|
||||||
{
|
{
|
||||||
CreateItem( itemMortar, (INT8)(50 + Random( 51 )), &gTempObject );
|
CreateItem( itemMortar, (INT8)(50 + Random( 51 )), &gTempObject );
|
||||||
@@ -2051,7 +2053,7 @@ void ChooseFaceGearForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp )
|
|||||||
//All elites get a gasmask and either night goggles or uv goggles.
|
//All elites get a gasmask and either night goggles or uv goggles.
|
||||||
if( Chance( 75 ) )
|
if( Chance( 75 ) )
|
||||||
{
|
{
|
||||||
usItem = PickARandomItem(GASMASKS);
|
usItem = PickARandomItem(GASMASKS, pp->ubSoldierClass);
|
||||||
if ( usItem > 0 )
|
if ( usItem > 0 )
|
||||||
{
|
{
|
||||||
CreateItem( usItem, (INT8)(70+Random(31)), &(pp->Inv[ HEAD1POS ]) );
|
CreateItem( usItem, (INT8)(70+Random(31)), &(pp->Inv[ HEAD1POS ]) );
|
||||||
@@ -2060,7 +2062,7 @@ void ChooseFaceGearForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
usItem = PickARandomItem(HEARINGAIDS);
|
usItem = PickARandomItem(HEARINGAIDS, pp->ubSoldierClass);
|
||||||
if ( usItem > 0 )
|
if ( usItem > 0 )
|
||||||
{
|
{
|
||||||
CreateItem( usItem, (INT8)(70+Random(31)), &(pp->Inv[ HEAD1POS ]) );
|
CreateItem( usItem, (INT8)(70+Random(31)), &(pp->Inv[ HEAD1POS ]) );
|
||||||
@@ -2072,7 +2074,7 @@ void ChooseFaceGearForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp )
|
|||||||
{
|
{
|
||||||
if( Chance( 75 ) )
|
if( Chance( 75 ) )
|
||||||
{
|
{
|
||||||
usItem = PickARandomItem(NVGLOW);
|
usItem = PickARandomItem(NVGLOW, pp->ubSoldierClass);
|
||||||
if ( usItem > 0 )
|
if ( usItem > 0 )
|
||||||
{
|
{
|
||||||
CreateItem( usItem, (INT8)(70+Random(31)), &(pp->Inv[ HEAD2POS ]) );
|
CreateItem( usItem, (INT8)(70+Random(31)), &(pp->Inv[ HEAD2POS ]) );
|
||||||
@@ -2081,7 +2083,7 @@ void ChooseFaceGearForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
usItem = PickARandomItem(NVGHIGH);
|
usItem = PickARandomItem(NVGHIGH, pp->ubSoldierClass);
|
||||||
if ( usItem > 0 )
|
if ( usItem > 0 )
|
||||||
{
|
{
|
||||||
CreateItem( usItem, (INT8)(70+Random(31)), &(pp->Inv[ HEAD2POS ]) );
|
CreateItem( usItem, (INT8)(70+Random(31)), &(pp->Inv[ HEAD2POS ]) );
|
||||||
@@ -2096,7 +2098,7 @@ void ChooseFaceGearForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp )
|
|||||||
{ //chance of getting a face item
|
{ //chance of getting a face item
|
||||||
if( Chance( 50 ) )
|
if( Chance( 50 ) )
|
||||||
{
|
{
|
||||||
usItem = PickARandomItem(GASMASKS);
|
usItem = PickARandomItem(GASMASKS, pp->ubSoldierClass);
|
||||||
if ( usItem > 0 )
|
if ( usItem > 0 )
|
||||||
{
|
{
|
||||||
CreateItem( usItem, (INT8)(70+Random(31)), &(pp->Inv[ HEAD1POS ]) );
|
CreateItem( usItem, (INT8)(70+Random(31)), &(pp->Inv[ HEAD1POS ]) );
|
||||||
@@ -2105,7 +2107,7 @@ void ChooseFaceGearForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
usItem = PickARandomItem(NVGLOW);
|
usItem = PickARandomItem(NVGLOW, pp->ubSoldierClass);
|
||||||
if ( usItem > 0 )
|
if ( usItem > 0 )
|
||||||
{
|
{
|
||||||
CreateItem( usItem, (INT8)(70+Random(31)), &(pp->Inv[ HEAD1POS ]) );
|
CreateItem( usItem, (INT8)(70+Random(31)), &(pp->Inv[ HEAD1POS ]) );
|
||||||
@@ -2115,7 +2117,7 @@ void ChooseFaceGearForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp )
|
|||||||
}
|
}
|
||||||
if( Chance( bDifficultyRating / 3 ) )
|
if( Chance( bDifficultyRating / 3 ) )
|
||||||
{ //chance of getting a extended ear
|
{ //chance of getting a extended ear
|
||||||
usItem = PickARandomItem(HEARINGAIDS);
|
usItem = PickARandomItem(HEARINGAIDS, pp->ubSoldierClass);
|
||||||
if ( usItem > 0 )
|
if ( usItem > 0 )
|
||||||
{
|
{
|
||||||
CreateItem( usItem, (INT8)(70+Random(31)), &(pp->Inv[ HEAD2POS ]) );
|
CreateItem( usItem, (INT8)(70+Random(31)), &(pp->Inv[ HEAD2POS ]) );
|
||||||
@@ -2198,7 +2200,7 @@ void ChooseKitsForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8 bKitClass
|
|||||||
#endif //obsoleteCode
|
#endif //obsoleteCode
|
||||||
|
|
||||||
// if we still want more medical and first aid kits, we can just add extras of those item #s to the array
|
// if we still want more medical and first aid kits, we can just add extras of those item #s to the array
|
||||||
usKitItem = PickARandomItem( KIT , bKitClass, FALSE );
|
usKitItem = PickARandomItem( KIT, pp->ubSoldierClass, bKitClass, FALSE );
|
||||||
if ( usKitItem > 0 )
|
if ( usKitItem > 0 )
|
||||||
{
|
{
|
||||||
CreateItem( usKitItem, (INT8)(80 + Random( 21 )), &gTempObject );
|
CreateItem( usKitItem, (INT8)(80 + Random( 21 )), &gTempObject );
|
||||||
@@ -2223,7 +2225,7 @@ void ChooseMiscGearForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8 bMiscC
|
|||||||
UINT16 usItem = 0;
|
UINT16 usItem = 0;
|
||||||
for ( UINT16 i=0;i<usRandom;i++ )
|
for ( UINT16 i=0;i<usRandom;i++ )
|
||||||
{
|
{
|
||||||
usItem = PickARandomItem (MISCITEMS , bMiscClass, FALSE);
|
usItem = PickARandomItem (MISCITEMS, pp->ubSoldierClass, bMiscClass, FALSE);
|
||||||
if ( usItem > 0 )
|
if ( usItem > 0 )
|
||||||
{
|
{
|
||||||
int bStatus = 80 + Random( 21 );
|
int bStatus = 80 + Random( 21 );
|
||||||
@@ -2318,7 +2320,7 @@ void ChooseBombsForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8 bBombClas
|
|||||||
//UINT16 usRandom;
|
//UINT16 usRandom;
|
||||||
UINT16 usItem = 0;
|
UINT16 usItem = 0;
|
||||||
|
|
||||||
usItem = PickARandomItem( BOMB , bBombClass, FALSE );
|
usItem = PickARandomItem( BOMB, pp->ubSoldierClass, bBombClass, FALSE );
|
||||||
if ( usItem > 0 )
|
if ( usItem > 0 )
|
||||||
{
|
{
|
||||||
CreateItem( usItem, (INT8)(80 + Random( 21 )), &gTempObject );
|
CreateItem( usItem, (INT8)(80 + Random( 21 )), &gTempObject );
|
||||||
@@ -2381,7 +2383,7 @@ void ChooseLBEsForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8 bLBEClass
|
|||||||
if((UsingNewInventorySystem() == false))
|
if((UsingNewInventorySystem() == false))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
usItem = PickARandomItem( LBE , bLBEClass, FALSE );
|
usItem = PickARandomItem( LBE, pp->ubSoldierClass, bLBEClass, FALSE );
|
||||||
if ( usItem > 0 )
|
if ( usItem > 0 )
|
||||||
{
|
{
|
||||||
CreateItem( usItem, (INT8)(80 + Random( 21 )), &gTempObject );
|
CreateItem( usItem, (INT8)(80 + Random( 21 )), &gTempObject );
|
||||||
@@ -2400,7 +2402,7 @@ void ChooseLocationSpecificGearForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp
|
|||||||
if ( gWorldSectorX == TIXA_SECTOR_X && gWorldSectorY == TIXA_SECTOR_Y && StrategicMap[ TIXA_SECTOR_X + TIXA_SECTOR_Y * MAP_WORLD_X ].fEnemyControlled )
|
if ( gWorldSectorX == TIXA_SECTOR_X && gWorldSectorY == TIXA_SECTOR_Y && StrategicMap[ TIXA_SECTOR_X + TIXA_SECTOR_Y * MAP_WORLD_X ].fEnemyControlled )
|
||||||
{
|
{
|
||||||
//dnl ch40 041009
|
//dnl ch40 041009
|
||||||
usItem = PickARandomItem(GASMASKS);
|
usItem = PickARandomItem(GASMASKS, pp->ubSoldierClass);
|
||||||
if(Random(100) > 80)
|
if(Random(100) > 80)
|
||||||
usItem = NOTHING;
|
usItem = NOTHING;
|
||||||
if(usItem > 0)
|
if(usItem > 0)
|
||||||
@@ -3247,7 +3249,7 @@ void ReplaceExtendedGuns( SOLDIERCREATE_STRUCT *pp, INT8 bSoldierClass )
|
|||||||
{
|
{
|
||||||
bWeaponClass = GetWeaponClass( usItem );
|
bWeaponClass = GetWeaponClass( usItem );
|
||||||
AssertMsg( bWeaponClass != -1, String( "Gun %d does not have a match in the extended gun array", usItem ) );
|
AssertMsg( bWeaponClass != -1, String( "Gun %d does not have a match in the extended gun array", usItem ) );
|
||||||
usNewGun = SelectStandardArmyGun( bWeaponClass );
|
usNewGun = SelectStandardArmyGun( bWeaponClass, bSoldierClass );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( usNewGun != NOTHING )
|
if ( usNewGun != NOTHING )
|
||||||
@@ -3291,7 +3293,7 @@ void ReplaceExtendedGuns( SOLDIERCREATE_STRUCT *pp, INT8 bSoldierClass )
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
UINT16 SelectStandardArmyGun( UINT8 uiGunLevel )
|
UINT16 SelectStandardArmyGun( UINT8 uiGunLevel, INT8 bSoldierClass )
|
||||||
{
|
{
|
||||||
ARMY_GUN_CHOICE_TYPE *pGunChoiceTable;
|
ARMY_GUN_CHOICE_TYPE *pGunChoiceTable;
|
||||||
int uiChoice;
|
int uiChoice;
|
||||||
@@ -3306,7 +3308,12 @@ UINT16 SelectStandardArmyGun( UINT8 uiGunLevel )
|
|||||||
//if (gGameOptions.fGunNut)
|
//if (gGameOptions.fGunNut)
|
||||||
//{
|
//{
|
||||||
// use table of extended gun choices
|
// use table of extended gun choices
|
||||||
pGunChoiceTable = &(gExtendedArmyGunChoices[0]);
|
|
||||||
|
// Flugente: if accessing with wrong soldier class, or not using different selection choices, take default one
|
||||||
|
if ( bSoldierClass >= SOLDIER_GUN_CHOICE_SELECTIONS || bSoldierClass < SOLDIER_CLASS_NONE || !gGameExternalOptions.fSoldierClassSpecificItemTables )
|
||||||
|
bSoldierClass = SOLDIER_CLASS_NONE;
|
||||||
|
|
||||||
|
pGunChoiceTable = &(gExtendedArmyGunChoices[bSoldierClass][0]);
|
||||||
//}
|
//}
|
||||||
//else
|
//else
|
||||||
//{
|
//{
|
||||||
@@ -3407,15 +3414,15 @@ void ResetMortarsOnTeamCount( void )
|
|||||||
guiMortarsRolledByTeam = 0;
|
guiMortarsRolledByTeam = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT16 PickARandomItem(UINT8 typeIndex)
|
UINT16 PickARandomItem(UINT8 typeIndex, INT8 bSoldierClass)
|
||||||
{
|
{
|
||||||
return PickARandomItem(typeIndex,100,FALSE);
|
return PickARandomItem(typeIndex, bSoldierClass, 100,FALSE);
|
||||||
}
|
}
|
||||||
UINT16 PickARandomItem(UINT8 typeIndex, UINT8 maxCoolness)
|
UINT16 PickARandomItem(UINT8 typeIndex, INT8 bSoldierClass, UINT8 maxCoolness)
|
||||||
{
|
{
|
||||||
return PickARandomItem(typeIndex,maxCoolness,TRUE);
|
return PickARandomItem(typeIndex, bSoldierClass, maxCoolness,TRUE);
|
||||||
}
|
}
|
||||||
UINT16 PickARandomItem(UINT8 typeIndex, UINT8 maxCoolness, BOOLEAN getMatchingCoolness)
|
UINT16 PickARandomItem(UINT8 typeIndex, INT8 bSoldierClass, UINT8 maxCoolness, BOOLEAN getMatchingCoolness)
|
||||||
{
|
{
|
||||||
//DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("PickARandomItem: typeIndex = %d, maxCoolness = %d, getMatchingCoolness = %d",typeIndex,maxCoolness,getMatchingCoolness));
|
//DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("PickARandomItem: typeIndex = %d, maxCoolness = %d, getMatchingCoolness = %d",typeIndex,maxCoolness,getMatchingCoolness));
|
||||||
|
|
||||||
@@ -3424,27 +3431,31 @@ UINT16 PickARandomItem(UINT8 typeIndex, UINT8 maxCoolness, BOOLEAN getMatchingCo
|
|||||||
UINT16 defaultItem = 0;
|
UINT16 defaultItem = 0;
|
||||||
BOOLEAN pickItem = FALSE;
|
BOOLEAN pickItem = FALSE;
|
||||||
|
|
||||||
if ( gArmyItemChoices[ typeIndex ].ubChoices <= 0 )
|
// Flugente: if accessing with wrong soldier class, or not using different selection choices, take default one
|
||||||
|
if ( bSoldierClass >= SOLDIER_GUN_CHOICE_SELECTIONS || bSoldierClass < SOLDIER_CLASS_NONE || !gGameExternalOptions.fSoldierClassSpecificItemTables )
|
||||||
|
bSoldierClass = SOLDIER_CLASS_NONE;
|
||||||
|
|
||||||
|
if ( gArmyItemChoices[bSoldierClass][ typeIndex ].ubChoices <= 0 )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// check up to 10 times for an item with a matching coolness
|
// check up to 10 times for an item with a matching coolness
|
||||||
for (int i=0; i < 10;i++)
|
for (int i=0; i < 10;i++)
|
||||||
{
|
{
|
||||||
//if we've already tried more times then there are items + 1, limit the looping to speed up the game, and just plain give up
|
//if we've already tried more times then there are items + 1, limit the looping to speed up the game, and just plain give up
|
||||||
if ( i > gArmyItemChoices[ typeIndex ].ubChoices )
|
if ( i > gArmyItemChoices[bSoldierClass][ typeIndex ].ubChoices )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// a chance for nothing!
|
// a chance for nothing!
|
||||||
uiChoice = Random(gArmyItemChoices[ typeIndex ].ubChoices + (int) ( gArmyItemChoices[ typeIndex ].ubChoices / 3 ));
|
uiChoice = Random(gArmyItemChoices[bSoldierClass][ typeIndex ].ubChoices + (int) ( gArmyItemChoices[bSoldierClass][ typeIndex ].ubChoices / 3 ));
|
||||||
|
|
||||||
if ( uiChoice >= gArmyItemChoices[ typeIndex ].ubChoices )
|
if ( uiChoice >= gArmyItemChoices[bSoldierClass][ typeIndex ].ubChoices )
|
||||||
{
|
{
|
||||||
if ( !getMatchingCoolness )
|
if ( !getMatchingCoolness )
|
||||||
return 0;
|
return 0;
|
||||||
else
|
else
|
||||||
uiChoice = Random(gArmyItemChoices[ typeIndex ].ubChoices);
|
uiChoice = Random(gArmyItemChoices[bSoldierClass][ typeIndex ].ubChoices);
|
||||||
}
|
}
|
||||||
usItem = gArmyItemChoices[ typeIndex ].bItemNo[ uiChoice ];
|
usItem = gArmyItemChoices[bSoldierClass][ typeIndex ].bItemNo[ uiChoice ];
|
||||||
|
|
||||||
// Flugente: random items
|
// Flugente: random items
|
||||||
UINT16 newitemfromrandom = 0;
|
UINT16 newitemfromrandom = 0;
|
||||||
@@ -3503,7 +3514,7 @@ UINT16 PickARandomItem(UINT8 typeIndex, UINT8 maxCoolness, BOOLEAN getMatchingCo
|
|||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
UINT16 PickARandomAttachment(UINT8 typeIndex, UINT16 usBaseItem, UINT8 maxCoolness, BOOLEAN getMatchingCoolness)
|
UINT16 PickARandomAttachment(UINT8 typeIndex, INT8 bSoldierClass, UINT16 usBaseItem, UINT8 maxCoolness, BOOLEAN getMatchingCoolness)
|
||||||
{
|
{
|
||||||
//DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("PickARandomAttachment: baseItem = %d, typeIndex = %d, maxCoolness = %d, getMatchingCoolness = %d",usBaseItem, typeIndex,maxCoolness,getMatchingCoolness));
|
//DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("PickARandomAttachment: baseItem = %d, typeIndex = %d, maxCoolness = %d, getMatchingCoolness = %d",usBaseItem, typeIndex,maxCoolness,getMatchingCoolness));
|
||||||
|
|
||||||
@@ -3511,19 +3522,23 @@ UINT16 PickARandomAttachment(UINT8 typeIndex, UINT16 usBaseItem, UINT8 maxCoolne
|
|||||||
UINT32 uiChoice;
|
UINT32 uiChoice;
|
||||||
UINT16 defaultItem = 0;
|
UINT16 defaultItem = 0;
|
||||||
|
|
||||||
|
// Flugente: if accessing with wrong soldier class, or not using different selection choices, take default one
|
||||||
|
if ( bSoldierClass >= SOLDIER_GUN_CHOICE_SELECTIONS || bSoldierClass < SOLDIER_CLASS_NONE || !gGameExternalOptions.fSoldierClassSpecificItemTables )
|
||||||
|
bSoldierClass = SOLDIER_CLASS_NONE;
|
||||||
|
|
||||||
// DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("PickARandomAttachment: # choices = %d", gArmyItemChoices[ typeIndex ].ubChoices ));
|
// DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("PickARandomAttachment: # choices = %d", gArmyItemChoices[ typeIndex ].ubChoices ));
|
||||||
if ( gArmyItemChoices[ typeIndex ].ubChoices <= 0 )
|
if ( gArmyItemChoices[bSoldierClass][ typeIndex ].ubChoices <= 0 )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// check up to 10 times for an item with a matching coolness
|
// check up to 10 times for an item with a matching coolness
|
||||||
for (int i=0; i < 50; i++)
|
for (int i=0; i < 50; i++)
|
||||||
{
|
{
|
||||||
//if we've already tried more times then there are items + 1, limit the looping to speed up the game, and just plain give up
|
//if we've already tried more times then there are items + 1, limit the looping to speed up the game, and just plain give up
|
||||||
if ( i > gArmyItemChoices[ typeIndex ].ubChoices )
|
if ( i > gArmyItemChoices[bSoldierClass][ typeIndex ].ubChoices )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
uiChoice = Random(gArmyItemChoices[ typeIndex ].ubChoices);
|
uiChoice = Random(gArmyItemChoices[bSoldierClass][ typeIndex ].ubChoices);
|
||||||
usItem = gArmyItemChoices[ typeIndex ].bItemNo[ uiChoice ];
|
usItem = gArmyItemChoices[bSoldierClass][ typeIndex ].bItemNo[ uiChoice ];
|
||||||
|
|
||||||
BOOLEAN fDefaultAttachment = FALSE;
|
BOOLEAN fDefaultAttachment = FALSE;
|
||||||
for(UINT8 cnt = 0; cnt < MAX_DEFAULT_ATTACHMENTS; cnt++){
|
for(UINT8 cnt = 0; cnt < MAX_DEFAULT_ATTACHMENTS; cnt++){
|
||||||
|
|||||||
@@ -79,14 +79,15 @@ void AssignCreatureInventory( SOLDIERTYPE *pSoldier );
|
|||||||
|
|
||||||
void ReplaceExtendedGuns( SOLDIERCREATE_STRUCT *pp, INT8 bSoldierClass );
|
void ReplaceExtendedGuns( SOLDIERCREATE_STRUCT *pp, INT8 bSoldierClass );
|
||||||
|
|
||||||
UINT16 SelectStandardArmyGun( UINT8 uiGunLevel );
|
UINT16 SelectStandardArmyGun( UINT8 uiGunLevel, INT8 bSoldierClass );
|
||||||
|
|
||||||
INT8 GetWeaponClass( UINT16 usGun );
|
INT8 GetWeaponClass( UINT16 usGun );
|
||||||
void MarkAllWeaponsOfSameGunClassAsDropped( UINT16 usWeapon );
|
void MarkAllWeaponsOfSameGunClassAsDropped( UINT16 usWeapon );
|
||||||
|
|
||||||
void ResetMortarsOnTeamCount( void );
|
void ResetMortarsOnTeamCount( void );
|
||||||
|
|
||||||
extern ARMY_GUN_CHOICE_TYPE gExtendedArmyGunChoices[ARMY_GUN_LEVELS];
|
// Flugente: created separate gun choices for different soldier classes
|
||||||
|
extern ARMY_GUN_CHOICE_TYPE gExtendedArmyGunChoices[SOLDIER_GUN_CHOICE_SELECTIONS][ARMY_GUN_LEVELS];
|
||||||
|
|
||||||
// Headrock: Added LBE enumeration
|
// Headrock: Added LBE enumeration
|
||||||
enum
|
enum
|
||||||
@@ -115,7 +116,8 @@ enum
|
|||||||
MAX_ITEM_TYPES
|
MAX_ITEM_TYPES
|
||||||
};
|
};
|
||||||
|
|
||||||
extern ARMY_GUN_CHOICE_TYPE gArmyItemChoices[MAX_ITEM_TYPES];
|
// Flugente: created separate gun choices for different soldier classes
|
||||||
|
extern ARMY_GUN_CHOICE_TYPE gArmyItemChoices[SOLDIER_GUN_CHOICE_SELECTIONS][MAX_ITEM_TYPES];
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
+16
-8
@@ -7374,13 +7374,17 @@ UINT16 FindReplacementMagazineIfNecessary( UINT16 usOldGun, UINT16 usOldAmmo, UI
|
|||||||
// increase this if any gun can have more types that this
|
// increase this if any gun can have more types that this
|
||||||
#define MAX_AMMO_TYPES_PER_GUN 24 // MADD MARKER
|
#define MAX_AMMO_TYPES_PER_GUN 24 // MADD MARKER
|
||||||
|
|
||||||
UINT16 RandomMagazine( UINT16 usItem, UINT8 ubPercentStandard, UINT8 maxCoolness )
|
UINT16 RandomMagazine( UINT16 usItem, UINT8 ubPercentStandard, UINT8 maxCoolness, INT8 bSoldierClass )
|
||||||
{
|
{
|
||||||
// Note: if any ammo items in the item table are separated from the main group,
|
// Note: if any ammo items in the item table are separated from the main group,
|
||||||
// this function will have to be rewritten to scan the item table for an item
|
// this function will have to be rewritten to scan the item table for an item
|
||||||
// with item class ammo, which has class index ubLoop
|
// with item class ammo, which has class index ubLoop
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("RandomMagazine (by index)"));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("RandomMagazine (by index)"));
|
||||||
|
|
||||||
|
// Flugente: if accessing with wrong soldier class, or not using different selection choices, take default one
|
||||||
|
if ( bSoldierClass >= SOLDIER_GUN_CHOICE_SELECTIONS || bSoldierClass < SOLDIER_CLASS_NONE || !gGameExternalOptions.fSoldierClassSpecificItemTables )
|
||||||
|
bSoldierClass = SOLDIER_CLASS_NONE;
|
||||||
|
|
||||||
WEAPONTYPE * pWeapon;
|
WEAPONTYPE * pWeapon;
|
||||||
UINT16 usLoop;
|
UINT16 usLoop;
|
||||||
UINT16 loopItem;
|
UINT16 loopItem;
|
||||||
@@ -7408,11 +7412,11 @@ UINT16 RandomMagazine( UINT16 usItem, UINT8 ubPercentStandard, UINT8 maxCoolness
|
|||||||
// store it! (make sure array is big enough)
|
// store it! (make sure array is big enough)
|
||||||
Assert(usPossibleMagCnt < MAX_AMMO_TYPES_PER_GUN);
|
Assert(usPossibleMagCnt < MAX_AMMO_TYPES_PER_GUN);
|
||||||
// Madd: check to see if allowed by army
|
// Madd: check to see if allowed by army
|
||||||
if ( gArmyItemChoices[ENEMYAMMOTYPES].ubChoices > 0 )
|
if ( gArmyItemChoices[bSoldierClass][ENEMYAMMOTYPES].ubChoices > 0 )
|
||||||
{
|
{
|
||||||
for ( int i=0;i<gArmyItemChoices[ENEMYAMMOTYPES].ubChoices;i++ )
|
for ( int i=0;i<gArmyItemChoices[bSoldierClass][ENEMYAMMOTYPES].ubChoices;i++ )
|
||||||
{
|
{
|
||||||
if ( gArmyItemChoices[ENEMYAMMOTYPES].bItemNo[i] == Magazine[usLoop].ubAmmoType )
|
if ( gArmyItemChoices[bSoldierClass][ENEMYAMMOTYPES].bItemNo[i] == Magazine[usLoop].ubAmmoType )
|
||||||
{
|
{
|
||||||
usPossibleMagIndex[usPossibleMagCnt++] = usLoop;
|
usPossibleMagIndex[usPossibleMagCnt++] = usLoop;
|
||||||
break;
|
break;
|
||||||
@@ -7460,13 +7464,17 @@ UINT16 RandomMagazine( UINT16 usItem, UINT8 ubPercentStandard, UINT8 maxCoolness
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT16 RandomMagazine( OBJECTTYPE * pGun, UINT8 ubPercentStandard, UINT8 maxCoolness )
|
UINT16 RandomMagazine( OBJECTTYPE * pGun, UINT8 ubPercentStandard, UINT8 maxCoolness, INT8 bSoldierClass )
|
||||||
{
|
{
|
||||||
// Note: if any ammo items in the item table are separated from the main group,
|
// Note: if any ammo items in the item table are separated from the main group,
|
||||||
// this function will have to be rewritten to scan the item table for an item
|
// this function will have to be rewritten to scan the item table for an item
|
||||||
// with item class ammo, which has class index ubLoop
|
// with item class ammo, which has class index ubLoop
|
||||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("RandomMagazine"));
|
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("RandomMagazine"));
|
||||||
|
|
||||||
|
// Flugente: if accessing with wrong soldier class, or not using different selection choices, take default one
|
||||||
|
if ( bSoldierClass >= SOLDIER_GUN_CHOICE_SELECTIONS || bSoldierClass < SOLDIER_CLASS_NONE || !gGameExternalOptions.fSoldierClassSpecificItemTables )
|
||||||
|
bSoldierClass = SOLDIER_CLASS_NONE;
|
||||||
|
|
||||||
WEAPONTYPE * pWeapon;
|
WEAPONTYPE * pWeapon;
|
||||||
UINT16 usLoop;
|
UINT16 usLoop;
|
||||||
UINT16 loopItem;
|
UINT16 loopItem;
|
||||||
@@ -7494,11 +7502,11 @@ UINT16 RandomMagazine( OBJECTTYPE * pGun, UINT8 ubPercentStandard, UINT8 maxCool
|
|||||||
// store it! (make sure array is big enough)
|
// store it! (make sure array is big enough)
|
||||||
Assert(usPossibleMagCnt < MAX_AMMO_TYPES_PER_GUN);
|
Assert(usPossibleMagCnt < MAX_AMMO_TYPES_PER_GUN);
|
||||||
// Madd: check to see if allowed by army
|
// Madd: check to see if allowed by army
|
||||||
if ( gArmyItemChoices[ENEMYAMMOTYPES].ubChoices > 0 )
|
if ( gArmyItemChoices[bSoldierClass][ENEMYAMMOTYPES].ubChoices > 0 )
|
||||||
{
|
{
|
||||||
for ( int i=0;i<gArmyItemChoices[ENEMYAMMOTYPES].ubChoices;i++ )
|
for ( int i=0;i<gArmyItemChoices[bSoldierClass][ENEMYAMMOTYPES].ubChoices;i++ )
|
||||||
{
|
{
|
||||||
if ( gArmyItemChoices[ENEMYAMMOTYPES].bItemNo[i] == Magazine[usLoop].ubAmmoType )
|
if ( gArmyItemChoices[bSoldierClass][ENEMYAMMOTYPES].bItemNo[i] == Magazine[usLoop].ubAmmoType )
|
||||||
{
|
{
|
||||||
usPossibleMagIndex[usPossibleMagCnt++] = usLoop;
|
usPossibleMagIndex[usPossibleMagCnt++] = usLoop;
|
||||||
break;
|
break;
|
||||||
|
|||||||
+2
-2
@@ -65,8 +65,8 @@ BOOLEAN CreateAmmo( UINT16 usItem, OBJECTTYPE * pObj, UINT16 ubShotsLeft = 0);
|
|||||||
BOOLEAN CreateItems( UINT16 usItem, INT8 bStatus, UINT8 ubNumber, OBJECTTYPE * pObj );
|
BOOLEAN CreateItems( UINT16 usItem, INT8 bStatus, UINT8 ubNumber, OBJECTTYPE * pObj );
|
||||||
BOOLEAN CreateMoney( UINT32 uiMoney, OBJECTTYPE * pObj );
|
BOOLEAN CreateMoney( UINT32 uiMoney, OBJECTTYPE * pObj );
|
||||||
extern UINT16 DefaultMagazine( UINT16 usItem );
|
extern UINT16 DefaultMagazine( UINT16 usItem );
|
||||||
UINT16 RandomMagazine( UINT16 usItem, UINT8 ubPercentStandard, UINT8 maxCoolness );
|
UINT16 RandomMagazine( UINT16 usItem, UINT8 ubPercentStandard, UINT8 maxCoolness, INT8 bSoldierClass );
|
||||||
UINT16 RandomMagazine( OBJECTTYPE * pGun, UINT8 ubPercentStandard, UINT8 maxCoolness );
|
UINT16 RandomMagazine( OBJECTTYPE * pGun, UINT8 ubPercentStandard, UINT8 maxCoolness, INT8 bSoldierClass );
|
||||||
extern BOOLEAN ReloadGun( SOLDIERTYPE * pSoldier, OBJECTTYPE * pGun, OBJECTTYPE * pAmmo, UINT32 subObject = 0 );
|
extern BOOLEAN ReloadGun( SOLDIERTYPE * pSoldier, OBJECTTYPE * pGun, OBJECTTYPE * pAmmo, UINT32 subObject = 0 );
|
||||||
|
|
||||||
bool IsBackpackSlot(INT8 bSlot);
|
bool IsBackpackSlot(INT8 bSlot);
|
||||||
|
|||||||
@@ -13807,7 +13807,7 @@ void SOLDIERTYPE::SoldierInventoryCoolDown(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Flugente: determine if we can rest our weapon on something. This ca6n only happen when STANDING/CROUCHED. As a result, we get superior handling modifiers (we apply the PRONE modfiers)
|
// Flugente: determine if we can rest our weapon on something. This can only happen when STANDING/CROUCHED. As a result, we get superior handling modifiers (we apply the PRONE modfiers)
|
||||||
BOOLEAN SOLDIERTYPE::IsWeaponMounted( void )
|
BOOLEAN SOLDIERTYPE::IsWeaponMounted( void )
|
||||||
{
|
{
|
||||||
BOOLEAN applybipod = FALSE;
|
BOOLEAN applybipod = FALSE;
|
||||||
@@ -14201,10 +14201,14 @@ BOOLEAN SOLDIERTYPE::IsFeedingExternal(UINT8* pubId1, UINT16* pGunSlot1, UINT16
|
|||||||
if ( gGameExternalOptions.ubExternalFeeding == 0 )
|
if ( gGameExternalOptions.ubExternalFeeding == 0 )
|
||||||
return( FALSE );
|
return( FALSE );
|
||||||
|
|
||||||
// basic check if are up to this task
|
// basic check if we are up to this task
|
||||||
if ( !this->bActive || !this->bInSector || this->stats.bLife < OKLIFE )
|
if ( !this->bActive || !this->bInSector || this->stats.bLife < OKLIFE )
|
||||||
return( FALSE );
|
return( FALSE );
|
||||||
|
|
||||||
|
// this is odd - invalid GridNo... well, no feeding then
|
||||||
|
if ( TileIsOutOfBounds(this->sGridNo) )
|
||||||
|
return( FALSE );
|
||||||
|
|
||||||
BOOLEAN isFeeding = FALSE;
|
BOOLEAN isFeeding = FALSE;
|
||||||
|
|
||||||
UINT16 usGunItem = 0;
|
UINT16 usGunItem = 0;
|
||||||
@@ -14847,7 +14851,7 @@ BOOLEAN SOLDIERTYPE::EquipmentTooGood( BOOLEAN fCloselook )
|
|||||||
|
|
||||||
++numberofattachments;
|
++numberofattachments;
|
||||||
|
|
||||||
// no ordinary soldier is allowed that many attachments > not covert
|
// no ordinary soldier is allowed that many attachments -> not covert
|
||||||
if ( numberofattachments > gGameExternalOptions.iMaxEnemyAttachments )
|
if ( numberofattachments > gGameExternalOptions.iMaxEnemyAttachments )
|
||||||
{
|
{
|
||||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_TOOMANYATTACHMENTS], this->name, Item[pObj->usItem].szItemName );
|
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szCovertTextStr[STR_COVERT_TOOMANYATTACHMENTS], this->name, Item[pObj->usItem].szItemName );
|
||||||
|
|||||||
@@ -328,6 +328,9 @@ enum
|
|||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Flugente: there are now separate gun choices, depending on a soldier's class
|
||||||
|
#define SOLDIER_GUN_CHOICE_SELECTIONS SOLDIER_CLASS_CREATURE
|
||||||
|
|
||||||
#define SOLDIER_CLASS_ENEMY( bSoldierClass ) ( ( bSoldierClass >= SOLDIER_CLASS_ADMINISTRATOR ) && ( bSoldierClass <= SOLDIER_CLASS_ARMY ) )
|
#define SOLDIER_CLASS_ENEMY( bSoldierClass ) ( ( bSoldierClass >= SOLDIER_CLASS_ADMINISTRATOR ) && ( bSoldierClass <= SOLDIER_CLASS_ARMY ) )
|
||||||
#define SOLDIER_CLASS_MILITIA( bSoldierClass ) ( ( bSoldierClass >= SOLDIER_CLASS_GREEN_MILITIA ) && ( bSoldierClass <= SOLDIER_CLASS_ELITE_MILITIA ) )
|
#define SOLDIER_CLASS_MILITIA( bSoldierClass ) ( ( bSoldierClass >= SOLDIER_CLASS_GREEN_MILITIA ) && ( bSoldierClass <= SOLDIER_CLASS_ELITE_MILITIA ) )
|
||||||
|
|
||||||
|
|||||||
@@ -3015,7 +3015,7 @@ SOLDIERTYPE* TacticalCreateCreature( INT8 bCreatureBodyType )
|
|||||||
return TacticalCreateSoldier( &pp, &ubID );
|
return TacticalCreateSoldier( &pp, &ubID );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Flugente: assassins are elite soldiers of the civ team that go hostile on a certain event, otherwsie they jsut blend in
|
// Flugente: assassins are elite soldiers of the civ team that go hostile on a certain event, otherwsie they just blend in
|
||||||
SOLDIERTYPE* TacticalCreateEnemyAssassin(UINT8 disguisetype)
|
SOLDIERTYPE* TacticalCreateEnemyAssassin(UINT8 disguisetype)
|
||||||
{
|
{
|
||||||
BASIC_SOLDIERCREATE_STRUCT bp;
|
BASIC_SOLDIERCREATE_STRUCT bp;
|
||||||
@@ -3033,9 +3033,18 @@ SOLDIERTYPE* TacticalCreateEnemyAssassin(UINT8 disguisetype)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UINT8 assassinclass = SOLDIER_CLASS_GREEN_MILITIA;
|
||||||
|
if ( disguisetype == REGULAR_MILITIA )
|
||||||
|
assassinclass = SOLDIER_CLASS_REG_MILITIA;
|
||||||
|
else if ( disguisetype == ELITE_MILITIA )
|
||||||
|
assassinclass = SOLDIER_CLASS_ELITE_MILITIA;
|
||||||
|
else if ( disguisetype > ELITE_MILITIA )
|
||||||
|
// invalid class, abort
|
||||||
|
return NULL;
|
||||||
|
|
||||||
memset( &bp, 0, sizeof( BASIC_SOLDIERCREATE_STRUCT ) );
|
memset( &bp, 0, sizeof( BASIC_SOLDIERCREATE_STRUCT ) );
|
||||||
RandomizeRelativeLevel( &( bp.bRelativeAttributeLevel ), SOLDIER_CLASS_ELITE );
|
RandomizeRelativeLevel( &( bp.bRelativeAttributeLevel ), assassinclass );
|
||||||
RandomizeRelativeLevel( &( bp.bRelativeEquipmentLevel ), SOLDIER_CLASS_ELITE );
|
RandomizeRelativeLevel( &( bp.bRelativeEquipmentLevel ), assassinclass );
|
||||||
bp.bTeam = CIV_TEAM;
|
bp.bTeam = CIV_TEAM;
|
||||||
bp.bOrders = SEEKENEMY;
|
bp.bOrders = SEEKENEMY;
|
||||||
bp.bAttitude = (INT8) Random( MAXATTITUDES );
|
bp.bAttitude = (INT8) Random( MAXATTITUDES );
|
||||||
|
|||||||
+52
-36
@@ -15,6 +15,7 @@
|
|||||||
#include "XML_Language.h"
|
#include "XML_Language.h"
|
||||||
#include "Encyclopedia_Data.h"
|
#include "Encyclopedia_Data.h"
|
||||||
#include "Encyclopedia.h"
|
#include "Encyclopedia.h"
|
||||||
|
#include "Inventory Choosing.h" // added by Flugente
|
||||||
//forward declarations of common classes to eliminate includes
|
//forward declarations of common classes to eliminate includes
|
||||||
class OBJECTTYPE;
|
class OBJECTTYPE;
|
||||||
class SOLDIERTYPE;
|
class SOLDIERTYPE;
|
||||||
@@ -52,42 +53,57 @@ typedef PARSE_STAGE;
|
|||||||
#define TAIWANESE_PREFIX "Taiwanese."
|
#define TAIWANESE_PREFIX "Taiwanese."
|
||||||
#define CHINESE_PREFIX "Chinese."
|
#define CHINESE_PREFIX "Chinese."
|
||||||
|
|
||||||
#define ATTACHMENTSFILENAME "Attachments.xml"
|
#define ATTACHMENTSFILENAME "Items\\Attachments.xml"
|
||||||
#define ATTACHMENTINFOFILENAME "AttachmentInfo.xml"
|
#define ATTACHMENTINFOFILENAME "Items\\AttachmentInfo.xml"
|
||||||
#define ITEMSFILENAME "Items.xml"
|
#define ITEMSFILENAME "Items\\Items.xml"
|
||||||
#define WEAPONSFILENAME "Weapons.xml"
|
#define WEAPONSFILENAME "Items\\Weapons.xml"
|
||||||
#define LAUNCHABLESFILENAME "Launchables.xml"
|
#define LAUNCHABLESFILENAME "Items\\Launchables.xml"
|
||||||
#define COMPATIBLEFACEITEMSFILENAME "CompatibleFaceItems.xml"
|
#define COMPATIBLEFACEITEMSFILENAME "Items\\CompatibleFaceItems.xml"
|
||||||
#define MERGESFILENAME "Merges.xml"
|
#define MERGESFILENAME "Items\\Merges.xml"
|
||||||
#define ATTACHMENTCOMBOMERGESFILENAME "AttachmentComboMerges.xml"
|
#define ATTACHMENTCOMBOMERGESFILENAME "Items\\AttachmentComboMerges.xml"
|
||||||
// HEADROCK HAM 5: Item Transformations Filename
|
// HEADROCK HAM 5: Item Transformations Filename
|
||||||
#define ITEMTRANSFORMATIONSFILENAME "Item_Transformations.xml"
|
#define ITEMTRANSFORMATIONSFILENAME "Items\\Item_Transformations.xml"
|
||||||
#define MAGAZINESFILENAME "Magazines.xml"
|
#define MAGAZINESFILENAME "Items\\Magazines.xml"
|
||||||
#define ARMOURSFILENAME "Armours.xml"
|
#define ARMOURSFILENAME "Items\\Armours.xml"
|
||||||
#define EXPLOSIVESFILENAME "Explosives.xml"
|
#define EXPLOSIVESFILENAME "Items\\Explosives.xml"
|
||||||
#define DRUGSFILENAME "Drugs.xml"
|
#define DRUGSFILENAME "Items\\Drugs.xml"
|
||||||
#define FOODFILENAME "Food.xml"
|
#define FOODFILENAME "Items\\Food.xml"
|
||||||
#define MERCHANTSFILENAME "NPCInventory\\Merchants.xml"
|
#define MERCHANTSFILENAME "NPCInventory\\Merchants.xml"
|
||||||
#define CLOTHESFILENAME "Clothes.xml"
|
#define CLOTHESFILENAME "Items\\Clothes.xml"
|
||||||
#define RANDOMITEMFILENAME "RandomItem.xml"
|
#define RANDOMITEMFILENAME "Items\\RandomItem.xml"
|
||||||
#define AMMOFILENAME "AmmoStrings.xml"
|
#define AMMOFILENAME "Items\\AmmoStrings.xml"
|
||||||
#define AMMOTYPESFILENAME "AmmoTypes.xml"
|
#define AMMOTYPESFILENAME "Items\\AmmoTypes.xml"
|
||||||
#define INCOMPATIBLEATTACHMENTSFILENAME "IncompatibleAttachments.xml"
|
#define INCOMPATIBLEATTACHMENTSFILENAME "Items\\IncompatibleAttachments.xml"
|
||||||
#define ATTACHMENTSLOTSFILENAME "AttachmentSlots.xml"
|
#define ATTACHMENTSLOTSFILENAME "Items\\AttachmentSlots.xml"
|
||||||
#define ENEMYGUNCHOICESFILENAME "EnemyGunChoices.xml"
|
#define IMPITEMCHOICESFILENAME "Inventory\\IMPItemChoices.xml"
|
||||||
#define ENEMYITEMCHOICESFILENAME "EnemyItemChoices.xml"
|
|
||||||
#define IMPITEMCHOICESFILENAME "IMPItemChoices.xml"
|
// Flugente: added new gun and item choices for different soldier classes
|
||||||
|
#define ENEMYGUNCHOICESFILENAME "Inventory\\EnemyGunChoices.xml" // default selection
|
||||||
|
#define GUNCHOICESFILENAME_ENEMY_ADMIN "Inventory\\GunChoices_Enemy_Admin.xml"
|
||||||
|
#define GUNCHOICESFILENAME_ENEMY_REGULAR "Inventory\\GunChoices_Enemy_Regular.xml"
|
||||||
|
#define GUNCHOICESFILENAME_ENEMY_ELITE "Inventory\\GunChoices_Enemy_Elite.xml"
|
||||||
|
#define GUNCHOICESFILENAME_MILITIA_GREEN "Inventory\\GunChoices_Militia_Green.xml"
|
||||||
|
#define GUNCHOICESFILENAME_MILITIA_REGULAR "Inventory\\GunChoices_Militia_Regular.xml"
|
||||||
|
#define GUNCHOICESFILENAME_MILITIA_ELITE "Inventory\\GunChoices_Militia_Elite.xml"
|
||||||
|
|
||||||
|
#define ENEMYITEMCHOICESFILENAME "Inventory\\EnemyItemChoices.xml" // default selection
|
||||||
|
#define ITEMCHOICESFILENAME_ENEMY_ADMIN "Inventory\\ItemChoices_Enemy_Admin.xml"
|
||||||
|
#define ITEMCHOICESFILENAME_ENEMY_REGULAR "Inventory\\ItemChoices_Enemy_Regular.xml"
|
||||||
|
#define ITEMCHOICESFILENAME_ENEMY_ELITE "Inventory\\ItemChoices_Enemy_Elite.xml"
|
||||||
|
#define ITEMCHOICESFILENAME_MILITIA_GREEN "Inventory\\ItemChoices_Militia_Green.xml"
|
||||||
|
#define ITEMCHOICESFILENAME_MILITIA_REGULAR "Inventory\\ItemChoices_Militia_Regular.xml"
|
||||||
|
#define ITEMCHOICESFILENAME_MILITIA_ELITE "Inventory\\ItemChoices_Militia_Elite.xml"
|
||||||
|
|
||||||
// CHRISL:
|
// CHRISL:
|
||||||
#define LOADBEARINGEQUIPMENTFILENAME "LoadBearingEquipment.xml"
|
#define LOADBEARINGEQUIPMENTFILENAME "Items\\LoadBearingEquipment.xml"
|
||||||
#define LBEPOCKETFILENAME "Pockets.xml"
|
#define LBEPOCKETFILENAME "Inventory\\Pockets.xml"
|
||||||
// THE_BOB : added for pocket popup definitions
|
// THE_BOB : added for pocket popup definitions
|
||||||
#define LBEPOCKETPOPUPFILENAME "PocketPopups.xml"
|
#define LBEPOCKETPOPUPFILENAME "Inventory\\PocketPopups.xml"
|
||||||
|
|
||||||
#define MERCSTARTINGGEARFILENAME "MercStartingGear.xml"
|
#define MERCSTARTINGGEARFILENAME "Inventory\\MercStartingGear.xml"
|
||||||
|
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
#define MERCSTARTINGGEAR25FILENAME "MercStartingGear25.xml" //ja25 ub
|
#define MERCSTARTINGGEAR25FILENAME "Inventory\\MercStartingGear25.xml" //ja25 ub
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define TONYINVENTORYFILENAME "NPCInventory\\TonyInventory.xml"
|
#define TONYINVENTORYFILENAME "NPCInventory\\TonyInventory.xml"
|
||||||
@@ -142,7 +158,7 @@ typedef PARSE_STAGE;
|
|||||||
#define SOUNDSFILENAME "Sounds\\Sounds.xml"
|
#define SOUNDSFILENAME "Sounds\\Sounds.xml"
|
||||||
#define BURSTSOUNDSFILENAME "Sounds\\BurstSounds.xml"
|
#define BURSTSOUNDSFILENAME "Sounds\\BurstSounds.xml"
|
||||||
|
|
||||||
#define EXPLOSIONDATAFILENAME "ExplosionData.xml"
|
#define EXPLOSIONDATAFILENAME "Items\\ExplosionData.xml"
|
||||||
|
|
||||||
#define CITYTABLEFILENAME "Map\\Cities.xml"
|
#define CITYTABLEFILENAME "Map\\Cities.xml"
|
||||||
#define MOVEMENTCOSTFILENAME "Map\\MovementCosts.xml"
|
#define MOVEMENTCOSTFILENAME "Map\\MovementCosts.xml"
|
||||||
@@ -157,11 +173,11 @@ typedef PARSE_STAGE;
|
|||||||
#define COMPOSITIONFILENAME "Army\\ArmyComposition.xml"
|
#define COMPOSITIONFILENAME "Army\\ArmyComposition.xml"
|
||||||
|
|
||||||
// WANNE: drops filename
|
// WANNE: drops filename
|
||||||
#define ENEMYWEAPONDROPSFILENAME "EnemyWeaponDrops.xml"
|
#define ENEMYWEAPONDROPSFILENAME "Inventory\\EnemyWeaponDrops.xml"
|
||||||
#define ENEMYAMMODROPSFILENAME "EnemyAmmoDrops.xml"
|
#define ENEMYAMMODROPSFILENAME "Inventory\\EnemyAmmoDrops.xml"
|
||||||
#define ENEMYEXPLOSIVEDROPSFILENAME "EnemyExplosiveDrops.xml"
|
#define ENEMYEXPLOSIVEDROPSFILENAME "Inventory\\EnemyExplosiveDrops.xml"
|
||||||
#define ENEMYARMOURDROPSFILENAME "EnemyArmourDrops.xml"
|
#define ENEMYARMOURDROPSFILENAME "Inventory\\EnemyArmourDrops.xml"
|
||||||
#define ENEMYMISCDROPSFILENAME "EnemyMiscDrops.xml"
|
#define ENEMYMISCDROPSFILENAME "Inventory\\EnemyMiscDrops.xml"
|
||||||
|
|
||||||
// WANNE: Sector loadscreens [2007-05-18]
|
// WANNE: Sector loadscreens [2007-05-18]
|
||||||
#define SECTORLOADSCREENSFILENAME "Map\\SectorLoadscreens.xml"
|
#define SECTORLOADSCREENSFILENAME "Map\\SectorLoadscreens.xml"
|
||||||
@@ -352,10 +368,10 @@ extern BOOLEAN WriteAttachmentSlotsStats();
|
|||||||
extern BOOLEAN ReadInAttachmentSlotsStats(STR fileName);
|
extern BOOLEAN ReadInAttachmentSlotsStats(STR fileName);
|
||||||
|
|
||||||
extern BOOLEAN WriteExtendedArmyGunChoicesStats();
|
extern BOOLEAN WriteExtendedArmyGunChoicesStats();
|
||||||
extern BOOLEAN ReadInExtendedArmyGunChoicesStats(STR fileName);
|
extern BOOLEAN ReadInExtendedArmyGunChoicesStats(ARMY_GUN_CHOICE_TYPE* pGunChoice, STR fileName);
|
||||||
|
|
||||||
extern BOOLEAN WriteArmyItemChoicesStats();
|
extern BOOLEAN WriteArmyItemChoicesStats();
|
||||||
extern BOOLEAN ReadInArmyItemChoicesStats(STR fileName);
|
extern BOOLEAN ReadInArmyItemChoicesStats(ARMY_GUN_CHOICE_TYPE* pGunChoice, STR fileName);
|
||||||
|
|
||||||
extern BOOLEAN WriteIMPItemChoicesStats();
|
extern BOOLEAN WriteIMPItemChoicesStats();
|
||||||
extern BOOLEAN ReadInIMPItemChoicesStats(STR fileName);
|
extern BOOLEAN ReadInIMPItemChoicesStats(STR fileName);
|
||||||
|
|||||||
@@ -416,7 +416,7 @@ armyitemchoicesEndElementHandle(void *userData, const XML_Char *name)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
BOOLEAN ReadInArmyItemChoicesStats(STR fileName)
|
BOOLEAN ReadInArmyItemChoicesStats(ARMY_GUN_CHOICE_TYPE* pGunChoice, STR fileName)
|
||||||
{
|
{
|
||||||
HWFILE hFile;
|
HWFILE hFile;
|
||||||
UINT32 uiBytesRead;
|
UINT32 uiBytesRead;
|
||||||
@@ -453,7 +453,7 @@ BOOLEAN ReadInArmyItemChoicesStats(STR fileName)
|
|||||||
|
|
||||||
|
|
||||||
memset(&pData,0,sizeof(pData));
|
memset(&pData,0,sizeof(pData));
|
||||||
pData.curArray = gArmyItemChoices;
|
pData.curArray = pGunChoice;
|
||||||
pData.maxArraySize = MAX_ITEM_TYPES;
|
pData.maxArraySize = MAX_ITEM_TYPES;
|
||||||
|
|
||||||
XML_SetUserData(parser, &pData);
|
XML_SetUserData(parser, &pData);
|
||||||
@@ -499,9 +499,9 @@ BOOLEAN WriteArmyItemChoicesStats()
|
|||||||
FilePrintf(hFile,"\t<ENEMYITEMCHOICES>\r\n");
|
FilePrintf(hFile,"\t<ENEMYITEMCHOICES>\r\n");
|
||||||
|
|
||||||
FilePrintf(hFile,"\t\t<uiIndex>%d</uiIndex>\r\n", cnt );
|
FilePrintf(hFile,"\t\t<uiIndex>%d</uiIndex>\r\n", cnt );
|
||||||
FilePrintf(hFile,"\t\t<ubChoices>%d</ubChoices>\r\n", gArmyItemChoices[cnt].ubChoices );
|
FilePrintf(hFile,"\t\t<ubChoices>%d</ubChoices>\r\n", gArmyItemChoices[SOLDIER_CLASS_NONE][cnt].ubChoices );
|
||||||
for (int i=0;i<50;i++)
|
for (int i=0;i<50;i++)
|
||||||
FilePrintf(hFile,"\t\t<bItemNo%d>%d</bItemNo%d>\r\n",i+1,gArmyItemChoices[cnt].bItemNo[i],i+1 );
|
FilePrintf(hFile,"\t\t<bItemNo%d>%d</bItemNo%d>\r\n",i+1,gArmyItemChoices[SOLDIER_CLASS_NONE][cnt].bItemNo[i],i+1 );
|
||||||
|
|
||||||
|
|
||||||
FilePrintf(hFile,"\t</ENEMYITEMCHOICES>\r\n");
|
FilePrintf(hFile,"\t</ENEMYITEMCHOICES>\r\n");
|
||||||
|
|||||||
@@ -416,7 +416,7 @@ extendedarmygunchoicesEndElementHandle(void *userData, const XML_Char *name)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
BOOLEAN ReadInExtendedArmyGunChoicesStats(STR fileName)
|
BOOLEAN ReadInExtendedArmyGunChoicesStats(ARMY_GUN_CHOICE_TYPE* pGunChoice, STR fileName)
|
||||||
{
|
{
|
||||||
HWFILE hFile;
|
HWFILE hFile;
|
||||||
UINT32 uiBytesRead;
|
UINT32 uiBytesRead;
|
||||||
@@ -453,7 +453,7 @@ BOOLEAN ReadInExtendedArmyGunChoicesStats(STR fileName)
|
|||||||
|
|
||||||
|
|
||||||
memset(&pData,0,sizeof(pData));
|
memset(&pData,0,sizeof(pData));
|
||||||
pData.curArray = gExtendedArmyGunChoices;
|
pData.curArray = pGunChoice;
|
||||||
pData.maxArraySize = ARMY_GUN_LEVELS;
|
pData.maxArraySize = ARMY_GUN_LEVELS;
|
||||||
|
|
||||||
XML_SetUserData(parser, &pData);
|
XML_SetUserData(parser, &pData);
|
||||||
@@ -499,9 +499,9 @@ BOOLEAN WriteExtendedArmyGunChoicesStats()
|
|||||||
FilePrintf(hFile,"\t<ENEMYGUNCHOICES>\r\n");
|
FilePrintf(hFile,"\t<ENEMYGUNCHOICES>\r\n");
|
||||||
|
|
||||||
FilePrintf(hFile,"\t\t<uiIndex>%d</uiIndex>\r\n", cnt );
|
FilePrintf(hFile,"\t\t<uiIndex>%d</uiIndex>\r\n", cnt );
|
||||||
FilePrintf(hFile,"\t\t<ubChoices>%d</ubChoices>\r\n", gExtendedArmyGunChoices[cnt].ubChoices );
|
FilePrintf(hFile,"\t\t<ubChoices>%d</ubChoices>\r\n", gExtendedArmyGunChoices[SOLDIER_CLASS_NONE][cnt].ubChoices );
|
||||||
for (int i=0;i<50;i++)
|
for (int i=0;i<50;i++)
|
||||||
FilePrintf(hFile,"\t\t<bItemNo%d>%d</bItemNo%d>\r\n",i+1,gExtendedArmyGunChoices[cnt].bItemNo[i],i+1 );
|
FilePrintf(hFile,"\t\t<bItemNo%d>%d</bItemNo%d>\r\n",i+1,gExtendedArmyGunChoices[SOLDIER_CLASS_NONE][cnt].bItemNo[i],i+1 );
|
||||||
|
|
||||||
|
|
||||||
FilePrintf(hFile,"\t</ENEMYGUNCHOICES>\r\n");
|
FilePrintf(hFile,"\t</ENEMYGUNCHOICES>\r\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user