#textdomain wesnoth
# Utility macros for scenario-objective control.

# These macros don't depend on any others.  Please don't change this.
# ! in comments is used in generating HTML documentation, ignore it otherwise.

# Max number of turns in a scenario, mainly for use as a turn upper bound
# in ai declarations for aggression, etc.
#define FOREVER
999 #enddef

# The effectively infinite radius.
#define INFINITY
999 #enddef

# Everywhere on the map.  For filters that would otherwise touch recall lists.
#define EVERYWHERE
x,y=1-999,1-999 #enddef

#define NO_MAP_DATA
    # The display code in the game becomes confused if you give it a
    # scenario with no map data (like, a text epilog).  Use this
    # macro to feed it dummy map data that won't actually be used.
    map_data="usage=map
border_size=1

Gg          , Gg          , Gg          , Gg
Gg          , 1 Gg        , 2 Gg        , Gg
Gg          , Gg          , Gg          , Gg
"
#enddef

#define AI_CANT_PLAY SIDES
    # Displays a standard warning at the start of the first AI turn for each
    # given side about the AI not knowing how to play this side properly. Use
    # this to tag sides intended solely for human players in special multiplayer
    # scenarios (ones with shops, custom right-click options and such).
    #
    # Example:
    # ! {AI_CANT_PLAY 1,2,3,4}
    [event]
        name=ai turn
        first_time_only=no

        [if]
            [have_unit]
                side=$side_number

                [and]
                    side={SIDES}
                [/and]
            [/have_unit]

            [variable]
                name=side_$side_number|_ai_warning_displayed
                not_equals=yes
            [/variable]

            [then]
                [message]
                    speaker=narrator
                    message= _ "The computer player might not be able to play side $side_number properly in this scenario. Side $side_number is intended to be played by a human player."
                    image=wesnoth-icon.png
                [/message]

                [set_variable]
                    name=side_$side_number|_ai_warning_displayed
                    value=yes
                [/set_variable]
            [/then]
        [/if]
    [/event]
#enddef
