#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.
#
# 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

# Wooden bridges (put those on top of everything)
{BRIDGE               *^Bw\ *^Bw| *^Bw/  (W*^,Ss^,Ai^) (C*,K*,*^F*)                bridge}

# Forests
# SIMPLE_FOREST_TERRAIN defined in forests.cfg
{SIMPLE_FOREST_TERRAIN  Hh*^Fp           (C*,K*,X*,Ql*,Qx*,Gv*,W*,M*,*^V*)         forest/pine-sparse}
{SIMPLE_FOREST_TERRAIN  *^Fp             (C*,K*,X*,Ql*,Qx*,Gv*,W*,M*,*^V*)         forest/pine}

{SIMPLE_FOREST_TERRAIN  *^Ft             (C*,K*,X*,Ql*,Qx*,Gv*,W*,M*,*^V*)         forest/tropical}

{SIMPLE_FOREST_TERRAIN  Ha*^Fpa          (C*,K*,X*,Ql*,Qx*,Gv*,W*,M*,*^V*)         forest/snow-forest-sparse}
{SIMPLE_FOREST_TERRAIN  *^Fpa            (C*,K*,X*,Ql*,Qx*,Gv*,W*,M*,*^V*)         forest/snow-forest}

{SIMPLE_FOREST_TERRAIN  Hh*^Fds          (C*,K*,X*,Ql*,Qx*,Gv*,W*,M*,*^V*)         forest/deciduous-summer-sparse}
{SIMPLE_FOREST_TERRAIN  *^Fds            (C*,K*,X*,Ql*,Qx*,Gv*,W*,M*,*^V*)         forest/deciduous-summer}

{SIMPLE_FOREST_TERRAIN  Hh*^Fdf          (C*,K*,X*,Ql*,Qx*,Gv*,W*,M*,*^V*)         forest/deciduous-fall-sparse}
{SIMPLE_FOREST_TERRAIN  *^Fdf            (C*,K*,X*,Ql*,Qx*,Gv*,W*,M*,*^V*)         forest/deciduous-fall}

{SIMPLE_FOREST_TERRAIN  Hh*^Fdw          (C*,K*,X*,Ql*,Qx*,Gv*,W*,M*,*^V*)         forest/deciduous-winter-sparse}
{SIMPLE_FOREST_TERRAIN  *^Fdw            (C*,K*,X*,Ql*,Qx*,Gv*,W*,M*,*^V*)         forest/deciduous-winter}

{SIMPLE_FOREST_TERRAIN  Ha*^Fda          (C*,K*,X*,Ql*,Qx*,Gv*,W*,M*,*^V*)         forest/deciduous-winter-snow-sparse}
{SIMPLE_FOREST_TERRAIN  *^Fda            (C*,K*,X*,Ql*,Qx*,Gv*,W*,M*,*^V*)         forest/deciduous-winter-snow}

{SIMPLE_FOREST_TERRAIN  Hh*^Fms          (C*,K*,X*,Ql*,Qx*,Gv*,W*,M*,*^V*)         forest/mixed-summer-sparse}
{SIMPLE_FOREST_TERRAIN  *^Fms            (C*,K*,X*,Ql*,Qx*,Gv*,W*,M*,*^V*)         forest/mixed-summer}

{SIMPLE_FOREST_TERRAIN  Hh*^Fmf          (C*,K*,X*,Ql*,Qx*,Gv*,W*,M*,*^V*)         forest/mixed-fall-sparse}
{SIMPLE_FOREST_TERRAIN  *^Fmf            (C*,K*,X*,Ql*,Qx*,Gv*,W*,M*,*^V*)         forest/mixed-fall}

{SIMPLE_FOREST_TERRAIN  Hh*^Fmw          (C*,K*,X*,Ql*,Qx*,Gv*,W*,M*,*^V*)         forest/mixed-winter-sparse}
{SIMPLE_FOREST_TERRAIN  *^Fmw            (C*,K*,X*,Ql*,Qx*,Gv*,W*,M*,*^V*)         forest/mixed-winter}

{SIMPLE_FOREST_TERRAIN  Ha*^Fma          (C*,K*,X*,Ql*,Qx*,Gv*,W*,M*,*^V*)         forest/mixed-winter-snow-sparse}
{SIMPLE_FOREST_TERRAIN  *^Fma            (C*,K*,X*,Ql*,Qx*,Gv*,W*,M*,*^V*)         forest/mixed-winter-snow}

