mirror of
https://github.com/1dot13/source.git
synced 2026-08-12 14:10:23 +02:00
Merge branch 'master' into decideaction
This commit is contained in:
@@ -40,4 +40,4 @@ typedef enum
|
||||
#endif
|
||||
} ItemActionType;
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+69
-69
@@ -1,32 +1,30 @@
|
||||
#include "sgp.h"
|
||||
#include "air raid.h"
|
||||
#include "game event hook.h"
|
||||
#include "game clock.h"
|
||||
#include "Air Raid.h"
|
||||
#include "Game Event Hook.h"
|
||||
#include "Game Clock.h"
|
||||
#include "strategicmap.h"
|
||||
#include "PreBattle Interface.h"
|
||||
#include "screenids.h"
|
||||
#include "jascreens.h"
|
||||
#include "random.h"
|
||||
#include "overhead types.h"
|
||||
#include "Overhead Types.h"
|
||||
#include "Sound Control.h"
|
||||
#include "timer control.h"
|
||||
#include "dialogue control.h"
|
||||
#include "overhead.h"
|
||||
#include "Timer Control.h"
|
||||
#include "Dialogue Control.h"
|
||||
#include "Overhead.h"
|
||||
#include "message.h"
|
||||
#include "isometric utils.h"
|
||||
#include "soldier macros.h"
|
||||
#include "los.h"
|
||||
#include "Isometric Utils.h"
|
||||
#include "Soldier macros.h"
|
||||
#include "LOS.h"
|
||||
#include "math.h"
|
||||
#include "explosion control.h"
|
||||
#include "interface.h"
|
||||
#include "music control.h"
|
||||
#include "Campaign Types.h"
|
||||
#include "Explosion Control.h"
|
||||
#include "Interface.h"
|
||||
#include "Music Control.h"
|
||||
#include "GameSettings.h"
|
||||
#include "text.h"
|
||||
#include "Text.h"
|
||||
#include "Morale.h"
|
||||
#include "Map screen helicopter.h"
|
||||
#include "structure wrap.h"
|
||||
#include "meanwhile.h"
|
||||
#include "Structure Wrap.h"
|
||||
#include "Meanwhile.h"
|
||||
|
||||
#include "GameInitOptionsScreen.h"
|
||||
|
||||
@@ -79,7 +77,7 @@ typedef struct
|
||||
{
|
||||
BOOLEAN fInAirRaid;
|
||||
BOOLEAN fAirRaidScheduled;
|
||||
UINT8 ubAirRaidMode;
|
||||
UINT8 ubAirRaidMode;
|
||||
UINT32 uiSoundSample;
|
||||
UINT32 uiRaidLastUpdate;
|
||||
BOOLEAN fFadingRaidIn;
|
||||
@@ -87,32 +85,32 @@ typedef struct
|
||||
INT8 bNumDives;
|
||||
INT8 bMaxDives;
|
||||
BOOLEAN fFadingRaidOut;
|
||||
INT16 sDiveX;
|
||||
INT16 sDiveY;
|
||||
INT16 sDiveTargetLocation;
|
||||
UINT8 ubDiveDirection;
|
||||
INT16 sNumGridNosMoved;
|
||||
INT32 iNumTurnsSinceLastDive;
|
||||
INT32 iNumTurnsSinceDiveStarted;
|
||||
INT32 iNumGridNosMovedThisTurn;
|
||||
INT16 sDiveX;
|
||||
INT16 sDiveY;
|
||||
INT16 sDiveTargetLocation;
|
||||
UINT8 ubDiveDirection;
|
||||
INT16 sNumGridNosMoved;
|
||||
INT32 iNumTurnsSinceLastDive;
|
||||
INT32 iNumTurnsSinceDiveStarted;
|
||||
INT32 iNumGridNosMovedThisTurn;
|
||||
BOOLEAN fAirRaidHasHadTurn;
|
||||
UINT8 ubBeginTeamTurn;
|
||||
UINT8 ubBeginTeamTurn;
|
||||
BOOLEAN fHaveTBBatton;
|
||||
AIR_RAID_DEFINITION AirRaidDef;
|
||||
INT16 sRaidSoldierID;
|
||||
SoldierID sRaidSoldierID;
|
||||
|
||||
INT16 sNotLocatedYet;
|
||||
INT32 iNumFrames;
|
||||
INT16 sNotLocatedYet;
|
||||
INT32 iNumFrames;
|
||||
|
||||
INT8 bLevel;
|
||||
INT8 bTeam;
|
||||
INT8 bSide;
|
||||
UINT8 ubAttackerID;
|
||||
SoldierID ubAttackerID;
|
||||
UINT16 usAttackingWeapon;
|
||||
FLOAT dXPos;
|
||||
FLOAT dYPos;
|
||||
INT16 sX;
|
||||
INT16 sY;
|
||||
FLOAT dXPos;
|
||||
FLOAT dYPos;
|
||||
INT16 sX;
|
||||
INT16 sY;
|
||||
INT32 sGridNo;
|
||||
|
||||
|
||||
@@ -187,7 +185,6 @@ void ScheduleAirRaid( AIR_RAID_DEFINITION *pAirRaidDef )
|
||||
|
||||
BOOLEAN BeginAirRaid( )
|
||||
{
|
||||
INT32 cnt=0;
|
||||
BOOLEAN fOK = FALSE;
|
||||
SOLDIERTYPE *pSoldier;
|
||||
gfQuoteSaid = FALSE;
|
||||
@@ -215,9 +212,10 @@ BOOLEAN BeginAirRaid( )
|
||||
// Do we have any guys in here...
|
||||
|
||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("BeginAirRaid: check for mercs: first id = %d, last id = %d ",gTacticalStatus.Team[ gbPlayerNum ].bFirstID, gTacticalStatus.Team[ gbPlayerNum ].bLastID));
|
||||
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
for ( cnt = 0, pSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; cnt++, pSoldier++)
|
||||
SoldierID cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
for ( ; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++cnt )
|
||||
{
|
||||
pSoldier = cnt;
|
||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("BeginAirRaid: soldier id = %d, active = %d",pSoldier->ubID,pSoldier->bActive));
|
||||
if ( pSoldier->bActive )
|
||||
{
|
||||
@@ -303,29 +301,29 @@ BOOLEAN BeginAirRaid( )
|
||||
}
|
||||
|
||||
|
||||
INT32 PickLocationNearAnyMercInSector( )
|
||||
static INT32 PickLocationNearAnyMercInSector( )
|
||||
{
|
||||
UINT8 ubMercsInSector[ 20 ] = { 0 };
|
||||
UINT8 ubNumMercs = 0;
|
||||
UINT8 ubChosenMerc;
|
||||
UINT16 ubMercsInSector[ 20 ] = { 0 };
|
||||
UINT16 ubNumMercs = 0;
|
||||
UINT16 ubChosenMerc;
|
||||
SOLDIERTYPE *pTeamSoldier;
|
||||
INT32 cnt=0;
|
||||
|
||||
// Loop through all our guys and randomly say one from someone in our sector
|
||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,"PickLocationNearAnyMercInSector");
|
||||
|
||||
// set up soldier ptr as first element in mercptrs list
|
||||
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
SoldierID cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
|
||||
// run through list
|
||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("PickLocationNearAnyMercInSector: total guys = %d", gTacticalStatus.Team[ gbPlayerNum ].bLastID));
|
||||
for ( pTeamSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; cnt++,pTeamSoldier++ )
|
||||
for ( ; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++cnt )
|
||||
{
|
||||
pTeamSoldier = cnt;
|
||||
// Add guy if he's a candidate...
|
||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("PickLocationNearAnyMercInSector: looping %d",cnt));
|
||||
if ( OK_INSECTOR_MERC( pTeamSoldier ) )
|
||||
{
|
||||
ubMercsInSector[ ubNumMercs ] = (UINT8)cnt;
|
||||
ubMercsInSector[ ubNumMercs ] = (UINT16)cnt;
|
||||
ubNumMercs++;
|
||||
}
|
||||
}
|
||||
@@ -334,7 +332,7 @@ INT32 PickLocationNearAnyMercInSector( )
|
||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("PickLocationNearAnyMercInSector: number of guys %d",ubNumMercs));
|
||||
if ( ubNumMercs > 0 )
|
||||
{
|
||||
ubChosenMerc = (UINT8)Random( ubNumMercs );
|
||||
ubChosenMerc = (UINT16)Random( ubNumMercs );
|
||||
|
||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("PickLocationNearAnyMercInSector: chosen guy = %d",ubChosenMerc));
|
||||
return( MercPtrs[ ubMercsInSector[ ubChosenMerc ] ]->sGridNo );
|
||||
@@ -344,7 +342,7 @@ INT32 PickLocationNearAnyMercInSector( )
|
||||
return( NOWHERE );
|
||||
}
|
||||
|
||||
INT32 PickRandomLocationAtMinSpacesAway( INT32 sGridNo, INT16 sMinValue, INT16 sRandomVar )
|
||||
static INT32 PickRandomLocationAtMinSpacesAway( INT32 sGridNo, INT16 sMinValue, INT16 sRandomVar )
|
||||
{
|
||||
INT32 sNewGridNo = NOWHERE;
|
||||
INT16 sX, sY, sNewX, sNewY;
|
||||
@@ -382,7 +380,7 @@ INT32 PickRandomLocationAtMinSpacesAway( INT32 sGridNo, INT16 sMinValue, INT16 s
|
||||
return( sNewGridNo );
|
||||
}
|
||||
|
||||
void TryToStartRaid( )
|
||||
static void TryToStartRaid( )
|
||||
{
|
||||
// OK, check conditions,
|
||||
|
||||
@@ -414,7 +412,7 @@ void TryToStartRaid( )
|
||||
|
||||
}
|
||||
|
||||
void AirRaidStart( )
|
||||
static void AirRaidStart( )
|
||||
{
|
||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("AirRaidStart"));
|
||||
// Begin ambient sound....
|
||||
@@ -434,7 +432,7 @@ void AirRaidStart( )
|
||||
}
|
||||
}
|
||||
|
||||
void AirRaidLookForDive( )
|
||||
static void AirRaidLookForDive( )
|
||||
{
|
||||
BOOLEAN fDoDive = FALSE;
|
||||
BOOLEAN fDoQuote = FALSE;
|
||||
@@ -558,7 +556,7 @@ void AirRaidLookForDive( )
|
||||
}
|
||||
|
||||
|
||||
void AirRaidStartEnding( )
|
||||
static void AirRaidStartEnding( )
|
||||
{
|
||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("AirRaidStartEnding"));
|
||||
// Fade out sound.....
|
||||
@@ -566,7 +564,7 @@ void AirRaidStartEnding( )
|
||||
}
|
||||
|
||||
|
||||
void BeginBombing( )
|
||||
static void BeginBombing( )
|
||||
{
|
||||
INT32 sGridNo;
|
||||
UINT32 iSoundStartDelay;
|
||||
@@ -623,7 +621,7 @@ void BeginBombing( )
|
||||
|
||||
|
||||
|
||||
void BeginDive( )
|
||||
static void BeginDive( )
|
||||
{
|
||||
INT32 sGridNo;
|
||||
UINT32 iSoundStartDelay;
|
||||
@@ -681,7 +679,7 @@ void BeginDive( )
|
||||
}
|
||||
|
||||
|
||||
void MoveDiveAirplane( FLOAT dAngle )
|
||||
static void MoveDiveAirplane( FLOAT dAngle )
|
||||
{
|
||||
FLOAT dDeltaPos;
|
||||
|
||||
@@ -701,7 +699,7 @@ void MoveDiveAirplane( FLOAT dAngle )
|
||||
}
|
||||
|
||||
|
||||
void DoDive( )
|
||||
static void DoDive( )
|
||||
{
|
||||
INT16 sRange;
|
||||
INT32 sGridNo, sOldGridNo;
|
||||
@@ -877,7 +875,7 @@ void DoDive( )
|
||||
}
|
||||
|
||||
|
||||
void DoBombing( )
|
||||
static void DoBombing( )
|
||||
{
|
||||
INT16 sRange;
|
||||
INT32 sGridNo, sOldGridNo, sBombGridNo;
|
||||
@@ -1057,9 +1055,10 @@ void HandleAirRaid( )
|
||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("HandleAirRaid: check for mercs: first id = %d, last id = %d ",gTacticalStatus.Team[ gbPlayerNum ].bFirstID, gTacticalStatus.Team[ gbPlayerNum ].bLastID));
|
||||
SOLDIERTYPE * pSoldier;
|
||||
BOOLEAN fOK = FALSE;
|
||||
int cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
for ( cnt = 0, pSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; cnt++, pSoldier++)
|
||||
SoldierID cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
for ( ; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++cnt )
|
||||
{
|
||||
pSoldier = cnt;
|
||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("HandleAirRaid: soldier id = %d, active = %d",pSoldier->ubID,pSoldier->bActive));
|
||||
if ( pSoldier->bActive )
|
||||
{
|
||||
@@ -1349,7 +1348,7 @@ BOOLEAN SaveAirRaidInfoToSaveGameFile( HWFILE hFile )
|
||||
//// sAirRaidSaveStruct.sRaidSoldierID = gpRaidSoldier->ubID;
|
||||
// }
|
||||
// else
|
||||
sAirRaidSaveStruct.sRaidSoldierID = -1;
|
||||
sAirRaidSaveStruct.sRaidSoldierID = NOBODY;
|
||||
|
||||
|
||||
memcpy( &sAirRaidSaveStruct.AirRaidDef, &gAirRaidDef, sizeof( AIR_RAID_DEFINITION ) );
|
||||
@@ -1407,9 +1406,9 @@ BOOLEAN LoadAirRaidInfoFromSaveGameFile( HWFILE hFile )
|
||||
giNumFrames = sAirRaidSaveStruct.iNumFrames;
|
||||
|
||||
|
||||
if( sAirRaidSaveStruct.sRaidSoldierID != -1 )
|
||||
if( sAirRaidSaveStruct.sRaidSoldierID != NOBODY )
|
||||
{
|
||||
gpRaidSoldier = &Menptr[ sAirRaidSaveStruct.sRaidSoldierID ];
|
||||
gpRaidSoldier = sAirRaidSaveStruct.sRaidSoldierID;
|
||||
|
||||
gpRaidSoldier->pathing.bLevel = sAirRaidSaveStruct.bLevel;
|
||||
gpRaidSoldier->bTeam = sAirRaidSaveStruct.bTeam;
|
||||
@@ -1447,12 +1446,12 @@ void EndAirRaid( )
|
||||
if ( !gTacticalStatus.Team[ ENEMY_TEAM ].bTeamActive && !gTacticalStatus.Team[ CREATURE_TEAM ].bTeamActive )
|
||||
{
|
||||
SOLDIERTYPE * pTeamSoldier;
|
||||
INT32 cnt;
|
||||
|
||||
// Loop through all militia and restore them to peaceful status
|
||||
cnt = gTacticalStatus.Team[ MILITIA_TEAM ].bFirstID;
|
||||
for ( pTeamSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ MILITIA_TEAM ].bLastID; cnt++,pTeamSoldier++)
|
||||
SoldierID cnt = gTacticalStatus.Team[ MILITIA_TEAM ].bFirstID;
|
||||
for ( ; cnt <= gTacticalStatus.Team[ MILITIA_TEAM ].bLastID; ++cnt )
|
||||
{
|
||||
pTeamSoldier = cnt;
|
||||
if ( pTeamSoldier->bActive && pTeamSoldier->bInSector )
|
||||
{
|
||||
pTeamSoldier->aiData.bAlertStatus = STATUS_GREEN;
|
||||
@@ -1462,8 +1461,9 @@ void EndAirRaid( )
|
||||
|
||||
cnt = gTacticalStatus.Team[ CIV_TEAM ].bFirstID;
|
||||
// Loop through all civs and restore them to peaceful status
|
||||
for ( pTeamSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ CIV_TEAM ].bLastID; cnt++,pTeamSoldier++)
|
||||
for ( ; cnt <= gTacticalStatus.Team[ CIV_TEAM ].bLastID; ++cnt )
|
||||
{
|
||||
pTeamSoldier = cnt;
|
||||
if ( pTeamSoldier->bActive && pTeamSoldier->bInSector )
|
||||
{
|
||||
pTeamSoldier->aiData.bAlertStatus = STATUS_GREEN;
|
||||
@@ -1496,7 +1496,7 @@ void EndAirRaid( )
|
||||
}
|
||||
|
||||
// Madd
|
||||
void CheckForAndSetupAirRaid ()
|
||||
static void CheckForAndSetupAirRaid ()
|
||||
{
|
||||
//INT16 sSectorX;
|
||||
//INT16 sSectorY;
|
||||
@@ -1575,7 +1575,7 @@ void CheckForAndSetupAirRaid ()
|
||||
//}
|
||||
}
|
||||
|
||||
void EnemyCallInAirStrike (INT16 sSectorX, INT16 sSectorY)
|
||||
static void EnemyCallInAirStrike (INT16 sSectorX, INT16 sSectorY)
|
||||
{
|
||||
//AIR_RAID_DEFINITION AirRaidDef;
|
||||
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
#ifndef AIR_RAID_H
|
||||
#define AIR_RAID_H
|
||||
|
||||
#include "soldier control.h"
|
||||
#include "Soldier Control.h"
|
||||
|
||||
#define AIR_RAID_BEGINNING_GAME 0x00000001
|
||||
#define AIR_RAID_CAN_RANDOMIZE_TEASE_DIVES 0x00000002
|
||||
@@ -62,4 +62,4 @@ BOOLEAN LoadAirRaidInfoFromSaveGameFile( HWFILE hFile );
|
||||
void EndAirRaid( );
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "types.h"
|
||||
#include "wcheck.h"
|
||||
#include "stdlib.h"
|
||||
#include "debug.h"
|
||||
#include "WCheck.h"
|
||||
#include "DEBUG.H"
|
||||
#include "Animation Cache.h"
|
||||
#include "Animation Data.h"
|
||||
#include "Animation Control.h"
|
||||
@@ -20,16 +16,16 @@ void DetermineOptimumAnimationCacheSize( )
|
||||
guiCacheSize = MIN_CACHE_SIZE;
|
||||
}
|
||||
|
||||
BOOLEAN InitAnimationCache( UINT16 usSoldierID, AnimationSurfaceCacheType *pAnimCache )
|
||||
BOOLEAN InitAnimationCache( SoldierID usSoldierID, AnimationSurfaceCacheType *pAnimCache )
|
||||
{
|
||||
UINT32 cnt;
|
||||
|
||||
// Allocate entries
|
||||
AnimDebugMsg( String( "*** Initializing anim cache surface for soldier %d", usSoldierID ) );
|
||||
AnimDebugMsg( String( "*** Initializing anim cache surface for soldier %d", usSoldierID.i ) );
|
||||
pAnimCache->usCachedSurfaces = (UINT16 *) MemAlloc( sizeof( UINT16 ) * guiCacheSize );
|
||||
CHECKF( pAnimCache->usCachedSurfaces!= NULL );
|
||||
|
||||
AnimDebugMsg( String( "*** Initializing anim cache hit counter for soldier %d", usSoldierID ) );
|
||||
AnimDebugMsg( String( "*** Initializing anim cache hit counter for soldier %d", usSoldierID.i ) );
|
||||
pAnimCache->sCacheHits = (INT16 *) MemAlloc( sizeof( UINT16) * guiCacheSize );
|
||||
CHECKF( pAnimCache->sCacheHits!= NULL );
|
||||
|
||||
@@ -41,13 +37,13 @@ BOOLEAN InitAnimationCache( UINT16 usSoldierID, AnimationSurfaceCacheType *pAnim
|
||||
}
|
||||
pAnimCache->ubCacheSize = 0;
|
||||
|
||||
// Zero surface databse history for this soldeir
|
||||
// Zero surface database history for this soldier
|
||||
ClearAnimationSurfacesUsageHistory( usSoldierID );
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
void DeleteAnimationCache( UINT16 usSoldierID, AnimationSurfaceCacheType *pAnimCache )
|
||||
void DeleteAnimationCache( SoldierID usSoldierID, AnimationSurfaceCacheType *pAnimCache )
|
||||
{
|
||||
// Allocate entries
|
||||
if ( pAnimCache->usCachedSurfaces!= NULL )
|
||||
@@ -64,7 +60,7 @@ void DeleteAnimationCache( UINT16 usSoldierID, AnimationSurfaceCacheType *pAnimC
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN GetCachedAnimationSurface( UINT16 usSoldierID, AnimationSurfaceCacheType *pAnimCache, UINT16 usSurfaceIndex, UINT16 usCurrentAnimation )
|
||||
BOOLEAN GetCachedAnimationSurface( SoldierID usSoldierID, AnimationSurfaceCacheType *pAnimCache, UINT16 usSurfaceIndex, UINT16 usCurrentAnimation )
|
||||
{
|
||||
UINT8 cnt;
|
||||
UINT8 ubLowestIndex = 0;
|
||||
@@ -89,7 +85,7 @@ BOOLEAN GetCachedAnimationSurface( UINT16 usSoldierID, AnimationSurfaceCacheType
|
||||
AnimDebugMsg( String( "Anim Cache: Determining Bump Candidate ( Soldier %d )", usSoldierID ) );
|
||||
|
||||
// Determine exisiting surface used by merc
|
||||
usCurrentAnimSurface = DetermineSoldierAnimationSurface( MercPtrs[ usSoldierID ], usCurrentAnimation );
|
||||
usCurrentAnimSurface = DetermineSoldierAnimationSurface( usSoldierID, usCurrentAnimation );
|
||||
// If the surface we are going to bump is our existing animation, reject it as a candidate
|
||||
|
||||
// If we get here, we need to remove an animation, pick the best one
|
||||
@@ -142,11 +138,11 @@ BOOLEAN GetCachedAnimationSurface( UINT16 usSoldierID, AnimationSurfaceCacheType
|
||||
}
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void UnLoadCachedAnimationSurfaces( UINT16 usSoldierID, AnimationSurfaceCacheType *pAnimCache )
|
||||
void UnLoadCachedAnimationSurfaces( SoldierID usSoldierID, AnimationSurfaceCacheType *pAnimCache )
|
||||
{
|
||||
UINT8 cnt;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef __ANIMATION_CACHE_H
|
||||
#define __ANIMATION_CACHE_H
|
||||
|
||||
#include "types.h"
|
||||
#include "Overhead Types.h"
|
||||
|
||||
#define MAX_CACHE_SIZE 20
|
||||
//#define MIN_CACHE_SIZE 2
|
||||
@@ -18,12 +18,12 @@ typedef struct
|
||||
|
||||
extern UINT32 guiCacheSize;
|
||||
|
||||
BOOLEAN GetCachedAnimationSurface( UINT16 usSoldierID, AnimationSurfaceCacheType *pAnimCache, UINT16 usSurfaceIndex, UINT16 usCurrentAnimation );
|
||||
BOOLEAN InitAnimationCache( UINT16 usSoldierID, AnimationSurfaceCacheType *pAnimCache );
|
||||
void DeleteAnimationCache( UINT16 usSoldierID, AnimationSurfaceCacheType *pAnimCache );
|
||||
BOOLEAN GetCachedAnimationSurface( SoldierID usSoldierID, AnimationSurfaceCacheType *pAnimCache, UINT16 usSurfaceIndex, UINT16 usCurrentAnimation );
|
||||
BOOLEAN InitAnimationCache( SoldierID usSoldierID, AnimationSurfaceCacheType *pAnimCache );
|
||||
void DeleteAnimationCache( SoldierID usSoldierID, AnimationSurfaceCacheType *pAnimCache );
|
||||
void DetermineOptimumAnimationCacheSize( );
|
||||
void UnLoadCachedAnimationSurfaces( UINT16 usSoldierID, AnimationSurfaceCacheType *pAnimCache );
|
||||
void UnLoadCachedAnimationSurfaces( SoldierID usSoldierID, AnimationSurfaceCacheType *pAnimCache );
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,19 +1,14 @@
|
||||
#include "builddefines.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "stdlib.h"
|
||||
#include "debug.h"
|
||||
#include "DEBUG.H"
|
||||
#include "Animation Control.h"
|
||||
#include "Animation Data.h"
|
||||
#include "FileMan.h"
|
||||
#include "weapons.h"
|
||||
#include "message.h"
|
||||
#include "structure.h"
|
||||
#include "worlddef.h"
|
||||
#include "worldman.h"
|
||||
#include "rotting corpses.h"
|
||||
#include "Rotting Corpses.h"
|
||||
#include "Debug Control.h"
|
||||
#include "Random.h"
|
||||
#include "Soldier Control.h"
|
||||
|
||||
#include "connect.h"
|
||||
@@ -3730,7 +3725,7 @@ BOOLEAN LoadAnimationStateInstructions( )
|
||||
}
|
||||
|
||||
//ddd Trick for loading more than 320 animation files (?)
|
||||
UINT16 fuckTheBoundz[320][100];
|
||||
UINT16 fuckTheBoundz[320][100] {};
|
||||
|
||||
//Read in block
|
||||
//if ( !FileRead( hFile, gusAnimInst, sizeof( gusAnimInst ), &uiBytesRead ) ) //commentet by ddd
|
||||
@@ -4297,10 +4292,10 @@ UINT16 DetermineSoldierAnimationSurface( SOLDIERTYPE *pSoldier, UINT16 usAnimSta
|
||||
// ADJUST BASED ON ITEM IN HAND....
|
||||
usItem = pSoldier->inv[ HANDPOS ].usItem;
|
||||
|
||||
if ( ( Item[ usItem ].usItemClass == IC_GUN || Item[ usItem ].usItemClass == IC_LAUNCHER ) && !Item[usItem].rocketlauncher)
|
||||
if ( ( Item[ usItem ].usItemClass == IC_GUN || Item[ usItem ].usItemClass == IC_LAUNCHER ) && !ItemIsRocketLauncher(usItem) )
|
||||
{
|
||||
// if ( (Item[ usItem ].fFlags & ITEM_TWO_HANDED) )
|
||||
if ( (Item[ usItem ].twohanded ) )
|
||||
if (ItemIsTwoHanded(usItem))
|
||||
{
|
||||
ubWaterHandIndex = 0;
|
||||
}
|
||||
@@ -4321,7 +4316,7 @@ UINT16 DetermineSoldierAnimationSurface( SOLDIERTYPE *pSoldier, UINT16 usAnimSta
|
||||
// ADJUST BASED ON ITEM IN HAND....
|
||||
usItem = pSoldier->inv[ HANDPOS ].usItem;
|
||||
|
||||
if ( !(Item[ usItem ].usItemClass == IC_GUN ) && !(Item[ usItem ].usItemClass == IC_LAUNCHER ) || Item[usItem].rocketlauncher )
|
||||
if ( !(Item[ usItem ].usItemClass == IC_GUN ) && !(Item[ usItem ].usItemClass == IC_LAUNCHER ) || ItemIsRocketLauncher(usItem) )
|
||||
{
|
||||
if ( usAnimState == STANDING )
|
||||
{
|
||||
@@ -4342,10 +4337,10 @@ UINT16 DetermineSoldierAnimationSurface( SOLDIERTYPE *pSoldier, UINT16 usAnimSta
|
||||
else
|
||||
{
|
||||
// CHECK FOR HANDGUN
|
||||
if ( ( Item[ usItem ].usItemClass == IC_GUN || Item[ usItem ].usItemClass == IC_LAUNCHER ) && !Item[usItem].rocketlauncher )
|
||||
if ( ( Item[ usItem ].usItemClass == IC_GUN || Item[ usItem ].usItemClass == IC_LAUNCHER ) && !ItemIsRocketLauncher(usItem) )
|
||||
{
|
||||
// if ( !(Item[ usItem ].fFlags & ITEM_TWO_HANDED) )
|
||||
if ( !(Item[ usItem ].twohanded ) )
|
||||
if ( !ItemIsTwoHanded(usItem) )
|
||||
{
|
||||
// SANDRO - new anim for running with pistol by PasHancock
|
||||
if ( usAnimState == RUNNING )
|
||||
|
||||
+15
-18
@@ -1,19 +1,16 @@
|
||||
#include "builddefines.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "wcheck.h"
|
||||
#include "stdlib.h"
|
||||
#include "debug.h"
|
||||
#include "WCheck.h"
|
||||
#include "DEBUG.H"
|
||||
#include "Animation Data.h"
|
||||
#include "Animation Control.h"
|
||||
|
||||
#include "jascreens.h"
|
||||
#include "tiledef.h"
|
||||
#include "Sys Globals.h"
|
||||
#include "Debug Control.h"
|
||||
#include "utilities.h"
|
||||
#include "Utilities.h"
|
||||
#include "worlddef.h"
|
||||
#include "Fileman.h"
|
||||
#include "FileMan.h"
|
||||
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
@@ -913,7 +910,7 @@ BOOLEAN DeInitAnimationSystem( )
|
||||
|
||||
|
||||
|
||||
STRUCTURE_FILE_REF *InternalGetAnimationStructureRef( UINT8 usSoldierID, UINT16 usSurfaceIndex, UINT16 usAnimState, BOOLEAN fUseAbsolute )
|
||||
static STRUCTURE_FILE_REF *InternalGetAnimationStructureRef( SoldierID usSoldierID, UINT16 usSurfaceIndex, UINT16 usAnimState, BOOLEAN fUseAbsolute )
|
||||
{
|
||||
INT8 bStructDataType;
|
||||
|
||||
@@ -935,26 +932,26 @@ STRUCTURE_FILE_REF *InternalGetAnimationStructureRef( UINT8 usSoldierID, UINT16
|
||||
if ( ( usAnimState == FALLFORWARD_FROMHIT_STAND || usAnimState == GENERIC_HIT_STAND ||
|
||||
usAnimState == FALLFORWARD_FROMHIT_CROUCH || usAnimState == STANDING_BURST_HIT ) && !fUseAbsolute )
|
||||
{
|
||||
return( gAnimStructureDatabase[ MercPtrs[ usSoldierID ]->ubBodyType ][ S_STRUCT ].pStructureFileRef );
|
||||
return( gAnimStructureDatabase[ usSoldierID->ubBodyType ][ S_STRUCT ].pStructureFileRef );
|
||||
}
|
||||
|
||||
return( gAnimStructureDatabase[ MercPtrs[ usSoldierID ]->ubBodyType ][ bStructDataType ].pStructureFileRef );
|
||||
return( gAnimStructureDatabase[ usSoldierID->ubBodyType ][ bStructDataType ].pStructureFileRef );
|
||||
}
|
||||
|
||||
|
||||
STRUCTURE_FILE_REF *GetAnimationStructureRef( UINT8 usSoldierID, UINT16 usSurfaceIndex, UINT16 usAnimState )
|
||||
STRUCTURE_FILE_REF *GetAnimationStructureRef( SoldierID usSoldierID, UINT16 usSurfaceIndex, UINT16 usAnimState )
|
||||
{
|
||||
return( InternalGetAnimationStructureRef( usSoldierID, usSurfaceIndex, usAnimState, FALSE ) );
|
||||
}
|
||||
|
||||
|
||||
STRUCTURE_FILE_REF *GetDefaultStructureRef( UINT8 usSoldierID )
|
||||
STRUCTURE_FILE_REF *GetDefaultStructureRef( SoldierID usSoldierID )
|
||||
{
|
||||
return( gAnimStructureDatabase[ MercPtrs[ usSoldierID ]->ubBodyType ][ DEFAULT_STRUCT ].pStructureFileRef );
|
||||
return( gAnimStructureDatabase[ usSoldierID->ubBodyType ][ DEFAULT_STRUCT ].pStructureFileRef );
|
||||
}
|
||||
|
||||
// Surface mamagement functions
|
||||
BOOLEAN LoadAnimationSurface( UINT16 usSoldierID, UINT16 usSurfaceIndex, UINT16 usAnimState )
|
||||
// Surface management functions
|
||||
BOOLEAN LoadAnimationSurface( SoldierID usSoldierID, UINT16 usSurfaceIndex, UINT16 usAnimState )
|
||||
{
|
||||
AuxObjectData *pAuxData;
|
||||
|
||||
@@ -1022,7 +1019,7 @@ BOOLEAN LoadAnimationSurface( UINT16 usSoldierID, UINT16 usSurfaceIndex, UINT16
|
||||
}
|
||||
|
||||
// get structure data if any
|
||||
pStructureFileRef = InternalGetAnimationStructureRef( (UINT8)usSoldierID, usSurfaceIndex, usAnimState, TRUE );
|
||||
pStructureFileRef = InternalGetAnimationStructureRef( usSoldierID, usSurfaceIndex, usAnimState, TRUE );
|
||||
|
||||
if ( pStructureFileRef != NULL )
|
||||
{
|
||||
@@ -1075,7 +1072,7 @@ BOOLEAN LoadAnimationSurface( UINT16 usSoldierID, UINT16 usSurfaceIndex, UINT16
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN UnLoadAnimationSurface( UINT16 usSoldierID, UINT16 usSurfaceIndex )
|
||||
BOOLEAN UnLoadAnimationSurface( SoldierID usSoldierID, UINT16 usSurfaceIndex )
|
||||
{
|
||||
// Decrement usage flag, only if this soldier has it currently tagged
|
||||
if ( gbAnimUsageHistory[ usSurfaceIndex ][ usSoldierID ] > 0 )
|
||||
@@ -1120,7 +1117,7 @@ BOOLEAN UnLoadAnimationSurface( UINT16 usSoldierID, UINT16 usSurfaceIndex )
|
||||
|
||||
}
|
||||
|
||||
void ClearAnimationSurfacesUsageHistory( UINT16 usSoldierID )
|
||||
void ClearAnimationSurfacesUsageHistory( SoldierID usSoldierID )
|
||||
{
|
||||
UINT32 cnt;
|
||||
|
||||
|
||||
@@ -688,16 +688,16 @@ extern AnimationStructureType gAnimStructureDatabase[ TOTALBODYTYPES ][ NUM_STRU
|
||||
// Functions
|
||||
BOOLEAN InitAnimationSystem( );
|
||||
BOOLEAN DeInitAnimationSystem( );
|
||||
BOOLEAN LoadAnimationSurface( UINT16 usSoldierID, UINT16 usSurfaceIndex, UINT16 usAnimState );
|
||||
BOOLEAN UnLoadAnimationSurface( UINT16 usSoldierID, UINT16 usSurfaceIndex );
|
||||
void ClearAnimationSurfacesUsageHistory( UINT16 usSoldierID );
|
||||
BOOLEAN LoadAnimationSurface( SoldierID usSoldierID, UINT16 usSurfaceIndex, UINT16 usAnimState );
|
||||
BOOLEAN UnLoadAnimationSurface( SoldierID usSoldierID, UINT16 usSurfaceIndex );
|
||||
void ClearAnimationSurfacesUsageHistory( SoldierID usSoldierID );
|
||||
|
||||
|
||||
void DeleteAnimationProfiles( );
|
||||
BOOLEAN LoadAnimationProfiles( );
|
||||
|
||||
STRUCTURE_FILE_REF *GetAnimationStructureRef( UINT8 usSoldierID, UINT16 usSurfaceIndex, UINT16 usAnimState );
|
||||
STRUCTURE_FILE_REF *GetDefaultStructureRef( UINT8 usSoldierID );
|
||||
STRUCTURE_FILE_REF *GetAnimationStructureRef( SoldierID usSoldierID, UINT16 usSurfaceIndex, UINT16 usAnimState );
|
||||
STRUCTURE_FILE_REF *GetDefaultStructureRef( SoldierID usSoldierID );
|
||||
|
||||
// Profile data
|
||||
extern ANIM_PROF *gpAnimProfiles;
|
||||
|
||||
@@ -1,29 +1,22 @@
|
||||
#include "Types.h"
|
||||
#include "stdlib.h"
|
||||
#include "types.h"
|
||||
#include <cstdlib>
|
||||
#include "Arms Dealer Init.h"
|
||||
#include "String.h"
|
||||
#include "Debug.h"
|
||||
#include "Random.h"
|
||||
#include "DEBUG.H"
|
||||
#include "random.h"
|
||||
#include "Weapons.h"
|
||||
#include "FileMan.h"
|
||||
#include "Game Clock.h"
|
||||
#include "ArmsDealerInvInit.h"
|
||||
#include "Message.h"
|
||||
#include "soldier profile.h"
|
||||
#include "Soldier Profile.h"
|
||||
#include "Handle Items.h"
|
||||
#include "Quests.h"
|
||||
#include "Scheduling.h"
|
||||
#include "GameSettings.h"
|
||||
#include "Overhead.h" // added by Flugente for MercPtrs[]
|
||||
#include "LuaInitNPCs.h" // added by Flugente
|
||||
|
||||
#ifdef JA2UB
|
||||
#include "Explosion Control.h"
|
||||
#include "Ja25_Tactical.h"
|
||||
#include "Ja25 Strategic Ai.h"
|
||||
#include "MapScreen Quotes.h"
|
||||
#include "email.h"
|
||||
#include "interface Dialogue.h"
|
||||
#include "ub_config.h"
|
||||
#endif
|
||||
|
||||
@@ -71,22 +64,17 @@ void GuaranteeAtLeastXItemsOfIndex( UINT8 ubArmsDealer, UINT16 usItemIndex, UIN
|
||||
void GuaranteeAtMostNumOfItemsForItem( UINT8 ubArmsDealer, INT16 sItemIndex, UINT8 ubAtMostNumItems );
|
||||
|
||||
void ArmsDealerGetsFreshStock( UINT8 ubArmsDealer, UINT16 usItemIndex, UINT8 ubNumItems );
|
||||
BOOLEAN ItemContainsLiquid( UINT16 usItemIndex );
|
||||
UINT8 DetermineDealerItemCondition( UINT8 ubArmsDealer, UINT16 usItemIndex );
|
||||
|
||||
BOOLEAN DoesItemAppearInDealerInventoryList( UINT8 ubArmsDealer, UINT16 usItemIndex, BOOLEAN fPurchaseFromPlayer );
|
||||
|
||||
#ifdef JA2UB
|
||||
UINT8 GetFirstValidSpecialItemFromDealer( UINT8 ubArmsDealer, INT16 sItemIndex );
|
||||
|
||||
void AddTexsVideosToBettysInventory();
|
||||
BOOLEAN CanThisItemBeSoldToSimulatedCustomer( UINT8 ubArmsDealerID, UINT16 usItemIndex );
|
||||
#endif
|
||||
|
||||
void GuaranteeMinimumAlcohol( UINT8 ubArmsDealer );
|
||||
|
||||
BOOLEAN ItemIsARocketRifle( INT16 sItemIndex );
|
||||
|
||||
BOOLEAN GetArmsDealerShopHours( UINT8 ubArmsDealer, UINT32 *puiOpeningTime, UINT32 *puiClosingTime );
|
||||
|
||||
ARMS_DEALER_STATUS& ARMS_DEALER_STATUS::operator=(const OLD_ARMS_DEALER_STATUS_101& status)
|
||||
@@ -205,7 +193,7 @@ void AddArmsDealerAdditionalIntelData( UINT16 ausDealer, UINT16 usItem, INT16 sI
|
||||
gArmsDealerAdditionalIntelData[ausDealer].push_back( data );
|
||||
}
|
||||
|
||||
void ArmsDealers_ReadIntelData()
|
||||
static void ArmsDealers_ReadIntelData()
|
||||
{
|
||||
gArmsDealerAdditionalIntelData.clear();
|
||||
|
||||
@@ -961,7 +949,7 @@ UINT32 GetArmsDealerItemTypeFromItemNumber( UINT16 usItem )
|
||||
return( ARMS_DEALER_HANDGUNCLASS );
|
||||
break;
|
||||
case RIFLECLASS:
|
||||
if ( ItemIsARocketRifle( usItem ) )
|
||||
if (ItemHasFingerPrintID( usItem ) )
|
||||
return( ARMS_DEALER_ROCKET_RIFLE );
|
||||
else
|
||||
return( ARMS_DEALER_RIFLECLASS );
|
||||
@@ -990,6 +978,7 @@ UINT32 GetArmsDealerItemTypeFromItemNumber( UINT16 usItem )
|
||||
return( 0 );
|
||||
}
|
||||
// else treat as blade
|
||||
[[fallthrough]];
|
||||
case IC_BLADE:
|
||||
case IC_THROWING_KNIFE:
|
||||
return( ARMS_DEALER_BLADE );
|
||||
@@ -1010,15 +999,15 @@ UINT32 GetArmsDealerItemTypeFromItemNumber( UINT16 usItem )
|
||||
{
|
||||
if ( Item [usItem].alcohol > 0.0f )
|
||||
return( ARMS_DEALER_ALCOHOL );
|
||||
else if ( Item [usItem].electronic )
|
||||
else if (ItemIsElectronic(usItem))
|
||||
return( ARMS_DEALER_ELECTRONICS );
|
||||
else if ( Item [usItem].hardware )
|
||||
else if (ItemIsHardware(usItem))
|
||||
return( ARMS_DEALER_HARDWARE );
|
||||
else if ( Item [usItem].medical )
|
||||
else if (ItemIsMedical(usItem))
|
||||
return( ARMS_DEALER_MEDICAL );
|
||||
else if ( Item [usItem].attachment )
|
||||
else if (ItemIsAttachment(usItem))
|
||||
return( ARMS_DEALER_ATTACHMENTS );
|
||||
else if ( Item [usItem].detonator || Item [usItem].remotedetonator || Item [usItem].remotetrigger )
|
||||
else if ( IsAttachmentClass( usItem, (AC_DETONATOR | AC_REMOTEDET) ) || ItemIsRemoteTrigger(usItem))
|
||||
return( ARMS_DEALER_DETONATORS );
|
||||
else
|
||||
return( ARMS_DEALER_MISC );
|
||||
@@ -1076,7 +1065,7 @@ UINT32 GetArmsDealerItemTypeFromItemNumber( UINT16 usItem )
|
||||
return( ARMS_DEALER_AMMO );
|
||||
break;
|
||||
case IC_FACE:
|
||||
if (Item[usItem].electronic )
|
||||
if (ItemIsElectronic(usItem))
|
||||
return ARMS_DEALER_ELECTRONICS;
|
||||
else
|
||||
return ARMS_DEALER_FACE;
|
||||
@@ -1278,8 +1267,7 @@ BOOLEAN CanDealerRepairItem( UINT8 ubArmsDealer, UINT16 usItemIndex )
|
||||
// uiFlags = Item[ usItemIndex ].fFlags;
|
||||
|
||||
// can't repair anything that's not repairable!
|
||||
// if ( !( uiFlags & ITEM_REPAIRABLE ) )
|
||||
if ( !( Item[ usItemIndex ].repairable ) )
|
||||
if ( !ItemIsRepairable(usItemIndex) )
|
||||
{
|
||||
return(FALSE);
|
||||
}
|
||||
@@ -1297,8 +1285,7 @@ BOOLEAN CanDealerRepairItem( UINT8 ubArmsDealer, UINT16 usItemIndex )
|
||||
case ARMS_DEALER_PERKO:
|
||||
#endif
|
||||
// repairs ANYTHING non-electronic
|
||||
// if ( !( uiFlags & ITEM_ELECTRONIC ) )
|
||||
if ( !( Item[ usItemIndex ].electronic ) )
|
||||
if ( !ItemIsElectronic(usItemIndex) )
|
||||
{
|
||||
return(TRUE);
|
||||
}
|
||||
@@ -1306,8 +1293,7 @@ BOOLEAN CanDealerRepairItem( UINT8 ubArmsDealer, UINT16 usItemIndex )
|
||||
|
||||
case ARMS_DEALER_FREDO:
|
||||
// repairs ONLY electronics
|
||||
// if ( uiFlags & ITEM_ELECTRONIC )
|
||||
if ( Item[ usItemIndex ].electronic )
|
||||
if (ItemIsElectronic(usItemIndex))
|
||||
{
|
||||
return(TRUE);
|
||||
}
|
||||
@@ -1318,7 +1304,7 @@ BOOLEAN CanDealerRepairItem( UINT8 ubArmsDealer, UINT16 usItemIndex )
|
||||
// Flugente: if we set this guy to be a repairguy, and this item is NOT electronic, well, we can
|
||||
if ( armsDealerInfo[ubArmsDealer].ubTypeOfArmsDealer == ARMS_DEALER_REPAIRS )
|
||||
{
|
||||
if ( !( Item[ usItemIndex ].electronic ) )
|
||||
if ( !ItemIsElectronic(usItemIndex) )
|
||||
return(TRUE);
|
||||
else
|
||||
return(FALSE);
|
||||
@@ -1369,7 +1355,7 @@ UINT8 DetermineDealerItemCondition( UINT8 ubArmsDealer, UINT16 usItemIndex )
|
||||
|
||||
// if it's a damagable item, and not a liquid (those are always sold full)
|
||||
// if ( ( Item[ usItemIndex ].fFlags & ITEM_DAMAGEABLE ) && !ItemContainsLiquid( usItemIndex ) )
|
||||
if ( ( Item[ usItemIndex ].damageable ) && !ItemContainsLiquid( usItemIndex ) )
|
||||
if (ItemIsDamageable(usItemIndex) && !ItemContainsLiquid(usItemIndex))
|
||||
{
|
||||
// if he ONLY has used items, or 50% of the time if he carries both used & new items
|
||||
if ( ( armsDealerInfo[ ubArmsDealer ].uiFlags & ARMS_DEALER_ONLY_USED_ITEMS ) ||
|
||||
@@ -1383,25 +1369,6 @@ UINT8 DetermineDealerItemCondition( UINT8 ubArmsDealer, UINT16 usItemIndex )
|
||||
return( ubCondition);
|
||||
}
|
||||
|
||||
BOOLEAN ItemContainsLiquid( UINT16 usItemIndex )
|
||||
{
|
||||
return Item[usItemIndex].containsliquid;
|
||||
|
||||
//switch ( usItemIndex )
|
||||
//{
|
||||
// case CANTEEN:
|
||||
// case BEER:
|
||||
// case ALCOHOL:
|
||||
// case JAR_HUMAN_BLOOD:
|
||||
// case JAR_CREATURE_BLOOD:
|
||||
// case JAR_QUEEN_CREATURE_BLOOD:
|
||||
// case JAR_ELIXIR:
|
||||
// case GAS_CAN:
|
||||
// return( TRUE );
|
||||
//}
|
||||
|
||||
//return( FALSE );
|
||||
}
|
||||
|
||||
bool ItemIsSpecial(DEALER_SPECIAL_ITEM& item)
|
||||
{
|
||||
@@ -1724,7 +1691,7 @@ void RemoveRandomItemFromArmsDealerInventory( UINT8 ubArmsDealer, UINT16 usItemI
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN AddDeadArmsDealerItemsToWorld( UINT8 usProfileID, UINT8 aMercID )
|
||||
BOOLEAN AddDeadArmsDealerItemsToWorld( UINT8 usProfileID, SoldierID aMercID )
|
||||
{
|
||||
//Get Dealer ID from from merc Id
|
||||
INT8 bArmsDealer = GetArmsDealerIDFromMercID( usProfileID );
|
||||
@@ -1735,7 +1702,7 @@ BOOLEAN AddDeadArmsDealerItemsToWorld( UINT8 usProfileID, UINT8 aMercID )
|
||||
// not if this isn't a proper profile
|
||||
if ( usProfileID == NO_PROFILE )
|
||||
{
|
||||
pSoldier = MercPtrs[aMercID];
|
||||
pSoldier = aMercID;
|
||||
|
||||
if ( pSoldier && pSoldier->sNonNPCTraderID > 0 )
|
||||
bArmsDealer = pSoldier->sNonNPCTraderID;
|
||||
@@ -1839,7 +1806,7 @@ void MakeObjectOutOfDealerItems( DEALER_SPECIAL_ITEM *pSpclItemInfo, OBJECTTYPE
|
||||
// they don't have ammo for by selling them to Tony & buying them right back fully loaded! One could repeat this
|
||||
// ad nauseum (empty the gun between visits) as a (really expensive) way to get unlimited special ammo like rockets.
|
||||
//CHRISL: If we're working with a SingleShotRocketLauncher, we need ubGunShotsLeft to equal 1
|
||||
if(Item[pObject->usItem].singleshotrocketlauncher == TRUE)
|
||||
if(ItemIsSingleShotRocketLauncher(pObject->usItem))
|
||||
(*pObject)[subObject]->data.gun.ubGunShotsLeft = 1;
|
||||
else
|
||||
(*pObject)[subObject]->data.gun.ubGunShotsLeft = 0;
|
||||
@@ -1863,7 +1830,7 @@ void GiveObjectToArmsDealerForRepair( UINT8 ubArmsDealer, OBJECTTYPE *pObject, U
|
||||
Assert( CanDealerRepairItem( ubArmsDealer, pObject->usItem ) );
|
||||
|
||||
// c) Actually damaged, or a rocket rifle (being reset)
|
||||
Assert( ( (*pObject)[0]->data.objectStatus < 100 ) || ItemIsARocketRifle( pObject->usItem ) );
|
||||
Assert( ( (*pObject)[0]->data.objectStatus < 100 ) || ItemHasFingerPrintID( pObject->usItem ) );
|
||||
|
||||
/* ARM: Can now repair with removeable attachments still attached...
|
||||
// d) Already stripped of all *detachable* attachments
|
||||
@@ -1898,7 +1865,7 @@ void GiveItemToArmsDealerforRepair( UINT8 ubArmsDealer, OBJECTTYPE* pObject, UIN
|
||||
|
||||
Assert( DoesDealerDoRepairs( ubArmsDealer ) );
|
||||
Assert( (*pObject)[0]->data.objectStatus > 0 );
|
||||
Assert( ( (*pObject)[0]->data.objectStatus < 100 ) || ItemIsARocketRifle( pObject->usItem ) );
|
||||
Assert( ( (*pObject)[0]->data.objectStatus < 100 ) || ItemHasFingerPrintID( pObject->usItem ) );
|
||||
|
||||
// figure out the earliest the repairman will be free to start repairing this item
|
||||
uiTimeWhenFreeToStartIt = WhenWillRepairmanBeAllDoneRepairing( ubArmsDealer );
|
||||
@@ -1995,8 +1962,7 @@ UINT32 CalculateSimpleItemRepairTime( UINT8 ubArmsDealer, UINT16 usItemIndex, IN
|
||||
// repairs on electronic items take twice as long if the guy doesn't have the skill
|
||||
// for dealers, this means anyone but Fredo the Electronics guy takes twice as long (but doesn't charge double)
|
||||
// (Mind you, current he's the ONLY one who CAN repair Electronics at all! Oh well.)
|
||||
// if( ( Item[ usItemIndex ].fFlags & ITEM_ELECTRONIC ) && ( ubArmsDealer != ARMS_DEALER_FREDO ) )
|
||||
if( ( Item[ usItemIndex ].electronic ) && ( ubArmsDealer != ARMS_DEALER_FREDO ) )
|
||||
if( ItemIsElectronic(usItemIndex) && ( ubArmsDealer != ARMS_DEALER_FREDO ) )
|
||||
{
|
||||
uiTimeToRepair *= 2;
|
||||
}
|
||||
@@ -2065,7 +2031,7 @@ UINT32 CalculateSimpleItemRepairCost( UINT8 ubArmsDealer, UINT16 usItemIndex, IN
|
||||
}
|
||||
*/
|
||||
|
||||
if ( ItemIsARocketRifle( usItemIndex ) )
|
||||
if (ItemHasFingerPrintID( usItemIndex ) )
|
||||
{
|
||||
// resetting imprinting for a rocket rifle costs something extra even if rifle is at 100%
|
||||
uiRepairCost += 100;
|
||||
@@ -2167,7 +2133,7 @@ UINT16 CalcValueOfItemToDealer( UINT8 ubArmsDealer, UINT16 usItemIndex, BOOLEAN
|
||||
// the rest of this function applies only to the "general" dealers ( Jake, Keith, and Franz )
|
||||
|
||||
// Micky & Gabby specialize in creature parts & such, the others don't buy these at all (exception: jars)
|
||||
if ( ( !Item[usItemIndex].jar ) &&
|
||||
if ( ( !ItemIsJar(usItemIndex)) &&
|
||||
( DoesItemAppearInDealerInventoryList( ARMS_DEALER_MICKY, usItemIndex, TRUE ) ||
|
||||
DoesItemAppearInDealerInventoryList( ARMS_DEALER_GABBY, usItemIndex, TRUE ) ) )
|
||||
{
|
||||
@@ -2214,7 +2180,7 @@ UINT16 CalcValueOfItemToDealer( UINT8 ubArmsDealer, UINT16 usItemIndex, BOOLEAN
|
||||
{
|
||||
// exception: Gas (Jake's)
|
||||
// if ( usItemIndex != GAS_CAN )
|
||||
if ( !Item[usItemIndex].gascan )
|
||||
if ( !ItemIsGascan(usItemIndex))
|
||||
{
|
||||
// they pay only 1/3 of true value!
|
||||
usValueToThisDealer /= 3;
|
||||
@@ -2244,11 +2210,6 @@ void GuaranteeMinimumAlcohol( UINT8 ubArmsDealer )
|
||||
GuaranteeAtLeastXItemsOfIndex( ubArmsDealer, ALCOHOL, ( UINT8 ) ( GetDealersMaxItemAmount( ubArmsDealer, ALCOHOL ) / 3 ) );
|
||||
}
|
||||
|
||||
BOOLEAN ItemIsARocketRifle( INT16 sItemIndex )
|
||||
{
|
||||
return( Item[sItemIndex].fingerprintid );
|
||||
}
|
||||
|
||||
BOOLEAN GetArmsDealerShopHours( UINT8 ubArmsDealer, UINT32 *puiOpeningTime, UINT32 *puiClosingTime )
|
||||
{
|
||||
SOLDIERTYPE *pSoldier;
|
||||
|
||||
@@ -366,7 +366,7 @@ UINT32 GetTimeToFixItemBeingRepaired( UINT8 ubArmsDealer, UINT16 usItemIndex, UI
|
||||
BOOLEAN CanDealerTransactItem( UINT8 ubArmsDealer, UINT16 usItemIndex, BOOLEAN fPurchaseFromPlayer );
|
||||
BOOLEAN CanDealerRepairItem( UINT8 ubArmsDealer, UINT16 usItemIndex );
|
||||
|
||||
BOOLEAN AddDeadArmsDealerItemsToWorld( UINT8 usProfileID, UINT8 aMercID );
|
||||
BOOLEAN AddDeadArmsDealerItemsToWorld( UINT8 usProfileID, SoldierID aMercID );
|
||||
|
||||
void MakeObjectOutOfDealerItems( DEALER_SPECIAL_ITEM *pSpclItemInfo, OBJECTTYPE *pObject );
|
||||
void CreateObjectForDealer( int usItem, int status, int numObjects, OBJECTTYPE *pObject );
|
||||
@@ -393,4 +393,4 @@ extern void GuaranteeAtLeastXItemsOfIndex( UINT8 ubArmsDealer, UINT16 usItemInd
|
||||
extern void GuaranteeAtMostNumOfItemsForItem( UINT8 ubArmsDealer, INT16 sItemIndex, UINT8 ubAtMostNumItems );
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
#include "Types.h"
|
||||
#include "types.h"
|
||||
#include "ArmsDealerInvInit.h"
|
||||
//#include "Item Types.h"
|
||||
#include "Arms Dealer Init.h"
|
||||
#include "DEbug.h"
|
||||
#include "weapons.h"
|
||||
#include "DEBUG.H"
|
||||
#include "Weapons.h"
|
||||
#include "Campaign.h"
|
||||
#include "GameSettings.h"
|
||||
#include "AIInternals.h"
|
||||
#include "LaptopSave.h"
|
||||
#include "bobbyr.h"
|
||||
#include "Random.h"
|
||||
#include "Shopkeeper Interface.h"
|
||||
#include "BobbyR.h"
|
||||
#include "random.h"
|
||||
#include "connect.h"
|
||||
#include "Rebel Command.h"
|
||||
|
||||
@@ -689,7 +687,7 @@ DEALER_POSSIBLE_INV gArmsDealerAdditional[ADDITIONAL_ARMS_DEALERS][MAXITEMS+1];
|
||||
|
||||
// prototypes
|
||||
|
||||
INT8 GetMaxItemAmount( DEALER_POSSIBLE_INV *pInv, UINT16 usItemIndex )
|
||||
static INT8 GetMaxItemAmount( DEALER_POSSIBLE_INV *pInv, UINT16 usItemIndex )
|
||||
{
|
||||
UINT16 usCnt = 0;
|
||||
|
||||
@@ -927,7 +925,7 @@ DEALER_POSSIBLE_INV *GetPointerToDealersPossibleInventory( UINT16 ubArmsDealerID
|
||||
}
|
||||
|
||||
//Madd: added boolean fUsed
|
||||
UINT8 GetCurrentSuitabilityForItem( INT8 bArmsDealer, UINT16 usItemIndex, BOOLEAN fUsed )
|
||||
static UINT8 GetCurrentSuitabilityForItem( INT8 bArmsDealer, UINT16 usItemIndex, BOOLEAN fUsed )
|
||||
{
|
||||
unsigned ubItemCoolness;
|
||||
unsigned ubMinCoolness, ubMaxCoolness;
|
||||
@@ -944,8 +942,7 @@ UINT8 GetCurrentSuitabilityForItem( INT8 bArmsDealer, UINT16 usItemIndex, BOOLEA
|
||||
}
|
||||
|
||||
// items normally not sold at shops are unsuitable
|
||||
// if ( Item[ usItemIndex ].fFlags & ITEM_NOT_BUYABLE )
|
||||
if ( Item[ usItemIndex ].notbuyable )
|
||||
if (ItemIsNotBuyable(usItemIndex))
|
||||
{
|
||||
return(ITEM_SUITABILITY_NONE);
|
||||
}
|
||||
@@ -971,7 +968,7 @@ UINT8 GetCurrentSuitabilityForItem( INT8 bArmsDealer, UINT16 usItemIndex, BOOLEA
|
||||
// case JAR:
|
||||
// case JAR_ELIXIR:
|
||||
// case JAR_CREATURE_BLOOD:
|
||||
if ( Item[usItemIndex].medical || Item[usItemIndex].canteen || Item[usItemIndex].medicalkit || Item[usItemIndex].locksmithkit || Item[usItemIndex].toolkit || Item[usItemIndex].crowbar || Item[usItemIndex].jar )
|
||||
if (ItemIsMedical(usItemIndex) || ItemIsCanteen(usItemIndex) || ItemIsMedicalKit(usItemIndex) || ItemIsLocksmithKit(usItemIndex) || ItemIsToolkit(usItemIndex) || ItemIsCrowbar(usItemIndex) || ItemIsJar(usItemIndex) )
|
||||
return(ITEM_SUITABILITY_ALWAYS);
|
||||
//}
|
||||
|
||||
@@ -1455,8 +1452,7 @@ UINT8 GetDealerItemCategoryNumber( UINT16 usItemIndex )
|
||||
|
||||
BOOLEAN CanDealerItemBeSoldUsed( UINT16 usItemIndex )
|
||||
{
|
||||
// if ( !( Item[ usItemIndex ].fFlags & ITEM_DAMAGEABLE ) )
|
||||
if ( !( Item[ usItemIndex ].damageable ) )
|
||||
if ( !ItemIsDamageable(usItemIndex) )
|
||||
return(FALSE);
|
||||
|
||||
// certain items, although they're damagable, shouldn't be sold in a used condition
|
||||
|
||||
+86
-99
@@ -1,32 +1,29 @@
|
||||
#include "sgp.h"
|
||||
#include "overhead.h"
|
||||
#include "messageboxscreen.h"
|
||||
#include "Overhead.h"
|
||||
#include "MessageBoxScreen.h"
|
||||
#include "screenids.h"
|
||||
#include "Handle UI.h"
|
||||
#include "message.h"
|
||||
#include "game clock.h"
|
||||
#include "items.h"
|
||||
#include "Game Clock.h"
|
||||
#include "Items.h"
|
||||
#include "Text.h"
|
||||
#include "MercTextBox.h"
|
||||
#include "interface.h"
|
||||
#include "auto bandage.h"
|
||||
#include "Interface.h"
|
||||
#include "Auto Bandage.h"
|
||||
#include "renderworld.h"
|
||||
#include "strategic turns.h"
|
||||
#include "Strategic Turns.h"
|
||||
#include "Event Pump.h"
|
||||
#include "dialogue control.h"
|
||||
#include "Dialogue Control.h"
|
||||
#include "ai.h"
|
||||
#include "interface control.h"
|
||||
#include "Interface Control.h"
|
||||
#include "strategicmap.h"
|
||||
#include "animation control.h"
|
||||
#include "Animation Control.h"
|
||||
#include "Map Screen Interface.h"
|
||||
#include "Soldier Profile.h"
|
||||
#include "Assignments.h"
|
||||
#include "WordWrap.h"
|
||||
#include "cursors.h"
|
||||
#include "English.h"
|
||||
#include "SkillCheck.h" // added by Flugente
|
||||
#include "Cursors.h"
|
||||
#include "english.h"
|
||||
|
||||
#include "Music Control.h"
|
||||
|
||||
// max number of merc faces per row in autobandage box
|
||||
#define NUMBER_MERC_FACES_AUTOBANDAGE_BOX 4
|
||||
@@ -69,13 +66,11 @@ std::vector<INT32> giAutoBandagesSoldierFaces (2*CODE_MAXIMUM_NUMBER_OF_PLAYER_S
|
||||
BOOLEAN fAutoEndBandageButtonCreated = FALSE;
|
||||
|
||||
void BeginAutoBandageCallBack( UINT8 bExitValue );
|
||||
void CancelAutoBandageCallBack( UINT8 bExitValue );
|
||||
|
||||
// the update box for autobandaging mercs
|
||||
void CreateTerminateAutoBandageButton( INT16 sX, INT16 sY );
|
||||
void DestroyTerminateAutoBandageButton( void );
|
||||
void DisplayAutoBandageUpdatePanel( void );
|
||||
void EndAutobandageButtonCallback(GUI_BUTTON *btn,INT32 reason);
|
||||
void SetUpAutoBandageUpdatePanel( void );
|
||||
BOOLEAN AddFacesToAutoBandageBox( void );
|
||||
BOOLEAN RenderSoldierSmallFaceForAutoBandagePanel( INT32 iIndex, INT16 sCurrentXPosition, INT16 sCurrentYPosition );
|
||||
@@ -85,14 +80,12 @@ BOOLEAN RemoveFacesForAutoBandage( void );
|
||||
|
||||
extern BOOLEAN CanCharacterAutoBandageTeammate( SOLDIERTYPE *pSoldier );
|
||||
extern BOOLEAN CanCharacterBeAutoBandagedByTeammate( SOLDIERTYPE *pSoldier );
|
||||
extern UINT8 NumEnemyInSector( );
|
||||
extern UINT16 NumEnemyInSector( );
|
||||
|
||||
void BeginAutoBandage( )
|
||||
{
|
||||
INT32 cnt;
|
||||
BOOLEAN fFoundAGuy = FALSE;
|
||||
SOLDIERTYPE * pSoldier;
|
||||
BOOLEAN fFoundAMedKit = FALSE;
|
||||
BOOLEAN fFoundAGuy = FALSE;
|
||||
BOOLEAN fFoundAMedKit = FALSE;
|
||||
|
||||
// If we are in combat, we con't...
|
||||
if ( (gTacticalStatus.uiFlags & INCOMBAT) || (NumEnemyInSector() != 0) )
|
||||
@@ -101,21 +94,21 @@ void BeginAutoBandage( )
|
||||
return;
|
||||
}
|
||||
|
||||
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
SoldierID soldier = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
// check for anyone needing bandages
|
||||
for ( pSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++cnt, ++pSoldier )
|
||||
for ( ; soldier <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++soldier )
|
||||
{
|
||||
// if the soldier isn't active or in sector, we have problems..leave
|
||||
if ( !(pSoldier->bActive) || !(pSoldier->bInSector) || ( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) || (pSoldier->bAssignment == VEHICLE ) )
|
||||
if ( !(soldier->bActive) || !(soldier->bInSector) || ( soldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) || (soldier->bAssignment == VEHICLE ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// can this character be helped out by a teammate?
|
||||
if ( CanCharacterBeAutoBandagedByTeammate( pSoldier ) )
|
||||
if ( CanCharacterBeAutoBandagedByTeammate( soldier ) )
|
||||
fFoundAGuy = TRUE;
|
||||
|
||||
if ( FindObjClass( pSoldier, IC_MEDKIT ) != NO_SLOT )
|
||||
if ( FindObjClass( soldier, IC_MEDKIT ) != NO_SLOT )
|
||||
fFoundAMedKit = TRUE;
|
||||
|
||||
if ( fFoundAGuy && fFoundAMedKit )
|
||||
@@ -155,9 +148,6 @@ void BeginAutoBandage( )
|
||||
|
||||
void HandleAutoBandagePending( )
|
||||
{
|
||||
INT32 cnt;
|
||||
SOLDIERTYPE *pSoldier = NULL;
|
||||
|
||||
// OK, if we have a pending autobandage....
|
||||
// check some conditions
|
||||
if ( gTacticalStatus.fAutoBandagePending )
|
||||
@@ -176,15 +166,15 @@ void HandleAutoBandagePending( )
|
||||
}
|
||||
|
||||
// Do any guys have pending actions...?
|
||||
cnt = gTacticalStatus.Team[ OUR_TEAM ].bFirstID;
|
||||
for ( pSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++cnt, ++pSoldier)
|
||||
SoldierID soldier = gTacticalStatus.Team[ OUR_TEAM ].bFirstID;
|
||||
for ( ; soldier <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++soldier)
|
||||
{
|
||||
// Are we in sector?
|
||||
if ( pSoldier->bActive )
|
||||
if ( soldier->bActive )
|
||||
{
|
||||
if ( pSoldier->sSectorX == gWorldSectorX && pSoldier->sSectorY == gWorldSectorY && pSoldier->bSectorZ == gbWorldSectorZ && !pSoldier->flags.fBetweenSectors )
|
||||
if ( soldier->sSectorX == gWorldSectorX && soldier->sSectorY == gWorldSectorY && soldier->bSectorZ == gbWorldSectorZ && !soldier->flags.fBetweenSectors )
|
||||
{
|
||||
if ( pSoldier->aiData.ubPendingAction != NO_PENDING_ACTION )
|
||||
if ( soldier->aiData.ubPendingAction != NO_PENDING_ACTION )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -246,14 +236,14 @@ BOOLEAN HandleAutoBandage( )
|
||||
ShadowVideoSurfaceRect( FRAME_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
|
||||
InvalidateScreen( );
|
||||
RefreshScreen( NULL );
|
||||
INT32 cnt = gTacticalStatus.Team[OUR_TEAM].bFirstID;
|
||||
SOLDIERTYPE *pSoldier = NULL;
|
||||
for (pSoldier = MercPtrs[cnt]; cnt <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++cnt, ++pSoldier)
|
||||
|
||||
SoldierID soldier = gTacticalStatus.Team[OUR_TEAM].bFirstID;
|
||||
for ( ; soldier <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++soldier)
|
||||
{
|
||||
if(pSoldier->bActive && pSoldier->bInSector && pSoldier->aiData.bAction != 0)
|
||||
if(soldier->bActive && soldier->bInSector && soldier->aiData.bAction != 0)
|
||||
{
|
||||
//shadooow: this fixes autobandaging sometimes hang indefinitely
|
||||
pSoldier->aiData.bAction = 0;
|
||||
soldier->aiData.bAction = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -308,17 +298,15 @@ BOOLEAN HandleAutoBandage( )
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN CreateAutoBandageString( void )
|
||||
static BOOLEAN CreateAutoBandageString( void )
|
||||
{
|
||||
INT32 cnt;
|
||||
// WDS - make number of mercenaries, etc. be configurable
|
||||
UINT8 ubDoctor[CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS], ubDoctors = 0;
|
||||
UINT16 ubDoctor[CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS], ubDoctors = 0;
|
||||
UINT32 uiDoctorNameStringLength = 1; // for end-of-string character
|
||||
STR16 sTemp;
|
||||
SOLDIERTYPE * pSoldier;
|
||||
|
||||
cnt = gTacticalStatus.Team[ OUR_TEAM ].bFirstID;
|
||||
for ( pSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++cnt, ++pSoldier)
|
||||
SoldierID pSoldier = gTacticalStatus.Team[ OUR_TEAM ].bFirstID;
|
||||
for ( ; pSoldier <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++pSoldier )
|
||||
{
|
||||
if ( pSoldier->bActive && pSoldier->bInSector && pSoldier->stats.bLife >= OKLIFE && !(pSoldier->bCollapsed) && pSoldier->stats.bMedical > 0 && FindObjClass( pSoldier, IC_MEDKIT ) != NO_SLOT)
|
||||
{
|
||||
@@ -364,7 +352,7 @@ BOOLEAN CreateAutoBandageString( void )
|
||||
return( FALSE );
|
||||
}
|
||||
wcscpy( sTemp, L"" );
|
||||
for (cnt = 0; cnt < ubDoctors - 1; ++cnt)
|
||||
for (UINT16 cnt = 0; cnt < ubDoctors - 1; ++cnt)
|
||||
{
|
||||
wcscat( sTemp, MercPtrs[ubDoctor[cnt]]->name );
|
||||
if (ubDoctors > 2)
|
||||
@@ -394,10 +382,7 @@ void SetAutoBandageComplete( void )
|
||||
|
||||
void AutoBandage( BOOLEAN fStart )
|
||||
{
|
||||
SGPRect aRect;
|
||||
UINT8 ubLoop;
|
||||
INT32 cnt;
|
||||
SOLDIERTYPE * pSoldier;
|
||||
SGPRect aRect;
|
||||
|
||||
if ( fStart )
|
||||
{
|
||||
@@ -417,8 +402,8 @@ void AutoBandage( BOOLEAN fStart )
|
||||
// Compress time...
|
||||
//SetGameTimeCompressionLevel( TIME_COMPRESS_5MINS );
|
||||
|
||||
cnt = gTacticalStatus.Team[ OUR_TEAM ].bFirstID;
|
||||
for ( pSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++cnt, ++pSoldier)
|
||||
SoldierID pSoldier = gTacticalStatus.Team[ OUR_TEAM ].bFirstID;
|
||||
for ( ; pSoldier <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; ++pSoldier)
|
||||
{
|
||||
if ( pSoldier->bActive )
|
||||
{
|
||||
@@ -456,11 +441,11 @@ void AutoBandage( BOOLEAN fStart )
|
||||
gTacticalStatus.uiFlags &= ( ~OUR_MERCS_AUTO_MOVE );
|
||||
|
||||
// make sure anyone under AI control has their action cancelled
|
||||
cnt = gTacticalStatus.Team[ OUR_TEAM ].bFirstID;
|
||||
for ( pSoldier = MercPtrs[cnt]; cnt <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++cnt, ++pSoldier )
|
||||
SoldierID pSoldier = gTacticalStatus.Team[ OUR_TEAM ].bFirstID;
|
||||
for ( ; pSoldier <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++pSoldier )
|
||||
{
|
||||
// 0verhaul: Make sure the merc is also in the sector before making him stand up!
|
||||
if (pSoldier && pSoldier->bActive && pSoldier->bInSector)
|
||||
if (pSoldier->bActive && pSoldier->bInSector)
|
||||
{
|
||||
ActionDone( pSoldier );
|
||||
if ( pSoldier->bSlotItemTakenFrom != NO_SLOT )
|
||||
@@ -480,11 +465,10 @@ void AutoBandage( BOOLEAN fStart )
|
||||
}
|
||||
}
|
||||
|
||||
ubLoop = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
for ( ; ubLoop <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++ubLoop)
|
||||
pSoldier = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
for ( ; pSoldier <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++pSoldier )
|
||||
{
|
||||
pSoldier = MercPtrs[ubLoop];
|
||||
if (pSoldier && pSoldier->bActive && pSoldier->bInSector)
|
||||
if ( pSoldier->bActive && pSoldier->bInSector)
|
||||
{
|
||||
ActionDone(pSoldier);
|
||||
|
||||
@@ -553,7 +537,6 @@ void BeginAutoBandageCallBack( UINT8 bExitValue )
|
||||
|
||||
void SetUpAutoBandageUpdatePanel( void )
|
||||
{
|
||||
|
||||
INT32 iNumberDoctoring = 0;
|
||||
INT32 iNumberPatienting = 0;
|
||||
INT32 iNumberOnTeam = 0;
|
||||
@@ -574,24 +557,21 @@ void SetUpAutoBandageUpdatePanel( void )
|
||||
// grab number of potential grunts on players team
|
||||
iNumberOnTeam = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
|
||||
|
||||
// run through mercs on squad...if they can doctor, add to list
|
||||
// run through mercs on squad...if they can be a doctor or patient, add to list
|
||||
for( iCounterA = 0; iCounterA < iNumberOnTeam; iCounterA++ )
|
||||
{
|
||||
if( CanCharacterAutoBandageTeammate( &Menptr[ iCounterA ] ) )
|
||||
SOLDIERTYPE *pSoldier = &Menptr[iCounterA];
|
||||
|
||||
if( CanCharacterAutoBandageTeammate( pSoldier ))
|
||||
{
|
||||
// add to list, up the count
|
||||
iDoctorList[ iNumberDoctoring ] = iCounterA;
|
||||
iNumberDoctoring++;
|
||||
}
|
||||
}
|
||||
|
||||
// run through mercs on squad, if they can patient, add to list
|
||||
for( iCounterA = 0; iCounterA < iNumberOnTeam; iCounterA++ )
|
||||
{
|
||||
if( CanCharacterBeAutoBandagedByTeammate( &Menptr[ iCounterA ] ) )
|
||||
if ( CanCharacterBeAutoBandagedByTeammate( pSoldier ) )
|
||||
{
|
||||
// add to list, up the count
|
||||
iPatientList[ iNumberPatienting ] = iCounterA;
|
||||
iPatientList[iNumberPatienting] = iCounterA;
|
||||
iNumberPatienting++;
|
||||
}
|
||||
}
|
||||
@@ -1028,7 +1008,7 @@ BOOLEAN AddFacesToAutoBandageBox( void )
|
||||
INT32 iCounter = 0;
|
||||
INT32 iNumberOfDoctors = 0;
|
||||
VOBJECT_DESC VObjectDesc;
|
||||
|
||||
const MERCPROFILESTRUCT *profile;
|
||||
|
||||
// WDS - make number of mercenaries, etc. be configurable
|
||||
// reset
|
||||
@@ -1044,21 +1024,24 @@ BOOLEAN AddFacesToAutoBandageBox( void )
|
||||
// find a free slot
|
||||
if( iDoctorList[ iCounter ] != -1 )
|
||||
{
|
||||
if( gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex < 100 )
|
||||
profile = &gMercProfiles[(Menptr[iDoctorList[iCounter]]).ubProfile];
|
||||
const UINT8 face = profile->ubFaceIndex;
|
||||
|
||||
if( face < 100 )
|
||||
{
|
||||
// grab filename of face
|
||||
if ((iDoctorList[ iCounter ] != -1) && gMercProfiles[( Menptr[iDoctorList[iCounter]] ).ubProfile].Type == PROFILETYPE_IMP )
|
||||
sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%02d.sti", gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
|
||||
if ( profile->Type == PROFILETYPE_IMP )
|
||||
sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%02d.sti", face );
|
||||
else
|
||||
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%02d.sti", gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
|
||||
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%02d.sti", face );
|
||||
}
|
||||
else
|
||||
{
|
||||
// grab filename of face
|
||||
if ((iDoctorList[ iCounter ] != -1) && gMercProfiles[( Menptr[iDoctorList[iCounter]] ).ubProfile].Type == PROFILETYPE_IMP )
|
||||
sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%03d.sti", gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
|
||||
if ( profile->Type == PROFILETYPE_IMP )
|
||||
sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%03d.sti", face );
|
||||
else
|
||||
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%03d.sti", gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
|
||||
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%03d.sti", face );
|
||||
}
|
||||
|
||||
// load the face
|
||||
@@ -1077,21 +1060,24 @@ BOOLEAN AddFacesToAutoBandageBox( void )
|
||||
// find a free slot
|
||||
if( iPatientList[ iCounter ] != -1 )
|
||||
{
|
||||
if( gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex < 100 )
|
||||
profile = &gMercProfiles[(Menptr[iPatientList[iCounter]]).ubProfile];
|
||||
const UINT8 face = profile->ubFaceIndex;
|
||||
|
||||
if( face < 100 )
|
||||
{
|
||||
// grab filename of face
|
||||
if ((iPatientList[ iCounter ] != -1) && gMercProfiles[( Menptr[iPatientList[iCounter]] ).ubProfile].Type == PROFILETYPE_IMP )
|
||||
sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%02d.sti", gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
|
||||
if ( profile->Type == PROFILETYPE_IMP )
|
||||
sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%02d.sti", face );
|
||||
else
|
||||
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%02d.sti", gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
|
||||
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%02d.sti", face );
|
||||
}
|
||||
else
|
||||
{
|
||||
// grab filename of face
|
||||
if ( (iPatientList[ iCounter ] != -1) && gMercProfiles[( Menptr[iPatientList[iCounter]] ).ubProfile].Type == PROFILETYPE_IMP )
|
||||
sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%03d.sti", gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
|
||||
if ( profile->Type == PROFILETYPE_IMP )
|
||||
sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%03d.sti", face );
|
||||
else
|
||||
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%03d.sti", gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
|
||||
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%03d.sti", face );
|
||||
}
|
||||
|
||||
// load the face
|
||||
@@ -1233,15 +1219,15 @@ BOOLEAN RetreatBandagingPending()
|
||||
}
|
||||
|
||||
// return the ID of best doctor that has a medkit and is travelling with pPatient
|
||||
UINT16 GetBestRetreatingMercDoctor( SOLDIERTYPE* pPatient )
|
||||
SoldierID GetBestRetreatingMercDoctor( SOLDIERTYPE* pPatient )
|
||||
{
|
||||
// if this is a travelling, bleeding merc, can somebody who travels with him bandage him/her?
|
||||
if ( pPatient && pPatient->bActive && pPatient->flags.fBetweenSectors && pPatient->bBleeding )
|
||||
{
|
||||
UINT16 cnt = gTacticalStatus.Team[OUR_TEAM].bFirstID;
|
||||
SOLDIERTYPE* pSoldier = NULL;
|
||||
for ( pSoldier = MercPtrs[cnt]; cnt <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++cnt, ++pSoldier )
|
||||
SoldierID ID = gTacticalStatus.Team[OUR_TEAM].bFirstID;
|
||||
for ( ; ID <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++ID )
|
||||
{
|
||||
SOLDIERTYPE *pSoldier = ID;
|
||||
// this requires mercs to travel and thus NOT be in a sector
|
||||
// also we need to be in a specific sector
|
||||
if ( pSoldier->bActive && pSoldier->flags.fBetweenSectors && pSoldier->sSectorX == pPatient->sSectorX && pSoldier->sSectorY == pPatient->sSectorY )
|
||||
@@ -1249,7 +1235,7 @@ UINT16 GetBestRetreatingMercDoctor( SOLDIERTYPE* pPatient )
|
||||
// find the best conscious doctor that has a medkit
|
||||
if ( pSoldier->stats.bLife >= OKLIFE && pSoldier->stats.bMedical > 0 && FindObjClass( pSoldier, IC_MEDKIT ) != NO_SLOT )
|
||||
{
|
||||
return cnt;
|
||||
return ID;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1278,12 +1264,12 @@ void HandleRetreatBandaging()
|
||||
BOOLEAN needhelpinsector = FALSE;
|
||||
INT16 sX = -1;
|
||||
INT16 sY = -1;
|
||||
UINT16 possiblepatient = NOBODY;
|
||||
SoldierID possiblepatient = NOBODY;
|
||||
|
||||
UINT16 cnt = gTacticalStatus.Team[OUR_TEAM].bFirstID;
|
||||
SOLDIERTYPE* pSoldier = NULL;
|
||||
for ( pSoldier = MercPtrs[cnt]; cnt <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++cnt, ++pSoldier )
|
||||
SoldierID ID = gTacticalStatus.Team[OUR_TEAM].bFirstID;
|
||||
for ( ; ID <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++ID )
|
||||
{
|
||||
SOLDIERTYPE* pSoldier = ID;
|
||||
// this requires mercs to travel and thus NOT be in a sector
|
||||
// are we bleeding?
|
||||
if ( pSoldier->bActive && pSoldier->flags.fBetweenSectors && pSoldier->bBleeding )
|
||||
@@ -1327,7 +1313,7 @@ void HandleRetreatBandaging()
|
||||
needhelpinsector = TRUE;
|
||||
sX = pSoldier->sSectorX;
|
||||
sY = pSoldier->sSectorY;
|
||||
possiblepatient = cnt;
|
||||
possiblepatient = ID;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1336,16 +1322,17 @@ void HandleRetreatBandaging()
|
||||
if ( needhelpinsector && possiblepatient != NOBODY)
|
||||
{
|
||||
// find the best doctor here
|
||||
UINT16 bestdoctorid = GetBestRetreatingMercDoctor( MercPtrs[possiblepatient] );
|
||||
SoldierID bestdoctorid = GetBestRetreatingMercDoctor( MercPtrs[possiblepatient] );
|
||||
|
||||
if ( bestdoctorid != NOBODY )
|
||||
{
|
||||
// have the doctor treat people
|
||||
SOLDIERTYPE* pDoctor = MercPtrs[bestdoctorid];
|
||||
SOLDIERTYPE* pDoctor = bestdoctorid;
|
||||
|
||||
cnt = gTacticalStatus.Team[OUR_TEAM].bFirstID;
|
||||
for ( pSoldier = MercPtrs[cnt]; cnt <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++cnt, ++pSoldier )
|
||||
SoldierID ID = gTacticalStatus.Team[OUR_TEAM].bFirstID;
|
||||
for ( ; ID <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++ID)
|
||||
{
|
||||
SOLDIERTYPE *pSoldier = ID;
|
||||
// this requires mercs to travel and thus NOT be in a sector
|
||||
// also we need to be in a specific sector
|
||||
// treat bleeding people only
|
||||
|
||||
@@ -21,8 +21,8 @@ void SetRetreatBandaging( BOOLEAN aVal );
|
||||
BOOLEAN RetreatBandagingPending( );
|
||||
|
||||
// return the ID of best doctor that has a medkit and is travelling with pPatient
|
||||
UINT16 GetBestRetreatingMercDoctor( SOLDIERTYPE* pPatient );
|
||||
SoldierID GetBestRetreatingMercDoctor( SOLDIERTYPE* pPatient );
|
||||
|
||||
void HandleRetreatBandaging( );
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+31
-36
@@ -2,35 +2,33 @@
|
||||
#include "Overhead.h"
|
||||
#include "Boxing.h"
|
||||
#include "Render Fun.h"
|
||||
#include "Random.h"
|
||||
#include "Worldman.h"
|
||||
#include "random.h"
|
||||
#include "worldman.h"
|
||||
#include "Soldier Profile.h"
|
||||
#include "NPC.h"
|
||||
#include "Opplist.h"
|
||||
#include "opplist.h"
|
||||
#include "ai.h"
|
||||
#include "Dialogue Control.h"
|
||||
#include "Handle UI.h"
|
||||
#include "Points.h"
|
||||
#include "interface.h"
|
||||
#include "interface dialogue.h"
|
||||
#include "Interface.h"
|
||||
#include "interface Dialogue.h"
|
||||
#include "TeamTurns.h"
|
||||
#include "Music Control.h"
|
||||
#include "history.h"
|
||||
#include "strategicmap.h"
|
||||
#include "Game Clock.h"
|
||||
#include "Animation Data.h"
|
||||
#include "Font Control.h"
|
||||
#include "message.h"
|
||||
#include "GameSettings.h" // added by SANDRO
|
||||
#include "Soldier macros.h"
|
||||
#include <Font Control.h>
|
||||
#include <message.h>
|
||||
|
||||
INT32 gsBoxerGridNo[ NUM_BOXERS ] = { 11393, 11233, 11073 };
|
||||
UINT8 gubBoxerID[ NUM_BOXERS ] = { NOBODY, NOBODY, NOBODY };
|
||||
BOOLEAN gfBoxerFought[ NUM_BOXERS ] = { FALSE, FALSE, FALSE };
|
||||
BOOLEAN gfLastBoxingMatchWonByPlayer = FALSE;
|
||||
UINT8 gubBoxingMatchesWon = 0;
|
||||
UINT8 gubBoxersRests = 0;
|
||||
BOOLEAN gfBoxersResting = FALSE;
|
||||
INT32 gsBoxerGridNo[ NUM_BOXERS ] = { 11393, 11233, 11073 };
|
||||
SoldierID gubBoxerID[ NUM_BOXERS ] = { NOBODY, NOBODY, NOBODY };
|
||||
BOOLEAN gfBoxerFought[ NUM_BOXERS ] = { FALSE, FALSE, FALSE };
|
||||
BOOLEAN gfLastBoxingMatchWonByPlayer = FALSE;
|
||||
UINT8 gubBoxingMatchesWon = 0;
|
||||
UINT8 gubBoxersRests = 0;
|
||||
BOOLEAN gfBoxersResting = FALSE;
|
||||
|
||||
extern void RecalculateOppCntsDueToBecomingNeutral( SOLDIERTYPE * pSoldier );
|
||||
|
||||
@@ -211,7 +209,7 @@ UINT8 CountPeopleInBoxingRing( void )
|
||||
return( ubTotalInRing );
|
||||
}
|
||||
|
||||
void CountPeopleInBoxingRingAndDoActions( void )
|
||||
static void CountPeopleInBoxingRingAndDoActions( void )
|
||||
{
|
||||
UINT32 uiLoop;
|
||||
UINT8 ubTotalInRing = 0;
|
||||
@@ -327,8 +325,8 @@ void CountPeopleInBoxingRingAndDoActions( void )
|
||||
|
||||
BOOLEAN CheckOnBoxers( void )
|
||||
{
|
||||
UINT32 uiLoop;
|
||||
UINT8 ubID;
|
||||
UINT32 uiLoop;
|
||||
SoldierID ubID;
|
||||
|
||||
// repick boxer IDs every time
|
||||
if ( gubBoxerID[0] == NOBODY )
|
||||
@@ -338,15 +336,15 @@ BOOLEAN CheckOnBoxers( void )
|
||||
{
|
||||
ubID = WhoIsThere2( gsBoxerGridNo[ uiLoop ], 0 );
|
||||
|
||||
// WANNE: Safty check!
|
||||
// WANNE: Safety check!
|
||||
if (ubID < TOTAL_SOLDIERS)
|
||||
{
|
||||
if ( FindObjClass( MercPtrs[ ubID ], IC_WEAPON ) == NO_SLOT &&
|
||||
IS_MERC_BODY_TYPE( MercPtrs[ ubID ] ) )
|
||||
if ( FindObjClass( ubID, IC_WEAPON ) == NO_SLOT &&
|
||||
IS_MERC_BODY_TYPE( ubID ) )
|
||||
{
|
||||
// no weapon and not a civilian so this guy is a boxer
|
||||
gubBoxerID[ uiLoop ] = ubID;
|
||||
DebugQuestInfo(String("CheckOnBoxers: set gubBoxerID[%d] %d", ubID, gubBoxerID[uiLoop]));
|
||||
DebugQuestInfo(String("CheckOnBoxers: set gubBoxerID[%d] to %d", uiLoop, ubID.i));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -376,8 +374,8 @@ BOOLEAN BoxerExists( void )
|
||||
|
||||
BOOLEAN PickABoxer( void )
|
||||
{
|
||||
UINT32 uiLoop;
|
||||
SOLDIERTYPE* pBoxer;
|
||||
UINT32 uiLoop;
|
||||
SOLDIERTYPE *pBoxer;
|
||||
|
||||
for( uiLoop = 0; uiLoop < NUM_BOXERS; ++uiLoop )
|
||||
{
|
||||
@@ -386,11 +384,11 @@ BOOLEAN PickABoxer( void )
|
||||
if ( gfBoxerFought[ uiLoop ] )
|
||||
{
|
||||
// pathetic attempt to prevent multiple AI boxers
|
||||
MercPtrs[ gubBoxerID[ uiLoop ] ]->DeleteBoxingFlag();
|
||||
gubBoxerID[ uiLoop ]->DeleteBoxingFlag();
|
||||
}
|
||||
else
|
||||
{
|
||||
pBoxer = MercPtrs[ gubBoxerID[ uiLoop ] ];
|
||||
pBoxer = gubBoxerID[ uiLoop ];
|
||||
// pick this boxer!
|
||||
if ( pBoxer->bActive && pBoxer->bInSector && pBoxer->stats.bLife >= OKLIFE )
|
||||
{
|
||||
@@ -447,7 +445,7 @@ BOOLEAN BoxerAvailable( void )
|
||||
{
|
||||
if ( gubBoxerID[ ubLoop ] != NOBODY && !gfBoxerFought[ ubLoop ] )
|
||||
{
|
||||
if( MercPtrs[ gubBoxerID[ ubLoop ] ]->bActive && MercPtrs[ gubBoxerID[ ubLoop ] ]->bInSector && MercPtrs[ gubBoxerID[ ubLoop ] ]->stats.bLife >= OKLIFE )
|
||||
if( gubBoxerID[ ubLoop ]->bActive && gubBoxerID[ ubLoop ]->bInSector && gubBoxerID[ ubLoop ]->stats.bLife >= OKLIFE )
|
||||
return( TRUE );
|
||||
}
|
||||
}
|
||||
@@ -459,13 +457,13 @@ BOOLEAN BoxerAvailable( void )
|
||||
// SEQUEL FIGHT. Maybe we could check Kingpin's location instead!
|
||||
UINT8 BoxersAvailable( void )
|
||||
{
|
||||
UINT8 ubCount = 0;
|
||||
UINT8 ubCount = 0;
|
||||
|
||||
for (UINT8 ubLoop = 0; ubLoop < NUM_BOXERS; ++ubLoop)
|
||||
{
|
||||
if ( gubBoxerID[ ubLoop ] != NOBODY && !gfBoxerFought[ ubLoop ] )
|
||||
{
|
||||
if( MercPtrs[ gubBoxerID[ ubLoop ] ]->bActive && MercPtrs[ gubBoxerID[ ubLoop ] ]->bInSector && MercPtrs[ gubBoxerID[ ubLoop ] ]->stats.bLife >= OKLIFE )
|
||||
if( gubBoxerID[ ubLoop ]->bActive && gubBoxerID[ ubLoop ]->bInSector && gubBoxerID[ ubLoop ]->stats.bLife >= OKLIFE )
|
||||
++ubCount;
|
||||
}
|
||||
}
|
||||
@@ -479,9 +477,7 @@ BOOLEAN AnotherFightPossible( void )
|
||||
// a player has at least OKLIFE + 5 life
|
||||
|
||||
// and at least one fight HAS occurred
|
||||
UINT8 ubLoop;
|
||||
SOLDIERTYPE * pSoldier;
|
||||
UINT8 ubAvailable;
|
||||
UINT8 ubAvailable;
|
||||
|
||||
ubAvailable = BoxersAvailable();
|
||||
|
||||
@@ -491,9 +487,8 @@ BOOLEAN AnotherFightPossible( void )
|
||||
}
|
||||
|
||||
// Loop through all mercs on player team
|
||||
ubLoop = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
pSoldier = MercPtrs[ ubLoop ];
|
||||
for ( ; ubLoop <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++ubLoop, pSoldier++ )
|
||||
SoldierID pSoldier = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
for ( ; pSoldier <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++pSoldier )
|
||||
{
|
||||
if ( pSoldier->bActive && pSoldier->bInSector && pSoldier->stats.bLife > (OKLIFE + 5) && !pSoldier->bCollapsed )
|
||||
{
|
||||
|
||||
+9
-9
@@ -19,14 +19,14 @@ enum DisqualificationReasons
|
||||
BAD_ATTACK
|
||||
} ;
|
||||
|
||||
extern INT32 gsBoxerGridNo[ NUM_BOXERS ];
|
||||
extern UINT8 gubBoxerID[ NUM_BOXERS ];
|
||||
extern BOOLEAN gfBoxerFought[ NUM_BOXERS ];
|
||||
extern INT8 gbBoxingState;
|
||||
extern BOOLEAN gfLastBoxingMatchWonByPlayer;
|
||||
extern UINT8 gubBoxingMatchesWon;
|
||||
extern UINT8 gubBoxersRests;
|
||||
extern BOOLEAN gfBoxersResting;
|
||||
extern INT32 gsBoxerGridNo[ NUM_BOXERS ];
|
||||
extern SoldierID gubBoxerID[ NUM_BOXERS ];
|
||||
extern BOOLEAN gfBoxerFought[ NUM_BOXERS ];
|
||||
extern INT8 gbBoxingState;
|
||||
extern BOOLEAN gfLastBoxingMatchWonByPlayer;
|
||||
extern UINT8 gubBoxingMatchesWon;
|
||||
extern UINT8 gubBoxersRests;
|
||||
extern BOOLEAN gfBoxersResting;
|
||||
|
||||
extern void BoxingPlayerDisqualified( SOLDIERTYPE * pOffender, INT8 bReason );
|
||||
extern BOOLEAN PickABoxer( void );
|
||||
@@ -43,4 +43,4 @@ extern BOOLEAN BoxerExists( void );
|
||||
extern UINT8 CountPeopleInBoxingRing( void );
|
||||
extern void ClearAllBoxerFlags( void );
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+35
-35
@@ -3,8 +3,8 @@
|
||||
|
||||
#include "types.h"
|
||||
#include "Soldier Control.h"
|
||||
#include "los.h"
|
||||
#include "tile animation.h"
|
||||
#include "LOS.h"
|
||||
#include "Tile Animation.h"
|
||||
|
||||
|
||||
#define BULLET_FLAG_CREATURE_SPIT 0x0001
|
||||
@@ -30,49 +30,49 @@ typedef struct
|
||||
LEVELNODE* pNodes[BULLET_TRACER_MAX_LENGTH];
|
||||
//afp-end
|
||||
INT32 iBullet;
|
||||
UINT8 ubFirerID;
|
||||
UINT8 ubTargetID;
|
||||
INT8 bStartCubesAboveLevelZ;
|
||||
INT8 bEndCubesAboveLevelZ;
|
||||
INT32 sGridNo;
|
||||
SoldierID ubFirerID;
|
||||
SoldierID ubTargetID;
|
||||
INT8 bStartCubesAboveLevelZ;
|
||||
INT8 bEndCubesAboveLevelZ;
|
||||
INT32 sGridNo;
|
||||
INT16 sUnused;
|
||||
UINT16 usLastStructureHit;
|
||||
FIXEDPT qCurrX;
|
||||
FIXEDPT qCurrY;
|
||||
FIXEDPT qCurrZ;
|
||||
FIXEDPT qIncrX;
|
||||
FIXEDPT qIncrY;
|
||||
FIXEDPT qIncrZ;
|
||||
DOUBLE ddHorizAngle;
|
||||
UINT16 usLastStructureHit;
|
||||
FIXEDPT qCurrX;
|
||||
FIXEDPT qCurrY;
|
||||
FIXEDPT qCurrZ;
|
||||
FIXEDPT qIncrX;
|
||||
FIXEDPT qIncrY;
|
||||
FIXEDPT qIncrZ;
|
||||
DOUBLE ddHorizAngle;
|
||||
INT32 iCurrTileX;
|
||||
INT32 iCurrTileY;
|
||||
INT8 bLOSIndexX;
|
||||
INT8 bLOSIndexY;
|
||||
BOOLEAN fCheckForRoof;
|
||||
INT8 bLOSIndexX;
|
||||
INT8 bLOSIndexY;
|
||||
BOOLEAN fCheckForRoof;
|
||||
INT32 iCurrCubesZ;
|
||||
INT32 iLoop;
|
||||
BOOLEAN fAllocated;
|
||||
BOOLEAN fToDelete;
|
||||
BOOLEAN fLocated;
|
||||
BOOLEAN fReal;
|
||||
BOOLEAN fAimed;
|
||||
UINT32 uiLastUpdate;
|
||||
BOOLEAN fAllocated;
|
||||
BOOLEAN fToDelete;
|
||||
BOOLEAN fLocated;
|
||||
BOOLEAN fReal;
|
||||
BOOLEAN fAimed;
|
||||
UINT32 uiLastUpdate;
|
||||
UINT8 ubTilesPerUpdate;
|
||||
UINT16 usClockTicksPerUpdate;
|
||||
SOLDIERTYPE *pFirer; // Flugente: WARNING! We cannot assume this will be valid. Check wether ubFirerID is NOBODY first
|
||||
INT32 sOrigGridNo; // HEADROCK HAM 5.1: Original tile does not necessarily have to be the pFirer's tile
|
||||
INT32 sTargetGridNo;
|
||||
UINT16 usClockTicksPerUpdate;
|
||||
SOLDIERTYPE *pFirer; // Flugente: WARNING! We cannot assume this will be valid. Check wether ubFirerID is NOBODY first
|
||||
INT32 sOrigGridNo; // HEADROCK HAM 5.1: Original tile does not necessarily have to be the pFirer's tile
|
||||
INT32 sTargetGridNo;
|
||||
INT16 sHitBy;
|
||||
INT32 iImpact;
|
||||
INT32 iImpactReduction;
|
||||
INT32 iRange;
|
||||
INT32 iDistanceLimit;
|
||||
UINT16 usFlags;
|
||||
ANITILE *pAniTile;
|
||||
ANITILE *pShadowAniTile;
|
||||
UINT16 usFlags;
|
||||
ANITILE *pAniTile;
|
||||
ANITILE *pShadowAniTile;
|
||||
UINT16 ubItemStatus;
|
||||
UINT16 fromItem;
|
||||
INT32 flash;
|
||||
UINT16 fromItem;
|
||||
INT32 flash;
|
||||
// HEADROCK HAM B2.5: Experimental bullet tracer info. If the new tracer system is activated, this flag tells
|
||||
// the bullet animation functions to create a lightpath for this bullet. This means now all bullets in a tracer
|
||||
// magazine will cause a lightshow (that's the intended result).
|
||||
@@ -83,7 +83,7 @@ typedef struct
|
||||
|
||||
extern UINT32 guiNumBullets;
|
||||
|
||||
INT32 CreateBullet( UINT8 ubFirer, BOOLEAN fFake, UINT16 usFlags,UINT16 fromItem );
|
||||
INT32 CreateBullet( SoldierID ubFirerID, BOOLEAN fFake, UINT16 usFlags,UINT16 fromItem );
|
||||
void RemoveBullet( INT32 iBullet );
|
||||
void StopBullet( INT32 iBullet );
|
||||
void UpdateBullets( );
|
||||
@@ -107,4 +107,4 @@ BOOLEAN SaveBulletStructureToSaveGameFile( HWFILE hFile );
|
||||
BOOLEAN LoadBulletStructureFromSavedGameFile( HWFILE hFile );
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -93,6 +93,7 @@ set(TacticalSrc
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/VehicleMenu.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Weapons.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/World Items.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/XML.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/XML_AmmoStrings.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/XML_AmmoTypes.cpp"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/XML_Armour.cpp"
|
||||
|
||||
+12
-26
@@ -1,17 +1,13 @@
|
||||
#include "builddefines.h"
|
||||
#include <wchar.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "stdlib.h"
|
||||
#include "debug.h"
|
||||
#include "MemMan.h"
|
||||
#include "DEBUG.H"
|
||||
#include "Overhead Types.h"
|
||||
|
||||
#include "random.h"
|
||||
#include "campaign.h"
|
||||
#include "dialogue control.h"
|
||||
#include "Map Screen Interface.h"
|
||||
#include "Message.h"
|
||||
#include "Campaign.h"
|
||||
#include "Dialogue Control.h"
|
||||
#include "Font Control.h"
|
||||
#include "message.h"
|
||||
#include "Game Clock.h"
|
||||
#include "Strategic Mines.h"
|
||||
#include "Strategic Status.h"
|
||||
@@ -22,7 +18,7 @@
|
||||
#include "Interface.h"
|
||||
#include "Game Event Hook.h"
|
||||
#include "Overhead.h"
|
||||
#include "meanwhile.h"
|
||||
#include "Meanwhile.h"
|
||||
#include "Quests.h"
|
||||
#include "Squads.h"
|
||||
#include "Soldier macros.h"
|
||||
@@ -34,22 +30,16 @@
|
||||
#include "Strategic AI.h"
|
||||
#include "interface Dialogue.h"
|
||||
#include "DynamicDialogue.h"
|
||||
#include "email.h"
|
||||
#include "mercs.h"
|
||||
|
||||
#ifdef JA2UB
|
||||
#include "Explosion Control.h"
|
||||
#include "Ja25_Tactical.h"
|
||||
#include "Ja25 Strategic Ai.h"
|
||||
#include "MapScreen Quotes.h"
|
||||
#include "email.h"
|
||||
#include "interface Dialogue.h"
|
||||
#include "mercs.h"
|
||||
#include "ub_config.h"
|
||||
#endif
|
||||
|
||||
#include "GameInitOptionsScreen.h"
|
||||
|
||||
#include "email.h"
|
||||
#include "mercs.h"
|
||||
|
||||
|
||||
//forward declarations of common classes to eliminate includes
|
||||
@@ -1836,13 +1826,9 @@ void TestDumpStatChanges(void)
|
||||
|
||||
void AwardExperienceBonusToActiveSquad( UINT8 ubExpBonusType )
|
||||
{
|
||||
UINT16 usXPs = 0;
|
||||
UINT8 ubGuynum;
|
||||
SOLDIERTYPE *pSoldier;
|
||||
|
||||
|
||||
Assert ( ubExpBonusType < NUM_EXP_BONUS_TYPES );
|
||||
|
||||
UINT16 usXPs = 0;
|
||||
switch ( ubExpBonusType )
|
||||
{
|
||||
case EXP_BONUS_MINIMUM: usXPs = 25; break;
|
||||
@@ -1853,9 +1839,9 @@ void AwardExperienceBonusToActiveSquad( UINT8 ubExpBonusType )
|
||||
}
|
||||
|
||||
// to do: find guys in sector on the currently active squad, those that are conscious get this amount in XPs
|
||||
for ( ubGuynum = gTacticalStatus.Team[ gbPlayerNum ].bFirstID, pSoldier = MercPtrs[ ubGuynum ];
|
||||
ubGuynum <= gTacticalStatus.Team[ gbPlayerNum ].bLastID;
|
||||
ubGuynum++, pSoldier++ )
|
||||
for ( SoldierID pSoldier = gTacticalStatus.Team[ gbPlayerNum ].bFirstID ;
|
||||
pSoldier <= gTacticalStatus.Team[ gbPlayerNum ].bLastID;
|
||||
++pSoldier)
|
||||
{
|
||||
if ( pSoldier->bActive && pSoldier->bInSector && IsMercOnCurrentSquad( pSoldier ) && ( pSoldier->stats.bLife >= CONSCIOUSNESS ) &&
|
||||
!( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) && !AM_A_ROBOT( pSoldier ) )
|
||||
|
||||
+10
-13
@@ -1,34 +1,32 @@
|
||||
#include "builddefines.h"
|
||||
#include <stdio.h>
|
||||
#include "Types.h"
|
||||
#include "civ quotes.h"
|
||||
#include "types.h"
|
||||
#include "Civ Quotes.h"
|
||||
#include "mousesystem.h"
|
||||
#include "strategicmap.h"
|
||||
#include "WCheck.h"
|
||||
#include "FileMan.h"
|
||||
#include "encrypted file.h"
|
||||
#include "Encrypted File.h"
|
||||
#include "MessageBoxScreen.h"
|
||||
#include "Queen Command.h"
|
||||
#include "Overhead.h"
|
||||
#include "render dirty.h"
|
||||
#include "merctextbox.h"
|
||||
#include "Render Dirty.h"
|
||||
#include "MercTextBox.h"
|
||||
#include "ai.h"
|
||||
#include "Text.h"
|
||||
#include "screenids.h"
|
||||
#include "Animation Data.h"
|
||||
#include "Video.h"
|
||||
#include "video.h"
|
||||
#include "Font Control.h"
|
||||
#include "message.h"
|
||||
#include "local.h"
|
||||
#include "renderworld.h"
|
||||
#include "Interface.h"
|
||||
#include "cursors.h"
|
||||
#include "Cursors.h"
|
||||
#include "Dialogue Control.h"
|
||||
#include "Quests.h"
|
||||
#include "Strategic Town Loyalty.h"
|
||||
#include "NPC.h"
|
||||
#include "Strategic Mines.h"
|
||||
#include "Random.h"
|
||||
#include "random.h"
|
||||
#include "connect.h"
|
||||
|
||||
// for enemy taunts
|
||||
@@ -1093,9 +1091,8 @@ BOOLEAN LoadCivQuotesFromLoadGameFile( HWFILE hFile )
|
||||
return( TRUE );
|
||||
}
|
||||
//--------------------------------------------------------------
|
||||
|
||||
// anv: start enemy taunt with probabilty depending on taunt settings
|
||||
void PossiblyStartEnemyTaunt( SOLDIERTYPE *pCiv, TAUNTTYPE iTauntType, UINT32 uiTargetID )
|
||||
void PossiblyStartEnemyTaunt( SOLDIERTYPE *pCiv, TAUNTTYPE iTauntType, SoldierID uiTargetID )
|
||||
{
|
||||
SOLDIERTYPE *pTarget = NULL;
|
||||
if( uiTargetID != NOBODY )
|
||||
@@ -2309,7 +2306,7 @@ BOOLEAN PlayVoiceTaunt(SOLDIERTYPE *pCiv, TAUNTTYPE iTauntType, SOLDIERTYPE *pTa
|
||||
if ((OutFile = fopen("VoiceTauntLog.txt", "a+t")) != NULL)
|
||||
{
|
||||
fprintf(OutFile, "Soldier [%d] TauntType %d %s\n",
|
||||
pCiv->ubID,
|
||||
pCiv->ubID.i,
|
||||
iTauntType,
|
||||
filename);
|
||||
fclose(OutFile);
|
||||
|
||||
@@ -154,7 +154,7 @@ enum TAUNTTYPE//enemy taunts - SANDRO
|
||||
TAUNT_RIPOSTE
|
||||
};
|
||||
|
||||
void PossiblyStartEnemyTaunt( SOLDIERTYPE *pCiv, TAUNTTYPE iTauntType, UINT32 uiTargetID = NOBODY );
|
||||
void PossiblyStartEnemyTaunt( SOLDIERTYPE *pCiv, TAUNTTYPE iTauntType, SoldierID uiTargetID = NOBODY );
|
||||
void StartEnemyTaunt( SOLDIERTYPE *pCiv, TAUNTTYPE iTauntType, SOLDIERTYPE *pTarget = NULL ); //enemy taunts - SANDRO // anv: added pTarget argument
|
||||
void ShowTauntPopupBox( SOLDIERTYPE *pCiv, STR16 gzTauntQuote );
|
||||
|
||||
@@ -179,4 +179,4 @@ void BeginChatQuote( SOLDIERTYPE *pCiv, INT16 sX, INT16 sY );
|
||||
|
||||
BOOLEAN CivQuoteActive();
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+123
-125
@@ -1,72 +1,73 @@
|
||||
#include "sgp.h"
|
||||
//#include "soldier control.h"
|
||||
#include "Encrypted File.h"
|
||||
#include "faces.h"
|
||||
#include "wcheck.h"
|
||||
#include "gap.h"
|
||||
#include "overhead.h"
|
||||
#include "WCheck.h"
|
||||
#include "GAP.H"
|
||||
#include "Overhead.h"
|
||||
#include "Sound Control.h"
|
||||
#include "dialogue control.h"
|
||||
#include "Message.h"
|
||||
#include "render dirty.h"
|
||||
#include "soldier profile.h"
|
||||
#include "wordwrap.h"
|
||||
#include "Dialogue Control.h"
|
||||
#include "message.h"
|
||||
#include "Render Dirty.h"
|
||||
#include "Soldier Profile.h"
|
||||
#include "WordWrap.h"
|
||||
#include "sysutil.h"
|
||||
#include "vobject_blitters.h"
|
||||
#include "AimMembers.h"
|
||||
#include "mercs.h"
|
||||
#include "interface dialogue.h"
|
||||
#include "merctextbox.h"
|
||||
#include "interface Dialogue.h"
|
||||
#include "MercTextBox.h"
|
||||
#include "renderworld.h"
|
||||
#include "soldier macros.h"
|
||||
#include "squads.h"
|
||||
#include "Soldier macros.h"
|
||||
#include "Squads.h"
|
||||
#include "screenids.h"
|
||||
#include "interface utils.h"
|
||||
#include "Interface Utils.h"
|
||||
#include "strategicmap.h"
|
||||
#include "PreBattle Interface.h"
|
||||
#include "Game Clock.h"
|
||||
#include "Quests.h"
|
||||
#include "cursors.h"
|
||||
#include "Cursors.h"
|
||||
#include "gamescreen.h"
|
||||
#include "Random.h"
|
||||
#include "random.h"
|
||||
#include "Map Screen Helicopter.h"
|
||||
#include "GameSettings.h"
|
||||
#include "ShopKeeper Interface.h"
|
||||
#include "Map Screen Interface.h"
|
||||
#include "text.h"
|
||||
#include "Text.h"
|
||||
#include "Merc Contract.h"
|
||||
#include "Town Militia.h"
|
||||
#include "meanwhile.h"
|
||||
#include "SkillCheck.h"
|
||||
#include "Interface Control.h"
|
||||
#include "finances.h"
|
||||
#include "civ quotes.h"
|
||||
#include "Civ Quotes.h"
|
||||
#include "Map Screen Interface Map.h"
|
||||
#include "opplist.h"
|
||||
#include "ai.h"
|
||||
#include "worldman.h"
|
||||
#include "Map Screen Interface Bottom.h"
|
||||
#include "Campaign.h"
|
||||
#include "end game.h"
|
||||
#include "los.h"
|
||||
#include "End Game.h"
|
||||
#include "LOS.h"
|
||||
#include "qarray.h"
|
||||
#include "Soldier Profile.h"
|
||||
#include <vector>
|
||||
#include <queue>
|
||||
#include "Auto Resolve.h"
|
||||
|
||||
#include "connect.h"
|
||||
|
||||
#ifndef JA2UB
|
||||
#include "Town Militia.h"
|
||||
#include "Meanwhile.h"
|
||||
#endif // !JA2UB
|
||||
|
||||
|
||||
#ifdef JA2UB
|
||||
#include "Intro.h"
|
||||
#include "MapScreen Quotes.h"
|
||||
#include "Ja25 Strategic Ai.h"
|
||||
#include "Ja25_Tactical.h"
|
||||
#include "Animation Control.h"
|
||||
#include "ub_config.h"
|
||||
#endif
|
||||
|
||||
#include "ub_config.h"
|
||||
|
||||
#include "history.h"
|
||||
#include <language.hpp>
|
||||
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
@@ -172,7 +173,7 @@ UINT8 gubNumStopTimeQuotes = 2;
|
||||
std::queue<DIALOGUE_Q_STRUCT> ghDialogueQ;
|
||||
|
||||
FACETYPE *gpCurrentTalkingFace = NULL;
|
||||
UINT8 gubCurrentTalkingID = NO_PROFILE;
|
||||
UINT16 gubCurrentTalkingID = NO_PROFILE;
|
||||
INT8 gbUIHandlerID;
|
||||
|
||||
INT32 giNPCReferenceCount = 0;
|
||||
@@ -202,7 +203,7 @@ void RenderSubtitleBoxOverlay( VIDEO_OVERLAY *pBlitter );
|
||||
void RenderFaceOverlay( VIDEO_OVERLAY *pBlitter );
|
||||
|
||||
|
||||
extern BOOLEAN ContinueDialogue(SOLDIERTYPE *pSoldier, BOOLEAN fDone );
|
||||
extern BOOLEAN ContinueDialogue(SoldierID id, BOOLEAN fDone );
|
||||
extern void HandlePendingInitConv( );
|
||||
extern BOOLEAN WillMercRenew( SOLDIERTYPE *pSoldier, BOOLEAN fSayQuote );
|
||||
extern void DrawFace( INT16 sCharNumber );
|
||||
@@ -252,7 +253,7 @@ void HandleExternNPCSpeechFace( INT32 iIndex );
|
||||
|
||||
|
||||
|
||||
extern BOOLEAN ContinueDialogue(SOLDIERTYPE *pSoldier, BOOLEAN fDone );
|
||||
extern BOOLEAN ContinueDialogue(SoldierID id, BOOLEAN fDone );
|
||||
extern BOOLEAN DoSkiMessageBox( UINT8 ubStyle, STR16 zString, UINT32 uiExitScreen, UINT8 ubFlags, MSGBOX_CALLBACK ReturnCallback );
|
||||
|
||||
|
||||
@@ -465,6 +466,22 @@ void HandleDialogueUIAdjustments( )
|
||||
}
|
||||
|
||||
|
||||
// Flugente: additional dialogue
|
||||
extern void LuaHandleAdditionalDialogue(INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, UINT8 ubProfile, INT32 iFaceIndex, UINT16 usEventNr, UINT32 aData1, UINT32 aData2, UINT32 aData3);
|
||||
|
||||
static BOOLEAN ExecuteAdditionalCharacterDialogue(UINT8 ubProfile, INT32 iFaceIndex, UINT16 usEventNr, UINT32 aData1, UINT32 aData2, UINT32 aData3)
|
||||
{
|
||||
SOLDIERTYPE* pSoldier = FindSoldierByProfileID(ubProfile, TRUE);
|
||||
|
||||
if ( !pSoldier )
|
||||
return FALSE;
|
||||
|
||||
// call Lua script on whether we can play something here, and get text and sound file
|
||||
LuaHandleAdditionalDialogue(pSoldier->sSectorX, pSoldier->sSectorY, pSoldier->bSectorZ, ubProfile, iFaceIndex, usEventNr, aData1, aData2, aData3);
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
|
||||
void HandleDialogue( )
|
||||
{
|
||||
@@ -473,7 +490,6 @@ void HandleDialogue( )
|
||||
BOOLEAN fDoneTalking = FALSE;
|
||||
SOLDIERTYPE *pSoldier = NULL;
|
||||
CHAR16 zText[ 512 ];
|
||||
CHAR16 zMoney[128];
|
||||
|
||||
// we don't want to just delay action of some events, we want to pause the whole queue, regardless of the event
|
||||
if( gfDialogueQueuePaused )
|
||||
@@ -657,13 +673,13 @@ void HandleDialogue( )
|
||||
{
|
||||
if( gfMorrisShouldSayHi )
|
||||
{
|
||||
SOLDIERTYPE * pMorris;
|
||||
SOLDIERTYPE * pSoldier;
|
||||
INT16 sPlayerGridNo;
|
||||
UINT8 ubPlayerID;
|
||||
UINT8 ubQualifiedSoldierIDArray[ NUM_MERCS_WITH_NEW_QUOTES ];
|
||||
UINT8 ubNumQualifiedMercs=0;
|
||||
UINT8 ubCnt=0;
|
||||
SOLDIERTYPE *pMorris;
|
||||
SOLDIERTYPE *pSoldier;
|
||||
INT16 sPlayerGridNo;
|
||||
SoldierID ubPlayerID;
|
||||
SoldierID ubQualifiedSoldierIDArray[ NUM_MERCS_WITH_NEW_QUOTES ];
|
||||
UINT8 ubNumQualifiedMercs=0;
|
||||
UINT8 ubCnt=0;
|
||||
|
||||
if( !( gMercProfiles[ MORRIS_UB ].ubMiscFlags2 & PROFILE_MISC_FLAG2_SAID_FIRSTSEEN_QUOTE ) )
|
||||
{
|
||||
@@ -676,7 +692,7 @@ void HandleDialogue( )
|
||||
ubPlayerID = WhoIsThere2( sPlayerGridNo, 0 );
|
||||
if (ubPlayerID != NOBODY)
|
||||
{
|
||||
InitiateConversation( pMorris, MercPtrs[ ubPlayerID ], NPC_INITIAL_QUOTE, 0 );
|
||||
InitiateConversation( pMorris, ubPlayerID, NPC_INITIAL_QUOTE, 0 );
|
||||
gMercProfiles[ pMorris->ubProfile ].ubMiscFlags2 |= PROFILE_MISC_FLAG2_SAID_FIRSTSEEN_QUOTE;
|
||||
}
|
||||
}
|
||||
@@ -693,7 +709,7 @@ void HandleDialogue( )
|
||||
//loop through all the mercs
|
||||
for( ubCnt=0; ubCnt<ubNumQualifiedMercs; ++ubCnt )
|
||||
{
|
||||
pSoldier = MercPtrs[ ubQualifiedSoldierIDArray[ ubCnt ] ];
|
||||
pSoldier = ubQualifiedSoldierIDArray[ ubCnt ];
|
||||
|
||||
TacticalCharacterDialogue( pSoldier, QUOTE_JOINING_CAUSE_LEARNED_TO_LIKE_BUDDY_ON_TEAM );
|
||||
pSoldier->usQuoteSaidExtFlags |= SOLDIER_QUOTE_SAID_EXT_MORRIS;
|
||||
@@ -719,7 +735,7 @@ void HandleDialogue( )
|
||||
{
|
||||
SOLDIERTYPE * pMike;
|
||||
INT32 sPlayerGridNo;
|
||||
UINT8 ubPlayerID;
|
||||
UINT16 ubPlayerID;
|
||||
|
||||
pMike = FindSoldierByProfileID( MIKE, FALSE );
|
||||
if ( pMike )
|
||||
@@ -900,11 +916,11 @@ void HandleDialogue( )
|
||||
}
|
||||
else if ( QItem.uiSpecialEventFlag & DIALOGUE_SPECIAL_EVENT_CONTRACT_WANTS_TO_RENEW )
|
||||
{
|
||||
HandleMercIsWillingToRenew( (UINT8)QItem.uiSpecialEventData );
|
||||
HandleMercIsWillingToRenew( (UINT16)QItem.uiSpecialEventData );
|
||||
}
|
||||
else if ( QItem.uiSpecialEventFlag & DIALOGUE_SPECIAL_EVENT_CONTRACT_NOGO_TO_RENEW )
|
||||
{
|
||||
HandleMercIsNotWillingToRenew( (UINT8)QItem.uiSpecialEventData );
|
||||
HandleMercIsNotWillingToRenew( (UINT16)QItem.uiSpecialEventData );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -977,7 +993,7 @@ void HandleDialogue( )
|
||||
gTacticalStatus.fLockItemLocators = FALSE;
|
||||
|
||||
// Slide to location!
|
||||
SlideToLocation( 0, QItem.uiSpecialEventData );
|
||||
SlideToLocation( QItem.uiSpecialEventData );
|
||||
|
||||
// Flugente: only set up face if we can access correctly
|
||||
if ( QItem.iFaceIndex >= 0 )
|
||||
@@ -1054,38 +1070,36 @@ void HandleDialogue( )
|
||||
|
||||
if ( QItem.uiSpecialEventFlag & DIALOGUE_SPECIAL_EVENT_SHOPKEEPER )
|
||||
{
|
||||
std::wstring zMoney{};
|
||||
if( QItem.uiSpecialEventData < 3 )
|
||||
{
|
||||
// post a notice if the player wants to withdraw money from thier account to cover the difference?
|
||||
swprintf( zMoney, L"%d", QItem.uiSpecialEventData2 );
|
||||
InsertCommasForDollarFigure( zMoney );
|
||||
InsertDollarSignInToString( zMoney );
|
||||
zMoney = FormatMoney(QItem.uiSpecialEventData2);
|
||||
}
|
||||
else if ( QItem.uiSpecialEventData > 7 )
|
||||
{
|
||||
// post a notice if the player wants to withdraw money from thier account to cover the difference?
|
||||
swprintf( zMoney, L"%d", QItem.uiSpecialEventData2 );
|
||||
InsertCommasForDollarFigure( zMoney );
|
||||
zMoney = FormatMoney(QItem.uiSpecialEventData2);
|
||||
}
|
||||
|
||||
switch( QItem.uiSpecialEventData )
|
||||
{
|
||||
case( 0 ):
|
||||
swprintf( zText, SkiMessageBoxText[ SKI_SHORT_FUNDS_TEXT ], zMoney );
|
||||
swprintf( zText, SkiMessageBoxText[ SKI_SHORT_FUNDS_TEXT ], zMoney.data() );
|
||||
|
||||
//popup a message stating the player doesnt have enough money
|
||||
DoSkiMessageBox( MSG_BOX_BASIC_STYLE, zText, SHOPKEEPER_SCREEN, MSG_BOX_FLAG_OK, ConfirmDontHaveEnoughForTheDealerMessageBoxCallBack );
|
||||
break;
|
||||
case( 1 ):
|
||||
//if the player is trading items
|
||||
swprintf( zText, SkiMessageBoxText[ SKI_QUESTION_TO_DEDUCT_MONEY_FROM_PLAYERS_ACCOUNT_TO_COVER_DIFFERENCE ], zMoney );
|
||||
swprintf( zText, SkiMessageBoxText[ SKI_QUESTION_TO_DEDUCT_MONEY_FROM_PLAYERS_ACCOUNT_TO_COVER_DIFFERENCE ], zMoney.data() );
|
||||
|
||||
//ask them if we should deduct money out the players account to cover the difference
|
||||
DoSkiMessageBox( MSG_BOX_BASIC_STYLE, zText, SHOPKEEPER_SCREEN, MSG_BOX_FLAG_YESNO, ConfirmToDeductMoneyFromPlayersAccountMessageBoxCallBack );
|
||||
|
||||
break;
|
||||
case( 2 ):
|
||||
swprintf( zText, SkiMessageBoxText[ SKI_QUESTION_TO_DEDUCT_MONEY_FROM_PLAYERS_ACCOUNT_TO_COVER_COST ], zMoney );
|
||||
swprintf( zText, SkiMessageBoxText[ SKI_QUESTION_TO_DEDUCT_MONEY_FROM_PLAYERS_ACCOUNT_TO_COVER_COST ], zMoney.data() );
|
||||
|
||||
//ask them if we should deduct money out the players account to cover the difference
|
||||
DoSkiMessageBox( MSG_BOX_BASIC_STYLE, zText, SHOPKEEPER_SCREEN, MSG_BOX_FLAG_YESNO, ConfirmToDeductMoneyFromPlayersAccountMessageBoxCallBack );
|
||||
@@ -1118,7 +1132,7 @@ void HandleDialogue( )
|
||||
|
||||
case 8:
|
||||
//if the player is trading items
|
||||
swprintf( zText, SkiMessageBoxText[SKI_QUESTION_TO_DEDUCT_INTEL_FROM_PLAYERS_ACCOUNT_TO_COVER_DIFFERENCE], zMoney );
|
||||
swprintf( zText, SkiMessageBoxText[SKI_QUESTION_TO_DEDUCT_INTEL_FROM_PLAYERS_ACCOUNT_TO_COVER_DIFFERENCE], zMoney.data() );
|
||||
|
||||
//ask them if we should deduct money out the players account to cover the difference
|
||||
DoSkiMessageBox( MSG_BOX_BASIC_STYLE, zText, SHOPKEEPER_SCREEN, MSG_BOX_FLAG_YESNO, ConfirmToDeductIntelFromPlayersAccountMessageBoxCallBack );
|
||||
@@ -1126,7 +1140,7 @@ void HandleDialogue( )
|
||||
break;
|
||||
|
||||
case 9:
|
||||
swprintf( zText, SkiMessageBoxText[SKI_QUESTION_TO_DEDUCT_INTEL_FROM_PLAYERS_ACCOUNT_TO_COVER_COST], zMoney );
|
||||
swprintf( zText, SkiMessageBoxText[SKI_QUESTION_TO_DEDUCT_INTEL_FROM_PLAYERS_ACCOUNT_TO_COVER_COST], zMoney.data() );
|
||||
|
||||
//ask them if we should deduct money out the players account to cover the difference
|
||||
DoSkiMessageBox( MSG_BOX_BASIC_STYLE, zText, SHOPKEEPER_SCREEN, MSG_BOX_FLAG_YESNO, ConfirmToDeductIntelFromPlayersAccountMessageBoxCallBack );
|
||||
@@ -1333,8 +1347,6 @@ void HandleDialogue( )
|
||||
|
||||
gubCurrentTalkingID = QItem.iFaceIndex;
|
||||
|
||||
extern BOOLEAN ExecuteAdditionalCharacterDialogue( UINT8 ubProfile, INT32 iFaceIndex, UINT16 usEventNr, UINT32 aData1, UINT32 aData2, UINT32 aData3 );
|
||||
|
||||
ExecuteAdditionalCharacterDialogue( QItem.ubCharacterNum, QItem.iFaceIndex, QItem.usQuoteNum, QItem.uiSpecialEventData2, QItem.uiSpecialEventData3, QItem.uiSpecialEventData4 );
|
||||
}
|
||||
|
||||
@@ -1344,10 +1356,10 @@ void HandleDialogue( )
|
||||
{
|
||||
HandleEveryoneDoneTheirEndGameQuotes();
|
||||
}
|
||||
else
|
||||
else if ( QItem.uiSpecialEventData & MULTIPURPOSE_SPECIAL_EVENT_GETUP_AFTER_HELI_CRASH )
|
||||
{
|
||||
// grab soldier ptr from profile ID
|
||||
pSoldier = FindSoldierByProfileID( (UINT8)QItem.uiSpecialEventData, FALSE );
|
||||
pSoldier = FindSoldierByProfileID( (UINT8)QItem.uiSpecialEventData2, FALSE );
|
||||
|
||||
// FindSoldier was returning a lot of nullptrs which would crash the game very quickly after Jerry gets up. This check is here to circumvent that.
|
||||
if (pSoldier != nullptr)
|
||||
@@ -1595,7 +1607,7 @@ BOOLEAN TacticalCharacterDialogue( SOLDIERTYPE *pSoldier, UINT16 usQuoteNum )
|
||||
{
|
||||
if ( pSoldier->CanRobotBeControlled( ) )
|
||||
{
|
||||
return( TacticalCharacterDialogue( MercPtrs[ pSoldier->ubRobotRemoteHolderID ], usQuoteNum ) );
|
||||
return( TacticalCharacterDialogue( pSoldier->ubRobotRemoteHolderID, usQuoteNum ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1759,9 +1771,10 @@ void AdditionalTacticalCharacterDialogue_AllInSector(INT16 aSectorX, INT16 aSect
|
||||
UINT16 usEventNr, UINT32 aData1, UINT32 aData2, UINT32 aData3, INT32 aAroundGridno, INT32 aRadius )
|
||||
{
|
||||
SOLDIERTYPE* pSoldier;
|
||||
int cnt = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||
for ( pSoldier = MercPtrs[cnt]; cnt <= gTacticalStatus.Team[gbPlayerNum].bLastID; ++cnt, pSoldier++ )
|
||||
SoldierID cnt = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||
for ( ; cnt <= gTacticalStatus.Team[gbPlayerNum].bLastID; ++cnt )
|
||||
{
|
||||
pSoldier = cnt;
|
||||
if ( pSoldier->stats.bLife >= OKLIFE && pSoldier->bActive &&
|
||||
pSoldier->ubProfile != ausIgnoreProfile &&
|
||||
pSoldier->sSectorX == aSectorX && pSoldier->sSectorY == aSectorY && pSoldier->bSectorZ == aSectorZ &&
|
||||
@@ -1887,7 +1900,7 @@ BOOLEAN CharacterDialogue( UINT8 ubCharacterNum, UINT16 usQuoteNum, INT32 iFaceI
|
||||
{
|
||||
if ( gusSelectedSoldier != NOBODY )
|
||||
{
|
||||
AdditionalTacticalCharacterDialogue_CallsLua( MercPtrs[gusSelectedSoldier], ADE_DIALOGUE_REACTION, ubCharacterNum, usQuoteNum, ( gMercProfiles[ubCharacterNum].ubMiscFlags & PROFILE_MISC_FLAG_RECRUITED ) ? 1 : 0 );
|
||||
AdditionalTacticalCharacterDialogue_CallsLua( gusSelectedSoldier, ADE_DIALOGUE_REACTION, ubCharacterNum, usQuoteNum, ( gMercProfiles[ubCharacterNum].ubMiscFlags & PROFILE_MISC_FLAG_RECRUITED ) ? 1 : 0 );
|
||||
}
|
||||
}
|
||||
// if team members talk, anyone may answer
|
||||
@@ -1992,7 +2005,7 @@ BOOLEAN SpecialCharacterDialogueEventWithExtraParam( UINT32 uiSpecialEventFlag,
|
||||
}
|
||||
|
||||
extern INT8 gbSelectedArmsDealerID;
|
||||
extern UINT8 gusIDOfCivTrader;
|
||||
extern SoldierID gusIDOfCivTrader;
|
||||
|
||||
BOOLEAN ExecuteCharacterDialogue( UINT8 ubCharacterNum, UINT16 usQuoteNum, INT32 iFaceIndex, UINT8 bUIHandlerID, BOOLEAN fFromSoldier )
|
||||
{
|
||||
@@ -2107,7 +2120,7 @@ BOOLEAN ExecuteCharacterDialogue( UINT8 ubCharacterNum, UINT16 usQuoteNum, INT32
|
||||
&& iFaceIndex == -1
|
||||
&& gusIDOfCivTrader != NOBODY )
|
||||
{
|
||||
SOLDIERTYPE* pShopkeeper = MercPtrs[gusIDOfCivTrader];
|
||||
SOLDIERTYPE* pShopkeeper = gusIDOfCivTrader;
|
||||
|
||||
if ( pShopkeeper )
|
||||
{
|
||||
@@ -2181,21 +2194,6 @@ BOOLEAN ExecuteSnitchCharacterDialogue( UINT8 ubCharacterNum, UINT16 usQuoteNum,
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
// Flugente: additional dialogue
|
||||
extern void LuaHandleAdditionalDialogue( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ, UINT8 ubProfile, INT32 iFaceIndex, UINT16 usEventNr, UINT32 aData1, UINT32 aData2, UINT32 aData3 );
|
||||
|
||||
BOOLEAN ExecuteAdditionalCharacterDialogue( UINT8 ubProfile, INT32 iFaceIndex, UINT16 usEventNr, UINT32 aData1, UINT32 aData2, UINT32 aData3 )
|
||||
{
|
||||
SOLDIERTYPE *pSoldier = FindSoldierByProfileID( ubProfile, TRUE );
|
||||
|
||||
if ( !pSoldier )
|
||||
return FALSE;
|
||||
|
||||
// call Lua script on whether we can play something here, and get text and sound file
|
||||
LuaHandleAdditionalDialogue( pSoldier->sSectorX, pSoldier->sSectorY, pSoldier->bSectorZ, ubProfile, iFaceIndex, usEventNr, aData1, aData2, aData3 );
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
void SetQuoteStr( STR16 aStr )
|
||||
{
|
||||
@@ -2307,7 +2305,7 @@ void CreateTalkingUI( INT8 bUIHandlerID, INT32 iFaceIndex, UINT8 ubCharacterNum,
|
||||
}
|
||||
|
||||
|
||||
CHAR8 *GetDialogueDataFilename( UINT8 ubCharacterNum, UINT16 usQuoteNum, BOOLEAN fWavFile )
|
||||
static CHAR8 *GetDialogueDataFilename( UINT8 ubCharacterNum, UINT16 usQuoteNum, BOOLEAN fWavFile )
|
||||
{
|
||||
static CHAR8 zFileName[164];
|
||||
static CHAR8 zFileNameHelper[164];
|
||||
@@ -2407,8 +2405,8 @@ CHAR8 *GetDialogueDataFilename( UINT8 ubCharacterNum, UINT16 usQuoteNum, BOOLEAN
|
||||
{
|
||||
if ( fWavFile )
|
||||
{
|
||||
#ifdef RUSSIAN
|
||||
if ( ( gMercProfiles[ubCharacterNum].Type == PROFILETYPE_RPC ||
|
||||
if ( g_lang == i18n::Lang::ru &&
|
||||
( gMercProfiles[ubCharacterNum].Type == PROFILETYPE_RPC ||
|
||||
gMercProfiles[ubCharacterNum].Type == PROFILETYPE_NPC ||
|
||||
gMercProfiles[ubCharacterNum].Type == PROFILETYPE_VEHICLE ) && gMercProfiles[ ubCharacterNum ].ubMiscFlags & PROFILE_MISC_FLAG_RECRUITED )
|
||||
{
|
||||
@@ -2426,7 +2424,7 @@ CHAR8 *GetDialogueDataFilename( UINT8 ubCharacterNum, UINT16 usQuoteNum, BOOLEAN
|
||||
#endif
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
||||
{
|
||||
// build name of wav file (characternum + quotenum)
|
||||
sprintf( zFileNameHelper, "SPEECH\\%03d_%03d", usVoiceSet, usQuoteNum );
|
||||
@@ -2445,7 +2443,7 @@ CHAR8 *GetDialogueDataFilename( UINT8 ubCharacterNum, UINT16 usQuoteNum, BOOLEAN
|
||||
return( zFileName );
|
||||
}
|
||||
|
||||
CHAR8 *GetSnitchDialogueDataFilename( UINT8 ubCharacterNum, UINT16 usQuoteNum, BOOLEAN fWavFile, BOOLEAN fName )
|
||||
static CHAR8 *GetSnitchDialogueDataFilename( UINT8 ubCharacterNum, UINT16 usQuoteNum, BOOLEAN fWavFile, BOOLEAN fName )
|
||||
{
|
||||
static CHAR8 zFileName[164];
|
||||
static CHAR8 zFilename_Used[164];
|
||||
@@ -2494,7 +2492,7 @@ BOOLEAN DialogueDataFileExistsForProfile( UINT8 ubCharacterNum, UINT16 usQuoteNu
|
||||
return( FileExists( pFilename ) );
|
||||
}
|
||||
|
||||
BOOLEAN SnitchDialogueDataFileExistsForProfile( UINT8 ubCharacterNum, UINT16 usQuoteNum, BOOLEAN fWavFile, STR8 *ppStr, BOOLEAN fName )
|
||||
static BOOLEAN SnitchDialogueDataFileExistsForProfile( UINT8 ubCharacterNum, UINT16 usQuoteNum, BOOLEAN fWavFile, STR8 *ppStr, BOOLEAN fName )
|
||||
{
|
||||
STR8 pFilename;
|
||||
|
||||
@@ -3003,10 +3001,9 @@ void HandleTacticalSpeechUI( UINT8 ubCharacterNum, INT32 iFaceIndex )
|
||||
// If so, set current guy active to talk.....
|
||||
if ( pSoldier != NULL )
|
||||
{
|
||||
ContinueDialogue( pSoldier, FALSE );
|
||||
ContinueDialogue( pSoldier->ubID, FALSE );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -3110,29 +3107,29 @@ void HandleDialogueEnd( FACETYPE *pFace )
|
||||
SOLDIERTYPE *pSoldier = FindSoldierByProfileID( gTacticalStatus.ubLastQuoteProfileNUm, FALSE );
|
||||
if ( pSoldier )
|
||||
{
|
||||
UINT8 ubSeenEnemies[ MAX_NUM_SOLDIERS ];
|
||||
UINT8 ubSeenEnemiesCnt = 0;
|
||||
UINT16 ubSeenEnemies[ MAX_NUM_SOLDIERS ];
|
||||
UINT16 ubSeenEnemiesCnt = 0;
|
||||
switch( gTacticalStatus.ubLastQuoteSaid )
|
||||
{
|
||||
case QUOTE_CLOSE_CALL:
|
||||
case QUOTE_UNDER_HEAVY_FIRE:
|
||||
case QUOTE_TAKEN_A_BREATING:
|
||||
if( pSoldier->ubPreviousAttackerID != NOBODY && !( MercPtrs[pSoldier->ubPreviousAttackerID]->bDeafenedCounter > 0 ) )
|
||||
PossiblyStartEnemyTaunt( MercPtrs[pSoldier->ubPreviousAttackerID], TAUNT_RIPOSTE, gTacticalStatus.ubLastQuoteProfileNUm );
|
||||
if( pSoldier->ubPreviousAttackerID != NOBODY && !( pSoldier->ubPreviousAttackerID->bDeafenedCounter > 0 ) )
|
||||
PossiblyStartEnemyTaunt( pSoldier->ubPreviousAttackerID, TAUNT_RIPOSTE, pSoldier->ubID );
|
||||
break;
|
||||
default:
|
||||
// select random enemy, who we see, who sees us and isn't deaf
|
||||
for(UINT8 cnt = gTacticalStatus.Team[ ENEMY_TEAM ].bFirstID; cnt <= gTacticalStatus.Team[ ENEMY_TEAM ].bLastID ; cnt++ )
|
||||
for( SoldierID cnt = gTacticalStatus.Team[ ENEMY_TEAM ].bFirstID; cnt <= gTacticalStatus.Team[ ENEMY_TEAM ].bLastID ; ++cnt )
|
||||
{
|
||||
if( MercPtrs[cnt] != NULL && MercPtrs[cnt]->aiData.bOppList[pSoldier->ubID] == SEEN_CURRENTLY
|
||||
&& MercPtrs[pSoldier->ubID]->aiData.bOppList[cnt] == SEEN_CURRENTLY && !( MercPtrs[cnt]->bDeafenedCounter > 0 ) )
|
||||
if( cnt->aiData.bOppList[pSoldier->ubID] == SEEN_CURRENTLY
|
||||
&& pSoldier->ubID->aiData.bOppList[cnt] == SEEN_CURRENTLY && !( cnt->bDeafenedCounter > 0 ) )
|
||||
{
|
||||
ubSeenEnemies[ubSeenEnemiesCnt] = cnt;
|
||||
ubSeenEnemiesCnt++;
|
||||
}
|
||||
}
|
||||
if( ubSeenEnemiesCnt > 0 )
|
||||
PossiblyStartEnemyTaunt( MercPtrs[ubSeenEnemies[ Random(ubSeenEnemiesCnt) ]], TAUNT_RIPOSTE, gTacticalStatus.ubLastQuoteProfileNUm );
|
||||
PossiblyStartEnemyTaunt( MercPtrs[ubSeenEnemies[ Random(ubSeenEnemiesCnt) ]], TAUNT_RIPOSTE, pSoldier->ubID );
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -3293,20 +3290,20 @@ void RenderSubtitleBoxOverlay( VIDEO_OVERLAY *pBlitter )
|
||||
void SayQuoteFromAnyBodyInSector( UINT16 usQuoteNum )
|
||||
{
|
||||
// WDS - make number of mercenaries, etc. be configurable
|
||||
std::vector<UINT8> ubMercsInSector (CODE_MAXIMUM_NUMBER_OF_PLAYER_MERCS, 0);
|
||||
UINT8 ubNumMercs = 0;
|
||||
UINT8 ubChosenMerc;
|
||||
std::vector<UINT16> ubMercsInSector (CODE_MAXIMUM_NUMBER_OF_PLAYER_MERCS, 0);
|
||||
UINT16 ubNumMercs = 0;
|
||||
UINT16 ubChosenMerc;
|
||||
SOLDIERTYPE *pTeamSoldier;
|
||||
INT32 cnt;
|
||||
|
||||
// Loop through all our guys and randomly say one from someone in our sector
|
||||
|
||||
// set up soldier ptr as first element in mercptrs list
|
||||
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
SoldierID id = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
|
||||
// run through list
|
||||
for ( pTeamSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; cnt++,pTeamSoldier++ )
|
||||
for ( ; id <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++id )
|
||||
{
|
||||
pTeamSoldier = id;
|
||||
// Add guy if he's a candidate...
|
||||
if ( OK_INSECTOR_MERC( pTeamSoldier ) && !AM_AN_EPC( pTeamSoldier ) && !( pTeamSoldier->flags.uiStatusFlags & SOLDIER_GASSED ) && !(AM_A_ROBOT( pTeamSoldier )) && !pTeamSoldier->flags.fMercAsleep )
|
||||
{
|
||||
@@ -3329,7 +3326,7 @@ void SayQuoteFromAnyBodyInSector( UINT16 usQuoteNum )
|
||||
#endif
|
||||
}
|
||||
|
||||
ubMercsInSector[ ubNumMercs ] = (UINT8)cnt;
|
||||
ubMercsInSector[ ubNumMercs ] = (UINT16)id;
|
||||
ubNumMercs++;
|
||||
}
|
||||
}
|
||||
@@ -3337,16 +3334,16 @@ void SayQuoteFromAnyBodyInSector( UINT16 usQuoteNum )
|
||||
// If we are > 0
|
||||
if ( ubNumMercs > 0 )
|
||||
{
|
||||
ubChosenMerc = (UINT8)Random( ubNumMercs );
|
||||
ubChosenMerc = (UINT16)Random( ubNumMercs );
|
||||
|
||||
// If we are air raid, AND red exists somewhere...
|
||||
if ( usQuoteNum == QUOTE_AIR_RAID )
|
||||
{
|
||||
for ( cnt = 0; cnt < ubNumMercs; cnt++ )
|
||||
for ( UINT16 cnt = 0; cnt < ubNumMercs; cnt++ )
|
||||
{
|
||||
if ( ubMercsInSector[ cnt ] == 11 )
|
||||
{
|
||||
ubChosenMerc = (UINT8)cnt;
|
||||
ubChosenMerc = (UINT16)cnt;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -3366,22 +3363,22 @@ void SayQuoteFromAnyBodyInThisSector( INT16 sSectorX, INT16 sSectorY, INT8 bSect
|
||||
UINT16 ubNumMercs = 0;
|
||||
UINT16 ubChosenMerc;
|
||||
SOLDIERTYPE *pTeamSoldier;
|
||||
INT32 cnt;
|
||||
|
||||
// Loop through all our guys and randomly say one from someone in our sector
|
||||
|
||||
// set up soldier ptr as first element in mercptrs list
|
||||
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
SoldierID cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
|
||||
// run through list
|
||||
for ( pTeamSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; cnt++,pTeamSoldier++ )
|
||||
for ( ; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++cnt )
|
||||
{
|
||||
pTeamSoldier = cnt;
|
||||
if ( pTeamSoldier->bActive )
|
||||
{
|
||||
// Add guy if he's a candidate...
|
||||
if( pTeamSoldier->sSectorX == sSectorX && pTeamSoldier->sSectorY == sSectorY && pTeamSoldier->bSectorZ == bSectorZ && !AM_AN_EPC( pTeamSoldier ) && !( pTeamSoldier->flags.uiStatusFlags & SOLDIER_GASSED ) && !(AM_A_ROBOT( pTeamSoldier )) && !pTeamSoldier->flags.fMercAsleep )
|
||||
{
|
||||
ubMercsInSector[ ubNumMercs ] = (UINT8)cnt;
|
||||
ubMercsInSector[ ubNumMercs ] = (UINT16)cnt;
|
||||
++ubNumMercs;
|
||||
}
|
||||
}
|
||||
@@ -3415,20 +3412,20 @@ void SayQuoteFromAnyBodyInThisSector( INT16 sSectorX, INT16 sSectorY, INT8 bSect
|
||||
void SayQuoteFromNearbyMercInSector( INT32 sGridNo, INT8 bDistance, UINT16 usQuoteNum )
|
||||
{
|
||||
// WDS - make number of mercenaries, etc. be configurable
|
||||
std::vector<UINT8> ubMercsInSector (CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS, 0 );
|
||||
UINT8 ubNumMercs = 0;
|
||||
UINT8 ubChosenMerc;
|
||||
std::vector<UINT16> ubMercsInSector (CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS, 0 );
|
||||
UINT16 ubNumMercs = 0;
|
||||
UINT16 ubChosenMerc;
|
||||
SOLDIERTYPE *pTeamSoldier;
|
||||
INT32 cnt;
|
||||
|
||||
// Loop through all our guys and randomly say one from someone in our sector
|
||||
|
||||
// set up soldier ptr as first element in mercptrs list
|
||||
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
SoldierID cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
|
||||
// run through list
|
||||
for ( pTeamSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; cnt++,pTeamSoldier++ )
|
||||
for ( ; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++cnt )
|
||||
{
|
||||
pTeamSoldier = cnt;
|
||||
// Add guy if he's a candidate...
|
||||
if ( OK_INSECTOR_MERC( pTeamSoldier ) && PythSpacesAway( sGridNo, pTeamSoldier->sGridNo ) < bDistance && !AM_AN_EPC( pTeamSoldier ) && !( pTeamSoldier->flags.uiStatusFlags & SOLDIER_GASSED ) && !(AM_A_ROBOT( pTeamSoldier )) && !pTeamSoldier->flags.fMercAsleep &&
|
||||
SoldierTo3DLocationLineOfSightTest( pTeamSoldier, sGridNo, 0, 0, TRUE ) )
|
||||
@@ -3437,7 +3434,7 @@ void SayQuoteFromNearbyMercInSector( INT32 sGridNo, INT8 bDistance, UINT16 usQuo
|
||||
{
|
||||
continue;
|
||||
}
|
||||
ubMercsInSector[ ubNumMercs ] = (UINT8)cnt;
|
||||
ubMercsInSector[ ubNumMercs ] = (UINT16)cnt;
|
||||
ubNumMercs++;
|
||||
}
|
||||
}
|
||||
@@ -3445,7 +3442,7 @@ void SayQuoteFromNearbyMercInSector( INT32 sGridNo, INT8 bDistance, UINT16 usQuo
|
||||
// If we are > 0
|
||||
if ( ubNumMercs > 0 )
|
||||
{
|
||||
ubChosenMerc = (UINT8)Random( ubNumMercs );
|
||||
ubChosenMerc = (UINT16)Random( ubNumMercs );
|
||||
|
||||
if (usQuoteNum == 66)
|
||||
{
|
||||
@@ -3460,18 +3457,19 @@ void SayQuoteFromNearbyMercInSector( INT32 sGridNo, INT8 bDistance, UINT16 usQuo
|
||||
void SayQuote58FromNearbyMercInSector( INT32 sGridNo, INT8 bDistance, UINT16 usQuoteNum, INT8 bSex )
|
||||
{
|
||||
// WDS - make number of mercenaries, etc. be configurable
|
||||
std::vector<UINT8> ubMercsInSector (CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS, 0);
|
||||
UINT8 ubNumMercs = 0;
|
||||
UINT8 ubChosenMerc;
|
||||
std::vector<UINT16> ubMercsInSector (CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS, 0);
|
||||
UINT16 ubNumMercs = 0;
|
||||
UINT16 ubChosenMerc;
|
||||
SOLDIERTYPE *pTeamSoldier;
|
||||
INT32 cnt = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||
SoldierID cnt = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||
|
||||
// Loop through all our guys and randomly say one from someone in our sector
|
||||
|
||||
// set up soldier ptr as first element in mercptrs list
|
||||
// run through list
|
||||
for ( pTeamSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++cnt,pTeamSoldier++ )
|
||||
for ( ; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++cnt )
|
||||
{
|
||||
pTeamSoldier = cnt;
|
||||
// Add guy if he's a candidate...
|
||||
if ( OK_INSECTOR_MERC( pTeamSoldier ) && PythSpacesAway( sGridNo, pTeamSoldier->sGridNo ) < bDistance && !AM_AN_EPC( pTeamSoldier ) && !( pTeamSoldier->flags.uiStatusFlags & SOLDIER_GASSED ) && !(AM_A_ROBOT( pTeamSoldier )) && !pTeamSoldier->flags.fMercAsleep &&
|
||||
SoldierTo3DLocationLineOfSightTest( pTeamSoldier, sGridNo, 0, 0, TRUE ) )
|
||||
@@ -3487,7 +3485,7 @@ void SayQuote58FromNearbyMercInSector( INT32 sGridNo, INT8 bDistance, UINT16 usQ
|
||||
continue;
|
||||
}
|
||||
|
||||
ubMercsInSector[ ubNumMercs ] = (UINT8)cnt;
|
||||
ubMercsInSector[ ubNumMercs ] = (UINT16)cnt;
|
||||
++ubNumMercs;
|
||||
}
|
||||
}
|
||||
@@ -3495,7 +3493,7 @@ void SayQuote58FromNearbyMercInSector( INT32 sGridNo, INT8 bDistance, UINT16 usQ
|
||||
// If we are > 0
|
||||
if ( ubNumMercs > 0 )
|
||||
{
|
||||
ubChosenMerc = (UINT8)Random( ubNumMercs );
|
||||
ubChosenMerc = (UINT16)Random( ubNumMercs );
|
||||
TacticalCharacterDialogue( MercPtrs[ ubMercsInSector[ ubChosenMerc ] ], usQuoteNum );
|
||||
}
|
||||
}
|
||||
@@ -3614,7 +3612,7 @@ void UnSetEngagedInConvFromPCAction( SOLDIERTYPE *pSoldier )
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN IsStopTimeQuote( UINT16 usQuoteNum )
|
||||
static BOOLEAN IsStopTimeQuote( UINT16 usQuoteNum )
|
||||
{
|
||||
INT32 cnt;
|
||||
|
||||
|
||||
@@ -262,6 +262,7 @@ enum DialogQuoteIDs
|
||||
#ifdef JA2UB
|
||||
#define MULTIPURPOSE_SPECIAL_EVENT_TEAM_MEMBERS_DONE_TALKING 0x20000000
|
||||
#define MULTIPURPOSE_SPECIAL_EVENT_DONE_KILLING_DEIDRANNA 0x10000000
|
||||
#define MULTIPURPOSE_SPECIAL_EVENT_GETUP_AFTER_HELI_CRASH 0x08000000
|
||||
#else
|
||||
#define MULTIPURPOSE_SPECIAL_EVENT_DONE_KILLING_DEIDRANNA 0x00000001
|
||||
#define MULTIPURPOSE_SPECIAL_EVENT_TEAM_MEMBERS_DONE_TALKING 0x00000002
|
||||
@@ -489,4 +490,4 @@ void SetExternMapscreenSpeechPanelXY( INT16 sXPos, INT16 sYPos );
|
||||
void RemoveJerryMiloBrokenLaptopOverlay();
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -8,9 +8,8 @@
|
||||
#include "Overhead.h"
|
||||
#include "random.h"
|
||||
#include "Assignments.h"
|
||||
#include "message.h"
|
||||
#include "Soldier Profile.h"
|
||||
#include "Map Screen Interface Map.h"
|
||||
#include <mapscreen.h>
|
||||
#include "soldier profile type.h"
|
||||
#include "Queen Command.h"
|
||||
#include "Quests.h"
|
||||
#include "finances.h"
|
||||
@@ -18,9 +17,7 @@
|
||||
#include "LaptopSave.h"
|
||||
#include "strategic.h"
|
||||
#include "DynamicDialogue.h"
|
||||
#include <math.h>
|
||||
#include "Drugs And Alcohol.h" // for DoesMercHaveDisability( ... )
|
||||
#include "environment.h"
|
||||
|
||||
//GLOBALS
|
||||
DISEASE Disease[NUM_DISEASES];
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
* @author Flugente (bears-pit.com)
|
||||
*/
|
||||
|
||||
#include "Types.h"
|
||||
#include "types.h"
|
||||
|
||||
// number of different diseases. Altering this will alter the size of INT32 sDiseasePoints[NUM_DISEASES]; in SOLDIERTYPE
|
||||
#define NUM_DISEASES 20
|
||||
|
||||
+22
-28
@@ -1,27 +1,21 @@
|
||||
#include "builddefines.h"
|
||||
#include "Types.h"
|
||||
#include "types.h"
|
||||
#include "Isometric Utils.h"
|
||||
//#include "Soldier Control.h"
|
||||
#include "Overhead.h"
|
||||
#include "displaycover.h"
|
||||
#include "DisplayCover.h"
|
||||
#include "Font Control.h"
|
||||
#include "_Ja25EnglishText.h"
|
||||
#include "message.h"
|
||||
#include "GameSettings.h"
|
||||
#include "renderworld.h"
|
||||
#include "Interface.h"
|
||||
#include "Debug.h"
|
||||
#include "PATHAI.H"
|
||||
#include "worldman.h"
|
||||
#include "opplist.h"
|
||||
#include "los.h"
|
||||
#include "weapons.h"
|
||||
#include "LOS.h"
|
||||
#include "Weapons.h"
|
||||
#include "Game Clock.h"
|
||||
#include "Animation Control.h"
|
||||
#include "lighting.h"
|
||||
#include "Text.h"
|
||||
#include "strategicmap.h"
|
||||
#include "Render Fun.h"
|
||||
// HEADROCK HAM B2.7: Allow calling a CTH approximation function for the CTH display ("F" key)
|
||||
#include "UI Cursors.h"
|
||||
#include "soldier profile type.h"
|
||||
@@ -98,7 +92,7 @@ BOOLEAN IsTheRoofVisible( const INT32& sGridNo );
|
||||
BOOLEAN HasAdjTile(const INT32& ubX, const INT32& ubY, const INT32& ubZ);
|
||||
|
||||
|
||||
TileDefines GetOverlayIndex( INT8 bOverlayType )
|
||||
static TileDefines GetOverlayIndex( INT8 bOverlayType )
|
||||
{
|
||||
switch ( bOverlayType )
|
||||
{
|
||||
@@ -441,7 +435,7 @@ void RemoveCoverObjectsFromViewArea()
|
||||
gNoRedraw = (gubDrawMode == DRAW_MODE_OFF);
|
||||
}
|
||||
|
||||
void updateCoverViewArea()
|
||||
static void updateCoverViewArea()
|
||||
{
|
||||
INT16 usTmp;
|
||||
GetScreenXYWorldCell(gsVIEWPORT_START_X, gsVIEWPORT_START_Y, &gsMinCellX, &usTmp);
|
||||
@@ -538,11 +532,10 @@ void DisplayCover( BOOLEAN forceUpdate )
|
||||
|
||||
static void CalculateCoverFromEnemies()
|
||||
{
|
||||
if (gusSelectedSoldier == NOBODY)
|
||||
if (gusSelectedSoldier == NOBODY || gusSelectedSoldier->bActive == false)
|
||||
return;
|
||||
|
||||
SOLDIERTYPE* pSoldier;
|
||||
GetSoldier(&pSoldier, gusSelectedSoldier);
|
||||
SOLDIERTYPE* pSoldier = gusSelectedSoldier;
|
||||
const INT8 OurSoldierStealth = GetStealth(pSoldier);
|
||||
const INT8 OurSoldierLBESightAdjustment = GetSightAdjustmentBasedOnLBE(pSoldier);
|
||||
|
||||
@@ -673,10 +666,10 @@ void CalculateCover()
|
||||
INT8 ubZ;
|
||||
SOLDIERTYPE* pSoldier;
|
||||
|
||||
if (gusSelectedSoldier == NOBODY)
|
||||
if (gusSelectedSoldier == NOBODY || gusSelectedSoldier->bActive == false)
|
||||
return;
|
||||
|
||||
GetSoldier(&pSoldier, gusSelectedSoldier);
|
||||
pSoldier = gusSelectedSoldier;
|
||||
|
||||
for (ubX = gsMinCellX; ubX <= gsMaxCellX; ++ubX)
|
||||
{
|
||||
@@ -712,9 +705,10 @@ void CalculateCover()
|
||||
if (gTacticalStatus.fAtLeastOneGuyOnMultiSelect) // view of selected mercs
|
||||
{
|
||||
// OK, loop through all guys who are 'multi-selected' and
|
||||
INT32 cnt = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||
for (pSoldier = MercPtrs[cnt]; cnt <= gTacticalStatus.Team[gbPlayerNum].bLastID; ++cnt, ++pSoldier)
|
||||
SoldierID cnt = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||
for ( ; cnt <= gTacticalStatus.Team[gbPlayerNum].bLastID; ++cnt )
|
||||
{
|
||||
pSoldier = cnt;
|
||||
if (pSoldier->bActive && pSoldier->bInSector)
|
||||
{
|
||||
if (pSoldier->flags.uiStatusFlags & SOLDIER_MULTI_SELECTED)
|
||||
@@ -1199,7 +1193,7 @@ void CalculateMines()
|
||||
return;
|
||||
}
|
||||
|
||||
const INT32& sSelectedSoldierGridNo = MercPtrs[ gusSelectedSoldier ]->sGridNo;
|
||||
const INT32& sSelectedSoldierGridNo = gusSelectedSoldier->sGridNo;
|
||||
|
||||
for ( ubX=gsMinCellX; ubX<=gsMaxCellX; ++ubX )
|
||||
{
|
||||
@@ -1274,7 +1268,7 @@ void DetermineMineDisplayInTile( INT32 sGridNo, INT8 bLevel, INT8& bOverlayType,
|
||||
{
|
||||
case MINES_DRAW_PLAYERTEAM_NETWORKS:
|
||||
{
|
||||
if ( Item[pObj->usItem].tripwire == 1 )
|
||||
if (ItemIsTripwire(pObj->usItem))
|
||||
{
|
||||
// if we're already marked as MINE_BOMB, switch to MINE_BOMB_AND_WIRE
|
||||
if ( bOverlayType == MINE_BOMB )
|
||||
@@ -1314,7 +1308,7 @@ void DetermineMineDisplayInTile( INT32 sGridNo, INT8 bLevel, INT8& bOverlayType,
|
||||
|
||||
case MINES_DRAW_NETWORKCOLOURING:
|
||||
{
|
||||
if ( Item[pObj->usItem].tripwire == 1 )
|
||||
if (ItemIsTripwire(pObj->usItem))
|
||||
{
|
||||
// determine if wire is of the network we're searching for
|
||||
// determine this tripwire's flag
|
||||
@@ -1342,7 +1336,7 @@ void DetermineMineDisplayInTile( INT32 sGridNo, INT8 bLevel, INT8& bOverlayType,
|
||||
case MINES_DRAW_NET_C:
|
||||
case MINES_DRAW_NET_D:
|
||||
{
|
||||
if ( Item[pObj->usItem].tripwire == 1 )
|
||||
if (ItemIsTripwire(pObj->usItem))
|
||||
{
|
||||
UINT32 specificnet = 0;
|
||||
switch ( gubDrawMode )
|
||||
@@ -1453,7 +1447,7 @@ void CalculateTraitRange()
|
||||
return;
|
||||
}
|
||||
|
||||
const INT32& sSelectedSoldierGridNo = MercPtrs[ gusSelectedSoldier ]->sGridNo;
|
||||
const INT32& sSelectedSoldierGridNo = gusSelectedSoldier->sGridNo;
|
||||
|
||||
for ( ubX=gsMinCellX; ubX<=gsMaxCellX; ++ubX )
|
||||
{
|
||||
@@ -1530,7 +1524,7 @@ void AddTraitObjectsToViewArea()
|
||||
}
|
||||
}
|
||||
|
||||
BOOLEAN TraitTileHasAdjTile( const INT32& ubX, const INT32& ubY, const INT32& ubZ )
|
||||
static BOOLEAN TraitTileHasAdjTile( const INT32& ubX, const INT32& ubY, const INT32& ubZ )
|
||||
{
|
||||
INT32 ubTX, ubTY;
|
||||
|
||||
@@ -1591,7 +1585,7 @@ void CalculateTrackerRange( )
|
||||
|
||||
UINT16 range = gSkillTraitValues.usSVTrackerMaxRange * trackerskill;
|
||||
|
||||
const INT32& sSelectedSoldierGridNo = MercPtrs[gusSelectedSoldier]->sGridNo;
|
||||
const INT32& sSelectedSoldierGridNo = gusSelectedSoldier->sGridNo;
|
||||
|
||||
for ( ubX = gsMinCellX; ubX <= gsMaxCellX; ++ubX )
|
||||
{
|
||||
@@ -1684,7 +1678,7 @@ void AddTrackerObjectsToViewArea( )
|
||||
}
|
||||
}
|
||||
|
||||
BOOLEAN TrackerTileHasAdjTile( const INT32& ubX, const INT32& ubY, const INT32& ubZ )
|
||||
static BOOLEAN TrackerTileHasAdjTile( const INT32& ubX, const INT32& ubY, const INT32& ubZ )
|
||||
{
|
||||
INT32 ubTX, ubTY;
|
||||
|
||||
@@ -1775,7 +1769,7 @@ void CalculateWeapondata()
|
||||
|
||||
BOOLEAN guninhand = WeaponInHand( pSoldier );
|
||||
|
||||
INT32 sSelectedSoldierGridNo = MercPtrs[gusSelectedSoldier]->sGridNo;
|
||||
INT32 sSelectedSoldierGridNo = gusSelectedSoldier->sGridNo;
|
||||
|
||||
if ( TileIsOutOfBounds( sSelectedSoldierGridNo ) )
|
||||
return;
|
||||
|
||||
@@ -1,18 +1,15 @@
|
||||
#include "sgp.h"
|
||||
#include "soldier control.h"
|
||||
#include "soldier profile.h"
|
||||
#include "drugs and alcohol.h"
|
||||
#include "items.h"
|
||||
#include "morale.h"
|
||||
#include "points.h"
|
||||
#include "Soldier Control.h"
|
||||
#include "Soldier Profile.h"
|
||||
#include "Drugs And Alcohol.h"
|
||||
#include "Items.h"
|
||||
#include "Points.h"
|
||||
#include "message.h"
|
||||
#include "GameSettings.h" // SANDRO - had to add this, dammit!
|
||||
#include "Random.h"
|
||||
#include "random.h"
|
||||
#include "Text.h"
|
||||
#include "Interface.h"
|
||||
#include "Food.h" // added by Flugente
|
||||
#include "Animation data.h" // added by Flugente for SoldierBodyTypes
|
||||
#include "CampaignStats.h" // added by Flugente
|
||||
#include "Overhead.h"
|
||||
#include "DynamicDialogue.h"// added by Flugente
|
||||
|
||||
//forward declarations of common classes to eliminate includes
|
||||
@@ -205,7 +202,7 @@ BOOLEAN ApplyDrugs_New( SOLDIERTYPE *pSoldier, UINT16 usItem, UINT16 uStatusUsed
|
||||
gMercProfiles[pSoldier->ubProfile].ubNumTimesDrugUseInLifetime++;
|
||||
}
|
||||
|
||||
if ( Item[usItem].cigarette )
|
||||
if (ItemIsCigarette(usItem))
|
||||
{
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[MSG_MERC_TOOK_CIGARETTE], pSoldier->GetName( ), ShortItemNames[usItem] );
|
||||
}
|
||||
@@ -319,7 +316,7 @@ INT8 GetDrunkLevel( SOLDIERTYPE *pSoldier )
|
||||
}
|
||||
|
||||
// does a merc have a disability/personality, or is he under drugs that simulate this?
|
||||
BOOLEAN DoesMercHaveDisability( SOLDIERTYPE *pSoldier, UINT8 aVal )
|
||||
BOOLEAN DoesMercHaveDisability( const SOLDIERTYPE *pSoldier, UINT8 aVal )
|
||||
{
|
||||
if ( pSoldier->ubProfile != NO_PROFILE )
|
||||
{
|
||||
@@ -407,16 +404,16 @@ BOOLEAN MercDrugged( SOLDIERTYPE *pSoldier )
|
||||
|
||||
void HourlyDrugUpdate( )
|
||||
{
|
||||
for ( UINT16 ubID = gTacticalStatus.Team[OUR_TEAM].bFirstID; ubID <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++ubID )
|
||||
for ( SoldierID ubID = gTacticalStatus.Team[OUR_TEAM].bFirstID; ubID <= gTacticalStatus.Team[OUR_TEAM].bLastID; ++ubID )
|
||||
{
|
||||
// every hour, we lower our alcohol counter
|
||||
if ( MercPtrs[ubID]->newdrugs.drinkstaken > 0.0f )
|
||||
if ( ubID->newdrugs.drinkstaken > 0.0f )
|
||||
{
|
||||
MercPtrs[ubID]->newdrugs.drinkstaken = max( 0.0, MercPtrs[ubID]->newdrugs.drinkstaken - 0.15f );
|
||||
ubID->newdrugs.drinkstaken = max( 0.0, ubID->newdrugs.drinkstaken - 0.15f );
|
||||
|
||||
if ( MercPtrs[ubID]->newdrugs.drinkstaken <= 0.0f )
|
||||
if ( ubID->newdrugs.drinkstaken <= 0.0f )
|
||||
{
|
||||
MercPtrs[ubID]->usSoldierFlagMask2 &= ~SOLDIER_HUNGOVER;
|
||||
ubID->usSoldierFlagMask2 &= ~SOLDIER_HUNGOVER;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ void HandleEndTurnDrugAdjustments_New( SOLDIERTYPE *pSoldier );
|
||||
INT8 GetDrunkLevel( SOLDIERTYPE *pSoldier );
|
||||
|
||||
// does a merc have a disability/personality, or is he under drugs that simulate this?
|
||||
BOOLEAN DoesMercHaveDisability( SOLDIERTYPE *pSoldier, UINT8 aVal );
|
||||
BOOLEAN DoesMercHaveDisability( const SOLDIERTYPE *pSoldier, UINT8 aVal );
|
||||
BOOLEAN DoesMercHavePersonality( SOLDIERTYPE *pSoldier, UINT8 aVal );
|
||||
|
||||
//void HandleEndTurnDrugAdjustments( SOLDIERTYPE *pSoldier );
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
#include "SaveLoadGame.h"
|
||||
#include "GameVersion.h"
|
||||
#include "Text.h"
|
||||
#include "MercTextBox.h"
|
||||
#include "Meanwhile.h"
|
||||
#include "soldier profile type.h"
|
||||
#include "Soldier Profile.h"
|
||||
#include "Interface.h"
|
||||
@@ -30,6 +28,11 @@
|
||||
#include "Campaign.h"
|
||||
#include "Points.h"
|
||||
|
||||
#ifndef JA2UB
|
||||
#include "Meanwhile.h"
|
||||
#endif // !JA2UB
|
||||
|
||||
|
||||
// event id counter
|
||||
// has to be saved/loaded/reset
|
||||
UINT32 gDynamicDialogueEventCounter = 0;
|
||||
@@ -1108,7 +1111,7 @@ void SetfDynamicOpinionSpeechInProgress( BOOLEAN aVal )
|
||||
}
|
||||
|
||||
|
||||
void AddOpinionEvent( UINT8 usProfileA, UINT8 usProfileB, UINT8 usEvent, BOOLEAN fStartDialogue )
|
||||
void AddOpinionEvent( UINT16 usProfileA, UINT16 usProfileB, UINT8 usEvent, BOOLEAN fStartDialogue )
|
||||
{
|
||||
if ( usProfileA == NO_PROFILE || usProfileB == NO_PROFILE )
|
||||
return;
|
||||
@@ -1632,11 +1635,11 @@ void HandleDynamicOpinionsDailyRefresh( )
|
||||
RolloverDynamicOpinions( usProfileA );
|
||||
}
|
||||
|
||||
SOLDIERTYPE* pSoldier = NULL;
|
||||
UINT16 bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||
UINT16 bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID;
|
||||
for ( pSoldier = MercPtrs[bMercID]; bMercID <= bLastTeamID; ++bMercID, pSoldier++ )
|
||||
SoldierID bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||
SoldierID bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID;
|
||||
for ( ; bMercID <= bLastTeamID; ++bMercID )
|
||||
{
|
||||
SOLDIERTYPE* pSoldier = bMercID;
|
||||
if ( pSoldier->bActive && pSoldier->ubProfile != NO_PROFILE &&
|
||||
!(pSoldier->bAssignment == IN_TRANSIT || AM_A_ROBOT(pSoldier) ||
|
||||
pSoldier->bAssignment == ASSIGNMENT_DEAD) )
|
||||
@@ -1672,12 +1675,11 @@ void RolloverDynamicOpinions( UINT8 usProfileA )
|
||||
// check wether other people are friends with someone else we hate. All persons must be in Arulco
|
||||
void CheckForFriendsofHated( SOLDIERTYPE* pSoldier )
|
||||
{
|
||||
INT8 bMercID, bOtherID, bThirdID;
|
||||
INT8 bOpinion = -1;
|
||||
INT8 bSecondOpinion = -1;
|
||||
INT8 bLastTeamID;
|
||||
SOLDIERTYPE* pOtherSoldier;
|
||||
SOLDIERTYPE* pThirdSoldier;
|
||||
SoldierID bMercID, bOtherID, bThirdID, bLastTeamID;
|
||||
INT8 bOpinion = -1;
|
||||
INT8 bSecondOpinion = -1;
|
||||
SOLDIERTYPE *pOtherSoldier;
|
||||
SOLDIERTYPE *pThirdSoldier;
|
||||
|
||||
// make sure we ourselves aren't in transit
|
||||
if ( !pSoldier->bActive || pSoldier->ubProfile == NO_PROFILE || AM_A_ROBOT(pSoldier) || pSoldier->bAssignment == IN_TRANSIT || pSoldier->bAssignment == ASSIGNMENT_DEAD )
|
||||
@@ -1688,8 +1690,9 @@ void CheckForFriendsofHated( SOLDIERTYPE* pSoldier )
|
||||
|
||||
// loop through all other mercs
|
||||
bOtherID = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||
for ( pOtherSoldier = MercPtrs[bOtherID]; bOtherID <= bLastTeamID; ++bOtherID, pOtherSoldier++ )
|
||||
for ( ; bOtherID <= bLastTeamID; ++bOtherID )
|
||||
{
|
||||
pOtherSoldier = bOtherID;
|
||||
// skip past ourselves and all inactive mercs
|
||||
if ( bOtherID != bMercID && pOtherSoldier->bActive && pOtherSoldier->ubProfile != NO_PROFILE &&
|
||||
!(pOtherSoldier->bAssignment == IN_TRANSIT ||
|
||||
@@ -1703,8 +1706,9 @@ void CheckForFriendsofHated( SOLDIERTYPE* pSoldier )
|
||||
// there is someone in our team that we hate. We dislike his friends somewhat, purely because they like our foe
|
||||
// loop through all other mercs
|
||||
bThirdID = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||
for ( pThirdSoldier = MercPtrs[bThirdID]; bThirdID <= bLastTeamID; ++bThirdID, pThirdSoldier++ )
|
||||
for ( ; bThirdID <= bLastTeamID; ++bThirdID )
|
||||
{
|
||||
pThirdSoldier = bThirdID;
|
||||
// skip past ourselves and all inactive mercs
|
||||
if ( bThirdID != bMercID && bThirdID != bOtherID && pThirdSoldier->bActive && pThirdSoldier->ubProfile != NO_PROFILE &&
|
||||
!(pThirdSoldier->bAssignment == IN_TRANSIT ||
|
||||
@@ -1750,11 +1754,11 @@ void HandleDynamicOpinionOnContractExtension( UINT8 ubCode, UINT8 usProfile )
|
||||
oldcontract -= 14 * 1440;
|
||||
|
||||
// someones contract got extended. Other mercs who have less time on their contract will be annoyed by this, as they feel they should have been paid first
|
||||
SOLDIERTYPE* pSoldier = NULL;
|
||||
UINT16 bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||
UINT16 bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID;
|
||||
for ( pSoldier = MercPtrs[bMercID]; bMercID <= bLastTeamID; ++bMercID, pSoldier++ )
|
||||
SoldierID bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||
SoldierID bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID;
|
||||
for ( ; bMercID <= bLastTeamID; ++bMercID )
|
||||
{
|
||||
SOLDIERTYPE *pSoldier = bMercID;
|
||||
if ( pSoldier->bActive && pSoldier->ubProfile != NO_PROFILE && pSoldier->ubProfile != usProfile &&
|
||||
!(pSoldier->bAssignment == IN_TRANSIT ||
|
||||
pSoldier->bAssignment == ASSIGNMENT_DEAD) )
|
||||
@@ -1844,11 +1848,11 @@ void HandleDynamicOpinionTeamDrinking( SOLDIERTYPE* pSoldier )
|
||||
if ( !pSoldier || pSoldier->ubProfile == NO_PROFILE || AM_A_ROBOT(pSoldier) || pSoldier->newdrugs.drinkstaken <= 0.0 )
|
||||
return;
|
||||
|
||||
SOLDIERTYPE* pTeamSoldier = NULL;
|
||||
UINT16 bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||
UINT16 bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID;
|
||||
for ( pTeamSoldier = MercPtrs[bMercID]; bMercID <= bLastTeamID; ++bMercID, pTeamSoldier++ )
|
||||
SoldierID bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||
SoldierID bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID;
|
||||
for ( ; bMercID <= bLastTeamID; ++bMercID)
|
||||
{
|
||||
SOLDIERTYPE* pTeamSoldier = bMercID;
|
||||
// everybody other merc in the same sector can get updated if they are drugged too
|
||||
if ( pTeamSoldier->bActive && pTeamSoldier->ubProfile != NO_PROFILE && pTeamSoldier->ubProfile != pSoldier->ubProfile &&
|
||||
pTeamSoldier->sSectorX == pSoldier->sSectorX && pTeamSoldier->sSectorY == pSoldier->sSectorY && pTeamSoldier->bSectorZ == pSoldier->bSectorZ &&
|
||||
@@ -1903,11 +1907,11 @@ void HandleDynamicOpinionTeaching( SOLDIERTYPE* pSoldier, UINT8 ubStat )
|
||||
break;
|
||||
}
|
||||
|
||||
SOLDIERTYPE* pTeamSoldier = NULL;
|
||||
UINT16 bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||
UINT16 bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID;
|
||||
for ( pTeamSoldier = MercPtrs[bMercID]; bMercID <= bLastTeamID; ++bMercID, pTeamSoldier++ )
|
||||
SoldierID bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||
SoldierID bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID;
|
||||
for ( ; bMercID <= bLastTeamID; ++bMercID)
|
||||
{
|
||||
SOLDIERTYPE* pTeamSoldier = bMercID;
|
||||
// award event for every trainer in this sector
|
||||
if ( pTeamSoldier->bActive && pTeamSoldier->ubProfile != NO_PROFILE && pTeamSoldier->ubProfile != pSoldier->ubProfile &&
|
||||
pTeamSoldier->sSectorX == pSoldier->sSectorX && pTeamSoldier->sSectorY == pSoldier->sSectorY && pTeamSoldier->bSectorZ == pSoldier->bSectorZ &&
|
||||
@@ -1940,16 +1944,16 @@ UINT32 GetSoldierLeaderRating( SOLDIERTYPE* pSoldier )
|
||||
}
|
||||
|
||||
|
||||
UINT16 GetBestMercLeaderInSector( INT16 sX, INT16 sY, INT8 sZ )
|
||||
SoldierID GetBestMercLeaderInSector( INT16 sX, INT16 sY, INT8 sZ )
|
||||
{
|
||||
UINT32 highestrating = 0;
|
||||
UINT16 bestid = NOBODY;
|
||||
UINT32 highestrating = 0;
|
||||
SoldierID bestid = NOBODY;
|
||||
SoldierID bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||
SoldierID bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID;
|
||||
|
||||
SOLDIERTYPE* pSoldier = NULL;
|
||||
UINT16 bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||
UINT16 bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID;
|
||||
for ( pSoldier = MercPtrs[bMercID]; bMercID <= bLastTeamID; ++bMercID, ++pSoldier )
|
||||
for ( ; bMercID <= bLastTeamID; ++bMercID )
|
||||
{
|
||||
SOLDIERTYPE* pSoldier = bMercID;
|
||||
// everybody other merc in the same sector gets annoyed
|
||||
if ( pSoldier->bActive && pSoldier->ubProfile != NO_PROFILE &&
|
||||
pSoldier->sSectorX == sX && pSoldier->sSectorY == sY && pSoldier->bSectorZ == sZ &&
|
||||
@@ -1972,10 +1976,11 @@ UINT8 GetRandomMercInSectorNotInList( INT16 sX, INT16 sY, INT8 sZ, std::vector<U
|
||||
{
|
||||
std::vector<UINT16> resultvector;
|
||||
SOLDIERTYPE* pTeamSoldier = NULL;
|
||||
UINT16 bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||
UINT16 bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID;
|
||||
for ( pTeamSoldier = MercPtrs[bMercID]; bMercID <= bLastTeamID; ++bMercID, ++pTeamSoldier )
|
||||
SoldierID bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||
SoldierID bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID;
|
||||
for ( ; bMercID <= bLastTeamID; ++bMercID )
|
||||
{
|
||||
pTeamSoldier = bMercID;
|
||||
// everybody other merc in the same sector gets annoyed
|
||||
if ( pTeamSoldier->bActive && pTeamSoldier->ubProfile != NO_PROFILE &&
|
||||
pTeamSoldier->sSectorX == sX && pTeamSoldier->sSectorY == sY && pTeamSoldier->bSectorZ == sZ &&
|
||||
@@ -2002,14 +2007,14 @@ UINT8 GetFittingInterjectorProfile( UINT8 usEvent, UINT8 usProfileVictim, UINT8
|
||||
if ( usEvent >= OPINIONEVENT_MAX )
|
||||
return NO_PROFILE;
|
||||
|
||||
INT16 idVictim = GetSoldierIDFromMercID( usProfileVictim );
|
||||
INT16 idCause = GetSoldierIDFromMercID( usProfileCause );
|
||||
SoldierID idVictim = GetSoldierIDFromMercID( usProfileVictim );
|
||||
SoldierID idCause = GetSoldierIDFromMercID( usProfileCause );
|
||||
|
||||
if ( idVictim < 0 || idCause < 0 )
|
||||
if ( idVictim == NOBODY || idCause == NOBODY )
|
||||
return NO_PROFILE;
|
||||
|
||||
SOLDIERTYPE* pSoldierVictim = MercPtrs[idVictim];
|
||||
SOLDIERTYPE* pSoldierCause = MercPtrs[idCause];
|
||||
SOLDIERTYPE* pSoldierVictim = idVictim;
|
||||
SOLDIERTYPE* pSoldierCause = idCause;
|
||||
|
||||
if ( !pSoldierVictim || !pSoldierCause )
|
||||
return NO_PROFILE;
|
||||
@@ -2018,10 +2023,11 @@ UINT8 GetFittingInterjectorProfile( UINT8 usEvent, UINT8 usProfileVictim, UINT8
|
||||
std::vector<UINT8> profilevector;
|
||||
|
||||
SOLDIERTYPE* pTeamSoldier = NULL;
|
||||
UINT16 bMercID = gTacticalStatus.Team[pSoldierVictim->bTeam].bFirstID;
|
||||
UINT16 bLastTeamID = gTacticalStatus.Team[pSoldierVictim->bTeam].bLastID;
|
||||
for ( pTeamSoldier = MercPtrs[bMercID]; bMercID <= bLastTeamID; ++bMercID, pTeamSoldier++ )
|
||||
SoldierID bMercID = gTacticalStatus.Team[pSoldierVictim->bTeam].bFirstID;
|
||||
SoldierID bLastTeamID = gTacticalStatus.Team[pSoldierVictim->bTeam].bLastID;
|
||||
for ( ; bMercID <= bLastTeamID; ++bMercID )
|
||||
{
|
||||
pTeamSoldier = bMercID;
|
||||
// only people that are here
|
||||
if ( !pTeamSoldier->bActive || pTeamSoldier->bAssignment == IN_TRANSIT || pTeamSoldier->bAssignment == ASSIGNMENT_DEAD || pTeamSoldier->bAssignment == ASSIGNMENT_POW || pTeamSoldier->bAssignment == ASSIGNMENT_MINIEVENT || pTeamSoldier->bAssignment == ASSIGNMENT_REBELCOMMAND )
|
||||
continue;
|
||||
@@ -2157,10 +2163,11 @@ void HandleDynamicOpinionChange( SOLDIERTYPE* pSoldier, UINT8 usEvent, BOOLEAN f
|
||||
|
||||
UINT8 usEventUsed; // it is possible that the individual event is switched
|
||||
SOLDIERTYPE* pTeamSoldier = NULL;
|
||||
UINT16 bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||
UINT16 bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID;
|
||||
for ( pTeamSoldier = MercPtrs[bMercID]; bMercID <= bLastTeamID; ++bMercID, pTeamSoldier++ )
|
||||
SoldierID bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||
SoldierID bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID;
|
||||
for ( ; bMercID <= bLastTeamID; ++bMercID )
|
||||
{
|
||||
pTeamSoldier = bMercID;
|
||||
// we test several conditions before we allow adding an opinion
|
||||
// other merc must be active, have a profile, be someone else and not be in transit or dead
|
||||
if ( pTeamSoldier->bActive && pTeamSoldier->ubProfile != NO_PROFILE && pTeamSoldier->ubProfile != pSoldier->ubProfile &&
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* @brief This file contains declarations of classes and functions used for dynamic dialogue
|
||||
*/
|
||||
|
||||
#include "Types.h"
|
||||
#include "types.h"
|
||||
#include "Soldier Control.h"
|
||||
|
||||
// Flugente: calculate A's opinion of B
|
||||
@@ -452,7 +452,7 @@ BOOLEAN LoadDynamicDialogue( HWFILE hwFile );
|
||||
|
||||
|
||||
// modify usProfileA's opinion of usProfileB because of usEvent
|
||||
void AddOpinionEvent( UINT8 usProfileA, UINT8 usProfileB, UINT8 usEvent, BOOLEAN fStartDialogue = TRUE );
|
||||
void AddOpinionEvent( UINT16 usProfileA, UINT16 usProfileB, UINT8 usEvent, BOOLEAN fStartDialogue = TRUE );
|
||||
|
||||
// get usProfileA's opinion of usProfileB on one of the last 4 days
|
||||
INT8 GetDynamicOpinionDay( UINT8 usProfileA, UINT8 usProfileB, UINT8 usDay );
|
||||
@@ -480,7 +480,7 @@ void HandleDynamicOpinionTeaching( SOLDIERTYPE* pSoldier, UINT8 ubStat );
|
||||
// some events require a 'leader' - merc the team will regard as the one being in charge, and subsequently being praised or damned for the way things develop
|
||||
UINT32 GetSoldierLeaderRating( SOLDIERTYPE* pSoldier );
|
||||
|
||||
UINT16 GetBestMercLeaderInSector( INT16 sX, INT16 sY, INT8 sZ );
|
||||
SoldierID GetBestMercLeaderInSector( INT16 sX, INT16 sY, INT8 sZ );
|
||||
|
||||
// get id of a random merc in a sector, provided one exists
|
||||
UINT8 GetRandomMercInSectorNotInList( INT16 sX, INT16 sY, INT8 sZ, std::vector<UINT8> aTaboo, BOOLEAN fImpOnly );
|
||||
|
||||
+44
-40
@@ -1,14 +1,9 @@
|
||||
|
||||
#include "Overhead.h"
|
||||
#include "Render Fun.h"
|
||||
#include "Random.h"
|
||||
#include "Worldman.h"
|
||||
#include "worldman.h"
|
||||
#include "Soldier Profile.h"
|
||||
#include "NPC.h"
|
||||
#include "ai.h"
|
||||
#include "Dialogue Control.h"
|
||||
#include "Handle UI.h"
|
||||
#include "end game.h"
|
||||
#include "End Game.h"
|
||||
#include "Intro.h"
|
||||
#include "Exit Grids.h"
|
||||
#include "strategicmap.h"
|
||||
@@ -17,23 +12,26 @@
|
||||
#include "Sound Control.h"
|
||||
#include "renderworld.h"
|
||||
#include "Isometric Utils.h"
|
||||
#include "Music Control.h"
|
||||
#include "Soldier macros.h"
|
||||
#include "qarray.h"
|
||||
#include "los.h"
|
||||
#include "Strategic AI.h"
|
||||
#include "Squads.h"
|
||||
#include "PreBattle Interface.h"
|
||||
#include "Strategic Movement.h"
|
||||
#include "strategic.h"
|
||||
#include "Morale.h"
|
||||
#include "Queen Command.h"
|
||||
#include "Strategic Town Loyalty.h"
|
||||
#include "Player Command.h"
|
||||
#include "Campaign Types.h"
|
||||
#include "Tactical Save.h"
|
||||
#include "screenids.h"
|
||||
|
||||
#ifndef JA2UB
|
||||
#include "NPC.h"
|
||||
#include "Music Control.h"
|
||||
#include "qarray.h"
|
||||
#include "LOS.h"
|
||||
#include "Strategic AI.h"
|
||||
#include "Squads.h"
|
||||
#include "PreBattle Interface.h"
|
||||
#include "strategic.h"
|
||||
#include "Queen Command.h"
|
||||
#include "Strategic Town Loyalty.h"
|
||||
#include "Player Command.h"
|
||||
#include "Tactical Save.h"
|
||||
#endif // !JA2UB
|
||||
|
||||
|
||||
#ifdef JA2UB
|
||||
#include "email.h"
|
||||
#include "Game Clock.h"
|
||||
@@ -41,6 +39,7 @@
|
||||
#include "Game Init.h"
|
||||
#include "interface Dialogue.h"
|
||||
#include "ub_config.h"
|
||||
#include "Handle UI.h"
|
||||
|
||||
void HandleAddingTheEndGameEmails();
|
||||
void EndFadeToCredits( void );
|
||||
@@ -149,7 +148,7 @@ void ChangeO3SectorStatue( BOOLEAN fFromExplosion )
|
||||
#ifdef JA2UB
|
||||
//Ja25 no queen
|
||||
#else
|
||||
void DeidrannaTimerCallback( void )
|
||||
static void DeidrannaTimerCallback( void )
|
||||
{
|
||||
HandleDeidrannaDeath( gpKillerSoldier, gsGridNo, gbLevel );
|
||||
}
|
||||
@@ -175,8 +174,7 @@ void BeginHandleDeidrannaDeath( SOLDIERTYPE *pKillerSoldier, INT32 sGridNo, INT8
|
||||
void HandleDeidrannaDeath( SOLDIERTYPE *pKillerSoldier, INT32 sGridNo, INT8 bLevel )
|
||||
{
|
||||
SOLDIERTYPE *pTeamSoldier;
|
||||
INT32 cnt;
|
||||
UINT8 ubKillerSoldierID = NOBODY;
|
||||
SoldierID ubKillerSoldierID = NOBODY;
|
||||
|
||||
// Start victory music here...
|
||||
SetMusicMode( MUSIC_TACTICAL_VICTORY );
|
||||
@@ -189,11 +187,13 @@ void HandleDeidrannaDeath( SOLDIERTYPE *pKillerSoldier, INT32 sGridNo, INT8 bLev
|
||||
|
||||
// STEP 1 ) START ALL QUOTES GOING!
|
||||
// OK - loop through all witnesses and see if they want to say something abou this...
|
||||
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
SoldierID cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
|
||||
// run through list
|
||||
for ( pTeamSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++cnt,pTeamSoldier++ )
|
||||
for ( ; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++cnt )
|
||||
{
|
||||
pTeamSoldier = cnt;
|
||||
|
||||
if ( cnt != ubKillerSoldierID )
|
||||
{
|
||||
if ( OK_INSECTOR_MERC( pTeamSoldier ) && !( pTeamSoldier->flags.uiStatusFlags & SOLDIER_GASSED ) && !AM_AN_EPC( pTeamSoldier ) )
|
||||
@@ -218,7 +218,7 @@ void HandleDeidrannaDeath( SOLDIERTYPE *pKillerSoldier, INT32 sGridNo, INT8 bLev
|
||||
SpecialCharacterDialogueEvent( DIALOGUE_SPECIAL_EVENT_MULTIPURPOSE, MULTIPURPOSE_SPECIAL_EVENT_DONE_KILLING_DEIDRANNA, 0,0,0,0 );
|
||||
}
|
||||
|
||||
void DoneFadeInKilledQueen( void )
|
||||
static void DoneFadeInKilledQueen( void )
|
||||
{
|
||||
SOLDIERTYPE *pNPCSoldier;
|
||||
|
||||
@@ -237,17 +237,18 @@ void DoneFadeInKilledQueen( void )
|
||||
|
||||
}
|
||||
|
||||
void DoneFadeOutKilledQueen( void )
|
||||
static void DoneFadeOutKilledQueen( void )
|
||||
{
|
||||
INT32 cnt;
|
||||
SoldierID cnt;
|
||||
SOLDIERTYPE *pSoldier, *pTeamSoldier;
|
||||
|
||||
// For one, loop through our current squad and move them over
|
||||
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
|
||||
// look for all mercs on the same team,
|
||||
for ( pSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; cnt++,pSoldier++)
|
||||
for (; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++cnt )
|
||||
{
|
||||
pSoldier = cnt;
|
||||
// Are we in this sector, On the current squad?
|
||||
if ( pSoldier->bActive && pSoldier->stats.bLife >= OKLIFE && pSoldier->bInSector && pSoldier->bAssignment == CurrentSquad( ) )
|
||||
{
|
||||
@@ -271,8 +272,9 @@ void DoneFadeOutKilledQueen( void )
|
||||
cnt = gTacticalStatus.Team[ ENEMY_TEAM ].bFirstID;
|
||||
|
||||
// look for all mercs on the same team,
|
||||
for ( pTeamSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ ENEMY_TEAM ].bLastID; cnt++,pTeamSoldier++)
|
||||
for ( ; cnt <= gTacticalStatus.Team[ ENEMY_TEAM ].bLastID; ++cnt )
|
||||
{
|
||||
pTeamSoldier = cnt;
|
||||
// Are we active and in sector.....
|
||||
if ( pTeamSoldier->bActive )
|
||||
{
|
||||
@@ -349,7 +351,7 @@ void HandleDoneLastKilledQueenQuote( )
|
||||
|
||||
void EndQueenDeathEndgameBeginEndCimenatic( )
|
||||
{
|
||||
INT32 cnt;
|
||||
SoldierID cnt;
|
||||
SOLDIERTYPE *pSoldier;
|
||||
|
||||
// Start end cimimatic....
|
||||
@@ -359,8 +361,9 @@ void EndQueenDeathEndgameBeginEndCimenatic( )
|
||||
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
|
||||
// look for all mercs on the same team,
|
||||
for ( pSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; cnt++,pSoldier++)
|
||||
for ( ; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++cnt )
|
||||
{
|
||||
pSoldier = cnt;
|
||||
// Are we in this sector, On the current squad?
|
||||
if ( pSoldier->bActive && pSoldier->stats.bLife >= OKLIFE && !AM_AN_EPC( pSoldier ) )
|
||||
{
|
||||
@@ -416,7 +419,7 @@ EndQueenDeathEndgame( );
|
||||
|
||||
|
||||
|
||||
void QueenBitchTimerCallback( void )
|
||||
static void QueenBitchTimerCallback( void )
|
||||
{
|
||||
#ifdef JA2UB
|
||||
//no Ub
|
||||
@@ -632,7 +635,7 @@ void FadeOutToLaptopOnEndGame( void )
|
||||
void BeginHandleQueenBitchDeath( SOLDIERTYPE *pKillerSoldier, INT32 sGridNo, INT8 bLevel )
|
||||
{
|
||||
SOLDIERTYPE *pTeamSoldier;
|
||||
INT32 cnt;
|
||||
SoldierID cnt;
|
||||
|
||||
|
||||
gpKillerSoldier = pKillerSoldier;
|
||||
@@ -653,8 +656,9 @@ void BeginHandleQueenBitchDeath( SOLDIERTYPE *pKillerSoldier, INT32 sGridNo, INT
|
||||
cnt = gTacticalStatus.Team[ CREATURE_TEAM ].bFirstID;
|
||||
|
||||
// look for all mercs on the same team,
|
||||
for ( pTeamSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ CREATURE_TEAM ].bLastID; cnt++,pTeamSoldier++)
|
||||
for ( ; cnt <= gTacticalStatus.Team[ CREATURE_TEAM ].bLastID; ++cnt )
|
||||
{
|
||||
pTeamSoldier = cnt;
|
||||
// Are we active and ALIVE and in sector.....
|
||||
if ( pTeamSoldier->bActive && pTeamSoldier->stats.bLife > 0 )
|
||||
{
|
||||
@@ -667,7 +671,7 @@ void BeginHandleQueenBitchDeath( SOLDIERTYPE *pKillerSoldier, INT32 sGridNo, INT
|
||||
{
|
||||
// gTacticalStatus.ubAttackBusyCount++;
|
||||
DebugAttackBusy( "Killing off a queen ally.\n");
|
||||
pTeamSoldier->EVENT_SoldierGotHit( 0, 10000, 0, pTeamSoldier->ubDirection, 320, NOBODY , FIRE_WEAPON_NO_SPECIAL, pTeamSoldier->bAimShotLocation, 0, NOWHERE );
|
||||
pTeamSoldier->EVENT_SoldierGotHit( 0, 10000, 0, pTeamSoldier->ubDirection, 320, NOBODY, FIRE_WEAPON_NO_SPECIAL, pTeamSoldier->bAimShotLocation, 0, NOWHERE );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -678,8 +682,7 @@ void BeginHandleQueenBitchDeath( SOLDIERTYPE *pKillerSoldier, INT32 sGridNo, INT
|
||||
void HandleQueenBitchDeath( SOLDIERTYPE *pKillerSoldier, INT32 sGridNo, INT8 bLevel )
|
||||
{
|
||||
SOLDIERTYPE *pTeamSoldier;
|
||||
INT32 cnt;
|
||||
UINT8 ubKillerSoldierID = NOBODY;
|
||||
SoldierID ubKillerSoldierID = NOBODY;
|
||||
|
||||
// Start victory music here...
|
||||
SetMusicMode( MUSIC_TACTICAL_VICTORY );
|
||||
@@ -692,13 +695,14 @@ void HandleQueenBitchDeath( SOLDIERTYPE *pKillerSoldier, INT32 sGridNo, INT8 bLe
|
||||
|
||||
// STEP 1 ) START ALL QUOTES GOING!
|
||||
// OK - loop through all witnesses and see if they want to say something abou this...
|
||||
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
SoldierID cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
|
||||
// run through list
|
||||
for ( pTeamSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; cnt++,pTeamSoldier++ )
|
||||
for ( ; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++cnt )
|
||||
{
|
||||
if ( cnt != ubKillerSoldierID )
|
||||
{
|
||||
pTeamSoldier = cnt;
|
||||
if ( OK_INSECTOR_MERC( pTeamSoldier ) && !( pTeamSoldier->flags.uiStatusFlags & SOLDIER_GASSED ) && !AM_AN_EPC( pTeamSoldier ) )
|
||||
{
|
||||
if ( QuoteExp[ pTeamSoldier->ubProfile ].QuoteExpWitnessQueenBugDeath )
|
||||
|
||||
+1
-1
@@ -25,4 +25,4 @@ void HandleQueenBitchDeath( SOLDIERTYPE *pKillerSoldier, INT32 sGridNo, INT8 bLe
|
||||
void BeginHandleQueenBitchDeath( SOLDIERTYPE *pKillerSoldier, INT32 sGridNo, INT8 bLevel );
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,36 +1,21 @@
|
||||
#include "builddefines.h"
|
||||
#include "GameSettings.h"
|
||||
#include <stdio.h>
|
||||
#include <memory.h>
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "strategicmap.h"
|
||||
#include "overhead.h"
|
||||
#include "isometric utils.h"
|
||||
|
||||
#include "soldier add.h"
|
||||
#include "soldier create.h"
|
||||
#include "Overhead.h"
|
||||
#include "Soldier Create.h"
|
||||
#include "Soldier Init List.h"
|
||||
#include "debug.h"
|
||||
#include "Random.h"
|
||||
#include "items.h"
|
||||
|
||||
|
||||
#include "Map Information.h"
|
||||
#include "soldier profile.h"
|
||||
#include "EditorMercs.h"
|
||||
#include "Animation Data.h"
|
||||
#include "message.h"
|
||||
#include "Font Control.h"
|
||||
#include "DEBUG.H"
|
||||
#include "random.h"
|
||||
#include "Items.h"
|
||||
#include "Campaign Types.h"
|
||||
#include "Tactical Save.h"
|
||||
#include "Game Clock.h"
|
||||
#include "Queen Command.h"
|
||||
#include "Scheduling.h"
|
||||
#include "Soldier macros.h" // added by Flugente
|
||||
|
||||
#include "GameVersion.h"
|
||||
|
||||
//ADB When a savegame is loaded, the enemy and civ stuff needs to be loaded and updated, but this can only happen
|
||||
//when the temp file is loaded which can happen much later, it cannot load convert and save when updating the savegame
|
||||
//therefore store a flag to load and convert later
|
||||
@@ -39,7 +24,7 @@ int gCivPreservedTempFileVersion[256];
|
||||
|
||||
BOOLEAN AddPlacementToWorld( SOLDIERINITNODE *pNode, GROUP *pGroup = NULL );
|
||||
|
||||
BOOLEAN CountNumberOfElitesRegularsAdminsAndCreaturesFromEnemySoldiersTempFile( UINT8 *pubNumRobots, UINT8 *pubNumElites, UINT8 *pubNumRegulars, UINT8 *pubNumAdmins, UINT8 *pubNumCreatures, UINT8 *pubNumTanks, UINT8 *pubNumJeeps );
|
||||
BOOLEAN CountNumberOfElitesRegularsAdminsAndCreaturesFromEnemySoldiersTempFile( UINT16 *pubNumRobots, UINT16 *pubNumElites, UINT16 *pubNumRegulars, UINT16 *pubNumAdmins, UINT16 *pubNumCreatures, UINT16 *pubNumTanks, UINT16 *pubNumJeeps );
|
||||
|
||||
BOOLEAN gfRestoringEnemySoldiersFromTempFile = FALSE;
|
||||
BOOLEAN gfRestoringCiviliansFromTempFile = FALSE;
|
||||
@@ -100,8 +85,8 @@ BOOLEAN LoadEnemySoldiersFromTempFile()
|
||||
#endif
|
||||
INT8 bSectorZ;
|
||||
UINT8 ubSectorID;
|
||||
UINT8 ubNumRobots = 0, ubNumElites = 0, ubNumTroops = 0, ubNumAdmins = 0, ubNumCreatures = 0, ubNumTanks = 0, ubNumJeeps = 0;
|
||||
UINT8 ubStrategicRobots, ubStrategicElites, ubStrategicTroops, ubStrategicAdmins, ubStrategicCreatures, ubStrategicTanks, ubStrategicJeeps;
|
||||
UINT16 ubNumRobots = 0, ubNumElites = 0, ubNumTroops = 0, ubNumAdmins = 0, ubNumCreatures = 0, ubNumTanks = 0, ubNumJeeps = 0;
|
||||
UINT16 ubStrategicRobots, ubStrategicElites, ubStrategicTroops, ubStrategicAdmins, ubStrategicCreatures, ubStrategicTanks, ubStrategicJeeps;
|
||||
|
||||
gfRestoringEnemySoldiersFromTempFile = TRUE;
|
||||
|
||||
@@ -695,8 +680,8 @@ BOOLEAN NewWayOfLoadingEnemySoldiersFromTempFile()
|
||||
#endif
|
||||
INT8 bSectorZ;
|
||||
UINT8 ubSectorID;
|
||||
UINT8 ubNumRobots = 0, ubNumElites = 0, ubNumTroops = 0, ubNumAdmins = 0, ubNumCreatures = 0, ubNumTanks = 0, ubNumJeeps = 0;
|
||||
UINT8 ubStrategicRobots = 0, ubStrategicElites, ubStrategicTroops, ubStrategicAdmins, ubStrategicCreatures, ubStrategicTanks, ubStrategicJeeps;
|
||||
UINT16 ubNumRobots = 0, ubNumElites = 0, ubNumTroops = 0, ubNumAdmins = 0, ubNumCreatures = 0, ubNumTanks = 0, ubNumJeeps = 0;
|
||||
UINT16 ubStrategicRobots = 0, ubStrategicElites, ubStrategicTroops, ubStrategicAdmins, ubStrategicCreatures, ubStrategicTanks, ubStrategicJeeps;
|
||||
|
||||
gfRestoringEnemySoldiersFromTempFile = TRUE;
|
||||
|
||||
@@ -1395,7 +1380,6 @@ BOOLEAN NewWayOfSavingEnemyAndCivliansToTempFile( INT16 sSectorX, INT16 sSectorY
|
||||
{
|
||||
SOLDIERINITNODE *curr;
|
||||
SOLDIERTYPE *pSoldier;
|
||||
INT32 i;
|
||||
INT32 slots = 0;
|
||||
UINT32 uiNumBytesWritten;
|
||||
UINT32 uiTimeStamp;
|
||||
@@ -1428,9 +1412,9 @@ BOOLEAN NewWayOfSavingEnemyAndCivliansToTempFile( INT16 sSectorX, INT16 sSectorY
|
||||
//STEP ONE: Prep the soldiers for saving...
|
||||
|
||||
//modify the map's soldier init list to reflect the changes to the members still alive...
|
||||
for( i = gTacticalStatus.Team[ ubStartID ].bFirstID; i <= gTacticalStatus.Team[ ubEndID ].bLastID; i++ )
|
||||
for( SoldierID i = gTacticalStatus.Team[ ubStartID ].bFirstID; i <= gTacticalStatus.Team[ ubEndID ].bLastID; ++i )
|
||||
{
|
||||
pSoldier = MercPtrs[ i ];
|
||||
pSoldier = i;
|
||||
|
||||
//make sure the person is active, alive, in the sector, and is not a profiled person
|
||||
if( pSoldier && pSoldier->bActive /*&& pSoldier->bInSector*/ && pSoldier->stats.bLife && pSoldier->ubProfile == NO_PROFILE )
|
||||
@@ -1584,9 +1568,9 @@ BOOLEAN NewWayOfSavingEnemyAndCivliansToTempFile( INT16 sSectorX, INT16 sSectorY
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
for( i = gTacticalStatus.Team[ ubStartID ].bFirstID; i <= gTacticalStatus.Team[ ubEndID ].bLastID; i++ )
|
||||
for( SoldierID i = gTacticalStatus.Team[ ubStartID ].bFirstID; i <= gTacticalStatus.Team[ ubEndID ].bLastID; ++i )
|
||||
{
|
||||
pSoldier = MercPtrs[ i ];
|
||||
pSoldier = i;
|
||||
// CJC: note that bInSector is not required; the civ could be offmap!
|
||||
if( pSoldier->bActive /*&& pSoldier->bInSector*/ && pSoldier->stats.bLife )
|
||||
{
|
||||
@@ -1638,7 +1622,7 @@ BOOLEAN NewWayOfSavingEnemyAndCivliansToTempFile( INT16 sSectorX, INT16 sSectorY
|
||||
|
||||
|
||||
|
||||
BOOLEAN CountNumberOfElitesRegularsAdminsAndCreaturesFromEnemySoldiersTempFile( UINT8 *pubNumRobots, UINT8 *pubNumElites, UINT8 *pubNumRegulars, UINT8 *pubNumAdmins, UINT8 *pubNumCreatures, UINT8 *pubNumTanks, UINT8 *pubNumJeeps )
|
||||
BOOLEAN CountNumberOfElitesRegularsAdminsAndCreaturesFromEnemySoldiersTempFile( UINT16 *pubNumRobots, UINT16 *pubNumElites, UINT16 *pubNumRegulars, UINT16 *pubNumAdmins, UINT16 *pubNumCreatures, UINT16 *pubNumTanks, UINT16 *pubNumJeeps )
|
||||
{
|
||||
// SOLDIERINITNODE *curr;
|
||||
SOLDIERCREATE_STRUCT tempDetailedPlacement;
|
||||
|
||||
@@ -22,4 +22,4 @@ BOOLEAN SaveEnemySoldiersToTempFile( INT16 sSectorX, INT16 sSectorY, INT8 bSecto
|
||||
|
||||
extern BOOLEAN gfRestoringEnemySoldiersFromTempFile;
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
#include "Types.h"
|
||||
#include "DEbug.h"
|
||||
#include "EnemyItemDrops.h"
|
||||
|
||||
WEAPON_DROPS gEnemyWeaponDrops[MAX_DROP_ITEMS];
|
||||
AMMO_DROPS gEnemyAmmoDrops[MAX_DROP_ITEMS];
|
||||
EXPLOSIVE_DROPS gEnemyExplosiveDrops[MAX_DROP_ITEMS];
|
||||
ARMOUR_DROPS gEnemyArmourDrops[MAX_DROP_ITEMS];
|
||||
MISC_DROPS gEnemyMiscDrops[MAX_DROP_ITEMS];
|
||||
MISC_DROPS gEnemyMiscDrops[MAX_DROP_ITEMS];
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#ifndef _ENEMY_ITEM_DROPS__H_
|
||||
#define _ENEMY_ITEM_DROPS__H_
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#define MAX_DROP_ITEMS 100
|
||||
|
||||
typedef struct
|
||||
@@ -49,4 +51,4 @@ extern EXPLOSIVE_DROPS gEnemyExplosiveDrops[MAX_DROP_ITEMS];
|
||||
extern ARMOUR_DROPS gEnemyArmourDrops[MAX_DROP_ITEMS];
|
||||
extern MISC_DROPS gEnemyMiscDrops[MAX_DROP_ITEMS];
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+116
-125
@@ -1,52 +1,44 @@
|
||||
#include "builddefines.h"
|
||||
#include "math.h"
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
|
||||
#include "worlddef.h"
|
||||
#include "renderworld.h"
|
||||
#include "vsurface.h"
|
||||
#include "Render Dirty.h"
|
||||
#include "sysutil.h"
|
||||
#include "wcheck.h"
|
||||
#include "WCheck.h"
|
||||
#include "video.h"
|
||||
#include "vobject_blitters.h"
|
||||
#include "faces.h"
|
||||
#include "utilities.h"
|
||||
#include "overhead.h"
|
||||
#include "gap.h"
|
||||
#include "Overhead.h"
|
||||
#include "GAP.H"
|
||||
#include "Soldier Profile.h"
|
||||
#include "Sound Control.h"
|
||||
#include "teamturns.h"
|
||||
#include "soldier macros.h"
|
||||
#include "dialogue control.h"
|
||||
#include "font control.h"
|
||||
#include "TeamTurns.h"
|
||||
#include "Soldier macros.h"
|
||||
#include "Dialogue Control.h"
|
||||
#include "Font Control.h"
|
||||
#include "Assignments.h"
|
||||
#include "Random.h"
|
||||
#include "random.h"
|
||||
#include "line.h"
|
||||
#include "GameSettings.h"
|
||||
#include "squads.h"
|
||||
#include "interface.h"
|
||||
#include "Quests.h"
|
||||
#include "animation control.h"
|
||||
#include "drugs and alcohol.h"
|
||||
#include "Squads.h"
|
||||
#include "Interface.h"
|
||||
#include <strategicmap.h>
|
||||
#include "Drugs And Alcohol.h"
|
||||
#include "Interface Items.h"
|
||||
#include "meanwhile.h"
|
||||
#include "Map Screen Interface.h"
|
||||
// HEADROCK HAM 3.2: Added two includes so that a function can read values of the Gun Range/hospital location
|
||||
#include "Campaign Types.h"
|
||||
#include "Strategic Event Handler.h"
|
||||
#include "Food.h" // added by Flugente
|
||||
#include "Queen Command.h" // added by Flugente for FindUnderGroundSector(...)
|
||||
#include "strategic.h" // added by Flugente
|
||||
|
||||
#ifdef JA2UB
|
||||
#include "Ja25_Tactical.h"
|
||||
#else
|
||||
#include "Meanwhile.h"
|
||||
#include "Map Screen Interface.h"
|
||||
#endif
|
||||
|
||||
// Defines
|
||||
#define NUM_FACE_SLOTS 50
|
||||
|
||||
#define END_FACE_OVERLAY_DELAY 2000
|
||||
|
||||
|
||||
@@ -74,11 +66,11 @@ CAMO_FACE gCamoFace[NUM_PROFILES];
|
||||
FACE_GEAR_VALUES zNewFaceGear[MAXITEMS];
|
||||
FACE_GEAR_VALUES zNewFaceGearIMP[MAXITEMS];
|
||||
|
||||
extern BOOLEAN gfSMDisableForItems;
|
||||
extern INT16 gsCurInterfacePanel;
|
||||
extern UINT16 gusSMCurrentMerc;
|
||||
extern BOOLEAN gfRerenderInterfaceFromHelpText;
|
||||
extern BOOLEAN gfInItemPickupMenu;
|
||||
extern BOOLEAN gfSMDisableForItems;
|
||||
extern INT16 gsCurInterfacePanel;
|
||||
extern SoldierID gusSMCurrentMerc;
|
||||
extern BOOLEAN gfRerenderInterfaceFromHelpText;
|
||||
extern BOOLEAN gfInItemPickupMenu;
|
||||
|
||||
BOOLEAN FaceRestoreSavedBackgroundRect( INT32 iFaceIndex, INT16 sDestLeft, INT16 sDestTop, INT16 sSrcLeft, INT16 sSrcTop, INT16 sWidth, INT16 sHeight );
|
||||
void SetupFinalTalkingDelay( FACETYPE *pFace );
|
||||
@@ -131,7 +123,7 @@ INT32 InitSoldierFace( SOLDIERTYPE *pSoldier )
|
||||
}
|
||||
|
||||
|
||||
INT32 InitFace( UINT8 usMercProfileID, UINT8 ubSoldierID, UINT32 uiInitFlags )
|
||||
INT32 InitFace( UINT8 usMercProfileID, SoldierID ubSoldierID, UINT32 uiInitFlags )
|
||||
{
|
||||
UINT32 uiBlinkFrequency;
|
||||
UINT32 uiExpressionFrequency;
|
||||
@@ -184,7 +176,7 @@ void SetPalettes(HVOBJECT *hVObject, UINT32 uiIndex)
|
||||
(*hVObject)->pShades[FLASH_PORTRAIT_GRAYSHADE] = Create16BPPPaletteShaded(Pal, 255, 255, 255, FALSE);
|
||||
}
|
||||
|
||||
INT32 InternalInitFace( UINT8 usMercProfileID, UINT8 ubSoldierID, UINT32 uiInitFlags, INT32 iFaceFileID, UINT32 uiBlinkFrequency, UINT32 uiExpressionFrequency )
|
||||
INT32 InternalInitFace( UINT8 usMercProfileID, SoldierID ubSoldierID, UINT32 uiInitFlags, INT32 iFaceFileID, UINT32 uiBlinkFrequency, UINT32 uiExpressionFrequency )
|
||||
{
|
||||
FACETYPE *pFace;
|
||||
VOBJECT_DESC VObjectDesc;
|
||||
@@ -556,15 +548,14 @@ void DeleteFace( INT32 iFaceIndex )
|
||||
|
||||
}
|
||||
|
||||
void SetAutoFaceActiveFromSoldier( UINT32 uiDisplayBuffer, UINT32 uiRestoreBuffer, UINT8 ubSoldierID , UINT16 usFaceX, UINT16 usFaceY )
|
||||
void SetAutoFaceActiveFromSoldier( UINT32 uiDisplayBuffer, UINT32 uiRestoreBuffer, SoldierID ubSoldierID, UINT16 usFaceX, UINT16 usFaceY )
|
||||
{
|
||||
if( ubSoldierID == NOBODY )
|
||||
if( ubSoldierID >= NOBODY )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SetAutoFaceActive( uiDisplayBuffer, uiRestoreBuffer, MercPtrs[ ubSoldierID ]->iFaceIndex, usFaceX, usFaceY );
|
||||
|
||||
SetAutoFaceActive( uiDisplayBuffer, uiRestoreBuffer, ubSoldierID->iFaceIndex, usFaceX, usFaceY );
|
||||
}
|
||||
|
||||
void GetFaceRelativeCoordinates( FACETYPE *pFace, UINT16 *pusEyesX, UINT16 *pusEyesY, UINT16 *pusMouthX, UINT16 *pusMouthY )
|
||||
@@ -755,17 +746,17 @@ void InternalSetAutoFaceActive( UINT32 uiDisplayBuffer, UINT32 uiRestoreBuffer,
|
||||
// Are we a soldier?
|
||||
if ( pFace->ubSoldierID != NOBODY )
|
||||
{
|
||||
pFace->bOldSoldierLife = MercPtrs[ pFace->ubSoldierID ]->stats.bLife;
|
||||
pFace->bOldSoldierLife = pFace->ubSoldierID->stats.bLife;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SetAutoFaceInActiveFromSoldier( UINT8 ubSoldierID )
|
||||
void SetAutoFaceInActiveFromSoldier( SoldierID ubSoldierID )
|
||||
{
|
||||
// Check for valid soldier
|
||||
CHECKV( ubSoldierID != NOBODY );
|
||||
|
||||
SetAutoFaceInActive( MercPtrs[ ubSoldierID ]->iFaceIndex );
|
||||
SetAutoFaceInActive( ubSoldierID->iFaceIndex );
|
||||
}
|
||||
|
||||
|
||||
@@ -797,7 +788,7 @@ void SetAutoFaceInActive(INT32 iFaceIndex )
|
||||
//
|
||||
if ( pFace->ubSoldierID != NOBODY )
|
||||
{
|
||||
pSoldier = MercPtrs[ pFace->ubSoldierID ];
|
||||
pSoldier = pFace->ubSoldierID;
|
||||
|
||||
// IF we are in tactical
|
||||
if ( pSoldier->bAssignment == iCurrentTacticalSquad && guiCurrentScreen == GAME_SCREEN )
|
||||
@@ -950,11 +941,11 @@ void BlinkAutoFace( INT32 iFaceIndex )
|
||||
// CHECK IF BUDDY IS DEAD, UNCONSCIOUS, ASLEEP, OR POW!
|
||||
if ( pFace->ubSoldierID != NOBODY )
|
||||
{
|
||||
uiFaceShade = GetFaceShade(MercPtrs[pFace->ubSoldierID], pFace, FALSE);
|
||||
uiFaceShade = GetFaceShade(pFace->ubSoldierID, pFace, FALSE);
|
||||
|
||||
if ( ( MercPtrs[ pFace->ubSoldierID ]->stats.bLife < OKLIFE ) ||
|
||||
( MercPtrs[ pFace->ubSoldierID ]->flags.fMercAsleep == TRUE ) ||
|
||||
( MercPtrs[ pFace->ubSoldierID ]->bAssignment == ASSIGNMENT_POW ) )
|
||||
if ( ( pFace->ubSoldierID->stats.bLife < OKLIFE ) ||
|
||||
( pFace->ubSoldierID->flags.fMercAsleep == TRUE ) ||
|
||||
( pFace->ubSoldierID->bAssignment == ASSIGNMENT_POW ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -1090,13 +1081,13 @@ void HandleFaceHilights( FACETYPE *pFace, UINT32 uiBuffer, INT16 sFaceX, INT16 s
|
||||
{
|
||||
if ( pFace->ubSoldierID != NOBODY )
|
||||
{
|
||||
if ( MercPtrs[ pFace->ubSoldierID ]->stats.bLife >= OKLIFE )
|
||||
if ( pFace->ubSoldierID->stats.bLife >= OKLIFE )
|
||||
{
|
||||
// Lock buffer
|
||||
pDestBuf = LockVideoSurface( uiBuffer, &uiDestPitchBYTES );
|
||||
SetClippingRegionAndImageWidth( uiDestPitchBYTES, sFaceX-2, sFaceY-1, sFaceX + pFace->usFaceWidth + 4, sFaceY + pFace->usFaceHeight + 4 );
|
||||
|
||||
if ( MercPtrs[ pFace->ubSoldierID ]->bStealthMode )
|
||||
if ( pFace->ubSoldierID->bStealthMode )
|
||||
{
|
||||
usLineColor = Get16BPPColor( FROMRGB( 158, 158, 12 ) );
|
||||
}
|
||||
@@ -1239,7 +1230,7 @@ void MouthAutoFace( INT32 iFaceIndex )
|
||||
// Set shade
|
||||
if (pFace->ubSoldierID != NOBODY)
|
||||
{
|
||||
uiFaceShade = GetFaceShade(MercPtrs[pFace->ubSoldierID], pFace, FALSE);
|
||||
uiFaceShade = GetFaceShade(pFace->ubSoldierID, pFace, FALSE);
|
||||
}
|
||||
|
||||
HandleRenderFaceAdjustments( pFace, TRUE, FALSE, 0, pFace->usFaceX, pFace->usFaceY, pFace->usEyesX, pFace->usEyesY, uiFaceShade);
|
||||
@@ -1365,12 +1356,12 @@ UINT32 GetFaceShade(SOLDIERTYPE *pSoldier, FACETYPE *pFace, BOOLEAN fExternBlit)
|
||||
return FLASH_PORTRAIT_NOSHADE;
|
||||
}
|
||||
|
||||
BOOLEAN RenderAutoFaceFromSoldier( UINT8 ubSoldierID )
|
||||
BOOLEAN RenderAutoFaceFromSoldier( SoldierID ubSoldierID )
|
||||
{
|
||||
// Check for valid soldier
|
||||
CHECKF( ubSoldierID != NOBODY );
|
||||
|
||||
return( RenderAutoFace( MercPtrs[ ubSoldierID ]->iFaceIndex ) );
|
||||
return( RenderAutoFace( ubSoldierID->iFaceIndex ) );
|
||||
}
|
||||
|
||||
//---------------------------------------LEGION-------------------------------
|
||||
@@ -1631,16 +1622,16 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
|
||||
// BLIT HATCH
|
||||
if ( pFace->ubSoldierID != NOBODY )
|
||||
{
|
||||
pSoldier = MercPtrs[ pFace->ubSoldierID ];
|
||||
pSoldier = pFace->ubSoldierID;
|
||||
|
||||
UINT8 faceProfileId = gMercProfiles[pSoldier->ubProfile].ubFaceIndex;
|
||||
BOOLEAN isIMP = gMercProfiles[pSoldier->ubProfile].Type == PROFILETYPE_IMP;
|
||||
|
||||
if (gGameSettings.fOptions[TOPTION_SHOW_TACTICAL_FACE_GEAR] && MercPtrs[pFace->ubSoldierID]->stats.bLife > 0 && !(pFace->uiFlags & FACE_BIGFACE))
|
||||
if (gGameSettings.fOptions[TOPTION_SHOW_TACTICAL_FACE_GEAR] && pSoldier->stats.bLife > 0 && !(pFace->uiFlags & FACE_BIGFACE))
|
||||
{
|
||||
if (MercPtrs[pFace->ubSoldierID]->inv[HELMETPOS].usItem > 0)
|
||||
if (pSoldier->inv[HELMETPOS].usItem > 0)
|
||||
{
|
||||
uiFaceItemOne = MercPtrs[pFace->ubSoldierID]->inv[HELMETPOS].usItem;
|
||||
uiFaceItemOne = pSoldier->inv[HELMETPOS].usItem;
|
||||
|
||||
if (uiFaceItemOne != NONE && zNewFaceGear[uiFaceItemOne].Type == 1) //back
|
||||
{
|
||||
@@ -1650,17 +1641,17 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
|
||||
|
||||
// this section chooses the pictures for gas mask and NV goggles if the ini setting "SHOW_TACTICAL_FACE_GEAR" is TRUE
|
||||
// and the merc actually wears something to be shown
|
||||
if (MercPtrs[pFace->ubSoldierID]->inv[HEAD1POS].usItem + MercPtrs[pFace->ubSoldierID]->inv[HEAD2POS].usItem > 0)
|
||||
if (pSoldier->inv[HEAD1POS].usItem + pSoldier->inv[HEAD2POS].usItem > 0)
|
||||
{
|
||||
// WANNE: Removed the limitation
|
||||
// silversurfer: don't overwrite icons if they shall be shown!
|
||||
//if ( !gGameSettings.fOptions[ SHOW_TACTICAL_FACE_ICONS ] )
|
||||
{
|
||||
uiFaceItemOne = MercPtrs[pFace->ubSoldierID]->inv[HEAD1POS].usItem;
|
||||
uiFaceItemTwo = MercPtrs[pFace->ubSoldierID]->inv[HEAD2POS].usItem;
|
||||
uiFaceItemOne = pSoldier->inv[HEAD1POS].usItem;
|
||||
uiFaceItemTwo = pSoldier->inv[HEAD2POS].usItem;
|
||||
|
||||
uiFaceOne = MercPtrs[pFace->ubSoldierID]->inv[HEAD1POS].usItem;
|
||||
uiFaceTwo = MercPtrs[pFace->ubSoldierID]->inv[HEAD2POS].usItem;
|
||||
uiFaceOne = pSoldier->inv[HEAD1POS].usItem;
|
||||
uiFaceTwo = pSoldier->inv[HEAD2POS].usItem;
|
||||
|
||||
// check first face slot
|
||||
if (uiFaceItemOne != NONE)
|
||||
@@ -1799,11 +1790,11 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
|
||||
}
|
||||
}
|
||||
|
||||
if (MercPtrs[pFace->ubSoldierID]->inv[HELMETPOS].usItem > 0)
|
||||
if (pSoldier->inv[HELMETPOS].usItem > 0)
|
||||
// dirty hack for IMPs because they don't have pictures for face gear
|
||||
// && ( MercPtrs[ pFace->ubSoldierID ]->ubProfile < 51 || MercPtrs[ pFace->ubSoldierID ]->ubProfile > 56 )
|
||||
// && ( pSoldier->ubProfile < 51 || pSoldier->ubProfile > 56 )
|
||||
{
|
||||
uiFaceItemOne = MercPtrs[pFace->ubSoldierID]->inv[HELMETPOS].usItem;
|
||||
uiFaceItemOne = pSoldier->inv[HELMETPOS].usItem;
|
||||
|
||||
if (uiFaceItemOne != NONE)
|
||||
{
|
||||
@@ -1817,7 +1808,7 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
|
||||
//------------------------------------end of tactical face gear-----------------------------
|
||||
}
|
||||
|
||||
if ( (MercPtrs[pFace->ubSoldierID]->stats.bLife < CONSCIOUSNESS || MercPtrs[pFace->ubSoldierID]->flags.fDeadPanel ) )
|
||||
if ( (pSoldier->stats.bLife < CONSCIOUSNESS || pSoldier->flags.fDeadPanel ) )
|
||||
{
|
||||
// Blit Closed eyes here!
|
||||
BltVideoObjectFromIndex( uiRenderBuffer, pFace->uiVideoObject, 1, usEyesX, usEyesY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
@@ -1826,14 +1817,14 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
|
||||
BltVideoObjectFromIndex( uiRenderBuffer, guiHATCH, 0, sFaceX, sFaceY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
}
|
||||
|
||||
if( MercPtrs[ pFace->ubSoldierID ]->flags.fMercAsleep == TRUE )
|
||||
if( pSoldier->flags.fMercAsleep == TRUE )
|
||||
{
|
||||
// blit eyes closed
|
||||
BltVideoObjectFromIndex( uiRenderBuffer, pFace->uiVideoObject, 1, usEyesX, usEyesY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
}
|
||||
|
||||
// Flugente: frozen soldiers are, well, frozen
|
||||
if ( MercPtrs[pFace->ubSoldierID]->usSkillCooldown[SOLDIER_COOLDOWN_CRYO] )
|
||||
if ( pSoldier->usSkillCooldown[SOLDIER_COOLDOWN_CRYO] )
|
||||
{
|
||||
// Blit Closed eyes here!
|
||||
BltVideoObjectFromIndex( uiRenderBuffer, pFace->uiVideoObject, 2, usEyesX, usEyesY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
@@ -1907,7 +1898,7 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
|
||||
|
||||
}
|
||||
|
||||
if ( MercPtrs[ pFace->ubSoldierID ]->bInSector && ( ( ( gTacticalStatus.ubCurrentTeam != OUR_TEAM ) || !OK_INTERRUPT_MERC( MercPtrs[ pFace->ubSoldierID ] ) ) && !gfHiddenInterrupt ) || ( ( gfSMDisableForItems && !gfInItemPickupMenu ) && gusSMCurrentMerc == pFace->ubSoldierID && gsCurInterfacePanel == SM_PANEL ) )
|
||||
if ( pSoldier->bInSector && ( ( ( gTacticalStatus.ubCurrentTeam != OUR_TEAM ) || !OK_INTERRUPT_MERC( pSoldier ) ) && !gfHiddenInterrupt ) || ( ( gfSMDisableForItems && !gfInItemPickupMenu ) && gusSMCurrentMerc == pSoldier && gsCurInterfacePanel == SM_PANEL ) )
|
||||
{
|
||||
// Blit hatch!
|
||||
BltVideoObjectFromIndex( uiRenderBuffer, guiHATCH, 0, sFaceX, sFaceY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
@@ -1915,12 +1906,12 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
|
||||
}
|
||||
|
||||
// sevenfm: only show for alive soldiers, no face icons for big faces
|
||||
if (MercPtrs[pFace->ubSoldierID]->stats.bLife > 0 && !(pFace->uiFlags & FACE_BIGFACE))
|
||||
if (pSoldier->stats.bLife > 0 && !(pFace->uiFlags & FACE_BIGFACE))
|
||||
{
|
||||
// Check if a robot and is not controlled....
|
||||
if (MercPtrs[pFace->ubSoldierID]->flags.uiStatusFlags & SOLDIER_ROBOT)
|
||||
if (pSoldier->flags.uiStatusFlags & SOLDIER_ROBOT)
|
||||
{
|
||||
if (!MercPtrs[pFace->ubSoldierID]->CanRobotBeControlled())
|
||||
if (!pSoldier->CanRobotBeControlled())
|
||||
{
|
||||
// Not controlled robot
|
||||
sIconIndex = 5;
|
||||
@@ -1928,7 +1919,7 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
|
||||
}
|
||||
}
|
||||
|
||||
if (MercPtrs[pFace->ubSoldierID]->ControllingRobot())
|
||||
if (pSoldier->ControllingRobot())
|
||||
{
|
||||
// controlling robot
|
||||
sIconIndex = 4;
|
||||
@@ -1941,16 +1932,16 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
|
||||
// this section chooses the icons for face gear if the ini setting "SHOW_TACTICAL_FACE_ICONS" is TRUE
|
||||
// and the merc actually wears something to be shown
|
||||
if (gGameSettings.fOptions[TOPTION_SHOW_TACTICAL_FACE_ICONS] &&
|
||||
(MercPtrs[pFace->ubSoldierID]->inv[HEAD1POS].usItem + MercPtrs[pFace->ubSoldierID]->inv[HEAD2POS].usItem) > 0)
|
||||
(pSoldier->inv[HEAD1POS].usItem + pSoldier->inv[HEAD2POS].usItem) > 0)
|
||||
{
|
||||
uiFaceItemOne = MercPtrs[pFace->ubSoldierID]->inv[HEAD1POS].usItem;
|
||||
uiFaceItemTwo = MercPtrs[pFace->ubSoldierID]->inv[HEAD2POS].usItem;
|
||||
uiFaceItemOne = pSoldier->inv[HEAD1POS].usItem;
|
||||
uiFaceItemTwo = pSoldier->inv[HEAD2POS].usItem;
|
||||
|
||||
//MM: fixing the hardcoded craziness here...
|
||||
// check first face slot
|
||||
if (uiFaceItemOne != NONE)
|
||||
{
|
||||
if (Item[uiFaceItemOne].gasmask)
|
||||
if (ItemIsGasmask(uiFaceItemOne))
|
||||
uiFaceItemOne = 1;
|
||||
else if (Item[uiFaceItemOne].nightvisionrangebonus > 0)
|
||||
uiFaceItemOne = 2;
|
||||
@@ -1965,7 +1956,7 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
|
||||
// check second face slot
|
||||
if (uiFaceItemTwo != NONE)
|
||||
{
|
||||
if (Item[uiFaceItemTwo].gasmask)
|
||||
if (ItemIsGasmask(uiFaceItemTwo))
|
||||
uiFaceItemTwo = 21;
|
||||
else if (Item[uiFaceItemTwo].nightvisionrangebonus > 0)
|
||||
uiFaceItemTwo = 42;
|
||||
@@ -2052,20 +2043,20 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
|
||||
}
|
||||
|
||||
// If blind...
|
||||
if (MercPtrs[pFace->ubSoldierID]->bBlindedCounter > 0)
|
||||
if (pSoldier->bBlindedCounter > 0)
|
||||
{
|
||||
DoRightIcon(uiRenderBuffer, pFace, sFaceX, sFaceY, bNumRightIcons, 6);
|
||||
bNumRightIcons++;
|
||||
}
|
||||
|
||||
// Flugente: add drug symbol if drugged (without alcohol)
|
||||
if (MercDrugged(MercPtrs[pFace->ubSoldierID]))
|
||||
if (MercDrugged(pSoldier))
|
||||
{
|
||||
DoRightIcon(uiRenderBuffer, pFace, sFaceX, sFaceY, bNumRightIcons, 7);
|
||||
bNumRightIcons++;
|
||||
}
|
||||
|
||||
if (GetDrunkLevel(MercPtrs[pFace->ubSoldierID]) != SOBER)
|
||||
if (GetDrunkLevel(pSoldier) != SOBER)
|
||||
{
|
||||
DoRightIcon(uiRenderBuffer, pFace, sFaceX, sFaceY, bNumRightIcons, 8);
|
||||
bNumRightIcons++;
|
||||
@@ -2074,13 +2065,13 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
|
||||
// Flugente: food system - symbols used if hungry or thirsty
|
||||
if (UsingFoodSystem())
|
||||
{
|
||||
if (MercPtrs[pFace->ubSoldierID]->bDrinkLevel < FoodMoraleMods[FOOD_MERC_START_SHOW_HUNGER_SYMBOL].bThreshold)
|
||||
if (pSoldier->bDrinkLevel < FoodMoraleMods[FOOD_MERC_START_SHOW_HUNGER_SYMBOL].bThreshold)
|
||||
{
|
||||
DoRightIcon(uiRenderBuffer, pFace, sFaceX, sFaceY, bNumRightIcons, 9);
|
||||
bNumRightIcons++;
|
||||
}
|
||||
|
||||
if (MercPtrs[pFace->ubSoldierID]->bFoodLevel < FoodMoraleMods[FOOD_MERC_START_SHOW_HUNGER_SYMBOL].bThreshold)
|
||||
if (pSoldier->bFoodLevel < FoodMoraleMods[FOOD_MERC_START_SHOW_HUNGER_SYMBOL].bThreshold)
|
||||
{
|
||||
DoRightIcon(uiRenderBuffer, pFace, sFaceX, sFaceY, bNumRightIcons, 10);
|
||||
bNumRightIcons++;
|
||||
@@ -2090,13 +2081,13 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
|
||||
// Flugente: are we supplying ammo to someone else?
|
||||
if (gGameExternalOptions.ubExternalFeeding > 0)
|
||||
{
|
||||
UINT8 ubID1 = 0;
|
||||
SoldierID ubID1 = NOBODY;
|
||||
UINT16 ubGunSlot1 = 0;
|
||||
UINT16 ubFaceSlot1 = 0;
|
||||
UINT8 ubID2 = 0;
|
||||
SoldierID ubID2 = NOBODY;
|
||||
UINT16 ubGunSlot2 = 0;
|
||||
UINT16 ubFaceSlot2 = 0;
|
||||
if (MercPtrs[pFace->ubSoldierID]->IsFeedingExternal(&ubID1, &ubGunSlot1, &ubFaceSlot1, &ubID2, &ubGunSlot2, &ubFaceSlot2))
|
||||
if (pSoldier->IsFeedingExternal(&ubID1, &ubGunSlot1, &ubFaceSlot1, &ubID2, &ubGunSlot2, &ubFaceSlot2))
|
||||
{
|
||||
DoRightIcon(uiRenderBuffer, pFace, sFaceX, sFaceY, bNumRightIcons, 11);
|
||||
bNumRightIcons++;
|
||||
@@ -2104,33 +2095,33 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
|
||||
}
|
||||
|
||||
// Flugente: add an icon if we are currently in disguise
|
||||
if (MercPtrs[pFace->ubSoldierID]->usSoldierFlagMask & (SOLDIER_COVERT_CIV | SOLDIER_COVERT_SOLDIER))
|
||||
if (pSoldier->usSoldierFlagMask & (SOLDIER_COVERT_CIV | SOLDIER_COVERT_SOLDIER))
|
||||
{
|
||||
DoRightIcon(uiRenderBuffer, pFace, sFaceX, sFaceY, bNumRightIcons, 12);
|
||||
bNumRightIcons++;
|
||||
}
|
||||
|
||||
// Flugente: add an icon if we are performing a multi-turn action
|
||||
if (MercPtrs[pFace->ubSoldierID]->GetMultiTurnAction() == MTA_HACK)
|
||||
if (pSoldier->GetMultiTurnAction() == MTA_HACK)
|
||||
{
|
||||
DoRightIcon(uiRenderBuffer, pFace, sFaceX, sFaceY, bNumRightIcons, 30);
|
||||
bNumRightIcons++;
|
||||
}
|
||||
else if (MercPtrs[pFace->ubSoldierID]->GetMultiTurnAction() > MTA_NONE)
|
||||
else if (pSoldier->GetMultiTurnAction() > MTA_NONE)
|
||||
{
|
||||
DoRightIcon(uiRenderBuffer, pFace, sFaceX, sFaceY, bNumRightIcons, 14);
|
||||
bNumRightIcons++;
|
||||
}
|
||||
|
||||
// Flugente: icons for radio operator actions (not the assignment)
|
||||
if (MercPtrs[pFace->ubSoldierID]->bAssignment != RADIO_SCAN)
|
||||
if (pSoldier->bAssignment != RADIO_SCAN)
|
||||
{
|
||||
if (MercPtrs[pFace->ubSoldierID]->usSoldierFlagMask & (SOLDIER_RADIO_OPERATOR_SCANNING | SOLDIER_RADIO_OPERATOR_LISTENING))
|
||||
if (pSoldier->usSoldierFlagMask & (SOLDIER_RADIO_OPERATOR_SCANNING | SOLDIER_RADIO_OPERATOR_LISTENING))
|
||||
{
|
||||
DoRightIcon(uiRenderBuffer, pFace, sFaceX, sFaceY, bNumRightIcons, 19);
|
||||
bNumRightIcons++;
|
||||
}
|
||||
else if (MercPtrs[pFace->ubSoldierID]->usSoldierFlagMask & SOLDIER_RADIO_OPERATOR_JAMMING)
|
||||
else if (pSoldier->usSoldierFlagMask & SOLDIER_RADIO_OPERATOR_JAMMING)
|
||||
{
|
||||
DoRightIcon(uiRenderBuffer, pFace, sFaceX, sFaceY, bNumRightIcons, 20);
|
||||
bNumRightIcons++;
|
||||
@@ -2138,9 +2129,9 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
|
||||
}
|
||||
|
||||
// Flugente: spotter
|
||||
if (MercPtrs[pFace->ubSoldierID]->usSkillCounter[SOLDIER_COUNTER_SPOTTER] > 0)
|
||||
if (pSoldier->usSkillCounter[SOLDIER_COUNTER_SPOTTER] > 0)
|
||||
{
|
||||
if (MercPtrs[pFace->ubSoldierID]->IsSpotting())
|
||||
if (pSoldier->IsSpotting())
|
||||
{
|
||||
DoRightIcon(uiRenderBuffer, pFace, sFaceX, sFaceY, bNumRightIcons, 24);
|
||||
bNumRightIcons++;
|
||||
@@ -2153,21 +2144,21 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
|
||||
}
|
||||
|
||||
// Flugente: focus trait
|
||||
if (MercPtrs[pFace->ubSoldierID]->usSoldierFlagMask2 & SOLDIER_TRAIT_FOCUS)
|
||||
if (pSoldier->usSoldierFlagMask2 & SOLDIER_TRAIT_FOCUS)
|
||||
{
|
||||
DoRightIcon(uiRenderBuffer, pFace, sFaceX, sFaceY, bNumRightIcons, 17);
|
||||
bNumRightIcons++;
|
||||
}
|
||||
|
||||
// Flugente: disease
|
||||
if (MercPtrs[pFace->ubSoldierID]->HasDisease(TRUE, FALSE, TRUE))
|
||||
if (pSoldier->HasDisease(TRUE, FALSE, TRUE))
|
||||
{
|
||||
DoRightIcon(uiRenderBuffer, pFace, sFaceX, sFaceY, bNumRightIcons, 28);
|
||||
bNumRightIcons++;
|
||||
}
|
||||
|
||||
// Flugente: drag stuff
|
||||
if (MercPtrs[pFace->ubSoldierID]->IsDragging())
|
||||
if (pSoldier->IsDragging())
|
||||
{
|
||||
DoRightIcon(uiRenderBuffer, pFace, sFaceX, sFaceY, bNumRightIcons, 31);
|
||||
++bNumRightIcons;
|
||||
@@ -2180,7 +2171,7 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
|
||||
case DOCTOR_MILITIA:
|
||||
sIconIndex_Assignment = 1;
|
||||
fDoIcon_Assignment = TRUE;
|
||||
sPtsAvailable = CalculateHealingPointsForDoctor(MercPtrs[pFace->ubSoldierID], &usMaximumPts, FALSE);
|
||||
sPtsAvailable = CalculateHealingPointsForDoctor(pSoldier, &usMaximumPts, FALSE);
|
||||
|
||||
fShowCustomText = TRUE;
|
||||
|
||||
@@ -2203,8 +2194,8 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
|
||||
sIconIndex_Assignment = 2;
|
||||
fDoIcon_Assignment = TRUE;
|
||||
// show current health / maximum health
|
||||
sPtsAvailable = MercPtrs[pFace->ubSoldierID]->stats.bLife;
|
||||
usMaximumPts = MercPtrs[pFace->ubSoldierID]->stats.bLifeMax;
|
||||
sPtsAvailable = pSoldier->stats.bLife;
|
||||
usMaximumPts = pSoldier->stats.bLifeMax;
|
||||
fShowNumber = TRUE;
|
||||
fShowMaximum = TRUE;
|
||||
break;
|
||||
@@ -2220,27 +2211,27 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
|
||||
fShowNumber = TRUE;
|
||||
fShowMaximum = TRUE;
|
||||
|
||||
switch (MercPtrs[pFace->ubSoldierID]->bAssignment)
|
||||
switch (pSoldier->bAssignment)
|
||||
{
|
||||
case(TRAIN_SELF) :
|
||||
sPtsAvailable = GetSoldierTrainingPts(MercPtrs[pFace->ubSoldierID], MercPtrs[pFace->ubSoldierID]->bTrainStat, &usMaximumPts);
|
||||
sPtsAvailable = GetSoldierTrainingPts(pSoldier, pSoldier->bTrainStat, &usMaximumPts);
|
||||
break;
|
||||
case(TRAIN_BY_OTHER) :
|
||||
sPtsAvailable = GetSoldierStudentPts(MercPtrs[pFace->ubSoldierID], MercPtrs[pFace->ubSoldierID]->bTrainStat, &usMaximumPts);
|
||||
sPtsAvailable = GetSoldierStudentPts(pSoldier, pSoldier->bTrainStat, &usMaximumPts);
|
||||
break;
|
||||
case(TRAIN_TOWN) :
|
||||
case DRILL_MILITIA:
|
||||
sPtsAvailable = GetTownTrainPtsForCharacter(MercPtrs[pFace->ubSoldierID], &usMaximumPts);
|
||||
sPtsAvailable = GetTownTrainPtsForCharacter(pSoldier, &usMaximumPts);
|
||||
// divide both amounts by 10 to make the displayed numbers a little more user-palatable (smaller)
|
||||
sPtsAvailable = (sPtsAvailable + 5) / 10;
|
||||
usMaximumPts = (usMaximumPts + 5) / 10;
|
||||
break;
|
||||
case(TRAIN_TEAMMATE) :
|
||||
sPtsAvailable = GetBonusTrainingPtsDueToInstructor(MercPtrs[pFace->ubSoldierID], NULL, MercPtrs[pFace->ubSoldierID]->bTrainStat, &usMaximumPts);
|
||||
sPtsAvailable = GetBonusTrainingPtsDueToInstructor(pSoldier, NULL, pSoldier->bTrainStat, &usMaximumPts);
|
||||
break;
|
||||
case TRAIN_WORKERS:
|
||||
fShowMaximum = FALSE;
|
||||
sPtsAvailable = GetTrainWorkerPts(MercPtrs[pFace->ubSoldierID]);
|
||||
sPtsAvailable = GetTrainWorkerPts(pSoldier);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -2250,25 +2241,25 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
|
||||
sIconIndex_Assignment = 0;
|
||||
fDoIcon_Assignment = TRUE;
|
||||
// Show repair points if merc has a toolkit in his hand. Otherwise show cleaning points.
|
||||
if (Item[pSoldier->inv[HANDPOS].usItem].toolkit)
|
||||
sPtsAvailable = CalculateRepairPointsForRepairman(MercPtrs[pFace->ubSoldierID], &usMaximumPts, FALSE);
|
||||
if (ItemIsToolkit(pSoldier->inv[HANDPOS].usItem))
|
||||
sPtsAvailable = CalculateRepairPointsForRepairman(pSoldier, &usMaximumPts, FALSE);
|
||||
else
|
||||
sPtsAvailable = CalculateCleaningPointsForRepairman(MercPtrs[pFace->ubSoldierID], &usMaximumPts);
|
||||
sPtsAvailable = CalculateCleaningPointsForRepairman(pSoldier, &usMaximumPts);
|
||||
fShowNumber = TRUE;
|
||||
fShowMaximum = TRUE;
|
||||
|
||||
// check if we are repairing a vehicle
|
||||
if (Menptr[pFace->ubSoldierID].bVehicleUnderRepairID != -1)
|
||||
if (pSoldier->bVehicleUnderRepairID != -1)
|
||||
{
|
||||
// reduce to a multiple of VEHICLE_REPAIR_POINTS_DIVISOR. This way skill too low will show up as 0 repair pts.
|
||||
sPtsAvailable -= (sPtsAvailable % VEHICLE_REPAIR_POINTS_DIVISOR);
|
||||
usMaximumPts -= (usMaximumPts % VEHICLE_REPAIR_POINTS_DIVISOR);
|
||||
}
|
||||
else if (Menptr[pFace->ubSoldierID].flags.fFixingSAMSite)
|
||||
else if (pSoldier->flags.fFixingSAMSite)
|
||||
{
|
||||
sPtsAvailable = (sPtsAvailable / SAM_SITE_REPAIR_DIVISOR);
|
||||
|
||||
INT16 sector = CALCULATE_STRATEGIC_INDEX(Menptr[pFace->ubSoldierID].sSectorX, Menptr[pFace->ubSoldierID].sSectorY);
|
||||
INT16 sector = CALCULATE_STRATEGIC_INDEX(pSoldier->sSectorX, pSoldier->sSectorY);
|
||||
|
||||
usMaximumPts = 100 - StrategicMap[sector].bSAMCondition;
|
||||
}
|
||||
@@ -2338,7 +2329,7 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
|
||||
case DISEASE_DOCTOR_SECTOR:
|
||||
sIconIndex_Assignment = 1;
|
||||
fDoIcon_Assignment = TRUE;
|
||||
sPtsAvailable = CalculateHealingPointsForDoctor(MercPtrs[pFace->ubSoldierID], &usMaximumPts, FALSE);
|
||||
sPtsAvailable = CalculateHealingPointsForDoctor(pSoldier, &usMaximumPts, FALSE);
|
||||
fShowNumber = TRUE;
|
||||
fShowMaximum = TRUE;
|
||||
|
||||
@@ -2350,15 +2341,15 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
|
||||
case FORTIFICATION:
|
||||
sIconIndex_Assignment = 14;
|
||||
fDoIcon_Assignment = TRUE;
|
||||
sPtsAvailable = (INT16)(MercPtrs[pFace->ubSoldierID]->GetConstructionPoints());
|
||||
sPtsAvailable = (INT16)(pSoldier->GetConstructionPoints());
|
||||
fShowNumber = TRUE;
|
||||
fShowMaximum = TRUE;
|
||||
|
||||
{
|
||||
if (MercPtrs[pFace->ubSoldierID]->bSectorZ)
|
||||
if (pSoldier->bSectorZ)
|
||||
{
|
||||
UNDERGROUND_SECTORINFO *pSectorInfo;
|
||||
pSectorInfo = FindUnderGroundSector(MercPtrs[pFace->ubSoldierID]->sSectorX, MercPtrs[pFace->ubSoldierID]->sSectorY, MercPtrs[pFace->ubSoldierID]->bSectorZ);
|
||||
pSectorInfo = FindUnderGroundSector(pSoldier->sSectorX, pSoldier->sSectorY, pSoldier->bSectorZ);
|
||||
|
||||
if (pSectorInfo)
|
||||
usMaximumPts = (INT16)(pSectorInfo->dFortification_MaxPossible);
|
||||
@@ -2366,7 +2357,7 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
|
||||
else
|
||||
{
|
||||
SECTORINFO *pSectorInfo;
|
||||
pSectorInfo = &SectorInfo[SECTOR(MercPtrs[pFace->ubSoldierID]->sSectorX, MercPtrs[pFace->ubSoldierID]->sSectorY)];
|
||||
pSectorInfo = &SectorInfo[SECTOR(pSoldier->sSectorX, pSoldier->sSectorY)];
|
||||
|
||||
if (pSectorInfo)
|
||||
usMaximumPts = (INT16)(pSectorInfo->dFortification_MaxPossible);
|
||||
@@ -2386,8 +2377,8 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
|
||||
}
|
||||
else
|
||||
{
|
||||
bPtsAvailable = MercPtrs[pFace->ubSoldierID]->GetIntelGain();
|
||||
usMaximumPts = (UINT16)(MercPtrs[pFace->ubSoldierID]->GetUncoverRisk());
|
||||
bPtsAvailable = pSoldier->GetIntelGain();
|
||||
usMaximumPts = (UINT16)(pSoldier->GetUncoverRisk());
|
||||
|
||||
swprintf(sString, L"%4.2f/%d%%%%", bPtsAvailable, usMaximumPts);
|
||||
|
||||
@@ -2399,7 +2390,7 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
|
||||
sIconIndex_Assignment = 35;
|
||||
fDoIcon_Assignment = TRUE;
|
||||
fShowCustomText = TRUE;
|
||||
bPtsAvailable = MercPtrs[pFace->ubSoldierID]->GetBurialPoints(&usMaximumPts);
|
||||
bPtsAvailable = pSoldier->GetBurialPoints(&usMaximumPts);
|
||||
|
||||
swprintf(sString, L"%3.1f/%d", bPtsAvailable, usMaximumPts);
|
||||
break;
|
||||
@@ -2408,8 +2399,8 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
|
||||
sIconIndex_Assignment = 36;
|
||||
fDoIcon_Assignment = TRUE;
|
||||
fShowCustomText = TRUE;
|
||||
sPtsAvailable = (INT16)MercPtrs[pFace->ubSoldierID]->GetAdministrationPoints();
|
||||
bPtsAvailable = GetAdministrationPercentage(MercPtrs[pFace->ubSoldierID]->sSectorX, MercPtrs[pFace->ubSoldierID]->sSectorY);
|
||||
sPtsAvailable = (INT16)pSoldier->GetAdministrationPoints();
|
||||
bPtsAvailable = GetAdministrationPercentage(pSoldier->sSectorX, pSoldier->sSectorY);
|
||||
|
||||
swprintf(sString, L"%d/%3.1f", sPtsAvailable, bPtsAvailable);
|
||||
break;
|
||||
@@ -2418,7 +2409,7 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
|
||||
sIconIndex_Assignment = 34;
|
||||
fDoIcon_Assignment = TRUE;
|
||||
fShowCustomText = TRUE;
|
||||
sPtsAvailable = (INT16)MercPtrs[pFace->ubSoldierID]->GetExplorationPoints();
|
||||
sPtsAvailable = (INT16)pSoldier->GetExplorationPoints();
|
||||
|
||||
// we only show our points, not how far we are with the task, lest the player deduct how many items there are to find in the first place
|
||||
swprintf( sString, L"%d", sPtsAvailable );
|
||||
@@ -2426,14 +2417,14 @@ void HandleRenderFaceAdjustments( FACETYPE *pFace, BOOLEAN fDisplayBuffer, BOOLE
|
||||
}
|
||||
|
||||
// Check for being serviced...
|
||||
if (MercPtrs[pFace->ubSoldierID]->ubServicePartner != NOBODY)
|
||||
if (pSoldier->ubServicePartner != NOBODY)
|
||||
{
|
||||
// Doctor...
|
||||
sIconIndex_Assignment = 1;
|
||||
fDoIcon_Assignment = TRUE;
|
||||
}
|
||||
|
||||
if (MercPtrs[pFace->ubSoldierID]->ubServiceCount != 0)
|
||||
if (pSoldier->ubServiceCount != 0)
|
||||
{
|
||||
// Patient
|
||||
sIconIndex_Assignment = 2;
|
||||
@@ -2624,7 +2615,7 @@ BOOLEAN RenderAutoFace( INT32 iFaceIndex )
|
||||
// Set shade
|
||||
if ( pFace->ubSoldierID != NOBODY )
|
||||
{
|
||||
uiFaceShade = GetFaceShade(MercPtrs[pFace->ubSoldierID], pFace, FALSE);
|
||||
uiFaceShade = GetFaceShade(pFace->ubSoldierID, pFace, FALSE);
|
||||
SetFaceShade(pFace, uiFaceShade);
|
||||
}
|
||||
|
||||
@@ -2657,12 +2648,12 @@ BOOLEAN RenderAutoFace( INT32 iFaceIndex )
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN ExternRenderFaceFromSoldier( UINT32 uiBuffer, UINT8 ubSoldierID, INT16 sX, INT16 sY )
|
||||
BOOLEAN ExternRenderFaceFromSoldier( UINT32 uiBuffer, SoldierID ubSoldierID, INT16 sX, INT16 sY )
|
||||
{
|
||||
// Check for valid soldier
|
||||
CHECKF( ubSoldierID != NOBODY );
|
||||
|
||||
return( ExternRenderFace( uiBuffer, MercPtrs[ ubSoldierID ]->iFaceIndex, sX, sY ) );
|
||||
return( ExternRenderFace( uiBuffer, ubSoldierID->iFaceIndex, sX, sY ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -2688,7 +2679,7 @@ BOOLEAN ExternRenderFace( UINT32 uiBuffer, INT32 iFaceIndex, INT16 sX, INT16 sY
|
||||
UINT32 uiFaceShade = FLASH_PORTRAIT_NOSHADE;
|
||||
if ( pFace->ubSoldierID != NOBODY )
|
||||
{
|
||||
uiFaceShade = GetFaceShade(MercPtrs[pFace->ubSoldierID], pFace, TRUE);
|
||||
uiFaceShade = GetFaceShade(pFace->ubSoldierID, pFace, TRUE);
|
||||
SetFaceShade(pFace, uiFaceShade);
|
||||
}
|
||||
|
||||
@@ -2850,7 +2841,7 @@ void HandleAutoFaces( )
|
||||
if ( pFace->ubSoldierID != NOBODY )
|
||||
{
|
||||
// Get Life now
|
||||
pSoldier = MercPtrs[ pFace->ubSoldierID ];
|
||||
pSoldier = pFace->ubSoldierID;
|
||||
bLife = pSoldier->stats.bLife;
|
||||
bInSector = pSoldier->bInSector;
|
||||
bAPs = pSoldier->bActionPoints;
|
||||
|
||||
+34
-32
@@ -1,24 +1,21 @@
|
||||
#include <math.h>
|
||||
#include "sgp.h"
|
||||
#include "soldier profile.h"
|
||||
#include "Soldier Profile.h"
|
||||
#include "Food.h"
|
||||
#include "items.h"
|
||||
#include "morale.h"
|
||||
#include "points.h"
|
||||
#include "Items.h"
|
||||
#include "Morale.h"
|
||||
#include "Points.h"
|
||||
#include "message.h"
|
||||
#include "GameSettings.h" // SANDRO - had to add this, dammit!
|
||||
#include "Random.h"
|
||||
#include "random.h"
|
||||
#include "Text.h"
|
||||
#include "Interface.h"
|
||||
#include "Dialogue Control.h"
|
||||
#include "Sound Control.h"
|
||||
#include "Assignments.h"
|
||||
#include "Overhead.h"
|
||||
#include "Isometric Utils.h"
|
||||
#include "Campaign Types.h"
|
||||
#include "Drugs And Alcohol.h"
|
||||
#include "environment.h"
|
||||
#include "WorldDat.h"
|
||||
#include "Facilities.h"
|
||||
#include "Soldier macros.h"
|
||||
#include "strategicmap.h"
|
||||
@@ -101,7 +98,7 @@ BOOLEAN DoesSoldierRefuseToEat( SOLDIERTYPE *pSoldier, OBJECTTYPE *pObj )
|
||||
if ( UsingFoodSystem() )
|
||||
{
|
||||
// static variables to remember the last food someone was forced to eat
|
||||
static UINT8 lasteater = 0;
|
||||
static UINT16 lasteater = 0;
|
||||
static UINT16 lastitem = 0;
|
||||
|
||||
UINT32 foodtype = Item[pObj->usItem].foodtype;
|
||||
@@ -174,7 +171,7 @@ BOOLEAN ApplyFood( SOLDIERTYPE *pSoldier, OBJECTTYPE *pObject, UINT16 usPointsTo
|
||||
return( FALSE);
|
||||
|
||||
// workaround: canteens with 1% status are treated as 'empty'. They cannot be consumed, but refilled
|
||||
if ( Item[pObject->usItem].canteen == TRUE && (*pObject)[0]->data.objectStatus == 1 )
|
||||
if (ItemIsCanteen(pObject->usItem) && (*pObject)[0]->data.objectStatus == 1 )
|
||||
return( FALSE);
|
||||
|
||||
// do we eat or drink this stuff?
|
||||
@@ -364,7 +361,9 @@ void ReduceBPRegenForHunger( SOLDIERTYPE *pSoldier, INT32 *psPoints )
|
||||
|
||||
void HourlyFoodSituationUpdate( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
if ( !pSoldier )
|
||||
// A merc away on a minievent assignment is ignored since we cannot control their food or water intake.
|
||||
// Without this they would end up losing stats and/or dying during long event assignments, which would lead to the game crashing when death occurs.
|
||||
if ( !pSoldier || pSoldier->bAssignment == ASSIGNMENT_MINIEVENT)
|
||||
return;
|
||||
|
||||
// determine our current activity level
|
||||
@@ -691,7 +690,7 @@ void EatFromInventory( SOLDIERTYPE *pSoldier, BOOLEAN fcanteensonly )
|
||||
// if fcanteensonly is TRUE, omit everything that is not a canteen
|
||||
if ( fcanteensonly )
|
||||
{
|
||||
if ( Item[pObj->usItem].canteen == FALSE )
|
||||
if ( !ItemIsCanteen(pObj->usItem))
|
||||
continue;
|
||||
}
|
||||
else
|
||||
@@ -705,7 +704,7 @@ void EatFromInventory( SOLDIERTYPE *pSoldier, BOOLEAN fcanteensonly )
|
||||
if ( foodcondition < FOOD_BAD_THRESHOLD )
|
||||
continue;
|
||||
|
||||
if ( Item[pObj->usItem].canteen == TRUE )
|
||||
if (ItemIsCanteen(pObj->usItem))
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -739,7 +738,7 @@ void EatFromInventory( SOLDIERTYPE *pSoldier, BOOLEAN fcanteensonly )
|
||||
// if fcanteensonly is TRUE, omit everything that is not a canteen
|
||||
if ( fcanteensonly )
|
||||
{
|
||||
if ( Item[pObj->usItem].canteen == FALSE )
|
||||
if (!ItemIsCanteen(pObj->usItem))
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -761,15 +760,16 @@ void EatFromInventory( SOLDIERTYPE *pSoldier, BOOLEAN fcanteensonly )
|
||||
|
||||
void HourlyFoodUpdate( void )
|
||||
{
|
||||
INT8 bMercID, bLastTeamID;
|
||||
SOLDIERTYPE * pSoldier = NULL;
|
||||
SoldierID bMercID, bLastTeamID;
|
||||
SOLDIERTYPE * pSoldier = NULL;
|
||||
|
||||
bMercID = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
bLastTeamID = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
|
||||
|
||||
// loop through all mercs to calculate their morale
|
||||
for ( pSoldier = MercPtrs[ bMercID ]; bMercID <= bLastTeamID; ++bMercID, ++pSoldier)
|
||||
for ( ; bMercID <= bLastTeamID; ++bMercID )
|
||||
{
|
||||
pSoldier = bMercID;
|
||||
//if the merc is active, and in Arulco
|
||||
if ( pSoldier && pSoldier->bActive && !AM_AN_EPC(pSoldier) && pSoldier->ubProfile != ROBOT && !IsVehicle(pSoldier) && !(pSoldier->bAssignment == IN_TRANSIT || pSoldier->bAssignment == ASSIGNMENT_DEAD ) )
|
||||
{
|
||||
@@ -827,15 +827,16 @@ void SectorFillCanteens( void )
|
||||
addtemperature = FOOD_WATER_POISONOUS_TEMPERATURE;
|
||||
|
||||
// first step: fill all canteens in inventories
|
||||
INT8 bMercID, bLastTeamID;
|
||||
SOLDIERTYPE * pSoldier = NULL;
|
||||
SoldierID bMercID, bLastTeamID;
|
||||
SOLDIERTYPE * pSoldier = NULL;
|
||||
|
||||
bMercID = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
bLastTeamID = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
|
||||
|
||||
// loop through all mercs
|
||||
for ( pSoldier = MercPtrs[ bMercID ]; bMercID <= bLastTeamID; ++bMercID, pSoldier++)
|
||||
for ( ; bMercID <= bLastTeamID; ++bMercID )
|
||||
{
|
||||
pSoldier = bMercID;
|
||||
//if the merc is in this sector
|
||||
if ( pSoldier->bActive && pSoldier->ubProfile != NO_PROFILE && pSoldier->bInSector && ( pSoldier->sSectorX == gWorldSectorX ) && ( pSoldier->sSectorY == gWorldSectorY ) && ( pSoldier->bSectorZ == gbWorldSectorZ) )
|
||||
{
|
||||
@@ -844,7 +845,7 @@ void SectorFillCanteens( void )
|
||||
for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop) // ... for all items in our inventory ...
|
||||
{
|
||||
// ... if Item exists and is canteen (that can have drink points) ...
|
||||
if (pSoldier->inv[bLoop].exists() == true && Item[pSoldier->inv[bLoop].usItem].canteen && Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints > 0)
|
||||
if (pSoldier->inv[bLoop].exists() == true && ItemIsCanteen(pSoldier->inv[bLoop].usItem) && Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints > 0)
|
||||
{
|
||||
OBJECTTYPE* pObj = &(pSoldier->inv[bLoop]); // ... get pointer for this item ...
|
||||
|
||||
@@ -876,7 +877,7 @@ void SectorFillCanteens( void )
|
||||
if( gWorldItems[ uiCount ].fExists ) // ... if item exists ...
|
||||
{
|
||||
// ... if Item exists and is a canteen (only those are refillable) ...
|
||||
if ( Item[gWorldItems[ uiCount ].object.usItem].canteen && Food[Item[gWorldItems[ uiCount ].object.usItem].foodtype].bDrinkPoints > 0)
|
||||
if (ItemIsCanteen(gWorldItems[ uiCount ].object.usItem) && Food[Item[gWorldItems[ uiCount ].object.usItem].foodtype].bDrinkPoints > 0)
|
||||
{
|
||||
OBJECTTYPE* pObj = &(gWorldItems[ uiCount ].object); // ... get pointer for this item ...
|
||||
|
||||
@@ -901,15 +902,16 @@ void SectorFillCanteens( void )
|
||||
INT32 drumsize = Food[Item[pWaterDrum->usItem].foodtype].bDrinkPoints;
|
||||
|
||||
// first step: fill all canteens in inventories
|
||||
INT8 bMercID, bLastTeamID;
|
||||
SOLDIERTYPE * pSoldier = NULL;
|
||||
SoldierID bMercID, bLastTeamID;
|
||||
SOLDIERTYPE * pSoldier = NULL;
|
||||
|
||||
bMercID = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
bLastTeamID = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
|
||||
|
||||
// loop through all mercs
|
||||
for ( pSoldier = MercPtrs[ bMercID ]; bMercID <= bLastTeamID; ++bMercID, pSoldier++)
|
||||
for ( ; bMercID <= bLastTeamID; ++bMercID )
|
||||
{
|
||||
pSoldier = bMercID;
|
||||
//if the merc is in this sector
|
||||
if ( pSoldier->bActive && pSoldier->ubProfile != NO_PROFILE && pSoldier->bInSector && ( pSoldier->sSectorX == gWorldSectorX ) && ( pSoldier->sSectorY == gWorldSectorY ) && ( pSoldier->bSectorZ == gbWorldSectorZ) )
|
||||
{
|
||||
@@ -918,7 +920,7 @@ void SectorFillCanteens( void )
|
||||
for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop) // ... for all items in our inventory ...
|
||||
{
|
||||
// ... if Item exists and is canteen and is NOT a water drum...
|
||||
if (pSoldier->inv[bLoop].exists() == true && Item[pSoldier->inv[bLoop].usItem].canteen && (Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints > 0) && !HasItemFlag(pSoldier->inv[bLoop].usItem, (WATER_DRUM)))
|
||||
if (pSoldier->inv[bLoop].exists() == true && ItemIsCanteen(pSoldier->inv[bLoop].usItem) && (Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints > 0) && !HasItemFlag(pSoldier->inv[bLoop].usItem, (WATER_DRUM)))
|
||||
{
|
||||
OBJECTTYPE* pObj = &(pSoldier->inv[bLoop]); // ... get pointer for this item ...
|
||||
|
||||
@@ -971,7 +973,7 @@ void SectorFillCanteens( void )
|
||||
if( gWorldItems[ uiCount ].fExists ) // ... if item exists ...
|
||||
{
|
||||
// ... if Item exists and is a canteen (only those are refillable) ...
|
||||
if ( Item[gWorldItems[ uiCount ].object.usItem].canteen )
|
||||
if (ItemIsCanteen(gWorldItems[ uiCount ].object.usItem))
|
||||
{
|
||||
OBJECTTYPE* pObj = &(gWorldItems[ uiCount ].object); // ... get pointer for this item ...
|
||||
|
||||
@@ -1029,7 +1031,7 @@ OBJECTTYPE* GetUsableWaterDrumInSector( void )
|
||||
if( gWorldItems[ uiCount ].fExists ) // ... if item exists ...
|
||||
{
|
||||
// ... if Item exists and is a canteen (only those are refillable) ...
|
||||
if ( Item[gWorldItems[ uiCount ].object.usItem].canteen )
|
||||
if (ItemIsCanteen(gWorldItems[ uiCount ].object.usItem))
|
||||
{
|
||||
OBJECTTYPE* pObj = &(gWorldItems[ uiCount ].object); // ... get pointer for this item ...
|
||||
|
||||
@@ -1075,7 +1077,7 @@ void SoldierAutoFillCanteens(SOLDIERTYPE *pSoldier)
|
||||
for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop) // ... for all items in our inventory ...
|
||||
{
|
||||
// ... if Item exists and is canteen (that can have drink points) ...
|
||||
if (pSoldier->inv[bLoop].exists() == true && Item[pSoldier->inv[bLoop].usItem].canteen && Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints > 0)
|
||||
if (pSoldier->inv[bLoop].exists() == true && ItemIsCanteen(pSoldier->inv[bLoop].usItem) && Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints > 0)
|
||||
{
|
||||
OBJECTTYPE* pObj = &(pSoldier->inv[bLoop]); // ... get pointer for this item ...
|
||||
|
||||
@@ -1116,7 +1118,7 @@ BOOLEAN HasFoodInInventory( SOLDIERTYPE *pSoldier, BOOLEAN fCheckFood, BOOLEAN f
|
||||
|
||||
if ( fCheckDrink && Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints )
|
||||
{
|
||||
if ( Item[pSoldier->inv[bLoop].usItem].canteen )
|
||||
if (ItemIsCanteen(pSoldier->inv[bLoop].usItem))
|
||||
{
|
||||
// empty canteens retain 1% status, so check ether something is in them
|
||||
if ( pSoldier->inv[bLoop][0]->data.objectStatus > 1 )
|
||||
@@ -1168,7 +1170,7 @@ void DrinkFromWaterTap( SOLDIERTYPE* pSoldier )
|
||||
for (INT8 bLoop = 0; bLoop < invsize; ++bLoop) // ... for all items in our inventory ...
|
||||
{
|
||||
// ... if Item exists and is canteen (that can have drink points) ...
|
||||
if (pSoldier->inv[bLoop].exists() == true && Item[pSoldier->inv[bLoop].usItem].canteen && Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints > 0)
|
||||
if (pSoldier->inv[bLoop].exists() == true && ItemIsCanteen(pSoldier->inv[bLoop].usItem) && Food[Item[pSoldier->inv[bLoop].usItem].foodtype].bDrinkPoints > 0)
|
||||
{
|
||||
OBJECTTYPE* pObj = &(pSoldier->inv[bLoop]); // ... get pointer for this item ...
|
||||
|
||||
@@ -1195,4 +1197,4 @@ void DrinkFromWaterTap( SOLDIERTYPE* pSoldier )
|
||||
}
|
||||
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, szInteractiveActionText[8], pSoldier->GetName( ) );
|
||||
}
|
||||
}
|
||||
|
||||
+3
-5
@@ -1,11 +1,9 @@
|
||||
#include "builddefines.h"
|
||||
#include "debug.h"
|
||||
#include <string.h>
|
||||
#include "DEBUG.H"
|
||||
#include "types.h"
|
||||
//#include "mssw.h"
|
||||
#include "gap.h"
|
||||
#include "GAP.H"
|
||||
#include "Sound Control.h"
|
||||
#include "soundman.h"
|
||||
#include <stdio.h>
|
||||
#include "FileMan.h"
|
||||
|
||||
SUBSEQUENTSOUNDS subsequentsounds;
|
||||
|
||||
+14
-24
@@ -1,23 +1,21 @@
|
||||
#include "builddefines.h"
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include <wchar.h>
|
||||
#include "sgp.h"
|
||||
#include "worlddef.h"
|
||||
#include "worldman.h"
|
||||
#include "renderworld.h"
|
||||
#include "structure.h"
|
||||
#include "Animation Control.h"
|
||||
#include "points.h"
|
||||
#include "Points.h"
|
||||
#include "opplist.h"
|
||||
#include "overhead.h"
|
||||
#include "tile animation.h"
|
||||
#include "Overhead.h"
|
||||
#include "Tile Animation.h"
|
||||
#include "Interactive Tiles.h"
|
||||
#include "handle doors.h"
|
||||
#include "Handle Doors.h"
|
||||
#include "Sound Control.h"
|
||||
#include "interface.h"
|
||||
#include "keys.h"
|
||||
#include "Interface.h"
|
||||
#include "Keys.h"
|
||||
#include "message.h"
|
||||
#include "text.h"
|
||||
#include "Text.h"
|
||||
#include "random.h"
|
||||
#include "SkillCheck.h"
|
||||
#include "Dialogue Control.h"
|
||||
@@ -29,20 +27,14 @@
|
||||
#include "Isometric Utils.h"
|
||||
#include "ai.h"
|
||||
#include "Soldier macros.h"
|
||||
#include "Event Pump.h"
|
||||
#include "GameSettings.h"
|
||||
#include "fresh_header.h"
|
||||
#include "connect.h"
|
||||
#include <language.hpp>
|
||||
|
||||
#ifdef JA2UB
|
||||
#include "Explosion Control.h"
|
||||
#include "Ja25_Tactical.h"
|
||||
#include "Ja25 Strategic Ai.h"
|
||||
#include "MapScreen Quotes.h"
|
||||
#include "email.h"
|
||||
#include "interface Dialogue.h"
|
||||
#include "mercs.h"
|
||||
#include "ub_config.h"
|
||||
#endif
|
||||
|
||||
BOOLEAN gfSetPerceivedDoorState = FALSE;
|
||||
@@ -438,12 +430,10 @@ void ProcessImplicationsOfPCMessingWithDoor( SOLDIERTYPE * pSoldier )
|
||||
// if player is hacking at a door in the brothel and a kingpin guy can see him
|
||||
if ( (InARoom( pSoldier->sGridNo, &usRoom ) && IN_BROTHEL( usRoom )) || (gWorldSectorX == 5 && gWorldSectorY == MAP_ROW_D && gbWorldSectorZ == 0 && (pSoldier->sGridNo == gModSettings.iBrothelDoor1 || pSoldier->sGridNo == gModSettings.iBrothelDoor2 || pSoldier->sGridNo == gModSettings.iBrothelDoor3 ) ) )//11010,11177,11176
|
||||
{
|
||||
UINT8 ubLoop;
|
||||
|
||||
// see if a kingpin goon can see us
|
||||
for ( ubLoop = gTacticalStatus.Team[ CIV_TEAM ].bFirstID; ubLoop <= gTacticalStatus.Team[ CIV_TEAM ].bLastID; ubLoop++ )
|
||||
for ( SoldierID ubLoop = gTacticalStatus.Team[ CIV_TEAM ].bFirstID; ubLoop <= gTacticalStatus.Team[ CIV_TEAM ].bLastID; ++ubLoop )
|
||||
{
|
||||
pGoon = MercPtrs[ ubLoop ];
|
||||
pGoon = ubLoop;
|
||||
if ( pGoon->ubCivilianGroup == KINGPIN_CIV_GROUP && pGoon->bActive && pGoon->bInSector && pGoon->stats.bLife >= OKLIFE && pGoon->aiData.bOppList[ pSoldier->ubID ] == SEEN_CURRENTLY )
|
||||
{
|
||||
MakeCivHostile(pGoon);
|
||||
@@ -1492,7 +1482,7 @@ void SetDoorString( INT32 sGridNo )
|
||||
// ATE: If here, we try to say, opened or closed...
|
||||
if ( gfUIIntTileLocation2 == FALSE )
|
||||
{
|
||||
#ifdef GERMAN
|
||||
if( g_lang == i18n::Lang::de ) {
|
||||
|
||||
wcscpy( gzIntTileLocation2, TacticalStr[ DOOR_DOOR_MOUSE_DESCRIPTION ] );
|
||||
gfUIIntTileLocation2 = TRUE;
|
||||
@@ -1535,7 +1525,7 @@ void SetDoorString( INT32 sGridNo )
|
||||
gfUIIntTileLocation = TRUE;
|
||||
}
|
||||
}
|
||||
#else
|
||||
} else {
|
||||
|
||||
// Try to get doors status here...
|
||||
pDoorStatus = GetDoorStatus( sGridNo );
|
||||
@@ -1576,7 +1566,7 @@ void SetDoorString( INT32 sGridNo )
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -26,4 +26,4 @@ void HandleDoorChangeFromGridNo( SOLDIERTYPE *pSoldier, INT32 sGridNo, BOOLEAN f
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+135
-145
@@ -1,66 +1,61 @@
|
||||
#include "connect.h"
|
||||
#include "items.h"
|
||||
#include "Items.h"
|
||||
#include "Action Items.h"
|
||||
#include "handle Items.h"
|
||||
#include "overhead.h"
|
||||
#include "weapons.h"
|
||||
#include "points.h"
|
||||
#include "Overhead.h"
|
||||
#include "Weapons.h"
|
||||
#include "Points.h"
|
||||
#include "tiledef.h"
|
||||
#include "worlddef.h"
|
||||
#include "worldman.h"
|
||||
#include "interface.h"
|
||||
#include "Interface.h"
|
||||
#include "renderworld.h"
|
||||
#include "Animation Control.h"
|
||||
#include "font control.h"
|
||||
#include "render dirty.h"
|
||||
#include "Font Control.h"
|
||||
#include "Render Dirty.h"
|
||||
#include "World items.h"
|
||||
#include "text.h"
|
||||
#include "Text.h"
|
||||
#include "Timer Control.h"
|
||||
#include "wcheck.h"
|
||||
#include "interface items.h"
|
||||
#include "physics.h"
|
||||
#include "soldier profile.h"
|
||||
#include "interface dialogue.h"
|
||||
#include "quests.h"
|
||||
#include "WCheck.h"
|
||||
#include "Interface Items.h"
|
||||
#include "Soldier Profile.h"
|
||||
#include "interface Dialogue.h"
|
||||
#include "Quests.h"
|
||||
#include "message.h"
|
||||
#include "isometric utils.h"
|
||||
#include "los.h"
|
||||
#include "dialogue control.h"
|
||||
#include "Isometric Utils.h"
|
||||
#include "LOS.h"
|
||||
#include "Dialogue Control.h"
|
||||
#include "ai.h"
|
||||
#include "soldier macros.h"
|
||||
#include "interface panels.h"
|
||||
#include "Strategic Town Loyalty.h"
|
||||
#include "soldier functions.h"
|
||||
#include "Map Screen Helicopter.h"
|
||||
#include "pathai.h"
|
||||
#include "Soldier macros.h"
|
||||
#include "Interface Panels.h"
|
||||
#include "Soldier Functions.h"
|
||||
#include "PATHAI.H"
|
||||
#include "fov.h"
|
||||
#include "MessageBoxScreen.h"
|
||||
#include "explosion control.h"
|
||||
#include "Explosion Control.h"
|
||||
#include "SkillCheck.h"
|
||||
#include "Campaign.h"
|
||||
#include "Random.h"
|
||||
#include "structure wrap.h"
|
||||
#include "interactive tiles.h"
|
||||
#include "random.h"
|
||||
#include "Structure Wrap.h"
|
||||
#include "Interactive Tiles.h"
|
||||
#include "SaveLoadMap.h"
|
||||
#include "ShopKeeper Interface.h"
|
||||
#include "Arms Dealer Init.h"
|
||||
#include "soldier add.h"
|
||||
#include "Soldier Add.h"
|
||||
#include "Sound Control.h"
|
||||
#include "squads.h"
|
||||
#include "rotting corpses.h"
|
||||
#include "soldier ani.h"
|
||||
#include "Opplist.h"
|
||||
#include "Squads.h"
|
||||
#include "Rotting Corpses.h"
|
||||
#include "Soldier Ani.h"
|
||||
#include "opplist.h"
|
||||
#include "qarray.h"
|
||||
#include "render fun.h"
|
||||
#include "Render Fun.h"
|
||||
#include "Map Information.h"
|
||||
#include "GameSettings.h"
|
||||
#include "end game.h"
|
||||
#include "interface control.h"
|
||||
#include "End Game.h"
|
||||
#include "Interface Control.h"
|
||||
#include "Map Screen Interface Map Inventory.h"
|
||||
// added by SANDRO
|
||||
#include "Morale.h"
|
||||
// added by Flugente
|
||||
#include "drugs and alcohol.h"
|
||||
#include "Drugs And Alcohol.h"
|
||||
#include "Food.h"
|
||||
// added by sevenfm - this is needed for _keydown(SHIFT) to work
|
||||
#include "english.h"
|
||||
@@ -75,13 +70,12 @@
|
||||
#include "Game Clock.h" // added by Flugente
|
||||
#include <vfs/Core/vfs_file_raii.h> // added by Flugente for vfs-stuff
|
||||
#include "DynamicDialogue.h" // added by Flugente for SoldierRelation()
|
||||
#include "MessageBoxScreen.h" // added by Flugente
|
||||
#include "Map Screen Interface.h" // added by Flugente
|
||||
#include "Map Screen Interface Map.h" // added by Flugente
|
||||
#include "WorldDat.h"
|
||||
|
||||
#ifdef JA2UB
|
||||
#include "Ja25_Tactical.h"
|
||||
#include "Ja25 Strategic Ai.h"
|
||||
#endif
|
||||
|
||||
#define NUM_ITEMS_LISTED 8
|
||||
@@ -239,20 +233,20 @@ BOOLEAN HandleCheckForBadChangeToGetThrough( SOLDIERTYPE *pSoldier, SOLDIERTYPE
|
||||
|
||||
INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHandItem, BOOLEAN fFromUI )
|
||||
{
|
||||
SOLDIERTYPE *pTargetSoldier = NULL;
|
||||
UINT16 usSoldierIndex;
|
||||
INT32 sTargetGridNo;
|
||||
INT16 sAPCost;
|
||||
INT32 sActionGridNo;
|
||||
UINT8 ubDirection = 0;
|
||||
INT32 sAdjustedGridNo;
|
||||
BOOLEAN fDropBomb = FALSE;
|
||||
BOOLEAN fAddingTurningCost = FALSE;
|
||||
BOOLEAN fAddingRaiseGunCost = FALSE;
|
||||
LEVELNODE *pIntNode;
|
||||
STRUCTURE *pStructure;
|
||||
UINT16 usRaiseGunCost = 0;
|
||||
UINT16 usTurningCost = 0;
|
||||
SOLDIERTYPE *pTargetSoldier = NULL;
|
||||
SoldierID usSoldierIndex;
|
||||
INT32 sTargetGridNo;
|
||||
INT16 sAPCost;
|
||||
INT32 sActionGridNo;
|
||||
UINT8 ubDirection = 0;
|
||||
INT32 sAdjustedGridNo;
|
||||
BOOLEAN fDropBomb = FALSE;
|
||||
BOOLEAN fAddingTurningCost = FALSE;
|
||||
BOOLEAN fAddingRaiseGunCost = FALSE;
|
||||
LEVELNODE *pIntNode;
|
||||
STRUCTURE *pStructure;
|
||||
UINT16 usRaiseGunCost = 0;
|
||||
UINT16 usTurningCost = 0;
|
||||
|
||||
//shadooow: automatically close EDB when opened and trying to use any weapon or action
|
||||
if (gfInItemDescBox)
|
||||
@@ -277,7 +271,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
|
||||
//if ( FindSoldier( sGridNo, &usSoldierIndex, &uiMercFlags, FIND_SOLDIER_GRIDNO ) )
|
||||
if ( ( usSoldierIndex = WhoIsThere2( sGridNo, bLevel ) ) != NOBODY )
|
||||
{
|
||||
pTargetSoldier = MercPtrs[ usSoldierIndex ];
|
||||
pTargetSoldier = usSoldierIndex;
|
||||
|
||||
// anv: don't try to heal interactive spots
|
||||
if (fFromUI && Item[usHandItem].usItemClass != IC_MEDKIT)
|
||||
@@ -319,7 +313,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
|
||||
pSoldier->ubProfile != NO_PROFILE &&
|
||||
pTargetSoldier &&
|
||||
Item[usHandItem].usItemClass != IC_MEDKIT &&
|
||||
!Item[usHandItem].gascan &&
|
||||
!ItemIsGascan(usHandItem) &&
|
||||
!ItemCanBeAppliedToOthers(usHandItem) &&
|
||||
!HasItemFlag(usHandItem, EMPTY_BLOOD_BAG) &&
|
||||
!HasItemFlag( usHandItem, MEDICAL_SPLINT ) )
|
||||
@@ -473,8 +467,8 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
|
||||
if ( Item[ usHandItem ].usItemClass == IC_GUN || Item[ usHandItem ].usItemClass == IC_THROWING_KNIFE )
|
||||
{
|
||||
// WEAPONS
|
||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("HandleItem: checking for fingerprintID, item id = %d,id required = %d, imprint id = %d, soldier id = %d",usHandItem,Item[usHandItem].fingerprintid,pSoldier->inv[ pSoldier->ubAttackingHand ][0]->data.ubImprintID,pSoldier->ubProfile));
|
||||
if ( Item[usHandItem].fingerprintid )
|
||||
DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("HandleItem: checking for fingerprintID, item id = %d,id required = %d, imprint id = %d, soldier id = %d",usHandItem, ItemHasFingerPrintID(usHandItem), pSoldier->inv[ pSoldier->ubAttackingHand ][0]->data.ubImprintID,pSoldier->ubProfile));
|
||||
if (ItemHasFingerPrintID(usHandItem))
|
||||
{
|
||||
// check imprint ID
|
||||
// NB not-imprinted value is NO_PROFILE
|
||||
@@ -807,7 +801,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
|
||||
}
|
||||
|
||||
// ATE: Here to make cursor go back to move after LAW shot...
|
||||
if ( fFromUI && Item[usHandItem].singleshotrocketlauncher)
|
||||
if ( fFromUI && ItemIsSingleShotRocketLauncher(usHandItem) )
|
||||
{
|
||||
guiPendingOverrideEvent = A_CHANGE_TO_MOVE;
|
||||
}
|
||||
@@ -969,7 +963,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
|
||||
BOOLEAN fCorpse = FALSE;
|
||||
if(pCorpse != NULL)
|
||||
fCorpse = IsValidDecapitationCorpse( pCorpse );
|
||||
if ( Item[usHandItem].wirecutters && pTargetSoldier == NULL && !pCorpse ) // Madd: quick fix to allow wirecutter/knives
|
||||
if (ItemIsWirecutters(usHandItem) && pTargetSoldier == NULL && !pCorpse ) // Madd: quick fix to allow wirecutter/knives
|
||||
{
|
||||
// See if we can get there to stab
|
||||
sActionGridNo = FindAdjacentGridEx( pSoldier, sGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
|
||||
@@ -1025,9 +1019,9 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
|
||||
}
|
||||
}
|
||||
|
||||
if ( Item[usHandItem].toolkit )
|
||||
if (ItemIsToolkit(usHandItem))
|
||||
{
|
||||
UINT8 ubMercID;
|
||||
UINT16 ubMercID;
|
||||
BOOLEAN fVehicle = FALSE;
|
||||
INT32 sVehicleGridNo=-1;
|
||||
|
||||
@@ -1098,9 +1092,9 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
|
||||
}
|
||||
}
|
||||
|
||||
if ( Item[usHandItem].gascan )
|
||||
if (ItemIsGascan(usHandItem))
|
||||
{
|
||||
UINT8 ubMercID;
|
||||
UINT16 ubMercID;
|
||||
INT32 sVehicleGridNo=-1;
|
||||
|
||||
// For repair, check if we are over a vehicle, then get gridnot to edge of that vehicle!
|
||||
@@ -1170,7 +1164,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
|
||||
}
|
||||
|
||||
|
||||
if ( Item[usHandItem].jar )
|
||||
if (ItemIsJar(usHandItem))
|
||||
{
|
||||
sActionGridNo = FindAdjacentGridEx( pSoldier, sGridNo, &ubDirection, &sAdjustedGridNo, TRUE, FALSE );
|
||||
|
||||
@@ -1394,11 +1388,11 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
|
||||
}
|
||||
}
|
||||
|
||||
UINT8 ubPerson = WhoIsThere2(usMapPos, pSoldier->pathing.bLevel);
|
||||
SoldierID ubPerson = WhoIsThere2(usMapPos, pSoldier->pathing.bLevel);
|
||||
|
||||
// Flugente: apply misc items to other soldiers
|
||||
// sevenfm: check that target soldier is visible
|
||||
if (ItemCanBeAppliedToOthers(usHandItem) && ubPerson != NOBODY && MercPtrs[ubPerson] && MercPtrs[ubPerson]->bVisible != 0)
|
||||
if (ItemCanBeAppliedToOthers(usHandItem) && ubPerson != NOBODY && ubPerson->bVisible != 0)
|
||||
{
|
||||
// ATE: AI CANNOT GO THROUGH HERE!
|
||||
BOOLEAN fHadToUseCursorPos = FALSE;
|
||||
@@ -1614,7 +1608,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
|
||||
}
|
||||
}
|
||||
|
||||
if ( Item[usHandItem].canandstring )
|
||||
if (ItemIsCanAndString(usHandItem))
|
||||
{
|
||||
STRUCTURE *pStructure;
|
||||
LEVELNODE *pIntTile;
|
||||
@@ -1686,7 +1680,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
|
||||
if ( EnoughPoints( pSoldier, sAPCost, 0, fFromUI ) )
|
||||
{
|
||||
DeductPoints( pSoldier, sAPCost, 0 );
|
||||
if ( Item[usHandItem].xray )
|
||||
if (ItemHasXRay(usHandItem))
|
||||
{
|
||||
PlayJA2Sample( USE_X_RAY_MACHINE, RATE_11025, SoundVolume( HIGHVOLUME, pSoldier->sGridNo ), 1, SoundDir( pSoldier->sGridNo ) );
|
||||
|
||||
@@ -1867,7 +1861,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
|
||||
sAPCost = MinAPsToAttack( pSoldier, sTargetGridNo, TRUE, pSoldier->aiData.bAimTime, 0 );
|
||||
|
||||
// Check if these is room to place mortar!
|
||||
if ( Item[usHandItem].mortar )
|
||||
if (ItemIsMortar(usHandItem))
|
||||
{
|
||||
ubDirection = (UINT8)GetDirectionFromGridNo( sTargetGridNo, pSoldier );
|
||||
|
||||
@@ -1881,7 +1875,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
|
||||
|
||||
//pSoldier->flags.fDontChargeAPsForStanceChange = TRUE;//dnl ch72 270913 no reason why not charge for stance change
|
||||
}
|
||||
else if ( Item[usHandItem].grenadelauncher )//usHandItem == GLAUNCHER || usHandItem == UNDER_GLAUNCHER )
|
||||
else if (ItemIsGrenadeLauncher(usHandItem))//usHandItem == GLAUNCHER || usHandItem == UNDER_GLAUNCHER )
|
||||
{
|
||||
GetAPChargeForShootOrStabWRTGunRaises( pSoldier, sTargetGridNo, TRUE, &fAddingTurningCost, &fAddingRaiseGunCost, pSoldier->aiData.bAimTime );
|
||||
usTurningCost = CalculateTurningCost(pSoldier, usHandItem, fAddingTurningCost);
|
||||
@@ -1960,7 +1954,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
|
||||
if ( Item[ usHandItem ].ubCursor == INVALIDCURS )
|
||||
{
|
||||
// Found detonator...
|
||||
if ( HasAttachmentOfClass( &(pSoldier->inv[pSoldier->ubAttackingHand]), (AC_DETONATOR | AC_REMOTEDET | AC_DEFUSE) ) || Item[usHandItem].tripwire )
|
||||
if ( HasAttachmentOfClass( &(pSoldier->inv[pSoldier->ubAttackingHand]), (AC_DETONATOR | AC_REMOTEDET | AC_DEFUSE) ) || ItemIsTripwire(usHandItem))
|
||||
{
|
||||
StartBombMessageBox( pSoldier, sGridNo );
|
||||
|
||||
@@ -1980,7 +1974,7 @@ INT32 HandleItem( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT16 usHa
|
||||
void HandleSoldierDropBomb( SOLDIERTYPE *pSoldier, INT32 sGridNo )
|
||||
{
|
||||
// Does this have detonator that needs info?
|
||||
if ( HasAttachmentOfClass( &(pSoldier->inv[ HANDPOS ] ), (AC_DETONATOR | AC_REMOTEDET | AC_DEFUSE) ) || Item[ (&(pSoldier->inv[ HANDPOS ] ))->usItem ].tripwire == 1)
|
||||
if ( HasAttachmentOfClass( &(pSoldier->inv[ HANDPOS ] ), (AC_DETONATOR | AC_REMOTEDET | AC_DEFUSE) ) || ItemIsTripwire((&(pSoldier->inv[ HANDPOS ] ))->usItem) )
|
||||
{
|
||||
StartBombMessageBox( pSoldier, sGridNo );
|
||||
}
|
||||
@@ -2003,7 +1997,7 @@ void HandleSoldierDropBomb( SOLDIERTYPE *pSoldier, INT32 sGridNo )
|
||||
if ( iResult >= 0 )
|
||||
{
|
||||
// Less explosives gain for placing tripwire
|
||||
if ( Item[ pSoldier->inv[ HANDPOS ].usItem ].tripwire )
|
||||
if (ItemIsTripwire(pSoldier->inv[ HANDPOS ].usItem))
|
||||
StatChange( pSoldier, EXPLODEAMT, 1, FALSE );
|
||||
else if ( HasItemFlag( (pSoldier->inv[HANDPOS]).usItem, BEARTRAP ) )
|
||||
StatChange( pSoldier, MECHANAMT, 10, FALSE );
|
||||
@@ -2027,7 +2021,7 @@ void HandleSoldierDropBomb( SOLDIERTYPE *pSoldier, INT32 sGridNo )
|
||||
pSoldier->inv[ HANDPOS ][0]->data.bTrap++;
|
||||
|
||||
// anv: additional tile properties - modify trap level depending on its placement
|
||||
if(gGameExternalOptions.fAdditionalTileProperties && Item[ pSoldier->inv[ HANDPOS ].usItem ].tripwire != 1 )
|
||||
if(gGameExternalOptions.fAdditionalTileProperties && !ItemIsTripwire(pSoldier->inv[ HANDPOS ].usItem))
|
||||
{
|
||||
ADDITIONAL_TILE_PROPERTIES_VALUES zAllTileValues = GetAllAdditonalTilePropertiesForGrid( sGridNo, pSoldier->pathing.bLevel );
|
||||
pSoldier->inv[ HANDPOS ][0]->data.bTrap += zAllTileValues.bTrapBonus;
|
||||
@@ -2072,7 +2066,7 @@ void HandleSoldierDropBomb( SOLDIERTYPE *pSoldier, INT32 sGridNo )
|
||||
StatChange( pSoldier, EXPLODEAMT, 10, FROM_FAILURE );
|
||||
|
||||
// oops! How badly did we screw up?
|
||||
if ( iResult < -20 && Item[ pSoldier->inv[ HANDPOS ].usItem ].tripwire != 1 )
|
||||
if ( iResult < -20 && !ItemIsTripwire(pSoldier->inv[ HANDPOS ].usItem) )
|
||||
{
|
||||
// OOPS! ... BOOM!
|
||||
IgniteExplosion( NOBODY, pSoldier->sX, pSoldier->sY, (INT16) (gpWorldLevelData[pSoldier->sGridNo].sHeight), pSoldier->sGridNo, pSoldier->inv[ HANDPOS ].usItem, pSoldier->pathing.bLevel, pSoldier->ubDirection, &pSoldier->inv[ HANDPOS ] );
|
||||
@@ -2137,7 +2131,7 @@ void SoldierHandleDropItem( SOLDIERTYPE *pSoldier )
|
||||
}
|
||||
}
|
||||
|
||||
AddItemToPool( pSoldier->sGridNo, pSoldier->pTempObject, 1, pSoldier->pathing.bLevel, 0 , -1 );
|
||||
AddItemToPool( pSoldier->sGridNo, pSoldier->pTempObject, 1, pSoldier->pathing.bLevel, 0, -1 );
|
||||
NotifySoldiersToLookforItems( );
|
||||
|
||||
OBJECTTYPE::DeleteMe( &pSoldier->pTempObject );
|
||||
@@ -2380,7 +2374,7 @@ void HandleAutoPlaceFail( SOLDIERTYPE *pSoldier, INT32 iItemIndex, INT32 sGridNo
|
||||
else
|
||||
{
|
||||
// Add back to world...
|
||||
AddItemToPool( sGridNo, &(gWorldItems[ iItemIndex ].object ), 1 , pSoldier->pathing.bLevel, 0, -1 );
|
||||
AddItemToPool( sGridNo, &(gWorldItems[ iItemIndex ].object ), 1, pSoldier->pathing.bLevel, 0, -1 );
|
||||
|
||||
// If we are a merc, say DAMN quote....
|
||||
if ( pSoldier->bTeam == gbPlayerNum )
|
||||
@@ -2576,7 +2570,7 @@ void SoldierGetItemFromWorld( SOLDIERTYPE *pSoldier, INT32 iItemIndex, INT32 sGr
|
||||
if ( ItemExistsAtLocation( sGridNo, iItemIndex, pSoldier->pathing.bLevel ) )
|
||||
{
|
||||
// Flugente: if item is tripwireactivated and is a planted bomb, call the defuse dialogue. We obviously know about the items' existence already...
|
||||
if ( gWorldItems[ iItemIndex ].object.exists() && gWorldItems[ iItemIndex ].object.fFlags & OBJECT_ARMED_BOMB && Item[gWorldItems[ iItemIndex ].object.usItem].tripwireactivation == 1 )
|
||||
if ( gWorldItems[ iItemIndex ].object.exists() && gWorldItems[ iItemIndex ].object.fFlags & OBJECT_ARMED_BOMB && ItemHasTripwireActivation(gWorldItems[ iItemIndex ].object.usItem) )
|
||||
{
|
||||
gpBoobyTrapItemPool = GetItemPoolForIndex( sGridNo, iItemIndex, pSoldier->pathing.bLevel );
|
||||
gpBoobyTrapSoldier = pSoldier;
|
||||
@@ -2948,17 +2942,17 @@ void RemoveItemGraphicFromWorld( INVTYPE *pItem, INT32 sGridNo, UINT8 ubLevel, L
|
||||
}
|
||||
|
||||
// INVENTORY POOL STUFF
|
||||
OBJECTTYPE* AddItemToPool( INT32 sGridNo, OBJECTTYPE *pObject, INT8 bVisible, UINT8 ubLevel, UINT16 usFlags, INT8 bRenderZHeightAboveLevel, INT8 soldierID )
|
||||
OBJECTTYPE* AddItemToPool( INT32 sGridNo, OBJECTTYPE *pObject, INT8 bVisible, UINT8 ubLevel, UINT16 usFlags, INT8 bRenderZHeightAboveLevel, INT16 soldierID)
|
||||
{
|
||||
return InternalAddItemToPool( &sGridNo, pObject, bVisible, ubLevel, usFlags, bRenderZHeightAboveLevel, soldierID, NULL );
|
||||
}
|
||||
|
||||
OBJECTTYPE * AddItemToPoolAndGetIndex( INT32 sGridNo, OBJECTTYPE *pObject, INT8 bVisible, UINT8 ubLevel, UINT16 usFlags, INT8 bRenderZHeightAboveLevel, INT8 soldierID, INT32 * piItemIndex )
|
||||
OBJECTTYPE * AddItemToPoolAndGetIndex( INT32 sGridNo, OBJECTTYPE *pObject, INT8 bVisible, UINT8 ubLevel, UINT16 usFlags, INT8 bRenderZHeightAboveLevel, SoldierID soldierID, INT32 * piItemIndex )
|
||||
{
|
||||
return( InternalAddItemToPool( &sGridNo, pObject, bVisible, ubLevel, usFlags, bRenderZHeightAboveLevel, soldierID, piItemIndex ) );
|
||||
}
|
||||
|
||||
OBJECTTYPE* InternalAddItemToPool( INT32 *psGridNo, OBJECTTYPE *pObject, INT8 bVisible, UINT8 ubLevel, UINT16 usFlags, INT8 bRenderZHeightAboveLevel, INT8 soldierID, INT32 * piItemIndex )
|
||||
OBJECTTYPE* InternalAddItemToPool( INT32 *psGridNo, OBJECTTYPE *pObject, INT8 bVisible, UINT8 ubLevel, UINT16 usFlags, INT8 bRenderZHeightAboveLevel, SoldierID soldierID, INT32 * piItemIndex )
|
||||
{
|
||||
ITEM_POOL *pItemPool;
|
||||
ITEM_POOL *pItemPoolTemp;
|
||||
@@ -2998,8 +2992,7 @@ OBJECTTYPE* InternalAddItemToPool( INT32 *psGridNo, OBJECTTYPE *pObject, INT8 bV
|
||||
|
||||
if ( TERRAIN_IS_WATER( bTerrainID) )
|
||||
{
|
||||
// if ( Item[ pObject->usItem ].fFlags & ITEM_SINKS )
|
||||
if ( Item[ pObject->usItem ].sinks )
|
||||
if (ItemSinks(pObject->usItem))
|
||||
{
|
||||
return( NULL );
|
||||
}
|
||||
@@ -3340,7 +3333,7 @@ BOOLEAN MarblesExistAtLocation( INT32 sGridNo, UINT8 ubLevel, INT32 * piItemInde
|
||||
pItemPoolTemp = pItemPool;
|
||||
while( pItemPoolTemp != NULL )
|
||||
{
|
||||
if ( Item[gWorldItems[ pItemPoolTemp->iItemIndex ].object.usItem].marbles )
|
||||
if (ItemIsMarbles(gWorldItems[ pItemPoolTemp->iItemIndex ].object.usItem))
|
||||
{
|
||||
if ( piItemIndex )
|
||||
{
|
||||
@@ -4293,9 +4286,8 @@ BOOLEAN DrawItemPoolList( ITEM_POOL *pItemPool, INT32 sGridNo, UINT8 bCommand, I
|
||||
if (gGameExternalOptions.gfShowBackpackOwner &&
|
||||
Item[gWorldItems[pItemPool->iItemIndex].object.usItem].usItemClass == IC_LBEGEAR &&
|
||||
LoadBearingEquipment[Item[gWorldItems[pItemPool->iItemIndex].object.usItem].ubClassIndex].lbeClass == BACKPACK &&
|
||||
gWorldItems[pItemPool->iItemIndex].soldierID != -1 &&
|
||||
MercPtrs[gWorldItems[pItemPool->iItemIndex].soldierID])
|
||||
swprintf(pStr, L"%s (%d) (%s)", ShortItemNames[gWorldItems[pTempItemPool->iItemIndex].object.usItem], gWorldItems[pTempItemPool->iItemIndex].object.ubNumberOfObjects, MercPtrs[gWorldItems[pItemPool->iItemIndex].soldierID]->GetName());
|
||||
gWorldItems[pItemPool->iItemIndex].soldierID != NOBODY)
|
||||
swprintf(pStr, L"%s (%d) (%s)", ShortItemNames[gWorldItems[pTempItemPool->iItemIndex].object.usItem], gWorldItems[pTempItemPool->iItemIndex].object.ubNumberOfObjects, gWorldItems[pItemPool->iItemIndex].soldierID->GetName());
|
||||
else
|
||||
swprintf( pStr, L"%s (%d)", ShortItemNames[ gWorldItems[ pTempItemPool->iItemIndex ].object.usItem ], gWorldItems[ pTempItemPool->iItemIndex ].object.ubNumberOfObjects );
|
||||
}
|
||||
@@ -4304,9 +4296,8 @@ BOOLEAN DrawItemPoolList( ITEM_POOL *pItemPool, INT32 sGridNo, UINT8 bCommand, I
|
||||
if (gGameExternalOptions.gfShowBackpackOwner &&
|
||||
Item[gWorldItems[pItemPool->iItemIndex].object.usItem].usItemClass == IC_LBEGEAR &&
|
||||
LoadBearingEquipment[Item[gWorldItems[pItemPool->iItemIndex].object.usItem].ubClassIndex].lbeClass == BACKPACK &&
|
||||
gWorldItems[pItemPool->iItemIndex].soldierID != -1 &&
|
||||
MercPtrs[gWorldItems[pItemPool->iItemIndex].soldierID])
|
||||
swprintf(pStr, L"%s (%s)", ShortItemNames[gWorldItems[pTempItemPool->iItemIndex].object.usItem], MercPtrs[gWorldItems[pItemPool->iItemIndex].soldierID]->GetName());
|
||||
gWorldItems[pItemPool->iItemIndex].soldierID != NOBODY)
|
||||
swprintf(pStr, L"%s (%s)", ShortItemNames[gWorldItems[pTempItemPool->iItemIndex].object.usItem], gWorldItems[pItemPool->iItemIndex].soldierID->GetName());
|
||||
else
|
||||
swprintf( pStr, L"%s", ShortItemNames[ gWorldItems[ pTempItemPool->iItemIndex ].object.usItem ] );
|
||||
}
|
||||
@@ -4414,9 +4405,8 @@ BOOLEAN DrawItemPoolList( ITEM_POOL *pItemPool, INT32 sGridNo, UINT8 bCommand, I
|
||||
if (gGameExternalOptions.gfShowBackpackOwner &&
|
||||
Item[gWorldItems[pItemPool->iItemIndex].object.usItem].usItemClass == IC_LBEGEAR &&
|
||||
LoadBearingEquipment[Item[gWorldItems[pItemPool->iItemIndex].object.usItem].ubClassIndex].lbeClass == BACKPACK &&
|
||||
gWorldItems[pItemPool->iItemIndex].soldierID != -1 &&
|
||||
MercPtrs[gWorldItems[pItemPool->iItemIndex].soldierID])
|
||||
swprintf(pStr, L"%s (%d) (%s)", ShortItemNames[gWorldItems[pItemPool->iItemIndex].object.usItem], gWorldItems[pItemPool->iItemIndex].object.ubNumberOfObjects, MercPtrs[gWorldItems[pItemPool->iItemIndex].soldierID]->GetName());
|
||||
gWorldItems[pItemPool->iItemIndex].soldierID != NOBODY)
|
||||
swprintf(pStr, L"%s (%d) (%s)", ShortItemNames[gWorldItems[pItemPool->iItemIndex].object.usItem], gWorldItems[pItemPool->iItemIndex].object.ubNumberOfObjects, gWorldItems[pItemPool->iItemIndex].soldierID->GetName());
|
||||
else
|
||||
swprintf( pStr, L"%s (%d)", ShortItemNames[ gWorldItems[ pItemPool->iItemIndex ].object.usItem ], gWorldItems[ pItemPool->iItemIndex ].object.ubNumberOfObjects );
|
||||
}
|
||||
@@ -4425,9 +4415,8 @@ BOOLEAN DrawItemPoolList( ITEM_POOL *pItemPool, INT32 sGridNo, UINT8 bCommand, I
|
||||
if (gGameExternalOptions.gfShowBackpackOwner &&
|
||||
Item[gWorldItems[pItemPool->iItemIndex].object.usItem].usItemClass == IC_LBEGEAR &&
|
||||
LoadBearingEquipment[Item[gWorldItems[pItemPool->iItemIndex].object.usItem].ubClassIndex].lbeClass == BACKPACK &&
|
||||
gWorldItems[pItemPool->iItemIndex].soldierID != -1 &&
|
||||
MercPtrs[gWorldItems[pItemPool->iItemIndex].soldierID])
|
||||
swprintf(pStr, L"%s (%s)", ShortItemNames[gWorldItems[pItemPool->iItemIndex].object.usItem], MercPtrs[gWorldItems[pItemPool->iItemIndex].soldierID]->GetName());
|
||||
gWorldItems[pItemPool->iItemIndex].soldierID != NOBODY)
|
||||
swprintf(pStr, L"%s (%s)", ShortItemNames[gWorldItems[pItemPool->iItemIndex].object.usItem], gWorldItems[pItemPool->iItemIndex].soldierID->GetName());
|
||||
else
|
||||
swprintf( pStr, L"%s", ShortItemNames[ gWorldItems[ pItemPool->iItemIndex ].object.usItem ] );
|
||||
}
|
||||
@@ -4815,12 +4804,12 @@ void RenderTopmostFlashingItems( )
|
||||
BOOLEAN VerifyGiveItem( SOLDIERTYPE *pSoldier, SOLDIERTYPE **ppTargetSoldier )
|
||||
{
|
||||
SOLDIERTYPE *pTSoldier;
|
||||
UINT16 usSoldierIndex;
|
||||
SoldierID usSoldierIndex;
|
||||
OBJECTTYPE *pObject;
|
||||
|
||||
INT32 sGridNo;
|
||||
UINT8 ubDirection;
|
||||
UINT8 ubTargetMercID;
|
||||
UINT8 ubDirection;
|
||||
SoldierID ubTargetMercID;
|
||||
|
||||
// DO SOME CHECKS IF WE CAN DO ANIMATION.....
|
||||
|
||||
@@ -4829,7 +4818,7 @@ BOOLEAN VerifyGiveItem( SOLDIERTYPE *pSoldier, SOLDIERTYPE **ppTargetSoldier )
|
||||
|
||||
sGridNo = pSoldier->aiData.sPendingActionData2;
|
||||
ubDirection = pSoldier->aiData.bPendingActionData3;
|
||||
ubTargetMercID = (UINT8)pSoldier->aiData.uiPendingActionData4;
|
||||
ubTargetMercID = static_cast<UINT16>( pSoldier->aiData.uiPendingActionData4 );
|
||||
|
||||
usSoldierIndex = WhoIsThere2( sGridNo, pSoldier->pathing.bLevel );
|
||||
|
||||
@@ -4855,7 +4844,7 @@ BOOLEAN VerifyGiveItem( SOLDIERTYPE *pSoldier, SOLDIERTYPE **ppTargetSoldier )
|
||||
{
|
||||
if ( pSoldier->pTempObject != NULL )
|
||||
{
|
||||
AddItemToPool( pSoldier->sGridNo, pSoldier->pTempObject, 1, pSoldier->pathing.bLevel, 0 , -1 );
|
||||
AddItemToPool( pSoldier->sGridNo, pSoldier->pTempObject, 1, pSoldier->pathing.bLevel, 0, -1 );
|
||||
|
||||
// Place it on the ground!
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, TacticalStr[ ITEM_HAS_BEEN_PLACED_ON_GROUND_STR ], ShortItemNames[ pSoldier->pTempObject->usItem ] );
|
||||
@@ -4865,7 +4854,7 @@ BOOLEAN VerifyGiveItem( SOLDIERTYPE *pSoldier, SOLDIERTYPE **ppTargetSoldier )
|
||||
|
||||
if ( ubTargetMercID != NOBODY )
|
||||
{
|
||||
MercPtrs[ ubTargetMercID ]->flags.uiStatusFlags &= (~SOLDIER_ENGAGEDINACTION );
|
||||
ubTargetMercID->flags.uiStatusFlags &= (~SOLDIER_ENGAGEDINACTION );
|
||||
}
|
||||
|
||||
OBJECTTYPE::DeleteMe( &pSoldier->pTempObject );
|
||||
@@ -4885,7 +4874,7 @@ void SoldierGiveItemFromAnimation( SOLDIERTYPE *pSoldier )
|
||||
|
||||
INT32 sGridNo;
|
||||
UINT8 ubDirection;
|
||||
UINT8 ubTargetMercID;
|
||||
UINT16 ubTargetMercID;
|
||||
UINT16 usItemNum;
|
||||
BOOLEAN fToTargetPlayer = FALSE;
|
||||
|
||||
@@ -4914,7 +4903,7 @@ void SoldierGiveItemFromAnimation( SOLDIERTYPE *pSoldier )
|
||||
|
||||
sGridNo = pSoldier->aiData.sPendingActionData2;
|
||||
ubDirection = pSoldier->aiData.bPendingActionData3;
|
||||
ubTargetMercID = (UINT8)pSoldier->aiData.uiPendingActionData4;
|
||||
ubTargetMercID = (UINT16)pSoldier->aiData.uiPendingActionData4;
|
||||
|
||||
// ATE: Deduct APs!
|
||||
DeductPoints( pSoldier, GetBasicAPsToPickupItem( pSoldier ), 0 ); // SANDRO
|
||||
@@ -5008,7 +4997,7 @@ void SoldierGiveItemFromAnimation( SOLDIERTYPE *pSoldier )
|
||||
DirtyMercPanelInterface( pSoldier, DIRTYLEVEL2 );
|
||||
}
|
||||
|
||||
AddItemToPool( pSoldier->sGridNo, &gTempObject, 1, pSoldier->pathing.bLevel, 0 , -1 );
|
||||
AddItemToPool( pSoldier->sGridNo, &gTempObject, 1, pSoldier->pathing.bLevel, 0, -1 );
|
||||
|
||||
// We could not place it!
|
||||
// Drop it on the ground?
|
||||
@@ -5079,13 +5068,13 @@ void SoldierGiveItemFromAnimation( SOLDIERTYPE *pSoldier )
|
||||
|
||||
INT32 AdjustGridNoForItemPlacement( SOLDIERTYPE *pSoldier, INT32 sGridNo )
|
||||
{
|
||||
STRUCTURE *pStructure;
|
||||
INT16 sDesiredLevel;
|
||||
INT32 sActionGridNo;
|
||||
BOOLEAN fStructFound = FALSE;
|
||||
UINT8 ubDirection;
|
||||
INT32 sAdjustedGridNo;
|
||||
UINT8 ubTargetID;
|
||||
STRUCTURE *pStructure;
|
||||
INT16 sDesiredLevel;
|
||||
INT32 sActionGridNo;
|
||||
BOOLEAN fStructFound = FALSE;
|
||||
UINT8 ubDirection;
|
||||
INT32 sAdjustedGridNo;
|
||||
SoldierID ubTargetID;
|
||||
|
||||
|
||||
sActionGridNo = sGridNo;
|
||||
@@ -5154,7 +5143,7 @@ void StartBombMessageBox( SOLDIERTYPE * pSoldier, INT32 sGridNo )
|
||||
|
||||
gpTempSoldier = pSoldier;
|
||||
gsTempGridNo = sGridNo;
|
||||
if (Item[ pSoldier->inv[HANDPOS].usItem].remotetrigger )
|
||||
if (ItemIsRemoteTrigger(pSoldier->inv[HANDPOS].usItem))
|
||||
{
|
||||
wcscpy( gzUserDefinedButton[0], L"1" );
|
||||
wcscpy( gzUserDefinedButton[1], L"2" );
|
||||
@@ -5249,7 +5238,7 @@ void StartBombMessageBox( SOLDIERTYPE * pSoldier, INT32 sGridNo )
|
||||
{
|
||||
DoMessageBox( MSG_BOX_BASIC_SMALL_BUTTONS, TacticalStr[ CHOOSE_REMOTE_FREQUENCY_STR ], GAME_SCREEN, MSG_BOX_FLAG_FOUR_NUMBERED_BUTTONS, BombMessageBoxCallBack, NULL );
|
||||
}
|
||||
else if ( Item[ (&(pSoldier->inv[HANDPOS]))->usItem ].tripwire == 1 )
|
||||
else if (ItemIsTripwire((&(pSoldier->inv[HANDPOS]))->usItem))
|
||||
{
|
||||
wcscpy( gzUserDefinedButton[0], L"1-A" );
|
||||
wcscpy( gzUserDefinedButton[1], L"1-B" );
|
||||
@@ -5394,15 +5383,16 @@ void UpdateGear()
|
||||
if ( (guiCurrentScreen != GAME_SCREEN && guiCurrentScreen != MSG_BOX_SCREEN) )
|
||||
return;
|
||||
|
||||
UINT16 bMercID, bLastTeamID;
|
||||
SoldierID bMercID, bLastTeamID;
|
||||
SOLDIERTYPE* pSoldier = NULL;
|
||||
|
||||
bMercID = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||
bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID;
|
||||
|
||||
// loop through all mercs
|
||||
for ( pSoldier = MercPtrs[bMercID]; bMercID <= bLastTeamID; ++bMercID, ++pSoldier )
|
||||
for ( ; bMercID <= bLastTeamID; ++bMercID )
|
||||
{
|
||||
pSoldier = bMercID;
|
||||
//if the merc is in this sector
|
||||
if ( pSoldier->bActive && pSoldier->bInSector && (pSoldier->sSectorX == gWorldSectorX) && (pSoldier->sSectorY == gWorldSectorY) && (pSoldier->bSectorZ == gbWorldSectorZ) )
|
||||
{
|
||||
@@ -5573,10 +5563,10 @@ void BombMessageBoxCallBack( UINT8 ubExitValue )
|
||||
if (gpTempSoldier)
|
||||
{
|
||||
// sevenfm: remember last tripwire network settings
|
||||
if(Item[ gpTempSoldier->inv[HANDPOS].usItem ].tripwire )
|
||||
if(ItemIsTripwire(gpTempSoldier->inv[HANDPOS].usItem))
|
||||
gubLastTripwire = ubExitValue;
|
||||
|
||||
if (Item[ gpTempSoldier->inv[HANDPOS].usItem ].remotetrigger )
|
||||
if (ItemIsRemoteTrigger(gpTempSoldier->inv[HANDPOS].usItem))
|
||||
{
|
||||
// Flugente: jamming can prevent bomb activation
|
||||
if ( !gSkillTraitValues.fVOJammingBlocksRemoteBombs || !SectorJammed() )
|
||||
@@ -5602,7 +5592,7 @@ void BombMessageBoxCallBack( UINT8 ubExitValue )
|
||||
if ( iResult >= 0 )
|
||||
{
|
||||
// Less explosives gain for placing tripwire
|
||||
if ( Item[ gpTempSoldier->inv[ HANDPOS ].usItem ].tripwire == 1 )
|
||||
if (ItemIsTripwire(gpTempSoldier->inv[ HANDPOS ].usItem))
|
||||
StatChange( gpTempSoldier, EXPLODEAMT, 5, FALSE );
|
||||
else if ( HasItemFlag( (gpTempSoldier->inv[HANDPOS]).usItem, BEARTRAP ) )
|
||||
StatChange( gpTempSoldier, MECHANAMT, 10, FALSE );
|
||||
@@ -5643,7 +5633,7 @@ void BombMessageBoxCallBack( UINT8 ubExitValue )
|
||||
else
|
||||
{
|
||||
// we can't blow up tripwire, no matter how bad we fail
|
||||
if ( Item[ gpTempSoldier->inv[ HANDPOS ].usItem ].tripwire != 1 )
|
||||
if ( !ItemIsTripwire(gpTempSoldier->inv[ HANDPOS ].usItem))
|
||||
{
|
||||
// OOPS! ... BOOM!
|
||||
IgniteExplosion( NOBODY, gpTempSoldier->sX, gpTempSoldier->sY, (INT16) (gpWorldLevelData[gpTempSoldier->sGridNo].sHeight), gpTempSoldier->sGridNo, gpTempSoldier->inv[ HANDPOS ].usItem, gpTempSoldier->pathing.bLevel, gpTempSoldier->ubDirection, &gpTempSoldier->inv[ HANDPOS ] );
|
||||
@@ -5699,7 +5689,7 @@ void BombMessageBoxCallBack( UINT8 ubExitValue )
|
||||
gTempObject[0]->data.ubDirection = gpTempSoldier->ubDirection; // Flugente: direction of bomb is direction of soldier
|
||||
|
||||
// Flugente: tripwire was called through a messagebox, but has to be buried nevertheless
|
||||
if ( Item[ (&gTempObject)->usItem ].tripwire == 1 )
|
||||
if (ItemIsTripwire((&gTempObject)->usItem))
|
||||
{
|
||||
AddItemToPool( gsTempGridNo, &gTempObject, BURIED, gpTempSoldier->pathing.bLevel, WORLD_ITEM_ARMED_BOMB, 0 );
|
||||
// sevenfm: set flag only if planting tripwire
|
||||
@@ -5839,7 +5829,7 @@ BOOLEAN HandItemWorks( SOLDIERTYPE *pSoldier, INT8 bSlot )
|
||||
// shape to be usable, and doesn't break during use.
|
||||
// Exception: land mines. You can bury them broken, they just won't blow!
|
||||
// if ( (Item[ pObj->usItem ].fFlags & ITEM_DAMAGEABLE) && (pObj->usItem != MINE) && (Item[ pObj->usItem ].usItemClass != IC_MEDKIT) && pObj->usItem != GAS_CAN )
|
||||
if ( Item[pObj->usItem].damageable && !Item[pObj->usItem].mine && (Item[pObj->usItem].usItemClass != IC_MEDKIT) && !Item[pObj->usItem].gascan && !IsStructureConstructItem( pObj->usItem, pSoldier->sGridNo, NULL ) )
|
||||
if (ItemIsDamageable(pObj->usItem) && !ItemIsMine(pObj->usItem) && (Item[pObj->usItem].usItemClass != IC_MEDKIT) && !ItemIsGascan(pObj->usItem) && !IsStructureConstructItem( pObj->usItem, pSoldier->sGridNo, NULL ) )
|
||||
{
|
||||
// if it's still usable, check whether it breaks
|
||||
if ( (*pObj)[0]->data.objectStatus >= USABLE)
|
||||
@@ -6103,7 +6093,7 @@ void BoobyTrapMessageBoxCallBack( UINT8 ubExitValue )
|
||||
CreateItem(gTempObject[0]->data.misc.usBombItem, gTempObject[0]->data.misc.bBombStatus, &TempObject);
|
||||
|
||||
// also spawn attached guns/explosives
|
||||
if (gTempObject.usItem != ACTION_ITEM && (Item[gTempObject.usItem].tripwire || Item[gTempObject.usItem].usItemClass & IC_EXPLOSV))
|
||||
if (gTempObject.usItem != ACTION_ITEM && (ItemIsTripwire(gTempObject.usItem) || Item[gTempObject.usItem].usItemClass & IC_EXPLOSV))
|
||||
{
|
||||
// search for attached items
|
||||
OBJECTTYPE* pAttItem = NULL;
|
||||
@@ -6172,7 +6162,7 @@ void BoobyTrapMessageBoxCallBack( UINT8 ubExitValue )
|
||||
{
|
||||
// OJW - 20091029 - disarm explosives
|
||||
if (is_networked && is_client)
|
||||
send_disarm_explosive( gsBoobyTrapGridNo , gpBoobyTrapItemPool->iItemIndex , gpBoobyTrapSoldier->ubID );
|
||||
send_disarm_explosive( gsBoobyTrapGridNo, gpBoobyTrapItemPool->iItemIndex, gpBoobyTrapSoldier->ubID );
|
||||
// remove it from the ground
|
||||
RemoveItemFromPool( gsBoobyTrapGridNo, gpBoobyTrapItemPool->iItemIndex, gbBoobyTrapLevel );
|
||||
}
|
||||
@@ -6194,7 +6184,7 @@ void BoobyTrapMessageBoxCallBack( UINT8 ubExitValue )
|
||||
|
||||
// OJW - 20091029 - disarm explosives
|
||||
if (is_networked && is_client)
|
||||
send_disarm_explosive( gsBoobyTrapGridNo , gpBoobyTrapItemPool->iItemIndex , gpBoobyTrapSoldier->ubID );
|
||||
send_disarm_explosive( gsBoobyTrapGridNo, gpBoobyTrapItemPool->iItemIndex, gpBoobyTrapSoldier->ubID );
|
||||
|
||||
RemoveItemFromPool( gsBoobyTrapGridNo, gpBoobyTrapItemPool->iItemIndex, gbBoobyTrapLevel );
|
||||
}
|
||||
@@ -6211,7 +6201,7 @@ void BoobyTrapMessageBoxCallBack( UINT8 ubExitValue )
|
||||
}
|
||||
// OJW - 20091029 - disarm explosives
|
||||
if (is_networked && is_client)
|
||||
send_disarm_explosive( gsBoobyTrapGridNo , gpBoobyTrapItemPool->iItemIndex , gpBoobyTrapSoldier->ubID );
|
||||
send_disarm_explosive( gsBoobyTrapGridNo, gpBoobyTrapItemPool->iItemIndex, gpBoobyTrapSoldier->ubID );
|
||||
|
||||
// remove it from the ground
|
||||
RemoveItemFromPool( gsBoobyTrapGridNo, gpBoobyTrapItemPool->iItemIndex, gbBoobyTrapLevel );
|
||||
@@ -6366,7 +6356,7 @@ void SwitchMessageBoxCallBack( UINT8 ubExitValue )
|
||||
// Message that switch is activated...
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, gzLateLocalizedString[ 60 ] );
|
||||
|
||||
SetOffBombsByFrequency( gpTempSoldier->ubID, bTempFrequency );
|
||||
SetOffBombsByFrequency( gpTempSoldier->ubID, bTempFrequency );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6736,11 +6726,11 @@ void TestPotentialOwner( SOLDIERTYPE * pSoldier )
|
||||
|
||||
void CheckForPickedOwnership( void )
|
||||
{
|
||||
ITEM_POOL * pItemPool;
|
||||
UINT8 ubProfile;
|
||||
UINT8 ubCivGroup;
|
||||
SOLDIERTYPE * pSoldier;
|
||||
UINT8 ubLoop;
|
||||
ITEM_POOL * pItemPool;
|
||||
UINT8 ubProfile;
|
||||
UINT8 ubCivGroup;
|
||||
SOLDIERTYPE * pSoldier;
|
||||
SoldierID ubLoop;
|
||||
|
||||
// LOOP THROUGH LIST TO FIND NODE WE WANT
|
||||
GetItemPool( gsTempGridNo, &pItemPool, gpTempSoldier->pathing.bLevel );
|
||||
@@ -6767,9 +6757,9 @@ void CheckForPickedOwnership( void )
|
||||
pItemPool = pItemPool->pNext;
|
||||
continue;
|
||||
}
|
||||
for ( ubLoop = gTacticalStatus.Team[ CIV_TEAM ].bFirstID; ubLoop <= gTacticalStatus.Team[ CIV_TEAM ].bLastID; ubLoop++ )
|
||||
for ( ubLoop = gTacticalStatus.Team[ CIV_TEAM ].bFirstID; ubLoop <= gTacticalStatus.Team[ CIV_TEAM ].bLastID; ++ubLoop )
|
||||
{
|
||||
pSoldier = MercPtrs[ ubLoop ];
|
||||
pSoldier = ubLoop;
|
||||
if ( pSoldier && pSoldier->ubCivilianGroup == ubCivGroup )
|
||||
{
|
||||
TestPotentialOwner( pSoldier );
|
||||
@@ -6990,7 +6980,7 @@ INT32 FindNearestAvailableGridNoForItem( INT32 sSweetGridNo, INT8 ubRadius )
|
||||
|
||||
BOOLEAN CanPlayerUseRocketRifle( SOLDIERTYPE *pSoldier, BOOLEAN fDisplay )
|
||||
{
|
||||
if ( Item[pSoldier->inv[ pSoldier->ubAttackingHand ].usItem].fingerprintid )
|
||||
if (ItemHasFingerPrintID(pSoldier->inv[ pSoldier->ubAttackingHand ].usItem))
|
||||
{
|
||||
// check imprint ID
|
||||
// NB not-imprinted value is NO_PROFILE
|
||||
@@ -7042,7 +7032,7 @@ UINT8 StealItems(SOLDIERTYPE* pSoldier,SOLDIERTYPE* pOpponent, UINT8* ubIndexRet
|
||||
fStealItem = FALSE;
|
||||
|
||||
pObject=&pOpponent->inv[i];
|
||||
if ((pObject->exists() == true) && !(Item[pObject->usItem].defaultundroppable )) // CHECK! Undroppable items cannot be stolen - SANDRO
|
||||
if ((pObject->exists() == true) && !ItemIsUndroppableByDefault(pObject->usItem)) // CHECK! Undroppable items cannot be stolen - SANDRO
|
||||
{
|
||||
// Is the enemy collapsed
|
||||
if ( pOpponent->stats.bLife < OKLIFE || pOpponent->bCollapsed )
|
||||
@@ -7799,9 +7789,9 @@ BOOLEAN BuildStructFromName( INT32 sGridNo, INT8 sLevel, const char* aStr, UINT8
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
UINT16 gusTempDragBuildSoldierID = NOBODY;
|
||||
SoldierID gusTempDragBuildSoldierID = NOBODY;
|
||||
|
||||
BOOLEAN BuildStructDrag( INT32 sGridNo, INT8 sLevel, UINT32 uiTileType, UINT8 usIndex, UINT16 usSoldierID )
|
||||
BOOLEAN BuildStructDrag( INT32 sGridNo, INT8 sLevel, UINT32 uiTileType, UINT8 usIndex, SoldierID usSoldierID )
|
||||
{
|
||||
// needs to be a valid location
|
||||
if ( TileIsOutOfBounds( sGridNo ) )
|
||||
@@ -9406,11 +9396,11 @@ void DoInteractiveAction( INT32 sGridNo, SOLDIERTYPE *pSoldier )
|
||||
|
||||
// handle the default result of an interactive action
|
||||
// This is called either if no lua action id is set, or by lua if this should happen as a supplement to whatever lua does
|
||||
void DoInteractiveActionDefaultResult( INT32 sGridNo, UINT8 ubID, BOOLEAN aSuccess )
|
||||
void DoInteractiveActionDefaultResult( INT32 sGridNo, SoldierID ubID, BOOLEAN aSuccess )
|
||||
{
|
||||
SOLDIERTYPE* pSoldier = NULL;
|
||||
if ( ubID != NOBODY )
|
||||
pSoldier = MercPtrs[ubID];
|
||||
pSoldier = ubID;
|
||||
|
||||
// we need a valid soldier and a valid object
|
||||
if ( !pSoldier )
|
||||
@@ -9855,7 +9845,7 @@ void ReadEquipmentTable( SOLDIERTYPE* pSoldier, std::string name )
|
||||
}
|
||||
}
|
||||
// if we want to equip a two-handed item in our first hand, also drop whatever we have in the second hand
|
||||
else if ( node.slot == HANDPOS && Item[node.item].twohanded && pSoldier->inv[SECONDHANDPOS].exists( ) )
|
||||
else if ( node.slot == HANDPOS && ItemIsTwoHanded(node.item) && pSoldier->inv[SECONDHANDPOS].exists( ) )
|
||||
{
|
||||
AutoPlaceObjectInInventoryStash( &pSoldier->inv[SECONDHANDPOS], pSoldier->sGridNo, pSoldier->pathing.bLevel );
|
||||
DeleteObj( &pSoldier->inv[SECONDHANDPOS] );
|
||||
@@ -10268,7 +10258,7 @@ void ReadEquipmentTable( SOLDIERTYPE* pSoldier, std::string name )
|
||||
}
|
||||
|
||||
// if there is water in this sector, refill canteens
|
||||
if ( refillwaterfromsector && Item[(pSoldier->inv[slot]).usItem].canteen && Food[Item[(pSoldier->inv[slot]).usItem].foodtype].bDrinkPoints > 0 )
|
||||
if ( refillwaterfromsector && ItemIsCanteen(pSoldier->inv[slot].usItem) && Food[Item[(pSoldier->inv[slot]).usItem].foodtype].bDrinkPoints > 0 )
|
||||
{
|
||||
OBJECTTYPE* pObj = &(pSoldier->inv[slot]);
|
||||
|
||||
@@ -10458,9 +10448,9 @@ void TakePhoto(SOLDIERTYPE* pSoldier, INT32 sGridNo, INT8 bLevel )
|
||||
InARoom( newgridno, &room );
|
||||
|
||||
// check if there is someone here
|
||||
UINT16 ubid = WhoIsThere2( newgridno, bLevel );
|
||||
SoldierID ubid = WhoIsThere2( newgridno, bLevel );
|
||||
|
||||
LuaAddPhotoData( gWorldSectorX, gWorldSectorY, gbWorldSectorZ, newgridno, bLevel, pSoldier->ubProfile, room, ( ubid == NOBODY ) ? NO_PROFILE : MercPtrs[ubid]->ubProfile );
|
||||
LuaAddPhotoData( gWorldSectorX, gWorldSectorY, gbWorldSectorZ, newgridno, bLevel, pSoldier->ubProfile, room, ( ubid == NOBODY ) ? NO_PROFILE : ubid->ubProfile );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,9 +194,9 @@ void AllSoldiersLookforItems( BOOLEAN RevealRoofsAndItems );
|
||||
|
||||
void SoldierGetItemFromWorld( SOLDIERTYPE *pSoldier, INT32 iItemIndex, INT32 sGridNo, INT8 bZLevel, BOOLEAN *pfSelectionList );
|
||||
|
||||
OBJECTTYPE* AddItemToPool( INT32 sGridNo, OBJECTTYPE *pObject, INT8 bVisible, UINT8 ubLevel, UINT16 usFlags, INT8 bRenderZHeightAboveLevel, INT8 soldierID = -1 );
|
||||
OBJECTTYPE* AddItemToPoolAndGetIndex( INT32 sGridNo, OBJECTTYPE *pObject, INT8 bVisible, UINT8 ubLevel, UINT16 usFlags, INT8 bRenderZHeightAboveLevel, INT8 soldierID, INT32 * piItemIndex );
|
||||
OBJECTTYPE* InternalAddItemToPool( INT32 *psGridNo, OBJECTTYPE *pObject, INT8 bVisible, UINT8 ubLevel, UINT16 usFlags, INT8 bRenderZHeightAboveLevel, INT8 soldierID, INT32 * piItemIndex );
|
||||
OBJECTTYPE* AddItemToPool(INT32 sGridNo, OBJECTTYPE* pObject, INT8 bVisible, UINT8 ubLevel, UINT16 usFlags, INT8 bRenderZHeightAboveLevel, INT16 soldierID = -1);
|
||||
OBJECTTYPE* AddItemToPoolAndGetIndex( INT32 sGridNo, OBJECTTYPE *pObject, INT8 bVisible, UINT8 ubLevel, UINT16 usFlags, INT8 bRenderZHeightAboveLevel, SoldierID soldierID, INT32 * piItemIndex );
|
||||
OBJECTTYPE* InternalAddItemToPool( INT32 *psGridNo, OBJECTTYPE *pObject, INT8 bVisible, UINT8 ubLevel, UINT16 usFlags, INT8 bRenderZHeightAboveLevel, SoldierID soldierID, INT32 * piItemIndex );
|
||||
|
||||
INT32 AdjustGridNoForItemPlacement( SOLDIERTYPE *pSoldier, INT32 sGridNo );
|
||||
BOOLEAN GetItemPool( INT32 usMapPos, ITEM_POOL **ppItemPool, UINT8 ubLevel );
|
||||
@@ -297,7 +297,7 @@ BOOLEAN IsDragStructurePresent( INT32 sGridNo, INT8 sLevel, UINT32& arusTileType
|
||||
void GetDragStructureXmlEntry( UINT32 ausTileType, UINT16 ausStructureNumber, int& arXmlVectorEntry );
|
||||
BOOLEAN RemoveStructDrag( INT32 sGridNo, INT8 sLevel, UINT32 uiTileType );
|
||||
void CorrectDragStructData( INT32 sGridNo, INT8 sLevel, UINT8 ausHitpoints, UINT8 ausDecalFlags );
|
||||
BOOLEAN BuildStructDrag( INT32 sGridNo, INT8 sLevel, UINT32 uiTileType, UINT8 usIndex, UINT16 usSoldierID );
|
||||
BOOLEAN BuildStructDrag( INT32 sGridNo, INT8 sLevel, UINT32 uiTileType, UINT8 usIndex, SoldierID usSoldierID );
|
||||
|
||||
void UpdateFortificationPossibleAmount();
|
||||
void HandleFortificationUpdate();
|
||||
@@ -329,7 +329,7 @@ extern ITEM_POOL *gpItemPool;//dnl ch26 210909
|
||||
|
||||
// Flugente: interactive actions
|
||||
void DoInteractiveAction( INT32 sGridNo, SOLDIERTYPE *pSoldier );
|
||||
void DoInteractiveActionDefaultResult( INT32 sGridNo, UINT8 ubID, BOOLEAN aSuccess );
|
||||
void DoInteractiveActionDefaultResult( INT32 sGridNo, SoldierID ubID, BOOLEAN aSuccess );
|
||||
BOOLEAN SpendMoney( SOLDIERTYPE *pSoldier, UINT32 aAmount ); // character spends money - either from inventory or the account
|
||||
|
||||
// Flugente: intel
|
||||
|
||||
+15
-15
@@ -1,15 +1,14 @@
|
||||
#include "Handle UI Plan.h"
|
||||
#include "overhead.h"
|
||||
#include "Overhead.h"
|
||||
#include "Isometric Utils.h"
|
||||
#include "pathai.h"
|
||||
#include "PATHAI.H"
|
||||
#include "Handle UI.h"
|
||||
#include "points.h"
|
||||
#include "weapons.h"
|
||||
#include "Points.h"
|
||||
#include "renderworld.h"
|
||||
#include "Animation Control.h"
|
||||
#include "message.h"
|
||||
#include "soldier create.h"
|
||||
#include "interface.h"
|
||||
#include "Soldier Create.h"
|
||||
#include "Interface.h"
|
||||
|
||||
UINT8 gubNumUIPlannedMoves = 0;
|
||||
SOLDIERTYPE *gpUIPlannedSoldier = NULL;
|
||||
@@ -37,12 +36,12 @@ BOOLEAN BeginUIPlan( SOLDIERTYPE *pSoldier )
|
||||
BOOLEAN AddUIPlan( INT32 sGridNo, UINT8 ubPlanID )
|
||||
{
|
||||
SOLDIERTYPE *pPlanSoldier;
|
||||
INT16 sXPos, sYPos;
|
||||
INT16 sAPCost = 0;
|
||||
INT8 bDirection;
|
||||
INT32 iLoop;
|
||||
INT16 sXPos, sYPos;
|
||||
INT16 sAPCost = 0;
|
||||
INT8 bDirection;
|
||||
INT32 iLoop;
|
||||
SOLDIERCREATE_STRUCT MercCreateStruct;
|
||||
UINT8 ubNewIndex;
|
||||
SoldierID ubNewIndex;
|
||||
|
||||
// Depeding on stance and direction facing, add guy!
|
||||
|
||||
@@ -79,7 +78,7 @@ BOOLEAN AddUIPlan( INT32 sGridNo, UINT8 ubPlanID )
|
||||
if ( TacticalCreateSoldier( &MercCreateStruct, &ubNewIndex ) )
|
||||
{
|
||||
// Get pointer to soldier
|
||||
GetSoldier( &pPlanSoldier, (UINT16)ubNewIndex );
|
||||
GetSoldier( &pPlanSoldier, ubNewIndex );
|
||||
|
||||
pPlanSoldier->sPlannedTargetX = -1;
|
||||
pPlanSoldier->sPlannedTargetY = -1;
|
||||
@@ -118,7 +117,7 @@ BOOLEAN AddUIPlan( INT32 sGridNo, UINT8 ubPlanID )
|
||||
pPlanSoldier->ChangeSoldierState( pPlanSoldier->usUIMovementMode, 0, FALSE );
|
||||
|
||||
// Change selected soldier
|
||||
gusSelectedSoldier = (UINT16)pPlanSoldier->ubID;
|
||||
gusSelectedSoldier = pPlanSoldier->ubID;
|
||||
|
||||
// Change global planned mode to this guy!
|
||||
gpUIPlannedSoldier = pPlanSoldier;
|
||||
@@ -161,7 +160,7 @@ BOOLEAN AddUIPlan( INT32 sGridNo, UINT8 ubPlanID )
|
||||
if ( TacticalCreateSoldier( &MercCreateStruct, &ubNewIndex ) )
|
||||
{
|
||||
// Get pointer to soldier
|
||||
GetSoldier( &pPlanSoldier, (UINT16)ubNewIndex );
|
||||
GetSoldier( &pPlanSoldier, ubNewIndex );
|
||||
|
||||
pPlanSoldier->sPlannedTargetX = -1;
|
||||
pPlanSoldier->sPlannedTargetY = -1;
|
||||
@@ -197,7 +196,7 @@ BOOLEAN AddUIPlan( INT32 sGridNo, UINT8 ubPlanID )
|
||||
pPlanSoldier->ChangeSoldierState( pPlanSoldier->usUIMovementMode, 0, FALSE );
|
||||
|
||||
// Change selected soldier
|
||||
gusSelectedSoldier = (UINT16)pPlanSoldier->ubID;
|
||||
gusSelectedSoldier = pPlanSoldier->ubID;
|
||||
|
||||
// Change global planned mode to this guy!
|
||||
gpUIPlannedSoldier = pPlanSoldier;
|
||||
@@ -243,6 +242,7 @@ void EndUIPlan( )
|
||||
SOLDIERTYPE *pSoldier;
|
||||
|
||||
// Zero out any planned soldiers
|
||||
//FIXME
|
||||
for( cnt = MAX_NUM_SOLDIERS; cnt < TOTAL_SOLDIERS; cnt++ )
|
||||
{
|
||||
pSoldier = MercPtrs[ cnt ];
|
||||
|
||||
@@ -14,4 +14,4 @@ void EndUIPlan( );
|
||||
BOOLEAN InUIPlanMode( );
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+219
-255
File diff suppressed because it is too large
Load Diff
+23
-30
@@ -181,7 +181,7 @@ extern UI_EVENT gEvents[ NUM_UI_EVENTS ];
|
||||
extern UI_MODE gCurrentUIMode;
|
||||
extern UI_MODE gOldUIMode;
|
||||
extern UINT32 guiCurrentEvent;
|
||||
extern INT16 gsSelectedLevel;
|
||||
extern INT16 gsSelectedLevel;
|
||||
extern BOOLEAN gfPlotNewMovement;
|
||||
extern UINT32 guiPendingOverrideEvent;
|
||||
|
||||
@@ -191,34 +191,33 @@ extern BOOLEAN gfUIDisplayActionPoints;
|
||||
extern BOOLEAN gfUIDisplayActionPointsInvalid;
|
||||
extern BOOLEAN gfUIDisplayActionPointsBlack;
|
||||
extern BOOLEAN gfUIDisplayActionPointsCenter;
|
||||
extern INT16 gUIDisplayActionPointsOffY;
|
||||
extern INT16 gUIDisplayActionPointsOffX;
|
||||
extern INT16 gUIDisplayActionPointsOffY;
|
||||
extern INT16 gUIDisplayActionPointsOffX;
|
||||
extern BOOLEAN gfUIDoNotHighlightSelMerc;
|
||||
extern UINT32 guiShowUPDownArrows;
|
||||
extern BOOLEAN gfUIHandleSelection;
|
||||
extern BOOLEAN gfUIHandleSelectionAboveGuy;
|
||||
extern INT32 gsSelectedGridNo;
|
||||
extern INT16 gsSelectedGuy;
|
||||
extern INT32 gsSelectedGridNo;
|
||||
extern SoldierID gsSelectedGuy;
|
||||
extern BOOLEAN gfUIInDeadlock;
|
||||
extern UINT8 gUIDeadlockedSoldier;
|
||||
|
||||
extern BOOLEAN gfUIMouseOnValidCatcher;
|
||||
extern UINT8 gubUIValidCatcherID;
|
||||
extern SoldierID gubUIValidCatcherID;
|
||||
extern BOOLEAN gUIUseReverse;
|
||||
|
||||
|
||||
extern BOOLEAN gfUIHandleShowMoveGrid;
|
||||
extern INT32 gsUIHandleShowMoveGridLocation;
|
||||
extern INT32 gsUIHandleShowMoveGridLocation;
|
||||
|
||||
extern BOOLEAN gfUIDisplayDamage;
|
||||
extern INT8 gbDamage;
|
||||
extern INT32 gsDamageGridNo;
|
||||
extern INT32 gsDamageGridNo;
|
||||
|
||||
extern BOOLEAN gfFontPopupDo;
|
||||
|
||||
extern BOOLEAN gUITargetReady;
|
||||
extern BOOLEAN gUITargetShotWaiting;
|
||||
extern INT32 gsUITargetShotGridNo;
|
||||
extern INT32 gsUITargetShotGridNo;
|
||||
|
||||
extern CHAR16 gzLocation[ 20 ];
|
||||
extern BOOLEAN gfUIBodyHitLocation;
|
||||
@@ -268,16 +267,16 @@ extern BOOLEAN gfUIHandlePhysicsTrajectory;
|
||||
|
||||
|
||||
// GLOBALS FOR FAST LOOKUP FOR FINDING MERCS FROM THE MOUSE
|
||||
extern BOOLEAN gfUISelectiveTargetFound;
|
||||
extern UINT16 gusUISelectiveTargetID;
|
||||
extern UINT32 guiUISelectiveTargetFlags;
|
||||
extern BOOLEAN gfUISelectiveTargetFound;
|
||||
extern SoldierID gusUISelectiveTargetID;
|
||||
extern UINT32 guiUISelectiveTargetFlags;
|
||||
|
||||
extern BOOLEAN gfUIFullTargetFound;
|
||||
extern UINT16 gusUIFullTargetID;
|
||||
extern UINT32 guiUIFullTargetFlags;
|
||||
extern BOOLEAN gfUIFullTargetFound;
|
||||
extern SoldierID gusUIFullTargetID;
|
||||
extern UINT32 guiUIFullTargetFlags;
|
||||
|
||||
extern BOOLEAN gfUIConfirmExitArrows;
|
||||
extern INT32 gsJumpOverGridNo;
|
||||
extern INT32 gsJumpOverGridNo;
|
||||
|
||||
extern UINT32 HandleTacticalUI(void);
|
||||
extern UINT32 UIHandleEndTurn( UI_EVENT *pUIEvent );
|
||||
@@ -293,11 +292,6 @@ void HandleObjectHighlighting( );
|
||||
|
||||
extern BOOLEAN gfUIForceReExamineCursorData;
|
||||
|
||||
extern INT16 guiCreateGuyIndex;
|
||||
extern INT16 guiCreateBadGuyIndex;
|
||||
|
||||
extern UINT8 gRenderDebugInfoMode;
|
||||
|
||||
// WANNE: Calculate the APs to turn around
|
||||
INT16 APsToTurnAround(SOLDIERTYPE *pSoldier, INT32 sAdjustedGridNo);
|
||||
|
||||
@@ -318,17 +312,16 @@ void GetRTMousePositionInput( UINT32 *puiNewEvent );
|
||||
void QueryRTLeftButton( UINT32 *puiNewEvent );
|
||||
void QueryRTRightButton( UINT32 *puiNewEvent );
|
||||
|
||||
void AdjustSoldierCreationStartValues( );
|
||||
|
||||
BOOLEAN SelectedMercCanAffordAttack( );
|
||||
BOOLEAN SelectedMercCanAffordMove( );
|
||||
void GetMercClimbDirection( UINT8 ubSoldierID, BOOLEAN *pfGoDown, BOOLEAN *pfGoUp );
|
||||
void GetMercClimbDirection( SoldierID ubSoldierID, BOOLEAN *pfGoDown, BOOLEAN *pfGoUp );
|
||||
|
||||
void ToggleHandCursorMode( UINT32 *puiNewEvent );
|
||||
void ToggleTalkCursorMode( UINT32 *puiNewEvent );
|
||||
void ToggleLookCursorMode( UINT32 *puiNewEvent );
|
||||
|
||||
void UIHandleSoldierStanceChange( UINT8 ubSoldierID, INT8 bNewStance );
|
||||
void UIHandleSoldierStanceChange( SoldierID ubSoldierID, INT8 bNewStance );
|
||||
void GetCursorMovementFlags( UINT32 *puiCursorFlags );
|
||||
|
||||
BOOLEAN HandleUIMovementCursor( SOLDIERTYPE *pSoldier, UINT32 uiCursorFlags, INT32 usMapPos, UINT32 uiFlags );
|
||||
@@ -336,15 +329,15 @@ BOOLEAN UIMouseOnValidAttackLocation( SOLDIERTYPE *pSoldier );
|
||||
|
||||
BOOLEAN UIOkForItemPickup( SOLDIERTYPE *pSoldier, INT32 sGridNo );
|
||||
|
||||
BOOLEAN IsValidTalkableNPCFromMouse( UINT8 *pubSoldierID, BOOLEAN fGive, BOOLEAN fAllowMercs, BOOLEAN fCheckCollapsed );
|
||||
BOOLEAN IsValidTalkableNPC( UINT8 ubSoldierID, BOOLEAN fGive, BOOLEAN fAllowMercs, BOOLEAN fCheckCollapsed );
|
||||
BOOLEAN IsValidTalkableNPCFromMouse( SoldierID *pubSoldierID, BOOLEAN fGive, BOOLEAN fAllowMercs, BOOLEAN fCheckCollapsed );
|
||||
BOOLEAN IsValidTalkableNPC( SoldierID ubSoldierID, BOOLEAN fGive, BOOLEAN fAllowMercs, BOOLEAN fCheckCollapsed );
|
||||
|
||||
BOOLEAN HandleTalkInit( );
|
||||
|
||||
BOOLEAN HandleCheckForExitArrowsInput( BOOLEAN fAdjustForConfirm );
|
||||
|
||||
void SetUIBusy( UINT8 ubID );
|
||||
void UnSetUIBusy( UINT8 ubID );
|
||||
void SetUIBusy( SoldierID ubID );
|
||||
void UnSetUIBusy( SoldierID ubID );
|
||||
|
||||
UINT32 UIHandleLUIEndLock( UI_EVENT *pUIEvent );
|
||||
|
||||
@@ -382,6 +375,6 @@ void PreventFromTheFreezingBug(SOLDIERTYPE* pSoldier);
|
||||
void GetGridNoScreenXY( INT32 sGridNo, INT16 *pScreenX, INT16 *pScreenY );
|
||||
|
||||
//Legion by Jazz
|
||||
void GetMercOknoDirection( UINT8 ubSoldierID, BOOLEAN *pfGoDown, BOOLEAN *pfGoUp );
|
||||
void GetMercOknoDirection( SoldierID ubSoldierID, BOOLEAN *pfGoDown, BOOLEAN *pfGoUp );
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,52 +1,47 @@
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include <math.h>
|
||||
#include "sgp.h"
|
||||
#include "gameloop.h"
|
||||
#include "himage.h"
|
||||
#include "vobject.h"
|
||||
#include "sysutil.h"
|
||||
#include "overhead.h"
|
||||
#include "Overhead.h"
|
||||
#include "mousesystem.h"
|
||||
#include "Button System.h"
|
||||
#include "interface.h"
|
||||
#include "Interface.h"
|
||||
#include "vsurface.h"
|
||||
#include "input.h"
|
||||
#include "Handle UI.h"
|
||||
#include "Animation Control.h"
|
||||
#include "Animation Data.h"
|
||||
#include "renderworld.h"
|
||||
#include "cursors.h"
|
||||
#include "radar screen.h"
|
||||
#include "Cursors.h"
|
||||
#include "Radar Screen.h"
|
||||
#include "worldman.h"
|
||||
#include "Font Control.h"
|
||||
#include "render dirty.h"
|
||||
#include "utilities.h"
|
||||
#include "interface cursors.h"
|
||||
#include "Render Dirty.h"
|
||||
#include "Utilities.h"
|
||||
#include "Interface Cursors.h"
|
||||
#include "lighting.h"
|
||||
#include "Interface Panels.h"
|
||||
#include "pathai.h"
|
||||
#include "vobject_blitters.h"
|
||||
#include "faces.h"
|
||||
#include "Handle UI Plan.h"
|
||||
#include "interface control.h"
|
||||
#include "interface items.h"
|
||||
#include "interface dialogue.h"
|
||||
#include "interactive tiles.h"
|
||||
#include "Interface Control.h"
|
||||
#include "Interface Items.h"
|
||||
#include "interface Dialogue.h"
|
||||
#include "Interactive Tiles.h"
|
||||
#include "Game Clock.h"
|
||||
#include "Strategic Exit GUI.h"
|
||||
#include "PopUpBox.h"
|
||||
#include "Assignments.h"
|
||||
#include "spread burst.h"
|
||||
#include "squads.h"
|
||||
#include "Spread burst.h"
|
||||
#include "Squads.h"
|
||||
#include "line.h"
|
||||
#include "Militia Control.h"
|
||||
#include "Map Screen Interface.h"
|
||||
#include "civ quotes.h"
|
||||
#include "Civ Quotes.h"
|
||||
#include "GameSettings.h"
|
||||
#include "Explosion Control.h" // added by Flugente
|
||||
|
||||
#include "connect.h"
|
||||
#include "Text.h"
|
||||
|
||||
#ifdef JA2UB
|
||||
@@ -317,7 +312,7 @@ void SetUpInterface( )
|
||||
{
|
||||
if ( gusSelectedSoldier != NOBODY )
|
||||
{
|
||||
if ( MercPtrs[ gusSelectedSoldier ]->sGridNo != gsUIHandleShowMoveGridLocation )
|
||||
if ( gusSelectedSoldier->sGridNo != gsUIHandleShowMoveGridLocation )
|
||||
{
|
||||
if ( gfUIHandleShowMoveGrid == 2 )
|
||||
{
|
||||
@@ -327,7 +322,7 @@ void SetUpInterface( )
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( MercPtrs[ gusSelectedSoldier ]->bStealthMode )
|
||||
if ( gusSelectedSoldier->bStealthMode )
|
||||
{
|
||||
AddTopmostToHead( gsUIHandleShowMoveGridLocation, GetSnapCursorIndex( FIRSTPOINTERS9 ) );
|
||||
gpWorldLevelData[gsUIHandleShowMoveGridLocation].pTopmostHead->ubShadeLevel=DEFAULT_SHADE_LEVEL;
|
||||
@@ -917,7 +912,7 @@ void RenderTopmostTacticalInterface( )
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawSelectedUIAboveGuy((UINT16)pSoldier->ubID);
|
||||
DrawSelectedUIAboveGuy(pSoldier->ubID);
|
||||
}
|
||||
|
||||
DrawCounters( pSoldier );
|
||||
|
||||
@@ -73,4 +73,4 @@ void DrawExplosionWarning( INT32 sGridno, INT8 sLevel, INT8 sDelay );
|
||||
// For now, we aren't using usColour, but that will likely change in the future
|
||||
void DrawTraitRadius( INT32 sGridno, INT8 sLevel, INT32 sRadius, INT16 sThickness, UINT16 usColour );
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,20 +1,15 @@
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include "sgp.h"
|
||||
#include "mousesystem.h"
|
||||
#include "vsurface.h"
|
||||
#include "input.h"
|
||||
#include "Handle UI.h"
|
||||
#include "cursors.h"
|
||||
#include "Cursors.h"
|
||||
#include "worlddef.h"
|
||||
#include "worldman.h"
|
||||
#include "Interface Cursors.h"
|
||||
#include "interface.h"
|
||||
#include "Isometric utils.h"
|
||||
#include "cursors.h"
|
||||
#include "sys globals.h"
|
||||
#include "overhead.h"
|
||||
#include "interface items.h"
|
||||
#include "Interface.h"
|
||||
#include "Isometric Utils.h"
|
||||
#include "Sys Globals.h"
|
||||
#include "Overhead.h"
|
||||
#include "Interface Items.h"
|
||||
#include "GameSettings.h"
|
||||
|
||||
#define DISPLAY_AP_INDEX MOCKFLOOR1
|
||||
@@ -335,7 +330,7 @@ BOOLEAN DrawUICursor( )
|
||||
// If we are over a target, jump to that....
|
||||
if ( gfUIFullTargetFound )
|
||||
{
|
||||
gusTargetDropPos = MercPtrs[ gusUIFullTargetID ]->sGridNo;
|
||||
gusTargetDropPos = gusUIFullTargetID->sGridNo;
|
||||
}
|
||||
|
||||
// Put tile on the floor
|
||||
@@ -354,7 +349,7 @@ BOOLEAN DrawUICursor( )
|
||||
// ATE; Is the current guy in steath mode?
|
||||
if ( gusSelectedSoldier != NOBODY )
|
||||
{
|
||||
if ( MercPtrs[ gusSelectedSoldier ]->bStealthMode )
|
||||
if ( gusSelectedSoldier->bStealthMode )
|
||||
{
|
||||
usTileCursor = FIRSTPOINTERS9;
|
||||
}
|
||||
@@ -367,7 +362,7 @@ BOOLEAN DrawUICursor( )
|
||||
// ATE; Is the current guy in steath mode?
|
||||
if ( gusSelectedSoldier != NOBODY )
|
||||
{
|
||||
if ( MercPtrs[ gusSelectedSoldier ]->bStealthMode )
|
||||
if ( gusSelectedSoldier->bStealthMode )
|
||||
{
|
||||
usTileCursor = FIRSTPOINTERS10;
|
||||
}
|
||||
|
||||
@@ -249,4 +249,4 @@ extern UINT32 gusCurMousePos;
|
||||
UINT16 GetSnapCursorIndex( UINT16 usAdditionalData );
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+92
-104
@@ -1,59 +1,53 @@
|
||||
#include "builddefines.h"
|
||||
#include <stdio.h>
|
||||
#include "sgp.h"
|
||||
#include "Encrypted File.h"
|
||||
#include "faces.h"
|
||||
#include "wcheck.h"
|
||||
#include "soldier profile.h"
|
||||
#include "wordwrap.h"
|
||||
#include "WCheck.h"
|
||||
#include "Soldier Profile.h"
|
||||
#include "WordWrap.h"
|
||||
#include "sysutil.h"
|
||||
#include "vobject_blitters.h"
|
||||
#include "interface dialogue.h"
|
||||
#include "font control.h"
|
||||
#include "dialogue control.h"
|
||||
#include "interface Dialogue.h"
|
||||
#include "Font Control.h"
|
||||
#include "Dialogue Control.h"
|
||||
#include "renderworld.h"
|
||||
#include "npc.h"
|
||||
#include "interface dialogue.h"
|
||||
#include "merctextbox.h"
|
||||
#include "NPC.h"
|
||||
#include "MercTextBox.h"
|
||||
#include "message.h"
|
||||
#include "items.h"
|
||||
#include "text.h"
|
||||
#include "overhead.h"
|
||||
#include "assignments.h"
|
||||
#include "Items.h"
|
||||
#include "Text.h"
|
||||
#include "Overhead.h"
|
||||
#include "Assignments.h"
|
||||
#include "strategic.h"
|
||||
#include "strategicmap.h"
|
||||
#include "gamescreen.h"
|
||||
#include "ai.h"
|
||||
#include "aiinternals.h"
|
||||
#include "interactive tiles.h"
|
||||
#include "soldier profile.h"
|
||||
#include "interface panels.h"
|
||||
#include "quests.h"
|
||||
#include "squads.h"
|
||||
#include "game event hook.h"
|
||||
#include "game clock.h"
|
||||
#include "AIInternals.h"
|
||||
#include "Interactive Tiles.h"
|
||||
#include "Interface Panels.h"
|
||||
#include "Quests.h"
|
||||
#include "Squads.h"
|
||||
#include "Game Event Hook.h"
|
||||
#include "Game Clock.h"
|
||||
#include "MessageBoxScreen.h"
|
||||
#include "Tactical Save.h"
|
||||
#include "interface control.h"
|
||||
#include "cursors.h"
|
||||
#include "fade screen.h"
|
||||
#include "Interface Control.h"
|
||||
#include "Cursors.h"
|
||||
#include "Fade Screen.h"
|
||||
#include "gameloop.h"
|
||||
#include "finances.h"
|
||||
#include "saveloadmap.h"
|
||||
#include "SaveLoadMap.h"
|
||||
#include "Arms Dealer Init.h"
|
||||
#include "ShopKeeper Interface.h"
|
||||
#include "Strategic Town Loyalty.h"
|
||||
#include "meanwhile.h"
|
||||
#include "Meanwhile.h"
|
||||
#include "GameSettings.h"
|
||||
#include "Strategic Mines.h"
|
||||
#include "Boxing.h"
|
||||
#include "Items.h"
|
||||
#include "WorldMan.h"
|
||||
#include "worldman.h"
|
||||
#include "Render Fun.h"
|
||||
// including this for Strategic AI.h
|
||||
#include "Strategic Movement.h"
|
||||
#include "Strategic AI.h"
|
||||
#include "Soldier create.h"
|
||||
#include "Soldier Create.h"
|
||||
#include "SkillCheck.h"
|
||||
#include "Sound Control.h"
|
||||
#include "opplist.h"
|
||||
@@ -63,17 +57,12 @@
|
||||
#include "Morale.h"
|
||||
#include "personnel.h"
|
||||
#include "Map Screen Interface.h"
|
||||
#include "Queen Command.h"
|
||||
#include "Campaign.h"
|
||||
#include "BobbyRMailOrder.h"
|
||||
#include "end game.h"
|
||||
#include "End Game.h"
|
||||
#include "Map Screen Helicopter.h"
|
||||
#include "Cheats.h"
|
||||
#include "Overhead.h"
|
||||
#include "Soldier Control.h"
|
||||
|
||||
#include "LuaInitNPCs.h"
|
||||
#include "Text.h"
|
||||
#include "Luaglobal.h"
|
||||
|
||||
|
||||
@@ -81,20 +70,18 @@
|
||||
#include "Explosion Control.h"
|
||||
#include "Ja25_Tactical.h"
|
||||
#include "Ja25 Strategic Ai.h"
|
||||
#include "MapScreen Quotes.h"
|
||||
#include "email.h"
|
||||
#include "Soldier macros.h"
|
||||
#include "LOS.h"
|
||||
#include "Soldier Control.h"
|
||||
#include "Ja25Update.h"
|
||||
#include "ub_config.h"
|
||||
#else
|
||||
// anv: for playable Speck
|
||||
#include "Speck Quotes.h"
|
||||
#include "mercs.h"
|
||||
#endif
|
||||
|
||||
#ifdef JA2UB
|
||||
#else
|
||||
// anv: for playable Speck
|
||||
#include "Speck Quotes.h"
|
||||
#include "mercs.h"
|
||||
#ifndef _DEBUG
|
||||
#include "Cheats.h"
|
||||
#endif
|
||||
|
||||
//forward declarations of common classes to eliminate includes
|
||||
@@ -182,7 +169,7 @@ BOOLEAN InternalInitiateConversation( SOLDIERTYPE *pDestSoldier, SOLDIERTYPE *pS
|
||||
extern void EndGameMessageBoxCallBack( UINT8 ubExitValue );
|
||||
extern INT32 FindNearestOpenableNonDoor( INT32 sStartGridNo );
|
||||
extern void RecalculateOppCntsDueToBecomingNeutral( SOLDIERTYPE * pSoldier );
|
||||
extern UINT8 NumCapableEnemyInSector( );
|
||||
extern UINT16 NumCapableEnemyInSector( );
|
||||
|
||||
#ifdef JA2UB
|
||||
//JA25 UB
|
||||
@@ -1037,7 +1024,7 @@ void TalkPanelClickCallback( MOUSE_REGION * pRegion, INT32 iReason )
|
||||
// open inv panel...
|
||||
gfSwitchPanel = TRUE;
|
||||
gbNewPanel = SM_PANEL;
|
||||
gubNewPanelParam = (UINT8)gpSrcSoldier->ubID;
|
||||
gubNewPanelParam = gpSrcSoldier->ubID;
|
||||
|
||||
// Wait!
|
||||
gpDestSoldier->aiData.bNextAction = AI_ACTION_WAIT;
|
||||
@@ -1555,7 +1542,7 @@ void HandleNPCTriggerNPC( UINT8 ubTargetNPC, UINT8 ubTargetRecord, BOOLEAN fShow
|
||||
guiWaitingForTriggerTime = GetJA2Clock( );
|
||||
|
||||
// Setup locator!
|
||||
ShowRadioLocator( (UINT8)pSoldier->ubID, SHOW_LOCATOR_FAST );
|
||||
ShowRadioLocator( pSoldier->ubID, SHOW_LOCATOR_FAST );
|
||||
|
||||
// If he's visible, locate...
|
||||
if ( pSoldier->bVisible != -1 )
|
||||
@@ -1584,7 +1571,7 @@ void HandleNPCTrigger( )
|
||||
{
|
||||
SOLDIERTYPE *pSoldier;
|
||||
INT32 sPlayerGridNo;
|
||||
UINT8 ubPlayerID;
|
||||
UINT16 ubPlayerID;
|
||||
|
||||
pSoldier = FindSoldierByProfileID( gubTargetNPC, FALSE );
|
||||
if (!pSoldier)
|
||||
@@ -1818,16 +1805,16 @@ void HandleFactForNPCUnescorted( UINT8 ubNPC )
|
||||
|
||||
void HandleNPCDoAction( UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum )
|
||||
{
|
||||
INT32 cnt;
|
||||
SOLDIERTYPE *pSoldier, *pSoldier2;
|
||||
INT8 bNumDone = 0;
|
||||
INT32 sGridNo = NOWHERE, sAdjustedGridNo;
|
||||
INT8 bItemIn;
|
||||
UINT8 ubDesiredMercDir;
|
||||
EXITGRID ExitGrid;
|
||||
INT32 iRandom = 0;
|
||||
UINT8 ubMineIndex;
|
||||
INT16 sX, sY, sX2, sY2;
|
||||
SoldierID cnt;
|
||||
SOLDIERTYPE *pSoldier, *pSoldier2;
|
||||
INT8 bNumDone = 0;
|
||||
INT32 sGridNo = NOWHERE, sAdjustedGridNo;
|
||||
INT8 bItemIn;
|
||||
UINT8 ubDesiredMercDir;
|
||||
EXITGRID ExitGrid;
|
||||
INT32 iRandom = 0;
|
||||
UINT8 ubMineIndex;
|
||||
INT16 sX, sY, sX2, sY2;
|
||||
|
||||
pSoldier2 = NULL;
|
||||
//ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Handling %s, action %d at %ld", gMercProfiles[ ubTargetNPC ].zNickname, usActionCode, GetJA2Clock() );
|
||||
@@ -1880,8 +1867,9 @@ void HandleNPCDoAction( UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum
|
||||
// Squad here to search for...
|
||||
|
||||
// look for all mercs on the same team,
|
||||
for ( pSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; cnt++,pSoldier++)
|
||||
for ( ; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++cnt )
|
||||
{
|
||||
pSoldier = cnt;
|
||||
// Are we in this sector, On the current squad?
|
||||
if ( pSoldier->bActive && pSoldier->stats.bLife >= OKLIFE && pSoldier->bInSector && pSoldier->bAssignment == CurrentSquad( ) )
|
||||
{
|
||||
@@ -2170,8 +2158,9 @@ void HandleNPCDoAction( UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum
|
||||
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
|
||||
// look for all mercs on the same team,
|
||||
for ( pSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; cnt++,pSoldier++)
|
||||
for ( ; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++cnt )
|
||||
{
|
||||
pSoldier = cnt;
|
||||
// Are we in this sector, On the current squad?
|
||||
if ( pSoldier->bActive && pSoldier->stats.bLife >= OKLIFE && pSoldier->bInSector )
|
||||
{
|
||||
@@ -2353,7 +2342,8 @@ void HandleNPCDoAction( UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum
|
||||
break;
|
||||
case NPC_ACTION_HAVE_PACOS_FOLLOW:
|
||||
pSoldier = FindSoldierByProfileID( 114, FALSE );
|
||||
sGridNo = 18193; //dnl!!!
|
||||
sGridNo = 8537; //dnl!!!
|
||||
//kitty: changed gridno from 18193 to 8537, that's at entrance door to rebel basement, where Fatima and Dimitri dialogue happens
|
||||
if (pSoldier)
|
||||
{
|
||||
if (NewOKDestination( pSoldier, sGridNo, TRUE, 0 ) )
|
||||
@@ -2480,7 +2470,7 @@ void HandleNPCDoAction( UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum
|
||||
if (pSoldier)
|
||||
{
|
||||
DeleteTalkingMenu();
|
||||
pSoldier->EVENT_SoldierGotHit( 1, 100, 10, pSoldier->ubDirection, 320, NOBODY , FIRE_WEAPON_NO_SPECIAL, AIM_SHOT_TORSO, 0, NOWHERE );
|
||||
pSoldier->EVENT_SoldierGotHit( 1, 100, 10, pSoldier->ubDirection, 320, NOBODY, FIRE_WEAPON_NO_SPECIAL, AIM_SHOT_TORSO, 0, NOWHERE );
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -2825,7 +2815,7 @@ void HandleNPCDoAction( UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum
|
||||
bItemIn = FindObj( pSoldier, DEED );
|
||||
if (bItemIn != NO_SLOT)
|
||||
{
|
||||
AddItemToPool( 12541, &(pSoldier->inv[bItemIn]), -1 , 0, 0, 0 );
|
||||
AddItemToPool( 12541, &(pSoldier->inv[bItemIn]), -1, 0, 0, 0 );
|
||||
DeleteObj( &(pSoldier->inv[ bItemIn ]) );
|
||||
RemoveObjectFromSoldierProfile( ubTargetNPC, DEED );
|
||||
}
|
||||
@@ -3224,7 +3214,7 @@ void HandleNPCDoAction( UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum
|
||||
if ( pSoldier )
|
||||
{
|
||||
INT32 sNearestPC;
|
||||
UINT8 ubID;
|
||||
SoldierID ubID;
|
||||
INT8 bMoneySlot;
|
||||
INT8 bEmptySlot;
|
||||
|
||||
@@ -3235,7 +3225,7 @@ void HandleNPCDoAction( UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum
|
||||
ubID = WhoIsThere2( sNearestPC, 0 );
|
||||
if (ubID != NOBODY)
|
||||
{
|
||||
pSoldier2 = MercPtrs[ ubID ];
|
||||
pSoldier2 = ubID;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3357,7 +3347,7 @@ void HandleNPCDoAction( UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum
|
||||
pSoldier = FindSoldierByProfileID( ubTargetNPC, FALSE );
|
||||
if (pSoldier)
|
||||
{
|
||||
UINT8 ubTargetID;
|
||||
SoldierID ubTargetID;
|
||||
SOLDIERTYPE *pTarget;
|
||||
|
||||
// Target a different merc....
|
||||
@@ -3384,7 +3374,7 @@ void HandleNPCDoAction( UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum
|
||||
}
|
||||
else
|
||||
{
|
||||
pTarget = MercPtrs[ ubTargetID ];
|
||||
pTarget = ubTargetID;
|
||||
}
|
||||
|
||||
// Use a different approach....
|
||||
@@ -3477,7 +3467,7 @@ void HandleNPCDoAction( UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum
|
||||
pSoldier = FindSoldierByProfileID( ubTargetNPC, FALSE );
|
||||
if (pSoldier)
|
||||
{
|
||||
UINT8 ubTargetID;
|
||||
SoldierID ubTargetID;
|
||||
SOLDIERTYPE *pTarget;
|
||||
INT32 cnt;
|
||||
BOOLEAN fGoodTarget = FALSE;
|
||||
@@ -3491,7 +3481,7 @@ void HandleNPCDoAction( UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum
|
||||
}
|
||||
else
|
||||
{
|
||||
pTarget = MercPtrs[ ubTargetID ];
|
||||
pTarget = ubTargetID;
|
||||
}
|
||||
|
||||
pSoldier->aiData.uiPendingActionData4 = APPROACH_DONE_PUNCH_1;
|
||||
@@ -3726,8 +3716,9 @@ void HandleNPCDoAction( UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum
|
||||
{
|
||||
//HOSPITAL_PATIENT_DISTANCE
|
||||
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
for ( pSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; cnt++,pSoldier++)
|
||||
for ( ; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++cnt )
|
||||
{
|
||||
pSoldier = cnt;
|
||||
// Are we in this sector, On the current squad?
|
||||
if ( pSoldier->bActive && pSoldier->bInSector && pSoldier->stats.bLife > 0 && (pSoldier->stats.bLife < pSoldier->stats.bLifeMax || NumberOfDamagedStats(pSoldier) > 0) && pSoldier->bAssignment != ASSIGNMENT_HOSPITAL && PythSpacesAway( pSoldier->sGridNo, pSoldier2->sGridNo ) < HOSPITAL_PATIENT_DISTANCE )
|
||||
{
|
||||
@@ -3901,7 +3892,7 @@ void HandleNPCDoAction( UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum
|
||||
if ( !gfInTalkPanel )
|
||||
{
|
||||
INT32 sNearestPC;
|
||||
UINT8 ubID;
|
||||
SoldierID ubID;
|
||||
|
||||
pSoldier = FindSoldierByProfileID( ubTargetNPC, FALSE );
|
||||
if ( pSoldier )
|
||||
@@ -3914,7 +3905,7 @@ void HandleNPCDoAction( UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum
|
||||
ubID = WhoIsThere2( sNearestPC, 0 );
|
||||
if (ubID != NOBODY)
|
||||
{
|
||||
pSoldier2 = MercPtrs[ ubID ];
|
||||
pSoldier2 = ubID;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4331,7 +4322,7 @@ void HandleNPCDoAction( UINT8 ubTargetNPC, UINT16 usActionCode, UINT8 ubQuoteNum
|
||||
case NPC_ACTION_PUT_PACOS_IN_BASEMENT:
|
||||
gMercProfiles[ PACOS ].sSectorX = 10;
|
||||
gMercProfiles[ PACOS ].sSectorY = MAP_ROW_A;
|
||||
gMercProfiles[ PACOS ].bSectorZ = 0;
|
||||
gMercProfiles[ PACOS ].bSectorZ = 1; //kitty: fixed - first level underground is 1, not 0
|
||||
break;
|
||||
case NPC_ACTION_HISTORY_ASSASSIN:
|
||||
AddHistoryToPlayersLog( HISTORY_ASSASSIN, 0, GetWorldTotalMin(), gWorldSectorX, gWorldSectorY );
|
||||
@@ -4578,9 +4569,9 @@ UINT32 CalcMedicalCost( UINT8 ubId )
|
||||
|
||||
INT32 sGridNo = pNPC->sGridNo;
|
||||
|
||||
for ( UINT32 cnt = gTacticalStatus.Team[gbPlayerNum].bFirstID; cnt <= gTacticalStatus.Team[gbPlayerNum].bLastID; ++cnt )
|
||||
for ( SoldierID cnt = gTacticalStatus.Team[gbPlayerNum].bFirstID; cnt <= gTacticalStatus.Team[gbPlayerNum].bLastID; ++cnt )
|
||||
{
|
||||
pSoldier = MercPtrs[ cnt ];
|
||||
pSoldier = cnt;
|
||||
if ( pSoldier->bActive && pSoldier->bInSector && pSoldier->stats.bLife > 0 && pSoldier->bAssignment != ASSIGNMENT_HOSPITAL )
|
||||
{
|
||||
if ( pSoldier->stats.bLife < pSoldier->stats.bLifeMax || NumberOfDamagedStats(pSoldier) > 0)
|
||||
@@ -4630,8 +4621,7 @@ void StartDialogueMessageBox( UINT8 ubProfileID, UINT16 usMessageBoxType )
|
||||
case NPC_ACTION_ASK_ABOUT_PAYING_RPC:
|
||||
case NPC_ACTION_ASK_ABOUT_PAYING_RPC_WITH_DAILY_SALARY:
|
||||
case NPC_ACTION_REDUCE_CONRAD_SALARY_CONDITIONS:
|
||||
swprintf( zTemp2, L"%d", gMercProfiles[ubProfileID].sSalary );
|
||||
InsertDollarSignInToString( zTemp2 );
|
||||
swprintf( zTemp2, L"%s", FormatMoney(gMercProfiles[ubProfileID].sSalary).data());
|
||||
swprintf( zTemp, TacticalStr[ HIRE_PROMPT ], gMercProfiles[ubProfileID].zNickname, zTemp2 );
|
||||
DoMessageBox( MSG_BOX_BASIC_STYLE, zTemp, GAME_SCREEN, ( UINT8 )MSG_BOX_FLAG_YESNO, DialogueMessageBoxCallBack, NULL );
|
||||
break;
|
||||
@@ -4640,8 +4630,7 @@ void StartDialogueMessageBox( UINT8 ubProfileID, UINT16 usMessageBoxType )
|
||||
DoMessageBox( MSG_BOX_BASIC_STYLE, TacticalStr[ BOXING_PROMPT ], GAME_SCREEN, ( UINT8 )MSG_BOX_FLAG_YESNO, DialogueMessageBoxCallBack, NULL );
|
||||
break;
|
||||
case NPC_ACTION_BUY_LEATHER_KEVLAR_VEST:
|
||||
swprintf( zTemp2, L"%d", Item[LEATHER_JACKET_W_KEVLAR].usPrice );
|
||||
InsertDollarSignInToString( zTemp2 );
|
||||
swprintf( zTemp2, L"%s", FormatMoney(Item[LEATHER_JACKET_W_KEVLAR].usPrice).data());
|
||||
swprintf( zTemp, TacticalStr[ BUY_VEST_PROMPT ], ItemNames[LEATHER_JACKET_W_KEVLAR], zTemp2 );
|
||||
DoMessageBox( MSG_BOX_BASIC_STYLE, zTemp, GAME_SCREEN, ( UINT8 )MSG_BOX_FLAG_YESNO, DialogueMessageBoxCallBack, NULL );
|
||||
break;
|
||||
@@ -4662,15 +4651,13 @@ void StartDialogueMessageBox( UINT8 ubProfileID, UINT16 usMessageBoxType )
|
||||
{
|
||||
iTemp -= giHospitalRefund;
|
||||
}
|
||||
swprintf( zTemp2, L"%ld", iTemp );
|
||||
InsertDollarSignInToString( zTemp2 );
|
||||
swprintf( zTemp2, L"%s", FormatMoney(iTemp).data());
|
||||
swprintf( zTemp, TacticalStr[ PAY_MONEY_PROMPT ], zTemp2 );
|
||||
|
||||
DoMessageBox( MSG_BOX_BASIC_STYLE, zTemp, GAME_SCREEN, ( UINT8 )MSG_BOX_FLAG_YESNO, DialogueMessageBoxCallBack, NULL );
|
||||
break;
|
||||
case NPC_ACTION_BUY_VEHICLE_REQUESTOR:
|
||||
swprintf( zTemp2, L"%ld", 10000 );
|
||||
InsertDollarSignInToString( zTemp2 );
|
||||
swprintf( zTemp2, L"%s", FormatMoney(10000).data());
|
||||
swprintf( zTemp, TacticalStr[ PAY_MONEY_PROMPT ], zTemp2 );
|
||||
|
||||
DoMessageBox( MSG_BOX_BASIC_STYLE, zTemp, GAME_SCREEN, ( UINT8 )MSG_BOX_FLAG_YESNO, DialogueMessageBoxCallBack, NULL );
|
||||
@@ -4850,13 +4837,14 @@ void DialogueMessageBoxCallBack( UINT8 ubExitValue )
|
||||
{
|
||||
// He tried to lie.....
|
||||
// Find the best conscious merc with a chance....
|
||||
UINT8 cnt;
|
||||
SOLDIERTYPE * pLier = NULL;
|
||||
SOLDIERTYPE * pSoldier;
|
||||
SoldierID cnt;
|
||||
SOLDIERTYPE *pLier = NULL;
|
||||
SOLDIERTYPE *pSoldier;
|
||||
|
||||
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
for ( pSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; cnt++,pSoldier++ )
|
||||
for ( ; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++cnt )
|
||||
{
|
||||
pSoldier = cnt;
|
||||
if ( pSoldier->bActive && pSoldier->bInSector && pSoldier->stats.bLife >= OKLIFE && pSoldier->bBreath >= OKBREATH )
|
||||
{
|
||||
if (!pLier || (EffectiveWisdom( pSoldier ) + EffectiveLeadership( pSoldier ) > EffectiveWisdom( pLier ) + EffectiveLeadership( pSoldier ) ) )
|
||||
@@ -5016,13 +5004,13 @@ void DoneFadeInActionBasement( )
|
||||
{
|
||||
// Start conversation, etc
|
||||
SOLDIERTYPE *pSoldier, *pNPCSoldier;
|
||||
INT32 cnt;
|
||||
|
||||
// Look for someone to talk to
|
||||
// look for all mercs on the same team,
|
||||
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
for ( pSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; cnt++,pSoldier++)
|
||||
SoldierID cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
for ( ; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++cnt )
|
||||
{
|
||||
pSoldier = cnt;
|
||||
// Are we in this sector, On the current squad?
|
||||
if ( pSoldier->bActive && pSoldier->stats.bLife >= OKLIFE && pSoldier->bInSector && pSoldier->bAssignment == CurrentSquad( ) )
|
||||
{
|
||||
@@ -5206,10 +5194,10 @@ void CarmenLeavesSectorCallback( void )
|
||||
|
||||
void PerformJerryMiloAction301()
|
||||
{
|
||||
UINT8 ubMercsPresent[NUM_MERCS_WITH_NEW_QUOTES];
|
||||
SoldierID ubMercsPresent[NUM_MERCS_WITH_NEW_QUOTES];
|
||||
UINT8 usNumMercsPresent;
|
||||
SOLDIERTYPE *pSoldier=NULL;
|
||||
UINT8 ubId;
|
||||
SoldierID ubId;
|
||||
|
||||
//Get the number and array of the new soldiers
|
||||
usNumMercsPresent = GetNumSoldierIdAndProfileIdOfTheNewMercsOnPlayerTeam( ubMercsPresent, NULL );
|
||||
@@ -5219,7 +5207,7 @@ void PerformJerryMiloAction301()
|
||||
{
|
||||
ubId = ubMercsPresent[ cnt ];
|
||||
|
||||
TacticalCharacterDialogue( MercPtrs[ubId], QUOTE_DEATH_RATE_REFUSAL );
|
||||
TacticalCharacterDialogue( ubId, QUOTE_DEATH_RATE_REFUSAL );
|
||||
}
|
||||
|
||||
//Trigger Jerry Milo's script record 11 ( call action 302 )
|
||||
@@ -5231,8 +5219,8 @@ void PerformJerryMiloAction301()
|
||||
|
||||
void PerformJerryMiloAction302()
|
||||
{
|
||||
UINT8 ubMercsPresent[NUM_MERCS_WITH_NEW_QUOTES];
|
||||
UINT8 usNumMercsPresent;
|
||||
SoldierID ubMercsPresent[NUM_MERCS_WITH_NEW_QUOTES];
|
||||
UINT8 usNumMercsPresent;
|
||||
|
||||
//off jazz
|
||||
//Get the number and array of the new soldiers
|
||||
@@ -5384,11 +5372,11 @@ void HandleSpecificQuoteWhenLeavingNpcTalkMenu()
|
||||
|
||||
void HaveQualifiedMercSayQuoteAboutNpcWhenLeavingTalkScreen( UINT8 ubNpcProfileID, UINT32 uiQuoteNum )
|
||||
{
|
||||
UINT8 usNumMercsPresent;
|
||||
UINT8 SoldierIdArray[NUM_MERCS_WITH_NEW_QUOTES];
|
||||
UINT8 ValidSoldierIdArray[NUM_MERCS_WITH_NEW_QUOTES] = {0};
|
||||
UINT8 ubNumValidSoldiers=0;
|
||||
UINT8 ubCnt;
|
||||
UINT8 usNumMercsPresent;
|
||||
SoldierID SoldierIdArray[NUM_MERCS_WITH_NEW_QUOTES];
|
||||
SoldierID ValidSoldierIdArray[NUM_MERCS_WITH_NEW_QUOTES] = {0};
|
||||
UINT8 ubNumValidSoldiers=0;
|
||||
UINT8 ubCnt;
|
||||
SOLDIERTYPE *pSoldier=NULL;
|
||||
SOLDIERTYPE * pNPC;
|
||||
|
||||
@@ -5484,7 +5472,7 @@ BOOLEAN IsMineEntranceInSectorI13AtThisGridNo( UINT32 sGridNo )
|
||||
void HaveBiggensDetonatingExplosivesByTheMine()
|
||||
{
|
||||
SOLDIERTYPE *pSoldier = NULL;
|
||||
UINT8 ubID=NOBODY;
|
||||
SoldierID ubID = NOBODY;
|
||||
|
||||
pSoldier = FindSoldierByProfileID( BIGGENS_UB , FALSE ); //BIGGENS
|
||||
if( pSoldier != NULL )
|
||||
@@ -5638,7 +5626,7 @@ void HandleRaulBlowingHimselfUp()
|
||||
usItem = HAND_GRENADE;
|
||||
INT16 sX, sY;
|
||||
ConvertGridNoToCenterCellXY(pSoldier->sGridNo, &sX, &sY);
|
||||
IgniteExplosion( RAUL_UB, sX, sY, 0, pSoldier->sGridNo, usItem, pSoldier->pathing.bLevel );
|
||||
IgniteExplosion( pSoldier->ubID, sX, sY, 0, pSoldier->sGridNo, usItem, pSoldier->pathing.bLevel );
|
||||
|
||||
SetJa25GeneralFlag( JA_GF__RAUL_BLOW_HIMSELF_UP );
|
||||
}
|
||||
|
||||
+399
-430
File diff suppressed because it is too large
Load Diff
+356
-259
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
#ifndef __INTERFACE_ITEMS_H
|
||||
#define __INTERFACE_ITEMS_H
|
||||
|
||||
#include "items.h"
|
||||
#include "Items.h"
|
||||
#include "Handle Items.h"
|
||||
#include "popup_class.h"
|
||||
|
||||
@@ -159,18 +159,19 @@ public:
|
||||
this->fCursorActive = src.fCursorActive;
|
||||
this->ItemPointerInfo = src.ItemPointerInfo;
|
||||
this->ubInvSlot = src.ubInvSlot;
|
||||
this->ubSoldierID = src.ubSoldierID;
|
||||
this->ubSoldierID = static_cast<UINT16>(src.ubSoldierID);
|
||||
return *this;
|
||||
}
|
||||
//could use a little tidying up
|
||||
BOOLEAN Save(HWFILE hFile);
|
||||
BOOLEAN Load(HWFILE hFile);
|
||||
|
||||
UINT8 ubSoldierID;
|
||||
SoldierID ubSoldierID;
|
||||
UINT8 ubInvSlot;
|
||||
BOOLEAN fCursorActive;
|
||||
OBJECTTYPE ItemPointerInfo;
|
||||
};
|
||||
#define SIZEOF_ITEM_CURSOR_SAVE_INFO_POD offsetof( ITEM_CURSOR_SAVE_INFO, ItemPointerInfo )
|
||||
|
||||
// HEADROCK HAM 5: Enums for big-item display attachment asterisks.
|
||||
enum
|
||||
|
||||
+195
-204
File diff suppressed because it is too large
Load Diff
+15
-15
@@ -77,18 +77,18 @@ void UpdateTEAMPanel( );
|
||||
*/
|
||||
BOOLEAN InitializeTEAMPanelCoords( );
|
||||
|
||||
void SetSMPanelCurrentMerc( UINT8 ubNewID );
|
||||
void SetTEAMPanelCurrentMerc( UINT8 ubNewID );
|
||||
UINT16 GetSMPanelCurrentMerc( );
|
||||
void SetSMPanelCurrentMerc( SoldierID ubNewID );
|
||||
void SetTEAMPanelCurrentMerc( UINT16 ubNewID );
|
||||
SoldierID GetSMPanelCurrentMerc( );
|
||||
void UpdateSMPanel( );
|
||||
|
||||
BOOLEAN InitTEAMSlots( );
|
||||
void AddPlayerToInterfaceTeamSlot( UINT8 ubID );
|
||||
void AddPlayerToInterfaceTeamSlot( SoldierID ubID );
|
||||
BOOLEAN RemovePlayerFromInterfaceTeamSlot( UINT8 ubID );
|
||||
BOOLEAN GetPlayerIDFromInterfaceTeamSlot( UINT8 ubPanelSlot, UINT8 *pubID );
|
||||
BOOLEAN GetPlayerIDFromInterfaceTeamSlot( UINT8 ubPanelSlot, SoldierID * pubID );
|
||||
void RemoveAllPlayersFromSlot( );
|
||||
BOOLEAN PlayerExistsInSlot( UINT8 ubID );
|
||||
BOOLEAN RemovePlayerFromTeamSlotGivenMercID( UINT8 ubMercID );
|
||||
BOOLEAN PlayerExistsInSlot( SoldierID ubID );
|
||||
BOOLEAN RemovePlayerFromTeamSlotGivenMercID( SoldierID ubMercID );
|
||||
void CheckForAndAddMercToTeamPanel( SOLDIERTYPE *pSoldier );
|
||||
void CleanUpStack( OBJECTTYPE * pObj, OBJECTTYPE * pCursorObj );
|
||||
|
||||
@@ -105,10 +105,10 @@ void InitOldInventorySystem( );
|
||||
// ATE TO BE MOVED TO INTERFACE_ITEMS.C
|
||||
extern INT8 gbNewItem[ NUM_INV_SLOTS ];
|
||||
extern INT8 gbNewItemCycle[ NUM_INV_SLOTS ];
|
||||
extern UINT8 gubNewItemMerc;
|
||||
extern UINT8 gubNewItemMerc;
|
||||
|
||||
void ShowRadioLocator( UINT8 ubID, UINT8 ubLocatorSpeed );
|
||||
void EndRadioLocator( UINT8 ubID );
|
||||
void ShowRadioLocator( SoldierID ubID, UINT8 ubLocatorSpeed );
|
||||
void EndRadioLocator( SoldierID ubID );
|
||||
|
||||
|
||||
extern MOUSE_REGION gSMPanelRegion;
|
||||
@@ -118,12 +118,12 @@ extern BOOLEAN gfDisableTacticalPanelButtons;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UINT8 ubID;
|
||||
BOOLEAN fOccupied;
|
||||
SoldierID ubID;
|
||||
BOOLEAN fOccupied;
|
||||
|
||||
} TEAM_PANEL_SLOTS_TYPE;
|
||||
|
||||
extern TEAM_PANEL_SLOTS_TYPE gTeamPanel[ NUM_TEAM_SLOTS ];
|
||||
extern TEAM_PANEL_SLOTS_TYPE gTeamPanel[ NUM_TEAM_SLOTS ];
|
||||
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ void GoToMapScreenFromTactical( void );
|
||||
|
||||
void FinishAnySkullPanelAnimations( );
|
||||
|
||||
UINT8 FindNextMercInTeamPanel( SOLDIERTYPE *pSoldier, BOOLEAN fGoodForLessOKLife, BOOLEAN fOnlyRegularMercs );
|
||||
SoldierID FindNextMercInTeamPanel( SOLDIERTYPE *pSoldier, BOOLEAN fGoodForLessOKLife, BOOLEAN fOnlyRegularMercs );
|
||||
|
||||
// CHRISL: New callback functions for backpack buttons
|
||||
BOOLEAN ChangeDropPackStatus(SOLDIERTYPE *pSoldier, BOOLEAN newStatus);
|
||||
@@ -168,4 +168,4 @@ extern UINT8 gubDescBoxTotalAdvLines;
|
||||
// Jenilee: determine the cost of moving this item around in our inventory
|
||||
UINT16 GetInvMovementCost(OBJECTTYPE* pObj, INT16 old_pos, INT16 new_pos);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
#include "builddefines.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "sgp.h"
|
||||
#include "himage.h"
|
||||
#include "vobject.h"
|
||||
#include "interface utils.h"
|
||||
#include "render dirty.h"
|
||||
#include "interface.h"
|
||||
#include "Interface Utils.h"
|
||||
#include "Render Dirty.h"
|
||||
#include "Interface.h"
|
||||
#include "sysutil.h"
|
||||
#include "faces.h"
|
||||
#include "render dirty.h"
|
||||
#include "weapons.h"
|
||||
#include "Weapons.h"
|
||||
#include "Overhead.h"
|
||||
#include "Soldier macros.h"
|
||||
#include "line.h"
|
||||
@@ -43,7 +41,7 @@ extern UINT32 guiBrownBackgroundForTeamPanel;
|
||||
extern UINT32 guiGoldBackgroundForTeamPanel;
|
||||
|
||||
// selected grunt
|
||||
extern UINT16 gusSelectedSoldier;
|
||||
extern SoldierID gusSelectedSoldier;
|
||||
|
||||
// car portraits
|
||||
enum{
|
||||
@@ -494,7 +492,7 @@ void RenderSoldierFace( SOLDIERTYPE *pSoldier, INT16 sFaceX, INT16 sFaceY, BOOLE
|
||||
}
|
||||
else
|
||||
{
|
||||
SetAutoFaceActiveFromSoldier( FRAME_BUFFER, guiSAVEBUFFER, pSoldier->ubID , sFaceX, sFaceY );
|
||||
SetAutoFaceActiveFromSoldier( FRAME_BUFFER, guiSAVEBUFFER, pSoldier->ubID, sFaceX, sFaceY );
|
||||
// SetAutoFaceActiveFromSoldier( FRAME_BUFFER, FACE_AUTO_RESTORE_BUFFER, pSoldier->ubID , sFaceX, sFaceY );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,4 +27,4 @@ void UnLoadCarPortraits( void );
|
||||
void DrawItemOutlineZoomedInventory( INT16 sX, INT16 sY, INT16 sWidth, INT16 sHeight, INT16 sColor, UINT32 uiBuffer );
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+62
-96
@@ -1,62 +1,55 @@
|
||||
#include "builddefines.h"
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <time.h>
|
||||
#include "sgp.h"
|
||||
#include "gameloop.h"
|
||||
#include "himage.h"
|
||||
#include "vobject.h"
|
||||
#include "sysutil.h"
|
||||
#include "overhead.h"
|
||||
#include "Overhead.h"
|
||||
#include "mousesystem.h"
|
||||
#include "Button System.h"
|
||||
#include "interface.h"
|
||||
#include "Interface.h"
|
||||
#include "vsurface.h"
|
||||
#include "wcheck.h"
|
||||
#include "WCheck.h"
|
||||
#include "input.h"
|
||||
#include "Handle UI.h"
|
||||
#include "Animation Control.h"
|
||||
#include "Animation Data.h"
|
||||
#include "renderworld.h"
|
||||
#include "sys globals.h"
|
||||
#include "cursors.h"
|
||||
#include "radar screen.h"
|
||||
#include "Sys Globals.h"
|
||||
#include "Cursors.h"
|
||||
#include "Radar Screen.h"
|
||||
#include "worldman.h"
|
||||
#include "Font Control.h"
|
||||
#include "render dirty.h"
|
||||
#include "utilities.h"
|
||||
#include "interface cursors.h"
|
||||
#include "Render Dirty.h"
|
||||
#include "Utilities.h"
|
||||
#include "Interface Cursors.h"
|
||||
#include "Sound Control.h"
|
||||
#include "lighting.h"
|
||||
#include "Interface Panels.h"
|
||||
#include "pathai.h"
|
||||
#include "vobject_blitters.h"
|
||||
#include "PATHAI.H"
|
||||
#include <shading.h>
|
||||
#include "faces.h"
|
||||
#include "Handle UI Plan.h"
|
||||
#include "interface control.h"
|
||||
#include "interface items.h"
|
||||
#include "soldier profile.h"
|
||||
#include "Interface Control.h"
|
||||
#include "Interface Items.h"
|
||||
#include "Soldier Profile.h"
|
||||
#include "MercTextBox.h"
|
||||
#include "soldier functions.h"
|
||||
#include "cursor control.h"
|
||||
#include "handle doors.h"
|
||||
#include "keys.h"
|
||||
#include "text.h"
|
||||
#include "points.h"
|
||||
#include "soldier macros.h"
|
||||
#include "game clock.h"
|
||||
#include "Soldier Functions.h"
|
||||
#include "Cursor Control.h"
|
||||
#include "Handle Doors.h"
|
||||
#include "Keys.h"
|
||||
#include "Text.h"
|
||||
#include "Points.h"
|
||||
#include "Soldier macros.h"
|
||||
#include "Game Clock.h"
|
||||
#include "physics.h"
|
||||
#include "Map Screen Interface Map.h"
|
||||
#include "line.h"
|
||||
#include "Vehicles.h"
|
||||
#include "messageboxscreen.h"
|
||||
#include "gamesettings.h"
|
||||
#include "GameSettings.h"
|
||||
#include "Squads.h"
|
||||
#include "message.h"
|
||||
#include "strategicmap.h"
|
||||
#include "Queen Command.h"
|
||||
// HEADROCK HAM 4: Included for new CTH indicator
|
||||
#include "weapons.h"
|
||||
#include "Weapons.h"
|
||||
#include "Map Screen Interface.h" // added by Flugente for SquadNames
|
||||
#include "environment.h"
|
||||
#include "SkillCheck.h" // added by Flugente
|
||||
@@ -65,14 +58,7 @@
|
||||
|
||||
#include "InterfaceItemImages.h"
|
||||
#ifdef JA2UB
|
||||
#include "Explosion Control.h"
|
||||
#include "Ja25_Tactical.h"
|
||||
#include "Ja25 Strategic Ai.h"
|
||||
#include "MapScreen Quotes.h"
|
||||
#include "email.h"
|
||||
#include "interface Dialogue.h"
|
||||
#include "mercs.h"
|
||||
#include "ub_config.h"
|
||||
#endif
|
||||
|
||||
#include "connect.h"
|
||||
@@ -122,8 +108,8 @@ extern BOOLEAN gfCannotGetThrough; // will use it when showing red laser dot
|
||||
extern void SoldierTooltip(SOLDIERTYPE*);
|
||||
|
||||
BOOLEAN gfProgBarActive = FALSE;
|
||||
UINT8 gubProgNumEnemies = 0;
|
||||
UINT8 gubProgCurEnemy = 0;
|
||||
UINT16 gubProgNumEnemies = 0;
|
||||
UINT16 gubProgCurEnemy = 0;
|
||||
|
||||
|
||||
UINT32 guiPORTRAITICONS;
|
||||
@@ -164,8 +150,6 @@ MOUSE_REGION gMenuOverlayRegion;
|
||||
|
||||
MOUSE_REGION gBottomPanalRegion;
|
||||
|
||||
UINT16 gusOldSelectedSoldier = NOBODY;
|
||||
|
||||
// OVerlay ID
|
||||
INT32 giPopupSlideMessageOverlay = -1;
|
||||
UINT16 gusOverlayPopupBoxWidth, gusOverlayPopupBoxHeight;
|
||||
@@ -187,9 +171,9 @@ BOOLEAN gfPanelAllocated = FALSE;
|
||||
|
||||
extern MOUSE_REGION gDisableRegion;
|
||||
extern MOUSE_REGION gUserTurnRegion;
|
||||
extern BOOLEAN gfUserTurnRegionActive;
|
||||
extern UINT8 gubSelectSMPanelToMerc;
|
||||
extern BOOLEAN gfIgnoreOnSelectedGuy;
|
||||
extern BOOLEAN gfUserTurnRegionActive;
|
||||
extern SoldierID gubSelectSMPanelToMerc;
|
||||
extern BOOLEAN gfIgnoreOnSelectedGuy;
|
||||
|
||||
enum
|
||||
{
|
||||
@@ -461,14 +445,7 @@ BOOLEAN InitializeTacticalInterface( )
|
||||
|
||||
// failing the CHECKF after this will cause you to lose your mouse
|
||||
|
||||
if ( GETPIXELDEPTH() == 8 )
|
||||
{
|
||||
strcpy( vs_desc.ImageFile, "INTERFACE\\IN_TEXT_8.pcx" );
|
||||
}
|
||||
else if ( GETPIXELDEPTH() == 16 )
|
||||
{
|
||||
strcpy( vs_desc.ImageFile, "INTERFACE\\IN_TEXT.STI" );
|
||||
}
|
||||
strcpy( vs_desc.ImageFile, "INTERFACE\\IN_TEXT.STI" );
|
||||
|
||||
if( !AddVideoSurface( &vs_desc, &guiINTEXT ) )
|
||||
AssertMsg( 0, "Missing INTERFACE\\In_text.sti");
|
||||
@@ -663,10 +640,7 @@ void ShutdownCurrentPanel( )
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void SetCurrentTacticalPanelCurrentMerc( UINT8 ubID )
|
||||
void SetCurrentTacticalPanelCurrentMerc( SoldierID ubID )
|
||||
{
|
||||
SOLDIERTYPE *pSoldier;
|
||||
|
||||
@@ -676,7 +650,7 @@ void SetCurrentTacticalPanelCurrentMerc( UINT8 ubID )
|
||||
if ( gsCurInterfacePanel == SM_PANEL )
|
||||
{
|
||||
// If we are not of merc bodytype, or am an epc, and going into inv, goto another....
|
||||
pSoldier = MercPtrs[ ubID ];
|
||||
pSoldier = ubID;
|
||||
|
||||
if ( !IS_MERC_BODY_TYPE( pSoldier ) || AM_AN_EPC( pSoldier ) )
|
||||
{
|
||||
@@ -692,13 +666,12 @@ void SetCurrentTacticalPanelCurrentMerc( UINT8 ubID )
|
||||
break;
|
||||
|
||||
case TEAM_PANEL:
|
||||
SetTEAMPanelCurrentMerc( (UINT8)gusSelectedSoldier );
|
||||
SetTEAMPanelCurrentMerc( gusSelectedSoldier );
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
void CreateCurrentTacticalPanelButtons( )
|
||||
{
|
||||
switch( gsCurInterfacePanel )
|
||||
@@ -730,7 +703,7 @@ void SetCurrentInterfacePanel( UINT8 ubNewPanel )
|
||||
void ToggleTacticalPanels( )
|
||||
{
|
||||
gfSwitchPanel = TRUE;
|
||||
gubNewPanelParam = (UINT8)gusSelectedSoldier;
|
||||
gubNewPanelParam = gusSelectedSoldier;
|
||||
|
||||
if ( gsCurInterfacePanel == SM_PANEL )
|
||||
{
|
||||
@@ -760,7 +733,7 @@ void RemoveCurrentTacticalPanelButtons( )
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN IsMercPortraitVisible( UINT8 ubSoldierID )
|
||||
BOOLEAN IsMercPortraitVisible( UINT16 ubSoldierID )
|
||||
{
|
||||
if ( gsCurInterfacePanel == TEAM_PANEL )
|
||||
{
|
||||
@@ -851,7 +824,7 @@ void PopupMovementMenu( UI_EVENT *pUIEvent )
|
||||
|
||||
if ( gusSelectedSoldier != NOBODY )
|
||||
{
|
||||
pSoldier = MercPtrs[ gusSelectedSoldier ];
|
||||
pSoldier = gusSelectedSoldier;
|
||||
}
|
||||
|
||||
// Blit background!
|
||||
@@ -978,12 +951,12 @@ void PopupMovementMenu( UI_EVENT *pUIEvent )
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( Item[pSoldier->inv[ HANDPOS ].usItem].toolkit )
|
||||
if (ItemIsToolkit(pSoldier->inv[ HANDPOS ].usItem))
|
||||
{
|
||||
uiActionImages = TOOLKITACTIONC_IMAGES;
|
||||
swprintf( zActionString, TacticalStr[ NOT_APPLICABLE_POPUPTEXT ] );
|
||||
}
|
||||
else if ( Item[pSoldier->inv[ HANDPOS ].usItem].wirecutters )
|
||||
else if (ItemIsWirecutters(pSoldier->inv[ HANDPOS ].usItem))
|
||||
{
|
||||
uiActionImages = WIRECUTACTIONC_IMAGES;
|
||||
swprintf( zActionString, TacticalStr[ NOT_APPLICABLE_POPUPTEXT ] );
|
||||
@@ -1673,7 +1646,7 @@ void DrawCTHPixelToBuffer( UINT16 *pBuffer, UINT32 uiPitch, INT16 sLeft, INT16 s
|
||||
|
||||
//QUOTE_SYSTEM_STRUCT soldierTTInfo;
|
||||
|
||||
void DrawSelectedUIAboveGuy( UINT16 usSoldierID )
|
||||
void DrawSelectedUIAboveGuy( SoldierID usSoldierID )
|
||||
{
|
||||
SOLDIERTYPE *pSoldier;
|
||||
INT16 sXPos, sYPos;
|
||||
@@ -3562,10 +3535,7 @@ void DrawBarsInUIBox( SOLDIERTYPE *pSoldier , INT16 sXPos, INT16 sYPos, INT16 sW
|
||||
}
|
||||
if ( pSoldier->ubID == gusSelectedSoldier )
|
||||
{
|
||||
if(gbPixelDepth==16)
|
||||
RectangleDraw( TRUE, sXPos+1, sYPos-1, sXPos+sWidth+3, sYPos+1+interval*3, color16, pDestBuf);
|
||||
else
|
||||
RectangleDraw8( TRUE, sXPos+1, sYPos-1, sXPos+sWidth+3, sYPos+1+interval*3, color8, pDestBuf);
|
||||
RectangleDraw( TRUE, sXPos+1, sYPos-1, sXPos+sWidth+3, sYPos+1+interval*3, color16, pDestBuf);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4218,7 +4188,7 @@ void BtnDoorMenuCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
if ( EnoughPoints( gOpenDoorMenu.pSoldier, APBPConstants[AP_OPEN_DOOR], APBPConstants[BP_OPEN_DOOR], FALSE ) )
|
||||
{
|
||||
// Set UI
|
||||
SetUIBusy( (UINT8)gOpenDoorMenu.pSoldier->ubID );
|
||||
SetUIBusy( gOpenDoorMenu.pSoldier->ubID );
|
||||
|
||||
if ( gOpenDoorMenu.fClosingDoor )
|
||||
{
|
||||
@@ -4242,7 +4212,7 @@ void BtnDoorMenuCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
if ( EnoughPoints( gOpenDoorMenu.pSoldier, GetAPsToOpenDoor( gOpenDoorMenu.pSoldier ), APBPConstants[BP_OPEN_DOOR], FALSE ) )
|
||||
{
|
||||
// Set UI
|
||||
SetUIBusy( (UINT8)gOpenDoorMenu.pSoldier->ubID );
|
||||
SetUIBusy( gOpenDoorMenu.pSoldier->ubID );
|
||||
|
||||
if ( gOpenDoorMenu.fClosingDoor )
|
||||
{
|
||||
@@ -4267,7 +4237,7 @@ void BtnDoorMenuCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
if ( EnoughPoints( gOpenDoorMenu.pSoldier, APBPConstants[AP_BOOT_DOOR], APBPConstants[BP_BOOT_DOOR], FALSE ) )
|
||||
{
|
||||
// Set UI
|
||||
SetUIBusy( (UINT8)gOpenDoorMenu.pSoldier->ubID );
|
||||
SetUIBusy( gOpenDoorMenu.pSoldier->ubID );
|
||||
|
||||
InteractWithClosedDoor( gOpenDoorMenu.pSoldier, HANDLE_DOOR_FORCE );
|
||||
}
|
||||
@@ -4284,7 +4254,7 @@ void BtnDoorMenuCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
if ( EnoughPoints( gOpenDoorMenu.pSoldier, APBPConstants[AP_UNLOCK_DOOR], APBPConstants[BP_UNLOCK_DOOR], FALSE ) )
|
||||
{
|
||||
// Set UI
|
||||
SetUIBusy( (UINT8)gOpenDoorMenu.pSoldier->ubID );
|
||||
SetUIBusy( gOpenDoorMenu.pSoldier->ubID );
|
||||
|
||||
InteractWithClosedDoor( gOpenDoorMenu.pSoldier, HANDLE_DOOR_UNLOCK );
|
||||
}
|
||||
@@ -4301,7 +4271,7 @@ void BtnDoorMenuCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
if ( EnoughPoints( gOpenDoorMenu.pSoldier, GetAPsToPicklock( gOpenDoorMenu.pSoldier ), APBPConstants[BP_PICKLOCK], FALSE ) ) // SANDRO
|
||||
{
|
||||
// Set UI
|
||||
SetUIBusy( (UINT8)gOpenDoorMenu.pSoldier->ubID );
|
||||
SetUIBusy( gOpenDoorMenu.pSoldier->ubID );
|
||||
|
||||
InteractWithClosedDoor( gOpenDoorMenu.pSoldier, HANDLE_DOOR_LOCKPICK );
|
||||
}
|
||||
@@ -4318,7 +4288,7 @@ void BtnDoorMenuCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
if ( EnoughPoints( gOpenDoorMenu.pSoldier, APBPConstants[AP_EXAMINE_DOOR], APBPConstants[BP_EXAMINE_DOOR], FALSE ) )
|
||||
{
|
||||
// Set UI
|
||||
SetUIBusy( (UINT8)gOpenDoorMenu.pSoldier->ubID );
|
||||
SetUIBusy( gOpenDoorMenu.pSoldier->ubID );
|
||||
|
||||
InteractWithClosedDoor( gOpenDoorMenu.pSoldier, HANDLE_DOOR_EXAMINE );
|
||||
}
|
||||
@@ -4344,7 +4314,7 @@ void BtnDoorMenuCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
if ( EnoughPoints( gOpenDoorMenu.pSoldier, APBPConstants[AP_EXPLODE_DOOR], APBPConstants[BP_EXPLODE_DOOR], FALSE ) )
|
||||
{
|
||||
// Set UI
|
||||
SetUIBusy( (UINT8)gOpenDoorMenu.pSoldier->ubID );
|
||||
SetUIBusy( gOpenDoorMenu.pSoldier->ubID );
|
||||
|
||||
InteractWithClosedDoor( gOpenDoorMenu.pSoldier, HANDLE_DOOR_EXPLODE );
|
||||
}
|
||||
@@ -4359,7 +4329,7 @@ void BtnDoorMenuCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
if ( EnoughPoints( gOpenDoorMenu.pSoldier, GetAPsToBombDoor( gOpenDoorMenu.pSoldier ), APBPConstants[BP_EXPLODE_DOOR], FALSE ) ) // SANDRO
|
||||
{
|
||||
// Set UI
|
||||
SetUIBusy( (UINT8)gOpenDoorMenu.pSoldier->ubID );
|
||||
SetUIBusy( gOpenDoorMenu.pSoldier->ubID );
|
||||
|
||||
InteractWithClosedDoor( gOpenDoorMenu.pSoldier, HANDLE_DOOR_EXPLODE );
|
||||
}
|
||||
@@ -4377,7 +4347,7 @@ void BtnDoorMenuCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
if ( EnoughPoints( gOpenDoorMenu.pSoldier, GetAPsToUntrapDoor( gOpenDoorMenu.pSoldier ), APBPConstants[BP_UNTRAP_DOOR], FALSE ) ) // SANDRO
|
||||
{
|
||||
// Set UI
|
||||
SetUIBusy( (UINT8)gOpenDoorMenu.pSoldier->ubID );
|
||||
SetUIBusy( gOpenDoorMenu.pSoldier->ubID );
|
||||
|
||||
InteractWithClosedDoor( gOpenDoorMenu.pSoldier, HANDLE_DOOR_UNTRAP );
|
||||
}
|
||||
@@ -4403,7 +4373,7 @@ void BtnDoorMenuCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
if ( EnoughPoints( gOpenDoorMenu.pSoldier, APBPConstants[AP_USE_CROWBAR], APBPConstants[BP_USE_CROWBAR], FALSE ) )
|
||||
{
|
||||
// Set UI
|
||||
SetUIBusy( (UINT8)gOpenDoorMenu.pSoldier->ubID );
|
||||
SetUIBusy( gOpenDoorMenu.pSoldier->ubID );
|
||||
|
||||
InteractWithClosedDoor( gOpenDoorMenu.pSoldier, HANDLE_DOOR_CROWBAR );
|
||||
}
|
||||
@@ -4418,7 +4388,7 @@ void BtnDoorMenuCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
if ( EnoughPoints( gOpenDoorMenu.pSoldier, APBPConstants[AP_USE_CROWBAR], APBPConstants[BP_USE_CROWBAR], FALSE ) )
|
||||
{
|
||||
// Set UI
|
||||
SetUIBusy( (UINT8)gOpenDoorMenu.pSoldier->ubID );
|
||||
SetUIBusy( gOpenDoorMenu.pSoldier->ubID );
|
||||
|
||||
InteractWithClosedDoor( gOpenDoorMenu.pSoldier, HANDLE_DOOR_CROWBAR );
|
||||
}
|
||||
@@ -5176,7 +5146,7 @@ void PauseRT( BOOLEAN fPause )
|
||||
}
|
||||
|
||||
|
||||
void InitEnemyUIBar( UINT8 ubNumEnemies, UINT8 ubDoneEnemies )
|
||||
void InitEnemyUIBar( UINT16 ubNumEnemies, UINT16 ubDoneEnemies )
|
||||
{
|
||||
// OK, set value
|
||||
gubProgNumEnemies = ubNumEnemies + ubDoneEnemies;
|
||||
@@ -5215,8 +5185,7 @@ void UpdateEnemyUIBar( )
|
||||
void InitPlayerUIBar( BOOLEAN fInterrupt )
|
||||
{
|
||||
SOLDIERTYPE *pTeamSoldier;
|
||||
INT32 cnt = 0;
|
||||
INT8 bNumOK = 0, bNumNotOK = 0;
|
||||
INT16 bNumOK = 0, bNumNotOK = 0;
|
||||
|
||||
if ( !gGameOptions.fTurnTimeLimit )
|
||||
{
|
||||
@@ -5241,11 +5210,12 @@ void InitPlayerUIBar( BOOLEAN fInterrupt )
|
||||
gTacticalStatus.usTactialTurnLimitCounter = 0;
|
||||
|
||||
// IF IT'S THE SELECTED GUY, MAKE ANOTHER SELECTED!
|
||||
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
SoldierID cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
|
||||
// look for all mercs on the same team,
|
||||
for ( pTeamSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; cnt++,pTeamSoldier++)
|
||||
for ( ; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++cnt )
|
||||
{
|
||||
pTeamSoldier = cnt;
|
||||
// Are we active and in sector.....
|
||||
if ( pTeamSoldier->bActive && pTeamSoldier->bInSector )
|
||||
{
|
||||
@@ -5714,7 +5684,6 @@ void BeginMultiPurposeLocator( INT32 sGridNo, INT8 bLevel, BOOLEAN fSlideTo )
|
||||
|
||||
// sGridNo here for DG compatibility
|
||||
gTacticalStatus.sSlideTarget = sGridNo;
|
||||
gTacticalStatus.sSlideReason = NOBODY;
|
||||
|
||||
// Plot new path!
|
||||
gfPlotNewMovement = TRUE;
|
||||
@@ -5812,10 +5781,7 @@ void DrawBar( INT32 x, INT32 y, INT32 width, INT32 height, UINT16 color8, UINT16
|
||||
{
|
||||
for( INT32 i=0; i < height; i++ )
|
||||
{
|
||||
if(gbPixelDepth==16)
|
||||
LineDraw( TRUE, x, y+i, x+width-1, y+i, color16, pDestBuf );
|
||||
else if(gbPixelDepth==8)
|
||||
LineDraw8( TRUE, x, y+i, x+width-1, y+i, color8, pDestBuf );
|
||||
LineDraw( TRUE, x, y+i, x+width-1, y+i, color16, pDestBuf );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6043,7 +6009,7 @@ void GetEnemyInfoString( SOLDIERTYPE* pSelectedSoldier, SOLDIERTYPE* pTargetSold
|
||||
}
|
||||
else
|
||||
{ // show general name
|
||||
if( Item[pTargetSoldier->inv[HEAD1POS].usItem].gasmask )
|
||||
if(ItemIsGasmask(pTargetSoldier->inv[HEAD1POS].usItem))
|
||||
wcscat( NameStr, TacticalStr[ GENERAL_INFO_MASK ] );
|
||||
else if( Item[pTargetSoldier->inv[HEAD1POS].usItem].nightvisionrangebonus || Item[pTargetSoldier->inv[HEAD1POS].usItem].cavevisionrangebonus )
|
||||
wcscat( NameStr, TacticalStr[ GENERAL_INFO_NVG ] );
|
||||
@@ -6059,7 +6025,7 @@ void GetEnemyInfoString( SOLDIERTYPE* pSelectedSoldier, SOLDIERTYPE* pTargetSold
|
||||
}
|
||||
else
|
||||
{ // show general name
|
||||
if( Item[pTargetSoldier->inv[HEAD1POS].usItem].gasmask )
|
||||
if(ItemIsGasmask(pTargetSoldier->inv[HEAD1POS].usItem))
|
||||
wcscat( NameStr, TacticalStr[ GENERAL_INFO_MASK ] );
|
||||
else if( Item[pTargetSoldier->inv[HEAD1POS].usItem].nightvisionrangebonus || Item[pTargetSoldier->inv[HEAD1POS].usItem].cavevisionrangebonus )
|
||||
wcscat( NameStr, TacticalStr[ GENERAL_INFO_NVG ] );
|
||||
@@ -6136,7 +6102,7 @@ void ShowEnemyWeapon( INT16 sX, INT16 sY, SOLDIERTYPE* pTargetSoldier )
|
||||
INT32 iVisibleDistance;
|
||||
|
||||
if ( gusSelectedSoldier != NOBODY )
|
||||
pSelectedSoldier = MercPtrs[ gusSelectedSoldier ];
|
||||
pSelectedSoldier = gusSelectedSoldier;
|
||||
else
|
||||
return;
|
||||
|
||||
@@ -6182,7 +6148,7 @@ void ShowEnemyHealthBar( INT16 sX, INT16 sY, SOLDIERTYPE* pSoldier )
|
||||
SOLDIERTYPE *pSelectedSoldier;
|
||||
|
||||
if ( gusSelectedSoldier != NOBODY )
|
||||
pSelectedSoldier = MercPtrs[ gusSelectedSoldier ];
|
||||
pSelectedSoldier = gusSelectedSoldier;
|
||||
else
|
||||
return;
|
||||
|
||||
|
||||
+10
-10
@@ -1,7 +1,7 @@
|
||||
#ifndef _INTERFACE_H
|
||||
#define _INTERFACE_H
|
||||
|
||||
#include "handle UI.h"
|
||||
#include "Handle UI.h"
|
||||
#include "mousesystem.h"
|
||||
#include "structure.h"
|
||||
#include "Assignments.h" // added by Flugente for the stat-enums
|
||||
@@ -372,9 +372,9 @@ enum
|
||||
|
||||
extern BOOLEAN gfSwitchPanel;
|
||||
extern BOOLEAN gfUIStanceDifferent;
|
||||
extern UINT8 gbNewPanel;
|
||||
extern UINT8 gubNewPanelParam;
|
||||
extern INT16 gsCurInterfacePanel;
|
||||
extern UINT8 gbNewPanel;
|
||||
extern SoldierID gubNewPanelParam;
|
||||
extern INT16 gsCurInterfacePanel;
|
||||
|
||||
extern UINT32 guiRENDERBUFFER;
|
||||
extern UINT32 guiCLOSE;
|
||||
@@ -458,16 +458,16 @@ void HandleInterfaceBackgrounds( );
|
||||
void BeginOverlayMessage( UINT32 uiFont, STR16 pFontString, ... );
|
||||
void EndOverlayMessage( );
|
||||
|
||||
void DrawSelectedUIAboveGuy( UINT16 usSoldierID );
|
||||
void DrawSelectedUIAboveGuy( SoldierID usSoldierID );
|
||||
|
||||
// HEADROCK HAM 4: Draw the CTH indicator, using values grabbed from the global CTH array
|
||||
BOOLEAN DrawCTHIndicator();
|
||||
|
||||
void CreateCurrentTacticalPanelButtons( );
|
||||
void RemoveCurrentTacticalPanelButtons( );
|
||||
void SetCurrentTacticalPanelCurrentMerc( UINT8 ubID );
|
||||
void SetCurrentTacticalPanelCurrentMerc( SoldierID ubID );
|
||||
void SetCurrentInterfacePanel( UINT8 ubNewPanel );
|
||||
BOOLEAN IsMercPortraitVisible( UINT8 ubSoldierID );
|
||||
BOOLEAN IsMercPortraitVisible( UINT16 ubSoldierID );
|
||||
|
||||
BOOLEAN InitializeCurrentPanel( );
|
||||
void ShutdownCurrentPanel( );
|
||||
@@ -482,7 +482,7 @@ void HandleUpDownArrowBackgrounds( );
|
||||
|
||||
void EndDeadlockMsg( );
|
||||
|
||||
void HandleLocateSelectMerc( UINT8 ubID, INT8 bFlag );
|
||||
void HandleLocateSelectMerc( SoldierID ubID, INT8 bFlag );
|
||||
|
||||
void DirtyMercPanelInterface( SOLDIERTYPE *pSoldier, UINT8 ubDirtyLevel );
|
||||
|
||||
@@ -522,7 +522,7 @@ void EndTopMessage( );
|
||||
|
||||
void PauseRT( BOOLEAN fPause );
|
||||
|
||||
void InitEnemyUIBar( UINT8 ubNumEnemies, UINT8 ubDoneEnemies );
|
||||
void InitEnemyUIBar( UINT16 ubNumEnemies, UINT16 ubDoneEnemies );
|
||||
|
||||
STR16 GetSoldierHealthString( SOLDIERTYPE *pSoldier );
|
||||
|
||||
@@ -581,4 +581,4 @@ void NCTHShowMounted( SOLDIERTYPE* pSoldier, UINT16* ptrBuf, UINT32 uiPitch, INT
|
||||
BOOLEAN HasBackgroundFlag( UINT8 usProfile, UINT64 aFlag );
|
||||
INT16 GetBackgroundValue( UINT8 usProfile, UINT16 aNr );
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include "DEBUG.H"
|
||||
#include "vobject.h"
|
||||
#include "utilities.h"
|
||||
#include "Utilities.h"
|
||||
#include "GameSettings.h"
|
||||
#include <vfs/Core/vfs.h>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef _ITERFACEITEMIMAGES_H_
|
||||
#define _ITERFACEITEMIMAGES_H_
|
||||
|
||||
#include "Types.h"
|
||||
#include "types.h"
|
||||
#include <vfs/Core/vfs_types.h>
|
||||
#include <vfs/Core/vfs_path.h>
|
||||
#include <map>
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#include <memory.h>
|
||||
#include "Inventory Choosing.h"
|
||||
#include "animation data.h"
|
||||
#include "Animation Data.h"
|
||||
#include "Items.h"
|
||||
#include "Random.h"
|
||||
#include "random.h"
|
||||
#include "Weapons.h"
|
||||
#include "Strategic Status.h"
|
||||
#include "Campaign.h"
|
||||
@@ -15,7 +14,6 @@
|
||||
#include "strategic.h"
|
||||
#include "Game Clock.h"
|
||||
#include "message.h"
|
||||
#include "Tactical Save.h" // added by Flugente
|
||||
#include "Soldier macros.h" // added by Flugente
|
||||
#include "Rebel Command.h"
|
||||
extern WorldItems gAllWorldItems;
|
||||
@@ -738,7 +736,7 @@ void GenerateRandomEquipment( SOLDIERCREATE_STRUCT *pp, INT8 bSoldierClass, INT8
|
||||
switch( Item[ pItem->usItem ].usItemClass )
|
||||
{
|
||||
case IC_GUN:
|
||||
if ( !Item[pItem->usItem].rocketlauncher )
|
||||
if ( !ItemIsRocketLauncher(pItem->usItem) )
|
||||
{
|
||||
bWeaponClass *= -1;
|
||||
}
|
||||
@@ -873,7 +871,7 @@ void ChooseWeaponForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8 bWeaponC
|
||||
pp->Inv[ i ][0]->data.gun.ubGunAmmoType = Magazine[Item[usAmmoIndex].ubClassIndex].ubAmmoType;
|
||||
pp->Inv[ i ][0]->data.gun.usGunAmmoItem = usAmmoIndex;
|
||||
|
||||
if ( Item[usGunIndex].fingerprintid )
|
||||
if (ItemHasFingerPrintID(usGunIndex))
|
||||
{
|
||||
pp->Inv[ i ][0]->data.ubImprintID = (NO_PROFILE + 1);
|
||||
}
|
||||
@@ -951,7 +949,7 @@ void ChooseWeaponForSoldierCreateStruct( SOLDIERCREATE_STRUCT *pp, INT8 bWeaponC
|
||||
pp->Inv[ HANDPOS ].fFlags |= OBJECT_UNDROPPABLE;
|
||||
|
||||
// Rocket Rifles must come pre-imprinted, in case carrier gets killed without getting a shot off
|
||||
if ( Item[usGunIndex].fingerprintid )
|
||||
if (ItemHasFingerPrintID(usGunIndex))
|
||||
{
|
||||
pp->Inv[ HANDPOS ][0]->data.ubImprintID = (NO_PROFILE + 1);
|
||||
}
|
||||
@@ -3144,7 +3142,7 @@ void ReplaceExtendedGuns( SOLDIERCREATE_STRUCT *pp, INT8 bSoldierClass )
|
||||
{
|
||||
usItem = pp->Inv[ uiLoop ].usItem;
|
||||
|
||||
if ( ( Item[ usItem ].usItemClass & IC_GUN ) && ExtendedGunListGun( usItem ) )
|
||||
if ( ( Item[ usItem ].usItemClass & IC_GUN ) && ItemIsOnlyInTonsOfGuns( usItem ) )
|
||||
{
|
||||
if ( bSoldierClass == SOLDIER_CLASS_NONE )
|
||||
{
|
||||
@@ -3528,7 +3526,7 @@ UINT32 ItemFitness( OBJECTTYPE* pObj, UINT8 idx )
|
||||
}
|
||||
else if ( Item[ pObj->usItem ].usItemClass & IC_FACE )
|
||||
{
|
||||
if ( Item[ pObj->usItem ].gasmask )
|
||||
if (ItemIsGasmask(pObj->usItem))
|
||||
value = (*pObj)[idx]->data.objectStatus;
|
||||
else if ( Item[ pObj->usItem ].hearingrangebonus )
|
||||
{
|
||||
@@ -3901,7 +3899,7 @@ void MoveOneMilitiaEquipmentSet(INT16 sSourceX, INT16 sSourceY, INT16 sTargetX,
|
||||
pWorldItem_tmp[uiCount].usFlags = WORLD_ITEM_REACHABLE;
|
||||
pWorldItem_tmp[uiCount].bVisible = 1;
|
||||
pWorldItem_tmp[uiCount].bRenderZHeightAboveLevel = 0;
|
||||
pWorldItem_tmp[uiCount].soldierID = -1;
|
||||
pWorldItem_tmp[uiCount].soldierID = NOBODY;
|
||||
pWorldItem_tmp[uiCount].object = tmp.Inv[ i ];
|
||||
}
|
||||
}
|
||||
@@ -3924,23 +3922,23 @@ void MoveOneMilitiaEquipmentSet(INT16 sSourceX, INT16 sSourceY, INT16 sTargetX,
|
||||
}
|
||||
}
|
||||
|
||||
void MoveMilitiaEquipment(INT16 sSourceX, INT16 sSourceY, INT16 sTargetX, INT16 sTargetY, UINT8 usElites, UINT8 usRegulars, UINT8 usGreens)
|
||||
void MoveMilitiaEquipment(INT16 sSourceX, INT16 sSourceY, INT16 sTargetX, INT16 sTargetY, UINT16 usElites, UINT16 usRegulars, UINT16 usGreens)
|
||||
{
|
||||
if ( !gGameExternalOptions.fMilitiaUseSectorInventory )
|
||||
return;
|
||||
|
||||
// atm there is no class-specific selection, but that might change in the future
|
||||
for (UINT8 i = 0; i < usElites; ++i)
|
||||
for (UINT16 i = 0; i < usElites; ++i)
|
||||
{
|
||||
MoveOneMilitiaEquipmentSet( sSourceX, sSourceY, sTargetX, sTargetY, SOLDIER_CLASS_ELITE_MILITIA);
|
||||
}
|
||||
|
||||
for (UINT8 i = 0; i < usRegulars; ++i)
|
||||
for (UINT16 i = 0; i < usRegulars; ++i)
|
||||
{
|
||||
MoveOneMilitiaEquipmentSet( sSourceX, sSourceY, sTargetX, sTargetY, SOLDIER_CLASS_REG_MILITIA);
|
||||
}
|
||||
|
||||
for (UINT8 i = 0; i < usGreens; ++i)
|
||||
for (UINT16 i = 0; i < usGreens; ++i)
|
||||
{
|
||||
MoveOneMilitiaEquipmentSet( sSourceX, sSourceY, sTargetX, sTargetY, SOLDIER_CLASS_GREEN_MILITIA);
|
||||
}
|
||||
@@ -4186,7 +4184,7 @@ void TakeMilitiaEquipmentfromSector( INT16 sMapX, INT16 sMapY, INT8 sMapZ, SOLDI
|
||||
else if ( Item[pWorldItem[ uiCount ].object.usItem].usItemClass & IC_FACE && (!si[SI_SIGHT].done || !si[SI_FACE2].done || !si[SI_FACE_SPARESIGHT].done || !si[SI_GASMASK].done) )
|
||||
{
|
||||
// gasmasks are reserved for a special slot and will only be worn if we do not have 2 face items. items that increase our vision (NVGs adn sungooggles) get to slot 1, everything else in 2
|
||||
if ( Item[ pWorldItem[ uiCount ].object.usItem ].gasmask )
|
||||
if (ItemIsGasmask(pWorldItem[ uiCount ].object.usItem))
|
||||
EvaluateObjForItem( pWorldItem, pObj, uiCount, &si[SI_GASMASK] );
|
||||
else if ( Item[ pWorldItem[ uiCount ].object.usItem ].nightvisionrangebonus > 0 )
|
||||
{
|
||||
@@ -4265,7 +4263,7 @@ void TakeMilitiaEquipmentfromSector( INT16 sMapX, INT16 sMapY, INT8 sMapZ, SOLDI
|
||||
if ( fnd == launcherhelpmap.end() )
|
||||
{
|
||||
LauncherHelpStruct tmp;
|
||||
tmp.fNeedsAmmo = !Item[pWorldItem[ uiCount ].object.usItem].singleshotrocketlauncher;
|
||||
tmp.fNeedsAmmo = !ItemIsSingleShotRocketLauncher(pWorldItem[ uiCount ].object.usItem);
|
||||
launcherhelpmap[ pWorldItem[ uiCount ].object.usItem ] = tmp;
|
||||
}
|
||||
}
|
||||
@@ -4647,7 +4645,7 @@ void TakeMilitiaEquipmentfromSector( INT16 sMapX, INT16 sMapY, INT8 sMapZ, SOLDI
|
||||
pWorldItem[uiCount].usFlags = WORLD_ITEM_REACHABLE;
|
||||
pWorldItem[uiCount].bVisible = 1;
|
||||
pWorldItem[uiCount].bRenderZHeightAboveLevel = 0;
|
||||
pWorldItem[uiCount].soldierID = -1;
|
||||
pWorldItem[uiCount].soldierID = NOBODY;
|
||||
pWorldItem[uiCount].object = newAmmoObj;
|
||||
|
||||
fNewMagCreated = FALSE;
|
||||
@@ -4686,7 +4684,7 @@ void TakeMilitiaEquipmentfromSector( INT16 sMapX, INT16 sMapY, INT8 sMapZ, SOLDI
|
||||
pWorldItem_tmp[uiCount].usFlags = WORLD_ITEM_REACHABLE;
|
||||
pWorldItem_tmp[uiCount].bVisible = 1;
|
||||
pWorldItem_tmp[uiCount].bRenderZHeightAboveLevel = 0;
|
||||
pWorldItem_tmp[uiCount].soldierID = -1;
|
||||
pWorldItem_tmp[uiCount].soldierID = NOBODY;
|
||||
pWorldItem_tmp[uiCount].object = newAmmoObj;
|
||||
|
||||
fNewMagCreated = FALSE;
|
||||
|
||||
@@ -121,9 +121,9 @@ extern ARMY_GUN_CHOICE_TYPE gArmyItemChoices[SOLDIER_GUN_CHOICE_SELECTIONS][MAX_
|
||||
void MoveOneMilitiaEquipmentSet(INT16 sSourceX, INT16 sSourceY, INT16 sTargetX, INT16 sTargetY, INT8 bSoldierClass);
|
||||
|
||||
// move a number of militia equipment sets between sectors
|
||||
void MoveMilitiaEquipment(INT16 sSourceX, INT16 sSourceY, INT16 sTargetX, INT16 sTargetY, UINT8 usElites, UINT8 usRegulars, UINT8 usGreens);
|
||||
void MoveMilitiaEquipment(INT16 sSourceX, INT16 sSourceY, INT16 sTargetX, INT16 sTargetY, UINT16 usElites, UINT16 usRegulars, UINT16 usGreens);
|
||||
|
||||
// take militia items from sector
|
||||
void TakeMilitiaEquipmentfromSector( INT16 sMapX, INT16 sMapY, INT8 sMapZ, SOLDIERCREATE_STRUCT *pp, INT8 bSoldierClass );
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+46
-20
@@ -1,13 +1,10 @@
|
||||
|
||||
#include "Item Types.h"
|
||||
#include "Debug.h"
|
||||
#include "DEBUG.H"
|
||||
#include "Items.h"
|
||||
#include "GameSettings.h"
|
||||
#include "screenids.h"
|
||||
#include "Action Items.h" // added by Flugente for the ACTION_ITEM_BLOW_UP value
|
||||
#include "Random.h" // added by Flugente
|
||||
#include "Message.h" // added by BOB for missing LBE info messages
|
||||
#include "overhead.h" // added by BOB for missing LBE info messages
|
||||
#include "message.h" // added by BOB for missing LBE info messages
|
||||
#include "Map Screen Interface.h" // added by BOB for missing LBE info messages
|
||||
|
||||
|
||||
@@ -27,7 +24,7 @@ extern UINT32 guiCurrentItemDescriptionScreen;
|
||||
extern BOOLEAN fShowMapInventoryPool;
|
||||
//extern BOOLEAN AutoPlaceObjectInInventoryStash( OBJECTTYPE *pItemPtr, INT32 sGridNo );
|
||||
|
||||
bool checkObjectLBEIntegrity(OBJECTTYPE * object) {
|
||||
static bool checkObjectLBEIntegrity(OBJECTTYPE * object) {
|
||||
bool integrityCheck = TRUE;
|
||||
|
||||
|
||||
@@ -48,27 +45,27 @@ bool checkLBEArrayIntegrity(bool verbose) {
|
||||
ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"LBENODE integrity check start: checking soldier items...");
|
||||
|
||||
for (int i = 0; i < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; i++) {
|
||||
if (!gCharactersList[i].fValid || gCharactersList[i].usSolID < 0) continue;
|
||||
if (!gCharactersList[i].fValid || gCharactersList[i].usSolID >= NOBODY) continue;
|
||||
|
||||
int id = gCharactersList[i].usSolID;
|
||||
SOLDIERTYPE soldier = Menptr[id];
|
||||
SoldierID id = gCharactersList[i].usSolID;
|
||||
SOLDIERTYPE *soldier = id;
|
||||
|
||||
if (verbose)ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"LBENODE integrity check start: checking soldier items (%s)...", soldier.name);
|
||||
if (verbose)ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"LBENODE integrity check start: checking soldier items (%s)...", soldier->name);
|
||||
|
||||
for (int j = 0; j < soldier.inv.size(); j++) {
|
||||
OBJECTTYPE * object = &(soldier.inv[j]);
|
||||
for (int j = 0; j < soldier->inv.size(); j++) {
|
||||
OBJECTTYPE * object = &(soldier->inv[j]);
|
||||
if (object->HasAnyActiveLBEs()) {
|
||||
|
||||
if (!checkObjectLBEIntegrity(object)) {
|
||||
ScreenMsg(FONT_MCOLOR_LTRED, MSG_INTERFACE, L"> LBENODE missing: %s -> %s!", soldier.name, Item[object->usItem].szItemName);
|
||||
ScreenMsg(FONT_MCOLOR_LTRED, MSG_INTERFACE, L"> LBENODE missing: %s -> %s!", soldier->name, Item[object->usItem].szItemName);
|
||||
integrityCheck = false;
|
||||
}
|
||||
else {
|
||||
if (verbose)ScreenMsg(FONT_MCOLOR_LTGREEN, MSG_INTERFACE, L"> OK: %s -> %s", soldier.name, Item[object->usItem].szItemName);
|
||||
if (verbose)ScreenMsg(FONT_MCOLOR_LTGREEN, MSG_INTERFACE, L"> OK: %s -> %s", soldier->name, Item[object->usItem].szItemName);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (verbose)ScreenMsg(FONT_MCOLOR_LTGRAY, MSG_INTERFACE, L"> SKIP: %s -> %s", soldier.name, Item[object->usItem].szItemName);
|
||||
if (verbose)ScreenMsg(FONT_MCOLOR_LTGRAY, MSG_INTERFACE, L"> SKIP: %s -> %s", soldier->name, Item[object->usItem].szItemName);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -125,7 +122,7 @@ bool IsSlotASmallPocket(int slot)
|
||||
return false;
|
||||
}
|
||||
|
||||
void CreateLBE (OBJECTTYPE* pObj, UINT8 ubID, int numSubPockets)
|
||||
void CreateLBE (OBJECTTYPE* pObj, SoldierID ubID, int numSubPockets)
|
||||
{
|
||||
int uniqueID;
|
||||
LBENODE* pLBE = NULL;
|
||||
@@ -592,7 +589,7 @@ LBENODE* OBJECTTYPE::GetLBEPointer(unsigned int index)
|
||||
|
||||
}
|
||||
|
||||
bool OBJECTTYPE::exists()
|
||||
bool OBJECTTYPE::exists() const
|
||||
{
|
||||
return(this && ubNumberOfObjects && usItem);
|
||||
}
|
||||
@@ -1179,6 +1176,34 @@ ObjectData& ObjectData::operator =(const ObjectData& src)
|
||||
return *this;
|
||||
}
|
||||
|
||||
ObjectData& ObjectData::operator =(const ObjectData_PRE_ITS& src)
|
||||
{
|
||||
if ((void*)this != (void*)&src)
|
||||
{
|
||||
//copy over the data
|
||||
this->bTrap = src.bTrap;
|
||||
this->fUsed = src.fUsed;
|
||||
this->ubImprintID = src.ubImprintID;
|
||||
|
||||
this->bTemperature = src.bTemperature;
|
||||
this->ubDirection = src.ubDirection;
|
||||
this->ubWireNetworkFlag = src.ubWireNetworkFlag;
|
||||
this->bDefuseFrequency = src.bDefuseFrequency;
|
||||
this->sRepairThreshold = src.sRepairThreshold;
|
||||
this->sObjectFlag = src.sObjectFlag;
|
||||
|
||||
//copy over the union
|
||||
this->misc.bBombStatus = src.misc.bBombStatus;
|
||||
this->misc.bDetonatorType = src.misc.bDetonatorType;
|
||||
this->misc.usBombItem = src.misc.usBombItem;
|
||||
this->misc.bDelay = src.misc.bDelay;
|
||||
this->misc.ubBombOwner = static_cast<UINT16>(src.misc.ubBombOwner);
|
||||
this->misc.bActionValue = src.misc.bActionValue;
|
||||
this->misc.ubTolerance = src.misc.ubTolerance;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
ObjectData::~ObjectData()
|
||||
{
|
||||
DeleteLBE();
|
||||
@@ -1561,12 +1586,13 @@ OBJECTTYPE& OBJECTTYPE::operator=(const OLD_OBJECTTYPE_101& src)
|
||||
case IC_KEY:
|
||||
(*this)[0]->data.key.ubKeyID = src.ugYucky.ubKeyID;
|
||||
break;
|
||||
case IC_MISC:
|
||||
case IC_GRENADE:
|
||||
case IC_BOMB:
|
||||
(*this)[0]->data.misc.bDetonatorType = src.ugYucky.bDetonatorType;
|
||||
(*this)[0]->data.misc.usBombItem = src.ugYucky.usBombItem;
|
||||
(*this)[0]->data.misc.bDelay = src.ugYucky.bDelay; // includes bFrequency
|
||||
(*this)[0]->data.misc.ubBombOwner = src.ugYucky.ubBombOwner;
|
||||
(*this)[0]->data.misc.ubBombOwner = static_cast<UINT16>(src.ugYucky.ubBombOwner);
|
||||
(*this)[0]->data.misc.bActionValue = src.ugYucky.bActionValue;
|
||||
(*this)[0]->data.misc.ubTolerance = src.ugYucky.ubTolerance; // includes ubLocationID
|
||||
(*this)[0]->data.ubDirection = DIRECTION_IRRELEVANT;
|
||||
@@ -1595,7 +1621,7 @@ OBJECTTYPE& OBJECTTYPE::operator=(const OLD_OBJECTTYPE_101& src)
|
||||
}
|
||||
else if ( EXPLOSIVE_GUN( this->usItem ) )
|
||||
{
|
||||
if ( Item[this->usItem].singleshotrocketlauncher )
|
||||
if (ItemIsSingleShotRocketLauncher(this->usItem))
|
||||
{
|
||||
(*this)[0]->data.gun.ubGunShotsLeft = 1;
|
||||
}
|
||||
@@ -1658,7 +1684,7 @@ OBJECTTYPE& OBJECTTYPE::operator=(const OLD_OBJECTTYPE_101& src)
|
||||
(*this)[0]->data.misc.bDetonatorType = src.ugYucky.bDetonatorType;
|
||||
(*this)[0]->data.misc.usBombItem = src.ugYucky.usBombItem;
|
||||
(*this)[0]->data.misc.bDelay = src.ugYucky.bDelay; // includes bFrequency
|
||||
(*this)[0]->data.misc.ubBombOwner = src.ugYucky.ubBombOwner;
|
||||
(*this)[0]->data.misc.ubBombOwner = static_cast<UINT16>(src.ugYucky.ubBombOwner);
|
||||
(*this)[0]->data.misc.bActionValue = src.ugYucky.bActionValue;
|
||||
(*this)[0]->data.misc.ubTolerance = src.ugYucky.ubTolerance; // includes ubLocationID
|
||||
(*this)[0]->data.ubWireNetworkFlag = TRIPWIRE_NETWORK_OWNER_ENEMY; // it is always assumed that preplated traps are of hostile origin
|
||||
|
||||
+282
-269
@@ -1,7 +1,7 @@
|
||||
#ifndef ITEM_TYPES_H
|
||||
#define ITEM_TYPES_H
|
||||
|
||||
#include "types.h"
|
||||
#include "Overhead Types.h"
|
||||
#include <vector>
|
||||
#include <list>
|
||||
// THE_BOB : added for pocket popup definitions
|
||||
@@ -247,7 +247,7 @@ public:
|
||||
|
||||
UINT32 lbeClass;
|
||||
UINT16 lbeIndex;
|
||||
UINT8 ubID;
|
||||
SoldierID ubID;
|
||||
BOOLEAN ZipperFlag;
|
||||
int uniqueID;
|
||||
UINT32 uiNodeChecksum;
|
||||
@@ -259,7 +259,7 @@ public:
|
||||
#define SIZEOF_LBENODE_POD (offsetof(LBENODE, endOfPOD))
|
||||
bool checkLBEArrayIntegrity(bool verbose=false); // BOB: checks all worldItems for missing LBE info
|
||||
|
||||
void CreateLBE(OBJECTTYPE* pObj, UINT8 ubID, int numSubPockets);
|
||||
void CreateLBE(OBJECTTYPE* pObj, SoldierID ubID, int numSubPockets);
|
||||
bool DestroyLBEIfEmpty(OBJECTTYPE* pObj, int stackIndex = 0);
|
||||
void DestroyLBE(OBJECTTYPE* pObj, int stackIndex = 0);
|
||||
void GetLBESlots(UINT32 LBEType, std::vector<INT8>& LBESlots);
|
||||
@@ -390,6 +390,7 @@ public:
|
||||
UINT8 fUsed; // flags for whether the item is used or not
|
||||
};
|
||||
|
||||
|
||||
namespace ObjectDataStructs {
|
||||
struct OBJECT_GUN
|
||||
{
|
||||
@@ -408,15 +409,15 @@ namespace ObjectDataStructs {
|
||||
struct OBJECT_BOMBS_AND_OTHER
|
||||
{ // this is used by placed bombs, switches, and the action item
|
||||
INT16 bBombStatus; // % status
|
||||
INT8 bDetonatorType; // timed, remote, or pressure-activated
|
||||
INT8 bDetonatorType; // timed, remote, or pressure-activated
|
||||
UINT16 usBombItem; // the usItem of the bomb.
|
||||
union
|
||||
{
|
||||
INT8 bDelay; // >=0 values used only
|
||||
INT8 bFrequency; // >=0 values used only
|
||||
};
|
||||
UINT8 ubBombOwner; // side which placed the bomb
|
||||
UINT8 bActionValue; // this is used by the ACTION_ITEM fake item
|
||||
SoldierID ubBombOwner; // side which placed the bomb
|
||||
UINT8 bActionValue; // this is used by the ACTION_ITEM fake item
|
||||
union
|
||||
{
|
||||
UINT8 ubTolerance; // tolerance value for panic triggers
|
||||
@@ -439,8 +440,57 @@ namespace ObjectDataStructs {
|
||||
INT8 bLBE; // Marks item as LBENODE
|
||||
int uniqueID; // how the LBENODE is accessed
|
||||
};
|
||||
|
||||
// Used to maintain compatibility with major map versions older than 8.0
|
||||
struct OBJECT_BOMBS_AND_OTHER_PRE_ITS
|
||||
{
|
||||
INT16 bBombStatus;
|
||||
INT8 bDetonatorType;
|
||||
UINT16 usBombItem;
|
||||
union
|
||||
{
|
||||
INT8 bDelay;
|
||||
INT8 bFrequency;
|
||||
};
|
||||
UINT8 ubBombOwner; //<-- Data size changed
|
||||
UINT8 bActionValue;
|
||||
union
|
||||
{
|
||||
UINT8 ubTolerance;
|
||||
UINT8 ubLocationID;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
struct ObjectData_PRE_ITS
|
||||
{
|
||||
union {
|
||||
INT16 objectStatus;//holds the same value as bStatus[0]
|
||||
UINT16 ubShotsLeft;//holds the same value as ubShotsLeft[0]
|
||||
ObjectDataStructs::OBJECT_GUN gun;
|
||||
ObjectDataStructs::OBJECT_MONEY money;
|
||||
ObjectDataStructs::OBJECT_BOMBS_AND_OTHER_PRE_ITS misc;
|
||||
ObjectDataStructs::OBJECT_KEY key;
|
||||
ObjectDataStructs::OBJECT_OWNER owner;
|
||||
ObjectDataStructs::OBJECT_LBE lbe;
|
||||
};
|
||||
INT8 bTrap; // 1-10 exp_lvl to detect
|
||||
UINT8 fUsed; // flags for whether the item is used or not
|
||||
UINT8 ubImprintID; // ID of merc that item is imprinted on
|
||||
char endOfPOD; // For WF maps
|
||||
FLOAT bTemperature; // Flugente FTW 1.2: temperature of gun
|
||||
UINT8 ubDirection; // direction the bomb faces (for directional explosives)
|
||||
UINT32 ubWireNetworkFlag; // flags for the tripwire network
|
||||
INT8 bDefuseFrequency; // frequency for defusing, >=0 values used only
|
||||
INT16 sRepairThreshold; // repair only possible up to this value
|
||||
FLOAT bFiller; // unused for now
|
||||
UINT64 sObjectFlag; // used to notify of various states that apply to this object, but not the item in general
|
||||
};
|
||||
// Flugente: needed for reading WF maps
|
||||
#define SIZEOF_OBJECTDATA_POD_PRE_ITS (offsetof(ObjectData_PRE_ITS, endOfPOD))
|
||||
|
||||
|
||||
class ObjectData
|
||||
{
|
||||
public:
|
||||
@@ -451,6 +501,8 @@ public:
|
||||
ObjectData(const ObjectData&);
|
||||
// Assignment operator
|
||||
ObjectData& operator=(const ObjectData&);
|
||||
// Conversion operator
|
||||
ObjectData& operator=(const ObjectData_PRE_ITS&);
|
||||
|
||||
|
||||
void initialize() {memset(this, 0, sizeof(ObjectData));};
|
||||
@@ -474,7 +526,7 @@ public:
|
||||
UINT8 fUsed; // flags for whether the item is used or not
|
||||
UINT8 ubImprintID; // ID of merc that item is imprinted on
|
||||
|
||||
// Flugente: due do inconsistencies with WF maps, where data from a map is laoded differently, I had to add this marker.
|
||||
// Flugente: due do inconsistencies with WF maps, where data from a map is loaded differently, I had to add this marker.
|
||||
// New values, like bTemperature, have to come after this. And please, don't destroy ObjectData's POD-ness.
|
||||
char endOfPOD;
|
||||
|
||||
@@ -546,7 +598,7 @@ public:
|
||||
|
||||
bool operator==(OBJECTTYPE& compare);
|
||||
bool operator==(const OBJECTTYPE& compare)const;
|
||||
bool exists();
|
||||
bool exists() const;
|
||||
bool IsActiveLBE(unsigned int index);
|
||||
bool HasAnyActiveLBEs(SOLDIERTYPE * pSoldier = NULL, UINT8 iter = 0);
|
||||
LBENODE* GetLBEPointer(unsigned int index);
|
||||
@@ -738,18 +790,18 @@ extern OBJECTTYPE gTempObject;
|
||||
// note that these should not be used to determine what kind of an attachment an item is, that is determined by attachmentclass and the AC_xxx flags above
|
||||
#define BLOOD_BAG 0x00000001 //1 // this item is a blood bag can can be used to boost surgery
|
||||
#define MANPAD 0x00000002 //2 // this item is a MAn-Portable Air-Defense System
|
||||
#define BEARTRAP 0x00000004 //4 // a mechanical trap that does no explosion, but causes leg damage to whoever activates it
|
||||
#define BEARTRAP 0x00000004 //4 // a mechanical trap that does no explosion, but causes leg damage to whoever activates it
|
||||
#define CAMERA 0x00000008 //8
|
||||
|
||||
#define WATER_DRUM 0x00000010 //16 // water drums allow to refill canteens in the sector they are in
|
||||
#define MEAT_BLOODCAT 0x00000020 //32 // retrieve this by gutting a bloodcat
|
||||
#define MEAT_COW 0x00000040 //64 // retrieve this by gutting a cow
|
||||
#define BELT_FED 0x00000080 //128 // item can be fed externally
|
||||
#define BELT_FED 0x00000080 //128 // item can be fed externally
|
||||
|
||||
#define AMMO_BELT 0x00000100 //256 // this item can be used to feed externally
|
||||
#define AMMO_BELT_VEST 0x00000200 //512 // this is a vest that can contain AMMO_BELT items in its medium slots
|
||||
#define CAMO_REMOVAL 0x00000400 //1024 // item can be used to remove camo
|
||||
#define CLEANING_KIT 0x00000800 //2048 // weapon cleaning kit
|
||||
#define CAMO_REMOVAL 0x00000400 //1024 // item can be used to remove camo
|
||||
#define CLEANING_KIT 0x00000800 //2048 // weapon cleaning kit
|
||||
|
||||
#define ATTENTION_ITEM 0x00001000 //4096 // this item is 'interesting' to the AI. Dumb soldiers may try to pick it up
|
||||
#define GAROTTE 0x00002000 //8192 // this item is a garotte
|
||||
@@ -758,18 +810,18 @@ extern OBJECTTYPE gTempObject;
|
||||
|
||||
#define SKIN_BLOODCAT 0x00010000 //65536 // retrieve this by skinning (=decapitating) a bloodcat
|
||||
#define NO_METAL_DETECTION 0x00020000 //131072 // a planted bomb with this flag can NOT be detected via metal detector. Use sparingly!
|
||||
#define JUMP_GRENADE 0x00040000 //262144 // add +25 heigth to explosion, used for bouncing grenades and jumping mines
|
||||
#define JUMP_GRENADE 0x00040000 //262144 // add +25 heigth to explosion, used for bouncing grenades and jumping mines
|
||||
#define HANDCUFFS 0x00080000 //524288 // item can be used to capture soldiers
|
||||
|
||||
#define TASER 0x00100000 //1048576 // item is a taser, melee hits with this will drain breath (if batteries are supplied)
|
||||
#define SCUBA_BOTTLE 0x00200000 //2097152 // item is a scuba gear air bottle
|
||||
#define SCUBA_BOTTLE 0x00200000 //2097152 // item is a scuba gear air bottle
|
||||
#define SCUBA_MASK 0x00400000 //4194304 // item is a scuba gear breathing mask
|
||||
#define SCUBA_FINS 0x00800000 //8388608 // this item speed up swimming, but slows walking and running
|
||||
|
||||
#define TRIPWIREROLL 0x01000000 //16777216 // this item is a tripwire roll
|
||||
#define TRIPWIREROLL 0x01000000 //16777216 // this item is a tripwire roll
|
||||
#define RADIO_SET 0x02000000 //33554432 // item can be used to radio militia/squads in other sectors
|
||||
#define SIGNAL_SHELL 0x04000000 //67108864 // this is a signal shell that precedes artillery barrages
|
||||
#define SODA 0x08000000 //134217728 // item is a can of soda, sold in vending machines
|
||||
#define SIGNAL_SHELL 0x04000000 //67108864 // this is a signal shell that precedes artillery barrages
|
||||
#define SODA 0x08000000 //134217728 // item is a can of soda, sold in vending machines
|
||||
|
||||
#define ROOF_COLLAPSE_ITEM 0x10000000 //268435456 // this item is required in the collapsing of roof tiles. It is used internally and should never be seen by the player
|
||||
#define DISEASEPROTECTION_1 0x20000000 //536870912 // this item protects us from getting diseases by human contact if kept in inventory
|
||||
@@ -779,6 +831,98 @@ extern OBJECTTYPE gTempObject;
|
||||
// extended flagmask to UINT64
|
||||
#define EMPTY_BLOOD_BAG 0x0000000100000000 // this item is a empty blood bag
|
||||
#define MEDICAL_SPLINT 0x0000000200000000 // this item is a medical splint that can be applied to some diseases
|
||||
#define ITEM_damageable 0x0000000400000000
|
||||
#define ITEM_repairable 0x0000000800000000
|
||||
|
||||
#define ITEM_waterdamages 0x0000001000000000
|
||||
#define ITEM_metal 0x0000002000000000
|
||||
#define ITEM_sinks 0x0000004000000000
|
||||
#define ITEM_showstatus 0x0000008000000000
|
||||
|
||||
#define ITEM_hiddenaddon 0x0000010000000000
|
||||
#define ITEM_twohanded 0x0000020000000000
|
||||
#define ITEM_notbuyable 0x0000040000000000
|
||||
#define ITEM_attachment 0x0000080000000000
|
||||
|
||||
#define ITEM_hiddenattachment 0x0000100000000000
|
||||
#define ITEM_biggunlist 0x0000200000000000
|
||||
#define ITEM_notineditor 0x0000400000000000
|
||||
#define ITEM_defaultundroppable 0x0000800000000000
|
||||
|
||||
#define ITEM_unaerodynamic 0x0001000000000000
|
||||
#define ITEM_electronic 0x0002000000000000
|
||||
#define ITEM_cannon 0x0004000000000000
|
||||
#define ITEM_rocketrifle 0x0008000000000000
|
||||
|
||||
#define ITEM_fingerprintid 0x0010000000000000
|
||||
#define ITEM_metaldetector 0x0020000000000000
|
||||
#define ITEM_gasmask 0x0040000000000000
|
||||
#define ITEM_lockbomb 0x0080000000000000
|
||||
|
||||
#define ITEM_flare 0x0100000000000000
|
||||
#define ITEM_grenadelauncher 0x0200000000000000
|
||||
#define ITEM_mortar 0x0400000000000000
|
||||
#define ITEM_duckbill 0x0800000000000000
|
||||
|
||||
//UNUSED #define ITEM_detonator 0x1000000000000000
|
||||
//UNUSED #define ITEM_remotedetonator 0x2000000000000000
|
||||
#define ITEM_hidemuzzleflash 0x4000000000000000
|
||||
#define ITEM_rocketlauncher 0x8000000000000000
|
||||
|
||||
// New UINT64 Item Flag => usItemFlag2
|
||||
#define ITEM_singleshotrocketlauncher 0x00000001
|
||||
#define ITEM_brassknuckles 0x00000002
|
||||
#define ITEM_crowbar 0x00000004
|
||||
#define ITEM_glgrenade 0x00000008
|
||||
|
||||
#define ITEM_flakjacket 0x00000010
|
||||
#define ITEM_leatherjacket 0x00000020
|
||||
#define ITEM_batteries 0x00000040
|
||||
#define ITEM_needsbatteries 0x00000080
|
||||
|
||||
#define ITEM_xray 0x00000100
|
||||
#define ITEM_wirecutters 0x00000200
|
||||
#define ITEM_toolkit 0x00000400
|
||||
#define ITEM_firstaidkit 0x00000800
|
||||
|
||||
#define ITEM_medicalkit 0x00001000
|
||||
#define ITEM_canteen 0x00002000
|
||||
#define ITEM_jar 0x00004000
|
||||
#define ITEM_canandstring 0x00008000
|
||||
|
||||
#define ITEM_marbles 0x00010000
|
||||
#define ITEM_walkman 0x00020000
|
||||
#define ITEM_remotetrigger 0x00040000
|
||||
#define ITEM_robotremotecontrol 0x00080000
|
||||
|
||||
#define ITEM_camouflagekit 0x00100000
|
||||
#define ITEM_locksmithkit 0x00200000
|
||||
#define ITEM_mine 0x00400000
|
||||
#define ITEM_antitankmine 0x00800000
|
||||
|
||||
#define ITEM_hardware 0x01000000
|
||||
#define ITEM_medical 0x02000000
|
||||
#define ITEM_gascan 0x04000000
|
||||
#define ITEM_containsliquid 0x08000000
|
||||
|
||||
#define ITEM_rock 0x10000000
|
||||
#define ITEM_thermaloptics 0x20000000
|
||||
#define ITEM_scifi 0x40000000
|
||||
#define ITEM_newinv 0x80000000
|
||||
|
||||
#define ITEM_DiseaseSystemExclusive 0x0000000100000000 // kitty: item exclusively available with disease feature
|
||||
#define ITEM_barrel 0x0000000200000000 // item can be used on some guns as an exchange barrel
|
||||
#define ITEM_tripwireactivation 0x0000000400000000 // item (mine) can be activated by nearby tripwire
|
||||
#define ITEM_tripwire 0x0000000800000000 // item is tripwire
|
||||
|
||||
#define ITEM_directional 0x0000001000000000 // item is a directional mine/bomb (actual direction is set upon planting)
|
||||
#define ITEM_blockironsight 0x0000002000000000 // if a gun or any attachment have this property, the iron sight won't be usable (if there is at least one other usable sight)
|
||||
#define ITEM_fAllowClimbing 0x0000004000000000 // JMich: BackpackClimb does item allow climbing while wearing it
|
||||
#define ITEM_cigarette 0x0000008000000000 // Flugente: this item can be smoked
|
||||
|
||||
#define ITEM_fProvidesRobotCamo 0x0000010000000000 // rftr: robot attachments
|
||||
#define ITEM_fProvidesRobotNightVision 0x0000020000000000 // rftr: robot attachments
|
||||
#define ITEM_fProvidesRobotLaserBonus 0x0000040000000000 // rftr: robot attachments
|
||||
|
||||
// ----------------------------------------------------------------
|
||||
|
||||
@@ -947,163 +1091,48 @@ extern OBJECTTYPE gTempObject;
|
||||
// autofiretohitbonus,
|
||||
// bursttohitbonus
|
||||
|
||||
// bitflags for usLimitedToSystem
|
||||
#define FOOD_SYSTEM_FLAG 1
|
||||
#define DISEASE_SYSTEM_FLAG 2
|
||||
|
||||
typedef struct
|
||||
{
|
||||
UINT32 usItemClass;
|
||||
UINT64 nasAttachmentClass; //CHRISL: Identify the class of attachment
|
||||
UINT64 nasLayoutClass;
|
||||
//Madd: Common Attachment Framework: attach items based on matching connection points rather than using the old long attachmentinfo method
|
||||
UINT64 ulAvailableAttachmentPoint;
|
||||
UINT64 ulAttachmentPoint;
|
||||
UINT8 ubAttachToPointAPCost; // cost to attach to any matching point
|
||||
UINT16 ubClassIndex;
|
||||
UINT8 ubCursor;
|
||||
INT8 bSoundType;
|
||||
UINT8 ubGraphicType;
|
||||
UINT16 ubGraphicNum;
|
||||
UINT16 ubWeight; //2 units per kilogram; roughly 1 unit per pound
|
||||
UINT8 ubPerPocket;
|
||||
UINT16 ItemSize;
|
||||
UINT16 usPrice;
|
||||
UINT8 ubCoolness;
|
||||
INT8 bReliability;
|
||||
INT8 bRepairEase;
|
||||
UINT16 fFlags;
|
||||
|
||||
UINT32 uiIndex; // added
|
||||
CHAR16 szItemName[80]; //+1 for the null terminator //added
|
||||
|
||||
BOOLEAN damageable;
|
||||
BOOLEAN repairable;
|
||||
BOOLEAN waterdamages;
|
||||
BOOLEAN metal;
|
||||
BOOLEAN sinks;
|
||||
BOOLEAN showstatus;
|
||||
BOOLEAN hiddenaddon;
|
||||
BOOLEAN twohanded;
|
||||
BOOLEAN notbuyable;
|
||||
BOOLEAN attachment;
|
||||
BOOLEAN hiddenattachment;
|
||||
BOOLEAN biggunlist;
|
||||
BOOLEAN notineditor;
|
||||
BOOLEAN defaultundroppable;
|
||||
BOOLEAN unaerodynamic;
|
||||
BOOLEAN electronic;
|
||||
UINT8 inseparable; //Madd:Normally, an inseparable attachment can never be removed.
|
||||
//But now we will make it so that these items can be replaced, but still not removed directly.
|
||||
//0 = removeable (as before)
|
||||
//1 = inseparable (as before)
|
||||
//2 = inseparable, but replaceable
|
||||
|
||||
CHAR16 szLongItemName[80];
|
||||
CHAR16 szItemDesc[400];
|
||||
CHAR16 szBRName[80];
|
||||
CHAR16 szBRDesc[400];
|
||||
|
||||
//TODO: quest items, boosters, money
|
||||
|
||||
// special item/attachment functions:
|
||||
BOOLEAN cannon;
|
||||
BOOLEAN rocketrifle;
|
||||
BOOLEAN fingerprintid;
|
||||
BOOLEAN metaldetector;
|
||||
BOOLEAN gasmask;
|
||||
BOOLEAN lockbomb;
|
||||
BOOLEAN flare;
|
||||
INT16 percentnoisereduction;
|
||||
INT16 bipod;
|
||||
INT16 tohitbonus;
|
||||
INT16 bestlaserrange;
|
||||
INT16 rangebonus;
|
||||
INT16 percentrangebonus;
|
||||
INT16 aimbonus;
|
||||
INT16 minrangeforaimbonus;
|
||||
INT16 percentapreduction;
|
||||
INT16 percentstatusdrainreduction;
|
||||
BOOLEAN grenadelauncher;
|
||||
BOOLEAN mortar;
|
||||
BOOLEAN duckbill;
|
||||
BOOLEAN detonator;
|
||||
BOOLEAN remotedetonator;
|
||||
BOOLEAN hidemuzzleflash;
|
||||
BOOLEAN rocketlauncher;
|
||||
BOOLEAN singleshotrocketlauncher;
|
||||
UINT16 discardedlauncheritem;
|
||||
BOOLEAN brassknuckles;
|
||||
//*** ddd UINT16 bloodieditem;
|
||||
INT16 bloodieditem;
|
||||
BOOLEAN crowbar;
|
||||
BOOLEAN glgrenade;
|
||||
BOOLEAN flakjacket;
|
||||
INT16 hearingrangebonus;
|
||||
INT16 visionrangebonus;
|
||||
INT16 nightvisionrangebonus;
|
||||
INT16 dayvisionrangebonus;
|
||||
INT16 cavevisionrangebonus;
|
||||
INT16 brightlightvisionrangebonus;
|
||||
INT16 itemsizebonus;
|
||||
BOOLEAN leatherjacket;
|
||||
BOOLEAN batteries;
|
||||
BOOLEAN needsbatteries;
|
||||
BOOLEAN xray;
|
||||
BOOLEAN wirecutters;
|
||||
BOOLEAN toolkit;
|
||||
BOOLEAN firstaidkit;
|
||||
BOOLEAN medicalkit;
|
||||
BOOLEAN canteen;
|
||||
BOOLEAN jar;
|
||||
BOOLEAN canandstring;
|
||||
BOOLEAN marbles;
|
||||
BOOLEAN walkman;
|
||||
BOOLEAN remotetrigger;
|
||||
BOOLEAN robotremotecontrol;
|
||||
BOOLEAN camouflagekit;
|
||||
BOOLEAN locksmithkit;
|
||||
BOOLEAN mine;
|
||||
BOOLEAN antitankmine;
|
||||
FLOAT alcohol;
|
||||
BOOLEAN hardware;
|
||||
BOOLEAN medical;
|
||||
BOOLEAN gascan;
|
||||
BOOLEAN containsliquid;
|
||||
BOOLEAN rock;
|
||||
|
||||
INT16 damagebonus;
|
||||
INT16 meleedamagebonus;
|
||||
|
||||
INT16 magsizebonus;
|
||||
INT16 percentautofireapreduction;
|
||||
INT16 autofiretohitbonus;
|
||||
INT16 APBonus;
|
||||
INT16 rateoffirebonus;
|
||||
INT16 burstsizebonus;
|
||||
INT16 bursttohitbonus;
|
||||
INT16 percentreadytimeapreduction;
|
||||
INT16 bulletspeedbonus;
|
||||
BOOLEAN thermaloptics;
|
||||
UINT8 percenttunnelvision;
|
||||
INT16 percentreloadtimeapreduction;
|
||||
INT16 percentburstfireapreduction;
|
||||
|
||||
INT16 camobonus;
|
||||
INT16 stealthbonus;
|
||||
INT16 urbanCamobonus;
|
||||
INT16 desertCamobonus;
|
||||
INT16 snowCamobonus;
|
||||
|
||||
BOOLEAN scifi; // item only available in scifi mode
|
||||
BOOLEAN newinv; // item only available in new inventory mode
|
||||
UINT8 ubAttachmentSystem; //Item availability per attachment system: 0 = both, 1 = OAS, 2 = NAS
|
||||
|
||||
CHAR16 szItemName[80]; //+1 for the null terminator //added
|
||||
CHAR16 szLongItemName[80];
|
||||
CHAR16 szBRName[80];
|
||||
UINT16 defaultattachments[MAX_DEFAULT_ATTACHMENTS]; //Need more default attachments, chose an array to do so. (no vector / list just to keep this all plain data)
|
||||
|
||||
UINT64 nasAttachmentClass; //CHRISL: Identify the class of attachment
|
||||
UINT64 nasLayoutClass;
|
||||
UINT64 ulAvailableAttachmentPoint;
|
||||
UINT64 ulAttachmentPoint;
|
||||
FLAGS64 usItemFlag; // bitflags to store various item properties (better than introducing 64 BOOLEAN values). If I only had thought of this earlier....
|
||||
FLAGS64 usItemFlag2; // bitflags to store various item properties
|
||||
|
||||
UINT32 uiIndex;
|
||||
UINT32 usItemClass;
|
||||
UINT32 attachmentclass; // attachmentclass used
|
||||
UINT32 drugtype; // this flagmask determines what different components are used in a drug, which results in different effects
|
||||
UINT32 foodtype;
|
||||
UINT32 usActionItemFlag; // Flugente: a flag that is necessary for transforming action items to objects with new abilities (for now, tripwire networks and directional explosives)
|
||||
UINT32 clothestype; // Flugente: clothes type that 'links' to an entry in Clothes.xml
|
||||
|
||||
//zilpin: pellet spread patterns externalized in XML
|
||||
INT32 spreadPattern;
|
||||
|
||||
FLOAT alcohol;
|
||||
// HEADROCK HAM 4: New modifiers that do not require a stance array, since they affect the gun objectively, not
|
||||
// subjectively.
|
||||
FLOAT RecoilModifierX;
|
||||
FLOAT RecoilModifierY;
|
||||
FLOAT scopemagfactor;
|
||||
FLOAT projectionfactor;
|
||||
FLOAT usOverheatingCooldownFactor; // every turn/5 seconds, a gun's temperature is lowered by this amount
|
||||
FLOAT overheatTemperatureModificator; // percentage modifier of heat a shot generates (read from attachments)
|
||||
FLOAT overheatCooldownModificator; // percentage modifier of cooldown amount (read from attachments, applies to guns & barrels)
|
||||
FLOAT overheatJamThresholdModificator; // percentage modifier of a gun's jam threshold (read from attachments)
|
||||
FLOAT overheatDamageThresholdModificator; // percentage modifier of a gun's damage threshold (read from attachments)
|
||||
FLOAT dirtIncreaseFactor; // Flugente: advanced repair/dirt system. One shot causes this much dirt on a gun
|
||||
FLOAT fRobotDamageReductionModifier; // rftr: robot attachments
|
||||
|
||||
// HEADROCK HAM 4: New variable arrays for the New CTH system.
|
||||
INT16 flatbasemodifier[3];
|
||||
INT16 percentbasemodifier[3];
|
||||
@@ -1116,114 +1145,98 @@ typedef struct
|
||||
INT16 counterforceaccuracymodifier[3];
|
||||
INT16 targettrackingmodifier[3];
|
||||
INT16 aimlevelsmodifier[3];
|
||||
// HEADROCK HAM 4: New modifiers that do not require a stance array, since they affect the gun objectively, not
|
||||
// subjectively.
|
||||
FLOAT RecoilModifierX;
|
||||
FLOAT RecoilModifierY;
|
||||
|
||||
//Madd: Common Attachment Framework: attach items based on matching connection points rather than using the old long attachmentinfo method
|
||||
UINT16 ubClassIndex;
|
||||
UINT16 ubGraphicNum;
|
||||
UINT16 ubWeight; //2 units per kilogram; roughly 1 unit per pound
|
||||
UINT16 ItemSize;
|
||||
UINT16 usPrice;
|
||||
UINT16 discardedlauncheritem;
|
||||
UINT16 randomitem; // Flugente: a link to RandomItemsClass.xml. Out of such an item, a random object is created, depending on the entries in the xml
|
||||
UINT16 usBuddyItem; // Flugente: item is connected to another item. Type of connection depends on item specifics
|
||||
UINT16 usRiotShieldStrength; // Flugente: riot shields. strength of shield
|
||||
UINT16 usRiotShieldGraphic; // Flugente: riot shields. graphic of shield (when deployed in tactical, taken from Tilecache/riotshield.sti)
|
||||
|
||||
INT16 percentnoisereduction;
|
||||
INT16 bipod;
|
||||
INT16 tohitbonus;
|
||||
INT16 bestlaserrange;
|
||||
INT16 rangebonus;
|
||||
INT16 percentrangebonus;
|
||||
INT16 aimbonus;
|
||||
INT16 minrangeforaimbonus;
|
||||
INT16 percentapreduction;
|
||||
INT16 percentstatusdrainreduction;
|
||||
INT16 bloodieditem;
|
||||
INT16 hearingrangebonus;
|
||||
INT16 visionrangebonus;
|
||||
INT16 nightvisionrangebonus;
|
||||
INT16 dayvisionrangebonus;
|
||||
INT16 cavevisionrangebonus;
|
||||
INT16 brightlightvisionrangebonus;
|
||||
INT16 itemsizebonus;
|
||||
INT16 damagebonus;
|
||||
INT16 meleedamagebonus;
|
||||
INT16 magsizebonus;
|
||||
INT16 percentautofireapreduction;
|
||||
INT16 autofiretohitbonus;
|
||||
INT16 APBonus;
|
||||
INT16 rateoffirebonus;
|
||||
INT16 burstsizebonus;
|
||||
INT16 bursttohitbonus;
|
||||
INT16 percentreadytimeapreduction;
|
||||
INT16 bulletspeedbonus;
|
||||
INT16 percentreloadtimeapreduction;
|
||||
INT16 percentburstfireapreduction;
|
||||
INT16 camobonus;
|
||||
INT16 stealthbonus;
|
||||
INT16 urbanCamobonus;
|
||||
INT16 desertCamobonus;
|
||||
INT16 snowCamobonus;
|
||||
INT16 PercentRecoilModifier;
|
||||
INT16 percentaccuracymodifier;
|
||||
FLOAT scopemagfactor;
|
||||
FLOAT projectionfactor;
|
||||
BOOLEAN speeddot;
|
||||
INT16 usSpotting; // Flugente: spotting effectiveness
|
||||
INT16 sBackpackWeightModifier; // JMich: BackpackClimb modifier to weight calculation to climb.
|
||||
INT16 sFireResistance;
|
||||
|
||||
// Flugente
|
||||
BOOLEAN barrel; // item can be used on some guns as an exchange barrel
|
||||
FLOAT usOverheatingCooldownFactor; // every turn/5 seconds, a gun's temperature is lowered by this amount
|
||||
FLOAT overheatTemperatureModificator; // percentage modifier of heat a shot generates (read from attachments)
|
||||
FLOAT overheatCooldownModificator; // percentage modifier of cooldown amount (read from attachments, applies to guns & barrels)
|
||||
FLOAT overheatJamThresholdModificator; // percentage modifier of a gun's jam threshold (read from attachments)
|
||||
FLOAT overheatDamageThresholdModificator; // percentage modifier of a gun's damage threshold (read from attachments)
|
||||
UINT8 ubAttachToPointAPCost; // cost to attach to any matching point
|
||||
UINT8 ubCursor;
|
||||
UINT8 ubGraphicType;
|
||||
UINT8 ubPerPocket;
|
||||
UINT8 ubCoolness;
|
||||
UINT8 percenttunnelvision;
|
||||
UINT8 ubAttachmentSystem; //Item availability per attachment system: 0 = both, 1 = OAS, 2 = NAS
|
||||
UINT8 CrowbarModifier;
|
||||
UINT8 DisarmModifier;
|
||||
UINT8 usHackingModifier;
|
||||
UINT8 usBurialModifier; // Flugente: a modifier for burial effectiveness
|
||||
UINT8 usDamageChance; // Flugente: advanced repair/dirt system. Chance that damage to the status will also damage the repair threshold
|
||||
UINT8 usFlashLightRange; // Flugente: range of a flashlight (an item with usFlashLightRange > 0 is deemed a flashlight)
|
||||
UINT8 usItemChoiceTimeSetting; // Flugente: determine wether the AI should pick this item for its choices only at certain times
|
||||
UINT8 ubSleepModifier; // silversurfer: item provides breath regeneration bonus while resting
|
||||
UINT8 usPortionSize; // Flugente: for consumables: how much of this item is consumed at once
|
||||
UINT8 usAdministrationModifier; // Flugente: a modifier for administration effectiveness
|
||||
UINT8 inseparable; //Madd:Normally, an inseparable attachment can never be removed.
|
||||
//But now we will make it so that these items can be replaced, but still not removed directly.
|
||||
//0 = removeable (as before)
|
||||
//1 = inseparable (as before)
|
||||
//2 = inseparable, but replaceable
|
||||
|
||||
UINT32 attachmentclass; // attachmentclass used
|
||||
|
||||
BOOLEAN tripwireactivation; // item (mine) can be activated by nearby tripwire
|
||||
BOOLEAN tripwire; // item is tripwire
|
||||
BOOLEAN directional; // item is a directional mine/bomb (actual direction is set upon planting)
|
||||
|
||||
UINT32 drugtype; // this flagmask determines what different components are used in a drug, which results in different effects
|
||||
|
||||
BOOLEAN blockironsight; // if a gun or any attachment have this property, the iron sight won't be usable (if there is at least one other usable sight)
|
||||
|
||||
UINT64 usItemFlag; // bitflags to store various item properties (better than introducing 32 BOOLEAN values). If I only had thought of this earlier....
|
||||
|
||||
// Flugente: food type
|
||||
UINT32 foodtype;
|
||||
|
||||
//JMich_SkillModifiers: Adding new skill modifiers
|
||||
INT8 LockPickModifier;
|
||||
UINT8 CrowbarModifier;
|
||||
UINT8 DisarmModifier;
|
||||
INT8 RepairModifier;
|
||||
|
||||
// Flugente: a modifier to hacking
|
||||
UINT8 usHackingModifier;
|
||||
|
||||
// Flugente: a modifier for burial effectiveness
|
||||
UINT8 usBurialModifier;
|
||||
|
||||
// Flugente: advanced repair/dirt system
|
||||
UINT8 usDamageChance; // chance that damage to the status will also damage the repair threshold
|
||||
FLOAT dirtIncreaseFactor; // one shot causes this much dirt on a gun
|
||||
|
||||
// Flugente: a flag that is necessary for transforming action items to objects with new abilities (for now, tripwire networks and directional explosives)
|
||||
UINT32 usActionItemFlag;
|
||||
|
||||
// Flugente: clothes type that 'links' to an entry in Clothes.xml
|
||||
UINT32 clothestype;
|
||||
|
||||
// Flugente: a link to RandomItemsClass.xml. Out of such an item, a random object is created, depending on the entries in the xml
|
||||
UINT16 randomitem;
|
||||
INT8 randomitemcoolnessmodificator; // alters the allowed maximum coolness a random item can have
|
||||
|
||||
// Flugente: range of a flashlight (an item with usFlashLightRange > 0 is deemed a flashlight)
|
||||
UINT8 usFlashLightRange;
|
||||
|
||||
// Flugente: determine wether the AI should pick this item for its choices only at certain times
|
||||
UINT8 usItemChoiceTimeSetting;
|
||||
|
||||
// Flugente: item is connected to another item. Type of connection depends on item specifics
|
||||
UINT16 usBuddyItem;
|
||||
|
||||
// silversurfer: item provides breath regeneration bonus while resting
|
||||
UINT8 ubSleepModifier;
|
||||
|
||||
// Flugente: spotting effectiveness
|
||||
INT16 usSpotting;
|
||||
|
||||
//JMich.BackpackClimb
|
||||
INT16 sBackpackWeightModifier; //modifier to weight calculation to climb.
|
||||
BOOLEAN fAllowClimbing; //does item allow climbing while wearing it
|
||||
|
||||
BOOLEAN cigarette; // Flugente: this item can be smoked
|
||||
UINT8 usPortionSize; // Flugente: for consumables: how much of this item is consumed at once
|
||||
|
||||
// Flugente: riot shields
|
||||
UINT16 usRiotShieldStrength; // strength of shield
|
||||
UINT16 usRiotShieldGraphic; // graphic of shield (when deployed in tactical, taken from Tilecache/riotshield.sti)
|
||||
|
||||
// Flugente: fire resistance
|
||||
INT16 sFireResistance;
|
||||
|
||||
// Flugente: a modifier for administration effectiveness
|
||||
UINT8 usAdministrationModifier;
|
||||
|
||||
// rftr: robot attachments
|
||||
FLOAT fRobotDamageReductionModifier;
|
||||
INT8 bRobotStrBonus;
|
||||
INT8 bRobotAgiBonus;
|
||||
INT8 bRobotDexBonus;
|
||||
INT8 bRobotTargetingSkillGrant;
|
||||
INT8 bRobotChassisSkillGrant;
|
||||
INT8 bRobotUtilitySkillGrant;
|
||||
BOOLEAN fProvidesRobotCamo;
|
||||
BOOLEAN fProvidesRobotNightVision;
|
||||
BOOLEAN fProvidesRobotLaserBonus;
|
||||
//shadooow: bitflag controlling what system needs to be in play for item to appear
|
||||
UINT8 usLimitedToSystem;
|
||||
|
||||
// rftr: the progress bounds that allow a transport group to drop an item
|
||||
INT8 iTransportGroupMinProgress;
|
||||
INT8 iTransportGroupMaxProgress;
|
||||
INT8 bSoundType;
|
||||
INT8 bReliability;
|
||||
INT8 bRepairEase;
|
||||
INT8 LockPickModifier;
|
||||
INT8 RepairModifier;
|
||||
INT8 randomitemcoolnessmodificator; // Flugente: a link to RandomItemsClass.xml. alters the allowed maximum coolness a random item can have
|
||||
INT8 bRobotStrBonus; // rftr: robot attachments
|
||||
INT8 bRobotAgiBonus; // rftr: robot attachments
|
||||
INT8 bRobotDexBonus; // rftr: robot attachments
|
||||
INT8 bRobotTargetingSkillGrant; // rftr: robot attachments
|
||||
INT8 bRobotChassisSkillGrant; // rftr: robot attachments
|
||||
INT8 bRobotUtilitySkillGrant; // rftr: robot attachments
|
||||
INT8 iTransportGroupMinProgress; // rftr: the progress bounds that allow a transport group to drop an item
|
||||
INT8 iTransportGroupMaxProgress; // rftr: the progress bounds that allow a transport group to drop an item
|
||||
} INVTYPE;
|
||||
|
||||
|
||||
|
||||
+272
-214
File diff suppressed because it is too large
Load Diff
+74
-6
@@ -179,8 +179,76 @@ BOOLEAN ValidAttachmentClass( UINT16 usAttachment, UINT16 usItem );
|
||||
//Determines if it is possible to equip this weapon with this ammo.
|
||||
BOOLEAN ValidAmmoType( UINT16 usItem, UINT16 usAmmoType );
|
||||
|
||||
//Determines if this item is a two handed item.
|
||||
BOOLEAN TwoHandedItem( UINT16 usItem );
|
||||
BOOLEAN ItemIsDamageable(UINT16 usItem);
|
||||
BOOLEAN ItemIsRepairable(UINT16 usItem);
|
||||
BOOLEAN ItemIsDamagedByWater(UINT16 usItem);
|
||||
BOOLEAN ItemIsMetal(UINT16 usItem);
|
||||
BOOLEAN ItemSinks(UINT16 usItem);
|
||||
BOOLEAN ItemIsTwoHanded(UINT16 usItem);
|
||||
BOOLEAN ItemIsHiddenAddon(UINT16 usItem);
|
||||
BOOLEAN ItemIsNotBuyable(UINT16 usItem);
|
||||
BOOLEAN ItemIsAttachment(UINT16 usItem);
|
||||
BOOLEAN ItemIsHiddenAttachment(UINT16 usItem);
|
||||
BOOLEAN ItemIsOnlyInTonsOfGuns(UINT16 usItem);
|
||||
BOOLEAN ItemIsNotInEditor(UINT16 usItem);
|
||||
BOOLEAN ItemIsUndroppableByDefault(UINT16 usItem);
|
||||
BOOLEAN ItemIsUnaerodynamic(UINT16 usItem);
|
||||
BOOLEAN ItemIsElectronic(UINT16 usItem);
|
||||
BOOLEAN ItemIsCannon(UINT16 usItem);
|
||||
BOOLEAN ItemIsRocketRifle(UINT16 usItem);
|
||||
BOOLEAN ItemHasFingerPrintID(UINT16 usItem);
|
||||
BOOLEAN ItemIsMetalDetector(UINT16 usItem);
|
||||
BOOLEAN ItemIsGasmask(UINT16 usItem);
|
||||
BOOLEAN ItemIsLockBomb(UINT16 usItem);
|
||||
BOOLEAN ItemIsFlare(UINT16 usItem);
|
||||
BOOLEAN ItemIsGrenadeLauncher(UINT16 usItem);
|
||||
BOOLEAN ItemIsMortar(UINT16 usItem);
|
||||
BOOLEAN ItemIsDuckbill(UINT16 usItem);
|
||||
BOOLEAN ItemHasHiddenMuzzleFlash(UINT16 usItem);
|
||||
BOOLEAN ItemIsRocketLauncher(UINT16 usItem);
|
||||
BOOLEAN ItemIsSingleShotRocketLauncher(UINT16 usItem);
|
||||
BOOLEAN ItemIsBrassKnuckles(UINT16 usItem);
|
||||
BOOLEAN ItemIsCrowbar(UINT16 usItem);
|
||||
BOOLEAN ItemIsGLgrenade(UINT16 usItem);
|
||||
BOOLEAN ItemIsFlakJacket(UINT16 usItem);
|
||||
BOOLEAN ItemIsLeatherJacket(UINT16 usItem);
|
||||
BOOLEAN ItemIsBatteries(UINT16 usItem);
|
||||
BOOLEAN ItemNeedsBatteries(UINT16 usItem);
|
||||
BOOLEAN ItemHasXRay(UINT16 usItem);
|
||||
BOOLEAN ItemIsWirecutters(UINT16 usItem);
|
||||
BOOLEAN ItemIsToolkit(UINT16 usItem);
|
||||
BOOLEAN ItemIsFirstAidKit(UINT16 usItem);
|
||||
BOOLEAN ItemIsMedicalKit(UINT16 usItem);
|
||||
BOOLEAN ItemIsCanteen(UINT16 usItem);
|
||||
BOOLEAN ItemIsJar(UINT16 usItem);
|
||||
BOOLEAN ItemIsCanAndString(UINT16 usItem);
|
||||
BOOLEAN ItemIsMarbles(UINT16 usItem);
|
||||
BOOLEAN ItemIsWalkman(UINT16 usItem);
|
||||
BOOLEAN ItemIsRemoteTrigger(UINT16 usItem);
|
||||
BOOLEAN ItemIsRobotRemote(UINT16 usItem);
|
||||
BOOLEAN ItemIsCamoKit(UINT16 usItem);
|
||||
BOOLEAN ItemIsLocksmithKit(UINT16 usItem);
|
||||
BOOLEAN ItemIsMine(UINT16 usItem);
|
||||
BOOLEAN ItemIsATMine(UINT16 usItem);
|
||||
BOOLEAN ItemIsHardware(UINT16 usItem);
|
||||
BOOLEAN ItemIsMedical(UINT16 usItem);
|
||||
BOOLEAN ItemIsGascan(UINT16 usItem);
|
||||
BOOLEAN ItemContainsLiquid(UINT16 usItem);
|
||||
BOOLEAN ItemIsRock(UINT16 usItem);
|
||||
BOOLEAN ItemIsThermalOptics(UINT16 usItem);
|
||||
BOOLEAN ItemIsOnlyInScifi(UINT16 usItem);
|
||||
BOOLEAN ItemIsOnlyInNIV(UINT16 usItem);
|
||||
BOOLEAN ItemIsBarrel(UINT16 usItem);
|
||||
BOOLEAN ItemHasTripwireActivation(UINT16 usItem);
|
||||
BOOLEAN ItemIsTripwire(UINT16 usItem);
|
||||
BOOLEAN ItemIsDirectional(UINT16 usItem);
|
||||
BOOLEAN ItemBlocksIronsight(UINT16 usItem);
|
||||
BOOLEAN ItemAllowsClimbing(UINT16 usItem);
|
||||
BOOLEAN ItemIsCigarette(UINT16 usItem);
|
||||
BOOLEAN ItemIsOnlyInDisease(UINT16 usItem);
|
||||
BOOLEAN ItemProvidesRobotCamo(UINT16 usItem);
|
||||
BOOLEAN ItemProvidesRobotNightvision(UINT16 usItem);
|
||||
BOOLEAN ItemProvidesRobotLaserBonus(UINT16 usItem);
|
||||
|
||||
//Existing functions without header def's, added them here, just incase I'll need to call
|
||||
//them from the editor.
|
||||
@@ -222,12 +290,11 @@ UINT8 ConvertObjectTypeMoneyValueToProfileMoneyValue( UINT32 uiMoneyAmount );
|
||||
BOOLEAN CheckForChainReaction( UINT16 usItem, INT16 bStatus, INT16 bDamage, BOOLEAN fOnGround );
|
||||
|
||||
BOOLEAN ItemIsLegal( UINT16 usItemIndex, BOOLEAN fIgnoreCoolness = FALSE );
|
||||
BOOLEAN ExtendedGunListGun( UINT16 usGun );
|
||||
UINT16 StandardGunListReplacement( UINT16 usGun );
|
||||
UINT16 FindReplacementMagazine( UINT8 ubCalibre, UINT16 ubMagSize, UINT8 ubAmmoType);
|
||||
UINT16 FindReplacementMagazineIfNecessary( UINT16 usOldGun, UINT16 usOldAmmo, UINT16 usNewGun );
|
||||
|
||||
BOOLEAN DamageItemOnGround( OBJECTTYPE * pObject, INT32 sGridNo, INT8 bLevel, INT32 iDamage, UINT8 ubOwner );
|
||||
BOOLEAN DamageItemOnGround( OBJECTTYPE * pObject, INT32 sGridNo, INT8 bLevel, INT32 iDamage, SoldierID ubOwner );
|
||||
|
||||
BOOLEAN CompatibleFaceItem( UINT16 usItem1, UINT16 usItem2 );
|
||||
|
||||
@@ -497,10 +564,11 @@ UINT64 GetAvailableAttachmentPoint ( OBJECTTYPE * pObject, UINT8 subObject );
|
||||
void CheckBombSpecifics( OBJECTTYPE * pObj, INT8* detonatortype, INT8* setting, INT8* defusefrequency );
|
||||
|
||||
// Flugente: check for specific flags
|
||||
BOOLEAN HasItemFlag( UINT16 usItem, UINT64 aFlag );
|
||||
BOOLEAN HasItemFlag(UINT16 usItem, FLAGS64 aFlag);
|
||||
BOOLEAN HasItemFlag2(UINT16 usItem, FLAGS64 aFlag);
|
||||
|
||||
// Flugente: get first item number that has this flag. Use with caution, as we search in all items
|
||||
BOOLEAN GetFirstItemWithFlag( UINT16* pusItem, UINT64 aFlag );
|
||||
BOOLEAN GetFirstItemWithFlag( UINT16* pusItem, FLAGS64 aFlag );
|
||||
|
||||
// Flugente: check if this object is currently fed from an external source (belts in inventory, other mercs)
|
||||
BOOLEAN ObjectIsBeingFedExternal(SOLDIERTYPE* pSoldier, OBJECTTYPE * pObject);
|
||||
|
||||
+64
-76
@@ -1,45 +1,23 @@
|
||||
#include "items.h"
|
||||
#include "weapons.h"
|
||||
#ifdef JA2UB
|
||||
#include "Items.h"
|
||||
#include "Soldier Control.h"
|
||||
#include "overhead.h"
|
||||
#include "Overhead.h"
|
||||
#include "Handle UI.h"
|
||||
#include "Animation Control.h"
|
||||
#include "Isometric Utils.h"
|
||||
#include "Animation Data.h"
|
||||
#include "Random.h"
|
||||
#include "Campaign.h"
|
||||
#include "interface.h"
|
||||
#include "Keys.h"
|
||||
|
||||
#include "soldier profile.h"
|
||||
#include "SkillCheck.h"
|
||||
#include "los.h"
|
||||
#include "message.h"
|
||||
#include "text.h"
|
||||
|
||||
#include "MessageBoxScreen.h"
|
||||
|
||||
#include "ShopKeeper Interface.h"
|
||||
|
||||
#include "random.h"
|
||||
#include "Interface.h"
|
||||
#include "Soldier Profile.h"
|
||||
#include "Text.h"
|
||||
#include "GameSettings.h"
|
||||
#include "Auto Resolve.h"
|
||||
#include "Interface Items.h"
|
||||
#include "Campaign Types.h"
|
||||
#include "strategicmap.h"
|
||||
#include "Inventory Choosing.h"
|
||||
#include "Soldier Create.h"
|
||||
#include "Soldier macros.h"
|
||||
#include "Smell.h"
|
||||
#include "lighting.h"
|
||||
#include "utilities.h"
|
||||
#include "english.h"
|
||||
#include "debug control.h"
|
||||
|
||||
#ifdef JA2UB
|
||||
#include "worldman.h"
|
||||
#include "Game Clock.h"
|
||||
#include "Sound Control.h"
|
||||
#include "Ja25 Strategic Ai.h"
|
||||
#include "MapScreen Quotes.h"
|
||||
#include "Ja25_Tactical.h"
|
||||
#include "Dialogue Control.h"
|
||||
#include "interface Dialogue.h"
|
||||
@@ -48,10 +26,8 @@
|
||||
#include "renderworld.h"
|
||||
#include "qarray.h"
|
||||
#include "Soldier Init List.h"
|
||||
#include "Soldier Control.h"
|
||||
#include "End Game.h"
|
||||
#include "structure.h"
|
||||
#include "Explosion Control.h"
|
||||
#include "ub_config.h"
|
||||
#include "GameInitOptionsScreen.h"
|
||||
|
||||
@@ -84,7 +60,7 @@ typedef struct
|
||||
//Morris items
|
||||
//UINT32 MORRIS_INSTRUCTION_NOTE = 1362;
|
||||
|
||||
UINT8 Get3RandomQualifiedMercs( UINT8 *pSoldierId1, UINT8 *pSoldierId2, UINT8 *pSoldierId3 );
|
||||
UINT8 Get3RandomQualifiedMercs( SoldierID *pSoldierId1, SoldierID *pSoldierId2, SoldierID *pSoldierId3 );
|
||||
|
||||
//*******************************************************************
|
||||
//
|
||||
@@ -293,7 +269,8 @@ UINT32 POWERGENSECTOR_GRIDNO1 = 15100;
|
||||
UINT32 POWERGENSECTOR_GRIDNO2 = 12220;
|
||||
UINT32 POWERGENSECTOR_GRIDNO3 = 14155;
|
||||
UINT32 POWERGENSECTOR_GRIDNO4 = 13980;
|
||||
UINT32 POWERGENSECTOREXITGRID_GRIDNO1 = 19749;
|
||||
UINT32 POWERGENSECTOREXITGRID_SRC_GRIDNO = 10979;
|
||||
UINT32 POWERGENSECTOREXITGRID_DST_GRIDNO = 19749;
|
||||
UINT32 POWERGENFANSOUND_GRIDNO1 = 10979;
|
||||
UINT32 POWERGENFANSOUND_GRIDNO2 = 19749;
|
||||
UINT32 STARTFANBACKUPAGAIN_GRIDNO = 10980;
|
||||
@@ -304,17 +281,22 @@ UINT32 SECTOR_LAUNCH_MISSLES_Y = 12;
|
||||
UINT32 SECTOR_LAUNCH_MISSLES_Z = 3;
|
||||
//J13-0
|
||||
UINT32 SECTOR_FAN_X = 13;
|
||||
UINT32 SECTOR_FAN_Z = 10;
|
||||
UINT32 SECTOR_FAN_Y = 0;
|
||||
UINT32 SECTOR_FAN_Y = 10;
|
||||
UINT32 SECTOR_FAN_Z = 0;
|
||||
//K14-1
|
||||
UINT32 SECTOR_OPEN_GATE_IN_TUNNEL_X = 14;
|
||||
UINT32 SECTOR_OPEN_GATE_IN_TUNNEL_Y = 11;
|
||||
UINT32 SECTOR_OPEN_GATE_IN_TUNNEL_Z = 1;
|
||||
//J14-1
|
||||
// Destination sector for fan exitgrid
|
||||
//J14-1
|
||||
UINT32 EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_X = 14;
|
||||
UINT32 EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Y = 10;
|
||||
UINT32 EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Z = 1;
|
||||
|
||||
INT16 BETTY_BLOODCAT_SECTOR_X = 10;
|
||||
INT16 BETTY_BLOODCAT_SECTOR_Y = 9;
|
||||
INT8 BETTY_BLOODCAT_SECTOR_Z = 0;
|
||||
|
||||
void InitGridNoUB()
|
||||
{
|
||||
SWITCHINMORRISAREA_GRIDNO = gGameUBOptions.SwitchInMorrisAreaGridNo; //= 15231;
|
||||
@@ -326,7 +308,8 @@ void InitGridNoUB()
|
||||
POWERGENSECTOR_GRIDNO2 = gGameUBOptions.PowergenSectorGridNo2; //= 12220;
|
||||
POWERGENSECTOR_GRIDNO3 = gGameUBOptions.PowergenSectorGridNo3; //= 14155;
|
||||
POWERGENSECTOR_GRIDNO4 = gGameUBOptions.PowergenSectorGridNo4; //= 13980;
|
||||
POWERGENSECTOREXITGRID_GRIDNO1 = gGameUBOptions.PowergenSectorExitgridGridNo; // = 19749;
|
||||
POWERGENSECTOREXITGRID_SRC_GRIDNO = gGameUBOptions.PowergenSectorExitgridSrcGridNo; //= 10979; // Exitgrid location in the sector it is created in
|
||||
POWERGENSECTOREXITGRID_DST_GRIDNO = gGameUBOptions.PowergenSectorExitgridGridNo; // = 19749; // Exitgrid location in the destination sector
|
||||
POWERGENFANSOUND_GRIDNO1 = gGameUBOptions.PowergenFanSoundGridNo1; //= 10979;
|
||||
POWERGENFANSOUND_GRIDNO2 = gGameUBOptions.PowergenFanSoundGridNo2; //= 19749;
|
||||
STARTFANBACKUPAGAIN_GRIDNO = gGameUBOptions.StartFanbackupAgainGridNo; //= 10980;
|
||||
@@ -338,8 +321,8 @@ void InitGridNoUB()
|
||||
SECTOR_LAUNCH_MISSLES_Z = gGameUBOptions.SectorLaunchMisslesZ; //3;
|
||||
//J13-0
|
||||
SECTOR_FAN_X = gGameUBOptions.SectorFanX; //13;
|
||||
SECTOR_FAN_Z = gGameUBOptions.SectorFanY; //10;
|
||||
SECTOR_FAN_Y = gGameUBOptions.SectorFanZ; //0;
|
||||
SECTOR_FAN_Y = gGameUBOptions.SectorFanY; //10;
|
||||
SECTOR_FAN_Z = gGameUBOptions.SectorFanZ; //0;
|
||||
//K14-1
|
||||
SECTOR_OPEN_GATE_IN_TUNNEL_X = gGameUBOptions.SectorOpenGateInTunnelX; //14;
|
||||
SECTOR_OPEN_GATE_IN_TUNNEL_Y = gGameUBOptions.SectorOpenGateInTunnelY; //11;
|
||||
@@ -348,7 +331,12 @@ void InitGridNoUB()
|
||||
EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_X = gGameUBOptions.ExitForFanToPowerGenSectorX; //14;
|
||||
EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Y = gGameUBOptions.ExitForFanToPowerGenSectorY; //10;
|
||||
EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Z = gGameUBOptions.ExitForFanToPowerGenSectorZ; //1;
|
||||
|
||||
|
||||
BETTY_BLOODCAT_SECTOR_X = gGameUBOptions.BettyBloodCatSectorX;
|
||||
BETTY_BLOODCAT_SECTOR_Y = gGameUBOptions.BettyBloodCatSectorY;
|
||||
BETTY_BLOODCAT_SECTOR_Z = gGameUBOptions.BettyBloodCatSectorZ;
|
||||
|
||||
|
||||
MANUEL_UB = gGameUBOptions.ubMANUEL_UB;
|
||||
BIGGENS_UB = gGameUBOptions.ubBIGGENS_UB;
|
||||
JOHN_K_UB = gGameUBOptions.ubJOHN_K_UB;
|
||||
@@ -452,7 +440,7 @@ BOOLEAN IsSoldierQualifiedInitialHireMerc( SOLDIERTYPE *pSoldier )
|
||||
}
|
||||
}
|
||||
|
||||
UINT8 GetNumSoldierIdAndProfileIdOfTheNewMercsOnPlayerTeam( UINT8 *pSoldierIdArray, UINT8 *pProfileIdArray )
|
||||
UINT8 GetNumSoldierIdAndProfileIdOfTheNewMercsOnPlayerTeam( SoldierID *pSoldierIdArray, UINT8 *pProfileIdArray )
|
||||
{
|
||||
SOLDIERTYPE *pSoldier=NULL;
|
||||
UINT8 usNumMercsPresent=0;
|
||||
@@ -523,10 +511,10 @@ INT16 RandomProfileIdFromNewMercsOnPlayerTeam()
|
||||
}
|
||||
}
|
||||
|
||||
INT16 RandomSoldierIdFromNewMercsOnPlayerTeam()
|
||||
SoldierID RandomSoldierIdFromNewMercsOnPlayerTeam()
|
||||
{
|
||||
UINT8 usNumMercsPresent;
|
||||
UINT8 SoldierIdArray[NUM_MERCS_WITH_NEW_QUOTES];
|
||||
UINT8 usNumMercsPresent;
|
||||
SoldierID SoldierIdArray[NUM_MERCS_WITH_NEW_QUOTES];
|
||||
|
||||
//Get the number and array of the new soldiers
|
||||
usNumMercsPresent = GetNumSoldierIdAndProfileIdOfTheNewMercsOnPlayerTeam( SoldierIdArray, NULL );
|
||||
@@ -536,20 +524,20 @@ INT16 RandomSoldierIdFromNewMercsOnPlayerTeam()
|
||||
if( usNumMercsPresent > 0 )
|
||||
{
|
||||
//return a random merc from the array
|
||||
return( (INT16)( SoldierIdArray[ Random( usNumMercsPresent ) ] ));
|
||||
return( ( SoldierIdArray[ Random( usNumMercsPresent ) ] ));
|
||||
}
|
||||
else
|
||||
{
|
||||
return( -1 );
|
||||
return( NOBODY );
|
||||
}
|
||||
}
|
||||
|
||||
UINT8 RandomArrayOfQualifiedMercs( UINT8 *pRandomSoldierIdArray )
|
||||
UINT8 RandomArrayOfQualifiedMercs( SoldierID *pRandomSoldierIdArray )
|
||||
{
|
||||
UINT8 usNumMercsPresent;
|
||||
UINT8 SoldierIdArray[NUM_MERCS_WITH_NEW_QUOTES];
|
||||
BOOLEAN UsedArray[NUM_MERCS_WITH_NEW_QUOTES];
|
||||
BOOLEAN fFound=FALSE;
|
||||
UINT8 usNumMercsPresent;
|
||||
SoldierID SoldierIdArray[NUM_MERCS_WITH_NEW_QUOTES];
|
||||
BOOLEAN UsedArray[NUM_MERCS_WITH_NEW_QUOTES];
|
||||
BOOLEAN fFound=FALSE;
|
||||
UINT8 ubRand;
|
||||
|
||||
memset( UsedArray, 0, NUM_MERCS_WITH_NEW_QUOTES );
|
||||
@@ -584,11 +572,11 @@ UINT8 RandomArrayOfQualifiedMercs( UINT8 *pRandomSoldierIdArray )
|
||||
return( usNumMercsPresent );
|
||||
}
|
||||
|
||||
UINT8 Get3RandomQualifiedMercs( UINT8 *pSoldierId1, UINT8 *pSoldierId2, UINT8 *pSoldierId3 )
|
||||
UINT8 Get3RandomQualifiedMercs( SoldierID *pSoldierId1, SoldierID *pSoldierId2, SoldierID *pSoldierId3 )
|
||||
{
|
||||
UINT8 usNumMercs;
|
||||
UINT8 RandomSoldierIdArray[ NUM_MERCS_WITH_NEW_QUOTES ];
|
||||
UINT8 ubNumberDifMercsAssigned=0;
|
||||
UINT8 usNumMercs;
|
||||
SoldierID RandomSoldierIdArray[ NUM_MERCS_WITH_NEW_QUOTES ];
|
||||
UINT8 ubNumberDifMercsAssigned=0;
|
||||
|
||||
usNumMercs = RandomArrayOfQualifiedMercs( RandomSoldierIdArray );
|
||||
|
||||
@@ -646,7 +634,7 @@ void HandleWhenCertainPercentageOfEnemiesDie()
|
||||
UINT32 uiPercentEnemiesKilled;
|
||||
UINT8 ubSectorID;
|
||||
|
||||
//if there isnt enemies in the sector
|
||||
//if there isn't enemies in the sector
|
||||
if( ( gTacticalStatus.Team[ ENEMY_TEAM ].bMenInSector + gTacticalStatus.ubArmyGuysKilled ) == 0 )
|
||||
{
|
||||
//get out
|
||||
@@ -663,7 +651,7 @@ void HandleWhenCertainPercentageOfEnemiesDie()
|
||||
switch( ubSectorID )
|
||||
{
|
||||
case SEC_K15:
|
||||
//all enemies are dead and if the quote hasnt been said yet
|
||||
//all enemies are dead and if the quote hasn't been said yet
|
||||
if( uiPercentEnemiesKilled >= 100 && !( gJa25SaveStruct.uiJa25GeneralFlags & JA_GF__ALL_DEAD_TOP_LEVEL_OF_COMPLEX ) )
|
||||
{
|
||||
INT16 bProfile = RandomProfileIdFromNewMercsOnPlayerTeam();
|
||||
@@ -703,7 +691,7 @@ void StopPowerGenFan()
|
||||
return;
|
||||
}
|
||||
|
||||
//Remeber how the player got through
|
||||
//Remember how the player got through
|
||||
SetJa25GeneralFlag( JA_GF__POWER_GEN_FAN_HAS_BEEN_STOPPED );
|
||||
|
||||
gJa25SaveStruct.ubStateOfFanInPowerGenSector = PGF__STOPPED;
|
||||
@@ -721,7 +709,7 @@ void StopPowerGenFan()
|
||||
//Turn off the power gen fan sound
|
||||
HandleRemovingPowerGenFanSound();
|
||||
|
||||
//remeber which turn the fan stopped on
|
||||
//remember which turn the fan stopped on
|
||||
gJa25SaveStruct.uiTurnPowerGenFanWentDown = gJa25SaveStruct.uiTacticalTurnCounter;
|
||||
|
||||
|
||||
@@ -729,7 +717,7 @@ void StopPowerGenFan()
|
||||
// Replace the Fan graphic
|
||||
//
|
||||
|
||||
// Turn on permenant changes....
|
||||
// Turn on permanent changes....
|
||||
ApplyMapChangesToMapTempFile( TRUE );
|
||||
|
||||
//Add the exit grid to the power gen fan
|
||||
@@ -784,7 +772,7 @@ void StartFanBackUpAgain()
|
||||
return;
|
||||
}
|
||||
|
||||
//Remeber how the player got through
|
||||
//Remember how the player got through
|
||||
gJa25SaveStruct.ubStateOfFanInPowerGenSector = PGF__RUNNING_NORMALLY;
|
||||
|
||||
|
||||
@@ -796,7 +784,7 @@ void StartFanBackUpAgain()
|
||||
// Replace the Fan graphic
|
||||
//
|
||||
|
||||
// Turn on permenant changes....
|
||||
// Turn on permanent changes....
|
||||
ApplyMapChangesToMapTempFile( TRUE );
|
||||
|
||||
// Remove it!
|
||||
@@ -821,7 +809,7 @@ void StartFanBackUpAgain()
|
||||
gTacticalStatus.uiFlags |= NOHIDE_REDUNDENCY;
|
||||
|
||||
//Remove the exit grid
|
||||
RemoveExitGridFromWorld( PGF__FAN_EXIT_GRID_GRIDNO );
|
||||
RemoveExitGridFromWorld( POWERGENSECTOREXITGRID_SRC_GRIDNO );
|
||||
|
||||
// FOR THE NEXT RENDER LOOP, RE-EVALUATE REDUNDENT TILES
|
||||
SetRenderFlags(RENDER_FLAG_FULL);
|
||||
@@ -875,20 +863,20 @@ void HandlePowerGenAlarm()
|
||||
}
|
||||
else
|
||||
{
|
||||
UINT8 bSoldierId1, bSoldierId2, bSoldierId3;
|
||||
SoldierID bSoldierId1, bSoldierId2, bSoldierId3;
|
||||
Get3RandomQualifiedMercs( &bSoldierId1, &bSoldierId2, &bSoldierId3 );
|
||||
|
||||
if( bSoldierId1 != -1 && Menptr[ bSoldierId1 ].ubProfile != BIGGENS_UB ) //BIGGENS
|
||||
if( bSoldierId1 != NOBODY && bSoldierId1->ubProfile != BIGGENS_UB ) //BIGGENS
|
||||
{
|
||||
TacticalCharacterDialogue( &Menptr[ bSoldierId1 ], QUOTE_HATED_1_ON_TEAM_LONGTIMETOHATE );
|
||||
TacticalCharacterDialogue( bSoldierId1, QUOTE_HATED_1_ON_TEAM_LONGTIMETOHATE );
|
||||
}
|
||||
else if( bSoldierId2 != -1 && Menptr[ bSoldierId2 ].ubProfile != BIGGENS_UB ) //BIGGENS
|
||||
else if( bSoldierId2 != NOBODY && bSoldierId2->ubProfile != BIGGENS_UB ) //BIGGENS
|
||||
{
|
||||
TacticalCharacterDialogue( &Menptr[ bSoldierId2 ], QUOTE_HATED_1_ON_TEAM_LONGTIMETOHATE );
|
||||
TacticalCharacterDialogue( bSoldierId2, QUOTE_HATED_1_ON_TEAM_LONGTIMETOHATE );
|
||||
}
|
||||
else if( bSoldierId3 != -1 && Menptr[ bSoldierId3 ].ubProfile != BIGGENS_UB ) // BIGGENS
|
||||
else if( bSoldierId3 != NOBODY && bSoldierId3->ubProfile != BIGGENS_UB ) // BIGGENS
|
||||
{
|
||||
TacticalCharacterDialogue( &Menptr[ bSoldierId3 ], QUOTE_HATED_1_ON_TEAM_LONGTIMETOHATE );
|
||||
TacticalCharacterDialogue( bSoldierId3, QUOTE_HATED_1_ON_TEAM_LONGTIMETOHATE );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -914,7 +902,7 @@ void HandleAddingPowerGenFanSound()
|
||||
sGridNo = POWERGENFANSOUND_GRIDNO2;
|
||||
|
||||
//Create the new ambient fan sound
|
||||
//gJa25SaveStruct.iPowerGenFanPositionSndID = NewPositionSnd( sGridNo, POSITION_SOUND_STATIONATY_OBJECT, 0, POWER_GEN_FAN_SOUND );
|
||||
gJa25SaveStruct.iPowerGenFanPositionSndID = NewPositionSnd( sGridNo, POSITION_SOUND_STATIONATY_OBJECT, 0, POWER_GEN_FAN_SOUND, 30 );
|
||||
|
||||
SetPositionSndsInActive( );
|
||||
SetPositionSndsActive( );
|
||||
@@ -942,10 +930,10 @@ void AddExitGridForFanToPowerGenSector()
|
||||
ExitGrid.ubGotoSectorX = EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_X; //14;
|
||||
ExitGrid.ubGotoSectorY = EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Y; //MAP_ROW_J;
|
||||
ExitGrid.ubGotoSectorZ = EXIT_FOR_FAN_TO_POWER_GEN_SECTOR_Z; //1;
|
||||
ExitGrid.usGridNo = POWERGENSECTOREXITGRID_GRIDNO1;
|
||||
ExitGrid.usGridNo = POWERGENSECTOREXITGRID_DST_GRIDNO;
|
||||
|
||||
//Add the exit grid when the fan is either stopped or blown up
|
||||
AddExitGridToWorld( PGF__FAN_EXIT_GRID_GRIDNO, &ExitGrid );
|
||||
AddExitGridToWorld( POWERGENSECTOREXITGRID_SRC_GRIDNO, &ExitGrid );
|
||||
}
|
||||
|
||||
BOOLEAN HandlePlayerSayingQuoteWhenFailingToOpenGateInTunnel( SOLDIERTYPE *pSoldierAtDoor, BOOLEAN fSayQuoteOnlyOnce )
|
||||
@@ -1060,8 +1048,8 @@ void HandlePlayingQuoteWhenHiringNpc( UINT8 ubProfile )
|
||||
|
||||
BOOLEAN SayQuoteFromAllNewHiredMercButDoGastonLast( UINT8 ubProfile, UINT32 uiQuoteNum )
|
||||
{
|
||||
UINT8 usNumMercsPresent;
|
||||
UINT8 SoldierIdArray[NUM_MERCS_WITH_NEW_QUOTES];
|
||||
UINT8 usNumMercsPresent;
|
||||
SoldierID SoldierIdArray[NUM_MERCS_WITH_NEW_QUOTES];
|
||||
SOLDIERTYPE *pSoldier=NULL;
|
||||
|
||||
//Get an array of the mercs on the team
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
#include "MapScreen Quotes.h"
|
||||
|
||||
#define PGF__FAN_EXIT_GRID_GRIDNO 10979
|
||||
|
||||
#define NUM_MERCS_WITH_NEW_QUOTES 20//7
|
||||
|
||||
@@ -37,8 +36,8 @@ typedef struct
|
||||
extern BOOLEAN gfFirstTimeInGameHeliCrash;
|
||||
|
||||
INT16 RandomProfileIdFromNewMercsOnPlayerTeam();
|
||||
INT16 RandomSoldierIdFromNewMercsOnPlayerTeam();
|
||||
UINT8 GetNumSoldierIdAndProfileIdOfTheNewMercsOnPlayerTeam( UINT8 *pSoldierIdArray, UINT8 *pProfileIdArray );
|
||||
SoldierID RandomSoldierIdFromNewMercsOnPlayerTeam();
|
||||
UINT8 GetNumSoldierIdAndProfileIdOfTheNewMercsOnPlayerTeam( SoldierID *pSoldierIdArray, UINT8 *pProfileIdArray );
|
||||
BOOLEAN IsSoldierQualifiedMerc( SOLDIERTYPE *pSoldier );
|
||||
BOOLEAN IsSoldierQualifiedInitialHireMerc( SOLDIERTYPE *pSoldier );
|
||||
BOOLEAN IsSoldierQualifiedMercForSeeingPowerGenFan( SOLDIERTYPE *pSoldier );
|
||||
@@ -47,10 +46,10 @@ BOOLEAN SayQuoteFromAllNewHiredMercButDoGastonLast( UINT8 ubProfile, UINT32 uiQu
|
||||
|
||||
//Pass in an array of size NUM_MERCS_WITH_NEW_QUOTES, array will be filled with
|
||||
//random soldier IDs of the qualified mercs
|
||||
UINT8 RandomArrayOfQualifiedMercs( UINT8 *pRandomSoldierIdArray );
|
||||
UINT8 RandomArrayOfQualifiedMercs( SoldierID *pRandomSoldierIdArray );
|
||||
|
||||
|
||||
extern UINT8 Get3RandomQualifiedMercs( UINT8 *pSoldierId1, UINT8 *pSoldierId2, UINT8 *pSoldierId3 );
|
||||
extern UINT8 Get3RandomQualifiedMercs( SoldierID *pSoldierId1, SoldierID *pSoldierId2, SoldierID *pSoldierId3 );
|
||||
|
||||
void HandleWhenCertainPercentageOfEnemiesDie();
|
||||
|
||||
@@ -144,6 +143,10 @@ extern UINT8 RAUL_UB;
|
||||
extern UINT8 MORRIS_UB;
|
||||
extern UINT8 RUDY_UB;
|
||||
|
||||
extern INT16 BETTY_BLOODCAT_SECTOR_X;
|
||||
extern INT16 BETTY_BLOODCAT_SECTOR_Y;
|
||||
extern INT8 BETTY_BLOODCAT_SECTOR_Z;
|
||||
|
||||
extern void Old_UB_Inventory ();
|
||||
extern void New_UB_Inventory ();
|
||||
|
||||
@@ -151,4 +154,4 @@ extern void InitGridNoUB();
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+40
-44
@@ -1,39 +1,33 @@
|
||||
#include "builddefines.h"
|
||||
#include <stdio.h>
|
||||
#include <memory.h>
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "Keys.h"
|
||||
#include "debug.h"
|
||||
#include "Smoothing Utils.h"
|
||||
#include "DEBUG.H"
|
||||
#include "SkillCheck.h"
|
||||
#include "opplist.h"
|
||||
#include "items.h"
|
||||
#include "weapons.h"
|
||||
#include "Items.h"
|
||||
#include "Weapons.h"
|
||||
#include "ai.h"
|
||||
#include "message.h"
|
||||
#include "text.h"
|
||||
#include "explosion control.h"
|
||||
#include "isometric utils.h"
|
||||
#include "StrategicMap.h"
|
||||
#include "Text.h"
|
||||
#include "Explosion Control.h"
|
||||
#include "Isometric Utils.h"
|
||||
#include "strategicmap.h"
|
||||
#include "Tactical Save.h"
|
||||
#include "Campaign Types.h"
|
||||
#include "los.h"
|
||||
#include "opplist.h"
|
||||
#include "tiledat.h"
|
||||
#include "overhead.h"
|
||||
#include "LOS.h"
|
||||
#include "TileDat.h"
|
||||
#include "Overhead.h"
|
||||
#include "structure.h"
|
||||
#include "renderworld.h"
|
||||
#include "worldman.h"
|
||||
#include "wcheck.h"
|
||||
#include "WCheck.h"
|
||||
#include "random.h"
|
||||
#include "worlddef.h"
|
||||
#include "campaign.h"
|
||||
#include "Campaign.h"
|
||||
#include "Sound Control.h"
|
||||
#include "Interface.h"
|
||||
#include "Game Clock.h"
|
||||
#include "handle doors.h"
|
||||
#include "Handle Doors.h"
|
||||
#include "Map Screen Interface.h"
|
||||
#include "GameSettings.h" // added by SANDRO
|
||||
#include "Dialogue Control.h" // added by Flugente
|
||||
@@ -1390,11 +1384,11 @@ DOOR_STATUS *GetDoorStatus( INT32 sGridNo )
|
||||
|
||||
BOOLEAN AllMercsLookForDoor( INT32 sGridNo, BOOLEAN fUpdateValue )
|
||||
{
|
||||
INT32 cnt, cnt2;
|
||||
INT8 bDirs[ 8 ] = { NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST };
|
||||
SOLDIERTYPE *pSoldier;
|
||||
DOOR_STATUS *pDoorStatus;
|
||||
INT32 usNewGridNo;
|
||||
INT32 cnt2;
|
||||
INT8 bDirs[ 8 ] = { NORTH, SOUTH, EAST, WEST, NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST };
|
||||
SOLDIERTYPE *pSoldier;
|
||||
DOOR_STATUS *pDoorStatus;
|
||||
INT32 usNewGridNo;
|
||||
|
||||
// Get door
|
||||
pDoorStatus = GetDoorStatus( sGridNo );
|
||||
@@ -1405,11 +1399,12 @@ BOOLEAN AllMercsLookForDoor( INT32 sGridNo, BOOLEAN fUpdateValue )
|
||||
}
|
||||
|
||||
// IF IT'S THE SELECTED GUY, MAKE ANOTHER SELECTED!
|
||||
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
SoldierID cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
|
||||
// look for all mercs on the same team,
|
||||
for ( pSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; cnt++,pSoldier++ )
|
||||
for ( ; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++cnt )
|
||||
{
|
||||
pSoldier = cnt;
|
||||
// ATE: Ok, lets check for some basic things here!
|
||||
if ( pSoldier->stats.bLife >= OKLIFE && !TileIsOutOfBounds(pSoldier->sGridNo) && pSoldier->bActive && pSoldier->bInSector )
|
||||
{
|
||||
@@ -2070,11 +2065,10 @@ BOOLEAN LoadKeyTableFromSaveedGameFile( HWFILE hFile, UINT32 uiSaveGameVersion )
|
||||
|
||||
void ExamineDoorsOnEnteringSector( )
|
||||
{
|
||||
INT32 cnt;
|
||||
DOOR_STATUS *pDoorStatus;
|
||||
SOLDIERTYPE *pSoldier;
|
||||
BOOLEAN fOK = FALSE;
|
||||
INT8 bTownId;
|
||||
DOOR_STATUS *pDoorStatus;
|
||||
SOLDIERTYPE *pSoldier;
|
||||
BOOLEAN fOK = FALSE;
|
||||
INT8 bTownId;
|
||||
|
||||
// OK, only do this if conditions are met....
|
||||
// If this is any omerta tow, don't do it...
|
||||
@@ -2093,10 +2087,11 @@ void ExamineDoorsOnEnteringSector( )
|
||||
|
||||
// there is at least one human being in that sector.
|
||||
// check for civ
|
||||
cnt = gTacticalStatus.Team[ ENEMY_TEAM ].bFirstID;
|
||||
SoldierID cnt = gTacticalStatus.Team[ ENEMY_TEAM ].bFirstID;
|
||||
// look for all mercs on the same team,
|
||||
for ( pSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ LAST_TEAM ].bLastID; cnt++ ,pSoldier++ )
|
||||
for ( ; cnt <= gTacticalStatus.Team[ LAST_TEAM ].bLastID; ++cnt )
|
||||
{
|
||||
pSoldier = cnt;
|
||||
if ( pSoldier->bActive )
|
||||
{
|
||||
if ( pSoldier->bInSector )
|
||||
@@ -2110,7 +2105,7 @@ void ExamineDoorsOnEnteringSector( )
|
||||
// Let's do it!
|
||||
if ( fOK )
|
||||
{
|
||||
for ( cnt = 0; cnt < gubNumDoorStatus; cnt++ )
|
||||
for ( UINT8 cnt = 0; cnt < gubNumDoorStatus; cnt++ )
|
||||
{
|
||||
pDoorStatus = &( gpDoorStatus[ cnt ] );
|
||||
|
||||
@@ -2126,12 +2121,11 @@ void ExamineDoorsOnEnteringSector( )
|
||||
|
||||
void HandleDoorsChangeWhenEnteringSectorCurrentlyLoaded( )
|
||||
{
|
||||
INT32 cnt;
|
||||
DOOR_STATUS *pDoorStatus;
|
||||
SOLDIERTYPE *pSoldier;
|
||||
BOOLEAN fOK = FALSE;
|
||||
INT32 iNumNewMercs = 0;
|
||||
INT8 bTownId;
|
||||
DOOR_STATUS *pDoorStatus;
|
||||
SOLDIERTYPE *pSoldier;
|
||||
BOOLEAN fOK = FALSE;
|
||||
INT32 iNumNewMercs = 0;
|
||||
INT8 bTownId;
|
||||
|
||||
// OK, only do this if conditions are met....
|
||||
|
||||
@@ -2145,7 +2139,7 @@ void HandleDoorsChangeWhenEnteringSectorCurrentlyLoaded( )
|
||||
|
||||
// 1 ) there is at least one human being in that sector.
|
||||
// check for civ
|
||||
cnt = gTacticalStatus.Team[ ENEMY_TEAM ].bFirstID;
|
||||
SoldierID cnt = gTacticalStatus.Team[ ENEMY_TEAM ].bFirstID;
|
||||
|
||||
// Check time...
|
||||
if ( ( GetWorldTotalMin( ) - gTacticalStatus.uiTimeSinceLastInTactical ) < 30 )
|
||||
@@ -2154,8 +2148,9 @@ void HandleDoorsChangeWhenEnteringSectorCurrentlyLoaded( )
|
||||
}
|
||||
|
||||
// look for all mercs on the same team,
|
||||
for ( pSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ LAST_TEAM ].bLastID; cnt++ ,pSoldier++ )
|
||||
for ( ; cnt <= gTacticalStatus.Team[ LAST_TEAM ].bLastID; ++cnt )
|
||||
{
|
||||
pSoldier = cnt;
|
||||
if ( pSoldier->bActive && pSoldier->bInSector )
|
||||
{
|
||||
fOK = TRUE;
|
||||
@@ -2165,8 +2160,9 @@ void HandleDoorsChangeWhenEnteringSectorCurrentlyLoaded( )
|
||||
|
||||
// Loop through our team now....
|
||||
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
for ( pSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; cnt++ ,pSoldier++ )
|
||||
for ( ; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++cnt )
|
||||
{
|
||||
pSoldier = cnt;
|
||||
if ( pSoldier->bActive && pSoldier->bInSector && gbMercIsNewInThisSector[ cnt ] )
|
||||
{
|
||||
iNumNewMercs++;
|
||||
@@ -2182,7 +2178,7 @@ void HandleDoorsChangeWhenEnteringSectorCurrentlyLoaded( )
|
||||
// Let's do it!
|
||||
if ( fOK )
|
||||
{
|
||||
for ( cnt = 0; cnt < gubNumDoorStatus; cnt++ )
|
||||
for ( UINT8 cnt = 0; cnt < gubNumDoorStatus; cnt++ )
|
||||
{
|
||||
pDoorStatus = &( gpDoorStatus[ cnt ] );
|
||||
|
||||
|
||||
+1
-1
@@ -281,4 +281,4 @@ void AttachStringToDoor( INT32 sGridNo );
|
||||
|
||||
void DropKeysInKeyRing( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, INT8 bVisible, BOOLEAN fAddToDropList, INT32 iDropListSlot, BOOLEAN fUseUnLoaded );
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+93
-101
@@ -1,51 +1,42 @@
|
||||
#include "connect.h"
|
||||
#include "builddefines.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#include <memory.h>
|
||||
#include <math.h>
|
||||
#include "wcheck.h"
|
||||
#include "WCheck.h"
|
||||
#include "Isometric Utils.h"
|
||||
#include "debug.h"
|
||||
#include "los.h"
|
||||
#include "animation control.h"
|
||||
#include "Random.h"
|
||||
//#include "soldier control.h"
|
||||
#include "DEBUG.H"
|
||||
#include "LOS.h"
|
||||
#include "Animation Control.h"
|
||||
#include "random.h"
|
||||
#include "Event Pump.h"
|
||||
#include "overhead.h"
|
||||
#include "weapons.h"
|
||||
|
||||
#include "Overhead.h"
|
||||
#include "Weapons.h"
|
||||
#include "opplist.h"
|
||||
#include "bullets.h"
|
||||
|
||||
#include "Bullets.h"
|
||||
#include "lighting.h"
|
||||
#include "phys math.h"
|
||||
#include "items.h"
|
||||
#include "Items.h"
|
||||
#include "Soldier Profile.h"
|
||||
#include "worldman.h"
|
||||
#include "rotting corpses.h"
|
||||
#include "Rotting Corpses.h"
|
||||
#include "GameSettings.h"
|
||||
#include "keys.h"
|
||||
#include "Keys.h"
|
||||
#include "message.h"
|
||||
#include "Structure Wrap.h"
|
||||
#include "campaign.h"
|
||||
#include "Campaign.h"
|
||||
#include "environment.h"
|
||||
#include "Pathai.h"
|
||||
#include "PATHAI.H"
|
||||
#include "Soldier macros.h"
|
||||
#include "strategicmap.h"
|
||||
#include "Interface.h"
|
||||
#include "points.h"
|
||||
#include "Points.h"
|
||||
#include "Smell.h"
|
||||
#include "Text.h"
|
||||
#include "Quests.h"
|
||||
#include "items.h"
|
||||
#include "Item Types.h"
|
||||
#include "Vehicles.h"
|
||||
#include "fresh_header.h"
|
||||
#include "WorldDat.h"
|
||||
// HEADROCK HAM 3.6: This must be included, for testing whether Bloodcats and Enemies can see one another.
|
||||
#include "Campaign Types.h"
|
||||
#include "soldier tile.h" // added by Flugente
|
||||
#include "Sound Control.h" // added by Flugente
|
||||
#include "Soldier Functions.h" // added by Flugente for DoesSoldierWearGasMask(...)
|
||||
#include "CampaignStats.h" // added by Flugente
|
||||
@@ -2435,7 +2426,7 @@ INT32 SoldierTo3DLocationLineOfSightTest( SOLDIERTYPE * pStartSoldier, INT32 sGr
|
||||
{
|
||||
FLOAT dStartZPos, dEndZPos;
|
||||
INT16 sX, sY, sX2, sY2;
|
||||
UINT8 ubTargetID;
|
||||
SoldierID ubTargetID;
|
||||
BOOLEAN fOk;
|
||||
|
||||
CHECKF( pStartSoldier );
|
||||
@@ -2455,7 +2446,7 @@ INT32 SoldierTo3DLocationLineOfSightTest( SOLDIERTYPE * pStartSoldier, INT32 sGr
|
||||
if (ubTargetID != NOBODY)
|
||||
{
|
||||
// there's a merc there; do a soldier-to-soldier test
|
||||
return( SoldierToSoldierLineOfSightTest( pStartSoldier, MercPtrs[ubTargetID], bAware, iTileSightLimit, LOS_POS, adjustForSight) );
|
||||
return( SoldierToSoldierLineOfSightTest( pStartSoldier, ubTargetID, bAware, iTileSightLimit, LOS_POS, adjustForSight) );
|
||||
}
|
||||
// else... assume standing height
|
||||
dEndZPos = STANDING_LOS_POS + bLevel * HEIGHT_UNITS;
|
||||
@@ -3436,7 +3427,7 @@ BOOLEAN BulletHitMerc( BULLET * pBullet, STRUCTURE * pStructure, BOOLEAN fIntend
|
||||
// be legal, but the bLevel May change...
|
||||
sNewGridNo = NewGridNo( pBullet->sGridNo, DirectionInc( gOppositeDirection[ SWeaponHit.usDirection ] ) );
|
||||
|
||||
bSpewBloodLevel = MercPtrs[ SWeaponHit.usSoldierID ]->pathing.bLevel;
|
||||
bSpewBloodLevel = SWeaponHit.usSoldierID->pathing.bLevel;
|
||||
fCanSpewBlood = TRUE;
|
||||
|
||||
// If on anything other than bLevel of 0, we can pretty much freely spew blood
|
||||
@@ -4390,7 +4381,7 @@ UINT8 SoldierToSoldierBodyPartChanceToGetThrough( SOLDIERTYPE * pStartSoldier, S
|
||||
return( ChanceToGetThrough( pStartSoldier, (FLOAT) sX, (FLOAT) sY, dEndZPos ) );
|
||||
}
|
||||
|
||||
UINT8 SoldierToLocationChanceToGetThrough( SOLDIERTYPE * pStartSoldier, INT32 sGridNo, INT8 bLevel, INT8 bCubeLevel, UINT8 ubTargetID )
|
||||
UINT8 SoldierToLocationChanceToGetThrough( SOLDIERTYPE * pStartSoldier, INT32 sGridNo, INT8 bLevel, INT8 bCubeLevel, SoldierID ubTargetID )
|
||||
{
|
||||
FLOAT dEndZPos;
|
||||
INT16 sXPos;
|
||||
@@ -4640,7 +4631,7 @@ void CalculateFiringIncrementsSimple( DOUBLE ddHorizAngle, DOUBLE ddVerticAngle,
|
||||
pBullet->qIncrZ = FloatToFixed( (FLOAT) ( sin( ddVerticAngle ) / sin( (PI/2) - ddVerticAngle ) * HEIGHTUNITS_PER_CELL ) );//dnl ch60 010913
|
||||
}
|
||||
|
||||
INT8 FireBullet( UINT8 ubFirer, BULLET * pBullet, BOOLEAN fFake )
|
||||
INT8 FireBullet( SoldierID ubFirer, BULLET * pBullet, BOOLEAN fFake )
|
||||
{
|
||||
//DebugMsg(TOPIC_JA2,DBG_LEVEL_3,String("FireBullet"));
|
||||
|
||||
@@ -4654,7 +4645,7 @@ INT8 FireBullet( UINT8 ubFirer, BULLET * pBullet, BOOLEAN fFake )
|
||||
pBullet->sGridNo = MAPROWCOLTOPOS( pBullet->iCurrTileY, pBullet->iCurrTileX );
|
||||
|
||||
if ( ubFirer != NOBODY )
|
||||
pBullet->pFirer = MercPtrs[ ubFirer ];
|
||||
pBullet->pFirer = ubFirer;
|
||||
else
|
||||
pBullet->pFirer = NULL;
|
||||
|
||||
@@ -4840,15 +4831,15 @@ INT8 FireBulletGivenTargetNCTH( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY,
|
||||
{
|
||||
usBulletFlags |= BULLET_FLAG_KNIFE;
|
||||
}
|
||||
else if ( Item[usHandItem].rocketlauncher )
|
||||
else if (ItemIsRocketLauncher(usHandItem))
|
||||
{
|
||||
usBulletFlags |= BULLET_FLAG_MISSILE;
|
||||
}
|
||||
else if ( Item[usHandItem].cannon )
|
||||
else if (ItemIsCannon(usHandItem))
|
||||
{
|
||||
usBulletFlags |= BULLET_FLAG_TANK_CANNON;
|
||||
}
|
||||
else if ( Item[usHandItem].rocketrifle )
|
||||
else if (ItemIsRocketRifle(usHandItem))
|
||||
{
|
||||
usBulletFlags |= BULLET_FLAG_SMALL_MISSILE;
|
||||
}
|
||||
@@ -4907,7 +4898,7 @@ INT8 FireBulletGivenTargetNCTH( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY,
|
||||
ubImpact = (UINT8) (ubImpact * AmmoTypes[weapon->gun.ubGunAmmoType].multipleBulletDamageMultiplier / max(1,AmmoTypes[weapon->gun.ubGunAmmoType].multipleBulletDamageDivisor) );
|
||||
if (pFirer->ubTargetID != NOBODY)
|
||||
{
|
||||
MercPtrs[ pFirer->ubTargetID ]->bNumPelletsHitBy = 0;
|
||||
pFirer->ubTargetID->bNumPelletsHitBy = 0;
|
||||
}
|
||||
}
|
||||
weapon=NULL;
|
||||
@@ -5118,7 +5109,7 @@ INT8 FireBulletGivenTargetNCTH( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY,
|
||||
fprintf(OutFile, "{ % 9.8f , % 9.8f , % 9.8f , % 9.8f }, //DEBUG: merc %4d fired pellet %4d of %4d using method %4d %12s with SpreadPattern %4d %s\n",
|
||||
ddRawHorizAngle, ddRawVerticAngle,
|
||||
ddHorizAngle, ddVerticAngle,
|
||||
pFirer->ubID, ubLoop, ubShots,
|
||||
pFirer->ubID.i, ubLoop, ubShots,
|
||||
gpSpreadPattern[ubSpreadIndex].method, gSpreadPatternMethodNames[gpSpreadPattern[ubSpreadIndex].method],
|
||||
ubSpreadIndex, gpSpreadPattern[ubSpreadIndex].Name,
|
||||
NULL
|
||||
@@ -5237,7 +5228,7 @@ INT8 FireBulletGivenTargetNCTH( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY,
|
||||
if( !fFake && ( pFirer->ubProfile != NO_PROFILE ) && ( pFirer->bTeam == gbPlayerNum ) )
|
||||
{
|
||||
// another shot fired
|
||||
if ( Item[usHandItem].usItemClass == IC_LAUNCHER || Item[usHandItem].grenadelauncher || Item[usHandItem].rocketlauncher || Item[usHandItem].singleshotrocketlauncher || Item[usHandItem].mortar)
|
||||
if ( Item[usHandItem].usItemClass == IC_LAUNCHER || ItemIsGrenadeLauncher(usHandItem) || ItemIsRocketLauncher(usHandItem) || ItemIsSingleShotRocketLauncher(usHandItem) || ItemIsMortar(usHandItem))
|
||||
gMercProfiles[ pFirer->ubProfile ].records.usMissilesLaunched++;
|
||||
else if ( Item[usHandItem].usItemClass == IC_THROWING_KNIFE )
|
||||
gMercProfiles[ pFirer->ubProfile ].records.usKnivesThrown++;
|
||||
@@ -5335,15 +5326,15 @@ INT8 FireBulletGivenTarget( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY, FLOA
|
||||
{
|
||||
usBulletFlags |= BULLET_FLAG_KNIFE;
|
||||
}
|
||||
else if ( Item[usHandItem].rocketlauncher )
|
||||
else if (ItemIsRocketLauncher(usHandItem))
|
||||
{
|
||||
usBulletFlags |= BULLET_FLAG_MISSILE;
|
||||
}
|
||||
else if ( Item[usHandItem].cannon )
|
||||
else if (ItemIsCannon(usHandItem))
|
||||
{
|
||||
usBulletFlags |= BULLET_FLAG_TANK_CANNON;
|
||||
}
|
||||
else if ( Item[usHandItem].rocketrifle )
|
||||
else if (ItemIsRocketRifle(usHandItem))
|
||||
{
|
||||
usBulletFlags |= BULLET_FLAG_SMALL_MISSILE;
|
||||
}
|
||||
@@ -5435,7 +5426,7 @@ INT8 FireBulletGivenTarget( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY, FLOA
|
||||
ubImpact = (UINT8) (ubImpact * AmmoTypes[weapon->gun.ubGunAmmoType].multipleBulletDamageMultiplier / max(1,AmmoTypes[weapon->gun.ubGunAmmoType].multipleBulletDamageDivisor) );
|
||||
if (pFirer->ubTargetID != NOBODY)
|
||||
{
|
||||
MercPtrs[ pFirer->ubTargetID ]->bNumPelletsHitBy = 0;
|
||||
pFirer->ubTargetID->bNumPelletsHitBy = 0;
|
||||
}
|
||||
}
|
||||
weapon=NULL;
|
||||
@@ -5639,7 +5630,7 @@ INT8 FireBulletGivenTarget( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY, FLOA
|
||||
fprintf(OutFile, "{ % 9.8f , % 9.8f , % 9.8f , % 9.8f }, //DEBUG: merc %4d fired pellet %4d of %4d using method %4d %12s with SpreadPattern %4d %s\n",
|
||||
ddRawHorizAngle, ddRawVerticAngle,
|
||||
ddHorizAngle, ddVerticAngle,
|
||||
pFirer->ubID, ubLoop, ubShots,
|
||||
pFirer->ubID.i, ubLoop, ubShots,
|
||||
gpSpreadPattern[ubSpreadIndex].method, gSpreadPatternMethodNames[gpSpreadPattern[ubSpreadIndex].method],
|
||||
ubSpreadIndex, gpSpreadPattern[ubSpreadIndex].Name
|
||||
);
|
||||
@@ -5753,7 +5744,7 @@ INT8 FireBulletGivenTarget( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY, FLOA
|
||||
if( !fFake && ( pFirer->ubProfile != NO_PROFILE ) && ( pFirer->bTeam == gbPlayerNum ) )
|
||||
{
|
||||
// another shot fired
|
||||
if ( Item[usHandItem].usItemClass == IC_LAUNCHER || Item[usHandItem].grenadelauncher || Item[usHandItem].rocketlauncher || Item[usHandItem].singleshotrocketlauncher || Item[usHandItem].mortar)
|
||||
if ( Item[usHandItem].usItemClass == IC_LAUNCHER || ItemIsGrenadeLauncher(usHandItem) || ItemIsRocketLauncher(usHandItem) || ItemIsSingleShotRocketLauncher(usHandItem) || ItemIsMortar(usHandItem))
|
||||
gMercProfiles[ pFirer->ubProfile ].records.usMissilesLaunched++;
|
||||
else if ( Item[usHandItem].usItemClass == IC_THROWING_KNIFE )
|
||||
gMercProfiles[ pFirer->ubProfile ].records.usKnivesThrown++;
|
||||
@@ -5775,7 +5766,7 @@ INT8 FireBulletGivenTarget( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY, FLOA
|
||||
// Note that this function does not make provisions for Fake Firing. There is no need for it, and it would needlessly
|
||||
// complicate things anyway.
|
||||
// Also note we receive start coordinates from the bomb itself, because there's nowhere else to get them.
|
||||
INT8 FireFragmentGivenTarget( UINT8 ubOwner, FLOAT dStartX, FLOAT dStartY, FLOAT dStartZ, FLOAT dEndX, FLOAT dEndY, FLOAT dEndZ, UINT16 usExplosiveItem )
|
||||
INT8 FireFragmentGivenTarget( SoldierID ubOwner, FLOAT dStartX, FLOAT dStartY, FLOAT dStartZ, FLOAT dEndX, FLOAT dEndY, FLOAT dEndZ, UINT16 usExplosiveItem )
|
||||
{
|
||||
// Artificial...
|
||||
dStartZ++;
|
||||
@@ -6007,15 +5998,15 @@ INT8 FireBulletGivenTargetTrapOnly( SOLDIERTYPE* pThrower, OBJECTTYPE* pObj, INT
|
||||
{
|
||||
usBulletFlags |= BULLET_FLAG_KNIFE;
|
||||
}
|
||||
else if ( Item[usItem].rocketlauncher )
|
||||
else if (ItemIsRocketLauncher(usItem))
|
||||
{
|
||||
usBulletFlags |= BULLET_FLAG_MISSILE;
|
||||
}
|
||||
else if ( Item[usItem].cannon )
|
||||
else if (ItemIsCannon(usItem))
|
||||
{
|
||||
usBulletFlags |= BULLET_FLAG_TANK_CANNON;
|
||||
}
|
||||
else if ( Item[usItem].rocketrifle )
|
||||
else if (ItemIsRocketRifle(usItem))
|
||||
{
|
||||
usBulletFlags |= BULLET_FLAG_SMALL_MISSILE;
|
||||
}
|
||||
@@ -6284,7 +6275,7 @@ INT8 FireBulletGivenTargetTrapOnly( SOLDIERTYPE* pThrower, OBJECTTYPE* pObj, INT
|
||||
fprintf(OutFile, "{ % 9.8f , % 9.8f , % 9.8f , % 9.8f }, //DEBUG: merc %4d fired pellet %4d of %4d using method %4d %12s with SpreadPattern %4d %s\n",
|
||||
ddRawHorizAngle, ddRawVerticAngle,
|
||||
ddHorizAngle, ddVerticAngle,
|
||||
NOBODY, ubLoop, ubShots,
|
||||
NOBODY.i, ubLoop, ubShots,
|
||||
gpSpreadPattern[ubSpreadIndex].method, gSpreadPatternMethodNames[gpSpreadPattern[ubSpreadIndex].method],
|
||||
ubSpreadIndex, gpSpreadPattern[ubSpreadIndex].Name
|
||||
);
|
||||
@@ -6594,15 +6585,15 @@ INT8 FireBulletGivenTarget_NoObjectNoSoldier( UINT16 usItem, UINT8 ammotype, UIN
|
||||
{
|
||||
usBulletFlags |= BULLET_FLAG_KNIFE;
|
||||
}
|
||||
else if ( Item[usItem].rocketlauncher )
|
||||
else if (ItemIsRocketLauncher(usItem))
|
||||
{
|
||||
usBulletFlags |= BULLET_FLAG_MISSILE;
|
||||
}
|
||||
else if ( Item[usItem].cannon )
|
||||
else if (ItemIsCannon(usItem))
|
||||
{
|
||||
usBulletFlags |= BULLET_FLAG_TANK_CANNON;
|
||||
}
|
||||
else if ( Item[usItem].rocketrifle )
|
||||
else if (ItemIsRocketRifle(usItem))
|
||||
{
|
||||
usBulletFlags |= BULLET_FLAG_SMALL_MISSILE;
|
||||
}
|
||||
@@ -6834,7 +6825,7 @@ INT8 FireBulletGivenTarget_NoObjectNoSoldier( UINT16 usItem, UINT8 ammotype, UIN
|
||||
fprintf( OutFile, "{ % 9.8f , % 9.8f , % 9.8f , % 9.8f }, //DEBUG: merc %4d fired pellet %4d of %4d using method %4d %12s with SpreadPattern %4d %s\n",
|
||||
ddRawHorizAngle, ddRawVerticAngle,
|
||||
ddHorizAngle, ddVerticAngle,
|
||||
NOBODY, ubLoop, ubShots,
|
||||
NOBODY.i, ubLoop, ubShots,
|
||||
gpSpreadPattern[ubSpreadIndex].method, gSpreadPatternMethodNames[gpSpreadPattern[ubSpreadIndex].method],
|
||||
ubSpreadIndex, gpSpreadPattern[ubSpreadIndex].Name
|
||||
);
|
||||
@@ -6923,7 +6914,7 @@ INT8 ChanceToGetThrough(SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY, FLOAT dE
|
||||
// sevenfm: check that weapon exists!
|
||||
if (pObjHand->exists() &&
|
||||
pObjHand->usItem == pFirer->usAttackingWeapon &&
|
||||
(Item[pFirer->usAttackingWeapon].usItemClass == IC_GUN || Item[pFirer->usAttackingWeapon].usItemClass == IC_THROWING_KNIFE || Item[pFirer->usAttackingWeapon].rocketlauncher))
|
||||
(Item[pFirer->usAttackingWeapon].usItemClass == IC_GUN || Item[pFirer->usAttackingWeapon].usItemClass == IC_THROWING_KNIFE || ItemIsRocketLauncher(pFirer->usAttackingWeapon)))
|
||||
{
|
||||
BOOLEAN fBuckShot = FALSE;
|
||||
|
||||
@@ -6951,7 +6942,7 @@ INT8 ChanceToGetThrough(SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY, FLOAT dE
|
||||
// sevenfm: additionally initialize usAttackingWeapon, ubTargetID, bDoBurst and bDoAutofire which are used by FireBulletGivenTarget()
|
||||
UINT16 oldAttackingWeapon = pFirer->usAttackingWeapon;
|
||||
UINT8 oldAttackingHand = pFirer->ubAttackingHand;
|
||||
UINT8 oldTargetID = pFirer->ubTargetID;
|
||||
SoldierID oldTargetID = pFirer->ubTargetID;
|
||||
INT8 oldBurst = pFirer->bDoBurst;
|
||||
INT8 oldAutofire = pFirer->bDoAutofire;
|
||||
|
||||
@@ -6986,9 +6977,8 @@ INT8 ChanceToGetThrough(SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY, FLOAT dE
|
||||
|
||||
void MoveBullet( INT32 iBullet )
|
||||
{
|
||||
BULLET *pBullet;
|
||||
|
||||
FIXEDPT qLandHeight;
|
||||
BULLET *pBullet;
|
||||
FIXEDPT qLandHeight;
|
||||
INT32 iCurrAboveLevelZ;
|
||||
INT32 iCurrCubesAboveLevelZ;
|
||||
INT16 sDesiredLevel;
|
||||
@@ -6997,48 +6987,48 @@ void MoveBullet( INT32 iBullet )
|
||||
INT32 iOldTileY;
|
||||
INT32 iOldCubesZ;
|
||||
|
||||
MAP_ELEMENT * pMapElement;
|
||||
STRUCTURE * pStructure;
|
||||
STRUCTURE * pRoofStructure = NULL;
|
||||
MAP_ELEMENT *pMapElement;
|
||||
STRUCTURE *pStructure;
|
||||
STRUCTURE *pRoofStructure = NULL;
|
||||
|
||||
FIXEDPT qLastZ;
|
||||
FIXEDPT qLastZ;
|
||||
|
||||
SOLDIERTYPE * pTarget;
|
||||
UINT8 ubTargetID;
|
||||
BOOLEAN fIntended;
|
||||
BOOLEAN fStopped;
|
||||
INT8 bOldLOSIndexX;
|
||||
INT8 bOldLOSIndexY;
|
||||
SOLDIERTYPE *pTarget;
|
||||
SoldierID ubTargetID;
|
||||
BOOLEAN fIntended;
|
||||
BOOLEAN fStopped;
|
||||
INT8 bOldLOSIndexX;
|
||||
INT8 bOldLOSIndexY;
|
||||
|
||||
UINT32 uiTileInc = 0;
|
||||
UINT32 uiTime;
|
||||
UINT32 uiTileInc = 0;
|
||||
UINT32 uiTime;
|
||||
|
||||
INT8 bDir;
|
||||
INT32 iGridNo, iAdjGridNo;
|
||||
INT8 bDir;
|
||||
INT32 iGridNo, iAdjGridNo;
|
||||
|
||||
INT32 iRemainingImpact;
|
||||
INT32 iRemainingImpact;
|
||||
|
||||
FIXEDPT qDistToTravelX;
|
||||
FIXEDPT qDistToTravelY;
|
||||
INT32 iStepsToTravelX;
|
||||
INT32 iStepsToTravelY;
|
||||
INT32 iStepsToTravel;
|
||||
FIXEDPT qDistToTravelX;
|
||||
FIXEDPT qDistToTravelY;
|
||||
INT32 iStepsToTravelX;
|
||||
INT32 iStepsToTravelY;
|
||||
INT32 iStepsToTravel;
|
||||
|
||||
INT32 iNumLocalStructures;
|
||||
INT32 iStructureLoop;
|
||||
UINT32 uiChanceOfHit;
|
||||
INT32 iNumLocalStructures;
|
||||
INT32 iStructureLoop;
|
||||
UINT32 uiChanceOfHit;
|
||||
|
||||
BOOLEAN fResolveHit;
|
||||
BOOLEAN fResolveHit;
|
||||
|
||||
INT32 i;
|
||||
BOOLEAN fGoingOver = FALSE;
|
||||
BOOLEAN fHitStructure;
|
||||
INT32 i;
|
||||
BOOLEAN fGoingOver = FALSE;
|
||||
BOOLEAN fHitStructure;
|
||||
|
||||
FIXEDPT qWallHeight;
|
||||
FIXEDPT qWindowBottomHeight;
|
||||
FIXEDPT qWindowTopHeight;
|
||||
FIXEDPT qWallHeight;
|
||||
FIXEDPT qWindowBottomHeight;
|
||||
FIXEDPT qWindowTopHeight;
|
||||
|
||||
UINT16 lastriotshieldholder = NOBODY; // added by Flugente
|
||||
SoldierID lastriotshieldholder = NOBODY; // added by Flugente
|
||||
|
||||
pBullet = GetBulletPtr( iBullet );
|
||||
|
||||
@@ -7224,8 +7214,10 @@ void MoveBullet( INT32 iBullet )
|
||||
}
|
||||
else if (pStructure->fFlags & STRUCTURE_PERSON)
|
||||
{
|
||||
SOLDIERTYPE *pSoldier = MercPtrs[pStructure->usStructureID];
|
||||
|
||||
// HEADROCK HAM 5: Fragments can hit the shooter.
|
||||
if ( MercPtrs[ pStructure->usStructureID ] != pBullet->pFirer || pBullet->fFragment == TRUE )
|
||||
if ( pSoldier != pBullet->pFirer || pBullet->fFragment == TRUE )
|
||||
{
|
||||
// in actually moving the bullet, we consider only count friends as targets if the bullet is unaimed
|
||||
// (buckshot), if they are the intended target, or beyond the range of automatic friendly fire hits
|
||||
@@ -7244,13 +7236,13 @@ void MoveBullet( INT32 iBullet )
|
||||
else if ( pBullet->pFirer->flags.uiStatusFlags & SOLDIER_MONSTER )
|
||||
{
|
||||
// monsters firing will always accidentally hit people but never accidentally hit each other.
|
||||
if ( !(MercPtrs[ pStructure->usStructureID ]->flags.uiStatusFlags & SOLDIER_MONSTER) )
|
||||
if ( !(pSoldier->flags.uiStatusFlags & SOLDIER_MONSTER) )
|
||||
{
|
||||
gpLocalStructure[iNumLocalStructures] = pStructure;
|
||||
iNumLocalStructures++;
|
||||
}
|
||||
}
|
||||
else if (MercPtrs[pStructure->usStructureID]->bVisible == TRUE &&
|
||||
else if (pSoldier->bVisible == TRUE &&
|
||||
PositionAllowsHit(pBullet, pStructure) &&
|
||||
(pBullet->fAimed && pBullet->iLoop > MIN_DIST_FOR_HIT_FRIENDS ||
|
||||
!pBullet->fAimed && pBullet->iLoop > MIN_DIST_FOR_HIT_FRIENDS_UNAIMED ||
|
||||
@@ -7262,16 +7254,16 @@ void MoveBullet( INT32 iBullet )
|
||||
}
|
||||
|
||||
// this might be a close call
|
||||
if ( pBullet->ubFirerID != NOBODY && MercPtrs[ pStructure->usStructureID ]->bTeam == gbPlayerNum && pBullet->pFirer->bTeam != gbPlayerNum && sDesiredLevel == MercPtrs[ pStructure->usStructureID ]->pathing.bLevel )
|
||||
if ( pBullet->ubFirerID != NOBODY && pSoldier->bTeam == gbPlayerNum && pBullet->pFirer->bTeam != gbPlayerNum && sDesiredLevel == pSoldier->pathing.bLevel )
|
||||
{
|
||||
MercPtrs[ pStructure->usStructureID ]->flags.fCloseCall = TRUE;
|
||||
pSoldier->flags.fCloseCall = TRUE;
|
||||
}
|
||||
|
||||
if ( IS_MERC_BODY_TYPE( MercPtrs[pStructure->usStructureID] ) )
|
||||
if ( IS_MERC_BODY_TYPE( pSoldier ) )
|
||||
{
|
||||
// apply suppression, regardless of friendly or enemy
|
||||
// except if friendly, not within a few tiles of shooter
|
||||
if (pBullet->ubFirerID == NOBODY || MercPtrs[pStructure->usStructureID]->bSide != pBullet->pFirer->bSide || pBullet->iLoop > gGameExternalOptions.usMinDistanceFriendlySuppression)
|
||||
if (pBullet->ubFirerID == NOBODY || pSoldier->bSide != pBullet->pFirer->bSide || pBullet->iLoop > gGameExternalOptions.usMinDistanceFriendlySuppression)
|
||||
{
|
||||
// buckshot has only a 1 in 2 chance of applying a suppression point
|
||||
// HEADROCK HAM 5: For NCTH, make pellets as effective as any other bullet.
|
||||
@@ -7280,7 +7272,7 @@ void MoveBullet( INT32 iBullet )
|
||||
if (!(pBullet->usFlags & BULLET_FLAG_BUCKSHOT) || Chance(gGameExternalOptions.ubBuckshotSuppressionEffectiveness))
|
||||
{
|
||||
// bullet goes whizzing by this guy!
|
||||
switch ( gAnimControl[ MercPtrs[pStructure->usStructureID]->usAnimState ].ubEndHeight )
|
||||
switch ( gAnimControl[ pSoldier->usAnimState ].ubEndHeight )
|
||||
{
|
||||
case ANIM_PRONE:
|
||||
// two 1/4 chances of avoiding suppression pt - one below
|
||||
@@ -7297,8 +7289,8 @@ void MoveBullet( INT32 iBullet )
|
||||
}
|
||||
// else fall through
|
||||
default:
|
||||
MercPtrs[pStructure->usStructureID]->ubSuppressionPoints++;
|
||||
MercPtrs[pStructure->usStructureID]->ubSuppressorID = pBullet->ubFirerID;
|
||||
pSoldier->ubSuppressionPoints++;
|
||||
pSoldier->ubSuppressorID = pBullet->ubFirerID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -7358,7 +7350,7 @@ void MoveBullet( INT32 iBullet )
|
||||
ubTargetID = WhoIsThere2( iAdjGridNo, (INT8) sDesiredLevel );
|
||||
if (ubTargetID != NOBODY)
|
||||
{
|
||||
pTarget = MercPtrs[ ubTargetID ];
|
||||
pTarget = ubTargetID;
|
||||
if ( IS_MERC_BODY_TYPE( pTarget ) && (pBullet->ubFirerID == NOBODY || pBullet->pFirer->bSide != pTarget->bSide) )
|
||||
{
|
||||
// buckshot has only a 1 in 2 chance of applying a suppression point
|
||||
@@ -8643,7 +8635,7 @@ void AdjustTargetCenterPoint( SOLDIERTYPE *pShooter, INT32 iTargetGridNo, FLOAT
|
||||
|
||||
//INT32 iLaserRange = GetBestLaserRange(&(pShooter->inv[pSoldier->ubAttackingHand]));
|
||||
INT16 sLaserRange = GetBestLaserRange(pWeapon);
|
||||
if (AM_A_ROBOT(pShooter) && Item[pShooter->inv[ROBOT_TARGETING_SLOT].usItem].fProvidesRobotLaserBonus)
|
||||
if (AM_A_ROBOT(pShooter) && ItemProvidesRobotLaserBonus(pShooter->inv[ROBOT_TARGETING_SLOT].usItem))
|
||||
{
|
||||
sLaserRange = max(sLaserRange, GetBestLaserRange(&pShooter->inv[ROBOT_TARGETING_SLOT]));
|
||||
}
|
||||
@@ -9911,7 +9903,7 @@ UINT32 CalcCounterForceAccuracy(SOLDIERTYPE *pShooter, OBJECTTYPE *pWeapon, UINT
|
||||
// If we can't see the target, but buddies can see it, CF-Accuracy drops by 50%
|
||||
// If we can't see the target and neither can buddies, CF-Accuracy drops by 75%
|
||||
|
||||
UINT8 ubTargetID = WhoIsThere2( pShooter->sTargetGridNo, pShooter->bTargetLevel ); // Target ubID
|
||||
SoldierID ubTargetID = WhoIsThere2( pShooter->sTargetGridNo, pShooter->bTargetLevel ); // Target ubID
|
||||
INT16 sDistVis = pShooter->GetMaxDistanceVisible(pShooter->sTargetGridNo, pShooter->bTargetLevel, CALC_FROM_ALL_DIRS ) * CELL_X_SIZE;
|
||||
gbForceWeaponNotReady = true;
|
||||
INT16 sDistVisNoScope = pShooter->GetMaxDistanceVisible(pShooter->sTargetGridNo, pShooter->bTargetLevel, CALC_FROM_ALL_DIRS ) * CELL_X_SIZE;
|
||||
@@ -9920,12 +9912,12 @@ UINT32 CalcCounterForceAccuracy(SOLDIERTYPE *pShooter, OBJECTTYPE *pWeapon, UINT
|
||||
|
||||
INT32 iSightRange = 0;
|
||||
if (ubTargetID != NOBODY)
|
||||
iSightRange = SoldierToSoldierLineOfSightTest( pShooter, MercPtrs[ubTargetID], TRUE, NO_DISTANCE_LIMIT, pShooter->bAimShotLocation, false );
|
||||
iSightRange = SoldierToSoldierLineOfSightTest( pShooter, ubTargetID, TRUE, NO_DISTANCE_LIMIT, pShooter->bAimShotLocation, false );
|
||||
if (iSightRange == 0) { // didn't do a bodypart-based test or can't see specific body part aimed at
|
||||
iSightRange = SoldierTo3DLocationLineOfSightTest( pShooter, pShooter->sTargetGridNo, pShooter->bTargetLevel, pShooter->bTargetCubeLevel, TRUE, NO_DISTANCE_LIMIT, false );
|
||||
}
|
||||
if (iSightRange == 0) { // Can't see the target but we still need to know what the sight range would be if we could so we can deal with cover penalties
|
||||
iSightRange = SoldierToSoldierLineOfSightTest( pShooter, MercPtrs[ubTargetID], TRUE, NO_DISTANCE_LIMIT, pShooter->bAimShotLocation, false, true );
|
||||
iSightRange = SoldierToSoldierLineOfSightTest( pShooter, ubTargetID, TRUE, NO_DISTANCE_LIMIT, pShooter->bAimShotLocation, false, true );
|
||||
}
|
||||
|
||||
// Modify iSightRange for scope use
|
||||
|
||||
+4
-5
@@ -1,8 +1,7 @@
|
||||
#ifndef LOS_H
|
||||
#define LOS_H
|
||||
|
||||
//#define LOS_DEBUG
|
||||
#include "WorldDat.h" // needed for MAX_TILESETS
|
||||
#include "Soldier Control.h"
|
||||
|
||||
// fixed-point arithmetic definitions start here
|
||||
|
||||
@@ -69,7 +68,7 @@ INT8 FireBulletGivenTarget( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY, FLOA
|
||||
// HEADROCK HAM 4: Changed the name of one argument to avoid confusion with the new CTH system.
|
||||
INT8 FireBulletGivenTargetNCTH( SOLDIERTYPE * pFirer, FLOAT dEndX, FLOAT dEndY, FLOAT dEndZ, UINT16 usHandItem, INT16 sApertureRatio, BOOLEAN fBuckshot, BOOLEAN fFake );
|
||||
// HEADROCK HAM 5: Function for fragments ejected from an explosion.
|
||||
INT8 FireFragmentGivenTarget( UINT8 ubOwner, FLOAT dStartX, FLOAT dStartY, FLOAT dStartZ, FLOAT dEndX, FLOAT dEndY, FLOAT dEndZ, UINT16 usExplosiveItem );
|
||||
INT8 FireFragmentGivenTarget( SoldierID ubOwner, FLOAT dStartX, FLOAT dStartY, FLOAT dStartZ, FLOAT dEndX, FLOAT dEndY, FLOAT dEndZ, UINT16 usExplosiveItem );
|
||||
|
||||
// Flugente: fire a shot from a gun that has no user (used for traps with attached guns)
|
||||
INT8 FireBulletGivenTargetTrapOnly( SOLDIERTYPE* pThrower, OBJECTTYPE* pObj, INT32 gridno, FLOAT dStartZ, FLOAT dEndX, FLOAT dEndY, FLOAT dEndZ, INT16 sHitBy);
|
||||
@@ -152,7 +151,7 @@ UINT8 SoldierToSoldierChanceToGetThrough( SOLDIERTYPE * pStartSoldier, SOLDIERTY
|
||||
UINT8 SoldierToSoldierBodyPartChanceToGetThrough( SOLDIERTYPE * pStartSoldier, SOLDIERTYPE * pEndSoldier, UINT8 ubAimLocation );
|
||||
UINT8 AISoldierToSoldierChanceToGetThrough( SOLDIERTYPE * pStartSoldier, SOLDIERTYPE * pEndSoldier );
|
||||
UINT8 AISoldierToLocationChanceToGetThrough( SOLDIERTYPE * pStartSoldier, INT32 sGridNo, INT8 bLevel, INT8 bCubeLevel );
|
||||
UINT8 SoldierToLocationChanceToGetThrough( SOLDIERTYPE * pStartSoldier, INT32 sGridNo, INT8 bLevel, INT8 bCubeLevel, UINT8 ubTargetID );
|
||||
UINT8 SoldierToLocationChanceToGetThrough( SOLDIERTYPE * pStartSoldier, INT32 sGridNo, INT8 bLevel, INT8 bCubeLevel, SoldierID ubTargetID );
|
||||
INT32 SoldierToLocationWindowTest( SOLDIERTYPE * pStartSoldier, INT32 sEndGridNo );
|
||||
// sevenfm: AI LOS functions
|
||||
INT32 LOS_Raised(SOLDIERTYPE * pStartSoldier, SOLDIERTYPE * pEndSoldier, int iTileSightLimit = CALC_FROM_ALL_DIRS, UINT8 ubAimLocation = LOS_POS);
|
||||
@@ -261,4 +260,4 @@ void DamageRiotShield( SOLDIERTYPE* pSoldier, INT32& rsDamage, INT32& rsSecondar
|
||||
extern INT8 GetStealth(SOLDIERTYPE* pSoldier);
|
||||
extern INT8 GetSightAdjustmentBasedOnLBE(SOLDIERTYPE* pSoldier);
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -24,14 +24,15 @@ AbstractXMLLoader::ParseData* AbstractXMLLoader::MakeParseData(XML_Parser* parse
|
||||
return new ParseData(parser);
|
||||
}
|
||||
|
||||
bool AbstractXMLLoader::LoadFromFile(const char* directoryName, const char* fileName) {
|
||||
bool AbstractXMLLoader::LoadFromFile(const char* directoryName, const char* fileName, CHAR8* errorBuf) {
|
||||
HWFILE hFile;
|
||||
UINT32 uiBytesRead;
|
||||
UINT32 uiFSize;
|
||||
CHAR8* lpcBuffer;
|
||||
char fileNameFull[MAX_PATH + 1];
|
||||
if (strlen(fileName) + strlen(directoryName) >= MAX_PATH) {
|
||||
LiveMessage("Can't load file. Concatinated filename too long for buffer!");
|
||||
sprintf(errorBuf, "Can't load file %s%s, Concatenated filename too long for buffer!", directoryName, fileName);
|
||||
LiveMessage(errorBuf);
|
||||
return false;
|
||||
}
|
||||
SetDirectoryName(directoryName);
|
||||
@@ -46,12 +47,14 @@ bool AbstractXMLLoader::LoadFromFile(const char* directoryName, const char* file
|
||||
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, msg.c_str());
|
||||
hFile = FileOpen(fileNameFull, FILE_ACCESS_READ, FALSE);
|
||||
if (!hFile) {
|
||||
sprintf(errorBuf, "Can't open %s", fileNameFull);
|
||||
delete data;
|
||||
return false;
|
||||
}
|
||||
uiFSize = FileGetSize(hFile);
|
||||
lpcBuffer = (CHAR8*)MemAlloc(uiFSize + 1);
|
||||
if (!FileRead(hFile, lpcBuffer, uiFSize, &uiBytesRead)) {
|
||||
sprintf(errorBuf, "Error reading %s to buffer", fileNameFull);
|
||||
MemFree(lpcBuffer);
|
||||
delete data;
|
||||
return false;
|
||||
@@ -72,7 +75,6 @@ bool AbstractXMLLoader::LoadFromFile(const char* directoryName, const char* file
|
||||
|
||||
try {
|
||||
if (!XML_Parse(parser, lpcBuffer, uiFSize, TRUE)) {
|
||||
CHAR8 errorBuf[512];
|
||||
sprintf(errorBuf, "XML Parser Error in %s[%d]: %s", fileNameFull, XML_GetCurrentLineNumber(parser), XML_ErrorString(XML_GetErrorCode(parser)));
|
||||
LiveMessage(errorBuf);
|
||||
MemFree(lpcBuffer);
|
||||
@@ -80,7 +82,6 @@ bool AbstractXMLLoader::LoadFromFile(const char* directoryName, const char* file
|
||||
return false;
|
||||
}
|
||||
} catch (XMLParseException e) {
|
||||
CHAR8 errorBuf[512];
|
||||
sprintf(errorBuf, "XML Parser Exception in %s[%d]: %s", fileNameFull, e._LINE, e.what());
|
||||
LiveMessage(errorBuf);
|
||||
MemFree(lpcBuffer);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include "expat.h"
|
||||
#include "Types.h"
|
||||
#include "types.h"
|
||||
#include "XML.h"
|
||||
#include "TopicIDs.h"
|
||||
#include "TopicOps.h"
|
||||
@@ -55,7 +55,7 @@ private:
|
||||
public:
|
||||
AbstractXMLLoader(XML_StartElementHandler startHandler, XML_EndElementHandler endHandler, XML_CharacterDataHandler charHandler, ParseDataFactoryFunc parseDataFactF = MakeParseData);
|
||||
~AbstractXMLLoader(void);
|
||||
bool LoadFromFile(const char* directoryName, const char* fileName);
|
||||
bool LoadFromFile(const char* directoryName, const char* fileName, CHAR8* errorBuf);
|
||||
const char* GetFileName();
|
||||
const char* GetDirectoryName();
|
||||
void SetFileName(const char* fileName);
|
||||
|
||||
@@ -214,10 +214,10 @@ bool Filter::Match(SOLDIERTYPE* pSoldier) {
|
||||
cmp_val = Weapon[pSoldier->inv[HANDPOS].usItem].ubCalibre;
|
||||
break;
|
||||
case REQ_WEAPON_TWOHANDED:
|
||||
cmp_val = TwoHandedItem(pSoldier->inv[HANDPOS].usItem);
|
||||
cmp_val = ItemIsTwoHanded(pSoldier->inv[HANDPOS].usItem);
|
||||
break;
|
||||
case REQ_LEFT_WEAPON_TWOHANDED:
|
||||
cmp_val = TwoHandedItem(pSoldier->inv[SECONDHANDPOS].usItem);
|
||||
cmp_val = ItemIsTwoHanded(pSoldier->inv[SECONDHANDPOS].usItem);
|
||||
break;
|
||||
case REQ_VEST_AMOR_PROTECTION:
|
||||
cmp_val = Armour[Item[pSoldier->inv[VESTPOS].usItem].ubClassIndex].ubProtection;
|
||||
@@ -258,6 +258,18 @@ bool Filter::Match(SOLDIERTYPE* pSoldier) {
|
||||
case REQ_LEGPOSATTACHMENT3:
|
||||
cmp_val = CompareAttachment(pSoldier, LEGPOS, 3);
|
||||
break;
|
||||
case REQ_VESTPOSATTACHMENT0:
|
||||
cmp_val = CompareAttachment( pSoldier, VESTPOS, 0 );
|
||||
break;
|
||||
case REQ_VESTPOSATTACHMENT1:
|
||||
cmp_val = CompareAttachment( pSoldier, VESTPOS, 1 );
|
||||
break;
|
||||
case REQ_VESTPOSATTACHMENT2:
|
||||
cmp_val = CompareAttachment( pSoldier, VESTPOS, 2 );
|
||||
break;
|
||||
case REQ_VESTPOSATTACHMENT3:
|
||||
cmp_val = CompareAttachment( pSoldier, VESTPOS, 3 );
|
||||
break;
|
||||
default:
|
||||
if (q < NUM_REQTYPESINV) {
|
||||
cmp_val = pSoldier->inv[q].usItem;
|
||||
|
||||
@@ -75,6 +75,10 @@ public:
|
||||
REQ_LEGPOSATTACHMENT1,
|
||||
REQ_LEGPOSATTACHMENT2,
|
||||
REQ_LEGPOSATTACHMENT3,
|
||||
REQ_VESTPOSATTACHMENT0,
|
||||
REQ_VESTPOSATTACHMENT1,
|
||||
REQ_VESTPOSATTACHMENT2,
|
||||
REQ_VESTPOSATTACHMENT3,
|
||||
NUM_REQTYPES,
|
||||
// 3rd byte is for operator flags
|
||||
_REQ_BTWN = 0x20000,
|
||||
|
||||
@@ -270,7 +270,7 @@ namespace LogicalBodyTypes {
|
||||
/*****************************************
|
||||
Filter enum criterion types
|
||||
******************************************/
|
||||
LOGBT_ENUMDB_ADD("IntegerFilterCriterionTypes", 43,
|
||||
LOGBT_ENUMDB_ADD("IntegerFilterCriterionTypes", 47,
|
||||
Filter::REQ_HELMETPOS,
|
||||
Filter::REQ_VESTPOS,
|
||||
Filter::REQ_LEGPOS,
|
||||
@@ -313,7 +313,11 @@ namespace LogicalBodyTypes {
|
||||
Filter::REQ_LEGPOSATTACHMENT0,
|
||||
Filter::REQ_LEGPOSATTACHMENT1,
|
||||
Filter::REQ_LEGPOSATTACHMENT2,
|
||||
Filter::REQ_LEGPOSATTACHMENT3
|
||||
Filter::REQ_LEGPOSATTACHMENT3,
|
||||
Filter::REQ_VESTPOSATTACHMENT0,
|
||||
Filter::REQ_VESTPOSATTACHMENT1,
|
||||
Filter::REQ_VESTPOSATTACHMENT2,
|
||||
Filter::REQ_VESTPOSATTACHMENT3
|
||||
);
|
||||
|
||||
/*****************************************
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#ifndef _LBT_PALETTETABLE__H_
|
||||
#define _LBT_PALETTETABLE__H_
|
||||
|
||||
#include "soldier control.h"
|
||||
#include "Soldier Control.h"
|
||||
#include "Utilities.h"
|
||||
#include "lighting.h"
|
||||
|
||||
|
||||
@@ -1,18 +1,11 @@
|
||||
#include <stdio.h>
|
||||
#include "fileMan.h"
|
||||
#include "FileMan.h"
|
||||
#include "types.h"
|
||||
#include "Map Information.h"
|
||||
#include "Soldier Init List.h"
|
||||
#include "Random.h"
|
||||
#include "worlddef.h"
|
||||
#include "renderworld.h"
|
||||
#include "EditorMercs.h"
|
||||
#include "Exit Grids.h"
|
||||
#include "Isometric Utils.h"
|
||||
#include "Animation Data.h"
|
||||
#include "Road Smoothing.h"
|
||||
#include "message.h"
|
||||
#include "weapons.h"
|
||||
#include "environment.h"
|
||||
#include "lighting.h"
|
||||
#include "Animated ProgressBar.h"
|
||||
|
||||
@@ -66,4 +66,4 @@ BOOLEAN ValidateEntryPointGridNo( INT32 *sGridNo );
|
||||
|
||||
extern BOOLEAN gfWorldLoaded;
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+68
-68
@@ -1,36 +1,33 @@
|
||||
#include "builddefines.h"
|
||||
#include <stdio.h>
|
||||
#include <cstdlib>
|
||||
#include <vector>
|
||||
#include <string.h>
|
||||
#include "stdlib.h"
|
||||
#include "debug.h"
|
||||
//#include "soldier control.h"
|
||||
// HEADROCK HAM 3.5: Strange that this wasn't included.
|
||||
#include <types.h>
|
||||
#include "GameSettings.h"
|
||||
#include "weapons.h"
|
||||
#include "handle items.h"
|
||||
#include <soundman.h>
|
||||
#include <Campaign Types.h>
|
||||
#include "Overhead Types.h"
|
||||
#include "Soldier Control.h"
|
||||
#include <Timer Control.h>
|
||||
#include "worlddef.h"
|
||||
#include "rotting corpses.h"
|
||||
#include "tile cache.h"
|
||||
#include "isometric utils.h"
|
||||
#include "animation control.h"
|
||||
#include "utilities.h"
|
||||
#include "game clock.h"
|
||||
#include "soldier create.h"
|
||||
#include "Rotting Corpses.h"
|
||||
#include "Isometric Utils.h"
|
||||
#include "Animation Control.h"
|
||||
#include "Game Clock.h"
|
||||
#include "Soldier Create.h"
|
||||
#include "renderworld.h"
|
||||
#include "tile animation.h"
|
||||
#include "Tile Animation.h"
|
||||
#include "merc entering.h"
|
||||
#include "Sound Control.h"
|
||||
#include "strategic.h"
|
||||
#include "strategicmap.h"
|
||||
#include "Handle UI.h"
|
||||
#include "squads.h"
|
||||
#include "Squads.h"
|
||||
#include "english.h"
|
||||
#include "cursor control.h"
|
||||
#include "Merc Hiring.h"
|
||||
#include "Font Control.h"
|
||||
#include "message.h"
|
||||
#include "Text.h"
|
||||
#include "strategic turns.h"
|
||||
#include "Strategic Turns.h"
|
||||
#include "ai.h"
|
||||
#include "Dialogue Control.h"
|
||||
#include "Music Control.h"
|
||||
@@ -43,7 +40,6 @@
|
||||
#include "ub_config.h"
|
||||
#endif
|
||||
|
||||
#include "Music Control.h"
|
||||
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
@@ -355,7 +351,7 @@ UINT8 ubHeliScripts[ NUM_HELI_STATES ][ MAX_HELI_SCRIPT ] =
|
||||
|
||||
|
||||
BOOLEAN gfHandleHeli = FALSE;
|
||||
UINT8 gusHeliSeats[ MAX_MERC_IN_HELI ];
|
||||
SoldierID gusHeliSeats[ MAX_MERC_IN_HELI ];
|
||||
INT8 gbNumHeliSeatsOccupied = 0;
|
||||
|
||||
BOOLEAN gfFirstGuyDown = FALSE;
|
||||
@@ -392,7 +388,7 @@ void ResetHeliSeats( )
|
||||
gbNumHeliSeatsOccupied = 0;
|
||||
}
|
||||
|
||||
void AddMercToHeli( UINT8 ubID )
|
||||
void AddMercToHeli( SoldierID ubID )
|
||||
{
|
||||
if ( gbNumHeliSeatsOccupied < MAX_MERC_IN_HELI )
|
||||
{
|
||||
@@ -481,7 +477,7 @@ void HandleHeliDrop( BOOLEAN fPlayer )
|
||||
{
|
||||
UINT8 ubScriptCode;
|
||||
UINT32 uiClock;
|
||||
INT32 iVol;
|
||||
static INT32 iVol = 0;
|
||||
INT32 cnt;
|
||||
ANITILE_PARAMS AniParams;
|
||||
|
||||
@@ -502,21 +498,21 @@ void HandleHeliDrop( BOOLEAN fPlayer )
|
||||
{
|
||||
// Add merc to sector
|
||||
#ifdef JA2UB
|
||||
//MercPtrs[ gusHeliSeats[ cnt ] ]->ubStrategicInsertionCode = INSERTION_CODE_NORTH;
|
||||
MercPtrs[ gusHeliSeats[ cnt ] ]->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO;
|
||||
MercPtrs[ gusHeliSeats[ cnt ] ]->usStrategicInsertionData = gGameUBOptions.LOCATEGRIDNO;
|
||||
//gusHeliSeats[ cnt ]->ubStrategicInsertionCode = INSERTION_CODE_NORTH;
|
||||
gusHeliSeats[ cnt ]->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO;
|
||||
gusHeliSeats[ cnt ]->usStrategicInsertionData = gGameUBOptions.LOCATEGRIDNO;
|
||||
#else
|
||||
//MercPtrs[ gusHeliSeats[ cnt ] ]->ubStrategicInsertionCode = INSERTION_CODE_NORTH;
|
||||
MercPtrs[ gusHeliSeats[ cnt ] ]->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO;
|
||||
MercPtrs[ gusHeliSeats[ cnt ] ]->usStrategicInsertionData = gGameExternalOptions.iInitialMercArrivalLocation;
|
||||
//gusHeliSeats[ cnt ]->ubStrategicInsertionCode = INSERTION_CODE_NORTH;
|
||||
gusHeliSeats[ cnt ]->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO;
|
||||
gusHeliSeats[ cnt ]->usStrategicInsertionData = gGameExternalOptions.iInitialMercArrivalLocation;
|
||||
#endif
|
||||
// HEADROCK HAM 3.5: Externalized!
|
||||
UpdateMercInSector( MercPtrs[ gusHeliSeats[ cnt ] ], gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY, startingZ );
|
||||
UpdateMercInSector( gusHeliSeats[ cnt ], gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY, startingZ );
|
||||
|
||||
// Check for merc arrives quotes...
|
||||
HandleMercArrivesQuotes( MercPtrs[ gusHeliSeats[ cnt ] ] );
|
||||
HandleMercArrivesQuotes( gusHeliSeats[ cnt ] );
|
||||
|
||||
ScreenMsg( FONT_MCOLOR_WHITE, MSG_INTERFACE, TacticalStr[ MERC_HAS_ARRIVED_STR ], MercPtrs[ gusHeliSeats[ cnt ] ]->GetName() );
|
||||
ScreenMsg( FONT_MCOLOR_WHITE, MSG_INTERFACE, TacticalStr[ MERC_HAS_ARRIVED_STR ], gusHeliSeats[ cnt ]->GetName() );
|
||||
|
||||
}
|
||||
|
||||
@@ -558,23 +554,23 @@ void HandleHeliDrop( BOOLEAN fPlayer )
|
||||
{
|
||||
// Add merc to sector
|
||||
#ifdef JA2UB
|
||||
//MercPtrs[ gusHeliSeats[ cnt ] ]->ubStrategicInsertionCode = INSERTION_CODE_NORTH;
|
||||
MercPtrs[ gusHeliSeats[ cnt ] ]->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO;
|
||||
MercPtrs[ gusHeliSeats[ cnt ] ]->usStrategicInsertionData = gGameUBOptions.LOCATEGRIDNO;
|
||||
//gusHeliSeats[ cnt ]->ubStrategicInsertionCode = INSERTION_CODE_NORTH;
|
||||
gusHeliSeats[ cnt ]->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO;
|
||||
gusHeliSeats[ cnt ]->usStrategicInsertionData = gGameUBOptions.LOCATEGRIDNO;
|
||||
#else
|
||||
//MercPtrs[ gusHeliSeats[ cnt ] ]->ubStrategicInsertionCode = INSERTION_CODE_NORTH;
|
||||
MercPtrs[ gusHeliSeats[ cnt ] ]->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO;
|
||||
//gusHeliSeats[ cnt ]->ubStrategicInsertionCode = INSERTION_CODE_NORTH;
|
||||
gusHeliSeats[ cnt ]->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO;
|
||||
// sevenfm: if soldiers land into enemy sector, use gsGridNoSweetSpot
|
||||
//MercPtrs[ gusHeliSeats[ cnt ] ]->usStrategicInsertionData = gGameExternalOptions.iInitialMercArrivalLocation;
|
||||
MercPtrs[gusHeliSeats[cnt]]->usStrategicInsertionData = gsGridNoSweetSpot;
|
||||
//gusHeliSeats[ cnt ]->usStrategicInsertionData = gGameExternalOptions.iInitialMercArrivalLocation;
|
||||
gusHeliSeats[ cnt ]->usStrategicInsertionData = gsGridNoSweetSpot;
|
||||
#endif
|
||||
// HEADROCK HAM 3.5: Externalized!
|
||||
UpdateMercInSector( MercPtrs[ gusHeliSeats[ cnt ] ], gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY, startingZ );
|
||||
UpdateMercInSector( gusHeliSeats[ cnt ], gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY, startingZ );
|
||||
|
||||
// Check for merc arrives quotes...
|
||||
HandleMercArrivesQuotes( MercPtrs[ gusHeliSeats[ cnt ] ] );
|
||||
HandleMercArrivesQuotes( gusHeliSeats[ cnt ] );
|
||||
|
||||
ScreenMsg( FONT_MCOLOR_WHITE, MSG_INTERFACE, TacticalStr[ MERC_HAS_ARRIVED_STR ], MercPtrs[ gusHeliSeats[ cnt ] ]->GetName() );
|
||||
ScreenMsg( FONT_MCOLOR_WHITE, MSG_INTERFACE, TacticalStr[ MERC_HAS_ARRIVED_STR ], gusHeliSeats[ cnt ]->GetName() );
|
||||
}
|
||||
|
||||
// Remove heli
|
||||
@@ -618,11 +614,15 @@ void HandleHeliDrop( BOOLEAN fPlayer )
|
||||
{
|
||||
if( uiSoundSample!=NO_SAMPLE )
|
||||
{
|
||||
iVol=SoundGetVolume( uiSoundSample );
|
||||
iVol=__min( HIGHVOLUME, iVol+5);
|
||||
SoundSetVolume(uiSoundSample, iVol);
|
||||
if(iVol==HIGHVOLUME)
|
||||
iVol = __min(HIGHVOLUME, iVol + 5);
|
||||
if ( GetSoundEffectsVolume() != 0)
|
||||
{
|
||||
SoundSetVolume(uiSoundSample, iVol);
|
||||
}
|
||||
if (iVol == HIGHVOLUME)
|
||||
{
|
||||
fFadingHeliIn=FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -633,11 +633,11 @@ void HandleHeliDrop( BOOLEAN fPlayer )
|
||||
{
|
||||
if( uiSoundSample!=NO_SAMPLE )
|
||||
{
|
||||
iVol=SoundGetVolume(uiSoundSample);
|
||||
|
||||
iVol=__max( 0, iVol-5);
|
||||
|
||||
SoundSetVolume(uiSoundSample, iVol);
|
||||
if (GetSoundEffectsVolume() != 0)
|
||||
{
|
||||
SoundSetVolume(uiSoundSample, iVol);
|
||||
}
|
||||
if(iVol==0)
|
||||
{
|
||||
// Stop sound
|
||||
@@ -698,24 +698,24 @@ void HandleHeliDrop( BOOLEAN fPlayer )
|
||||
{
|
||||
// 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 animation.
|
||||
MercPtrs[ gusHeliSeats[ gbCurDrop ] ]->usAnimState = STANDING;
|
||||
MercPtrs[ gusHeliSeats[ gbCurDrop ] ]->EVENT_InitNewSoldierAnim( HELIDROP, 0 , FALSE );
|
||||
gusHeliSeats[ gbCurDrop ]->usAnimState = STANDING;
|
||||
gusHeliSeats[ gbCurDrop ]->EVENT_InitNewSoldierAnim( HELIDROP, 0 , FALSE );
|
||||
|
||||
// Change insertion code
|
||||
MercPtrs[ gusHeliSeats[ gbCurDrop ] ]->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO;
|
||||
MercPtrs[ gusHeliSeats[ gbCurDrop ] ]->usStrategicInsertionData = gsGridNoSweetSpot;
|
||||
gusHeliSeats[ gbCurDrop ]->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO;
|
||||
gusHeliSeats[ gbCurDrop ]->usStrategicInsertionData = gsGridNoSweetSpot;
|
||||
|
||||
// HEADROCK HAM 3.5: Externalized!
|
||||
UpdateMercInSector( MercPtrs[ gusHeliSeats[ gbCurDrop ] ], gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY, startingZ );
|
||||
//EVENT_SetSoldierPosition( MercPtrs[ gusHeliSeats[ gbCurDrop ] ], sWorldX, sWorldY );
|
||||
UpdateMercInSector( gusHeliSeats[ gbCurDrop ], gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY, startingZ );
|
||||
//EVENT_SetSoldierPosition( gusHeliSeats[ gbCurDrop ], sWorldX, sWorldY );
|
||||
|
||||
// IF the first guy down, set squad!
|
||||
if ( gfFirstGuyDown )
|
||||
{
|
||||
gfFirstGuyDown = FALSE;
|
||||
SetCurrentSquad( MercPtrs[ gusHeliSeats[ gbCurDrop ] ]->bAssignment, TRUE );
|
||||
SetCurrentSquad( gusHeliSeats[ gbCurDrop ]->bAssignment, TRUE );
|
||||
}
|
||||
ScreenMsg( FONT_MCOLOR_WHITE, MSG_INTERFACE, TacticalStr[ MERC_HAS_ARRIVED_STR ], MercPtrs[ gusHeliSeats[ gbCurDrop ] ]->GetName() );
|
||||
ScreenMsg( FONT_MCOLOR_WHITE, MSG_INTERFACE, TacticalStr[ MERC_HAS_ARRIVED_STR ], gusHeliSeats[ gbCurDrop ]->GetName() );
|
||||
|
||||
++gbCurDrop;
|
||||
|
||||
@@ -991,7 +991,7 @@ void HandleFirstHeliDropOfGame( )
|
||||
SayQuoteFromAnyBodyInSector( QUOTE_ENEMY_PRESENCE );
|
||||
|
||||
// Start music
|
||||
UseCreatureMusic(HostileZombiesPresent());
|
||||
CheckForZombieMusic();
|
||||
|
||||
#ifdef NEWMUSIC
|
||||
GlobalSoundID = MusicSoundValues[ SECTOR( gWorldSectorX, gWorldSectorY ) ].SoundTacticalTensor[gbWorldSectorZ];
|
||||
@@ -1024,7 +1024,7 @@ void HandleFirstHeliDropOfGame( )
|
||||
CharacterDialogueWithSpecialEvent( 0, 0, 0, DIALOGUE_TACTICAL_UI , FALSE , FALSE , DIALOGUE_SPECIAL_EVENT_ENABLE_AI ,0, 0 );
|
||||
}
|
||||
|
||||
UINT8 SpawnAirDropElite( INT32 sGridNo )
|
||||
SoldierID SpawnAirDropElite( INT32 sGridNo )
|
||||
{
|
||||
SOLDIERTYPE *pSoldier;
|
||||
|
||||
@@ -1076,7 +1076,7 @@ void InitiateEnemyAirDropSoldiers( INT32 sGridNo )
|
||||
|
||||
for ( int i = 0; i < 6; ++i )
|
||||
{
|
||||
UINT8 id = SpawnAirDropElite( gMapInformation.sSouthGridNo + i );
|
||||
SoldierID id = SpawnAirDropElite( gMapInformation.sSouthGridNo + i );
|
||||
|
||||
if ( id == NOBODY )
|
||||
return;
|
||||
@@ -1192,23 +1192,23 @@ void HandleEnemyAirdrop( )
|
||||
{
|
||||
// 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.
|
||||
//MercPtrs[ gusHeliSeats[ gbCurDrop ] ]->usAnimState = STANDING;
|
||||
MercPtrs[gusHeliSeats[gbCurDrop]]->EVENT_InitNewSoldierAnim( HELIDROP, 0, FALSE );
|
||||
//gusHeliSeats[ gbCurDrop ]->usAnimState = STANDING;
|
||||
gusHeliSeats[gbCurDrop]->EVENT_InitNewSoldierAnim( HELIDROP, 0, FALSE );
|
||||
|
||||
// Change insertion code
|
||||
MercPtrs[gusHeliSeats[gbCurDrop]]->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO;
|
||||
MercPtrs[gusHeliSeats[gbCurDrop]]->usStrategicInsertionData = gsGridNoSweetSpot;
|
||||
gusHeliSeats[gbCurDrop]->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO;
|
||||
gusHeliSeats[gbCurDrop]->usStrategicInsertionData = gsGridNoSweetSpot;
|
||||
|
||||
// HEADROCK HAM 3.5: Externalized!
|
||||
UpdateMercInSector( MercPtrs[gusHeliSeats[gbCurDrop]], gWorldSectorX, gWorldSectorY, startingZ );
|
||||
UpdateMercInSector( gusHeliSeats[gbCurDrop], gWorldSectorX, gWorldSectorY, startingZ );
|
||||
|
||||
// IF the first guy down, set squad!
|
||||
if ( gfFirstGuyDown )
|
||||
{
|
||||
gfFirstGuyDown = FALSE;
|
||||
//SetCurrentSquad( MercPtrs[ gusHeliSeats[ gbCurDrop ] ]->bAssignment, TRUE );
|
||||
//SetCurrentSquad( gusHeliSeats[ gbCurDrop ]->bAssignment, TRUE );
|
||||
}
|
||||
ScreenMsg( FONT_MCOLOR_WHITE, MSG_INTERFACE, TacticalStr[MERC_HAS_ARRIVED_STR], MercPtrs[gusHeliSeats[gbCurDrop]]->GetName( ) );
|
||||
ScreenMsg( FONT_MCOLOR_WHITE, MSG_INTERFACE, TacticalStr[MERC_HAS_ARRIVED_STR], gusHeliSeats[gbCurDrop]->GetName( ) );
|
||||
|
||||
++gbCurDrop;
|
||||
|
||||
|
||||
+95
-111
@@ -1,37 +1,25 @@
|
||||
#include "builddefines.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "stdlib.h"
|
||||
#include "debug.h"
|
||||
#include "DEBUG.H"
|
||||
#include "math.h"
|
||||
#include "worlddef.h"
|
||||
#include "renderworld.h"
|
||||
#include "Assignments.h"
|
||||
#include "merc entering.h"
|
||||
#include "Animation Control.h"
|
||||
#include "Animation Data.h"
|
||||
#include "Isometric Utils.h"
|
||||
#include "Event Pump.h"
|
||||
#include "Render Fun.h"
|
||||
#include "interface.h"
|
||||
#include "sysutil.h"
|
||||
#include "FileMan.h"
|
||||
#include "Random.h"
|
||||
#include "ai.h"
|
||||
#include "Interactive Tiles.h"
|
||||
#include "english.h"
|
||||
#include "overhead.h"
|
||||
#include "Handle UI.h"
|
||||
#include <Font Control.h>
|
||||
#include "random.h"
|
||||
#include "Overhead.h"
|
||||
#include "Soldier Profile.h"
|
||||
#include "Game Clock.h"
|
||||
#include "soldier create.h"
|
||||
#include "Soldier Create.h"
|
||||
#include "Merc Hiring.h"
|
||||
#include "Game Event Hook.h"
|
||||
#include "message.h"
|
||||
#include "strategicmap.h"
|
||||
#include "strategic.h"
|
||||
#include "items.h"
|
||||
#include "Soldier Add.h"
|
||||
#include "History.h"
|
||||
#include "Items.h"
|
||||
#include "history.h"
|
||||
#include "Squads.h"
|
||||
#include "Strategic Merc Handler.h"
|
||||
#include "Dialogue Control.h"
|
||||
@@ -39,16 +27,14 @@
|
||||
#include "Map Screen Interface Map.h"
|
||||
#include "screenids.h"
|
||||
#include "jascreens.h"
|
||||
#include "text.h"
|
||||
#include "Text.h"
|
||||
#include "Merc Contract.h"
|
||||
#include "LaptopSave.h"
|
||||
#include "personnel.h"
|
||||
#include "Auto Resolve.h"
|
||||
#include "Map Screen Interface Bottom.h"
|
||||
#include "Quests.h"
|
||||
#include "GameSettings.h"
|
||||
#include "DynamicDialogue.h"// added by Flugente
|
||||
#include "Dialogue Control.h" // added by Flugente
|
||||
#include "connect.h"
|
||||
#include "Map Information.h"
|
||||
|
||||
@@ -61,9 +47,6 @@
|
||||
#include "opplist.h"
|
||||
#include "Ja25Update.h"
|
||||
#include "ub_config.h"
|
||||
#endif
|
||||
|
||||
#ifdef JA2UB
|
||||
#else
|
||||
// anv: for Kulba's odyssey
|
||||
#include "email.h"
|
||||
@@ -127,7 +110,7 @@ UINT16 GetInitialHeliRandomTime();
|
||||
INT8 HireMerc( MERC_HIRE_STRUCT *pHireMerc)
|
||||
{
|
||||
SOLDIERTYPE *pSoldier;
|
||||
UINT8 iNewIndex;
|
||||
SoldierID iNewIndex;
|
||||
UINT8 ubCurrentSoldier = pHireMerc->ubProfileID;
|
||||
MERCPROFILESTRUCT *pMerc;
|
||||
SOLDIERCREATE_STRUCT MercCreateStruct;
|
||||
@@ -211,18 +194,18 @@ INT8 HireMerc( MERC_HIRE_STRUCT *pHireMerc)
|
||||
// make an objecttype
|
||||
CreateItem(LETTER, 100, &gTempObject);
|
||||
// Give it
|
||||
fReturn = AutoPlaceObject( MercPtrs[iNewIndex], &gTempObject, FALSE );
|
||||
fReturn = AutoPlaceObject( iNewIndex, &gTempObject, FALSE );
|
||||
// CHRISL: This condition should resolve the issue of the letter not being issued to the first merc
|
||||
if(!fReturn)
|
||||
{
|
||||
if (UsingNewInventorySystem())
|
||||
{
|
||||
(MercPtrs[iNewIndex]->inv[NUM_INV_SLOTS-1]) = gTempObject;
|
||||
(iNewIndex->inv[NUM_INV_SLOTS-1]) = gTempObject;
|
||||
fReturn=TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
(MercPtrs[iNewIndex]->inv[SMALLPOCK8POS]) = gTempObject;
|
||||
(iNewIndex->inv[SMALLPOCK8POS]) = gTempObject;
|
||||
fReturn = TRUE;
|
||||
}
|
||||
}
|
||||
@@ -239,7 +222,7 @@ INT8 HireMerc( MERC_HIRE_STRUCT *pHireMerc)
|
||||
//record how long the merc will be gone for
|
||||
pMerc->bMercStatus = (UINT8)pHireMerc->iTotalContractLength;
|
||||
|
||||
pSoldier = &Menptr[iNewIndex];
|
||||
pSoldier = iNewIndex;
|
||||
|
||||
//Copy over insertion data....
|
||||
pSoldier->ubStrategicInsertionCode = pHireMerc->ubInsertionCode;
|
||||
@@ -425,7 +408,7 @@ INT8 HireMerc( MERC_HIRE_STRUCT *pHireMerc)
|
||||
}
|
||||
|
||||
|
||||
void MercArrivesCallback( UINT8 ubSoldierID )
|
||||
void MercArrivesCallback( SoldierID ubSoldierID )
|
||||
{
|
||||
MERCPROFILESTRUCT *pMerc;
|
||||
SOLDIERTYPE *pSoldier;
|
||||
@@ -457,7 +440,7 @@ void MercArrivesCallback( UINT8 ubSoldierID )
|
||||
// stop time compression until player restarts it
|
||||
StopTimeCompression();
|
||||
|
||||
pSoldier = &Menptr[ ubSoldierID ];
|
||||
pSoldier = ubSoldierID;
|
||||
|
||||
pMerc = &gMercProfiles[ pSoldier->ubProfile ];
|
||||
|
||||
@@ -498,11 +481,11 @@ void MercArrivesCallback( UINT8 ubSoldierID )
|
||||
{
|
||||
bool force_helidrop = true;
|
||||
SOLDIERTYPE *pTeamSoldier;
|
||||
for (UINT8 cnt = 0; cnt < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; cnt++)
|
||||
for (UINT16 cnt = 0; cnt < giMAXIMUM_NUMBER_OF_PLAYER_SLOTS; cnt++)
|
||||
{
|
||||
if (gCharactersList[cnt].fValid)
|
||||
{
|
||||
pTeamSoldier = &Menptr[gCharactersList[cnt].usSolID];
|
||||
pTeamSoldier = gCharactersList[cnt].usSolID;
|
||||
if (pTeamSoldier != pSoldier && pTeamSoldier->bAssignment != ASSIGNMENT_DEAD && pTeamSoldier->bAssignment != ASSIGNMENT_POW && pTeamSoldier->bAssignment != IN_TRANSIT && pSoldier->ubStrategicInsertionCode != INSERTION_CODE_CHOPPER)
|
||||
{
|
||||
force_helidrop = false;
|
||||
@@ -671,12 +654,12 @@ BOOLEAN IsTheSoldierAliveAndConcious( SOLDIERTYPE *pSoldier )
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
UINT8 NumberOfMercsOnPlayerTeam()
|
||||
UINT16 NumberOfMercsOnPlayerTeam()
|
||||
{
|
||||
INT8 cnt;
|
||||
SOLDIERTYPE *pSoldier;
|
||||
INT16 bLastTeamID;
|
||||
UINT8 ubCount=0;
|
||||
SoldierID cnt;
|
||||
SOLDIERTYPE *pSoldier;
|
||||
SoldierID bLastTeamID;
|
||||
UINT16 ubCount=0;
|
||||
|
||||
// Set locator to first merc
|
||||
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
@@ -685,8 +668,9 @@ UINT8 NumberOfMercsOnPlayerTeam()
|
||||
if (! MercPtrs[cnt])
|
||||
return 0;
|
||||
|
||||
for ( pSoldier = MercPtrs[ cnt ]; cnt <= bLastTeamID; cnt++,pSoldier++)
|
||||
for ( ; cnt <= bLastTeamID; ++cnt )
|
||||
{
|
||||
pSoldier = cnt;
|
||||
AssertNotNIL(pSoldier);
|
||||
|
||||
//if the is active, and is not a vehicle
|
||||
@@ -702,9 +686,9 @@ UINT8 NumberOfMercsOnPlayerTeam()
|
||||
|
||||
void HandleMercArrivesQuotes( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
UINT8 cnt, usLastTeamID;
|
||||
INT8 bHated;
|
||||
SOLDIERTYPE *pTeamSoldier;
|
||||
SoldierID cnt, usLastTeamID;
|
||||
INT8 bHated;
|
||||
SOLDIERTYPE *pTeamSoldier;
|
||||
#ifdef JA2UB
|
||||
//if we are at the begining of the game going through the initial heli scequence
|
||||
if( pSoldier->fWaitingToGetupFromJA25Start )
|
||||
@@ -730,8 +714,9 @@ void HandleMercArrivesQuotes( SOLDIERTYPE *pSoldier )
|
||||
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
usLastTeamID = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
|
||||
//loop though all the mercs
|
||||
for ( pTeamSoldier = MercPtrs[ cnt ]; cnt <= usLastTeamID; ++cnt, ++pTeamSoldier)
|
||||
for ( ; cnt <= usLastTeamID; ++cnt )
|
||||
{
|
||||
pTeamSoldier = cnt;
|
||||
if ( pTeamSoldier->bActive )
|
||||
{
|
||||
if ( pTeamSoldier->ubWhatKindOfMercAmI == MERC_TYPE__AIM_MERC )
|
||||
@@ -819,14 +804,13 @@ UINT32 GetMercArrivalTimeOfDay( )
|
||||
|
||||
void UpdateAnyInTransitMercsWithGlobalArrivalSector( )
|
||||
{
|
||||
INT32 cnt;
|
||||
SOLDIERTYPE *pSoldier;
|
||||
|
||||
cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
SoldierID cnt = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
|
||||
// look for all mercs on the same team,
|
||||
for ( pSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; cnt++,pSoldier++)
|
||||
for ( ; cnt <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++cnt )
|
||||
{
|
||||
pSoldier = cnt;
|
||||
if ( pSoldier->bActive )
|
||||
{
|
||||
if ( pSoldier->bAssignment == IN_TRANSIT )
|
||||
@@ -1036,78 +1020,78 @@ if ( gGameUBOptions.InGameHeliCrash == TRUE )
|
||||
|
||||
void UpdateJerryMiloInInitialSector()
|
||||
{
|
||||
SOLDIERTYPE *pSoldier = NULL;
|
||||
SOLDIERTYPE *pJerrySoldier=NULL;
|
||||
SOLDIERTYPE *pSoldier = NULL;
|
||||
SOLDIERTYPE *pJerrySoldier = NULL;
|
||||
|
||||
|
||||
//SectorInfo[ SEC_H7 ].fSurfaceWasEverPlayerControlled = TRUE;
|
||||
SectorInfo[ (UINT8)SECTOR( gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY ) ].fSurfaceWasEverPlayerControlled = TRUE;
|
||||
//SectorInfo[ SEC_H7 ].ubNumAdmins = 2;
|
||||
StrategicMap[ (UINT8)SECTOR( gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY ) ].fEnemyControlled = FALSE;
|
||||
|
||||
if ( gGameUBOptions.InGameHeli == TRUE )
|
||||
return; //AA
|
||||
|
||||
if ( gGameUBOptions.InGameHeliCrash == TRUE )
|
||||
{
|
||||
//if it is the first sector we are loading up, place Jerry in the map
|
||||
if( !gfFirstTimeInGameHeliCrash )
|
||||
return;
|
||||
|
||||
if ( gGameUBOptions.InJerry == TRUE )
|
||||
{
|
||||
pSoldier = FindSoldierByProfileID( JERRY_MILO_UB, FALSE ); //JERRY
|
||||
if( pSoldier == NULL )
|
||||
{
|
||||
Assert( 0 );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//the internet part of the laptop isnt working. It gets broken in the heli crash.
|
||||
if ( gGameUBOptions.LaptopQuestEnabled == TRUE )
|
||||
StartQuest( QUEST_FIX_LAPTOP, -1, -1 );
|
||||
|
||||
//Record the initial sector as ours
|
||||
//SectorInfo[ SEC_H7 ].fSurfaceWasEverPlayerControlled = TRUE;
|
||||
SectorInfo[ (UINT8)SECTOR( gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY ) ].fSurfaceWasEverPlayerControlled = TRUE;
|
||||
StrategicMap[ (UINT8)SECTOR( gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY ) ].fEnemyControlled = FALSE;
|
||||
|
||||
if ( gGameUBOptions.InJerry == TRUE )
|
||||
SectorInfo[(UINT8)SECTOR( gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY )].fSurfaceWasEverPlayerControlled = TRUE;
|
||||
//SectorInfo[ SEC_H7 ].ubNumAdmins = 2;
|
||||
StrategicMap[CALCULATE_STRATEGIC_INDEX( gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY )].fEnemyControlled = FALSE;
|
||||
|
||||
if ( gGameUBOptions.InGameHeli == TRUE )
|
||||
return; //AA
|
||||
|
||||
if ( gGameUBOptions.InGameHeliCrash == TRUE )
|
||||
{
|
||||
//Set some variable so Jerry will be on the ground
|
||||
pSoldier->fWaitingToGetupFromJA25Start = TRUE;
|
||||
pSoldier->fIgnoreGetupFromCollapseCheck = TRUE;
|
||||
//if it is the first sector we are loading up, place Jerry in the map
|
||||
if ( !gfFirstTimeInGameHeliCrash )
|
||||
return;
|
||||
|
||||
//pSoldier->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO; //to by³o wy³¹czone
|
||||
//pSoldier->usStrategicInsertionData = GetInitialHeliGridNo( ); //to by³o wy³¹czone
|
||||
if ( gGameUBOptions.InJerry == TRUE )
|
||||
{
|
||||
pSoldier = FindSoldierByProfileID( JERRY_MILO_UB, FALSE ); //JERRY
|
||||
if ( pSoldier == NULL )
|
||||
{
|
||||
Assert( 0 );
|
||||
}
|
||||
|
||||
RESETTIMECOUNTER( pSoldier->GetupFromJA25StartCounter, gsInitialHeliRandomTimes[ 6 ] + 800 + Random( 400 ) );
|
||||
}
|
||||
|
||||
//should we be on our back or tummy
|
||||
if( Random( 100 ) < 50 )
|
||||
pSoldier->EVENT_InitNewSoldierAnim( STAND_FALLFORWARD_STOP, 1, TRUE );
|
||||
else
|
||||
pSoldier->EVENT_InitNewSoldierAnim( FALLBACKHIT_STOP, 1, TRUE );
|
||||
}
|
||||
//the internet part of the laptop isnt working. It gets broken in the heli crash.
|
||||
if ( gGameUBOptions.LaptopQuestEnabled == TRUE )
|
||||
StartQuest( QUEST_FIX_LAPTOP, -1, -1 );
|
||||
|
||||
//Wont work cause it gets reset every frame
|
||||
//make sure we can see Jerry
|
||||
|
||||
if ( gGameUBOptions.InJerry == TRUE )
|
||||
{
|
||||
pJerrySoldier = FindSoldierByProfileID(JERRY_MILO_UB, FALSE );//JERRY
|
||||
if( pJerrySoldier != NULL )
|
||||
{
|
||||
//Make sure we can see the pilot
|
||||
gbPublicOpplist[OUR_TEAM][ pJerrySoldier->ubID ] = SEEN_CURRENTLY;
|
||||
pJerrySoldier->bVisible = TRUE;
|
||||
}
|
||||
//Record the initial sector as ours
|
||||
//SectorInfo[ SEC_H7 ].fSurfaceWasEverPlayerControlled = TRUE;
|
||||
SectorInfo[(UINT8)SECTOR( gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY )].fSurfaceWasEverPlayerControlled = TRUE;
|
||||
StrategicMap[CALCULATE_STRATEGIC_INDEX( gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY )].fEnemyControlled = FALSE;
|
||||
|
||||
}
|
||||
if ( gGameUBOptions.InJerry == TRUE )
|
||||
{
|
||||
//Set some variable so Jerry will be on the ground
|
||||
pSoldier->fWaitingToGetupFromJA25Start = TRUE;
|
||||
pSoldier->fIgnoreGetupFromCollapseCheck = TRUE;
|
||||
|
||||
//Lock the interface
|
||||
guiPendingOverrideEvent = LU_BEGINUILOCK;
|
||||
//pSoldier->ubStrategicInsertionCode = INSERTION_CODE_GRIDNO; //to by³o wy³¹czone
|
||||
//pSoldier->usStrategicInsertionData = GetInitialHeliGridNo( ); //to by³o wy³¹czone
|
||||
|
||||
RESETTIMECOUNTER( pSoldier->GetupFromJA25StartCounter, gsInitialHeliRandomTimes[6] + 800 + Random( 400 ) );
|
||||
|
||||
//should we be on our back or tummy
|
||||
if ( Random( 100 ) < 50 )
|
||||
pSoldier->EVENT_InitNewSoldierAnim( STAND_FALLFORWARD_STOP, 1, TRUE );
|
||||
else
|
||||
pSoldier->EVENT_InitNewSoldierAnim( FALLBACKHIT_STOP, 1, TRUE );
|
||||
}
|
||||
|
||||
//Wont work cause it gets reset every frame
|
||||
//make sure we can see Jerry
|
||||
|
||||
if ( gGameUBOptions.InJerry == TRUE )
|
||||
{
|
||||
pJerrySoldier = FindSoldierByProfileID( JERRY_MILO_UB, FALSE );//JERRY
|
||||
if ( pJerrySoldier != NULL )
|
||||
{
|
||||
//Make sure we can see the pilot
|
||||
gbPublicOpplist[OUR_TEAM][pJerrySoldier->ubID] = SEEN_CURRENTLY;
|
||||
pJerrySoldier->bVisible = TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Lock the interface
|
||||
guiPendingOverrideEvent = LU_BEGINUILOCK;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,10 +46,10 @@ extern INT16 gsMercArriveSectorY;
|
||||
|
||||
|
||||
INT8 HireMerc( MERC_HIRE_STRUCT *pHireMerc);
|
||||
void MercArrivesCallback( UINT8 ubSoldierID );
|
||||
void MercArrivesCallback( SoldierID ubSoldierID );
|
||||
BOOLEAN IsMercHireable( UINT8 ubMercID );
|
||||
BOOLEAN IsMercDead( UINT8 ubMercID );
|
||||
UINT8 NumberOfMercsOnPlayerTeam();
|
||||
UINT16 NumberOfMercsOnPlayerTeam();
|
||||
BOOLEAN IsTheSoldierAliveAndConcious( SOLDIERTYPE *pSoldier );
|
||||
void HandleMercArrivesQuotes( SOLDIERTYPE *pSoldier );
|
||||
void UpdateAnyInTransitMercsWithGlobalArrivalSector( );
|
||||
|
||||
@@ -5,30 +5,28 @@
|
||||
#include "Campaign Types.h"
|
||||
#include "Overhead.h"
|
||||
#include "strategicmap.h"
|
||||
#include "PreBattle Interface.h"
|
||||
#include "Map Screen Interface.h"
|
||||
#include "Queen Command.h"
|
||||
#include "strategic.h"
|
||||
#include "popupbox.h"
|
||||
#include "interface control.h"
|
||||
#include "PopUpBox.h"
|
||||
#include "Interface Control.h"
|
||||
#include "Map Screen Interface Map.h"
|
||||
#include "renderworld.h"
|
||||
#include "Text.h"
|
||||
#include "utilities.h"
|
||||
#include "Utilities.h"
|
||||
#include "Interface.h"
|
||||
#include "GameSettings.h"
|
||||
#include "Input.h"
|
||||
#include "input.h"
|
||||
#include "opplist.h"
|
||||
#include "los.h"
|
||||
#include "LOS.h"
|
||||
#include "Items.h"
|
||||
#include "Animation Control.h"
|
||||
#include "points.h"
|
||||
#include "Points.h"
|
||||
#include "Campaign.h"
|
||||
#include "ai.h"
|
||||
#include "Isometric Utils.h"
|
||||
#include "MilitiaSquads.h"
|
||||
#include "MilitiaIndividual.h" // added by Flugente
|
||||
#include "CampaignStats.h" // added by Flugente
|
||||
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
@@ -176,12 +174,11 @@ void ResetMilitia()
|
||||
void RemoveMilitiaFromTactical()
|
||||
{
|
||||
SOLDIERINITNODE *curr;
|
||||
INT32 i;
|
||||
for( i = gTacticalStatus.Team[ MILITIA_TEAM ].bFirstID; i <= gTacticalStatus.Team[ MILITIA_TEAM ].bLastID; i++ )
|
||||
for( SoldierID id = gTacticalStatus.Team[ MILITIA_TEAM ].bFirstID; id <= gTacticalStatus.Team[ MILITIA_TEAM ].bLastID; ++id )
|
||||
{
|
||||
if( MercPtrs[ i ]->bActive )
|
||||
if( id->bActive )
|
||||
{
|
||||
TacticalRemoveSoldier( MercPtrs[ i ]->ubID );
|
||||
TacticalRemoveSoldier( id );
|
||||
}
|
||||
}
|
||||
curr = gSoldierInitHead;
|
||||
@@ -199,7 +196,7 @@ void PrepareMilitiaForTactical( BOOLEAN fPrepareAll)
|
||||
{
|
||||
SECTORINFO *pSector;
|
||||
INT32 x;
|
||||
UINT8 ubGreen, ubRegs, ubElites;
|
||||
UINT16 ubGreen, ubRegs, ubElites;
|
||||
|
||||
if( gbWorldSectorZ > 0 )
|
||||
return;
|
||||
@@ -327,7 +324,6 @@ void PrepareMilitiaForTactical( BOOLEAN fPrepareAll)
|
||||
|
||||
void HandleMilitiaPromotions( void )
|
||||
{
|
||||
UINT8 cnt;
|
||||
SOLDIERTYPE* pTeamSoldier;
|
||||
|
||||
gbGreenToElitePromotions = 0;
|
||||
@@ -335,10 +331,11 @@ void HandleMilitiaPromotions( void )
|
||||
gbRegToElitePromotions = 0;
|
||||
gbMilitiaPromotions = 0;
|
||||
|
||||
cnt = gTacticalStatus.Team[ MILITIA_TEAM ].bFirstID;
|
||||
SoldierID cnt = gTacticalStatus.Team[ MILITIA_TEAM ].bFirstID;
|
||||
|
||||
for ( pTeamSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ MILITIA_TEAM ].bLastID; ++cnt, ++pTeamSoldier)
|
||||
for ( ; cnt <= gTacticalStatus.Team[ MILITIA_TEAM ].bLastID; ++cnt )
|
||||
{
|
||||
pTeamSoldier = cnt;
|
||||
if ( pTeamSoldier->bActive && pTeamSoldier->bInSector && pTeamSoldier->stats.bLife > 0 )
|
||||
{
|
||||
// Flugente: take care of promotions and individual militia update
|
||||
@@ -1422,13 +1419,14 @@ void MilitiaControlMenuBtnCallBack( MOUSE_REGION * pRegion, INT32 iReason )
|
||||
case( MILCON_MENU_ALL_ATTACK ):
|
||||
if (fAllowSectorOrder)
|
||||
{
|
||||
UINT8 cnt;
|
||||
SoldierID cnt;
|
||||
SOLDIERTYPE *pTeamSoldier;
|
||||
|
||||
cnt = gTacticalStatus.Team[ MILITIA_TEAM ].bFirstID;
|
||||
|
||||
for ( pTeamSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ MILITIA_TEAM ].bLastID; cnt++, pTeamSoldier++)
|
||||
for ( ; cnt <= gTacticalStatus.Team[ MILITIA_TEAM ].bLastID; ++cnt )
|
||||
{
|
||||
pTeamSoldier = cnt;
|
||||
if ( (pTeamSoldier->bActive) && (pTeamSoldier->bInSector) && (pTeamSoldier->stats.bLife >= OKLIFE) )
|
||||
{
|
||||
// sevenfm: stop any AI
|
||||
@@ -1459,13 +1457,14 @@ void MilitiaControlMenuBtnCallBack( MOUSE_REGION * pRegion, INT32 iReason )
|
||||
case( MILCON_MENU_ALL_HOLD ):
|
||||
if (fAllowSectorOrder)
|
||||
{
|
||||
UINT8 cnt;
|
||||
SoldierID cnt;
|
||||
SOLDIERTYPE *pTeamSoldier;
|
||||
|
||||
cnt = gTacticalStatus.Team[ MILITIA_TEAM ].bFirstID;
|
||||
|
||||
for ( pTeamSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ MILITIA_TEAM ].bLastID; cnt++, pTeamSoldier++)
|
||||
for ( ; cnt <= gTacticalStatus.Team[ MILITIA_TEAM ].bLastID; ++cnt )
|
||||
{
|
||||
pTeamSoldier = cnt;
|
||||
if ( (pTeamSoldier->bActive) && (pTeamSoldier->bInSector) && (pTeamSoldier->stats.bLife >= OKLIFE) )
|
||||
{
|
||||
// sevenfm: stop any AI
|
||||
@@ -1495,14 +1494,15 @@ void MilitiaControlMenuBtnCallBack( MOUSE_REGION * pRegion, INT32 iReason )
|
||||
case( MILCON_MENU_ALL_RETREAT ):
|
||||
if (fAllowSectorOrder)
|
||||
{
|
||||
UINT8 cnt;
|
||||
SoldierID cnt;
|
||||
INT16 sActionGridNo;
|
||||
SOLDIERTYPE *pTeamSoldier;
|
||||
|
||||
cnt = gTacticalStatus.Team[ MILITIA_TEAM ].bFirstID;
|
||||
|
||||
for ( pTeamSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ MILITIA_TEAM ].bLastID; cnt++, pTeamSoldier++)
|
||||
for ( ; cnt <= gTacticalStatus.Team[ MILITIA_TEAM ].bLastID; ++cnt )
|
||||
{
|
||||
pTeamSoldier = cnt;
|
||||
if ( (pTeamSoldier->bActive) && (pTeamSoldier->bInSector) && (pTeamSoldier->stats.bLife >= OKLIFE) )
|
||||
{
|
||||
// sevenfm: stop any AI
|
||||
@@ -1558,14 +1558,16 @@ void MilitiaControlMenuBtnCallBack( MOUSE_REGION * pRegion, INT32 iReason )
|
||||
case( MILCON_MENU_ALL_COMETOME ):
|
||||
if (fAllowSectorOrder)
|
||||
{
|
||||
UINT8 cnt, ubDirection;
|
||||
SoldierID cnt;
|
||||
UINT8 ubDirection;
|
||||
INT32 sActionGridNo, sGridNo, sAdjustedGridNo;
|
||||
SOLDIERTYPE *pTeamSoldier;
|
||||
|
||||
cnt = gTacticalStatus.Team[ MILITIA_TEAM ].bFirstID;
|
||||
|
||||
for ( pTeamSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ MILITIA_TEAM ].bLastID; cnt++, pTeamSoldier++)
|
||||
for ( ; cnt <= gTacticalStatus.Team[ MILITIA_TEAM ].bLastID; ++cnt )
|
||||
{
|
||||
pTeamSoldier = cnt;
|
||||
if ( (pTeamSoldier->bActive) && (pTeamSoldier->bInSector) && (pTeamSoldier->stats.bLife >= OKLIFE) )
|
||||
{
|
||||
// sevenfm: stop any AI
|
||||
@@ -1614,14 +1616,15 @@ void MilitiaControlMenuBtnCallBack( MOUSE_REGION * pRegion, INT32 iReason )
|
||||
case( MILCON_MENU_ALL_SPREAD ):
|
||||
if (fAllowSectorOrder)
|
||||
{
|
||||
UINT8 cnt;
|
||||
SoldierID cnt;
|
||||
INT32 sActionGridNo;
|
||||
SOLDIERTYPE *pTeamSoldier;
|
||||
|
||||
cnt = gTacticalStatus.Team[ MILITIA_TEAM ].bFirstID;
|
||||
|
||||
for ( pTeamSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ MILITIA_TEAM ].bLastID; cnt++, pTeamSoldier++)
|
||||
for ( ; cnt <= gTacticalStatus.Team[ MILITIA_TEAM ].bLastID; ++cnt )
|
||||
{
|
||||
pTeamSoldier = cnt;
|
||||
if ( (pTeamSoldier->bActive) && (pTeamSoldier->bInSector) && (pTeamSoldier->stats.bLife >= OKLIFE) )
|
||||
{
|
||||
// sevenfm: stop any AI
|
||||
@@ -1667,13 +1670,14 @@ void MilitiaControlMenuBtnCallBack( MOUSE_REGION * pRegion, INT32 iReason )
|
||||
case( MILCON_MENU_ALL_GETDOWN ):
|
||||
if (fAllowSectorOrder)
|
||||
{
|
||||
UINT8 cnt;
|
||||
SoldierID cnt;
|
||||
SOLDIERTYPE *pTeamSoldier;
|
||||
|
||||
cnt = gTacticalStatus.Team[ MILITIA_TEAM ].bFirstID;
|
||||
|
||||
for ( pTeamSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ MILITIA_TEAM ].bLastID; cnt++, pTeamSoldier++)
|
||||
for ( ; cnt <= gTacticalStatus.Team[ MILITIA_TEAM ].bLastID; ++cnt )
|
||||
{
|
||||
pTeamSoldier = cnt;
|
||||
if ( (pTeamSoldier->bActive) && (pTeamSoldier->bInSector) && (pTeamSoldier->stats.bLife >= OKLIFE) )
|
||||
{
|
||||
// sevenfm: stop any AI
|
||||
@@ -1705,13 +1709,14 @@ void MilitiaControlMenuBtnCallBack( MOUSE_REGION * pRegion, INT32 iReason )
|
||||
case( MILCON_MENU_ALL_CROUCH ):
|
||||
if (fAllowSectorOrder)
|
||||
{
|
||||
UINT8 cnt;
|
||||
SoldierID cnt;
|
||||
SOLDIERTYPE *pTeamSoldier;
|
||||
|
||||
cnt = gTacticalStatus.Team[ MILITIA_TEAM ].bFirstID;
|
||||
|
||||
for ( pTeamSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ MILITIA_TEAM ].bLastID; ++cnt, ++pTeamSoldier)
|
||||
for ( ; cnt <= gTacticalStatus.Team[ MILITIA_TEAM ].bLastID; ++cnt )
|
||||
{
|
||||
pTeamSoldier = cnt;
|
||||
if ( (pTeamSoldier->bActive) && (pTeamSoldier->bInSector) && (pTeamSoldier->stats.bLife >= OKLIFE) )
|
||||
{
|
||||
// sevenfm: stop any AI
|
||||
@@ -1743,15 +1748,16 @@ void MilitiaControlMenuBtnCallBack( MOUSE_REGION * pRegion, INT32 iReason )
|
||||
case( MILCON_MENU_ALL_TAKE_COVER ):
|
||||
if (fAllowSectorOrder)
|
||||
{
|
||||
UINT8 cnt;
|
||||
SoldierID cnt;
|
||||
INT16 sActionGridNo;
|
||||
INT32 iDummy;
|
||||
SOLDIERTYPE *pTeamSoldier;
|
||||
|
||||
cnt = gTacticalStatus.Team[ MILITIA_TEAM ].bFirstID;
|
||||
|
||||
for ( pTeamSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ MILITIA_TEAM ].bLastID; cnt++, pTeamSoldier++)
|
||||
for ( ; cnt <= gTacticalStatus.Team[ MILITIA_TEAM ].bLastID; ++cnt )
|
||||
{
|
||||
pTeamSoldier = cnt;
|
||||
if ( (pTeamSoldier->bActive) && (pTeamSoldier->bInSector) && (pTeamSoldier->stats.bLife >= OKLIFE) )
|
||||
{
|
||||
// sevenfm: stop any AI
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef __MILITIA_CONTROL_H
|
||||
#define __MILITIA_CONTROL_H
|
||||
|
||||
#include "Types.h"
|
||||
#include "types.h"
|
||||
#include "Soldier Control.h"
|
||||
#include "mousesystem.h"
|
||||
#include "Strategic Movement.h"
|
||||
@@ -28,4 +28,4 @@ BOOLEAN CreateDestroyMilitiaControlPopUpBoxes( void );
|
||||
|
||||
BOOLEAN CheckIfRadioIsEquipped( void );
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -43,4 +43,4 @@ void SetInteractivePicture( std::string aStr, bool aVal );
|
||||
void MiniGame_Init_Picture();
|
||||
UINT32 MiniGame_Handle_Picture();
|
||||
|
||||
#endif //__MINIGAME_H
|
||||
#endif //__MINIGAME_H
|
||||
|
||||
+4
-31
@@ -5,49 +5,22 @@
|
||||
|
||||
#include "builddefines.h"
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include "sgp.h"
|
||||
#include "gameloop.h"
|
||||
#include "MiniGame.h"
|
||||
#include "WCheck.h"
|
||||
#include "Utilities.h"
|
||||
#include "Overhead Types.h"
|
||||
#include "WordWrap.h"
|
||||
#include "Cursors.h"
|
||||
#include "Line.h"
|
||||
#include "Insurance Text.h"
|
||||
#include "Encrypted File.h"
|
||||
#include "Text.h"
|
||||
#include "Multi Language Graphic Utils.h"
|
||||
#include "random.h"
|
||||
#include "Interface.h"
|
||||
#include "DropDown.h"
|
||||
#include "finances.h"
|
||||
#include "Game Clock.h"
|
||||
#include "GameVersion.h"
|
||||
#include "GameSettings.h"
|
||||
#include "message.h"
|
||||
#include "Game Event Hook.h"
|
||||
#include "Handle UI.h"
|
||||
#include "Overhead.h"
|
||||
#include "Sound Control.h"
|
||||
#include "himage.h"
|
||||
#include "vobject.h"
|
||||
#include "vobject_blitters.h"
|
||||
#include "wcheck.h"
|
||||
#include "input.h"
|
||||
#include "font.h"
|
||||
#include "timer.h"
|
||||
#include "mousesystem.h"
|
||||
#include <wchar.h>
|
||||
#include <tchar.h>
|
||||
#include "Font.h"
|
||||
#include "Timer Control.h"
|
||||
#include "Sys Globals.h"
|
||||
#include "interface.h"
|
||||
#include "utilities.h"
|
||||
#include "render dirty.h"
|
||||
#include "cursor control.h"
|
||||
#include "utilities.h"
|
||||
#include "Cursor Control.h"
|
||||
#include "english.h"
|
||||
#include "WordWrap.h"
|
||||
#include "gamescreen.h"
|
||||
#include "Isometric Utils.h"
|
||||
#include "math.h"
|
||||
|
||||
+80
-78
@@ -1,40 +1,29 @@
|
||||
#include <stdlib.h>
|
||||
#include <cstdlib>
|
||||
#include "Morale.h"
|
||||
#include "Overhead.h"
|
||||
#include "Soldier Profile.h"
|
||||
#include "dialogue control.h"
|
||||
#include "Map Screen Interface.h"
|
||||
#include "Dialogue Control.h"
|
||||
#include "message.h"
|
||||
#include "assignments.h"
|
||||
#include "Assignments.h"
|
||||
#include "Strategic Movement.h"
|
||||
#include "Strategic Status.h"
|
||||
#include "SkillCheck.h"
|
||||
#include "drugs and alcohol.h"
|
||||
#include "StrategicMap.h"
|
||||
#include "Debug.h"
|
||||
#include "Drugs And Alcohol.h"
|
||||
#include "strategicmap.h"
|
||||
#include "DEBUG.H"
|
||||
#include "Squads.h"
|
||||
#include "ai.h"
|
||||
#include "Campaign.h"
|
||||
#include "mapscreen.h"
|
||||
#include "Soldier macros.h"
|
||||
#include "Event Pump.h"
|
||||
// HEADROCK HAM 3.5: Added for facility effect on morale
|
||||
#include "Facilities.h"
|
||||
// addedd by SANDRO
|
||||
#include "GameSettings.h"
|
||||
#include "Isometric Utils.h"
|
||||
#include "Food.h"
|
||||
#include "Interface.h" // added by Flugente
|
||||
#include "finances.h" // added by Flugente for EXTENDED_CONTRACT_BY_1_DAY
|
||||
#include "Soldier Add.h" // added by Flugente for MERC_TYPE__AIM_MERC
|
||||
#include "CampaignStats.h" // added by Flugente for gCurrentIncident
|
||||
#include "DynamicDialogue.h" // added by Flugente
|
||||
|
||||
#include "connect.h"
|
||||
#include "fresh_header.h"
|
||||
|
||||
#include "Random.h"
|
||||
|
||||
#include "random.h"
|
||||
#include "Merc Contract.h"
|
||||
|
||||
//#define MORALE_MOD_MAX 50 // morale *mod* range is -50 to 50, if you change this, check the decay formulas!
|
||||
@@ -253,12 +242,13 @@ void DecayStrategicMorale( SOLDIERTYPE * pSoldier )
|
||||
void DecayTacticalMoraleModifiers( void )
|
||||
{
|
||||
SOLDIERTYPE * pSoldier;
|
||||
UINT8 ubLoop, ubLoop2;
|
||||
SoldierID ubLoop, ubLoop2;
|
||||
BOOLEAN fHandleNervous;
|
||||
|
||||
ubLoop = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
for ( pSoldier = MercPtrs[ ubLoop ]; ubLoop <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ubLoop++, pSoldier++ )
|
||||
for ( ; ubLoop <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++ubLoop )
|
||||
{
|
||||
pSoldier = ubLoop;
|
||||
//if the merc is active, in Arulco
|
||||
// CJC: decay modifiers while asleep! or POW!
|
||||
if ( pSoldier->bActive && pSoldier->ubProfile != NO_PROFILE &&
|
||||
@@ -313,9 +303,10 @@ void DecayTacticalMoraleModifiers( void )
|
||||
{
|
||||
// look for anyone else in same sector
|
||||
fHandleNervous = TRUE;
|
||||
for ( ubLoop2 = gTacticalStatus.Team[ gbPlayerNum ].bFirstID; ubLoop2 <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ubLoop2++ )
|
||||
for ( ubLoop2 = gTacticalStatus.Team[ gbPlayerNum ].bFirstID; ubLoop2 <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++ubLoop2 )
|
||||
{
|
||||
if ( MercPtrs[ ubLoop2 ] != pSoldier && MercPtrs[ ubLoop2 ]->bActive && MercPtrs[ ubLoop2 ]->sSectorX == pSoldier->sSectorX && MercPtrs[ ubLoop2 ]->sSectorY == pSoldier->sSectorY && MercPtrs[ ubLoop2 ]->bSectorZ == pSoldier->bSectorZ )
|
||||
SOLDIERTYPE *pSoldier2 = ubLoop2;
|
||||
if ( pSoldier2 != pSoldier && pSoldier2->bActive && pSoldier2->sSectorX == pSoldier->sSectorX && pSoldier2->sSectorY == pSoldier->sSectorY && pSoldier2->bSectorZ == pSoldier->bSectorZ )
|
||||
{
|
||||
// found someone!
|
||||
fHandleNervous = FALSE;
|
||||
@@ -360,11 +351,11 @@ void DecayTacticalMoraleModifiers( void )
|
||||
void DecayStrategicMoraleModifiers( void )
|
||||
{
|
||||
SOLDIERTYPE * pSoldier;
|
||||
UINT8 ubLoop;
|
||||
SoldierID ubLoop = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
|
||||
ubLoop = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
for ( pSoldier = MercPtrs[ ubLoop ]; ubLoop <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ubLoop++, pSoldier++ )
|
||||
for ( ; ubLoop <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++ubLoop )
|
||||
{
|
||||
pSoldier = ubLoop;
|
||||
//if the merc is active, in Arulco
|
||||
// CJC: decay modifiers while asleep! or POW!
|
||||
if ( pSoldier->bActive && pSoldier->ubProfile != NO_PROFILE &&
|
||||
@@ -726,9 +717,9 @@ void HandleMoraleEventForSoldier( SOLDIERTYPE * pSoldier, INT8 bMoraleEvent )
|
||||
|
||||
void HandleMoraleEvent( SOLDIERTYPE *pSoldier, INT8 bMoraleEvent, INT16 sMapX, INT16 sMapY, INT8 bMapZ )
|
||||
{
|
||||
UINT8 ubLoop;
|
||||
SOLDIERTYPE * pTeamSoldier;
|
||||
MERCPROFILESTRUCT * pProfile;
|
||||
SoldierID id;
|
||||
SOLDIERTYPE *pTeamSoldier;
|
||||
MERCPROFILESTRUCT *pProfile;
|
||||
|
||||
gfSomeoneSaidMoraleQuote = FALSE;
|
||||
|
||||
@@ -776,9 +767,10 @@ void HandleMoraleEvent( SOLDIERTYPE *pSoldier, INT8 bMoraleEvent, INT16 sMapX, I
|
||||
|
||||
case MORALE_BATTLE_WON:
|
||||
// affects everyone to varying degrees
|
||||
ubLoop = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
for ( pTeamSoldier = MercPtrs[ ubLoop ]; ubLoop <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ubLoop++, pTeamSoldier++ )
|
||||
id = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
for ( ; id <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++id )
|
||||
{
|
||||
pTeamSoldier = id;
|
||||
if ( pTeamSoldier->bActive )
|
||||
{
|
||||
if ( SOLDIER_IN_SECTOR( pTeamSoldier, sMapX, sMapY, bMapZ ) )
|
||||
@@ -795,9 +787,10 @@ void HandleMoraleEvent( SOLDIERTYPE *pSoldier, INT8 bMoraleEvent, INT16 sMapX, I
|
||||
break;
|
||||
case MORALE_RAN_AWAY:
|
||||
// affects everyone to varying degrees
|
||||
ubLoop = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
for ( pTeamSoldier = MercPtrs[ ubLoop ]; ubLoop <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ubLoop++, pTeamSoldier++ )
|
||||
id = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
for ( ; id <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ++id )
|
||||
{
|
||||
pTeamSoldier = id;
|
||||
if ( pTeamSoldier->bActive )
|
||||
{
|
||||
// CJC: adding to SOLDIER_IN_SECTOR check special stuff because the old sector values might
|
||||
@@ -867,9 +860,10 @@ void HandleMoraleEvent( SOLDIERTYPE *pSoldier, INT8 bMoraleEvent, INT16 sMapX, I
|
||||
case MORALE_MONSTER_QUEEN_KILLED:
|
||||
case MORALE_DEIDRANNA_KILLED:
|
||||
// affects everyone, everywhere
|
||||
ubLoop = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
for ( pTeamSoldier = MercPtrs[ ubLoop ]; ubLoop <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ubLoop++, pTeamSoldier++ )
|
||||
id = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||
for ( ; id <= gTacticalStatus.Team[gbPlayerNum].bLastID; ++id )
|
||||
{
|
||||
pTeamSoldier = id;
|
||||
if ( pTeamSoldier->bActive )
|
||||
{
|
||||
if ( gGameOptions.fNewTraitSystem && bMoraleEvent != MORALE_DEIDRANNA_KILLED)
|
||||
@@ -896,9 +890,10 @@ void HandleMoraleEvent( SOLDIERTYPE *pSoldier, INT8 bMoraleEvent, INT16 sMapX, I
|
||||
case MORALE_GREAT_MORALE:
|
||||
case MORALE_AIRSTRIKE:
|
||||
// affects every in sector
|
||||
ubLoop = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
for ( pTeamSoldier = MercPtrs[ ubLoop ]; ubLoop <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ubLoop++, pTeamSoldier++ )
|
||||
id = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||
for ( ; id <= gTacticalStatus.Team[gbPlayerNum].bLastID; ++id )
|
||||
{
|
||||
pTeamSoldier = id;
|
||||
if ( pTeamSoldier->bActive && SOLDIER_IN_SECTOR( pTeamSoldier, sMapX, sMapY, bMapZ ) )
|
||||
{
|
||||
HandleMoraleEventForSoldier( pTeamSoldier, bMoraleEvent );
|
||||
@@ -911,9 +906,10 @@ void HandleMoraleEvent( SOLDIERTYPE *pSoldier, INT8 bMoraleEvent, INT16 sMapX, I
|
||||
Assert( pSoldier );
|
||||
|
||||
// affects everyone
|
||||
ubLoop = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
for ( pTeamSoldier = MercPtrs[ ubLoop ]; ubLoop <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ubLoop++, pTeamSoldier++ )
|
||||
id = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||
for ( ; id <= gTacticalStatus.Team[gbPlayerNum].bLastID; ++id )
|
||||
{
|
||||
pTeamSoldier = id;
|
||||
if ( pTeamSoldier->bActive )
|
||||
{
|
||||
HandleMoraleEventForSoldier( pTeamSoldier, bMoraleEvent );
|
||||
@@ -925,9 +921,10 @@ void HandleMoraleEvent( SOLDIERTYPE *pSoldier, INT8 bMoraleEvent, INT16 sMapX, I
|
||||
Assert( pSoldier );
|
||||
|
||||
// affects everyone, in sector differently than not, extra bonuses if it's a buddy or hated merc
|
||||
ubLoop = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
for ( pTeamSoldier = MercPtrs[ ubLoop ]; ubLoop <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ubLoop++, pTeamSoldier++ )
|
||||
id = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||
for ( ; id <= gTacticalStatus.Team[gbPlayerNum].bLastID; ++id )
|
||||
{
|
||||
pTeamSoldier = id;
|
||||
if ( pTeamSoldier->bActive && pTeamSoldier->ubProfile != NO_PROFILE)
|
||||
{
|
||||
pProfile = &(gMercProfiles[ pTeamSoldier->ubProfile ]);
|
||||
@@ -980,9 +977,10 @@ void HandleMoraleEvent( SOLDIERTYPE *pSoldier, INT8 bMoraleEvent, INT16 sMapX, I
|
||||
// female mercs get unhappy based on how sexist they are (=hate men)
|
||||
// gentlemen males get unhappy too
|
||||
|
||||
ubLoop = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
for ( pTeamSoldier = MercPtrs[ ubLoop ]; ubLoop <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; ubLoop++, pTeamSoldier++ )
|
||||
id = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||
for ( ; id <= gTacticalStatus.Team[gbPlayerNum].bLastID; ++id )
|
||||
{
|
||||
pTeamSoldier = id;
|
||||
if ( pTeamSoldier->bActive && pTeamSoldier->ubProfile != NO_PROFILE )
|
||||
{
|
||||
if ( WhichHated( pTeamSoldier->ubProfile, pSoldier->ubProfile ) != -1 )
|
||||
@@ -1042,9 +1040,10 @@ void HandleMoraleEvent( SOLDIERTYPE *pSoldier, INT8 bMoraleEvent, INT16 sMapX, I
|
||||
|
||||
case MORALE_ENEMYGROUP_COWARD:
|
||||
// affects coward in sector
|
||||
ubLoop = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||
for ( pTeamSoldier = MercPtrs[ubLoop]; ubLoop <= gTacticalStatus.Team[gbPlayerNum].bLastID; ubLoop++, pTeamSoldier++ )
|
||||
id = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||
for ( ; id <= gTacticalStatus.Team[gbPlayerNum].bLastID; ++id )
|
||||
{
|
||||
pTeamSoldier = id;
|
||||
if ( pTeamSoldier->bActive && (pTeamSoldier->sSectorX == sMapX) && (pTeamSoldier->sSectorY == sMapY) && (pTeamSoldier->bSectorZ == bMapZ) )
|
||||
{
|
||||
if ( DoesMercHavePersonality( pTeamSoldier, CHAR_TRAIT_COWARD ) )
|
||||
@@ -1140,28 +1139,28 @@ void HandleMoraleEvent( SOLDIERTYPE *pSoldier, INT8 bMoraleEvent, INT16 sMapX, I
|
||||
|
||||
void HourlyMoraleUpdate( void )
|
||||
{
|
||||
INT8 bMercID, bOtherID;
|
||||
INT8 bActualTeamOpinion;
|
||||
INT8 bTeamMoraleModChange, bTeamMoraleModDiff;
|
||||
INT8 bOpinion=-1;
|
||||
INT32 iTotalOpinions;
|
||||
INT8 bNumTeamMembers;
|
||||
INT8 bHighestTeamLeadership = 0;
|
||||
INT8 bLastTeamID;
|
||||
SOLDIERTYPE * pSoldier;
|
||||
SOLDIERTYPE * pOtherSoldier;
|
||||
MERCPROFILESTRUCT * pProfile;
|
||||
BOOLEAN fSameGroupOnly;
|
||||
static INT8 bStrategicMoraleUpdateCounter = 0;
|
||||
BOOLEAN fFoundHated = FALSE;
|
||||
INT8 bHated;
|
||||
SoldierID bMercID, bOtherID, bLastTeamID;
|
||||
INT8 bActualTeamOpinion;
|
||||
INT8 bTeamMoraleModChange, bTeamMoraleModDiff;
|
||||
INT8 bOpinion=-1;
|
||||
INT32 iTotalOpinions;
|
||||
INT8 bNumTeamMembers;
|
||||
INT8 bHighestTeamLeadership = 0;
|
||||
SOLDIERTYPE *pSoldier;
|
||||
SOLDIERTYPE *pOtherSoldier;
|
||||
MERCPROFILESTRUCT *pProfile;
|
||||
BOOLEAN fSameGroupOnly;
|
||||
static INT8 bStrategicMoraleUpdateCounter = 0;
|
||||
BOOLEAN fFoundHated = FALSE;
|
||||
INT8 bHated;
|
||||
|
||||
bMercID = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
bLastTeamID = gTacticalStatus.Team[ gbPlayerNum ].bLastID;
|
||||
|
||||
// loop through all mercs to calculate their morale
|
||||
for ( pSoldier = MercPtrs[ bMercID ]; bMercID <= bLastTeamID; ++bMercID,pSoldier++)
|
||||
for ( ; bMercID <= bLastTeamID; ++bMercID )
|
||||
{
|
||||
pSoldier = bMercID;
|
||||
//if the merc is active, in Arulco, and conscious, not POW
|
||||
if ( pSoldier->bActive && pSoldier->ubProfile != NO_PROFILE &&
|
||||
!(pSoldier->bAssignment == IN_TRANSIT ||
|
||||
@@ -1193,8 +1192,9 @@ void HourlyMoraleUpdate( void )
|
||||
|
||||
// loop through all other mercs
|
||||
bOtherID = gTacticalStatus.Team[ gbPlayerNum ].bFirstID;
|
||||
for ( pOtherSoldier = MercPtrs[ bOtherID ]; bOtherID <= bLastTeamID; bOtherID++,pOtherSoldier++)
|
||||
for ( ; bOtherID <= bLastTeamID; ++bOtherID )
|
||||
{
|
||||
pOtherSoldier = bOtherID;
|
||||
// skip past ourselves and all inactive mercs
|
||||
if (bOtherID != bMercID && pOtherSoldier->bActive && pOtherSoldier->ubProfile != NO_PROFILE &&
|
||||
!(pOtherSoldier->bAssignment == IN_TRANSIT ||
|
||||
@@ -1344,13 +1344,12 @@ void HourlyMoraleUpdate( void )
|
||||
|
||||
void HandleSnitchCheck( void )
|
||||
{
|
||||
UINT16 bMercID, bOtherID;
|
||||
INT8 bOpinion = -1;
|
||||
UINT16 bLastTeamID;
|
||||
SOLDIERTYPE* pSoldier;
|
||||
SOLDIERTYPE* pOtherSoldier;
|
||||
MERCPROFILESTRUCT* pProfile;
|
||||
BOOLEAN fSameGroupOnly;
|
||||
SoldierID bMercID, bOtherID, bLastTeamID;
|
||||
INT8 bOpinion = -1;
|
||||
SOLDIERTYPE *pSoldier;
|
||||
SOLDIERTYPE *pOtherSoldier;
|
||||
MERCPROFILESTRUCT *pProfile;
|
||||
BOOLEAN fSameGroupOnly;
|
||||
// anv: save merc id and his negative morale event for snitches
|
||||
std::vector<SnitchEvent> snitcheventvector;
|
||||
|
||||
@@ -1358,8 +1357,9 @@ void HandleSnitchCheck( void )
|
||||
bLastTeamID = gTacticalStatus.Team[gbPlayerNum].bLastID;
|
||||
|
||||
// loop through all mercs to calculate their morale
|
||||
for ( pSoldier = MercPtrs[bMercID]; bMercID <= bLastTeamID; ++bMercID, pSoldier++ )
|
||||
for ( ; bMercID <= bLastTeamID; ++bMercID )
|
||||
{
|
||||
pSoldier = bMercID;
|
||||
//if the merc is active, in Arulco, not POW, not a vehicle
|
||||
if ( pSoldier && pSoldier->bActive && pSoldier->ubProfile != NO_PROFILE &&
|
||||
!(pSoldier->bAssignment == IN_TRANSIT ||
|
||||
@@ -1382,8 +1382,9 @@ void HandleSnitchCheck( void )
|
||||
}
|
||||
// loop through all other mercs
|
||||
bOtherID = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||
for ( pOtherSoldier = MercPtrs[bOtherID]; bOtherID <= bLastTeamID; ++bOtherID, pOtherSoldier++ )
|
||||
for ( ; bOtherID <= bLastTeamID; ++bOtherID )
|
||||
{
|
||||
pOtherSoldier = bOtherID;
|
||||
// skip past ourselves and all inactive mercs
|
||||
if ( bOtherID != bMercID && pOtherSoldier && pOtherSoldier->bActive && pOtherSoldier->ubProfile != NO_PROFILE &&
|
||||
!(pOtherSoldier->bAssignment == IN_TRANSIT ||
|
||||
@@ -1557,7 +1558,7 @@ void HandleSnitchesReports( std::vector<SnitchEvent>& aVec )
|
||||
|
||||
void RememberSnitchableEvent( UINT8 ubTargetProfile, UINT8 ubSecondaryTargetProfile, BOOLEAN fSameGroupOnly, UINT8 ubEventType, std::vector<SnitchEvent>& aVec )
|
||||
{
|
||||
UINT16 bSnitchID;
|
||||
SoldierID bSnitchID;
|
||||
INT16 sSnitchingChance = 0;
|
||||
UINT8 ubSnitchProfile;
|
||||
SOLDIERTYPE * pSnitch;
|
||||
@@ -1569,8 +1570,9 @@ void RememberSnitchableEvent( UINT8 ubTargetProfile, UINT8 ubSecondaryTargetProf
|
||||
|
||||
// loop through all other mercs
|
||||
bSnitchID = gTacticalStatus.Team[gbPlayerNum].bFirstID;
|
||||
for ( pSnitch = MercPtrs[bSnitchID]; bSnitchID <= gTacticalStatus.Team[gbPlayerNum].bLastID; ++bSnitchID, pSnitch++ )
|
||||
for ( ; bSnitchID <= gTacticalStatus.Team[gbPlayerNum].bLastID; ++bSnitchID )
|
||||
{
|
||||
pSnitch = bSnitchID;
|
||||
ubSnitchProfile = pSnitch->ubProfile;
|
||||
// skip past ourselves and all inactive mercs
|
||||
if ( ProfileHasSkillTrait( ubSnitchProfile, SNITCH_NT ) &&
|
||||
@@ -1702,10 +1704,10 @@ void DailyMoraleUpdate(SOLDIERTYPE *pSoldier)
|
||||
// Added by SANDRO
|
||||
BOOLEAN IsShowOffNearBy( SOLDIERTYPE * pSoldier )
|
||||
{
|
||||
UINT32 uiLoop;
|
||||
SOLDIERTYPE * pTeammate;
|
||||
BOOLEAN fOneException = FALSE;
|
||||
BOOLEAN fYesHeIs = FALSE;
|
||||
SoldierID uiLoop;
|
||||
SOLDIERTYPE *pTeammate;
|
||||
BOOLEAN fOneException = FALSE;
|
||||
BOOLEAN fYesHeIs = FALSE;
|
||||
|
||||
if (!pSoldier)
|
||||
{
|
||||
@@ -1716,9 +1718,9 @@ BOOLEAN IsShowOffNearBy( SOLDIERTYPE * pSoldier )
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
for ( uiLoop = gTacticalStatus.Team[ pSoldier->bTeam ].bFirstID; uiLoop <= gTacticalStatus.Team[ pSoldier->bTeam ].bLastID; uiLoop++)
|
||||
for ( uiLoop = gTacticalStatus.Team[ pSoldier->bTeam ].bFirstID; uiLoop <= gTacticalStatus.Team[ pSoldier->bTeam ].bLastID; ++uiLoop )
|
||||
{
|
||||
pTeammate = MercPtrs[ uiLoop ];
|
||||
pTeammate = uiLoop;
|
||||
if ( pTeammate == NULL )
|
||||
{
|
||||
continue;
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
#ifndef _MORALE_H
|
||||
#define _MORALE_H
|
||||
|
||||
#include "Types.h"
|
||||
#include "types.h"
|
||||
#include "Soldier Control.h"
|
||||
|
||||
//#define DEFAULT_MORALE 50
|
||||
@@ -160,4 +160,4 @@ void DailyMoraleUpdate( SOLDIERTYPE *pSoldier );
|
||||
|
||||
void DecayTacticalMoraleModifiers( void );
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+131
-18
@@ -2,7 +2,7 @@
|
||||
#define __OVERHEAD_TYPES_H
|
||||
// GLOBAL HEADER FOR DATA, TYPES FOR TACTICAL ENGINE
|
||||
|
||||
#include "Types.h"
|
||||
#include "types.h"
|
||||
|
||||
#define REFINE_AIM_1 0
|
||||
#define REFINE_AIM_MID1 1
|
||||
@@ -32,7 +32,7 @@
|
||||
//TACTICAL OVERHEAD STUFF
|
||||
//#define NO_SOLDIER TOTAL_SOLDIERS // SAME AS NOBODY
|
||||
//#define NOBODY NO_SOLDIER
|
||||
#define NOBODY TOTAL_SOLDIERS
|
||||
//#define NOBODY TOTAL_SOLDIERS
|
||||
|
||||
|
||||
|
||||
@@ -277,31 +277,32 @@ const int startingZ = 0;
|
||||
|
||||
// ENUMERATION OF SOLDIER POSIITONS IN GLOBAL SOLDIER LIST
|
||||
// WDS - make number of mercenaries, etc. be configurable
|
||||
#define CODE_MAXIMUM_NUMBER_OF_PLAYER_MERCS 32
|
||||
extern UINT8 giMAXIMUM_NUMBER_OF_PLAYER_MERCS;
|
||||
#define CODE_MAXIMUM_NUMBER_OF_PLAYER_MERCS 254
|
||||
extern UINT16 giMAXIMUM_NUMBER_OF_PLAYER_MERCS;
|
||||
#define CODE_MAXIMUM_NUMBER_OF_PLAYER_VEHICLES 6
|
||||
extern UINT8 giMAXIMUM_NUMBER_OF_PLAYER_VEHICLES;
|
||||
extern UINT16 giMAXIMUM_NUMBER_OF_PLAYER_VEHICLES;
|
||||
#define CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS CODE_MAXIMUM_NUMBER_OF_PLAYER_MERCS+CODE_MAXIMUM_NUMBER_OF_PLAYER_VEHICLES
|
||||
extern UINT8 giMAXIMUM_NUMBER_OF_PLAYER_SLOTS;
|
||||
#define CODE_MAXIMUM_NUMBER_OF_ENEMIES 64
|
||||
extern UINT8 giMAXIMUM_NUMBER_OF_ENEMIES;
|
||||
#define CODE_MAXIMUM_NUMBER_OF_CREATURES 40
|
||||
extern UINT8 giMAXIMUM_NUMBER_OF_CREATURES;
|
||||
#define CODE_MAXIMUM_NUMBER_OF_REBELS 64
|
||||
extern UINT8 giMAXIMUM_NUMBER_OF_REBELS;
|
||||
#define CODE_MAXIMUM_NUMBER_OF_CIVS 40
|
||||
extern UINT8 giMAXIMUM_NUMBER_OF_CIVS;
|
||||
extern UINT16 giMAXIMUM_NUMBER_OF_PLAYER_SLOTS;
|
||||
#define CODE_MAXIMUM_NUMBER_OF_ENEMIES 256
|
||||
extern UINT16 giMAXIMUM_NUMBER_OF_ENEMIES;
|
||||
#define CODE_MAXIMUM_NUMBER_OF_CREATURES 256
|
||||
extern UINT16 giMAXIMUM_NUMBER_OF_CREATURES;
|
||||
#define CODE_MAXIMUM_NUMBER_OF_REBELS 256
|
||||
extern UINT16 giMAXIMUM_NUMBER_OF_REBELS;
|
||||
#define CODE_MAXIMUM_NUMBER_OF_CIVS 256
|
||||
extern UINT16 giMAXIMUM_NUMBER_OF_CIVS;
|
||||
|
||||
// The following should be the largest from the above set of constants.
|
||||
// Note: Is there any way to compute this via the preprocessor?
|
||||
#define LARGEST_NUMBER_IN_ANY_GROUP 64
|
||||
#define LARGEST_NUMBER_IN_ANY_GROUP 260
|
||||
|
||||
#define MAX_NUM_SOLDIERS (CODE_MAXIMUM_NUMBER_OF_PLAYER_MERCS+CODE_MAXIMUM_NUMBER_OF_PLAYER_VEHICLES+CODE_MAXIMUM_NUMBER_OF_ENEMIES+CODE_MAXIMUM_NUMBER_OF_CREATURES+CODE_MAXIMUM_NUMBER_OF_REBELS+CODE_MAXIMUM_NUMBER_OF_CIVS)
|
||||
#define NUM_PLANNING_MERCS 8
|
||||
#define TOTAL_SOLDIERS ( NUM_PLANNING_MERCS + MAX_NUM_SOLDIERS )
|
||||
//#define TOTAL_SOLDIERS ( NUM_PLANNING_MERCS + MAX_NUM_SOLDIERS )
|
||||
#define TOTAL_SOLDIERS (MAX_NUM_SOLDIERS )
|
||||
|
||||
// If there are more than (one less the size of the field used to store IDs (currently a char)) then fail
|
||||
#if TOTAL_SOLDIERS > 254
|
||||
#if TOTAL_SOLDIERS > 2048
|
||||
#error Too many!
|
||||
#endif
|
||||
#if CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS > LARGEST_NUMBER_IN_ANY_GROUP
|
||||
@@ -360,7 +361,7 @@ typedef CHAR8 PaletteRepID[ 30 ];
|
||||
typedef struct
|
||||
{
|
||||
UINT8 ubType;
|
||||
PaletteRepID ID;
|
||||
PaletteRepID ID;
|
||||
UINT8 ubPaletteSize;
|
||||
UINT8 *r;
|
||||
UINT8 *g;
|
||||
@@ -374,4 +375,116 @@ typedef struct
|
||||
// strcmp returns 0 if true!
|
||||
#define COMPARE_PALETTEREP_ID( a, b ) ( strcmp( a, b ) ? FALSE : TRUE )
|
||||
|
||||
|
||||
struct SOLDIERTYPE;
|
||||
extern SOLDIERTYPE *MercPtrs[TOTAL_SOLDIERS];
|
||||
|
||||
typedef struct SoldierID
|
||||
{
|
||||
UINT16 i;
|
||||
|
||||
// Implicit conversion and constructor to provide compatibility with unchanged code
|
||||
// TODO: Remove once SoldierID is used everywhere and these are no longer needed
|
||||
inline operator UINT16() const { return i; }
|
||||
|
||||
constexpr SoldierID(const UINT16 val = TOTAL_SOLDIERS) : i(val)
|
||||
{
|
||||
// Limit the maximum value to TOTAL_SOLDIERS. Anything beyond that is invalid
|
||||
if ( i > TOTAL_SOLDIERS )
|
||||
i = TOTAL_SOLDIERS;
|
||||
}
|
||||
constexpr SoldierID( const UINT32 val ) : i( val )
|
||||
{
|
||||
// Limit the maximum value to TOTAL_SOLDIERS. Anything beyond that is invalid
|
||||
if ( i > TOTAL_SOLDIERS )
|
||||
i = TOTAL_SOLDIERS;
|
||||
}
|
||||
constexpr SoldierID( const INT32 val ) : i( val )
|
||||
{
|
||||
// Limit the maximum value to TOTAL_SOLDIERS. Anything beyond that is invalid
|
||||
if ( i > TOTAL_SOLDIERS || i < 0)
|
||||
i = TOTAL_SOLDIERS;
|
||||
}
|
||||
|
||||
// No conversions from 8-bit integers!
|
||||
SoldierID( const UINT8 ) = delete;
|
||||
SoldierID( const INT8 ) = delete;
|
||||
|
||||
|
||||
SOLDIERTYPE* operator->() { return MercPtrs[i]; }
|
||||
const SOLDIERTYPE* operator->() const { return MercPtrs[i]; }
|
||||
inline operator SOLDIERTYPE* () { return MercPtrs[i]; }
|
||||
inline operator const SOLDIERTYPE*() const { return MercPtrs[i]; }
|
||||
inline SoldierID &operator++()
|
||||
{
|
||||
i++;
|
||||
return *this;
|
||||
}
|
||||
inline SoldierID &operator--()
|
||||
{
|
||||
i--;
|
||||
return *this;
|
||||
}
|
||||
} SoldierID;
|
||||
|
||||
inline bool operator==(const SoldierID lhs, const SoldierID rhs) { return lhs.i == rhs.i; }
|
||||
inline bool operator==(const SoldierID lhs, const int rhs) { return lhs.i == rhs; }
|
||||
inline bool operator==(const SoldierID lhs, const UINT32 rhs) { return lhs.i == rhs; }
|
||||
inline bool operator==(const SoldierID lhs, const UINT16 rhs) { return lhs.i == rhs; }
|
||||
inline bool operator==(const SoldierID lhs, const INT16 rhs) { return lhs.i == rhs; }
|
||||
inline bool operator==(const int lhs, const SoldierID rhs) { return lhs == rhs.i; }
|
||||
inline bool operator==(const UINT16 lhs, const SoldierID rhs) { return lhs == rhs.i; }
|
||||
inline bool operator==(const INT16 lhs, const SoldierID rhs) { return lhs == rhs.i; }
|
||||
|
||||
inline bool operator!=(const SoldierID lhs, const SoldierID rhs) { return lhs.i != rhs.i; }
|
||||
inline bool operator!=(const SoldierID lhs, const UINT32 rhs) { return lhs.i != rhs; }
|
||||
inline bool operator!=(const SoldierID lhs, const UINT16 rhs) { return lhs.i != rhs; }
|
||||
inline bool operator!=(const int lhs, const SoldierID rhs) { return lhs != rhs.i; }
|
||||
inline bool operator!=(const UINT32 lhs, const SoldierID rhs) { return lhs != rhs.i; }
|
||||
inline bool operator!=(const UINT16 lhs, const SoldierID rhs) { return lhs != rhs.i; }
|
||||
inline bool operator!=(const INT16 lhs, const SoldierID rhs) { return lhs != rhs.i; }
|
||||
|
||||
inline bool operator<(const SoldierID lhs, const SoldierID rhs) { return lhs.i < rhs.i; }
|
||||
inline bool operator<(const SoldierID lhs, const int rhs) { return lhs.i < rhs; }
|
||||
inline bool operator<(const SoldierID lhs, UINT16 rhs) { return lhs.i < rhs; }
|
||||
inline bool operator<(const int lhs, const SoldierID rhs) { return lhs < rhs.i; }
|
||||
inline bool operator<(const unsigned int lhs, const SoldierID rhs) { return lhs < rhs.i; }
|
||||
inline bool operator<(const UINT16 lhs, const SoldierID rhs) { return lhs < rhs.i; }
|
||||
|
||||
inline bool operator>(const SoldierID lhs, const SoldierID rhs) { return lhs.i > rhs.i; }
|
||||
inline bool operator>(const SoldierID lhs, const int rhs) { return lhs.i > rhs; }
|
||||
inline bool operator>(const int lhs, const SoldierID rhs) { return lhs > rhs.i; }
|
||||
inline bool operator>(const UINT16 lhs, const SoldierID rhs) { return lhs > rhs.i; }
|
||||
|
||||
inline bool operator<=(const SoldierID lhs, const SoldierID rhs) { return lhs.i <= rhs.i; }
|
||||
inline bool operator<=(const SoldierID lhs, const int rhs) { return lhs.i <= rhs; }
|
||||
inline bool operator<=(const SoldierID lhs, const UINT16 rhs) { return lhs.i <= rhs; }
|
||||
inline bool operator<=(const int lhs, const SoldierID rhs) { return lhs <= rhs.i; }
|
||||
inline bool operator<=(const UINT32 lhs, const SoldierID rhs) { return lhs <= rhs.i; }
|
||||
inline bool operator<=(const UINT16 lhs, const SoldierID rhs) { return lhs <= rhs.i; }
|
||||
inline bool operator<=(const INT16 lhs, const SoldierID rhs) { return lhs <= rhs.i; }
|
||||
|
||||
inline bool operator>=(const SoldierID lhs, const SoldierID rhs) { return lhs.i >= rhs.i; }
|
||||
inline bool operator>=(const SoldierID lhs, const int rhs) { return lhs.i >= rhs; }
|
||||
inline bool operator>=(const SoldierID lhs, const UINT16 rhs) { return lhs.i >= rhs; }
|
||||
inline bool operator>=(const int lhs, const SoldierID rhs) { return lhs >= rhs.i; }
|
||||
inline bool operator>=(const unsigned int lhs, const SoldierID rhs) { return lhs >= rhs.i; }
|
||||
inline bool operator>=(const UINT16 lhs, const SoldierID rhs) { return lhs >= rhs.i; }
|
||||
|
||||
inline SoldierID operator-(const SoldierID lhs, const SoldierID rhs) { return SoldierID{ static_cast<UINT16>(lhs.i - rhs.i) }; }
|
||||
inline SoldierID operator-(const SoldierID lhs, const int rhs) { return SoldierID{ static_cast<UINT16>(lhs.i - rhs) }; }
|
||||
inline SoldierID operator-(const SoldierID lhs, const unsigned int rhs) { return SoldierID{ static_cast<UINT16>(lhs.i - rhs) }; }
|
||||
inline SoldierID operator-(const SoldierID lhs, const UINT16 rhs) { return SoldierID{ static_cast<UINT16>(lhs.i - rhs) }; }
|
||||
inline SoldierID operator-(const int lhs, const SoldierID rhs) { return SoldierID{ static_cast<UINT16>(lhs - rhs.i) }; }
|
||||
inline SoldierID operator-(const unsigned int lhs, const SoldierID rhs) { return SoldierID{ static_cast<UINT16>(lhs - rhs.i) }; }
|
||||
|
||||
inline SoldierID operator+(const SoldierID lhs, const SoldierID rhs) { return SoldierID{ static_cast<UINT16>(lhs.i + rhs.i) }; }
|
||||
inline SoldierID operator+(const SoldierID lhs, const int rhs) { return SoldierID{ static_cast<UINT16>(lhs.i + rhs) }; }
|
||||
inline SoldierID operator+(const SoldierID lhs, const unsigned int rhs) { return SoldierID{ static_cast<UINT16>(lhs.i + rhs) }; }
|
||||
inline SoldierID operator+(const SoldierID lhs, const UINT16 rhs) { return SoldierID{ static_cast<UINT16>(lhs.i + rhs) }; }
|
||||
inline SoldierID operator+(const unsigned int lhs, const SoldierID rhs) { return SoldierID{ static_cast<UINT16>(lhs + rhs.i) }; }
|
||||
inline SoldierID operator+(const INT16 lhs, const SoldierID rhs) { return SoldierID{ static_cast<UINT16>(lhs + rhs.i) }; }
|
||||
|
||||
|
||||
inline constexpr SoldierID NOBODY{ TOTAL_SOLDIERS };
|
||||
#endif
|
||||
|
||||
+697
-778
File diff suppressed because it is too large
Load Diff
+123
-125
@@ -5,7 +5,7 @@
|
||||
#include <stdio.h>
|
||||
#include "Soldier Control.h"
|
||||
#include <EditorMercs.h>
|
||||
#include "soldier find.h"
|
||||
#include "Soldier Find.h"
|
||||
#include "Campaign Types.h" // added by Flugente for SECTORINFO and UNDERGROUND_SECTORINFO
|
||||
#define ADD_SOLDIER_NO_PROFILE_ID 200
|
||||
|
||||
@@ -23,12 +23,12 @@ enum
|
||||
// TACTICAL ENGINE STATUS FLAGS
|
||||
typedef struct
|
||||
{
|
||||
UINT8 bFirstID;
|
||||
UINT8 bLastID;
|
||||
SoldierID bFirstID;
|
||||
SoldierID bLastID;
|
||||
COLORVAL RadarColor;
|
||||
INT8 bSide;
|
||||
INT8 bMenInSector;
|
||||
UINT8 ubLastMercToRadio;
|
||||
INT16 bMenInSector;
|
||||
SoldierID ubLastMercToRadio;
|
||||
INT8 bTeamActive;
|
||||
INT8 bAwareOfOpposition;
|
||||
INT8 bHuman;
|
||||
@@ -60,109 +60,108 @@ enum
|
||||
|
||||
struct TacticalStatusType
|
||||
{
|
||||
UINT32 uiFlags;
|
||||
UINT32 uiFlags;
|
||||
TacticalTeamType Team[ MAXTEAMS ];
|
||||
UINT8 ubCurrentTeam;
|
||||
INT32 sSlideTarget;
|
||||
INT16 sSlideReason;
|
||||
UINT32 uiTimeSinceMercAIStart;
|
||||
INT8 fPanicFlags;
|
||||
INT32 sPanicTriggerGridNoUnused;
|
||||
INT16 sHandGrid;
|
||||
UINT8 ubSpottersCalledForBy;
|
||||
UINT8 ubTheChosenOne;
|
||||
UINT32 uiTimeOfLastInput;
|
||||
UINT32 uiTimeSinceDemoOn;
|
||||
UINT32 uiCountdownToRestart;
|
||||
BOOLEAN fGoingToEnterDemo;
|
||||
BOOLEAN fNOTDOLASTDEMO;
|
||||
BOOLEAN fMultiplayer;
|
||||
BOOLEAN fCivGroupHostile[ NUM_CIV_GROUPS ];
|
||||
UINT8 ubLastBattleSectorX;
|
||||
UINT8 ubLastBattleSectorY;
|
||||
BOOLEAN fLastBattleWon;
|
||||
INT8 bOriginalSizeOfEnemyForce;
|
||||
INT8 bPanicTriggerIsAlarmUnused;
|
||||
BOOLEAN fVirginSector;
|
||||
BOOLEAN fEnemyInSector;
|
||||
BOOLEAN fInterruptOccurred;
|
||||
INT8 bRealtimeSpeed;
|
||||
UINT8 ubEnemyIntention;
|
||||
UINT8 ubEnemyIntendedRetreatDirection;
|
||||
UINT8 ubEnemySightingOnTheirTurnEnemyID;
|
||||
UINT8 ubEnemySightingOnTheirTurnPlayerID;
|
||||
BOOLEAN fEnemySightingOnTheirTurn;
|
||||
BOOLEAN fAutoBandageMode;
|
||||
UINT8 ubAttackBusyCount;
|
||||
INT8 bNumEnemiesFoughtInBattleUnused;
|
||||
UINT8 ubEngagedInConvFromActionMercID;
|
||||
UINT16 usTactialTurnLimitCounter;
|
||||
BOOLEAN fInTopMessage;
|
||||
UINT8 ubTopMessageType;
|
||||
CHAR16 zTopMessageString[20];
|
||||
UINT16 usTactialTurnLimitMax;
|
||||
UINT32 uiTactialTurnLimitClock;
|
||||
BOOLEAN fTactialTurnLimitStartedBeep;
|
||||
INT8 bBoxingState;
|
||||
INT8 bConsNumTurnsNotSeen;
|
||||
UINT8 ubArmyGuysKilled;
|
||||
UINT8 ubCurrentTeam;
|
||||
INT32 sSlideTarget;
|
||||
INT16 sSlideReason_UNUSED;
|
||||
UINT32 uiTimeSinceMercAIStart;
|
||||
INT8 fPanicFlags;
|
||||
INT32 sPanicTriggerGridNoUnused;
|
||||
INT16 sHandGrid;
|
||||
SoldierID ubSpottersCalledForBy;
|
||||
SoldierID ubTheChosenOne;
|
||||
UINT32 uiTimeOfLastInput;
|
||||
UINT32 uiTimeSinceDemoOn;
|
||||
UINT32 uiCountdownToRestart;
|
||||
BOOLEAN fGoingToEnterDemo;
|
||||
BOOLEAN fNOTDOLASTDEMO;
|
||||
BOOLEAN fMultiplayer;
|
||||
BOOLEAN fCivGroupHostile[ NUM_CIV_GROUPS ];
|
||||
UINT8 ubLastBattleSectorX;
|
||||
UINT8 ubLastBattleSectorY;
|
||||
BOOLEAN fLastBattleWon;
|
||||
INT8 bOriginalSizeOfEnemyForce;
|
||||
INT8 bPanicTriggerIsAlarmUnused;
|
||||
BOOLEAN fVirginSector;
|
||||
BOOLEAN fEnemyInSector;
|
||||
BOOLEAN fInterruptOccurred;
|
||||
INT8 bRealtimeSpeed;
|
||||
UINT8 ubEnemyIntention;
|
||||
UINT8 ubEnemyIntendedRetreatDirection;
|
||||
SoldierID ubEnemySightingOnTheirTurnEnemyID;
|
||||
SoldierID ubEnemySightingOnTheirTurnPlayerID;
|
||||
BOOLEAN fEnemySightingOnTheirTurn;
|
||||
BOOLEAN fAutoBandageMode;
|
||||
UINT8 ubAttackBusyCount;
|
||||
INT8 bNumEnemiesFoughtInBattleUnused;
|
||||
UINT16 ubEngagedInConvFromActionMercID;
|
||||
UINT16 usTactialTurnLimitCounter;
|
||||
BOOLEAN fInTopMessage;
|
||||
UINT8 ubTopMessageType;
|
||||
CHAR16 zTopMessageString[20];
|
||||
UINT16 usTactialTurnLimitMax;
|
||||
UINT32 uiTactialTurnLimitClock;
|
||||
BOOLEAN fTactialTurnLimitStartedBeep;
|
||||
INT8 bBoxingState;
|
||||
INT8 bConsNumTurnsNotSeen;
|
||||
UINT8 ubArmyGuysKilled;
|
||||
|
||||
INT32 sPanicTriggerGridNo[ NUM_PANIC_TRIGGERS ];
|
||||
INT8 bPanicTriggerIsAlarm[ NUM_PANIC_TRIGGERS ];
|
||||
UINT8 ubPanicTolerance[ NUM_PANIC_TRIGGERS ];
|
||||
BOOLEAN fAtLeastOneGuyOnMultiSelect;
|
||||
BOOLEAN fSaidCreatureFlavourQuote;
|
||||
BOOLEAN fHaveSeenCreature;
|
||||
BOOLEAN fKilledEnemyOnAttack;
|
||||
UINT8 ubEnemyKilledOnAttack;
|
||||
INT8 bEnemyKilledOnAttackLevel;
|
||||
UINT16 ubEnemyKilledOnAttackLocation;
|
||||
BOOLEAN fItemsSeenOnAttack;
|
||||
BOOLEAN ubItemsSeenOnAttackSoldier;
|
||||
BOOLEAN fBeenInCombatOnce;
|
||||
BOOLEAN fSaidCreatureSmellQuote;
|
||||
UINT32 usItemsSeenOnAttackGridNo;
|
||||
BOOLEAN fLockItemLocators;
|
||||
UINT8 ubLastQuoteSaid;
|
||||
UINT8 ubLastQuoteProfileNUm;
|
||||
BOOLEAN fCantGetThrough;
|
||||
INT32 sCantGetThroughGridNo;
|
||||
INT32 sCantGetThroughSoldierGridNo;
|
||||
UINT8 ubCantGetThroughID;
|
||||
BOOLEAN fDidGameJustStart;
|
||||
BOOLEAN fStatChangeCheatOn;
|
||||
UINT8 ubLastRequesterTargetID;
|
||||
BOOLEAN fGoodToAllowCrows;
|
||||
UINT8 ubNumCrowsPossible;
|
||||
UINT32 uiTimeCounterForGiveItemSrc;
|
||||
BOOLEAN fUnLockUIAfterHiddenInterrupt;
|
||||
INT8 bNumFoughtInBattle[ MAXTEAMS ];
|
||||
UINT32 uiDecayBloodLastUpdate;
|
||||
UINT32 uiTimeSinceLastInTactical;
|
||||
BOOLEAN fHasAGameBeenStarted;
|
||||
INT8 bConsNumTurnsWeHaventSeenButEnemyDoes;
|
||||
BOOLEAN fSomeoneHit;
|
||||
UINT8 ubPaddingSmall;
|
||||
UINT32 uiTimeSinceLastOpplistDecay;
|
||||
INT8 bMercArrivingQuoteBeingUsed;
|
||||
UINT8 ubEnemyKilledOnAttackKiller;
|
||||
BOOLEAN fCountingDownForGuideDescription;
|
||||
INT8 bGuideDescriptionCountDown;
|
||||
UINT8 ubGuideDescriptionToUse;
|
||||
INT8 bGuideDescriptionSectorX;
|
||||
INT8 bGuideDescriptionSectorY;
|
||||
INT8 fEnemyFlags;
|
||||
BOOLEAN fAutoBandagePending;
|
||||
BOOLEAN fHasEnteredCombatModeSinceEntering;
|
||||
BOOLEAN fDontAddNewCrows;
|
||||
UINT8 ubMorePadding;
|
||||
UINT16 sCreatureTenseQuoteDelay;
|
||||
UINT32 uiCreatureTenseQuoteLastUpdate;
|
||||
INT32 sPanicTriggerGridNo[ NUM_PANIC_TRIGGERS ];
|
||||
INT8 bPanicTriggerIsAlarm[ NUM_PANIC_TRIGGERS ];
|
||||
UINT8 ubPanicTolerance[ NUM_PANIC_TRIGGERS ];
|
||||
BOOLEAN fAtLeastOneGuyOnMultiSelect;
|
||||
BOOLEAN fSaidCreatureFlavourQuote;
|
||||
BOOLEAN fHaveSeenCreature;
|
||||
BOOLEAN fKilledEnemyOnAttack;
|
||||
UINT16 ubEnemyKilledOnAttack;
|
||||
INT8 bEnemyKilledOnAttackLevel;
|
||||
UINT16 ubEnemyKilledOnAttackLocation;
|
||||
BOOLEAN fItemsSeenOnAttack;
|
||||
BOOLEAN ubItemsSeenOnAttackSoldier;
|
||||
BOOLEAN fBeenInCombatOnce;
|
||||
BOOLEAN fSaidCreatureSmellQuote;
|
||||
UINT32 usItemsSeenOnAttackGridNo;
|
||||
BOOLEAN fLockItemLocators;
|
||||
UINT8 ubLastQuoteSaid;
|
||||
UINT8 ubLastQuoteProfileNUm;
|
||||
BOOLEAN fCantGetThrough;
|
||||
INT32 sCantGetThroughGridNo;
|
||||
INT32 sCantGetThroughSoldierGridNo;
|
||||
SoldierID ubCantGetThroughID;
|
||||
BOOLEAN fDidGameJustStart;
|
||||
BOOLEAN fStatChangeCheatOn;
|
||||
UINT8 ubLastRequesterTargetID;
|
||||
BOOLEAN fGoodToAllowCrows;
|
||||
UINT8 ubNumCrowsPossible;
|
||||
UINT32 uiTimeCounterForGiveItemSrc;
|
||||
BOOLEAN fUnLockUIAfterHiddenInterrupt;
|
||||
INT8 bNumFoughtInBattle[ MAXTEAMS ];
|
||||
UINT32 uiDecayBloodLastUpdate;
|
||||
UINT32 uiTimeSinceLastInTactical;
|
||||
BOOLEAN fHasAGameBeenStarted;
|
||||
INT8 bConsNumTurnsWeHaventSeenButEnemyDoes;
|
||||
BOOLEAN fSomeoneHit;
|
||||
UINT32 uiTimeSinceLastOpplistDecay;
|
||||
INT8 bMercArrivingQuoteBeingUsed;
|
||||
UINT16 ubEnemyKilledOnAttackKiller;
|
||||
BOOLEAN fCountingDownForGuideDescription;
|
||||
INT8 bGuideDescriptionCountDown;
|
||||
UINT8 ubGuideDescriptionToUse;
|
||||
INT8 bGuideDescriptionSectorX;
|
||||
INT8 bGuideDescriptionSectorY;
|
||||
INT8 fEnemyFlags;
|
||||
BOOLEAN fAutoBandagePending;
|
||||
BOOLEAN fHasEnteredCombatModeSinceEntering;
|
||||
BOOLEAN fDontAddNewCrows;
|
||||
UINT8 ubMorePadding;
|
||||
UINT16 sCreatureTenseQuoteDelay;
|
||||
UINT32 uiCreatureTenseQuoteLastUpdate;
|
||||
// SANDRO - added these
|
||||
UINT8 ubLastRequesterSurgeryTargetID;
|
||||
UINT8 ubInterruptPending;
|
||||
SoldierID ubLastRequesterSurgeryTargetID;
|
||||
UINT8 ubInterruptPending;
|
||||
// sevenfm: Ctrl+D disable interrupts
|
||||
BOOLEAN ubDisablePlayerInterrupts;
|
||||
BOOLEAN ubDisablePlayerInterrupts;
|
||||
// PADDING GONE!!!!!
|
||||
|
||||
};
|
||||
@@ -171,8 +170,7 @@ struct TacticalStatusType
|
||||
extern UINT8 gbPlayerNum;
|
||||
extern INT8 gbShowEnemies;
|
||||
|
||||
extern UINT16 gusSelectedSoldier;
|
||||
extern UINT16 gusOldSelectedSoldier;
|
||||
extern SoldierID gusSelectedSoldier;
|
||||
|
||||
extern CHAR8 gzAlertStr[][ 30 ];
|
||||
extern CHAR8 gzActionStr[][ 30 ];
|
||||
@@ -205,7 +203,7 @@ void ShutdownTacticalEngine( );
|
||||
|
||||
BOOLEAN InitOverhead( );
|
||||
BOOLEAN ShutdownOverhead( );
|
||||
BOOLEAN GetSoldier( SOLDIERTYPE **ppSoldier, UINT16 usSoldierIndex );
|
||||
BOOLEAN GetSoldier( SOLDIERTYPE **ppSoldier, SoldierID usSoldierIndex );
|
||||
|
||||
UINT32 CountNonVehiclesOnPlayerTeam( );
|
||||
|
||||
@@ -226,25 +224,25 @@ void EndTurn( UINT8 ubNextTeam );
|
||||
void StartPlayerTeamTurn( BOOLEAN fDoBattleSnd, BOOLEAN fEnteringCombatMode );
|
||||
void EndTacticalDemo( );
|
||||
|
||||
void SelectSoldier( UINT16 usSoldierID, BOOLEAN fAcknowledge, BOOLEAN fForceReselect );
|
||||
void SelectSoldier( SoldierID usSoldierID, BOOLEAN fAcknowledge, BOOLEAN fForceReselect );
|
||||
|
||||
//Kaiden: Function declaration from UB to reveal all items after combat.
|
||||
void RevealAllDroppedEnemyItems();
|
||||
|
||||
void LocateGridNo( INT32 sGridNo );
|
||||
void LocateSoldier( UINT16 usID, BOOLEAN fSetLocator);
|
||||
void LocateSoldier( SoldierID usID, BOOLEAN fSetLocator);
|
||||
|
||||
void BeginTeamTurn( UINT8 ubTeam );
|
||||
void SlideTo(INT32 sGridNo, UINT16 usSoldierID , UINT16 usReasonID, BOOLEAN fSetLocator) ;
|
||||
void SlideToLocation( UINT16 usReasonID, INT32 sDestGridNo );
|
||||
void SlideTo(SoldierID usSoldierID, BOOLEAN fSetLocator) ;
|
||||
void SlideToLocation( INT32 sDestGridNo );
|
||||
|
||||
void RebuildAllSoldierShadeTables( );
|
||||
void HandlePlayerTeamMemberDeath( SOLDIERTYPE *pSoldier );
|
||||
UINT8 LastActiveTeamMember( UINT8 ubTeam );
|
||||
SoldierID LastActiveTeamMember( UINT16 ubTeam );
|
||||
BOOLEAN SoldierOnVisibleWorldTile( SOLDIERTYPE *pSoldier );
|
||||
|
||||
UINT8 FindNextActiveAndAliveMerc( SOLDIERTYPE *pSoldier, BOOLEAN fGoodForLessOKLife, BOOLEAN fOnlyRegularMercs );
|
||||
UINT8 FindPrevActiveAndAliveMerc( SOLDIERTYPE *pSoldier, BOOLEAN fGoodForLessOKLife, BOOLEAN fOnlyRegularMercs );
|
||||
SoldierID FindNextActiveAndAliveMerc( SOLDIERTYPE *pSoldier, BOOLEAN fGoodForLessOKLife, BOOLEAN fOnlyRegularMercs );
|
||||
SoldierID FindPrevActiveAndAliveMerc( SOLDIERTYPE *pSoldier, BOOLEAN fGoodForLessOKLife, BOOLEAN fOnlyRegularMercs );
|
||||
|
||||
BOOLEAN CheckForPlayerTeamInMissionExit( );
|
||||
void HandleNPCTeamMemberDeath( SOLDIERTYPE *pSoldier );
|
||||
@@ -261,7 +259,7 @@ INT32 FindNextToAdjacentGridEx( SOLDIERTYPE *pSoldier, INT32 sGridNo, UINT8 *pub
|
||||
|
||||
void SelectNextAvailSoldier( SOLDIERTYPE *pSoldier );
|
||||
BOOLEAN TeamMemberNear(INT8 bTeam, INT32 sGridNo, INT32 iRange);
|
||||
BOOLEAN IsValidTargetMerc( UINT8 ubSoldierID );
|
||||
BOOLEAN IsValidTargetMerc( SoldierID ubSoldierID );
|
||||
|
||||
// FUNCTIONS FOR MANIPULATING MERC SLOTS - A LIST OF ALL ACTIVE MERCS
|
||||
INT32 GetFreeMercSlot( );
|
||||
@@ -323,7 +321,7 @@ BOOLEAN HostileBloodcatsPresent( );
|
||||
BOOLEAN HostileZombiesPresent( );
|
||||
BOOLEAN HostileCreaturesPresent();
|
||||
|
||||
UINT8 NumPCsInSector( );
|
||||
UINT16 NumPCsInSector( );
|
||||
void SetSoldierNonNeutral( SOLDIERTYPE * pSoldier );
|
||||
void SetSoldierNeutral( SOLDIERTYPE * pSoldier );
|
||||
|
||||
@@ -334,10 +332,10 @@ void SetMsgBoxForPlayerBeNotifiedOfSomeoneElseInSector();
|
||||
void HandleDisplayingOfPlayerLostDialogue( );
|
||||
|
||||
// UTILITY FUNCTIONS
|
||||
INT8 NumActiveAndConsciousTeamMembers( UINT8 ubTeam );
|
||||
UINT8 NumEnemyInSector( );
|
||||
UINT8 NumCapableEnemyInSector( );
|
||||
INT8 NumMercsOnPlayerTeam( );
|
||||
UINT16 NumActiveAndConsciousTeamMembers( UINT8 ubTeam );
|
||||
UINT16 NumEnemyInSector( );
|
||||
UINT16 NumCapableEnemyInSector( );
|
||||
UINT16 NumMercsOnPlayerTeam( );
|
||||
#endif
|
||||
|
||||
extern BOOLEAN sniperwarning;
|
||||
@@ -351,10 +349,10 @@ extern BOOLEAN gogglewarning;
|
||||
// will a sam site under the players control shoot down an airraid?
|
||||
BOOLEAN WillAirRaidBeStopped( INT16 sSectorX, INT16 sSectorY );
|
||||
// HEADROCK HAM 3.5: Externalized for First Arrival enemy check
|
||||
extern UINT8 NumEnemyInSector();
|
||||
extern UINT16 NumEnemyInSector();
|
||||
|
||||
// Flugente
|
||||
extern UINT8 NumZombiesInSector();
|
||||
extern UINT16 NumZombiesInSector();
|
||||
|
||||
// Flugente: offer the enemy the chance to surrender
|
||||
void HandleSurrenderOffer( SOLDIERTYPE* pSoldier );
|
||||
@@ -371,7 +369,7 @@ void TeamDropAll(UINT8 bTeam, BOOLEAN fForce = FALSE);
|
||||
void TeamRestock(UINT8 bTeam);
|
||||
|
||||
// are we allowed to steal access this guy's inventory?
|
||||
BOOLEAN AllowedToStealFromTeamMate( UINT8 aAccessorID, UINT8 aTargetID );
|
||||
BOOLEAN AllowedToStealFromTeamMate( SoldierID ubID, SoldierID ubTargetID );
|
||||
|
||||
// Flugente: is an soldier profile already used?
|
||||
BOOLEAN IsProfileInUse(UINT8 usTeam, INT8 aType, UINT16 aNr);
|
||||
@@ -402,12 +400,11 @@ enum {
|
||||
};
|
||||
|
||||
// Flugente: return number of enemy officers and highest rank found
|
||||
UINT8 HighestEnemyOfficersInSector(UINT8& aType);
|
||||
UINT16 HighestEnemyOfficersInSector(UINT8& aType);
|
||||
|
||||
// count all soldiers in the current sector that have a specific flag set
|
||||
UINT16 NumSoldiersWithFlagInSector(UINT8 aTeam, UINT32 aFlag);
|
||||
UINT16 NumSoldiersofClassWithFlag2InSector( UINT8 aTeam, UINT8 aSoldierClass, UINT32 aFlag );
|
||||
INT32 GetClosestSoldierWithFlag( UINT8 aTeam, UINT32 aFlag );
|
||||
|
||||
// Flugente: VIP targets
|
||||
// can a new VIP be created?
|
||||
@@ -434,5 +431,6 @@ BOOLEAN IsCivFactionMemberAliveInSector( UINT8 usCivilianGroup );
|
||||
|
||||
BOOLEAN IsFreeSlotAvailable( int aTeam );
|
||||
void AttemptToCapturePlayerSoldiers();
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
|
||||
#ifndef _PATHAI_H
|
||||
#define _PATHAI_H
|
||||
#include "isometric utils.h"
|
||||
#include "Isometric Utils.h"
|
||||
|
||||
namespace ASTAR {
|
||||
#include "BinaryHeap.hpp"
|
||||
|
||||
+15
-25
@@ -7,50 +7,40 @@
|
||||
Author : Chris Camfield
|
||||
Date : 1997-NOV
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "stdlib.h"
|
||||
#include "debug.h"
|
||||
#include "DEBUG.H"
|
||||
#include "MemMan.h"
|
||||
#include "Overhead Types.h"
|
||||
|
||||
#include "Animation Cache.h"
|
||||
#include "Animation Data.h"
|
||||
#include "Animation Control.h"
|
||||
#include "interface.h"
|
||||
#include <math.h>
|
||||
|
||||
#include "Interface.h"
|
||||
#include "input.h"
|
||||
#include "english.h"
|
||||
#include "worlddef.h"
|
||||
#include "worldman.h"
|
||||
#include "renderworld.h"
|
||||
#include "pathai.h"
|
||||
#include "PATHAI.H"
|
||||
#include "Points.h"
|
||||
#include "ai.h"
|
||||
#include "Random.h"
|
||||
#include "random.h"
|
||||
#include "message.h"
|
||||
#include "structure wrap.h"
|
||||
#include "keys.h"
|
||||
#include "gamesettings.h"
|
||||
#include "Structure Wrap.h"
|
||||
#include "Keys.h"
|
||||
#include "GameSettings.h"
|
||||
#include "Buildings.h"
|
||||
#include "soldier profile.h" // added by SANDRO
|
||||
#include "Soldier macros.h"
|
||||
#include "AIinternals.h"
|
||||
#include "AIInternals.h"
|
||||
#include "Rotting Corpses.h"
|
||||
#include "Meanwhile.h"
|
||||
#include "connect.h"
|
||||
#include <Cheats.h>
|
||||
#include "connect.h"
|
||||
#include "LOS.h" //ddd
|
||||
#include "BinaryHeap.hpp"
|
||||
#include "opplist.h"
|
||||
#include "Weapons.h"
|
||||
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
|
||||
#include "BinaryHeap.hpp"
|
||||
#include "opplist.h"
|
||||
#include "weapons.h"
|
||||
extern BOOLEAN gubWorldTileInLight[MAX_ALLOWED_WORLD_MAX];
|
||||
extern BOOLEAN gubIsCorpseThere[MAX_ALLOWED_WORLD_MAX];
|
||||
extern INT32 gubMerkCanSeeThisTile[MAX_ALLOWED_WORLD_MAX];
|
||||
@@ -2045,7 +2035,7 @@ bool AStarPathfinder::IsSomeoneInTheWay()
|
||||
if (fPathAroundPeople && ( (CurrentNode != DestNode) || fCopyReachable) )
|
||||
{
|
||||
// ATE: ONLY cancel if they are moving.....
|
||||
UINT8 ubMerc = WhoIsThere2( CurrentNode, pSoldier->pathing.bLevel);
|
||||
UINT16 ubMerc = WhoIsThere2( CurrentNode, pSoldier->pathing.bLevel);
|
||||
if ( ubMerc < NOBODY && ubMerc != pSoldier->ubID )
|
||||
{
|
||||
// Check for movement....
|
||||
@@ -2165,7 +2155,7 @@ INT32 FindBestPath(SOLDIERTYPE *s , INT32 sDestination, INT8 bLevel, INT16 usMov
|
||||
INT8 bLoopState = LOOPING_CLOCKWISE;
|
||||
//BOOLEAN fLoopForwards = FALSE;
|
||||
BOOLEAN fCheckedBehind = FALSE;
|
||||
UINT8 ubMerc;
|
||||
SoldierID ubMerc;
|
||||
INT32 iDestX,iDestY, iLocX, iLocY, dx, dy;
|
||||
INT32 newLoc,curLoc;
|
||||
//INT32 curY;
|
||||
@@ -3106,7 +3096,7 @@ if(!GridNoOnVisibleWorldTile(iDestination))
|
||||
|
||||
// sevenfm: for player mercs, ignore invisible opponents
|
||||
if (ubMerc < TOTAL_SOLDIERS && ubMerc != s->ubID &&
|
||||
(!(s->flags.uiStatusFlags & SOLDIER_PC) || MercPtrs[ubMerc]->bSide == s->bSide || MercPtrs[ubMerc]->aiData.bNeutral || MercPtrs[ubMerc]->bVisible >= 0 || SoldierToSoldierLineOfSightTest(s, MercPtrs[ubMerc], TRUE, CALC_FROM_ALL_DIRS)))
|
||||
(!(s->flags.uiStatusFlags & SOLDIER_PC) || ubMerc->bSide == s->bSide || ubMerc->aiData.bNeutral || ubMerc->bVisible >= 0 || SoldierToSoldierLineOfSightTest(s, ubMerc, TRUE, CALC_FROM_ALL_DIRS)))
|
||||
//if ( ubMerc < TOTAL_SOLDIERS && ubMerc != s->ubID )
|
||||
{
|
||||
goto NEXTDIR;
|
||||
|
||||
@@ -1 +1 @@
|
||||
//#define PATHAI_VISIBLE_DEBUG
|
||||
//#define PATHAI_VISIBLE_DEBUG
|
||||
|
||||
+69
-56
@@ -1,30 +1,27 @@
|
||||
#include "sgp.h"
|
||||
#include "worlddef.h"
|
||||
#include "points.h"
|
||||
#include "overhead.h"
|
||||
#include "Font control.h"
|
||||
#include "interface.h"
|
||||
#include "Isometric utils.h"
|
||||
#include "pathai.h"
|
||||
#include "interface.h"
|
||||
#include "Points.h"
|
||||
#include "Overhead.h"
|
||||
#include "Font Control.h"
|
||||
#include "Interface.h"
|
||||
#include "Isometric Utils.h"
|
||||
#include "PATHAI.H"
|
||||
#include "message.h"
|
||||
#include "Animation Control.h"
|
||||
#include "Weapons.h"
|
||||
|
||||
#include "structure wrap.h"
|
||||
#include "dialogue control.h"
|
||||
#include "items.h"
|
||||
#include "rt time defines.h"
|
||||
#include "Structure Wrap.h"
|
||||
#include "Dialogue Control.h"
|
||||
#include "Items.h"
|
||||
#include "ai.h"
|
||||
#include "handle ui.h"
|
||||
#include "text.h"
|
||||
#include "Handle UI.h"
|
||||
#include "Text.h"
|
||||
#include "SkillCheck.h"
|
||||
#include "wcheck.h"
|
||||
#include "WCheck.h"
|
||||
#include "Soldier Profile.h"
|
||||
#include "Soldier macros.h"
|
||||
#include "Random.h"
|
||||
#include "random.h"
|
||||
#include "Campaign.h"
|
||||
#include "drugs and alcohol.h"
|
||||
#include "Drugs And Alcohol.h"
|
||||
#include "GameSettings.h"
|
||||
#include "worldman.h"
|
||||
#include "math.h"
|
||||
@@ -604,19 +601,7 @@ INT16 ActionPointCost( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bDir, UINT16 u
|
||||
UINT16 usBPPenalty = APBPConstants[AP_MODIFIER_PACK];
|
||||
if ( bSlot == BPACKPOCKPOS ) //Backpack caried on back
|
||||
{
|
||||
OBJECTTYPE * pObj = &( pSoldier->inv[ BPACKPOCKPOS ] );
|
||||
UINT16 usBackPackWeight = CalculateObjectWeight( pObj );
|
||||
// CalculateObjectWeight checks for active LBE gear. Unfortunatly our backpack is not active since we are carying it.
|
||||
// Sounds not intuitive at all, active means the LBE caries items (marked with blue *), but when put on the LBE adittional slots of our soldier
|
||||
// are activated where something can be carried. So we have to add the weights of those slots as well.
|
||||
std::vector<INT8> vbLBESlots;
|
||||
GetLBESlots( BPACKPOCKPOS, vbLBESlots );
|
||||
for ( UINT8 i = 0; i < vbLBESlots.size() ; i++ )
|
||||
{
|
||||
pObj = &( pSoldier->inv[ vbLBESlots[ i ] ] );
|
||||
usBackPackWeight += CalculateObjectWeight( pObj );
|
||||
}
|
||||
usBPPenalty = min( ( usBackPackWeight / 50 ), usBPPenalty ); //1 AP penalty for each 5kg of weight up to the penalty defined by AP_MODIFIER_PACK (default = 4)
|
||||
usBPPenalty = GetBackbackAPPenaltyFromBackpack(pSoldier);
|
||||
}
|
||||
else //Backpack caried not on back (maybe somewhere inside another LBE or in Hand?)
|
||||
{
|
||||
@@ -2006,7 +1991,7 @@ void GetAPChargeForShootOrStabWRTGunRaises( SOLDIERTYPE *pSoldier, INT32 sGridNo
|
||||
{
|
||||
UINT8 ubDirection;
|
||||
UINT32 uiMercFlags;
|
||||
UINT16 usTargID;
|
||||
SoldierID usTargID;
|
||||
BOOLEAN fAddingTurningCost = FALSE;
|
||||
BOOLEAN fAddingRaiseGunCost = FALSE;
|
||||
|
||||
@@ -2018,7 +2003,7 @@ void GetAPChargeForShootOrStabWRTGunRaises( SOLDIERTYPE *pSoldier, INT32 sGridNo
|
||||
// Given a gridno here, check if we are on a guy - if so - get his gridno
|
||||
if ( FindSoldier( sGridNo, &usTargID, &uiMercFlags, FIND_SOLDIER_GRIDNO ) )
|
||||
{
|
||||
sGridNo = MercPtrs[ usTargID ]->sGridNo;
|
||||
sGridNo = usTargID->sGridNo;
|
||||
}
|
||||
|
||||
ubDirection = (UINT8)GetDirectionFromGridNo( sGridNo, pSoldier );
|
||||
@@ -2189,7 +2174,7 @@ UINT16 CalculateRaiseGunCost(SOLDIERTYPE *pSoldier, BOOLEAN fAddingRaiseGunCost,
|
||||
INT16 MinAPsToShootOrStab(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 bAimTime, UINT8 ubAddTurningCost, UINT8 ubForceRaiseGunCost )
|
||||
{
|
||||
UINT32 uiMercFlags;
|
||||
UINT16 usTargID;
|
||||
SoldierID usTargID;
|
||||
INT16 bFullAPs;
|
||||
INT16 bAimSkill;
|
||||
INT16 bAPCost = APBPConstants[AP_MIN_AIM_ATTACK];
|
||||
@@ -2230,7 +2215,7 @@ INT16 MinAPsToShootOrStab(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 bAimTime,
|
||||
// Given a gridno here, check if we are on a guy - if so - get his gridno
|
||||
if ( FindSoldier( sGridNo, &usTargID, &uiMercFlags, FIND_SOLDIER_GRIDNO ) )
|
||||
{
|
||||
sGridNo = MercPtrs[ usTargID ]->sGridNo;
|
||||
sGridNo = usTargID->sGridNo;
|
||||
}
|
||||
//usRange = GetRangeFromGridNoDiff( pSoldier->sGridNo, sGridNo );
|
||||
}
|
||||
@@ -2375,9 +2360,9 @@ INT16 MinAPsToShootOrStab(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 bAimTime,
|
||||
// Do we need to stand up?
|
||||
bAPCost += GetAPsToChangeStance( pSoldier, ANIM_STAND );
|
||||
}
|
||||
else if(Item[usItem].rocketlauncher || Item[usItem].grenadelauncher || Item[usItem].mortar)//dnl ch72 260913 move this here from bottom, need to change as rocketlaucher could be fired from crouch too
|
||||
else if(ItemIsRocketLauncher(usItem) || ItemIsGrenadeLauncher(usItem) || ItemIsMortar(usItem))//dnl ch72 260913 move this here from bottom, need to change as rocketlaucher could be fired from crouch too
|
||||
{
|
||||
if(gAnimControl[pSoldier->usAnimState].ubEndHeight == ANIM_PRONE || Item[usItem].mortar && gAnimControl[pSoldier->usAnimState].ubEndHeight == ANIM_STAND)
|
||||
if(gAnimControl[pSoldier->usAnimState].ubEndHeight == ANIM_PRONE || ItemIsMortar(usItem) && gAnimControl[pSoldier->usAnimState].ubEndHeight == ANIM_STAND)
|
||||
bAPCost += GetAPsToChangeStance(pSoldier, ANIM_CROUCH);
|
||||
else
|
||||
bAPCost += GetAPsToChangeStance(pSoldier, gAnimControl[pSoldier->usAnimState].ubEndHeight);
|
||||
@@ -2393,9 +2378,9 @@ INT16 MinAPsToShootOrStab(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 bAimTime,
|
||||
if (!TileIsOutOfBounds(sGridNo))
|
||||
{
|
||||
{
|
||||
if(Item[usItem].rocketlauncher || Item[usItem].grenadelauncher || Item[usItem].mortar)//dnl ch72 260913
|
||||
if(ItemIsRocketLauncher(usItem) || ItemIsGrenadeLauncher(usItem) || ItemIsMortar(usItem))//dnl ch72 260913
|
||||
{
|
||||
if(gAnimControl[pSoldier->usAnimState].ubEndHeight == ANIM_PRONE || Item[usItem].mortar && gAnimControl[pSoldier->usAnimState].ubEndHeight == ANIM_STAND)
|
||||
if(gAnimControl[pSoldier->usAnimState].ubEndHeight == ANIM_PRONE || ItemIsMortar(usItem) && gAnimControl[pSoldier->usAnimState].ubEndHeight == ANIM_STAND)
|
||||
usTurningCost = CalculateTurningCost(pSoldier, usItem, fAddingTurningCost, ANIM_CROUCH);
|
||||
else
|
||||
usTurningCost = CalculateTurningCost(pSoldier, usItem, fAddingTurningCost);
|
||||
@@ -2429,7 +2414,7 @@ INT16 MinAPsToShootOrStab(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 bAimTime,
|
||||
|
||||
// if attacking a new target (or if the specific target is uncertain)
|
||||
// Added check if the weapon is throwing knife/melee weapons - otherwise it would add APs for change target on cursor but not actually deduct them afterwards - SANDRO
|
||||
if ( ubForceRaiseGunCost == TRUE || (( sGridNo != pSoldier->sLastTarget ) && !Item[usUBItem].rocketlauncher && ( Item[ usUBItem ].usItemClass != IC_THROWING_KNIFE )/* && ( Item[ usUBItem ].usItemClass != IC_PUNCH ) && ( Item[ usUBItem ].usItemClass != IC_BLADE )*/ ) )//dnl ch69 140913 //dnl ch73 290913
|
||||
if ( ubForceRaiseGunCost == TRUE || (( sGridNo != pSoldier->sLastTarget ) && !ItemIsRocketLauncher(usUBItem) && ( Item[ usUBItem ].usItemClass != IC_THROWING_KNIFE )/* && ( Item[ usUBItem ].usItemClass != IC_PUNCH ) && ( Item[ usUBItem ].usItemClass != IC_BLADE )*/ ) )//dnl ch69 140913 //dnl ch73 290913
|
||||
{
|
||||
if ( pSoldier->IsValidAlternativeFireMode( bAimTime, sGridNo ) )
|
||||
bAPCost += (APBPConstants[AP_CHANGE_TARGET] / 2);
|
||||
@@ -2473,12 +2458,12 @@ INT16 MinAPsToPunch(SOLDIERTYPE *pSoldier, INT32 sGridNo)
|
||||
// sevenfm: check enemy only if we have correct gridNo
|
||||
if( !TileIsOutOfBounds(sGridNo) )
|
||||
{
|
||||
UINT16 usTargID = WhoIsThere2(sGridNo, pSoldier->bTargetLevel);
|
||||
SoldierID usTargID = WhoIsThere2(sGridNo, pSoldier->bTargetLevel);
|
||||
// Given a gridno here, check if we are on a guy - if so - get his gridno
|
||||
if(usTargID != NOBODY)
|
||||
{
|
||||
// Check if target is prone, if so, calc cost...
|
||||
if(gAnimControl[MercPtrs[usTargID]->usAnimState].ubEndHeight == ANIM_PRONE)
|
||||
if(gAnimControl[usTargID->usAnimState].ubEndHeight == ANIM_PRONE)
|
||||
bAPCost += GetAPsToChangeStance(pSoldier, ANIM_CROUCH);
|
||||
else
|
||||
bAPCost += GetAPsToChangeStance(pSoldier, ANIM_STAND);
|
||||
@@ -2635,13 +2620,13 @@ BOOLEAN EnoughAmmo( SOLDIERTYPE *pSoldier, BOOLEAN fDisplay, INT8 bInvPos )
|
||||
OBJECTTYPE* pObjUsed = pSoldier->GetUsedWeapon( &(pSoldier->inv[bInvPos]) );
|
||||
UINT16 usItemUsed = pSoldier->GetUsedWeaponNumber( &(pSoldier->inv[bInvPos]) );
|
||||
|
||||
if ( Item[usItemUsed].singleshotrocketlauncher )
|
||||
if (ItemIsSingleShotRocketLauncher(usItemUsed))
|
||||
{
|
||||
// hack... they turn empty afterwards anyways
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
if (Item[ usItemUsed ].usItemClass == IC_LAUNCHER || Item[usItemUsed].cannon )
|
||||
if (Item[ usItemUsed ].usItemClass == IC_LAUNCHER || ItemIsCannon(usItemUsed))
|
||||
{
|
||||
if ( FindAttachmentByClass( pObjUsed, IC_GRENADE ) != 0 )
|
||||
{
|
||||
@@ -2661,7 +2646,7 @@ BOOLEAN EnoughAmmo( SOLDIERTYPE *pSoldier, BOOLEAN fDisplay, INT8 bInvPos )
|
||||
}
|
||||
|
||||
// WANNE: If there is a tank, it always have ammo to shoot, no check!
|
||||
if (Item[usItemUsed].cannon)
|
||||
if (ItemIsCannon(usItemUsed))
|
||||
{
|
||||
return ( TRUE );
|
||||
}
|
||||
@@ -2715,13 +2700,13 @@ void DeductAmmo( SOLDIERTYPE *pSoldier, OBJECTTYPE* pObj )
|
||||
{
|
||||
// tanks never run out of MG ammo!
|
||||
// unlimited cannon ammo is handled in AI
|
||||
if ( (ARMED_VEHICLE( pSoldier ) || ENEMYROBOT( pSoldier )) && !Item[pObj->usItem].cannon )
|
||||
if ( (ARMED_VEHICLE( pSoldier ) || ENEMYROBOT( pSoldier )) && !ItemIsCannon(pObj->usItem) )
|
||||
return;
|
||||
|
||||
if ( Item[pObj->usItem].cannon )
|
||||
if (ItemIsCannon(pObj->usItem))
|
||||
{
|
||||
}
|
||||
else if ( Item[ pObj->usItem ].usItemClass == IC_GUN && !Item[pObj->usItem].cannon && pSoldier->bWeaponMode != WM_ATTACHED_GL && pSoldier->bWeaponMode != WM_ATTACHED_GL_BURST && pSoldier->bWeaponMode != WM_ATTACHED_GL_AUTO )
|
||||
else if ( Item[ pObj->usItem ].usItemClass == IC_GUN && !ItemIsCannon(pObj->usItem) && pSoldier->bWeaponMode != WM_ATTACHED_GL && pSoldier->bWeaponMode != WM_ATTACHED_GL_BURST && pSoldier->bWeaponMode != WM_ATTACHED_GL_AUTO )
|
||||
{
|
||||
// Flugente: check for underbarrel weapons and use that object if necessary
|
||||
OBJECTTYPE* pObjUsed = pSoldier->GetUsedWeapon( pObj );
|
||||
@@ -2754,7 +2739,7 @@ void DeductAmmo( SOLDIERTYPE *pSoldier, OBJECTTYPE* pObj )
|
||||
gCampaignStats.AddConsumption(CAMPAIGN_CONSUMED_AMMO, (FLOAT)(Item[(*pObjUsed)[0]->data.gun.usGunAmmoItem].ubWeight) / (FLOAT)(Magazine[ Item[ (*pObjUsed)[0]->data.gun.usGunAmmoItem ].ubClassIndex ].ubMagSize ) );
|
||||
}
|
||||
}
|
||||
else if ( Item[ pObj->usItem ].usItemClass == IC_LAUNCHER || Item[pObj->usItem].cannon || pSoldier->bWeaponMode == WM_ATTACHED_GL || pSoldier->bWeaponMode == WM_ATTACHED_GL_BURST || pSoldier->bWeaponMode == WM_ATTACHED_GL_AUTO )
|
||||
else if ( Item[ pObj->usItem ].usItemClass == IC_LAUNCHER || ItemIsCannon(pObj->usItem) || pSoldier->bWeaponMode == WM_ATTACHED_GL || pSoldier->bWeaponMode == WM_ATTACHED_GL_BURST || pSoldier->bWeaponMode == WM_ATTACHED_GL_AUTO )
|
||||
{
|
||||
OBJECTTYPE* pAttachment = FindAttachmentByClass( pObj, IC_GRENADE );
|
||||
if ( !pAttachment->exists() )
|
||||
@@ -3325,7 +3310,7 @@ INT16 GetAPsToReadyWeapon( SOLDIERTYPE *pSoldier, UINT16 usAnimState )
|
||||
// If we are told to go to the alt weapon holding mode
|
||||
if ( gAnimControl[ usAnimState ].uiFlags & ( ANIM_ALT_WEAPON_HOLDING ) || (pSoldier->bScopeMode == USE_ALT_WEAPON_HOLD && usAnimState == INVALID_ANIMATION) )//dnl ch71 180913
|
||||
{
|
||||
if ( Item[ usItem ].twohanded )
|
||||
if (ItemIsTwoHanded(usItem))
|
||||
{
|
||||
// Raising only to hip, either charge no APs or a portion of them
|
||||
ubReadyAPs = ((ubReadyAPs * gGameExternalOptions.ubToAltWeaponHoldReadyAPsPerc) + 99) / 100 ; // round up for rifles
|
||||
@@ -3339,7 +3324,7 @@ INT16 GetAPsToReadyWeapon( SOLDIERTYPE *pSoldier, UINT16 usAnimState )
|
||||
// If we are told to go from alternative to standard weapon holding
|
||||
else if ( gAnimControl[ pSoldier->usAnimState ].uiFlags & ( ANIM_ALT_WEAPON_HOLDING ) )
|
||||
{
|
||||
if ( Item[ usItem ].twohanded )
|
||||
if (ItemIsTwoHanded(usItem))
|
||||
{
|
||||
ubReadyAPs = ubReadyAPs * gGameExternalOptions.ubFromAltWeaponHoldReadyAPsPerc / 100; // round down for rifles
|
||||
}
|
||||
@@ -3703,7 +3688,7 @@ UINT16 GetTotalAPsToDropBomb( SOLDIERTYPE *pSoldier, INT32 sGridNo )
|
||||
|
||||
if ( sAPs > 0 )
|
||||
{
|
||||
if(Item[pSoldier->inv[HANDPOS].usItem].mine == 1)
|
||||
if(ItemIsMine(pSoldier->inv[HANDPOS].usItem))
|
||||
sAPs += GetAPsToPlantMine( pSoldier ); // changed by SANDRO
|
||||
else
|
||||
sAPs += GetAPsToDropBomb( pSoldier ); // changed by SANDRO
|
||||
@@ -3979,7 +3964,8 @@ INT16 GetAPsCrouch( SOLDIERTYPE *pSoldier, BOOLEAN fBackpackCheck )
|
||||
|
||||
// if backpack and new inventory
|
||||
if ( fBackpackCheck && (UsingNewInventorySystem() == true) && pSoldier->inv[BPACKPOCKPOS].exists() == true && !pSoldier->flags.ZipperFlag)
|
||||
iFinalAPsToCrouch += fBackpackCheck;//dnl ch70 160913 was 1
|
||||
// min was added to stick with the behaviour above (+1) assuming the backpack is heavier than BACKPACK_WEIGHT_FACTOR
|
||||
iFinalAPsToCrouch += min(1, GetBackbackAPPenaltyFromBackpack(pSoldier));
|
||||
|
||||
// -x% APs needed to change stance for MA trait
|
||||
if ( HAS_SKILL_TRAIT( pSoldier, MARTIAL_ARTS_NT ) && ( gGameOptions.fNewTraitSystem ))
|
||||
@@ -3999,7 +3985,8 @@ INT16 GetAPsProne( SOLDIERTYPE *pSoldier, BOOLEAN fBackpackCheck )
|
||||
|
||||
// if backpack and new inventory
|
||||
if ( fBackpackCheck && (UsingNewInventorySystem() == true) && pSoldier->inv[BPACKPOCKPOS].exists() == true && !pSoldier->flags.ZipperFlag)
|
||||
iFinalAPsToLieDown += fBackpackCheck;//dnl ch70 160913 was 1
|
||||
// min was added to stick with the behaviour above (+1) assuming the backpack is heavier than BACKPACK_WEIGHT_FACTOR
|
||||
iFinalAPsToLieDown += min(1, GetBackbackAPPenaltyFromBackpack(pSoldier));
|
||||
|
||||
// -x% APs needed to change stance for MA trait
|
||||
if ( HAS_SKILL_TRAIT( pSoldier, MARTIAL_ARTS_NT ) && ( gGameOptions.fNewTraitSystem ))
|
||||
@@ -4154,7 +4141,7 @@ INT32 GetBPCostPer10APsForGunHolding( SOLDIERTYPE * pSoldier, BOOLEAN fEstimate
|
||||
// Alternative weapon holding?
|
||||
if (( gAnimControl[ pSoldier->usAnimState ].uiFlags & ANIM_ALT_WEAPON_HOLDING ) || (fEstimate && pSoldier->bScopeMode == USE_ALT_WEAPON_HOLD) )
|
||||
{
|
||||
if ( Item[pSoldier->inv[pSoldier->ubAttackingHand].usItem].twohanded ) // firing from hip is not nearly ?n effort
|
||||
if (ItemIsTwoHanded(pSoldier->inv[pSoldier->ubAttackingHand].usItem)) // firing from hip is not nearly ?n effort
|
||||
dModifier += 80; // only 20% cost if on hip
|
||||
else // holding pistol in one hand is worse in this case
|
||||
dModifier -= 25; // increased cost by 25%
|
||||
@@ -4265,7 +4252,7 @@ INT32 GetBPCostForRecoilkick( SOLDIERTYPE * pSoldier )
|
||||
iKickPower = iKickPower * (100 - sWeaponWeight) / 100;
|
||||
|
||||
// If one-handed gun, reduce it a bit, since the whole thing is somewhat different.
|
||||
if ( !Item[pSoldier->inv[pSoldier->ubAttackingHand].usItem].twohanded )
|
||||
if ( !ItemIsTwoHanded(pSoldier->inv[pSoldier->ubAttackingHand].usItem) )
|
||||
iKickPower = iKickPower * 3 / 4; // -25%
|
||||
|
||||
// ::: overview :::
|
||||
@@ -4310,7 +4297,7 @@ INT32 GetBPCostForRecoilkick( SOLDIERTYPE * pSoldier )
|
||||
// Alternative weapon holding?
|
||||
if ( gAnimControl[ pSoldier->usAnimState ].uiFlags & ANIM_ALT_WEAPON_HOLDING )
|
||||
{
|
||||
if ( Item[pSoldier->inv[pSoldier->ubAttackingHand].usItem].twohanded ) // firing from hip makes the kicking rather diminishing
|
||||
if (ItemIsTwoHanded(pSoldier->inv[pSoldier->ubAttackingHand].usItem)) // firing from hip makes the kicking rather diminishing
|
||||
dModifier += 80; // only 20% of the regular kick power
|
||||
else // holding pistol in one hand is worse in this case
|
||||
dModifier -= 33; // plus 33% power
|
||||
@@ -4403,3 +4390,29 @@ INT16 GetAPsToStartDrag(SOLDIERTYPE *pSoldier, BOOLEAN fStance)
|
||||
return sAPCost;
|
||||
}
|
||||
|
||||
INT16 GetBackbackAPPenaltyFromBackpack(SOLDIERTYPE *pSoldier)
|
||||
{
|
||||
UINT16 usBPPenalty = 0;
|
||||
OBJECTTYPE * pObj = &( pSoldier->inv[ BPACKPOCKPOS ] );
|
||||
|
||||
if ((UsingNewInventorySystem() == true) && pSoldier->inv[BPACKPOCKPOS].exists() && pObj != NULL)
|
||||
{
|
||||
UINT16 usBackPackWeight = CalculateObjectWeight( pObj );
|
||||
// CalculateObjectWeight checks for active LBE gear. Unfortunatly our backpack is not active since we are carying it.
|
||||
// Sounds not intuitive at all, active means the LBE caries items (marked with blue *), but when put on the LBE adittional slots of our soldier
|
||||
// are activated where something can be carried. So we have to add the weights of those slots as well.
|
||||
std::vector<INT8> vbLBESlots;
|
||||
GetLBESlots( BPACKPOCKPOS, vbLBESlots );
|
||||
for ( UINT8 i = 0; i < vbLBESlots.size() ; i++ )
|
||||
{
|
||||
pObj = &( pSoldier->inv[ vbLBESlots[ i ] ] );
|
||||
usBackPackWeight += CalculateObjectWeight( pObj );
|
||||
}
|
||||
//1 AP penalty for each 5kg of weight up to the penalty defined by AP_MODIFIER_PACK (default = 4)
|
||||
// BUSCHER: Externalized the weight factor (previously 50 = 5.0 kg)
|
||||
// usBPPenalty = min( ( usBackPackWeight / 50 ), usBPPenalty );
|
||||
usBPPenalty = min( ( usBackPackWeight / gGameExternalOptions.ubBackPackWeightFactorForAPPenalty), APBPConstants[AP_MODIFIER_PACK] );
|
||||
|
||||
}
|
||||
return usBPPenalty;
|
||||
}
|
||||
|
||||
@@ -391,4 +391,7 @@ INT32 GetBPCostForRecoilkick( SOLDIERTYPE * pSoldier );
|
||||
INT16 GetAPsToBreakWindow(SOLDIERTYPE *pSoldier, BOOLEAN fStance);
|
||||
INT16 GetAPsToStartDrag(SOLDIERTYPE *pSoldier, BOOLEAN fStance);
|
||||
|
||||
// Buscher
|
||||
INT16 GetBackbackAPPenaltyFromBackpack(SOLDIERTYPE *pSoldier);
|
||||
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
#include "sgp.h"
|
||||
#include <types.h>
|
||||
#include "qarray.h"
|
||||
|
||||
QARRAY_VALUES QuoteExp[NUM_PROFILES];
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user