This commit is contained in:
parent
e890f6ce88
commit
f81e80230f
2 changed files with 265 additions and 0 deletions
90
source/enemy/npc.h
Normal file
90
source/enemy/npc.h
Normal file
|
@ -0,0 +1,90 @@
|
|||
|
||||
#ifndef __NPC_H__
|
||||
#define __NPC_H__
|
||||
|
||||
//#include <dstructs.h>
|
||||
#include "Game/Thing.h"
|
||||
#include "Gfx/Skel.h"
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
class CNpc : public CThing
|
||||
{
|
||||
public:
|
||||
void init();
|
||||
void shutdown();
|
||||
void think(int _frames);
|
||||
virtual void render();
|
||||
|
||||
|
||||
protected:
|
||||
// NPC data structure definitions //
|
||||
|
||||
enum NPC_UNIT_TYPE
|
||||
{
|
||||
NPC_TEST_TYPE = 0,
|
||||
NPC_UNIT_TYPE_MAX,
|
||||
};
|
||||
|
||||
enum NPC_INIT_FUNC
|
||||
{
|
||||
NPC_INIT_DEFAULT = 0,
|
||||
NPC_INIT_SNAKE = 1,
|
||||
NPC_INIT_ACID,
|
||||
};
|
||||
|
||||
enum NPC_CONTROL_FUNC
|
||||
{
|
||||
NPC_CONTROL_MOVEMENT,
|
||||
NPC_CONTROL_SHOT,
|
||||
NPC_CONTROL_CLOSE,
|
||||
NPC_CONTROL_COLLISION,
|
||||
};
|
||||
|
||||
enum NPC_SENSOR_FUNC
|
||||
{
|
||||
NPC_SENSOR_NONE = 0,
|
||||
NPC_SENSOR_USER_CLOSE = 1,
|
||||
};
|
||||
|
||||
enum NPC_MOVEMENT_FUNC
|
||||
{
|
||||
NPC_MOVEMENT_STATIC = 0,
|
||||
NPC_MOVEMENT_FIXED_PATH = 1,
|
||||
NPC_MOVEMENT_USER_SEEK,
|
||||
NPC_MOVEMENT_VERTICAL,
|
||||
};
|
||||
|
||||
enum NPC_MOVEMENT_MODIFIER_FUNC
|
||||
{
|
||||
NPC_MOVEMENT_MODIFIER_NONE = 0,
|
||||
NPC_MOVEMENT_MODIFIER_BOB = 1,
|
||||
};
|
||||
|
||||
|
||||
typedef struct NPC_DATA_TYPE
|
||||
{
|
||||
NPC_INIT_FUNC initFunc;
|
||||
NPC_SENSOR_FUNC sensorFunc;
|
||||
NPC_MOVEMENT_FUNC movementFunc;
|
||||
NPC_MOVEMENT_MODIFIER_FUNC movementModifierFunc;
|
||||
}
|
||||
NPC_DATA;
|
||||
|
||||
NPC_UNIT_TYPE m_type;
|
||||
NPC_CONTROL_FUNC m_controlFunc;
|
||||
|
||||
bool processSensor();
|
||||
void processMovement();
|
||||
void processShot();
|
||||
void processClose();
|
||||
void processCollision();
|
||||
void processTimer();
|
||||
|
||||
static NPC_DATA m_data[NPC_UNIT_TYPE_MAX];
|
||||
};
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue