#textdomain wesnoth-anl

#define CONDITION VAR TEST_NAME VALUE
    [variable]
        name={VAR}
        {TEST_NAME}={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
    [sound]
        name={SOUND}
    [/sound]
#enddef

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

#define OPEN_CHEST X Y TREASURE_VALUE
    {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_VALUE}
    [/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_VALUE}}
#enddef

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