#textdomain wesnoth
# This file needs to be processed *after* all others in this directory
#
# The following flags are defined to have a meaning
#
# * base : the corresponding tile has already graphics for the terrain
# base. No other one should be added.
# * transition-$direction : the corresponding tile already has the transition
# in the given direction (or should not have one). No other one should be
# added.
# * keep-of-$castle : castle being a tile code. The corresponding tile is the
# keep corresponding to the given castle tile
#
# when adding new probabilities update the commented line
# the proper way to calculate the propabilities is described here
# http://www.wesnoth.org/wiki/TerrainGraphicsTutorial#Cumulative_Probabilities

# NOTE the terrain _off^_usr gets its definition from the code since it's
# themable

#-----------------------------------------------------------------
# forest/pine<->Castle|Encampment special cases, also used by some other
# terrain
# Macros moved to terrain-graphics/forestcastle.cfg
#-----------------------------------------------------------------

{FORESTADJCASTLEA *^Fp  (C*,K*,Xu,Ql,Qxu,Gv*) 100 forest/pine-castle}
{FORESTADJCASTLEA *^Fpa (C*,K*,Xu,Ql,Qxu,Gv*) 100 snow-forest-castle}
{FORESTADJCASTLEA *^Ft  (C*,K*,Xu,Ql,Qxu,Gv*) 100 forest/tropical-castle}
{FORESTADJCASTLEA *^Uf  (C*,K*,Xu,Ql,Qxu,Gv*) 100 mushrooms-castle}

{FORESTADJCASTLES *^Fp  (C*,K*,Xu,Ql,Qxu,Gv*) 100 forest/pine-castle}
{FORESTADJCASTLES *^Fpa (C*,K*,Xu,Ql,Qxu,Gv*) 100 snow-forest-castle}
{FORESTADJCASTLES *^Ft  (C*,K*,Xu,Ql,Qxu,Gv*) 100 forest/tropical-castle}
{FORESTADJCASTLES *^Uf  (C*,K*,Xu,Ql,Qxu,Gv*) 100 mushrooms-castle}

{FORESTADJCASTLEO *^Fp  (C*,K*,Xu,Ql,Qxu,Gv*) 100 forest/pine-castle}
{FORESTADJCASTLEO *^Fpa (C*,K*,Xu,Ql,Qxu,Gv*) 100 snow-forest-castle}
{FORESTADJCASTLEO *^Ft  (C*,K*,Xu,Ql,Qxu,Gv*) 100 forest/tropical-castle}
{FORESTADJCASTLEO *^Uf  (C*,K*,Xu,Ql,Qxu,Gv*) 100 mushrooms-castle}

{FORESTADJCASTLE  *^Fp  (C*,K*,Xu,Ql,Qxu,Gv*) 100 forest/pine-castle}
{FORESTADJCASTLE  *^Fpa (C*,K*,Xu,Ql,Qxu,Gv*) 100 snow-forest-castle}
{FORESTADJCASTLE  *^Ft  (C*,K*,Xu,Ql,Qxu,Gv*) 100 forest/tropical-castle}
{FORESTADJCASTLE  *^Uf  (C*,K*,Xu,Ql,Qxu,Gv*) 100 mushrooms-castle}

{FORESTADJCASTLES   Mm (C*,K*,Xu,Ql,Qx*)      100 mountains-castle-n}
{FORESTADJCASTLEO   Mm (C*,K*,Xu,Ql,Qx*)      100 mountains-castle-n}
{MOUNTAINADJCASTLEA Mm (C*,K*,Xu,Ql,Qx*)      100 mountains-castle}
{FORESTADJCASTLE    Mm (C*,K*,Xu,Ql,Qx*)      100 mountains-castle}

#33% 17% 5% 45%
{FORESTADJ *^Fp  (W*,M*,Hd,*^V*,Xu,Ql,Qxu,Gv*) 33  forest/pine_small}
{FORESTADJ *^Fp  (W*,M*,Hd,*^V*,Xu,Ql,Qxu,Gv*) 25  forest/pine3}
{FORESTADJ *^Fp  (W*,M*,Hd,*^V*,Xu,Ql,Qxu,Gv*) 10  forest/pine4}
{FORESTADJ *^Fp  (W*,M*,Hd,*^V*,Xu,Ql,Qxu,Gv*) 100 forest/pine2_small}

{FORESTADJ *^Fpa (W*,M*,Hd,*^V*) 100 snow-forest_small}

{FORESTADJ *^Uf  (W*,M*,Hd,*^V*) 100 mushrooms-castle}

#define SWAMPADJSINGLE FID ID NID PROB TILE
    [terrain_graphics]
        map="
, 1
3 , 3
, 2
3 , 3
, 3"

        [tile]
            pos=1
            type={ID}
        [/tile]

        [tile]
            pos=2
            type={FID}
            no_flag="overlay"
            set_flag="overlay"
        [/tile]

        [tile]
            pos=3
            type={NID}
        [/tile]

        probability={PROB}
        rotations=n,ne,se,s,sw,nw

        [image]
            name={TILE}-@R0
            base=90,144
        [/image]
    [/terrain_graphics]
#enddef

# Bridges don't currently work right over swamp.  For some reason the reeds are not displayed.  The bridge macro used to be much further down in the code, but i moved it up here to get the bridges to display � eleazar
{BRIDGE *^Bw\ *^Bw| *^Bw/  (W*^,Ss^) (C*,K*,*^F*)   bridge}

# Chasm bridges -  for now they don't tile

{TERRAIN_BASE_FL   Qxu^Bs\ cave/chasm-stone-bridge-se-nw bridge 1}
{TERRAIN_BASE_FL   Qxu^Bs| cave/chasm-stone-bridge-s-n bridge 1}
{TERRAIN_BASE_FL   Qxu^Bs/ cave/chasm-stone-bridge-sw-ne bridge 1}

{TERRAIN_ADJACENT             0  Qxu^Bs\        (!,Qxu)                 cave/chasm-stone-bridge-se-nw}
{TERRAIN_ADJACENT             0  Qxu^Bs|        (!,Qxu)                 cave/chasm-stone-bridge-s-n}
{TERRAIN_ADJACENT             0  Qxu^Bs/        (!,Qxu)                 cave/chasm-stone-bridge-sw-ne}

{TERRAIN_BASE_FL   Ql^Bs\ cave/chasm-lava-stone-bridge-se-nw bridge 1}
{TERRAIN_BASE_FL   Ql^Bs| cave/chasm-lava-stone-bridge-s-n bridge 1}
{TERRAIN_BASE_FL   Ql^Bs/ cave/chasm-lava-stone-bridge-sw-ne bridge 1}

{TERRAIN_ADJACENT             0  Ql^Bs\        (!,Ql)                 cave/chasm-lava-stone-bridge-se-nw}
{TERRAIN_ADJACENT             0  Ql^Bs|        (!,Ql)                 cave/chasm-lava-stone-bridge-s-n}
{TERRAIN_ADJACENT             0  Ql^Bs/        (!,Ql)                 cave/chasm-lava-stone-bridge-sw-ne}


{SWAMPADJSINGLE Ss   (C*,K*,H*,M*,X*,Q*,A*) (!,C*,K*,H*,M*,X*,Q*,A*) 100     swamp/reed-castle}
{SWAMPADJSINGLE Chs  (!,Ch*)                 Chs                       100     swamp/reed-castle}

