#textdomain wesnoth-sof
[unit_type]
    id=Dwarvish Miner
    name= _ "Dwarvish Miner"
    race=dwarf
    image=units/dwarves/miner.png
    {MAGENTA_IS_THE_TEAM_COLOR}
    hitpoints=25
    movement_type=dwarvishfoot
    movement=5
    level=1
    alignment=neutral
    advances_to=null
    {AMLA_DEFAULT}
    experience=150
    cost=19
    usage=fighter
    description= _ "Dwarvish miners are the grunt workers of Dwarvish society. They take the precious ores out of the ground, but do not ever take part in the crafting of weapons or artifacts."
    {DEFENSE_ANIM_FILTERED "units/dwarves/miner-defend.png" "units/dwarves/miner.png" {SOUND_LIST:DWARF_HIT} (
        [not]
            role=loaded
            [or]
                role=has_coal
            [/or]
            [or]
                role=has_gold
            [/or]
        [/not]
    )}
    {DEFENSE_ANIM_FILTERED "units/dwarves/miner-laden-defend.png" "units/dwarves/miner-laden.png" {SOUND_LIST:DWARF_HIT} (
        role=loaded
        [or]
            role=has_coal
        [/or]
        [or]
            role=has_gold
        [/or]
    )}
    die_sound={SOUND_LIST:DWARF_DIE}
    [attack]
        name=pick
        description= _"pick"
        type=pierce
        range=melee
        damage=4
        number=2
        icon=attacks/pick-axe.png
    [/attack]
    [standing_anim]
        [filter]
            role=loaded
            [or]
                role=has_coal
            [/or]
            [or]
                role=has_gold
            [/or]
        [/filter]
        start_time=0
        [frame]
            duration=1000
            image=units/dwarves/miner-laden.png
        [/frame]
    [/standing_anim]

    # FIXME: this animation is defined to work around a crash due to no valid
    # standing animation being available to an unloaded miner otherwise
    [standing_anim]
        [filter]
            [not]
                role=loaded
                [or]
                    role=has_coal
                [/or]
                [or]
                    role=has_gold
                [/or]
            [/not]
        [/filter]
        start_time=0
        [frame]
            duration=1000
            image=units/dwarves/miner.png
        [/frame]
    [/standing_anim]
    [attack_anim]
        [filter_attack]
            name=pick
        [/filter_attack]
        [filter]
            [not]
                role=loaded
                [or]
                    role=has_coal
                [/or]
                [or]
                    role=has_gold
                [/or]
            [/not]
        [/filter]
        [frame]
            begin=-200
            end=-100
            image=units/dwarves/miner-attack-1.png
        [/frame]
        [if]
            hits=yes
            [frame]
                begin=-100
                end=100
                image=units/dwarves/miner-attack-2.png
                sound=axe.ogg
            [/frame]
        [/if]
        [else]
            hits=no
            [frame]
                begin=-100
                end=150
                image=units/dwarves/miner-attack-2.png
                sound={SOUND_LIST:MISS}
            [/frame]
        [/else]
        [frame]
            begin=150
            end=175
            image=units/dwarves/miner.png
        [/frame]
    [/attack_anim]
    [attack_anim]
        [filter_attack]
            name=pick
        [/filter_attack]
        [filter]
            role=loaded
            [or]
                role=has_coal
            [/or]
            [or]
                role=has_gold
            [/or]
        [/filter]
        [frame]
            begin=-200
            end=-100
            image=units/dwarves/miner-laden-attack-1.png
        [/frame]
        [if]
            hits=yes
            [frame]
                begin=-100
                end=100
                image=units/dwarves/miner-laden-attack-2.png
                sound=axe.ogg
            [/frame]
        [/if]
        [else]
            hits=no
            [frame]
                begin=-100
                end=150
                image=units/dwarves/miner-laden-attack-2.png
                sound={SOUND_LIST:MISS}
            [/frame]
        [/else]
        [frame]
            begin=150
            end=175
            image=units/dwarves/miner-laden.png
        [/frame]
    [/attack_anim]
[/unit_type]
