#textdomain wesnoth-l
[scenario]
    id=01_The_Raid
    name= _ "The Raid"
    map_file=01_The_Raid.map
    {TURNS 19 17 15}

    next_scenario=02_Civil_Disobedience

    {INTRO_AND_SCENARIO_MUSIC "transience.ogg" "nunc_dimittis.ogg"}
    {EXTRA_SCENARIO_MUSIC "knolls.ogg"}

    [label]
        x,y=11,1
        text= _ "Dallben"
    [/label]

    [story]
        [part]
            #po: Baldras is an old man from the country and both speaks and writes with many grammatical errors due to his relative lack of education
            #po: He is also a little bit rude and grumpy, so languages with ruder or more informal variants of words should use those where appropriate
            story= _ "From the journal of Baldras, 21 Scatterseed, 501 YW

Months... seven months it’s been since the Crown did send a single guard here to help us. This Garard II be a pompous stinker, even worser than his pa! Us of these border towns Delwyn and Dallben already be poor and needy, yet alls ‘His Majesty’ can think of is tax, tax, tax, takin’ all our hard earned gold from us. Then he uses our gold to provoke more wars with more orcs just for personal glory and more land for them grubby nobles to lord over."
            background=story/frontier.webp
        [/part]
        [part]
            story= _ "To abbadon with the Crown! We got no armies and we don’t even got real weapons, but we of the Western Marches make do just fine with our slings and clubs. In all Annuvin Province, there won’t be nobody besting us in these swamps. We’re self-reliant out here. We gots our own trade routes and pacts of mutual defense. No need for them Wesnothians. Not a single bit."
            background=story/frontier.webp
        [/part]
        [part]
            #po: Some languages, including Norwegian and Old English, don't have a single word for "uncle", dividing it into
            #po: mother's-brother vs. father's-brother. Baldras is Harper's mother's brother.
            #po: Erwen is Baldras' younger sister, so languages with a special word for that should use it
            story= _ "The sun were out today, but it were raining too. Weird mix of brightness and woe. Reminds me of the day Harper’s pa died in that orc raid. Since my sis Erwen passed when she were young, poor lass had nobody but me. Never wanted no kid of my own but... she’s mine to take care of now. Fine lass, that one, just a bit careless like her pa. I needs to keep a good eye on her now, with all them orcs running round here of late."
            background=story/frontier.webp
        [/part]
    [/story]

    {LIBERTY_BIGMAP {JOURNEY_01_NEW} }

    {DEFAULT_SCHEDULE_DUSK}

    [side]
        type=Bandit_Peasant
        id=Baldras
        name= _ "Baldras"
        profile=portraits/baldras.webp
        side=1
        color=blue
        canrecruit=yes
        recruit=
        controller=human
        unrenamable=yes
        experience=25
        gold=0
        [modifications]
            [object]
                duration=forever
                [effect]
                    apply_to=attack
                    name=mace-spiked
                    #textdomain wesnoth-units
                    set_description= _ "mace"
                    set_icon=attacks/mace.png
                    #textdomain wesnoth-l
                [/effect]
            [/object]
            {TRAIT_STRONG}
        [/modifications]
    [/side]

    {STARTING_VILLAGES 1 4}

    [side]
        type=Goblin Pillager
        id=Fal Khag
        name= _ "Fal Khag"
        side=2
        color=orange
        controller=ai
        canrecruit=yes
        facing=sw
        team_name=orcs
        user_team_name=_"Orcs"
        gold=25
        {FLAG_VARIANT6 ragged}
        defeat_condition=no_units_left
    [/side]

    [event]
        name=prestart

        [micro_ai]
            side=2
            ai_type=messenger_escort
            action=add

            [filter]
                id=Fal Khag
            [/filter]
            waypoint_x,waypoint_y=11,1
        [/micro_ai]

        [objectives]
            side=1
            [objective]
                description= _ "Defeat all of the Goblin marauders"
                condition=win
            [/objective]
            [objective]
                description= _ "Goblins reach the village of Dallben"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Baldras"
                condition=lose
            [/objective]
            [objective]
                description= _ "Death of Harper"
                condition=lose
            [/objective]

            {TURNS_RUN_OUT}

            [gold_carryover]
                bonus=yes
                carryover_percentage=100
            [/gold_carryover]
        [/objectives]

        #sign to mark the village location
        {PLACE_IMAGE scenery/signpost.png  11 3}

        #eye candy
        {PLACE_IMAGE items/scarecrow.png 2 3}
        {PLACE_IMAGE items/straw-bale1.png 8 2}
        {PLACE_IMAGE items/straw-bale2.png 9 3}
        {PLACE_IMAGE items/leather-pack.png 1 10}

        {SET_VILLAGE 10 1 1}
        {SET_VILLAGE 12 1 1}

