From 2519c43d6159be13dfd47ddc915f65f4c8c34110 Mon Sep 17 00:00:00 2001 From: ln-zookeeper Date: Fri, 23 Dec 2016 13:11:06 +0200 Subject: [PATCH] Supersede probability/animation village macros with optional arguments --- data/core/terrain-graphics.cfg | 12 ++--- data/core/terrain-graphics/new-macros.cfg | 58 ++++++----------------- 2 files changed, 21 insertions(+), 49 deletions(-) diff --git a/data/core/terrain-graphics.cfg b/data/core/terrain-graphics.cfg index 5e58da7036df..5529056ece41 100644 --- a/data/core/terrain-graphics.cfg +++ b/data/core/terrain-graphics.cfg @@ -321,10 +321,10 @@ #Drake villages #20% 20% 20% 20% 20% -{NEW:VILLAGE_A3 *^Vd 200 village/drake1-A}{VILLAGE_PROBABILITY 20} -{NEW:VILLAGE_A3 *^Vd 100 village/drake2-A}{VILLAGE_PROBABILITY 25} -{NEW:VILLAGE *^Vd village/drake3}{VILLAGE_PROBABILITY 33} -{NEW:VILLAGE *^Vd village/drake4}{VILLAGE_PROBABILITY 50} +{NEW:VILLAGE *^Vd village/drake1-A PROB=20 ANIM=[01~03] TIME=200} +{NEW:VILLAGE *^Vd village/drake2-A PROB=25 ANIM=[01~03] TIME=100} +{NEW:VILLAGE *^Vd village/drake3 PROB=33} +{NEW:VILLAGE *^Vd village/drake4 PROB=50} {NEW:VILLAGE *^Vd village/drake5} #Orcish villages @@ -362,8 +362,8 @@ # {NEW:VILLAGE *^Vm village/coast2}{VILLAGE_PROBABILITY 24} # {NEW:VILLAGE *^Vm village/coast3}{VILLAGE_PROBABILITY 29} # {NEW:VILLAGE *^Vm village/coast4}{VILLAGE_PROBABILITY 35} -{NEW:VILLAGE_TOD_P *^Vm 80 village/coast} -{NEW:VILLAGE_A4 *^Vm 140 village/coast_5-A} +{NEW:VILLAGE_TOD_P *^Vm 80 village/coast} +{NEW:VILLAGE *^Vm village/coast_5-A ANIM=[01~04] TIME=140} # # > O V E R L A Y S < diff --git a/data/core/terrain-graphics/new-macros.cfg b/data/core/terrain-graphics/new-macros.cfg index 43538278a1b5..89dacb13140a 100644 --- a/data/core/terrain-graphics/new-macros.cfg +++ b/data/core/terrain-graphics/new-macros.cfg @@ -1859,6 +1859,16 @@ transition#endarg #enddef #define NEW:VILLAGE TERRAINLIST IMAGESTEM + +#arg PROB +100#endarg + +#arg ANIM +#endarg + +#arg TIME +#endarg + [terrain_graphics] map=" , * @@ -1873,8 +1883,10 @@ transition#endarg set_no_flag=village [/tile] + probability={PROB} + [image] - name={IMAGESTEM}@V.png + name={IMAGESTEM}@V{ANIM}.png:{TIME} variations=";2;3;4;5;6;7" layer=0 base=90,144 @@ -1884,27 +1896,7 @@ transition#endarg #enddef #define NEW:VILLAGE_A3 TERRAINLIST TIME IMAGESTEM - [terrain_graphics] - map=" -, * -* , * -, 1 -* , * -, *" - - [tile] - pos=1 - type={TERRAINLIST} - set_no_flag=village - [/tile] - - [image] - name={IMAGESTEM}[01~03].png:{TIME} - layer=0 - base=90,144 - center=90,144 - [/image] - [/terrain_graphics] + {NEW:VILLAGE {TERRAINLIST} {IMAGESTEM} (ANIM=[01~03]) (TIME={TIME})} #enddef #define NEW:VILLAGE_TOD_P TERRAINLIST PROB IMAGESTEM @@ -1938,27 +1930,7 @@ transition#endarg #enddef #define NEW:VILLAGE_A4 TERRAINLIST TIME IMAGESTEM - [terrain_graphics] - map=" -, * -* , * -, 1 -* , * -, *" - - [tile] - pos=1 - type={TERRAINLIST} - set_no_flag=village - [/tile] - - [image] - name={IMAGESTEM}[01~04].png:{TIME} - layer=0 - base=90,144 - center=90,144 - [/image] - [/terrain_graphics] + {NEW:VILLAGE {TERRAINLIST} {IMAGESTEM} (ANIM=[01~04]) (TIME={TIME})} #enddef # This hacky macro will hopefully be replaced with a more elegant way of passing