mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-30 01:47:13 +00:00
91 lines
1.8 KiB
INI
91 lines
1.8 KiB
INI
# Condition triggering if 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}
|
|
[/have_unit]
|
|
[then]
|
|
{ACTION}
|
|
[/then]
|
|
[/if]
|
|
#enddef
|
|
|
|
# Condition triggering if PLAYER has no units left.
|
|
# For example, give player 2 gold if player 1 is dead
|
|
# {IF_DEAD 1 (
|
|
# [gold]
|
|
# side=2
|
|
# amount=25
|
|
# [/gold]
|
|
# )}
|
|
|
|
#define IF_DEAD PLAYER ACTION
|
|
[if]
|
|
[have_unit]
|
|
side={PLAYER}
|
|
[/have_unit]
|
|
[then]
|
|
[/then]
|
|
[else]
|
|
{ACTION}
|
|
[/else]
|
|
[/if]
|
|
#enddef
|
|
|
|
# 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.
|
|
# For example, if player 3 and 4 is allied, steal 10 gold from each:
|
|
# {IF_ALLIED 3 4 (
|
|
# [gold]
|
|
# side=3
|
|
# amount=-10
|
|
# [/gold]
|
|
# [gold]
|
|
# side=4
|
|
# amount=-10
|
|
# [/gold]
|
|
# )}
|
|
|
|
#define IF_ALLIED PLAYER1 PLAYER2 ACTION
|
|
[store_unit]
|
|
[filter]
|
|
side={PLAYER1}
|
|
canrecruit=1
|
|
[/filter]
|
|
variable=leader1
|
|
mode=replace
|
|
kill=no
|
|
[/store_unit]
|
|
[store_unit]
|
|
[filter]
|
|
side={PLAYER2}
|
|
canrecruit=1
|
|
[/filter]
|
|
variable=leader2
|
|
mode=replace
|
|
kill=no
|
|
[/store_unit]
|
|
[if]
|
|
[variable]
|
|
name=leader1.team_name
|
|
equals=$leader2.team_name
|
|
[/variable]
|
|
[then]
|
|
{ACTION}
|
|
[/then]
|
|
[/if]
|
|
[clear_variable]
|
|
name=leader1
|
|
[/clear_variable]
|
|
[clear_variable]
|
|
name=leader2
|
|
[/clear_variable]
|
|
#enddef
|