Improved connections between different castles

Fixes the hard cut in the middle of horizontal walls between different castle types. This reworks NEW:CASTLEWALL and other related macros quite a bit. Removed NEW:CASTLEWALL_INTERNAL_OPEN_ENDS and moved its contents directly into NEW:CASTLEWALL.
This commit is contained in:
ln-zookeeper 2016-12-24 00:25:04 +02:00
parent eb61ca0673
commit 5c6902f3a8
2 changed files with 277 additions and 211 deletions

View file

@ -599,14 +599,14 @@
# Aquatic camp
{NEW:CASTLEWALL (Kme,Cme) (!,C*,K*,X*) X* castle/aquatic-camp/castle}
{AQUATIC:CAMPS Kme Cme castle/aquatic-camp}
{NEW:CASTLEWALL (Kme,Cme) (!,C*,K*,X*) C* castle/aquatic-camp/castle}
{AQUATIC:CAMPS Kme Cme,Cm,Km castle/aquatic-camp}
# Aquatic castle
{NEW:CASTLEWALL Cm (!,C*,K*,X*) X* castle/aquatic-castle/castle}
{NEW:CASTLEWALL2 Km !,Ket,!,C*,Ke* (!,C*,K*,X*) castle/aquatic-castle/keep-castle}
{NEW:CASTLEWALL Km (!,Km,X*) X* castle/aquatic-castle/keep}
{NEW:CASTLEWALL Cm (!,C*,K*,X*) C* castle/aquatic-castle/castle}
{NEW:CASTLEWALL2 Km !,Ket,!,C*,Ke* (!,C*,K*,X*) castle/aquatic-castle/keep-castle}
{NEW:CASTLEWALL Km (!,Km,X*) K* castle/aquatic-castle/keep}
# disable the next line to get the brown bank transition. It adds more images to the hex though.
{DISABLE_BASE_TRANSITIONS_F (Km,Cm) non_submerged}
@ -619,43 +619,43 @@
# Elven castle
{NEW:CASTLEWALL Cv (!,C*,K*,X*) X* castle/elven/castle}
{NEW:CASTLEWALL2 Kv !,Ket,!,C*,Ke* (!,C*,K*,X*) castle/elven/keep-castle}
{NEW:CASTLEWALL Kv (Ke,Kea,!,K*,X*) X* castle/elven/keep}
{NEW:CASTLEWALL Cv (!,C*,K*,X*) C* castle/elven/castle}
{NEW:CASTLEWALL2 Kv !,Ket,!,C*,Ke* (!,C*,K*,X*) castle/elven/keep-castle}
{NEW:CASTLEWALL Kv (!,K*,X*) K* castle/elven/keep}
# Orcish castles
{NEW:CASTLEWALL Co,Cv (!,C*,K*,X*) X* castle/orcish/fort}
{NEW:CASTLEWALL2 Ko,Kv !,Ket,!,C*,Ke* (!,C*,K*,X*) castle/orcish/keep-fort}
{NEW:CASTLEWALL Ko,Kv (!,K*,X*) X* castle/orcish/keep}
{NEW:CASTLEWALL Co (!,C*,K*,X*) C* castle/orcish/fort}
{NEW:CASTLEWALL2 Ko !,Ket,!,C*,Ke* (!,C*,K*,X*) castle/orcish/keep-fort}
{NEW:CASTLEWALL Ko (!,K*,X*) K* castle/orcish/keep}
{NEW:CASTLEWALL (Co*,Cv) (!,C*,K*,X*) X* castle/winter-orcish/fort}
{NEW:CASTLEWALL2 (Ko*,Kv) !,Ket,!,C*,Ke* (!,C*,K*,X*) castle/winter-orcish/keep-fort}
{NEW:CASTLEWALL (Ko*,Kv) (Ke,Kea,!,K*,X*) X* castle/winter-orcish/keep}
{NEW:CASTLEWALL Coa (!,C*,K*,X*) C* castle/winter-orcish/fort}
{NEW:CASTLEWALL2 Koa !,Ket,!,C*,Ke* (!,C*,K*,X*) castle/winter-orcish/keep-fort}
{NEW:CASTLEWALL Koa (Ke,Kea,!,K*,X*) K* castle/winter-orcish/keep}
# Desert castles
{NEW:CASTLEWALL Cd,Cv,Co* (!,C*,K*,X*) X* castle/sand/castle}
{NEW:CASTLEWALL2 Kd,Kv,Ko* !,Ket,!,C*,Ke* (!,C*,K*,X*) castle/sand/keep-castle}
{NEW:CASTLEWALL Kd,Ko*,Kv (!,K*,X*) X* castle/sand/keep}
{NEW:CASTLEWALL Cd (!,C*,K*,X*) C* castle/sand/castle}
{NEW:CASTLEWALL2 Kd !,Ket,!,C*,Ke* (!,C*,K*,X*) castle/sand/keep-castle}
{NEW:CASTLEWALL Kd (!,K*,X*) K* castle/sand/keep}
{NEW:CASTLEWALL Cd*,Cv,Co* (!,C*,K*,X*) X* castle/sand/ruin-castle}
{NEW:CASTLEWALL2 Kdr,Kv,Ko* !,Ket,!,C*,Ke* (!,C*,K*,X*) castle/sand/ruin-keep-castle}
{NEW:CASTLEWALL Kd*,Ko*,Kv (Ke,Kea,!,K*,X*) X* castle/sand/ruin-keep}
{NEW:CASTLEWALL Cdr (!,C*,K*,X*) C* castle/sand/ruin-castle}
{NEW:CASTLEWALL2 Kdr !,Ket,!,C*,Ke* (!,C*,K*,X*) castle/sand/ruin-keep-castle}
{NEW:CASTLEWALL Kdr (Ke,Kea,!,K*,X*) K* castle/sand/ruin-keep}
#
# Human castles
#
{NEW:CASTLEWALL Ch,Cv,Co,Cd (!,C*,K*,X*) X* castle/castle}
{NEW:CASTLEWALL2 Kh,Kv,Ko,Kd !,Ket,!,C*,Ke* (!,C*,K*,X*) castle/keep-castle}
{NEW:CASTLEWALL Kh,Kd*,Ko,Kv (!,K*,X*) X* castle/keep}
{NEW:CASTLEWALL Ch (!,C*,K*,X*) C* castle/castle}
{NEW:CASTLEWALL2 Kh !,Ket,!,C*,Ke* (!,C*,K*,X*) castle/keep-castle}
{NEW:CASTLEWALL Kh (!,K*,X*) K* castle/keep}
{NEW:CASTLEWALL Ch,Cha,Coa (!,C*,K*,X*) X* castle/snowy/castle}
{NEW:CASTLEWALL2 Kh,Kha,Koa !,Ket,!,C*,Ke* (!,C*,K*,X*) castle/snowy/keep-castle}
{NEW:CASTLEWALL Kh,Kha,Kd*,Ko*,Kv (Ke,Kea,!,K*,X*) X* castle/snowy/keep}
{NEW:CASTLEWALL Cha (!,C*,K*,X*) C* castle/snowy/castle}
{NEW:CASTLEWALL2 Kha !,Ket,!,C*,Ke* (!,C*,K*,X*) castle/snowy/keep-castle}
{NEW:CASTLEWALL Kha (Ke,Kea,!,K*,X*) K* castle/snowy/keep}
# sunken/swamp ruins (submerged part)
@ -664,32 +664,32 @@
# (!,Chr,Chs,!,Ch*) is used to catch convex transitions between Chw and Ch*
# without lots of additional rules
{NEW:CASTLEWALL (!,Chr,Chs,Ce*,Ke*,!,Ch*) (W*) X* castle/sunken-ruin}
{NEW:CASTLEWALL (!,Chr,Chs,Ce*,Ke*,!,Ch*) (W*) C* castle/sunken-ruin}
{NEW:CASTLEWALL2_P Khw,Khs Ch* W*,Ss 75 castle/sunken-ruinkeep1-castle}
{NEW:CASTLEWALL2 Khw,Khs Ch* W*,Ss castle/sunkenkeep-castle}
{NEW:CASTLEWALL2_P Khw,Khs Ch* W*,Ss 75 castle/sunken-ruinkeep1-castle}
{NEW:CASTLEWALL2 Khw,Khs Ch* W*,Ss castle/sunkenkeep-castle}
{NEW:CASTLEWALL_P (!,Khr,!,Kh*) W*,Ss,Chw,Chs X* 75 castle/sunken-ruinkeep1}
{NEW:CASTLEWALL (!,Khr,!,Kh*) W*,Ss,Chw,Chs X* castle/sunkenkeep}
{NEW:CASTLEWALL (!,Khr,!,Kh*) W*,Ss,Chw,Chs K* castle/sunken-ruinkeep1 PROB=75}
{NEW:CASTLEWALL (!,Khr,!,Kh*) W*,Ss,Chw,Chs K* castle/sunkenkeep}
# ruined castle and non-submerged 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
{NEW:CASTLEWALL Ch*,Cd*,Cv,Co* (!,C*,K*,X*) X* castle/ruin}
{NEW:CASTLEWALL Ch* (!,C*,K*,X*) C* castle/ruin}
{NEW:CASTLEWALL2_P (Khr,Khw,Khs) (C*) (!,Ch*,Kh*,X*) 75 castle/ruinkeep1-castle}
{NEW:CASTLEWALL2 (Khr,Khw,Khs) (C*) (!,Ch*,Kh*,X*) castle/keep-castle}
{NEW:CASTLEWALL2_P (Khr,Khw,Khs) (C*) (!,Ch*,Kh*,X*) 75 castle/ruinkeep1-castle}
{NEW:CASTLEWALL2 (Khr,Khw,Khs) (C*) (!,Ch*,Kh*,X*) castle/keep-castle}
{NEW:CASTLEWALL_P Kh*,Kd*,Ko*,Kv (Ke,Kea,!,K*,X*) X* 75 castle/ruinkeep1}
{NEW:CASTLEWALL Kh*,Kd*,Ko*,Kv (Ke,Kea,!,K*,X*) X* castle/keep}
{NEW:CASTLEWALL Kh* (Ke,Kea,!,K*,X*) K* castle/ruinkeep1 PROB=75}
{NEW:CASTLEWALL Kh* (Ke,Kea,!,K*,X*) K* castle/keep}
# Encampment
{NEW:CASTLEWALL2 !,Ke,Kea,Kud,Kme,!,K* (Ke,Kea,C*) (!,C*,K*,X*) castle/encampment/tall-keep-castle}
{NEW:CASTLEWALL !,Ke,Kea,Kud,Kme,!,K* (Ke,Kea,!,K*,X*) X* castle/encampment/tall-keep}
{NEW:CASTLEWALL (!,Cud,Cea,Coa,Cha,Kud,Kea,Koa,Kha,Kme,!,C*,K*) (!,C*,K*,X*) X* castle/encampment/regular}
{NEW:CASTLEWALL (!,Cud,Kud,Kme,!,C*,K*) (!,C*,K*,X*) X* castle/encampment/snow}
{NEW:CASTLEWALL Ce,Ke (!,C*,K*,X*) C* castle/encampment/regular}
{NEW:CASTLEWALL Cea,Kea (!,C*,K*,X*) C* castle/encampment/snow}
{NEW:CASTLEWALL2 Ket (C*) (!,C*,K*,X*) castle/encampment/tall-keep-castle}
{NEW:CASTLEWALL Ket (!,K*,X*) K* castle/encampment/tall-keep}
# Castle & Encampment Base Transtions

