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


C# Packet.GetShort方法代码示例

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


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

示例1: UseRegular

		/// <summary>
		/// Handles usage of the skill if it's a regular dye.
		/// </summary>
		/// <param name="creature"></param>
		/// <param name="skill"></param>
		/// <param name="packet"></param>
		/// <param name="part"></param>
		private void UseRegular(Creature creature, Skill skill, Packet packet, int part)
		{
			var x = packet.GetShort();
			var y = packet.GetShort();

			Send.SkillUseDye(creature, skill.Info.Id, part, x, y);
		}
开发者ID:xKamuna,项目名称:aura,代码行数:14,代码来源:Dye.cs

示例2: CompleteRegular

		/// <summary>
		/// Completes skill usage if it was a regular dye.
		/// </summary>
		/// <param name="creature"></param>
		/// <param name="packet"></param>
		/// <param name="skill"></param>
		/// <param name="part"></param>
		private void CompleteRegular(Creature creature, Packet packet, Skill skill, int part)
		{
			var x = packet.GetShort();
			var y = packet.GetShort();

			// Choose random picker
			var rnd = RandomProvider.Get();
			DyePicker picker;
			switch (rnd.Next(5))
			{
				default:
				case 0: picker = creature.Temp.RegularDyePickers.Picker1; break;
				case 1: picker = creature.Temp.RegularDyePickers.Picker2; break;
				case 2: picker = creature.Temp.RegularDyePickers.Picker3; break;
				case 3: picker = creature.Temp.RegularDyePickers.Picker4; break;
				case 4: picker = creature.Temp.RegularDyePickers.Picker5; break;
			}

			// Apply picker offset
			x = (short)((x + picker.X) % MapSize);
			y = (short)((y + picker.Y) % MapSize);

			// Arguments
			var a1 = creature.Temp.DyeDistortA1;
			var a2 = creature.Temp.DyeDistortA2;
			var a3 = creature.Temp.DyeDistortA3;
			var a4 = creature.Temp.DyeDistortA4;

			// Color item
			var item = creature.Temp.SkillItem1;
			var data = item.Data;
			try
			{
				switch (part)
				{
					default:
					case 0: item.Info.Color1 = GetRegularColor(data.ColorMap1, a1, a2, a3, a4, x, y); break;
					case 1: item.Info.Color2 = GetRegularColor(data.ColorMap2, a1, a2, a3, a4, x, y); break;
					case 2: item.Info.Color3 = GetRegularColor(data.ColorMap3, a1, a2, a3, a4, x, y); break;
				}
				this.DyeSuccess(creature);

				Send.AcquireFixedDyedItemInfo(creature, item.EntityId);
			}
			catch (Exception ex)
			{
				Log.Exception(ex);
				Send.ServerMessage(creature, Localization.Get("Error, please report."));
			}

			Send.SkillCompleteDye(creature, skill.Info.Id, part);
		}
开发者ID:tkiapril,项目名称:aura,代码行数:59,代码来源:Dye.cs

示例3: CompleteRegular

		/// <summary>
		/// Completes skill usage if it was a regular dye.
		/// </summary>
		/// <param name="creature"></param>
		/// <param name="packet"></param>
		/// <param name="skill"></param>
		/// <param name="part"></param>
		private void CompleteRegular(Creature creature, Packet packet, Skill skill, int part)
		{
			var x = packet.GetShort();
			var y = packet.GetShort();

			// TODO: Get the distort formula for regulars

			Send.ServerMessage(creature, Localization.Get("This skill isn't implemented completely yet."));
			Send.SkillCompleteDye(creature, skill.Info.Id, part);
		}
开发者ID:xKamuna,项目名称:aura,代码行数:17,代码来源:Dye.cs


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