Rev | Line | |
---|
[10651] | 1 | |
---|
| 2 | #ifndef _NPC_H |
---|
| 3 | #define _NPC_H |
---|
| 4 | |
---|
| 5 | #include "world_entity.h" |
---|
| 6 | #include "world_entities/weapons/weapon_manager.h" |
---|
| 7 | #include "track/action_box.h" |
---|
| 8 | |
---|
| 9 | class ActionboxEnemy : public WorldEntity |
---|
| 10 | { |
---|
| 11 | ObjectListDeclaration(ActionboxEnemy); |
---|
| 12 | |
---|
| 13 | public: |
---|
| 14 | ActionboxEnemy(const TiXmlElement* root = NULL); |
---|
| 15 | virtual ~ActionboxEnemy (); |
---|
| 16 | |
---|
| 17 | virtual void tick(float dt); |
---|
| 18 | virtual void draw() const; |
---|
| 19 | |
---|
| 20 | virtual void loadParams(const TiXmlElement* root); |
---|
[10712] | 21 | |
---|
| 22 | virtual void destroy( WorldEntity* killer ); |
---|
[10651] | 23 | |
---|
| 24 | private: |
---|
| 25 | bool isActive; |
---|
| 26 | float pitch; // rotate angle around x-axix |
---|
| 27 | float dPitch; // change pitch += dPitch*dt |
---|
[10656] | 28 | Quaternion qPitch; |
---|
[10651] | 29 | |
---|
[10662] | 30 | float acceleration; |
---|
| 31 | float maxSpeed; |
---|
| 32 | float speed; |
---|
[10727] | 33 | float agility; |
---|
[10662] | 34 | |
---|
[10727] | 35 | void setAcceleration( float f ){ this->acceleration = f; } |
---|
| 36 | void setMaxSpeed( float f ){ this->maxSpeed = f; } |
---|
| 37 | void setAgility( float f ){ this->agility = f; } |
---|
| 38 | |
---|
[10656] | 39 | Quaternion myDir; |
---|
| 40 | Vector myCoor; |
---|
| 41 | |
---|
[10667] | 42 | bool bFire; |
---|
| 43 | |
---|
| 44 | Vector escapePoint; |
---|
| 45 | bool onEscape; |
---|
[10725] | 46 | bool escaped; |
---|
| 47 | Vector endPoint; |
---|
[10667] | 48 | |
---|
[10725] | 49 | void setEndPoint( float x, float y, float z ){ endPoint = Vector(x, y, z); } |
---|
| 50 | |
---|
[10651] | 51 | void attackPlayer( ActionBox* box, float dt ); |
---|
| 52 | void moveTowardsBox( ActionBox* box, float dt ); |
---|
[10667] | 53 | void moveTowards( Vector targetPos, Vector targetDir, float dt ); |
---|
[10712] | 54 | |
---|
| 55 | WeaponManager weaponMan; //!< the weapon manager: managing a list of energy weapons to wepaon-slot mapping |
---|
[10651] | 56 | }; |
---|
| 57 | |
---|
| 58 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.