#textdomain wesnoth-utbs

#define KALEH_DESCRIPTION
_"Kaleh is still a young Elf of the Quenoth, on the verge of adulthood. He trained with his father with the bow and sword, joining him in lighter expeditions and raids. When his father was lost, Kaleh became more serious and solemn than is usual for those who walk under the two suns. He turned inwards for answers and guidance, not knowing how much his people would look towards him for guidance in times to come."#enddef

#define NYM_DESCRIPTION
_"Nym is Kaleh’s childhood friend, a young, rebellious lady with quick wits and strong will. Her high spirits are a great boon in dark times."#enddef

#define QUENOTH_YOUTH_DESCRIPTION
    {KALEH_DESCRIPTION}+"

"+{NYM_DESCRIPTION}#enddef

#define HEAL_EFFECTS
    major_amla=yes
    [effect]
        apply_to=hitpoints
        heal_full=yes
    [/effect]
    [effect]
        apply_to=status
        remove=poisoned
    [/effect]
    [effect]
        apply_to=status
        remove=slowed
    [/effect]
    [effect]
        apply_to=status
        remove=dazed
    [/effect]
#enddef

#define XP_INCREASE_EFFECT
    [effect]
        apply_to=max_experience
        increase=20%
    [/effect]
#enddef

#define QUENOTH_YOUTH_ADVANCEMENTS EXTRA_EFFECTS
    [advancement]
        id=warrior_1
        description= _ "Warrior"
        image=attacks/sword-elven.png
        [effect]
            [filter]
                type=Quenoth Youth
            [/filter]
            apply_to=type
            name=Quenoth Youth 2
        [/effect]
        [effect]
            [filter]
                type=Quenoth Youth 2
            [/filter]
            apply_to=type
            name=Quenoth Youth 3
        [/effect]
        {HEAL_EFFECTS}
        {EXTRA_EFFECTS}
        [effect]
            apply_to=attack
            name=sword
            increase_damage=2
        [/effect]
        [effect]
            apply_to=attack
            name=bow
            increase_damage=2
            increase_attacks=1
        [/effect]
    [/advancement]
    [advancement]
        id=hunter_1
        description= _ "Hunter"
        image=attacks/bolas.png
        [effect]
            [filter]
                type=Quenoth Youth
            [/filter]
            apply_to=type
            name=Quenoth Youth 2
        [/effect]
        [effect]
            [filter]
                type=Quenoth Youth 2
            [/filter]
            apply_to=type
            name=Quenoth Youth 3
        [/effect]
        {HEAL_EFFECTS}
        {EXTRA_EFFECTS}
        [effect]
            apply_to=new_attack
            name=bolas
            description= _"bolas"
            type=impact
            range=ranged
            damage=10
            number=2
            icon=attacks/bolas.png
            [specials]
                {WEAPON_SPECIAL_SLOW}
            [/specials]
        [/effect]
        [effect]
            apply_to=movement
            increase=1
        [/effect]
    [/advancement]
    [advancement]
        id=leader_1
        description= _ "Leader"
        image=attacks/leader.png
        [effect]
            [filter]
                type=Quenoth Youth
            [/filter]
            apply_to=type
            name=Quenoth Youth 2
        [/effect]
        [effect]
            [filter]
                type=Quenoth Youth 2
            [/filter]
            apply_to=type
            name=Quenoth Youth 3
        [/effect]
        {HEAL_EFFECTS}
        {EXTRA_EFFECTS}
        [effect]
            apply_to=attack
            name=sword
            increase_damage=1
        [/effect]
        [effect]
            apply_to=attack
            name=bow
            increase_damage=1
        [/effect]
        [effect]
            apply_to=new_ability
            [abilities]
                {ABILITY_LEADERSHIP}
            [/abilities]
        [/effect]
    [/advancement]

    [advancement]
        id=warrior_2_1
        require_amla=warrior_1
        description= _ "Warrior (choose only one): specialize in melee combat"
        image=attacks/sword-elven.png
        exclude_amla=warrior_2_1,warrior_2_2
        [effect]
            [filter]
                type=Quenoth Youth 2
            [/filter]
            apply_to=type
            name=Quenoth Youth 3
        [/effect]
        {HEAL_EFFECTS}
        {EXTRA_EFFECTS}
        [effect]
            apply_to=attack
            name=sword
            increase_damage=2
            increase_attacks=1
        [/effect]
    [/advancement]
    [advancement]
        id=warrior_2_2
        require_amla=warrior_1
        description= _ "Warrior (choose only one): specialize in archery"
        image=attacks/sword-elven.png
        exclude_amla=warrior_2_1,warrior_2_2
        [effect]
            [filter]
                type=Quenoth Youth 2
            [/filter]
            apply_to=type
            name=Quenoth Youth 3
        [/effect]
        {HEAL_EFFECTS}
        {EXTRA_EFFECTS}
        [effect]
            apply_to=attack
            name=bow
            increase_damage=3
            [set_specials]
                {WEAPON_SPECIAL_MARKSMAN}
            [/set_specials]
        [/effect]
    [/advancement]
    [advancement]
        id=hunter_2_1
        require_amla=hunter_1
        description= _ "Hunter (choose only one): specialize in surprise attacks"
        image=attacks/bolas.png
        exclude_amla=hunter_2_1,hunter_2_2
        [effect]
            [filter]
                type=Quenoth Youth 2
            [/filter]
            apply_to=type
            name=Quenoth Youth 3
        [/effect]
        {HEAL_EFFECTS}
        {EXTRA_EFFECTS}
        [effect]
            apply_to=attack
            name=sword
            [set_specials]
                {WEAPON_SPECIAL_BACKSTAB}
            [/set_specials]
        [/effect]
        [effect]
            apply_to=attack
            name=bolas
            increase_damage=3
            increase_attacks=1
        [/effect]
    [/advancement]
    [advancement]
        id=hunter_2_2
        require_amla=hunter_1
        description= _ "Hunter (choose only one): specialize in skirmishing"
        image=attacks/bolas.png
        exclude_amla=hunter_2_1,hunter_2_2
        [effect]
            [filter]
                type=Quenoth Youth 2
            [/filter]
            apply_to=type
            name=Quenoth Youth 3
        [/effect]
        {HEAL_EFFECTS}
        {EXTRA_EFFECTS}
        [effect]
            apply_to=new_ability
            [abilities]
                {ABILITY_SKIRMISHER}
            [/abilities]
        [/effect]
        [effect]
            apply_to=attack
            name=bolas
            increase_damage=3
            increase_attacks=1
        [/effect]
    [/advancement]
    [advancement]
        id=leader_2_1
        require_amla=leader_1
        description= _ "Leader (choose only one): specialize in supporting allies"
        image=attacks/leader.png
        exclude_amla=leader_2_1,leader_2_2
        [effect]
            [filter]
                type=Quenoth Youth 2
            [/filter]
            apply_to=type
            name=Quenoth Youth 3
        [/effect]
        {HEAL_EFFECTS}
        {EXTRA_EFFECTS}
        [effect]
            apply_to=new_ability
            [abilities]
                {ABILITY_SUPPORT}
            [/abilities]
        [/effect]
        [effect]
            apply_to=attack
            name=sword
            increase_damage=1
        [/effect]
        [effect]
            apply_to=attack
            name=bow
            increase_damage=1
        [/effect]
    [/advancement]
    [advancement]
        id=leader_2_2
        require_amla=leader_1
        description= _ "Leader (choose only one): specialize in distracting enemies"
        image=attacks/leader.png
        exclude_amla=leader_2_1,leader_2_2
        [effect]
            [filter]
                type=Quenoth Youth 2
            [/filter]
            apply_to=type
            name=Quenoth Youth 3
        [/effect]
        {HEAL_EFFECTS}
        {EXTRA_EFFECTS}
        [effect]
            apply_to=new_ability
            [abilities]
                {ABILITY_DISTRACT}
            [/abilities]
        [/effect]
        [effect]
            apply_to=attack
            name=sword
            increase_damage=1
        [/effect]
        [effect]
            apply_to=attack
            name=bow
            increase_damage=1
        [/effect]
    [/advancement]
