#textdomain wesnoth-anl

#define CONDITION VAR TEST VALUE
    [variable]
        name={VAR}
        {TEST}={VALUE}
    [/variable]
#enddef

#define ADD_GOLD SIDE AMOUNT
    [gold]
        side={SIDE}
        amount={AMOUNT}
    [/gold]
#enddef

#define ALLOW_RECRUIT SIDE TYPE
    [allow_recruit]
        side={SIDE}
        type={TYPE}
    [/allow_recruit]
#enddef

#define DISALLOW_RECRUIT SIDE TYPE
    [disallow_recruit]
        side={SIDE}
        type={TYPE}
    [/disallow_recruit]
#enddef

#define ANL_CAPTURE_VILLAGE
    [capture_village]
        x=$x1
        y=$y1
        side=$side_number
    [/capture_village]
#enddef

#define REMOVE_ITEM X Y
    [removeitem]
        x={X}
        y={Y}
    [/removeitem]
#enddef

#define PLAY_SOUND SOUND_FILE
    [sound]
        name={SOUND_FILE}
    [/sound]
#enddef

#define DELAY TIME
    [delay]
        time={TIME}
    [/delay]
#enddef

#define OPEN_CHEST X Y TREASURE
    {PLAY_SOUND open-chest.wav}
    [removeitem]
        x={X}
        y={Y}
        image=items/chest-plain-closed.png
    [/removeitem]
    {PLACE_IMAGE items/chest-plain-open.png {X} {Y}}
    [set_variable]
        name=oc_treasure
        value={TREASURE}
    [/set_variable]
    [message]
        speaker=narrator
        image=items/chest-plain-open.png
        message= _ "The chest contains $oc_treasure gold."
    [/message]
    [clear_variable]
        name=oc_treasure
    [/clear_variable]
    {ADD_GOLD $side_number {TREASURE}}
#enddef

#define MOVEMENT_RESTRICTION TERRAIN_1 TERRAIN_2
    [object]
        silent=yes
        duration=forever
        [effect]
            apply_to=movement_costs
            replace=true
            [movement_costs]
                {TERRAIN_1}={UNREACHABLE}
                {TERRAIN_2}={UNREACHABLE}
            [/movement_costs]
        [/effect]
    [/object]
#enddef
