#textdomain wesnoth-units

[unit_type]
    id=Ranger
    name= _ "Ranger"
    race=human
    image="units/human-outlaws/ranger.png"
    profile=portraits/humans/ranger.png
    {MAGENTA_IS_THE_TEAM_COLOR}
    hitpoints=60
    movement_type=smallfoot
    movement=6
    experience=150
    level=3
    alignment=chaotic
    advances_to=null
    {AMLA_DEFAULT}
    cost=60
    usage=mixed fighter
    description= _ "Rangers are wild men and wanderers, who have chosen to shun the company of their fellow men for myriad reasons. They have spent the better part of their lives in the thick of nature, and know many of its secrets. They are excellent pathfinders and explorers, and can find food and shelter where other men would find only sticks and stones.

The presence of these men troubles the more authoritarian of rulers; they are an element that knights and landed armies cannot control. They are men of dubious motives, and are the first to scoff at any royal decree, if they even hear of it at all. Rangers can be hired, but they are just as likely to be in the employ of bandits, as they are to be in the king’s service."
    die_sound={SOUND_LIST:HUMAN_DIE}
    {DEFENSE_ANIM_RANGE "units/human-outlaws/ranger-sword-defend-2.png" "units/human-outlaws/ranger-sword-defend-1.png" {SOUND_LIST:HUMAN_HIT} melee }
    {DEFENSE_ANIM_RANGE "units/human-outlaws/ranger-bow-defend.png" "units/human-outlaws/ranger-bow.png" {SOUND_LIST:HUMAN_HIT} ranged }

    [portrait]
        size=400
        side="left"
        mirror="false"
        image="portraits/humans/transparent/ranger.png"
    [/portrait]
    [portrait]
        size=400
        side="right"
        mirror="true"
        image="portraits/humans/transparent/ranger.png"
    [/portrait]

    # Rangers are almost like human elves
    [defense]
        swamp_water=40
        forest=40
        hills=40
        shallow_water=60
    [/defense]
    [movement_costs]
        shallow_water=2
        swamp_water=2
        forest=1
        hills=1
        mountains=2
        cave=2
        frozen=2
    [/movement_costs]
    [attack]
        name=sword
        description= _ "sword"
        icon=attacks/sword-human.png
        type=blade
        range=melee
        damage=7
        number=4
    [/attack]
    [attack]
        name=bow
        description= _ "bow"
        icon=attacks/bow.png
        type=pierce
        range=ranged
        damage=7
        number=4
    [/attack]
    [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=-400
            end=-325
            image="units/human-outlaws/ranger-bow.png"
        [/frame]
        [if]
            hits=yes
            [frame]
                begin=-325
                end=-250
                image="units/human-outlaws/ranger-bow-attack1.png"
                sound=bow.ogg
            [/frame]
        [/if]
        [else]
            hits=no
            [frame]
                begin=-325
                end=-250
                image="units/human-outlaws/ranger-bow-attack1.png"
                sound=bow-miss.ogg
            [/frame]
        [/else]
        [frame]
            begin=-250
            end=-100
            image="units/human-outlaws/ranger-bow-attack2.png"
        [/frame]
        [frame]
            begin=-100
            end=-25
            image="units/human-outlaws/ranger-bow-attack3.png"
        [/frame]
        [frame]
            begin=-25
            end=50
            image="units/human-outlaws/ranger-bow-attack4.png"
        [/frame]
        [frame]
            begin=50
            end=100
            image="units/human-outlaws/ranger-bow.png"
        [/frame]
    [/attack_anim]

    [attack_anim]
        [filter_attack]
            name=sword
        [/filter_attack]
        start_time=-275

        [frame]
            duration=50
            image="units/human-outlaws/ranger-sword-defend-1.png"
        [/frame]
        [frame]
            duration=100
            image="units/human-outlaws/ranger-sword-attack1.png"
        [/frame]
        [if]
            hits=yes
            [frame]
                duration=100
                image="units/human-outlaws/ranger-sword-attack2.png"
                sound=dagger-swish.wav
            [/frame]
        [/if]
        [else]
            hits=no
            [frame]
                duration=100
                image="units/human-outlaws/ranger-sword-attack2.png"
                sound={SOUND_LIST:MISS}
            [/frame]
        [/else]
        [frame]
            duration=100
            image="units/human-outlaws/ranger-sword-attack3.png"
        [/frame]
        [frame]
            duration=100
            image="units/human-outlaws/ranger-sword-attack4.png"
        [/frame]
        [frame]
            duration=50
            image="units/human-outlaws/ranger-sword-defend-1.png"
        [/frame]
    [/attack_anim]
[/unit_type]
