EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Sentry Class Reference

#include "Sentry.h"

Inheritance diagram for Sentry:
Collaboration diagram for Sentry:

Public Member Functions

virtual SentryGetSentrySE ()
 
virtual bool IsSentrySE ()
 
float GetThermal ()
 
float GetEM ()
 
float GetKinetic ()
 
float GetExplosive ()
 
SentryAIGetAIMgr ()
 
Sentry.cpp

Sentry class : Allan

Date
: 23 April 2017
 Sentry (InventoryItemRef self, PyServiceMgr &services, SystemManager *system, const FactionData &data)
 
virtual ~Sentry ()
 
virtual void Process ()
 
virtual void TargetLost (SystemEntity *who)
 
virtual void TargetedAdd (SystemEntity *who)
 
virtual void EncodeDestiny (Buffer &into)
 
virtual void Killed (Damage &fatal_blow)
 
void SaveSentry ()
 
void RemoveSentry ()
 
void SetResists ()
 
- Public Member Functions inherited from ObjectSystemEntity
 ObjectSystemEntity (InventoryItemRef self, PyServiceMgr &services, SystemManager *system)
 
virtual ~ObjectSystemEntity ()
 
virtual ObjectSystemEntityGetObjectSE ()
 
virtual bool IsInanimateSE ()
 
virtual bool IsObjectEntity ()
 
virtual void UpdateDamage ()
 
virtual void MakeDamageState (DoDestinyDamageState &into)
 
virtual PyDictMakeSlimItem ()
 
virtual bool IsInvul ()
 
void SetInvul (bool invul=false)
 
- Public Member Functions inherited from SystemEntity
 SystemEntity (InventoryItemRef self, PyServiceMgr &services, SystemManager *system)
 
virtual ~SystemEntity ()
 
virtual bool ProcessTic ()
 
virtual SystemEntityGetSE ()
 
virtual StaticSystemEntityGetStaticSE ()
 
virtual StationSEGetStationSE ()
 
virtual PlanetSEGetPlanetSE ()
 
virtual MoonSEGetMoonSE ()
 
virtual StargateSEGetGateSE ()
 
virtual BeltSEGetBeltSE ()
 
virtual ItemSystemEntityGetItemSE ()
 
virtual ContainerSEGetContSE ()
 
virtual WreckSEGetWreckSE ()
 
virtual AnomalySEGetAnomalySE ()
 
virtual WormholeSEGetWormholeSE ()
 
virtual FieldSEGetFieldSE ()
 
virtual ProbeSEGetProbeSE ()
 
virtual AsteroidSEGetAsteroidSE ()
 
virtual StructureSEGetPOSSE ()
 
virtual StructureSEGetJammerSE ()
 
virtual JumpBridgeSEGetJumpBridgeSE ()
 
virtual StructureSEGetOutpostSE ()
 
virtual TowerSEGetTowerSE ()
 
virtual ArraySEGetArraySE ()
 
virtual WeaponSEGetWeaponSE ()
 
virtual BatterySEGetBatterySE ()
 
virtual DeployableSEGetDeployableSE ()
 
virtual ModuleSEGetModuleSE ()
 
virtual ReactorSEGetReactorSE ()
 
virtual CustomsSEGetCOSE ()
 
virtual TCUSEGetTCUSE ()
 
virtual SBUSEGetSBUSE ()
 
virtual IHubSEGetIHubSE ()
 
virtual DynamicSystemEntityGetDynamicSE ()
 
virtual NPCGetNPCSE ()
 
virtual DroneSEGetDroneSE ()
 
virtual MissileGetMissileSE ()
 
virtual ShipSEGetShipSE ()
 
virtual ConcordGetConcordSE ()
 
virtual bool isGlobal ()
 
virtual bool IsSystemEntity ()
 
virtual bool IsStaticEntity ()
 
virtual bool IsBeltSE ()
 
virtual bool IsGateSE ()
 
virtual bool IsPlanetSE ()
 
virtual bool IsMoonSE ()
 
virtual bool IsStationSE ()
 
virtual bool IsItemEntity ()
 
virtual bool IsAnomalySE ()
 
virtual bool IsWormholeSE ()
 
virtual bool IsCelestialSE ()
 
virtual bool IsContainerSE ()
 
virtual bool IsFieldSE ()
 
virtual bool IsProbeSE ()
 
virtual bool IsPOSSE ()
 
