Files
source/Strategic/Map Screen Interface Map.h
T
Overhaul 7a27e7105d New attack busy system
Added missing #includes

Added LUA scripting and console

Changed the way tracers are visualized, so they work more like real tracers instead of a light fountain

Fixed signedness of many grid variables used in GetMouseMapPos calls

Fixed enemy weapon choosing:  Sometimes a mortar is chosen but later rejected, but the grenade class was not reset.  Caused assertion failure

Added checks so enemies don't try to chuck RPG grenades with their hands

Now possible to shoot a someone in the head if he's in water

Fixed InitSightArrays to also clear soldier interrupt duel points.  This was causing an assertion failure elsewhere in the code because the interrupt list still had soldiers on it sometimes when this function was called.

Soldiers are much less willing to forfeit their turn over an attempt to use more APs than they have

Removed early setting of muzzle flash.  This would allow enemies to get an interrupt before you even fired.

Fixed item dropping by AI.  If AI tried to drop something while standing it would cause deadlock

Change to greatly speed up closing the sector inventory window in an unloaded sector

Added conditional compile flag to always give robot weapon ready advantage, even for 360 degree sighting


Check builddefines.h for the conditional flags.  Of greatest interest might be LUA_CONSOLE.  This will cause the game to bring up a command console when run.  However this console is severely lacking in many areas.  If anybody knows of an open-source terminal/console that could be used instead, it would be appreciated.  The existing console does bad things when you try to close it, and since it counts as a separate app, it pauses the game while it has focus.

