New feature: Getting and using intel allows for more spy-related roleplay.

For more info, see http://thepit.ja-galaxy-forum.com/index.php?t=msg&th=23643&goto=352475&#msg_352475

Requires GameDir >= r2401.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8522 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2018-02-18 23:17:34 +00:00
parent ee73811cfe
commit e55b480996
83 changed files with 3784 additions and 937 deletions
+42 -4
View File
@@ -74,7 +74,8 @@ UINT32 gASD_Flags = 0;
// enemy heli constants
#define ENEMYHELI_DESTROYED 0x00000001
#define ENEMYHELI_ORDER_GOTODESTINATION 0x00000002
#define ENEMYHELI_KNOWNTOPLAYER 0x00000008 // the player knows about this heli (it will this be displayed on the map)
#define ENEMYHELI_KNOWNBYINTEL 0x00000004 // the player knows about this heli from intel (it will be displayed on the map)
#define ENEMYHELI_KNOWNTOPLAYER 0x00000008 // the player knows about this heli (it will be displayed on the map)
#define ENEMYHELI_ORDER_DROPTROOPS 0x00000010
#define ENEMYHELI_ORDER_PICKUPTROOPS 0x00000020
@@ -585,7 +586,7 @@ void ENEMY_HELI::Destroy( )
flagmask |= ENEMYHELI_DESTROYED;
// if the player knows about this heli, play a sound and leave a message
if ( flagmask & ENEMYHELI_KNOWNTOPLAYER )
if ( flagmask & (ENEMYHELI_KNOWNBYINTEL|ENEMYHELI_KNOWNTOPLAYER) )
{
CHAR16 pStr2[128];
GetSectorIDString( SECTORX( sector_current ), SECTORY( sector_current ), 0, pStr2, FALSE );
@@ -740,7 +741,7 @@ std::set<UINT8> GetEnemyHeliSectors( BOOLEAN afKnownToPlayer )
continue;
// if the player doesn't know about this heli, don't add this
if ( afKnownToPlayer && !((*it).flagmask & ENEMYHELI_KNOWNTOPLAYER) )
if ( afKnownToPlayer && !((*it).flagmask & (ENEMYHELI_KNOWNBYINTEL|ENEMYHELI_KNOWNTOPLAYER)) )
continue;
set.insert( (*it).sector_current );
@@ -749,6 +750,39 @@ std::set<UINT8> GetEnemyHeliSectors( BOOLEAN afKnownToPlayer )
return set;
}
std::vector<INT16> GetEnemyHeliIDKnowledgeStatus()
{
INT16 id = -1;
std::vector<INT16> vec;
std::vector<ENEMY_HELI>::iterator itend = gEnemyHeliVector.end();
for ( std::vector<ENEMY_HELI>::iterator it = gEnemyHeliVector.begin(); it != itend; ++it )
{
++id;
if ( ( ( *it ).flagmask & ( ENEMYHELI_DESTROYED | ENEMYHELI_KNOWNBYINTEL | ENEMYHELI_KNOWNTOPLAYER ) ) )
vec.push_back( -1 );
else
vec.push_back( id );
}
return vec;
}
void BuyHeliInfoWithIntel( INT16 id )
{
if ( id >= 0 && id < gEnemyHeliVector.size() )
{
ENEMY_HELI& heli = gEnemyHeliVector[id];
// if the heli is already destroyed, nothing to do here
if ( heli.flagmask & ENEMYHELI_DESTROYED )
return;
heli.flagmask |= ENEMYHELI_KNOWNBYINTEL;
}
}
void UpdateEnemyHeliRepair( INT16 id )
{
if ( id >= 0 && id < gEnemyHeliVector.size( ) )
@@ -1094,7 +1128,7 @@ void EnemyHeliMANPADSCheck( INT16 id )
return;
// if the player doesn't know about this heli, he can't shoot it down
if ( !(heli.flagmask & ENEMYHELI_KNOWNTOPLAYER) )
if ( !(heli.flagmask & ( ENEMYHELI_KNOWNBYINTEL|ENEMYHELI_KNOWNTOPLAYER)) )
return;
INT8 heli_x = SECTORX( heli.sector_current );
@@ -1205,6 +1239,10 @@ void EnemyHeliCheckPlayerKnowledge( INT16 id )
if ( id >= 0 && id < gEnemyHeliVector.size( ) )
{
ENEMY_HELI& heli = gEnemyHeliVector[id];
// if we already know about this from intel, nothing to do here
if ( heli.flagmask & ENEMYHELI_KNOWNBYINTEL )
return;
INT8 current_x = SECTORX( heli.sector_current );
INT8 current_y = SECTORY( heli.sector_current );