virtual bool IsCOSE ()
 
virtual bool IsTCUSE ()
 
virtual bool IsSBUSE ()
 
virtual bool IsIHubSE ()
 
virtual bool IsTowerSE ()
 
virtual bool IsArraySE ()
 
virtual bool IsJammerSE ()
 
virtual bool IsWeaponSE ()
 
virtual bool IsBatterySE ()
 
virtual bool IsModuleSE ()
 
virtual bool IsMoonMiner ()
 
virtual bool IsOutpostSE ()
 
virtual bool IsAsteroidSE ()
 
virtual bool IsDeployableSE ()
 
virtual bool IsJumpBridgeSE ()
 
virtual bool IsReactorSE ()
 
virtual bool IsOperSE ()
 
virtual bool IsDynamicEntity ()
 
virtual bool IsLogin ()
 
virtual bool IsFrozen ()
 
virtual bool IsNPCSE ()
 
virtual bool IsDroneSE ()
 
virtual bool IsWreckSE ()
 
virtual bool IsMissileSE ()
 
virtual bool IsShipSE ()
 
virtual bool IsConcord ()
 
PyServiceMgrGetServices ()
 
SystemBubbleSysBubble ()
 
SystemManagerSystemMgr ()
 
TargetManagerTargetMgr ()
 
DestinyManagerDestinyMgr ()
 
InventoryItemRef GetSelf ()
 
uint16 GetTypeID ()
 
uint32 GetGroupID ()
 
uint8 GetCategoryID ()
 
EVEItemFlags GetFlag ()
 
uint32 GetID ()
 
double GetRadius ()
 
uint32 GetLocationID ()
 
const char * GetName () const
 
const GPointGetPosition () const
 
void SetPosition (const GPoint &pos)
 
double x ()
 
double y ()
 
double z ()
 
int32 GetAllianceID ()
 
int32 GetWarFactionID ()
 
uint32 GetCorporationID ()
 
uint32 GetOwnerID ()
 
uint32 GetFleetID ()
 
void SetFleetID (uint32 set)
 
int8 GetHarmonic ()
 
void SetHarmonic (int8 set)
 
void DropLoot (WreckContainerRef wreckRef, uint32 groupID, uint32 owner)
 
void AwardSecurityStatus (InventoryItemRef iRef, Character *pChar)
 
void SendDamageStateChanged ()
 
bool ApplyDamage (Damage &d)
 
double DistanceTo2 (const SystemEntity *other)
 
PyTupleMakeDamageState ()
 
virtual void Abandon ()
 
const bool IsDead ()
 
const GVectorGetVelocity ()
 
virtual void MissileLaunched (Missile *pMissile)
 
virtual bool LoadExtras ()
 
virtual void Delete ()
 
virtual void SetPilot (Client *pClient)
 
virtual bool HasPilot ()
 
virtual ClientGetPilot ()
 

Protected Attributes

SentryAIm_AI
 
- Protected Attributes inherited from SystemEntity
SystemBubblem_bubble
 
SystemManagerm_system
 
TargetManagerm_targMgr
 
DestinyManagerm_destiny
 
PyServiceMgrm_services
 
InventoryItemRef m_self
 
bool m_killed
 
double m_radius
 
int32 m_harmonic
 
int32 m_warID
 
int32 m_allyID
 
uint32 m_corpID
 
uint32 m_fleetID
 
uint32 m_ownerID
 

Private Attributes

float m_emDamage = 0
 
float m_expDamage = 0
 
float m_kinDamage = 0
 
float m_therDamage = 0
 
float m_hullDamage = 0
 
float m_armorDamage = 0
 
float m_shieldCharge = 0
 
float m_shieldCapacity = 0
 

Detailed Description

Definition at line 20 of file Sentry.h.

Constructor & Destructor Documentation

Sentry::Sentry ( InventoryItemRef  self,
PyServiceMgr services,
SystemManager system,
const FactionData data 
)

Definition at line 24 of file Sentry.cpp.

