#textdomain wesnoth-l
[scenario]
    id=02_Civil_Disobedience
    name= _ "Civil Disobedience"
    next_scenario=03_A_Strategy_of_Hope
    map_file=02_Civil_Disobedience.map
    {TURNS 14 13 12}
    {DEFAULT_SCHEDULE_AFTERNOON}

    {INTRO_AND_SCENARIO_MUSIC "revelation.ogg" "loyalists.ogg"}
    {EXTRA_SCENARIO_MUSIC "battle.ogg"}
    {EXTRA_SCENARIO_MUSIC "siege_of_laurelmor.ogg"}

    [label]
        x,y=31,13
        text= _ "Baldras’ farm"
    [/label]

    [story]
        [part]
            story= _ "Baldras’ journal, 6 Deeproot, 501 YW:

Me and Harper visited Erwen’s grave today. I helped the lass pick her a bunch of flowers — we even found some of her favorite, blue lilies. Harper don’t remember her much, but still thinks lots about her. Lass reminds me so much of her ma often times, real bright and brassy, even if she don’t got the same sense or wits. I’m just hoping she be learning more with time."
            background=story/frontier.webp
        [/part]
        [part]
            story= _ "Speaking of sense, I gots me a bad feeling in my gut about today. I’d better ready our hunting troop when I get back to the village, just in case..."
            background=story/frontier.webp
        [/part]
    [/story]

    {LIBERTY_BIGMAP {JOURNEY_02_NEW} }

    [side]
        type=Bandit_Peasant
        id=Baldras
        name= _ "Baldras"
        side=1
        color=blue
        canrecruit=yes
        controller=human
        {GOLD 170 140 110}
        team_name=good_guys
        user_team_name=_"Rebels"
        recruit=Footpad_Peasant,Poacher_Peasant,Thug_Peasant
    [/side]

    {STARTING_VILLAGES 1 12}

    [side]
        type=Cavalier
        id=Tarwen
        name= _ "Tarwen"
        side=2
        color=red
        canrecruit=yes
        controller=ai
        gold=0
        team_name=bad_guys
        user_team_name=_"Weldyn"
        [ai]
            [goal]
                name=protect_location
                [criteria]
                    x,y=26,7
                [/criteria]
                protect_radius=11
                value=10
            [/goal]
            passive_leader=yes
        [/ai]
        {FLAG_VARIANT loyalist}
    [/side]

    #The peasants - no leader or keep, but they help you as allies
    #by getting trampled on the first turn
    [side]
        side=3
        color=lightblue
        no_leader=yes
        controller=ai
        team_name=good_guys
        user_team_name=_"Rebels"
        [ai]
            caution=0.9
            aggression=0.1
        [/ai]
    [/side]

    [event]
        name=prestart

        [objectives]
            side=1
            [objective]
                description= _ "Kill the Wesnoth army captain, Tarwen"
                condition=win
            [/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=40
            [/gold_carryover]
        [/objectives]

        {PLACE_IMAGE items/scarecrow.png 29 13}
        {PLACE_IMAGE "items/scarecrow.png~FL(horiz)" 18 1}

        {PLACE_IMAGE items/straw-bale1.png 32 14}
        {PLACE_IMAGE items/straw-bale2.png 33 6}
        {PLACE_IMAGE "items/straw-bale1.png~FL(horiz)" 15 5}
        {PLACE_IMAGE items/grain-sheaf.png 19 12}

        {PLACE_IMAGE "scenery/oak-leaning.png" 27 9}
        {PLACE_IMAGE "scenery/well.png" 22 7}

        {PLACE_IMAGE "items/mace.png" 31 14}

        {GENERIC_UNIT 3 Peasant 17 4}
        {GENERIC_UNIT 3 Peasant 22 3}
        {GENERIC_UNIT 3 Peasant 25 6}
        {GENERIC_UNIT 3 Peasant 26 8}
        {GENERIC_UNIT 3 Peasant 23 13}
        {GENERIC_UNIT 3 Peasant 33 5}
        {GENERIC_UNIT 3 Peasant 31 3}
        {GENERIC_UNIT 3 Peasant 35 12}

        {MODIFY_UNIT type=Peasant facing sw}
    [/event]

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

        [recall]
            id=Harper
        [/recall]
        [message]
            speaker=Harper
            message= _ "Look, riders approach."
        [/message]
        [message]
            speaker=Baldras
            message= _ "Stand fast, Harper."
        [/message]

        {MOVE_UNIT id=Tarwen 4 10}

        [capture_village]
            x=2-11
            y=6-11
            side=2
        [/capture_village]

        [message]
            speaker=Tarwen
            message= _ "By order of the Queen, the magistrate of this town is to travel with us to Elensefar for vetting."
        [/message]
        [message]
            speaker=Baldras
            message= _ "The Crown did long since abandon our village. You Wesnothians be too busy countin’ the gold from our taxes to be sending aid against them orcs. Nobody here be leaving to nowhere."
        [/message]
        [message]
            speaker=Tarwen
            message= _ "Insolent peasant. Try not my patience, else I shall be forced to drag thy deceased corpse back with me to the city."
        [/message]
        [message]
            speaker=Baldras
            message= _ "Try it then, stinker."
        [/message]
        [message]
            speaker=Tarwen
            message= _ "As you wish."
        [/message]

        {GENERIC_UNIT 2 Cavalryman 15 7}
        {MOVE_UNIT x,y=15,7 20 6}

        {GENERIC_UNIT 2 Cavalryman 15 7}
        {MOVE_UNIT x,y=15,7 20 8}

        {GENERIC_UNIT 2 Cavalryman 15 7}
        {MOVE_UNIT x,y=15,7 22 8}

        {GENERIC_UNIT 2 Cavalryman 15 7}
        {MOVE_UNIT x,y=15,7 22 6}

#ifdef NORMAL
        {GENERIC_UNIT 2 Horseman 15 7}
        {MOVE_UNIT x,y=15,7 19 5}

        {GENERIC_UNIT 2 Horseman 15 7}
        {MOVE_UNIT x,y=15,7 18 9}
#endif
#ifdef HARD
        {GENERIC_UNIT 2 Horseman 15 7}
        {MOVE_UNIT x,y=15,7 19 5}

        {GENERIC_UNIT 2 Horseman 15 7}
        {MOVE_UNIT x,y=15,7 18 9}

        {GENERIC_UNIT 2 Horseman 15 7}
        {MOVE_UNIT x,y=15,7 18 6}
#endif
        [message]
            speaker=Tarwen
            message= _ "Guard the gate."
        [/message]

        {GENERIC_UNIT 2 Spearman 14 6}
        {MOVE_UNIT x,y=14,6 16 6}

        {GENERIC_UNIT 2 Spearman 14 7}
        {MOVE_UNIT x,y=14,7 16 7}

        {MOVE_UNIT id=Tarwen 8 8}

        [message]
            speaker=Harper
            message= _ "<i>Uncle, since when did we have a queen?</i>"
        [/message]
        [message]
            speaker=Baldras
            message= _ "<i>Since a few years back, I thinks, but weren’t never her giving out no orders...</i>"
        [/message]
        [message]
            speaker=Baldras
            message= _ "<i>It don’t really matter right now. Harper, get yerself out o’ here. This be no kind of battle for you.</i>"
        [/message]
        [message]
            speaker=Harper
            message= _ "I can fight!"
        [/message]
        [message]
            speaker=Baldras
            message= _ "<i>Harper, do what I says to ya.</i>"
        [/message]
        [message]
            speaker=Harper
            message= _ "We’re in this together. Death to the Wesnothians!"
        [/message]
        [message]
            speaker=Baldras
            message= _ "Impulsive lass..."
        [/message]
    [/event]

    [event]
        name=attack
        [filter_second]
            side=3
        [/filter_second]

        [message]
            speaker=second_unit
            #po: this is from Monty Python and the Holy Grail :)
            message= _ "Help, help! I’m being repressed!"
        [/message]
    [/event]

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

        [message]
            speaker=Harper
            message= _ "They just killed an innocent man! Murderers!"
        [/message]

        [message]
            speaker=Tarwen
            message= _ "Cry thine eyes out for me, peasant."
        [/message]
    [/event]

    [event]
        name=moveto
        [filter]
            id=Baldras
            x,y=31,14
        [/filter]

        [message]
            speaker=Baldras
            message= _ "I oughta bring out the good mace to fight off these thugs."
        [/message]

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

        [object]
            id=baldras_buff
            take_only_once=yes
            silent=yes
            duration=forever
            [filter]
                x,y=31,14
            [/filter]
            [effect]
                apply_to=attack
                range=melee
                increase_damage=1
            [/effect]
        [/object]

        {REMOVE_IMAGE 31 14}
    [/event]

    #
    #Special event - when you attack Tarwen, he stops being passive (surprise!)
    #
    [event]
        name=attack
        [filter_second]
            id=Tarwen
        [/filter_second]

        [modify_side]
            [filter_side]
                side=2
            [/filter_side]

            [ai]
                passive_leader=no
            [/ai]
        [/modify_side]

        [message]
            speaker=Tarwen
            message= _ "Back, back ye curs!"
        [/message]
    [/event]

    [event]
        name=die
        [filter]
            side=2
        [/filter]

        [message]
            speaker=Harper
            message= _ "Take that, you bullies!"
        [/message]
    [/event]
    #
    # Victory
    #
    [event]
        name=die
        [filter]
            id=Tarwen
        [/filter]

        [message]
            speaker=second_unit
            message= _ "Get out of my village!"
        [/message]

        [kill]
            side=2
        [/kill]
    [/event]

    [event]
        name=enemies defeated

        [if]
            [have_unit]
                side=3
                count=3-99999
            [/have_unit]
            [then]
                [set_achievement]
                    content_for=liberty
                    id="liberty_or_death"
                [/set_achievement]
            [/then]
        [/if]

        [role]
            type=Huntsman_Peasant,Ranger,Fugitive_Peasant,Highwayman_Peasant,Outlaw_Peasant,Trapper_Peasant,Bandit_Peasant,Footpad_Peasant,Poacher_Peasant,Thug_Peasant
            [not]
                id=Harper,Baldras
            [/not]
            role=Advisor
        [/role]

        [message]
            role=Advisor
            message= _ "We beat their leader, but a couple of them riders escaped. What should we do?"
        [/message]

        [message]
            speaker=Baldras
            message= _ "Somethin’ be very wrong here. That Garard weren’t never no hero or nothing, but his men never would’ve attacked us. The Queen must’ve did something to him."
        [/message]

        [message]
            speaker=Harper
            #wmllint: local spelling ol'
            message= _ "We’ve got to tell the people of Delwyn about this. Ol’ magistrate Relana will have some ideas."
        [/message]

        [message]
            role=Advisor
            message= _ "That’s true. Whenever there’s been troubles, we’ve always looked to her for help."
        [/message]

        [message]
            speaker=Baldras
            message= _ "Fine. We’ll go to Delwyn, see what Relana gots to say. With them riders so eagerly attackin’ us today, I’m thinking Delwyn will be under threat too."
        [/message]

        [message]
            speaker=Harper
            message= _ "So we’ll have to fight them Wesnothians again?"
        [/message]

        [message]
            speaker=Baldras
            message= _ "Alls I can say for certain is we’ve made ourselves enemies of the Crown. They’ll be hunting us now."
        [/message]

        [message]
            speaker=Harper
            message= _ "Then we’re outlaws."
        [/message]

        [message]
            speaker=Baldras
            message= _ "Aye, outlaws."
        [/message]

        [store_unit]
            [filter]
                side=1

                [filter_wml]
                    [abilities]
                        [outlaw_type_hack]
                        [/outlaw_type_hack]
                    [/abilities]
                [/filter_wml]
            [/filter]

            kill=yes
            variable=stored_peasants
        [/store_unit]

        [foreach]
            array=stored_peasants
            [do]
                [unit]
                    side=1
                    type=$this_item.abilities.outlaw_type_hack.id
                    id=$this_item.id
                    name=$this_item.name
                    x,y=$this_item.x,$this_item.y
                    hitpoints=$this_item.hitpoints
                    moves=$this_item.moves
                    experience=$this_item.experience
                    gender=$this_item.gender
                    facing=$this_item.facing
                    profile=$this_item.profile
                    unrenamable=$this_item.unrenamable
                    canrecruit=$this_item.canrecruit
                    random_traits=$this_item.random_traits
                    role=$this_item.role

                    [insert_tag]
                        name=modifications
                        variable=this_item.modifications
                    [/insert_tag]
                [/unit]
            [/do]
        [/foreach]

        [modify_side]
            side=1
            color=black
        [/modify_side]

        {CLEAR_VARIABLE stored_peasants}

        [disallow_recruit]
            side=1
            type=Thug_Peasant,Footpad_Peasant,Poacher_Peasant
        [/disallow_recruit]
        [allow_recruit]
            side=1
            type=Thug,Footpad,Poacher
        [/allow_recruit]
        [endlevel]
            result=victory
            bonus=yes
            {NEW_GOLD_CARRYOVER 40}
        [/endlevel]
    [/event]

    #
    # Loss conditions - turns run out
    #
    [event]
        name=time over

        [unit]
            type=Knight
            side=2
            x,y=4,11
            id=Reinforcement Knight
            generate_name=yes
            animate=yes
            facing=ne
        [/unit]
        {GENERIC_UNIT 2 (Knight)       3 12} {FACING ne}
        {GENERIC_UNIT 2 (Lancer)       4 12} {FACING ne}
        {GENERIC_UNIT 2 (Lancer)       3 13} {FACING ne}
        {GENERIC_UNIT 2 (Knight) 4 13} {FACING ne}
        {GENERIC_UNIT 2 (Dragoon) 3 14} {FACING ne}
        {GENERIC_UNIT 2 (Dragoon) 4 14} {FACING ne}

        [message]
            speaker=Reinforcement Knight
            message= _ "At your order, Captain."
        [/message]
        [message]
            speaker=Tarwen
            message= _ "Slay them all."
        [/message]
        [message]
            speaker=Baldras
            message= _ "Curses! Their reinforcements has arrived. We gots no chance to fight ‘em off now..."
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]

    {LIBERTY_DEATHS}
[/scenario]
