-
Notifications
You must be signed in to change notification settings - Fork 0
/
boomer.per
431 lines (362 loc) · 8.54 KB
/
boomer.per
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
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
; Macro Constants
(defconst camp-distance 15)
(defconst food-distance 15)
(defconst wood-distance 15)
(defconst mill-distance 17)
(defconst seperation-distance 4)
(defconst darkage-camp-count 1)
(defconst feudalage-camp-count 4)
(defconst castleage-camp-count 10)
(defconst darkage-mill-count 2)
(defconst feudalage-mill-count 4)
(defconst castleage-mill-count 6)
; Variable
(defconst mill-count 0)
; Goals
(defconst boom-goal 1)
(defconst defend-goal 2)
(defconst attack-goal 3)
(defconst farm-goal 4)
(defconst raid-goal 5)
(defconst kill-goal 6)
; Unit IDs
(defconst female-forager 355)
(defconst male-forager 353)
(defrule
(true)
=>
(set-strategic-number sn-percent-civilian-explorers 0)
(set-strategic-number sn-total-number-explorers 1)
(set-strategic-number sn-number-explore-groups 1)
(set-strategic-number sn-minimum-explore-group-size 1)
(set-strategic-number sn-intelligent-gathering 1)
(set-strategic-number sn-attack-intelligence 1)
(set-strategic-number sn-enable-boar-hunting 2)
(set-strategic-number sn-food-dropsite-distance 12)
(set-strategic-number sn-maximum-hunt-drop-distance 20)
(set-strategic-number sn-maximum-food-drop-distance 12)
(set-strategic-number sn-camp-max-distance camp-distance)
(set-strategic-number sn-mill-max-distance mill-distance)
(set-strategic-number sn-dropsite-separation-distance seperation-distance)
(set-strategic-number sn-allow-adjacent-dropsites 0)
(set-strategic-number sn-maximum-attack-group-size 30)
(set-goal farm-goal 0)
;;; TODO: MAYBE REMOVE
(disable-self)
)
;;; Dark Age only rules
(defrule
(current-age == dark-age)
(civilian-population < 6)
=>
(set-strategic-number sn-food-gatherer-percentage 100)
(set-strategic-number sn-wood-gatherer-percentage 0)
(set-strategic-number sn-gold-gatherer-percentage 0)
(set-strategic-number sn-stone-gatherer-percentage 0)
(set-goal mill-count darkage-mill-count)
(disable-self)
)
(defrule
(current-age == dark-age)
(civilian-population >= 6)
=>
(set-strategic-number sn-food-gatherer-percentage 60)
(set-strategic-number sn-wood-gatherer-percentage 40)
(set-strategic-number sn-gold-gatherer-percentage 0)
(set-strategic-number sn-stone-gatherer-percentage 0)
(disable-self)
)
(defrule
(can-research feudal-age)
(civilian-population >= 18)
=>
(research feudal-age)
)
;;; Feudal Age only rules
(defrule
(current-age == feudal-age)
=>
(set-strategic-number sn-food-gatherer-percentage 30)
(set-strategic-number sn-wood-gatherer-percentage 30)
(set-strategic-number sn-gold-gatherer-percentage 30)
(set-strategic-number sn-stone-gatherer-percentage 0)
(set-strategic-number sn-percent-civilian-builders 10)
(set-goal mill-count feudalage-mill-count)
(disable-self)
)
(defrule
(can-research castle-age)
=>
(research castle-age)
)
;;; Castle Age only rules
(defrule
(current-age == castle-age)
=>
(set-strategic-number sn-food-gatherer-percentage 20)
(set-strategic-number sn-wood-gatherer-percentage 30)
(set-strategic-number sn-gold-gatherer-percentage 30)
(set-strategic-number sn-stone-gatherer-percentage 10)
(set-strategic-number sn-percent-civilian-builders 10)
(set-goal mill-count castleage-mill-count)
(disable-self)
)
(defrule
(can-research imperial-age)
=>
(research imperial-age)
)
;;; Imperial Age only rules
(defrule
(current-age == imperial-age)
=>
(set-strategic-number sn-food-gatherer-percentage 40)
(set-strategic-number sn-wood-gatherer-percentage 25)
(set-strategic-number sn-gold-gatherer-percentage 25)
(set-strategic-number sn-stone-gatherer-percentage 10)
(disable-self)
)
;;; Military Rules
(defrule
(soldier-count > 20)
=>
(set-strategic-number sn-enable-offensive-priority 1)
(attack-now)
)
;
(defrule
(current-age == dark-age)
(building-type-count-total lumber-camp >= 1)
(or (unit-type-count villager >= 12)
(wood-amount >= 110))
(or (unit-type-count villager < 20)
(or (building-type-count-total lumber-camp >= 2)
(wood-amount >= 110)))
(or (unit-type-count villager < 30)
(or (building-type-count-total mining-camp >= 1)
(wood-amount >= 110)))
=>
(set-goal farm-goal 1)
)
(defrule
(current-age > dark-age)
(idle-farm-count < 2)
(wood-amount > 400)
(building-type-count-total farm < 2)
=>
(set-goal farm-goal 1)
)
(defrule
(or
(or
(unit-type-count female-forager > 0)
(unit-type-count male-forager > 0)
)
(food-amount > 1000)
)
=>
(set-goal farm-goal 0)
)
(defrule
(goal farm-goal 1)
(can-build farm)
(wood-amount > 400)
(idle-farm-count < 1)
=>
(build farm)
)
;; Macro Rules
(defrule
(housing-headroom < 5)
(population-headroom != 0)
(can-build house)
=>
(build house)
)
(defrule
(current-age == dark-age)
(civilian-population >= 18)
(building-type-count barracks < 1)
(can-build barracks)
=>
(build barracks)
)
(defrule
(building-type-count-total archery-range < 2)
(can-build archery-range)
=>
(build archery-range)
)
(defrule
(building-type-count-total siege-workshop < 1)
(can-build siege-workshop)
=>
(build siege-workshop)
)
(defrule
(building-type-count archery-range > 1)
(building-type-count-total blacksmith == 0)
(can-build blacksmith)
=>
(build blacksmith)
)
(defrule
(building-type-count-total university == 0)
(can-build university)
=>
(build university)
)
(defrule
(wood-amount >= 500)
(food-amount >= 500)
(gold-amount >= 500)
(can-build archery-range)
=>
(build archery-range)
)
(defrule
(building-type-count-total archery-range > 1)
(can-train archer-line)
=>
(train archer-line)
)
(defrule
(can-train mangonel-line)
=>
(train mangonel-line)
)
(defrule
(can-research ri-fletching)
=>
(research ri-fletching)
)
(defrule
(can-research ri-bodkin-arrow)
=>
(research ri-bodkin-arrow)
)
(defrule
(can-research ri-crossbow)
=>
(research ri-crossbow)
)
(defrule
(can-research ri-ballistics)
=>
(research ri-ballistics)
)
(defrule
(can-research ri-arbalest)
=>
(research ri-arbalest)
)
(defrule
(can-research ri-padded-archer-armor)
=>
(research ri-padded-archer-armor)
)
(defrule
(can-research ri-leather-archer-armor)
=>
(research ri-leather-archer-armor)
)
(defrule
(can-research ri-horse-collar)
=>
(research ri-horse-collar)
)
(defrule
(can-research ri-loom)
(civilian-population >= 18)
=>
(research ri-loom)
)
(defrule
(can-research ri-bow-saw)
=>
(research ri-bow-saw)
)
(defrule
(current-age == dark-age)
(resource-found wood)
(building-type-count-total mill > 0)
(dropsite-min-distance wood > 1)
(building-type-count-total lumber-camp < darkage-camp-count)
(can-build lumber-camp)
=>
(build lumber-camp)
)
(defrule
(current-age == feudal-age)
(resource-found wood)
(building-type-count-total mill > 0)
(dropsite-min-distance wood > 1)
(building-type-count-total lumber-camp < feudalage-camp-count )
(can-build lumber-camp)
=>
(build lumber-camp)
)
(defrule
(current-age == castle-age)
(resource-found wood)
(building-type-count-total mill > 0)
(dropsite-min-distance wood > 1)
(building-type-count-total lumber-camp < castleage-camp-count )
(can-build lumber-camp)
=>
(build lumber-camp)
)
(defrule
(resource-found food)
(building-type-count-total house > 1)
(dropsite-min-distance food > 3)
(can-build mill)
(building-type-count-total mill <= mill-count)
=>
(build mill)
)
(defrule
(resource-found gold)
(dropsite-min-distance gold > 3)
(building-type-count-total lumber-camp > 1)
(can-build mining-camp)
=>
(build mining-camp)
)
(defrule
(resource-found stone)
(dropsite-min-distance stone > 3)
(building-type-count-total mining-camp > 1)
(can-build mining-camp)
=>
(build mining-camp)
)
(defrule
(can-research ri-wheel-barrow)
=>
(research ri-wheel-barrow)
)
(defrule
(can-research ri-double-bit-axe)
=>
(research ri-double-bit-axe)
)
(defrule
(can-research ri-gold-mining)
=>
(research ri-gold-mining)
)
(defrule
(current-age == dark-age)
(civilian-population < 25)
(can-train villager)
=>
(train villager)
)
(defrule
(current-age > dark-age)
(can-train villager)
(civilian-population < 130)
=>
(train villager)
)