#textdomain wesnoth-did

#define STORYTXT_BACKGROUND_BIGMAP_DID
    [background_layer]
        image=maps/background.jpg
        scale_vertically=yes
        scale_horizontally=no
        keep_aspect_ratio=yes
    [/background_layer]
    [background_layer]
        image=maps/did.png
        scale_vertically=yes
        scale_horizontally=no
        keep_aspect_ratio=yes
        base_layer=yes
    [/background_layer]
#enddef

# Generic macro for showing storytext background images
#define STORYTXT_BACKGROUND IMAGE
    [background_layer]
        image=story/{IMAGE}
        scale=no
    [/background_layer]
#enddef

#define DID_TRACK STAGE
    [story]
        [part]
            show_title=yes
            {STORYTXT_BACKGROUND_BIGMAP_DID}
            {STAGE}
        [/part]
    [/story]
#enddef

#undef NEW_JOURNEY

#define NEW_JOURNEY X Y
    [image]
        x,y={X},{Y}
        file=misc/new-journey.png
        delay=300
        centered=yes
    [/image]
#enddef

#define NEW_JOURNEY_BLUE X Y
    [image]
        x,y={X},{Y}
        file=misc/new-journey-blue.png
        delay=300
        centered=yes
    [/image]
#enddef

#define JOURNEY_01_NEW
    {NEW_BATTLE 866 693}
#enddef

#define JOURNEY_01_OLD
    {OLD_BATTLE 866 693}
#enddef

#define JOURNEY_02_NEW
    {JOURNEY_01_OLD}
    {NEW_JOURNEY 890 702}
    {NEW_JOURNEY 915 709}
    {NEW_JOURNEY 940 715}
    {NEW_JOURNEY 966 720}
    {NEW_JOURNEY 991 723}
    {NEW_JOURNEY 1017 725}
    {NEW_JOURNEY 1043 723}
    {NEW_JOURNEY 1069 719}
    {NEW_JOURNEY 1093 711}
    {NEW_JOURNEY 1116 699}
    {NEW_JOURNEY 1135 682}
    {NEW_BATTLE 1150 661}
#enddef

#define JOURNEY_02_OLD
    {JOURNEY_01_OLD}
    {OLD_JOURNEY 890 702}
    {OLD_JOURNEY 915 709}
    {OLD_JOURNEY 940 715}
    {OLD_JOURNEY 966 720}
    {OLD_JOURNEY 991 723}
    {OLD_JOURNEY 1017 725}
    {OLD_JOURNEY 1043 723}
    {OLD_JOURNEY 1069 719}
    {OLD_JOURNEY 1093 711}
    {OLD_JOURNEY 1116 699}
    {OLD_JOURNEY 1135 682}
    {OLD_BATTLE 1150 661}
#enddef

#define JOURNEY_03_NEW
    {JOURNEY_02_OLD}
    {NEW_JOURNEY 1127 649}
    {NEW_JOURNEY 1105 635}
    {NEW_JOURNEY 1091 614}
    {NEW_BATTLE 1093 588}
#enddef

#define JOURNEY_03_OLD
    {JOURNEY_02_OLD}
    {OLD_JOURNEY 1127 649}
    {OLD_JOURNEY 1105 635}
    {OLD_JOURNEY 1091 614}
    {OLD_BATTLE 1093 588}
#enddef

#define JOURNEY_04_NEW
    {JOURNEY_03_OLD}
    {NEW_JOURNEY 1101 564}
    {NEW_JOURNEY 1116 544}
    {NEW_JOURNEY 1136 528}
    {NEW_JOURNEY 1142 505}
    {NEW_JOURNEY 1134 481}
    {NEW_BATTLE 1124 458}
#enddef

#define JOURNEY_04_OLD
    {JOURNEY_03_OLD}
    {OLD_JOURNEY 1101 564}
    {OLD_JOURNEY 1116 544}
    {OLD_JOURNEY 1136 528}
    {OLD_JOURNEY 1142 505}
    {OLD_JOURNEY 1134 481}
    {OLD_BATTLE 1124 458}
#enddef

#define JOURNEY_05_NEW
    {JOURNEY_04_OLD}
    {NEW_JOURNEY 1101 445}
    {NEW_JOURNEY 1079 432}
    {NEW_JOURNEY 1057 418}
    {NEW_JOURNEY 1036 402}
    {NEW_JOURNEY 1016 386}
    {NEW_JOURNEY 998 368}
    {NEW_JOURNEY 982 347}
    {NEW_JOURNEY 969 325}
    {NEW_JOURNEY 963 300}
    {NEW_JOURNEY 967 274}
    {NEW_JOURNEY 982 254}
    {NEW_JOURNEY 1005 241}
    {NEW_JOURNEY 1030 236}
    {NEW_JOURNEY 1056 239}
    {NEW_JOURNEY 1080 248}
    {NEW_BATTLE 1101 264}
#enddef

#define JOURNEY_05_OLD
    {JOURNEY_04_OLD}
    {OLD_JOURNEY 1101 445}
    {OLD_JOURNEY 1079 432}
    {OLD_JOURNEY 1057 418}
    {OLD_JOURNEY 1036 402}
    {OLD_JOURNEY 1016 386}
    {OLD_JOURNEY 998 368}
    {OLD_JOURNEY 982 347}
    {OLD_JOURNEY 969 325}
    {OLD_JOURNEY 963 300}
    {OLD_JOURNEY 967 274}
    {OLD_JOURNEY 982 254}
    {OLD_JOURNEY 1005 241}
    {OLD_JOURNEY 1030 236}
    {OLD_JOURNEY 1056 239}
    {OLD_JOURNEY 1080 248}
    {OLD_BATTLE 1101 264}
#enddef

#define JOURNEY_06_NEW
    {JOURNEY_05_OLD}
    {NEW_JOURNEY_BLUE 1095 276}
    {NEW_JOURNEY_BLUE 1082 300}
    {NEW_JOURNEY 1088 288}
    {NEW_JOURNEY_BLUE 1072 325}
    {NEW_JOURNEY 1077 312}
    {NEW_JOURNEY_BLUE 1065 351}
    {NEW_JOURNEY 1068 338}
    {NEW_JOURNEY_BLUE 1061 377}
    {NEW_JOURNEY 1062 364}
    {NEW_JOURNEY_BLUE 1058 405}
    {NEW_JOURNEY 1060 391}
    {NEW_JOURNEY_BLUE 1052 430}
    {NEW_JOURNEY 1057 418}
    {NEW_JOURNEY_BLUE 1043 456}
    {NEW_JOURNEY 1048 442}
    {NEW_JOURNEY_BLUE 1033 483}
    {NEW_JOURNEY 1039 469}
    {NEW_JOURNEY_BLUE 1020 509}
    {NEW_JOURNEY 1027 497}
    {NEW_JOURNEY_BLUE 1005 532}
    {NEW_JOURNEY 1013 521}
    {NEW_JOURNEY_BLUE 992 556}
    {NEW_JOURNEY 998 544}
    {NEW_JOURNEY_BLUE 970 568}
    {NEW_JOURNEY 985 567}
    {NEW_JOURNEY_BLUE 950 585}
    {NEW_JOURNEY 986 594}
    {NEW_JOURNEY 980 622}
    {NEW_JOURNEY_BLUE 926 596}
    {NEW_JOURNEY 965 645}
    {NEW_JOURNEY 941 657}
    {NEW_JOURNEY_BLUE 901 605}
    {NEW_JOURNEY 914 660}
    {NEW_JOURNEY 888 655}
    {NEW_JOURNEY_BLUE 883 624}
    {NEW_JOURNEY 868 666}
    {NEW_BATTLE 866 693}
#enddef

#define JOURNEY_06_OLD
    {JOURNEY_05_OLD}
    {OLD_JOURNEY 1088 288}
    {OLD_JOURNEY 1077 312}
    {OLD_JOURNEY 1068 338}
    {OLD_JOURNEY 1062 364}
    {OLD_JOURNEY 1060 391}
    {OLD_JOURNEY 1057 418}
    {OLD_JOURNEY 1048 442}
    {OLD_JOURNEY 1039 469}
    {OLD_JOURNEY 1027 497}
    {OLD_JOURNEY 1013 521}
    {OLD_JOURNEY 998 544}
    {OLD_JOURNEY 985 567}
    {OLD_JOURNEY 986 594}
    {OLD_JOURNEY 980 622}
    {OLD_JOURNEY 965 645}
    {OLD_JOURNEY 941 657}
    {OLD_JOURNEY 914 660}
    {OLD_JOURNEY 888 655}
    {OLD_JOURNEY 868 666}
    {OLD_BATTLE 866 693}
#enddef

