Exemplo n.º 1
0
        //If the player is able to move to the desired cell,
        //  return true. Otherwise, return false such as if
        //  the player tries to move to an invalid cell
        public bool MovePlayer(Core.Direction direction)
        {
            int x = Game.Player.X;
            int y = Game.Player.Y;

            switch (direction)
            {
            case Core.Direction.Up:
            {
                y = Game.Player.Y - 1;
                break;
            }

            case Core.Direction.Down:
            {
                y = Game.Player.Y + 1;
                break;
            }

            case Core.Direction.Left:
            {
                x = Game.Player.X - 1;
                break;
            }

            case Core.Direction.Right:
            {
                x = Game.Player.X + 1;
                break;
            }

            default:
                return(false);
            }

            if (Game.DungeonMap.SetActorPosition(Game.Player, x, y))
            {
                return(true);
            }

            Monster monster = Game.DungeonMap.GetMonsterAt(x, y);

            if (monster != null)
            {
                Attack(Game.Player, monster);
                return(true);
            }

            return(false);
        }
Exemplo n.º 2
0
 public PlayerDigging(Core.DiggingStatus status, int x, sbyte y, int z, Core.Direction face)
 {
     this._Status = status;
     this._X = x;
     this._Y = y;
     this._Z = z;
     this._Face = face;
 }
Exemplo n.º 3
0
 public PlayerBlockPlacement(int x, sbyte y, int z, Core.Direction direction, short blockid, sbyte amount, short damage)
 {
     this._X = x;
     this._Y = y;
     this._Z = z;
     this._Direction = direction;
     this._BlockId = blockid;
     this._Amount = amount;
     this._Damage = damage;
 }