Add documentation for all but two of the utility macros.

Put all documentation comments in a standard form that can be

mechanically extracted.  Move some macsos to the deprecated.cfg file.
This commit is contained in:
Eric S. Raymond 2007-04-16 05:19:33 +00:00
parent a594e4bdd9
commit b704c056f4
11 changed files with 720 additions and 702 deletions

View File

@ -1,7 +1,9 @@
# Macros for setting animations.
# These don't rely on any other macros. Please don't change this.
#define DEFENSE_ANIM FRAME BASEFRAME HITSOUND
#define DEFENSE_ANIM REACTION BASEFRAME HITSOUND
# Define a defensive animation moving from a specified BASEFRAME
# to REACTION, with HITSOUND playing only if a hit occurs.
[defend]
start_time=-126
[frame]
@ -10,13 +12,13 @@
[/frame]
[frame]
duration=100
image={FRAME}
image={REACTION}
[/frame]
[if]
hits=hit
[frame]
duration=150
image={FRAME}
image={REACTION}
sound={HITSOUND}
[/frame]
[/if]
@ -24,7 +26,7 @@
hits=miss,kill
[frame]
duration=150
image={FRAME}
image={REACTION}
[/frame]
[/else]
[frame]
@ -35,7 +37,10 @@
#enddef
#define DEFENSE_ANIM_FILTERED FRAME BASEFRAME HITSOUND FILTER
#define DEFENSE_ANIM_FILTERED REACTION BASEFRAME HITSOUND FILTER
# Define a defensive animation moving from a specified BASEFRAME
# to REACTION, with HITSOUND playing only if a hit occurs. This
# fires only if FILTER is matched.
[defend]
start_time=-126
{FILTER}
@ -45,13 +50,13 @@
[/frame]
[frame]
duration=100
image={FRAME}
image={REACTION}
[/frame]
[if]
hits=hit
[frame]
duration=150
image={FRAME}
image={REACTION}
sound={HITSOUND}
[/frame]
[/if]
@ -59,7 +64,7 @@
hits=miss,kill
[frame]
duration=150
image={FRAME}
image={REACTION}
[/frame]
[/else]
[frame]
@ -70,7 +75,10 @@
#enddef
#define DEFENSE_ANIM_RANGE FRAME BASEFRAME HITSOUND RANGE
#define DEFENSE_ANIM_RANGE REACTION BASEFRAME HITSOUND RANGE
# Define a defensive animation moving from a specified BASEFRAME
# to REACTION, with HITSOUND playing only if a hit occurs. This
# fires only on the class of attacks specified by RANGE.
[defend]
start_time=-126
[attack_filter]
@ -82,13 +90,13 @@
[/frame]
[frame]
duration=100
image={FRAME}
image={REACTION}
[/frame]
[if]
hits=hit
[frame]
duration=150
image={FRAME}
image={REACTION}
sound={HITSOUND}
[/frame]
[/if]
@ -96,7 +104,7 @@
hits=miss,kill
[frame]
duration=150
image={FRAME}
image={RANGE}
[/frame]
[/else]
[frame]
@ -107,7 +115,11 @@
#enddef
#define DEFENSE_ANIM_ELVEN_FILTERED FRAME BASEFRAME HITSOUND FILTER
#define DEFENSE_ANIM_ELVEN_FILTERED REACTION BASEFRAME HITSOUND FILTER
# Define a defensive animation moving from a specified BASEFRAME
# to REACTION, with HITSOUND playing only if a hit occurs and an
# elven halo waxing and waning during the animation. This fires
# only if FILTER is matched.
[defend]
{FILTER}
[frame]
@ -125,13 +137,13 @@
[frame]
begin=-125
end=-75
image={FRAME}
image={REACTION}
halo=halo/elven/elven-shield-halo-60pct.png
[/frame]
[frame]
begin=-75
end=-25
image={FRAME}
image={REACTION}
halo=halo/elven/elven-shield-halo-80pct.png
[/frame]
[if]
@ -139,7 +151,7 @@
[frame]
begin=-25
end=75
image={FRAME}
image={REACTION}
sound={HITSOUND}
halo=halo/elven/elven-shield-halo-100pct.png
[/frame]
@ -149,14 +161,14 @@
[frame]
begin=-25
end=75
image={FRAME}
image={REACTION}
halo=halo/elven/elven-shield-halo-100pct.png
[/frame]
[/else]
[frame]
begin=75
end=125
image={FRAME}
image={REACTION}
halo=halo/elven/elven-shield-halo-80pct.png
[/frame]
[frame]
@ -180,224 +192,12 @@
[/defend]
#enddef
# These are included for backwards-compatibility mainly; they aren't and
# shouldn't be used for mainline units.
#define MISSILE_FRAME_WAIL
[if]
direction=n,ne,nw
[missile_frame]
begin=-300
end=-230
image="projectiles/wailprojectile-n-1.png"
image_diagonal="projectiles/wailprojectile-ne-1.png"
[/missile_frame]
[missile_frame]
begin=-230
end=-160
image="projectiles/wailprojectile-n-2.png"
image_diagonal="projectiles/wailprojectile-ne-2.png"
[/missile_frame]
[missile_frame]
begin=-160
end=0
image="projectiles/wailprojectile-n-3.png"
image_diagonal="projectiles/wailprojectile-ne-3.png"
[/missile_frame]
[missile_frame]
begin=0
end=40
image="projectiles/wailprojectile-n-4.png"
image_diagonal="projectiles/wailprojectile-ne-4.png"
[/missile_frame]
[missile_frame]
begin=40
end=80
image="projectiles/wailprojectile-n-5.png"
image_diagonal="projectiles/wailprojectile-ne-5.png"
[/missile_frame]
[missile_frame]
begin=80
end=120
image="projectiles/wailprojectile-n-6.png"
image_diagonal="projectiles/wailprojectile-ne-6.png"
[/missile_frame]
[/if]
[else]
direction=s,se,sw
### The price of asymmetrical projectiles - here, we use a conditional because the game automatically flips the images for the south frame. We have a separate set of images for the south part, which are not only flipped vertically, but also have their angle corrected for the sw direction.
[missile_frame]
begin=-300
end=-230
image="projectiles/wailprojectile-s-1.png"
image_diagonal="projectiles/wailprojectile-se-1.png"
[/missile_frame]
[missile_frame]
begin=-230
end=-160
image="projectiles/wailprojectile-s-2.png"
image_diagonal="projectiles/wailprojectile-se-2.png"
[/missile_frame]
[missile_frame]
begin=-160
end=0
image="projectiles/wailprojectile-s-3.png"
image_diagonal="projectiles/wailprojectile-se-3.png"
[/missile_frame]
[missile_frame]
begin=0
end=40
image="projectiles/wailprojectile-s-4.png"
image_diagonal="projectiles/wailprojectile-se-4.png"
[/missile_frame]
[missile_frame]
begin=40
end=80
image="projectiles/wailprojectile-s-5.png"
image_diagonal="projectiles/wailprojectile-se-5.png"
[/missile_frame]
[missile_frame]
begin=80
end=120
image="projectiles/wailprojectile-s-6.png"
image_diagonal="projectiles/wailprojectile-se-6.png"
[/missile_frame]
[/else]
#enddef
#define MISSILE_FRAME_FIRE_BREATH N_OFFSET S_OFFSET N_DIAGONAL_OFFSET S_DIAGONAL_OFFSET
[if]
direction=n
[missile_frame]
begin=-400
end=100
halo=projectiles/fire-breath-n-1.png:80,projectiles/fire-breath-n-2.png:80,projectiles/fire-breath-n-3.png:80,projectiles/fire-breath-n-4.png:80,projectiles/fire-breath-n-5.png:80
halo_x,halo_y={N_OFFSET}
[/missile_frame]
[/if]
[else]
direction=s
[missile_frame]
begin=-400
end=100
halo=projectiles/fire-breath-s-1.png:80,projectiles/fire-breath-s-2.png:80,projectiles/fire-breath-s-3.png:80,projectiles/fire-breath-s-4.png:80,projectiles/fire-breath-s-5.png:80
halo_x,halo_y={S_OFFSET}
[/missile_frame]
[/else]
[else]
direction=ne,nw
[missile_frame]
begin=-400
end=100
halo=projectiles/fire-breath-ne-1.png:80,projectiles/fire-breath-ne-2.png:80,projectiles/fire-breath-ne-3.png:80,projectiles/fire-breath-ne-4.png:80,projectiles/fire-breath-ne-5.png:80
halo_x,halo_y={N_DIAGONAL_OFFSET}
[/missile_frame]
[/else]
[else]
direction=se,sw
[missile_frame]
begin=-400
end=100
halo=projectiles/fire-breath-se-1.png:80,projectiles/fire-breath-se-2.png:80,projectiles/fire-breath-se-3.png:80,projectiles/fire-breath-se-4.png:80,projectiles/fire-breath-se-5.png:80
halo_x,halo_y={S_DIAGONAL_OFFSET}
[/missile_frame]
[/else]
#enddef
#define MISSILE_FRAME_FAERIE_FIRE
[missile_frame]
begin=-500
end=-350
image="projectiles/icemissile-n-1.png"
image_diagonal="projectiles/icemissile-ne-1.png"
halo=halo/elven/ice-halo1.png:100,halo/elven/ice-halo2.png:100,halo/elven/ice-halo3.png:25
halo_x,halo_y=0,0
[/missile_frame]
[missile_frame]
begin=-350
end=-200
image="projectiles/icemissile-n-2.png"
image_diagonal="projectiles/icemissile-ne-2.png"
halo=halo/elven/ice-halo3.png:75,halo/elven/ice-halo4.png:75
halo_x,halo_y=0,0
[/missile_frame]
[missile_frame]
begin=-200
end=-50
image="projectiles/icemissile-n-3.png"
image_diagonal="projectiles/icemissile-ne-3.png"
halo=halo/elven/ice-halo5.png:100,halo/elven/ice-halo1.png:100,halo/elven/ice-halo2.png:50
halo_x,halo_y=0,0
[/missile_frame]
[missile_frame]
begin=-50
end=0
image="projectiles/icemissile-n-4.png"
image_diagonal="projectiles/icemissile-ne-4.png"
halo=halo/elven/ice-halo6.png
halo_x,halo_y=0,0
[/missile_frame]
[missile_frame]
begin=25
end=75
image="projectiles/icemissile-n-5.png"
image_diagonal="projectiles/icemissile-ne-5.png"
halo=halo/elven/ice-halo7.png
halo_x,halo_y=0,0
[/missile_frame]
[missile_frame]
begin=75
end=125
image="projectiles/icemissile-n-6.png"
image_diagonal="projectiles/icemissile-ne-6.png"
halo=halo/elven/ice-halo8.png
halo_x,halo_y=0,0
[/missile_frame]
[missile_frame]
begin=125
end=175
image="projectiles/icemissile-n-7.png"
image_diagonal="projectiles/icemissile-ne-7.png"
halo=halo/elven/ice-halo9.png
halo_x,halo_y=0,0
[/missile_frame]
#enddef
#define MISSILE_FRAME_FIREBALL
[missile_frame]
begin=-220
end=-100
image="projectiles/fireball-n-2.png"
image_diagonal="projectiles/fireball-nw-2.png"
[/missile_frame]
[missile_frame]
begin=-100
end=25
image="projectiles/fireball-n.png"
image_diagonal="projectiles/fireball-nw.png"
[/missile_frame]
[missile_frame]
begin=25
end=80
image="projectiles/fireball-n-2.png"
image_diagonal="projectiles/fireball-nw-2.png"
[/missile_frame]
#enddef
# this macro is called on top of every idle animation,
# to provide a standard set of conditions to play the idle animation
#define STANDARD_IDLE_FILTER
# Poisoned units should have no idle animation
# Poisoned units should have no idle animation. This macro defines a
# filter that excludes them.
[unit_filter]
[not]
[wml_filter]

