Adding macros so that keep graphics are now selected...

...according to the adjacent castle tiles.
This commit is contained in:
Philippe Plantier 2004-06-10 21:56:51 +00:00
parent a59ebc38ee
commit 1ddec66add
3 changed files with 39 additions and 4 deletions

View file

@ -76,11 +76,15 @@
# Special transitions go first
# Castle and keeps
{CASTLE_AND_KEEP C K castle keep}
# Castle and keeps. Always use the same letter for keeps: the CASTLE_AND_KEEP
# macro will determine the correct graphics to use, according to the adjacent
# castle letter.
# Encampment sample
#{CASTLE_WALLS nK !nK encampment}
#define KEEP_TILE
K
#enddef
{CASTLE_AND_KEEP C {KEEP_TILE} castle keep}
{CASTLE_AND_KEEP e {KEEP_TILE} encampment tent}
# Forest, hills and mountains should always overlay on northern sides
{TERRAIN_ADJACENT_NORTH m mountains}

View file

@ -62,6 +62,9 @@
# dynamically-drawn keeps.
#define CASTLE_AND_KEEP CASTLE KEEP CASTLE_IMAGE KEEP_IMAGE
# Keep rules will only work if the keep is adjacent to a castle tile.
{FLAG_IF_ADJACENT {KEEP} {CASTLE} keep-of-{CASTLE}}
{CASTLE_WALLS {CASTLE} !{CASTLE}{KEEP} {CASTLE_IMAGE}}
{DISABLE_TRANSITIONS {KEEP}}
@ -73,6 +76,7 @@
[tile]
pos=1
type={KEEP}
has_flag=keep-of-{CASTLE}
[/tile]
[tile]
pos=2
@ -99,6 +103,7 @@
[tile]
pos=1
type={KEEP}
has_flag=keep-of-{CASTLE}
[/tile]
[tile]
pos=3
@ -126,6 +131,7 @@
[tile]
pos=1
type={KEEP}
has_flag=keep-of-{CASTLE}
[/tile]
[tile]
pos=2
@ -157,6 +163,7 @@
[tile]
pos=1
type={KEEP}
has_flag=keep-of-{CASTLE}
[/tile]
[tile]
pos=2

View file

@ -42,4 +42,28 @@
[/terrain_graphics]
#enddef
# This utility macro sets a flag on a given terrain, if it is adjacent to an
# other terrain.
# Example:
# {FLAG_IF_ADJACENT K C keep-of-castle} makes flags all K tiles adjacent to C
# tiles with the keep-of-castle flag
#
# Use this to make other rule depend on adjacent terrain
#define FLAG_IF_ADJACENT LETTER ADJACENT FLAG
[terrain_graphics]
[tile]
x=0
y=0
type={LETTER}
set_flag={FLAG}
[/tile]
[tile]
x=0
y=1
type={ADJACENT}
[/tile]
rotations=x,x,x,x,x,x
[/terrain_graphics]
#enddef