#textdomain wesnoth-utbs
[unit_type]
    id=Desert Sharpshooter
    name= _ "Desert Sharpshooter"
    race=elf
    image=units/elves-desert/sharpshooter.png
    {MAGENTA_IS_THE_TEAM_COLOR}
    hitpoints=47
    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=150
    level=3
    alignment=lawful
    advances_to=null
    {AMLA_DEFAULT}
    cost=90
    usage=archer
    description= _ "The most elite archers among the elves, Desert Sharpshooters use the best bows and arrows available, which makes them just as deadly as their ancestors. Desert Sharpshooters are incredibly accurate, even when firing very quickly, which makes them excellent at picking off entrenched enemies."+{SPECIAL_NOTES}+{SPECIAL_NOTES_MARKSMAN}
    die_sound={SOUND_LIST:ELF_HIT}
    # Because of the elvish sharpshooter's skill, I make an exception
    # to the desert elf rule of decreasing the ranged attack and
    # increasing the melee attack. In this case I just increase the
    # melee attack and don't decrease the ranged.
    # This is a reward for the player getting a level 3 sharpshooter
    # and because since the sharpshooter has 5 attacks, reducing
    # the ranged damage by 1 is a big penalty. Overall the desert elves
    # are bad at ranged attacks, but I want to give the player one
    # exception
    [attack]
        name=sword
        description= _"sword"
        type=blade
        range=melee
        damage=8
        number=2
        icon=attacks/sword-elven.png
    [/attack]
    [attack]
        name=longbow
        description= _"longbow"
        type=pierce
        range=ranged
        damage=10
        number=5
        [specials]
            {WEAPON_SPECIAL_MARKSMAN}
        [/specials]
        icon=attacks/bow-elven-magic.png
    [/attack]
    {DEFENSE_ANIM_RANGE "units/elves-desert/sharpshooter-sword-defend.png" "units/elves-desert/sharpshooter-sword.png" {SOUND_LIST:ELF_HIT} melee }
    {DEFENSE_ANIM_RANGE "units/elves-desert/sharpshooter-bow-defend.png" "units/elves-desert/sharpshooter-bow.png" {SOUND_LIST:ELF_HIT} ranged }
    [attack_anim]
        [filter_attack]
            name=longbow
        [/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/sharpshooter-bow.png"
        [/frame]
        [if]
            hits=no
            [frame]
                begin=-380
                end=-305
                image="units/elves-desert/sharpshooter-bow-attack1.png"
                sound=bow-miss.ogg
            [/frame]
        [/if]
        [else]
            hits=yes
            [frame]
                begin=-380
                end=-305
                image="units/elves-desert/sharpshooter-bow-attack1.png"
                sound=bow.ogg
            [/frame]
        [/else]
        [frame]
            begin=-305
            end=-230
            image="units/elves-desert/sharpshooter-bow-attack2.png"
        [/frame]
        [frame]
            begin=-230
            end=-130
            image="units/elves-desert/sharpshooter-bow-attack3.png"
        [/frame]
        [frame]
            begin=-130
            end=0
            image="units/elves-desert/sharpshooter-bow-attack4.png"
        [/frame]
        [frame]
            begin=0
            end=150
            image="units/elves-desert/sharpshooter-bow-attack5.png"
        [/frame]
    [/attack_anim]
    [attack_anim]
        [filter_attack]
            name=sword
        [/filter_attack]
        [frame]
            begin=-200
            end=-175
            image="units/elves-desert/sharpshooter-sword.png"
        [/frame]
        [frame]
            begin=-175
            end=-75
            image="units/elves-desert/sharpshooter-sword-1.png"
        [/frame]
        [if]
            hits=no
            [frame]
                begin=-75
                end=100
                image="units/elves-desert/sharpshooter-sword-2.png"
                sound={SOUND_LIST:MISS}
            [/frame]
        [/if]
        [else]
            hits=yes
            [frame]
                begin=-75
                end=100
                image="units/elves-desert/sharpshooter-sword-2.png"
                sound={SOUND_LIST:SWORD_SWISH}
            [/frame]
        [/else]
        [frame]
            begin=100
            end=175
            image="units/elves-desert/sharpshooter-sword-3.png"
        [/frame]
        [frame]
            begin=175
            end=200
            image="units/elves-desert/sharpshooter-sword.png"
        [/frame]
    [/attack_anim]
    [female]
        name= _ "female^Desert Sharpshooter"
        gender=female
        image="units/elves-desert/sharpshooter+female.png"
        die_sound={SOUND_LIST:ELF_FEMALE_HIT}
        {DEFENSE_ANIM_RANGE "units/elves-desert/sharpshooter+female-sword-defend.png" "units/elves-desert/sharpshooter+female-sword.png" {SOUND_LIST:ELF_FEMALE_HIT} melee}
        {DEFENSE_ANIM_RANGE "units/elves-desert/sharpshooter+female-bow-defend.png" "units/elves-desert/sharpshooter+female-bow.png" {SOUND_LIST:ELF_FEMALE_HIT} ranged}
        [attack_anim]
            [filter_attack]
                name=longbow
            [/filter_attack]
            [frame]
                image="units/elves-desert/sharpshooter+female-bow.png"
            [/frame]
            [if]
                hits=no
                [frame]
                    image="units/elves-desert/sharpshooter+female-bow-attack1.png"
                [/frame]
            [/if]
            [else]
                hits=yes
                [frame]
                    image="units/elves-desert/sharpshooter+female-bow-attack1.png"
                [/frame]
            [/else]
            [frame]
                image="units/elves-desert/sharpshooter+female-bow-attack2.png"
            [/frame]
            [frame]
                image="units/elves-desert/sharpshooter+female-bow-attack3.png"
            [/frame]
            [frame]
                image="units/elves-desert/sharpshooter+female-bow-attack4.png"
            [/frame]
            [frame]
                image="units/elves-desert/sharpshooter+female-bow-attack5.png"
            [/frame]
        [/attack_anim]
        [attack_anim]
            [filter_attack]
                name=sword
            [/filter_attack]
            [frame]
                image="units/elves-desert/sharpshooter+female-sword.png"
            [/frame]
            [frame]
                image="units/elves-desert/sharpshooter+female-sword-1.png"
            [/frame]
            [if]
                hits=no
                [frame]
                    image="units/elves-desert/sharpshooter+female-sword-2.png"
                [/frame]
            [/if]
            [else]
                hits=yes
                [frame]
                    image="units/elves-desert/sharpshooter+female-sword-2.png"
                [/frame]
            [/else]
            [frame]
                image="units/elves-desert/sharpshooter+female-sword-3.png"
            [/frame]
            [frame]
                image="units/elves-desert/sharpshooter+female-sword.png"
            [/frame]
        [/attack_anim]
    [/female]
[/unit_type]
