#textdomain wesnoth

#toplevel macros to handle keeps
# keeps are base terrain (use flag base) but at layer -2

###############################
#  No test on neighbour       #
###############################
#define KEEP_BASE_PLFB TERRAIN PROB LAYER FLAG BUILDER IMAGESTEM
    {GENERIC_SINGLE_PLFB ({TERRAIN})  ({PROB}) ({LAYER}) ({FLAG}) ({BUILDER}) ({IMAGESTEM})}
#enddef

#meta-macro KEEP_BASE TERRAINLIST P=PROB=100 L=LAYER=-2 F=FLAG=base B=BUILDER=IMAGE_SINGLE IMAGESTEM

#define KEEP_BASE_RANDOM_LFB TERRAIN LAYER FLAG BUILDER IMAGESTEM
    {GENERIC_SINGLE_RANDOM_LFB ({TERRAIN}) ({LAYER}) ({FLAG}) ({BUILDER}) ({IMAGESTEM})}
#enddef

#meta-macro KEEP_BASE_RANDOM TERRAINLIST L=LAYER=-2 F=FLAG=base B=BUILDER=IMAGE_SINGLE IMAGESTEM

###############################
#  Needs one neighbour        #
###############################

#define KEEP_BASE_RESTRICTED_PLFB TERRAIN ADJACENT PROB LAYER FLAG BUILDER IMAGESTEM
    {GENERIC_RESTRICTED_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) ({LAYER}) ({FLAG}) ({BUILDER}) ({IMAGESTEM}) ()}
#enddef

#meta-macro KEEP_BASE_RESTRICTED TERRAIN ADJACENT P=PROB=100 L=LAYER=-2 F=FLAG=base B=BUILDER=IMAGE_SINGLE IMAGESTEM

#define KEEP_BASE_RESTRICTED_RANDOM_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM
    {GENERIC_RESTRICTED_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) ({LAYER}) ({FLAG}) ({BUILDER}) ({IMAGESTEM}) ()}
#enddef

#meta-macro KEEP_BASE_RESTRICTED_RANDOM TERRAIN ADJACENT L=LAYER=-2 F=FLAG=base B=BUILDER=IMAGE_SINGLE IMAGESTEM

#define KEEP_BASE_ROTATION_RESTRICTED_PLFB TERRAIN ADJACENT PROB LAYER FLAG BUILDER IMAGESTEM
    {GENERIC_RESTRICTED_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) ({LAYER}) ({FLAG}) ({BUILDER}) ({IMAGESTEM}) (-@R0)}
#enddef

#meta-macro KEEP_BASE_ROTATION_RESTRICTED TERRAIN  ADJACENT P=PROB=100 L=LAYER=-2 F=FLAG=base B=BUILDER=IMAGE_SINGLE IMAGESTEM

#define KEEP_BASE_ROTATION_RESTRICTED_RANDOM_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM
    {GENERIC_RESTRICTED_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) ({LAYER}) ({FLAG}) ({BUILDER}) ({IMAGESTEM}) (-@R0)}
#enddef

#meta-macro KEEP_BASE_ROTATION_RESTRICTED_RANDOM TERRAIN ADJACENT L=LAYER=-2 F=FLAG=base B=BUILDER=IMAGE_SINGLE IMAGESTEM

###############################
#  Needs two neighbour        #
###############################

#define KEEP_BASE_RESTRICTED2_PLFB TERRAIN ADJACENT PROB LAYER FLAG BUILDER IMAGESTEM
    {GENERIC_RESTRICTED2_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) ({LAYER}) ({FLAG}) ({BUILDER}) ({IMAGESTEM}) ()}
#enddef

#meta-macro KEEP_BASE_RESTRICTED2 TERRAIN ADJACENT P=PROB=100 L=LAYER=-2 F=FLAG=base B=BUILDER=IMAGE_SINGLE IMAGESTEM

#define KEEP_BASE_RESTRICTED2_RANDOM_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM
    {GENERIC_RESTRICTED2_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) ({LAYER}) ({FLAG}) ({BUILDER}) ({IMAGESTEM}) ()}
#enddef

#meta-macro KEEP_BASE_RESTRICTED2_RANDOM TERRAIN ADJACENT L=LAYER=-2 F=FLAG=base B=BUILDER=IMAGE_SINGLE IMAGESTEM

#define KEEP_BASE_ROTATION_RESTRICTED2_PLFB TERRAIN ADJACENT PROB LAYER FLAG BUILDER IMAGESTEM
    {GENERIC_RESTRICTED2_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) ({LAYER}) ({FLAG}) ({BUILDER}) ({IMAGESTEM}) (-@R0-@R1)}
#enddef

#meta-macro KEEP_BASE_ROTATION_RESTRICTED2 TERRAIN  ADJACENT P=PROB=100 L=LAYER=-2 F=FLAG=base B=BUILDER=IMAGE_SINGLE IMAGESTEM