#define JOURNEY_07_NEW
    {JOURNEY_06_OLD}
    {NEW_JOURNEY 868 666}
    {NEW_JOURNEY 860 640}
    {NEW_JOURNEY 845 617}
    {NEW_JOURNEY 826 598}
    {NEW_JOURNEY 803 583}
    {NEW_JOURNEY 778 573}
    {NEW_JOURNEY 751 571}
    {NEW_JOURNEY 725 580}
    {NEW_JOURNEY 704 594}
    {NEW_JOURNEY 683 608}
    {NEW_JOURNEY 662 623}
    {NEW_JOURNEY 642 638}
    {NEW_JOURNEY 621 654}
    {NEW_JOURNEY 601 669}
    {NEW_JOURNEY 581 685}
    {NEW_JOURNEY 561 700}
    {NEW_JOURNEY 540 714}
    {NEW_JOURNEY 518 727}
    {NEW_JOURNEY 495 738}
    {NEW_JOURNEY 471 746}
    {NEW_JOURNEY 446 751}
    {NEW_JOURNEY 421 753}
    {NEW_JOURNEY 395 752}
    {NEW_JOURNEY 370 749}
    {NEW_JOURNEY 345 745}
    {NEW_JOURNEY 320 738}
    {NEW_BATTLE 296 731}
#enddef

#define JOURNEY_07_OLD
    {JOURNEY_06_OLD}
    {OLD_JOURNEY 868 666}
    {OLD_JOURNEY 860 640}
    {OLD_JOURNEY 845 617}
    {OLD_JOURNEY 826 598}
    {OLD_JOURNEY 803 583}
    {OLD_JOURNEY 778 573}
    {OLD_JOURNEY 751 571}
    {OLD_JOURNEY 725 580}
    {OLD_JOURNEY 704 594}
    {OLD_JOURNEY 683 608}
    {OLD_JOURNEY 662 623}
    {OLD_JOURNEY 642 638}
    {OLD_JOURNEY 621 654}
    {OLD_JOURNEY 601 669}
    {OLD_JOURNEY 581 685}
    {OLD_JOURNEY 561 700}
    {OLD_JOURNEY 540 714}
    {OLD_JOURNEY 518 727}
    {OLD_JOURNEY 495 738}
    {OLD_JOURNEY 471 746}
    {OLD_JOURNEY 446 751}
    {OLD_JOURNEY 421 753}
    {OLD_JOURNEY 395 752}
    {OLD_JOURNEY 370 749}
    {OLD_JOURNEY 345 745}
    {OLD_JOURNEY 320 738}
    {OLD_BATTLE 296 731}
#enddef

#define JOURNEY_08_NEW
    {JOURNEY_07_OLD}
    {NEW_JOURNEY 273 716}
    {NEW_JOURNEY 266 689}
    {NEW_JOURNEY 270 662}
    {NEW_BATTLE 279 635}
#enddef

#define JOURNEY_08_OLD
    {JOURNEY_07_OLD}
    {OLD_JOURNEY 273 716}
    {OLD_JOURNEY 266 689}
    {OLD_JOURNEY 270 662}
    {OLD_BATTLE 279 635}
#enddef

#define JOURNEY_09_NEW
    {JOURNEY_08_OLD}
    {NEW_JOURNEY 250 630}
    {NEW_JOURNEY 224 616}
    {NEW_JOURNEY 198 602}
    {NEW_JOURNEY 168 599}
    {NEW_JOURNEY 139 602}
    {NEW_JOURNEY 152 578}
    {NEW_JOURNEY 175 562}
    {NEW_JOURNEY 201 552}
    {NEW_JOURNEY 225 537}
    {NEW_JOURNEY 238 513}
    {NEW_JOURNEY 246 489}
    {NEW_JOURNEY 257 466}
    {NEW_JOURNEY 272 446}
    {NEW_JOURNEY 290 428}
    {NEW_JOURNEY 310 412}
    {NEW_JOURNEY 331 398}
    {NEW_JOURNEY 353 385}
    {NEW_JOURNEY 376 374}
    {NEW_JOURNEY 399 364}
    {NEW_JOURNEY 423 355}
    {NEW_JOURNEY 446 346}
    {NEW_JOURNEY 470 337}
    {NEW_JOURNEY 494 328}
    {NEW_JOURNEY 517 318}
    {NEW_JOURNEY 539 306}
    {NEW_BATTLE 556 287}
#enddef

#define JOURNEY_09_OLD
    {JOURNEY_08_OLD}
    {OLD_JOURNEY 250 630}
    {OLD_JOURNEY 224 616}
    {OLD_JOURNEY 198 602}
    {OLD_JOURNEY 168 599}
    {OLD_JOURNEY 139 602}
    {OLD_JOURNEY 152 578}
    {OLD_JOURNEY 175 562}
    {OLD_JOURNEY 201 552}
    {OLD_JOURNEY 225 537}
    {OLD_JOURNEY 238 513}
    {OLD_JOURNEY 246 489}
    {OLD_JOURNEY 257 466}
    {OLD_JOURNEY 272 446}
    {OLD_JOURNEY 290 428}
    {OLD_JOURNEY 310 412}
    {OLD_JOURNEY 331 398}
    {OLD_JOURNEY 353 385}
    {OLD_JOURNEY 376 374}
    {OLD_JOURNEY 399 364}
    {OLD_JOURNEY 423 355}
    {OLD_JOURNEY 446 346}
    {OLD_JOURNEY 470 337}
    {OLD_JOURNEY 494 328}
    {OLD_JOURNEY 517 318}
    {OLD_JOURNEY 539 306}
    {OLD_BATTLE 556 287}
#enddef

#define JOURNEY_10_NEW
    {JOURNEY_09_OLD}
    {NEW_BATTLE 566 264}
#enddef


#textdomain wesnoth-did

#define CHARACTER_STATS_MALIN_KESHAR
    type=Malin Keshar
    variation=AM1
    id=Malin Keshar
    name= _ "Malin Keshar"
    profile=portraits/malin_young.png
    canrecruit=yes
    unrenamable=yes
#enddef

#define CHARACTER_STATS_MAL_KESHAR
    type=Mal Keshar
    variation=MKL1
    id=Mal Keshar
    name= _ "Mal Keshar"
    profile=portraits/malin_lich.png
    canrecruit=yes
    unrenamable=yes
#enddef

#define CHARACTER_STATS_DELA_KESHAR
    type=Frontier Baroness
    id=Dela Keshar
    name= _ "Dela Keshar"
    profile=portraits/dela.png
    canrecruit=yes
    unrenamable=yes
#enddef

#define CHARACTER_STATS_DARKEN_VOLK
    type=Dark Sorcerer
    id=Darken Volk
    name= _ "Darken Volk"
    profile=portraits/darken_volk.png
    unrenamable=yes
    random_traits=no
    [modifications]
        # NOTE: if you change these, make sure you don't break the
        # removal of the loyal trait in 'Alone at Last
        [trait]
            id=loyal
            name= _ "loyal"
            description= _ "to himself"
            [effect]
                apply_to=loyal
            [/effect]
            [effect]
                apply_to=ellipse
                ellipse=misc/ellipse-hero
            [/effect]
            [effect]
                apply_to=overlay
                add=misc/hero-icon.png
            [/effect]
        [/trait]
        {TRAIT_QUICK}
        [object]
            [effect]
                apply_to=image_mod
                # This shifts the Dark Sorcerer and Necromancer hair and
                # robe colors a bit; first the hair, then the robes
                replace="PAL(E3DCDC,C9C3BE,999188,6E675C,514A3F>C1C1C1,919191,646464,444444,080808)~PAL(889880,506858,283028>7C999B,4C546C,262C31)"
            [/effect]
        [/object]
    [/modifications]
#enddef


#textdomain wesnoth-did

#define HERODEATH_MALIN
    [event]
        name=last breath
        [filter]
            id=Malin Keshar
        [/filter]

        [message]
            speaker=unit
            message= _ "I’m not ready to die yet..."
        [/message]

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

#define HERODEATH_MALIN_LICH
    [event]
        name=last breath
        [filter]
            id=Mal Keshar
        [/filter]

        [message]
            speaker=unit
            message= _ "... Then my battle against the orcs is lost!"
        [/message]

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

#define HERODEATH_VOLK
    [event]
        name=last breath
        [filter]
            id=Darken Volk
        [/filter]

        [message]
            speaker=unit
            message= _ "Fool boy! With my demise, none in this world will aid you..."
        [/message]

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

#define HERODEATH_VOLK_B
    [event]
        name=last breath
        [filter]
            id=Darken Volk
        [/filter]

        [message]
            speaker=unit
            message= _ "No! I was so close... to achieving my goal... of so many years..."
        [/message]

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

#define TIME_OVER_DEFEAT
    [event]
        name=time over

        [message]
            speaker=Darken Volk
            message= _ "Your incompetence at this simple task is appalling. You will never grow strong enough to be of use to me."
        [/message]

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


#textdomain wesnoth-did

