campaign_type="multiplayer"
difficulty="NORMAL"
label="2p - Hamlets Turn 17"
mp_game_title="ladder1500"
random_seed="831554023"
version="1.6"
[replay]

	[command]
		[recruit]
			value="2"
			x="11"
			y="5"
		[/recruit]
		[random]
			value="1006924067"
		[/random]
		[random]
			value="64446267"
		[/random]
		[random]
			value="845547315"
		[/random]
		[random]
			value="14394733"
		[/random]
		[random]
			value="1168100151"
		[/random]
		[random]
			value="1446338511"
		[/random]
		[random]
			value="1282611779"
		[/random]
		[random]
			value="1828141559"
		[/random]
		[random]
			value="1176210396"
		[/random]
		[random]
			value="370468522"
		[/random]
		[random]
			value="9855953"
		[/random]
		[random]
			value="1707757969"
		[/random]
		[random]
			value="1122641107"
		[/random]
		[random]
			value="849827078"
		[/random]
		[random]
			value="916067830"
			[results]
				checksum="9CIQwCrz6RyeTTICy,HrVEsv8xKMwFuxzJDqOwQmKzmtMTEzPv,zPSmuOMoJAyLuJqKyRzLtHrjDLNtqqmLt5eGFJBAwBICTrpKGHCIsunwtguIWckGAO<cOO98<>0k3"
			[/results]
		[/random]
	[/command]

	[command]
		[recruit]
			value="2"
			x="11"
			y="4"
		[/recruit]
		[random]
			value="884072903"
		[/random]
		[random]
			value="1797456462"
		[/random]
		[random]
			value="980615093"
		[/random]
		[random]
			value="1379615725"
		[/random]
		[random]
			value="269131448"
		[/random]
		[random]
			value="1618819377"
		[/random]
		[random]
			value="168281729"
		[/random]
		[random]
			value="1276055515"
		[/random]
		[random]
			value="1683265644"
		[/random]
		[random]
			value="1013829044"
		[/random]
		[random]
			value="1290450248"
		[/random]
		[random]
			value="703882147"
		[/random]
		[random]
			value="312683908"
		[/random]
		[random]
			value="425578379"
		[/random]
		[random]
			value="384540059"
			[results]
				checksum="9CIQwCrz6RyeTTICy,HrVEsv8xKMwFuxzJDqOwQmKzmtMTEzPv,zPSmuOMoJAyLuJqKyRzLtHrjDLNtqqmLt5eGFJBAwBICTrpKGHCIsunwtfEIWcfGAO<cOO98<>0k3"
			[/results]
		[/random]
	[/command]

	[command]
		[recruit]
			value="1"
			x="12"
			y="3"
		[/recruit]
		[random]
			value="527123286"
		[/random]
		[random]
			value="779425694"
		[/random]
		[random]
			value="2052626937"
		[/random]
		[random]
			value="397410441"
		[/random]
		[random]
			value="1736740802"
		[/random]
		[random]
			value="950936581"
		[/random]
		[random]
			value="1756270522"
		[/random]
		[random]
			value="1209239927"
		[/random]
		[random]
			value="1001223197"
		[/random]
		[random]
			value="492859777"
		[/random]
		[random]
			value="859212742"
		[/random]
		[random]
			value="1981838290"
		[/random]
		[random]
			value="1872475502"
		[/random]
		[random]
			value="1128344190"
		[/random]
		[random]
			value="1453174020"
			[results]
				checksum="ACIByNSVYsLXPemyRXKCwqFrLmVQqEv0TwtBGgNMvJHtOMFtHrtKmNzMnuxEPDq6BPSLFIOJqR+ProSyETFwFyA9FumVnpCouMKPBb5OJGPbmz3o>.fjcflW4pf7m5p7"
			[/results]
		[/random]
	[/command]

	[command]
		[recruit]
			value="0"
			x="13"
			y="4"
		[/recruit]
		[random]
			value="561197193"
		[/random]
		[random]
			value="621507937"
		[/random]
		[random]
			value="324290587"
		[/random]
		[random]
			value="1610365818"
		[/random]
		[random]
			value="392712298"
		[/random]
		[random]
			value="1568513678"
		[/random]
		[random]
			value="1428118626"
		[/random]
		[random]
			value="919835584"
		[/random]
		[random]
			value="200455724"
		[/random]
		[random]
			value="1333261916"
		[/random]
		[random]
			value="1317246026"
		[/random]
		[random]
			value="1937196526"
		[/random]
		[random]
			value="136714849"
		[/random]
		[random]
			value="926032900"
		[/random]
		[random]
			value="998952805"
			[results]
				checksum="DB6s-,zQn1M2yLIrtl,yvEJs+TqLAH7qSCNCNSvmIJ>KNGxwmIQwSVVvQLyBGFwuCzBR9PMVRCroPzMEKTmSKvvPnFtw+QnBRSqBwbD3xFMMEJCCHO+YDPPnPywBn8EE"
			[/results]
		[/random]
	[/command]

	[command]
		[recruit]
			value="4"
			x="11"
			y="2"
		[/recruit]
		[random]
			value="1266939078"
		[/random]
		[random]
			value="1944260744"
		[/random]
		[random]
			value="495824803"
		[/random]
		[random]
			value="812293594"
		[/random]
		[random]
			value="1016563632"
		[/random]
		[random]
			value="321285839"
		[/random]
		[random]
			value="742188169"
		[/random]
		[random]
			value="1577760825"
		[/random]
		[random]
			value="942793777"
		[/random]
		[random]
			value="1066478756"
		[/random]
		[random]
			value="1040642996"
		[/random]
		[random]
			value="1335506075"
		[/random]
		[random]
			value="487508786"
		[/random]
		[random]
			value="321277974"
		[/random]
		[random]
			value="107858012"
			[results]
				checksum="iDp,4nc1oNO1LLyKmJLIEhoF>vyBA6mszOAMDTywuzyODCrTtRLwFwmIsr1QENmxPFHFw.RFKFnqypNKAM8mwoFomIhFlq1.CL-<<ddBfkHDONNHvMSO1I9LGCHpACmL"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="11,10,9,8"
			y="3,3,4,4"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]

[command]
undo="no"
[speak]
id="Stas"
message="hf$)"
side="1"
[/speak]
[/command]

[command]
undo="no"
[speak]
id="Funeral_Warfog"
message="you think you won't have problems this time?"
side="2"
[/speak]
[/command]

	[command]
		[recruit]
			value="7"
			x="11"
			y="21"
		[/recruit]
		[random]
			value="6438"
		[/random]
		[random]
			value="17772"
		[/random]
		[random]
			value="25142"
		[/random]
		[random]
			value="14581"
		[/random]
		[random]
			value="14227"
		[/random]
		[random]
			value="21658"
		[/random]
		[random]
			value="3723"
		[/random]
		[random]
			value="23189"
		[/random]
		[random]
			value="16914"
		[/random]
		[random]
			value="15678"
		[/random]
		[random]
			value="14726"
		[/random]
		[random]
			value="13109"
		[/random]
		[random]
			value="4800"
		[/random]
		[random]
			value="1481"
		[/random]
		[random]
			value="20830"
			[results]
				checksum=",Ad3Y5f-Gtmspp5jHbEoRiSrOCpxE4IDyxOzzQOG.nCLyyGDmUtLNvFrwCUxRLwFwmIsr1QENmxPFHFw.RFKFnqypNLpM8mwoFomIhFlq1.CLW<<ddNv5EsLNHBNzkOI"
			[/results]
		[/random]
	[/command]

	[command]
		[recruit]
			value="7"
			x="9"
			y="22"
		[/recruit]
		[random]
			value="10285"
		[/random]
		[random]
			value="19648"
		[/random]
		[random]
			value="26229"
		[/random]
		[random]
			value="30521"
		[/random]
		[random]
			value="3765"
		[/random]
		[random]
			value="149"
		[/random]
		[random]
			value="236"
		[/random]
		[random]
			value="16690"
		[/random]
		[random]
			value="13038"
		[/random]
		[random]
			value="8893"
		[/random]
		[random]
			value="11834"
		[/random]
		[random]
			value="15667"
		[/random]
		[random]
			value="30058"
		[/random]
		[random]
			value="28945"
		[/random]
		[random]
			value="22056"
			[results]
				checksum=",Ad3Y5f-Gtmsop5jHbEoRiSrOCpxE4IDyxOzzQOG.nCLyyGDmUtLNvFrwCUxRLwFwmIsr1QENmxPFHFw.RFKFnqypNLoM8mwoFomIhFlq1.CLB<<ddNv5EsLNHBNzhOI"
			[/results]
		[/random]
	[/command]

	[command]
		[recruit]
			value="6"
			x="11"
			y="22"
		[/recruit]
		[random]
			value="30085"
		[/random]
		[random]
			value="29700"
		[/random]
		[random]
			value="10661"
		[/random]
		[random]
			value="19990"
		[/random]
		[random]
			value="18102"
		[/random]
		[random]
			value="18735"
		[/random]
		[random]
			value="25126"
		[/random]
		[random]
			value="17872"
		[/random]
		[random]
			value="8210"
		[/random]
		[random]
			value="3767"
		[/random]
		[random]
			value="25335"
		[/random]
		[random]
			value="31836"
		[/random]
		[random]
			value="18859"
		[/random]
		[random]
			value="16758"
		[/random]
		[random]
			value="30300"
			[results]
				checksum="XBfX4cmdHYau810h3t9co8gj2UWo-1,n-62ad7l9i<dX9dX-4o9W2w2-6hZd9kbd.d07gZj2f,ei5ybXfdk5k4Nw>d595,cp6dzgA.Zj4982<j6D1<4M96i7zO.<BDyI"
			[/results]
		[/random]
	[/command]

	[command]
		[recruit]
			value="1"
			x="10"
			y="22"
		[/recruit]
		[random]
			value="9989"
		[/random]
		[random]
			value="4724"
		[/random]
		[random]
			value="16736"
		[/random]
		[random]
			value="2595"
		[/random]
		[random]
			value="29621"
		[/random]
		[random]
			value="24088"
		[/random]
		[random]
			value="4500"
		[/random]
		[random]
			value="10084"
		[/random]
		[random]
			value="31898"
		[/random]
		[random]
			value="692"
		[/random]
		[random]
			value="16930"
		[/random]
		[random]
			value="9686"
		[/random]
		[random]
			value="3894"
		[/random]
		[random]
			value="26193"
		[/random]
		[random]
			value="30014"
			[results]
				checksum="14,Wfc>cu2lH0olW9-5N-m<e6f60hfabkcij<4>i3h3e2.t0a1f<j870h0k565.Y0>ide2Hi80k.d8da021n<.26Z+40CN5c8b.-X,48K.7v3f3XdJFikGNVwGMoVOFH"
			[/results]
		[/random]
	[/command]

	[command]
		[recruit]
			value="2"
			x="11"
			y="24"
		[/recruit]
		[random]
			value="18172"
		[/random]
		[random]
			value="911"
		[/random]
		[random]
			value="13427"
		[/random]
		[random]
			value="12702"
		[/random]
		[random]
			value="32646"
		[/random]
		[random]
			value="9930"
		[/random]
		[random]
			value="6776"
		[/random]
		[random]
			value="28078"
		[/random]
		[random]
			value="26942"
		[/random]
		[random]
			value="22312"
		[/random]
		[random]
			value="27407"
		[/random]
		[random]
			value="22556"
		[/random]
		[random]
			value="4510"
		[/random]
		[random]
			value="12872"
		[/random]
		[random]
			value="15140"
			[results]
				checksum="RVQsCRORlSP,DLsxDMMfFuzJRDJCyOyPpHMVsOIMzEOKRzPuHEfJqwNzzmyJIhVwVwSxvKmMAS8wEVRB+JCszfJzd4jC+rc<MF13amk4nil5K7b35>-yp,+.8,eyb6ac"
			[/results]
		[/random]
	[/command]

[command]
undo="no"
[speak]
id="Stas"
message="dont now ..... but this time i kill my provayder"
side="1"
[/speak]
[/command]

	[command]
		[move]
			x="11,12,13,14"
			y="23,22,22,22"
		[/move]
	[/command]

	[command]
		[countdown_update]
			team="2"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]

