mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
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
154 lines
5.7 KiB
C
154 lines
5.7 KiB
C
#ifndef _OPPLIST_H
|
|
#define _OPPLIST_H
|
|
|
|
|
|
#define EVERYBODY MAXMERCS
|
|
|
|
#define MAX_MISC_NOISE_DURATION 12 // max dur for VERY loud NOBODY noises
|
|
|
|
#define DOOR_NOISE_VOLUME 2
|
|
#define WINDOW_CRACK_VOLUME 4
|
|
#define WINDOW_SMASH_VOLUME 8
|
|
#define MACHETE_VOLUME 9
|
|
#define TRIMMER_VOLUME 18
|
|
#define CHAINSAW_VOLUME 30
|
|
#define SMASHING_DOOR_VOLUME 6
|
|
#define CROWBAR_DOOR_VOLUME 4
|
|
#define ITEM_THROWN_VOLUME 2
|
|
|
|
#define TIME_BETWEEN_RT_OPPLIST_DECAYS 20
|
|
|
|
// this is a fake "level" value (0 on ground, 1 on roof) for
|
|
// HearNoise to ignore the effects of lighting(?)
|
|
#define LIGHT_IRRELEVANT 127
|
|
|
|
#define AUTOMATIC_INTERRUPT 100
|
|
#define NO_INTERRUPT 127
|
|
|
|
#define MOVEINTERRUPT 0
|
|
#define SIGHTINTERRUPT 1
|
|
#define NOISEINTERRUPT 2
|
|
|
|
|
|
// noise type constants
|
|
enum
|
|
{
|
|
NOISE_UNKNOWN = 0,
|
|
NOISE_MOVEMENT,
|
|
NOISE_CREAKING,
|
|
NOISE_SPLASHING,
|
|
NOISE_BULLET_IMPACT,
|
|
NOISE_GUNFIRE,
|
|
NOISE_EXPLOSION,
|
|
NOISE_SCREAM,
|
|
NOISE_ROCK_IMPACT,
|
|
NOISE_GRENADE_IMPACT,
|
|
NOISE_WINDOW_SMASHING,
|
|
NOISE_DOOR_SMASHING,
|
|
NOISE_SILENT_ALARM, // only heard by enemies
|
|
MAX_NOISES
|
|
};
|
|
|
|
enum
|
|
{
|
|
EXPECTED_NOSEND, // other nodes expecting noise & have all info
|
|
EXPECTED_SEND, // other nodes expecting noise, but need info
|
|
UNEXPECTED // other nodes are NOT expecting this noise
|
|
};
|
|
|
|
#define NUM_WATCHED_LOCS 3
|
|
|
|
extern INT8 gbPublicOpplist[MAXTEAMS][ TOTAL_SOLDIERS ];
|
|
extern INT8 gbSeenOpponents[TOTAL_SOLDIERS][TOTAL_SOLDIERS];
|
|
extern INT16 gsLastKnownOppLoc[TOTAL_SOLDIERS][TOTAL_SOLDIERS]; // merc vs. merc
|
|
extern INT8 gbLastKnownOppLevel[TOTAL_SOLDIERS][TOTAL_SOLDIERS];
|
|
extern INT16 gsPublicLastKnownOppLoc[MAXTEAMS][TOTAL_SOLDIERS]; // team vs. merc
|
|
extern INT8 gbPublicLastKnownOppLevel[MAXTEAMS][TOTAL_SOLDIERS];
|
|
extern UINT8 gubPublicNoiseVolume[MAXTEAMS];
|
|
extern INT16 gsPublicNoiseGridno[MAXTEAMS];
|
|
extern INT8 gbPublicNoiseLevel[MAXTEAMS];
|
|
extern UINT8 gubKnowledgeValue[10][10];
|
|
extern INT8 gbLookDistance[8][8];
|
|
extern INT8 gfKnowAboutOpponents;
|
|
|
|
extern BOOLEAN gfPlayerTeamSawJoey;
|
|
extern BOOLEAN gfMikeShouldSayHi;
|
|
|
|
|
|
extern INT16 gsWatchedLoc[ TOTAL_SOLDIERS ][ NUM_WATCHED_LOCS ];
|
|
extern INT8 gbWatchedLocLevel[ TOTAL_SOLDIERS ][ NUM_WATCHED_LOCS ];
|
|
extern UINT8 gubWatchedLocPoints[ TOTAL_SOLDIERS ][ NUM_WATCHED_LOCS ];
|
|
extern BOOLEAN gfWatchedLocReset[ TOTAL_SOLDIERS ][ NUM_WATCHED_LOCS ];
|
|
|
|
#define BEST_SIGHTING_ARRAY_SIZE 6
|
|
#define BEST_SIGHTING_ARRAY_SIZE_ALL_TEAMS_LOOK_FOR_ALL 6
|
|
#define BEST_SIGHTING_ARRAY_SIZE_NONCOMBAT 3
|
|
#define BEST_SIGHTING_ARRAY_SIZE_INCOMBAT 0
|
|
extern UINT8 gubBestToMakeSightingSize;
|
|
|
|
INT16 AdjustMaxSightRangeForEnvEffects( SOLDIERTYPE *pSoldier, INT8 bLightLevel, INT16 sDistVisible );
|
|
INT16 ManLooksForMan(SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent, UINT8 ubCaller);
|
|
void HandleSight(SOLDIERTYPE *pSoldier, UINT8 ubSightFlags);
|
|
void AllTeamsLookForAll(UINT8 ubAllowInterrupts);
|
|
void GloballyDecideWhoSeesWho(void);
|
|
UINT16 GetClosestMerc( UINT16 usSoldierIndex );
|
|
void ManLooksForOtherTeams(SOLDIERTYPE *pSoldier);
|
|
void OtherTeamsLookForMan(SOLDIERTYPE *pOpponent);
|
|
void ManSeesMan(SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent, INT16 sOppGridno, INT8 bOppLevel, UINT8 ubCaller, UINT8 ubCaller2);
|
|
void DecideTrueVisibility(SOLDIERTYPE *pSoldier, UINT8 ubLocate);
|
|
void AddOneOpponent(SOLDIERTYPE *pSoldier);
|
|
void RemoveOneOpponent(SOLDIERTYPE *pSoldier);
|
|
void UpdatePersonal(SOLDIERTYPE *pSoldier, UINT8 ubID, INT8 bNewOpplist, INT16 sGridno, INT8 bLevel);
|
|
INT16 MaxDistanceVisible( void );
|
|
INT16 DistanceVisible( SOLDIERTYPE *pSoldier, INT8 bFacingDir, INT8 bSubjectDir, INT16 sSubjectGridNo, INT8 bLevel, SOLDIERTYPE *pOther );
|
|
void ResetLastKnownLocs(SOLDIERTYPE *ptr);
|
|
void RecalculateOppCntsDueToNoLongerNeutral( SOLDIERTYPE * pSoldier );
|
|
void ReevaluateBestSightingPosition( SOLDIERTYPE * pSoldier, INT8 bInterruptDuelPts );
|
|
|
|
|
|
void InitOpponentKnowledgeSystem(void);
|
|
void InitSoldierOppList(SOLDIERTYPE *pSoldier);
|
|
void BetweenTurnsVisibilityAdjustments(void);
|
|
void RemoveManAsTarget(SOLDIERTYPE *pSoldier);
|
|
void UpdatePublic(UINT8 ubTeam, UINT8 ubID, INT8 bNewOpplist, INT16 sGridno, INT8 bLevel );
|
|
void RadioSightings(SOLDIERTYPE *pSoldier, UINT8 ubAbout, UINT8 ubTeamToRadioTo );
|
|
void OurTeamRadiosRandomlyAbout(UINT8 ubAbout);
|
|
void DebugSoldierPage1( );
|
|
void DebugSoldierPage2( );
|
|
void DebugSoldierPage3( );
|
|
void DebugSoldierPage4( );
|
|
|
|
UINT8 MovementNoise( SOLDIERTYPE *pSoldier );
|
|
UINT8 DoorOpeningNoise( SOLDIERTYPE *pSoldier );
|
|
void MakeNoise(UINT8 ubNoiseMaker, INT16 sGridNo, INT8 bLevel, UINT8 ubTerrType, UINT8 ubVolume, UINT8 ubNoiseType );
|
|
void OurNoise( UINT8 ubNoiseMaker, INT16 sGridNo, INT8 bLevel, UINT8 ubTerrType, UINT8 ubVolume, UINT8 ubNoiseType );
|
|
|
|
void ResolveInterruptsVs( SOLDIERTYPE * pSoldier, UINT8 ubInterruptType);
|
|
|
|
void VerifyAndDecayOpplist(SOLDIERTYPE *pSoldier);
|
|
void DecayIndividualOpplist(SOLDIERTYPE *pSoldier);
|
|
void VerifyPublicOpplistDueToDeath( SOLDIERTYPE * pSoldier );
|
|
void NoticeUnseenAttacker( SOLDIERTYPE * pAttacker, SOLDIERTYPE * pDefender, INT8 bReason );
|
|
|
|
BOOLEAN MercSeesCreature( SOLDIERTYPE * pSoldier );
|
|
|
|
INT8 GetWatchedLocPoints( UINT8 ubID, INT16 sGridNo, INT8 bLevel );
|
|
INT8 GetHighestVisibleWatchedLoc( UINT8 ubID );
|
|
INT8 GetHighestWatchedLocPoints( UINT8 ubID );
|
|
|
|
void TurnOffEveryonesMuzzleFlashes( void );
|
|
void TurnOffTeamsMuzzleFlashes( UINT8 ubTeam );
|
|
void EndMuzzleFlash( SOLDIERTYPE * pSoldier );
|
|
void NonCombatDecayPublicOpplist( UINT32 uiTime );
|
|
|
|
void CheckHostileOrSayQuoteList( void );
|
|
void InitOpplistForDoorOpening( void );
|
|
UINT8 DoorOpeningNoise( SOLDIERTYPE * pSoldier );
|
|
|
|
void AddToShouldBecomeHostileOrSayQuoteList( UINT8 ubID );
|
|
|
|
extern INT8 gbLightSighting[1][16];
|
|
|
|
BOOLEAN SoldierHasLimitedVision(SOLDIERTYPE * pSoldier);
|
|
|
|
#endif |