#textdomain wesnoth-dw
[unit_type]
    id=Merman Brawler
    name= _ "Merman Brawler"
    profile="portraits/brawler.png"
    race=merman
    image="units/merfolk/brawler.png"
    hitpoints=38
    movement_type=swimmer
    movement=6
    level=1
    experience=50
    {AMLA_DEFAULT}
    alignment=lawful
    cost=19
    usage=fighter
    description= _ "Exceptionally large and strong mermen are sometimes more comfortable with their own fists and tails than with other weapons."+{SPECIAL_NOTES}+{SPECIAL_NOTES_STUN}
    die_sound=mermen-die.ogg
    {DEFENSE_ANIM "units/merfolk/brawler-defend.png" "units/merfolk/brawler-defend.png" mermen-hit.wav }
    [attack]
        name=fist-merman
        #textdomain wesnoth-units
        description=_"fist"
        type=impact
        range=melee
        damage=5
        number=4
    [/attack]
    [attack]
        name=tail-merman
        description=_"tail"
        #textdomain wesnoth-dw
        type=impact
        range=melee
        damage=9
        number=2
        [specials]
            {WEAPON_SPECIAL_STUN}
        [/specials]
    [/attack]

    [attack_anim]
        [filter_attack]
            name=fist-merman
        [/filter_attack]
        start_time=-300
        [frame]
            image="units/merfolk/brawler.png:50"
        [/frame]
        [frame]
            image="units/merfolk/brawler-fist-[1~3].png:[200,100*2]"
        [/frame]
        {SOUND:HIT_AND_MISS fist.ogg dagger-swish.wav -50}
        [frame]
            image="units/merfolk/brawler.png:50"
        [/frame]
    [/attack_anim]

    [attack_anim]
        [filter_attack]
            name=tail-merman
        [/filter_attack]
        start_time=-140
        {SOUND:HIT_AND_MISS fist.ogg dagger-swish.wav -50}
        [frame]
            image="units/merfolk/brawler-tail-land-[1,3,5~1].png:[30*2,80,30,80*3]"
        [/frame]
        [frame]
            image="units/merfolk/brawler.png:80"
        [/frame]
    [/attack_anim]

    [event]
        name=attacker_hits
        first_time_only=no

        [filter_attack]
            special=tail_stun
        [/filter_attack]

        [filter_second]
            [not]
                level=0
                [or]
                    status=stunned
                [/or]
            [/not]
        [/filter_second]

        {VARIABLE second_unit.status.stunned yes}

        [unstore_unit]
            variable=second_unit
            find_vacant=no
            male_text= _ "stunned"
            female_text= _ "female^stunned"
            red,green,blue=196,196,128
        [/unstore_unit]

        [object]
            silent=yes
            duration=turn end

            [filter]
                x,y=$x2,$y2
            [/filter]

            [effect]
                apply_to=image_mod
                replace="CS(50,50,0)"
            [/effect]

            [effect]
                apply_to=zoc
                value=no
            [/effect]
        [/object]
    [/event]

    [event]
        name=defender_hits
        first_time_only=no

        [filter_second_attack]
            special=tail_stun
        [/filter_second_attack]

        [filter]
            [not]
                level=0
                [or]
                    status=stunned
                [/or]
            [/not]
        [/filter]

        {VARIABLE unit.status.stunned yes}

        [unstore_unit]
            variable=unit
            find_vacant=no
            male_text= _ "stunned"
            female_text= _ "female^stunned"
            red,green,blue=196,196,128
        [/unstore_unit]

        [object]
            silent=yes
            duration=turn end

            [filter]
                x,y=$x1,$y1
            [/filter]

            [effect]
                apply_to=image_mod
                replace="CS(50,50,0)"
            [/effect]

            [effect]
                apply_to=zoc
                value=no
            [/effect]
        [/object]
    [/event]

    [event]
        name=side turn end
        first_time_only=no

        [store_unit]
            [filter]
                side=$side_number
                status=stunned
            [/filter]
            variable=stunned
        [/store_unit]

        [foreach]
            array=stunned
            [do]
                {CLEAR_VARIABLE this_item.status.stunned}

                [unstore_unit]
                    variable=this_item
                [/unstore_unit]
            [/do]
        [/foreach]

        {CLEAR_VARIABLE stunned}
    [/event]
[/unit_type]