#define GIVE_MALIN_EXPERIENCE EXP
    [store_unit]
        [filter]
            id=Malin Keshar
        [/filter]
        variable=malin
    [/store_unit]

    {VARIABLE experience_gained {EXP}}
    {VARIABLE_OP malin.experience add $experience_gained|}
    [floating_text]
        x,y=$malin.x,$malin.y
        text="" + _ "+$experience_gained| exp" + ""
    [/floating_text]
    {CLEAR_VARIABLE experience_gained}

    [unstore_unit]
        variable=malin
    [/unstore_unit]

    {CLEAR_VARIABLE malin}
#enddef

#define CLEAR_CORPSE_HORDE
    [kill]
        type=Walking Corpse
        [not]
            variation=drake,dwarf,goblin,gryphon,mounted,saurian,spider,swimmer,troll,wose,wolf,bat
        [/not]
        side=1
        [filter_wml]
            experience=0
        [/filter_wml]
    [/kill]
#enddef

# MODIFY_ONE_UNIT alters a unit variable for a single unit
#define MODIFY_ONE_UNIT FILTER WML
    [store_unit]
        [filter]
            {FILTER}
        [/filter]
        variable=MODIFY_UNIT_store
        kill=no
    [/store_unit]

    [modify_unit]
        [filter]
            id=$MODIFY_UNIT_store[0].id
        [/filter]
        {WML}
    [/modify_unit]

    {CLEAR_VARIABLE MODIFY_UNIT_store}
#enddef

# Create a new ghost-type "advisor" if Malin doesn't already have one
#define CREATE_ADVISOR
    [if]
        [have_unit]
            side=1
            role=advisor
            search_recall_list=yes
        [/have_unit]
        [then]
            # Recall an advisor if we have one
            [recall]
                role=advisor
            [/recall]
        [/then]
        [else]
            # Else, make a new advisor from a ghost unit
            [role]
                role=advisor
                side=1
                type=Eidolon,Phantom,Spectral Servant,Spectre,Nightgaunt,Wraith,Shadow,Ghost
                search_recall_list=yes
                [auto_recall][/auto_recall]
                [else]
                    # If that fails too, make a brand new ghost advisor
                    [unit]
                        type=Ghost
                        side=1
                        role=advisor
                        animate=yes
                        placement=leader
                    [/unit]
                [/else]
            [/role]
        [/else]
    [/if]
#enddef

#define MANOR_DOORS ALLOWED_SIDES
    # Triggers when moving next to any door terrain and will replace it
    # with an 'opened' variant.

    [event]
        name=moveto
        first_time_only=no

        [filter]
            side={ALLOWED_SIDES}

            [filter_location]
                [filter_adjacent_location]
                    terrain=*^Pr*
                [/filter_adjacent_location]
            [/filter_location]
            [not]
                [filter_location]
                    [filter_adjacent_location]
                        terrain=*^Pr/o,*^Pr\o,*^Pr|o
                    [/filter_adjacent_location]
                [/filter_location]
            [/not]
        [/filter]

        [store_locations]
            terrain=*^Pr*

            [filter_adjacent_location]
                x,y=$x1,$y1
            [/filter_adjacent_location]

            variable=door_to_open
        [/store_locations]

        [terrain]
            x,y=$door_to_open.x,$door_to_open.y
            terrain="$door_to_open.terrain|o" # Append 'o' to the terrain string to get open variant.
            layer=both
        [/terrain]

        [redraw]
            side=$unit.side
        [/redraw]

        {CLEAR_VARIABLE door_to_open}
    [/event]
#enddef

#define SET_GOT_INSIDE_MANOR
    {MODIFY_UNIT (
        side=1
        {NOT_ON_RECALL_LIST}
        [not]
            id=Malin Keshar

            [or]
                id=Darken Volk
            [/or]
        [/not]
    ) variables.got_inside_manor yes}
#enddef


#textdomain wesnoth-did

#define TRAIT_MAIMED
    [trait]
        id=maimed
        male_name= _ "maimed"
        female_name= _ "female^maimed"
        help_text= _ "<italic>text='Maimed'</italic> units have 3 less movement points than usual."
        [effect]
            apply_to=movement
            increase=-3
        [/effect]
    [/trait]
#enddef


#textdomain wesnoth-Genesis

[about]
    title= _ "Creator and Lead Designer"
    [entry]
        name="nemaara"
        wikiuser="nemaara"
        comment="Designer, storywriter, and developer."
    [/entry]
[/about]
[about]
    title= _ "Graphics"
	[entry]
        name="nemaara"
        comment="Sprite and pixel art drawing"
    [/entry]
    [entry]
        name="Iris Morelle (shadowm)"
        comment="
- Custom sprites drawn for fae and Guardians
- Sprites taken or adapted from AtS (see AtS credits for original creators)
"
    [/entry]
    [entry]
        name="duwi"
        comment="Portrait for Luna (tumblr @duwido)"
    [/entry]
    [entry]
        name="doofus-01"
        comment="Terrains from Archaic Resources (reproduced in Genesis Resources with revision)"
    [/entry]
[/about]
[about]
    title= _ "Music"
	[entry]
        name="nemaara"
        comment="Wind3, Grey Skies versions 1 and 2, Waves"
    [/entry]
    [entry]
        name="Jeremy Nicoll (jeremy2)"
        comment="Lonely Snowfall"
    [/entry]
    [entry]
        name="Mattias Westlund (West)"
        comment="Ambuscade"
    [/entry]
[/about]
[about]
    title= _ "Additional Thanks to"
    [entry]
        name="Iris Morelle (shadowm)"
        comment="Suggestions for plot and lore."
    [/entry]
	[entry]
         name="EoZ/Elder"
        comment="Additional playtesting and balancing suggestions."
    [/entry]
[/about]


#textdomain wesnoth-Genesis

# taken from Invasion from the Unknown
# code written by shadowm

[lua]
    code = <<
        GENESIS = '>>+"{~add-ons/Genesis/dist/VERSION}"+<<'

        -- Global helper function table.
        helper = wesnoth.require "lua/helper.lua"

        -- Load local code files.
        for i, file in ipairs {
            'skip_more_stuff.lua',
            'lib.lua',
            'on_event.lua',

            'hex.lua',
            'common.lua',
            'optimizations.lua',
            'spawner.lua',
            'overrides.lua',
            'wlp.lua',
            'interface-utils.lua',

            'gui/transient_message.lua',

            'version.lua',
        }
        do
            wesnoth.dofile('~add-ons/Genesis/lua/' .. file)
        end
    >>
[/lua]

{~add-ons/Genesis/sounds}
{~add-ons/Genesis/utils}

[+units]
    {~add-ons/Genesis/units}
[/units]

#ifdef CAMPAIGN_GENESIS_EPISODE_I
[lua]
    code = <<
        for i, file in ipairs {
            'character-utils.lua',
        }
        do
            wesnoth.dofile('~add-ons/Genesis/episode1/lua/' .. file)
        end
    >>
[/lua]
{~add-ons/Genesis/episode1/utils}
[+units]
    {~add-ons/Genesis/episode1/units/}
    {~add-ons/Genesis/episode1/units/demons}
    {~add-ons/Genesis/episode1/units/undead}
    {~add-ons/Genesis/episode1/units/faeries}
    {~add-ons/Genesis/episode1/units/fae}
    {~add-ons/Genesis/episode1/units/fake}
[/units]
{~add-ons/Genesis/episode1/storytxt.cfg}
{~add-ons/Genesis/episode1/deaths.cfg}
{~add-ons/Genesis/episode1/scenarios}
#endif

#ifdef CAMPAIGN_GENESIS_EPISODE_II
[lua]
    code = <<
        for i, file in ipairs {
            'character-utils.lua',
            'spells.lua',
        }
        do
            wesnoth.dofile('~add-ons/Genesis/episode2/lua/' .. file)
        end
    >>
[/lua]
{~add-ons/Genesis/episode2/utils}
[+units]
    {~add-ons/Genesis/episode2/units/}
    {~add-ons/Genesis/episode2/units/halflings}
[/units]
{~add-ons/Genesis/episode2/storytxt.cfg}
{~add-ons/Genesis/episode2/scenarios}
#endif


#
# File automatically generated by Wesnoth to keep track
# of version information on installed add-ons. DO NOT EDIT!
#
[info]
	core=""
	dependencies="Genesis_Resources"
	title="Genesis"
	type="campaign"
	uploads=5
	version="0.2.3"
[/info]


#textdomain wesnoth-Genesis

# wmlscope: set export=no
[textdomain]
    name="wesnoth-Genesis"
[/textdomain]

#ifdef CAMPAIGN_GENESIS_MENU_ENTRY_SHAREDINFO
#undef CAMPAIGN_GENESIS_MENU_ENTRY_SHAREDINFO
#endif

#textdomain wesnoth-Genesis

dependencies=Genesis_Resources