References FactionData::allianceID, AttrArmorDamage, AttrCapacitorCapacity, AttrCapacitorCharge, AttrCapacity, AttrDamage, AttrEmDamage, AttrExplosiveDamage, AttrInertia, AttrKineticDamage, AttrMass, AttrRadius, AttrShieldCapacity, AttrShieldCharge, AttrThermalDamage, AttrVolume, ItemType::capacity(), FactionData::corporationID, EvilOne, EvilZero, FactionData::factionID, EvilNumber::get_float(), InventoryItem::GetAttribute(), m_AI, SystemEntity::m_allyID, m_armorDamage, SystemEntity::m_corpID, m_emDamage, m_expDamage, m_hullDamage, m_kinDamage, SystemEntity::m_ownerID, SystemEntity::m_self, m_shieldCapacity, m_shieldCharge, m_therDamage, SystemEntity::m_warID, ItemType::mass(), FactionData::ownerID, ItemType::radius(), InventoryItem::SetAttribute(), SetResists(), InventoryItem::type(), and ItemType::volume().

25 : ObjectSystemEntity(self, services, system)
26 {
27  m_allyID = data.allianceID;
28  m_warID = data.factionID;
29  m_corpID = data.corporationID;
30  m_ownerID = data.ownerID;
31  m_AI = new SentryAI(this);
32 
33  // Create default dynamic attributes in the AttributeMap:
37  m_self->SetAttribute(AttrMass, m_self->type().mass(), false);
43 
44  SetResists();
45 
46  /* Gets the value from the Sentry and put on our own vars */
55 
56  // _log(Sentry__TRACE, "Created Sentry object for %s (%u)", m_self.get()->name(), m_self.get()->itemID());
57 }
float m_kinDamage
Definition: Sentry.h:59
float m_shieldCapacity
Definition: Sentry.h:64
uint32 m_ownerID
Definition: SystemEntity.h:283
float m_hullDamage
Definition: Sentry.h:61
float capacity() const
Definition: ItemType.h:71
EvilNumber EvilZero
Definition: EvilNumber.cpp:32
const ItemType & type() const
float m_shieldCharge
Definition: Sentry.h:63
InventoryItemRef m_self
Definition: SystemEntity.h:269
uint32 m_corpID
Definition: SystemEntity.h:281
float mass() const
Definition: ItemType.h:69
void SetResists()
Definition: Sentry.cpp:123
void SetAttribute(uint16 attrID, int num, bool notify=true)
float m_emDamage
Definition: Sentry.h:57
uint32 corporationID
EvilNumber GetAttribute(const uint16 attrID) const
float radius() const
Definition: ItemType.h:68
float volume() const
Definition: ItemType.h:70
EvilNumber EvilOne
Definition: EvilNumber.cpp:34
float get_float()
Definition: EvilNumber.cpp:184
float m_therDamage
Definition: Sentry.h:60
float m_armorDamage
Definition: Sentry.h:62
float m_expDamage
Definition: Sentry.h:58
ObjectSystemEntity(InventoryItemRef self, PyServiceMgr &services, SystemManager *system)
SentryAI * m_AI
Definition: Sentry.h:54

Here is the call graph for this function:

Sentry::~Sentry ( )
virtual

Definition at line 59 of file Sentry.cpp.

References m_AI, SystemEntity::m_destiny, and SafeDelete().

59  {
62 }
DestinyManager * m_destiny
Definition: SystemEntity.h:265
void SafeDelete(T *&p)
Deletes and nullifies a pointer.
Definition: SafeMem.h:83
SentryAI * m_AI
Definition: Sentry.h:54

Here is the call graph for this function:

Member Function Documentation

void Sentry::EncodeDestiny ( Buffer into)
virtual

Reimplemented from ObjectSystemEntity.

Definition at line 85 of file Sentry.cpp.

References _log, Destiny::MassSector::allianceID, Buffer::Append(), Destiny::MassSector::cloak, Destiny::MassSector::corporationID, Destiny::BallHeader::entityID, Destiny::BallHeader::flags, Destiny::STOP_Struct::formationID, SystemEntity::GetID(), SystemEntity::GetName(), SystemEntity::GetRadius(), Destiny::MassSector::harmonic, IsAlliance, Destiny::Ball::Flag::IsMassive, SystemEntity::m_allyID, SystemEntity::m_corpID, SystemEntity::m_harmonic, SystemEntity::m_self, main(), ItemType::mass(), Destiny::MassSector::mass, Destiny::BallHeader::mode, Destiny::BallHeader::posX, Destiny::BallHeader::posY, Destiny::BallHeader::posZ, Destiny::BallHeader::radius, Destiny::Ball::Mode::STOP, InventoryItem::type(), SystemEntity::x(), SystemEntity::y(), and SystemEntity::z().