View File

@ -1,15 +1,15 @@
# Conditionals for MP scenarios.
# These don't depend on any other macros.
# Condition triggering if PLAYER has at least one unit left.
#define IF_ALIVE PLAYER ACTION
# Condition triggering of ACTION om whether PLAYER has at least one unit left.
# For example, if the player 2 is still alive, kill all his units.
# {IF_ALIVE 2 (
# [kill]
# side=2
# [/kill]
# )}
#define IF_ALIVE PLAYER ACTION
[if]
[have_unit]
side={PLAYER}
@ -20,7 +20,9 @@
[/if]
#enddef
# Condition triggering if PLAYER has no units left.
#define IF_DEAD PLAYER ACTION
# Condition triggering of ACTION on whether PLAYER has no units left.
# For example, give player 2 gold if player 1 is dead
# {IF_DEAD 1 (
# [gold]
@ -28,8 +30,6 @@
# amount=25
# [/gold]
# )}
#define IF_DEAD PLAYER ACTION
[if]
[have_unit]
side={PLAYER}
@ -42,8 +42,10 @@
[/if]
#enddef
#define IF_ALLIED PLAYER1 PLAYER2 ACTION
# Condition that triggers if PLAYER1 and PLAYER2 belong to the same team.
# NOTE: only works if leaders are alive, are the same leader as the game started and haven't changed teams.
# NOTE: only works if leaders are alive, are the same leader as the game
# started and haven't changed teams.
# For example, if player 3 and 4 is allied, steal 10 gold from each:
# {IF_ALLIED 3 4 (
# [gold]
@ -55,8 +57,6 @@
# amount=-10
# [/gold]
# )}
#define IF_ALLIED PLAYER1 PLAYER2 ACTION
[store_unit]
[filter]
side={PLAYER1}

View File

