Ejemplo n.º 1
0
        public void PlayerMove(Player player, MoveDto data)
        {
            GridGenerator terrainGrid = GridGenerator.Instance;

            terrainGrid.ChangeStateCell(data.lastCell, CellState.Empty);
            terrainGrid.ChangeStateCell(data.newCell, CellState.Occupied);

            player.SetPositionOnGrid(data.newCell);

            terrainGrid.MovePlayerOnGrid(data.lastCell, data.newCell, player.Visual);
        }
Ejemplo n.º 2
0
        public override void ExecuteCommand()
        {
            Debug.Log($"Cell script : {_cell}");

            var oldPosition = PlayerCharac.PositionOnGrid;

            _grid.ChangeStateCell(PlayerCharac.PositionOnGrid, CellState.Empty);

            PlayerCharac.SetPositionOnGrid(_cell.Position);
            _cell.State = CellState.Occupied;

            var newPosition = _grid.MovePlayerOnGrid(PlayerCharac.PositionOnGrid, _cell.Position, Player, _path);

            PlayerCharac.Attributes.ActionPoints.AddFlatModifier((_path.Count - 1) * -1);

            _spellBar.UpdateDisplay();
            _display.UpdateDisplay();

            RaiseEventPhoton(newPosition, _cell.Position, oldPosition);
        }