Talvieno

Gondolf

Nov 29th, 2016
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 100.84 KB | None | 0 0
  1. (defconst asked-for-help 89)
  2. ;==========Goals:
  3. ;1 1= Attacking
  4. ;3 = Military explorers
  5.  
  6. ; ============== GROUPS - most of these will work for any file
  7. (defrule
  8. (true);test
  9. =>
  10. (set-strategic-number sn-intelligent-gathering 1)
  11. (set-goal 5 1)
  12. (set-goal asked-for-help 0)
  13. (set-strategic-number sn-maximum-hunt-drop-distance 50)
  14. (disable-self)
  15. )
  16. (defrule
  17. (goal 1 1)
  18. =>
  19. (set-strategic-number sn-percent-civilian-explorers 10)
  20. (set-strategic-number sn-percent-civilian-builders 10)
  21. (set-strategic-number sn-percent-civilian-gatherers 80)
  22. (chat-local-to-self "Checking to see if I missed something.")
  23. (disable-self)
  24. )
  25. (defrule
  26. (goal 1 2)
  27. =>
  28. (set-strategic-number sn-percent-civilian-explorers 0)
  29. (set-strategic-number sn-percent-civilian-builders 15)
  30. (set-strategic-number sn-percent-civilian-gatherers 85)
  31. (chat-local-to-self "Let's get on with it!.")
  32. (disable-self)
  33. )
  34. (defrule
  35. (true)
  36. =>
  37. (set-goal 3 3)
  38. (set-strategic-number sn-maximum-town-size 25)
  39. (set-strategic-number sn-camp-max-distance 30)
  40. (set-strategic-number sn-mill-max-distance 30)
  41. (set-strategic-number sn-percent-enemy-sighted-response 100)
  42. (set-strategic-number sn-enemy-sighted-response-distance 8) ;(set-strategic-number sn-enemy-sighted-response-distance 100)
  43. (set-strategic-number sn-blot-exploration-map 1)
  44. (set-strategic-number sn-percent-attack-soldiers 100)
  45. (enable-wall-placement 2)
  46. (set-strategic-number sn-maximum-attack-group-size 200)
  47. (set-strategic-number sn-number-explore-groups 2)
  48. (set-strategic-number sn-task-ungrouped-soldiers 0);imperial random
  49. (set-strategic-number sn-group-form-distance 40)
  50. (set-strategic-number sn-group-leader-defense-distance 3)
  51. (disable-self)
  52. )
  53. ; ============== ATTACK GROUPS - changing percent attack soldiers will make an AI weak or tough
  54.  
  55. (defrule
  56. (true)
  57. =>
  58. (enable-wall-placement 2)
  59. (set-goal 4 10)
  60. (set-strategic-number sn-group-commander-selection-method 0)
  61. (set-strategic-number sn-maximum-boat-attack-group-size 15)
  62. (set-strategic-number sn-minimum-peace-like-level 50)
  63. (set-strategic-number sn-minimum-attack-group-size 5)
  64. (set-strategic-number sn-do-not-scale-for-difficulty-level 1)
  65. (set-strategic-number sn-attack-intelligence 1)
  66. (enable-timer 5 300)
  67. (disable-self)
  68. )
  69. ; ================== RESIGNING - resigns if it can't train villagers
  70.  
  71. (defrule
  72. (building-type-count town-center less-than 1)
  73. (population < 1)
  74. (unit-type-count villager < 1)
  75. (not (can-train villager) )
  76. (building-type-count castle < 1)
  77. (building-type-count barracks < 1)
  78. (building-type-count dock < 1)
  79. (building-type-count stable < 1)
  80. (building-type-count archery-range < 1)
  81. =>
  82. (chat-to-all "Monk! I need a monk!")
  83. (resign)
  84. (disable-self)
  85. )
  86.  
  87.  
  88. ; ============== VILLAGER ASSIGNMENT - most of these will work for any file
  89. #load-if-not-defined DEATH-MATCH
  90. (defrule
  91. (unit-type-count villager >= 12); -total
  92. =>
  93. (set-strategic-number sn-enable-boar-hunting 1); boar and deer
  94. (disable-self)
  95. )
  96.  
  97. (defrule
  98. (goal 3 3)
  99. (unit-type-count villager < 1)
  100. (building-type-count town-center < 1)
  101. =>
  102. (set-strategic-number sn-maximum-explore-group-size 200)
  103. (set-strategic-number sn-minimum-explore-group-size 5)
  104. (set-strategic-number sn-number-explore-groups 5)
  105. (set-strategic-number sn-percentage-explore-exterminators 100)
  106. (enable-timer 2 60)
  107. (set-goal 3 2)
  108. (disable-self)
  109. )
  110. (defrule
  111. (goal 3 2)
  112. (timer-triggered 2)
  113. =>
  114. (disable-timer 2)
  115. (enable-timer 2 60)
  116. (set-goal 3 1)
  117. (set-strategic-number sn-maximum-explore-group-size 1)
  118. (set-strategic-number sn-number-explore-groups 2)
  119. (set-strategic-number sn-minimum-explore-group-size 1)
  120. (set-strategic-number sn-percentage-explore-exterminators 50)
  121. )
  122. (defrule
  123. (goal 3 1)
  124. (timer-triggered 2)
  125. =>
  126. (disable-timer 2)
  127. (enable-timer 2 60)
  128. (set-goal 3 2)
  129. (set-strategic-number sn-maximum-explore-group-size 200)
  130. (set-strategic-number sn-minimum-explore-group-size 5)
  131. (set-strategic-number sn-number-explore-groups 5)
  132. (set-strategic-number sn-percentage-explore-exterminators 100)
  133. )
  134.  
  135. (defrule
  136. (unit-type-count villager < 1)
  137. (building-type-count town-center < 1)
  138. =>
  139. (chat-local-to-self "Roamers")
  140. (disable-self)
  141. )
  142.  
  143. (defrule
  144. (unit-type-count villager > 0)
  145. (building-type-count town-center > 0)
  146. =>
  147. (chat-local-to-self "Townsmen")
  148. (disable-self)
  149. )
  150. (defrule
  151. (unit-type-count villager < 1)
  152. (building-type-count town-center < 1)
  153. =>
  154. (attack-now)
  155. (enable-timer 8 180)
  156. (set-strategic-number sn-maximum-explore-group-size 200)
  157. (set-strategic-number sn-minimum-explore-group-size 25)
  158. (set-strategic-number sn-number-explore-groups 4)
  159. (set-strategic-number sn-percentage-explore-exterminators 100)
  160. (disable-self)
  161. )
  162. (defrule
  163. (timer-triggered 8)
  164. =>
  165. (attack-now)
  166. (disable-self)
  167. )
  168. (defrule
  169. (or
  170. (unit-type-count villager > 0)
  171. (building-type-count town-center > 0)
  172. )
  173. =>
  174. (set-strategic-number sn-maximum-explore-group-size 1)
  175. (set-strategic-number sn-number-explore-groups 2)
  176. (set-strategic-number sn-minimum-explore-group-size 1)
  177. (set-strategic-number sn-percentage-explore-exterminators 50)
  178. (disable-self)
  179. )
  180. #end-if
  181. (defrule
  182. (current-age == dark-age)
  183. (unit-type-count villager < 9)
  184. =>
  185. (set-strategic-number sn-percent-civilian-explorers 0)
  186. (set-strategic-number sn-percent-civilian-builders 15)
  187. (set-strategic-number sn-percent-civilian-gatherers 85)
  188. (set-strategic-number sn-cap-civilian-explorers 0)
  189. (set-strategic-number sn-cap-civilian-builders 100)
  190. (set-strategic-number sn-food-gatherer-percentage 100)
  191. (set-strategic-number sn-gold-gatherer-percentage 0)
  192. (set-strategic-number sn-stone-gatherer-percentage 0)
  193. (set-strategic-number sn-wood-gatherer-percentage 0)
  194. (set-strategic-number sn-maximum-gold-drop-distance 20)
  195. (set-strategic-number sn-maximum-stone-drop-distance 20)
  196. (set-strategic-number sn-maximum-food-drop-distance 20)
  197. (set-strategic-number sn-maximum-wood-drop-distance 20)
  198. (disable-self)
  199. )
  200. (defrule
  201. (current-age == dark-age)
  202. (unit-type-count villager > 8)
  203. =>
  204. (set-strategic-number sn-percent-civilian-explorers 0)
  205. (set-strategic-number sn-percent-civilian-builders 15)
  206. (set-strategic-number sn-percent-civilian-gatherers 85)
  207. (set-strategic-number sn-cap-civilian-explorers 0)
  208. (set-strategic-number sn-cap-civilian-builders 100)
  209. (set-strategic-number sn-food-gatherer-percentage 75)
  210. (set-strategic-number sn-gold-gatherer-percentage 0)
  211. (set-strategic-number sn-stone-gatherer-percentage 0)
  212. (set-strategic-number sn-wood-gatherer-percentage 25)
  213. (set-strategic-number sn-maximum-gold-drop-distance 20)
  214. (set-strategic-number sn-maximum-stone-drop-distance 20)
  215. (set-strategic-number sn-maximum-food-drop-distance 20)
  216. (disable-self)
  217. )
  218. (defrule
  219. (current-age == dark-age)
  220. (housing-headroom < 5)
  221. (not (can-build house))
  222. (unit-type-count villager > 8)
  223. =>
  224. (set-strategic-number sn-percent-civilian-explorers 0)
  225. (set-strategic-number sn-percent-civilian-builders 15)
  226. (set-strategic-number sn-percent-civilian-gatherers 85)
  227. (set-strategic-number sn-cap-civilian-explorers 0)
  228. (set-strategic-number sn-cap-civilian-builders 100)
  229. (set-strategic-number sn-food-gatherer-percentage 55)
  230. (set-strategic-number sn-gold-gatherer-percentage 0)
  231. (set-strategic-number sn-stone-gatherer-percentage 0)
  232. (set-strategic-number sn-wood-gatherer-percentage 45)
  233. (set-strategic-number sn-maximum-gold-drop-distance 20)
  234. (set-strategic-number sn-maximum-stone-drop-distance 20)
  235. (set-strategic-number sn-maximum-food-drop-distance 20)
  236. (disable-self)
  237. )
  238. (defrule
  239. (current-age == dark-age)
  240. (idle-farm-count < 1)
  241. (not (can-build farm))
  242. (unit-type-count villager > 15)
  243. =>
  244. (set-strategic-number sn-percent-civilian-explorers 0)
  245. (set-strategic-number sn-percent-civilian-builders 15)
  246. (set-strategic-number sn-percent-civilian-gatherers 85)
  247. (set-strategic-number sn-cap-civilian-explorers 0)
  248. (set-strategic-number sn-cap-civilian-builders 100)
  249. (set-strategic-number sn-food-gatherer-percentage 55)
  250. (set-strategic-number sn-gold-gatherer-percentage 0)
  251. (set-strategic-number sn-stone-gatherer-percentage 0)
  252. (set-strategic-number sn-wood-gatherer-percentage 45)
  253. (set-strategic-number sn-maximum-gold-drop-distance 20)
  254. (set-strategic-number sn-maximum-stone-drop-distance 20)
  255. (set-strategic-number sn-maximum-food-drop-distance 20)
  256. (disable-self)
  257. )
  258.  
  259. (defrule
  260. (current-age == dark-age)
  261. (wood-amount > 400)
  262. (unit-type-count villager > 15)
  263. =>
  264. (set-strategic-number sn-percent-civilian-explorers 0)
  265. (set-strategic-number sn-percent-civilian-builders 15)
  266. (set-strategic-number sn-percent-civilian-gatherers 85)
  267. (set-strategic-number sn-cap-civilian-explorers 0)
  268. (set-strategic-number sn-cap-civilian-builders 100)
  269. (set-strategic-number sn-food-gatherer-percentage 75)
  270. (set-strategic-number sn-gold-gatherer-percentage 0)
  271. (set-strategic-number sn-stone-gatherer-percentage 0)
  272. (set-strategic-number sn-wood-gatherer-percentage 25)
  273. (disable-self)
  274. )
  275. (defrule
  276. (current-age == dark-age)
  277. (or (wood-amount > 800)
  278. (unit-type-count villager > 35))
  279. (unit-type-count villager > 15)
  280. =>
  281. (set-strategic-number sn-percent-civilian-explorers 0)
  282. (set-strategic-number sn-percent-civilian-builders 15)
  283. (set-strategic-number sn-percent-civilian-gatherers 85)
  284. (set-strategic-number sn-cap-civilian-explorers 0)
  285. (set-strategic-number sn-cap-civilian-builders 100)
  286. (set-strategic-number sn-food-gatherer-percentage 95)
  287. (set-strategic-number sn-gold-gatherer-percentage 0)
  288. (set-strategic-number sn-stone-gatherer-percentage 0)
  289. (set-strategic-number sn-wood-gatherer-percentage 5)
  290. (disable-self)
  291. )
  292.  
  293. (defrule
  294. (current-age == feudal-age)
  295. =>
  296. (set-strategic-number sn-percent-civilian-explorers 0)
  297. (set-strategic-number sn-percent-civilian-builders 15)
  298. (set-strategic-number sn-percent-civilian-gatherers 85)
  299. (set-strategic-number sn-cap-civilian-explorers 0)
  300. (set-strategic-number sn-cap-civilian-builders 100)
  301. (set-strategic-number sn-food-gatherer-percentage 45)
  302. (set-strategic-number sn-gold-gatherer-percentage 25)
  303. (set-strategic-number sn-stone-gatherer-percentage 0)
  304. (set-strategic-number sn-wood-gatherer-percentage 30)
  305. (set-strategic-number sn-maximum-gold-drop-distance 20)
  306. (set-strategic-number sn-maximum-stone-drop-distance 20)
  307. (set-strategic-number sn-maximum-food-drop-distance 20)
  308. (disable-self)
  309. )
  310. (defrule
  311. (current-age == castle-age)
  312. =>
  313. (set-strategic-number sn-percent-civilian-explorers 0)
  314. (set-strategic-number sn-percent-civilian-builders 25);imperial random
  315. (set-strategic-number sn-percent-civilian-gatherers 75);imperial random
  316. (set-strategic-number sn-cap-civilian-explorers 0)
  317. (set-strategic-number sn-cap-civilian-builders 100);imperial random
  318. (set-strategic-number sn-food-gatherer-percentage 30)
  319. (set-strategic-number sn-gold-gatherer-percentage 25)
  320. (set-strategic-number sn-stone-gatherer-percentage 15);imperial random
  321. (set-strategic-number sn-wood-gatherer-percentage 30);imperial random
  322. (set-strategic-number sn-maximum-gold-drop-distance 20)
  323. (set-strategic-number sn-maximum-stone-drop-distance 20)
  324. (set-strategic-number sn-maximum-food-drop-distance 20)
  325. (disable-self)
  326. )
  327. (defrule
  328. (current-age == imperial-age)
  329. (gold-amount < 5000)
  330. =>
  331. (set-strategic-number sn-percent-civilian-explorers 0)
  332. (set-strategic-number sn-percent-civilian-builders 25);imperial random
  333. (set-strategic-number sn-percent-civilian-gatherers 75);imperial random
  334. (set-strategic-number sn-cap-civilian-explorers 0)
  335. (set-strategic-number sn-cap-civilian-builders 100);imperial random
  336. (set-strategic-number sn-food-gatherer-percentage 30)
  337. (set-strategic-number sn-gold-gatherer-percentage 25)
  338. (set-strategic-number sn-stone-gatherer-percentage 15);imperial random
  339. (set-strategic-number sn-wood-gatherer-percentage 30);imperial random
  340. (set-strategic-number sn-maximum-gold-drop-distance 20)
  341. (set-strategic-number sn-maximum-stone-drop-distance 20)
  342. (set-strategic-number sn-maximum-food-drop-distance 20)
  343. (disable-self)
  344. )
  345. (defrule
  346. (current-age == imperial-age)
  347. (gold-amount > 5000)
  348. =>
  349. (set-strategic-number sn-percent-civilian-explorers 0)
  350. (set-strategic-number sn-percent-civilian-builders 75);imperial random
  351. (set-strategic-number sn-percent-civilian-gatherers 25);imperial random
  352. (set-strategic-number sn-cap-civilian-explorers 0)
  353. (set-strategic-number sn-cap-civilian-builders 100);imperial random
  354. (set-strategic-number sn-food-gatherer-percentage 25)
  355. (set-strategic-number sn-gold-gatherer-percentage 25)
  356. (set-strategic-number sn-stone-gatherer-percentage 25);imperial random
  357. (set-strategic-number sn-wood-gatherer-percentage 25);imperial random
  358. (set-strategic-number sn-maximum-gold-drop-distance 20)
  359. (set-strategic-number sn-maximum-stone-drop-distance 20)
  360. (set-strategic-number sn-maximum-food-drop-distance 20)
  361. (disable-self)
  362. )
  363. (defrule;imperial random
  364. (current-age == imperial-age)
  365. =>
  366. (set-strategic-number sn-retask-gather-amount 0)
  367. (set-strategic-number sn-build-frequency 1)
  368. (set-strategic-number sn-scaling-frequency 1)
  369. (set-strategic-number sn-max-skips-per-attempt 5)
  370. (disable-self)
  371. )
  372.  
  373. ; ============== COMPUTER CHEATING - In long scenario games, a CP can run out of resources. This magically gives him more. Delete if you don't like your AI to cheat.
  374.  
  375.  
  376.  
  377. ; ============== ATTACKING -
  378. (defrule
  379. (goal 5 1)
  380. (game-time > 900)
  381. (not (town-under-attack))
  382. (military-population > 15)
  383. (stone-amount < 1000)
  384. (gold-amount < 2000)
  385. (food-amount < 4000)
  386. (wood-amount < 4000)
  387. =>
  388. (attack-now)
  389. (enable-timer 7 600)
  390. (set-goal asked-for-help 0)
  391. (disable-self)
  392. (chat-local-to-self "first attack")
  393. (chat-to-allies "First official attack.")
  394. (set-goal 5 2)
  395. (chat-to-allies "31")
  396. );died at about 1:39 with the old rules, went to about 1:53
  397. (defrule
  398. (goal 5 1)
  399. (game-time > 550)
  400. (game-time < 660)
  401. (military-population > 15)
  402. (not (town-under-attack))
  403. (stone-amount > 1000)
  404. (gold-amount > 2000)
  405. (food-amount > 4000)
  406. (wood-amount > 4000)
  407. =>
  408. (set-goal asked-for-help 0)
  409. (attack-now)
  410. (enable-timer 7 600)
  411. (disable-self)
  412. (chat-to-allies "31")
  413. (chat-to-allies "Care to join me for a sneak attack?")
  414. (set-goal 5 2)
  415. )
  416.  
  417. (defrule
  418. (timer-triggered 7)
  419. (not (town-under-attack))
  420. (military-population > 24)
  421. =>
  422. (set-goal asked-for-help 0)
  423. (attack-now)
  424. (disable-timer 7)
  425. (set-goal 1 1)
  426. (chat-local-to-self "Massive Magic, GO!")
  427. (delete-building stone-wall-line)
  428. (set-strategic-number sn-task-ungrouped-soldiers 0)
  429. (set-strategic-number sn-number-forward-builders 2)
  430. (chat-to-allies "I'm attacking with full force!")
  431. (enable-timer 1 600)
  432. )
  433. (defrule
  434. (timer-triggered 7)
  435. (or (town-under-attack)
  436. (military-population < 24))
  437. =>
  438. (set-goal asked-for-help 0)
  439. (disable-timer 7)
  440. (set-goal 1 1)
  441. (chat-local-to-self "Cannot attack.")
  442. (enable-timer 1 600)
  443. )
  444. ;(defrule ;what the hell is this shit? ~2016 tal
  445. ; (goal 1 1)
  446. ; (not (town-under-attack))
  447. ; (military-population > 24)
  448. ;=>
  449. ; (attack-now)
  450. ;)
  451. (defrule
  452. (town-under-attack)
  453. (building-type-count castle > 0)
  454. (can-build watch-tower-line)
  455. (players-unit-type-count any-enemy trebuchet < 4)
  456. (players-unit-type-count any-enemy battering-ram-line < 4)
  457. =>
  458. (build watch-tower-line)
  459. )
  460. (defrule
  461. (goal 1 1)
  462. (not (town-under-attack))
  463. (military-population > 50)
  464. (can-build barracks)
  465. (building-type-count barracks > 0)
  466. (building-type-count barracks < 3)
  467. =>
  468. (build-forward barracks)
  469. )
  470. (defrule
  471. (goal 1 1)
  472. (not (town-under-attack))
  473. (military-population > 50)
  474. (can-build archery-range)
  475. (building-type-count archery-range > 0)
  476. (building-type-count archery-range < 3)
  477. =>
  478. (build-forward archery-range)
  479. )
  480. (defrule
  481. (goal 1 1)
  482. (not (town-under-attack))
  483. (military-population > 75)
  484. (can-build bombard-tower)
  485. =>
  486. (build-forward bombard-tower)
  487. )
  488. (defrule
  489. (goal 1 1)
  490. (not (town-under-attack))
  491. (military-population > 100)
  492. =>
  493. (build-forward watch-tower-line)
  494. )
  495. (defrule
  496. (timer-triggered 1)
  497. (goal asked-for-help 0)
  498. =>
  499. (disable-timer 1)
  500. (enable-timer 7 600)
  501. (set-goal 1 2)
  502. )
  503. (defrule
  504. (timer-triggered 1)
  505. (goal asked-for-help 1)
  506. (not (town-under-attack))
  507. =>
  508. (attack-now)
  509. (set-goal 1 1)
  510. (chat-local-to-self "Responding to allied request")
  511. (set-strategic-number sn-task-ungrouped-soldiers 0)
  512. (set-strategic-number sn-number-forward-builders 2)
  513. (chat-to-allies "Gandalf calls for aid!")
  514. (disable-timer 1)
  515. (enable-timer 1 600)
  516. (set-goal asked-for-help 0)
  517. )
  518. (defrule
  519. (timer-triggered 1)
  520. (goal asked-for-help 1)
  521. (or (town-under-attack)
  522. (military-population < 24))
  523. =>
  524. (disable-timer 1)
  525. (enable-timer 1 600)
  526. (set-goal asked-for-help 0)
  527. (set-goal 1 2)
  528. )
  529. (defrule
  530. (town-under-attack)
  531. (goal asked-for-help 0)
  532. (goal 1 1)
  533. =>
  534. (set-goal asked-for-help 1)
  535. (chat-to-allies "18")
  536. )
  537. (defrule
  538. (taunt-detected any-ally 18)
  539. (goal asked-for-help 0)
  540. =>
  541. (set-goal asked-for-help 1)
  542. (chat-local-to-self "Shortening attack timer to provide reinforcements.")
  543. )
  544. ; ============== ADVANCING IN AGE
  545.  
  546. ; Dark to Feudal
  547.  
  548. (defrule
  549. (current-age == dark-age)
  550. =>
  551. (set-goal 16 96)
  552. (disable-self)
  553. )
  554. (defrule
  555. (town-under-attack)
  556. (current-age == castle-age)
  557. =>
  558. (release-escrow food)
  559. (release-escrow wood)
  560. (release-escrow gold)
  561. (release-escrow stone)
  562. )
  563. (defrule
  564. (current-age == dark-age)
  565. (can-train villager)
  566. (population < 15)
  567. (food-amount < 10000)
  568. =>
  569. (train villager)
  570. )
  571.  
  572. (defrule
  573. (can-research-with-escrow feudal-age)
  574. =>
  575. (release-escrow wood)
  576. (release-escrow food)
  577. (release-escrow gold)
  578. (release-escrow stone)
  579. (research feudal-age)
  580. (chat-local-to-self "rising to feudal")
  581. (set-goal 16 0)
  582. )
  583. (defrule
  584. (can-research feudal-age)
  585. =>
  586. (research feudal-age)
  587. (chat-local-to-self "rising to feudal")
  588. (set-goal 16 0)
  589. )
  590. (defrule
  591. (current-age == dark-age)
  592. (can-train villager)
  593. (population < 50)
  594. (food-amount < 10000)
  595. =>
  596. (train villager)
  597. )
  598.  
  599. ; Feudal to Castle
  600.  
  601. (defrule
  602. (current-age == feudal-age)
  603. =>
  604. (set-goal 16 98)
  605. (disable-self)
  606. )
  607.  
  608. (defrule
  609. (goal 16 98)
  610. (wood-amount greater-than 600)
  611. (gold-amount < 200)
  612. (can-sell-commodity wood)
  613. =>
  614. (chat-local-to-self "selling wood for castle gold")
  615. (sell-commodity wood)
  616. )
  617.  
  618. (defrule
  619. (goal 16 98)
  620. (stone-amount greater-than 99)
  621. (gold-amount < 300)
  622. (commodity-selling-price stone greater-than 50)
  623. (can-sell-commodity stone)
  624. =>
  625. (chat-local-to-self "selling stone for castle gold")
  626. (sell-commodity stone)
  627. )
  628.  
  629. (defrule
  630. (goal 16 98)
  631. (food-amount greater-or-equal 1100)
  632. (gold-amount < 200)
  633. (can-sell-commodity food)
  634. =>
  635. (chat-local-to-self "selling food for castle gold")
  636. (sell-commodity food)
  637. )
  638.  
  639. (defrule
  640. (escrow-amount gold > 50)
  641. (goal 16 98)
  642. =>
  643. (release-escrow gold)
  644. )
  645.  
  646. ;getting needed food
  647. (defrule
  648. (goal 16 98)
  649. (gold-amount greater-or-equal 330)
  650. (food-amount < 800)
  651. (can-buy-commodity food)
  652. =>
  653. (chat-local-to-self "buying castle food")
  654. (buy-commodity food)
  655. )
  656.  
  657. ; advance to castle age if possible.
  658. (defrule
  659. (can-research-with-escrow castle-age)
  660. =>
  661. (release-escrow wood)
  662. (release-escrow food)
  663. (release-escrow gold)
  664. (release-escrow stone)
  665. (research castle-age)
  666. (chat-local-to-self "rising to castle")
  667. (set-goal 16 0)
  668. )
  669. (defrule
  670. (can-research castle-age)
  671. =>
  672. (research castle-age)
  673. (chat-local-to-self "rising to castle")
  674. (set-goal 16 0)
  675. )
  676. ; Castle to Imperial
  677.  
  678. (defrule
  679. (current-age == castle-age)
  680. =>
  681. (set-goal 16 99)
  682. (disable-self)
  683. )
  684.  
  685. (defrule
  686. (goal 16 99)
  687. (wood-amount greater-than 300)
  688. (gold-amount < 800)
  689. (can-sell-commodity wood)
  690. =>
  691. (chat-local-to-self "selling wood for imperial gold")
  692. (sell-commodity wood)
  693. )
  694. (defrule
  695. (goal 16 99)
  696. (gold-amount greater-than 900)
  697. (food-amount < 1000)
  698. (can-buy-commodity food)
  699. =>
  700. (chat-local-to-self "buying food for imperial ... food")
  701. (buy-commodity food)
  702. )
  703. (defrule
  704. (goal 16 99)
  705. (building-type-count castle > 0)
  706. (stone-amount greater-than 300)
  707. (commodity-selling-price stone greater-than 30)
  708. (can-sell-commodity stone)
  709. =>
  710. (chat-local-to-self "selling stone for imperial gold")
  711. (sell-commodity stone)
  712. )
  713. (defrule
  714. (goal 16 99)
  715. (stone-amount greater-than 850)
  716. (commodity-selling-price stone greater-than 30)
  717. (can-sell-commodity stone)
  718. =>
  719. (chat-local-to-self "selling stone for imperial gold")
  720. (sell-commodity stone)
  721. )
  722. (defrule
  723. (goal 16 99)
  724. (food-amount greater-or-equal 1200)
  725. (can-sell-commodity food)
  726. (gold-amount < 800)
  727. =>
  728. (chat-local-to-self "selling food for imperial gold")
  729. (sell-commodity food)
  730. )
  731.  
  732. ;getting needed food
  733. (defrule
  734. (goal 16 99)
  735. (gold-amount greater-or-equal 1000)
  736. (food-amount < 1000)
  737. (can-buy-commodity food)
  738. =>
  739. (chat-local-to-self "buying imperial food")
  740. (buy-commodity food)
  741. )
  742.  
  743. ; advance to imperial age if possible.
  744. (defrule
  745. (can-research-with-escrow imperial-age)
  746. =>
  747. (release-escrow wood)
  748. (release-escrow food)
  749. (release-escrow gold)
  750. (release-escrow stone)
  751. (research imperial-age)
  752. (chat-local-to-self "rising to imperial")
  753. (set-goal 16 0)
  754. (set-escrow-percentage wood 15)
  755. (set-escrow-percentage food 45)
  756. (set-escrow-percentage gold 45)
  757. (set-escrow-percentage stone 15)
  758. )
  759. (defrule
  760. (can-research imperial-age)
  761. =>
  762. (chat-local-to-self "rising to imperial")
  763. (set-goal 16 0)
  764. (set-escrow-percentage wood 15)
  765. (set-escrow-percentage food 45)
  766. (set-escrow-percentage gold 45)
  767. (set-escrow-percentage stone 15)
  768. )
  769. ; ============== BUILD LISTS
  770. (defrule
  771. (building-type-count town-center < 1)
  772. =>
  773. (build town-center)
  774. )
  775. (defrule
  776. (building-type-count town-center < 1)
  777. =>
  778. (build town-center)
  779. )
  780. (defrule
  781. (building-type-count town-center < 1)
  782. =>
  783. (build town-center)
  784. )
  785. #load-if-defined NOMAD-MAP
  786. (defrule
  787. (game-time < 60)
  788. (military-population < 6)
  789. (building-type-count town-center < 1)
  790. =>
  791. (set-strategic-number sn-percent-civilian-explorers 100)
  792. (set-strategic-number sn-percent-civilian-builders 0)
  793. (set-strategic-number sn-percent-civilian-gatherers 0)
  794. (set-strategic-number sn-cap-civilian-explorers 100)
  795. (set-strategic-number sn-cap-civilian-gatherers 0)
  796. (chat-local-to-self "Explore")
  797. (disable-self)
  798. )
  799. (defrule
  800. (resource-found gold)
  801. (resource-found food)
  802. (resource-found wood)
  803. (resource-found stone)
  804. (building-type-count town-center < 1)
  805. (civilian-population > 2)
  806. =>
  807. (build town-center)
  808. (set-strategic-number sn-percent-civilian-explorers 0)
  809. (set-strategic-number sn-percent-civilian-builders 15)
  810. (set-strategic-number sn-percent-civilian-gatherers 85)
  811. (set-strategic-number sn-cap-civilian-explorers 0)
  812. (set-strategic-number sn-cap-civilian-gatherers 100)
  813. (chat-local-to-self "Settling down")
  814. (disable-self)
  815. )
  816. (defrule
  817. (game-time greater-than 150)
  818. (building-type-count town-center less-than 1)
  819. (can-build town-center)
  820. =>
  821. (set-strategic-number sn-percent-civilian-explorers 0)
  822. (set-strategic-number sn-percent-civilian-builders 15)
  823. (set-strategic-number sn-percent-civilian-gatherers 85)
  824. (set-strategic-number sn-cap-civilian-explorers 0)
  825. (set-strategic-number sn-cap-civilian-gatherers 100)
  826. (build town-center)
  827. (chat-local-to-self "Settling down now...")
  828. )
  829. #end-if
  830. (defrule;imperial random
  831. (unit-type-count villager greater-than 15)
  832. (housing-headroom < 10)
  833. (population-headroom less-than 1)
  834. =>
  835. (delete-unit villager)
  836. )
  837. (defrule
  838. (not (current-age == dark-age))
  839. (unit-type-count villager < 30);imperial random
  840. (population < 175)
  841. (can-train villager)
  842. =>
  843. (train villager)
  844. )
  845. (defrule
  846. (not (current-age == dark-age))
  847. (not (town-under-attack))
  848. (unit-type-count villager > 30)
  849. (unit-type-count villager less-than 80);imperial random
  850. (population < 175)
  851. (can-train villager)
  852. =>
  853. (train villager)
  854. )
  855.  
  856. ;DESPERATE FOR GOLD
  857. (defrule
  858. (or (or (or (wood-amount > 400)
  859. (food-amount > 400))
  860. (wood-amount > 600))
  861. (food-amount > 600))
  862. (population > 100)
  863. (gold-amount < 200)
  864. (unit-type-count trade-cart < 50)
  865. (can-train-with-escrow trade-cart)
  866. (players-building-type-count any-ally market > 0)
  867. =>
  868. (release-escrow gold)
  869. (train trade-cart);Builds infinite trade carts until there are plenty
  870. )
  871.  
  872. ;maintain housing
  873. (defrule
  874. (housing-headroom less-than 6)
  875. (population-headroom greater-than 0)
  876. (can-build house)
  877. =>
  878. (build house)
  879. )
  880. (defrule;imperial random
  881. (unit-type-count villager greater-than 15)
  882. (housing-headroom < 10)
  883. (population-headroom less-than 1)
  884. =>
  885. (delete-unit villager)
  886. )
  887. ;maintain a town center
  888. (defrule
  889. (game-time greater-than 150)
  890. (building-type-count town-center less-than 1)
  891. (can-build town-center)
  892. =>
  893. (build town-center)
  894. )
  895. (defrule
  896. (building-type-count castle < 1);imperial random
  897. (can-build castle)
  898. (building-type-count town-center > 0)
  899. =>
  900. (build castle)
  901. )
  902. (defrule
  903. (building-type-count market less-than 1)
  904. (or (or (or (or (building-type-count barracks > 0)
  905. (and (stone-amount > 600)
  906. (gold-amount < 100)))
  907. (and (gold-amount > 600)
  908. (wood-amount < 100)))
  909. (and (gold-amount > 600)
  910. (food-amount < 100)))
  911. (game-time >= 1200))
  912. (can-build market)
  913. (not (current-age == imperial-age))
  914. =>
  915. (build market)
  916. )
  917. (defrule
  918. (building-type-count market less-than 1)
  919. (can-build-with-escrow market)
  920. (game-time >= 1200)
  921. (not (current-age == imperial-age))
  922. =>
  923. (release-escrow wood)
  924. (build market)
  925. )
  926. (defrule
  927. (building-type-count archery-range less-than 1)
  928. (current-age == castle-age)
  929. (can-build-with-escrow archery-range)
  930. =>
  931. (release-escrow wood)
  932. (build archery-range)
  933. (disable-self)
  934. )
  935. (defrule
  936. (building-type-count barracks < 1)
  937. (or (or (or (current-age > dark-age)
  938. (game-time > 900))
  939. (town-under-attack))
  940. (wood-amount > 300))
  941. (can-build barracks)
  942. =>
  943. (build barracks)
  944. )
  945. (defrule
  946. (building-type-count archery-range less-than 1)
  947. (building-type-count barracks > 0)
  948. (can-build-with-escrow archery-range)
  949. =>
  950. (release-escrow wood)
  951. (build archery-range)
  952. )
  953. (defrule
  954. (or
  955. (game-time > 900)
  956. (or
  957. (building-type-count barracks > 0)
  958. (wood-amount > 1000)
  959. )
  960. )
  961. (building-type-count archery-range less-than 1)
  962. (can-build archery-range)
  963. =>
  964. (build archery-range)
  965. )
  966. (defrule;imperial random
  967. (building-type-count dock < 1);imperial deathmatch
  968. (can-build dock)
  969. (or
  970. (building-type-count barracks > 0)
  971. (wood-amount > 500)
  972. )
  973. =>
  974. (build dock)
  975. )
  976. ;maintain 3 town centers
  977. (defrule
  978. (current-age == castle-age)
  979. (building-type-count town-center less-than 3)
  980. (can-build-with-escrow town-center)
  981. =>
  982. (release-escrow stone)
  983. (release-escrow wood)
  984. (build town-center)
  985. )
  986. ;maintain 3 town centers
  987. (defrule;imperial random
  988. (game-time greater-than 45);imperial random
  989. (food-amount > 400);imperial random
  990. (building-type-count town-center less-than 3);imperial random
  991. (can-build town-center)
  992. =>
  993. (build town-center)
  994. )
  995. ;alternate lumber camp
  996. (defrule;imperial random
  997. (building-type-count lumber-camp < 2);imperial random
  998. (game-time > 1200)
  999. (can-build lumber-camp)
  1000. =>
  1001. (build lumber-camp)
  1002. )
  1003. (defrule;imperial random
  1004. (building-type-count mining-camp < 3);imperial random
  1005. (or (game-time > 900)
  1006. (current-age > dark-age))
  1007. (can-build mining-camp)
  1008. (or (resource-found gold)
  1009. (resource-found stone))
  1010. =>
  1011. (build mining-camp)
  1012. )
  1013. (defrule;imperial deathmatch
  1014. (stone-amount > 500)
  1015. (game-time > 300)
  1016. (building-type-count castle > 0)
  1017. =>
  1018. (build-wall 2 stone-wall-line)
  1019. (build-gate 2)
  1020. )
  1021. (defrule;imperial deathmatch
  1022. (true)
  1023. =>
  1024. (build-gate 2)
  1025. )
  1026. (defrule
  1027. (current-age > dark-age)
  1028. (building-type-count barracks less-than 1)
  1029. (can-build barracks)
  1030. =>
  1031. (build barracks)
  1032. )
  1033.  
  1034. ;(defrule;Moved in imperial Random
  1035. ; (building-type-count archery-range less-than 1)
  1036. ; (can-build archery-range)
  1037. ;=>
  1038. ; (build archery-range)
  1039. ;)
  1040.  
  1041. (defrule
  1042. (building-type-count stable less-than 1)
  1043. (or
  1044. (game-time > 900)
  1045. (or
  1046. (building-type-count barracks > 0)
  1047. (wood-amount > 1000)
  1048. )
  1049. )
  1050. (can-build stable)
  1051. =>
  1052. (build stable)
  1053. )
  1054.  
  1055. (defrule
  1056. (building-type-count monastery less-than 1)
  1057. (can-build monastery)
  1058. =>
  1059. (build monastery)
  1060. )
  1061.  
  1062. (defrule
  1063. (building-type-count siege-workshop less-than 1)
  1064. (can-build siege-workshop)
  1065. =>
  1066. (build siege-workshop)
  1067. )
  1068.  
  1069. (defrule;Lower Priority
  1070. (building-type-count market less-than 1)
  1071. (can-build market)
  1072. (or
  1073. (and (and (building-type-count archery-range > 0)
  1074. (building-type-count stable > 0))
  1075. (building-type-count barracks > 0))
  1076. (game-time > 1200))
  1077. =>
  1078. (build market)
  1079. )
  1080.  
  1081. (defrule;imperial random
  1082. (building-type-count castle < 4);imperial random
  1083. (can-build castle)
  1084. (building-type-count town-center > 0)
  1085. =>
  1086. (build castle)
  1087. )
  1088. (defrule
  1089. (wood-amount > 1000)
  1090. (building-type-count archery-range less-than 3)
  1091. (can-build archery-range)
  1092. =>
  1093. (build archery-range)
  1094. )
  1095. (defrule
  1096. (wood-amount > 1000)
  1097. (building-type-count barracks less-than 3)
  1098. (can-build barracks)
  1099. =>
  1100. (build barracks)
  1101. )
  1102. (defrule
  1103. (wood-amount > 1000)
  1104. (building-type-count stable less-than 3)
  1105. (can-build stable)
  1106. =>
  1107. (build stable)
  1108. )
  1109. (defrule
  1110. (wood-amount > 750)
  1111. (building-type-count monastery less-than 3)
  1112. (can-build monastery)
  1113. =>
  1114. (build monastery)
  1115. )
  1116.  
  1117. (defrule;imperial random
  1118. (building-type-count dock < 4);imperial deathmatch
  1119. (building-type-count market > 0)
  1120. (can-build dock)
  1121. =>
  1122. (build dock)
  1123. )
  1124. (defrule
  1125. (building-type-count blacksmith less-than 1)
  1126. (current-age == feudal-age)
  1127. (building-type-count market > 0);imperial random
  1128. (building-type-count stable > 0)
  1129. (building-type-count archery-range > 0)
  1130. (can-build-with-escrow blacksmith)
  1131. =>
  1132. (release-escrow wood)
  1133. (build blacksmith)
  1134. )
  1135. (defrule
  1136. (building-type-count blacksmith less-than 1)
  1137. (or
  1138. (current-age == feudal-age)
  1139. (building-type-count barracks > 0);imperial random
  1140. )
  1141. (can-build blacksmith)
  1142. (or
  1143. (not (building-available market))
  1144. (building-type-count market > 0);imperial random
  1145. )
  1146. =>
  1147. (build blacksmith)
  1148. )
  1149.  
  1150. (defrule
  1151. (building-type-count university less-than 1)
  1152. (can-build university)
  1153. (wood-amount greater-than 250);imperial random
  1154. =>
  1155. (build university)
  1156. )
  1157. (defrule
  1158. (building-type-count monastery less-than 1)
  1159. (can-build monastery)
  1160. =>
  1161. (build monastery)
  1162. )
  1163.  
  1164. (defrule
  1165. (building-type-count farm less-than 4)
  1166. (wood-amount > 250)
  1167. (building-type-count archery-range > 0);imperial random
  1168. (can-build farm)
  1169. =>
  1170. (build farm)
  1171. )
  1172. (defrule;always have farms
  1173. (or
  1174. (current-age == feudal-age)
  1175. (current-age == dark-age)
  1176. )
  1177. (idle-farm-count < 1);imperial random
  1178. (can-build farm)
  1179. =>
  1180. (build farm)
  1181. )
  1182. (defrule
  1183. (wood-amount greater-than 160) ;imperial random
  1184. (idle-farm-count < 1);imperial random
  1185. (can-build farm)
  1186. =>
  1187. (build farm)
  1188. )
  1189.  
  1190. (defrule
  1191. (resource-found food)
  1192. (building-type-count mill less-than 1)
  1193. =>
  1194. (build mill)
  1195. )
  1196.  
  1197. (defrule
  1198. (resource-found wood)
  1199. (unit-type-count villager > 8)
  1200. (building-type-count lumber-camp < 1)
  1201. (can-build lumber-camp)
  1202. =>
  1203. (build lumber-camp)
  1204. )
  1205. (defrule
  1206. (unit-type-count fishing-ship > 3)
  1207. (building-type-count fish-trap < 5)
  1208. (can-build fish-trap)
  1209. =>
  1210. (build fish-trap)
  1211. )
  1212. (defrule
  1213. (resource-found wood)
  1214. (building-type-count lumber-camp < 5)
  1215. (dropsite-min-distance wood > 5)
  1216. (can-build lumber-camp)
  1217. (unit-type-count villager > 8)
  1218. (dropsite-min-distance wood >= 6)
  1219. =>
  1220. (build lumber-camp)
  1221. )
  1222. (defrule
  1223. (resource-found wood)
  1224. (building-type-count lumber-camp < 5)
  1225. (dropsite-min-distance wood > 20)
  1226. (can-build lumber-camp)
  1227. (dropsite-min-distance wood >= 6)
  1228. =>
  1229. (build lumber-camp)
  1230. )
  1231. (defrule
  1232. (building-type-count lumber-camp >= 5)
  1233. =>
  1234. (delete-building lumber-camp)
  1235. )
  1236. (defrule
  1237. (building-type-count mining-camp >= 5)
  1238. =>
  1239. (delete-building mining-camp)
  1240. )
  1241.  
  1242. (defrule
  1243. (resource-found gold)
  1244. (building-type-count mining-camp < 5)
  1245. (dropsite-min-distance gold > 5)
  1246. (building-type-count mill > 0)
  1247. (or (game-time > 900)
  1248. (current-age > dark-age))
  1249. =>
  1250. (build mining-camp)
  1251. )
  1252.  
  1253. (defrule
  1254. (resource-found stone)
  1255. (building-type-count mining-camp < 5)
  1256. (dropsite-min-distance stone > 5)
  1257. (can-build mining-camp)
  1258. (or (game-time > 900)
  1259. (current-age > dark-age))
  1260. =>
  1261. (build mining-camp)
  1262. )
  1263. ;Towers Imperial deathmatch
  1264. ;#load-if-defined VICTORY-STANDARD
  1265. ;(defrule;imperial random
  1266. ; (building-type-count castle > 3);imperial random
  1267. ; (can-build wonder)
  1268. ; (not (goal 2 7))
  1269. ; (game-time > 1200)
  1270. ; (building-type-count wonder < 1)
  1271. ; (population-headroom < 1)
  1272. ; (not (town-under-attack))
  1273. ;=>
  1274. ; (build wonder)
  1275. ;)
  1276. ;#end-if
  1277. (defrule
  1278. (building-type-count bombard-tower < 5)
  1279. (can-build bombard-tower)
  1280. =>
  1281. (build bombard-tower)
  1282. )
  1283. (defrule
  1284. (game-time > 300)
  1285. (building-type-count castle > 3)
  1286. (stone-amount > 750)
  1287. (can-build bombard-tower)
  1288. =>
  1289. (build bombard-tower)
  1290. )
  1291. (defrule
  1292. (game-time > 600)
  1293. (stone-amount > 1500)
  1294. (can-build castle)
  1295. =>
  1296. (build castle)
  1297. )
  1298. (defrule
  1299. (players-civ any-enemy korean)
  1300. (building-type-count dock > 0)
  1301. (building-type-count bombard-tower < 5)
  1302. (stone-amount > 750)
  1303. (can-build bombard-tower)
  1304. =>
  1305. (build bombard-tower)
  1306. )
  1307.  
  1308.  
  1309. (defrule
  1310. (game-time > 300)
  1311. (building-type-count castle > 4)
  1312. (stone-amount > 750)
  1313. (can-build watch-tower-line)
  1314. =>
  1315. (build watch-tower-line)
  1316. )
  1317.  
  1318.  
  1319.  
  1320. ; ============== MILITARY UNITS
  1321. (defrule
  1322. (not (town-under-attack))
  1323. (military-population > 15)
  1324. (unit-type-count battering-ram-line < 1)
  1325. (can-train-with-escrow battering-ram-line)
  1326. =>
  1327. (release-escrow wood)
  1328. (release-escrow gold)
  1329. (train battering-ram-line)
  1330. )
  1331. (defrule
  1332. (unit-type-count trade-cart < 10)
  1333. (wood-amount > 500)
  1334. (gold-amount < 500)
  1335. (unit-type-count villager < 10)
  1336. (can-train trade-cart)
  1337. =>
  1338. (train trade-cart)
  1339. )
  1340. (defrule
  1341. (unit-type-count eagle-warrior-line < 10)
  1342. (food-amount > 200)
  1343. (gold-amount > 200)
  1344. (can-train eagle-warrior-line)
  1345. =>
  1346. (train eagle-warrior-line)
  1347. )
  1348. (defrule
  1349. (unit-type-count missionary < 10)
  1350. (gold-amount > 200)
  1351. (can-train missionary)
  1352. =>
  1353. (train missionary)
  1354. )
  1355. (defrule
  1356. (unit-type-count longboat-line < 10)
  1357. (food-amount > 200)
  1358. (gold-amount > 200)
  1359. (can-train longboat-line)
  1360. =>
  1361. (train longboat-line)
  1362. )
  1363. (defrule
  1364. (unit-type-count turtle-ship-line < 10)
  1365. (food-amount > 200)
  1366. (gold-amount > 200)
  1367. (can-train turtle-ship-line)
  1368. =>
  1369. (train turtle-ship-line)
  1370. )
  1371. (defrule
  1372. (unit-type-count knight-line < 12)
  1373. (food-amount > 200)
  1374. (gold-amount > 200)
  1375. (can-train knight-line)
  1376. =>
  1377. (train knight-line)
  1378. )
  1379.  
  1380. (defrule
  1381. (unit-type-count villager > 25)
  1382. (not (current-age == dark-age))
  1383. (not (current-age == imperial-age))
  1384. (unit-type-count skirmisher-line < 15)
  1385. (can-train skirmisher-line)
  1386. =>
  1387. (train skirmisher-line)
  1388. )
  1389. (defrule
  1390. (unit-type-count villager > 25)
  1391. (not (current-age == dark-age))
  1392. (not (current-age == imperial-age))
  1393. (unit-type-count militiaman-line < 15)
  1394. (can-train militiaman-line)
  1395. =>
  1396. (train militiaman-line)
  1397. )
  1398. (defrule
  1399. (not (current-age == dark-age))
  1400. (unit-type-count spearman-line < 7)
  1401. (can-train spearman-line)
  1402. (food-amount > 200)
  1403. (wood-amount > 200)
  1404. =>
  1405. (train spearman-line)
  1406. )
  1407. (defrule
  1408. (not (current-age == dark-age))
  1409. (unit-type-count militiaman-line < 5)
  1410. (can-train militiaman-line)
  1411. (food-amount > 200)
  1412. (gold-amount > 200)
  1413. =>
  1414. (train militiaman-line)
  1415. )
  1416. (defrule
  1417. (not (current-age == dark-age))
  1418. (not (current-age == feudal-age))
  1419. (unit-type-count spearman-line < 15)
  1420. (can-train spearman-line)
  1421. (food-amount > 200)
  1422. (wood-amount > 200)
  1423. =>
  1424. (train spearman-line)
  1425. )
  1426. (defrule
  1427. (not (current-age == dark-age))
  1428. (not (current-age == feudal-age))
  1429. (unit-type-count militiaman-line < 10)
  1430. (can-train militiaman-line)
  1431. (food-amount > 200)
  1432. (gold-amount > 200)
  1433. =>
  1434. (train militiaman-line)
  1435. )
  1436. (defrule
  1437. (not (current-age == dark-age))
  1438. (unit-type-count skirmisher-line < 7)
  1439. (can-train skirmisher-line)
  1440. (food-amount > 200)
  1441. (wood-amount > 200)
  1442. =>
  1443. (train skirmisher-line)
  1444. )
  1445. (defrule
  1446. (unit-type-count scout-cavalry-line < 1)
  1447. (can-train scout-cavalry-line)
  1448. (food-amount > 200)
  1449. =>
  1450. (train scout-cavalry-line)
  1451. )
  1452. (defrule
  1453. (not (current-age == dark-age))
  1454. (unit-type-count archer-line < 7)
  1455. (can-train archer-line)
  1456. (gold-amount > 200)
  1457. (wood-amount > 200)
  1458. =>
  1459. (train archer-line)
  1460. )
  1461. (defrule
  1462. (not (current-age == dark-age))
  1463. (not (current-age == feudal-age))
  1464. (unit-type-count archer-line < 15)
  1465. (can-train archer-line)
  1466. (gold-amount > 200)
  1467. (wood-amount > 200)
  1468. =>
  1469. (train archer-line)
  1470. )
  1471.  
  1472. (defrule
  1473. (not (current-age == dark-age))
  1474. (not (current-age == feudal-age))
  1475. (unit-type-count skirmisher-line < 15)
  1476. (can-train skirmisher-line)
  1477. (food-amount > 200)
  1478. (wood-amount > 200)
  1479. =>
  1480. (train skirmisher-line)
  1481. )
  1482. (defrule
  1483. (unit-type-count my-unique-unit-line < 8)
  1484. (can-train my-unique-unit-line)
  1485. (food-amount > 200)
  1486. (gold-amount > 200)
  1487. =>
  1488. (train my-unique-unit-line)
  1489. )
  1490. (defrule
  1491.  
  1492. (not (town-under-attack))
  1493. (unit-type-count my-unique-unit-line < 64)
  1494. (not (civ-selected persian))
  1495. (can-train my-unique-unit-line)
  1496. (food-amount > 4000)
  1497. (gold-amount > 2000)
  1498. (building-type-count castle > 3)
  1499. =>
  1500. (train my-unique-unit-line)
  1501. )
  1502. (defrule
  1503. (not (town-under-attack))
  1504. (unit-type-count my-unique-unit-line < 32)
  1505. (civ-selected persian)
  1506. (can-train my-unique-unit-line)
  1507. (food-amount > 4000)
  1508. (gold-amount > 2000)
  1509. (building-type-count castle > 3)
  1510. =>
  1511. (train my-unique-unit-line)
  1512. )
  1513. ;defrule
  1514. ; (players-unit-type-count any-enemy chu-ko-nu-line > 40)
  1515. ; (wood-amount > 500)
  1516. ; (gold-amount > 500)
  1517. ;=>
  1518. ; (build siege-workshop)
  1519. ; (train mangonel-line)
  1520. ;)
  1521. (defrule
  1522. (unit-type-count trebuchet < 3)
  1523. (can-train trebuchet)
  1524. =>
  1525. (train trebuchet)
  1526. )
  1527.  
  1528. (defrule
  1529. (unit-type-count monk < 6)
  1530. (can-train monk)
  1531. (gold-amount > 200)
  1532. =>
  1533. (train monk)
  1534. )
  1535.  
  1536.  
  1537. (defrule
  1538. (not (town-under-attack))
  1539. (unit-type-count battering-ram-line < 4)
  1540. (can-train battering-ram-line)
  1541. (gold-amount > 200)
  1542. (wood-amount > 200)
  1543. =>
  1544. (train battering-ram-line)
  1545. )
  1546. (defrule
  1547. (unit-type-count mangonel-line < 1)
  1548. (can-train mangonel-line)
  1549. (wood-amount > 200)
  1550. (gold-amount > 200)
  1551. =>
  1552. (train my-unique-unit-line)
  1553. )
  1554. (defrule
  1555. (unit-type-count transport-ship < 1)
  1556. (wood-amount > 200)
  1557. (gold-amount > 200)
  1558. (can-train transport-ship)
  1559. =>
  1560. (train transport-ship)
  1561. )
  1562. (defrule
  1563. (unit-type-count demolition-ship-line < 10)
  1564. (wood-amount > 150)
  1565. (gold-amount > 2000)
  1566. (wood-amount > 4000)
  1567. (can-train demolition-ship-line)
  1568. =>
  1569. (train demolition-ship-line)
  1570. )
  1571. (defrule
  1572. (unit-type-count fishing-ship < 5)
  1573. (wood-amount > 200)
  1574. (gold-amount > 200)
  1575. (can-train fishing-ship)
  1576. =>
  1577. (train fishing-ship)
  1578. )
  1579. (defrule
  1580. (unit-type-count transport-ship < 1)
  1581. (wood-amount > 200)
  1582. (gold-amount > 200)
  1583. (can-train transport-ship)
  1584. =>
  1585. (train transport-ship)
  1586. )
  1587. (defrule
  1588. (unit-type-count fire-ship-line < 8)
  1589. (wood-amount > 200)
  1590. (gold-amount > 200)
  1591. (can-train fire-ship-line)
  1592. =>
  1593. (train fire-ship-line)
  1594. )
  1595. (defrule
  1596. (unit-type-count galley-line < 6)
  1597. (wood-amount > 200)
  1598. (gold-amount > 200)
  1599. (can-train galley-line)
  1600. =>
  1601. (train galley-line)
  1602. )
  1603. (defrule
  1604. (unit-type-count cannon-galleon-line < 4)
  1605. (wood-amount > 200)
  1606. (gold-amount > 200)
  1607. (can-train cannon-galleon-line)
  1608. =>
  1609. (train cannon-galleon-line)
  1610. )
  1611. (defrule
  1612. (unit-type-count transport-ship < 2)
  1613. (wood-amount > 400)
  1614. (gold-amount > 400)
  1615. (can-train transport-ship)
  1616. =>
  1617. (train transport-ship)
  1618. )
  1619. (defrule
  1620. (unit-type-count fire-ship-line < 16)
  1621. (wood-amount > 400)
  1622. (gold-amount > 400)
  1623. (can-train fire-ship-line)
  1624. =>
  1625. (train fire-ship-line)
  1626. )
  1627. (defrule
  1628. (unit-type-count galley-line < 12)
  1629. (wood-amount > 400)
  1630. (gold-amount > 400)
  1631. (can-train galley-line)
  1632. =>
  1633. (train galley-line)
  1634. )
  1635. (defrule
  1636. (unit-type-count cannon-galleon-line < 8)
  1637. (wood-amount > 400)
  1638. (gold-amount > 400)
  1639. (can-train cannon-galleon-line)
  1640. =>
  1641. (train cannon-galleon-line)
  1642. )
  1643.  
  1644. ;Second Runthrough;imperial random
  1645. (defrule
  1646. (unit-type-count knight-line < 24)
  1647. (food-amount > 200)
  1648. (gold-amount > 200)
  1649. (can-train knight-line)
  1650. =>
  1651. (train knight-line)
  1652. )
  1653.  
  1654. (defrule
  1655. (not (current-age == dark-age))
  1656. (not (current-age == feudal-age))
  1657. (not (current-age == castle-age))
  1658. (unit-type-count militiaman-line < 20)
  1659. (can-train militiaman-line)
  1660. (food-amount > 200)
  1661. (gold-amount > 200)
  1662. =>
  1663. (train militiaman-line)
  1664. )
  1665.  
  1666. (defrule
  1667. (not (current-age == dark-age))
  1668. (not (current-age == feudal-age))
  1669. (unit-type-count scout-cavalry-line < 2)
  1670. (can-train scout-cavalry-line)
  1671. (food-amount > 200)
  1672. =>
  1673. (train scout-cavalry-line)
  1674. )
  1675. (defrule
  1676. (not (current-age == dark-age))
  1677. (not (current-age == feudal-age))
  1678. (not (current-age == castle-age))
  1679. (unit-type-count archer-line < 30)
  1680. (can-train archer-line)
  1681. (gold-amount > 200)
  1682. (wood-amount > 200)
  1683. =>
  1684. (train archer-line)
  1685. )
  1686. (defrule
  1687. (not (current-age == dark-age))
  1688. (not (current-age == feudal-age))
  1689. (not (current-age == castle-age))
  1690. (unit-type-count spearman-line < 30)
  1691. (can-train spearman-line)
  1692. (food-amount > 200)
  1693. (wood-amount > 200)
  1694. =>
  1695. (train spearman-line)
  1696. )
  1697. (defrule
  1698. (not (current-age == dark-age))
  1699. (not (current-age == feudal-age))
  1700. (not (current-age == castle-age))
  1701. (unit-type-count skirmisher-line < 30)
  1702. (can-train skirmisher-line)
  1703. (food-amount > 200)
  1704. (wood-amount > 200)
  1705. =>
  1706. (train skirmisher-line)
  1707. )
  1708. (defrule
  1709. (unit-type-count my-unique-unit-line < 16)
  1710. (can-train my-unique-unit-line)
  1711. (food-amount > 200)
  1712. (gold-amount > 200)
  1713. =>
  1714. (train my-unique-unit-line)
  1715. )
  1716.  
  1717. (defrule
  1718. (unit-type-count trebuchet < 6)
  1719. (can-train trebuchet)
  1720. =>
  1721. (train trebuchet)
  1722. )
  1723.  
  1724. (defrule
  1725. (unit-type-count monk < 15)
  1726. (can-train monk)
  1727. (gold-amount > 200)
  1728. =>
  1729. (train monk)
  1730. )
  1731. (defrule
  1732. (unit-type-count missionary < 20)
  1733. (gold-amount > 200)
  1734. (can-train missionary)
  1735. =>
  1736. (train missionary)
  1737. )
  1738. (defrule
  1739. (unit-type-count eagle-warrior-line < 20)
  1740. (food-amount > 200)
  1741. (gold-amount > 200)
  1742. (can-train eagle-warrior-line)
  1743. =>
  1744. (train eagle-warrior-line)
  1745. )
  1746. (defrule
  1747. (unit-type-count longboat-line < 20)
  1748. (food-amount > 200)
  1749. (gold-amount > 200)
  1750. (can-train longboat-line)
  1751. =>
  1752. (train longboat-line)
  1753. )
  1754. (defrule
  1755. (unit-type-count turtle-ship-line < 20)
  1756. (food-amount > 200)
  1757. (gold-amount > 200)
  1758. (can-train turtle-ship-line)
  1759. =>
  1760. (train turtle-ship-line)
  1761. )
  1762. (defrule
  1763. (not (town-under-attack))
  1764. (unit-type-count scorpion-line < 8)
  1765. (can-train scorpion-line)
  1766. (gold-amount > 200)
  1767. (wood-amount > 200)
  1768. =>
  1769. (train scorpion-line)
  1770. )
  1771.  
  1772. (defrule
  1773. (unit-type-count transport-ship < 3)
  1774. (wood-amount > 200)
  1775. (gold-amount > 200)
  1776. (can-train transport-ship)
  1777. =>
  1778. (train transport-ship)
  1779. )
  1780. (defrule
  1781. (unit-type-count fire-ship-line < 12)
  1782. (wood-amount > 200)
  1783. (gold-amount > 200)
  1784. (can-train fire-ship-line)
  1785. =>
  1786. (train fire-ship-line)
  1787. )
  1788. (defrule
  1789. (unit-type-count galley-line < 12)
  1790. (wood-amount > 200)
  1791. (gold-amount > 200)
  1792. (can-train galley-line)
  1793. =>
  1794. (train galley-line)
  1795. )
  1796. (defrule
  1797. (unit-type-count cannon-galleon-line < 12)
  1798. (wood-amount > 200)
  1799. (gold-amount > 200)
  1800. (can-train cannon-galleon-line)
  1801. =>
  1802. (train cannon-galleon-line)
  1803. )
  1804. (defrule
  1805. (unit-type-count transport-ship < 4)
  1806. (wood-amount > 200)
  1807. (gold-amount > 200)
  1808. (can-train transport-ship)
  1809. =>
  1810. (train transport-ship)
  1811. )
  1812. (defrule
  1813. (unit-type-count fire-ship-line < 16)
  1814. (wood-amount > 200)
  1815. (gold-amount > 200)
  1816. (can-train fire-ship-line)
  1817. =>
  1818. (train fire-ship-line)
  1819. )
  1820. (defrule
  1821. (unit-type-count galley-line < 16)
  1822. (wood-amount > 200)
  1823. (gold-amount > 200)
  1824. (can-train galley-line)
  1825. =>
  1826. (train galley-line)
  1827. )
  1828. (defrule
  1829. (unit-type-count cannon-galleon-line < 16)
  1830. (wood-amount > 200)
  1831. (gold-amount > 200)
  1832. (can-train cannon-galleon-line)
  1833. =>
  1834. (train cannon-galleon-line)
  1835. )
  1836.  
  1837.  
  1838.  
  1839. ;superpop
  1840. ; ============== ADDED BUILD LISTS
  1841.  
  1842. ;superhousing
  1843. (defrule
  1844. (housing-headroom less-than 16)
  1845. (population-headroom greater-than 0)
  1846. (can-build house)
  1847. (population > 50)
  1848. =>
  1849. (build house)
  1850. )
  1851. (defrule
  1852. (unit-type-count villager less-than 200);imperial random
  1853. (population < 438)
  1854. (food-amount > 100)
  1855. (can-train villager)
  1856. (military-population >= 35)
  1857. =>
  1858. (train villager)
  1859. )
  1860. ;upgrade to 6 town centers if possible for super villager spam
  1861. (defrule;imperial random
  1862. (game-time greater-than 45);imperial random
  1863. (food-amount > 1000);imperial random
  1864. (military-population >= 70)
  1865. (unit-type-count villager less-than 40)
  1866. (building-type-count town-center less-than 6);imperial random
  1867. (can-build town-center)
  1868. =>
  1869. (build town-center)
  1870. )
  1871.  
  1872. (defrule
  1873. (wood-amount > 1000)
  1874. (building-type-count siege-workshop less-than 2)
  1875. (can-build siege-workshop)
  1876. =>
  1877. (build siege-workshop)
  1878. )
  1879.  
  1880.  
  1881. (defrule
  1882. (wood-amount > 1000)
  1883. (building-type-count archery-range less-than 6)
  1884. (can-build archery-range)
  1885. =>
  1886. (build archery-range)
  1887. )
  1888. (defrule
  1889. (wood-amount > 1000)
  1890. (building-type-count barracks less-than 6)
  1891. (can-build barracks)
  1892. =>
  1893. (build barracks)
  1894. )
  1895. (defrule
  1896. (wood-amount > 1000)
  1897. (building-type-count stable less-than 6)
  1898. (can-build stable)
  1899. =>
  1900. (build stable)
  1901. )
  1902.  
  1903. (defrule
  1904. (players-civ any-enemy korean)
  1905. (building-type-count dock > 0)
  1906. (building-type-count bombard-tower < 10)
  1907. (stone-amount > 750)
  1908. (can-build bombard-tower)
  1909. =>
  1910. (build bombard-tower)
  1911. )
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917. ; ============== MILITARY UNITS
  1918. (defrule
  1919. (unit-type-count trade-cart < 25)
  1920. (wood-amount > 1250)
  1921. (gold-amount < 1250)
  1922. (unit-type-count villager < 10)
  1923. (can-train trade-cart)
  1924. =>
  1925. (train trade-cart)
  1926. )
  1927. (defrule
  1928. (unit-type-count eagle-warrior-line < 25)
  1929. (food-amount > 500)
  1930. (gold-amount > 500)
  1931. (can-train eagle-warrior-line)
  1932. =>
  1933. (train eagle-warrior-line)
  1934. )
  1935. (defrule
  1936. (unit-type-count missionary < 25)
  1937. (gold-amount > 500)
  1938. (can-train missionary)
  1939. =>
  1940. (train missionary)
  1941. )
  1942. (defrule
  1943. (unit-type-count longboat-line < 25)
  1944. (food-amount > 500)
  1945. (gold-amount > 500)
  1946. (can-train longboat-line)
  1947. =>
  1948. (train longboat-line)
  1949. )
  1950. (defrule
  1951.  
  1952. (not (town-under-attack))
  1953. (unit-type-count my-unique-unit-line < 160)
  1954. (not (civ-selected persian))
  1955. (can-train my-unique-unit-line)
  1956. (food-amount > 4000)
  1957. (gold-amount > 2000)
  1958. (building-type-count castle > 3)
  1959. =>
  1960. (train my-unique-unit-line)
  1961. )
  1962. (defrule
  1963. (not (town-under-attack))
  1964. (unit-type-count my-unique-unit-line < 80)
  1965. (civ-selected persian)
  1966. (can-train my-unique-unit-line)
  1967. (food-amount > 4000)
  1968. (gold-amount > 2000)
  1969. (building-type-count castle > 3)
  1970. =>
  1971. (train my-unique-unit-line)
  1972. )
  1973.  
  1974.  
  1975.  
  1976. (defrule
  1977. (not (town-under-attack))
  1978. (unit-type-count battering-ram-line < 10)
  1979. (can-train battering-ram-line)
  1980. (gold-amount > 500)
  1981. (wood-amount > 500)
  1982. =>
  1983. (train battering-ram-line)
  1984. )
  1985. (defrule
  1986. (unit-type-count mangonel-line < 3)
  1987. (can-train mangonel-line)
  1988. (wood-amount > 500)
  1989. (gold-amount > 500)
  1990. =>
  1991. (train my-unique-unit-line)
  1992. )
  1993. (defrule
  1994. (unit-type-count demolition-ship-line < 10)
  1995. (wood-amount > 375)
  1996. (gold-amount > 2000)
  1997. (wood-amount > 8000)
  1998. (can-train demolition-ship-line)
  1999. =>
  2000. (train demolition-ship-line)
  2001. )
  2002. (defrule
  2003. (unit-type-count fishing-ship < 13)
  2004. (wood-amount > 500)
  2005. (gold-amount > 500)
  2006. (can-train fishing-ship)
  2007. =>
  2008. (train fishing-ship)
  2009. )
  2010.  
  2011. ;Second Runthrough;imperial random
  2012. (defrule
  2013. (unit-type-count knight-line < 60)
  2014. (food-amount > 500)
  2015. (gold-amount > 500)
  2016. (can-train knight-line)
  2017. =>
  2018. (train knight-line)
  2019. )
  2020.  
  2021. (defrule
  2022. (not (current-age == dark-age))
  2023. (not (current-age == feudal-age))
  2024. (not (current-age == castle-age))
  2025. (unit-type-count militiaman-line < 50)
  2026. (can-train militiaman-line)
  2027. (food-amount > 500)
  2028. (gold-amount > 500)
  2029. =>
  2030. (train militiaman-line)
  2031. )
  2032.  
  2033. (defrule
  2034. (not (current-age == dark-age))
  2035. (not (current-age == feudal-age))
  2036. (unit-type-count scout-cavalry-line < 5)
  2037. (can-train scout-cavalry-line)
  2038. (food-amount > 500)
  2039. =>
  2040. (train scout-cavalry-line)
  2041. )
  2042. (defrule
  2043. (not (current-age == dark-age))
  2044. (not (current-age == feudal-age))
  2045. (not (current-age == castle-age))
  2046. (unit-type-count archer-line < 75)
  2047. (can-train archer-line)
  2048. (gold-amount > 500)
  2049. (wood-amount > 500)
  2050. =>
  2051. (train archer-line)
  2052. )
  2053. (defrule
  2054. (not (current-age == dark-age))
  2055. (not (current-age == feudal-age))
  2056. (not (current-age == castle-age))
  2057. (unit-type-count spearman-line < 75)
  2058. (can-train spearman-line)
  2059. (food-amount > 500)
  2060. (wood-amount > 500)
  2061. =>
  2062. (train spearman-line)
  2063. )
  2064. (defrule
  2065. (not (current-age == dark-age))
  2066. (not (current-age == feudal-age))
  2067. (not (current-age == castle-age))
  2068. (unit-type-count skirmisher-line < 75)
  2069. (can-train skirmisher-line)
  2070. (food-amount > 500)
  2071. (wood-amount > 500)
  2072. =>
  2073. (train skirmisher-line)
  2074. )
  2075. (defrule
  2076. (unit-type-count my-unique-unit-line < 40)
  2077. (can-train my-unique-unit-line)
  2078. (food-amount > 500)
  2079. (gold-amount > 500)
  2080. =>
  2081. (train my-unique-unit-line)
  2082. )
  2083.  
  2084. (defrule
  2085. (unit-type-count trebuchet < 15)
  2086. (can-train trebuchet)
  2087. =>
  2088. (train trebuchet)
  2089. )
  2090.  
  2091. (defrule
  2092. (unit-type-count monk < 38)
  2093. (can-train monk)
  2094. (gold-amount > 500)
  2095. =>
  2096. (train monk)
  2097. )
  2098. (defrule
  2099. (unit-type-count missionary < 50)
  2100. (gold-amount > 500)
  2101. (can-train missionary)
  2102. =>
  2103. (train missionary)
  2104. )
  2105. (defrule
  2106. (unit-type-count eagle-warrior-line < 50)
  2107. (food-amount > 500)
  2108. (gold-amount > 500)
  2109. (can-train eagle-warrior-line)
  2110. =>
  2111. (train eagle-warrior-line)
  2112. )
  2113. (defrule
  2114. (unit-type-count longboat-line < 50)
  2115. (food-amount > 500)
  2116. (gold-amount > 500)
  2117. (can-train longboat-line)
  2118. =>
  2119. (train longboat-line)
  2120. )
  2121. (defrule
  2122. (unit-type-count turtle-ship-line < 50)
  2123. (food-amount > 500)
  2124. (gold-amount > 500)
  2125. (can-train turtle-ship-line)
  2126. =>
  2127. (train turtle-ship-line)
  2128. )
  2129. (defrule
  2130. (not (town-under-attack))
  2131. (unit-type-count scorpion-line < 20)
  2132. (can-train scorpion-line)
  2133. (gold-amount > 500)
  2134. (wood-amount > 500)
  2135. =>
  2136. (train scorpion-line)
  2137. )
  2138.  
  2139. (defrule
  2140. (unit-type-count transport-ship < 10)
  2141. (wood-amount > 500)
  2142. (gold-amount > 500)
  2143. (can-train transport-ship)
  2144. =>
  2145. (train transport-ship)
  2146. )
  2147. (defrule
  2148. (unit-type-count fire-ship-line < 40)
  2149. (wood-amount > 500)
  2150. (gold-amount > 500)
  2151. (can-train fire-ship-line)
  2152. =>
  2153. (train fire-ship-line)
  2154. )
  2155. (defrule
  2156. (unit-type-count galley-line < 40)
  2157. (wood-amount > 500)
  2158. (gold-amount > 500)
  2159. (can-train galley-line)
  2160. =>
  2161. (train galley-line)
  2162. )
  2163. (defrule
  2164. (unit-type-count cannon-galleon-line < 40)
  2165. (wood-amount > 500)
  2166. (gold-amount > 500)
  2167. (can-train cannon-galleon-line)
  2168. =>
  2169. (train cannon-galleon-line)
  2170. )
  2171.  
  2172.  
  2173. ; ========================== UPGRADES - I usually use the same rules for upgrades for all civs. If the AI has a certain number of units, it tries to upgrade them.
  2174.  
  2175. ; problem with escrow - give up
  2176. (defrule
  2177. (escrow-amount wood > 500)
  2178. =>
  2179. (release-escrow wood)
  2180. )
  2181. (defrule
  2182. (escrow-amount stone > 500)
  2183. =>
  2184. (release-escrow stone)
  2185. )
  2186. (defrule
  2187. (or
  2188. (or
  2189. (escrow-amount wood > 1000)
  2190. (escrow-amount food > 1500)
  2191. )
  2192. (or
  2193. (escrow-amount gold > 1500)
  2194. (escrow-amount stone > 1000)
  2195. )
  2196. )
  2197. =>
  2198. (release-escrow wood)
  2199. (release-escrow food)
  2200. (release-escrow gold)
  2201. (release-escrow stone)
  2202. )
  2203.  
  2204.  
  2205. ; ////////////////////////////////////////////////////
  2206.  
  2207. ; sets initial goal for escrow to make sure there are villagers
  2208.  
  2209. (defrule
  2210. (true)
  2211. =>
  2212. (disable-self)
  2213. )
  2214. (defrule
  2215. (unit-type-count villager >= 10)
  2216. =>
  2217. (disable-self)
  2218. )
  2219.  
  2220. ; sets escrow
  2221. ;0 = Unacceptable
  2222. ;10 = Unacceptable
  2223. ;20 = Unacceptable
  2224. ;30 = Unacceptable
  2225. ;40 = 14:50
  2226. ;50 = Time
  2227. ;60 = Time
  2228. ;70 = Time
  2229. ;80 = Time
  2230. ;90 = 11:16
  2231. ;100 = Time
  2232. ;56 =
  2233. ;75 = Late
  2234. ;80 = 25:35, late
  2235. (defrule
  2236. (current-age == dark-age)
  2237. (unit-type-count villager < 30)
  2238. =>
  2239. (set-escrow-percentage wood 0)
  2240. (set-escrow-percentage food 0)
  2241. (set-escrow-percentage gold 0)
  2242. (set-escrow-percentage stone 0)
  2243. )
  2244. (defrule
  2245. (current-age == dark-age)
  2246. (unit-type-count villager > 30)
  2247. =>
  2248. (set-escrow-percentage wood 20)
  2249. (set-escrow-percentage food 80)
  2250. (set-escrow-percentage gold 80)
  2251. (set-escrow-percentage stone 10)
  2252. )
  2253. (defrule
  2254. (current-age == feudal-age)
  2255. (unit-type-count villager < 60)
  2256. (or (building-type-count market > 0)
  2257. (game-time < 1200))
  2258. =>
  2259. (set-escrow-percentage wood 5)
  2260. (set-escrow-percentage food 15)
  2261. (set-escrow-percentage gold 50)
  2262. (set-escrow-percentage stone 25)
  2263. )
  2264. (defrule
  2265. (current-age == feudal-age)
  2266. (unit-type-count villager < 60)
  2267. (or (building-type-count market > 0)
  2268. (game-time < 1200))
  2269. =>
  2270. (set-escrow-percentage wood 5)
  2271. (set-escrow-percentage food 15)
  2272. (set-escrow-percentage gold 50)
  2273. (set-escrow-percentage stone 25)
  2274. )
  2275. (defrule
  2276. (current-age == feudal-age)
  2277. (unit-type-count villager < 60)
  2278. (or (building-type-count market < 0)
  2279. (game-time > 1200))
  2280. =>
  2281. (set-escrow-percentage wood 80)
  2282. (set-escrow-percentage food 15)
  2283. (set-escrow-percentage gold 50)
  2284. (set-escrow-percentage stone 25)
  2285. )
  2286. (defrule
  2287. (current-age == feudal-age)
  2288. (unit-type-count villager > 60)
  2289. =>
  2290. (set-escrow-percentage wood 25)
  2291. (set-escrow-percentage food 85)
  2292. (set-escrow-percentage gold 85)
  2293. (set-escrow-percentage stone 12)
  2294. )
  2295. (defrule
  2296. (current-age == castle-age)
  2297. (unit-type-count villager < 80)
  2298. =>
  2299. (set-escrow-percentage wood 5)
  2300. (set-escrow-percentage food 5)
  2301. (set-escrow-percentage gold 25)
  2302. (set-escrow-percentage stone 12)
  2303. )
  2304. (defrule
  2305. (current-age == castle-age)
  2306. (unit-type-count villager > 80)
  2307. =>
  2308. (set-escrow-percentage wood 15)
  2309. (set-escrow-percentage food 45)
  2310. (set-escrow-percentage gold 45)
  2311. (set-escrow-percentage stone 7)
  2312. )
  2313. (defrule
  2314. (current-age == castle-age)
  2315. (unit-type-count villager > 120)
  2316. =>
  2317. (set-escrow-percentage wood 30)
  2318. (set-escrow-percentage food 90)
  2319. (set-escrow-percentage gold 90)
  2320. (set-escrow-percentage stone 15)
  2321. )
  2322. (defrule
  2323. (current-age == imperial-age)
  2324. (not (research-completed my-unique-unit-upgrade))
  2325. =>
  2326. (set-escrow-percentage wood 20)
  2327. (set-escrow-percentage food 56)
  2328. (set-escrow-percentage gold 56)
  2329. (set-escrow-percentage stone 10)
  2330. )
  2331.  
  2332. ; /////////////////////////////////////////////////////
  2333. ;UNIT UPGRADES
  2334. (defrule
  2335. (can-research ri-cartography)
  2336. =>
  2337. (research ri-cartography)
  2338. (chat-local-to-self "I can see it now...")
  2339. (chat-to-allies "Researching Cartography.")
  2340. )
  2341. (defrule
  2342. (can-research ri-cartography)
  2343. =>
  2344. (research ri-cartography)
  2345. (chat-local-to-self "I can see it now...")
  2346. (chat-to-allies "Researching Cartography.")
  2347. )
  2348. (defrule
  2349. (or
  2350. (building-type-count castle > 0)
  2351. (building-type-count watch-tower-line > 2)
  2352. )
  2353. (can-research ri-murder-holes)
  2354. =>
  2355. (research ri-murder-holes)
  2356. )
  2357. (defrule
  2358. (can-research ri-town-patrol)
  2359. =>
  2360. (research ri-town-patrol)
  2361. )
  2362. (defrule
  2363. (can-research ri-town-watch)
  2364. =>
  2365. (research ri-town-watch)
  2366. )
  2367.  
  2368. (defrule
  2369.  
  2370. (can-research my-unique-unit-upgrade)
  2371. =>
  2372. (research my-unique-unit-upgrade)
  2373. )
  2374.  
  2375. (defrule
  2376.  
  2377. (unit-type-count militiaman > 2)
  2378. (can-research ri-man-at-arms)
  2379. =>
  2380. (research ri-man-at-arms)
  2381. )
  2382.  
  2383. (defrule
  2384.  
  2385. (unit-type-count man-at-arms > 2)
  2386. (can-research ri-long-swordsman)
  2387. =>
  2388. (research ri-long-swordsman)
  2389. )
  2390.  
  2391. (defrule
  2392.  
  2393. (unit-type-count long-swordsman > 3)
  2394. (can-research ri-two-handed-swordsman)
  2395. =>
  2396. (research ri-two-handed-swordsman)
  2397. )
  2398.  
  2399. (defrule
  2400.  
  2401. (unit-type-count two-handed-swordsman > 3)
  2402. (can-research ri-champion)
  2403. =>
  2404. (research ri-champion)
  2405. )
  2406.  
  2407. (defrule
  2408.  
  2409. (unit-type-count spearman > 3)
  2410. (can-research ri-pikeman)
  2411. =>
  2412. (research ri-pikeman)
  2413. )
  2414. (defrule
  2415.  
  2416. (unit-type-count spearman-line > 3)
  2417. (can-research ri-halberdier)
  2418. =>
  2419. (research ri-halberdier)
  2420. )
  2421. (defrule
  2422.  
  2423. (unit-type-count scout-cavalry > 4)
  2424. (can-research ri-light-cavalry)
  2425. =>
  2426. (research ri-light-cavalry)
  2427. )
  2428.  
  2429. (defrule
  2430.  
  2431. (unit-type-count camel > 4)
  2432. (can-research ri-heavy-camel)
  2433. =>
  2434. (research ri-heavy-camel)
  2435. )
  2436.  
  2437. (defrule
  2438.  
  2439. (unit-type-count knight > 4)
  2440. (can-research ri-cavalier)
  2441. =>
  2442. (research ri-cavalier)
  2443. )
  2444.  
  2445. (defrule
  2446.  
  2447. (unit-type-count cavalier > 4)
  2448. (can-research ri-paladin)
  2449. =>
  2450. (research ri-paladin)
  2451. )
  2452.  
  2453. (defrule
  2454.  
  2455. (unit-type-count archer > 2)
  2456. (can-research ri-crossbow)
  2457. =>
  2458. (research ri-crossbow)
  2459. )
  2460.  
  2461. (defrule
  2462.  
  2463. (unit-type-count crossbowman > 2)
  2464. (can-research ri-arbalest)
  2465. =>
  2466. (research ri-arbalest)
  2467. )
  2468.  
  2469. (defrule
  2470.  
  2471. (unit-type-count cavalry-archer > 2)
  2472. (can-research ri-heavy-cavalry-archer)
  2473. =>
  2474. (research ri-heavy-cavalry-archer)
  2475. )
  2476.  
  2477. (defrule
  2478. (unit-type-count skirmisher > 2)
  2479. (can-research ri-elite-skirmisher)
  2480. =>
  2481. (research ri-elite-skirmisher)
  2482. )
  2483.  
  2484. (defrule
  2485.  
  2486. (unit-type-count scorpion > 2)
  2487. (can-research ri-heavy-scorpion)
  2488. =>
  2489. (research ri-heavy-scorpion)
  2490. )
  2491.  
  2492. (defrule
  2493.  
  2494. (unit-type-count battering-ram > 2)
  2495. (can-research ri-capped-ram)
  2496. =>
  2497. (research ri-capped-ram)
  2498. )
  2499.  
  2500. (defrule
  2501.  
  2502. (unit-type-count capped-ram > 2)
  2503. (can-research ri-siege-ram)
  2504. =>
  2505. (research ri-siege-ram)
  2506. )
  2507.  
  2508. (defrule
  2509.  
  2510. (unit-type-count mangonel > 1)
  2511. (can-research ri-onager)
  2512. =>
  2513. (research ri-onager)
  2514. )
  2515.  
  2516. (defrule
  2517.  
  2518. (unit-type-count onager > 1)
  2519. (can-research ri-siege-onager)
  2520. =>
  2521. (research ri-siege-onager)
  2522. )
  2523.  
  2524. ;DOCK UNITS
  2525. (defrule
  2526.  
  2527. (unit-type-count galley > 2)
  2528. (can-research ri-war-galley)
  2529. =>
  2530. (research ri-war-galley)
  2531. )
  2532.  
  2533. (defrule
  2534.  
  2535. (unit-type-count war-galley > 2)
  2536. (can-research ri-galleon)
  2537. =>
  2538. (research ri-galleon)
  2539. )
  2540.  
  2541. (defrule
  2542.  
  2543. (or
  2544. (unit-type-count galleon > 2)
  2545. (unit-type-count war-galley > 2)
  2546. )
  2547. (can-research ri-cannon-galleon)
  2548. =>
  2549. (research ri-cannon-galleon)
  2550. )
  2551.  
  2552. (defrule
  2553.  
  2554. (unit-type-count fire-ship > 1)
  2555. (can-research ri-fast-fire-ship)
  2556. =>
  2557. (research ri-fast-fire-ship)
  2558. )
  2559.  
  2560. (defrule
  2561.  
  2562. (unit-type-count demolition-ship > 2)
  2563. (can-research ri-heavy-demolition-ship)
  2564. =>
  2565. (research ri-heavy-demolition-ship)
  2566. )
  2567.  
  2568. ; ////////////////////////WEAPONS//////////////////
  2569.  
  2570. (defrule
  2571.  
  2572. (can-research ri-forging)
  2573. =>
  2574. (research ri-forging)
  2575. )
  2576.  
  2577. (defrule
  2578.  
  2579. (can-research ri-iron-casting)
  2580. =>
  2581. (research ri-iron-casting)
  2582. )
  2583.  
  2584. (defrule
  2585.  
  2586. (can-research ri-blast-furnace)
  2587. =>
  2588. (research ri-blast-furnace)
  2589. )
  2590.  
  2591. ;ARCHER UPGRADES -- cost food/gold
  2592. (defrule
  2593.  
  2594. (can-research ri-fletching)
  2595. =>
  2596. (research ri-fletching)
  2597. )
  2598.  
  2599. (defrule
  2600.  
  2601. (can-research ri-bodkin-arrow)
  2602. =>
  2603. (research ri-bodkin-arrow)
  2604. )
  2605.  
  2606. (defrule
  2607.  
  2608. (can-research ri-bracer)
  2609. =>
  2610. (research ri-bracer)
  2611. )
  2612.  
  2613. (defrule
  2614.  
  2615. (or
  2616. (unit-type-count archer-line > 3)
  2617. (or
  2618. (unit-type-count skirmisher-line > 3)
  2619. (unit-type-count cavalry-archer-line > 3)
  2620. )
  2621. )
  2622. (can-research ri-padded-archer-armor)
  2623. =>
  2624. (research ri-padded-archer-armor)
  2625. )
  2626.  
  2627. (defrule
  2628.  
  2629. (or
  2630. (unit-type-count archer-line > 3)
  2631. (or
  2632. (unit-type-count skirmisher-line > 3)
  2633. (unit-type-count cavalry-archer-line > 3)
  2634. )
  2635. )
  2636. (can-research ri-leather-archer-armor)
  2637. =>
  2638. (research ri-leather-archer-armor)
  2639. )
  2640.  
  2641. (defrule
  2642.  
  2643. (or
  2644. (unit-type-count archer-line > 3)
  2645. (or
  2646. (unit-type-count skirmisher-line > 3)
  2647. (unit-type-count cavalry-archer-line > 3)
  2648. )
  2649. )
  2650. (can-research ri-ring-archer-armor)
  2651. =>
  2652. (research ri-ring-archer-armor)
  2653. )
  2654.  
  2655. (defrule
  2656.  
  2657. (or
  2658. (unit-type-count militiaman-line > 3)
  2659. (unit-type-count spearman-line > 3)
  2660. )
  2661. (can-research ri-scale-mail)
  2662. =>
  2663. (research ri-scale-mail)
  2664. )
  2665.  
  2666. (defrule
  2667.  
  2668. (or
  2669. (unit-type-count militiaman-line > 3)
  2670. (unit-type-count spearman-line > 3)
  2671. )
  2672. (can-research ri-chain-mail)
  2673. =>
  2674. (research ri-chain-mail)
  2675. )
  2676.  
  2677. (defrule
  2678.  
  2679. (or
  2680. (unit-type-count militiaman-line > 3)
  2681. (unit-type-count spearman-line > 3)
  2682. )
  2683. (can-research ri-plate-mail)
  2684. =>
  2685. (research ri-plate-mail)
  2686. )
  2687.  
  2688.  
  2689. (defrule
  2690.  
  2691. (or
  2692. (unit-type-count militiaman-line > 3)
  2693. (unit-type-count spearman-line > 3)
  2694. )
  2695. (can-research ri-tracking)
  2696. =>
  2697. (research ri-tracking)
  2698. )
  2699.  
  2700. (defrule
  2701.  
  2702. (or
  2703. (unit-type-count militiaman-line > 3)
  2704. (unit-type-count spearman-line > 3)
  2705. )
  2706. (can-research ri-squires)
  2707. =>
  2708. (research ri-squires)
  2709. )
  2710.  
  2711. (defrule
  2712.  
  2713. (or
  2714. (unit-type-count knight-line > 3)
  2715. (unit-type-count scout-cavalry-line > 3)
  2716. )
  2717. (can-research ri-scale-barding)
  2718. =>
  2719. (research ri-scale-barding)
  2720. )
  2721.  
  2722. (defrule
  2723.  
  2724. (or
  2725. (unit-type-count knight-line > 3)
  2726. (unit-type-count scout-cavalry-line > 3)
  2727. )
  2728. (can-research ri-chain-barding)
  2729. =>
  2730. (research ri-chain-barding)
  2731. )
  2732.  
  2733. (defrule
  2734.  
  2735. (or
  2736. (unit-type-count knight-line > 3)
  2737. (unit-type-count scout-cavalry-line > 3)
  2738. )
  2739. (can-research ri-plate-barding)
  2740. =>
  2741. (research ri-plate-barding)
  2742. )
  2743.  
  2744. (defrule
  2745.  
  2746. (or
  2747. (unit-type-count cavalry-archer-line > 3)
  2748. (or
  2749. (unit-type-count knight-line > 3)
  2750. (unit-type-count scout-cavalry-line > 3)
  2751. )
  2752. )
  2753. (can-research ri-husbandry)
  2754. =>
  2755. (research ri-husbandry)
  2756. )
  2757.  
  2758. ; /////////////////////SIEGE RESEARCH ITEMS///////////////////////////
  2759.  
  2760. (defrule
  2761.  
  2762. (can-research ri-siege-engineers)
  2763. =>
  2764. (research ri-siege-engineers)
  2765. )
  2766.  
  2767. ;FORTRESS UPGRADES
  2768. (defrule
  2769.  
  2770. (can-research ri-hoardings)
  2771. =>
  2772. (research ri-hoardings)
  2773. )
  2774.  
  2775. ;SHIPS
  2776. (defrule
  2777.  
  2778. (unit-type-count cannon-galleon > 2)
  2779. (can-research ri-deck-guns)
  2780. =>
  2781. (research ri-deck-guns)
  2782. )
  2783.  
  2784. (defrule
  2785.  
  2786. (or
  2787. (unit-type-count transport-ship > 0)
  2788. (unit-type-count galley-line > 2)
  2789. )
  2790. (can-research ri-careening)
  2791. =>
  2792. (research ri-careening)
  2793. )
  2794.  
  2795. (defrule
  2796.  
  2797. (or
  2798. (unit-type-count transport-ship > 0)
  2799. (unit-type-count galley-line > 2)
  2800. )
  2801. (can-research ri-dry-dock)
  2802. =>
  2803. (research ri-dry-dock)
  2804. )
  2805.  
  2806. (defrule
  2807.  
  2808. (or
  2809. (unit-type-count galley-line > 2)
  2810. (or
  2811. (unit-type-count cannon-galleon-line > 1)
  2812. (unit-type-count fire-ship-line > 1)
  2813. )
  2814. )
  2815. (can-research ri-shipwright)
  2816. =>
  2817. (research ri-shipwright)
  2818. )
  2819.  
  2820. ;OTHER RESEARCH ITEMS
  2821. (defrule
  2822.  
  2823. (can-research ri-ballistics)
  2824. =>
  2825. (research ri-ballistics)
  2826. )
  2827.  
  2828. (defrule
  2829.  
  2830. (can-research ri-chemistry)
  2831. =>
  2832. (research ri-chemistry)
  2833. )
  2834.  
  2835. (defrule
  2836.  
  2837. (can-research ri-conscription)
  2838. =>
  2839. (research ri-conscription)
  2840. )
  2841.  
  2842. (defrule
  2843.  
  2844. (can-research my-unique-research)
  2845. =>
  2846. (research my-unique-research)
  2847. )
  2848.  
  2849.  
  2850. ; //////////////////////ECONOMIC////////////////////////
  2851.  
  2852. ;mining-camp items
  2853. (defrule
  2854.  
  2855. (can-research ri-gold-mining)
  2856. =>
  2857. (research ri-gold-mining)
  2858. )
  2859.  
  2860. (defrule
  2861.  
  2862. (can-research ri-gold-shaft-mining)
  2863. =>
  2864. (research ri-gold-shaft-mining)
  2865. )
  2866.  
  2867. (defrule
  2868.  
  2869. (building-type-count mining-camp > 1)
  2870. (can-research ri-stone-mining)
  2871. =>
  2872. (research ri-stone-mining)
  2873. )
  2874.  
  2875. (defrule
  2876.  
  2877. (building-type-count mining-camp > 1)
  2878. (can-research ri-stone-shaft-mining)
  2879. =>
  2880. (research ri-stone-shaft-mining)
  2881. )
  2882.  
  2883. ;mill items
  2884. (defrule
  2885.  
  2886. (can-research ri-horse-collar)
  2887. =>
  2888. (research ri-horse-collar)
  2889. )
  2890.  
  2891. (defrule
  2892.  
  2893. (can-research ri-heavy-plow)
  2894. =>
  2895. (research ri-heavy-plow)
  2896. )
  2897.  
  2898. (defrule
  2899.  
  2900. (can-research ri-crop-rotation)
  2901. =>
  2902. (research ri-crop-rotation)
  2903. )
  2904.  
  2905. ;saw mill
  2906. (defrule
  2907.  
  2908. (can-research ri-double-bit-axe)
  2909. =>
  2910. (research ri-double-bit-axe)
  2911. )
  2912.  
  2913. (defrule
  2914.  
  2915. (can-research ri-bow-saw)
  2916. =>
  2917. (research ri-bow-saw)
  2918. )
  2919.  
  2920. (defrule
  2921.  
  2922. (can-research ri-two-man-saw)
  2923. =>
  2924. (research ri-two-man-saw)
  2925. )
  2926.  
  2927. ;university stuff
  2928. (defrule
  2929.  
  2930. (can-research ri-masonry)
  2931. =>
  2932. (research ri-masonry)
  2933. )
  2934.  
  2935. (defrule
  2936.  
  2937. (can-research ri-architecture)
  2938. =>
  2939. (research ri-architecture)
  2940. )
  2941.  
  2942. (defrule
  2943. (can-research ri-stonecutting)
  2944. =>
  2945. (research ri-stonecutting)
  2946. )
  2947.  
  2948. ;market & town center
  2949. (defrule
  2950.  
  2951. (can-research ri-guilds)
  2952. =>
  2953. (research ri-guilds)
  2954. )
  2955.  
  2956. (defrule
  2957.  
  2958. (current-age == dark-age)
  2959. (can-research ri-loom)
  2960. =>
  2961. (research ri-loom)
  2962. )
  2963.  
  2964. (defrule
  2965.  
  2966. (can-research ri-hand-cart)
  2967. =>
  2968. (research ri-hand-cart)
  2969. )
  2970.  
  2971. (defrule
  2972.  
  2973. (can-research ri-wheel-barrow)
  2974. =>
  2975. (research ri-wheel-barrow)
  2976. )
  2977.  
  2978. (defrule
  2979.  
  2980. (or
  2981. (players-stance any-computer ally)
  2982. (players-stance any-human ally)
  2983. )
  2984. (can-research ri-coinage)
  2985. =>
  2986. (research ri-coinage)
  2987. )
  2988.  
  2989. (defrule
  2990.  
  2991. (or
  2992. (players-stance any-computer ally)
  2993. (players-stance any-human ally)
  2994. )
  2995. (can-research ri-banking)
  2996. =>
  2997. (research ri-banking)
  2998. )
  2999.  
  3000. ; ////////////////////MONK/////////////////
  3001. (defrule
  3002.  
  3003. (or
  3004. (players-unit-type-count any-enemy monk > 1)
  3005. (unit-type-count war-elephant-line > 2)
  3006. )
  3007. (can-research ri-faith)
  3008. =>
  3009. (research ri-faith)
  3010. )
  3011.  
  3012. (defrule
  3013.  
  3014. (players-unit-type-count any-enemy monk > 2)
  3015. (can-research ri-atonement)
  3016. =>
  3017. (research ri-atonement)
  3018. )
  3019.  
  3020. (defrule
  3021.  
  3022. (unit-type-count monk > 2)
  3023. (can-research ri-block-printing)
  3024. =>
  3025. (research ri-block-printing)
  3026. )
  3027.  
  3028. (defrule
  3029.  
  3030. (unit-type-count monk > 2)
  3031. (can-research ri-illumination)
  3032. =>
  3033. (research ri-illumination)
  3034. )
  3035.  
  3036. (defrule
  3037.  
  3038. (unit-type-count monk > 2)
  3039. (can-research ri-fervor)
  3040. =>
  3041. (research ri-fervor)
  3042. )
  3043.  
  3044. (defrule
  3045.  
  3046. (unit-type-count monk > 2)
  3047. (can-research ri-redemption)
  3048. =>
  3049. (research ri-redemption)
  3050. )
  3051.  
  3052. (defrule
  3053.  
  3054. (unit-type-count monk > 2)
  3055. (can-research ri-sanctity)
  3056. =>
  3057. (research ri-sanctity)
  3058. )
  3059.  
  3060. ;TOWERS
  3061.  
  3062. (defrule
  3063.  
  3064. (building-type-count watch-tower > 1)
  3065. (can-research ri-guard-tower)
  3066. =>
  3067. (research ri-guard-tower)
  3068. )
  3069.  
  3070. (defrule
  3071.  
  3072. (building-type-count guard-tower > 1)
  3073. (can-research ri-keep)
  3074. =>
  3075. (research ri-keep)
  3076. )
  3077.  
  3078. (defrule
  3079.  
  3080. (building-type-count university > 0)
  3081. (building-type-count watch-tower-line > 3)
  3082. (research-available ri-bombard-tower)
  3083. =>
  3084. (research ri-bombard-tower)
  3085. )
  3086.  
  3087. (defrule
  3088.  
  3089. (building-type-count watch-tower-line > 3)
  3090. (can-research ri-heated-shot)
  3091. =>
  3092. (research ri-heated-shot)
  3093. )
  3094.  
  3095. (defrule
  3096. (or
  3097. (building-type-count castle > 0)
  3098. (building-type-count watch-tower-line > 2)
  3099. )
  3100. (can-research ri-murder-holes)
  3101. =>
  3102. (research ri-murder-holes)
  3103. )
  3104.  
  3105. (defrule
  3106.  
  3107. (or
  3108. (building-type-count castle > 0)
  3109. (building-type-count watch-tower-line > 2)
  3110. )
  3111. (can-research ri-fortified-wall)
  3112. =>
  3113. (research ri-fortified-wall)
  3114. )
  3115. ; ================ IMPERIAL RESEARCH
  3116. (defrule
  3117. (goal 16 0)
  3118. (can-research-with-escrow my-unique-unit-upgrade)
  3119. =>
  3120. (release-escrow wood)
  3121. (release-escrow food)
  3122. (release-escrow gold)
  3123. (release-escrow stone)
  3124. (research my-unique-unit-upgrade)
  3125. )
  3126.  
  3127. (defrule
  3128. (goal 16 0)
  3129. (unit-type-count militiaman > 4)
  3130. (can-research-with-escrow ri-man-at-arms)
  3131. =>
  3132. (release-escrow wood)
  3133. (release-escrow food)
  3134. (release-escrow gold)
  3135. (release-escrow stone)
  3136. (research ri-man-at-arms)
  3137. )
  3138.  
  3139. (defrule
  3140. (goal 16 0)
  3141. (unit-type-count man-at-arms > 6)
  3142. (can-research-with-escrow ri-long-swordsman)
  3143. =>
  3144. (release-escrow wood)
  3145. (release-escrow food)
  3146. (release-escrow gold)
  3147. (release-escrow stone)
  3148. (research ri-long-swordsman)
  3149. )
  3150.  
  3151. (defrule
  3152. (goal 16 0)
  3153. (unit-type-count long-swordsman > 6)
  3154. (can-research-with-escrow ri-two-handed-swordsman)
  3155. =>
  3156. (release-escrow wood)
  3157. (release-escrow food)
  3158. (release-escrow gold)
  3159. (release-escrow stone)
  3160. (research ri-two-handed-swordsman)
  3161. )
  3162.  
  3163. (defrule
  3164. (goal 16 0)
  3165. (unit-type-count two-handed-swordsman > 6)
  3166. (can-research-with-escrow ri-champion)
  3167. =>
  3168. (release-escrow wood)
  3169. (release-escrow food)
  3170. (release-escrow gold)
  3171. (release-escrow stone)
  3172. (research ri-champion)
  3173. )
  3174.  
  3175. (defrule
  3176. (goal 16 0)
  3177. (unit-type-count-total spearman > 2)
  3178. (can-research-with-escrow ri-pikeman)
  3179. =>
  3180. (release-escrow wood)
  3181. (release-escrow food)
  3182. (release-escrow gold)
  3183. (release-escrow stone)
  3184. (research ri-pikeman)
  3185. )
  3186.  
  3187. (defrule
  3188. (goal 16 0)
  3189. (unit-type-count-total scout-cavalry > 2)
  3190. (can-research-with-escrow ri-light-cavalry)
  3191. =>
  3192. (release-escrow wood)
  3193. (release-escrow food)
  3194. (release-escrow gold)
  3195. (release-escrow stone)
  3196. (research ri-light-cavalry)
  3197. )
  3198.  
  3199. (defrule
  3200. (goal 16 0)
  3201. (unit-type-count-total camel > 2)
  3202. (can-research-with-escrow ri-heavy-camel)
  3203. =>
  3204. (release-escrow wood)
  3205. (release-escrow food)
  3206. (release-escrow gold)
  3207. (release-escrow stone)
  3208. (research ri-heavy-camel)
  3209. )
  3210.  
  3211. (defrule
  3212. (goal 16 0)
  3213. (unit-type-count-total knight > 2)
  3214. (can-research-with-escrow ri-cavalier)
  3215. =>
  3216. (release-escrow wood)
  3217. (release-escrow food)
  3218. (release-escrow gold)
  3219. (release-escrow stone)
  3220. (research ri-cavalier)
  3221. )
  3222.  
  3223. (defrule
  3224. (goal 16 0)
  3225. (unit-type-count-total cavalier > 2)
  3226. (can-research-with-escrow ri-paladin)
  3227. =>
  3228. (release-escrow wood)
  3229. (release-escrow food)
  3230. (release-escrow gold)
  3231. (release-escrow stone)
  3232. (research ri-paladin)
  3233. )
  3234.  
  3235. (defrule
  3236. (goal 16 0)
  3237. (unit-type-count archer > 6)
  3238. (can-research-with-escrow ri-crossbow)
  3239. =>
  3240. (release-escrow wood)
  3241. (release-escrow food)
  3242. (release-escrow gold)
  3243. (release-escrow stone)
  3244. (research ri-crossbow)
  3245. )
  3246.  
  3247. (defrule
  3248. (goal 16 0)
  3249. (unit-type-count crossbowman > 6)
  3250. (can-research-with-escrow ri-arbalest)
  3251. =>
  3252. (release-escrow wood)
  3253. (release-escrow food)
  3254. (release-escrow gold)
  3255. (release-escrow stone)
  3256. (research ri-arbalest)
  3257. )
  3258.  
  3259. (defrule
  3260. (goal 16 0)
  3261. (unit-type-count cavalry-archer > 6)
  3262. (can-research-with-escrow ri-heavy-cavalry-archer)
  3263. =>
  3264. (release-escrow wood)
  3265. (release-escrow food)
  3266. (release-escrow gold)
  3267. (release-escrow stone)
  3268. (research ri-heavy-cavalry-archer)
  3269. )
  3270.  
  3271. (defrule
  3272. (unit-type-count-total skirmisher > 2)
  3273. (can-research-with-escrow ri-elite-skirmisher)
  3274. =>
  3275. (release-escrow wood)
  3276. (release-escrow food)
  3277. (release-escrow gold)
  3278. (release-escrow stone)
  3279. (research ri-elite-skirmisher)
  3280. )
  3281.  
  3282. (defrule
  3283. (goal 16 0)
  3284. (unit-type-count scorpion > 4)
  3285. (can-research-with-escrow ri-heavy-scorpion)
  3286. =>
  3287. (release-escrow wood)
  3288. (release-escrow food)
  3289. (release-escrow gold)
  3290. (release-escrow stone)
  3291. (research ri-heavy-scorpion)
  3292. )
  3293.  
  3294. (defrule
  3295. (goal 16 0)
  3296. (unit-type-count battering-ram > 2)
  3297. (can-research-with-escrow ri-capped-ram)
  3298. =>
  3299. (release-escrow wood)
  3300. (release-escrow food)
  3301. (release-escrow gold)
  3302. (release-escrow stone)
  3303. (research ri-capped-ram)
  3304. )
  3305.  
  3306. (defrule
  3307. (goal 16 0)
  3308. (unit-type-count capped-ram > 2)
  3309. (can-research-with-escrow ri-siege-ram)
  3310. =>
  3311. (release-escrow wood)
  3312. (release-escrow food)
  3313. (release-escrow gold)
  3314. (release-escrow stone)
  3315. (research ri-siege-ram)
  3316. )
  3317.  
  3318. (defrule
  3319. (goal 16 0)
  3320. (unit-type-count mangonel > 3)
  3321. (can-research-with-escrow ri-onager)
  3322. =>
  3323. (release-escrow wood)
  3324. (release-escrow food)
  3325. (release-escrow gold)
  3326. (release-escrow stone)
  3327. (research ri-onager)
  3328. )
  3329.  
  3330. (defrule
  3331. (goal 16 0)
  3332. (unit-type-count onager > 3)
  3333. (can-research-with-escrow ri-siege-onager)
  3334. =>
  3335. (release-escrow wood)
  3336. (release-escrow food)
  3337. (release-escrow gold)
  3338. (release-escrow stone)
  3339. (research ri-siege-onager)
  3340. )
  3341.  
  3342. ;DOCK UNITS
  3343. (defrule
  3344. (goal 16 0)
  3345. (unit-type-count galley > 2)
  3346. (can-research-with-escrow ri-war-galley)
  3347. =>
  3348. (release-escrow wood)
  3349. (release-escrow food)
  3350. (release-escrow gold)
  3351. (release-escrow stone)
  3352. (research ri-war-galley)
  3353. )
  3354.  
  3355. (defrule
  3356. (goal 16 0)
  3357. (unit-type-count war-galley > 2)
  3358. (can-research-with-escrow ri-galleon)
  3359. =>
  3360. (release-escrow wood)
  3361. (release-escrow food)
  3362. (release-escrow gold)
  3363. (release-escrow stone)
  3364. (research ri-galleon)
  3365. )
  3366.  
  3367. (defrule
  3368. (goal 16 0)
  3369. (or
  3370. (unit-type-count galleon > 2)
  3371. (unit-type-count war-galley > 2)
  3372. )
  3373. (can-research-with-escrow ri-cannon-galleon)
  3374. =>
  3375. (release-escrow wood)
  3376. (release-escrow food)
  3377. (release-escrow gold)
  3378. (release-escrow stone)
  3379. (research ri-cannon-galleon)
  3380. )
  3381.  
  3382. (defrule
  3383. (goal 16 0)
  3384. (unit-type-count-total fire-ship > 1)
  3385. (can-research-with-escrow ri-fast-fire-ship)
  3386. =>
  3387. (release-escrow wood)
  3388. (release-escrow food)
  3389. (release-escrow gold)
  3390. (release-escrow stone)
  3391. (research ri-fast-fire-ship)
  3392. )
  3393.  
  3394. (defrule
  3395. (goal 16 0)
  3396. (unit-type-count demolition-ship > 2)
  3397. (can-research-with-escrow ri-heavy-demolition-ship)
  3398. =>
  3399. (release-escrow wood)
  3400. (release-escrow food)
  3401. (release-escrow gold)
  3402. (release-escrow stone)
  3403. (research ri-heavy-demolition-ship)
  3404. )
  3405.  
  3406. ; ////////////////////////WEAPONS//////////////////
  3407.  
  3408. (defrule
  3409. (goal 16 0)
  3410. (can-research-with-escrow ri-forging)
  3411. =>
  3412. (release-escrow wood)
  3413. (release-escrow food)
  3414. (release-escrow gold)
  3415. (release-escrow stone)
  3416. (research ri-forging)
  3417. )
  3418.  
  3419. (defrule
  3420. (goal 16 0)
  3421. (can-research-with-escrow ri-iron-casting)
  3422. =>
  3423. (release-escrow wood)
  3424. (release-escrow food)
  3425. (release-escrow gold)
  3426. (release-escrow stone)
  3427. (research ri-iron-casting)
  3428. )
  3429.  
  3430. (defrule
  3431. (goal 16 0)
  3432. (can-research-with-escrow ri-blast-furnace)
  3433. =>
  3434. (release-escrow wood)
  3435. (release-escrow food)
  3436. (release-escrow gold)
  3437. (release-escrow stone)
  3438. (research ri-blast-furnace)
  3439. )
  3440.  
  3441. ;ARCHER UPGRADES -- cost food/gold
  3442. (defrule
  3443. (goal 16 0)
  3444. (can-research-with-escrow ri-fletching)
  3445. =>
  3446. (release-escrow wood)
  3447. (release-escrow food)
  3448. (release-escrow gold)
  3449. (release-escrow stone)
  3450. (research ri-fletching)
  3451. )
  3452.  
  3453. (defrule
  3454. (goal 16 0)
  3455. (can-research-with-escrow ri-bodkin-arrow)
  3456. =>
  3457. (release-escrow wood)
  3458. (release-escrow food)
  3459. (release-escrow gold)
  3460. (release-escrow stone)
  3461. (research ri-bodkin-arrow)
  3462. )
  3463.  
  3464. (defrule
  3465. (goal 16 0)
  3466. (can-research-with-escrow ri-bracer)
  3467. =>
  3468. (release-escrow wood)
  3469. (release-escrow food)
  3470. (release-escrow gold)
  3471. (release-escrow stone)
  3472. (research ri-bracer)
  3473. )
  3474.  
  3475. (defrule
  3476. (goal 16 0)
  3477. (or
  3478. (unit-type-count-total archer-line > 3)
  3479. (or
  3480. (unit-type-count-total skirmisher-line > 3)
  3481. (unit-type-count-total cavalry-archer-line > 3)
  3482. )
  3483. )
  3484. (can-research-with-escrow ri-padded-archer-armor)
  3485. =>
  3486. (release-escrow wood)
  3487. (release-escrow food)
  3488. (release-escrow gold)
  3489. (release-escrow stone)
  3490. (research ri-padded-archer-armor)
  3491. )
  3492.  
  3493. (defrule
  3494. (goal 16 0)
  3495. (or
  3496. (unit-type-count-total archer-line > 3)
  3497. (or
  3498. (unit-type-count-total skirmisher-line > 3)
  3499. (unit-type-count-total cavalry-archer-line > 3)
  3500. )
  3501. )
  3502. (can-research-with-escrow ri-leather-archer-armor)
  3503. =>
  3504. (release-escrow wood)
  3505. (release-escrow food)
  3506. (release-escrow gold)
  3507. (release-escrow stone)
  3508. (research ri-leather-archer-armor)
  3509. )
  3510.  
  3511. (defrule
  3512. (goal 16 0)
  3513. (or
  3514. (unit-type-count-total archer-line > 3)
  3515. (or
  3516. (unit-type-count-total skirmisher-line > 3)
  3517. (unit-type-count-total cavalry-archer-line > 3)
  3518. )
  3519. )
  3520. (can-research-with-escrow ri-ring-archer-armor)
  3521. =>
  3522. (release-escrow wood)
  3523. (release-escrow food)
  3524. (release-escrow gold)
  3525. (release-escrow stone)
  3526. (research ri-ring-archer-armor)
  3527. )
  3528.  
  3529. (defrule
  3530. (goal 16 0)
  3531. (or
  3532. (unit-type-count-total militiaman-line > 3)
  3533. (unit-type-count-total spearman-line > 3)
  3534. )
  3535. (can-research-with-escrow ri-scale-mail)
  3536. =>
  3537. (release-escrow wood)
  3538. (release-escrow food)
  3539. (release-escrow gold)
  3540. (release-escrow stone)
  3541. (research ri-scale-mail)
  3542. )
  3543.  
  3544. (defrule
  3545. (goal 16 0)
  3546. (or
  3547. (unit-type-count-total militiaman-line > 3)
  3548. (unit-type-count-total spearman-line > 3)
  3549. )
  3550. (can-research-with-escrow ri-chain-mail)
  3551. =>
  3552. (release-escrow wood)
  3553. (release-escrow food)
  3554. (release-escrow gold)
  3555. (release-escrow stone)
  3556. (research ri-chain-mail)
  3557. )
  3558.  
  3559. (defrule
  3560. (goal 16 0)
  3561. (or
  3562. (unit-type-count-total militiaman-line > 3)
  3563. (unit-type-count-total spearman-line > 3)
  3564. )
  3565. (can-research-with-escrow ri-plate-mail)
  3566. =>
  3567. (release-escrow wood)
  3568. (release-escrow food)
  3569. (release-escrow gold)
  3570. (release-escrow stone)
  3571. (research ri-plate-mail)
  3572. )
  3573.  
  3574.  
  3575. (defrule
  3576. (goal 16 0)
  3577. (or
  3578. (unit-type-count-total militiaman-line > 3)
  3579. (unit-type-count-total spearman-line > 3)
  3580. )
  3581. (can-research-with-escrow ri-tracking)
  3582. =>
  3583. (release-escrow wood)
  3584. (release-escrow food)
  3585. (release-escrow gold)
  3586. (release-escrow stone)
  3587. (research ri-tracking)
  3588. )
  3589.  
  3590. (defrule
  3591. (goal 16 0)
  3592. (or
  3593. (unit-type-count-total militiaman-line > 3)
  3594. (unit-type-count-total spearman-line > 3)
  3595. )
  3596. (can-research-with-escrow ri-squires)
  3597. =>
  3598. (release-escrow wood)
  3599. (release-escrow food)
  3600. (release-escrow gold)
  3601. (release-escrow stone)
  3602. (research ri-squires)
  3603. )
  3604.  
  3605. (defrule
  3606. (goal 16 0)
  3607. (or
  3608. (unit-type-count-total knight-line > 3)
  3609. (unit-type-count-total scout-cavalry-line > 3)
  3610. )
  3611. (can-research-with-escrow ri-scale-barding)
  3612. =>
  3613. (release-escrow wood)
  3614. (release-escrow food)
  3615. (release-escrow gold)
  3616. (release-escrow stone)
  3617. (research ri-scale-barding)
  3618. )
  3619.  
  3620. (defrule
  3621. (goal 16 0)
  3622. (or
  3623. (unit-type-count-total knight-line > 3)
  3624. (unit-type-count-total scout-cavalry-line > 3)
  3625. )
  3626. (can-research-with-escrow ri-chain-barding)
  3627. =>
  3628. (release-escrow wood)
  3629. (release-escrow food)
  3630. (release-escrow gold)
  3631. (release-escrow stone)
  3632. (research ri-chain-barding)
  3633. )
  3634.  
  3635. (defrule
  3636. (goal 16 0)
  3637. (or
  3638. (unit-type-count-total knight-line > 3)
  3639. (unit-type-count-total scout-cavalry-line > 3)
  3640. )
  3641. (can-research-with-escrow ri-plate-barding)
  3642. =>
  3643. (release-escrow wood)
  3644. (release-escrow food)
  3645. (release-escrow gold)
  3646. (release-escrow stone)
  3647. (research ri-plate-barding)
  3648. )
  3649.  
  3650. (defrule
  3651. (goal 16 0)
  3652. (or
  3653. (unit-type-count-total cavalry-archer-line > 3)
  3654. (or
  3655. (unit-type-count-total knight-line > 3)
  3656. (unit-type-count-total scout-cavalry-line > 3)
  3657. )
  3658. )
  3659. (can-research-with-escrow ri-husbandry)
  3660. =>
  3661. (release-escrow wood)
  3662. (release-escrow food)
  3663. (release-escrow gold)
  3664. (release-escrow stone)
  3665. (research ri-husbandry)
  3666. )
  3667.  
  3668. ; /////////////////////SIEGE RESEARCH ITEMS///////////////////////////
  3669.  
  3670. (defrule
  3671. (goal 16 0)
  3672. (can-research-with-escrow ri-siege-engineers)
  3673. =>
  3674. (release-escrow wood)
  3675. (release-escrow food)
  3676. (release-escrow gold)
  3677. (release-escrow stone)
  3678. (research ri-siege-engineers)
  3679. )
  3680.  
  3681. ;FORTRESS UPGRADES
  3682. (defrule
  3683. (goal 16 0)
  3684. (can-research-with-escrow ri-hoardings)
  3685. =>
  3686. (release-escrow wood)
  3687. (release-escrow food)
  3688. (release-escrow gold)
  3689. (release-escrow stone)
  3690. (research ri-hoardings)
  3691. )
  3692.  
  3693. ;SHIPS
  3694. (defrule
  3695. (goal 16 0)
  3696. (unit-type-count cannon-galleon > 2)
  3697. (can-research-with-escrow ri-deck-guns)
  3698. =>
  3699. (release-escrow wood)
  3700. (release-escrow food)
  3701. (release-escrow gold)
  3702. (release-escrow stone)
  3703. (research ri-deck-guns)
  3704. )
  3705.  
  3706. (defrule
  3707. (goal 16 0)
  3708. (or
  3709. (unit-type-count transport-ship > 0)
  3710. (unit-type-count galley-line > 2)
  3711. )
  3712. (can-research-with-escrow ri-careening)
  3713. =>
  3714. (release-escrow wood)
  3715. (release-escrow food)
  3716. (release-escrow gold)
  3717. (release-escrow stone)
  3718. (research ri-careening)
  3719. )
  3720.  
  3721. (defrule
  3722. (goal 16 0)
  3723. (or
  3724. (unit-type-count transport-ship > 0)
  3725. (unit-type-count galley-line > 2)
  3726. )
  3727. (can-research-with-escrow ri-dry-dock)
  3728. =>
  3729. (release-escrow wood)
  3730. (release-escrow food)
  3731. (release-escrow gold)
  3732. (release-escrow stone)
  3733. (research ri-dry-dock)
  3734. )
  3735.  
  3736. (defrule
  3737. (goal 16 0)
  3738. (or
  3739. (unit-type-count galley-line > 2)
  3740. (or
  3741. (unit-type-count-total cannon-galleon-line > 1)
  3742. (unit-type-count-total fire-ship-line > 1)
  3743. )
  3744. )
  3745. (can-research-with-escrow ri-shipwright)
  3746. =>
  3747. (release-escrow wood)
  3748. (release-escrow food)
  3749. (release-escrow gold)
  3750. (release-escrow stone)
  3751. (research ri-shipwright)
  3752. )
  3753.  
  3754. ;OTHER RESEARCH ITEMS
  3755. (defrule
  3756. (goal 16 0)
  3757. (can-research-with-escrow ri-ballistics)
  3758. =>
  3759. (release-escrow wood)
  3760. (release-escrow food)
  3761. (release-escrow gold)
  3762. (release-escrow stone)
  3763. (research ri-ballistics)
  3764. )
  3765.  
  3766. (defrule
  3767. (goal 16 0)
  3768. (can-research-with-escrow ri-chemistry)
  3769. =>
  3770. (release-escrow wood)
  3771. (release-escrow food)
  3772. (release-escrow gold)
  3773. (release-escrow stone)
  3774. (research ri-chemistry)
  3775. )
  3776.  
  3777. (defrule
  3778. (goal 16 0)
  3779. (can-research-with-escrow ri-conscription)
  3780. =>
  3781. (release-escrow wood)
  3782. (release-escrow food)
  3783. (release-escrow gold)
  3784. (release-escrow stone)
  3785. (research ri-conscription)
  3786. )
  3787.  
  3788. (defrule
  3789. (goal 16 0)
  3790. (can-research-with-escrow my-unique-research)
  3791. =>
  3792. (release-escrow wood)
  3793. (release-escrow food)
  3794. (release-escrow gold)
  3795. (release-escrow stone)
  3796. (research my-unique-research)
  3797. )
  3798.  
  3799.  
  3800. ; //////////////////////ECONOMIC////////////////////////
  3801.  
  3802. ;mining-camp items
  3803. (defrule
  3804. (goal 16 0)
  3805. (can-research-with-escrow ri-gold-mining)
  3806. =>
  3807. (release-escrow wood)
  3808. (release-escrow food)
  3809. (release-escrow gold)
  3810. (release-escrow stone)
  3811. (research ri-gold-mining)
  3812. )
  3813.  
  3814. (defrule
  3815. (goal 16 0)
  3816. (can-research-with-escrow ri-gold-shaft-mining)
  3817. =>
  3818. (release-escrow wood)
  3819. (release-escrow food)
  3820. (release-escrow gold)
  3821. (release-escrow stone)
  3822. (research ri-gold-shaft-mining)
  3823. )
  3824.  
  3825. (defrule
  3826. (goal 16 0)
  3827. (building-type-count mining-camp > 1)
  3828. (can-research-with-escrow ri-stone-mining)
  3829. =>
  3830. (release-escrow wood)
  3831. (release-escrow food)
  3832. (release-escrow gold)
  3833. (release-escrow stone)
  3834. (research ri-stone-mining)
  3835. )
  3836.  
  3837. (defrule
  3838. (goal 16 0)
  3839. (building-type-count mining-camp > 1)
  3840. (can-research-with-escrow ri-stone-shaft-mining)
  3841. =>
  3842. (release-escrow wood)
  3843. (release-escrow food)
  3844. (release-escrow gold)
  3845. (release-escrow stone)
  3846. (research ri-stone-shaft-mining)
  3847. )
  3848.  
  3849. ;mill items
  3850. (defrule
  3851. (goal 16 0)
  3852. (can-research-with-escrow ri-horse-collar)
  3853. =>
  3854. (release-escrow wood)
  3855. (release-escrow food)
  3856. (release-escrow gold)
  3857. (release-escrow stone)
  3858. (research ri-horse-collar)
  3859. )
  3860.  
  3861. (defrule
  3862. (goal 16 0)
  3863. (can-research-with-escrow ri-heavy-plow)
  3864. =>
  3865. (release-escrow wood)
  3866. (release-escrow food)
  3867. (release-escrow gold)
  3868. (release-escrow stone)
  3869. (research ri-heavy-plow)
  3870. )
  3871.  
  3872. (defrule
  3873. (goal 16 0)
  3874. (can-research-with-escrow ri-crop-rotation)
  3875. =>
  3876. (release-escrow wood)
  3877. (release-escrow food)
  3878. (release-escrow gold)
  3879. (release-escrow stone)
  3880. (research ri-crop-rotation)
  3881. )
  3882.  
  3883. ;saw mill
  3884. (defrule
  3885. (goal 16 0)
  3886. (can-research-with-escrow ri-double-bit-axe)
  3887. =>
  3888. (release-escrow wood)
  3889. (release-escrow food)
  3890. (release-escrow gold)
  3891. (release-escrow stone)
  3892. (research ri-double-bit-axe)
  3893. )
  3894.  
  3895. (defrule
  3896. (goal 16 0)
  3897. (can-research-with-escrow ri-bow-saw)
  3898. =>
  3899. (release-escrow wood)
  3900. (release-escrow food)
  3901. (release-escrow gold)
  3902. (release-escrow stone)
  3903. (research ri-bow-saw)
  3904. )
  3905.  
  3906. (defrule
  3907. (goal 16 0)
  3908. (can-research-with-escrow ri-two-man-saw)
  3909. =>
  3910. (release-escrow wood)
  3911. (release-escrow food)
  3912. (release-escrow gold)
  3913. (release-escrow stone)
  3914. (research ri-two-man-saw)
  3915. )
  3916.  
  3917. ;university stuff
  3918. (defrule
  3919. (goal 16 0)
  3920. (can-research-with-escrow ri-masonry)
  3921. =>
  3922. (release-escrow wood)
  3923. (release-escrow food)
  3924. (release-escrow gold)
  3925. (release-escrow stone)
  3926. (research ri-masonry)
  3927. )
  3928.  
  3929. (defrule
  3930. (goal 16 0)
  3931. (can-research-with-escrow ri-architecture)
  3932. =>
  3933. (release-escrow wood)
  3934. (release-escrow food)
  3935. (release-escrow gold)
  3936. (release-escrow stone)
  3937. (research ri-architecture)
  3938. )
  3939.  
  3940. (defrule
  3941. (goal 16 0)
  3942. (can-research-with-escrow ri-stonecutting)
  3943. =>
  3944. (release-escrow wood)
  3945. (release-escrow food)
  3946. (release-escrow gold)
  3947. (release-escrow stone)
  3948. (research ri-stonecutting)
  3949. )
  3950.  
  3951. ;market & town center
  3952. (defrule
  3953. (goal 16 0)
  3954. (can-research-with-escrow ri-guilds)
  3955. =>
  3956. (release-escrow wood)
  3957. (release-escrow food)
  3958. (release-escrow gold)
  3959. (release-escrow stone)
  3960. (research ri-guilds)
  3961. )
  3962.  
  3963. (defrule
  3964. (goal 16 0)
  3965. (current-age == dark-age)
  3966. (can-research-with-escrow ri-loom)
  3967. =>
  3968. (release-escrow wood)
  3969. (release-escrow food)
  3970. (release-escrow gold)
  3971. (release-escrow stone)
  3972. (research ri-loom)
  3973. )
  3974.  
  3975. (defrule
  3976. (goal 16 0)
  3977. (can-research-with-escrow ri-hand-cart)
  3978. =>
  3979. (release-escrow wood)
  3980. (release-escrow food)
  3981. (release-escrow gold)
  3982. (release-escrow stone)
  3983. (research ri-hand-cart)
  3984. )
  3985.  
  3986. (defrule
  3987. (goal 16 0)
  3988. (can-research-with-escrow ri-wheel-barrow)
  3989. =>
  3990. (release-escrow wood)
  3991. (release-escrow food)
  3992. (release-escrow gold)
  3993. (release-escrow stone)
  3994. (research ri-wheel-barrow)
  3995. )
  3996.  
  3997. (defrule
  3998. (goal 16 0)
  3999. (or
  4000. (players-stance any-computer ally)
  4001. (players-stance any-human ally)
  4002. )
  4003. (can-research-with-escrow ri-coinage)
  4004. =>
  4005. (release-escrow wood)
  4006. (release-escrow food)
  4007. (release-escrow gold)
  4008. (release-escrow stone)
  4009. (research ri-coinage)
  4010. )
  4011.  
  4012. (defrule
  4013. (goal 16 0)
  4014. (or
  4015. (players-stance any-computer ally)
  4016. (players-stance any-human ally)
  4017. )
  4018. (can-research-with-escrow ri-banking)
  4019. =>
  4020. (release-escrow wood)
  4021. (release-escrow food)
  4022. (release-escrow gold)
  4023. (release-escrow stone)
  4024. (research ri-banking)
  4025. )
  4026.  
  4027. ; ////////////////////MONK/////////////////
  4028. (defrule
  4029. (goal 16 0)
  4030. (or
  4031. (players-unit-type-count any-enemy monk > 1)
  4032. (unit-type-count-total war-elephant-line > 2)
  4033. )
  4034. (can-research-with-escrow ri-faith)
  4035. =>
  4036. (release-escrow wood)
  4037. (release-escrow food)
  4038. (release-escrow gold)
  4039. (release-escrow stone)
  4040. (research ri-faith)
  4041. )
  4042.  
  4043. (defrule
  4044. (goal 16 0)
  4045. (players-unit-type-count any-enemy monk > 2)
  4046. (can-research-with-escrow ri-atonement)
  4047. =>
  4048. (release-escrow wood)
  4049. (release-escrow food)
  4050. (release-escrow gold)
  4051. (release-escrow stone)
  4052. (research ri-atonement)
  4053. )
  4054.  
  4055. (defrule
  4056. (goal 16 0)
  4057. (unit-type-count-total monk > 2)
  4058. (can-research-with-escrow ri-block-printing)
  4059. =>
  4060. (release-escrow wood)
  4061. (release-escrow food)
  4062. (release-escrow gold)
  4063. (release-escrow stone)
  4064. (research ri-block-printing)
  4065. )
  4066.  
  4067. (defrule
  4068. (goal 16 0)
  4069. (unit-type-count-total monk > 2)
  4070. (can-research-with-escrow ri-illumination)
  4071. =>
  4072. (release-escrow wood)
  4073. (release-escrow food)
  4074. (release-escrow gold)
  4075. (release-escrow stone)
  4076. (research ri-illumination)
  4077. )
  4078.  
  4079. (defrule
  4080. (goal 16 0)
  4081. (unit-type-count-total monk > 2)
  4082. (can-research-with-escrow ri-fervor)
  4083. =>
  4084. (release-escrow wood)
  4085. (release-escrow food)
  4086. (release-escrow gold)
  4087. (release-escrow stone)
  4088. (research ri-fervor)
  4089. )
  4090.  
  4091. (defrule
  4092. (goal 16 0)
  4093. (unit-type-count-total monk > 2)
  4094. (can-research-with-escrow ri-redemption)
  4095. =>
  4096. (release-escrow wood)
  4097. (release-escrow food)
  4098. (release-escrow gold)
  4099. (release-escrow stone)
  4100. (research ri-redemption)
  4101. )
  4102.  
  4103. (defrule
  4104. (goal 16 0)
  4105. (unit-type-count-total monk > 2)
  4106. (can-research-with-escrow ri-sanctity)
  4107. =>
  4108. (release-escrow wood)
  4109. (release-escrow food)
  4110. (release-escrow gold)
  4111. (release-escrow stone)
  4112. (research ri-sanctity)
  4113. )
  4114.  
  4115. ;TOWERS
  4116.  
  4117. (defrule
  4118. (goal 16 0)
  4119. (building-type-count-total watch-tower > 1)
  4120. (can-research-with-escrow ri-guard-tower)
  4121. =>
  4122. (release-escrow wood)
  4123. (release-escrow food)
  4124. (release-escrow gold)
  4125. (release-escrow stone)
  4126. (research ri-guard-tower)
  4127. )
  4128.  
  4129. (defrule
  4130. (goal 16 0)
  4131. (building-type-count-total guard-tower > 1)
  4132. (can-research-with-escrow ri-keep)
  4133. =>
  4134. (release-escrow wood)
  4135. (release-escrow food)
  4136. (release-escrow gold)
  4137. (release-escrow stone)
  4138. (research ri-keep)
  4139. )
  4140.  
  4141. (defrule
  4142. (goal 16 0)
  4143. (building-type-count university > 0)
  4144. (building-type-count-total watch-tower-line > 3)
  4145. (research-available ri-bombard-tower)
  4146. =>
  4147. (release-escrow wood)
  4148. (release-escrow food)
  4149. (release-escrow gold)
  4150. (release-escrow stone)
  4151. (research ri-bombard-tower)
  4152. )
  4153.  
  4154. (defrule
  4155. (goal 16 0)
  4156. (building-type-count-total watch-tower-line > 3)
  4157. (can-research-with-escrow ri-heated-shot)
  4158. =>
  4159. (release-escrow wood)
  4160. (release-escrow food)
  4161. (release-escrow gold)
  4162. (release-escrow stone)
  4163. (research ri-heated-shot)
  4164. )
  4165.  
  4166. (defrule
  4167. (goal 16 0)
  4168. (or
  4169. (building-type-count-total castle > 0)
  4170. (building-type-count-total watch-tower-line > 2)
  4171. )
  4172. (can-research-with-escrow ri-murder-holes)
  4173. =>
  4174. (release-escrow wood)
  4175. (release-escrow food)
  4176. (release-escrow gold)
  4177. (release-escrow stone)
  4178. (research ri-murder-holes)
  4179. )
  4180.  
  4181. (defrule
  4182. (goal 16 0)
  4183. (or
  4184. (building-type-count-total castle > 0)
  4185. (building-type-count-total watch-tower-line > 2)
  4186. )
  4187. (can-research-with-escrow ri-fortified-wall)
  4188. =>
  4189. (release-escrow wood)
  4190. (release-escrow food)
  4191. (release-escrow gold)
  4192. (release-escrow stone)
  4193. (research ri-fortified-wall)
  4194. )
  4195. ; ================ MARKET - just buys and sells when the price is right and stockpile low
  4196.  
  4197. ; ///////////////////////// FEUDAL
  4198.  
  4199. (defrule
  4200. (current-age == feudal-age)
  4201. (gold-amount >= 500)
  4202. (wood-amount <= 100)
  4203. (commodity-buying-price wood <= 100)
  4204. (can-buy-commodity wood)
  4205. =>
  4206. (chat-local-to-self "Wood panic")
  4207. (buy-commodity wood)
  4208. )
  4209.  
  4210. (defrule
  4211. (current-age == feudal-age)
  4212. (gold-amount >= 500)
  4213. (food-amount <= 100)
  4214. (commodity-buying-price food <= 100)
  4215. (can-buy-commodity food)
  4216. =>
  4217. (chat-local-to-self "Food panic")
  4218. (buy-commodity food)
  4219. )
  4220.  
  4221. (defrule
  4222. (current-age == feudal-age)
  4223. (gold-amount >= 600)
  4224. (stone-amount <= 100)
  4225. (commodity-buying-price stone <= 200)
  4226. (can-buy-commodity stone)
  4227. =>
  4228. (chat-local-to-self "need stone")
  4229. (buy-commodity stone)
  4230. )
  4231.  
  4232. (defrule
  4233. (current-age == feudal-age)
  4234. (wood-amount >= 500)
  4235. (or
  4236. (gold-amount < 100)
  4237. (food-amount < 100)
  4238. )
  4239. (commodity-selling-price wood >= 50)
  4240. (can-sell-commodity wood)
  4241. =>
  4242. (chat-local-to-self "Gold panic; sell wood")
  4243. (sell-commodity wood)
  4244. )
  4245.  
  4246. (defrule
  4247. (current-age == feudal-age)
  4248. (food-amount >= 1000)
  4249. (or
  4250. (gold-amount < 100)
  4251. (wood-amount < 100)
  4252. )
  4253. (can-sell-commodity food)
  4254. =>
  4255. (chat-local-to-self "excess food")
  4256. (sell-commodity food)
  4257. )
  4258.  
  4259. (defrule
  4260. (current-age == feudal-age)
  4261. (stone-amount >= 1000)
  4262. (or
  4263. (gold-amount < 100)
  4264. (wood-amount < 100)
  4265. )
  4266. (can-sell-commodity stone)
  4267. =>
  4268. (chat-local-to-self "excess stone")
  4269. (sell-commodity stone)
  4270. )
  4271. ;****************************CASTLE
  4272. (defrule
  4273. (not (goal 16 99))
  4274. (current-age == castle-age)
  4275. (gold-amount >= 1000)
  4276. (wood-amount <= 200)
  4277. (commodity-buying-price wood <= 100)
  4278. (can-buy-commodity wood)
  4279. =>
  4280. (chat-local-to-self "Wood panic")
  4281. (buy-commodity wood)
  4282. )
  4283.  
  4284. (defrule
  4285. (not (goal 16 99))
  4286. (current-age == castle-age)
  4287. (gold-amount >= 500)
  4288. (wood-amount <= 100)
  4289. (can-buy-commodity wood)
  4290. =>
  4291. (chat-local-to-self "Wood panic")
  4292. (buy-commodity wood)
  4293. )
  4294.  
  4295. (defrule
  4296. (current-age == castle-age)
  4297. (gold-amount >= 1000)
  4298. (food-amount <= 200)
  4299. (commodity-buying-price food <= 100)
  4300. (can-buy-commodity food)
  4301. =>
  4302. (chat-local-to-self "Food panic")
  4303. (buy-commodity food)
  4304. )
  4305.  
  4306. (defrule
  4307. (current-age == castle-age)
  4308. (gold-amount >= 500)
  4309. (food-amount <= 100)
  4310. (can-buy-commodity food)
  4311. =>
  4312. (chat-local-to-self "Food panic")
  4313. (buy-commodity food)
  4314. )
  4315.  
  4316. (defrule
  4317. (current-age == castle-age)
  4318. (gold-amount >= 1200)
  4319. (stone-amount <= 200)
  4320. (commodity-buying-price stone <= 200)
  4321. (can-buy-commodity stone)
  4322. =>
  4323. (chat-local-to-self "need stone")
  4324. (buy-commodity stone)
  4325. )
  4326.  
  4327. (defrule
  4328. (current-age == castle-age)
  4329. (wood-amount >= 1000)
  4330. (or
  4331. (gold-amount < 200)
  4332. (food-amount < 200)
  4333. )
  4334. (commodity-selling-price wood >= 25)
  4335. (can-sell-commodity wood)
  4336. =>
  4337. (chat-local-to-self "Gold panic; sell wood")
  4338. (sell-commodity wood)
  4339. )
  4340.  
  4341. (defrule
  4342. (current-age == castle-age)
  4343. (food-amount >= 1200)
  4344. (or
  4345. (gold-amount < 200)
  4346. (wood-amount < 200)
  4347. )
  4348. (can-sell-commodity food)
  4349. =>
  4350. (chat-local-to-self "excess food")
  4351. (sell-commodity food)
  4352. )
  4353.  
  4354. (defrule
  4355. (current-age == castle-age)
  4356. (stone-amount >= 1000)
  4357. (or
  4358. (gold-amount < 200)
  4359. (wood-amount < 200)
  4360. )
  4361. (can-sell-commodity stone)
  4362. =>
  4363. (chat-local-to-self "excess stone")
  4364. (sell-commodity stone)
  4365. )
  4366.  
  4367. ;imperial age
  4368.  
  4369. (defrule
  4370. (gold-amount >= 1500)
  4371. (wood-amount <= 200)
  4372. (can-buy-commodity wood)
  4373. =>
  4374. (chat-local-to-self "Wood panic")
  4375. (buy-commodity wood)
  4376. )
  4377. (defrule
  4378. (gold-amount >= 750)
  4379. (wood-amount <= 100)
  4380. (can-buy-commodity wood)
  4381. =>
  4382. (chat-local-to-self "NO WOOD! ")
  4383. (buy-commodity wood)
  4384. )
  4385. (defrule
  4386. (gold-amount >= 1500)
  4387. (food-amount <= 200)
  4388. (can-buy-commodity food)
  4389. =>
  4390. (chat-local-to-self "Food panic")
  4391. (buy-commodity food)
  4392. )
  4393.  
  4394. (defrule
  4395. (gold-amount >= 1500)
  4396. (stone-amount <= 200)
  4397. (can-buy-commodity stone)
  4398. =>
  4399. (chat-local-to-self "need stone")
  4400. (buy-commodity stone)
  4401. )
  4402.  
  4403. (defrule
  4404. (wood-amount >= 1500)
  4405. (or
  4406. (gold-amount < 200)
  4407. (food-amount < 200)
  4408. )
  4409. (can-sell-commodity wood)
  4410. =>
  4411. (chat-local-to-self "Gold panic; sell wood")
  4412. (sell-commodity wood)
  4413. )
  4414.  
  4415. (defrule
  4416. (food-amount >= 1500)
  4417. (or
  4418. (gold-amount < 200)
  4419. (wood-amount < 200)
  4420. )
  4421. (can-sell-commodity food)
  4422. =>
  4423. (chat-local-to-self "excess food")
  4424. (sell-commodity food)
  4425. )
  4426.  
  4427. (defrule
  4428. (stone-amount >= 1500)
  4429. (or
  4430. (or
  4431. (gold-amount < 200)
  4432. (wood-amount < 200)
  4433. )
  4434. (food-amount < 200)
  4435. )
  4436. (can-sell-commodity stone)
  4437. =>
  4438. (chat-local-to-self "excess stone")
  4439. (sell-commodity stone)
  4440. )
  4441. (defrule
  4442. (stone-amount > 1000)
  4443. (gold-amount < 1000)
  4444. =>
  4445. (sell-commodity stone)
  4446. )
  4447.  
  4448. (defrule
  4449. (wood-amount > 1000)
  4450. (gold-amount < 1000)
  4451. =>
  4452. (sell-commodity wood)
  4453. )
  4454. (defrule
  4455. (food-amount > 1500)
  4456. (gold-amount < 1000)
  4457. =>
  4458. (sell-commodity food)
  4459. )
  4460. (defrule
  4461. (gold-amount > 1000)
  4462. (food-amount < 1000)
  4463. =>
  4464. (buy-commodity food)
  4465. )
  4466. (defrule
  4467. (gold-amount > 1000)
  4468. (wood-amount < 1000)
  4469. =>
  4470. (buy-commodity wood)
  4471. )
  4472. (defrule
  4473. (gold-amount > 1000)
  4474. (stone-amount < 1000)
  4475. =>
  4476. (buy-commodity stone)
  4477. )
  4478. (defrule;imperial random
  4479. (current-age == imperial-age)
  4480. (research-completed my-unique-unit-upgrade)
  4481. =>
  4482. (release-escrow wood)
  4483. (release-escrow food)
  4484. (release-escrow gold)
  4485. (release-escrow stone)
  4486. )
  4487.  
  4488. ;;;;;;;;;;;;;;;;;;;;;Town under attack
  4489.  
  4490. (defrule
  4491. (town-under-attack)
  4492. (game-time > 450)
  4493. =>
  4494. (set-strategic-number sn-task-ungrouped-soldiers 1)
  4495. (set-strategic-number sn-maximum-town-size 25)
  4496. (set-strategic-number sn-camp-max-distance 25)
  4497. (release-escrow food)
  4498. (release-escrow wood)
  4499. (release-escrow gold)
  4500. (set-goal 1 2);Normal Explorers
  4501. (set-goal 2 7);Town has been attacked
  4502. (set-goal 8 1);Enable Vengance Request
  4503. )
  4504. (defrule
  4505. (goal 8 1);Town was under attack
  4506. (not (town-under-attack))
  4507. (game-time > 1500)
  4508. =>
  4509. (set-strategic-number sn-maximum-town-size 50)
  4510. )
  4511. ;removed for test
  4512. (defrule
  4513. (goal 8 1);Town was under attack
  4514. (not (town-under-attack))
  4515. (players-military-population any-ally > 24)
  4516.  
  4517. =>
  4518. (set-goal 8 2);Disable Vengance Request
  4519. )
  4520. ;;;Scenario added
  4521. (defrule
  4522. (or
  4523. (military-population >= 24)
  4524. (game-time >= 600)
  4525. )
  4526. =>
  4527. (set-strategic-number sn-maximum-town-size 30)
  4528. (disable-self)
  4529. )
  4530. (defrule
  4531. (or
  4532. (military-population >= 48)
  4533. (game-time >= 1200)
  4534. )
  4535. =>
  4536. (set-strategic-number sn-maximum-town-size 35)
  4537. (disable-self)
  4538. )
  4539. (defrule
  4540. (or
  4541. (military-population >= 72)
  4542. (game-time >= 1800)
  4543. )
  4544. =>
  4545. (set-strategic-number sn-maximum-town-size 40)
  4546. (disable-self)
  4547. )
  4548. (defrule
  4549. (or
  4550. (military-population >= 96)
  4551. (game-time >= 2400)
  4552. )
  4553. =>
  4554. (set-strategic-number sn-maximum-town-size 45)
  4555. (disable-self)
  4556. )
  4557. (defrule
  4558. (or
  4559. (military-population >= 120)
  4560. (game-time >= 2800)
  4561. )
  4562. =>
  4563. (set-strategic-number sn-maximum-town-size 50)
  4564. (disable-self)
  4565. )
  4566. (defrule;e to n
  4567. (players-stance any-enemy neutral)
  4568. =>
  4569. (chat-to-player this-any-enemy "This will benefit both of us.")
  4570. (set-stance this-any-enemy neutral)
  4571. )
  4572. (defrule
  4573. (players-stance any-neutral ally)
  4574. =>
  4575. (chat-to-player this-any-neutral "You will not regret your decision.")
  4576. (set-stance this-any-neutral ally)
  4577. )
  4578. (defrule
  4579. (players-stance any-neutral enemy)
  4580. =>
  4581. (chat-to-player this-any-neutral "I regret that it must be this way.")
  4582. (set-stance this-any-neutral enemy)
  4583. (chat-to-allies "31")
  4584. (chat-to-allies "Time to even the odds.")
  4585. (attack-now)
  4586. )
  4587. (defrule
  4588. (players-stance any-ally enemy)
  4589. =>
  4590. (chat-to-player this-any-ally "Traitor! Prepare to regret your decision.")
  4591. (set-stance this-any-ally enemy)
  4592. (chat-to-allies "31")
  4593. (chat-to-allies "Friends! Destroy the traitors among us.")
  4594. (attack-now)
  4595. )
  4596. (defrule
  4597. (taunt-detected any-ally 31)
  4598. (goal 5 1)
  4599. =>
  4600. (set-goal 5 2)
  4601. (enable-timer 7 300)
  4602. )
  4603. (defrule
  4604. (taunt-detected any-ally 31)
  4605. (not (town-under-attack))
  4606. (military-population > 12)
  4607. =>
  4608. (acknowledge-taunt this-any-ally 31)
  4609. (attack-now)
  4610. (chat-to-player this-any-ally "Behold the power of Gandalf!")
  4611. )
  4612. (defrule
  4613. (taunt-detected any-ally 31)
  4614. (military-population < 24)
  4615. (town-under-attack)
  4616. =>
  4617. (acknowledge-taunt this-any-ally 31)
  4618. (chat-to-player this-any-ally "I've got my own problems to worry about.")
  4619. )
  4620. (defrule
  4621. (taunt-detected any-ally 31)
  4622. (town-under-attack)
  4623. (military-population > 24)
  4624. =>
  4625. (acknowledge-taunt this-any-ally 31)
  4626. (chat-to-player this-any-ally "I can't! I'm under attack!")
  4627. )
  4628. (defrule
  4629. (taunt-detected any-ally 31)
  4630. (military-population < 13)
  4631. (not (town-under-attack))
  4632. =>
  4633. (acknowledge-taunt this-any-ally 31)
  4634. (chat-to-player this-any-ally "I'll come as soon as I can.")
  4635. )
  4636. (defrule
  4637. (players-stance any-ally neutral)
  4638. =>
  4639. (chat-to-player this-any-ally "You are making a foolish decision.")
  4640. (set-stance this-any-ally enemy)
  4641. (chat-to-allies "Help! My allies are plotting against me!")
  4642. (chat-to-allies "31")
  4643. (attack-now)
  4644. )
  4645. (defrule
  4646. (game-time > 2700)
  4647. (game-time < 5400)
  4648. (not (town-under-attack))
  4649. =>
  4650. (set-strategic-number sn-camp-max-distance 50)
  4651. (set-strategic-number sn-maximum-gold-drop-distance 40)
  4652. (set-strategic-number sn-maximum-stone-drop-distance 40)
  4653. (set-strategic-number sn-maximum-food-drop-distance 40)
  4654. (disable-self)
  4655. )
  4656. (defrule
  4657. (game-time > 5400)
  4658. (game-time < 8100)
  4659. (not (town-under-attack))
  4660. =>
  4661. (set-strategic-number sn-camp-max-distance 75)
  4662. (set-strategic-number sn-maximum-gold-drop-distance 60)
  4663. (set-strategic-number sn-maximum-stone-drop-distance 60)
  4664. (set-strategic-number sn-maximum-food-drop-distance 60)
  4665. (disable-self)
  4666. )
  4667. (defrule
  4668. (game-time > 8100)
  4669. (not (town-under-attack))
  4670. =>
  4671. (set-strategic-number sn-camp-max-distance 100)
  4672. (set-strategic-number sn-maximum-gold-drop-distance 80)
  4673. (set-strategic-number sn-maximum-stone-drop-distance 80)
  4674. (set-strategic-number sn-maximum-food-drop-distance 80)
  4675. (disable-self)
  4676. )
  4677. ;===========================> Migration
  4678. (defrule
  4679. (population > 25)
  4680. (unit-type-count transport-ship > 0)
  4681. (unit-type-count fishing-ship > 0)
  4682. (building-type-count town-center < 3)
  4683. =>
  4684. (build-forward town-center)
  4685. )
  4686. (defrule
  4687. (population > 25)
  4688. (building-type-count castle < 7)
  4689. (building-type-count castle > 3)
  4690. =>
  4691. (build-forward castle)
  4692. )
  4693. ;============================> TRIBUTE
  4694. (defrule
  4695. (timer-triggered 5)
  4696. (food-amount > 1000)
  4697. (players-population any-ally > 10)
  4698. =>
  4699. (tribute-to-player every-ally food 100)
  4700. (chat-to-allies "Here is some food.")
  4701. )
  4702. (defrule
  4703. (timer-triggered 5)
  4704. (wood-amount > 1000)
  4705. (players-population any-ally > 10)
  4706. =>
  4707. (tribute-to-player every-ally wood 100)
  4708. (chat-to-allies "Here is some wood.")
  4709. )
  4710. (defrule
  4711. (timer-triggered 5)
  4712. (gold-amount > 1000)
  4713. (players-population any-ally > 10)
  4714. =>
  4715. (tribute-to-player every-ally gold 100)
  4716. (chat-to-allies "Here is some gold.")
  4717. )
  4718. (defrule
  4719. (timer-triggered 5)
  4720. (stone-amount > 1000)
  4721. (players-population any-ally > 10)
  4722. =>
  4723. (tribute-to-player every-ally stone 100)
  4724. (chat-to-allies "Here is some stone.")
  4725. )
  4726. (defrule
  4727. (timer-triggered 5)
  4728. =>
  4729. (disable-timer 5)
  4730. (enable-timer 5 300)
  4731. )
  4732. (defrule
  4733. (game-time > 7200)
  4734. (military-population > 75)
  4735. (players-population every-enemy < 25)
  4736. =>
  4737. (chat-to-enemies "You play two hours to die like this?")
  4738. (chat-to-allies "Let's finish this.")
  4739. (chat-to-allies "31")
  4740. (attack-now)
  4741. (disable-self)
  4742. )
  4743. (defrule
  4744. (game-time < 450)
  4745. (military-population > 50)
  4746. (not (town-under-attack))
  4747. =>
  4748. (chat-to-all "Raiding Party!")
  4749. (attack-now)
  4750. (disable-self)
  4751. )
  4752. (defrule
  4753. (true)
  4754. =>
  4755. (enable-wall-placement 2)
  4756. )
  4757. ;=====================> Tribute requests
  4758. (defrule
  4759. (taunt-detected any-ally 3)
  4760. (food-amount > 200)
  4761. (building-type-count market > 0)
  4762. (players-tribute my-player-number food < 2500)
  4763. =>
  4764. (acknowledge-taunt this-any-ally 3)
  4765. (tribute-to-player this-any-ally food 200)
  4766. (chat-to-player this-any-ally "Now go build an army.")
  4767. )
  4768. (defrule
  4769. (taunt-detected any-ally 3)
  4770. (food-amount > 200)
  4771. (building-type-count market > 0)
  4772. (players-tribute my-player-number food >= 2500)
  4773. (players-tribute my-player-number food < 5000)
  4774. =>
  4775. (acknowledge-taunt this-any-ally 3)
  4776. (tribute-to-player this-any-ally food 100)
  4777. (chat-to-player this-any-ally "You SHOULD have enough food already.")
  4778. )
  4779. (defrule
  4780. (taunt-detected any-ally 3)
  4781. (building-type-count market > 0)
  4782. (players-tribute my-player-number food >= 5000)
  4783. =>
  4784. (acknowledge-taunt this-any-ally 3)
  4785. (chat-to-player this-any-ally "I've given you enough food.")
  4786. )
  4787. (defrule
  4788. (taunt-detected any-ally 3)
  4789. (or
  4790. (food-amount < 200)
  4791. (building-type-count market > 0)
  4792. )
  4793. =>
  4794. (acknowledge-taunt this-any-ally 3)
  4795. (chat-to-player this-any-ally "I apologize. I am low on food.")
  4796. )
  4797.  
  4798. (defrule
  4799. (taunt-detected any-ally 4)
  4800. (wood-amount > 200)
  4801. (building-type-count market > 0)
  4802. (players-tribute my-player-number wood < 2500)
  4803. =>
  4804. (acknowledge-taunt this-any-ally 4)
  4805. (tribute-to-player this-any-ally wood 200)
  4806. (chat-to-player this-any-ally "Now go build a city.")
  4807. )
  4808. (defrule
  4809. (taunt-detected any-ally 4)
  4810. (wood-amount > 200)
  4811. (building-type-count market > 0)
  4812. (players-tribute my-player-number wood >= 2500)
  4813. (players-tribute my-player-number wood < 5000)
  4814. =>
  4815. (acknowledge-taunt this-any-ally 4)
  4816. (tribute-to-player this-any-ally wood 100)
  4817. (chat-to-player this-any-ally "You SHOULD have enough wood already.")
  4818. )
  4819. (defrule
  4820. (taunt-detected any-ally 4)
  4821. (building-type-count market > 0)
  4822. (players-tribute my-player-number wood >= 5000)
  4823. =>
  4824. (acknowledge-taunt this-any-ally 4)
  4825. (chat-to-player this-any-ally "I've given you enough wood.")
  4826. )
  4827. (defrule
  4828. (taunt-detected any-ally 4)
  4829. (or
  4830. (wood-amount < 200)
  4831. (building-type-count market > 0)
  4832. )
  4833. =>
  4834. (acknowledge-taunt this-any-ally 4)
  4835. (chat-to-player this-any-ally "I apologize. I am low on wood.")
  4836. )
  4837.  
  4838. (defrule
  4839. (taunt-detected any-ally 5)
  4840. (gold-amount > 400)
  4841. (building-type-count market > 0)
  4842. (players-tribute my-player-number gold < 2500)
  4843. =>
  4844. (acknowledge-taunt this-any-ally 5)
  4845. (tribute-to-player this-any-ally gold 200)
  4846. (chat-to-player this-any-ally "Don't spend it all in one place.")
  4847. )
  4848. (defrule
  4849. (taunt-detected any-ally 5)
  4850. (gold-amount > 400)
  4851. (building-type-count market > 0)
  4852. (players-tribute my-player-number gold >= 2500)
  4853. (players-tribute my-player-number gold < 5000)
  4854. =>
  4855. (acknowledge-taunt this-any-ally 5)
  4856. (tribute-to-player this-any-ally gold 100)
  4857. (chat-to-player this-any-ally "You SHOULD have enough gold already.")
  4858. )
  4859. (defrule
  4860. (taunt-detected any-ally 5)
  4861. (building-type-count market > 0)
  4862. (players-tribute my-player-number food >= 5000)
  4863. =>
  4864. (acknowledge-taunt this-any-ally 5)
  4865. (chat-to-player this-any-ally "I've given you enough gold.")
  4866. )
  4867. (defrule
  4868. (taunt-detected any-ally 5)
  4869. (or
  4870. (gold-amount < 400)
  4871. (building-type-count market > 0)
  4872. )
  4873. =>
  4874. (acknowledge-taunt this-any-ally 5)
  4875. (chat-to-player this-any-ally "I apologize. I am low on gold.")
  4876. )
  4877.  
  4878. (defrule
  4879. (taunt-detected any-ally 6)
  4880. (stone-amount > 800)
  4881. (building-type-count market > 0)
  4882. (players-tribute my-player-number stone < 2500)
  4883. =>
  4884. (acknowledge-taunt this-any-ally 6)
  4885. (tribute-to-player this-any-ally stone 200)
  4886. (chat-to-player this-any-ally "Now go build a castle.")
  4887. )
  4888. (defrule
  4889. (taunt-detected any-ally 6)
  4890. (stone-amount > 800)
  4891. (building-type-count market > 0)
  4892. (players-tribute my-player-number stone >= 2500)
  4893. (players-tribute my-player-number stone < 5000)
  4894. =>
  4895. (acknowledge-taunt this-any-ally 6)
  4896. (tribute-to-player this-any-ally stone 100)
  4897. (chat-to-player this-any-ally "You SHOULD have enough stone already.")
  4898. )
  4899. (defrule
  4900. (taunt-detected any-ally 6)
  4901. (players-tribute my-player-number stone >= 5000)
  4902. (building-type-count market > 0)
  4903. =>
  4904. (acknowledge-taunt this-any-ally 6)
  4905. (chat-to-player this-any-ally "I've given you enough stone.")
  4906. )
  4907. (defrule
  4908. (taunt-detected any-ally 6)
  4909. (or
  4910. (stone-amount < 800)
  4911. (building-type-count market > 0)
  4912. )
  4913. =>
  4914. (acknowledge-taunt this-any-ally 6)
  4915. (chat-to-player this-any-ally "I apologize. I am low on stone.")
  4916. )
Advertisement
Add Comment
Please, Sign In to add comment