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


C# IUnitAction类代码示例

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


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

示例1: OnProc

		public override void OnProc(Unit triggerer, IUnitAction action)
		{
			if (action is IDamageAction)
			{
				var owner = Owner;
				var dmgAction = ((IDamageAction)action);

				var healSelfAmount = ((dmgAction.Damage * EffectValue) + 50) / 100;	// don't forget rounding
				var healPartyAmount = (healSelfAmount + 3) / 5; // don't forget rounding

				owner.Heal(healSelfAmount, owner, SpellEffect);
				if (owner is Character)
				{
					var chr = (Character)owner;
					var group = chr.Group;
					if (group != null)
					{
						// heal all group members in same context (ie same Map in current implementation)
						group.CallOnAllInSameContext(chr.ContextHandler, (member) =>
						{
							member.Heal(healPartyAmount, owner, SpellEffect);
						});
					}
				}
			}
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:26,代码来源:PriestShadowFixes.cs

示例2: OnProc

		public override void OnProc(Unit target, IUnitAction action)
		{
			if (m_spellEffect.TriggerSpell == null)
			{
				log.Warn("Tried to trigger invalid Spell \"{0}\" from Aura {1}", 
					SpellEffect.TriggerSpellId, m_spellEffect.Spell);
			}
			else
			{
				Owner.SpellCast.ValidateAndTrigger(m_spellEffect.TriggerSpell, target);
			}
		}
开发者ID:WCellFR,项目名称:WCellFR,代码行数:12,代码来源:ProcTriggerSpell.cs

示例3: OnProc

		/// <summary>
		/// Called when a matching proc event triggers this proc handler with the given
		/// triggerer and action.
		/// </summary>
		public override void OnProc(Unit triggerer, IUnitAction action)
		{
			if (m_spellEffect.TriggerSpell == null)
			{
				//log.Warn("Tried to trigger invalid Spell \"{0}\" from Aura {1}", SpellEffect.TriggerSpellId, m_aura.Spell);
			}
			else
			{
				SpellCast.ValidateAndTriggerNew(m_spellEffect.TriggerSpell, m_aura.CasterReference, Owner, triggerer, 
					m_aura.Controller as SpellChannel, m_aura.UsedItem, action, m_spellEffect);
			}
		}
开发者ID:remixod,项目名称:netServer,代码行数:16,代码来源:ProcTriggerSpell.cs

示例4: OnProc

		public override void OnProc(Unit target, IUnitAction action)
		{
			var val = m_spellEffect.CalcEffectValue(m_aura.CasterInfo);

			if (action is IDamageAction)
			{
				((IDamageAction)action).Damage += val;
			}
			else
			{
				m_aura.Auras.Owner.DoSpellDamage(target, m_spellEffect, val);
			}
		}
开发者ID:pallmall,项目名称:WCell,代码行数:13,代码来源:ProcTriggerDamage.cs

示例5: OnProc

		public override void OnProc(Unit target, IUnitAction action)
		{
			if (m_spellEffect.TriggerSpell == null)
			{
				log.Warn("Tried to trigger invalid Spell \"{0}\" from Aura {1}", 
					SpellEffect.TriggerSpellId, m_spellEffect.Spell);
			}
			else
			{
				var owner = m_aura.Auras.Owner;
				//owner.SpellCast.Trigger(m_spellEffect.TriggerSpell, m_spellEffect, target);
				owner.SpellCast.Trigger(m_spellEffect.TriggerSpell, target);
			}
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:14,代码来源:ProcTiggerSpell.cs

示例6: OnProc

		public override void OnProc(Unit target, IUnitAction action)
		{
			var val = m_spellEffect.CalcEffectValue(m_aura.CasterInfo);

			//if (action is IDamageAction)
			//{
			//    ((IDamageAction)action).Damage += val;
			//}
			//else
			{
				if (Owner.MayAttack(target))
				{
					Owner.DoSpellDamage(target, m_spellEffect, val);
				}
			}
		}
开发者ID:ray2006,项目名称:WCell,代码行数:16,代码来源:ProcTriggerDamage.cs

示例7: OnProc

			public override void OnProc(Unit triggerer, IUnitAction action)
			{
				var chr = action.Attacker as Character;
				if (chr != null)
				{
					var runes = chr.PlayerSpells.Runes;
					if (runes != null)
					{
						// convert one of each "From rune" to "To rune" (if not on cooldown)
						foreach (var rune in From)
						{
							runes.Convert(rune, To);
						}
					}
				}
			}
开发者ID:remixod,项目名称:netServer,代码行数:16,代码来源:DeathKnightFixes.cs

示例8: OnProc

        public override void OnProc(Unit triggerer, IUnitAction action)
        {
            var val = m_spellEffect.CalcEffectValue(m_aura.CasterReference);

            //if (action is IDamageAction)
            //{
            //    ((IDamageAction)action).Damage += val;
            //}
            //else

            if (Owner.MayAttack(triggerer))
            {
                Owner.DealSpellDamage(triggerer, m_spellEffect, val);
            }
            else
            {
                LogManager.GetCurrentClassLogger().Warn("Invalid damage effect on Spell {0} was triggered by {1} who cannot be attacked by Aura-Owner {2}.",
                    m_aura.Spell, triggerer, Owner);
            }
        }
开发者ID:ebakkedahl,项目名称:WCell,代码行数:20,代码来源:ProcTriggerDamage.cs

示例9: TriggerProc

 public void TriggerProc(Unit triggerer, IUnitAction action)
 {
     if (trigger)
     {
         var dAction = action as DamageAction;
         if (dAction.CanCrit)
         {
             dAction.AddBonusCritChance(modPercentage);
             trigger = false;
         }
     }
 }
开发者ID:Zakkgard,项目名称:WCell,代码行数:12,代码来源:MageArcaneFixes.cs

示例10: OnProc

		public override void OnProc(Unit triggerer, IUnitAction action)
		{
			var dmgAction = action as DamageAction;
			if (dmgAction == null) return;
			dmgAction.ReferenceCount++;

			Owner.AddMessage(() =>
			{
				var nextTarget = Owner.GetRandomVisibleUnit(Owner.MaxAttackRange, unit => Owner.MayAttack(unit) && unit != triggerer);
				if (nextTarget != null)
				{
					dmgAction.Victim = nextTarget;
					dmgAction.SpellEffect = m_spellEffect;
					triggerer.DoRawDamage(dmgAction);
				}
				// TODO: To ensure correct pooling, must ensure that reference count gets counted down
				// But object messages don't get executed if the object gets removed before execution
				dmgAction.ReferenceCount--;
			});
		}
开发者ID:Zerant,项目名称:WCell,代码行数:20,代码来源:WarriorArmsFixes.cs

示例11: CanProcBeTriggeredBy

		/// <summary>
		/// Whether this proc handler can be triggered by the given action
		/// </summary>
		public virtual bool CanProcBeTriggeredBy(IUnitAction action)
		{
			return true;
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:7,代码来源:AuraEffectHandler.cs

示例12: CanProcBeTriggeredBy

		public override bool CanProcBeTriggeredBy(IUnitAction action)
		{
			// Check whether Improved LotP has been activated yet
			return EffectValue > 0;
		}
开发者ID:primax,项目名称:WCell,代码行数:5,代码来源:DruidFeralCombatFixes.cs

示例13: OnProc

 public override void OnProc(Unit triggerer, IUnitAction action)
 {
     Owner.Energize(EffectValue, m_aura.CasterUnit, m_spellEffect);
 }
开发者ID:ebakkedahl,项目名称:WCell,代码行数:4,代码来源:ProcEnergizeHandler.cs

示例14: OnProc

		public override void OnProc(Unit triggerer, IUnitAction action)
		{
			// heal (and dispose automatically, since the single ProcCharge is used up)
			// "30% of the amount healed"
			Owner.Heal((damageAmount * 3 + 5) / 10, m_aura.CasterUnit, m_spellEffect);
		}
开发者ID:remixod,项目名称:netServer,代码行数:6,代码来源:DruidRestorationFixes.cs

示例15: ValidateAndTrigger

		public void ValidateAndTrigger(Spell spell, Unit triggerOwner, WorldObject target, IUnitAction action = null, SpellEffect triggerEffect = null)
		{
			WorldObject[] targets;

			if (triggerOwner == null)
			{
				LogManager.GetCurrentClassLogger().Warn("triggerOwner is null when trying to proc spell: {0} (target: {1})", spell, target);
				return;
			}

			if (spell.CasterIsTarget || !spell.HasTargets)
			{
				targets = new[] { triggerOwner };
			}
			else if (target != null)
			{
				if (spell.IsAreaSpell ||
					(spell.IsHarmfulFor(CasterReference, target)))
				{
					targets = null;
				}
				else
				{
					targets = new[] { target };
				}
			}
			else
			{
				targets = null;
			}

			if (action != null)
			{
				action.ReferenceCount++;
				TriggerAction = action;
			}

			Start(spell, triggerEffect, true, targets);
			//Dispose();
		}
开发者ID:primax,项目名称:WCell,代码行数:40,代码来源:SpellCast.cs


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