/
hex.cfg
214 lines (203 loc) · 4.94 KB
/
hex.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
#textdomain wesnoth-Ageless_Era
# wmllint: unbalanced-on
#define AE_WEAPON_SPECIAL_HEX
# fake special used to describe the mechanics
# and filter on when the events are launched
[dummy]
id=AE_efm_hex
name= _ "hex"
name_inactive= _ "Hex"
description= _ "Curses the hit unit. The cursed unit gets a 15% defense penalty on every terrain until it is cured by a village.
Does not affect undeads or leaders, and the defense value can't go lower than 10%."
apply_to=opponent
[/dummy]
# wmlxgettext: [specials]
[/specials]
# wmlxgettext: [attack]
[/attack]
# # # # # INFLICT THE CURSE # # # # #
# Remember if current attacker/defender is potential target of curse
[event]
name=attack
first_time_only=no
id=AE_efm_hex_attack1
[filter_attack]
special=AE_efm_hex
[/filter_attack]
[filter_second]
canrecruit=no
[not]
status=AE_efm_curse
[/not]
[not]
status=not_living
[/not]
[/filter_second]
[set_variable]
name=AE_efm_defender_cursable
value=yes
[/set_variable]
[/event]
[event]
name=attack
first_time_only=no
id=AE_efm_hex_attack2
[filter_second_attack]
special=AE_efm_hex
[/filter_second_attack]
[filter]
canrecruit=no
[not]
status=AE_efm_curse
[/not]
[not]
status=not_living
[/not]
[/filter]
[set_variable]
name=AE_efm_attacker_cursable
value=yes
[/set_variable]
[/event]
# Record that attacker/defender was target and was hit
[event]
name=attacker hits
first_time_only=no
id=AE_efm_hex_attacker_1
[filter_attack]
special=AE_efm_hex
[/filter_attack]
[filter_condition]
[variable]
name=AE_efm_defender_cursable
equals=yes
[/variable]
[/filter_condition]
[set_variable]
name=AE_efm_curse_defender
value=yes
[/set_variable]
[/event]
[event]
name=defender hits
first_time_only=no
id=AE_efm_hex_defender_1
[filter_second_attack]
special=AE_efm_hex
[/filter_second_attack]
[filter_condition]
[variable]
name=AE_efm_attacker_cursable
equals=yes
[/variable]
[/filter_condition]
[set_variable]
name=AE_efm_curse_attacker
value=yes
[/set_variable]
[/event]
# applies curse
[event]
name=attack end
first_time_only=no
id=AE_efm_hex_attacker_2
[filter_attack]
special=AE_efm_hex
[/filter_attack]
[filter_condition]
[variable]
name=AE_efm_curse_defender
equals=yes
[/variable]
[/filter_condition]
[AE_efm_add_hex]
id=$second_unit.id
[/AE_efm_add_hex]
{CLEAR_VARIABLE AE_efm_curse_defender,AE_efm_defender_cursable}
[/event]
[event]
name=attack end
first_time_only=no
id=AE_efm_hex_defender_2
[filter_second_attack]
special=AE_efm_hex
[/filter_second_attack]
[filter_condition]
[variable]
name=AE_efm_curse_attacker
equals=yes
[/variable]
[/filter_condition]
[AE_efm_add_hex]
id=$unit.id
[/AE_efm_add_hex]
{CLEAR_VARIABLE AE_efm_curse_attacker,AE_efm_attacker_cursable}
[/event]
# cleans variables in case curse did not happen
[event]
name=attack end
first_time_only=no
id=AE_efm_hex_attacker_3
[filter_attack]
special=AE_efm_hex
[/filter_attack]
[filter_condition]
[variable]
name=AE_efm_defender_cursable
equals=yes
[/variable]
[/filter_condition]
{CLEAR_VARIABLE AE_efm_defender_cursable}
[/event]
[event]
name=attack end
first_time_only=no
id=AE_efm_hex_defender_3
[filter_second_attack]
special=AE_efm_hex
[/filter_second_attack]
[filter_condition]
[variable]
name=AE_efm_attacker_cursable
equals=yes
[/variable]
[/filter_condition]
{CLEAR_VARIABLE AE_efm_attacker_cursable}
[/event]
# # # # # HEAL THE CURSE # # # # #
# event that switches the "cursed" variable to "no" if a unit is resting in a village
# and switches defense back to normal
[event]
name=turn refresh
first_time_only=no
id=AE_efm_hex_turn_refresh_heal
[filter_condition]
[have_unit]
status=AE_efm_curse
[/have_unit]
[/filter_condition]
[AE_efm_remove_hex]
status=AE_efm_curse
[filter_location]
terrain="*^V*"
[/filter_location]
[/AE_efm_remove_hex]
[/event]
# This next event removes the curse if a unit advances
[event]
name=advance
first_time_only=no
id=AE_efm_hex_advance
[filter]
status=AE_efm_curse
[/filter]
[AE_efm_remove_hex]
id=$unit.id
[/AE_efm_remove_hex]
[/event]
[+attack]
# wmlxgettext: [/attack]
[+specials]
# wmlxgettext: [/specials]
#enddef
# wmllint: unbalanced-off