[command]
undo="no"
[speak]
id="Nobun"
message="lol"
[/speak]
[/command]

	[command]
		[move]
			x="11,10,9,8,7,6,5,4,3,2"
			y="5,4,4,3,3,2,2,1,2,1"
		[/move]
	[/command]

[command]
undo="no"
[speak]
id="Funeral_Warfog"
message=":)"
side="2"
[/speak]
[/command]

	[command]
		[move]
			x="11,11,10,9,8,7,7,6,6,5"
			y="4,5,5,6,6,7,8,8,9,10"
		[/move]
	[/command]

	[command]
		[move]
			x="13,14,15,16,17,18"
			y="4,4,4,4,5,4"
		[/move]
	[/command]

	[command]
		[move]
			x="12,12,12,12,12,12,12"
			y="3,4,5,6,7,8,9"
		[/move]
	[/command]

	[command]
		[move]
			x="11,11,11,11,11,11"
			y="2,3,4,5,6,7"
		[/move]
	[/command]
	[command]
		[move]
			x="8,7,6,5,4"
			y="4,4,3,4,3"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]

	[command]
		[move]
			x="11,11,11,11,12,12,13"
			y="22,21,20,19,18,17,17"
		[/move]
	[/command]

	[command]
		[move]
			x="10,11,12,13,14,15,16,17,18"
			y="22,23,23,23,23,23,23,24,24"
		[/move]
	[/command]

	[command]
		[move]
			x="11,12,13,14,14"
			y="21,20,20,19,18"
		[/move]
	[/command]

	[command]
		[move]
			x="9,8,7,6"
			y="22,22,22,21"
		[/move]
	[/command]

	[command]
		[move]
			x="6,5"
			y="21,21"
		[/move]
	[/command]

	[command]
		[move]
			x="11,10,9,8,7,6,5"
			y="24,24,24,23,23,23,23"
		[/move]
	[/command]

	[command]
		[move]
			x="14,13,12,11"
			y="22,23,23,23"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]

	[command]
		[move]
			x="18,18,18,18,18,17"
			y="4,5,6,7,8,9"
		[/move]
	[/command]

	[command]
		[move]
			x="11,11,10,10,9"
			y="7,8,8,9,10"
		[/move]
	[/command]
	[command]
		[move]
			x="4,5,6,7,8,9"
			y="3,4,3,4,4,4"
		[/move]
	[/command]

	[command]
		[move]
			x="2,2,3,3,3,3,3,3,3,3"
			y="1,2,3,4,5,6,7,8,9,10"
		[/move]
	[/command]

	[command]
		[move]
			x="5,5"
			y="10,11"
		[/move]
	[/command]

	[command]
		[move]
			x="5,5"
			y="11,12"
		[/move]
	[/command]

	[command]
		[move]
			x="5,5"
			y="12,13"
		[/move]
	[/command]

	[command]
		[move]
			x="5,5"
			y="13,14"
		[/move]
	[/command]

	[command]
		[move]
			x="5,5,5"
			y="14,15,16"
		[/move]
	[/command]

	[command]
		[move]
			x="5,5,5"
			y="16,17,18"
		[/move]
	[/command]

	[command]
		[move]
			x="12,13,14,14,15,15,16"
			y="9,10,10,11,12,13,13"
		[/move]
	[/command]

	[command]
		[countdown_update]
			team="1"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]

	[command]
		[move]
			x="18,18,19,20"
			y="24,23,23,22"
		[/move]
	[/command]

	[command]
		[move]
			x="14,15,16,17"
			y="18,18,17,17"
		[/move]
	[/command]

	[command]
		[move]
			x="5,4,4,4,4,4"
			y="23,22,21,20,19,18"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="4"
				y="18"
			[/source]
			[destination]
				x="5"
				y="18"
			[/destination]
		[/attack]
		[random]
			value="24994"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="11597"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="10642"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="22155"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="14979"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="16881"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="28594"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="5,4,4"
			y="21,21,22"
		[/move]
	[/command]

	[command]
		[recruit]
			value="7"
			x="9"
			y="22"
		[/recruit]
		[random]
			value="8347"
		[/random]
		[random]
			value="18008"
		[/random]
		[random]
			value="32180"
		[/random]
		[random]
			value="24410"
		[/random]
		[random]
			value="24295"
		[/random]
		[random]
			value="32692"
		[/random]
		[random]
			value="22561"
		[/random]
		[random]
			value="4819"
		[/random]
		[random]
			value="31106"
		[/random]
		[random]
			value="6421"
		[/random]
		[random]
			value="14250"
		[/random]
		[random]
			value="15214"
		[/random]
		[random]
			value="19273"
		[/random]
		[random]
			value="23856"
		[/random]
		[random]
			value="27203"
			[results]
				checksum=",Ad3Y5f-Gtmnrp5jHbEoRiVrOCpxE4IDyxOzzQOG.nCLyyGDmUtLNvFrwCUxRLwFwmIsr1QENmxPFHFw.RFKFnqypNQrM8mwoFomIhFlq1.CLB<<ddNv5EsLNHBNzhOI"
			[/results]
		[/random]
	[/command]

	[command]
		[recruit]
			value="0"
			x="10"
			y="22"
		[/recruit]
		[random]
			value="10173"
		[/random]
		[random]
			value="4715"
		[/random]
		[random]
			value="18435"
		[/random]
		[random]
			value="15365"
		[/random]
		[random]
			value="142"
		[/random]
		[random]
			value="29813"
		[/random]
		[random]
			value="10921"
		[/random]
		[random]
			value="3847"
		[/random]
		[random]
			value="22254"
		[/random]
		[random]
			value="16995"
		[/random]
		[random]
			value="4092"
		[/random]
		[random]
			value="10998"
		[/random]
		[random]
			value="29610"
		[/random]
		[random]
			value="7637"
		[/random]
		[random]
			value="24299"
			[results]
				checksum="pMyPwoKvbBq0MCQtxRPyPu1PqOvyvtVtPtsuCMyPNLLqFJRxvqM3FDTGMqHwEVMDODuIOJsNEnPcOusOKDwebPsxOruODoP.K+zDJqnqswJL0PpQ,OvAQ30CF>dl1cth"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="11,11,11,10,9"
			y="23,22,21,20,20"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]

	[command]
		[move]
			x="9,10,11"
			y="4,3,3"
		[/move]
	[/command]

	[command]
		[recruit]
			value="1"
			x="11"
			y="5"
		[/recruit]
		[random]
			value="774813339"
		[/random]
		[random]
			value="212503999"
		[/random]
		[random]
			value="2105110901"
		[/random]
		[random]
			value="1993391715"
		[/random]
		[random]
			value="1180064604"
		[/random]
		[random]
			value="610811655"
		[/random]
		[random]
			value="1026171922"
		[/random]
		[random]
			value="927888150"
		[/random]
		[random]
			value="411892735"
		[/random]
		[random]
			value="1593858883"
		[/random]
		[random]
			value="992308241"
		[/random]
		[random]
			value="166290347"
		[/random]
		[random]
			value="755290004"
		[/random]
		[random]
			value="81012109"
		[/random]
		[random]
			value="2140284144"
			[results]
				checksum="ACIByNSVYmLXPemyRXKFwqFrLmVQqEv0TwtBGgNMvJHtOMFtHrtKmNzMnuxEPDq6BPSLFIOJqR+ProSyETFwFyA9zumVnpCouMKPBb5oJGPbmz3o>.fjcflW4pf7m5p7"
			[/results]
		[/random]
	[/command]

	[command]
		[recruit]
			value="1"
			x="13"
			y="4"
		[/recruit]
		[random]
			value="1591681748"
		[/random]
		[random]
			value="990787091"
		[/random]
		[random]
			value="644393923"
		[/random]
		[random]
			value="219011439"
		[/random]
		[random]
			value="1203291091"
		[/random]
		[random]
			value="602021176"
		[/random]
		[random]
			value="64919506"
		[/random]
		[random]
			value="235872047"
		[/random]
		[random]
			value="1212832831"
		[/random]
		[random]
			value="1091091428"
		[/random]
		[random]
			value="1163760197"
		[/random]
		[random]
			value="1624725567"
		[/random]
		[random]
			value="537466663"
		[/random]
		[random]
			value="8584790"
		[/random]
		[random]
			value="1791015914"
			[results]
				checksum="ACIByNSVYzLXPemyRXKFwqFrLmVQqEv0TwtBGgNMvJHtOMFtHrtKmNzMnuxEPDq6BPSLFIOJqR+ProSyETFwFyA9uumVnpCouMKPBb5OJGPbmz3o>.fjcflW4pf7m5p7"
			[/results]
		[/random]
	[/command]

	[command]
		[recruit]
			value="5"
			x="11"
			y="4"
		[/recruit]
		[random]
			value="1366773863"
		[/random]
		[random]
			value="163484858"
		[/random]
		[random]
			value="1204775388"
		[/random]
		[random]
			value="1610087948"
		[/random]
		[random]
			value="417874012"
		[/random]
		[random]
			value="648973489"
		[/random]
		[random]
			value="453391392"
		[/random]
		[random]
			value="1062267935"
		[/random]
		[random]
			value="867984928"
		[/random]
		[random]
			value="1656682483"
		[/random]
		[random]
			value="1664289111"
		[/random]
		[random]
			value="932904435"
		[/random]
		[random]
			value="1892554530"
		[/random]
		[random]
			value="729638294"
		[/random]
		[random]
			value="2023995863"
			[results]
				checksum="tjfpy66<OvHAptQKQ0oOBBSqwDYSGUuIaHzsLFtQzOWOCBvyFBUsQPVHTIwPFmPFBqCnEs<sBULDPTGRPzPuVKDJsNyMIt,RFNPGrGqf<xPrTryODoP.K+zDJqnmswJI"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="11,11,11,11"
			y="3,4,5,6"
		[/move]
	[/command]
	[command]
		[move]
			x="17,17,17,17"
			y="9,10,11,12"
		[/move]
	[/command]
	[command]
		[move]
			x="5,6,6,7,8,8,9,10,11"
			y="18,17,16,16,15,14,14,13,13"
		[/move]
	[/command]

	[command]
		[move]
			x="3,4,5,6,7,8,9,10,11"
			y="10,10,11,11,12,12,13,13,14"
		[/move]
	[/command]

	[command]
		[move]
			x="9,10,10"
			y="10,10,11"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]

	[command]
		[move]
			x="4,4,4,5,5,5"
			y="22,21,20,20,19,18"
		[/move]
	[/command]

	[command]
		[move]
			x="10,10,10,10"
			y="22,21,20,19"
		[/move]
	[/command]
	[command]
		[move]
			x="9,9,9,9"
			y="22,21,20,19"
		[/move]
	[/command]
	[command]
		[move]
			x="17,18"
			y="17,16"
		[/move]
	[/command]

	[command]
		[move]
			x="20,20,19,19,18,17,17,17"
			y="22,21,21,20,19,19,18,17"
		[/move]
	[/command]

	[command]
		[countdown_update]
			team="2"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]

	[command]
		[move]
			x="17,18,18,18,19,19"
			y="12,12,13,14,15,16"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="19"
				y="16"
			[/source]
			[destination]
				x="18"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="1517879681"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1501843513"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1534428667"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1163848937"
			[results]
				chance="50"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1686277709"
			[results]
				chance="50"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="16,17,17,18"
			y="13,14,15,15"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="18"
				y="15"
			[/source]
			[destination]
				x="18"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="880071653"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1288883425"
			[results]
				chance="50"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="725634283"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1877430595"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="74068122"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1391558956"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1708700946"
			[results]
				chance="50"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="11,12,13,14,15,16,17"
			y="14,14,14,14,15,15,16"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="17"
				y="16"
			[/source]
			[destination]
				x="18"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="48402201"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="206967245"
			[results]
				chance="50"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="627117423"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="83114952"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="43621357"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="279997094"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="11,12,13,14,15,15,16"
			y="13,13,14,14,15,16,16"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="16"
				y="16"
			[/source]
			[destination]
				x="17"
				y="17"
			[/destination]
		[/attack]
		[random]
			value="1936339187"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="681109786"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="11,11,11,11"
			y="6,5,4,3"
		[/move]
	[/command]

	[command]
		[move]
			x="11,11,11,11,11,10,10"
			y="4,5,6,7,8,8,9"
		[/move]
	[/command]

	[command]
		[move]
			x="11,11,11,10,10,9"
			y="5,6,7,7,8,9"
		[/move]
	[/command]

	[command]
		[move]
			x="13,13,13,12,12,12"
			y="4,5,6,6,7,8"
		[/move]
	[/command]
	[command]
		[recruit]
			value="3"
			x="11"
			y="5"
		[/recruit]
		[random]
			value="95797694"
		[/random]
		[random]
			value="215786627"
		[/random]
		[random]
			value="1116874928"
		[/random]
		[random]
			value="1999583893"
		[/random]
		[random]
			value="2070059720"
		[/random]
		[random]
			value="1845101916"
		[/random]
		[random]
			value="1775147040"
		[/random]
		[random]
			value="1598131446"
		[/random]
		[random]
			value="810156105"
		[/random]
		[random]
			value="412545153"
		[/random]
		[random]
			value="1339577385"
		[/random]
		[random]
			value="1233712990"
		[/random]
		[random]
			value="677741079"
		[/random]
		[random]
			value="1241187921"
		[/random]
		[random]
			value="2109527995"
			[results]
				checksum="rQV6GBwD,UJ+7fLAQJ+xOoaC2U6DfS5lmb>+9w26zYBFaluj9yjnQ1omih>hik67n,e0IoZ07o9kcp0Ad568,m9n<X,+m,08797o60sxBFgnXEzrk-i.-tciji+H>s3M"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="11,11"
			y="3,4"
		[/move]
	[/command]
	[command]
		[move]
			x="10,10,11,12,13,14"
			y="11,12,13,13,13,13"
		[/move]
	[/command]

	[command]
		[countdown_update]
			team="1"
			value="310000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]

	[command]
		[move]
			x="9,10,11,11,11"
			y="20,20,21,22,23"
		[/move]
	[/command]

	[command]
		[recruit]
			value="7"
			x="11"
			y="21"
		[/recruit]
		[random]
			value="10478"
		[/random]
		[random]
			value="15173"
		[/random]
		[random]
			value="28808"
		[/random]
		[random]
			value="24602"
		[/random]
		[random]
			value="9924"
		[/random]
		[random]
			value="2130"
		[/random]
		[random]
			value="8694"
		[/random]
		[random]
			value="15693"
		[/random]
		[random]
			value="2289"
		[/random]
		[random]
			value="2495"
		[/random]
		[random]
			value="26135"
		[/random]
		[random]
			value="22263"
		[/random]
		[random]
			value="19471"
		[/random]
		[random]
			value="18764"
		[/random]
		[random]
			value="24825"
			[results]
				checksum=",Ad3Y5f-Gtmsop5jHbEoRiSrOCpxE4IDyxOzzQOG.nCLyyGDmUtLNvFrwCUxRLwFwmIsr1QENmxPFHFw.RFKFnqypNLoM8mwoFomIhFlq1.CLB<<ddNv5EsLNHBNzhOI"
			[/results]
		[/random]
	[/command]

	[command]
		[recruit]
			value="0"
			x="11"
			y="22"
		[/recruit]
		[random]
			value="16408"
		[/random]
		[random]
			value="7239"
		[/random]
		[random]
			value="20356"
		[/random]
		[random]
			value="23712"
		[/random]
		[random]
			value="1605"
		[/random]
		[random]
			value="1565"
		[/random]
		[random]
			value="303"
		[/random]
		[random]
			value="3420"
		[/random]
		[random]
			value="26905"
		[/random]
		[random]
			value="11200"
		[/random]
		[random]
			value="7712"
		[/random]
		[random]
			value="9265"
		[/random]
		[random]
			value="5600"
		[/random]
		[random]
			value="8932"
		[/random]
		[random]
			value="19605"
			[results]
				checksum="pMyPwoKvbBq0MCQtxRPyPu1PqOvyvtVtPtsuCMyPNLLqFJRxvqM3FDTGMqHwEVMDODuIOJsNErPcOusOKDwebPsxOruODoP.K+zDJqnqswJL0PpQ,RvAQ30CF>hl1cth"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="13,12,11,11,11,12"
			y="17,17,17,16,15,14"
		[/move]
	[/command]

	[command]
		[move]
			x="12,13"
			y="14,14"
		[/move]
	[/command]

	[command]
		[move]
			x="9,10,11,12,13"
			y="19,18,18,17,17"
		[/move]
	[/command]
	[command]
		[move]
			x="10,11,12,13,14,15"
			y="19,19,18,18,17,17"
		[/move]
	[/command]
	[command]
		[move]
			x="17,17,16,15,14,14,14"
			y="17,18,18,18,17,16,15"
		[/move]
	[/command]

	[command]
		[move]
			x="14,15,16"
			y="15,15,15"
		[/move]
	[/command]

	[command]
		[move]
			x="18,17"
			y="16,17"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="15"
				y="17"
			[/source]
			[destination]
				x="16"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="11736"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="30901"
			[results]
				chance="60"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="9299"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="31894"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="23133"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="16"
				y="15"
			[/source]
			[destination]
				x="16"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="30457"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="14439"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="14628"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="16431"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="15561"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="3053"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="17"
				y="17"
			[/source]
			[destination]
				x="16"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="27815"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="31582"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="32684"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="27248"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1506"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="12351"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]

	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="13"
				y="14"
			[/source]
			[destination]
				x="14"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="5506"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="9955"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="3171"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="6853"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="4,5,6,7,8"
			y="18,18,17,17,16"
		[/move]
	[/command]

	[command]
		[move]
			x="11,12,13"
			y="23,22,22"
		[/move]
	[/command]

	[command]
		[countdown_update]
			team="2"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]

	[command]
		[move]
			x="19,18"
			y="16,16"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="18"
				y="16"
			[/source]
			[destination]
				x="17"
				y="17"
			[/destination]
		[/attack]
		[random]
			value="1166363958"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="299933857"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="229665471"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1946169313"
			[results]
				chance="40"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1770852302"
			[results]
				chance="40"
				damage="5"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="10,11,11,11,12,13"
			y="9,10,11,12,12,13"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="13"
				y="13"
			[/source]
			[destination]
				x="13"
				y="14"
			[/destination]
		[/attack]
		[random]
			value="341890060"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1273621485"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="372758407"
			[results]
				chance="40"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="17"
				y="16"
			[/source]
			[destination]
				x="16"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="1686668375"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1280816139"
			[results]
				chance="60"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="14,15,16,17,17"
			y="13,14,13,14,15"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="17"
				y="15"
			[/source]
			[destination]
				x="16"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="1427477724"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1508131531"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1521243761"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="18,18,17,16"
			y="15,14,14,14"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="16"
				y="14"
			[/source]
			[destination]
				x="16"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="1071233223"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="248907632"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1404657401"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1305703006"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="969415918"
			[results]
				chance="60"
				damage="4"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="16,16,16,16,16,17,17,17,17"
			y="16,15,14,13,12,12,11,10,9"
		[/move]
	[/command]

	[command]
		[move]
			x="12,13,13,14,14,15"
			y="8,9,10,10,11,12"
		[/move]
	[/command]
	[command]
		[move]
			x="9,8,7"
			y="9,9,10"
		[/move]
	[/command]

	[command]
		[move]
			x="7,7"
			y="10,11"
		[/move]
	[/command]

	[command]
		[move]
			x="7,6,5"
			y="11,10,10"
		[/move]
	[/command]

	[command]
		[move]
			x="11,11,12,12,13,13,14"
			y="5,6,6,7,8,9,9"
		[/move]
	[/command]
	[command]
		[move]
			x="11,11"
			y="4,3"
		[/move]
	[/command]

	[command]
		[recruit]
			value="1"
			x="11"
			y="5"
		[/recruit]
		[random]
			value="1651116630"
		[/random]
		[random]
			value="2072476041"
		[/random]
		[random]
			value="1347402576"
		[/random]
		[random]
			value="1619612501"
		[/random]
		[random]
			value="742866311"
		[/random]
		[random]
			value="900611615"
		[/random]
		[random]
			value="1867955176"
		[/random]
		[random]
			value="1103943915"
		[/random]
		[random]
			value="957878593"
		[/random]
		[random]
			value="940768122"
		[/random]
		[random]
			value="743859498"
		[/random]
		[random]
			value="1464673425"
		[/random]
		[random]
			value="524676551"
		[/random]
		[random]
			value="1954303303"
		[/random]
		[random]
			value="406714125"
			[results]
				checksum="ACIByNSVYoLXPemyRXKCwqFrLmVQqEv0TwtBGgNMvJHtOMFtHrtKmNzMnuxEPDq6BPSLFIOJqR+ProSyETFwFyA9BumVnpCouMKPBb5TJGPbmz3o>.fjcflW4pf7m5p7"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="11,11,11,11,12"
			y="3,4,5,6,6"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="293000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]

	[command]
		[move]
			x="13,14,15,16,16,16,16"
			y="22,21,21,20,19,18,17"
		[/move]
	[/command]

	[command]
		[move]
			x="15,16,17"
			y="17,17,17"
		[/move]
	[/command]

	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="17"
				y="17"
			[/source]
			[destination]
				x="17"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="2969"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="13187"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="21990"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="13591"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="25386"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="13,14,15,16"
			y="17,17,17,16"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="16"
				y="16"
			[/source]
			[destination]
				x="17"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="20788"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="10166"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="6912"
			[results]
				chance="60"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="25088"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="6827"
			[results]
				chance="60"
				damage="10"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="11,11,11,11,12,13"
			y="21,20,19,18,17,17"
		[/move]
	[/command]
	[command]
		[move]
			x="11,11,11,11,12,12"
			y="22,21,20,19,18,17"
		[/move]
	[/command]
	[command]
		[move]
			x="8,8"
			y="16,15"
		[/move]
	[/command]

	[command]
		[move]
			x="8,8,9,10,11"
			y="15,14,14,13,13"
		[/move]
	[/command]

	[command]
		[move]
			x="11,12"
			y="13,13"
		[/move]
	[/command]

	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="13"
				y="14"
			[/source]
			[destination]
				x="13"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="15897"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="12145"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="6864"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="26692"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="21700"
			[results]
				chance="40"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="12"
				y="13"
			[/source]
			[destination]
				x="13"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="11510"
			[results]
				chance="40"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="20167"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="16688"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="22032"
			[results]
				chance="40"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="23624"
			[results]
				chance="40"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="8648"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]

	[command]
		[countdown_update]
			team="2"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]

	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="13"
				y="13"
			[/source]
			[destination]
				x="13"
				y="14"
			[/destination]
		[/attack]
		[random]
			value="33227629"
			[results]
				chance="40"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="99024758"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="477477462"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="18,18,18,18,18,17"
			y="16,15,14,13,12,12"
		[/move]
	[/command]
	[command]
		[move]
			x="16,16,15,15,15,15"
			y="14,13,13,12,11,10"
		[/move]
	[/command]
	[command]
		[move]
			x="17,17,18,18,18"
			y="15,14,13,12,11"
		[/move]
	[/command]
	[command]
		[move]
			x="15,16,17"
			y="12,12,13"
		[/move]
	[/command]
	[command]
		[move]
			x="14,15,16,17"
			y="9,10,10,11"
		[/move]
	[/command]
	[command]
		[move]
			x="11,11,11,10,10,10,9"
			y="5,6,7,7,8,9,10"
		[/move]
	[/command]

	[command]
		[move]
			x="12,12,11,11,11"
			y="6,5,5,4,3"
		[/move]
	[/command]

	[command]
		[recruit]
			value="1"
			x="11"
			y="5"
		[/recruit]
		[random]
			value="322019986"
		[/random]
		[random]
			value="380175912"
		[/random]
		[random]
			value="1477968956"
		[/random]
		[random]
			value="152082944"
		[/random]
		[random]
			value="1734693110"
		[/random]
		[random]
			value="1183268595"
		[/random]
		[random]
			value="174454005"
		[/random]
		[random]
			value="2067164887"
		[/random]
		[random]
			value="1011358186"
		[/random]
		[random]
			value="521224438"
		[/random]
		[random]
			value="768729162"
		[/random]
		[random]
			value="1810886586"
		[/random]
		[random]
			value="1094347775"
		[/random]
		[random]
			value="1628013868"
		[/random]
		[random]
			value="974912250"
			[results]
				checksum="ACIByNSVYyLXPemyRXKFwqFrLmVQqEv0TwtBGgNMvJHtOMFtHrtKmNzMnuxEPDq6BPSLFIOJqR+ProSyETFwFyA9vumVnpCouMKPBb5TJGPbmz3o>.fjcflW4p97m5p7"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="11,11"
			y="3,4"
		[/move]
	[/command]
	[command]
		[move]
			x="5,5"
			y="10,11"
		[/move]
	[/command]

	[command]
		[move]
			x="5,5"
			y="11,12"
		[/move]
	[/command]

	[command]
		[move]
			x="5,5"
			y="12,13"
		[/move]
	[/command]

	[command]
		[move]
			x="5,6"
			y="13,13"
		[/move]
	[/command]

	[command]
		[countdown_update]
			team="1"
			value="246000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]

	[command]
		[move]
			x="13,12,11,11,12"
			y="14,14,14,13,12"
		[/move]
	[/command]

	[command]
		[move]
			x="13,14,14,14,14"
			y="17,16,15,14,13"
		[/move]
	[/command]

	[command]
		[move]
			x="16,16,15,14,13,12,11"
			y="17,18,19,19,20,20,21"
		[/move]
	[/command]

	[command]
		[move]
			x="17,17,17,16,16"
			y="17,16,15,14,13"
		[/move]
	[/command]

	[command]
		[move]
			x="16,17"
			y="16,17"
		[/move]
	[/command]

	[command]
		[move]
			x="17,18"
			y="17,16"
		[/move]
	[/command]

	[command]
		[move]
			x="12,13,14,15,16,17"
			y="17,17,16,17,17,17"
		[/move]
	[/command]

	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="14"
				y="13"
			[/source]
			[destination]
				x="13"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="8267"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="27891"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="16077"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="28979"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="28728"
			[results]
				chance="40"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="12"
				y="12"
			[/source]
			[destination]
				x="13"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="30866"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="5352"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="15340"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="22446"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="13351"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]

	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="12"
				y="13"
			[/source]
			[destination]
				x="13"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="23298"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="4419"
			[results]
				chance="40"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="318"
			[results]
				chance="40"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="25773"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="18468"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="4671"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]

	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="16"
				y="13"
			[/source]
			[destination]
				x="17"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="29498"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1905"
			[results]
				chance="50"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="2531"
			[results]
				chance="50"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="16875"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="22112"
			[results]
				chance="50"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="30755"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]

	[command]
		[countdown_update]
			team="2"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]

	[command]
		[move]
			x="13,13"
			y="13,12"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="13"
				y="12"
			[/source]
			[destination]
				x="12"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="1618747046"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1337356004"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1694747814"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="6,7,8,9,10,11"
			y="13,13,13,13,13,13"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="11"
				y="13"
			[/source]
			[destination]
				x="12"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="1366689597"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1361219918"
			[results]
				chance="40"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="318240589"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="9,10,11,12,12,12"
			y="10,9,9,9,10,11"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="12"
				y="11"
			[/source]
			[destination]
				x="12"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="1932405104"
			[results]
				chance="40"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1646084446"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="618614081"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="17,16,15,14,13,12,11,10,9"
			y="9,9,9,9,10,9,9,9,10"
		[/move]
	[/command]

	[command]
		[move]
			x="15,16,17"
			y="10,9,9"
		[/move]
	[/command]

	[command]
		[move]
			x="18,17,16,15,14"
			y="11,11,10,11,10"
		[/move]
	[/command]
	[command]
		[move]
			x="17,16"
			y="13,12"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="16"
				y="12"
			[/source]
			[destination]
				x="16"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="445482724"
			[results]
				chance="50"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="758233664"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1081915472"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="55133318"
			[results]
				chance="50"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1027386235"
			[results]
				chance="50"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1595464000"
			[results]
				chance="50"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="17,16"
			y="11,11"
		[/move]
	[/command]
	[command]
		[move]
			x="17,17"
			y="12,13"
		[/move]
	[/command]

	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="17"
				y="13"
			[/source]
			[destination]
				x="16"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="2094289485"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1028651720"
			[results]
				chance="50"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="2120883805"
			[results]
				chance="50"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="426370011"
			[results]
				chance="50"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="938333008"
			[results]
				chance="50"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="416666320"
			[results]
				chance="50"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1458744600"
			[results]
				chance="50"
				damage="5"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="16,17"
			y="11,12"
		[/move]
	[/command]
	[command]
		[move]
			x="11,11,12,12,12,12"
			y="5,6,6,7,8,9"
		[/move]
	[/command]
	[command]
		[move]
			x="11,11,11,11,11,11"
			y="4,5,6,7,8,9"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="187000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]

	[command]
		[move]
			x="11,11,11"
			y="21,22,23"
		[/move]
	[/command]
	[command]
		[recruit]
			value="0"
			x="11"
			y="21"
		[/recruit]
		[random]
			value="27382"
		[/random]
		[random]
			value="4993"
		[/random]
		[random]
			value="1702"
		[/random]
		[random]
			value="5076"
		[/random]
		[random]
			value="29094"
		[/random]
		[random]
			value="23697"
		[/random]
		[random]
			value="4445"
		[/random]
		[random]
			value="19010"
		[/random]
		[random]
			value="12778"
		[/random]
		[random]
			value="15197"
		[/random]
		[random]
			value="14196"
		[/random]
		[random]
			value="11471"
		[/random]
		[random]
			value="14093"
		[/random]
		[random]
			value="9171"
		[/random]
		[random]
			value="7088"
			[results]
				checksum="pMyPvoKvbBq0MCQtxRPyPu1PqOvyvtVtPtsuCMyPNLLqFJRxvqM3FDTGMqHwEVMDODuIOJsNEBPcOusOKDwebPsxOruODoP.K+zDJqnqswJG0PpQ,OvAQ30CF>nl1cth"
			[/results]
		[/random]
	[/command]

	[command]
		[recruit]
			value="7"
			x="11"
			y="22"
		[/recruit]
		[random]
			value="1324"
		[/random]
		[random]
			value="28611"
		[/random]
		[random]
			value="928"
		[/random]
		[random]
			value="12433"
		[/random]
		[random]
			value="1488"
		[/random]
		[random]
			value="28876"
		[/random]
		[random]
			value="13026"
		[/random]
		[random]
			value="23023"
		[/random]
		[random]
			value="31115"
		[/random]
		[random]
			value="1633"
		[/random]
		[random]
			value="24336"
		[/random]
		[random]
			value="20707"
		[/random]
		[random]
			value="23414"
		[/random]
		[random]
			value="24712"
		[/random]
		[random]
			value="21537"
			[results]
				checksum=",Ad3Y5f-Gtmsop5jHbEoRiSrOCpxE4IDyxOzzQOG.nCLyyGDmUtLNvFrwCUxRLwFwmIsr1QENmxPFHFw.RFKFnqypNLoM8mwoFomIhFlq1.CLB<<ddNv5EsLNHBNzhOI"
			[/results]
		[/random]
	[/command]

	[command]
		[recruit]
			value="1"
			x="10"
			y="22"
		[/recruit]
		[random]
			value="1978"
		[/random]
		[random]
			value="30692"
		[/random]
		[random]
			value="28306"
		[/random]
		[random]
			value="19830"
		[/random]
		[random]
			value="24242"
		[/random]
		[random]
			value="32059"
		[/random]
		[random]
			value="22295"
		[/random]
		[random]
			value="25739"
		[/random]
		[random]
			value="30920"
		[/random]
		[random]
			value="7478"
		[/random]
		[random]
			value="1965"
		[/random]
		[random]
			value="3957"
		[/random]
		[random]
			value="30533"
		[/random]
		[random]
			value="1101"
		[/random]
		[random]
			value="2555"
			[results]
				checksum="14,Wfc>cu2lH0olW9-5N-m<e6f60hfabkcij<4>i3h3e2.t0a1f<j870h0k565.Y0>ide2Hi80k.d8da021n<.26Z+40CN5c8b.-X,48K.7v3f3XdJFikGNVwGMoVOFH"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="11,11,11,11,11"
			y="23,22,21,20,19"
		[/move]
	[/command]
	[command]
		[move]
			x="12,12,12,12,13"
			y="13,14,15,16,17"
		[/move]
	[/command]
	[command]
		[move]
			x="18,17,17,16,16"
			y="16,16,15,14,13"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="16"
				y="13"
			[/source]
			[destination]
				x="17"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="28645"
			[results]
				chance="50"
				damage="10"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="12"
				y="12"
			[/source]
			[destination]
				x="13"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="16498"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="17905"
			[results]
				chance="40"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="15125"
			[results]
				chance="50"
				damage="9"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="14,14,14"
			y="13,12,11"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="14"
				y="11"
			[/source]
			[destination]
				x="14"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="9560"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="25342"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="27248"
			[results]
				chance="50"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="25993"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]

	[command]
		[countdown_update]
			team="2"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]

	[command]
		[move]
			x="11,12"
			y="13,13"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="12"
				y="13"
			[/source]
			[destination]
				x="12"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="1976257047"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="353865171"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1536014189"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="11,12,12,13"
			y="9,9,10,11"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="13"
				y="11"
			[/source]
			[destination]
				x="14"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="1070459563"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1453440593"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="113123177"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1736597391"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1523015270"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1533869508"
			[results]
				chance="60"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="910215327"
			[results]
				chance="60"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="17,16"
			y="9,9"
		[/move]
	[/command]
	[command]
		[move]
			x="14,15,16,17"
			y="10,10,9,9"
		[/move]
	[/command]
	[command]
		[move]
			x="12,13,14"
			y="9,10,10"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="14"
				y="10"
			[/source]
			[destination]
				x="14"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="1536807145"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="891052967"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="947755781"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1811685173"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1059338854"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="250492471"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="901200077"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]

