mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
- added new disability "Fear of heights"
- Fix: wrong backgrounds were filtered out when checking for personality/disability/traits git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8351 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -642,13 +642,13 @@ BOOLEAN IsBackGroundAllowed( UINT16 ubNumber )
|
||||
|
||||
if ( SkillsList[0] == TECHNICIAN_NT || SkillsList[1] == TECHNICIAN_NT || SkillsList[2] == TECHNICIAN_NT )
|
||||
{
|
||||
if ( zBackground[ ubNumber ].value[MECHANICAL] < 0 )
|
||||
if ( zBackground[ ubNumber ].value[BG_MECHANICAL] < 0 )
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if ( SkillsList[0] == DOCTOR_NT || SkillsList[1] == DOCTOR_NT || SkillsList[2] == DOCTOR_NT )
|
||||
{
|
||||
if ( zBackground[ ubNumber ].value[MEDICAL] < 0 )
|
||||
if ( zBackground[ ubNumber ].value[BG_MEDICAL] < 0 )
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -672,7 +672,7 @@ BOOLEAN IsBackGroundAllowed( UINT16 ubNumber )
|
||||
|
||||
if ( SkillsList[0] == DEMOLITIONS_NT || SkillsList[1] == DEMOLITIONS_NT || SkillsList[2] == DEMOLITIONS_NT )
|
||||
{
|
||||
if ( zBackground[ ubNumber ].value[EXPLOSIVE_ASSIGN] < 0 )
|
||||
if ( zBackground[ ubNumber ].value[BG_EXPLOSIVE_ASSIGN] < 0 )
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -697,11 +697,15 @@ BOOLEAN IsBackGroundAllowed( UINT16 ubNumber )
|
||||
return FALSE;
|
||||
break;
|
||||
case FORGETFUL:
|
||||
if ( zBackground[ ubNumber ].value[LEADERSHIP] > 0 )
|
||||
if ( zBackground[ ubNumber ].value[BG_LEADERSHIP] > 0 )
|
||||
return FALSE;
|
||||
break;
|
||||
case PSYCHO:
|
||||
if ( zBackground[ ubNumber ].value[LEADERSHIP] > 0 )
|
||||
if ( zBackground[ ubNumber ].value[BG_LEADERSHIP] > 0 )
|
||||
return FALSE;
|
||||
break;
|
||||
case AFRAID_OF_HEIGHTS:
|
||||
if ( zBackground[ubNumber].value[BG_HEIGHT] > 0 )
|
||||
return FALSE;
|
||||
break;
|
||||
default:
|
||||
@@ -716,7 +720,7 @@ BOOLEAN IsBackGroundAllowed( UINT16 ubNumber )
|
||||
return FALSE;
|
||||
break;
|
||||
case CHAR_TRAIT_LONER:
|
||||
if ( zBackground[ ubNumber ].value[LEADERSHIP] > 0 )
|
||||
if ( zBackground[ ubNumber ].value[BG_LEADERSHIP] > 0 )
|
||||
return FALSE;
|
||||
break;
|
||||
case CHAR_TRAIT_OPTIMIST:
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
enum
|
||||
{
|
||||
IMP_DISABILITY_TRAIT__TITLE_TEXT=IMP_DISABILITIES_NUMBER,
|
||||
IMP_DISABILITY_TRAIT__TITLE_TEXT = NUM_DISABILITIES,
|
||||
};
|
||||
|
||||
|
||||
@@ -65,11 +65,11 @@ enum
|
||||
|
||||
BOOLEAN gfIST_Redraw3=FALSE;
|
||||
|
||||
BOOLEAN gfDisabilityTraitQuestions[ IMP_DISABILITIES_NUMBER ];
|
||||
BOOLEAN gfDisabilityTraitQuestions[NUM_DISABILITIES];
|
||||
|
||||
// these are the buttons for the questions
|
||||
INT32 giIMPDisabilityTraitAnswerButton[ IMP_DISABILITIES_NUMBER ];
|
||||
INT32 giIMPDisabilityTraitAnswerButtonImage[ IMP_DISABILITIES_NUMBER ];
|
||||
INT32 giIMPDisabilityTraitAnswerButton[NUM_DISABILITIES];
|
||||
INT32 giIMPDisabilityTraitAnswerButtonImage[NUM_DISABILITIES];
|
||||
|
||||
// this is the Done buttons
|
||||
INT32 giIMPDisabilityTraitFinsihButton;
|
||||
@@ -78,7 +78,7 @@ INT32 giIMPDisabilityTraitFinsihButtonImage;
|
||||
//image handle
|
||||
UINT32 guiIST_GreyGoldBox3;
|
||||
|
||||
MOUSE_REGION gMR_DisabilityHelpTextRegions[ IMP_DISABILITIES_NUMBER ];
|
||||
MOUSE_REGION gMR_DisabilityHelpTextRegions[NUM_DISABILITIES];
|
||||
|
||||
//*******************************************************************
|
||||
//
|
||||
@@ -140,7 +140,7 @@ void EnterIMPDisabilityTrait( void )
|
||||
if( iCurrentProfileMode != IMP__FINISH )
|
||||
{
|
||||
//Have the NONE trait initially selected
|
||||
gfDisabilityTraitQuestions[ IMP_NO_DISABILITY ] = TRUE;
|
||||
gfDisabilityTraitQuestions[ NO_DISABILITY ] = TRUE;
|
||||
}
|
||||
|
||||
HandleDisabilityTraitButtonStates( );
|
||||
@@ -148,7 +148,7 @@ void EnterIMPDisabilityTrait( void )
|
||||
// add regions for help texts
|
||||
UINT16 usPosX = IMP_DISABILITY_COLUMN_START_X + 62;
|
||||
UINT16 usPosY = IMP_DISABILITY_COLUMN_START_Y + 8;
|
||||
for( UINT8 ubCnt=0; ubCnt<IMP_DISABILITIES_NUMBER; ubCnt++ )
|
||||
for ( UINT8 ubCnt = 0; ubCnt<NUM_DISABILITIES; ubCnt++ )
|
||||
{
|
||||
MSYS_DefineRegion( &gMR_DisabilityHelpTextRegions[ubCnt], usPosX, ( usPosY ),
|
||||
(usPosX + 156), ( usPosY + 17), MSYS_PRIORITY_HIGH,
|
||||
@@ -176,7 +176,7 @@ void RenderIMPDisabilityTrait( void )
|
||||
RenderProfileBackGround();
|
||||
|
||||
// Display title
|
||||
DrawTextToScreen( gzIMPDisabilityTraitText[IMP_DISABILITIES_NUMBER], LAPTOP_SCREEN_UL_X - 111, LAPTOP_TITLE_Y, LAPTOP_TEXT_WIDTH, FONT14ARIAL, FONT_MCOLOR_WHITE, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
|
||||
DrawTextToScreen( gzIMPDisabilityTraitText[NUM_DISABILITIES], LAPTOP_SCREEN_UL_X - 111, LAPTOP_TITLE_Y, LAPTOP_TEXT_WIDTH, FONT14ARIAL, FONT_MCOLOR_WHITE, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
|
||||
|
||||
IMPDisabilityTraitDisplayDisabilityTraits();
|
||||
}
|
||||
@@ -189,7 +189,7 @@ void ExitIMPDisabilityTrait( void )
|
||||
DeleteVideoObjectFromIndex( guiIST_GreyGoldBox3 );
|
||||
|
||||
//remove the skill buttons
|
||||
for(ubCnt = 0; ubCnt < IMP_DISABILITIES_NUMBER; ubCnt++)
|
||||
for ( ubCnt = 0; ubCnt < NUM_DISABILITIES; ubCnt++ )
|
||||
{
|
||||
//if there is a button allocated
|
||||
if( giIMPDisabilityTraitAnswerButton[ubCnt] != -1 )
|
||||
@@ -225,7 +225,7 @@ void AddImpDisabilityTraitButtons()
|
||||
usPosX = IMP_DISABILITY_COLUMN_START_X;
|
||||
usPosY = IMP_DISABILITY_COLUMN_START_Y;
|
||||
|
||||
for(ubCnt = 0; ubCnt < IMP_DISABILITIES_NUMBER; ubCnt++)
|
||||
for ( ubCnt = 0; ubCnt < NUM_DISABILITIES; ubCnt++ )
|
||||
{
|
||||
//reset
|
||||
giIMPDisabilityTraitAnswerButton[ubCnt] = -1;
|
||||
@@ -294,13 +294,13 @@ void HandleIMPDisabilityTraitAnswers( UINT32 uiSkillPressed )
|
||||
}
|
||||
|
||||
//reset all other buttons
|
||||
for( ubCnt=0; ubCnt<IMP_DISABILITIES_NUMBER; ubCnt++ )
|
||||
for ( ubCnt = 0; ubCnt<NUM_DISABILITIES; ++ubCnt )
|
||||
{
|
||||
gfDisabilityTraitQuestions[ ubCnt ] = FALSE;
|
||||
}
|
||||
|
||||
//make sure its a valid disability trait
|
||||
if( uiSkillPressed >= IMP_DISABILITIES_NUMBER )
|
||||
if ( uiSkillPressed >= NUM_DISABILITIES )
|
||||
{
|
||||
Assert( 0 );
|
||||
return;
|
||||
@@ -335,9 +335,7 @@ void HandleIMPDisabilityTraitAnswers( UINT32 uiSkillPressed )
|
||||
|
||||
void HandleDisabilityTraitButtonStates( )
|
||||
{
|
||||
UINT8 ubCnt;
|
||||
|
||||
for( ubCnt=0; ubCnt<IMP_DISABILITIES_NUMBER; ubCnt++ )
|
||||
for ( UINT8 ubCnt = 0; ubCnt<NUM_DISABILITIES; ++ubCnt )
|
||||
{
|
||||
//if the skill is selected ( ie depressed )
|
||||
if( gfDisabilityTraitQuestions[ ubCnt ] )
|
||||
@@ -364,7 +362,7 @@ void IMPDisabilityTraitDisplayDisabilityTraits()
|
||||
usPosX = IMP_DISABILITY_COLUMN_START_X + IMP_DISABILITY_TRAIT__TEXT_OFFSET_X;
|
||||
usPosY = IMP_DISABILITY_COLUMN_START_Y + IMP_DISABILITY_TRAIT__TEXT_OFFSET_Y;
|
||||
|
||||
for( ubCnt=0; ubCnt<IMP_DISABILITIES_NUMBER; ubCnt++ )
|
||||
for ( ubCnt = 0; ubCnt<NUM_DISABILITIES; ++ubCnt )
|
||||
{
|
||||
usBoxPosX = usPosX - IMP_DISABILITY_TRAIT__GREY_BOX_OFFSET_X;
|
||||
usBoxPosY = usPosY - IMP_DISABILITY_TRAIT__GREY_BOX_OFFSET_Y;
|
||||
@@ -452,11 +450,10 @@ BOOLEAN CameBackToDisabilityTraitPageButNotFinished()
|
||||
|
||||
INT8 iChosenDisabilityTrait()
|
||||
{
|
||||
UINT8 ubCnt;
|
||||
INT8 iDisabilityTraitNumber = 0;
|
||||
|
||||
//loop through all the buttons and reset them
|
||||
for( ubCnt=0; ubCnt<IMP_DISABILITIES_NUMBER; ubCnt++ )
|
||||
for ( UINT8 ubCnt = 0; ubCnt<NUM_DISABILITIES; ++ubCnt )
|
||||
{
|
||||
//if the trait is selected
|
||||
if( gfDisabilityTraitQuestions[ ubCnt ] )
|
||||
@@ -464,6 +461,7 @@ INT8 iChosenDisabilityTrait()
|
||||
iDisabilityTraitNumber = ubCnt;
|
||||
}
|
||||
}
|
||||
|
||||
return( iDisabilityTraitNumber );
|
||||
}
|
||||
|
||||
@@ -472,7 +470,7 @@ INT8 iPlayersAttributePointsBonusForDisabilitySelected()
|
||||
INT8 bExtraAttributePoints = 0;
|
||||
|
||||
//if there is any disability selected, give a bonus to attributes (counted there)
|
||||
if( ( iChosenDisabilityTrait() > 0 ) && ( iChosenDisabilityTrait() <= IMP_DISABILITIES_NUMBER ) )
|
||||
if ( (iChosenDisabilityTrait( ) > 0) && (iChosenDisabilityTrait( ) <= NUM_DISABILITIES) )
|
||||
{
|
||||
bExtraAttributePoints = gGameExternalOptions.iBonusPointsForDisability;
|
||||
}
|
||||
|
||||
@@ -8,27 +8,7 @@ void RenderIMPDisabilityTrait( void );
|
||||
void ExitIMPDisabilityTrait( void );
|
||||
void HandleIMPDisabilityTrait( void );
|
||||
|
||||
//enum
|
||||
//{
|
||||
typedef enum
|
||||
{
|
||||
IMP_NO_DISABILITY = 0,
|
||||
IMP_DISABILITY_HEAT_INTOLERANT,
|
||||
IMP_DISABILITY_NERVOUS,
|
||||
IMP_DISABILITY_CLAUSTROPHOBIC,
|
||||
IMP_DISABILITY_NONSWIMMER,
|
||||
IMP_DISABILITY_FEAR_OF_INSECTS,
|
||||
IMP_DISABILITY_FORGETFUL,
|
||||
IMP_DISABILITY_PSYCHO,
|
||||
IMP_DISABILITY_DEAF,
|
||||
IMP_DISABILITY_SHORTSIGHTED,
|
||||
IMP_DISABILITY_BLEEDER,
|
||||
IMP_DISABILITIES_NUMBER,
|
||||
};
|
||||
|
||||
INT8 iChosenDisabilityTrait();
|
||||
INT8 iPlayersAttributePointsBonusForDisabilitySelected();
|
||||
|
||||
STR16 gzIMPDisabilityText[];
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4128,6 +4128,16 @@ void HandleIMPCharProfileResultsMessage( void)
|
||||
|
||||
AddEmailRecordToList( pString );
|
||||
}
|
||||
else if ( gMercProfiles[iCurrentIMPSlot].bDisability == AFRAID_OF_HEIGHTS )
|
||||
{
|
||||
swprintf( pString, gzIMPDisabilityTraitEmailTextAfraidOfHeights[0] );
|
||||
|
||||
AddEmailRecordToList( pString );
|
||||
|
||||
swprintf( pString, gzIMPDisabilityTraitEmailTextAfraidOfHeights[1] );
|
||||
|
||||
AddEmailRecordToList( pString );
|
||||
}
|
||||
else
|
||||
{
|
||||
// personality tick
|
||||
|
||||
Reference in New Issue
Block a user