@ -1,19 +1,19 @@
# These are clutter, scheduled to be removed.
# This one it used to tag macros for removal, the number in the name is the
#define DEPRECATE_132 NAME
# Tag macros for removal, the number in the name is the
# release where the message is shown the first time.
# The removal will be 2 versions later.
#define DEPRECATE_132 NAME
[deprecated_message]
message="Macro '" + {NAME} + "' is scheduled for removal in Wesnoth 1.3.4."
[/deprecated_message]
#enddef
# Gives a side an amount of gold
# For example, lets make player 1 rich:
# {ADD_GOLD 1 999}
#define ADD_GOLD SIDE AMOUNT
# Gives a side an amount of gold
# For example, to make player 1 rich:
# {ADD_GOLD 1 999}
{DEPRECATE_132 ADD_GOLD}
[gold]
side={SIDE}
@ -21,4 +21,217 @@
[/gold]
#enddef
# These are included for backwards-compatibility mainly; they aren't and
# shouldn't be used for mainline units.
#define MISSILE_FRAME_WAIL
{DEPRECATE_132 MISSILE_FRAME_WAIL}
[if]
direction=n,ne,nw
[missile_frame]
begin=-300
end=-230
image="projectiles/wailprojectile-n-1.png"
image_diagonal="projectiles/wailprojectile-ne-1.png"
[/missile_frame]
[missile_frame]
begin=-230
end=-160
image="projectiles/wailprojectile-n-2.png"
image_diagonal="projectiles/wailprojectile-ne-2.png"
[/missile_frame]
[missile_frame]
begin=-160
end=0
image="projectiles/wailprojectile-n-3.png"
image_diagonal="projectiles/wailprojectile-ne-3.png"
[/missile_frame]
[missile_frame]
begin=0
end=40
image="projectiles/wailprojectile-n-4.png"
image_diagonal="projectiles/wailprojectile-ne-4.png"
[/missile_frame]
[missile_frame]
begin=40
end=80
image="projectiles/wailprojectile-n-5.png"
image_diagonal="projectiles/wailprojectile-ne-5.png"
[/missile_frame]
[missile_frame]
begin=80
end=120
image="projectiles/wailprojectile-n-6.png"
image_diagonal="projectiles/wailprojectile-ne-6.png"
[/missile_frame]
[/if]
[else]
direction=s,se,sw
### The price of asymmetrical projectiles - here, we use a conditional because the game automatically flips the images for the south frame. We have a separate set of images for the south part, which are not only flipped vertically, but also have their angle corrected for the sw direction.
[missile_frame]
begin=-300
end=-230
image="projectiles/wailprojectile-s-1.png"
image_diagonal="projectiles/wailprojectile-se-1.png"
[/missile_frame]
[missile_frame]
begin=-230
end=-160
image="projectiles/wailprojectile-s-2.png"
image_diagonal="projectiles/wailprojectile-se-2.png"
[/missile_frame]
[missile_frame]
begin=-160
end=0
image="projectiles/wailprojectile-s-3.png"
image_diagonal="projectiles/wailprojectile-se-3.png"
[/missile_frame]
[missile_frame]
begin=0
end=40
image="projectiles/wailprojectile-s-4.png"
image_diagonal="projectiles/wailprojectile-se-4.png"
[/missile_frame]
[missile_frame]
begin=40
end=80
image="projectiles/wailprojectile-s-5.png"
image_diagonal="projectiles/wailprojectile-se-5.png"
[/missile_frame]
[missile_frame]
begin=80
end=120
image="projectiles/wailprojectile-s-6.png"
image_diagonal="projectiles/wailprojectile-se-6.png"
[/missile_frame]
[/else]
#enddef
#define MISSILE_FRAME_FIRE_BREATH N_OFFSET S_OFFSET N_DIAGONAL_OFFSET S_DIAGONAL_OFFSET
{DEPRECATE_132 MISSILE_FRAME_FIRE_BREATH}
[if]
direction=n
[missile_frame]
begin=-400
end=100
halo=projectiles/fire-breath-n-1.png:80,projectiles/fire-breath-n-2.png:80,projectiles/fire-breath-n-3.png:80,projectiles/fire-breath-n-4.png:80,projectiles/fire-breath-n-5.png:80
halo_x,halo_y={N_OFFSET}
[/missile_frame]
[/if]
[else]
direction=s
[missile_frame]
begin=-400
end=100
halo=projectiles/fire-breath-s-1.png:80,projectiles/fire-breath-s-2.png:80,projectiles/fire-breath-s-3.png:80,projectiles/fire-breath-s-4.png:80,projectiles/fire-breath-s-5.png:80
halo_x,halo_y={S_OFFSET}
[/missile_frame]
[/else]
[else]
direction=ne,nw
[missile_frame]
begin=-400
end=100
halo=projectiles/fire-breath-ne-1.png:80,projectiles/fire-breath-ne-2.png:80,projectiles/fire-breath-ne-3.png:80,projectiles/fire-breath-ne-4.png:80,projectiles/fire-breath-ne-5.png:80
halo_x,halo_y={N_DIAGONAL_OFFSET}
[/missile_frame]
[/else]
[else]
direction=se,sw
[missile_frame]
begin=-400
end=100
halo=projectiles/fire-breath-se-1.png:80,projectiles/fire-breath-se-2.png:80,projectiles/fire-breath-se-3.png:80,projectiles/fire-breath-se-4.png:80,projectiles/fire-breath-se-5.png:80
halo_x,halo_y={S_DIAGONAL_OFFSET}
[/missile_frame]
[/else]
#enddef
#define MISSILE_FRAME_FAERIE_FIRE
{DEPRECATE_132 MISSILE_FRAME_FAERIE_FIRE}
[missile_frame]
begin=-500
end=-350
image="projectiles/icemissile-n-1.png"
image_diagonal="projectiles/icemissile-ne-1.png"
halo=halo/elven/ice-halo1.png:100,halo/elven/ice-halo2.png:100,halo/elven/ice-halo3.png:25
halo_x,halo_y=0,0
[/missile_frame]
[missile_frame]
begin=-350
end=-200
image="projectiles/icemissile-n-2.png"
image_diagonal="projectiles/icemissile-ne-2.png"
halo=halo/elven/ice-halo3.png:75,halo/elven/ice-halo4.png:75
halo_x,halo_y=0,0
[/missile_frame]
[missile_frame]
begin=-200
end=-50
image="projectiles/icemissile-n-3.png"
image_diagonal="projectiles/icemissile-ne-3.png"
halo=halo/elven/ice-halo5.png:100,halo/elven/ice-halo1.png:100,halo/elven/ice-halo2.png:50
halo_x,halo_y=0,0
[/missile_frame]
[missile_frame]
begin=-50
end=0
image="projectiles/icemissile-n-4.png"
image_diagonal="projectiles/icemissile-ne-4.png"
halo=halo/elven/ice-halo6.png
halo_x,halo_y=0,0
[/missile_frame]
[missile_frame]
begin=25
end=75
image="projectiles/icemissile-n-5.png"
image_diagonal="projectiles/icemissile-ne-5.png"
halo=halo/elven/ice-halo7.png
halo_x,halo_y=0,0
[/missile_frame]
[missile_frame]
begin=75
end=125
image="projectiles/icemissile-n-6.png"
image_diagonal="projectiles/icemissile-ne-6.png"
halo=halo/elven/ice-halo8.png
halo_x,halo_y=0,0
[/missile_frame]
[missile_frame]
begin=125
end=175
image="projectiles/icemissile-n-7.png"
image_diagonal="projectiles/icemissile-ne-7.png"
halo=halo/elven/ice-halo9.png
halo_x,halo_y=0,0
[/missile_frame]
#enddef
#define MISSILE_FRAME_FIREBALL
{DEPRECATE_132 MISSILE_FRAME_FIREBALL}
[missile_frame]
begin=-220
end=-100
image="projectiles/fireball-n-2.png"
image_diagonal="projectiles/fireball-nw-2.png"
[/missile_frame]
[missile_frame]
begin=-100
end=25
image="projectiles/fireball-n.png"
image_diagonal="projectiles/fireball-nw.png"
[/missile_frame]
[missile_frame]
begin=25
end=80
image="projectiles/fireball-n-2.png"
image_diagonal="projectiles/fireball-nw-2.png"
[/missile_frame]
#enddef

View File