[command]
undo="no"
[speak]
id="Funeral_Warfog"
message="hmmm no comment :)"
side="2"
[/speak]
[/command]

	[command]
		[move]
			x="9,10,11,12,13,14,15,15"
			y="10,9,9,9,10,9,10,11"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="15"
				y="11"
			[/source]
			[destination]
				x="14"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="1261083361"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1027028625"
			[results]
				chance="60"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="758084436"
			[results]
				chance="60"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="16,16,16,15"
			y="9,10,11,12"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="15"
				y="12"
			[/source]
			[destination]
				x="14"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="1343399982"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="406144804"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1303979934"
			[results]
				chance="60"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1348839159"
			[results]
				chance="60"
				damage="6"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="16,17"
			y="12,13"
		[/move]
	[/command]
	[command]
		[move]
			x="17,16"
			y="12,12"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="16"
				y="12"
			[/source]
			[destination]
				x="16"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="457207223"
			[results]
				chance="50"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="296999277"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1862968082"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]

	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="17"
				y="13"
			[/source]
			[destination]
				x="16"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="286387315"
			[results]
				chance="50"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1113707368"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="267507406"
			[results]
				chance="50"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="886708235"
			[results]
				chance="50"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="12"
				y="11"
			[/source]
			[destination]
				x="12"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="343370994"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1243952899"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2063192436"
			[results]
				chance="40"
				damage="4"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]

