new disabilities:

- 'deaf' reduces hearing ability
- 'shortsighted' reduces sight range

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6049 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2013-05-02 00:15:51 +00:00
parent 265fd3bc61
commit 8fb494ff53
20 changed files with 249 additions and 47 deletions
+33 -16
View File
@@ -41,8 +41,14 @@ enum
#define IMP_DISABILITY_COLUMN_START_X ( LAPTOP_SCREEN_UL_X + 136 )
//#define IMP_DISABILITY_COLUMN_START_X ( LAPTOP_SCREEN_UL_X + 136 )
#define IMP_DISABILITY_COLUMN_START_X ( LAPTOP_SCREEN_UL_X + 15 )
#define IMP_DISABILITY_2ND_COLUMN_START_X ( IMP_DISABILITY_COLUMN_START_X + 241 )
#define IMP_DISABILITY_COLUMN_START_Y ( LAPTOP_SCREEN_WEB_UL_Y + 40 )
#define IMP_DISABILITY_2ND_COLUMN_START_Y IMP_DISABILITY_COLUMN_START_Y
#define IMP_DISABILITY_TRAIT_NUMBER_TO_START_2ND_COLUMN 6
#define IMP_DISABILITY_TRAIT__SPACE_BTN_BUTTONS 38
@@ -146,15 +152,26 @@ void EnterIMPDisabilityTrait( void )
HandleDisabilityTraitButtonStates( );
// 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++ )
{
MSYS_DefineRegion( &gMR_DisabilityHelpTextRegions[ubCnt], ( IMP_DISABILITY_COLUMN_START_X + 62 ), ( usPosY ),
(IMP_DISABILITY_COLUMN_START_X + 218), ( usPosY + 17), MSYS_PRIORITY_HIGH,
MSYS_DefineRegion( &gMR_DisabilityHelpTextRegions[ubCnt], usPosX, ( usPosY ),
(usPosX + 156), ( usPosY + 17), MSYS_PRIORITY_HIGH,
MSYS_NO_CURSOR, MSYS_NO_CALLBACK, NULL );
MSYS_AddRegion( &gMR_DisabilityHelpTextRegions[ubCnt] );
usPosY += IMP_DISABILITY_TRAIT__SPACE_BTN_BUTTONS;
//Determine the next x location
if( ubCnt < IMP_DISABILITY_TRAIT_NUMBER_TO_START_2ND_COLUMN )
usPosX = IMP_DISABILITY_COLUMN_START_X + 62;
else
usPosX = IMP_DISABILITY_2ND_COLUMN_START_X + 62;
//Determine the next Y location
if( ubCnt == IMP_DISABILITY_TRAIT_NUMBER_TO_START_2ND_COLUMN )
usPosY = IMP_DISABILITY_COLUMN_START_Y + 8;
else
usPosY += IMP_DISABILITY_TRAIT__SPACE_BTN_BUTTONS;
}
}
@@ -242,15 +259,15 @@ void AddImpDisabilityTraitButtons()
//ButtonList[ giIMPDisabilityTraitAnswerButton[ ubCnt ] ]->ubSoundSchemeID = 0;
//Determine the next x location
//if( ubCnt < IMP_DISABILITY_TRAIT_NUMBER_TO_START_2ND_COLUMN )
if( ubCnt < IMP_DISABILITY_TRAIT_NUMBER_TO_START_2ND_COLUMN )
usPosX = IMP_DISABILITY_COLUMN_START_X;
//else
// usPosX = IMP_DISABILITY_2ND_COLUMN_START_X;
else
usPosX = IMP_DISABILITY_2ND_COLUMN_START_X;
//Determine the next Y location
//if( ubCnt == IMP_DISABILITY_TRAIT_NUMBER_TO_START_2ND_COLUMN )
// usPosY = IMP_DISABILITY_2ND_COLUMN_START_Y;
//else
if( ubCnt == IMP_DISABILITY_TRAIT_NUMBER_TO_START_2ND_COLUMN )
usPosY = IMP_DISABILITY_2ND_COLUMN_START_Y;
else
usPosY += IMP_DISABILITY_TRAIT__SPACE_BTN_BUTTONS;
}
}
@@ -380,15 +397,15 @@ void IMPDisabilityTraitDisplayDisabilityTraits()
AssignDisabilityHelpText( ubCnt );
//Determine the next x location
// if( ubCnt < IMP_DISABILITY_TRAIT_NUMBER_TO_START_2ND_COLUMN )
if( ubCnt < IMP_DISABILITY_TRAIT_NUMBER_TO_START_2ND_COLUMN )
usPosX = IMP_DISABILITY_COLUMN_START_X + IMP_DISABILITY_TRAIT__TEXT_OFFSET_X;
//else
// usPosX = IMP_DISABILITY_2ND_COLUMN_START_X + IMP_DISABILITY_TRAIT__TEXT_OFFSET_X;
else
usPosX = IMP_DISABILITY_2ND_COLUMN_START_X + IMP_DISABILITY_TRAIT__TEXT_OFFSET_X;
//Determine the next Y location
//if( ubCnt == IMP_DISABILITY_TRAIT_NUMBER_TO_START_2ND_COLUMN )
// usPosY = IMP_DISABILITY_2ND_COLUMN_START_Y + IMP_DISABILITY_TRAIT__TEXT_OFFSET_Y;
//else
if( ubCnt == IMP_DISABILITY_TRAIT_NUMBER_TO_START_2ND_COLUMN )
usPosY = IMP_DISABILITY_2ND_COLUMN_START_Y + IMP_DISABILITY_TRAIT__TEXT_OFFSET_Y;
else
usPosY += IMP_DISABILITY_TRAIT__SPACE_BTN_BUTTONS;
}
}
+2
View File
@@ -20,6 +20,8 @@ typedef enum
IMP_DISABILITY_FEAR_OF_INSECTS,
IMP_DISABILITY_FORGETFUL,
IMP_DISABILITY_PSYCHO,
IMP_DISABILITY_DEAF,
IMP_DISABILITY_SHORTSIGHTED,
IMP_DISABILITIES_NUMBER,
};
+43 -19
View File
@@ -4065,13 +4065,13 @@ void HandleIMPCharProfileResultsMessage( void)
switch( gMercProfiles[ iCurrentIMPSlot ].bDisability)
{
// normal as can be
case( NO_DISABILITY ):
iOffSet = IMP_PERSONALITY_NORMAL;
case( NO_DISABILITY ):
iOffSet = IMP_PERSONALITY_NORMAL;
break;
case( HEAT_INTOLERANT ):
iOffSet = IMP_PERSONALITY_HEAT;
break;
case( NERVOUS ):
case( NERVOUS ):
iOffSet = IMP_PERSONALITY_NERVOUS;
break;
case( CLAUSTROPHOBIC ):
@@ -4091,25 +4091,49 @@ void HandleIMPCharProfileResultsMessage( void)
break;
}
// personality tick
// DEF: removed 1/12/99, cause it was changing the length of email that were already calculated
// LoadEncryptedDataFromFile( "BINARYDATA\\Impass.edt", pString, MAIL_STRING_SIZE * ( iOffSet + Random( IMP_PERSONALITY_LENGTH - 1 ) + 1 ), MAIL_STRING_SIZE );
LoadEncryptedDataFromFile( "BINARYDATA\\Impass.edt", pString, MAIL_STRING_SIZE * ( iOffSet + 1 ), MAIL_STRING_SIZE );
// add to list
AddEmailRecordToList( pString );
// persoanlity paragraph
LoadEncryptedDataFromFile( "BINARYDATA\\Impass.edt", pString, MAIL_STRING_SIZE * ( iOffSet + IMP_PERSONALITY_LENGTH ), MAIL_STRING_SIZE );
// add to list
AddEmailRecordToList( pString );
// extra paragraph for bugs
if( gMercProfiles[ iCurrentIMPSlot ].bDisability == FEAR_OF_INSECTS )
// Flugente: new personalities do not get their text from .edt files
if ( gMercProfiles[ iCurrentIMPSlot ].bDisability == DEAF )
{
// persoanlity paragraph
LoadEncryptedDataFromFile( "BINARYDATA\\Impass.edt", pString, MAIL_STRING_SIZE * ( iOffSet + IMP_PERSONALITY_LENGTH + 1 ), MAIL_STRING_SIZE );
swprintf( pString, gzIMPDisabilityTraitEmailTextDeaf[0] );
AddEmailRecordToList( pString );
swprintf( pString, gzIMPDisabilityTraitEmailTextDeaf[1] );
AddEmailRecordToList( pString );
}
else if ( gMercProfiles[ iCurrentIMPSlot ].bDisability == SHORTSIGHTED )
{
swprintf( pString, gzIMPDisabilityTraitEmailTextShortSighted[0] );
AddEmailRecordToList( pString );
swprintf( pString, gzIMPDisabilityTraitEmailTextShortSighted[1] );
AddEmailRecordToList( pString );
}
else
{
// personality tick
// DEF: removed 1/12/99, cause it was changing the length of email that were already calculated
//LoadEncryptedDataFromFile( "BINARYDATA\\Impass.edt", pString, MAIL_STRING_SIZE * ( iOffSet + Random( IMP_PERSONALITY_LENGTH - 1 ) + 1 ), MAIL_STRING_SIZE );
LoadEncryptedDataFromFile( "BINARYDATA\\Impass.edt", pString, MAIL_STRING_SIZE * ( iOffSet + 1 ), MAIL_STRING_SIZE );
// add to list
AddEmailRecordToList( pString );
// personality paragraph
LoadEncryptedDataFromFile( "BINARYDATA\\Impass.edt", pString, MAIL_STRING_SIZE * ( iOffSet + IMP_PERSONALITY_LENGTH ), MAIL_STRING_SIZE );
// add to list
AddEmailRecordToList( pString );
// extra paragraph for bugs
if( gMercProfiles[ iCurrentIMPSlot ].bDisability == FEAR_OF_INSECTS )
{
// personality paragraph
LoadEncryptedDataFromFile( "BINARYDATA\\Impass.edt", pString, MAIL_STRING_SIZE * ( iOffSet + IMP_PERSONALITY_LENGTH + 1 ), MAIL_STRING_SIZE );
// add to list
AddEmailRecordToList( pString );
}
}
// attitude intro
+3
View File
@@ -11272,6 +11272,9 @@ INT16 GetTotalVisionRangeBonus( SOLDIERTYPE * pSoldier, UINT8 bLightLevel )
bonus -= 10;
}
// Flugente: add sight range bonus due to disabilities, traits etc. (not equipment)
bonus += pSoldier->GetSightRangeBonus();
// SANDRO - STOMP traits - Scouting bonus for sight range with binoculars and similar
if ( gGameOptions.fNewTraitSystem && HAS_SKILL_TRAIT( pSoldier, SCOUTING_NT ) && pSoldier->pathing.bLevel == 0 )
{
+27
View File
@@ -13999,6 +13999,33 @@ INT32 SOLDIERTYPE::GetDamageResistance(BOOLEAN fAutoResolve, BOOLEAN fCalcBreath
return( resistance );
}
INT8 SOLDIERTYPE::GetHearingBonus()
{
INT8 bonus = 0;
INT8 bSlot = FindHearingAid(this);
if ( bSlot != -1 )
{
// at 81-100% adds +5, at 61-80% adds +4, at 41-60% adds +3, etc.
bonus += GetHearingRangeBonus(this); // pSoldier->inv[bSlot][0]->data.objectStatus / 20 + 1;
}
if ( gMercProfiles[ this->ubProfile ].bDisability == DEAF )
bonus -= 5;
return bonus;
}
INT16 SOLDIERTYPE::GetSightRangeBonus()
{
INT16 bonus = 0;
if ( gMercProfiles[ this->ubProfile ].bDisability == SHORTSIGHTED )
bonus -= 10;
return bonus;
}
INT16 SOLDIERTYPE::GetSoldierCriticalDamageBonus( void )
{
INT16 val = 0;
+2
View File
@@ -1469,6 +1469,8 @@ public:
// returns damage resistance in percent
INT32 GetDamageResistance( BOOLEAN fAutoResolve = FALSE, BOOLEAN fCalcBreathLoss = FALSE);
INT8 GetHearingBonus();
INT16 GetSightRangeBonus();
INT16 GetSoldierCriticalDamageBonus( void ); // Flugente: determines critical damage bonus depending on class, skill, etc.
+4
View File
@@ -371,6 +371,10 @@ void RevealRoofsAndItems(SOLDIERTYPE *pSoldier, UINT32 itemsToo, BOOLEAN fShowLo
else
{
range = pSoldier->bViewRange;
// Flugente: adjust sightrange
range = (UINT16)( (range * (100 + pSoldier->GetSightRangeBonus()) ) / 100);
// balance item viewing range between normal and the limit set by opplist-type functions -- CJC
range = (AdjustMaxSightRangeForEnvEffects( pSoldier, LightTrueLevel( pSoldier->sGridNo, pSoldier->pathing.bLevel), range ) + range) / 2;
}
+1 -10
View File
@@ -1539,8 +1539,6 @@ void TurnOffTeamsMuzzleFlashes( UINT8 ubTeam )
INT8 DecideHearing( SOLDIERTYPE * pSoldier )
{
// calculate the hearing value for the merc...
INT8 bSlot;
INT8 bHearing;
if ( TANK( pSoldier ) )
@@ -1571,14 +1569,7 @@ INT8 DecideHearing( SOLDIERTYPE * pSoldier )
bHearing += 1 * NUM_SKILL_TRAITS( pSoldier, NIGHTOPS_OT );
}
//bSlot = FindObj( pSoldier, EXTENDEDEAR );
//if ( bSlot == HEAD1POS || bSlot == HEAD2POS)
bSlot = FindHearingAid(pSoldier);
if ( bSlot != -1 )
{
// at 81-100% adds +5, at 61-80% adds +4, at 41-60% adds +3, etc.
bHearing += GetHearingRangeBonus(pSoldier); // pSoldier->inv[bSlot][0]->data.objectStatus / 20 + 1;
}
bHearing += pSoldier->GetHearingBonus();
// adjust for dark conditions
switch ( ubAmbientLightLevel )
+3
View File
@@ -216,6 +216,9 @@ typedef enum
FEAR_OF_INSECTS,
FORGETFUL,
PSYCHO,
// Flugente: more disabilities
DEAF,
SHORTSIGHTED,
NUM_DISABILITIES
} PersonalityTrait;
+3 -1
View File
@@ -303,7 +303,9 @@ extern STR16 gzIMPCharacterTraitText[];
extern STR16 gzIMPAttitudesText[];
extern STR16 gzIMPColorChoosingText[];
extern STR16 sColorChoiceExplanationTexts[];
extern STR16 gzIMPDisabilityTraitText[];
extern STR16 gzIMPDisabilityTraitText[]; // added by Flugente
extern STR16 gzIMPDisabilityTraitEmailTextDeaf[]; // added by Flugente
extern STR16 gzIMPDisabilityTraitEmailTextShortSighted[];
extern STR16 sEnemyTauntsFireGun[];
extern STR16 sEnemyTauntsFireLauncher[];
extern STR16 sEnemyTauntsThrow[];
+14
View File
@@ -6661,9 +6661,23 @@ STR16 gzIMPDisabilityTraitText[]=
L"怕虫",
L"健忘",
L"神经错乱",
L"Deaf",
L"Shortsighted",
L"I.M.P. 性格缺陷",
};
STR16 gzIMPDisabilityTraitEmailTextDeaf[] =// TODO.Translate
{
L"We bet you're glad this isn't voicemail.",
L"You've either visited to many discos in your teens, or were to close a massive artillery bombardment. Or just old. Either way, your team better learn sign language.",
};
STR16 gzIMPDisabilityTraitEmailTextShortSighted[] =
{
L"You'll be screwed if you ever lose your glasses.",
L"That happens when you spend your days in front of glowing rectangles. You should have eaten more carrots. Ever seen a rabbit with glasses? Figures.",
};
// HEADROCK HAM 3.6: Error strings for assigning a merc to a facility
STR16 gzFacilityErrorMessage[]=
{
+14
View File
@@ -6652,9 +6652,23 @@ STR16 gzIMPDisabilityTraitText[]=
L"Fear of Insects",
L"Forgetful",
L"Psychotic",
L"Deaf",
L"Shortsighted",
L"I.M.P. Disabilities",
};
STR16 gzIMPDisabilityTraitEmailTextDeaf[] =// TODO.Translate
{
L"We bet you're glad this isn't voicemail.",
L"You've either visited to many discos in your teens, or were to close a massive artillery bombardment. Or just old. Either way, your team better learn sign language.",
};
STR16 gzIMPDisabilityTraitEmailTextShortSighted[] =
{
L"You'll be screwed if you ever lose your glasses.",
L"That happens when you spend your days in front of glowing rectangles. You should have eaten more carrots. Ever seen a rabbit with glasses? Figures.",
};
// TODO.Translate
// HEADROCK HAM 3.6: Error strings for assigning a merc to a facility
STR16 gzFacilityErrorMessage[]=
+14
View File
@@ -6646,9 +6646,23 @@ STR16 gzIMPDisabilityTraitText[]=
L"Fear of Insects",
L"Forgetful",
L"Psychotic",
L"Deaf",
L"Shortsighted",
L"I.M.P. Disabilities",
};
STR16 gzIMPDisabilityTraitEmailTextDeaf[] =
{
L"We bet you're glad this isn't voicemail.",
L"You've either visited to many discos in your teens, or were to close a massive artillery bombardment. Or just old. Either way, your team better learn sign language.",
};
STR16 gzIMPDisabilityTraitEmailTextShortSighted[] =
{
L"You'll be screwed if you ever lose your glasses.",
L"That happens when you spend your days in front of glowing rectangles. You should have eaten more carrots. Ever seen a rabbit with glasses? Figures.",
};
// HEADROCK HAM 3.6: Error strings for assigning a merc to a facility
STR16 gzFacilityErrorMessage[]=
{
+14
View File
@@ -6641,9 +6641,23 @@ STR16 gzIMPDisabilityTraitText[]=
L"Peur des insectes",
L"Distrait",
L"Psychotique",
L"Deaf",
L"Shortsighted",
L"Handicaps IMP",
};
STR16 gzIMPDisabilityTraitEmailTextDeaf[] =// TODO.Translate
{
L"We bet you're glad this isn't voicemail.",
L"You've either visited to many discos in your teens, or were to close a massive artillery bombardment. Or just old. Either way, your team better learn sign language.",
};
STR16 gzIMPDisabilityTraitEmailTextShortSighted[] =
{
L"You'll be screwed if you ever lose your glasses.",
L"That happens when you spend your days in front of glowing rectangles. You should have eaten more carrots. Ever seen a rabbit with glasses? Figures.",
};
// HEADROCK HAM 3.6: Error strings for assigning a merc to a facility
STR16 gzFacilityErrorMessage[]=
{
+14
View File
@@ -6471,9 +6471,23 @@ STR16 gzIMPDisabilityTraitText[]=
L"Angst vor Insekten",
L"Vergesslichkeit",
L"Psychopath",
L"Schwerhörigkeit",
L"Kurzsichtigkeit",
L"Ihre größte Schwäche",
};
STR16 gzIMPDisabilityTraitEmailTextDeaf[] =
{
L"Sie sind bestimmt froh, dass wir ihnen das hier nicht auf die Mailbox sprechen.",
L"Sie haben entweder in ihrer Jugend zuviele Diskos besucht, oder zu viele Bombardierungen von nahem erlebt. Oder sie sind einfach alt. Ihr Team sollte jedenfalls Gebärdensprache lernen.",
};
STR16 gzIMPDisabilityTraitEmailTextShortSighted[] =
{
L"Ohne ihre Brille sind sie aufgeschmissen.",
L"Das passiert wenn man dauernd nur vor der Glotze rumhängt. Sie hätten mehr Karotten essen sollen. Schon mal einen Hasen mit Brille gesehen? Aha.",
};
// HEADROCK HAM 3.6: Error strings for assigning a merc to a facility
STR16 gzFacilityErrorMessage[]=
{
+14
View File
@@ -6638,9 +6638,23 @@ STR16 gzIMPDisabilityTraitText[]=
L"Fear of Insects",
L"Forgetful",
L"Psychotic",
L"Deaf",
L"Shortsighted",
L"I.M.P. Disabilities",
};
STR16 gzIMPDisabilityTraitEmailTextDeaf[] =// TODO.Translate
{
L"We bet you're glad this isn't voicemail.",
L"You've either visited to many discos in your teens, or were to close a massive artillery bombardment. Or just old. Either way, your team better learn sign language.",
};
STR16 gzIMPDisabilityTraitEmailTextShortSighted[] =
{
L"You'll be screwed if you ever lose your glasses.",
L"That happens when you spend your days in front of glowing rectangles. You should have eaten more carrots. Ever seen a rabbit with glasses? Figures.",
};
// TODO.Translate
// HEADROCK HAM 3.6: Error strings for assigning a merc to a facility
STR16 gzFacilityErrorMessage[]=
+2 -1
View File
@@ -431,7 +431,8 @@ STR16 gzIMPDisabilitiesHelpTexts[]=
L"A look at large insects can cause big problems\nand being in tropical sectors also reduce his performance a bit.",
L"Sometimes forgets what orders he got and therefore loses some APs if in combat.",
L"He can go psycho and shoot like mad once in a while\nand can lose morale if unable to do that so given weapon.",
L"Drastically reduced hearing.",
L"Sight range is lowered.",
};
+14
View File
@@ -6659,9 +6659,23 @@ STR16 gzIMPDisabilityTraitText[]=
L"Boi się owadów",
L"Zapominalski",
L"Psychol",
L"Deaf",
L"Shortsighted",
L"Niepełnosprawności I.M.P.-a",
};
STR16 gzIMPDisabilityTraitEmailTextDeaf[] =// TODO.Translate
{
L"We bet you're glad this isn't voicemail.",
L"You've either visited to many discos in your teens, or were to close a massive artillery bombardment. Or just old. Either way, your team better learn sign language.",
};
STR16 gzIMPDisabilityTraitEmailTextShortSighted[] =
{
L"You'll be screwed if you ever lose your glasses.",
L"That happens when you spend your days in front of glowing rectangles. You should have eaten more carrots. Ever seen a rabbit with glasses? Figures.",
};
// HEADROCK HAM 3.6: Error strings for assigning a merc to a facility
STR16 gzFacilityErrorMessage[]=
{
+14
View File
@@ -6644,9 +6644,23 @@ STR16 gzIMPDisabilityTraitText[]=
L"Боязнь насекомых", //Fear of Insects
L"Забывчивый", //Forgetful
L"Психопат", //Psychotic
L"Deaf",
L"Shortsighted",
L"I.M.P.: Недостатки", //I.M.P. Disabilities
};
STR16 gzIMPDisabilityTraitEmailTextDeaf[] =// TODO.Translate
{
L"We bet you're glad this isn't voicemail.",
L"You've either visited to many discos in your teens, or were to close a massive artillery bombardment. Or just old. Either way, your team better learn sign language.",
};
STR16 gzIMPDisabilityTraitEmailTextShortSighted[] =
{
L"You'll be screwed if you ever lose your glasses.",
L"That happens when you spend your days in front of glowing rectangles. You should have eaten more carrots. Ever seen a rabbit with glasses? Figures.",
};
// HEADROCK HAM 3.6: Error strings for assigning a merc to a facility
STR16 gzFacilityErrorMessage[]=
{
+14
View File
@@ -6656,9 +6656,23 @@ STR16 gzIMPDisabilityTraitText[]=
L"Fear of Insects",
L"Forgetful",
L"Psychotic",
L"Deaf",
L"Shortsighted",
L"I.M.P. Disabilities",
};
STR16 gzIMPDisabilityTraitEmailTextDeaf[] =// TODO.Translate
{
L"We bet you're glad this isn't voicemail.",
L"You've either visited to many discos in your teens, or were to close a massive artillery bombardment. Or just old. Either way, your team better learn sign language.",
};
STR16 gzIMPDisabilityTraitEmailTextShortSighted[] =
{
L"You'll be screwed if you ever lose your glasses.",
L"That happens when you spend your days in front of glowing rectangles. You should have eaten more carrots. Ever seen a rabbit with glasses? Figures.",
};
// TODO.Translate
// HEADROCK HAM 3.6: Error strings for assigning a merc to a facility
STR16 gzFacilityErrorMessage[]=