86 {
87  using namespace Destiny;
88 
89  BallHeader head = BallHeader();
90  head.entityID = GetID();
91  head.mode = Ball::Mode::STOP;
92  head.radius = GetRadius();
93  head.posX = x();
94  head.posY = y();
95  head.posZ = z();
97  into.Append( head );
98  MassSector mass = MassSector();
99  mass.mass = m_self->type().mass();
100  mass.cloak = 0;
101  mass.harmonic = m_harmonic;
102  mass.corporationID = m_corpID;
103  mass.allianceID = (IsAlliance(m_allyID) ? m_allyID : -1);
104  into.Append( mass );
106  main.formationID = 0xFF;
107  into.Append( main );
108 
109  _log(SE__DESTINY, "Sentry::EncodeDestiny: %s - id:%li, mode:%u, flags:0x%X", GetName(), head.entityID, head.mode, head.flags);
110 }
void Append(const T &value)
Appends a single value to buffer.
Definition: Buffer.h:437
#define _log(type, fmt,...)
Definition: logsys.h:124
double GetRadius()
Definition: SystemEntity.h:208
double y()
Definition: SystemEntity.h:214
int32 m_harmonic
Definition: SystemEntity.h:276
const ItemType & type() const
InventoryItemRef m_self
Definition: SystemEntity.h:269
uint32 m_corpID
Definition: SystemEntity.h:281
float mass() const
Definition: ItemType.h:69
double z()
Definition: SystemEntity.h:215
uint32 GetID()
Definition: SystemEntity.h:207
const char * GetName() const
Definition: SystemEntity.h:210
double x()
Definition: SystemEntity.h:213
int main(int argc, char *argv[])
#define IsAlliance(itemID)
Definition: EVE_Defines.h:244

Here is the call graph for this function:

SentryAI* Sentry::GetAIMgr ( )
inline

Definition at line 51 of file Sentry.h.

References m_AI.

51 { return m_AI; }
SentryAI * m_AI
Definition: Sentry.h:54
float Sentry::GetEM ( )
inline

Definition at line 47 of file Sentry.h.

References m_emDamage.

Referenced by SentryAI::AttackTarget().

47 { return m_emDamage; }
float m_emDamage
Definition: Sentry.h:57

Here is the caller graph for this function:

float Sentry::GetExplosive ( )
inline

Definition at line 49 of file Sentry.h.

References m_expDamage.

Referenced by SentryAI::AttackTarget().

49 { return m_expDamage; }
float m_expDamage
Definition: Sentry.h:58

Here is the caller graph for this function:

float Sentry::GetKinetic ( )
inline

Definition at line 48 of file Sentry.h.

References m_kinDamage.

Referenced by SentryAI::AttackTarget().

48 { return m_kinDamage; }
float m_kinDamage
Definition: Sentry.h:59

Here is the caller graph for this function:

virtual Sentry* Sentry::GetSentrySE ( )
inlinevirtual

Reimplemented from SystemEntity.

Definition at line 28 of file Sentry.h.

28 { return this; }
float Sentry::GetThermal ( )
inline

Definition at line 46 of file Sentry.h.

References m_therDamage.

Referenced by SentryAI::AttackTarget().

46 { return m_therDamage; }
float m_therDamage
Definition: Sentry.h:60

Here is the caller graph for this function:

virtual bool Sentry::IsSentrySE ( )
inlinevirtual

Reimplemented from SystemEntity.

Definition at line 30 of file Sentry.h.

30 { return true; }
void Sentry::Killed ( Damage fatal_blow)
virtual

Reimplemented from ObjectSystemEntity.

Definition at line 139 of file Sentry.cpp.