#define DALLBEN_PEASANT TYPE X Y ID_STRING NAME_STRING
    [unit]
        type={TYPE}
        id={ID_STRING}
        name={NAME_STRING}  # wmllint: ignore
        x,y={X},{Y}
        side=1
        random_traits=yes
    [/unit]
#enddef

#define GOBLIN_RAIDER TYPE X Y NAME_STRING
    [unit]
        side=2
        type={TYPE}
        x,y={X},{Y}
        name={NAME_STRING}  # wmllint: ignore
        random_traits=yes
        facing=sw
    [/unit]
#enddef

        {GOBLIN_RAIDER (Wolf Rider) 21 29 ( _ "Gatrakh")}
        {GOBLIN_RAIDER (Goblin Pillager) 19 29 ( _ "Thurg")}

#ifdef EASY
        {GOBLIN_RAIDER (Wolf Rider) 19 30 ( _ "Krung")}
        {GOBLIN_RAIDER (Wolf Rider) 20 29 ( _ "Gorokh")}
#endif

#ifdef NORMAL
        {GOBLIN_RAIDER (Goblin Pillager) 19 30 ( _ "Krung")}
        {GOBLIN_RAIDER (Wolf Rider) 20 29 ( _ "Gorokh")}
#endif

#ifdef HARD
        {GOBLIN_RAIDER (Goblin Pillager) 19 30 ( _ "Krung")}
        {GOBLIN_RAIDER (Goblin Pillager) 20 29 ( _ "Gorokh")}
#endif

