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

#include "NPCAI.h"

Collaboration diagram for NPCAIMgr:

Public Member Functions

 NPCAIMgr (NPC *who)
 
 ~NPCAIMgr ()
 
void Process ()
 
void Target (SystemEntity *pSE)
 
void Targeted (SystemEntity *pSE)
 
void TargetLost (SystemEntity *pSE)
 
void DisableRepTimers (bool shield=true, bool armor=true)
 
bool IsIdle ()
 
bool IsFighting ()
 
uint16 GetOptimalRange ()
 
uint16 GetSigRes ()
 
uint32 GetFalloff ()
 
uint32 GetAttackRange ()
 
double GetTrackingSpeed ()
 
void DisableWarpOutTimer ()
 
void WarpOutComplete ()
 
void LaunchMissile (uint16 typeID, SystemEntity *pSE)
 
void MissileLaunched (Missile *pMissile)
 

Protected Member Functions

void Attack (SystemEntity *pSE)
 
void SetIdle ()
 
void WarpOut ()
 
void SetWander ()
 
void SetChasing (SystemEntity *pSE)
 
void SetEngaged (SystemEntity *pSE)
 
void SetFleeing (SystemEntity *pSE)
 
void ClearTarget (SystemEntity *pSE)
 
void SetFollowing (SystemEntity *pSE)
 
void SetSignaling (SystemEntity *pSE)
 
void AttackTarget (SystemEntity *pSE)
 
void CheckDistance (SystemEntity *pSE)
 
float GetTargetTime ()
 
std::string GetStateName (int8 stateID)
 

Protected Attributes

int8 m_state
 

Private Attributes

bool m_webber:1
 
bool m_warpScram:1
 
bool m_isWandering:1
 
bool m_useSigRadius:1
 
bool m_useTargSwitching:1
 
bool m_useSecondTarget:1
 
float m_switchTargChance
 
uint16 m_preferedSigRadius
 
uint8 m_maxAttackTargets
 
uint8 m_maxLockedTargets
 
uint16 m_maxSpeed
 
uint16 m_attackSpeed
 
uint16 m_missileTypeID
 
uint16 m_launcherCycleTime
 
uint16 m_sigResolution
 
uint16 m_orbitSpeed
 
uint16 m_targetRange
 
uint16 m_optimalRange
 
uint16 m_boostRange
 
uint16 m_armorRepairDuration
 
uint16 m_shieldBoosterDuration
 
uint32 m_sigRadius
 
uint32 m_falloff
 
uint32 m_flyRange
 
uint32 m_sightRange
 
uint32 m_maxAttackRange
 
uint32 m_warpScramRange
 
float m_warpScramChance
 
float m_armorRepairDelayChance
 
float m_shieldBoosterDelayChance
 
double m_trackingSpeed
 
double m_damageMultiplier
 
NPCm_npc
 
DestinyManagerm_destiny
 
InventoryItemRef m_self
 
TurretFormulas m_formula
 
Timer m_processTimer
 
Timer m_mainAttackTimer
 
Timer m_missileTimer
 
Timer m_shieldBoosterTimer
 
Timer m_armorRepairTimer
 
Timer m_beginFindTarget
 
Timer m_warpOutTimer
 
Timer m_warpScramblerTimer
 
Timer m_webifierTimer
 

Detailed Description

Definition at line 54 of file NPCAI.h.

Constructor & Destructor Documentation

NPCAIMgr::NPCAIMgr ( NPC who)
Todo:
ai update ideas bubble call SomeFunction to tell ai of new ship arriving in bubble method to use npc's preferred sig radius for targets finish flee and signal action methods (and determine who can use them and when)
  • this should take system sov, npc anomalies, destruction speed, and pirate faction add methods to check target/targeter warping out and chance of npc following (and possibly calling backup)

have data...needs coding... chase duration/distance timers ewar shit, including point/tackle

Todo:
all of these need to be verified and/or updated
Todo:
change these next 2 (rep and boost) to boolean to avoid timer creation/checks

Definition at line 51 of file NPCAI.cpp.

References AttrAI_ChanceToNotTargetSwitch, AttrAI_PreferredSignatureRadius, AttrAI_ShouldUseSecondaryTarget, AttrAI_ShouldUseSignatureRadius, AttrAI_ShouldUseTargetSwitching, AttrDamageMultiplier, AttrEntityArmorRepairDelayChance, AttrEntityArmorRepairDelayChanceLarge, AttrEntityArmorRepairDelayChanceMedium, AttrEntityArmorRepairDelayChanceSmall, AttrEntityArmorRepairDuration, AttrEntityAttackRange, AttrEntityChaseMaxDistance, AttrEntityCruiseSpeed, AttrEntityFlyRange, AttrEntityMissileTypeID, AttrEntityShieldBoostDelayChance, AttrEntityShieldBoostDelayChanceLarge, AttrEntityShieldBoostDelayChanceMedium, AttrEntityShieldBoostDelayChanceSmall, AttrEntityShieldBoostDuration, AttrEntityWarpScrambleChance, AttrFalloff, AttrMaxAttackTargets, AttrMaxLockedTargets, AttrMaxRange, AttrMaxVelocity, AttrMissileLaunchDuration, AttrOptimalSigRadius, AttrRadius, AttrSignatureRadius, AttrSpeed, AttrTrackingSpeed, AttrWarpScrambleRange, RefPtr< X >::get(), EvilNumber::get_double(), EvilNumber::get_float(), EvilNumber::get_uint32(), InventoryItem::GetAttribute(), InventoryItem::HasAttribute(), m_armorRepairDelayChance, m_armorRepairDuration, m_attackSpeed, m_boostRange, m_damageMultiplier, m_falloff, m_flyRange, m_isWandering, m_launcherCycleTime, m_maxAttackRange, m_maxAttackTargets, m_maxLockedTargets, m_maxSpeed, m_missileTypeID, m_optimalRange, m_orbitSpeed, m_preferedSigRadius, m_self, m_shieldBoosterDelayChance, m_shieldBoosterDuration, m_sightRange, m_sigRadius, m_sigResolution, m_switchTargChance, m_trackingSpeed, m_useSecondTarget, m_useSigRadius, m_useTargSwitching, m_warpScram, m_warpScramChance, m_warpScramRange, and m_webber.

