AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
Acore::WorldObjectSpellConeTargetCheck Struct Reference

#include "Spell.h"

Inheritance diagram for Acore::WorldObjectSpellConeTargetCheck:
Acore::WorldObjectSpellAreaTargetCheck Acore::WorldObjectSpellTargetCheck

Public Member Functions

 WorldObjectSpellConeTargetCheck (float coneAngle, float range, WorldObject *caster, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionList *condList)
 
bool operator() (WorldObject *target)
 
- Public Member Functions inherited from Acore::WorldObjectSpellAreaTargetCheck
 WorldObjectSpellAreaTargetCheck (float range, Position const *position, WorldObject *caster, WorldObject *referer, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionList *condList, Acore::WorldObjectSpellAreaTargetSearchReason searchReason=Acore::WorldObjectSpellAreaTargetSearchReason::Area, SpellTargetReferenceTypes referenceType=TARGET_REFERENCE_TYPE_CASTER)
 
bool operator() (WorldObject *target)
 
- Public Member Functions inherited from Acore::WorldObjectSpellTargetCheck
 WorldObjectSpellTargetCheck (WorldObject *caster, WorldObject *referer, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionList *condList)
 
 ~WorldObjectSpellTargetCheck ()
 
bool operator() (WorldObject *target)
 

Public Attributes

float _coneAngle
 
- Public Attributes inherited from Acore::WorldObjectSpellAreaTargetCheck
float _range
 
Position const * _position
 
Acore::WorldObjectSpellAreaTargetSearchReason _searchReason
 
SpellTargetReferenceTypes _referenceType
 
- Public Attributes inherited from Acore::WorldObjectSpellTargetCheck
WorldObject * _caster
 
WorldObject * _referer
 
SpellInfo const * _spellInfo
 
SpellTargetCheckTypes _targetSelectionType
 
ConditionSourceInfo * _condSrcInfo
 
ConditionList * _condList
 

Detailed Description

Constructor & Destructor Documentation

◆ WorldObjectSpellConeTargetCheck()

Acore::WorldObjectSpellConeTargetCheck::WorldObjectSpellConeTargetCheck ( float  coneAngle,
float  range,
WorldObject *  caster,
SpellInfo const *  spellInfo,
SpellTargetCheckTypes  selectionType,
ConditionList *  condList 
)
9512 : WorldObjectSpellAreaTargetCheck(range, caster, caster, caster, spellInfo, selectionType, condList), _coneAngle(coneAngle)
9513 {
9514 }
WorldObjectSpellAreaTargetCheck(float range, Position const *position, WorldObject *caster, WorldObject *referer, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionList *condList, Acore::WorldObjectSpellAreaTargetSearchReason searchReason=Acore::WorldObjectSpellAreaTargetSearchReason::Area, SpellTargetReferenceTypes referenceType=TARGET_REFERENCE_TYPE_CASTER)
Definition Spell.cpp:9441
float _coneAngle
Definition Spell.h:851

Member Function Documentation

◆ operator()()

bool Acore::WorldObjectSpellConeTargetCheck::operator() ( WorldObject *  target)
9517 {
9519 {
9520 if (!_caster->isInBack(target, _coneAngle))
9521 return false;
9522 }
9524 {
9525 if (!_caster->HasInLine(target, target->GetObjectSize(), _caster->GetObjectSize()))
9526 return false;
9527 }
9528 else
9529 {
9530 Unit* unitCaster = _caster->ToUnit();
9531 if ((!unitCaster || !unitCaster->IsWithinBoundaryRadius(target->ToUnit())) && !_caster->isInFront(target, _coneAngle))
9532 return false;
9533 }
9535 }
@ SPELL_ATTR0_CU_CONE_BACK
Definition SpellInfo.h:178
@ SPELL_ATTR0_CU_CONE_LINE
Definition SpellInfo.h:179
Unit * ToUnit()
Definition Object.h:216
bool HasAttribute(SpellAttr0 attribute) const
Definition SpellInfo.h:441
Definition Unit.h:665
bool IsWithinBoundaryRadius(Unit const *obj) const
Definition Unit.cpp:828
bool isInFront(WorldObject const *target, float arc=M_PI) const
Definition Object.cpp:1557
bool isInBack(WorldObject const *target, float arc=M_PI) const
Definition Object.cpp:1562
float GetObjectSize() const
Definition Object.cpp:2897
bool operator()(WorldObject *target)
Definition Spell.cpp:9447
SpellInfo const * _spellInfo
Definition Spell.h:818
WorldObject * _caster
Definition Spell.h:816
bool HasInLine(Position const *pos, float width) const
Definition Position.cpp:43

References Acore::WorldObjectSpellTargetCheck::_caster, _coneAngle, Acore::WorldObjectSpellTargetCheck::_spellInfo, WorldObject::GetObjectSize(), SpellInfo::HasAttribute(), Position::HasInLine(), WorldObject::isInBack(), WorldObject::isInFront(), Unit::IsWithinBoundaryRadius(), Acore::WorldObjectSpellAreaTargetCheck::operator()(), SPELL_ATTR0_CU_CONE_BACK, SPELL_ATTR0_CU_CONE_LINE, and Object::ToUnit().

Member Data Documentation

◆ _coneAngle

float Acore::WorldObjectSpellConeTargetCheck::_coneAngle

Referenced by operator()().


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