More macro type checking.

Replace a South Guard macro that duplicates one in the core library.
This commit is contained in:
Eric S. Raymond 2008-02-13 01:11:52 +00:00
parent fe36193828
commit 4c4f802989
16 changed files with 51 additions and 59 deletions

View file

@ -216,9 +216,9 @@
[/delay]
#enddef
#define ALLOW_RECRUIT LIST
#define ALLOW_RECRUIT LIST_VALUE
[allow_recruit]
side=2
type={LIST}
type={LIST_VALUE}
[/allow_recruit]
#enddef

View file

@ -181,23 +181,23 @@
[/unit]
#enddef
#define MOVE_TRANSPORT_GALEON ORIGX ORIGY ENDX ENDY MOVEX MOVEY
#define MOVE_TRANSPORT_GALEON ORIG_X ORIG_Y END_X END_Y X_SPAN Y_SPAN
[hide_unit]
x={ORIGX}
y={ORIGY}
x={ORIG_X}
y={ORIG_Y}
[/hide_unit]
[move_unit_fake]
type=Transport Galleon
x={MOVEX}
y={MOVEY}
x={X_SPAN}
y={Y_SPAN}
[/move_unit_fake]
[teleport]
[filter]
x={ORIGX}
y={ORIGY}
x={ORIG_X}
y={ORIG_Y}
[/filter]
x={ENDX}
y={ENDY}
x={END_X}
y={END_Y}
[/teleport]
[unhide_unit]
[/unhide_unit]

View file

@ -390,7 +390,7 @@
[/unit]
#enddef
#define JAIL_SAGA ORATOR
#define JAIL_SAGA DESCRIPTION
[set_variable]
name=saga_told
@ -398,7 +398,7 @@
[/set_variable]
[message]
description={ORATOR}
description={DESCRIPTION}
message= _ "Finally! I see someone managed to see through the web of deception thrown up by that vile Karrag!"
[/message]
@ -408,12 +408,12 @@
[/message]
[message]
description={ORATOR}
description={DESCRIPTION}
message= _ "I guess Karrag thought I knew too much. When his masked henchmen started raiding, plundering and taking all sorts of prisoners - which were sent to these underlevels and never seen again - I began to inquire. I discovered many unsettling things indeed, but before I could capitalize on them I was arrested and thrown down here."
[/message]
[message]
description={ORATOR}
description={DESCRIPTION}
message= _ "I gather that he is involved in some sick ritual which requires the blood of living creatures. These cells seem to be the holding place where he keeps his victims. The 'dirtgrubbers' he seems to prefer sacrificing have long since been taken away. Now it is just us few dwarves that remain..."
[/message]

View file

@ -132,16 +132,16 @@
# Add a useful village on 'trivial' difficulty'.
#ifdef EASY
{SG_CHANGE_TERRAIN 13 23 Gg^Vh}
{MODIFY_TERRAIN Gg^Vh 13 23}
#endif
# Modify the size of the keep of the enemy on 'simple' and 'easy' difficulties.
#ifdef NORMAL
{SG_CHANGE_TERRAIN 20 22 Ce}
{MODIFY_TERRAIN Ce 20 22}
#endif
#ifdef HARD
{SG_CHANGE_TERRAIN 20 22 Ce}
{SG_CHANGE_TERRAIN 19 24 Ce}
{MODIFY_TERRAIN Ce 20 22}
{MODIFY_TERRAIN Ce 19 24}
#endif
[/event]

View file

@ -126,16 +126,16 @@
# Add a useful village on 'trivial' difficulty'.
#ifdef EASY
{SG_CHANGE_TERRAIN 26 20 Gg^Vh}
{MODIFY_TERRAIN Gg^Vh 26 20}
#endif
# Modify the size of the keep of the enemy on 'simple' and 'easy' difficulties.
#ifdef NORMAL
{SG_CHANGE_TERRAIN 18 27 Ce}
{MODIFY_TERRAIN Ce 18 27}
#endif
#ifdef HARD
{SG_CHANGE_TERRAIN 18 27 Ce}
{SG_CHANGE_TERRAIN 19 28 Ce}
{MODIFY_TERRAIN Ce 18 27}
{MODIFY_TERRAIN Ce 19 28}
#endif
#make Urza Nalmath water-phobic
@ -515,7 +515,7 @@
{PLACE_IMAGE $random $x1 $y1}
{SG_CHANGE_TERRAIN $x1 $y1 Gg}
{MODIFY_TERRAIN Gg $x1 $y1}
[gold]
side=2

View file

@ -111,8 +111,8 @@
# Reduce the size of the enemy camp on 'trivial' difficulty
#ifdef EASY
{SG_CHANGE_TERRAIN 16 21 Gg}
{SG_CHANGE_TERRAIN 15 21 Gg}
{MODIFY_TERRAIN Gg 16 21}
{MODIFY_TERRAIN Gg 15 21}
#endif
[/event]

View file

@ -157,7 +157,7 @@
description=Urza Afalas
[/recall]
{SG_CHANGE_TERRAIN 28 46 Gg}
{MODIFY_TERRAIN Gg 28 46}
[/event]
#start

View file

@ -712,8 +712,8 @@
[scroll]
x,y=-10,-10
[/scroll]
{SG_CHANGE_TERRAIN 18 23 Re}
{SG_CHANGE_TERRAIN 18 24 Ww}
{MODIFY_TERRAIN Re 18 23}
{MODIFY_TERRAIN Ww 18 24}
[redraw][/redraw]
[message]

View file