53  m_npc(who),
54  m_destiny(who->DestinyMgr()),
55  m_self(who->GetSelf()),
56  m_processTimer(0),
58  m_missileTimer(0),
59  m_warpOutTimer(0),
65 {
66  assert(m_self.get() != nullptr);
67  m_webber = false;
68  m_warpScram = false;
69  m_isWandering = false;
70 
72 
73  /* set npc ship data */
78  if (m_launcherCycleTime > 100) {
80  } else {
81  m_missileTypeID = 0;
82  }
83 
84  // AttrEntityDefenderChance = 497, <<< for defender missiles
85 
88  // ship speeds
89  // absolute (boosted) Max Ship Speed
91  // Orbit Velocity
92  m_orbitSpeed = m_self->GetAttribute(AttrEntityCruiseSpeed).get_uint32(); // ship speed when not chasing target
93  //AttrEntityChaseMaxDelay - time before 'chase speed' kicks in
94  //AttrEntityChaseMaxDelayChance - chance npc will wait AttrEntityChaseMaxDelay before chasing
95  //AttrEntityChaseMaxDuration - max time a chase will last (unless weapons fired)
96  //AttrEntityChaseMaxDurationChance - chance that any chase will last for AttrEntityChaseMaxDuration
97 
98  // ship distances
99  //AttrEntityMaxWanderRange
100  // Optimal Range - TODO: test for 0
101  m_optimalRange = m_self->GetAttribute(AttrMaxRange).get_uint32(); // distance which npc starts using weapons
102  // Accuracy falloff (distance past optimal range at which accuracy has fallen by half) - TODO: test for 0
105  // Orbit Range, Follow Range - npc tries to stay at this distance from active target
106  m_flyRange = m_self->GetAttribute(AttrEntityFlyRange).get_uint32(); //AttrOrbitRange is 0 for npc
107  if (!m_flyRange)
108  m_flyRange = 0;
109  // distance for Speed Boost activation (this needs to be revisited)
111  if (!m_boostRange)
112  m_boostRange = 0;
113  // some npcs have flyRange > boostRange. this corrects it. (extends boost range)
114  if (m_flyRange > m_boostRange)
116  // max firing range default:10000 (lowest in db is 1000)
118  // this should be set according to npc size.
119  if (m_maxAttackRange < 1000)
120  m_maxAttackRange = 10000;
121 
122  // 'sight' range (undefined in db)
123  float radius = m_self->GetAttribute(AttrRadius).get_float();
124  if (radius < 30) {
125  m_sightRange = 2500;
126  } else if (radius < 60) {
127  m_sightRange = 5000;
128  } else if (radius < 150) {
129  m_sightRange = 8000;
130  } else if (radius < 280) {
131  m_sightRange = 12000;
132  } else if (radius < 550) {
133  m_sightRange = 15000;
134  } else {
135  m_sightRange = 20000;
136  }
139 
140  // ship targets
142  if (m_maxAttackTargets < 1)
143  m_maxAttackTargets = 1;
145  if (m_maxLockedTargets < 1) {
146  if (m_maxAttackTargets > 1) {
148  } else {
149  m_maxLockedTargets = 1;
150  }
151  }
152 
155  // this is chance an npc has of delaying it's rep (if applicable)
164  } else {
167  }
170 
171  // this is chance an npc has of delaying it's sebo (if applicable)
180  } else {
183  }
186 
187  // advanced AI variables only used by sleepers for now (and on live). will update advanced npcs to use these also
189  m_useTargSwitching = true;
190  } else {
191  m_useTargSwitching = false;
192  }
194  m_useSecondTarget = true;
195  } else {
196  m_useSecondTarget = false;
197  }
199  m_useSigRadius = true;
201  } else {
202  m_useSigRadius = false;
204  }
207  } else {
208  m_switchTargChance = 0;
209  }
210 
213  } else {
214  m_warpScramRange = 0;
215  }
218  } else {
219  m_warpScramChance = 0;
220  }
221 
222  /*
223  AttrWarpScrambleRange = 103,
224  AttrWarpScrambleStrength = 105,
225  AttrEntityWarpScrambleChance = 504,
226  AttrWarpScrambleDuration = 505,
227  AttrModifyTargetSpeedRange = 514
228  */
229 
230  /*
231  AttrEntityEquipmentMin = 456,
232  AttrEntityEquipmentMax = 457,
233  */
234 
235  /*
236  AttrEntityTargetJam = 928,
237  AttrEntityTargetJamDuration = 929,
238  AttrEntityTargetJamDurationChance = 930, // npcActivationChanceAttributeID in dgmEffects
239  AttrEntityCapacitorDrainDurationChance = 931, // npcActivationChanceAttributeID in dgmEffects
240  AttrEntitySensorDampenDurationChance = 932, // npcActivationChanceAttributeID in dgmEffects
241  AttrEntityTrackingDisruptDurationChance = 933, // npcActivationChanceAttributeID in dgmEffects
242  AttrEntityTargetPaintDurationChance = 935, // npcActivationChanceAttributeID in dgmEffects
243  AttrEntityTargetJamMaxRange = 936,
244  AttrEntityCapacitorDrainMaxRange = 937,
245  AttrEntitySensorDampenMaxRange = 938,
246  AttrEntityTrackingDisruptMaxRange = 940,
247  AttrEntityTargetPaintMaxRange = 941,
248  AttrEntityCapacitorDrainDuration = 942,
249  AttrEntitySensorDampenDuration = 943,
250  AttrEntityTrackingDisruptDuration = 944,
251  AttrEntityTargetPaintDuration = 945,
252  AttrEntityCapacitorDrainAmount = 946,
253  AttrEntitySensorDampenMultiplier = 947,
254  AttrEntityTrackingDisruptMultiplier = 948,
255  AttrEntityTargetPaintMultiplier = 949,
256  AttrEntitySensorDampenFallOff = 950,
257  AttrEntityTrackingDisruptFallOff = 951,
258  AttrEntityCapacitorFallOff = 952,
259  AttrEntityTargetJamFallOff = 953,
260  AttrEntityTargetPaintFallOff = 954,
261  */
262 
263  // does this need to be running if there are no players in bubble?
264  // yes...npcs will warp out when no targets in sight range, but need a process tic to do that.
265  // m_processTimer.Start(m_attackSpeed);
266 
267  // maybe this can be used to tell spawnMgr to respawn this npc as required....
268  // AttrEntityGroupRespawnChance = 640,
269 }
double m_damageMultiplier
Definition: NPCAI.h:143
uint16 m_optimalRange
Definition: NPCAI.h:126
bool m_isWandering
Definition: NPCAI.h:108
uint16 m_launcherCycleTime
Definition: NPCAI.h:122
bool HasAttribute(const uint16 attrID) const
bool m_warpScram
Definition: NPCAI.h:107
uint16 m_boostRange
Definition: NPCAI.h:127
Timer m_armorRepairTimer
Definition: NPCAI.h:155
Timer m_shieldBoosterTimer
Definition: NPCAI.h:154
InventoryItemRef m_self
Definition: NPCAI.h:147
uint16 m_orbitSpeed
Definition: NPCAI.h:124
uint16 m_sigResolution
Definition: NPCAI.h:123
Timer m_mainAttackTimer
Definition: NPCAI.h:152
Timer m_webifierTimer
Definition: NPCAI.h:159
uint16 m_maxSpeed
Definition: NPCAI.h:119
uint32 m_falloff
Definition: NPCAI.h:132
Timer m_missileTimer
Definition: NPCAI.h:153
DestinyManager * m_destiny
Definition: NPCAI.h:146
uint16 m_armorRepairDuration
Definition: NPCAI.h:128
DestinyManager * DestinyMgr()
Definition: SystemEntity.h:198
InventoryItemRef GetSelf()
Definition: SystemEntity.h:202
Timer m_beginFindTarget
Definition: NPCAI.h:156
uint32 get_uint32()
Definition: EvilNumber.cpp:173
uint32 m_maxAttackRange
Definition: NPCAI.h:135
bool m_useSecondTarget
Definition: NPCAI.h:111
bool m_useTargSwitching
Definition: NPCAI.h:110
X * get() const
Definition: RefPtr.h:213
uint16 m_shieldBoosterDuration
Definition: NPCAI.h:129
double m_trackingSpeed
Definition: NPCAI.h:142
uint8 m_maxAttackTargets
Definition: NPCAI.h:117
float m_warpScramChance
Definition: NPCAI.h:138
bool m_webber
Definition: NPCAI.h:106
uint16 m_preferedSigRadius
Definition: NPCAI.h:114
float m_armorRepairDelayChance
Definition: NPCAI.h:139
uint16 m_attackSpeed
Definition: NPCAI.h:120
NPC * m_npc
Definition: NPCAI.h:145
Timer m_warpScramblerTimer
Definition: NPCAI.h:158
uint32 m_sigRadius
Definition: NPCAI.h:131
float m_switchTargChance
Definition: NPCAI.h:113
EvilNumber GetAttribute(const uint16 attrID) const
uint32 m_flyRange
Definition: NPCAI.h:133
double get_double()
Definition: EvilNumber.cpp:191
uint32 m_sightRange
Definition: NPCAI.h:134
Timer m_processTimer
Definition: NPCAI.h:151
float get_float()
Definition: EvilNumber.cpp:184
uint8 m_maxLockedTargets
Definition: NPCAI.h:118
bool m_useSigRadius
Definition: NPCAI.h:109
Timer m_warpOutTimer
Definition: NPCAI.h:157
int8 m_state
Definition: NPCAI.h:101
uint32 m_warpScramRange
Definition: NPCAI.h:136
uint16 m_missileTypeID
Definition: NPCAI.h:121
float m_shieldBoosterDelayChance
Definition: NPCAI.h:140

Here is the call graph for this function:

NPCAIMgr::~NPCAIMgr ( )
inline

Definition at line 58 of file NPCAI.h.

58 { /* do nothing here */ }

Member Function Documentation

void NPCAIMgr::Attack ( SystemEntity pSE)
protected

Definition at line 689 of file NPCAI.cpp.

References _log, AttackTarget(), TargetManager::CanAttack(), Timer::Check(), ClearTarget(), SystemEntity::DestinyMgr(), Timer::Disable(), SystemEntity::GetID(), SystemEntity::GetName(), SystemEntity::GetPosition(), SystemBubble::InBubble(), DestinyManager::IsCloaked(), m_mainAttackTimer, m_missileTimer, m_npc, SystemEntity::SysBubble(), and SystemEntity::TargetMgr().

Referenced by CheckDistance(), and TargetLost().

690 {
691  if (pSE == nullptr)
692  return;
693  if (m_mainAttackTimer.Check()) {
694  if (pSE == nullptr)
695  return;
696  // Check to see if the target still in the bubble (Client warped out)
697  if (!m_npc->SysBubble()->InBubble(pSE->GetPosition())) {
698  _log(NPC__AI_TRACE, "%s(%u): Target %s(%u) no longer in bubble. Clear target and move on",
699  m_npc->GetName(), m_npc->GetID(), pSE->GetName(), pSE->GetID());
701  ClearTarget(pSE);
702  return;
703  }
704  if (pSE->DestinyMgr() == nullptr) {
705  _log(NPC__AI_TRACE, "%s(%u): Target %s(%u) has no destiny manager. Clear target and move on",
706  m_npc->GetName(), m_npc->GetID(), pSE->GetName(), pSE->GetID());
708  ClearTarget(pSE);
709  return;
710  }
711  // Check to see if the target is not cloaked:
712  if (pSE->DestinyMgr()->IsCloaked()) {
713  _log(NPC__AI_TRACE, "%s(%u): Target %s(%u) is cloaked. Clear target and move on",
714  m_npc->GetName(), m_npc->GetID(), pSE->GetName(), pSE->GetID());
716  ClearTarget(pSE);
717  return;
718  }
719  if (m_npc->TargetMgr()->CanAttack())
720  AttackTarget(pSE);
721  }
722 }
#define _log(type, fmt,...)
Definition: logsys.h:124
void Disable()
Definition: timer.h:39
SystemBubble * SysBubble()
Definition: SystemEntity.h:195
bool InBubble(const GPoint &pt, bool inWarp=false) const
TargetManager * TargetMgr()
Definition: SystemEntity.h:197
Timer m_mainAttackTimer
Definition: NPCAI.h:152
const GPoint & GetPosition() const
Definition: SystemEntity.h:211
Timer m_missileTimer
Definition: NPCAI.h:153
DestinyManager * DestinyMgr()
Definition: SystemEntity.h:198
uint32 GetID()
Definition: SystemEntity.h:207
bool Check(bool reset=true)
Definition: timer.cpp:62
const char * GetName() const
Definition: SystemEntity.h:210
NPC * m_npc
Definition: NPCAI.h:145
void AttackTarget(SystemEntity *pSE)
Definition: NPCAI.cpp:735
void ClearTarget(SystemEntity *pSE)
Definition: NPCAI.cpp:724

Here is the call graph for this function:

Here is the caller graph for this function:

void NPCAIMgr::AttackTarget ( SystemEntity pSE)
protected

Definition at line 735 of file NPCAI.cpp.

References SystemEntity::ApplyDamage(), AttrGfxTurretID, EvilNumber::get_uint32(), InventoryItem::GetAttribute(), NPC::GetEM(), NPC::GetExplosive(), SystemEntity::GetID(), NPC::GetKinetic(), TurretFormulas::GetNPCToHit(), NPC::GetThermal(), InventoryItem::HasAttribute(), InventoryItem::itemID(), m_attackSpeed, m_damageMultiplier, m_destiny, m_formula, m_npc, m_self, sConfig, DestinyManager::SendSpecialEffect(), targetAttack, and InventoryItem::typeID().

Referenced by Attack().

