-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGenius.per
417 lines (342 loc) · 8.31 KB
/
Genius.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
;Genius 2013 Beta 0.1 (内部版本号1.3.3.2)
;Written By DGideas.
;QQ:547339086
;Copyright (C) DGideas 2012-2013
;;;;;;;;;;配置限制;;;;;;;;;;
;限制:陆战种族不限(AOFE除外).
;推荐运行于1.0 C版本.
;;;;;;;;;;程序特色;;;;;;;;;;
;自选作弊,调整作弊级别
;;;;;;;;;;荣誉墙;;;;;;;;;;
;还空着.
#load-if-not-defined DEATH-MATCH
;不是决斗模式
;设定常量(普通类)
(load "Genius\defconst\normal")
;设定goal类目标编号
(load "Genius\defconst\goal")
;剧情模式检测
(load "Genius\DEngineI\DEngineI")
;DEngineI引擎
(load "Genius\debug")
;测试模块
(load "Genius\cheat\main");加载作弊模块
;处理系统定义符号,判断条件
#load-if-defined DIFFICULTY-HARDEST
(defrule
(true)
=>
(cc-add-resource food 350)
(cc-add-resource wood 350)
(cc-add-resource gold 350)
(cc-add-resource stone 350)
(disable-self)
)
#end-if
#load-if-defined DIFFICULTY
(defrule
(true)
=>
(cc-add-resource food 200)
(cc-add-resource wood 200)
(cc-add-resource gold 200)
(cc-add-resource stone 200)
(disable-self)
)
#end-if
(load "Genius\scan\run-scan")
;策略设定
(load "Genius\ssn")
;(load "Genius\GEngineI\GEngineI")
;资源状况自动检测(测试v2)
(load "Genius\scan\need")
;升级完成的动作
(defrule
(current-age == feudal-age);封建时代
=>
(chat-to-all "已升级至封建时代")
(set-goal upgrade no);没有升级
(set-strategic-number sn-blot-exploration-map 1);再探索地图
(disable-self)
)
(defrule
(current-age == castle-age);城堡时代
=>
(chat-to-all "已升级至城堡时代")
(set-goal upgrade no);没有升级
(chat-to-allies "取消了探索单位")
(set-strategic-number sn-number-explore-groups 0);取消探索单位
(chat-to-allies "一个伐木场")
(build lumber-camp);建造伐木场
(disable-self)
)
(defrule
(current-age == imperial-age);帝王时代
=>
(chat-to-all "已升级至帝王时代")
(set-goal upgrade no);没有升级
(chat-to-allies "一个采矿场")
(build mining-camp)
(disable-self)
)
;游戏开始
(load "Genius\start")
(load "Genius\SmartEngine\smartengine")
;通用脚本
(defrule
(unit-type-count-total militiaman-line < 3);未达人数限制
(housing-headroom > 0 );有住房
(can-train militiaman-line);能生产步兵
(civilian-population >= age1villagernum);人数达标,防止要塞地图一开始就生兵
=>
(chat-to-allies "一个步兵")
(train militiaman-line);一个步兵
)
(defrule
(unit-type-count-total skirmisher-line < 3);未达人数限制
(housing-headroom > 0 );有住房
(can-train skirmisher-line);能生产矛兵
(civilian-population >= age1villagernum);人数达标,防止要塞地图一开始就生兵
=>
(chat-to-allies "一个矛兵")
(train skirmisher-line);一个矛兵
)
(defrule
(unit-type-count-total skirmisher-line < 6);未达人数限制
(housing-headroom > 0 );有住房
(can-train skirmisher-line);能生产矛兵
(current-age == castle-age);城堡时代
=>
(chat-to-allies "一个矛兵")
(train skirmisher-line);一个矛兵
)
(defrule
(unit-type-count-total monk < 3);未达人数限制
(housing-headroom > 0 );有住房
(current-age == castle-age);城堡时代
(not (town-under-attack));城镇没有收到攻击
(building-type-count-total town-center > 0);当存在城镇中心:防止城镇中心被毁后建造失控
(gold-amount > 200);黄金充足
(can-train monk);能生产僧侣
=>
(chat-to-allies "一个僧侣")
(train monk);一个僧侣
)
(defrule
(unit-type-count-total monk < 8);未达人数限制
(housing-headroom > 0 );有住房
(current-age == imperial-age);帝王时代
(not (town-under-attack));城镇没有收到攻击
(building-type-count-total town-center > 0);当存在城镇中心:防止城镇中心被毁后建造失控
(gold-amount > 200);黄金充足
(can-train monk);能生产僧侣
=>
(chat-to-allies "一个僧侣")
(train monk);一个僧侣
)
#load-if-defined DIFFICULTY-HARDEST
(defrule
(unit-type-count-total monk < 15);未达人数限制
(housing-headroom > 0 );有住房
(current-age == imperial-age);帝王时代
(not (town-under-attack));城镇没有收到攻击
(building-type-count-total town-center > 0);当存在城镇中心:防止城镇中心被毁后建造失控
(gold-amount > 200);黄金充足
(can-train monk);能生产僧侣
=>
(chat-to-allies "一个僧侣")
(train monk);一个僧侣
)
#end-if
#load-if-defined AZTEC-CIV
(defrule
(unit-type-count-total monk < 10);未达人数限制
(housing-headroom > 0 );有住房
(current-age == castle-age);城堡时代
(not (town-under-attack));城镇没有收到攻击
(building-type-count-total town-center > 0);当存在城镇中心:防止城镇中心被毁后建造失控
(gold-amount > 200);黄金充足
(can-train monk);能生产僧侣
=>
(chat-to-allies "一个僧侣")
(train monk);一个僧侣
)
#end-if
#load-if-defined AZTEC-CIV
(defrule
(unit-type-count-total monk < 15);未达人数限制
(housing-headroom > 0 );有住房
(current-age == imperial-age);帝王时代
(not (town-under-attack));城镇没有收到攻击
(building-type-count-total town-center > 0);当存在城镇中心:防止城镇中心被毁后建造失控
(gold-amount > 200);黄金充足
(can-train monk);能生产僧侣
=>
(chat-to-allies "一个僧侣")
(train monk);一个僧侣
)
#end-if
#load-if-defined DIFFICULTY
(defrule
(unit-type-count-total monk < 10);未达人数限制
(housing-headroom > 0 );有住房
(current-age == imperial-age);帝王时代
(not (town-under-attack));城镇没有收到攻击
(building-type-count-total town-center > 0);当存在城镇中心:防止城镇中心被毁后建造失控
(gold-amount > 200);黄金充足
(can-train monk);能生产僧侣
=>
(chat-to-allies "一个僧侣")
(train monk);一个僧侣
)
#end-if
(defrule
(unit-type-count-total battering-ram < 2);未达数量限制
(housing-headroom > 0 );有住房
(current-age == castle-age);城堡时代
(not (town-under-attack));城镇没有收到攻击
(can-train battering-ram);能生产轻型攻城车
(building-type-count-total town-center > 0);当存在城镇中心:防止城镇中心被毁后建造失控
=>
(chat-to-allies "一个轻型攻城车")
(train battering-ram);一个轻型攻城车
)
(defrule
(unit-type-count-total battering-ram < 3);未达数量限制
(housing-headroom > 0 );有住房
(current-age == imperial-age);帝王时代
(not (town-under-attack));城镇没有收到攻击
(can-train battering-ram);能生产轻型攻城车
(building-type-count-total town-center > 0);当存在城镇中心:防止城镇中心被毁后建造失控
=>
(chat-to-allies "一个轻型攻城车")
(train battering-ram);一个轻型攻城车
)
(defrule
(unit-type-count-total mangonel < 1);未达数量限制
(housing-headroom > 0 );有住房
(current-age == castle-age);城堡时代
(not (town-under-attack));城镇没有收到攻击
(can-train mangonel);能生产投石车
(building-type-count-total town-center > 0);当存在城镇中心:防止城镇中心被毁后建造失控
=>
(chat-to-allies "一个投石车")
(train mangonel);一个投石车
)
(defrule
(unit-type-count-total mangonel < 3);未达数量限制
(housing-headroom > 0 );有住房
(current-age == imperial-age);帝王时代
(not (town-under-attack));城镇没有收到攻击
(can-train mangonel);能生产投石车
(building-type-count-total town-center > 0);当存在城镇中心:防止城镇中心被毁后建造失控
=>
(chat-to-allies "一个投石车")
(train mangonel);一个投石车
)
;自我防卫
(defrule
(current-age == dark-age);黑暗时代
(town-under-attack);城镇受到攻击
=>
(chat-to-all "RUSH?这可不行,你等死吧!!!")
(cc-add-resource food 350)
(cc-add-resource wood 350)
(cc-add-resource gold 350)
(cc-add-resource stone 350)
(set-goal rushyet yes)
(disable-self)
)
(defrule
(current-age == feudal-age);封建时代
(town-under-attack);城镇受到攻击
=>
(chat-to-all "呵呵,你死定了")
(cc-add-resource food 200)
(cc-add-resource wood 200)
(cc-add-resource gold 200)
(cc-add-resource stone 200)
(set-goal rushyet yes)
(disable-self)
)
(defrule
(current-age == castle-age);城堡时代
(town-under-attack);城镇受到攻击
=>
(chat-to-all "找死!!!")
(set-goal rushyet yes)
(disable-self)
)
(defrule
(current-age == imperial-age);帝王时代
(town-under-attack);城镇受到攻击
=>
(chat-to-all "找死!!!")
(set-goal rushyet yes)
(disable-self)
)
;判断进攻条件
(defrule
(military-population >= armynum)
(not (town-under-attack));城镇没有收到攻击
=>
(set-goal attackstat 2)
)
(defrule
(military-population < armynum)
(goal attackstat 2);攻击过,被击退了
=>
(set-goal attackstat 3)
)
(defrule
(military-population < 5)
(goal attackstat 4);攻击过,被击退了
=>
(set-goal attackstat 3)
)
;进攻
(defrule
(goal attackstat 2)
=>
(chat-to-all-using-id 07140)
(attack-now)
(set-goal attackyet yes)
)
(defrule
(goal attackstat 4)
=>
(chat-to-all-using-id 07140)
(attack-now)
(set-goal attackyet yes)
)
(defrule
(goal attackstat 2)
=>
(chat-to-all "SMTS攻击,冲啊!!!")
(set-strategic-number sn-maximum-town-size 100);测试数值
(attack-now)
(set-goal attackyet yes)
)
(defrule
(goal attackstat 4)
=>
(chat-to-all "SMTS攻击,冲啊!!!")
(set-strategic-number sn-maximum-town-size 100);测试数值
(attack-now)
(set-goal attackyet yes)
)
(defrule
(goal attackstat 3)
=>
;SMTS撤销
(set-strategic-number sn-maximum-town-size 40);测试数值
)
#end-if
;自动提醒
;弃权(Beta)
(load "Genius\resign")
;响应聊天指令
(load "Genius\chat")
#load-if-defined DEATH-MATCH
;(load "Genius\DEngineII\DEngineII")
#end-if