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


C# Item.GetRoom方法代码示例

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


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

示例1: OnTrigger

        public void OnTrigger(GameClient Session, Item Item, int Request, bool HasRights)
        {
            RoomUser User = null;
            if (Session != null)
                User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
            if (User == null)
                return;

            if (Gamemap.TilesTouching(Item.GetX, Item.GetY, User.X, User.Y))
            {
                if (Item.ExtraData != "-1")
                {
                    if (Request == -1)
                    {
                        Item.ExtraData = "0";
                        Item.UpdateState();
                    }
                    else
                    {
                        Item.ExtraData = "-1";
                        Item.UpdateState(false, true);
                        Item.RequestUpdate(3, true);
                    }
                }
            }
            else
            {
                User.MoveTo(Item.SquareInFront);
            }
        }
开发者ID:BjkGkh,项目名称:Boon,代码行数:30,代码来源:InteractorDice.cs

示例2: OnPlace

        public void OnPlace(GameClient Session, Item Item)
        {
            if (Item.team == TEAM.NONE)
                return;

            Item.ExtraData = Item.GetRoom().GetGameManager().Points[Convert.ToInt32( Item.team)].ToString();
            Item.UpdateState(false, true);
        }
开发者ID:BjkGkh,项目名称:Boon,代码行数:8,代码来源:InteractorScoreCounter.cs

示例3: OnTrigger

        public void OnTrigger(GameClient Session, Item Item, int Request, bool HasRights)
        {
            if (HasRights)
            {
                Item.GetRoom().GetGameManager().Points[Convert.ToInt32(Item.team)] = 0;

                Item.ExtraData = "0";
                Item.UpdateState();
            }
        }
开发者ID:BjkGkh,项目名称:Boon,代码行数:10,代码来源:InteractorBanzaiScoreCounter.cs

示例4: OnTrigger

        public void OnTrigger(GameClient Session, Item Item, int Request, bool HasRights)
        {
            if (Session == null || Item == null)
                return;

            if (!HasRights)
                return;

            IWiredItem Box = null;
            if (!Item.GetRoom().GetWired().TryGet(Item.Id, out Box))
                return;

            Item.ExtraData = "1";
            Item.UpdateState(false, true);
            Item.RequestUpdate(2, true);

            if (Item.GetBaseItem().WiredType == WiredBoxType.AddonRandomEffect)
                return;
            if (Item.GetRoom().GetWired().IsTrigger(Item))
            {
                List<int> BlockedItems = WiredBoxTypeUtility.ContainsBlockedEffect(Box, Item.GetRoom().GetWired().GetEffects(Box));
                Session.SendMessage(new WiredTriggerConfigComposer(Box, BlockedItems));
            }
            else if (Item.GetRoom().GetWired().IsEffect(Item))
            {
                List<int> BlockedItems = WiredBoxTypeUtility.ContainsBlockedTrigger(Box, Item.GetRoom().GetWired().GetTriggers(Box));
                Session.SendMessage(new WiredEffectConfigComposer(Box, BlockedItems));
            }
            else if (Item.GetRoom().GetWired().IsCondition(Item))
                Session.SendMessage(new WiredConditionConfigComposer(Box));
        }
开发者ID:BjkGkh,项目名称:Boon,代码行数:31,代码来源:InteractorWired.cs

示例5: OnRemove

        public void OnRemove(GameClient Session, Item Item)
        {
            Item.ExtraData = "0";

            if (Item.InteractingUser != 0)
            {
                RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Item.InteractingUser);

                if (User != null)
                {
                    User.ClearMovement(true);
                    User.UnlockWalking();
                }

                Item.InteractingUser = 0;
            }
        }
开发者ID:BjkGkh,项目名称:Boon,代码行数:17,代码来源:InteractorOneWayGate.cs

