public void OnPlayerTeleport(PlayerTeleportEvent evt)
        {
            if (AdvancedTeleportationPlugin.Instance.BackPos.ContainsKey(evt.Player.User.SlgId))
            {
                AdvancedTeleportationPlugin.Instance.BackPos.Remove(evt.Player.User.SlgId);
            }

            AdvancedTeleportationPlugin.Instance.BackPos.Add(evt.Player.User.SlgId, evt.Player.Position);
        }
Exemplo n.º 2
0
 public void OnEvent(PlayerTeleportEvent eventData)
 {
     if (countdownText.IsActive())
     {
         UpdateTextRotationAndPositionOnce(countdownText);
     }
     if (buttonClickText.IsActive())
     {
         UpdateTextRotationAndPositionOnce(buttonClickText);
     }
 }
Exemplo n.º 3
0
        public override bool ProcessKeyboard(KeyboardInfo info)
        {
            if (info.KeysPressed.Contains(AsciiKey.Get(Keys.N)))
            {
                NewGameEvent?.Invoke(this, new EventArgs());
                return(true);
            }

            if (!_game.Player.IsAlive)
            {
                return(false);
            }

            if (info.KeysPressed.Contains(AsciiKey.Get(Keys.T)))
            {
                PlayerTeleportEvent?.Invoke(this, new EventArgs());
                return(true);
            }

            var keyHit    = false;
            var direction = new Point();

            if (info.KeysPressed.Contains(AsciiKey.Get(Keys.Up)) ||
                info.KeysPressed.Contains(AsciiKey.Get(Keys.NumPad8)) ||
                info.KeysPressed.Contains(AsciiKey.Get(Keys.NumPad7)) ||
                info.KeysPressed.Contains(AsciiKey.Get(Keys.NumPad9)))
            {
                direction.Y = -1;
                keyHit      = true;
            }
            if (info.KeysPressed.Contains(AsciiKey.Get(Keys.Down)) ||
                info.KeysPressed.Contains(AsciiKey.Get(Keys.NumPad2)) ||
                info.KeysPressed.Contains(AsciiKey.Get(Keys.NumPad1)) ||
                info.KeysPressed.Contains(AsciiKey.Get(Keys.NumPad3)))
            {
                direction.Y += 1;
                keyHit       = true;
            }
            if (info.KeysPressed.Contains(AsciiKey.Get(Keys.Left)) ||
                info.KeysPressed.Contains(AsciiKey.Get(Keys.NumPad4)) ||
                info.KeysPressed.Contains(AsciiKey.Get(Keys.NumPad7)) ||
                info.KeysPressed.Contains(AsciiKey.Get(Keys.NumPad1)))
            {
                direction.X -= 1;
                keyHit       = true;
            }
            if (info.KeysPressed.Contains(AsciiKey.Get(Keys.Right)) ||
                info.KeysPressed.Contains(AsciiKey.Get(Keys.NumPad6)) ||
                info.KeysPressed.Contains(AsciiKey.Get(Keys.NumPad9)) ||
                info.KeysPressed.Contains(AsciiKey.Get(Keys.NumPad3)))
            {
                direction.X += 1;
                keyHit       = true;
            }

            if (keyHit)
            {
                PlayerMoveEvent?.Invoke(this, new PlayerMoveEventArgs(direction));
            }

            return(keyHit);
        }