label="2p - Den of Onis replay Ion514"
version="1.6"
completion="victory"
campaign_type="multiplayer"
difficulty="NORMAL"
random_seed="23997"
random_calls="0"
next_underlying_unit_id="33"
end_text_duration="0"
[variables]
[/variables]
[replay]
	[command]
		[start]
		[/start]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Sgt_Syphillis has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="LordMM has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[recruit]
			value="5"
			x="15"
			y="22"
		[/recruit]
		[random]
			value="20714"
		[/random]
		[random]
			value="27570"
		[/random]
		[random]
			value="18814"
		[/random]
		[random]
			value="27749"
		[/random]
		[random]
			value="15041"
		[/random]
		[random]
			value="9897"
		[/random]
		[random]
			value="10604"
		[/random]
		[random]
			value="11104"
		[/random]
		[random]
			value="11709"
		[/random]
		[random]
			value="22825"
		[/random]
		[random]
			value="7624"
		[/random]
		[random]
			value="8183"
		[/random]
		[random]
			value="31541"
		[/random]
		[random]
			value="3653"
		[/random]
		[random]
			value="18474"
			[results]
				checksum="afk10b5br.kQp.+wk<Ab-239eel1N5llg71o3Xl17<1,5g7Z-k6kZlaGnZ68p4>gn6n3e1iafnb5+9fn4>73a+>+.57mc,6d1edjnNmi-f,a8gbj+B.awWJe+,PQ3hpQ"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="eastprince has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Doc_Holiday has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[recruit]
			value="3"
			x="15"
			y="23"
		[/recruit]
		[random]
			value="5968"
		[/random]
		[random]
			value="28782"
		[/random]
		[random]
			value="7427"
		[/random]
		[random]
			value="4131"
		[/random]
		[random]
			value="10774"
		[/random]
		[random]
			value="10354"
		[/random]
		[random]
			value="5681"
		[/random]
		[random]
			value="27182"
		[/random]
		[random]
			value="20345"
		[/random]
		[random]
			value="4350"
		[/random]
		[random]
			value="30897"
		[/random]
		[random]
			value="31624"
		[/random]
		[random]
			value="18721"
		[/random]
		[random]
			value="4649"
		[/random]
		[random]
			value="17675"
			[results]
				checksum="80M696kdt17Q-aGPQ75eF4RIQSHu+GNvRCnIqFywJTCHmxqx1EwQVOxDmGODNOzCNSPAGPJpfzEDPJCs,8AqDwqDqPxMAuFRQxPzFwD4s97wU,890qvi7pTKIPwx3xSB"
			[/results]
		[/random]
	[/command]
	[command]
		[recruit]
			value="2"
			x="14"
			y="21"
		[/recruit]
		[random]
			value="18922"
		[/random]
		[random]
			value="32422"
		[/random]
		[random]
			value="23597"
		[/random]
		[random]
			value="407"
		[/random]
		[random]
			value="968"
		[/random]
		[random]
			value="24729"
		[/random]
		[random]
			value="12268"
		[/random]
		[random]
			value="8401"
		[/random]
		[random]
			value="16633"
		[/random]
		[random]
			value="6568"
		[/random]
		[random]
			value="28441"
		[/random]
		[random]
			value="28538"
		[/random]
		[random]
			value="20134"
		[/random]
		[random]
			value="10472"
		[/random]
		[random]
			value="10434"
			[results]
				checksum="dyxuTOIUoJO8HNrG4rKqKKyCcwwqoNtRxBzMHwQmPyQBpPAuOCIG6zNHsCQFqzuGzwKqqyuyKqpN5RBJTuEm3frBwnBwBICTrpKGHCIsunwtfvIWc<MGO<7LH5>c8208"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="Ion514"
			message="gl & hf"
			side="2"
		[/speak]
	[/command]
	[command]
		[recruit]
			value="4"
			x="13"
			y="21"
		[/recruit]
		[random]
			value="5131"
		[/random]
		[random]
			value="29359"
		[/random]
		[random]
			value="1179"
		[/random]
		[random]
			value="18238"
		[/random]
		[random]
			value="20555"
		[/random]
		[random]
			value="21429"
		[/random]
		[random]
			value="31096"
		[/random]
		[random]
			value="5402"
		[/random]
		[random]
			value="1194"
		[/random]
		[random]
			value="29446"
		[/random]
		[random]
			value="9082"
		[/random]
		[random]
			value="18291"
		[/random]
		[random]
			value="955"
		[/random]
		[random]
			value="15800"
		[/random]
		[random]
			value="19693"
			[results]
				checksum="4zf1OSv,C7F>rbJjGs8AZ92.m<LzFBEHnuR73QRpoMa2r4.k-cpOaw87,.Y8Z.5ndaB-kwWvSlbAfbufC3iaj7hobd->Zhepk<>2fa5>ai01-b1+6Z+40CN5c8b.>X,4"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="pad911 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="15,16,17,18,19"
			y="24,23,23,22,22"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		undo="no"
		[speak]
			id="solange1"
			message="thx, same"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="2"
			x="17"
			y="5"
		[/recruit]
		[random]
			value="30044"
		[/random]
		[random]
			value="11901"
		[/random]
		[random]
			value="28174"
		[/random]
		[random]
			value="32747"
		[/random]
		[random]
			value="25686"
		[/random]
		[random]
			value="1534"
		[/random]
		[random]
			value="7547"
		[/random]
		[random]
			value="26130"
		[/random]
		[random]
			value="4566"
		[/random]
		[random]
			value="9694"
		[/random]
		[random]
			value="27643"
		[/random]
		[random]
			value="31354"
		[/random]
		[random]
			value="13864"
		[/random]
		[random]
			value="28811"
		[/random]
		[random]
			value="20556"
			[results]
				checksum="dyxuTOJUoJO8HNrG4rKqKKyCcwwqoNtRxBzMHwQmPyQBpPAuOCIG6zNHsCQFqzuGzwKqqyuyKqqQ5RBJTuEm3frBwnBwBICTrpKGHCIsunwtfvIWc<MGO<7LH5>f.208"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="2"
			x="15"
			y="4"
		[/recruit]
		[random]
			value="32"
		[/random]
		[random]
			value="30742"
		[/random]
		[random]
			value="20851"
		[/random]
		[random]
			value="7057"
		[/random]
		[random]
			value="11459"
		[/random]
		[random]
			value="5114"
		[/random]
		[random]
			value="4510"
		[/random]
		[random]
			value="13257"
		[/random]
		[random]
			value="7476"
		[/random]
		[random]
			value="19869"
		[/random]
		[random]
			value="8467"
		[/random]
		[random]
			value="14484"
		[/random]
		[random]
			value="15513"
		[/random]
		[random]
			value="4191"
		[/random]
		[random]
			value="30526"
			[results]
				checksum="dyxuTOIUoJO8HNrG4rKqKKyCcwwqoNtRxBzMHwQmPyQBpPAuOCIG6zNHsCQFqzuGzwKqqyuyKqqT5RBJTuEm3frBwnBwBICTrpKGHCIsunwtfvIWc-MGO<7LH5>f<208"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="0"
			x="16"
			y="4"
		[/recruit]
		[random]
			value="30193"
		[/random]
		[random]
			value="30789"
		[/random]
		[random]
			value="1949"
		[/random]
		[random]
			value="16904"
		[/random]
		[random]
			value="5917"
		[/random]
		[random]
			value="4560"
		[/random]
		[random]
			value="24341"
		[/random]
		[random]
			value="32159"
		[/random]
		[random]
			value="5028"
		[/random]
		[random]
			value="11930"
		[/random]
		[random]
			value="28890"
		[/random]
		[random]
			value="12836"
		[/random]
		[random]
			value="20948"
		[/random]
		[random]
			value="5385"
		[/random]
		[random]
			value="15820"
			[results]
				checksum=">UABwPGKRFs+RPQ0VDMFU5szDKhwNqBscwwqoNtRxBzMHwQmPyPvpPAuOCIG6zNHsCQFqzuGzwKqqyuyKqqV5RBJTuEm3frBwnBwBICTrpKGHCIsunwtfyIWcjMGO<Yo"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="5"
			x="15"
			y="3"
		[/recruit]
		[random]
			value="17791"
		[/random]
		[random]
			value="19435"
		[/random]
		[random]
			value="24862"
		[/random]
		[random]
			value="26128"
		[/random]
		[random]
			value="4038"
		[/random]
		[random]
			value="5742"
		[/random]
		[random]
			value="11977"
		[/random]
		[random]
			value="31156"
		[/random]
		[random]
			value="21040"
		[/random]
		[random]
			value="32116"
		[/random]
		[random]
			value="31793"
		[/random]
		[random]
			value="25169"
		[/random]
		[random]
			value="7452"
		[/random]
		[random]
			value="10412"
		[/random]
		[random]
			value="2006"
			[results]
				checksum="efk10b5br.lQp.+wk<Ab-239eel1N5llg71o3Xl17<1,5g7Z-k6kZlaGnZ68p4>gn6n3e1iafnb5+9er4>73a+>+.57mc,6d1edjnNmi-f,a8gbj+B.awWJe+,PQ3hpR"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,14,13,12,11"
			y="2,2,3,3,4"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="15,16,17,18,19,20,21,22"
			y="22,21,21,20,21,20,20,19"
		[/move]
	[/command]
	[command]
		[move]
			x="13,12,11,11,11,10,9"
			y="21,20,20,19,18,17,17"
		[/move]
	[/command]
	[command]
		[move]
			x="14,13,12,11,10"
			y="21,21,20,21,20"
		[/move]
	[/command]
	[command]
		[move]
			x="15,15,15,15,16,16,16"
			y="23,22,21,20,19,18,17"
		[/move]
	[/command]
	[command]
		[move]
			x="19,18,17,16,15"
			y="22,22,23,23,24"
		[/move]
	[/command]
	[command]
		[recruit]
			value="4"
			x="13"
			y="21"
		[/recruit]
		[random]
			value="8977"
		[/random]
		[random]
			value="3717"
		[/random]
		[random]
			value="18943"
		[/random]
		[random]
			value="20862"
		[/random]
		[random]
			value="13033"
		[/random]
		[random]
			value="30178"
		[/random]
		[random]
			value="19064"
		[/random]
		[random]
			value="15017"
		[/random]
		[random]
			value="3308"
		[/random]
		[random]
			value="10129"
		[/random]
		[random]
			value="30084"
		[/random]
		[random]
			value="31601"
		[/random]
		[random]
			value="32268"
		[/random]
		[random]
			value="19976"
		[/random]
		[random]
			value="22490"
			[results]
				checksum="3Cf1OSv,C7F>rbJjRs8AZ92.m<LzFBEHnuR73QRpoMa2r4.k-cpOaw87,.Y8Z.5ndaB-kwWvSlbAfbufC3iaj7hobd->Zheuk<>2fa5>ai01-b1+6Z+40CN5c8b.>X,4"
			[/results]
		[/random]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,18,19,19,20,20,21"
			y="5,5,6,7,7,8,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="16,16,15,14,14,14"
			y="4,5,6,6,7,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,16,17,18,19,20"
			y="3,3,4,4,5,5"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,15,15,15,15,15,16"
			y="4,5,6,7,8,9,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="commrad has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,12,13,14,15"
			y="4,3,3,2,2"
		[/move]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="4"
			x="17"
			y="5"
		[/recruit]
		[random]
			value="17293"
		[/random]
		[random]
			value="6926"
		[/random]
		[random]
			value="15726"
		[/random]
		[random]
			value="790"
		[/random]
		[random]
			value="30072"
		[/random]
		[random]
			value="14127"
		[/random]
		[random]
			value="16037"
		[/random]
		[random]
			value="15584"
		[/random]
		[random]
			value="21769"
		[/random]
		[random]
			value="8685"
		[/random]
		[random]
			value="20819"
		[/random]
		[random]
			value="15968"
		[/random]
		[random]
			value="3373"
		[/random]
		[random]
			value="2007"
		[/random]
		[random]
			value="10202"
			[results]
				checksum="4zf1OSw,C7F>rbJjCs8AZ92.m<LzFBEHnuR73QRpoMa2r4.k-cpOaw87,.Y8Z.5ndaB-kwWvSlbAfbufC3iaj7hobd->Zhetk<>2fa5>ai01-b1+6Z+40CN5c8b.>X,4"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="5"
			x="16"
			y="4"
		[/recruit]
		[random]
			value="18245"
		[/random]
		[random]
			value="30440"
		[/random]
		[random]
			value="8568"
		[/random]
		[random]
			value="27214"
		[/random]
		[random]
			value="5994"
		[/random]
		[random]
			value="5551"
		[/random]
		[random]
			value="29890"
		[/random]
		[random]
			value="18907"
		[/random]
		[random]
			value="13256"
		[/random]
		[random]
			value="14790"
		[/random]
		[random]
			value="7726"
		[/random]
		[random]
			value="2239"
		[/random]
		[random]
			value="20703"
		[/random]
		[random]
			value="13178"
		[/random]
		[random]
			value="9065"
			[results]
				checksum="hfk10b5br.lQp.+wk<Ab-239eel1N5llg71o3Xl17<1,5g7Z-k6kZlaGnZ68p4>gn6n3e1iafnb5+9es4>73a+>+.57mc,6d1edjnNmi-f,a8gbj.r.awWGe+,PQ3hpR"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Johannes has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="solange has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="9,8,7,6,6,6"
			y="17,16,17,16,15,14"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Varas has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="10,9,8,7,6"
			y="20,20,19,20,19"
		[/move]
	[/command]
	[command]
		[move]
			x="13,12,11,11,11,10,9"
			y="21,20,20,19,18,17,17"
		[/move]
	[/command]
	[command]
		[move]
			x="22,23,24,24,24,25"
			y="19,20,19,18,17,17"
		[/move]
	[/command]
	[command]
		[recruit]
			value="4"
			x="15"
			y="22"
		[/recruit]
		[random]
			value="15429"
		[/random]
		[random]
			value="9459"
		[/random]
		[random]
			value="11586"
		[/random]
		[random]
			value="3581"
		[/random]
		[random]
			value="31942"
		[/random]
		[random]
			value="17320"
		[/random]
		[random]
			value="8894"
		[/random]
		[random]
			value="25086"
		[/random]
		[random]
			value="26537"
		[/random]
		[random]
			value="16788"
		[/random]
		[random]
			value="4989"
		[/random]
		[random]
			value="23928"
		[/random]
		[random]
			value="25678"
		[/random]
		[random]
			value="30118"
		[/random]
		[random]
			value="4992"
			[results]
				checksum="4zf1OSv,C7F>rbJjGs8AZ92.m<LzFBEHnuR73QRpoMa2r4.k-cpOaw87,.Y8Z.5ndaB-kwWvSlbAfbufC3iaj7hobd->Zhepk<>2fa5>ai01-b1+6Z+40CN5c8b.>X,4"
			[/results]
		[/random]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="16,15,14,13"
			y="9,9,9,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="14,14,13,12,11,10,9"
			y="8,7,7,6,6,6,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="f has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="21,21,21,22,23,24"
			y="9,8,7,6,7,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="20,20,21,21,21"
			y="5,6,7,8,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,16,16,15,15,14"
			y="5,5,6,7,8,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="16,16,16,16,16,16"
			y="4,5,6,7,8,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,15,15,16,17"
			y="2,3,4,4,5"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Gore has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="6,6,5"
			y="14,13,13"
		[/move]
	[/command]
	[command]
		[move]
			x="5,4,3,3,3"
			y="13,12,12,11,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="gracz has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="9,8,7,6,6,6"
			y="17,16,17,16,15,14"
		[/move]
	[/command]
	[command]
		[move]
			x="6,7,8,9,9,9"
			y="19,19,19,19,18,17"
		[/move]
	[/command]
	[command]
		[move]
			x="15,16,17,18,19,20,21"
			y="22,21,21,20,21,20,20"
		[/move]
	[/command]
	[command]
		[move]
			x="25,26,27,27,26"
			y="17,16,16,15,14"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="A_monkey has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Angel has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="26,26,26"
			y="14,13,12"
		[/move]
	[/command]
	[command]
		[recruit]
			value="4"
			x="13"
			y="21"
		[/recruit]
		[random]
			value="390"
		[/random]
		[random]
			value="11248"
		[/random]
		[random]
			value="9120"
		[/random]
		[random]
			value="6709"
		[/random]
		[random]
			value="5683"
		[/random]
		[random]
			value="22771"
		[/random]
		[random]
			value="10934"
		[/random]
		[random]
			value="27862"
		[/random]
		[random]
			value="12268"
		[/random]
		[random]
			value="31541"
		[/random]
		[random]
			value="2286"
		[/random]
		[random]
			value="18808"
		[/random]
		[random]
			value="24936"
		[/random]
		[random]
			value="2270"
		[/random]
		[random]
			value="4315"
			[results]
				checksum="4zf1OSw,C7F>rbJjIs8AZ92.m<KzFBEHnuR73QRpoMa2r4.k-cpOaw87,.Y8Z.5ndaB-kwWvSlbAfbufC3iaj7hobd->Zhenk<>2fa5>ai01-b1+6Z+40CN5c8b.>X,4"
			[/results]
		[/random]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Zeaux has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="9,8"
			y="6,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="killer89 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,7,6,6,5,5"
			y="6,6,6,7,8,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="24,24,24"
			y="6,7,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="24,24,24"
			y="8,9,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="21,21,21,21,22"
			y="9,10,11,12,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="PsychoticKittens has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="13,12"
			y="10,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="12,11,10,10,10,9,8"
			y="10,10,9,8,7,7,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,16,15,15,15"
			y="5,4,4,3,2"
		[/move]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="1"
			x="17"
			y="5"
		[/recruit]
		[random]
			value="5267"
		[/random]
		[random]
			value="14450"
		[/random]
		[random]
			value="14429"
		[/random]
		[random]
			value="2937"
		[/random]
		[random]
			value="6465"
		[/random]
		[random]
			value="7045"
		[/random]
		[random]
			value="3855"
		[/random]
		[random]
			value="3548"
		[/random]
		[random]
			value="27623"
		[/random]
		[random]
			value="20064"
		[/random]
		[random]
			value="19802"
		[/random]
		[random]
			value="18607"
		[/random]
		[random]
			value="27539"
		[/random]
		[random]
			value="2856"
		[/random]
		[random]
			value="32471"
			[results]
				checksum="KFLvyin74-,ApeaEvE02ik,1f-H<ltHpHl.4.Zv+KOuxJJEBpQwGOLzIDBBrtvLGpNIMjJxOsDGJKEAIFmsFKnyPOyou3tJHxVzEnyVqOuyLwrBF>8AJxGsqutBis5-V"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="16,17,18,19"
			y="9,10,9,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="14,15"
			y="8,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="19,19"
			y="10,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="3,3,3,4,4,5,5"
			y="10,11,12,12,13,14,15"
		[/move]
	[/command]
	[command]
		[move]
			x="21,22,23,24,24,24,25"
			y="20,19,20,19,18,17,17"
		[/move]
	[/command]
	[command]
		[move]
			x="26,26,27,27,27,26,25,24"
			y="12,13,14,15,16,16,17,17"
		[/move]
	[/command]
	[command]
		[move]
			x="13,13,14,15,15,15"
			y="21,20,19,19,18,17"
		[/move]
	[/command]
	[command]
		[recruit]
			value="1"
			x="13"
			y="21"
		[/recruit]
		[random]
			value="30978"
		[/random]
		[random]
			value="2617"
		[/random]
		[random]
			value="6223"
		[/random]
		[random]
			value="29771"
		[/random]
		[random]
			value="11091"
		[/random]
		[random]
			value="19507"
		[/random]
		[random]
			value="25303"
		[/random]
		[random]
			value="4494"
		[/random]
		[random]
			value="21045"
		[/random]
		[random]
			value="31693"
		[/random]
		[random]
			value="1679"
		[/random]
		[random]
			value="12571"
		[/random]
		[random]
			value="27822"
		[/random]
		[random]
			value="30019"
		[/random]
		[random]
			value="8909"
			[results]
				checksum="KzLvyin74-,BpeaEvE02ik,1f-H<ltHpHl.4.Zv+KOuxJJEBpQwGOLzIDBBrtvLGpNIMjJxOsDGJKEAIFmsFKnyPOypu3tJHxVzEnyVqOuyLwrBF>8AJxGsqutBjv5-V"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="16,16,17,18,19"
			y="17,18,19,18,19"
		[/move]
	[/command]
	[command]
		[move]
			x="15,16"
			y="17,17"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="M22av has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="5,6,7,7,6"
			y="9,8,9,10,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="8,7,6,6,5,5"
			y="6,6,6,7,8,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,17,18,19,19,19"
			y="5,6,6,7,8,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="19,18"
			y="11,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="18,17,16,15,14"
			y="11,11,10,11,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Lord_MM has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="24,24,25,26"
			y="10,11,12,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="22,23,24,25"
			y="12,12,12,13"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,14,13"
			y="9,9,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="russell has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="9,9"
			y="17,16"
		[/move]
	[/command]
	[command]
		[move]
			x="9,9,9,8,7"
			y="16,15,14,13,14"
		[/move]
	[/command]
	[command]
		[move]
			x="6,6,5,5,6"
			y="14,13,13,12,11"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="6"
				y="11"
			[/source]
			[destination]
				x="6"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="17404"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="23080"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="8866"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="231"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="29930"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="2717"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="22980"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="5,5,5,5,5"
			y="15,14,13,12,11"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="5"
				y="11"
			[/source]
			[destination]
				x="6"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="9812"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="32735"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="527"
			[results]
				chance="70"
				damage="9"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="13,13,12,11,11,11"
			y="21,20,19,19,18,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Duke has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Gally has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="25,26,27,27,26,26"
			y="17,16,16,15,14,13"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="26"
				y="13"
			[/source]
			[destination]
				x="26"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="12428"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="18761"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="3729"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="18859"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="2874"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="29415"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Pogingplayer has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="24,25,26,27,27,26"
			y="17,17,16,16,15,14"
		[/move]
	[/command]
	[command]
		[move]
			x="19,20"
			y="19,18"
		[/move]
	[/command]
	[command]
		[move]
			x="20,21,22,23,24,24,25,25,26"
			y="18,19,19,20,19,18,18,17,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="d has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="16,17,18,19"
			y="17,17,16,16"
		[/move]
	[/command]
	[command]
		[move]
			x="19,20"
			y="16,15"
		[/move]
	[/command]
	[command]
		[recruit]
			value="2"
			x="13"
			y="21"
		[/recruit]
		[random]
			value="30070"
		[/random]
		[random]
			value="8325"
		[/random]
		[random]
			value="28494"
		[/random]
		[random]
			value="27395"
		[/random]
		[random]
			value="30693"
		[/random]
		[random]
			value="26801"
		[/random]
		[random]
			value="18852"
		[/random]
		[random]
			value="24501"
		[/random]
		[random]
			value="14840"
		[/random]
		[random]
			value="16440"
		[/random]
		[random]
			value="28432"
		[/random]
		[random]
			value="23476"
		[/random]
		[random]
			value="12404"
		[/random]
		[random]
			value="3998"
		[/random]
		[random]
			value="4498"
			[results]
				checksum="dyxuTOIUoJO8HNrG4rKqKKyCcwwqoNtRxBzMHwQmPyQBpPAuOCIG6zNHsCQFqzuGzwKqqyuyKqpO5RBJTuEm3frBwnBwBICTrpKGHCIsunwtfyIWc-MGO<7LH5>c-208"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Terrorist has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="25"
				y="13"
			[/source]
			[destination]
				x="26"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="22006"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="21623"
			[results]
				chance="40"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="28236"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="32351"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="7703"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="22610"
			[results]
				chance="60"
				damage="5"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="5,6,7,7,6"
			y="9,8,9,10,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="6"
				y="10"
			[/source]
			[destination]
				x="6"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="16034"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="21937"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="7149"
			[results]
				chance="60"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="7704"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="959"
			[results]
				chance="60"
				damage="6"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="13,14,14"
			y="10,10,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="14,14,13"
			y="10,11,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="19,19"
			y="9,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="19,18,18"
			y="10,10,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="1"
			x="17"
			y="5"
		[/recruit]
		[random]
			value="29361"
		[/random]
		[random]
			value="13793"
		[/random]
		[random]
			value="29736"
		[/random]
		[random]
			value="2433"
		[/random]
		[random]
			value="25053"
		[/random]
		[random]
			value="13505"
		[/random]
		[random]
			value="30874"
		[/random]
		[random]
			value="17971"
		[/random]
		[random]
			value="26092"
		[/random]
		[random]
			value="12647"
		[/random]
		[random]
			value="17010"
		[/random]
		[random]
			value="6792"
		[/random]
		[random]
			value="32658"
		[/random]
		[random]
			value="7108"
		[/random]
		[random]
			value="27568"
			[results]
				checksum="KFLvyin74-,xpeaEvE02ik,1f-H<ltHpHl.4.Zv+KOuxJJEBpQwGOLzIDBBrtvLGpNIMjJxOsDGJKEAIFmsFKnyPOyBu3tJHxVzEnyVqOuyLwrBF>8AJxGsqutBjv5-V"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="commrad1 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="5"
				y="11"
			[/source]
			[destination]
				x="6"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="11282"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="32608"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="2034"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="18873"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2336"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="14119"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="7,6,5,5,6"
			y="14,13,13,12,11"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="6"
				y="11"
			[/source]
			[destination]
				x="6"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="3397"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="17408"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="176"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="3565"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="10875"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="7535"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="20,21,21,21,22,23,24"
			y="15,15,14,13,12,12,12"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="24"
				y="12"
			[/source]
			[destination]
				x="25"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="8168"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="29082"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="31757"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="28942"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="23602"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Yawner has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="26,27,27,26,25"
			y="16,16,15,14,14"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="25"
				y="14"
			[/source]
			[destination]
				x="25"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="26840"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="22148"
			[results]
				chance="70"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="18854"
			[results]
				chance="60"
				damage="4"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Gally2 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="26,26"
			y="14,13"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="26"
				y="13"
			[/source]
			[destination]
				x="26"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="5899"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2982"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="26610"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="22054"
			[results]
				chance="60"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="11764"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="31803"
			[results]
				chance="60"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="6531"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="13,14,15,16,16"
			y="21,20,20,19,18"
		[/move]
	[/command]
	[command]
		[move]
			x="16,16"
			y="18,17"
		[/move]
	[/command]
	[command]
		[move]
			x="11,10,9"
			y="17,17,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="tomy has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="15,15,15,15,15,16"
			y="24,23,22,21,20,19"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Souleater has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,17,18,19,19,19"
			y="5,6,6,7,8,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="18,18,19,20,20,20"
			y="11,12,13,13,14,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="14,14,14,15,16,16,16"
			y="11,12,13,14,14,15,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="16"
				y="16"
			[/source]
			[destination]
				x="16"
				y="17"
			[/destination]
		[/attack]
		[random]
			value="7437"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="15859"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="3666"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="11916"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="24026"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="7270"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="13,13,13,13,13,14"
			y="12,13,14,15,16,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="26"
				y="12"
			[/source]
			[destination]
				x="26"
				y="13"
			[/destination]
		[/attack]
		[random]
			value="26"
			[results]
				chance="60"
				damage="9"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="6"
				y="10"
			[/source]
			[destination]
				x="5"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="16026"
			[results]
				chance="60"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="25402"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="23851"
			[results]
				chance="60"
				damage="8"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="4"
			x="17"
			y="5"
		[/recruit]
		[random]
			value="1730"
		[/random]
		[random]
			value="2843"
		[/random]
		[random]
			value="27422"
		[/random]
		[random]
			value="32731"
		[/random]
		[random]
			value="28550"
		[/random]
		[random]
			value="29268"
		[/random]
		[random]
			value="8745"
		[/random]
		[random]
			value="8408"
		[/random]
		[random]
			value="5492"
		[/random]
		[random]
			value="21526"
		[/random]
		[random]
			value="14208"
		[/random]
		[random]
			value="4417"
		[/random]
		[random]
			value="4652"
		[/random]
		[random]
			value="22100"
		[/random]
		[random]
			value="8406"
			[results]
				checksum="3Cf1OSv,C7F>rbJjHs8AZ92.m<KzFBEHnuR73QRpoMa2r4.k-cpOaw87,.Y8Z.5ndaB-kwWvSlbAfbufC3iaj7hobd->Zheok<>2fa5>ai01-b1+6Z+40CN5c8b.>X,4"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="ME4 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="24,25"
			y="12,13"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="25"
				y="13"
			[/source]
			[destination]
				x="26"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="25566"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="30859"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="31371"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="6243"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="26500"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="916"
			[results]
				chance="40"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="25,26"
			y="14,13"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="26"
				y="13"
			[/source]
			[destination]
				x="26"
				y="12"
			[/destination]
		[/attack]
		[random]
			value="20237"
			[results]
				chance="60"
				damage="6"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="ayumi has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="6,5,4,3,3,4,5"
			y="11,12,11,11,10,9,9"
		[/move]
	[/command]
	[command]
		[move]
			x="16,16"
			y="17,18"
		[/move]
	[/command]
	[command]
		[move]
			x="16,16"
			y="18,17"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="16"
				y="17"
			[/source]
			[destination]
				x="16"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="26358"
			[results]
				chance="60"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="2834"
			[results]
				chance="60"
				damage="2"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="9507"
			[results]
				chance="60"
				damage="10"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="9,10,11,12,13"
			y="17,16,17,16,17"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="13"
				y="17"
			[/source]
			[destination]
				x="14"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="18361"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="3835"
			[results]
				chance="70"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="7650"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="13405"
			[results]
				chance="70"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="5066"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1943"
			[results]
				chance="70"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="17893"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="3593"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="16,15,15,15,15,15"
			y="19,20,21,22,23,24"
		[/move]
	[/command]
	[command]
		[recruit]
			value="4"
			x="13"
			y="21"
		[/recruit]
		[random]
			value="4599"
		[/random]
		[random]
			value="7508"
		[/random]
		[random]
			value="5508"
		[/random]
		[random]
			value="10190"
		[/random]
		[random]
			value="25420"
		[/random]
		[random]
			value="28910"
		[/random]
		[random]
			value="551"
		[/random]
		[random]
			value="28886"
		[/random]
		[random]
			value="2983"
		[/random]
		[random]
			value="23750"
		[/random]
		[random]
			value="16935"
		[/random]
		[random]
			value="3960"
		[/random]
		[random]
			value="22549"
		[/random]
		[random]
			value="12736"
		[/random]
		[random]
			value="31403"
			[results]
				checksum="3Cf1OSv,C7F>rbJjRs8AZ92.m<LzFBEHnuR73QRpoMa2r4.k-cpOaw87,.Y8Z.5ndaB-kwWvSlbAfbufC3iaj7hobd->Zheuk<>2fa5>ai01-b1+6Z+40CN5c8b.>X,4"
			[/results]
		[/random]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Warfall has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Codazzo has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,18,19,19,19,20,21"
			y="5,5,6,7,8,8,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="19,20,21,22"
			y="9,9,9,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="20,19,18,17"
			y="15,16,16,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="1"
			[source]
				x="17"
				y="17"
			[/source]
			[destination]
				x="16"
				y="17"
			[/destination]
		[/attack]
		[random]
			value="15569"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="10311"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="577"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="22772"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2284"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="16115"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="7022"
			[results]
				chance="60"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Dharokan has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="14,15"
			y="16,17"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="15"
				y="17"
			[/source]
			[destination]
				x="16"
				y="17"
			[/destination]
		[/attack]
		[random]
			value="16038"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="7698"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="26154"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1851"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="24761"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="30048"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="7927"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="6,7,7,7,6,6,7,8"
			y="10,10,9,8,7,6,6,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="John has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="4"
			x="15"
			y="4"
		[/recruit]
		[random]
			value="27327"
		[/random]
		[random]
			value="29917"
		[/random]
		[random]
			value="13617"
		[/random]
		[random]
			value="12828"
		[/random]
		[random]
			value="13270"
		[/random]
		[random]
			value="28326"
		[/random]
		[random]
			value="16878"
		[/random]
		[random]
			value="12765"
		[/random]
		[random]
			value="1516"
		[/random]
		[random]
			value="15002"
		[/random]
		[random]
			value="29870"
		[/random]
		[random]
			value="15878"
		[/random]
		[random]
			value="15222"
		[/random]
		[random]
			value="13867"
		[/random]
		[random]
			value="11949"
			[results]
				checksum="3Cf1OSv,C7F>rbJjRs8AZ92.m<LzFBEHnuR73QRpoMa2r4.k-cpOaw87,.Y8Z.5ndaB-kwWvSlbAfbufC3iaj7hobd->Zheuk<>2fa5>ai01-b1+6Z+40CN5c8b.>X,4"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="16,16"
			y="17,18"
		[/move]
	[/command]
	[command]
		[move]
			x="13,14,14,15,16,16"
			y="21,20,19,19,18,17"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="16"
				y="17"
			[/source]
			[destination]
				x="17"
				y="17"
			[/destination]
		[/attack]
		[random]
			value="5320"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="4790"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="26461"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Noobkillerr has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="13,13,14,15,16,17"
			y="17,16,15,15,15,16"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="17"
				y="16"
			[/source]
			[destination]
				x="17"
				y="17"
			[/destination]
		[/attack]
		[random]
			value="30427"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="26605"
			[results]
				chance="60"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="22374"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="21656"
			[results]
				chance="60"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="32541"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="19054"
			[results]
				chance="60"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="13386"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="19961"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[recruit]
			value="4"
			x="13"
			y="21"
		[/recruit]
		[random]
			value="4455"
		[/random]
		[random]
			value="17545"
		[/random]
		[random]
			value="28275"
		[/random]
		[random]
			value="29682"
		[/random]
		[random]
			value="12851"
		[/random]
		[random]
			value="16869"
		[/random]
		[random]
			value="20316"
		[/random]
		[random]
			value="23937"
		[/random]
		[random]
			value="2794"
		[/random]
		[random]
			value="18647"
		[/random]
		[random]
			value="4996"
		[/random]
		[random]
			value="24912"
		[/random]
		[random]
			value="31976"
		[/random]
		[random]
			value="12247"
		[/random]
		[random]
			value="2003"
			[results]
				checksum="4zf1OSw,C7F>rbJjCs8AZ92.m<LzFBEHnuR73QRpoMa2r4.k-cpOaw87,.Y8Z.5ndaB-kwWvSlbAfbufC3iaj7hobd->Zhetk<>2fa5>ai01-b1+6Z+40CN5c8b.>X,4"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="16,17,18,19,19,19"
			y="18,19,19,20,21,22"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="KarmaSpender has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="25,26,27,27,27,26,25"
			y="13,13,14,15,16,16,17"
		[/move]
	[/command]
	[command]
		[move]
			x="26,26,27,27,26,25,25,24,24,23"
			y="13,14,15,16,16,17,18,18,19,20"
		[/move]
	[/command]
	[command]
		[move]
			x="5,5,6,6,7"
			y="9,8,7,6,6"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="7"
				y="6"
			[/source]
			[destination]
				x="8"
				y="6"
			[/destination]
		[/attack]
		[random]
			value="12703"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="12822"
			[results]
				chance="70"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1536"
			[results]
				chance="70"
				damage="9"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="15,15,15,14"
			y="24,23,22,21"
		[/move]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,14"
			y="4,4"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="14,13,12,11"
			y="4,4,4,4"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="maty has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,14,13,12,11"
			y="2,2,3,3,3"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="rcx has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="22,23,24,24"
			y="9,9,9,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Wupper has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="21,22,23,24,24,25"
			y="9,9,9,9,10,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,16,17,18,18"
			y="17,16,17,16,15"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="18"
				y="15"
			[/source]
			[destination]
				x="17"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="8962"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="15505"
			[results]
				chance="40"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="32400"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="32620"
			[results]
				chance="40"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="30323"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="30336"
			[results]
				chance="40"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="18289"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="25984"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,18"
			y="17,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="18"
				y="16"
			[/source]
			[destination]
				x="17"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="29997"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="19789"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="11324"
			[results]
				chance="60"
				damage="9"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Lord has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="shadowofzo has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="13,14,14,15,16,16,17"
			y="21,20,19,19,18,17,17"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="17"
				y="17"
			[/source]
			[destination]
				x="18"
				y="16"
			[/destination]
		[/attack]
		[random]
			value="20969"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="9584"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1229"
			[results]
				chance="70"
				damage="7"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="23,22,21,20,20,19,19"
			y="20,19,19,18,17,17,16"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="19"
				y="16"
			[/source]
			[destination]
				x="18"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="28153"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="24193"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="13474"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="31686"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="18357"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="ILikeMike has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="16,16,17"
			y="17,16,16"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="17"
				y="16"
			[/source]
			[destination]
				x="18"
				y="15"
			[/destination]
		[/attack]
		[random]
			value="4285"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="3189"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2578"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="14175"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="5046"
			[results]
				chance="70"
				damage="6"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="7,6,6,5,5"
			y="6,6,7,8,9"
		[/move]
	[/command]
	[command]
		[move]
			x="14,15,15,15"
			y="21,22,23,24"
		[/move]
	[/command]
	[command]
		[move]
			x="19,19,19,18,17,16,16"
			y="22,21,20,19,19,18,17"
		[/move]
	[/command]
	[command]
		[recruit]
			value="4"
			x="15"
			y="22"
		[/recruit]
		[random]
			value="23497"
		[/random]
		[random]
			value="3142"
		[/random]
		[random]
			value="25649"
		[/random]
		[random]
			value="26364"
		[/random]
		[random]
			value="10987"
		[/random]
		[random]
			value="30298"
		[/random]
		[random]
			value="6601"
		[/random]
		[random]
			value="31738"
		[/random]
		[random]
			value="5856"
		[/random]
		[random]
			value="19699"
		[/random]
		[random]
			value="29914"
		[/random]
		[random]
			value="17264"
		[/random]
		[random]
			value="22203"
		[/random]
		[random]
			value="27107"
		[/random]
		[random]
			value="10942"
			[results]
				checksum="3Cf1OSw,C7F>rbJjDs8AZ92.m<KzFBEHnuR73QRpoMa2r4.k-cpOaw87,.Y8Z.5ndaB-kwWvSlbAfbufC3iaj7hobd->Zhesk<>2fa5>ai01-b1+6Z+40CN5c8b.>X,4"
			[/results]
		[/random]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="25,24,24,23,22"
			y="11,10,9,9,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="domi has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="22,23,24"
			y="9,9,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="24,24,23,22,21"
			y="10,9,9,9,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,12,13,14,15"
			y="3,3,3,2,2"
		[/move]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="5"
			x="17"
			y="5"
		[/recruit]
		[random]
			value="9495"
		[/random]
		[random]
			value="14029"
		[/random]
		[random]
			value="1072"
		[/random]
		[random]
			value="4007"
		[/random]
		[random]
			value="24784"
		[/random]
		[random]
			value="26460"
		[/random]
		[random]
			value="10127"
		[/random]
		[random]
			value="26012"
		[/random]
		[random]
			value="244"
		[/random]
		[random]
			value="31263"
		[/random]
		[random]
			value="2551"
		[/random]
		[random]
			value="4503"
		[/random]
		[random]
			value="6580"
		[/random]
		[random]
			value="5909"
		[/random]
		[random]
			value="17845"
			[results]
				checksum="dfk10b5br.kQp.+wk<Ab-239eel1N5llg71o3Xl17<1,5g7Z-k6kZlaGnZ68p4>gn6n3e1iafnb5+9fo4>73a+>+.57mc,6d1edjnNmi-f,a8gbj.r.awWGe+,PQ3hpQ"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="scruppy has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="RED88 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="15,14,14,14,14,14,14,14"
			y="22,21,20,19,18,17,16,15"
		[/move]
	[/command]
	[command]
		[move]
			x="19,18,18"
			y="16,15,14"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="jzmer-obs has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="17,16,16,16,16,16,15"
			y="17,16,15,14,13,12,12"
		[/move]
	[/command]
	[command]
		[move]
			x="16,16,16,16,16,16,16,15"
			y="17,16,15,14,13,12,11,11"
		[/move]
	[/command]
	[command]
		[move]
			x="17,16,16,16,16"
			y="16,15,14,13,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="nipnop has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="18,17,17,17,16"
			y="14,14,13,12,11"
		[/move]
	[/command]
	[command]
		[move]
			x="16,17"
			y="11,12"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="JayEpstein has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="17,17"
			y="12,13"
		[/move]
	[/command]
	[command]
		[move]
			x="16,15"
			y="12,13"
		[/move]
	[/command]
	[command]
		[move]
			x="25,26,27,27"
			y="17,16,16,15"
		[/move]
	[/command]
	[command]
		[recruit]
			value="1"
			x="13"
			y="21"
		[/recruit]
		[random]
			value="21013"
		[/random]
		[random]
			value="552"
		[/random]
		[random]
			value="28890"
		[/random]
		[random]
			value="3123"
		[/random]
		[random]
			value="5964"
		[/random]
		[random]
			value="25666"
		[/random]
		[random]
			value="24978"
		[/random]
		[random]
			value="28730"
		[/random]
		[random]
			value="22253"
		[/random]
		[random]
			value="14209"
		[/random]
		[random]
			value="12717"
		[/random]
		[random]
			value="8610"
		[/random]
		[random]
			value="24512"
		[/random]
		[random]
			value="16160"
		[/random]
		[random]
			value="18632"
			[results]
				checksum="KFLvyin74-,ApeaEvE02ik,1f-H<ltHpHl.4.Zv+KOuxJJEBpQwGOLzIDBBrtvLGpNIMjJxOsDGJKEAIFmsFKnyPOyou3tJHxVzEnyVqOuyLwrBF>8AJxGsqutBis5-V"
			[/results]
		[/random]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Nath has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="emmanuel has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="HotHead has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="kolz has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="24,24,24"
			y="8,7,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,17,16,15,15,14,14,14"
			y="5,6,6,7,8,8,9,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="14"
				y="10"
			[/source]
			[destination]
				x="15"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="3499"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="27985"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="24833"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="13398"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="7165"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="24872"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1482"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="21,20,19,18,17,16"
			y="9,9,10,10,10,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="1"
			[source]
				x="16"
				y="10"
			[/source]
			[destination]
				x="15"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="7592"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="8175"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="8956"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="20675"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="24130"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="24240"
			[results]
				chance="70"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="18235"
			[results]
				chance="70"
				damage="6"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="11,12,13,14,14,15"
			y="4,4,5,5,6,7"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="24,23,22,21,21,21"
			y="6,7,6,7,8,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="TUR has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="5"
			x="17"
			y="5"
		[/recruit]
		[random]
			value="13820"
		[/random]
		[random]
			value="5140"
		[/random]
		[random]
			value="19301"
		[/random]
		[random]
			value="12310"
		[/random]
		[random]
			value="9157"
		[/random]
		[random]
			value="24163"
		[/random]
		[random]
			value="15545"
		[/random]
		[random]
			value="18835"
		[/random]
		[random]
			value="29734"
		[/random]
		[random]
			value="26363"
		[/random]
		[random]
			value="17666"
		[/random]
		[random]
			value="7370"
		[/random]
		[random]
			value="16268"
		[/random]
		[random]
			value="6627"
		[/random]
		[random]
			value="16437"
			[results]
				checksum="efk10b5br.lQp.+wk<Ab-239eel1N5llg71o3Xl17<1,5g7Z-k6kZlaGnZ68p4>gn6n3e1iafnb5+9er4>73a+>+.57mc,6d1edjnNmi-f,a8gbj+B.awWJe+,PQ3hpR"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="subLime has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="A_Guy has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="13,13,13,13,13,13"
			y="21,20,19,18,17,16"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Dreibl has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="14,15,16,16,16,16"
			y="15,15,14,13,12,11"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="16"
				y="11"
			[/source]
			[destination]
				x="16"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="32061"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="8815"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="13582"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="15,16,17,17"
			y="12,12,12,11"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="17"
				y="11"
			[/source]
			[destination]
				x="16"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="25967"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="25633"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="21223"
			[results]
				chance="70"
				damage="9"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[choose]
			value="0"
		[/choose]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Ferro95 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="15,15,15"
			y="13,12,11"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="15"
				y="11"
			[/source]
			[destination]
				x="14"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="22996"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="19129"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="21583"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="21680"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="9806"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="17,16,15,14"
			y="13,12,12,11"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="14"
				y="11"
			[/source]
			[destination]
				x="14"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="5460"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="26247"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="27336"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="5421"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="21619"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="osf has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="5,5,6,6,7"
			y="9,8,7,6,6"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Clik has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="27,27,26,26,25,25,24"
			y="15,14,13,12,12,11,10"
		[/move]
	[/command]
	[command]
		[recruit]
			value="2"
			x="13"
			y="21"
		[/recruit]
		[random]
			value="5546"
		[/random]
		[random]
			value="1174"
		[/random]
		[random]
			value="20159"
		[/random]
		[random]
			value="7403"
		[/random]
		[random]
			value="6175"
		[/random]
		[random]
			value="29252"
		[/random]
		[random]
			value="18885"
		[/random]
		[random]
			value="30184"
		[/random]
		[random]
			value="27712"
		[/random]
		[random]
			value="8419"
		[/random]
		[random]
			value="25638"
		[/random]
		[random]
			value="15948"
		[/random]
		[random]
			value="11710"
		[/random]
		[random]
			value="26795"
		[/random]
		[random]
			value="21321"
			[results]
				checksum="dyxuTOJUoJO8HNrG4rKqKKyCcwwqoNtRxBzMHwQmPyQBpPAuOCIG6zNHsCQFqzuGzwKqqyuyKqqQ5RBJTuEm3frBwnBwBICTrpKGHCIsunwtfvIWc<MGO<7LH5>f.208"
			[/results]
		[/random]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="14,14,14"
			y="10,9,8"
		[/move]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,15,14,14,14"
			y="7,8,8,9,10"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="14"
				y="10"
			[/source]
			[destination]
				x="14"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="20293"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="5463"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="8257"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="25432"
			[results]
				chance="40"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="10415"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="10253"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="14,14,14,13"
			y="8,9,10,11"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="13"
				y="11"
			[/source]
			[destination]
				x="14"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="25079"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="17855"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="27392"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="5442"
			[results]
				chance="60"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="23993"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="27696"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="sentry has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,17,16,16,16,16"
			y="5,6,6,7,8,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="1"
			x="17"
			y="5"
		[/recruit]
		[random]
			value="6109"
		[/random]
		[random]
			value="3891"
		[/random]
		[random]
			value="22001"
		[/random]
		[random]
			value="16929"
		[/random]
		[random]
			value="10308"
		[/random]
		[random]
			value="29176"
		[/random]
		[random]
			value="27640"
		[/random]
		[random]
			value="22100"
		[/random]
		[random]
			value="13591"
		[/random]
		[random]
			value="2675"
		[/random]
		[random]
			value="5089"
		[/random]
		[random]
			value="32706"
		[/random]
		[random]
			value="30092"
		[/random]
		[random]
			value="12824"
		[/random]
		[random]
			value="1063"
			[results]
				checksum="KFLvyin74-,xpeaEvE02ik,1f-H<ltHpHl.4.Zv+KOuxJJEBpQwGOLzIDBBrtvLGpNIMjJxOsDGJKEAIFmsFKnyPOyBu3tJHxVzEnyVqOuyLwrBF>8AJxGsqutBjv5-V"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="21,22,23,24"
			y="9,9,9,9"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="24"
				y="9"
			[/source]
			[destination]
				x="24"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="13151"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="15414"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="14134"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="6011"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="883"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="12703"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="nbr has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Xe has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="14,15,16,17,18,19,20,21,22,23"
			y="11,12,12,12,11,11,10,10,9,9"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="23"
				y="9"
			[/source]
			[destination]
				x="24"
				y="9"
			[/destination]
		[/attack]
		[random]
			value="30456"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="24103"
			[results]
				chance="70"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="25460"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="11505"
			[results]
				chance="70"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="24"
				y="10"
			[/source]
			[destination]
				x="24"
				y="9"
			[/destination]
		[/attack]
		[random]
			value="22095"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="17136"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="13044"
			[results]
				chance="70"
				damage="6"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="13,13,13,13,14,14"
			y="16,15,14,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="23897"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="10133"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="4838"
			[results]
				chance="40"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="14103"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="2946"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="12536"
			[results]
				chance="40"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="17,18,18,18,18,18,18"
			y="11,10,9,8,7,6,5"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="18"
				y="5"
			[/source]
			[destination]
				x="17"
				y="5"
			[/destination]
		[/attack]
		[random]
			value="28788"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2982"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1045"
			[results]
				chance="70"
				damage="12"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="15,15,14,13"
			y="11,12,12,12"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="13"
				y="12"
			[/source]
			[destination]
				x="13"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="25469"
			[results]
				chance="70"
				damage="6"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="16,17,18,18,18,18,18,17"
			y="11,11,10,9,8,7,6,6"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="17"
				y="6"
			[/source]
			[destination]
				x="17"
				y="5"
			[/destination]
		[/attack]
		[random]
			value="15050"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="30370"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="15199"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Lastmerlin has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="7,8,9,10,11"
			y="6,5,5,4,4"
		[/move]
	[/command]
	[command]
		[move]
			x="13,13,13,13,13,13,13"
			y="21,20,19,18,17,16,15"
		[/move]
	[/command]
	[command]
		[recruit]
			value="4"
			x="13"
			y="21"
		[/recruit]
		[random]
			value="24670"
		[/random]
		[random]
			value="12626"
		[/random]
		[random]
			value="32651"
		[/random]
		[random]
			value="3283"
		[/random]
		[random]
			value="2967"
		[/random]
		[random]
			value="12322"
		[/random]
		[random]
			value="25068"
		[/random]
		[random]
			value="10371"
		[/random]
		[random]
			value="21067"
		[/random]
		[random]
			value="26615"
		[/random]
		[random]
			value="2780"
		[/random]
		[random]
			value="24484"
		[/random]
		[random]
			value="11609"
		[/random]
		[random]
			value="4802"
		[/random]
		[random]
			value="7898"
			[results]
				checksum="4zf1OSw,C7F>rbJjCs8AZ92.m<LzFBEHnuR73QRpoMa2r4.k-cpOaw87,.Y8Z.5ndaB-kwWvSlbAfbufC3iaj7hobd->Zhetk<>2fa5>ai01-b1+6Z+40CN5c8b.>X,4"
			[/results]
		[/random]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="17"
				y="5"
			[/source]
			[destination]
				x="18"
				y="5"
			[/destination]
		[/attack]
		[random]
			value="10802"
			[results]
				chance="60"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="4488"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="10671"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="22398"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="5064"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="18739"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1570"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="16,16,16,16,16,17,18"
			y="9,8,7,6,5,5,4"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="18"
				y="4"
			[/source]
			[destination]
				x="18"
				y="5"
			[/destination]
		[/attack]
		[random]
			value="15427"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="6640"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="17892"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="32678"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="14214"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="13015"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="506"
			[results]
				chance="60"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="PlutoPL has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="14"
				y="10"
			[/source]
			[destination]
				x="14"
				y="11"
			[/destination]
		[/attack]
		[random]
			value="15395"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="12684"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="25697"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Bacon has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="13,12,12,12,12,12,13"
			y="15,14,13,12,11,10,10"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="13"
				y="10"
			[/source]
			[destination]
				x="14"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="32487"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="264"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="14744"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="25021"
			[results]
				chance="60"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="1984"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="13,14,15,15"
			y="12,12,12,11"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="15"
				y="11"
			[/source]
			[destination]
				x="14"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="8599"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="18066"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="31166"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="25165"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="10522"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="32564"
			[results]
				chance="70"
				damage="5"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Boggyy has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Valkun has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="14,15,16,16,15"
			y="11,12,11,10,10"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="15"
				y="10"
			[/source]
			[destination]
				x="14"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="32390"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="1291"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="10142"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="24947"
			[results]
				chance="70"
				damage="3"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="17272"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="21074"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="17,16,15,15,14,14"
			y="6,6,7,8,8,9"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="14"
				y="9"
			[/source]
			[destination]
				x="14"
				y="10"
			[/destination]
		[/attack]
		[random]
			value="2762"
			[results]
				chance="70"
				damage="5"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="commrad1 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="18,18,17,16,15,14"
			y="5,6,7,7,8,8"
		[/move]
	[/command]
	[command]
		[move]
			x="11,12,13,14,15,16,17"
			y="4,3,4,3,4,3,4"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="17"
				y="4"
			[/source]
			[destination]
				x="18"
				y="4"
			[/destination]
		[/attack]
		[random]
			value="29779"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="20864"
			[results]
				chance="70"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="27761"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="31011"
			[results]
				chance="70"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="7083"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="30381"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2181"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="24,24,23,22,21"
			y="10,9,9,9,9"
		[/move]
	[/command]
	[command]
		[move]
			x="23,24,24,24"
			y="9,8,7,6"
		[/move]
	[/command]
	[command]
		[move]
			x="13,13,13,13,13,13,13"
			y="21,20,19,18,17,16,15"
		[/move]
	[/command]
	[command]
		[recruit]
			value="4"
			x="13"
			y="21"
		[/recruit]
		[random]
			value="19181"
		[/random]
		[random]
			value="2880"
		[/random]
		[random]
			value="1973"
		[/random]
		[random]
			value="2619"
		[/random]
		[random]
			value="19050"
		[/random]
		[random]
			value="25674"
		[/random]
		[random]
			value="12881"
		[/random]
		[random]
			value="13434"
		[/random]
		[random]
			value="27573"
		[/random]
		[random]
			value="17809"
		[/random]
		[random]
			value="20293"
		[/random]
		[random]
			value="27261"
		[/random]
		[random]
			value="13644"
		[/random]
		[random]
			value="28456"
		[/random]
		[random]
			value="25518"
			[results]
				checksum="3Cf1OSv,C7F>rbJjHs8AZ92.m<KzFBEHnuR73QRpoMa2r4.k-cpOaw87,.Y8Z.5ndaB-kwWvSlbAfbufC3iaj7hobd->Zheok<>2fa5>ai01-b1+6Z+40CN5c8b.>X,4"
			[/results]
		[/random]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,16"
			y="5,4"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="1"
			[source]
				x="16"
				y="4"
			[/source]
			[destination]
				x="17"
				y="4"
			[/destination]
		[/attack]
		[random]
			value="24962"
			[results]
				chance="70"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="21817"
			[results]
				chance="60"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="27272"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="9820"
			[results]
				chance="60"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="9009"
			[results]
				chance="70"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="29875"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="28792"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="18,18,17"
			y="4,3,3"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="0"
			weapon="0"
			[source]
				x="17"
				y="3"
			[/source]
			[destination]
				x="17"
				y="4"
			[/destination]
		[/attack]
		[random]
			value="15747"
			[results]
				chance="70"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="24508"
			[results]
				chance="40"
				damage="11"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="30195"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="2820"
			[results]
				chance="40"
				damage="11"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="16280"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="230"
			[results]
				chance="40"
				damage="11"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,16,17"
			y="2,2,3"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="17"
				y="3"
			[/source]
			[destination]
				x="17"
				y="4"
			[/destination]
		[/attack]
		[random]
			value="6738"
			[results]
				chance="70"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="22093"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="29481"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="14971"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="15722"
			[results]
				chance="70"
				damage="4"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Dracon has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Francis has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Carving2 has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="21,20,19,19,18,18,17"
			y="9,8,8,7,6,5,5"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="-1"
			weapon="1"
			[source]
				x="17"
				y="5"
			[/source]
			[destination]
				x="16"
				y="4"
			[/destination]
		[/attack]
		[random]
			value="1489"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="29548"
			[results]
				chance="70"
				damage="6"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[choose]
			value="0"
		[/choose]
	[/command]
	[command]
		[move]
			x="14,14,15,16,16,16,16"
			y="8,7,7,6,5,4,3"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="16"
				y="3"
			[/source]
			[destination]
				x="17"
				y="3"
			[/destination]
		[/attack]
		[random]
			value="16967"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="25914"
			[results]
				chance="60"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="6911"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="2244"
			[results]
				chance="60"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="4452"
			[results]
				chance="70"
				damage="9"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="17450"
			[results]
				chance="60"
				damage="10"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Raidon has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="DallaireGordievsky has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="24,23,22,21,20"
			y="6,6,6,6,5"
		[/move]
	[/command]
	[command]
		[move]
			x="15,16,16,16,17,17"
			y="10,9,8,7,7,6"
		[/move]
	[/command]
	[command]
		[move]
			x="15,14,14,14"
			y="11,10,9,8"
		[/move]
	[/command]
	[command]
		[move]
			x="14,14,14,15,16,16,16,16"
			y="9,8,7,7,6,5,4,3"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="16"
				y="3"
			[/source]
			[destination]
				x="17"
				y="3"
			[/destination]
		[/attack]
		[random]
			value="26991"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="10228"
			[results]
				chance="60"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="23238"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="24537"
			[results]
				chance="60"
				damage="10"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="32246"
			[results]
				chance="70"
				damage="6"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="18894"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="10540"
			[results]
				chance="60"
				damage="10"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="firo has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="13,13,14,14,14,14,14"
			y="10,9,8,7,6,5,4"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="grimmjow has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="13,13,13,13,13,13,13,13"
			y="21,20,19,18,17,16,15,14"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="oryolalex has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="13,14,14,14,14,14,14"
			y="15,14,13,12,11,10,9"
		[/move]
	[/command]
	[command]
		[recruit]
			value="1"
			x="13"
			y="21"
		[/recruit]
		[random]
			value="24220"
		[/random]
		[random]
			value="28675"
		[/random]
		[random]
			value="151"
		[/random]
		[random]
			value="5680"
		[/random]
		[random]
			value="32348"
		[/random]
		[random]
			value="3618"
		[/random]
		[random]
			value="31841"
		[/random]
		[random]
			value="13733"
		[/random]
		[random]
			value="10180"
		[/random]
		[random]
			value="14807"
		[/random]
		[random]
			value="17342"
		[/random]
		[random]
			value="14677"
		[/random]
		[random]
			value="25498"
		[/random]
		[random]
			value="13532"
		[/random]
		[random]
			value="15700"
			[results]
				checksum="KFLvyin74-,xpeaEvE02ik,1f-H<ltHpHl.4.Zv+KOuxJJEBpQwGOLzIDBBrtvLGpNIMjJxOsDGJKEAIFmsFKnyPOyBu3tJHxVzEnyVqOuyLwrBF>8AJxGsqutBjv5-V"
			[/results]
		[/random]
	[/command]
	[command]
		[countdown_update]
			team="1"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		sent="yes"
		[move]
			x="17,17,16,15"
			y="3,2,1,2"
		[/move]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="MajinVegeta has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[recruit]
			value="4"
			x="15"
			y="3"
		[/recruit]
		[random]
			value="12190"
		[/random]
		[random]
			value="2527"
		[/random]
		[random]
			value="513"
		[/random]
		[random]
			value="17434"
		[/random]
		[random]
			value="196"
		[/random]
		[random]
			value="31380"
		[/random]
		[random]
			value="5038"
		[/random]
		[random]
			value="13040"
		[/random]
		[random]
			value="23267"
		[/random]
		[random]
			value="16787"
		[/random]
		[random]
			value="25309"
		[/random]
		[random]
			value="27680"
		[/random]
		[random]
			value="350"
		[/random]
		[random]
			value="1347"
		[/random]
		[random]
			value="27303"
			[results]
				checksum="3Cf1OSv,C7F>rbJjRs8AZ92.m<LzFBEHnuR73QRpoMa2r4.k-cpOaw87,.Y8Z.5ndaB-kwWvSlbAfbufC3iaj7hobd->Zheuk<>2fa5>ai01-b1+6Z+40CN5c8b.>X,4"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="darky has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[move]
			x="15,15,15"
			y="2,3,4"
		[/move]
	[/command]
	[command]
		sent="yes"
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="15"
				y="4"
			[/source]
			[destination]
				x="14"
				y="4"
			[/destination]
		[/attack]
		[random]
			value="20451"
			[results]
				chance="70"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="22415"
			[results]
				chance="60"
				damage="2"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="24599"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="8766"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="29903"
			[results]
				chance="70"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="12688"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="5838"
			[results]
				chance="70"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="3610"
			[results]
				chance="70"
				damage="4"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[countdown_update]
			team="2"
			value="270000"
		[/countdown_update]
	[/command]
	[command]
		sent="yes"
		[end_turn]
		[/end_turn]
	[/command]
	[command]
		[move]
			x="14,14,14,15,15,15"
			y="9,8,7,7,6,5"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="15"
				y="5"
			[/source]
			[destination]
				x="15"
				y="4"
			[/destination]
		[/attack]
		[random]
			value="27032"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="17367"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="27477"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="5532"
			[results]
				chance="60"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="10801"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="4387"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="4464"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="18319"
			[results]
				chance="60"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Spree has logged into the lobby"
		[/speak]
	[/command]
	[command]
		[move]
			x="14,14,15,16,16,16"
			y="8,7,7,6,5,4"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="1"
			weapon="1"
			[source]
				x="16"
				y="4"
			[/source]
			[destination]
				x="15"
				y="4"
			[/destination]
		[/attack]
		[random]
			value="18995"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="32478"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="17672"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="17468"
			[results]
				chance="40"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="5880"
			[results]
				chance="70"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="7531"
			[results]
				chance="40"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="32524"
			[results]
				chance="40"
				damage="8"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="26733"
			[results]
				chance="40"
				damage="8"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		[move]
			x="17,17,17,16"
			y="6,5,4,3"
		[/move]
	[/command]
	[command]
		[attack]
			defender_weapon="0"
			weapon="1"
			[source]
				x="16"
				y="3"
			[/source]
			[destination]
				x="15"
				y="4"
			[/destination]
		[/attack]
		[random]
			value="17573"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="20859"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="19671"
			[results]
				chance="60"
				damage="0"
				dies="no"
				hits="no"
			[/results]
		[/random]
		[random]
			value="23901"
			[results]
				chance="70"
				damage="7"
				dies="no"
				hits="yes"
			[/results]
		[/random]
		[random]
			value="11113"
			[results]
				chance="60"
				damage="8"
				dies="yes"
				hits="yes"
			[/results]
		[/random]
	[/command]
	[command]
		sent="yes"
		undo="no"
		[speak]
			id="Ion514"
			message="gg"
			side="2"
		[/speak]
	[/command]
	[command]
		undo="no"
		[speak]
			id="solange1"
			message="thx, gg"
			side="1"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Lela has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Ion514 has left the game."
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="solange1 takes control of side 2."
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Near has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="perty has logged into the lobby"
		[/speak]
	[/command]
	[command]
		sent="yes"
		[speak]
			id="server"
			message="Jon0 has logged into the lobby"
		[/speak]
	[/command]
