#textdomain wesnoth-utbs

[unit_type]
    id=Desert Archer
    name= _ "Desert Archer"
    race=elf
    gender=male
    image=units/elves-desert/archer.png
    {MAGENTA_IS_THE_TEAM_COLOR}
    hitpoints=29
    movement_type=woodland
    #desert elves move fast across the sands, but are not used to forests
    #they are also a bit faster in caves
    [movement_costs]
        sand=1
        forest=2
        cave=2
        frozen=3
    [/movement_costs]
    [defense]
        sand=40
        forest=50
    [/defense]
    movement=6
    experience=44
    level=1
    alignment=lawful
    advances_to=Desert Ranger,Desert Marksman
    cost=17
    usage=archer
    description= _ "Desert Archers are trained from youth in archery, and so skilled in long-range combat. Though their bows are cruder and their arrows less plentiful than their elvish ancestors, they fight with ferocity that does credit to their race."
    die_sound={SOUND_LIST:ELF_HIT}
    # melee attack increased from 5-2 to 6-2
    # ranged attack decreased from 5-4 to 4-4
    [attack]
        name=sword
        description= _"sword"
        type=blade
        range=melee
        damage=6
        number=2
        icon=attacks/sword-elven.png
    [/attack]
    [attack]
        name=bow
        description= _"bow"
        type=pierce
        range=ranged
        damage=4
        number=4
        icon=attacks/bow-elven.png
    [/attack]
    {DEFENSE_ANIM_RANGE "units/elves-desert/archer-sword-defend.png" "units/elves-desert/archer-sword.png" {SOUND_LIST:ELF_HIT} melee }
    {DEFENSE_ANIM_RANGE "units/elves-desert/archer-bow-defend.png" "units/elves-desert/archer-bow.png" {SOUND_LIST:ELF_HIT} ranged }
    [attack_anim]
        [filter_attack]
            name=bow
        [/filter_attack]
        [missile_frame]
            begin=-150
            end=0
            image="projectiles/missile-n.png"
            image_diagonal="projectiles/missile-ne.png"
        [/missile_frame]
        [frame]
            begin=-445
            end=-380
            image="units/elves-desert/archer-bow.png"
        [/frame]
        [if]
            hits=yes
            [frame]
                begin=-380
                end=-305
                image="units/elves-desert/archer-bow-attack1.png"
                sound=bow.ogg
            [/frame]
        [/if]
        [else]
            hits=no
            [frame]
                begin=-380
                end=-305
                image="units/elves-desert/archer-bow-attack1.png"
                sound=bow-miss.ogg
            [/frame]
        [/else]
        [frame]
            begin=-305
            end=-230
            image="units/elves-desert/archer-bow-attack2.png"
        [/frame]
        [frame]
            begin=-230
            end=-130
            image="units/elves-desert/archer-bow-attack3.png"
        [/frame]
        [frame]
            begin=-130
            end=0
            image="units/elves-desert/archer-bow-attack4.png"
        [/frame]
        [frame]
            begin=0
            end=65
            image="units/elves-desert/archer-bow.png"
        [/frame]
    [/attack_anim]
    [attack_anim]
        [filter_attack]
            name=sword
        [/filter_attack]
        [frame]
            begin=-200
            end=-175
            image="units/elves-desert/archer-sword.png"
        [/frame]
        [frame]
            begin=-175
            end=-75
            image="units/elves-desert/archer-sword-1.png"
        [/frame]
        [if]
            hits=no
            [frame]
                begin=-75
                end=75
                image="units/elves-desert/archer-sword-2.png"
                sound={SOUND_LIST:MISS}
            [/frame]
        [/if]
        [else]
            hits=yes
            [frame]
                begin=-75
                end=75
                image="units/elves-desert/archer-sword-2.png"
                sound={SOUND_LIST:SWORD_SWISH}
            [/frame]
        [/else]
        [frame]
            begin=75
            end=125
            image="units/elves-desert/archer-sword-3.png"
        [/frame]
        [frame]
            begin=125
            end=175
            image="units/elves-desert/archer-sword-4.png"
        [/frame]
        [frame]
            begin=175
            end=200
            image="units/elves-desert/archer-sword.png"
        [/frame]
    [/attack_anim]
    [idle_anim]
        {STANDARD_IDLE_FILTER}
        start_time=0
        [frame]
            duration=100
            image="units/elves-desert/archer-idle-1.png"
        [/frame]
        [frame]
            duration=100
            image="units/elves-desert/archer-idle-2.png"
        [/frame]
        [frame]
            duration=100
            image="units/elves-desert/archer-idle-3.png"
        [/frame]
        [frame]
            duration=100
            image="units/elves-desert/archer-idle-4.png"
        [/frame]
        [frame]
            duration=100
            image="units/elves-desert/archer-idle-5.png"
        [/frame]
        [frame]
            duration=100
            image="units/elves-desert/archer-idle-6.png"
        [/frame]
        [frame]
            duration=100
            image="units/elves-desert/archer-idle-3.png"
        [/frame]
        [frame]
            duration=100
            image="units/elves-desert/archer-idle-4.png"
        [/frame]
        [frame]
            duration=100
            image="units/elves-desert/archer-idle-5.png"
        [/frame]
        [frame]
            duration=100
            image="units/elves-desert/archer-idle-6.png"
        [/frame]
        [frame]
            duration=100
            image="units/elves-desert/archer-idle-3.png"
        [/frame]
        [frame]
            duration=100
            image="units/elves-desert/archer-idle-4.png"
        [/frame]
        [frame]
            duration=100
            image="units/elves-desert/archer-idle-5.png"
        [/frame]
        [frame]
            duration=100
            image="units/elves-desert/archer-idle-6.png"
        [/frame]
        [frame]
            duration=100
            image="units/elves-desert/archer-idle-2.png"
        [/frame]
        [frame]
            duration=100
            image="units/elves-desert/archer-idle-1.png"
        [/frame]
    [/idle_anim]
    [female]
        name= _ "female^Desert Archer"
        gender=female
        image="units/elves-desert/archer+female.png"
        die_sound={SOUND_LIST:ELF_FEMALE_HIT}
        {DEFENSE_ANIM_RANGE "units/elves-desert/archer+female-sword-defend.png" "units/elves-desert/archer+female-sword.png" {SOUND_LIST:ELF_FEMALE_HIT} melee }
        {DEFENSE_ANIM_RANGE "units/elves-desert/archer+female-bow-defend.png" "units/elves-desert/archer+female-bow.png" {SOUND_LIST:ELF_FEMALE_HIT} ranged}
        [attack_anim]
            [filter_attack]
                name=bow
            [/filter_attack]
            [frame]
                image="units/elves-desert/archer+female-bow.png"
            [/frame]
            [if]
                [frame]
                    image="units/elves-desert/archer+female-bow-attack1.png"
                [/frame]
            [/if]
            [else]
                [frame]
                    image="units/elves-desert/archer+female-bow-attack1.png"
                [/frame]
            [/else]
            [frame]
                image="units/elves-desert/archer+female-bow-attack2.png"
            [/frame]
            [frame]
                image="units/elves-desert/archer+female-bow-attack3.png"
            [/frame]
            [frame]
                image="units/elves-desert/archer+female-bow-attack4.png"
            [/frame]
            [frame]
                image="units/elves-desert/archer+female-bow.png"
            [/frame]
        [/attack_anim]
        [attack_anim]
            [filter_attack]
                name=sword
            [/filter_attack]
            [frame]
                image="units/elves-desert/archer+female-sword.png"
            [/frame]
            [frame]
                image="units/elves-desert/archer+female-sword-1.png"
            [/frame]
            [if]
                hits=no
                [frame]
                    image="units/elves-desert/archer+female-sword-2.png"
                [/frame]
            [/if]
            [else]
                hits=yes
                [frame]
                    image="units/elves-desert/archer+female-sword-2.png"
                [/frame]
            [/else]
            [frame]
                image="units/elves-desert/archer+female-sword-3.png"
            [/frame]
            [frame]
                image="units/elves-desert/archer+female-sword-4.png"
            [/frame]
            [frame]
                image="units/elves-desert/archer+female-sword.png"
            [/frame]
        [/attack_anim]
    [/female]
[/unit_type]

#wmllint: usage of "Desert Archer" is archer

#define DESERT_ARCHER_VARIANT SUFFIX COST
    [unit_type]
        id=Desert Archer{SUFFIX}
        [base_unit]
            id=Desert Archer
        [/base_unit]
        hide_help=true
        do_not_list=true
        cost={COST}
    [/unit_type]
#enddef

{DESERT_ARCHER_VARIANT  2 18}
{DESERT_ARCHER_VARIANT  3 19}
{DESERT_ARCHER_VARIANT  4 20}
{DESERT_ARCHER_VARIANT  5 21}
{DESERT_ARCHER_VARIANT  6 22}
{DESERT_ARCHER_VARIANT  7 23}
{DESERT_ARCHER_VARIANT  8 24}
{DESERT_ARCHER_VARIANT  9 25}
{DESERT_ARCHER_VARIANT 10 26}
{DESERT_ARCHER_VARIANT 11 27}

#undef DESERT_ARCHER_VARIANT
