#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=50
    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.png" "units/dwarves/miner.png" {SOUND_LIST:DWARF_HIT} (
        [filter]
            [not]
                role=loaded
                [or]
                    role=has_coal
                [/or]
                [or]
                    role=has_gold
                [/or]
            [/not]
        [/filter]
    )}
    {DEFENSE_ANIM_FILTERED "units/dwarves/miner-laden.png" "units/dwarves/miner-laden.png" {SOUND_LIST:DWARF_HIT} (
        [filter]
            role=loaded
            [or]
                role=has_coal
            [/or]
            [or]
                role=has_gold
            [/or]
        [/filter]
    )}
    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]
        offset=0.0~0.3,0.3~0.5,0.5~0.6,0.6~0.5,0.5~0.3,0.3~0.0
        [frame]
            begin=-350
            end=-100
            image=units/dwarves/miner.png
        [/frame]
        [if]
            hits=yes
            [frame]
                begin=-100
                end=250
                image=units/dwarves/miner.png
                sound=axe.ogg
            [/frame]
        [/if]
        [else]
            hits=no
            [frame]
                begin=-100
                end=250
                image=units/dwarves/miner.png
                sound={SOUND_LIST:MISS}
            [/frame]
        [/else]
    [/attack_anim]
    [attack_anim]
        [filter_attack]
            name=pick
        [/filter_attack]
        [filter]
            role=loaded
            [or]
                role=has_coal
            [/or]
            [or]
                role=has_gold
            [/or]
        [/filter]
        offset=0.0~0.3,0.3~0.5,0.5~0.6,0.6~0.5,0.5~0.3,0.3~0.0
        [frame]
            begin=-350
            end=-100
            image=units/dwarves/miner-laden.png
        [/frame]
        [if]
            hits=yes
            [frame]
                begin=-100
                end=250
                image=units/dwarves/miner-laden.png
                sound=axe.ogg
            [/frame]
        [/if]
        [else]
            hits=no
            [frame]
                begin=-100
                end=250
                image=units/dwarves/miner-laden.png
                sound={SOUND_LIST:MISS}
            [/frame]
        [/else]
    [/attack_anim]
[/unit_type]