735  {
736  if (pSE == nullptr)
737  return;
738  // put checks here for point/tackle
739 
740  // effects are listed in EVE_Effects.h
741  std::string guid = "effects.Laser"; // client looks for 'turret' in ship.ball.modules for 'effects.laser'
742  uint32 gfxID = 0;
743  if (m_self->HasAttribute(AttrGfxTurretID))// graphicID for turret for drone type ships
746  pSE->GetID(),0,guid,1,1,
747  1,m_attackSpeed,0,gfxID);
748 
749  Damage d(m_npc,
750  m_self,
751  m_npc->GetKinetic(),
752  m_npc->GetThermal(),
753  m_npc->GetEM(),
754  m_npc->GetExplosive(),
757  );
758 
759  if (sConfig.npc.UseDamageMultiplier)
760  if (m_damageMultiplier > 0)
761  d *= m_damageMultiplier;
762 
763  pSE->ApplyDamage(d);
764 }
#define sConfig
A macro for easier access to the singleton.
double m_damageMultiplier
Definition: NPCAI.h:143
TurretFormulas m_formula
Definition: NPCAI.h:149
bool HasAttribute(const uint16 attrID) const
InventoryItemRef m_self
Definition: NPCAI.h:147
void SendSpecialEffect(uint32 entityID, uint32 moduleID, uint32 moduleTypeID, uint32 targetID, uint32 chargeTypeID, std::string guid, bool isOffensive, bool start, bool isActive, int32 duration, uint32 repeat, int32 graphicInfo=0) const
DestinyManager * m_destiny
Definition: NPCAI.h:146
uint32 get_uint32()
Definition: EvilNumber.cpp:173
Definition: Damage.h:33
uint32 GetID()
Definition: SystemEntity.h:207
float GetThermal()
Definition: NPC.h:76
float GetExplosive()
Definition: NPC.h:79
uint16 m_attackSpeed
Definition: NPCAI.h:120
unsigned __int32 uint32
Definition: eve-compat.h:50
NPC * m_npc
Definition: NPCAI.h:145
EvilNumber GetAttribute(const uint16 attrID) const
float GetNPCToHit(NPC *pNPC, SystemEntity *pTarget)
float GetEM()
Definition: NPC.h:77
bool ApplyDamage(Damage &d)
Definition: Damage.cpp:108
uint16 typeID() const
float GetKinetic()
Definition: NPC.h:78
uint32 itemID() const
Definition: InventoryItem.h:98

Here is the call graph for this function:

Here is the caller graph for this function:

void NPCAIMgr::CheckDistance ( SystemEntity pSE)
protected

Definition at line 554 of file NPCAI.cpp.

References _log, Attack(), ClearTarget(), Ga::GaVec3::distance(), SystemEntity::GetID(), SystemEntity::GetName(), SystemEntity::GetPosition(), GetStateName(), NPCAI::State::Idle, TargetManager::IsTargetedBy(), m_boostRange, m_flyRange, m_isWandering, m_npc, m_sightRange, m_state, SetChasing(), SetEngaged(), SetFollowing(), and SystemEntity::TargetMgr().

Referenced by Process(), and Target().

555 {
556  if (pSE == nullptr)
557  return;
558  double dist = m_npc->GetPosition().distance(pSE->GetPosition());
559  if ((dist > m_sightRange) and (!m_npc->TargetMgr()->IsTargetedBy(pSE))) {
560  _log(NPC__AI_TRACE, "%s(%u): CheckDistance: %s(%u) is too far away (%u). Return to Idle.", \
561  m_npc->GetName(), m_npc->GetID(), pSE->GetName(), pSE->GetID(), dist);
562  if (m_state != NPCAI::State::Idle) {
563  // target is no longer in npc's "sight range" and is NOT targeting this npc. unlock target and return to idle.
564  // should we do anything else here? search for another target? wander around? yes..later
565  // if npc is targeted greater than this distance, it will chase
566  ClearTarget(pSE);
567  }
568  return;
569  }
570 
571  m_isWandering = false;
572 
573  if (dist < m_flyRange) {
574  SetEngaged(pSE);
575  } else if (dist < m_boostRange) {
576  SetFollowing(pSE);
577  } else {
578  SetChasing(pSE);
579  }
580 
581  _log(NPC__AI_TRACE, "%s(%u): CheckDistance: target: %s(%u), state: %s, dist: %.0f, flyRange: %u, boostRange: %u.", \
582  m_npc->GetName(), m_npc->GetID(), pSE->GetName(), pSE->GetID(), GetStateName(m_state).c_str(), dist, m_flyRange, m_boostRange);
583 
584  Attack(pSE);
585 }
#define _log(type, fmt,...)
Definition: logsys.h:124
bool m_isWandering
Definition: NPCAI.h:108
uint16 m_boostRange
Definition: NPCAI.h:127
void Attack(SystemEntity *pSE)
Definition: NPCAI.cpp:689
TargetManager * TargetMgr()
Definition: SystemEntity.h:197
const GPoint & GetPosition() const
Definition: SystemEntity.h:211
void SetEngaged(SystemEntity *pSE)
Definition: NPCAI.cpp:507
void SetFollowing(SystemEntity *pSE)
Definition: NPCAI.cpp:493
void SetChasing(SystemEntity *pSE)
Definition: NPCAI.cpp:478
uint32 GetID()
Definition: SystemEntity.h:207
const char * GetName() const
Definition: SystemEntity.h:210
NPC * m_npc
Definition: NPCAI.h:145
uint32 m_flyRange
Definition: NPCAI.h:133
std::string GetStateName(int8 stateID)
Definition: NPCAI.cpp:860
uint32 m_sightRange
Definition: NPCAI.h:134
GaExpInl GaFloat distance(const GaVec3 &oth) const
Definition: GaTypes.h:158
bool IsTargetedBy(SystemEntity *pSE)
void ClearTarget(SystemEntity *pSE)
Definition: NPCAI.cpp:724
int8 m_state
Definition: NPCAI.h:101

Here is the call graph for this function:

Here is the caller graph for this function:

void NPCAIMgr::ClearTarget ( SystemEntity pSE)
protected

Definition at line 724 of file NPCAI.cpp.

References TargetManager::ClearTarget(), TargetManager::HasNoTargets(), m_npc, SetIdle(), and SystemEntity::TargetMgr().

Referenced by Attack(), CheckDistance(), and Process().

724  {
725  m_npc->TargetMgr()->ClearTarget(pSE);
726  //m_npc->TargetMgr()->OnTarget(pSE, TargMgr::Mode::Lost);
727 
728  if (m_npc->TargetMgr()->HasNoTargets())
729  SetIdle();
730 }
void SetIdle()
Definition: NPCAI.cpp:446
void ClearTarget(SystemEntity *tSE)
TargetManager * TargetMgr()
Definition: SystemEntity.h:197
NPC * m_npc
Definition: NPCAI.h:145
bool HasNoTargets() const

Here is the call graph for this function:

Here is the caller graph for this function:

void NPCAIMgr::DisableRepTimers ( bool  shield = true,
bool  armor = true 
)

Definition at line 852 of file NPCAI.cpp.

References Timer::Disable(), m_armorRepairTimer, and m_shieldBoosterTimer.

Referenced by NPC::UseArmorRepairer(), NPC::UseHullRepairer(), and NPC::UseShieldRecharge().

853 {
854  if (armor)
856  if (shield)
858 }
void Disable()
Definition: timer.h:39
Timer m_armorRepairTimer
Definition: NPCAI.h:155
Timer m_shieldBoosterTimer
Definition: NPCAI.h:154

Here is the call graph for this function:

Here is the caller graph for this function:

void NPCAIMgr::DisableWarpOutTimer ( )
inline

Definition at line 79 of file NPCAI.h.

References Timer::Disable(), and m_warpOutTimer.

void Disable()
Definition: timer.h:39
Timer m_warpOutTimer
Definition: NPCAI.h:157

Here is the call graph for this function:

uint32 NPCAIMgr::GetAttackRange ( )
inline

Definition at line 75 of file NPCAI.h.

References m_maxAttackRange.

75 { return m_maxAttackRange; }
uint32 m_maxAttackRange
Definition: NPCAI.h:135
uint32 NPCAIMgr::GetFalloff ( )
inline

Definition at line 74 of file NPCAI.h.

References m_falloff.

Referenced by TurretFormulas::GetNPCToHit().

74 { return m_falloff; }
uint32 m_falloff
Definition: NPCAI.h:132

Here is the caller graph for this function:

uint16 NPCAIMgr::GetOptimalRange ( )
inline

Definition at line 72 of file NPCAI.h.

References m_optimalRange.

Referenced by TurretFormulas::GetNPCToHit().

72 { return m_optimalRange; }
uint16 m_optimalRange
Definition: NPCAI.h:126

Here is the caller graph for this function:

uint16 NPCAIMgr::GetSigRes ( )
inline

Definition at line 73 of file NPCAI.h.

References m_sigResolution.

Referenced by TurretFormulas::GetNPCToHit().

73 { return m_sigResolution; }
uint16 m_sigResolution
Definition: NPCAI.h:123

Here is the caller graph for this function:

std::string NPCAIMgr::GetStateName ( int8  stateID)
protected

Definition at line 860 of file NPCAI.cpp.

References NPCAI::State::Chasing, NPCAI::State::Engaged, NPCAI::State::Fleeing, NPCAI::State::Following, NPCAI::State::Idle, NPCAI::State::Signaling, NPCAI::State::WarpFollow, and NPCAI::State::WarpOut.

Referenced by CheckDistance(), Process(), and Targeted().

861 {
862  switch (stateID) {
863  case NPCAI::State::Idle: return "Idle";
864  case NPCAI::State::Chasing: return "Chasing";
865  case NPCAI::State::Engaged: return "Engaged";
866  case NPCAI::State::Fleeing: return "Fleeing";
867  case NPCAI::State::Following: return "Following";
868  case NPCAI::State::Signaling: return "Signaling";
869  case NPCAI::State::WarpOut: return "Warping Out";
870  case NPCAI::State::WarpFollow: return "Following Warp";
871  default: return "Invalid";
872  }
873 }

Here is the caller graph for this function:

float NPCAIMgr::GetTargetTime ( )
protected

Definition at line 830 of file NPCAI.cpp.

References AttrRadius, AttrScanSpeed, EvilNumber::get_float(), InventoryItem::GetAttribute(), and m_self.

Referenced by Target(), and Targeted().