@ -1,328 +1,339 @@
# This file contains shortcuts for common WML events (such as prestart, side
# turn, and such), which can be used to write events faster and in less space.
#
# It is recommended that you only use these if you're confident you could write
# the expanded form as well; these are mostly intended as shortcuts for
# experienced WML authors.
#
# These don't depend on any other macros. Please don't change this.
# Creates a generic event, only intended to be used when no other event can be
# used.
#define ON_EVENT NAME ACTION
[event]
name={NAME}
{ACTION}
[/event]
#enddef
# Creates an event that triggers when the scenario starts but before the user
# gets any visible output.
#
# For example, you can make side 2 start the scenario with ownership of the
# village at 13,15:
#
# {ON_PRESTART (
# [capture_village]
# side=2
# x,y=13,15
# [/capture_village]
# )}
#define ON_PRESTART ACTION
[event]
name=prestart
{ACTION}
[/event]
#enddef
# Creates an event that triggers when the scenario starts, after the map is
# displayed but before the player can act.
#
# For example you could display some dialogue when the scenario starts:
#
# {ON_START (
# [message]
# speaker=Konrad
# message= _ "Hey, I can see some enemies up ahead!"
# [/message]
#
# [message]
# speaker=Delfador
# message= _ "Yes, so it would seem. Charge!"
# [/message]
# )}
#define ON_START ACTION
[event]
name=start
{ACTION}
[/event]
#enddef
# Creates an event that triggers at the end of every turn.
#
# For example, you could give a player some gold at the end every turn:
#
# {ON_NEXT_TURN (
# [gold]
# amount=35
# side=1
# [/gold]
# )}
#define ON_NEXT_TURN ACTION
[event]
name=new turn
first_time_only=no
{ACTION}
[/event]
#enddef
# Creates an event that triggers at the end of the current turn.
# For example you could give a player some gold before his/hers next turn.:
# {ON_NEXT_TURN (
# [gold]
# amount=100
# side=1
# [/gold]
# )}
#define ON_NEXT_TURN_ONCE ACTION
[event]
name=new turn
first_time_only=yes
{ACTION}
[/event]
#enddef
# Creates an event that triggers at the start of every players turn
# For example you could set each players gold to a fixed amount every turn.
# {ON_SIDETURN (
# [modify_side]
# side=3
# gold=0
# [/modify_side]
# )}
#define ON_SIDETURN ACTION
[event]
name=side turn
first_time_only=no
{ACTION}
[/event]
#enddef
# Creates an event that triggers at the start of turn TURN
# For example you can create a Wose belonging to player 1 at turn 3:
# {ON_TURN 3 (
# [unit]
# side=1
# type=wose
# x,y=12,4
# [/unit]
# )}
#define ON_TURN TURN ACTION
[event]
name=turn {TURN}
{ACTION}
[/event]
#enddef
# Creates an event that triggers when the last turn ends.
# For example you could display a message saying they suck:
# {ON_LAST_TURN (
# [message]
# speaker=narrator
# message="They suck!"
# [/message]
# )}
#define ON_LAST_TURN ACTION
[event]
name=time over
{ACTION}
[/event]
#enddef
# Creates an event that triggers when a player wins the game, before the game ends.
# For example you could congratulate the player:
# {ON_VICTORY (
# [message]
# speaker=narrator
# message="Congratulations!"
# [/message]
# )}
#define ON_VICTORY ACTION
[event]
name=victory
{ACTION}
[/event]
#enddef
# Creates an event that triggers when a player wins the game, before the game ends.
# For example you could suggest an easier difficulty the player:
# {ON_DEFEAT (
# [message]
# speaker=narrator
# message="Aww.. you lost. Try again with 800g and +40g income?"
# [/message]
# )}
#define ON_DEFEAT ACTION
[event]
name=defeat
{ACTION}
[/event]
#enddef
# Creates an event that triggers anytime a unit steps on a given tile.
# The filter can be used to only affect special units, or units of a given player.
# For example we could make a tree where the first players leader can read a note, but noone else:
# {ON_TILE 5 7 (
# side=1
# canrecruit=1
# ) (
# [message]
# speaker=narrator
# message="This is a note."
# [/message]
# )}
#define ON_TILE X Y FILTER ACTION
[event]
name=moveto
first_time_only=no
[filter]
x={X}
y={Y}
{FILTER}
[/filter]
{ACTION}
[/event]
#enddef
# Allows the player to undo the effects of a moveto event.
# For example, lets allow undoing reading a note:
# {ON_TILE 5 7 () (
# [message]
# speaker=narrator
# message="This is a note."
# [/message]
# {ALLOW_UNDO}
# )}
#define ALLOW_UNDO
[allow_undo]
[/allow_undo]
#enddef
# Creates an event that triggers the first time a unit steps on a given tile.
# The filter can be used to only affect special units, or units of a given player.
# For example we could make a text-message that is only readable once:
# {ON_TILE_ONCE 5 7 () (
# [message]
# speaker=narrator
# message="This is a note."
# [/message]
# )}
#define ON_TILE_ONCE X Y FILTER ACTION
[event]
name=moveto
first_time_only=yes
[filter]
x={X}
y={Y}
{FILTER}
[/filter]
{ACTION}
[/event]
#enddef
# Creates an event that triggers anytime a unit matching FILTER dies.
# For example we can make all units scream in pain upon death:
# {ON_DEATH () (
# [message]
# speaker=unit
# message="AAaaaaAAaaAAaarrrghh!!!"
# [/message]
# )}
#define ON_DEATH FILTER ACTION
[event]
name=die
first_time_only=no
[filter]
{FILTER}
[/filter]
{ACTION}
[/event]
#enddef
# Creates an event that triggers the first time a unit matching FILTER dies.
# For example we can make only player 3s leader units scream in pain upon death:
# {ON_DEATH_ONCE (
# side=3
# canrecruit=1
# ) (
# [message]
# speaker=unit
# message="AAaaaaAAaaAAaarrrghh!!!"
# [/message]
# )}
#define ON_DEATH_ONCE FILTER ACTION
[event]
name=die
first_time_only=yes
[filter]
{FILTER}
[/filter]
{ACTION}
[/event]
#enddef
# Creates an event that triggers before any unit matching FILTER advances to a new class.
# For example we could make it smile:
# {ON_ADVANCEMENT () (
# [message]
# speaker=unit
# message=":D"
# [/message]
# )}
#define ON_ADVANCEMENT FILTER ACTION
[event]
name=advance
first_time_only=no
[filter]
{FILTER}
[/filter]
{ACTION}
[/event]
#enddef
# Creates an event that triggers after any unit matching FILTER advanced to a new class.
# For example we could make it claim to be the strongest one alive:
# {ON_POSTADVANCEMENT () (
# [message]
# speaker=unit
# message="I'm the strongest one alive!"
# [/message]
# )}
#define ON_POSTADVANCEMENT FILTER ACTION
[event]
name=post_advance
first_time_only=no
[filter]
{FILTER}
[/filter]
{ACTION}
[/event]
#enddef
# This file contains shortcuts for common WML events (such as prestart, side
# turn, and such), which can be used to write events faster and in less space.
#
# It is recommended that you only use these if you're confident you could write
# the expanded form as well; these are mostly intended as shortcuts for
# experienced WML authors.
#
# These don't depend on any other macros. Please don't change this.
#define ON_EVENT NAME ACTION
# Creates a generic event. Strictly a syntactic shortcut
[event]
name={NAME}
{ACTION}
[/event]
#enddef
#define ON_PRESTART ACTION
# Creates an event that triggers when the scenario starts but before the user
# gets any visible output. Strictly a syntactic shortcut.
#
# For example, you can make side 2 start the scenario with ownership of the
# village at 13,15:
#
# {ON_PRESTART (
# [capture_village]
# side=2
# x,y=13,15
# [/capture_village]
# )}
[event]
name=prestart
{ACTION}
[/event]
#enddef
#define ON_START ACTION
# Creates an event that triggers when the scenario starts, after the map is
# displayed but before the player can act. Strictly a syntactic shortcut.
#
# For example you could display some dialogue when the scenario starts:
#
# {ON_START (
# [message]
# speaker=Konrad
# message= _ "Hey, I can see some enemies up ahead!"
# [/message]
#
# [message]
# speaker=Delfador
# message= _ "Yes, so it would seem. Charge!"
# [/message]
# )}
[event]
name=start
{ACTION}
[/event]
#enddef
# {ON_NEXT_TURN (
# Creates an event that triggers at the end of every turn.
#
# For example, you could give a player some gold at the end every turn:
# [gold]
# amount=35
# side=1
# [/gold]
# )}
#define ON_NEXT_TURN ACTION
[event]
name=new turn
first_time_only=no
{ACTION}
[/event]
#enddef
#define ON_NEXT_TURN_ONCE ACTION
# Creates an event that triggers at the end of the current turn.
# For example you could give a player some gold before his/hers next turn.:
# {ON_NEXT_TURN (
# [gold]
# amount=100
# side=1
# [/gold]
# )}
[event]
name=new turn
first_time_only=yes
{ACTION}
[/event]
#enddef
#define ON_SIDETURN ACTION
# Creates an event that triggers at the start of every players turn
# For example, you could set each players gold to a fixed amount every turn.
# {ON_SIDETURN (
# [modify_side]
# side=3
# gold=0
# [/modify_side]
# )}
[event]
name=side turn
first_time_only=no
{ACTION}
[/event]
#enddef
#define ON_TURN TURN ACTION
# Creates an event that triggers at the start of turn TURN
# For example you can create a Wose belonging to player 1 at turn 3:
# Strictly a syntactic shortcut.
# {ON_TURN 3 (
# [unit]
# side=1
# type=wose
# x,y=12,4
# [/unit]
# )}
[event]
name=turn {TURN}
{ACTION}
[/event]
#enddef
#define ON_LAST_TURN ACTION
# Creates an event that triggers when the last turn ends.
# Strictly a syntactic shortcut.
#
# For example you could display a message saying they suck:
# {ON_LAST_TURN (
# [message]
# speaker=narrator
# message="They suck!"
# [/message]
# )}
[event]
name=time over
{ACTION}
[/event]
#enddef
#define ON_VICTORY ACTION
# Creates an event that triggers when a player wins the game, before
# the game ends. Strictly a syntactic shortcut.
#
# For example you could congratulate the player:
# {ON_VICTORY (
# [message]
# speaker=narrator
# message="Congratulations!"
# [/message]
# )}
[event]
name=victory
{ACTION}
[/event]
#enddef
#define ON_DEFEAT ACTION
# Creates an event that triggers when a player wins the game, before
# the game ends. Strictly a syntactic shortcut.
#
# For example you could suggest an easier difficulty
# the player:
# {ON_DEFEAT (
# [message]
# speaker=narrator
# message="Aww.. you lost. Try again with 800g and +40g income?"
# [/message]
# )}
[event]
name=defeat
{ACTION}
[/event]
#enddef
#define ON_TILE X Y FILTER ACTION
# Creates an event that triggers anytime a unit steps on a given tile.
# The filter can be used to only affect special units, or units of a
# given player.
#
# For example, we could make a tree where the first player's leader can
# read a note, but noone else:
# {ON_TILE 5 7 (
# side=1
# canrecruit=1
# ) (
# [message]
# speaker=narrator
# message="This is a note."
# [/message]
# )}
[event]
name=moveto
first_time_only=no
[filter]
x={X}
y={Y}
{FILTER}
[/filter]
{ACTION}
[/event]
#enddef
#define ALLOW_UNDO
# Allows the player to undo the effects of a moveto event.
# Strictly a syntactic shortcut.
#
# For example, let's allow undoing reading a note:
# {ON_TILE 5 7 () (
# [message]
# speaker=narrator
# message="This is a note."
# [/message]
# {ALLOW_UNDO}
# )}
[allow_undo]
[/allow_undo]
#enddef
#define ON_TILE_ONCE X Y FILTER ACTION
# Creates an event that triggers the first time a unit steps on a
# given tile. The filter can be used to only affect special units, or
# units of a given player.
For example we could make a text-message
# that is only readable once:
# {ON_TILE_ONCE 5 7 () (
# [message]
# speaker=narrator
# message="This is a note."
# [/message]
# )}
[event]
name=moveto
first_time_only=yes
[filter]
x={X}
y={Y}
{FILTER}
[/filter]
{ACTION}
[/event]
#enddef
#define ON_DEATH FILTER ACTION
# Creates an event that triggers anytime a unit matching FILTER dies.
# Strictly a syntactic shortcut.
#
# For example we can make all units scream in pain upon death:
# {ON_DEATH () (
# [message]
# speaker=unit
# message="AAaaaaAAaaAAaarrrghh!!!"
# [/message]
# )}
[event]
name=die
first_time_only=no
[filter]
{FILTER}
[/filter]
{ACTION}
[/event]
#enddef
#define ON_DEATH_ONCE FILTER ACTION
# Creates an event that triggers the first time a unit matching FILTER
# dies. Strictly a syntactic shortcut.
#
# For example we can make only player 3s leader units scream in
# pain upon death:
# {ON_DEATH_ONCE (
# side=3
# canrecruit=1
# ) (
# [message]
# speaker=unit
# message="AAaaaaAAaaAAaarrrghh!!!"
# [/message]
# )}
[event]
name=die
first_time_only=yes
[filter]
{FILTER}
[/filter]
{ACTION}
[/event]
#enddef
#define ON_ADVANCEMENT FILTER ACTION
# Creates an event that triggers before any unit matching FILTER
# advances to a new class. Strictly a syntactic shortcut.
#
# For example we could make it smile:
# {ON_ADVANCEMENT () (
# [message]
# speaker=unit
# message=":D"
# [/message]
# )}
[event]
name=advance
first_time_only=no
[filter]
{FILTER}
[/filter]
{ACTION}
[/event]
#enddef
#define ON_POSTADVANCEMENT FILTER ACTION
# Creates an event that triggers after any unit matching FILTER
# advanced to a new class. Strictly a syntactic shortcut.
#
# For example we could make it claim to be
# the strongest one alive:
# {ON_POSTADVANCEMENT () (
# [message]
# speaker=unit
# message="I'm the strongest one alive!"
# [/message]
# )}
[event]
name=post_advance
first_time_only=no
[filter]
{FILTER}
[/filter]
{ACTION}
[/event]
#enddef