{FORESTADJ Ss        (C*,K*,H*,M*,X*,Q*,A*)                    8     swamp/reed1-small}
{FORESTADJ Ss        (C*,K*,H*,M*,X*,Q*,A*)                   13     swamp/reed2-small}
{FORESTADJ Ss        (C*,K*,H*,M*,X*,Q*,A*)                   21     swamp/reed3-small}
{FORESTADJ Ss        (C*,K*,H*,M*,X*,Q*,A*)                  100     swamp/reed4-small}
{FORESTADJ Chs       (!,Ch*)                          8     swamp/reed1-small}
{FORESTADJ Chs       (!,Ch*)                         13     swamp/reed2-small}
{FORESTADJ Chs       (!,Ch*)                         21     swamp/reed3-small}
{FORESTADJ Chs       (!,Ch*)                        100     swamp/reed4-small}

# Mountains
# macros found in terrain-graphics/mountains.cfg

#TWOBYFOUR TYPE NAME1 NAME2 NAME3 NAME4 NAME5 FLAG PROB
{TWOBYFOUR   Mm   mountain_range3_1 mountain_range3_2 mountain_range3_3 mountain_range3_4 mountain_range3_5 overlay 18}

#TWOBYFOUR2 TYPE NAME1 NAME2 NAME3 NAME4 NAME5 FLAG PROB
{TWOBYFOUR2  Mm   mountain_range4_1 mountain_range4_2 mountain_range4_3 mountain_range4_4 mountain_range4_5 overlay 26}

#ONEBYTHREE TYPE NAME1 NAME2 NAME3 FLAG PROB
{ONEBYTHREE  Mm   mountain_range1_1 mountain_range1_2 mountain_range1_3 overlay 20}

#ONEBYTHREE2 TYPE NAME1 NAME2 NAME3 FLAG PROB
{ONEBYTHREE2 Mm   mountain_range2_1 mountain_range2_2 mountain_range2_3 overlay 20}

# TWOBYTWO TYPE NAME1 NAME2 NAME3 FLAG PROB
{TWOBYTWO    Mm   mountain5_1 mountain5_2 mountain5_3 overlay 40}
{TWOBYTWO    Mm   mountain6_1 mountain6_2 mountain6_3 overlay 30}

#Macro for Single Hex
#define SHEX TYPE FLAG PROB TILE
    [terrain_graphics]
        map="
, *
* , *
, 1
* , *
, *"

        [tile]
            pos=1
            type={TYPE}
            no_flag={FLAG}
            set_flag={FLAG}
        [/tile]

        probability={PROB}

        [image]
            name={TILE}
            base=90,146
        [/image]
    [/terrain_graphics]
#enddef

#Macro for Single Hex with double overlay
#define SHEX_DOUBLE TYPE FLAG PROB TILE1 TILE2
    [terrain_graphics]
        map="
, *
* , *
, 1
* , *
, *"

        [tile]
            pos=1
            type={TYPE}
            no_flag={FLAG}
            set_flag={FLAG}
        [/tile]

        probability={PROB}

        [image]
            name={TILE1}
            base=90,146
        [/image]
        [image]
            name={TILE2}
            base=90,146
        [/image]
    [/terrain_graphics]
#enddef

#define SHEX_LAYER TYPE FLAG LAYER PROB TILE
    [terrain_graphics]
        map="
, *
* , *
, 1
* , *
, *"

        [tile]
            pos=1
            type={TYPE}
            no_flag={FLAG}
            set_flag={FLAG}
        [/tile]

        probability={PROB}

        [image]
            name={TILE}
            layer={LAYER}
            base=90,146
        [/image]
    [/terrain_graphics]
#enddef

#define TERRAIN_OVERLAY_PROB TERRAIN_PATTERN FLAG PROB IMAGESTEM
    [terrain_graphics]
        [tile]
            x=0
            y=0
            type={TERRAIN_PATTERN}
            [image]
                layer=-1000
                name={IMAGESTEM}
            [/image]
        [/tile]
        probability={PROB}
        no_flag={FLAG}
        set_flag={FLAG}
    [/terrain_graphics]
#enddef

#Single hex mountain tiles (mountain + village)
#33% 33% 33%
{SHEX Mm           overlay 33  mountains3}
{SHEX Mm           overlay 50  mountains2}
{SHEX Mm           overlay 100 mountains}

#Single hex normal forest/pine tiles
#33% 17% 5% 45%
{SHEX *^Fp         overlay 33  forest/pine}
{SHEX *^Fp         overlay 25  forest/pine3}
{SHEX *^Fp         overlay 10  forest/pine4}
{SHEX *^Fp         overlay 100 forest/pine2}

#Single hex tropical forest/pine tiles
#33% 17% 5% 45%
{SHEX *^Ft         overlay 33  forest/tropical2}
{SHEX *^Ft         overlay 25  forest/tropical3}
{SHEX *^Ft         overlay 10  forest/tropical4}
{SHEX *^Ft         overlay 100 forest/tropical}

#Single hex normal snow forest/pine tiles
#25% 25% 25% 25%
{SHEX *^Fpa        overlay 25  snow-forest2}
{SHEX *^Fpa        overlay 33  snow-forest3}
{SHEX *^Fpa        overlay 50  snow-forest4}
{SHEX *^Fpa        overlay 100 snow-forest}

#Single hex forest/great-tree
#33% 17% 50%
{SHEX *^Fet        overlay 33  forest/great-tree3}
{SHEX *^Fet        overlay 25  forest/great-tree2}
{SHEX *^Fet        overlay 100 forest/great-tree1}

#Single hex underground mushroom forest/pine tiles
#20% 20% 20% 20% 20%
{SHEX *^Uf         overlay 20  mushrooms2}
{SHEX *^Uf         overlay 25  mushrooms3}
{SHEX *^Uf         overlay 33  mushrooms4}
{SHEX *^Uf         overlay 50  mushrooms5}
{SHEX *^Uf         overlay 100 mushrooms}

#Single hex Cave lit by Beam of Light
#33% 33% 33%
{SHEX *^Ii         overlay 33  cave/beam3}
{SHEX *^Ii         overlay 50  cave/beam2}
{SHEX *^Ii         overlay 100 cave/beam1}

{SHEX_DOUBLE *^Ufi         overlay 20  mushrooms2 cave/beam2}
{SHEX_DOUBLE *^Ufi         overlay 25  mushrooms3 cave/beam1}
{SHEX_DOUBLE *^Ufi         overlay 33  mushrooms4 cave/beam3}
{SHEX_DOUBLE *^Ufi         overlay 50  mushrooms5 cave/beam2}
{SHEX_DOUBLE *^Ufi         overlay 100 mushrooms  cave/beam1}

{SHEX (Ss,Chs)     overlay 10  swamp/reed3}
{SHEX (Ss,Chs)     overlay 20  swamp/reed1}
{SHEX (Ss,Chs)     overlay 25  swamp/reed2}
{SHEX (Ss,Chs)     overlay 33  swamp/reed4}
{SHEX (Ss,Chs)     overlay 50  swamp/reed5}
{SHEX (Ss,Chs)     overlay 100 swamp/reed6}

#Macro for clouds
#define CLOUDS TYPE NAME1 NAME2 NAME3 FLAG PROB
    [terrain_graphics]
        map="
