#textdomain wesnoth
# Interface shortcut macros.
# These don't depend on any other macros. Please don't change this.
# ! in comments is used to generate HTML documentation; ignore it otherwise.
#define HIGHLIGHT_IMAGE X Y IMAGE BACKGROUND_VALUE
# Scrolls to the given location, blinks the given image in and out a few
# times, and then leaves the image in place. Use this to pinpoint an
# important location to the player. If there's an existing [item] on the
# location, specify it as the BACKGROUND_VALUE or else it'll get lost
# during the blinking.
[scroll_to]
x,y={X},{Y}
check_fogged=no
[/scroll_to]
[repeat]
times=3
[do]
[item]
x,y={X},{Y}
halo={IMAGE}
[/item]
[redraw][/redraw]
[delay]
time=300
[/delay]
[remove_item]
x,y={X},{Y}
[/remove_item]
[item]
x,y={X},{Y}
image={BACKGROUND_VALUE}
[/item]
[redraw][/redraw]
[delay]
time=300
[/delay]
[/do]
[/repeat]
[item]
x,y={X},{Y}
image={IMAGE}
[/item]
[redraw][/redraw]
#enddef
#define CLEAR_FOG SIDE X Y RADIUS
# Clears fog in a specific area for the given side.
# This will persist until {UNCLEAR_FOG} (below) is used.
[lift_fog]
[filter_side]
side={SIDE}
[/filter_side]
x,y={X},{Y}
radius={RADIUS}
multiturn=yes
[/lift_fog]
#enddef
#define UNCLEAR_FOG
# Restores fog that was temporarily cleared (check CLEAR_FOG above). Only
# one UNCLEAR_FOG is required no matter how many times CLEAR_FOG was used.
[reset_fog]
[/reset_fog]
#enddef
#define SET_LABEL X Y STRING
# Puts STRING 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}
text={STRING}
[/label]
#enddef
#define REMOVE_LABEL X Y
#arg EXTRA_WML
#endarg
# Removes a label from a given tile.
#
# For example, remove it from 4,7
#! {REMOVE_LABEL 4 7}
[label]
x={X}
y={Y}
text="" # wmllint: ignore
{EXTRA_WML}
[/label]
#enddef
#define FAKE_UNIT_MOVE FROM_X TO_X FROM_Y TO_Y SIDE TYPE MODIFIER_WML
# Moves a fake unit using TYPE's animations, from (FROM_X, FROM_Y)
# to (TO_X, TO_Y). You can also specify modifiers that change the
# baseframe displayed by unit's gender or variation, or none at
# all.
#
# Example:
#! {FAKE_UNIT_MOVE 1 2 1 2 1 (Dark Adept) (
#! gender=female
#! variation=fancy
#! )}
[move_unit_fake]
type={TYPE}
side={SIDE}
x={FROM_X},{TO_X}
y={FROM_Y},{TO_Y}
{MODIFIER_WML}
[/move_unit_fake]
#enddef
#define SCROLL X Y
# Scrolls the screen by the specified offsets
#
# For example, let's scroll 5 right and 3 down:
#! {SCROLL 5 3}
[scroll]
x={X}
y={Y}
[/scroll]
#enddef
#define SCROLL_TO X Y
# Scrolls the screen to focus on the specified coordinates
#
# For example, let's focus on 26,35:
#! {SCROLL_TO 26 35}
[scroll_to]
x={X}
y={Y}
[/scroll_to]
#enddef
#define QUAKE SOUND
# Visuals and sound for an earth tremor.
[sound]
name={SOUND}
[/sound]
[scroll]
x=5
y=0
[/scroll]
[scroll]
x=-10
y=0
[/scroll]
[scroll]
x=5
y=5
[/scroll]
[scroll]
x=0
y=-10
[/scroll]
[scroll]
x=0
y=5
[/scroll]
#enddef
#define EARTHQUAKE ACTION_WML
# Creates an earthquake-effect while performing ACTION_WML
# For example we could kill all non-leader units in the earthquake:
#! {EARTHQUAKE (
#! [kill]
#! canrecruit=no
#! animate=yes
#! [/kill]
#! )}
[sound]
name=lightning.ogg
[/sound]
{SCROLL 2 1}
{SCROLL -1 -3}
{SCROLL -3 1}
{ACTION_WML}
{SCROLL 1 3}
{SCROLL 1 -2}
#enddef
#define COLOR_ADJUST RED GREEN BLUE
# Adjusts the color of terrain by a tint of red, green and blue
# for example, let's make it very blueish:
#! {COLOR_ADJUST 0 0 100}
[color_adjust]
red={RED}
green={GREEN}
blue={BLUE}
[/color_adjust]
#enddef
#define SCREEN_FADE RED GREEN BLUE DURATION
[screen_fade]
red={RED}
green={GREEN}
blue={BLUE}
alpha=255
duration={DURATION}
[/screen_fade]
#enddef
#define SCREEN_UNFADE DURATION
[screen_fade]
alpha=0
duration={DURATION}
[/screen_fade]
#enddef
#define SCREEN_FADE_OUT
{SCREEN_FADE 0 0 0 500}
#enddef
#define SCREEN_FADE_IN
{SCREEN_UNFADE 500}
#enddef
#define FLASH RED GREEN BLUE ACTION_WML
# Flash the screen this colour, performing the action during the flash.
# The action will be performed at the height of the flash,
# and the screen will still be slightly visible during the action.
# For example to flash the screen orange and play an explosion sound:
#! {FLASH 255 128 0 (
#! [sound]
#! name=explosion.ogg
#! [/sound]
#! )}
[screen_fade]
red,green,blue={RED},{GREEN},{BLUE}
alpha=200
duration=150
[/screen_fade]
[delay]
time=35
[/delay]
{ACTION_WML}
[delay]
time=35
[/delay]
{SCREEN_UNFADE 150}
#enddef
#define FLASH_WHITE ACTION_WML
# Flash the screen momentarily white, performing the given action during
# the flash.
{FLASH 255 255 255 ({ACTION_WML})}
#enddef
#define FLASH_RED ACTION_WML
# Flash the screen momentarily red, performing the given action during
# the flash.
{FLASH 255 0 0 ({ACTION_WML})}
#enddef
#define FLASH_GREEN ACTION_WML
# Flash the screen momentarily green, performing the given action during
# the flash.
{FLASH 0 255 0 ({ACTION_WML})}
#enddef
#define FLASH_BLUE ACTION_WML
# Flash the screen momentarily blue, performing the given action during
# the flash.
{FLASH 0 0 255 ({ACTION_WML})}
#enddef
#define THUNDER ACTION_WML
# Creates a thunder-and-lightning effect while performing ACTION_WML.
# For example, player 3 might disappear in the flash of lightning:
#! {THUNDER (
#! [store_unit]
#! [filter]
#! side=3
#! [/filter]
#! variable=player3
#! kill=yes
#! [/store_unit]
#! )}
[sound]
name=lightning.ogg
[/sound]
{FLASH_WHITE ({ACTION_WML}) }
#enddef
#define FLASH_LIGHTNING ACTION_WML
# Perform the given action WML with an accompanying lightning effect.
[screen_fade]
red,green,blue=240,230,255
alpha=100
duration=50
[/screen_fade]
[sound]
name=lightning.ogg
[/sound]
[delay]
time=25
[/delay]
{ACTION_WML}
[delay]
time=75
[/delay]
{SCREEN_UNFADE 250}
#enddef
#define FADE_STEP_RGB RED GREEN BLUE DELAY_TIME
# Defines a single step in a fade animation; used internally by the other fade macros.
[color_adjust]
red,green,blue={RED},{GREEN},{BLUE}
[/color_adjust]
[delay]
time={DELAY_TIME}
[/delay]
[redraw][/redraw]
#enddef
#define FADE_STEP NUMBER DELAY_TIME
# Defines a single step in a monochrome fade animation; used internally in the fade to black macros.
{FADE_STEP_RGB {NUMBER} {NUMBER} {NUMBER} {DELAY_TIME}}
#enddef
#define FADE_TO_BLACK
# Fades the screen to black. Use {FADE_IN} to return to normal
{FADE_STEP -32 5}
{FADE_STEP -64 5}
{FADE_STEP -96 5}
{FADE_STEP -128 5}
{FADE_STEP -160 5}
{FADE_STEP -192 5}
{FADE_STEP -224 5}
{FADE_STEP -256 5}
{FADE_STEP -512 5}
#enddef
#define FADE_TO_BLACK_HOLD TIME
# Fades the screen to black and then pauses for TIME milliseconds.
# Use {FADE_IN} to return to normal
{FADE_STEP -32 5}
{FADE_STEP -64 5}
{FADE_STEP -96 5}
{FADE_STEP -128 5}
{FADE_STEP -160 5}
{FADE_STEP -192 5}
{FADE_STEP -224 5}
{FADE_STEP -256 5}
{FADE_STEP -512 {TIME}}
#enddef
#define FADE_IN
# Brings the screen back from a {FADE_TO_BLACK}
{FADE_STEP -256 5}
{FADE_STEP -224 5}
{FADE_STEP -192 5}
{FADE_STEP -160 5}
{FADE_STEP -128 5}
{FADE_STEP -96 5}
{FADE_STEP -64 5}
{FADE_STEP -32 5}
{FADE_STEP 0 5}
#enddef
# Encapsulate text in conventional markup for characters whispering.
# We do this so whispers can be restyled by tweaking this markup
#define WHISPER TEXT
"(" + {TEXT} + ")"#enddef
# Encapsulate text in conventional markup for characters speaking aside.
# We do this so asides can be restyled by tweaking this markup
#define ASIDE TEXT
"(" + {TEXT} + ")"#enddef
# Encapsulate text in conventional markup similar to how standard
# character message dialogs are rendered. Intended for story screens
# mainly.
#define CAPTION TEXT
"" + {TEXT} + "
"#enddef