#undef GOBLIN_RAIDER

        # now store the good guys so they are invisible during the
        # goblin conversation
        [store_unit]
            variable=goodguys_store
            kill=yes
            [filter]
                side=1
            [/filter]
        [/store_unit]
    [/event]

    # Starting conversation and actions
    [event]
        name=start

        [message]
            speaker=Fal Khag
            message= _ "I long to burn human cities, but that weaselly witch thinks we’re only good enough for these puny villages. These hapless clods barely have anything, but at least the witch’s gold is good."
        [/message]
        [message]
            speaker=Fal Khag
            message= _ "Ride, you worms! Let’s finish our raid before their hunters return."
        [/message]

        #Put the leader back and make some other good guys
        [unstore_unit]
            variable=goodguys_store
        [/unstore_unit]
        {CLEAR_VARIABLE goodguys_store}

        {DALLBEN_PEASANT Footpad_Peasant 8 29 Jalak ( _ "Jalak")}
        [unit]
            type=Footpad_Peasant
            id=Delurin
            name= _ "Delurin"  # wmllint: ignore
            x,y=7,29
            side=1
            [modifications]
                {TRAIT_RESILIENT}
                {TRAIT_INTELLIGENT}
            [/modifications]
        [/unit]
        {DALLBEN_PEASANT Footpad_Peasant 7 27 Red ( _ "Red")}
        {DALLBEN_PEASANT Bandit_Peasant 5 29 Ordo ( _ "Ordo")}
        {DALLBEN_PEASANT Bandit_Peasant 6 30 Novus ( _ "Novus")}
        {DALLBEN_PEASANT Thug_Peasant 7 30 Teneor ( _ "Teneor")}
        {DALLBEN_PEASANT Poacher_Peasant 5 28 Kembe ( _ "Kembe")}
        {DALLBEN_PEASANT Poacher_Peasant 5 30 Treagh ( _ "Treagh")}
        # wmllint: recognize Red
        # wmllint: recognize Kembe

        [unit]
            type=Footpad_Peasant
            id=Harper
            name= _ "Harper"
            gender=female
            profile=portraits/harper.webp
            x,y=8,30
            side=1
            random_traits=no
            [modifications]
                [object]
                    duration=forever
                    [effect]
                        apply_to=attack
                        name=mace-spiked
                        #textdomain wesnoth-units
                        set_description= _ "club"
                        set_icon=attacks/club.png
                        #textdomain wesnoth-l
                    [/effect]
                [/object]
                {TRAIT_LOYAL_HERO}
                {TRAIT_RESILIENT}
                {TRAIT_DEXTROUS}
            [/modifications]
            unrenamable=yes
        [/unit]

        [message]
            speaker=Red
            # po: Other country folk also have accents
            message= _ "Look, goblin riders approach! You was right, they was going to raid Dallben while we was gone."
        [/message]
        [message]
            speaker=Baldras
            message= _ "We gots to stop them or they’ll burn down the whole village. Damn these goblins and damn the Crown. We always be havin’ to fight for ourselves."
        [/message]
        [message]
            speaker=Harper
            # po: Harper has a bit of an accent, but not as much as Baldras. She's a bit reckless as Baldras alludes to, but is more polite.
            # po: Harper is quite the tomboy and her personality should reflect that, she should use words that are exciting and high spirited
            # po: She's also pretty young (teenagerish) so her dialogue should reflect some lack of experience or immaturity
            message= _ "Uncle, we got no time to talk! Them riders are heading full speed straight for Dallben. We’ll need to chase them down through those woods, and fast, or we won’t be able to catch up."
        [/message]
        [message]
            speaker=Baldras
            message= _ "Do it. Hold them beasts back till us old-timers get there to finish ‘em off."
        [/message]
        [message]
            speaker=Baldras
            message= _ "And Harper... don’t be getting reckless on me today. Your old man died like that, charging into a pack of goblins by ‘imself. I won’t lose ya the same way."
        [/message]
        [message]
            speaker=Harper
            message= _ "I know, I know, no need to worry so much. All right, let’s go!"
        [/message]
    [/event]

    #
    # Victory
    #
    [event]
        name=enemies defeated

        {CLEAR_VARIABLE town_guards_awakened}

        [message]
            speaker=Harper
            message= _ "These orc raids keep getting harder and harder to hold off. Feels like every new day’s just another chance for us to lose everything..."
        [/message]
        [message]
            speaker=Baldras
            message= _ "That Garard II stopped sendin’ patrols out here a while back. Stinker probably sent his troops on some new war against them orcs. Don’t really matter. Technically Annuvin be under the charge of Elensefar, but you don’t see ‘em coming to help us either."
        [/message]
        [message]
            speaker=Harper
            message= _ "Then why do we got to pay taxes to the King? Maybe Elensefar doesn’t help us, but at least they don’t take our gold."
        [/message]
        [message]
            speaker=Baldras
            message= _ "We don’t got no choice, lass. If I don’t gives them what they want, they’ll make trouble for everyone in Dallben."
        [/message]
        [message]
            speaker=Harper
            message= _ "But we can’t keep doing this forever, Uncle. If we stay like this, those orcs will eventually overrun us. What should we do?"
        [/message]
        [message]
            speaker=Baldras
            message= _ "I don’t know, Harper. I just don’t know. Alls I can say is we’re on our own out here."
        [/message]

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

    [event]
        name=attack
        [filter]
            id=Harper
        [/filter]
        [filter_second]
            type=Goblin Pillager
        [/filter_second]

        [message]
            speaker=Harper
            # po: Harper has a scar from a fire burn on the right side of her face
            message= _ "My face kinda itches... I gotta be careful around these big ones."
        [/message]
    [/event]

    [event]
        name=attack
        [filter]
            side=2
        [/filter]
        [filter_attack]
            [not]
                type=fire
            [/not]
        [/filter_attack]

        [message]
            speaker=Fal Khag
            message= _ "Time to feast on these puny pinkskins."
        [/message]

        [message]
            speaker=Harper
            message= _ "Hey! Who ya calling puny?"
        [/message]
    [/event]

    [event]
        name=attack
        [filter]
            side=2
        [/filter]
        [filter_attack]
            type=fire
        [/filter_attack]

        [message]
            speaker=Harper
            message= _ "Ahh! I <i>really</i> don’t like fire..."
        [/message]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Fal Khag
        [/filter]

        [message]
            speaker=Fal Khag
            message= _ "I was... too weak..?"
        [/message]

        [message]
            speaker=Harper
            message= _ "Silly goblin."
        [/message]
    [/event]

    # Small buff for Harper

    [event]
        name=moveto
        [filter]
            id=Harper
            x,y=1,10
        [/filter]

        [message]
            speaker=Harper
            message= _ "Hey, someone left their pack here. I could use it to carry some more rocks."
        [/message]

        [sound]
            name=sling.ogg
        [/sound]

        [object]
            id=harper_buff
            take_only_once=yes
            silent=yes
            duration=forever
            [filter]
                x,y=1,10
            [/filter]
            [effect]
                apply_to=attack
                range=ranged
                increase_damage=1
            [/effect]
        [/object]

        {REMOVE_IMAGE 1 10}
    [/event]

    [event]
        name=moveto
        [filter]
            x,y=2,3
        [/filter]

        [message]
            speaker=unit
            message= _ "Spooky."
        [/message]

        [store_unit]
            [filter]
                x,y=2,3
            [/filter]
            variable=stored_unit
        [/store_unit]

        {VARIABLE_OP stored_unit.experience add 2}

        [unstore_unit]
            variable=stored_unit
        [/unstore_unit]

        {CLEAR_VARIABLE stored_unit}
    [/event]

    # Orcs near the villlage

    [event]
        name=moveto
        [filter]
            side=2

            [filter_location]
                x,y=11,2
                radius=12
            [/filter_location]
        [/filter]
        [filter_condition]
            [variable]
                name=town_guards_awakened
                not_equals=yes
            [/variable]
        [/filter_condition]

        [message]
            speaker=Harper
            message= _ "They’re getting close to Dallben! What should we do?"
        [/message]
        [message]
            speaker=Baldras
            message= _ "There be a couple guards in the village. Might be able to slow them wolves down if they gets closer."
        [/message]
    [/event]

    [event]
        name=moveto
        [filter]
            [filter_location]
                x,y=11,2
                radius=9
            [/filter_location]
        [/filter]

        {DALLBEN_PEASANT Thug_Peasant 12 2 Remald ( _ "Remald")}
        {DALLBEN_PEASANT Thug_Peasant 10 2 Wolmas ( _ "Wolmas")}
        # wmllint: recognize Remald
        # wmllint: recognize Wolmas

