#textdomain wesnoth-Genesis
[scenario]
    id=13_Blood_Sea
    name= _ "Blood Sea"
    map_data="{~add-ons/Genesis/episode1/maps/13_Blood_Sea.map}"
    next_scenario=14_Iron_Crescent
    victory_when_enemies_defeated=no
    disallow_recall=yes
    turns=25
    {ETERNALDARK}

    {SCENARIO_MUSIC snowfall.ogg}
    {EXTRA_SCENARIO_MUSIC returning_in_time.ogg}
    {EXTRA_SCENARIO_MUSIC underground.ogg}

    [side]
        {PLAYER_FAE}
        side=1
        recruit=
        {GOLD 370 320 220}
        {NO_INCOME_SIDE}
        fog=yes
        shroud=yes
    [/side]

    [side]
        {YUURE_SIDE}
        side=2
        fog=no
        shroud=no
        [ai]
            aggression=1
            caution=0
            grouping=false
            [goal]
                [criteria]
                    id=Yumi
                [/criteria]
                value=200
            [/goal]
            [goal]
                [criteria]
                    id=Aryel
                [/criteria]
                value=200
            [/goal]
            [goal]
                [criteria]
                    side=3
                [/criteria]
                value=-1000
            [/goal]
        [/ai]
    [/side]
    [side]
        {BLACK_DEMON_SIDE}
        side=3
        fog=no
        shroud=no
        [ai]
            aggression=1
            caution=0
            grouping=false
            [goal]
                [criteria]
                    id=Yumi
                [/criteria]
                value=200
            [/goal]
            [goal]
                [criteria]
                    id=Aryel
                [/criteria]
                value=200
            [/goal]
            [goal]
                [criteria]
                    side=3
                [/criteria]
                value=-1000
            [/goal]
        [/ai]
    [/side]

#define CAVE_WALL_SEED
        [store_locations]
            variable=blood_hex
            terrain=Wwb
            [and]
                [not]
                    [filter_adjacent_location]
                        terrain=Xu,Xue
                    [/filter_adjacent_location]
                [/not]
            [/and]
            [and]
                [not]
                    [filter]
                    [/filter]
                [/not]
            [/and]
        [/store_locations]
        [for]
            array=blood_hex
            [do]
                [set_variable]
                    name=change_terrain
                    rand=1..50
                [/set_variable]
                [if]
                    [variable]
                        name=change_terrain
                        less_than=6
                    [/variable]
                    [then]
                        [terrain]
                             x,y=$blood_hex[$i].x,$blood_hex[$i].y
                            terrain=Xu
                        [/terrain]
                    [/then]
                [/if]
                {CLEAR_VARIABLE change_terrain}
            [/do]
        [/for]
        {CLEAR_VARIABLE blood_hex}
        [redraw][/redraw]
#enddef

#define TERRAIN_GEN1
        [store_locations]
            variable=blood_hex
            terrain=Wwb
            [and]
                [not]
                    [filter_adjacent_location]
                        terrain=Xue
                    [/filter_adjacent_location]
                [/not]
            [/and]
            [and]
                [not]
                    [filter]
                    [/filter]
                [/not]
            [/and]
        [/store_locations]
        [for]
            array=blood_hex
            [do]
                [set_variable]
                    name=change_terrain
                    rand=1..60
                [/set_variable]
                [if]
                    [variable]
                        name=change_terrain
                        less_than=3
                    [/variable]
                    [then]
                        [terrain]
                             x,y=$blood_hex[$i].x,$blood_hex[$i].y
                            terrain=Qxv
                        [/terrain]
                    [/then]
                [/if]
                {CLEAR_VARIABLE change_terrain}
            [/do]
        [/for]
        {CLEAR_VARIABLE blood_hex}
#enddef

#define TERRAIN_GEN2
        [store_locations]
            variable=blood_hex
            terrain=Wwb
            [and]
                [filter_adjacent_location]
                    terrain=Qxv
                [/filter_adjacent_location]
            [/and]
            [and]
                [not]
                    [filter_adjacent_location]
                        terrain=Xue
                    [/filter_adjacent_location]
                [/not]
            [/and]
            [and]
                [not]
                    [filter]
                    [/filter]
                [/not]
            [/and]
        [/store_locations]
        [for]
            array=blood_hex
            [do]
                [set_variable]
                    name=change_terrain
                    rand=1..10
                [/set_variable]
                [if]
                    [variable]
                        name=change_terrain
                        less_than=3
                    [/variable]
                    [then]
                        [terrain]
                             x,y=$blood_hex[$i].x,$blood_hex[$i].y
                            terrain=Qxv
                        [/terrain]
                    [/then]
                [/if]
                {CLEAR_VARIABLE change_terrain}
            [/do]
        [/for]
        {CLEAR_VARIABLE blood_hex}
        [redraw][/redraw]
#enddef
#define REGEN_ABYSS
        [store_locations]
            variable=blood_hex
            terrain=Wwb
            [and]
                [not]
                    [filter]
                    [/filter]
                [/not]
            [/and]
        [/store_locations]
        [for]
            array=blood_hex
            [do]
                [set_variable]
                    name=change_terrain
                    rand=1..300
                [/set_variable]
                [if]
                    [variable]
                        name=change_terrain
                        less_than=6
                    [/variable]
                    [then]
                        [terrain]
                             x,y=$blood_hex[$i].x,$blood_hex[$i].y
                            terrain=Qxv
                        [/terrain]
                    [/then]
                [/if]
                {CLEAR_VARIABLE change_terrain}
            [/do]
        [/for]
        {CLEAR_VARIABLE blood_hex}
        [store_locations]
            variable=blood_hex
            terrain=Wwb
            [and]
                [not]
                    [filter]
                    [/filter]
                [/not]
            [/and]
            [and]
                [filter_adjacent_location]
                    terrain=Qxv
                [/filter_adjacent_location]
            [/and]
        [/store_locations]
        [for]
            array=blood_hex
            [do]
                [set_variable]
                    name=change_terrain
                    rand=1..50
                [/set_variable]
                [if]
                    [variable]
                        name=change_terrain
                        less_than=6
                    [/variable]
                    [then]
                        [terrain]
                             x,y=$blood_hex[$i].x,$blood_hex[$i].y
                            terrain=Qxv
                        [/terrain]
                    [/then]
                [/if]
                {CLEAR_VARIABLE change_terrain}
            [/do]
        [/for]
        {CLEAR_VARIABLE blood_hex}
        [redraw][/redraw]
#enddef

#define DRAW_WALLS
        [store_locations]
            variable=blood_hex
            terrain=Wwb,Qxv
            [filter_adjacent_location]
                terrain=Xu
                count=1
            [/filter_adjacent_location]
            [and]
                [not]
                    [filter_adjacent_location]
                        terrain=Xue
                    [/filter_adjacent_location]
                [/not]
            [/and]
            [and]
                [not]
                    [filter]
                    [/filter]
                [/not]
            [/and]
        [/store_locations]
        [for]
            array=blood_hex
            [do]
                [set_variable]
                    name=change_terrain
                    rand=1..30
                [/set_variable]
                [if]
                    [variable]
                        name=change_terrain
                        less_than=6
                    [/variable]
                    [then]
                        [terrain]
                             x,y=$blood_hex[$i].x,$blood_hex[$i].y
                            terrain=Xu
                        [/terrain]
                    [/then]
                [/if]
                {CLEAR_VARIABLE change_terrain}
            [/do]
        [/for]
        {CLEAR_VARIABLE blood_hex}
        [redraw][/redraw]
#enddef

#define DRAW_WALLS2
        [store_locations]
            variable=blood_hex
            terrain=Wwb,Qxv
            [filter_adjacent_location]
                terrain=Xu
                count=2
            [/filter_adjacent_location]
            [and]
                [not]
                    [filter_adjacent_location]
                        terrain=Xue
                    [/filter_adjacent_location]
                [/not]
            [/and]
            [and]
                [not]
                    [filter]
                    [/filter]
                [/not]
            [/and]
        [/store_locations]
        [for]
            array=blood_hex
            [do]
                [set_variable]
                    name=change_terrain
                    rand=1..70
                [/set_variable]
                [if]
                    [variable]
                        name=change_terrain
                        less_than=6
                    [/variable]
                    [then]
                        [terrain]
                             x,y=$blood_hex[$i].x,$blood_hex[$i].y
                            terrain=Xu
                        [/terrain]
                    [/then]
                [/if]
                {CLEAR_VARIABLE change_terrain}
            [/do]
        [/for]
        {CLEAR_VARIABLE blood_hex}
        [redraw][/redraw]
#enddef

#define DRAW_WALLS3
        [store_locations]
            variable=blood_hex
            terrain=Wwb,Qxv
            [filter_adjacent_location]
                terrain=Xu
                count=3
            [/filter_adjacent_location]
            [and]
                [not]
                    [filter_adjacent_location]
                        terrain=Xue
                    [/filter_adjacent_location]
                [/not]
            [/and]
            [and]
                [not]
                    [filter]
                    [/filter]
                [/not]
            [/and]
        [/store_locations]
        [for]
            array=blood_hex
            [do]
                [set_variable]
                    name=change_terrain
                    rand=1..150
                [/set_variable]
                [if]
                    [variable]
                        name=change_terrain
                        less_than=6
                    [/variable]
                    [then]
                        [terrain]
                             x,y=$blood_hex[$i].x,$blood_hex[$i].y
                            terrain=Xu
                        [/terrain]
                    [/then]
                [/if]
                {CLEAR_VARIABLE change_terrain}
            [/do]
        [/for]
        {CLEAR_VARIABLE blood_hex}
        [redraw][/redraw]
#enddef

#define DRAW_WALLS4
        [store_locations]
            variable=blood_hex
            terrain=Wwb,Qxv
            [filter_adjacent_location]
                terrain=Xu
                count=4
            [/filter_adjacent_location]
            [and]
                [not]
                    [filter_adjacent_location]
                        terrain=Xue
                    [/filter_adjacent_location]
                [/not]
            [/and]
            [and]
                [not]
                    [filter]
                    [/filter]
                [/not]
            [/and]
        [/store_locations]
        [for]
            array=blood_hex
            [do]
                [set_variable]
                    name=change_terrain
                    rand=1..250
                [/set_variable]
                [if]
                    [variable]
                        name=change_terrain
                        less_than=6
                    [/variable]
                    [then]
                        [terrain]
                             x,y=$blood_hex[$i].x,$blood_hex[$i].y
                            terrain=Xu
                        [/terrain]
                    [/then]
                [/if]
                {CLEAR_VARIABLE change_terrain}
            [/do]
        [/for]
        {CLEAR_VARIABLE blood_hex}
        [redraw][/redraw]
#enddef

#define BREAK_WALLS
        [store_locations]
            variable=blood_hex
            terrain=Xu
            [filter_adjacent_location]
                terrain=Wwb,Qxv
                count=3,4
            [/filter_adjacent_location]
        [/store_locations]
        [for]
            array=blood_hex
            [do]
                [set_variable]
                    name=change_terrain
                    rand=1..100
                [/set_variable]
                [if]
                    [variable]
                        name=change_terrain
                        less_than=6
                    [/variable]
                    [then]
                        [terrain]
                             x,y=$blood_hex[$i].x,$blood_hex[$i].y
                            terrain=Wwb
                        [/terrain]
                    [/then]
                [/if]
                {CLEAR_VARIABLE change_terrain}
            [/do]
        [/for]
        {CLEAR_VARIABLE blood_hex}
        [redraw][/redraw]
#enddef

#define DRAW_DARKNESS1
        [store_locations]
            variable=blood_hex
            terrain=Wwb,Xu,Qxv
            [not]
                terrain=Gd^Fyok
            [/not]
            [filter_adjacent_location]
                terrain=Woby
                count=1-2
            [/filter_adjacent_location]
        [/store_locations]
        [for]
            array=blood_hex
            [do]
                [set_variable]
                    name=change_terrain
                    rand=1..10
                [/set_variable]
                [if]
                    [variable]
                        name=change_terrain
                        less_than=6
                    [/variable]
                    [then]
                        [terrain]
                             x,y=$blood_hex[$i].x,$blood_hex[$i].y
                            terrain=Woby
                        [/terrain]
                    [/then]
                [/if]
                {CLEAR_VARIABLE change_terrain}
            [/do]
        [/for]
        {CLEAR_VARIABLE blood_hex}
        [redraw][/redraw]
