#textdomain wesnoth-utbs
[unit_type]
    id=Desert Captain
    name= _ "Desert Captain"
    race=elf
    image=units/elves-desert/captain.png
    {MAGENTA_IS_THE_TEAM_COLOR}
    [leading_anim]
        [frame]
            begin=-150
            end=150
            image="units/elves-desert/captain-leading.png"
        [/frame]
    [/leading_anim]
    hitpoints=47
    [abilities]
        {ABILITY_LEADERSHIP_LEVEL_2}
    [/abilities]
    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=5
    experience=90
    level=2
    alignment=lawful
    advances_to=Desert Marshal
    cost=40
    usage=fighter
    description= _ "Skilled in commanding other elves, Desert Captains provide a bonus to all level 1 units on adjacent hexes. Desert Captains prefer engaging the enemy in melee combat, but are trained in archery as well."+{SPECIAL_NOTES}+{SPECIAL_NOTES_LEADERSHIP}
    die_sound={SOUND_LIST:ELF_HIT}
    {DEFENSE_ANIM_RANGE "units/elves-desert/captain-defend.png" "units/elves-desert/captain.png" {SOUND_LIST:ELF_HIT} melee}
    {DEFENSE_ANIM_RANGE "units/elves-desert/captain-bow-defend.png" "units/elves-desert/captain-bow.png" {SOUND_LIST:ELF_HIT} ranged }
    # melee attack increased from 7-4 to 8-4
    # ranged attack decreased from 5-3 to 4-3
    [attack]
        name=sword
        description= _"sword"
        type=blade
        range=melee
        damage=8
        number=4
        icon=attacks/sword-elven.png
    [/attack]
    [attack]
        name=bow
        description= _"bow"
        type=pierce
        range=ranged
        damage=4
        number=3
        icon=attacks/bow-elven.png
    [/attack]
    [attack_anim]
        [filter_attack]
            name=bow
        [/filter_attack]
        hits=yes
        [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/captain-bow.png"
        [/frame]
        [frame]
            begin=-380
            end=-305
            image="units/elves-desert/captain-bow-attack1.png"
            sound=bow.ogg
        [/frame]
        [frame]
            begin=-305
            end=-230
            image="units/elves-desert/captain-bow-attack2.png"
        [/frame]
        [frame]
            begin=-230
            end=-130
            image="units/elves-desert/captain-bow-attack3.png"
        [/frame]
        [frame]
            begin=-130
            end=0
            image="units/elves-desert/captain-bow-attack4.png"
        [/frame]
        [frame]
            begin=0
            end=65
            image="units/elves-desert/captain-bow.png"
        [/frame]
    [/attack_anim]
    [attack_anim]
        [filter_attack]
            name=bow
        [/filter_attack]
        hits=no
        [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/captain-bow.png"
        [/frame]
        [frame]
            begin=-380
            end=-305
            image="units/elves-desert/captain-bow-attack1.png"
            sound=bow-miss.ogg
        [/frame]
        [frame]
            begin=-305
            end=-230
            image="units/elves-desert/captain-bow-attack2.png"
        [/frame]
        [frame]
            begin=-230
            end=-130
            image="units/elves-desert/captain-bow-attack3.png"
        [/frame]
        [frame]
            begin=-130
            end=0
            image="units/elves-desert/captain-bow-attack4.png"
        [/frame]
        [frame]
            begin=0
            end=65
            image="units/elves-desert/captain-bow.png"
        [/frame]
    [/attack_anim]
    [attack_anim]
        [filter_attack]
            name=sword
        [/filter_attack]
        [frame]
            begin=-200
            end=-175
            image="units/elves-desert/captain.png"
        [/frame]
        [frame]
            begin=-175
            end=-100
            image="units/elves-desert/captain-melee-2.png"
        [/frame]
        [if]
            hits=yes
            [frame]
                begin=-100
                end=100
                image="units/elves-desert/captain-melee-1.png"
                sound={SOUND_LIST:SWORD_SWISH}
            [/frame]
        [/if]
        [else]
            hits=no
            [frame]
                begin=-100
                end=100
                image="units/elves-desert/captain-melee-1.png"
                sound={SOUND_LIST:MISS}
            [/frame]
        [/else]
        [frame]
            begin=100
            end=175
            image="units/elves-desert/captain-melee-2.png"
        [/frame]
        [frame]
            begin=175
            end=225
            image="units/elves-desert/captain.png"
        [/frame]
    [/attack_anim]
[/unit_type]
