#textdomain wesnoth-units
[unit_type]
    id=Elder Mage
    name= _ "Elder Mage"
    race=human
    image="units/human-magi/elder-mage.png"
    {DEFENSE_ANIM "units/human-magi/elder-mage-defend.png" "units/human-magi/elder-mage.png" {SOUND_LIST:HUMAN_OLD_HIT} }
    hitpoints=55
    movement_type=smallfoot
    [resistance]
        fire=80
    [/resistance]
    movement=6
    experience=150
    level=5
    alignment=neutral
    advances_to=null
    {AMLA_DEFAULT}
    cost=65
    usage=mixed fighter
    die_sound={SOUND_LIST:HUMAN_OLD_DIE}
    description= _ "Once great, Elder Magi have seen their power a little diminished from wearying years of battle. Nevertheless they remain feared on the battlefield on account of their powerful lightning bolts."+{SPECIAL_NOTES}+{SPECIAL_NOTES_MAGICAL}
    [attack]
        name=staff
        description= _"staff"
        icon=attacks/staff-magic.png
        type=impact
        range=melee
        damage=8
        number=2
    [/attack]
    [attack]
        name=lightning
        description= _"lightning"
        icon=attacks/lightning.png
        type=fire
        range=ranged
        [specials]
            {WEAPON_SPECIAL_MAGICAL}
        [/specials]
        damage=14
        number=4
    [/attack]

    [attack_anim]
        [filter_attack]
            name=staff
        [/filter_attack]
        [frame]
            begin=-225
            end=-200
            image="units/human-magi/elder-mage-ranged1.png"
        [/frame]
        [frame]
            begin=-200
            end=-100
            image="units/human-magi/elder-mage-melee1.png"
        [/frame]
        [if]
            hits=yes
            [frame]
                begin=-100
                end=100
                image="units/human-magi/elder-mage-melee2.png"
                sound=staff.wav
            [/frame]
        [/if]
        [else]
            hits=no
            [frame]
                begin=-100
                end=100
                image="units/human-magi/elder-mage-melee2.png"
                sound={SOUND_LIST:MISS}
            [/frame]
        [/else]
        [frame]
            begin=100
            end=150
            image="units/human-magi/elder-mage-ranged1.png"
        [/frame]
        [frame]
            begin=150
            end=200
            image="units/human-magi/elder-mage.png"
        [/frame]
    [/attack_anim]

#define ELDER_MAGE_LIGHTNING DIRECTION_NUMBER
    [attack_anim]
        [filter_attack]
            name=lightning
        [/filter_attack]

        {LIGHTNING_BOLT {DIRECTION_NUMBER} }

        [if]
            hits=yes
            [frame]
                begin=-300
                end=-200
                image="units/human-magi/elder-mage-ranged1.png"
                sound=lightning.ogg
            [/frame]
        [/if]
        [else]
            hits=no
            [frame]
                begin=-300
                end=-200
                image="units/human-magi/elder-mage-ranged1.png"
                sound=lightning-miss.ogg
            [/frame]
        [/else]
        [frame]
            begin=-200
            end=-100
            image="units/human-magi/elder-mage-ranged2.png"
        [/frame]
        [frame]
            begin=-100
            end=100
            image="units/human-magi/elder-mage-ranged3.png"
        [/frame]
        [frame]
            begin=100
            end=200
            image="units/human-magi/elder-mage-ranged2.png"
        [/frame]
        [frame]
            begin=200
            end=250
            image="units/human-magi/elder-mage-ranged1.png"
        [/frame]
    [/attack_anim]
#enddef

    {ELDER_MAGE_LIGHTNING 1}
    {ELDER_MAGE_LIGHTNING 2}
    {ELDER_MAGE_LIGHTNING 3}
[/unit_type]
