Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defconst asked-for-help 89)
- ;==========Goals:
- ;1 1= Attacking
- ;3 = Military explorers
- ; ============== GROUPS - most of these will work for any file
- (defrule
- (true);test
- =>
- (set-strategic-number sn-intelligent-gathering 1)
- (set-goal 5 1)
- (set-goal asked-for-help 0)
- (set-strategic-number sn-maximum-hunt-drop-distance 50)
- (disable-self)
- )
- (defrule
- (goal 1 1)
- =>
- (set-strategic-number sn-percent-civilian-explorers 10)
- (set-strategic-number sn-percent-civilian-builders 10)
- (set-strategic-number sn-percent-civilian-gatherers 80)
- (chat-local-to-self "Checking to see if I missed something.")
- (disable-self)
- )
- (defrule
- (goal 1 2)
- =>
- (set-strategic-number sn-percent-civilian-explorers 0)
- (set-strategic-number sn-percent-civilian-builders 15)
- (set-strategic-number sn-percent-civilian-gatherers 85)
- (chat-local-to-self "Let's get on with it!.")
- (disable-self)
- )
- (defrule
- (true)
- =>
- (set-goal 3 3)
- (set-strategic-number sn-maximum-town-size 25)
- (set-strategic-number sn-camp-max-distance 30)
- (set-strategic-number sn-mill-max-distance 30)
- (set-strategic-number sn-percent-enemy-sighted-response 100)
- (set-strategic-number sn-enemy-sighted-response-distance 8) ;(set-strategic-number sn-enemy-sighted-response-distance 100)
- (set-strategic-number sn-blot-exploration-map 1)
- (set-strategic-number sn-percent-attack-soldiers 100)
- (enable-wall-placement 2)
- (set-strategic-number sn-maximum-attack-group-size 200)
- (set-strategic-number sn-number-explore-groups 2)
- (set-strategic-number sn-task-ungrouped-soldiers 0);imperial random
- (set-strategic-number sn-group-form-distance 40)
- (set-strategic-number sn-group-leader-defense-distance 3)
- (disable-self)
- )
- ; ============== ATTACK GROUPS - changing percent attack soldiers will make an AI weak or tough
- (defrule
- (true)
- =>
- (enable-wall-placement 2)
- (set-goal 4 10)
- (set-strategic-number sn-group-commander-selection-method 0)
- (set-strategic-number sn-maximum-boat-attack-group-size 15)
- (set-strategic-number sn-minimum-peace-like-level 50)
- (set-strategic-number sn-minimum-attack-group-size 5)
- (set-strategic-number sn-do-not-scale-for-difficulty-level 1)
- (set-strategic-number sn-attack-intelligence 1)
- (enable-timer 5 300)
- (disable-self)
- )
- ; ================== RESIGNING - resigns if it can't train villagers
- (defrule
- (building-type-count town-center less-than 1)
- (population < 1)
- (unit-type-count villager < 1)
- (not (can-train villager) )
- (building-type-count castle < 1)
- (building-type-count barracks < 1)
- (building-type-count dock < 1)
- (building-type-count stable < 1)
- (building-type-count archery-range < 1)
- =>
- (chat-to-all "Monk! I need a monk!")
- (resign)
- (disable-self)
- )
- ; ============== VILLAGER ASSIGNMENT - most of these will work for any file
- #load-if-not-defined DEATH-MATCH
- (defrule
- (unit-type-count villager >= 12); -total
- =>
- (set-strategic-number sn-enable-boar-hunting 1); boar and deer
- (disable-self)
- )
- (defrule
- (goal 3 3)
- (unit-type-count villager < 1)
- (building-type-count town-center < 1)
- =>
- (set-strategic-number sn-maximum-explore-group-size 200)
- (set-strategic-number sn-minimum-explore-group-size 5)
- (set-strategic-number sn-number-explore-groups 5)
- (set-strategic-number sn-percentage-explore-exterminators 100)
- (enable-timer 2 60)
- (set-goal 3 2)
- (disable-self)
- )
- (defrule
- (goal 3 2)
- (timer-triggered 2)
- =>
- (disable-timer 2)
- (enable-timer 2 60)
- (set-goal 3 1)
- (set-strategic-number sn-maximum-explore-group-size 1)
- (set-strategic-number sn-number-explore-groups 2)
- (set-strategic-number sn-minimum-explore-group-size 1)
- (set-strategic-number sn-percentage-explore-exterminators 50)
- )
- (defrule
- (goal 3 1)
- (timer-triggered 2)
- =>
- (disable-timer 2)
- (enable-timer 2 60)
- (set-goal 3 2)
- (set-strategic-number sn-maximum-explore-group-size 200)
- (set-strategic-number sn-minimum-explore-group-size 5)
- (set-strategic-number sn-number-explore-groups 5)
- (set-strategic-number sn-percentage-explore-exterminators 100)
- )
- (defrule
- (unit-type-count villager < 1)
- (building-type-count town-center < 1)
- =>
- (chat-local-to-self "Roamers")
- (disable-self)
- )
- (defrule
- (unit-type-count villager > 0)
- (building-type-count town-center > 0)
- =>
- (chat-local-to-self "Townsmen")
- (disable-self)
- )
- (defrule
- (unit-type-count villager < 1)
- (building-type-count town-center < 1)
- =>
- (attack-now)
- (enable-timer 8 180)
- (set-strategic-number sn-maximum-explore-group-size 200)
- (set-strategic-number sn-minimum-explore-group-size 25)
- (set-strategic-number sn-number-explore-groups 4)
- (set-strategic-number sn-percentage-explore-exterminators 100)
- (disable-self)
- )
- (defrule
- (timer-triggered 8)
- =>
- (attack-now)
- (disable-self)
- )
- (defrule
- (or
- (unit-type-count villager > 0)
- (building-type-count town-center > 0)
- )
- =>
- (set-strategic-number sn-maximum-explore-group-size 1)
- (set-strategic-number sn-number-explore-groups 2)
- (set-strategic-number sn-minimum-explore-group-size 1)
- (set-strategic-number sn-percentage-explore-exterminators 50)
- (disable-self)
- )
- #end-if
- (defrule
- (current-age == dark-age)
- (unit-type-count villager < 9)
- =>
- (set-strategic-number sn-percent-civilian-explorers 0)
- (set-strategic-number sn-percent-civilian-builders 15)
- (set-strategic-number sn-percent-civilian-gatherers 85)
- (set-strategic-number sn-cap-civilian-explorers 0)
- (set-strategic-number sn-cap-civilian-builders 100)
- (set-strategic-number sn-food-gatherer-percentage 100)
- (set-strategic-number sn-gold-gatherer-percentage 0)
- (set-strategic-number sn-stone-gatherer-percentage 0)
- (set-strategic-number sn-wood-gatherer-percentage 0)
- (set-strategic-number sn-maximum-gold-drop-distance 20)
- (set-strategic-number sn-maximum-stone-drop-distance 20)
- (set-strategic-number sn-maximum-food-drop-distance 20)
- (set-strategic-number sn-maximum-wood-drop-distance 20)
- (disable-self)
- )
- (defrule
- (current-age == dark-age)
- (unit-type-count villager > 8)
- =>
- (set-strategic-number sn-percent-civilian-explorers 0)
- (set-strategic-number sn-percent-civilian-builders 15)
- (set-strategic-number sn-percent-civilian-gatherers 85)
- (set-strategic-number sn-cap-civilian-explorers 0)
- (set-strategic-number sn-cap-civilian-builders 100)
- (set-strategic-number sn-food-gatherer-percentage 75)
- (set-strategic-number sn-gold-gatherer-percentage 0)
- (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 20)
- (set-strategic-number sn-maximum-food-drop-distance 20)
- (disable-self)
- )
- (defrule
- (current-age == dark-age)
- (housing-headroom < 5)
- (not (can-build house))
- (unit-type-count villager > 8)
- =>
- (set-strategic-number sn-percent-civilian-explorers 0)
- (set-strategic-number sn-percent-civilian-builders 15)
- (set-strategic-number sn-percent-civilian-gatherers 85)
- (set-strategic-number sn-cap-civilian-explorers 0)
- (set-strategic-number sn-cap-civilian-builders 100)
- (set-strategic-number sn-food-gatherer-percentage 55)
- (set-strategic-number sn-gold-gatherer-percentage 0)
- (set-strategic-number sn-stone-gatherer-percentage 0)
- (set-strategic-number sn-wood-gatherer-percentage 45)
- (set-strategic-number sn-maximum-gold-drop-distance 20)
- (set-strategic-number sn-maximum-stone-drop-distance 20)
- (set-strategic-number sn-maximum-food-drop-distance 20)
- (disable-self)
- )
- (defrule
- (current-age == dark-age)
- (idle-farm-count < 1)
- (not (can-build farm))
- (unit-type-count villager > 15)
- =>
- (set-strategic-number sn-percent-civilian-explorers 0)
- (set-strategic-number sn-percent-civilian-builders 15)
- (set-strategic-number sn-percent-civilian-gatherers 85)
- (set-strategic-number sn-cap-civilian-explorers 0)
- (set-strategic-number sn-cap-civilian-builders 100)
- (set-strategic-number sn-food-gatherer-percentage 55)
- (set-strategic-number sn-gold-gatherer-percentage 0)
- (set-strategic-number sn-stone-gatherer-percentage 0)
- (set-strategic-number sn-wood-gatherer-percentage 45)
- (set-strategic-number sn-maximum-gold-drop-distance 20)
- (set-strategic-number sn-maximum-stone-drop-distance 20)
- (set-strategic-number sn-maximum-food-drop-distance 20)
- (disable-self)
- )
- (defrule
- (current-age == dark-age)
- (wood-amount > 400)
- (unit-type-count villager > 15)
- =>
- (set-strategic-number sn-percent-civilian-explorers 0)
- (set-strategic-number sn-percent-civilian-builders 15)
- (set-strategic-number sn-percent-civilian-gatherers 85)
- (set-strategic-number sn-cap-civilian-explorers 0)
- (set-strategic-number sn-cap-civilian-builders 100)
- (set-strategic-number sn-food-gatherer-percentage 75)
- (set-strategic-number sn-gold-gatherer-percentage 0)
- (set-strategic-number sn-stone-gatherer-percentage 0)
- (set-strategic-number sn-wood-gatherer-percentage 25)
- (disable-self)
- )
- (defrule
- (current-age == dark-age)
- (or (wood-amount > 800)
- (unit-type-count villager > 35))
- (unit-type-count villager > 15)
- =>
- (set-strategic-number sn-percent-civilian-explorers 0)
- (set-strategic-number sn-percent-civilian-builders 15)
- (set-strategic-number sn-percent-civilian-gatherers 85)
- (set-strategic-number sn-cap-civilian-explorers 0)
- (set-strategic-number sn-cap-civilian-builders 100)
- (set-strategic-number sn-food-gatherer-percentage 95)
- (set-strategic-number sn-gold-gatherer-percentage 0)
- (set-strategic-number sn-stone-gatherer-percentage 0)
- (set-strategic-number sn-wood-gatherer-percentage 5)
- (disable-self)
- )
- (defrule
- (current-age == feudal-age)
- =>
- (set-strategic-number sn-percent-civilian-explorers 0)
- (set-strategic-number sn-percent-civilian-builders 15)
- (set-strategic-number sn-percent-civilian-gatherers 85)
- (set-strategic-number sn-cap-civilian-explorers 0)
- (set-strategic-number sn-cap-civilian-builders 100)
- (set-strategic-number sn-food-gatherer-percentage 45)
- (set-strategic-number sn-gold-gatherer-percentage 25)
- (set-strategic-number sn-stone-gatherer-percentage 0)
- (set-strategic-number sn-wood-gatherer-percentage 30)
- (set-strategic-number sn-maximum-gold-drop-distance 20)
- (set-strategic-number sn-maximum-stone-drop-distance 20)
- (set-strategic-number sn-maximum-food-drop-distance 20)
- (disable-self)
- )
- (defrule
- (current-age == castle-age)
- =>
- (set-strategic-number sn-percent-civilian-explorers 0)
- (set-strategic-number sn-percent-civilian-builders 25);imperial random
- (set-strategic-number sn-percent-civilian-gatherers 75);imperial random
- (set-strategic-number sn-cap-civilian-explorers 0)
- (set-strategic-number sn-cap-civilian-builders 100);imperial random
- (set-strategic-number sn-food-gatherer-percentage 30)
- (set-strategic-number sn-gold-gatherer-percentage 25)
- (set-strategic-number sn-stone-gatherer-percentage 15);imperial random
- (set-strategic-number sn-wood-gatherer-percentage 30);imperial random
- (set-strategic-number sn-maximum-gold-drop-distance 20)
- (set-strategic-number sn-maximum-stone-drop-distance 20)
- (set-strategic-number sn-maximum-food-drop-distance 20)
- (disable-self)
- )
- (defrule
- (current-age == imperial-age)
- (gold-amount < 5000)
- =>
- (set-strategic-number sn-percent-civilian-explorers 0)
- (set-strategic-number sn-percent-civilian-builders 25);imperial random
- (set-strategic-number sn-percent-civilian-gatherers 75);imperial random
- (set-strategic-number sn-cap-civilian-explorers 0)
- (set-strategic-number sn-cap-civilian-builders 100);imperial random
- (set-strategic-number sn-food-gatherer-percentage 30)
- (set-strategic-number sn-gold-gatherer-percentage 25)
- (set-strategic-number sn-stone-gatherer-percentage 15);imperial random
- (set-strategic-number sn-wood-gatherer-percentage 30);imperial random
- (set-strategic-number sn-maximum-gold-drop-distance 20)
- (set-strategic-number sn-maximum-stone-drop-distance 20)
- (set-strategic-number sn-maximum-food-drop-distance 20)
- (disable-self)
- )
- (defrule
- (current-age == imperial-age)
- (gold-amount > 5000)
- =>
- (set-strategic-number sn-percent-civilian-explorers 0)
- (set-strategic-number sn-percent-civilian-builders 75);imperial random
- (set-strategic-number sn-percent-civilian-gatherers 25);imperial random
- (set-strategic-number sn-cap-civilian-explorers 0)
- (set-strategic-number sn-cap-civilian-builders 100);imperial random
- (set-strategic-number sn-food-gatherer-percentage 25)
- (set-strategic-number sn-gold-gatherer-percentage 25)
- (set-strategic-number sn-stone-gatherer-percentage 25);imperial random
- (set-strategic-number sn-wood-gatherer-percentage 25);imperial random
- (set-strategic-number sn-maximum-gold-drop-distance 20)
- (set-strategic-number sn-maximum-stone-drop-distance 20)
- (set-strategic-number sn-maximum-food-drop-distance 20)
- (disable-self)
- )
- (defrule;imperial random
- (current-age == imperial-age)
- =>
- (set-strategic-number sn-retask-gather-amount 0)
- (set-strategic-number sn-build-frequency 1)
- (set-strategic-number sn-scaling-frequency 1)
- (set-strategic-number sn-max-skips-per-attempt 5)
- (disable-self)
- )
- ; ============== COMPUTER CHEATING - In long scenario games, a CP can run out of resources. This magically gives him more. Delete if you don't like your AI to cheat.
- ; ============== ATTACKING -
- (defrule
- (goal 5 1)
- (game-time > 900)
- (not (town-under-attack))
- (military-population > 15)
- (stone-amount < 1000)
- (gold-amount < 2000)
- (food-amount < 4000)
- (wood-amount < 4000)
- =>
- (attack-now)
- (enable-timer 7 600)
- (set-goal asked-for-help 0)
- (disable-self)
- (chat-local-to-self "first attack")
- (chat-to-allies "First official attack.")
- (set-goal 5 2)
- (chat-to-allies "31")
- );died at about 1:39 with the old rules, went to about 1:53
- (defrule
- (goal 5 1)
- (game-time > 550)
- (game-time < 660)
- (military-population > 15)
- (not (town-under-attack))
- (stone-amount > 1000)
- (gold-amount > 2000)
- (food-amount > 4000)
- (wood-amount > 4000)
- =>
- (set-goal asked-for-help 0)
- (attack-now)
- (enable-timer 7 600)
- (disable-self)
- (chat-to-allies "31")
- (chat-to-allies "Care to join me for a sneak attack?")
- (set-goal 5 2)
- )
- (defrule
- (timer-triggered 7)
- (not (town-under-attack))
- (military-population > 24)
- =>
- (set-goal asked-for-help 0)
- (attack-now)
- (disable-timer 7)
- (set-goal 1 1)
- (chat-local-to-self "Massive Magic, GO!")
- (delete-building stone-wall-line)
- (set-strategic-number sn-task-ungrouped-soldiers 0)
- (set-strategic-number sn-number-forward-builders 2)
- (chat-to-allies "I'm attacking with full force!")
- (enable-timer 1 600)
- )
- (defrule
- (timer-triggered 7)
- (or (town-under-attack)
- (military-population < 24))
- =>
- (set-goal asked-for-help 0)
- (disable-timer 7)
- (set-goal 1 1)
- (chat-local-to-self "Cannot attack.")
- (enable-timer 1 600)
- )
- ;(defrule ;what the hell is this shit? ~2016 tal
- ; (goal 1 1)
- ; (not (town-under-attack))
- ; (military-population > 24)
- ;=>
- ; (attack-now)
- ;)
- (defrule
- (town-under-attack)
- (building-type-count castle > 0)
- (can-build watch-tower-line)
- (players-unit-type-count any-enemy trebuchet < 4)
- (players-unit-type-count any-enemy battering-ram-line < 4)
- =>
- (build watch-tower-line)
- )
- (defrule
- (goal 1 1)
- (not (town-under-attack))
- (military-population > 50)
- (can-build barracks)
- (building-type-count barracks > 0)
- (building-type-count barracks < 3)
- =>
- (build-forward barracks)
- )
- (defrule
- (goal 1 1)
- (not (town-under-attack))
- (military-population > 50)
- (can-build archery-range)
- (building-type-count archery-range > 0)
- (building-type-count archery-range < 3)
- =>
- (build-forward archery-range)
- )
- (defrule
- (goal 1 1)
- (not (town-under-attack))
- (military-population > 75)
- (can-build bombard-tower)
- =>
- (build-forward bombard-tower)
- )
- (defrule
- (goal 1 1)
- (not (town-under-attack))
- (military-population > 100)
- =>
- (build-forward watch-tower-line)
- )
- (defrule
- (timer-triggered 1)
- (goal asked-for-help 0)
- =>
- (disable-timer 1)
- (enable-timer 7 600)
- (set-goal 1 2)
- )
- (defrule
- (timer-triggered 1)
- (goal asked-for-help 1)
- (not (town-under-attack))
- =>
- (attack-now)
- (set-goal 1 1)
- (chat-local-to-self "Responding to allied request")
- (set-strategic-number sn-task-ungrouped-soldiers 0)
- (set-strategic-number sn-number-forward-builders 2)
- (chat-to-allies "Gandalf calls for aid!")
- (disable-timer 1)
- (enable-timer 1 600)
- (set-goal asked-for-help 0)
- )
- (defrule
- (timer-triggered 1)
- (goal asked-for-help 1)
- (or (town-under-attack)
- (military-population < 24))
- =>
- (disable-timer 1)
- (enable-timer 1 600)
- (set-goal asked-for-help 0)
- (set-goal 1 2)
- )
- (defrule
- (town-under-attack)
- (goal asked-for-help 0)
- (goal 1 1)
- =>
- (set-goal asked-for-help 1)
- (chat-to-allies "18")
- )
- (defrule
- (taunt-detected any-ally 18)
- (goal asked-for-help 0)
- =>
- (set-goal asked-for-help 1)
- (chat-local-to-self "Shortening attack timer to provide reinforcements.")
- )
- ; ============== ADVANCING IN AGE
- ; Dark to Feudal
- (defrule
- (current-age == dark-age)
- =>
- (set-goal 16 96)
- (disable-self)
- )
- (defrule
- (town-under-attack)
- (current-age == castle-age)
- =>
- (release-escrow food)
- (release-escrow wood)
- (release-escrow gold)
- (release-escrow stone)
- )
- (defrule
- (current-age == dark-age)
- (can-train villager)
- (population < 15)
- (food-amount < 10000)
- =>
- (train villager)
- )
- (defrule
- (can-research-with-escrow feudal-age)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research feudal-age)
- (chat-local-to-self "rising to feudal")
- (set-goal 16 0)
- )
- (defrule
- (can-research feudal-age)
- =>
- (research feudal-age)
- (chat-local-to-self "rising to feudal")
- (set-goal 16 0)
- )
- (defrule
- (current-age == dark-age)
- (can-train villager)
- (population < 50)
- (food-amount < 10000)
- =>
- (train villager)
- )
- ; Feudal to Castle
- (defrule
- (current-age == feudal-age)
- =>
- (set-goal 16 98)
- (disable-self)
- )
- (defrule
- (goal 16 98)
- (wood-amount greater-than 600)
- (gold-amount < 200)
- (can-sell-commodity wood)
- =>
- (chat-local-to-self "selling wood for castle gold")
- (sell-commodity wood)
- )
- (defrule
- (goal 16 98)
- (stone-amount greater-than 99)
- (gold-amount < 300)
- (commodity-selling-price stone greater-than 50)
- (can-sell-commodity stone)
- =>
- (chat-local-to-self "selling stone for castle gold")
- (sell-commodity stone)
- )
- (defrule
- (goal 16 98)
- (food-amount greater-or-equal 1100)
- (gold-amount < 200)
- (can-sell-commodity food)
- =>
- (chat-local-to-self "selling food for castle gold")
- (sell-commodity food)
- )
- (defrule
- (escrow-amount gold > 50)
- (goal 16 98)
- =>
- (release-escrow gold)
- )
- ;getting needed food
- (defrule
- (goal 16 98)
- (gold-amount greater-or-equal 330)
- (food-amount < 800)
- (can-buy-commodity food)
- =>
- (chat-local-to-self "buying castle food")
- (buy-commodity food)
- )
- ; advance to castle age if possible.
- (defrule
- (can-research-with-escrow castle-age)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research castle-age)
- (chat-local-to-self "rising to castle")
- (set-goal 16 0)
- )
- (defrule
- (can-research castle-age)
- =>
- (research castle-age)
- (chat-local-to-self "rising to castle")
- (set-goal 16 0)
- )
- ; Castle to Imperial
- (defrule
- (current-age == castle-age)
- =>
- (set-goal 16 99)
- (disable-self)
- )
- (defrule
- (goal 16 99)
- (wood-amount greater-than 300)
- (gold-amount < 800)
- (can-sell-commodity wood)
- =>
- (chat-local-to-self "selling wood for imperial gold")
- (sell-commodity wood)
- )
- (defrule
- (goal 16 99)
- (gold-amount greater-than 900)
- (food-amount < 1000)
- (can-buy-commodity food)
- =>
- (chat-local-to-self "buying food for imperial ... food")
- (buy-commodity food)
- )
- (defrule
- (goal 16 99)
- (building-type-count castle > 0)
- (stone-amount greater-than 300)
- (commodity-selling-price stone greater-than 30)
- (can-sell-commodity stone)
- =>
- (chat-local-to-self "selling stone for imperial gold")
- (sell-commodity stone)
- )
- (defrule
- (goal 16 99)
- (stone-amount greater-than 850)
- (commodity-selling-price stone greater-than 30)
- (can-sell-commodity stone)
- =>
- (chat-local-to-self "selling stone for imperial gold")
- (sell-commodity stone)
- )
- (defrule
- (goal 16 99)
- (food-amount greater-or-equal 1200)
- (can-sell-commodity food)
- (gold-amount < 800)
- =>
- (chat-local-to-self "selling food for imperial gold")
- (sell-commodity food)
- )
- ;getting needed food
- (defrule
- (goal 16 99)
- (gold-amount greater-or-equal 1000)
- (food-amount < 1000)
- (can-buy-commodity food)
- =>
- (chat-local-to-self "buying imperial food")
- (buy-commodity food)
- )
- ; advance to imperial age if possible.
- (defrule
- (can-research-with-escrow imperial-age)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research imperial-age)
- (chat-local-to-self "rising to imperial")
- (set-goal 16 0)
- (set-escrow-percentage wood 15)
- (set-escrow-percentage food 45)
- (set-escrow-percentage gold 45)
- (set-escrow-percentage stone 15)
- )
- (defrule
- (can-research imperial-age)
- =>
- (chat-local-to-self "rising to imperial")
- (set-goal 16 0)
- (set-escrow-percentage wood 15)
- (set-escrow-percentage food 45)
- (set-escrow-percentage gold 45)
- (set-escrow-percentage stone 15)
- )
- ; ============== BUILD LISTS
- (defrule
- (building-type-count town-center < 1)
- =>
- (build town-center)
- )
- (defrule
- (building-type-count town-center < 1)
- =>
- (build town-center)
- )
- (defrule
- (building-type-count town-center < 1)
- =>
- (build town-center)
- )
- #load-if-defined NOMAD-MAP
- (defrule
- (game-time < 60)
- (military-population < 6)
- (building-type-count town-center < 1)
- =>
- (set-strategic-number sn-percent-civilian-explorers 100)
- (set-strategic-number sn-percent-civilian-builders 0)
- (set-strategic-number sn-percent-civilian-gatherers 0)
- (set-strategic-number sn-cap-civilian-explorers 100)
- (set-strategic-number sn-cap-civilian-gatherers 0)
- (chat-local-to-self "Explore")
- (disable-self)
- )
- (defrule
- (resource-found gold)
- (resource-found food)
- (resource-found wood)
- (resource-found stone)
- (building-type-count town-center < 1)
- (civilian-population > 2)
- =>
- (build town-center)
- (set-strategic-number sn-percent-civilian-explorers 0)
- (set-strategic-number sn-percent-civilian-builders 15)
- (set-strategic-number sn-percent-civilian-gatherers 85)
- (set-strategic-number sn-cap-civilian-explorers 0)
- (set-strategic-number sn-cap-civilian-gatherers 100)
- (chat-local-to-self "Settling down")
- (disable-self)
- )
- (defrule
- (game-time greater-than 150)
- (building-type-count town-center less-than 1)
- (can-build town-center)
- =>
- (set-strategic-number sn-percent-civilian-explorers 0)
- (set-strategic-number sn-percent-civilian-builders 15)
- (set-strategic-number sn-percent-civilian-gatherers 85)
- (set-strategic-number sn-cap-civilian-explorers 0)
- (set-strategic-number sn-cap-civilian-gatherers 100)
- (build town-center)
- (chat-local-to-self "Settling down now...")
- )
- #end-if
- (defrule;imperial random
- (unit-type-count villager greater-than 15)
- (housing-headroom < 10)
- (population-headroom less-than 1)
- =>
- (delete-unit villager)
- )
- (defrule
- (not (current-age == dark-age))
- (unit-type-count villager < 30);imperial random
- (population < 175)
- (can-train villager)
- =>
- (train villager)
- )
- (defrule
- (not (current-age == dark-age))
- (not (town-under-attack))
- (unit-type-count villager > 30)
- (unit-type-count villager less-than 80);imperial random
- (population < 175)
- (can-train villager)
- =>
- (train villager)
- )
- ;DESPERATE FOR GOLD
- (defrule
- (or (or (or (wood-amount > 400)
- (food-amount > 400))
- (wood-amount > 600))
- (food-amount > 600))
- (population > 100)
- (gold-amount < 200)
- (unit-type-count trade-cart < 50)
- (can-train-with-escrow trade-cart)
- (players-building-type-count any-ally market > 0)
- =>
- (release-escrow gold)
- (train trade-cart);Builds infinite trade carts until there are plenty
- )
- ;maintain housing
- (defrule
- (housing-headroom less-than 6)
- (population-headroom greater-than 0)
- (can-build house)
- =>
- (build house)
- )
- (defrule;imperial random
- (unit-type-count villager greater-than 15)
- (housing-headroom < 10)
- (population-headroom less-than 1)
- =>
- (delete-unit villager)
- )
- ;maintain a town center
- (defrule
- (game-time greater-than 150)
- (building-type-count town-center less-than 1)
- (can-build town-center)
- =>
- (build town-center)
- )
- (defrule
- (building-type-count castle < 1);imperial random
- (can-build castle)
- (building-type-count town-center > 0)
- =>
- (build castle)
- )
- (defrule
- (building-type-count market less-than 1)
- (or (or (or (or (building-type-count barracks > 0)
- (and (stone-amount > 600)
- (gold-amount < 100)))
- (and (gold-amount > 600)
- (wood-amount < 100)))
- (and (gold-amount > 600)
- (food-amount < 100)))
- (game-time >= 1200))
- (can-build market)
- (not (current-age == imperial-age))
- =>
- (build market)
- )
- (defrule
- (building-type-count market less-than 1)
- (can-build-with-escrow market)
- (game-time >= 1200)
- (not (current-age == imperial-age))
- =>
- (release-escrow wood)
- (build market)
- )
- (defrule
- (building-type-count archery-range less-than 1)
- (current-age == castle-age)
- (can-build-with-escrow archery-range)
- =>
- (release-escrow wood)
- (build archery-range)
- (disable-self)
- )
- (defrule
- (building-type-count barracks < 1)
- (or (or (or (current-age > dark-age)
- (game-time > 900))
- (town-under-attack))
- (wood-amount > 300))
- (can-build barracks)
- =>
- (build barracks)
- )
- (defrule
- (building-type-count archery-range less-than 1)
- (building-type-count barracks > 0)
- (can-build-with-escrow archery-range)
- =>
- (release-escrow wood)
- (build archery-range)
- )
- (defrule
- (or
- (game-time > 900)
- (or
- (building-type-count barracks > 0)
- (wood-amount > 1000)
- )
- )
- (building-type-count archery-range less-than 1)
- (can-build archery-range)
- =>
- (build archery-range)
- )
- (defrule;imperial random
- (building-type-count dock < 1);imperial deathmatch
- (can-build dock)
- (or
- (building-type-count barracks > 0)
- (wood-amount > 500)
- )
- =>
- (build dock)
- )
- ;maintain 3 town centers
- (defrule
- (current-age == castle-age)
- (building-type-count town-center less-than 3)
- (can-build-with-escrow town-center)
- =>
- (release-escrow stone)
- (release-escrow wood)
- (build town-center)
- )
- ;maintain 3 town centers
- (defrule;imperial random
- (game-time greater-than 45);imperial random
- (food-amount > 400);imperial random
- (building-type-count town-center less-than 3);imperial random
- (can-build town-center)
- =>
- (build town-center)
- )
- ;alternate lumber camp
- (defrule;imperial random
- (building-type-count lumber-camp < 2);imperial random
- (game-time > 1200)
- (can-build lumber-camp)
- =>
- (build lumber-camp)
- )
- (defrule;imperial random
- (building-type-count mining-camp < 3);imperial random
- (or (game-time > 900)
- (current-age > dark-age))
- (can-build mining-camp)
- (or (resource-found gold)
- (resource-found stone))
- =>
- (build mining-camp)
- )
- (defrule;imperial deathmatch
- (stone-amount > 500)
- (game-time > 300)
- (building-type-count castle > 0)
- =>
- (build-wall 2 stone-wall-line)
- (build-gate 2)
- )
- (defrule;imperial deathmatch
- (true)
- =>
- (build-gate 2)
- )
- (defrule
- (current-age > dark-age)
- (building-type-count barracks less-than 1)
- (can-build barracks)
- =>
- (build barracks)
- )
- ;(defrule;Moved in imperial Random
- ; (building-type-count archery-range less-than 1)
- ; (can-build archery-range)
- ;=>
- ; (build archery-range)
- ;)
- (defrule
- (building-type-count stable less-than 1)
- (or
- (game-time > 900)
- (or
- (building-type-count barracks > 0)
- (wood-amount > 1000)
- )
- )
- (can-build stable)
- =>
- (build stable)
- )
- (defrule
- (building-type-count monastery less-than 1)
- (can-build monastery)
- =>
- (build monastery)
- )
- (defrule
- (building-type-count siege-workshop less-than 1)
- (can-build siege-workshop)
- =>
- (build siege-workshop)
- )
- (defrule;Lower Priority
- (building-type-count market less-than 1)
- (can-build market)
- (or
- (and (and (building-type-count archery-range > 0)
- (building-type-count stable > 0))
- (building-type-count barracks > 0))
- (game-time > 1200))
- =>
- (build market)
- )
- (defrule;imperial random
- (building-type-count castle < 4);imperial random
- (can-build castle)
- (building-type-count town-center > 0)
- =>
- (build castle)
- )
- (defrule
- (wood-amount > 1000)
- (building-type-count archery-range less-than 3)
- (can-build archery-range)
- =>
- (build archery-range)
- )
- (defrule
- (wood-amount > 1000)
- (building-type-count barracks less-than 3)
- (can-build barracks)
- =>
- (build barracks)
- )
- (defrule
- (wood-amount > 1000)
- (building-type-count stable less-than 3)
- (can-build stable)
- =>
- (build stable)
- )
- (defrule
- (wood-amount > 750)
- (building-type-count monastery less-than 3)
- (can-build monastery)
- =>
- (build monastery)
- )
- (defrule;imperial random
- (building-type-count dock < 4);imperial deathmatch
- (building-type-count market > 0)
- (can-build dock)
- =>
- (build dock)
- )
- (defrule
- (building-type-count blacksmith less-than 1)
- (current-age == feudal-age)
- (building-type-count market > 0);imperial random
- (building-type-count stable > 0)
- (building-type-count archery-range > 0)
- (can-build-with-escrow blacksmith)
- =>
- (release-escrow wood)
- (build blacksmith)
- )
- (defrule
- (building-type-count blacksmith less-than 1)
- (or
- (current-age == feudal-age)
- (building-type-count barracks > 0);imperial random
- )
- (can-build blacksmith)
- (or
- (not (building-available market))
- (building-type-count market > 0);imperial random
- )
- =>
- (build blacksmith)
- )
- (defrule
- (building-type-count university less-than 1)
- (can-build university)
- (wood-amount greater-than 250);imperial random
- =>
- (build university)
- )
- (defrule
- (building-type-count monastery less-than 1)
- (can-build monastery)
- =>
- (build monastery)
- )
- (defrule
- (building-type-count farm less-than 4)
- (wood-amount > 250)
- (building-type-count archery-range > 0);imperial random
- (can-build farm)
- =>
- (build farm)
- )
- (defrule;always have farms
- (or
- (current-age == feudal-age)
- (current-age == dark-age)
- )
- (idle-farm-count < 1);imperial random
- (can-build farm)
- =>
- (build farm)
- )
- (defrule
- (wood-amount greater-than 160) ;imperial random
- (idle-farm-count < 1);imperial random
- (can-build farm)
- =>
- (build farm)
- )
- (defrule
- (resource-found food)
- (building-type-count mill less-than 1)
- =>
- (build mill)
- )
- (defrule
- (resource-found wood)
- (unit-type-count villager > 8)
- (building-type-count lumber-camp < 1)
- (can-build lumber-camp)
- =>
- (build lumber-camp)
- )
- (defrule
- (unit-type-count fishing-ship > 3)
- (building-type-count fish-trap < 5)
- (can-build fish-trap)
- =>
- (build fish-trap)
- )
- (defrule
- (resource-found wood)
- (building-type-count lumber-camp < 5)
- (dropsite-min-distance wood > 5)
- (can-build lumber-camp)
- (unit-type-count villager > 8)
- (dropsite-min-distance wood >= 6)
- =>
- (build lumber-camp)
- )
- (defrule
- (resource-found wood)
- (building-type-count lumber-camp < 5)
- (dropsite-min-distance wood > 20)
- (can-build lumber-camp)
- (dropsite-min-distance wood >= 6)
- =>
- (build lumber-camp)
- )
- (defrule
- (building-type-count lumber-camp >= 5)
- =>
- (delete-building lumber-camp)
- )
- (defrule
- (building-type-count mining-camp >= 5)
- =>
- (delete-building mining-camp)
- )
- (defrule
- (resource-found gold)
- (building-type-count mining-camp < 5)
- (dropsite-min-distance gold > 5)
- (building-type-count mill > 0)
- (or (game-time > 900)
- (current-age > dark-age))
- =>
- (build mining-camp)
- )
- (defrule
- (resource-found stone)
- (building-type-count mining-camp < 5)
- (dropsite-min-distance stone > 5)
- (can-build mining-camp)
- (or (game-time > 900)
- (current-age > dark-age))
- =>
- (build mining-camp)
- )
- ;Towers Imperial deathmatch
- ;#load-if-defined VICTORY-STANDARD
- ;(defrule;imperial random
- ; (building-type-count castle > 3);imperial random
- ; (can-build wonder)
- ; (not (goal 2 7))
- ; (game-time > 1200)
- ; (building-type-count wonder < 1)
- ; (population-headroom < 1)
- ; (not (town-under-attack))
- ;=>
- ; (build wonder)
- ;)
- ;#end-if
- (defrule
- (building-type-count bombard-tower < 5)
- (can-build bombard-tower)
- =>
- (build bombard-tower)
- )
- (defrule
- (game-time > 300)
- (building-type-count castle > 3)
- (stone-amount > 750)
- (can-build bombard-tower)
- =>
- (build bombard-tower)
- )
- (defrule
- (game-time > 600)
- (stone-amount > 1500)
- (can-build castle)
- =>
- (build castle)
- )
- (defrule
- (players-civ any-enemy korean)
- (building-type-count dock > 0)
- (building-type-count bombard-tower < 5)
- (stone-amount > 750)
- (can-build bombard-tower)
- =>
- (build bombard-tower)
- )
- (defrule
- (game-time > 300)
- (building-type-count castle > 4)
- (stone-amount > 750)
- (can-build watch-tower-line)
- =>
- (build watch-tower-line)
- )
- ; ============== MILITARY UNITS
- (defrule
- (not (town-under-attack))
- (military-population > 15)
- (unit-type-count battering-ram-line < 1)
- (can-train-with-escrow battering-ram-line)
- =>
- (release-escrow wood)
- (release-escrow gold)
- (train battering-ram-line)
- )
- (defrule
- (unit-type-count trade-cart < 10)
- (wood-amount > 500)
- (gold-amount < 500)
- (unit-type-count villager < 10)
- (can-train trade-cart)
- =>
- (train trade-cart)
- )
- (defrule
- (unit-type-count eagle-warrior-line < 10)
- (food-amount > 200)
- (gold-amount > 200)
- (can-train eagle-warrior-line)
- =>
- (train eagle-warrior-line)
- )
- (defrule
- (unit-type-count missionary < 10)
- (gold-amount > 200)
- (can-train missionary)
- =>
- (train missionary)
- )
- (defrule
- (unit-type-count longboat-line < 10)
- (food-amount > 200)
- (gold-amount > 200)
- (can-train longboat-line)
- =>
- (train longboat-line)
- )
- (defrule
- (unit-type-count turtle-ship-line < 10)
- (food-amount > 200)
- (gold-amount > 200)
- (can-train turtle-ship-line)
- =>
- (train turtle-ship-line)
- )
- (defrule
- (unit-type-count knight-line < 12)
- (food-amount > 200)
- (gold-amount > 200)
- (can-train knight-line)
- =>
- (train knight-line)
- )
- (defrule
- (unit-type-count villager > 25)
- (not (current-age == dark-age))
- (not (current-age == imperial-age))
- (unit-type-count skirmisher-line < 15)
- (can-train skirmisher-line)
- =>
- (train skirmisher-line)
- )
- (defrule
- (unit-type-count villager > 25)
- (not (current-age == dark-age))
- (not (current-age == imperial-age))
- (unit-type-count militiaman-line < 15)
- (can-train militiaman-line)
- =>
- (train militiaman-line)
- )
- (defrule
- (not (current-age == dark-age))
- (unit-type-count spearman-line < 7)
- (can-train spearman-line)
- (food-amount > 200)
- (wood-amount > 200)
- =>
- (train spearman-line)
- )
- (defrule
- (not (current-age == dark-age))
- (unit-type-count militiaman-line < 5)
- (can-train militiaman-line)
- (food-amount > 200)
- (gold-amount > 200)
- =>
- (train militiaman-line)
- )
- (defrule
- (not (current-age == dark-age))
- (not (current-age == feudal-age))
- (unit-type-count spearman-line < 15)
- (can-train spearman-line)
- (food-amount > 200)
- (wood-amount > 200)
- =>
- (train spearman-line)
- )
- (defrule
- (not (current-age == dark-age))
- (not (current-age == feudal-age))
- (unit-type-count militiaman-line < 10)
- (can-train militiaman-line)
- (food-amount > 200)
- (gold-amount > 200)
- =>
- (train militiaman-line)
- )
- (defrule
- (not (current-age == dark-age))
- (unit-type-count skirmisher-line < 7)
- (can-train skirmisher-line)
- (food-amount > 200)
- (wood-amount > 200)
- =>
- (train skirmisher-line)
- )
- (defrule
- (unit-type-count scout-cavalry-line < 1)
- (can-train scout-cavalry-line)
- (food-amount > 200)
- =>
- (train scout-cavalry-line)
- )
- (defrule
- (not (current-age == dark-age))
- (unit-type-count archer-line < 7)
- (can-train archer-line)
- (gold-amount > 200)
- (wood-amount > 200)
- =>
- (train archer-line)
- )
- (defrule
- (not (current-age == dark-age))
- (not (current-age == feudal-age))
- (unit-type-count archer-line < 15)
- (can-train archer-line)
- (gold-amount > 200)
- (wood-amount > 200)
- =>
- (train archer-line)
- )
- (defrule
- (not (current-age == dark-age))
- (not (current-age == feudal-age))
- (unit-type-count skirmisher-line < 15)
- (can-train skirmisher-line)
- (food-amount > 200)
- (wood-amount > 200)
- =>
- (train skirmisher-line)
- )
- (defrule
- (unit-type-count my-unique-unit-line < 8)
- (can-train my-unique-unit-line)
- (food-amount > 200)
- (gold-amount > 200)
- =>
- (train my-unique-unit-line)
- )
- (defrule
- (not (town-under-attack))
- (unit-type-count my-unique-unit-line < 64)
- (not (civ-selected persian))
- (can-train my-unique-unit-line)
- (food-amount > 4000)
- (gold-amount > 2000)
- (building-type-count castle > 3)
- =>
- (train my-unique-unit-line)
- )
- (defrule
- (not (town-under-attack))
- (unit-type-count my-unique-unit-line < 32)
- (civ-selected persian)
- (can-train my-unique-unit-line)
- (food-amount > 4000)
- (gold-amount > 2000)
- (building-type-count castle > 3)
- =>
- (train my-unique-unit-line)
- )
- ;defrule
- ; (players-unit-type-count any-enemy chu-ko-nu-line > 40)
- ; (wood-amount > 500)
- ; (gold-amount > 500)
- ;=>
- ; (build siege-workshop)
- ; (train mangonel-line)
- ;)
- (defrule
- (unit-type-count trebuchet < 3)
- (can-train trebuchet)
- =>
- (train trebuchet)
- )
- (defrule
- (unit-type-count monk < 6)
- (can-train monk)
- (gold-amount > 200)
- =>
- (train monk)
- )
- (defrule
- (not (town-under-attack))
- (unit-type-count battering-ram-line < 4)
- (can-train battering-ram-line)
- (gold-amount > 200)
- (wood-amount > 200)
- =>
- (train battering-ram-line)
- )
- (defrule
- (unit-type-count mangonel-line < 1)
- (can-train mangonel-line)
- (wood-amount > 200)
- (gold-amount > 200)
- =>
- (train my-unique-unit-line)
- )
- (defrule
- (unit-type-count transport-ship < 1)
- (wood-amount > 200)
- (gold-amount > 200)
- (can-train transport-ship)
- =>
- (train transport-ship)
- )
- (defrule
- (unit-type-count demolition-ship-line < 10)
- (wood-amount > 150)
- (gold-amount > 2000)
- (wood-amount > 4000)
- (can-train demolition-ship-line)
- =>
- (train demolition-ship-line)
- )
- (defrule
- (unit-type-count fishing-ship < 5)
- (wood-amount > 200)
- (gold-amount > 200)
- (can-train fishing-ship)
- =>
- (train fishing-ship)
- )
- (defrule
- (unit-type-count transport-ship < 1)
- (wood-amount > 200)
- (gold-amount > 200)
- (can-train transport-ship)
- =>
- (train transport-ship)
- )
- (defrule
- (unit-type-count fire-ship-line < 8)
- (wood-amount > 200)
- (gold-amount > 200)
- (can-train fire-ship-line)
- =>
- (train fire-ship-line)
- )
- (defrule
- (unit-type-count galley-line < 6)
- (wood-amount > 200)
- (gold-amount > 200)
- (can-train galley-line)
- =>
- (train galley-line)
- )
- (defrule
- (unit-type-count cannon-galleon-line < 4)
- (wood-amount > 200)
- (gold-amount > 200)
- (can-train cannon-galleon-line)
- =>
- (train cannon-galleon-line)
- )
- (defrule
- (unit-type-count transport-ship < 2)
- (wood-amount > 400)
- (gold-amount > 400)
- (can-train transport-ship)
- =>
- (train transport-ship)
- )
- (defrule
- (unit-type-count fire-ship-line < 16)
- (wood-amount > 400)
- (gold-amount > 400)
- (can-train fire-ship-line)
- =>
- (train fire-ship-line)
- )
- (defrule
- (unit-type-count galley-line < 12)
- (wood-amount > 400)
- (gold-amount > 400)
- (can-train galley-line)
- =>
- (train galley-line)
- )
- (defrule
- (unit-type-count cannon-galleon-line < 8)
- (wood-amount > 400)
- (gold-amount > 400)
- (can-train cannon-galleon-line)
- =>
- (train cannon-galleon-line)
- )
- ;Second Runthrough;imperial random
- (defrule
- (unit-type-count knight-line < 24)
- (food-amount > 200)
- (gold-amount > 200)
- (can-train knight-line)
- =>
- (train knight-line)
- )
- (defrule
- (not (current-age == dark-age))
- (not (current-age == feudal-age))
- (not (current-age == castle-age))
- (unit-type-count militiaman-line < 20)
- (can-train militiaman-line)
- (food-amount > 200)
- (gold-amount > 200)
- =>
- (train militiaman-line)
- )
- (defrule
- (not (current-age == dark-age))
- (not (current-age == feudal-age))
- (unit-type-count scout-cavalry-line < 2)
- (can-train scout-cavalry-line)
- (food-amount > 200)
- =>
- (train scout-cavalry-line)
- )
- (defrule
- (not (current-age == dark-age))
- (not (current-age == feudal-age))
- (not (current-age == castle-age))
- (unit-type-count archer-line < 30)
- (can-train archer-line)
- (gold-amount > 200)
- (wood-amount > 200)
- =>
- (train archer-line)
- )
- (defrule
- (not (current-age == dark-age))
- (not (current-age == feudal-age))
- (not (current-age == castle-age))
- (unit-type-count spearman-line < 30)
- (can-train spearman-line)
- (food-amount > 200)
- (wood-amount > 200)
- =>
- (train spearman-line)
- )
- (defrule
- (not (current-age == dark-age))
- (not (current-age == feudal-age))
- (not (current-age == castle-age))
- (unit-type-count skirmisher-line < 30)
- (can-train skirmisher-line)
- (food-amount > 200)
- (wood-amount > 200)
- =>
- (train skirmisher-line)
- )
- (defrule
- (unit-type-count my-unique-unit-line < 16)
- (can-train my-unique-unit-line)
- (food-amount > 200)
- (gold-amount > 200)
- =>
- (train my-unique-unit-line)
- )
- (defrule
- (unit-type-count trebuchet < 6)
- (can-train trebuchet)
- =>
- (train trebuchet)
- )
- (defrule
- (unit-type-count monk < 15)
- (can-train monk)
- (gold-amount > 200)
- =>
- (train monk)
- )
- (defrule
- (unit-type-count missionary < 20)
- (gold-amount > 200)
- (can-train missionary)
- =>
- (train missionary)
- )
- (defrule
- (unit-type-count eagle-warrior-line < 20)
- (food-amount > 200)
- (gold-amount > 200)
- (can-train eagle-warrior-line)
- =>
- (train eagle-warrior-line)
- )
- (defrule
- (unit-type-count longboat-line < 20)
- (food-amount > 200)
- (gold-amount > 200)
- (can-train longboat-line)
- =>
- (train longboat-line)
- )
- (defrule
- (unit-type-count turtle-ship-line < 20)
- (food-amount > 200)
- (gold-amount > 200)
- (can-train turtle-ship-line)
- =>
- (train turtle-ship-line)
- )
- (defrule
- (not (town-under-attack))
- (unit-type-count scorpion-line < 8)
- (can-train scorpion-line)
- (gold-amount > 200)
- (wood-amount > 200)
- =>
- (train scorpion-line)
- )
- (defrule
- (unit-type-count transport-ship < 3)
- (wood-amount > 200)
- (gold-amount > 200)
- (can-train transport-ship)
- =>
- (train transport-ship)
- )
- (defrule
- (unit-type-count fire-ship-line < 12)
- (wood-amount > 200)
- (gold-amount > 200)
- (can-train fire-ship-line)
- =>
- (train fire-ship-line)
- )
- (defrule
- (unit-type-count galley-line < 12)
- (wood-amount > 200)
- (gold-amount > 200)
- (can-train galley-line)
- =>
- (train galley-line)
- )
- (defrule
- (unit-type-count cannon-galleon-line < 12)
- (wood-amount > 200)
- (gold-amount > 200)
- (can-train cannon-galleon-line)
- =>
- (train cannon-galleon-line)
- )
- (defrule
- (unit-type-count transport-ship < 4)
- (wood-amount > 200)
- (gold-amount > 200)
- (can-train transport-ship)
- =>
- (train transport-ship)
- )
- (defrule
- (unit-type-count fire-ship-line < 16)
- (wood-amount > 200)
- (gold-amount > 200)
- (can-train fire-ship-line)
- =>
- (train fire-ship-line)
- )
- (defrule
- (unit-type-count galley-line < 16)
- (wood-amount > 200)
- (gold-amount > 200)
- (can-train galley-line)
- =>
- (train galley-line)
- )
- (defrule
- (unit-type-count cannon-galleon-line < 16)
- (wood-amount > 200)
- (gold-amount > 200)
- (can-train cannon-galleon-line)
- =>
- (train cannon-galleon-line)
- )
- ;superpop
- ; ============== ADDED BUILD LISTS
- ;superhousing
- (defrule
- (housing-headroom less-than 16)
- (population-headroom greater-than 0)
- (can-build house)
- (population > 50)
- =>
- (build house)
- )
- (defrule
- (unit-type-count villager less-than 200);imperial random
- (population < 438)
- (food-amount > 100)
- (can-train villager)
- (military-population >= 35)
- =>
- (train villager)
- )
- ;upgrade to 6 town centers if possible for super villager spam
- (defrule;imperial random
- (game-time greater-than 45);imperial random
- (food-amount > 1000);imperial random
- (military-population >= 70)
- (unit-type-count villager less-than 40)
- (building-type-count town-center less-than 6);imperial random
- (can-build town-center)
- =>
- (build town-center)
- )
- (defrule
- (wood-amount > 1000)
- (building-type-count siege-workshop less-than 2)
- (can-build siege-workshop)
- =>
- (build siege-workshop)
- )
- (defrule
- (wood-amount > 1000)
- (building-type-count archery-range less-than 6)
- (can-build archery-range)
- =>
- (build archery-range)
- )
- (defrule
- (wood-amount > 1000)
- (building-type-count barracks less-than 6)
- (can-build barracks)
- =>
- (build barracks)
- )
- (defrule
- (wood-amount > 1000)
- (building-type-count stable less-than 6)
- (can-build stable)
- =>
- (build stable)
- )
- (defrule
- (players-civ any-enemy korean)
- (building-type-count dock > 0)
- (building-type-count bombard-tower < 10)
- (stone-amount > 750)
- (can-build bombard-tower)
- =>
- (build bombard-tower)
- )
- ; ============== MILITARY UNITS
- (defrule
- (unit-type-count trade-cart < 25)
- (wood-amount > 1250)
- (gold-amount < 1250)
- (unit-type-count villager < 10)
- (can-train trade-cart)
- =>
- (train trade-cart)
- )
- (defrule
- (unit-type-count eagle-warrior-line < 25)
- (food-amount > 500)
- (gold-amount > 500)
- (can-train eagle-warrior-line)
- =>
- (train eagle-warrior-line)
- )
- (defrule
- (unit-type-count missionary < 25)
- (gold-amount > 500)
- (can-train missionary)
- =>
- (train missionary)
- )
- (defrule
- (unit-type-count longboat-line < 25)
- (food-amount > 500)
- (gold-amount > 500)
- (can-train longboat-line)
- =>
- (train longboat-line)
- )
- (defrule
- (not (town-under-attack))
- (unit-type-count my-unique-unit-line < 160)
- (not (civ-selected persian))
- (can-train my-unique-unit-line)
- (food-amount > 4000)
- (gold-amount > 2000)
- (building-type-count castle > 3)
- =>
- (train my-unique-unit-line)
- )
- (defrule
- (not (town-under-attack))
- (unit-type-count my-unique-unit-line < 80)
- (civ-selected persian)
- (can-train my-unique-unit-line)
- (food-amount > 4000)
- (gold-amount > 2000)
- (building-type-count castle > 3)
- =>
- (train my-unique-unit-line)
- )
- (defrule
- (not (town-under-attack))
- (unit-type-count battering-ram-line < 10)
- (can-train battering-ram-line)
- (gold-amount > 500)
- (wood-amount > 500)
- =>
- (train battering-ram-line)
- )
- (defrule
- (unit-type-count mangonel-line < 3)
- (can-train mangonel-line)
- (wood-amount > 500)
- (gold-amount > 500)
- =>
- (train my-unique-unit-line)
- )
- (defrule
- (unit-type-count demolition-ship-line < 10)
- (wood-amount > 375)
- (gold-amount > 2000)
- (wood-amount > 8000)
- (can-train demolition-ship-line)
- =>
- (train demolition-ship-line)
- )
- (defrule
- (unit-type-count fishing-ship < 13)
- (wood-amount > 500)
- (gold-amount > 500)
- (can-train fishing-ship)
- =>
- (train fishing-ship)
- )
- ;Second Runthrough;imperial random
- (defrule
- (unit-type-count knight-line < 60)
- (food-amount > 500)
- (gold-amount > 500)
- (can-train knight-line)
- =>
- (train knight-line)
- )
- (defrule
- (not (current-age == dark-age))
- (not (current-age == feudal-age))
- (not (current-age == castle-age))
- (unit-type-count militiaman-line < 50)
- (can-train militiaman-line)
- (food-amount > 500)
- (gold-amount > 500)
- =>
- (train militiaman-line)
- )
- (defrule
- (not (current-age == dark-age))
- (not (current-age == feudal-age))
- (unit-type-count scout-cavalry-line < 5)
- (can-train scout-cavalry-line)
- (food-amount > 500)
- =>
- (train scout-cavalry-line)
- )
- (defrule
- (not (current-age == dark-age))
- (not (current-age == feudal-age))
- (not (current-age == castle-age))
- (unit-type-count archer-line < 75)
- (can-train archer-line)
- (gold-amount > 500)
- (wood-amount > 500)
- =>
- (train archer-line)
- )
- (defrule
- (not (current-age == dark-age))
- (not (current-age == feudal-age))
- (not (current-age == castle-age))
- (unit-type-count spearman-line < 75)
- (can-train spearman-line)
- (food-amount > 500)
- (wood-amount > 500)
- =>
- (train spearman-line)
- )
- (defrule
- (not (current-age == dark-age))
- (not (current-age == feudal-age))
- (not (current-age == castle-age))
- (unit-type-count skirmisher-line < 75)
- (can-train skirmisher-line)
- (food-amount > 500)
- (wood-amount > 500)
- =>
- (train skirmisher-line)
- )
- (defrule
- (unit-type-count my-unique-unit-line < 40)
- (can-train my-unique-unit-line)
- (food-amount > 500)
- (gold-amount > 500)
- =>
- (train my-unique-unit-line)
- )
- (defrule
- (unit-type-count trebuchet < 15)
- (can-train trebuchet)
- =>
- (train trebuchet)
- )
- (defrule
- (unit-type-count monk < 38)
- (can-train monk)
- (gold-amount > 500)
- =>
- (train monk)
- )
- (defrule
- (unit-type-count missionary < 50)
- (gold-amount > 500)
- (can-train missionary)
- =>
- (train missionary)
- )
- (defrule
- (unit-type-count eagle-warrior-line < 50)
- (food-amount > 500)
- (gold-amount > 500)
- (can-train eagle-warrior-line)
- =>
- (train eagle-warrior-line)
- )
- (defrule
- (unit-type-count longboat-line < 50)
- (food-amount > 500)
- (gold-amount > 500)
- (can-train longboat-line)
- =>
- (train longboat-line)
- )
- (defrule
- (unit-type-count turtle-ship-line < 50)
- (food-amount > 500)
- (gold-amount > 500)
- (can-train turtle-ship-line)
- =>
- (train turtle-ship-line)
- )
- (defrule
- (not (town-under-attack))
- (unit-type-count scorpion-line < 20)
- (can-train scorpion-line)
- (gold-amount > 500)
- (wood-amount > 500)
- =>
- (train scorpion-line)
- )
- (defrule
- (unit-type-count transport-ship < 10)
- (wood-amount > 500)
- (gold-amount > 500)
- (can-train transport-ship)
- =>
- (train transport-ship)
- )
- (defrule
- (unit-type-count fire-ship-line < 40)
- (wood-amount > 500)
- (gold-amount > 500)
- (can-train fire-ship-line)
- =>
- (train fire-ship-line)
- )
- (defrule
- (unit-type-count galley-line < 40)
- (wood-amount > 500)
- (gold-amount > 500)
- (can-train galley-line)
- =>
- (train galley-line)
- )
- (defrule
- (unit-type-count cannon-galleon-line < 40)
- (wood-amount > 500)
- (gold-amount > 500)
- (can-train cannon-galleon-line)
- =>
- (train cannon-galleon-line)
- )
- ; ========================== UPGRADES - I usually use the same rules for upgrades for all civs. If the AI has a certain number of units, it tries to upgrade them.
- ; problem with escrow - give up
- (defrule
- (escrow-amount wood > 500)
- =>
- (release-escrow wood)
- )
- (defrule
- (escrow-amount stone > 500)
- =>
- (release-escrow stone)
- )
- (defrule
- (or
- (or
- (escrow-amount wood > 1000)
- (escrow-amount food > 1500)
- )
- (or
- (escrow-amount gold > 1500)
- (escrow-amount stone > 1000)
- )
- )
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- )
- ; ////////////////////////////////////////////////////
- ; sets initial goal for escrow to make sure there are villagers
- (defrule
- (true)
- =>
- (disable-self)
- )
- (defrule
- (unit-type-count villager >= 10)
- =>
- (disable-self)
- )
- ; sets escrow
- ;0 = Unacceptable
- ;10 = Unacceptable
- ;20 = Unacceptable
- ;30 = Unacceptable
- ;40 = 14:50
- ;50 = Time
- ;60 = Time
- ;70 = Time
- ;80 = Time
- ;90 = 11:16
- ;100 = Time
- ;56 =
- ;75 = Late
- ;80 = 25:35, late
- (defrule
- (current-age == dark-age)
- (unit-type-count villager < 30)
- =>
- (set-escrow-percentage wood 0)
- (set-escrow-percentage food 0)
- (set-escrow-percentage gold 0)
- (set-escrow-percentage stone 0)
- )
- (defrule
- (current-age == dark-age)
- (unit-type-count villager > 30)
- =>
- (set-escrow-percentage wood 20)
- (set-escrow-percentage food 80)
- (set-escrow-percentage gold 80)
- (set-escrow-percentage stone 10)
- )
- (defrule
- (current-age == feudal-age)
- (unit-type-count villager < 60)
- (or (building-type-count market > 0)
- (game-time < 1200))
- =>
- (set-escrow-percentage wood 5)
- (set-escrow-percentage food 15)
- (set-escrow-percentage gold 50)
- (set-escrow-percentage stone 25)
- )
- (defrule
- (current-age == feudal-age)
- (unit-type-count villager < 60)
- (or (building-type-count market > 0)
- (game-time < 1200))
- =>
- (set-escrow-percentage wood 5)
- (set-escrow-percentage food 15)
- (set-escrow-percentage gold 50)
- (set-escrow-percentage stone 25)
- )
- (defrule
- (current-age == feudal-age)
- (unit-type-count villager < 60)
- (or (building-type-count market < 0)
- (game-time > 1200))
- =>
- (set-escrow-percentage wood 80)
- (set-escrow-percentage food 15)
- (set-escrow-percentage gold 50)
- (set-escrow-percentage stone 25)
- )
- (defrule
- (current-age == feudal-age)
- (unit-type-count villager > 60)
- =>
- (set-escrow-percentage wood 25)
- (set-escrow-percentage food 85)
- (set-escrow-percentage gold 85)
- (set-escrow-percentage stone 12)
- )
- (defrule
- (current-age == castle-age)
- (unit-type-count villager < 80)
- =>
- (set-escrow-percentage wood 5)
- (set-escrow-percentage food 5)
- (set-escrow-percentage gold 25)
- (set-escrow-percentage stone 12)
- )
- (defrule
- (current-age == castle-age)
- (unit-type-count villager > 80)
- =>
- (set-escrow-percentage wood 15)
- (set-escrow-percentage food 45)
- (set-escrow-percentage gold 45)
- (set-escrow-percentage stone 7)
- )
- (defrule
- (current-age == castle-age)
- (unit-type-count villager > 120)
- =>
- (set-escrow-percentage wood 30)
- (set-escrow-percentage food 90)
- (set-escrow-percentage gold 90)
- (set-escrow-percentage stone 15)
- )
- (defrule
- (current-age == imperial-age)
- (not (research-completed my-unique-unit-upgrade))
- =>
- (set-escrow-percentage wood 20)
- (set-escrow-percentage food 56)
- (set-escrow-percentage gold 56)
- (set-escrow-percentage stone 10)
- )
- ; /////////////////////////////////////////////////////
- ;UNIT UPGRADES
- (defrule
- (can-research ri-cartography)
- =>
- (research ri-cartography)
- (chat-local-to-self "I can see it now...")
- (chat-to-allies "Researching Cartography.")
- )
- (defrule
- (can-research ri-cartography)
- =>
- (research ri-cartography)
- (chat-local-to-self "I can see it now...")
- (chat-to-allies "Researching Cartography.")
- )
- (defrule
- (or
- (building-type-count castle > 0)
- (building-type-count watch-tower-line > 2)
- )
- (can-research ri-murder-holes)
- =>
- (research ri-murder-holes)
- )
- (defrule
- (can-research ri-town-patrol)
- =>
- (research ri-town-patrol)
- )
- (defrule
- (can-research ri-town-watch)
- =>
- (research ri-town-watch)
- )
- (defrule
- (can-research my-unique-unit-upgrade)
- =>
- (research my-unique-unit-upgrade)
- )
- (defrule
- (unit-type-count militiaman > 2)
- (can-research ri-man-at-arms)
- =>
- (research ri-man-at-arms)
- )
- (defrule
- (unit-type-count man-at-arms > 2)
- (can-research ri-long-swordsman)
- =>
- (research ri-long-swordsman)
- )
- (defrule
- (unit-type-count long-swordsman > 3)
- (can-research ri-two-handed-swordsman)
- =>
- (research ri-two-handed-swordsman)
- )
- (defrule
- (unit-type-count two-handed-swordsman > 3)
- (can-research ri-champion)
- =>
- (research ri-champion)
- )
- (defrule
- (unit-type-count spearman > 3)
- (can-research ri-pikeman)
- =>
- (research ri-pikeman)
- )
- (defrule
- (unit-type-count spearman-line > 3)
- (can-research ri-halberdier)
- =>
- (research ri-halberdier)
- )
- (defrule
- (unit-type-count scout-cavalry > 4)
- (can-research ri-light-cavalry)
- =>
- (research ri-light-cavalry)
- )
- (defrule
- (unit-type-count camel > 4)
- (can-research ri-heavy-camel)
- =>
- (research ri-heavy-camel)
- )
- (defrule
- (unit-type-count knight > 4)
- (can-research ri-cavalier)
- =>
- (research ri-cavalier)
- )
- (defrule
- (unit-type-count cavalier > 4)
- (can-research ri-paladin)
- =>
- (research ri-paladin)
- )
- (defrule
- (unit-type-count archer > 2)
- (can-research ri-crossbow)
- =>
- (research ri-crossbow)
- )
- (defrule
- (unit-type-count crossbowman > 2)
- (can-research ri-arbalest)
- =>
- (research ri-arbalest)
- )
- (defrule
- (unit-type-count cavalry-archer > 2)
- (can-research ri-heavy-cavalry-archer)
- =>
- (research ri-heavy-cavalry-archer)
- )
- (defrule
- (unit-type-count skirmisher > 2)
- (can-research ri-elite-skirmisher)
- =>
- (research ri-elite-skirmisher)
- )
- (defrule
- (unit-type-count scorpion > 2)
- (can-research ri-heavy-scorpion)
- =>
- (research ri-heavy-scorpion)
- )
- (defrule
- (unit-type-count battering-ram > 2)
- (can-research ri-capped-ram)
- =>
- (research ri-capped-ram)
- )
- (defrule
- (unit-type-count capped-ram > 2)
- (can-research ri-siege-ram)
- =>
- (research ri-siege-ram)
- )
- (defrule
- (unit-type-count mangonel > 1)
- (can-research ri-onager)
- =>
- (research ri-onager)
- )
- (defrule
- (unit-type-count onager > 1)
- (can-research ri-siege-onager)
- =>
- (research ri-siege-onager)
- )
- ;DOCK UNITS
- (defrule
- (unit-type-count galley > 2)
- (can-research ri-war-galley)
- =>
- (research ri-war-galley)
- )
- (defrule
- (unit-type-count war-galley > 2)
- (can-research ri-galleon)
- =>
- (research ri-galleon)
- )
- (defrule
- (or
- (unit-type-count galleon > 2)
- (unit-type-count war-galley > 2)
- )
- (can-research ri-cannon-galleon)
- =>
- (research ri-cannon-galleon)
- )
- (defrule
- (unit-type-count fire-ship > 1)
- (can-research ri-fast-fire-ship)
- =>
- (research ri-fast-fire-ship)
- )
- (defrule
- (unit-type-count demolition-ship > 2)
- (can-research ri-heavy-demolition-ship)
- =>
- (research ri-heavy-demolition-ship)
- )
- ; ////////////////////////WEAPONS//////////////////
- (defrule
- (can-research ri-forging)
- =>
- (research ri-forging)
- )
- (defrule
- (can-research ri-iron-casting)
- =>
- (research ri-iron-casting)
- )
- (defrule
- (can-research ri-blast-furnace)
- =>
- (research ri-blast-furnace)
- )
- ;ARCHER UPGRADES -- cost food/gold
- (defrule
- (can-research ri-fletching)
- =>
- (research ri-fletching)
- )
- (defrule
- (can-research ri-bodkin-arrow)
- =>
- (research ri-bodkin-arrow)
- )
- (defrule
- (can-research ri-bracer)
- =>
- (research ri-bracer)
- )
- (defrule
- (or
- (unit-type-count archer-line > 3)
- (or
- (unit-type-count skirmisher-line > 3)
- (unit-type-count cavalry-archer-line > 3)
- )
- )
- (can-research ri-padded-archer-armor)
- =>
- (research ri-padded-archer-armor)
- )
- (defrule
- (or
- (unit-type-count archer-line > 3)
- (or
- (unit-type-count skirmisher-line > 3)
- (unit-type-count cavalry-archer-line > 3)
- )
- )
- (can-research ri-leather-archer-armor)
- =>
- (research ri-leather-archer-armor)
- )
- (defrule
- (or
- (unit-type-count archer-line > 3)
- (or
- (unit-type-count skirmisher-line > 3)
- (unit-type-count cavalry-archer-line > 3)
- )
- )
- (can-research ri-ring-archer-armor)
- =>
- (research ri-ring-archer-armor)
- )
- (defrule
- (or
- (unit-type-count militiaman-line > 3)
- (unit-type-count spearman-line > 3)
- )
- (can-research ri-scale-mail)
- =>
- (research ri-scale-mail)
- )
- (defrule
- (or
- (unit-type-count militiaman-line > 3)
- (unit-type-count spearman-line > 3)
- )
- (can-research ri-chain-mail)
- =>
- (research ri-chain-mail)
- )
- (defrule
- (or
- (unit-type-count militiaman-line > 3)
- (unit-type-count spearman-line > 3)
- )
- (can-research ri-plate-mail)
- =>
- (research ri-plate-mail)
- )
- (defrule
- (or
- (unit-type-count militiaman-line > 3)
- (unit-type-count spearman-line > 3)
- )
- (can-research ri-tracking)
- =>
- (research ri-tracking)
- )
- (defrule
- (or
- (unit-type-count militiaman-line > 3)
- (unit-type-count spearman-line > 3)
- )
- (can-research ri-squires)
- =>
- (research ri-squires)
- )
- (defrule
- (or
- (unit-type-count knight-line > 3)
- (unit-type-count scout-cavalry-line > 3)
- )
- (can-research ri-scale-barding)
- =>
- (research ri-scale-barding)
- )
- (defrule
- (or
- (unit-type-count knight-line > 3)
- (unit-type-count scout-cavalry-line > 3)
- )
- (can-research ri-chain-barding)
- =>
- (research ri-chain-barding)
- )
- (defrule
- (or
- (unit-type-count knight-line > 3)
- (unit-type-count scout-cavalry-line > 3)
- )
- (can-research ri-plate-barding)
- =>
- (research ri-plate-barding)
- )
- (defrule
- (or
- (unit-type-count cavalry-archer-line > 3)
- (or
- (unit-type-count knight-line > 3)
- (unit-type-count scout-cavalry-line > 3)
- )
- )
- (can-research ri-husbandry)
- =>
- (research ri-husbandry)
- )
- ; /////////////////////SIEGE RESEARCH ITEMS///////////////////////////
- (defrule
- (can-research ri-siege-engineers)
- =>
- (research ri-siege-engineers)
- )
- ;FORTRESS UPGRADES
- (defrule
- (can-research ri-hoardings)
- =>
- (research ri-hoardings)
- )
- ;SHIPS
- (defrule
- (unit-type-count cannon-galleon > 2)
- (can-research ri-deck-guns)
- =>
- (research ri-deck-guns)
- )
- (defrule
- (or
- (unit-type-count transport-ship > 0)
- (unit-type-count galley-line > 2)
- )
- (can-research ri-careening)
- =>
- (research ri-careening)
- )
- (defrule
- (or
- (unit-type-count transport-ship > 0)
- (unit-type-count galley-line > 2)
- )
- (can-research ri-dry-dock)
- =>
- (research ri-dry-dock)
- )
- (defrule
- (or
- (unit-type-count galley-line > 2)
- (or
- (unit-type-count cannon-galleon-line > 1)
- (unit-type-count fire-ship-line > 1)
- )
- )
- (can-research ri-shipwright)
- =>
- (research ri-shipwright)
- )
- ;OTHER RESEARCH ITEMS
- (defrule
- (can-research ri-ballistics)
- =>
- (research ri-ballistics)
- )
- (defrule
- (can-research ri-chemistry)
- =>
- (research ri-chemistry)
- )
- (defrule
- (can-research ri-conscription)
- =>
- (research ri-conscription)
- )
- (defrule
- (can-research my-unique-research)
- =>
- (research my-unique-research)
- )
- ; //////////////////////ECONOMIC////////////////////////
- ;mining-camp items
- (defrule
- (can-research ri-gold-mining)
- =>
- (research ri-gold-mining)
- )
- (defrule
- (can-research ri-gold-shaft-mining)
- =>
- (research ri-gold-shaft-mining)
- )
- (defrule
- (building-type-count mining-camp > 1)
- (can-research ri-stone-mining)
- =>
- (research ri-stone-mining)
- )
- (defrule
- (building-type-count mining-camp > 1)
- (can-research ri-stone-shaft-mining)
- =>
- (research ri-stone-shaft-mining)
- )
- ;mill items
- (defrule
- (can-research ri-horse-collar)
- =>
- (research ri-horse-collar)
- )
- (defrule
- (can-research ri-heavy-plow)
- =>
- (research ri-heavy-plow)
- )
- (defrule
- (can-research ri-crop-rotation)
- =>
- (research ri-crop-rotation)
- )
- ;saw mill
- (defrule
- (can-research ri-double-bit-axe)
- =>
- (research ri-double-bit-axe)
- )
- (defrule
- (can-research ri-bow-saw)
- =>
- (research ri-bow-saw)
- )
- (defrule
- (can-research ri-two-man-saw)
- =>
- (research ri-two-man-saw)
- )
- ;university stuff
- (defrule
- (can-research ri-masonry)
- =>
- (research ri-masonry)
- )
- (defrule
- (can-research ri-architecture)
- =>
- (research ri-architecture)
- )
- (defrule
- (can-research ri-stonecutting)
- =>
- (research ri-stonecutting)
- )
- ;market & town center
- (defrule
- (can-research ri-guilds)
- =>
- (research ri-guilds)
- )
- (defrule
- (current-age == dark-age)
- (can-research ri-loom)
- =>
- (research ri-loom)
- )
- (defrule
- (can-research ri-hand-cart)
- =>
- (research ri-hand-cart)
- )
- (defrule
- (can-research ri-wheel-barrow)
- =>
- (research ri-wheel-barrow)
- )
- (defrule
- (or
- (players-stance any-computer ally)
- (players-stance any-human ally)
- )
- (can-research ri-coinage)
- =>
- (research ri-coinage)
- )
- (defrule
- (or
- (players-stance any-computer ally)
- (players-stance any-human ally)
- )
- (can-research ri-banking)
- =>
- (research ri-banking)
- )
- ; ////////////////////MONK/////////////////
- (defrule
- (or
- (players-unit-type-count any-enemy monk > 1)
- (unit-type-count war-elephant-line > 2)
- )
- (can-research ri-faith)
- =>
- (research ri-faith)
- )
- (defrule
- (players-unit-type-count any-enemy monk > 2)
- (can-research ri-atonement)
- =>
- (research ri-atonement)
- )
- (defrule
- (unit-type-count monk > 2)
- (can-research ri-block-printing)
- =>
- (research ri-block-printing)
- )
- (defrule
- (unit-type-count monk > 2)
- (can-research ri-illumination)
- =>
- (research ri-illumination)
- )
- (defrule
- (unit-type-count monk > 2)
- (can-research ri-fervor)
- =>
- (research ri-fervor)
- )
- (defrule
- (unit-type-count monk > 2)
- (can-research ri-redemption)
- =>
- (research ri-redemption)
- )
- (defrule
- (unit-type-count monk > 2)
- (can-research ri-sanctity)
- =>
- (research ri-sanctity)
- )
- ;TOWERS
- (defrule
- (building-type-count watch-tower > 1)
- (can-research ri-guard-tower)
- =>
- (research ri-guard-tower)
- )
- (defrule
- (building-type-count guard-tower > 1)
- (can-research ri-keep)
- =>
- (research ri-keep)
- )
- (defrule
- (building-type-count university > 0)
- (building-type-count watch-tower-line > 3)
- (research-available ri-bombard-tower)
- =>
- (research ri-bombard-tower)
- )
- (defrule
- (building-type-count watch-tower-line > 3)
- (can-research ri-heated-shot)
- =>
- (research ri-heated-shot)
- )
- (defrule
- (or
- (building-type-count castle > 0)
- (building-type-count watch-tower-line > 2)
- )
- (can-research ri-murder-holes)
- =>
- (research ri-murder-holes)
- )
- (defrule
- (or
- (building-type-count castle > 0)
- (building-type-count watch-tower-line > 2)
- )
- (can-research ri-fortified-wall)
- =>
- (research ri-fortified-wall)
- )
- ; ================ IMPERIAL RESEARCH
- (defrule
- (goal 16 0)
- (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)
- )
- (defrule
- (goal 16 0)
- (unit-type-count militiaman > 4)
- (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)
- )
- (defrule
- (goal 16 0)
- (unit-type-count man-at-arms > 6)
- (can-research-with-escrow ri-long-swordsman)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-long-swordsman)
- )
- (defrule
- (goal 16 0)
- (unit-type-count long-swordsman > 6)
- (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)
- )
- (defrule
- (goal 16 0)
- (unit-type-count two-handed-swordsman > 6)
- (can-research-with-escrow ri-champion)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-champion)
- )
- (defrule
- (goal 16 0)
- (unit-type-count-total spearman > 2)
- (can-research-with-escrow ri-pikeman)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-pikeman)
- )
- (defrule
- (goal 16 0)
- (unit-type-count-total scout-cavalry > 2)
- (can-research-with-escrow ri-light-cavalry)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-light-cavalry)
- )
- (defrule
- (goal 16 0)
- (unit-type-count-total camel > 2)
- (can-research-with-escrow ri-heavy-camel)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-heavy-camel)
- )
- (defrule
- (goal 16 0)
- (unit-type-count-total knight > 2)
- (can-research-with-escrow ri-cavalier)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-cavalier)
- )
- (defrule
- (goal 16 0)
- (unit-type-count-total cavalier > 2)
- (can-research-with-escrow ri-paladin)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-paladin)
- )
- (defrule
- (goal 16 0)
- (unit-type-count archer > 6)
- (can-research-with-escrow ri-crossbow)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-crossbow)
- )
- (defrule
- (goal 16 0)
- (unit-type-count crossbowman > 6)
- (can-research-with-escrow ri-arbalest)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-arbalest)
- )
- (defrule
- (goal 16 0)
- (unit-type-count cavalry-archer > 6)
- (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)
- )
- (defrule
- (unit-type-count-total skirmisher > 2)
- (can-research-with-escrow ri-elite-skirmisher)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-elite-skirmisher)
- )
- (defrule
- (goal 16 0)
- (unit-type-count scorpion > 4)
- (can-research-with-escrow ri-heavy-scorpion)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-heavy-scorpion)
- )
- (defrule
- (goal 16 0)
- (unit-type-count battering-ram > 2)
- (can-research-with-escrow ri-capped-ram)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-capped-ram)
- )
- (defrule
- (goal 16 0)
- (unit-type-count capped-ram > 2)
- (can-research-with-escrow ri-siege-ram)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-siege-ram)
- )
- (defrule
- (goal 16 0)
- (unit-type-count mangonel > 3)
- (can-research-with-escrow ri-onager)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-onager)
- )
- (defrule
- (goal 16 0)
- (unit-type-count onager > 3)
- (can-research-with-escrow ri-siege-onager)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-siege-onager)
- )
- ;DOCK UNITS
- (defrule
- (goal 16 0)
- (unit-type-count galley > 2)
- (can-research-with-escrow ri-war-galley)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-war-galley)
- )
- (defrule
- (goal 16 0)
- (unit-type-count war-galley > 2)
- (can-research-with-escrow ri-galleon)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-galleon)
- )
- (defrule
- (goal 16 0)
- (or
- (unit-type-count galleon > 2)
- (unit-type-count war-galley > 2)
- )
- (can-research-with-escrow ri-cannon-galleon)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-cannon-galleon)
- )
- (defrule
- (goal 16 0)
- (unit-type-count-total fire-ship > 1)
- (can-research-with-escrow ri-fast-fire-ship)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-fast-fire-ship)
- )
- (defrule
- (goal 16 0)
- (unit-type-count demolition-ship > 2)
- (can-research-with-escrow ri-heavy-demolition-ship)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-heavy-demolition-ship)
- )
- ; ////////////////////////WEAPONS//////////////////
- (defrule
- (goal 16 0)
- (can-research-with-escrow ri-forging)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-forging)
- )
- (defrule
- (goal 16 0)
- (can-research-with-escrow ri-iron-casting)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-iron-casting)
- )
- (defrule
- (goal 16 0)
- (can-research-with-escrow ri-blast-furnace)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-blast-furnace)
- )
- ;ARCHER UPGRADES -- cost food/gold
- (defrule
- (goal 16 0)
- (can-research-with-escrow ri-fletching)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-fletching)
- )
- (defrule
- (goal 16 0)
- (can-research-with-escrow ri-bodkin-arrow)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-bodkin-arrow)
- )
- (defrule
- (goal 16 0)
- (can-research-with-escrow ri-bracer)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-bracer)
- )
- (defrule
- (goal 16 0)
- (or
- (unit-type-count-total archer-line > 3)
- (or
- (unit-type-count-total skirmisher-line > 3)
- (unit-type-count-total cavalry-archer-line > 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)
- )
- (defrule
- (goal 16 0)
- (or
- (unit-type-count-total archer-line > 3)
- (or
- (unit-type-count-total skirmisher-line > 3)
- (unit-type-count-total cavalry-archer-line > 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)
- )
- (defrule
- (goal 16 0)
- (or
- (unit-type-count-total archer-line > 3)
- (or
- (unit-type-count-total skirmisher-line > 3)
- (unit-type-count-total cavalry-archer-line > 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)
- )
- (defrule
- (goal 16 0)
- (or
- (unit-type-count-total militiaman-line > 3)
- (unit-type-count-total spearman-line > 3)
- )
- (can-research-with-escrow ri-scale-mail)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-scale-mail)
- )
- (defrule
- (goal 16 0)
- (or
- (unit-type-count-total militiaman-line > 3)
- (unit-type-count-total spearman-line > 3)
- )
- (can-research-with-escrow ri-chain-mail)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-chain-mail)
- )
- (defrule
- (goal 16 0)
- (or
- (unit-type-count-total militiaman-line > 3)
- (unit-type-count-total spearman-line > 3)
- )
- (can-research-with-escrow ri-plate-mail)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-plate-mail)
- )
- (defrule
- (goal 16 0)
- (or
- (unit-type-count-total militiaman-line > 3)
- (unit-type-count-total spearman-line > 3)
- )
- (can-research-with-escrow ri-tracking)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-tracking)
- )
- (defrule
- (goal 16 0)
- (or
- (unit-type-count-total militiaman-line > 3)
- (unit-type-count-total spearman-line > 3)
- )
- (can-research-with-escrow ri-squires)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-squires)
- )
- (defrule
- (goal 16 0)
- (or
- (unit-type-count-total knight-line > 3)
- (unit-type-count-total scout-cavalry-line > 3)
- )
- (can-research-with-escrow ri-scale-barding)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-scale-barding)
- )
- (defrule
- (goal 16 0)
- (or
- (unit-type-count-total knight-line > 3)
- (unit-type-count-total scout-cavalry-line > 3)
- )
- (can-research-with-escrow ri-chain-barding)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-chain-barding)
- )
- (defrule
- (goal 16 0)
- (or
- (unit-type-count-total knight-line > 3)
- (unit-type-count-total scout-cavalry-line > 3)
- )
- (can-research-with-escrow ri-plate-barding)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-plate-barding)
- )
- (defrule
- (goal 16 0)
- (or
- (unit-type-count-total cavalry-archer-line > 3)
- (or
- (unit-type-count-total knight-line > 3)
- (unit-type-count-total scout-cavalry-line > 3)
- )
- )
- (can-research-with-escrow ri-husbandry)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-husbandry)
- )
- ; /////////////////////SIEGE RESEARCH ITEMS///////////////////////////
- (defrule
- (goal 16 0)
- (can-research-with-escrow ri-siege-engineers)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-siege-engineers)
- )
- ;FORTRESS UPGRADES
- (defrule
- (goal 16 0)
- (can-research-with-escrow ri-hoardings)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-hoardings)
- )
- ;SHIPS
- (defrule
- (goal 16 0)
- (unit-type-count cannon-galleon > 2)
- (can-research-with-escrow ri-deck-guns)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-deck-guns)
- )
- (defrule
- (goal 16 0)
- (or
- (unit-type-count transport-ship > 0)
- (unit-type-count galley-line > 2)
- )
- (can-research-with-escrow ri-careening)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-careening)
- )
- (defrule
- (goal 16 0)
- (or
- (unit-type-count transport-ship > 0)
- (unit-type-count galley-line > 2)
- )
- (can-research-with-escrow ri-dry-dock)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-dry-dock)
- )
- (defrule
- (goal 16 0)
- (or
- (unit-type-count galley-line > 2)
- (or
- (unit-type-count-total cannon-galleon-line > 1)
- (unit-type-count-total fire-ship-line > 1)
- )
- )
- (can-research-with-escrow ri-shipwright)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-shipwright)
- )
- ;OTHER RESEARCH ITEMS
- (defrule
- (goal 16 0)
- (can-research-with-escrow ri-ballistics)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-ballistics)
- )
- (defrule
- (goal 16 0)
- (can-research-with-escrow ri-chemistry)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-chemistry)
- )
- (defrule
- (goal 16 0)
- (can-research-with-escrow ri-conscription)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-conscription)
- )
- (defrule
- (goal 16 0)
- (can-research-with-escrow my-unique-research)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research my-unique-research)
- )
- ; //////////////////////ECONOMIC////////////////////////
- ;mining-camp items
- (defrule
- (goal 16 0)
- (can-research-with-escrow ri-gold-mining)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-gold-mining)
- )
- (defrule
- (goal 16 0)
- (can-research-with-escrow ri-gold-shaft-mining)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-gold-shaft-mining)
- )
- (defrule
- (goal 16 0)
- (building-type-count mining-camp > 1)
- (can-research-with-escrow ri-stone-mining)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-stone-mining)
- )
- (defrule
- (goal 16 0)
- (building-type-count mining-camp > 1)
- (can-research-with-escrow ri-stone-shaft-mining)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-stone-shaft-mining)
- )
- ;mill items
- (defrule
- (goal 16 0)
- (can-research-with-escrow ri-horse-collar)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-horse-collar)
- )
- (defrule
- (goal 16 0)
- (can-research-with-escrow ri-heavy-plow)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-heavy-plow)
- )
- (defrule
- (goal 16 0)
- (can-research-with-escrow ri-crop-rotation)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-crop-rotation)
- )
- ;saw mill
- (defrule
- (goal 16 0)
- (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)
- )
- (defrule
- (goal 16 0)
- (can-research-with-escrow ri-bow-saw)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-bow-saw)
- )
- (defrule
- (goal 16 0)
- (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)
- )
- ;university stuff
- (defrule
- (goal 16 0)
- (can-research-with-escrow ri-masonry)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-masonry)
- )
- (defrule
- (goal 16 0)
- (can-research-with-escrow ri-architecture)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-architecture)
- )
- (defrule
- (goal 16 0)
- (can-research-with-escrow ri-stonecutting)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-stonecutting)
- )
- ;market & town center
- (defrule
- (goal 16 0)
- (can-research-with-escrow ri-guilds)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-guilds)
- )
- (defrule
- (goal 16 0)
- (current-age == dark-age)
- (can-research-with-escrow ri-loom)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-loom)
- )
- (defrule
- (goal 16 0)
- (can-research-with-escrow ri-hand-cart)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-hand-cart)
- )
- (defrule
- (goal 16 0)
- (can-research-with-escrow ri-wheel-barrow)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-wheel-barrow)
- )
- (defrule
- (goal 16 0)
- (or
- (players-stance any-computer ally)
- (players-stance any-human ally)
- )
- (can-research-with-escrow ri-coinage)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-coinage)
- )
- (defrule
- (goal 16 0)
- (or
- (players-stance any-computer ally)
- (players-stance any-human ally)
- )
- (can-research-with-escrow ri-banking)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-banking)
- )
- ; ////////////////////MONK/////////////////
- (defrule
- (goal 16 0)
- (or
- (players-unit-type-count any-enemy monk > 1)
- (unit-type-count-total war-elephant-line > 2)
- )
- (can-research-with-escrow ri-faith)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-faith)
- )
- (defrule
- (goal 16 0)
- (players-unit-type-count any-enemy monk > 2)
- (can-research-with-escrow ri-atonement)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-atonement)
- )
- (defrule
- (goal 16 0)
- (unit-type-count-total monk > 2)
- (can-research-with-escrow ri-block-printing)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-block-printing)
- )
- (defrule
- (goal 16 0)
- (unit-type-count-total monk > 2)
- (can-research-with-escrow ri-illumination)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-illumination)
- )
- (defrule
- (goal 16 0)
- (unit-type-count-total monk > 2)
- (can-research-with-escrow ri-fervor)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-fervor)
- )
- (defrule
- (goal 16 0)
- (unit-type-count-total monk > 2)
- (can-research-with-escrow ri-redemption)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-redemption)
- )
- (defrule
- (goal 16 0)
- (unit-type-count-total monk > 2)
- (can-research-with-escrow ri-sanctity)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-sanctity)
- )
- ;TOWERS
- (defrule
- (goal 16 0)
- (building-type-count-total watch-tower > 1)
- (can-research-with-escrow ri-guard-tower)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-guard-tower)
- )
- (defrule
- (goal 16 0)
- (building-type-count-total guard-tower > 1)
- (can-research-with-escrow ri-keep)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-keep)
- )
- (defrule
- (goal 16 0)
- (building-type-count university > 0)
- (building-type-count-total watch-tower-line > 3)
- (research-available ri-bombard-tower)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-bombard-tower)
- )
- (defrule
- (goal 16 0)
- (building-type-count-total watch-tower-line > 3)
- (can-research-with-escrow ri-heated-shot)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-heated-shot)
- )
- (defrule
- (goal 16 0)
- (or
- (building-type-count-total castle > 0)
- (building-type-count-total watch-tower-line > 2)
- )
- (can-research-with-escrow ri-murder-holes)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-murder-holes)
- )
- (defrule
- (goal 16 0)
- (or
- (building-type-count-total castle > 0)
- (building-type-count-total watch-tower-line > 2)
- )
- (can-research-with-escrow ri-fortified-wall)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- (research ri-fortified-wall)
- )
- ; ================ MARKET - just buys and sells when the price is right and stockpile low
- ; ///////////////////////// FEUDAL
- (defrule
- (current-age == feudal-age)
- (gold-amount >= 500)
- (wood-amount <= 100)
- (commodity-buying-price wood <= 100)
- (can-buy-commodity wood)
- =>
- (chat-local-to-self "Wood panic")
- (buy-commodity wood)
- )
- (defrule
- (current-age == feudal-age)
- (gold-amount >= 500)
- (food-amount <= 100)
- (commodity-buying-price food <= 100)
- (can-buy-commodity food)
- =>
- (chat-local-to-self "Food panic")
- (buy-commodity food)
- )
- (defrule
- (current-age == feudal-age)
- (gold-amount >= 600)
- (stone-amount <= 100)
- (commodity-buying-price stone <= 200)
- (can-buy-commodity stone)
- =>
- (chat-local-to-self "need stone")
- (buy-commodity stone)
- )
- (defrule
- (current-age == feudal-age)
- (wood-amount >= 500)
- (or
- (gold-amount < 100)
- (food-amount < 100)
- )
- (commodity-selling-price wood >= 50)
- (can-sell-commodity wood)
- =>
- (chat-local-to-self "Gold panic; sell wood")
- (sell-commodity wood)
- )
- (defrule
- (current-age == feudal-age)
- (food-amount >= 1000)
- (or
- (gold-amount < 100)
- (wood-amount < 100)
- )
- (can-sell-commodity food)
- =>
- (chat-local-to-self "excess food")
- (sell-commodity food)
- )
- (defrule
- (current-age == feudal-age)
- (stone-amount >= 1000)
- (or
- (gold-amount < 100)
- (wood-amount < 100)
- )
- (can-sell-commodity stone)
- =>
- (chat-local-to-self "excess stone")
- (sell-commodity stone)
- )
- ;****************************CASTLE
- (defrule
- (not (goal 16 99))
- (current-age == castle-age)
- (gold-amount >= 1000)
- (wood-amount <= 200)
- (commodity-buying-price wood <= 100)
- (can-buy-commodity wood)
- =>
- (chat-local-to-self "Wood panic")
- (buy-commodity wood)
- )
- (defrule
- (not (goal 16 99))
- (current-age == castle-age)
- (gold-amount >= 500)
- (wood-amount <= 100)
- (can-buy-commodity wood)
- =>
- (chat-local-to-self "Wood panic")
- (buy-commodity wood)
- )
- (defrule
- (current-age == castle-age)
- (gold-amount >= 1000)
- (food-amount <= 200)
- (commodity-buying-price food <= 100)
- (can-buy-commodity food)
- =>
- (chat-local-to-self "Food panic")
- (buy-commodity food)
- )
- (defrule
- (current-age == castle-age)
- (gold-amount >= 500)
- (food-amount <= 100)
- (can-buy-commodity food)
- =>
- (chat-local-to-self "Food panic")
- (buy-commodity food)
- )
- (defrule
- (current-age == castle-age)
- (gold-amount >= 1200)
- (stone-amount <= 200)
- (commodity-buying-price stone <= 200)
- (can-buy-commodity stone)
- =>
- (chat-local-to-self "need stone")
- (buy-commodity stone)
- )
- (defrule
- (current-age == castle-age)
- (wood-amount >= 1000)
- (or
- (gold-amount < 200)
- (food-amount < 200)
- )
- (commodity-selling-price wood >= 25)
- (can-sell-commodity wood)
- =>
- (chat-local-to-self "Gold panic; sell wood")
- (sell-commodity wood)
- )
- (defrule
- (current-age == castle-age)
- (food-amount >= 1200)
- (or
- (gold-amount < 200)
- (wood-amount < 200)
- )
- (can-sell-commodity food)
- =>
- (chat-local-to-self "excess food")
- (sell-commodity food)
- )
- (defrule
- (current-age == castle-age)
- (stone-amount >= 1000)
- (or
- (gold-amount < 200)
- (wood-amount < 200)
- )
- (can-sell-commodity stone)
- =>
- (chat-local-to-self "excess stone")
- (sell-commodity stone)
- )
- ;imperial age
- (defrule
- (gold-amount >= 1500)
- (wood-amount <= 200)
- (can-buy-commodity wood)
- =>
- (chat-local-to-self "Wood panic")
- (buy-commodity wood)
- )
- (defrule
- (gold-amount >= 750)
- (wood-amount <= 100)
- (can-buy-commodity wood)
- =>
- (chat-local-to-self "NO WOOD! ")
- (buy-commodity wood)
- )
- (defrule
- (gold-amount >= 1500)
- (food-amount <= 200)
- (can-buy-commodity food)
- =>
- (chat-local-to-self "Food panic")
- (buy-commodity food)
- )
- (defrule
- (gold-amount >= 1500)
- (stone-amount <= 200)
- (can-buy-commodity stone)
- =>
- (chat-local-to-self "need stone")
- (buy-commodity stone)
- )
- (defrule
- (wood-amount >= 1500)
- (or
- (gold-amount < 200)
- (food-amount < 200)
- )
- (can-sell-commodity wood)
- =>
- (chat-local-to-self "Gold panic; sell wood")
- (sell-commodity wood)
- )
- (defrule
- (food-amount >= 1500)
- (or
- (gold-amount < 200)
- (wood-amount < 200)
- )
- (can-sell-commodity food)
- =>
- (chat-local-to-self "excess food")
- (sell-commodity food)
- )
- (defrule
- (stone-amount >= 1500)
- (or
- (or
- (gold-amount < 200)
- (wood-amount < 200)
- )
- (food-amount < 200)
- )
- (can-sell-commodity stone)
- =>
- (chat-local-to-self "excess stone")
- (sell-commodity stone)
- )
- (defrule
- (stone-amount > 1000)
- (gold-amount < 1000)
- =>
- (sell-commodity stone)
- )
- (defrule
- (wood-amount > 1000)
- (gold-amount < 1000)
- =>
- (sell-commodity wood)
- )
- (defrule
- (food-amount > 1500)
- (gold-amount < 1000)
- =>
- (sell-commodity food)
- )
- (defrule
- (gold-amount > 1000)
- (food-amount < 1000)
- =>
- (buy-commodity food)
- )
- (defrule
- (gold-amount > 1000)
- (wood-amount < 1000)
- =>
- (buy-commodity wood)
- )
- (defrule
- (gold-amount > 1000)
- (stone-amount < 1000)
- =>
- (buy-commodity stone)
- )
- (defrule;imperial random
- (current-age == imperial-age)
- (research-completed my-unique-unit-upgrade)
- =>
- (release-escrow wood)
- (release-escrow food)
- (release-escrow gold)
- (release-escrow stone)
- )
- ;;;;;;;;;;;;;;;;;;;;;Town under attack
- (defrule
- (town-under-attack)
- (game-time > 450)
- =>
- (set-strategic-number sn-task-ungrouped-soldiers 1)
- (set-strategic-number sn-maximum-town-size 25)
- (set-strategic-number sn-camp-max-distance 25)
- (release-escrow food)
- (release-escrow wood)
- (release-escrow gold)
- (set-goal 1 2);Normal Explorers
- (set-goal 2 7);Town has been attacked
- (set-goal 8 1);Enable Vengance Request
- )
- (defrule
- (goal 8 1);Town was under attack
- (not (town-under-attack))
- (game-time > 1500)
- =>
- (set-strategic-number sn-maximum-town-size 50)
- )
- ;removed for test
- (defrule
- (goal 8 1);Town was under attack
- (not (town-under-attack))
- (players-military-population any-ally > 24)
- =>
- (set-goal 8 2);Disable Vengance Request
- )
- ;;;Scenario added
- (defrule
- (or
- (military-population >= 24)
- (game-time >= 600)
- )
- =>
- (set-strategic-number sn-maximum-town-size 30)
- (disable-self)
- )
- (defrule
- (or
- (military-population >= 48)
- (game-time >= 1200)
- )
- =>
- (set-strategic-number sn-maximum-town-size 35)
- (disable-self)
- )
- (defrule
- (or
- (military-population >= 72)
- (game-time >= 1800)
- )
- =>
- (set-strategic-number sn-maximum-town-size 40)
- (disable-self)
- )
- (defrule
- (or
- (military-population >= 96)
- (game-time >= 2400)
- )
- =>
- (set-strategic-number sn-maximum-town-size 45)
- (disable-self)
- )
- (defrule
- (or
- (military-population >= 120)
- (game-time >= 2800)
- )
- =>
- (set-strategic-number sn-maximum-town-size 50)
- (disable-self)
- )
- (defrule;e to n
- (players-stance any-enemy neutral)
- =>
- (chat-to-player this-any-enemy "This will benefit both of us.")
- (set-stance this-any-enemy neutral)
- )
- (defrule
- (players-stance any-neutral ally)
- =>
- (chat-to-player this-any-neutral "You will not regret your decision.")
- (set-stance this-any-neutral ally)
- )
- (defrule
- (players-stance any-neutral enemy)
- =>
- (chat-to-player this-any-neutral "I regret that it must be this way.")
- (set-stance this-any-neutral enemy)
- (chat-to-allies "31")
- (chat-to-allies "Time to even the odds.")
- (attack-now)
- )
- (defrule
- (players-stance any-ally enemy)
- =>
- (chat-to-player this-any-ally "Traitor! Prepare to regret your decision.")
- (set-stance this-any-ally enemy)
- (chat-to-allies "31")
- (chat-to-allies "Friends! Destroy the traitors among us.")
- (attack-now)
- )
- (defrule
- (taunt-detected any-ally 31)
- (goal 5 1)
- =>
- (set-goal 5 2)
- (enable-timer 7 300)
- )
- (defrule
- (taunt-detected any-ally 31)
- (not (town-under-attack))
- (military-population > 12)
- =>
- (acknowledge-taunt this-any-ally 31)
- (attack-now)
- (chat-to-player this-any-ally "Behold the power of Gandalf!")
- )
- (defrule
- (taunt-detected any-ally 31)
- (military-population < 24)
- (town-under-attack)
- =>
- (acknowledge-taunt this-any-ally 31)
- (chat-to-player this-any-ally "I've got my own problems to worry about.")
- )
- (defrule
- (taunt-detected any-ally 31)
- (town-under-attack)
- (military-population > 24)
- =>
- (acknowledge-taunt this-any-ally 31)
- (chat-to-player this-any-ally "I can't! I'm under attack!")
- )
- (defrule
- (taunt-detected any-ally 31)
- (military-population < 13)
- (not (town-under-attack))
- =>
- (acknowledge-taunt this-any-ally 31)
- (chat-to-player this-any-ally "I'll come as soon as I can.")
- )
- (defrule
- (players-stance any-ally neutral)
- =>
- (chat-to-player this-any-ally "You are making a foolish decision.")
- (set-stance this-any-ally enemy)
- (chat-to-allies "Help! My allies are plotting against me!")
- (chat-to-allies "31")
- (attack-now)
- )
- (defrule
- (game-time > 2700)
- (game-time < 5400)
- (not (town-under-attack))
- =>
- (set-strategic-number sn-camp-max-distance 50)
- (set-strategic-number sn-maximum-gold-drop-distance 40)
- (set-strategic-number sn-maximum-stone-drop-distance 40)
- (set-strategic-number sn-maximum-food-drop-distance 40)
- (disable-self)
- )
- (defrule
- (game-time > 5400)
- (game-time < 8100)
- (not (town-under-attack))
- =>
- (set-strategic-number sn-camp-max-distance 75)
- (set-strategic-number sn-maximum-gold-drop-distance 60)
- (set-strategic-number sn-maximum-stone-drop-distance 60)
- (set-strategic-number sn-maximum-food-drop-distance 60)
- (disable-self)
- )
- (defrule
- (game-time > 8100)
- (not (town-under-attack))
- =>
- (set-strategic-number sn-camp-max-distance 100)
- (set-strategic-number sn-maximum-gold-drop-distance 80)
- (set-strategic-number sn-maximum-stone-drop-distance 80)
- (set-strategic-number sn-maximum-food-drop-distance 80)
- (disable-self)
- )
- ;===========================> Migration
- (defrule
- (population > 25)
- (unit-type-count transport-ship > 0)
- (unit-type-count fishing-ship > 0)
- (building-type-count town-center < 3)
- =>
- (build-forward town-center)
- )
- (defrule
- (population > 25)
- (building-type-count castle < 7)
- (building-type-count castle > 3)
- =>
- (build-forward castle)
- )
- ;============================> TRIBUTE
- (defrule
- (timer-triggered 5)
- (food-amount > 1000)
- (players-population any-ally > 10)
- =>
- (tribute-to-player every-ally food 100)
- (chat-to-allies "Here is some food.")
- )
- (defrule
- (timer-triggered 5)
- (wood-amount > 1000)
- (players-population any-ally > 10)
- =>
- (tribute-to-player every-ally wood 100)
- (chat-to-allies "Here is some wood.")
- )
- (defrule
- (timer-triggered 5)
- (gold-amount > 1000)
- (players-population any-ally > 10)
- =>
- (tribute-to-player every-ally gold 100)
- (chat-to-allies "Here is some gold.")
- )
- (defrule
- (timer-triggered 5)
- (stone-amount > 1000)
- (players-population any-ally > 10)
- =>
- (tribute-to-player every-ally stone 100)
- (chat-to-allies "Here is some stone.")
- )
- (defrule
- (timer-triggered 5)
- =>
- (disable-timer 5)
- (enable-timer 5 300)
- )
- (defrule
- (game-time > 7200)
- (military-population > 75)
- (players-population every-enemy < 25)
- =>
- (chat-to-enemies "You play two hours to die like this?")
- (chat-to-allies "Let's finish this.")
- (chat-to-allies "31")
- (attack-now)
- (disable-self)
- )
- (defrule
- (game-time < 450)
- (military-population > 50)
- (not (town-under-attack))
- =>
- (chat-to-all "Raiding Party!")
- (attack-now)
- (disable-self)
- )
- (defrule
- (true)
- =>
- (enable-wall-placement 2)
- )
- ;=====================> Tribute requests
- (defrule
- (taunt-detected any-ally 3)
- (food-amount > 200)
- (building-type-count market > 0)
- (players-tribute my-player-number food < 2500)
- =>
- (acknowledge-taunt this-any-ally 3)
- (tribute-to-player this-any-ally food 200)
- (chat-to-player this-any-ally "Now go build an army.")
- )
- (defrule
- (taunt-detected any-ally 3)
- (food-amount > 200)
- (building-type-count market > 0)
- (players-tribute my-player-number food >= 2500)
- (players-tribute my-player-number food < 5000)
- =>
- (acknowledge-taunt this-any-ally 3)
- (tribute-to-player this-any-ally food 100)
- (chat-to-player this-any-ally "You SHOULD have enough food already.")
- )
- (defrule
- (taunt-detected any-ally 3)
- (building-type-count market > 0)
- (players-tribute my-player-number food >= 5000)
- =>
- (acknowledge-taunt this-any-ally 3)
- (chat-to-player this-any-ally "I've given you enough food.")
- )
- (defrule
- (taunt-detected any-ally 3)
- (or
- (food-amount < 200)
- (building-type-count market > 0)
- )
- =>
- (acknowledge-taunt this-any-ally 3)
- (chat-to-player this-any-ally "I apologize. I am low on food.")
- )
- (defrule
- (taunt-detected any-ally 4)
- (wood-amount > 200)
- (building-type-count market > 0)
- (players-tribute my-player-number wood < 2500)
- =>
- (acknowledge-taunt this-any-ally 4)
- (tribute-to-player this-any-ally wood 200)
- (chat-to-player this-any-ally "Now go build a city.")
- )
- (defrule
- (taunt-detected any-ally 4)
- (wood-amount > 200)
- (building-type-count market > 0)
- (players-tribute my-player-number wood >= 2500)
- (players-tribute my-player-number wood < 5000)
- =>
- (acknowledge-taunt this-any-ally 4)
- (tribute-to-player this-any-ally wood 100)
- (chat-to-player this-any-ally "You SHOULD have enough wood already.")
- )
- (defrule
- (taunt-detected any-ally 4)
- (building-type-count market > 0)
- (players-tribute my-player-number wood >= 5000)
- =>
- (acknowledge-taunt this-any-ally 4)
- (chat-to-player this-any-ally "I've given you enough wood.")
- )
- (defrule
- (taunt-detected any-ally 4)
- (or
- (wood-amount < 200)
- (building-type-count market > 0)
- )
- =>
- (acknowledge-taunt this-any-ally 4)
- (chat-to-player this-any-ally "I apologize. I am low on wood.")
- )
- (defrule
- (taunt-detected any-ally 5)
- (gold-amount > 400)
- (building-type-count market > 0)
- (players-tribute my-player-number gold < 2500)
- =>
- (acknowledge-taunt this-any-ally 5)
- (tribute-to-player this-any-ally gold 200)
- (chat-to-player this-any-ally "Don't spend it all in one place.")
- )
- (defrule
- (taunt-detected any-ally 5)
- (gold-amount > 400)
- (building-type-count market > 0)
- (players-tribute my-player-number gold >= 2500)
- (players-tribute my-player-number gold < 5000)
- =>
- (acknowledge-taunt this-any-ally 5)
- (tribute-to-player this-any-ally gold 100)
- (chat-to-player this-any-ally "You SHOULD have enough gold already.")
- )
- (defrule
- (taunt-detected any-ally 5)
- (building-type-count market > 0)
- (players-tribute my-player-number food >= 5000)
- =>
- (acknowledge-taunt this-any-ally 5)
- (chat-to-player this-any-ally "I've given you enough gold.")
- )
- (defrule
- (taunt-detected any-ally 5)
- (or
- (gold-amount < 400)
- (building-type-count market > 0)
- )
- =>
- (acknowledge-taunt this-any-ally 5)
- (chat-to-player this-any-ally "I apologize. I am low on gold.")
- )
- (defrule
- (taunt-detected any-ally 6)
- (stone-amount > 800)
- (building-type-count market > 0)
- (players-tribute my-player-number stone < 2500)
- =>
- (acknowledge-taunt this-any-ally 6)
- (tribute-to-player this-any-ally stone 200)
- (chat-to-player this-any-ally "Now go build a castle.")
- )
- (defrule
- (taunt-detected any-ally 6)
- (stone-amount > 800)
- (building-type-count market > 0)
- (players-tribute my-player-number stone >= 2500)
- (players-tribute my-player-number stone < 5000)
- =>
- (acknowledge-taunt this-any-ally 6)
- (tribute-to-player this-any-ally stone 100)
- (chat-to-player this-any-ally "You SHOULD have enough stone already.")
- )
- (defrule
- (taunt-detected any-ally 6)
- (players-tribute my-player-number stone >= 5000)
- (building-type-count market > 0)
- =>
- (acknowledge-taunt this-any-ally 6)
- (chat-to-player this-any-ally "I've given you enough stone.")
- )
- (defrule
- (taunt-detected any-ally 6)
- (or
- (stone-amount < 800)
- (building-type-count market > 0)
- )
- =>
- (acknowledge-taunt this-any-ally 6)
- (chat-to-player this-any-ally "I apologize. I am low on stone.")
- )
Advertisement
Add Comment
Please, Sign In to add comment