, *
* , *
, 2
* , *
, *"

        [tile]
            pos=2
            type={TYPE}
            no_flag={FLAG}
            set_flag={FLAG}
        [/tile]

        [image]
            name={NAME1}
            base=32,208
        [/image]

        [image]
            name={NAME2}
            base=88,372
        [/image]

        [image]
            name={NAME3}
            base=142,308
        [/image]

        probability={PROB}
    [/terrain_graphics]
#enddef

#33% 33% 33%
{CLOUDS *^Xm cloud1_1 cloud1_2 cloud1_3 clouds 33}
{CLOUDS *^Xm cloud1_1 cloud2_2 cloud1_3 clouds 50}
{CLOUDS *^Xm cloud1_1 cloud3_2 cloud1_3 clouds 100}

{PEAKS_ONEBYTWO *^Xm mountain_peak_range1_1 mountain_peak_range1_2 peaks 15}

{PEAKS_LARGE *^Xm mountain_peak_large1  peaks 25}
{PEAKS_LARGE *^Xm mountain_peak_large2  peaks 33}

{PEAKS *^Xm mountain_peak1  peaks 16}
{PEAKS *^Xm mountain_peak2  peaks 20}
{PEAKS *^Xm mountain_peak3  peaks 27}
{PEAKS *^Xm mountain_peak4  peaks 40}
{PEAKS *^Xm mountain_peak5  peaks 80}

#
#       >  V I L L A G E   B U I L D I N G S   <

# Flagged as 'village' so they can be placed on
# top of both 'base' and 'overlay'

#Single hex human villages (grassland, hills, mountains)
#30% 30% 40%
{SHEX *^Vh        village 30  village/human}
{SHEX *^Vh        village 43  village/human2}
{SHEX *^Vh        village 100 village/human3}

{SHEX *^Vhh       village 100 village/human4}

#Single hex human villages (snow)
#33% 33% 33%
{SHEX *^Vha       village 33  village/human-snow}
{SHEX *^Vha       village 50  village/human-snow2}
{SHEX *^Vha       village 100 village/human-snow3}

{SHEX *^Vhha      village 100 village/human-snow4}

#Single hex tropical village
{SHEX *^Vht       village 100 village/tropical-forest}

#Single hex elven villages
#10% 25% 25% 40%
{SHEX *^Ve        village 10  village/elven}
{SHEX *^Ve        village 28  village/elven3}
{SHEX *^Ve        village 38  village/elven4}
{SHEX *^Ve        village 100 village/elven2}

#Single hex elven villages (snow)
#10% 25% 25% 40%
{SHEX *^Vea       village 10  village/elven-snow}
{SHEX *^Vea       village 28  village/elven-snow3}
{SHEX *^Vea       village 38  village/elven-snow4}
{SHEX *^Vea       village 100 village/elven-snow2}

#Single hex desert villages
#33% 33% 33%
{SHEX *^Vda       village 33 village/desert}
{SHEX *^Vda       village 50 village/desert2}
{SHEX *^Vda       village 100 village/desert3}

#Single hex desert tent
{SHEX *^Vdt       village 100 village/desert-camp}

#Single hex underground villages
#33% 33% 33%
{SHEX *^Vu        village 33  village/cave}
{SHEX *^Vu        village 50  village/cave2}
{SHEX *^Vu        village 100 village/cave3}

{SHEX *^Vud       village 10  village/dwarven2}
{SHEX *^Vud       village 28  village/dwarven3}
{SHEX *^Vud       village 38  village/dwarven4}
{SHEX *^Vud       village 100 village/dwarven}

#Single hex crude villages (grassland)
#50% 50%
{SHEX *^Vc        village 50  village/hut1}
{SHEX *^Vc        village 100  village/hut2}

#Single hex swamp village
#50% 50%
{SHEX *^Vhs       village 50  village/swampwater}
{SHEX *^Vhs       village 100 village/swampwater2}

#Single hex merfolk village
{SHEX *^Vm        village 50 village/coast}
{SHEX *^Vm        village 100 village/coast2}

# Single hex windmill village
{SHEX *^Wm       windmill 100 ("windmill-01:70,windmill-02:70,windmill-03:70,windmill-04:70,windmill-05:70,windmill-06:70,windmill-07:70,windmill-08:70,windmill-09:70,windmill-10:70,windmill-11:70,windmill-12:70,windmill-13:70,windmill-14:70,windmill-15:70,windmill-16:70,windmill-17:70,windmill-18:70")}

#
#       >  O V E R L A Y S <
#

{SHEX_LAYER *^Gvs      farm       -10       33      flat/farm-veg-spring1}
{SHEX_LAYER *^Gvs      farm       -10       50      flat/farm-veg-spring2}
{SHEX_LAYER *^Gvs      farm       -10       100     flat/farm-veg-spring3}

{SHEX 		*^Dr       overlay              33      sand_rubble1}
{SHEX 		*^Dr       overlay              50      sand_rubble2}
{SHEX 		*^Dr       overlay              100     sand_rubble3}

#
#       >  B A S E   T E R R A I N S  <
#

{TERRAIN_BASE_PROB  Uu                  cave/floor2		       20}
{TERRAIN_BASE_PROB  Uu                  cave/floor3		       25}
{TERRAIN_BASE_PROB  Uu                  cave/floor4		       33}
{TERRAIN_BASE_PROB  Uu                  cave/floor5		       50}
{TERRAIN_BASE       Uu                  cave/floor6}

{TERRAIN_BASE_PROB  Xu                  cave/wall-rough1       33}
{TERRAIN_BASE_PROB  Xu                  cave/wall-rough2       50}
{TERRAIN_BASE       Xu                  cave/wall-rough3}

#33% 33% 33%
{TERRAIN_BASE_PROB  Uh                  cave/hills-variation1    33}
{TERRAIN_BASE_PROB  Uh                  cave/hills-variation2    50}
{TERRAIN_BASE       Uh                  cave/hills-variation3}

#33% 33% 33%
{TERRAIN_BASE_PROB  Hh                  hills-variation1         33}
{TERRAIN_BASE_PROB  Hh                  hills-variation2         50}
{TERRAIN_BASE       Hh                  hills-variation3}

#30% 30% 40%
{TERRAIN_BASE_PROB  Ha                  snow-hills3              30}
{TERRAIN_BASE_PROB  Ha                  snow-hills2              43}
{TERRAIN_BASE       Ha                  snow-hills}

#30% 30% 40%
{TERRAIN_BASE_PROB  Aa                  snow2                    30}
{TERRAIN_BASE_PROB  Aa                  snow3 	               43}
{TERRAIN_BASE       Aa                  snow}

{TERRAIN_BASE       Qxu                 chasm}

{TERRAIN_BASE_PROB  Ql,Qlf              lava                     33}
{TERRAIN_BASE_PROB  Ql,Qlf              lava2                    50}
{TERRAIN_BASE       Ql,Qlf              lava3}

