本文整理汇总了C#中Entities.Pullback方法的典型用法代码示例。如果您正苦于以下问题:C# Entities.Pullback方法的具体用法?C# Entities.Pullback怎么用?C# Entities.Pullback使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Entities
的用法示例。
在下文中一共展示了Entities.Pullback方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Handle
/// <summary>
/// Handling the Jump action from GeneralDataPacket.
/// </summary>
/// <param name="client">The client.</param>
/// <param name="General">The GeneralDataPacket.</param>
public static void Handle(Entities.GameClient client, GeneralDataPacket General)
{
if (!client.Alive)
return;
if (client.ContainsFlag1(Enums.Effect1.IceBlock))
return;
if (client.Booth != null)
{
client.Booth.CancelBooth();
client.Pullback();
}
client.Action = Enums.ActionType.None;
client.AttackPacket = null;
ushort JumpX = General.Data1Low;
ushort JumpY = General.Data1High;
if (Core.Screen.GetDistance(client.X, client.Y, JumpX, JumpY) > 28)
{
client.Pullback();
return;
}
if (!client.Map.ValidCoord(JumpX, JumpY))
{
client.Pullback();
return;
}
/*DateTime time = new ProjectX_V3_Lib.Time.SystemTime(General.Timestamp);
if (client.LastMovement > time)
{
client.Pullback(); // speedhack
return;
}*/
if (!(DateTime.Now >= client.LastMovement.AddMilliseconds(400)) && client.LastMoveJump)
{
client.Pullback(); // speedhack
return;
}
if (client.Battle != null)
{
if (!client.Battle.EnterArea(client))
{
client.Pullback();
return;
}
else if (!client.Battle.LeaveArea(client))
{
client.Pullback();
return;
}
}
if (Calculations.BasicCalculations.ChanceSuccess(50))
client.Stamina += 7;
client.LastMoveJump = true;
client.LastMovement = DateTime.Now;
client.LastX = client.X;
client.LastY = client.Y;
client.X = JumpX;
client.Y = JumpY;
client.SendToScreen(General, true);
Data.AdvancedSkill.SkillInArea(client, client.X, client.Y);
}
示例2: Handle
/// <summary>
/// Handles the movement packet.
/// </summary>
/// <param name="client">The client.</param>
/// <param name="packet">The packet.</param>
public static void Handle(Entities.GameClient client, DataPacket packet)
{
if (client.ContainsFlag1(Enums.Effect1.IceBlock))
return;
client.Action = Enums.ActionType.None;
client.AttackPacket = null;
client.LastMoveJump = false;
using (var move = new MovementPacket(packet))
{
if (move.EntityUID != client.EntityUID)
return;
int NewX = 0, NewY = 0;
int NewDir = 0;
switch (move.WalkMode)
{
case Enums.WalkMode.Run:
case Enums.WalkMode.Walk:
{
NewDir = (int)move.Direction % 8;
NewX = client.X + DeltaX[NewDir];
NewY = client.Y + DeltaY[NewDir];
break;
}
case Enums.WalkMode.Mount:
{
NewDir = (int)move.Direction % 24;
NewX = client.X + DeltaMountX[NewDir];
NewY = client.Y + DeltaMountY[NewDir];
break;
}
}
if (client.Map.ValidCoord(NewX, NewY))
{
client.LastX = client.X;
client.LastY = client.LastY;
client.LastMovement = DateTime.Now;
client.X = (ushort)NewX;
client.Y = (ushort)NewY;
client.Direction = (byte)NewDir;
client.SendToScreen(move, true);
if (client.Battle != null)
{
if (!client.Battle.EnterArea(client))
{
client.X = client.LastX;
client.Y = client.LastY;
client.Pullback();
return;
}
else if (!client.Battle.LeaveArea(client))
{
client.X = client.LastX;
client.Y = client.LastY;
client.Pullback();
return;
}
}
Data.AdvancedSkill.SkillInArea(client, client.X, client.Y);
}
}
}