Esempio n. 1
0
        private void SlushInSnow(object o, WorldGen wg, int x, int y, BiomeType bt)
        {
            VeinSettings v = (VeinSettings)o;

            if (bt == BiomeType.Taiga && y >= wg.HeightMap[x] && y < wg.HeightMap[x] + bt.SecondaryLayer - 10)
            {
                if (WorldGen.OctaveGenerator(v.noise, x, y, v.Settings) > v.Filter)
                {
                    wg.Level.tiles[x, y] = new Tile(v.Tile.Foreground)
                    {
                        Background = v.Tile.Background
                    }
                }
            }
            ;
        }
Esempio n. 2
0
        void BottomCaves(object o, WorldGen wg, int x, int y, BiomeType b)
        {
            VeinSettings v = (VeinSettings)o;

            if (y >= level.Height - HeightMap[x] + 85 && y < wg.level.Height - 3)
            {
                if (WorldGen.OctaveGenerator(v.noise, x, y, v.Settings) > v.Filter)
                {
                    wg.Level.tiles[x, y] = new Tile(v.Tile.Foreground)
                    {
                        Background = wg.Level.tiles[x, y].Background
                    }
                }
            }
            ;
        }
Esempio n. 3
0
        private void SandInWorld(object o, WorldGen wg, int x, int y, BiomeType b)
        {
            BlockItem    prev = wg.Level.tiles[x, y].Background;
            VeinSettings v    = (VeinSettings)o;

            if (y > wg.HeightMap[x] + 4 && y < level.Height)
            {
                if (WorldGen.OctaveGenerator(v.noise, x, y, v.Settings) > v.Filter)
                {
                    wg.Level.tiles[x, y] = new Tile(v.Tile.Foreground)
                    {
                        Background = v.Tile.Background != Item.Blank ? v.Tile.Background : prev
                    }
                }
            }
            ;
        }
