本文整理汇总了C#中RoomUser.OnStopWalk方法的典型用法代码示例。如果您正苦于以下问题:C# RoomUser.OnStopWalk方法的具体用法?C# RoomUser.OnStopWalk怎么用?C# RoomUser.OnStopWalk使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RoomUser
的用法示例。
在下文中一共展示了RoomUser.OnStopWalk方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TeleportToItem
internal void TeleportToItem(RoomUser user, RoomItem item)
{
if (user.SetStep)
room.GetGameMap().GameMap[user.SetX, user.SetY] = user.SqState;
else
room.GetGameMap().GameMap[user.X, user.Y] = user.SqState;
int itemCoord = item.GetDoubleCoordinate();
int userCoord = user.GetDoubleCoordinate();
UpdateUserMovement(ref userCoord, ref itemCoord, user);
user.X = item.GetX;
user.Y = item.GetY;
user.Z = item.GetZ;
if (user.isFlying)
user.Z += 4 + 0.5 * Math.Sin(0.7 * user.flyk);
user.SqState = GameMap[item.GetX, item.GetY];
GameMap[user.X, user.Y] = 1;
user.GoalX = user.X;
user.GoalY = user.Y;
user.SetStep = false;
user.IsWalking = false;
user.UpdateNeeded = true;
user.OnStopWalk();
if (item.GetBaseItem().IsSeat)
{
if (!user.Statusses.ContainsKey("sit"))
{
user.Statusses.Add("sit", TextHandling.GetString(item.Height));
}
}
else if (item.GetBaseItem().InteractionType == InteractionType.bed)
{
if (!user.Statusses.ContainsKey("lay"))
{
user.Statusses.Add("lay", TextHandling.GetString(item.Height) + " null");
}
}
user.Z = item.GetZ;
if (user.isFlying)
user.Z += 4 + (0.2 * 0.5 * Math.Sin(0.7 * user.flyk));
user.RotHead = item.Rot;
user.RotBody = item.Rot;
user.UpdateNeeded = true;
//item.OnUserWalk(user, false); BE GONE BUG
}
示例2: FreezeUser
private void FreezeUser(RoomUser user)
{
if (user.IsBot || user.shieldActive || user.team == Team.none)
return;
if (user.Freezed)
{
user.Freezed = false;
user.ApplyEffect((int)user.team + 39);
return;
}
user.Freezed = true;
user.FreezeCounter = 0;
user.FreezeLives--;
if (user.FreezeLives <= 0)
{
user.ApplyEffect(-1);
room.GetGameManager().AddPointToTeam(user.team, -20, user);
user.team = Team.none;
if (exitTeleport != null)
room.GetGameMap().TeleportToItem(user, exitTeleport);
user.Freezed = false;
user.SetStep = false;
user.IsWalking = false;
user.UpdateNeeded = true;
user.OnStopWalk();
return;
}
room.GetGameManager().AddPointToTeam(user.team, -10, user);
user.ApplyEffect(12);
ServerMessage message = PacketHandelingManager.GetRecycledItem(OutputCode.GamePlayerValueMessageEvent);
message.AddInt32(user.InternalRoomID);
message.AddInt32(user.FreezeLives);
user.GetClient().SendMessage(message);
}
示例3: CalculatePath
private void CalculatePath(RoomUser User, ref bool updated)
{
Gamemap map = room.GetGameMap();
SquarePoint Point = DreamPathfinder.GetNextStep(User.X, User.Y, User.Z, User.GoalX, User.GoalY, map.GameMap, map.GetStackmap(), map.Model.SqFloorHeight,
map.Model.MapSizeX, map.Model.MapSizeY, User.AllowOverride, map.DiagonalEnabled, map);
if (Point.X == User.X && Point.Y == User.Y) //No path found, or reached goal (:
{
User.IsWalking = false;
User.IsHorseWalking = false;
User.OnStopWalk();
User.RemoveStatus("mv");
UpdateUserStatus(User, false);
}
else
{
HandleSetMovement(Point, User, ref updated, true);
if (User.IsPet && User.PetGotUserRiding())
{
RoomUser ridingPet = User.GetRoomUserRiding();
SetStepForUser(ridingPet);
HandleSetMovement(Point, ridingPet, ref updated, false);
UpdateUserEffect(ridingPet, ridingPet.X, ridingPet.Y);
ridingPet.UpdateNeeded = true;
FinishUserCycle(ridingPet);
}
}
User.UpdateNeeded = true;
}