New feature: Covert ops

- you can disguise members of your team as civilians or soldiers and, if careful, avoid detection by the enemy.
- For more info, see http://www.bears-pit.com/board/ubbthreads.php/topics/309312/New_feature_Covert_operations.html#Post309312
- GameDir revision >= 1529 is needed for this feature

- fixed a bug that could cause inventory items to be treated like armed bombs
- bloodcats can now be skinned

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@5529 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2012-08-24 23:52:55 +00:00
parent fa1586b22b
commit fd445fe5ed
62 changed files with 2151 additions and 263 deletions
+57
View File
@@ -101,6 +101,7 @@ static INT8 bTempFrequency;
void BombMessageBoxCallBack( UINT8 ubExitValue );
void TacticalFunctionSelectionMessageBoxCallBack( UINT8 ubExitValue ); // Flugente: callback after deciding what tactical function to use
void CorpseMessageBoxCallBack( UINT8 ubExitValue ); // Flugente: callback after deciding what to do with a corpse
void BoobyTrapMessageBoxCallBack( UINT8 ubExitValue );
void SwitchMessageBoxCallBack( UINT8 ubExitValue );
void BoobyTrapDialogueCallBack( void );
@@ -133,6 +134,8 @@ void StartBombMessageBox( SOLDIERTYPE * pSoldier, INT32 sGridNo );
void StartTacticalFunctionSelectionMessageBox( SOLDIERTYPE * pSoldier, INT32 sGridNo, INT8 bLevel ); // added by Flugente
void CleanWeapons();
void StartCorpseMessageBox( SOLDIERTYPE * pSoldier, INT32 sGridNo, INT8 bLevel ); // added by Flugente
BOOLEAN HandleCheckForBadChangeToGetThrough( SOLDIERTYPE *pSoldier, SOLDIERTYPE *pTargetSoldier, INT32 sTargetGridNo , INT8 bLevel )
{
BOOLEAN fBadChangeToGetThrough = FALSE;
@@ -1647,6 +1650,11 @@ void HandleTacticalFunctionSelection( SOLDIERTYPE *pSoldier, INT32 sGridNo )
}
void HandleSoldierUseCorpse( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel )
{
StartCorpseMessageBox( pSoldier, sGridNo, bLevel );
}
void SoldierHandleDropItem( SOLDIERTYPE *pSoldier )
{
// LOOK IN PANDING DATA FOR ITEM TO DROP, AND LOCATION
@@ -2441,6 +2449,12 @@ OBJECTTYPE* InternalAddItemToPool( INT32 *psGridNo, OBJECTTYPE *pObject, INT8 bV
bRenderZHeightAboveLevel = 0;
}
// Flugente: if this item is a corpse, don't add it to the world. Instead spawn a corpse in its position
if ( HasItemFlag(pObject->usItem, CORPSE) && AddCorpseFromObject(pObject, *psGridNo, ubLevel ) )
{
return( NULL );
}
//CHRISL: We need to make sure that item stacks follow the OldInv stacking limits
// Copy the object we're working with the gTempObject so that we can use pObject later in this function
OBJECTTYPE poolObject = OBJECTTYPE(*pObject);
@@ -4418,6 +4432,19 @@ INT32 AdjustGridNoForItemPlacement( SOLDIERTYPE *pSoldier, INT32 sGridNo )
return( sActionGridNo );
}
// Flugente
void StartCorpseMessageBox( SOLDIERTYPE * pSoldier, INT32 sGridNo, INT8 bLevel )
{
gpTempSoldier = pSoldier;
// determine what is possible with this corpse
BOOLEAN fDecapitate = TRUE;
BOOLEAN fTakeClothes = TRUE;
BOOLEAN fTakeCorpse = TRUE;
if ( fDecapitate && fTakeClothes )
DoMessageBox( MSG_BOX_BASIC_SMALL_BUTTONS, TacticalStr[ CORPSE_SELECTION_STR ], GAME_SCREEN, MSG_BOX_FLAG_FOUR_NUMBERED_BUTTONS, CorpseMessageBoxCallBack, NULL );
}
void StartBombMessageBox( SOLDIERTYPE * pSoldier, INT32 sGridNo )
{
@@ -4667,6 +4694,36 @@ void TacticalFunctionSelectionMessageBoxCallBack( UINT8 ubExitValue )
}
}
// Flugente: callback after deciding what to do with a corpse
void CorpseMessageBoxCallBack( UINT8 ubExitValue )
{
if (gpTempSoldier)
{
INT32 nextGridNoinSight = gpTempSoldier->sGridNo;
nextGridNoinSight = NewGridNo( nextGridNoinSight, DirectionInc( gpTempSoldier->ubDirection ) );
INT8 level = gpTempSoldier->bTargetLevel;
switch (ubExitValue)
{
case 1:
DecapitateCorpse( gpTempSoldier, nextGridNoinSight, level );
break;
case 2:
GutCorpse( gpTempSoldier, nextGridNoinSight, level );
break;
case 3:
StripCorpse( gpTempSoldier, nextGridNoinSight, level );
break;
case 4:
TakeCorpse( gpTempSoldier, nextGridNoinSight, level );
break;
default:
break;
}
}
}
BOOLEAN HandItemWorks( SOLDIERTYPE *pSoldier, INT8 bSlot )
{
BOOLEAN fItemJustBroke = FALSE, fItemWorks = TRUE;