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


C# Skill.GetCastTime方法代码示例

本文整理汇总了C#中Skill.GetCastTime方法的典型用法代码示例。如果您正苦于以下问题:C# Skill.GetCastTime方法的具体用法?C# Skill.GetCastTime怎么用?C# Skill.GetCastTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Skill的用法示例。


在下文中一共展示了Skill.GetCastTime方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Prepare

		public bool Prepare(Creature creature, Skill skill, Packet packet)
		{
			Send.SkillFlashEffect(creature);
			Send.SkillPrepare(creature, skill.Info.Id, skill.GetCastTime());

			return true;
		}
开发者ID:tkiapril,项目名称:aura,代码行数:7,代码来源:SilentMove.cs

示例2: Prepare

		/// <summary>
		/// Prepares skill, showing a casting motion.
		/// </summary>
		/// <param name="creature"></param>
		/// <param name="skill"></param>
		/// <param name="packet"></param>
		/// <returns></returns>
		public virtual bool Prepare(Creature creature, Skill skill, Packet packet)
		{
			creature.StopMove();

			Send.Effect(creature, Effect.Casting, (short)skill.Info.Id, (byte)0, (byte)1, (short)0);
			Send.SkillPrepare(creature, skill.Info.Id, skill.GetCastTime());

			return true;
		}
开发者ID:ripxfrostbite,项目名称:aura,代码行数:16,代码来源:MagicBolt.cs

示例3: Prepare

		/// <summary>
		/// Prepares (loads) the skill.
		/// </summary>
		/// <param name="creature"></param>
		/// <param name="skill"></param>
		/// <param name="packet"></param>
		/// <returns></returns>
		public override bool Prepare(Creature creature, Skill skill, Packet packet)
		{
			Send.SkillFlashEffect(creature);
			Send.SkillPrepare(creature, skill.Info.Id, skill.GetCastTime());

			creature.CooldownManager.SetCooldown(skill, DateTime.Now.AddSeconds(skill.RankData.Var2));

			return true;
		}
开发者ID:xKamuna,项目名称:aura,代码行数:16,代码来源:FinalHit.cs

示例4: Prepare

		/// <summary>
		/// Prepares skill.
		/// </summary>
		/// <param name="creature"></param>
		/// <param name="skill"></param>
		/// <param name="packet"></param>
		/// <returns></returns>
		public bool Prepare(Creature creature, Skill skill, Packet packet)
		{
			Send.SkillPrepare(creature, skill.Info.Id, skill.GetCastTime());

			// Lock running if not elf
			//if (!creature.IsElf)
				//creature.Lock(Locks.Run);

			return true;
		}
开发者ID:xKamuna,项目名称:aura,代码行数:17,代码来源:RangedAttack.cs

示例5: Prepare

		/// <summary>
		/// Prepares skill.
		/// </summary>
		/// <param name="creature"></param>
		/// <param name="skill"></param>
		/// <param name="packet"></param>
		/// <returns></returns>
		public bool Prepare(Creature creature, Skill skill, Packet packet)
		{
			Send.SkillPrepare(creature, skill.Info.Id, skill.GetCastTime());

			// Lock running if not elf
			if (!creature.CanRunWithRanged)
				creature.Lock(Locks.Run);

			return true;
		}
开发者ID:tkiapril,项目名称:aura,代码行数:17,代码来源:SupportShot.cs

示例6: Prepare

		/// <summary>
		/// Preapres the skill.
		/// </summary>
		/// <param name="creature"></param>
		/// <param name="skill"></param>
		/// <param name="packet"></param>
		/// <returns></returns>
		public override bool Prepare(Creature creature, Skill skill, Packet packet)
		{
			creature.StopMove();

			Send.SkillInitEffect(creature, "");
			Send.UseMotion(creature, 10, 2);
			Send.SkillPrepare(creature, skill.Info.Id, skill.GetCastTime());

			return true;
		}
