#textdomain wesnoth-trow
[unit_type]
    id=Familiar
    name= _ "Familiar"
    race=undead
    image="units/familiar-3.png"
    hitpoints=36
    movement_type=smallfly
    movement=8
    experience=100
    level=2
    alignment=chaotic
    advances_to=null
    {AMLA_DEFAULT}
    cost=40
    usage=scout
    description= _ "Powerful magic users sometimes have familiars, creatures which have had a spirit or minor demon drawn into them. A familiar may act as a spy or messenger for its master."
    die_sound=bat-flapping.wav

    # Use undeadfoot resistances despite the smallfly movement values
    [resistance]
        blade=90
        pierce=70
        impact=110
        fire=120
        cold=40
        arcane=150
    [/resistance]

    [attack]
        name=bite
        description= _"bite"
        icon=attacks/fangs-animal.png
        type=blade
        range=melee
        damage=5
        number=5
    [/attack]
    [defend]
        [if]
            hits=miss
            offset=0.0~-0.15,-0.15~0.0
        [/if]
        start_time=-126
        [frame]
            duration=1
            image="units/familiar-3.png"
        [/frame]
        [frame]
            duration=50
            image="units/familiar-4.png"
        [/frame]
        [if]
            hits=hit
            [frame]
                duration=200
                image="units/familiar-4.png"
                sound=familiar-teeth.ogg
            [/frame]
        [/if]
        [else]
            hits=miss,kill
            [frame]
                duration=200
                image="units/familiar-4.png"
            [/frame]
        [/else]
        [frame]
            duration=1
            image="units/familiar-3.png"
        [/frame]
    [/defend]
    [standing_anim]
        layer=60
        start_time=0
        [frame]
            duration=50
            image="units/familiar-3.png"
        [/frame]
        [frame]
            duration=60
            image="units/familiar-2.png"
        [/frame]
        [frame]
            duration=80
            image="units/familiar-1.png"
        [/frame]
        [frame]
            duration=60
            image="units/familiar-2.png"
        [/frame]
        [frame]
            duration=50
            image="units/familiar-3.png"
        [/frame]
        [frame]
            duration=60
            image="units/familiar-4.png"
        [/frame]
        [frame]
            duration=80
            image="units/familiar-5.png"
        [/frame]
        [frame]
            duration=60
            image="units/familiar-4.png"
        [/frame]
    [/standing_anim]
    [movement_anim]
        start_time=0
        [frame]
            duration=50
            image="units/familiar-3.png"
        [/frame]
        [frame]
            duration=60
            image="units/familiar-2.png"
        [/frame]
        [frame]
            duration=80
            image="units/familiar-1.png"
        [/frame]
        [frame]
            duration=60
            image="units/familiar-2.png"
        [/frame]
        [frame]
            duration=50
            image="units/familiar-3.png"
        [/frame]
        [frame]
            duration=60
            image="units/familiar-4.png"
        [/frame]
        [frame]
            duration=80
            image="units/familiar-5.png"
        [/frame]
        [frame]
            duration=60
            image="units/familiar-4.png"
        [/frame]
    [/movement_anim]
    [attack_anim]
        [filter_attack]
            name=bite
        [/filter_attack]

        offset=0.0~0.9:200,0.9~0.0:160
        start_time=-200

        [frame]
            duration=30
            image="units/familiar-3.png"
        [/frame]
        [frame]
            duration=30
            image="units/familiar-2.png"
        [/frame]
        [frame]
            duration=30
            image="units/familiar-1.png"
            sound=bat-flapping.wav
        [/frame]
        [frame]
            duration=30
            image="units/familiar-2.png"
        [/frame]
        [frame]
            duration=30
            image="units/familiar-3.png"
        [/frame]
        [if]
            hits=yes
            [frame]
                duration=70
                image="units/familiar-4.png"
                sound=bite-small.ogg
            [/frame]
        [/if]
        [else]
            hits=no
            [frame]
                duration=70
                image="units/familiar-4.png"
                sound={SOUND_LIST:MISS}
            [/frame]
        [/else]
        [frame]
            duration=50
            image="units/familiar-3.png"
        [/frame]
        [frame]
            duration=50
            image="units/familiar-2.png"
        [/frame]
        [frame]
            duration=40
            image="units/familiar-3.png"
        [/frame]
    [/attack_anim]
[/unit_type]
