#textdomain wesnoth

#define VIMG BASE_STRING NAME_STRING
    [image]
        name={NAME_STRING}
        base={BASE_STRING}
    [/image]

#enddef

# This utility macro disables standard transitions on a given terrain type. It
# is used for castles and keeps, as those have custom transitions.

#define DISABLE_TRANSITIONS TERRAIN_PATTERN
    [terrain_graphics]
        map="
, 1
6,  2
, 7
5,  3
, 4"
        [tile]
            pos=1
            set_flag=overlay-s,transition-s
        [/tile]
        [tile]
            pos=2
            set_flag=overlay-sw,transition-sw
        [/tile]
        [tile]
            pos=3
            set_flag=overlay-nw,transition-nw
        [/tile]
        [tile]
            pos=4
            set_flag=overlay-n,transition-n
        [/tile]
        [tile]
            pos=5
            set_flag=overlay-ne,transition-ne
        [/tile]
        [tile]
            pos=6
            set_flag=overlay-se,transition-se
        [/tile]
        [tile]
            pos=7
            type={TERRAIN_PATTERN}
        [/tile]
    [/terrain_graphics]
#enddef

# This utility macro sets a flag on a given terrain, if it is adjacent to an
# other terrain.
# Example:
# {FLAG_IF_ADJACENT Kud Cud keep-of-castle} flags all Kud tiles
# adjacent to Cud tiles with the keep-of-castle flag
#
# Use this to make other rule depend on adjacent terrain

#define FLAG_IF_ADJACENT TERRAIN ADJACENT FLAG
    [terrain_graphics]
        map="
,  2
.,   .
,  1
.,   .
,  ."
        [tile]
            pos=1
            type={TERRAIN}
            set_flag={FLAG}
            no_flag={FLAG}
        [/tile]
        [tile]
            pos=2
            type={ADJACENT}
        [/tile]
        rotations=n,ne,se,s,sw,nw
    [/terrain_graphics]
#enddef
