Files
source/Tactical/Overhead.h
T
Wanne e64d5a2fa6 MERGED source code from development trunk revision 4545 up to latest current revision 4882
Development Trunk: https://ja2svn.dyndns.org/source/ja2/branches/Wanne/JA2%201.13%20MP
A detailed list of all the features (changes) is visible in the history log of the development trunk:

INFO: The source code for the official 2011 release (4870) has been branched here:
https://ja2svn.dyndns.org/source/ja2/branches/JA2_rev.4870_2011

This commit contains the following features:

*** Externalized Vehicles ***
o Now with this feature we can add/remove vehicles
o New XML File: TableData\Vehicles.xml
o Added a new function parameter to lua file Scripts\Overhead lua to set up the helicopter in method: SetUpHelicopterForPlayer()
o Added example mini (Docs\Externalized Vehicles Example.zip) mod which adds 2 additional vehicles (hummer and ice-cream truck to sector A9)

*** Up to 255 save slots ***
- There is a "Next" and "Prev" button where you can scroll through the save slots
- It is now possible to load the automatic save (SAVE_EVERY_N_HOURS) from the load screen. This is the first slot after the quickload slot
- Added the 2 alternate players end turn saves (which can be enabled/disabled in option screen) to the save/load game form

*** New Feature: Externalized emails from Emails.edt to XML***
o This feature can be enabled/disabled in the Source:
--> See email.cpp: If "ReadXMLEmail" == FALSE, then normal way (read from Email.edt) otherwise read from XML files
o 2 new XML files: TableData\Email\EmailMercAvailable.xml and EmailMercLevelUp.xml
o Renamed SenderNamesList.xml to EmailSenderNamesList.xml and moved from TableData folder to TableData\Email folder
o Names for mercenaries are get from the file MercProfiles.xml and different names get from the file EmailSenderNamesList.xml

*** Externalized Hidden Towns (Tixa, Orta) ***
o Now it is possible to add new hidden towns (locations)
o See file: TableData/Map/Cities.xml
o New variable in TableData/Map/Cities.xml
- hiddenTown:   0 = show on strategy map, 1 = Hide on strategy map
- townIcon:     1 = on, 0 = off (This is the icon you see on the strategy map)
- szIconFile:   The path to the sti icon file (eg: interface\prison.sti, interface\my_icon.sti)
- iconPosition: The x,y position of the icon on the strategy map

*** Encyclopedia and Briefing Room, reachable from the laptop ***
o 2 new ja2_options.ini properties: BRIEFING_ROOM, ENCYCLOPEDIA
o demonstration video: http://www.youtube.com/watch?v=7CIXdXWLrAo
o Added Example usage of the Briefing Room
- Extract it in your JA2 1.13 folder and use the latest development executable
- The briefing room can be reached from the laptop. Enter SN5631 for the code and then click the "Exit" button
- See "Info_BriefingRoom.txt" and "BriefingRoom_Mission1.png"

*** Improved interrupt system (IIS) ***
o This system changes the way interrupts work. See: http://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=290787#Post290787
o Option system (see ja2_options.ini: IMPROVED_INTERRUPT_SYSTEM)
o A few more settings for the interrupt system in ja2_options.ini
o INFO: Multiplayer games always use the "old" interrupt system, not matter what the user selects in the ja2_options.ini

*** Walking and sidestepping with weapon raised ***
o Enable/disable the walking/sidestepping with raised weapon in ja2_options.ini: ALLOW_WALKING_WITH_WEAPON_RAISED
o You can set an AP/BP modifier when walking/sidestepping with weapon raised in APBPConstants.ini: AP_MODIFIER_WEAPON_READY
o The following feature apply when you walk/sidestep with weapon raised:
-> limited angle of view, but you can see more farther when the weapon has a scope
-> better change for interrupts if you see an enemy
-> less APs and BPs when shooting, because the weapon is already raised
-> It should cost more APs when walking. Maybe you can export the additional AP and BP modifier to the APBPConstants.ini

*** Increase squad size to 8 (800x600) and 8 and 10 (1024x768) ***
o Squad sizes (dependend on the screen resolution) can be selected in the start new game screen
o In a multiplayer game, the squad size will always be 6, because it does not work with more soldiers/squad

