<?xml version="1.0" standalone="yes" ?>
<scenario>
<difficulty value="3"/>
<players>
<player control="human" faction="magic" team="1"/>
<player control="cpu" faction="magic" team="1"/>
<player control="cpu" faction="tech" team="2"/>
<player control="cpu" faction="tech" team="2"/>
</players>
<map value="1"/>
<tileset value="forest"/>
<tech-tree value="magitech"/>
<default-resources value="false"/>
<default-units value="false"/>
<default-victory-conditions value="false"/>
<scripts>
<startup>
--å…³é— AI
disableAi(1)
disableAi(2)
disableAi(3)
--åŒç›Ÿå•ä½
createUnit('mage_tower', 0, startLocation(0))
magetowerUnit=lastCreatedUnit()
setCameraPosition(unitPosition(magetowerUnit))
createUnit('tower_of_souls', 1, startLocation(0))
for i=1, 9 do
createUnit('battlemage', 1, startLocation(0))
givePositionCommand(lastCreatedUnit(), 'attack', startLocation(3))
end
createUnit('summoner', 1, startLocation(0))
givePositionCommand(lastCreatedUnit(), 'attack', startLocation(3))
--玩家å•ä½
createUnit('drake_rider',0,startLocation(0))
--敌人å•ä½æ‘庄
createUnit('castle', 2, startLocation(3))
createUnit('defense_tower', 2, startLocation(3))
createUnit('farm',3,startLocation(3))
createUnit('cow',3,startLocation(3))
--åˆ›é€ æ•Œäººæ”»å‡»è€…
createUnit('swordman', 2, startLocation(3))
givePositionCommand(lastCreatedUnit(), 'attack', startLocation(0))
createUnit('battle_machine', 3, startLocation(3))
givePositionCommand(lastCreatedUnit(), 'attack', startLocation(0))
for i=1, 9 do
createUnit('archer', 2, startLocation(3))
givePositionCommand(lastCreatedUnit(), 'attack', startLocation(0))
end
</startup>
<unitCreated>
</unitCreated>
<unitDied>
--检查己方主塔是å¦æ»äº¡
if unitCountOfType(0, 'mage_tower')==0 then
setPlayerAsWinner(2)
setPlayerAsWinner(3)
endGame()
end
--己方æ»äº¡å¤æ´»
if unitCountOfType(0, 'drake_rider')==0 then
createUnit('drake_rider',0,startLocation(0))
end
--敌方牛æ»äº¡å¤æ´»
if unitCountOfType(3, 'cow')==0 then
createUnit('cow',3,startLocation(3))
end
--敌方æ»äº¡ï¼Œå¤æ´»
if unitCountOfType(3, 'battle_machine')==0 then
createUnit('battle_machine',3,startLocation(3))
givePositionCommand(lastCreatedUnit(),'attack',startLocation(0))
end
--æ€æ»æ•Œæ–¹ç»™äºˆå°å¥–励
if unitFaction(lastDeadUnit())==2 then
giveResource('gold', 0, 2)
giveResource('wood',0,2)
giveResource('stone',0,1)
end
--æ€æ»æ•Œæ–¹ç»™äºˆå¤§å¥–励
if unitFaction(lastDeadUnit())==3 and lastDeadUnitName()=='battle_machine' then
giveResource('gold',0,50)
giveResource('wood',0,40)
giveResource('stone',0,30)
giveResource('energy',0,1)
end
--己方æ¯ç”Ÿäº§ä¸€ä¸ªå¦å¾’initiateï¼Œæ•Œæ–¹å¢žåŠ ä¸‰ä¸ªé˜²å¾¡å¡”
if lastCreatedUnitName()=='initiate' then
for i=1,3 do
createUnit('defense_tower',2,startLocation(3))
end
end
--æ´¾å•ä½æ”»å‡»æ•Œæ–¹
if unitCountOfType(1,'battlemage')==5 then
for i=1, 9 do
createUnit('battlemage', 1, startLocation(0))
givePositionCommand(lastCreatedUnit(), 'attack', startLocation(3))
end
end
--åˆ›é€ æ•Œäººæ”»å‡»è€…
if unitCountOfType(2,'archer')==6 then
for i=1, 9 do
createUnit('archer', 2, startLocation(3))
givePositionCommand(lastCreatedUnit(), 'attack', startLocation(0))
end
end
--检查敌方主塔是å¦æ»äº¡
if unitCountOfType(2, 'castle')==0 then
setPlayerAsWinner(0)
setPlayerAsWinner(1)
endGame()
end
</unitDied>
</scripts>
</scenario>