{SIMPLE_OVERLAY_TERRAIN  *^Uf*           (C*,K*,X*,Ql*,Qx*,Gv*,W*,M*,Hd,*^V*)      forest/mushrooms}

# Great-tree
#33% 17% 50%
{OVERLAY_P               *^Fet                                  33                 forest/great-tree3}
{OVERLAY_P               *^Fet                                  25                 forest/great-tree2}
{OVERLAY_P               *^Fet                                  100                forest/great-tree1}

# Oasis
{OVERLAY_P               (*^Do,Do)                              30                 village/desert-oasis-1}
{OVERLAY_P               (*^Do,Do)                              43                 village/desert-oasis-2}
{OVERLAY_P               (*^Do,Do)                              100                village/desert-oasis-3}

# Swamp
{SIMPLE_OVERLAY_TERRAIN  Ss              (C*,K*,H*,M*,X*,Q*,A*)                    swamp/reed}
{SIMPLE_OVERLAY_TERRAIN  Chs             (!,Chs,Chw,Chr)                           swamp/reed}

# Mountains
{OVERLAY_RESTRICTED3     Mm              (C*,K*,X*,Ql,Qx*)                         mountains-castle-n}
{TRANSITION_RESTRICTED2  Mm              (C*,K*,X*,Ql,Qx*)                         mountains-castle}
{OVERLAY_RESTRICTED2     Mm              (C*,K*,X*,Ql,Qx*)                         mountains-castle-n}
{TRANSITION_RESTRICTED   Mm              (C*,K*,X*,Ql,Qx*)                         mountains-castle}

{MOUNTAINS_2x4_NW_SE     Mm                                     18        overlay  mountain_range3}
{MOUNTAINS_2x4_SW_NE     Mm                                     26        overlay  mountain_range4}

{MOUNTAINS_1x3_NW_SE     Mm                                     20        overlay  mountain_range1}
{MOUNTAINS_1x3_SW_NE     Mm                                     20        overlay  mountain_range2}

{MOUNTAINS_2x2           Mm                                     40        overlay  mountain5}
{MOUNTAINS_2x2           Mm                                     30        overlay  mountain6}

{MOUNTAIN_SINGLE         Mm                                     33        overlay  mountains3}
{MOUNTAIN_SINGLE         Mm                                     50        overlay  mountains2}
{MOUNTAIN_SINGLE         Mm                                     100       overlay  mountains}

# Snow mountains (uncomment rules as the corresponding tiles are added)
#{OVERLAY_RESTRICTED3     Ms              (C*,K*,X*,Ql,Qx*)                         snow-mountains-castle-n}
#{TRANSITION_RESTRICTED2  Ms              (C*,K*,X*,Ql,Qx*)                         snow-mountains-castle}
#{OVERLAY_RESTRICTED2     Ms              (C*,K*,X*,Ql,Qx*)                         snow-mountains-castle-n}
#{TRANSITION_RESTRICTED   Ms              (C*,K*,X*,Ql,Qx*)                         snow-mountains-castle}

#{MOUNTAINS_2x4_NW_SE     Ms                                     18        overlay  snow-mountain_range3}
#{MOUNTAINS_2x4_SW_NE     Ms                                     26        overlay  snow-mountain_range4}

#{MOUNTAINS_1x3_NW_SE     Ms                                     20        overlay  snow-mountain_range1}
#{MOUNTAINS_1x3_SW_NE     Ms                                     20        overlay  snow-mountain_range2}

{MOUNTAINS_2x2           Ms                                     15        overlay  snow-mountain5}
{MOUNTAINS_2x2           Ms                                     25        overlay  snow-mountain6}

{MOUNTAIN_SINGLE         Ms                                     33        overlay  snow-mountains3}
{MOUNTAIN_SINGLE         Ms                                     50        overlay  snow-mountains2}
{MOUNTAIN_SINGLE         Ms                                     100       overlay  snow-mountains}

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

{OVERLAY_LF              *^Xm                                         1   clouds1  cloud1_1}
{OVERLAY_LF              *^Xm                                         1   clouds2  cloud1_3}

#33% 33% 33%
{OVERLAY_PLF             *^Xm                                   33    1   clouds3  cloud1_2}
{OVERLAY_PLF             *^Xm                                   50    1   clouds3  cloud2_2}
{OVERLAY_LF              *^Xm                                         1   clouds3  cloud3_2}

