-
-
Notifications
You must be signed in to change notification settings - Fork 988
/
aspect_complex.cfg
308 lines (288 loc) · 5.63 KB
/
aspect_complex.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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
#define AI_FILTER_KEY_MISSING KEY
[not]
glob_on_{KEY}=*
[/not]
#enddef
#define AI_ASPECT_FILTER_STANDARD
engine=cpp
name=standard_aspect
[or]
{AI_FILTER_KEY_MISSING engine}
name=standard_aspect
[/or]
#enddef
#define AI_ASPECT_FILTER_COMPOSITE
engine=cpp
name=composite_aspect
[or]
{AI_FILTER_KEY_MISSING engine}
name=composite_aspect
[/or]
#enddef
#define AI_ASPECT_FILTER_DEFAULT
[or]
engine=cpp
{AI_FILTER_KEY_MISSING name}
[/or]
[or]
{AI_FILTER_KEY_MISSING engine}
{AI_FILTER_KEY_MISSING name}
[/or]
#enddef
#define AI_ASPECT_FILTER_ATTACKS
engine=cpp
name=ai_default_rca::aspect_attacks
id=attacks
[or]
{AI_FILTER_KEY_MISSING engine}
name=ai_default_rca::aspect_attacks
id=attacks
[/or]
[or]
engine=cpp
{AI_FILTER_KEY_MISSING name}
id=attacks
[/or]
[or]
{AI_FILTER_KEY_MISSING engine}
{AI_FILTER_KEY_MISSING name}
id=attacks
[/or]
#enddef
#define AI_ASPECT_FILTER_LUA
engine=lua
name=lua_aspect
[or]
engine=lua
{AI_FILTER_KEY_MISSING name}
[/or]
[or]
{AI_FILTER_KEY_MISSING engine}
name=lua_aspect
[/or]
#enddef
#define AI_ASPECT_SWITCH BASE
[switch]
key=id
[case]
value=aggression,caution,leader_aggression,leader_value,scout_village_targeting,village_value,recruitment_diversity
super="{BASE}~real"
[/case]
[case]
value=leader_ignores_keep,passive_leader,passive_leader_shares_keep,simple_targeting,support_villages
super="{BASE}~bool"
[/case]
[case]
value=villages_per_scout,attack_depth,recruitment_randomness
super="{BASE}~int"
[/case]
[case]
value=grouping
super="{BASE}~ai_grouping"
[/case]
[case]
value=advancements,recruitment_more,recruitment_pattern
super="{BASE}~string_list"
[/case]
[case]
value=avoid
super="{BASE}~avoid"
[/case]
[case]
value=leader_goal
super="{BASE}~leader_goal"
[/case]
[case]
value=recruitment_instructions
super="{BASE}~recruitment_instructions"
[/case]
[case]
value=recruitment_save_gold
super="{BASE}~recruitment_save_gold"
[/case]
[case]
value=attacks
super="{BASE}~attacks"
[/case]
[/switch]
#enddef
[tag]
name="aspect"
super="$ai/$component"
max=infinite
{AI_ASPECT_INVALIDATE}
[if]
{AI_ASPECT_FILTER_STANDARD}
[then]
{AI_ASPECT_SWITCH $ai/standard_aspect}
[/then]
[elseif]
{AI_ASPECT_FILTER_COMPOSITE}
{AI_ASPECT_FILTER_DEFAULT}
[then]
{AI_ASPECT_SWITCH $ai/composite_aspect}
[/then]
[/elseif]
[elseif]
{AI_ASPECT_FILTER_ATTACKS}
[then]
super="$ai/facet~attacks"
[/then]
[/elseif]
[elseif]
{AI_ASPECT_FILTER_LUA}
[then]
super="$ai/facet~lua"
[/then]
[/elseif]
# TODO: Somehow give an error for any other combination
[/if]
[/tag]
[tag]
name="$facet_base"
super="$ai/$component"
{AI_ASPECT_INVALIDATE}
{AI_ASPECT_FILTERS}
[/tag]
[tag]
name="facet~lua"
super="$ai/$generic_lua_component"
{SIMPLE_KEY value string}
[/tag]
#define AI_ASPECT NAME VALUE
[tag]
# This defines the valid content of an aspect with name=standard_aspect
# and the specified ID
name="standard_aspect~{NAME}"
{VALUE}
[/tag]
[tag]
# This defines the valid content of an aspect with name=composite_aspect
# and the specified ID
name="composite_aspect~{NAME}"
[tag]
name="facet"
max=infinite
super="$ai/facet~{NAME}"
[/tag]
[tag]
name="default"
super="$ai/facet~{NAME}"
[/tag]
[/tag]
#enddef
#define AI_FACET NAME VALUE
{AI_ASPECT {NAME} {VALUE}}
[tag]
name="facet~{NAME}"
super="$ai/$facet_base"
[if]
{AI_ASPECT_FILTER_STANDARD}
{AI_ASPECT_FILTER_DEFAULT}
[then]
super="$ai/standard_aspect~{NAME}"
[/then]
[elseif]
{AI_ASPECT_FILTER_COMPOSITE}
[then]
super="$ai/composite_aspect~{NAME}"
[/then]
[/elseif]
[elseif]
{AI_ASPECT_FILTER_LUA}
[then]
super="$ai/facet~lua"
[/then]
[/elseif]
[else]
# This required key is just a hack to get an error here.
# It's not actually valid.
{REQUIRED_KEY invalid_engine_name_combo_in_aspect bool}
[/else]
[/if]
[/tag]
#enddef
#define AI_FACET_SCALAR TYPE
{AI_FACET {TYPE} {SIMPLE_KEY value {TYPE}}}
#enddef
#define AI_FACET_TAG TAG CONTENTS
{AI_FACET {TAG} (
[tag]
name="value"
{CONTENTS}
[/tag]
)}
#enddef
{AI_FACET_SCALAR real}
{AI_FACET_SCALAR int}
{AI_FACET_SCALAR bool}
{AI_FACET_SCALAR string_list}
{AI_FACET_SCALAR ai_grouping}
{AI_FACET avoid {FILTER_TAG value location ()}}
{AI_FACET_TAG leader_goal (
{SIMPLE_KEY x int}
{SIMPLE_KEY y int}
{SIMPLE_KEY max_risk real}
{SIMPLE_KEY auto_remove bool}
)}
{AI_FACET_TAG recruitment_save_gold (
{SIMPLE_KEY active int}
{SIMPLE_KEY begin real}
{SIMPLE_KEY end real}
{SIMPLE_KEY spend_all_gold int}
{SIMPLE_KEY save_on_negative_income bool}
)}
{AI_FACET_TAG recruitment_instructions (
[tag]
name="recruit"
max=infinite
super="$ai/$recruit"
[/tag]
[tag]
name="total"
max=infinite
super="$ai/$recruit_base"
[/tag]
[tag]
name="pattern"
max=infinite
super="$ai/$recruit_base"
[/tag]
[tag]
name="limit"
max=infinite
super="$ai/$recruit_limit"
[/tag]
)}
{AI_ASPECT attacks (
{FILTER_TAG filter_own unit ()}
{FILTER_TAG filter_enemy unit ()}
)}
[tag]
name="facet~attacks"
super="$ai/$facet_base"
[if]
{AI_ASPECT_FILTER_ATTACKS}
{AI_ASPECT_FILTER_DEFAULT}
[then]
super="$ai/standard_aspect~attacks"
[/then]
[elseif]
{AI_ASPECT_FILTER_COMPOSITE}
[then]
super="$ai/composite_aspect~attacks"
[/then]
[/elseif]
[elseif]
{AI_ASPECT_FILTER_LUA}
[then]
super="$ai/facet~lua"
[/then]
[/elseif]
[else]
# This required key is just a hack to get an error here.
# It's not actually valid.
{REQUIRED_KEY invalid_engine_name_combo_in_aspect bool}
[/else]
[/if]
[/tag]