本文整理汇总了C#中RoomUser.UserIsRidingAHorse方法的典型用法代码示例。如果您正苦于以下问题:C# RoomUser.UserIsRidingAHorse方法的具体用法?C# RoomUser.UserIsRidingAHorse怎么用?C# RoomUser.UserIsRidingAHorse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RoomUser
的用法示例。
在下文中一共展示了RoomUser.UserIsRidingAHorse方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateUserStatus
internal void UpdateUserStatus(RoomUser User, bool cyclegameitems)
{
if (User == null)
return;
bool isBot = User.IsBot;
if (isBot)
cyclegameitems = false;
if (User.Statusses.ContainsKey("lay") || User.Statusses.ContainsKey("sit"))
{
User.Statusses.Remove("lay");
if (!User.forcesit)
User.Statusses.Remove("sit");
User.UpdateNeeded = true;
}
//List<RoomItem> ItemsOnSquare = GetFurniObjects(User.X, User.Y);
//CoordItemSearch ItemSearch = new CoordItemSearch(room.GetGameMap().CoordinatedItems);
int userCoord = User.GetDoubleCoordinate();
List<RoomItem> ItemsOnSquare = room.GetGameMap().GetCoordinatedItems(ref userCoord); //ItemSearch.GetAllRoomItemForSquare(User.X, User.Y);
double newZ = room.GetGameMap().GetNewZForUser(User.X, User.Y, User.Z);
if (newZ != User.Z)
{
if (User.isFlying)
newZ += 4 + (0.5 * Math.Sin(0.7 * User.flyk));
if (User.UserIsRidingAHorse())
newZ += 1;
User.Z = newZ;
User.UpdateNeeded = true;
}
DynamicRoomModel Model = room.GetGameMap().Model;
if (Model.SqState[User.X, User.Y] == SquareState.SEAT)
{
if (!User.Statusses.ContainsKey("sit"))
{
User.Statusses.Add("sit", "1.0");
}
User.Z = Model.SqFloorHeight[User.X, User.Y];
if (User.isFlying)
User.Z += 4 + (0.5 * Math.Sin(0.7 * User.flyk));
User.RotHead = Model.SqSeatRot[User.X, User.Y];
User.RotBody = Model.SqSeatRot[User.X, User.Y];
User.UpdateNeeded = true;
}
RoomItem[] items = room.GetGameMap().GetCoordinatedHeighestItems(ref userCoord).ToArray();
foreach (RoomItem item in items)
item.OnUserWalk(User, cyclegameitems);
if (User.pressurePlate != 0)
{
if (User.PressurePlateReset)
{
RoomItem plate = room.GetRoomItemHandler().GetItem(User.pressurePlate);
if (plate == null)
return;
User.pressurePlate = 0;
plate.ExtraData = "0";
plate.UpdateState(false, true);
}
User.PressurePlateReset = true;
}
if (cyclegameitems)
{
if (room.GotSoccer())
room.GetSoccer().OnUserWalk(User);
if (room.GotBanzai())
room.GetBanzai().OnUserWalk(User);
if (room.GotFreeze())
room.GetFreeze().OnUserWalk(User);
}
}
示例2: HandleSetMovement
private void HandleSetMovement(SquarePoint Point, RoomUser User, ref bool updated, bool setSquareMap)
{
int nextX = Point.X;
int nextY = Point.Y;
User.RemoveStatus("mv");
//double nextZ = room.GetGameMap().SqAbsoluteHeight(nextX, nextY);
double nextZ = room.GetGameMap().GetNewZForUser(nextX, nextY, User.Z);
//if (room.GetGameMap().SquareOccupied(nextX, nextY, nextZ))
// return;
if (User.UserIsRidingAHorse())
nextZ += 1;
User.Statusses.Remove("lay");
User.Statusses.Remove("sit");
if (!User.isFlying)
User.AddStatus("mv", nextX + "," + nextY + "," + TextHandling.GetString(nextZ));
else
User.AddStatus("mv", nextX + "," + nextY + "," + TextHandling.GetString(nextZ + 4 + (0.5 * Math.Sin(0.7 * User.flyk))));
int newRot = Rotation.Calculate(User.X, User.Y, nextX, nextY, User.moonwalkEnabled);
User.RotBody = newRot;
User.RotHead = newRot;
User.SetStep = true;
User.SetX = nextX;
User.SetY = nextY;
User.SetZ = nextZ;
UpdateUserEffect(User, User.SetX, User.SetY);
updated = true;
User.UpdateNeeded = true;
if (setSquareMap)
{
room.GetGameMap().GameMap[User.X, User.Y] = User.SqState; // REstore the old one
User.SqState = room.GetGameMap().GameMap[User.SetX, User.SetY];//Backup the new one
if (!room.AllowWalkthrough)
room.GetGameMap().GameMap[nextX, nextY] = 0;
}
}