Display special offer for 1st M.E.R.C. inv kit in UB

* Use weekly instead of daily salary for total cost calculation
This commit is contained in:
Asdow
2025-04-26 00:37:38 +03:00
parent 5062ae74f2
commit a3e7ce5794
10 changed files with 42 additions and 7 deletions
+33 -7
View File
@@ -1070,14 +1070,27 @@ void DisplayMercsStats( UINT8 ubMercID )
if (gubCurMercFilesTogglePage == MERC_FILES_INV_PAGE)
{
//Gear Cost
usPosY = usPosY + 145;
usPosY = usPosY + 148;
DrawTextToScreen( MercInfo[MERC_FILES_GEAR], MERC_STATS_SECOND_COL_X, usPosY, 0, MERC_STATS_FONT, MERC_STATIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
if ( (gMercProfiles[ ubMercID ].ubMiscFlags & PROFILE_MISC_FLAG_ALREADY_USED_ITEMS )
&& ( !(gMercProfiles[ ubMercID ].ubMiscFlags2 & PROFILE_MISC_FLAG2_MERC_GEARKIT_UNPAID) || gGameExternalOptions.fGearKitsAlwaysAvailable ) )
if ( (gMercProfiles[ubMercID].ubMiscFlags & PROFILE_MISC_FLAG_ALREADY_USED_ITEMS)
&& (!(gMercProfiles[ubMercID].ubMiscFlags2 & PROFILE_MISC_FLAG2_MERC_GEARKIT_UNPAID) || gGameExternalOptions.fGearKitsAlwaysAvailable) )
{
gMercProfiles[ ubMercID ].usOptionalGearCost = 0;
}
#ifdef JA2UB
if ( gSelectedMercKit == 0 ) // First kit is free, due to M.E.R.C special offer
{
gMercProfiles[ubMercID].usOptionalGearCost = 0;
swprintf(NsString, L"+ ");
// Special offer text above the gear cost
const auto y = usPosY - MERC_SPACE_BN_LINES + 2;
swprintf( NsString, MercInfo[MERC_FILES_SPECIAL_OFFER] );
DrawTextToScreen( NsString, usPosX, y, 95, MERC_TITLE_FONT, MERC_TITLE_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
}
#endif // JA2UB
swprintf( NsString, L"+ " );
swprintf(sTemp, L"%d",gMercProfiles[ ubMercID ].usOptionalGearCost);
InsertCommasForDollarFigure( sTemp );
InsertDollarSignInToString( sTemp );
@@ -1089,7 +1102,11 @@ void DisplayMercsStats( UINT8 ubMercID )
DrawTextToScreen( MercInfo[MERC_FILES_TOTAL], MERC_STATS_SECOND_COL_X, usPosY, 0, MERC_NAME_FONT, MERC_STATIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
swprintf(N2sString, L"= ");
#ifdef JA2UB
swprintf( sTemp, L"%d", gMercProfiles[ubMercID].usOptionalGearCost + gMercProfiles[ubMercID].uiWeeklySalary );
#else
swprintf(sTemp, L"%d",gMercProfiles[ ubMercID ].usOptionalGearCost+gMercProfiles[ ubMercID ].sSalary);
#endif
InsertCommasForDollarFigure( sTemp );
InsertDollarSignInToString( sTemp );
wcscat( N2sString, sTemp );
@@ -1207,16 +1224,25 @@ BOOLEAN MercFilesHireMerc(UINT8 ubMercID)
AddTransactionToPlayersBook( HIRED_MERC, ubMercID, GetWorldTotalMin(), Namount );
}
#ifdef JA2UB
#ifdef JA2UB
//add an entry in the finacial page for the hiring of the merc
AddTransactionToPlayersBook(PAY_SPECK_FOR_MERC, ubMercID, GetWorldTotalMin(), -(INT32)( gMercProfiles[ubMercID].uiWeeklySalary ) );
#endif
INT32 totalCost = gMercProfiles[ubMercID].uiWeeklySalary;
if ( gSelectedMercKit > 0 ) // First kit is included in the initial fee
{
totalCost += gMercProfiles[ubMercID].usOptionalGearCost;
}
AddTransactionToPlayersBook(PAY_SPECK_FOR_MERC, ubMercID, GetWorldTotalMin(), -totalCost );
#endif
//JMich_MMG: Setting the flag that we bought the gear and still haven't paid for it if we succesfully hired the merc
if ( fMercBuyEquipment )
{
gMercProfiles[ ubMercID ].ubMiscFlags |= PROFILE_MISC_FLAG_ALREADY_USED_ITEMS;
#ifdef JA2UB
// Gear cost gets added to initial hiring fee in UB
#else
gMercProfiles[ ubMercID ].ubMiscFlags2 |= PROFILE_MISC_FLAG2_MERC_GEARKIT_UNPAID;
#endif // JA2UB
}
return(TRUE);
+1
View File
@@ -5478,6 +5478,7 @@ STR16 MercInfo[] =
L"未结账单", //L"Unsettled Bills",
L"生平", //L"Bio",
L"物品", //L"Inv",
L"Special Offer!",
};
+1
View File
@@ -5481,6 +5481,7 @@ STR16 MercInfo[] =
L"Unsettled Bills", // TODO.Translate
L"Bio", // TODO.Translate
L"Inv",
L"Special Offer!",
};
+1
View File
@@ -5478,6 +5478,7 @@ STR16 MercInfo[] =
L"Unsettled Bills",
L"Bio",
L"Inv",
L"Special Offer!",
};
+1
View File
@@ -5485,6 +5485,7 @@ STR16 MercInfo[] =
L"Payez sa solde",
L"Biographie",
L"Inventaire",
L"Special Offer!",
};
+1
View File
@@ -5429,6 +5429,7 @@ STR16 MercInfo[] =
L"Offene Beträge",
L"Bio",
L"Inv",
L"Special Offer!",
};
// For use at the M.E.R.C. web site. Text relating to opening an account with MERC
+1
View File
@@ -5468,6 +5468,7 @@ STR16 MercInfo[] =
L"Unsettled Bills", // TODO.Translate
L"Bio", // TODO.Translate
L"Inv",
L"Special Offer!",
};
+1
View File
@@ -5481,6 +5481,7 @@ STR16 MercInfo[] =
L"Unsettled Bills", // TODO.Translate
L"Bio", // TODO.Translate
L"Inv",
L"Special Offer!",
};
+1
View File
@@ -5474,6 +5474,7 @@ STR16 MercInfo[] =
L"Неоплаченные счета",
L"Информация",
L"Снаряжение",
L"Special Offer!",
};
+1
View File
@@ -1262,6 +1262,7 @@ enum
MERC_FILES_MERC_OUTSTANDING,
MERC_FILES_BIO, //JMich_MMG: Adding two new texts for the small button, assuming we manage to add a silhouette with the gear, add it after this.
MERC_FILES_INVENTORY,
MERC_FILES_SPECIAL_OFFER,
TEXT_NUM_MERC_FILES,
};
extern STR16 MercInfo[];