示例6: OnTrigger

        public void OnTrigger(GameClient Session, Item Item, int Request, bool HasRights)
        {
            if (Session == null)
                return;

            RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
            if (User == null)
                return;

            if (Gamemap.TilesTouching(Item.GetX, Item.GetY, User.X, User.Y))
            {
                int Modes = Item.GetBaseItem().Modes - 1;

                if (Modes <= 0)
                    return;

                PlusEnvironment.GetGame().GetQuestManager().ProgressUserQuest(Session, QuestType.FURNI_SWITCH);

                int CurrentMode = 0;
                int NewMode = 0;

                if (!int.TryParse(Item.ExtraData, out CurrentMode))
                {
                }

                if (CurrentMode <= 0)
                    NewMode = 1;
                else if (CurrentMode >= Modes)
                    NewMode = 0;
                else
                    NewMode = CurrentMode + 1;

                Item.ExtraData = NewMode.ToString();
                Item.UpdateState();
            }
            else
                User.MoveTo(Item.SquareInFront);
        }
开发者ID:BjkGkh,项目名称:Boon,代码行数:38,代码来源:InteractorSwitch.cs

示例7: OnWiredTrigger

        public void OnWiredTrigger(Item Item)
        {
            if (Item.GetRoom().GetSoccer().GameIsStarted)
                Item.GetRoom().GetSoccer().StopGame(true);

            Item.pendingReset = true;
            Item.UpdateNeeded = true;
            Item.ExtraData = "30";
            Item.UpdateState();

            Item.GetRoom().GetSoccer().StartGame();
        }
开发者ID:BjkGkh,项目名称:Boon,代码行数:12,代码来源:InteractorCounter.cs

示例8: OnTrigger

        public void OnTrigger(GameClient Session, Item Item, int Request, bool HasRights)
        {
            if (!HasRights)
            {
                return;
            }

            int oldValue = 0;

            if (!int.TryParse(Item.ExtraData, out oldValue))
            {
                Item.ExtraData = "30";
                oldValue = 30;
            }

            if (Request == 0 && oldValue == 0)
            {
                oldValue = 30;
            }
            else if (Request == 2)
            {
                if (Item.GetRoom().GetSoccer().GameIsStarted && Item.pendingReset && oldValue > 0)
                {
                    oldValue = 0;
                    Item.pendingReset = false;
                }
                else
                {
                    if (oldValue < 30)
                        oldValue = 30;
                    else if (oldValue == 30)
                        oldValue = 60;
                    else if (oldValue == 60)
                        oldValue = 120;
                    else if (oldValue == 120)
                        oldValue = 180;
                    else if (oldValue == 180)
                        oldValue = 300;
                    else if (oldValue == 300)
                        oldValue = 600;
                    else
                        oldValue = 0;
                    Item.UpdateNeeded = false;
                }
            }
            else if (Request == 1 || Request == 0)
            {
                if (Request == 1 && oldValue == 0)
                {
                    Item.ExtraData = "30";
                    oldValue = 30;
                }

                if (!Item.GetRoom().GetSoccer().GameIsStarted)
                {
                    Item.UpdateNeeded = !Item.UpdateNeeded;

                    if (Item.UpdateNeeded)
                    {
                        Item.GetRoom().GetSoccer().StartGame();
                    }

                    Item.pendingReset = true;
                }
                else
                {
                    Item.UpdateNeeded = !Item.UpdateNeeded;

                    if (Item.UpdateNeeded)
                    {
                        Item.GetRoom().GetSoccer().StopGame(true);
                    }

                    Item.pendingReset = true;
                }
            }


            Item.ExtraData = Convert.ToString(oldValue);
            Item.UpdateState();
        }
开发者ID:BjkGkh,项目名称:Boon,代码行数:81,代码来源:InteractorCounter.cs