#enddef

#define KALEH_ANIMATIONS
    {LEADING_ANIM "units/quenoth/kaleh-lead2.png" "units/quenoth/kaleh-lead1.png" (12,-32)}
    {DEFENSE_ANIM_RANGE "units/quenoth/kaleh-defend-2.png" "units/quenoth/kaleh-defend-1.png" {SOUND_LIST:ELF_HIT} melee}
    {DEFENSE_ANIM_FILTERED "units/quenoth/kaleh-bow-defend-2.png" "units/quenoth/kaleh-bow-defend-1.png" {SOUND_LIST:ELF_HIT} (
        [filter_second_attack]
            name=bow
        [/filter_second_attack]
    )}
    {DEFENSE_ANIM_FILTERED "units/quenoth/kaleh-defend-2.png" "units/quenoth/kaleh-defend-1.png" {SOUND_LIST:ELF_HIT} (
        [filter_second_attack]
            name=bolas
        [/filter_second_attack]
    )}
    [attack_anim]
        [filter_attack]
            name=bow
        [/filter_attack]
        missile_start_time=-100
        [missile_frame]
            duration=100
            image=projectiles/missile-n.png
            image_diagonal=projectiles/missile-ne.png
        [/missile_frame]
        start_time=-380
        [frame]
            image=units/quenoth/kaleh-bow.png:470
        [/frame]
        {SOUND:HIT_AND_MISS bow.ogg bow-miss.ogg -380}
    [/attack_anim]
    [attack_anim]
        [filter_attack]
            name=sword
        [/filter_attack]
        start_time=-420
        offset=0.0:210,0.0~0.5:210,0.5~0.0:250,0.0:1
        [frame]
            image="units/quenoth/kaleh-sword[1,2,3,4,5,6,7].png:[80,80,80,80,100,125,125],units/quenoth/kaleh.png:1"
        [/frame]
        {SOUND:HIT_AND_MISS {SOUND_LIST:SWORD_SWISH} {SOUND_LIST:MISS} -100}
    [/attack_anim]
    [attack_anim]
        [filter_attack]
            name=bolas
        [/filter_attack]
        missile_start_time=-150
        [missile_frame]
            duration=150
            image=projectiles/bolas-n.png
            image_diagonal=projectiles/bolas-ne.png
        [/missile_frame]
        start_time=-400
        [frame]
            image=units/quenoth/kaleh-bolas[1,2,3,4].png:[70,80,100,200]
        [/frame]
        {SOUND:HIT_AND_MISS hatchet.wav hatchet-miss.wav -300}
    [/attack_anim]
