本文整理汇总了C#中Aura.World.World.MabiCreature.Has方法的典型用法代码示例。如果您正苦于以下问题:C# MabiCreature.Has方法的具体用法?C# MabiCreature.Has怎么用?C# MabiCreature.Has使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Aura.World.World.MabiCreature
的用法示例。
在下文中一共展示了MabiCreature.Has方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DealManaDamage
/// <summary>
/// Reduces given damage if Mana Shield is active and returns the total
/// mana damage. Also cancels Mana Shield if Mana is insufficent and
/// reduces mana on target.
/// </summary>
/// <param name="target"></param>
/// <param name="damage"></param>
/// <returns></returns>
public static float DealManaDamage(MabiCreature target, ref float damage)
{
if (!target.Has(CreatureConditionA.ManaShield))
return 0;
var skill = target.Skills.Get(SkillConst.ManaShield);
if (skill == null)
return 0;
// Var 1 = Efficiency
var manaDamage = damage / skill.RankInfo.Var1;
if (target.Mana >= manaDamage)
damage = 0;
else
{
damage -= (manaDamage - target.Mana) * skill.RankInfo.Var1;
manaDamage = target.Mana;
}
target.Mana -= manaDamage;
if (target.Mana <= 0)
SkillManager.GetHandler(SkillConst.ManaShield).Stop(target, skill, null);
return manaDamage;
}