Added basic requirements to start snitching (alive, conscious, not in transit etc).

When clicking on move equipment menu, check basic requirements.
If soldiers land into enemy sector from helicopter, use gsGridNoSweetSpot instead of default arrival location when ESC is pressed.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8919 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Sevenfm
2021-01-14 15:17:56 +00:00
parent c32f5c76da
commit c6c0b09b70
2 changed files with 62 additions and 9 deletions
+57 -6
View File
@@ -483,7 +483,7 @@ void HandlePrisonerProcessingInSector( INT16 sMapX, INT16 sMapY, INT8 bZ );
// Flugente: prisons can riot if there aren't enough guards around
void HandlePrison( INT16 sMapX, INT16 sMapY, INT8 bZ );
// Flugente: assigned mercs can move equipemnt in city sectors
// Flugente: assigned mercs can move equipment in city sectors
void HandleEquipmentMove( INT16 sMapX, INT16 sMapY, INT8 bZ );
void HandleTrainWorkers( );
@@ -515,7 +515,7 @@ void HandleAdministrationAssignments();
// Flugente: handle exploration assignements
void HandleExplorationAssignments();
// is the character between secotrs in mvt
// is the character between sectors in mvt
BOOLEAN CharacterIsBetweenSectors( SOLDIERTYPE *pSoldier );
// update soldier life
@@ -2747,6 +2747,56 @@ BOOLEAN CanCharacterSnitch( SOLDIERTYPE *pSoldier )
{
AssertNotNIL(pSoldier);
// sevenfm: added basic requirements
if (!BasicCanCharacterAssignment(pSoldier, TRUE))
{
return(FALSE);
}
// only need to be alive and well to do so right now
// alive and conscious
if (pSoldier->stats.bLife < OKLIFE)
{
// dead or unconscious...
return (FALSE);
}
if (pSoldier->bSectorZ != 0)
{
return(FALSE);
}
// in transit?
if (IsCharacterInTransit(pSoldier) == TRUE)
{
return (FALSE);
}
// character on the move?
if (CharacterIsBetweenSectors(pSoldier))
{
return(FALSE);
}
// check in helicopter in hostile sector
if (pSoldier->bAssignment == VEHICLE)
{
if ((iHelicopterVehicleId != -1) && (pSoldier->iVehicleId == iHelicopterVehicleId))
{
// enemies in sector
if (NumNonPlayerTeamMembersInSector(pSoldier->sSectorX, pSoldier->sSectorY, ENEMY_TEAM) > 0)
{
return(FALSE);
}
}
}
if (pSoldier->ubWhatKindOfMercAmI == MERC_TYPE__EPC)
{
// epcs can't do this
return(FALSE);
}
// Flugente: we can't perform most assignments while concealed
if ( SPY_LOCATION( pSoldier->bAssignment ) )
return( FALSE );
@@ -8671,7 +8721,7 @@ void HandlePrison( INT16 sMapX, INT16 sMapY, INT8 bZ )
}
}
// Flugente: assigned mercs can move equipemnt in city sectors
// Flugente: assigned mercs can move equipment in city sectors
void HandleEquipmentMove( INT16 sMapX, INT16 sMapY, INT8 bZ )
{
// no underground
@@ -14103,7 +14153,8 @@ void AssignmentMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason )
break;
case( ASSIGN_MENU_MOVE_ITEMS ):
if( 1 )
if (CanCharacterPractise(pSoldier))
//if( 1 )
{
gAssignMenuState = ASMENU_NONE;
@@ -14121,14 +14172,14 @@ void AssignmentMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason )
DetermineBoxPositions();
}
}
else if( 0 )
/*else if( 0 )
{
fTeamPanelDirty = TRUE;
fMapScreenBottomDirty = TRUE;
swprintf( sString, zMarksMapScreenText[ 18 ], pSoldier->GetName() );
DoScreenIndependantMessageBox( sString , MSG_BOX_FLAG_OK, NULL );
}
}*/
break;
case ASSIGN_MENU_FORTIFY:
+5 -3
View File
@@ -566,9 +566,11 @@ void HandleHeliDrop( BOOLEAN fPlayer )
MercPtrs[ gusHeliSeats[ cnt ] ]->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO;
MercPtrs[ gusHeliSeats[ cnt ] ]->usStrategicInsertionData = gGameUBOptions.LOCATEGRIDNO;
#else
//MercPtrs[ gusHeliSeats[ cnt ] ]->ubStrategicInsertionCode = INSERTION_CODE_NORTH;
//MercPtrs[ gusHeliSeats[ cnt ] ]->ubStrategicInsertionCode = INSERTION_CODE_NORTH;
MercPtrs[ gusHeliSeats[ cnt ] ]->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO;
MercPtrs[ gusHeliSeats[ cnt ] ]->usStrategicInsertionData = gGameExternalOptions.iInitialMercArrivalLocation;
// sevenfm: if soldiers land into enemy sector, use gsGridNoSweetSpot
//MercPtrs[ gusHeliSeats[ cnt ] ]->usStrategicInsertionData = gGameExternalOptions.iInitialMercArrivalLocation;
MercPtrs[gusHeliSeats[cnt]]->usStrategicInsertionData = gsGridNoSweetSpot;
#endif
// HEADROCK HAM 3.5: Externalized!
UpdateMercInSector( MercPtrs[ gusHeliSeats[ cnt ] ], gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY, startingZ );
@@ -699,7 +701,7 @@ void HandleHeliDrop( BOOLEAN fPlayer )
if ( gbCurDrop < bEndVal )
{
// Flugente: it is now possible to use airdrops with soldiers after they have arrived in Arulco. In that case, they might have an animation that breaks EVENT_InitNewSoldierAnim prematurely.
// In the worst case, this can cause the game to be unable to finish the airdrop. For that reason, we set all those soldiers to the STANDING aniamtion.
// In the worst case, this can cause the game to be unable to finish the airdrop. For that reason, we set all those soldiers to the STANDING animation.
MercPtrs[ gusHeliSeats[ gbCurDrop ] ]->usAnimState = STANDING;
MercPtrs[ gusHeliSeats[ gbCurDrop ] ]->EVENT_InitNewSoldierAnim( HELIDROP, 0 , FALSE );