本文整理汇总了C#中RoomUser.PetGotUserRiding方法的典型用法代码示例。如果您正苦于以下问题:C# RoomUser.PetGotUserRiding方法的具体用法?C# RoomUser.PetGotUserRiding怎么用?C# RoomUser.PetGotUserRiding使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RoomUser
的用法示例。
在下文中一共展示了RoomUser.PetGotUserRiding方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
示例2: SetStepForUser
private bool SetStepForUser(RoomUser User)
{
if (room.GetGameMap().CanWalk(User.SetX, User.SetY, User.SetZ, User.AllowOverride) || User.ignoreMap || User.PetGotUserRiding())
{
int currentCoord = User.GetDoubleCoordinate();
int newCoord = TextHandling.CombineXYCoord(User.SetX, User.SetY);
room.GetGameMap().UpdateUserMovement(ref currentCoord, ref newCoord, User);
RoomItem[] items = room.GetGameMap().GetCoordinatedHeighestItems(ref currentCoord);
User.X = User.SetX;
User.Y = User.SetY;
User.Z = User.SetZ;
if (User.isFlying)
{
User.Z += 4 + 0.5 * Math.Sin(0.7 * User.flyk);
}
else
{
foreach (RoomItem item in items)
{
item.UserWalksOffFurni(User);
}
}
if (User.X == room.GetGameMap().Model.DoorX && User.Y == room.GetGameMap().Model.DoorY && !ToRemove.Contains(User) && !User.IsBot)
{
ToRemove.Add(User);
return true;
}
UpdateUserStatus(User, true);
}
User.SetStep = false;
return false;
}