-
-
Notifications
You must be signed in to change notification settings - Fork 988
/
2_Closing_the_Gates.cfg
820 lines (721 loc) · 23.6 KB
/
2_Closing_the_Gates.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
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
#textdomain wesnoth-sof
[scenario]
name= _ "Closing the Gates"
id=2_Closing_the_Gates
turns=15
map_data="{campaigns/Sceptre_of_Fire/maps/2_Closing_the_Gates.map}"
next_scenario=2t_In_the_Dwarven_City
victory_when_enemies_defeated=no
{SCENARIO_MUSIC battle.ogg}
{EXTRA_SCENARIO_MUSIC the_city_falls.ogg}
{DEFAULT_SCHEDULE}
[side]
type=Dwarvish Fighter
id=Rugnur
side=1
canrecruit=yes
shroud=yes
controller=human
recruit=Dwarvish Fighter,Dwarvish Thunderer,Dwarvish Guardsman,Dwarvish Scout
team_name=dwarves
user_team_name= _ "Dwarves"
{FLAG_VARIANT knalgan}
[/side]
# Give Rugnur control of all the non-boneyard villages inside the cave.
# Trolls are going to take a couple of these fairly quickly.
{STARTING_VILLAGES_AREA 1 14 11 3}
{STARTING_VILLAGES_AREA 1 26 11 6}
[side]
type=Elvish Captain
id=Glindur
name= _ "Glindur"
side=2
canrecruit=yes
{RECRUIT (Elvish Fighter,Elvish Scout,Elvish Archer,Elvish Shaman) (Elvish Fighter,Elvish Hero,Elvish Scout,Elvish Archer,Elvish Shaman) (Elvish Fighter,Elvish Hero,Elvish Scout,Elvish Archer,Elvish Ranger,Elvish Shaman)}
{GOLD 200 250 300}
team_name=elves
user_team_name= _ "Elves"
{FLAG_VARIANT wood-elvish}
[/side]
[side]
no_leader=yes
side=3
team_name=trolls
user_team_name= _ "Trolls"
[/side]
[story]
[part]
story= _ "Next in our story, Rugnur retreated into the caves of Knalga. But the elves pressed on, and would enter the caves shortly."
[/part]
[/story]
{SOF_TRACK {JOURNEY_02_NEW} }
{SOF_DEATHS}
[event]
name=prestart
# TODO: manually add snow detritus
[objectives]
side=1
[objective]
description= _ "Place someone on each of the six magic glyphs in order to close the dwarvish gates"
condition=win
[show_if]
{VARIABLE_CONDITIONAL gate_closed boolean_not_equals yes}
[/show_if]
[/objective]
[objective]
description= _ "Kill all elves in the caves after the gates are closed"
condition=win
[show_if]
{VARIABLE_CONDITIONAL gate_closed boolean_not_equals yes}
[/show_if]
[/objective]
[objective]
description= _ "Kill all elves in the caves"
condition=win
[show_if]
{VARIABLE_CONDITIONAL gate_closed boolean_equals yes}
[/show_if]
[/objective]
[objective]
description= _ "Death of Rugnur"
condition=lose
[/objective]
[objective]
description= _ "Death of Baglur"
condition=lose
[/objective]
{TURNS_RUN_OUT}
[gold_carryover]
bonus=yes
carryover_percentage=40
[/gold_carryover]
[/objectives]
[kill]
side=1
type=Caravan
[/kill]
# stores all the locations outside the gate into an array, so checks for
# whether there are units still outside don't require maintaining a
# static set of coordinates
[store_locations]
x,y=10,20
radius=20
[filter_radius]
[not]
terrain=X*
[/not]
[not]
x=12,13,14
y=12,13,13
[/not]
[not]
x=2,21
y=6,24
[/not]
[/filter_radius]
variable=locations_outside
[/store_locations]
[remove_shroud]
find_in=locations_outside
side=1
[/remove_shroud]
{GENERIC_UNIT 3 "Troll Whelp" 6 3}
{GENERIC_UNIT 3 "Troll Whelp" 6 3}
{GENERIC_UNIT 3 "Troll Whelp" 6 3}
{GENERIC_UNIT 3 "Troll Whelp" 30 25}
{GENERIC_UNIT 3 "Troll Whelp" 30 25}
{GENERIC_UNIT 3 "Troll Whelp" 30 25}
#ifdef HARD
{GENERIC_UNIT 3 "Troll Whelp" 30 25}
#endif
#ifdef NORMAL
{GENERIC_UNIT 3 "Troll Whelp" 30 25}
#endif
[set_variables]
name=glyphs
[value]
x,y=9,11
image_off=scenery/rune1.png
image_on=scenery/rune1-glow.png
[/value]
[value]
x,y=14,3
image_off=scenery/rune2.png
image_on=scenery/rune2-glow.png
[/value]
[value]
x,y=30,19
image_off=scenery/rune3.png
image_on=scenery/rune3-glow.png
[/value]
[value]
x,y=17,15
image_off=scenery/rune4.png
image_on=scenery/rune4-glow.png
[/value]
[value]
x,y=3,5
image_off=scenery/rune1.png
image_on=scenery/rune1-glow.png
toggles_x=2
toggles_y=6
[/value]
[value]
x,y=23,24
image_off=scenery/rune2.png
image_on=scenery/rune2-glow.png
toggles_x=21
toggles_y=24
[/value]
[/set_variables]
[foreach]
array=glyphs
[do]
[item]
x,y=$this_item.x,$this_item.y
image=$this_item.image_off
[/item]
[/do]
[/foreach]
[/event]
[event]
name=start
{MOVE_UNIT id=Rugnur 22 12}
[recall]
id=Alanin
[/recall]
[redraw]
side=1
[/redraw]
[message]
speaker=Rugnur
message= _ "These elves are right behind me! We have to go warn the council of this attack...!"
[/message]
[message]
speaker=Alanin
message= _ "Here — I’ll go warn the council. You stay here and fight."
[/message]
[message]
speaker=Rugnur
message= _ "Yes, that sounds good. I’ll stay here and try to defend the gates..."
[/message]
{MOVE_UNIT id=Alanin 32 12}
[store_unit]
[filter]
id=Alanin
[/filter]
variable=changealanin
kill=yes
[/store_unit]
[message]
speaker=Glindur
message= _ "I see you have sent a messenger to the city. Good idea, but will it really help? We have more troops and more provisions, and we are going to enter those caves and kill you!"
[/message]
[message]
speaker=Rugnur
message= _ "(<i>Gulp</i>)"
[/message]
[message]
speaker=Glindur
message= _ "Ha! I thought as much. Well then, surrender!"
[/message]
[message]
speaker=Rugnur
message= _ "Um... on what terms?"
[/message]
[message]
speaker=Glindur
message= _ "Unconditional."
[/message]
{GENERIC_UNIT 1 "Dwarvish Guardsman" 10 13}
{GENERIC_UNIT 1 "Dwarvish Guardsman" 14 15}
{GENERIC_UNIT 1 "Dwarvish Guardsman" 12 11}
{GENERIC_UNIT 1 "Dwarvish Guardsman" 15 13}
#ifdef EASY
{GENERIC_UNIT 1 "Dwarvish Guardsman" 12 14}
#endif
[unit]
x,y=22,11
type=Dwarvish Stalwart
side=1
id=Baglur
name= _ "Baglur"
unrenamable=yes
{IS_HERO}
profile=portraits/baglur.png
facing=sw
[modifications]
{TRAIT_LOYAL}
{TRAIT_RESILIENT}
[/modifications]
[/unit]
[redraw]
side=1
[/redraw]
[message]
speaker=Baglur
message= _ "Wait! Rugnur, dinna’ they tell you <i>anything</i> when you took command here?!"
[/message]
[message]
speaker=Rugnur
message= _ "Not really. This was supposedly a time of peace. Who are you?"
[/message]
[message]
speaker=Baglur
message= _ "Argh! I’m a retired warrior... it looks like I’ll ha’ to come out and help you, else we’ll be overrun by the damn elves... argh again. Well, listen here. This entrance to the city can be closed. There’s a gate. If we can close it, the elves will no’ be able to enter. And you elves; begone from here!"
[/message]
[message]
speaker=Glindur
message= _ "Cease your meddling, old dwarf! Rugnur is in charge here, and it is he who will bargain with us."
[/message]
[message]
speaker=Rugnur
message= _ "Baglur, how do you close the gates?"
[/message]
[message]
speaker=Baglur
message= _ "Och, well that’s the difficulty. It’s a magic gate. Indestructible. But that means it can only be closed by magic. Ye need to position a warrior on each of the six glyphs. When all are occupied, the gates wi’ close. Then the elves will be shut out of the caves forever, at least through this entrance."
[/message]
[message]
speaker=Rugnur
message= _ "Don’t we have troops positioned near these glyphs, to unlock them?"
[/message]
[message]
speaker=Baglur
message= _ "Och, well, no. Lately trolls have been more in charge of those caves where the glyphs are than we dwarves have."
[/message]
[message]
speaker=Rugnur
message= _ "Well, where are they located?"
[/message]
[message]
speaker=Baglur
message= _ "Two are down a side passage in the northwest, another two are in a similar location in the southeast, and two are right next to the front gate."
[/message]
[message]
speaker=Glindur
message= _ "Have you made up your mind yet about surrendering? If you will not give up, prepare for battle!"
[/message]
[message]
speaker=Rugnur
# wmllint: local spelling stonecraft
message= _ "You may be more powerful than us, but I doubt even you can blast through dwarf-made stonecraft. We refuse — now let’s close these gates!"
[/message]
[/event]
# These macros toggle a glyph on the given location on or off
#define GLYPH_ON X Y
[foreach]
array=glyphs
[do]
[if]
[variable]
name=this_item.x
numerical_equals={X}
[/variable]
[variable]
name=this_item.y
numerical_equals={Y}
[/variable]
[then]
[remove_item]
x,y={X},{Y}
image=$this_item.image_off
[/remove_item]
[item]
x,y={X},{Y}
image=$this_item.image_on
[/item]
[if]
[variable]
name=this_item.toggles_x
not_equals=$empty
[/variable]
[then]
[sound]
name=rumble.ogg
[/sound]
[terrain]
x,y=$this_item.toggles_x,$this_item.toggles_y
terrain=Xu
[/terrain]
[/then]
[/if]
[/then]
[/if]
[/do]
[/foreach]
#enddef
#define GLYPH_OFF X Y
[foreach]
array=glyphs
[do]
[if]
[variable]
name=this_item.x
numerical_equals={X}
[/variable]
[variable]
name=this_item.y
numerical_equals={Y}
[/variable]
[then]
[remove_item]
x,y={X},{Y}
image=$this_item.image_on
[/remove_item]
[item]
x,y={X},{Y}
image=$this_item.image_off
[/item]
[if]
[variable]
name=this_item.toggles_x
not_equals=$empty
[/variable]
[then]
[sound]
name=rumble.ogg
[/sound]
[terrain]
x,y=$this_item.toggles_x,$this_item.toggles_y
terrain=Cud
[/terrain]
[/then]
[/if]
[/then]
[/if]
[/do]
[/foreach]
#enddef
# We reach the northern side entrance
[event]
name=moveto
[filter]
x,y=3,5
side=1
[/filter]
[message]
speaker=unit
message= _ "But what about this entrance? The elves can come through it just as easily as the main gate, and it cannot be closed!"
[/message]
[message]
speaker=Baglur
message= _ "I think it can be sealed up somehow... Yes, look, activating that glyph seems to have closed up the gap."
[/message]
[/event]
# We reach the southern side entrance
[event]
name=moveto
[filter]
x,y=23,24
side=1
[/filter]
[message]
speaker=unit
message= _ "But what about this entrance? The elves can come through it just as easily as the main gate, and it cannot be closed!"
[/message]
[message]
speaker=Baglur
message= _ "I think it can be sealed up somehow... Yes, look, activating that glyph seems to have closed up the gap."
[/message]
[/event]
# Check for all glyph activators in place
[event]
name=moveto
first_time_only=no
[filter]
side=1
[filter_location]
find_in=glyphs
[/filter_location]
[/filter]
[filter_condition]
[variable]
name=gate_closed
boolean_equals=no
[/variable]
[/filter_condition]
{GLYPH_ON $x1 $y1}
[if]
[have_unit]
side=1
[filter_location]
find_in=glyphs
[/filter_location]
count=6
[/have_unit]
[then]
{VARIABLE gate_closed yes}
[message]
speaker=Rugnur
message= _ "We have everyone positioned on the glyphs! What do we do now?"
[/message]
[message]
speaker=Baglur
message= _ "Just watch. The gates wi’ close very soon. Then the elves outside — and, unfortunately, our dwarves who are still out there — wi’ become irrelevant."
[/message]
[scroll_to]
x,y=13,13
[/scroll_to]
[sound]
name=rumble.ogg
[/sound]
[terrain]
x=12,13,14
y=12,13,13
terrain=^Xo
layer=overlay
[/terrain]
[redraw][/redraw]
[kill]
x=12,13,14
y=12,13,13
animate=yes
fire_event=yes
[/kill]
[delay]
time=2000
[/delay]
[message]
speaker=Glindur
message= _ "Agh! Well, you have defeated me for now, but eventually you will have to exit these caves, to give Haldric back his jewel. And when you do, we will be ready for you."
[/message]
[message]
speaker=Baglur
message= _ "If that is what ye choose to do, fine, but be prepared to wait for many years."
[/message]
[kill]
[filter_location]
find_in=locations_outside
[/filter_location]
side=1
fire_event=yes
animate=yes
[/kill]
[kill]
[filter_location]
find_in=locations_outside
[/filter_location]
side=2,3
fire_event=no
[/kill]
[place_shroud]
find_in=locations_outside
[not]
x=10, 11, 12, 13, 14
y=13,13-14,13-14,14-15,14-15
[/not]
side=1
[/place_shroud]
[if]
[have_unit]
side=2
[/have_unit]
[then]
[message]
speaker=Rugnur
message= _ "There are still some elves left in here. We have to eliminate them, too, unless they surrender."
[/message]
[message]
side=2
message= _ "You would have us be cowards! We do not surrender."
[/message]
[show_objectives]
[/show_objectives]
[/then]
[else]
[message]
speaker=Rugnur
message= _ "Well, now I should go down to the city and report. I’m late already..."
[/message]
[endlevel]
result=victory
bonus=yes
{NEW_GOLD_CARRYOVER 40}
[/endlevel]
[/else]
[/if]
[/then]
[else]
[message]
speaker=unit
message= _ "My glyph is on."
[/message]
[allow_undo]
[/allow_undo]
[/else]
[/if]
[/event]
# Toggles a glyph off when the player steps off it
[event]
name=moveto
first_time_only=no
[filter]
side=1
[filter_location]
[not]
find_in=glyphs
[/not]
[/filter_location]
[/filter]
[filter_condition]
[variable]
name=gate_closed
boolean_equals=no
[/variable]
[have_location]
x,y=$x2,$y2
find_in=glyphs
[/have_location]
[/filter_condition]
{GLYPH_OFF $x2 $y2}
[/event]
# Toggles a glyph off when the player unit on it dies
[event]
name=die
first_time_only=no
[filter]
side=1
[filter_location]
find_in=glyphs
[/filter_location]
[/filter]
[filter_condition]
[variable]
name=gate_closed
boolean_equals=no
[/variable]
[/filter_condition]
{GLYPH_OFF $x1 $y1}
[/event]
# This triggers either when the remaining elves in the caves after the gate
# is closed are killed or when all elves are killed before the gate is
# closed (unlikely)
[event]
name=die
first_time_only=no
[filter]
side=2
[/filter]
[if]
[not]
[have_unit]
side=2
[not]
x,y=$x1,$y1
[/not]
[/have_unit]
[/not]
[then]
[message]
speaker=Rugnur
message= _ "That’s all of the elves. Now I should go down to the city and report. I’m late already..."
[/message]
[endlevel]
result=victory
bonus=yes
{NEW_GOLD_CARRYOVER 40}
[/endlevel]
[/then]
[/if]
[/event]
[event]
name=scenario_end
{CLEAR_VARIABLE glyphs,glyph_i,locations_outside,gate_closed}
[/event]
[event]
name=die
[filter]
id=Baglur
[/filter]
[endlevel]
result=defeat
[/endlevel]
[/event]
# These handle the graphics for the gate. Normally, the gate is drawn in the
# "down" position, and after the impassable overlay ^Xo has been placed on
# the gate, an animated version will be drawn, displaying the gate closing.
# The map= and images are drawn relative to 11,11.
[terrain_graphics]
x,y=11,11
map="
*, *, *
, *, *, *
*, *, *
, 1, *, *
*, 2, *
, *, 3, *
*, *, *
, *, *, *"
[tile]
pos=1
x,y=1,1
type=!,*^Xo
[/tile]
[tile]
pos=2
x,y=2,2
type=!,*^Xo
[/tile]
[tile]
pos=3
x,y=3,2
type=!,*^Xo
[/tile]
[image]
name=gate-left-down.png
base=90,144
[/image]
[image]
name=gate-middle-down.png
base=144,180
[/image]
[image]
name=gate-right-down.png
base=196,216
[/image]
[/terrain_graphics]
[terrain_graphics]
x,y=11,11
map="
*, *, *
, *, *, *
*, *, *
, 1, *, *
*, 2, *
, *, 3, *
*, *, *
, *, *, *"
[tile]
pos=1
x,y=1,1
type=*^Xo
[/tile]
[tile]
pos=2
x,y=2,2
type=*^Xo
[/tile]
[tile]
pos=3
x,y=3,2
type=*^Xo
[/tile]
# Technically, these animations loop, but only about once per 15 minutes
# so the user should see the loop very rarely.
[image]
name=gate-left-rising-1.png:500,gate-left-rising-2.png:500,gate-left-rising-3.png:500,gate-left-up.png:50000,gate-left-up.png:50000,gate-left-up.png:50000,gate-left-up.png:50000
base=90,144
[/image]
[image]
name=gate-middle-rising-1.png:500,gate-middle-rising-2.png:500,gate-middle-rising-3.png:500,gate-middle-up.png:50000,gate-middle-up.png:50000,gate-middle-up.png:50000,gate-middle-up.png:50000
base=144,180
[/image]
[image]
name=gate-right-rising-1.png:500,gate-right-rising-2.png:500,gate-right-rising-3.png:500,gate-right-up.png:50000,gate-right-up.png:50000,gate-right-up.png:50000,gate-right-up.png:50000
base=196,216
[/image]
[/terrain_graphics]
[/scenario]
#undef GLYPH_ON
#undef GLYPH_OFF