References _log, MapDB::AddFactionKill(), MapDB::AddKill(), DBSystemDynamicEntity::allianceID, SystemEntity::AwardSecurityStatus(), SystemManager::BuildDynamicEntity(), DBSystemDynamicEntity::categoryID, EVEDB::invCategories::Celestial, DBSystemDynamicEntity::corporationID, SystemEntity::DropLoot(), DBSystemDynamicEntity::factionID, flagNone, RefPtr< X >::get(), SystemEntity::GetAllianceID(), Client::GetChar(), Client::GetCharacterID(), SystemEntity::GetCorporationID(), SystemEntity::GetID(), SystemEntity::GetLocationID(), SystemEntity::GetName(), SystemEntity::GetPilot(), DestinyManager::GetPosition(), SystemEntity::GetSelf(), SystemManager::GetSystemSecurityRating(), InventoryItem::groupID(), DBSystemDynamicEntity::groupID, SystemEntity::HasPilot(), is_log_enabled, SystemEntity::IsDroneSE(), Ga::GaVec3::isNaN(), IsWreckTypeID, InventoryItem::itemID(), DBSystemDynamicEntity::itemID, InventoryItem::itemName(), DBSystemDynamicEntity::itemName, itoa(), SystemEntity::m_allyID, SystemEntity::m_bubble, SystemEntity::m_destiny, SystemEntity::m_self, SystemEntity::m_system, SystemEntity::m_warID, MakeRandomFloat(), InventoryItem::name(), InventoryItem::ownerID(), DBSystemDynamicEntity::ownerID, DBSystemDynamicEntity::position, sConfig, sDataMgr, DestinyManager::SendJettisonPacket(), sEntityList, sItemFactory, sLog, Damage::srcSE, InventoryItem::typeID(), DBSystemDynamicEntity::typeID, EVEDB::invGroups::Wreck, Ga::GaVec3::x, SystemEntity::x(), Ga::GaVec3::y, SystemEntity::y(), Ga::GaVec3::z, and SystemEntity::z().