示例9: OnTrigger

        public void OnTrigger(GameClient Session, Item Item, int Request, bool HasRights)
        {
            if (Session == null)
                return;
            RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
            if (User == null)
            {
                return;
            }

            if (!((Math.Abs((User.X - Item.GetX)) >= 2) || (Math.Abs((User.Y - Item.GetY)) >= 2)))
            {
                User.SetRot(Rotation.Calculate(User.X, User.Y, Item.GetX, Item.GetY), false);
                if (User.RotBody%2 != 0)
                {
                    User.MoveTo(Item.GetX + 1, Item.GetY);
                    return;
                }
                Room Room = Item.GetRoom();
                var NewPoint = new Point(0, 0);
                if (User.RotBody == 4)
                {
                    NewPoint = new Point(Item.GetX, Item.GetY + 1);
                }

                if (User.RotBody == 0)
                {
                    NewPoint = new Point(Item.GetX, Item.GetY - 1);
                }

                if (User.RotBody == 6)
                {
                    NewPoint = new Point(Item.GetX - 1, Item.GetY);
                }

                if (User.RotBody == 2)
                {
                    NewPoint = new Point(Item.GetX + 1, Item.GetY);
                }

                if (Room.GetGameMap().ValidTile(NewPoint.X, NewPoint.Y) &&
                    Room.GetGameMap().itemCanBePlacedHere(NewPoint.X, NewPoint.Y) &&
                    Room.GetGameMap().CanRollItemHere(NewPoint.X, NewPoint.Y))
                {
                    Double NewZ = Item.GetRoom().GetGameMap().SqAbsoluteHeight(NewPoint.X, NewPoint.Y);

                    /*var mMessage = new ServerMessage();
                    mMessage.Init(Outgoing.ObjectOnRoller); // Cf
                    mMessage.AppendInt32(Item.GetX);
                    mMessage.AppendInt32(Item.GetY);
                    mMessage.AppendInt32(NewPoint.X);
                    mMessage.AppendInt32(NewPoint.Y);
                    mMessage.AppendInt32(1);
                    mMessage.AppendInt32(Item.Id);
                    mMessage.AppendString(Item.GetZ.ToString().Replace(',', '.'));
                    mMessage.AppendString(NewZ.ToString().Replace(',', '.'));
                    mMessage.AppendInt32(0);
                    Room.SendMessage(mMessage);*/

                    Room.SendMessage(new SlideObjectBundleComposer(Item.GetX, Item.GetY, Item.GetZ, NewPoint.X, NewPoint.Y, NewZ, 0, 0, Item.Id));

                    Item.GetRoom()  .GetRoomItemHandler() .SetFloorItem(User.GetClient(), Item, NewPoint.X, NewPoint.Y, Item.Rotation, false, false, false);
                }
            }
            else
            {
                User.MoveTo(Item.GetX + 1, Item.GetY);
            }
        }
开发者ID:BjkGkh,项目名称:Boon,代码行数:69,代码来源:InteractorPuzzleBox.cs

示例10: OnWiredTrigger

        public void OnWiredTrigger(Item Item)
        {
            if (Item.GetRoom().GetBanzai().isBanzaiActive)
                Item.GetRoom().GetBanzai().BanzaiEnd(true);

            Item.pendingReset = true;
            Item.UpdateNeeded = true;
            Item.ExtraData = "30";
            Item.UpdateState();

            if (!Item.GetRoom().GetBanzai().isBanzaiActive)
                Item.GetRoom().GetBanzai().BanzaiStart();
        }
开发者ID:BjkGkh,项目名称:Boon,代码行数:13,代码来源:InteractorBanzaiTimer.cs

