label="Morpf vs Odol 18.04.2009"
version="1.6"
completion="victory"
campaign_type="multiplayer"
difficulty="NORMAL"
random_seed="5655"
random_calls="0"
next_underlying_unit_id="36"
end_text_duration="0"
[variables]
[/variables]
[replay]
	[command]
		[start]
		[/start]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Mattek has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="0"
			x="10"
			y="4"
		[/recruit]
		[random]
			value="12109"
		[/random]
		[random]
			value="7417"
		[/random]
		[random]
			value="8171"
		[/random]
		[random]
			value="31648"
		[/random]
		[random]
			value="8597"
		[/random]
		[random]
			value="4206"
		[/random]
		[random]
			value="15847"
		[/random]
		[random]
			value="13024"
		[/random]
		[random]
			value="22905"
		[/random]
		[random]
			value="7183"
		[/random]
		[random]
			value="7259"
		[/random]
		[random]
			value="16832"
		[/random]
		[random]
			value="9062"
		[/random]
		[random]
			value="31464"
		[/random]
		[random]
			value="26930"
			[results]
				checksum="F.puxQ8q-vqhspPuqvoeBIvxzyqxRKaVOEMsRHPLsxrnKSQUuPzuQTzBNpzqtPasFJDFNwNCmGSzKQuCLICMwz5BGNz0sHXttHryoCqiuuzfBrmxtBFSypdZF<grEJR6"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="1"
			x="9"
			y="4"
		[/recruit]
		[random]
			value="5379"
		[/random]
		[random]
			value="28476"
		[/random]
		[random]
			value="8008"
		[/random]
		[random]
			value="23084"
		[/random]
		[random]
			value="29401"
		[/random]
		[random]
			value="3448"
		[/random]
		[random]
			value="3478"
		[/random]
		[random]
			value="25465"
		[/random]
		[random]
			value="19594"
		[/random]
		[random]
			value="18649"
		[/random]
		[random]
			value="1622"
		[/random]
		[random]
			value="27598"
		[/random]
		[random]
			value="526"
		[/random]
		[random]
			value="18949"
		[/random]
		[random]
			value="30184"
			[results]
				checksum="MppsyKA8tq1H+rohkH2DZ9>b7j1h.rkiw1-Fek9X9FajMic5Q3Y959Xncn>g+J0<5+3mY8je7a461,hkEw7d1pgHD0ytJwg>n6zuefoWmmRC,xvlCaM1htCesyckpNss"
			[/results]
		[/random]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Odol"
			message="GL&HF"
			side="2"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="5"
			x="8"
			y="3"
		[/recruit]
		[random]
			value="23468"
		[/random]
		[random]
			value="30039"
		[/random]
		[random]
			value="29583"
		[/random]
		[random]
			value="19181"
		[/random]
		[random]
			value="29621"
		[/random]
		[random]
			value="15847"
		[/random]
		[random]
			value="24103"
		[/random]
		[random]
			value="23440"
		[/random]
		[random]
			value="30915"
		[/random]
		[random]
			value="4367"
		[/random]
		[random]
			value="10221"
		[/random]
		[random]
			value="30146"
		[/random]
		[random]
			value="32743"
		[/random]
		[random]
			value="17846"
		[/random]
		[random]
			value="18943"
			[results]
				checksum="8ax-d6b6xp8sjgga3aP72g3e+iBm.jefmffY-+6<ip3<5-4egW6m2lahna90i9fl5a1hh7oj8-<F->mkj.91>I6ygXo9WjoolcACZdd9b,<-lvi-OF>N69sv8joLJwPp"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="0"
			x="7"
			y="4"
		[/recruit]
		[random]
			value="18709"
		[/random]
		[random]
			value="24180"
		[/random]
		[random]
			value="13750"
		[/random]
		[random]
			value="22400"
		[/random]
		[random]
			value="29279"
		[/random]
		[random]
			value="31803"
		[/random]
		[random]
			value="32174"
		[/random]
		[random]
			value="20723"
		[/random]
		[random]
			value="29237"
		[/random]
		[random]
			value="5998"
		[/random]
		[random]
			value="15930"
		[/random]
		[random]
			value="12832"
		[/random]
		[random]
			value="23167"
		[/random]
		[random]
			value="24160"
		[/random]
		[random]
			value="50"
			[results]
				checksum="F.luxQ8q-vqhspPuqvoeBIvxzyqxRKaVOEMsRHPLsxrnKSQUuPzuQTzBNpzqtPasFJDFNwNCmGSzKQuCLMCMwz5BGNz0sHXttHryoCqiuuzfBrmxtBFMypdZF<gxEJR6"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="1"
			x="6"
			y="4"
		[/recruit]
		[random]
			value="31388"
		[/random]
		[random]
			value="11465"
		[/random]
		[random]
			value="12249"
		[/random]
		[random]
			value="4112"
		[/random]
		[random]
			value="20642"
		[/random]
		[random]
			value="21241"
		[/random]
		[random]
			value="2237"
		[/random]
		[random]
			value="22091"
		[/random]
		[random]
			value="29061"
		[/random]
		[random]
			value="25307"
		[/random]
		[random]
			value="6588"
		[/random]
		[random]
			value="6302"
		[/random]
		[random]
			value="9431"
		[/random]
		[random]
			value="19266"
		[/random]
		[random]
			value="1453"
			[results]
				checksum="MkpsyKA8tq1G+rohkH2DZ9>b7j1h.rkiw1-Fek9X9FajMic5Q3Y959Xncn>g+J0<5+3mY8je7a461,hkJw7d1pgHD0ytJwg>n6zuefoWmmRC,xvlCbQ1htCesyhkpNss"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Stilios has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,8,9"
			y="2,1,1"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="Morpf"
			message="you too"
			side="1"
		[/speak]
	[/command]
	[command]
		[recruit]
			value="6"
			x="12"
			y="23"
		[/recruit]
		[random]
			value="922"
		[/random]
		[random]
			value="2897"
		[/random]
		[random]
			value="871"
		[/random]
		[random]
			value="29923"
		[/random]
		[random]
			value="15587"
		[/random]
		[random]
			value="21113"
		[/random]
		[random]
			value="16427"
		[/random]
		[random]
			value="17961"
		[/random]
		[random]
			value="30625"
		[/random]
		[random]
			value="18130"
		[/random]
		[random]
			value="25767"
		[/random]
		[random]
			value="1630"
		[/random]
		[random]
			value="5959"
		[/random]
		[random]
			value="2899"
		[/random]
		[random]
			value="24584"
			[results]
				checksum="J59kONwuL-Q+4062sP>0637mC5373eQ6,a5n2j.dTe2hl89<fZ.a.g-4+XcWi.Xef>.1Xyja86>c+>fg4o.2cih1iXam6r,8m4,Z.v3Dnk4Yd84dfCd5sga,Y<,06m7r"
			[/results]
		[/random]
	[/command]
	[command]
		[recruit]
			value="6"
			x="16"
			y="23"
		[/recruit]
		[random]
			value="22925"
		[/random]
		[random]
			value="13964"
		[/random]
		[random]
			value="26398"
		[/random]
		[random]
			value="21413"
		[/random]
		[random]
			value="21637"
		[/random]
		[random]
			value="31481"
		[/random]
		[random]
			value="22291"
		[/random]
		[random]
			value="13393"
		[/random]
		[random]
			value="26664"
		[/random]
		[random]
			value="18784"
		[/random]
		[random]
			value="20785"
		[/random]
		[random]
			value="4672"
		[/random]
		[random]
			value="29887"
		[/random]
		[random]
			value="3764"
		[/random]
		[random]
			value="9516"
			[results]
				checksum="J59kLNwuL-Q+<062sP>0636mC5373eQ6,a5n2j.dTe2hl89<fZ.a.g-4+XcWi.Xef>.1Xyja86>c+>fg4o.2cih1iXak6r,8m4,Z.v3Dnk4Yd84dfCd5sga,Y<,09k7r"
			[/results]
		[/random]
	[/command]
	[command]
		[recruit]
			value="4"
			x="13"
			y="24"
		[/recruit]
		[random]
			value="31525"
		[/random]
		[random]
			value="12539"
		[/random]
		[random]
			value="6885"
		[/random]
		[random]
			value="3285"
		[/random]
		[random]
			value="29230"
		[/random]
		[random]
			value="29206"
		[/random]
		[random]
			value="32309"
		[/random]
		[random]
			value="9027"
		[/random]
		[random]
			value="20739"
		[/random]
		[random]
			value="17780"
		[/random]
		[random]
			value="12735"
		[/random]
		[random]
			value="2040"
		[/random]
		[random]
			value="3124"
		[/random]
		[random]
			value="8762"
		[/random]
		[random]
			value="4520"
			[results]
				checksum="6hs5opl9pneud6314Hg106a+elObfd5dh>d-kgk5j40fd5c,laoh2>q4W68<jj1,,Bh1+4l10mji0WUg681h64jGjKk7ELbfXlO69>IPFNIDBGnoCSO3srDyLKztBBJx"
			[/results]
		[/random]
	[/command]
	[command]
		[recruit]
			value="4"
			x="15"
			y="24"
		[/recruit]
		[random]
			value="25123"
		[/random]
		[random]
			value="24004"
		[/random]
		[random]
			value="5123"
		[/random]
		[random]
			value="13519"
		[/random]
		[random]
			value="2821"
		[/random]
		[random]
			value="5379"
		[/random]
		[random]
			value="28123"
		[/random]
		[random]
			value="26828"
		[/random]
		[random]
			value="27065"
		[/random]
		[random]
			value="19235"
		[/random]
		[random]
			value="3586"
		[/random]
		[random]
			value="5375"
		[/random]
		[random]
			value="17001"
		[/random]
		[random]
			value="8060"
		[/random]
		[random]
			value="4870"
			[results]
				checksum="jfC5opl9pneud6314Hg106a+elObfd5dh>d-kgk5j40fd5c,laoh2>q4W68<jj1,,Bh1+4l10mji-0Ug681h64jGjKk7ELYl9YI95gAxGxnvPuSVVEH>yBMtLAwyHUqR"
			[/results]
		[/random]
	[/command]
	[command]
		[recruit]
			value="4"
			x="14"
			y="24"
		[/recruit]
		[random]
			value="4531"
		[/random]
		[random]
			value="18121"
		[/random]
		[random]
			value="6195"
		[/random]
		[random]
			value="30565"
		[/random]
		[random]
			value="12077"
		[/random]
		[random]
			value="22695"
		[/random]
		[random]
			value="14070"
		[/random]
		[random]
			value="25670"
		[/random]
		[random]
			value="14924"
		[/random]
		[random]
			value="14920"
		[/random]
		[random]
			value="8283"
		[/random]
		[random]
			value="14201"
		[/random]
		[random]
			value="25544"
		[/random]
		[random]
			value="24784"
		[/random]
		[random]
			value="7945"
			[results]
				checksum="jfC5opl9pneud6314Hg106a+elObfd5dh>d-kgk5j40fd5c,laoh2>q4W68<jj1,,Bh1+4l10mji-0Ug681h64jGjKk7ELYl9YI95gAxGxnvPuSVVEH>yBMtLAwyHUqR"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="14,14,13"
			y="25,26,27"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="shagal has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,5,4,3,2"
			y="4,5,4,4,3"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,10,9,9,8"
			y="4,5,6,7,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,10,11,11,12"
			y="4,4,5,6,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="7,6,6,6,5"
			y="4,4,5,6,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,9,10,11,12,13,14,15,15,16"
			y="3,4,4,5,5,6,6,7,8,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,9,8"
			y="1,2,2"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="15,16,17,18,19,20"
			y="24,23,23,23,24,24"
		[/move]
	[/command]
	[command]
		[move]
			x="13,12,12,13,13,14"
			y="24,23,22,22,21,20"
		[/move]
	[/command]
	[command]
		[move]
			x="16,16,16,17,17,18,19,20"
			y="23,22,21,21,20,19,19,18"
		[/move]
	[/command]
	[command]
		[move]
			x="12,11,11,10,9,8,7,6"
			y="23,23,22,21,21,20,20,19"
		[/move]
	[/command]
	[command]
		[move]
			x="14,13,12,12,12,11"
			y="24,24,23,22,21,21"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="bodak has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="13,12,12,13,14"
			y="27,26,25,25,24"
		[/move]
	[/command]
	[command]
		[recruit]
			value="2"
			x="12"
			y="23"
		[/recruit]
		[random]
			value="19197"
		[/random]
		[random]
			value="22429"
		[/random]
		[random]
			value="27253"
		[/random]
		[random]
			value="499"
		[/random]
		[random]
			value="7383"
		[/random]
		[random]
			value="29631"
		[/random]
		[random]
			value="21823"
		[/random]
		[random]
			value="10054"
		[/random]
		[random]
			value="4622"
		[/random]
		[random]
			value="8654"
		[/random]
		[random]
			value="27186"
		[/random]
		[random]
			value="12874"
		[/random]
		[random]
			value="7594"
		[/random]
		[random]
			value="23109"
		[/random]
		[random]
			value="2863"
			[results]
				checksum="<3k85mndU3eF>a,..P305kg7W0d6cpzj<c3>k7>a,+alX1ah,2Wi<0o.-bnee7bo56d2incd,4Z6occi45H-f-5057b>02aa.o6Z+40CN5c8b.<X,47J.7v3b3e4xt<3"
			[/results]
		[/random]
	[/command]
	[command]
		[recruit]
			value="5"
			x="16"
			y="23"
		[/recruit]
		[random]
			value="27617"
		[/random]
		[random]
			value="30821"
		[/random]
		[random]
			value="10531"
		[/random]
		[random]
			value="24758"
		[/random]
		[random]
			value="13956"
		[/random]
		[random]
			value="29110"
		[/random]
		[random]
			value="13245"
		[/random]
		[random]
			value="22145"
		[/random]
		[random]
			value="10397"
		[/random]
		[random]
			value="25669"
		[/random]
		[random]
			value="14280"
		[/random]
		[random]
			value="5244"
		[/random]
		[random]
			value="30868"
		[/random]
		[random]
			value="7653"
		[/random]
		[random]
			value="14486"
			[results]
				checksum="SU39RsJPnopbtoBBt5yPBdjCxIoyMyJsCAbPtOQpxQRNpnMsQGGGqEpPQwrEETo0BNqQDyBuEICFSQFuTGrqGNJbRBzNpHETGFOwJPvMPJFf8IBNyQOKRJUZDRgO-mID"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Blinkinell has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="roku has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="boon has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Ferex has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="16,16,16,16,17,18,19,19,20"
			y="8,7,6,5,5,4,4,3,2"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="12,13,14,15,16"
			y="6,7,7,8,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,9,10,11,12"
			y="7,8,8,9,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Usstag has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="5,5,4,3,2"
			y="7,8,8,9,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="2,2,2,3,4,5"
			y="3,4,5,6,6,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="6,6,6,6,5,4,3,3"
			y="19,20,21,22,23,22,22,21"
		[/move]
	[/command]
	[command]
		[move]
			x="11,10,10,10,10"
			y="21,20,19,18,17"
		[/move]
	[/command]
	[command]
		[move]
			x="20,19,18,18,18"
			y="18,18,17,16,15"
		[/move]
	[/command]
	[command]
		[move]
			x="18,19"
			y="15,15"
		[/move]
	[/command]
	[command]
		[move]
			x="19,19"
			y="15,14"
		[/move]
	[/command]
	[command]
		[move]
			x="19,18"
			y="14,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Rrr has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="14,13,13,13,12,12"
			y="20,20,19,18,17,16"
		[/move]
	[/command]
	[command]
		[move]
			x="20,20,20,19,18,17"
			y="24,23,22,22,21,21"
		[/move]
	[/command]
	[command]
		[move]
			x="16,16,16,16,15,15"
			y="23,22,21,20,20,19"
		[/move]
	[/command]
	[command]
		[move]
			x="12,12,12,11,10,10,10"
			y="23,22,21,21,20,19,18"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="z3rgl1ng has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="King_Smasher has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="20,20,20,20,20"
			y="2,3,4,5,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="20,19"
			y="6,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="12,12,13"
			y="9,10,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="5,6,7,7"
			y="7,7,8,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="2,3"
			y="9,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="2"
			x="10"
			y="4"
		[/recruit]
		[random]
			value="22459"
		[/random]
		[random]
			value="32307"
		[/random]
		[random]
			value="4485"
		[/random]
		[random]
			value="14476"
		[/random]
		[random]
			value="239"
		[/random]
		[random]
			value="3600"
		[/random]
		[random]
			value="6082"
		[/random]
		[random]
			value="31639"
		[/random]
		[random]
			value="20681"
		[/random]
		[random]
			value="1231"
		[/random]
		[random]
			value="27869"
		[/random]
		[random]
			value="2949"
		[/random]
		[random]
			value="16774"
		[/random]
		[random]
			value="26188"
		[/random]
		[random]
			value="28045"
			[results]
				checksum="<0CL,<MA07qnKSwFonI1LxtPCvyvIJCEpbxFsqwtpJJCxrnKSQUuOzuQTzBNpzqtPasFJDFNwNCmGSzKQuCQLCMwz5BGNz0sHXttHryoCqiuuzfBrmxtBFNypdZF<gID"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="DAKKA_RickyDakka has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[recruit]
			value="3"
			x="12"
			y="23"
		[/recruit]
		[random]
			value="23426"
		[/random]
		[random]
			value="6867"
		[/random]
		[random]
			value="25802"
		[/random]
		[random]
			value="24660"
		[/random]
		[random]
			value="19925"
		[/random]
		[random]
			value="24484"
		[/random]
		[random]
			value="27439"
		[/random]
		[random]
			value="21978"
		[/random]
		[random]
			value="15714"
		[/random]
		[random]
			value="25057"
		[/random]
		[random]
			value="11793"
		[/random]
		[random]
			value="31657"
		[/random]
		[random]
			value="7903"
		[/random]
		[random]
			value="27122"
		[/random]
		[random]
			value="8330"
			[results]
				checksum="H-Q.4kSU1kP6gOQR,wHJxusL-.Ekr06z8QM,E>N>OoNiAM-x,w+es6q9HO5BeFhCwtP2J9TQGVxvQw8SMUFUUA1FGHuc9g.x6zCvNjoC,6pf75HoLfpj9>yBpy8oYyof"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="12,12,12,12,11"
			y="16,15,14,13,13"
		[/move]
	[/command]
	[command]
		[move]
			x="10,10,10,10,10"
			y="17,16,15,14,13"
		[/move]
	[/command]
	[command]
		[move]
			x="10,10,11,11,11,12"
			y="18,17,17,16,15,14"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Duress has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="3,3,2,2,2,2"
			y="21,22,22,23,24,25"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="tank has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="17,17,17,17"
			y="21,20,19,18"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="5333 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="15,15,14,14,13"
			y="19,18,17,16,16"
		[/move]
	[/command]
	[command]
		[move]
			x="18,18,18"
			y="13,12,11"
		[/move]
	[/command]
	[command]
		[move]
			x="18,18"
			y="11,10"
		[/move]
	[/command]
	[command]
		[move]
			x="18,18,18,18"
			y="10,11,12,13"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,10,10,11"
			y="4,5,6,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="2"
			x="10"
			y="4"
		[/recruit]
		[random]
			value="22058"
		[/random]
		[random]
			value="20668"
		[/random]
		[random]
			value="12199"
		[/random]
		[random]
			value="7988"
		[/random]
		[random]
			value="783"
		[/random]
		[random]
			value="31144"
		[/random]
		[random]
			value="16979"
		[/random]
		[random]
			value="27163"
		[/random]
		[random]
			value="6108"
		[/random]
		[random]
			value="24575"
		[/random]
		[random]
			value="4434"
		[/random]
		[random]
			value="9812"
		[/random]
		[random]
			value="22984"
		[/random]
		[random]
			value="24494"
		[/random]
		[random]
			value="17960"
			[results]
				checksum="<0CL,<MA07qnKSwEonI1LxtPCvyvIJCEpbxFsqwtpJJCxrnKSQUuOzuQTzBNpzqtPasFJDFNwNCmGSzKQuCQLCMwz5BGNz0sHXttHryoCqiuuzfBrmxtBFNypdZF<gDD"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Janitor has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="7,7,8,8,9"
			y="9,10,10,11,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="_LIfe has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Krane has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="LastSamurai has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="cubas has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="zako has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,10"
			y="12,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="3,4,5,6,7"
			y="10,9,9,8,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="19,18,18,17,16,16,16,15,15"
			y="7,6,5,5,5,6,7,8,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Kela has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="2,1,1,1,1,1,1"
			y="25,25,24,23,22,21,20"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Neves has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="12,12,11,10,10,10,10"
			y="23,22,22,21,20,19,18"
		[/move]
	[/command]
	[command]
		[recruit]
			value="3"
			x="12"
			y="23"
		[/recruit]
		[random]
			value="2943"
		[/random]
		[random]
			value="6764"
		[/random]
		[random]
			value="7148"
		[/random]
		[random]
			value="27460"
		[/random]
		[random]
			value="9636"
		[/random]
		[random]
			value="20860"
		[/random]
		[random]
			value="119"
		[/random]
		[random]
			value="20913"
		[/random]
		[random]
			value="8820"
		[/random]
		[random]
			value="1549"
		[/random]
		[random]
			value="12295"
		[/random]
		[random]
			value="28787"
		[/random]
		[random]
			value="32274"
		[/random]
		[random]
			value="2749"
		[/random]
		[random]
			value="7575"
			[results]
				checksum="H-Q.4kSV1kP6gOQR,wHJxusL-.Ekr06z8QM,E>N>OoNiAM-x,w+es6q9HO5BeFhCwtP2J9TQGVxuTw8SMUFUUA1FGHuc9g0x6zCvNjoC,6pf72FoLfpj9>yBpy8oZxof"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="17,17,16,16,16"
			y="18,17,16,15,14"
		[/move]
	[/command]
	[command]
		[move]
			x="18,18,18,18"
			y="13,12,11,10"
		[/move]
	[/command]
	[command]
		[move]
			x="18,18,19,20,21"
			y="10,9,9,9,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="tyler has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="z3rgl1ng has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Marcinian has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="12,13,14"
			y="14,14,14"
		[/move]
	[/command]
	[command]
		[move]
			x="13,13,12"
			y="16,15,14"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="RoninShogun has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Respect has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="spoc has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="superbank has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Marcinian has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Senitine has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,9"
			y="11,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Neves has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,11,11,11,11"
			y="7,8,9,10,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,10,10,11"
			y="4,5,6,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="16,16,17,17,18"
			y="8,9,10,11,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="LastSamurai has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Horun has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="CookieBite has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="cubas has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,16,17,18,19,20"
			y="9,9,9,9,9,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="1"
			x="6"
			y="4"
		[/recruit]
		[random]
			value="31961"
		[/random]
		[random]
			value="16463"
		[/random]
		[random]
			value="12521"
		[/random]
		[random]
			value="15065"
		[/random]
		[random]
			value="9152"
		[/random]
		[random]
			value="18198"
		[/random]
		[random]
			value="11363"
		[/random]
		[random]
			value="4675"
		[/random]
		[random]
			value="21562"
		[/random]
		[random]
			value="21698"
		[/random]
		[random]
			value="23635"
		[/random]
		[random]
			value="21711"
		[/random]
		[random]
			value="32190"
		[/random]
		[random]
			value="19450"
		[/random]
		[random]
			value="17819"
			[results]
				checksum="MppsyKA8tq1H+rohkH2DZ9>b7j1h.rkiw1-Fek9X9FajMic5Q3Y959Xncn>g+J0<5+3mY8je7a461,hkEw7d1pgHD0ytJwg>n6zuefoWmmRC,xvlCaM1htCesyckpNss"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Nath has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,9,10,11,12,13,14"
			y="2,3,2,2,2,2,2"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,8,7,6"
			y="12,12,13,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="7,7,8,8,9"
			y="9,10,10,11,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="1,1,1"
			y="20,19,18"
		[/move]
	[/command]
	[command]
		[move]
			x="1,1,1"
			y="18,17,16"
		[/move]
	[/command]
	[command]
		[move]
			x="10,10,10,9,8,8,7"
			y="18,17,16,16,15,14,14"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="7"
				y="14"
			[/source]
			[destination]
				x="6"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="8963"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="3222"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="31788"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="11861"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Ronyc has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="10,9,8"
			y="13,14,13"
		[/move]
	[/command]
	[command]
		[move]
			x="12,11,10,10"
			y="14,15,14,13"
		[/move]
	[/command]
	[command]
		[move]
			x="16,16"
			y="14,13"
		[/move]
	[/command]
	[command]
		[move]
			x="12,12,11,10,10,10,10,10"
			y="23,22,22,21,20,19,18,17"
		[/move]
	[/command]
	[command]
		[recruit]
			value="4"
			x="16"
			y="23"
		[/recruit]
		[random]
			value="22055"
		[/random]
		[random]
			value="21134"
		[/random]
		[random]
			value="30341"
		[/random]
		[random]
			value="12425"
		[/random]
		[random]
			value="31861"
		[/random]
		[random]
			value="10162"
		[/random]
		[random]
			value="16937"
		[/random]
		[random]
			value="681"
		[/random]
		[random]
			value="9259"
		[/random]
		[random]
			value="7827"
		[/random]
		[random]
			value="15045"
		[/random]
		[random]
			value="2909"
		[/random]
		[random]
			value="5049"
		[/random]
		[random]
			value="3880"
		[/random]
		[random]
			value="5759"
			[results]
				checksum="jfC5opl9pneud6314Hg106a+elObfd5dh>d-kgk5j40fd5c,laoh2>q4W68<jj1,,Bh1+4l10mji0.Ug681h64jGjKk7ELYl9YI95gAxGxnvPuSIVEH>yBMtLAwyHPDR"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="awaw has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Ben10 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="21"
				y="10"
			[/source]
			[destination]
				x="20"
				y="9"
			[/destination]
		[/attack]
		[random]
			value="24673"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1092"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="3468"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="27708"
			[results]
				chance="40"
				damage="12"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="30804"
			[results]
				chance="50"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Muffin has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="20"
				y="9"
			[/source]
			[destination]
				x="21"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="17912"
			[results]
				chance="40"
				damage="12"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="9651"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="13790"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="13158"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="15140"
			[results]
				chance="50"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="6"
				y="13"
			[/source]
			[destination]
				x="7"
				y="14"
			[/destination]
		[/attack]
		[random]
			value="2766"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="24121"
			[results]
				chance="50"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="5515"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="11586"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="7tenz has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Yan has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,8,7,7"
			y="12,11,12,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="7"
				y="13"
			[/source]
			[destination]
				x="7"
				y="14"
			[/destination]
		[/attack]
		[random]
			value="5836"
			[results]
				chance="40"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="18131"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="25265"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="3227"
			[results]
				chance="40"
				damage="10"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,10,9,8"
			y="11,11,12,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="8"
				y="12"
			[/source]
			[destination]
				x="8"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="10312"
			[results]
				chance="50"
				damage="18"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,11,11,12,12"
			y="7,8,9,9,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="13,12,11,10,9"
			y="11,10,11,11,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,6,6,5,5"
			y="4,5,6,7,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="14,13,12,11,10,9,8"
			y="2,2,2,2,2,3,2"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Senitine has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="3"
			x="10"
			y="4"
		[/recruit]
		[random]
			value="8080"
		[/random]
		[random]
			value="28233"
		[/random]
		[random]
			value="1635"
		[/random]
		[random]
			value="14067"
		[/random]
		[random]
			value="27030"
		[/random]
		[random]
			value="14308"
		[/random]
		[random]
			value="16582"
		[/random]
		[random]
			value="5998"
		[/random]
		[random]
			value="6526"
		[/random]
		[random]
			value="13160"
		[/random]
		[random]
			value="11977"
		[/random]
		[random]
			value="9470"
		[/random]
		[random]
			value="32324"
		[/random]
		[random]
			value="8177"
		[/random]
		[random]
			value="20196"
			[results]
				checksum="s67vszkDcAP6A+iACEP7A2muIutTrV-zNi5IwMDsI88+-635<idd<26oh6m2>-p8-0W.oZ8>>6f27lXfl8>9Z2A4b82p.au,,a+31>-PXX2S4+>Y,4gk3GZ9to8iVxJ<"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="exz has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="10,10,9,8,7,6"
			y="17,16,16,15,15,14"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="6"
				y="14"
			[/source]
			[destination]
				x="6"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="19876"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="9636"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="29709"
			[results]
				chance="60"
				damage="2"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="6227"
			[results]
				chance="60"
				damage="2"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="8"
				y="13"
			[/source]
			[destination]
				x="8"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="21545"
			[results]
				chance="70"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="30085"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="13642"
			[results]
				chance="70"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="13136"
			[results]
				chance="50"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="11,10,9"
			y="13,13,13"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="9"
				y="13"
			[/source]
			[destination]
				x="8"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="23942"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="11842"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="28525"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="16053"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="10,11,11,11"
			y="13,13,12,11"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="11"
				y="11"
			[/source]
			[destination]
				x="12"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="26760"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="11926"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="2363"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="16884"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="21,21,21,21"
			y="10,11,12,13"
		[/move]
	[/command]
	[command]
		[move]
			x="16,16,16,16,16,17"
			y="23,22,21,20,19,19"
		[/move]
	[/command]
	[command]
		[recruit]
			value="3"
			x="12"
			y="23"
		[/recruit]
		[random]
			value="12477"
		[/random]
		[random]
			value="20185"
		[/random]
		[random]
			value="5471"
		[/random]
		[random]
			value="28971"
		[/random]
		[random]
			value="23009"
		[/random]
		[random]
			value="19680"
		[/random]
		[random]
			value="18474"
		[/random]
		[random]
			value="1642"
		[/random]
		[random]
			value="29827"
		[/random]
		[random]
			value="17432"
		[/random]
		[random]
			value="2663"
		[/random]
		[random]
			value="20548"
		[/random]
		[random]
			value="19586"
		[/random]
		[random]
			value="26037"
		[/random]
		[random]
			value="18956"
			[results]
				checksum="H-Q.4kSV1kP6gOQR,wHJxusL-.Ekr06z8QM,E>N>OoNiAM-x,w+es6q9HO5BeFhCwtP2J9TQGVxvRw8SMUFUUA1FGHuc9g.x6zCvNjoC,6pf72FoLfpj9>yBpy8oYzof"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="1,1,1"
			y="16,15,14"
		[/move]
	[/command]
	[command]
		[move]
			x="1,1,1"
			y="14,13,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Cashim has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="5,4,3,2"
			y="8,8,9,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Bleyk has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="xxx has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,8,8,8,7"
			y="12,11,10,9,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="LastSamurai has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,10,9,8,8,7"
			y="4,5,6,6,7,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="20,20,21,21"
			y="9,10,11,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="21"
				y="12"
			[/source]
			[destination]
				x="21"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="28998"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="32016"
			[results]
				chance="50"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="24213"
			[results]
				chance="40"
				damage="12"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Respect has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="18,17,17,17,16"
			y="11,11,10,9,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="12"
				y="10"
			[/source]
			[destination]
				x="11"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="20289"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="9"
				y="12"
			[/source]
			[destination]
				x="9"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="1696"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="15000"
			[results]
				chance="30"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="10213"
			[results]
				chance="60"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="9339"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="27449"
			[results]
				chance="60"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Blinkinell has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="7"
				y="13"
			[/source]
			[destination]
				x="8"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="11162"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="29454"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="2757"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="18477"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="25410"
			[results]
				chance="50"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="6"
				y="13"
			[/source]
			[destination]
				x="6"
				y="14"
			[/destination]
		[/attack]
		[random]
			value="29598"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="10847"
			[results]
				chance="50"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="25385"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="19124"
			[results]
				chance="30"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="2"
			x="10"
			y="4"
		[/recruit]
		[random]
			value="14620"
		[/random]
		[random]
			value="9232"
		[/random]
		[random]
			value="29597"
		[/random]
		[random]
			value="16939"
		[/random]
		[random]
			value="5008"
		[/random]
		[random]
			value="18977"
		[/random]
		[random]
			value="16476"
		[/random]
		[random]
			value="339"
		[/random]
		[random]
			value="16167"
		[/random]
		[random]
			value="109"
		[/random]
		[random]
			value="5515"
		[/random]
		[random]
			value="12245"
		[/random]
		[random]
			value="26297"
		[/random]
		[random]
			value="14520"
		[/random]
		[random]
			value="1765"
			[results]
				checksum="<0CL,0MA07qnKSwEonI1LxtPCvyvIJCEpbxFsqwtpJJCxrnKSQUuOzuQTzBNpzqtPasFJDFNwNCmGSzKQuCQNCMwz5BGNz0sHXttHryoCqiuuzfBrmxtBFTypdZF<gDD"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Neves has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,8,8,8,8,8"
			y="2,3,4,5,6,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="8,8"
			y="13,14"
		[/move]
	[/command]
	[command]
		[move]
			x="6,7,8,8"
			y="14,15,14,13"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="8"
				y="13"
			[/source]
			[destination]
				x="7"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="22617"
			[results]
				chance="70"
				damage="2"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="29303"
			[results]
				chance="70"
				damage="2"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="29005"
			[results]
				chance="70"
				damage="2"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="11,10,9,8,7,7"
			y="11,10,10,10,11,12"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="7"
				y="12"
			[/source]
			[destination]
				x="7"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="26198"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2220"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="21530"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="28413"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="378"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="8,8,9,9"
			y="14,15,16,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Igor369PL has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="jam-on-the-toast has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="1,1,1"
			y="12,13,14"
		[/move]
	[/command]
	[command]
		[move]
			x="12,12,11,10,10,10,10,10"
			y="23,22,22,21,20,19,18,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="MJMX has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Bleyk has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="17,18,19,20"
			y="19,18,18,18"
		[/move]
	[/command]
	[command]
		[move]
			x="14,14,14,14,13"
			y="14,13,12,11,11"
		[/move]
	[/command]
	[command]
		[move]
			x="16,15,15,14"
			y="13,13,12,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Le_Yam has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[recruit]
			value="4"
			x="12"
			y="23"
		[/recruit]
		[random]
			value="23568"
		[/random]
		[random]
			value="10342"
		[/random]
		[random]
			value="16327"
		[/random]
		[random]
			value="28646"
		[/random]
		[random]
			value="31342"
		[/random]
		[random]
			value="20760"
		[/random]
		[random]
			value="21895"
		[/random]
		[random]
			value="11621"
		[/random]
		[random]
			value="15103"
		[/random]
		[random]
			value="17541"
		[/random]
		[random]
			value="31523"
		[/random]
		[random]
			value="24356"
		[/random]
		[random]
			value="22336"
		[/random]
		[random]
			value="3971"
		[/random]
		[random]
			value="7724"
			[results]
				checksum="6hs5opl9pneud6314Hg106a+elObfd5dh>d-kgk5j40fd5c,laoh2>q4W68<jj1,,Bh1+4l10mji0WUg681h64jGjKk7ELbfXlO69>IPFNIDBGnoCSO3srDyLKztBBJx"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Alibaba has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Robb has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="jaki has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="aupapa has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="7,7,7,7"
			y="8,9,10,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="7"
				y="11"
			[/source]
			[destination]
				x="7"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="28957"
			[results]
				chance="70"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="13169"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="26012"
			[results]
				chance="70"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="14262"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="20313"
			[results]
				chance="70"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="25933"
			[results]
				chance="70"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="15954"
			[results]
				chance="70"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="3984"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="24986"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="7178"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="32010"
			[results]
				chance="70"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="10446"
			[results]
				chance="70"
				damage="4"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,5,5,4,4,3"
			y="13,13,12,11,10,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,8"
			y="7,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="7,7,8"
			y="9,8,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="9"
				y="12"
			[/source]
			[destination]
				x="9"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="27625"
			[results]
				chance="60"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="25736"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="20755"
			[results]
				chance="60"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="18752"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="17841"
			[results]
				chance="60"
				damage="7"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Eragon1 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="2"
			weapon="1"
			[source]
				x="12"
				y="10"
			[/source]
			[destination]
				x="13"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="3522"
			[results]
				chance="40"
				damage="18"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="23672"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="28524"
			[results]
				chance="40"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="TiSU has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="21,21,21,21,21,21,20,19"
			y="12,11,10,9,8,7,6,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Eldorass has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="7,7,7,7,7"
			y="13,12,11,10,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,10,10,11"
			y="4,5,6,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Marverik has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="10,10,10,10,10,9"
			y="17,16,15,14,13,13"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="9"
				y="13"
			[/source]
			[destination]
				x="9"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="11252"
			[results]
				chance="60"
				damage="2"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="16084"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="12884"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="8,7,7"
			y="13,13,12"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="7"
				y="12"
			[/source]
			[destination]
				x="7"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="7809"
			[results]
				chance="70"
				damage="2"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="14321"
			[results]
				chance="70"
				damage="2"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="14009"
			[results]
				chance="70"
				damage="2"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="14,13,12,11,10"
			y="11,12,12,12,11"
		[/move]
	[/command]
	[command]
		[move]
			x="13,14,14,14,15"
			y="11,10,9,8,8"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="2"
			[source]
				x="15"
				y="8"
			[/source]
			[destination]
				x="16"
				y="8"
			[/destination]
		[/attack]
		[random]
			value="27229"
			[results]
				chance="50"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="6937"
			[results]
				chance="40"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="26819"
			[results]
				chance="50"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="1,1,1"
			y="14,13,12"
		[/move]
	[/command]
	[command]
		[move]
			x="9,9,8,7,6"
			y="17,18,18,19,19"
		[/move]
	[/command]
	[command]
		[move]
			x="12,12,12,11,10,10"
			y="23,22,21,21,20,19"
		[/move]
	[/command]
	[command]
		[recruit]
			value="4"
			x="12"
			y="23"
		[/recruit]
		[random]
			value="30475"
		[/random]
		[random]
			value="21573"
		[/random]
		[random]
			value="8181"
		[/random]
		[random]
			value="5437"
		[/random]
		[random]
			value="25873"
		[/random]
		[random]
			value="31870"
		[/random]
		[random]
			value="8105"
		[/random]
		[random]
			value="16192"
		[/random]
		[random]
			value="13540"
		[/random]
		[random]
			value="18354"
		[/random]
		[random]
			value="8522"
		[/random]
		[random]
			value="22249"
		[/random]
		[random]
			value="17802"
		[/random]
		[random]
			value="1819"
		[/random]
		[random]
			value="9784"
			[results]
				checksum="6hs5opl9mneud6314Hg106a+elObfd5dh>d-kgk5j40fd5c,laoh2>q4W68<jj1,,Bh1+4l10mji0YUg681h64jGjKk7ELbfXlO69>IPFNIDBGnBCSO3srDyLKztBBHx"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="beginner has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Arawath has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Avior has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="z3rgl1ng has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="avalan has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="PhoenixSuns has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Various has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Nerelf has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="jules has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="16"
				y="8"
			[/source]
			[destination]
				x="15"
				y="8"
			[/destination]
		[/attack]
		[random]
			value="9893"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="14110"
			[results]
				chance="50"
				damage="2"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="25522"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="29135"
			[results]
				chance="50"
				damage="2"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="32466"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="12,11"
			y="10,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="11"
				y="11"
			[/source]
			[destination]
				x="10"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="30628"
			[results]
				chance="50"
				damage="18"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Stilios has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Bonbonetty has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="2,1"
			y="9,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="3,2"
			y="10,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="salut has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Logalmier has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,9,9,9,10"
			y="7,8,9,10,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="10"
				y="10"
			[/source]
			[destination]
				x="10"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="18480"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Neo has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="7,7,8"
			y="9,8,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="7,7,7"
			y="11,10,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="9"
				y="12"
			[/source]
			[destination]
				x="9"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="10062"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="6040"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2754"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="23890"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="PhoenixSunsnnn has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="19,18,18,17,16,15,14,14"
			y="7,6,5,5,5,6,6,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="14"
				y="7"
			[/source]
			[destination]
				x="15"
				y="8"
			[/destination]
		[/attack]
		[random]
			value="1364"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="7962"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2348"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="25176"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,12,13,14"
			y="7,7,8,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="14"
				y="8"
			[/source]
			[destination]
				x="15"
				y="8"
			[/destination]
		[/attack]
		[random]
			value="18577"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="22599"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="16482"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="17502"
			[results]
				chance="70"
				damage="2"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,8,8,8"
			y="6,5,4,3"
		[/move]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="0"
			x="10"
			y="4"
		[/recruit]
		[random]
			value="28417"
		[/random]
		[random]
			value="5501"
		[/random]
		[random]
			value="4627"
		[/random]
		[random]
			value="19044"
		[/random]
		[random]
			value="23720"
		[/random]
		[random]
			value="25570"
		[/random]
		[random]
			value="1294"
		[/random]
		[random]
			value="27182"
		[/random]
		[random]
			value="22868"
		[/random]
		[random]
			value="1794"
		[/random]
		[random]
			value="18573"
		[/random]
		[random]
			value="12380"
		[/random]
		[random]
			value="3853"
		[/random]
		[random]
			value="7757"
		[/random]
		[random]
			value="25993"
			[results]
				checksum="F<juxQ8q-vqhtpPuqvoeBIvxzyqxRKaVOEMsRHPLsxrnKSQUuPzuQTzBNpzqtPasFJDFNwNCmGSzKQuCQKCMwz5BGNz0sHXttHryoCqiuuzfBrmxtBFSypdZF<grEJR6"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,8"
			y="3,4"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="10"
				y="11"
			[/source]
			[destination]
				x="10"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="28885"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="26780"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="15361"
			[results]
				chance="70"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="15536"
			[results]
				chance="50"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="15"
				y="8"
			[/source]
			[destination]
				x="14"
				y="7"
			[/destination]
		[/attack]
		[random]
			value="16403"
			[results]
				chance="50"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="6499"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="13508"
			[results]
				chance="50"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="beginner has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="7,6,5,4,3"
			y="12,11,11,10,10"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="3"
				y="10"
			[/source]
			[destination]
				x="2"
				y="9"
			[/destination]
		[/attack]
		[random]
			value="20809"
			[results]
				chance="60"
				damage="2"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="v0mi has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Br4inz has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="awaw2 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="9,10,11,11"
			y="13,13,13,12"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="11"
				y="12"
			[/source]
			[destination]
				x="11"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="13014"
			[results]
				chance="60"
				damage="2"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="27744"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="27401"
			[results]
				chance="60"
				damage="2"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="19119"
			[results]
				chance="60"
				damage="2"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="10,10,10,11,11,11"
			y="19,18,17,17,16,15"
		[/move]
	[/command]
	[command]
		[move]
			x="12,12,12,11,10,10,10"
			y="23,22,21,21,20,19,18"
		[/move]
	[/command]
	[command]
		[recruit]
			value="4"
			x="12"
			y="23"
		[/recruit]
		[random]
			value="22341"
		[/random]
		[random]
			value="16678"
		[/random]
		[random]
			value="16773"
		[/random]
		[random]
			value="17743"
		[/random]
		[random]
			value="11885"
		[/random]
		[random]
			value="19476"
		[/random]
		[random]
			value="1233"
		[/random]
		[random]
			value="3956"
		[/random]
		[random]
			value="21289"
		[/random]
		[random]
			value="5789"
		[/random]
		[random]
			value="13372"
		[/random]
		[random]
			value="10330"
		[/random]
		[random]
			value="5697"
		[/random]
		[random]
			value="6713"
		[/random]
		[random]
			value="24566"
			[results]
				checksum="6hs5opl9mneud6314Hg106a+elObfd5dh>d-kgk5j40fd5c,laoh2>q4W68<jj1,,Bh1+4l10mji0YUg681h64jGjKk7ELbfXlO69>IPFNIDBGnBCSO3srDyLKztBBHx"
			[/results]
		[/random]
	[/command]
	[command]
		[recruit]
			value="4"
			x="13"
			y="24"
		[/recruit]
		[random]
			value="4066"
		[/random]
		[random]
			value="32684"
		[/random]
		[random]
			value="26328"
		[/random]
		[random]
			value="25770"
		[/random]
		[random]
			value="3174"
		[/random]
		[random]
			value="16398"
		[/random]
		[random]
			value="14637"
		[/random]
		[random]
			value="4985"
		[/random]
		[random]
			value="28106"
		[/random]
		[random]
			value="13479"
		[/random]
		[random]
			value="27220"
		[/random]
		[random]
			value="18292"
		[/random]
		[random]
			value="7882"
		[/random]
		[random]
			value="20757"
		[/random]
		[random]
			value="17405"
			[results]
				checksum="6hs5opl9mneud6314Hg106a+elObfd5dh>d-kgk5j40fd5c,laoh2>q4W68<jj1,,Bh1+4l10mji0YUg681h64jGjKk7ELbfXlO69>IPFNIDBGnBCSO3srDyLKztBBHx"
			[/results]
		[/random]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="zajop has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="benno has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="shan has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Arawath1 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,11,11,11,11"
			y="11,10,9,8,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,11"
			y="10,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="11"
				y="11"
			[/source]
			[destination]
				x="11"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="9310"
			[results]
				chance="40"
				damage="22"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="5675"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="10636"
			[results]
				chance="40"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="9570"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="1"
			[source]
				x="9"
				y="12"
			[/source]
			[destination]
				x="10"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="1172"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="6195"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="27261"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="25854"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="asd11qq2 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="16"
				y="8"
			[/source]
			[destination]
				x="15"
				y="8"
			[/destination]
		[/attack]
		[random]
			value="32154"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="11107"
			[results]
				chance="50"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="24260"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="26147"
			[results]
				chance="50"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="15335"
			[results]
				chance="40"
				damage="6"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="14,13,13,13,13,12"
			y="7,8,9,10,11,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="12"
				y="11"
			[/source]
			[destination]
				x="11"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="12274"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="13437"
			[results]
				chance="50"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1175"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="14,13,12,11,10"
			y="8,9,9,10,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="10"
				y="10"
			[/source]
			[destination]
				x="10"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="4451"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="1,2"
			y="10,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="2"
				y="9"
			[/source]
			[destination]
				x="3"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="20596"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="30848"
			[results]
				chance="50"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="3225"
			[results]
				chance="30"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="10936"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,10,9,8,8,7"
			y="4,5,6,6,7,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="goomh has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,8"
			y="4,3"
		[/move]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="2"
			x="6"
			y="4"
		[/recruit]
		[random]
			value="9443"
		[/random]
		[random]
			value="10153"
		[/random]
		[random]
			value="7444"
		[/random]
		[random]
			value="19916"
		[/random]
		[random]
			value="10792"
		[/random]
		[random]
			value="9529"
		[/random]
		[random]
			value="12419"
		[/random]
		[random]
			value="21089"
		[/random]
		[random]
			value="13833"
		[/random]
		[random]
			value="12798"
		[/random]
		[random]
			value="327"
		[/random]
		[random]
			value="25124"
		[/random]
		[random]
			value="19159"
		[/random]
		[random]
			value="18573"
		[/random]
		[random]
			value="23275"
			[results]
				checksum="<0CL>,MA07qnKSwEonI1LxtPCvyvIJCEpbxFsqwtpJJCxrnKSQUuOzuQTzBNpzqtPasFJDFNwNCmGSzKQuCLJCMwz5BGNz0sHXttHryoCqiuuzfBrmxtBFNypdZF<gID"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,9,9,9,9"
			y="3,4,5,6,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="11,12"
			y="12,12"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="12"
				y="12"
			[/source]
			[destination]
				x="12"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="8003"
			[results]
				chance="60"
				damage="4"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="10"
				y="11"
			[/source]
			[destination]
				x="11"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="13202"
			[results]
				chance="40"
				damage="10"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="11,12,12,11,11,11"
			y="15,14,13,13,12,11"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="11"
				y="11"
			[/source]
			[destination]
				x="10"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="31039"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="7267"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="27479"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="23604"
			[results]
				chance="40"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="misha has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="3,4,5,6,7"
			y="10,9,10,10,10"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="7"
				y="10"
			[/source]
			[destination]
				x="7"
				y="9"
			[/destination]
		[/attack]
		[random]
			value="14592"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="18032"
			[results]
				chance="60"
				damage="3"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[choose]
			value="0"
		[/choose]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Gene_sys_ has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="shade84 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="pantera has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="10,10,10,10,10,10,11"
			y="18,17,16,15,14,13,13"
		[/move]
	[/command]
	[command]
		[move]
			x="12,12,12,11,10,10,10"
			y="23,22,21,21,20,19,18"
		[/move]
	[/command]
	[command]
		[move]
			x="13,12,12,12,12,12"
			y="24,23,22,21,20,19"
		[/move]
	[/command]
	[command]
		[recruit]
			value="4"
			x="12"
			y="23"
		[/recruit]
		[random]
			value="8013"
		[/random]
		[random]
			value="26056"
		[/random]
		[random]
			value="5718"
		[/random]
		[random]
			value="21532"
		[/random]
		[random]
			value="23083"
		[/random]
		[random]
			value="16587"
		[/random]
		[random]
			value="15795"
		[/random]
		[random]
			value="8978"
		[/random]
		[random]
			value="21347"
		[/random]
		[random]
			value="784"
		[/random]
		[random]
			value="19543"
		[/random]
		[random]
			value="22795"
		[/random]
		[random]
			value="25864"
		[/random]
		[random]
			value="10161"
		[/random]
		[random]
			value="29957"
			[results]
				checksum="6hs5opl9mneud6314Hg106a+elObfd5dh>d-kgk5j40fd5c,laoh2>q4W68<jj1,,Bh1+4l10mji0YUg681h64jGjKk7ELbfXlO69>IPFNIDBGnBCSO3srDyLKztBBHx"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Alibaba has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Battlesmile has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Urpo has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="gracz has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,10,11,12,12"
			y="10,9,9,9,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="12"
				y="10"
			[/source]
			[destination]
				x="11"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="6782"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="16,15,14,14,13"
			y="8,9,9,10,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Ged has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="7,7"
			y="8,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,6,6,6,7"
			y="4,5,6,7,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,9,9,8,8,7"
			y="7,8,9,9,10,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="7"
				y="11"
			[/source]
			[destination]
				x="7"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="15413"
			[results]
				chance="40"
				damage="19"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="9848"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="6835"
			[results]
				chance="40"
				damage="19"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="1"
			[source]
				x="9"
				y="12"
			[/source]
			[destination]
				x="10"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="5203"
			[results]
				chance="50"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="32031"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="12184"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="27138"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,11,11,10,10"
			y="7,8,9,9,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="10"
				y="10"
			[/source]
			[destination]
				x="10"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="4058"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="11856"
			[results]
				chance="70"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="941"
			[results]
				chance="50"
				damage="7"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="bastle has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Redplayer has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="11,11,10"
			y="13,12,11"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="10"
				y="11"
			[/source]
			[destination]
				x="10"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="375"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="20006"
			[results]
				chance="50"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="15736"
			[results]
				chance="70"
				damage="9"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="BarF has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="TehShadower has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="11,10,9,8"
			y="11,10,10,10"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="8"
				y="10"
			[/source]
			[destination]
				x="7"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="24126"
			[results]
				chance="40"
				damage="15"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="20224"
			[results]
				chance="60"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="28984"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="20332"
			[results]
				chance="60"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="15076"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Alibaba has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="10,10,10,9,8,7"
			y="18,17,16,16,15,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="dexter has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Duress1 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Undertaker has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="12,11,11"
			y="12,12,11"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="11"
				y="11"
			[/source]
			[destination]
				x="12"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="2187"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="5588"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="15815"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="9140"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="knight_ruben has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Nerelf has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="12,12,12,12,12,12"
			y="19,18,17,16,15,14"
		[/move]
	[/command]
	[command]
		[move]
			x="6,6,6,7,7,8"
			y="19,18,17,17,16,15"
		[/move]
	[/command]
	[command]
		[move]
			x="12,12,12,11,10,10,10"
			y="23,22,21,21,20,19,18"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="awaw has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Moab has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="12,13,14,15,16"
			y="10,10,9,9,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="13,12"
			y="11,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="12"
				y="10"
			[/source]
			[destination]
				x="11"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="16288"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="3967"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="6231"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1804"
			[results]
				chance="30"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="dexter has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="7,7,7"
			y="8,9,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="7"
				y="10"
			[/source]
			[destination]
				x="8"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="14995"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="7,7,8,9,9,9"
			y="9,8,7,8,9,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="9"
				y="10"
			[/source]
			[destination]
				x="8"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="27887"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="9080"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="28436"
			[results]
				chance="60"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="13517"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="24288"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="nilkiimas has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Entropy has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,7,7,8"
			y="7,8,9,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="8"
				y="9"
			[/source]
			[destination]
				x="8"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="24726"
			[results]
				chance="60"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="26047"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="17581"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="28336"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1724"
			[results]
				chance="60"
				damage="8"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="7,7,7,7,8"
			y="11,10,9,8,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="MCDonnalds has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Kometa has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="bodak has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,8,8,9,10"
			y="12,11,10,10,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="10"
				y="10"
			[/source]
			[destination]
				x="11"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="4730"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="30218"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="14295"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="13379"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="liquid has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="11"
				y="11"
			[/source]
			[destination]
				x="10"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="27492"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="11554"
			[results]
				chance="70"
				damage="2"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="2370"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="awaw has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="10,9,8,8"
			y="11,12,11,10"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="8"
				y="10"
			[/source]
			[destination]
				x="8"
				y="9"
			[/destination]
		[/attack]
		[random]
			value="27740"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="21086"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="29274"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="25655"
			[results]
				chance="60"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="10168"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Alibaba has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="12,12,11,11,10"
			y="14,13,13,12,11"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="10"
				y="11"
			[/source]
			[destination]
				x="10"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="385"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="9213"
			[results]
				chance="50"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="20390"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="17461"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="9948"
			[results]
				chance="50"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="nilkiimas has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="DeadEye has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="ZeusTheTrueGod has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Lega_Nord has logged into the lobby"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Odol"
			message="Where has my luck gone? :P"
			side="2"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Ronyc has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="7,7,7,7,6,6"
			y="15,14,13,12,11,10"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="6"
				y="10"
			[/source]
			[destination]
				x="7"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="28640"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="32634"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="15112"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="9921"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="deadmeat has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="xerox has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="8,8,7,7,7,7"
			y="15,14,14,13,12,11"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="7"
				y="11"
			[/source]
			[destination]
				x="7"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="18866"
			[results]
				chance="70"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="2222"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="15140"
			[results]
				chance="70"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="17362"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="10,10,10,10,10,10"
			y="18,17,16,15,14,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Dynasti has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[recruit]
			value="4"
			x="16"
			y="23"
		[/recruit]
		[random]
			value="31753"
		[/random]
		[random]
			value="5648"
		[/random]
		[random]
			value="20787"
		[/random]
		[random]
			value="8916"
		[/random]
		[random]
			value="2247"
		[/random]
		[random]
			value="23192"
		[/random]
		[random]
			value="23961"
		[/random]
		[random]
			value="8432"
		[/random]
		[random]
			value="4296"
		[/random]
		[random]
			value="30421"
		[/random]
		[random]
			value="14948"
		[/random]
		[random]
			value="2880"
		[/random]
		[random]
			value="4097"
		[/random]
		[random]
			value="32245"
		[/random]
		[random]
			value="22753"
			[results]
				checksum="6hs5opl9mneud6314Hg106a+elObfd5dh>d-kgk5j40fd5c,laoh2>q4W68<jj1,,Bh1+4l10mji--Ug681h64jGjKk7ELbfXlO69>IPFNIDBGnoCSO3srDyLKztBCMx"
			[/results]
		[/random]
	[/command]
	[command]
		[recruit]
			value="3"
			x="12"
			y="23"
		[/recruit]
		[random]
			value="6854"
		[/random]
		[random]
			value="7735"
		[/random]
		[random]
			value="10253"
		[/random]
		[random]
			value="31549"
		[/random]
		[random]
			value="26627"
		[/random]
		[random]
			value="1375"
		[/random]
		[random]
			value="32306"
		[/random]
		[random]
			value="27961"
		[/random]
		[random]
			value="28434"
		[/random]
		[random]
			value="10857"
		[/random]
		[random]
			value="27823"
		[/random]
		[random]
			value="25639"
		[/random]
		[random]
			value="12630"
		[/random]
		[random]
			value="9142"
		[/random]
		[random]
			value="8375"
			[results]
				checksum="H-Q.4kSU1kP6gOQR,wHJxusL-.Ekr06z8QM,E>N>OoNiAM-x,w+es6q9HO5BeFhCwtP2J9TQGVxvQw8SMUFUUA1FGHuc9g.x6zCvNjoC,6pf75HoLfpj9>yBpy8oYyof"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="20,19,18,18,18,19"
			y="18,18,17,16,15,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="Morpf"
			message="^^"
			side="1"
		[/speak]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="12"
				y="10"
			[/source]
			[destination]
				x="11"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="2376"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="26547"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="4471"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="16047"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,8,8,8,8"
			y="7,6,5,4,3"
		[/move]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="1"
			x="6"
			y="4"
		[/recruit]
		[random]
			value="22173"
		[/random]
		[random]
			value="22462"
		[/random]
		[random]
			value="31741"
		[/random]
		[random]
			value="26315"
		[/random]
		[random]
			value="29801"
		[/random]
		[random]
			value="9065"
		[/random]
		[random]
			value="2319"
		[/random]
		[random]
			value="20892"
		[/random]
		[random]
			value="22312"
		[/random]
		[random]
			value="1500"
		[/random]
		[random]
			value="25829"
		[/random]
		[random]
			value="19144"
		[/random]
		[random]
			value="730"
		[/random]
		[random]
			value="1383"
		[/random]
		[random]
			value="1443"
			[results]
				checksum="MdpsyKA8tq1H+rohkH2DZ9>b7j1h.rkiw1-Fek9X9FajMic5Q3Y959Xncn>g+J0<5+3mY8je7a461,hkQw7d1pgHD0ytJwg>n6zuefoWmmRC,xvlCaM1htCesyhkpNss"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="2"
			x="10"
			y="4"
		[/recruit]
		[random]
			value="7855"
		[/random]
		[random]
			value="23836"
		[/random]
		[random]
			value="15658"
		[/random]
		[random]
			value="29037"
		[/random]
		[random]
			value="9233"
		[/random]
		[random]
			value="30667"
		[/random]
		[random]
			value="27609"
		[/random]
		[random]
			value="27501"
		[/random]
		[random]
			value="7464"
		[/random]
		[random]
			value="27517"
		[/random]
		[random]
			value="14107"
		[/random]
		[random]
			value="19677"
		[/random]
		[random]
			value="3191"
		[/random]
		[random]
			value="19196"
		[/random]
		[random]
			value="22437"
			[results]
				checksum="<0CL,-MA07qnKSwFonI1LxtPCvyvIJCEpbxFsqwtpJJCxrnKSQUuOzuQTzBNpzqtPasFJDFNwNCmGSzKQuCQGCMwz5BGNz0sHXttHryoCqiuuzfBrmxtBFTypdZF<gID"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Nerelf has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="0"
			x="9"
			y="4"
		[/recruit]
		[random]
			value="12415"
		[/random]
		[random]
			value="1931"
		[/random]
		[random]
			value="1713"
		[/random]
		[random]
			value="16658"
		[/random]
		[random]
			value="23650"
		[/random]
		[random]
			value="5444"
		[/random]
		[random]
			value="19354"
		[/random]
		[random]
			value="16727"
		[/random]
		[random]
			value="8916"
		[/random]
		[random]
			value="20335"
		[/random]
		[random]
			value="19158"
		[/random]
		[random]
			value="14246"
		[/random]
		[random]
			value="27671"
		[/random]
		[random]
			value="22099"
		[/random]
		[random]
			value="22626"
			[results]
				checksum="F.puxQ8q-vqhspPuqvoeBIvxzyqxRKaVOEMsRHPLsxrnKSQUuPzuQTzBNpzqtPasFJDFNwNCmGSzKQuCLICMwz5BGNz0sHXttHryoCqiuuzfBrmxtBFSypdZF<grEJR6"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,8"
			y="3,4"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="7,7"
			y="10,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,7,7,8"
			y="9,9,8,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,10,10,10,11"
			y="10,9,8,7,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,9,9,8,7,6"
			y="10,9,8,7,8,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Igor369PL has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="16,15,14,13,12"
			y="8,8,8,9,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="11,10,10,10,11"
			y="11,10,9,8,8"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="11"
				y="8"
			[/source]
			[destination]
				x="11"
				y="7"
			[/destination]
		[/attack]
		[random]
			value="26442"
			[results]
				chance="60"
				damage="2"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[choose]
			value="0"
		[/choose]
	[/command]
	[command]
		[move]
			x="10,10,10,10,9"
			y="11,10,9,8,8"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="9"
				y="8"
			[/source]
			[destination]
				x="8"
				y="7"
			[/destination]
		[/attack]
		[random]
			value="313"
			[results]
				chance="50"
				damage="5"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="8,9,9,9,8"
			y="10,10,9,8,7"
		[/move]
	[/command]
	[command]
		[move]
			x="7,8,8"
			y="11,10,9"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="8"
				y="9"
			[/source]
			[destination]
				x="7"
				y="9"
			[/destination]
		[/attack]
		[random]
			value="8214"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="28288"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="7991"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="31811"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="6,7"
			y="10,10"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="7"
				y="10"
			[/source]
			[destination]
				x="7"
				y="9"
			[/destination]
		[/attack]
		[random]
			value="12787"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="28217"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="9797"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="31280"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Gyeprefos has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="10,9,8,8,7,6,6"
			y="13,13,12,11,11,10,9"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="6"
				y="9"
			[/source]
			[destination]
				x="7"
				y="9"
			[/destination]
		[/attack]
		[random]
			value="2475"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="15818"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="6899"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="23471"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Neo has logged into the lobby"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Odol"
			message="... nowhere to be found :)"
			side="2"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Alibaba has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="19,18,17,16,16"
			y="15,15,15,14,13"
		[/move]
	[/command]
	[command]
		[move]
			x="12,12,11,10,10,10,10"
			y="23,22,22,21,20,19,18"
		[/move]
	[/command]
	[command]
		[move]
			x="16,16,16,16,15,15"
			y="23,22,21,20,20,19"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="LordMaryn has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[recruit]
			value="4"
			x="12"
			y="23"
		[/recruit]
		[random]
			value="24218"
		[/random]
		[random]
			value="5177"
		[/random]
		[random]
			value="20453"
		[/random]
		[random]
			value="31480"
		[/random]
		[random]
			value="17521"
		[/random]
		[random]
			value="6429"
		[/random]
		[random]
			value="5183"
		[/random]
		[random]
			value="21013"
		[/random]
		[random]
			value="31441"
		[/random]
		[random]
			value="18962"
		[/random]
		[random]
			value="28513"
		[/random]
		[random]
			value="14320"
		[/random]
		[random]
			value="8122"
		[/random]
		[random]
			value="9004"
		[/random]
		[random]
			value="10972"
			[results]
				checksum="jfC5opl9pneud6314Hg106a+elObfd5dh>d-kgk5j40fd5c,laoh2>q4W68<jj1,,Bh1+4l10mji-0Ug681h64jGjKk7ELYl9YI95gAxGxnvPuSVVEH>yBMtLAwyHUqR"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="justin has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="Various"
			message="i will make some pangasius with potatoes :)"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="gbolt has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="liyimin has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="Various"
			message="I really like that fish"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,10,10,10,11"
			y="4,4,5,6,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="11"
				y="7"
			[/source]
			[destination]
				x="11"
				y="8"
			[/destination]
		[/attack]
		[random]
			value="11281"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="3564"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="22292"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="24576"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="579"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="12,12,11"
			y="10,9,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="11"
				y="9"
			[/source]
			[destination]
				x="11"
				y="8"
			[/destination]
		[/attack]
		[random]
			value="19951"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="3209"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="26344"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1658"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="11335"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="12,11,10,9"
			y="9,10,10,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="9"
				y="10"
			[/source]
			[destination]
				x="8"
				y="9"
			[/destination]
		[/attack]
		[random]
			value="31828"
			[results]
				chance="60"
				damage="18"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="Various"
			message="uh wasnt obs chat sorry"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="7"
				y="9"
			[/source]
			[destination]
				x="7"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="29219"
			[results]
				chance="60"
				damage="18"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Arthas has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,7"
			y="8,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="7"
				y="8"
			[/source]
			[destination]
				x="8"
				y="7"
			[/destination]
		[/attack]
		[random]
			value="1238"
			[results]
				chance="40"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="31555"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="28800"
			[results]
				chance="40"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="16248"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="26195"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Alibaba has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,8,8,9"
			y="4,5,6,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="9"
				y="7"
			[/source]
			[destination]
				x="8"
				y="7"
			[/destination]
		[/attack]
		[random]
			value="9268"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="28413"
			[results]
				chance="40"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="27829"
			[results]
				chance="40"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="5649"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="3203"
			[results]
				chance="40"
				damage="9"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="10,10,9,8,8"
			y="4,5,6,6,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="8"
				y="7"
			[/source]
			[destination]
				x="9"
				y="8"
			[/destination]
		[/attack]
		[random]
			value="16246"
			[results]
				chance="60"
				damage="18"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,6,6,6,6"
			y="4,5,6,7,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="6"
				y="8"
			[/source]
			[destination]
				x="6"
				y="9"
			[/destination]
		[/attack]
		[random]
			value="19057"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="exz has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="1"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="piepork has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="shura has logged into the lobby"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Odol"
			message="No problem :) I hate fish, though :/"
			side="2"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Pulsative has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="11,10"
			y="8,7"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="10"
				y="7"
			[/source]
			[destination]
				x="9"
				y="7"
			[/destination]
		[/attack]
		[random]
			value="19782"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="23575"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="843"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="32625"
			[results]
				chance="30"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="16784"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="18894"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="gracz has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Duthlet has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="9"
				y="8"
			[/source]
			[destination]
				x="9"
				y="7"
			[/destination]
		[/attack]
		[random]
			value="13616"
			[results]
				chance="40"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="17137"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="18819"
			[results]
				chance="40"
				damage="9"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Bonbonetty has logged into the lobby"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="Odol"
			message="GG"
			side="1"
		[/speak]
	[/command]