831 {
832  float targetTime = (m_self->GetAttribute(AttrScanSpeed).get_float());
833  float radius = m_self->GetAttribute(AttrRadius).get_float();
834  if (targetTime < 1) {
835  if (radius < 30) {
836  targetTime = 1500;
837  } else if (radius < 60) {
838  targetTime = 2500;
839  } else if (radius < 150) {
840  targetTime = 4000;
841  } else if (radius < 280) {
842  targetTime = 6000;
843  } else if (radius < 550) {
844  targetTime = 8000;
845  } else {
846  targetTime = 13000;
847  }
848  }
849  return targetTime;
850 }
InventoryItemRef m_self
Definition: NPCAI.h:147
EvilNumber GetAttribute(const uint16 attrID) const
float get_float()
Definition: EvilNumber.cpp:184

Here is the call graph for this function:

Here is the caller graph for this function:

double NPCAIMgr::GetTrackingSpeed ( )
inline

Definition at line 76 of file NPCAI.h.

References m_trackingSpeed.

Referenced by TurretFormulas::GetNPCToHit().

76 { return m_trackingSpeed; }
double m_trackingSpeed
Definition: NPCAI.h:142

Here is the caller graph for this function:

bool NPCAIMgr::IsFighting ( )

Definition at line 372 of file NPCAI.cpp.

References NPCAI::State::Idle, and m_state.

372  {
373  // more to this here....
374  return (m_state != NPCAI::State::Idle);
375 }
int8 m_state
Definition: NPCAI.h:101
bool NPCAIMgr::IsIdle ( )
inline

Definition at line 70 of file NPCAI.h.

References NPCAI::State::Idle, and m_state.

Referenced by DestinyManager::BeginMovement().

70 { return (m_state == NPCAI::State::Idle); }
int8 m_state
Definition: NPCAI.h:101

Here is the caller graph for this function:

void NPCAIMgr::LaunchMissile ( uint16  typeID,
SystemEntity pSE 
)

Definition at line 777 of file NPCAI.cpp.

References AttrAoeCloudSize, AttrAoeFalloff, AttrAoeVelocity, AttrExplosionDelay, AttrMaxVelocity, AttrMissileEntityAoeCloudSizeMultiplier, AttrMissileEntityAoeFalloffMultiplier, AttrMissileEntityAoeVelocityMultiplier, AttrMissileEntityFlightTimeMultiplier, AttrMissileEntityVelocityMultiplier, SystemEntity::DestinyMgr(), Ga::GaVec3::distance(), flagMissile, InventoryItem::GetAttribute(), SystemEntity::GetID(), SystemEntity::GetLocationID(), SystemEntity::GetPosition(), SystemManager::GetServiceMgr(), InventoryItem::HasAttribute(), m_npc, m_self, DestinyManager::MakeMissile(), EVEDB::invGroups::Missile, SystemEntity::MissileLaunched(), Missile::SetHitTimer(), Missile::SetSpeed(), sItemFactory, and SystemEntity::SystemMgr().

Referenced by MissileLaunched(), and Process().

778 {
779  if (typeID == 0)
780  return;
781  // Actually Launch a missile, creating a new Destiny object for it
782  // ItemData( uint32 _typeID, uint32 _ownerID, uint32 _locationID, EVEItemFlags _flag, const char *_name = "", \
783  const GPoint &_position = NULL_ORIGIN, const char *_customInfo = "", bool _contraband = false);
784  ItemData idata(typeID, m_npc->GetID(), m_npc->GetLocationID(), flagMissile, "NPC Missile", m_npc->GetPosition());
785  InventoryItemRef missileRef = sItemFactory.SpawnItem(idata);
786  if (missileRef.get() == nullptr)
787  return; // make error here
788 
789  // modify missile based on npc attribs
792  if (m_self->HasAttribute(AttrMissileEntityFlightTimeMultiplier)) // this may be wrong
800 
801  SystemManager* pSystem = m_npc->SystemMgr();
802  // Missile(InventoryItemRef self, PyServiceMgr &services, SystemManager* system, InventoryItemRef module, SystemEntity* target, ShipItem* ship);
803  Missile* pMissile = new Missile(missileRef, *(pSystem->GetServiceMgr()), pSystem, m_self, pSE, m_npc);
804  if (pMissile == nullptr)
805  return; // make error here
806  double distance = pMissile->GetPosition().distance(pSE->GetPosition());
807  double missileSpeed = missileRef->GetAttribute(AttrMaxVelocity).get_float();
808  double travelTime = (distance/missileSpeed);
809  if (travelTime < 1)
810  travelTime = 1;
811  pMissile->SetSpeed(missileSpeed);
812  pMissile->SetHitTimer(travelTime *1000);
813  pMissile->DestinyMgr()->MakeMissile(pMissile);
814 
815  // tell target a missile has been launched at them.. (defender missile trigger for ship, tower, pos, npc, others?)
816  if (typeID != 265) // but only if it's NOT a defender missile
817  pSE->MissileLaunched(pMissile);
818 }
bool HasAttribute(const uint16 attrID) const
void MakeMissile(Missile *missile)
void SetHitTimer(uint32 setTime)
Definition: Missile.h:60
InventoryItemRef m_self
Definition: NPCAI.h:147
const GPoint & GetPosition() const
Definition: SystemEntity.h:211
DestinyManager * DestinyMgr()
Definition: SystemEntity.h:198
SystemManager * SystemMgr()
Definition: SystemEntity.h:196
uint32 GetLocationID()
Definition: SystemEntity.h:209
uint32 GetID()
Definition: SystemEntity.h:207
void SetSpeed(double speed)
Definition: Missile.h:61
NPC * m_npc
Definition: NPCAI.h:145
PyServiceMgr * GetServiceMgr()
Definition: SystemManager.h:88
EvilNumber GetAttribute(const uint16 attrID) const
#define sItemFactory
Definition: ItemFactory.h:165
GaExpInl GaFloat distance(const GaVec3 &oth) const
Definition: GaTypes.h:158
virtual void MissileLaunched(Missile *pMissile)
Definition: SystemEntity.h:249

Here is the call graph for this function:

Here is the caller graph for this function:

void NPCAIMgr::MissileLaunched ( Missile pMissile)

Definition at line 820 of file NPCAI.cpp.

References AttrEntityDefenderChance, EvilNumber::get_float(), InventoryItem::GetAttribute(), LaunchMissile(), m_self, MakeRandomFloat(), and sConfig.

Referenced by NPC::MissileLaunched().

821 {
823  if (sConfig.npc.DefenderMissileChance)
824  chance = sConfig.npc.DefenderMissileChance;
825  // check chance to shoot defender missile at incomming missile (working, ??/??/??)
826  if (MakeRandomFloat() < chance)
827  LaunchMissile(265, pMissile); // defender missile
828 }
#define sConfig
A macro for easier access to the singleton.
double MakeRandomFloat(double low, double high)
Generates random real from interval [low; high].
Definition: misc.cpp:114
InventoryItemRef m_self
Definition: NPCAI.h:147
EvilNumber GetAttribute(const uint16 attrID) const
void LaunchMissile(uint16 typeID, SystemEntity *pSE)
Definition: NPCAI.cpp:777
float get_float()
Definition: EvilNumber.cpp:184

Here is the call graph for this function:

Here is the caller graph for this function:

void NPCAIMgr::Process ( )

Definition at line 271 of file NPCAI.cpp.

References _log, NPCAI::State::Chasing, Timer::Check(), CheckDistance(), ClearTarget(), Timer::Disable(), Ga::GaVec3::distance(), Timer::Enabled(), NPCAI::State::Engaged, NPCAI::State::Fleeing, NPCAI::State::Following, TargetManager::GetFirstTarget(), SystemBubble::GetID(), SystemEntity::GetID(), SystemEntity::GetName(), SystemBubble::GetPlayers(), SystemEntity::GetPosition(), NPC::GetSpawnMgr(), GetStateName(), SystemManager::GetSystemSecurityRating(), TargetManager::HasNoTargets(), NPCAI::State::Idle, SpawnMgr::IsChaining(), DestinyManager::IsCloaked(), DestinyManager::IsWarping(), LaunchMissile(), m_armorRepairTimer, m_attackSpeed, m_beginFindTarget, m_destiny, m_isWandering, m_missileTimer, m_missileTypeID, m_npc, m_shieldBoosterTimer, m_sightRange, m_state, m_warpOutTimer, sConfig, SetIdle(), SetWander(), NPCAI::State::Signaling, Timer::Start(), SystemEntity::SysBubble(), SystemEntity::SystemMgr(), Target(), SystemEntity::TargetMgr(), NPC::UseArmorRepairer(), NPC::UseShieldRecharge(), NPCAI::State::WarpFollow, and NPCAI::State::WarpOut.

Referenced by NPC::Process().