#enddef

#define DRAW_DARKNESS2
        [store_locations]
            variable=blood_hex
            terrain=Wwb,Xu,Qxv
            [not]
                terrain=Gd^Fyok
            [/not]
            [filter_adjacent_location]
                terrain=Woby
                count=3-4
            [/filter_adjacent_location]
        [/store_locations]
        [for]
            array=blood_hex
            [do]
                [set_variable]
                    name=change_terrain
                    rand=1..25
                [/set_variable]
                [if]
                    [variable]
                        name=change_terrain
                        less_than=6
                    [/variable]
                    [then]
                        [terrain]
                             x,y=$blood_hex[$i].x,$blood_hex[$i].y
                            terrain=Woby
                        [/terrain]
                    [/then]
                [/if]
                {CLEAR_VARIABLE change_terrain}
            [/do]
        [/for]
        {CLEAR_VARIABLE blood_hex}
        [store_locations]
            variable=blood_hex
            terrain=Wwb,Xu
            [not]
                terrain=Gd^Fyok,Xue
            [/not]
            [filter_adjacent_location]
                terrain=Woby
                count=5-6
            [/filter_adjacent_location]
        [/store_locations]
        [for]
            array=blood_hex
            [do]
                [set_variable]
                    name=change_terrain
                    rand=1..50
                [/set_variable]
                [if]
                    [variable]
                        name=change_terrain
                        less_than=6
                    [/variable]
                    [then]
                        [terrain]
                            x,y=$blood_hex[$i].x,$blood_hex[$i].y
                            terrain=Woby
                        [/terrain]
                    [/then]
                [/if]
                {CLEAR_VARIABLE change_terrain}
            [/do]
        [/for]
        {CLEAR_VARIABLE blood_hex}
        [redraw][/redraw]
#enddef

#define SWITCH_WALLS
    [store_locations]
        variable=hex
        terrain=Xue
    [/store_locations]
    [for]
        array=hex
        [do]
            [terrain]
                x,y=$hex[$i].x,$hex[$i].y
                terrain=Xu
            [/terrain]
        [/do]
    [/for]
    {CLEAR_VARIABLE hex}
#enddef

