EvEmu
0.8.4
11 September 2021
|
#include "NPCAI.h"
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 |
NPCAIMgr::NPCAIMgr | ( | NPC * | who | ) |
have data...needs coding... chase duration/distance timers ewar shit, including point/tackle
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.
|
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().
|
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().
|
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().
|
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().
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().
|
inline |
Definition at line 79 of file NPCAI.h.
References Timer::Disable(), and m_warpOutTimer.
|
inline |
|
inline |
Definition at line 74 of file NPCAI.h.
References m_falloff.
Referenced by TurretFormulas::GetNPCToHit().
|
inline |
Definition at line 72 of file NPCAI.h.
References m_optimalRange.
Referenced by TurretFormulas::GetNPCToHit().
|
inline |
Definition at line 73 of file NPCAI.h.
References m_sigResolution.
Referenced by TurretFormulas::GetNPCToHit().
|
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().
|
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().
|
inline |
Definition at line 76 of file NPCAI.h.
References m_trackingSpeed.
Referenced by TurretFormulas::GetNPCToHit().
bool NPCAIMgr::IsFighting | ( | ) |
Definition at line 372 of file NPCAI.cpp.
References NPCAI::State::Idle, and m_state.
|
inline |
Definition at line 70 of file NPCAI.h.
References NPCAI::State::Idle, and m_state.
Referenced by DestinyManager::BeginMovement().
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().
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().
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().
|
protected |
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().
|
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().
|
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().
|
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().
|
protected |
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().
|
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.
|
protected |
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().
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().
void NPCAIMgr::Targeted | ( | SystemEntity * | pSE | ) |
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().
void NPCAIMgr::TargetLost | ( | SystemEntity * | pSE | ) |
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().
|
protected |
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().
|
inline |
Definition at line 80 of file NPCAI.h.
References Timer::Disable(), NPCAI::State::Idle, m_state, and m_warpOutTimer.
Referenced by DestinyManager::WarpStop().
|
private |
Definition at line 139 of file NPCAI.h.
Referenced by NPCAIMgr(), and Targeted().
|
private |
Definition at line 128 of file NPCAI.h.
Referenced by NPCAIMgr(), and Targeted().
|
private |
Definition at line 155 of file NPCAI.h.
Referenced by DisableRepTimers(), Process(), SetIdle(), and Targeted().
|
private |
Definition at line 120 of file NPCAI.h.
Referenced by AttackTarget(), NPCAIMgr(), Process(), and Target().
|
private |
|
private |
Definition at line 127 of file NPCAI.h.
Referenced by CheckDistance(), and NPCAIMgr().
|
private |
Definition at line 143 of file NPCAI.h.
Referenced by AttackTarget(), and NPCAIMgr().
|
private |
Definition at line 146 of file NPCAI.h.
Referenced by AttackTarget(), Process(), SetChasing(), SetEngaged(), SetFleeing(), SetFollowing(), SetIdle(), SetSignaling(), SetWander(), and WarpOut().
|
private |
Definition at line 132 of file NPCAI.h.
Referenced by GetFalloff(), NPCAIMgr(), SetFollowing(), and SetSignaling().
|
private |
Definition at line 133 of file NPCAI.h.
Referenced by CheckDistance(), and NPCAIMgr().
|
private |
Definition at line 149 of file NPCAI.h.
Referenced by AttackTarget().
|
private |
Definition at line 108 of file NPCAI.h.
Referenced by CheckDistance(), NPCAIMgr(), Process(), and SetWander().
|
private |
Definition at line 122 of file NPCAI.h.
Referenced by NPCAIMgr(), and Target().
|
private |
|
private |
Definition at line 135 of file NPCAI.h.
Referenced by GetAttackRange(), and NPCAIMgr().
|
private |
Definition at line 117 of file NPCAI.h.
Referenced by NPCAIMgr().
|
private |
Definition at line 118 of file NPCAI.h.
Referenced by NPCAIMgr(), Target(), and Targeted().
|
private |
Definition at line 119 of file NPCAI.h.
Referenced by NPCAIMgr(), SetChasing(), and SetFleeing().
|
private |
|
private |
Definition at line 121 of file NPCAI.h.
Referenced by NPCAIMgr(), and Process().
|
private |
Definition at line 145 of file NPCAI.h.
Referenced by Attack(), AttackTarget(), CheckDistance(), ClearTarget(), LaunchMissile(), Process(), SetChasing(), SetEngaged(), SetFleeing(), SetFollowing(), SetIdle(), SetSignaling(), SetWander(), Target(), Targeted(), TargetLost(), and WarpOut().
|
private |
Definition at line 126 of file NPCAI.h.
Referenced by GetOptimalRange(), NPCAIMgr(), and SetEngaged().
|
private |
Definition at line 124 of file NPCAI.h.
Referenced by NPCAIMgr(), SetEngaged(), SetFollowing(), SetIdle(), SetSignaling(), and SetWander().
|
private |
Definition at line 114 of file NPCAI.h.
Referenced by NPCAIMgr().
|
private |
Definition at line 147 of file NPCAI.h.
Referenced by AttackTarget(), GetTargetTime(), LaunchMissile(), MissileLaunched(), and NPCAIMgr().
|
private |
Definition at line 140 of file NPCAI.h.
Referenced by NPCAIMgr(), and Targeted().
|
private |
Definition at line 129 of file NPCAI.h.
Referenced by NPCAIMgr(), and Targeted().
|
private |
Definition at line 154 of file NPCAI.h.
Referenced by DisableRepTimers(), Process(), SetIdle(), and Targeted().
|
private |
Definition at line 134 of file NPCAI.h.
Referenced by CheckDistance(), NPCAIMgr(), Process(), SetWander(), Target(), and Targeted().
|
private |
Definition at line 131 of file NPCAI.h.
Referenced by NPCAIMgr().
|
private |
Definition at line 123 of file NPCAI.h.
Referenced by GetSigRes(), and NPCAIMgr().
|
protected |
Definition at line 101 of file NPCAI.h.
Referenced by CheckDistance(), IsFighting(), IsIdle(), Process(), SetChasing(), SetEngaged(), SetFleeing(), SetFollowing(), SetIdle(), SetSignaling(), Targeted(), TargetLost(), WarpOut(), and WarpOutComplete().
|
private |
Definition at line 113 of file NPCAI.h.
Referenced by NPCAIMgr().
|
private |
Definition at line 142 of file NPCAI.h.
Referenced by GetTrackingSpeed(), and NPCAIMgr().
|
private |
Definition at line 111 of file NPCAI.h.
Referenced by NPCAIMgr().
|
private |
Definition at line 109 of file NPCAI.h.
Referenced by NPCAIMgr().
|
private |
Definition at line 110 of file NPCAI.h.
Referenced by NPCAIMgr().
|
private |
Definition at line 157 of file NPCAI.h.
Referenced by DisableWarpOutTimer(), Process(), SetChasing(), SetEngaged(), SetFleeing(), SetFollowing(), SetIdle(), SetSignaling(), WarpOut(), and WarpOutComplete().
|
private |
Definition at line 107 of file NPCAI.h.
Referenced by NPCAIMgr().
|
private |
|
private |
Definition at line 138 of file NPCAI.h.
Referenced by NPCAIMgr().
|
private |
Definition at line 136 of file NPCAI.h.
Referenced by NPCAIMgr().
|
private |
Definition at line 106 of file NPCAI.h.
Referenced by NPCAIMgr().
|
private |