#g 2% 2% 3% 3% 9% 9% 9% 9% 9% 9% 9% 27%
{TERRAIN_BASE_PROB  Gg^                 flat/grass-rocks1         2}
{TERRAIN_BASE_PROB  Gg^                 flat/grass-rocks2         2}
#f? 10% 10% 10% 10% 10% 10% 10% 30%
{TERRAIN_BASE_PROB  Gg                  flat/grass-r1             10}
{TERRAIN_BASE_PROB  Gg                  flat/grass-r2             11}
{TERRAIN_BASE_PROB  Gg                  flat/grass-r3             13}
{TERRAIN_BASE_PROB  Gg                  flat/grass-r4             14}
{TERRAIN_BASE_PROB  Gg                  flat/grass-r5             17}
{TERRAIN_BASE_PROB  Gg                  flat/grass-r6             20}
{TERRAIN_BASE_PROB  Gg                  flat/grass-r7             25}
{TERRAIN_BASE       Gg                  flat/grass-r8}

{TERRAIN_BASE_PROB  Ggf                 flat/grass-flowers1       20}
{TERRAIN_BASE_PROB  Ggf                 flat/grass-flowers2       25}
{TERRAIN_BASE_PROB  Ggf                 flat/grass-flowers3       33}
{TERRAIN_BASE_PROB  Ggf                 flat/grass-flowers4       50}
{TERRAIN_BASE       Ggf                 flat/grass-flowers5}

{TERRAIN_BASE_PROB  Gs                  flat/savanna                  33}
{TERRAIN_BASE_PROB  Gs                  flat/savanna2                 50}
{TERRAIN_BASE       Gs                  flat/savanna3}

{TERRAIN_BASE       Re                  flat/dirt}

#33% 33% 33%
{TERRAIN_BASE_PROB  Rr                  flat/road3                    33}
{TERRAIN_BASE_PROB  Rr                  flat/road2                    50}
{TERRAIN_BASE       Rr                  flat/road}

{TERRAIN_BASE_PROB  Rp                  flat/stone-path6                    17}
{TERRAIN_BASE_PROB  Rp                  flat/stone-path5                    19}
{TERRAIN_BASE_PROB  Rp                  flat/stone-path4                    25}
{TERRAIN_BASE_PROB  Rp                  flat/stone-path3                    33}
{TERRAIN_BASE_PROB  Rp                  flat/stone-path2                    50}
{TERRAIN_BASE       Rp                  flat/stone-path}

{TERRAIN_BASE       Rd                  desert-road}

{TERRAIN_BASE       *^Dc                desert_crater}
{TERRAIN_BASE       *^Do                desert-oasis}

#0% 0% 0% 12% 12% 12% 12% 12% 12% 12% 12%
{TERRAIN_BASE_PROB  Dd                  desert1                  12}
{TERRAIN_BASE_PROB  Dd                  desert2                  14}
{TERRAIN_BASE_PROB  Dd                  desert3                  17}
{TERRAIN_BASE_PROB  Dd                  desert4                  20}
{TERRAIN_BASE_PROB  Dd                  desert5                  25}
{TERRAIN_BASE_PROB  Dd                  desert6                  33}
{TERRAIN_BASE_PROB  Dd                  desert7                  50}
{TERRAIN_BASE       Dd                  desert}

{TERRAIN_OVERLAY_PROB Dd^ overlay 5 desert-plant}
{TERRAIN_OVERLAY_PROB Dd^ overlay 5 desert-plant2}
{TERRAIN_OVERLAY_PROB Dd^ overlay 5 desert-plant3}

#33% 33% 33%
{TERRAIN_BASE_PROB  Hd                  desert-hills2            33}
{TERRAIN_BASE_PROB  Hd                  desert-hills3            50}
{TERRAIN_BASE       Hd                  desert-hills}

#25% 25% 25% 25%
{TERRAIN_BASE_PROB  Md                  desert-mountain-peak1    25}
{TERRAIN_BASE_PROB  Md                  desert-mountain-peak2    33}
{TERRAIN_BASE_PROB  Md                  desert-mountain-peak3    50}
{TERRAIN_BASE       Md                  desert-mountains}

#10% 10% 10% 70%
{TERRAIN_BASE_PROB  Ds                  sand-rock1               10}
{TERRAIN_BASE_PROB  Ds                  sand-rock2               11}
{TERRAIN_BASE_PROB  Ds                  sand-rock3               13}
{TERRAIN_BASE_PROB  Ds                  sand2                  12}
{TERRAIN_BASE_PROB  Ds                  sand3                  14}
{TERRAIN_BASE_PROB  Ds                  sand4                  17}
{TERRAIN_BASE_PROB  Ds                  sand5                  20}
{TERRAIN_BASE_PROB  Ds                  sand6                  25}
{TERRAIN_BASE_PROB  Ds                  sand7                  33}
{TERRAIN_BASE_PROB  Ds                  sand8                  50}
{TERRAIN_BASE       Ds                  sand}

{TERRAIN_BASE       Do                desert-oasis}

#8% 8% 8% 8% 23% 23% 23%
{TERRAIN_BASE_PROB  Ss                  swamp/water-flowers1      8}
{TERRAIN_BASE_PROB  Ss                  swamp/water-flowers2      9}
{TERRAIN_BASE_PROB  Ss                  swamp/water-plant1        10}
{TERRAIN_BASE_PROB  Ss                  swamp/water-plant2        11}
{TERRAIN_BASE_PROB  Ss                  swamp/water2              33}
{TERRAIN_BASE_PROB  Ss                  swamp/water3              50}
{TERRAIN_BASE       Ss                  swamp/water}

#10% 10% 10% 10% 25% 35%
{TERRAIN_BASE_PROB  Ai                  ice2                     10}
{TERRAIN_BASE_PROB  Ai                  ice3                     11}
{TERRAIN_BASE_PROB  Ai                  ice5                     13}
{TERRAIN_BASE_PROB  Ai                  ice6                     14}
{TERRAIN_BASE_PROB  Ai                  ice4                     42}
{TERRAIN_BASE       Ai                  ice}

#set them to 33 for some irregulrity
#33% 67%
{TERRAIN_BASE_PROB  Wwf                 water/ford2                    33}
{TERRAIN_BASE       Wwf                 water/ford}

#30% 30% 40%
{TERRAIN_BASE_PROB  Wo                  water/ocean3                   30}
{TERRAIN_BASE_PROB  Wo                  water/ocean2                   43}
{TERRAIN_BASE       Wo                  water/ocean}

#30% 30% 40%
{TERRAIN_BASE_PROB  Ww                  water/coast3                   30}
{TERRAIN_BASE_PROB  Ww                  water/coast2                   43}
{TERRAIN_BASE       Ww                  water/coast}

#{TERRAIN_BASE       ~                 fog}

#This one is to fill any "gaps" there might be when next to castles or walls
{TERRAIN_BASE       Mm                  hills-variation1}

#{CANYON X canyon}
#added ruins

# This is where the BRIGDE macro used to be

#
#     >  T R A N S I T I O N S   B E T W E E N   T E R R A I N S  <
#

# Special transitions go first

#
#     >  C A S T L E S   B A S E   T E R R A I N S  <
#

{DISABLE_TRANSITIONS Kh*}
{DISABLE_TRANSITIONS Ch}
{DISABLE_TRANSITIONS Kv*}
{DISABLE_TRANSITIONS Cv}

{TERRAIN_BASE        (Ch,Kh*)  castle/cobbles}
{KEEP_BASE           Kh        castle/cobbles}

{TERRAIN_BASE        Cv        castle/elven/grounds}
{KEEP_BASE           Kv        castle/elven/keep}