# enemy spawns

    #spawns
    [event]
        name=side 2 turn
        first_time_only=no
        [filter_condition]
            [variable]
                name=boss_battle
                numerical_equals=0
            [/variable]
        [/filter_condition]
        [store_locations]
            variable=hex
            terrain=Qxv
        [/store_locations]
        [for]
            array=hex
            [do]
                #ifdef HARD
                [set_variable]
                    name=spawn_val
                    rand=1..300
                [/set_variable]
                #endif
                #ifdef NORMAL
                [set_variable]
                    name=spawn_val
                    rand=1..500
                [/set_variable]
                #endif
                #ifdef EASY
                [set_variable]
                    name=spawn_val
                    rand=1..600
                [/set_variable]
                #endif
                [if]
                    [variable]
                        name=spawn_val
                        numerical_equals=4
                    [/variable]
                    [then]
                        {SPAWN_NOID ("Demon Voidhunter","Demon Voidreaver") 3 $hex[$i].x $hex[$i].y}
                    [/then]
                [/if]
                {CLEAR_VARIABLE spawn_val}
            [/do]
        [/for]
        {CLEAR_VARIABLE hex}
        [store_locations]
            variable=hex
            terrain=Wwb
        [/store_locations]
        [for]
            array=hex
            [do]
                #ifdef HARD
                [set_variable]
                    name=spawn_val
                    rand=1..1000
                [/set_variable]
                #endif
                #ifdef NORMAL
                [set_variable]
                    name=spawn_val
                    rand=1..1600
                [/set_variable]
                #endif
                #ifdef EASY
                [set_variable]
                    name=spawn_val
                    rand=1..1800
                [/set_variable]
                #endif
                [if]
                    [variable]
                        name=spawn_val
                        numerical_equals=4
                    [/variable]
                    [then]
                        {SPAWN_NOID ("Demon Nightmare") 2 $hex[$i].x $hex[$i].y}
                    [/then]
                [/if]
                {CLEAR_VARIABLE spawn_val}
            [/do]
        [/for]
        {CLEAR_VARIABLE hex}
        [store_locations]
            variable=hex
            terrain=Woby
        [/store_locations]
        [for]
            array=hex
            [do]
                #ifdef HARD
                [set_variable]
                    name=spawn_val
                    rand=1..750
                [/set_variable]
                #endif
                #ifdef NORMAL
                [set_variable]
                    name=spawn_val
                    rand=1..1200
                [/set_variable]
                #endif
                #ifdef EASY
                [set_variable]
                    name=spawn_val
                    rand=1..1400
                [/set_variable]
                #endif
                [if]
                    [variable]
                        name=spawn_val
                        numerical_equals=4
                    [/variable]
                    [then]
                        {SPAWN_NOID ("Shadow Demon") 2 $hex[$i].x $hex[$i].y}
                    [/then]
                [/if]
                {CLEAR_VARIABLE spawn_val}
            [/do]
        [/for]
        {CLEAR_VARIABLE hex}
    [/event]

    #REDRAW THE MAZE
    [event]
        name=new turn
        first_time_only=no
        [filter_condition]
            [variable]
                name=boss_battle
                numerical_equals=0
            [/variable]
        [/filter_condition]

        [if]
            [variable]
                name=faster_spread
                numerical_equals=0
            [/variable]
            [then]
                {DRAW_DARKNESS1}
                {BREAK_WALLS}
                {DRAW_WALLS}
                {DRAW_WALLS}
                {DRAW_WALLS2}
                {BREAK_WALLS}
                {DRAW_WALLS2}
                {DRAW_WALLS3}
                {DRAW_WALLS3}
                {DRAW_WALLS4}
                {BREAK_WALLS}
                {REGEN_ABYSS}
            [/then]
        [/if]
        [if]
            [variable]
                name=faster_spread
                numerical_equals=1
            [/variable]
            [then]
                {DRAW_DARKNESS1}
                {DRAW_DARKNESS1}
                {DRAW_DARKNESS2}
                {BREAK_WALLS}
                {DRAW_WALLS}
                {DRAW_WALLS}
                {DRAW_WALLS2}
                {BREAK_WALLS}
                {DRAW_WALLS2}
                {DRAW_WALLS3}
                {DRAW_WALLS3}
                {DRAW_WALLS4}
                {BREAK_WALLS}
                {REGEN_ABYSS}
                {DRAW_DARKNESS1}
                {DRAW_DARKNESS2}
            [/then]
        [/if]
    [/event]

    [event]
        name=prestart

        {CAVE_WALL_SEED}
        {CAVE_WALL_SEED}
        {DRAW_WALLS}
        {DRAW_WALLS}
        {DRAW_WALLS2}
        {TERRAIN_GEN1}
        {TERRAIN_GEN2}

        [set_variable]
            name=faster_spread
            value=0
        [/set_variable]
        [set_variable]
            name=boss_battle
            value=0
        [/set_variable]
        [set_variable]
            name=turn_damage
            value=0
        [/set_variable]

        [store_unit]
            [filter]
                id=Esther
            [/filter]
            variable=esther_tmp
        [/store_unit]
        [kill]
            id=Esther
        [/kill]

        # recruiting code for this scenario
        [set_menu_item]
            id=recruit_manifestation
            description= _ "Recruit Manifestation"
            image="attacks/wail.png~SCALE(18,18)"
            [show_if]
                [variable]
                    name=side_number
                    numerical_equals=1
                [/variable]
            [/show_if]
            [filter_location]
                [not]
                    [filter][/filter]
                [/not]
                [filter_adjacent_location]
                    [filter]
                        side=1
                        id=Yumi
                    [/filter]
                [/filter_adjacent_location]
            [/filter_location]
            [command]
                [store_gold]
                    [filter_side]
                        side=1
                    [/filter_side]
                    variable=side1gold
                [/store_gold]
                [if]
                    [variable]
                        name=side1gold
                        less_than=4
                    [/variable]
                    [then]
                        {MESSAGE_NOT_ENOUGH_GOLD}
                    [/then]
                    [else]
                        [unit]
                            side=1
                            type=Manifestation
                            x,y=$x1,$y1
                            moves,attacks_left=0,0
                            animate=yes
                            upkeep=free
                            [modifications]
                                {TRAIT_LOYAL}
                            [/modifications]
                        [/unit]
                        {VARIABLE_OP side1gold sub 4}
                        [modify_side]
                            side=1
                            gold=$side1gold
                        [/modify_side]
                        {CLEAR_VARIABLE side1gold}
                    [/else]
                [/if]
            [/command]
        [/set_menu_item]
        [sound_source]
            id=s10dark1
            x=14
            y=14
            sounds="dark-2.ogg"
            full_range=100
            delay=0
            loop=-1
            check_fogged=no
            check_shrouded=no
        [/sound_source]
    [/event]

    [event]
        name=start

        {FADE_SCREEN}
        {SCROLL_TO 29 34}
        [remove_shroud]
            side=1
            x=29
            y=34
            radius=6
        [/remove_shroud]
        [lift_fog]
            [filter_side]
                side=1
            [/filter_side]
            x=29
            y=34
            radius=6
            multiturn=no
        [/lift_fog]
        {UNFADE_SCREEN}
        {DELAY 1000}
        {RECALL_YUMI 29 34}
        {DELAY 1250}
        [message]
            speaker=Yumi
            message= _ "(<i>stares</i>)"
        [/message]
        {DELAY 1250}

        [remove_shroud]
            side=1
            x=37
            y=37
            radius=6
        [/remove_shroud]
        [lift_fog]
            [filter_side]
                side=1
            [/filter_side]
            x=37
            y=37
            radius=9
            multiturn=no
        [/lift_fog]

        {SCROLL_TO 37 37}
        {DELAY 750}
        {RECALL_ARYEL 37 37}
        [message]
            speaker=Aryel
            message= _ "Yumi?"
        [/message]
        {DELAY 500}
        {MODIFY_UNIT (id=Aryel) facing se}
        {DELAY 750}
        {MODIFY_UNIT (id=Aryel) facing sw}
        {DELAY 500}
        [move_unit]
            id=Aryel
            to_x,to_y=29,34
        [/move_unit]
        [message]
            speaker=Aryel
            message= _ "Where are we?"
        [/message]
        {DELAY 1500}
        [message]
            speaker=Aryel
            message= _ "Are you paying attention?"
        [/message]
        [message]
            speaker=Aryel
            message= _ "Yu-"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(<i>blinks</i>) Aryel?"
        [/message]
        [message]
            speaker=Aryel
            message= _ "Yumi, what in the world is going on?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "<i>Should I tell her?</i>"
        [/message]
        [message]
            speaker=Yumi
            message= _ "<i>... maybe not yet.</i>"
        [/message]
        [message]
            speaker=Aryel
            message= _ "(<i>sighs</i>) I'm not going to get anything out of you, am I? At least stop running off on your own, especially with everyone exploding in pools of blood right now-"
        [/message]
        [message]
            speaker=Yumi
            message= _ "I think I can stop it."
        [/message]
        [message]
            speaker=Aryel
            message= _ "You do? How?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "It's the tree. We have to find the tree."
        [/message]
        [message]
            speaker=Aryel
            message= _ "... <i>A tree? Does she mean the one that was growing in the fort's courtyard? I thought that was just an ordinary tree. It shouldn't have had anything to do with this... but Yumi's intuition about these things is usually correct. It's probably a good idea to listen to her.</i>"
        [/message]
        [message]
            speaker=Aryel
            message= _ "Okay. And where is this tree?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(<i>frowns</i>) I don't know."
        [/message]
        [message]
            speaker=Aryel
            message= _ "... I see. Guess we have to look for it."
        [/message]

        [objectives]
            {OBJECTIVE_VICTORY  ( _ "Explore")}
            {OBJECTIVE_DEFEAT  ( _ "Death of Yumi")}
            {OBJECTIVE_DEFEAT  ( _ "Death of Aryel")}
            {OBJECTIVE_NOTE ( _ "You may recruit by right clicking on a hex next to Yumi.")}
            {OBJECTIVE_NOTE ( _ "Explore northwest.")}
            {OBJECTIVE_NOTE ( _ "The main objective becomes available on turn 15.")}
        [/objectives]

        {DRAW_WALLS3}
        {DRAW_WALLS}
        {DRAW_WALLS2}
        {DRAW_WALLS4}
        {BREAK_WALLS}
        {TERRAIN_GEN1}
        {TERRAIN_GEN2}

        {SPAWN_NOID ("Demon Nightmare") 2 36 22}
        {SPAWN_NOID ("Demon Nightmare") 2 29 24}
        {SPAWN_NOID ("Demon Nightmare") 2 16 29}
        {SPAWN_NOID ("Demon Nightmare") 2 14 34}
        {SPAWN_NOID ("Demon Voidreaver") 3 20 21}
        #ifdef NORMAL
            {SPAWN_NOID ("Demon Voidreaver") 3 19 22}
            {SPAWN_NOID ("Shadow Demon") 2 14 11}
            {SPAWN_NOID ("Shadow Demon") 2 17 10}
        #endif
        #ifdef HARD
            {SPAWN_NOID ("Shadow Demon") 2 14 11}
            {SPAWN_NOID ("Shadow Demon") 2 17 10}
            {SPAWN_NOID ("Demon Voidreaver") 3 19 22}
            {SPAWN_NOID ("Demon Voidreaver") 3 10 14}
            {SPAWN_NOID ("Demon Voidreaver") 3 20 11}
        #endif

    [/event]

    #damage
    [event]
        name=new turn
        first_time_only=no
        [if]
            [variable]
                name=turn_damage
                numerical_not_equals=0
            [/variable]
            [then]
                [store_unit]
                    [filter]
                        side=1
                    [/filter]
                    variable=fire_dmg_unit
                [/store_unit]
            [/then]
        [/if]
        [for]
            array=fire_dmg_unit
            [do]
            [if]
                [variable]
                    name=fire_dmg_unit[$i].hitpoints
                    greater_than=$turn_damage
                [/variable]

                [then]
                    {VARIABLE_OP fire_dmg_unit[$i].hitpoints sub $turn_damage}
                [/then]
                [else]
                    {VARIABLE fire_dmg_unit[$i].hitpoints 1}
                [/else]
            [/if]
            [unstore_unit]
                variable=fire_dmg_unit[$i]
                find_vacant=no
                text= _ "harmed"
                {COLOR_HARM}
            [/unstore_unit]
            [/do]
        [/for]
        {CLEAR_VARIABLE fire_dmg_unit}
    [/event]

    [event]
        name=sighted
        first_time_only=yes
        [filter]
            side=2,3
        [/filter]
        [filter_second]
            side=1
        [/filter_second]
        [message]
            speaker=Aryel
            message= _ "These demons again? Ugh. What a pain."
        [/message]
    [/event]

    [event]
        name=turn 2
        {SWITCH_WALLS}
    [/event]

    [event]
        name=turn 3

        [message]
            speaker=Aryel
            message= _ "Yumi?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "Hmm?"
        [/message]
        [message]
            speaker=Aryel
            message= _ "Why are the walls moving?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "..."
        [/message]
        [message]
            speaker=Yumi
            message= _ "I don't know."
        [/message]
    [/event]
    [event]
        name=turn 4

        [message]
            speaker=Aryel
            message= _ "Where are we, exactly?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "I don't know that either."
        [/message]
    [/event]

    [event]
        name=turn 5 end

        #ifndef HARD
            [set_variable]
                name=turn_damage
                value=1
            [/set_variable]
        #endif
        #ifdef HARD
            [set_variable]
                name=turn_damage
                value=2
            [/set_variable]
        #endif
    [/event]
    [event]
        name=side 1 turn 6
        {PLAY_SOUND "magic-dark.ogg"}
        [message]
            speaker=Yumi
            message= _ "(<i>flinches</i>)"
        [/message]
        [message]
            speaker=Aryel
            message= _ "Ow! What was that?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(<i>rubs arms</i>) Something's there. It's taking our energy."
        [/message]
        [message]
            speaker=Aryel
            message= _ "Something? Like what?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "It's like a demon."
        [/message]
        [message]
            speaker=Aryel
            message= _ "Like a demon?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "It's like a demon, but not a demon."
        [/message]
        [message]
            speaker=Aryel
            message= _ "... oookay. So a demon lord? Well, probably not that, I could sense 'it' if it were. So something else."
        [/message]
        [message]
            speaker=Yumi
            message= _ "It's hiding."
        [/message]
        [message]
            speaker=Aryel
            message= _ "Hiding. Riiiight."
        [/message]
        [message]
            speaker=Aryel
            message= _ "Yumi, are you sure that this is a good idea? I know you said that you know what's going on, but..."
        [/message]
        {DELAY 750}
        [message]
            speaker=Aryel
            message= _ "Yumi."
        [/message]
        [message]
            speaker=Aryel
            message= _ "Yuuuumi."
        [/message]
        [message]
            speaker=Yumi
            message= _ "You don't believe me?"
        [/message]
        [message]
            speaker=Aryel
            message= _ "It's... just that I have no clue what's going on, and you're not telling me anything-"
        [/message]
        [message]
            speaker=Yumi
            message= _ "Sorry. Aryel..."
        [/message]
        [message]
            speaker=Aryel
            message= _ "What is it?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(<i>shakes head</i>) This is my fault."
        [/message]
        [message]
            speaker=Aryel
            message= _ "What makes you say that? Yumi? Hello? Yuumi."
        [/message]
        [message]
            speaker=Aryel
            message= _ "..."
        [/message]
        [message]
            speaker=Aryel
            message= _ "Ugh."
        [/message]
    [/event]
    [event]
        name=turn 7

        [message]
            speaker=Aryel
            message= _ "I don't get why you have to be like this."
        [/message]
        [message]
            speaker=Yumi
            message= _ "I want to tell you. I really do."
        [/message]
        [message]
            speaker=Aryel
            message= _ "And you can't because..?"
        [/message]
    [/event]
    [event]
        name=turn 8

        [message]
            speaker=Aryel
            message= _ "You can't hide everything forever, Yumi. I know you try to pretend like you're fine, and that you're in the dark about everything like us, but it's not true. And no matter how much you insist otherwise, you aren't going to fool me."
        [/message]
        [message]
            speaker=Yumi
            message= _ "(<i>fidgets nervously</i>)"
        [/message]
    [/event]
    [event]
        name=turn 9

        [message]
            speaker=Aryel
            message= _ "Esther lets you off the hook too often. I mean, I do too, but not this time."
        [/message]
        [message]
            speaker=Yumi
            message= _ "But-"
        [/message]
        [message]
            speaker=Aryel
            message= _ "No buts! And I dont want to hear anything about protecting us. We're in this together. You can trust me, can't you?"
        [/message]
    [/event]
    [event]
        name=turn 10

        [message]
            speaker=Yumi
            message= _ "I trust you."
        [/message]
        [message]
            speaker=Aryel
            message= _ "So what's the problem?"
        [/message]
    [/event]
    [event]
        name=turn 10 end

        #ifndef HARD
            [set_variable]
                name=turn_damage
                value=2
            [/set_variable]
        #endif
        #ifdef HARD
            [set_variable]
                name=turn_damage
                value=3
            [/set_variable]
        #endif
    [/event]
    [event]
        name=turn 11

        [message]
            speaker=Yumi
            message= _ "The problem is me."
        [/message]
        [message]
            speaker=Aryel
            message= _ "No, it's not. Stop pretending like this is all your fault. You don't need to hide yourself from me."
        [/message]
        [message]
            speaker=Aryel
            message= _ "We both know you don't have the emotions of a potato, Yumi."
        [/message]
        [message]
            speaker=Aryel
            message= _ "Won't you talk to me?"
        [/message]
    [/event]

    [event]
        name=turn 12

        [message]
            speaker=Yumi
            message= _ "Aryel...I just..."
        [/message]
        [message]
            speaker=Yumi
            message= _ "(<i>whispers</i>) I'm afraid."
        [/message]
        [message]
            speaker=Aryel
            message= _ "Why?"
        [/message]
    [/event]

    [event]
        name=side 2 turn 12

        [message]
            speaker=Yumi
            message= _ "(<i>breathes deeply</i>) They're always in my dreams. The demons. The nightmares."
        [/message]
        [message]
            speaker=Yumi
            message= _ "Whenever I close my eyes, they're there. They won't leave my head."
        [/message]
    [/event]
    [event]
        name=side 3 turn 12

        [message]
            speaker=Yumi
            message= _ "I can't sleep anymore. I can't sleep. Aryel..."
        [/message]
        [set_variable]
            name=faster_spread
            value=1
        [/set_variable]
    [/event]

    [event]
        name=turn 13

        [message]
            speaker=Yumi
            message= _ "They're always there waiting for me."
        [/message]
        [message]
            speaker=Yumi
            message= _ "They just won't leave me alone."
        [/message]
        [message]
            speaker=Yumi
            message= _ "But they're not hunting me."
        [/message]
        [message]
            speaker=Yumi
            message= _ "It's there, lurking in the shadows. They want me to use it. But if I do, everyone will die. You saw what happened to all those humans. If I can't control it, it'll keep eating everything. Esther, you... everyone."
        [/message]
        [message]
            speaker=Yumi
            message= _ "But if I don't, it'll eventually come anyway..."
        [/message]
    [/event]
    [event]
        name=side 2 turn 13

        [message]
            speaker=Yumi
            message= _ "I keep trying, but I feel like I can't do anything."
        [/message]
    [/event]
    [event]
        name=side 3 turn 13

        [message]
            speaker=Yumi
            message= _ "I'm useless. I'm... weak."
        [/message]
    [/event]

    [event]
        name=turn 14

        [message]
            speaker=Yumi
            message= _ "Aryel..."
        [/message]
        [message]
            speaker=Yumi
            message= _ "I can't take it anymore."
        [/message]
        [message]
            speaker=Yumi
            message= _ "They keep showing me what's going to happen. What they're going to do- what it's going to do."
        [/message]
    [/event]
    [event]
        name=side 3 turn 14

        [message]
            speaker=Yumi
            message= _ "In my dream, there's blood everywhere... everything, people, plants, even the ground, it all turns into a sea of blood. That's just the start. It's a warning."
        [/message]
        [message]
            speaker=Yumi
            message= _ "And then it comes, turning everything to darkness. Everything's going to be just... gone."
        [/message]
        [message]
            speaker=Yumi
            message= _ "It's going to destroy everything. All the humans, the demons, the faerie..."
        [/message]
    [/event]
    [event]
        name=turn 15

        [message]
            speaker=Yumi
            message= _ "(<i>whispers</i>) Even Esther and you."
        [/message]
        [message]
            speaker=Yumi
            message= _ "..."
        [/message]
        [message]
            speaker=Yumi
            message= _ "I don't want you two to leave me..."
        [/message]
        [message]
            speaker=Yumi
            message= _ "..."
        [/message]
        [message]
            speaker=Yumi
            message= _ "(<i>breathes</i>)"
        [/message]
        [message]
            speaker=Yumi
            message= _ "Sorry... I talk too much..."
        [/message]
        {DELAY 1500}
        [message]
            speaker=Aryel
            message= _ "(<i>sighs</i>)"
        [/message]
        [message]
            speaker=Aryel
            message= _ "I should have said something earlier. I <i>knew</i> something was up but..."
        [/message]
        [message]
            speaker=Aryel
            message= _ "Yumi. None of this is your fault. You hear me? Stop blaming yourself."
        [/message]
        [message]
            speaker=Yumi
            message= _ "(<i>shakes head</i>)"
        [/message]
        [message]
            speaker=Aryel
            message= _ "If anything, it's my fault. I shouldn't have... ugh. For goodness sake, you've been fighting these demons alone! You've been keeping it to yourself this whole time, and you still think that this is all-"
        [/message]
        [message]
            speaker=Yumi
            message= _ "They're not the ones causing this."
        [/message]
        [message]
            speaker=Aryel
            message= _ "But you said-"
        [/message]
        [message]
            speaker=Yumi
            message= _ "It's the other ones. The ones that you can't see. The ones that aren't demons. <i>And part of it is me...</i>"
        [/message]
        {DELAY 1000}
        [message]
            speaker=Aryel
            message= _ "Yumi, we're not giving up. We're getting to the bottom of this. I'm not going to sit by while they do this to you."
        [/message]
        [message]
            speaker=Yumi
            message= _ "But you can't stop them! They'll- they'll hurt you..."
        [/message]
        [message]
            speaker=Aryel
            message= _ "So? What do you want me to do, Yumi? You think I can just sit back while you're suffering?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(<i>remains silent</i>)"
        [/message]
        [message]
            speaker=Aryel
            message= _ "I thought so. Look, Yumi. Esther and I aren't going to leave you. We're your friends. We want to protect you."
        [/message]
        [message]
            speaker=Yumi
            message= _ "... I'm just a burden."
        [/message]
        [message]
            speaker=Aryel
            message= _ "Don't be ridiculous. Now come on. Stay close to me, okay? I'm not going to let you give up so easily."
        [/message]
        [terrain]
            x,y=14,9
            terrain=Gd^Fyok
        [/terrain]
    [/event]
    [event]
        name=turn 15 end

        #ifndef HARD
            [set_variable]
                name=turn_damage
                value=3
            [/set_variable]
        #endif
        #ifdef HARD
            [set_variable]
                name=turn_damage
                value=4
            [/set_variable]
        #endif
    [/event]
    [event]
        name=moveto
        first_time_only=yes
        [filter]
            side=1
            [filter_location]
                terrain=Gd^Fyok
            [/filter_location]
            [and]
                [not]
                    id=Yumi
                [/not]
            [/and]
        [/filter]
        [message]
            speaker=Aryel
            message= _ "Yumi, I found your tree."
        [/message]
    [/event]
