mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ff8476c15 | ||
|
|
6a9df9f22c | ||
|
|
c3a34a660d | ||
|
|
1074e9c408 | ||
|
|
4537f5d4dc | ||
|
|
4ae331c19e | ||
|
|
b85380c958 | ||
|
|
eb3f62c3d5 | ||
|
|
8644e5f8b9 | ||
|
|
872a356e82 | ||
|
|
7bb7c54317 | ||
|
|
49a56d01ac | ||
|
|
09ce332721 | ||
|
|
5e2c61ef12 | ||
|
|
4d948fda06 | ||
|
|
2ae110971b | ||
|
|
9a78e7dfa0 | ||
|
|
d95bae2bf6 | ||
|
|
a1bb85ca95 | ||
|
|
d9391de58a | ||
|
|
c02bbc90cb | ||
|
|
efb54202ea | ||
|
|
11caa6529c | ||
|
|
e2f296c42c | ||
|
|
ee2807ae64 | ||
|
|
b23c9ac8b1 | ||
|
|
fa0c5a2862 | ||
|
|
db6da100e1 | ||
|
|
a3e7ce5794 | ||
|
|
5062ae74f2 | ||
|
|
dd58f904f4 | ||
|
|
8dcb431ef2 | ||
|
|
5f45d06852 | ||
|
|
92103e36a6 | ||
|
|
8f98a9b985 | ||
|
|
c2e78d0461 | ||
|
|
3e45217a9a |
@@ -200,6 +200,7 @@ jobs:
|
||||
git push --delete origin refs/tags/latest || true
|
||||
git tag latest
|
||||
git push --force origin refs/tags/latest
|
||||
sleep 15 # make sure github can find the tag for gh release
|
||||
gh release create latest ../dist/* \
|
||||
--generate-notes \
|
||||
--title "Latest (unstable)" \
|
||||
|
||||
@@ -147,6 +147,7 @@ foreach(app IN LISTS ApplicationTargets)
|
||||
)
|
||||
target_link_libraries(${exe} PRIVATE ${Ja2_Libraries} $<IF:${usingMsBuild},legacy_stdio_definitions.lib,>)
|
||||
target_link_options(${exe} PRIVATE $<IF:${usingMsBuild},/SAFESEH:NO,>)
|
||||
target_compile_definitions(${exe} PRIVATE ${compilationFlags} ${debugFlags})
|
||||
|
||||
# language library for an application, e.g. JA2MAPEDITOR_ENGLISH_i18n
|
||||
set(language_library ${exe}_i18n)
|
||||
|
||||
@@ -1830,7 +1830,7 @@ void BtnGIOSquadSizeSelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
|
||||
if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
|
||||
{
|
||||
UINT8 maxSquadSize = GIO_SQUAD_SIZE_10;
|
||||
if (iResolution >= _800x600 && iResolution < _1024x768)
|
||||
if (iResolution >= _800x600 && iResolution < _1280x720)
|
||||
maxSquadSize = GIO_SQUAD_SIZE_8;
|
||||
|
||||
if ( iCurrentSquadSize < maxSquadSize )
|
||||
@@ -1850,7 +1850,7 @@ void BtnGIOSquadSizeSelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
|
||||
btn->uiFlags|=(BUTTON_CLICKED_ON);
|
||||
|
||||
UINT8 maxSquadSize = GIO_SQUAD_SIZE_10;
|
||||
if (iResolution >= _800x600 && iResolution < _1024x768)
|
||||
if (iResolution >= _800x600 && iResolution < _1280x720 )
|
||||
maxSquadSize = GIO_SQUAD_SIZE_8;
|
||||
|
||||
if ( iCurrentSquadSize < maxSquadSize )
|
||||
|
||||
@@ -1998,6 +1998,7 @@ void LoadGameExternalOptions()
|
||||
gGameExternalOptions.fFoodDecayInSectors = iniReader.ReadBoolean("Tactical Food Settings", "FOOD_DECAY_IN_SECTORS", TRUE);
|
||||
gGameExternalOptions.sFoodDecayModificator = iniReader.ReadFloat("Tactical Food Settings", "FOOD_DECAY_MODIFICATOR", 1.0f, 0.1f, 10.0f);
|
||||
gGameExternalOptions.fFoodEatingSounds = iniReader.ReadBoolean("Tactical Food Settings", "FOOD_EATING_SOUNDS", TRUE);
|
||||
gGameExternalOptions.fAlwaysFood = iniReader.ReadBoolean("Tactical Food Settings", "ALWAYS_FOOD", FALSE);
|
||||
|
||||
//################# Disease Settings ##################
|
||||
gGameExternalOptions.fDisease = iniReader.ReadBoolean( "Disease Settings", "DISEASE", FALSE );
|
||||
|
||||
@@ -506,6 +506,7 @@ typedef struct
|
||||
FLOAT sFoodDecayModificator;
|
||||
|
||||
BOOLEAN fFoodEatingSounds;
|
||||
BOOLEAN fAlwaysFood;
|
||||
|
||||
// Flugente: disease settings
|
||||
BOOLEAN fDisease;
|
||||
|
||||
+2
-2
@@ -22,7 +22,7 @@ extern CHAR16 zBuildInformation[256];
|
||||
//
|
||||
// Keeps track of the saved game version. Increment the saved game version whenever
|
||||
// you will invalidate the saved game file
|
||||
|
||||
#define MERC_PROFILE_INSERTION_DATA 185 // Bigmap support for AddProfileToMap function
|
||||
#define GROWTH_MODIFIERS 184
|
||||
#define REBELCOMMAND 183
|
||||
#define DRAGSTRUCTURE 182 // Flugente: we can drag structures behind us
|
||||
@@ -105,7 +105,7 @@ extern CHAR16 zBuildInformation[256];
|
||||
#define AP100_SAVEGAME_DATATYPE_CHANGE 105 // Before this, we didn't have the 100AP structure changes
|
||||
#define NIV_SAVEGAME_DATATYPE_CHANGE 102 // Before this, we used the old structure system
|
||||
|
||||
#define SAVE_GAME_VERSION GROWTH_MODIFIERS
|
||||
#define SAVE_GAME_VERSION MERC_PROFILE_INSERTION_DATA
|
||||
|
||||
//#define RUSSIANGOLD
|
||||
#ifdef __cplusplus
|
||||
|
||||
+11
-1
@@ -1467,7 +1467,17 @@ BOOLEAN MERCPROFILESTRUCT::Load(HWFILE hFile, bool forceLoadOldVersion, bool for
|
||||
numBytesRead = ReadFieldByField( hFile, &this->ubLastDateSpokenTo, sizeof(this->ubLastDateSpokenTo), sizeof(UINT8), numBytesRead);
|
||||
numBytesRead = ReadFieldByField( hFile, &this->bLastQuoteSaidWasSpecial, sizeof(this->bLastQuoteSaidWasSpecial), sizeof(UINT8), numBytesRead);
|
||||
numBytesRead = ReadFieldByField( hFile, &this->bSectorZ, sizeof(this->bSectorZ), sizeof(INT8), numBytesRead);
|
||||
numBytesRead = ReadFieldByField( hFile, &this->usStrategicInsertionData, sizeof(this->usStrategicInsertionData), sizeof(UINT16), numBytesRead);
|
||||
|
||||
if ( guiCurrentSaveGameVersion >= MERC_PROFILE_INSERTION_DATA )
|
||||
{
|
||||
numBytesRead = ReadFieldByField( hFile, &this->usStrategicInsertionData, sizeof( this->usStrategicInsertionData ), sizeof( UINT32 ), numBytesRead );
|
||||
}
|
||||
else
|
||||
{
|
||||
numBytesRead = ReadFieldByField( hFile, &this->usStrategicInsertionData, sizeof(UINT16), sizeof(UINT16), numBytesRead);
|
||||
buffer += 4; // To make numBytesRead check match the struct size. 2 bytes from uint32 - uint16 and 2 bytes due to struct memory layout change when usStrategicInsertionData was increased to uint32
|
||||
}
|
||||
|
||||
numBytesRead = ReadFieldByField( hFile, &this->bFriendlyOrDirectDefaultResponseUsedRecently, sizeof(this->bFriendlyOrDirectDefaultResponseUsedRecently), sizeof(INT8), numBytesRead);
|
||||
numBytesRead = ReadFieldByField( hFile, &this->bRecruitDefaultResponseUsedRecently, sizeof(this->bRecruitDefaultResponseUsedRecently), sizeof(INT8), numBytesRead);
|
||||
numBytesRead = ReadFieldByField( hFile, &this->bThreatenDefaultResponseUsedRecently, sizeof(this->bThreatenDefaultResponseUsedRecently), sizeof(INT8), numBytesRead);
|
||||
|
||||
+7
-1
@@ -238,7 +238,8 @@ void LoadGameUBOptions()
|
||||
gGameUBOptions.PowergenSectorGridNo3 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_SECTOR_GRIDNO_3", 14155);
|
||||
gGameUBOptions.PowergenSectorGridNo4 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_SECTOR_GRIDNO_4", 13980);
|
||||
|
||||
gGameUBOptions.PowergenSectorExitgridGridNo = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_SECTOR_EXITGRID_GRIDNO", 19749);
|
||||
gGameUBOptions.PowergenSectorExitgridGridNo = iniReader.ReadInteger( "Unfinished Business Settings", "POWERGEN_SECTOR_EXITGRID_GRIDNO", 19749 );
|
||||
gGameUBOptions.PowergenSectorExitgridSrcGridNo = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_SECTOR_EXITGRID_SRC_GRIDNO", 10979 );
|
||||
gGameUBOptions.PowergenFanSoundGridNo1 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_FAN_SOUND_GRIDNO_1", 10979);
|
||||
gGameUBOptions.PowergenFanSoundGridNo2 = iniReader.ReadInteger("Unfinished Business Settings","POWERGEN_FAN_SOUND_GRIDNO_2", 19749);
|
||||
gGameUBOptions.StartFanbackupAgainGridNo = iniReader.ReadInteger("Unfinished Business Settings","START_FANBACKUP_AGAIN_GRIDNO", 10980);
|
||||
@@ -356,6 +357,11 @@ void LoadGameUBOptions()
|
||||
gGameUBOptions.H10SectorPlayerQuoteZ = iniReader.ReadInteger("Unfinished Business Settings","H10_SECTOR_PLAYER_QUOTE_Z", 0);
|
||||
|
||||
|
||||
gGameUBOptions.BettyBloodCatSectorX = iniReader.ReadInteger( "Unfinished Business Settings", "BETTY_BLOODCAT_SECTOR_X", 10 );
|
||||
gGameUBOptions.BettyBloodCatSectorY = iniReader.ReadInteger( "Unfinished Business Settings", "BETTY_BLOODCAT_SECTOR_Y", 9 );
|
||||
gGameUBOptions.BettyBloodCatSectorZ = iniReader.ReadInteger( "Unfinished Business Settings", "BETTY_BLOODCAT_SECTOR_Z", 0 );
|
||||
|
||||
|
||||
if ( gGameUBOptions.InGameHeli == TRUE )
|
||||
gGameUBOptions.InGameHeliCrash = FALSE;
|
||||
|
||||
|
||||
+5
-1
@@ -67,6 +67,7 @@ typedef struct
|
||||
UINT32 PowergenSectorGridNo3;
|
||||
UINT32 PowergenSectorGridNo4;
|
||||
UINT32 PowergenSectorExitgridGridNo;
|
||||
UINT32 PowergenSectorExitgridSrcGridNo;
|
||||
UINT32 PowergenFanSoundGridNo1;
|
||||
UINT32 PowergenFanSoundGridNo2;
|
||||
UINT32 StartFanbackupAgainGridNo;
|
||||
@@ -219,7 +220,10 @@ typedef struct
|
||||
UINT32 SectorDoorInTunnelGridNo;
|
||||
|
||||
UINT8 MaxNumberOfMercs;
|
||||
|
||||
|
||||
INT16 BettyBloodCatSectorX;
|
||||
INT16 BettyBloodCatSectorY;
|
||||
INT8 BettyBloodCatSectorZ;
|
||||
} GAME_UB_OPTIONS;
|
||||
|
||||
extern GAME_UB_OPTIONS gGameUBOptions;
|
||||
|
||||
+116
-40
@@ -418,6 +418,34 @@ BOOLEAN EnterMercsFiles()
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
static void TryToHireMERC()
|
||||
{
|
||||
if ( (gMercProfiles[GetAvailableMercIDFromMERCArray( gubCurMercIndex )].ubMiscFlags & PROFILE_MISC_FLAG_ALREADY_USED_ITEMS) && !gGameExternalOptions.fGearKitsAlwaysAvailable )
|
||||
{
|
||||
//bought gear before
|
||||
fMercBuyEquipment = 0;
|
||||
MercProcessHireAfterGear();
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef JA2UB
|
||||
if ( gSelectedMercKit == 0 ) // First kit is free, due to M.E.R.C special offer
|
||||
{
|
||||
fMercBuyEquipment = 1;
|
||||
MercProcessHireAfterGear();
|
||||
}
|
||||
else
|
||||
{
|
||||
//prompt to buy gear
|
||||
DoLapTopMessageBox( MSG_BOX_BLUE_ON_GREY, MercInfo[MERC_FILES_BUY_GEAR], LAPTOP_SCREEN, MSG_BOX_FLAG_YESNO, MercHireButtonGearYesNoCallback );
|
||||
}
|
||||
#else
|
||||
//prompt to buy gear
|
||||
DoLapTopMessageBox( MSG_BOX_BLUE_ON_GREY, MercInfo[MERC_FILES_BUY_GEAR], LAPTOP_SCREEN, MSG_BOX_FLAG_YESNO, MercHireButtonGearYesNoCallback );
|
||||
#endif // JA2UB
|
||||
}
|
||||
}
|
||||
|
||||
void SelectMercsFaceRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
|
||||
{
|
||||
if (iReason & MSYS_CALLBACK_REASON_RBUTTON_UP)
|
||||
@@ -442,15 +470,7 @@ void SelectMercsFaceRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
|
||||
//else try to hire the merc
|
||||
else
|
||||
{
|
||||
if ( (gMercProfiles[ GetAvailableMercIDFromMERCArray( gubCurMercIndex ) ].ubMiscFlags & PROFILE_MISC_FLAG_ALREADY_USED_ITEMS) && !gGameExternalOptions.fGearKitsAlwaysAvailable )
|
||||
{
|
||||
//bought gear before
|
||||
fMercBuyEquipment = 0;
|
||||
MercProcessHireAfterGear();
|
||||
}
|
||||
else
|
||||
//prompt to buy gear
|
||||
DoLapTopMessageBox( MSG_BOX_BLUE_ON_GREY, MercInfo[ MERC_FILES_BUY_GEAR ], LAPTOP_SCREEN, MSG_BOX_FLAG_YESNO, MercHireButtonGearYesNoCallback );
|
||||
TryToHireMERC();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -701,15 +721,7 @@ void BtnMercHireButtonCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
//else try to hire the merc
|
||||
else
|
||||
{
|
||||
if ( (gMercProfiles[ GetAvailableMercIDFromMERCArray( gubCurMercIndex ) ].ubMiscFlags & PROFILE_MISC_FLAG_ALREADY_USED_ITEMS) && !gGameExternalOptions.fGearKitsAlwaysAvailable )
|
||||
{
|
||||
//bought gear before
|
||||
fMercBuyEquipment = 0;
|
||||
MercProcessHireAfterGear();
|
||||
}
|
||||
else
|
||||
//prompt to buy gear
|
||||
DoLapTopMessageBox( MSG_BOX_BLUE_ON_GREY, MercInfo[ MERC_FILES_BUY_GEAR ], LAPTOP_SCREEN, MSG_BOX_FLAG_YESNO, MercHireButtonGearYesNoCallback );
|
||||
TryToHireMERC();
|
||||
}
|
||||
|
||||
InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
|
||||
@@ -1040,14 +1052,25 @@ void DisplayMercsStats( UINT8 ubMercID )
|
||||
DrawNumeralsToScreen(gMercProfiles[ ubMercID ].bMedical, 3, MERC_STATS_SECOND_NUM_COL_X, usPosY, MERC_STATS_FONT, ubColor);
|
||||
usPosY += MERC_SPACE_BN_LINES;
|
||||
|
||||
//Daily Salary
|
||||
DrawTextToScreen( MercInfo[MERC_FILES_SALARY], MERC_STATS_SECOND_COL_X, usPosY, 0, MERC_STATS_FONT, MERC_STATIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
|
||||
//Merc Salary
|
||||
#ifdef JA2UB
|
||||
// One time "Fee" instead of "Salary" per day
|
||||
DrawTextToScreen( CharacterInfo[AIM_MEMBER_FEE], MERC_STATS_SECOND_COL_X, usPosY, 0, MERC_TITLE_FONT, MERC_TITLE_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
||||
|
||||
usPosX = MERC_STATS_SECOND_COL_X + StringPixLength(MercInfo[MERC_FILES_SALARY], MERC_NAME_FONT);
|
||||
swprintf(sString, L"%d", gMercProfiles[ ubMercID ].sSalary);
|
||||
usPosX = MERC_STATS_SECOND_COL_X + StringPixLength( CharacterInfo[AIM_MEMBER_FEE], MERC_NAME_FONT );
|
||||
swprintf( sString, L"%d", gMercProfiles[ubMercID].uiWeeklySalary );
|
||||
InsertCommasForDollarFigure( sString );
|
||||
InsertDollarSignInToString( sString );
|
||||
swprintf(sTemp, L" %s", MercInfo[MERC_FILES_PER_DAY]);
|
||||
#else
|
||||
DrawTextToScreen( MercInfo[MERC_FILES_SALARY], MERC_STATS_SECOND_COL_X, usPosY, 0, MERC_STATS_FONT, MERC_STATIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
||||
|
||||
usPosX = MERC_STATS_SECOND_COL_X + StringPixLength( MercInfo[MERC_FILES_SALARY], MERC_NAME_FONT );
|
||||
swprintf( sString, L"%d", gMercProfiles[ubMercID].sSalary );
|
||||
InsertCommasForDollarFigure( sString );
|
||||
InsertDollarSignInToString( sString );
|
||||
swprintf( sTemp, L" %s", MercInfo[MERC_FILES_PER_DAY] );
|
||||
#endif // JA2UB
|
||||
|
||||
wcscat( sString, sTemp );
|
||||
DrawTextToScreen( sString, usPosX, usPosY, 95, MERC_NAME_FONT, MERC_DYNAMIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
||||
|
||||
@@ -1059,14 +1082,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 );
|
||||
@@ -1078,7 +1114,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 );
|
||||
@@ -1175,6 +1215,22 @@ BOOLEAN MercFilesHireMerc(UINT8 ubMercID)
|
||||
return(FALSE);//not enough big ones $$$sATMText
|
||||
}
|
||||
|
||||
#ifdef JA2UB
|
||||
Namount = 0;
|
||||
Namount += gMercProfiles[ubMercID].uiWeeklySalary;
|
||||
if ( gSelectedMercKit > 0 )
|
||||
{
|
||||
Namount += gMercProfiles[ubMercID].usOptionalGearCost;
|
||||
}
|
||||
|
||||
if ( Namount > LaptopSaveInfo.iCurrentBalance )
|
||||
{
|
||||
DoLapTopMessageBox( MSG_BOX_LAPTOP_DEFAULT, sATMText[4], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL );
|
||||
return(FALSE);//not enough big ones $$$sATMText
|
||||
}
|
||||
#endif // JA2UB
|
||||
|
||||
|
||||
bReturnCode = HireMerc( &HireMercStruct );
|
||||
|
||||
//already have limit of mercs on the team
|
||||
@@ -1196,16 +1252,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);
|
||||
@@ -1305,15 +1370,7 @@ void HandleMercsFilesKeyBoardInput( )
|
||||
//else try to hire the merc
|
||||
else
|
||||
{
|
||||
//bought gear before
|
||||
if ( (gMercProfiles[ GetAvailableMercIDFromMERCArray( gubCurMercIndex ) ].ubMiscFlags & PROFILE_MISC_FLAG_ALREADY_USED_ITEMS) && !gGameExternalOptions.fGearKitsAlwaysAvailable )
|
||||
{
|
||||
fMercBuyEquipment = 0;
|
||||
MercProcessHireAfterGear();
|
||||
}
|
||||
//prompt to buy gear
|
||||
else
|
||||
DoLapTopMessageBox( MSG_BOX_BLUE_ON_GREY, MercInfo[ MERC_FILES_BUY_GEAR ], LAPTOP_SCREEN, MSG_BOX_FLAG_YESNO, MercHireButtonGearYesNoCallback );
|
||||
TryToHireMERC();
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1783,11 +1840,22 @@ void MercWeaponKitSelectionUpdate(UINT8 selectedInventory)
|
||||
void MercHireButtonGearYesNoCallback (UINT8 bExitValue)
|
||||
{
|
||||
//yes, buy gear
|
||||
if( bExitValue == MSG_BOX_RETURN_YES )
|
||||
if ( bExitValue == MSG_BOX_RETURN_YES )
|
||||
{
|
||||
fMercBuyEquipment = 1;
|
||||
}
|
||||
//no, no gear
|
||||
else
|
||||
{
|
||||
#ifdef JA2UB
|
||||
// Switch to the free, first kit
|
||||
gSelectedMercKit = 0;
|
||||
MercWeaponKitSelectionUpdate( gSelectedMercKit );
|
||||
fMercBuyEquipment = 1;
|
||||
#else
|
||||
fMercBuyEquipment = 0;
|
||||
#endif // JA2UB
|
||||
}
|
||||
|
||||
MercProcessHireAfterGear();
|
||||
}
|
||||
@@ -1810,6 +1878,10 @@ void MercProcessHireAfterGear()
|
||||
|
||||
void NextMercMember()
|
||||
{
|
||||
// Reset selected kit, cannot assume next merc has more than 1 kit
|
||||
gSelectedMercKit = 0;
|
||||
MercWeaponKitSelectionUpdate( gSelectedMercKit );
|
||||
|
||||
if (gfKeyState [ CTRL ])
|
||||
gubCurMercIndex = LaptopSaveInfo.gubLastMercIndex;
|
||||
else if (gfKeyState [ SHIFT ])
|
||||
@@ -1840,6 +1912,10 @@ void NextMercMember()
|
||||
|
||||
void PrevMercMember()
|
||||
{
|
||||
// Reset selected kit, cannot assume next merc has more than 1 kit
|
||||
gSelectedMercKit = 0;
|
||||
MercWeaponKitSelectionUpdate( gSelectedMercKit );
|
||||
|
||||
if (gfKeyState [ CTRL ])
|
||||
gubCurMercIndex = 0;
|
||||
else if (gfKeyState [ SHIFT ])
|
||||
|
||||
@@ -1278,8 +1278,7 @@ void LandHelicopter( void )
|
||||
else
|
||||
{
|
||||
#ifdef JA2UB
|
||||
Assert( 0 );
|
||||
//No meanwhiles
|
||||
//No meanwhiles in UB
|
||||
#else
|
||||
// play meanwhile scene if it hasn't been used yet
|
||||
HandleKillChopperMeanwhileScene();
|
||||
|
||||
@@ -5283,12 +5283,12 @@ BOOLEAN LoadMilitiaPopUpBox( void )
|
||||
// load the militia pop up box
|
||||
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
|
||||
|
||||
if (iResolution >= _640x480 && iResolution < _800x600)
|
||||
FilenameForBPP("INTERFACE\\Militia.sti", VObjectDesc.ImageFile);
|
||||
else if (iResolution < _1024x768)
|
||||
if ( isWidescreenUI() || iResolution >= _1024x768)
|
||||
FilenameForBPP("INTERFACE\\Militia_1024x768.sti", VObjectDesc.ImageFile);
|
||||
else if (iResolution >= _800x600)
|
||||
FilenameForBPP("INTERFACE\\Militia_800x600.sti", VObjectDesc.ImageFile);
|
||||
else
|
||||
FilenameForBPP("INTERFACE\\Militia_1024x768.sti", VObjectDesc.ImageFile);
|
||||
FilenameForBPP("INTERFACE\\Militia.sti", VObjectDesc.ImageFile);
|
||||
|
||||
CHECKF(AddVideoObject(&VObjectDesc, &guiMilitia));
|
||||
|
||||
|
||||
@@ -342,8 +342,8 @@ BOOLEAN SetThisSectorAsPlayerControlled( INT16 sMapX, INT16 sMapY, INT8 bMapZ, B
|
||||
// Ja25: no loyalty
|
||||
#else
|
||||
HandleGlobalLoyaltyEvent( GLOBAL_LOYALTY_GAIN_SAM, sMapX, sMapY, bMapZ );
|
||||
UpdateAirspaceControl( );
|
||||
#endif
|
||||
UpdateAirspaceControl( );
|
||||
// if Skyrider has been delivered to chopper, and already mentioned Drassen SAM site, but not used this quote yet
|
||||
if ( IsHelicopterPilotAvailable( ) && ( guiHelicopterSkyriderTalkState >= 1 ) && ( !gfSkyriderSaidCongratsOnTakingSAM ) )
|
||||
{
|
||||
|
||||
@@ -3171,7 +3171,7 @@ BOOLEAN CheckPendingNonPlayerTeam( UINT8 usTeam )
|
||||
void HandleBloodCatDeaths( SECTORINFO *pSector )
|
||||
{
|
||||
//if the current sector is the first part of the town
|
||||
if( gWorldSectorX == 10 && gWorldSectorY == 9 && gbWorldSectorZ == 0 )
|
||||
if( gWorldSectorX == BETTY_BLOODCAT_SECTOR_X && gWorldSectorY == BETTY_BLOODCAT_SECTOR_Y && gbWorldSectorZ == BETTY_BLOODCAT_SECTOR_Z )
|
||||
{
|
||||
//if ALL the bloodcats are killed
|
||||
if( pSector->bBloodCats == 0 )
|
||||
|
||||
+55
-18
@@ -1610,6 +1610,11 @@ void InitStrategicAI()
|
||||
case 1:
|
||||
if( ubPicked[0] != ubSector && ubPicked[1] != ubSector )
|
||||
{
|
||||
// (0,0) coordinates signify a not used cache sector
|
||||
if ( gModSettings.ubWeaponCache1X == 0 || gModSettings.ubWeaponCache1Y == 0 )
|
||||
{
|
||||
break;
|
||||
}
|
||||
pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache1X, gModSettings.ubWeaponCache1Y ) ]; //SEC_E11
|
||||
pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
|
||||
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops1 * 2);
|
||||
@@ -1628,6 +1633,10 @@ void InitStrategicAI()
|
||||
case 2:
|
||||
if( ubPicked[0] != ubSector && ubPicked[1] != ubSector )
|
||||
{
|
||||
if ( gModSettings.ubWeaponCache2X == 0 || gModSettings.ubWeaponCache2Y == 0 )
|
||||
{
|
||||
break;
|
||||
}
|
||||
pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache2X, gModSettings.ubWeaponCache2Y ) ]; //SEC_H5
|
||||
pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
|
||||
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops2 * 2);
|
||||
@@ -1646,6 +1655,10 @@ void InitStrategicAI()
|
||||
case 3:
|
||||
if( ubPicked[0] != ubSector && ubPicked[1] != ubSector )
|
||||
{
|
||||
if ( gModSettings.ubWeaponCache3X == 0 || gModSettings.ubWeaponCache3Y == 0 )
|
||||
{
|
||||
break;
|
||||
}
|
||||
pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache3X, gModSettings.ubWeaponCache3Y ) ]; //SEC_H10
|
||||
pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
|
||||
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops3 * 2);
|
||||
@@ -1664,6 +1677,10 @@ void InitStrategicAI()
|
||||
case 4:
|
||||
if( ubPicked[0] != ubSector && ubPicked[1] != ubSector )
|
||||
{
|
||||
if ( gModSettings.ubWeaponCache4X == 0 || gModSettings.ubWeaponCache4Y == 0 )
|
||||
{
|
||||
break;
|
||||
}
|
||||
pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache4X, gModSettings.ubWeaponCache4Y ) ]; //SEC_J12
|
||||
pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
|
||||
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops4 * 2);
|
||||
@@ -1682,6 +1699,10 @@ void InitStrategicAI()
|
||||
case 5:
|
||||
if( ubPicked[0] != ubSector && ubPicked[1] != ubSector )
|
||||
{
|
||||
if ( gModSettings.ubWeaponCache5X == 0 || gModSettings.ubWeaponCache5Y == 0 )
|
||||
{
|
||||
break;
|
||||
}
|
||||
pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache5X, gModSettings.ubWeaponCache5Y ) ]; //SEC_M9
|
||||
pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
|
||||
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops5 * 2);
|
||||
@@ -1706,25 +1727,40 @@ void InitStrategicAI()
|
||||
}
|
||||
else
|
||||
{
|
||||
pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache1X, gModSettings.ubWeaponCache1Y ) ]; //SEC_E11
|
||||
pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
|
||||
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops1 * 2);
|
||||
if ( gModSettings.ubWeaponCache1X != 0 && gModSettings.ubWeaponCache1Y != 0 )
|
||||
{
|
||||
pSector = &SectorInfo[SECTOR( gModSettings.ubWeaponCache1X, gModSettings.ubWeaponCache1Y )]; //SEC_E11
|
||||
pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
|
||||
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops1 * 2);
|
||||
}
|
||||
|
||||
pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache2X, gModSettings.ubWeaponCache2Y ) ]; //SEC_H5
|
||||
pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
|
||||
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops2 * 2);
|
||||
if ( gModSettings.ubWeaponCache2X != 0 && gModSettings.ubWeaponCache2Y != 0 )
|
||||
{
|
||||
pSector = &SectorInfo[SECTOR( gModSettings.ubWeaponCache2X, gModSettings.ubWeaponCache2Y )]; //SEC_H5
|
||||
pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
|
||||
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops2 * 2);
|
||||
}
|
||||
|
||||
pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache3X, gModSettings.ubWeaponCache3Y ) ]; //SEC_H10
|
||||
pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
|
||||
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops3 * 2);
|
||||
if ( gModSettings.ubWeaponCache3X != 0 && gModSettings.ubWeaponCache3Y != 0 )
|
||||
{
|
||||
pSector = &SectorInfo[SECTOR( gModSettings.ubWeaponCache3X, gModSettings.ubWeaponCache3Y )]; //SEC_H10
|
||||
pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
|
||||
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops3 * 2);
|
||||
}
|
||||
|
||||
pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache4X, gModSettings.ubWeaponCache4Y ) ]; //SEC_J12
|
||||
pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
|
||||
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops4 * 2);
|
||||
if ( gModSettings.ubWeaponCache4X != 0 && gModSettings.ubWeaponCache4Y != 0 )
|
||||
{
|
||||
pSector = &SectorInfo[SECTOR( gModSettings.ubWeaponCache4X, gModSettings.ubWeaponCache4Y )]; //SEC_J12
|
||||
pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
|
||||
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops4 * 2);
|
||||
}
|
||||
|
||||
pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache5X, gModSettings.ubWeaponCache5Y ) ]; //SEC_M9
|
||||
pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
|
||||
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops5 * 2);
|
||||
if ( gModSettings.ubWeaponCache5X != 0 && gModSettings.ubWeaponCache5Y != 0 )
|
||||
{
|
||||
pSector = &SectorInfo[SECTOR( gModSettings.ubWeaponCache5X, gModSettings.ubWeaponCache5Y )]; //SEC_M9
|
||||
pSector->uiFlags |= SF_USE_ALTERNATE_MAP;
|
||||
pSector->ubNumTroops = (UINT8)(6 + zDiffSetting[gGameOptions.ubDifficultyLevel].iWeaponCacheTroops5 * 2);
|
||||
}
|
||||
|
||||
/*
|
||||
pSector = &SectorInfo[ SECTOR( gModSettings.ubWeaponCache1X, gModSettings.ubWeaponCache1Y ) ]; //SEC_E11
|
||||
@@ -7115,15 +7151,16 @@ void InitializeGroup( const GROUP_TYPE groupType, const UINT8 groupSize, UINT8 &
|
||||
tankCount++;
|
||||
}
|
||||
|
||||
if ( gGameExternalOptions.fASDAssignsJeeps && ASDSoldierUpgradeToJeep( ) )
|
||||
if ( troopCount > 0 && gGameExternalOptions.fASDAssignsJeeps && ASDSoldierUpgradeToJeep( ) )
|
||||
{
|
||||
troopCount--;
|
||||
jeepCount++;
|
||||
}
|
||||
|
||||
if ( gGameExternalOptions.fASDAssignsRobots && ASDSoldierUpgradeToRobot() )
|
||||
if ( troopCount > 0 && gGameExternalOptions.fASDAssignsRobots && ASDSoldierUpgradeToRobot() )
|
||||
{
|
||||
const int numRobots = 1 + Random(difficultyMod);
|
||||
// Limit amount of robots, if randomized difficulty bonus would cause us to go over the troopCount amount
|
||||
const int numRobots = min( (1 + Random(difficultyMod)), troopCount);
|
||||
troopCount -= numRobots;
|
||||
robotCount += numRobots;
|
||||
}
|
||||
|
||||
@@ -2644,6 +2644,7 @@ BOOLEAN PossibleToCoordinateSimultaneousGroupArrivals( GROUP *pFirstGroup )
|
||||
{
|
||||
if ( pGroup != pFirstGroup && (pGroup->usGroupTeam == OUR_TEAM || pGroup->usGroupTeam == MILITIA_TEAM) && pGroup->fBetweenSectors &&
|
||||
pGroup->ubNextX == pFirstGroup->ubSectorX && pGroup->ubNextY == pFirstGroup->ubSectorY &&
|
||||
pFirstGroup->ubSectorZ == pGroup->ubSectorZ &&
|
||||
!(pGroup->uiFlags & GROUPFLAG_SIMULTANEOUSARRIVAL_CHECKED) &&
|
||||
!IsGroupTheHelicopterGroup( pGroup ) )
|
||||
{
|
||||
|
||||
@@ -7778,6 +7778,7 @@ void HandleMovingEnemiesCloseToEntranceInSecondTunnelMap( )
|
||||
|
||||
void HandlePowerGenFanSoundModification( )
|
||||
{
|
||||
extern UINT32 POWERGENSECTOREXITGRID_SRC_GRIDNO;
|
||||
SetTileAnimCounter( TILE_ANIM__FAST_SPEED );
|
||||
|
||||
switch ( gJa25SaveStruct.ubStateOfFanInPowerGenSector )
|
||||
@@ -7786,7 +7787,7 @@ void HandlePowerGenFanSoundModification( )
|
||||
HandleAddingPowerGenFanSound( );
|
||||
|
||||
//MAKE SURE the fan does not have an exit grid
|
||||
RemoveExitGridFromWorld( PGF__FAN_EXIT_GRID_GRIDNO );
|
||||
RemoveExitGridFromWorld( POWERGENSECTOREXITGRID_SRC_GRIDNO );
|
||||
break;
|
||||
|
||||
case PGF__STOPPED:
|
||||
|
||||
@@ -1345,10 +1345,10 @@ void HandleDialogue( )
|
||||
{
|
||||
HandleEveryoneDoneTheirEndGameQuotes();
|
||||
}
|
||||
else
|
||||
else if ( QItem.uiSpecialEventData & MULTIPURPOSE_SPECIAL_EVENT_GETUP_AFTER_HELI_CRASH )
|
||||
{
|
||||
// grab soldier ptr from profile ID
|
||||
pSoldier = FindSoldierByProfileID( (UINT8)QItem.uiSpecialEventData, FALSE );
|
||||
pSoldier = FindSoldierByProfileID( (UINT8)QItem.uiSpecialEventData2, FALSE );
|
||||
|
||||
// FindSoldier was returning a lot of nullptrs which would crash the game very quickly after Jerry gets up. This check is here to circumvent that.
|
||||
if (pSoldier != nullptr)
|
||||
|
||||
@@ -262,6 +262,7 @@ enum DialogQuoteIDs
|
||||
#ifdef JA2UB
|
||||
#define MULTIPURPOSE_SPECIAL_EVENT_TEAM_MEMBERS_DONE_TALKING 0x20000000
|
||||
#define MULTIPURPOSE_SPECIAL_EVENT_DONE_KILLING_DEIDRANNA 0x10000000
|
||||
#define MULTIPURPOSE_SPECIAL_EVENT_GETUP_AFTER_HELI_CRASH 0x08000000
|
||||
#else
|
||||
#define MULTIPURPOSE_SPECIAL_EVENT_DONE_KILLING_DEIDRANNA 0x00000001
|
||||
#define MULTIPURPOSE_SPECIAL_EVENT_TEAM_MEMBERS_DONE_TALKING 0x00000002
|
||||
|
||||
@@ -2353,7 +2353,8 @@ void HandleNPCDoAction( UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum
|
||||
break;
|
||||
case NPC_ACTION_HAVE_PACOS_FOLLOW:
|
||||
pSoldier = FindSoldierByProfileID( 114, FALSE );
|
||||
sGridNo = 18193; //dnl!!!
|
||||
sGridNo = 8537; //dnl!!!
|
||||
//kitty: changed gridno from 18193 to 8537, that's at entrance door to rebel basement, where Fatima and Dimitri dialogue happens
|
||||
if (pSoldier)
|
||||
{
|
||||
if (NewOKDestination( pSoldier, sGridNo, TRUE, 0 ) )
|
||||
@@ -4331,7 +4332,7 @@ void HandleNPCDoAction( UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum
|
||||
case NPC_ACTION_PUT_PACOS_IN_BASEMENT:
|
||||
gMercProfiles[ PACOS ].sSectorX = 10;
|
||||
gMercProfiles[ PACOS ].sSectorY = MAP_ROW_A;
|
||||
gMercProfiles[ PACOS ].bSectorZ = 0;
|
||||
gMercProfiles[ PACOS ].bSectorZ = 1; //kitty: fixed - first level underground is 1, not 0
|
||||
break;
|
||||
case NPC_ACTION_HISTORY_ASSASSIN:
|
||||
AddHistoryToPlayersLog( HISTORY_ASSASSIN, 0, GetWorldTotalMin(), gWorldSectorX, gWorldSectorY );
|
||||
|
||||
+15
-8
@@ -1271,14 +1271,21 @@ BOOLEAN ItemIsLegal( UINT16 usItemIndex, BOOLEAN fIgnoreCoolness )
|
||||
if ( Item[usItemIndex].ubCoolness == 0 && !fIgnoreCoolness )
|
||||
return FALSE;
|
||||
|
||||
// silversurfer: no food items if the food system is off
|
||||
if (!UsingFoodSystem() && Item[usItemIndex].foodtype > 0)
|
||||
{
|
||||
// silversurfer: Only restrict food for now. Water can be used to replenish lost energy so it is useful even without the food system.
|
||||
// kitty: and only if food isn't a drug at the same time, to make sure using those drugs without food system is possible
|
||||
if (Food[Item[usItemIndex].foodtype].bFoodPoints > 0 && Item[usItemIndex].drugtype == 0 )
|
||||
return FALSE;
|
||||
}
|
||||
// kitty: players might want food items in game for roleplay reasons, i.e. when interacting with npc-dealer in restaurant, no food might seems odd
|
||||
// with the option "ALWAYS_FOOD" set TRUE, food items will show even without using the foodsystem
|
||||
// should it be set to FALSE, no food items will be shown without using the foodsystem
|
||||
if (!gGameExternalOptions.fAlwaysFood)
|
||||
{
|
||||
// silversurfer: no food items if the food system is off
|
||||
if (!UsingFoodSystem() && Item[usItemIndex].foodtype > 0 )
|
||||
{
|
||||
// silversurfer: Only restrict food for now. Water can be used to replenish lost energy so it is useful even without the food system.
|
||||
// kitty: and only if food isn't a drug at the same time, to make sure using those drugs without food system is possible
|
||||
if (Food[Item[usItemIndex].foodtype].bFoodPoints > 0 && Item[usItemIndex].drugtype == 0 )
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
// kitty: no disease items if the disease system is off
|
||||
// whether the item is exclusive is defined by tag
|
||||
|
||||
+31
-19
@@ -293,7 +293,8 @@ UINT32 POWERGENSECTOR_GRIDNO1 = 15100;
|
||||
UINT32 POWERGENSECTOR_GRIDNO2 = 12220;
|
||||
UINT32 POWERGENSECTOR_GRIDNO3 = 14155;
|
||||
UINT32 POWERGENSECTOR_GRIDNO4 = 13980;
|
||||
UINT32 POWERGENSECTOREXITGRID_GRIDNO1 = 19749;
|
||||
UINT32 POWERGENSECTOREXITGRID_SRC_GRIDNO = 10979;
|
||||
UINT32 POWERGENSECTOREXITGRID_DST_GRIDNO = 19749;
|
||||
UINT32 POWERGENFANSOUND_GRIDNO1 = 10979;
|
||||
UINT32 POWERGENFANSOUND_GRIDNO2 = 19749;
|
||||
UINT32 STARTFANBACKUPAGAIN_GRIDNO = 10980;
|
||||
@@ -304,17 +305,22 @@ UINT32 SECTOR_LAUNCH_MISSLES_Y = 12;
|
||||
UINT32 SECTOR_LAUNCH_MISSLES_Z = 3;
|
||||
//J13-0
|
||||
UINT32 SECTOR_FAN_X = 13;
|
||||
UINT32 SECTOR_FAN_Z = 10;
|
||||
UINT32 SECTOR_FAN_Y = 0;
|
||||
UINT32 SECTOR_FAN_Y = 10;
|
||||
UINT32 SECTOR_FAN_Z = 0;
|
||||
//K14-1
|
||||
UINT32 SECTOR_OPEN_GATE_IN_TUNNEL_X = 14;
|
||||
UINT32 SECTOR_OPEN_GATE_IN_TUNNEL_Y = 11;
|
||||
UINT32 SECTOR_OPEN_GATE_IN_TUNNEL_Z = 1;
|
||||
//J14-1
|
||||
// Destination sector for fan exitgrid
|
||||
//J14-1
|
||||
UINT32 EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_X = 14;
|
||||
UINT32 EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Y = 10;
|
||||
UINT32 EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Z = 1;
|
||||
|
||||
INT16 BETTY_BLOODCAT_SECTOR_X = 10;
|
||||
INT16 BETTY_BLOODCAT_SECTOR_Y = 9;
|
||||
INT8 BETTY_BLOODCAT_SECTOR_Z = 0;
|
||||
|
||||
void InitGridNoUB()
|
||||
{
|
||||
SWITCHINMORRISAREA_GRIDNO = gGameUBOptions.SwitchInMorrisAreaGridNo; //= 15231;
|
||||
@@ -326,7 +332,8 @@ void InitGridNoUB()
|
||||
POWERGENSECTOR_GRIDNO2 = gGameUBOptions.PowergenSectorGridNo2; //= 12220;
|
||||
POWERGENSECTOR_GRIDNO3 = gGameUBOptions.PowergenSectorGridNo3; //= 14155;
|
||||
POWERGENSECTOR_GRIDNO4 = gGameUBOptions.PowergenSectorGridNo4; //= 13980;
|
||||
POWERGENSECTOREXITGRID_GRIDNO1 = gGameUBOptions.PowergenSectorExitgridGridNo; // = 19749;
|
||||
POWERGENSECTOREXITGRID_SRC_GRIDNO = gGameUBOptions.PowergenSectorExitgridSrcGridNo; //= 10979; // Exitgrid location in the sector it is created in
|
||||
POWERGENSECTOREXITGRID_DST_GRIDNO = gGameUBOptions.PowergenSectorExitgridGridNo; // = 19749; // Exitgrid location in the destination sector
|
||||
POWERGENFANSOUND_GRIDNO1 = gGameUBOptions.PowergenFanSoundGridNo1; //= 10979;
|
||||
POWERGENFANSOUND_GRIDNO2 = gGameUBOptions.PowergenFanSoundGridNo2; //= 19749;
|
||||
STARTFANBACKUPAGAIN_GRIDNO = gGameUBOptions.StartFanbackupAgainGridNo; //= 10980;
|
||||
@@ -338,8 +345,8 @@ void InitGridNoUB()
|
||||
SECTOR_LAUNCH_MISSLES_Z = gGameUBOptions.SectorLaunchMisslesZ; //3;
|
||||
//J13-0
|
||||
SECTOR_FAN_X = gGameUBOptions.SectorFanX; //13;
|
||||
SECTOR_FAN_Z = gGameUBOptions.SectorFanY; //10;
|
||||
SECTOR_FAN_Y = gGameUBOptions.SectorFanZ; //0;
|
||||
SECTOR_FAN_Y = gGameUBOptions.SectorFanY; //10;
|
||||
SECTOR_FAN_Z = gGameUBOptions.SectorFanZ; //0;
|
||||
//K14-1
|
||||
SECTOR_OPEN_GATE_IN_TUNNEL_X = gGameUBOptions.SectorOpenGateInTunnelX; //14;
|
||||
SECTOR_OPEN_GATE_IN_TUNNEL_Y = gGameUBOptions.SectorOpenGateInTunnelY; //11;
|
||||
@@ -348,7 +355,12 @@ void InitGridNoUB()
|
||||
EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_X = gGameUBOptions.ExitForFanToPowerGenSectorX; //14;
|
||||
EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Y = gGameUBOptions.ExitForFanToPowerGenSectorY; //10;
|
||||
EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Z = gGameUBOptions.ExitForFanToPowerGenSectorZ; //1;
|
||||
|
||||
|
||||
BETTY_BLOODCAT_SECTOR_X = gGameUBOptions.BettyBloodCatSectorX;
|
||||
BETTY_BLOODCAT_SECTOR_Y = gGameUBOptions.BettyBloodCatSectorY;
|
||||
BETTY_BLOODCAT_SECTOR_Z = gGameUBOptions.BettyBloodCatSectorZ;
|
||||
|
||||
|
||||
MANUEL_UB = gGameUBOptions.ubMANUEL_UB;
|
||||
BIGGENS_UB = gGameUBOptions.ubBIGGENS_UB;
|
||||
JOHN_K_UB = gGameUBOptions.ubJOHN_K_UB;
|
||||
@@ -646,7 +658,7 @@ void HandleWhenCertainPercentageOfEnemiesDie()
|
||||
UINT32 uiPercentEnemiesKilled;
|
||||
UINT8 ubSectorID;
|
||||
|
||||
//if there isnt enemies in the sector
|
||||
//if there isn't enemies in the sector
|
||||
if( ( gTacticalStatus.Team[ ENEMY_TEAM ].bMenInSector + gTacticalStatus.ubArmyGuysKilled ) == 0 )
|
||||
{
|
||||
//get out
|
||||
@@ -663,7 +675,7 @@ void HandleWhenCertainPercentageOfEnemiesDie()
|
||||
switch( ubSectorID )
|
||||
{
|
||||
case SEC_K15:
|
||||
//all enemies are dead and if the quote hasnt been said yet
|
||||
//all enemies are dead and if the quote hasn't been said yet
|
||||
if( uiPercentEnemiesKilled >= 100 && !( gJa25SaveStruct.uiJa25GeneralFlags & JA_GF__ALL_DEAD_TOP_LEVEL_OF_COMPLEX ) )
|
||||
{
|
||||
INT16 bProfile = RandomProfileIdFromNewMercsOnPlayerTeam();
|
||||
@@ -703,7 +715,7 @@ void StopPowerGenFan()
|
||||
return;
|
||||
}
|
||||
|
||||
//Remeber how the player got through
|
||||
//Remember how the player got through
|
||||
SetJa25GeneralFlag( JA_GF__POWER_GEN_FAN_HAS_BEEN_STOPPED );
|
||||
|
||||
gJa25SaveStruct.ubStateOfFanInPowerGenSector = PGF__STOPPED;
|
||||
@@ -721,7 +733,7 @@ void StopPowerGenFan()
|
||||
//Turn off the power gen fan sound
|
||||
HandleRemovingPowerGenFanSound();
|
||||
|
||||
//remeber which turn the fan stopped on
|
||||
//remember which turn the fan stopped on
|
||||
gJa25SaveStruct.uiTurnPowerGenFanWentDown = gJa25SaveStruct.uiTacticalTurnCounter;
|
||||
|
||||
|
||||
@@ -729,7 +741,7 @@ void StopPowerGenFan()
|
||||
// Replace the Fan graphic
|
||||
//
|
||||
|
||||
// Turn on permenant changes....
|
||||
// Turn on permanent changes....
|
||||
ApplyMapChangesToMapTempFile( TRUE );
|
||||
|
||||
//Add the exit grid to the power gen fan
|
||||
@@ -784,7 +796,7 @@ void StartFanBackUpAgain()
|
||||
return;
|
||||
}
|
||||
|
||||
//Remeber how the player got through
|
||||
//Remember how the player got through
|
||||
gJa25SaveStruct.ubStateOfFanInPowerGenSector = PGF__RUNNING_NORMALLY;
|
||||
|
||||
|
||||
@@ -796,7 +808,7 @@ void StartFanBackUpAgain()
|
||||
// Replace the Fan graphic
|
||||
//
|
||||
|
||||
// Turn on permenant changes....
|
||||
// Turn on permanent changes....
|
||||
ApplyMapChangesToMapTempFile( TRUE );
|
||||
|
||||
// Remove it!
|
||||
@@ -821,7 +833,7 @@ void StartFanBackUpAgain()
|
||||
gTacticalStatus.uiFlags |= NOHIDE_REDUNDENCY;
|
||||
|
||||
//Remove the exit grid
|
||||
RemoveExitGridFromWorld( PGF__FAN_EXIT_GRID_GRIDNO );
|
||||
RemoveExitGridFromWorld( POWERGENSECTOREXITGRID_SRC_GRIDNO );
|
||||
|
||||
// FOR THE NEXT RENDER LOOP, RE-EVALUATE REDUNDENT TILES
|
||||
SetRenderFlags(RENDER_FLAG_FULL);
|
||||
@@ -914,7 +926,7 @@ void HandleAddingPowerGenFanSound()
|
||||
sGridNo = POWERGENFANSOUND_GRIDNO2;
|
||||
|
||||
//Create the new ambient fan sound
|
||||
//gJa25SaveStruct.iPowerGenFanPositionSndID = NewPositionSnd( sGridNo, POSITION_SOUND_STATIONATY_OBJECT, 0, POWER_GEN_FAN_SOUND );
|
||||
gJa25SaveStruct.iPowerGenFanPositionSndID = NewPositionSnd( sGridNo, POSITION_SOUND_STATIONATY_OBJECT, 0, POWER_GEN_FAN_SOUND, 30 );
|
||||
|
||||
SetPositionSndsInActive( );
|
||||
SetPositionSndsActive( );
|
||||
@@ -942,10 +954,10 @@ void AddExitGridForFanToPowerGenSector()
|
||||
ExitGrid.ubGotoSectorX = EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_X; //14;
|
||||
ExitGrid.ubGotoSectorY = EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Y; //MAP_ROW_J;
|
||||
ExitGrid.ubGotoSectorZ = EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Z; //1;
|
||||
ExitGrid.usGridNo = POWERGENSECTOREXITGRID_GRIDNO1;
|
||||
ExitGrid.usGridNo = POWERGENSECTOREXITGRID_DST_GRIDNO;
|
||||
|
||||
//Add the exit grid when the fan is either stopped or blown up
|
||||
AddExitGridToWorld( PGF__FAN_EXIT_GRID_GRIDNO, &ExitGrid );
|
||||
AddExitGridToWorld( POWERGENSECTOREXITGRID_SRC_GRIDNO, &ExitGrid );
|
||||
}
|
||||
|
||||
BOOLEAN HandlePlayerSayingQuoteWhenFailingToOpenGateInTunnel( SOLDIERTYPE *pSoldierAtDoor, BOOLEAN fSayQuoteOnlyOnce )
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
#include "MapScreen Quotes.h"
|
||||
|
||||
#define PGF__FAN_EXIT_GRID_GRIDNO 10979
|
||||
|
||||
#define NUM_MERCS_WITH_NEW_QUOTES 20//7
|
||||
|
||||
@@ -144,6 +143,10 @@ extern UINT8 RAUL_UB;
|
||||
extern UINT8 MORRIS_UB;
|
||||
extern UINT8 RUDY_UB;
|
||||
|
||||
extern INT16 BETTY_BLOODCAT_SECTOR_X;
|
||||
extern INT16 BETTY_BLOODCAT_SECTOR_Y;
|
||||
extern INT8 BETTY_BLOODCAT_SECTOR_Z;
|
||||
|
||||
extern void Old_UB_Inventory ();
|
||||
extern void New_UB_Inventory ();
|
||||
|
||||
|
||||
+62
-62
@@ -1036,78 +1036,78 @@ if ( gGameUBOptions.InGameHeliCrash == TRUE )
|
||||
|
||||
void UpdateJerryMiloInInitialSector()
|
||||
{
|
||||
SOLDIERTYPE *pSoldier = NULL;
|
||||
SOLDIERTYPE *pJerrySoldier=NULL;
|
||||
SOLDIERTYPE *pSoldier = NULL;
|
||||
SOLDIERTYPE *pJerrySoldier = NULL;
|
||||
|
||||
|
||||
//SectorInfo[ SEC_H7 ].fSurfaceWasEverPlayerControlled = TRUE;
|
||||
SectorInfo[ (UINT8)SECTOR( gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY ) ].fSurfaceWasEverPlayerControlled = TRUE;
|
||||
//SectorInfo[ SEC_H7 ].ubNumAdmins = 2;
|
||||
StrategicMap[ (UINT8)SECTOR( gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY ) ].fEnemyControlled = FALSE;
|
||||
|
||||
if ( gGameUBOptions.InGameHeli == TRUE )
|
||||
return; //AA
|
||||
|
||||
if ( gGameUBOptions.InGameHeliCrash == TRUE )
|
||||
{
|
||||
//if it is the first sector we are loading up, place Jerry in the map
|
||||
if( !gfFirstTimeInGameHeliCrash )
|
||||
return;
|
||||
|
||||
if ( gGameUBOptions.InJerry == TRUE )
|
||||
{
|
||||
pSoldier = FindSoldierByProfileID( JERRY_MILO_UB, FALSE ); //JERRY
|
||||
if( pSoldier == NULL )
|
||||
{
|
||||
Assert( 0 );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//the internet part of the laptop isnt working. It gets broken in the heli crash.
|
||||
if ( gGameUBOptions.LaptopQuestEnabled == TRUE )
|
||||
StartQuest( QUEST_FIX_LAPTOP, -1, -1 );
|
||||
|
||||
//Record the initial sector as ours
|
||||
//SectorInfo[ SEC_H7 ].fSurfaceWasEverPlayerControlled = TRUE;
|
||||
SectorInfo[ (UINT8)SECTOR( gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY ) ].fSurfaceWasEverPlayerControlled = TRUE;
|
||||
StrategicMap[ (UINT8)SECTOR( gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY ) ].fEnemyControlled = FALSE;
|
||||
|
||||
if ( gGameUBOptions.InJerry == TRUE )
|
||||
SectorInfo[(UINT8)SECTOR( gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY )].fSurfaceWasEverPlayerControlled = TRUE;
|
||||
//SectorInfo[ SEC_H7 ].ubNumAdmins = 2;
|
||||
StrategicMap[CALCULATE_STRATEGIC_INDEX( gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY )].fEnemyControlled = FALSE;
|
||||
|
||||
if ( gGameUBOptions.InGameHeli == TRUE )
|
||||
return; //AA
|
||||
|
||||
if ( gGameUBOptions.InGameHeliCrash == TRUE )
|
||||
{
|
||||
//Set some variable so Jerry will be on the ground
|
||||
pSoldier->fWaitingToGetupFromJA25Start = TRUE;
|
||||
pSoldier->fIgnoreGetupFromCollapseCheck = TRUE;
|
||||
//if it is the first sector we are loading up, place Jerry in the map
|
||||
if ( !gfFirstTimeInGameHeliCrash )
|
||||
return;
|
||||
|
||||
//pSoldier->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO; //to by³o wy³¹czone
|
||||
//pSoldier->usStrategicInsertionData = GetInitialHeliGridNo( ); //to by³o wy³¹czone
|
||||
if ( gGameUBOptions.InJerry == TRUE )
|
||||
{
|
||||
pSoldier = FindSoldierByProfileID( JERRY_MILO_UB, FALSE ); //JERRY
|
||||
if ( pSoldier == NULL )
|
||||
{
|
||||
Assert( 0 );
|
||||
}
|
||||
|
||||
RESETTIMECOUNTER( pSoldier->GetupFromJA25StartCounter, gsInitialHeliRandomTimes[ 6 ] + 800 + Random( 400 ) );
|
||||
}
|
||||
|
||||
//should we be on our back or tummy
|
||||
if( Random( 100 ) < 50 )
|
||||
pSoldier->EVENT_InitNewSoldierAnim( STAND_FALLFORWARD_STOP, 1, TRUE );
|
||||
else
|
||||
pSoldier->EVENT_InitNewSoldierAnim( FALLBACKHIT_STOP, 1, TRUE );
|
||||
}
|
||||
//the internet part of the laptop isnt working. It gets broken in the heli crash.
|
||||
if ( gGameUBOptions.LaptopQuestEnabled == TRUE )
|
||||
StartQuest( QUEST_FIX_LAPTOP, -1, -1 );
|
||||
|
||||
//Wont work cause it gets reset every frame
|
||||
//make sure we can see Jerry
|
||||
|
||||
if ( gGameUBOptions.InJerry == TRUE )
|
||||
{
|
||||
pJerrySoldier = FindSoldierByProfileID(JERRY_MILO_UB, FALSE );//JERRY
|
||||
if( pJerrySoldier != NULL )
|
||||
{
|
||||
//Make sure we can see the pilot
|
||||
gbPublicOpplist[OUR_TEAM][ pJerrySoldier->ubID ] = SEEN_CURRENTLY;
|
||||
pJerrySoldier->bVisible = TRUE;
|
||||
}
|
||||
//Record the initial sector as ours
|
||||
//SectorInfo[ SEC_H7 ].fSurfaceWasEverPlayerControlled = TRUE;
|
||||
SectorInfo[(UINT8)SECTOR( gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY )].fSurfaceWasEverPlayerControlled = TRUE;
|
||||
StrategicMap[CALCULATE_STRATEGIC_INDEX( gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY )].fEnemyControlled = FALSE;
|
||||
|
||||
}
|
||||
if ( gGameUBOptions.InJerry == TRUE )
|
||||
{
|
||||
//Set some variable so Jerry will be on the ground
|
||||
pSoldier->fWaitingToGetupFromJA25Start = TRUE;
|
||||
pSoldier->fIgnoreGetupFromCollapseCheck = TRUE;
|
||||
|
||||
//Lock the interface
|
||||
guiPendingOverrideEvent = LU_BEGINUILOCK;
|
||||
//pSoldier->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO; //to by³o wy³¹czone
|
||||
//pSoldier->usStrategicInsertionData = GetInitialHeliGridNo( ); //to by³o wy³¹czone
|
||||
|
||||
RESETTIMECOUNTER( pSoldier->GetupFromJA25StartCounter, gsInitialHeliRandomTimes[6] + 800 + Random( 400 ) );
|
||||
|
||||
//should we be on our back or tummy
|
||||
if ( Random( 100 ) < 50 )
|
||||
pSoldier->EVENT_InitNewSoldierAnim( STAND_FALLFORWARD_STOP, 1, TRUE );
|
||||
else
|
||||
pSoldier->EVENT_InitNewSoldierAnim( FALLBACKHIT_STOP, 1, TRUE );
|
||||
}
|
||||
|
||||
//Wont work cause it gets reset every frame
|
||||
//make sure we can see Jerry
|
||||
|
||||
if ( gGameUBOptions.InJerry == TRUE )
|
||||
{
|
||||
pJerrySoldier = FindSoldierByProfileID( JERRY_MILO_UB, FALSE );//JERRY
|
||||
if ( pJerrySoldier != NULL )
|
||||
{
|
||||
//Make sure we can see the pilot
|
||||
gbPublicOpplist[OUR_TEAM][pJerrySoldier->ubID] = SEEN_CURRENTLY;
|
||||
pJerrySoldier->bVisible = TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Lock the interface
|
||||
guiPendingOverrideEvent = LU_BEGINUILOCK;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1077,7 +1077,7 @@ BOOLEAN ExecuteOverhead( )
|
||||
pSoldier->DoMercBattleSound( BATTLE_SOUND_CURSE1 );
|
||||
}
|
||||
|
||||
SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_MULTIPURPOSE, pSoldier->ubProfile, 0, 0, pSoldier->iFaceIndex, 0 );
|
||||
SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_MULTIPURPOSE, MULTIPURPOSE_SPECIAL_EVENT_GETUP_AFTER_HELI_CRASH, pSoldier->ubProfile, 0, pSoldier->iFaceIndex, 0 );
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -7915,7 +7915,7 @@ BOOLEAN CheckForEndOfBattle( BOOLEAN fAnEnemyRetreated )
|
||||
if ( CheckFact( FACT_FIRST_BATTLE_BEING_FOUGHT, 0 ) )
|
||||
{
|
||||
// ATE: Need to trigger record for this event .... for NPC scripting
|
||||
TriggerNPCRecord( PACOS, 18 );
|
||||
TriggerNPCRecord( PACOS, 20 );
|
||||
|
||||
// this is our first battle... and we won!
|
||||
SetFactTrue( FACT_FIRST_BATTLE_FOUGHT );
|
||||
|
||||
@@ -909,7 +909,9 @@ DragSelection::Setup( UINT32 aVal )
|
||||
|
||||
if ( xmlentry >= 0 )
|
||||
{
|
||||
swprintf( pStr, L"%hs (%s)", gStructureMovePossible[xmlentry].szTileSetDisplayName, FaceDirs[gOneCDirection[ubDirection]] );
|
||||
WCHAR buf[256];
|
||||
MultiByteToWideChar(CP_UTF8, 0, gStructureMovePossible[xmlentry].szTileSetDisplayName, -1, buf, 256);
|
||||
swprintf(pStr, L"%s (%s)", buf, FaceDirs[gOneCDirection[ubDirection]]);
|
||||
|
||||
// we have to use an offset of NOBODY in order to differentiate between person and corpse
|
||||
pOption = new POPUP_OPTION( &std::wstring( pStr ), new popupCallbackFunction<void, UINT32>( &Wrapper_Function_DragSelection_GridNo, sTempGridNo ) );
|
||||
|
||||
@@ -2445,7 +2445,7 @@ BOOLEAN SOLDIERTYPE::CreateSoldierCommon( UINT8 ubBodyType, UINT16 usSoldierID,
|
||||
|
||||
if ( this->ubBodyType == QUEENMONSTER )
|
||||
{
|
||||
this->iPositionSndID = NewPositionSnd( NOWHERE, POSITION_SOUND_FROM_SOLDIER, (UINT32)this, QUEEN_AMBIENT_NOISE );
|
||||
this->iPositionSndID = NewPositionSnd( NOWHERE, POSITION_SOUND_FROM_SOLDIER, (UINT32)this, QUEEN_AMBIENT_NOISE, 15 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -9957,10 +9957,6 @@ BOOLEAN IsGunBurstCapable(OBJECTTYPE* pObject, BOOLEAN fNotify, SOLDIERTYPE* pSo
|
||||
fCapable = TRUE;
|
||||
}
|
||||
}
|
||||
else if (Weapon[pObject->usItem].fBurstOnlyByFanTheHammer)
|
||||
{
|
||||
fCapable = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -934,7 +934,7 @@ public:
|
||||
UINT8 ubLastDateSpokenTo;
|
||||
UINT8 bLastQuoteSaidWasSpecial;
|
||||
INT8 bSectorZ;
|
||||
UINT16 usStrategicInsertionData;
|
||||
UINT32 usStrategicInsertionData;
|
||||
INT8 bFriendlyOrDirectDefaultResponseUsedRecently;
|
||||
INT8 bRecruitDefaultResponseUsedRecently;
|
||||
INT8 bThreatenDefaultResponseUsedRecently;
|
||||
|
||||
@@ -5164,13 +5164,16 @@ INT16 ubMinAPCost;
|
||||
|
||||
// offer surrender?
|
||||
#ifndef JA2UB
|
||||
if ( pSoldier->bTeam == ENEMY_TEAM && pSoldier->bVisible == TRUE && !(gTacticalStatus.fEnemyFlags & ENEMY_OFFERED_SURRENDER) && pSoldier->stats.bLife >= pSoldier->stats.bLifeMax / 2 && !ARMED_VEHICLE( pSoldier ) && !ENEMYROBOT( pSoldier ) )
|
||||
if ( !is_networked ) // No surrender in multiplayer
|
||||
{
|
||||
if ( gTacticalStatus.Team[ MILITIA_TEAM ].bMenInSector == 0 && gTacticalStatus.Team[ CREATURE_TEAM ].bMenInSector == 0 && NumPCsInSector() < 4 && gTacticalStatus.Team[ ENEMY_TEAM ].bMenInSector >= NumPCsInSector() * 3 )
|
||||
if ( pSoldier->bTeam == ENEMY_TEAM && pSoldier->bVisible == TRUE && !(gTacticalStatus.fEnemyFlags & ENEMY_OFFERED_SURRENDER) && pSoldier->stats.bLife >= pSoldier->stats.bLifeMax / 2 && !ARMED_VEHICLE( pSoldier ) && !ENEMYROBOT( pSoldier ) )
|
||||
{
|
||||
if (gubQuest[QUEST_HELD_IN_ALMA] == QUESTNOTSTARTED || gubQuest[QUEST_HELD_IN_TIXA] == QUESTNOTSTARTED || gubQuest[QUEST_INTERROGATION] == QUESTNOTSTARTED)
|
||||
if ( gTacticalStatus.Team[ MILITIA_TEAM ].bMenInSector == 0 && gTacticalStatus.Team[ CREATURE_TEAM ].bMenInSector == 0 && NumPCsInSector() < 4 && gTacticalStatus.Team[ ENEMY_TEAM ].bMenInSector >= NumPCsInSector() * 3 )
|
||||
{
|
||||
return( AI_ACTION_OFFER_SURRENDER );
|
||||
if (gubQuest[QUEST_HELD_IN_ALMA] == QUESTNOTSTARTED || gubQuest[QUEST_HELD_IN_TIXA] == QUESTNOTSTARTED || gubQuest[QUEST_INTERROGATION] == QUESTNOTSTARTED)
|
||||
{
|
||||
return( AI_ACTION_OFFER_SURRENDER );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9584,13 +9587,16 @@ INT8 ArmedVehicleDecideActionBlack( SOLDIERTYPE *pSoldier )
|
||||
|
||||
// offer surrender?
|
||||
#ifndef JA2UB
|
||||
if ( pSoldier->bTeam == ENEMY_TEAM && pSoldier->bVisible == TRUE && !(gTacticalStatus.fEnemyFlags & ENEMY_OFFERED_SURRENDER) && pSoldier->stats.bLife >= pSoldier->stats.bLifeMax / 2 && !ARMED_VEHICLE( pSoldier ) && !ENEMYROBOT( pSoldier ) )
|
||||
if ( !is_networked ) // No surrender in multiplayer
|
||||
{
|
||||
if ( gTacticalStatus.Team[MILITIA_TEAM].bMenInSector == 0 && gTacticalStatus.Team[CREATURE_TEAM].bMenInSector == 0 && NumPCsInSector( ) < 4 && gTacticalStatus.Team[ENEMY_TEAM].bMenInSector >= NumPCsInSector( ) * 3 )
|
||||
if ( pSoldier->bTeam == ENEMY_TEAM && pSoldier->bVisible == TRUE && !(gTacticalStatus.fEnemyFlags & ENEMY_OFFERED_SURRENDER) && pSoldier->stats.bLife >= pSoldier->stats.bLifeMax / 2 && !ARMED_VEHICLE( pSoldier ) && !ENEMYROBOT( pSoldier ) )
|
||||
{
|
||||
if (gubQuest[QUEST_HELD_IN_ALMA] == QUESTNOTSTARTED || gubQuest[QUEST_HELD_IN_TIXA] == QUESTNOTSTARTED || gubQuest[QUEST_INTERROGATION] == QUESTNOTSTARTED)
|
||||
if ( gTacticalStatus.Team[MILITIA_TEAM].bMenInSector == 0 && gTacticalStatus.Team[CREATURE_TEAM].bMenInSector == 0 && NumPCsInSector() < 4 && gTacticalStatus.Team[ENEMY_TEAM].bMenInSector >= NumPCsInSector() * 3 )
|
||||
{
|
||||
return(AI_ACTION_OFFER_SURRENDER);
|
||||
if ( gubQuest[QUEST_HELD_IN_ALMA] == QUESTNOTSTARTED || gubQuest[QUEST_HELD_IN_TIXA] == QUESTNOTSTARTED || gubQuest[QUEST_INTERROGATION] == QUESTNOTSTARTED )
|
||||
{
|
||||
return(AI_ACTION_OFFER_SURRENDER);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
#pragma optimize("", off)
|
||||
#include "builddefines.h"
|
||||
|
||||
/****************************************************************************************
|
||||
|
||||
@@ -2929,7 +2929,7 @@ BOOLEAN LoadWorld(const STR8 puiFilename, FLOAT* pMajorMapVersion, UINT8* pMinor
|
||||
SetWorldSize(iRowSize, iColSize);
|
||||
|
||||
// We still have the "normal" map size AND the map is saved in vanilla format
|
||||
if ((iRowSize <= OLD_WORLD_ROWS && iRowSize <= OLD_WORLD_COLS) && (dMajorMapVersion == VANILLA_MAJOR_MAP_VERSION && ubMinorMapVersion == VANILLA_MINOR_MAP_VERSION))
|
||||
if ((iRowSize <= OLD_WORLD_ROWS && iColSize <= OLD_WORLD_COLS) && (dMajorMapVersion == VANILLA_MAJOR_MAP_VERSION && ubMinorMapVersion == VANILLA_MINOR_MAP_VERSION))
|
||||
{
|
||||
// Check "vanilla map saving"
|
||||
gfVanillaMode = TRUE;//dnl ch74 191013
|
||||
|
||||
+130
-121
@@ -768,12 +768,13 @@ void DelayedSoundTimerCallback( void )
|
||||
typedef struct
|
||||
{
|
||||
UINT32 uiFlags;
|
||||
INT32 sGridNo;
|
||||
INT32 iSoundSampleID;
|
||||
INT32 iSoundToPlay;
|
||||
INT32 sGridNo;
|
||||
INT32 iSoundSampleID;
|
||||
INT32 iSoundToPlay;
|
||||
UINT32 uiData;
|
||||
BOOLEAN fAllocated;
|
||||
BOOLEAN fInActive;
|
||||
UINT8 volume;
|
||||
|
||||
} POSITIONSND;
|
||||
|
||||
@@ -793,88 +794,89 @@ INT32 GetFreePositionSnd( void )
|
||||
{
|
||||
UINT32 uiCount;
|
||||
|
||||
for(uiCount=0; uiCount < guiNumPositionSnds; uiCount++)
|
||||
for ( uiCount = 0; uiCount < guiNumPositionSnds; uiCount++ )
|
||||
{
|
||||
if(( gPositionSndData[uiCount].fAllocated==FALSE ) )
|
||||
return( (INT32)uiCount );
|
||||
if ( (gPositionSndData[uiCount].fAllocated == FALSE) )
|
||||
return((INT32)uiCount);
|
||||
}
|
||||
|
||||
if( guiNumPositionSnds < NUM_POSITION_SOUND_EFFECT_SLOTS )
|
||||
return( (INT32) guiNumPositionSnds++ );
|
||||
if ( guiNumPositionSnds < NUM_POSITION_SOUND_EFFECT_SLOTS )
|
||||
return((INT32)guiNumPositionSnds++);
|
||||
|
||||
return( -1 );
|
||||
return(-1);
|
||||
}
|
||||
|
||||
void RecountPositionSnds( void )
|
||||
{
|
||||
INT32 uiCount;
|
||||
|
||||
for(uiCount=guiNumPositionSnds-1; (uiCount >=0) ; uiCount--)
|
||||
for ( uiCount = guiNumPositionSnds - 1; (uiCount >= 0); uiCount-- )
|
||||
{
|
||||
if( ( gPositionSndData[uiCount].fAllocated ) )
|
||||
if ( (gPositionSndData[uiCount].fAllocated) )
|
||||
{
|
||||
guiNumPositionSnds=(UINT32)(uiCount+1);
|
||||
guiNumPositionSnds = (UINT32)(uiCount + 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
INT32 NewPositionSnd( INT32 sGridNo, UINT32 uiFlags, UINT32 uiData, UINT32 iSoundToPlay )
|
||||
INT32 NewPositionSnd( INT32 sGridNo, UINT32 uiFlags, UINT32 uiData, UINT32 iSoundToPlay, UINT8 volume )
|
||||
{
|
||||
POSITIONSND *pPositionSnd;
|
||||
INT32 iPositionSndIndex;
|
||||
|
||||
if( ( iPositionSndIndex = GetFreePositionSnd() )==(-1) )
|
||||
if ( (iPositionSndIndex = GetFreePositionSnd()) == (-1) )
|
||||
return(-1);
|
||||
|
||||
memset( &gPositionSndData[ iPositionSndIndex ], 0, sizeof( POSITIONSND ) );
|
||||
memset( &gPositionSndData[iPositionSndIndex], 0, sizeof( POSITIONSND ) );
|
||||
|
||||
pPositionSnd = &gPositionSndData[ iPositionSndIndex ];
|
||||
pPositionSnd = &gPositionSndData[iPositionSndIndex];
|
||||
|
||||
|
||||
// Default to inactive
|
||||
|
||||
if ( gfPositionSoundsActive )
|
||||
{
|
||||
pPositionSnd->fInActive = FALSE;
|
||||
pPositionSnd->fInActive = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
pPositionSnd->fInActive = TRUE;
|
||||
pPositionSnd->fInActive = TRUE;
|
||||
}
|
||||
|
||||
pPositionSnd->sGridNo = sGridNo;
|
||||
pPositionSnd->uiData = uiData;
|
||||
pPositionSnd->uiFlags = uiFlags;
|
||||
pPositionSnd->fAllocated = TRUE;
|
||||
pPositionSnd->sGridNo = sGridNo;
|
||||
pPositionSnd->uiData = uiData;
|
||||
pPositionSnd->uiFlags = uiFlags;
|
||||
pPositionSnd->fAllocated = TRUE;
|
||||
pPositionSnd->iSoundToPlay = iSoundToPlay;
|
||||
pPositionSnd->volume = volume;
|
||||
|
||||
pPositionSnd->iSoundSampleID = NO_SAMPLE;
|
||||
|
||||
return( iPositionSndIndex );
|
||||
return(iPositionSndIndex);
|
||||
}
|
||||
|
||||
void DeletePositionSnd( INT32 iPositionSndIndex )
|
||||
{
|
||||
POSITIONSND *pPositionSnd;
|
||||
|
||||
pPositionSnd = &gPositionSndData[ iPositionSndIndex ];
|
||||
pPositionSnd = &gPositionSndData[iPositionSndIndex];
|
||||
|
||||
if ( pPositionSnd->fAllocated )
|
||||
{
|
||||
// Turn inactive first...
|
||||
pPositionSnd->fInActive = TRUE;
|
||||
// Turn inactive first...
|
||||
pPositionSnd->fInActive = TRUE;
|
||||
|
||||
// End sound...
|
||||
if ( pPositionSnd->iSoundSampleID != NO_SAMPLE )
|
||||
{
|
||||
SoundStop( pPositionSnd->iSoundSampleID );
|
||||
}
|
||||
// End sound...
|
||||
if ( pPositionSnd->iSoundSampleID != NO_SAMPLE )
|
||||
{
|
||||
SoundStop( pPositionSnd->iSoundSampleID );
|
||||
}
|
||||
|
||||
pPositionSnd->fAllocated = FALSE;
|
||||
pPositionSnd->fAllocated = FALSE;
|
||||
|
||||
RecountPositionSnds( );
|
||||
RecountPositionSnds();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -882,17 +884,17 @@ void SetPositionSndGridNo( INT32 iPositionSndIndex, INT32 sGridNo )
|
||||
{
|
||||
POSITIONSND *pPositionSnd;
|
||||
|
||||
pPositionSnd = &gPositionSndData[ iPositionSndIndex ];
|
||||
pPositionSnd = &gPositionSndData[iPositionSndIndex];
|
||||
|
||||
if ( pPositionSnd->fAllocated )
|
||||
{
|
||||
pPositionSnd->sGridNo = sGridNo;
|
||||
pPositionSnd->sGridNo = sGridNo;
|
||||
|
||||
SetPositionSndsVolumeAndPanning( );
|
||||
SetPositionSndsVolumeAndPanning();
|
||||
}
|
||||
}
|
||||
|
||||
void SetPositionSndsActive( )
|
||||
void SetPositionSndsActive()
|
||||
{
|
||||
UINT32 cnt;
|
||||
POSITIONSND *pPositionSnd;
|
||||
@@ -901,24 +903,31 @@ void SetPositionSndsActive( )
|
||||
|
||||
for ( cnt = 0; cnt < guiNumPositionSnds; cnt++ )
|
||||
{
|
||||
pPositionSnd = &gPositionSndData[ cnt ];
|
||||
pPositionSnd = &gPositionSndData[cnt];
|
||||
|
||||
if ( pPositionSnd->fAllocated )
|
||||
{
|
||||
if ( pPositionSnd->fInActive )
|
||||
if ( pPositionSnd->fAllocated )
|
||||
{
|
||||
pPositionSnd->fInActive = FALSE;
|
||||
if ( pPositionSnd->fInActive )
|
||||
{
|
||||
pPositionSnd->fInActive = FALSE;
|
||||
|
||||
// Begin sound effect
|
||||
// Volume 0
|
||||
pPositionSnd->iSoundSampleID = PlayJA2Sample( pPositionSnd->iSoundToPlay, RATE_11025, 0, 0, MIDDLEPAN );
|
||||
// Begin sound effect
|
||||
// Volume 0
|
||||
if ( pPositionSnd->iSoundToPlay == POWER_GEN_FAN_SOUND )
|
||||
{
|
||||
pPositionSnd->iSoundSampleID = PlayJA2SampleFromFile( "Sounds\\POWERGENFAN.WAV", RATE_11025, 0, 0, MIDDLEPAN );
|
||||
}
|
||||
else
|
||||
{
|
||||
pPositionSnd->iSoundSampleID = PlayJA2Sample( pPositionSnd->iSoundToPlay, RATE_11025, 0, 0, MIDDLEPAN );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SetPositionSndsInActive( )
|
||||
void SetPositionSndsInActive()
|
||||
{
|
||||
UINT32 cnt;
|
||||
POSITIONSND *pPositionSnd;
|
||||
@@ -927,20 +936,20 @@ void SetPositionSndsInActive( )
|
||||
|
||||
for ( cnt = 0; cnt < guiNumPositionSnds; cnt++ )
|
||||
{
|
||||
pPositionSnd = &gPositionSndData[ cnt ];
|
||||
pPositionSnd = &gPositionSndData[cnt];
|
||||
|
||||
if ( pPositionSnd->fAllocated )
|
||||
{
|
||||
pPositionSnd->fInActive = TRUE;
|
||||
|
||||
// End sound...
|
||||
if ( pPositionSnd->iSoundSampleID != NO_SAMPLE )
|
||||
if ( pPositionSnd->fAllocated )
|
||||
{
|
||||
SoundStop( pPositionSnd->iSoundSampleID );
|
||||
pPositionSnd->iSoundSampleID = NO_SAMPLE;
|
||||
pPositionSnd->fInActive = TRUE;
|
||||
|
||||
// End sound...
|
||||
if ( pPositionSnd->iSoundSampleID != NO_SAMPLE )
|
||||
{
|
||||
SoundStop( pPositionSnd->iSoundSampleID );
|
||||
pPositionSnd->iSoundSampleID = NO_SAMPLE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// == Lesh slightly changed this function ============
|
||||
@@ -950,51 +959,51 @@ UINT8 PositionSoundDir( INT32 sGridNo )
|
||||
INT16 sScreenX, sScreenY;
|
||||
INT16 sMiddleX;
|
||||
INT16 sDif, sAbsDif;
|
||||
|
||||
if (TileIsOutOfBounds(sGridNo))
|
||||
|
||||
if ( TileIsOutOfBounds( sGridNo ) )
|
||||
{
|
||||
return( MIDDLEPAN );
|
||||
return(MIDDLEPAN);
|
||||
}
|
||||
|
||||
// OK, get screen position of gridno.....
|
||||
ConvertGridNoToXY( sGridNo, &sWorldX, &sWorldY );
|
||||
|
||||
// Get screen coordinates for current position of soldier
|
||||
GetWorldXYAbsoluteScreenXY( (INT16)(sWorldX), (INT16)(sWorldY), &sScreenX, &sScreenY);
|
||||
GetWorldXYAbsoluteScreenXY( (INT16)(sWorldX), (INT16)(sWorldY), &sScreenX, &sScreenY );
|
||||
|
||||
// Get middle of where we are now....
|
||||
sMiddleX = gsTopLeftWorldX + ( gsBottomRightWorldX - gsTopLeftWorldX ) / 2;
|
||||
sMiddleX = gsTopLeftWorldX + (gsBottomRightWorldX - gsTopLeftWorldX) / 2;
|
||||
|
||||
sDif = sMiddleX - sScreenX;
|
||||
|
||||
if ( ( sAbsDif = abs( sDif ) ) > 64 )
|
||||
if ( (sAbsDif = abs( sDif )) > 64 )
|
||||
{
|
||||
// OK, NOT the middle.
|
||||
|
||||
// Is it outside the screen?
|
||||
if ( sAbsDif > ( ( gsBottomRightWorldX - gsTopLeftWorldX ) / 2 ) )
|
||||
{
|
||||
if ( sAbsDif > ((gsBottomRightWorldX - gsTopLeftWorldX) / 2) )
|
||||
{
|
||||
// yes, outside...
|
||||
if ( sDif > 0 )
|
||||
{
|
||||
return( FARLEFT );
|
||||
return(FARLEFT);
|
||||
//return( 1 );
|
||||
}
|
||||
else
|
||||
return( FARRIGHT );
|
||||
//return( 126 );
|
||||
else
|
||||
return(FARRIGHT);
|
||||
//return( 126 );
|
||||
|
||||
}
|
||||
}
|
||||
else // inside screen
|
||||
{
|
||||
if ( sDif > 0)
|
||||
return( LEFTSIDE );
|
||||
if ( sDif > 0 )
|
||||
return(LEFTSIDE);
|
||||
else
|
||||
return( RIGHTSIDE );
|
||||
return(RIGHTSIDE);
|
||||
}
|
||||
}
|
||||
else // hardly any difference, so sound should be played from middle
|
||||
return(MIDDLE);
|
||||
return(MIDDLE);
|
||||
}
|
||||
|
||||
|
||||
@@ -1007,21 +1016,21 @@ INT8 PositionSoundVolume( INT8 bInitialVolume, INT32 sGridNo )
|
||||
INT16 sDifY, sAbsDifY;
|
||||
INT16 sMaxDistX, sMaxDistY;
|
||||
double sMaxSoundDist, sSoundDist;
|
||||
|
||||
if (TileIsOutOfBounds(sGridNo))
|
||||
|
||||
if ( TileIsOutOfBounds( sGridNo ) )
|
||||
{
|
||||
return( bInitialVolume );
|
||||
return(bInitialVolume);
|
||||
}
|
||||
|
||||
// OK, get screen position of gridno.....
|
||||
ConvertGridNoToXY( sGridNo, &sWorldX, &sWorldY );
|
||||
|
||||
// Get screen coordinates for current position of soldier
|
||||
GetWorldXYAbsoluteScreenXY( (INT16)(sWorldX), (INT16)(sWorldY), &sScreenX, &sScreenY);
|
||||
GetWorldXYAbsoluteScreenXY( (INT16)(sWorldX), (INT16)(sWorldY), &sScreenX, &sScreenY );
|
||||
|
||||
// Get middle of where we are now....
|
||||
sMiddleX = gsTopLeftWorldX + ( gsBottomRightWorldX - gsTopLeftWorldX ) / 2;
|
||||
sMiddleY = gsTopLeftWorldY + ( gsBottomRightWorldY - gsTopLeftWorldY ) / 2;
|
||||
sMiddleX = gsTopLeftWorldX + (gsBottomRightWorldX - gsTopLeftWorldX) / 2;
|
||||
sMiddleY = gsTopLeftWorldY + (gsBottomRightWorldY - gsTopLeftWorldY) / 2;
|
||||
|
||||
sDifX = sMiddleX - sScreenX;
|
||||
sDifY = sMiddleY - sScreenY;
|
||||
@@ -1029,28 +1038,28 @@ INT8 PositionSoundVolume( INT8 bInitialVolume, INT32 sGridNo )
|
||||
sAbsDifX = abs( sDifX );
|
||||
sAbsDifY = abs( sDifY );
|
||||
|
||||
sMaxDistX = (INT16)( ( gsBottomRightWorldX - gsTopLeftWorldX ) * 1.5 );
|
||||
sMaxDistY = (INT16)( ( gsBottomRightWorldY - gsTopLeftWorldY ) * 1.5 );
|
||||
sMaxDistX = (INT16)((gsBottomRightWorldX - gsTopLeftWorldX) * 1.5);
|
||||
sMaxDistY = (INT16)((gsBottomRightWorldY - gsTopLeftWorldY) * 1.5);
|
||||
|
||||
sMaxSoundDist = sqrt( (double) ( sMaxDistX * sMaxDistX ) + ( sMaxDistY * sMaxDistY ) );
|
||||
sSoundDist = sqrt( (double)( sAbsDifX * sAbsDifX ) + ( sAbsDifY * sAbsDifY ) );
|
||||
sMaxSoundDist = sqrt( (double)(sMaxDistX * sMaxDistX) + (sMaxDistY * sMaxDistY) );
|
||||
sSoundDist = sqrt( (double)(sAbsDifX * sAbsDifX) + (sAbsDifY * sAbsDifY) );
|
||||
|
||||
if ( sSoundDist == 0 )
|
||||
{
|
||||
return( bInitialVolume );
|
||||
return(bInitialVolume);
|
||||
}
|
||||
|
||||
if ( sSoundDist > sMaxSoundDist )
|
||||
{
|
||||
sSoundDist = sMaxSoundDist;
|
||||
sSoundDist = sMaxSoundDist;
|
||||
}
|
||||
|
||||
// Scale
|
||||
return( (INT8)( bInitialVolume * ( ( sMaxSoundDist - sSoundDist ) / sMaxSoundDist ) ) );
|
||||
return((INT8)(bInitialVolume * ((sMaxSoundDist - sSoundDist) / sMaxSoundDist)));
|
||||
}
|
||||
|
||||
|
||||
void SetPositionSndsVolumeAndPanning( )
|
||||
void SetPositionSndsVolumeAndPanning()
|
||||
{
|
||||
UINT32 cnt;
|
||||
POSITIONSND *pPositionSnd;
|
||||
@@ -1060,49 +1069,49 @@ void SetPositionSndsVolumeAndPanning( )
|
||||
|
||||
for ( cnt = 0; cnt < guiNumPositionSnds; cnt++ )
|
||||
{
|
||||
pPositionSnd = &gPositionSndData[ cnt ];
|
||||
pPositionSnd = &gPositionSndData[cnt];
|
||||
|
||||
if ( pPositionSnd->fAllocated )
|
||||
{
|
||||
if ( !pPositionSnd->fInActive )
|
||||
if ( pPositionSnd->fAllocated )
|
||||
{
|
||||
if ( pPositionSnd->iSoundSampleID != NO_SAMPLE )
|
||||
{
|
||||
bVolume = PositionSoundVolume( 15, pPositionSnd->sGridNo );
|
||||
|
||||
if ( pPositionSnd->uiFlags & POSITION_SOUND_FROM_SOLDIER )
|
||||
if ( !pPositionSnd->fInActive )
|
||||
{
|
||||
pSoldier = (SOLDIERTYPE*)pPositionSnd->uiData;
|
||||
|
||||
if ( pSoldier->bVisible == -1 )
|
||||
if ( pPositionSnd->iSoundSampleID != NO_SAMPLE )
|
||||
{
|
||||
// Limit volume,,,
|
||||
if ( bVolume > 10 )
|
||||
bVolume = PositionSoundVolume( pPositionSnd->volume, pPositionSnd->sGridNo );
|
||||
|
||||
if ( pPositionSnd->uiFlags & POSITION_SOUND_FROM_SOLDIER )
|
||||
{
|
||||
bVolume = 10;
|
||||
pSoldier = (SOLDIERTYPE *)pPositionSnd->uiData;
|
||||
|
||||
if ( pSoldier->bVisible == -1 )
|
||||
{
|
||||
// Limit volume,,,
|
||||
if ( bVolume > 10 )
|
||||
{
|
||||
bVolume = 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//if the sound is from a stationary object
|
||||
if ( pPositionSnd->uiFlags & POSITION_SOUND_STATIONATY_OBJECT )
|
||||
{
|
||||
// make sure you can always hear it
|
||||
if ( bVolume < 5 )
|
||||
{
|
||||
bVolume = 5;
|
||||
}
|
||||
}
|
||||
|
||||
SoundSetVolume( pPositionSnd->iSoundSampleID, bVolume );
|
||||
|
||||
ubPan = PositionSoundDir( pPositionSnd->sGridNo );
|
||||
|
||||
SoundSetPan( pPositionSnd->iSoundSampleID, ubPan );
|
||||
}
|
||||
}
|
||||
|
||||
//if the sound is from a stationay object
|
||||
if( pPositionSnd->uiFlags & POSITION_SOUND_STATIONATY_OBJECT )
|
||||
{
|
||||
// make sure you can always hear it
|
||||
if ( bVolume < 5 )
|
||||
{
|
||||
bVolume = 5;
|
||||
}
|
||||
}
|
||||
|
||||
SoundSetVolume( pPositionSnd->iSoundSampleID, bVolume );
|
||||
|
||||
ubPan = PositionSoundDir( pPositionSnd->sGridNo );
|
||||
|
||||
SoundSetPan( pPositionSnd->iSoundSampleID, ubPan );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -379,7 +379,9 @@ enum SoundDefines
|
||||
S_VAL,
|
||||
//BREAK_LIGHT_IGNITING,
|
||||
|
||||
NUM_SAMPLES
|
||||
NUM_SAMPLES,
|
||||
POWER_GEN_FAN_SOUND = 5001 // This is a workaround to get the generator fan positional sound working in UB campaign.
|
||||
// Had to special case it because sound effects have been externalized.
|
||||
};
|
||||
|
||||
enum AmbientDefines
|
||||
@@ -453,7 +455,7 @@ void PlayDelayedJA2Sample( UINT32 uiDelay, UINT32 usNum, UINT32 usRate, UINT32 u
|
||||
#define POSITION_SOUND_FROM_SOLDIER 0x00000001
|
||||
#define POSITION_SOUND_STATIONATY_OBJECT 0x00000002
|
||||
|
||||
INT32 NewPositionSnd( INT32 sGridNo, UINT32 uiFlags, UINT32 uiData, UINT32 iSoundToPlay );
|
||||
INT32 NewPositionSnd( INT32 sGridNo, UINT32 uiFlags, UINT32 uiData, UINT32 iSoundToPlay, UINT8 volume );
|
||||
void DeletePositionSnd( INT32 iPositionSndIndex );
|
||||
void SetPositionSndsActive( );
|
||||
void SetPositionSndsInActive( );
|
||||
|
||||
@@ -5478,6 +5478,7 @@ STR16 MercInfo[] =
|
||||
L"未结账单", //L"Unsettled Bills",
|
||||
L"生平", //L"Bio",
|
||||
L"物品", //L"Inv",
|
||||
L"Special Offer!",
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -5481,6 +5481,7 @@ STR16 MercInfo[] =
|
||||
L"Unsettled Bills", // TODO.Translate
|
||||
L"Bio", // TODO.Translate
|
||||
L"Inv",
|
||||
L"Special Offer!",
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -5478,6 +5478,7 @@ STR16 MercInfo[] =
|
||||
L"Unsettled Bills",
|
||||
L"Bio",
|
||||
L"Inv",
|
||||
L"Special Offer!",
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -5485,6 +5485,7 @@ STR16 MercInfo[] =
|
||||
L"Payez sa solde",
|
||||
L"Biographie",
|
||||
L"Inventaire",
|
||||
L"Special Offer!",
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -5468,6 +5468,7 @@ STR16 MercInfo[] =
|
||||
L"Unsettled Bills", // TODO.Translate
|
||||
L"Bio", // TODO.Translate
|
||||
L"Inv",
|
||||
L"Special Offer!",
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -5481,6 +5481,7 @@ STR16 MercInfo[] =
|
||||
L"Unsettled Bills", // TODO.Translate
|
||||
L"Bio", // TODO.Translate
|
||||
L"Inv",
|
||||
L"Special Offer!",
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -5474,6 +5474,7 @@ STR16 MercInfo[] =
|
||||
L"Неоплаченные счета",
|
||||
L"Информация",
|
||||
L"Снаряжение",
|
||||
L"Special Offer!",
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -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[];
|
||||
|
||||
Reference in New Issue
Block a user