{PEAKS_1x2_SW_NE         *^Xm                                   15        peaks    mountain_peak_range1}
{PEAKS_LARGE             *^Xm                                   25        peaks    mountain_peak_large1}
{PEAKS_LARGE             *^Xm                                   33        peaks    mountain_peak_large2}
{OVERLAY_RANDOM_LF       *^Xm                                         2   peaks    mountain_peak}

#
#       >  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'

#Human villages
{VILLAGE_RANDOM          *^Vh                                                      village/human}
{VILLAGE_RANDOM          *^Vha                                                     village/human-snow}

{VILLAGE                 *^Vhh                                                     village/human-hills}
{VILLAGE                 *^Vhha                                                    village/human-snow-hills}

{VILLAGE_RANDOM          *^Vhc                                                     village/human-city}

#tropical village
{VILLAGE_P               *^Vht                                  100                village/tropical-forest}

#Crude villages (grassland)
{VILLAGE_P               *^Vc                                   50                 village/hut}
{VILLAGE_P               *^Vc                                   100                village/hut2}

{VILLAGE_P               *^Vca                                  50                 village/hut-snow}
{VILLAGE_P               *^Vca                                  100                village/hut-snow2}

{VILLAGE_P               *^Vl                                   100                village/log-cabin}
{VILLAGE_P               *^Vla                                  100                village/log-cabin-snow}

{VILLAGE_P               *^Vct                                  50                 tent}
{VILLAGE_P               *^Vct                                  100                tent2}

#Drake villages
#20% 20% 20% 20% 20%
{VILLAGE_P              *^Vd                                    20                 village/drake1-1:100,village/drake1-2:100,village/drake1-3:100}
{VILLAGE_P              *^Vd                                    25                 village/drake2-1:100,village/drake2-2:100,village/drake2-3:100,village/drake2-4:100}
{VILLAGE_P              *^Vd                                    33                 village/drake3}
{VILLAGE_P              *^Vd                                    50                 village/drake4}
{VILLAGE_P              *^Vd                                    100                village/drake5}

#Orcish villages
#25% 25% 25% 25%
{VILLAGE_P              *^Vo                                    25                 village/orc1}
{VILLAGE_P              *^Vo                                    33                 village/orc2}
{VILLAGE_P              *^Vo                                    50                 village/orc3}
{VILLAGE_P              *^Vo                                    100                village/orc4}

{VILLAGE_P              *^Voa                                   25                 village/orc-snow1}
{VILLAGE_P              *^Voa                                   33                 village/orc-snow2}
{VILLAGE_P              *^Voa                                   50                 village/orc-snow3}
{VILLAGE_P              *^Voa                                   100                village/orc-snow4}

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

#10% 25% 25% 40%
{VILLAGE_P               *^Vea                                  10                 village/elven-snow}
{VILLAGE_P               *^Vea                                  28                 village/elven-snow3}
{VILLAGE_P               *^Vea                                  38                 village/elven-snow4}
{VILLAGE_P               *^Vea                                  100                village/elven-snow2}

#Desert villages
{VILLAGE_RANDOM          *^Vda                                                     village/desert}
{VILLAGE                 *^Vdt                                                     village/desert-camp}

#Cave villages
{VILLAGE_RANDOM          *^Vu                                                      village/cave}
{VILLAGE_RANDOM          *^Vud                                                     village/dwarven}

#Swamp village
{VILLAGE_RANDOM          *^Vhs                                                     village/swampwater}

#Merfolk village
{VILLAGE_P               *^Vm                                   20                 village/coast}
{VILLAGE_P               *^Vm                                   24                 village/coast2}
{VILLAGE_P               *^Vm                                   29                 village/coast3}
{VILLAGE_P               *^Vm                                   35                 village/coast4}
{VILLAGE_P               *^Vm                                   100                village/coast5-1:140,village/coast5-2:140,village/coast5-3:140,village/coast5-4:140}

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

#Farmland
{OVERLAY_RANDOM_L        *^Gvs                                        -10          flat/farm-veg-spring}

# Windmill decoration
{OVERLAY                 *^Wm                           ("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")}

#Rubble
{OVERLAY_RANDOM          *^Dr                                                      sand_rubble}

# Illuminated caves
{OVERLAY_RANDOM_LF       (*^Ufi,*^Ii)                                  1  light    cave/beam}