#define S13_SPAWN_ILLUSION_NOID X Y R
    [store_locations]
        [and]
            x,y={X},{Y}
            radius={R}
        [/and]

        [not]
            [filter]
            [/filter]

            [or]
                [filter_adjacent_location]
                    [filter]
                    [/filter]
                [/filter_adjacent_location]
            [/or]
        [/not]
        variable=spawn_points
    [/store_locations]

    [set_variable]
        name=tmp
        rand=0..$($spawn_points.length-1)
    [/set_variable]

    [set_variable]
        name=x_loc
        value=$spawn_points[$tmp].x
    [/set_variable]

    [set_variable]
        name=y_loc
        value=$spawn_points[$tmp].y
    [/set_variable]

    [unit]
        type=Illusory Angel Illusion
        animate=yes
        side=2
        x,y=$x_loc,$y_loc
        random_traits=no
        generate_name=no
        gender=female
        moves=1
        hitpoints=$luna.hitpoints
    [/unit]

    [clear_variable]
        name=x_loc,y_loc,spawn_points,tmp
    [/clear_variable]
#enddef
#define S13_SPAWN_ILLUSION ID
    [store_locations]
        [and]
            x,y=14,9
            radius=7
        [/and]

        [not]
            [filter]
            [/filter]

            [or]
                [filter_adjacent_location]
                    [filter]
                    [/filter]
                [/filter_adjacent_location]
            [/or]
        [/not]
        variable=spawn_points
    [/store_locations]

    [set_variable]
        name=tmp
        rand=0..$($spawn_points.length-1)
    [/set_variable]

    [set_variable]
        name=x_loc
        value=$spawn_points[$tmp].x
    [/set_variable]

    [set_variable]
        name=y_loc
        value=$spawn_points[$tmp].y
    [/set_variable]

    [unit]
        id={ID}
        type=Illusory Angel Illusion
        animate=yes
        side=2
        x,y=$x_loc,$y_loc
        random_traits=no
        generate_name=no
        gender=female
    [/unit]

    [clear_variable]
        name=x_loc,y_loc,spawn_points,tmp
    [/clear_variable]
#enddef

#define REGENERATE_ILLUSIONS
    [store_unit]
        [filter]
            id=Luna
        [/filter]
        variable=luna
    [/store_unit]
    [kill]
        side=2
        animate=yes
    [/kill]
    [set_variable]
        name=generator
        rand=1..5
    [/set_variable]
    [set_variable]
        name=gen_counter
        value=0
    [/set_variable]
    [set_variable]
        name=rev_gen
        value=5
    [/set_variable]
    {VARIABLE_OP rev_gen sub $generator}
    {VARIABLE_OP rev_gen sub 1}

    [while]
        [variable]
            name=gen_counter
            less_than=$generator
        [/variable]
        [do]
            {S13_SPAWN_ILLUSION_NOID 14 9 7}
            {VARIABLE_OP gen_counter add 1}
        [/do]
    [/while]

    [set_variable]
        name=gen_counter
        value=0
    [/set_variable]

    [store_locations]
        [and]
            x,y=14,9
            radius=7
        [/and]
        [not]
            [filter]
            [/filter]

            [or]
                [filter_adjacent_location]
                    [filter]
                    [/filter]
                [/filter_adjacent_location]
            [/or]
        [/not]
        variable=spawn_points
    [/store_locations]

    [set_variable]
        name=tmp
        rand=0..$($spawn_points.length-1)
    [/set_variable]

    [set_variable]
        name=x_loc
        value=$spawn_points[$tmp].x
    [/set_variable]
        [set_variable]
        name=y_loc
        value=$spawn_points[$tmp].y
    [/set_variable]
    [unit]
        id=Luna
        type=Illusory Angel
        hitpoints=$luna.hitpoints
        animate=yes
        side=2
        x,y=$x_loc,$y_loc
        random_traits=no
        generate_name=no
        gender=female
        moves=1
    [/unit]
    [clear_variable]
        name=x_loc,y_loc,spawn_points,tmp
    [/clear_variable]

    [while]
        [variable]
            name=gen_counter
            less_than=$rev_gen
        [/variable]
        [do]
            {S13_SPAWN_ILLUSION_NOID 14 9 7}
            {VARIABLE_OP gen_counter add 1}
        [/do]
    [/while]
    #ifdef NORMAL
        {S13_SPAWN_ILLUSION_NOID 14 9 7}
    #endif
    #ifdef HARD
        {S13_SPAWN_ILLUSION_NOID 14 9 7}
        {S13_SPAWN_ILLUSION_NOID 14 9 7}
        {S13_SPAWN_ILLUSION_NOID 14 9 7}
    #endif

    [clear_variable]
        name=gen_counter,rev_gen,generator,luna
    [/clear_variable]