View File

@ -1,10 +1,9 @@
# Utility macros for images, overlays, and display effects.
# These don't depend on any other macros. Please don't change this.
#define MAGENTA_IS_THE_TEAM_COLOR
# A macro to define a common set of magenta color values which different
# units can be color shifted by using the team color system.
#define MAGENTA_IS_THE_TEAM_COLOR
flag_rgb=magenta
#enddef
@ -23,11 +22,12 @@ blue=255
#enddef
#define IS_HERO
# Embed this into a unit declaration to add a hero icon to the unit
# Embed this into a unit declaration to add a hero icon to the unit.
overlays="misc/hero-icon.png"
#enddef
#define DOT X Y
# Mark the specified map hex with a dot.
[image]
x,y={X},{Y}
file=misc/dot.png
@ -36,6 +36,7 @@ delay=500
#enddef
#define CROSS X Y
# Mark the specified map hex with a cross.
[image]
x,y={X},{Y}
file=misc/cross.png

View File

@ -1,13 +1,13 @@
# Interface shortcut macros.
# These don't depend on any other macros. Please don't change this.
# Displays a text message spoken by SPEAKER.
# Speaker can be any of: narrator, unit and second_unit
# For example, let's have the narrator, which looks like a feary
# express some feelings on the undead:
# {MESSAGE narrator "units/elves-wood/shyde.png" _ "Faery" _ "Aarr! Them be undeadies! Loooks at them.."}
#define MESSAGE SPEAKER IMAGE CAPTION TEXT
# Displays a text message spoken by SPEAKER.
# Speaker can be any of: narrator, unit and second_unit
# For example, let's have the narrator, which looks like a faery
# express some feelings on the undead:
# {MESSAGE narrator "units/elves-wood/shyde.png" _ "Faery" _ "Aarr! Them be undeadies! Loooks at them.."}
[message]
speaker={SPEAKER}
message={TEXT}
@ -16,15 +16,12 @@
[/message]
#enddef
# Scrolls the screen to the given coordinates.
# For example, lets focus on 26,35:
# {SCROLL 26 35}
# Puts a label on the map at x,y
# example:
# {SET_LABEL 4 7 _ "There be dragons here!"}
#define SET_LABEL X Y TEXT
# Puts TEXT on the map at X,Y. Strictly a syntactic shortcut.
#
# For example:
# {SET_LABEL 4 7 _ "There be dragons here!"}
[label]
x={X}
y={Y}
@ -32,11 +29,11 @@
[/label]
#enddef
# Removes a label from a given tile
# Exameple, remove it from 4,7
# {REMOVE_LABEL 4 7}
#define REMOVE_LABEL X Y
# Removes a label from a given tile.
#
# For example, remove it from 4,7
# {REMOVE_LABEL 4 7}
[label]
x={X}
y={Y}
@ -44,70 +41,71 @@
[/label]
#enddef
#define SET_LABEL_PERSISTANT X Y TEXT
# Sets a label on tile x,y that gets reset every sideturn in case
# someone clears it.
#
# Example:
# {SET_LABEL_PERSISTANT 4 7 _ "There really will be dragons here!!"}
#define SET_LABEL_PERSISTANT X Y TEXT
{SET_LABEL {X} {Y} ({TEXT}) }
{ON_SIDETURN (
{SET_LABEL {X} {Y} ({TEXT}) }
)}
#enddef
# Places an image at a given tile, shrinking it to fit the tile
# For example, lets put a tent on tile 14,5
# {SET_IMAGE 14 5 "terrain/tent.png"}
#define SET_IMAGE X Y IMAGE
# Places an image at a given tile, shrinking it to fit the tile
#
# For example, let's put a tent on tile 14,5
# {SET_IMAGE 14 5 "terrain/tent.png"}
[item]
x,y={X},{Y}
image={IMAGE}
[/item]
#enddef
# Removes a previously set image from a tile
#define REMOVE_IMAGE X Y
# Removes a previously set image from a tile.
#
# Example:
# {REMOVE_IMAGE 14 5}
#define REMOVE_IMAGE X Y
[removeitem]
x,y={X},{Y}
[/removeitem]
#enddef
# Shorthand for setting both an image and a label at once.
#define SET_IMAGE_AND_LABEL X Y IMAGE TEXT
# Shorthand for setting both an image and a label at once.
{SET_LABEL {X} {Y} ({TEXT}) }
{SET_IMAGE {X} {Y} ({IMAGE}) }
#enddef
# Shorthand for setting both a persistant label and image at once.
#define SET_IMAGE_AND_LABEL_PERSISTANT X Y IMAGE TEXT
# Shorthand for setting both a persistant label and image at once.
{SET_LABEL_PERSISTANT {X} {Y} ({TEXT}) }
{SET_IMAGE {X} {Y} ({IMAGE}) }
#enddef
# Shorthand for removing both image and label at once
#define REMOVE_IMAGE_AND_LABEL X Y
# Shorthand for removing both image and label at once
{REMOVE_IMAGE {X} {Y}}
{REMOVE_LABEL {X} {Y}}
#enddef
#define SCROLL X Y
# Scrolls the screen to the given coordinates.
#
# For example, let's focus on 26,35:
# {SCROLL 26 35}
[scroll]
x={X}
y={Y}
[/scroll]
#enddef
# Visuals and sound for an earth tremor.
#define TREMOR
# Visuals and sound for an earth tremor.
[sound]
name="rumble.ogg"
[/sound]
@ -133,6 +131,7 @@
[/scroll]
#enddef
#define EARTHQUAKE ACTION
# Creates an earthquake-effect while performing ACTION
# For example we could kill all non-leader units in the earthquake:
# {EARTHQUAKE (
@ -141,8 +140,6 @@
# animate=yes
# [/kill]
# )}
#define EARTHQUAKE ACTION
[sound]
name=lightning.ogg
[/sound]
@ -154,11 +151,10 @@
{SCROLL 1 -2}
#enddef
# adjusts the color of the screen by a tint or red, green and blue
#define COLOR_ADJUST RED GREEN BLUE
# Adjusts the color of the screen by a tint or red, green and blue
# for example, lets make it very blueish:
# {COLOR_ADJUST 0 0 100}
#define COLOR_ADJUST RED GREEN BLUE
[colour_adjust]
red={RED}
green={GREEN}
@ -169,6 +165,7 @@
# Flashes the screen with a given color performing ACTION
# These macros come in WHITE, RED, GREEN and BLUE and can
# easily be expanded for ORANGE, PURPLE etc.
#
# Example, Flash the screen to scare the player:
# {FLASH_GREEN ()}
# {FLASH_RED ()}
@ -176,6 +173,7 @@
# {FLASH_WHITE ()}
#define FLASH_WHITE ACTION
# Flash the screen momentarily white.
{COLOR_ADJUST 67 67 67}
{COLOR_ADJUST 100 100 100}
{ACTION}
@ -184,6 +182,7 @@
#enddef
#define FLASH_RED ACTION
# Flash the screen momentarily red.
{COLOR_ADJUST 67 0 0}
{COLOR_ADJUST 100 0 0}
{ACTION}
@ -192,6 +191,7 @@
#enddef
#define FLASH_GREEN ACTION
# Flash the screen momentarily green.
{COLOR_ADJUST 0 67 0}
{COLOR_ADJUST 0 100 0}
{ACTION}
@ -200,6 +200,7 @@
#enddef
#define FLASH_BLUE ACTION
# Flash the screen momentarily blue.
{COLOR_ADJUST 0 0 67}
{COLOR_ADJUST 0 0 100}
{ACTION}
@ -207,8 +208,9 @@
{COLOR_ADJUST 0 0 0}
#enddef
# Creates a flashlike-effect while performing ACTION
# For example, player 3 might disappear in the flash of a lightning:
#define THUNDER ACTION
# Creates a thunder-and-lightning effect while performing ACTION.
# For example, player 3 might disappear in the flash of lightning:
# {THUNDER (
# [store_unit]
# [filter]
@ -218,8 +220,6 @@
# kill=yes
# [/store_unit]
# )}
#define THUNDER ACTION
[sound]
name=lightning.ogg
[/sound]