[/replay]
[snapshot]
[/snapshot]
[replay_start]
	current_tod="0"
	description="Two armies collide on this disjointed coastal landscape of hidden caves and jagged rivers."
	experience_modifier="70"
	hash="n4UrJ8rcXt8,3<A1JA6<klMKNRsw67ef6RRxl,bXnfuVpa6k>7x72gW.usb4lOB5W7DyGNNH3FpcaR>f9oL4,ZrrebnIWPTqLzev0<fvttGq0J1dbmwIfpk<B4qOTgqe"
	id="multiplayer_Sablestone_Delta"
	map_data="border_size=1
usage=map

Ss          , Gs          , Gs          , Gs          , Ss          , Ss          , Ss          , Ss          , Gs          , Gs          , Gs          , Ss          , Ss          , Gs          , Gs          , Gs          , Ww          , Ww          , Gs          , Uh          , Xu          , Xu          , Xu          
Gs          , Gs^Ft       , Gs^Ft       , Ss          , Ss          , Ss          , Gs^Ft       , Ss          , Ss          , Ss^Vhs      , Gs          , Gs^Ft       , Ss          , Ss          , Gs          , Gs^Ft       , Ww          , Ww          , Gs^Ft       , Uh          , Xu          , Xu          , Xu          
Ww          , Ww          , Gs          , Gs          , Gs          , Gs          , Gs          , Ss          , 1 Kud       , Ss          , Gs          , Gs          , Gs          , Gs          , Gs          , Ww          , Gs          , Gs          , Gs          , Gs^Uf       , Gs^Vht      , Xu          , Xu          
Xu          , Xu          , Gs^Vht      , Ww          , Ww          , Ww          , Ww          , Gs          , Kud         , Gs          , Ww          , Ww          , Ww          , Ww          , Gs          , Gs          , Ww          , Gs          , Xu          , Re          , Re          , Cud         , Ss          
Xu          , Xu          , Gs          , Gs          , Gs          , Ww          , Cud         , Cud         , Gs          , Cud         , Cud         , Ww          , Gs          , Gs          , Gs          , Ww          , Ww          , Gs          , Re          , Ss          , Re          , Re          , Ss          
Gs          , Gs^Ft       , Gs          , Ww          , Ww          , Gs          , Gs          , Ww          , Ww          , Ww          , Gs          , Gs          , Ww          , Ww          , Ww          , Gs          , Gs          , Gs          , Re          , Re          , Cud         , Re          , Re          
Ww          , Ww          , Ww          , Gs          , Gs          , Ww          , Gs          , Gs          , Wwf         , Gs          , Gs          , Gs          , Gs          , Gs          , Ww          , Ww          , Gs          , Xu          , Re          , Cud         , Re          , Re          , Xu          
Gs          , Gs          , Ww          , Gs          , Ww          , Gs          , Gs          , Gs          , Uu^Vud      , Gs          , Gs^Ft       , Hh          , Gs          , Gs          , Gs          , Gs          , Cud         , Xu          , Xu          , Uu^Vu       , Xu          , Re          , Xu          
Ww          , Ww          , Gs          , Ww          , Gs          , Gs          , Gs          , Cud         , Xu          , Wwf         , Wwf         , Gs^Ft       , Gs          , Gs          , Rd          , Cud         , Ss^Vhs      , Uh          , Ww          , Xu          , Xu          , Cud         , Ww          
Gs          , Gs          , Gs^Vht      , Gs          , Gs          , Gs^Ft       , Gs          , Cud         , Wwf         , Wwf         , Wwf         , Gs          , Cud         , Gs          , Gs          , Wwf         , Gs          , Gs          , Gs          , Cud         , Wwf         , Ww          , Ww          
Ww          , Gs^Ft       , Wwf         , Cud         , Rd          , Gs          , Wwf         , Wwf         , Gs          , Gs          , Gs          , Wwf         , Cud         , Rd          , Rd^Ft       , Gs          , Gs          , Gs          , Ww          , Xu          , Cud         , Cud         , Xu          
Gs          , Ww          , Xu          , Xu          , Rd          , Gs^Ft       , Wwf         , Gs          , Gs          , Ss          , Hh          , Cud         , Wwf         , Mm          , Gs^Ft       , Rd          , Gs          , Gs^Ft       , Hh          , Xu          , Xu          , Uh          , Xu          
Ww          , Gs^Ft       , Xu          , Gs          , Gs          , Gs          , Gs          , Wwf         , Wwf         , Mm          , Wwf         , Wwf         , Wwf         , Gs          , Gs          , Rd          , Rd^Uf       , Gs          , Gs          , Xu          , Xu          , Gs^Ft       , Gs^Ft       
Uh          , Ww          , Xu          , Cud         , Xu          , Rd          , Uh          , Gs          , Gs^Ft       , Wwf         , Hh          , Hh          , Gs          , Wwf         , Gs          , Uh          , Cud         , Rd^Ft       , Cud         , Rd^Ft       , Xu          , Cud         , Xu          
Xu          , Uh          , Xu          , Uu^Uf       , Cud         , Xu          , Cud         , Rd          , Gs          , Wwf         , Gs          , Mm^Xm       , Hh          , Wwf         , Gs^Ft       , Rd          , Uh          , Xu          , Xu          , Uu^Uf       , Xu          , Uh          , Uh          
Gs          , Cud         , Xu          , Rd^Ft       , Gs          , Rd^Ft       , Rd^Uf       , Uh          , Gs          , Wwf         , Wwf         , Hh          , Wwf         , Wwf         , Wwf         , Gs          , Gs          , Rd          , Rd          , Cud         , Xu          , Ww          , Ww          
Xu          , Gs^Ft       , Xu          , Xu          , Hh          , Gs          , Gs          , Rd          , Gs^Ft       , Gs          , Wwf         , Wwf         , Hh          , Mm          , Gs          , Wwf         , Wwf         , Gs^Ft       , Gs          , Gs          , Xu          , Gs^Ft       , Gs^Ft       
Xu          , Uh          , Cud         , Xu          , Ww          , Gs^Ft       , Gs          , Rd          , Rd^Ft       , Mm          , Cud         , Cud         , Gs          , Ss          , Gs          , Gs          , Wwf         , Gs          , Rd          , Xu          , Wwf         , Ww          , Ww          
Ww          , Cud         , Wwf         , Xu          , Gs          , Gs          , Gs          , Gs          , Gs          , Rd          , Cud         , Wwf         , Wwf         , Gs          , Wwf         , Wwf         , Gs          , Gs^Ft       , Rd          , Cud         , Gs^Vht      , Gs^Ft       , Gs          
Ww          , Ww          , Xu          , Cud         , Ww          , Gs          , Ss^Vhs      , Wwf         , Rd          , Gs          , Gs          , Gs          , Wwf         , Wwf         , Xu          , Cud         , Gs          , Gs          , Gs          , Gs          , Gs          , Gs          , Gs          
Xu          , Cud         , Xu          , Xu          , Xu          , Uh          , Cud         , Cud         , Gs          , Gs          , Gs          , Gs^Ft       , Gs^Ft       , Wwf         , Uu^Vud      , Cud         , Gs          , Gs          , Ww          , Ww          , Ww          , Ww          , Ww          
Xu          , Re          , Re          , Uu^Vu       , Re          , Xu          , Gs          , Gs          , Ww          , Gs          , Gs          , Hh          , Gs          , Gs          , Wwf         , Gs          , Gs          , Gs          , Gs          , Gs          , Ww          , Gs          , Gs          
Re          , Re          , Cud         , Cud         , Re          , Xu          , Gs          , Ww          , Ww          , Gs          , Ww          , Gs          , Gs          , Gs          , Ww          , Gs          , Gs          , Ww          , Ww          , Gs          , Gs          , Ww          , Ww          
Ss          , Re          , Re          , Re          , Re          , Gs          , Ww          , Gs          , Gs          , Ww          , Gs          , Gs          , Cud         , Ww          , Gs          , Ww          , Cud         , Gs          , Gs          , Ww          , Gs          , Gs^Ft       , Gs          
Ss          , Re          , Re          , Ss          , Xu          , Gs          , Ww          , Ww          , Ww          , Gs          , Ww          , Ww          , Ww          , Cud         , Kud         , Cud         , Ww          , Ww          , Ww          , Gs          , Gs^Vht      , Xu          , Xu          
Cud         , Cud         , Gs^Vht      , Re          , Gs          , Gs          , Gs          , Gs          , Ww          , Ww          , Gs          , Ww          , Gs          , Gs          , 2 Kud       , Gs          , Gs          , Ww          , Gs          , Ww          , Gs          , Xu          , Xu          
Xu          , Xu          , Xu          , Gs^Uf       , Gs^Ft       , Gs          , Ww          , Gs          , Gs          , Gs          , Gs^Ft       , Gs          , Gs          , Ss          , Ss          , Ss          , Gs          , Gs          , Ss          , Gs          , Gs^Ft       , Ww          , Ww          
Xu          , Xu          , Xu          , Uh          , Xu          , Ww          , Gs^Ft       , Gs          , Ss          , Ss          , Ss          , Ss          , Gs          , Ss^Vhs      , Ss          , Gs          , Gs^Ft       , Ss          , Ss          , Ss          , Ss          , Uh          , Uh          
Ww          , Ww          , Ww          , Xu          , Xu          , Xu          , Ss          , Gs          , Ss          , Xu          , Xu          , Xu          , Ss          , Ss          , Gs          , Xu          , Xu          , Xu          , Xu          , Gs^Ft       , Ss          , Xu          , Xu          
Ww          , Ww          , Ww          , Xu          , Xu          , Xu          , Ss          , Xu          , Ss          , Xu          , Xu          , Xu          , Ss          , Ss          , Gs          , Xu          , Xu          , Xu          , Xu          , Gs          , Ss          , Xu          , Xu          
"
	mp_countdown="yes"
	mp_countdown_action_bonus="20"
	mp_countdown_init_time="330"
	mp_countdown_reservoir_time="330"
	mp_countdown_turn_bonus="210"
	mp_fog="yes"
	mp_shroud="no"
	mp_use_map_settings="yes"
	mp_village_gold="2"
	name="2p - Sablestone Delta"
	next_underlying_unit_id="0"
	objectives="Victory:
@Defeat enemy leader(s)"
	observer="yes"
	random_seed="5655"
	random_start_time="no"
	scenario="Ladder (1650> only please)"
	turns="-1"
	version="1.6"
	[time]
		green="-20"
		id="dawn"
		image="misc/schedule-dawn.png"
		name=_ "Dawn"
		red="-20"
		sound="ambient/morning.ogg"
	[/time]
	[time]
		id="morning"
		image="misc/schedule-morning.png"
		lawful_bonus="25"
		name=_ "Morning"
	[/time]
	[time]
		id="afternoon"
		image="misc/schedule-afternoon.png"
		lawful_bonus="25"
		name=_ "Afternoon"
	[/time]
	[time]
		blue="-20"
		green="-20"
		id="dusk"
		image="misc/schedule-dusk.png"
		name=_ "Dusk"
		sound="ambient/night.ogg"
	[/time]
	[time]
		blue="-10"
		green="-40"
		id="first_watch"
		image="misc/schedule-firstwatch.png"
		lawful_bonus="-25"
		name=_ "First Watch"
		red="-40"
	[/time]
	[time]
		blue="-10"
		green="-40"
		id="second_watch"
		image="misc/schedule-secondwatch.png"
		lawful_bonus="-25"
		name=_ "Second Watch"
		red="-40"
	[/time]
	[music]
		ms_before="12000"
		name="knolls.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="wanderer.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="battle.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="transience.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="the_king_is_dead.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="knalgan_theme.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="the_city_falls.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="nunc_dimittis.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="revelation.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="loyalists.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="breaking_the_chains.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="elvish-theme.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="legends_of_the_north.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="traveling_minstrels.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="underground.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="vengeful.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="frantic.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="the_dangerous_symphony.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="heroes_rite.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="suspense.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="the_deep_path.ogg"
	[/music]
	[music]
		append="yes"
		ms_before="12000"
		name="siege_of_laurelmor.ogg"
	[/music]
	[event]
		name="prestart"
		[music]
			ms_before="12000"
			name="knolls.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="wanderer.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="battle.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="transience.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="revelation.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="loyalists.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="the_king_is_dead.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="knalgan_theme.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="the_city_falls.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="nunc_dimittis.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="breaking_the_chains.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="elvish-theme.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="legends_of_the_north.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="traveling_minstrels.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="underground.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="vengeful.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="frantic.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="the_dangerous_symphony.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="heroes_rite.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="suspense.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="the_deep_path.ogg"
		[/music]
		[music]
			append="yes"
			ms_before="12000"
			name="siege_of_laurelmor.ogg"
		[/music]
	[/event]
	[era]
		id="era_default"
