-
-
Notifications
You must be signed in to change notification settings - Fork 988
/
macros.cfg
107 lines (93 loc) · 2.7 KB
/
macros.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#textdomain wesnoth-did
# MODIFY_ONE_UNIT alters a unit variable for a single unit
#define MODIFY_ONE_UNIT FILTER WML
[store_unit]
[filter]
{FILTER}
[/filter]
variable=MODIFY_UNIT_store
kill=no
[/store_unit]
[modify_unit]
[filter]
id=$MODIFY_UNIT_store[0].id
[/filter]
{WML}
[/modify_unit]
{CLEAR_VARIABLE MODIFY_UNIT_store}
#enddef
# Create a new ghost-type "advisor" if Malin doesn't already have one
#define CREATE_ADVISOR
[if]
[have_unit]
side=1
role=advisor
search_recall_list=yes
[/have_unit]
[then]
# Recall an advisor if we have one
[recall]
role=advisor
[/recall]
[/then]
[else]
# Else, make a new advisor from a ghost unit
[role]
role=advisor
side=1
type=Spectre,Nightgaunt,Wraith,Shadow,Ghost
search_recall_list=yes
[auto_recall][/auto_recall]
[else]
# If that fails too, make a brand new ghost advisor
[unit]
type=Ghost
side=1
role=advisor
animate=yes
placement=leader
[/unit]
[/else]
[/role]
[/else]
[/if]
#enddef
#define MANOR_DOORS ALLOWED_SIDES
# Triggers when moving next to any door terrain and will replace it
# with an 'opened' variant.
[event]
name=moveto
first_time_only=no
[filter]
side={ALLOWED_SIDES}
[filter_location]
[filter_adjacent_location]
terrain=*^Pr*
[/filter_adjacent_location]
[/filter_location]
[not]
[filter_location]
[filter_adjacent_location]
terrain=*^Pr/o,*^Pr\o,*^Pr|o
[/filter_adjacent_location]
[/filter_location]
[/not]
[/filter]
[store_locations]
terrain=*^Pr*
[filter_adjacent_location]
x,y=$x1,$y1
[/filter_adjacent_location]
variable=door_to_open
[/store_locations]
[terrain]
x,y=$door_to_open.x,$door_to_open.y
terrain="$door_to_open.terrain|o" # Append 'o' to the terrain string to get open variant.
layer=both
[/terrain]
[redraw]
side=$unit.side
[/redraw]
{CLEAR_VARIABLE door_to_open}
[/event]
#enddef