#define KEEP_BASE_ROTATION_RESTRICTED2_RANDOM_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM
    {GENERIC_RESTRICTED2_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) ({LAYER}) ({FLAG}) ({BUILDER}) ({IMAGESTEM}) (-@R0-@R1)}
#enddef

#meta-macro KEEP_BASE_ROTATION_RESTRICTED2_RANDOM TERRAIN ADJACENT L=LAYER=-2 F=FLAG=base B=BUILDER=IMAGE_SINGLE IMAGESTEM

###############################
#  Needs three neighbour      #
###############################

#define KEEP_BASE_RESTRICTED3_PLFB TERRAIN ADJACENT PROB LAYER FLAG BUILDER IMAGESTEM
    {GENERIC_RESTRICTED3_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) ({LAYER}) ({FLAG}) ({BUILDER}) ({IMAGESTEM}) ()}
#enddef

#meta-macro KEEP_BASE_RESTRICTED3 TERRAIN ADJACENT P=PROB=100 L=LAYER=-2 F=FLAG=base B=BUILDER=IMAGE_SINGLE IMAGESTEM

#define KEEP_BASE_RESTRICTED3_RANDOM_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM
    {GENERIC_RESTRICTED3_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) ({LAYER}) ({FLAG}) ({BUILDER}) ({IMAGESTEM}) ()}
#enddef

#meta-macro KEEP_BASE_RESTRICTED3_RANDOM TERRAIN ADJACENT L=LAYER=-2 F=FLAG=base B=BUILDER=IMAGE_SINGLE IMAGESTEM

#define KEEP_BASE_ROTATION_RESTRICTED3_PLFB TERRAIN ADJACENT PROB LAYER FLAG BUILDER IMAGESTEM
    {GENERIC_RESTRICTED3_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) ({LAYER}) ({FLAG}) ({BUILDER}) ({IMAGESTEM}) (-@R0-@R1-@R2)}
#enddef

#meta-macro KEEP_BASE_ROTATION_RESTRICTED3 TERRAIN  ADJACENT P=PROB=100 L=LAYER=-2 F=FLAG=base B=BUILDER=IMAGE_SINGLE IMAGESTEM

#define KEEP_BASE_ROTATION_RESTRICTED3_RANDOM_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM
    {GENERIC_RESTRICTED3_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) ({LAYER}) ({FLAG}) ({BUILDER}) ({IMAGESTEM}) (-@R0-@R1-@R2)}
#enddef

#meta-macro KEEP_BASE_ROTATION_RESTRICTED3_RANDOM TERRAIN ADJACENT L=LAYER=-2 F=FLAG=base B=BUILDER=IMAGE_SINGLE IMAGESTEM

###############################
#  Combination of the above   #
###############################

#define KEEP_BASE_COMPLETE_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM
    {GENERIC_COMPLETE_LFB ({TERRAIN}) ({ADJACENT}) ({LAYER}) ({FLAG}) ({BUILDER}) ({IMAGESTEM})}
#enddef

#meta-macro KEEP_BASE_COMPLETE TERRAIN ADJACENT L=LAYER=-2 F=FLAG=base B=BUILDER=IMAGE_SINGLE IMAGESTEM

