예제 #1
0
        public Tile CreateTile(string nativeName, int x, int y, int?height)
        {
            if (Tiles[x][y] != null)
            {
                return(null);
            }

            Tile tile = new Tile(this, x, y, NativeManager.GetTileNative(nativeName), height);

            Tiles[x][y] = tile;
            return(tile);
        }
예제 #2
0
        public Tile ChangeTile(string nativeName, int x, int y, float?height, IPlayerParentRef owner)
        {
            if (Tiles[x][y] == null)
            {
                return(null);
            }

            Tile tile = Tiles[x][y];

            tile.Owner    = owner;
            tile.Native   = NativeManager.GetTileNative(nativeName);
            tile.Affected = true;
            if (height != null)
            {
                tile.Height = height.Value;
            }

            if (tile.Native.Unbearable && tile.TempObject != null)
            {
                tile.TempObject.Kill();
            }

            if (tile.TempObject != null)
            {
                if (tile.TempObject is Actor actor)
                {
                    actor.BuffManager.RemoveTileBuffs();
                }

                if (!tile.Revealed)
                {
                    tile.Affected = true;
                    tile.Revealed = true;
                }

                tile.Native.OnStepAction(this, Tiles[x][y]);
            }

            return(tile);
        }