This file is indexed.

/usr/share/games/wesnoth/1.10/data/campaigns/Liberty/scenarios/05_Hide_and_Seek.cfg is in wesnoth-1.10-l 1:1.10.2-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
#textdomain wesnoth-l
[scenario]
    id=05_Hide_and_Seek
    next_scenario=06_The_Grey_Woods
    victory_when_enemies_defeated=no
    name= _ "Hide and Seek"
    map_data="{campaigns/Liberty/maps/05_Hide_and_Seek.map}"
    {TURNS 34 30 26}

    [time]
        id=midnight
        name= _ "Midnight"
        image=schedule-midnight.png
        lawful_bonus=-25
    [/time]

    {INTRO_AND_SCENARIO_MUSIC wanderer.ogg underground.ogg}
    {EXTRA_SCENARIO_MUSIC revelation.ogg}
    {EXTRA_SCENARIO_MUSIC nunc_dimittis.ogg}
    # the music will change if the guards see you

    [story]
        [part]
            show_title=yes
            {TO_HIDE_AND_SEEK}
        [/part]
    [/story]

    [side]
        type=Bandit
        id=Baldras
        side=1
        canrecruit=yes
        controller=human
        recruit=Thug,Footpad,Poacher
        gold=0
        income=-2
        village_gold=0
        team_name=good_guys
        user_team_name=_"Rebels"
        shroud=no
        fog=yes
        share_maps=no
        share_view=no
    [/side]

    [side]
        type=Master Bowman
        id=Quentin
        name= _ "Quentin"
        side=2
        canrecruit=yes
        controller=ai
        ai_algorithm=idle_ai
        user_team_name=_"Asheviere"
        team_name=bad_guys
        [ai]
            passive_leader=yes
        [/ai]
        shroud=no
        fog=yes
    [/side]

    [side]
        no_leader=yes
        side=3
        color=blue
        controller=ai
        team_name=bad_guys
        user_team_name=_"Asheviere"
        [ai]
            aggression=2.0
            caution=0.0
            grouping=no
            simple_targeting=yes
        [/ai]
        shroud=no
        fog=yes
        {FLAG_VARIANT loyalist}
    [/side]

    {STARTING_VILLAGES_ALL 2}

    [side]
        type=Rogue
        id=Hans
        name= _ "Hans"
        side=4
        color=green
        canrecruit=yes
        controller=ai
        facing=sw
        [ai]
            passive_leader=yes
        [/ai]
        team_name=good_guys
        user_team_name=_"Rebels"
        shroud=no
        fog=yes
        share_maps=no
        share_view=no
        {FLAG_VARIANT ragged}
    [/side]

    #
    # Prestart events
    #
    [event]
        name=prestart

        # {SCATTER_IMAGE (terrain,y=Gg,1-25) 14 scenery/pine1.png}
        {PLACE_IMAGE "scenery/oak-leaning.png~FL(horiz)" 12 37}

        [store_side]
            side=1
            variable=stored_side_1
        [/store_side]

        [objectives]
            side=1
            [objective]
                description= _ "Take Baldras to meet the leader of the insurgency"
                condition=win
            [/objective]
            [objective]
                description= _ "Death of Baldras"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Harper"
                condition=lose
            [/objective]

            {TURNS_RUN_OUT}
        [/objectives]

        #some various city props
        {PLACE_IMAGE scenery/well.png 11 36}

        {PLACE_IMAGE items/scarecrow.png 15 22}

        {PLACE_IMAGE items/straw-bale1.png 1 22}
        {PLACE_IMAGE "items/straw-bale2.png~FL(horiz)" 2 22}
        {PLACE_IMAGE "items/straw-bale1.png~FL(horiz)" 1 23}
        {PLACE_IMAGE items/straw-bale1.png 31 27}

        {PLACE_IMAGE "items/archery-target-right.png~FL(horiz)" 4 44}
        {PLACE_IMAGE "items/archery-target-right.png~FL(horiz)" 6 45}
        {PLACE_IMAGE "items/archery-target-right.png~FL(horiz)" 5 47}

        # Here we preplace a few guards