{TERRAIN_BASE_PROB   Cud       castle/dwarven-castle-floor3	33}
{TERRAIN_BASE_PROB   Cud       castle/dwarven-castle-floor2	50}
{TERRAIN_BASE        Cud       castle/dwarven-castle-floor}

{TERRAIN_BASE        Kud       castle/dwarven-keep-floor}

{TERRAIN_BASE        (Ce,Ke)   flat/dirt}

{TERRAIN_BASE        Chr       castle/cobbles}
{TERRAIN_BASE        Chw       castle/sunken-ruin}
#30% 30% 40%
{TERRAIN_BASE_PROB   Chs       swamp/water2            30}
{TERRAIN_BASE_PROB   Chs       swamp/water3            43}
{TERRAIN_BASE        Chs       swamp/water}

#{TERRAIN_BASE O orccastle}

#define TERRAIN_ADJACENT_CORNER_BOTH INNER OUTER IMAGESTEM
    {TERRAIN_ADJACENT_CORNER  {INNER} {OUTER} {OUTER} 52,76 {IMAGESTEM}-convex}
    {TERRAIN_ADJACENT_CORNER  {OUTER} {INNER} {INNER} 56,68 {IMAGESTEM}-concave}
#enddef

# Loyalist castle
{TERRAIN_ADJACENT_CORNER       Ch               (!,Ch*,Kh*)       (!,Ch*,Kh*)      52,76 castle/castle-convex}
{TERRAIN_ADJACENT_CORNER       (!,Ch*,Kh*)      Ch                Ch*              56,68 castle/castle-concave}
{TERRAIN_ADJACENT_CORNER       Kh               Ch*               Ch*              54,72 castle/keep-inside}
{TERRAIN_ADJACENT_CORNER       Kh               (!,Ch*,Kh*)       (!,Ch*,Kh*)      52,76 castle/keep-wall}
{TERRAIN_ADJACENT_CORNER       Kh               (!,Ch*,Kh*)       Ch*              52,72 castle/keep-wall-0}
{TERRAIN_ADJACENT_CORNER       Kh               Ch*               (!,Ch*,Kh*)      56,76 castle/keep-wall-1}
{TERRAIN_ADJACENT_CORNER       Kh               Kh*               (!,Kh*)          56,76 castle/keep-keep}

# Elven castle
{TERRAIN_ADJACENT_CORNER       Cv               (!,Cv,Kv)         (!,Cv,Kv)        52,76 castle/elven/convex}
{TERRAIN_ADJACENT_CORNER       (!,Cv,Kv)        Cv                Cv               56,68 castle/elven/concave}
{TERRAIN_ADJACENT_CORNER       Kv               Cv                Cv               54,72 castle/elven/keep-inside}
{TERRAIN_ADJACENT_CORNER       Kv               (!,Cv,Kv)         (!,Cv,Kv)        52,76 castle/elven/keep-wall}
{TERRAIN_ADJACENT_CORNER       Kv               (!,Cv,Kv)         Cv               52,72 castle/elven/keep-wall-0}
{TERRAIN_ADJACENT_CORNER       Kv               Cv                (!,Cv,Kv)        56,76 castle/elven/keep-wall-1}
{TERRAIN_ADJACENT_CORNER       Kv               Kv                (!,Kv)           56,76 castle/elven/keep-keep}

# ruined castle

#17% 17% 17% 17% 17% 17%
{TERRAIN_ADJACENT_CORNER_PROB  Chr              (!,Ch*,Kh*)       (!,Ch*,Kh*)      52,76 castle/ruin5-convex  17}
{TERRAIN_ADJACENT_CORNER_PROB  Chr              (!,Ch*,Kh*)       (!,Ch*,Kh*)      52,76 castle/ruin4-convex  20}
{TERRAIN_ADJACENT_CORNER_PROB  Chr              (!,Ch*,Kh*)       (!,Ch*,Kh*)      52,76 castle/ruin3-convex  25}
{TERRAIN_ADJACENT_CORNER_PROB  Chr              (!,Ch*,Kh*)       (!,Ch*,Kh*)      52,76 castle/ruin2-convex  33}
{TERRAIN_ADJACENT_CORNER_PROB  Chr              (!,Ch*,Kh*)       (!,Ch*,Kh*)      52,76 castle/ruin1-convex  50}
{TERRAIN_ADJACENT_CORNER_PROB  Chr              (!,Ch*,Kh*)       (!,Ch*,Kh*)      52,76 castle/castle-convex 100}

#17% 17% 17% 17% 17% 17%
{TERRAIN_ADJACENT_CORNER_PROB  (!,Ch*,Kh*)      Chr               Ch*              56,68 castle/ruin5-concave  17}
{TERRAIN_ADJACENT_CORNER_PROB  (!,Ch*,Kh*)      Chr               Ch*              56,68 castle/ruin4-concave  20}
{TERRAIN_ADJACENT_CORNER_PROB  (!,Ch*,Kh*)      Chr               Ch*              56,68 castle/ruin3-concave  25}
{TERRAIN_ADJACENT_CORNER_PROB  (!,Ch*,Kh*)      Chr               Ch*              56,68 castle/ruin2-concave  33}
{TERRAIN_ADJACENT_CORNER_PROB  (!,Ch*,Kh*)      Chr               Ch*              56,68 castle/ruin1-concave  50}
{TERRAIN_ADJACENT_CORNER_PROB  (!,Ch*,Kh*)      Chr               Ch*              56,68 castle/castle-concave 100}

#75% 25%
{TERRAIN_ADJACENT_CORNER_PROB  Khr              Ch*               Ch*              54,72 castle/ruinkeep1-inside 75}
{TERRAIN_ADJACENT_CORNER_PROB  Khr              Ch*               Ch*              54,72 castle/keep-inside 100}

#75% 25%
{TERRAIN_ADJACENT_CORNER_PROB  Khr              (!,Ch*,Kh*)       (!,Ch*,Kh*)      54,72 castle/ruinkeep1-wall   75}
{TERRAIN_ADJACENT_CORNER_PROB  Khr              (!,Ch*,Kh*)       (!,Ch*,Kh*)      52,76 castle/keep-wall        100}

#75% 25%
{TERRAIN_ADJACENT_CORNER_PROB  Khr              (!,Ch*,Kh*)       Ch*              54,72 castle/ruinkeep1-wall-0 75}
{TERRAIN_ADJACENT_CORNER_PROB  Khr              (!,Ch*,Kh*)       Ch*              52,72 castle/keep-wall-0      100}

#75% 25%
{TERRAIN_ADJACENT_CORNER_PROB  Khr              Ch*               (!,Ch*,Kh*)      54,72 castle/ruinkeep1-wall-1 75}
{TERRAIN_ADJACENT_CORNER_PROB  Khr              Ch*               (!,Ch*,Kh*)      56,76 castle/keep-wall-1      100}

#75% 25%
{TERRAIN_ADJACENT_CORNER_PROB  Khr              Kh*               (!,Kh*)          54,72 castle/ruinkeep1-keep   75}
{TERRAIN_ADJACENT_CORNER_PROB  Khr              Kh*               (!,Kh*)          56,76 castle/keep-keep        100}

# sunken ruined castle
#{DISABLE_TRANSITIONS Q}

