mirror of
https://github.com/1dot13/source.git
synced 2026-08-19 14:20:30 +02:00
Removed distinction between male and female IMP slots. Number of IMP slots is now set via MAX_IMP_CHARACTERS, slots are set with IMP_'number'.
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8608 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -633,7 +633,7 @@ UINT32 GameInitOptionsScreenInit( void )
|
|||||||
|
|
||||||
// Max. IMP Characters
|
// Max. IMP Characters
|
||||||
UINT8 maxIMPCharacterCount = (UINT8)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_MAX_IMP_CHARACTERS, 1);
|
UINT8 maxIMPCharacterCount = (UINT8)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_MAX_IMP_CHARACTERS, 1);
|
||||||
gGameOptions.ubMaxIMPCharacters = min( (gGameExternalOptions.iIMPMaleCharacterCount + gGameExternalOptions.iIMPFemaleCharacterCount), ( max( 1, maxIMPCharacterCount) ));
|
gGameOptions.ubMaxIMPCharacters = min( gGameExternalOptions.iMaxIMPCharacters, ( max( 1, maxIMPCharacterCount) ));
|
||||||
|
|
||||||
// Progress Speed of Item Choices (Default: Normal)
|
// Progress Speed of Item Choices (Default: Normal)
|
||||||
gGameOptions.ubProgressSpeedOfItemsChoices = (UINT8)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_PROGRESS_SPEED_OF_ITEM_CHOICES, ITEM_PROGRESS_NORMAL);
|
gGameOptions.ubProgressSpeedOfItemsChoices = (UINT8)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_PROGRESS_SPEED_OF_ITEM_CHOICES, ITEM_PROGRESS_NORMAL);
|
||||||
@@ -1767,7 +1767,7 @@ void BtnGIOIMPNumberSelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
|
|||||||
|
|
||||||
if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
|
if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
|
||||||
{
|
{
|
||||||
if ( iCurrentIMPNumberSetting < (gGameExternalOptions.iIMPMaleCharacterCount + gGameExternalOptions.iIMPFemaleCharacterCount) )
|
if ( iCurrentIMPNumberSetting < gGameExternalOptions.iMaxIMPCharacters )
|
||||||
{
|
{
|
||||||
PlayButtonSound( giGIOIMPNumberButton[1], BUTTON_SOUND_CLICKED_ON );
|
PlayButtonSound( giGIOIMPNumberButton[1], BUTTON_SOUND_CLICKED_ON );
|
||||||
|
|
||||||
@@ -1783,7 +1783,7 @@ void BtnGIOIMPNumberSelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
|
|||||||
{
|
{
|
||||||
btn->uiFlags|=(BUTTON_CLICKED_ON);
|
btn->uiFlags|=(BUTTON_CLICKED_ON);
|
||||||
|
|
||||||
if ( iCurrentIMPNumberSetting < (gGameExternalOptions.iIMPMaleCharacterCount + gGameExternalOptions.iIMPFemaleCharacterCount) )
|
if ( iCurrentIMPNumberSetting < gGameExternalOptions.iMaxIMPCharacters )
|
||||||
{
|
{
|
||||||
PlayButtonSound( giGIOIMPNumberButton[1], BUTTON_SOUND_CLICKED_ON );
|
PlayButtonSound( giGIOIMPNumberButton[1], BUTTON_SOUND_CLICKED_ON );
|
||||||
|
|
||||||
@@ -3093,7 +3093,7 @@ void DoneFadeOutForExitGameInitOptionScreen( void )
|
|||||||
gGameExternalOptions.ubGameMaximumNumberOfPlayerMercs = gGameOptions.ubSquadSize;*/
|
gGameExternalOptions.ubGameMaximumNumberOfPlayerMercs = gGameOptions.ubSquadSize;*/
|
||||||
|
|
||||||
// SANDRO - added following:
|
// SANDRO - added following:
|
||||||
gGameOptions.ubMaxIMPCharacters = min( (gGameExternalOptions.iIMPMaleCharacterCount + gGameExternalOptions.iIMPFemaleCharacterCount), ( max( 1, iCurrentIMPNumberSetting) ));
|
gGameOptions.ubMaxIMPCharacters = min( gGameExternalOptions.iMaxIMPCharacters, ( max( 1, iCurrentIMPNumberSetting) ));
|
||||||
gGameOptions.fNewTraitSystem = GetCurrentTraitsOptionButtonSetting();
|
gGameOptions.fNewTraitSystem = GetCurrentTraitsOptionButtonSetting();
|
||||||
|
|
||||||
gGameUBOptions.fTexAndJohn = GetCurrentTexAndJohnButtonSetting();
|
gGameUBOptions.fTexAndJohn = GetCurrentTexAndJohnButtonSetting();
|
||||||
@@ -3706,7 +3706,7 @@ UINT32 GameInitOptionsScreenInit( void )
|
|||||||
|
|
||||||
// Max. IMP Characters
|
// Max. IMP Characters
|
||||||
UINT8 maxIMPCharacterCount = (UINT8)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_MAX_IMP_CHARACTERS, 1);
|
UINT8 maxIMPCharacterCount = (UINT8)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_MAX_IMP_CHARACTERS, 1);
|
||||||
gGameOptions.ubMaxIMPCharacters = min( (gGameExternalOptions.iIMPMaleCharacterCount + gGameExternalOptions.iIMPFemaleCharacterCount), ( max( 1, maxIMPCharacterCount) ));
|
gGameOptions.ubMaxIMPCharacters = min( gGameExternalOptions.iMaxIMPCharacters, ( max( 1, maxIMPCharacterCount) ));
|
||||||
|
|
||||||
// Progress Speed of Item Choices (Default: Normal)
|
// Progress Speed of Item Choices (Default: Normal)
|
||||||
gGameOptions.ubProgressSpeedOfItemsChoices = (UINT8)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_PROGRESS_SPEED_OF_ITEM_CHOICES, ITEM_PROGRESS_NORMAL);
|
gGameOptions.ubProgressSpeedOfItemsChoices = (UINT8)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_PROGRESS_SPEED_OF_ITEM_CHOICES, ITEM_PROGRESS_NORMAL);
|
||||||
@@ -4832,7 +4832,7 @@ void BtnGIOIMPNumberSelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
|
|||||||
|
|
||||||
if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
|
if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
|
||||||
{
|
{
|
||||||
if ( iCurrentIMPNumberSetting < (gGameExternalOptions.iIMPMaleCharacterCount + gGameExternalOptions.iIMPFemaleCharacterCount) )
|
if ( iCurrentIMPNumberSetting < gGameExternalOptions.iMaxIMPCharacters )
|
||||||
{
|
{
|
||||||
PlayButtonSound( giGIOIMPNumberButton[1], BUTTON_SOUND_CLICKED_ON );
|
PlayButtonSound( giGIOIMPNumberButton[1], BUTTON_SOUND_CLICKED_ON );
|
||||||
|
|
||||||
@@ -4848,7 +4848,7 @@ void BtnGIOIMPNumberSelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
|
|||||||
{
|
{
|
||||||
btn->uiFlags|=(BUTTON_CLICKED_ON);
|
btn->uiFlags|=(BUTTON_CLICKED_ON);
|
||||||
|
|
||||||
if ( iCurrentIMPNumberSetting < (gGameExternalOptions.iIMPMaleCharacterCount + gGameExternalOptions.iIMPFemaleCharacterCount) )
|
if ( iCurrentIMPNumberSetting < gGameExternalOptions.iMaxIMPCharacters )
|
||||||
{
|
{
|
||||||
PlayButtonSound( giGIOIMPNumberButton[1], BUTTON_SOUND_CLICKED_ON );
|
PlayButtonSound( giGIOIMPNumberButton[1], BUTTON_SOUND_CLICKED_ON );
|
||||||
|
|
||||||
@@ -6105,9 +6105,8 @@ void DoneFadeOutForExitGameInitOptionScreen( void )
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// SANDRO - added following:
|
// SANDRO - added following:
|
||||||
gGameOptions.ubMaxIMPCharacters = min( (gGameExternalOptions.iIMPMaleCharacterCount + gGameExternalOptions.iIMPFemaleCharacterCount), ( max( 1, iCurrentIMPNumberSetting) ));
|
gGameOptions.ubMaxIMPCharacters = min( gGameExternalOptions.iMaxIMPCharacters, ( max( 1, iCurrentIMPNumberSetting) ));
|
||||||
gGameOptions.fNewTraitSystem = GetCurrentTraitsOptionButtonSetting();
|
gGameOptions.fNewTraitSystem = GetCurrentTraitsOptionButtonSetting();
|
||||||
gGameOptions.fEnemiesDropAllItems = GetCurrentDropAllButtonSetting();
|
gGameOptions.fEnemiesDropAllItems = GetCurrentDropAllButtonSetting();
|
||||||
gGameOptions.ubProgressSpeedOfItemsChoices = min( GIO_PROGRESS_VERY_FAST, iCurrentProgressSetting );
|
gGameOptions.ubProgressSpeedOfItemsChoices = min( GIO_PROGRESS_VERY_FAST, iCurrentProgressSetting );
|
||||||
|
|||||||
+7
-39
@@ -664,7 +664,7 @@ void InitGameOptions()
|
|||||||
gGameOptions.ubIronManMode = 0;
|
gGameOptions.ubIronManMode = 0;
|
||||||
|
|
||||||
// following added by SANDRO
|
// following added by SANDRO
|
||||||
gGameOptions.ubMaxIMPCharacters = (gGameExternalOptions.iIMPMaleCharacterCount + gGameExternalOptions.iIMPFemaleCharacterCount);
|
gGameOptions.ubMaxIMPCharacters = gGameExternalOptions.iMaxIMPCharacters;
|
||||||
|
|
||||||
if (gGameExternalOptions.fReadProfileDataFromXML)
|
if (gGameExternalOptions.fReadProfileDataFromXML)
|
||||||
gGameOptions.fNewTraitSystem = TRUE;
|
gGameOptions.fNewTraitSystem = TRUE;
|
||||||
@@ -689,9 +689,6 @@ void InitGameOptions()
|
|||||||
#define FIRST_STANDARD_FEMALE_SLOT 54
|
#define FIRST_STANDARD_FEMALE_SLOT 54
|
||||||
|
|
||||||
|
|
||||||
extern INT32 CountFilledIMPSlots( INT8 iSex );
|
|
||||||
extern INT32 CountEmptyIMPSlots( INT8 iSex );
|
|
||||||
|
|
||||||
// Snap: Read options from an INI file in the default of custom Data directory
|
// Snap: Read options from an INI file in the default of custom Data directory
|
||||||
void LoadGameExternalOptions()
|
void LoadGameExternalOptions()
|
||||||
{
|
{
|
||||||
@@ -743,15 +740,7 @@ void LoadGameExternalOptions()
|
|||||||
|
|
||||||
// WDS: Allow flexible numbers of IMPs of each sex
|
// WDS: Allow flexible numbers of IMPs of each sex
|
||||||
// SANDRO - moved to the game itself
|
// SANDRO - moved to the game itself
|
||||||
//gGameExternalOptions.iMaxIMPCharacters = iniReader.ReadInteger("Recruitment Settings","MAX_IMP_CHARACTERS",1, 1, NUM_PROFILES);
|
gGameExternalOptions.iMaxIMPCharacters = iniReader.ReadInteger("Recruitment Settings","MAX_IMP_CHARACTERS",1, 1, NUM_PROFILES);
|
||||||
|
|
||||||
gGameExternalOptions.iIMPMaleCharacterCount = iniReader.ReadInteger("Recruitment Settings","IMP_MALE_CHARACTER_COUNT", COUNT_STANDARD_MALE_SLOTS, 1, NUM_PROFILES);
|
|
||||||
gGameExternalOptions.iIMPFemaleCharacterCount = iniReader.ReadInteger("Recruitment Settings","IMP_FEMALE_CHARACTER_COUNT", COUNT_STANDARD_FEMALE_SLOTS, 1, NUM_PROFILES);
|
|
||||||
if (gGameExternalOptions.iIMPMaleCharacterCount + gGameExternalOptions.iIMPFemaleCharacterCount > NUM_PROFILES)
|
|
||||||
{
|
|
||||||
gGameExternalOptions.iIMPMaleCharacterCount = COUNT_STANDARD_MALE_SLOTS;
|
|
||||||
gGameExternalOptions.iIMPFemaleCharacterCount = COUNT_STANDARD_FEMALE_SLOTS;
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Note: put -1 between male/female slots and -1 at end. This allows everything to be
|
// Note: put -1 between male/female slots and -1 at end. This allows everything to be
|
||||||
@@ -761,15 +750,13 @@ void LoadGameExternalOptions()
|
|||||||
// Because errors in these values can really goof things up we will try to fix up bad
|
// Because errors in these values can really goof things up we will try to fix up bad
|
||||||
// values and use the defaults instead.
|
// values and use the defaults instead.
|
||||||
//
|
//
|
||||||
int idx;
|
char caIMPCountStr[] = "IMP_%d";
|
||||||
char caMaleCountStr [] = "IMP_MALE_%d";
|
|
||||||
char caFemaleCountStr [] = "IMP_FEMALE_%d";
|
|
||||||
char caCountStr[20];
|
char caCountStr[20];
|
||||||
|
|
||||||
gGameExternalOptions.iaIMPSlots = (INT32*)MemAlloc( (gGameExternalOptions.iIMPMaleCharacterCount + gGameExternalOptions.iIMPFemaleCharacterCount + 2) * sizeof( UINT32 ) );
|
gGameExternalOptions.iaIMPSlots = (INT32*)MemAlloc( (gGameExternalOptions.iMaxIMPCharacters) * sizeof( UINT32 ) );
|
||||||
for (idx = 0; idx < gGameExternalOptions.iIMPMaleCharacterCount; ++idx)
|
for (int idx = 0; idx < gGameExternalOptions.iMaxIMPCharacters; ++idx)
|
||||||
{
|
{
|
||||||
sprintf( caCountStr, caMaleCountStr, idx+1);
|
sprintf( caCountStr, caIMPCountStr, idx+1);
|
||||||
gGameExternalOptions.iaIMPSlots[idx] = iniReader.ReadInteger("Recruitment Settings",caCountStr, -1, -1, NUM_PROFILES-1);
|
gGameExternalOptions.iaIMPSlots[idx] = iniReader.ReadInteger("Recruitment Settings",caCountStr, -1, -1, NUM_PROFILES-1);
|
||||||
if (gGameExternalOptions.iaIMPSlots[idx] < 0)
|
if (gGameExternalOptions.iaIMPSlots[idx] < 0)
|
||||||
{
|
{
|
||||||
@@ -777,32 +764,13 @@ void LoadGameExternalOptions()
|
|||||||
{
|
{
|
||||||
gGameExternalOptions.iaIMPSlots[idx] = FIRST_STANDARD_MALE_SLOT+idx;
|
gGameExternalOptions.iaIMPSlots[idx] = FIRST_STANDARD_MALE_SLOT+idx;
|
||||||
}
|
}
|
||||||
else
|
else if ( idx < COUNT_STANDARD_FEMALE_SLOTS )
|
||||||
{
|
{
|
||||||
// This is bad so just use the last standard slot #
|
// This is bad so just use the last standard slot #
|
||||||
gGameExternalOptions.iaIMPSlots[idx] = FIRST_STANDARD_MALE_SLOT+COUNT_STANDARD_MALE_SLOTS-1;
|
gGameExternalOptions.iaIMPSlots[idx] = FIRST_STANDARD_MALE_SLOT+COUNT_STANDARD_MALE_SLOTS-1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gGameExternalOptions.iaIMPSlots[gGameExternalOptions.iIMPMaleCharacterCount] = -1;
|
|
||||||
for (idx = 0; idx < gGameExternalOptions.iIMPFemaleCharacterCount; ++idx)
|
|
||||||
{
|
|
||||||
sprintf( caCountStr, caFemaleCountStr, idx+1);
|
|
||||||
gGameExternalOptions.iaIMPSlots[idx+gGameExternalOptions.iIMPMaleCharacterCount+1] = iniReader.ReadInteger("Recruitment Settings",caCountStr, -1, -1, NUM_PROFILES-1);
|
|
||||||
if (gGameExternalOptions.iaIMPSlots[idx+gGameExternalOptions.iIMPMaleCharacterCount+1] < 0)
|
|
||||||
{
|
|
||||||
if (idx < COUNT_STANDARD_FEMALE_SLOTS)
|
|
||||||
{
|
|
||||||
gGameExternalOptions.iaIMPSlots[idx+gGameExternalOptions.iIMPMaleCharacterCount+1] = FIRST_STANDARD_FEMALE_SLOT+idx;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// This is bad so just use the last standard slot #
|
|
||||||
gGameExternalOptions.iaIMPSlots[idx+gGameExternalOptions.iIMPMaleCharacterCount+1] = FIRST_STANDARD_FEMALE_SLOT+COUNT_STANDARD_FEMALE_SLOTS-1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
gGameExternalOptions.iaIMPSlots[gGameExternalOptions.iIMPFemaleCharacterCount+gGameExternalOptions.iIMPMaleCharacterCount+1] = -1;
|
|
||||||
|
|
||||||
// silversurfer: read early recruitment options 1=immediately (control Omerta), 2=early (control 1, 2, 3 towns including Omerta)
|
// silversurfer: read early recruitment options 1=immediately (control Omerta), 2=early (control 1, 2, 3 towns including Omerta)
|
||||||
// 3=normal (control 3, 4, 5 towns including Omerta), 4=after liberating Omerta and solving the "Deliver Food Quest" for Miguel
|
// 3=normal (control 3, 4, 5 towns including Omerta), 4=after liberating Omerta and solving the "Deliver Food Quest" for Miguel
|
||||||
|
|||||||
+2
-4
@@ -286,10 +286,8 @@ typedef struct
|
|||||||
BOOLEAN fSellAll;
|
BOOLEAN fSellAll;
|
||||||
INT16 iPriceModifier;
|
INT16 iPriceModifier;
|
||||||
|
|
||||||
// WDS: Allow flexible numbers of IMPs of each sex
|
// Flugente: max number of IMPs, regardless of gender
|
||||||
INT32 iIMPMaleCharacterCount; // Count of how many there are
|
INT32 iMaxIMPCharacters; // Limit of how many to allow
|
||||||
INT32 iIMPFemaleCharacterCount;
|
|
||||||
//INT32 iMaxIMPCharacters; // Limit of how many to allow
|
|
||||||
//
|
//
|
||||||
// iaIMPSlots is an array of the slots (in prof.dat) to use for IMPs.
|
// iaIMPSlots is an array of the slots (in prof.dat) to use for IMPs.
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -379,23 +379,11 @@ void BtnIMPBeginScreenDoneCallback(GUI_BUTTON *btn,INT32 reason)
|
|||||||
// check to see if a name has been selected, if not, do not allow player to proceed with more char generation
|
// check to see if a name has been selected, if not, do not allow player to proceed with more char generation
|
||||||
if( ( pFullNameString[ 0 ] != 0) && ( pFullNameString[ 0 ] != L' ' ) && ( bGenderFlag != -1 ) )
|
if( ( pFullNameString[ 0 ] != 0) && ( pFullNameString[ 0 ] != L' ' ) && ( bGenderFlag != -1 ) )
|
||||||
{
|
{
|
||||||
if (bGenderFlag == IMP_MALE)
|
if ( CountEmptyIMPSlots() == 0 )
|
||||||
{
|
{
|
||||||
if (CountEmptyIMPSlots(MALE) == 0)
|
// You cannot have more than the max I.M.P characters on your team.
|
||||||
{
|
DoLapTopMessageBox( MSG_BOX_IMP_STYLE, pImpPopUpStrings[9], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL );
|
||||||
// You cannot have more than the male max I.M.P characters on your team.
|
bProceed = FALSE;
|
||||||
DoLapTopMessageBox( MSG_BOX_IMP_STYLE, pImpPopUpStrings[ 9 ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL);
|
|
||||||
bProceed = FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (bGenderFlag == IMP_FEMALE)
|
|
||||||
{
|
|
||||||
if (CountEmptyIMPSlots(FEMALE) == 0)
|
|
||||||
{
|
|
||||||
// You cannot have more than the female max I.M.P characters on your team.
|
|
||||||
DoLapTopMessageBox( MSG_BOX_IMP_STYLE, pImpPopUpStrings[ 9 ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL);
|
|
||||||
bProceed = FALSE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -124,16 +124,7 @@ void CreateACharacterFromPlayerEnteredStats( void )
|
|||||||
// of changes and revisions that have been made to personalities and attitudes.
|
// of changes and revisions that have been made to personalities and attitudes.
|
||||||
CreatePlayersPersonalitySkillsAndAttitude();
|
CreatePlayersPersonalitySkillsAndAttitude();
|
||||||
|
|
||||||
// Flugente: as the profile is no longer identical to the voice set, we need to determine a free slot
|
LaptopSaveInfo.iIMPIndex = GetFreeIMPSlot( -1 );
|
||||||
INT32 impslot = 0;
|
|
||||||
if ( fCharacterIsMale )
|
|
||||||
impslot = GetFirstMaleSlot( );
|
|
||||||
else
|
|
||||||
impslot = GetFirstFemaleSlot( );
|
|
||||||
|
|
||||||
INT32 impid = gGameExternalOptions.iaIMPSlots[impslot];
|
|
||||||
|
|
||||||
LaptopSaveInfo.iIMPIndex = GetFreeIMPSlot( impid, -1 );
|
|
||||||
|
|
||||||
// copy over full name
|
// copy over full name
|
||||||
wcscpy( gMercProfiles[ LaptopSaveInfo.iIMPIndex ].zName, pFullName );
|
wcscpy( gMercProfiles[ LaptopSaveInfo.iIMPIndex ].zName, pFullName );
|
||||||
|
|||||||
@@ -1511,7 +1511,7 @@ BOOLEAN LoadImpCharacter( STR nickName )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set the ID of the new IMP
|
// Set the ID of the new IMP
|
||||||
iProfileId = GetFreeIMPSlot(iProfileId, iProfileId);
|
iProfileId = GetFreeIMPSlot(iProfileId);
|
||||||
|
|
||||||
// We can create the new imp, beacuse we found an empty slot
|
// We can create the new imp, beacuse we found an empty slot
|
||||||
if (iProfileId != -1)
|
if (iProfileId != -1)
|
||||||
@@ -1719,7 +1719,6 @@ void GiveIMPItems( MERCPROFILESTRUCT *pProfile, INT8 abilityValue, UINT8 typeInd
|
|||||||
{
|
{
|
||||||
MakeProfileInvItemAnySlot(pProfile,usItem,100,1);
|
MakeProfileInvItemAnySlot(pProfile,usItem,100,1);
|
||||||
|
|
||||||
|
|
||||||
// give ammo for guns
|
// give ammo for guns
|
||||||
if ( Item[usItem].usItemClass == IC_GUN && !Item[usItem].rocketlauncher )
|
if ( Item[usItem].usItemClass == IC_GUN && !Item[usItem].rocketlauncher )
|
||||||
{
|
{
|
||||||
@@ -1740,8 +1739,6 @@ void GiveIMPItems( MERCPROFILESTRUCT *pProfile, INT8 abilityValue, UINT8 typeInd
|
|||||||
if (iChoice < 0)
|
if (iChoice < 0)
|
||||||
iChoice = 0;
|
iChoice = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// SANDRO - Function to determine actual cost of profile
|
// SANDRO - Function to determine actual cost of profile
|
||||||
@@ -1753,7 +1750,7 @@ INT32 iGetProfileCost()
|
|||||||
if (gGameExternalOptions.fDynamicIMPProfileCost)
|
if (gGameExternalOptions.fDynamicIMPProfileCost)
|
||||||
{
|
{
|
||||||
// silversurfer: When we create an IMP he doesn't occupy a slot yet so we need to add 1 to get the correct price in advance.
|
// silversurfer: When we create an IMP he doesn't occupy a slot yet so we need to add 1 to get the correct price in advance.
|
||||||
INT32 iIMPProfileCost = gGameExternalOptions.iIMPProfileCost * (CountFilledIMPSlots( -1 ) + 1);
|
INT32 iIMPProfileCost = gGameExternalOptions.iIMPProfileCost * (CountFilledIMPSlots() + 1);
|
||||||
|
|
||||||
if ( iIMPProfileCost + impgearcost >= gGameExternalOptions.iIMPProfileCost )
|
if ( iIMPProfileCost + impgearcost >= gGameExternalOptions.iIMPProfileCost )
|
||||||
return iIMPProfileCost + impgearcost;
|
return iIMPProfileCost + impgearcost;
|
||||||
@@ -1761,6 +1758,3 @@ INT32 iGetProfileCost()
|
|||||||
|
|
||||||
return gGameExternalOptions.iIMPProfileCost + impgearcost;
|
return gGameExternalOptions.iIMPProfileCost + impgearcost;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -408,7 +408,7 @@ void ProcessPlayerInputActivationString( void )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CountFilledIMPSlots(-1) < gGameOptions.ubMaxIMPCharacters)
|
if (CountFilledIMPSlots() < gGameOptions.ubMaxIMPCharacters)
|
||||||
{
|
{
|
||||||
// Kaiden: Need to reset skills, attributes and personalities with the new UB Method.
|
// Kaiden: Need to reset skills, attributes and personalities with the new UB Method.
|
||||||
ResetSkillsAttributesAndPersonality( );
|
ResetSkillsAttributesAndPersonality( );
|
||||||
@@ -430,7 +430,7 @@ void ProcessPlayerInputActivationString( void )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CountFilledIMPSlots(-1) < gGameOptions.ubMaxIMPCharacters)
|
if (CountFilledIMPSlots() < gGameOptions.ubMaxIMPCharacters)
|
||||||
{
|
{
|
||||||
if (LoadImpCharacter( IMP_MERC_FILENAME ) == TRUE)
|
if (LoadImpCharacter( IMP_MERC_FILENAME ) == TRUE)
|
||||||
{
|
{
|
||||||
@@ -456,7 +456,7 @@ void ProcessPlayerInputActivationString( void )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CountFilledIMPSlots(-1) < gGameOptions.ubMaxIMPCharacters)
|
if (CountFilledIMPSlots() < gGameOptions.ubMaxIMPCharacters)
|
||||||
{
|
{
|
||||||
if (LoadImpCharacter( charPlayerActivationString ) == TRUE)
|
if (LoadImpCharacter( charPlayerActivationString ) == TRUE)
|
||||||
{
|
{
|
||||||
|
|||||||
+18
-265
@@ -29,7 +29,6 @@
|
|||||||
|
|
||||||
#define MAIN_PAGE_BUTTON_TEXT_WIDTH 95
|
#define MAIN_PAGE_BUTTON_TEXT_WIDTH 95
|
||||||
|
|
||||||
|
|
||||||
#define MAIN_PAGE_SPACE_BTN_BUTTONS 120
|
#define MAIN_PAGE_SPACE_BTN_BUTTONS 120
|
||||||
|
|
||||||
#define MAIN_PAGE__FIRST_BUTTON_POS_X ( LAPTOP_SCREEN_UL_X + 15 )
|
#define MAIN_PAGE__FIRST_BUTTON_POS_X ( LAPTOP_SCREEN_UL_X + 15 )
|
||||||
@@ -37,12 +36,10 @@
|
|||||||
#define MAIN_PAGE__THIRD_BUTTON_POS_X ( MAIN_PAGE__SECOND_BUTTON_POS_X + MAIN_PAGE_SPACE_BTN_BUTTONS )
|
#define MAIN_PAGE__THIRD_BUTTON_POS_X ( MAIN_PAGE__SECOND_BUTTON_POS_X + MAIN_PAGE_SPACE_BTN_BUTTONS )
|
||||||
#define MAIN_PAGE__FOURTH_BUTTON_POS_X ( MAIN_PAGE__THIRD_BUTTON_POS_X + MAIN_PAGE_SPACE_BTN_BUTTONS )
|
#define MAIN_PAGE__FOURTH_BUTTON_POS_X ( MAIN_PAGE__THIRD_BUTTON_POS_X + MAIN_PAGE_SPACE_BTN_BUTTONS )
|
||||||
|
|
||||||
|
|
||||||
// main page buttons
|
// main page buttons
|
||||||
INT32 giIMPMainPageButton[6];
|
INT32 giIMPMainPageButton[6];
|
||||||
INT32 giIMPMainPageButtonImage[6];
|
INT32 giIMPMainPageButtonImage[6];
|
||||||
|
|
||||||
|
|
||||||
// mouse regions for not entablable warning
|
// mouse regions for not entablable warning
|
||||||
MOUSE_REGION pIMPMainPageMouseRegions[ 4 ];
|
MOUSE_REGION pIMPMainPageMouseRegions[ 4 ];
|
||||||
|
|
||||||
@@ -70,7 +67,6 @@ BOOLEAN IMP_CanWeDisplaySpecialtiesGraph( );
|
|||||||
BOOLEAN IMP_CanWeDisplayAttributeGraph( );
|
BOOLEAN IMP_CanWeDisplayAttributeGraph( );
|
||||||
BOOLEAN IMP_CanWeDisplayPortrait( );
|
BOOLEAN IMP_CanWeDisplayPortrait( );
|
||||||
|
|
||||||
|
|
||||||
BOOLEAN CheckIfFinishedCharacterGeneration( void );
|
BOOLEAN CheckIfFinishedCharacterGeneration( void );
|
||||||
|
|
||||||
// this is the current state of profiling the player is in.
|
// this is the current state of profiling the player is in.
|
||||||
@@ -85,171 +81,6 @@ BOOLEAN CheckIfFinishedCharacterGeneration( void );
|
|||||||
|
|
||||||
INT32 iCurrentProfileMode = IMP__REGISTRY;
|
INT32 iCurrentProfileMode = IMP__REGISTRY;
|
||||||
|
|
||||||
// Return a count of how many IMP slots there are in total
|
|
||||||
INT32 CountIMPSlots()
|
|
||||||
{
|
|
||||||
INT32 idx;
|
|
||||||
// Keep a static count so we only count once
|
|
||||||
static INT32 iMaxIMPs = -1;
|
|
||||||
if (iMaxIMPs != -1)
|
|
||||||
return iMaxIMPs;
|
|
||||||
|
|
||||||
iMaxIMPs = 0;
|
|
||||||
// Count the males
|
|
||||||
for (idx = GetFirstMaleSlot(); idx <= GetLastMaleSlot(); ++idx)
|
|
||||||
{
|
|
||||||
++iMaxIMPs;
|
|
||||||
}
|
|
||||||
// Count the females
|
|
||||||
for (idx = GetFirstFemaleSlot(); idx <= GetLastFemaleSlot(); ++idx)
|
|
||||||
{
|
|
||||||
++iMaxIMPs;
|
|
||||||
}
|
|
||||||
Assert(iMaxIMPs > 0);
|
|
||||||
return iMaxIMPs;
|
|
||||||
}
|
|
||||||
|
|
||||||
INT32 GetFirstSlot(INT8 iSex)
|
|
||||||
{
|
|
||||||
if (iSex == MALE)
|
|
||||||
return GetFirstMaleSlot();
|
|
||||||
else if (iSex == FEMALE)
|
|
||||||
return GetFirstFemaleSlot();
|
|
||||||
else {
|
|
||||||
return GetFirstMaleSlot();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
INT32 GetLastSlot(INT8 iSex)
|
|
||||||
{
|
|
||||||
if (iSex == MALE)
|
|
||||||
return GetLastMaleSlot();
|
|
||||||
else if (iSex == FEMALE)
|
|
||||||
return GetLastFemaleSlot();
|
|
||||||
else {
|
|
||||||
return GetLastFemaleSlot();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
INT32 GetFirstFreeSlot(INT8 iSex) {
|
|
||||||
INT32 iStart = GetFirstSlot(iSex);
|
|
||||||
INT32 iEnd = GetLastSlot(iSex);
|
|
||||||
INT32 idx;
|
|
||||||
|
|
||||||
for (idx = iStart; idx <= iEnd; ++idx)
|
|
||||||
{
|
|
||||||
if (IsIMPSlotFree(gGameExternalOptions.iaIMPSlots[idx]) == TRUE)
|
|
||||||
return idx;
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Return a count of how many IMP slots there are for males
|
|
||||||
INT32 CountMaleIMPSlots() {
|
|
||||||
INT32 idx;
|
|
||||||
// Keep a static count so we only count once
|
|
||||||
static INT32 iMaxMaleIMPS = -1;
|
|
||||||
if (iMaxMaleIMPS != -1)
|
|
||||||
return iMaxMaleIMPS;
|
|
||||||
|
|
||||||
iMaxMaleIMPS = 0;
|
|
||||||
for (idx = GetFirstMaleSlot(); idx <= GetLastMaleSlot(); ++idx)
|
|
||||||
// Count the males
|
|
||||||
{
|
|
||||||
++iMaxMaleIMPS;
|
|
||||||
}
|
|
||||||
Assert(iMaxMaleIMPS > 0);
|
|
||||||
return iMaxMaleIMPS;
|
|
||||||
}
|
|
||||||
INT32 GetFirstMaleSlot() {
|
|
||||||
Assert(gGameExternalOptions.iaIMPSlots[0] != -1);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
INT32 GetLastMaleSlot() {
|
|
||||||
// Keep a static count so we only count once
|
|
||||||
static INT32 idx = -1;
|
|
||||||
if (idx != -1)
|
|
||||||
return idx;
|
|
||||||
|
|
||||||
idx = 0;
|
|
||||||
// Skip the males
|
|
||||||
while (gGameExternalOptions.iaIMPSlots[idx] != -1)
|
|
||||||
{
|
|
||||||
++idx;
|
|
||||||
}
|
|
||||||
--idx;
|
|
||||||
Assert(idx >= 0);
|
|
||||||
Assert(gGameExternalOptions.iaIMPSlots[idx] != -1);
|
|
||||||
return idx;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Return a count of how many IMP slots there are for females
|
|
||||||
INT32 CountFemaleIMPSlots() {
|
|
||||||
INT32 idx;
|
|
||||||
// Keep a static count so we only count once
|
|
||||||
static INT32 iMaxFemaleIMPS = -1;
|
|
||||||
if (iMaxFemaleIMPS != -1)
|
|
||||||
return iMaxFemaleIMPS;
|
|
||||||
|
|
||||||
iMaxFemaleIMPS = 0;
|
|
||||||
for (idx = GetFirstFemaleSlot(); idx <= GetLastFemaleSlot(); ++idx)
|
|
||||||
// Count the males
|
|
||||||
{
|
|
||||||
++iMaxFemaleIMPS;
|
|
||||||
}
|
|
||||||
Assert(iMaxFemaleIMPS > 0);
|
|
||||||
return iMaxFemaleIMPS;
|
|
||||||
}
|
|
||||||
INT32 GetFirstFemaleSlot() {
|
|
||||||
// Keep a static count so we only count once
|
|
||||||
static INT32 idx = -1;
|
|
||||||
if (idx != -1)
|
|
||||||
return idx;
|
|
||||||
|
|
||||||
idx = 0;
|
|
||||||
// Skip the males
|
|
||||||
while (gGameExternalOptions.iaIMPSlots[idx] != -1)
|
|
||||||
{
|
|
||||||
++idx;
|
|
||||||
}
|
|
||||||
++idx;
|
|
||||||
Assert(idx >= 0);
|
|
||||||
Assert(gGameExternalOptions.iaIMPSlots[idx] != -1);
|
|
||||||
return idx;
|
|
||||||
}
|
|
||||||
INT32 GetLastFemaleSlot() {
|
|
||||||
// Keep a static count so we only count once
|
|
||||||
static INT32 idx = -1;
|
|
||||||
if (idx != -1)
|
|
||||||
return idx;
|
|
||||||
|
|
||||||
idx = 0;
|
|
||||||
// Skip the males
|
|
||||||
while (gGameExternalOptions.iaIMPSlots[idx] != -1)
|
|
||||||
{
|
|
||||||
++idx;
|
|
||||||
}
|
|
||||||
++idx;
|
|
||||||
// Skip the females
|
|
||||||
while (gGameExternalOptions.iaIMPSlots[idx] != -1)
|
|
||||||
{
|
|
||||||
++idx;
|
|
||||||
}
|
|
||||||
--idx;
|
|
||||||
Assert(idx >= 0);
|
|
||||||
Assert(gGameExternalOptions.iaIMPSlots[idx] != -1);
|
|
||||||
return idx;
|
|
||||||
}
|
|
||||||
|
|
||||||
INT32 GetVoiceCountFromVoiceSlot(INT32 iSlot) {
|
|
||||||
if (iSlot <= GetLastMaleSlot())
|
|
||||||
return iSlot - GetFirstMaleSlot() + 1;
|
|
||||||
else
|
|
||||||
return iSlot - GetFirstFemaleSlot() + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
BOOLEAN IsIMPSlotFree(INT32 iIMPId)
|
BOOLEAN IsIMPSlotFree(INT32 iIMPId)
|
||||||
{
|
{
|
||||||
if ((iIMPId >= 0) && (iIMPId < NUM_PROFILES) &&
|
if ((iIMPId >= 0) && (iIMPId < NUM_PROFILES) &&
|
||||||
@@ -264,7 +95,6 @@ BOOLEAN IsIMPSlotFree(INT32 iIMPId)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void EnterIMPMainPage( void )
|
void EnterIMPMainPage( void )
|
||||||
{
|
{
|
||||||
// turn off review mode
|
// turn off review mode
|
||||||
@@ -286,7 +116,6 @@ void EnterIMPMainPage( void )
|
|||||||
RenderIMPMainPage( );
|
RenderIMPMainPage( );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ExitIMPMainPage( void )
|
void ExitIMPMainPage( void )
|
||||||
{
|
{
|
||||||
// exit from IMP About us page
|
// exit from IMP About us page
|
||||||
@@ -296,7 +125,6 @@ void ExitIMPMainPage( void )
|
|||||||
DestoryMouseRegionsForIMPMainPageBasedOnCharGenStatus( );
|
DestoryMouseRegionsForIMPMainPageBasedOnCharGenStatus( );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void RenderIMPMainPage( void )
|
void RenderIMPMainPage( void )
|
||||||
{
|
{
|
||||||
// rneders the IMP about us page
|
// rneders the IMP about us page
|
||||||
@@ -310,7 +138,6 @@ void RenderIMPMainPage( void )
|
|||||||
RenderMainIndentFrame( 164, 74 );
|
RenderMainIndentFrame( 164, 74 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void HandleIMPMainPage( void )
|
void HandleIMPMainPage( void )
|
||||||
{
|
{
|
||||||
// handles the IMP about main page
|
// handles the IMP about main page
|
||||||
@@ -855,8 +682,6 @@ void UpDateIMPMainPageButtons( void )
|
|||||||
*/
|
*/
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BeginMessageBoxCallBack( UINT8 bExitValue )
|
void BeginMessageBoxCallBack( UINT8 bExitValue )
|
||||||
@@ -865,22 +690,20 @@ void BeginMessageBoxCallBack( UINT8 bExitValue )
|
|||||||
if( bExitValue == MSG_BOX_RETURN_YES )
|
if( bExitValue == MSG_BOX_RETURN_YES )
|
||||||
{
|
{
|
||||||
iCurrentImpPage = IMP_BEGIN;
|
iCurrentImpPage = IMP_BEGIN;
|
||||||
iCurrentProfileMode = IMP__REGISTRY;
|
iCurrentProfileMode = IMP__REGISTRY;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if( bExitValue == MSG_BOX_RETURN_OK )
|
else if( bExitValue == MSG_BOX_RETURN_OK )
|
||||||
{
|
{
|
||||||
// if ok, then we are coming from financial warning, allow continue
|
// if ok, then we are coming from financial warning, allow continue
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CreateMouseRegionsForIMPMainPageBasedOnCharGenStatus( void )
|
void CreateMouseRegionsForIMPMainPageBasedOnCharGenStatus( void )
|
||||||
{
|
{
|
||||||
// this procedure will create masks for the char generation main page
|
// this procedure will create masks for the char generation main page
|
||||||
|
|
||||||
|
|
||||||
// mask for personality page button
|
// mask for personality page button
|
||||||
MSYS_DefineRegion( &pIMPMainPageMouseRegions[ 0 ],LAPTOP_SCREEN_UL_X + 13 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ), LAPTOP_SCREEN_UL_X + 13 + 115 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ) + 93 , MSYS_PRIORITY_HIGH+5,
|
MSYS_DefineRegion( &pIMPMainPageMouseRegions[ 0 ],LAPTOP_SCREEN_UL_X + 13 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ), LAPTOP_SCREEN_UL_X + 13 + 115 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ) + 93 , MSYS_PRIORITY_HIGH+5,
|
||||||
CURSOR_WWW, MSYS_NO_CALLBACK, IMPMainPageNotSelectableBtnCallback );
|
CURSOR_WWW, MSYS_NO_CALLBACK, IMPMainPageNotSelectableBtnCallback );
|
||||||
@@ -889,15 +712,10 @@ void CreateMouseRegionsForIMPMainPageBasedOnCharGenStatus( void )
|
|||||||
MSYS_DefineRegion( &pIMPMainPageMouseRegions[ 1 ],LAPTOP_SCREEN_UL_X + 133 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ), LAPTOP_SCREEN_UL_X + 133 + 115 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ) + 93 , MSYS_PRIORITY_HIGH+5,
|
MSYS_DefineRegion( &pIMPMainPageMouseRegions[ 1 ],LAPTOP_SCREEN_UL_X + 133 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ), LAPTOP_SCREEN_UL_X + 133 + 115 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ) + 93 , MSYS_PRIORITY_HIGH+5,
|
||||||
CURSOR_WWW, MSYS_NO_CALLBACK, IMPMainPageNotSelectableBtnCallback );
|
CURSOR_WWW, MSYS_NO_CALLBACK, IMPMainPageNotSelectableBtnCallback );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// mask for portrait page button
|
// mask for portrait page button
|
||||||
MSYS_DefineRegion( &pIMPMainPageMouseRegions[ 2 ],LAPTOP_SCREEN_UL_X + 253 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ), LAPTOP_SCREEN_UL_X + 253 + 115 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ) + 93 , MSYS_PRIORITY_HIGH+5,
|
MSYS_DefineRegion( &pIMPMainPageMouseRegions[ 2 ],LAPTOP_SCREEN_UL_X + 253 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ), LAPTOP_SCREEN_UL_X + 253 + 115 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ) + 93 , MSYS_PRIORITY_HIGH+5,
|
||||||
CURSOR_WWW, MSYS_NO_CALLBACK, IMPMainPageNotSelectableBtnCallback );
|
CURSOR_WWW, MSYS_NO_CALLBACK, IMPMainPageNotSelectableBtnCallback );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// mask for voice page button
|
// mask for voice page button
|
||||||
MSYS_DefineRegion( &pIMPMainPageMouseRegions[ 3 ],LAPTOP_SCREEN_UL_X + 373 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ), LAPTOP_SCREEN_UL_X + 373 + 115 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ) + 93 , MSYS_PRIORITY_HIGH+5,
|
MSYS_DefineRegion( &pIMPMainPageMouseRegions[ 3 ],LAPTOP_SCREEN_UL_X + 373 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ), LAPTOP_SCREEN_UL_X + 373 + 115 , LAPTOP_SCREEN_WEB_UL_Y + ( 245 ) + 93 , MSYS_PRIORITY_HIGH+5,
|
||||||
CURSOR_WWW, MSYS_NO_CALLBACK, IMPMainPageNotSelectableBtnCallback );
|
CURSOR_WWW, MSYS_NO_CALLBACK, IMPMainPageNotSelectableBtnCallback );
|
||||||
@@ -908,11 +726,8 @@ void DestoryMouseRegionsForIMPMainPageBasedOnCharGenStatus( void )
|
|||||||
// will destroy button masks for the char gen pages
|
// will destroy button masks for the char gen pages
|
||||||
|
|
||||||
MSYS_RemoveRegion( &pIMPMainPageMouseRegions[ 0 ]);
|
MSYS_RemoveRegion( &pIMPMainPageMouseRegions[ 0 ]);
|
||||||
|
|
||||||
MSYS_RemoveRegion( &pIMPMainPageMouseRegions[ 1 ]);
|
MSYS_RemoveRegion( &pIMPMainPageMouseRegions[ 1 ]);
|
||||||
|
|
||||||
MSYS_RemoveRegion( &pIMPMainPageMouseRegions[ 2 ]);
|
MSYS_RemoveRegion( &pIMPMainPageMouseRegions[ 2 ]);
|
||||||
|
|
||||||
MSYS_RemoveRegion( &pIMPMainPageMouseRegions[ 3 ]);
|
MSYS_RemoveRegion( &pIMPMainPageMouseRegions[ 3 ]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -920,8 +735,7 @@ void IMPMainPageNotSelectableBtnCallback(MOUSE_REGION * pRegion, INT32 iReason )
|
|||||||
{
|
{
|
||||||
if (iReason & MSYS_CALLBACK_REASON_INIT)
|
if (iReason & MSYS_CALLBACK_REASON_INIT)
|
||||||
{
|
{
|
||||||
|
return;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
|
if(iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
|
||||||
@@ -931,18 +745,12 @@ void IMPMainPageNotSelectableBtnCallback(MOUSE_REGION * pRegion, INT32 iReason )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// WDS: Allow flexible numbers of IMPs of each sex
|
// WDS: Allow flexible numbers of IMPs of each sex
|
||||||
INT32 CountFilledIMPSlots( INT8 iSex )
|
INT32 CountFilledIMPSlots()
|
||||||
{
|
{
|
||||||
INT32 i;
|
|
||||||
INT32 iCount = 0;
|
INT32 iCount = 0;
|
||||||
INT32 iStart;
|
|
||||||
INT32 iEnd;
|
|
||||||
|
|
||||||
iStart = GetFirstSlot(iSex);
|
|
||||||
iEnd = GetLastSlot(iSex);
|
|
||||||
|
|
||||||
// Count the used slots
|
// Count the used slots
|
||||||
for (i = iStart; i <= iEnd; ++i)
|
for ( INT32 i = 0; i < gGameExternalOptions.iMaxIMPCharacters; ++i)
|
||||||
{
|
{
|
||||||
if ((gGameExternalOptions.iaIMPSlots[i] != -1) &&
|
if ((gGameExternalOptions.iaIMPSlots[i] != -1) &&
|
||||||
(!IsIMPSlotFree(gGameExternalOptions.iaIMPSlots[i])))
|
(!IsIMPSlotFree(gGameExternalOptions.iaIMPSlots[i])))
|
||||||
@@ -955,18 +763,12 @@ INT32 CountFilledIMPSlots( INT8 iSex )
|
|||||||
return iCount;
|
return iCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
INT32 CountEmptyIMPSlots( INT8 iSex )
|
INT32 CountEmptyIMPSlots()
|
||||||
{
|
{
|
||||||
INT32 i;
|
|
||||||
INT32 iCount = 0;
|
INT32 iCount = 0;
|
||||||
INT32 iStart;
|
|
||||||
INT32 iEnd;
|
|
||||||
|
|
||||||
iStart = GetFirstSlot(iSex);
|
|
||||||
iEnd = GetLastSlot(iSex);
|
|
||||||
|
|
||||||
// Count the free slots
|
// Count the free slots
|
||||||
for (i = iStart; i <= iEnd; ++i)
|
for ( INT32 i = 0; i < gGameExternalOptions.iMaxIMPCharacters; ++i)
|
||||||
{
|
{
|
||||||
if (IsIMPSlotFree(gGameExternalOptions.iaIMPSlots[i]))
|
if (IsIMPSlotFree(gGameExternalOptions.iaIMPSlots[i]))
|
||||||
{
|
{
|
||||||
@@ -978,75 +780,26 @@ INT32 CountEmptyIMPSlots( INT8 iSex )
|
|||||||
return iCount;
|
return iCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
INT32 GetFreeIMPSlot(INT32 iDefaultIMPId)
|
||||||
INT32 GetSexOfIMP(INT32 iIMPId)
|
|
||||||
{
|
{
|
||||||
INT32 ui;
|
// We have a default imp id (90210 or nickname)
|
||||||
//CHRISL: There is "padding" build into the iaIMPSLots array. The index after the last male and female entry are both set
|
if (iDefaultIMPId != -1)
|
||||||
// to -1. The following loop, however, does not take this into consideration. A female IMP using iIMPId 56 will never
|
|
||||||
// get setup correctly, resulting in the "Assert(FALSE)" the occurs after the loop. Since the array is initially setup
|
|
||||||
// by adding 2 to the male/female totals, do the same here.
|
|
||||||
//for (ui = 0; ui < CountIMPSlots(); ++ui)
|
|
||||||
for (ui = 0; ui < CountIMPSlots()+2; ++ui)
|
|
||||||
{
|
{
|
||||||
if (gGameExternalOptions.iaIMPSlots[ui] == iIMPId)
|
if (IsIMPSlotFree(iDefaultIMPId))
|
||||||
{
|
{
|
||||||
if (ui <= GetLastMaleSlot())
|
return iDefaultIMPId;
|
||||||
return MALE;
|
|
||||||
else
|
|
||||||
return FEMALE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Assert(FALSE);
|
|
||||||
return MALE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// The default IMP id is already used, find next free imp id
|
||||||
|
|
||||||
INT32 GetFreeIMPSlot(INT32 iIMPId, INT32 iDefaultIMPId)
|
// Find a free imp slot
|
||||||
{
|
for (INT32 i = 0; i < gGameExternalOptions.iMaxIMPCharacters; ++i)
|
||||||
INT32 iStart;
|
|
||||||
INT32 iEnd;
|
|
||||||
INT32 i;
|
|
||||||
|
|
||||||
UINT32 iSex = GetSexOfIMP(iIMPId);
|
|
||||||
|
|
||||||
if (iIMPId != -1)
|
|
||||||
{
|
{
|
||||||
// We have a default imp id (90210 or nickname)
|
// Found a free imp slot
|
||||||
if (iDefaultIMPId != -1)
|
if (IsIMPSlotFree(gGameExternalOptions.iaIMPSlots[i]))
|
||||||
{
|
{
|
||||||
if (IsIMPSlotFree(iDefaultIMPId))
|
return gGameExternalOptions.iaIMPSlots[i];
|
||||||
{
|
|
||||||
return iDefaultIMPId;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// The default IMP id is already used, find next free imp id
|
|
||||||
// Female
|
|
||||||
if (iSex == FEMALE)
|
|
||||||
{
|
|
||||||
iStart = GetFirstFemaleSlot();
|
|
||||||
iEnd = GetLastFemaleSlot();
|
|
||||||
}
|
|
||||||
else if (iSex == MALE)
|
|
||||||
{
|
|
||||||
iStart = GetFirstMaleSlot();
|
|
||||||
iEnd = GetLastMaleSlot();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
AssertMsg( 0, "Merc neither male nor female");
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Find a free imp slot
|
|
||||||
for (i = iStart; i <= iEnd; ++i)
|
|
||||||
{
|
|
||||||
// Found a free imp slot
|
|
||||||
if (IsIMPSlotFree(gGameExternalOptions.iaIMPSlots[i]))
|
|
||||||
{
|
|
||||||
return gGameExternalOptions.iaIMPSlots[i];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-29
@@ -8,39 +8,16 @@ void EnterIMPMainPage( void );
|
|||||||
void HandleIMPMainPage( void );
|
void HandleIMPMainPage( void );
|
||||||
void NextProfilingMode( void );
|
void NextProfilingMode( void );
|
||||||
void ShadeUnSelectableButtons( void );
|
void ShadeUnSelectableButtons( void );
|
||||||
|
|
||||||
BOOLEAN IsIMPSlotFree(INT32 iIMPId);
|
BOOLEAN IsIMPSlotFree(INT32 iIMPId);
|
||||||
|
INT32 GetFreeIMPSlot(INT32 iDefaultIMPId);
|
||||||
|
|
||||||
INT32 GetFreeIMPSlot(INT32 iIMPId, INT32 iDefaultIMPId);
|
// WDS: Allow flexible numbers of IMPs
|
||||||
|
INT32 CountFilledIMPSlots();
|
||||||
// WDS: Allow flexible numbers of IMPs of each sex
|
INT32 CountEmptyIMPSlots();
|
||||||
INT32 CountFilledIMPSlots( INT8 iSex );
|
|
||||||
INT32 CountEmptyIMPSlots( INT8 iSex );
|
|
||||||
|
|
||||||
// Return a count of how many IMP slots there are
|
|
||||||
INT32 CountIMPSlots();
|
|
||||||
INT32 CountMaleIMPSlots();
|
|
||||||
INT32 CountFemaleIMPSlots();
|
|
||||||
|
|
||||||
// Get the first/last slots
|
|
||||||
INT32 GetFirstSlot(INT8 iSex);
|
|
||||||
INT32 GetLastSlot(INT8 iSex);
|
|
||||||
INT32 GetFirstFreeSlot(INT8 iSex);
|
|
||||||
INT32 GetFirstMaleSlot();
|
|
||||||
INT32 GetLastMaleSlot();
|
|
||||||
INT32 GetFirstFemaleSlot();
|
|
||||||
INT32 GetLastFemaleSlot();
|
|
||||||
|
|
||||||
// This returns a count of how any slots along we are in the potential
|
|
||||||
// slot list. Usable for displaying on the "Voice" button in the interface
|
|
||||||
// and probably not much else.
|
|
||||||
INT32 GetVoiceCountFromVoiceSlot(INT32 iSlot);
|
|
||||||
|
|
||||||
// Given an IMP slot # (0 to NUM_PROFILES-1) return MALE or FEMALE
|
|
||||||
INT32 GetSexOfIMP(INT32 iIMPId);
|
|
||||||
|
|
||||||
extern INT32 iCurrentProfileMode;
|
extern INT32 iCurrentProfileMode;
|
||||||
|
|
||||||
|
|
||||||
//enums for the various Profile modes
|
//enums for the various Profile modes
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
@@ -52,5 +29,4 @@ enum
|
|||||||
IMP__FINISH,
|
IMP__FINISH,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
Reference in New Issue
Block a user