[command]
undo="no"
[speak]
id="Nobun"
message="???"
[/speak]
[/command]

	[command]
		[countdown_update]
			team="1"
			value="181000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]

	[command]
		[move]
			x="11,11,11,11,11"
			y="19,20,21,22,23"
		[/move]
	[/command]
	[command]
		[move]
			x="17,16"
			y="17,16"
		[/move]
	[/command]

	[command]
		[move]
			x="16,16,16"
			y="16,15,14"
		[/move]
	[/command]

	[command]
		[move]
			x="16,15,15"
			y="14,14,13"
		[/move]
	[/command]

	[command]
		[move]
			x="11,11,12,13,14,15,15"
			y="22,21,20,20,19,19,18"
		[/move]
	[/command]

	[command]
		[move]
			x="13,14"
			y="17,16"
		[/move]
	[/command]
	[command]
		[move]
			x="11,11,11,11,12,13"
			y="21,20,19,18,17,17"
		[/move]
	[/command]
	[command]
		[move]
			x="5,5,5"
			y="18,17,16"
		[/move]
	[/command]

	[command]
		[move]
			x="5,6"
			y="16,15"
		[/move]
	[/command]

	[command]
		[move]
			x="6,5,5,5"
			y="15,16,17,18"
		[/move]
	[/command]

	[command]
		[move]
			x="10,9,8,7,6,6,6,6,6,6"
			y="22,22,21,21,20,19,18,17,16,15"
		[/move]
	[/command]

	[command]
		[recruit]
			value="6"
			x="11"
			y="21"
		[/recruit]
		[random]
			value="29094"
		[/random]
		[random]
			value="31276"
		[/random]
		[random]
			value="17024"
		[/random]
		[random]
			value="28863"
		[/random]
		[random]
			value="2430"
		[/random]
		[random]
			value="26946"
		[/random]
		[random]
			value="20130"
		[/random]
		[random]
			value="18538"
		[/random]
		[random]
			value="30088"
		[/random]
		[random]
			value="5691"
		[/random]
		[random]
			value="5554"
		[/random]
		[random]
			value="9611"
		[/random]
		[random]
			value="29295"
		[/random]
		[random]
			value="24804"
		[/random]
		[random]
			value="30422"
			[results]
				checksum="XBfX4cmdHYau810h3t9co8gj2UWo-1,n-62ad7l9i<dX9dX-4o9W2w2-6hZd9kbd.d07gZj2f,ep8ybXfdk5k4Nw>d595,cp6dzgA.Zj4982<j3D1<4M96i7zO.<CyyI"
			[/results]
		[/random]
	[/command]

	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="15"
				y="13"
			[/source]
			[destination]
				x="15"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="30997"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="30585"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="11515"
			[results]
				chance="60"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="24224"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="4158"
			[results]
				chance="60"
				damage="7"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="16"
				y="13"
			[/source]
			[destination]
				x="16"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="26614"
			[results]
				chance="50"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="6370"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="7984"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="20990"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="19353"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="14,15,15,15,15,15"
			y="16,16,15,14,13,12"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="15"
				y="12"
			[/source]
			[destination]
				x="16"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="6326"
			[results]
				chance="50"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="11082"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="32060"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2298"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="8198"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="741"
			[results]
				chance="50"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[countdown_update]
			team="2"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]