View File

@ -1,14 +1,15 @@
# Utility macros for scenario-objectivew control.
# These macros don't depend on any others. Please don't change this.
#define SET_OBJECTIVES SIDE SUMMARY NOTE CONDITIONS
# Sets the objectives for a given player
# Side 0 means every player. Does not affect gameplay,
# except that it tells the player what the objectives of a scenario are.
#
# For example, we could set the objective for all players to: "survive for
# 3 turns" wuth this:
# {SET_OBJECTIVES 0 "Survive for 3 turns" () ()}
#
#define SET_OBJECTIVES SIDE SUMMARY NOTE CONDITIONS
[objectives]
side = {SIDE}
summary = {SUMMARY}
@ -17,40 +18,42 @@
[/objectives]
#enddef
#define VICTORY_CONDITION DESCRIPTION
# Used in conjunction with SET_OBJECTIVES this sets a victory condition
# (marked green).
#
# For example we could tell player 2 to win by killing all other players
# {SET_OBJECTIVES 0 "Kill eachother." (
# {VICTORY_CONDITION "Kill all other players."}
# )}
#
#define VICTORY_CONDITION DESCRIPTION
[objective]
condition = "win"
description = {DESCRIPTION}
[/objective]
#enddef
#define DEFEAT_CONDITION DESCRIPTION
# Used in conjunction with SET_OBJECTIVES this sets a defeat condition
# (marked red).
#
# For example we could tell all players that they lose if they die.
# {SET_OBJECTIVES 0 "Survive." (
# {DEFEAT_CONDITION "Death of your leader."}
# )}
#
#define DEFEAT_CONDITION DESCRIPTION
[objective]
condition = "lose"
description = {DESCRIPTION}
[/objective]
#enddef
#define SIDE_PLAYER SIDE TEAM DESCRIPTION GOLD INCOME SIDE_PARMS
# Defines a multiplayer side in a scenario that is controllable by the player.
#
# For example we can set side 1 to be a player belonging to team "Good Guys"
# starting with 200g and no income:
# {SIDE_PLAYER 1 "Good Guys" "Good Guy #1" 200 -2 ()}
#
#define SIDE_PLAYER SIDE TEAM DESCRIPTION GOLD INCOME SIDE_PARMS
[side]
description={DESCRIPTION}
side={SIDE}
@ -63,15 +66,16 @@
[/side]
#enddef
#define SIDE_COMPUTER SIDE TEAM DESCRIPTION GOLD INCOME SIDE_PARMS AI_PARMS
# Defines a multiplayer side in a scenario that is controllad by the computer.
# For example we can set side 4 to be a computer belonging to team "Evil Guys"
#
# For example, we can set side 4 to be a computer belonging to team "Evil Guys"
# starting with 666g and no 99 income.
# We also make it more aggressive:
# {SIDE_COMPUTER 4 "Evil Guys" "Evil One" 666 99 (
# aggression=0.95
# )}
#
#define SIDE_COMPUTER SIDE TEAM DESCRIPTION GOLD INCOME SIDE_PARMS AI_PARMS
[side]
description={DESCRIPTION}
side={SIDE}