#enddef

#define NYM_ANIMATIONS
    {LEADING_ANIM "units/quenoth/nym-lead2.png" "units/quenoth/nym-lead1.png" (12,-32)}
    {DEFENSE_ANIM_RANGE "units/quenoth/nym-defend-2.png" "units/quenoth/nym-defend-1.png" {SOUND_LIST:ELF_FEMALE_HIT} melee}
    {DEFENSE_ANIM_FILTERED "units/quenoth/nym-bow-defend-2.png" "units/quenoth/nym-bow-defend-1.png" {SOUND_LIST:ELF_FEMALE_HIT} (
        [filter_second_attack]
            name=bow
        [/filter_second_attack]
    )}
    {DEFENSE_ANIM_FILTERED "units/quenoth/nym-defend-2.png" "units/quenoth/nym-defend-1.png" {SOUND_LIST:ELF_FEMALE_HIT} (
        [filter_second_attack]
            name=bolas
        [/filter_second_attack]
    )}
    [attack_anim]
        [filter_attack]
            name=bow
        [/filter_attack]
        missile_start_time=-100
        [missile_frame]
            duration=100
            image=projectiles/missile-n.png
            image_diagonal=projectiles/missile-ne.png
        [/missile_frame]
        start_time=-380
        [frame]
            image=units/quenoth/nym-bow.png:470
        [/frame]
        {SOUND:HIT_AND_MISS bow.ogg bow-miss.ogg -380}
    [/attack_anim]
    [attack_anim]
        [filter_attack]
            name=sword
        [/filter_attack]
        start_time=-420
        offset=0.0:210,0.0~0.5:210,0.5~0.0:250,0.0:1
        [frame]
            image="units/quenoth/nym-sword[1,2,3,4,5,6,7].png:[80,80,80,80,100,125,125],units/quenoth/nym.png:1"
        [/frame]
        {SOUND:HIT_AND_MISS {SOUND_LIST:SWORD_SWISH} {SOUND_LIST:MISS} -100}
    [/attack_anim]
    [attack_anim]
        [filter_attack]
            name=bolas
        [/filter_attack]
        missile_start_time=-150
        [missile_frame]
            duration=150
            image=projectiles/bolas-n.png
            image_diagonal=projectiles/bolas-ne.png
        [/missile_frame]
        start_time=-400
        [frame]
            image=units/quenoth/nym-bolas[1,2,3,4].png:[70,80,100,200]
        [/frame]
        {SOUND:HIT_AND_MISS hatchet.wav hatchet-miss.wav -300}
    [/attack_anim]
#enddef