@ -151,8 +151,8 @@
{SG_GUARD (Lieutenant) (Lt. Nilaf) (_"Lt. Nilaf") 1 26 21}
{SG_GUARD (Heavy Infantryman) (Provincial Guard) (_"Provincial Guard") 1 28 20}
{SG_CHANGE_TERRAIN 25 22 Ce}
{SG_CHANGE_TERRAIN 28 20 Ce}
{MODIFY_TERRAIN Ce 25 22}
{MODIFY_TERRAIN Ce 28 20}
{STARTING_VILLAGES 1 9}
[/then]
@ -167,7 +167,7 @@
{SG_GUARD (Heavy Infantryman) (Provincial Guard) (_"Provincial Guard") 1 25 21}
{SG_GUARD (Spearman) (Provincial Guard) (_"Provincial Guard") 1 28 21}
{SG_CHANGE_TERRAIN 25 21 Ce}
{MODIFY_TERRAIN Ce 25 21}
{STARTING_VILLAGES 1 5}
[/then]

View file

@ -8,11 +8,3 @@
flag=flag/SG-flag-1.png:150,flag/SG-flag-2.png:150,flag/SG-flag-3.png:150,flag/SG-flag-4.png:150
flag_icon=flag/SG-flag-icon.png
#enddef
#define SG_CHANGE_TERRAIN X Y TERRAIN
[terrain]
x={X}
y={Y}
terrain={TERRAIN}
[/terrain]
#enddef

View file

@ -1230,7 +1230,7 @@
[/variable]
[then]
#turn village into sand, Dd is the letter for sand
#turn village into sand, Dd is the terrain code for sand
[terrain]
x=$camps[0].x
y=$camps[0].y
@ -1628,7 +1628,7 @@
[/filter_location]
[/filter]
#turn village into sand, Dd is the letter for sand
#turn village into sand, Dd is the terrain code for sand
[terrain]
x=$x1
y=$y1

View file

@ -63,10 +63,10 @@
#enddef
#!***Macro to random place unit within area***
#define RANDOM_PLACEMENT X Y RADIUS UNIT
#define RANDOM_PLACEMENT X Y RADIUS_NUMBER UNIT_WML
[store_locations]
x,y={X},{Y}
radius={RADIUS}
radius={RADIUS_NUMBER}
variable=random_placement_locations
[/store_locations]
@ -79,7 +79,7 @@
{CLEAR_VARIABLE random_placement_locations}
{UNIT}
{UNIT_WML}
[+unit]
x,y=$random_placement_x,$random_placement_y

View file

@ -3,12 +3,12 @@
# ! in comments is used for generating HTML documentation, ignore it otherwise.
#define DEPRECATE NAME VERSION
# Tag macros for removal, the VERSION argument is the
#define DEPRECATE MACRO_NAME VERSION_NAME
# Tag macros for removal, the VERSION_NAME argument is the
# release where the message is shown the first time.
# The removal will be 2 versions later.
[deprecated_message]
message="Macro '" + {NAME} + "' is scheduled for removal in Wesnoth " + {VERSION} + "."
message="Macro '" + {MACRO_NAME} + "' is scheduled for removal in Wesnoth " + {VERSION_NAME} + "."
[/deprecated_message]
#enddef

View file

@ -394,12 +394,12 @@
{CLEAR_VARIABLE new_spawn}
#enddef
#define CLEAR_SPAWN_GROUP INDEX
{CLEAR_VARIABLE main_spawns[{INDEX}]}
#define CLEAR_SPAWN_GROUP NUMBER
{CLEAR_VARIABLE main_spawns[{NUMBER}]}
#enddef
#define REMOVE_SPAWN_GROUP INDEX
{VARIABLE index {INDEX}}
#define REMOVE_SPAWN_GROUP NUMBER
{VARIABLE index {NUMBER}}
[while]
[variable]
name=index

View file

@ -18,17 +18,17 @@
[/label]
#enddef
#define COUNTDOWN_THEME_STATUS FONT_SMALL
#define COUNTDOWN_THEME_STATUS FONT_SMALL_SIZE
[report_countdown]
id=report_timeout
font_size={FONT_SMALL}
font_size={FONT_SMALL_SIZE}
ref=time-icon
rect="+0,=,+50,+20"
xanchor=proportional
yanchor=fixed
[/report_countdown]
#enddef
#define REPLAY_THEME FONT_SMALL
#define REPLAY_THEME FONT_SMALL_SIZE
[replay]
[change]
id=main-map
@ -59,7 +59,7 @@
text= _ "Replay"
ref=replay-panel
rect="=+3,=+3,+60,=-4"
font_size={FONT_SMALL}
font_size={FONT_SMALL_SIZE}
font_rgb=160,160,160
xanchor=fixed
yanchor=fixed

View file

@ -63,7 +63,7 @@ def isresource(filename):
def formaltype(f):
# Deduce the expected type of the formal
if f in ("SIDE", "X", "Y", "TO_X", "TO_Y", "AMOUNT", "RED", "GREEN", "BLUE", "TURN", "RADIUS") or f.endswith("NUMBER"):
if f in ("SIDE", "X", "Y", "AMOUNT", "RED", "GREEN", "BLUE", "TURN", "RADIUS") or f.endswith("NUMBER") or f.endswith("_X") or f.endswith("_Y"):
ftype = "numeric"
elif f in ("POSITION",):
ftype = "position"
@ -81,13 +81,13 @@ def formaltype(f):
ftype = "optional_string"
elif f.endswith("IMAGE") or f == "PROFILE":
ftype = "image"
elif f in ("MUSIC", "SOUND"):
elif f in ("MUSIC",) or f.endswith("SOUND"):
ftype = "sound"
elif f in ("FILTER", "ACTION"):
ftype = "filter"
elif f.endswith("_WML"):
ftype = "wml"
elif f in ("VALUE",):
elif f.endswith("VALUE"):
ftype = "any"
else:
ftype = None