#textdomain wesnoth-utbs
[unit]
    id=Desert Sharpshooter
    name= _ "Desert Sharpshooter"
    race=elf
    image=units/elves-desert/sharpshooter.png
    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
        tundra=3
    [/movement_costs]
    [defense]
        sand=40
        forest=50
    [/defense]
    movement=6
    experience=150
    level=3
    alignment=lawful
    advanceto=null
    {AMLA_DEFAULT}
    cost=90
    usage=archer
    unit_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}
    {DEFENSE_ANIM_RANGE "units/elves-desert/sharpshooter-defend.png" units/elves-desert/sharpshooter.png {SOUND_LIST:ELF_HIT} melee}
    {DEFENSE_ANIM_RANGE "units/elves-desert/sharpshooter-bow-defend.png" units/elves-desert/sharpshooter.png {SOUND_LIST:ELF_HIT} ranged}
    [death]
        [frame]
            begin=0
            end=100
            image="units/elves-desert/sharpshooter-die1.png"
        [/frame]
        [frame]
            begin=100
            end=200
            image="units/elves-desert/sharpshooter-die2.png"
        [/frame]
        [frame]
            begin=200
            end=300
            image="units/elves-desert/sharpshooter-die3.png"
        [/frame]
        [frame]
            begin=300
            end=400
            image="units/elves-desert/sharpshooter-die4.png"
        [/frame]
    [/death]
    # 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]
    [attack_anim]
        [attack_filter]
            name=longbow
        [/attack_filter]
        [missile_frame]
            begin=-100
            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=yes
            [frame]
                begin=-380
                end=-305
                image=units/elves-desert/sharpshooter-attack1.png
                sound=bow.ogg
            [/frame]
        [/if]
        [else]
            hits=no
            [frame]
                begin=-380
                end=-305
                image=units/elves-desert/sharpshooter-attack1.png
                sound=bow-miss.ogg
            [/frame]
        [/else]
        [frame]
            begin=-305
            end=-230
            image=units/elves-desert/sharpshooter-attack2.png
        [/frame]
        [frame]
            begin=-230
            end=-130
            image=units/elves-desert/sharpshooter-attack3.png
        [/frame]
        [frame]
            begin=-130
            end=-100
            image=units/elves-desert/sharpshooter-attack4.png
        [/frame]
        [frame]
            begin=-100
            end=0
            image=units/elves-desert/sharpshooter-attack4.png
        [/frame]
        [frame]
            begin=0
            end=65
            image=units/elves-desert/sharpshooter-bow.png
        [/frame]
    [/attack_anim]
    [attack_anim]
        [attack_filter]
            name=sword
        [/attack_filter]
        [if]
            hits=yes
            [frame]
                begin=-101
                end=100
                image=units/elves-desert/sharpshooter-attack.png
                sound={SOUND_LIST:SWORD_SWISH}
            [/frame]
        [/if]
        [else]
            hits=no
            [frame]
                begin=-101
                end=100
                image=units/elves-desert/sharpshooter-attack.png
                sound={SOUND_LIST:MISS}
            [/frame]
        [/else]
    [/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-defend.png" "units/elves-desert/sharpshooter+female.png" {SOUND_LIST:ELF_FEMALE_HIT} melee}
        {DEFENSE_ANIM_RANGE "units/elves-desert/sharpshooter+female-bow-defend.png" "units/elves-desert/sharpshooter+female.png" {SOUND_LIST:ELF_FEMALE_HIT} ranged}
        [death]
            [frame]
                begin=0
                end=100
                image="units/elves-desert/sharpshooter-die1.png"
            [/frame]
            [frame]
                begin=100
                end=200
                image="units/elves-desert/sharpshooter-die2.png"
            [/frame]
            [frame]
                begin=200
                end=300
                image="units/elves-desert/sharpshooter-die3.png"
            [/frame]
            [frame]
                begin=300
                end=400
                image="units/elves-desert/sharpshooter-die4.png"
            [/frame]
        [/death]
        [attack_anim]
            [attack_filter]
                name=longbow
            [/attack_filter]
            [missile_frame]
                begin=-100
                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+female-bow.png"
            [/frame]
            [if]
                hits=yes
                [frame]
                    begin=-380
                    end=-305
                    image="units/elves-desert/sharpshooter+female-attack1.png"
                    sound=bow.ogg
                [/frame]
            [/if]
            [else]
                hits=no
                [frame]
                    begin=-380
                    end=-305
                    image="units/elves-desert/sharpshooter+female-attack1.png"
                    sound=bow-miss.ogg
                [/frame]
            [/else]
            [frame]
                begin=-305
                end=-230
                image="units/elves-desert/sharpshooter+female-attack2.png"
            [/frame]
            [frame]
                begin=-230
                end=-130
                image="units/elves-desert/sharpshooter+female-attack3.png"
            [/frame]
            [frame]
                begin=-130
                end=-100
                image="units/elves-desert/sharpshooter+female-attack4.png"
            [/frame]
            [frame]
                begin=-100
                end=0
                image="units/elves-desert/sharpshooter+female-attack4.png"
            [/frame]
            [frame]
                begin=0
                end=65
                image="units/elves-desert/sharpshooter+female-bow.png"
            [/frame]
        [/attack_anim]
        [attack_anim]
            [attack_filter]
                name=sword
            [/attack_filter]
            [if]
                hits=yes
                [frame]
                    begin=-101
                    end=100
                    image="units/elves-desert/sharpshooter+female-attack.png"
                    sound={SOUND_LIST:SWORD_SWISH}
                [/frame]
            [/if]
            [else]
                hits=no
                [frame]
                    begin=-101
                    end=100
                    image="units/elves-desert/sharpshooter+female-attack.png"
                    sound={SOUND_LIST:MISS}
                [/frame]
            [/else]
        [/attack_anim]
    [/female]
[/unit]