开发者ID:ripxfrostbite,项目名称:aura,代码行数:17,代码来源:GlasGhaibhleannSkill.cs

示例7: Prepare

		/// <summary>
		/// Prepares WM, empty skill init for only the loading sound.
		/// </summary>
		/// <param name="creature"></param>
		/// <param name="skill"></param>
		/// <param name="packet"></param>
		/// <returns></returns>
		public bool Prepare(Creature creature, Skill skill, Packet packet)
		{
			creature.StopMove();
			creature.Lock(Locks.Move);

			Send.SkillInitEffect(creature, null);
			Send.SkillPrepare(creature, skill.Info.Id, skill.GetCastTime());

			return true;
		}
开发者ID:RonnyZijler,项目名称:aura,代码行数:17,代码来源:Windmill.cs

示例8: Prepare

		/// <summary>
		/// Prepares skill.
		/// </summary>
		/// <param name="creature"></param>
		/// <param name="skill"></param>
		/// <param name="packet"></param>
		/// <returns></returns>
		public bool Prepare(Creature creature, Skill skill, Packet packet)
		{
			Send.SkillFlashEffect(creature);
			Send.SkillPrepare(creature, skill.Info.Id, skill.GetCastTime());

			if (creature.RightHand == null || !creature.RightHand.HasTag("/crossbow/"))
				creature.Lock(Locks.Run);

			return true;
		}
开发者ID:aura-project,项目名称:aura,代码行数:17,代码来源:MagnumShot.cs

示例9: Prepare

		/// <summary>
		/// Handles skill preparation.
		/// </summary>
		/// <param name="creature"></param>
		/// <param name="skill"></param>
		/// <param name="packet"></param>
		public override bool Prepare(Creature creature, Skill skill, Packet packet)
		{
			Send.SkillFlashEffect(creature);
			Send.SkillPrepare(creature, skill.Info.Id, skill.GetCastTime());

			// Default lock is Walk|Run,  since renovation you are stopped when
			// loading counter, previously you kept running till you were at your
			// destination.
			if (AuraData.FeaturesDb.IsEnabled("TalentRenovationCloseCombat"))
				creature.StopMove();

			return true;
		}
开发者ID:ripxfrostbite,项目名称:aura,代码行数:19,代码来源:Counterattack.cs

示例10: Prepare

		/// <summary>
		/// Prepares skill, fails if no Dice is found.
		/// </summary>
		/// <param name="creature"></param>
		/// <param name="skill"></param>
		/// <param name="packet"></param>
		/// <returns></returns>
		public bool Prepare(Creature creature, Skill skill, Packet packet)
		{
			// Check if dice are equipped (checked on client as well)
			if (creature.RightHand == null || !creature.RightHand.HasTag("/dice/"))
			{
				Send.Notice(creature, Localization.Get("You must equip one Six Sided Dice to use this Action."));
				return false;
			}

			creature.StopMove();

			Send.UseMotion(creature, 27, 0, false, false);
			Send.Effect(creature, Effect.Dice, 0, "prepare"); // [200200, NA233 (2016-08-12)] New 0 int after effect id
			Send.SkillPrepare(creature, skill.Info.Id, skill.GetCastTime());

			return true;
		}
开发者ID:aura-project,项目名称:aura,代码行数:24,代码来源:DiceTossing.cs

示例11: Prepare

		/// <summary>
		/// Prepares the skill, called to start casting.
		/// </summary>
		/// <param name="creature"></param>
		/// <param name="skill"></param>
		/// <param name="packet"></param>
		public override bool Prepare(Creature creature, Skill skill, Packet packet)
		{
			Send.SkillFlashEffect(creature);
			Send.SkillPrepare(creature, skill.Info.Id, skill.GetCastTime());

			// Default lock is Walk|Run, since renovation you're not able to
			// move while loading anymore.
			if (AuraData.FeaturesDb.IsEnabled("TalentRenovationCloseCombat"))
			{
				creature.StopMove();
			}
			// Since the client locks Walk|Run by default we have to tell it
			// to enable walk but disable run (under any circumstances) if
			// renovation is disabled.
			else
			{
				creature.Lock(Locks.Run, true);
				creature.Unlock(Locks.Walk, true);
			}

			return true;
		}