#17% 17% 17% 17% 17% 17%
{TERRAIN_ADJACENT_CORNER_PROB  Chw              (W*,Ss)           (W*,Ss)          52,76 castle/sunken-ruin5-convex 17}
{TERRAIN_ADJACENT_CORNER_PROB  Chw              (W*,Ss)           (W*,Ss)          52,76 castle/sunken-ruin4-convex 20}
{TERRAIN_ADJACENT_CORNER_PROB  Chw              (W*,Ss)           (W*,Ss)          52,76 castle/sunken-ruin3-convex 25}
{TERRAIN_ADJACENT_CORNER_PROB  Chw              (W*,Ss)           (W*,Ss)          52,76 castle/sunken-ruin2-convex 33}
{TERRAIN_ADJACENT_CORNER_PROB  Chw              (W*,Ss)           (W*,Ss)          52,76 castle/sunken-ruin1-convex 50}
{TERRAIN_ADJACENT_CORNER_PROB  Chw              (W*,Ss)           (W*,Ss)          52,76 castle/sunken-ruin-convex  100}

#17% 17% 17% 17% 17% 17%
{TERRAIN_ADJACENT_CORNER_PROB  (W*,Ss)          Chw               Ch*              56,68 castle/sunken-ruin5-concave 17}
{TERRAIN_ADJACENT_CORNER_PROB  (W*,Ss)          Chw               Ch*              56,68 castle/sunken-ruin4-concave 20}
{TERRAIN_ADJACENT_CORNER_PROB  (W*,Ss)          Chw               Ch*              56,68 castle/sunken-ruin3-concave 25}
{TERRAIN_ADJACENT_CORNER_PROB  (W*,Ss)          Chw               Ch*              56,68 castle/sunken-ruin2-concave 33}
{TERRAIN_ADJACENT_CORNER_PROB  (W*,Ss)          Chw               Ch*              56,68 castle/sunken-ruin1-concave 50}
{TERRAIN_ADJACENT_CORNER_PROB  (W*,Ss)          Chw               Ch*              56,68 castle/sunken-ruin-concave  100}

#17% 17% 17% 17% 17% 17%
{TERRAIN_ADJACENT_CORNER_PROB  Chw              (!,Ch*,Kh*)       (!,Ch*,Kh*)      52,76 castle/ruin5-convex  17}
{TERRAIN_ADJACENT_CORNER_PROB  Chw              (!,Ch*,Kh*)       (!,Ch*,Kh*)      52,76 castle/ruin4-convex  20}
{TERRAIN_ADJACENT_CORNER_PROB  Chw              (!,Ch*,Kh*)       (!,Ch*,Kh*)      52,76 castle/ruin3-convex  25}
{TERRAIN_ADJACENT_CORNER_PROB  Chw              (!,Ch*,Kh*)       (!,Ch*,Kh*)      52,76 castle/ruin2-convex  33}
{TERRAIN_ADJACENT_CORNER_PROB  Chw              (!,Ch*,Kh*)       (!,Ch*,Kh*)      52,76 castle/ruin1-convex  50}
{TERRAIN_ADJACENT_CORNER_PROB  Chw              (!,Ch*,Kh*)       (!,Ch*,Kh*)      52,76 castle/castle-convex 100}

#17% 17% 17% 17% 17% 17%
{TERRAIN_ADJACENT_CORNER_PROB  (!,Ch*,Kh*)      Chw               Ch*              56,68 castle/ruin5-concave  17}
{TERRAIN_ADJACENT_CORNER_PROB  (!,Ch*,Kh*)      Chw               Ch*              56,68 castle/ruin4-concave  20}
{TERRAIN_ADJACENT_CORNER_PROB  (!,Ch*,Kh*)      Chw               Ch*              56,68 castle/ruin3-concave  25}
{TERRAIN_ADJACENT_CORNER_PROB  (!,Ch*,Kh*)      Chw               Ch*              56,68 castle/ruin2-concave  33}
{TERRAIN_ADJACENT_CORNER_PROB  (!,Ch*,Kh*)      Chw               Ch*              56,68 castle/ruin1-concave  50}
{TERRAIN_ADJACENT_CORNER_PROB  (!,Ch*,Kh*)      Chw               Ch*              56,68 castle/castle-concave 100}

#75% 25%
{TERRAIN_ADJACENT_CORNER_PROB  Khw              Ch*               Ch*              54,72 castle/sunken-ruinkeep1-inside 75}
{TERRAIN_ADJACENT_CORNER_PROB  Khw              Ch*               Ch*              54,72 castle/sunkenkeep-inside       100}

#75% 25%
{TERRAIN_ADJACENT_CORNER_PROB  Khw              (!,Ch*,Kh*)       (!,Ch*,Kh*)      52,76 castle/sunken-ruinkeep1-wall 75}
{TERRAIN_ADJACENT_CORNER_PROB  Khw              (!,Ch*,Kh*)       (!,Ch*,Kh*)      52,76 castle/sunkenkeep-wall       100}

#75% 25%
{TERRAIN_ADJACENT_CORNER_PROB  Khw              (!,Ch*,Kh*)       Ch*              52,72 castle/sunken-ruinkeep1-wall-0 75}
{TERRAIN_ADJACENT_CORNER_PROB  Khw              (!,Ch*,Kh*)       Ch*              52,72 castle/sunkenkeep-wall-0       100}

#75% 25%
{TERRAIN_ADJACENT_CORNER_PROB  Khw              Ch*               (!,Ch*,Kh*)      56,76 castle/sunken-ruinkeep1-wall-1 75}
{TERRAIN_ADJACENT_CORNER_PROB  Khw              Ch*               (!,Ch*,Kh*)      56,76 castle/sunkenkeep-wall-1       100}

#75% 25%
{TERRAIN_ADJACENT_CORNER_PROB  Khw              Kh*               (!,Kh*)          56,76 castle/sunken-ruinkeep1-keep 75}
{TERRAIN_ADJACENT_CORNER_PROB  Khw              Kh*               (!,Kh*)          56,76 castle/sunkenkeep-keep       100}

# swamp ruined castle
#{DISABLE_TRANSITIONS q}

#17% 17% 17% 17% 17% 17%
{TERRAIN_ADJACENT_CORNER_PROB  Chs              (!,Ch*,Kh*)     (!,Ch*,Kh*)     52,76 castle/ruin5-convex 17}
{TERRAIN_ADJACENT_CORNER_PROB  Chs              (!,Ch*,Kh*)     (!,Ch*,Kh*)     52,76 castle/ruin4-convex 20}
{TERRAIN_ADJACENT_CORNER_PROB  Chs              (!,Ch*,Kh*)     (!,Ch*,Kh*)     52,76 castle/ruin3-convex 25}
{TERRAIN_ADJACENT_CORNER_PROB  Chs              (!,Ch*,Kh*)     (!,Ch*,Kh*)     52,76 castle/ruin2-convex 33}
{TERRAIN_ADJACENT_CORNER_PROB  Chs              (!,Ch*,Kh*)     (!,Ch*,Kh*)     52,76 castle/ruin1-convex 50}
{TERRAIN_ADJACENT_CORNER_PROB  Chs              (!,Ch*,Kh*)     (!,Ch*,Kh*)     52,76 castle/castle-convex  100}