# Chasm bridges -  for now they don't tile
{OVERLAY_F               Qxu^Bs\                                          bridge   cave/chasm-stone-bridge-se-nw}
{OVERLAY_F               Qxu^Bs|                                          bridge   cave/chasm-stone-bridge-s-n}
{OVERLAY_F               Qxu^Bs/                                          bridge   cave/chasm-stone-bridge-sw-ne}

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

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

# Flat base terrains

#2% 2%
{TERRAIN_BASE_P          Gg^                                    2                  flat/grass-rocks1}
{TERRAIN_BASE_P          Gg^                                    2                  flat/grass-rocks2}
#10% 10% 10% 10% 10% 10% 10% 30%
{TERRAIN_BASE_P          Gg                                     10                 flat/grass-r1}
{TERRAIN_BASE_P          Gg                                     11                 flat/grass-r2}
{TERRAIN_BASE_P          Gg                                     13                 flat/grass-r3}
{TERRAIN_BASE_P          Gg                                     14                 flat/grass-r4}
{TERRAIN_BASE_P          Gg                                     17                 flat/grass-r5}
{TERRAIN_BASE_P          Gg                                     20                 flat/grass-r6}
{TERRAIN_BASE_P          Gg                                     25                 flat/grass-r7}
{TERRAIN_BASE            Gg                                                        flat/grass-r8}

{TERRAIN_BASE_RANDOM     Ggf                                                       flat/grass-flowers}

{TERRAIN_BASE_RANDOM     Gs^F*                                                     forest/floor}
{TERRAIN_BASE_RANDOM     Gs                                                        flat/savanna}

{TERRAIN_BASE_RANDOM     Re                                                        flat/dirt}

{TERRAIN_BASE_RANDOM     Rr                                                        flat/road}
{TERRAIN_BASE_RANDOM     Rp                                                        flat/stone-path}

# Hills base terrain
{TERRAIN_BASE_RANDOM     Hh                                                        hills-variation}

# Cave base terrains

{TERRAIN_BASE_RANDOM     Uu                                                        cave/floor}
{TERRAIN_BASE_RANDOM     Ur                                                        cave/path}
{TERRAIN_BASE_RANDOM     Uh                                                        cave/hills-variation}

{TERRAIN_BASE_RANDOM     Xu                                                        cave/wall-rough}

{TERRAIN_BASE            Qxu                                                       chasm}
{TERRAIN_BASE_RANDOM     Ql,Qlf                                                    lava}

# Desert base terrains

{TERRAIN_BASE_RANDOM     Dd                                                        desert}

# only use the smaller plant tiles when adjacent to castles, chasms etc
{OVERLAY_RESTRICTED_PF   Dd^    (C*,K*,Q*)                       5         overlay  desert-plant}
{OVERLAY_RESTRICTED_PF   Dd^    (C*,K*,Q*)                       5         overlay  desert-plant2}
{OVERLAY_RESTRICTED_PF   Dd^    (C*,K*,Q*)                       5         overlay  desert-plant3}
# and then any plant tile elsewhere
{OVERLAY_PF              Dd^                                   0.1         overlay  desert-plant}
{OVERLAY_PF              Dd^                                   0.1         overlay  desert-plant2}
{OVERLAY_PF              Dd^                                   0.1         overlay  desert-plant3}
{OVERLAY_PF              Dd^                                   0.1         overlay  desert-plant4}
{OVERLAY_PF              Dd^                                   0.1         overlay  desert-plant5}
{OVERLAY_PF              Dd^                                   0.1         overlay  desert-plant6}
{OVERLAY_PF              Dd^                                   0.1         overlay  desert-plant7}
{OVERLAY_PF              Dd^                                   0.1         overlay  desert-plant8}
{OVERLAY_PF              Dd^                                   0.1         overlay  desert-plant9}
{OVERLAY_PF              Dd^                                   0.1         overlay  desert-plant10}
{OVERLAY_PF              Dd^                                   0.1         overlay  desert-plant11}

#10% 10% 10% 70%
{TERRAIN_BASE_P          Ds                                     10                 sand-rock1}
{TERRAIN_BASE_P          Ds                                     11                 sand-rock2}
{TERRAIN_BASE_P          Ds                                     13                 sand-rock3}
{TERRAIN_BASE_RANDOM     Ds                                                        sand}

{TERRAIN_BASE            Rd                                                        desert-road}