View file

@ -1193,174 +1193,6 @@ transition#endarg
{NEW:WALL2_P {TERRAINLIST} {ADJACENT1} {ADJACENT2} 100 {LAYER} {IMAGESTEM}}
#enddef
#define NEW:CASTLEWALL_INTERNAL_OPEN_ENDS TERRAINLIST ADJACENT ADJACENT_OPEN IMAGESTEM
# These rules place towers to fill gaps between the rest of the castle and
# ADJACENT_OPEN neighbours. It didn't seem to be possible to do this in a
# less hacky and verbose manner due to layering problems.
[terrain_graphics]
map="
2
, 3
1"
[tile]
pos=1
type={TERRAINLIST}
set_no_flag=castlewall1-@R0
[/tile]
[tile]
pos=2
type={ADJACENT_OPEN}
[/tile]
[tile]
pos=3
type={ADJACENT}
[/tile]
rotations=concave-l,convex-r,skip,skip,concave-br,concave-bl
[image]
layer=0
base=54,107
name={IMAGESTEM}@V-@R0.png
variations=";2;3;4;5;6"
[/image]
[/terrain_graphics]
[terrain_graphics]
map="
2
, 3
1"
[tile]
pos=1
type={TERRAINLIST}
set_no_flag=castlewall2-@R0
[/tile]
[tile]
pos=2
type={ADJACENT}
[/tile]
[tile]
pos=3
type={ADJACENT_OPEN}
[/tile]
rotations=concave-br,skip,convex-br,skip,skip,concave-r
[image]
layer=0
base=54,107
name={IMAGESTEM}@V-@R0.png
variations=";2;3;4;5;6"
[/image]
[/terrain_graphics]
[terrain_graphics]
map="
2
, 3
1"
[tile]
pos=1
type={TERRAINLIST}
set_no_flag=castlewall3-@R0
[/tile]
[tile]
pos=2
type={ADJACENT}
[/tile]
[tile]
pos=3
type={ADJACENT_OPEN}
[/tile]
rotations=skip,concave-bl,skip,convex-bl,skip,skip
[image]
layer=0
base=54,71
name={IMAGESTEM}@V-@R0.png
variations=";2;3;4;5;6"
[/image]
[/terrain_graphics]
[terrain_graphics]
map="
2
, 3
1"
[tile]
pos=1
type={ADJACENT}
[/tile]
[tile]
pos=2
type={ADJACENT_OPEN}
[/tile]
[tile]
pos=3
type={TERRAINLIST}
set_no_flag=castlewall4-convex-l
[/tile]
[image]
layer=0
base=54,107
name={IMAGESTEM}@V-convex-l.png
variations=";2;3;4;5;6"
[/image]
[/terrain_graphics]
[terrain_graphics]
map="
2
, 3
1"
[tile]
pos=1
type={ADJACENT}
[/tile]
[tile]
pos=2
type={TERRAINLIST}
set_no_flag=castlewall5-convex-br
[/tile]
[tile]
pos=3
type={ADJACENT_OPEN}
[/tile]
[image]
layer=0
base=54,107
name={IMAGESTEM}@V-convex-br.png
variations=";2;3;4;5;6"
[/image]
[/terrain_graphics]
[terrain_graphics]
map="
, 2
1
, 3"
[tile]
pos=1
type={ADJACENT}
[/tile]
[tile]
pos=2
type={TERRAINLIST}
set_no_flag=castlewall6-convex-bl
[/tile]
[tile]
pos=3
type={ADJACENT_OPEN}
[/tile]
[image]
layer=0
base=54,107
name={IMAGESTEM}@V-convex-bl.png
variations=";2;3;4;5;6"
[/image]
[/terrain_graphics]
#enddef
#define NEW:CASTLEWALL_INTERNAL_P TERRAINLIST ADJACENT PROB IMAGESTEM
[terrain_graphics]
map="
@ -1428,11 +1260,245 @@ transition#endarg
#define NEW:CASTLEWALL_P TERRAINLIST ADJACENT ADJACENT_OPEN PROB IMAGESTEM
{NEW:CASTLEWALL_INTERNAL_P {TERRAINLIST} {ADJACENT} {PROB} {IMAGESTEM}}
{NEW:CASTLEWALL_INTERNAL_OPEN_ENDS {TERRAINLIST} {ADJACENT} {ADJACENT_OPEN} {IMAGESTEM}}
#enddef
#define NEW:CASTLEWALL TERRAINLIST ADJACENT ADJACENT_OPEN IMAGESTEM
{NEW:CASTLEWALL_P {TERRAINLIST} {ADJACENT} {ADJACENT_OPEN} 100 {IMAGESTEM}}
#define NEW:CASTLEWALL TERRAINLIST ADJACENT ADJACENT_JOIN IMAGESTEM
#arg PROB
100#endarg
#arg FLAG
castlewall#endarg
#arg ADJACENT_OPEN
X*#endarg
{NEW:CASTLEWALL_INTERNAL_P {TERRAINLIST} {ADJACENT} {PROB} {IMAGESTEM}}
# These two rules place suitable connecting tiles at corners where the wall
# meets another castle type's wall.
[terrain_graphics]
map="
2
, 3
1"
[tile]
pos=1
type={TERRAINLIST}
set_no_flag={FLAG}-@R0
[/tile]
[tile]
pos=2
type={ADJACENT}
[/tile]
[tile]
pos=3
type=!,{TERRAINLIST},!,{ADJACENT_JOIN}
[/tile]
rotations=concave-br,skip,skip,concave-tl,skip,concave-r
[image]
layer=0
base=54,107
name={IMAGESTEM}@V-@R0.png
variations=";2;3;4;5;6"
[/image]
[/terrain_graphics]
[terrain_graphics]
map="
2
, 3
1"
[tile]
pos=1
type={TERRAINLIST}
set_no_flag={FLAG}-@R0
[/tile]
[tile]
pos=2
type=!,{TERRAINLIST},!,{ADJACENT_JOIN}
[/tile]
[tile]
pos=3
type={ADJACENT}
[/tile]
rotations=concave-l,skip,concave-tr,skip,skip,concave-bl
[image]
layer=0
base=54,107
name={IMAGESTEM}@V-@R0.png
variations=";2;3;4;5;6"
[/image]
[/terrain_graphics]
# These rules place towers to fill gaps between the rest of the castle and
# ADJACENT_OPEN neighbours. It didn't seem to be possible to do this in a
# less hacky and verbose manner due to layering problems.
[terrain_graphics]
map="
2
, 3
1"
[tile]
pos=1
type={TERRAINLIST}
set_no_flag={FLAG}-end-@R0
[/tile]
[tile]
pos=2
type={ADJACENT_OPEN}
[/tile]
[tile]
pos=3
type={ADJACENT}
[/tile]
rotations=concave-l,convex-r,skip,skip,concave-br,concave-bl
[image]
layer=0
base=54,107
name={IMAGESTEM}@V-@R0.png
variations=";2;3;4;5;6"
[/image]
[/terrain_graphics]
[terrain_graphics]
map="
2
, 3
1"
[tile]
pos=1
type={TERRAINLIST}
set_no_flag={FLAG}-end-@R0
[/tile]
[tile]
pos=2
type={ADJACENT}
[/tile]
[tile]
pos=3
type={ADJACENT_OPEN}
[/tile]
rotations=concave-br,skip,convex-br,skip,skip,concave-r
[image]
layer=0
base=54,107
name={IMAGESTEM}@V-@R0.png
variations=";2;3;4;5;6"
[/image]
[/terrain_graphics]
[terrain_graphics]
map="
2
, 3
1"
[tile]
pos=1
type={TERRAINLIST}
set_no_flag={FLAG}-end-@R0
[/tile]
[tile]
pos=2
type={ADJACENT}
[/tile]
[tile]
pos=3
type={ADJACENT_OPEN}
[/tile]
rotations=skip,concave-bl,skip,convex-bl,skip,skip
[image]
layer=0
base=54,71
name={IMAGESTEM}@V-@R0.png
variations=";2;3;4;5;6"
[/image]
[/terrain_graphics]
[terrain_graphics]
map="
2
, 3
1"
[tile]
pos=1
type={ADJACENT}
[/tile]
[tile]
pos=2
type={ADJACENT_OPEN}
[/tile]
[tile]
pos=3
type={TERRAINLIST}
set_no_flag={FLAG}-end-convex-l
[/tile]
[image]
layer=0
base=54,107
name={IMAGESTEM}@V-convex-l.png
variations=";2;3;4;5;6"
[/image]
[/terrain_graphics]
[terrain_graphics]
map="
2
, 3
1"
[tile]
pos=1
type={ADJACENT}
[/tile]
[tile]
pos=2
type={TERRAINLIST}
set_no_flag={FLAG}-end-convex-br
[/tile]
[tile]
pos=3
type={ADJACENT_OPEN}
[/tile]
[image]
layer=0
base=54,107
name={IMAGESTEM}@V-convex-br.png
variations=";2;3;4;5;6"
[/image]
[/terrain_graphics]
[terrain_graphics]
map="
, 2
1
, 3"
[tile]
pos=1
type={ADJACENT}
[/tile]
[tile]
pos=2
type={TERRAINLIST}
set_no_flag={FLAG}-end-convex-bl
[/tile]
[tile]
pos=3
type={ADJACENT_OPEN}
[/tile]
[image]
layer=0
base=54,107
name={IMAGESTEM}@V-convex-bl.png
variations=";2;3;4;5;6"
[/image]
[/terrain_graphics]
#enddef
#define NEW:CASTLEWALL2_P TERRAINLIST ADJACENT1 ADJACENT2 PROB IMAGESTEM