#textdomain wesnoth-multiplayer
		name=_ "Default"
		[multiplayer_side]
			flag_rgb="magenta"
			id="Random"
			image="units/random-dice.png"
			name=_ "Random"
			random_faction="yes"
		[/multiplayer_side]
		[multiplayer_side]
			flag_rgb="magenta"
			id="Loyalists"
			image="units/human-loyalists/lieutenant.png"
			leader="Lieutenant,Swordsman,Pikeman,Javelineer,Shock Trooper,Longbowman,White Mage,Red Mage"
			name=_ "Loyalists"
			random_leader="Lieutenant,Swordsman,Pikeman,Javelineer,Longbowman,Red Mage"
			recruit="Cavalryman,Horseman,Spearman,Fencer,Heavy Infantryman,Bowman,Mage,Merman Fighter"
			terrain_liked="Gg, Ww, Wo"
			type="Lieutenant"
			[ai]
				recruitment_pattern="fighter,fighter,fighter,archer,mixed fighter,scout"
				[team_formula]
					rulebase="fai 'recruitment.fai'
		# ===== Some general functions used later ==== #

def sumarize_values( input_map )
	sum(
		values(input_map)
	);

def lowest_value( input_map )
	choose( input_map, -value ).value;

def highest_value( input_map )
	choose( input_map, value ).value;

def change_numbers_to_percents( input_map )
	map( input_map, 
		(value*100) / highest_value(input_map) 
	);

def add_number_to_values( input_map, number )
	map( input_map, 
		value + number 
	);

#make sure we have only positive values in a map #

def make_positive_only( input_map )
	if( lowest_value( input_map ) < 0, 
		add_number_to_values( 
			input_map, 
			abs(lowest_value(input_map))
		), 
		input_map 
	);

def sumarize_maps_values( map_A, map_B )
	map( map_A + map_B, 
		value + map_A[key]
	);

		#===== Evaluation how good unit is on a map ===== #

# ==1==  evaluate average defense #
#gives map where key is id of terrain, and value is number of hexes of that terrain on a gamemap#

def locations_map(ai*) 
	tomap( 
		map( 
			map.terrain, 
			id 
		) 
	);

#filters terrain map, min_percent it minimal % of map that terrain has to occupy to be considered in later evaluations# 

def filtered_locations_map(ai*, min_percent)
	filter( 
		locations_map(ai) , 
		value >  (map.w * map.h) / ( 100 / min_percent ) 
	);

#returns average defense of the unit #

def unit_average_defense(ai*, unit, terrain_min_percent )
	sum( 
		values( 
			map(
				filtered_locations_map(ai,terrain_min_percent), 
				defense_on( 
					unit, 
					find(map.terrain,id=key).loc
				) *
				value
			) 
		) 
	) / 
	sum(
		values(
			filtered_locations_map(
				ai,
				terrain_min_percent
			)
		)
	);

#returns map of units from units_list and their average defense (more -> better) #

def map_units_average_defense(ai*, units_list, terrain_min_percent) 
	tomap(
		map( 
			units_list, 
			id 
		), 
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	);

def units_average_defense(ai*, units_list, terrain_min_percent)
	sum(
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	) /
	size(
		units_list
	);


# ==2== TODO: evaluate unit effectivness based on movement points and movement cost#


		#===== Evaluation of game state - how good is ai doing ===== #

# ==1== based on unit cost and current amount of gold #
# returns number between 0 and 100 where: 0 we are losing, 100 we are winning #

def units_cost_gold_eval(ai*)
	min(
		[
			(
				(
					sum(
						map(
							allies, 'team', 
							sum(
								map(
									units_of_side[team], 
									cost
								)
							) + 
							teams[team].gold 
						)
					) * 
					100
				) / 
				sum(
					map(
						enemies, 'team', 
						sum(
							map(
								units_of_side[team], 
								cost
							)
						) + 
						max(
							[teams[team].gold, 0]
						) 
					)
				)
			) / 2,
			100
		]
	);

# ==2== based on village possession #

def count_allied_villages(ai*)
	sum(
		map(
			allies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

def count_enemy_villages(ai*)
	sum(
		map(
			enemies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

# multipled by 1000 to increase precision #

def village_evaluation(ai*)
	(
		50000 + 
		(
			count_allied_villages(ai) - 
			count_enemy_villages(ai)
		) * 
		(
			50000 /
			size(
				villages
			)
		)
	) /
	1000;

# ==3== combined 2 of the above #

def eval(ai*)
	( 
		units_cost_gold_eval(ai) + 
		village_evaluation(ai)
	) / 
	2;

		#===== Evaluation how effective my units are against the enemy ===== #

#==1==  basic evaluation #

# evaluate how much damage unit can inflict - how much damage unit can get#

def evaluate_attacker_against_opponents(ai*, unit, enemy_units)
	sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( unit, enemy_unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				) 
			)
		)
	);

def evaluate_defender_against_opponents(ai*, unit, enemy_units)
	-sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( enemy_unit, unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				)
			)
		)
	);

def units_hp_map(ai*, units)
	tomap( 
		map(
			units, 
			id
		), 
		map( 
			units, 
			hitpoints
		)
	);

#in case side's gold is more than 50, add units that side can recruit to the side's unit list#

def create_side_unit_list(ai*, side)
	if( 
		teams[side].gold > 50, 
		recruits_of_side[side], 
		[]
	) + 
	units_of_side[side];

def evaluate_my_recruits_as_attackers(ai*)
	tomap( 
		map(
			my_recruits, 
			id
		), 
		map(
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_attacker_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai, 
							enemy_side
						)
					)
				)
			)
		)
	);

def evaluate_my_recruits_as_defenders(ai*)
	tomap(
		map(
			my_recruits, 
			id
		),
		map( 
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_defender_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai,
							enemy_side
						)
					)
				)
			)
		)
	);


# === 2 ===  now consider abilities and weapon specials  #

def abilities_weights()
	['skirmisher' -> 15, 'ambush' -> 10, 'nightstalk' -> 20, 'regenerates' -> 20, 'healing' -> 15, 'curing' -> 10, 'leadership' -> 20, 'illumination' -> 15, 'teleport' -> 10, 'steadfast' -> 15 ];

def weapon_specials_weights()
	[ 'backstab' -> 20 ,'slow' -> 10 ,'berserk' -> 20 ,'stones' -> 60 ,'plague' -> 10 ,'marksman' -> 30 ,'magical' -> 40 ,'charge' -> 30 ,'drains' -> 30,  'firststrike' -> 10, 'poison' -> 25 ];

def apply_abilities_weights( units_map )
	map( 
		units_map, 
		value +
		(
			value * 
			max(
				map(
					get_unit_type( key ).abilities, 'ability',
					abilities_weights()[ability]
				)
			)
		) / 100
	);

def apply_weapon_specials_weights( units_map )
	map(
		units_map, 
		value +
		(
			value *
			max(
				map(
					get_unit_type( key ).attacks, 'attack',
					vars.weapon_specials[attack.special]
				)
			)
		) / 100
	);

# since undead units don't get random traits and are balanced with that, we need to lower their evaluation a bit to match fairly the living units #

def undead_malus( units_map )
	map( 
		units_map, 
		if(
			get_unit_type(key).undead,
			( value * 90 ) / 100,
			value 
		)
	);

# === 3 ===  pit 1 and 2 together  #

def evaluate_attackers(ai*)
	change_numbers_to_percents(
		apply_abilities_weights(
			apply_weapon_specials_weights(
				undead_malus( 
					make_positive_only(
						evaluate_my_recruits_as_attackers( ai )	
					)
				)
			)
		)
	);

def evaluate_defenders(ai*)
	map(
		map(
			change_numbers_to_percents(
				apply_abilities_weights(
					apply_weapon_specials_weights(
						undead_malus( 
							make_positive_only(
								evaluate_my_recruits_as_defenders( ai )	
							)
						)
					)
				)
			),
			value / 3
		), 
		value +
		map(
			change_numbers_to_percents(
				units_hp_map(
					ai,
					my_recruits
				)
			),
		value * 2 / 3
		)[key]
	);

	#=========== we have evaluation of game state and units, time to combine them: ==========#
		#=========	recruitment_list_builder	=========#

def rlb_apply_eval(eval, attackers_map, defenders_map, offset)
	map(
		sumarize_maps_values(
			map(
				attackers_map, 
				value * (eval+offset)
			),
			map(
				defenders_map,
				value * ( (100 - eval) - offset )
			)
		),
		value / 100
	);

def rlb_remove_lowest( input_map, percent)
	filter(
		input_map, 
		value > 
		(
			(
				percent * sumarize_values(input_map)
			) / 100
		)
	);

def rlb_first_step(eval, attackers_map, defenders_map, offset)
	rlb_remove_lowest(
		rlb_apply_eval(
			eval,
			attackers_map,
			defenders_map,
			offset
		),
		10
	);

def recruitment_list_builder(eval, attackers_map, defenders_map)
	map(
		rlb_first_step(
			eval,
			attackers_map,
			defenders_map,
			40
		),
		(
			(
				value * 100
			) / 
			sumarize_values(
				rlb_first_step(
					eval,
					attackers_map,
					defenders_map,
					40
				)
			)
		)
	);

		# ========== choose the unit to recruit now ========= #

def unit_chooser(ai*,unit_map) 
	choose(
		keys(unit_map), 'unit_type',
		unit_map[unit_type] - 
		(
			(
				100 * 
				size(
					filter(
						my_units, 
						type = unit_type
					)
				)
			) / 
			size(my_units)
		)
	);

def unit_map_cost_filter(ai*, unit_map)
	filter( unit_map,
		get_unit_type(key).cost < my_side.gold
	);

		# ==========	Main formula section 	========== #

def initialize_weapon_specials_map(ai*)
	if(vars.weapon_specials_init != turn,
		[
			set_var('weapon_specials_init', turn),
			set_var('weapon_specials',
				map(
					weapon_specials_weights(),
					if( key = 'magical',
						units_average_defense(ai, enemy_units, 10),
						if( key = 'marksman',
							units_average_defense(ai, enemy_units, 10) - 10,
							value
						)
					)
				)
			)
		],
		[]
	);

