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


C# Creature.GetChainCastLevel方法代码示例

本文整理汇总了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;
		}
开发者ID:aura-project,项目名称:aura,代码行数:22,代码来源:MagicBolt.cs

示例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);
			}
		}
开发者ID:aura-project,项目名称:aura,代码行数:29,代码来源:MagicBolt.cs


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