[command]
undo="no"
[speak]
id="Funeral_Warfog"
message="I was ashamed for such a luck I had"
side="2"
[/speak]
[/command]

[command]
undo="no"
[speak]
id="Nobun"
message="lol"
[/speak]
[/command]

	[command]
		[move]
			x="17,17,17,16"
			y="9,10,11,11"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="16"
				y="11"
			[/source]
			[destination]
				x="15"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="1954758674"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2118356347"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1021660811"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="16,17,17,17,17"
			y="12,12,11,10,9"
		[/move]
	[/command]
	[command]
		[move]
			x="17,16"
			y="13,12"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="16"
				y="12"
			[/source]
			[destination]
				x="15"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="1068671622"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1044574295"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1173142513"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1914947064"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="928715172"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1932996589"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="12,12,12,11,10,9"
			y="11,10,9,9,9,10"
		[/move]
	[/command]

	[command]
		[move]
			x="13,12,12,11,11,10"
			y="11,10,9,9,8,7"
		[/move]
	[/command]

	[command]
		[move]
			x="12,13,14"
			y="13,13,13"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="14"
				y="13"
			[/source]
			[destination]
				x="15"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="307962854"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="149414623"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="199555419"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="2055915662"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="127967591"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1280166860"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="15,16,17,17,17"
			y="11,10,11,12,13"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="17"
				y="13"
			[/source]
			[destination]
				x="16"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="1361797300"
			[results]
				chance="50"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="989212089"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="181168460"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="14,14"
			y="10,11"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="14"
				y="11"
			[/source]
			[destination]
				x="15"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="1947764089"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="937915170"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="398857933"
			[results]
				chance="40"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[countdown_update]
			team="1"
			value="155000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]

[command]
undo="no"
[speak]
id="Stas"
message=")))"
side="1"
[/speak]
[/command]

	[command]
		[move]
			x="16,16,16,16,17"
			y="13,14,15,16,17"
		[/move]
	[/command]
	[command]
		[move]
			x="15,15,16,17,18"
			y="12,11,10,10,9"
		[/move]
	[/command]

	[command]
		[move]
			x="13,14,14,14"
			y="17,16,15,14"
		[/move]
	[/command]
	[command]
		[move]
			x="15,15,15,16,16,16"
			y="18,17,16,15,14,13"
		[/move]
	[/command]

	[command]
		[move]
			x="11,11,11,12,12,13"
			y="21,20,19,18,17,17"
		[/move]
	[/command]
	[command]
		[move]
			x="6,7,7,7,6,5,5,5"
			y="15,15,14,13,12,12,11,10"
		[/move]
	[/command]

	[command]
		[move]
			x="5,5,4,4,4,4"
			y="18,17,16,15,14,13"
		[/move]
	[/command]
	[command]
		[recruit]
			value="7"
			x="11"
			y="21"
		[/recruit]
		[random]
			value="15141"
		[/random]
		[random]
			value="19775"
		[/random]
		[random]
			value="1959"
		[/random]
		[random]
			value="16123"
		[/random]
		[random]
			value="31562"
		[/random]
		[random]
			value="7599"
		[/random]
		[random]
			value="30199"
		[/random]
		[random]
			value="7782"
		[/random]
		[random]
			value="564"
		[/random]
		[random]
			value="11437"
		[/random]
		[random]
			value="9223"
		[/random]
		[random]
			value="12375"
		[/random]
		[random]
			value="28733"
		[/random]
		[random]
			value="3643"
		[/random]
		[random]
			value="13985"
			[results]
				checksum=",Ad3Y5f-Gtmnsp5jHbEoRiVrOCpxE4IDyxOzzQOG.nCLyyGDmUtLNvFrwCUxRLwFwmIsr1QENmxPFHFw.RFKFnqypNQsM8mwoFomIhFlq1.CLW<<ddNv5EsLNHBNzkOI"
			[/results]
		[/random]
	[/command]

	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="15"
				y="13"
			[/source]
			[destination]
				x="16"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="4775"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="22126"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="31393"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="4706"
			[results]
				chance="60"
				damage="3"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="16"
				y="13"
			[/source]
			[destination]
				x="17"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="22768"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="31938"
			[results]
				chance="50"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1799"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="13182"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="30442"
			[results]
				chance="50"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="18670"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]

	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="14"
				y="14"
			[/source]
			[destination]
				x="14"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="32159"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="30246"
			[results]
				chance="50"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="5653"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1807"
			[results]
				chance="50"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="20302"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="6975"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]

	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="18"
				y="9"
			[/source]
			[destination]
				x="17"
				y="9"
			[/destination]
		[/attack]
		[random]
			value="20648"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="7187"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="5633"
			[results]
				chance="40"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="17838"
			[results]
				chance="30"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="7207"
			[results]
				chance="40"
				damage="5"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[countdown_update]
			team="2"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]

	[command]
		[move]
			x="16,16,16,17"
			y="11,10,9,9"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="17"
				y="9"
			[/source]
			[destination]
				x="18"
				y="9"
			[/destination]
		[/attack]
		[random]
			value="102404037"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="23436113"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1348864466"
			[results]
				chance="70"
				damage="5"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="10,10,10,11,11,11"
			y="7,6,5,5,4,3"
		[/move]
	[/command]

	[command]
		[recruit]
			value="1"
			x="11"
			y="4"
		[/recruit]
		[random]
			value="171637363"
		[/random]
		[random]
			value="1746908189"
		[/random]
		[random]
			value="1705874387"
		[/random]
		[random]
			value="1943914097"
		[/random]
		[random]
			value="893042587"
		[/random]
		[random]
			value="470206248"
		[/random]
		[random]
			value="1801410573"
		[/random]
		[random]
			value="55621353"
		[/random]
		[random]
			value="1636078415"
		[/random]
		[random]
			value="1732873764"
		[/random]
		[random]
			value="1405564247"
		[/random]
		[random]
			value="216952920"
		[/random]
		[random]
			value="610048923"
		[/random]
		[random]
			value="924813141"
		[/random]
		[random]
			value="1192769891"
			[results]
				checksum="ACIByNSVYrLXPemyRXKCwqFrLmVQqEv0TwtBGgNMvJHtOMFtHrtKmNzMnuxEPDq6BPSLFIOJqR+ProSyETFwFyA9CumVnpCouMKPBb5tJGPbmz3o>.fjcflW4pf7m5p7"
			[/results]
		[/random]
	[/command]

	[command]
		[recruit]
			value="1"
			x="11"
			y="5"
		[/recruit]
		[random]
			value="218457306"
		[/random]
		[random]
			value="1347589242"
		[/random]
		[random]
			value="544977202"
		[/random]
		[random]
			value="14887755"
		[/random]
		[random]
			value="93148181"
		[/random]
		[random]
			value="1015183451"
		[/random]
		[random]
			value="1816298328"
		[/random]
		[random]
			value="148769534"
		[/random]
		[random]
			value="503778218"
		[/random]
		[random]
			value="1401688445"
		[/random]
		[random]
			value="1554333781"
		[/random]
		[random]
			value="720731138"
		[/random]
		[random]
			value="2011737368"
		[/random]
		[random]
			value="331663275"
		[/random]
		[random]
			value="1913501030"
			[results]
				checksum="ACIByNSVYzLXPemyRXKFwqFrLmVQqEv0TwtBGgNMvJHtOMFtHrtKmNzMnuxEPDq6BPSLFIOJqR+ProSyETFwFyA9uumVnpCouMKPBb5OJGPbmz3o>.fjcflW4pf7m5p7"
			[/results]
		[/random]
	[/command]

	[command]
		[recruit]
			value="3"
			x="12"
			y="3"
		[/recruit]
		[random]
			value="1712797649"
		[/random]
		[random]
			value="39253644"
		[/random]
		[random]
			value="1833860031"
		[/random]
		[random]
			value="967002446"
		[/random]
		[random]
			value="1593587425"
		[/random]
		[random]
			value="407107522"
		[/random]
		[random]
			value="831256166"
		[/random]
		[random]
			value="1925250700"
		[/random]
		[random]
			value="173124904"
		[/random]
		[random]
			value="619900344"
		[/random]
		[random]
			value="449304704"
		[/random]
		[random]
			value="887397646"
		[/random]
		[random]
			value="1488937982"
		[/random]
		[random]
			value="1056780501"
		[/random]
		[random]
			value="48393944"
			[results]
				checksum="rQV6GBwD,UJ+7fMAQJ+xOoaC2U6DfS5lmb>+9w26zYBFaluj9yjnQ1omih>hik67n,e0IoZ07o9kcp0Ad568,m9n<X,+m-08797o60sxBFgnkEzrk-i.-tciji+H>s3M"
			[/results]
		[/random]
	[/command]

	[command]
		[recruit]
			value="1"
			x="13"
			y="4"
		[/recruit]
		[random]
			value="71095340"
		[/random]
		[random]
			value="914601016"
		[/random]
		[random]
			value="1970479787"
		[/random]
		[random]
			value="1401177153"
		[/random]
		[random]
			value="479915017"
		[/random]
		[random]
			value="2009733431"
		[/random]
		[random]
			value="1087553537"
		[/random]
		[random]
			value="1446917463"
		[/random]
		[random]
			value="1455837208"
		[/random]
		[random]
			value="1494661059"
		[/random]
		[random]
			value="130689981"
		[/random]
		[random]
			value="1233604261"
		[/random]
		[random]
			value="1667785963"
		[/random]
		[random]
			value="750590326"
		[/random]
		[random]
			value="1682908965"
			[results]
				checksum="ACIByNSVYrLXPemyRXKCwqFrLmVQqEv0TwtBGgNMvJHtOMFtHrtKmNzMnuxEPDq6BPSLFIOJqR+ProSyETFwFyA9CumVnpCouMKPBb5TJGPbmz3o>.fjcflW4p97m5p7"
			[/results]
		[/random]
	[/command]

	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="16"
				y="12"
			[/source]
			[destination]
				x="16"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="1103061752"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1553268017"
			[results]
				chance="50"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="960374685"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1006718775"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="845472562"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1708097158"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1067160904"
			[results]
				chance="50"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="17,18"
			y="13,12"
		[/move]
	[/command]

