![]() |
AzerothCore 3.3.5a
OpenSource WoW Emulator
|
#include "CombatManager.h"
Static Public Member Functions | |
| static bool | CanBeginCombat (Unit const *a, Unit const *b) |
Static Public Attributes | |
| static constexpr uint32 | EVADE_TIMER_DURATION = 10 * IN_MILLISECONDS |
| static constexpr uint32 | EVADE_REGEN_DELAY = 5 * IN_MILLISECONDS |
Private Member Functions | |
| void | PutReference (ObjectGuid const &guid, CombatReference *ref) |
| void | PurgeReference (ObjectGuid const &guid, bool pvp) |
| bool | UpdateOwnerCombatState () const |
Static Private Member Functions | |
| static void | NotifyAICombat (Unit *me, Unit *other) |
Private Attributes | |
| Unit *const | _owner |
| EvadeState | _evadeState |
| uint32 | _evadeTimer |
| std::unordered_map< ObjectGuid, CombatReference * > | _pveRefs |
| std::unordered_map< ObjectGuid, PvPCombatReference * > | _pvpRefs |
Friends | |
| struct | CombatReference |
| struct | PvPCombatReference |
|
inline |
| CombatManager::~CombatManager | ( | ) |
References _owner, _pveRefs, _pvpRefs, ASSERT, Object::GetGUID(), and ObjectGuid::ToString().
|
delete |
References Unit::GetCharmerOrOwnerPlayerOrPlayerItself(), WorldObject::GetMap(), Unit::HasUnitState(), WorldObject::InSamePhase(), Unit::IsAlive(), Unit::IsCombatDisallowed(), Unit::IsFriendlyTo(), Player::IsGameMaster(), Object::IsInWorld(), UNIT_STATE_EVADE, and UNIT_STATE_IN_FLIGHT.
Referenced by RevalidateCombat(), and SetInCombatWith().
|
inline |
Referenced by UnitAI::EvadeTimerExpired().
|
inline |
Referenced by TestCreature::CleanupCombatState(), and Unit::ClearInCombat().
| void CombatManager::EndAllPvECombat | ( | ) |
References _owner, _pveRefs, ThreatManager::ClearAllThreat(), Unit::GetThreatMgr(), and ThreatManager::RemoveMeFromThreatLists().
Referenced by Unit::CombatStop().
| void CombatManager::EndAllPvPCombat | ( | ) |
| void CombatManager::EndCombatBeyondRange | ( | float | range, |
| bool | includingPvP = false |
||
| ) |
References _pveRefs, _pvpRefs, CombatReference::EndCombat(), CombatReference::first, WorldObject::IsWithinDistInMap(), and CombatReference::second.
Referenced by Player::Update().
| Unit * CombatManager::GetAnyTarget | ( | ) | const |
|
inline |
|
inline |
|
inline |
Referenced by debug_commandscript::HandleDebugCombatListCommand(), and Unit::SetImmuneToPC().
|
inline |
Referenced by debug_commandscript::HandleDebugCombatListCommand(), and UpdateOwnerCombatState().
| bool CombatManager::HasPvECombat | ( | ) | const |
| bool CombatManager::HasPvECombatWithPlayers | ( | ) | const |
| bool CombatManager::HasPvPCombat | ( | ) | const |
| void CombatManager::InheritCombatStatesFrom | ( | Unit const * | who | ) |
References _owner, _pveRefs, _pvpRefs, Unit::GetCombatManager(), Unit::HasUnitFlag(), Unit::IsImmuneToNPC(), Unit::IsImmuneToPC(), IsInCombatWith(), SetInCombatWith(), and UNIT_FLAG_PLAYER_CONTROLLED.
Referenced by Spell::DoSpellHitOnUnit().
|
inline |
References EVADE_STATE_NONE.
Referenced by Creature::IsNotReachableAndNeedRegen().
|
inline |
References EVADE_STATE_HOME.
| bool CombatManager::IsInCombatWith | ( | ObjectGuid const & | who | ) | const |
References _pveRefs, and _pvpRefs.
Referenced by ThreatManager::AddThreat(), InheritCombatStatesFrom(), IsInCombatWith(), Unit::IsInCombatWith(), and SetInCombatWith().
| bool CombatManager::IsInCombatWith | ( | Unit const * | who | ) | const |
References Object::GetGUID(), and IsInCombatWith().
|
inline |
References EVADE_STATE_NONE.
References Unit::GetAI().
Referenced by CombatReference::Refresh(), and SetInCombatWith().
|
delete |
|
private |
References _pveRefs, and _pvpRefs.
Referenced by CombatReference::EndCombat().
|
private |
References CombatReference::_isPvP, _owner, _pveRefs, _pvpRefs, ASSERT, Object::GetGUID(), and ObjectGuid::ToString().
Referenced by SetInCombatWith().
| void CombatManager::RevalidateCombat | ( | ) |
References _owner, _pveRefs, _pvpRefs, CanBeginCombat(), CombatReference::EndCombat(), CombatReference::GetOther(), and CombatReference::second.
| void CombatManager::SetEvadeState | ( | EvadeState | state | ) |
References _evadeState, _evadeTimer, _owner, EVADE_STATE_NONE, Unit::HasUnitFlag(), Unit::m_Controlled, and UNIT_FLAG_PLAYER_CONTROLLED.
Referenced by HomeMovementGenerator< Creature >::DoFinalize(), HomeMovementGenerator< Creature >::DoInitialize(), and StopEvade().
| bool CombatManager::SetInCombatWith | ( | Unit * | who, |
| bool | addSecondUnitSuppressed = false |
||
| ) |
References _owner, _pveRefs, _pvpRefs, CanBeginCombat(), CombatReference, Unit::GetCombatManager(), Object::GetGUID(), Unit::IsControlledByPlayer(), IsInCombatWith(), Acore::Containers::MapGetValuePtr(), NotifyAICombat(), PutReference(), PvPCombatReference, CombatReference::Suppress(), and UpdateOwnerCombatState().
Referenced by ThreatManager::AddThreat(), InheritCombatStatesFrom(), and Unit::SetInCombatWith().
|
inline |
Referenced by Creature::SetCannotReachTarget().
| void CombatManager::StopEvade | ( | ) |
References _evadeTimer, EVADE_STATE_NONE, and SetEvadeState().
Referenced by Creature::SetCannotReachTarget().
| void CombatManager::SuppressPvPCombat | ( | ) |
References _owner, _pvpRefs, Unit::GetAI(), and UpdateOwnerCombatState().
Referenced by Unit::CombatStop().
| void CombatManager::Update | ( | uint32 | tdiff | ) |
References _evadeTimer, _owner, _pvpRefs, CombatReference::EndCombat(), CombatReference::first, Unit::GetAI(), CombatReference::second, and PvPCombatReference::Update().
Referenced by Unit::Update().
|
private |
References _owner, Unit::AtDisengage(), Unit::AtEngage(), Unit::AtEnterCombat(), Unit::AtExitCombat(), GetAnyTarget(), Unit::GetCharmerOrOwner(), HasCombat(), Object::IsCreature(), Unit::IsInCombat(), Unit::RemoveUnitFlag(), Unit::SetUnitFlag(), sScriptMgr, Object::ToPlayer(), and UNIT_FLAG_IN_COMBAT.
Referenced by CombatReference::EndCombat(), CombatReference::Refresh(), SetInCombatWith(), CombatReference::SuppressFor(), and SuppressPvPCombat().
|
friend |
Referenced by SetInCombatWith().
|
friend |
Referenced by SetInCombatWith().
|
private |
Referenced by SetEvadeState().
|
private |
Referenced by SetEvadeState(), StopEvade(), and Update().
|
private |
|
private |
|
private |
|
staticconstexpr |
|
staticconstexpr |