#enddef

    [event]
        name=moveto
        first_time_only=yes
        [filter]
            side=1
            [filter_location]
                terrain=Gd^Fyok
            [/filter_location]
            [and]
                id=Yumi
            [/and]
        [/filter]

        {DELAY 300}

        [heal_unit]
            [filter]
                id=Yumi
            [/filter]
            amount=full
        [/heal_unit]
        [heal_unit]
            [filter]
                id=Aryel
            [/filter]
            amount=full
        [/heal_unit]

        [message]
            speaker=Yumi
            message= _ "(<i>frowns</i>)"
        [/message]

        {DELAY 500}

        [kill]
            side=1
            type=Manifestation
        [/kill]

        [kill]
            side=2
        [/kill]

        [kill]
            side=3
        [/kill]

        {DELAY 500}
        {TURN_UNIT5 "Aryel"}
        {DELAY 500}

        [move_unit]
            id=Aryel
            to_x,to_y=13,10
        [/move_unit]

        [message]
            speaker=Aryel
            message= _ "Huh. All the demons and ghosts just disappeared."
        [/message]

        {DELAY 1000}
        [move_unit]
            id=Yumi
            to_x,to_y=14,10
        [/move_unit]
        {FADE_SCREEN}
        {DELAY 1000}
        [message]
            speaker=Aryel
            message= _ "Is it working?"
        [/message]

        [terrain]
            x,y=14,9
            radius=10
            terrain=Xue
        [/terrain]
        {DELAY 1000}
        [message]
            speaker=Yumi
            message= _ "I don't think so."
        [/message]
        [terrain]
            x,y=14,9
            radius=8
            terrain=Woby
        [/terrain]

        [terrain]
            x,y=14,9
            terrain=Gd^Fyok
        [/terrain]
        [redraw][/redraw]

        {DELAY 500}
        {PLAY_SOUND "magic-dark.ogg"}
        {DELAY 750}
        {DELAY 500}
        {PLAY_SOUND "magic-dark-miss.ogg"}
        {DELAY 500}
        {PLAY_SOUND "magic-dark.ogg"}
        {DELAY 500}
        {PLAY_SOUND "magic-dark-miss.ogg"}
        {DELAY 500}
        {PLAY_SOUND "magic-dark-miss.ogg"}
        {DELAY 1000}

        [message]
            speaker=Yumi
            message= _ "It's coming."
        [/message]

        [message]
            speaker=Aryel
            message= _ "(<i>squeaks</i>) <i>Itttt</i>?"
        [/message]

        {DELAY 750}

        [message]
            speaker=Yumi
            message= _ "(<i>shudders</i>)"
        [/message]

        [modify_unit]
            [filter]
                id=Yumi
            [/filter]
            attacks_left=1
            moves=6
        [/modify_unit]
        [modify_unit]
            [filter]
                id=Aryel
            [/filter]
            attacks_left=1
            moves=6
        [/modify_unit]

        {DELAY 750}

        [fade_out_music][/fade_out_music]

        {REPLACE_SCENARIO_MUSIC everlasting_night.ogg}
        {APPEND_MUSIC           into_the_shadows.ogg}

        [place_shroud]
            side=1
        [/place_shroud]
        [reset_fog]
            [filter_side]
                side=1
            [/filter_side]
        [/reset_fog]
        [redraw]
            side=1
            clear_shroud=yes
        [/redraw]
        [remove_shroud]
            side=1
            x,y=14,9
            radius=8
        [/remove_shroud]
        [lift_fog]
            [filter_side]
                side=1
            [/filter_side]
            x,y=14,9
            radius=6
            multiturn=yes
        [/lift_fog]

        {DELAY 750}

        {UNFADE_SCREEN}

        {DELAY 500}
        {SCROLL_TO 14 9}
        {PLAY_SOUND "magic-dark.ogg"}
        [terrain]
            x,y=14,9
            terrain=Woby
        [/terrain]
        [redraw][/redraw]
        {DELAY 250}
        [move_unit]
            id=Aryel
            to_x,to_y=12,10
        [/move_unit]
        {DELAY 250}
        [terrain]
            x,y=14,9
            terrain=Gd^Fyok
        [/terrain]
        [redraw][/redraw]
        {PLAY_SOUND "magic-dark.ogg"}
        {DELAY 250}
        [move_unit]
            id=Yumi
            to_x,to_y=14,11
        [/move_unit]
        {DELAY 250}
        [terrain]
            x,y=14,9
            terrain=Woby
        [/terrain]
        [redraw][/redraw]
        {PLAY_SOUND "magic-dark.ogg"}
        {DELAY 250}
        [move_unit]
            id=Aryel
            to_x,to_y=11,11
        [/move_unit]
        {DELAY 250}
        {PLAY_SOUND "magic-dark.ogg"}
        [terrain]
            x,y=14,9
            terrain=Gd^Fyok
        [/terrain]
        [redraw][/redraw]
        {DELAY 250}
        [move_unit]
            id=Yumi
            to_x,to_y=14,12
        [/move_unit]
        {DELAY 250}
        {PLAY_SOUND "magic-dark.ogg"}
        [terrain]
            x,y=14,9
            terrain=Woby
        [/terrain]
        [redraw][/redraw]
        {DELAY 250}
        {PLAY_SOUND "magic-faeriefire.ogg"}
        {DELAY 500}

        [unit]
            id=Luna
            type=Illusory Angel
            animate=yes
            side=2
            x,y=14,9
            random_traits=no
            generate_name=no
            gender=female
        [/unit]

        {DELAY 1000}

        [message]
            speaker=Luna
            message= _ "<i>Welcome, young faerie. I see you brought a friend with you this time.</i>"
        [/message]

        [message]
            speaker=Yumi
            message= _ "(<i>whimpers</i>)"
        [/message]
        [message]
            speaker=Aryel
            message= _ "Yumi?"
        [/message]

        [message]
            speaker=Luna
            message= _ "<i>You know what I am here for.</i>"
        [/message]

        [message]
            speaker=Yumi
            message= _ "(<i>holds head</i>)"
        [/message]
        [move_unit]
            id=Aryel
            to_x,to_y=14,11
        [/move_unit]
        [message]
            speaker=Aryel
            message= _ "You stay away from her!"
        [/message]
        [message]
            speaker=Luna
            message= _ "<i>You cannot stop me.</i>"
        [/message]
        [kill]
            id=Luna
            animate=yes
        [/kill]
        [unit]
            id=Luna
            type=Illusory Angel
            animate=yes
            side=2
            x,y=14,13
            random_traits=no
            generate_name=no
            gender=female
        [/unit]
        [message]
            speaker=Aryel
            message= _ "I won't let you!"
        [/message]
        {PLAY_SOUND "melee-fire.ogg"}
        [harm_unit]
            [filter]
                id=Luna
            [/filter]
            [primary_attack]
                range=ranged
                name=blood boil
            [/primary_attack]
            [secondary_attack]
                range=ranged
                name=blood boil
            [/secondary_attack]
            amount=999
            animate=yes
            kill=yes
            fire_event=no
        [/harm_unit]

        {DELAY 500}

        [store_locations]
            [and]
                x,y=14,9
                radius=7
            [/and]

            [not]
                [filter]
                [/filter]

                [or]
                    [filter_adjacent_location]
                        [filter]
                        [/filter]
                    [/filter_adjacent_location]
                [/or]
            [/not]
            variable=spawn_points
        [/store_locations]

        [set_variable]
            name=tmp
            rand=0..$($spawn_points.length-1)
        [/set_variable]

        [set_variable]
            name=x_loc
            value=$spawn_points[$tmp].x
        [/set_variable]

        [set_variable]
            name=y_loc
            value=$spawn_points[$tmp].y
        [/set_variable]

        [unit]
            id=Luna
            type=Illusory Angel
            animate=yes
            side=2
            x,y=$x_loc,$y_loc
            random_traits=no
            generate_name=no
            gender=female
        [/unit]

        [message]
            speaker=Aryel
            message= _ "What? How are you-"
        [/message]
        [message]
            speaker=Luna
            message= _ "<i>That was a fake.</i>"
        [/message]

        {PLAY_SOUND "melee-fire.ogg"}
        [harm_unit]
            [filter]
                id=Luna
            [/filter]
            [primary_attack]
                range=ranged
                name=blood boil
            [/primary_attack]
            [secondary_attack]
                range=ranged
                name=blood boil
            [/secondary_attack]
            amount=999
            animate=yes
            kill=yes
            fire_event=no
        [/harm_unit]

        {DELAY 500}

        [store_locations]
            [and]
                x,y=14,9
                radius=7
            [/and]

            [not]
                [filter]
                [/filter]

                [or]
                    [filter_adjacent_location]
                        [filter]
                        [/filter]
                    [/filter_adjacent_location]
                [/or]
            [/not]
            variable=spawn_points
        [/store_locations]

        [set_variable]
            name=tmp
            rand=0..$($spawn_points.length-1)
        [/set_variable]

        [set_variable]
            name=x_loc
            value=$spawn_points[$tmp].x
        [/set_variable]

        [set_variable]
            name=y_loc
            value=$spawn_points[$tmp].y
        [/set_variable]

        [unit]
            id=Luna
            type=Illusory Angel
            animate=yes
            side=2
            x,y=$x_loc,$y_loc
            random_traits=no
            generate_name=no
            gender=female
        [/unit]

        [message]
            speaker=Luna
            message= _ "<i>That one too.</i>"
        [/message]

        {PLAY_SOUND "melee-fire.ogg"}
        [harm_unit]
            [filter]
                id=Luna
            [/filter]
            [primary_attack]
                range=ranged
                name=blood boil
            [/primary_attack]
            [secondary_attack]
                range=ranged
                name=blood boil
            [/secondary_attack]
            amount=999
            animate=yes
            kill=yes
            fire_event=no
        [/harm_unit]

        {DELAY 500}

        [store_locations]
            [and]
                x,y=14,9
                radius=7
            [/and]

            [not]
                [filter]
                [/filter]

                [or]
                    [filter_adjacent_location]
                        [filter]
                        [/filter]
                    [/filter_adjacent_location]
                [/or]
            [/not]
            variable=spawn_points
        [/store_locations]

        [set_variable]
            name=tmp
            rand=0..$($spawn_points.length-1)
        [/set_variable]

        [set_variable]
            name=x_loc
            value=$spawn_points[$tmp].x
        [/set_variable]

        [set_variable]
            name=y_loc
            value=$spawn_points[$tmp].y
        [/set_variable]

        [unit]
            id=Luna
            type=Illusory Angel
            animate=yes
            side=2
            x,y=$x_loc,$y_loc
            random_traits=no
            generate_name=no
            gender=female
        [/unit]

        [message]
            speaker=Luna
            message= _ "<i>Stubborn, aren't you?</i>"
        [/message]
        [message]
            speaker=Aryel
            message= _ "I'll do this all night if I have to."
        [/message]
        [message]
            speaker=Luna
            message= _ "<i>I can see that.</i>"
        [/message]

        [kill]
            id=Luna
            animate=yes
        [/kill]

        {DELAY 500}

        {S13_SPAWN_ILLUSION ("Illusion1")}
        {S13_SPAWN_ILLUSION ("Illusion2")}
        [store_locations]
            [and]
                x,y=14,9
                radius=7
            [/and]

            [not]
                [filter]
                [/filter]

                [or]
                    [filter_adjacent_location]
                        [filter]
                        [/filter]
                    [/filter_adjacent_location]
                [/or]
            [/not]
            variable=spawn_points
        [/store_locations]

        [set_variable]
            name=tmp
            rand=0..$($spawn_points.length-1)
        [/set_variable]

        [set_variable]
            name=x_loc
            value=$spawn_points[$tmp].x
        [/set_variable]
            [set_variable]
            name=y_loc
            value=$spawn_points[$tmp].y
        [/set_variable]
        [unit]
            id=Luna
            type=Illusory Angel
            animate=yes
            side=2
            x,y=$x_loc,$y_loc
            random_traits=no
            generate_name=no
            gender=female
        [/unit]
        [clear_variable]
            name=x_loc,y_loc,spawn_points,tmp
        [/clear_variable]
        {S13_SPAWN_ILLUSION ("Illusion3")}
        {S13_SPAWN_ILLUSION ("Illusion4")}

        [clear_variable]
            name=x_loc,y_loc,spawn_points,tmp
        [/clear_variable]

        [message]
            speaker=Illusion1
            message= _ "<i>This would be much easier if you did not resist.</i>"
        [/message]
        [message]
            speaker=Illusion3
            message= _ "<i>Alas, it seems that I must subdue you by force.</i>"
        [/message]
        [message]
            speaker=Illusion4
            message= _ "<i>But, do not worry. There will be no pain.</i>"
        [/message]
        [message]
            speaker=Aryel
            message= _ "Oh you have got to be joking..."
        [/message]

        [modify_turns]
            value=-1
        [/modify_turns]
        [objectives]
            {OBJECTIVE_VICTORY  ( _ "Defeat the Illusory Angel")}
            {OBJECTIVE_DEFEAT  ( _ "Death of Yumi")}
            {OBJECTIVE_DEFEAT  ( _ "Death of Aryel")}
            {OBJECTIVE_NOTE ( _ "The damage you take on each turn will increase as time passes.")}
            {OBJECTIVE_NOTE ( _ "If you kill all the illusions, more will automatically spawn.")}
        [/objectives]

        [set_variable]
            name=boss_battle
            value=1
        [/set_variable]
        [set_variable]
            name=illusions_hit
            value=0
        [/set_variable]
        [set_variable]
            name=real_hit
            value=0
        [/set_variable]
        [set_variable]
            name=mirrored
            value=0
        [/set_variable]
    [/event]

    [event]
        name=side 2 turn
        first_time_only=no
        [store_unit]
            [filter]
                ability=dreamwalk
            [/filter]
            variable=heal_unit
        [/store_unit]

        [for]
            array=heal_unit
            [do]
                {VARIABLE heal_health $heal_unit[$i].max_hitpoints}
                {VARIABLE_OP heal_health sub $heal_unit[$i].hitpoints}
                {VARIABLE_OP heal_health multiply 0.2}

                [if]
                    [variable]
                        name=heal_health
                        greater_than=0
                    [/variable]
                    [then]
                        [heal_unit]
                            [filter]
                                x,y=$heal_unit[$i].x,$heal_unit[$i].y
                            [/filter]
                            amount=$heal_health
                            animate=yes
                            restore_statuses=yes
                        [/heal_unit]
                    [/then]
                [/if]
                {CLEAR_VARIABLE heal_health}
            [/do]
        [/for]
        {CLEAR_VARIABLE heal_unit}
    [/event]

    [event]
        name=defender hits
        first_time_only=yes
        [filter_condition]
            [variable]
                name=boss_battle
                numerical_equals=1
            [/variable]
        [/filter_condition]
        [filter]
            type=Blood Fae,Shadow Fae
        [/filter]
        [filter_second]
            type=Illusory Angel,Illusory Angel Illusion
        [/filter_second]
        [filter_attack]
            [not]
                name=void assault
            [/not]
        [/filter_attack]
        [filter_condition]
            [variable]
                name=mirrored
                numerical_equals=0
            [/variable]
        [/filter_condition]

        [message]
            speaker=Aryel
            message= _ "She's copying our attacks! That's- that's cheating!"
        [/message]
        [message]
            speaker=second_unit
            message= _ "<i>Call it what you will.</i>"
        [/message]
        {VARIABLE_OP mirrored add 1}
    [/event]

    [event]
        name=attacker hits
        first_time_only=yes
        [filter_condition]
            [variable]
                name=boss_battle
                numerical_equals=1
            [/variable]
        [/filter_condition]
        [filter]
            type=Illusory Angel,Illusory Angel Illusion
        [/filter]
        [filter_second]
            type=Blood Fae,Shadow Fae
        [/filter_second]
        [filter_second_attack]
            [not]
                name=void assault
            [/not]
        [/filter_second_attack]
        [filter_condition]
            [variable]
                name=mirrored
                numerical_equals=0
            [/variable]
        [/filter_condition]

        [message]
            speaker=Aryel
            message= _ "She's copying our attacks! That's- that's cheating!"
        [/message]
        [message]
            speaker=unit
            message= _ "<i>Call it what you will.</i>"
        [/message]
        {VARIABLE_OP mirrored add 1}
    [/event]
    [event]
        name=attacker hits
        first_time_only=yes
        [filter_condition]
            [variable]
                name=boss_battle
                numerical_equals=1
            [/variable]
        [/filter_condition]
        [filter]
            type=Shadow Fae
        [/filter]
        [filter_second]
            type=Illusory Angel
        [/filter_second]
        [filter_attack]
            name=void assault
        [/filter_attack]

        [message]
            speaker=second_unit
            message= _ "<i>What is this sorcery?</i>"
        [/message]
    [/event]

