EvEmu
0.8.4
11 September 2021
|
#include "DroneAI.h"
Public Member Functions | |
DroneAIMgr (DroneSE *who) | |
void | Process () |
void | Target (SystemEntity *by_who) |
void | Targeted (SystemEntity *by_who) |
void | TargetLost (SystemEntity *by_who) |
void | ClearTargets () |
void | ClearAllTargets () |
int8 | GetState () |
void | SetIdle () |
void | Return () |
void | AssignShip (ShipSE *pSE) |
Protected Member Functions | |
void | Attack (SystemEntity *pTarget) |
void | SetEngaged (SystemEntity *pTarget) |
void | ClearTarget (SystemEntity *pTarget) |
void | AttackTarget (SystemEntity *pTarget) |
void | CheckDistance (SystemEntity *pTarget) |
std::string | GetStateName (int8 stateID) |
Protected Attributes | |
int8 | m_state |
Private Attributes | |
double | m_sigRadius |
double | m_attackSpeed |
double | m_entityFlyRange |
double | m_entityOrbitRange |
double | m_entityChaseRange |
double | m_entityAttackRange |
uint32 | m_chaseSpeed |
uint32 | m_cruiseSpeed |
uint32 | m_targetRange |
uint32 | m_armorRepairDuration |
uint32 | m_shieldBoosterDuration |
DroneSE * | m_pDrone |
ShipSE * | m_assignedShip |
TurretFormulas | m_formula |
Timer | m_processTimer |
Timer | m_mainAttackTimer |
Timer | m_beginFindTarget |
Timer | m_warpScramblerTimer |
Timer | m_webifierTimer |
DroneAIMgr::DroneAIMgr | ( | DroneSE * | who | ) |
DroneAI.cpp this class is for drone AI
: Allan : 0.15 : 27Nov19
Definition at line 20 of file DroneAI.cpp.
References m_entityAttackRange, m_processTimer, and Timer::Start().
|
inline |
Definition at line 62 of file DroneAI.h.
References m_assignedShip.
Referenced by DroneSE::AssignShip(), DroneSE::Offline(), and DroneSE::Online().
|
protected |
Definition at line 285 of file DroneAI.cpp.
References _log, AttackTarget(), TargetManager::CanAttack(), Timer::Check(), ClearTarget(), SystemEntity::DestinyMgr(), SystemEntity::GetID(), SystemEntity::GetName(), SystemEntity::GetPosition(), SystemBubble::InBubble(), DestinyManager::IsCloaked(), m_mainAttackTimer, m_pDrone, SystemEntity::SysBubble(), and SystemEntity::TargetMgr().
Referenced by CheckDistance().
|
protected |
Definition at line 330 of file DroneAI.cpp.
References SystemEntity::ApplyDamage(), AttrDamageMultiplier, AttrGfxTurretID, SystemEntity::DestinyMgr(), EvilNumber::get_float(), EvilNumber::get_uint32(), InventoryItem::GetAttribute(), TurretFormulas::GetDroneToHit(), DroneSE::GetEM(), DroneSE::GetExplosive(), SystemEntity::GetID(), DroneSE::GetKinetic(), SystemEntity::GetSelf(), DroneSE::GetThermal(), InventoryItem::HasAttribute(), InventoryItem::itemID(), m_attackSpeed, m_formula, m_pDrone, sConfig, DestinyManager::SendSpecialEffect(), targetAttack, and InventoryItem::typeID().
Referenced by Attack().
|
protected |
Definition at line 174 of file DroneAI.cpp.
References _log, Attack(), ClearTarget(), Ga::GaVec3::distance(), Timer::Enabled(), SystemEntity::GetID(), SystemEntity::GetName(), SystemEntity::GetPosition(), DroneAI::State::Idle, m_attackSpeed, m_entityAttackRange, m_entityChaseRange, m_entityFlyRange, m_mainAttackTimer, m_pDrone, m_state, SetEngaged(), and Timer::Start().
Referenced by Process(), and Target().
void DroneAIMgr::ClearAllTargets | ( | ) |
Definition at line 206 of file DroneAI.cpp.
References TargetManager::ClearAllTargets(), m_pDrone, and SystemEntity::TargetMgr().
|
protected |
Definition at line 318 of file DroneAI.cpp.
References TargetManager::ClearTarget(), TargetManager::HasNoTargets(), m_pDrone, SetIdle(), and SystemEntity::TargetMgr().
Referenced by Attack(), and CheckDistance().
void DroneAIMgr::ClearTargets | ( | ) |
Definition at line 202 of file DroneAI.cpp.
References TargetManager::ClearTargets(), m_pDrone, and SystemEntity::TargetMgr().
int8 DroneAIMgr::GetState | ( | ) |
Definition at line 121 of file DroneAI.cpp.
References DroneAI::State::Assisting, DroneAI::State::Engaged, DroneAI::State::Guarding, DroneAI::State::Idle, DroneAI::State::Incapacitated, DroneAI::State::Invalid, m_state, and DroneAI::State::Unknown.
Referenced by DroneSE::GetState(), and DroneSE::StateChange().
|
protected |
Definition at line 363 of file DroneAI.cpp.
References DroneAI::State::Approaching, DroneAI::State::Assisting, DroneAI::State::Combat, DroneAI::State::Departing, DroneAI::State::Departing2, DroneAI::State::Engaged, DroneAI::State::Fleeing, DroneAI::State::Guarding, DroneAI::State::Idle, DroneAI::State::Incapacitated, DroneAI::State::Mining, DroneAI::State::Operating, DroneAI::State::Pursuit, and DroneAI::State::Unknown.
Referenced by Targeted().
void DroneAIMgr::Process | ( | ) |
Definition at line 48 of file DroneAI.cpp.
References _log, DroneAI::State::Approaching, DroneAI::State::Assisting, CheckDistance(), TargetManager::ClearTarget(), DroneAI::State::Combat, DroneAI::State::Departing, DroneAI::State::Departing2, Ga::GaVec3::distance(), Profile::drone, DroneAI::State::Engaged, DroneAI::State::Fleeing, TargetManager::GetFirstTarget(), SystemEntity::GetID(), SystemEntity::GetName(), SystemEntity::GetPosition(), GetTimeUSeconds(), DroneAI::State::Guarding, TargetManager::HasNoTargets(), DroneAI::State::Idle, DroneAI::State::Incapacitated, DroneAI::State::Invalid, m_assignedShip, m_entityOrbitRange, m_pDrone, m_state, DroneAI::State::Mining, DroneAI::State::Operating, DroneAI::State::Pursuit, sConfig, SetIdle(), sProfiler, SystemEntity::SysBubble(), SystemEntity::TargetMgr(), and DroneAI::State::Unknown.
Referenced by DroneSE::Process().
void DroneAIMgr::Return | ( | ) |
Definition at line 135 of file DroneAI.cpp.
References DroneAI::State::Departing, SystemEntity::DestinyMgr(), DestinyManager::Follow(), DroneSE::GetHomeShip(), m_assignedShip, m_chaseSpeed, m_entityOrbitRange, m_pDrone, m_state, and DestinyManager::SetMaxVelocity().
|
protected |
Definition at line 160 of file DroneAI.cpp.
References _log, SystemEntity::DestinyMgr(), DroneAI::State::Engaged, SystemEntity::GetID(), SystemEntity::GetName(), m_chaseSpeed, m_cruiseSpeed, m_entityOrbitRange, m_pDrone, m_state, MakeRandomFloat(), DestinyManager::Orbit(), and DestinyManager::SetMaxVelocity().
Referenced by CheckDistance().
void DroneAIMgr::SetIdle | ( | ) |
Definition at line 142 of file DroneAI.cpp.
References _log, Timer::Disable(), SystemEntity::GetID(), SystemEntity::GetName(), DroneAI::State::Idle, DroneSE::IdleOrbit(), m_assignedShip, m_beginFindTarget, m_mainAttackTimer, m_pDrone, m_state, m_warpScramblerTimer, and m_webifierTimer.
Referenced by ClearTarget(), ShipSE::LaunchDrone(), Process(), Target(), and TargetLost().
void DroneAIMgr::Target | ( | SystemEntity * | by_who | ) |
Definition at line 211 of file DroneAI.cpp.
References _log, AttrMaxAttackTargets, AttrScanSpeed, CheckDistance(), Timer::Disable(), EvilNumber::get_int(), EvilNumber::get_uint32(), InventoryItem::GetAttribute(), SystemEntity::GetID(), SystemEntity::GetName(), SystemEntity::GetSelf(), m_beginFindTarget, m_entityAttackRange, m_pDrone, SetIdle(), TargetManager::StartTargeting(), and SystemEntity::TargetMgr().
void DroneAIMgr::Targeted | ( | SystemEntity * | by_who | ) |
Definition at line 231 of file DroneAI.cpp.
References _log, DroneAI::State::Approaching, DroneAI::State::Assisting, DroneAI::State::Combat, DroneAI::State::Departing, DroneAI::State::Departing2, DroneAI::State::Engaged, DroneAI::State::Fleeing, SystemEntity::GetID(), SystemEntity::GetName(), GetStateName(), DroneAI::State::Guarding, DroneAI::State::Idle, DroneAI::State::Incapacitated, m_pDrone, m_state, DroneAI::State::Mining, DroneAI::State::Operating, DroneAI::State::Pursuit, and DroneAI::State::Unknown.
Referenced by DroneSE::TargetedAdd().
void DroneAIMgr::TargetLost | ( | SystemEntity * | by_who | ) |
Definition at line 266 of file DroneAI.cpp.
References _log, DroneAI::State::Engaged, SystemEntity::GetID(), SystemEntity::GetName(), TargetManager::HasNoTargets(), m_pDrone, m_state, SetIdle(), and SystemEntity::TargetMgr().
Referenced by DroneSE::TargetLost().
|
private |
|
private |
Definition at line 77 of file DroneAI.h.
Referenced by AttackTarget(), and CheckDistance().
|
private |
|
private |
Definition at line 83 of file DroneAI.h.
Referenced by Return(), and SetEngaged().
|
private |
Definition at line 84 of file DroneAI.h.
Referenced by SetEngaged().
|
private |
Definition at line 81 of file DroneAI.h.
Referenced by CheckDistance(), DroneAIMgr(), and Target().
|
private |
Definition at line 80 of file DroneAI.h.
Referenced by CheckDistance().
|
private |
Definition at line 78 of file DroneAI.h.
Referenced by CheckDistance().
|
private |
Definition at line 79 of file DroneAI.h.
Referenced by Process(), Return(), and SetEngaged().
|
private |
Definition at line 92 of file DroneAI.h.
Referenced by AttackTarget().
|
private |
Definition at line 95 of file DroneAI.h.
Referenced by Attack(), CheckDistance(), and SetIdle().
|
private |
Definition at line 89 of file DroneAI.h.
Referenced by Attack(), AttackTarget(), CheckDistance(), ClearAllTargets(), ClearTarget(), ClearTargets(), Process(), Return(), SetEngaged(), SetIdle(), Target(), Targeted(), and TargetLost().
|
private |
Definition at line 94 of file DroneAI.h.
Referenced by DroneAIMgr().
|
protected |
Definition at line 71 of file DroneAI.h.
Referenced by CheckDistance(), GetState(), Process(), Return(), SetEngaged(), SetIdle(), Targeted(), and TargetLost().
|
private |
|
private |