#17% 17% 17% 17% 17% 17%
{TERRAIN_ADJACENT_CORNER_PROB  (!,Ch*,Kh*)      Chs             Ch*             56,68 castle/ruin5-concave  17}
{TERRAIN_ADJACENT_CORNER_PROB  (!,Ch*,Kh*)      Chs             Ch*             56,68 castle/ruin4-concave  20}
{TERRAIN_ADJACENT_CORNER_PROB  (!,Ch*,Kh*)      Chs             Ch*             56,68 castle/ruin3-concave  25}
{TERRAIN_ADJACENT_CORNER_PROB  (!,Ch*,Kh*)      Chs             Ch*             56,68 castle/ruin2-concave  33}
{TERRAIN_ADJACENT_CORNER_PROB  (!,Ch*,Kh*)      Chs             Ch*             56,68 castle/ruin1-concave  50}
{TERRAIN_ADJACENT_CORNER_PROB  (!,Ch*,Kh*)      Chs             Ch*             56,68 castle/castle-concave 100}

#75% 25%
{TERRAIN_ADJACENT_CORNER_PROB  Khs              Ch*             Ch*             54,72 castle/ruinkeep1-inside 75}
{TERRAIN_ADJACENT_CORNER_PROB  Khs              Ch*             Ch*             54,72 castle/keep-inside      100}

#75% 25%
{TERRAIN_ADJACENT_CORNER_PROB  Khs              (!,Ch*,Kh*)     (!,Ch*,Kh*)     52,76 castle/ruinkeep1-wall   75}
{TERRAIN_ADJACENT_CORNER_PROB  Khs              (!,Ch*,Kh*)     (!,Ch*,Kh*)     52,76 castle/keep-wall       100}

#75% 25%
{TERRAIN_ADJACENT_CORNER_PROB  Khs              (!,Ch*,Kh*)     Ch*             52,72 castle/ruinkeep1-wall-0 75}
{TERRAIN_ADJACENT_CORNER_PROB  Khs              (!,Ch*,Kh*)     Ch*             52,72 castle/keep-wall-0     100}

#75% 25%
{TERRAIN_ADJACENT_CORNER_PROB  Khs              Ch*             (!,Ch*,Kh*)     56,76 castle/ruinkeep1-wall-1 75}
{TERRAIN_ADJACENT_CORNER_PROB  Khs              Ch*             (!,Ch*,Kh*)     56,76 castle/keep-wall-1     100}

#75% 25%
{TERRAIN_ADJACENT_CORNER_PROB  Khs              Kh*             (!,Kh*)         56,76 castle/ruinkeep1-keep   75}
{TERRAIN_ADJACENT_CORNER_PROB  Khs              Kh*             (!,Kh*)         56,76 castle/keep-keep       100}

# Encampments
{DISABLE_TRANSITIONS (Ce,Ke)}
{TERRAIN_ADJACENT_CORNER_BOTH  (Ce,Ke)          (!,Ce,Ke,Ch*,Kh*)                  castle/encampment}
# FIXME: Line below commented out because the macro is nonexistent.
# It was probably trying to do something, though, and should be fixed.
#{KEEP_ADJACENT_CORNER_BOTH     Ce               (!,Ce,Ke,Ch*,Kh*)   keep-of-ce     castle/encampment}

# Cave and dwarven castles
{DISABLE_TRANSITIONS Qxu}
{DISABLE_TRANSITIONS Xu}
{DISABLE_TRANSITIONS (Cud,Kud)}

{TERRAIN_ADJACENT_CORNER_BOTH  Xu               (!,Xu,Cud,Kud,Qxu,Ql)                  cave/wall-rough}
{TERRAIN_ADJACENT_CORNER       Xu               (!,Xu,Cud,Kud,Qxu,Ql)  (Qxu,Ql)        54,68 cave/wall-rough-convex}
{TERRAIN_ADJACENT_CORNER       Xu               (Qxu,Ql)    (!,Xu,Cud,Kud,Qxu,Ql)      54,68 cave/wall-rough-convex}
{TERRAIN_ADJACENT_CORNER_BOTH  Xu               (Qxu,Ql)                               cave/wall-rough-chasm}

{TERRAIN_ADJACENT_CORNER_BOTH  (Cud,Kud)        (!,Xu,Qxu,Ql,Cud,Kud)                  castle/dwarven-castle}

{TERRAIN_ADJACENT_CORNER_BOTH  (Cud,Kud)        Xu                                     castle/dwarven-castle-wall}

{TERRAIN_ADJACENT_CORNER     (Cud,Kud)          Xu                 (!,Cud,Kud,Xu)      54,68 castle/dwarven-castle-wall-cw}
{TERRAIN_ADJACENT_CORNER     (Cud,Kud)          (!,Cud,Kud,Xu)     Xu                  54,68 castle/dwarven-castle-wall-ccw}

#castle-chasm transitions
{TERRAIN_ADJACENT_CORNER_BOTH  (Cud,Kud)        Qxu                                    chasm-dcastle}

{TERRAIN_ADJACENT_CORNER     (Cud,Kud)          (!,Cud,Kud,Xu,Ql,Qxu)    Qxu       52,76 chasm-dcastle-ccw}
{TERRAIN_ADJACENT_CORNER     (Cud,Kud)          Qxu          (!,Cud,Kud,Xu,Ql,Qxu) 52,76 chasm-dcastle-cw}

#castle-lava transitions

{TERRAIN_ADJACENT_CORNER_BOTH  (Cud,Kud)        Ql                                     lava-dcastle}

{TERRAIN_ADJACENT_CORNER     (Cud,Kud)           (!,Cud,Kud,Xu,Ql,Qxu)    Ql       52,76 lava-dcastle-ccw}
{TERRAIN_ADJACENT_CORNER     (Cud,Kud)           Ql          (!,Cud,Kud,Xu,Ql,Qxu) 52,76 lava-dcastle-cw}

#chasm-water transitions

{TERRAIN_ADJACENT_CORNER_BOTH  Qxu              (W*)                                   chasm}

#castle-lava-chasm transitions

{TERRAIN_ADJACENT_CORNER        (Cud,Kud)        Qxu            Ql                 52,76 lava-dcastle-chasm-ccw}
{TERRAIN_ADJACENT_CORNER        (Cud,Kud)        Ql             Qxu                52,76 lava-dcastle-chasm-cw}

# Lava
{DISABLE_TRANSITIONS Ql}

{TERRAIN_ADJACENT_CORNER_LAYER  Ql               (!,Ql,Qxu)     (!,Ql,Qxu)       -90 52,76 lava-convex}
{TERRAIN_ADJACENT_CORNER_LAYER  (!,Ql,Qxu)       Ql             Ql              -90 52,76 lava-concave}

# Lava-chasm

{TERRAIN_ADJACENT_CORNER_LAYER  Qxu              Ql             Ql              -100 52,76 lava-chasm-convex}
{TERRAIN_ADJACENT_CORNER_LAYER  Ql               Qxu            Qxu             -100 52,76 lava-chasm-concave}

{TERRAIN_ADJACENT_CORNER_LAYER  Ql               Qxu            (!,Ql,Qxu)      -90 52,76 lava-chasm-ccw}
{TERRAIN_ADJACENT_CORNER_LAYER  Ql               (!,Ql,Qxu)     Qxu             -90 52,76 lava-chasm-cw}

