Example #1
0
        private void UserLocation(S.UserLocation p)
        {
            MapControl.NextAction = 0;
            if (User.CurrentLocation == p.Location && User.Direction == p.Direction)
            {
                if (Settings.autoPick)
                {
                    if (CMain.Time > GameScene.PickUpTime)
                    {
                        GameScene.PickUpTime = CMain.Time + 200;
                        Network.Enqueue(new C.PickUp());
                    }
                }
                return;
            }

            if (Settings.DebugMode)
            {
                GameScene.Scene.ReceiveChat(new S.Chat {
                    Message = "Displacement", Type = ChatType.System
                });
            }

            GameScene.Scene.MapControl.RemoveObject(User);
            User.CurrentLocation = p.Location;
            User.MapLocation     = p.Location;
            GameScene.Scene.MapControl.AddObject(User);

            GameScene.Scene.MapControl.FloorValid = false;
            MapControl.InputDelay = CMain.Time + 400;

            if (User.Dead)
            {
                return;
            }

            User.ClearMagic();
            User.QueuedAction = null;

            for (int i = User.ActionFeed.Count - 1; i >= 0; i--)
            {
                if (User.ActionFeed[i].Action == MirAction.Pushed)
                {
                    continue;
                }
                User.ActionFeed.RemoveAt(i);
            }

            User.SetAction();
        }
Example #2
0
    public void UserLocation(S.UserLocation p)
    {
        NextAction = 0;

        if (p.Location.X != User.Player.CurrentLocation.x || p.Location.Y != User.Player.CurrentLocation.y)
        {
            ClearAction();
            GameScene.ChatController.ReceiveChat("Displacement.", ChatType.System);

            CurrentScene.Cells[User.Player.CurrentLocation.x, User.Player.CurrentLocation.y].RemoveObject(User.Player);
            User.Player.CurrentLocation   = new Vector2Int(p.Location.X, p.Location.Y);
            gameObject.transform.position = CurrentScene.Cells[p.Location.X, p.Location.Y].position;
            CurrentScene.Cells[p.Location.X, p.Location.Y].AddObject(User.Player);
        }
    }
Example #3
0
 public static void UserLocation(S.UserLocation p)
 {
     gameManager.UserLocation(p);
 }
Example #4
0
 public void UserLocation(S.UserLocation p)
 {
     NextAction = 0;
 }