{TERRAIN_BASE_F          *^Dc                                             overlay  desert_crater}

{TERRAIN_BASE_RANDOM     Hd                                                        desert-hills}
{TERRAIN_BASE_RANDOM     Md                                                        desert-mountains}

# Frozen base terrain

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

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

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

# Water base terrains

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

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

#33% 67%
{TERRAIN_BASE_P          Wwf                                    33                 water/ford2}
{TERRAIN_BASE            Wwf                                                       water/ford}

{TERRAIN_BASE_RANDOM     Wwr                                                       water/reef}

#8% 8% 8% 8% 23% 23% 23%
{TERRAIN_BASE_P          Ss                                     8                  swamp/water-flowers1}
{TERRAIN_BASE_P          Ss                                     9                  swamp/water-flowers2}
{TERRAIN_BASE_P          Ss                                     10                 swamp/water-plant1}
{TERRAIN_BASE_P          Ss                                     11                 swamp/water-plant2}
{TERRAIN_BASE_RANDOM     Ss                                                        swamp/water}

# Castle base terrains

{KEEP_BASE               (Ch,Chr,Kh*)                                              castle/cobbles}
{TERRAIN_BASE            Chw                                                       castle/sunken-ruin}
{TERRAIN_BASE_RANDOM     Chs                                                       swamp/water}

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

{KEEP_BASE               (Ce,Ke)                                                   castle/encampment-ground}
{OVERLAY_RANDOM          Ke                                                        tent}

{KEEP_BASE               Co                                                        castle/orcish/ground}
{KEEP_BASE               Ko                                                        castle/orcish/keep}

{TERRAIN_BASE_RANDOM     Cud                                                       castle/dwarven-castle-floor}
{TERRAIN_BASE            Kud                                                       castle/dwarven-keep-floor}
{OVERLAY                 Kud                                                       castle/dwarven-keep}

#{TERRAIN_BASE       ~                 fog}

#
#     >  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  <
#

#
# Human castle
#

{DISABLE_BASE_TRANSITIONS  (Ch,Kh*)}
{WALL_TRANSITION      Ch                 (!,Ch*,Kh*)                      castle/castle}
{WALL_TRANSITION2     Kh                 Ch*             (!,Ch*,Kh*)      castle/keep-castle}
{WALL_TRANSITION      Kh                 (!,Kh*)                          castle/keep}

# sunken/swamp ruins (submerged part)
# Show sunken graphics for sunken castle only when next to water terrain
# Show sunken graphics for sunken/swamp keep also when next to swamp

# (!,Chr,Chs,!,Ch*) is used to catch convex transitions between Chw and Ch* without lots of additional rules
# don't do this at home
#17% 17% 17% 17% 17% 17%
{WALL_TRANSITION_P    (!,Chr,Chs,!,Ch*)  (W*)                        17  castle/sunken-ruin5}
{WALL_TRANSITION_P    (!,Chr,Chs,!,Ch*)  (W*)                        20  castle/sunken-ruin4}
{WALL_TRANSITION_P    (!,Chr,Chs,!,Ch*)  (W*)                        25  castle/sunken-ruin3}
{WALL_TRANSITION_P    (!,Chr,Chs,!,Ch*)  (W*)                        33  castle/sunken-ruin2}
{WALL_TRANSITION_P    (!,Chr,Chs,!,Ch*)  (W*)                        50  castle/sunken-ruin1}
{WALL_TRANSITION      (!,Chr,Chs,!,Ch*)  (W*)                            castle/sunken-ruin}

{WALL_TRANSITION2_P   (Khw,Khs)          (Ch*)           (W*,Ss)     75  castle/sunken-ruinkeep1-castle}
{WALL_TRANSITION2_P   (Khw,Khs)          (Ch*)           (W*,Ss)     100 castle/sunkenkeep-castle}

{WALL_TRANSITION_P    (!,Khr,!,Kh*)      (W*,Ss,Chw,Chs)             75  castle/sunken-ruinkeep1}
{WALL_TRANSITION_P    (!,Khr,!,Kh*)      (W*,Ss,Chw,Chs)             100 castle/sunkenkeep}

# ruined castle and non-sumberged parts of sunken/swamp ruins