def create_recruits_map(ai*)
	if(vars.recruits_map_creator != turn,
		[
			set_var('recruits_map_creator', turn ),
			set_var('recruits_map',
				debug_print('final unit evaluation: ', recruitment_list_builder(
					debug_print('current AI evaluation (0-100): ', eval(ai)),
					debug_print('attackers evaluation: ',evaluate_attackers(ai)),
					debug_print('defenders evaluation: ',evaluate_defenders(ai))
				))
			)
		],
		[]
	);

def castle_space(ai*)
	filter( map( castle_locs( my_leader.loc ), 'location', if( unit_at( location ), 1, 0 ) ), self = 0  ).size;

if(vars.turn_initialized = turn,
		if( my_leader.loc = nearest_keep( my_leader.loc ),
			if( 
				get_unit_type(
					choose(
						vars.recruits_map,
						-get_unit_type(key).cost
					).key
				).cost <
				my_side.gold,
				if( castle_space(self),
					recruit(debug_print(
						unit_chooser(
							self,
							unit_map_cost_filter(
								self,
								vars.recruits_map
							)
						)
					)),
					fallback()
				),
				fallback() 
			),
			if( my_leader.movement_left > 0,
				move( my_leader.loc, nearest_keep( my_leader.loc ) ),
				fallback()
			)
		),
	[set_var(debug_print('turn_initialized'), turn)] +
	initialize_weapon_specials_map(self) +
	create_recruits_map(self)
)

faiend
"
				[/team_formula]
			[/ai]
		[/multiplayer_side]
		[multiplayer_side]
			flag_rgb="magenta"
			id="Rebels"
			image="units/elves-wood/captain.png"
			leader="Elvish Captain,Elvish Hero,Elvish Ranger,Elvish Marksman,Elvish Druid,Elvish Sorceress,White Mage,Red Mage,Elder Wose"
			name=_ "Rebels"
			random_leader="Elvish Captain,Elvish Hero,Elvish Ranger,Elvish Marksman,Elvish Druid,Elvish Sorceress,Red Mage"
			recruit="Elvish Fighter,Elvish Archer,Mage,Elvish Shaman,Elvish Scout,Wose,Merman Hunter"
			terrain_liked="Ff, Fa, Ss, Ww"
			type="Elvish Captain"
			[ai]
				recruitment_pattern="fighter,fighter,archer,archer,mixed fighter,healer,scout"
				[team_formula]
					rulebase="fai 'recruitment.fai'
		# ===== Some general functions used later ==== #

def sumarize_values( input_map )
	sum(
		values(input_map)
	);

def lowest_value( input_map )
	choose( input_map, -value ).value;

def highest_value( input_map )
	choose( input_map, value ).value;

def change_numbers_to_percents( input_map )
	map( input_map, 
		(value*100) / highest_value(input_map) 
	);

def add_number_to_values( input_map, number )
	map( input_map, 
		value + number 
	);

#make sure we have only positive values in a map #

def make_positive_only( input_map )
	if( lowest_value( input_map ) < 0, 
		add_number_to_values( 
			input_map, 
			abs(lowest_value(input_map))
		), 
		input_map 
	);

def sumarize_maps_values( map_A, map_B )
	map( map_A + map_B, 
		value + map_A[key]
	);

		#===== Evaluation how good unit is on a map ===== #

# ==1==  evaluate average defense #
#gives map where key is id of terrain, and value is number of hexes of that terrain on a gamemap#

def locations_map(ai*) 
	tomap( 
		map( 
			map.terrain, 
			id 
		) 
	);

#filters terrain map, min_percent it minimal % of map that terrain has to occupy to be considered in later evaluations# 

def filtered_locations_map(ai*, min_percent)
	filter( 
		locations_map(ai) , 
		value >  (map.w * map.h) / ( 100 / min_percent ) 
	);

#returns average defense of the unit #

def unit_average_defense(ai*, unit, terrain_min_percent )
	sum( 
		values( 
			map(
				filtered_locations_map(ai,terrain_min_percent), 
				defense_on( 
					unit, 
					find(map.terrain,id=key).loc
				) *
				value
			) 
		) 
	) / 
	sum(
		values(
			filtered_locations_map(
				ai,
				terrain_min_percent
			)
		)
	);

#returns map of units from units_list and their average defense (more -> better) #

def map_units_average_defense(ai*, units_list, terrain_min_percent) 
	tomap(
		map( 
			units_list, 
			id 
		), 
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	);

def units_average_defense(ai*, units_list, terrain_min_percent)
	sum(
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	) /
	size(
		units_list
	);


# ==2== TODO: evaluate unit effectivness based on movement points and movement cost#


		#===== Evaluation of game state - how good is ai doing ===== #

# ==1== based on unit cost and current amount of gold #
# returns number between 0 and 100 where: 0 we are losing, 100 we are winning #

def units_cost_gold_eval(ai*)
	min(
		[
			(
				(
					sum(
						map(
							allies, 'team', 
							sum(
								map(
									units_of_side[team], 
									cost
								)
							) + 
							teams[team].gold 
						)
					) * 
					100
				) / 
				sum(
					map(
						enemies, 'team', 
						sum(
							map(
								units_of_side[team], 
								cost
							)
						) + 
						max(
							[teams[team].gold, 0]
						) 
					)
				)
			) / 2,
			100
		]
	);

# ==2== based on village possession #

def count_allied_villages(ai*)
	sum(
		map(
			allies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

def count_enemy_villages(ai*)
	sum(
		map(
			enemies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

# multipled by 1000 to increase precision #

def village_evaluation(ai*)
	(
		50000 + 
		(
			count_allied_villages(ai) - 
			count_enemy_villages(ai)
		) * 
		(
			50000 /
			size(
				villages
			)
		)
	) /
	1000;

# ==3== combined 2 of the above #

def eval(ai*)
	( 
		units_cost_gold_eval(ai) + 
		village_evaluation(ai)
	) / 
	2;

		#===== Evaluation how effective my units are against the enemy ===== #

#==1==  basic evaluation #

# evaluate how much damage unit can inflict - how much damage unit can get#

def evaluate_attacker_against_opponents(ai*, unit, enemy_units)
	sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( unit, enemy_unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				) 
			)
		)
	);

def evaluate_defender_against_opponents(ai*, unit, enemy_units)
	-sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( enemy_unit, unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				)
			)
		)
	);

def units_hp_map(ai*, units)
	tomap( 
		map(
			units, 
			id
		), 
		map( 
			units, 
			hitpoints
		)
	);

#in case side's gold is more than 50, add units that side can recruit to the side's unit list#

def create_side_unit_list(ai*, side)
	if( 
		teams[side].gold > 50, 
		recruits_of_side[side], 
		[]
	) + 
	units_of_side[side];

def evaluate_my_recruits_as_attackers(ai*)
	tomap( 
		map(
			my_recruits, 
			id
		), 
		map(
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_attacker_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai, 
							enemy_side
						)
					)
				)
			)
		)
	);

def evaluate_my_recruits_as_defenders(ai*)
	tomap(
		map(
			my_recruits, 
			id
		),
		map( 
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_defender_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai,
							enemy_side
						)
					)
				)
			)
		)
	);


# === 2 ===  now consider abilities and weapon specials  #

def abilities_weights()
	['skirmisher' -> 15, 'ambush' -> 10, 'nightstalk' -> 20, 'regenerates' -> 20, 'healing' -> 15, 'curing' -> 10, 'leadership' -> 20, 'illumination' -> 15, 'teleport' -> 10, 'steadfast' -> 15 ];

def weapon_specials_weights()
	[ 'backstab' -> 20 ,'slow' -> 10 ,'berserk' -> 20 ,'stones' -> 60 ,'plague' -> 10 ,'marksman' -> 30 ,'magical' -> 40 ,'charge' -> 30 ,'drains' -> 30,  'firststrike' -> 10, 'poison' -> 25 ];

def apply_abilities_weights( units_map )
	map( 
		units_map, 
		value +
		(
			value * 
			max(
				map(
					get_unit_type( key ).abilities, 'ability',
					abilities_weights()[ability]
				)
			)
		) / 100
	);

def apply_weapon_specials_weights( units_map )
	map(
		units_map, 
		value +
		(
			value *
			max(
				map(
					get_unit_type( key ).attacks, 'attack',
					vars.weapon_specials[attack.special]
				)
			)
		) / 100
	);

# since undead units don't get random traits and are balanced with that, we need to lower their evaluation a bit to match fairly the living units #

def undead_malus( units_map )
	map( 
		units_map, 
		if(
			get_unit_type(key).undead,
			( value * 90 ) / 100,
			value 
		)
	);

# === 3 ===  pit 1 and 2 together  #

def evaluate_attackers(ai*)
	change_numbers_to_percents(
		apply_abilities_weights(
			apply_weapon_specials_weights(
				undead_malus( 
					make_positive_only(
						evaluate_my_recruits_as_attackers( ai )	
					)
				)
			)
		)
	);

def evaluate_defenders(ai*)
	map(
		map(
			change_numbers_to_percents(
				apply_abilities_weights(
					apply_weapon_specials_weights(
						undead_malus( 
							make_positive_only(
								evaluate_my_recruits_as_defenders( ai )	
							)
						)
					)
				)
			),
			value / 3
		), 
		value +
		map(
			change_numbers_to_percents(
				units_hp_map(
					ai,
					my_recruits
				)
			),
		value * 2 / 3
		)[key]
	);

	#=========== we have evaluation of game state and units, time to combine them: ==========#
		#=========	recruitment_list_builder	=========#

def rlb_apply_eval(eval, attackers_map, defenders_map, offset)
	map(
		sumarize_maps_values(
			map(
				attackers_map, 
				value * (eval+offset)
			),
			map(
				defenders_map,
				value * ( (100 - eval) - offset )
			)
		),
		value / 100
	);

def rlb_remove_lowest( input_map, percent)
	filter(
		input_map, 
		value > 
		(
			(
				percent * sumarize_values(input_map)
			) / 100
		)
	);

def rlb_first_step(eval, attackers_map, defenders_map, offset)
	rlb_remove_lowest(
		rlb_apply_eval(
			eval,
			attackers_map,
			defenders_map,
			offset
		),
		10
	);

def recruitment_list_builder(eval, attackers_map, defenders_map)
	map(
		rlb_first_step(
			eval,
			attackers_map,
			defenders_map,
			40
		),
		(
			(
				value * 100
			) / 
			sumarize_values(
				rlb_first_step(
					eval,
					attackers_map,
					defenders_map,
					40
				)
			)
		)
	);

		# ========== choose the unit to recruit now ========= #

def unit_chooser(ai*,unit_map) 
	choose(
		keys(unit_map), 'unit_type',
		unit_map[unit_type] - 
		(
			(
				100 * 
				size(
					filter(
						my_units, 
						type = unit_type
					)
				)
			) / 
			size(my_units)
		)
	);

def unit_map_cost_filter(ai*, unit_map)
	filter( unit_map,
		get_unit_type(key).cost < my_side.gold
	);

		# ==========	Main formula section 	========== #

def initialize_weapon_specials_map(ai*)
	if(vars.weapon_specials_init != turn,
		[
			set_var('weapon_specials_init', turn),
			set_var('weapon_specials',
				map(
					weapon_specials_weights(),
					if( key = 'magical',
						units_average_defense(ai, enemy_units, 10),
						if( key = 'marksman',
							units_average_defense(ai, enemy_units, 10) - 10,
							value
						)
					)
				)
			)
		],
		[]
	);

def create_recruits_map(ai*)
	if(vars.recruits_map_creator != turn,
		[
			set_var('recruits_map_creator', turn ),
			set_var('recruits_map',
				debug_print('final unit evaluation: ', recruitment_list_builder(
					debug_print('current AI evaluation (0-100): ', eval(ai)),
					debug_print('attackers evaluation: ',evaluate_attackers(ai)),
					debug_print('defenders evaluation: ',evaluate_defenders(ai))
				))
			)
		],
		[]
	);

def castle_space(ai*)
	filter( map( castle_locs( my_leader.loc ), 'location', if( unit_at( location ), 1, 0 ) ), self = 0  ).size;

if(vars.turn_initialized = turn,
		if( my_leader.loc = nearest_keep( my_leader.loc ),
			if( 
				get_unit_type(
					choose(
						vars.recruits_map,
						-get_unit_type(key).cost
					).key
				).cost <
				my_side.gold,
				if( castle_space(self),
					recruit(debug_print(
						unit_chooser(
							self,
							unit_map_cost_filter(
								self,
								vars.recruits_map
							)
						)
					)),
					fallback()
				),
				fallback() 
			),
			if( my_leader.movement_left > 0,
				move( my_leader.loc, nearest_keep( my_leader.loc ) ),
				fallback()
			)
		),
	[set_var(debug_print('turn_initialized'), turn)] +
	initialize_weapon_specials_map(self) +
	create_recruits_map(self)
)

faiend
"
				[/team_formula]
			[/ai]
		[/multiplayer_side]
		[multiplayer_side]
			flag_rgb="magenta"
			id="Northerners"
			image="units/orcs/warrior.png"
			leader="Orcish Warrior,Troll,Troll Rocklobber,Orcish Crossbowman,Orcish Slayer"
			name=_ "Northerners"
			recruit="Orcish Grunt,Troll Whelp,Wolf Rider,Orcish Archer,Orcish Assassin,Naga Fighter,Goblin Spearman"
			terrain_liked="Hh, Ha, Mm, Ss"
			type="Orcish Warrior"
			[ai]
				recruitment_pattern="fighter,fighter,fighter,mixed fighter,archer,scout"
				[team_formula]
					rulebase="fai 'recruitment.fai'
		# ===== Some general functions used later ==== #

def sumarize_values( input_map )
	sum(
		values(input_map)
	);

def lowest_value( input_map )
	choose( input_map, -value ).value;

def highest_value( input_map )
	choose( input_map, value ).value;

def change_numbers_to_percents( input_map )
	map( input_map, 
		(value*100) / highest_value(input_map) 
	);

def add_number_to_values( input_map, number )
	map( input_map, 
		value + number 
	);

#make sure we have only positive values in a map #

def make_positive_only( input_map )
	if( lowest_value( input_map ) < 0, 
		add_number_to_values( 
			input_map, 
			abs(lowest_value(input_map))
		), 
		input_map 
	);

def sumarize_maps_values( map_A, map_B )
	map( map_A + map_B, 
		value + map_A[key]
	);

		#===== Evaluation how good unit is on a map ===== #

# ==1==  evaluate average defense #
#gives map where key is id of terrain, and value is number of hexes of that terrain on a gamemap#

def locations_map(ai*) 
	tomap( 
		map( 
			map.terrain, 
			id 
		) 
	);

#filters terrain map, min_percent it minimal % of map that terrain has to occupy to be considered in later evaluations# 

def filtered_locations_map(ai*, min_percent)
	filter( 
		locations_map(ai) , 
		value >  (map.w * map.h) / ( 100 / min_percent ) 
	);

#returns average defense of the unit #

def unit_average_defense(ai*, unit, terrain_min_percent )
	sum( 
		values( 
			map(
				filtered_locations_map(ai,terrain_min_percent), 
				defense_on( 
					unit, 
					find(map.terrain,id=key).loc
				) *
				value
			) 
		) 
	) / 
	sum(
		values(
			filtered_locations_map(
				ai,
				terrain_min_percent
			)
		)
	);

#returns map of units from units_list and their average defense (more -> better) #

def map_units_average_defense(ai*, units_list, terrain_min_percent) 
	tomap(
		map( 
			units_list, 
			id 
		), 
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	);

def units_average_defense(ai*, units_list, terrain_min_percent)
	sum(
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	) /
	size(
		units_list
	);


# ==2== TODO: evaluate unit effectivness based on movement points and movement cost#


		#===== Evaluation of game state - how good is ai doing ===== #

# ==1== based on unit cost and current amount of gold #
# returns number between 0 and 100 where: 0 we are losing, 100 we are winning #

def units_cost_gold_eval(ai*)
	min(
		[
			(
				(
					sum(
						map(
							allies, 'team', 
							sum(
								map(
									units_of_side[team], 
									cost
								)
							) + 
							teams[team].gold 
						)
					) * 
					100
				) / 
				sum(
					map(
						enemies, 'team', 
						sum(
							map(
								units_of_side[team], 
								cost
							)
						) + 
						max(
							[teams[team].gold, 0]
						) 
					)
				)
			) / 2,
			100
		]
	);

# ==2== based on village possession #

def count_allied_villages(ai*)
	sum(
		map(
			allies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

def count_enemy_villages(ai*)
	sum(
		map(
			enemies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

# multipled by 1000 to increase precision #

def village_evaluation(ai*)
	(
		50000 + 
		(
			count_allied_villages(ai) - 
			count_enemy_villages(ai)
		) * 
		(
			50000 /
			size(
				villages
			)
		)
	) /
	1000;

# ==3== combined 2 of the above #

def eval(ai*)
	( 
		units_cost_gold_eval(ai) + 
		village_evaluation(ai)
	) / 
	2;

		#===== Evaluation how effective my units are against the enemy ===== #

#==1==  basic evaluation #

# evaluate how much damage unit can inflict - how much damage unit can get#

def evaluate_attacker_against_opponents(ai*, unit, enemy_units)
	sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( unit, enemy_unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				) 
			)
		)
	);

def evaluate_defender_against_opponents(ai*, unit, enemy_units)
	-sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( enemy_unit, unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				)
			)
		)
	);

def units_hp_map(ai*, units)
	tomap( 
		map(
			units, 
			id
		), 
		map( 
			units, 
			hitpoints
		)
	);

#in case side's gold is more than 50, add units that side can recruit to the side's unit list#

def create_side_unit_list(ai*, side)
	if( 
		teams[side].gold > 50, 
		recruits_of_side[side], 
		[]
	) + 
	units_of_side[side];

def evaluate_my_recruits_as_attackers(ai*)
	tomap( 
		map(
			my_recruits, 
			id
		), 
		map(
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_attacker_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai, 
							enemy_side
						)
					)
				)
			)
		)
	);

def evaluate_my_recruits_as_defenders(ai*)
	tomap(
		map(
			my_recruits, 
			id
		),
		map( 
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_defender_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai,
							enemy_side
						)
					)
				)
			)
		)
	);


# === 2 ===  now consider abilities and weapon specials  #

def abilities_weights()
	['skirmisher' -> 15, 'ambush' -> 10, 'nightstalk' -> 20, 'regenerates' -> 20, 'healing' -> 15, 'curing' -> 10, 'leadership' -> 20, 'illumination' -> 15, 'teleport' -> 10, 'steadfast' -> 15 ];

def weapon_specials_weights()
	[ 'backstab' -> 20 ,'slow' -> 10 ,'berserk' -> 20 ,'stones' -> 60 ,'plague' -> 10 ,'marksman' -> 30 ,'magical' -> 40 ,'charge' -> 30 ,'drains' -> 30,  'firststrike' -> 10, 'poison' -> 25 ];

def apply_abilities_weights( units_map )
	map( 
		units_map, 
		value +
		(
			value * 
			max(
				map(
					get_unit_type( key ).abilities, 'ability',
					abilities_weights()[ability]
				)
			)
		) / 100
	);

def apply_weapon_specials_weights( units_map )
	map(
		units_map, 
		value +
		(
			value *
			max(
				map(
					get_unit_type( key ).attacks, 'attack',
					vars.weapon_specials[attack.special]
				)
			)
		) / 100
	);

# since undead units don't get random traits and are balanced with that, we need to lower their evaluation a bit to match fairly the living units #

def undead_malus( units_map )
	map( 
		units_map, 
		if(
			get_unit_type(key).undead,
			( value * 90 ) / 100,
			value 
		)
	);

# === 3 ===  pit 1 and 2 together  #

def evaluate_attackers(ai*)
	change_numbers_to_percents(
		apply_abilities_weights(
			apply_weapon_specials_weights(
				undead_malus( 
					make_positive_only(
						evaluate_my_recruits_as_attackers( ai )	
					)
				)
			)
		)
	);

def evaluate_defenders(ai*)
	map(
		map(
			change_numbers_to_percents(
				apply_abilities_weights(
					apply_weapon_specials_weights(
						undead_malus( 
							make_positive_only(
								evaluate_my_recruits_as_defenders( ai )	
							)
						)
					)
				)
			),
			value / 3
		), 
		value +
		map(
			change_numbers_to_percents(
				units_hp_map(
					ai,
					my_recruits
				)
			),
		value * 2 / 3
		)[key]
	);

	#=========== we have evaluation of game state and units, time to combine them: ==========#
		#=========	recruitment_list_builder	=========#

def rlb_apply_eval(eval, attackers_map, defenders_map, offset)
	map(
		sumarize_maps_values(
			map(
				attackers_map, 
				value * (eval+offset)
			),
			map(
				defenders_map,
				value * ( (100 - eval) - offset )
			)
		),
		value / 100
	);

def rlb_remove_lowest( input_map, percent)
	filter(
		input_map, 
		value > 
		(
			(
				percent * sumarize_values(input_map)
			) / 100
		)
	);

def rlb_first_step(eval, attackers_map, defenders_map, offset)
	rlb_remove_lowest(
		rlb_apply_eval(
			eval,
			attackers_map,
			defenders_map,
			offset
		),
		10
	);

def recruitment_list_builder(eval, attackers_map, defenders_map)
	map(
		rlb_first_step(
			eval,
			attackers_map,
			defenders_map,
			40
		),
		(
			(
				value * 100
			) / 
			sumarize_values(
				rlb_first_step(
					eval,
					attackers_map,
					defenders_map,
					40
				)
			)
		)
	);

		# ========== choose the unit to recruit now ========= #

def unit_chooser(ai*,unit_map) 
	choose(
		keys(unit_map), 'unit_type',
		unit_map[unit_type] - 
		(
			(
				100 * 
				size(
					filter(
						my_units, 
						type = unit_type
					)
				)
			) / 
			size(my_units)
		)
	);

def unit_map_cost_filter(ai*, unit_map)
	filter( unit_map,
		get_unit_type(key).cost < my_side.gold
	);

		# ==========	Main formula section 	========== #