[unit_type]
    id=Quenoth Youth
    race=elf
    ignore_race_traits=yes
    gender=male,female
    name= _ "Quenoth Youth"
    image=units/quenoth/kaleh.png
    movement_type=quenoth_foot
    movement=6
    hitpoints=32
    experience=40
    level=1
    profile=portraits/kaleh.png
    alignment=lawful
    advances_to=null
    cost=14
    usage=fighter
    description={QUENOTH_YOUTH_DESCRIPTION}
    die_sound={SOUND_LIST:ELF_HIT}
    [attack]
        name=sword
        #textdomain wesnoth-units
        description= _"sword"
        type=blade
        range=melee
        damage=5
        number=4
        icon=attacks/sword-elven.png
    [/attack]
    [attack]
        name=bow
        description= _"bow"
        #textdomain wesnoth-utbs
        type=pierce
        range=ranged
        damage=4
        number=3
        icon=attacks/bow-elven.png
    [/attack]
    {KALEH_ANIMATIONS}
    [male]
        description={KALEH_DESCRIPTION}
    [/male]
    [female]
        gender=female
        name= _ "female^Quenoth Youth"
        image="units/quenoth/nym.png"
        profile=portraits/nym.png
        die_sound={SOUND_LIST:ELF_FEMALE_HIT}
        description={NYM_DESCRIPTION}
        {NYM_ANIMATIONS}
    [/female]
    {QUENOTH_YOUTH_ADVANCEMENTS ()}
[/unit_type]

[unit_type]
    id=Quenoth Youth 2
    race=elf
    ignore_race_traits=yes
    gender=male,female
    name= _ "Quenoth Youth"
    image=units/quenoth/kaleh.png
    movement_type=quenoth_foot
    movement=6
    hitpoints=40
    experience=90
    level=2
    profile=portraits/kaleh.png
    alignment=lawful
    advances_to=null
    cost=14
    usage=fighter
    description={QUENOTH_YOUTH_DESCRIPTION}
    die_sound={SOUND_LIST:ELF_HIT}
    hide_help=yes
    do_not_list=yes
    [attack]
        name=sword
        #textdomain wesnoth-units
        description= _"sword"
        type=blade
        range=melee
        damage=5
        number=4
        icon=attacks/sword-elven.png
    [/attack]
    [attack]
        name=bow
        description= _"bow"
        #textdomain wesnoth-utbs
        type=pierce
        range=ranged
        damage=4
        number=3
        icon=attacks/bow-elven.png
    [/attack]
    {KALEH_ANIMATIONS}
    [male]
        description={KALEH_DESCRIPTION}
    [/male]
    [female]
        gender=female
        name= _ "female^Quenoth Youth"
        image="units/quenoth/nym.png"
        profile=portraits/nym.png
        die_sound={SOUND_LIST:ELF_FEMALE_HIT}
        description={NYM_DESCRIPTION}
        {NYM_ANIMATIONS}
    [/female]
    {QUENOTH_YOUTH_ADVANCEMENTS ()}
[/unit_type]

[unit_type]
    id=Quenoth Youth 3
    race=elf
    ignore_race_traits=yes
    gender=male,female
    name= _ "Quenoth Youth"
    image=units/quenoth/kaleh.png
    movement_type=quenoth_foot
    movement=6
    hitpoints=52
    experience=150
    level=3
    profile=portraits/kaleh.png
    alignment=lawful
    advances_to=null
    cost=14
    usage=fighter
    description={QUENOTH_YOUTH_DESCRIPTION}
    die_sound={SOUND_LIST:ELF_HIT}
    hide_help=yes
    do_not_list=yes
    [attack]
        name=sword
        #textdomain wesnoth-units
        description= _"sword"
        type=blade
        range=melee
        damage=5
        number=4
        icon=attacks/sword-elven.png
    [/attack]
    [attack]
        name=bow
        description= _"bow"
        #textdomain wesnoth-utbs
        type=pierce
        range=ranged
        damage=4
        number=3
        icon=attacks/bow-elven.png
    [/attack]
    {KALEH_ANIMATIONS}
    [male]
        description={KALEH_DESCRIPTION}
    [/male]
    [female]
        gender=female
        name= _ "female^Quenoth Youth"
        image="units/quenoth/nym.png"
        profile=portraits/nym.png
        die_sound={SOUND_LIST:ELF_FEMALE_HIT}
        description={NYM_DESCRIPTION}
        {NYM_ANIMATIONS}
    [/female]
    {QUENOTH_YOUTH_ADVANCEMENTS {XP_INCREASE_EFFECT}}
    {AMLA_DEFAULT}
[/unit_type]