#define ILLUSION_TEXT
        [if]
            [variable]
                name=boss_battle
                numerical_equals=1
            [/variable]
            [then]
                [switch]
                    variable=illusions_hit
                    [case]
                        value=3
                        [message]
                            speaker=Aryel
                            message= _ "Is every single one of these things fake? Geez."
                        [/message]
                        {VARIABLE_OP illusions_hit add 1}
                    [/case]
                    [case]
                        value=9
                        [message]
                            speaker=narrator
                            message= _ "<i>You won't hit me like that</i>."
                        [/message]
                        {VARIABLE_OP illusions_hit add 1}
                    [/case]
                    [case]
                        value=15
                        [message]
                            speaker=Aryel
                            message= _ "This is getting irritating."
                        [/message]
                        {VARIABLE_OP illusions_hit add 1}
                    [/case]
                    [case]
                        value=21
                        [message]
                            speaker=Yumi
                            message= _ "(<i>frowns</i>) <i>They're all fake...</i>"
                        [/message]
                        {VARIABLE_OP illusions_hit add 1}
                    [/case]
                    [case]
                        value=27
                        [message]
                            speaker=Aryel
                            message= _ "Will you just come out here and fight us properly?"
                        [/message]
                        {VARIABLE_OP illusions_hit add 1}
                    [/case]
                    [case]
                        value=33
                        [message]
                            speaker=narrator
                            message= _ "<i>The more mirrors you shatter, the more shall appear</i>."
                        [/message]
                        {VARIABLE_OP illusions_hit add 1}
                    [/case]
                    [case]
                        value=40
                        [message]
                            speaker=Yumi
                            message= _ "<i>Which one is the real one..?</i>"
                        [/message]
                        {VARIABLE_OP illusions_hit add 1}
                    [/case]
                    [else]
                        {VARIABLE_OP illusions_hit add 1}
                    [/else]
                [/switch]
            [/then]
        [/if]
        [if]
            [have_unit]
                type=Illusory Angel Illusion
            [/have_unit]
            [then][/then]
            [else]
                {REGENERATE_ILLUSIONS}
            [/else]
        [/if]
#enddef

    [event]
        name=attacker hits
        first_time_only=no

        [filter_second]
            type=Illusory Angel Illusion
        [/filter_second]
        {PLAY_SOUND "magic-dark-miss.ogg"}
        [kill]
            x,y=$x2,$y2
        [/kill]
        [filter_condition]
            [variable]
                name=boss_battle
                numerical_equals=1
            [/variable]
            [and]
                [variable]
                    name=second_unit.hitpoints
                    less_than=90
                [/variable]
            [/and]
        [/filter_condition]

        {ILLUSION_TEXT}
    [/event]

    [event]
        name=defender hits
        first_time_only=no
        [filter_condition]
            [variable]
                name=boss_battle
                numerical_equals=1
            [/variable]
            [and]
                [variable]
                    name=unit.hitpoints
                    less_than=90
                [/variable]
            [/and]
        [/filter_condition]
        [filter]
            type=Illusory Angel Illusion
        [/filter]
        {PLAY_SOUND "magic-dark-miss.ogg"}
        [kill]
            x,y=$x1,$y1
        [/kill]

        {ILLUSION_TEXT}
    [/event]

    [event]
        name=attack end
        first_time_only=no
        [filter_condition]
            [variable]
                name=boss_battle
                numerical_equals=1
            [/variable]
        [/filter_condition]

        [if]
            [have_unit]
                x,y=$x1,$y1
                type=Illusory Angel
                [or]
                    x,y=$x2,$y2
                    type=Illusory Angel
                [/or]
            [/have_unit]
            [then]
                [switch]
                    variable=real_hit
                    [case]
                        value=0
                        [message]
                            speaker=Aryel
                            message= _ "Gotcha!"
                        [/message]
                        {DELAY 250}
                        {REGENERATE_ILLUSIONS}
                        {DELAY 250}
                        [message]
                            speaker=Aryel
                            message= _ "... or not."
                        [/message]
                        {VARIABLE_OP real_hit add 1}
                    [/case]
                    [case]
                        value=1
                        [message]
                            speaker=Luna
                            message= _ "<i>Not this time.</i>"
                        [/message]
                        {DELAY 250}
                        {REGENERATE_ILLUSIONS}
                        {DELAY 250}
                        {VARIABLE_OP real_hit add 1}
                    [/case]
                    [case]
                        value=3
                        [message]
                            speaker=Aryel
                            message= _ "Quit running away!"
                        [/message]
                        {REGENERATE_ILLUSIONS}
                        {VARIABLE_OP real_hit add 1}
                    [/case]
                    [case]
                        value=6
                        [message]
                            speaker=Yumi
                            message= _ "<i>She won't stay still...</i>"
                        [/message]
                        {DELAY 250}
                        {REGENERATE_ILLUSIONS}
                        {DELAY 250}
                        {VARIABLE_OP real_hit add 1}
                    [/case]
                    [else]
                        {VARIABLE_OP real_hit add 1}
                        {REGENERATE_ILLUSIONS}
                    [/else]
                [/switch]
            [/then]
        [/if]
    [/event]

    # and the damage goes up and up and up
    [event]
        name=turn 20 end
        [filter_condition]
            [variable]
                name=boss_battle
                less_than=2
            [/variable]
        [/filter_condition]
        #ifndef HARD
            [set_variable]
                name=turn_damage
                value=3
            [/set_variable]
        #endif
        #ifdef HARD
            [set_variable]
                name=turn_damage
                value=5
            [/set_variable]
        #endif
    [/event]
    [event]
        name=turn 25 end
        [filter_condition]
            [variable]
                name=boss_battle
                less_than=2
            [/variable]
        [/filter_condition]
        #ifdef EASY
            [set_variable]
                name=turn_damage
                value=4
            [/set_variable]
        #endif
        #ifdef NORMAL
            [set_variable]
                name=turn_damage
                value=5
            [/set_variable]
        #endif
        #ifdef HARD
            [set_variable]
                name=turn_damage
                value=6
            [/set_variable]
        #endif
    [/event]
    [event]
        name=turn 30 end
        [filter_condition]
            [variable]
                name=boss_battle
                less_than=2
            [/variable]
        [/filter_condition]
        #ifdef EASY
            [set_variable]
                name=turn_damage
                value=5
            [/set_variable]
        #endif
        #ifdef NORMAL
            [set_variable]
                name=turn_damage
                value=6
            [/set_variable]
        #endif
        #ifdef HARD
            [set_variable]
                name=turn_damage
                value=7
            [/set_variable]
        #endif
    [/event]
    # you really ought to finish phase 1 by turn 35 ish
    [event]
        name=turn 35 end
        [filter_condition]
            [variable]
                name=boss_battle
                less_than=2
            [/variable]
        [/filter_condition]
        #ifdef EASY
            [set_variable]
                name=turn_damage
                value=7
            [/set_variable]
        #endif
        #ifdef NORMAL
            [set_variable]
                name=turn_damage
                value=8
            [/set_variable]
        #endif
        #ifdef HARD
            [set_variable]
                name=turn_damage
                value=9
            [/set_variable]
        #endif
    [/event]
    [event]
        name=turn 40 end
        [filter_condition]
            [variable]
                name=boss_battle
                less_than=2
            [/variable]
        [/filter_condition]
        [set_variable]
            name=turn_damage
            value=10
        [/set_variable]
    [/event]

#define VOID_SEED
        [store_locations]
            variable=blood_hex
            terrain=Wwb,Woby,Xu,Qxv
        [/store_locations]
        [for]
            array=blood_hex
            [do]
                [set_variable]
                    name=change_terrain
                    rand=1..100
                [/set_variable]
                [if]
                    [variable]
                        name=change_terrain
                        less_than=3
                    [/variable]
                    [then]
                        [terrain]
                            x,y=$blood_hex[$i].x,$blood_hex[$i].y
                            terrain=Qxua
                        [/terrain]
                    [/then]
                [/if]
                {CLEAR_VARIABLE change_terrain}
            [/do]
        [/for]
        {CLEAR_VARIABLE blood_hex}
        [redraw][/redraw]
#enddef

#define DRAW_VOID
        [store_locations]
            variable=blood_hex
            terrain=Wwb,Woby,Xu,Qxv
            [filter_adjacent_location]
                terrain=Qxua
                count=1-3
            [/filter_adjacent_location]
        [/store_locations]
        [for]
            array=blood_hex
            [do]
                [set_variable]
                    name=change_terrain
                    rand=1..25
                [/set_variable]
                [if]
                    [variable]
                        name=change_terrain
                        less_than=6
                    [/variable]
                    [then]
                        [terrain]
                             x,y=$blood_hex[$i].x,$blood_hex[$i].y
                            terrain=Qxua
                        [/terrain]
                    [/then]
                [/if]
                {CLEAR_VARIABLE change_terrain}
            [/do]
        [/for]
        {CLEAR_VARIABLE blood_hex}
        [store_locations]
            variable=blood_hex
            terrain=Wwb,Xu
            [not]
                terrain=Gd^Fyok,Xue
            [/not]
            [filter_adjacent_location]
                terrain=Qxua
                count=4-6
            [/filter_adjacent_location]
        [/store_locations]
        [for]
            array=blood_hex
            [do]
                [set_variable]
                    name=change_terrain
                    rand=1..50
                [/set_variable]
                [if]
                    [variable]
                        name=change_terrain
                        less_than=6
                    [/variable]
                    [then]
                        [terrain]
                            x,y=$blood_hex[$i].x,$blood_hex[$i].y
                            terrain=Qxua
                        [/terrain]
                    [/then]
                [/if]
                {CLEAR_VARIABLE change_terrain}
            [/do]
        [/for]
        {CLEAR_VARIABLE blood_hex}
        [redraw][/redraw]