# Chasm
{TERRAIN_ADJACENT_CORNER_LAYER  Qxu              (!,Ql,Qxu)     (!,Ql,Qxu)      -90 52,76 chasm-convex}
{TERRAIN_ADJACENT_CORNER_LAYER  (!,Ql,Qxu)       Qxu            Qxu             -90 52,76 chasm-concave}

# Castle decorations and castle floors. Those must always be after the castles
# are defined.

{BUILDING_PROBABILITY Ke  ({VIMG 20,26 tent})   50}
{BUILDING_PROBABILITY Ke  ({VIMG 20,26 tent2})  100}
{BUILDING             Kud ({VIMG 36,40 castle/dwarven-keep}) }



#
#       > N O R M A L   T R A N S I T I O N S. <

#The order mostly controls which overlap which, some
# TERRAIN_ADJACENT_CUSTOMs and varying layer numbers are used to make some
# special transitions to layer in more complex ways.

{TERRAIN_ADJACENT          -140    (Mm,Hh,Ha)        Chr                                 flat/grass}

#{TERRAIN_ADJACENT_CUSTOM  -150    Mm               (Ha,Aa,Hd,W*,Ss)                     mountains transition2}
#{TERRAIN_ADJACENT_CUSTOM  -151    Mm               (!,Mm,Qxu,Hh,C*,K*,Xu)               mountains transition2}
{TERRAIN_ADJACENT          -160    Md               (!,Md,Qxu)                           desert-mountains}

{TERRAIN_ADJACENT          -170    Ha               Hh                                   snow-hills-to-hills}
{TERRAIN_ADJACENT          -171    Ha               (W*,Ss)                              snow-hills-to-water}
{TERRAIN_ADJACENT          -172    Ha               (!,Ha,Qxu,Mm,Md,W*,Ss)               snow-hills}

{TERRAIN_ADJACENT          -180    (Mm,Hh)          (!,Hh,W*,Ss)                         hills}
{TERRAIN_ADJACENT_CUSTOM   -181    (Mm,Hh)          (W*,Ss)                              hills transition2}
{TERRAIN_ADJACENT          -190    Hd               (!,Hd,Qxu)                           desert-hills}
{TERRAIN_ADJACENT          -200    Uh               (!,Uh)                               cave/hills}

{TERRAIN_ADJACENT          -210    Qlf              (!,Ql,Qlf,Qxu,Xu)                    lava}
{TERRAIN_ADJACENT          -220    U*               (!,U*)                               cave/floor}

# The snow-to-water transition here is applied both to snow and snow hills. The
# custom layer numbers are used to make the submerged part of the ice-to-water
# transition be drawn under other land transitions but the non-submerged part to
# be drawn on top of them.

{TERRAIN_ADJACENT          -240    Aa               (!,Aa,Qxu,W*,Ss)                     snow}
{TERRAIN_ADJACENT          -241    Aa               (W*,Ss)                              snow-to-water}
{TERRAIN_ADJACENT_CUSTOM   -400    Aa,Ha,Ai         (W*,Ss)                              ice-to-water submerged_part}
{TERRAIN_ADJACENT_CUSTOM   -242    Aa,Ha,Ai         (W*,Ss)                              ice non_submerged_part}

{TERRAIN_ADJACENT          -260    Gs               (W*,Ss)                              flat/savanna-to-water}

# These two work in conjunction with the mountain and hill transitions to create
# a smooth coastline between grassland, hills and mountains.

{TERRAIN_ADJACENT          -270    (Gg*,Qxu)        (!,Gg*,Qxu,Mm,Hh,W*)                 flat/grass}
{TERRAIN_ADJACENT_CUSTOM   -271    (!,Ggf)          Ggf                                  flat/grass flower-transit}
{TERRAIN_ADJACENT          -319    (Gg*,Qxu,Mm,Hh)  W*                                   flat/grass-to-water}

{TERRAIN_ADJACENT          -280    Gs               (!,Gs,Qxu)                           flat/savanna}
{TERRAIN_ADJACENT          -290    Rr               (!,Rr)                               flat/road}
{TERRAIN_ADJACENT          -300    Rp               (!,Rp)                               flat/stone-path}
{TERRAIN_ADJACENT_CUSTOM   -250    *^Gvs            (!,*^Gvs,C*,K*,*^F*,M*,H*,W*,S*)     flat/farm-veg-spring transition2}
{TERRAIN_ADJACENT          -259    Re               (!,Re)                               flat/dirt}

#{TERRAIN_ADJACENT          -310    (Dd,Do)          (!,Dd,Do)                            desert-oasis}

{TERRAIN_ADJACENT          -320    Ds               (!,Ds)                               sand}

# fixing the grassland to water transition glitch next to desert road:
{TERRAIN_ADJACENT_3_DIFFERENT    2    Rd               W*                 Gg                desert-road   road-water-grass-transition}

# Desert and desert road transitions, with desert road transitioning extra
# nicely with desert and desert villages.

{TERRAIN_ADJACENT             -330    Dd^,Dd^D*        (Dd^V*)                              desert}
{TERRAIN_ADJACENT             -345    Rd               (Dd^V*)                              desert-road}
# we need a specific rule to raise road-to-water transitions above
# desert-to-water in the case where desert-village, road and shallow water meet
{TERRAIN_ADJACENT_3_DIFFERENT -345    Rd               W*                 Dd^V*             desert-road   road-water-desert-transition}
{TERRAIN_ADJACENT             -355    Rd               (!,Rd,Dd)                            desert-road}
{TERRAIN_ADJACENT             -350    Dd               (!,R*,Dd)                            desert}
{TERRAIN_ADJACENT             -340    Dd^,Dd^D*        R*                                   desert}

# Water Transitions draw below everything else

{TERRAIN_ADJACENT_CUSTOM   -500    (Ch,Cv,Ce,Chr,Cud,Kh,Kv,Ke,Khr,Kud)     (Ai,W*)        castle/castle-to-ice transition3}
{TERRAIN_ADJACENT_CUSTOM   -505    (Ch,Cv,Ce,Chr,Cud,Kh,Kv,Ke,Khr,Kud)     W*             castle/castle-to-water transition2}
{TERRAIN_ADJACENT          -503    Ai               (!,Ai,Qxu)                           ice}

{TERRAIN_ADJACENT          -515    (Ss,Chs)         (!,Ss,Chs,H*,M*)                     swamp/water}

{TERRAIN_ADJACENT          -520    Ww               (!,Ww,Mm)                            water/coast}
{TERRAIN_ADJACENT          -530    Wwf              (!,Wwf)                              water/ford}
{TERRAIN_ADJACENT          -540    Wo               (!,Wo)                               water/ocean}
{TERRAIN_ADJACENT_CUSTOM   -550    Chw              (Ch,Chr)             castle/sunken-ruin     transition2}
{TERRAIN_ADJACENT_CUSTOM   -550    Chs              (Ch,Chr)             swamp/water     transition2}
{TERRAIN_ADJACENT          -560    Chw              (!,Chw,Chr)                          water/coast}
{TERRAIN_ADJACENT          -570    (!,Chr,Chw)      Chr                                  flat/grass}

# TERRAIN_BASE_DEFAULT doesn't seem to work for _s
{TERRAIN_BASE _s void}
{TERRAIN_BASE_DEFAULT void}
