当前位置: 首页>>代码示例>>C++>>正文


C++ SetHitDamage函数代码示例

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


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

示例1: RecalculateDamage

 void RecalculateDamage(SpellEffIndex /*effIndex*/)
 {
     if (GetHitUnit() && GetHitUnit()->HasAuraState(AURA_STATE_FROZEN, GetSpellInfo(), GetCaster()))
     {
         if (AuraEffect* aurEff = GetCaster()->GetAuraEffect(SPELL_AURA_DUMMY, SPELLFAMILY_MAGE, ICON_MAGE_SHATTER, EFFECT_1))
         {
             int32 damage = GetHitDamage();
             AddPct(damage, aurEff->GetAmount());
             SetHitDamage(damage);
         }
     }
 }
开发者ID:Ksenon,项目名称:multi_realm_cell,代码行数:12,代码来源:spell_mage.cpp

示例2: HandleDamage

            void HandleDamage(SpellEffIndex /*effIndex*/)
			{
				if(!GetCaster() || !GetHitUnit())
					return;

                PreventHitDamage();
                uint32 ticks = 1;
                if (constAuraEffectPtr aurEff = GetCaster()->GetAuraEffect(SPELL_BLADE_DANCE_AURA_2, EFFECT_0))
                    ticks = std::max(aurEff->GetTickNumber(), ticks);

                SetHitDamage(urand(11875, 13125) * ticks);
            }
开发者ID:Cailiaock,项目名称:5.4.7-Wow-source,代码行数:12,代码来源:boss_alizabal.cpp

示例3: HandleDamage

            void HandleDamage(SpellEffIndex /*effIndex*/)
            {
                int32 damage = GetEffectValue();
                ApplyPct(damage, GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK));

                if (Unit* target = GetHitUnit())
                {
                    damage = GetCaster()->SpellDamageBonusDone(target, GetSpellInfo(), uint32(damage), SPELL_DIRECT_DAMAGE);
                    damage = target->SpellDamageBonusTaken(GetCaster(), GetSpellInfo(), uint32(damage), SPELL_DIRECT_DAMAGE);
                }
                SetHitDamage(damage);
            }
开发者ID:ForesterDev,项目名称:trinitycore-m4a,代码行数:12,代码来源:spell_warrior.cpp

示例4: CalcDamage

            void CalcDamage()
            {
                int32 damage = GetHitDamage();
                if (Unit* target = GetHitUnit())
                    if (AuraEffect const* shockCharges = target->GetAuraEffect(SPELL_AMBER_SHOCK_CHARGE, EFFECT_0, GetCaster()->GetGUID()))
                    {
                        damage += shockCharges->GetAmount();
                        shockCharges->GetBase()->Remove();
                    }

                SetHitDamage(damage);
            }
开发者ID:GetPlay,项目名称:335source,代码行数:12,代码来源:oculus.cpp

示例5: RecalculateDamage

            void RecalculateDamage()
            {
                if (GetHitUnit()->getPowerType() != POWER_MANA)
                    return;

                const int32 maxDamage = GetCaster()->GetMap()->GetSpawnMode() == 1 ? 15000 : 10000;
                int32 newDamage = GetHitDamage();
                newDamage += GetHitUnit()->GetMaxPower(POWER_MANA)/2;
                newDamage = std::min<int32>(maxDamage, newDamage);

                SetHitDamage(newDamage);
            }
开发者ID:3kids,项目名称:TrinityCore,代码行数:12,代码来源:boss_bronjahm.cpp

示例6: CalculateDamage

            void CalculateDamage()
            {
                if (!GetHitUnit())
                    return;

                float radius = GetSpellInfo()->Effects[EFFECT_0].CalcRadius(GetCaster());
                if (!radius)
                    return;

                float distance = GetCaster()->GetDistance2d(GetHitUnit());
                if (distance > 1.0f)
                    SetHitDamage(int32(GetHitDamage() * ((radius - distance) / radius)));
            }
开发者ID:mryanlam,项目名称:Old-TrinityCore-Project-Script.me-,代码行数:13,代码来源:boss_gruul.cpp

示例7: HandleOnHit

            void HandleOnHit(SpellEffIndex effIndex)
            {
                if (Unit* caster = GetCaster())
                {
                    if (caster->HasAura(44544))
                        SetHitDamage(int32(GetHitDamage() * 1.25f));

                    if (GetHitUnit())
                        caster->SetIciclesTarget(GetHitUnit()->GetGUID());

                    caster->CastSpell(caster, SPELL_MAGE_ICICLE_PERIODIC_TRIGGER, true);
                }
            }
开发者ID:Cailiaock,项目名称:5.4.7-Wow-source,代码行数:13,代码来源:spell_mastery.cpp

示例8: DealDamage

        void DealDamage()
        {
            Unit* caster = GetCaster();
            Unit* target = GetHitUnit();

            if (!caster || !target)
                return;

            float distance = caster->GetExactDist2d(target);

            if (distance >= 0 && distance <= 60)
                SetHitDamage(GetHitDamage() * (distance / MAX_DIST));
        }
