Talvieno

Gandalf.per

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