#textdomain wesnoth-utbs
# add the events for Kaleh abilities

# the stun attack
[event]
    name=attacker_hits
    first_time_only=no
    [filter_attack]
        special=stun
    [/filter_attack]
    [filter_second]
        [not]
            level=0
        [/not]
        [not]
            role="zoc_off"
        [/not]
    [/filter_second]
    {VARIABLE second_unit.role "zoc_off"}
    [unstore_unit]
        variable=second_unit
        text=_ "stunned"	# wmllint: ignore
        red,green,blue=150,120,250
    [/unstore_unit]
    [object]
        silent=yes
        [filter]
            x,y=$x2,$y2
        [/filter]
        [effect]
            apply_to=zoc
            value=0
        [/effect]
    [/object]
[/event]
[event]
    name=new turn
    first_time_only=no
    [store_unit]
        variable=zoc_unit
        kill=no
        [filter]
            role="zoc_off"
        [/filter]
    [/store_unit]
    {FOREACH zoc_unit i}
        {VARIABLE zoc_unit[$i].role ""}
        [unstore_unit]
            variable=zoc_unit[$i]
        [/unstore_unit]
        [object]
            silent=yes
            [filter]
                x=$zoc_unit[$i].x
                y=$zoc_unit[$i].y
            [/filter]
            [effect]
                apply_to=zoc
                value=1
            [/effect]
        [/object]
    {NEXT i}
[/event]