#define CAMPAIGN_GENESIS_MENU_ENTRY_SHAREDINFO EPISODE_ID_SUFFIX EPISODE_SUBTITLE EPISODE_DESCRIPTION
    id=GENESIS_{EPISODE_ID_SUFFIX}
    define=CAMPAIGN_GENESIS
    extra_defines=CAMPAIGN_GENESIS_EPISODE_{EPISODE_ID_SUFFIX}
    version={~add-ons/Genesis/dist/VERSION}
    difficulties=EASY,NORMAL,HARD
    name= _ "Genesis"+"
"+{EPISODE_SUBTITLE}
    description={EPISODE_DESCRIPTION}+"

"+_""+"
"+_"Version:"+" {~add-ons/Genesis/dist/VERSION} "+_"(requires Wesnoth 1.14 or later)"+""

    {~add-ons/Genesis/about.cfg}
#enddef

[campaign]
    {CAMPAIGN_GENESIS_MENU_ENTRY_SHAREDINFO I ( _ "Episode I") ( _ "Twilight shrouds the frozen sky,
Where sunlight fades to silent night.
Beneath the blood sea dead souls cry,
Blind to blue moon's ashen light.
Impetuous force stirs blackened flame,
Erasing her forsaken name.
The iron crescent reaps all lives,
In dreams of darkness, spirit dies.

(Expert level - 23 scenarios)")}

    end_text= _ "To be continued..."
    first_scenario=01_Ash
    abbrev= _ "Gns-1"
    icon="data/add-ons/Genesis/images/units/fae/esther.png"
    image="data/add-ons/Genesis/images/story/moonlit-lake.png"

    {CAMPAIGN_DIFFICULTY EASY   "data/add-ons/Genesis_Resources/images/units/faeries-other/sprite.png~RC(magenta>green)" ( _ "Sprite") ( _ "Easy")}
    {CAMPAIGN_DIFFICULTY NORMAL "data/add-ons/Genesis_Resources/images/units/faeries-other/fire.png~RC(magenta>green)" ( _ "Nymph") ( _ "Normal")} {DEFAULT_DIFFICULTY}
    {CAMPAIGN_DIFFICULTY HARD   "data/add-ons/Genesis_Resources/images/units/faeries-other/dryad.png~RC(magenta>green)" ( _ "Dryad") ( _ "Hard")}
[/campaign]

[campaign]
    {CAMPAIGN_GENESIS_MENU_ENTRY_SHAREDINFO II ( _ "Episode II") ( _ "Alone in faded slumber, dreaming,
Wicked things traverse unending nightmares.
Soulless beings of the darkness, they say,
We have no souls, but neither do you.

Hall of grey, stoned faces,
Unblinking eyes stare open widely,
As if questioningly, but ever silent,
Frozen screams etched in eternity.

You've slain them all, wherefore?
They drop dead, one by one,

(Expert level - 1 scenario)")}

    end_text= _ "To be continued..."
    first_scenario=00_Cutscene
    abbrev= _ "Gns-2"
    icon="data/add-ons/Genesis/images/units/fae/aryel.png"
    image="data/add-ons/Genesis/images/story/moonlit-lake.png"
    difficulty_descriptions={MENU_IMG_TXT2 "data/add-ons/Genesis/images/units/demons/fiend/fiend-female.png~RC(magenta>red)" _"difficulty_menu^Fiend" (""+_"(Easy)"+"")} + ";*" + {MENU_IMG_TXT2 "data/add-ons/Genesis/images/units/demons/fiend/berserker-female.png~RC(magenta>red)" _"difficulty_menu^Brute" (""+_"(Normal)"+"")} + ";" + {MENU_IMG_TXT2 "data/add-ons/Genesis/images/units/demons/fiend/hellion-female.png~RC(magenta>red)" _"difficulty_menu^Hellion" (""+_"(Difficult)"+"")}
[/campaign]

#ifdef CAMPAIGN_GENESIS_EPISODE_I
[binary_path]
    path=data/add-ons/Genesis_Resources/
[/binary_path]
{~add-ons/Genesis_Resources/utils}
{~add-ons/Genesis_Resources/music}

[binary_path]
    path=data/add-ons/Genesis/
[/binary_path]

{~add-ons/Genesis/loader.cfg}
#endif

#ifdef CAMPAIGN_GENESIS_EPISODE_II
[binary_path]
    path=data/add-ons/Genesis_Resources/
[/binary_path]
{~add-ons/Genesis_Resources/utils}
{~add-ons/Genesis_Resources/music}

[binary_path]
    path=data/add-ons/Genesis/
[/binary_path]

{~add-ons/Genesis/loader.cfg}
#endif


#textdomain wesnoth-Genesis
#define FAE_DEATHS2

    [event]
        name=last breath
        [filter]
            id=Yumi
        [/filter]
        [message]
            speaker=Yumi
            message= _ "(gasps)"
        [/message]
        [message]
            speaker=Aryel
            message= _ "Yumi!"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(chokes)"
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Esther
        [/filter]
        [message]
            speaker=Esther
            message= _ "(cough) I-I can't breathe-"
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Aryel
        [/filter]
        [message]
            speaker=Aryel
            message= _ "Ugh. (gasp) It hurts-"
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]
#enddef
#define FAE_DEATHS

    [event]
        name=last breath
        [filter]
            id=Yumi
        [/filter]
        [message]
            speaker=Yumi
            message= _ "Es...ther... (gasp)"
        [/message]
        [message]
            speaker=Esther
            message= _ "Yumi!"
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Esther
        [/filter]
        [message]
            speaker=Esther
            message= _ "Yumi- (cough) -run... be safe..."
        [/message]
        [message]
            speaker=Yumi
            message= _ "Esther! Esther, please, you can't leave me..."
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]

    [event]
        name=last breath
        [filter]
            id=Aryel
        [/filter]
        [message]
            speaker=Aryel
            message= _ "I-can't die- (gasp) -now..."
        [/message]
        [message]
            speaker=Yumi
            message= _ "Aryel, no! Esther, Esther, we have to save her-"
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]
#enddef


#textdomain wesnoth-Genesis

#define CAMPAIGN_INTRO_HEADER
    title="!" # wmllint: ignore
    title_alignment=center
    show_title=yes
#enddef

#define CAMPAIGN_INTRO_PADDING
    "

" #enddef

#define CAMPAIGN_INTRO_WARNING_TITLE
    ""+
    _ "Warning!"+"

" #enddef

# wmlindent: start ignoring
#define CAMPAIGN_INTRO_GAMEPLAY_WARNING
    _ "Many scenarios of this campaign work significantly different from normal Wesnoth gameplay. It is especially important to pay close attention to the mission objectives and not necessarily try to kill every single enemy, especially on shrouded maps, or in places where enemies seem to respawn continuously." #enddef

#define CAMPAIGN_INTRO_CONTENT_WARNING
    _ "This campaign is the prequel to Invasion from the Unknown and After the Storm. It may be useful, but is not necessary to play these campaigns before playing Genesis." #enddef

#define CAMPAIGN_INTRO_OPTIONS_WARNING
    _ "A game screen resolution of 800x600 or greater is recommended. Some sequences make use of floating labels, halos, and standing unit animations, so you might want to make sure these options are enabled under Preferences ? Display." #enddef

#define STORYTXT_TITLE_CARD _ID _MAIN_TITLE _ALTERNATE_TITLE
    title={_MAIN_TITLE}+" ("+{_ALTERNATE_TITLE}+")
"+{_ID}+""
#enddef

#define STORYTXT_TITLE_CARD_SIMPLE _ID _MAIN_TITLE
    title={_MAIN_TITLE}+"
"+{_ID}+""
#enddef

#define STORYTXT_CAPTION _TEXT
    ""+{_TEXT}+"

" #enddef

#define STORYTXT_INIT_WARNING
    [story]
        [part]
            music="data/core/sounds/ambient/wardrums.ogg"

            {CAMPAIGN_INTRO_HEADER}

            story={CAMPAIGN_INTRO_WARNING_TITLE}+{CAMPAIGN_INTRO_GAMEPLAY_WARNING}+{CAMPAIGN_INTRO_PADDING}+{CAMPAIGN_INTRO_CONTENT_WARNING}
        [/part]
    [/story]
#enddef

#define STORYTXT_ASH
    [story]
        [part]
            music=journeys_end.ogg
            story= _ "In our universe, there exist ten worlds, one for each of the ten aspects of creation."
        [/part]
        [part]
            story= _ "Life, Water, Thunder, Earth, Fire, Darkness, Light, Air, Ice, and Existence. Ten Guardians embody each one of these aspects, deities who channel the essence of these elements to foster the growth of their worlds and their peoples. Our world, Irdya, is that of Earth and the home to the faerie. Though we are protected by the Guardian Xia'el against the many demons from the other worlds, our relatively peaceful lives are still often fraught with battle."
        [/part]
        [part]
            story= _ "War is more common than peace. The disunity among the Guardians prevents their personal intervention to maintain order, even among those who desire harmony. There are plenty of them who do not..."
        [/part]
        [part]
            story= _ "I don't know what to think. The Guardians that are meant to protect us seem to only relish bloodshed. They pit their powers and their peoples against one another, treating precious life like trifles for their amusement. They sit back and watch as ash rains from the sky and the dry wind carries demon fire, burning away our beautiful forests... We're left to fight on our own."
        [/part]
        [part]
            story= _ "... they're coming again. The demons. There's no end to this carnage, is there? Fine. I'm not afraid of fighting. I can't be."
        [/part]
    [/story]
#enddef

#define STORYTXT_RED_PEAKS
    [story]
        [part]
            music=elvish-theme.ogg
            story= _ "Yumi always seems to be apathetic about everything, but I think secretly, she does care a lot. Come to think of it, she probably didn't want to leave because she had gotten kind of attached to our home. I guess even she can be kind of sentimental at times."
        [/part]
        [part]
            story= _ "To tell the truth, the real reason I wanted to leave was that those Urdemons seemed to be targeting Yumi and me. Maybe it was just my imagination or maybe I'm just being paranoid, but it's always a possibility that they know that we're not exactly real faerie. It's not like the demons would be interested in that. On the other hand, some of the Guardians might be..."
        [/part]
        [part]
            story= _ "I wish we knew more about what's going on. Demons attacks aren't something new, but them specifically being Urdemons is. It would be best if we could find Xia'el or Uria, since they're supposed to be the ones handling this mess being Guardians and all, but they've got their own agenda. I doubt we can really rely on them. We'll have to figure this mess out by ourselves."
        [/part]
    [/story]
#enddef

#define STORYTXT_NORTHLANDS
    [story]
        [switch]
            variable=prev_scenario
            [case]
                value="none"

                [part]
                    story={STORYTXT_CAPTION ( _ "Esther")} + _ "Thanks to those Stromguardes finally showing up, we actually made it past those volcanoes. The rest of our journey to the northlands was fortunately very quiet, though I can't say that I'm totally at ease. There's no mistaking that those demons were definitely after Yumi and me, so that means they'll be back for us sometime."
                [/part]
                [part]
                    story={STORYTXT_CAPTION ( _ "Esther")} + _ "For now, though, it's peaceful enough. There's plentiful forests in the northlands to settle in - a couple of the faerie decided to stick with us, but most of them have gone off and found new homes up here. It's not really a bad thing to have fewer people around anyway. The less there are, the less Yumi and I risk getting found out and the less attention we'll draw to ourselves. I suppose I don't really mind being social, but Yumi..."
                [/part]
                [part]
                    story={STORYTXT_CAPTION ( _ "Esther")} + _ "Yumi worries me. I can't make sense of her most of the time. She gets so nervous over the littlest things but seems so indifferent over anything important. I don't get it. She's puzzling. Times like these make me miss Aryel. She's a bit odd, but she's fun and even Yumi seems to relax a little when she's around. We'll need to find out where she went."
                [/part]
            [/case]
            [case]
                value="White City"
                [part]
                    story={STORYTXT_CAPTION ( _ "Esther")} + _ "So we definitely need Aryel now. If Yumi's right and that thing is filled with demon magic, it might be a clue as to how and why the Urdemons are attacking us. On the flip side, I'm surprised that the humans were so agreeable this time. Usually, even if they're not exactly enemies, they're not really friendly to the faerie. I can't imagine they'd be amicable to us either, if they knew what we were..."
                [/part]
                [part]
                    story={STORYTXT_CAPTION ( _ "Esther")} + _ "Well, I digress. If we go back, we'll just have to be extra nice to them and hope for the best."
                [/part]
            [/case]
            [case]
                value="Glacial Shrine"
                [part]
                    story={STORYTXT_CAPTION ( _ "Esther")} + _ "We tried to be helpful, but obviously we couldn't tell the humans too much. We talked about what we had learned a little bit, but ultimately it wasn't anything too new, except for the few inscriptions on the last glyph. Those were really different, but we can't really make any assumptions based on those yet, not without more information."
                [/part]
                [part]
                    story={STORYTXT_CAPTION ( _ "Esther")} + _ "Surprisingly, though, the general allowed some of his men to follow us. I guess it would get boring just staying in that fort for weeks, especially with nothing but snow and ice around them. The extra help should be useful, but of course, this means that we'll have to be careful not to give them any hints that we're not normal faerie."
                [/part]
            [/case]
            [case]
                value="Black Cauldron"
                [part]
                    story={STORYTXT_CAPTION ( _ "Aryel")} + _ "Yumi's the youngest of us by quite a bit. Well, okay, so I'm not technically that much older, but it's just the way she acts. She just seems so... so shy. I don't know what to make of it. It always feels like she's hiding something from everyone. Maybe she really is. Is it just because she's afraid? It's not like we're out to get her. Yes, I tease her sometimes, but she knows we won't hurt her. It just doesn't make sense."
                [/part]
                [part]
                    story={STORYTXT_CAPTION ( _ "Aryel")} + _ "Maybe I don't have a right to be worried. Esther's been taking care of her just fine. Right now, the demons are the bigger issue..."
                [/part]
            [/case]
        [/switch]
    [/story]
#enddef

#define STORYTXT_BLUE_MOON
    [story]
        [part]
            music=silence.ogg
            story= _ "Where... am I?"
        [/part]
        [part]
            story= _ "I feel... weird."
        [/part]
        [part]
            story= _ "Everything is so dark. I can't see. It's cold..."
        [/part]
    [/story]
#enddef

#define STORYTXT_BLACK_CAULDRON
    [story]
        [part]
            story={STORYTXT_CAPTION ( _ "Esther")} + _ "I know I probably sound overly enthusiastic at times, but I feel like it's necessary since Yumi's so... passive all the time. I definitely can't let my own nervousness show. She's already anxious enough for the both of us. I need to be the level-headed one."
        [/part]
        [part]
            music=silence.ogg
            story={STORYTXT_CAPTION ( _ "Esther")} + _ "Anyway, Yumi actually knows Aryel better than I do, so I don't doubt her when she says Aryel's probably here."
        [/part]
    [/story]
#enddef

#define STORYTXT_WHITE_CITY
    [story]
        [part]
            music=silence.ogg
            story={STORYTXT_CAPTION ( _ "Esther")} + _ "It might seem silly to go to a human city to look for information, but Caerleon was actually built atop the ruins of other settlements. With a little luck, we might actually be able to find something. On the other hand, Yumi doesn't seem particularly fond of humans. It almost feels like she might be more scared of them than she is of the demons. So, I guess we'll limit our exploration a little bit."
        [/part]
    [/story]
#enddef

#define STORYTXT_CRYPT
    [story]
        [part]
            music=silence.ogg
            story={STORYTXT_CAPTION ( _ "Esther")} + _ "We got a bit of a stern lecture from the humans, but considering how wary they are of our magic, it could have been much worse. They still agreed to let us open the crypt as long as we put up a barrier around it. I'm not sure how effective our spell will be, especially if we encounter demons, but it's still worth a shot."
        [/part]
    [/story]
#enddef

#define STORYTXT_CAERLEON
    [story]
        [switch]
            variable=prev_scenario
            [case]
                value="none"
                [part]
                    story={STORYTXT_CAPTION ( _ "Esther")} + _ "Xia'el left pretty quickly, but before she did, she told us not to open the crypt again. Must be something inside that chamber that's so important that even we shouldn't mess with it. Guardian stuff and all that. She also told us to stay out of trouble, as if she's expecting something to happen. Maybe it's because all these demons are around? I'm not sure. She seemed somewhat troubled by something else. I wonder what it was."
                [/part]
                [part]
                    story={STORYTXT_CAPTION ( _ "Esther")} + _ "Maybe I should talk to Aryel about it. She might have some ideas. We can't rely on Xia'el for sure. Sad to say that, but at the same time, we can't be crying to her for help all the time either. We need to figure out what's going on with these Urdemons and who's controlling them. Actually, quite honestly, Yumi probably has a better idea of what's happening but asking her for answers is like pulling teeth, so..."
                [/part]
                [part]
                    story={STORYTXT_CAPTION ( _ "Esther")} + _ "On a side note, some of the humans have taken a liking to our little group. I can't imagine why, but a little help here and there never hurts."
                [/part]
            [/case]
            [case]
                value="Pantheon"
                [part]
                    story={STORYTXT_CAPTION ( _ "Esther")} + _ "The text on the statues was mildly troubling, but we'll have to see if anything comes of the humans' disregard for Xia'el. Not that we think so highly of her or anything, but she's the Guardian of Irdya after all. We should at least respect her."
                [/part]
            [/case]
            [case]
                value="Colosseum"
                [part]
                    story={STORYTXT_CAPTION ( _ "Esther")} + _ "Typical Aryel. She always likes to show off. Funny how she can go from being so unsociable one moment to hogging the spotlight all to herself the next. Well, I suppose it's not bad that she gets some fun sometimes. I just worry that she draws too much attention to herself."
                [/part]
            [/case]
        [/switch]
    [/story]
#enddef

#define STORYTXT_UPPER_DISTRICT
    [story]
        [switch]
            variable=prev_scenario
            [case]
                value="Arcaneum"
                [part]
                    story={STORYTXT_CAPTION ( _ "Esther")} + _ "The magi were grateful, of course, but a little cold. I can't help but think that they just don't like faeries very much. It seems strange, since we've been nothing but helpful to them. But it is what it is. We don't really have to deal with them if we don't want to. Then again, not all of them were that full of themselves, so maybe there's a little hope to make some friends. It'd be nice to have some of them on our side, no matter what Aryel thinks of them."
                [/part]
            [/case]
        [/switch]
    [/story]
#enddef

#define STORYTXT_ARCANEUM
    [story]
        [part]
            story={STORYTXT_CAPTION ( _ "Esther")} + _ "We had to pass through a powerful containment spell - no surprise there - but it's weird that we haven't seen any magi yet so far. Guess they're all hiding away from the undead. It seems like Aryel was right about these humans. They don't like cleaning up after their own messes."
        [/part]
    [/story]
#enddef

#define STORYTXT_IMPETUS
    [story]
        [part]
            music=silence.ogg
            story={STORYTXT_CAPTION ( _ "Esther")} + _ "It's been a few uneventful weeks. It's great that we haven't been attacked by more demons, but this period of calm is troubling rather than serene. It's just that things won't stay this way forever, and the fact that demons haven't shown up again makes me think that they, or I guess the person controlling them, are planning something. For that matter, we don't even know if Xia'el is still here or if she's left again. I know we can't really rely on her, but somehow her being here felt more reassuring."
        [/part]
        [part]
            story={STORYTXT_CAPTION ( _ "Esther")} + _ "We settled down with some of the faerie in the forests to the east. Despite Caerleon being a rather pretty city, a lot of the humans are somewhat cold and rude. Well, I suppose the few that came traveling with us are not unpleasant, but the whole air around Caerleon is a little bit disconcerting. As much as it's sometimes nice to socialize around them, staying for too long makes even me uncomfortable. Nevermind Aryel and Yumi, hah."
        [/part]
        [part]
            story={STORYTXT_CAPTION ( _ "Esther")} + _ "I suppose not having to do anything is nice in a way. Even if I'm not afraid of it, it's not like I enjoy fighting all the time. All I want is to keep Yumi and Aryel safe. If anything, peace is definitely a better option, but I just wonder how long things will stay like this."
        [/part]
    [/story]
#enddef

#define STORYTXT_SIEGE_OF_HELEMOOR
    [story]
        [part]
            music=silence.ogg
            story={STORYTXT_CAPTION ( _ "Esther")} + _ "Aryel was very fussy the whole night. I would have reassured her that I was fine, but I was pretty tired and ended up sleeping very early."
        [/part]
        [part]
            story={STORYTXT_CAPTION ( _ "Esther")} + _ "I woke up in the middle of the night. The wind had died down and the freshly fallen snow was soft and very cold. The moon was almost completely dark, but I was feeling a little better so I got up and walked around a bit. I caught sight of Yumi staring at the sky through the trees - her eyes were very dark, almost completely black."
        [/part]
        [part]
            story={STORYTXT_CAPTION ( _ "Esther")} + _ "I know she realized I was looking, but didn't she pay any attention to me. She seemed to be thinking about something? I wonder what it was. What goes on in that head of hers? I don't know what to do. Should I try to pry information out of her, or should I give her her space? The thing is, I don't think anything good will come of trying to force things out of her... nor do I want to. At the same time, her hiding things from us is troublesome..."
        [/part]
        [part]
            story={STORYTXT_CAPTION ( _ "Esther")} + _ "Honestly, dealing with this is a little stressful. Aryel's being really skittish right now, and Yumi is, well... Yumi. I suppose the best thing I can do is try to be stable. As long as they can rely on me, I hope we won't get into more trouble."
        [/part]
        [part]
            story={STORYTXT_CAPTION ( _ "Esther")} + _ "When I woke up in the morning, I found Aryel taking care of one of the humans' messenger hawks. Apparently, she found it with a bruised wing. Looked like it was from the impact of an arrow, but the bird was okay and its message was intact. Apparently, the King of Caerleon sent a large army toward Fort Helemoor in the northwest a few days ago. So the humans are even fighting each other now?"
        [/part]
        [part]
            story={STORYTXT_CAPTION ( _ "Esther")} + _ "We're heading north toward the fort, in case things do go sour and we're needed there. Hopefully we'll be able to get some clues as to why the humans are acting so strangely."
        [/part]
    [/story]
#enddef

#define STORYTXT_ASHEN_HEARTS
    [story]
        [part]
            music=silence.ogg
            story={STORYTXT_CAPTION ( _ "Esther")} + _ "We flew as fast as we could, but the humans made it to Caerleon before us. Aryel said that we weren't too far behind though. Hopefully they've just put her somewhere alone and aren't going to do anything with her at the moment. I hope."
        [/part]
        [part]
            story={STORYTXT_CAPTION ( _ "Esther")} + _ "Talya said that they would probably take Yumi to one of the prisons near the arcaneum area. Aryel also sensed her in that general direction, so we need to head there first. We can figure out what to do with the rest of these humans later. Whatever's going on among their high ranking officers and in their councils... as Talya put it, everyone seems to have gone insane. At the moment, I no longer have the patience nor the time to put up with this. If we need to fight through them, we'll do just that."
        [/part]
        [part]
            story={STORYTXT_CAPTION ( _ "Esther")} + _ "I've aired on the side of mercy in the past. In some sense, we're supposed to be the caretakers of Irdya. This is our home, and we are the ones who have kept everyone safe all this time. Even humans. That's how I felt before. But now..."
        [/part]
        [part]
            story={STORYTXT_CAPTION ( _ "Esther")} + _ "If they do anything to Yumi, I'm not willing to forgive them."
        [/part]
    [/story]
#enddef

#define STORYTXT_BLACK_FIRE
    [story]
        [part]
            story={STORYTXT_CAPTION ( _ "Talya")} + _ "We cleaned up and napped a little bit, but there wasn't much time. By the time I woke up, General Haart informed me that the demons were already near the gates. They couldn't have been more than a couple hours away, and given the size of their army, we would need a lot of help."
        [/part]
        [part]
            story={STORYTXT_CAPTION ( _ "Talya")} + _ "I went to go look for Esther and found her chatting quietly with Aryel. They were talking a bit about Yumi, who I guess was still sleeping. I joined them for a bit of food, then Aryel said she had to go back to check on Yumi. Those two seem to hang out together a lot. I wonder if they have something going on between them..."
        [/part]
        [part]
            story={STORYTXT_CAPTION ( _ "Talya")} + _ "Well, Esther did say that they used to run off alone all the time. They're probably not that used to being around other people. Maybe that's why Esther told them to go check out the palace first on their own. I just hope we're strong enough to defend against those demons. If we can keep them out of the city and back from the gates, maybe we can fight them off long enough to go help Aryel and Yumi."
        [/part]
    [/story]
#enddef

#define STORYTXT_ROYAL_PALACE
    [story]
        [part]
            story={STORYTXT_CAPTION ( _ "Aryel")} + _ "Talya and Esther came by earlier. I actually wanted to get going at about the same time they set off, but Yumi was still sleeping. I didn't have the heart to wake her either. She looked so very tired."
        [/part]
        [part]
            story={STORYTXT_CAPTION ( _ "Aryel")} + _ "The sun had gone down by the time she got up. I gave her a bit of pudding to eat. She refused everything else. Something wasn't quite right with her. It felt like she was thinking about something she didn't want anyone else to know about. Well, she always is. I asked her about it and she gave me her usual response. That she wasn't hiding anything. Of course."
        [/part]
        [part]
            story={STORYTXT_CAPTION ( _ "Aryel")} + _ "You know, if I lost a hair for every secret Yumi kept from me, I'd be bald by now. Ugh. I mean, I like Yumi, but sometimes that girl really stresses me out. I don't know what to do. She definitely knows something important, but she must feel that telling me would be harmful somehow. I wonder why."
        [/part]
        [part]
            story={STORYTXT_CAPTION ( _ "Aryel")} + _ "Blegh. I can't worry about this right now. We've got to figure out what's wrong with the human king and his advisors. Let's just sort out one thing at a time first."
        [/part]
    [/story]
#enddef


#textdomain wesnoth-Genesis

[scenario]
    id=01_Ash
    name= _ "Ash"
    map_data="{~add-ons/Genesis/episode1/maps/01_Ash.map}"
    {TURNS 21 19 17}
    theme=Cutscene_Minimal
    next_scenario=02_Red_Peaks

    {STORYTXT_INIT_WARNING}
    {STORYTXT_ASH}

    {EXTENDED_TIME2}
    current_time=8

    {FAE_DEATHS}

    [side]
        {PLAYER_FAE}
        {FAERIE_RECRUITS}
        variation=FF1
        facing=se
        [modifications]
            {TRAIT_FEARLESS}
        [/modifications]
        # profile=portraits/esther.png
        unrenamable=yes
        side=1
        {GOLD 150 120 70}
    [/side]

    [side]
        {ETHEA_ENEMY_SIDE}
        {AGGRESSIVE_SIDE}
        type=Demon Warrior
        id=Azzarae
        name= _ "Azzarae"
        unrenamable=yes
        canrecruit=yes
        side=2
        recruit=Demon,Winged Demon,Chaos Hound
        {GOLD 60 80 100}
        {INCOME 4 7 10}
    [/side]

    {STARTING_VILLAGES_ALL 1}
    {STARTING_VILLAGES 2 8}

    #ifdef HARD
        {RESPAWN_POINT ("Winged Demon") 2 39 20 7}
        {RESPAWN_POINT ("Winged Demon") 2 44 20 7}
        {RESPAWN_POINT ("Winged Demon") 2 45 17 7}
        {RESPAWN_POINT ("Winged Demon") 2 44 13 7}
        {RESPAWN_POINT ("Winged Demon") 2 46 8 7}
    #endif
    #ifdef NORMAL
        {RESPAWN_POINT ("Winged Demon") 2 39 20 14}
        {RESPAWN_POINT ("Winged Demon") 2 44 20 14}
        {RESPAWN_POINT ("Winged Demon") 2 45 17 14}
        {RESPAWN_POINT ("Winged Demon") 2 44 13 14}
        {RESPAWN_POINT ("Winged Demon") 2 46 8 14}
    #endif
    #ifdef EASY
        {RESPAWN_POINT ("Winged Demon") 2 39 20 17}
        {RESPAWN_POINT ("Winged Demon") 2 44 20 17}
        {RESPAWN_POINT ("Winged Demon") 2 45 17 17}
        {RESPAWN_POINT ("Winged Demon") 2 44 13 17}
        {RESPAWN_POINT ("Winged Demon") 2 46 8 17}
    #endif

    [event]
        name=prestart

        {FADE_SCREEN}
        [store_unit]
            [filter]
                id=Esther
            [/filter]
            variable=esther
        [/store_unit]
        [kill]
            id=Esther
        [/kill]
        [modify_side]
            side=1
            shroud=yes
        [/modify_side]
        [place_shroud]
            side=1
            x=1-47
            y=1-21
        [/place_shroud]

        [set_variable]
            name=turn_fire_dmg
            value=0
        [/set_variable]
    [/event]

    [event]
        name=start

        {DELAY 1500}

        [credits_text]
            title= _ "GENESIS"
            duration=3000
        [/credits_text]

        [credits_text]
            title= _ "Episode I"
            duration=2500
        [/credits_text]
        [fade_out_music]
            duration=1500
        [/fade_out_music]
        {REPLACE_SCENARIO_MUSIC silence.ogg}
        {SCROLL_TO 18 10}
        [change_theme]
            theme=
        [/change_theme]
        [modify_side]
            side=1
            shroud=no
        [/modify_side]
        [remove_shroud]
            side=1
            x=1-47
            y=1-21
        [/remove_shroud]
        [redraw]
            side=1
            clear_shroud=yes
        [/redraw]
        {UNFADE_SCREEN}
        [unstore_unit]
            variable=esther
        [/unstore_unit]
        [unhide_unit]
            [filter][/filter]
        [/unhide_unit]
        {CLEAR_VARIABLE esther}

        {REPLACE_SCENARIO_MUSIC revelation.ogg}

        [message]
            speaker=Esther
            message= _ "Yumi? Yumi, wake up. Yumi..."
        [/message]

        [unit]
            side=1
            type=Shadow Fae
            variation=SF1
            canrecruit=yes
            x,y=9,7
            name= _ "Yumi"
            id=Yumi
            unrenamable=yes
            # profile=portraits/yumi.png
            animate=yes
            facing=se
        [/unit]

        {DELAY 750}

        [message]
            speaker=Yumi
            message= _ "(yawns)"
        [/message]
        [message]
            speaker=Esther
            message= _ "Rise and shine, we've got visitors."
        [/message]
        [message]
            speaker=Yumi
            message= _ "(squints)"
        [/message]

        [scroll_to]
            x,y=38,15
        [/scroll_to]

        {DELAY 2000}

        [message]
            speaker=Yumi
            message= _ "I thought demons didn't live here on Irdya."
        [/message]
        [message]
            speaker=Esther
            message= _ "They don't. These ones look like they're from Ethea, the world of Life. Wonder why they're here."
        [/message]
        [message]
            speaker=Esther
            message= _ "... Yumi?"
        [/message]
        [message]
            speaker=Esther
            message= _ "...hello? You paying attention?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "They're here to kill us."
        [/message]
        [message]
            speaker=Esther
            message= _ "Well... they sure look hostile, but I guess I should try to be optimistic around miss gloomy."
        [/message]
        [message]
            speaker=Esther
            message= _ "Don't be like that. We're allies with Ethea. They're probably just here to like, I don't know, pass us a message or something."
        [/message]
        [message]
            speaker=Yumi
            message= _ "(rolls eyes) They also probably just burned down the forest on accident too."
        [/message]
        [message]
            speaker=Esther
            message= _ "I guess you have a point. Well, just in case, we'd better wake the faeries in the villages. You stay back and out of danger, okay?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(shrugs)"
        [/message]
        [unit]
            side=1
            generate_name=yes
            type=Faerie Sprite
            random_traits=no
            animate=yes
            [modifications]
                {TRAIT_LOYAL}
                {TRAIT_INTELLIGENT}
            [/modifications]
            x,y=16,16
        [/unit]
        [unit]
            side=1
            generate_name=yes
            type=Dusk Faerie
            random_traits=no
            animate=yes
            [modifications]
                {TRAIT_LOYAL}
                {TRAIT_INTELLIGENT}
            [/modifications]
            x,y=12,13
        [/unit]
        [unit]
            side=1
            generate_name=yes
            type=Yousei Briar Maiden
            random_traits=no
            animate=yes
            [modifications]
                {TRAIT_LOYAL}
                {TRAIT_STRONG}
            [/modifications]
            x,y=22,8
        [/unit]
        [unit]
            side=1
            generate_name=yes
            type=Faerie Shaman
            random_traits=no
            animate=yes
            [modifications]
                {TRAIT_LOYAL}
                {TRAIT_RESILIENT}
            [/modifications]
            x,y=20,13
        [/unit]

        [objectives]
            {OBJECTIVE_VICTORY  ( _ "Defeat Azzarae")}
            {OBJECTIVE_DEFEAT ( _ "Death of Esther")}
            {OBJECTIVE_DEFEAT ( _ "Death of Yumi")}
            {OBJECTIVE_DEFEAT ( _ "Turns run out")}
            {OBJECTIVE_CARRYOVER}
        [/objectives]

        {REPLACE_SCENARIO_MUSIC battle.ogg}
        {APPEND_MUSIC battle-epic.ogg}
        {APPEND_MUSIC casualties_of_war.ogg}
        {APPEND_MUSIC nunc_dimittis.ogg}
        {APPEND_MUSIC knolls.ogg}
    [/event]

    [event]
        name=new turn
        first_time_only=no
        [if]
            [variable]
                name=turn_fire_dmg
                numerical_not_equals=0
            [/variable]
            [then]
                [store_unit]
                    [filter]
                        side=1
                        [not]
                            id=Esther
                        [/not]
                    [/filter]
                    variable=fire_dmg_unit
                [/store_unit]
                {PLAY_SOUND "fire.wav"}
            [/then]
        [/if]
        [for]
            array=fire_dmg_unit
            [do]
                [if]
                    [variable]
                        name=fire_dmg_unit[$i].hitpoints
                        greater_than=$turn_fire_dmg
                    [/variable]

                    [then]
                        {VARIABLE_OP fire_dmg_unit[$i].hitpoints sub $turn_fire_dmg}
                    [/then]
                    [else]
                        [set_variable]
                            name=fire_dmg_unit[$i].hitpoints
                            value=1
                        [/set_variable]
                    [/else]
                [/if]
                [unstore_unit]
                    variable=fire_dmg_unit[$i]
                    find_vacant=no
                    text= _ "burned"
                    {COLOR_HARM}
                [/unstore_unit]
            [/do]
        [/for]
        {CLEAR_VARIABLE fire_dmg_unit}
    [/event]

    [event]
        name=moveto
        first_time_only=yes
        [filter]
            id=Yumi
            x,y=18,10
        [/filter]

        [message]
            speaker=Yumi
            message= _ "I don't know about this, Esther..."
        [/message]
        [message]
            speaker=Esther
            message= _ "Stop worrying! You'll do great!"
        [/message]
    [/event]

    [event]
        name=attack
        first_time_only=yes
        [filter]
            side=2
        [/filter]
        [filter_second]
            id=Yumi
        [/filter_second]

        [message]
            speaker=Esther
            message= _ "Be careful! You'll get hurt!"
        [/message]
    [/event]

    [event]
        name=last breath
        first_time_only=yes
        [filter]
            side=2
            [not]
                type=Chaos Hound, Demonic Hound, Hellhound
            [/not]
        [/filter]
        [filter_second]
            id=Esther
        [/filter_second]

        [message]
            speaker=Esther
            message= _ "Why are you here? Who ordered you to attack us?"
        [/message]
        [message]
            speaker=unit
            message= _ "(stares)"
        [/message]
        [message]
            speaker=Esther
            message= _ "Can you hear me? Answer me."
        [/message]
        [message]
            speaker=unit
            message= _ "(stares)"
        [/message]

        [if]
            [variable]
                name=unit.gender
                equals=male
            [/variable]
            [then]
                [message]
                    speaker=Yumi
                    message= _ "He's not talking. Just kill him."
                [/message]
            [/then]
            [else]
                [message]
                    speaker=Yumi
                    message= _ "She's not talking. Just kill her."
                [/message]
            [/else]
        [/if]
    [/event]

    [event]
        name=attack
        first_time_only=yes
        [filter]
            side=2
        [/filter]

        [message]
            speaker=Esther
            message= _ "Ah, they're attacking us after all."
        [/message]
        [message]
            speaker=Yumi
            message= _ "Why wouldn't they?"
        [/message]
        [message]
            speaker=Esther
            message= _ "Like I said, we're allies with Ethea, and Xia'el and Uria are friends. It doesn't make sense for the Urdemons to do this. They're usually pretty nice to us."
        [/message]
        [message]
            speaker=Yumi
            message= _ "(tilts head)"
        [/message]
        [message]
            speaker=Esther
            message= _ "Xia'el and Uria are the Guardians of Earth and Life, remember? They're supposed to keep peace on our worlds, Irdya and Ethea. If any of the Urdemons get out of control, Uria's supposed to stop them. She's usually pretty strict with them you know."
        [/message]
        [message]
            speaker=Yumi
            message= _ "So... where is she?"
        [/message]
        [message]
            speaker=Esther
            message= _ "Obviously not here. I guess speculating about this right now isn't helpful. Let's worry about surviving first."
        [/message]
    [/event]

    [event]
        name=turn 5 end

        [message]
            speaker=Esther
            message= _ "Look out, it looks like the demon leader's casting some kind of spell!"
        [/message]
        [animate_unit]
            [filter]
                id=Azzarae
            [/filter]
            [primary_attack]
                range=ranged
            [/primary_attack]
            flag=attack
        [/animate_unit]
        {DELAY 750}
        [animate_unit]
            [filter]
                id=Azzarae
            [/filter]
            [primary_attack]
                range=ranged
            [/primary_attack]
            flag=attack
        [/animate_unit]
        {DELAY 300}
        [animate_unit]
            [filter]
                id=Azzarae
            [/filter]
            [primary_attack]
                range=ranged
            [/primary_attack]
            flag=attack
        [/animate_unit]
        {DELAY 150}
        #ifndef HARD
            [set_variable]
                name=turn_fire_dmg
                value=2
            [/set_variable]
        #endif
        #ifdef HARD
            [set_variable]
                name=turn_fire_dmg
                value=3
            [/set_variable]
        #endif

        {FLASH_RED_EXTREME ({DELAY 1500})}
        {COLOR_ADJUST 50 0 0}
    [/event]
    [event]
        name=side 1 turn 6

        [message]
            speaker=Yumi
            message= _ "Ow!"
        [/message]
        [message]
            speaker=Esther
            message= _ "Yumi! Are you okay?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "I'm... fine. What was that?"
        [/message]
        [message]
            speaker=Esther
            message= _ "Seems like he's trying to use the heat from the lava to fry us."
        [/message]
        [message]
            speaker=Yumi
            message= _ "Ugh, I hate fire."
        [/message]
        [message]
            speaker=Esther
            message= _ "I know you do, but I can't do anything about it without getting rid of that lava. We've got to beat them first."
        [/message]
    [/event]
    [event]
        name=turn 10 end

        #ifndef HARD
            [set_variable]
                name=turn_fire_dmg
                value=3
            [/set_variable]
        #endif
        #ifdef HARD
            [set_variable]
                name=turn_fire_dmg
                value=4
            [/set_variable]
        #endif

        {COLOR_ADJUST 75 0 0}
    [/event]
    [event]
        name=side 1 turn 11

        [message]
            speaker=Yumi
            message= _ "Oww..."
        [/message]
        [message]
            speaker=Esther
            message= _ "Hang in there! Don't give up on me."
        [/message]
        [message]
            speaker=Yumi
            message= _ "I'm trying..."
        [/message]
    [/event]

    [event]
        name=moveto
        first_time_only=yes
        [filter]
            side=2
            [filter_location]
                terrain=G*^F*
            [/filter_location]
        [/filter]

        [message]
            speaker=Esther
            message= _ "They're burning the forest!"
        [/message]
        [message]
            speaker=Yumi
            message= _ "Wonderful."
        [/message]
    [/event]
    [event]
        name=moveto
        first_time_only=no
        [filter]
            side=2
            [filter_location]
                terrain=G*^F*,G*^V*
            [/filter_location]
        [/filter]
        {PLAY_SOUND "torch.ogg"}
        [terrain]
            x,y=$x1,$y1
            radius=1
            terrain=Rd
        [/terrain]
        [terrain]
            x,y=$x1,$y1
            terrain=Rd^Ecf
        [/terrain]
        [redraw][/redraw]
    [/event]
    [event]
        name=side 1 turn 15

        {CLEAR_VARIABLE tmp_lava_dmg}
        {CLEAR_VARIABLE lava_hex}
        #ifndef HARD
            [set_variable]
                name=turn_fire_dmg
                value=6
            [/set_variable]
        #endif
        #ifdef HARD
            [set_variable]
                name=turn_fire_dmg
                value=9
            [/set_variable]
        #endif
        {COLOR_ADJUST 100 0 0}

        [message]
            speaker=Esther
            message= _ "We've got to finish them off before everyone gets burned to death!"
        [/message]
    [/event]

    # victory events
    [event]
        name=last breath
        [filter]
            id=Azzarae
        [/filter]

        [message]
            speaker=Esther
            message= _ "Talk!"
        [/message]
        [message]
            speaker=Azzarae
            message= _ "... I cannot..."
        [/message]
        [message]
            speaker=Esther
            message= _ "Answer me!"
        [/message]
        [message]
            speaker=Azzarae
            message= _ "I am bound..."
        [/message]
        [message]
            speaker=Esther
            message= _ "The leader's acting strange too? Oh well."
        [/message]

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

    [event]
        name=victory
        [message]
            speaker=Esther
            message= _ "Smile, Yumi! We won!"
        [/message]
        [message]
            speaker=Yumi
            message= _ "Ugh."
        [/message]

        [scroll_to]
            x,y=38,6
        [/scroll_to]

        {DELAY 1250}

        [scroll_to]
            x,y=31,15
        [/scroll_to]

        {DELAY 1250}

        [scroll_to]
            x,y=38,15
        [/scroll_to]

        {DELAY 1250}

        [message]
            speaker=Yumi
            message= _ "We won. Awesome."
        [/message]
        [message]
            speaker=Esther
            message= _ "On the bright side at least we're still alive. Right?"
        [/message]
        [message]
            speaker=Esther
            message= _ "We're still alive, at least..."
        [/message]
        [message]
            speaker=Esther
            message= _ "Anyway, we can't stay here any longer. We have to- what are you doing?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "Going to sleep. I'm tired."
        [/message]
        [message]
            speaker=Esther
            message= _ "But-"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(pouts)"
        [/message]
        [message]
            speaker=Esther
            message= _ "(sighs) Okay, but we really shouldn't stay here for too long. After you wake up, we have to get going. Otherwise the demons will hunt us down. Okay?"
        [/message]
        [message]
            speaker=Yumi
            message= _ "(shrugs)"
        [/message]

        {CLEAR_VARIABLE turn_fire_dmg}
    [/event]

    # defeat
    [event]
        name=time over

        {PLAY_SOUND "dragonstick.ogg"}
        {FLASH_RED_EXTREME ({DELAY 1500})}

        [message]
            speaker=Yumi
            message= _ "Great, now we're going to be roasted alive..."
        [/message]

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