本文整理汇总了C++中GetTarget函数的典型用法代码示例。如果您正苦于以下问题:C++ GetTarget函数的具体用法?C++ GetTarget怎么用?C++ GetTarget使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetTarget函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetTarget
Tracking::Target VisionTablesFrisbeeAimer::GetMediumRightTarget() {
return GetTarget("medium_right");
}
示例2: HandleProc
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
{
PreventDefaultAction();
GetTarget()->CastSpell(GetTarget(), SPELL_PRIEST_ITEM_EFFICIENCY, true, NULL, aurEff);
}
示例3: HandleDummyTick
void HandleDummyTick(AuraEffect const* aurEff)
{
GetTarget()->CastSpell((Unit*)NULL, aurEff->GetAmount(), true);
}
示例4: OnApply
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (Unit* target = GetTarget())
target->CastSpell(target, SPELL_JOKKUM_SUMMON, true);
}
示例5: HandlePeriodic
void HandlePeriodic(AuraEffect const* /* aurEff */)
{
if (++_counter == 5)
GetTarget()->CastSpell((Unit*)NULL, SPELL_DESPAWN_RIFT, true);
}
示例6: OnPeriodic
void OnPeriodic(AuraEffect const* /*aurEff*/)
{
GetTarget()->RemoveAuraFromStack(GetId());
}
示例7: OnApply
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
GetTarget()->RemoveAura(SPELL_RAM_FATIGUE);
}
示例8: HandleProc
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
int32 damage = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), 45));
GetTarget()->CastCustomSpell(SPELL_MIRRORED_SOUL_DAMAGE, SPELLVALUE_BASE_POINT0, damage, GetCaster(), true);
}
示例9: switch
void CNPC_Hydra::RunTask( const Task_t *pTask )
{
switch( pTask->iTask )
{
case TASK_HYDRA_DEPLOY:
{
m_flHeadGoalInfluence = 1.0;
float dist = (EyePosition() - m_vecHeadGoal).Length();
if (dist < m_idealSegmentLength)
{
TaskComplete();
}
AimHeadInTravelDirection( 0.2 );
}
break;
case TASK_HYDRA_PREP_STAB:
{
int i;
if (m_body.Count() < 2)
{
TaskFail( "hydra is too short to begin stab" );
return;
}
CBaseEntity *pTarget = GetTarget();
if (pTarget == NULL)
{
TaskFail( FAIL_NO_TARGET );
}
if (pTarget->IsPlayer())
{
m_vecTarget = pTarget->EyePosition( );
}
else
{
m_vecTarget = pTarget->BodyTarget( EyePosition( ) );
}
float distToTarget = (m_vecTarget - m_vecHeadGoal).Length();
float distToBase = (m_vecHeadGoal - GetAbsOrigin()).Length();
m_idealLength = distToTarget + distToBase * 0.5;
if (m_idealLength > HYDRA_MAX_LENGTH)
m_idealLength = HYDRA_MAX_LENGTH;
if (distToTarget < 100.0)
{
m_vecTargetDir = (m_vecTarget - m_vecHeadGoal);
VectorNormalize( m_vecTargetDir );
m_vecHeadGoal = m_vecHeadGoal - m_vecTargetDir * (100 - distToTarget) * 0.5;
}
else if (distToTarget > 200.0)
{
m_vecTargetDir = (m_vecTarget - m_vecHeadGoal);
VectorNormalize( m_vecTargetDir );
m_vecHeadGoal = m_vecHeadGoal - m_vecTargetDir * (200.0 - distToTarget) * 0.5;
}
// face enemy
m_vecTargetDir = (m_vecTarget - m_body[m_body.Count()-1].vecPos);
VectorNormalize( m_vecTargetDir );
m_vecHeadDir = m_vecHeadDir * 0.6 + m_vecTargetDir * 0.4;
VectorNormalize( m_vecHeadDir.GetForModify() );
// build tension towards strike time
float influence = 1.0 - (m_flTaskEndTime - gpGlobals->curtime) / pTask->flTaskData;
if (influence > 1)
influence = 1.0;
influence = influence * influence * influence;
m_flHeadGoalInfluence = influence;
// keep head segment straight
i = m_body.Count() - 2;
m_body[i].vecGoalPos = m_vecHeadGoal - m_vecHeadDir * m_body[i].flActualLength;
m_body[i].flGoalInfluence = influence;
// curve neck into spiral
float distBackFromHead = m_body[i].flActualLength;
Vector right, up;
VectorVectors( m_vecHeadDir, right, up );
for (i = i - 1; i > 1 && distBackFromHead < distToTarget; i--)
{
distBackFromHead += m_body[i].flActualLength;
float r = (distBackFromHead / 200) * 3.1415 * 2;
// spiral
Vector p0 = m_vecHeadGoal
- m_vecHeadDir * distBackFromHead * 0.5
+ cos( r ) * m_body[i].flActualLength * right
+ sin( r ) * m_body[i].flActualLength * up;
//.........这里部分代码省略.........
示例10: Absorb
void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & /*absorbAmount*/)
{
if (Unit* owner = GetUnitOwner())
{
if (dmgInfo.GetSpellInfo())
{
if (uint32 poweringUp = sSpellMgr->GetSpellIdForDifficulty(SPELL_POWERING_UP, owner))
{
if (urand(0, 99) < 5)
GetTarget()->CastSpell(GetTarget(), spellId, true);
// Twin Vortex part
uint32 lightVortex = sSpellMgr->GetSpellIdForDifficulty(SPELL_LIGHT_VORTEX_DAMAGE, owner);
uint32 darkVortex = sSpellMgr->GetSpellIdForDifficulty(SPELL_DARK_VORTEX_DAMAGE, owner);
int32 stacksCount = int32(dmgInfo.GetSpellInfo()->Effects[EFFECT_0].CalcValue()) * 0.001 - 1;
if (lightVortex && darkVortex && stacksCount)
{
if (dmgInfo.GetSpellInfo()->Id == darkVortex || dmgInfo.GetSpellInfo()->Id == lightVortex)
{
Aura* pAura = owner->GetAura(poweringUp);
if (pAura)
{
pAura->ModStackAmount(stacksCount);
owner->CastSpell(owner, poweringUp, true);
}
else
{
owner->CastSpell(owner, poweringUp, true);
if (Aura* pTemp = owner->GetAura(poweringUp))
pTemp->ModStackAmount(stacksCount);
}
}
}
// Picking floating balls
uint32 unleashedDark = sSpellMgr->GetSpellIdForDifficulty(SPELL_UNLEASHED_DARK, owner);
uint32 unleashedLight = sSpellMgr->GetSpellIdForDifficulty(SPELL_UNLEASHED_LIGHT, owner);
if (unleashedDark && unleashedLight)
{
if (dmgInfo.GetSpellInfo()->Id == unleashedDark || dmgInfo.GetSpellInfo()->Id == unleashedLight)
{
// need to do the things in this order, else players might have 100 charges of Powering Up without anything happening
Aura* pAura = owner->GetAura(poweringUp);
if (pAura)
{
// 2 lines together add the correct amount of buff stacks
pAura->ModStackAmount(stacksCount);
owner->CastSpell(owner, poweringUp, true);
}
else
{
owner->CastSpell(owner, poweringUp, true);
if (Aura* pTemp = owner->GetAura(poweringUp))
pTemp->ModStackAmount(stacksCount);
}
}
}
}
}
}
}
示例11: OnRemove
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* target = GetTarget();
target->CastSpell(target, SPELL_RAM_LEVEL_NEUTRAL, true);
}
示例12: OnApply
void OnApply(constAuraEffectPtr /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
Unit* target = GetTarget();
target->SetStandState(UNIT_STAND_STATE_SIT);
target->CastSpell(target, SPELL_MEAL_PERIODIC, false);
}
示例13: Absorb
void Absorb(AuraEffect * /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
{
// reduces all damage taken while Stunned in Cat Form
if (GetTarget()->GetShapeshiftForm() == FORM_CAT && GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_STUNNED) && GetTarget()->HasAuraWithMechanic(1<<MECHANIC_STUN))
absorbAmount = CalculatePctN(dmgInfo.GetDamage(), absorbPct);
}
示例14: HandleDummyTick
void HandleDummyTick(AuraEffect const* aurEff)
{
GetCaster()->CastCustomSpell(SPELL_MARK_OF_THE_FACELESS_LEECH, SPELLVALUE_BASE_POINT1, aurEff->GetAmount(), GetTarget(), true);
}
示例15: OnRemove
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (GetTarget()->isAlive())
GetTarget()->CastSpell(GetTarget(), SPELL_SLAG_IMBUED, true);
}