271  {
272  if (m_destiny->IsWarping())
273  return;
274 
275  if (m_warpOutTimer.Check(false)) {
276  // disallow warpout if spawn has active respawn timer (spawn is being chained)
277  if (m_npc->GetSpawnMgr()->IsChaining(m_npc->SysBubble()->GetID())) {
280  }
281  }
282 
283  /* NPCAI::State definitions -allan 25July15 (UD 1June16)
284  * Idle, // not doing anything, nothing in sight....idle. call Wander() to loosely orbit random object in bubble ~10-20k at 1/2 orbit speed
285  * Chasing, // target within npc sight range. attacking begins here. use m_maxSpeed to get within falloff
286  * Following, // between optimal and falloff. try to get closer, but still orbiting and attacking
287  * Engaged, // actively fighting (in orbit). use m_orbitSpeed.
288  * Fleeing, // running away....use m_maxSpeed then warp away when out of range (does this make sense??)
289  * Signaling // calling for help..use m_orbitSpeed *2 to speed tank while calling for reinforcements
290  */
291  switch(m_state) {
292  case NPCAI::State::Idle: {
293  if (m_beginFindTarget.Check()) {
294  std::vector<Client*> clientVec;
295  clientVec.clear();
296  DestinyManager* pDestiny(nullptr);
297  m_npc->SysBubble()->GetPlayers(clientVec); // what about player drones? yes...later
298  for (auto cur : clientVec) {
299  if (cur->IsInvul())
300  continue;
301  if (cur->GetShipSE() == nullptr)
302  continue;
303  if (cur->InPod()) {
304  if (sConfig.npc.TargetPod) {
305  if (m_npc->SystemMgr()->GetSystemSecurityRating() > sConfig.npc.TargetPodSec)
306  continue;
307  } else {
308  continue;
309  }
310  }
311  pDestiny = cur->GetShipSE()->DestinyMgr();
312  if (pDestiny == nullptr) // this shouldnt be needed, but whatever...
313  continue;
314  if (pDestiny->IsCloaked() or pDestiny->IsWarping())
315  continue;
316  if (m_npc->GetPosition().distance(cur->GetShipSE()->GetPosition()) > m_sightRange)
317  continue;
318 
319  Target(cur->GetShipSE());
320  return;
321  }
322  if (sConfig.npc.IdleWander)
323  if (!m_isWandering)
324  SetWander();
325  } else {
326  if (!m_beginFindTarget.Enabled())
327  m_beginFindTarget.Start(m_attackSpeed); //find target is based on npc attack speed.
328  }
329  } break;
332  case NPCAI::State::Engaged: {
333  if (m_npc->TargetMgr()->HasNoTargets()) {
334  _log(NPC__AI_TRACE, "%s(%u): Stopped %s - HasNoTargets = true.", m_npc->GetName(), m_npc->GetID(), GetStateName(m_state).c_str());
335  SetIdle();
336  return;
337  }
338  SystemEntity* pSE = m_npc->TargetMgr()->GetFirstTarget(false);
339  if (pSE == nullptr) {
340  _log(NPC__AI_TRACE, "%s(%u): Stopped %s - GetFirstTarget() returned NULL.", m_npc->GetName(), m_npc->GetID(), GetStateName(m_state).c_str());
341  SetIdle();
342  return;
343  }
344  if (pSE->SysBubble() == nullptr) {
345  ClearTarget(pSE);
346  return;
347  }
348  CheckDistance(pSE);
349  if (m_missileTimer.Check())
351  } break;
356  _log(NPC__AI_TRACE, "%s(%u): Called %s - needs to be completed.", m_npc->GetName(), m_npc->GetID(), GetStateName(m_state).c_str());
358  // not sure how im gonna do these
359  } break;
360  }
361 
365 
369 
370 }
#define sConfig
A macro for easier access to the singleton.
void Target(SystemEntity *pSE)
Definition: NPCAI.cpp:587
#define _log(type, fmt,...)
Definition: logsys.h:124
bool m_isWandering
Definition: NPCAI.h:108
void SetIdle()
Definition: NPCAI.cpp:446
void Disable()
Definition: timer.h:39
void UseShieldRecharge()
Definition: NPC.cpp:222
SystemBubble * SysBubble()
Definition: SystemEntity.h:195
Timer m_armorRepairTimer
Definition: NPCAI.h:155
bool IsChaining(uint16 bubbleID)
Definition: SpawnMgr.cpp:827
Timer m_shieldBoosterTimer
Definition: NPCAI.h:154
const float GetSystemSecurityRating()
Definition: SystemManager.h:86
TargetManager * TargetMgr()
Definition: SystemEntity.h:197
void SetWander()
Definition: NPCAI.cpp:409
const GPoint & GetPosition() const
Definition: SystemEntity.h:211
void CheckDistance(SystemEntity *pSE)
Definition: NPCAI.cpp:554
Timer m_missileTimer
Definition: NPCAI.h:153
DestinyManager * m_destiny
Definition: NPCAI.h:146
SystemEntity * GetFirstTarget(bool need_locked=false)
SystemManager * SystemMgr()
Definition: SystemEntity.h:196
SpawnMgr * GetSpawnMgr()
Definition: NPC.h:82
Timer m_beginFindTarget
Definition: NPCAI.h:156
bool Enabled() const
Definition: timer.h:41
uint16 GetID()
Definition: SystemBubble.h:91
uint32 GetID()
Definition: SystemEntity.h:207
bool Check(bool reset=true)
Definition: timer.cpp:62
const char * GetName() const
Definition: SystemEntity.h:210
uint16 m_attackSpeed
Definition: NPCAI.h:120
NPC * m_npc
Definition: NPCAI.h:145
bool HasNoTargets() const
void UseArmorRepairer()
Definition: NPC.cpp:238
void LaunchMissile(uint16 typeID, SystemEntity *pSE)
Definition: NPCAI.cpp:777
std::string GetStateName(int8 stateID)
Definition: NPCAI.cpp:860
uint32 m_sightRange
Definition: NPCAI.h:134
GaExpInl GaFloat distance(const GaVec3 &oth) const
Definition: GaTypes.h:158
Timer m_warpOutTimer
Definition: NPCAI.h:157
void ClearTarget(SystemEntity *pSE)
Definition: NPCAI.cpp:724
int8 m_state
Definition: NPCAI.h:101
void GetPlayers(std::vector< Client * > &into) const
uint16 m_missileTypeID
Definition: NPCAI.h:121
void Start(uint32 setTimerTime=0, bool changeResetTimer=true)
Definition: timer.cpp:81

Here is the call graph for this function:

Here is the caller graph for this function:

void NPCAIMgr::SetChasing ( SystemEntity pSE)
protected
Todo:
implement chase timer using entityChaseMaxDuration to limit chase time.

Definition at line 478 of file NPCAI.cpp.

References _log, NPCAI::State::Chasing, Timer::Disable(), SystemEntity::GetID(), SystemEntity::GetName(), SystemEntity::GetPosition(), DestinyManager::GotoPoint(), DestinyManager::IsFollowing(), DestinyManager::IsGoto(), m_destiny, m_maxSpeed, m_npc, m_state, m_warpOutTimer, and DestinyManager::SetMaxVelocity().

Referenced by CheckDistance(), Target(), and Targeted().

478  {
479  if (pSE == nullptr)
480  return;
483  return;
484  _log(NPC__AI_TRACE, "%s(%u): Begin chasing. Target is %s(%u).", \
485  m_npc->GetName(), m_npc->GetID(), pSE->GetName(), pSE->GetID());
486  // target out of range to attack/follow, but within npc sight range....use mwd/ab if equiped
488  m_destiny->GotoPoint(pSE->GetPosition()); //head towards target
491 }
#define _log(type, fmt,...)
Definition: logsys.h:124
void Disable()
Definition: timer.h:39
void SetMaxVelocity(float maxVelocity)
const GPoint & GetPosition() const
Definition: SystemEntity.h:211
uint16 m_maxSpeed
Definition: NPCAI.h:119
DestinyManager * m_destiny
Definition: NPCAI.h:146
uint32 GetID()
Definition: SystemEntity.h:207
const char * GetName() const
Definition: SystemEntity.h:210
NPC * m_npc
Definition: NPCAI.h:145
void GotoPoint(const GPoint &point)
Timer m_warpOutTimer
Definition: NPCAI.h:157
int8 m_state
Definition: NPCAI.h:101

Here is the call graph for this function:

Here is the caller graph for this function:

void NPCAIMgr::SetEngaged ( SystemEntity pSE)
protected

Definition at line 507 of file NPCAI.cpp.

References _log, Timer::Disable(), NPCAI::State::Engaged, SystemEntity::GetID(), SystemEntity::GetName(), DestinyManager::IsOrbiting(), m_destiny, m_npc, m_optimalRange, m_orbitSpeed, m_state, m_warpOutTimer, DestinyManager::Orbit(), and DestinyManager::SetMaxVelocity().

Referenced by CheckDistance().

507  {
508  if (pSE == nullptr)
509  return;
511  return;
512  _log(NPC__AI_TRACE, "%s(%u): Begin engaging. Target is %s(%u).", \
513  m_npc->GetName(), m_npc->GetID(), pSE->GetName(), pSE->GetID());
514  // actively fighting
516  m_destiny->Orbit(pSE, m_optimalRange); //try to get inside orbit range
519 }
uint16 m_optimalRange
Definition: NPCAI.h:126
#define _log(type, fmt,...)
Definition: logsys.h:124
void Disable()
Definition: timer.h:39
void SetMaxVelocity(float maxVelocity)
uint16 m_orbitSpeed
Definition: NPCAI.h:124
DestinyManager * m_destiny
Definition: NPCAI.h:146
uint32 GetID()
Definition: SystemEntity.h:207
const char * GetName() const
Definition: SystemEntity.h:210
NPC * m_npc
Definition: NPCAI.h:145
void Orbit(SystemEntity *pSE, uint32 distance=0)
Timer m_warpOutTimer
Definition: NPCAI.h:157
int8 m_state
Definition: NPCAI.h:101

Here is the call graph for this function:

Here is the caller graph for this function:

void NPCAIMgr::SetFleeing ( SystemEntity pSE)
protected

Definition at line 522 of file NPCAI.cpp.

References _log, Timer::Disable(), NPCAI::State::Fleeing, SystemEntity::GetID(), SystemEntity::GetName(), DestinyManager::IsMoving(), m_destiny, m_maxSpeed, m_npc, m_state, m_warpOutTimer, and DestinyManager::SetMaxVelocity().

522  {
523  if (pSE == nullptr)
524  return;
526  return;
527  _log(NPC__AI_TRACE, "%s(%u): Begin fleeing. Target is %s(%u).", \
528  m_npc->GetName(), m_npc->GetID(), pSE->GetName(), pSE->GetID());
529  // actively fleeing
530  // use superspeed to disengage, then warp. << both these will need to be written.
531  // this state is only usable by higher-class npcs.
535 }
#define _log(type, fmt,...)
Definition: logsys.h:124
void Disable()
Definition: timer.h:39
void SetMaxVelocity(float maxVelocity)
uint16 m_maxSpeed
Definition: NPCAI.h:119
DestinyManager * m_destiny
Definition: NPCAI.h:146
uint32 GetID()
Definition: SystemEntity.h:207
const char * GetName() const
Definition: SystemEntity.h:210
NPC * m_npc
Definition: NPCAI.h:145
Timer m_warpOutTimer
Definition: NPCAI.h:157
int8 m_state
Definition: NPCAI.h:101

Here is the call graph for this function:

void NPCAIMgr::SetFollowing ( SystemEntity pSE)
protected

Definition at line 493 of file NPCAI.cpp.

References _log, Timer::Disable(), DestinyManager::Follow(), NPCAI::State::Following, SystemEntity::GetID(), SystemEntity::GetName(), DestinyManager::IsFollowing(), DestinyManager::IsGoto(), m_destiny, m_falloff, m_npc, m_orbitSpeed, m_state, m_warpOutTimer, and DestinyManager::SetMaxVelocity().

Referenced by CheckDistance().

493  {
494  if (pSE == nullptr)
495  return;
497  return;
498  _log(NPC__AI_TRACE, "%s(%u): Begin following. Target is %s(%u).", \
499  m_npc->GetName(), m_npc->GetID(), pSE->GetName(), pSE->GetID());
500  // too close to chase, but to far to engage
502  m_destiny->Follow(pSE, m_falloff); //try to get inside falloff range
505 }
#define _log(type, fmt,...)
Definition: logsys.h:124
void Disable()
Definition: timer.h:39
void SetMaxVelocity(float maxVelocity)
uint16 m_orbitSpeed
Definition: NPCAI.h:124
uint32 m_falloff
Definition: NPCAI.h:132
DestinyManager * m_destiny
Definition: NPCAI.h:146
uint32 GetID()
Definition: SystemEntity.h:207
const char * GetName() const
Definition: SystemEntity.h:210
NPC * m_npc
Definition: NPCAI.h:145
void Follow(SystemEntity *pSE, uint32 distance)
Timer m_warpOutTimer
Definition: NPCAI.h:157
int8 m_state
Definition: NPCAI.h:101

Here is the call graph for this function:

Here is the caller graph for this function:

void NPCAIMgr::SetIdle ( )
protected
Todo:
need to clear out targets here

Definition at line 446 of file NPCAI.cpp.

References _log, Timer::Disable(), SystemEntity::GetID(), SystemEntity::GetName(), NPC::GetSpawnMgr(), NPCAI::State::Idle, SystemBubble::IsAnomaly(), SystemBubble::IsIncursion(), SystemBubble::IsMission(), m_armorRepairTimer, m_beginFindTarget, m_destiny, m_mainAttackTimer, m_missileTimer, m_npc, m_orbitSpeed, m_shieldBoosterTimer, m_state, m_warpOutTimer, m_warpScramblerTimer, m_webifierTimer, sConfig, DestinyManager::SetMaxVelocity(), Timer::Start(), DestinyManager::Stop(), and SystemEntity::SysBubble().

Referenced by ClearTarget(), Process(), Target(), Targeted(), and TargetLost().

446  {
448  return;
449  // not doing anything....idle.
450 
453  _log(NPC__AI_TRACE, "%s(%u): Idle: returning to idle.", \
454  m_npc->GetName(), m_npc->GetID());
456  m_destiny->Stop();
458 
466 
467  SystemBubble* pBubble = m_npc->SysBubble();
468  //disallow warpout if anomaly, incursion or mission rat
469  if (pBubble->IsAnomaly() or pBubble->IsIncursion() or pBubble->IsMission())
470  return;
471 
472  //disallow warpout by NOT setting timer.
473  if (sConfig.npc.WarpOut > 0)
474  if (m_npc->GetSpawnMgr() != nullptr)
475  m_warpOutTimer.Start(sConfig.npc.WarpOut *1000); // s to ms
476 }
#define sConfig
A macro for easier access to the singleton.
#define _log(type, fmt,...)
Definition: logsys.h:124
void Disable()
Definition: timer.h:39
bool IsMission()
Definition: SystemBubble.h:67
bool IsAnomaly()
Definition: SystemBubble.h:66
SystemBubble * SysBubble()
Definition: SystemEntity.h:195
Timer m_armorRepairTimer
Definition: NPCAI.h:155
Timer m_shieldBoosterTimer
Definition: NPCAI.h:154
void SetMaxVelocity(float maxVelocity)
uint16 m_orbitSpeed
Definition: NPCAI.h:124
bool IsIncursion()
Definition: SystemBubble.h:68
Timer m_mainAttackTimer
Definition: NPCAI.h:152
Timer m_webifierTimer
Definition: NPCAI.h:159
Timer m_missileTimer
Definition: NPCAI.h:153
DestinyManager * m_destiny
Definition: NPCAI.h:146
SpawnMgr * GetSpawnMgr()
Definition: NPC.h:82
Timer m_beginFindTarget
Definition: NPCAI.h:156
uint32 GetID()
Definition: SystemEntity.h:207
const char * GetName() const
Definition: SystemEntity.h:210
NPC * m_npc
Definition: NPCAI.h:145
Timer m_warpScramblerTimer
Definition: NPCAI.h:158
Timer m_warpOutTimer
Definition: NPCAI.h:157
int8 m_state
Definition: NPCAI.h:101
void Start(uint32 setTimerTime=0, bool changeResetTimer=true)
Definition: timer.cpp:81

Here is the call graph for this function:

Here is the caller graph for this function:

void NPCAIMgr::SetSignaling ( SystemEntity pSE)
protected

Definition at line 538 of file NPCAI.cpp.

References _log, Timer::Disable(), SystemEntity::GetID(), SystemEntity::GetName(), DestinyManager::IsOrbiting(), m_destiny, m_falloff, m_npc, m_orbitSpeed, m_state, m_warpOutTimer, DestinyManager::Orbit(), DestinyManager::SetMaxVelocity(), and NPCAI::State::Signaling.

538  {
539  if (pSE == nullptr)
540  return;
542  return;
543  _log(NPC__AI_TRACE, "%s(%u): Begin signaling. Target is %s(%u).", \
544  m_npc->GetName(), m_npc->GetID(), pSE->GetName(), pSE->GetID());
545  // actively signaling
546  // start speedtanking while signaling. (im sure this is cheating, but fuckem.)
547  // this state is only usable by higher-class npcs.
549  m_destiny->Orbit(pSE, m_falloff); //try to get outside orbit range
552 }
#define _log(type, fmt,...)
Definition: logsys.h:124
void Disable()
Definition: timer.h:39
void SetMaxVelocity(float maxVelocity)
uint16 m_orbitSpeed
Definition: NPCAI.h:124
uint32 m_falloff
Definition: NPCAI.h:132
DestinyManager * m_destiny
Definition: NPCAI.h:146
uint32 GetID()
Definition: SystemEntity.h:207
const char * GetName() const
Definition: SystemEntity.h:210
NPC * m_npc
Definition: NPCAI.h:145
void Orbit(SystemEntity *pSE, uint32 distance=0)
Timer m_warpOutTimer
Definition: NPCAI.h:157
int8 m_state
Definition: NPCAI.h:101

Here is the call graph for this function:

void NPCAIMgr::SetWander ( )
protected
Todo:
figure out a way for npc to wander 'aimlessly' around their bubble

Definition at line 409 of file NPCAI.cpp.

References _log, SystemBubble::GetID(), SystemEntity::GetID(), SystemEntity::GetName(), SystemBubble::GetRandomEntity(), SystemManager::GetSE(), NPC::GetSpawnMgr(), SystemBubble::HasDynamics(), SystemBubble::IsAnomaly(), SystemBubble::IsBelt(), SystemBubble::IsIncursion(), SystemBubble::IsMission(), m_destiny, m_isWandering, m_npc, m_orbitSpeed, m_sightRange, MakeRandomInt(), DestinyManager::Orbit(), sBubbleMgr, DestinyManager::SetMaxVelocity(), DestinyManager::Stop(), SystemEntity::SysBubble(), SystemEntity::SystemMgr(), and WarpOut().

Referenced by Process().