def initialize_weapon_specials_map(ai*)
	if(vars.weapon_specials_init != turn,
		[
			set_var('weapon_specials_init', turn),
			set_var('weapon_specials',
				map(
					weapon_specials_weights(),
					if( key = 'magical',
						units_average_defense(ai, enemy_units, 10),
						if( key = 'marksman',
							units_average_defense(ai, enemy_units, 10) - 10,
							value
						)
					)
				)
			)
		],
		[]
	);

def create_recruits_map(ai*)
	if(vars.recruits_map_creator != turn,
		[
			set_var('recruits_map_creator', turn ),
			set_var('recruits_map',
				debug_print('final unit evaluation: ', recruitment_list_builder(
					debug_print('current AI evaluation (0-100): ', eval(ai)),
					debug_print('attackers evaluation: ',evaluate_attackers(ai)),
					debug_print('defenders evaluation: ',evaluate_defenders(ai))
				))
			)
		],
		[]
	);

def castle_space(ai*)
	filter( map( castle_locs( my_leader.loc ), 'location', if( unit_at( location ), 1, 0 ) ), self = 0  ).size;

if(vars.turn_initialized = turn,
		if( my_leader.loc = nearest_keep( my_leader.loc ),
			if( 
				get_unit_type(
					choose(
						vars.recruits_map,
						-get_unit_type(key).cost
					).key
				).cost <
				my_side.gold,
				if( castle_space(self),
					recruit(debug_print(
						unit_chooser(
							self,
							unit_map_cost_filter(
								self,
								vars.recruits_map
							)
						)
					)),
					fallback()
				),
				fallback() 
			),
			if( my_leader.movement_left > 0,
				move( my_leader.loc, nearest_keep( my_leader.loc ) ),
				fallback()
			)
		),
	[set_var(debug_print('turn_initialized'), turn)] +
	initialize_weapon_specials_map(self) +
	create_recruits_map(self)
)

faiend
"
				[/team_formula]
			[/ai]
		[/multiplayer_side]
		[multiplayer_side]
			flag_rgb="magenta"
			id="Undead"
			image="units/undead-necromancers/dark-sorcerer.png"
			leader="Dark Sorcerer,Revenant,Deathblade,Bone Shooter,Necrophage"
			name=_ "Undead"
			random_leader="Dark Sorcerer,Revenant,Deathblade,Bone Shooter"
			recruit="Skeleton,Skeleton Archer,Walking Corpse,Ghost,Vampire Bat,Dark Adept,Ghoul"
			terrain_liked="Ss, Hh, Ha, Ww"
			type="Dark Sorcerer"
			[ai]
				recruitment_pattern="fighter,fighter,archer,fighter,scout,archer"
				[team_formula]
					rulebase="fai 'recruitment.fai'
		# ===== Some general functions used later ==== #

def sumarize_values( input_map )
	sum(
		values(input_map)
	);

def lowest_value( input_map )
	choose( input_map, -value ).value;

def highest_value( input_map )
	choose( input_map, value ).value;

def change_numbers_to_percents( input_map )
	map( input_map, 
		(value*100) / highest_value(input_map) 
	);

def add_number_to_values( input_map, number )
	map( input_map, 
		value + number 
	);

#make sure we have only positive values in a map #

def make_positive_only( input_map )
	if( lowest_value( input_map ) < 0, 
		add_number_to_values( 
			input_map, 
			abs(lowest_value(input_map))
		), 
		input_map 
	);

def sumarize_maps_values( map_A, map_B )
	map( map_A + map_B, 
		value + map_A[key]
	);

		#===== Evaluation how good unit is on a map ===== #

# ==1==  evaluate average defense #
#gives map where key is id of terrain, and value is number of hexes of that terrain on a gamemap#

def locations_map(ai*) 
	tomap( 
		map( 
			map.terrain, 
			id 
		) 
	);

#filters terrain map, min_percent it minimal % of map that terrain has to occupy to be considered in later evaluations# 

def filtered_locations_map(ai*, min_percent)
	filter( 
		locations_map(ai) , 
		value >  (map.w * map.h) / ( 100 / min_percent ) 
	);

#returns average defense of the unit #

def unit_average_defense(ai*, unit, terrain_min_percent )
	sum( 
		values( 
			map(
				filtered_locations_map(ai,terrain_min_percent), 
				defense_on( 
					unit, 
					find(map.terrain,id=key).loc
				) *
				value
			) 
		) 
	) / 
	sum(
		values(
			filtered_locations_map(
				ai,
				terrain_min_percent
			)
		)
	);

#returns map of units from units_list and their average defense (more -> better) #

def map_units_average_defense(ai*, units_list, terrain_min_percent) 
	tomap(
		map( 
			units_list, 
			id 
		), 
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	);

def units_average_defense(ai*, units_list, terrain_min_percent)
	sum(
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	) /
	size(
		units_list
	);


# ==2== TODO: evaluate unit effectivness based on movement points and movement cost#


		#===== Evaluation of game state - how good is ai doing ===== #

# ==1== based on unit cost and current amount of gold #
# returns number between 0 and 100 where: 0 we are losing, 100 we are winning #

def units_cost_gold_eval(ai*)
	min(
		[
			(
				(
					sum(
						map(
							allies, 'team', 
							sum(
								map(
									units_of_side[team], 
									cost
								)
							) + 
							teams[team].gold 
						)
					) * 
					100
				) / 
				sum(
					map(
						enemies, 'team', 
						sum(
							map(
								units_of_side[team], 
								cost
							)
						) + 
						max(
							[teams[team].gold, 0]
						) 
					)
				)
			) / 2,
			100
		]
	);

# ==2== based on village possession #

def count_allied_villages(ai*)
	sum(
		map(
			allies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

def count_enemy_villages(ai*)
	sum(
		map(
			enemies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

# multipled by 1000 to increase precision #

def village_evaluation(ai*)
	(
		50000 + 
		(
			count_allied_villages(ai) - 
			count_enemy_villages(ai)
		) * 
		(
			50000 /
			size(
				villages
			)
		)
	) /
	1000;

# ==3== combined 2 of the above #

def eval(ai*)
	( 
		units_cost_gold_eval(ai) + 
		village_evaluation(ai)
	) / 
	2;

		#===== Evaluation how effective my units are against the enemy ===== #

#==1==  basic evaluation #

# evaluate how much damage unit can inflict - how much damage unit can get#

def evaluate_attacker_against_opponents(ai*, unit, enemy_units)
	sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( unit, enemy_unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				) 
			)
		)
	);

def evaluate_defender_against_opponents(ai*, unit, enemy_units)
	-sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( enemy_unit, unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				)
			)
		)
	);

def units_hp_map(ai*, units)
	tomap( 
		map(
			units, 
			id
		), 
		map( 
			units, 
			hitpoints
		)
	);

#in case side's gold is more than 50, add units that side can recruit to the side's unit list#

def create_side_unit_list(ai*, side)
	if( 
		teams[side].gold > 50, 
		recruits_of_side[side], 
		[]
	) + 
	units_of_side[side];

def evaluate_my_recruits_as_attackers(ai*)
	tomap( 
		map(
			my_recruits, 
			id
		), 
		map(
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_attacker_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai, 
							enemy_side
						)
					)
				)
			)
		)
	);

def evaluate_my_recruits_as_defenders(ai*)
	tomap(
		map(
			my_recruits, 
			id
		),
		map( 
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_defender_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai,
							enemy_side
						)
					)
				)
			)
		)
	);


# === 2 ===  now consider abilities and weapon specials  #

def abilities_weights()
	['skirmisher' -> 15, 'ambush' -> 10, 'nightstalk' -> 20, 'regenerates' -> 20, 'healing' -> 15, 'curing' -> 10, 'leadership' -> 20, 'illumination' -> 15, 'teleport' -> 10, 'steadfast' -> 15 ];

def weapon_specials_weights()
	[ 'backstab' -> 20 ,'slow' -> 10 ,'berserk' -> 20 ,'stones' -> 60 ,'plague' -> 10 ,'marksman' -> 30 ,'magical' -> 40 ,'charge' -> 30 ,'drains' -> 30,  'firststrike' -> 10, 'poison' -> 25 ];

def apply_abilities_weights( units_map )
	map( 
		units_map, 
		value +
		(
			value * 
			max(
				map(
					get_unit_type( key ).abilities, 'ability',
					abilities_weights()[ability]
				)
			)
		) / 100
	);

def apply_weapon_specials_weights( units_map )
	map(
		units_map, 
		value +
		(
			value *
			max(
				map(
					get_unit_type( key ).attacks, 'attack',
					vars.weapon_specials[attack.special]
				)
			)
		) / 100
	);

# since undead units don't get random traits and are balanced with that, we need to lower their evaluation a bit to match fairly the living units #

def undead_malus( units_map )
	map( 
		units_map, 
		if(
			get_unit_type(key).undead,
			( value * 90 ) / 100,
			value 
		)
	);

# === 3 ===  pit 1 and 2 together  #

def evaluate_attackers(ai*)
	change_numbers_to_percents(
		apply_abilities_weights(
			apply_weapon_specials_weights(
				undead_malus( 
					make_positive_only(
						evaluate_my_recruits_as_attackers( ai )	
					)
				)
			)
		)
	);

def evaluate_defenders(ai*)
	map(
		map(
			change_numbers_to_percents(
				apply_abilities_weights(
					apply_weapon_specials_weights(
						undead_malus( 
							make_positive_only(
								evaluate_my_recruits_as_defenders( ai )	
							)
						)
					)
				)
			),
			value / 3
		), 
		value +
		map(
			change_numbers_to_percents(
				units_hp_map(
					ai,
					my_recruits
				)
			),
		value * 2 / 3
		)[key]
	);

	#=========== we have evaluation of game state and units, time to combine them: ==========#
		#=========	recruitment_list_builder	=========#

def rlb_apply_eval(eval, attackers_map, defenders_map, offset)
	map(
		sumarize_maps_values(
			map(
				attackers_map, 
				value * (eval+offset)
			),
			map(
				defenders_map,
				value * ( (100 - eval) - offset )
			)
		),
		value / 100
	);

def rlb_remove_lowest( input_map, percent)
	filter(
		input_map, 
		value > 
		(
			(
				percent * sumarize_values(input_map)
			) / 100
		)
	);

def rlb_first_step(eval, attackers_map, defenders_map, offset)
	rlb_remove_lowest(
		rlb_apply_eval(
			eval,
			attackers_map,
			defenders_map,
			offset
		),
		10
	);

def recruitment_list_builder(eval, attackers_map, defenders_map)
	map(
		rlb_first_step(
			eval,
			attackers_map,
			defenders_map,
			40
		),
		(
			(
				value * 100
			) / 
			sumarize_values(
				rlb_first_step(
					eval,
					attackers_map,
					defenders_map,
					40
				)
			)
		)
	);

		# ========== choose the unit to recruit now ========= #

def unit_chooser(ai*,unit_map) 
	choose(
		keys(unit_map), 'unit_type',
		unit_map[unit_type] - 
		(
			(
				100 * 
				size(
					filter(
						my_units, 
						type = unit_type
					)
				)
			) / 
			size(my_units)
		)
	);

def unit_map_cost_filter(ai*, unit_map)
	filter( unit_map,
		get_unit_type(key).cost < my_side.gold
	);

		# ==========	Main formula section 	========== #

def initialize_weapon_specials_map(ai*)
	if(vars.weapon_specials_init != turn,
		[
			set_var('weapon_specials_init', turn),
			set_var('weapon_specials',
				map(
					weapon_specials_weights(),
					if( key = 'magical',
						units_average_defense(ai, enemy_units, 10),
						if( key = 'marksman',
							units_average_defense(ai, enemy_units, 10) - 10,
							value
						)
					)
				)
			)
		],
		[]
	);

def create_recruits_map(ai*)
	if(vars.recruits_map_creator != turn,
		[
			set_var('recruits_map_creator', turn ),
			set_var('recruits_map',
				debug_print('final unit evaluation: ', recruitment_list_builder(
					debug_print('current AI evaluation (0-100): ', eval(ai)),
					debug_print('attackers evaluation: ',evaluate_attackers(ai)),
					debug_print('defenders evaluation: ',evaluate_defenders(ai))
				))
			)
		],
		[]
	);

def castle_space(ai*)
	filter( map( castle_locs( my_leader.loc ), 'location', if( unit_at( location ), 1, 0 ) ), self = 0  ).size;

if(vars.turn_initialized = turn,
		if( my_leader.loc = nearest_keep( my_leader.loc ),
			if( 
				get_unit_type(
					choose(
						vars.recruits_map,
						-get_unit_type(key).cost
					).key
				).cost <
				my_side.gold,
				if( castle_space(self),
					recruit(debug_print(
						unit_chooser(
							self,
							unit_map_cost_filter(
								self,
								vars.recruits_map
							)
						)
					)),
					fallback()
				),
				fallback() 
			),
			if( my_leader.movement_left > 0,
				move( my_leader.loc, nearest_keep( my_leader.loc ) ),
				fallback()
			)
		),
	[set_var(debug_print('turn_initialized'), turn)] +
	initialize_weapon_specials_map(self) +
	create_recruits_map(self)
)

faiend
"
				[/team_formula]
			[/ai]
		[/multiplayer_side]
		[multiplayer_side]
			flag_rgb="magenta"
			id="Knalgan Alliance"
			image="units/dwarves/steelclad.png"
			leader="Dwarvish Steelclad,Dwarvish Thunderguard,Dwarvish Stalwart,Rogue,Trapper"
			name=_ "Knalgan Alliance"
			random_leader="Dwarvish Steelclad,Dwarvish Thunderguard,Rogue,Trapper"
			recruit="Dwarvish Guardsman,Dwarvish Fighter,Dwarvish Ulfserker,Dwarvish Thunderer,Thief,Poacher,Footpad,Gryphon Rider"
			terrain_liked="Hh, Ha, Mm"
			type="Dwarvish Steelclad"
			[ai]
				recruitment_pattern="fighter,fighter,fighter,mixed fighter,archer,scout"
				[team_formula]
					rulebase="fai 'recruitment.fai'
		# ===== Some general functions used later ==== #

def sumarize_values( input_map )
	sum(
		values(input_map)
	);

def lowest_value( input_map )
	choose( input_map, -value ).value;

def highest_value( input_map )
	choose( input_map, value ).value;

def change_numbers_to_percents( input_map )
	map( input_map, 
		(value*100) / highest_value(input_map) 
	);

def add_number_to_values( input_map, number )
	map( input_map, 
		value + number 
	);

#make sure we have only positive values in a map #

def make_positive_only( input_map )
	if( lowest_value( input_map ) < 0, 
		add_number_to_values( 
			input_map, 
			abs(lowest_value(input_map))
		), 
		input_map 
	);

def sumarize_maps_values( map_A, map_B )
	map( map_A + map_B, 
		value + map_A[key]
	);

		#===== Evaluation how good unit is on a map ===== #

# ==1==  evaluate average defense #
#gives map where key is id of terrain, and value is number of hexes of that terrain on a gamemap#

def locations_map(ai*) 
	tomap( 
		map( 
			map.terrain, 
			id 
		) 
	);

#filters terrain map, min_percent it minimal % of map that terrain has to occupy to be considered in later evaluations# 

def filtered_locations_map(ai*, min_percent)
	filter( 
		locations_map(ai) , 
		value >  (map.w * map.h) / ( 100 / min_percent ) 
	);

#returns average defense of the unit #

def unit_average_defense(ai*, unit, terrain_min_percent )
	sum( 
		values( 
			map(
				filtered_locations_map(ai,terrain_min_percent), 
				defense_on( 
					unit, 
					find(map.terrain,id=key).loc
				) *
				value
			) 
		) 
	) / 
	sum(
		values(
			filtered_locations_map(
				ai,
				terrain_min_percent
			)
		)
	);

#returns map of units from units_list and their average defense (more -> better) #

def map_units_average_defense(ai*, units_list, terrain_min_percent) 
	tomap(
		map( 
			units_list, 
			id 
		), 
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	);

def units_average_defense(ai*, units_list, terrain_min_percent)
	sum(
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	) /
	size(
		units_list
	);


# ==2== TODO: evaluate unit effectivness based on movement points and movement cost#


		#===== Evaluation of game state - how good is ai doing ===== #

# ==1== based on unit cost and current amount of gold #
# returns number between 0 and 100 where: 0 we are losing, 100 we are winning #

def units_cost_gold_eval(ai*)
	min(
		[
			(
				(
					sum(
						map(
							allies, 'team', 
							sum(
								map(
									units_of_side[team], 
									cost
								)
							) + 
							teams[team].gold 
						)
					) * 
					100
				) / 
				sum(
					map(
						enemies, 'team', 
						sum(
							map(
								units_of_side[team], 
								cost
							)
						) + 
						max(
							[teams[team].gold, 0]
						) 
					)
				)
			) / 2,
			100
		]
	);

# ==2== based on village possession #

def count_allied_villages(ai*)
	sum(
		map(
			allies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

def count_enemy_villages(ai*)
	sum(
		map(
			enemies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

# multipled by 1000 to increase precision #

def village_evaluation(ai*)
	(
		50000 + 
		(
			count_allied_villages(ai) - 
			count_enemy_villages(ai)
		) * 
		(
			50000 /
			size(
				villages
			)
		)
	) /
	1000;

# ==3== combined 2 of the above #

def eval(ai*)
	( 
		units_cost_gold_eval(ai) + 
		village_evaluation(ai)
	) / 
	2;

		#===== Evaluation how effective my units are against the enemy ===== #

#==1==  basic evaluation #

# evaluate how much damage unit can inflict - how much damage unit can get#

def evaluate_attacker_against_opponents(ai*, unit, enemy_units)
	sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( unit, enemy_unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				) 
			)
		)
	);

def evaluate_defender_against_opponents(ai*, unit, enemy_units)
	-sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( enemy_unit, unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				)
			)
		)
	);

def units_hp_map(ai*, units)
	tomap( 
		map(
			units, 
			id
		), 
		map( 
			units, 
			hitpoints
		)
	);

#in case side's gold is more than 50, add units that side can recruit to the side's unit list#

def create_side_unit_list(ai*, side)
	if( 
		teams[side].gold > 50, 
		recruits_of_side[side], 
		[]
	) + 
	units_of_side[side];

def evaluate_my_recruits_as_attackers(ai*)
	tomap( 
		map(
			my_recruits, 
			id
		), 
		map(
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_attacker_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai, 
							enemy_side
						)
					)
				)
			)
		)
	);

def evaluate_my_recruits_as_defenders(ai*)
	tomap(
		map(
			my_recruits, 
			id
		),
		map( 
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_defender_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai,
							enemy_side
						)
					)
				)
			)
		)
	);


# === 2 ===  now consider abilities and weapon specials  #

def abilities_weights()
	['skirmisher' -> 15, 'ambush' -> 10, 'nightstalk' -> 20, 'regenerates' -> 20, 'healing' -> 15, 'curing' -> 10, 'leadership' -> 20, 'illumination' -> 15, 'teleport' -> 10, 'steadfast' -> 15 ];

def weapon_specials_weights()
	[ 'backstab' -> 20 ,'slow' -> 10 ,'berserk' -> 20 ,'stones' -> 60 ,'plague' -> 10 ,'marksman' -> 30 ,'magical' -> 40 ,'charge' -> 30 ,'drains' -> 30,  'firststrike' -> 10, 'poison' -> 25 ];

def apply_abilities_weights( units_map )
	map( 
		units_map, 
		value +
		(
			value * 
			max(
				map(
					get_unit_type( key ).abilities, 'ability',
					abilities_weights()[ability]
				)
			)
		) / 100
	);

def apply_weapon_specials_weights( units_map )
	map(
		units_map, 
		value +
		(
			value *
			max(
				map(
					get_unit_type( key ).attacks, 'attack',
					vars.weapon_specials[attack.special]
				)
			)
		) / 100
	);

# since undead units don't get random traits and are balanced with that, we need to lower their evaluation a bit to match fairly the living units #

def undead_malus( units_map )
	map( 
		units_map, 
		if(
			get_unit_type(key).undead,
			( value * 90 ) / 100,
			value 
		)
	);

# === 3 ===  pit 1 and 2 together  #

def evaluate_attackers(ai*)
	change_numbers_to_percents(
		apply_abilities_weights(
			apply_weapon_specials_weights(
				undead_malus( 
					make_positive_only(
						evaluate_my_recruits_as_attackers( ai )	
					)
				)
			)
		)
	);

def evaluate_defenders(ai*)
	map(
		map(
			change_numbers_to_percents(
				apply_abilities_weights(
					apply_weapon_specials_weights(
						undead_malus( 
							make_positive_only(
								evaluate_my_recruits_as_defenders( ai )	
							)
						)
					)
				)
			),
			value / 3
		), 
		value +
		map(
			change_numbers_to_percents(
				units_hp_map(
					ai,
					my_recruits
				)
			),
		value * 2 / 3
		)[key]
	);

	#=========== we have evaluation of game state and units, time to combine them: ==========#
		#=========	recruitment_list_builder	=========#

def rlb_apply_eval(eval, attackers_map, defenders_map, offset)
	map(
		sumarize_maps_values(
			map(
				attackers_map, 
				value * (eval+offset)
			),
			map(
				defenders_map,
				value * ( (100 - eval) - offset )
			)
		),
		value / 100
	);

def rlb_remove_lowest( input_map, percent)
	filter(
		input_map, 
		value > 
		(
			(
				percent * sumarize_values(input_map)
			) / 100
		)
	);

def rlb_first_step(eval, attackers_map, defenders_map, offset)
	rlb_remove_lowest(
		rlb_apply_eval(
			eval,
			attackers_map,
			defenders_map,
			offset
		),
		10
	);

def recruitment_list_builder(eval, attackers_map, defenders_map)
	map(
		rlb_first_step(
			eval,
			attackers_map,
			defenders_map,
			40
		),
		(
			(
				value * 100
			) / 
			sumarize_values(
				rlb_first_step(
					eval,
					attackers_map,
					defenders_map,
					40
				)
			)
		)
	);

		# ========== choose the unit to recruit now ========= #

def unit_chooser(ai*,unit_map) 
	choose(
		keys(unit_map), 'unit_type',
		unit_map[unit_type] - 
		(
			(
				100 * 
				size(
					filter(
						my_units, 
						type = unit_type
					)
				)
			) / 
			size(my_units)
		)
	);