Esempio n. 4
0
        void RareOre(object o, WorldGen wg, int x, int y, BiomeType b)
        {
            VeinSettings v = (VeinSettings)o;

            if (y >= wg.HeightMap[x] + b.SecondaryLayer && y < wg.Level.Height)
            {
                float value = ((float)(y - wg.HeightMap[x]) / ((float)wg.Level.Height - (wg.HeightMap[x])));
                if (WorldGen.OctaveGenerator(v.noise, x, y, v.Settings) > MathHelper.Lerp(v.MaxFilter, v.Filter, value))
                {
                    if (wg.Level.tiles[x, y].Foreground == Item.Stone || wg.Level.tiles[x, y].Foreground == Item.Dirt)
                    {
                        wg.Level.tiles[x, y] = new Tile(v.Tile.Foreground)
                        {
                            Background = v.Tile.Background
                        }
                    }
                    ;
                }
            }
        }

        void CoalOre(object o, WorldGen wg, int x, int y, BiomeType b)
        {
            VeinSettings v = (VeinSettings)o;

            if (y >= wg.HeightMap[x] && y < wg.Level.Height)
            {
                float value = ((float)(y - wg.HeightMap[x]) / ((float)wg.Level.Height - (wg.HeightMap[x])));
                if (WorldGen.OctaveGenerator(v.noise, x, y, v.Settings) > MathHelper.Lerp(v.MaxFilter, v.Filter, value))
                {
                    if (wg.Level.tiles[x, y].Foreground == b.Secondary.Foreground || wg.Level.tiles[x, y].Foreground == b.Primary.Foreground)
                    {
                        wg.Level.tiles[x, y] = new Tile(v.Tile.Foreground)
                        {
                            Background = v.Tile.Background
                        }
                    }
                    ;
                }
            }
        }

        void IronOre(object o, WorldGen wg, int x, int y, BiomeType b)
        {
            VeinSettings v = (VeinSettings)o;

            if (y >= wg.HeightMap[x] && y < wg.Level.Height)
            {
                float value = ((float)(y - wg.HeightMap[x]) / ((float)wg.Level.Height - (wg.HeightMap[x])));
                if (WorldGen.OctaveGenerator(v.noise, x, y, v.Settings) > MathHelper.Lerp(v.MaxFilter, v.Filter, value))
                {
                    if (wg.Level.tiles[x, y].Foreground == b.Secondary.Foreground || wg.Level.tiles[x, y].Foreground == b.Primary.Foreground)
                    {
                        wg.Level.tiles[x, y] = new Tile(v.Tile.Foreground)
                        {
                            Background = v.Tile.Background
                        }
                    }
                    ;
                }
            }
        }

        void CopperOre(object o, WorldGen wg, int x, int y, BiomeType b)
        {
            VeinSettings v = (VeinSettings)o;

            if (y >= wg.HeightMap[x] && y < wg.Level.Height)
            {
                if (WorldGen.OctaveGenerator(v.noise, x, y, v.Settings) > v.Filter)
                {
                    if (wg.Level.tiles[x, y].Foreground == b.Secondary.Foreground || wg.Level.tiles[x, y].Foreground == b.Primary.Foreground)
                    {
                        wg.Level.tiles[x, y] = new Tile(v.Tile.Foreground)
                        {
                            Background = v.Tile.Background
                        }
                    }
                    ;
                }
            }
        }

        void MiniCaves(object o, WorldGen wg, int x, int y, BiomeType b)
        {
            VeinSettings v = (VeinSettings)o;

            if (y >= wg.HeightMap[x] && y < wg.HeightMap[x] + b.SecondaryLayer + 10)
            {
                if (b != BiomeType.Desert && WorldGen.OctaveGenerator(v.noise, x, y, v.Settings) > v.Filter)
                {
                    wg.Level.tiles[x, y] = new Tile(v.Tile.Foreground)
                    {
                        Background = wg.Level.tiles[x, y].Background
                    }
                }
            }
            ;
        }

        void LargeCaves(object o, WorldGen wg, int x, int y, BiomeType b)
        {
            VeinSettings v = (VeinSettings)o;

            if (y >= wg.HeightMap[x] + b.SecondaryLayer - 10 && y < wg.level.Height)
            {
                if (WorldGen.OctaveGenerator(v.noise, x, y, v.Settings) > v.Filter)
                {
                    wg.Level.tiles[x, y] = new Tile(v.Tile.Foreground)
                    {
                        Background = wg.Level.tiles[x, y].Background
                    }
                }
            }
            ;
        }

        void DirtInStone(object o, WorldGen wg, int x, int y, BiomeType b)
        {
            VeinSettings v = (VeinSettings)o;

            if (y >= wg.HeightMap[x] + b.SecondaryLayer - 10 && y < wg.level.Height)
            {
                if (WorldGen.OctaveGenerator(v.noise, x, y, v.Settings) > v.Filter)
                {
                    wg.Level.tiles[x, y] = new Tile(v.Tile.Foreground)
                    {
                        Background = v.Tile.Background
                    }
                }
            }
            ;
        }

        void StoneInDirt(object o, WorldGen wg, int x, int y, BiomeType b)
        {
            if (b != BiomeType.Taiga)
            {
                VeinSettings v = (VeinSettings)o;
                if (b == BiomeType.LushDesert || b == BiomeType.Desert || b == BiomeType.Marsh ? y >= wg.HeightMap[x] + wg.random.Next(7, 10) : y >= wg.HeightMap[x] + 1 && y < wg.HeightMap[x] + b.SecondaryLayer + 10)
                {
                    if (WorldGen.OctaveGenerator(v.noise, x, y, v.Settings) > v.Filter)
                    {
                        wg.Level.tiles[x, y] = new Tile(v.Tile.Foreground)
                        {
                            Background = v.Tile.Background
                        }
                    }
                }
                ;
            }
        }

        void SandInDirt(object o, WorldGen wg, int x, int y, BiomeType b)
        {
            VeinSettings v = (VeinSettings)o;

            if (b == BiomeType.Desert && y > wg.HeightMap[x] && y < wg.HeightMap[x] + b.SecondaryLayer + 10)
            {
                if (WorldGen.OctaveGenerator(v.noise, x, y, v.Settings) > v.Filter)
                {
                    wg.Level.tiles[x, y] = new Tile(v.Tile.Foreground)
                    {
                        Background = v.Tile.Background
                    }
                }
            }
            ;
        }

        void MudInDirt(object o, WorldGen wg, int x, int y, BiomeType b)
        {
            VeinSettings v = (VeinSettings)o;

            if ((b == BiomeType.Marsh || b == BiomeType.Fen) && y > wg.HeightMap[x] && y < wg.HeightMap[x] + b.SecondaryLayer + 10)
            {
                if (WorldGen.OctaveGenerator(v.noise, x, y, v.Settings) > v.Filter)
                {
                    wg.Level.tiles[x, y] = new Tile(v.Tile.Foreground)
                    {
                        Background = v.Tile.Background
                    }
                }
            }
            ;
        }

        void ClayInLushDesert(object o, WorldGen wg, int x, int y, BiomeType b)
        {
            VeinSettings v = (VeinSettings)o;

            if (b == BiomeType.LushDesert && y > wg.HeightMap[x] && y < wg.HeightMap[x] + b.SecondaryLayer + 10)
            {
                if (WorldGen.OctaveGenerator(v.noise, x, y, v.Settings) > v.Filter)
                {
                    wg.Level.tiles[x, y] = new Tile(v.Tile.Foreground)
                    {
                        Background = v.Tile.Background
                    }
                }
            }
            ;
        }

        void SandStoneInDesert(object o, WorldGen wg, int x, int y, BiomeType b)
        {
            VeinSettings v = (VeinSettings)o;

            if (b == BiomeType.LushDesert || b == BiomeType.Desert && y >= wg.HeightMap[x] && y < wg.HeightMap[x] + b.SecondaryLayer + 10)
            {
                if (WorldGen.OctaveGenerator(v.noise, x, y, v.Settings) > v.Filter)
                {
                    wg.Level.tiles[x, y] = new Tile(v.Tile.Foreground)
                    {
                        Background = v.Tile.Background
                    }
                }
            }
            ;
        }

        void LushDesert(object o, WorldGen wg, int x, int y, BiomeType b)
        {
            VeinSettings v = (VeinSettings)o;

            if (b == BiomeType.LushDesert || b == BiomeType.Desert && y > wg.HeightMap[x] && y < wg.HeightMap[x] + b.SecondaryLayer + 10)
            {
                if (WorldGen.OctaveGenerator(v.noise, x, y, v.Settings) > v.Filter)
                {
                    wg.Level.tiles[x, y] = new Tile(v.Tile.Foreground)
                    {
                        Background = v.Tile.Background
                    }
                }
            }
            ;
        }

        #endregion
    }
}