Files
source/Utils/Event Pump.h
T
Wanne 47210f9b14 Updated Enemy taunts feature (by anv)
- ridiculous amount of tags: attack, hit, miss, kill, head pop, blinded, type of attack, is target a zombie...
- ripostes to merc quotes,
- taunts can now make noise,
- bumped up amount of taunts to respectable 733, mostly thanks to your contributions guys,
- accidently squashed bug with incorrect noise notifications ("hears scream" instead of "hears explosion" etc.)

Ripostes
At the moment enemies can react to quotes "enemy detected", "1st enemy detected", "multiple enemies detected", "bullet flew by", "under heavy fire", as these are most likely to be used in combat. In the first three cases, riposting enemy will be chosen randomly from all enemy witnesses, latter two - last enemy to attack this merc will taunt.
Enemy's riposte will come as soon as merc quote is finished.

Noisy taunts
Taunts can be handled like other noises in game - shots, explosions, etc., meaning:
- they will be displayed only if someone from our team is close enough to hear them,
- they can be heard even if you don't see enemy (with twist of his name changed to "unknown voice". Yay.)
- volume of taunts is configurable in .ini.

see: http://www.ja-galaxy-forum.com/board/ubbthreads.php/topics/327830/4.html



git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6628 3b4a5df2-a311-0410-b5c6-a8a6f20db521
2013-11-19 07:52:51 +00:00

278 lines
5.1 KiB
C

