/
12_Walking_Trees.cfg
399 lines (361 loc) · 12 KB
/
12_Walking_Trees.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
#textdomain wesnoth-sota
# There is no leader for side 2, but the side starts with a canrecruit unit who leaves
# at the beginning. Woses spawn on many turns, but they are invisible on their forest
# hexes. So, in their first turn, they move one hex and tear up the dirt on their
# starting location. That way the player isn't totally surprised.
[scenario]
name= _ "Walking Trees"
map_data="{campaigns/Secrets_of_the_Ancients/maps/12_Walking_Trees.map}"
id=12_Walking_Trees
next_scenario=13_Together_Again
[story]
[part]
[background_layer]
image=story/elf-road.jpg
scale=no
[/background_layer]
story= _ "17 IV, 23 YW
My primary objective was met, and I had been able to press a number of ghosts into service. Also, I had a new companion with a talent for healing. I doubted that Ras-Tabahn was already waiting at the appointed place, but I still wanted to hurry, so we followed the elf road north as quickly as we could. Fortunately, it was not in bad repair, though in many places it was overgrown, leaving only a few smooth cobbles to mark the way. The second day, we were still deep in the woods when we encountered an elf sorceress."
[/part]
{JOURNEY_PART 12}
[/story]
{DEFAULT_SCHEDULE}
{DEFAULT_MUSIC_PLAYLIST}
{TURNS 18 18 18}
victory_when_enemies_defeated=no
[side]
{SIDE_1_ARDONNA}
{ARDONNA_RECRUIT_4}
{GOLD 200 190 180}
[/side]
[side]
side=2
no_leader=yes
controller=ai
user_team_name= _ "Forest"
team_name=bad
gold=0
income=-2
color=teal
[unit]
type=Elvish Enchantress
x,y=24,2
name=_ "Isthiniel"
id=Isthiniel
# To match her appearance in S21:
[modifications]
{TRAIT_RESILIENT}
[/modifications]
canrecruit=yes
facing=sw
[/unit]
hidden=yes
{FLAG_VARIANT wood-elvish}
[/side]
# For each difficulty level, the first 16 woses are level-1, the rest are level-2.
#ifdef EASY
#define MAX_NUMBER_OF_WOSES
18
#enddef
#define WOSES_PER_TURN
4
#enddef
#endif
#ifdef NORMAL
#define MAX_NUMBER_OF_WOSES
22
#enddef
#define WOSES_PER_TURN
4
#enddef
#endif
#ifdef HARD
#define MAX_NUMBER_OF_WOSES
25
#enddef
#define WOSES_PER_TURN
5
#enddef
#endif
# *************************** PRESTART ***************************
[event]
name=prestart
[objectives]
side=1
[objective]
description= _ "Move Ardonna to the northeast corner of the map"
condition=win
[/objective]
{HOW_TO_LOSE_WITH_ARDONNA}
[gold_carryover]
bonus=yes
carryover_percentage=40
[/gold_carryover]
[/objectives]
{RECALL_LOYAL_UNITS}
[set_variable]
name=wose_x
value=15
[/set_variable]
[set_variable]
name=wose_y
value=13
[/set_variable]
[set_variable]
name=number_of_woses
value=1
[/set_variable]
[/event]
# *************************** PLAY ***************************
[event]
name=start,side 2 turn 3 refresh,side 2 turn 6 refresh,side 2 turn 9 refresh,side 2 turn 11 refresh
first_time_only=no
[set_variable]
name=woses_this_turn
value=1
[/set_variable]
[while]
[and]
[variable]
name=number_of_woses
less_than_equal_to={MAX_NUMBER_OF_WOSES}
[/variable]
[variable]
name=woses_this_turn
less_than_equal_to={WOSES_PER_TURN}
[/variable]
[/and]
# Put a wose in a random location with some constraints:
[do]
# [do] keep choosing a location [while] the location is no good.
[while]
[have_location]
x=$wose_x
y=$wose_y
terrain=!,*^F* # No good. Not a forest hex.
[or]
terrain=Ke
[and]
x=$wose_x
y=$wose_y
radius=7 # Too close to the player’s keep.
[/and]
[/or]
[or]
[filter]
side=1
[/filter]
[and]
x=$wose_x
y=$wose_y
radius=2
# The wose would be adjacent to one of the
# player's units after it moved one hex.
[/and]
[/or]
[or]
x=$wose_x
y=$wose_y
[filter]
[/filter] # Another unit is there already.
[/or]
[/have_location]
[do]
# Choose a random location, which gets closer to the
# top corner after turn 8.
[if]
[variable]
name=turn_number
greater_than=8
[/variable]
[then]
[set_variable]
name=wose_x
rand=13..27
[/set_variable]
[set_variable]
name=wose_y
rand=1..13
[/set_variable]
[/then]
[else]
[set_variable]
name=wose_x
rand=1..27
[/set_variable]
[set_variable]
name=wose_y
rand=1..21
[/set_variable]
[/else]
[/if]
[/do]
[/while]
[if]
[variable]
name=number_of_woses
greater_than=16
[/variable]
[then]
[set_variable]
name=wose_type
value=Elder Wose
[/set_variable]
[/then]
[else]
[set_variable]
name=wose_type
value=Wose
[/set_variable]
[/else]
[/if]
[unit]
type=$wose_type
x=$wose_x
y=$wose_y
side=2
[/unit]
[set_variable]
name=number_of_woses
add=1
[/set_variable]
[set_variable]
name=woses_this_turn
add=1
[/set_variable]
[/do]
[/while]
[store_locations]
variable=new_wose_locations
terrain=*^F*
[filter]
side=2
[/filter]
[/store_locations]
[if]
[variable]
name=turn_number
greater_than=1
[/variable]
[then]
[modify_unit]
[filter]
[filter_location]
find_in=new_wose_locations
[/filter_location]
[/filter]
moves=1
[/modify_unit]
[/then]
[/if]
[/event]
# If a newly spawned wose is moving from its starting location, change the location
# to dark dirt. (The wose will probably be invisible in the forest, but the dirt
# will tell where it spawned.)
[event]
name=moveto
first_time_only=no
[filter]
side=2
[/filter]
[filter_condition]
[have_location]
x,y=$x2,$y2
find_in=new_wose_locations
[/have_location]
[/filter_condition]
[terrain]
terrain=Rb
x,y=$x2,$y2
[/terrain]
[item]
x,y=$x2,$y2
image=items/dirt1.png
[/item]
[/event]
# *************************** ENDING / OPENING ***************************
[event]
name=start
[message]
speaker=Isthiniel
message= _ "I felt our dead stirring and corruption descending on the forest. When I left to investigate, I expected to find grim, veiled forces at work. Instead I find a human mage boldly marching down our road! I will not allow you to continue to molest our peace, and you must release the dead you have enslaved."
[/message]
[message]
speaker=Ardonna
message= _ "Well, that I won’t do. However, if you do not attack, you will be rid of me soon, as I only wish to leave these woods."
[/message]
[message]
speaker=Isthiniel
message= _ "Attack? No, I cannot. Most of my people won’t come here; it is only duty that drives me. However, the woods themselves are disturbed, and they will cast you out on their own. I can feel them awaken."
[/message]
[terrain]
terrain=Rb
x,y=24,4
[/terrain]
[item]
x,y=24,4
image=items/dirt1.png
[/item]
[move_unit_fake]
type=Ancient Wose
x=24, 22
y=4, 3
[/move_unit_fake]
[unit]
type=Ancient Wose
name= _ "Dolmathengalin"
id=Dolmathengalin
x,y=22,3
side=2
[/unit]
[message]
speaker=Dolmathengalin
message= _ "You are greeted daughter of elves. Why does the forest moan in despair?"
[/message]
[message]
speaker=Vendraxis
message= _ "That tree can talk!"
[/message]
[message]
speaker=Isthiniel
message= _ "That dark mage has woken our dead and stifles the air with her very presence. Please wake your people, Elder, and destroy her."
[/message]
[message]
speaker=Dolmathengalin
message= _ "This shall be done."
[/message]
[message]
speaker=Isthiniel
message= _ "I shall leave you. I have no wish to witness this violence."
[/message]
[kill]
id=Isthiniel
[/kill]
[move_unit_fake]
type=Elvish Enchantress
x=24, 27
y=2, 1
[/move_unit_fake]
[/event]
[event]
name=moveto
[filter]
id=Ardonna
x,y=27,1
[/filter]
[clear_variable]
name=wose_x, wose_y, wose_type, random, number_of_woses, woses_this_turn, new_wose_locations
[/clear_variable]
[endlevel]
result=victory
bonus=yes
{NEW_GOLD_CARRYOVER 40}
[/endlevel]
[/event]
{HERO_DEATHS}
{MAKE_BATS_NORMAL}
{ZOMBIES}
{MANAGE_PROFILE}
#undef MAX_NUMBER_OF_WOSES
#undef WOSES_PER_TURN
[/scenario]