/*-- 
	Goldmine
	Author: Maikel
	
	A landscape with some smooth hills and some gold underneath the surface.
--*/

// Fills an overlay with random specks.
overlay RandomMat {
	mask=1; invert=1; grp=1;
	loosebounds=1;
	// Combine multiple algortihms.
	overlay {
		algo=rndchecker; a=10;
		zoomX=10; zoomY=-10;
		turbulence=100; lambda=3;
		mask=1; loosebounds=1;
	} | overlay { 
		algo=bozo; a=8;
		zoomX=10; zoomY=-10;
		turbulence=1000; lambda=3;
		mask=1; loosebounds=1;
	} | overlay {
		algo=bozo; a=8;
		zoomX=-10; zoomY=10;
		turbulence=1000; lambda=3;
		mask=1; loosebounds=1;
	};
};

// Fills an overlay with some random spots.
overlay RandomSpots {
	mask=1; invert=1; grp=1;
	overlay {
		algo=bozo; a=10;
		zoomX=10; zoomY=-10;
		turbulence=1000; lambda=3;
		mask=1; loosebounds=1;
	} & overlay {
		algo=bozo; a=10;
		zoomX=-10; zoomY=10;
		turbulence=1000; lambda=3;
		mask=1; loosebounds=1;
	};
};

map Goldmine {
	// Use the sine algorithm for some small hills.
 	overlay {
		mat=Earth; tex=earth;
 		algo=sin;
		zoomX=40; zoomY=-100;
 		ox=20; oy=40;
 		turbulence=10; lambda=0;
 		// Different types of earth, some tunnel and materials.
 		RandomMat & overlay {
 			mat=Tunnel; tex=tunnel;
 			overlay {
 				algo=border; a=1; b=1;
 				mat=Earth; tex=Earth;
 			};
 		};
 		RandomMat & overlay { mat=Earth; tex=earth_rough; };
		RandomMat & overlay { mat=Earth; tex=earth_dry; };
		RandomSpots & overlay { mat=Earth; tex=earth_topsoil; };
 		RandomSpots & overlay { mat=Earth; tex=earth_midsoil; };
		RandomSpots & overlay { mat=Coal; tex=coal; };
 		RandomSpots & overlay { mat=Sulphur; tex=sulphur; };
		RandomSpots & overlay { mat=Ore; tex=Ore; };
		// Make layers with different types of materials.
 		// Upper layer with sulphur and coal.
 		overlay {
 			x=0; y=58; wdt=100; hgt=12;
 			turbulence=10; lambda=3;
 			loosebounds=1; mask=1;
 			RandomMat & overlay { mat=Earth; tex=earth_topsoil; }; 
 			RandomMat & overlay { mat=Coal; tex=coal; };
 			RandomMat & overlay { mat=Sulphur; tex=sulphur; };
 		}; 		
 		// Middle layer with rock and ore.
 		overlay {
 			x=0; y=72; wdt=100; hgt=12;
 			turbulence=10; lambda=3;
 			loosebounds=1; mask=1;
 			RandomMat & overlay { mat=Earth; tex=earth_midsoil; };
 			RandomMat & overlay { mat=Rock; tex=rock; };
 			RandomMat & overlay { mat=Ore; tex=ore; };
 			RandomSpots & overlay { mat=Rock; tex=rock_cracked; };
 			RandomSpots & overlay { mat=Rock; tex=rock_cracked; };
 			RandomSpots & overlay { mat=Rock; tex=rock_cracked; };
 			RandomSpots & overlay { mat=Rock; tex=rock_cracked; };
 		}; 		
		// Bottom layer with gold.
 		overlay {
 			x=0; y=86; wdt=100; hgt=12;
 			turbulence=10; lambda=3;
 			loosebounds=1; mask=1;
 			RandomSpots & overlay { mat=Gold; tex=gold; };
 			RandomSpots & overlay { mat=Gold; tex=gold; };
 			RandomSpots & overlay { mat=Gold; tex=gold; };
 			RandomSpots & overlay { mat=Gold; tex=gold; };
 			RandomSpots & overlay { mat=Gold; tex=gold; };
 			RandomMat & overlay { mat=Gold; tex=gold; };
 			RandomMat & overlay { mat=Gold; tex=gold; };
 		}; 	
 		// Border of earth and sand.
 		overlay {
 			algo=border; a=3; b=3;
 			mat=Sand; tex=sand_rough;
 			RandomMat & overlay { mat=Earth; tex=earth_rough; };
			RandomMat & overlay { mat=Earth; tex=earth_dry; };
			RandomMat & overlay { mat=Earth; tex=earth; };
 		};
 	};
};