[command]
undo="no"
[speak]
id="Nobun"
message="i think it is hard to manage humans with elfs (advantage during day)"
[/speak]
[/command]

	[command]
		[move]
			x="14,15,16,17,17"
			y="11,12,11,12,13"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="17"
				y="13"
			[/source]
			[destination]
				x="16"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="1877516003"
			[results]
				chance="50"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="814769369"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2140514829"
			[results]
				chance="50"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="985018565"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="597938666"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="341866578"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="248579916"
			[results]
				chance="50"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="14,14,14,14,14,14"
			y="13,12,11,10,9,8"
		[/move]
	[/command]
	[command]
		[move]
			x="18,17,16,15,14,14,13,13,12"
			y="12,12,11,11,10,9,9,8,7"
		[/move]
	[/command]

	[command]
		[countdown_update]
			team="1"
			value="158000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]

	[command]
		[move]
			x="13,12,11,11,11,10,9"
			y="17,17,17,16,15,14,14"
		[/move]
	[/command]
	[command]
		[move]
			x="16,16,15,15,14,13"
			y="13,14,15,16,16,17"
		[/move]
	[/command]
	[command]
		[move]
			x="14,15,16,17,18"
			y="14,15,15,16,16"
		[/move]
	[/command]

	[command]
		[move]
			x="11,11,11,10,9,8"
			y="21,20,19,18,18,17"
		[/move]
	[/command]

	[command]
		[recruit]
			value="7"
			x="11"
			y="21"
		[/recruit]
		[random]
			value="28124"
		[/random]
		[random]
			value="29458"
		[/random]
		[random]
			value="26804"
		[/random]
		[random]
			value="16110"
		[/random]
		[random]
			value="525"
		[/random]
		[random]
			value="26042"
		[/random]
		[random]
			value="30792"
		[/random]
		[random]
			value="31186"
		[/random]
		[random]
			value="13254"
		[/random]
		[random]
			value="19365"
		[/random]
		[random]
			value="28294"
		[/random]
		[random]
			value="21336"
		[/random]
		[random]
			value="21940"
		[/random]
		[random]
			value="12440"
		[/random]
		[random]
			value="23730"
			[results]
				checksum=",Ad3Y5f-Gtmsop5jHbEoRiSrOCpxE4IDyxOzzQOG.nCLyyGDmUtLNvFrwCUxRLwFwmIsr1QENmxPFHFw.RFKFnqypNLoM8mwoFomIhFlq1.CLB<<ddNv5EsLNHBNzhOI"
			[/results]
		[/random]
	[/command]

	[command]
		[recruit]
			value="0"
			x="11"
			y="22"
		[/recruit]
		[random]
			value="6051"
		[/random]
		[random]
			value="16798"
		[/random]
		[random]
			value="551"
		[/random]
		[random]
			value="10515"
		[/random]
		[random]
			value="20200"
		[/random]
		[random]
			value="20746"
		[/random]
		[random]
			value="25968"
		[/random]
		[random]
			value="14030"
		[/random]
		[random]
			value="14901"
		[/random]
		[random]
			value="8170"
		[/random]
		[random]
			value="23492"
		[/random]
		[random]
			value="27448"
		[/random]
		[random]
			value="5637"
		[/random]
		[random]
			value="25495"
		[/random]
		[random]
			value="17572"
			[results]
				checksum="pMyPwoKvbBq0MCQtxRPyPu1PqOvyvtVtPtsuCMyPNLLqFJRxvqM3FDTGMqHwEVMDODuIOJsNEnPcOusOKDwebPsxOruODoP.K+zDJqnqswJL0PpQ,OvAQ30CF>dl1cth"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="11,11,11,11,11,12,13"
			y="23,22,21,20,19,18,18"
		[/move]
	[/command]
	[command]
		[move]
			x="5,5,5,6,6,6,6,5,4"
			y="10,9,8,7,6,5,4,4,3"
		[/move]
	[/command]

	[command]
		[move]
			x="4,4,4,5,5"
			y="13,12,11,11,10"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]

	[command]
		[move]
			x="11,10,9,8,7,6,5"
			y="4,3,4,4,4,3,3"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="5"
				y="3"
			[/source]
			[destination]
				x="4"
				y="3"
			[/destination]
		[/attack]
		[random]
			value="631278543"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1465727034"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1479492101"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="11,10,9,8,7,6"
			y="5,5,6,6,7,7"
		[/move]
	[/command]

	[command]
		[move]
			x="12,11,10,9,8"
			y="3,4,4,5,4"
		[/move]
	[/command]
	[command]
		[move]
			x="13,12,11,10,9,8,7"
			y="4,4,5,5,6,6,7"
		[/move]
	[/command]
	[command]
		[move]
			x="17,16"
			y="9,9"
		[/move]
	[/command]
	[command]
		[move]
			x="14,15,16,17"
			y="8,9,8,9"
		[/move]
	[/command]
	[command]
		[move]
			x="11,10,9,8,7,6"
			y="3,3,4,4,4,3"
		[/move]
	[/command]
	[command]
		[move]
			x="17,17"
			y="13,14"
		[/move]
	[/command]

	[command]
		[move]
			x="17,17,18"
			y="14,15,15"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="18"
				y="15"
			[/source]
			[destination]
				x="18"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="137254356"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="798430294"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2140330733"
			[results]
				chance="50"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1418781320"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="458678122"
			[results]
				chance="50"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="2129487046"
			[results]
				chance="50"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="16,16,17,18,19,19"
			y="12,13,14,14,15,16"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="19"
				y="16"
			[/source]
			[destination]
				x="18"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="1815193959"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1470036871"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="168920341"
			[results]
				chance="50"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="753019880"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1934645385"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="964185786"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="16,16,16,17"
			y="9,10,11,12"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="105000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]

	[command]
		[move]
			x="11,11,12,13,14,15,15"
			y="22,21,20,20,19,19,18"
		[/move]
	[/command]

	[command]
		[move]
			x="13,14,15,16,17"
			y="18,17,17,16,16"
		[/move]
	[/command]

	[command]
		[move]
			x="17,16,16,17"
			y="17,16,15,15"
		[/move]
	[/command]
	[command]
		[move]
			x="13,14,15,16,17"
			y="17,17,17,17,17"
		[/move]
	[/command]
	[command]
		[move]
			x="18,17,16,15,14,13"
			y="16,17,16,16,16,17"
		[/move]
	[/command]
	[command]
		[move]
			x="11,11,11,11,12,13,14"
			y="21,20,19,18,17,17,16"
		[/move]
	[/command]
	[command]
		[move]
			x="8,7,6,5"
			y="17,18,17,18"
		[/move]
	[/command]

	[command]
		[move]
			x="4,3,2,2,2"
			y="3,4,3,2,1"
		[/move]
	[/command]
	[command]
		[move]
			x="9,9,10,11"
			y="14,13,12,12"
		[/move]
	[/command]

	[command]
		[move]
			x="11,11,11"
			y="12,11,10"
		[/move]
	[/command]

	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="17"
				y="16"
			[/source]
			[destination]
				x="18"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="31"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="27734"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="23794"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="26874"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="13940"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="20907"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="8127"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="17"
				y="15"
			[/source]
			[destination]
				x="18"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="23442"
			[results]
				chance="60"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="13114"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="18298"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1780"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="13351"
			[results]
				chance="60"
				damage="8"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]

	[command]
		[move]
			x="19,19,20,20"
			y="16,15,14,13"
		[/move]
	[/command]
	[command]
		[move]
			x="17,17,16,16,15"
			y="12,11,10,9,9"
		[/move]
	[/command]
	[command]
		[move]
			x="6,5,4,3"
			y="3,3,2,2"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="3"
				y="2"
			[/source]
			[destination]
				x="2"
				y="1"
			[/destination]
		[/attack]
		[random]
			value="1171853733"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1325209316"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1193948776"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="5,4,4,3"
			y="3,2,1,1"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="3"
				y="1"
			[/source]
			[destination]
				x="2"
				y="1"
			[/destination]
		[/attack]
		[random]
			value="1820592271"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="983400083"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1386029185"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="12,11,10,9,8,7,6,5,4"
			y="7,7,6,6,5,5,4,4,3"
		[/move]
	[/command]

	[command]
		[move]
			x="17,16,15,14,13,12"
			y="9,9,9,9,10,10"
		[/move]
	[/command]

	[command]
		[move]
			x="9,10"
			y="10,9"
		[/move]
	[/command]
	[command]
		[move]
			x="6,5,4,4"
			y="7,8,8,9"
		[/move]
	[/command]

	[command]
		[move]
			x="7,7,7,7,6"
			y="7,8,9,10,10"
		[/move]
	[/command]

	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="6"
				y="10"
			[/source]
			[destination]
				x="5"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="1800586954"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1697634481"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="521302476"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1981106239"
			[results]
				chance="40"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="4"
				y="9"
			[/source]
			[destination]
				x="5"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="2047885785"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1799511965"
			[results]
				chance="50"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1053274262"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1741129138"
			[results]
				chance="40"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="10"
				y="9"
			[/source]
			[destination]
				x="11"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="2094413914"
			[results]
				chance="40"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1139508018"
			[results]
				chance="40"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="667629848"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]

	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="12"
				y="10"
			[/source]
			[destination]
				x="11"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="972024281"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1396023923"
			[results]
				chance="40"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="985179038"
			[results]
				chance="40"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[countdown_update]
			team="1"
			value="211000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]

	[command]
		[move]
			x="17,17,18,18,18,18,19"
			y="17,16,15,14,13,12,12"
		[/move]
	[/command]

	[command]
		[move]
			x="14,15,15,15,15,16"
			y="16,16,15,14,13,12"
		[/move]
	[/command]

	[command]
		[move]
			x="17,18,18,18"
			y="16,15,14,13"
		[/move]
	[/command]

	[command]
		[move]
			x="17,17,18,19"
			y="15,14,13,13"
		[/move]
	[/command]
	[command]
		[move]
			x="15,16,17,17,18,19,20"
			y="18,17,17,16,15,15,14"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="20"
				y="14"
			[/source]
			[destination]
				x="20"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="19673"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="27019"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="8482"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="21732"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="26276"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="13582"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]

	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="19"
				y="13"
			[/source]
			[destination]
				x="20"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="11736"
			[results]
				chance="40"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="7289"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="4963"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="7065"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="30618"
			[results]
				chance="40"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="4738"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="11532"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[choose]
			value="1"
		[/choose]
	[/command]

	[command]
		[move]
			x="5,5,4,4,4"
			y="18,17,16,15,14"
		[/move]
	[/command]

	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="2"
				y="1"
			[/source]
			[destination]
				x="3"
				y="1"
			[/destination]
		[/attack]
		[random]
			value="15476"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="19276"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="11783"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="18553"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="25001"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="21899"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="13575"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="11,11"
			y="10,11"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="2"
			value="251000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]

	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="3"
				y="1"
			[/source]
			[destination]
				x="2"
				y="1"
			[/destination]
		[/attack]
		[random]
			value="41882614"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1977131657"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="196403234"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="4,3,2,1,1"
			y="3,3,3,3,2"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="1"
				y="2"
			[/source]
			[destination]
				x="2"
				y="1"
			[/destination]
		[/attack]
		[random]
			value="1806045152"
			[results]
				chance="60"
				damage="8"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="8,8,8,8,7,7,6"
			y="4,5,6,7,8,9,9"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="6"
				y="9"
			[/source]
			[destination]
				x="5"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="784111826"
			[results]
				chance="40"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1971656722"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1071939536"
			[results]
				chance="40"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="4,4"
			y="9,10"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="4"
				y="10"
			[/source]
			[destination]
				x="5"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="1935973569"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1830719171"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="257204180"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1096700178"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1285191585"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="281454164"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="270334986"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]

	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="6"
				y="10"
			[/source]
			[destination]
				x="5"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="431356935"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="992381215"
			[results]
				chance="40"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="810571306"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="2139994539"
			[results]
				chance="40"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1975552317"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="688635887"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2036626313"
			[results]
				chance="40"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="20"
				y="13"
			[/source]
			[destination]
				x="20"
				y="14"
			[/destination]
		[/attack]
		[random]
			value="1497091878"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1780763624"
			[results]
				chance="40"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="2086744172"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="664452701"
			[results]
				chance="40"
				damage="5"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="10,10"
			y="9,10"
		[/move]
	[/command]

	[command]
		[move]
			x="12,12"
			y="10,11"
		[/move]
	[/command]
	[command]
		[move]
			x="15,14,13,12"
			y="9,9,10,10"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="12"
				y="10"
			[/source]
			[destination]
				x="11"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="1147568739"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="356262215"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="716922752"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="10"
				y="10"
			[/source]
			[destination]
				x="11"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="1433137917"
			[results]
				chance="40"
				damage="3"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="3,4,5,6,7,8"
			y="2,2,3,3,4,4"
		[/move]
	[/command]

	[command]
		[countdown_update]
			team="1"
			value="232000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]

	[command]
		[move]
			x="18,18,17,17,17,17"
			y="13,12,12,11,10,9"
		[/move]
	[/command]

	[command]
		[move]
			x="19,19,19,18,17,16"
			y="13,12,11,10,10,9"
		[/move]
	[/command]
	[command]
		[move]
			x="19,19,19,19,18"
			y="12,11,10,9,8"
		[/move]
	[/command]

	[command]
		[move]
			x="16,15,14"
			y="12,12,11"
		[/move]
	[/command]

	[command]
		[move]
			x="14,13"
			y="11,11"
		[/move]
	[/command]

	[command]
		[move]
			x="20,21,21,21,20,19,18"
			y="14,14,13,12,11,11,10"
		[/move]
	[/command]
	[command]
		[move]
			x="4,4,5,6,7,7"
			y="14,13,13,12,12,11"
		[/move]
	[/command]

	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="13"
				y="11"
			[/source]
			[destination]
				x="12"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="32424"
			[results]
				chance="50"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="24008"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="4622"
			[results]
				chance="50"
				damage="10"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="7"
				y="11"
			[/source]
			[destination]
				x="6"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="30600"
			[results]
				chance="60"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="26207"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="5600"
			[results]
				chance="60"
				damage="9"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="5"
				y="10"
			[/source]
			[destination]
				x="6"
				y="9"
			[/destination]
		[/attack]
		[random]
			value="5950"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="8209"
			[results]
				chance="40"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="16323"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="17238"
			[results]
				chance="40"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="9200"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="18,18"
			y="8,7"
		[/move]
	[/command]

	[command]
		[countdown_update]
			team="2"
			value="276000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]

	[command]
		[move]
			x="8,9,10,11"
			y="4,4,3,3"
		[/move]
	[/command]

	[command]
		[recruit]
			value="1"
			x="13"
			y="4"
		[/recruit]
		[random]
			value="1264381965"
		[/random]
		[random]
			value="1620152551"
		[/random]
		[random]
			value="690045151"
		[/random]
		[random]
			value="1354005427"
		[/random]
		[random]
			value="95169970"
		[/random]
		[random]
			value="1032562552"
		[/random]
		[random]
			value="876498616"
		[/random]
		[random]
			value="676985200"
		[/random]
		[random]
			value="1032154177"
		[/random]
		[random]
			value="446689118"
		[/random]
		[random]
			value="61477616"
		[/random]
		[random]
			value="480483087"
		[/random]
		[random]
			value="393824517"
		[/random]
		[random]
			value="1886861783"
		[/random]
		[random]
			value="956781366"
			[results]
				checksum="ACIByNSVYyLXPemyRXKFwqFrLmVQqEv0TwtBGgNMvJHtOMFtHrtKmNzMnuxEPDq6BPSLFIOJqR+ProSyETFwFyA9vumVnpCouMKPBb5TJGPbmz3o>.fjcflW4p97m5p7"
			[/results]
		[/random]
	[/command]

	[command]
		[recruit]
			value="1"
			x="11"
			y="5"
		[/recruit]
		[random]
			value="1628136272"
		[/random]
		[random]
			value="1564754663"
		[/random]
		[random]
			value="1422008020"
		[/random]
		[random]
			value="2074825391"
		[/random]
		[random]
			value="1626232279"
		[/random]
		[random]
			value="1902491107"
		[/random]
		[random]
			value="321166260"
		[/random]
		[random]
			value="1365610414"
		[/random]
		[random]
			value="711788826"
		[/random]
		[random]
			value="70141928"
		[/random]
		[random]
			value="400515180"
		[/random]
		[random]
			value="706055195"
		[/random]
		[random]
			value="735182717"
		[/random]
		[random]
			value="1455092812"
		[/random]
		[random]
			value="1309758641"
			[results]
				checksum="ACIByNSVYrLXPemyRXKCwqFrLmVQqEv0TwtBGgNMvJHtOMFtHrtKmNzMnuxEPDq6BPSLFIOJqR+ProSyETFwFyA9CumVnpCouMKPBb5TJGPbmz3o>.fjcflW4p97m5p7"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="3,2"
			y="1,1"
		[/move]
	[/command]
	[command]
		[move]
			x="12,12,11,10,9,8"
			y="10,9,9,9,10,10"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="8"
				y="10"
			[/source]
			[destination]
				x="7"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="393463534"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="820792402"
			[results]
				chance="60"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="2091305520"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1058603398"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="6,6"
			y="9,10"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="6"
				y="10"
			[/source]
			[destination]
				x="7"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="700952166"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1537530793"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1066964083"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="1,2,3,3,3,4,5,5,5,5"
			y="2,2,3,4,5,5,6,7,8,9"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="5"
				y="9"
			[/source]
			[destination]
				x="5"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="138561650"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="781008493"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1971408740"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]

	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="4"
				y="10"
			[/source]
			[destination]
				x="5"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="93588087"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="943328855"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1494810953"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1987446332"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1318509244"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="45625260"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1125104969"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="10,9,8,7,6"
			y="10,10,9,9,9"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="6"
				y="9"
			[/source]
			[destination]
				x="5"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="684477415"
			[results]
				chance="60"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1204194875"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1880432260"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1467675410"
			[results]
				chance="40"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="101889755"
			[results]
				chance="60"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1843653512"
			[results]
				chance="40"
				damage="5"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="11,11"
			y="3,4"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="254000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]

	[command]
		[move]
			x="13,13,12,11,10,9"
			y="11,10,9,9,9,10"
		[/move]
	[/command]

	[command]
		[move]
			x="7,7"
			y="11,10"
		[/move]
	[/command]

	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="7"
				y="10"
			[/source]
			[destination]
				x="6"
				y="9"
			[/destination]
		[/attack]
		[random]
			value="29881"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="21383"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="13309"
			[results]
				chance="60"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="5688"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="6393"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="20518"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="13387"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]

	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="9"
				y="10"
			[/source]
			[destination]
				x="8"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="4884"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="21855"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="31341"
			[results]
				chance="60"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="19439"
			[results]
				chance="60"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="18,17,17,16,15,15,15"
			y="10,10,9,8,8,7,6"
		[/move]
	[/command]

	[command]
		[move]
			x="17,16,15,15,15,14,13"
			y="9,8,8,7,6,5,5"
		[/move]
	[/command]

	[command]
		[move]
			x="18,17,16,15,14,14"
			y="7,7,6,6,5,4"
		[/move]
	[/command]

	[command]
		[move]
			x="16,16,16,15,15,14"
			y="9,8,7,7,6,5"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="14"
				y="4"
			[/source]
			[destination]
				x="13"
				y="4"
			[/destination]
		[/attack]
		[random]
			value="6134"
			[results]
				chance="40"
				damage="12"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="11878"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="4442"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="3302"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1548"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="14932"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="30534"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="13,14,14,14,13"
			y="17,16,15,14,14"
		[/move]
	[/command]

	[command]
		[countdown_update]
			team="2"
			value="317000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]

	[command]
		[move]
			x="2,3,4,5,6,7,8"
			y="1,2,2,3,3,4,4"
		[/move]
	[/command]

	[command]
		[move]
			x="6,5"
			y="10,10"
		[/move]
	[/command]
	[command]
		[move]
			x="4,5,6"
			y="10,10,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="1835879629"
			[results]
				chance="60"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1279765435"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="192535095"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1863188746"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="52908067"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1567957137"
			[results]
				chance="60"
				damage="6"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="8,9"
			y="10,11"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="9"
				y="11"
			[/source]
			[destination]
				x="9"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="24555185"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1748102621"
			[results]
				chance="80"
				damage="6"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="6,7,8,9"
			y="9,9,8,9"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="9"
				y="9"
			[/source]
			[destination]
				x="9"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="2091987428"
			[results]
				chance="40"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="526014722"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1552433470"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1831373422"
			[results]
				chance="40"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[choose]
			value="1"
		[/choose]
	[/command]

	[command]
		[move]
			x="5,5,5,5,5"
			y="9,10,11,12,13"
		[/move]
	[/command]

	[command]
		[move]
			x="5,5"
			y="13,14"
		[/move]
	[/command]

	[command]
		[move]
			x="5,5"
			y="14,15"
		[/move]
	[/command]

	[command]
		[move]
			x="11,11"
			y="4,3"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="13"
				y="4"
			[/source]
			[destination]
				x="14"
				y="4"
			[/destination]
		[/attack]
		[random]
			value="911937856"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1320267096"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="336714495"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1280675646"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="661592931"
			[results]
				chance="40"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1721691200"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="772817658"
			[results]
				chance="60"
				damage="5"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[countdown_update]
			team="1"
			value="217000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]

	[command]
		[move]
			x="9,8"
			y="10,10"
		[/move]
	[/command]

	[command]
		[move]
			x="8,8,7,6,5,5"
			y="10,11,12,12,12,11"
		[/move]
	[/command]

	[command]
		[move]
			x="15,15,14"
			y="6,5,4"
		[/move]
	[/command]

	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="14"
				y="4"
			[/source]
			[destination]
				x="13"
				y="4"
			[/destination]
		[/attack]
		[random]
			value="27849"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="16457"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="662"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="22737"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="20964"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="26232"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="13,14,15,15,15,14,13"
			y="5,5,5,4,3,2,3"
		[/move]
	[/command]

	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="13"
				y="3"
			[/source]
			[destination]
				x="13"
				y="4"
			[/destination]
		[/attack]
		[random]
			value="24721"
			[results]
				chance="40"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="23310"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="770"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="10851"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="29476"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="6226"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="31625"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="14,15,15,14"
			y="5,5,4,3"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="14"
				y="3"
			[/source]
			[destination]
				x="13"
				y="4"
			[/destination]
		[/attack]
		[random]
			value="29005"
			[results]
				chance="40"
				damage="11"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="5"
				y="11"
			[/source]
			[destination]
				x="5"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="12630"
			[results]
				chance="40"
				damage="8"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]

	[command]
		[move]
			x="13,12,11,10,10"
			y="14,13,13,12,11"
		[/move]
	[/command]

	[command]
		[countdown_update]
			team="2"
			value="330000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]

	[command]
		[move]
			x="11,12,13"
			y="5,4,4"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="13"
				y="4"
			[/source]
			[destination]
				x="13"
				y="3"
			[/destination]
		[/attack]
		[random]
			value="1950005273"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="896785088"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1681301614"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1190410722"
			[results]
				chance="40"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1192913359"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1918054077"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="976905442"
			[results]
				chance="60"
				damage="5"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]