#define SEEKER X Y TYPE
    [unit]
        type={TYPE}
        generate_name=yes
        x,y={X},{Y}
        side=2
        random_traits=yes
    [/unit]
#enddef

        {SEEKER 3 42 (Iron Mauler)}
        {SEEKER 15 37 (Shock Trooper)}
        {SEEKER 17 38 (Shock Trooper)}
        {SEEKER 2 45 (Bowman)}
        {SEEKER 3 47 (Bowman)}

        # Here we approximate the vision area extending around all units and
        # initialize the loop variables, both of which we need when randomly
        # placing the guards below

        [store_locations]
            [filter]
            [/filter]

            radius=6

            [filter_radius]
                terrain=Gg,R*,Re^Gvs,*^V*,C*
            [/filter_radius]

            variable=total_vision_area
        [/store_locations]

        {VARIABLE guards 1}
        {VARIABLE loops 0}

        # This loop which places most of the guards works like this:
        #
        # - generate a new guard (at 1,1, no real location for it yet)
        # - figure out the vision range of this unit (dependant on unit type and
        #   traits) and a few other helper variables
        # - store all the locations on which the vision range of the new guard
        #   wouldn't touch the vision range of any other unit.
        # - pick one of those locations randomly, and place the new guard there.
        # - pick a random location which satisfies the same condition (but
        #   ignoring the vision range of the new guard) around the new guard,
        #   and place an assistant guard there, so guards are almost always
        #   paired.
        # - update the total vision range with those of the new guards.
        # - repeat until 20 guards are placed or we've repeated 25 times.
        #
        # Note that when calculating vision ranges of units, the vision range is
        # only approximated, by only allowing the simulated vision range to
        # penetrate terrain=Gg,R*,Re^Gvs,*^V*,C*. However, this is a good enough
        # estimate when the map doesn't contain thin walls of other terrains.
        #
        # The result is the map filled with randomly placed pairs of guards,
        # which all have a hex or two of space between their vision ranges, thus
        # allowing the player to sneak through the map without being spotted.
        # It might not be perfect, but it seems to work perfectly most of the
        # time.

        [while]
            [variable]
                name=guards
                less_than=20
            [/variable]

            [variable]
                name=loops
                less_than=25
            [/variable]

            [do]
                {VARIABLE_OP guard_type rand "Shock Trooper"}

                [unit]
                    x,y=1,1
                    side=2
                    type=$guard_type
                    random_traits=yes
                    generate_name=yes
                [/unit]

                [store_unit]
                    [filter]
                        x,y=1,1
                    [/filter]

                    kill=yes
                    variable=stored_guard
                [/store_unit]

                [if]
                    [variable]
                        name=stored_guard.modifications.trait[0].id
                        not_equals=quick
                    [/variable]

                    [variable]
                        name=stored_guard.modifications.trait[1].id
                        not_equals=quick
                    [/variable]

                    [then]
                        {VARIABLE guard_MP $stored_guard.max_moves}
                    [/then]

                    [else]
                        {VARIABLE guard_MP $stored_guard.max_moves}
                        {VARIABLE_OP guard_MP add 1}
                    [/else]
                [/if]

                {VARIABLE guard_vision_range $guard_MP}
                {VARIABLE_OP guard_vision_range add 1}

                {VARIABLE guard_vision_range_plus_1 $guard_vision_range}
                {VARIABLE_OP guard_vision_range_plus_1 add 1}

                {VARIABLE guard_vision_range_plus_3 $guard_vision_range}
                {VARIABLE_OP guard_vision_range_plus_3 add 3}

                [store_locations]
                    [and]
                        find_in=total_vision_area
                        radius=$guard_vision_range_plus_3

                        [filter_radius]
                            terrain=Gg,R*,Re^Gvs,*^V*,C*
                        [/filter_radius]
                    [/and]

                    [not]
                        find_in=total_vision_area
                        radius=$guard_vision_range_plus_1

                        [filter_radius]
                            terrain=Gg,R*,Re^Gvs,*^V*,C*
                        [/filter_radius]
                    [/not]

                    [and]
                        terrain=Gg,R*,Re^Gvs,*^V*,C*
                    [/and]

                    variable=new_guard_locations
                [/store_locations]

                {IF_VAR new_guard_locations.length greater_than 0 (
                    [then]
                        {VARIABLE_OP random_i rand "1..$new_guard_locations.length"}
                        {VARIABLE_OP random_i sub 1}

                        {VARIABLE stored_guard.x $new_guard_locations[$random_i].x}
                        {VARIABLE stored_guard.y $new_guard_locations[$random_i].y}

                        [unstore_unit]
                            variable=stored_guard
                        [/unstore_unit]

                        [store_locations]
                            [and]
                                x,y=$stored_guard.x,$stored_guard.y
                                radius=2
                            [/and]

                            [not]
                                find_in=total_vision_area
                                radius=7

                                [filter_radius]
                                    terrain=Gg,R*,Re^Gvs,*^V*,C*
                                [/filter_radius]
                            [/not]

                            [not]
                                terrain=*^F*,Hh,Ww,Wo,Ss,Ds
                            [/not]

                            variable=new_assistant_guard_locations
                        [/store_locations]

                        {IF_VAR new_assistant_guard_locations.length greater_than 0 (
                            [then]
                                {VARIABLE_OP random_i rand "1..$new_assistant_guard_locations.length"}
                                {VARIABLE_OP random_i sub 1}

                                {VARIABLE_OP assistant_guard_type rand "Shock Trooper,Shock Trooper,Iron Mauler,Javelineer,Swordsman,Pikeman"}

                                [unit]
                                    type=$assistant_guard_type
                                    side=2
                                    x,y=$new_assistant_guard_locations[$random_i].x,$new_assistant_guard_locations[$random_i].y
                                    generate_name=yes
                                    random_traits=yes
                                [/unit]

                                [store_locations]
                                    [and]
                                        x,y=$new_assistant_guard_locations[$random_i].x,$new_assistant_guard_locations[$random_i].y
                                        radius=6

                                        [filter_radius]
                                            terrain=Gg,R*,Re^Gvs,*^V*,C*
                                        [/filter_radius]
                                    [/and]

                                    [or]
                                        find_in=total_vision_area
                                    [/or]

                                    variable=total_vision_area
                                [/store_locations]
                            [/then]
                        )}

                        [store_locations]
                            [and]
                                x,y=$stored_guard.x,$stored_guard.y
                                radius=$guard_vision_range

                                [filter_radius]
                                    terrain=Gg,R*,Re^Gvs,*^V*,C*
                                [/filter_radius]
                            [/and]

                            [or]
                                find_in=total_vision_area
                            [/or]

                            variable=total_vision_area
                        [/store_locations]

                        {VARIABLE_OP guards add 1}
                    [/then]
                )}

                {VARIABLE_OP loops add 1}
            [/do]
        [/while]

        {CLEAR_VARIABLE total_vision_area}
        {CLEAR_VARIABLE new_guard_locations}
        {CLEAR_VARIABLE new_assistant_guard_locations}
        {CLEAR_VARIABLE guard_type}
        {CLEAR_VARIABLE assistant_guard_type}
        {CLEAR_VARIABLE stored_guard}
        {CLEAR_VARIABLE guard_MP}
        {CLEAR_VARIABLE guard_vision_range}
        {CLEAR_VARIABLE guard_vision_range_plus_1}
        {CLEAR_VARIABLE guard_vision_range_plus_3}
        {CLEAR_VARIABLE guards}
        {CLEAR_VARIABLE loops}

        [store_unit]
            [filter]
                id=Baldras
            [/filter]

            kill=yes
            variable=stored_Baldras
        [/store_unit]

        [unit]
            side=1
            type=Boat
            id=Boat
            x,y=1,4
        [/unit]

        [hide_unit]
            x,y=1,4
        [/hide_unit]

        [item]
            x,y=1,4
            image=units/transport/boat.png
        [/item]
    [/event]

    #
    # Starting conversation and actions
    #
    [event]
        name=start

        [message]
            speaker=narrator
            message= _ "Relentlessly pursued by riders patrolling the road to Elensefar, Baldras and his men traveled unseen along the swampy banks of the Great River to the city of Carcyn."
            image="wesnoth-icon.png"
        [/message]
        [message]
            speaker=narrator
            message= _ "They hid until nightfall, then crept out to find the help Lord Maddock hinted was here."
            image="wesnoth-icon.png"
        [/message]

        [kill]
            x,y=1,4
            animate=no
            fire_event=no
        [/kill]

        [remove_item]
            x,y=1,4
        [/remove_item]

        [move_unit_fake]
            side=1
            type=Boat
            x=1,7
            y=4,5
        [/move_unit_fake]

        [item]
            x,y=7,5
            image=units/transport/boat.png
        [/item]

        [move_unit_fake]
            side=1
            type=$stored_Baldras.type
            x=7,7
            y=5,6
        [/move_unit_fake]

        [unstore_unit]
            variable=stored_Baldras
        [/unstore_unit]

        [redraw]
            side=1
        [/redraw]

        [recall]
            id=Harper
            x,y=8,5
        [/recall]

        [message]
            speaker=Baldras
            message= _ "I’m not sure where we’re supposed to go now. If we go into town we can start asking around for information."
        [/message]

        [move_unit_fake]
            type=Thief
            side=4
            x=7,6
            y=9,6
        [/move_unit_fake]

        [unit]
            type=Thief
            side=4
            x,y=6,6
            random_traits=yes
            id=Link
            name= _ "Link"
        [/unit]

        [message]
            speaker=Baldras
            message= _ "Who are you?"
        [/message]
        [message]
            speaker=Link
            message= _ "I have come to find you. You must make it through the city without being seen. The soldiers are normally out hunting for my kind, but a company of heavy infantry arrived three days ago and took over the patrols."
        [/message]
        [message]
            speaker=Harper
            message= _ "They’re looking for us."
        [/message]
        [message]
            speaker=Link
            message= _ "Well, good thing I found you first. Now hurry, you must make it past the city into the Grey Woods. There is a small path in the southeast that leads into the forest; look for the signpost. My brother Hans is waiting for you there and will take you to our master. Try to avoid the soldiers if you can."
        [/message]

        {HIGHLIGHT_IMAGE 26 48 scenery/signpost.png ()}

        [scroll_to_unit]
            id=Baldras
        [/scroll_to_unit]

        {MOVE_UNIT id=Link 5 8}

        [kill]
            id=Link
            animate=no
            fire_event=no
        [/kill]

        [redraw]
        [/redraw]

        {CLEAR_VARIABLE stored_Baldras}
    [/event]

    [event]
        name=sighted
        [filter]
            side=2
        [/filter]
        [filter_second]
            side=1
        [/filter_second]

        [redraw]
            side=1
        [/redraw]

        [message]
            speaker=second_unit
            message= _ "Looks like these guards hold stationary posts, so if we’re careful enough we should be able to slip our way around them unnoticed."
        [/message]
        [message]
            speaker=Baldras
            message= _ "Harper, you younger and faster folks need to be our eyes now. Scout ahead and try to find a way for us to get past the guards, but make sure to not stay where they can see you or we’re all in big trouble..."
        [/message]
    [/event]

    [event]
        name=side turn
        first_time_only=no

        [if]
            [variable]
                name=side_number
                equals=2
            [/variable]

            [then]
                [if]
                    [have_unit]
                        side=1

                        [filter_vision]
                            visible=yes
                            viewing_side=2
                        [/filter_vision]

                        [or]
                            side=1

                            [filter_vision]
                                visible=yes
                                viewing_side=3
                            [/filter_vision]
                        [/or]
                    [/have_unit]

                    [then]
                        # if player is visible to enemies, flip all nearby enemies to side 3,
                        # which is the aggressive side and thus the nearby enemies will begin
                        # to pursue the player

                        [store_unit]
                            [filter]
                                side=2

                                [filter_location]
                                    [filter]
                                        side=1
                                    [/filter]

                                    {QUANTITY radius 8 11 13}
                                [/filter_location]
                            [/filter]

                            kill=yes
                            variable=side_2_units_nearby
                        [/store_unit]

                        {FOREACH side_2_units_nearby i}
                            {VARIABLE side_2_units_nearby[$i].side 3}

                            [unstore_unit]
                                variable=side_2_units_nearby[$i]
                                find_vacant=no
                            [/unstore_unit]
                        {NEXT i}

                        {CLEAR_VARIABLE side_2_units_nearby}
                    [/then]

                    [else]
                        # if player isn't seen by enemies anymore, make all enemies idle again

                        {MODIFY_UNIT side=3 side 2}
                    [/else]
                [/if]
            [/then]
        [/if]
    [/event]

    [event]
        name=moveto
        [filter]
            side=3
        [/filter]

        {INCIDENTAL_MUSIC vengeful.ogg}

        [message]
            speaker=Harper
            message= _ "They’ve seen us! <i>Run</i>!"
        [/message]
    [/event]

    [event]
        name=attack_end
        [filter]
            side=2
        [/filter]
        [filter_second]
            side=1
        [/filter_second]

        {IF_VAR $second_unit.hitpoints greater_than 0 (
            [then]
                [message]
                    speaker=Baldras
                    message= _ "Fall back, quickly! Maybe we can yet lose them!"
                [/message]
            [/then]
        )}
    [/event]

    [event]
        name=sighted
        [filter]
            id=Hans
        [/filter]
        [filter_second]
            side=1
        [/filter_second]
        [message]
            speaker=unit
            message= _ "Gentlemen, please come this way and follow the path into the forest. Our leader is anxious to meet you."
        [/message]
        [message]
            speaker=second_unit
            message= _ "As soon as we escape the Wesnoth death squad, we will be happy to oblige."
        [/message]
        [message]
            speaker=Baldras
            message= _ "I haven’t run this much in years. If you were to ask me to infiltrate a heavily guarded city relying on nothing but the cover of darkness and my wits, I would say you were crazy."
        [/message]
        [message]
            speaker=Baldras
            message= _ "As it turns out, I’m the crazy one. Let’s finish this folly."
        [/message]
    [/event]

    #
    # Special event - if someone besides Baldras goes to the end, you get a
    # message
    #
    [event]
        name=moveto

        [filter]
            side=1

            [filter_adjacent]
                id=Hans
            [/filter_adjacent]

            [not]
                id=Baldras
            [/not]
        [/filter]

        [message]
            speaker=Hans
            message= _ "You can come if you wish, but the leader is only interested in speaking to Baldras."
        [/message]

        [allow_undo][/allow_undo]
    [/event]

    #
    # Victory
    #
    [event]
        name=moveto

        [filter]
            x=26
            y=48
            id=Baldras
        [/filter]

        [message]
            speaker=Hans
            message= _ "Fly, and we may yet evade them in the Grey Woods."
        [/message]

        [message]
            speaker=Baldras
            message= _ "Lead the way."
        [/message]

        [modify_side]
            side=1
            gold=$stored_side_1.gold
        [/modify_side]

        {CLEAR_VARIABLE stored_side_1}

        [endlevel]
            result=victory
            bonus=no
            {NEW_GOLD_CARRYOVER 100}
        [/endlevel]
    [/event]

    #
    # Loss conditions - turns run out
    #
    [event]
        name=time over
        [message]
            speaker=Baldras
            message= _ "We have spent too much time here. Surely the Queen’s forces have returned to Dallben. Our mission is unfinished, but we must return to fight a suicide battle."
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]

    {LIBERTY_DEATHS}

    {VILLAGE_BURNED}
[/scenario]