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

C# IUnitAction类代码示例

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

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



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


示例16: CanProcBeTriggeredBy

		public override bool CanProcBeTriggeredBy(IUnitAction action)
		{
			return action.Spell != null && action.Spell.DispelType == DispelType.Disease &&
				action.Spell != m_spellEffect.TriggerSpell;	// prevent infinite loop
		}
开发者ID:KroneckerX,项目名称:WCell,代码行数:5,代码来源:ProcOnDiseaseTriggerSpellHandler.cs


示例17: CanProcBeTriggeredBy

 public override bool CanProcBeTriggeredBy(IUnitAction action)
 {
     // only trigger when critical
     return action.IsCritical;
 }
开发者ID:ebakkedahl,项目名称:WCell,代码行数:5,代码来源:ProcTriggerSpellOnCritHandler.cs


示例18: Trigger

		/// <summary>
		/// Casts the given spell on the given targets within this SpellCast's context.
		/// Finds targets automatically if the given targets are null.
		/// </summary>
		public void Trigger(SpellId spell, SpellEffect triggerEffect, IUnitAction triggerAction = null, params WorldObject[] targets)
		{
			Trigger(SpellHandler.Get(spell), triggerEffect, triggerAction, targets);
		}
开发者ID:primax,项目名称:WCell,代码行数:8,代码来源:SpellCast.cs


示例19: OnProc

		public override void OnProc(Unit triggerer, IUnitAction action)
		{
			// "causes affected targets to heal themselves for $s1% of their total health when they critically hit with a melee or ranged attack."
			action.Attacker.HealPercent(EffectValue, m_aura.CasterUnit, m_spellEffect);

			if (action.Attacker == m_aura.CasterUnit)
			{
				// "In addition, you gain $s2% of your maximum mana when you benefit from this heal."
				action.Attacker.EnergizePercent(EffectValue * 2, m_aura.CasterUnit, m_spellEffect);
			}
		}
开发者ID:primax,项目名称:WCell,代码行数:11,代码来源:DruidFeralCombatFixes.cs


示例20: ValidateAndTriggerNew

		/// <summary>
		/// 
		/// </summary>
		public static void ValidateAndTriggerNew(Spell spell, Unit caster, WorldObject target, SpellChannel usedChannel = null,
			Item usedItem = null, IUnitAction action = null, SpellEffect triggerEffect = null)
		{
			ValidateAndTriggerNew(spell, caster.SharedReference, caster, target, usedChannel, usedItem, action, triggerEffect);
		}
开发者ID:primax,项目名称:WCell,代码行数:8,代码来源:SpellCast.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# IUnitDef类代码示例发布时间:2022-05-24
下一篇:
C# IUnit类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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