Files
source/Tactical/Squads.h
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

178 lines
5.3 KiB
C

#ifndef _SQUADS_H
#define _SQUADS_H
#include "Soldier Control.h"
#include "FileMan.h"
#include "Overhead Types.h"
// header for squad management system
#define NUMBER_OF_SOLDIERS_PER_SQUAD 10
// enums for squads
enum{
FIRST_SQUAD=0,
SECOND_SQUAD,
THIRD_SQUAD,
FOURTH_SQUAD,
FIFTH_SQUAD,
SIXTH_SQUAD,
SEVENTH_SQUAD,
EIGTH_SQUAD,
NINTH_SQUAD,
TENTH_SQUAD,
ELEVENTH_SQUAD,
TWELTH_SQUAD,
THIRTEENTH_SQUAD,
FOURTEENTH_SQUAD,
FIFTHTEEN_SQUAD,
SIXTEENTH_SQUAD,
SEVENTEENTH_SQUAD,
EIGTHTEENTH_SQUAD,
NINTEENTH_SQUAD,
TWENTYTH_SQUAD,
NUMBER_OF_SQUADS,
};
// ATE: Added so we can have no current squad
// happens in we move off sector via tactical, but nobody is left!
#define NO_CURRENT_SQUAD NUMBER_OF_SQUADS
// ptrs to soldier types of squads and their members
// squads
extern SOLDIERTYPE *Squad[ NUMBER_OF_SQUADS ][ NUMBER_OF_SOLDIERS_PER_SQUAD ];
extern INT32 iCurrentTacticalSquad;
// will initialize the squad lists for game initalization
void InitSquads( void );
// add character to squad
BOOLEAN AddCharacterToSquad( SOLDIERTYPE *pCharacter, INT8 bSquadValue );
// find the first slot the guy will fit in, return true if he is in a squad or has been put in one
BOOLEAN AddCharacterToAnySquad( SOLDIERTYPE *pCharacter );
// remove character from squads
BOOLEAN RemoveCharacterFromSquads( SOLDIERTYPE *pCharacter );
// remove character from a squad
BOOLEAN RemoveCharacterFromASquad( SOLDIERTYPE *pCharacter, INT8 bSquadValue );
// check if character is in this squad
BOOLEAN IsCharacterInSquad( SOLDIERTYPE *pCharacter, INT8 bSquadValue );
// return which squad character is in, -1 if none found
INT8 SquadCharacterIsIn( SOLDIERTYPE *pCharacter );
// what slot is character in in this squad?..-1 if not found in squad
INT8 SlotCharacterIsInSquad( SOLDIERTYPE *pCharacter, INT8 bSquadValue );
// return number of people in this squad
INT8 NumberOfPeopleInSquad( INT8 bSquadValue );
INT8 NumberOfNonEPCsInSquad( INT8 bSquadValue );
BOOLEAN IsRobotControllerInSquad( INT8 bSquadValue );
INT8 NumberOfPlayerControllableMercsInSquad( INT8 bSquadValue );
// what sector is the squad currently in?..return if anyone in squad
BOOLEAN SectorSquadIsIn(INT8 bSquadValue, INT16 *sMapX, INT16 *sMapY, INT16 *sMapZ );
// rebuild current squad list
void RebuildCurrentSquad( void );
// copy path of squad to character
BOOLEAN CopyPathOfSquadToCharacter( SOLDIERTYPE *pCharacter, INT8 bSquadValue );
// copy path from character back to squad
BOOLEAN CopyPathOfCharacterToSquad( SOLDIERTYPE *pCharacter, INT8 bSquadValue );
// what is the id of the current squad?
INT32 CurrentSquad( void );
// add character to unique squad (returns the squad #, -1 if failed)
INT8 AddCharacterToUniqueSquad( SOLDIERTYPE *pCharacter );
// resort the squad by ubID
void SortSquadByID( INT8 bSquadValue );
// is this squad empty?
BOOLEAN SquadIsEmpty( INT8 bSquadValue );
// is this squad in the current tactical sector?
BOOLEAN IsSquadOnCurrentTacticalMap( INT32 iCurrentSquad );
// set this squad as the current tatcical squad
BOOLEAN SetCurrentSquad( INT32 iCurrentSquad, BOOLEAN fForce );
// set default squad in sector
void SetDefaultSquadOnSectorEntry( BOOLEAN fForce );
// get last squad that has active mercs
INT32 GetLastSquadActive( void );
// set squads between sector position
void SetSquadPositionBetweenSectors( UINT8 ubNextX, UINT8 ubNextY, UINT8 ubPrevX, UINT8 ubPrevY, UINT32 uiTraverseTime, UINT32 uiArriveTime, UINT8 ubSquadValue );
// get squads between sector positions and times
void GetSquadPosition( UINT8 *ubNextX, UINT8 *ubNextY, UINT8 *ubPrevX, UINT8 *ubPrevY, UINT32 *uiTraverseTime, UINT32 *uiArriveTime, UINT8 ubSquadValue );
void ExamineCurrentSquadLights( void );
// get location of this squad
void GetLocationOfSquad( INT16 *sX, INT16 *sY, INT8 *bZ, INT8 bSquadValue );
//Save the squad information to the saved game file
BOOLEAN SaveSquadInfoToSavedGameFile( HWFILE hFile );
//Load all the squad info from the saved game file
BOOLEAN LoadSquadInfoFromSavedGameFile( HWFILE hFile );
// get squad id of first free squad
INT8 GetFirstEmptySquad( void );
// is this squad in the same sector as soldier?
BOOLEAN IsSquadInSector( SOLDIERTYPE *pSoldier, UINT8 ubSquad );
// is any merc on squad asleep?
BOOLEAN IsAnyMercOnSquadAsleep( UINT8 ubSquadValue );
// is therea dead guy here
BOOLEAN IsDeadGuyInThisSquadSlot( INT8 bSlotId, INT8 bSquadValue , INT8 *bNumberOfDeadGuysSoFar );
// dead soldier was on squad
BOOLEAN SoldierIsDeadAndWasOnSquad( SOLDIERTYPE *pSoldier, INT8 bSquadValue );
// now reset the table for these mercs
BOOLEAN ResetDeadSquadMemberList( INT32 iSquadValue );
// this passed soldier on the current squad int he tactical map
BOOLEAN IsMercOnCurrentSquad( SOLDIERTYPE *pSoldier );
// is this squad filled up?
BOOLEAN IsThisSquadFull( INT8 bSquadValue );
// is this squad moving?
BOOLEAN IsThisSquadOnTheMove( INT8 bSquadValue );
// is there a vehicle in this squad?
BOOLEAN DoesVehicleExistInSquad( INT8 bSquadValue );
// re-create any trashed squad movement groups
void CheckSquadMovementGroups( void );
//SQUAD10: Check for squads that are oversized at current resolution and move them to another squad
void FixOversizedSquadsInSector( void );
#endif