• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetTarget函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetTarget函数的典型用法代码示例。如果您正苦于以下问题:C++ GetTarget函数的具体用法?C++ GetTarget怎么用?C++ GetTarget使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetTarget函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: GetTarget

Tracking::Target VisionTablesFrisbeeAimer::GetMediumRightTarget() {
	return GetTarget("medium_right");
}
开发者ID:MrWilson1,项目名称:skyline-robotics,代码行数:3,代码来源:FrisbeeAimer.cpp


示例2: HandleProc

 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
 {
     PreventDefaultAction();
     GetTarget()->CastSpell(GetTarget(), SPELL_PRIEST_ITEM_EFFICIENCY, true, NULL, aurEff);
 }
开发者ID:GlassFace,项目名称:XC_CORE,代码行数:5,代码来源:spell_priest.cpp


示例3: HandleDummyTick

 void HandleDummyTick(AuraEffect const* aurEff)
 {
     GetTarget()->CastSpell((Unit*)NULL, aurEff->GetAmount(), true);
 }
开发者ID:Abrek,项目名称:My-WoDCore-6.x.x,代码行数:4,代码来源:shadowfang_keep.cpp


示例4: OnApply

 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
 {
     if (Unit* target = GetTarget())
         target->CastSpell(target, SPELL_JOKKUM_SUMMON, true);
 }
开发者ID:GlassFace,项目名称:LegacyCore_6.x.x,代码行数:5,代码来源:zone_storm_peaks.cpp


示例5: HandlePeriodic

 void HandlePeriodic(AuraEffect const* /* aurEff */)
 {
     if (++_counter == 5)
         GetTarget()->CastSpell((Unit*)NULL, SPELL_DESPAWN_RIFT, true);
 }
开发者ID:GlassFace,项目名称:LegacyCore_6.x.x,代码行数:5,代码来源:zone_storm_peaks.cpp


示例6: OnPeriodic

 void OnPeriodic(AuraEffect const* /*aurEff*/)
 {
     GetTarget()->RemoveAuraFromStack(GetId());
 }
开发者ID:Zerothustra,项目名称:TrinityCore,代码行数:4,代码来源:spell_holiday.cpp


示例7: OnApply

 void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
 {
     GetTarget()->RemoveAura(SPELL_RAM_FATIGUE);
 }
开发者ID:Zerothustra,项目名称:TrinityCore,代码行数:4,代码来源:spell_holiday.cpp


示例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);
 }
开发者ID:redlaine,项目名称:InfinityCore-Ark,代码行数:6,代码来源:boss_devourer_of_souls.cpp


示例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;

//.........这里部分代码省略.........
开发者ID:xxauroraxx,项目名称:Source.Python,代码行数:101,代码来源:npc_hydra.cpp


示例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);
                                }
                            }
                        }
                    }
                }
            }
        }
开发者ID:hamza77500,项目名称:TrinityCore,代码行数:63,代码来源:boss_twin_valkyr.cpp


示例11: OnRemove

 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
 {
     Unit* target = GetTarget();
     target->CastSpell(target, SPELL_RAM_LEVEL_NEUTRAL, true);
 }
开发者ID:Zerothustra,项目名称:TrinityCore,代码行数:5,代码来源:spell_holiday.cpp


示例12: OnApply

 void OnApply(constAuraEffectPtr /*aurEff*/, AuraEffectHandleModes /*mode*/)
 {
     Unit* target = GetTarget();
     target->SetStandState(UNIT_STAND_STATE_SIT);
     target->CastSpell(target, SPELL_MEAL_PERIODIC, false);
 }
开发者ID:AwkwardDev,项目名称:SurgeCore-505,代码行数:6,代码来源:spell_holiday.cpp


示例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);
 }
开发者ID:SingularityCore,项目名称:Singularity,代码行数:6,代码来源:spell_druid.cpp


示例14: HandleDummyTick

 void HandleDummyTick(AuraEffect const* aurEff)
 {
     GetCaster()->CastCustomSpell(SPELL_MARK_OF_THE_FACELESS_LEECH, SPELLVALUE_BASE_POINT1, aurEff->GetAmount(), GetTarget(), true);
 }
开发者ID:Firearm,项目名称:TrinityCore,代码行数:4,代码来源:boss_general_vezax.cpp


示例15: OnRemove

 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
 {
     if (GetTarget()->isAlive())
         GetTarget()->CastSpell(GetTarget(), SPELL_SLAG_IMBUED, true);
 }
开发者ID:AlucardVoss,项目名称:Patchs,代码行数:5,代码来源:boss_ignis.cpp


示例16: Absorb

 void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
 {
     // reduces all damage taken while stun, fear or silence
     if (GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_FLEEING | UNIT_FLAG_SILENCED) || (GetTarget()->GetUInt32Value(UNIT_FIELD_FLAGS) & (UNIT_FLAG_STUNNED) && GetTarget()->HasAuraWithMechanic(1<<MECHANIC_STUN)))
         absorbAmount = CalculatePctN(dmgInfo.GetDamage(), absorbPct);
 }
开发者ID:Anubisss,项目名称:ngrealmd,代码行数:6,代码来源:spell_shaman.cpp


示例17: IGetTargetDrawInterface

