EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
DroneAI.h
Go to the documentation of this file.
1 
10 #ifndef __EVEMU_SHIP_DRONEAI_H__
11 #define __EVEMU_SHIP_DRONEAI_H__
12 
14 
15 // only for drones
16 namespace DroneAI {
17  namespace State {
18  enum {
19  Invalid = -1,
20  // defined in client
21  Idle = 0, // not doing anything....idle.
22  Combat = 1, // fighting - needs targetID
23  Mining = 2, // unsure - needs targetID
24  Approaching = 3, // too close to chase, but to far to engage
25  Departing = 4, // return to ship
26  Departing2 = 5, // leaving. different from Departing
27  Pursuit = 6, // target out of range to attack/follow, but within npc sight range....use mwd/ab if equiped
28  Fleeing = 7, // running away
29  Operating = 9, // whats diff from engaged here?
30  Engaged = 10, // non-combat? - needs targetID
31  // internal only
32  Unknown = 8, // as stated
33  Guarding = 11,
34  Assisting = 12,
35  Incapacitated = 13 //
36  };
37  }
38 }
39 
40 class DroneSE;
41 class SystemEntity;
42 class Timer;
43 class EvilNumber;
44 
45 class DroneAIMgr {
46 public:
47  DroneAIMgr(DroneSE *who);
48 
49  void Process();
50 
51  void Target(SystemEntity *by_who);
52  void Targeted(SystemEntity *by_who);
53  void TargetLost(SystemEntity *by_who);
54 
55  void ClearTargets();
56  void ClearAllTargets();
57 
58  int8 GetState();
59 
60  void SetIdle();
61  void Return();
62  void AssignShip(ShipSE* pSE) { m_assignedShip = pSE; }
63 
64 protected:
65  void Attack(SystemEntity* pTarget);
66  void SetEngaged(SystemEntity* pTarget);
67  void ClearTarget(SystemEntity* pTarget);
68  void AttackTarget(SystemEntity* pTarget);
69  void CheckDistance(SystemEntity* pTarget);
70 
72  std::string GetStateName(int8 stateID);
73 
74 private:
75  //cached to reduce access times. (faster but uses more memory)
76  double m_sigRadius;
77  double m_attackSpeed;
82 
88 
91 
93 
99 };
100 
101 #endif // __EVEMU_SHIP_DRONEAI_H__
void ClearAllTargets()
Definition: DroneAI.cpp:206
uint32 m_chaseSpeed
Definition: DroneAI.h:83
void AssignShip(ShipSE *pSE)
Definition: DroneAI.h:62
Timer m_mainAttackTimer
Definition: DroneAI.h:95
void CheckDistance(SystemEntity *pTarget)
Definition: DroneAI.cpp:174
std::string GetStateName(int8 stateID)
Definition: DroneAI.cpp:363
double m_entityOrbitRange
Definition: DroneAI.h:79
double m_entityFlyRange
Definition: DroneAI.h:78
double m_attackSpeed
Definition: DroneAI.h:77
TurretFormulas m_formula
Definition: DroneAI.h:92
int8 m_state
Definition: DroneAI.h:71
void AttackTarget(SystemEntity *pTarget)
Definition: DroneAI.cpp:330
DroneSE * m_pDrone
Definition: DroneAI.h:89
Timer m_warpScramblerTimer
Definition: DroneAI.h:97
int8 GetState()
Definition: DroneAI.cpp:121
Timer m_beginFindTarget
Definition: DroneAI.h:96
double m_entityChaseRange
Definition: DroneAI.h:80
this is a class that kinda mimics how python polymorph's numbers.
Definition: EvilNumber.h:59
void SetEngaged(SystemEntity *pTarget)
Definition: DroneAI.cpp:160
Definition: Ship.h:301
signed __int8 int8
Definition: eve-compat.h:45
uint32 m_armorRepairDuration
Definition: DroneAI.h:86
uint32 m_cruiseSpeed
Definition: DroneAI.h:84
void SetIdle()
Definition: DroneAI.cpp:142
Timer m_processTimer
Definition: DroneAI.h:94
ShipSE * m_assignedShip
Definition: DroneAI.h:90
void Targeted(SystemEntity *by_who)
Definition: DroneAI.cpp:231
Definition: Drone.h:46
void ClearTarget(SystemEntity *pTarget)
Definition: DroneAI.cpp:318
void Attack(SystemEntity *pTarget)
Definition: DroneAI.cpp:285
unsigned __int32 uint32
Definition: eve-compat.h:50
double m_sigRadius
Definition: DroneAI.h:76
uint32 m_targetRange
Definition: DroneAI.h:85
void TargetLost(SystemEntity *by_who)
Definition: DroneAI.cpp:266
double m_entityAttackRange
Definition: DroneAI.h:81
Timer m_webifierTimer
Definition: DroneAI.h:98
uint32 m_shieldBoosterDuration
Definition: DroneAI.h:87
Definition: timer.h:30
void ClearTargets()
Definition: DroneAI.cpp:202
void Target(SystemEntity *by_who)
Definition: DroneAI.cpp:211
void Process()
Definition: DroneAI.cpp:48
void Return()
Definition: DroneAI.cpp:135
DroneAIMgr(DroneSE *who)
Definition: DroneAI.cpp:20