; SAMPLE AOK AI FILE ; 3/15/01 (defrule (true) => (chat-to-all "Devine Winner v4.0") (enable-wall-placement 2) (disable-self) ) (defrule (true) => (disable-timer 2) (disable-timer 1) (disable-timer 6) (disable-timer 7) (disable-timer 3) (disable-timer 8) (disable-self) ) ; wall parameters (defconst wall-perimeter 2) (defconst ri-perfusion 457) (defconst ri-herbal-medicine 441) (defconst militia-ready 1) (defconst knights-ready 1) (defconst archers-ready 1) (defconst need-food-goal 1) (defconst need-wood-goal 2) (defconst need-gold-goal 3) (defconst need-stone-goal 4) (defconst save-food-goal 24) (defconst save-wood-goal 25) (defconst save-gold-goal 26) (defconst save-stone-goal 27) ; ============== GROUPS (defrule (true) => (set-strategic-number sn-allow-civilian-defense 0) (set-strategic-number sn-mill-max-distance 10) (set-strategic-number sn-percent-enemy-sighted-response 100) (set-strategic-number sn-enemy-sighted-response-distance 30) (set-strategic-number sn-number-attack-groups 0) (set-strategic-number sn-group-form-distance 15) (set-strategic-number sn-blot-exploration-map 1) (set-strategic-number sn-number-explore-groups 1) (set-strategic-number sn-total-number-explorers 1) (set-strategic-number sn-minimum-defend-group-size 5) (set-strategic-number sn-initial-exploration-required 0) (disable-self) ) (defrule (true) => (set-strategic-number sn-percent-civilian-explorers 0) (set-strategic-number sn-number-boat-explore-groups 1) (set-strategic-number sn-percent-civilian-gatherers 67) (set-strategic-number sn-percent-civilian-builders 33) (set-strategic-number sn-cap-civilian-gatherers 100) (set-strategic-number sn-cap-civilian-builders 20) (set-strategic-number sn-minimum-dropsite-buffer 1) (set-strategic-number sn-max-skips-per-attempt 3) (set-difficulty-parameter ability-to-dodge-missiles 100) (set-difficulty-parameter ability-to-maintain-distance 100) (set-strategic-number sn-target-evaluation-damage-capability 100) (set-strategic-number sn-target-evaluation-hitpoints 50) (disable-self) ) (defrule (true) => (set-strategic-number sn-relic-defend-priority 2) (set-strategic-number sn-stone-defend-priority 4) (set-strategic-number sn-gold-defend-priority 5) (set-strategic-number sn-town-defend-priority 1) (set-strategic-number sn-dock-defend-priority 3) (set-goal 10 0) (set-goal 11 0) (set-goal 12 0) (disable-self) ) ; ============== ATTACK GROUPS (defrule (goal 16 2) (true) => (set-strategic-number sn-percent-attack-soldiers 100) (disable-self) ) (defrule (goal 16 3) (true) => (set-strategic-number sn-percent-attack-soldiers 90) (disable-self) ) #load-if-defined BRITON-CIV (defconst militia long-swordsman) (defconst archers arbalest) (defconst skirmishers elite-skirmisher) (defconst spearmans pikeman) (defconst knights knight) (defconst unique-unit my-unique-unit-line) (defconst militia-count 10) (defconst archer-count 20) (defconst skirmisher-count 5) (defconst spearman-count 20) (defconst knight-count 10) (defconst unique-count 20) #end-if #load-if-defined BYZANTINE-CIV (defconst militia champion) (defconst archers arbalest) (defconst skirmishers elite-skirmisher) (defconst spearmans pikeman) (defconst knights paladin) (defconst unique-unit my-unique-unit-line) (defconst militia-count 20) (defconst archer-count 15) (defconst skirmisher-count 5) (defconst spearman-count 5) (defconst knight-count 20) (defconst unique-count 10) #end-if #load-if-defined CELTIC-CIV (defconst militia champion) (defconst archers crossbowman) (defconst skirmishers elite-skirmisher) (defconst spearmans pikeman) (defconst knights paladin) (defconst unique-unit elite-woad-raider) (defconst militia-count 30) (defconst archer-count 10) (defconst skirmisher-count 10) (defconst spearman-count 5) (defconst knight-count 20) (defconst unique-count 10) #end-if #load-if-defined CHINESE-CIV (defconst militia champion) (defconst archers arbalest) (defconst skirmishers elite-skirmisher) (defconst spearmans pikeman) (defconst knights cavalier) (defconst unique-unit my-unique-unit-line) (defconst militia-count 20) (defconst archer-count 20) (defconst skirmisher-count 5) (defconst spearman-count 10) (defconst knight-count 10) (defconst unique-count 20) #end-if #load-if-defined FRANKISH-CIV (defconst militia champion) (defconst archers crossbowman) (defconst skirmishers elite-skirmisher) (defconst spearmans pikeman) (defconst knights cavalier) (defconst unique-unit my-unique-unit-line) (defconst militia-count 20) (defconst archer-count 10) (defconst skirmisher-count 10) (defconst spearman-count 5) (defconst knight-count 20) (defconst unique-count 10) #end-if #load-if-defined GOTHIC-CIV (defconst militia champion) (defconst archers crossbowman) (defconst skirmishers elite-skirmisher) (defconst spearmans pikeman) (defconst knights cavalier) (defconst unique-unit elite-huskarl) (defconst militia-count 30) (defconst archer-count 10) (defconst skirmisher-count 5) (defconst spearman-count 10) (defconst knight-count 10) (defconst unique-count 10) #end-if #load-if-defined JAPANESE-CIV (defconst militia champion) (defconst archers arbalest) (defconst skirmishers elite-skirmisher) (defconst spearmans pikeman) (defconst knights cavalier) (defconst unique-unit elite-samurai) (defconst militia-count 30) (defconst archer-count 20) (defconst skirmisher-count 5) (defconst spearman-count 5) (defconst knight-count 10) (defconst unique-count 10) #end-if #load-if-defined MONGOL-CIV (defconst militia champion) (defconst archers arbalest) (defconst skirmishers elite-skirmisher) (defconst spearmans pikeman) (defconst knights cavalier) (defconst unique-unit my-unique-unit-line) (defconst militia-count 20) (defconst archer-count 15) (defconst skirmisher-count 5) (defconst spearman-count 5) (defconst knight-count 10) (defconst unique-count 20) #end-if #load-if-defined PERSIAN-CIV (defconst militia long-swordsman) (defconst archers crossbowman) (defconst skirmishers elite-skirmisher) (defconst spearmans pikeman) (defconst knights paladin) (defconst unique-unit elite-war-elephant) (defconst militia-count 5) (defconst archer-count 10) (defconst skirmisher-count 10) (defconst spearman-count 10) (defconst knight-count 30) (defconst unique-count 10) #end-if #load-if-defined SARACEN-CIV (defconst militia champion) (defconst archers arbalest) (defconst skirmishers elite-skirmisher) (defconst spearmans pikeman) (defconst knights knight) (defconst unique-unit elite-mameluke) (defconst militia-count 20) (defconst archer-count 20) (defconst skirmisher-count 5) (defconst spearman-count 10) (defconst knight-count 5) (defconst unique-count 10) #end-if #load-if-defined TEUTONIC-CIV (defconst militia champion) (defconst archers crossbowman) (defconst skirmishers elite-skirmisher) (defconst spearmans pikeman) (defconst knights paladin) (defconst unique-unit my-unique-unit-line) (defconst militia-count 20) (defconst archer-count 10) (defconst skirmisher-count 5) (defconst spearman-count 5) (defconst knight-count 20) (defconst unique-count 15) #end-if #load-if-defined TURKISH-CIV (defconst militia long-swordsman) (defconst archers crossbowman) (defconst skirmishers skirmisher) (defconst spearmans spearman) (defconst knights cavalier) (defconst unique-unit my-unique-unit-line) (defconst militia-research ri-long-swordsman) (defconst knights-research ri-cavalier) (defconst archers-research ri-crossbow) (defconst militia-count 5) (defconst archer-count 5) (defconst skirmisher-count 5) (defconst spearman-count 10) (defconst knight-count 40) (defconst gunner-count 5) (defconst bomber-count 5) (defconst scorpion-count 5) (defconst camel-count 0) (defconst unique-count 5) #end-if #load-if-defined VIKING-CIV (defconst militia champion) (defconst archers arbalest) (defconst skirmishers skirmisher) (defconst spearmans pikeman) (defconst knights cavalier) (defconst unique-unit elite-berserk) (defconst militia-count 25) (defconst archer-count 25) (defconst skirmisher-count 5) (defconst spearman-count 5) (defconst knight-count 10) (defconst unique-count 10) #end-if ;================================================================= ;====================== Dark Age ================================= ;================================================================= ; ============== VILLAGER ASSIGNMENT (defrule (current-age == dark-age) => (set-strategic-number sn-maximum-town-size 12) (set-strategic-number sn-food-gatherer-percentage 70) (set-strategic-number sn-gold-gatherer-percentage 5) (set-strategic-number sn-stone-gatherer-percentage 0) (set-strategic-number sn-wood-gatherer-percentage 25) (set-strategic-number sn-maximum-gold-drop-distance 20) (set-strategic-number sn-maximum-stone-drop-distance 10) (set-strategic-number sn-maximum-food-drop-distance 10) (set-strategic-number sn-maximum-wood-drop-distance 10) (set-strategic-number sn-maximum-hunt-drop-distance 10) (set-strategic-number sn-camp-max-distance 20) (disable-self) ) ; ============== ADVANCING IN AGE ; Dark to Feudal (defrule (current-age == dark-age) (can-research-with-escrow feudal-age) => (release-escrow food) (research feudal-age) (set-goal 16 1) (disable-self) ) ; ============== BUILD LISTS ;maintain housing (defrule (housing-headroom less-than 4) (population-headroom greater-than 0) (can-build house) => (build house) ) ; maximum 25 villagers in dark age (defrule (unit-type-count-total villager less-than 50) (current-age == dark-age) (can-train-with-escrow villager) => (release-escrow food) (train villager) ) (defrule (building-type-count-total mill less-than 5) (game-time > 100) (dropsite-min-distance food > 5) (can-build-with-escrow mill) => (release-escrow wood) (build mill) (disable-self) ) (defrule (resource-found wood) (dropsite-min-distance wood > 5) (can-build-with-escrow lumber-camp) => (release-escrow wood) (build lumber-camp) ) (defrule (resource-found gold) (building-type-count-total mill > 0) (game-time > 250) (dropsite-min-distance gold > 5) (building-type-count-total mining-camp less-than 16) (can-build-with-escrow mining-camp) => (release-escrow wood) (build mining-camp) ) (defrule (current-age == dark-age) (game-time > 200) (building-type-count-total lumber-camp >= 1) (idle-farm-count < 1) (building-type-count-total farm less-than 28) (can-build farm) => (build farm) ) ;maintain a town center (defrule (building-type-count town-center less-than 1) (can-build town-center) => (build town-center) ) (defrule (unit-type-count-total scout-cavalry-line < 2) (can-train scout-cavalry-line) => (train scout-cavalry-line) (set-strategic-number sn-number-explore-groups 1) (set-strategic-number sn-total-number-explorers 1) ) (defrule (unit-type-count-total scout-cavalry-line < 1) => (set-strategic-number sn-number-explore-groups 0) (set-strategic-number sn-total-number-explorers 0) ) ;================= Researches =============== ;town center (defrule (game-time greater-than 100) (can-research ri-loom) => (research ri-loom) (disable-self) ) ;================================================================= ;====================== Feudal Age ================================= ;================================================================= ; ============== VILLAGER ASSIGNMENT (defrule (current-age == feudal-age) => (set-strategic-number sn-maximum-town-size 15) (set-strategic-number sn-maximum-gold-drop-distance 5) (set-strategic-number sn-maximum-stone-drop-distance 20) (set-strategic-number sn-maximum-food-drop-distance 5) (set-strategic-number sn-maximum-wood-drop-distance 5) (set-strategic-number sn-maximum-hunt-drop-distance 0) (disable-self) ) (defrule (goal 16 1) (gold-amount < 200) => (set-strategic-number sn-food-gatherer-percentage 44) (set-strategic-number sn-gold-gatherer-percentage 8) (set-strategic-number sn-stone-gatherer-percentage 4) (set-strategic-number sn-wood-gatherer-percentage 44) ) (defrule (goal 16 1) (gold-amount > 200) => (set-strategic-number sn-food-gatherer-percentage 48) (set-strategic-number sn-gold-gatherer-percentage 4) (set-strategic-number sn-stone-gatherer-percentage 4) (set-strategic-number sn-wood-gatherer-percentage 44) ) ; ============== ADVANCING IN AGE ; Feudal to Castle (defrule (current-age == feudal-age) (can-research-with-escrow castle-age) => (release-escrow food) (release-escrow gold) (research castle-age) (set-goal 16 2) (disable-self) ) ; ============== BUILD LISTS (defrule (goal 16 1) (idle-farm-count < 1) (building-type-count-total farm less-than 20) (can-build-with-escrow farm) => (release-escrow wood) (build farm) ) (defrule (building-type-count-total market less-than 1) (can-build-with-escrow market) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (build market) ) (defrule (building-type-count-total blacksmith less-than 1) (can-build-with-escrow blacksmith) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (build blacksmith) ) (defrule (goal 16 1) (building-type-count-total blacksmith > 0) (building-type-count-total market > 0) (building-type-count-total barracks less-than 1) (can-build barracks) => (build barracks) (disable-self) ) (defrule (resource-found stone) (building-type-count-total blacksmith > 0) (building-type-count-total market > 0) (dropsite-min-distance stone > 5) (building-type-count-total mining-camp less-than 16) (can-build-with-escrow mining-camp) => (release-escrow wood) (build mining-camp) ) (defrule (goal 16 1) (building-type-count-total watch-tower-line < 1) (can-build watch-tower-line) => (build-forward watch-tower-line) ) ;================================================================= ;====================== Castle Age ================================= ;================================================================= ; ============== VILLAGER ASSIGNMENT (defrule (current-age == castle-age) => (set-strategic-number sn-allow-civilian-defense 1) (set-strategic-number sn-camp-max-distance 30) (set-strategic-number sn-maximum-gold-drop-distance 5) (set-strategic-number sn-maximum-stone-drop-distance 5) (set-strategic-number sn-maximum-food-drop-distance 10) (set-strategic-number sn-maximum-wood-drop-distance 10) (set-strategic-number sn-group-commander-selection-method 2) (set-strategic-number sn-sentry-distance 27) (set-strategic-number sn-target-evaluation-siege-weapon 100) (set-strategic-number sn-special-attack-type1 1) (disable-self) ) ; ============== ADVANCING IN AGE ; Castle to Imperial (defrule (current-age == castle-age) (can-research-with-escrow imperial-age) => (release-escrow food) (release-escrow gold) (research imperial-age) (set-goal 16 3) (disable-self) ) (defrule (goal 16 2) => (set-strategic-number sn-food-gatherer-percentage 35) (set-strategic-number sn-gold-gatherer-percentage 20) (set-strategic-number sn-stone-gatherer-percentage 5) (set-strategic-number sn-wood-gatherer-percentage 40) ) (defrule (current-age == castle-age) (gold-amount < 700) => (set-strategic-number sn-food-gatherer-percentage 30) (set-strategic-number sn-gold-gatherer-percentage 35) (set-strategic-number sn-stone-gatherer-percentage 5) (set-strategic-number sn-wood-gatherer-percentage 30) ) (defrule (current-age == castle-age) (gold-amount > 700) (unit-type-count-total fishing-ship < 1) => (set-strategic-number sn-food-gatherer-percentage 45) (set-strategic-number sn-gold-gatherer-percentage 20) (set-strategic-number sn-stone-gatherer-percentage 5) (set-strategic-number sn-wood-gatherer-percentage 30) ) (defrule (current-age == castle-age) (gold-amount > 700) (unit-type-count-total fishing-ship > 0) => (set-strategic-number sn-food-gatherer-percentage 40) (set-strategic-number sn-gold-gatherer-percentage 20) (set-strategic-number sn-stone-gatherer-percentage 5) (set-strategic-number sn-wood-gatherer-percentage 35) ) (defrule (current-age == castle-age) (gold-amount < 800) (food-amount > 900) => (set-strategic-number sn-food-gatherer-percentage 20) (set-strategic-number sn-gold-gatherer-percentage 45) (set-strategic-number sn-stone-gatherer-percentage 5) (set-strategic-number sn-wood-gatherer-percentage 30) ) ; ============== BUILD LISTS (defrule (or (goal 16 2) (goal 16 3) ) (idle-farm-count < 1) (building-type-count-total monastery > 0) (building-type-count-total farm less-than 50) (wood-amount < 40) => (set-goal need-wood-goal 1) ) (defrule (or (goal 16 2) (goal 16 3) ) (idle-farm-count < 1) (building-type-count-total monastery > 0) (building-type-count-total farm less-than 50) (wood-amount < 80) => (set-goal save-wood-goal 1) ) (defrule (goal 16 2) (idle-farm-count < 1) (building-type-count-total monastery > 0) (building-type-count-total farm less-than 50) (can-build farm) => (build farm) (chat-local-to-self "farm") ) (defrule (building-type-count-total dock > 0) (unit-type-count-total fishing-ship less-than 10) (wood-amount < 50) => (set-goal need-wood-goal 1) ) (defrule (building-type-count-total dock > 0) (unit-type-count-total fishing-ship less-than 10) (wood-amount < 75) => (set-goal save-wood-goal 1) ) (defrule (game-time < 3600) (building-type-count-total dock > 0) (unit-type-count-total fishing-ship less-than 10) (can-train-with-escrow fishing-ship) => (release-escrow wood) (train fishing-ship) (chat-local-to-self "fishing ship") ) ;(defrule ; (unit-type-count-total fishing-ship > 0) ; (building-type-count-total fish-trap less-than 10) ; (can-build fish-trap) ;=> ; (build fish-trap) ; (chat-local-to-self "fishing trap") ;) ;(defrule ; (goal 16 2) ; (unit-type-count-total villager less-than 50) ; (food-amount < 30) ;=> ; (set-goal need-food-goal 1) ;) ; ;(defrule ; (goal 16 2) ; (unit-type-count-total villager less-than 50) ; (food-amount < 75) ;=> ; (set-goal save-food-goal 1) ;) ; ;(defrule ; (goal 16 2) ; (unit-type-count-total villager less-than 50) ; (can-train villager) ;=> ; (train villager) ; (chat-local-to-self "villager") ;) (defrule (goal 16 2) (building-type-count-total monastery less-than 1) (wood-amount < 150) => (set-goal need-wood-goal 1) ) (defrule (goal 16 2) (building-type-count-total monastery less-than 1) (wood-amount < 175) => (set-goal save-wood-goal 1) ) (defrule (goal 16 2) (building-type-count-total monastery less-than 1) (can-build-with-escrow monastery) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (build monastery) (chat-local-to-self "monastery") ) (defrule (building-type-count-total university less-than 1) (wood-amount < 150) => (set-goal need-wood-goal 1) ) (defrule (building-type-count-total university less-than 1) (wood-amount < 200) => (set-goal save-wood-goal 1) ) (defrule (building-type-count-total university less-than 1) (can-build-with-escrow university) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (build university) (chat-local-to-self "university") (set-strategic-number sn-maximum-town-size 17) ) ; Build gates for a wall (defrule (goal 16 3) (building-type-count-total gate < 6) (stone-amount < 20) => (set-goal need-stone-goal 1) ) (defrule (goal 16 3) (building-type-count-total gate < 6) (stone-amount < 30) => (set-goal save-stone-goal 1) ) (defrule (goal 16 3) (building-type-count-total gate < 6) (can-build-gate-with-escrow wall-perimeter) => (release-escrow stone) (build-gate wall-perimeter) (chat-local-to-self "gate") ) ; Build the wall (defrule (goal 16 3) (wall-completed-percentage wall-perimeter < 100) (stone-amount < 150) => (set-goal need-stone-goal 1) ) (defrule (goal 16 3) (wall-completed-percentage wall-perimeter < 100) (can-build-wall-with-escrow wall-perimeter stone-wall-line) => (release-escrow stone) (build-wall wall-perimeter stone-wall-line) (chat-local-to-self "wall") ) (defrule (or (goal 16 2) (goal 16 3) ) (building-type-count-total castle less-than 1) (stone-amount < 650) => (set-goal need-stone-goal 1) ) (defrule (or (goal 16 2) (goal 16 3) ) (building-type-count-total castle less-than 2) (can-build-with-escrow castle) => (release-escrow stone) (build castle) (chat-local-to-self "castle") ) (defrule (or (goal 16 2) (goal 16 3) ) (building-type-count-total monastery > 0) (building-type-count-total barracks less-than 1) (wood-amount < 150) => (set-goal need-wood-goal 1) ) (defrule (or (goal 16 2) (goal 16 3) ) (building-type-count-total monastery > 0) (building-type-count-total barracks less-than 1) (wood-amount < 200) => (set-goal save-wood-goal 1) ) (defrule (or (goal 16 2) (goal 16 3) ) (building-type-count-total monastery > 0) (building-type-count-total barracks less-than 1) (can-build barracks) => (build barracks) (chat-local-to-self "barracks") ) (defrule (or (goal 16 2) (goal 16 3) ) (building-type-count-total monastery > 0) (building-type-count-total university > 0) (building-type-count-total archery-range less-than 1) (wood-amount < 150) => (set-goal need-wood-goal 1) ) (defrule (or (goal 16 2) (goal 16 3) ) (building-type-count-total monastery > 0) (building-type-count-total university > 0) (building-type-count-total archery-range less-than 1) (wood-amount < 200) => (set-goal save-wood-goal 1) ) (defrule (or (goal 16 2) (goal 16 3) ) (building-type-count-total monastery > 0) (building-type-count-total university > 0) (building-type-count-total archery-range less-than 1) (can-build-with-escrow archery-range) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (build archery-range) (chat-local-to-self "archery range") ) (defrule (or (goal 16 2) (goal 16 3) ) (building-type-count-total monastery > 0) (building-type-count-total university > 0) (building-type-count-total stable less-than 1) (wood-amount < 150) => (set-goal need-wood-goal 1) ) (defrule (or (goal 16 2) (goal 16 3) ) (building-type-count-total monastery > 0) (building-type-count-total university > 0) (building-type-count-total stable less-than 1) (wood-amount < 200) => (set-goal save-wood-goal 1) ) (defrule (or (goal 16 2) (goal 16 3) ) (building-type-count-total monastery > 0) (building-type-count-total university > 0) (building-type-count-total stable less-than 1) (can-build-with-escrow stable) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (build stable) (chat-local-to-self "stable") ) ; Build towers (defrule (goal 16 3) (building-type-count-total castle >= 1) (building-type-count-total watch-tower-line < 5) (wood-amount < 15) => (set-goal need-wood-goal 1) ) (defrule (goal 16 3) (building-type-count-total castle >= 1) (building-type-count-total watch-tower-line < 5) (wood-amount < 50) => (set-goal save-wood-goal 1) ) (defrule (goal 16 3) (building-type-count-total castle >= 1) (building-type-count-total watch-tower-line < 5) (can-build watch-tower-line) => (build watch-tower-line) (chat-local-to-self "tower") ) (defrule (goal 16 3) (building-type-count-total monastery > 0) (building-type-count-total university > 0) (building-type-count-total siege-workshop less-than 1) (wood-amount < 170) => (set-goal need-wood-goal 1) ) (defrule (goal 16 3) (building-type-count-total monastery > 0) (building-type-count-total university > 0) (building-type-count-total siege-workshop less-than 1) (wood-amount < 250) => (set-goal save-wood-goal 1) ) (defrule (goal 16 3) (building-type-count-total monastery > 0) (building-type-count-total university > 0) (building-type-count-total siege-workshop less-than 1) (can-build-with-escrow siege-workshop) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (build siege-workshop) (chat-local-to-self "siege") ) (defrule (goal 16 2) (building-type-count-total monastery > 0) (building-type-count-total university > 0) (building-type-count-total barracks > 0) (building-type-count-total dock less-than 1) (wood-amount < 100) => (set-goal need-wood-goal 1) ) (defrule (goal 16 2) (building-type-count-total monastery > 0) (building-type-count-total university > 0) (building-type-count-total barracks > 0) (building-type-count-total dock less-than 1) (wood-amount < 150) => (set-goal save-wood-goal 1) ) (defrule (goal 16 2) (building-type-count-total monastery > 0) (building-type-count-total university > 0) (building-type-count-total barracks > 0) (building-type-count-total dock less-than 1) (can-build-with-escrow dock) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (build dock) (chat-local-to-self "dock") ) (defrule (or (current-age == castle-age) (current-age == imperial-age) ) (building-type-count-total monastery > 0) (building-type-count-total university > 0) (building-type-count-total barracks > 0) (building-type-count-total stable > 0) (building-type-count-total archery-range > 0) (building-type-count-total siege-workshop > 0) (building-type-count town-center less-than 3) (wood-amount < 250) => (set-goal need-wood-goal 1) ) (defrule (or (current-age == castle-age) (current-age == imperial-age) ) (building-type-count-total monastery > 0) (building-type-count-total university > 0) (building-type-count-total barracks > 0) (building-type-count-total stable > 0) (building-type-count-total archery-range > 0) (building-type-count-total siege-workshop > 0) (building-type-count town-center less-than 3) (wood-amount < 400) => (set-goal save-wood-goal 1) ) (defrule (or (current-age == castle-age) (current-age == imperial-age) ) (building-type-count-total monastery > 0) (building-type-count-total university > 0) (building-type-count-total barracks > 0) (building-type-count-total stable > 0) (building-type-count-total archery-range > 0) (building-type-count-total siege-workshop > 0) (building-type-count town-center less-than 3) (stone-amount < 90) => (set-goal need-stone-goal 1) ) (defrule (or (current-age == castle-age) (current-age == imperial-age) ) (building-type-count-total monastery > 0) (building-type-count-total university > 0) (building-type-count-total barracks > 0) (building-type-count-total stable > 0) (building-type-count-total archery-range > 0) (building-type-count-total siege-workshop > 0) (building-type-count town-center less-than 3) (wood-amount < 250) => (set-goal save-stone-goal 1) ) (defrule (or (current-age == castle-age) (current-age == imperial-age) ) (building-type-count-total monastery > 0) (building-type-count-total university > 0) (building-type-count-total barracks > 0) (building-type-count-total stable > 0) (building-type-count-total archery-range > 0) (building-type-count-total siege-workshop > 0) (building-type-count town-center less-than 3) (can-build town-center) => (build town-center) (chat-local-to-self "town center") ) ; ============== MILITARY UNITS (defrule (unit-type-count-total monk < 4) (can-train-with-escrow monk) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (train monk) ) (defrule (or (goal 16 2) (goal 16 3) ) (goal 10 0) (goal 11 0) (goal 12 0) (town-under-attack) (unit-type-count-total spearman-line < 1) (unit-type-count-total skirmisher-line < 1) => (set-strategic-number sn-percent-enemy-sighted-response 0) (set-strategic-number sn-enemy-sighted-response-distance 0) ) (defrule (goal 16 2) (town-under-attack) (unit-type-count-total knight-line < 5) (can-train knight-line) => (train knight-line) ) (defrule (goal 16 2) (town-under-attack) (unit-type-count-total archer-line < 10) (can-train archer-line) => (train archer-line) ) (defrule (goal 16 2) (town-under-attack) (unit-type-count-total skirmisher-line < 10) (can-train skirmisher-line) => (train skirmisher-line) ) (defrule (goal 16 2) (town-under-attack) (unit-type-count-total scorpion-line < 5) (can-train scorpion-line) => (train scorpion-line) ) (defrule (goal 16 2) (town-under-attack) (unit-type-count-total my-unique-unit-line < 5) (can-train my-unique-unit-line) => (train my-unique-unit-line) ) (defrule (goal 16 2) (town-under-attack) (unit-type-count-total militiaman-line < 5) (can-train militiaman-line) => (train militiaman-line) ) (defrule (goal 16 2) (town-under-attack) (unit-type-count-total spearman-line < 5) (can-train spearman-line) => (train spearman-line) ) ;(defrule ; (goal 16 2) ; (unit-type-count-total trebuchet < 2) ; (can-train trebuchet) ;=> ; (train trebuchet) ;) ;(defrule ; (goal 16 2) ; (unit-type-count-total skirmisher-line < 5) ; (can-train archer-line) ;=> ; (train archer-line) ;) (defrule (or (goal 16 2) (goal 16 3) ) (unit-type-count-total spearman-line > 4) (unit-type-count-total skirmisher-line > 4) (unit-type-count-total my-unique-unit-line > 4) => (set-strategic-number sn-percent-enemy-sighted-response 100) (set-strategic-number sn-enemy-sighted-response-distance 75) ) ;================= Economy Researches =============== ;================= Researches =============== ;mill (defrule (goal 16 2) (research-available ri-horse-collar) (food-amount < 50) => (set-goal need-food-goal 1) ) (defrule (goal 16 2) (research-available ri-horse-collar) (food-amount < 75) => (set-goal save-food-goal 1) ) (defrule (goal 16 2) (research-available ri-horse-collar) (wood-amount < 50) => (set-goal need-wood-goal 1) ) (defrule (goal 16 2) (research-available ri-horse-collar) (wood-amount < 75) => (set-goal save-wood-goal 1) ) (defrule (goal 16 2) (can-research-with-escrow ri-horse-collar) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-horse-collar) (disable-self) ) (defrule (goal 16 3) (research-available ri-heavy-plow) (food-amount < 100) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (research-available ri-heavy-plow) (food-amount < 125) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (research-available ri-heavy-plow) (wood-amount < 100) => (set-goal need-wood-goal 1) ) (defrule (goal 16 3) (wood-amount < 125) => (set-goal save-wood-goal 1) ) (defrule (goal 16 3) (can-research-with-escrow ri-heavy-plow) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-heavy-plow) (disable-self) ) ;lumber camp (defrule (goal 16 3) (research-available ri-bow-saw) (food-amount < 100) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (research-available ri-bow-saw) (food-amount < 150) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (research-available ri-bow-saw) (wood-amount < 80) => (set-goal need-wood-goal 1) ) (defrule (goal 16 3) (research-available ri-bow-saw) (wood-amount < 100) => (set-goal save-wood-goal 1) ) (defrule (goal 16 3) (can-research-with-escrow ri-bow-saw) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-bow-saw) (disable-self) ) (defrule (goal 16 3) (research-available ri-double-bit-axe) (food-amount < 70) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (research-available ri-double-bit-axe) (food-amount < 100) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (research-available ri-double-bit-axe) (wood-amount < 30) => (set-goal need-wood-goal 1) ) (defrule (goal 16 3) (research-available ri-double-bit-axe) (wood-amount < 50) => (set-goal save-wood-goal 1) ) (defrule (goal 16 3) (can-research-with-escrow ri-double-bit-axe) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-double-bit-axe) (disable-self) ) ;;;;;;;;;;;;;;; Gold mining camp (defrule (goal 16 2) (research-available ri-gold-mining) (food-amount < 80) => (set-goal need-food-goal 1) ) (defrule (goal 16 2) (research-available ri-gold-mining) (food-amount < 100) => (set-goal save-food-goal 1) ) (defrule (goal 16 2) (research-available ri-gold-mining) (wood-amount < 60) => (set-goal need-wood-goal 1) ) (defrule (goal 16 2) (research-available ri-gold-mining) (wood-amount < 75) => (set-goal save-wood-goal 1) ) (defrule (goal 16 2) (can-research-with-escrow ri-gold-mining) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-gold-mining) (disable-self) ) (defrule (goal 16 3) (research-available ri-gold-shaft-mining) (food-amount < 180) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (research-available ri-gold-shaft-mining) (food-amount < 200) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (research-available ri-gold-shaft-mining) (wood-amount < 130) => (set-goal need-wood-goal 1) ) (defrule (goal 16 3) (research-available ri-gold-shaft-mining) (wood-amount < 150) => (set-goal save-wood-goal 1) ) (defrule (goal 16 3) (can-research ri-gold-shaft-mining) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-gold-shaft-mining) (disable-self) ) ;town center (defrule (or (goal 16 2) (goal 16 3) ) (research-available ri-wheel-barrow) (food-amount < 150) => (set-goal need-food-goal 1) ) (defrule (or (goal 16 2) (goal 16 3) ) (research-available ri-wheel-barrow) (food-amount < 175) => (set-goal save-food-goal 1) ) (defrule (or (goal 16 2) (goal 16 3) ) (research-available ri-wheel-barrow) (wood-amount < 30) => (set-goal need-wood-goal 1) ) (defrule (or (goal 16 2) (goal 16 3) ) (research-available ri-wheel-barrow) (wood-amount < 50) => (set-goal save-wood-goal 1) ) (defrule (or (goal 16 2) (goal 16 3) ) (can-research-with-escrow ri-wheel-barrow) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-wheel-barrow) (disable-self) ) (defrule (or (goal 16 2) (goal 16 3) ) (research-available ri-hand-cart) (food-amount < 250) => (set-goal need-food-goal 1) ) (defrule (or (goal 16 2) (goal 16 3) ) (research-available ri-hand-cart) (food-amount < 300) => (set-goal save-food-goal 1) ) (defrule (or (goal 16 2) (goal 16 3) ) (research-available ri-hand-cart) (wood-amount < 150) => (set-goal need-wood-goal 1) ) (defrule (or (goal 16 2) (goal 16 3) ) (research-available ri-hand-cart) (wood-amount < 200) => (set-goal save-wood-goal 1) ) (defrule (or (goal 16 2) (goal 16 3) ) (can-research-with-escrow ri-hand-cart) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-hand-cart) (disable-self) ) ;================= Military Researches =============== ;archary range ;(defrule ; (can-research-with-escrow ri-thumb-ring) ;=> ; (release-escrow wood) ; (release-escrow food) ; (release-escrow gold) ; (release-escrow stone) ; (research ri-thumb-ring) ; (disable-self) ;) ;barrak (defrule (goal 16 3) (research-available ri-squires) (food-amount < 170) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (research-available ri-squires) (food-amount < 200) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (can-research-with-escrow ri-squires) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-squires) (disable-self) ) (defrule (goal 16 3) (research-available ri-tracking) (food-amount < 50) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (research-available ri-tracking) (food-amount < 75) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (can-research-with-escrow ri-tracking) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-tracking) (disable-self) ) ;stable (defrule (goal 16 3) (research-available ri-husbandry) (food-amount < 220) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (research-available ri-husbandry) (food-amount < 250) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (can-research-with-escrow ri-husbandry) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-husbandry) (disable-self) ) ;university (defrule (goal 16 3) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (research-available ri-stonecutting) (wood-amount < 170) => (set-goal need-wood-goal 1) ) (defrule (goal 16 3) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (research-available ri-stonecutting) (wood-amount < 250) => (set-goal save-wood-goal 1) ) (defrule (goal 16 3) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (research-available ri-stonecutting) (wood-amount < 270) => (set-goal need-stone-goal 1) ) (defrule (goal 16 3) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (research-available ri-stonecutting) (wood-amount < 350) => (set-goal save-stone-goal 1) ) (defrule (goal 16 3) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (can-research ri-stonecutting) => (research ri-stonecutting) (disable-self) ) (defrule (goal 16 3) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (research-available ri-guard-tower) (food-amount < 70) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (research-available ri-guard-tower) (food-amount < 100) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (research-available ri-guard-tower) (stone-amount < 230) => (set-goal need-stone-goal 1) ) (defrule (goal 16 3) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (research-available ri-guard-tower) (stone-amount < 250) => (set-goal save-stone-goal 1) ) (defrule (goal 16 3) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (building-type-count-total watch-tower-line > 0) (can-research ri-guard-tower) => (research ri-guard-tower) (disable-self) ) (defrule (goal 16 3) (research-available ri-murder-holes) (food-amount < 170) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (research-available ri-murder-holes) (food-amount < 200) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (research-available ri-murder-holes) (stone-amount < 170) => (set-goal need-stone-goal 1) ) (defrule (goal 16 3) (research-available ri-murder-holes) (stone-amount < 200) => (set-goal save-stone-goal 1) ) (defrule (goal 16 3) (can-research-with-escrow ri-murder-holes) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-murder-holes) (disable-self) ) ;moastery (defrule (goal 16 3) (research-available ri-fervor) (gold-amount < 120) => (set-goal need-gold-goal 1) ) (defrule (goal 16 3) (research-available ri-fervor) (gold-amount < 140) => (set-goal save-gold-goal 1) ) (defrule (goal 16 3) (can-research-with-escrow ri-fervor) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-fervor) (disable-self) ) ;========================================ATTACK (defrule (current-age == castle-age) (unit-type-count-total spearman-line >= 10) (unit-type-count-total archer-line >= 10) (unit-type-count-total trebuchet >= 1) => (attack-now) (enable-timer 6 1000) (chat-to-all "31") (disable-self) ) (defrule (timer-triggered 6) (unit-type-count-total spearman-line >= 10) (unit-type-count-total archer-line >= 10) (unit-type-count-total trebuchet >= 2) => (attack-now) (disable-timer 6) (enable-timer 6 1000) ) ;================================================================= ;====================== Imperial Age ================================= ;================================================================= ; ============== VILLAGER ASSIGNMENT (defrule (current-age == imperial-age) => (set-strategic-number sn-maximum-town-size 20) (set-strategic-number sn-camp-max-distance 40) (set-strategic-number sn-maximum-gold-drop-distance 20) (set-strategic-number sn-maximum-stone-drop-distance 20) (set-strategic-number sn-maximum-wood-drop-distance 10) (set-strategic-number sn-maximum-food-drop-distance 10) (set-strategic-number sn-special-attack-type1 0) (set-strategic-number sn-task-ungrouped-soldiers 0) (disable-self) ) (defrule (current-age == imperial-age) (unit-type-count-total fishing-ship < 1) (goal need-food-goal 0) (goal need-wood-goal 0) (goal need-gold-goal 0) (goal need-stone-goal 0) => (set-strategic-number sn-food-gatherer-percentage 40) (set-strategic-number sn-gold-gatherer-percentage 20) (set-strategic-number sn-stone-gatherer-percentage 10) (set-strategic-number sn-wood-gatherer-percentage 30) ) (defrule (current-age == imperial-age) (unit-type-count-total fishing-ship > 0) (goal need-food-goal 0) (goal need-wood-goal 0) (goal need-gold-goal 0) (goal need-stone-goal 0) => (set-strategic-number sn-food-gatherer-percentage 25) (set-strategic-number sn-gold-gatherer-percentage 30) (set-strategic-number sn-stone-gatherer-percentage 10) (set-strategic-number sn-wood-gatherer-percentage 35) ) (defrule (current-age == imperial-age) => (enable-timer 2 500) (enable-timer 5 900) (enable-timer 7 2000) (disable-self) ) (defrule (goal 16 3) (unit-type-count-total fishing-ship > 0) (goal need-food-goal 0) (goal need-wood-goal 0) (goal need-gold-goal 0) (goal need-stone-goal 0) => (set-strategic-number sn-food-gatherer-percentage 25) (set-strategic-number sn-gold-gatherer-percentage 20) (set-strategic-number sn-stone-gatherer-percentage 10) (set-strategic-number sn-wood-gatherer-percentage 45) ) (defrule (goal 16 3) (unit-type-count-total fishing-ship < 1) (goal need-food-goal 0) (goal need-wood-goal 0) (goal need-gold-goal 0) (goal need-stone-goal 0) => (set-strategic-number sn-food-gatherer-percentage 30) (set-strategic-number sn-gold-gatherer-percentage 15) (set-strategic-number sn-stone-gatherer-percentage 10) (set-strategic-number sn-wood-gatherer-percentage 45) ) (defrule (goal 16 3) (town-under-attack) (goal need-food-goal 0) (goal need-wood-goal 0) (goal need-gold-goal 0) (goal need-stone-goal 0) => (set-strategic-number sn-food-gatherer-percentage 60) (set-strategic-number sn-gold-gatherer-percentage 0) (set-strategic-number sn-stone-gatherer-percentage 0) (set-strategic-number sn-wood-gatherer-percentage 40) ) ; ============== BUILD LISTS (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total fishing-ship > 1) => (delete-unit fishing-ship) ) ;(defrule ; (goal 16 3) ; (unit-type-count-total fishing-ship > 0) ; (building-type-count-total fish-trap less-than 20) ; (can-build fish-trap) ;=> ; (build fish-trap) ;) (defrule (goal 16 3) (building-type-count-total archery-range > 0) (building-type-count-total stable > 0) (building-type-count-total barracks > 0) (idle-farm-count < 1) (building-type-count-total farm less-than 50) (can-build farm) => (build farm) (chat-local-to-self "farm") ) (defrule (goal 16 3) (or (or (goal 10 0) (goal 11 0) ) (goal 12 0) ) (unit-type-count-total villager less-than 50) (can-train villager) => (train villager) ) (defrule (goal 16 3) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total villager less-than 40) (food-amount < 40) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total villager less-than 40) (food-amount < 75) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total villager less-than 40) (can-train villager) => (train villager) ) (defrule (goal 16 3) (wall-completed-percentage wall-perimeter < 100) (can-build-wall-with-escrow wall-perimeter stone-wall-line) => (release-escrow stone) (build-wall wall-perimeter stone-wall-line) ) (defrule (goal 16 3) (building-type-count-total siege-workshop >= 1) (building-type-count-total archery-range >= 1) (building-type-count-total stable less-than 3) (wood-amount < 150) => (set-goal need-wood-goal 1) ) (defrule (goal 16 3) (building-type-count-total siege-workshop >= 1) (building-type-count-total archery-range >= 1) (building-type-count-total stable less-than 3) (wood-amount < 200) => (set-goal save-wood-goal 1) ) (defrule (goal 16 3) (building-type-count-total siege-workshop >= 1) (building-type-count-total archery-range >= 1) (building-type-count-total stable less-than 3) (can-build stable) => (build stable) ) (defrule (goal 16 3) (building-type-count-total siege-workshop >= 1) (building-type-count-total archery-range less-than 3) (wood-amount < 150) => (set-goal need-wood-goal 1) ) (defrule (goal 16 3) (building-type-count-total siege-workshop >= 1) (building-type-count-total archery-range less-than 3) (wood-amount < 200) => (set-goal save-wood-goal 1) ) (defrule (goal 16 3) (building-type-count-total siege-workshop >= 1) (building-type-count-total archery-range less-than 3) (can-build archery-range) => (build archery-range) ) (defrule (goal 16 3) (building-type-count-total barracks less-than 1) (wood-amount < 150) => (set-goal need-wood-goal 1) ) (defrule (goal 16 3) (building-type-count-total barracks less-than 1) (wood-amount < 200) => (set-goal save-wood-goal 1) ) (defrule (goal 16 3) (building-type-count-total barracks less-than 1) (can-build barracks) => (build barracks) ) (defrule (goal 16 3) (building-type-count-total barracks less-than 1) (wood-amount < 150) => (set-goal need-wood-goal 1) ) (defrule (goal 16 3) (building-type-count-total siege-workshop >= 1) (building-type-count-total archery-range >= 1) (building-type-count-total stable >= 1) (building-type-count-total barracks less-than 3) (wood-amount < 200) => (set-goal save-wood-goal 1) ) (defrule (goal 16 3) (building-type-count-total siege-workshop >= 1) (building-type-count-total archery-range >= 1) (building-type-count-total stable >= 1) (building-type-count-total barracks less-than 3) (can-build barracks) => (build barracks) ) (defrule (goal 16 3) (building-type-count-total siege-workshop >= 1) (building-type-count-total archery-range >= 1) (building-type-count-total stable >= 1) (building-type-count-total monastery less-than 2) (wood-amount < 150) => (set-goal need-wood-goal 1) ) (defrule (goal 16 3) (building-type-count-total siege-workshop >= 1) (building-type-count-total archery-range >= 1) (building-type-count-total stable >= 1) (building-type-count-total monastery less-than 2) (wood-amount < 200) => (set-goal save-wood-goal 1) ) (defrule (goal 16 3) (building-type-count-total siege-workshop >= 1) (building-type-count-total archery-range >= 1) (building-type-count-total stable >= 1) (building-type-count-total monastery less-than 2) (can-build monastery) => (build monastery) ) (defrule (goal 16 3) (building-type-count-total castle less-than 3) (stone-amount < 600) => (set-goal need-stone-goal 1) ) (defrule (goal 16 3) (building-type-count-total castle less-than 3) (stone-amount < 700) => (set-goal save-stone-goal 1) ) (defrule (goal 16 3) (building-type-count-total castle less-than 3) (can-build-with-escrow castle) => (release-escrow stone) (build castle) ) ; Build forward bombard towers (defrule (goal 16 3) (building-type-count-total castle >= 1) (building-available bombard-tower) (building-type-count-total bombard-tower < 4) (stone-amount < 100) => (set-goal need-stone-goal 1) ) (defrule (goal 16 3) (building-type-count-total castle >= 1) (building-available bombard-tower) (building-type-count-total bombard-tower < 4) (stone-amount < 150) => (set-goal save-stone-goal 1) ) (defrule (goal 16 3) (building-type-count-total castle >= 1) (building-available bombard-tower) (building-type-count-total bombard-tower < 4) (stone-amount < 80) => (set-goal need-gold-goal 1) ) (defrule (goal 16 3) (building-type-count-total castle >= 1) (building-available bombard-tower) (building-type-count-total bombard-tower < 4) (stone-amount < 150) => (set-goal save-gold-goal 1) ) (defrule (goal 16 3) (building-type-count-total castle >= 1) (building-available bombard-tower) (building-type-count-total bombard-tower < 4) (can-build bombard-tower) => (build-forward bombard-tower) ) (defrule (goal 16 3) (building-type-count-total archery-range > 0) (building-type-count-total stable > 0) (building-type-count-total barracks > 0) (building-type-count-total dock less-than 2) (can-build-with-escrow dock) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (build dock) ) ;================= Economy Researches =============== ;mill (defrule (goal 16 3) (research-available ri-crop-rotation) (food-amount < 220) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (research-available ri-crop-rotation) (food-amount < 250) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (research-available ri-crop-rotation) (wood-amount < 220) => (set-goal need-wood-goal 1) ) (defrule (goal 16 3) (research-available ri-crop-rotation) (wood-amount < 250) => (set-goal save-wood-goal 1) ) (defrule (goal 16 3) (can-research-with-escrow ri-crop-rotation) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-crop-rotation) (disable-self) ) ;lumber camp (defrule (goal 16 3) (research-available ri-two-man-saw) (food-amount < 270) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (research-available ri-two-man-saw) (food-amount < 300) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (research-available ri-two-man-saw) (wood-amount < 170) => (set-goal need-wood-goal 1) ) (defrule (goal 16 3) (research-available ri-two-man-saw) (wood-amount < 200) => (set-goal save-wood-goal 1) ) (defrule (goal 16 3) (can-research-with-escrow ri-two-man-saw) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-two-man-saw) (disable-self) ) ;;;;;;;;;;;;;;;;;mining camp (defrule (goal 16 3) (research-available ri-stone-mining) (food-amount < 80) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (research-available ri-stone-mining) (food-amount < 100) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (research-available ri-stone-mining) (wood-amount < 60) => (set-goal need-wood-goal 1) ) (defrule (goal 16 3) (research-available ri-stone-mining) (wood-amount < 75) => (set-goal save-wood-goal 1) ) (defrule (goal 16 3) (can-research-with-escrow ri-stone-mining) => (release-escrow food) (release-escrow wood) (research ri-stone-mining) (disable-self) ) ;;;;;;;;;;;;; stone-shaft mining (defrule (goal 16 3) (research-available ri-stone-shaft-mining) (food-amount < 180) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (research-available ri-stone-shaft-mining) (food-amount < 200) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (research-available ri-stone-shaft-mining) (wood-amount < 130) => (set-goal need-wood-goal 1) ) (defrule (goal 16 3) (research-available ri-stone-shaft-mining) (wood-amount < 150) => (set-goal save-wood-goal 1) ) (defrule (goal 16 3) (can-research-with-escrow ri-stone-shaft-mining) => (release-escrow food) (release-escrow wood) (research ri-stone-shaft-mining) (disable-self) ) ;;;;;;;;;;;;;;town center (defrule (goal 16 3) (research-available ri-town-watch) (food-amount < 60) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (research-available ri-town-watch) (food-amount < 100) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (can-research ri-town-watch) => (research ri-town-watch) (disable-self) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-town-patrol) (food-amount < 270) => (set-goal need-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-town-patrol) (food-amount < 350) => (set-goal save-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-town-patrol) (wood-amount < 170) => (set-goal need-wood-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-town-patrol) (wood-amount < 250) => (set-goal save-wood-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (can-research ri-town-patrol) => (research ri-town-patrol) (disable-self) ) ;;;;;;;;;;;;;;;;;;;market (defrule (research-available ri-guilds) (food-amount < 270) => (set-goal need-food-goal 1) ) (defrule (research-available ri-guilds) (food-amount < 300) => (set-goal save-food-goal 1) ) (defrule (research-available ri-guilds) (wood-amount < 170) => (set-goal need-wood-goal 1) ) (defrule (research-available ri-guilds) (wood-amount < 200) => (set-goal save-wood-goal 1) ) (defrule (can-research-with-escrow ri-guilds) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-guilds) (disable-self) ) ;================= Military Researches =============== ;;;;;;;;;;;;;;;;; castle (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (can-research-with-escrow ri-conscription) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-conscription) (disable-self) ) ;;;;;;;;hoardings (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (can-research-with-escrow ri-hoardings) (wood-amount < 370) => (set-goal need-wood-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (can-research-with-escrow ri-hoardings) (wood-amount < 400) => (set-goal save-wood-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (can-research-with-escrow ri-hoardings) (stone-amount < 370) => (set-goal need-stone-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (can-research-with-escrow ri-hoardings) (stone-amount < 400) => (set-goal save-stone-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (can-research-with-escrow ri-hoardings) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-hoardings) (disable-self) ) ;;;;;;;;;;;;;;;; sappers ;(defrule ; (goal 10 archers-ready) ; (goal 11 knights-ready) ; (goal 12 militia-ready) ; (goal 16 3) ; (can-research-with-escrow ri-sappers) ;=> ; (release-escrow wood) ; (release-escrow food) ; (release-escrow gold) ; (release-escrow stone) ; (research ri-sappers) ; (disable-self) ;) ;;;;;;;;;;;;;;; unique unit upgrade (defrule (goal 16 3) (can-research-with-escrow my-unique-unit-upgrade) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research my-unique-unit-upgrade) (disable-self) ) ;stable (defrule (goal 16 3) (can-research-with-escrow knights-research) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research knights-research) (set-goal 11 knights-ready) (chat-local-to-self "knights-ready") (disable-self) ) ;(defrule ; (goal 16 3) ; (can-research ri-bloodlines) ;=> ; (research ri-bloodlines) ; (disable-self) ;) ;;;;;;;;;;;;;; Cavalier (defrule (goal 16 3) (goal 11 0) (research-available ri-cavalier) (food-amount < 270) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (goal 11 0) (research-available ri-cavalier) (food-amount < 300) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (goal 11 0) (research-available ri-cavalier) (gold-amount < 270) => (set-goal need-gold-goal 1) ) (defrule (goal 16 3) (goal 11 0) (research-available ri-cavalier) (gold-amount < 300) => (set-goal save-gold-goal 1) ) (defrule (goal 16 3) (goal 11 0) (can-research-with-escrow ri-cavalier) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-cavalier) (disable-self) ) ;;;;;;;;;;;;;;;;;;;; paladin (defrule (goal 16 3) (goal 11 0) (can-research-with-escrow ri-paladin) (food-amount < 1270) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (goal 11 0) (can-research-with-escrow ri-paladin) (food-amount < 1300) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (goal 11 0) (can-research-with-escrow ri-paladin) (gold-amount < 720) => (set-goal need-gold-goal 1) ) (defrule (goal 16 3) (goal 11 0) (can-research-with-escrow ri-paladin) (gold-amount < 750) => (set-goal save-gold-goal 1) ) (defrule (goal 16 3) (goal 11 0) (can-research-with-escrow ri-paladin) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-paladin) (disable-self) ) ;;;;;;;;;;;;;;;;;; cavalry (defrule (goal 16 3) (research-available ri-light-cavalry) (food-amount < 130) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (research-available ri-light-cavalry) (food-amount < 150) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (research-available ri-light-cavalry) (gold-amount < 30) => (set-goal need-gold-goal 1) ) (defrule (goal 16 3) (research-available ri-light-cavalry) (gold-amount < 50) => (set-goal save-gold-goal 1) ) (defrule (goal 16 3) (can-research-with-escrow ri-light-cavalry) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-light-cavalry) (disable-self) ) ;;;;;;;;;;;;;;;; heavy camel (defrule (goal 16 3) (goal 11 knights-ready) (can-research-with-escrow ri-heavy-camel) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-heavy-camel) (disable-self) ) ;(defrule ; (goal 16 3) ; (can-research-with-escrow ri-hussar) ;=> ; (release-escrow wood) ; (release-escrow food) ; (release-escrow gold) ; (release-escrow stone) ; (research ri-hussar) ; (disable-self) ;) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;barrack (defrule (goal 16 3) (can-research-with-escrow militia-research) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research militia-research) (set-goal 12 militia-ready) (chat-local-to-self "militia-ready") (disable-self) ) (defrule (goal 16 3) (research-available ri-pikeman) (food-amount < 190) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (research-available ri-pikeman) (food-amount < 215) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (research-available ri-pikeman) (gold-amount < 70) => (set-goal need-gold-goal 1) ) (defrule (goal 16 3) (research-available ri-pikeman) (gold-amount < 90) => (set-goal save-gold-goal 1) ) (defrule (goal 16 3) (can-research-with-escrow ri-pikeman) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-pikeman) (disable-self) ) ;;;;;;;;;;;;;;;;;;;;; man at arms (defrule (goal 16 3) (goal 12 0) (research-available ri-man-at-arms) (food-amount < 180) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (goal 12 0) (research-available ri-man-at-arms) (food-amount < 200) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (goal 12 0) (research-available ri-man-at-arms) (gold-amount < 30) => (set-goal need-gold-goal 1) ) (defrule (goal 16 3) (goal 12 0) (research-available ri-man-at-arms) (gold-amount < 40) => (set-goal save-gold-goal 1) ) (defrule (goal 16 3) (goal 12 0) (can-research-with-escrow ri-man-at-arms) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-man-at-arms) (disable-self) ) ;;;;;;;;;;;;;;;;;;;;;;;; ri-long-swordsman (defrule (goal 16 3) (goal 12 0) (research-available ri-long-swordsman) (food-amount < 270) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (goal 12 0) (research-available ri-long-swordsman) (food-amount < 300) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (goal 12 0) (research-available ri-long-swordsman) (gold-amount < 50) => (set-goal need-gold-goal 1) ) (defrule (goal 16 3) (goal 12 0) (research-available ri-long-swordsman) (gold-amount < 65) => (set-goal save-gold-goal 1) ) (defrule (goal 16 3) (goal 12 0) (can-research-with-escrow ri-long-swordsman) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-long-swordsman) (disable-self) ) ;;;;;;;;;;;;;;;;;;; ri-two-handed-swordsman (defrule (goal 16 3) (goal 12 0) (research-available ri-two-handed-swordsman) (food-amount < 370) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (goal 12 0) (research-available ri-two-handed-swordsman) (food-amount < 400) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (goal 12 0) (research-available ri-two-handed-swordsman) (gold-amount < 80) => (set-goal need-gold-goal 1) ) (defrule (goal 16 3) (goal 12 0) (research-available ri-two-handed-swordsman) (gold-amount < 100) => (set-goal save-gold-goal 1) ) (defrule (goal 16 3) (goal 12 0) (can-research-with-escrow ri-two-handed-swordsman) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-two-handed-swordsman) (disable-self) ) ;;;;;;;;;;;;;;;;;;;;;;; ri-champion (defrule (goal 16 3) (goal 12 0) (research-available ri-champion) (food-amount < 820) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (goal 12 0) (research-available ri-champion) (food-amount < 850) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (goal 12 0) (research-available ri-champion) (gold-amount < 330) => (set-goal need-gold-goal 1) ) (defrule (goal 16 3) (research-available ri-champion) (gold-amount < 350) => (set-goal save-gold-goal 1) ) (defrule (goal 16 3) (goal 12 0) (can-research-with-escrow ri-champion) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-champion) (disable-self) ) ;(defrule ; (goal 16 3) ; (can-research-with-escrow ri-halberdier) ;=> ; (release-escrow wood) ; (release-escrow food) ; (release-escrow gold) ; (release-escrow stone) ; (research ri-halberdier) ; (disable-self) ;) ;;;;;;;;;;;;;;;;;;;;;;;;;;;; archery range (defrule (goal 16 3) (can-research-with-escrow archers-research) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research archers-research) (set-goal 10 archers-ready) (chat-local-to-self "archers-ready") (disable-self) ) ;;;;;;;;; ri-hand-cannon (defrule (goal 16 3) (can-research-with-escrow ri-hand-cannon) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-hand-cannon) (disable-self) ) ;;;;;;;;;;;;;;;;;;;;;;;; ri-crossbow (defrule (goal 16 3) (goal 10 0) (research-available ri-crossbow) (food-amount < 100) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (goal 10 0) (research-available ri-crossbow) (food-amount < 125) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (goal 10 0) (research-available ri-crossbow) (gold-amount < 60) => (set-goal need-gold-goal 1) ) (defrule (goal 16 3) (goal 10 0) (research-available ri-crossbow) (gold-amount < 75) => (set-goal save-gold-goal 1) ) (defrule (goal 16 3) (goal 10 0) (can-research-with-escrow ri-crossbow) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-crossbow) (disable-self) ) ;;;;;;;;;;;;;;;;;;;;;;;; ri-arbalest (defrule (goal 16 3) (goal 10 0) (research-available ri-arbalest) (food-amount < 325) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (goal 10 0) (research-available ri-arbalest) (food-amount < 350) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (goal 10 0) (research-available ri-arbalest) (gold-amount < 275) => (set-goal need-gold-goal 1) ) (defrule (goal 16 3) (goal 10 0) (research-available ri-arbalest) (gold-amount < 300) => (set-goal save-gold-goal 1) ) (defrule (goal 16 3) (goal 10 0) (can-research-with-escrow ri-arbalest) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-arbalest) (disable-self) ) ;;;;;;;;;;;;;;;;;;;; ri-elite-skirmisher (defrule (goal 16 3) (research-available ri-elite-skirmisher) (wood-amount < 230) => (set-goal need-wood-goal 1) ) (defrule (goal 16 3) (research-available ri-elite-skirmisher) (wood-amount < 250) => (set-goal save-wood-goal 1) ) (defrule (goal 16 3) (research-available ri-elite-skirmisher) (gold-amount < 150) => (set-goal need-gold-goal 1) ) (defrule (goal 16 3) (research-available ri-elite-skirmisher) (gold-amount < 160) => (set-goal save-gold-goal 1) ) (defrule (goal 16 3) (can-research-with-escrow ri-elite-skirmisher) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-elite-skirmisher) (disable-self) ) ;;;;;;;;;;;;;;;;;;;;; ri-heavy-cavalry-archer ;(defrule ; (goal 16 3) ; (goal 10 archers-ready) ; (can-research-with-escrow ri-heavy-cavalry-archer) ;=> ; (release-escrow wood) ; (release-escrow food) ; (release-escrow gold) ; (release-escrow stone) ; (research ri-heavy-cavalry-archer) ; (disable-self) ;) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; siege (defrule (goal 16 3) (can-research-with-escrow ri-bombard-cannon) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-bombard-cannon) (disable-self) ) ;;;;;;;;;;;;;;; ri-capped-ram (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-capped-ram) (food-amount < 180) => (set-goal need-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-capped-ram) (food-amount < 200) => (set-goal save-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-capped-ram) (gold-amount < 230) => (set-goal need-gold-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-capped-ram) (gold-amount < 250) => (set-goal save-gold-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (can-research-with-escrow ri-capped-ram) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-capped-ram) (disable-self) ) ;;;;;;;;;;;;;;;;;;;;; ri-siege-ram (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-siege-ram) (food-amount < 950) => (set-goal need-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-siege-ram) (food-amount < 1000) => (set-goal save-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-siege-ram) (gold-amount < 770) => (set-goal need-gold-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-siege-ram) (gold-amount < 800) => (set-goal save-gold-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (can-research-with-escrow ri-siege-ram) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-siege-ram) (disable-self) ) ;;;;;;;;;;;;;;;;;;;;;;;;; ri-heavy-scorpion (defrule (goal 16 3) (research-available ri-heavy-scorpion) (food-amount < 950) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (research-available ri-heavy-scorpion) (food-amount < 1000) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (research-available ri-heavy-scorpion) (wood-amount < 1050) => (set-goal need-wood-goal 1) ) (defrule (goal 16 3) (research-available ri-heavy-scorpion) (wood-amount < 1100) => (set-goal need-wood-goal 1) ) (defrule (goal 16 3) (can-research-with-escrow ri-heavy-scorpion) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-heavy-scorpion) (disable-self) ) ;(defrule ; (goal 16 3) ; (can-research-with-escrow ri-siege-onager) ;=> ; (release-escrow wood) ; (release-escrow food) ; (release-escrow gold) ; (release-escrow stone) ; (research ri-siege-onager) ; (disable-self) ;) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; monastery ;;;;;;; ri-block-printing (defrule (goal 16 3) (research-available ri-block-printing) (gold-amount < 180) => (set-goal need-gold-goal 1) ) (defrule (goal 16 3) (research-available ri-block-printing) (gold-amount < 200) => (set-goal save-gold-goal 1) ) (defrule (goal 16 3) (can-research-with-escrow ri-block-printing) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-block-printing) (disable-self) ) ;;;;;;;;;;;;;;; ri-atonement (defrule (goal 16 3) (research-available ri-atonement) (gold-amount < 300) => (set-goal need-gold-goal 1) ) (defrule (goal 16 3) (research-available ri-atonement) (gold-amount < 325) => (set-goal save-gold-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (can-research-with-escrow ri-atonement) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-atonement) (disable-self) ) (defrule (goal 16 3) (research-available ri-faith) (food-amount < 720) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (research-available ri-faith) (food-amount < 750) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (research-available ri-faith) (gold-amount < 950) => (set-goal need-gold-goal 1) ) (defrule (goal 16 3) (research-available ri-faith) (gold-amount < 1000) => (set-goal save-gold-goal 1) ) (defrule (goal 16 3) (can-research-with-escrow ri-faith) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-faith) (disable-self) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-illumination) (gold-amount < 100) => (set-goal need-gold-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-illumination) (gold-amount < 120) => (set-goal save-gold-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (can-research-with-escrow ri-illumination) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-illumination) (disable-self) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-redemption) (gold-amount < 450) => (set-goal need-gold-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-redemption) (gold-amount < 475) => (set-goal save-gold-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (can-research-with-escrow ri-redemption) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-redemption) (disable-self) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-sanctity) (gold-amount < 100) => (set-goal need-gold-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-sanctity) (gold-amount < 120) => (set-goal save-gold-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (can-research-with-escrow ri-sanctity) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-sanctity) (disable-self) ) ;(defrule ; (goal 16 3) ; (can-research-with-escrow ri-theocracy) ;=> ; (release-escrow wood) ; (release-escrow food) ; (release-escrow gold) ; (release-escrow stone) ; (research ri-theocracy) ; (disable-self) ;) ;(defrule ; (goal 16 3) ; (can-research-with-escrow ri-heresy) ;=> ; (release-escrow wood) ; (release-escrow food) ; (release-escrow gold) ; (release-escrow stone) ; (research ri-heresy) ; (disable-self) ;) ;(defrule ; (goal 16 3) ; (can-research-with-escrow ri-perfusion) ;=> ; (release-escrow wood) ; (release-escrow food) ; (release-escrow gold) ; (release-escrow stone) ; (research ri-perfusion) ; (disable-self) ;) ;(defrule ; (goal 16 3) ; (can-research-with-escrow ri-herbal-medicine) ;=> ; (release-escrow wood) ; (release-escrow food) ; (release-escrow gold) ; (release-escrow stone) ; (research ri-herbal-medicine) ; (disable-self) ;) ;;;;;;;;;;;;;;;;;;;;;;;;;;;; blacksmith (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-scale-mail) (food-amount < 80) => (set-goal need-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-scale-mail) (food-amount < 100) => (set-goal save-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (can-research-with-escrow ri-scale-mail) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-scale-mail) (disable-self) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-chain-mail) (food-amount < 180) => (set-goal need-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-chain-mail) (food-amount < 200) => (set-goal save-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-chain-mail) (gold-amount < 80) => (set-goal need-gold-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-chain-mail) (gold-amount < 100) => (set-goal save-gold-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (can-research-with-escrow ri-chain-mail) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-chain-mail) (disable-self) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-plate-mail) (food-amount < 280) => (set-goal need-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-plate-mail) (food-amount < 300) => (set-goal save-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-plate-mail) (gold-amount < 130) => (set-goal need-gold-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-plate-mail) (gold-amount < 150) => (set-goal save-gold-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (can-research-with-escrow ri-plate-mail) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-plate-mail) (disable-self) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (can-research-with-escrow ri-padded-archer-armor) (food-amount < 80) => (set-goal need-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (can-research-with-escrow ri-padded-archer-armor) (food-amount < 100) => (set-goal save-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (can-research-with-escrow ri-padded-archer-armor) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-padded-archer-armor) (disable-self) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-leather-archer-armor) (food-amount < 130) => (set-goal need-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-leather-archer-armor) (food-amount < 150) => (set-goal save-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-leather-archer-armor) (gold-amount < 130) => (set-goal need-gold-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-leather-archer-armor) (gold-amount < 150) => (set-goal save-gold-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (can-research-with-escrow ri-leather-archer-armor) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-leather-archer-armor) (disable-self) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (can-research-with-escrow ri-ring-archer-armor) (gold-amount < 230) => (set-goal need-gold-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (can-research-with-escrow ri-ring-archer-armor) (gold-amount < 250) => (set-goal save-gold-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (can-research-with-escrow ri-ring-archer-armor) (food-amount < 230) => (set-goal need-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (can-research-with-escrow ri-ring-archer-armor) (food-amount < 250) => (set-goal save-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (can-research-with-escrow ri-ring-archer-armor) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-ring-archer-armor) (disable-self) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-scale-barding) (food-amount < 130) => (set-goal need-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-scale-barding) (food-amount < 150) => (set-goal save-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (can-research-with-escrow ri-scale-barding) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-scale-barding) (disable-self) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-chain-barding) (food-amount < 230) => (set-goal need-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-chain-barding) (food-amount < 250) => (set-goal save-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-chain-barding) (gold-amount < 130) => (set-goal need-gold-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-chain-barding) (gold-amount < 150) => (set-goal save-gold-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (can-research-with-escrow ri-chain-barding) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-chain-barding) (disable-self) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-plate-barding) (gold-amount < 180) => (set-goal need-gold-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-plate-barding) (gold-amount < 200) => (set-goal save-gold-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-plate-barding) (food-amount < 330) => (set-goal need-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-plate-barding) (food-amount < 350) => (set-goal save-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (can-research-with-escrow ri-plate-barding) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-plate-barding) (disable-self) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-fletching) (food-amount < 80) => (set-goal need-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-fletching) (food-amount < 100) => (set-goal save-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-fletching) (gold-amount < 30) => (set-goal need-gold-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-fletching) (gold-amount < 50) => (set-goal save-gold-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (can-research-with-escrow ri-fletching) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-fletching) (disable-self) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-bodkin-arrow) (gold-amount < 80) => (set-goal need-gold-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-bodkin-arrow) (gold-amount < 100) => (set-goal save-gold-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-bodkin-arrow) (food-amount < 180) => (set-goal need-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-bodkin-arrow) (food-amount < 200) => (set-goal save-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (can-research-with-escrow ri-bodkin-arrow) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-bodkin-arrow) (disable-self) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-bracer) (food-amount < 280) => (set-goal need-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-bracer) (food-amount < 300) => (set-goal save-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-bracer) (gold-amount < 180) => (set-goal need-gold-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-bracer) (gold-amount < 200) => (set-goal save-gold-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (can-research-with-escrow ri-bracer) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-bracer) (disable-self) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-forging) (food-amount < 130) => (set-goal need-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-forging) (food-amount < 150) => (set-goal save-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (can-research-with-escrow ri-forging) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-forging) (disable-self) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-iron-casting) (food-amount < 200) => (set-goal need-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-iron-casting) (food-amount < 220) => (set-goal save-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-iron-casting) (gold-amount < 100) => (set-goal need-gold-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-iron-casting) (gold-amount < 120) => (set-goal save-gold-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (can-research-with-escrow ri-iron-casting) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-iron-casting) (disable-self) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-blast-furnace) (gold-amount < 200) => (set-goal need-gold-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-blast-furnace) (gold-amount < 225) => (set-goal save-gold-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-blast-furnace) (food-amount < 250) => (set-goal need-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (research-available ri-blast-furnace) (food-amount < 275) => (set-goal save-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (can-research-with-escrow ri-blast-furnace) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-blast-furnace) (disable-self) ) ;university (defrule (goal 16 3) (research-available ri-ballistics) (wood-amount < 270) => (set-goal need-wood-goal 1) ) (defrule (goal 16 3) (research-available ri-ballistics) (wood-amount < 450) => (set-goal save-wood-goal 1) ) (defrule (goal 16 3) (research-available ri-ballistics) (gold-amount < 150) => (set-goal need-gold-goal 1) ) (defrule (goal 16 3) (research-available ri-ballistics) (gold-amount < 300) => (set-goal save-gold-goal 1) ) (defrule (goal 16 3) (can-research ri-ballistics) => (research ri-ballistics) (disable-self) ) (defrule (goal 16 3) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (research-available ri-masonry) (wood-amount < 150) => (set-goal need-wood-goal 1) ) (defrule (goal 16 3) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (research-available ri-masonry) (wood-amount < 300) => (set-goal save-wood-goal 1) ) (defrule (goal 16 3) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (research-available ri-masonry) (stone-amount < 140) => (set-goal need-stone-goal 1) ) (defrule (goal 16 3) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (research-available ri-masonry) (stone-amount < 300) => (set-goal save-stone-goal 1) ) (defrule (goal 16 3) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (can-research ri-masonry) => (research ri-masonry) (disable-self) ) (defrule (goal 16 3) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (wall-completed-percentage wall-perimeter > 90) (research-available ri-fortified-wall) (stone-amount < 90) => (set-goal need-stone-goal 1) ) (defrule (goal 16 3) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (wall-completed-percentage wall-perimeter > 90) (research-available ri-fortified-wall) (stone-amount < 250) => (set-goal save-stone-goal 1) ) (defrule (goal 16 3) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (wall-completed-percentage wall-perimeter > 90) (research-available ri-fortified-wall) (food-amount < 180) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (wall-completed-percentage wall-perimeter > 90) (research-available ri-fortified-wall) (food-amount < 350) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (wall-completed-percentage wall-perimeter > 90) (can-research ri-fortified-wall) => (research ri-fortified-wall) (disable-self) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (building-type-count-total watch-tower-line > 0) (research-available ri-keep) (food-amount < 470) => (set-goal need-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (building-type-count-total watch-tower-line > 0) (research-available ri-keep) (food-amount < 650) => (set-goal save-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (building-type-count-total watch-tower-line > 0) (research-available ri-keep) (stone-amount < 330) => (set-goal need-stone-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (building-type-count-total watch-tower-line > 0) (research-available ri-keep) (stone-amount < 500) => (set-goal save-stone-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (building-type-count-total watch-tower-line > 0) (can-research ri-keep) => (research ri-keep) (disable-self) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (research-available ri-architecture) (stone-amount < 280) => (set-goal need-stone-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (research-available ri-architecture) (stone-amount < 450) => (set-goal save-stone-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (research-available ri-architecture) (wood-amount < 180) => (set-goal need-wood-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (research-available ri-architecture) (wood-amount < 350) => (set-goal save-wood-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (can-research ri-architecture) => (research ri-architecture) (disable-self) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (research-available ri-chemistry) (food-amount < 270) => (set-goal need-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (research-available ri-chemistry) (food-amount < 300) => (set-goal save-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (research-available ri-chemistry) (gold-amount < 180) => (set-goal need-gold-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (research-available ri-chemistry) (gold-amount < 200) => (set-goal save-gold-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (can-research-with-escrow ri-chemistry) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (research ri-chemistry) (disable-self) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (research-available ri-siege-engineers) (food-amount < 470) => (set-goal need-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (research-available ri-siege-engineers) (food-amount < 650) => (set-goal save-food-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (research-available ri-siege-engineers) (wood-amount < 570) => (set-goal need-wood-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (research-available ri-siege-engineers) (wood-amount < 750) => (set-goal save-wood-goal 1) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (can-research ri-siege-engineers) => (research ri-siege-engineers) (disable-self) ) (defrule (research-available ri-bombard-tower) (food-amount < 770) => (set-goal need-food-goal 1) ) (defrule (research-available ri-bombard-tower) (food-amount < 800) => (set-goal save-food-goal 1) ) (defrule (research-available ri-bombard-tower) (food-amount < 380) => (set-goal need-stone-goal 1) ) (defrule (research-available ri-bombard-tower) (food-amount < 400) => (set-goal save-stone-goal 1) ) (defrule (can-research ri-bombard-tower) => (research ri-bombard-tower) (disable-self) ) ;dock (defrule (building-type-count dock > 0) (unit-type-count-total fire-ship-line > 0) (can-research ri-fast-fire-ship) => (research ri-fast-fire-ship) (disable-self) ) (defrule (building-type-count dock > 0) (unit-type-count-total galley-line > 0) (can-research ri-galleon) => (research ri-galleon) (disable-self) ) (defrule (goal 16 3) (building-type-count dock > 0) (unit-type-count-total galley-line > 0) (can-research ri-war-galley) => (research ri-war-galley) (disable-self) ) (defrule (building-type-count dock > 0) (can-research ri-cannon-galleon) => (research ri-cannon-galleon) (disable-self) ) (defrule (building-type-count dock > 0) (unit-type-count-total cannon-galleon-line > 0) (can-research ri-deck-guns) => (research ri-deck-guns) (disable-self) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (goal 16 3) (building-type-count dock > 0) (can-research ri-careening) => (research ri-careening) (disable-self) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (building-type-count dock > 0) (can-research ri-dry-dock) => (research ri-dry-dock) (disable-self) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (building-type-count dock > 0) (can-research ri-shipwright) => (research ri-shipwright) (disable-self) ) ; ============== MILITARY UNITS (defrule (timer-triggered 2) (not (town-under-attack)) (unit-type-count-total monk < 4) (can-train monk) => (disable-timer 2) (enable-timer 2 500) (train monk) ) ;barrack (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total militiaman-line < 5) (food-amount < 60) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total militiaman-line < 5) (food-amount < 260) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total militiaman-line < 5) (gold-amount < 20) => (set-goal need-gold-goal 1) ) (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total militiaman-line < 5) (gold-amount < 220) => (set-goal save-gold-goal 1) ) (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total militiaman-line < 5) (can-train-with-escrow militiaman-line) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (train militiaman-line) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (unit-type-count-total spearman-line < 5) (food-amount < 35) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (unit-type-count-total spearman-line < 5) (food-amount < 235) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (unit-type-count-total spearman-line < 5) (wood-amount < 25) => (set-goal need-wood-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (unit-type-count-total spearman-line < 5) (wood-amount < 225) => (set-goal save-wood-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (unit-type-count-total spearman-line < 5) (can-train-with-escrow spearman-line) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (train spearman-line) ) (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total spearman-line < 10) (can-train-with-escrow spearman-line) (food-amount < 35) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total spearman-line < 10) (can-train-with-escrow spearman-line) (food-amount < 235) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total spearman-line < 10) (can-train-with-escrow spearman-line) (wood-amount < 25) => (set-goal need-wood-goal 1) ) (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total spearman-line < 10) (can-train-with-escrow spearman-line) (wood-amount < 225) => (set-goal save-wood-goal 1) ) (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total spearman-line < 10) (can-train-with-escrow spearman-line) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (train spearman-line) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total militiaman-line < militia-count) (food-amount < 60) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total militiaman-line < militia-count) (food-amount < 260) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total militiaman-line < militia-count) (gold-amount < 20) => (set-goal need-gold-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total militiaman-line < militia-count) (gold-amount < 220) => (set-goal save-gold-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total militiaman-line < militia-count) (can-train militia) => (train militia) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total spearmans < spearman-count) (food-amount < 35) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total spearmans < spearman-count) (food-amount < 235) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total spearmans < spearman-count) (wood-amount < 25) => (set-goal need-wood-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total spearmans < spearman-count) (wood-amount < 225) => (set-goal save-wood-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total spearmans < spearman-count) (can-train spearmans) => (train spearmans) ) ;stable (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total knight-line < 5) (food-amount < 60) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total knight-line < 5) (food-amount < 260) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total knight-line < 5) (gold-amount < 75) => (set-goal need-gold-goal 1) ) (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total knight-line < 5) (gold-amount < 275) => (set-goal save-gold-goal 1) ) (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total knight-line < 5) (can-train-with-escrow knight-line) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (train knight-line) ) (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total scout-cavalry-line < 10) (food-amount < 80) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total scout-cavalry-line < 10) (food-amount < 280) => (set-goal save-food-goal 1) ) ;;;;;;;;;;;;;;;; (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total scout-cavalry-line < 10) (can-train-with-escrow scout-cavalry-line) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (train scout-cavalry-line) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total knight-line < knight-count) (food-amount < 60) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total knight-line < knight-count) (food-amount < 260) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total knight-line < knight-count) (food-amount < 60) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total knight-line < knight-count) (food-amount < 260) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total knight-line < knight-count) (gold-amount < 75) => (set-goal need-gold-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total knight-line < knight-count) (gold-amount < 275) => (set-goal save-gold-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total knight-line < knight-count) (can-train knights) => (train knights) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (not (town-under-attack)) (unit-type-count-total camel-line < camel-count) (gold-amount < 60) => (set-goal need-gold-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (not (town-under-attack)) (unit-type-count-total camel-line < camel-count) (gold-amount < 260) => (set-goal save-gold-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (not (town-under-attack)) (unit-type-count-total camel-line < camel-count) (food-amount < 55) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (not (town-under-attack)) (unit-type-count-total camel-line < camel-count) (food-amount < 255) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (not (town-under-attack)) (unit-type-count-total camel-line < camel-count) (can-train camel-line) => (train camel-line) ) ;range (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total archer-line < 5) (wood-amount < 25) => (set-goal need-wood-goal 1) ) (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total archer-line < 5) (wood-amount < 225) => (set-goal save-wood-goal 1) ) (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total archer-line < 5) (gold-amount < 45) => (set-goal need-gold-goal 1) ) (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total archer-line < 5) (gold-amount < 245) => (set-goal save-gold-goal 1) ) (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total archer-line < 5) (can-train-with-escrow archer-line) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (train archer-line) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (unit-type-count-total skirmisher-line < 5) (food-amount < 25) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (unit-type-count-total skirmisher-line < 5) (food-amount < 225) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (unit-type-count-total skirmisher-line < 5) (wood-amount < 35) => (set-goal need-wood-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (unit-type-count-total skirmisher-line < 5) (wood-amount < 235) => (set-goal save-wood-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (unit-type-count-total skirmisher-line < 5) (can-train-with-escrow skirmisher-line) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (train skirmisher-line) ) (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total skirmisher-line < 10) (wood-amount < 35) => (set-goal need-wood-goal 1) ) (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total skirmisher-line < 10) (wood-amount < 235) => (set-goal save-wood-goal 1) ) (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total skirmisher-line < 10) (food-amount < 25) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total skirmisher-line < 10) (food-amount < 225) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total skirmisher-line < 10) (can-train-with-escrow skirmisher-line) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (train skirmisher-line) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total archer-line < archer-count) (wood-amount < 25) => (set-goal need-wood-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total archer-line < archer-count) (wood-amount < 225) => (set-goal save-wood-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total archer-line < archer-count) (gold-amount < 45) => (set-goal need-gold-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total archer-line < archer-count) (gold-amount < 245) => (set-goal save-gold-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total archer-line < archer-count) (can-train archers) => (train archers) ) ;(defrule ; (goal 16 3) ; (unit-type-count-total villager > 35) ; (goal 10 archers-ready) ; (goal 11 knights-ready) ; (goal 12 militia-ready) ; (unit-type-count-total cavalry-archer-line < 10) ; (can-train cavalry-archer-line) ;=> ; (train cavalry-archer-line) ;) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total skirmishers < skirmisher-count) (food-amount < 25) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total skirmishers < skirmisher-count) (food-amount < 225) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total skirmishers < skirmisher-count) (wood-amount < 35) => (set-goal need-wood-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total skirmishers < skirmisher-count) (wood-amount < 235) => (set-goal save-wood-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total skirmishers < skirmisher-count) (can-train skirmishers) => (train skirmishers) ) (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total hand-cannoneer < 10) (food-amount < 45) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total hand-cannoneer < 10) (food-amount < 245) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total hand-cannoneer < 10) (gold-amount < 50) => (set-goal need-gold-goal 1) ) (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total hand-cannoneer < 10) (gold-amount < 250) => (set-goal save-gold-goal 1) ) (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total hand-cannoneer < 10) (can-train hand-cannoneer) => (train hand-cannoneer) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total hand-cannoneer < gunner-count) (gold-amount < 50) => (set-goal need-gold-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total hand-cannoneer < gunner-count) (gold-amount < 250) => (set-goal save-gold-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total hand-cannoneer < gunner-count) (food-amount < 45) => (set-goal need-food-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total hand-cannoneer < gunner-count) (food-amount < 245) => (set-goal save-food-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total hand-cannoneer < gunner-count) (can-train hand-cannoneer) => (train hand-cannoneer) ) ;siege (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total scorpion-line < 5) (wood-amount < 75) => (set-goal need-wood-goal 1) ) (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total scorpion-line < 5) (wood-amount < 275) => (set-goal save-wood-goal 1) ) (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total scorpion-line < 5) (gold-amount < 75) => (set-goal need-gold-goal 1) ) (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total scorpion-line < 5) (gold-amount < 275) => (set-goal save-gold-goal 1) ) (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total scorpion-line < 5) (can-train-with-escrow scorpion-line) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (train scorpion-line) ) (defrule (goal 16 3) (unit-type-count-total villager > 20) (unit-type-count-total scorpion-line < scorpion-count) (gold-amount < 75) => (set-goal need-gold-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 20) (unit-type-count-total scorpion-line < scorpion-count) (gold-amount < 275) => (set-goal save-gold-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 20) (unit-type-count-total scorpion-line < scorpion-count) (wood-amount < 75) => (set-goal need-wood-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 20) (unit-type-count-total scorpion-line < scorpion-count) (wood-amount < 275) => (set-goal save-wood-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 20) (unit-type-count-total scorpion-line < scorpion-count) (can-train-with-escrow scorpion-line) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (train scorpion-line) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (not (town-under-attack)) (unit-type-count-total bombard-cannon < bomber-count) (can-train bombard-cannon) => (train bombard-cannon) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (not (town-under-attack)) (unit-type-count-total battering-ram-line < 5) (can-train battering-ram-line) => (train battering-ram-line) ) ;castle (defrule (goal 16 3) (unit-type-count-total villager > 35) (unit-type-count-total unique-unit < 5) (can-train unique-unit) => (train unique-unit) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (unit-type-count-total trebuchet < 5) (wood-amount < 200) => (set-goal need-wood-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (unit-type-count-total trebuchet < 5) (wood-amount < 400) => (set-goal save-wood-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (unit-type-count-total trebuchet < 5) (gold-amount < 200) => (set-goal need-gold-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (unit-type-count-total trebuchet < 5) (gold-amount < 400) => (set-goal save-gold-goal 1) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (unit-type-count-total trebuchet < 5) (can-train trebuchet) => (train trebuchet) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total unique-unit < unique-count) (can-train unique-unit) => (train unique-unit) ) ;dock (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total fire-ship-line < 5) (can-train-with-escrow fire-ship-line) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (train fire-ship-line) ) (defrule (goal 16 3) (town-under-attack) (unit-type-count-total villager > 20) (unit-type-count-total galley-line < 5) (can-train-with-escrow galley-line) => (release-escrow wood) (release-escrow food) (release-escrow gold) (release-escrow stone) (train galley-line) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (unit-type-count-total demolition-ship-line < 2) (can-train demolition-ship-line) => (train demolition-ship-line) ) (defrule (goal 16 3) (unit-type-count-total villager > 35) (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) (unit-type-count-total cannon-galleon-line < 5) (can-train cannon-galleon-line) => (train cannon-galleon-line) ) ;(defrule ; (goal 16 3) ; (unit-type-count-total villager > 35) ; (goal 10 archers-ready) ; (goal 11 knights-ready) ; (goal 12 militia-ready) ; (unit-type-count-total transport-ship < 5) ; (can-train transport-ship) ;=> ; (train transport-ship) ;) ; ============== ATTACK (defrule (timer-triggered 7) (unit-type-count-total villager > 35) (unit-type-count-total battering-ram-line >= 1) (unit-type-count-total trebuchet >= 2) (or (or (unit-type-count-total knights > 1) (unit-type-count-total archers > 1) ) (unit-type-count-total militia > 1) ) => (attack-now) (disable-timer 7) (enable-timer 7 1000) (enable-timer 8 300) (set-strategic-number sn-percent-attack-soldiers 100) (chat-to-all "21") ) (defrule (timer-triggered 8) (game-time < 8000) (unit-type-count-total villager > 35) (or (or (unit-type-count-total knights > 1) (unit-type-count-total archers > 1) ) (unit-type-count-total militia > 1) ) => (attack-now) (disable-timer 8) (set-strategic-number sn-percent-attack-soldiers 90) ) (defrule (timer-triggered 8) (game-time > 8000) => (attack-now) (disable-timer 8) (enable-timer 8 300) ) (defrule (goal 10 archers-ready) (goal 11 knights-ready) (goal 12 militia-ready) => (chat-to-all "9") (set-strategic-number sn-enemy-sighted-response-distance 75) (set-strategic-number sn-percent-enemy-sighted-response 100) ) (defrule (game-time > 2700) => (set-strategic-number sn-camp-max-distance 50) (set-strategic-number sn-enemy-sighted-response-distance 50) (set-strategic-number sn-percent-enemy-sighted-response 100) (disable-self) ) (defrule (game-time > 3600) (wood-amount > 2000) (food-amount > 2000) (unit-type-count-total villager > 40) => (delete-unit villager) ) (defrule (game-time > 3600) (unit-type-count-total villager > 35) => (set-strategic-number sn-camp-max-distance 30) (set-strategic-number sn-enemy-sighted-response-distance 75) (set-strategic-number sn-percent-enemy-sighted-response 100) ) (defrule (game-time > 7200) (unit-type-count-total villager > 35) => (set-strategic-number sn-enemy-sighted-response-distance 100) (set-strategic-number sn-percent-enemy-sighted-response 100) ) (defrule (game-time > 7200) (unit-type-count-total villager > 35) (unit-type-count-total spearman-line < 20) (can-train spearman-line) => (train spearman-line) ) (defrule (game-time > 7200) (unit-type-count-total villager > 35) (unit-type-count-total skirmisher-line < 30) (can-train skirmisher-line) => (train skirmisher-line) ) (defrule (game-time > 7200) (unit-type-count-total villager > 35) (unit-type-count-total scout-cavalry-line < 35) (can-train scout-cavalry-line) => (train scout-cavalry-line) ) ; ================ MARKET - buys/sells (defrule (goal 16 1) (wood-amount >= 500) (gold-amount < 200) (food-amount > 500) (can-sell-commodity wood) => (sell-commodity wood) (chat-local-to-self "selling wood") ) (defrule (goal 16 1) (stone-amount >= 500) (or (gold-amount < 200) (food-amount < 800) ) (can-sell-commodity stone) => (sell-commodity stone) (chat-local-to-self "selling stone") ) (defrule (goal 16 1) (food-amount >= 1000) (gold-amount < 200) (can-sell-commodity food) => (sell-commodity food) (chat-local-to-self "selling food") ) (defrule (goal 16 1) (gold-amount > 325) (food-amount < 800) (can-buy-commodity food) => (buy-commodity food) (chat-local-to-self "buying food") ) (defrule (goal 16 1) (gold-amount > 400) (wood-amount < 50) (can-buy-commodity wood) => (buy-commodity wood) (chat-local-to-self "buying wood") ) (defrule (goal 16 2) (wood-amount >= 500) (gold-amount < 800) (food-amount > 800) (can-sell-commodity wood) => (sell-commodity wood) (chat-local-to-self "selling wood") ) (defrule (goal 16 2) (stone-amount >= 500) (or (gold-amount < 800) (food-amount < 1000) ) (can-sell-commodity stone) => (sell-commodity stone) (chat-local-to-self "selling stone") ) (defrule (goal 16 2) (food-amount >= 1200) (gold-amount < 800) (can-sell-commodity food) => (sell-commodity food) (chat-local-to-self "selling food") ) (defrule (goal 16 2) (gold-amount > 925) (food-amount < 1000) (can-buy-commodity food) => (buy-commodity food) (chat-local-to-self "buying food") ) (defrule (goal 16 2) (gold-amount > 1000) (wood-amount < 50) (can-buy-commodity wood) => (buy-commodity wood) (chat-local-to-self "buying wood") ) (defrule (or (goal 16 2) (goal 16 3) ) (goal save-food-goal 0) (goal need-wood-goal 1) (can-sell-commodity food) => (sell-commodity food) (chat-local-to-self "selling food") ) (defrule (or (goal 16 2) (goal 16 3) ) (goal save-food-goal 0) (goal need-gold-goal 1) (can-sell-commodity food) => (sell-commodity food) (chat-local-to-self "selling food") ) (defrule (or (goal 16 2) (goal 16 3) ) (goal save-food-goal 0) (goal need-stone-goal 1) (can-sell-commodity food) => (sell-commodity food) (chat-local-to-self "selling food") ) (defrule (or (goal 16 2) (goal 16 3) ) (goal save-wood-goal 0) (goal need-food-goal 1) (can-sell-commodity wood) => (sell-commodity wood) (chat-local-to-self "selling wood") ) (defrule (or (goal 16 2) (goal 16 3) ) (goal save-wood-goal 0) (goal need-gold-goal 1) (can-sell-commodity wood) => (sell-commodity wood) (chat-local-to-self "selling wood") ) (defrule (or (goal 16 2) (goal 16 3) ) (goal save-wood-goal 0) (goal need-stone-goal 1) (can-sell-commodity wood) => (sell-commodity wood) (chat-local-to-self "selling wood") ) (defrule (or (goal 16 2) (goal 16 3) ) (goal save-gold-goal 0) (goal need-food-goal 1) (can-buy-commodity food) => (buy-commodity food) (chat-local-to-self "buying food") ) (defrule (or (goal 16 2) (goal 16 3) ) (goal save-gold-goal 0) (goal need-wood-goal 1) (can-buy-commodity wood) => (buy-commodity wood) (chat-local-to-self "buying wood") ) (defrule (or (goal 16 2) (goal 16 3) ) (goal save-gold-goal 0) (goal need-stone-goal 1) (can-buy-commodity stone) => (buy-commodity stone) (chat-local-to-self "buying stone") ) ;===============ESCROW ========================= ; sets escrow (defrule (true) => (set-escrow-percentage wood 10) (set-escrow-percentage food 10) (set-escrow-percentage gold 10) (set-escrow-percentage stone 10) ) ; ================== RESIGNING - resigns if it can't train villagers (defrule (building-type-count town-center less-than 1) (unit-type-count-total villager < 2) (not (can-train villager) ) => (resign) (chat-to-all "55") (chat-to-all "56") (disable-self) ) ;============================================================= ; Set the gathering percentages (defrule (goal need-food-goal 1) (goal need-wood-goal 0) (goal need-gold-goal 0) (goal need-stone-goal 0) => (set-goal need-food-goal 0) (set-strategic-number sn-food-gatherer-percentage 90) (set-strategic-number sn-wood-gatherer-percentage 10) (set-strategic-number sn-gold-gatherer-percentage 0) (set-strategic-number sn-stone-gatherer-percentage 0) ) (defrule (goal need-food-goal 0) (goal need-wood-goal 1) (goal need-gold-goal 0) (goal need-stone-goal 0) => (set-goal need-wood-goal 0) (set-strategic-number sn-food-gatherer-percentage 10) (set-strategic-number sn-wood-gatherer-percentage 90) (set-strategic-number sn-gold-gatherer-percentage 0) (set-strategic-number sn-stone-gatherer-percentage 0) ) (defrule (goal need-food-goal 1) (goal need-wood-goal 1) (goal need-gold-goal 0) (goal need-stone-goal 0) => (set-goal need-food-goal 0) (set-goal need-wood-goal 0) (set-strategic-number sn-food-gatherer-percentage 45) (set-strategic-number sn-wood-gatherer-percentage 55) (set-strategic-number sn-gold-gatherer-percentage 0) (set-strategic-number sn-stone-gatherer-percentage 0) ) (defrule (goal need-food-goal 0) (goal need-wood-goal 0) (goal need-gold-goal 1) (goal need-stone-goal 0) => (set-goal need-gold-goal 0) (set-strategic-number sn-food-gatherer-percentage 10) (set-strategic-number sn-wood-gatherer-percentage 5) (set-strategic-number sn-gold-gatherer-percentage 85) (set-strategic-number sn-stone-gatherer-percentage 0) ) (defrule (goal need-food-goal 1) (goal need-wood-goal 0) (goal need-gold-goal 1) (goal need-stone-goal 0) => (set-goal need-food-goal 0) (set-goal need-gold-goal 0) (set-strategic-number sn-food-gatherer-percentage 55) (set-strategic-number sn-wood-gatherer-percentage 10) (set-strategic-number sn-gold-gatherer-percentage 35) (set-strategic-number sn-stone-gatherer-percentage 0) ) (defrule (goal need-food-goal 0) (goal need-wood-goal 1) (goal need-gold-goal 1) (goal need-stone-goal 0) => (set-goal need-wood-goal 0) (set-goal need-gold-goal 0) (set-strategic-number sn-food-gatherer-percentage 10) (set-strategic-number sn-wood-gatherer-percentage 60) (set-strategic-number sn-gold-gatherer-percentage 30) (set-strategic-number sn-stone-gatherer-percentage 0) ) (defrule (goal need-food-goal 1) (goal need-wood-goal 1) (goal need-gold-goal 1) (goal need-stone-goal 0) => (set-goal need-food-goal 0) (set-goal need-wood-goal 0) (set-goal need-gold-goal 0) (set-strategic-number sn-food-gatherer-percentage 40) (set-strategic-number sn-wood-gatherer-percentage 40) (set-strategic-number sn-gold-gatherer-percentage 20) (set-strategic-number sn-stone-gatherer-percentage 0) ) (defrule (goal need-food-goal 0) (goal need-wood-goal 0) (goal need-gold-goal 0) (goal need-stone-goal 1) => (set-goal need-stone-goal 0) (set-strategic-number sn-food-gatherer-percentage 35) (set-strategic-number sn-wood-gatherer-percentage 35) (set-strategic-number sn-gold-gatherer-percentage 0) (set-strategic-number sn-stone-gatherer-percentage 30) ) (defrule (goal need-food-goal 1) (goal need-wood-goal 0) (goal need-gold-goal 0) (goal need-stone-goal 1) => (set-goal need-food-goal 0) (set-goal need-stone-goal 0) (set-strategic-number sn-food-gatherer-percentage 65) (set-strategic-number sn-wood-gatherer-percentage 10) (set-strategic-number sn-gold-gatherer-percentage 0) (set-strategic-number sn-stone-gatherer-percentage 25) ) (defrule (goal need-food-goal 0) (goal need-wood-goal 1) (goal need-gold-goal 0) (goal need-stone-goal 1) => (set-goal need-wood-goal 0) (set-goal need-stone-goal 0) (set-strategic-number sn-food-gatherer-percentage 10) (set-strategic-number sn-wood-gatherer-percentage 65) (set-strategic-number sn-gold-gatherer-percentage 0) (set-strategic-number sn-stone-gatherer-percentage 25) ) (defrule (goal need-food-goal 1) (goal need-wood-goal 1) (goal need-gold-goal 0) (goal need-stone-goal 1) => (set-goal need-food-goal 0) (set-goal need-wood-goal 0) (set-goal need-stone-goal 0) (set-strategic-number sn-food-gatherer-percentage 40) (set-strategic-number sn-wood-gatherer-percentage 45) (set-strategic-number sn-gold-gatherer-percentage 0) (set-strategic-number sn-stone-gatherer-percentage 15) ) (defrule (goal need-food-goal 0) (goal need-wood-goal 0) (goal need-gold-goal 1) (goal need-stone-goal 1) => (set-goal need-gold-goal 0) (set-goal need-stone-goal 0) (set-strategic-number sn-food-gatherer-percentage 10) (set-strategic-number sn-wood-gatherer-percentage 5) (set-strategic-number sn-gold-gatherer-percentage 45) (set-strategic-number sn-stone-gatherer-percentage 40) ) (defrule (goal need-food-goal 1) (goal need-wood-goal 0) (goal need-gold-goal 1) (goal need-stone-goal 1) => (set-goal need-food-goal 0) (set-goal need-gold-goal 0) (set-goal need-stone-goal 0) (set-strategic-number sn-food-gatherer-percentage 45) (set-strategic-number sn-wood-gatherer-percentage 10) (set-strategic-number sn-gold-gatherer-percentage 25) (set-strategic-number sn-stone-gatherer-percentage 20) ) (defrule (goal need-food-goal 0) (goal need-wood-goal 1) (goal need-gold-goal 1) (goal need-stone-goal 1) => (set-goal need-wood-goal 0) (set-goal need-gold-goal 0) (set-goal need-stone-goal 0) (set-strategic-number sn-food-gatherer-percentage 10) (set-strategic-number sn-wood-gatherer-percentage 50) (set-strategic-number sn-gold-gatherer-percentage 25) (set-strategic-number sn-stone-gatherer-percentage 15) ) (defrule (goal need-food-goal 1) (goal need-wood-goal 1) (goal need-gold-goal 1) (goal need-stone-goal 1) => (set-goal need-food-goal 0) (set-goal need-wood-goal 0) (set-goal need-gold-goal 0) (set-goal need-stone-goal 0) (set-strategic-number sn-food-gatherer-percentage 30) (set-strategic-number sn-wood-gatherer-percentage 30) (set-strategic-number sn-gold-gatherer-percentage 20) (set-strategic-number sn-stone-gatherer-percentage 20) )