本文整理汇总了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);
});
}
}
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
}
示例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);
}
}
}
}
示例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);
}
}
示例9: TriggerProc
public void TriggerProc(Unit triggerer, IUnitAction action)
{
if (trigger)
{
var dAction = action as DamageAction;
if (dAction.CanCrit)
{
dAction.AddBonusCritChance(modPercentage);
trigger = false;
}
}
}
示例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--;
});
}
示例11: CanProcBeTriggeredBy
/// <summary>
/// Whether this proc handler can be triggered by the given action
/// </summary>
public virtual bool CanProcBeTriggeredBy(IUnitAction action)
{
return true;
}
示例12: CanProcBeTriggeredBy
public override bool CanProcBeTriggeredBy(IUnitAction action)
{
// Check whether Improved LotP has been activated yet
return EffectValue > 0;
}
示例13: OnProc
public override void OnProc(Unit triggerer, IUnitAction action)
{
Owner.Energize(EffectValue, m_aura.CasterUnit, m_spellEffect);
}
示例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);
}
示例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();
}