#enddef

    [event]
        name=last breath
        [filter]
            id=Luna
        [/filter]
        [filter_condition]
            [variable]
                name=boss_battle
                numerical_equals=1
            [/variable]
        [/filter_condition]

        {PLAY_SOUND "magic-dark-miss.ogg"}
        [kill]
            type=Illusory Angel Illusion
            animate=yes
        [/kill]

        [fade_out_music][/fade_out_music]

        {REPLACE_SCENARIO_MUSIC silence.ogg}
        {DELAY 750}

        [store_unit]
            [filter]
                id=Yumi
            [/filter]
            variable=yumi
        [/store_unit]
        [store_unit]
            [filter]
                id=Aryel
            [/filter]
            variable=aryel
        [/store_unit]

        #ifdef EASY
        {VARIABLE_OP yumi.experience add 250}
        {VARIABLE_OP aryel.experience add 250}

        [unstore_unit]
            variable=yumi
            find_vacant=no
            text= _ "+250 XP"
            red,green,blue=255,0,255
            advance=no
        [/unstore_unit]
        [unstore_unit]
            variable=aryel
            find_vacant=no
            text= _ "+250 XP"
            red,green,blue=255,0,255
            advance=no
        [/unstore_unit]
        #endif
        #ifdef NORMAL
        {VARIABLE_OP yumi.experience add 200}
        {VARIABLE_OP aryel.experience add 200}

        [unstore_unit]
            variable=yumi
            find_vacant=no
            text= _ "+200 XP"
            red,green,blue=255,0,255
            advance=no
        [/unstore_unit]
        [unstore_unit]
            variable=aryel
            find_vacant=no
            text= _ "+200 XP"
            red,green,blue=255,0,255
            advance=no
        [/unstore_unit]
        #endif
        #ifdef HARD
        {VARIABLE_OP yumi.experience add 100}
        {VARIABLE_OP aryel.experience add 100}

        [unstore_unit]
            variable=yumi
            find_vacant=no
            text= _ "+100 XP"
            red,green,blue=255,0,255
            advance=no
        [/unstore_unit]
        [unstore_unit]
            variable=aryel
            find_vacant=no
            text= _ "+100 XP"
            red,green,blue=255,0,255
            advance=no
        [/unstore_unit]
        #endif

        {CLEAR_VARIABLE yumi}
        {CLEAR_VARIABLE aryel}
        {DELAY 750}
        [message]
            speaker=Luna
            message= _ "<i>Well done.</i>"
        [/message]
        {DELAY 750}
        [message]
            speaker=Luna
            message= _ "<i>However...</i>"
        [/message]

        [store_unit]
            [filter]
                id=Luna
            [/filter]
            variable=luna
        [/store_unit]
        [unit]
            id=Dummy
            type=Guardian of Darkness
            name=_ "Illusory Angel"
            animate=no
            side=2
            x,y=1,39
            hitpoints=1
            max_hitpoints=127
            random_traits=no
            generate_name=no
            gender=female
            facing=$luna.facing
        [/unit]
        [store_unit]
            [filter]
                id=Dummy
            [/filter]
            variable=tmp
        [/store_unit]

        [kill]
            id=Dummy
        [/kill]

        {DELAY 250}
        [unstore_unit]
            variable=tmp
            x,y=$luna.x,$luna.y
            find_vacant=no
            check_passability=no
        [/unstore_unit]
        {DELAY 500}

        [message]
            speaker=Dummy
            message= _ "<i>Your efforts are pointless.</i>"
        [/message]

        [set_variable]
            name=luna.hitpoints
            value=1
        [/set_variable]

        [unstore_unit]
            variable=luna
            find_vacant=no
            check_passability=no
        [/unstore_unit]
        {DELAY 250}

        {REPEAT 2 ({QUAKE_FIXED "rumble.ogg"})}

        [terrain]
            x,y=14,9
            terrain=Qxua
        [/terrain]
        [redraw][/redraw]
        {DELAY 250}
        [terrain]
            x,y=14,9
            terrain=Woby
        [/terrain]
        [redraw][/redraw]
        {DELAY 250}
        [terrain]
            x,y=14,9
            terrain=Qxua
        [/terrain]
        [redraw][/redraw]
        {DELAY 250}
        [terrain]
            x,y=14,9
            terrain=Woby
        [/terrain]
        [redraw][/redraw]
        {DELAY 250}
        [terrain]
            x,y=14,9
            terrain=Qxua
        [/terrain]
        [redraw][/redraw]
        {DELAY 500}
        [terrain]
            x,y=14,9
            radius=1
            terrain=Qxua
        [/terrain]
        [redraw][/redraw]
        {DELAY 500}
        {DRAW_VOID}
        {DELAY 500}
        {DRAW_VOID}
        {DELAY 500}
        {DRAW_VOID}
        {DELAY 500}
        {DRAW_VOID}

        {DELAY 250}
        [unstore_unit]
            variable=tmp
            x,y=$luna.x,$luna.y
            find_vacant=no
            check_passability=no
        [/unstore_unit]
        {DELAY 750}

        [message]
            speaker=Dummy
            message= _ "<i><b>It</b> is coming.</i>"
        [/message]
        {DELAY 250}

        [kill]
            id=Dummy
        [/kill]

        [unit]
            id=Luna
            type=Illusory Angel
            animate=no
            side=2
            x,y=$luna.x,$luna.y
            random_traits=no
            generate_name=no
            gender=female
            hitpoints=1
        [/unit]

        {DELAY 250}
        {FADE_SCREEN}
        [reset_fog]
            [filter_side]
                side=1
            [/filter_side]
        [/reset_fog]
        [store_locations]
            variable=wall
            terrain=Xue
        [/store_locations]
        [for]
            array=wall
            [do]
                [terrain]
                    x,y=$wall[$i].x,$wall[$i].y
                    terrain=Woby
                [/terrain]
            [/do]
        [/for]
        {CLEAR_VARIABLE wall}
        {REPEAT 2 ({QUAKE_FIXED "rumble.ogg"})}
        {DELAY 250}
        {VOID_SEED}
        {PLAY_SOUND "magic-dark.ogg"}
        {DELAY 500}
        {DRAW_VOID}
        {PLAY_SOUND "magic-dark.ogg"}
        {DELAY 500}
        {DRAW_VOID}
        {PLAY_SOUND "magic-dark.ogg"}
        {DELAY 250}
        {PLAY_SOUND "magic-dark.ogg"}
        {DELAY 500}
        {REPEAT 2 ({QUAKE_FIXED "rumble.ogg"})}
        #ifdef NORMAL
            {DRAW_VOID}
        #endif
        #ifdef HARD
            {DRAW_VOID}
            {DRAW_VOID}
        #endif

        [fade_out_music][/fade_out_music]

        {REPLACE_SCENARIO_MUSIC frantic.ogg}

        [store_locations]
            x,y=36,36
            radius=3
            variable=spawn_points
        [/store_locations]

        [set_variable]
            name=loc
            rand=0..$($spawn_points.length-1)
        [/set_variable]

        [set_variable]
            name=x_loc
            value=$spawn_points[$loc].x
        [/set_variable]

        [set_variable]
            name=y_loc
            value=$spawn_points[$loc].y
        [/set_variable]

        [terrain]
            x,y=$x_loc,$y_loc
            terrain=Gd^Fyok
        [/terrain]
        [redraw][/redraw]
        [modify_unit]
            [filter]
                id=Luna
            [/filter]
            hitpoints=127
        [/modify_unit]

        {UNFADE_SCREEN}
        [modify_unit]
            [filter]
                id=Yumi
            [/filter]
            attacks_left=1
            moves=6
        [/modify_unit]
        [modify_unit]
            [filter]
                id=Aryel
            [/filter]
            attacks_left=1
            moves=6
        [/modify_unit]
        {DELAY 250}
        [harm_unit]
            [filter]
                type=Manifestation
            [/filter]
            amount=4
            animate=no
            kill=no
            slowed=yes
        [/harm_unit]
        {DELAY 400}
        [harm_unit]
            [filter]
                id=Aryel
            [/filter]
            amount=1
            animate=yes
            kill=no
            slowed=no
        [/harm_unit]
        [modify_unit]
            [filter]
                id=Aryel
            [/filter]
            moves=5
        [/modify_unit]
        [message]
            speaker=Aryel
            message= _ "Owwww..."
        [/message]
        {DELAY 500}
        [harm_unit]
            [filter]
                id=Aryel
            [/filter]
            amount=1
            animate=yes
            kill=no
            slowed=no
        [/harm_unit]
        [modify_unit]
            [filter]
                id=Aryel
            [/filter]
            moves=4
        [/modify_unit]
        {DELAY 250}
        [message]
            speaker=Aryel
            message= _ "I-it's cold-"
        [/message]
        {DELAY 500}
        [harm_unit]
            [filter]
                id=Aryel
            [/filter]
            amount=1
            animate=yes
            kill=no
            slowed=no
        [/harm_unit]
        {DELAY 250}
        [message]
            speaker=Aryel
            message= _ "I can't..."
        [/message]
        {DELAY 250}
        [message]
            speaker=Yumi
            message= _ "<i>It's hurting Aryel! I have to stop it...</i>"
        [/message]
        {PLAY_SOUND "magic-faeriefire.ogg"}
        {DELAY 500}
        {PLAY_SOUND "magic-dark-miss.ogg"}
        [harm_unit]
            [filter]
                id=Aryel
            [/filter]
            amount=1
            animate=yes
            kill=no
            slowed=no
        [/harm_unit]
        {DELAY 350}
        {PLAY_SOUND "magic-faeriefire.ogg"}
        {DELAY 500}
        {PLAY_SOUND "magic-dark-miss.ogg"}
        [harm_unit]
            [filter]
                id=Aryel
            [/filter]
            amount=1
            animate=yes
            kill=no
            slowed=no
        [/harm_unit]
        [modify_unit]
            [filter]
                id=Aryel
            [/filter]
            moves=3
        [/modify_unit]
        {DELAY 250}
        {PLAY_SOUND "magic-faeriefire.ogg"}
        {DELAY 250}
        {PLAY_SOUND "magic-faeriefire.ogg"}
        {DELAY 250}
        [message]
            speaker=Aryel
            message= _ "(<i>breathes</i>) Ow."
        [/message]
        [message]
            speaker=Yumi
            message= _ "Are you... okay?"
        [/message]
        [message]
            speaker=Aryel
            message= _ "(<i>shudders</i>) Just cold. Really cold."
        [/message]
        {DELAY 500}
        [message]
            speaker=Yumi
            message= _ "(<i>bites lip</i>) This was a bad idea. We shouldn't have come."
        [/message]
        [message]
            speaker=Aryel
            message= _ "No- no... just..."
        [/message]
        {DELAY 250}
        [harm_unit]
            [filter]
                id=Aryel
            [/filter]
            amount=1
            kill=no
            slowed=no
        [/harm_unit]
        {DELAY 350}
        [harm_unit]
            [filter]
                id=Aryel
            [/filter]
            amount=0
            kill=no
            slowed=no
        [/harm_unit]
        {DELAY 500}
        [message]
            speaker=Aryel
            message= _ "Let's just get out of here. I don't think we can just stand here and fight her anymore."
        [/message]
        [message]
            speaker=Yumi
            message= _ "Okay."
        [/message]
        [message]
            speaker=Luna
            message= _ "<i>You should not run from me. If they catch you, it will be even worse.</i>"
        [/message]

        {S13_SPAWN_ILLUSION_NOID 32 32 6}
        {S13_SPAWN_ILLUSION_NOID 32 32 6}
        {S13_SPAWN_ILLUSION_NOID 32 32 6}

        #ifdef NORMAL
            {S13_SPAWN_ILLUSION_NOID 32 32 6}
        #endif
        #ifdef HARD
            {S13_SPAWN_ILLUSION_NOID 32 32 6}
            {S13_SPAWN_ILLUSION_NOID 32 32 6}
            {S13_SPAWN_ILLUSION_NOID 32 32 6}
        #endif

        [objectives]
            {OBJECTIVE_VICTORY  ( _ "Escape")}
            {OBJECTIVE_DEFEAT  ( _ "Death of Yumi")}
            {OBJECTIVE_DEFEAT  ( _ "Death of Aryel")}
            {OBJECTIVE_NOTE ( _ "Avoid stepping on void tiles.")}
            {OBJECTIVE_NOTE ( _ "Search near the starting location.")}
            {OBJECTIVE_NOTE ( _ "Do not fight the Illusory Angel.")}
        [/objectives]

        [set_variable]
            name=turn_damage
            value=3
        [/set_variable]

        [set_variable]
            name=boss_battle
            value=2
        [/set_variable]

        {CLEAR_VARIABLE luna}
        {CLEAR_VARIABLE tmp}
        {CLEAR_VARIABLE loc}
        {CLEAR_VARIABLE spawn_points}
    [/event]

    [event]
        name=last breath
        first_time_only=no
        [filter]
            id=Luna
        [/filter]
        [filter_condition]
            [variable]
                name=boss_battle
                numerical_equals=2
            [/variable]
        [/filter_condition]
        [store_unit]
            [filter]
                x,y=$x1,$y1
            [/filter]
            variable=tmp
        [/store_unit]
        [set_variable]
            name=tmp.hitpoints
            rand=127
        [/set_variable]
        [unstore_unit]
            variable=tmp
        [/unstore_unit]
        {CLEAR_VARIABLE tmp}
    [/event]

    [event]
        name=side 2 turn
        first_time_only=no
        [filter_condition]
            [variable]
                name=boss_battle
                numerical_equals=2
            [/variable]
        [/filter_condition]
        [store_locations]
            variable=hex
            terrain=Qxua
        [/store_locations]
        [for]
            array=hex
            [do]
                #ifdef HARD
                [set_variable]
                    name=spawn_val
                    rand=1..300
                [/set_variable]
                #endif
                #ifdef NORMAL
                [set_variable]
                    name=spawn_val
                    rand=1..450
                [/set_variable]
                #endif
                #ifdef EASY
                [set_variable]
                    name=spawn_val
                    rand=1..550
                [/set_variable]
                #endif
                [if]
                    [variable]
                        name=spawn_val
                        numerical_equals=4
                    [/variable]
                    [then]
                        [unit]
                            type=Illusory Angel Illusion
                            animate=no
                            side=2
                            x,y=$hex[$i].x,$hex[$i].y
                            random_traits=no
                            generate_name=no
                            gender=female
                        [/unit]
                    [/then]
                [/if]
                {CLEAR_VARIABLE spawn_val}
            [/do]
        [/for]
        {CLEAR_VARIABLE hex}

        {PLAY_SOUND "rumble.ogg"}
        {DRAW_VOID}
    [/event]

    [event]
        name=moveto
        first_time_only=yes
        [filter]
            id=Yumi
            [filter_location]
                terrain=Qxua
            [/filter_location]
        [/filter]

        [filter_condition]
            [variable]
                name=boss_battle
                numerical_equals=2
            [/variable]
        [/filter_condition]

        [message]
            speaker=Aryel
            message= _ "That doesn't hurt you?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "... no?"
        [/message]
        [message]
            speaker=Aryel
            message= _ "(<i>shivers</i>) Okay then."
        [/message]
    [/event]

    [event]
        name=moveto
        first_time_only=no
        [filter]
            [not]
                type=Illusory Angel, Illusory Angel Illusion, Shadow Fae
            [/not]
            [filter_location]
                terrain=Qxua
            [/filter_location]
        [/filter]

        [filter_condition]
            [variable]
                name=boss_battle
                numerical_equals=2
            [/variable]
        [/filter_condition]
        #ifdef HARD
        [set_variable]
            name=damage
            value=4
        [/set_variable]
        #endif
        #ifdef NORMAL
        [set_variable]
            name=damage
            value=3
        [/set_variable]
        #endif
        #ifdef EASY
        [set_variable]
            name=damage
            value=2
        [/set_variable]
        #endif
        [harm_unit]
            [filter]
                x,y=$x1,$y1
            [/filter]
            amount=$damage
            animate=yes
            kill=no
            slowed=yes
        [/harm_unit]
        {CLEAR_VARIABLE damage}
    [/event]

    [event]
        name=attacker hits
        first_time_only=no

        [filter_second]
            type=Illusory Angel Illusion
        [/filter_second]
        [filter_condition]
            [variable]
                name=boss_battle
                numerical_equals=2
            [/variable]
            [and]
                [variable]
                    name=second_unit.hitpoints
                    less_than=95
                [/variable]
            [/and]
        [/filter_condition]
        {PLAY_SOUND "magic-dark-miss.ogg"}
        [kill]
            x,y=$x2,$y2
        [/kill]
    [/event]

    [event]
        name=defender hits
        first_time_only=no
        [filter_condition]
            [variable]
                name=boss_battle
                numerical_equals=2
            [/variable]
            [and]
                [variable]
                    name=unit.hitpoints
                    less_than=95
                [/variable]
            [/and]
        [/filter_condition]
        [filter]
            type=Illusory Angel Illusion
        [/filter]
        {PLAY_SOUND "magic-dark-miss.ogg"}
        [kill]
            x,y=$x1,$y1
        [/kill]
    [/event]

    [event]
        name=moveto
        first_time_only=yes
        [filter]
            side=1
            [filter_location]
                terrain=Gd^Fyok
            [/filter_location]
        [/filter]
        [filter_condition]
            [variable]
                name=boss_battle
                numerical_equals=2
            [/variable]
        [/filter_condition]

        [store_unit]
            [filter]
                id=Yumi
            [/filter]
            variable=yumi_tmp
        [/store_unit]

        {DELAY 750}
        [kill]
            id=Yumi
        [/kill]
        {DELAY 750}
        [fade_out_music][/fade_out_music]

        {REPLACE_SCENARIO_MUSIC silence.ogg}
        [message]
            speaker=Aryel
            message= _ "Yumi?"
        [/message]
        {DELAY 500}
        {TURN_UNIT5 "Aryel"}
        {DELAY 500}
        [message]
            speaker=Aryel
            message= _ "... where'd she go?"
        [/message]
        {DELAY 500}
        [message]
            speaker=Aryel
            message= _ "Seriously?"
        [/message]

        [message]
            speaker=Luna
            message= _ "<i>She will not escape.</i>"
        [/message]

        [message]
            speaker=Aryel
            message= _ "(<i>growls</i>) Tell me where you took her!"
        [/message]
        [message]
            speaker=Luna
            message= _ "<i>Silly faerie.</i>"
        [/message]
        {DELAY 500}
        [kill]
            type=Illusory Angel Illusion
        [/kill]
        [kill]
            type=Illusory Angel
            animate=yes
        [/kill]
        {DELAY 300}
        [message]
            speaker=Aryel
            message= _ "What are you-"
        [/message]
        [store_unit]
            [filter]
                id=Aryel
            [/filter]
            variable=aryel_tmp
        [/store_unit]
        {DELAY 300}
        [unit]
            id=Luna
            type=Illusory Angel
            animate=yes
            side=2
            x,y=$aryel_tmp.x,$aryel_tmp.y
            random_traits=no
            generate_name=no
            gender=female
        [/unit]
        {DELAY 500}

        {PLAY_SOUND "magic-dark.ogg"}
        [harm_unit]
            [filter]
                id=Aryel
            [/filter]
            [primary_attack]
                range=ranged
                name=mirror_range
            [/primary_attack]
            [secondary_attack]
                range=ranged
                name=mirror_range
            [/secondary_attack]
            amount=1
            animate=yes
            kill=no
            fire_event=no
            slowed=yes
        [/harm_unit]
        {DELAY 500}
        [message]
            speaker=Aryel
            message= _ "(<i>gasps</i>)"
        [/message]
        [message]
            speaker=Aryel
            message= _ "You-"
        [/message]
        {PLAY_SOUND "magic-dark.ogg"}
        [harm_unit]
            [filter]
                id=Aryel
            [/filter]
            [primary_attack]
                range=ranged
                name=mirror_range
            [/primary_attack]
            [secondary_attack]
                range=ranged
                name=mirror_range
            [/secondary_attack]
            amount=1
            animate=yes
            kill=no
            fire_event=no
            slowed=yes
        [/harm_unit]
        {DELAY 300}
        [message]
            speaker=Aryel
            message= _ "I won't-"
        [/message]
        {DELAY 300}
        {PLAY_SOUND "magic-dark.ogg"}
        {PLAY_SOUND "petrified.ogg"}
        [harm_unit]
            [filter]
                id=Aryel
            [/filter]
            [primary_attack]
                range=ranged
                name=mirror_range
            [/primary_attack]
            [secondary_attack]
                range=ranged
                name=mirror_range
            [/secondary_attack]
            amount=1
            animate=yes
            kill=no
            fire_event=no
        [/harm_unit]
        {DELAY 250}
        [message]
            speaker=Aryel
            message= _ "-let you-"
        [/message]
        {DELAY 250}
        {PLAY_SOUND "magic-dark.ogg"}
        {PLAY_SOUND "petrified.ogg"}
        [harm_unit]
            [filter]
                id=Aryel
            [/filter]
            [primary_attack]
                range=ranged
                name=mirror_range
            [/primary_attack]
            [secondary_attack]
                range=ranged
                name=mirror_range
            [/secondary_attack]
            amount=1
            animate=yes
            kill=no
            fire_event=no
        [/harm_unit]
        {DELAY 250}
        [message]
            speaker=Aryel
            message= _ "-go after Yumi..."
        [/message]
        {DELAY 250}
        [harm_unit]
            [filter]
                id=Aryel
            [/filter]
            [primary_attack]
                range=ranged
                name=mirror_range
            [/primary_attack]
            [secondary_attack]
                range=ranged
                name=mirror_range
            [/secondary_attack]
            amount=1
            animate=yes
            kill=no
            fire_event=no
            petrified=yes
        [/harm_unit]
        {DELAY 750}

        [message]
            speaker=Luna
            message= _ "<i>Cute. Now be a good girl and don't move. I'll be back shortly.</i>"
        [/message]

        [kill]
            id=Luna
            animate=yes
        [/kill]

        {FADE_SCREEN}
        [kill]
            id=Aryel
        [/kill]
        {DELAY 500}

        [endlevel]
            result=victory
            bonus=yes
            {NEW_GOLD_CARRYOVER 100}
            replay_save=no
            carryover_report=no
            linger_mode=no
            next_scenario=14_Iron_Crescent
        [/endlevel]
    [/event]

    [event]
        name=turn 19
        first_time_only=no
        [filter_condition]
            [variable]
                name=boss_battle
                numerical_equals=0
            [/variable]
        [/filter_condition]

        [message]
            speaker=Yumi
            message= _ "(<i>holds head</i>)"
        [/message]
        [message]
            speaker=Aryel
            message= _ "Ugh... it hurts..."
        [/message]
    [/event]
    [event]
        name=turn 23
        first_time_only=no
        [filter_condition]
            [variable]
                name=boss_battle
                numerical_equals=0
            [/variable]
        [/filter_condition]

        [message]
            speaker=Yumi
            message= _ "(<i>rubs temples</i>) <i>My head...</i>"
        [/message]
        [message]
            speaker=Aryel
            message= _ "Yumi, you don't look so good."
        [/message]
        [message]
            speaker=Yumi
            message= _ "It hurts... my head..."
        [/message]
    [/event]
    [event]
        name=turn 24
        first_time_only=no
        [filter_condition]
            [variable]
                name=boss_battle
                numerical_equals=0
            [/variable]
        [/filter_condition]

        [message]
            speaker=Yumi
            message= _ "We really need to hurry up and find the tree."
        [/message]
    [/event]
    [event]
        name=turn 25
        first_time_only=no
        [filter_condition]
            [variable]
                name=boss_battle
                numerical_equals=0
            [/variable]
        [/filter_condition]

        [message]
            speaker=Aryel
            message= _ "Ow..."
        [/message]
    [/event]

    [event]
        name=time over

        [message]
            speaker=Yumi
            message= _ "(<i>pales</i>)"
        [/message]
        {DELAY 750}
        [message]
            speaker=Aryel
            message= _ "Yumi?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(<i>faints</i>)"
        [/message]
        [message]
            speaker=Aryel
            message= _ "Yumi!"
        [/message]

        [endlevel]
            result=defeat
        [/endlevel]
    [/event]

    # don't forget to unstore Esther
    [event]
        name=victory
        [kill]
            side=1
            type=Manifestation
        [/kill]
        [unstore_unit]
            variable=esther_tmp
            find_vacant=yes
        [/unstore_unit]
        [clear_menu_item]
            id=recruit_manifestation
        [/clear_menu_item]
        {CLEAR_VARIABLE esther_tmp}
        {CLEAR_VARIABLE turn_damage}
        {CLEAR_VARIABLE faster_spread}
        {CLEAR_VARIABLE boss_battle}
        {CLEAR_VARIABLE illusions_hit}
        {CLEAR_VARIABLE real_hit}
        {CLEAR_VARIABLE mirrored}
    [/event]

    [event]
        name=last breath
        [filter]
            id=Yumi
        [/filter]
        [message]
            speaker=Yumi
            message= _ "(<i>gasps</i>)"
        [/message]
        [message]
            speaker=Aryel
            message= _ "Yumi!"
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]
    [event]
        name=last breath
        [filter]
            id=Aryel
        [/filter]
        [message]
            speaker=Aryel
            message= _ "Ugh... i-it... hurts..."
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]
[/scenario]

#undef CAVE_WALL_SEED
#undef TERRAIN_GEN1
#undef TERRAIN_GEN2
#undef REGEN_ABYSS
#undef DRAW_WALLS
#undef DRAW_WALLS2
#undef DRAW_WALLS3
#undef DRAW_WALLS4
#undef BREAK_WALLS
#undef DRAW_DARKNESS1
#undef DRAW_DARKNESS2
#undef SWITCH_WALLS
#undef S13_SPAWN_ILLUSION_NOID X Y R
#undef S13_SPAWN_ILLUSION ID
#undef REGENERATE_ILLUSIONS
#undef VOID_SEED
#undef DRAW_VOID
#undef ILLUSION_TEXT