139  {
140  if ((m_bubble == nullptr) or (m_destiny == nullptr) or (m_system == nullptr))
141  return; // make error here?
142 
143  uint32 killerID = 0;
144  Client* pClient(nullptr);
145  SystemEntity* killer = fatal_blow.srcSE;
146 
147  if (killer->HasPilot()) {
148  pClient = killer->GetPilot();
149  killerID = pClient->GetCharacterID();
150  } else if (killer->IsDroneSE()) {
151  pClient = sEntityList.FindClientByCharID( killer->GetSelf()->ownerID() );
152  if (pClient == nullptr) {
153  sLog.Error("Sentry::Killed()", "killer == IsDrone and pPlayer == nullptr");
154  } else {
155  killerID = pClient->GetCharacterID();
156  }
157  } else {
158  killerID = killer->GetID();
159  }
160 
161  uint32 locationID = GetLocationID();
162  // log faction kill in dynamic data -allan
163  MapDB::AddKill(locationID);
164  MapDB::AddFactionKill(locationID);
165  if (pClient != nullptr) {
166  //award kill bounty.
167  //AwardBounty( pClient );
169  AwardSecurityStatus(m_self, pClient->GetChar().get()); // this awards secStatusChange for npcs in empire space
170  }
171 
172  GPoint wreckPosition = m_destiny->GetPosition();
173  if (wreckPosition.isNaN()) {
174  sLog.Error("Sentry::Killed()", "Wreck Position is NaN");
175  return;
176  }
177  uint32 wreckTypeID = sDataMgr.GetWreckID(m_self->typeID());
178  if (!IsWreckTypeID(wreckTypeID)) {
179  sLog.Error("Sentry::Killed()", "Could not get wreckType for %s of type %u", m_self->name(), m_self->typeID());
180  // default to generic frigate wreck till i get better checks and/or complete wreck data
181  wreckTypeID = 26557;
182  }
183 
184  std::string wreck_name = m_self->itemName();
185  wreck_name += " Wreck";
186  ItemData wreckItemData(wreckTypeID, killerID, locationID, flagNone, wreck_name.c_str(), wreckPosition, itoa(m_allyID));
187  WreckContainerRef wreckItemRef = sItemFactory.SpawnWreckContainer( wreckItemData );
188  if (wreckItemRef.get() == nullptr) {
189  sLog.Error("Sentry::Killed()", "Creating Wreck Item Failed for %s of type %u", wreck_name.c_str(), wreckTypeID);
190  return;
191  }
192 
193  if (is_log_enabled(PHYSICS__TRACE))
194  _log(PHYSICS__TRACE, "Sentry::Killed() - Sentry %s(%u) Position: %.2f,%.2f,%.2f. Wreck %s(%u) Position: %.2f,%.2f,%.2f.", \
195  GetName(), GetID(), x(), y(), z(), wreckItemRef->name(), wreckItemRef->itemID(), wreckPosition.x, wreckPosition.y, wreckPosition.z);
196 
198  wreckEntity.allianceID = killer->GetAllianceID();
200  wreckEntity.corporationID = killer->GetCorporationID();
201  wreckEntity.factionID = m_warID;
202  wreckEntity.groupID = EVEDB::invGroups::Wreck;
203  wreckEntity.itemID = wreckItemRef->itemID();
204  wreckEntity.itemName = wreck_name;
205  wreckEntity.ownerID = killerID;
206  wreckEntity.typeID = wreckTypeID;
207  wreckEntity.position = wreckPosition;
208 
209  if (!m_system->BuildDynamicEntity(wreckEntity, m_self->itemID())) {
210  sLog.Error("Sentry::Killed()", "Spawning Wreck Failed: typeID or typeName not supported: '%u'", wreckTypeID);
211  wreckItemRef->Delete();
212  return;
213  }
215 
216  if (MakeRandomFloat() < sConfig.npc.LootDropChance)
217  DropLoot(wreckItemRef, m_self->groupID(), killerID);
218 }
#define sConfig
A macro for easier access to the singleton.
#define _log(type, fmt,...)
Definition: logsys.h:124
#define IsWreckTypeID(typeID)
Definition: EVE_Defines.h:203
DestinyManager * m_destiny
Definition: SystemEntity.h:265
uint32 ownerID() const
Definition: InventoryItem.h:99
void SendJettisonPacket() const
double MakeRandomFloat(double low, double high)
Generates random real from interval [low; high].
Definition: misc.cpp:114
double y()
Definition: SystemEntity.h:214
virtual bool HasPilot()
Definition: SystemEntity.h:258
GaExpInl bool isNaN() const
Definition: GaTypes.h:194
static void AddKill(uint32 sysID)
Definition: MapDB.cpp:250
virtual Client * GetPilot()
Definition: SystemEntity.h:259
SystemBubble * m_bubble
Definition: SystemEntity.h:262
int32 GetCharacterID() const
Definition: Client.h:113
static void AddFactionKill(uint32 sysID)
Definition: MapDB.cpp:256
SystemEntity * srcSE
Definition: Damage.h:84
#define sEntityList
Definition: EntityList.h:208
const float GetSystemSecurityRating()
Definition: SystemManager.h:86
const char * name()
GaFloat x
Definition: GaTypes.h:207
bool BuildDynamicEntity(const DBSystemDynamicEntity &entity, uint32 launcherID=0)
uint16 groupID() const
#define is_log_enabled(type)
Definition: logsys.h:78
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
Definition: gpoint.h:33
InventoryItemRef m_self
Definition: SystemEntity.h:269
InventoryItemRef GetSelf()
Definition: SystemEntity.h:202
uint32 GetLocationID()
Definition: SystemEntity.h:209
SystemManager * m_system
Definition: SystemEntity.h:263
double z()
Definition: SystemEntity.h:215
int32 GetAllianceID()
Definition: SystemEntity.h:216
uint32 GetID()
Definition: SystemEntity.h:207
const char * GetName() const
Definition: SystemEntity.h:210
double x()
Definition: SystemEntity.h:213
Definition: Client.h:66
unsigned __int32 uint32
Definition: eve-compat.h:50
GaFloat y
Definition: GaTypes.h:207
uint32 GetCorporationID()
Definition: SystemEntity.h:218
const std::string & itemName() const
void DropLoot(WreckContainerRef wreckRef, uint32 groupID, uint32 owner)
void AwardSecurityStatus(InventoryItemRef iRef, Character *pChar)
const GPoint & GetPosition() const
#define sItemFactory
Definition: ItemFactory.h:165
virtual bool IsDroneSE()
Definition: SystemEntity.h:187
uint16 typeID() const
GaFloat z
Definition: GaTypes.h:207
const char * itoa(int64 num)
Convers num to string.
uint32 itemID() const
Definition: InventoryItem.h:98
#define sDataMgr

Here is the call graph for this function:

void Sentry::Process ( )
virtual

Reimplemented from SystemEntity.

Definition at line 64 of file Sentry.cpp.

References GetTimeUSeconds(), m_AI, SystemEntity::m_killed, Profile::npc, SentryAI::Process(), SystemEntity::Process(), sConfig, and sProfiler.