LUA scripting is very limited, basically just proof of concept.  There is one global variable, the Soldiers array.  An array index gives you the soldier in that slot in the currently loaded sector.  The soldier has a few things that can be accessed:  name (short name); fullname (long name); grid (current grid #, can be changed); walkto(grid) (function to walk to another grid); runto(grid) (function to run to another grid)


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@924 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2007-06-09 09:01:04 +00:00

292 lines
8.3 KiB
C

#ifndef _MAP_SCREEN_INTERFACE_MAP_H
#define _MAP_SCREEN_INTERFACE_MAP_H
#include "Vehicles.h"
#include "mapscreen.h"
// functions
void DrawMapIndexBigMap( BOOLEAN fSelectedCursorIsYellow );
//void DrawMapIndexSmallMap( BOOLEAN fSelectedCursorIsYellow );
UINT32 DrawMap( void );
void GetScreenXYFromMapXY( INT16 sMapX, INT16 sMapY, INT16 *psX, INT16 *psY );
void GetScreenXYFromMapXYStationary( INT16 sMapX, INT16 sMapY, INT16 *psX, INT16 *psY );
BOOLEAN InitializePalettesForMap( void );
void ShutDownPalettesForMap( void );
// plot path for helicopter
void PlotPathForHelicopter( INT16 sX, INT16 sY );
// the temp path, where the helicopter could go
void PlotATemporaryPathForHelicopter( INT16 sX, INT16 sY );
// trace a route for a passed path...doesn't require dest char - most more general
BOOLEAN TracePathRoute( BOOLEAN fCheckFlag, BOOLEAN fForceUpDate, PathStPtr pPath );
// show arrows for this char
void DisplayPathArrows(UINT16 usCharNum, HVOBJECT hMapHandle);
// restore backgrounds for arrows
void RestoreArrowBackgroundsForTrace(INT32 iArrow, INT32 iArrowX, INT32 iArrowY, BOOLEAN fZoom);
// build path for character
void PlotPathForCharacter( SOLDIERTYPE *pCharacter, INT16 sX, INT16 sY, BOOLEAN fTacticalTraversal );
// build temp path for character
void PlotATemporaryPathForCharacter( SOLDIERTYPE *pCharacter, INT16 sX, INT16 sY );
// display current/temp paths
void DisplaySoldierPath( SOLDIERTYPE *pCharacter );
void DisplaySoldierTempPath( SOLDIERTYPE *pCharacter );
void DisplayHelicopterPath( void );
void DisplayHelicopterTempPath( void );
// clear path after this sector
UINT32 ClearPathAfterThisSectorForCharacter( SOLDIERTYPE *pCharacter, INT16 sX, INT16 sY );
// cancel path : clear the path completely and gives player feedback message that the route was canceled
void CancelPathForCharacter( SOLDIERTYPE *pCharacter );
void CancelPathForVehicle( VEHICLETYPE *pVehicle, BOOLEAN fAlreadyReversed );
void CancelPathForGroup( GROUP *pGroup );
// check if we have waited long enought o update temp path
void DisplayThePotentialPathForHelicopter(INT16 sMapX, INT16 sMapY );
// clear out helicopter list after this sector
UINT32 ClearPathAfterThisSectorForHelicopter( INT16 sX, INT16 sY );
// check to see if sector is highlightable
BOOLEAN IsTheCursorAllowedToHighLightThisSector( INT16 sSectorX, INT16 sSectorY );
// set bad sectors list
void SetUpBadSectorsList( void );
// restore background for map grids
void RestoreBackgroundForMapGrid( INT16 sMapX, INT16 sMapY );
// clip blits to map view region
void ClipBlitsToMapViewRegion( void );
void ClipBlitsToMapViewRegionForRectangleAndABit( UINT32 uiDestPitchBYTES );
// clip blits to full screen....restore after use of ClipBlitsToMapViewRegion( )
void RestoreClipRegionToFullScreen( void );
void RestoreClipRegionToFullScreenForRectangle( UINT32 uiDestPitchBYTES );
// show the icons for people in motion
void ShowPeopleInMotion( INT16 sX, INT16 sY );
// last sector in helicopter's path
INT16 GetLastSectorOfHelicoptersPath( void );
// display info about helicopter path
void DisplayDistancesForHelicopter( void );
// display where hei is
void DisplayPositionOfHelicopter( void );
// check for click
BOOLEAN CheckForClickOverHelicopterIcon( INT16 sX, INT16 sY );
// show town markers
void BlitTownGridMarkers( void );
// load and delete the graphics for the map screen map militia
BOOLEAN LoadMilitiaPopUpBox( void );
void RemoveMilitiaPopUpBox( void );
// check if anyone left behind, if not, move selected cursor along with movement group
//void CheckIfAnyoneLeftInSector( INT16 sX, INT16 sY, INT16 sNewX, INT16 sNewY, INT8 bZ );
// grab the total number of militia in sector
INT32 GetNumberOfMilitiaInSector( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ );
// create destroy
void CreateDestroyMilitiaPopUPRegions( void );
// draw the militia box
BOOLEAN DrawMilitiaPopUpBox( void );
//Returns true if the player knows how many enemies are in the sector if that number is greater than 0.
//Returns false for all other cases.
UINT32 WhatPlayerKnowsAboutEnemiesInSector( INT16 sSectorX, INT16 sSectorY );
//There is a special case flag used when players encounter enemies in a sector, then retreat. The number of enemies
//will display on mapscreen until time is compressed. When time is compressed, the flag is cleared, and
//a question mark is displayed to reflect that the player no longer knows. This is the function that clears that
//flag.
void ClearAnySectorsFlashingNumberOfEnemies();
void CopyPathToCharactersSquadIfInOne( SOLDIERTYPE *pCharacter );
void InitMapSecrets( void );
enum {
ABORT_PLOTTING = 0,
PATH_CLEARED,
PATH_SHORTENED,
};
// what the player knows about the enemies in a given sector
enum {
KNOWS_NOTHING = 0,
KNOWS_THEYRE_THERE,
KNOWS_HOW_MANY,
};
// size of squares on the map
#define MAP_GRID_X 21
#define MAP_GRID_Y 18
// scroll bounds
#define EAST_ZOOM_BOUND 378
#define WEST_ZOOM_BOUND 42
#define SOUTH_ZOOM_BOUND 324
#define NORTH_ZOOM_BOUND 36
// WANNE: The starting top/left position of the background image
#define MAP_BORDER_X 261
#define MAP_BORDER_Y 0
// WANNE: The offset of the map border
#define MAP_BORDER_X_OFFSET (((SCREEN_WIDTH - 261) - 380) / 2)
#define MAP_BORDER_Y_OFFSET (((SCREEN_HEIGHT - 121) - 360) / 2)
// WANNE: The map view region (map image pcx)
#define MAP_VIEW_START_X (MAP_BORDER_X + MAP_BORDER_X_OFFSET + 9)
#define MAP_VIEW_START_Y (MAP_BORDER_Y + MAP_BORDER_Y_OFFSET + 10)
#define MAP_VIEW_WIDTH 336
#define MAP_VIEW_HEIGHT 298
//#define MAP_VIEW_START_X 270
//#define MAP_VIEW_START_Y 10
//#define MAP_VIEW_WIDTH 336
//#define MAP_VIEW_HEIGHT 298
// zoomed in grid sizes
#define MAP_GRID_ZOOM_X MAP_GRID_X*2
#define MAP_GRID_ZOOM_Y MAP_GRID_Y*2
// number of units wide
#define WORLD_MAP_X 18
// dirty regions for the map
#define DMAP_GRID_X ( MAP_GRID_X + 1 )
#define DMAP_GRID_Y ( MAP_GRID_Y + 1 )
#define DMAP_GRID_ZOOM_X ( MAP_GRID_ZOOM_X+1)
#define DMAP_GRID_ZOOM_Y ( MAP_GRID_ZOOM_Y+1)
// Orta position on the map
#define ORTA_SECTOR_X 4
#define ORTA_SECTOR_Y 11
#define TIXA_SECTOR_X 9
#define TIXA_SECTOR_Y 10
// what are we showing?..teams/vehicles
// Show values
#define SHOW_TEAMMATES 1
#define SHOW_VEHICLES 2
// wait time until temp path is drawn, from placing cursor on a map grid
#define MIN_WAIT_TIME_FOR_TEMP_PATH 200
//extern INT32 MAP_VIEW_START_X;
//extern INT32 MAP_VIEW_START_Y;
// zoom UL coords
extern INT32 iZoomX;
extern INT32 iZoomY;
// the number of militia on the cursor
extern INT16 sGreensOnCursor;
extern INT16 sRegularsOnCursor;
extern INT16 sElitesOnCursor;
// highlighted sectors
extern INT16 gsHighlightSectorX;
extern INT16 gsHighlightSectorY;
// the big map
extern UINT32 guiBIGMAP;
// the orta icon
extern UINT32 guiORTAICON;
extern UINT32 guiTIXAICON;
// the character icons
extern UINT32 guiCHARICONS;
// the merc arrival sector landing zone icon
extern UINT32 guiBULLSEYE;
// character between sector icons
extern UINT32 guiCHARBETWEENSECTORICONS;
extern UINT32 guiCHARBETWEENSECTORICONSCLOSE;
// the viewable map bound region
extern SGPRect MapScreenRect;
// draw temp path
extern BOOLEAN fDrawTempHeliPath;
// selected destination char
extern INT8 bSelectedDestChar;
// current assignment character
extern INT8 bSelectedAssignChar;
// the info character
extern INT8 bSelectedInfoChar;
// the contract char
extern INT8 bSelectedContractChar;
// map arrows graphical index value
extern UINT32 guiMAPCURSORS;
// has temp path for character path or helicopter been already drawn
extern BOOLEAN fTempPathAlreadyDrawn;
// map view region clipping rect
extern SGPRect MapScreenRect;
// the map border eta pop up
extern UINT32 guiMapBorderEtaPopUp;
// heli pop up
extern UINT32 guiMapBorderHeliSectors;
// the currently selected town militia
extern INT16 sSelectedMilitiaTown;
// the selected sectors
extern UINT16 sSelMapX;
extern UINT16 sSelMapY;
extern BOOLEAN fFoundTixa;
extern UINT32 guiSubLevel1, guiSubLevel2, guiSubLevel3;
extern INT16 sBaseSectorList[ MAX_TOWNS - 1 ];
extern POINT pTownPoints[ MAX_TOWNS ];
#endif