- Feature improvement: enemy soldiers can now free captured comrades

- Fix: when jumping through windows, AI soldiers no longer need to end their turn to avoid a deadlock

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6248 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2013-07-26 21:50:08 +00:00
parent 4e3e07ed55
commit cfe8ea5ea5
16 changed files with 163 additions and 10 deletions
+35 -2
View File
@@ -9039,9 +9039,10 @@ void SOLDIERTYPE::BeginSoldierClimbWindow( void )
this->usPendingAnimation = JUMPWINDOWS;
}
// Flugente: should be fixed now, re-enable if not
// Flugente: if an AI guy, end turn (weird endless clock syndrome)
if ( this->bTeam != OUR_TEAM )
EndAIGuysTurn( this);
//if ( this->bTeam != OUR_TEAM )
//EndAIGuysTurn( this);
// Flugente: if we are jumping through an intact window, smash it during our animation
if ( gGameExternalOptions.fCanJumpThroughClosedWindows )
@@ -15550,6 +15551,38 @@ UINT32 SOLDIERTYPE::GetSurrenderStrength()
return value;
}
// used for an enemy liberating fellow prisoners
BOOLEAN SOLDIERTYPE::FreePrisoner()
{
// we can only free people we are facing
INT32 nextGridNoinSight = NewGridNo( this->sGridNo, DirectionInc( this->ubDirection ) );
UINT8 target = WhoIsThere2( nextGridNoinSight, this->pathing.bLevel );
// is there somebody?
if ( target != NOBODY )
{
SOLDIERTYPE* pSoldier = MercPtrs[target];
// if he is captured, free him!
// note that this would also work for prisoner civs that we spawn in our prisons. All needed would be commanding the AI to get there
if ( pSoldier->bSoldierFlagMask & (SOLDIER_POW|SOLDIER_POW_PRISON) )
{
pSoldier->bSoldierFlagMask &= ~(SOLDIER_POW|SOLDIER_POW_PRISON);
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szPrisonerTextStr[STR_PRISONER_X_FREES_Y], this->GetName(), pSoldier->GetName() );
// alert both soldiers
this->aiData.bAlertStatus = min(this->aiData.bAlertStatus, STATUS_RED);
pSoldier->aiData.bAlertStatus = min(pSoldier->aiData.bAlertStatus, STATUS_RED);
return TRUE;
}
}
return FALSE;
}
// Flugente: scuba gear
BOOLEAN SOLDIERTYPE::UsesScubaGear()
{