Added new laptop merc data subpage to display more stats that weren't displayed before, like dialogue approach points and whether merc is a 'good guy'

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8372 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2017-01-22 20:12:29 +00:00
parent 4f8498e5ef
commit 4690b89ffc
13 changed files with 871 additions and 669 deletions
+1
View File
@@ -103,6 +103,7 @@ enum definedDropDowns
DROPDOWNNR_MERCCOMPARE1,
DROPDOWNNR_MERCCOMPARE2,
DROPDOWNNR_MERCCOMPARE_SQUADSELECTION,
DROPDOWNNR_PERSONALITY,
DROPDOWNNR_PMC_LOCATION,
+622 -635
View File
File diff suppressed because it is too large Load Diff
+93 -29
View File
@@ -882,6 +882,98 @@ INT32 CalcThreateningEffectiveness( UINT8 ubMerc )
return( (EffectiveLeadership( pSoldier ) + iStrength + iDeadliness) / 3 ); //Trail minor bug fix.
}
INT32 GetEffectiveApproachValue( UINT8 usProfile, UINT8 usApproach, CHAR16* apStr )
{
if ( usApproach > APPROACH_RECRUIT )
return 100;
FLOAT val = 0;
CHAR16 atStr[500];
swprintf( atStr, L"" );
if ( usApproach == APPROACH_THREATEN )
{
INT32 threateneffectiveness = CalcThreateningEffectiveness( usProfile );
if ( apStr )
{
swprintf( atStr, szLaptopStatText[0], threateneffectiveness );
wcscat( apStr, atStr );
}
val = threateneffectiveness;
}
else
{
if ( apStr )
{
swprintf( atStr, szLaptopStatText[1], gMercProfiles[usProfile].bLeadership );
wcscat( apStr, atStr );
}
val = ((INT32)gMercProfiles[usProfile].bLeadership);
}
FLOAT approachfactor = (FLOAT)(gMercProfiles[usProfile].usApproachFactor[usApproach - 1]) / 100.0f;
if ( apStr )
{
swprintf( atStr, szLaptopStatText[2], approachfactor );
wcscat( apStr, atStr );
}
val *= approachfactor;
// Flugente: backgrounds
SOLDIERTYPE* pSoldier = FindSoldierByProfileID( usProfile, TRUE );
if ( pSoldier )
{
UINT8 bgprperty = 0;
if ( usApproach == APPROACH_FRIENDLY )
bgprperty = BG_PERC_APPROACH_FRIENDLY;
else if ( usApproach == APPROACH_DIRECT )
bgprperty = BG_PERC_APPROACH_DIRECT;
else if ( usApproach == APPROACH_THREATEN )
bgprperty = BG_PERC_APPROACH_THREATEN;
else if ( usApproach == APPROACH_RECRUIT )
bgprperty = BG_PERC_APPROACH_RECRUIT;
FLOAT bgmodifier = (FLOAT)((100.0f + pSoldier->GetBackgroundValue( bgprperty ))) / 100.0f;
if ( apStr )
{
swprintf( atStr, szLaptopStatText[3], bgmodifier );
wcscat( apStr, atStr );
}
val = val * bgmodifier;
if ( apStr && gGameOptions.fNewTraitSystem && usApproach != APPROACH_THREATEN )
{
if ( DoesMercHavePersonality( pSoldier, CHAR_TRAIT_ASSERTIVE ) )
{
swprintf( atStr, L" \n" );
wcscat( apStr, atStr );
swprintf( atStr, szLaptopStatText[4] );
wcscat( apStr, atStr );
}
else if ( DoesMercHavePersonality( pSoldier, CHAR_TRAIT_MALICIOUS ) )
{
swprintf( atStr, L" \n" );
wcscat( apStr, atStr );
swprintf( atStr, szLaptopStatText[5] );
wcscat( apStr, atStr );
}
}
}
return (INT32)val;
}
UINT8 CalcDesireToTalk( UINT8 ubNPC, UINT8 ubMerc, INT8 bApproach )
{
INT32 iWillingness;
@@ -920,37 +1012,9 @@ UINT8 CalcDesireToTalk( UINT8 ubNPC, UINT8 ubMerc, INT8 bApproach )
{
iApproachVal = 100;
}
else if ( bApproach == APPROACH_THREATEN )
{
iEffectiveLeadership = CalcThreateningEffectiveness( ubMerc ) * pMercProfile->usApproachFactor[bApproach - 1] / 100;
// Flugente: backgrounds
SOLDIERTYPE* pSoldier = FindSoldierByProfileID( ubMerc, TRUE );
if ( pSoldier )
{
if ( bApproach == APPROACH_THREATEN )
iEffectiveLeadership = (iEffectiveLeadership * (100 + pSoldier->GetBackgroundValue(BG_PERC_APPROACH_THREATEN))) / 100;
}
iApproachVal = pNPCProfile->ubApproachVal[bApproach - 1] * iEffectiveLeadership / 50;
}
else
{
iEffectiveLeadership = ((INT32) pMercProfile->bLeadership) * pMercProfile->usApproachFactor[bApproach - 1] / 100;
// Flugente: backgrounds
SOLDIERTYPE* pSoldier = FindSoldierByProfileID( ubMerc, TRUE );
if ( pSoldier )
{
if ( bApproach == APPROACH_FRIENDLY )
iEffectiveLeadership = (iEffectiveLeadership * (100 + pSoldier->GetBackgroundValue(BG_PERC_APPROACH_FRIENDLY))) / 100;
else if ( bApproach == APPROACH_DIRECT )
iEffectiveLeadership = (iEffectiveLeadership * (100 + pSoldier->GetBackgroundValue(BG_PERC_APPROACH_DIRECT))) / 100;
else if ( bApproach == APPROACH_RECRUIT )
iEffectiveLeadership = (iEffectiveLeadership * (100 + pSoldier->GetBackgroundValue(BG_PERC_APPROACH_RECRUIT))) / 100;
}
iEffectiveLeadership = GetEffectiveApproachValue( ubMerc, bApproach, NULL );
iApproachVal = pNPCProfile->ubApproachVal[bApproach - 1] * iEffectiveLeadership / 50;
}
+2
View File
@@ -188,6 +188,8 @@ extern void ShutdownNPCQuotes( void );
extern void SetQuoteRecordAsUsed( UINT8 ubNPC, UINT8 ubRecord );
INT32 GetEffectiveApproachValue( UINT8 usProfile, UINT8 usApproach, CHAR16* apStr );
// uiApproachData is used for approach things like giving items, etc.
extern UINT8 CalcDesireToTalk( UINT8 ubNPC, UINT8 ubMerc, INT8 bApproach );
extern void Converse( UINT8 ubNPC, UINT8 ubMerc, INT8 bApproach, UINT32 uiApproachData );
+3 -1
View File
@@ -2797,7 +2797,7 @@ enum
// links to other pages
TEXT_MERCCOMPARE_SUBSITE1,
TEXT_MERCCOMPARE_INTRO1 = TEXT_MERCCOMPARE_SUBSITE1 + 4,
TEXT_MERCCOMPARE_INTRO1 = TEXT_MERCCOMPARE_SUBSITE1 + 5,
TEXT_MERCCOMPARE_BULLET1,
TEXT_MERCCOMPARE_BULLET2,
TEXT_MERCCOMPARE_BULLET3,
@@ -2986,6 +2986,8 @@ extern STR16 szSMilitiaResourceText[];
// Flugente: interactive actions
extern STR16 szInteractiveActionText[];
extern STR16 szLaptopStatText[];
#define TACTICAL_INVENTORY_DIALOG_NUM 16
#define TACTICAL_COVER_DIALOG_NUM 16
+18
View File
@@ -11203,6 +11203,24 @@ STR16 szInteractiveActionText[] =
L"This machine doesn't seem to be working.", // TODO.Translate
};
STR16 szLaptopStatText[] = // TODO.Translate
{
L"threaten effectiveness %d\n",
L"leadership %d\n",
L"approach modifier %.2f\n",
L"background modifier %.2f\n",
L"+50 (other) for assertive\n",
L"-50 (other) for malicious\n",
L"Good Guy",
L"%s eschews excessive violence and will refuse to attack non-hostiles.",
L"Friendly approach",
L"Direct approach",
L"Friendly approach",
L"Friendly approach",
};
// WANNE: Some Chinese specific strings that needs to be in unicode!
STR16 ChineseSpecString1 = L"%"; //defined in _ChineseText.cpp as this file is already unicode
STR16 ChineseSpecString2 = L"*%3d%%%"; //defined in _ChineseText.cpp as this file is already unicode
+18
View File
@@ -11221,4 +11221,22 @@ STR16 szInteractiveActionText[] =
L"This machine doesn't seem to be working.", // TODO.Translate
};
STR16 szLaptopStatText[] = // TODO.Translate
{
L"threaten effectiveness %d\n",
L"leadership %d\n",
L"approach modifier %.2f\n",
L"background modifier %.2f\n",
L"+50 (other) for assertive\n",
L"-50 (other) for malicious\n",
L"Good Guy",
L"%s eschews excessive violence and will refuse to attack non-hostiles.",
L"Friendly approach",
L"Direct approach",
L"Friendly approach",
L"Friendly approach",
};
#endif //DUTCH
+24 -4
View File
@@ -5021,10 +5021,10 @@ STR16 gsAtmSideButtonText[] =
STR16 gsAtmStartButtonText[] =
{
L"Transfer $", // transfer money to merc -- short form
L"Stats", // view stats of the merc
L"Inventory", // view the inventory of the merc
L"More Stats",
L"Employment",
L"Inventory", // view the inventory of the merc
};
STR16 sATMText[ ]=
@@ -5107,6 +5107,7 @@ STR16 pWebPagesTitles[] =
L"Mercs Love or Dislike You - Home",
L"Mercs Love or Dislike You - Analyze a team",
L"Mercs Love or Dislike You - Pairwise comparison",
L"Mercs Love or Dislike You - Personality",
L"Mercs Love or Dislike You - About us",
L"WHO - About WHO",
L"WHO - Disease in Arulco",
@@ -9752,8 +9753,9 @@ STR16 szMercCompareWebSite[] =
L"About us",
L"Analyse a team",
L"Pairwise comparison",
L"Customer voices",
L"Personalities",
L"Customer voices",
L"If your business provides innovative solutions for critical applications with realtime demands, perhaps some of these observations sound familiar to you:",
L"Your team struggles with itself.",
L"Your employees waste time working against each other.",
@@ -11204,4 +11206,22 @@ STR16 szInteractiveActionText[] =
L"This machine doesn't seem to be working.",
};
STR16 szLaptopStatText[] =
{
L"threaten effectiveness %d\n",
L"leadership %d\n",
L"approach modifier %.2f\n",
L"background modifier %.2f\n",
L"+50 (other) for assertive\n",
L"-50 (other) for malicious\n",
L"Good Guy",
L"%s eschews excessive violence and will refuse to attack non-hostiles.",
L"Friendly approach",
L"Direct approach",
L"Friendly approach",
L"Friendly approach",
};
#endif //ENGLISH
+18
View File
@@ -11203,4 +11203,22 @@ STR16 szInteractiveActionText[] =
L"This machine doesn't seem to be working.", // TODO.Translate
};
STR16 szLaptopStatText[] = // TODO.Translate
{
L"threaten effectiveness %d\n",
L"leadership %d\n",
L"approach modifier %.2f\n",
L"background modifier %.2f\n",
L"+50 (other) for assertive\n",
L"-50 (other) for malicious\n",
L"Good Guy",
L"%s eschews excessive violence and will refuse to attack non-hostiles.",
L"Friendly approach",
L"Direct approach",
L"Friendly approach",
L"Friendly approach",
};
#endif //FRENCH
+18
View File
@@ -11033,4 +11033,22 @@ STR16 szInteractiveActionText[] =
L"This machine doesn't seem to be working.", // TODO.Translate
};
STR16 szLaptopStatText[] = // TODO.Translate
{
L"threaten effectiveness %d\n",
L"leadership %d\n",
L"approach modifier %.2f\n",
L"background modifier %.2f\n",
L"+50 (other) for assertive\n",
L"-50 (other) for malicious\n",
L"Good Guy",
L"%s eschews excessive violence and will refuse to attack non-hostiles.",
L"Friendly approach",
L"Direct approach",
L"Friendly approach",
L"Friendly approach",
};
#endif //GERMAN
+18
View File
@@ -11212,4 +11212,22 @@ STR16 szInteractiveActionText[] =
L"This machine doesn't seem to be working.", // TODO.Translate
};
STR16 szLaptopStatText[] = // TODO.Translate
{
L"threaten effectiveness %d\n",
L"leadership %d\n",
L"approach modifier %.2f\n",
L"background modifier %.2f\n",
L"+50 (other) for assertive\n",
L"-50 (other) for malicious\n",
L"Good Guy",
L"%s eschews excessive violence and will refuse to attack non-hostiles.",
L"Friendly approach",
L"Direct approach",
L"Friendly approach",
L"Friendly approach",
};
#endif //ITALIAN
+18
View File
@@ -11225,4 +11225,22 @@ STR16 szInteractiveActionText[] =
L"This machine doesn't seem to be working.", // TODO.Translate
};
STR16 szLaptopStatText[] = // TODO.Translate
{
L"threaten effectiveness %d\n",
L"leadership %d\n",
L"approach modifier %.2f\n",
L"background modifier %.2f\n",
L"+50 (other) for assertive\n",
L"-50 (other) for malicious\n",
L"Good Guy",
L"%s eschews excessive violence and will refuse to attack non-hostiles.",
L"Friendly approach",
L"Direct approach",
L"Friendly approach",
L"Friendly approach",
};
#endif //POLISH
+18
View File
@@ -11204,4 +11204,22 @@ STR16 szInteractiveActionText[] =
L"This machine doesn't seem to be working.", // TODO.Translate
};
STR16 szLaptopStatText[] = // TODO.Translate
{
L"threaten effectiveness %d\n",
L"leadership %d\n",
L"approach modifier %.2f\n",
L"background modifier %.2f\n",
L"+50 (other) for assertive\n",
L"-50 (other) for malicious\n",
L"Good Guy",
L"%s eschews excessive violence and will refuse to attack non-hostiles.",
L"Friendly approach",
L"Direct approach",
L"Friendly approach",
L"Friendly approach",
};
#endif //RUSSIAN