#textdomain wesnoth-tutorial
#define LABEL STRING POS
[set_variable]
	name=label_string
	format={STRING}
[/set_variable]
[label]
	x,y={POS}
	text=$label_string
[/label]
{CLEAR_VARIABLE label_string}
#enddef
#define UNLABEL POS
[label]
	x,y={POS}
	text=""
[/label]
#enddef

#define PRINT STRING
[set_variable]
	name=print_string
	format={STRING}
[/set_variable]
[print]
	text=$print_string
	size=18
	duration=10000
	red,green,blue=255,255,255
[/print]
{CLEAR_VARIABLE print_string}
#enddef

#define CLEAR_PRINT
[print]
	text=""
[/print]
#enddef

#define MOVE DESCRIPTION STARTX STARTY ENDX ENDY
[scroll_to]
	x,y={STARTX},{STARTY}
[/scroll_to]
[store_unit]
	[filter]
		description={DESCRIPTION}
	[/filter]
	variable=MOVE_tmp
	kill=yes
[/store_unit]
[redraw][/redraw]
[move_unit_fake]
	type=$MOVE_tmp.type
	side=$MOVE_tmp.side
	x={STARTX},{ENDX}
	y={STARTY},{ENDY}
[/move_unit_fake]
# Drain moves
{VARIABLE MOVE_tmp.moves 0}
{VARIABLE MOVE_tmp.x {ENDX}}
{VARIABLE MOVE_tmp.y {ENDY}}
[unstore_unit]
	variable=MOVE_tmp
[/unstore_unit]
[redraw][/redraw]
{CLEAR_VARIABLE MOVE_tmp}
#enddef

#define NUMEQ VAR VAL
[variable]
	name={VAR}
	numerical_equals={VAL}
[/variable]
#enddef

#define GENDER A B
[if]
	[variable]
		name=gender
		equals=male
	[/variable]
[then]
	{A}
[/then]
[else]
	{B}
[/else]
[/if]
#enddef