*** Added UB-1.13 source code ***
o Merged the UB-1.13 source code (Revision: 4721) from svn: http://subversion.assembla.com/svn/ub-source113
o If you want to build UB-EXE or UB-MapEditor, just enable the 2 defines (JA2UB and JA2UBMAPS) in "builddefines.h"
o The UB-Verion reads from "ja2_UB.ini" instead of "ja2.ini"
o There are 2 new XML files
- Layout\LayoutMainMenu.xml
- MapAction\ActionItems.xml
o There are 2 new LUA-Script files
- Scripts\ExplosionControl.lua
- Scripts\InterfaceDialogue.lua

*** Hide enemy health text / enemy hit count ***
o ja2_options.ini: HIDE_ENEMY_HEALTH_TEXT, HIDE_ENEMY_HIT_COUNT
o both new settings only have effect in a singleplayer game
o see: http://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=128840&page=1


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4885 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2012-01-18 11:19:01 +00:00

396 lines
12 KiB
C

#ifndef __OVERHEAD_H
#define __OVERHEAD_H
#include <string.h>
#include <stdio.h>
#include "Soldier Control.h"
#include "overhead types.h"
#include "soldier find.h"
#define ADD_SOLDIER_NO_PROFILE_ID 200
#define MAX_REALTIME_SPEED_VAL 10
/*
enum
{
TOPTION_SUBTITLES,
TOPTION_SPEECH,
TOPTION_KEY_ADVANCE_SPEECH,
TOPTION_RTCONFIRM,
TOPTION_HIDE_BULLETS,
TOPTION_TRACKING_MODE,
TOPTION_CONFIRM_MOVE,
TOPTION_MUTE_CONFIRMATIONS,
TOPTION_SHADOWS,
TOPTION_BLOOD_N_GORE,
NUM_TOPTIONS
};
*/
// Enums for waiting for mercs to finish codes
enum
{
NO_WAIT_EVENT = 0,
WAIT_FOR_MERCS_TO_WALKOFF_SCREEN,
WAIT_FOR_MERCS_TO_WALKON_SCREEN,
WAIT_FOR_MERCS_TO_WALK_TO_GRIDNO
};
// TACTICAL ENGINE STATUS FLAGS
typedef struct
{
UINT8 bFirstID;
UINT8 bLastID;
COLORVAL RadarColor;
INT8 bSide;
INT8 bMenInSector;
UINT8 ubLastMercToRadio;
INT8 bTeamActive;
INT8 bAwareOfOpposition;
INT8 bHuman;
} TacticalTeamType;
//for use with TacticalStatusType.ubEnemyIntention
enum
{
INTENTION_SCOUTING,
INTENTION_PATROLLING,
INTENTION_ATTACKING,
INTENTION_DEFENDING,
INTENTION_RETREATING
};
//for use with TacticalStatusType.ubEnemyIntendedRetreatDirection
enum
{
RETREAT_NORTH,
RETREAT_EAST,
RETREAT_SOUTH,
RETREAT_WEST
};
#define PANIC_BOMBS_HERE 0x01
#define PANIC_TRIGGERS_HERE 0x02
#define NUM_PANIC_TRIGGERS 3
#define ENEMY_OFFERED_SURRENDER 0x01
typedef struct
{
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;
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;
// SANDRO - added these
UINT8 ubLastRequesterSurgeryTargetID;
UINT8 ubInterruptPending;
// PADDING GONE!!!!!
} TacticalStatusType;
extern UINT8 gbPlayerNum;
extern INT8 gbShowEnemies;
extern UINT16 gusSelectedSoldier;
extern UINT16 gusOldSelectedSoldier;
extern CHAR8 gzAlertStr[][ 30 ];
extern CHAR8 gzActionStr[][ 30 ];
extern CHAR8 gzDirectionStr[][ 30 ];
// TEMP FOR E3
extern UINT8 gubCurrentScene;
extern CHAR8 *GetSceneFilename( );
extern INT8 ubLevelMoveLink[ 10 ];
// Soldier List used for all soldier overhead interaction
extern SOLDIERTYPE Menptr[ TOTAL_SOLDIERS ];
extern SOLDIERTYPE *MercPtrs[ TOTAL_SOLDIERS ];
// MERC SLOTS - A LIST OF ALL ACTIVE MERCS
extern SOLDIERTYPE *MercSlots[ TOTAL_SOLDIERS ];
extern UINT32 guiNumMercSlots;
extern BOOLEAN gfMovingAnimation;
extern TacticalStatusType gTacticalStatus;
BOOLEAN InitTacticalEngine( );
void ShutdownTacticalEngine( );
BOOLEAN InitOverhead( );
BOOLEAN ShutdownOverhead( );
BOOLEAN GetSoldier( SOLDIERTYPE **ppSoldier, UINT16 usSoldierIndex );
UINT32 CountNonVehiclesOnPlayerTeam( void );
INT16 NewOKDestination( SOLDIERTYPE * pCurrSoldier, INT32 sGridNo, BOOLEAN fPeopleToo, INT8 bLevel );
//Simple check to see if a (one-tiled) soldier can occupy a given location on the ground or roof.
extern BOOLEAN IsLocationSittable( INT32 iMapIndex, BOOLEAN fOnRoof );
extern BOOLEAN IsLocationSittableExcludingPeople( INT32 iMapIndex, BOOLEAN fOnRoof );
extern BOOLEAN FlatRoofAboveGridNo( INT32 iMapIndex );
BOOLEAN ExecuteOverhead( );
BOOLEAN ResetAllAnimationCache( );
void EndTurn( );
void EndTurn( UINT8 ubNextTeam );
void StartPlayerTeamTurn( BOOLEAN fDoBattleSnd, BOOLEAN fEnteringCombatMode );
void EndTacticalDemo( );
void SelectSoldier( UINT16 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 BeginTeamTurn( UINT8 ubTeam );
void SlideTo(INT32 sGridNo, UINT16 usSoldierID , UINT16 usReasonID, BOOLEAN fSetLocator) ;
void SlideToLocation( UINT16 usReasonID, INT32 sDestGridNo );
void RebuildAllSoldierShadeTables( );
void HandlePlayerTeamMemberDeath( SOLDIERTYPE *pSoldier );
UINT8 LastActiveTeamMember( UINT8 ubTeam );
BOOLEAN SoldierOnVisibleWorldTile( SOLDIERTYPE *pSoldier );
UINT8 FindNextActiveAndAliveMerc( SOLDIERTYPE *pSoldier, BOOLEAN fGoodForLessOKLife, BOOLEAN fOnlyRegularMercs );
UINT8 FindPrevActiveAndAliveMerc( SOLDIERTYPE *pSoldier, BOOLEAN fGoodForLessOKLife, BOOLEAN fOnlyRegularMercs );
BOOLEAN CheckForPlayerTeamInMissionExit( );
void HandleNPCTeamMemberDeath( SOLDIERTYPE *pSoldier );
void StopMercAnimation( BOOLEAN fStop );
UINT32 EnterTacticalDemoMode();
BOOLEAN UIOKMoveDestination( SOLDIERTYPE *pSoldier, INT32 usMapPos );
INT32 FindAdjacentGridEx( SOLDIERTYPE *pSoldier, INT32 sGridNo, UINT8 *pubDirection, INT32 *psAdjustedGridNo, BOOLEAN fForceToPerson, BOOLEAN fDoor );
INT32 FindNextToAdjacentGridEx( SOLDIERTYPE *pSoldier, INT32 sGridNo, UINT8 *pubDirection, INT32 *psAdjustedGridNo, BOOLEAN fForceToPerson, BOOLEAN fDoor );
void SelectNextAvailSoldier( SOLDIERTYPE *pSoldier );
BOOLEAN TeamMemberNear(INT8 bTeam, INT32 sGridNo, INT32 iRange);
BOOLEAN IsValidTargetMerc( UINT8 ubSoldierID );
// FUNCTIONS FOR MANIPULATING MERC SLOTS - A LIST OF ALL ACTIVE MERCS
INT32 GetFreeMercSlot(void);
void RecountMercSlots(void);
INT32 AddMercSlot( SOLDIERTYPE *pSoldier );
BOOLEAN RemoveMercSlot( SOLDIERTYPE *pSoldier );
INT32 AddAwaySlot( SOLDIERTYPE *pSoldier );
BOOLEAN RemoveAwaySlot( SOLDIERTYPE *pSoldier );
INT32 MoveSoldierFromMercToAwaySlot( SOLDIERTYPE * pSoldier );
INT32 MoveSoldierFromAwayToMercSlot( SOLDIERTYPE * pSoldier );
void EnterCombatMode( UINT8 ubStartingTeam );
void ExitCombatMode( );
void HandleTeamServices( UINT8 ubTeamNum );
void HandlePlayerServices( SOLDIERTYPE *pTeamSoldier );
void SetEnemyPresence( );
void CycleThroughKnownEnemies( );
BOOLEAN CheckForEndOfCombatMode( BOOLEAN fIncrementTurnsNotSeen );
SOLDIERTYPE * FreeUpAttacker( );
BOOLEAN PlayerTeamFull( );
void SetActionToDoOnceMercsGetToLocation( UINT8 ubActionCode, INT8 bNumMercsWaiting, UINT32 uiData1, UINT32 uiData2, UINT32 uiData3 );
void ResetAllMercSpeeds( );
BOOLEAN HandleGotoNewGridNo( SOLDIERTYPE *pSoldier, BOOLEAN *pfKeepMoving, BOOLEAN fInitialMove, UINT16 usAnimState );
SOLDIERTYPE * ReduceAttackBusyCount( );
// HEADROCK HAM B2.6: Made this public so it can be used elsewhere.
INT8 CalcSuppressionTolerance( SOLDIERTYPE * pSoldier );
// HEADROCK HAM 3.2: A new function for checking the condition of nearby friendlies and returning a modifier.
INT8 CheckStatusNearbyFriendlies( SOLDIERTYPE *pSoldier );
void CommonEnterCombatModeCode( );
void CheckForPotentialAddToBattleIncrement( SOLDIERTYPE *pSoldier );
void CencelAllActionsForTimeCompression( void );
BOOLEAN CheckForEndOfBattle( BOOLEAN fAnEnemyRetreated );
void AddManToTeam( INT8 bTeam );
void RemoveManFromTeam( INT8 bTeam );
void RemoveSoldierFromTacticalSector( SOLDIERTYPE *pSoldier, BOOLEAN fAdjustSelected );
void MakeCivHostile( SOLDIERTYPE *pSoldier, INT8 bNewSide );
#define REASON_NORMAL_ATTACK 1
#define REASON_EXPLOSION 2
BOOLEAN ProcessImplicationsOfPCAttack( SOLDIERTYPE * pSoldier, SOLDIERTYPE ** ppTarget, INT8 bReason );
INT32 FindAdjacentPunchTarget( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pTargetSoldier, INT32 * psAdjustedTargetGridNo, UINT8 * pubDirection );
SOLDIERTYPE * CivilianGroupMemberChangesSides( SOLDIERTYPE * pAttacked );
void CivilianGroupChangesSides( UINT8 ubCivilianGroup );
void CycleVisibleEnemies( SOLDIERTYPE *pSrcSoldier );
UINT8 CivilianGroupMembersChangeSidesWithinProximity( SOLDIERTYPE * pAttacked );
void PauseAITemporarily( void );
void PauseAIUntilManuallyUnpaused( void );
void UnPauseAI( void );
void DoPOWPathChecks( void );
BOOLEAN HostileCiviliansWithGunsPresent( void );
BOOLEAN HostileCiviliansPresent( void );
BOOLEAN HostileBloodcatsPresent( void );
UINT8 NumPCsInSector( void );
void SetSoldierNonNeutral( SOLDIERTYPE * pSoldier );
void SetSoldierNeutral( SOLDIERTYPE * pSoldier );
#ifdef JA2UB
void HandleThePlayerBeNotifiedOfSomeoneElseInSector();
void SetMsgBoxForPlayerBeNotifiedOfSomeoneElseInSector();
void HandleDisplayingOfPlayerLostDialogue( void );
// UTILITY FUNCTIONS
INT8 NumActiveAndConsciousTeamMembers( UINT8 ubTeam );
UINT8 NumEnemyInSector( );
UINT8 NumCapableEnemyInSector( );
INT8 NumMercsOnPlayerTeam( );
#endif
extern BOOLEAN sniperwarning;
extern BOOLEAN biggunwarning;
extern BOOLEAN gogglewarning;
//extern BOOLEAN airstrikeavailable;
//void CheckForAndSetupAirRaid ();
//void EnemyCallInAirStrike (INT16 sSectorX, INT16 sSectorY);
// 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();
#endif