void    pfGUIControlMod::UpdateBounds( hsMatrix44 *invXformMatrix, bool force )
{
    hsMatrix44  xformMatrix, projMatrix;
    hsPoint3    corners[ 8 ];
    int         i;


    if( ( !fBoundsValid || force ) && fDialog && GetTarget() )
    {
        plDrawInterface *DI = IGetTargetDrawInterface( 0 );
        if( DI == nil )
            return;

        if( HasFlag( kBetterHitTesting ) )
        {
            hsTArray<hsPoint3>  scrnPoints;

            // Create a list of points to make a 2D convex hull from
            GetObjectPoints( GetTarget(), scrnPoints );
            hsMatrix44 l2w = GetTarget()->GetLocalToWorld();
            for( i = 0; i < scrnPoints.GetCount(); i++ )
            {
                scrnPoints[ i ] = l2w * scrnPoints[ i ];
                scrnPoints[ i ] = fDialog->WorldToScreenPoint( scrnPoints[ i ] );
            }

            // Now create a convex hull from them, assuming the Zs are all the same
            int numPoints = scrnPoints.GetCount();
            if( !CreateConvexHull( scrnPoints.AcquireArray(), numPoints ) )
                return;

            // Copy & store. Also recalc our bounding box just for fun
            fBounds.MakeEmpty();
            fBoundsPoints.SetCount( numPoints );
            for( i = 0; i < numPoints; i++ )
            {
                fBoundsPoints[ i ] = scrnPoints[ i ];
                fBounds.Union( &fBoundsPoints[ i ] );
            }
        }
        else
        {
            fBounds.MakeEmpty();

            hsBounds3Ext worldBounds = DI->GetLocalBounds();
            hsMatrix44 l2w = GetTarget()->GetLocalToWorld();
            worldBounds.Transform( &l2w );

            worldBounds.GetCorners( corners );
            for( i = 0; i < 8; i++ )
            {
                hsPoint3 scrnPt = fDialog->WorldToScreenPoint( corners[ i ] );
                fBounds.Union( &scrnPt );
            }
        }

        // Calc center Z
//      if( !fCenterValid )
        {
#if 0
            corners[ 1 ] = GetTarget()->GetLocalToWorld().GetTranslate();
            float w = corners[ 1 ].fX * fXformMatrix.fMap[3][0]
                    + corners[ 1 ].fY * fXformMatrix.fMap[3][1]
                    + corners[ 1 ].fZ * fXformMatrix.fMap[3][2]
                    + 1.f * fXformMatrix.fMap[3][3];
            corners[ 1 ] = fXformMatrix * corners[ 1 ];

            corners[ 1 ].fX = ( ( corners[ 1 ].fX / corners[ 1 ].fZ ) + 1.f ) / 2.f;
            corners[ 1 ].fY = ( ( corners[ 1 ].fY / corners[ 1 ].fZ ) + 1.f ) / 2.f;
            fScreenCenter = corners[ 1 ];

//          fScreenCenter.fZ = w;


            corners[ 1 ] = GetTarget()->GetLocalToWorld().GetTranslate();
            fDialog->WorldToScreenPoint( corners[ 1 ].fX, corners[ 1 ].fY, corners[ 1 ].fZ, fScreenCenter );
            fCenterValid = true;
#else
            corners[ 1 ] = GetTarget()->GetLocalToWorld().GetTranslate();
            fScreenCenter = fDialog->WorldToScreenPoint( corners[ 1 ] );
            corners[ 1 ] = fScreenCenter;
            fCenterValid = true;
#endif
        }

        fScreenMinZ = fBounds.GetMins().fZ;

        // Manually change the bounds so we know the z ranges from at least -1 to 1, suitable for us testing against for clicks
        corners[ 0 ] = fBounds.GetCenter();
        corners[ 0 ].fZ = -1.f;
        fBounds.Union( &corners[ 0 ] );
        corners[ 0 ].fZ = 1.f;
        fBounds.Union( &corners[ 0 ] );

        fBoundsValid = true;
    }
}
开发者ID:Drakesinger,项目名称:Plasma,代码行数:97,代码来源:pfGUIControlMod.cpp


示例18: HandleExtraEffect

 void HandleExtraEffect(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
 {
     if (Unit* caster = GetCaster())
         if (Creature* creCaster = caster->ToCreature())
             CAST_AI(boss_ick::boss_ickAI, creCaster->AI())->_ResetThreat(GetTarget());
 }
开发者ID:Kaitynlol,项目名称:ArcanumCore,代码行数:6,代码来源:boss_krickandick.cpp


示例19: CheckProc

 bool CheckProc(ProcEventInfo& /*eventInfo*/)
 {
     _procTarget = GetTarget()->GetOwner();
     return _procTarget != nullptr;
 }
开发者ID:GlassFace,项目名称:XC_CORE,代码行数:5,代码来源:spell_priest.cpp


示例20: OnRemove

 void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
 {
     GetTarget()->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false);
     GetTarget()->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, false);
 }
开发者ID:Kaitynlol,项目名称:ArcanumCore,代码行数:5,代码来源:boss_krickandick.cpp



注:本文中的GetTarget函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetTargetApplication函数代码示例发布时间:2022-05-30
下一篇:
C++ GetTalentSpellPos函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap