*************************

* HAM 3.6 (by Headrock) *
*************************
- Info: Needed GameDir files for HAM 3.6 are not committed yet to the SVN GameDir. Will do that in the next few days
- For more infos on HAM 3.6 check out: http://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=244808&page=0&fpart=1


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@3323 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2010-02-20 15:49:46 +00:00
parent 53821fcf49
commit f010769397
120 changed files with 16937 additions and 2200 deletions
+10 -1
View File
@@ -13,6 +13,7 @@
#include "Text.h"
#include "aimsort.h"
#include "Assignments.h"
#include "GameSettings.h"
#endif
@@ -98,7 +99,15 @@ BOOLEAN EnterAimFacialIndex()
MSYS_AddRegion( &gMercFaceMouseRegions[ i ] );
MSYS_SetRegionUserData( &gMercFaceMouseRegions[ i ], 0, i);
sprintf(sTemp, "%s%02d.sti", sFaceLoc, AimMercArray[i]);
if (gGameExternalOptions.fReadProfileDataFromXML)
{
// HEADROCK PROFEX: Do not read direct profile number, instead, look inside the profile for a ubFaceIndex value.
sprintf(sTemp, "%s%02d.sti", sFaceLoc, gMercProfiles[AimMercArray[i]].ubFaceIndex);
}
else
{
sprintf(sTemp, "%s%02d.sti", sFaceLoc, AimMercArray[i]);
}
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
FilenameForBPP(sTemp, VObjectDesc.ImageFile);
if( !AddVideoObject(&VObjectDesc, &guiAimFiFace[i]) )
+9 -1
View File
@@ -1432,7 +1432,15 @@ BOOLEAN DisplayMercsFace()
BltVideoObject(FRAME_BUFFER, hPortraitHandle, 0,PORTRAIT_X, PORTRAIT_Y, VO_BLT_SRCTRANSPARENCY,NULL);
// load the Face graphic and add it
sprintf(sTemp, "%s%02d.sti", sFaceLoc, gbCurrentSoldier);
if (gGameExternalOptions.fReadProfileDataFromXML)
{
// HEADROCK PROFEX: Do not read direct profile number, instead, look inside the profile for a ubFaceIndex value.
sprintf(sTemp, "%s%02d.sti", sFaceLoc, gMercProfiles[gbCurrentSoldier].ubFaceIndex);
}
else
{
sprintf(sTemp, "%s%02d.sti", sFaceLoc, gbCurrentSoldier);
}
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
FilenameForBPP(sTemp, VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiFace));
+3 -1
View File
@@ -604,7 +604,9 @@ void HandleBeginScreenTextEvent( UINT32 uiKey )
uiKey >= 'a' && uiKey <= 'z' ||
uiKey >= '0' && uiKey <= '9' ||
uiKey == '_' || uiKey == '.' ||
uiKey == ' ' )
uiKey == ' ' || uiKey == '"' ||
uiKey == 39 // This is ' which cannot be written explicitly here of course
)
#else
if( charSet::IsFromSet( uiKey, charSet::CS_SPACE|charSet::CS_ALPHA_NUM|charSet::CS_SPECIAL_ALPHA ) )
#endif
+1 -1
View File
@@ -222,7 +222,7 @@ public:
UINT16 RemoveDestination(UINT16 usDestinationID);
RefToDestinationStruct GetDestination(UINT16 usDestinationID) const;
RefToDestinationList LookupDestinationList(void) const;
// WANNE:
BOOLEAN IsSectorAShipmentSector(UINT8 ubMapX, UINT8 ubMapY, UINT8 ubMapZ);
+21 -4
View File
@@ -15,6 +15,9 @@
#include "cursors.h"
#include "email.h"
#include "text.h"
// HEADROCK PROFEX: This is required to display the proper facial image.
#include "Soldier Profile.h"
#include "GameSettings.h"
#endif
#define TOP_X LAPTOP_SCREEN_UL_X
@@ -1759,16 +1762,30 @@ BOOLEAN HandleSpecialTerroristFile( INT32 iFileNumber, STR sPictureName )
// show picture
if( ( giFilesPage == 0 ) && ( iCounter == 5 ) )
{
if( usProfileIdsForTerroristFiles[ iFileNumber + 1 ] < 100 )
if (gGameExternalOptions.fReadProfileDataFromXML)
{
sprintf(sTemp, "%s%02d.sti", "FACES\\BIGFACES\\", usProfileIdsForTerroristFiles[ iFileNumber + 1 ]);
// HEADROCK PROFEX: Do not read direct profile number, instead, look inside the profile for a ubFaceIndex value.
if( usProfileIdsForTerroristFiles[ iFileNumber + 1 ] < 100 )
{
sprintf(sTemp, "%s%02d.sti", "FACES\\BIGFACES\\", gMercProfiles[ usProfileIdsForTerroristFiles[ iFileNumber + 1 ] ].ubFaceIndex);
}
else
{
sprintf(sTemp, "%s%03d.sti", "FACES\\BIGFACES\\", gMercProfiles[ usProfileIdsForTerroristFiles[ iFileNumber + 1 ] ].ubFaceIndex);
}
}
else
{
sprintf(sTemp, "%s%03d.sti", "FACES\\BIGFACES\\", usProfileIdsForTerroristFiles[ iFileNumber + 1 ]);
if( usProfileIdsForTerroristFiles[ iFileNumber + 1 ] < 100 )
{
sprintf(sTemp, "%s%02d.sti", "FACES\\BIGFACES\\", usProfileIdsForTerroristFiles[ iFileNumber + 1 ]);
}
else
{
sprintf(sTemp, "%s%03d.sti", "FACES\\BIGFACES\\", usProfileIdsForTerroristFiles[ iFileNumber + 1 ]);
}
}
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
FilenameForBPP(sTemp, VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &uiPicture));
+37 -2
View File
@@ -17,6 +17,10 @@
#include "LaptopSave.h"
#include "Campaign Types.h"
#include "strategicmap.h"
// HEADROCK HAM 3.6: Added facilities for calculating hourly expenses
#include "Facilities.h"
// HEADROCK HAM 3.6: Militia upkeep
#include "Town Militia.h"
#endif
// the global defines
@@ -402,7 +406,27 @@ INT32 GetProjectedTotalDailyIncome( void )
// then there is how many deposits have been made, now look at how many mines we have, thier rate, amount of ore left and predict if we still
// had these mines how much more would we get?
return( PredictIncomeFromPlayerMines() );
// HEADROCK HAM 3.6: Facilities can make you money, and this is figured into your daily income.
INT32 iRate = 0;
iRate = PredictIncomeFromPlayerMines() + (15 * GetTotalFacilityHourlyCosts( TRUE )); // 15 hours is the average time a merc can work per day
return( iRate );
}
// HEADROCK HAM 3.6: Predict expenses today. Takes into account facilities, and in the future merc contracts.
INT32 GetProjectedExpenses( void )
{
INT32 iTotalExpenses = 0;
INT32 iFacilityExpenses = GetTotalFacilityHourlyCosts( FALSE );
INT32 iContractExpenses = GetTotalContractExpenses();
iTotalExpenses += (iFacilityExpenses*15); // 15 hours is the average time a merc can work every day.
iTotalExpenses += iContractExpenses;
iTotalExpenses += guiTotalUpkeepForMilitia;
return (iTotalExpenses);
}
INT32 GetProjectedBalance( void )
@@ -1224,7 +1248,8 @@ UINT32 ProcessAndEnterAFinacialRecord( UINT8 ubCode, UINT32 uiDate, INT32 iAmoun
else
{
// alloc space
uiId = ReadInLastElementOfFinanceListAndReturnIdNumber( );
// HEADROCK HAM 3.6: Fix by Warmsteel to prevent repetitive entries on finance list. Next line commented out.
// uiId = ReadInLastElementOfFinanceListAndReturnIdNumber( );
pFinance = (FinanceUnitPtr) MemAlloc(sizeof(FinanceUnit));
// setup info passed
@@ -1534,6 +1559,16 @@ void ProcessTransactionString(STR16 pString, FinanceUnitPtr pFinance)
swprintf(pString, pTransactionText[ MERC_DEPOSITED_MONEY_TO_PLAYER_ACCOUNT ], gMercProfiles[ pFinance->ubSecondCode ].zNickname );
break;
// HEADROCK HAM 3.6: Paid for Facility Use
case( FACILITY_OPERATIONS ):
swprintf(pString, L"%s", pTransactionText[ FACILITY_OPERATIONS ]);
break;
// HEADROCK HAM 3.6: Paid for militia upkeep
case( MILITIA_UPKEEP ):
swprintf(pString, L"%s", pTransactionText[ MILITIA_UPKEEP ]);
break;
}
+4 -1
View File
@@ -50,7 +50,9 @@ enum
TRAIN_TOWN_MILITIA,
PURCHASED_ITEM_FROM_DEALER,
MERC_DEPOSITED_MONEY_TO_PLAYER_ACCOUNT,
SOLD_ITEMS
SOLD_ITEMS,
FACILITY_OPERATIONS, // HEADROCK HAM 3.6: Facility costs (daily payment)
MILITIA_UPKEEP, // HEADROCK HAM 3.6: Militia Upkeep Costs (daily payment)
};
@@ -64,6 +66,7 @@ void InsertDollarSignInToString( STR16 pString );
void InsertCommasForDollarFigure( STR16 pString );
INT32 GetTodaysDaysIncome( void );
INT32 GetProjectedTotalDailyIncome( void );
INT32 GetProjectedExpenses( void ); // HEADROCK HAM 3.6: Projected daily expenses.
#endif
Binary file not shown.
+74 -14
View File
@@ -824,10 +824,21 @@ void RenderPersonnelFace(INT32 iId, INT32 iSlot, BOOLEAN fDead, BOOLEAN fFired,
// special case?..player generated merc
if (fCurrentTeamMode) {
if( ( 50 < MercPtrs[iId]->ubProfile )&&( 57 > MercPtrs[iId]->ubProfile ) ) {
if( ( 50 < MercPtrs[iId]->ubProfile )&&( 57 > MercPtrs[iId]->ubProfile ) )
{
sprintf( sTemp, "%s%03d.sti", FACES_DIR, gMercProfiles[ MercPtrs[iId]->ubProfile ].ubFaceIndex );
} else {
sprintf(sTemp, "%s%02d.sti", FACES_DIR, Menptr[ iId ].ubProfile);
}
else
{
if (gGameExternalOptions.fReadProfileDataFromXML)
{
// HEADROCK PROFEX: Do not read direct profile number, instead, look inside the profile for a ubFaceIndex value.
sprintf(sTemp, "%s%02d.sti", FACES_DIR, gMercProfiles[Menptr[ iId ].ubProfile].ubFaceIndex);
}
else
{
sprintf(sTemp, "%s%02d.sti", FACES_DIR, Menptr[ iId ].ubProfile);
}
}
if( MercPtrs[iId]->flags.uiStatusFlags & SOLDIER_VEHICLE ) {
@@ -839,10 +850,21 @@ void RenderPersonnelFace(INT32 iId, INT32 iSlot, BOOLEAN fDead, BOOLEAN fFired,
return;
}
if( ( 50 < iId )&&( 57 > iId ) ) {
if( ( 50 < iId )&&( 57 > iId ) )
{
sprintf( sTemp, "%s%03d.sti", FACES_DIR, gMercProfiles[ iId ].ubFaceIndex );
} else {
sprintf(sTemp, "%s%02d.sti", FACES_DIR, iId );
}
else
{
if (gGameExternalOptions.fReadProfileDataFromXML)
{
// HEADROCK PROFEX: Do not read direct profile number, instead, look inside the profile for a ubFaceIndex value.
sprintf(sTemp, "%s%02d.sti", FACES_DIR, gMercProfiles[Menptr[ iId ].ubProfile].ubFaceIndex );
}
else
{
sprintf(sTemp, "%s%02d.sti", FACES_DIR, iId );
}
}
}
@@ -1943,10 +1965,29 @@ void DisplayPicturesOfCurrentTeam( void )
if ((50 < pSoldier->ubProfile) && (57 > pSoldier->ubProfile)) {
sprintf( sTemp, "%s%03d.sti", SMALL_FACES_DIR, gMercProfiles[ pSoldier->ubProfile ].ubFaceIndex );
} else {
if ( pSoldier->ubProfile < 100 ) {
sprintf(sTemp, "%s%02d.sti", SMALL_FACES_DIR, pSoldier->ubProfile);
} else {
sprintf(sTemp, "%s%03d.sti", SMALL_FACES_DIR, pSoldier->ubProfile);
if ( pSoldier->ubProfile < 100 )
{
if (gGameExternalOptions.fReadProfileDataFromXML)
{
// HEADROCK PROFEX: Do not read direct profile number, instead, look inside the profile for a ubFaceIndex value.
sprintf(sTemp, "%s%02d.sti", SMALL_FACES_DIR, gMercProfiles[ pSoldier->ubProfile ].ubFaceIndex);
}
else
{
sprintf(sTemp, "%s%02d.sti", SMALL_FACES_DIR, pSoldier->ubProfile);
}
}
else
{
if (gGameExternalOptions.fReadProfileDataFromXML)
{
// HEADROCK PROFEX: Do not read direct profile number, instead, look inside the profile for a ubFaceIndex value.
sprintf(sTemp, "%s%03d.sti", SMALL_FACES_DIR, gMercProfiles[ pSoldier->ubProfile ].ubFaceIndex);
}
else
{
sprintf(sTemp, "%s%03d.sti", SMALL_FACES_DIR, pSoldier->ubProfile);
}
} // else
} // else
@@ -4462,10 +4503,29 @@ void DisplayPortraitOfPastMerc( INT32 iId , INT32 iCounter, BOOLEAN fDead, BOOLE
if( ( 50 < iId )&&( 57 > iId ) ) {
sprintf( sTemp, "%s%03d.sti", SMALL_FACES_DIR, gMercProfiles[ iId ].ubFaceIndex );
} else {
if( iId < 100 ) {
sprintf(sTemp, "%s%02d.sti", SMALL_FACES_DIR, iId );
} else {
sprintf(sTemp, "%s%03d.sti", SMALL_FACES_DIR, iId );
if( iId < 100 )
{
if (gGameExternalOptions.fReadProfileDataFromXML)
{
// HEADROCK PROFEX: Do not read direct profile number, instead, look inside the profile for a ubFaceIndex value.
sprintf(sTemp, "%s%02d.sti", SMALL_FACES_DIR, gMercProfiles[ iId ].ubFaceIndex );
}
else
{
sprintf(sTemp, "%s%02d.sti", SMALL_FACES_DIR, iId );
}
}
else
{
if (gGameExternalOptions.fReadProfileDataFromXML)
{
// HEADROCK PROFEX: Do not read direct profile number, instead, look inside the profile for a ubFaceIndex value.
sprintf(sTemp, "%s%03d.sti", SMALL_FACES_DIR, gMercProfiles[ iId ].ubFaceIndex );
}
else
{
sprintf(sTemp, "%s%03d.sti", SMALL_FACES_DIR, iId );
}
}
}