[/replay]
[snapshot]
[/snapshot]
[replay_start]
	current_tod="0"
#textdomain wesnoth-multiplayer
	description=_ "This most unusual of caves was once known as the Chamber of Laughing Devils, and was the inner citadel of the Kah Ruuk Oni. The Kah Ruuk were a wicked and cunning race of man-eating demons, who terrorized the people of the Eastern Lands for nearly four hundred years, before vanishing from Irdya without a trace. Since that time, many factions have vied for dominion over the Den of Onis, hoping to unlock the strange and mysterious magics of its creators."
	experience_modifier="70"
	hash="0UcdixDPqLm3+hh>V5qedNftTzpDzEnpcCt9okfubpKJFPc+N02noXfLREz,CUoR2IfA>Kgve5rc.2fi6bgul1BoAlggOrqRAY4K1w,Am7P<VLAwGeU,.pw-Ir84kuiX"
	id="multiplayer_Den_of_Onis"
	map_data="border_size=1
usage=map

Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Ql          , Ql          , Ql          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Ql          , Ql          , Ql          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Ur          , 2 Kud       , Uu          , Ql          , Ql          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Uh          , Wwf^Uf      , Wwf         , Rd          , Rd          , Cud         , Ur          , Uu^Uf       , Rd          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Ur          , Uu^Vu       , Ur          , Wwf         , Rd          , Cud         , Cud         , Ur          , Ur          , Hh          , Ss          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Rd          , Xu          , Wwf         , Rd          , Rd          , Ur          , Ur          , Wwf         , Wwf         , Rd          , Rd          , Cud         , Rp          , Gs^Fp       , Ss^Vhs      , Ss          , Rd          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Ur          , Ur          , Ur          , Rd          , Rd          , Wwf         , Rd          , Mm          , Ur          , Ur          , Ur^Fp       , Rd^Fp       , Uh          , Rd          , Rd          , Rp          , Wwf         , Rd          , Hh          , Rd          , Uu^Vu       , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Ql          , Uu^Uf       , Xu          , Ur          , Xu          , Xu          , Wwf         , Wwf         , Rd          , Ql          , Ql          , Ur          , Uu^Uf       , Wwf         , Rd          , Rd          , Hh          , Gs^Fp       , Rp          , Xu          , Rd          , Wwf         , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Rd          , Gs^Fp       , Rd          , Ur          , Xu          , Ww          , Ww          , Xu          , Xu          , Xu          , Uu^Vu       , Wwf         , Rd          , Rd          , Rd          , Rd          , Rd          , Rd          , Xu          , Xu          , Rp          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Ql          , Xu          , Rd          , Uu^Vu       , Xu          , Rd          , Xu          , Ww          , Wwf         , Uh          , Rd          , Rd          , Rd          , Rd^Fp       , Hh          , Rd          , Rp          , Mm          , Wwf         , Ss^Vhs      , Rd          , Rd          , Gs^Fp       , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Rp          , Xu          , Xu          , Uh          , Gs^Fp       , Xu          , Wwf         , Mm          , Wwf         , Gs^Fp       , Mm          , Hh          , Rd          , Rd          , Rd          , Rp          , Hh          , Wwf         , Rd          , Xu          , Xu          , Uh          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Wwf         , Wwf         , Gs^Fp       , Rd          , Rd          , Uu^Uf       , Xu          , Wwf         , Wwf         , Wwf         , Ww          , Ww          , Hh          , Rp          , Rd          , Rd          , Hh          , Gs^Fp       , Hh          , Wwf         , Xu          , Rp          , Rd          , Uu^Uf       , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Rp          , Wwf         , Rp          , Rp          , Rd          , Xu          , Ur          , Xu          , Wwf         , Rp          , Ww          , Rp          , Gs^Fp       , Rp          , Rp          , Rd          , Rd          , Rd          , Gs^Fp       , Rp          , Wwf         , Uh          , Gs^Fp       , Rd          , Rd          , Uh          , Xu          , Wo          , Xu          , Xu          
Xu          , Xu          , Wo          , Ww          , Uh          , Uh          , Rd          , Xu          , Uh          , Wwf         , Rp          , Rd          , Rd          , Rp          , Rd          , Rd          , Rp          , Rp          , Rp          , Rd          , Rp          , Wwf         , Xu          , Xu          , Xu          , Uh          , Rp          , Ww          , Wwf         , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Rd          , Rd          , Gs^Fp       , Xu          , Wwf         , Hh          , Gs^Fp       , Hh          , Rd          , Rd          , Rp          , Hh          , Gs^Fp       , Ww          , Ww          , Wwf         , Wwf         , Xu          , Rd          , Rd          , Rd          , Gs^Fp       , Rp          , Wwf         , Rp          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Uu^Uf       , Uh          , Rp          , Xu          , Wwf         , Wwf         , Gs^Fp       , Rp          , Rd          , Rd          , Rp          , Hh          , Ww          , Gs^Fp       , Wwf         , Mm          , Wwf         , Xu          , Uu^Uf       , Uh          , Rd          , Xu          , Wwf         , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Gs^Fp       , Xu          , Rd          , Rd          , Wwf         , Hh          , Rp          , Rd          , Hh          , Rd          , Rd          , Mm          , Rd          , Wwf         , Wwf         , Wwf         , Xu          , Gs^Fp       , Xu          , Xu          , Rd          , Rd          , Ql          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Rp          , Rp          , Xu          , Ss^Vhs      , Rd          , Mm          , Rd          , Rd          , Rd          , Rd^Fp       , Uu^Vu       , Rd          , Xu          , Uh          , Ww          , Ww          , Xu          , Rd          , Rd          , Uu^Vu       , Rd          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Wwf         , Xu          , Xu          , Rd          , Rd^Fp       , Rd          , Rd          , Rd          , Wwf         , Wwf         , Ur          , Xu          , Ql          , Xu          , Wwf         , Ww          , Xu          , Ur          , Ur          , Gs^Fp       , Uu^Uf       , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Uu^Vu       , Rd          , Hh          , Rp          , Wwf         , Hh          , Rd          , Rd          , Uh          , Uu^Uf       , Ur^Fp       , Ql          , Ur          , Rd          , Rd          , Wwf         , Rd          , Xu          , Ur          , Xu          , Ur          , Ql          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Rd          , Rd          , Rd          , Ss^Vhs      , Rp          , Rp          , Rd          , Rd          , Rd^Fp       , Wwf         , Ur          , Ur          , Mm          , Rd          , Wwf         , Wwf         , Rd          , Rd          , Ur          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Ss          , Ss          , Gs^Fp       , Ur          , Cud         , Cud         , Rd          , Rd          , Wwf         , Ur          , Ur          , Ur          , Rd          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Hh          , Rd          , Ur          , Ur          , Cud         , Rd          , Wwf         , Wwf         , Uu^Vu       , Uh          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Ql          , Uu^Uf       , Uu          , Cud         , Ur          , Rd          , Xu          , Wwf^Uf      , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Ql          , Ql          , 1 Kud       , Ql          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Ql          , Ql          , Ql          , Ql          , Ql          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          , Xu          
"
	mp_countdown="yes"
	mp_countdown_action_bonus="20"
	mp_countdown_init_time="270"
	mp_countdown_reservoir_time="270"
	mp_countdown_turn_bonus="200"
	mp_fog="yes"
	mp_shroud="no"
	mp_use_map_settings="yes"
	mp_village_gold="2"
	name=_ "2p - Den of Onis"
	next_underlying_unit_id="0"