def unit_map_cost_filter(ai*, unit_map)
	filter( unit_map,
		get_unit_type(key).cost < my_side.gold
	);

		# ==========	Main formula section 	========== #

def initialize_weapon_specials_map(ai*)
	if(vars.weapon_specials_init != turn,
		[
			set_var('weapon_specials_init', turn),
			set_var('weapon_specials',
				map(
					weapon_specials_weights(),
					if( key = 'magical',
						units_average_defense(ai, enemy_units, 10),
						if( key = 'marksman',
							units_average_defense(ai, enemy_units, 10) - 10,
							value
						)
					)
				)
			)
		],
		[]
	);

def create_recruits_map(ai*)
	if(vars.recruits_map_creator != turn,
		[
			set_var('recruits_map_creator', turn ),
			set_var('recruits_map',
				debug_print('final unit evaluation: ', recruitment_list_builder(
					debug_print('current AI evaluation (0-100): ', eval(ai)),
					debug_print('attackers evaluation: ',evaluate_attackers(ai)),
					debug_print('defenders evaluation: ',evaluate_defenders(ai))
				))
			)
		],
		[]
	);

def castle_space(ai*)
	filter( map( castle_locs( my_leader.loc ), 'location', if( unit_at( location ), 1, 0 ) ), self = 0  ).size;

if(vars.turn_initialized = turn,
		if( my_leader.loc = nearest_keep( my_leader.loc ),
			if( 
				get_unit_type(
					choose(
						vars.recruits_map,
						-get_unit_type(key).cost
					).key
				).cost <
				my_side.gold,
				if( castle_space(self),
					recruit(debug_print(
						unit_chooser(
							self,
							unit_map_cost_filter(
								self,
								vars.recruits_map
							)
						)
					)),
					fallback()
				),
				fallback() 
			),
			if( my_leader.movement_left > 0,
				move( my_leader.loc, nearest_keep( my_leader.loc ) ),
				fallback()
			)
		),
	[set_var(debug_print('turn_initialized'), turn)] +
	initialize_weapon_specials_map(self) +
	create_recruits_map(self)
)

faiend
"
				[/team_formula]
			[/ai]
		[/multiplayer_side]
		[multiplayer_side]
			flag_rgb="magenta"
			id="Drakes"
			image="units/drakes/flare.png"
			leader="Drake Flare,Fire Drake,Drake Slasher,Drake Gladiator,Drake Warrior,Saurian Oracle,Saurian Soothsayer"
			name=_ "Drakes"
			random_leader="Drake Flare,Fire Drake,Drake Slasher,Drake Gladiator,Drake Warrior"
			recruit="Drake Burner,Drake Clasher,Drake Glider,Drake Fighter,Saurian Skirmisher,Saurian Augur"
			terrain_liked="Hh, Ha, Ds, Ss"
			type="Drake Flare"
			[ai]
				recruitment_pattern="fighter,fighter,archer,healer,scout,scout"
				[team_formula]
					rulebase="fai 'recruitment.fai'
		# ===== Some general functions used later ==== #

def sumarize_values( input_map )
	sum(
		values(input_map)
	);

def lowest_value( input_map )
	choose( input_map, -value ).value;

def highest_value( input_map )
	choose( input_map, value ).value;

def change_numbers_to_percents( input_map )
	map( input_map, 
		(value*100) / highest_value(input_map) 
	);

def add_number_to_values( input_map, number )
	map( input_map, 
		value + number 
	);

#make sure we have only positive values in a map #

def make_positive_only( input_map )
	if( lowest_value( input_map ) < 0, 
		add_number_to_values( 
			input_map, 
			abs(lowest_value(input_map))
		), 
		input_map 
	);

def sumarize_maps_values( map_A, map_B )
	map( map_A + map_B, 
		value + map_A[key]
	);

		#===== Evaluation how good unit is on a map ===== #

# ==1==  evaluate average defense #
#gives map where key is id of terrain, and value is number of hexes of that terrain on a gamemap#

def locations_map(ai*) 
	tomap( 
		map( 
			map.terrain, 
			id 
		) 
	);

#filters terrain map, min_percent it minimal % of map that terrain has to occupy to be considered in later evaluations# 

def filtered_locations_map(ai*, min_percent)
	filter( 
		locations_map(ai) , 
		value >  (map.w * map.h) / ( 100 / min_percent ) 
	);

#returns average defense of the unit #

def unit_average_defense(ai*, unit, terrain_min_percent )
	sum( 
		values( 
			map(
				filtered_locations_map(ai,terrain_min_percent), 
				defense_on( 
					unit, 
					find(map.terrain,id=key).loc
				) *
				value
			) 
		) 
	) / 
	sum(
		values(
			filtered_locations_map(
				ai,
				terrain_min_percent
			)
		)
	);

#returns map of units from units_list and their average defense (more -> better) #

def map_units_average_defense(ai*, units_list, terrain_min_percent) 
	tomap(
		map( 
			units_list, 
			id 
		), 
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	);

def units_average_defense(ai*, units_list, terrain_min_percent)
	sum(
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	) /
	size(
		units_list
	);


# ==2== TODO: evaluate unit effectivness based on movement points and movement cost#


		#===== Evaluation of game state - how good is ai doing ===== #

# ==1== based on unit cost and current amount of gold #
# returns number between 0 and 100 where: 0 we are losing, 100 we are winning #

def units_cost_gold_eval(ai*)
	min(
		[
			(
				(
					sum(
						map(
							allies, 'team', 
							sum(
								map(
									units_of_side[team], 
									cost
								)
							) + 
							teams[team].gold 
						)
					) * 
					100
				) / 
				sum(
					map(
						enemies, 'team', 
						sum(
							map(
								units_of_side[team], 
								cost
							)
						) + 
						max(
							[teams[team].gold, 0]
						) 
					)
				)
			) / 2,
			100
		]
	);

# ==2== based on village possession #

def count_allied_villages(ai*)
	sum(
		map(
			allies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

def count_enemy_villages(ai*)
	sum(
		map(
			enemies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

# multipled by 1000 to increase precision #

def village_evaluation(ai*)
	(
		50000 + 
		(
			count_allied_villages(ai) - 
			count_enemy_villages(ai)
		) * 
		(
			50000 /
			size(
				villages
			)
		)
	) /
	1000;

# ==3== combined 2 of the above #

def eval(ai*)
	( 
		units_cost_gold_eval(ai) + 
		village_evaluation(ai)
	) / 
	2;

		#===== Evaluation how effective my units are against the enemy ===== #

#==1==  basic evaluation #

# evaluate how much damage unit can inflict - how much damage unit can get#

def evaluate_attacker_against_opponents(ai*, unit, enemy_units)
	sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( unit, enemy_unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				) 
			)
		)
	);

def evaluate_defender_against_opponents(ai*, unit, enemy_units)
	-sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( enemy_unit, unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				)
			)
		)
	);

def units_hp_map(ai*, units)
	tomap( 
		map(
			units, 
			id
		), 
		map( 
			units, 
			hitpoints
		)
	);

#in case side's gold is more than 50, add units that side can recruit to the side's unit list#

def create_side_unit_list(ai*, side)
	if( 
		teams[side].gold > 50, 
		recruits_of_side[side], 
		[]
	) + 
	units_of_side[side];

def evaluate_my_recruits_as_attackers(ai*)
	tomap( 
		map(
			my_recruits, 
			id
		), 
		map(
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_attacker_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai, 
							enemy_side
						)
					)
				)
			)
		)
	);

def evaluate_my_recruits_as_defenders(ai*)
	tomap(
		map(
			my_recruits, 
			id
		),
		map( 
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_defender_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai,
							enemy_side
						)
					)
				)
			)
		)
	);


# === 2 ===  now consider abilities and weapon specials  #

def abilities_weights()
	['skirmisher' -> 15, 'ambush' -> 10, 'nightstalk' -> 20, 'regenerates' -> 20, 'healing' -> 15, 'curing' -> 10, 'leadership' -> 20, 'illumination' -> 15, 'teleport' -> 10, 'steadfast' -> 15 ];

def weapon_specials_weights()
	[ 'backstab' -> 20 ,'slow' -> 10 ,'berserk' -> 20 ,'stones' -> 60 ,'plague' -> 10 ,'marksman' -> 30 ,'magical' -> 40 ,'charge' -> 30 ,'drains' -> 30,  'firststrike' -> 10, 'poison' -> 25 ];

def apply_abilities_weights( units_map )
	map( 
		units_map, 
		value +
		(
			value * 
			max(
				map(
					get_unit_type( key ).abilities, 'ability',
					abilities_weights()[ability]
				)
			)
		) / 100
	);

def apply_weapon_specials_weights( units_map )
	map(
		units_map, 
		value +
		(
			value *
			max(
				map(
					get_unit_type( key ).attacks, 'attack',
					vars.weapon_specials[attack.special]
				)
			)
		) / 100
	);

# since undead units don't get random traits and are balanced with that, we need to lower their evaluation a bit to match fairly the living units #

def undead_malus( units_map )
	map( 
		units_map, 
		if(
			get_unit_type(key).undead,
			( value * 90 ) / 100,
			value 
		)
	);

# === 3 ===  pit 1 and 2 together  #

def evaluate_attackers(ai*)
	change_numbers_to_percents(
		apply_abilities_weights(
			apply_weapon_specials_weights(
				undead_malus( 
					make_positive_only(
						evaluate_my_recruits_as_attackers( ai )	
					)
				)
			)
		)
	);

def evaluate_defenders(ai*)
	map(
		map(
			change_numbers_to_percents(
				apply_abilities_weights(
					apply_weapon_specials_weights(
						undead_malus( 
							make_positive_only(
								evaluate_my_recruits_as_defenders( ai )	
							)
						)
					)
				)
			),
			value / 3
		), 
		value +
		map(
			change_numbers_to_percents(
				units_hp_map(
					ai,
					my_recruits
				)
			),
		value * 2 / 3
		)[key]
	);

	#=========== we have evaluation of game state and units, time to combine them: ==========#
		#=========	recruitment_list_builder	=========#

def rlb_apply_eval(eval, attackers_map, defenders_map, offset)
	map(
		sumarize_maps_values(
			map(
				attackers_map, 
				value * (eval+offset)
			),
			map(
				defenders_map,
				value * ( (100 - eval) - offset )
			)
		),
		value / 100
	);

def rlb_remove_lowest( input_map, percent)
	filter(
		input_map, 
		value > 
		(
			(
				percent * sumarize_values(input_map)
			) / 100
		)
	);

def rlb_first_step(eval, attackers_map, defenders_map, offset)
	rlb_remove_lowest(
		rlb_apply_eval(
			eval,
			attackers_map,
			defenders_map,
			offset
		),
		10
	);

def recruitment_list_builder(eval, attackers_map, defenders_map)
	map(
		rlb_first_step(
			eval,
			attackers_map,
			defenders_map,
			40
		),
		(
			(
				value * 100
			) / 
			sumarize_values(
				rlb_first_step(
					eval,
					attackers_map,
					defenders_map,
					40
				)
			)
		)
	);

		# ========== choose the unit to recruit now ========= #

def unit_chooser(ai*,unit_map) 
	choose(
		keys(unit_map), 'unit_type',
		unit_map[unit_type] - 
		(
			(
				100 * 
				size(
					filter(
						my_units, 
						type = unit_type
					)
				)
			) / 
			size(my_units)
		)
	);

def unit_map_cost_filter(ai*, unit_map)
	filter( unit_map,
		get_unit_type(key).cost < my_side.gold
	);

		# ==========	Main formula section 	========== #

def initialize_weapon_specials_map(ai*)
	if(vars.weapon_specials_init != turn,
		[
			set_var('weapon_specials_init', turn),
			set_var('weapon_specials',
				map(
					weapon_specials_weights(),
					if( key = 'magical',
						units_average_defense(ai, enemy_units, 10),
						if( key = 'marksman',
							units_average_defense(ai, enemy_units, 10) - 10,
							value
						)
					)
				)
			)
		],
		[]
	);

def create_recruits_map(ai*)
	if(vars.recruits_map_creator != turn,
		[
			set_var('recruits_map_creator', turn ),
			set_var('recruits_map',
				debug_print('final unit evaluation: ', recruitment_list_builder(
					debug_print('current AI evaluation (0-100): ', eval(ai)),
					debug_print('attackers evaluation: ',evaluate_attackers(ai)),
					debug_print('defenders evaluation: ',evaluate_defenders(ai))
				))
			)
		],
		[]
	);

def castle_space(ai*)
	filter( map( castle_locs( my_leader.loc ), 'location', if( unit_at( location ), 1, 0 ) ), self = 0  ).size;

if(vars.turn_initialized = turn,
		if( my_leader.loc = nearest_keep( my_leader.loc ),
			if( 
				get_unit_type(
					choose(
						vars.recruits_map,
						-get_unit_type(key).cost
					).key
				).cost <
				my_side.gold,
				if( castle_space(self),
					recruit(debug_print(
						unit_chooser(
							self,
							unit_map_cost_filter(
								self,
								vars.recruits_map
							)
						)
					)),
					fallback()
				),
				fallback() 
			),
			if( my_leader.movement_left > 0,
				move( my_leader.loc, nearest_keep( my_leader.loc ) ),
				fallback()
			)
		),
	[set_var(debug_print('turn_initialized'), turn)] +
	initialize_weapon_specials_map(self) +
	create_recruits_map(self)
)

faiend
"
				[/team_formula]
			[/ai]
		[/multiplayer_side]
		[event]
			name="prestart"
			[store_unit]
				kill="yes"
				variable="leaders_to_make_quick"
				[filter]
					canrecruit="yes"
					[filter_wml]
						max_moves="4"
					[/filter_wml]
				[/filter]
			[/store_unit]
			[set_variable]
				name="i"
				value="0"
			[/set_variable]
			[while]
				[variable]
					less_than="$leaders_to_make_quick.length"
					name="i"
				[/variable]
				[do]
					[set_variables]
						mode="merge"
						name="leaders_to_make_quick[$i].modifications"
						[literal]
							[trait]
#textdomain wesnoth
								female_name=_ "female^quick"
								id="quick"
								male_name=_ "quick"
								[effect]
									apply_to="movement"
									increase="1"
								[/effect]
								[effect]
									apply_to="hitpoints"
									increase_total="-5%"
								[/effect]
							[/trait]
						[/literal]
					[/set_variables]
					[clear_variable]
						name="leaders_to_make_quick[$i].max_moves,leaders_to_make_quick[$i].moves,leaders_to_make_quick[$i].max_hitpoints,leaders_to_make_quick[$i].hitpoints"
					[/clear_variable]
					[unstore_unit]
						variable="leaders_to_make_quick[$i]"
					[/unstore_unit]
					[set_variable]
						add="1"
						name="i"
					[/set_variable]
				[/do]
			[/while]
			[clear_variable]
				name="i"
			[/clear_variable]
			[clear_variable]
				name="leaders_to_make_quick"
			[/clear_variable]
		[/event]
	[/era]
	[side]
		allow_changes="yes"
		allow_player="yes"
		canrecruit="yes"
		colour="1"
		controller="human"
		current_player="Morpf"
		flag_rgb="magenta"
		fog="yes"
		gender="male"
		gold="100"
		id="Morpf1"
		image="units/dwarves/steelclad.png"
		income="0"
		leader="Dwarvish Steelclad,Dwarvish Thunderguard,Dwarvish Stalwart,Rogue,Trapper"
		mp_countdown="yes"
		mp_countdown_action_bonus="20"
		mp_countdown_init_time="330"
		mp_countdown_reservoir_time="330"
		mp_countdown_turn_bonus="210"
		name="Morpf"
		random_leader="Dwarvish Steelclad,Dwarvish Thunderguard,Rogue,Trapper"
		recruit="Dwarvish Guardsman,Dwarvish Fighter,Dwarvish Ulfserker,Dwarvish Thunderer,Thief,Poacher,Footpad,Gryphon Rider"
		save_id="Morpf1"
		share_maps="no"
		share_view="yes"
		shroud="no"
		side="1"
		team_name="north"
		terrain_liked="Hh, Ha, Mm"
		type="Rogue"
		user_team_name="wesnoth-multiplayerteamname^North"
		village_gold="2"
		[ai]
			recruitment_pattern="fighter,fighter,fighter,mixed fighter,archer,scout"
			villages_per_scout="8"
			[team_formula]
				rulebase="fai 'recruitment.fai'
		# ===== Some general functions used later ==== #

def sumarize_values( input_map )
	sum(
		values(input_map)
	);

def lowest_value( input_map )
	choose( input_map, -value ).value;

def highest_value( input_map )
	choose( input_map, value ).value;

def change_numbers_to_percents( input_map )
	map( input_map, 
		(value*100) / highest_value(input_map) 
	);

def add_number_to_values( input_map, number )
	map( input_map, 
		value + number 
	);

#make sure we have only positive values in a map #

def make_positive_only( input_map )
	if( lowest_value( input_map ) < 0, 
		add_number_to_values( 
			input_map, 
			abs(lowest_value(input_map))
		), 
		input_map 
	);

def sumarize_maps_values( map_A, map_B )
	map( map_A + map_B, 
		value + map_A[key]
	);

		#===== Evaluation how good unit is on a map ===== #

# ==1==  evaluate average defense #
#gives map where key is id of terrain, and value is number of hexes of that terrain on a gamemap#

def locations_map(ai*) 
	tomap( 
		map( 
			map.terrain, 
			id 
		) 
	);

#filters terrain map, min_percent it minimal % of map that terrain has to occupy to be considered in later evaluations# 

def filtered_locations_map(ai*, min_percent)
	filter( 
		locations_map(ai) , 
		value >  (map.w * map.h) / ( 100 / min_percent ) 
	);

#returns average defense of the unit #

def unit_average_defense(ai*, unit, terrain_min_percent )
	sum( 
		values( 
			map(
				filtered_locations_map(ai,terrain_min_percent), 
				defense_on( 
					unit, 
					find(map.terrain,id=key).loc
				) *
				value
			) 
		) 
	) / 
	sum(
		values(
			filtered_locations_map(
				ai,
				terrain_min_percent
			)
		)
	);

#returns map of units from units_list and their average defense (more -> better) #

def map_units_average_defense(ai*, units_list, terrain_min_percent) 
	tomap(
		map( 
			units_list, 
			id 
		), 
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	);

def units_average_defense(ai*, units_list, terrain_min_percent)
	sum(
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	) /
	size(
		units_list
	);


# ==2== TODO: evaluate unit effectivness based on movement points and movement cost#


		#===== Evaluation of game state - how good is ai doing ===== #

# ==1== based on unit cost and current amount of gold #
# returns number between 0 and 100 where: 0 we are losing, 100 we are winning #

def units_cost_gold_eval(ai*)
	min(
		[
			(
				(
					sum(
						map(
							allies, 'team', 
							sum(
								map(
									units_of_side[team], 
									cost
								)
							) + 
							teams[team].gold 
						)
					) * 
					100
				) / 
				sum(
					map(
						enemies, 'team', 
						sum(
							map(
								units_of_side[team], 
								cost
							)
						) + 
						max(
							[teams[team].gold, 0]
						) 
					)
				)
			) / 2,
			100
		]
	);

# ==2== based on village possession #

def count_allied_villages(ai*)
	sum(
		map(
			allies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

def count_enemy_villages(ai*)
	sum(
		map(
			enemies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

# multipled by 1000 to increase precision #

def village_evaluation(ai*)
	(
		50000 + 
		(
			count_allied_villages(ai) - 
			count_enemy_villages(ai)
		) * 
		(
			50000 /
			size(
				villages
			)
		)
	) /
	1000;

# ==3== combined 2 of the above #

def eval(ai*)
	( 
		units_cost_gold_eval(ai) + 
		village_evaluation(ai)
	) / 
	2;

		#===== Evaluation how effective my units are against the enemy ===== #

#==1==  basic evaluation #

# evaluate how much damage unit can inflict - how much damage unit can get#

def evaluate_attacker_against_opponents(ai*, unit, enemy_units)
	sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( unit, enemy_unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				) 
			)
		)
	);

def evaluate_defender_against_opponents(ai*, unit, enemy_units)
	-sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( enemy_unit, unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				)
			)
		)
	);

def units_hp_map(ai*, units)
	tomap( 
		map(
			units, 
			id
		), 
		map( 
			units, 
			hitpoints
		)
	);

#in case side's gold is more than 50, add units that side can recruit to the side's unit list#

def create_side_unit_list(ai*, side)
	if( 
		teams[side].gold > 50, 
		recruits_of_side[side], 
		[]
	) + 
	units_of_side[side];

def evaluate_my_recruits_as_attackers(ai*)
	tomap( 
		map(
			my_recruits, 
			id
		), 
		map(
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_attacker_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai, 
							enemy_side
						)
					)
				)
			)
		)
	);

def evaluate_my_recruits_as_defenders(ai*)
	tomap(
		map(
			my_recruits, 
			id
		),
		map( 
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_defender_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai,
							enemy_side
						)
					)
				)
			)
		)
	);


# === 2 ===  now consider abilities and weapon specials  #

def abilities_weights()
	['skirmisher' -> 15, 'ambush' -> 10, 'nightstalk' -> 20, 'regenerates' -> 20, 'healing' -> 15, 'curing' -> 10, 'leadership' -> 20, 'illumination' -> 15, 'teleport' -> 10, 'steadfast' -> 15 ];

def weapon_specials_weights()
	[ 'backstab' -> 20 ,'slow' -> 10 ,'berserk' -> 20 ,'stones' -> 60 ,'plague' -> 10 ,'marksman' -> 30 ,'magical' -> 40 ,'charge' -> 30 ,'drains' -> 30,  'firststrike' -> 10, 'poison' -> 25 ];

def apply_abilities_weights( units_map )
	map( 
		units_map, 
		value +
		(
			value * 
			max(
				map(
					get_unit_type( key ).abilities, 'ability',
					abilities_weights()[ability]
				)
			)
		) / 100
	);

def apply_weapon_specials_weights( units_map )
	map(
		units_map, 
		value +
		(
			value *
			max(
				map(
					get_unit_type( key ).attacks, 'attack',
					vars.weapon_specials[attack.special]
				)
			)
		) / 100
	);