示例11: OnTrigger

        public void OnTrigger(GameClient Session, Item Item, int Request, bool HasRights)
        {
            RoomUser User = null;

            if (Session != null)
                User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);

            if (User == null)
                return;

            if (Gamemap.TilesTouching(Item.GetX, Item.GetY, User.X, User.Y))
            {
                if (Item.ExtraData == null || Item.ExtraData.Length <= 1 || !Item.ExtraData.Contains(Convert.ToChar(5).ToString()))
                {
                    Point pointOne;
                    Point pointTwo;

                    switch (Item.Rotation)
                    {
                        case 2:
                            pointOne = new Point(Item.GetX, Item.GetY + 1);
                            pointTwo = new Point(Item.GetX, Item.GetY - 1);
                            break;

                        case 4:
                            pointOne = new Point(Item.GetX - 1, Item.GetY);
                            pointTwo = new Point(Item.GetX + 1, Item.GetY);
                            break;

                        default:
                            return;
                    }

                    RoomUser UserOne = Item.GetRoom().GetRoomUserManager().GetUserForSquare(pointOne.X, pointOne.Y);
                    RoomUser UserTwo = Item.GetRoom().GetRoomUserManager().GetUserForSquare(pointTwo.X, pointTwo.Y);

                    if(UserOne == null || UserTwo == null)
                        Session.SendNotification("We couldn't find a valid user to lock this love lock with.");
                    else if(UserOne.GetClient() == null || UserTwo.GetClient() == null)
                        Session.SendNotification("We couldn't find a valid user to lock this love lock with.");
                    else if(UserOne.HabboId != Item.UserID && UserTwo.HabboId != Item.UserID)
                        Session.SendNotification("You can only use this item with the item owner.");
                    else
                    {
                        UserOne.CanWalk = false;
                        UserTwo.CanWalk = false;

                        Item.InteractingUser = UserOne.GetClient().GetHabbo().Id;
                        Item.InteractingUser2 = UserTwo.GetClient().GetHabbo().Id;

                        UserOne.GetClient().SendMessage(new LoveLockDialogueMessageComposer(Item.Id));
                        UserTwo.GetClient().SendMessage(new LoveLockDialogueMessageComposer(Item.Id));
                    }


                }
                else
                    return;
            }
            else
            {
                User.MoveTo(Item.SquareInFront);
            }
        }
开发者ID:BjkGkh,项目名称:Boon,代码行数:64,代码来源:InteractorLoveLock.cs

示例12: OnTrigger

        public void OnTrigger(GameClient Session, Item Item, int Request, bool HasRights)
        {
            if (Session == null)
                return;
            
            RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);

            if (Item.InteractingUser2 != User.UserId)
                Item.InteractingUser2 = User.UserId;

            if (User == null)
            {
                return;
            }
            if (Item.GetBaseItem().InteractionType == InteractionType.ONE_WAY_GATE)
            {
            if (User.Coordinate != Item.SquareInFront && User.CanWalk)
            {
                User.MoveTo(Item.SquareInFront);
                return;
            }
            if (!Item.GetRoom().GetGameMap().ValidTile(Item.SquareBehind.X, Item.SquareBehind.Y) ||
                !Item.GetRoom().GetGameMap().CanWalk(Item.SquareBehind.X, Item.SquareBehind.Y, false)
                || !Item.GetRoom().GetGameMap().SquareIsOpen(Item.SquareBehind.X, Item.SquareBehind.Y, false))
            {
                return;
            }

            if ((User.LastInteraction - PlusEnvironment.GetUnixTimestamp() < 0) && User.InteractingGate &&
                User.GateId == Item.Id)
            {
                User.InteractingGate = false;
                User.GateId = 0;
            }

           
            if (!Item.GetRoom().GetGameMap().CanWalk(Item.SquareBehind.X, Item.SquareBehind.Y, User.AllowOverride))
            {
                return;
            }
          
                if (Item.InteractingUser == 0)
                {
                    User.InteractingGate = true;
                    User.GateId = Item.Id;
                    Item.InteractingUser = User.HabboId;

                    User.CanWalk = false;

                    if (User.IsWalking && (User.GoalX != Item.SquareInFront.X || User.GoalY != Item.SquareInFront.Y))
                    {
                        User.ClearMovement(true);
                    }

                    User.AllowOverride = true;
                    User.MoveTo(Item.Coordinate);

                    Item.RequestUpdate(4, true);
                }
            }
        }
开发者ID:BjkGkh,项目名称:Boon,代码行数:61,代码来源:InteractorOneWayGate.cs


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