开发者ID:aura-project,项目名称:aura,代码行数:28,代码来源:Defense.cs

示例12: Prepare

		/// <summary>
		/// Prepares skill, fails if no Bandage is found.
		/// </summary>
		/// <param name="creature"></param>
		/// <param name="skill"></param>
		/// <param name="packet"></param>
		/// <returns></returns>
		public bool Prepare(Creature creature, Skill skill, Packet packet)
		{
			var itemEntityId = 0L;
			if (packet.Peek() == PacketElementType.String)
				itemEntityId = MabiDictionary.Fetch<long>("ITEMID", packet.GetString());

			// TODO: Get bandage if not item skill
			// Bandages are used starting from the bottom-right corner.
			// Higher quality bandages will take priority over lower quality bandages regardless of placement.
			// ~_______~
			// GetItem(ByTag) (starting in lower right?)

			// TODO: Check actual bandage
			if (creature.Inventory.Count(BandageItemId) == 0)
			{
				Send.Notice(creature, Localization.Get("You need more than one Bandage."));
				return false;
			}

			Send.SkillInitEffect(creature, null);
			Send.SkillPrepare(creature, skill.Info.Id, skill.GetCastTime());

			return true;
		}
开发者ID:xKamuna,项目名称:aura,代码行数:31,代码来源:FirstAid.cs

示例13: Prepare

		/// <summary>
		/// Prepares skill, fails if no Bandage is found.
		/// </summary>
		/// <param name="creature"></param>
		/// <param name="skill"></param>
		/// <param name="packet"></param>
		/// <returns></returns>
		public bool Prepare(Creature creature, Skill skill, Packet packet)
		{
			var itemEntityId = 0L;
			if (packet.Peek() == PacketElementType.String)
				itemEntityId = MabiDictionary.Fetch<long>("ITEMID", packet.GetString());

			Item bandage = null;

			// Get given bandage item or select one from the inventory
			if (itemEntityId != 0)
			{
				bandage = creature.Inventory.GetItem(itemEntityId);

				if (bandage == null || !bandage.HasTag("/bandage/"))
				{
					Log.Warning("FirstAid.Prepare: Creature '{0:X16}' tried to use invalid bandage.", creature.EntityId);
					return false;
				}
			}
			else
			{
				// Get all bandages in inventory
				var items = creature.Inventory.GetItems(a => a.HasTag("/bandage/"), StartAt.BottomRight);

				// Cancel if there are none
				if (items.Count == 0)
				{
					Send.Notice(creature, Localization.Get("You need more than one Bandage."));
					return false;
				}

				var best = 0;

				// Select the bandage with the highest quality,
				// starting from the bottom right
				foreach (var item in items)
				{
					var quality = 0;
					if (item.HasTag("/common_grade/"))
						quality = 1;
					else if (item.HasTag("/high_grade/"))
						quality = 2;
					else if (item.HasTag("/highest_grade/"))
						quality = 3;

					// Select this item, if the quality is *better* than the
					// previously selected one, we don't want to switch to a
					// bandage of equal quality, since we want to get the one
					// closest to the bottom right.
					if (bandage == null || quality > best)
					{
						best = quality;
						bandage = item;
					}
				}

				// Sanity check, shouldn't happen. Ever.
				if (bandage == null)
				{
					Log.Warning("FirstAid.Prepare: The impossible sanity check failed.");
					return false;
				}
			}

			creature.Temp.SkillItem1 = bandage;

			Send.SkillInitEffect(creature, null);
			Send.SkillPrepare(creature, skill.Info.Id, skill.GetCastTime());

			return true;
		}
开发者ID:aura-project,项目名称:aura,代码行数:78,代码来源:FirstAid.cs

示例14: 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


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