#ifndef EVENT_PROCESSOR_H
#define EVENT_PROCESSOR_H
#include "Event Manager.h"
#include "Overhead Types.h"
#define NETWORK_PATH_DATA_SIZE 6
// Enumerate all events for JA2
enum eJA2Events
{
E_PLAYSOUND,
S_CHANGEDEST,
// S_GETNEWPATH,
S_BEGINTURN,
S_CHANGESTANCE,
S_SETDESIREDDIRECTION,
S_BEGINFIREWEAPON,
S_FIREWEAPON,
S_WEAPONHIT,
S_STRUCTUREHIT,
S_WINDOWHIT,
S_MISS,
S_NOISE,
S_STOP_MERC,
EVENTS_LOCAL_AND_NETWORK, // Events above here are sent locally and over network
S_GETNEWPATH,
S_SETPOSITION,
S_CHANGESTATE,
S_SETDIRECTION,
EVENTS_ONLY_USED_LOCALLY, // Events above are only used locally
S_SENDPATHTONETWORK,
S_UPDATENETWORKSOLDIER,
EVENTS_ONLY_SENT_OVER_NETWORK, // Events above are only sent to the network
NUM_EVENTS
} ;
// This definition is used to denote events with a special delay value;
// it indicates that these events will not be processed until specifically
// called for in a special loop.
#define DEMAND_EVENT_DELAY 0xFFFF
// Enumerate all structures for events
typedef struct
{
UINT16 usIndex;
UINT16 usRate;
UINT8 ubVolume;
UINT8 ubLoops;
UINT32 uiPan;
} EV_E_PLAYSOUND;
typedef struct
{
UINT16 usSoldierID;
UINT32 uiUniqueId;
UINT16 usNewState;
INT16 sXPos;
INT16 sYPos;
UINT16 usStartingAniCode;
BOOLEAN fForce;
UINT8 usNewDirection;//hayden
UINT32 usTargetGridNo; // WANNE - MP: Used for manipulating the target grid no
} EV_S_CHANGESTATE;
typedef struct
{
UINT16 usSoldierID;
UINT32 uiUniqueId;
INT32 usNewDestination;
} EV_S_CHANGEDEST;
typedef struct
{
UINT16 usSoldierID;
UINT32 uiUniqueId;
FLOAT dNewXPos;
FLOAT dNewYPos;
} EV_S_SETPOSITION;
typedef struct
{
UINT16 usSoldierID;
UINT32 uiUniqueId;
INT32 sDestGridNo;
UINT16 usMovementAnim;
} EV_S_GETNEWPATH;
typedef struct
{
UINT16 usSoldierID;
UINT32 uiUniqueId;
} EV_S_BEGINTURN;
typedef struct
{
UINT16 usSoldierID;
UINT32 uiUniqueId;
UINT8 ubNewStance;
INT16 sXPos;
INT16 sYPos;
} EV_S_CHANGESTANCE;
typedef struct
{
UINT16 usSoldierID;
UINT32 uiUniqueId;
UINT16 usNewDirection;
} EV_S_SETDIRECTION;
typedef struct
{
UINT16 usSoldierID;
UINT32 uiUniqueId;
UINT16 usDesiredDirection;
} EV_S_SETDESIREDDIRECTION;
typedef struct
{
UINT16 usSoldierID;
UINT32 uiUniqueId;
INT32 sTargetGridNo;
INT8 bTargetLevel;
INT8 bTargetCubeLevel;
} EV_S_BEGINFIREWEAPON;
typedef struct
{
UINT16 usSoldierID;
UINT32 uiUniqueId;
INT32 sTargetGridNo;
INT8 bTargetLevel;
INT8 bTargetCubeLevel;
} EV_S_FIREWEAPON;
typedef struct
{
UINT16 usSoldierID;
UINT32 uiUniqueId;
UINT16 usWeaponIndex;
INT16 sDamage;
INT16 sBreathLoss;
UINT16 usDirection;
INT16 sXPos;
INT16 sYPos;
INT16 sZPos;
INT16 sRange;
UINT8 ubAttackerID;
BOOLEAN fHit;
UINT8 ubSpecial;
UINT8 ubLocation;
INT32 iBullet;
BOOLEAN fStopped;
} EV_S_WEAPONHIT;
typedef struct
{
INT16 sXPos;
INT16 sYPos;
INT16 sZPos;
UINT16 usWeaponIndex;
INT16 bWeaponStatus;
UINT8 ubAttackerID;
UINT16 usStructureID;
INT32 iImpact;
INT32 iBullet;
BOOLEAN fStopped;//hayden
} EV_S_STRUCTUREHIT;
typedef struct
{
INT32 sGridNo;
UINT16 usStructureID;
BOOLEAN fBlowWindowSouth;
BOOLEAN fLargeForce;
UINT8 ubAttackerID;
INT32 iBullet;
} EV_S_WINDOWHIT;
typedef struct
{
UINT8 ubAttackerID;
INT32 iBullet;
} EV_S_MISS;
typedef struct
{
UINT8 ubNoiseMaker;
INT32 sGridNo;
UINT8 bLevel;
UINT8 ubTerrType;
UINT8 ubVolume;
UINT8 ubNoiseType;
CHAR16 zNoiseMessage[320];
} EV_S_NOISE;
typedef struct
{
UINT16 usSoldierID;
UINT32 uiUniqueId;
UINT8 ubDirection;
INT32 sGridNo;
INT16 sXPos;
INT16 sYPos;
BOOLEAN fset;
} EV_S_STOP_MERC;
typedef struct
{
UINT8 usSoldierID;
// UINT32 uiUniqueId;
UINT16 usPathDataSize; // Size of Path
INT32 sAtGridNo; // Owner merc is at this tile when sending packet
UINT16 usCurrentPathIndex; // Index the owner of the merc is at when sending packet
UINT16 usPathData[ MAX_PATH_LIST_SIZE ]; // make define // Next X tile to go to
UINT16 ubNewState; // new movment Anim
INT32 sDestGridNo;
// INT8 bActionPoints;
// INT8 bBreath; // current breath value
// INT8 bDesiredDirection;
// maybe send current action & breath points
} EV_S_SENDPATHTONETWORK;
typedef struct
{
UINT8 usSoldierID;
//UINT32 uiUniqueId;
INT32 sAtGridNo; // Owner merc is at this tile when sending packet
INT8 bActionPoints; // current A.P. value
INT8 bBreath; // current breath value
//hayden
INT8 bLife;
INT8 bBleeding;
UINT16 usTactialTurnLimitCounter;
UINT16 usTactialTurnLimitMax;
UINT8 ubDirection;
UINT8 ubNewStance;
} EV_S_UPDATENETWORKSOLDIER;
// FUNCTIONS
BOOLEAN AddGameEvent( UINT32 uiEvent, UINT16 usDelay, PTR pEventData );
BOOLEAN AddGameEventFromNetwork( UINT32 uiEvent, UINT16 usDelay, PTR pEventData );
BOOLEAN DequeAllGameEvents( BOOLEAN fExecute );
BOOLEAN DequeueAllDemandGameEvents( BOOLEAN fExecute );
// clean out the evetn queue
BOOLEAN ClearEventQueue( void );
#endif