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 
)
9526 : WorldObjectSpellAreaTargetCheck(range, caster, caster, caster, spellInfo, selectionType, condList), _coneAngle(coneAngle)
9527 {
9528 }
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:9455
float _coneAngle
Definition Spell.h:855

Member Function Documentation

◆ operator()()

bool Acore::WorldObjectSpellConeTargetCheck::operator() ( WorldObject *  target)
9531 {
9533 {
9534 if (!_caster->isInBack(target, _coneAngle))
9535 return false;
9536 }
9538 {
9539 if (!_caster->HasInLine(target, target->GetObjectSize(), _caster->GetObjectSize()))
9540 return false;
9541 }
9542 else
9543 {
9544 Unit* unitCaster = _caster->ToUnit();
9545 if ((!unitCaster || !unitCaster->IsWithinBoundaryRadius(target->ToUnit())) && !_caster->isInFront(target, _coneAngle))
9546 return false;
9547 }
9549 }
@ 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:667
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:2898
bool operator()(WorldObject *target)
Definition Spell.cpp:9461
SpellInfo const * _spellInfo
Definition Spell.h:822
WorldObject * _caster
Definition Spell.h:820
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: