#textdomain wesnoth-units
[unit_type]
    id=Dwarvish Berserker
    name= _ "Dwarvish Berserker"
    race=dwarf
    image="units/dwarves/berserker.png"
    profile="portraits/dwarves/ulfserker.png"
    {MAGENTA_IS_THE_TEAM_COLOR}
    hitpoints=48
    movement_type=dwarvishfoot
    movement=5
    experience=150
    level=2
    alignment=neutral
    advances_to=null
    {AMLA_DEFAULT}
    undead_variation=dwarf
    cost=33
    usage=fighter
    description= _ "Berserkers are a rare caste of Dwarves, who work themselves into a towering rage before combat. These warriors disdain all notion of defense, thinking only of the unrelenting assaults for which they are legendary."+{SPECIAL_NOTES}+{SPECIAL_NOTES_BERSERK}
    die_sound={SOUND_LIST:DWARF_DIE}
    {DEFENSE_ANIM "units/dwarves/berserker-defend-2.png" "units/dwarves/berserker-defend-1.png" {SOUND_LIST:DWARF_HIT} }
    [portrait]
        size=400
        side="left"
        mirror="false"
        image="portraits/dwarves/transparent/ulfserker.png"
    [/portrait]
    [portrait]
        size=400
        side="right"
        mirror="true"
        image="portraits/dwarves/transparent/ulfserker.png"
    [/portrait]
    [defense]
        hills=60
        mountains=50
        village=60
        cave=60
        castle=60
    [/defense]
    [attack]
        name=berserker frenzy
        description=_"berserker frenzy"
        icon=attacks/frenzy.png
        type=blade
        [specials]
            {WEAPON_SPECIAL_BERSERK}
        [/specials]
        range=melee
        damage=7
        number=4
    [/attack]
    [idle_anim]
        {STANDARD_IDLE_FILTER}
        start_time=0
        [frame]
            duration=100
            image="units/dwarves/berserker-idle-1.png"
        [/frame]
        [frame]
            duration=100
            image="units/dwarves/berserker-idle-2.png"
        [/frame]
        [frame]
            duration=100
            image="units/dwarves/berserker-idle-3.png"
        [/frame]
        [frame]
            duration=100
            image="units/dwarves/berserker-idle-4.png"
        [/frame]
        [frame]
            duration=600
            image="units/dwarves/berserker-idle-5.png"
        [/frame]
        [frame]
            duration=100
            image="units/dwarves/berserker-idle-6.png"
        [/frame]
        [frame]
            duration=100
            image="units/dwarves/berserker-idle-7.png"
        [/frame]
        [frame]
            duration=100
            image="units/dwarves/berserker-idle-8.png"
        [/frame]
        [frame]
            duration=200
            image="units/dwarves/berserker-idle-9.png"
        [/frame]
        [frame]
            duration=100
            image="units/dwarves/berserker-idle-10.png"
        [/frame]
        [frame]
            duration=300
            image="units/dwarves/berserker-idle-9.png"
        [/frame]
        [frame]
            duration=100
            image="units/dwarves/berserker-idle-10.png"
        [/frame]
        [frame]
            duration=100
            image="units/dwarves/berserker-idle-11.png"
        [/frame]
        [frame]
            duration=400
            image="units/dwarves/berserker-idle-12.png"
        [/frame]
        [frame]
            duration=100
            image="units/dwarves/berserker-idle-11.png"
        [/frame]
        [frame]
            duration=100
            image="units/dwarves/berserker-idle-13.png"
        [/frame]
        [frame]
            duration=500
            image="units/dwarves/berserker-idle-15.png"
        [/frame]
        [frame]
            duration=100
            image="units/dwarves/berserker-idle-14.png"
        [/frame]
        [frame]
            duration=100
            image="units/dwarves/berserker-idle-16.png"
        [/frame]
        [frame]
            duration=100
            image="units/dwarves/berserker-idle-2.png"
        [/frame]
        [frame]
            duration=100
            image="units/dwarves/berserker-idle-1.png"
        [/frame]
    [/idle_anim]
    [attack_anim]
        [filter_attack]
            name=berserker frenzy
        [/filter_attack]

        [if]
            [filter_second_attack]
            [/filter_second_attack]
            value_second=1
            ### all units with any melee attack (because the dwarf's attack is melee) will pass the above filter, and execute this block instead of the following block

            start_time=-240
            offset=0.0~-0.15:20,-0.15~0.1:30,0.1~0.5:190,0.5~0.6:30,0.6~0.6:30,0.6~0.15:100,0.15~0.0:30
        [/if]
        [else]
            ### when a unit with no melee attack is attacked by a berzerk unit, they are highly likely to die.  We play an easter egg when this happens - the zerk looks at the victim for a moment, and then lets out a diabolical laugh.

            start_time=-3640
            offset=0.0~0.0:3400,0.0~-0.15:20,-0.15~0.1:30,0.1~0.5:190,0.5~0.6:30,0.6~0.6:30,0.6~0.15:100,0.15~0.0:30

            value_second=1
            [frame]
                duration=200
                image="units/dwarves/berserker.png"
            [/frame]
            [frame]
                duration=400
                image="units/dwarves/berserker-laugh-1.png"
            [/frame]
            [frame]
                duration=200
                image="units/dwarves/berserker-laugh-2.png"
                sound=dwarf-laugh.wav
            [/frame]
            [frame]
                duration=200
                image="units/dwarves/berserker-laugh-1.png"
            [/frame]
            [frame]
                duration=200
                image="units/dwarves/berserker-laugh-2.png"
            [/frame]
            [frame]
                duration=200
                image="units/dwarves/berserker-laugh-1.png"
            [/frame]
            [frame]
                duration=200
                image="units/dwarves/berserker-laugh-2.png"
            [/frame]
            [frame]
                duration=200
                image="units/dwarves/berserker-laugh-1.png"
            [/frame]
            [frame]
                duration=200
                image="units/dwarves/berserker-laugh-2.png"
            [/frame]
            [frame]
                duration=200
                image="units/dwarves/berserker-laugh-1.png"
            [/frame]
            [frame]
                duration=200
                image="units/dwarves/berserker-laugh-2.png"
            [/frame]
            [frame]
                duration=200
                image="units/dwarves/berserker-laugh-1.png"
            [/frame]
            [frame]
                duration=200
                image="units/dwarves/berserker-laugh-2.png"
            [/frame]
            [frame]
                duration=200
                image="units/dwarves/berserker-laugh-1.png"
            [/frame]
            [frame]
                duration=200
                image="units/dwarves/berserker-laugh-2.png"
            [/frame]
            [frame]
                duration=200
                image="units/dwarves/berserker-laugh-1.png"
            [/frame]
        [/else]
        [else]
            [frame]
                duration=1
                image="units/dwarves/berserker.png"
            [/frame]
        [/else]
        [frame]
            duration=40
            image="units/dwarves/berserker-attack-1.png"
        [/frame]
        [frame]
            duration=50
            image="units/dwarves/berserker-attack-2.png"
        [/frame]
        [frame]
            duration=50
            image="units/dwarves/berserker-attack-3.png"
        [/frame]
        [frame]
            duration=50
            image="units/dwarves/berserker-attack-4.png"
        [/frame]
        [if]
            hits=yes
            [frame]
                duration=50
                image="units/dwarves/berserker-attack-5.png"
                sound=axe.ogg
            [/frame]
        [/if]
        [else]
            hits=no
            [frame]
                duration=50
                image="units/dwarves/berserker-attack-5.png"
                sound={SOUND_LIST:MISS}
            [/frame]
        [/else]
        [frame]
            duration=60
            image="units/dwarves/berserker-attack-6.png"
        [/frame]
        [frame]
            duration=40
            image="units/dwarves/berserker-attack-7.png"
        [/frame]
        [frame]
            duration=30
            image="units/dwarves/berserker-attack-8.png"
        [/frame]
        [frame]
            duration=30
            image="units/dwarves/berserker-attack-1.png"
        [/frame]
        [frame]
            duration=30
            image="units/dwarves/berserker.png"
        [/frame]
    [/attack_anim]
[/unit_type]