View File

@ -14,12 +14,10 @@
# like that. Of course, if you want something more elaborate, code it
# manually.
#define DEFAULT_MUSIC_PLAYLIST
# A macro to define a standard playlist suitable for any level. The
# music is defined twice to catch instances where music is changed in
# a story and not set back.
#define DEFAULT_MUSIC_PLAYLIST
[music]
name=gameplay01.ogg
ms_before=12000
@ -84,6 +82,9 @@
#enddef
#
#
#define SCENARIO_MUSIC MUSIC
# This music macro ensures that the correct music is selected
# for a scenario just in case it is changed by [story].
# It should be positioned at the top of the scenario file
@ -91,17 +92,14 @@
#
# It also allows for the convenient use of a standardized
# intra-scenario music, should we decide to use one.
#
#define SCENARIO_MUSIC MUSIC
[music]
name="wesnoth-2.ogg"
[/music]
[event]
name=prestart
[music]
name={MUSIC}
[/music]
name="wesnoth-2.ogg"
[/music]
[event]
name=prestart
[music]
name={MUSIC}
[/music]
[/event]
#enddef

View File

@ -1,14 +1,14 @@
# Macros for teleporting units.
# These don't depend on any other macros. Please don't change this.
#define TELEPORT_UNIT FILTER NEWX NEWY
# Teleports a unit matching FILTER to NEWX,NEWY
# For example, teleport player 3's leader to 4,5
#
# {TELEPORT_UNIT (
# side=3
# canrecruit=1
# ) 4 5}
#define TELEPORT_UNIT FILTER NEWX NEWY
[teleport]
[filter]
{FILTER}
@ -20,11 +20,11 @@
[/redraw]
#enddef
#define TELEPORT_TILE OLDX OLDY NEWX NEWY
# Teleports a unit on tile OLDX,OLDY to NEWX,NEWY
#
# For example, teleport any unit thats currently on 1,1 to 4,5
# {TELEPORT_TILE 1 1 4 5}
#define TELEPORT_TILE OLDX OLDY NEWX NEWY
[teleport]
[filter]
x={OLDX}

View File

@ -1,12 +1,11 @@
# Utility macros for manipulating map terrain.
# These don't depend on any other macros. Please don't change this.
# Changes the terrain at a given list of coordinates
# For example we could make 14,15 and 14,16 grassland:
# {MODIFY_TERRAIN g (14,14) (15,16)}
#define MODIFY_TERRAIN LETTER X Y
# Changes the terrain at a given list of coordinates
#
# For example, we could make 14,15 and 14,16 grassland:
# {MODIFY_TERRAIN g (14,14) (15,16)}
[terrain]
letter={LETTER}
x={X}
@ -14,16 +13,15 @@
[/terrain]
#enddef
#define MODIFY_TERRAIN_MASK X Y MASK RULES
# Changes the terrain for a given area
# For example we could create a castle at 10,12:
# #define CASTLE_MASK
#
# For example, we could create a castle at 10,12:
# {MODIFY_TERRAIN_MASK 10 12 (
# CC
# CKC
# CC
# #enddef
# {MODIFY_TERRAIN_MASK 10 12 ({CASTLE_MASK})}
#define MODIFY_TERRAIN_MASK X Y MASK RULES
# )}
[terrain_mask]
x={X}
y={Y}

View File

