mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
Merged New Inventory Project into main branch
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1871 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+40
-40
@@ -16,9 +16,9 @@
|
||||
#endif
|
||||
|
||||
UINT8 gubNumUIPlannedMoves = 0;
|
||||
SOLDIERTYPE *gpUIPlannedSoldier = NULL;
|
||||
SOLDIERTYPE *gpUIPlannedSoldier = NULL;
|
||||
SOLDIERTYPE *gpUIStartPlannedSoldier = NULL;
|
||||
BOOLEAN gfInUIPlanMode = FALSE;
|
||||
BOOLEAN gfInUIPlanMode = FALSE;
|
||||
|
||||
|
||||
void SelectPausedFireAnimation( SOLDIERTYPE *pSoldier );
|
||||
@@ -29,16 +29,16 @@ BOOLEAN BeginUIPlan( SOLDIERTYPE *pSoldier )
|
||||
gubNumUIPlannedMoves = 0;
|
||||
gpUIPlannedSoldier = pSoldier;
|
||||
gpUIStartPlannedSoldier = pSoldier;
|
||||
gfInUIPlanMode = TRUE;
|
||||
gfInUIPlanMode = TRUE;
|
||||
|
||||
gfPlotNewMovement = TRUE;
|
||||
gfPlotNewMovement = TRUE;
|
||||
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Entering Planning Mode" );
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
BOOLEAN AddUIPlan( UINT16 sGridNo, UINT8 ubPlanID )
|
||||
BOOLEAN AddUIPlan( INT16 sGridNo, UINT8 ubPlanID )
|
||||
{
|
||||
SOLDIERTYPE *pPlanSoldier;
|
||||
INT16 sXPos, sYPos;
|
||||
@@ -49,7 +49,7 @@ BOOLEAN AddUIPlan( UINT16 sGridNo, UINT8 ubPlanID )
|
||||
UINT8 ubNewIndex;
|
||||
|
||||
// Depeding on stance and direction facing, add guy!
|
||||
|
||||
|
||||
// If we have a planned action here, ignore!
|
||||
|
||||
|
||||
@@ -63,16 +63,16 @@ BOOLEAN AddUIPlan( UINT16 sGridNo, UINT8 ubPlanID )
|
||||
if ( ubPlanID == UIPLAN_ACTION_MOVETO )
|
||||
{
|
||||
// Calculate cost to move here
|
||||
sAPCost = PlotPath( gpUIPlannedSoldier, sGridNo, COPYROUTE, NO_PLOT, TEMPORARY, (UINT16) gpUIPlannedSoldier->usUIMovementMode, NOT_STEALTH, FORWARD, gpUIPlannedSoldier->bActionPoints );
|
||||
sAPCost = PlotPath( gpUIPlannedSoldier, sGridNo, COPYROUTE, NO_PLOT, TEMPORARY, (UINT16) gpUIPlannedSoldier->usUIMovementMode, NOT_STEALTH, FORWARD, gpUIPlannedSoldier->bActionPoints );
|
||||
// Adjust for running if we are not already running
|
||||
if ( gpUIPlannedSoldier->usUIMovementMode == RUNNING )
|
||||
if ( gpUIPlannedSoldier->usUIMovementMode == RUNNING )
|
||||
{
|
||||
sAPCost += AP_START_RUN_COST;
|
||||
}
|
||||
|
||||
if ( EnoughPoints( gpUIPlannedSoldier, sAPCost, 0, FALSE ) )
|
||||
{
|
||||
memset( &MercCreateStruct, 0, sizeof( MercCreateStruct ) );
|
||||
MercCreateStruct.initialize();
|
||||
MercCreateStruct.bTeam = SOLDIER_CREATE_AUTO_TEAM;
|
||||
MercCreateStruct.ubProfile = NO_PROFILE;
|
||||
MercCreateStruct.fPlayerPlan = TRUE;
|
||||
@@ -81,7 +81,7 @@ BOOLEAN AddUIPlan( UINT16 sGridNo, UINT8 ubPlanID )
|
||||
|
||||
// Get Grid Corrdinates of mouse
|
||||
if ( TacticalCreateSoldier( &MercCreateStruct, &ubNewIndex ) )
|
||||
{
|
||||
{
|
||||
// Get pointer to soldier
|
||||
GetSoldier( &pPlanSoldier, (UINT16)ubNewIndex );
|
||||
|
||||
@@ -92,17 +92,17 @@ BOOLEAN AddUIPlan( UINT16 sGridNo, UINT8 ubPlanID )
|
||||
// Set ones we don't know about but do now back to old ( ie no new guys )
|
||||
for (iLoop = 0; iLoop < MAX_NUM_SOLDIERS; iLoop++ )
|
||||
{
|
||||
if ( gpUIPlannedSoldier->bOppList[ iLoop ] < 0 )
|
||||
if ( gpUIPlannedSoldier->aiData.bOppList[ iLoop ] < 0 )
|
||||
{
|
||||
pPlanSoldier->bOppList[ iLoop ] = gpUIPlannedSoldier->bOppList[ iLoop ];
|
||||
pPlanSoldier->aiData.bOppList[ iLoop ] = gpUIPlannedSoldier->aiData.bOppList[ iLoop ];
|
||||
}
|
||||
}
|
||||
|
||||
// Get XY from Gridno
|
||||
ConvertGridNoToCenterCellXY( sGridNo, &sXPos, &sYPos );
|
||||
|
||||
EVENT_SetSoldierPosition( pPlanSoldier, sXPos, sYPos );
|
||||
EVENT_SetSoldierDestination( pPlanSoldier, (UINT8) sGridNo ); // Hopefully this code is never used anymore because the second param is now direction, not grid
|
||||
pPlanSoldier->EVENT_SetSoldierPosition( sXPos, sYPos );
|
||||
pPlanSoldier->EVENT_SetSoldierDestination( (UINT8) sGridNo ); // Hopefully this code is never used anymore because the second param is now direction, not grid
|
||||
pPlanSoldier->bVisible = 1;
|
||||
pPlanSoldier->usUIMovementMode = gpUIPlannedSoldier->usUIMovementMode;
|
||||
|
||||
@@ -112,15 +112,15 @@ BOOLEAN AddUIPlan( UINT16 sGridNo, UINT8 ubPlanID )
|
||||
pPlanSoldier->ubPlannedUIAPCost = (UINT8)pPlanSoldier->bActionPoints;
|
||||
|
||||
// Get direction
|
||||
bDirection = (INT8)gpUIPlannedSoldier->usPathingData[ gpUIPlannedSoldier->usPathDataSize - 1 ];
|
||||
bDirection = (INT8)gpUIPlannedSoldier->pathing.usPathingData[ gpUIPlannedSoldier->pathing.usPathDataSize - 1 ];
|
||||
|
||||
// Set direction
|
||||
pPlanSoldier->ubDirection = bDirection;
|
||||
pPlanSoldier->bDesiredDirection = bDirection;
|
||||
pPlanSoldier->pathing.bDesiredDirection = bDirection;
|
||||
|
||||
// Set walking animation
|
||||
ChangeSoldierState( pPlanSoldier, pPlanSoldier->usUIMovementMode, 0, FALSE );
|
||||
|
||||
pPlanSoldier->ChangeSoldierState( pPlanSoldier->usUIMovementMode, 0, FALSE );
|
||||
|
||||
// Change selected soldier
|
||||
gusSelectedSoldier = (UINT16)pPlanSoldier->ubID;
|
||||
|
||||
@@ -129,7 +129,7 @@ BOOLEAN AddUIPlan( UINT16 sGridNo, UINT8 ubPlanID )
|
||||
|
||||
gubNumUIPlannedMoves++;
|
||||
|
||||
gfPlotNewMovement = TRUE;
|
||||
gfPlotNewMovement = TRUE;
|
||||
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Adding Merc Move to Plan" );
|
||||
|
||||
@@ -142,7 +142,7 @@ BOOLEAN AddUIPlan( UINT16 sGridNo, UINT8 ubPlanID )
|
||||
}
|
||||
else if ( ubPlanID == UIPLAN_ACTION_FIRE )
|
||||
{
|
||||
sAPCost = CalcTotalAPsToAttack( gpUIPlannedSoldier, sGridNo, TRUE, (INT8)(gpUIPlannedSoldier->bShownAimTime ) );
|
||||
sAPCost = CalcTotalAPsToAttack( gpUIPlannedSoldier, sGridNo, TRUE, (INT8)(gpUIPlannedSoldier->aiData.bShownAimTime ) );
|
||||
|
||||
// Get XY from Gridno
|
||||
ConvertGridNoToCenterCellXY( sGridNo, &sXPos, &sYPos );
|
||||
@@ -154,7 +154,7 @@ BOOLEAN AddUIPlan( UINT16 sGridNo, UINT8 ubPlanID )
|
||||
// CHECK IF WE ARE A PLANNED SOLDIER OR NOT< IF SO< CREATE!
|
||||
if ( gpUIPlannedSoldier->ubID < MAX_NUM_SOLDIERS )
|
||||
{
|
||||
memset( &MercCreateStruct, 0, sizeof( MercCreateStruct ) );
|
||||
MercCreateStruct.initialize();
|
||||
MercCreateStruct.bTeam = SOLDIER_CREATE_AUTO_TEAM;
|
||||
MercCreateStruct.ubProfile = NO_PROFILE;
|
||||
MercCreateStruct.fPlayerPlan = TRUE;
|
||||
@@ -163,7 +163,7 @@ BOOLEAN AddUIPlan( UINT16 sGridNo, UINT8 ubPlanID )
|
||||
|
||||
// Get Grid Corrdinates of mouse
|
||||
if ( TacticalCreateSoldier( &MercCreateStruct, &ubNewIndex ) )
|
||||
{
|
||||
{
|
||||
// Get pointer to soldier
|
||||
GetSoldier( &pPlanSoldier, (UINT16)ubNewIndex );
|
||||
|
||||
@@ -174,14 +174,14 @@ BOOLEAN AddUIPlan( UINT16 sGridNo, UINT8 ubPlanID )
|
||||
// Set ones we don't know about but do now back to old ( ie no new guys )
|
||||
for (iLoop = 0; iLoop < MAX_NUM_SOLDIERS; iLoop++ )
|
||||
{
|
||||
if ( gpUIPlannedSoldier->bOppList[ iLoop ] < 0 )
|
||||
if ( gpUIPlannedSoldier->aiData.bOppList[ iLoop ] < 0 )
|
||||
{
|
||||
pPlanSoldier->bOppList[ iLoop ] = gpUIPlannedSoldier->bOppList[ iLoop ];
|
||||
pPlanSoldier->aiData.bOppList[ iLoop ] = gpUIPlannedSoldier->aiData.bOppList[ iLoop ];
|
||||
}
|
||||
}
|
||||
|
||||
EVENT_SetSoldierPosition( pPlanSoldier, gpUIPlannedSoldier->dXPos, gpUIPlannedSoldier->dYPos );
|
||||
EVENT_SetSoldierDestination( pPlanSoldier, (UINT8) gpUIPlannedSoldier->sGridNo );
|
||||
pPlanSoldier->EVENT_SetSoldierPosition( gpUIPlannedSoldier->dXPos, gpUIPlannedSoldier->dYPos );
|
||||
pPlanSoldier->EVENT_SetSoldierDestination( (UINT8) gpUIPlannedSoldier->sGridNo );
|
||||
pPlanSoldier->bVisible = 1;
|
||||
pPlanSoldier->usUIMovementMode = gpUIPlannedSoldier->usUIMovementMode;
|
||||
|
||||
@@ -191,15 +191,15 @@ BOOLEAN AddUIPlan( UINT16 sGridNo, UINT8 ubPlanID )
|
||||
pPlanSoldier->ubPlannedUIAPCost = (UINT8)pPlanSoldier->bActionPoints;
|
||||
|
||||
// Get direction
|
||||
bDirection = (INT8)gpUIPlannedSoldier->usPathingData[ gpUIPlannedSoldier->usPathDataSize - 1 ];
|
||||
bDirection = (INT8)gpUIPlannedSoldier->pathing.usPathingData[ gpUIPlannedSoldier->pathing.usPathDataSize - 1 ];
|
||||
|
||||
// Set direction
|
||||
pPlanSoldier->ubDirection = bDirection;
|
||||
pPlanSoldier->bDesiredDirection = bDirection;
|
||||
pPlanSoldier->pathing.bDesiredDirection = bDirection;
|
||||
|
||||
// Set walking animation
|
||||
ChangeSoldierState( pPlanSoldier, pPlanSoldier->usUIMovementMode, 0, FALSE );
|
||||
|
||||
pPlanSoldier->ChangeSoldierState( pPlanSoldier->usUIMovementMode, 0, FALSE );
|
||||
|
||||
// Change selected soldier
|
||||
gusSelectedSoldier = (UINT16)pPlanSoldier->ubID;
|
||||
|
||||
@@ -217,11 +217,11 @@ BOOLEAN AddUIPlan( UINT16 sGridNo, UINT8 ubPlanID )
|
||||
gpUIPlannedSoldier->ubPlannedUIAPCost = (UINT8)gpUIPlannedSoldier->bActionPoints;
|
||||
|
||||
// Get direction from gridno
|
||||
bDirection = (INT8)GetDirectionFromGridNo( sGridNo, gpUIPlannedSoldier );
|
||||
bDirection = GetDirectionFromGridNo( sGridNo, gpUIPlannedSoldier );
|
||||
|
||||
// Set direction
|
||||
gpUIPlannedSoldier->ubDirection = bDirection;
|
||||
gpUIPlannedSoldier->bDesiredDirection = bDirection;
|
||||
gpUIPlannedSoldier->pathing.bDesiredDirection = bDirection;
|
||||
|
||||
// Set to shooting animation
|
||||
SelectPausedFireAnimation( gpUIPlannedSoldier );
|
||||
@@ -241,7 +241,7 @@ BOOLEAN AddUIPlan( UINT16 sGridNo, UINT8 ubPlanID )
|
||||
}
|
||||
|
||||
|
||||
void EndUIPlan( )
|
||||
void EndUIPlan( )
|
||||
{
|
||||
int cnt;
|
||||
SOLDIERTYPE *pSoldier;
|
||||
@@ -262,10 +262,10 @@ void EndUIPlan( )
|
||||
|
||||
|
||||
}
|
||||
gfInUIPlanMode = FALSE;
|
||||
gusSelectedSoldier = gpUIStartPlannedSoldier->ubID;
|
||||
gfInUIPlanMode = FALSE;
|
||||
gusSelectedSoldier = gpUIStartPlannedSoldier->ubID;
|
||||
|
||||
gfPlotNewMovement = TRUE;
|
||||
gfPlotNewMovement = TRUE;
|
||||
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Leaving Planning Mode" );
|
||||
|
||||
@@ -287,20 +287,20 @@ void SelectPausedFireAnimation( SOLDIERTYPE *pSoldier )
|
||||
|
||||
if ( pSoldier->bDoBurst > 0 )
|
||||
{
|
||||
ChangeSoldierState( pSoldier, STANDING_BURST, 2 , FALSE );
|
||||
pSoldier->ChangeSoldierState( STANDING_BURST, 2 , FALSE );
|
||||
}
|
||||
else
|
||||
{
|
||||
ChangeSoldierState( pSoldier, SHOOT_RIFLE_STAND, 2 , FALSE );
|
||||
pSoldier->ChangeSoldierState( SHOOT_RIFLE_STAND, 2 , FALSE );
|
||||
}
|
||||
break;
|
||||
|
||||
case ANIM_PRONE:
|
||||
ChangeSoldierState( pSoldier, SHOOT_RIFLE_PRONE, 2 , FALSE );
|
||||
pSoldier->ChangeSoldierState( SHOOT_RIFLE_PRONE, 2 , FALSE );
|
||||
break;
|
||||
|
||||
case ANIM_CROUCH:
|
||||
ChangeSoldierState( pSoldier, SHOOT_RIFLE_CROUCH, 2 , FALSE );
|
||||
pSoldier->ChangeSoldierState( SHOOT_RIFLE_CROUCH, 2 , FALSE );
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user