Author Topic: My scenarios :attackonly  (Read 1295 times)

cds

  • Battlemage
  • **
  • Posts: 34
    • View Profile
My scenarios :attackonly
« on: 12 May 2010, 14:48:20 »

<?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>

ElimiNator

  • Airship
  • ********
  • Posts: 3,385
  • The MegaGlest Moder.
    • View Profile
    • Jacob's Blog
    • Email
Re: My scenarios :attackonly
« Reply #1 on: 12 May 2010, 16:43:02 »
Ill try it out.  :)
Get the Vbros': Packs 1, 2, 3, 4, and 5!