#textdomain wesnoth
	objectives=_ "Victory:
@Defeat enemy leader(s)"
	observer="yes"
	random_seed="23997"
	random_start_time="no"
	scenario="ladder.sybversiva.org"
	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]
	[item]
		image="items/burial.png"
		x="15"
		y="13"
	[/item]
	[item]
		image="items/burial.png"
		x="26"
		y="16"
	[/item]
	[item]
		image="items/burial.png"
		x="4"
		y="9"
	[/item]
	[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="solange1"
		flag_rgb="magenta"
		fog="yes"
		gender="male"
		gold="100"
		id="solange11"
		image="units/drakes/flare.png"
		income="0"
		leader="Drake Flare,Fire Drake,Drake Slasher,Drake Gladiator,Drake Warrior,Saurian Oracle,Saurian Soothsayer"
		mp_countdown="yes"
		mp_countdown_action_bonus="20"
		mp_countdown_init_time="270"
		mp_countdown_reservoir_time="270"
		mp_countdown_turn_bonus="200"
		name="solange1"
		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"
		save_id="solange11"
		share_maps="no"
		share_view="yes"
		shroud="no"
		side="1"
		team_name="south"
		terrain_liked="Hh, Ha, Ds, Ss"
		type="Fire Drake"
		user_team_name="wesnoth-multiplayerteamname^South"
		village_gold="2"
		[ai]
			recruitment_pattern="fighter,fighter,archer,healer,scout,scout"
			villages_per_scout="8"
			[team_formula]
				rulebase="fai 'recruitment.fai'
		# ===== Some general functions used later ==== #

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

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

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

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

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

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

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

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

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

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

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

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

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

#returns average defense of the unit #

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

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

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

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


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


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

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

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

# ==2== based on village possession #

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

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

# multipled by 1000 to increase precision #

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

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

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

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

#==1==  basic evaluation #

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

faiend
"
			[/team_formula]
		[/ai]
		[ai]
			villages_per_scout="8"
		[/ai]
	[/side]
	[side]
		allow_changes="yes"
		allow_player="yes"
		canrecruit="yes"
		colour="2"
		controller="network"
		current_player="Ion514"
		flag_rgb="magenta"
		fog="yes"
		gender="male"
		gold="100"
		id="Ion5142"
		image="units/drakes/flare.png"
		income="0"
		leader="Drake Flare,Fire Drake,Drake Slasher,Drake Gladiator,Drake Warrior,Saurian Oracle,Saurian Soothsayer"
		mp_countdown="yes"
		mp_countdown_action_bonus="20"
		mp_countdown_init_time="270"
		mp_countdown_reservoir_time="270"
		mp_countdown_turn_bonus="200"
		name="Ion514"
		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"
		save_id="Ion5142"
		share_maps="no"
		share_view="yes"
		shroud="no"
		side="2"
		team_name="north"
		terrain_liked="Hh, Ha, Ds, Ss"
		type="Fire Drake"
		user_team_name="wesnoth-multiplayerteamname^North"
		village_gold="2"
		[ai]
			recruitment_pattern="fighter,fighter,archer,healer,scout,scout"
			villages_per_scout="8"
			[team_formula]
				rulebase="fai 'recruitment.fai'
		# ===== Some general functions used later ==== #

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

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

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

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

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

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

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

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

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

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

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

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

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

#returns average defense of the unit #

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

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

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

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


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


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

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

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

# ==2== based on village possession #

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

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

# multipled by 1000 to increase precision #

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

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

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

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

#==1==  basic evaluation #

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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

faiend
"
			[/team_formula]
		[/ai]
		[ai]
			villages_per_scout="8"
		[/ai]
	[/side]
[/replay_start]
[statistics]
	mid_scenario="yes"
	[scenario]
		scenario="2p - Den of Onis"
		[team]
			[recruits]
				Drake Burner="1"
				Drake Clasher="3"
				Drake Fighter="2"
				Saurian Augur="4"
				Saurian Skirmisher="4"
			[/recruits]
			[recalls]
			[/recalls]
			[advances]
			[/advances]
			[deaths]
				Drake Burner="1"
				Drake Clasher="3"
				Drake Fighter="2"
				Fire Drake="1"
				Saurian Augur="3"
				Saurian Skirmisher="4"
			[/deaths]
			[killed]
				Drake Clasher="1"
				Drake Fighter="2"
				Saurian Augur="5"
				Saurian Oracle="1"
				Saurian Skirmisher="1"
			[/killed]
			[attacks]
				[sequence]
					s0000="1"
					s0001="1"
					s01="1"
					s0110="1"
					s1="1"
					s1000="1"
					s1011="1"
					s11="1"
					s1101="1"
					s111="1"
					s1111="1"
					_num="60"
				[/sequence]
				[sequence]
					s000="1"
					s011="1"
					s0110="1"
					s0111="1"
					s100="1"
					s101="1"
					s1010="1"
					s10111="1"
					s110="1"
					s111="1"
					_num="70"
				[/sequence]
			[/attacks]
			[defends]
				[sequence]
					s="7"
					_num="0"
				[/sequence]
				[sequence]
					s="1"
					s00="1"
					s001="1"
					s00111="1"
					_num="40"
				[/sequence]
				[sequence]
					s01="2"
					s01001="1"
					s011="2"
					s0110="1"
					s1="2"
					s10="1"
					s101="1"
					s11="2"
					s1101="1"
					s111="1"
					s1110="1"
					_num="60"
				[/sequence]
				[sequence]
					s="2"
					s00="1"
					s01="1"
					s1="3"
					s11="2"
					s1100="1"
					s111="2"
					s1110="1"
					_num="70"
				[/sequence]
			[/defends]
			recruit_cost="236"
			recall_cost="0"
			damage_inflicted="521"
			damage_taken="524"
			expected_damage_inflicted="455893"
			expected_damage_taken="566721"
			turn_damage_inflicted="67"
			turn_damage_taken="24"
			turn_expected_damage_inflicted="33357"
			turn_expected_damage_taken="33690"
			save_id="Ion5142"
		[/team]
		[team]
			[recruits]
				Drake Clasher="3"
				Drake Fighter="3"
				Drake Glider="1"
				Saurian Augur="9"
				Saurian Skirmisher="1"
			[/recruits]
			[recalls]
			[/recalls]
			[advances]
				Saurian Oracle="2"
			[/advances]
			[deaths]
				Drake Clasher="1"
				Drake Fighter="2"
				Saurian Augur="5"
				Saurian Oracle="1"
				Saurian Skirmisher="1"
			[/deaths]
			[killed]
				Drake Burner="1"
				Drake Clasher="3"
				Drake Fighter="2"
				Fire Drake="1"
				Saurian Augur="3"
				Saurian Skirmisher="4"
			[/killed]
			[attacks]
				[sequence]
					s00="1"
					s000="1"
					s0000="2"
					s0101="1"
					_num="40"
				[/sequence]
				[sequence]
					s000="2"
					s001="1"
					s0101="1"
					s011="1"
					s1="1"
					s101="1"
					s11="2"
					_num="60"
				[/sequence]
				[sequence]
					s000="1"
					s001="3"
					s01="2"
					s011="3"
					s1="2"
					s100="1"
					s101="4"
					s1010="1"
					s11="2"
					s110="2"
					s111="4"
					_num="70"
				[/sequence]
			[/attacks]
			[defends]
				[sequence]
					s="1"
					_num="0"
				[/sequence]
				[sequence]
					s000="2"
					s010="1"
					s10="1"
					s111="1"
					s1110="1"
					_num="40"
				[/sequence]
				[sequence]
					s="1"
					s00="1"
					s001="1"
					s1="1"
					s100="1"
					s101="1"
					s11="2"
					s110="2"
					_num="60"
				[/sequence]
				[sequence]
					s0="1"
					s001="1"
					s101="1"
					s111="1"
					_num="70"
				[/sequence]
			[/defends]
			recruit_cost="283"
			recall_cost="0"
			damage_inflicted="524"
			damage_taken="521"
			expected_damage_inflicted="566721"
			expected_damage_taken="455893"
			turn_damage_inflicted="22"
			turn_damage_taken="51"
			turn_expected_damage_inflicted="30090"
			turn_expected_damage_taken="19357"
			save_id="solange11"
		[/team]
	[/scenario]
[/statistics]
