Bump minimum cmake
[megaglest-data.git] / tutorials / 2_basic_tutorial / 2_basic_tutorial.xml
blob1fe8b6c90cee8871fd8c39c8cc19f4f65a5827ae
1 <?xml version="1.0" standalone="yes" ?>
2 <scenario>
3         <difficulty value="0"/>
4         <players>
5                 <player control="human" faction="tech" team="1"/>
6                 <player control="cpu" faction="magic" team="2"/>
7                 <player control="closed"/>
8                 <player control="closed"/>
9         </players>
10         <map value="valley_of_death"/>
11         <tileset value="pine_rock"/>
12         <tech-tree value="megapack"/>
13         <default-resources value="false"/>
14         <default-units value="false"/>
15         <default-victory-conditions value="false"/>
16         <scripts>
17                 <startup>
18                         disableAi(1)
19                         createUnit('castle', 0, startLocation(0))
20                         setCameraPosition(unitPosition(lastCreatedUnit()))
21                         createUnit('farm', 0, startLocation(0))
22                         giveResource('gold', 0, 250)
23                         giveResource('food', 0, 50)
24                         giveResource('wood', 0, 50)
25                         giveResource('stone', 0, 100)
26                         showMessage('Welcome', 'GlestBasicTutorial')
27                         showMessage('WillBeUsingTech', 'GlestBasicTutorial')
28                         showMessage('NeedWorkers', 'Resources')
29                         setDisplayText('ProduceWorkers')
30                         objective= 'produce_worker'
31                 </startup>
32                 <resourceHarvested>
33                         if objective=='harvest_gold' and resourceAmount('gold', 0)>=100 then
34                                 showMessage('WorkersKeepOnHarvesting', 'WellDone')
35                                 showMessage('ResourceInformation', 'Resources')
36                                 showMessage('OtherResources', 'Resources')
37                                 setDisplayText('HarvestWoodAndStone')
38                                 objective= 'harvest_wood_and_stone'
39                         end
40                         if objective=='harvest_wood_and_stone' and resourceAmount('stone', 0)>=150 and resourceAmount('wood', 0)>=100 then
41                                 showMessage('TechResourceNeeds', 'WellDone')
42                                 showMessage('TechConsumesFood', 'Resources')
43                                 setDisplayText('ProduceCow')
44                                 objective= 'produce_cow'
45                         end
46                 </resourceHarvested>
47                 <unitCreatedOfType type="worker">
48                         if objective=='produce_worker' and unitCountOfType(0, 'worker')>=3 then
49                                 showMessage('SelectAndCommand', 'WellDone')
50                                 showMessage('HowToMine', 'Resources')
51                                 setDisplayText('MineGold')
52                                 objective= 'harvest_gold'
53                         end
54                 </unitCreatedOfType>
55                 <unitCreatedOfType type="cow">
56                         if objective=='produce_cow' then
57                                 showMessage('HaveEnoughAnimals', 'WellDone')
58                                 showMessage('BalanceDisplay', 'Resources')
59                                 showMessage('TechWarriorsAtBarracks', 'Combat')
60                                 showMessage('HowToBuildBarracks', 'Buildings')
61                                 setDisplayText('BuildBarracks')
62                                 objective= 'build_barracks'
63                         end
64                 </unitCreatedOfType>
65                 <unitCreatedOfType type="barracks">
66                         if objective=='build_barracks' then
67                                 showMessage('RememberToBuildBarracks', 'WellDone')
68                                 showMessage('SwordmanBrief', 'Combat')
69                                 setDisplayText('ProduceSwordman')
70                                 objective= 'produce_swordman'
71                         end
72                 </unitCreatedOfType>
73                 <unitCreatedOfType type="swordman">
74                         if objective=='produce_swordman' then
75                                 showMessage('HaveWarriorsAtBase', 'WellDone')
76                                 showMessage('ArcherBrief', 'Combat')
77                                 setDisplayText('ProduceArcher')
78                                 objective= 'produce_archer'
79                         end
80                 </unitCreatedOfType>
81                 <unitCreatedOfType type="archer">
82                         if objective=='produce_archer' then
83                                 showMessage('ProduceWarriors', 'WellDone')
84                                 setDisplayText('ProduceMoreWarriors')
85                                 for i=1, 3 do
86                                         createUnit('daemon', 1, startLocation(1))
87                                         givePositionCommand(lastCreatedUnit(), 'attack', startLocation(0))
88                                 end
89                                 objective= 'defend_from_attack'
90                         end
91                 </unitCreatedOfType>
92                 <unitDied>
93                         if objective=='defend_from_attack' and unitCount(1)==0 then
94                                 setDisplayText('WellDoneNextTutorial')
95                                 setPlayerAsWinner(0)
96                                 timer_event1 = startTimerEvent()
97                                 objective= 'end'
98                         end
99                 </unitDied>
100                 <timerTriggerEvent>
101                         if triggeredTimerEventId() == timer_event1 then
102                                 if timerEventSecondsElapsed(triggeredTimerEventId()) >= 7 then
103                                         endGame()
104                                         stopTimerEvent(triggeredTimerEventId())
105                                 end
106                         end
107                 </timerTriggerEvent>
108         </scripts>
109 </scenario>