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

    {INTRO_AND_SCENARIO_MUSIC "traveling_minstrels.ogg" "loyalists.ogg"}
    {EXTRA_SCENARIO_MUSIC "battle.ogg"}
    {EXTRA_SCENARIO_MUSIC "nunc_dimittis.ogg"}
    {EXTRA_SCENARIO_MUSIC "the_dangerous_symphony.ogg"}

    {LIBERTY_BIGMAP {JOURNEY_02_NEW} }

    [side]
        type=Bandit_Peasant
        id=Baldras
        name= _ "Baldras"
        side=1
        canrecruit=yes
        controller=human
        gold=100
        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
        canrecruit=yes
        controller=ai
        gold=0
        team_name=bad_guys
        user_team_name=_"Asheviere"
        [ai]
            [goal]
                name=protect_location
                [criteria]
                    x,y=30,7
                [/criteria]
                protect_radius=11
                value=10
            [/goal]
        [/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
        no_leader=yes
        controller=ai
        team_name=good_guys
        user_team_name=_"Rebels"
    [/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 33 13}
        {PLACE_IMAGE "items/scarecrow.png~FL(horiz)" 22 1}

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

        {PLACE_IMAGE "scenery/oak-leaning.png" 31 9}

        {GENERIC_UNIT 3 Peasant 21 4}
        {GENERIC_UNIT 3 Peasant 26 3}
        {GENERIC_UNIT 3 Peasant 29 6}
        {GENERIC_UNIT 3 Peasant 30 8}
        {GENERIC_UNIT 3 Peasant 27 13}

        {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, nephew."
        [/message]

        {MOVE_UNIT id=Tarwen 7 9}

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

        [message]
            speaker=Tarwen
            message= _ "By order of the Queen, the magistrate of this town is ordered to travel with us to Elensefar for vetting."
        [/message]
        [message]
            speaker=Harper
            message= _ "Garard is the King of Wesnoth. We are ruled by no queen."
        [/message]
        [message]
            speaker=Tarwen
            message= _ "Insolent peasants, you will kneel before your betters! Asheviere is the Queen of Wesnoth. The King fell three weeks ago at Abez. I shall not bandy words with you. Your magistrate will be coming with us, and we do not care if it is dead or alive."
        [/message]

        {GENERIC_UNIT 2 Cavalryman 19 7}
        {MOVE_UNIT x,y=19,7 24 6}

        {GENERIC_UNIT 2 Cavalryman 19 7}
        {MOVE_UNIT x,y=19,7 24 8}

        {GENERIC_UNIT 2 Cavalryman 19 7}
        {MOVE_UNIT x,y=19,7 26 8}

        {GENERIC_UNIT 2 Cavalryman 19 7}
        {MOVE_UNIT x,y=19,7 26 6}

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

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

        {GENERIC_UNIT 2 Horseman 19 7}
        {MOVE_UNIT x,y=19,7 22 9}

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

        {GENERIC_UNIT 2 Spearman 18 6}
        {MOVE_UNIT x,y=18,6 20 6}

        {GENERIC_UNIT 2 Spearman 18 7}
        {MOVE_UNIT x,y=18,7 20 7}

        {MOVE_UNIT id=Tarwen 12 8}

        [message]
            speaker=Baldras
            message= _ "Harper, get out of here. This is no battle for you."
        [/message]

        [message]
            speaker=Baldras
            message= _ "I am the magistrate of Dallben, and it is <i>you</i> who will be leaving Dallben, be it dead or alive."
        [/message]
    [/event]

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

        [message]
            speaker=Tarwen
            message= _ "Get back, you cur!"
        [/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

        [message]
            speaker=Baldras
            message= _ "Our lives were hard enough when we were beneath the attention of the Crown. But now I fear things will be worse."
        [/message]

        [message]
            speaker=Harper
            message= _ "We must tell the people of Delwyn about this."
        [/message]

        [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= _ "That is true. We have always flown to their aid, and they to ours. This is something we should face together."
        [/message]

        [message]
            speaker=Baldras
            message= _ "Very well. We will go to Delwyn and share counsel with them. I never thought Wesnoth would fall into darkness. Now, not only do the orcs threaten our lands, but some sinister thing is happening with the ascent of the Queen to the throne."
        [/message]

        [message]
            speaker=Baldras
            message= _ "Today we may no longer be citizens of Wesnoth. I wish it could be otherwise, but we are now 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
                    overlays=$this_item.overlays
                    random_traits=$this_item.random_traits
                    role=$this_item.role

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

        {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
        [message]
            speaker=Baldras
            message= _ "Oh, no! We have run out of time, they have arrived with reinforcements..."
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]

    [event]
        name=defeat

        [message]
            speaker=narrator
            image=wesnoth-icon.png
            message=_ "They would be remembered only as traitors rightly put down by the Queen’s lances. And in the dark years to come, woe betide any who questioned it."
        [/message]
    [/event]

    {LIBERTY_DEATHS}
[/scenario]