#ifdef EASY
        {DALLBEN_PEASANT Thug_Peasant 11 4 Jasken ( _ "Jasken")}
#endif

        {IF_VAR unit.side equals 1 (
            [then]
                [message]
                    speaker=Wolmas
                    message= _ "What’s happening here? Why be you running like mad, $unit.name|?"
                [/message]
                [message]
                    speaker=unit
                    message= _ "Goblin riders be on the hunt, headed right for Dallben. We gots to stop them!"
                [/message]
            [/then]

            [else]
                [message]
                    speaker=Wolmas
                    message= _ "Look! Goblin riders be on the hunt, headed right for Dallben!"
                [/message]
                [message]
                    speaker=Remald
                    message= _ "We gots to stop them!"
                [/message]
            [/else]
        )}

        {VARIABLE town_guards_awakened yes}
    [/event]

    #
    # Loss conditions - the orcs reach the village
    #
    [event]
        name=moveto
        [filter]
            side=2
            x=9-13
            y=1-2
        [/filter]
        [message]
            speaker=Harper
            message= _ "The goblins reached the village! Now there’ll be nothing left after they raid our homes..."
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]

    {LIBERTY_DEATHS}
[/scenario]

#undef GOBLIN_RAIDER
#undef DALLBEN_PEASANT