[command]
undo="no"
[speak]
id="Funeral_Warfog"
message="gg :)"
side="2"
[/speak]
[/command]

[command]
undo="no"
[speak]
id="Stas"
message="gg"
side="1"
[/speak]
[/command]

[command]
undo="no"
[speak]
id="Stas"
message="whay yuo do that?"
side="1"
[/speak]
[/command]

[command]
undo="no"
[speak]
id="Funeral_Warfog"
message="without luck you won"
side="2"
[/speak]
[/command]

[command]
undo="no"
[speak]
id="Funeral_Warfog"
message="hm desperate attack"
side="2"
[/speak]
[/command]

[command]
undo="no"
[speak]
id="Stas"
message="tnx"
side="1"
[/speak]
[/command]

[command]
undo="no"
[speak]
id="Funeral_Warfog"
message="silly strategy"
side="2"
[/speak]
[/command]

[command]
undo="no"
[speak]
id="Funeral_Warfog"
message="see ya"
side="2"
[/speak]
[/command]

[command]
undo="no"
[speak]
id="Stas"
message="bay"
side="1"
[/speak]
[/command]

[command]
[speak]
id="server"
message="Funeral_Warfog has left the game."
[/speak]
[/command]

[command]
[speak]
id="server"
message="Stas takes control of side 2."
[/speak]
[/command]
[/replay]
[replay_start]
current_tod="0"
description="Warfare transforms the simple farms and villages of a peaceful region into a subtly parceled battlefield."
experience_modifier="70"
hash="EqK,,,KxGHj1q>FS,UdqBn4erWBwx7tGxLe4nIo9f0-xnP6JQuOI6W-92qdedEsY3JamDYvGPYyVho<aFvF.erCJ<kAmykeuOUMfxjIttN.OSV6lVoINmB+HvhWlBQFe"
id="multiplayer_Hamlets"
map_data="border_size=1
usage=map

