EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
NPC.h
Go to the documentation of this file.
1 /*
2  ------------------------------------------------------------------------------------
3  LICENSE:
4  ------------------------------------------------------------------------------------
5  This file is part of EVEmu: EVE Online Server Emulator
6  Copyright 2006 - 2021 The EVEmu Team
7  For the latest information visit https://evemu.dev
8  ------------------------------------------------------------------------------------
9  This program is free software; you can redistribute it and/or modify it under
10  the terms of the GNU Lesser General Public License as published by the Free Software
11  Foundation; either version 2 of the License, or (at your option) any later
12  version.
13 
14  This program is distributed in the hope that it will be useful, but WITHOUT
15  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public License along with
19  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
20  Place - Suite 330, Boston, MA 02111-1307, USA, or go to
21  http://www.gnu.org/copyleft/lesser.txt.
22  ------------------------------------------------------------------------------------
23  Author: Zhur
24  Updates: Allan
25 */
26 
27 
28 #ifndef __NPC_H_INCL__
29 #define __NPC_H_INCL__
30 
32 #include "system/SystemEntity.h"
33 
34 class PyServiceMgr;
35 class DestinyManager;
36 class InventoryItem;
37 class Missile;
38 class NPCAIMgr;
39 class SystemManager;
40 
41 class NPC
42 : public DynamicSystemEntity
43 {
44 public:
45  NPC(InventoryItemRef self, PyServiceMgr& services, SystemManager* system, const FactionData& data, SpawnMgr* spawnMgr = nullptr);
46  virtual ~NPC();
47 
48  /* class type pointer querys. */
49  virtual NPC* GetNPCSE() { return this; }
50  /* class type tests. */
51  virtual bool IsNPCSE() { return true; }
52 
53  /* SystemEntity interface */
54  virtual void Process();
55  virtual void TargetLost(SystemEntity* who);
56  virtual void TargetedAdd(SystemEntity* who);
57  virtual void EncodeDestiny(Buffer& into);
58 
59  /* virtual functions default to base class and overridden as needed */
60  virtual void Killed(Damage &fatal_blow);
61  virtual bool Load(); // sets orbit range and initalizes the AIMgr
62 
63  /* virtual functions to be overridden in derived classes */
64  virtual void MissileLaunched(Missile* pMissile); // tells AI a missle has been launched at us. allows defender missile code
65 
66  /* specific functions handled here. */
67  void SaveNPC();
68  void RemoveNPC();
69  void SetResists();
70  void UseHullRepairer();
71  void UseArmorRepairer();
72  void UseShieldRecharge();
73  void Orbit(SystemEntity* who);
74  void ForceSetSpawner(SpawnMgr* spawnMgr) { m_spawnMgr = spawnMgr; }
75 
76  float GetThermal() { return m_therDamage; }
77  float GetEM() { return m_emDamage; }
78  float GetKinetic() { return m_kinDamage; }
79  float GetExplosive() { return m_expDamage; }
80 
81  NPCAIMgr* GetAIMgr() { return m_AI; }
83 
84  /* for command dropLoot - commands all npcs in bubble to jettison loot */
85  void CmdDropLoot();
86 
87 protected:
90 
91 private:
93 
94  float m_emDamage;
95  float m_expDamage;
96  float m_kinDamage;
97  float m_therDamage;
98  float m_hullDamage;
102 };
103 
104 #endif
float m_armorDamage
Definition: NPC.h:99
virtual void EncodeDestiny(Buffer &into)
Definition: NPC.cpp:127
virtual bool IsNPCSE()
Definition: NPC.h:51
virtual void Process()
Definition: NPC.cpp:96
float m_hullDamage
Definition: NPC.h:98
virtual ~NPC()
Definition: NPC.cpp:82
void UseShieldRecharge()
Definition: NPC.cpp:222
virtual bool Load()
Definition: NPC.cpp:86
virtual void TargetLost(SystemEntity *who)
Definition: NPC.cpp:119
void Orbit(SystemEntity *who)
Definition: NPC.cpp:111
SpawnMgr * m_spawnMgr
Definition: NPC.h:89
virtual void MissileLaunched(Missile *pMissile)
Definition: NPC.cpp:269
float m_shieldCapacity
Definition: NPC.h:101
NPCAIMgr * m_AI
Definition: NPC.h:88
NPCAIMgr * GetAIMgr()
Definition: NPC.h:81
Generic class for buffers.
Definition: Buffer.h:40
SpawnMgr * GetSpawnMgr()
Definition: NPC.h:82
void RemoveNPC()
Definition: NPC.cpp:279
NPC(InventoryItemRef self, PyServiceMgr &services, SystemManager *system, const FactionData &data, SpawnMgr *spawnMgr=nullptr)
Definition: NPC.cpp:45
void SaveNPC()
Definition: NPC.cpp:274
Definition: Damage.h:33
float m_emDamage
Definition: NPC.h:94
float m_shieldCharge
Definition: NPC.h:100
float m_expDamage
Definition: NPC.h:95
void UseHullRepairer()
Definition: NPC.cpp:253
void CmdDropLoot()
Definition: NPC.cpp:391
Definition: NPC.h:41
float GetThermal()
Definition: NPC.h:76
float GetExplosive()
Definition: NPC.h:79
unsigned __int32 uint32
Definition: eve-compat.h:50
void ForceSetSpawner(SpawnMgr *spawnMgr)
Definition: NPC.h:74
void SetResists()
Definition: NPC.cpp:285
virtual NPC * GetNPCSE()
Definition: NPC.h:49
virtual void TargetedAdd(SystemEntity *who)
Definition: NPC.cpp:123
void UseArmorRepairer()
Definition: NPC.cpp:238
Definition: NPCAI.h:54
virtual void Killed(Damage &fatal_blow)
Definition: NPC.cpp:304
float GetEM()
Definition: NPC.h:77
float m_therDamage
Definition: NPC.h:97
float GetKinetic()
Definition: NPC.h:78
float m_kinDamage
Definition: NPC.h:96
uint32 m_orbitingID
Definition: NPC.h:92