#textdomain wesnoth-l

#define SET_VILLAGE X Y SIDE
    [capture_village]
        x={X}
        y={Y}
        side={SIDE}
    [/capture_village]
#enddef

#
# This one changes a unit from one type to another
#

#define CHG_TYPE FILTER VALUE
    [store_unit]
        [filter]
            {FILTER}
        [/filter]

        variable=chgtype_store
        kill=yes
    [/store_unit]

    {FOREACH chgtype_store i}
    [set_variable]
        name=chgtype_store[$i].type
        value={VALUE}
    [/set_variable]

    [unstore_unit]
        variable=chgtype_store[$i]
    [/unstore_unit]
    {NEXT i}

    {CLEAR_VARIABLE chgtype_store}
#enddef

#define CHG_TERRAIN TERRAIN X_SPAN Y_SPAN
    [terrain]
        terrain={TERRAIN}
        x={X_SPAN}
        y={Y_SPAN}
    [/terrain]
#enddef

#define OBJ_HOLY_ANKH X Y ID
    [event]
        name=moveto
        first_time_only=no
        [filter]
            x={X}
            y={Y}
            side=1
        [/filter]
        [object]
            id={ID}
            name= _ "Holy Ankh"
            image=items/ankh-necklace.png
            duration=level
            description= _ "You find a hefty pendant on a strange and ominous looking altar. It glows brightly when you pick it up!"
            cannot_use_message= _ "There is a strange altar here and a pendant on it. I don't want to touch it."
            [filter]
                side=1
                x,y={X},{Y}
            [/filter]
            [then]
                [removeitem]
                    x,y={X},{Y}
                [/removeitem]
            [/then]
            [effect]
                apply_to=new_attack
                name=ankh
                description= _ "holy ankh"
                icon=attacks/lightbeam.png
                type=arcane
                range=ranged
                [specials]
                    {WEAPON_SPECIAL_MAGICAL}
                [/specials]
                damage=24
                number=1
            [/effect]

            [effect]
                apply_to=new_animation
                [attack_anim]
                    [attack_filter]
                        name=ankh
                    [/attack_filter]

                    {MISSILE_FRAME_LIGHT_BEAM}

                    [if]
                        hits=no
                        [frame]
                            begin=-200
                            end=0
                            sound={SOUND_LIST:HOLY_MISS}
                        [/frame]
                    [/if]
                    [else]
                        hits=yes
                        [frame]
                            begin=-200
                            end=0
                            sound={SOUND_LIST:HOLY}
                        [/frame]
                    [/else]
                [/attack_anim]
            [/effect]
        [/object]
    [/event]
#enddef

#define L_DOT X Y
    [image]
        x,y={X},{Y}
        file=misc/dot.png
        delay=500
        centered=yes
    [/image]
#enddef

#define L_CROSS X Y
    [image]
        x,y={X},{Y}
        file=misc/cross.png
        delay=500
        centered=yes
    [/image]
#enddef

#define LIBERTY_DEATHS
    [event]
        name=die
        [filter]
            description=Baldras
        [/filter]
        [message]
            description=Baldras
            message= _ "Tell my wife... that I loved her!"
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]

    [event]
        name=die
        [filter]
            description=Harper
        [/filter]
        [message]
            description=Harper
            message= _ "Unngh... Now our people may never be free..."
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]

    [event]
        name=die
        [filter]
            description=Relnan
        [/filter]
        [message]
            description=Relnan
            message= _ "I am finished... will we ever be free?"
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]

    [event]
        name=die
        [filter]
            description=Lord Maddock
        [/filter]
        [message]
            description=Lord Maddock
            message= _ "How can this be? We have lost."
        [/message]
        [endlevel]
            result=defeat
        [/endlevel]
    [/event]
#enddef
