/*-- 
	Iron Peak
	Author: Maikel
	
	A mountain peak filled with iron ore and coal, the crust consists 
	of granite, rock, ice and some entrances.
--*/

// Fills an overlay randomly with the specified material.
overlay RandomMat {
	mask=1; invert=1; grp=1;
	// Combine multiple algortihms to obtain more regularity than just rndchecker.
	overlay {
		algo=rndchecker; a=18;
		zoomX=-25; zoomY=-25;
		turbulence=100; lambda=3;
		mask=1;
	} | overlay { 
		algo=bozo; a=25;
		zoomX=10; zoomY=-10;
		turbulence=1000; lambda=3;
		mask=1;
	} | overlay {
		algo=bozo; a=25;
		zoomX=-10; zoomY=10;
		turbulence=1000; lambda=3;
		mask=1;
	};
};

// Fills the mountain with materials.
overlay MountainMaterials {
	// Earth as background material.
	mat=Earth; tex=earth;
	RandomMat & overlay { mat=Earth; tex=earth_dry; };
	RandomMat & overlay { mat=Earth; tex=earth_rough; };
	// Combine random mat with all materials needed.
	RandomMat & overlay { mat=Granite; tex=granite; };
	RandomMat & overlay { mat=Rock; tex=rock_cracked; };
	RandomMat & overlay { mat=Snow; tex=snow1; };
	RandomMat & overlay { mat=Ice; tex=ice3; };
	RandomMat & overlay { mat=Rock; tex=rock; };
	RandomMat & overlay { mat=Tunnel; tex=tunnel; };
	RandomMat & overlay { mat=Ore; tex=ore; };
	RandomMat & overlay { mat=Sulphur; tex=sulphur; };
	RandomMat & overlay { mat=Coal; tex=coal; };
	// A little more diagonal tunnels.
	overlay { 
		algo=lines;	a=3; b=20;
		rotate=45;
		turbulence=100;
		mat=Tunnel; tex=tunnel;
	};
	overlay { 
		algo=lines;	a=3; b=20;
		rotate=-45;
		turbulence=100;
		mat=Tunnel; tex=tunnel;
	};
};

// Fills the mountain crust with rocks and some earth and ice.
overlay CrustMaterials {
	mat=Rock; tex=rock;
	// Combine random mat with crust materials.
	RandomMat & overlay { mat=Earth; tex=earth_dry; };
	RandomMat & overlay { mat=Ice; tex=ice3; };
	RandomMat & overlay { mat=Tunnel; tex=tunnel; };
	RandomMat & overlay { mat=Granite; tex=granite; };	
	RandomMat & overlay { mat=Rock; tex=rock_cracked; };
};

map IronPeak {
	overlay {
		// A simple mountain peak with the polygon algorithm.
		algo=poly;
		point { x=0%; y=140%; };
		point { x=45%; y=12%; };
		point { x=55%; y=12%; };
		point { x=100%; y=140%; };
		turbulence=100; lambda=1;
		// Fill the mountain with materials.
		MountainMaterials;
		overlay {
			// Create a crust mainly with rocks and some entrance points.
			algo=border; a=5; b=5;
			CrustMaterials;
		};
	}; 
};