# There are no more human castles left, so we can just use Ch* here, which makes sure
# that all ruin<->non-ruin transitions are drawn
#17% 17% 17% 17% 17% 17%
{WALL_TRANSITION_P    Ch*                (!,Ch*,Kh*)                 17  castle/ruin5}
{WALL_TRANSITION_P    Ch*                (!,Ch*,Kh*)                 20  castle/ruin4}
{WALL_TRANSITION_P    Ch*                (!,Ch*,Kh*)                 25  castle/ruin3}
{WALL_TRANSITION_P    Ch*                (!,Ch*,Kh*)                 33  castle/ruin2}
{WALL_TRANSITION_P    Ch*                (!,Ch*,Kh*)                 50  castle/ruin1}
{WALL_TRANSITION      Ch*                (!,Ch*,Kh*)                     castle/castle}

{WALL_TRANSITION2_P   (Khr,Khw,Khs)      (Ch*)           (!,Ch*,Kh*) 75  castle/ruinkeep1-castle}
{WALL_TRANSITION2     (Khr,Khw,Khs)      (Ch*)           (!,Ch*,Kh*)     castle/keep-castle}

{WALL_TRANSITION_P    Kh*                (!,Kh*)                     75  castle/ruinkeep1}
{WALL_TRANSITION      Kh*                (!,Kh*)                         castle/keep}

# Elven castle
{DISABLE_BASE_TRANSITIONS  (Cv,Kv)}

{WALL_TRANSITION      Cv                 (!,Cv,Kv)                        castle/elven/castle}
{WALL_TRANSITION2     Kv                 Cv              (!,Cv,Kv*)       castle/elven/keep-castle}
{WALL_TRANSITION      Kv                 (!,Kv)                           castle/elven/keep}

# Encampment
{DISABLE_BASE_TRANSITIONS  (Ce,Ke)}
{WALL_TRANSITION      (Ce,Ke)            (!,Ce,Ke)                       castle/encampment}

# Orcish castle
{DISABLE_BASE_TRANSITIONS  (Co,Ko)}

{WALL_TRANSITION      Co                 (!,Co,Ko)                        castle/orcish/fort}
{WALL_TRANSITION2     Ko                 Co              (!,Co,Ko*)       castle/orcish/keep-fort}
{WALL_TRANSITION      Ko                 (!,Ko)                           castle/orcish/keep}

#
# Cave
# (including dwarven castle, chasm, lava)
#

{DISABLE_BASE_TRANSITIONS  Qxu}
{DISABLE_BASE_TRANSITIONS  Ql}
{DISABLE_BASE_TRANSITIONS  Xu}
{DISABLE_BASE_TRANSITIONS  (Cud,Kud)}

#dwarven castle transitions
{WALL_TRANSITION3     (Cud,Kud)        Ql                  Qxu                dcastle-lava-chasm}

{WALL_TRANSITION2     (Cud,Kud)        X*                 (!,Cud,Kud,X*)      castle/dwarven-castle-wall}
{WALL_TRANSITION2     (Cud,Kud)        Ql                 (!,Cud,Kud,Ql)      dcastle-lava}
{WALL_TRANSITION2     (Cud,Kud)        Qxu                (!,Cud,Kud,Qxu)     dcastle-chasm}

{WALL_TRANSITION      (Cud,Kud)        (!,Cud,Kud)                            castle/dwarven-castle}

{WALL_TRANSITION      Xu               (Qx*,Ql)                               cave/wall-rough-chasm}
{WALL_TRANSITION      Xu               (!,Xu)                                 cave/wall-rough}

#chasm/lava transitions always below castles/walls
{WALL_TRANSITION2_LF  Ql               Qxu                (!,Ql,Qxu)     -90  ground  lava-chasm}
{WALL_TRANSITION_LF   Ql               (!,Ql)                            -90  ground  lava}
{WALL_TRANSITION_LF   Qxu              (!,Qxu)                           -90  ground  chasm}

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

# The order mostly controls which overlap which, some
# TRANSITION_BASE_Ls and varying layer numbers are used to make some
# special transitions to layer in more complex ways.
# Default layer ist -500, so anything layering above should be higer.

{TRANSITION_BASE_L     (!,Chr,Chw)      Chr                         -150               flat/grass}

{TRANSITION_BASE_L     Md               (!,Md,Qxu)                  -160               desert-mountains}

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

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