Gs^Fp       , Hh          , Gg          , Wwf         , Wwf         , Gs^Fp       , Hh          , Gs^Fp       , Gg          , Gs^Fp       , Gs^Fp       , Wwf         , Gg          , Hh          , Gs^Fms      , Mm          , Wwf         , Wwf         , Hh          , Gs^Fp       , Hh          , Mm          , Mm          
Hh          , Hh          , Gg^Vh       , Wwf         , Wwf         , Gs^Fp       , Mm          , Hh          , Gg          , Gs^Fms      , Wwf         , Wwf         , Wwf         , Mm          , Hh          , Gs^Fms      , Wwf         , Wwf         , Gs^Fp       , Hh          , Hh          , Gs^Fms      , Hh          
Wwf         , Wwf         , Wwf         , Wwf         , Gg          , Wwf         , Wwf         , Hh          , Gg          , Gg          , Wwf         , Ch          , Wwf         , Gs^Fp       , Wwf         , Wwf         , Gg          , Gg          , Hh          , Mm          , Wwf         , Mm          , Hh          
Mm          , Hh          , Wwf         , Gg^Fp       , Gg^Ve       , Wwf         , Gg          , Gg          , Wwf         , Wwf         , Wwf         , 1 Kh        , Ch          , Wwf         , Gg          , Gg          , Rd          , Rd^Uf       , Wwf         , Wwf         , Gs^Fms      , Wwf         , Wwf         
Wwf         , Wwf         , Mm          , Wwf         , Gg^Fms      , Wwf         , Wwf         , Wwf         , Gg^Vh       , Gg          , Wwf         , Ch          , Wwf         , Ch          , Rd          , Rd          , Wwf         , Wwf         , Gg^Vh       , Gs^Fp       , Re^Gvs      , Hh          , Hh          
Gs^Fp       , Hh          , Wwf         , Gg^Fp       , Wwf         , Wwf         , Gg          , Gg          , Rd          , Gg          , Wwf         , Ch          , Gg          , Wwf         , Wwf         , Wwf         , Mm          , Gs^Fp       , Gg          , Re^Gvs      , Gg^Wm       , Re^Gvs      , Re^Gvs      
Wwf         , Wwf         , Mm          , Wwf         , Hh          , Gg^Fms      , Rd          , Rd          , Gg          , Gg          , Wwf         , Wwf         , Gs^Fms      , Gg          , Hh          , Gg          , Gg          , Gg          , Rd          , Gg          , Gg          , Hh          , Hh          
Gs^Fp       , Hh          , Gs^Fms      , Gg          , Gg          , Rd          , Gg          , Gg          , Wwf         , Wwf         , Gs^Fms      , Wwf         , Gs^Fp       , Mm          , Gg          , Gg          , Rd          , Rd          , Gg          , Ggf         , Mm          , Gs^Fp       , Gs^Fp       
Gs^Fp       , Gs^Fp       , Gg          , Gg          , Wwf         , Gg          , Wwf         , Wwf         , Mm          , Hh          , Wwf         , Wwf         , Gg          , Gg          , Rd          , Rd          , Rd          , Gg          , Gs^Fp       , Gs^Fms      , Gs^Fms      , Hh          , Hh          
Hh          , Hh          , Wwf         , Wwf         , Hh          , Wwf         , Gg          , Gg          , Gg          , Gg          , Wwf         , Gg          , Gg          , Rd          , Gg          , Gg          , Gg          , Gg^Vh       , Hh          , Gg          , Wwf         , Ggf         , Ggf         
Wwf         , Wwf         , Hh          , Ggf         , Gs^Fp       , Gg^Vh       , Re^Gvs      , Gg          , Gg          , Ss^Vhs      , Hh          , Ww          , Gs^Fms      , Gg          , Gs^Fp       , Hh          , Wwf         , Wwf         , Wwf         , Wwf         , Gg          , Wwf         , Wwf         
Hh          , Hh          , Gg          , Gg^Wm       , Re^Gvs      , Re^Gvs      , Re^Gvs      , Gg          , Gg          , Ss          , Gs^Fp       , Ww          , Hh          , Mm          , Wwf         , Wwf         , Gg          , Gg          , Rd^Uf       , Gg          , Gg          , Gs^Fp       , Gs^Fms      
Gs^Fp       , Gs^Fp       , Gg          , Gg          , Gg          , Re^Gvs      , Gg          , Gg          , Hh          , Mm          , Wwf         , Ww          , Ww          , Wo          , Wwf         , Gg          , Hh          , Gs^Fp       , Rd          , Rd          , Hh          , Gg          , Gg          
Rd          , Rd          , Gs^Fms      , Hh          , Rd          , Gg          , Gs^Fp       , Gg          , Gg          , Wwf         , Gg          , Gg          , Gg          , Wwf         , Gg          , Gg          , Gs^Fp       , Rd^Uf       , Rd          , Mm          , Gs^Fms      , Rd          , Rd          
Rd          , Rd          , Hh          , Mm          , Rd          , Rd^Uf       , Hh          , Gg          , Wwf         , Wwf         , Ww          , Gg          , Wwf         , Wwf         , Hh          , Gg          , Gg          , Gg          , Gg          , Hh          , Gg          , Rd          , Rd          
Gg          , Gg          , Gg          , Rd          , Rd^Uf       , Gs^Fp       , Gg          , Gg          , Wwf         , Wo          , Hh          , Ww          , Gs^Fp       , Mm          , Gg          , Gg          , Re^Gvs      , Re^Gvs      , Re^Gvs      , Gg          , Gg          , Gs^Fp       , Gs^Fp       
Gs^Fp       , Gs^Fp       , Gg          , Gg          , Wwf         , Gg          , Wwf         , Wwf         , Gs^Fms      , Mm          , Gs^Fp       , Ww          , Hh          , Ss          , Gg          , Gg          , Re^Gvs      , Re^Gvs      , Gs^Fms      , Gg^Wm       , Hh          , Hh          , Hh          
Wwf         , Wwf         , Wwf         , Wwf         , Hh          , Wwf         , Gg          , Hh          , Gg          , Gg          , Gg          , Ww          , Wwf         , Ss^Vhs      , Gg          , Gg          , Gg          , Gg^Vh       , Hh          , Ggf         , Wwf         , Wwf         , Wwf         
Ggf         , Ggf         , Gs^Fms      , Gg          , Gs^Fp       , Gg^Vh       , Rd          , Gg          , Rd          , Rd          , Gg          , Gg          , Wwf         , Gg          , Mm          , Gg          , Wwf         , Wwf         , Wwf         , Wwf         , Gg          , Mm          , Mm          
Hh          , Hh          , Mm          , Gs^Fp       , Gg          , Gg          , Rd          , Rd          , Gg          , Gg          , Gs^Fms      , Wwf         , Gs^Fms      , Hh          , Wwf         , Wwf         , Gg          , Gg          , Gg          , Gg          , Gs^Fp       , Gs^Fms      , Gs^Fms      
Gs^Fp       , Gs^Fp       , Gg          , Ggf         , Rd          , Rd          , Gg          , Gg          , Hh          , Mm          , Gg          , Wwf         , Wwf         , Wwf         , Gg          , Gg          , Rd          , Rd          , Hh          , Gg          , Mm          , Hh          , Hh          
Hh          , Hh          , Gg^Wm       , Gg          , Gg          , Gg          , Mm          , Gg          , Wwf         , Wwf         , Wwf         , Ch          , Gg          , Gg          , Rd          , Rd          , Gg          , Gg^Fp       , Wwf         , Wwf         , Wwf         , Wwf         , Wwf         
Re^Gvs      , Re^Gvs      , Re^Gvs      , Re^Gvs      , Gg^Vh       , Gs^Fp       , Wwf         , Wwf         , Rd          , Ch          , Ch          , Ch          , Gg          , Gg          , Gg^Vh       , Gg          , Wwf         , Wwf         , Gg^Fms      , Gg^Fp       , Gg^Ve       , Gg          , Gg          
Hh          , Hh          , Gs^Fms      , Gs^Fp       , Wwf         , Wwf         , Rd          , Rd          , Gg          , Gg          , Wwf         , 2 Kh        , Wwf         , Gg          , Wwf         , Wwf         , Gg          , Wwf         , Wwf         , Wwf         , Wwf         , Gs^Fp       , Gs^Fp       
Gs^Fp       , Mm          , Wwf         , Wwf         , Hh          , Rd^Uf       , Gs^Fp       , Hh          , Wwf         , Wwf         , Wwf         , Ch          , Wwf         , Wwf         , Hh          , Gg          , Ggf         , Wwf         , Gg^Vh       , Gg          , Wwf         , Mm          , Mm          
Gs^Fp       , Gs^Fp       , Wwf         , Gs^Fp       , Mm          , Hh          , Hh          , Wwf         , Gs^Fp       , Gs^Fp       , Gg          , Wwf         , Gg          , Gs^Fms      , Gs^Fms      , Gg          , Ggf         , Wwf         , Wwf         , Gg          , Gs^Fp       , Wwf         , Hh          
"
mp_countdown="yes"
mp_countdown_action_bonus="13"
mp_countdown_init_time="270"
mp_countdown_reservoir_time="330"
mp_countdown_turn_bonus="60"
mp_fog="yes"
mp_shroud="no"
mp_use_map_settings="yes"
mp_village_gold="2"
name="2p - Hamlets"
next_underlying_unit_id="0"
objectives="Victory:
@Defeat enemy leader(s)"
observer="yes"
random_seed="831554023"
random_start_time="no"
scenario="ladder1500"
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="Stas"
flag_rgb="magenta"
fog="yes"
gender="male"
gold="100"
id="Stas1"
image="units/elves-wood/captain.png"
income="0"
leader="Elvish Captain,Elvish Hero,Elvish Ranger,Elvish Marksman,Elvish Druid,Elvish Sorceress,White Mage,Red Mage,Elder Wose"
mp_countdown="yes"
mp_countdown_action_bonus="13"
mp_countdown_init_time="270"
mp_countdown_reservoir_time="330"
mp_countdown_turn_bonus="60"
name="Stas"
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"
save_id="Stas1"
share_maps="no"
share_view="yes"
shroud="no"
side="1"
team_name="north"
terrain_liked="Ff, Fa, Ss, Ww"
type="Elvish Captain"
user_team_name="wesnoth-multiplayerteamname^North"
village_gold="2"
[ai]
recruitment_pattern="fighter,fighter,archer,archer,mixed fighter,healer,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="human"
current_player="Stas"
flag_rgb="magenta"
fog="yes"
gender="male"
gold="100"
id="Funeral_Warfog2"
image="units/human-loyalists/lieutenant.png"
income="0"
leader="Lieutenant,Swordsman,Pikeman,Javelineer,Shock Trooper,Longbowman,White Mage,Red Mage"
mp_countdown="yes"
mp_countdown_action_bonus="13"
mp_countdown_init_time="270"
mp_countdown_reservoir_time="330"
mp_countdown_turn_bonus="60"
name="Funeral_Warfog"
random_leader="Lieutenant,Swordsman,Pikeman,Javelineer,Longbowman,Red Mage"
recruit="Cavalryman,Horseman,Spearman,Fencer,Heavy Infantryman,Bowman,Mage,Merman Fighter"
save_id="Funeral_Warfog2"
share_maps="no"
share_view="yes"
shroud="no"
side="2"
team_name="south"
terrain_liked="Gg, Ww, Wo"
type="Lieutenant"
user_team_name="wesnoth-multiplayerteamname^South"
village_gold="2"
[ai]
recruitment_pattern="fighter,fighter,fighter,archer,mixed fighter,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]