64  {
65  if (m_killed)
66  return;
67  double profileStartTime = GetTimeUSeconds();
68 
69  /* Enable base call to Process Targeting and Movement */
71  m_AI->Process();
72 
73  if (sConfig.debug.UseProfiling)
74  sProfiler.AddTime(Profile::npc, GetTimeUSeconds() - profileStartTime);
75 }
#define sConfig
A macro for easier access to the singleton.
virtual void Process()
#define sProfiler
Definition: dbcore.cpp:39
double GetTimeUSeconds()
Definition: utils_time.cpp:116
void Process()
Definition: SentryAI.cpp:83
SentryAI * m_AI
Definition: Sentry.h:54

Here is the call graph for this function:

void Sentry::RemoveSentry ( )

Definition at line 117 of file Sentry.cpp.

References InventoryItem::Delete(), and SystemEntity::m_self.

118 {
119  //this is called from SystemManager::RemoveSentry() which calls other SE* methods as needed
120  m_self->Delete();
121 }
InventoryItemRef m_self
Definition: SystemEntity.h:269
virtual void Delete()

Here is the call graph for this function:

void Sentry::SaveSentry ( )

Definition at line 112 of file Sentry.cpp.

References SystemEntity::m_self, and InventoryItem::SaveItem().

113 {
114  m_self->SaveItem();
115 }
InventoryItemRef m_self
Definition: SystemEntity.h:269

Here is the call graph for this function:

void Sentry::SetResists ( )

Definition at line 123 of file Sentry.cpp.

References AttrArmorEmDamageResonance, AttrArmorExplosiveDamageResonance, AttrArmorKineticDamageResonance, AttrArmorThermalDamageResonance, AttrEmDamageResonance, AttrExplosiveDamageResonance, AttrKineticDamageResonance, AttrShieldEmDamageResonance, AttrShieldExplosiveDamageResonance, AttrShieldKineticDamageResonance, AttrShieldThermalDamageResonance, AttrThermalDamageResonance, EvilOne, InventoryItem::HasAttribute(), SystemEntity::m_self, and InventoryItem::SetAttribute().

Referenced by Sentry().

123  {
124  /* fix for missing resist attribs -allan 18April16 */
137 }
bool HasAttribute(const uint16 attrID) const
InventoryItemRef m_self
Definition: SystemEntity.h:269
void SetAttribute(uint16 attrID, int num, bool notify=true)
EvilNumber EvilOne
Definition: EvilNumber.cpp:34

Here is the call graph for this function:

Here is the caller graph for this function:

void Sentry::TargetedAdd ( SystemEntity who)
virtual

Definition at line 81 of file Sentry.cpp.

References m_AI, and SentryAI::Targeted().

81  {
82  m_AI->Targeted(who);
83 }
void Targeted(SystemEntity *by_who)
Definition: SentryAI.cpp:229
SentryAI * m_AI
Definition: Sentry.h:54

Here is the call graph for this function:

void Sentry::TargetLost ( SystemEntity who)
virtual

Definition at line 77 of file Sentry.cpp.

References m_AI, and SentryAI::TargetLost().

77  {
78  m_AI->TargetLost(who);
79 }
void TargetLost(SystemEntity *by_who)
Definition: SentryAI.cpp:258
SentryAI * m_AI
Definition: Sentry.h:54

Here is the call graph for this function:

Member Data Documentation

SentryAI* Sentry::m_AI
protected

Definition at line 54 of file Sentry.h.

Referenced by GetAIMgr(), Process(), Sentry(), TargetedAdd(), TargetLost(), and ~Sentry().

float Sentry::m_armorDamage = 0
private

Definition at line 62 of file Sentry.h.

Referenced by Sentry().

float Sentry::m_emDamage = 0
private

Definition at line 57 of file Sentry.h.

Referenced by GetEM(), and Sentry().

float Sentry::m_expDamage = 0
private

Definition at line 58 of file Sentry.h.

Referenced by GetExplosive(), and Sentry().

float Sentry::m_hullDamage = 0
private

Definition at line 61 of file Sentry.h.

Referenced by Sentry().

float Sentry::m_kinDamage = 0
private

Definition at line 59 of file Sentry.h.

Referenced by GetKinetic(), and Sentry().

float Sentry::m_shieldCapacity = 0
private

Definition at line 64 of file Sentry.h.

Referenced by Sentry().

float Sentry::m_shieldCharge = 0
private

Definition at line 63 of file Sentry.h.

Referenced by Sentry().

float Sentry::m_therDamage = 0
private

Definition at line 60 of file Sentry.h.

Referenced by GetThermal(), and Sentry().


The documentation for this class was generated from the following files: