mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
- New Feature/exploit enhancement: enter hostile sector with helicopter and land mercs anywhere (see http://www.bears-pit.com/board/ubbthreads.php/topics/327879.html#Post327879)
- MP entry points are now much more and scale with mapsize git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6576 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -3197,9 +3197,8 @@ void GetMercClimbDirection( UINT8 ubSoldierID, BOOLEAN *pfGoDown, BOOLEAN *pfGoU
|
||||
*pfGoUp = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
// IF we are higher...
|
||||
if ( pSoldier->pathing.bLevel > 0 )
|
||||
else //if ( pSoldier->pathing.bLevel > 0 )
|
||||
{
|
||||
if ( FindLowerLevel( pSoldier, pSoldier->sGridNo, pSoldier->ubDirection, &bNewDirection ) )
|
||||
{
|
||||
|
||||
+30
-37
@@ -386,10 +386,6 @@ BOOLEAN gfFirstHeliRun;
|
||||
|
||||
void HandleFirstHeliDropOfGame( );
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void ResetHeliSeats( )
|
||||
{
|
||||
gbNumHeliSeatsOccupied = 0;
|
||||
@@ -415,13 +411,16 @@ void AddMercToHeli( UINT8 ubID )
|
||||
}
|
||||
}
|
||||
|
||||
// Flugente: we might want to set the helicopter dropoff point without starting it at the same time
|
||||
void SetHelicopterDroppoint( INT32 sGridNo )
|
||||
{
|
||||
gsGridNoSweetSpot = sGridNo;
|
||||
}
|
||||
|
||||
void StartHelicopterRun( INT32 sGridNoSweetSpot )
|
||||
void StartHelicopterRun()
|
||||
{
|
||||
INT16 sX, sY;
|
||||
|
||||
gsGridNoSweetSpot = sGridNoSweetSpot;
|
||||
|
||||
|
||||
if ( gbNumHeliSeatsOccupied == 0 )
|
||||
{
|
||||
return;
|
||||
@@ -431,7 +430,7 @@ void StartHelicopterRun( INT32 sGridNoSweetSpot )
|
||||
PauseGame();
|
||||
LockPauseState( 20 );
|
||||
|
||||
ConvertGridNoToCenterCellXY( sGridNoSweetSpot, &sX, &sY );
|
||||
ConvertGridNoToCenterCellXY( gsGridNoSweetSpot, &sX, &sY );
|
||||
|
||||
gsHeliXPos = sX - ( 2 * CELL_X_SIZE );
|
||||
gsHeliYPos = sY - ( 10 * CELL_Y_SIZE );
|
||||
@@ -444,15 +443,14 @@ void StartHelicopterRun( INT32 sGridNoSweetSpot )
|
||||
gbHeliRound = 1;
|
||||
|
||||
gubHeliState = HELI_APPROACH;
|
||||
guiHeliLastUpdate = GetJA2Clock( );
|
||||
guiHeliLastUpdate = GetJA2Clock( );
|
||||
|
||||
// Start sound
|
||||
uiSoundSample = PlayJA2Sample( HELI_1, RATE_11025, 0, 10000, MIDDLEPAN );
|
||||
fFadingHeliIn = TRUE;
|
||||
|
||||
gfHandleHeli = TRUE;
|
||||
|
||||
gfFirstGuyDown = TRUE;
|
||||
gfHandleHeli = TRUE;
|
||||
gfFirstGuyDown = TRUE;
|
||||
|
||||
guiPendingOverrideEvent = LU_BEGINUILOCK;
|
||||
}
|
||||
@@ -462,12 +460,10 @@ void HandleHeliDrop( )
|
||||
{
|
||||
UINT8 ubScriptCode;
|
||||
UINT32 uiClock;
|
||||
//INT16 sWorldX, sWorldY;
|
||||
INT32 iVol;
|
||||
INT32 cnt;
|
||||
ANITILE_PARAMS AniParams;
|
||||
|
||||
|
||||
|
||||
if ( gfHandleHeli )
|
||||
{
|
||||
if ( gCurrentUIMode != LOCKUI_MODE )
|
||||
@@ -503,7 +499,7 @@ void HandleHeliDrop( )
|
||||
// Remove heli
|
||||
DeleteAniTile( gpHeli );
|
||||
|
||||
RebuildCurrentSquad( );
|
||||
RebuildCurrentSquad( );
|
||||
|
||||
// Remove sound
|
||||
if( uiSoundSample!=NO_SAMPLE )
|
||||
@@ -559,7 +555,7 @@ void HandleHeliDrop( )
|
||||
// Remove heli
|
||||
DeleteAniTile( gpHeli );
|
||||
|
||||
RebuildCurrentSquad( );
|
||||
RebuildCurrentSquad( );
|
||||
|
||||
// Remove sound
|
||||
if( uiSoundSample!=NO_SAMPLE )
|
||||
@@ -603,7 +599,7 @@ void HandleHeliDrop( )
|
||||
iVol=__min( HIGHVOLUME, iVol+5);
|
||||
SoundSetVolume(uiSoundSample, iVol);
|
||||
if(iVol==HIGHVOLUME)
|
||||
fFadingHeliIn=FALSE;
|
||||
fFadingHeliIn=FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -631,7 +627,7 @@ void HandleHeliDrop( )
|
||||
UnLockPauseState();
|
||||
UnPauseGame();
|
||||
|
||||
RebuildCurrentSquad( );
|
||||
RebuildCurrentSquad( );
|
||||
|
||||
HandleFirstHeliDropOfGame( );
|
||||
}
|
||||
@@ -646,7 +642,7 @@ void HandleHeliDrop( )
|
||||
UnLockPauseState();
|
||||
UnPauseGame();
|
||||
|
||||
RebuildCurrentSquad( );
|
||||
RebuildCurrentSquad( );
|
||||
|
||||
HandleFirstHeliDropOfGame( );
|
||||
}
|
||||
@@ -681,15 +677,9 @@ void HandleHeliDrop( )
|
||||
MercPtrs[ gusHeliSeats[ gbCurDrop ] ]->EVENT_InitNewSoldierAnim( HELIDROP, 0 , FALSE );
|
||||
|
||||
// Change insertion code
|
||||
#ifdef JA2UB
|
||||
//MercPtrs[ gusHeliSeats[ gbCurDrop ] ]->ubStrategicInsertionCode = INSERTION_CODE_NORTH;
|
||||
MercPtrs[ gusHeliSeats[ gbCurDrop ] ]->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO;
|
||||
MercPtrs[ gusHeliSeats[ gbCurDrop ] ]->usStrategicInsertionData = gGameUBOptions.LOCATEGRIDNO;
|
||||
#else
|
||||
//MercPtrs[ gusHeliSeats[ gbCurDrop ] ]->ubStrategicInsertionCode = INSERTION_CODE_NORTH;
|
||||
MercPtrs[ gusHeliSeats[ gbCurDrop ] ]->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO;
|
||||
MercPtrs[ gusHeliSeats[ gbCurDrop ] ]->usStrategicInsertionData = gGameExternalOptions.iInitialMercArrivalLocation;
|
||||
#endif
|
||||
MercPtrs[ gusHeliSeats[ gbCurDrop ] ]->usStrategicInsertionData = gsGridNoSweetSpot;
|
||||
|
||||
// HEADROCK HAM 3.5: Externalized!
|
||||
UpdateMercInSector( MercPtrs[ gusHeliSeats[ gbCurDrop ] ], gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY, startingZ );
|
||||
//EVENT_SetSoldierPosition( MercPtrs[ gusHeliSeats[ gbCurDrop ] ], sWorldX, sWorldY );
|
||||
@@ -876,9 +866,8 @@ void BeginMercEntering( SOLDIERTYPE *pSoldier, INT32 sGridNo )
|
||||
ResetHeliSeats( );
|
||||
|
||||
AddMercToHeli( pSoldier->ubID );
|
||||
|
||||
|
||||
StartHelicopterRun( sGridNo );
|
||||
|
||||
StartHelicopterRun();
|
||||
|
||||
// Make sure AI does nothing.....
|
||||
PauseAIUntilManuallyUnpaused();
|
||||
@@ -887,13 +876,19 @@ void BeginMercEntering( SOLDIERTYPE *pSoldier, INT32 sGridNo )
|
||||
|
||||
void HandleFirstHeliDropOfGame( )
|
||||
{
|
||||
// Flugente: always call people to area
|
||||
CallAvailableEnemiesTo( gsGridNoSweetSpot );
|
||||
|
||||
// Are we in the first heli drop?
|
||||
if ( gfFirstHeliRun )
|
||||
{
|
||||
SyncStrategicTurnTimes();
|
||||
#ifdef JA2UB
|
||||
SetHelicopterDroppoint( gGameUBOptions.LOCATEGRIDNO );
|
||||
#else
|
||||
SetHelicopterDroppoint( gGameExternalOptions.iInitialMercArrivalLocation );
|
||||
#endif
|
||||
|
||||
// Call people to area
|
||||
CallAvailableEnemiesTo( gsGridNoSweetSpot );
|
||||
SyncStrategicTurnTimes();
|
||||
|
||||
// Move to header file...
|
||||
// HEADROCK HAM 3.5: Externalized!
|
||||
@@ -935,12 +930,10 @@ void HandleFirstHeliDropOfGame( )
|
||||
}
|
||||
|
||||
gfFirstHeliRun = FALSE;
|
||||
|
||||
}
|
||||
|
||||
// Send message to turn on ai again....
|
||||
CharacterDialogueWithSpecialEvent( 0, 0, 0, DIALOGUE_TACTICAL_UI , FALSE , FALSE , DIALOGUE_SPECIAL_EVENT_ENABLE_AI ,0, 0 );
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
+23
-11
@@ -22,6 +22,7 @@
|
||||
#include "meanwhile.h"
|
||||
#include "Exit Grids.h"
|
||||
#include "Interface.h" // added by Flugente for zBackground
|
||||
#include "renderworld.h" // added by Flugente
|
||||
#endif
|
||||
|
||||
#ifdef JA2UB
|
||||
@@ -1194,16 +1195,7 @@ BOOLEAN InternalAddSoldierToSector( UINT8 ubID, BOOLEAN fCalculateDirection, BOO
|
||||
sGridNo = pSoldier->sInsertionGridNo;
|
||||
}
|
||||
}
|
||||
|
||||
// Flugente backgrounds
|
||||
if ( pSoldier->ubStrategicInsertionCode == INSERTION_CODE_CENTER && pSoldier->GetBackgroundValue(BG_AIRDROP) )
|
||||
{
|
||||
fCalculateDirection = FALSE;
|
||||
pSoldier->ubInsertionDirection = Random( DIRECTION_IRRELEVANT );
|
||||
|
||||
pSoldier->bSoldierFlagMask |= SOLDIER_AIRDROP_BONUS;
|
||||
}
|
||||
|
||||
|
||||
// add this flag whenever we enter strategically enter a sector (= we attack a sector)
|
||||
pSoldier->bSoldierFlagMask |= SOLDIER_ASSAULT_BONUS;
|
||||
|
||||
@@ -1500,6 +1492,26 @@ void AddSoldierToSectorGridNo( SOLDIERTYPE *pSoldier, INT32 sGridNo, UINT8 ubDir
|
||||
fUpdateFinalPosition = FALSE;
|
||||
}
|
||||
|
||||
// Flugente: if we are airdropping, center screen on the action adn remove soldier initially. He will be dropped into the sector by the helicopter
|
||||
if ( pSoldier->bSoldierFlagMask & SOLDIER_AIRDROP )
|
||||
{
|
||||
pSoldier->bSoldierFlagMask &= ~SOLDIER_AIRDROP;
|
||||
|
||||
if ( gGameExternalOptions.ubSkyriderHotLZ == 3 )
|
||||
{
|
||||
gfIgnoreScrolling = FALSE;
|
||||
INT16 sNewCenterWorldX, sNewCenterWorldY;
|
||||
ConvertGridNoToCenterCellXY( sGridNo, &sNewCenterWorldX, &sNewCenterWorldY );
|
||||
|
||||
SetRenderCenter( sNewCenterWorldX, sNewCenterWorldY );
|
||||
gfIgnoreScrolling = TRUE;
|
||||
|
||||
pSoldier->RemoveSoldierFromGridNo( );
|
||||
pSoldier->bInSector = FALSE;
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// If this is a special insertion location, get path!
|
||||
if ( ubInsertionCode == INSERTION_CODE_ARRIVING_GAME )
|
||||
@@ -1524,7 +1536,7 @@ void AddSoldierToSectorGridNo( SOLDIERTYPE *pSoldier, INT32 sGridNo, UINT8 ubDir
|
||||
pSoldier->EVENT_SetSoldierDesiredDirection( ubDirection );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if( !(gTacticalStatus.uiFlags & LOADING_SAVED_GAME ) )
|
||||
{
|
||||
if ( !( pSoldier->flags.uiStatusFlags & SOLDIER_DEAD ) )
|
||||
|
||||
@@ -380,8 +380,8 @@ enum
|
||||
|
||||
#define SOLDIER_RADIO_OPERATOR_JAMMING 0x00100000 //1048576 // radio operator is jamming frequencies
|
||||
#define SOLDIER_RADIO_OPERATOR_SCANNING 0x00200000 //2097152 // radio operator is scanning for jammers
|
||||
/*#define PLAYER_NET_3_LVL_2 0x00400000 //4194304
|
||||
#define PLAYER_NET_4_LVL_2 0x00800000 //8388608
|
||||
#define SOLDIER_AIRDROP 0x00400000 //4194304 // soldier is entering the sector via airdrop from a helicopter
|
||||
/*#define PLAYER_NET_4_LVL_2 0x00800000 //8388608
|
||||
|
||||
#define PLAYER_NET_1_LVL_3 0x01000000 //16777216
|
||||
#define PLAYER_NET_2_LVL_3 0x02000000 //33554432
|
||||
|
||||
@@ -5,14 +5,14 @@
|
||||
void ResetHeliSeats( );
|
||||
void AddMercToHeli( UINT8 ubID );
|
||||
|
||||
void StartHelicopterRun( INT32 sGridNoSweetSpot );
|
||||
// Flugente: we might want to set the helicopter dropoff point without starting it at the same time
|
||||
void SetHelicopterDroppoint( INT32 sGridNo );
|
||||
|
||||
void StartHelicopterRun();
|
||||
|
||||
void HandleHeliDrop( );
|
||||
|
||||
|
||||
extern BOOLEAN gfIngagedInDrop;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user