本文整理汇总了C#中Aura.Channel.World.Entities.Creature.GetChainCastLevel方法的典型用法代码示例。如果您正苦于以下问题:C# Creature.GetChainCastLevel方法的具体用法?C# Creature.GetChainCastLevel怎么用?C# Creature.GetChainCastLevel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Aura.Channel.World.Entities.Creature
的用法示例。
在下文中一共展示了Creature.GetChainCastLevel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Ready
/// <summary>
/// Finishes preparing, adds stack.
/// </summary>
/// <param name="creature"></param>
/// <param name="skill"></param>
/// <param name="packet"></param>
/// <returns></returns>
public virtual bool Ready(Creature creature, Skill skill, Packet packet)
{
// Note: The client only prevents casting if stacks = max, if you go above the limit
// it lets you keep casting.
var addStacks = skill.RankData.Stack + creature.GetChainCastLevel(skill.Info.Id);
skill.Stacks = Math.Min(skill.RankData.StackMax, skill.Stacks + addStacks);
Send.Effect(creature, Effect.StackUpdate, EffectSkillName, (byte)skill.Stacks, (byte)0);
Send.Effect(creature, Effect.Casting, (short)skill.Info.Id, (byte)0, (byte)2, (short)0);
Send.SkillReady(creature, skill.Info.Id);
return true;
}
示例2: CustomPrepareUsage
/// <summary>
/// Custom usage of resources on Prepare, to account for chain
/// casting.
/// </summary>
/// <param name="creature"></param>
/// <param name="skill"></param>
public void CustomPrepareUsage(Creature creature, Skill skill)
{
var cost = skill.RankData.ManaPrepare;
if (cost == 0)
return;
var addedStacks = Math.Min(skill.RankData.StackMax - skill.Stacks, skill.RankData.Stack + creature.GetChainCastLevel(skill.Info.Id));
cost *= addedStacks;
var castTime = skill.GetCastTime();
if (castTime == 0)
{
creature.Mana += cost;
Send.StatUpdate(creature, StatUpdateType.Private, Stat.Mana);
}
else
{
var perSecond = (float)(cost / Math.Ceiling(castTime / 1000f) * (skill.RankData.NewLoadTime / 1000f));
var seconds = (int)(Math.Ceiling(castTime / 1000f) * 1000);
creature.Regens.Add(Stat.Mana, perSecond, creature.ManaMax, seconds);
}
}