@ -46,67 +46,67 @@
#### END OF TABLE OF CONTENTS ####
#macro to define a 'quantity' differently based on difficulty levels
#define QUANTITY ATTRIBUTE ON_EASY ON_NORMAL ON_HARD
# Macro to define a 'quantity' differently based on difficulty levels.
#ifdef EASY
{ATTRIBUTE}={ON_EASY}
#endif
#ifdef NORMAL
{ATTRIBUTE}={ON_NORMAL}
#endif
#ifdef HARD
{ATTRIBUTE}={ON_HARD}
#endif
#enddef
#macro to define number of turns for different difficulty levels
#define TURNS ON_EASY ON_NORMAL ON_HARD
# Macro to define number of turns for different difficulty levels.
{QUANTITY turns {ON_EASY} {ON_NORMAL} {ON_HARD}}
#enddef
#macro which will let you go {GOLD x y z} to set
#the gold depending on easy/medium/hard - x/y/z
#define GOLD ON_EASY ON_NORMAL ON_HARD
# Macro which will let you say {GOLD x y z} to set
# starting gold depending on easy/medium/hard - x/y/z
{QUANTITY gold {ON_EASY} {ON_NORMAL} {ON_HARD}}
#enddef
#define INCOME ON_EASY ON_NORMAL ON_HARD
# Macro which will let you say {GOLD x y z} to set
# per-turn income depending on easy/medium/hard - x/y/z
{QUANTITY income {ON_EASY} {ON_NORMAL} {ON_HARD}}
#enddef
#macro to define AI attack depth for different difficulty levels (set it to 1-6)
#define ATTACK_DEPTH ON_EASY ON_NORMAL ON_HARD
# Macro to define AI attack depth for different difficulty levels
# (set it to 1-6)
{QUANTITY attack_depth {ON_EASY} {ON_NORMAL} {ON_HARD}}
#enddef
#macro to make an AI team not recruit scouts
#define NO_SCOUTS
# Macro to make an AI team not recruit scouts.
villages_per_scout=0
#enddef
#macro to quickly pick a random value (in the $random variable, to avoid
#cluterring up savegames with such temporary variables)
#define RANDOM RANGE
# Macro to quickly pick a random value (in the $random variable, to avoid
# cluttering up savegames with such temporary variables).
[set_variable]
name=random
random={RANGE}
[/set_variable]
#enddef
#macro to initialize a variable
#define VARIABLE VAR VALUE
# Macro to initialize a variable. Strictly a syntatic shortcut.
[set_variable]
name={VAR}
value={VALUE}
[/set_variable]
#enddef
#macro to do mathematical operations on variables
#define VARIABLE_OP VAR OP ARG
# Macro to do mathematical operations on variables.
[set_variable]
name={VAR}
{OP}={ARG}
@ -114,13 +114,14 @@ name={VAR}
#enddef
#define CLEAR_VARIABLE VAR
# Macro to clear a variable previously set.
[clear_variable]
name={VAR}
[/clear_variable]
#enddef
#macro to iterate over an array
#define FOREACH ARRAY VAR
# Macro to begin a WML clause that iterates over an array.
{VARIABLE {VAR} 0}
[while]
[variable]
@ -131,6 +132,7 @@ name={VAR}
#enddef
#define NEXT VAR
# Macro to end a WML clause that iterates over an array.
[set_variable]
name={VAR}
add=1
@ -141,21 +143,20 @@ name={VAR}
#enddef
#define DEBUG_MSG MSG
# Emit a debug message. Meant to be overridden with no-op definition
# of the same name for proction use.
[message]
speaker=narrator
message={MSG}
[/message]
#enddef
# MODIFY_UNIT alters a unit variable (such as unit.x, unit.type,
#define MODIFY_UNIT FILTER VAR VALUE
# Alters a unit variable (such as unit.x, unit.type,
# unit.side), handling all the storing and unstoring.
#
# Example that flips all spearmen to side 2:
# {MODIFY_UNIT type=Spearman side 2}
#define MODIFY_UNIT FILTER VAR VALUE
[store_unit]
[filter]
{FILTER}
@ -180,15 +181,12 @@ message={MSG}
{CLEAR_VARIABLE MODIFY_UNIT_store}
#enddef
#define STORE_UNIT_VAR FILTER VAR TO_VAR
# Stores an attribute of a unit to the given variable.
#
# Example where this is used to flip all orcs to whatever side James is on:
#
# {STORE_UNIT_VAR description=James side side_of_James}
# {MODIFY_UNIT race=orc side $side_of_James}
#define STORE_UNIT_VAR FILTER VAR TO_VAR
[store_unit]
[filter]
{FILTER}
@ -203,13 +201,12 @@ message={MSG}
{CLEAR_VARIABLE STORE_UNIT_VAR_store}
#enddef
#define IF_TERRAIN X Y TYPES CONTENTS
# This is a way to check whether or not the terrain in the given coordinates
# is of the given type or types. Might be useful, since filtering by terrain
# isn't possible directly.
#
# You can use it for example like this:
#
# You can use it, for example, like this:
# [event]
# name=moveto
# first_time_only=no
@ -220,8 +217,6 @@ message={MSG}
# [/then]
# )}
# [/event]
#define IF_TERRAIN X Y TYPES CONTENTS
[store_locations]
x={X}
y={Y}
@ -241,7 +236,7 @@ message={MSG}
{CLEAR_VARIABLE IF_TERRAIN_temp}
#enddef
#define CREATE_UNIT SIDE TYPE X Y UNIT_ID OTHER
# Creates a unit of TYPE belonging to SIDE at X,Y. UNIT_ID can be used
# when filtering on it. For example, let's create a wose for player 1
# at 4,7
@ -254,8 +249,6 @@ message={MSG}
# {CREATE_UNIT 1 "Wose" 4 7 "Woselina" (
# canrecruit=1
# )}
#define CREATE_UNIT SIDE TYPE X Y UNIT_ID OTHER
[unit]
side={SIDE}
type={TYPE}
@ -268,14 +261,14 @@ message={MSG}
{OTHER}
[/unit]
#enddef
#define MOVE_UNIT FILTER TO_X TO_Y
# Moves a unit from its current location to the given location along a
# relatively straight line displaying the movement just like [move_unit_fake]
# does.
#
# Note that setting the destination on an existing unit does not kill either
# one, but causes the unit to move to the nearest vacant hex instead.
#define MOVE_UNIT FILTER TO_X TO_Y
[store_unit]
[filter]
{FILTER}
@ -317,7 +310,7 @@ message={MSG}
[redraw][/redraw]
#enddef
#define PUT_TO_RECALL_LIST FILTER
# This places a given unit back to the recall list of the side it is on.
# Note however, that the unit is not healed to full health, so when
# recalled (even if not until the next scenario) the unit may have less
@ -335,8 +328,6 @@ message={MSG}
#
# {PUT_TO_RECALL_LIST x,y=20,38}
# [/event]
#define PUT_TO_RECALL_LIST FILTER
[store_unit]
[filter]
{FILTER}
@ -357,10 +348,8 @@ message={MSG}
{NEXT i}
#enddef
#macro to make a side start a scenario with villages
#define STARTING_VILLAGES SIDE RADIUS
# Macro to make a side start a scenario with villages
[event]
name=prestart
[store_starting_location]
@ -393,17 +382,12 @@ name=prestart
[/event]
#enddef
#define MENU_IMG_TXT IMG TXT
"&"+{IMG}+"="+{TXT}#enddef
#define MENU_IMG_TXT2 IMG TXT1 TXT2
"&"+{IMG}+"="+{TXT1}+"="+{TXT2}#enddef
#
#USAGE {UNIT (Elvish Fighter) (Myname) ( _ "Myname") 1 1 1}
#
#define UNIT TYPE DESCRIPTION UDESCRIPTION SIDE X Y
# Create a unit with the Loyal trait.
#
# Example:
# {UNIT (Elvish Fighter) (Myname) ( _ "Myname") 1 1 1}
#
[unit]
type={TYPE}
description={DESCRIPTION}
@ -418,6 +402,7 @@ name=prestart
#enddef
#define UNDEAD_UNIT TYPE SIDE X Y
# Create a unit with the Undead and Loyal traits.
[unit]
type={TYPE}
side={SIDE}
@ -430,4 +415,12 @@ name=prestart
[/unit]
#enddef
# FIXME: Documentation for these is needed.
#define MENU_IMG_TXT IMG TXT
"&"+{IMG}+"="+{TXT}#enddef
#define MENU_IMG_TXT2 IMG TXT1 TXT2
"&"+{IMG}+"="+{TXT1}+"="+{TXT2}#enddef