#textdomain wesnoth-utbs
[unit_type]
    id=Desert Ranger
    name= _ "Desert Ranger"
    race=elf
    image=units/elves-desert/ranger.png
    {MAGENTA_IS_THE_TEAM_COLOR}
    hitpoints=42
    movement_type=woodland
    # Desert elves move fast across the sands, but are not used to forests
    # They are also a bit faster in caves
    # Avengers move faster in mountains and shallow water
    [movement_costs]
        sand=1
        forest=2
        cave=2
        frozen=3
        shallow_water=2
        mountains=2
    [/movement_costs]
    # Ranger defend better in shallow water and swamp
    [defense]
        sand=40
        forest=50
        shallow_water=70
        swamp_water=60
    [/defense]
    movement=6
    experience=80
    level=2
    alignment=lawful
    advances_to=Desert Avenger
    cost=40
    #instead of ambush desert rangers have backstab
    usage=mixed fighter
    description= _ "Desert Rangers are quick and powerful. Skilled in both short and long-range combat, Rangers are truly all-round fighters. Like their kin, they prefer the sword to the bow and are adept at sneaking around and backstabbing their enemies."+{SPECIAL_NOTES}+{SPECIAL_NOTES_BACKSTAB}
    die_sound={SOUND_LIST:ELF_HIT}
    # melee attack stayed the same from 7-3 to 7-3
    # ranged attack decreased from 7-4 to 6-4
    # I decided not to increase melee damage I didn't want the
    # backstab attack ability to be too powerful
    # For comparison the level 2 Rogue unit has a 6,3 backstab attack
    [attack]
        name=sword
        description= _"sword"
        type=blade
        range=melee
        damage=7
        number=3
        [specials]
            {WEAPON_SPECIAL_BACKSTAB}
        [/specials]
        icon=attacks/sword-elven.png
    [/attack]
    [attack]
        name=bow
        description= _"bow"
        type=pierce
        range=ranged
        damage=6
        number=4
        icon=attacks/bow-elven.png
    [/attack]
    {DEFENSE_ANIM_RANGE "units/elves-desert/ranger-sword-defend.png" "units/elves-desert/ranger-sword.png" {SOUND_LIST:ELF_HIT} melee }
    {DEFENSE_ANIM_RANGE "units/elves-desert/ranger-bow-defend.png" "units/elves-desert/ranger-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/ranger-bow.png"
        [/frame]
        [if]
            hits=yes
            [frame]
                begin=-380
                end=-305
                image="units/elves-desert/ranger-bow-attack1.png"
                sound=bow.ogg
            [/frame]
        [/if]
        [else]
            hits=no
            [frame]
                begin=-380
                end=-305
                image="units/elves-desert/ranger-bow-attack1.png"
                sound=bow-miss.ogg
            [/frame]
        [/else]
        [frame]
            begin=-305
            end=-230
            image="units/elves-desert/ranger-bow-attack2.png"
        [/frame]
        [frame]
            begin=-230
            end=-130
            image="units/elves-desert/ranger-bow-attack3.png"
        [/frame]
        [frame]
            begin=-130
            end=0
            image="units/elves-desert/ranger-bow-attack4.png"
        [/frame]
        [frame]
            begin=0
            end=65
            image="units/elves-desert/ranger-bow.png"
        [/frame]
    [/attack_anim]
    [attack_anim]
        [filter_attack]
            name=sword
        [/filter_attack]
        [frame]
            begin=-200
            end=-175
            image="units/elves-desert/ranger-sword.png"
        [/frame]
        [frame]
            begin=-175
            end=-75
            image="units/elves-desert/ranger-sword-1.png"
        [/frame]
        [if]
            hits=no
            [frame]
                begin=-75
                end=75
                image="units/elves-desert/ranger-sword-2.png"
                sound={SOUND_LIST:MISS}
            [/frame]
        [/if]
        [else]
            hits=yes
            [frame]
                begin=-75
                end=75
                image="units/elves-desert/ranger-sword-2.png"
                sound={SOUND_LIST:SWORD_SWISH}
            [/frame]
        [/else]
        [frame]
            begin=75
            end=175
            image="units/elves-desert/ranger-sword-3.png"
        [/frame]
        [frame]
            begin=175
            end=200
            image="units/elves-desert/ranger-sword.png"
        [/frame]
    [/attack_anim]
    [female]
        name= _ "female^Desert Ranger"
        gender=female
        image="units/elves-desert/ranger+female.png"
        die_sound={SOUND_LIST:ELF_FEMALE_HIT}
        {DEFENSE_ANIM_RANGE "units/elves-desert/ranger-sword-defend.png" "units/elves-desert/ranger+female-sword.png" {SOUND_LIST:ELF_FEMALE_HIT} melee}
        {DEFENSE_ANIM_RANGE "units/elves-desert/ranger+female-bow-defend.png" "units/elves-desert/ranger+female-bow.png" {SOUND_LIST:ELF_FEMALE_HIT} ranged}
        [attack_anim]
            [filter_attack]
                name=bow
            [/filter_attack]
            [frame]
                image="units/elves-desert/ranger+female-bow.png"
            [/frame]
            [if]
                [frame]
                    image="units/elves-desert/ranger+female-bow-attack1.png"
                [/frame]
            [/if]
            [else]
                [frame]
                    image="units/elves-desert/ranger+female-bow-attack1.png"
                [/frame]
            [/else]
            [frame]
                image="units/elves-desert/ranger+female-bow-attack2.png"
            [/frame]
            [frame]
                image="units/elves-desert/ranger+female-bow-attack3.png"
            [/frame]
            [frame]
                image="units/elves-desert/ranger+female-bow-attack4.png"
            [/frame]
            [frame]
                image="units/elves-desert/ranger+female-bow.png"
            [/frame]
        [/attack_anim]
        [attack_anim]
            [filter_attack]
                name=sword
            [/filter_attack]
            [frame]
                image="units/elves-desert/ranger+female-sword.png"
            [/frame]
            [frame]
                image="units/elves-desert/ranger+female-sword-1.png"
            [/frame]
            [if]
                [frame]
                    image="units/elves-desert/ranger+female-sword-2.png"
                [/frame]
            [/if]
            [else]
                [frame]
                    image="units/elves-desert/ranger+female-sword-2.png"
                [/frame]
            [/else]
            [frame]
                image="units/elves-desert/ranger+female-sword-3.png"
            [/frame]
            [frame]
                image="units/elves-desert/ranger+female-sword.png"
            [/frame]
        [/attack_anim]
    [/female]
[/unit_type]