410 {
411  if (m_npc->GetSpawnMgr() == nullptr)
412  return;
413  if (!m_isWandering) {
414  _log(NPC__AI_TRACE, "%s(%u): Wandering: No Targets within my sight range of %um", \
416  m_isWandering = true;
417  }
418 
419  SystemBubble* pBubble = m_npc->SysBubble();
420 
421  // wandering. nothing to shoot. look for target.
422  if (pBubble->IsAnomaly() or pBubble->IsIncursion() or pBubble->IsMission()) {
423  return;
424  } else if (pBubble->HasDynamics() and pBubble->IsBelt()) {
425  // pick random entity and loosely orbit it. if no entity found, orbit center of belt
426  SystemEntity* pSE = pBubble->GetRandomEntity();
427  if (pSE == nullptr)
428  pSE = m_npc->SystemMgr()->GetSE(sBubbleMgr.GetBeltID(pBubble->GetID()));
429  if (pSE == nullptr) {
430  _log(NPC__ERROR, "%s(%u): Wandering: No Target or beltSE found.", m_npc->GetName(), m_npc->GetID());
431  // nothing here...leave bubble
432  WarpOut();
433  return;
434  }
436  uint16 orbitDistance = MakeRandomInt(10000, 20000);
437  m_destiny->Orbit(pSE, orbitDistance);
438  _log(NPC__AI_TRACE, "%s(%u): Just for shits-n-giggles, I\'m gonna orbit %s(%u) at %um.", \
439  m_npc->GetName(), m_npc->GetID(), pSE->GetName(), pSE->GetID(), orbitDistance);
440  } else {
442  m_destiny->Stop();
443  }
444 }
SystemEntity * GetSE(uint32 entityID) const
bool IsBelt()
Definition: SystemBubble.h:64
#define _log(type, fmt,...)
Definition: logsys.h:124
bool m_isWandering
Definition: NPCAI.h:108
bool IsMission()
Definition: SystemBubble.h:67
bool IsAnomaly()
Definition: SystemBubble.h:66
SystemBubble * SysBubble()
Definition: SystemEntity.h:195
void SetMaxVelocity(float maxVelocity)
void WarpOut()
Definition: NPCAI.cpp:377
uint16 m_orbitSpeed
Definition: NPCAI.h:124
bool IsIncursion()
Definition: SystemBubble.h:68
SystemEntity * GetRandomEntity()
DestinyManager * m_destiny
Definition: NPCAI.h:146
SystemManager * SystemMgr()
Definition: SystemEntity.h:196
SpawnMgr * GetSpawnMgr()
Definition: NPC.h:82
uint16 GetID()
Definition: SystemBubble.h:91
uint32 GetID()
Definition: SystemEntity.h:207
const char * GetName() const
Definition: SystemEntity.h:210
NPC * m_npc
Definition: NPCAI.h:145
bool HasDynamics() const
Definition: SystemBubble.h:87
int64 MakeRandomInt(int64 low, int64 high)
Generates random integer from interval [low; high].
Definition: misc.cpp:109
void Orbit(SystemEntity *pSE, uint32 distance=0)
uint32 m_sightRange
Definition: NPCAI.h:134
#define sBubbleMgr
unsigned __int16 uint16
Definition: eve-compat.h:48

Here is the call graph for this function:

Here is the caller graph for this function:

void NPCAIMgr::Target ( SystemEntity pSE)

Definition at line 587 of file NPCAI.cpp.

References _log, CheckDistance(), Timer::Disable(), Timer::Enabled(), SystemEntity::GetID(), SystemEntity::GetName(), GetTargetTime(), m_attackSpeed, m_beginFindTarget, m_launcherCycleTime, m_mainAttackTimer, m_maxLockedTargets, m_missileTimer, m_npc, m_sightRange, SetChasing(), SetIdle(), Timer::Start(), TargetManager::StartTargeting(), and SystemEntity::TargetMgr().

Referenced by Process().

587  {
588  if (pSE == nullptr)
589  return;
590  float targetTime = GetTargetTime();
591  bool chase = false;
592 
593  if (!m_npc->TargetMgr()->StartTargeting(pSE, targetTime, m_maxLockedTargets, m_sightRange, chase)) {
594  if (chase) {
595  _log(NPC__AI_TRACE, "%s(%u): Targeting of %s(%u) failed. Begin Chasing.", \
596  m_npc->GetName(), m_npc->GetID(), pSE->GetName(), pSE->GetID());
597  SetChasing(pSE);
598  } else {
599  _log(NPC__AI_TRACE, "%s(%u): Targeting of %s(%u) failed. Clear Target and Return to Idle.", \
600  m_npc->GetName(), m_npc->GetID(), pSE->GetName(), pSE->GetID());
601  SetIdle();
602  }
603  return;
604  }
606  CheckDistance(pSE);
607 
608  if (!m_mainAttackTimer.Enabled())
610 
611  if (!m_missileTimer.Enabled() and (m_launcherCycleTime > 100))
613 }
#define _log(type, fmt,...)
Definition: logsys.h:124
void SetIdle()
Definition: NPCAI.cpp:446
void Disable()
Definition: timer.h:39
uint16 m_launcherCycleTime
Definition: NPCAI.h:122
float GetTargetTime()
Definition: NPCAI.cpp:830
TargetManager * TargetMgr()
Definition: SystemEntity.h:197
Timer m_mainAttackTimer
Definition: NPCAI.h:152
void CheckDistance(SystemEntity *pSE)
Definition: NPCAI.cpp:554
Timer m_missileTimer
Definition: NPCAI.h:153
Timer m_beginFindTarget
Definition: NPCAI.h:156
bool Enabled() const
Definition: timer.h:41
void SetChasing(SystemEntity *pSE)
Definition: NPCAI.cpp:478
uint32 GetID()
Definition: SystemEntity.h:207
const char * GetName() const
Definition: SystemEntity.h:210
uint16 m_attackSpeed
Definition: NPCAI.h:120
NPC * m_npc
Definition: NPCAI.h:145
uint32 m_sightRange
Definition: NPCAI.h:134
uint8 m_maxLockedTargets
Definition: NPCAI.h:118
bool StartTargeting(SystemEntity *tSE, ShipItemRef sRef)
void Start(uint32 setTimerTime=0, bool changeResetTimer=true)
Definition: timer.cpp:81

Here is the call graph for this function:

Here is the caller graph for this function:

void NPCAIMgr::Targeted ( SystemEntity pSE)
Todo:
determine if new targetedby entity is weaker than current target. use optimalSigRadius to test for 'optimal' target

Definition at line 615 of file NPCAI.cpp.

References _log, NPCAI::State::Chasing, Timer::Disable(), Timer::Enabled(), NPCAI::State::Engaged, NPCAI::State::Fleeing, NPCAI::State::Following, SystemEntity::GetID(), SystemEntity::GetName(), GetStateName(), GetTargetTime(), NPCAI::State::Idle, m_armorRepairDelayChance, m_armorRepairDuration, m_armorRepairTimer, m_beginFindTarget, m_maxLockedTargets, m_npc, m_shieldBoosterDelayChance, m_shieldBoosterDuration, m_shieldBoosterTimer, m_sightRange, m_state, MakeRandomFloat(), SetChasing(), SetIdle(), NPCAI::State::Signaling, Timer::Start(), TargetManager::StartTargeting(), and SystemEntity::TargetMgr().

Referenced by NPC::TargetedAdd().

615  {
616  if (pSE == nullptr)
617  return;
618  double targetTime = GetTargetTime();
619 
620  _log(NPC__AI_TRACE, "%s(%u): Targeted by %s(%u) while %s.", \
621  m_npc->GetName(), m_npc->GetID(), pSE->GetName(), pSE->GetID(), GetStateName(m_state).c_str());
622 
623  switch(m_state) {
624  case NPCAI::State::Idle: {
625  _log(NPC__AI_TRACE, "%s(%u): Begin Approaching and start Targeting sequence.", \
626  m_npc->GetName(), m_npc->GetID(), pSE->GetName(), pSE->GetID());
627  SetChasing(pSE);
628 
629  bool chase = false;
630  if (!m_npc->TargetMgr()->StartTargeting( pSE, targetTime, m_maxLockedTargets, m_sightRange, chase)) {
631  if (chase) {
632  _log(NPC__AI_TRACE, "%s(%u): Targeting of %s(%u) failed. Begin Chasing.", \
633  m_npc->GetName(), m_npc->GetID(), pSE->GetName(), pSE->GetID());
634  SetChasing(pSE);
635  } else {
636  _log(NPC__AI_TRACE, "%s(%u): Targeting of %s(%u) failed. Clear Target and Return to Idle.", \
637  m_npc->GetName(), m_npc->GetID(), pSE->GetName(), pSE->GetID());
638  SetIdle();
639  }
640  }
642  //CheckDistance(pAgressor);
643  } break;
644 
646  case NPCAI::State::Chasing: {
647  } break;
649  } break;
650  case NPCAI::State::Engaged: {
651  } break;
652  case NPCAI::State::Fleeing: {
653  } break;
655  } break;
656  }
663 }
#define _log(type, fmt,...)
Definition: logsys.h:124
void SetIdle()
Definition: NPCAI.cpp:446
void Disable()
Definition: timer.h:39
float GetTargetTime()
Definition: NPCAI.cpp:830
Timer m_armorRepairTimer
Definition: NPCAI.h:155
double MakeRandomFloat(double low, double high)
Generates random real from interval [low; high].
Definition: misc.cpp:114
Timer m_shieldBoosterTimer
Definition: NPCAI.h:154
TargetManager * TargetMgr()
Definition: SystemEntity.h:197
uint16 m_armorRepairDuration
Definition: NPCAI.h:128
Timer m_beginFindTarget
Definition: NPCAI.h:156
bool Enabled() const
Definition: timer.h:41
void SetChasing(SystemEntity *pSE)
Definition: NPCAI.cpp:478
uint32 GetID()
Definition: SystemEntity.h:207
uint16 m_shieldBoosterDuration
Definition: NPCAI.h:129
const char * GetName() const
Definition: SystemEntity.h:210
float m_armorRepairDelayChance
Definition: NPCAI.h:139
NPC * m_npc
Definition: NPCAI.h:145
std::string GetStateName(int8 stateID)
Definition: NPCAI.cpp:860
uint32 m_sightRange
Definition: NPCAI.h:134
uint8 m_maxLockedTargets
Definition: NPCAI.h:118
int8 m_state
Definition: NPCAI.h:101
bool StartTargeting(SystemEntity *tSE, ShipItemRef sRef)
float m_shieldBoosterDelayChance
Definition: NPCAI.h:140
void Start(uint32 setTimerTime=0, bool changeResetTimer=true)
Definition: timer.cpp:81

Here is the call graph for this function:

Here is the caller graph for this function:

void NPCAIMgr::TargetLost ( SystemEntity pSE)
Todo:
engage weakest target in current list

Definition at line 665 of file NPCAI.cpp.

References _log, Attack(), NPCAI::State::Chasing, NPCAI::State::Engaged, NPCAI::State::Following, TargetManager::GetFirstTarget(), SystemEntity::GetID(), SystemEntity::GetName(), TargetManager::HasNoTargets(), m_npc, m_state, SetIdle(), and SystemEntity::TargetMgr().

Referenced by NPC::TargetLost().

665  {
666  if (pSE == nullptr)
667  return;
668  switch(m_state) {
671  case NPCAI::State::Engaged: {
672  // implement chance for npc to follow warping player
673  // sConfig.npc.WarpFollowChance;
674  // NPCAI::State::WarpFollow
675  if (m_npc->TargetMgr()->HasNoTargets()) {
676  _log(NPC__AI_TRACE, "%s(%u): Target %s(%u) lost. No targets remain. Return to Idle.", \
677  m_npc->GetName(), m_npc->GetID(), pSE->GetName(), pSE->GetID());
678  SetIdle();
679  } else {
680  _log(NPC__AI_TRACE, "%s(%u): Target %s(%u) lost, but more targets remain.", \
681  m_npc->GetName(), m_npc->GetID(), pSE->GetName(), pSE->GetID());
684  }
685  }
686  }
687 }
#define _log(type, fmt,...)
Definition: logsys.h:124
void SetIdle()
Definition: NPCAI.cpp:446
void Attack(SystemEntity *pSE)
Definition: NPCAI.cpp:689
TargetManager * TargetMgr()
Definition: SystemEntity.h:197
SystemEntity * GetFirstTarget(bool need_locked=false)
uint32 GetID()
Definition: SystemEntity.h:207
const char * GetName() const
Definition: SystemEntity.h:210
NPC * m_npc
Definition: NPCAI.h:145
bool HasNoTargets() const
int8 m_state
Definition: NPCAI.h:101

