-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathnpc_enemy.h
86 lines (77 loc) · 1.9 KB
/
npc_enemy.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
/////////////////////////////////////////////////////////////////////
///////////////Original file by:Fyodor Zagumennov aka Sgw32//////////
///////////////Copyright(c) 2010 Fyodor Zagumennov //////////
/////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////
///////////////Run3 rules!!! It's a best game engine!/////////////////
/////////////////////////////////////////////////////////////////////
#pragma once
#include <Ogre.h>
#include <OgreNewt.h>
#include "global.h"
//AIR3 Headers
#include "AIR3.h"
#include "NPCSpawnProps.h"
#include "AIManager.h"
#include "BloodEmitter.h"
#include "Run3SoundRuntime.h"
#include "ExplosionManager.h"
#include "GibManager.h"
#include "Timeshift.h"
#include "npc_template.h"
using namespace Ogre;
using namespace std;
#ifndef __NPC_ENEMY_RUN3_H__
#define __NPC_ENEMY_RUN3_H__
#define __NPC_ENEMY_VELOCITY__ 5
/*namespace Ogre
{
class Node
{
public:
};
}*/
class npc_enemy : public npc_template
{
public:
npc_enemy();
~npc_enemy();
// init NPC
void init(NPCSpawnProps props);
// starts movement and activity
void setPlayerPosition(Vector3 pos);
bool check_straight();
bool check_straight(Vector3 n1,Vector3 n2);
// movement process here
void step(const Ogre::FrameEvent &evt);
// event callback
void processEvent(int flag,String param1,String param2);
// OgreNewt callback
void npc_force_callback( OgreNewt::Body* me);
// used in npc_physfollow
void addPoint(NPCNode* a);
// is NPC is killed
void kill();
//HEADSHOT!!!
void headshot();
// feedback from NPCManager
bool frameStarted(const Ogre::FrameEvent &evt);
//
void spawnNPC();
private:
Real mTime,mRealTime,mVel;
int i,iter;
Vector3 destCMD;
Real yShift;
Real stopDist;
Real health;
Real body_rot_y;
Real rangle;
Vector3 axis;
Real lastAngle;
Vector3 steps;
Vector3 physPos;
Vector3 physSize;
Real farFind;
};
#endif