#####################################################################################################
###############        AUTO GENERATED CODE        ###################################################
#####################################################################################################
#The following code is autogenerated by expand-terrain-macros.py
#generated from: #meta-macro KEEP_BASE TERRAINLIST P=PROB=100 L=LAYER=-2 F=FLAG=base B=BUILDER=IMAGE_SINGLE IMAGESTEM
#Please do not modify
#define KEEP_BASE_LFB TERRAINLIST LAYER FLAG BUILDER IMAGESTEM
    {KEEP_BASE_PLFB ({TERRAINLIST}) 100 ({LAYER}) ({FLAG}) ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_PFB TERRAINLIST PROB FLAG BUILDER IMAGESTEM
    {KEEP_BASE_PLFB ({TERRAINLIST}) ({PROB}) -2 ({FLAG}) ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_FB TERRAINLIST FLAG BUILDER IMAGESTEM
    {KEEP_BASE_PLFB ({TERRAINLIST}) 100 -2 ({FLAG}) ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_PLB TERRAINLIST PROB LAYER BUILDER IMAGESTEM
    {KEEP_BASE_PLFB ({TERRAINLIST}) ({PROB}) ({LAYER}) base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_LB TERRAINLIST LAYER BUILDER IMAGESTEM
    {KEEP_BASE_PLFB ({TERRAINLIST}) 100 ({LAYER}) base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_PB TERRAINLIST PROB BUILDER IMAGESTEM
    {KEEP_BASE_PLFB ({TERRAINLIST}) ({PROB}) -2 base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_B TERRAINLIST BUILDER IMAGESTEM
    {KEEP_BASE_PLFB ({TERRAINLIST}) 100 -2 base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_PLF TERRAINLIST PROB LAYER FLAG IMAGESTEM
    {KEEP_BASE_PLFB ({TERRAINLIST}) ({PROB}) ({LAYER}) ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_LF TERRAINLIST LAYER FLAG IMAGESTEM
    {KEEP_BASE_PLFB ({TERRAINLIST}) 100 ({LAYER}) ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_PF TERRAINLIST PROB FLAG IMAGESTEM
    {KEEP_BASE_PLFB ({TERRAINLIST}) ({PROB}) -2 ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_F TERRAINLIST FLAG IMAGESTEM
    {KEEP_BASE_PLFB ({TERRAINLIST}) 100 -2 ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_PL TERRAINLIST PROB LAYER IMAGESTEM
    {KEEP_BASE_PLFB ({TERRAINLIST}) ({PROB}) ({LAYER}) base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_L TERRAINLIST LAYER IMAGESTEM
    {KEEP_BASE_PLFB ({TERRAINLIST}) 100 ({LAYER}) base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_P TERRAINLIST PROB IMAGESTEM
    {KEEP_BASE_PLFB ({TERRAINLIST}) ({PROB}) -2 base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE TERRAINLIST IMAGESTEM
    {KEEP_BASE_PLFB ({TERRAINLIST}) 100 -2 base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#end of generated code
#The following code is autogenerated by expand-terrain-macros.py
#generated from: #meta-macro KEEP_BASE_RANDOM TERRAINLIST L=LAYER=-2 F=FLAG=base B=BUILDER=IMAGE_SINGLE IMAGESTEM
#Please do not modify
#define KEEP_BASE_RANDOM_FB TERRAINLIST FLAG BUILDER IMAGESTEM
    {KEEP_BASE_RANDOM_LFB ({TERRAINLIST}) -2 ({FLAG}) ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RANDOM_LB TERRAINLIST LAYER BUILDER IMAGESTEM
    {KEEP_BASE_RANDOM_LFB ({TERRAINLIST}) ({LAYER}) base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RANDOM_B TERRAINLIST BUILDER IMAGESTEM
    {KEEP_BASE_RANDOM_LFB ({TERRAINLIST}) -2 base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RANDOM_LF TERRAINLIST LAYER FLAG IMAGESTEM
    {KEEP_BASE_RANDOM_LFB ({TERRAINLIST}) ({LAYER}) ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RANDOM_F TERRAINLIST FLAG IMAGESTEM
    {KEEP_BASE_RANDOM_LFB ({TERRAINLIST}) -2 ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RANDOM_L TERRAINLIST LAYER IMAGESTEM
    {KEEP_BASE_RANDOM_LFB ({TERRAINLIST}) ({LAYER}) base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RANDOM TERRAINLIST IMAGESTEM
    {KEEP_BASE_RANDOM_LFB ({TERRAINLIST}) -2 base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#end of generated code
#The following code is autogenerated by expand-terrain-macros.py
#generated from: #meta-macro KEEP_BASE_RESTRICTED TERRAIN ADJACENT P=PROB=100 L=LAYER=-2 F=FLAG=base B=BUILDER=IMAGE_SINGLE IMAGESTEM
#Please do not modify
#define KEEP_BASE_RESTRICTED_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM
    {KEEP_BASE_RESTRICTED_PLFB ({TERRAIN}) ({ADJACENT}) 100 ({LAYER}) ({FLAG}) ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED_PFB TERRAIN ADJACENT PROB FLAG BUILDER IMAGESTEM
    {KEEP_BASE_RESTRICTED_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) -2 ({FLAG}) ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED_FB TERRAIN ADJACENT FLAG BUILDER IMAGESTEM
    {KEEP_BASE_RESTRICTED_PLFB ({TERRAIN}) ({ADJACENT}) 100 -2 ({FLAG}) ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED_PLB TERRAIN ADJACENT PROB LAYER BUILDER IMAGESTEM
    {KEEP_BASE_RESTRICTED_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) ({LAYER}) base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED_LB TERRAIN ADJACENT LAYER BUILDER IMAGESTEM
    {KEEP_BASE_RESTRICTED_PLFB ({TERRAIN}) ({ADJACENT}) 100 ({LAYER}) base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED_PB TERRAIN ADJACENT PROB BUILDER IMAGESTEM
    {KEEP_BASE_RESTRICTED_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) -2 base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED_B TERRAIN ADJACENT BUILDER IMAGESTEM
    {KEEP_BASE_RESTRICTED_PLFB ({TERRAIN}) ({ADJACENT}) 100 -2 base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED_PLF TERRAIN ADJACENT PROB LAYER FLAG IMAGESTEM
    {KEEP_BASE_RESTRICTED_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) ({LAYER}) ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED_LF TERRAIN ADJACENT LAYER FLAG IMAGESTEM
    {KEEP_BASE_RESTRICTED_PLFB ({TERRAIN}) ({ADJACENT}) 100 ({LAYER}) ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED_PF TERRAIN ADJACENT PROB FLAG IMAGESTEM
    {KEEP_BASE_RESTRICTED_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) -2 ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED_F TERRAIN ADJACENT FLAG IMAGESTEM
    {KEEP_BASE_RESTRICTED_PLFB ({TERRAIN}) ({ADJACENT}) 100 -2 ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED_PL TERRAIN ADJACENT PROB LAYER IMAGESTEM
    {KEEP_BASE_RESTRICTED_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) ({LAYER}) base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED_L TERRAIN ADJACENT LAYER IMAGESTEM
    {KEEP_BASE_RESTRICTED_PLFB ({TERRAIN}) ({ADJACENT}) 100 ({LAYER}) base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED_P TERRAIN ADJACENT PROB IMAGESTEM
    {KEEP_BASE_RESTRICTED_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) -2 base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED TERRAIN ADJACENT IMAGESTEM
    {KEEP_BASE_RESTRICTED_PLFB ({TERRAIN}) ({ADJACENT}) 100 -2 base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#end of generated code
#The following code is autogenerated by expand-terrain-macros.py
#generated from: #meta-macro KEEP_BASE_RESTRICTED_RANDOM TERRAIN ADJACENT L=LAYER=-2 F=FLAG=base B=BUILDER=IMAGE_SINGLE IMAGESTEM
#Please do not modify
#define KEEP_BASE_RESTRICTED_RANDOM_FB TERRAIN ADJACENT FLAG BUILDER IMAGESTEM
    {KEEP_BASE_RESTRICTED_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) -2 ({FLAG}) ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED_RANDOM_LB TERRAIN ADJACENT LAYER BUILDER IMAGESTEM
    {KEEP_BASE_RESTRICTED_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) ({LAYER}) base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED_RANDOM_B TERRAIN ADJACENT BUILDER IMAGESTEM
    {KEEP_BASE_RESTRICTED_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) -2 base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED_RANDOM_LF TERRAIN ADJACENT LAYER FLAG IMAGESTEM
    {KEEP_BASE_RESTRICTED_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) ({LAYER}) ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED_RANDOM_F TERRAIN ADJACENT FLAG IMAGESTEM
    {KEEP_BASE_RESTRICTED_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) -2 ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED_RANDOM_L TERRAIN ADJACENT LAYER IMAGESTEM
    {KEEP_BASE_RESTRICTED_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) ({LAYER}) base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED_RANDOM TERRAIN ADJACENT IMAGESTEM
    {KEEP_BASE_RESTRICTED_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) -2 base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#end of generated code
#The following code is autogenerated by expand-terrain-macros.py
#generated from: #meta-macro KEEP_BASE_ROTATION_RESTRICTED TERRAIN  ADJACENT P=PROB=100 L=LAYER=-2 F=FLAG=base B=BUILDER=IMAGE_SINGLE IMAGESTEM
#Please do not modify
#define KEEP_BASE_ROTATION_RESTRICTED_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED_PLFB ({TERRAIN}) ({ADJACENT}) 100 ({LAYER}) ({FLAG}) ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED_PFB TERRAIN ADJACENT PROB FLAG BUILDER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) -2 ({FLAG}) ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED_FB TERRAIN ADJACENT FLAG BUILDER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED_PLFB ({TERRAIN}) ({ADJACENT}) 100 -2 ({FLAG}) ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED_PLB TERRAIN ADJACENT PROB LAYER BUILDER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) ({LAYER}) base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED_LB TERRAIN ADJACENT LAYER BUILDER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED_PLFB ({TERRAIN}) ({ADJACENT}) 100 ({LAYER}) base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED_PB TERRAIN ADJACENT PROB BUILDER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) -2 base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED_B TERRAIN ADJACENT BUILDER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED_PLFB ({TERRAIN}) ({ADJACENT}) 100 -2 base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED_PLF TERRAIN ADJACENT PROB LAYER FLAG IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) ({LAYER}) ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED_LF TERRAIN ADJACENT LAYER FLAG IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED_PLFB ({TERRAIN}) ({ADJACENT}) 100 ({LAYER}) ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED_PF TERRAIN ADJACENT PROB FLAG IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) -2 ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED_F TERRAIN ADJACENT FLAG IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED_PLFB ({TERRAIN}) ({ADJACENT}) 100 -2 ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED_PL TERRAIN ADJACENT PROB LAYER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) ({LAYER}) base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED_L TERRAIN ADJACENT LAYER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED_PLFB ({TERRAIN}) ({ADJACENT}) 100 ({LAYER}) base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED_P TERRAIN ADJACENT PROB IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) -2 base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED TERRAIN ADJACENT IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED_PLFB ({TERRAIN}) ({ADJACENT}) 100 -2 base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#end of generated code
#The following code is autogenerated by expand-terrain-macros.py
#generated from: #meta-macro KEEP_BASE_ROTATION_RESTRICTED_RANDOM TERRAIN ADJACENT L=LAYER=-2 F=FLAG=base B=BUILDER=IMAGE_SINGLE IMAGESTEM
#Please do not modify
#define KEEP_BASE_ROTATION_RESTRICTED_RANDOM_FB TERRAIN ADJACENT FLAG BUILDER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) -2 ({FLAG}) ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED_RANDOM_LB TERRAIN ADJACENT LAYER BUILDER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) ({LAYER}) base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED_RANDOM_B TERRAIN ADJACENT BUILDER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) -2 base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED_RANDOM_LF TERRAIN ADJACENT LAYER FLAG IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) ({LAYER}) ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED_RANDOM_F TERRAIN ADJACENT FLAG IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) -2 ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED_RANDOM_L TERRAIN ADJACENT LAYER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) ({LAYER}) base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED_RANDOM TERRAIN ADJACENT IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) -2 base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#end of generated code
#The following code is autogenerated by expand-terrain-macros.py
#generated from: #meta-macro KEEP_BASE_RESTRICTED2 TERRAIN ADJACENT P=PROB=100 L=LAYER=-2 F=FLAG=base B=BUILDER=IMAGE_SINGLE IMAGESTEM
#Please do not modify
#define KEEP_BASE_RESTRICTED2_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM
    {KEEP_BASE_RESTRICTED2_PLFB ({TERRAIN}) ({ADJACENT}) 100 ({LAYER}) ({FLAG}) ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED2_PFB TERRAIN ADJACENT PROB FLAG BUILDER IMAGESTEM
    {KEEP_BASE_RESTRICTED2_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) -2 ({FLAG}) ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED2_FB TERRAIN ADJACENT FLAG BUILDER IMAGESTEM
    {KEEP_BASE_RESTRICTED2_PLFB ({TERRAIN}) ({ADJACENT}) 100 -2 ({FLAG}) ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED2_PLB TERRAIN ADJACENT PROB LAYER BUILDER IMAGESTEM
    {KEEP_BASE_RESTRICTED2_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) ({LAYER}) base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED2_LB TERRAIN ADJACENT LAYER BUILDER IMAGESTEM
    {KEEP_BASE_RESTRICTED2_PLFB ({TERRAIN}) ({ADJACENT}) 100 ({LAYER}) base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED2_PB TERRAIN ADJACENT PROB BUILDER IMAGESTEM
    {KEEP_BASE_RESTRICTED2_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) -2 base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED2_B TERRAIN ADJACENT BUILDER IMAGESTEM
    {KEEP_BASE_RESTRICTED2_PLFB ({TERRAIN}) ({ADJACENT}) 100 -2 base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED2_PLF TERRAIN ADJACENT PROB LAYER FLAG IMAGESTEM
    {KEEP_BASE_RESTRICTED2_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) ({LAYER}) ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED2_LF TERRAIN ADJACENT LAYER FLAG IMAGESTEM
    {KEEP_BASE_RESTRICTED2_PLFB ({TERRAIN}) ({ADJACENT}) 100 ({LAYER}) ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED2_PF TERRAIN ADJACENT PROB FLAG IMAGESTEM
    {KEEP_BASE_RESTRICTED2_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) -2 ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED2_F TERRAIN ADJACENT FLAG IMAGESTEM
    {KEEP_BASE_RESTRICTED2_PLFB ({TERRAIN}) ({ADJACENT}) 100 -2 ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED2_PL TERRAIN ADJACENT PROB LAYER IMAGESTEM
    {KEEP_BASE_RESTRICTED2_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) ({LAYER}) base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED2_L TERRAIN ADJACENT LAYER IMAGESTEM
    {KEEP_BASE_RESTRICTED2_PLFB ({TERRAIN}) ({ADJACENT}) 100 ({LAYER}) base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED2_P TERRAIN ADJACENT PROB IMAGESTEM
    {KEEP_BASE_RESTRICTED2_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) -2 base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED2 TERRAIN ADJACENT IMAGESTEM
    {KEEP_BASE_RESTRICTED2_PLFB ({TERRAIN}) ({ADJACENT}) 100 -2 base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#end of generated code
#The following code is autogenerated by expand-terrain-macros.py
#generated from: #meta-macro KEEP_BASE_RESTRICTED2_RANDOM TERRAIN ADJACENT L=LAYER=-2 F=FLAG=base B=BUILDER=IMAGE_SINGLE IMAGESTEM
#Please do not modify
#define KEEP_BASE_RESTRICTED2_RANDOM_FB TERRAIN ADJACENT FLAG BUILDER IMAGESTEM
    {KEEP_BASE_RESTRICTED2_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) -2 ({FLAG}) ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED2_RANDOM_LB TERRAIN ADJACENT LAYER BUILDER IMAGESTEM
    {KEEP_BASE_RESTRICTED2_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) ({LAYER}) base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED2_RANDOM_B TERRAIN ADJACENT BUILDER IMAGESTEM
    {KEEP_BASE_RESTRICTED2_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) -2 base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED2_RANDOM_LF TERRAIN ADJACENT LAYER FLAG IMAGESTEM
    {KEEP_BASE_RESTRICTED2_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) ({LAYER}) ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED2_RANDOM_F TERRAIN ADJACENT FLAG IMAGESTEM
    {KEEP_BASE_RESTRICTED2_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) -2 ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED2_RANDOM_L TERRAIN ADJACENT LAYER IMAGESTEM
    {KEEP_BASE_RESTRICTED2_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) ({LAYER}) base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED2_RANDOM TERRAIN ADJACENT IMAGESTEM
    {KEEP_BASE_RESTRICTED2_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) -2 base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#end of generated code
#The following code is autogenerated by expand-terrain-macros.py
#generated from: #meta-macro KEEP_BASE_ROTATION_RESTRICTED2 TERRAIN  ADJACENT P=PROB=100 L=LAYER=-2 F=FLAG=base B=BUILDER=IMAGE_SINGLE IMAGESTEM
#Please do not modify
#define KEEP_BASE_ROTATION_RESTRICTED2_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED2_PLFB ({TERRAIN}) ({ADJACENT}) 100 ({LAYER}) ({FLAG}) ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED2_PFB TERRAIN ADJACENT PROB FLAG BUILDER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED2_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) -2 ({FLAG}) ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED2_FB TERRAIN ADJACENT FLAG BUILDER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED2_PLFB ({TERRAIN}) ({ADJACENT}) 100 -2 ({FLAG}) ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED2_PLB TERRAIN ADJACENT PROB LAYER BUILDER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED2_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) ({LAYER}) base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED2_LB TERRAIN ADJACENT LAYER BUILDER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED2_PLFB ({TERRAIN}) ({ADJACENT}) 100 ({LAYER}) base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED2_PB TERRAIN ADJACENT PROB BUILDER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED2_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) -2 base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED2_B TERRAIN ADJACENT BUILDER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED2_PLFB ({TERRAIN}) ({ADJACENT}) 100 -2 base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED2_PLF TERRAIN ADJACENT PROB LAYER FLAG IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED2_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) ({LAYER}) ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED2_LF TERRAIN ADJACENT LAYER FLAG IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED2_PLFB ({TERRAIN}) ({ADJACENT}) 100 ({LAYER}) ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED2_PF TERRAIN ADJACENT PROB FLAG IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED2_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) -2 ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED2_F TERRAIN ADJACENT FLAG IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED2_PLFB ({TERRAIN}) ({ADJACENT}) 100 -2 ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED2_PL TERRAIN ADJACENT PROB LAYER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED2_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) ({LAYER}) base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED2_L TERRAIN ADJACENT LAYER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED2_PLFB ({TERRAIN}) ({ADJACENT}) 100 ({LAYER}) base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED2_P TERRAIN ADJACENT PROB IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED2_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) -2 base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED2 TERRAIN ADJACENT IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED2_PLFB ({TERRAIN}) ({ADJACENT}) 100 -2 base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#end of generated code
#The following code is autogenerated by expand-terrain-macros.py
#generated from: #meta-macro KEEP_BASE_ROTATION_RESTRICTED2_RANDOM TERRAIN ADJACENT L=LAYER=-2 F=FLAG=base B=BUILDER=IMAGE_SINGLE IMAGESTEM
#Please do not modify
#define KEEP_BASE_ROTATION_RESTRICTED2_RANDOM_FB TERRAIN ADJACENT FLAG BUILDER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED2_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) -2 ({FLAG}) ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED2_RANDOM_LB TERRAIN ADJACENT LAYER BUILDER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED2_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) ({LAYER}) base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED2_RANDOM_B TERRAIN ADJACENT BUILDER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED2_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) -2 base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED2_RANDOM_LF TERRAIN ADJACENT LAYER FLAG IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED2_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) ({LAYER}) ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED2_RANDOM_F TERRAIN ADJACENT FLAG IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED2_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) -2 ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED2_RANDOM_L TERRAIN ADJACENT LAYER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED2_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) ({LAYER}) base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED2_RANDOM TERRAIN ADJACENT IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED2_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) -2 base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#end of generated code
#The following code is autogenerated by expand-terrain-macros.py
#generated from: #meta-macro KEEP_BASE_RESTRICTED3 TERRAIN ADJACENT P=PROB=100 L=LAYER=-2 F=FLAG=base B=BUILDER=IMAGE_SINGLE IMAGESTEM
#Please do not modify
#define KEEP_BASE_RESTRICTED3_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM
    {KEEP_BASE_RESTRICTED3_PLFB ({TERRAIN}) ({ADJACENT}) 100 ({LAYER}) ({FLAG}) ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED3_PFB TERRAIN ADJACENT PROB FLAG BUILDER IMAGESTEM
    {KEEP_BASE_RESTRICTED3_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) -2 ({FLAG}) ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED3_FB TERRAIN ADJACENT FLAG BUILDER IMAGESTEM
    {KEEP_BASE_RESTRICTED3_PLFB ({TERRAIN}) ({ADJACENT}) 100 -2 ({FLAG}) ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED3_PLB TERRAIN ADJACENT PROB LAYER BUILDER IMAGESTEM
    {KEEP_BASE_RESTRICTED3_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) ({LAYER}) base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED3_LB TERRAIN ADJACENT LAYER BUILDER IMAGESTEM
    {KEEP_BASE_RESTRICTED3_PLFB ({TERRAIN}) ({ADJACENT}) 100 ({LAYER}) base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED3_PB TERRAIN ADJACENT PROB BUILDER IMAGESTEM
    {KEEP_BASE_RESTRICTED3_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) -2 base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED3_B TERRAIN ADJACENT BUILDER IMAGESTEM
    {KEEP_BASE_RESTRICTED3_PLFB ({TERRAIN}) ({ADJACENT}) 100 -2 base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED3_PLF TERRAIN ADJACENT PROB LAYER FLAG IMAGESTEM
    {KEEP_BASE_RESTRICTED3_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) ({LAYER}) ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED3_LF TERRAIN ADJACENT LAYER FLAG IMAGESTEM
    {KEEP_BASE_RESTRICTED3_PLFB ({TERRAIN}) ({ADJACENT}) 100 ({LAYER}) ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED3_PF TERRAIN ADJACENT PROB FLAG IMAGESTEM
    {KEEP_BASE_RESTRICTED3_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) -2 ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED3_F TERRAIN ADJACENT FLAG IMAGESTEM
    {KEEP_BASE_RESTRICTED3_PLFB ({TERRAIN}) ({ADJACENT}) 100 -2 ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED3_PL TERRAIN ADJACENT PROB LAYER IMAGESTEM
    {KEEP_BASE_RESTRICTED3_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) ({LAYER}) base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED3_L TERRAIN ADJACENT LAYER IMAGESTEM
    {KEEP_BASE_RESTRICTED3_PLFB ({TERRAIN}) ({ADJACENT}) 100 ({LAYER}) base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED3_P TERRAIN ADJACENT PROB IMAGESTEM
    {KEEP_BASE_RESTRICTED3_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) -2 base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED3 TERRAIN ADJACENT IMAGESTEM
    {KEEP_BASE_RESTRICTED3_PLFB ({TERRAIN}) ({ADJACENT}) 100 -2 base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#end of generated code
#The following code is autogenerated by expand-terrain-macros.py
#generated from: #meta-macro KEEP_BASE_RESTRICTED3_RANDOM TERRAIN ADJACENT L=LAYER=-2 F=FLAG=base B=BUILDER=IMAGE_SINGLE IMAGESTEM
#Please do not modify
#define KEEP_BASE_RESTRICTED3_RANDOM_FB TERRAIN ADJACENT FLAG BUILDER IMAGESTEM
    {KEEP_BASE_RESTRICTED3_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) -2 ({FLAG}) ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED3_RANDOM_LB TERRAIN ADJACENT LAYER BUILDER IMAGESTEM
    {KEEP_BASE_RESTRICTED3_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) ({LAYER}) base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED3_RANDOM_B TERRAIN ADJACENT BUILDER IMAGESTEM
    {KEEP_BASE_RESTRICTED3_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) -2 base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED3_RANDOM_LF TERRAIN ADJACENT LAYER FLAG IMAGESTEM
    {KEEP_BASE_RESTRICTED3_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) ({LAYER}) ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED3_RANDOM_F TERRAIN ADJACENT FLAG IMAGESTEM
    {KEEP_BASE_RESTRICTED3_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) -2 ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED3_RANDOM_L TERRAIN ADJACENT LAYER IMAGESTEM
    {KEEP_BASE_RESTRICTED3_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) ({LAYER}) base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_RESTRICTED3_RANDOM TERRAIN ADJACENT IMAGESTEM
    {KEEP_BASE_RESTRICTED3_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) -2 base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#end of generated code
#The following code is autogenerated by expand-terrain-macros.py
#generated from: #meta-macro KEEP_BASE_ROTATION_RESTRICTED3 TERRAIN  ADJACENT P=PROB=100 L=LAYER=-2 F=FLAG=base B=BUILDER=IMAGE_SINGLE IMAGESTEM
#Please do not modify
#define KEEP_BASE_ROTATION_RESTRICTED3_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED3_PLFB ({TERRAIN}) ({ADJACENT}) 100 ({LAYER}) ({FLAG}) ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED3_PFB TERRAIN ADJACENT PROB FLAG BUILDER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED3_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) -2 ({FLAG}) ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED3_FB TERRAIN ADJACENT FLAG BUILDER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED3_PLFB ({TERRAIN}) ({ADJACENT}) 100 -2 ({FLAG}) ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED3_PLB TERRAIN ADJACENT PROB LAYER BUILDER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED3_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) ({LAYER}) base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED3_LB TERRAIN ADJACENT LAYER BUILDER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED3_PLFB ({TERRAIN}) ({ADJACENT}) 100 ({LAYER}) base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED3_PB TERRAIN ADJACENT PROB BUILDER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED3_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) -2 base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED3_B TERRAIN ADJACENT BUILDER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED3_PLFB ({TERRAIN}) ({ADJACENT}) 100 -2 base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED3_PLF TERRAIN ADJACENT PROB LAYER FLAG IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED3_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) ({LAYER}) ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED3_LF TERRAIN ADJACENT LAYER FLAG IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED3_PLFB ({TERRAIN}) ({ADJACENT}) 100 ({LAYER}) ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED3_PF TERRAIN ADJACENT PROB FLAG IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED3_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) -2 ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED3_F TERRAIN ADJACENT FLAG IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED3_PLFB ({TERRAIN}) ({ADJACENT}) 100 -2 ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED3_PL TERRAIN ADJACENT PROB LAYER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED3_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) ({LAYER}) base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED3_L TERRAIN ADJACENT LAYER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED3_PLFB ({TERRAIN}) ({ADJACENT}) 100 ({LAYER}) base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED3_P TERRAIN ADJACENT PROB IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED3_PLFB ({TERRAIN}) ({ADJACENT}) ({PROB}) -2 base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED3 TERRAIN ADJACENT IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED3_PLFB ({TERRAIN}) ({ADJACENT}) 100 -2 base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#end of generated code
#The following code is autogenerated by expand-terrain-macros.py
#generated from: #meta-macro KEEP_BASE_ROTATION_RESTRICTED3_RANDOM TERRAIN ADJACENT L=LAYER=-2 F=FLAG=base B=BUILDER=IMAGE_SINGLE IMAGESTEM
#Please do not modify
#define KEEP_BASE_ROTATION_RESTRICTED3_RANDOM_FB TERRAIN ADJACENT FLAG BUILDER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED3_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) -2 ({FLAG}) ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED3_RANDOM_LB TERRAIN ADJACENT LAYER BUILDER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED3_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) ({LAYER}) base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED3_RANDOM_B TERRAIN ADJACENT BUILDER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED3_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) -2 base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED3_RANDOM_LF TERRAIN ADJACENT LAYER FLAG IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED3_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) ({LAYER}) ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED3_RANDOM_F TERRAIN ADJACENT FLAG IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED3_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) -2 ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED3_RANDOM_L TERRAIN ADJACENT LAYER IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED3_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) ({LAYER}) base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_ROTATION_RESTRICTED3_RANDOM TERRAIN ADJACENT IMAGESTEM
    {KEEP_BASE_ROTATION_RESTRICTED3_RANDOM_LFB ({TERRAIN}) ({ADJACENT}) -2 base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#end of generated code
#The following code is autogenerated by expand-terrain-macros.py
#generated from: #meta-macro KEEP_BASE_COMPLETE TERRAIN ADJACENT L=LAYER=-2 F=FLAG=base B=BUILDER=IMAGE_SINGLE IMAGESTEM
#Please do not modify
#define KEEP_BASE_COMPLETE_FB TERRAIN ADJACENT FLAG BUILDER IMAGESTEM
    {KEEP_BASE_COMPLETE_LFB ({TERRAIN}) ({ADJACENT}) -2 ({FLAG}) ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_COMPLETE_LB TERRAIN ADJACENT LAYER BUILDER IMAGESTEM
    {KEEP_BASE_COMPLETE_LFB ({TERRAIN}) ({ADJACENT}) ({LAYER}) base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_COMPLETE_B TERRAIN ADJACENT BUILDER IMAGESTEM
    {KEEP_BASE_COMPLETE_LFB ({TERRAIN}) ({ADJACENT}) -2 base ({BUILDER}) ({IMAGESTEM})}
#enddef
#define KEEP_BASE_COMPLETE_LF TERRAIN ADJACENT LAYER FLAG IMAGESTEM
    {KEEP_BASE_COMPLETE_LFB ({TERRAIN}) ({ADJACENT}) ({LAYER}) ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_COMPLETE_F TERRAIN ADJACENT FLAG IMAGESTEM
    {KEEP_BASE_COMPLETE_LFB ({TERRAIN}) ({ADJACENT}) -2 ({FLAG}) IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_COMPLETE_L TERRAIN ADJACENT LAYER IMAGESTEM
    {KEEP_BASE_COMPLETE_LFB ({TERRAIN}) ({ADJACENT}) ({LAYER}) base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#define KEEP_BASE_COMPLETE TERRAIN ADJACENT IMAGESTEM
    {KEEP_BASE_COMPLETE_LFB ({TERRAIN}) ({ADJACENT}) -2 base IMAGE_SINGLE ({IMAGESTEM})}
#enddef
#end of generated code