Here is the call graph for this function:

Here is the caller graph for this function:

void NPCAIMgr::WarpOut ( )
protected
Todo:
eventually, this will check with anomaly mgr for possible npc hideouts in system based on npc faction, system, players in system, players in bubble, and more later to determine a warpto target for this npc, or this group

for now, if there are players in system, just warp to another belt. if there are no players in this system, avoid using proc tics on npcs

Definition at line 377 of file NPCAI.cpp.

References Timer::Disable(), SystemBubble::GetID(), SystemEntity::GetPosition(), SystemManager::GetRandBeltID(), SystemManager::GetSE(), NPC::GetSpawnMgr(), NPCAI::State::Idle, m_destiny, m_npc, m_state, m_warpOutTimer, SpawnMgr::MoveSpawn(), SystemManager::PlayerCount(), sBubbleMgr, SystemEntity::SysBubble(), SystemEntity::SystemMgr(), NPCAI::State::WarpOut, and DestinyManager::WarpTo().

Referenced by SetWander().

378 {
380 
383  return;
384  }
385 
387  SystemManager* pSys = m_npc->SystemMgr();
388 
397  if (pSys->PlayerCount()) {
398  // pSys->GetAnomMgr();
399  uint32 newBeltID = pSys->GetRandBeltID();
400  if (newBeltID == sBubbleMgr.GetBeltID(m_npc->SysBubble()->GetID()))
401  newBeltID = pSys->GetRandBeltID();
402 
403  SystemEntity* newSE = pSys->GetSE(newBeltID);
404  m_destiny->WarpTo(newSE->GetPosition());
405  m_npc->GetSpawnMgr()->MoveSpawn(m_npc, sBubbleMgr.FindBubble(newSE));
406  }
407 }
SystemEntity * GetSE(uint32 entityID) const
void Disable()
Definition: timer.h:39
SystemBubble * SysBubble()
Definition: SystemEntity.h:195
uint32 GetRandBeltID()
const GPoint & GetPosition() const
Definition: SystemEntity.h:211
void MoveSpawn(NPC *pNPC, SystemBubble *pBubble)
Definition: SpawnMgr.cpp:141
DestinyManager * m_destiny
Definition: NPCAI.h:146
SystemManager * SystemMgr()
Definition: SystemEntity.h:196
SpawnMgr * GetSpawnMgr()
Definition: NPC.h:82
uint16 GetID()
Definition: SystemBubble.h:91
uint32 PlayerCount()
unsigned __int32 uint32
Definition: eve-compat.h:50
NPC * m_npc
Definition: NPCAI.h:145
void WarpTo(const GPoint &where, int32 distance=0, bool autoPilot=false, SystemEntity *pSE=nullptr)
#define sBubbleMgr
Timer m_warpOutTimer
Definition: NPCAI.h:157
int8 m_state
Definition: NPCAI.h:101

Here is the call graph for this function:

Here is the caller graph for this function:

void NPCAIMgr::WarpOutComplete ( )
inline

Definition at line 80 of file NPCAI.h.

References Timer::Disable(), NPCAI::State::Idle, m_state, and m_warpOutTimer.

Referenced by DestinyManager::WarpStop().

void Disable()
Definition: timer.h:39
Timer m_warpOutTimer
Definition: NPCAI.h:157
int8 m_state
Definition: NPCAI.h:101

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

float NPCAIMgr::m_armorRepairDelayChance
private

Definition at line 139 of file NPCAI.h.

Referenced by NPCAIMgr(), and Targeted().

uint16 NPCAIMgr::m_armorRepairDuration
private

Definition at line 128 of file NPCAI.h.

Referenced by NPCAIMgr(), and Targeted().

Timer NPCAIMgr::m_armorRepairTimer
private

Definition at line 155 of file NPCAI.h.

Referenced by DisableRepTimers(), Process(), SetIdle(), and Targeted().

uint16 NPCAIMgr::m_attackSpeed
private

Definition at line 120 of file NPCAI.h.

Referenced by AttackTarget(), NPCAIMgr(), Process(), and Target().

Timer NPCAIMgr::m_beginFindTarget
private

Definition at line 156 of file NPCAI.h.

Referenced by Process(), SetIdle(), Target(), and Targeted().

uint16 NPCAIMgr::m_boostRange
private

Definition at line 127 of file NPCAI.h.

Referenced by CheckDistance(), and NPCAIMgr().

double NPCAIMgr::m_damageMultiplier
private

Definition at line 143 of file NPCAI.h.

Referenced by AttackTarget(), and NPCAIMgr().

DestinyManager* NPCAIMgr::m_destiny
private
uint32 NPCAIMgr::m_falloff
private

Definition at line 132 of file NPCAI.h.

Referenced by GetFalloff(), NPCAIMgr(), SetFollowing(), and SetSignaling().

uint32 NPCAIMgr::m_flyRange
private

Definition at line 133 of file NPCAI.h.

Referenced by CheckDistance(), and NPCAIMgr().

TurretFormulas NPCAIMgr::m_formula
private

Definition at line 149 of file NPCAI.h.

Referenced by AttackTarget().

bool NPCAIMgr::m_isWandering
private

Definition at line 108 of file NPCAI.h.

Referenced by CheckDistance(), NPCAIMgr(), Process(), and SetWander().

uint16 NPCAIMgr::m_launcherCycleTime
private

Definition at line 122 of file NPCAI.h.

Referenced by NPCAIMgr(), and Target().

Timer NPCAIMgr::m_mainAttackTimer
private

Definition at line 152 of file NPCAI.h.

Referenced by Attack(), SetIdle(), and Target().

uint32 NPCAIMgr::m_maxAttackRange
private

Definition at line 135 of file NPCAI.h.

Referenced by GetAttackRange(), and NPCAIMgr().

uint8 NPCAIMgr::m_maxAttackTargets
private

Definition at line 117 of file NPCAI.h.

Referenced by NPCAIMgr().

uint8 NPCAIMgr::m_maxLockedTargets
private

Definition at line 118 of file NPCAI.h.

Referenced by NPCAIMgr(), Target(), and Targeted().

uint16 NPCAIMgr::m_maxSpeed
private

Definition at line 119 of file NPCAI.h.

Referenced by NPCAIMgr(), SetChasing(), and SetFleeing().

Timer NPCAIMgr::m_missileTimer
private

Definition at line 153 of file NPCAI.h.

Referenced by Attack(), Process(), SetIdle(), and Target().

uint16 NPCAIMgr::m_missileTypeID
private

Definition at line 121 of file NPCAI.h.

Referenced by NPCAIMgr(), and Process().

uint16 NPCAIMgr::m_optimalRange
private

Definition at line 126 of file NPCAI.h.

Referenced by GetOptimalRange(), NPCAIMgr(), and SetEngaged().

uint16 NPCAIMgr::m_orbitSpeed
private

Definition at line 124 of file NPCAI.h.

Referenced by NPCAIMgr(), SetEngaged(), SetFollowing(), SetIdle(), SetSignaling(), and SetWander().

uint16 NPCAIMgr::m_preferedSigRadius
private

Definition at line 114 of file NPCAI.h.

Referenced by NPCAIMgr().

Timer NPCAIMgr::m_processTimer
private

Definition at line 151 of file NPCAI.h.

InventoryItemRef NPCAIMgr::m_self
private

Definition at line 147 of file NPCAI.h.

Referenced by AttackTarget(), GetTargetTime(), LaunchMissile(), MissileLaunched(), and NPCAIMgr().

float NPCAIMgr::m_shieldBoosterDelayChance
private

Definition at line 140 of file NPCAI.h.

Referenced by NPCAIMgr(), and Targeted().

uint16 NPCAIMgr::m_shieldBoosterDuration
private

Definition at line 129 of file NPCAI.h.

Referenced by NPCAIMgr(), and Targeted().

Timer NPCAIMgr::m_shieldBoosterTimer
private

Definition at line 154 of file NPCAI.h.

Referenced by DisableRepTimers(), Process(), SetIdle(), and Targeted().

uint32 NPCAIMgr::m_sightRange
private

Definition at line 134 of file NPCAI.h.

Referenced by CheckDistance(), NPCAIMgr(), Process(), SetWander(), Target(), and Targeted().

uint32 NPCAIMgr::m_sigRadius
private

Definition at line 131 of file NPCAI.h.

Referenced by NPCAIMgr().

uint16 NPCAIMgr::m_sigResolution
private

Definition at line 123 of file NPCAI.h.

Referenced by GetSigRes(), and NPCAIMgr().

float NPCAIMgr::m_switchTargChance
private

Definition at line 113 of file NPCAI.h.

Referenced by NPCAIMgr().

uint16 NPCAIMgr::m_targetRange
private

Definition at line 125 of file NPCAI.h.

double NPCAIMgr::m_trackingSpeed
private

Definition at line 142 of file NPCAI.h.

Referenced by GetTrackingSpeed(), and NPCAIMgr().

bool NPCAIMgr::m_useSecondTarget
private

Definition at line 111 of file NPCAI.h.

Referenced by NPCAIMgr().

bool NPCAIMgr::m_useSigRadius
private

Definition at line 109 of file NPCAI.h.

Referenced by NPCAIMgr().

bool NPCAIMgr::m_useTargSwitching
private

Definition at line 110 of file NPCAI.h.

Referenced by NPCAIMgr().

Timer NPCAIMgr::m_warpOutTimer
private
bool NPCAIMgr::m_warpScram
private

Definition at line 107 of file NPCAI.h.

Referenced by NPCAIMgr().

Timer NPCAIMgr::m_warpScramblerTimer
private

Definition at line 158 of file NPCAI.h.

Referenced by SetIdle().

float NPCAIMgr::m_warpScramChance
private

Definition at line 138 of file NPCAI.h.

Referenced by NPCAIMgr().

uint32 NPCAIMgr::m_warpScramRange
private

Definition at line 136 of file NPCAI.h.

Referenced by NPCAIMgr().

bool NPCAIMgr::m_webber
private

Definition at line 106 of file NPCAI.h.

Referenced by NPCAIMgr().

Timer NPCAIMgr::m_webifierTimer
private

Definition at line 159 of file NPCAI.h.

Referenced by SetIdle().


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