當前位置: 首頁>>代碼示例>>C#>>正文


C# DamageAction.GetDamagePercent方法代碼示例

本文整理匯總了C#中WCell.RealmServer.Misc.DamageAction.GetDamagePercent方法的典型用法代碼示例。如果您正苦於以下問題:C# DamageAction.GetDamagePercent方法的具體用法?C# DamageAction.GetDamagePercent怎麽用?C# DamageAction.GetDamagePercent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WCell.RealmServer.Misc.DamageAction的用法示例。


在下文中一共展示了DamageAction.GetDamagePercent方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: OnAttack

		public override void OnAttack(DamageAction action)
		{
			//if (!action.IsDot)
			{
				var amount = action.GetDamagePercent(EffectValue);
				Owner.Heal(amount, m_aura.CasterUnit, m_spellEffect);
			}
		}
開發者ID:KroneckerX,項目名稱:WCell,代碼行數:8,代碼來源:LifeLeechPercentAuraHandler.cs

示例2: OnAttack

			public override void OnAttack(DamageAction action)
			{
				if (action.IsMagic)
				{
					// "Increases damage of all spells against targets with less than 35% health by $s1%."
					if (action.Victim.HealthPct <= 35)
					{
						action.Damage += action.GetDamagePercent(EffectValue);
					}
				}
			}
開發者ID:remixod,項目名稱:netServer,代碼行數:11,代碼來源:MageFireFixes.cs

示例3: OnDefend

			public override void OnDefend(DamageAction action)
			{
				// absorb EffectValue % from the damage
				var absorbed = Math.Min(action.GetDamagePercent(EffectValue), RemainingValue);

				// RemainingValue corresponds to AMZ's health, when it reaches 0, AMZ will be destroyed
				RemainingValue = action.Absorb(absorbed, (DamageSchoolMask)m_spellEffect.MiscValue);
			}
開發者ID:remixod,項目名稱:netServer,代碼行數:8,代碼來源:DeathKnightUnholyFixes.cs

示例4: OnAttack

			public override void OnAttack(DamageAction action)
			{
				var attacker = action.Attacker;		// same as Owner
				var victim = action.Victim;
				var dmg = action.GetDamagePercent(EffectValue);
				victim.AddMessage(() => victim.DealSpellDamage(attacker, m_spellEffect, dmg, false, false));	// may not crit
			}
開發者ID:remixod,項目名稱:netServer,代碼行數:7,代碼來源:DeathKnightUnholyFixes.cs

示例5: OnHit

        public override void OnHit(DamageAction action)
        {
            var chr = action.Attacker as Character;
            if (chr != null)
            {
                if (chr.Group != null)
                {
                    List<Character> origGroup = new List<Character>(chr.Group.GetAllCharacters());
                    List<Character> scrambledGroup = new List<Character>();

                    Random randNum = new Random();
                    int i = -1;
                    foreach (Character groupMember in origGroup)
                    {
                        i++;
                        if (groupMember == chr)
                            continue;
                        if (randNum.NextDouble() < (3 - scrambledGroup.Count / origGroup.Count - i))
                            scrambledGroup.Add(groupMember);
                    }
                    var effect = SpellHandler.Get(SpellId.DivineStorm_2).GetEffect(SpellEffectType.Heal);
                    foreach (Character target in scrambledGroup)
                        target.Heal(action.GetDamagePercent(25), chr, effect);
                }
            }
            base.OnHit(action);
        }
開發者ID:KroneckerX,項目名稱:WCell,代碼行數:27,代碼來源:PaladinRetributionFixes.cs


注:本文中的WCell.RealmServer.Misc.DamageAction.GetDamagePercent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。