{TRANSITION_BASE_L     Qlf              (!,Ql,Qlf,Qxu,X*)           -210               lava}
{TRANSITION_BASE_L     (Uu,Uh)          (!,Uu,Uh)                   -220               cave/floor}
{TRANSITION_BASE_L     Ur               (!,Ur)                      -221               cave/floor}
{TRANSITION_BASE_LF    (!,Ur)           Ur                          -222  transition2  cave/floor}

{TRANSITION_BASE_L     Aa               (W*,Ss)                     -240               snow-to-water}
{TRANSITION_BASE_L     Aa               (!,Aa,Qxu)                  -241               snow}

{TRANSITION_BASE_L     (Ss,Chs)         (!,Ss,Chs,H*,M*,A*)         -250               swamp/water}

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

{TRANSITION_BASE_L   (Gg*,Qxu,Mm,Ms,Hh) W*                          -260               flat/grass-to-water}
{TRANSITION_BASE_L     (Gg*,Qxu)        (!,Gg*,Qxu,Mm,Ms,Hh)        -270               flat/grass}
{TRANSITION_BASE_LF    (!,Ggf)          Ggf                   -271  flower-transition  flat/grass}

{TRANSITION_BASE_L     Gs^F*            (W*,Ss)                     -278               forest/floor-to-water}
{TRANSITION_BASE_L     Gs^F*            (!,Gs^F*,Qxu)               -279               forest/floor}
{TRANSITION_BASE_L     Gs               (W*,Ss)                     -280               flat/savanna-to-water}
{TRANSITION_BASE_L     Gs               (!,Gs,Qxu)                  -290               flat/savanna}
{TRANSITION_BASE_L     Rr               (!,Rr)                      -300               flat/road}
{TRANSITION_BASE_L     Rp               (!,Rp)                      -310               flat/stone-path}
{TRANSITION_BASE_LF    *^Gvs          (!,*^Gvs,C*,K*,*^F*,M*,H*,W*) -320  transition2  flat/farm-veg-spring}

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

{TRANSITION_BASE_L     Ds               (!,Ds)                      -330               sand}

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

{TRANSITION_BASE_L     Dd               (Dd^V*)                     -340               desert}
{TRANSITION_BASE_L     Rd               (Dd^V*)                     -350               desert-road}
{TRANSITION_BASE_L     Rd               (!,Rd,Dd)                   -351               desert-road}
{TRANSITION_BASE_L     Dd               (!,R*,Dd)                   -360               desert}
{TRANSITION_BASE_L     Dd               R*                          -361               desert}

{TRANSITION_BASE_LF    (!,Re)           Re                          -379  transition3  flat/dirt}
{TRANSITION_BASE_L     Re               (!,Re)                      -380               flat/dirt}

{TRANSITION_BASE_LF    (!,Chw,Khw,Khs,!,C*,K*)            (Ai,W*)     -480 non_submerged_part castle/castle-to-ice}
{TRANSITION_BASE_LF    Aa,Ha,Ms,Ai                        (W*,Ss)     -490 non_submerged_part ice}
{TRANSITION_BASE_LF    Aa,Ha,Ms,Ai                        (W*,Ss)     -505 submerged_part     ice-to-water}
# we just draw this again (invisible below the base layer) to set the transition flags
{TRANSITION_BASE_L     Aa,Ha,Ms,Ai                        (W*,Ss)     -1001                   ice-to-water}
{TRANSITION_BASE_LF    (!,Chw,Khw,Khs,!,C*,K*)            W*          -510 submerged_part     castle/castle-to-water}

# Water Transitions below everything else

{TRANSITION_BASE_L     (Ww,Wwr)         (!,Ww,Wwr,Mm,Ms,Wwf)          -520               water/coast}
{TRANSITION_BASE_L     Wwf              (!,Wwf)                       -530               water/ford}
{TRANSITION_BASE_L     Wo               (!,Wo)                        -540               water/ocean}
#WARNING : castles are at layer -1, probably to be fixed in 1.9 time
{TRANSITION_BASE_LF    Chw              (Ch,Chr)                      0     transition2  castle/sunken-ruin}
{TRANSITION_BASE_LF    Chs              (Ch,Chr)                      0     transition2  swamp/water}
{TRANSITION_BASE_L     Chw              (!,Chw,Chr)                   -570               water/coast}
 
# ugly fillups for missing transitions
{TRANSITION_BASE_L	Ai		_off^_usr			      -800		ice}

# Default terrain
{TERRAIN_BASE _s void}
{TERRAIN_BASE *  void}