# since undead units don't get random traits and are balanced with that, we need to lower their evaluation a bit to match fairly the living units #

def undead_malus( units_map )
	map( 
		units_map, 
		if(
			get_unit_type(key).undead,
			( value * 90 ) / 100,
			value 
		)
	);

# === 3 ===  pit 1 and 2 together  #

def evaluate_attackers(ai*)
	change_numbers_to_percents(
		apply_abilities_weights(
			apply_weapon_specials_weights(
				undead_malus( 
					make_positive_only(
						evaluate_my_recruits_as_attackers( ai )	
					)
				)
			)
		)
	);

def evaluate_defenders(ai*)
	map(
		map(
			change_numbers_to_percents(
				apply_abilities_weights(
					apply_weapon_specials_weights(
						undead_malus( 
							make_positive_only(
								evaluate_my_recruits_as_defenders( ai )	
							)
						)
					)
				)
			),
			value / 3
		), 
		value +
		map(
			change_numbers_to_percents(
				units_hp_map(
					ai,
					my_recruits
				)
			),
		value * 2 / 3
		)[key]
	);

	#=========== we have evaluation of game state and units, time to combine them: ==========#
		#=========	recruitment_list_builder	=========#

def rlb_apply_eval(eval, attackers_map, defenders_map, offset)
	map(
		sumarize_maps_values(
			map(
				attackers_map, 
				value * (eval+offset)
			),
			map(
				defenders_map,
				value * ( (100 - eval) - offset )
			)
		),
		value / 100
	);

def rlb_remove_lowest( input_map, percent)
	filter(
		input_map, 
		value > 
		(
			(
				percent * sumarize_values(input_map)
			) / 100
		)
	);

def rlb_first_step(eval, attackers_map, defenders_map, offset)
	rlb_remove_lowest(
		rlb_apply_eval(
			eval,
			attackers_map,
			defenders_map,
			offset
		),
		10
	);

def recruitment_list_builder(eval, attackers_map, defenders_map)
	map(
		rlb_first_step(
			eval,
			attackers_map,
			defenders_map,
			40
		),
		(
			(
				value * 100
			) / 
			sumarize_values(
				rlb_first_step(
					eval,
					attackers_map,
					defenders_map,
					40
				)
			)
		)
	);

		# ========== choose the unit to recruit now ========= #

def unit_chooser(ai*,unit_map) 
	choose(
		keys(unit_map), 'unit_type',
		unit_map[unit_type] - 
		(
			(
				100 * 
				size(
					filter(
						my_units, 
						type = unit_type
					)
				)
			) / 
			size(my_units)
		)
	);

def unit_map_cost_filter(ai*, unit_map)
	filter( unit_map,
		get_unit_type(key).cost < my_side.gold
	);

		# ==========	Main formula section 	========== #

def initialize_weapon_specials_map(ai*)
	if(vars.weapon_specials_init != turn,
		[
			set_var('weapon_specials_init', turn),
			set_var('weapon_specials',
				map(
					weapon_specials_weights(),
					if( key = 'magical',
						units_average_defense(ai, enemy_units, 10),
						if( key = 'marksman',
							units_average_defense(ai, enemy_units, 10) - 10,
							value
						)
					)
				)
			)
		],
		[]
	);

def create_recruits_map(ai*)
	if(vars.recruits_map_creator != turn,
		[
			set_var('recruits_map_creator', turn ),
			set_var('recruits_map',
				debug_print('final unit evaluation: ', recruitment_list_builder(
					debug_print('current AI evaluation (0-100): ', eval(ai)),
					debug_print('attackers evaluation: ',evaluate_attackers(ai)),
					debug_print('defenders evaluation: ',evaluate_defenders(ai))
				))
			)
		],
		[]
	);

def castle_space(ai*)
	filter( map( castle_locs( my_leader.loc ), 'location', if( unit_at( location ), 1, 0 ) ), self = 0  ).size;

if(vars.turn_initialized = turn,
		if( my_leader.loc = nearest_keep( my_leader.loc ),
			if( 
				get_unit_type(
					choose(
						vars.recruits_map,
						-get_unit_type(key).cost
					).key
				).cost <
				my_side.gold,
				if( castle_space(self),
					recruit(debug_print(
						unit_chooser(
							self,
							unit_map_cost_filter(
								self,
								vars.recruits_map
							)
						)
					)),
					fallback()
				),
				fallback() 
			),
			if( my_leader.movement_left > 0,
				move( my_leader.loc, nearest_keep( my_leader.loc ) ),
				fallback()
			)
		),
	[set_var(debug_print('turn_initialized'), turn)] +
	initialize_weapon_specials_map(self) +
	create_recruits_map(self)
)

faiend
"
			[/team_formula]
		[/ai]
		[ai]
			villages_per_scout="8"
		[/ai]
	[/side]
	[side]
		allow_changes="yes"
		allow_player="yes"
		canrecruit="yes"
		colour="2"
		controller="network"
		current_player="Odol"
		flag_rgb="magenta"
		fog="yes"
		gender="male"
		gold="100"
		id="Odol2"
		image="units/orcs/warrior.png"
		income="0"
		leader="Orcish Warrior,Troll,Troll Rocklobber,Orcish Crossbowman,Orcish Slayer"
		mp_countdown="yes"
		mp_countdown_action_bonus="20"
		mp_countdown_init_time="330"
		mp_countdown_reservoir_time="330"
		mp_countdown_turn_bonus="210"
		name="Odol"
		recruit="Orcish Grunt,Troll Whelp,Wolf Rider,Orcish Archer,Orcish Assassin,Naga Fighter,Goblin Spearman"
		save_id="Odol2"
		share_maps="no"
		share_view="yes"
		shroud="no"
		side="2"
		team_name="south"
		terrain_liked="Hh, Ha, Mm, Ss"
		type="Orcish Warrior"
		user_team_name="wesnoth-multiplayerteamname^South"
		village_gold="2"
		[ai]
			recruitment_pattern="fighter,fighter,fighter,mixed fighter,archer,scout"
			villages_per_scout="8"
			[team_formula]
				rulebase="fai 'recruitment.fai'
		# ===== Some general functions used later ==== #

def sumarize_values( input_map )
	sum(
		values(input_map)
	);

def lowest_value( input_map )
	choose( input_map, -value ).value;

def highest_value( input_map )
	choose( input_map, value ).value;

def change_numbers_to_percents( input_map )
	map( input_map, 
		(value*100) / highest_value(input_map) 
	);

def add_number_to_values( input_map, number )
	map( input_map, 
		value + number 
	);

#make sure we have only positive values in a map #

def make_positive_only( input_map )
	if( lowest_value( input_map ) < 0, 
		add_number_to_values( 
			input_map, 
			abs(lowest_value(input_map))
		), 
		input_map 
	);

def sumarize_maps_values( map_A, map_B )
	map( map_A + map_B, 
		value + map_A[key]
	);

		#===== Evaluation how good unit is on a map ===== #

# ==1==  evaluate average defense #
#gives map where key is id of terrain, and value is number of hexes of that terrain on a gamemap#

def locations_map(ai*) 
	tomap( 
		map( 
			map.terrain, 
			id 
		) 
	);

#filters terrain map, min_percent it minimal % of map that terrain has to occupy to be considered in later evaluations# 

def filtered_locations_map(ai*, min_percent)
	filter( 
		locations_map(ai) , 
		value >  (map.w * map.h) / ( 100 / min_percent ) 
	);

#returns average defense of the unit #

def unit_average_defense(ai*, unit, terrain_min_percent )
	sum( 
		values( 
			map(
				filtered_locations_map(ai,terrain_min_percent), 
				defense_on( 
					unit, 
					find(map.terrain,id=key).loc
				) *
				value
			) 
		) 
	) / 
	sum(
		values(
			filtered_locations_map(
				ai,
				terrain_min_percent
			)
		)
	);

#returns map of units from units_list and their average defense (more -> better) #

def map_units_average_defense(ai*, units_list, terrain_min_percent) 
	tomap(
		map( 
			units_list, 
			id 
		), 
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	);

def units_average_defense(ai*, units_list, terrain_min_percent)
	sum(
		map( 
			units_list, 'unit', 
			unit_average_defense(
				ai, 
				unit, 
				terrain_min_percent 
			) 
		) 
	) /
	size(
		units_list
	);


# ==2== TODO: evaluate unit effectivness based on movement points and movement cost#


		#===== Evaluation of game state - how good is ai doing ===== #

# ==1== based on unit cost and current amount of gold #
# returns number between 0 and 100 where: 0 we are losing, 100 we are winning #

def units_cost_gold_eval(ai*)
	min(
		[
			(
				(
					sum(
						map(
							allies, 'team', 
							sum(
								map(
									units_of_side[team], 
									cost
								)
							) + 
							teams[team].gold 
						)
					) * 
					100
				) / 
				sum(
					map(
						enemies, 'team', 
						sum(
							map(
								units_of_side[team], 
								cost
							)
						) + 
						max(
							[teams[team].gold, 0]
						) 
					)
				)
			) / 2,
			100
		]
	);

# ==2== based on village possession #

def count_allied_villages(ai*)
	sum(
		map(
			allies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

def count_enemy_villages(ai*)
	sum(
		map(
			enemies, 'side', 
			size(
				villages_of_side[side]
			)
		)
	);

# multipled by 1000 to increase precision #

def village_evaluation(ai*)
	(
		50000 + 
		(
			count_allied_villages(ai) - 
			count_enemy_villages(ai)
		) * 
		(
			50000 /
			size(
				villages
			)
		)
	) /
	1000;

# ==3== combined 2 of the above #

def eval(ai*)
	( 
		units_cost_gold_eval(ai) + 
		village_evaluation(ai)
	) / 
	2;

		#===== Evaluation how effective my units are against the enemy ===== #

#==1==  basic evaluation #

# evaluate how much damage unit can inflict - how much damage unit can get#

def evaluate_attacker_against_opponents(ai*, unit, enemy_units)
	sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( unit, enemy_unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				) 
			)
		)
	);

def evaluate_defender_against_opponents(ai*, unit, enemy_units)
	-sum( 
		map( 
			enemy_units, 'enemy_unit', 
			sum(
				map(
					[
						max_possible_damage_with_retaliation( enemy_unit, unit )
					],
					max(
						[
							self[0] - self[2],
							self[1] - self[3]
						]
					)
				)
			)
		)
	);

def units_hp_map(ai*, units)
	tomap( 
		map(
			units, 
			id
		), 
		map( 
			units, 
			hitpoints
		)
	);

#in case side's gold is more than 50, add units that side can recruit to the side's unit list#

def create_side_unit_list(ai*, side)
	if( 
		teams[side].gold > 50, 
		recruits_of_side[side], 
		[]
	) + 
	units_of_side[side];

def evaluate_my_recruits_as_attackers(ai*)
	tomap( 
		map(
			my_recruits, 
			id
		), 
		map(
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_attacker_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai, 
							enemy_side
						)
					)
				)
			)
		)
	);

def evaluate_my_recruits_as_defenders(ai*)
	tomap(
		map(
			my_recruits, 
			id
		),
		map( 
			my_recruits, 'my_unit',
			sum(
				map(
					enemies, 'enemy_side',
					evaluate_defender_against_opponents(
						ai,
						my_unit,
						create_side_unit_list(
							ai,
							enemy_side
						)
					)
				)
			)
		)
	);


# === 2 ===  now consider abilities and weapon specials  #

def abilities_weights()
	['skirmisher' -> 15, 'ambush' -> 10, 'nightstalk' -> 20, 'regenerates' -> 20, 'healing' -> 15, 'curing' -> 10, 'leadership' -> 20, 'illumination' -> 15, 'teleport' -> 10, 'steadfast' -> 15 ];

def weapon_specials_weights()
	[ 'backstab' -> 20 ,'slow' -> 10 ,'berserk' -> 20 ,'stones' -> 60 ,'plague' -> 10 ,'marksman' -> 30 ,'magical' -> 40 ,'charge' -> 30 ,'drains' -> 30,  'firststrike' -> 10, 'poison' -> 25 ];

def apply_abilities_weights( units_map )
	map( 
		units_map, 
		value +
		(
			value * 
			max(
				map(
					get_unit_type( key ).abilities, 'ability',
					abilities_weights()[ability]
				)
			)
		) / 100
	);

def apply_weapon_specials_weights( units_map )
	map(
		units_map, 
		value +
		(
			value *
			max(
				map(
					get_unit_type( key ).attacks, 'attack',
					vars.weapon_specials[attack.special]
				)
			)
		) / 100
	);

# since undead units don't get random traits and are balanced with that, we need to lower their evaluation a bit to match fairly the living units #

def undead_malus( units_map )
	map( 
		units_map, 
		if(
			get_unit_type(key).undead,
			( value * 90 ) / 100,
			value 
		)
	);

# === 3 ===  pit 1 and 2 together  #

def evaluate_attackers(ai*)
	change_numbers_to_percents(
		apply_abilities_weights(
			apply_weapon_specials_weights(
				undead_malus( 
					make_positive_only(
						evaluate_my_recruits_as_attackers( ai )	
					)
				)
			)
		)
	);

def evaluate_defenders(ai*)
	map(
		map(
			change_numbers_to_percents(
				apply_abilities_weights(
					apply_weapon_specials_weights(
						undead_malus( 
							make_positive_only(
								evaluate_my_recruits_as_defenders( ai )	
							)
						)
					)
				)
			),
			value / 3
		), 
		value +
		map(
			change_numbers_to_percents(
				units_hp_map(
					ai,
					my_recruits
				)
			),
		value * 2 / 3
		)[key]
	);

	#=========== we have evaluation of game state and units, time to combine them: ==========#
		#=========	recruitment_list_builder	=========#

def rlb_apply_eval(eval, attackers_map, defenders_map, offset)
	map(
		sumarize_maps_values(
			map(
				attackers_map, 
				value * (eval+offset)
			),
			map(
				defenders_map,
				value * ( (100 - eval) - offset )
			)
		),
		value / 100
	);

def rlb_remove_lowest( input_map, percent)
	filter(
		input_map, 
		value > 
		(
			(
				percent * sumarize_values(input_map)
			) / 100
		)
	);

def rlb_first_step(eval, attackers_map, defenders_map, offset)
	rlb_remove_lowest(
		rlb_apply_eval(
			eval,
			attackers_map,
			defenders_map,
			offset
		),
		10
	);

def recruitment_list_builder(eval, attackers_map, defenders_map)
	map(
		rlb_first_step(
			eval,
			attackers_map,
			defenders_map,
			40
		),
		(
			(
				value * 100
			) / 
			sumarize_values(
				rlb_first_step(
					eval,
					attackers_map,
					defenders_map,
					40
				)
			)
		)
	);

		# ========== choose the unit to recruit now ========= #

def unit_chooser(ai*,unit_map) 
	choose(
		keys(unit_map), 'unit_type',
		unit_map[unit_type] - 
		(
			(
				100 * 
				size(
					filter(
						my_units, 
						type = unit_type
					)
				)
			) / 
			size(my_units)
		)
	);

def unit_map_cost_filter(ai*, unit_map)
	filter( unit_map,
		get_unit_type(key).cost < my_side.gold
	);

		# ==========	Main formula section 	========== #

def initialize_weapon_specials_map(ai*)
	if(vars.weapon_specials_init != turn,
		[
			set_var('weapon_specials_init', turn),
			set_var('weapon_specials',
				map(
					weapon_specials_weights(),
					if( key = 'magical',
						units_average_defense(ai, enemy_units, 10),
						if( key = 'marksman',
							units_average_defense(ai, enemy_units, 10) - 10,
							value
						)
					)
				)
			)
		],
		[]
	);

def create_recruits_map(ai*)
	if(vars.recruits_map_creator != turn,
		[
			set_var('recruits_map_creator', turn ),
			set_var('recruits_map',
				debug_print('final unit evaluation: ', recruitment_list_builder(
					debug_print('current AI evaluation (0-100): ', eval(ai)),
					debug_print('attackers evaluation: ',evaluate_attackers(ai)),
					debug_print('defenders evaluation: ',evaluate_defenders(ai))
				))
			)
		],
		[]
	);

def castle_space(ai*)
	filter( map( castle_locs( my_leader.loc ), 'location', if( unit_at( location ), 1, 0 ) ), self = 0  ).size;

if(vars.turn_initialized = turn,
		if( my_leader.loc = nearest_keep( my_leader.loc ),
			if( 
				get_unit_type(
					choose(
						vars.recruits_map,
						-get_unit_type(key).cost
					).key
				).cost <
				my_side.gold,
				if( castle_space(self),
					recruit(debug_print(
						unit_chooser(
							self,
							unit_map_cost_filter(
								self,
								vars.recruits_map
							)
						)
					)),
					fallback()
				),
				fallback() 
			),
			if( my_leader.movement_left > 0,
				move( my_leader.loc, nearest_keep( my_leader.loc ) ),
				fallback()
			)
		),
	[set_var(debug_print('turn_initialized'), turn)] +
	initialize_weapon_specials_map(self) +
	create_recruits_map(self)
)

faiend
"
			[/team_formula]
		[/ai]
		[ai]
			villages_per_scout="8"
		[/ai]
	[/side]
[/replay_start]
[statistics]
	mid_scenario="yes"
	[scenario]
		scenario="2p - Sablestone Delta"
		[team]
			[recruits]
				Dwarvish Fighter="4"
				Dwarvish Guardsman="4"
				Dwarvish Thunderer="5"
				Dwarvish Ulfserker="1"
				Gryphon Rider="1"
			[/recruits]
			[recalls]
			[/recalls]
			[advances]
			[/advances]
			[deaths]
				Dwarvish Fighter="2"
				Dwarvish Guardsman="1"
				Dwarvish Thunderer="2"
				Dwarvish Ulfserker="1"
				Gryphon Rider="1"
				Rogue="1"
			[/deaths]
			[killed]
				Orcish Archer="1"
				Orcish Assassin="1"
				Orcish Grunt="4"
				Orcish Slayer="1"
				Troll Whelp="1"
				Wolf Rider="1"
			[/killed]
			[attacks]
				[sequence]
					s000="4"
					s001="2"
					s010="1"
					_num="30"
				[/sequence]
				[sequence]
					s0="1"
					s00="3"
					s000="1"
					s001="1"
					s01="1"
					s010="2"
					s011="1"
					s1="2"
					s10="1"
					s101="1"
					s11="1"
					s110="1"
					_num="40"
				[/sequence]
				[sequence]
					s0="2"
					s00="1"
					s001="1"
					s01="1"
					s1="2"
					s10="1"
					_num="50"
				[/sequence]
				[sequence]
					s0="2"
					s010="1"
					s011="1"
					s1="4"
					s101="1"
					s111="1"
					_num="60"
				[/sequence]
				[sequence]
					s11111011="1"
					_num="70"
				[/sequence]
			[/attacks]
			[defends]
				[sequence]
					s="8"
					_num="0"
				[/sequence]
				[sequence]
					s="1"
					s0="2"
					s010="1"
					_num="30"
				[/sequence]
				[sequence]
					s0="1"
					s01="2"
					s1="2"
					_num="40"
				[/sequence]
				[sequence]
					s="1"
					s01="2"
					s1="1"
					s101="1"
					_num="50"
				[/sequence]
				[sequence]
					s="1"
					s01="1"
					s010="1"
					s1="1"
					s10="4"
					s11="2"
					s110="1"
					_num="60"
				[/sequence]
				[sequence]
					s110="1"
					_num="70"
				[/sequence]
			[/defends]
			recruit_cost="268"
			recall_cost="0"
			damage_inflicted="531"
			damage_taken="355"
			expected_damage_inflicted="423838"
			expected_damage_taken="345867"
			turn_damage_inflicted="94"
			turn_damage_taken="43"
			turn_expected_damage_inflicted="76500"
			turn_expected_damage_taken="39624"
			save_id="Morpf1"
		[/team]
		[team]
			[recruits]
				Orcish Archer="1"
				Orcish Assassin="4"
				Orcish Grunt="11"
				Troll Whelp="1"
				Wolf Rider="2"
			[/recruits]
			[recalls]
			[/recalls]
			[advances]
				Orcish Slayer="2"
			[/advances]
			[deaths]
				Orcish Archer="1"
				Orcish Assassin="1"
				Orcish Grunt="4"
				Orcish Slayer="1"
				Troll Whelp="1"
				Wolf Rider="1"
			[/deaths]
			[killed]
				Dwarvish Fighter="2"
				Dwarvish Guardsman="1"
				Dwarvish Thunderer="2"
				Dwarvish Ulfserker="1"
				Gryphon Rider="1"
				Rogue="1"
			[/killed]
			[attacks]
				[sequence]
					s00="3"
					s1="1"
					s10="2"
					s11="1"
					_num="40"
				[/sequence]
				[sequence]
					s001="1"
					s1="1"
					s101="1"
					s11="1"
					_num="50"
				[/sequence]
				[sequence]
					s000="1"
					s01="1"
					s010="1"
					s011="2"
					s1="3"
					s100="1"
					s111="1"
					_num="60"
				[/sequence]
				[sequence]
					s00="1"
					s01="3"
					s010="1"
					s10="2"
					s11="4"
					s111="2"
					_num="70"
				[/sequence]
			[/attacks]
			[defends]
				[sequence]
					s="11"
					_num="0"
				[/sequence]
				[sequence]
					s0="1"
					s00="3"
					s10="1"
					_num="30"
				[/sequence]
				[sequence]
					s0="3"
					s00="2"
					s01="1"
					s010="1"
					s10="1"
					_num="40"
				[/sequence]
				[sequence]
					s00="1"
					s001="1"
					s1="5"
					s11="2"
					_num="50"
				[/sequence]
				[sequence]
					s01="2"
					s1="3"
					s10="1"
					s11="2"
					s1100="1"
					_num="70"
				[/sequence]
			[/defends]
			recruit_cost="261"
			recall_cost="0"
			damage_inflicted="355"
			damage_taken="531"
			expected_damage_inflicted="345867"
			expected_damage_taken="423838"
			turn_damage_inflicted="24"
			turn_damage_taken="9"
			turn_expected_damage_inflicted="18000"
			turn_expected_damage_taken="10188"
			save_id="Odol2"
		[/team]
	[/scenario]
[/statistics]