开发者ID:Grimtonz1337,项目名称:JadeCore,代码行数:13,代码来源:boss_feng.cpp

示例9: HandleOnHit

		void HandleOnHit()
		{
			if (Unit* caster = GetCaster())
			{
				int32 damage = GetHitDamage();

				// Mastery: Emberstorm
				if (AuraEffect* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_WARLOCK, 2129, EFFECT_0))
					AddPct(damage, aurEff->GetAmount());

				SetHitDamage(damage);
			}
		}
开发者ID:blitztech,项目名称:TrinityCore,代码行数:13,代码来源:warlock_spell.cpp

示例10: HandleOnHit

            void HandleOnHit()
            {
                if (Player* _player = GetCaster()->ToPlayer())
                {
                    if (Unit* unitTarget = GetHitUnit())
                    {
                        if (unitTarget->IsImmunedToSpellEffect(sSpellMgr->GetSpellInfo(WARRIOR_SPELL_STORM_BOLT_STUN), 0))
                            SetHitDamage(GetHitDamage() * 4);

                        _player->CastSpell(unitTarget, WARRIOR_SPELL_STORM_BOLT_STUN, true);
                    }
                }
            }
开发者ID:CATACLYSMDEV,项目名称:JadeCore-5.4.8-18291--dev-,代码行数:13,代码来源:spell_warrior.cpp

示例11: RecalculateDamage

            void RecalculateDamage(SpellEffIndex /*effIndex*/)
            {
                if (!GetCaster())
                    return;

                int32 baseDamages = GetHitDamage();

                int32 additionalDamages = GetCaster()->GetPower(POWER_ENERGY) * 100;

                SetHitDamage(baseDamages + additionalDamages);

                GetCaster()->SetPower(POWER_ENERGY, 0);
            }
开发者ID:DebugProject,项目名称:MistCore,代码行数:13,代码来源:boss_gunship_battle.cpp

示例12: HandleEffect

 void HandleEffect(SpellEffIndex effIndex)
 {
     if (Unit* caster = GetCaster())
     {
         if (Unit* target = GetHitUnit())
         {
             if (Aura* cancellingAura = target->GetAura(SPELL_NOISE_CANCELLING_BUFF))
             {
                 float reducePct = cancellingAura->GetEffect(1)->GetBaseAmount();
                 SetHitDamage(GetHitDamage() * (reducePct / 100));
             }
         }
     }
 }
开发者ID:ChipLeo,项目名称:SkyFire_5xx,代码行数:14,代码来源:boss_vizier_zorlock.cpp

示例13: ChangeDamage

            void ChangeDamage(SpellEffIndex /*effIndex*/)
            {
                int32 damage = GetHitDamage();

                // Because 1 Holy Power (HP) is consumed when casting spell,
                // GetPower(POWER_HOLY_POWER) will return 0 when player has 1 HP,
                // return 1 at 2 HP, and 2 at 3 HP
                int32 hp = GetCaster()->GetPower(POWER_HOLY_POWER);

                // Holy Power Scaling: 3 times damage at 2 HP, 6 times at 3 HP
                damage *= 0.5*hp*hp + 1.5*hp + 1;

                SetHitDamage(damage);
            }
开发者ID:Diyvol,项目名称:TrinityCore,代码行数:14,代码来源:spell_paladin.cpp

示例14: CalculateDamage

        void CalculateDamage(SpellEffIndex /*effIndex*/)
        {
            int32 damagePerCombo = GetHitDamage();
            if (AuraEffect const* t5 = GetCaster()->GetAuraEffect(SPELL_ROGUE_T5_2P_SET_BONUS, EFFECT_0))
                damagePerCombo += t5->GetAmount();

            int32 finalDamage = damagePerCombo;
            std::vector<SpellPowerCost> const& costs = GetSpell()->GetPowerCost();
            auto c = std::find_if(costs.begin(), costs.end(), [](SpellPowerCost const& cost) { return cost.Power == POWER_COMBO_POINTS; });
            if (c != costs.end())
                finalDamage *= c->Amount;

            SetHitDamage(finalDamage);
        }
开发者ID:090809,项目名称:TrinityCore,代码行数:14,代码来源:spell_rogue.cpp

示例15: DealDamage

            void DealDamage()
            {
                if (Unit* target = GetHitUnit())
                {
                    if (AuraPtr aura = target->GetAura(SPELL_JASPER_CHAINS))
                    {
                        uint8 stacks = aura->GetStackAmount();
                        int32 damage = GetHitDamage();

                        if (damage && stacks)
                            SetHitDamage(damage * stacks);
                    }
                }
            }
开发者ID:AlucardVoss,项目名称:Patchs,代码行数:14,代码来源:boss_stone_guard.cpp


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