Skip to content

Instantly share code, notes, and snippets.

@Andygmb
Created October 26, 2014 21:38
Show Gist options
  • Star 57 You must be signed in to star a gist
  • Fork 11 You must be signed in to fork a gist
  • Save Andygmb/1e3a6d9d444b2dfa8c40 to your computer and use it in GitHub Desktop.
Save Andygmb/1e3a6d9d444b2dfa8c40 to your computer and use it in GitHub Desktop.
; The official HD AI
; An Artificial Intelligence Script written by Archon and Promiskuitiv
; Get in contact with Promiskuitiv by sending a mail to neuernamae@web.de
; List of taunts it reacts to:
; Standard taunts.
; 33 - Stop slinging resources. If slinging is requested early and is immediately canceled it may mess up the strategy.
; 38 - Sling Resources. Human player only, stops any unit production except for civilian units.
; 100 - Forbids the AI to resign.
; 101 - Cancels the 100 taunt.
; 200 - Enables resource cheats - only works on 'hardest' difficulty.
; 222 - Same as 31, but more likely to help (only taunt this if you really need it).
; 230 - Tells the AI to go for a monk rush (taunt only works on civs who have good monks).
; 231-238 - Chat 230+[enemy player number] to make the AI target this enemy for 10 minutes.
; 250 - Chats information about the current strategy.
;Reusing obsolete strategic numbers that have no other effect.
(defconst sn-current-age 193);tracks our current age
(defconst sn-military-level 190); compares our military with enemy
(defconst sn-resource-control 191); 0=spend res free, 1=navy, 2=research only; > 2 specific items
(defconst sn-infantry-threat 53)
(defconst sn-archer-threat 64)
(defconst sn-cavalry-threat 65)
;Goals
(defconst increase-town-size-goal 1); this increases town size when needed, 0 = no increase, 2 = building placed this rule pass, else increase
(defconst attack-goal 2)
(defconst strategy-goal 3)
(defconst unit-goal 4)
(defconst train-civ-goal 5);1=train villagers, !=1 no villagers
(defconst control-goal 6); 6 = allow to be shot, 7 = shot, also controls if stone for a castle is needed.
(defconst anti-cavalry-threat-goal 7)
(defconst monk-threat-goal 8)
(defconst enemy-goal 9); keep track of what our foe is doing
(defconst farm-goal 10);enable/disable farming
(defconst under-attack-goal 11); town under attack or just a little harass?
(defconst enemy-boats-goal 12)
(defconst ffa-game-goal 13)
(defconst need-loom-goal 14)
(defconst escrow-purpose-goal 15); keeps track on what we use our escrow
(defconst spread-military-goal 16); spread military every couple of minutes to prevent villagers stuck
(defconst uu-up-goal 17); use escrow to upgrade uu
(defconst hostilities-goal 18); set this flag when we're attacked or attacking - avoid rule too long error
(defconst ranged-unit-type-goal 19);shows the ranged unit we use
(defconst retreat-now-goal 20); use to retreat with UP, condition: 1=always, 2=when attacking, 3=attack conditions false
(defconst housing-goal 21); used to build multiple houses with UP
(defconst anti-monk-threat-goal 22)
(defconst enemy-sighted-goal 23); when enemy activities detected, split the attack groups
(defconst attack-status-goal 24); indicates if we stop or regroup the attack
(defconst forward-threat-goal 25); enemy tower rush threat
(defconst enemy-fortifications-goal 26); delay attacks if enemy has many castles and walled with castle
(defconst restart-attack-goal 27); restarts attack in team games if TSA was reduced to place a building
(defconst save-wood-goal 28); controls spending wood
(defconst meso-enemy-goal 29); enemy has a meso civ; saves elements in a rule
(defconst nr-map-goal 30); focus on eco in easily wall-able maps vs humans
(defconst tribute-goal 31); ask for resources
(defconst patrol-goal 32); resets patrol attacks sent by the direct unit feature
(defconst split-rule-goal 33); split rule if we need more than 16 elements
(defconst tc-dodging-goal 34); move scout out of TC fire
(defconst kill-scouts-goal 35); kill enemy scouts
(defconst forward-goal 36); -1 no fwd, 1 fwd, ID of building = building requested
(defconst gather-inside-goal 37)
(defconst hunting-goal 38); controls hunting
(defconst micro-goal 41)
(defconst math-goal 42); temporary stored values
(defconst math-goal2 43)
(defconst math-goal3 44)
(defconst math-goal4 45)
(defconst position-goal 46); detect if we're pocket (=2) or flank (=1) player; was here before that many goals were used, shared with other AI
(defconst raid-goal 47); raiding weak player's eco.
(defconst closest-enemy-goal 48); stores player number of nearest enemy
(defconst threat-time-goal 49); stores time in miliseconds we were last attacked
(defconst threat-player-goal 50); stores player number of the attacker
(defconst threat-source-goal 51); unit class of the last enemy attacker
(defconst threat-target-goal 52); unit class of the our last attacked unit
(defconst winning-player 53); player number of enemy winning by specifal victory condition
(defconst victory-type 54); winning type
(defconst victory-time 55); time left
(defconst retargetenemy 56)
(defconst defendchat 57)
(defconst dark-build-order-goal 58); 1 = dock first, 2 = skip farms on a map that has more berries
(defconst closest-ally-goal 59); stores closes flank if pocket instead
(defconst aofe-game-goal 60); set to 1 if forgotten empires expansion is detected
(defconst attacking-enemy-goal 61); stores player number of the attacker; shared with Barbarian
(defconst reset 62); prov
(defconst attackchat 63)
(defconst stanceg 64)
(defconst request 65)
(defconst nomad 66)
(defconst landnomad 67)
(defconst request2 68)
(defconst team-coordination-goal 392); shared with Barbarian and Promi
;SN/Goal Values
(defconst yes 1)
(defconst no 0)
(defconst dark 78)
(defconst df-transit 79)
(defconst feudal 80)
(defconst fc-transit 81)
(defconst castle 82)
(defconst ci-transit 83)
(defconst imperial 84)
(defconst flush 200)
(defconst rush 201)
(defconst boom 202)
(defconst fast-imp 203)
(defconst sling 204)
(defconst drush 205); not used
(defconst mix 1)
(defconst belated-flush-defense 5)
(defconst aggressive-rush 6)
(defconst shot 7)
(defconst uu 8)
(defconst navy 4000)
(defconst flank 1)
(defconst pocket 2)
(defconst retreat 1)
(defconst groups 2)
(defconst tsa 3)
;Timers
(defconst increase-town-size-timer 1)
(defconst reset-town-size-timer 2)
(defconst scouting-timer 3)
(defconst attack-timer 4)
(defconst spread-military-timer 5)
(defconst under-attack-timer 7)
(defconst civ-explore-timer 8)
(defconst lumber-timer 8)
(defconst one-minute-timer 9)
(defconst tribute-timer 10)
(defconst micro-timer 11)
(defconst navy-attack-timer 12); don't spam attack or we can't retreat boats from fortifications
(defconst help-ally-timer 13); indicated when we sent help to ally
(defconst FDrop 14); timer for forcedrop to continuously train villager
(defconst retreat-timer 15); timer to avoid looping retreat unit commands
(defconst hunting-timer 16)
(defconst garrison-timer 17)
(defconst disable-defend-groups-timer 18); always enable defending again
(defconst monk-micro-timer 19)
(defconst misc-micro-timer 20)
(defconst train-forward-timer 21)
(defconst rally-units-timer 22)
(defconst reset-units-timer 23)
(defconst attack-chat 24)
(defconst stance 25)
(defconst thirty 26)
(defconst tensec 27)
(defconst two-minute-timer 28)
(defconst defend-timer 29)
(defconst resign-timer 30)
(defconst human-coop-timer 31)
(defconst tribute-timer2 31)
;Unit IDs
(defconst male-hunter 122)
(defconst female-hunter 216)
(defconst male-forager 120)
(defconst female-forager 354)
(defconst male-shepherd 592)
(defconst female-shepherd 590)
(defconst female-gold-miner 579)
(defconst male-gold-miner 581)
(defconst hunter 976)
(defconst food-gatherer 978)
(defconst ri-herbal-medicine 441)
(defconst ri-perfusion 457)
(defconst ri-anarchy 16)
(defconst ri-spies 408); useless for AIs
(defconst ri-treadmill-crane 54)
(defconst unpacked-trebuchet 42)
(defconst rax-husky-line 759)
(defconst ranged-unit-class 900)
(defconst building-class 903)
(defconst villager-class 904)
(defconst infantry-class 906)
(defconst cavalry-unit-class 912)
(defconst siege-unit-class 913)
(defconst monastery-class 918)
(defconst mounted-gun-class 923)
(defconst cavalry-archer-class 936)
(defconst gunpowder-class 944)
(defconst scorpion-class 955)
(defconst tower-class 952)
(defconst warship-class 922)
(defconst tree-class 915)
(defconst forage-bush 59)
(defconst gold-mine 66)
(defconst stone-mine 102)
(defconst shore-fish 933)
(defconst sea-fish 905)
(defconst sheep 958)
(defconst relic 285)
(defconst revealer 112)
(defconst flare 274)
(defconst tc-arrow 54)
(defconst watch-tower-arrow 786)
(defconst castle-arrow 746)
(defconst castle-arrow-chemistry 747)
;User Patch
(defconst game-time 0); FactId Constants
(defconst population-cap 1)
(defconst population-headroom 2)
(defconst housing-headroom 3)
(defconst idle-farm-count 4)
(defconst food-amount 5)
(defconst wood-amount 6)
(defconst stone-amount 7)
(defconst gold-amount 8)
(defconst escrow-amount 9)
(defconst commodity-buying-price 10)
(defconst commodity-selling-price 11)
(defconst dropsite-min-distance 12)
(defconst soldier-count 13)
(defconst attack-soldier-count 14)
(defconst defend-soldier-count 15)
(defconst warboat-count 16)
(defconst attack-warboat-count 17)
(defconst defend-warboat-count 18)
(defconst current-age 19)
(defconst current-score 20)
(defconst civilization 21)
(defconst player-number 22)
(defconst player-in-game 23)
(defconst unit-count 24)
(defconst unit-type-count 25)
(defconst unit-type-count-total 26)
(defconst building-count 27)
(defconst building-type-count 28)
(defconst building-type-count-total 29)
(defconst population 30)
(defconst military-population 31)
(defconst civilian-population 32)
(defconst random-number 33)
(defconst resource-amount 34)
(defconst player-distance 35)
(defconst allied-goal 36)
(defconst allied-sn 37)
(defconst resource-percent 38)
(defconst enemy-buildings-in-town 39)
(defconst enemy-units-in-town 40)
(defconst enemy-villagers-in-town 41)
(defconst players-in-game 42)
(defconst defender-count 43)
(defconst building-type-in-town 44)
(defconst unit-type-in-town 45)
(defconst villager-type-in-town 46)
(defconst gaia-type-count 47)
(defconst gaia-type-count-total 48)
(defconst cc-gaia-type-count 49)
(defconst aggressive 0)
(defconst defensive 1)
(defconst stand-ground 2)
(defconst no-attack 3)
(defconst projectile-town-center 0); Define ProjectileType Constants
(defconst projectile-castle 1)
(defconst projectile-watch-tower 2)
(defconst projectile-bombard-tower 3)
(defconst projectile-ship 4)
(defconst projectile-siege 5)
(defconst projectile-fortification 6)
(defconst projectile-any 7)
(defconst find-attacker 0); Define FindPlayerMethod Constants
(defconst find-random 1)
(defconst find-closest 2)
(defconst find-ordered 3)
(defconst research-unavailable 0); Define ResearchState Constants
(defconst research-available 1)
(defconst research-pending 2)
(defconst research-complete 3)
(defconst timer-disabled 0); Define TimerState Constants
(defconst timer-triggered 1)
(defconst timer-running 2)
(defconst group-type-land-attack 100);Define GroupType Constants
(defconst group-type-land-explore 101)
(defconst group-type-land-trade 109)
(defconst group-type-water-attack 102)
(defconst group-type-water-explore 103)
(defconst group-type-water-trade 106)
(defconst group-type-transport-ship 104)
(defconst group-type-fishing-ship 105)
(defconst group-type-forward-builder 107)
(defconst group-type-monk 108)
(defconst amount-tribute-inefficiency 46)
(defconst position-center 0)
(defconst position-opposite 1)
(defconst position-corner 2)
(defconst position-enemy 3)
(defconst position-border 4)
(defconst position-mirror 5)
(defconst position-flank 6)
(defconst position-zero 7)
(defconst position-map-size 8)
(defconst position-self 9)
(defconst position-target 10)
(defconst position-focus 11)
(defconst position-object 12)
(defconst position-point 13)
(defconst sort-targets 0)
(defconst sort-random 1)
(defconst sort-distance 2)
(defconst sort-hitpoints 3)
(defconst sort-range 4)
;(defconst find-attacker 0)
;(defconst find-random 1)
;(defconst find-closest 2)
;(defconst find-ordered 3)
(defconst ally 0)
(defconst neutral 1)
(defconst any 2)
(defconst enemy 3)
(defconst forage-food 16)
(defconst sheep-food 958)
(defconst boar-food 910)
#load-if-defined CIV-TAGS-FOR-EDITOR
(defconst ITALIAN-CIV 0)
(defconst MAGYAR-CIV 0)
(defconst INDIAN-CIV 0)
(defconst SLAVIC-CIV 0)
(defconst INCAN-CIV 0)
#end-if
(defconst italian 19)
(defconst indian 20)
(defconst incan 21)
(defconst magyar 22)
(defconst slavic 23)
(defconst stable-tarkan 886)
(defconst stable-elite-tarkan 887)
(defconst boyar 876)
(defconst elite-boyar 878)
(defconst kamayuk 879)
(defconst elite-kamayuk 881)
(defconst slinger 185)
(defconst ri-elite-magyar-huszar 472)
(defconst magyar-huszar 869)
(defconst elite-magyar-huszar 871)
(defconst ri-elite-elephant-archer 481)
(defconst elephant-archer 873)
(defconst elite-elephant-archer 875)
(defconst imperial-camel 897)
(defconst ri-elite-genoese-crossbow 468)
(defconst genoese-crossbowman 866)
(defconst elite-genoese-crossbowman 868)
(defconst heavy-eagle-warrior 753)
(defconst condottiero 882)
(defconst ri-chivalry 493)
(defconst ri-inquisition 492)
(defconst ri-sipahi 491)
(defconst ri-madrasah 490)
(defconst ri-ironclad 489)
(defconst ri-boiling-oil 488)
(defconst ri-nomads 487)
(defconst ri-panokseon 486)
(defconst ri-yasama 484)
(defconst ri-marauders 483)
(defconst ri-atlatl 460)
(defconst ri-war-wolf 461)
(defconst ri-greek-fire 464)
(defconst ri-chieftains 463)
(defconst ri-stronghold 482)
(defconst ri-great-wall 462)
(defconst ri-orthodoxy 512)
(defconst ri-druzhina 513)
(defconst ri-elite-boyar 504)
(defconst ri-andean-sling 516)
(defconst ri-couriers 517)
(defconst ri-elite-kamayuk 509)
(defconst ri-sultans 506)
(defconst ri-shatagni 507)
(defconst ri-imperial-camel 521)
(defconst ri-mercenaries 514)
(defconst ri-recurve-bow 515)
(defconst ri-silk-road 499)
(defconst ri-pavise 494)
(defconst ri-revetments 525)
(defconst ri-eagle-warrior 384)
(defconst ri-gillnets 65)
(defconst ri-hunting-dogs 526)
(defconst ri-obsidian-arrows 485)
(defconst siege-tower 885)
(defconst upgraded-palisade-wall 119)
(defconst sea-tower 785)
(defconst sea-wall 788)
; Other SNs
(defconst sn-food-modifier-percentage 156)
(defconst sn-wood-modifier-percentage 157)
(defconst sn-stone-modifier-percentage 158)
(defconst sn-gold-modifier-percentage 159)
;civ specific
#load-if-defined AZTEC-CIV
(defconst dark-age-villager 28)
(defconst villager-wonder-dark 32)
(defconst villager-wonder-feudal 34)
(defconst default-strategy 201)
(defconst pocket-strategy 202)
(defconst default-unit eagle-warrior)
(defconst unique-unit-food 110);minimum food amount
(defconst default-flush-unit archer)
(defconst no-gold-flush-unit skirmisher)
(defconst default-ranged archer)
(defconst pocket-unit eagle-warrior)
(defconst get-lightcav 0)
(defconst scout-unit eagle-warrior-line)
(defconst military-level-flush 1)
(defconst military-level-flush-aggressive 0)
(defconst allow-forward-castle 1)
(defconst sling-time 600)
(defconst sling-number 100); > 10 actually never slings
(defconst sling-two 0)
(defconst blot-size 0)
(defconst villager-barracks 3)
(defconst villager-stable 3)
(defconst villager-archery-range 9)
(defconst villager-monastery 7)
(defconst villager-town-center 15)
(defconst villager-castle 12)
(defconst villager-mining-camp 14)
(defconst villager-siege-workshop 16)
(defconst villager-market 17)
(defconst number-barracks 10)
(defconst number-stables 5)
(defconst number-archery-ranges 7)
(defconst tc-boom-monastery 2)
(defconst farm-count 14)
(defconst pidm-food 10)
(defconst pidm-wood 10)
(defconst pidm-gold 75)
(defconst pidm-stone 5)
(defconst pidm-food2 34)
(defconst pidm-wood2 28)
(defconst pidm-gold2 33)
(defconst pidm-stone2 5)
(defconst uu-food 36)
(defconst uu-wood 36)
(defconst uu-gold 24)
(defconst uu-stone 4)
(defconst uu-food2 36)
(defconst uu-wood2 30)
(defconst uu-gold2 28)
(defconst uu-stone2 6)
(defconst ci-uu-switch-food 38)
(defconst ci-uu-switch-wood 28)
(defconst ci-uu-switch-gold 28)
(defconst ci-uu-switch-stone 6)
(defconst evaluation-hitpoints 0)
(defconst evaluation-distance 100)
(defconst max-food-escrow 1000)
(defconst max-gold-escrow 500)
#end-if
#load-if-defined BRITON-CIV
(defconst dark-age-villager 28)
(defconst villager-wonder-dark 32)
(defconst villager-wonder-feudal 34)
(defconst default-strategy 200)
(defconst pocket-strategy 202)
(defconst default-unit archer)
(defconst unique-unit-food 0)
(defconst default-flush-unit archer)
(defconst no-gold-flush-unit skirmisher)
(defconst default-ranged archer)
(defconst pocket-unit my-unique-unit-line)
(defconst get-lightcav 0)
(defconst scout-unit scout-cavalry-line)
(defconst military-level-flush 2)
(defconst military-level-flush-aggressive 1)
(defconst allow-forward-castle 0)
(defconst sling-time 600)
(defconst sling-number 90)
(defconst sling-two 1)
(defconst blot-size 1)
(defconst villager-barracks 3)
(defconst villager-stable 3)
(defconst villager-archery-range 12)
(defconst villager-monastery 7)
(defconst villager-town-center 8)
(defconst villager-castle 3)
(defconst villager-mining-camp 14)
(defconst villager-siege-workshop 16)
(defconst villager-market 17)
(defconst number-barracks 6)
(defconst number-stables 0)
(defconst number-archery-ranges 9)
(defconst tc-boom-monastery 3)
(defconst farm-count 14)
(defconst pidm-food 0)
(defconst pidm-wood 47)
(defconst pidm-gold 48)
(defconst pidm-stone 5)
(defconst pidm-food2 26)
(defconst pidm-wood2 34)
(defconst pidm-gold2 35)
(defconst pidm-stone2 5)
(defconst uu-food 36)
(defconst uu-wood 44)
(defconst uu-gold 16)
(defconst uu-stone 4)
(defconst uu-food2 30)
(defconst uu-wood2 36)
(defconst uu-gold2 28)
(defconst uu-stone2 6)
(defconst ci-uu-switch-food 30)
(defconst ci-uu-switch-wood 40)
(defconst ci-uu-switch-gold 26)
(defconst ci-uu-switch-stone 6)
(defconst evaluation-hitpoints 100)
(defconst evaluation-distance 0)
(defconst max-food-escrow 850)
(defconst max-gold-escrow 850)
#end-if
#load-if-defined BYZANTINE-CIV
(defconst dark-age-villager 30)
(defconst villager-wonder-dark 32)
(defconst villager-wonder-feudal 34)
(defconst default-strategy 201)
(defconst pocket-strategy 201)
(defconst default-unit skirmisher)
(defconst unique-unit-food 120)
(defconst default-flush-unit skirmisher)
(defconst no-gold-flush-unit skirmisher)
(defconst default-ranged archer)
(defconst pocket-unit skirmisher)
(defconst get-lightcav 0)
(defconst scout-unit scout-cavalry-line)
(defconst military-level-flush 2)
(defconst military-level-flush-aggressive 1)
(defconst allow-forward-castle 0)
(defconst sling-time 270)
(defconst sling-number 80)
(defconst sling-two 0)
(defconst blot-size 1)
(defconst villager-barracks 9)
(defconst villager-stable 3)
(defconst villager-archery-range 12)
(defconst villager-monastery 12)
(defconst villager-town-center 15)
(defconst villager-castle 3)
(defconst villager-mining-camp 14)
(defconst villager-siege-workshop 16)
(defconst villager-market 17)
(defconst number-barracks 6)
(defconst number-stables 5)
(defconst number-archery-ranges 7)
(defconst tc-boom-monastery 2)
(defconst farm-count 14)
(defconst pidm-food 10)
(defconst pidm-wood 10)
(defconst pidm-gold 75)
(defconst pidm-stone 5)
(defconst pidm-food2 37)
(defconst pidm-wood2 32)
(defconst pidm-gold2 27)
(defconst pidm-stone2 4)
(defconst uu-food 36)
(defconst uu-wood 44)
(defconst uu-gold 16)
(defconst uu-stone 4)
(defconst uu-food2 39)
(defconst uu-wood2 39)
(defconst uu-gold2 18)
(defconst uu-stone2 3)
(defconst ci-uu-switch-food 38)
(defconst ci-uu-switch-wood 37)
(defconst ci-uu-switch-gold 18)
(defconst ci-uu-switch-stone 6)
(defconst evaluation-hitpoints 100)
(defconst evaluation-distance 0)
(defconst max-food-escrow 1600)
(defconst max-gold-escrow 800)
#end-if
#load-if-defined CELTIC-CIV
(defconst dark-age-villager 29)
(defconst villager-wonder-dark 32)
(defconst villager-wonder-feudal 34)
(defconst default-strategy 200)
(defconst pocket-strategy 201)
(defconst default-unit militiaman-line)
(defconst unique-unit-food 115)
(defconst default-flush-unit skirmisher)
(defconst no-gold-flush-unit skirmisher)
(defconst default-ranged 0)
(defconst pocket-unit knight)
(defconst get-lightcav 0)
(defconst scout-unit scout-cavalry-line)
(defconst military-level-flush 2)
(defconst military-level-flush-aggressive 1)
(defconst allow-forward-castle 0)
(defconst sling-time 210)
(defconst sling-number 55)
(defconst sling-two 1)
(defconst blot-size 1)
(defconst villager-barracks 3)
(defconst villager-stable 3)
(defconst villager-archery-range 9)
(defconst villager-monastery 7)
(defconst villager-town-center 8)
(defconst villager-castle 5)
(defconst villager-mining-camp 14)
(defconst villager-siege-workshop 16)
(defconst villager-market 17)
(defconst number-barracks 9)
(defconst number-stables 3)
(defconst number-archery-ranges 4)
(defconst tc-boom-monastery 2)
(defconst farm-count 16)
(defconst pidm-food 30)
(defconst pidm-wood 10)
(defconst pidm-gold 55)
(defconst pidm-stone 5)
(defconst pidm-food2 34)
(defconst pidm-wood2 28)
(defconst pidm-gold2 33)
(defconst pidm-stone2 5)
(defconst uu-food 39)
(defconst uu-wood 45)
(defconst uu-gold 13)
(defconst uu-stone 3)
(defconst uu-food2 40)
(defconst uu-wood2 28)
(defconst uu-gold2 28)
(defconst uu-stone2 4)
(defconst ci-uu-switch-food 38)
(defconst ci-uu-switch-wood 28)
(defconst ci-uu-switch-gold 28)
(defconst ci-uu-switch-stone 6)
(defconst evaluation-hitpoints 100)
(defconst evaluation-distance 0)
(defconst max-food-escrow 1000)
(defconst max-gold-escrow 800)
#end-if
#load-if-defined CHINESE-CIV
(defconst dark-age-villager 29)
(defconst villager-wonder-dark 33)
(defconst villager-wonder-feudal 35)
(defconst default-strategy 201)
(defconst pocket-strategy 202)
(defconst default-unit knight)
(defconst unique-unit-food 0)
(defconst default-flush-unit scout-cavalry)
(defconst no-gold-flush-unit scout-cavalry)
(defconst default-ranged archer)
(defconst pocket-unit my-unique-unit-line)
(defconst get-lightcav 0)
(defconst scout-unit scout-cavalry-line)
(defconst military-level-flush 1)
(defconst military-level-flush-aggressive 0)
(defconst allow-forward-castle 0)
(defconst sling-time 260)
(defconst sling-number 70)
(defconst sling-two 0)
(defconst blot-size 1)
(defconst villager-barracks 9)
(defconst villager-stable 3)
(defconst villager-archery-range 16)
(defconst villager-monastery 12)
(defconst villager-town-center 15)
(defconst villager-castle 5)
(defconst villager-mining-camp 14)
(defconst villager-siege-workshop 16)
(defconst villager-market 17)
(defconst number-barracks 6)
(defconst number-stables 8)
(defconst number-archery-ranges 6)
(defconst tc-boom-monastery 3)
(defconst farm-count 14)
(defconst pidm-food 0)
(defconst pidm-wood 47)
(defconst pidm-gold 48)
(defconst pidm-stone 5)
(defconst pidm-food2 26)
(defconst pidm-wood2 34)
(defconst pidm-gold2 35)
(defconst pidm-stone2 5)
(defconst uu-food 36)
(defconst uu-wood 44)
(defconst uu-gold 16)
(defconst uu-stone 4)
(defconst uu-food2 32)
(defconst uu-wood2 38)
(defconst uu-gold2 24)
(defconst uu-stone2 6)
(defconst ci-uu-switch-food 34)
(defconst ci-uu-switch-wood 34)
(defconst ci-uu-switch-gold 26)
(defconst ci-uu-switch-stone 6)
(defconst evaluation-hitpoints 0)
(defconst evaluation-distance 100)
(defconst max-food-escrow 760)
(defconst max-gold-escrow 760)
#end-if
#load-if-defined FRANKISH-CIV
(defconst dark-age-villager 29)
(defconst villager-wonder-dark 32)
(defconst villager-wonder-feudal 34)
(defconst default-strategy 201)
(defconst pocket-strategy 201)
(defconst default-unit knight)
(defconst unique-unit-food 0)
(defconst default-flush-unit skirmisher)
(defconst no-gold-flush-unit skirmisher)
(defconst default-ranged archer)
(defconst pocket-unit knight)
(defconst get-lightcav 0)
(defconst scout-unit scout-cavalry-line)
(defconst military-level-flush 1)
(defconst military-level-flush-aggressive 0)
(defconst allow-forward-castle 1)
(defconst sling-time 600)
(defconst sling-number 100)
(defconst sling-two 0)
(defconst blot-size 1)
(defconst villager-barracks 9)
(defconst villager-stable 3)
(defconst villager-archery-range 16)
(defconst villager-monastery 12)
(defconst villager-town-center 18)
(defconst villager-castle 8)
(defconst villager-mining-camp 14)
(defconst villager-siege-workshop 14)
(defconst villager-market 8)
(defconst number-barracks 8)
(defconst number-stables 10)
(defconst number-archery-ranges 4)
(defconst tc-boom-monastery 2)
(defconst farm-count 15)
(defconst pidm-food 45)
(defconst pidm-wood 0)
(defconst pidm-gold 50)
(defconst pidm-stone 5)
(defconst pidm-food2 34)
(defconst pidm-wood2 28)
(defconst pidm-gold2 33)
(defconst pidm-stone2 5)
(defconst uu-food 36)
(defconst uu-wood 44)
(defconst uu-gold 16)
(defconst uu-stone 4)
(defconst uu-food2 44)
(defconst uu-wood2 26)
(defconst uu-gold2 25)
(defconst uu-stone2 5)
(defconst ci-uu-switch-food 43)
(defconst ci-uu-switch-wood 26)
(defconst ci-uu-switch-gold 25)
(defconst ci-uu-switch-stone 6)
(defconst evaluation-hitpoints 0)
(defconst evaluation-distance 100)
(defconst max-food-escrow 1000)
(defconst max-gold-escrow 850)
#end-if
#load-if-defined GOTHIC-CIV
(defconst dark-age-villager 30)
(defconst villager-wonder-dark 33)
(defconst villager-wonder-feudal 35)
(defconst default-strategy 200)
(defconst pocket-strategy 201)
(defconst default-unit militiaman-line)
(defconst unique-unit-food 100)
(defconst default-flush-unit militiaman-line)
(defconst no-gold-flush-unit skirmisher)
#load-if-not-defined POST-IMPERIAL-AGE-START
(defconst default-ranged archer)
#else
(defconst default-ranged scorpion)
#end-if
(defconst pocket-unit knight)
(defconst get-lightcav 0)
(defconst scout-unit scout-cavalry-line)
(defconst military-level-flush 1)
(defconst military-level-flush-aggressive 0)
(defconst allow-forward-castle 1)
(defconst sling-time 250)
(defconst sling-number 40)
(defconst sling-two 0)
(defconst blot-size 1)
(defconst villager-barracks 3)
(defconst villager-stable 20)
(defconst villager-archery-range 14)
(defconst villager-monastery 12)
(defconst villager-castle 10)
(defconst villager-mining-camp 14)
(defconst villager-town-center 18)
(defconst villager-siege-workshop 15)
(defconst villager-market 9)
(defconst number-barracks 14)
(defconst number-stables 1)
(defconst number-archery-ranges 4)
(defconst tc-boom-monastery 2)
(defconst farm-count 14)
(defconst pidm-food 52)
(defconst pidm-wood 12)
(defconst pidm-gold 36)
(defconst pidm-stone 0)
(defconst pidm-food2 36)
(defconst pidm-wood2 23)
(defconst pidm-gold2 36)
(defconst pidm-stone2 5)
(defconst uu-food 36)
(defconst uu-wood 44)
(defconst uu-gold 16)
(defconst uu-stone 4)
(defconst uu-food2 51)
(defconst uu-wood2 28)
(defconst uu-gold2 19)
(defconst uu-stone2 2)
(defconst ci-uu-switch-food 46)
(defconst ci-uu-switch-wood 28)
(defconst ci-uu-switch-gold 20)
(defconst ci-uu-switch-stone 6)
(defconst evaluation-hitpoints 100)
(defconst evaluation-distance 0)
(defconst max-food-escrow 1200)
(defconst max-gold-escrow 550)
#end-if
#load-if-defined HUN-CIV
(defconst dark-age-villager 29)
(defconst villager-wonder-dark 32)
(defconst villager-wonder-feudal 34)
(defconst default-strategy 201)
(defconst pocket-strategy 201)
(defconst default-unit knight)
(defconst unique-unit-food 0)
(defconst default-flush-unit scout-cavalry)
(defconst no-gold-flush-unit scout-cavalry)
(defconst default-ranged cavalry-archer)
(defconst pocket-unit knight)
(defconst get-lightcav 1)
(defconst scout-unit scout-cavalry-line)
(defconst military-level-flush 1)
(defconst military-level-flush-aggressive 0)
(defconst allow-forward-castle 1)
(defconst sling-time 600)
(defconst sling-number 100)
(defconst sling-two 0)
(defconst blot-size 1)
(defconst villager-barracks 3)
(defconst villager-stable 3)
(defconst villager-castle 10)
(defconst villager-archery-range 8)
(defconst villager-monastery 6)
(defconst villager-mining-camp 16)
(defconst villager-town-center 15)
(defconst villager-siege-workshop 5)
(defconst villager-market 12)
(defconst number-barracks 9)
(defconst number-stables 8)
(defconst number-archery-ranges 12)
(defconst tc-boom-monastery 2)
(defconst farm-count 14)
(defconst pidm-food 0)
(defconst pidm-wood 30)
(defconst pidm-gold 67)
(defconst pidm-stone 3)
(defconst pidm-food2 30)
(defconst pidm-wood2 32)
(defconst pidm-gold2 33)
(defconst pidm-stone2 5)
(defconst uu-food 36)
(defconst uu-wood 44)
(defconst uu-gold 16)
(defconst uu-stone 4)
(defconst uu-food2 30)
(defconst uu-wood2 36)
(defconst uu-gold2 28)
(defconst uu-stone2 6)
(defconst ci-uu-switch-food 38)
(defconst ci-uu-switch-wood 28)
(defconst ci-uu-switch-gold 28)
(defconst ci-uu-switch-stone 6)
(defconst evaluation-hitpoints 0)
(defconst evaluation-distance 100)
(defconst max-food-escrow 1000)
(defconst max-gold-escrow 500)
#end-if
#load-if-defined JAPANESE-CIV
(defconst dark-age-villager 30)
(defconst villager-wonder-dark 32)
(defconst villager-wonder-feudal 34)
(defconst default-strategy 200)
(defconst pocket-strategy 202)
(defconst default-unit archer)
(defconst unique-unit-food 110)
(defconst default-flush-unit archer)
(defconst no-gold-flush-unit skirmisher)
(defconst default-ranged archer)
(defconst pocket-unit archer)
(defconst get-lightcav 0)
(defconst scout-unit scout-cavalry-line)
(defconst military-level-flush 1)
(defconst military-level-flush-aggressive 0)
(defconst allow-forward-castle 0)
(defconst sling-time 200)
(defconst sling-number 55)
(defconst sling-two 0)
(defconst blot-size 1)
(defconst villager-barracks 3)
(defconst villager-stable 3)
(defconst villager-archery-range 9)
(defconst villager-monastery 7)
(defconst villager-town-center 8)
(defconst villager-castle 5)
(defconst villager-mining-camp 14)
(defconst villager-siege-workshop 16)
(defconst villager-market 17)
(defconst number-barracks 9)
(defconst number-stables 1)
(defconst number-archery-ranges 7)
(defconst tc-boom-monastery 2)
(defconst farm-count 16)
(defconst pidm-food 30)
(defconst pidm-wood 10)
(defconst pidm-gold 60)
(defconst pidm-stone 0)
(defconst pidm-food2 38)
(defconst pidm-wood2 30)
(defconst pidm-gold2 27)
(defconst pidm-stone2 5)
(defconst uu-food 36)
(defconst uu-wood 44)
(defconst uu-gold 16)
(defconst uu-stone 4)
(defconst uu-food2 38)
(defconst uu-wood2 28)
(defconst uu-gold2 28)
(defconst uu-stone2 6)
(defconst ci-uu-switch-food 38)
(defconst ci-uu-switch-wood 28)
(defconst ci-uu-switch-gold 28)
(defconst ci-uu-switch-stone 6)
(defconst evaluation-hitpoints 100)
(defconst evaluation-distance 0)
(defconst max-food-escrow 950)
(defconst max-gold-escrow 875)
#end-if
#load-if-defined KOREAN-CIV
(defconst dark-age-villager 29)
(defconst villager-wonder-dark 33)
(defconst villager-wonder-feudal 35)
(defconst default-strategy 200)
(defconst pocket-strategy 202)
(defconst default-unit my-unique-unit-line)
(defconst unique-unit-food 0)
(defconst default-flush-unit archer)
(defconst no-gold-flush-unit skirmisher)
(defconst default-ranged archer)
(defconst pocket-unit my-unique-unit-line)
(defconst get-lightcav 0)
(defconst scout-unit scout-cavalry-line)
(defconst military-level-flush 1)
(defconst military-level-flush-aggressive 0)
(defconst allow-forward-castle 0)
(defconst sling-time 180)
(defconst sling-number 20)
(defconst sling-two 1)
(defconst blot-size 1)
(defconst villager-barracks 3)
(defconst villager-stable 16)
(defconst villager-archery-range 13)
(defconst villager-monastery 7)
(defconst villager-town-center 8)
(defconst villager-castle 4)
(defconst villager-mining-camp 14)
(defconst villager-siege-workshop 8)
(defconst villager-market 17)
(defconst number-barracks 6)
(defconst number-stables 1)
(defconst number-archery-ranges 7)
(defconst tc-boom-monastery 3)
(defconst farm-count 14)
(defconst pidm-food 0)
(defconst pidm-wood 58)
(defconst pidm-gold 37)
(defconst pidm-stone 5)
(defconst pidm-food2 26)
(defconst pidm-wood2 39)
(defconst pidm-gold2 30)
(defconst pidm-stone2 5)
(defconst uu-food 36)
(defconst uu-wood 48)
(defconst uu-gold 12)
(defconst uu-stone 4)
(defconst uu-food2 25)
(defconst uu-wood2 44)
(defconst uu-gold2 25)
(defconst uu-stone2 6)
(defconst ci-uu-switch-food 28)
(defconst ci-uu-switch-wood 40)
(defconst ci-uu-switch-gold 26)
(defconst ci-uu-switch-stone 6)
(defconst evaluation-hitpoints 100)
(defconst evaluation-distance 0)
(defconst max-food-escrow 0)
(defconst max-gold-escrow 800)
#end-if
#load-if-defined MAYAN-CIV
(defconst dark-age-villager 28)
(defconst villager-wonder-dark 32)
(defconst villager-wonder-feudal 34)
(defconst default-strategy 201)
(defconst pocket-strategy 202)
(defconst default-unit archer)
(defconst unique-unit-food 0)
(defconst default-flush-unit archer)
(defconst no-gold-flush-unit skirmisher)
(defconst default-ranged archer)
(defconst pocket-unit my-unique-unit-line)
(defconst get-lightcav 0)
(defconst scout-unit eagle-warrior-line)
(defconst military-level-flush 2)
(defconst military-level-flush-aggressive 1)
(defconst allow-forward-castle 0)
(defconst sling-time 600)
(defconst sling-number 100)
(defconst sling-two 0)
(defconst blot-size 0)
(defconst villager-barracks 3)
(defconst villager-stable 3)
(defconst villager-archery-range 14)
(defconst villager-monastery 15)
(defconst villager-town-center 15)
(defconst villager-castle 4)
(defconst villager-mining-camp 14)
(defconst villager-siege-workshop 12)
(defconst villager-market 17)
(defconst number-barracks 7)
(defconst number-stables 0)
(defconst number-archery-ranges 7)
(defconst tc-boom-monastery 3)
(defconst farm-count 14)
(defconst pidm-food 0)
(defconst pidm-wood 47)
(defconst pidm-gold 48)
(defconst pidm-stone 5)
(defconst pidm-food2 26)
(defconst pidm-wood2 34)
(defconst pidm-gold2 35)
(defconst pidm-stone2 5)
(defconst uu-food 36)
(defconst uu-wood 44)
(defconst uu-gold 16)
(defconst uu-stone 4)
(defconst uu-food2 33)
(defconst uu-wood2 39)
(defconst uu-gold2 23)
(defconst uu-stone2 4)
(defconst ci-uu-switch-food 28)
(defconst ci-uu-switch-wood 38)
(defconst ci-uu-switch-gold 28)
(defconst ci-uu-switch-stone 6)
(defconst evaluation-hitpoints 0)
(defconst evaluation-distance 100)
(defconst max-food-escrow 500)
(defconst max-gold-escrow 0)
#end-if
#load-if-defined MONGOL-CIV
(defconst dark-age-villager 28)
(defconst villager-wonder-dark 32)
(defconst villager-wonder-feudal 34)
(defconst default-strategy 200)
(defconst pocket-strategy 202)
(defconst default-unit knight)
(defconst default-flush-unit scout-cavalry)
(defconst no-gold-flush-unit scout-cavalry)
(defconst unique-unit-food 0)
(defconst default-ranged cavalry-archer)
(defconst pocket-unit my-unique-unit-line)
(defconst get-lightcav 1)
(defconst scout-unit scout-cavalry-line)
(defconst military-level-flush 1)
(defconst military-level-flush-aggressive 0)
(defconst allow-forward-castle 0)
(defconst sling-time 230)
(defconst sling-number 50)
(defconst sling-two 0)
(defconst blot-size 0)
(defconst villager-barracks 14)
(defconst villager-stable 3)
(defconst villager-archery-range 14)
(defconst villager-monastery 7)
(defconst villager-town-center 8)
(defconst villager-castle 3)
(defconst villager-mining-camp 14)
(defconst villager-siege-workshop 8)
(defconst villager-market 17)
(defconst number-barracks 6)
(defconst number-stables 5)
(defconst number-archery-ranges 7)
(defconst tc-boom-monastery 3)
(defconst farm-count 14)
(defconst pidm-food 0)
(defconst pidm-wood 30)
(defconst pidm-gold 65)
(defconst pidm-stone 5)
(defconst pidm-food2 26)
(defconst pidm-wood2 34)
(defconst pidm-gold2 35)
(defconst pidm-stone2 5)
(defconst uu-food 36)
(defconst uu-wood 44)
(defconst uu-gold 16)
(defconst uu-stone 4)
(defconst uu-food2 30)
(defconst uu-wood2 36)
(defconst uu-gold2 28)
(defconst uu-stone2 6)
(defconst ci-uu-switch-food 35)
(defconst ci-uu-switch-wood 33)
(defconst ci-uu-switch-gold 26)
(defconst ci-uu-switch-stone 6)
(defconst evaluation-hitpoints 0)
(defconst evaluation-distance 100)
(defconst max-food-escrow 1100)
(defconst max-gold-escrow 675)
#end-if
#load-if-defined PERSIAN-CIV
(defconst dark-age-villager 30)
(defconst villager-wonder-dark 33)
(defconst villager-wonder-feudal 35)
(defconst default-strategy 201)
(defconst pocket-strategy 201)
(defconst default-unit knight)
(defconst default-flush-unit scout-cavalry)
(defconst no-gold-flush-unit scout-cavalry)
(defconst unique-unit-food 0)
(defconst default-ranged archer)
(defconst pocket-unit knight)
(defconst get-lightcav 1)
(defconst scout-unit scout-cavalry-line)
(defconst military-level-flush 1)
(defconst military-level-flush-aggressive 0)
(defconst allow-forward-castle 1)
(defconst sling-time 240)
(defconst sling-number 60)
(defconst sling-two 0)
(defconst blot-size 1)
(defconst villager-barracks 7)
(defconst villager-stable 3)
(defconst villager-archery-range 16)
(defconst villager-monastery 12)
(defconst villager-town-center 18)
(defconst villager-castle 5)
(defconst villager-mining-camp 14)
(defconst villager-siege-workshop 7)
(defconst villager-market 17)
(defconst number-barracks 4)
(defconst number-stables 6)
(defconst number-archery-ranges 7)
(defconst tc-boom-monastery 2)
(defconst farm-count 14)
(defconst pidm-food 37)
(defconst pidm-wood 0)
(defconst pidm-gold 58)
(defconst pidm-stone 5)
(defconst pidm-food2 34)
(defconst pidm-wood2 28)
(defconst pidm-gold2 33)
(defconst pidm-stone2 5)
(defconst uu-food 36)
(defconst uu-wood 44)
(defconst uu-gold 16)
(defconst uu-stone 4)
(defconst uu-food2 43)
(defconst uu-wood2 24)
(defconst uu-gold2 29)
(defconst uu-stone2 4)
(defconst ci-uu-switch-food 40)
(defconst ci-uu-switch-wood 28)
(defconst ci-uu-switch-gold 20)
(defconst ci-uu-switch-stone 12)
(defconst evaluation-hitpoints 0)
(defconst evaluation-distance 100)
(defconst max-food-escrow 1600)
(defconst max-gold-escrow 1200)
#end-if
#load-if-defined SARACEN-CIV
(defconst dark-age-villager 30)
(defconst villager-wonder-dark 33)
(defconst villager-wonder-feudal 35)
(defconst default-strategy 200)
(defconst pocket-strategy 201)
#load-if-not-defined POST-IMPERIAL-AGE-START
(defconst default-unit knight)
#else
(defconst default-unit my-unique-unit-line)
#end-if
(defconst unique-unit-food 135)
(defconst default-flush-unit scout-cavalry)
(defconst no-gold-flush-unit scout-cavalry)
(defconst default-ranged archer)
(defconst pocket-unit archer)
(defconst get-lightcav 1)
(defconst scout-unit scout-cavalry-line)
(defconst military-level-flush 1)
(defconst military-level-flush-aggressive 0)
(defconst allow-forward-castle 1)
(defconst sling-time 190)
(defconst sling-number 25)
(defconst sling-two 1)
(defconst blot-size 1)
(defconst villager-barracks 9)
(defconst villager-stable 3)
(defconst villager-archery-range 9)
(defconst villager-monastery 15)
(defconst villager-town-center 18)
(defconst villager-castle 9)
(defconst villager-mining-camp 14)
(defconst villager-siege-workshop 16)
(defconst villager-market 9)
(defconst number-barracks 6)
(defconst number-stables 9)
(defconst number-archery-ranges 8)
(defconst tc-boom-monastery 2)
(defconst farm-count 14)
(defconst pidm-food 10)
(defconst pidm-wood 10)
(defconst pidm-gold 75)
(defconst pidm-stone 5)
(defconst pidm-food2 34)
(defconst pidm-wood2 28)
(defconst pidm-gold2 33)
(defconst pidm-stone2 5)
(defconst uu-food 36)
(defconst uu-wood 44)
(defconst uu-gold 16)
(defconst uu-stone 4)
(defconst uu-food2 30)
(defconst uu-wood2 36)
(defconst uu-gold2 28)
(defconst uu-stone2 6)
(defconst ci-uu-switch-food 33)
(defconst ci-uu-switch-wood 33)
(defconst ci-uu-switch-gold 28)
(defconst ci-uu-switch-stone 6)
(defconst evaluation-hitpoints 100)
(defconst evaluation-distance 0)
(defconst max-food-escrow 600)
(defconst max-gold-escrow 500)
#end-if
#load-if-defined SPANISH-CIV
(defconst dark-age-villager 30)
(defconst villager-wonder-dark 33)
(defconst villager-wonder-feudal 35)
(defconst default-strategy 201)
(defconst pocket-strategy 201)
(defconst default-unit knight)
(defconst unique-unit-food 110)
(defconst default-flush-unit skirmisher)
(defconst no-gold-flush-unit skirmisher)
(defconst default-ranged cavalry-archer)
(defconst pocket-unit knight)
(defconst get-lightcav 1)
(defconst scout-unit scout-cavalry-line)
(defconst military-level-flush 1)
(defconst military-level-flush-aggressive 0)
(defconst allow-forward-castle 0)
(defconst sling-time 600)
(defconst sling-number 100)
(defconst sling-two 0)
(defconst blot-size 1)
(defconst villager-barracks 14)
(defconst villager-stable 3)
(defconst villager-archery-range 16)
(defconst villager-monastery 12)
(defconst villager-town-center 18)
(defconst villager-castle 5)
(defconst villager-mining-camp 14)
(defconst villager-siege-workshop 16)
(defconst villager-market 17)
(defconst number-barracks 8)
(defconst number-stables 6)
(defconst number-archery-ranges 4)
(defconst tc-boom-monastery 2)
(defconst farm-count 14)
(defconst pidm-food 45)
(defconst pidm-wood 0)
(defconst pidm-gold 50)
(defconst pidm-stone 5)
(defconst pidm-food2 34)
(defconst pidm-wood2 28)
(defconst pidm-gold2 33)
(defconst pidm-stone2 5)
(defconst uu-food 36)
(defconst uu-wood 44)
(defconst uu-gold 16)
(defconst uu-stone 4)
(defconst uu-food2 42)
(defconst uu-wood2 24)
(defconst uu-gold2 28)
(defconst uu-stone2 6)
(defconst ci-uu-switch-food 42)
(defconst ci-uu-switch-wood 24)
(defconst ci-uu-switch-gold 28)
(defconst ci-uu-switch-stone 6)
(defconst evaluation-hitpoints 0)
(defconst evaluation-distance 100)
(defconst max-food-escrow 1200)
(defconst max-gold-escrow 600)
#end-if
#load-if-defined TEUTONIC-CIV
(defconst dark-age-villager 29)
(defconst villager-wonder-dark 32)
(defconst villager-wonder-feudal 34)
(defconst default-strategy 201)
(defconst pocket-strategy 201)
(defconst default-unit knight)
(defconst unique-unit-food 0)
(defconst default-flush-unit skirmisher)
(defconst no-gold-flush-unit skirmisher)
(defconst default-ranged archer)
(defconst pocket-unit knight)
(defconst get-lightcav 0)
(defconst scout-unit scout-cavalry-line)
(defconst military-level-flush 1)
(defconst military-level-flush-aggressive 0)
(defconst allow-forward-castle 0)
(defconst sling-time 600)
(defconst sling-number 100)
(defconst sling-two 0)
(defconst blot-size 1)
(defconst villager-barracks 14)
(defconst villager-stable 3)
(defconst villager-archery-range 16)
(defconst villager-monastery 12)
(defconst villager-town-center 18)
(defconst villager-castle 5)
(defconst villager-mining-camp 14)
(defconst villager-siege-workshop 7)
(defconst villager-market 17)
(defconst number-barracks 8)
(defconst number-stables 6)
(defconst number-archery-ranges 4)
(defconst tc-boom-monastery 2)
(defconst farm-count 16)
(defconst pidm-food 45)
(defconst pidm-wood 0)
(defconst pidm-gold 50)
(defconst pidm-stone 5)
(defconst pidm-food2 34)
(defconst pidm-wood2 28)
(defconst pidm-gold2 33)
(defconst pidm-stone2 5)
(defconst uu-food 36)
(defconst uu-wood 36)
(defconst uu-gold 24)
(defconst uu-stone 4)
(defconst uu-food2 42)
(defconst uu-wood2 24)
(defconst uu-gold2 28)
(defconst uu-stone2 6)
(defconst ci-uu-switch-food 42)
(defconst ci-uu-switch-wood 24)
(defconst ci-uu-switch-gold 28)
(defconst ci-uu-switch-stone 6)
(defconst evaluation-hitpoints 0)
(defconst evaluation-distance 100)
(defconst max-food-escrow 1200)
(defconst max-gold-escrow 600)
(defconst farm-wood 40)
#else
(defconst farm-wood 60)
#end-if
#load-if-defined TURKISH-CIV
(defconst dark-age-villager 30)
(defconst villager-wonder-dark 33)
(defconst villager-wonder-feudal 35)
(defconst default-strategy 201)
(defconst pocket-strategy 201)
(defconst default-unit knight)
(defconst unique-unit-food 110)
(defconst default-flush-unit scout-cavalry)
(defconst no-gold-flush-unit scout-cavalry)
#load-if-not-defined POST-IMPERIAL-AGE-START
(defconst default-ranged archer)
#else
(defconst default-ranged cavalry-archer)
#end-if
(defconst pocket-unit knight)
(defconst get-lightcav 1)
(defconst scout-unit scout-cavalry-line)
(defconst military-level-flush 1)
(defconst military-level-flush-aggressive 0)
(defconst allow-forward-castle 1)
(defconst sling-time 220)
(defconst sling-number 35)
(defconst sling-two 1)
(defconst blot-size 1)
(defconst villager-barracks 14)
(defconst villager-stable 3)
(defconst villager-archery-range 3)
(defconst villager-monastery 7)
(defconst villager-town-center 8)
(defconst villager-castle 5)
(defconst villager-mining-camp 14)
(defconst villager-siege-workshop 16)
(defconst villager-market 17)
(defconst number-barracks 6)
(defconst number-stables 7)
(defconst number-archery-ranges 4)
(defconst tc-boom-monastery 2)
(defconst farm-count 14)
(defconst pidm-food 45)
(defconst pidm-wood 0)
(defconst pidm-gold 50)
(defconst pidm-stone 5)
(defconst pidm-food2 42)
(defconst pidm-wood2 20)
(defconst pidm-gold2 33)
(defconst pidm-stone2 5)
(defconst uu-food 36)
(defconst uu-wood 44)
(defconst uu-gold 16)
(defconst uu-stone 4)
(defconst uu-food2 40)
(defconst uu-wood2 26)
(defconst uu-gold2 28)
(defconst uu-stone2 6)
(defconst ci-uu-switch-food 42)
(defconst ci-uu-switch-wood 24)
(defconst ci-uu-switch-gold 28)
(defconst ci-uu-switch-stone 6)
(defconst evaluation-hitpoints 0)
(defconst evaluation-distance 100)
(defconst max-food-escrow 850)
(defconst max-gold-escrow 750)
#end-if
#load-if-defined VIKING-CIV
(defconst dark-age-villager 30)
(defconst villager-wonder-dark 33)
(defconst villager-wonder-feudal 35)
(defconst default-strategy 201)
(defconst pocket-strategy 202)
(defconst default-unit militiaman-line)
(defconst unique-unit-food 115)
(defconst default-flush-unit archer)
(defconst no-gold-flush-unit skirmisher)
(defconst default-ranged archer)
(defconst pocket-unit archer)
(defconst get-lightcav 0)
(defconst scout-unit scout-cavalry-line)
(defconst military-level-flush 1)
(defconst military-level-flush-aggressive 0)
(defconst allow-forward-castle 1)
(defconst sling-time 600)
(defconst sling-number 95)
(defconst sling-two 0)
(defconst blot-size 1)
(defconst villager-barracks 3)
(defconst villager-stable 3)
(defconst villager-archery-range 9)
(defconst villager-monastery 9)
(defconst villager-town-center 7)
(defconst villager-castle 5)
(defconst villager-mining-camp 14)
(defconst villager-siege-workshop 16)
(defconst villager-market 17)
(defconst number-barracks 9)
(defconst number-stables 1)
(defconst number-archery-ranges 7)
(defconst tc-boom-monastery 3)
(defconst farm-count 14)
(defconst pidm-food 30)
(defconst pidm-wood 10)
(defconst pidm-gold 60)
(defconst pidm-stone 0)
(defconst pidm-food2 34)
(defconst pidm-wood2 28)
(defconst pidm-gold2 33)
(defconst pidm-stone2 5)
(defconst uu-food 36)
(defconst uu-wood 44)
(defconst uu-gold 16)
(defconst uu-stone 4)
(defconst uu-food2 38)
(defconst uu-wood2 28)
(defconst uu-gold2 28)
(defconst uu-stone2 6)
(defconst ci-uu-switch-food 46)
(defconst ci-uu-switch-wood 26)
(defconst ci-uu-switch-gold 22)
(defconst ci-uu-switch-stone 6)
(defconst evaluation-hitpoints 100)
(defconst evaluation-distance 0)
(defconst max-food-escrow 1300)
(defconst max-gold-escrow 550)
#end-if
#load-if-defined INCAN-CIV
(defconst dark-age-villager 29)
(defconst villager-wonder-dark 32)
(defconst villager-wonder-feudal 34)
(defconst default-strategy 200)
(defconst pocket-strategy 202)
(defconst default-unit archer)
(defconst unique-unit-food 110)
(defconst default-flush-unit archer)
(defconst no-gold-flush-unit skirmisher)
(defconst default-ranged archer)
(defconst pocket-unit eagle-warrior)
(defconst get-lightcav 0)
(defconst scout-unit eagle-warrior-line)
(defconst military-level-flush 1)
(defconst military-level-flush-aggressive 0)
(defconst allow-forward-castle 0)
(defconst sling-time 600)
(defconst sling-number 100)
(defconst sling-two 0)
(defconst blot-size 1)
(defconst villager-barracks 3)
(defconst villager-stable 3)
(defconst villager-archery-range 9)
(defconst villager-monastery 7)
(defconst villager-town-center 16)
(defconst villager-castle 5)
(defconst villager-mining-camp 14)
(defconst villager-siege-workshop 16)
(defconst villager-market 17)
(defconst number-barracks 9)
(defconst number-stables 1)
(defconst number-archery-ranges 7)
(defconst tc-boom-monastery 2)
(defconst farm-count 14)
(defconst pidm-food 30)
(defconst pidm-wood 10)
(defconst pidm-gold 60)
(defconst pidm-stone 0)
(defconst pidm-food2 34)
(defconst pidm-wood2 28)
(defconst pidm-gold2 33)
(defconst pidm-stone2 5)
(defconst uu-food 36)
(defconst uu-wood 36)
(defconst uu-gold 24)
(defconst uu-stone 4)
(defconst uu-food2 41)
(defconst uu-wood2 27)
(defconst uu-gold2 28)
(defconst uu-stone2 4)
(defconst ci-uu-switch-food 36)
(defconst ci-uu-switch-wood 32)
(defconst ci-uu-switch-gold 26)
(defconst ci-uu-switch-stone 6)
(defconst evaluation-hitpoints 100)
(defconst evaluation-distance 0)
(defconst max-food-escrow 1300)
(defconst max-gold-escrow 550)
#end-if
#load-if-defined INDIAN-CIV
(defconst dark-age-villager 30)
(defconst villager-wonder-dark 33)
(defconst villager-wonder-feudal 35)
(defconst default-strategy 201)
(defconst pocket-strategy 201)
(defconst default-unit skirmisher)
(defconst unique-unit-food 160)
(defconst default-flush-unit skirmisher)
(defconst no-gold-flush-unit skirmisher)
(defconst default-ranged archer)
(defconst pocket-unit knight)
(defconst get-lightcav 1)
(defconst scout-unit scout-cavalry-line)
(defconst military-level-flush 1)
(defconst military-level-flush-aggressive 0)
(defconst allow-forward-castle 1)
(defconst sling-time 195)
(defconst sling-number 60)
(defconst sling-two 1)
(defconst blot-size 1)
(defconst villager-barracks 9)
(defconst villager-stable 3)
(defconst villager-archery-range 9)
(defconst villager-monastery 7)
(defconst villager-town-center 18)
(defconst villager-castle 5)
(defconst villager-mining-camp 14)
(defconst villager-siege-workshop 16)
(defconst villager-market 17)
(defconst number-barracks 6)
(defconst number-stables 9)
(defconst number-archery-ranges 7)
(defconst tc-boom-monastery 3)
(defconst farm-count 14)
(defconst pidm-food 30)
(defconst pidm-wood 10)
(defconst pidm-gold 60)
(defconst pidm-stone 0)
(defconst pidm-food2 34)
(defconst pidm-wood2 28)
(defconst pidm-gold2 33)
(defconst pidm-stone2 5)
(defconst uu-food 36)
(defconst uu-wood 44)
(defconst uu-gold 16)
(defconst uu-stone 4)
(defconst uu-food2 38)
(defconst uu-wood2 28)
(defconst uu-gold2 28)
(defconst uu-stone2 6)
(defconst ci-uu-switch-food 42)
(defconst ci-uu-switch-wood 24)
(defconst ci-uu-switch-gold 28)
(defconst ci-uu-switch-stone 6)
(defconst evaluation-hitpoints 100)
(defconst evaluation-distance 0)
(defconst max-food-escrow 1300)
(defconst max-gold-escrow 550)
#end-if
#load-if-defined ITALIAN-CIV
(defconst dark-age-villager 30)
(defconst villager-wonder-dark 32)
(defconst villager-wonder-feudal 34)
(defconst default-strategy 201)
(defconst pocket-strategy 201)
(defconst default-unit archer)
(defconst unique-unit-food 115)
(defconst default-flush-unit archer)
(defconst no-gold-flush-unit skirmisher)
(defconst default-ranged archer)
(defconst pocket-unit knight)
(defconst get-lightcav 0)
(defconst scout-unit scout-cavalry-line)
(defconst military-level-flush 1)
(defconst military-level-flush-aggressive 0)
(defconst allow-forward-castle 0)
(defconst sling-time 600)
(defconst sling-number 100)
(defconst sling-two 0)
(defconst blot-size 1)
(defconst villager-barracks 12)
(defconst villager-stable 3)
(defconst villager-archery-range 9)
(defconst villager-monastery 7)
(defconst villager-town-center 18)
(defconst villager-castle 3)
(defconst villager-mining-camp 14)
(defconst villager-siege-workshop 16)
(defconst villager-market 17)
(defconst number-barracks 9)
(defconst number-stables 1)
(defconst number-archery-ranges 7)
(defconst tc-boom-monastery 2)
(defconst farm-count 14)
(defconst pidm-food 30)
(defconst pidm-wood 10)
(defconst pidm-gold 60)
(defconst pidm-stone 0)
(defconst pidm-food2 34)
(defconst pidm-wood2 28)
(defconst pidm-gold2 33)
(defconst pidm-stone2 5)
(defconst uu-food 36)
(defconst uu-wood 44)
(defconst uu-gold 16)
(defconst uu-stone 4)
(defconst uu-food2 38)
(defconst uu-wood2 28)
(defconst uu-gold2 28)
(defconst uu-stone2 6)
(defconst ci-uu-switch-food 38)
(defconst ci-uu-switch-wood 28)
(defconst ci-uu-switch-gold 28)
(defconst ci-uu-switch-stone 6)
(defconst evaluation-hitpoints 100)
(defconst evaluation-distance 0)
(defconst max-food-escrow 1300)
(defconst max-gold-escrow 550)
#end-if
#load-if-defined MAGYAR-CIV
(defconst dark-age-villager 30)
(defconst villager-wonder-dark 33)
(defconst villager-wonder-feudal 35)
(defconst default-strategy 200)
(defconst pocket-strategy 201)
(defconst default-unit knight)
(defconst unique-unit-food 130)
(defconst default-flush-unit scout-cavalry)
(defconst no-gold-flush-unit scout-cavalry)
#load-if-not-defined POST-IMPERIAL-AGE-START
(defconst default-ranged archer)
#else
(defconst default-ranged cavalry-archer)
#end-if
(defconst pocket-unit knight)
(defconst get-lightcav 0); uu instead
(defconst scout-unit scout-cavalry-line)
(defconst military-level-flush 1)
(defconst military-level-flush-aggressive 0)
(defconst allow-forward-castle 0)
(defconst sling-time 600)
(defconst sling-number 100)
(defconst sling-two 0)
(defconst blot-size 1)
(defconst villager-barracks 7)
(defconst villager-stable 3)
(defconst villager-archery-range 16)
(defconst villager-monastery 12)
(defconst villager-town-center 18)
(defconst villager-castle 12)
(defconst villager-mining-camp 14)
(defconst villager-siege-workshop 14)
(defconst villager-market 17)
(defconst number-barracks 8)
(defconst number-stables 6)
(defconst number-archery-ranges 4)
(defconst tc-boom-monastery 3)
(defconst farm-count 14)
(defconst pidm-food 30)
(defconst pidm-wood 10)
(defconst pidm-gold 60)
(defconst pidm-stone 0)
(defconst pidm-food2 34)
(defconst pidm-wood2 28)
(defconst pidm-gold2 33)
(defconst pidm-stone2 5)
(defconst uu-food 36)
(defconst uu-wood 36)
(defconst uu-gold 24)
(defconst uu-stone 4)
(defconst uu-food2 42)
(defconst uu-wood2 24)
(defconst uu-gold2 28)
(defconst uu-stone2 6)
(defconst ci-uu-switch-food 32)
(defconst ci-uu-switch-wood 36)
(defconst ci-uu-switch-gold 26)
(defconst ci-uu-switch-stone 6)
(defconst evaluation-hitpoints 100)
(defconst evaluation-distance 0)
(defconst max-food-escrow 1300)
(defconst max-gold-escrow 550)
#end-if
#load-if-defined SLAVIC-CIV
(defconst dark-age-villager 29)
(defconst villager-wonder-dark 32)
(defconst villager-wonder-feudal 34)
(defconst default-strategy 201)
(defconst pocket-strategy 202)
(defconst default-unit knight)
(defconst unique-unit-food 115)
(defconst default-flush-unit skirmisher)
(defconst no-gold-flush-unit skirmisher)
#load-if-not-defined DEATH-MATCH
(defconst default-ranged monk)
#else
(defconst default-ranged 0)
#end-if
(defconst pocket-unit scorpion)
(defconst get-lightcav 1)
(defconst scout-unit scout-cavalry-line)
(defconst military-level-flush 1)
(defconst military-level-flush-aggressive 0)
(defconst allow-forward-castle 0)
(defconst sling-time 600)
(defconst sling-number 100)
(defconst sling-two 0)
(defconst blot-size 1)
(defconst villager-barracks 2)
(defconst villager-stable 16)
(defconst villager-archery-range 16)
(defconst villager-monastery 6)
(defconst villager-town-center 16)
(defconst villager-castle 4)
(defconst villager-mining-camp 14)
(defconst villager-siege-workshop 6)
(defconst villager-market 17)
(defconst number-barracks 4)
(defconst number-stables 4)
(defconst number-archery-ranges 4)
(defconst tc-boom-monastery 2)
(defconst farm-count 14)
(defconst pidm-food 30)
(defconst pidm-wood 10)
(defconst pidm-gold 60)
(defconst pidm-stone 0)
(defconst pidm-food2 34)
(defconst pidm-wood2 24)
(defconst pidm-gold2 37)
(defconst pidm-stone2 5)
(defconst uu-food 36)
(defconst uu-wood 36)
(defconst uu-gold 24)
(defconst uu-stone 4)
(defconst uu-food2 36)
(defconst uu-wood2 31)
(defconst uu-gold2 30)
(defconst uu-stone2 3)
(defconst ci-uu-switch-food 42)
(defconst ci-uu-switch-wood 24)
(defconst ci-uu-switch-gold 28)
(defconst ci-uu-switch-stone 6)
(defconst evaluation-hitpoints 100)
(defconst evaluation-distance 0)
(defconst max-food-escrow 1300)
(defconst max-gold-escrow 550)
#end-if
#load-if-defined BYZANTINE-CIV
(defconst imp-food 667)
(defconst imp-gold 536)
(defconst imp-f2 517)
(defconst imp-g2 400)
#else
#load-if-defined ITALIAN-CIV
(defconst imp-food 900)
(defconst imp-gold 720)
(defconst imp-f2 730)
(defconst imp-g2 600)
#else
(defconst imp-food 1000)
(defconst imp-gold 800)
(defconst imp-f2 800)
(defconst imp-g2 650)
#end-if
#end-if
#load-if-defined POST-IMPERIAL-AGE-START
(defconst pop-house 20)
#else
(defconst pop-house 50)
#end-if
#load-if-defined DEATH-MATCH
(defconst housing-headroom1 40)
(defconst housing-headroom2 40)
(defconst camp-distance 45)
(defconst food-distance 0)
(defconst wood-distance -1)
#load-if-defined POST-IMPERIAL-AGE-START
(defconst market-time 420)
#else
(defconst market-time 900)
#end-if
(defconst number-markets 4)
(defconst number-blacksmiths 2)
(defconst mill-distance 15)
(defconst hunt-distance 0)
(defconst spread-interval 40)
(defconst home-exploration-time 30); deathmatch
(defconst special-attack-type2 town-center)
#else
(defconst housing-headroom1 3)
(defconst housing-headroom2 25)
(defconst camp-distance 15)
(defconst food-distance 25)
(defconst wood-distance 0)
(defconst market-time 2700)
(defconst number-blacksmiths 1)
(defconst number-markets 3)
#load-if-not-defined SCANDANAVIA-MAP
(defconst mill-distance 15)
(defconst hunt-distance 0)
#else
(defconst mill-distance 29)
(defconst hunt-distance 32)
#end-if
(defconst spread-interval 180)
#load-if-not-defined WONDER-RACE
(defconst home-exploration-time 420)
#else
(defconst home-exploration-time 32768)
#end-if
(defconst special-attack-type2 lumber-camp)
#end-if
#load-if-defined NOMAD-MAP
(defconst wood-distance2 -1)
#else
(defconst wood-distance2 30)
#end-if
#load-if-defined SALT-MARSH-MAP
(defconst dock-placement 1)
#else
(defconst dock-placement 0)
#end-if
#load-if-defined YUCATAN-MAP
(defconst max-warships 20)
#end-if
#load-if-defined HIGHLAND-MAP
(defconst max-warships 20)
#end-if
#load-if-not-defined HIGHLAND-MAP
#load-if-not-defined YUCATAN-MAP
(defconst max-warships 35)
#end-if
#end-if
#load-if-defined ARENA-MAP
(defconst camp-distance-tc 15)
#else
(defconst camp-distance-tc 22)
#end-if
#load-if-defined REGICIDE
#load-if-defined FORTRESS-MAP
(defconst lumber-delay 40)
#else
(defconst lumber-delay 180)
#end-if
#else
(defconst lumber-delay 180)
#end-if
#load-if-defined TINY-MAP
(defconst tsa-increment 6)
(defconst shorefishreq 50)
(defconst shorefishreq2 25)
(defconst deepfishreq 6)
(defconst deepfishreq2 3)
(defconst heavy-wood 7000)
(defconst max-trade-cart 22)
(defconst trade-distance 54)
#end-if
#load-if-defined SMALL-MAP
(defconst tsa-increment 8)
(defconst shorefishreq 100)
(defconst shorefishreq2 50)
(defconst deepfishreq 8)
(defconst deepfishreq2 4)
(defconst heavy-wood 8000)
(defconst max-trade-cart 28)
(defconst trade-distance 72)
#end-if
#load-if-defined MEDIUM-MAP
(defconst tsa-increment 10)
(defconst shorefishreq 150)
(defconst shorefishreq2 75)
(defconst deepfishreq 10)
(defconst deepfishreq2 5)
(defconst heavy-wood 10000)
(defconst max-trade-cart 35)
(defconst trade-distance 90)
#end-if
#load-if-defined NORMAL-MAP
(defconst tsa-increment 12)
(defconst shorefishreq 200)
(defconst shorefishreq2 100)
(defconst deepfishreq 12)
(defconst deepfishreq2 6)
(defconst heavy-wood 14000)
(defconst max-trade-cart 40)
(defconst trade-distance 120)
#end-if
#load-if-defined LARGE-MAP
(defconst tsa-increment 15)
(defconst shorefishreq 250)
(defconst shorefishreq2 125)
(defconst deepfishreq 14)
(defconst deepfishreq2 7)
(defconst heavy-wood 18000)
(defconst max-trade-cart 45)
(defconst trade-distance 150)
#end-if
#load-if-defined GIANT-MAP
(defconst tsa-increment 18)
(defconst shorefishreq 300)
(defconst shorefishreq2 150)
(defconst deepfishreq 16)
(defconst deepfishreq2 8)
(defconst heavy-wood 22000)
(defconst max-trade-cart 55)
(defconst trade-distance 200)
#end-if
#load-if-defined LUDIKRIS-MAP
(defconst tsa-increment 20)
(defconst shorefishreq 350)
(defconst shorefishreq2 175)
(defconst deepfishreq 18)
(defconst deepfishreq2 9)
(defconst heavy-wood 26000)
(defconst max-trade-cart 75)
(defconst trade-distance 400)
#end-if
#load-if-defined HIGHLAND-MAP
(defconst water-mixed 1000)
(defconst water-islands 1001)
#else
#load-if-defined TINY-MAP
(defconst water-mixed 1000)
(defconst water-islands 1001)
#end-if
#load-if-defined SMALL-MAP
(defconst water-mixed 2000)
(defconst water-islands 2001)
#end-if
#load-if-defined MEDIUM-MAP
(defconst water-mixed 4000)
(defconst water-islands 4001)
#end-if
#load-if-defined NORMAL-MAP
(defconst water-mixed 4000)
(defconst water-islands 4001)
#end-if
#load-if-defined LARGE-MAP
(defconst water-mixed 4000)
(defconst water-islands 4001)
#end-if
#load-if-defined GIANT-MAP
(defconst water-mixed 4000)
(defconst water-islands 4001)
#end-if
#load-if-defined LUDIKRIS-MAP
(defconst water-mixed 4000)
(defconst water-islands 4001)
#end-if
#end-if
#load-if-defined DIFFICULTY-EASIEST
(defconst wood-distance-farm 15)
#end-if
#load-if-defined DIFFICULTY-EASY
(defconst wood-distance-farm 12)
#end-if
#load-if-defined DIFFICULTY-MODERATE
(defconst wood-distance-farm 8)
#end-if
#load-if-defined DIFFICULTY-HARD
(defconst wood-distance-farm 7)
#end-if
#load-if-defined DIFFICULTY-HARDEST
(defconst wood-distance-farm 6)
#end-if
#load-if-not-defined TURBO-RANDOM-MAP
#load-if-not-defined POPULATION-CAP-25
(defconst number-rams 4)
(defconst number-garrison-units 4)
#load-if-defined DIFFICULTY-EASIEST
(defconst villager-feudal 10)
(defconst villager-flush 10)
#end-if
#load-if-defined DIFFICULTY-EASY
(defconst villager-feudal 12)
(defconst villager-flush 11)
#end-if
#load-if-not-defined DIFFICULTY-EASIEST
#load-if-not-defined DIFFICULTY-EASY
#load-if-defined LOW-RESOURCES-START
#load-if-defined DIFFICULTY-MODERATE
(defconst villager-flush 27)
(defconst villager-feudal 29)
#end-if
#load-if-defined DIFFICULTY-HARD
(defconst villager-flush 25)
(defconst villager-feudal 29)
#end-if
#load-if-defined DIFFICULTY-HARDEST
(defconst villager-flush 24)
(defconst villager-feudal 28)
#end-if
#end-if
#load-if-defined MEDIUM-RESOURCES-START
(defconst villager-flush 20)
(defconst villager-feudal 24)
#end-if
#load-if-defined HIGH-RESOURCES-START
(defconst villager-flush 15)
(defconst villager-feudal 16)
#end-if
#end-if ;NOT EASY
#end-if ;NOT EASIEST
#else
(defconst number-rams 3)
(defconst number-garrison-units 1)
(defconst villager-feudal 24)
(defconst villager-flush 24)
#end-if ; = POP25
#else ; = TURBO
#load-if-not-defined POPULATION-CAP-25
(defconst number-rams 4)
(defconst number-garrison-units 4)
#else
(defconst number-rams 3)
(defconst number-garrison-units 1)
#end-if
(defconst villager-flush 15)
(defconst villager-feudal 16)
#end-if
#load-if-defined GOLD-RUSH-MAP
#load-if-defined TINY-MAP
(defconst castle-age-camp-distance 48); high camp distance to reach center gold
#end-if
#load-if-defined SMALL-MAP
(defconst castle-age-camp-distance 48)
#end-if
#load-if-defined MEDIUM-MAP
(defconst castle-age-camp-distance 64)
#end-if
#load-if-defined NORMAL-MAP
(defconst castle-age-camp-distance 90)
#end-if
#load-if-defined LARGE-MAP
(defconst castle-age-camp-distance 124)
#end-if
#load-if-defined GIANT-MAP
(defconst castle-age-camp-distance 124)
#end-if
#load-if-defined LUDIKRIS-MAP
(defconst castle-age-camp-distance 240)
#end-if
#else
(defconst castle-age-camp-distance 35)
#end-if ; not gold-rush-map
(defconst scorpion-gold-min 170)
(defconst villager-coinage 60)
(defconst safe-town 45)
#load-if-defined POPULATION-CAP-25
(defconst max-fleet 20)
(defconst twenty-five-percent-pop 6)
(defconst thirty-percent-pop 7)
(defconst fourty-percent-pop 10)
(defconst sixty-percent-pop 15)
(defconst seventy-five-percent-pop 19)
(defconst eighty-five-percent-pop 21)
#load-if-defined DIFFICULTY-EASIEST
(defconst max-civ 4)
#end-if
#load-if-defined DIFFICULTY-EASY
(defconst max-civ 6)
#end-if
#load-if-defined DIFFICULTY-MODERATE
(defconst max-civ 8)
#end-if
#load-if-defined DIFFICULTY-HARD
(defconst max-civ 10)
#end-if
#load-if-defined DIFFICULTY-HARDEST
(defconst max-civ 12)
#end-if
(defconst max-civ-pop 20)
(defconst del-civ-pop 24)
(defconst max-pop 25)
(defconst tc-level-one 1)
(defconst tc-level-two 1)
(defconst tc-level-three 1)
(defconst tc-level-four 1)
(defconst tc-level-five 1)
(defconst low-min-number-upgrade 1)
(defconst mid-min-number-upgrade 2)
(defconst high-min-number-upgrade 3)
(defconst max-trade-pop 0)
#end-if
#load-if-defined POPULATION-CAP-50
(defconst max-fleet 30)
(defconst twenty-five-percent-pop 13)
(defconst thirty-percent-pop 15)
(defconst fourty-percent-pop 20)
(defconst sixty-percent-pop 30)
(defconst seventy-five-percent-pop 38)
(defconst eighty-five-percent-pop 42)
#load-if-defined DIFFICULTY-EASIEST
(defconst max-civ 4)
#end-if
#load-if-defined DIFFICULTY-EASY
(defconst max-civ 12)
#end-if
#load-if-defined DIFFICULTY-MODERATE
(defconst max-civ 18)
#end-if
#load-if-defined DIFFICULTY-HARD
(defconst max-civ 24)
#end-if
#load-if-defined DIFFICULTY-HARDEST
(defconst max-civ 28)
#end-if
(defconst max-civ-pop 45)
(defconst del-civ-pop 48)
(defconst max-pop 50)
(defconst tc-level-one 1)
(defconst tc-level-two 1)
(defconst tc-level-three 1)
(defconst tc-level-four 2)
(defconst tc-level-five 2)
(defconst low-min-number-upgrade 1)
(defconst mid-min-number-upgrade 3)
(defconst high-min-number-upgrade 5)
(defconst max-trade-pop 0)
#end-if
#load-if-defined POPULATION-CAP-75
(defconst max-fleet 40)
(defconst twenty-five-percent-pop 19)
(defconst thirty-percent-pop 22)
(defconst fourty-percent-pop 30)
(defconst sixty-percent-pop 45)
(defconst seventy-five-percent-pop 57)
(defconst eighty-five-percent-pop 64)
#load-if-defined DIFFICULTY-EASIEST
(defconst max-civ 5)
#end-if
#load-if-defined DIFFICULTY-EASY
(defconst max-civ 12)
#end-if
#load-if-defined DIFFICULTY-MODERATE
(defconst max-civ 22)
#end-if
#load-if-defined DIFFICULTY-HARD
(defconst max-civ 35)
#end-if
#load-if-defined DIFFICULTY-HARDEST
(defconst max-civ 50)
#end-if
(defconst max-civ-pop 65)
(defconst del-civ-pop 72)
(defconst max-pop 75)
(defconst tc-level-one 1)
(defconst tc-level-two 1)
(defconst tc-level-three 1)
(defconst tc-level-four 2)
(defconst tc-level-five 2)
(defconst low-min-number-upgrade 2)
(defconst mid-min-number-upgrade 4)
(defconst high-min-number-upgrade 6)
(defconst max-trade-pop 7)
#end-if
#load-if-defined POPULATION-CAP-100
(defconst max-fleet 40)
(defconst twenty-five-percent-pop 25)
(defconst thirty-percent-pop 30)
(defconst fourty-percent-pop 40)
(defconst sixty-percent-pop 60)
(defconst seventy-five-percent-pop 75)
(defconst eighty-five-percent-pop 85)
#load-if-defined DIFFICULTY-EASIEST
(defconst max-civ 5)
#end-if
#load-if-defined DIFFICULTY-EASY
(defconst max-civ 14)
#end-if
#load-if-defined DIFFICULTY-MODERATE
(defconst max-civ 26)
#end-if
#load-if-defined DIFFICULTY-HARD
(defconst max-civ 42)
#end-if
#load-if-defined DIFFICULTY-HARDEST
(defconst max-civ 65)
#end-if
(defconst max-civ-pop 95)
(defconst del-civ-pop 98)
(defconst max-pop 100)
(defconst tc-level-one 1)
(defconst tc-level-two 2)
(defconst tc-level-three 2)
(defconst tc-level-four 2)
(defconst tc-level-five 3)
(defconst low-min-number-upgrade 2)
(defconst mid-min-number-upgrade 5)
(defconst high-min-number-upgrade 8)
(defconst max-trade-pop 10)
#end-if
#load-if-defined POPULATION-CAP-125
(defconst max-fleet 50)
(defconst twenty-five-percent-pop 32)
(defconst thirty-percent-pop 37)
(defconst fourty-percent-pop 50)
(defconst sixty-percent-pop 75)
(defconst seventy-five-percent-pop 94)
(defconst eighty-five-percent-pop 106)
#load-if-defined DIFFICULTY-EASIEST
(defconst max-civ 6)
#end-if
#load-if-defined DIFFICULTY-EASY
(defconst max-civ 16)
#end-if
#load-if-defined DIFFICULTY-MODERATE
(defconst max-civ 32)
#end-if
#load-if-defined DIFFICULTY-HARD
(defconst max-civ 54)
#end-if
#load-if-defined DIFFICULTY-HARDEST
(defconst max-civ 75)
#end-if
(defconst max-civ-pop 115)
(defconst del-civ-pop 123)
(defconst max-pop 125)
(defconst tc-level-one 1)
(defconst tc-level-two 2)
(defconst tc-level-three 2)
(defconst tc-level-four 3)
(defconst tc-level-five 3)
(defconst low-min-number-upgrade 3)
(defconst mid-min-number-upgrade 6)
(defconst high-min-number-upgrade 9)
(defconst max-trade-pop 12)
#end-if
#load-if-defined POPULATION-CAP-150
(defconst max-fleet 56)
(defconst twenty-five-percent-pop 38)
(defconst thirty-percent-pop 45)
(defconst fourty-percent-pop 60)
(defconst sixty-percent-pop 90)
(defconst seventy-five-percent-pop 113)
(defconst eighty-five-percent-pop 128)
#load-if-defined DIFFICULTY-EASIEST
(defconst max-trade-pop 2)
(defconst max-civ 6)
#end-if
#load-if-defined DIFFICULTY-EASY
(defconst max-trade-pop 5)
(defconst max-civ 18)
#end-if
#load-if-defined DIFFICULTY-MODERATE
(defconst max-trade-pop 8)
(defconst max-civ 39)
#end-if
#load-if-defined DIFFICULTY-HARD
(defconst max-trade-pop 12)
(defconst max-civ 65)
#end-if
#load-if-defined DIFFICULTY-HARDEST
(defconst max-trade-pop 15)
(defconst max-civ 90)
#end-if
(defconst max-civ-pop 140)
(defconst del-civ-pop 148)
(defconst max-pop 150)
(defconst tc-level-one 1)
(defconst tc-level-two 2)
(defconst tc-level-three 3)
(defconst tc-level-four 3)
(defconst tc-level-five 4)
(defconst low-min-number-upgrade 4)
(defconst mid-min-number-upgrade 7)
(defconst high-min-number-upgrade 10)
#end-if
#load-if-defined POPULATION-CAP-175
(defconst max-fleet 66)
(defconst twenty-five-percent-pop 44)
(defconst thirty-percent-pop 52)
(defconst fourty-percent-pop 70)
(defconst sixty-percent-pop 105)
(defconst seventy-five-percent-pop 131)
(defconst eighty-five-percent-pop 149)
#load-if-defined DIFFICULTY-EASIEST
(defconst max-trade-pop 2)
(defconst max-civ 7)
#end-if
#load-if-defined DIFFICULTY-EASY
(defconst max-trade-pop 5)
(defconst max-civ 20)
#end-if
#load-if-defined DIFFICULTY-MODERATE
(defconst max-trade-pop 11)
(defconst max-civ 43)
#end-if
#load-if-defined DIFFICULTY-HARD
(defconst max-trade-pop 24)
(defconst max-civ 80)
#end-if
#load-if-defined DIFFICULTY-HARDEST
(defconst max-trade-pop 35)
(defconst max-civ 110)
#end-if
(defconst max-civ-pop 165)
(defconst del-civ-pop 173)
(defconst max-pop 175)
(defconst tc-level-one 1)
(defconst tc-level-two 2)
(defconst tc-level-three 3)
(defconst tc-level-four 4)
(defconst tc-level-five 5)
(defconst low-min-number-upgrade 4)
(defconst mid-min-number-upgrade 8)
(defconst high-min-number-upgrade 12)
#end-if
#load-if-defined POPULATION-CAP-200
#load-if-not-defined POPULATION-CAP-EXTENDED
(defconst max-fleet 75)
(defconst twenty-five-percent-pop 50)
(defconst thirty-percent-pop 60)
(defconst fourty-percent-pop 80)
(defconst sixty-percent-pop 120)
(defconst seventy-five-percent-pop 150)
(defconst eighty-five-percent-pop 170)
#load-if-defined DIFFICULTY-EASIEST
(defconst max-trade-pop 2)
(defconst max-civ 7)
#end-if
#load-if-defined DIFFICULTY-EASY
(defconst max-trade-pop 5)
(defconst max-civ 21)
#end-if
#load-if-defined DIFFICULTY-MODERATE
(defconst max-trade-pop 13)
(defconst max-civ 48)
#end-if
#load-if-defined DIFFICULTY-HARD
(defconst max-trade-pop 26)
(defconst max-civ 89)
#end-if
#load-if-defined DIFFICULTY-HARDEST
(defconst max-trade-pop 40)
(defconst max-civ 125)
#end-if
(defconst max-civ-pop 185)
#load-if-not-defined GOTHIC-CIV
(defconst del-civ-pop 196)
(defconst max-pop 200)
#else
(defconst del-civ-pop 206)
(defconst max-pop 210)
#end-if
#end-if
(defconst tc-level-one 1)
(defconst tc-level-two 2)
(defconst tc-level-three 3)
(defconst tc-level-four 4)
(defconst tc-level-five 5)
(defconst low-min-number-upgrade 4)
(defconst mid-min-number-upgrade 8)
(defconst high-min-number-upgrade 12)
#end-if
#load-if-defined POPULATION-CAP-225
(defconst max-fleet 78)
(defconst twenty-five-percent-pop 56)
(defconst thirty-percent-pop 66)
(defconst fourty-percent-pop 90)
(defconst sixty-percent-pop 135)
(defconst seventy-five-percent-pop 169)
(defconst eighty-five-percent-pop 191)
(defconst tc-level-one 1)
(defconst tc-level-two 2)
(defconst tc-level-three 3)
(defconst tc-level-four 4)
(defconst tc-level-five 5)
(defconst low-min-number-upgrade 4)
(defconst mid-min-number-upgrade 8)
(defconst high-min-number-upgrade 12)
#load-if-defined DIFFICULTY-EASIEST
(defconst max-trade-pop 2)
(defconst max-civ 8)
#end-if
#load-if-defined DIFFICULTY-EASY
(defconst max-trade-pop 6)
(defconst max-civ 23)
#end-if
#load-if-defined DIFFICULTY-MODERATE
(defconst max-trade-pop 15)
(defconst max-civ 52)
#end-if
#load-if-defined DIFFICULTY-HARD
(defconst max-trade-pop 29)
(defconst max-civ 95)
#end-if
#load-if-defined DIFFICULTY-HARDEST
(defconst max-trade-pop 45)
(defconst max-civ 135)
#end-if
(defconst max-civ-pop 210)
(defconst del-civ-pop 221)
(defconst max-pop 225)
#end-if
#load-if-defined POPULATION-CAP-EXTENDED; Load for Pop >= 250
#load-if-not-defined POPULATION-CAP-225
(defconst max-fleet 90)
(defconst twenty-five-percent-pop 63)
(defconst thirty-percent-pop 75)
(defconst fourty-percent-pop 100)
(defconst sixty-percent-pop 150)
(defconst seventy-five-percent-pop 187)
(defconst eighty-five-percent-pop 213)
(defconst tc-level-one 1)
(defconst tc-level-two 2)
(defconst tc-level-three 3)
(defconst tc-level-four 4)
(defconst tc-level-five 5)
(defconst low-min-number-upgrade 4)
(defconst mid-min-number-upgrade 8)
(defconst high-min-number-upgrade 12)
#load-if-defined DIFFICULTY-EASIEST
(defconst max-trade-pop 2)
(defconst max-civ 8)
#end-if
#load-if-defined DIFFICULTY-EASY
(defconst max-trade-pop 8)
(defconst max-civ 25)
#end-if
#load-if-defined DIFFICULTY-MODERATE
(defconst max-trade-pop 18)
(defconst max-civ 58)
#end-if
#load-if-defined DIFFICULTY-HARD
(defconst max-trade-pop 33)
(defconst max-civ 103)
#end-if
#load-if-defined DIFFICULTY-HARDEST
(defconst max-trade-pop 60)
(defconst max-civ 140)
#end-if
(defconst max-civ-pop 220)
(defconst del-civ-pop 246)
(defconst max-pop 250)
#end-if
#end-if
#load-if-defined DIFFICULTY-EASIEST
(defconst ability-to-dodge 100)
(defconst ability-to-kite 100)
(defconst enable-patrol 0)
#end-if
#load-if-defined DIFFICULTY-EASY
(defconst ability-to-dodge 75)
(defconst ability-to-kite 75)
(defconst enable-patrol 0)
#end-if
#load-if-defined DIFFICULTY-MODERATE
(defconst ability-to-dodge 50)
(defconst ability-to-kite 50)
(defconst enable-patrol 0)
#end-if
#load-if-defined DIFFICULTY-HARD
(defconst ability-to-dodge 25)
(defconst ability-to-kite 25)
(defconst enable-patrol 1)
#end-if
#load-if-defined DIFFICULTY-HARDEST
(defconst ability-to-dodge 0)
(defconst ability-to-kite 0)
(defconst enable-patrol 1)
#end-if
#load-if-defined ARABIA-MAP
(defconst additional-town-center-placed-distance 14)
(defconst pop60-town-size 16)
(defconst pop90-town-size 20)
(defconst pop120-town-size 24)
#end-if
#load-if-defined ARENA-MAP
(defconst additional-town-center-placed-distance 16)
(defconst pop60-town-size 20)
(defconst pop90-town-size 24)
(defconst pop120-town-size 24)
#end-if
#load-if-not-defined ARENA-MAP
#load-if-not-defined ARABIA-MAP
(defconst additional-town-center-placed-distance 16)
(defconst pop60-town-size 20)
(defconst pop90-town-size 24)
(defconst pop120-town-size 28)
#end-if
#end-if
#load-if-not-defined INCAN-CIV
#load-if-not-defined FRANKISH-CIV
(defconst castle-stone 650)
#else ; Franks
(defconst castle-stone 488)
#end-if
#else ; Incas
(defconst castle-stone 553)
#end-if
#load-if-defined UP-POCKET-POSITION
(defconst scouting-type scout-mirror)
#else
(defconst scouting-type scout-flank)
#end-if
; The locations that are currently implemented are center, mirror, opposite, and enemy.
; Corner, border, and flank are the ones that aren't currently implemented.
(defrule
(true)
=>
(set-strategic-number sn-maximum-town-size 8)
(set-strategic-number sn-total-number-explorers 13);start with all civilians as explorer and turn them off when sheep or berries are found
(set-strategic-number sn-percent-civilian-explorers 100)
(set-strategic-number sn-minimum-civilian-explorers 12)
(set-strategic-number sn-number-explore-groups 1);explore with scouts
(set-difficulty-parameter ability-to-dodge-missiles ability-to-dodge); 0 = dodge
(set-difficulty-parameter ability-to-maintain-distance ability-to-kite); 0 = kite
(set-strategic-number sn-percent-enemy-sighted-response 100);fight with all men
(set-strategic-number sn-group-commander-selection-method 0)
(set-strategic-number sn-ignore-attack-group-under-attack 0)
(set-strategic-number sn-attack-group-size-randomness 0)
(set-strategic-number sn-scale-minimum-attack-group-size 0)
(set-strategic-number sn-scale-maximum-attack-group-size 0)
(set-strategic-number sn-group-leader-defense-distance 3); increases chance to make a few big groups instead of many medium sized ones
(disable-self)
)
(defrule
(true)
=>
(set-strategic-number sn-intelligent-gathering 1);drop resources when switched to another type
(set-strategic-number sn-retask-gather-amount 0);minimum amount to collect before allowed to switch
(set-strategic-number sn-camp-max-distance camp-distance);small distances at the start
(set-strategic-number sn-mill-max-distance mill-distance)
(set-strategic-number sn-cap-civilian-builders 100); maximum villagers that can be tasked as builder
(set-strategic-number sn-cap-civilian-explorers 100); maximum villagers that can be tasked as explorer
(set-strategic-number sn-maximum-hunt-drop-distance hunt-distance);Dont walk all over the map for resources
(set-strategic-number sn-maximum-food-drop-distance food-distance)
(set-strategic-number sn-maximum-wood-drop-distance wood-distance)
(set-strategic-number sn-maximum-stone-drop-distance 0)
(set-strategic-number sn-maximum-gold-drop-distance 0)
(set-strategic-number sn-blot-exploration-map 0);1=rexplore
(set-strategic-number sn-blot-size blot-size);15=default, 0 scouts w/ high LOS, 1 rest
(set-strategic-number sn-sentry-distance-variation 0)
(disable-self)
)
(defrule
(true)
=>
(set-strategic-number sn-group-form-distance 20)
(set-strategic-number sn-consecutive-idle-unit-limit 0)
(set-strategic-number sn-percent-attack-soldiers 100);attack with all men
(set-strategic-number sn-attack-winning-player 1);attacks the player with most points, irrelevant for us
(set-strategic-number sn-attack-winning-player-factor 10000)
(set-strategic-number sn-attack-intelligence 1);doesn't really avoid TC/castle fire, but better than nothing
(set-strategic-number sn-build-frequency 1);sometimes it helps when AI trys to build next to enemy and get interrupted
(set-strategic-number sn-number-build-attempts-before-skip 5)
(set-strategic-number sn-max-skips-per-attempt 5)
(set-strategic-number sn-coop-share-attacking 1); usually helps ally too late, but better than nothing
(set-strategic-number sn-coop-share-information 1); gives information to an AI ally
(set-strategic-number sn-garrison-rams 0)
(set-strategic-number sn-current-age dark)
(set-strategic-number sn-minimum-water-body-size-for-dock 999); don't build docks in small puddles
(disable-self)
)
(defrule
(true)
=>
(set-strategic-number sn-target-evaluation-in-progress 0)
(set-strategic-number sn-target-evaluation-boat 0)
(set-strategic-number sn-target-evaluation-rof 0)
(set-strategic-number sn-target-evaluation-continent 0)
(set-strategic-number sn-target-evaluation-siege-weapon 500);high value => siege vs buildings, soldier vs soldier
(set-strategic-number sn-target-evaluation-distance evaluation-distance)
(set-strategic-number sn-target-evaluation-time-kill-ratio 0)
(set-strategic-number sn-target-evaluation-hitpoints evaluation-hitpoints)
(set-strategic-number sn-target-evaluation-damage-capability 1)
(set-strategic-number sn-target-evaluation-kills 0)
(set-strategic-number sn-target-evaluation-randomness 0)
(set-strategic-number sn-target-evaluation-attack-attempts 0)
(set-strategic-number sn-target-evaluation-range -100)
(set-strategic-number sn-special-attack-type2 special-attack-type2)
(disable-self)
)
(defrule
(true)
=>
(set-strategic-number sn-minimum-attack-group-size 1)
(set-strategic-number sn-zero-priority-distance 450)
(set-strategic-number sn-attack-group-gather-spacing 5)
(set-strategic-number sn-do-not-scale-for-difficulty-level 1)
(set-strategic-number sn-initial-exploration-required 0); !
(set-strategic-number sn-gather-defense-units 1)
(set-strategic-number sn-ignore-tower-elevation 1)
(set-goal escrow-purpose-goal 0)
(generate-random-number 100)
(enable-timer civ-explore-timer 150)
(enable-timer attack-timer 1)
(enable-timer spread-military-timer 220)
(enable-timer one-minute-timer 60)
(disable-self)
)
(defrule
(true)
=>
(set-strategic-number sn-task-ungrouped-soldiers 0); spread military 0=no,1=yes
(set-strategic-number sn-forage-defend-priority 1)
(set-strategic-number sn-gold-defend-priority 1)
(set-strategic-number sn-stone-defend-priority 1)
(set-strategic-number sn-livestock-defend-priority 1)
(set-goal reset 0)
(set-goal control-goal 0); secondary unit
(set-goal enemy-goal 0); enemy strategy unkonwn
(set-goal increase-town-size-goal 0); disable TS increase
(set-goal strategy-goal default-strategy)
(set-goal unit-goal default-unit)
(set-goal ranged-unit-type-goal default-ranged)
(set-goal under-attack-goal 0); not under attack
(set-goal spread-military-goal 0)
(disable-self)
)
(defrule
(true)
=>
; (set-strategic-number sn-percent-half-exploration 30); default
; (set-strategic-number sn-percent-exploration-required 0)
(set-strategic-number sn-number-enemy-objects-required 1)
(set-goal attackchat 1)
(set-goal stanceg 0)
(set-goal request 0)
(set-goal request2 0)
(up-assign-builders c: 621 c: 4)
(up-assign-builders c: town-center c: 4)
(enable-timer thirty 30)
(enable-timer tensec 10)
(set-goal retargetenemy yes)
(enable-timer two-minute-timer 120)
(set-goal defendchat no); soon to be reset
(set-strategic-number sn-allow-civilian-defense 1)
(disable-self)
)
(defrule
(true)
=>
(set-strategic-number sn-percent-building-cancellation 25)
(set-strategic-number sn-home-exploration-time home-exploration-time)
(set-strategic-number sn-minimum-boar-hunt-group-size 0)
; (set-strategic-number sn-enable-boar-hunting 2)
(set-strategic-number sn-number-civilian-militia 0)
(set-strategic-number sn-enable-patrol-attack enable-patrol)
(set-strategic-number sn-safe-town-size safe-town)
(set-goal nomad no)
(set-goal landnomad no)
(set-strategic-number sn-livestock-to-town-center 1)
(disable-self)
)
(defrule
(true)
=>
(enable-timer navy-attack-timer 1)
(enable-timer retreat-timer 1)
(enable-timer micro-timer 1)
(enable-timer garrison-timer 1)
(set-goal raid-goal 0)
(set-goal forward-goal -1)
(enable-timer defend-timer 10)
(set-goal position-goal pocket); nomad
(disable-self)
)
(defrule
(game-time < 10)
(wood-amount < 275)
(building-type-count-total town-center <= 0)
(up-compare-goal landnomad != yes)
=>
(set-goal nomad yes)
(set-goal landnomad yes)
(chat-local-to-self "Land-Nomad.")
(up-assign-builders c: town-center-foundation c: 10)
(disable-self))
(defrule
(game-time < 10)
(wood-amount >= 275)
(building-type-count-total town-center <= 0)
(up-compare-goal nomad != yes)
=>
(set-goal nomad yes)
(chat-local-to-self "Nomad.")
(up-assign-builders c: town-center-foundation c: 10)
(disable-self))
#load-if-not-defined DEATH-MATCH
#load-if-not-defined WONDER-RACE
#load-if-not-defined NOMAD-MAP
#load-if-not-defined UP-2-PLAYER-GAME
#load-if-defined UP-POCKET-POSITION
(defrule
; (strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(true);(game-time > 10)
=>
(set-goal position-goal pocket)
(set-goal strategy-goal pocket-strategy)
(set-goal unit-goal pocket-unit)
(set-goal control-goal 0)
(chat-local-to-self "I'm pocket.")
; (chat-to-player every-ally "I'm pocket.")
(disable-self))
#else
(defrule
; (strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(true);(game-time > 10)
=>
(set-goal position-goal flank)
(chat-local-to-self "I'm flank.")
; (chat-to-player every-ally "I'm flank.")
(disable-self))
#end-if
#end-if
#end-if
#end-if
#end-if
#load-if-defined DEATH-MATCH
;#load-if-not-defined UP-2-PLAYER-GAME
#load-if-defined UP-POCKET-POSITION
(defrule
(true);(game-time > 10)
=>
(set-goal position-goal pocket)
(chat-local-to-self "I'm pocket.")
; (chat-to-player every-ally "I'm pocket.")
(disable-self))
#else
(defrule
(true);(game-time > 10)
=>
(set-goal position-goal flank)
(chat-local-to-self "I'm flank.")
; (chat-to-player every-ally "I'm flank.")
(disable-self))
#end-if
;#end-if
#end-if
(defrule
(unit-type-count-total 213 < 3) ; Dead female builder
(unit-type-count-total 225 < 3) ; Dead male builder
(building-type-count town-center >= 1)
(strategic-number sn-percent-building-cancellation > 10)
=>
(set-strategic-number sn-percent-building-cancellation 10))
(defrule
(or (unit-type-count-total 213 >= 3) ; Dead female builder
(unit-type-count-total 225 >= 3)) ; Dead male builder
(population < max-civ-pop)
(building-type-count town-center >= 1)
(strategic-number sn-percent-building-cancellation < 100)
=>
(set-strategic-number sn-percent-building-cancellation 100)
; (chat-local-to-self "Resetting townsize."); test
; (set-strategic-number sn-maximum-town-size 12)
)
(defrule
(building-type-count town-center <= 0)
(building-type-count-total town-center >= 1)
(strategic-number sn-percent-building-cancellation > 0)
=>
(set-strategic-number sn-percent-building-cancellation 0))
(defrule
(strategic-number sn-allow-adjacent-dropsites != 0)
=>
(set-strategic-number sn-allow-adjacent-dropsites 0))
(defrule
(true); clear these goals/SNs each rule pass
=>
(set-strategic-number sn-military-level 0)
(set-strategic-number sn-archer-threat 0)
(set-strategic-number sn-infantry-threat 0)
(set-strategic-number sn-cavalry-threat 0)
(set-goal anti-cavalry-threat-goal 0)
(set-goal anti-monk-threat-goal 0)
(set-goal monk-threat-goal 0)
(set-goal enemy-sighted-goal 0)
(set-goal attack-goal 0)
(set-goal farm-goal 0)
(set-goal housing-goal 0)
(set-goal enemy-boats-goal 0)
(set-goal hostilities-goal 0)
(set-goal save-wood-goal 0)
(set-goal math-goal 0)
)
(defrule
(true)
=>
(set-goal gather-inside-goal 0)
(set-goal split-rule-goal 0)
(set-goal tribute-goal 0)
(set-goal threat-source-goal 0)
(set-goal threat-target-goal 0)
(set-goal team-coordination-goal 0)
(up-get-threat-data threat-time-goal threat-player-goal threat-source-goal threat-target-goal)
(up-get-victory-data winning-player victory-type victory-time)
(up-modify-goal attacking-enemy-goal g:= threat-player-goal); replacement
)
#load-if-not-defined DIFFICULTY-EASIEST
#load-if-not-defined DIFFICULTY-EASY
#load-if-not-defined DIFFICULTY-MODERATE
(defrule
(true)
=>
(set-strategic-number sn-enable-training-queue 1)
(set-strategic-number sn-wall-targeting-mode 1)
(set-strategic-number sn-enable-new-building-system 1)
)
#end-if
#end-if
#end-if
(defrule
(players-building-count any-enemy > 0)
=>
(up-find-player enemy find-closest closest-enemy-goal)
; (up-modify-sn sn-focus-player-number g:= closest-enemy-goal)
; (up-chat-data-to-self "Focus-player: %d" g: closest-enemy-goal)
)
(defrule
(or (strategic-number sn-maximum-town-size >= 40)
(strategic-number sn-number-attack-groups >= 1))
(up-compare-goal team-coordination-goal != 1)
=>
(set-goal team-coordination-goal 1)
)
(defrule
(or (game-time < 1200); don't block early villagers in DM
(nor (and (goal train-civ-goal -1)
(population >= max-civ-pop))
(goal train-civ-goal 2)))
=>
(set-goal train-civ-goal 1)
)
(defrule
(taunt-detected any-ally 33)
(game-time > 300)
=>
(acknowledge-taunt this-any-ally 33)
(chat-to-allies-using-id 22157)
(set-goal train-civ-goal 1)
)
(defrule
(current-age == imperial-age)
(population >= max-civ-pop)
(taunt-detected any-ally 32)
=>
(acknowledge-taunt this-any-ally 32)
(chat-to-allies-using-id 22154)
(set-goal train-civ-goal -1)
)
(defrule
(game-time > 1800)
(or (or (dropsite-min-distance wood == -1); wood gone
(dropsite-min-distance wood == 480)); or remaining wood is on other islands
(and (unit-type-count-total villager > thirty-percent-pop)
(game-type == 8)))
=>
(set-goal train-civ-goal -1)
)
(defrule
(current-age == imperial-age)
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
(or (and (unit-type-count villager > twenty-five-percent-pop)
(game-time > 2700))
(and (and (players-unit-type-count every-enemy galley-line < 15)
(players-unit-type-count every-enemy fire-ship-line < 15))
(warboat-count > 25)))
=>
(set-goal train-civ-goal -1)
)
(defrule
(current-age == imperial-age)
(strategic-number sn-resource-control < 1)
(up-compare-goal escrow-purpose-goal != ri-halberdier)
(civilian-population >= max-civ); more than enough civ, usually achieved by adding trade carts
(or (gold-amount > 800); and enough of all resources
(and (civilian-population > sixty-percent-pop)
(unit-type-count trade-cart > 0)))
(wood-amount > 800)
(food-amount > 800)
(population > del-civ-pop)
(unit-type-count-total villager >= 12)
(population-cap <= 250)
=>
(delete-unit villager)
(set-goal train-civ-goal -1)
(chat-local-to-self "Deleting excess villagers.")
)
(defrule
; (game-time < 60)
(unit-type-count-total villager > 0)
(building-type-count-total lumber-camp >= 1)
(wood-amount < 275)
(strategic-number sn-number-explore-groups == 101)
=>
(set-strategic-number sn-percent-civilian-explorers 0)
(set-strategic-number sn-cap-civilian-explorers 0)
(set-strategic-number sn-total-number-explorers 1)
(set-strategic-number sn-number-explore-groups 1))
(defrule
; (game-time < 60)
(unit-type-count-total villager > 0)
(building-type-count-total mining-camp >= 1)
(stone-amount < 100)
(strategic-number sn-number-explore-groups == 101)
=>
(set-strategic-number sn-percent-civilian-explorers 0)
(set-strategic-number sn-cap-civilian-explorers 0)
(set-strategic-number sn-total-number-explorers 1)
(set-strategic-number sn-number-explore-groups 1))
(defrule
; (game-time < 60)
(unit-type-count-total villager > 0)
(building-type-count town-center >= 1); -total
(strategic-number sn-number-explore-groups == 101)
=>
(set-strategic-number sn-percent-civilian-explorers 0)
(set-strategic-number sn-cap-civilian-explorers 0)
(set-strategic-number sn-total-number-explorers 1)
(set-strategic-number sn-number-explore-groups 1))
(defrule
(game-time < 120)
(unit-type-count-total villager > 0)
(building-type-count-total town-center == 0)
(building-type-count-total lumber-camp == 0)
(wood-amount < 275)
=>
(set-strategic-number sn-percent-civilian-explorers 100)
(set-strategic-number sn-cap-civilian-explorers 100)
(set-strategic-number sn-total-number-explorers 101)
(set-strategic-number sn-number-explore-groups 101))
(defrule
(game-time < 120)
(unit-type-count-total villager > 0)
(building-type-count-total town-center == 0)
(building-type-count-total mining-camp == 0)
(stone-amount < 100)
=>
(set-strategic-number sn-percent-civilian-explorers 100)
(set-strategic-number sn-cap-civilian-explorers 100)
(set-strategic-number sn-total-number-explorers 101)
(set-strategic-number sn-number-explore-groups 101))
(defrule
; (game-time < 120)
(unit-type-count-total villager > 0)
(building-type-count-total town-center == 0)
(wood-amount >= 275)
(stone-amount >= 100)
=>
(set-strategic-number sn-wood-gatherer-percentage 20)
(set-strategic-number sn-food-gatherer-percentage 80); provisory
(set-strategic-number sn-percent-civilian-explorers 100)
(set-strategic-number sn-cap-civilian-explorers 100)
(set-strategic-number sn-total-number-explorers 101)
(set-strategic-number sn-number-explore-groups 101))
(defrule ; 126
(or (building-type-count-total town-center == 0)
(and (up-pending-objects c: town-center == 0)
(building-type-count town-center == 0))); just to be sure
; (goal increase-town-size-goal 0)
(can-build town-center)
; (wood-amount >= 275)
; (stone-amount >= 100)
; (building-available town-center)
=>
(set-goal increase-town-size-goal 0)
(build town-center)
; (set-goal increase-town-size-goal town-center)
(chat-local-to-self "Trying to get a TC up.")
)
(defrule
(building-type-count-total mill >= 1)
(or (wood-amount >= 200)
(dropsite-min-distance wood s:<= sn-maximum-wood-drop-distance))
(strategic-number sn-wood-gatherer-percentage < 5)
(strategic-number sn-minimum-civilian-explorers >= 1)
=>
(set-strategic-number sn-percent-civilian-explorers 0)
(set-strategic-number sn-minimum-civilian-explorers 0)
(set-strategic-number sn-cap-civilian-explorers 0)
(set-strategic-number sn-total-number-explorers 1)
(set-strategic-number sn-number-explore-groups 1))
(defrule
(or (unit-type-count scout-unit >= 1)
(current-age <= dark-age))
(or (players-building-count every-enemy >= 1)
(current-age <= dark-age))
(building-type-count-total mill >= 1)
(building-type-count-total lumber-camp >= 1)
(dropsite-min-distance wood s:<= sn-maximum-wood-drop-distance)
(strategic-number sn-minimum-civilian-explorers >= 1)
=>
(set-strategic-number sn-percent-civilian-explorers 0)
(set-strategic-number sn-minimum-civilian-explorers 0)
(set-strategic-number sn-cap-civilian-explorers 0)
(set-strategic-number sn-total-number-explorers 1)
(set-strategic-number sn-number-explore-groups 1))
(defrule
(unit-type-count scout-unit <= 0)
(or (not (resource-found wood))
(or (dropsite-min-distance wood s:> sn-maximum-wood-drop-distance)
(dropsite-min-distance wood > 7)))
(strategic-number sn-wood-gatherer-percentage >= 5)
(building-type-count town-center >= 1); -total
=>
(set-strategic-number sn-percent-civilian-explorers 100)
(set-strategic-number sn-minimum-civilian-explorers 1)
(set-strategic-number sn-cap-civilian-explorers 1)
(set-strategic-number sn-total-number-explorers 2)
(set-strategic-number sn-number-explore-groups 2))
(defrule
(or (unit-type-count-total villager <= 1)
(unit-type-count scout-unit >= 1))
(strategic-number sn-current-age >= fc-transit); provisory
(strategic-number sn-minimum-civilian-explorers >= 1)
=>
(set-strategic-number sn-percent-civilian-explorers 0)
(set-strategic-number sn-minimum-civilian-explorers 0)
(set-strategic-number sn-cap-civilian-explorers 0)
(set-strategic-number sn-total-number-explorers 1)
(set-strategic-number sn-number-explore-groups 1))
(defrule
(resource-found wood)
(building-type-count-total town-center == 0)
(building-type-count-total lumber-camp == 0)
(wood-amount < 275)
(can-build lumber-camp)
=>
(set-strategic-number sn-allow-adjacent-dropsites 0); testing
(set-strategic-number sn-wood-gatherer-percentage 100)
(set-strategic-number sn-maximum-wood-drop-distance 480)
(build lumber-camp))
(defrule
(resource-found stone)
(building-type-count-total town-center == 0)
(building-type-count-total mining-camp < 1)
(or (wood-amount >= 260)
(building-type-count-total lumber-camp > 0))
(stone-amount < 100)
(can-build mining-camp)
=>
(set-strategic-number sn-allow-adjacent-dropsites 0)
(build mining-camp))
#load-if-defined DEFEND-WONDER
(defrule
(unit-type-count-total villager > fourty-percent-pop)
=>
(set-goal train-civ-goal -1)
)
#end-if
(defrule
(strategic-number sn-resource-control != 3)
(nand
(strategic-number sn-current-age == feudal)
(and
(strategic-number sn-resource-control == 2)
(goal under-attack-goal 0)
)
)
=>
(set-strategic-number sn-resource-control 0)
)
#load-if-defined WONDER-RACE
(defrule
(true)
=>
(set-goal strategy-goal fast-imp);overwrite all other settings
(set-goal unit-goal wonder)
(set-goal control-goal wonder)
)
(defrule
(goal increase-town-size-goal 0)
(building-type-count-total university < 1)
(current-age == castle-age)
(wood-amount >= 200)
=>
(set-goal increase-town-size-goal university)
(enable-timer increase-town-size-timer 4)
)
(defrule
(strategic-number sn-current-age >= ci-transit)
(can-research ri-treadmill-crane)
=>
(research ri-treadmill-crane))
(defrule
(strategic-number sn-current-age >= ci-transit)
=>
(enable-timer 6 60)(disable-self)
)
(defrule
(strategic-number sn-current-age >= ci-transit)
(timer-triggered 6)
(food-amount < 300); ri-stonecutting
(can-buy-commodity food)
(research-available ri-stonecutting)
=>
(buy-commodity food)
)
(defrule
(strategic-number sn-current-age >= ci-transit)
(not (research-available ri-stonecutting))
=>
(sell-commodity food)
(delete-building farm)
(enable-timer lumber-timer 1200)
)
(defrule
(current-age == imperial-age)
(wood-amount > 1100)
(can-sell-commodity wood)
=>
(sell-commodity wood)
)
(defrule
(current-age == imperial-age)
(wood-amount < 1000)
(gold-amount > 1150)
(commodity-buying-price wood <= 150)
=>
(buy-commodity wood)
)
(defrule
(current-age == imperial-age)
(stone-amount < 1000)
(gold-amount > 1174)
(commodity-buying-price stone <= 175)
=>
(buy-commodity stone)
)
(defrule
(can-build wonder)
=>
(build wonder)
)
(defrule
(building-type-count-total wonder > 0)
=>
(delete-building blacksmith)
(delete-building market)
(delete-building university)
(delete-building monastery)
(delete-building town-center)
(set-goal increase-town-size-goal 2); block build system
)
#else
;******************** NAVY INITIALISATION ********************
(defrule
(or (goal enemy-boats-goal 1)
(players-building-type-count any-enemy dock > 0))
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(building-type-count-total blacksmith > 0)
=>
(enable-wall-placement 2)
(set-strategic-number sn-minimum-water-body-size-for-dock water-mixed)
(set-strategic-number sn-percent-attack-soldiers 0)
(set-strategic-number sn-number-boat-explore-groups 0)
(chat-to-player my-player-number "The enemy goes for water, treating this as a watermap now.")
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(taunt-detected any-human 34)
=>
(acknowledge-taunt every-human 34)
(acknowledge-taunt every-human 35)
(enable-wall-placement 2)
(set-strategic-number sn-minimum-water-body-size-for-dock water-mixed)
(set-strategic-number sn-percent-attack-soldiers 0)
(set-strategic-number sn-number-boat-explore-groups 0)
; (chat-to-allies-using-id 7110); "Yes."
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock == water-mixed)
(taunt-detected any-human 35)
=>
(set-strategic-number sn-minimum-water-body-size-for-dock 999)
; (chat-to-allies-using-id 7110); "Yes."
)
#load-if-not-defined FORTRESS-MAP
#load-if-not-defined OASIS-MAP
#load-if-not-defined SALT-MARSH-MAP
(defrule
(or (cc-players-unit-type-count 0 shore-fish >= shorefishreq) ; a lot
(or (cc-players-unit-type-count 0 sea-fish >= deepfishreq); a lot
(and (cc-players-unit-type-count 0 shore-fish >= shorefishreq2); a bit
(cc-players-unit-type-count 0 sea-fish >= deepfishreq2)))); a bit
=>
(enable-wall-placement 2)
(set-strategic-number sn-minimum-water-body-size-for-dock water-mixed)
(set-strategic-number sn-percent-attack-soldiers 0)
(set-strategic-number sn-number-boat-explore-groups 0)
(chat-to-player my-player-number "This map has fish.")
(disable-self))
#else
(defrule
(true)
=>
(enable-wall-placement 2)
(set-strategic-number sn-maximum-fish-boat-drop-distance 14)
(set-strategic-number sn-minimum-water-body-size-for-dock water-mixed)
(set-strategic-number sn-percent-attack-soldiers 0)
(set-strategic-number sn-number-boat-explore-groups 0)
(chat-to-player my-player-number "This map has fish.")
(disable-self))
#end-if
#end-if
#end-if
(defrule
(or (map-type islands)
(map-type team-islands))
(strategic-number sn-minimum-water-body-size-for-dock != water-islands)
=>
(set-strategic-number sn-garrison-rams 0); don't load rams or the computer messes up with transports
(set-strategic-number sn-minimum-water-body-size-for-dock water-islands)
(set-strategic-number sn-group-form-distance 30); big distances to load transport ships
(set-goal strategy-goal rush)
(chat-to-player my-player-number "Defined as island-map."))
(defrule
(strategic-number sn-minimum-water-body-size-for-dock == water-mixed)
(wall-completed-percentage 2 >= 100)
(players-building-type-count my-player-number stone-wall < 15); this will be only true on islands
(players-building-type-count my-player-number palisade-wall < 15)
=>
(set-strategic-number sn-garrison-rams 0); don't load rams or the computer messes up with transports
(set-strategic-number sn-minimum-water-body-size-for-dock water-islands)
(set-strategic-number sn-group-form-distance 30); big distances to load transport ships
(set-goal strategy-goal rush)
(chat-to-player my-player-number "Islands?")
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock == water-mixed)
(or (goal unit-goal skirmisher)
(goal unit-goal archer))
(up-compare-goal strategy-goal != flush)
(current-age < castle-age)
=>
(set-goal strategy-goal boom)
(set-goal unit-goal my-unique-unit-line)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
(or (goal unit-goal my-unique-unit-line)
(or (goal unit-goal skirmisher)
(goal unit-goal archer)))
(current-age < castle-age)
=>
(set-goal strategy-goal rush)
(set-goal unit-goal militiaman-line)
)
(defrule
(not (taunt-detected any-human 35))
(or (players-unit-type-count any-enemy longboat-line > 0)
(or (players-unit-type-count any-enemy galley-line > 0)
(players-unit-type-count any-enemy fire-ship-line > 0)))
=>
(set-goal enemy-boats-goal 1)
)
(defrule
(not (taunt-detected any-human 35))
(building-type-count dock > 0)
(or (players-building-type-count any-enemy dock > 0)
(players-unit-type-count any-enemy fishing-ship > 0))
=>
(set-goal enemy-boats-goal 1)
)
(defrule
(not (player-in-game any-ally))
(player-valid 3)
(game-time > 13)
=>
(set-goal nr-map-goal 1)
(set-goal ffa-game-goal 1)
(disable-self)
)
;******************** MILITARY SUPERIORITY CODE ********************
; -1 = -5 units
; 1 = +5 units
; 2 = enemy has < 70% of our military
; 3 = enemy has < 55% of our military
(defrule
(military-population > 7)
(or
(military-population > 15)
(players-military-population target-player < 4)
)
(or
(military-population > 20)
(players-military-population target-player < 10)
)
(or
(military-population > 25)
(players-military-population target-player < 15)
)
(or
(military-population > 30)
(players-military-population target-player < 20)
)
(players-military-population target-player < 25)
=>
(set-strategic-number sn-military-level 1)
)
(defrule
(military-population > 35)
(or
(military-population > 40)
(players-military-population target-player < 30)
)
(or
(military-population > 45)
(players-military-population target-player < 35)
)
(or
(military-population > 50)
(players-military-population target-player < 40)
)
(or
(military-population > 55)
(players-military-population target-player < 45)
)
(players-military-population target-player < 50)
=>
(set-strategic-number sn-military-level 1)
)
(defrule
(military-population > 60)
(or
(military-population > 65)
(players-military-population target-player < 55)
)
(or
(military-population > 70)
(players-military-population target-player < 60)
)
(or
(military-population > 75)
(players-military-population target-player < 65)
)
(or
(military-population > 80)
(players-military-population target-player < 70)
)
(players-military-population target-player < 75)
=>
(set-strategic-number sn-military-level 1)
)
(defrule
(military-population > 85)
(or
(military-population > 90)
(players-military-population target-player < 80)
)
(or
(military-population > 95)
(players-military-population target-player < 85)
)
(or
(military-population > 100)
(players-military-population target-player < 90)
)
(or
(military-population > 105)
(players-military-population target-player < 95)
)
(players-military-population target-player < 100)
=>
(set-strategic-number sn-military-level 1)
)
(defrule
(military-population > 110)
(or
(military-population > 120)
(players-military-population target-player < 105)
)
(or
(military-population > 140)
(players-military-population target-player < 115)
)
(or
(military-population > 160)
(players-military-population target-player < 135)
)
(or
(military-population > 180)
(players-military-population target-player < 155)
)
(players-military-population target-player < 175)
=>
(set-strategic-number sn-military-level 1)
)
(defrule
(military-population > 200)
(or
(military-population > 220)
(players-military-population target-player < 195)
)
(or
(military-population > 240)
(players-military-population target-player < 215)
)
(or
(military-population > 260)
(players-military-population target-player < 235)
)
(or
(military-population > 280)
(players-military-population target-player < 255)
)
(players-military-population target-player < 275)
=>
(set-strategic-number sn-military-level 1)
)
(defrule
(military-population > 300)
(or
(military-population > 320)
(players-military-population target-player < 295)
)
(or
(military-population > 340)
(players-military-population target-player < 315)
)
(or
(military-population > 360)
(players-military-population target-player < 335)
)
(or
(military-population > 380)
(players-military-population target-player < 355)
)
(players-military-population target-player < 375)
=>
(set-strategic-number sn-military-level 1)
)
(defrule
(military-population > 400)
(or
(military-population > 420)
(players-military-population target-player < 395)
)
(or
(military-population > 440)
(players-military-population target-player < 415)
)
(or
(military-population > 460)
(players-military-population target-player < 435)
)
(or
(military-population > 480)
(players-military-population target-player < 455)
)
(players-military-population target-player < 475)
=>
(set-strategic-number sn-military-level 1)
)
(defrule
(military-population > 10)
(or
(military-population > 15)
(players-military-population target-player < 2)
)
(or
(military-population > 20)
(players-military-population target-player < 10)
)
(or
(military-population > 25)
(players-military-population target-player < 14)
)
(or
(military-population > 30)
(players-military-population target-player < 17)
)
(players-military-population target-player < 21)
=>
(set-strategic-number sn-military-level 2)
)
(defrule
(military-population > 35)
(or
(military-population > 40)
(players-military-population target-player < 24)
)
(or
(military-population > 45)
(players-military-population target-player < 28)
)
(or
(military-population > 50)
(players-military-population target-player < 31)
)
(or
(military-population > 55)
(players-military-population target-player < 35)
)
(players-military-population target-player < 38)
=>
(set-strategic-number sn-military-level 2)
)
(defrule
(military-population > 60)
(or
(military-population > 65)
(players-military-population target-player < 42)
)
(or
(military-population > 70)
(players-military-population target-player < 45)
)
(or
(military-population > 75)
(players-military-population target-player < 49)
)
(or
(military-population > 80)
(players-military-population target-player < 52)
)
(players-military-population target-player < 56)
=>
(set-strategic-number sn-military-level 2)
)
(defrule
(military-population > 100)
(or
(military-population > 120)
(players-military-population target-player < 70)
)
(or
(military-population > 140)
(players-military-population target-player < 84)
)
(or
(military-population > 160)
(players-military-population target-player < 98)
)
(or
(military-population > 180)
(players-military-population target-player < 112)
)
(players-military-population target-player < 126)
=>
(set-strategic-number sn-military-level 2)
)
(defrule
(military-population > 200)
(or
(military-population > 220)
(players-military-population target-player < 140)
)
(or
(military-population > 240)
(players-military-population target-player < 154)
)
(or
(military-population > 260)
(players-military-population target-player < 168)
)
(or
(military-population > 280)
(players-military-population target-player < 182)
)
(players-military-population target-player < 196)
=>
(set-strategic-number sn-military-level 2)
)
(defrule
(military-population > 300)
(or
(military-population > 320)
(players-military-population target-player < 210)
)
(or
(military-population > 340)
(players-military-population target-player < 224)
)
(or
(military-population > 360)
(players-military-population target-player < 238)
)
(or
(military-population > 380)
(players-military-population target-player < 252)
)
(players-military-population target-player < 266)
=>
(set-strategic-number sn-military-level 2)
)
(defrule
(military-population > 400)
(or
(military-population > 420)
(players-military-population target-player < 280)
)
(or
(military-population > 440)
(players-military-population target-player < 294)
)
(or
(military-population > 460)
(players-military-population target-player < 308)
)
(or
(military-population > 480)
(players-military-population target-player < 322)
)
(players-military-population target-player < 336)
=>
(set-strategic-number sn-military-level 2)
)
(defrule
(military-population > 23)
(or
(military-population > 28)
(players-military-population target-player < 14)
)
(or
(military-population > 35)
(players-military-population target-player < 17)
)
(or
(military-population > 40)
(players-military-population target-player < 21)
)
(or
(military-population > 45)
(players-military-population target-player < 24)
)
(players-military-population target-player < 27)
=>
(set-strategic-number sn-military-level 3)
)
(defrule
(military-population > 50)
(or
(military-population > 55)
(players-military-population target-player < 30)
)
(or
(military-population > 60)
(players-military-population target-player < 33)
)
(or
(military-population > 65)
(players-military-population target-player < 36)
)
(or
(military-population > 70)
(players-military-population target-player < 39)
)
(players-military-population target-player < 42)
=>
(set-strategic-number sn-military-level 3)
)
(defrule
(military-population > 75)
(or
(military-population > 80)
(players-military-population target-player < 41)
)
(or
(military-population > 85)
(players-military-population target-player < 44)
)
(or
(military-population > 90)
(players-military-population target-player < 47)
)
(or
(military-population > 95)
(players-military-population target-player < 50)
)
(players-military-population target-player < 52)
=>
(set-strategic-number sn-military-level 3)
)
(defrule
(military-population > 100)
(or
(military-population > 120)
(players-military-population target-player < 55)
)
(or
(military-population > 140)
(players-military-population target-player < 66)
)
(or
(military-population > 160)
(players-military-population target-player < 77)
)
(or
(military-population > 180)
(players-military-population target-player < 88)
)
(players-military-population target-player < 99)
=>
(set-strategic-number sn-military-level 3)
)
(defrule
(military-population > 200)
(or
(military-population > 220)
(players-military-population target-player < 110)
)
(or
(military-population > 240)
(players-military-population target-player < 121)
)
(or
(military-population > 260)
(players-military-population target-player < 132)
)
(or
(military-population > 280)
(players-military-population target-player < 143)
)
(players-military-population target-player < 154)
=>
(set-strategic-number sn-military-level 3)
)
(defrule
(military-population > 300)
(or
(military-population > 320)
(players-military-population target-player < 165)
)
(or
(military-population > 340)
(players-military-population target-player < 176)
)
(or
(military-population > 360)
(players-military-population target-player < 187)
)
(or
(military-population > 380)
(players-military-population target-player < 198)
)
(players-military-population target-player < 209)
=>
(set-strategic-number sn-military-level 3)
)
(defrule
(military-population > 400)
(or
(military-population > 420)
(players-military-population target-player < 220)
)
(or
(military-population > 440)
(players-military-population target-player < 231)
)
(or
(military-population > 460)
(players-military-population target-player < 242)
)
(or
(military-population > 480)
(players-military-population target-player < 253)
)
(players-military-population target-player < 264)
=>
(set-strategic-number sn-military-level 3)
)
(defrule
(players-military-population target-player > 5)
(or
(military-population < 2)
(players-military-population target-player > 10)
)
(or
(military-population < 6)
(players-military-population target-player > 15)
)
(or
(military-population < 10)
(players-military-population target-player > 20)
)
(or
(military-population < 15)
(players-military-population target-player > 25)
)
(military-population < 20)
=>
(set-strategic-number sn-military-level -1)
)
(defrule
(players-military-population target-player > 30)
(or
(military-population < 25)
(players-military-population target-player > 35)
)
(or
(military-population < 30)
(players-military-population target-player > 40)
)
(or
(military-population < 35)
(players-military-population target-player > 45)
)
(or
(military-population < 40)
(players-military-population target-player > 50)
)
(military-population < 45)
=>
(set-strategic-number sn-military-level -1)
)
(defrule
(players-military-population target-player > 55)
(or
(military-population < 50)
(players-military-population target-player > 60)
)
(or
(military-population < 55)
(players-military-population target-player > 65)
)
(or
(military-population < 60)
(players-military-population target-player > 70)
)
(or
(military-population < 65)
(players-military-population target-player > 75)
)
(military-population < 70)
=>
(set-strategic-number sn-military-level -1)
)
(defrule
(players-military-population target-player > 80)
(or
(military-population < 75)
(players-military-population target-player > 85)
)
(or
(military-population < 80)
(players-military-population target-player > 90)
)
(or
(military-population < 85)
(players-military-population target-player > 95)
)
(or
(military-population < 90)
(players-military-population target-player > 100)
)
(military-population < 95)
=>
(set-strategic-number sn-military-level -1)
)
(defrule
(players-military-population target-player > 105)
(or
(military-population < 100)
(players-military-population target-player > 120)
)
(or
(military-population < 115)
(players-military-population target-player > 140)
)
(or
(military-population < 135)
(players-military-population target-player > 160)
)
(or
(military-population < 155)
(players-military-population target-player > 180)
)
(military-population < 175)
=>
(set-strategic-number sn-military-level -1)
)
(defrule
(players-military-population target-player > 200)
(or
(military-population < 195)
(players-military-population target-player > 220)
)
(or
(military-population < 215)
(players-military-population target-player > 240)
)
(or
(military-population < 235)
(players-military-population target-player > 260)
)
(or
(military-population < 255)
(players-military-population target-player > 280)
)
(military-population < 275)
=>
(set-strategic-number sn-military-level -1)
)
(defrule
(players-military-population target-player > 300)
(or
(military-population < 295)
(players-military-population target-player > 320)
)
(or
(military-population < 315)
(players-military-population target-player > 340)
)
(or
(military-population < 335)
(players-military-population target-player > 360)
)
(or
(military-population < 355)
(players-military-population target-player > 380)
)
(military-population < 375)
=>
(set-strategic-number sn-military-level -1)
)
(defrule
(players-military-population target-player > 400)
(or
(military-population < 395)
(players-military-population target-player > 420)
)
(or
(military-population < 415)
(players-military-population target-player > 440)
)
(or
(military-population < 435)
(players-military-population target-player > 460)
)
(or
(military-population < 455)
(players-military-population target-player > 480)
)
(military-population < 475)
=>
(set-strategic-number sn-military-level -1)
)
(defrule
(population >= del-civ-pop)
(goal escrow-purpose-goal 0)
(or (research-completed ri-bracer)
(or (research-completed ri-plate-mail)
(or (research-completed ri-plate-barding)
(or (research-completed ri-blast-furnace)
(research-completed ri-ring-archer-armor)))))
(strategic-number sn-military-level <= 0)
=>
(set-strategic-number sn-military-level 1))
(defrule
(population >= del-civ-pop)
(current-age-time > 180)
(current-age >= imperial-age)
(goal escrow-purpose-goal 0)
(strategic-number sn-military-level <= 0)
=>
(set-strategic-number sn-military-level 1))
(defrule
(or (military-population >= 2)
(or (players-military-population any-ally >= 2)
(players-military-population any-enemy >= 2)))
(timer-triggered one-minute-timer)
=>
(up-chat-data-to-self "Military level: %d." s: sn-military-level)
)
#load-if-defined UP-MULTIPLE-ENEMIES ; counter the actual attacker too
(defrule ; but only when we're actually under attack
(nor (unit-type-count castle-arrow > 0)
(or (unit-type-count castle-arrow-chemistry > 0)
(or (unit-type-count tc-arrow > 0)
(goal under-attack-goal 1))))
=>
(up-jump-rule 2))
(defrule
(up-compare-goal threat-player-goal >= 1)
(up-compare-goal threat-player-goal < 8)
(strategic-number sn-target-player-number g:!= threat-player-goal)
(strategic-number sn-target-player-number s:== sn-focus-player-number)
=>
(up-modify-goal math-goal s:= sn-focus-player-number))
(defrule
(up-compare-goal threat-player-goal >= 1)
(up-compare-goal threat-player-goal < 8)
(strategic-number sn-target-player-number g:!= threat-player-goal)
(strategic-number sn-target-player-number s:== sn-focus-player-number)
=>
(up-modify-sn sn-focus-player-number g:= threat-player-goal))
#end-if
(defrule
(strategic-number sn-infantry-threat < 1)
(or
(or
(or
(players-unit-type-count focus-player militiaman-line > 6)
(players-unit-type-count focus-player eagle-warrior-line > 6)
)
(or
(players-unit-type-count focus-player teutonic-knight-line > 4)
(players-unit-type-count focus-player berserk-line > 4)
)
)
(or
(or
(players-unit-type-count focus-player samurai-line > 4)
(players-unit-type-count focus-player woad-raider-line > 4)
)
(players-unit-type-count focus-player jaguar-man-line > 4)
)
)
=>
(set-strategic-number sn-infantry-threat 1)
)
(defrule
(strategic-number sn-infantry-threat < 1)
(or
(players-unit-type-count focus-player huskarl-line > 6)
(players-unit-type-count focus-player throwing-axeman-line > 6)
)
=>
(set-strategic-number sn-infantry-threat 1)
)
(defrule
(strategic-number sn-infantry-threat < 2)
(or
(or
(or
(players-unit-type-count focus-player militiaman-line > 12)
(players-unit-type-count focus-player eagle-warrior-line > 12)
)
(or
(players-unit-type-count focus-player teutonic-knight-line > 10)
(players-unit-type-count focus-player berserk-line > 10)
)
)
(or
(or
(players-unit-type-count focus-player samurai-line > 10)
(players-unit-type-count focus-player woad-raider-line > 10)
)
(players-unit-type-count focus-player jaguar-man-line > 12)
)
)
=>
(set-strategic-number sn-infantry-threat 2)
)
(defrule
(strategic-number sn-infantry-threat < 2)
(or
(or
(and
(players-unit-type-count focus-player spearman-line > 18)
(unit-type-count cavalry-unit-class > 20)
)
(players-unit-type-count focus-player huskarl-line > 12)
)
(players-unit-type-count focus-player throwing-axeman-line > 12)
)
=>
(set-strategic-number sn-infantry-threat 2)
)
(defrule
(strategic-number sn-infantry-threat < 2)
(or
(or
(or
(players-unit-type-count focus-player militiaman-line > 20)
(players-unit-type-count focus-player eagle-warrior-line > 20)
)
(or
(players-unit-type-count focus-player teutonic-knight-line > 15)
(players-unit-type-count focus-player berserk-line > 15)
)
)
(or
(or
(players-unit-type-count focus-player samurai-line > 15)
(players-unit-type-count focus-player woad-raider-line > 15)
)
(players-unit-type-count focus-player jaguar-man-line > 15)
)
)
=>
(set-strategic-number sn-infantry-threat 3)
)
(defrule
(strategic-number sn-infantry-threat < 3)
(or
(or
(and
(players-unit-type-count focus-player spearman-line > 25)
(unit-type-count cavalry-unit-class > 20)
)
(players-unit-type-count focus-player huskarl-line > 16)
)
(players-unit-type-count focus-player throwing-axeman-line > 15)
)
=>
(set-strategic-number sn-infantry-threat 3)
)
(defrule
(strategic-number sn-infantry-threat < 3)
(or
(or
(or
(players-unit-type-count focus-player militiaman-line > 36)
(players-unit-type-count focus-player eagle-warrior-line > 36)
)
(or
(players-unit-type-count focus-player teutonic-knight-line > 24)
(players-unit-type-count focus-player berserk-line > 24)
)
)
(or
(or
(players-unit-type-count focus-player samurai-line > 24)
(players-unit-type-count focus-player woad-raider-line > 24)
)
(players-unit-type-count focus-player jaguar-man-line > 24)
)
)
=>
(set-strategic-number sn-infantry-threat 4)
)
(defrule
(strategic-number sn-infantry-threat < 4)
(or
(or
(and
(players-unit-type-count focus-player spearman-line > 46)
(unit-type-count cavalry-unit-class > 20)
)
(players-unit-type-count focus-player huskarl-line > 24)
)
(players-unit-type-count focus-player throwing-axeman-line > 24)
)
=>
(set-strategic-number sn-infantry-threat 4)
)
(defrule
(game-time < 1500)
(players-building-type-count focus-player castle > 0); early enemy castle and ranged uu civ
(or
(or
(players-civ focus-player briton)
(players-civ focus-player chinese)
)
(or
(or
(players-civ focus-player mayan)
(players-civ focus-player mongol)
)
(or
(players-civ focus-player spanish)
(players-civ focus-player turkish)
)
)
)
=>
(set-strategic-number sn-archer-threat 1)
)
(defrule
(or
(players-unit-type-count focus-player hand-cannoneer > 6)
(or
(players-unit-type-count focus-player conquistador-line > 4)
(players-unit-type-count focus-player janissary-line > 4)
)
)
=>
(set-strategic-number sn-archer-threat 1)
)
(defrule
(or
(or
(players-unit-type-count focus-player archer-line > 13)
(or
(players-unit-type-count focus-player chu-ko-nu-line > 9)
(players-unit-type-count focus-player longbowman-line > 9)
)
)
(or
(or
(players-unit-type-count focus-player plumed-archer-line > 9)
(players-unit-type-count focus-player mangudai-line > 9)
)
(or
(players-unit-type-count focus-player cavalry-archer-line > 9)
(players-unit-type-count focus-player war-wagon-line > 9)
)
)
)
=>
(set-strategic-number sn-archer-threat 2)
)
(defrule
(or
(or
(or
(players-unit-type-count focus-player elephant-archer > 9)
(players-unit-type-count focus-player genoese-crossbowman > 9)
)
(or
(players-unit-type-count focus-player hand-cannoneer > 13)
(and
(goal unit-goal archer)
(players-unit-type-count focus-player skirmisher-line > 15)
)
)
)
(or
(players-unit-type-count focus-player conquistador-line > 9)
(players-unit-type-count focus-player janissary-line > 9)
)
)
=>
(set-strategic-number sn-archer-threat 2)
)
(defrule
(or
(or
(players-unit-type-count focus-player archer-line > 25)
(or
(players-unit-type-count focus-player chu-ko-nu-line > 20)
(players-unit-type-count focus-player longbowman-line > 20)
)
)
(or
(or
(players-unit-type-count focus-player plumed-archer-line > 20)
(players-unit-type-count focus-player mangudai-line > 20)
)
(or
(players-unit-type-count focus-player cavalry-archer-line > 20)
(players-unit-type-count focus-player war-wagon-line > 20)
)
)
)
=>
(set-strategic-number sn-archer-threat 3)
)
(defrule
(or
(or
(players-unit-type-count focus-player genoese-crossbowman > 40)
(or
(players-unit-type-count focus-player chu-ko-nu-line > 40)
(players-unit-type-count focus-player longbowman-line > 40)
)
)
(or
(or
(players-unit-type-count focus-player plumed-archer-line > 40)
(players-unit-type-count focus-player mangudai-line > 40)
)
(or
(players-unit-type-count focus-player cavalry-archer-line > 40)
(players-unit-type-count focus-player war-wagon-line > 40)
)
)
)
=>
(set-strategic-number sn-archer-threat 4)
)
(defrule
(or
(or
(or
(players-unit-type-count focus-player magyar-huszar > 4)
(players-unit-type-count focus-player boyar > 4)
)
(or
(or
(players-unit-type-count focus-player knight-line > 4)
(players-unit-type-count focus-player scout-cavalry-line > 4)
)
(or
(players-unit-type-count focus-player tarkan-line > 3)
(players-unit-type-count focus-player war-elephant-line > 2)
)
)
)
(or
(players-unit-type-count focus-player camel-line > 4)
(players-unit-type-count focus-player cataphract-line > 4)
)
)
=>
(set-strategic-number sn-cavalry-threat 1)
)
(defrule
(or
(or
(or
(players-unit-type-count focus-player magyar-huszar > 10)
(players-unit-type-count focus-player boyar > 10)
)
(or
(or
(players-unit-type-count focus-player knight-line > 10)
(players-unit-type-count focus-player scout-cavalry-line > 10)
)
(or
(players-unit-type-count focus-player tarkan-line > 10)
(players-unit-type-count focus-player war-elephant-line > 6)
)
)
)
(or
(players-unit-type-count focus-player camel-line > 10)
(players-unit-type-count focus-player cataphract-line > 10)
)
)
=>
(set-strategic-number sn-cavalry-threat 2)
)
(defrule
(or
(or
(or
(players-unit-type-count focus-player magyar-huszar > 16)
(players-unit-type-count focus-player boyar > 16)
)
(or
(or
(players-unit-type-count focus-player knight-line > 16)
(players-unit-type-count focus-player scout-cavalry-line > 16)
)
(or
(players-unit-type-count focus-player tarkan-line > 16)
(players-unit-type-count focus-player war-elephant-line > 10)
)
)
)
(or
(players-unit-type-count focus-player camel-line > 16)
(players-unit-type-count focus-player cataphract-line > 16)
)
)
=>
(set-strategic-number sn-cavalry-threat 3)
)
(defrule
(or
(or
(or
(players-unit-type-count focus-player magyar-huszar > 26)
(players-unit-type-count focus-player boyar > 22)
)
(or
(or
(players-unit-type-count focus-player knight-line > 22)
(players-unit-type-count focus-player scout-cavalry-line > 26)
)
(or
(players-unit-type-count focus-player tarkan-line > 22)
(players-unit-type-count focus-player war-elephant-line > 15)
)
)
)
(or
(players-unit-type-count focus-player camel-line > 22)
(players-unit-type-count focus-player cataphract-line > 22)
)
)
=>
(set-strategic-number sn-cavalry-threat 4)
)
(defrule
(or
(or
(players-unit-type-count focus-player camel-line > 9)
(players-unit-type-count focus-player spearman-line > 12)
)
(or
(players-unit-type-count focus-player mameluke-line > 9)
(and
(game-time < 1380)
(players-unit-type-count focus-player spearman-line > 6)
)
)
)
=>
(set-goal anti-cavalry-threat-goal 1)
)
(defrule
(or
(players-unit-type-count any-enemy scout-cavalry-line > 9)
(or
(players-unit-type-count any-enemy eagle-warrior-line > 9)
(goal enemy-goal eagle-warrior)
)
)
=>
(set-goal anti-monk-threat-goal 1)
)
(defrule
(or
(players-unit-type-count any-enemy monk > 5)
(and
(game-time < 1500)
(players-building-type-count focus-player monastery > 1)
)
)
(or
(game-time < 1500)
(players-unit-type-count any-enemy monk > 11)
)
(or
(game-time < 1800)
(players-unit-type-count any-enemy monk > 18)
)
=>
(set-goal monk-threat-goal 1)
)
; Following rules help to make up for poor scouting.
(defrule
(game-time > 900)
(game-time < 1800)
(strategic-number sn-cavalry-threat == 0)
(or
(players-unit-type-count focus-player knight-line > 0)
(game-time < 1320)
)
(players-building-type-count focus-player stable > 0)
=>
(set-strategic-number sn-cavalry-threat 1)
)
(defrule
(strategic-number sn-cavalry-threat < 2)
(or
(and
(and
(game-time < 1500)
(players-unit-type-count focus-player knight-line > 3)
)
(or
(players-unit-type-count focus-player knight-line > 5)
(game-time < 1320)
)
)
(players-building-type-count focus-player stable > 1)
)
=>
(set-strategic-number sn-cavalry-threat 2)
)
(defrule
(game-time > 1020)
(game-time < 1260)
(goal strategy-goal flush)
(strategic-number sn-cavalry-threat == 0)
(players-building-type-count focus-player barracks < 1)
(players-building-type-count focus-player archery-range == 0)
(players-military-population focus-player < 2)
(players-building-type-count focus-player market == 0)
(nor
(players-civ focus-player aztec)
(players-civ focus-player mayan)
)
=>
(set-strategic-number sn-cavalry-threat 1)
)
#load-if-defined DEATH-MATCH
(defrule
(strategic-number sn-cavalry-threat < 1)
(current-age >= castle-age)
(game-time < 480)
(nor
(or
(players-civ focus-player gothic)
(players-civ focus-player korean)
)
(or
(players-civ focus-player viking)
(players-civ focus-player briton)
)
)
(nor
(players-civ focus-player japanese)
(goal meso-enemy-goal 1)
)
=>
(set-strategic-number sn-cavalry-threat 1)
)
#end-if
(defrule
(strategic-number sn-archer-threat < 1)
(players-current-age focus-player < imperial-age)
(players-current-age-time focus-player < 600)
(players-building-type-count focus-player archery-range > 1)
=>
(set-strategic-number sn-archer-threat 1)
)
#load-if-not-defined DIFFICULTY-EASIEST
#load-if-not-defined DIFFICULTY-EASY
#load-if-not-defined DIFFICULTY-MODERATE
#load-if-not-defined DIFFICULTY-HARD
;(defrule
;(or (goal unit-goal archer)
; (goal strategy-goal flush))
; (up-research-status c: ri-ballistics < research-pending)
;(or (and (strategic-number sn-cavalry-threat > 1)
; (players-current-age every-enemy >= castle-age))
; (players-unit-type-count focus-player eagle-warrior-line > 10))
;=>
; (set-difficulty-parameter ability-to-maintain-distance 100); stay
;)
(defrule
(or (or (unit-type-count fire-ship-line >= 1)
(unit-type-count scorpion-line >= 20))
(or (unit-type-count ranged-unit-class >= 50)
(unit-type-count war-wagon-line >= 50)))
=>
(set-difficulty-parameter ability-to-maintain-distance 100); stay
)
(defrule
(unit-type-count fire-ship-line < 1)
(unit-type-count scorpion-line < 18)
(unit-type-count ranged-unit-class < 45)
(unit-type-count war-wagon-line < 45)
=>
(set-difficulty-parameter ability-to-dodge-missiles ability-to-dodge); 0 = dodge
(set-difficulty-parameter ability-to-maintain-distance ability-to-kite)); 0 = kite
#end-if
#end-if
#end-if
#end-if
#load-if-defined UP-MULTIPLE-ENEMIES
(defrule ; test
(nor (unit-type-count castle-arrow > 0)
(or (unit-type-count castle-arrow-chemistry > 0)
(or (unit-type-count tc-arrow > 0)
(goal under-attack-goal 1))))
=>
(up-jump-rule 1))
(defrule
(strategic-number sn-target-player-number g:== threat-player-goal)
(strategic-number sn-target-player-number s:!= sn-focus-player-number)
=>
(up-modify-sn sn-focus-player-number s:== sn-target-player-number)
;jtbs (up-modify-sn sn-focus-player-number g:= math-goal)
)
#end-if
#end-if
; Scouting
#load-if-not-defined WONDER-RACE
#load-if-not-defined DEATH-MATCH
#load-if-not-defined SCANDANAVIA-MAP
(defrule
(strategic-number sn-minimum-civilian-explorers > 0)
(timer-triggered civ-explore-timer)
(game-time > 90)
(strategic-number sn-maximum-wood-drop-distance == 0)
=>
(set-strategic-number sn-maximum-wood-drop-distance -1)
(chat-local-to-self "Enable wood gathering.")
)
#load-if-not-defined UP-MULTIPLAYER-GAME ; bug in MP
(defrule
(game-time > 90)
(strategic-number sn-percent-civilian-explorers == 0)
(building-type-count-total mill == 0)
(unit-type-count villager < 11)
(sheep-and-forage-too-far)
(strategic-number sn-current-age == dark)
(building-type-count town-center > 0)
=>
(set-strategic-number sn-percent-civilian-builders 0)
(set-strategic-number sn-percent-civilian-explorers 100)
(set-strategic-number sn-minimum-civilian-explorers 12)
(set-strategic-number sn-maximum-food-drop-distance 32)
(set-strategic-number sn-maximum-wood-drop-distance 0)
(enable-timer civ-explore-timer 20)
(chat-local-to-self "Civ explore again.")
(disable-self)
)
#end-if
#end-if
(defrule
(or
(players-building-type-count every-enemy dock == 0)
(and
(warboat-count > 7)
(players-building-type-count any-enemy dock == 0)
)
)
(warboat-count > 0)
(strategic-number sn-number-boat-explore-groups < 1)
(nand
(warboat-count < 6)
(unit-type-count revealer > 0)
)
=>
(set-strategic-number sn-number-boat-explore-groups 1)
(set-strategic-number sn-total-number-explorers 2)
(chat-local-to-self "Search for enemy docks.")
)
#else
(defrule
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
(players-building-count every-enemy == 0)
(goal under-attack-goal 0)
(warboat-count > 0)
=>
(set-strategic-number sn-number-boat-explore-groups 5)
(set-strategic-number sn-total-number-explorers 6)
)
(defrule
(strategic-number sn-number-boat-explore-groups > 1)
(players-building-type-count every-enemy dock > 0)
=>
(set-strategic-number sn-number-boat-explore-groups 1)
)
#end-if
(defrule
(game-time s:>= sn-home-exploration-time); 300 by default
(nor (map-type islands)
(map-type team-islands))
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(players-building-count any-enemy <= 0); every
(military-population >= 1)
; (up-compare-goal strategy-goal != boom)
=>
(chat-local-to-self "Searching for the closest enemy.")
(up-send-scout group-type-land-explore scouting-type)
(enable-timer scouting-timer 120)
(disable-self))
(defrule
(timer-triggered scouting-timer)
(game-time < 1200)
(nor (map-type islands)
(map-type team-islands))
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(players-building-count every-enemy <= 0)
(military-population >= 1)
; (up-compare-goal strategy-goal != boom)
=>
(chat-local-to-self "Searching for the closest enemy again.")
(up-send-scout group-type-land-explore scouting-type)
(enable-timer scouting-timer 120)); 80
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(or (and (unit-type-count knight-line == 0)
(strategic-number sn-military-level >= 0))
(game-time >= 1380))
(game-time > 1140)
(game-time < 1800)
(timer-triggered scouting-timer)
(strategic-number sn-infantry-threat == 0)
(strategic-number sn-archer-threat == 0)
(strategic-number sn-cavalry-threat == 0)
(players-building-count any-enemy >= 1)
(players-current-age focus-player >= feudal-age)
(goal monk-threat-goal 0)
=>
(enable-timer scouting-timer 180)
; (set-strategic-number sn-percent-attack-soldiers 1)
; (attack-now)
(chat-local-to-self "Scouting the target-player.")
(up-send-scout group-type-land-explore scout-enemy)
)
(defrule
(game-time > 1500)
(players-building-count every-enemy > 0)
(or (or (strategic-number sn-infantry-threat >= 1)
(strategic-number sn-archer-threat >= 1))
(or (strategic-number sn-cavalry-threat >= 1)
(goal monk-threat-goal 1)))
=>
(set-strategic-number sn-number-explore-groups 0);disable scouting when found threats to not waste units
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(or (and (and
(strategic-number sn-infantry-threat == 0)
(strategic-number sn-archer-threat == 0)
)
(and
(strategic-number sn-cavalry-threat == 0)
(goal monk-threat-goal 0)
)
)
(players-building-count any-enemy == 0)
)
(strategic-number sn-number-explore-groups == 0)
=>
(set-strategic-number sn-number-explore-groups 1); restart scouting when no threats found
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(players-current-age any-enemy == feudal-age)
(players-current-age-time any-enemy > 360); enemy in feudal age for 6+ mins
(game-time < 1320)
(players-military-population any-enemy < 2); yet no military
(players-building-count any-enemy == 0); not all enemy sighted
(military-population > 10)
(goal position-goal pocket)
=>
(set-strategic-number sn-number-explore-groups 3); find the sling
(set-strategic-number sn-total-number-explorers 3)
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(nor
(players-civ every-enemy gothic)
(players-civ every-enemy viking)
)
(nor
(players-civ every-enemy japanese)
(goal meso-enemy-goal 1)
)
(strategic-number sn-cavalry-threat == 0)
(strategic-number sn-number-explore-groups == 0)
=>
(set-strategic-number sn-number-explore-groups 1);resume exploring
)
(defrule
(stance-toward focus-player enemy)
(or (players-civ focus-player aztec)
(or (players-civ focus-player mayan)
(players-civ focus-player incan)))
(up-compare-goal meso-enemy-goal != 1)
=>
(set-goal meso-enemy-goal 1)
)
(defrule
(stance-toward focus-player enemy)
(nor (players-civ focus-player aztec)
(or (players-civ focus-player mayan)
(players-civ focus-player incan)))
(up-compare-goal meso-enemy-goal != 0)
=>
(set-goal meso-enemy-goal 0)
)
#load-if-not-defined POPULATION-CAP-25
#load-if-not-defined UP-POCKET-POSITION
;gather information about what the enemy (mainly 1v1) is doing
(defrule
(current-age == dark-age); we have +2 villagers, so enemy feudals early?! => flush
(unit-type-count villager >= 22); or +3 villagers as meso as they start with either one more or free loom and save time.
(or
(players-civilian-population target-player < 21)
(unit-type-count villager >= 23)
)
(or
(players-civilian-population target-player < 22)
(unit-type-count villager >= 24)
)
(or
(players-civilian-population target-player < 23)
(unit-type-count villager >= 25)
)
(players-civilian-population target-player < 24)
=>
(set-goal enemy-goal flush)
)
(defrule
(current-age == dark-age); we have +2 villagers, so enemy feudals early?! => flush
(unit-type-count villager >= 26)
(or
(players-civilian-population target-player < 25)
(unit-type-count villager >= 27)
)
(or
(players-civilian-population target-player < 26)
(unit-type-count villager >= 28)
)
(or
(players-civilian-population target-player < 27)
(unit-type-count villager >= 29)
)
(or
(players-civilian-population target-player < 28)
(unit-type-count villager >= 30)
)
(players-civilian-population target-player < 29)
=>
(set-goal enemy-goal flush)
)
(defrule
(or
(game-time < 1020)
(players-military-population target-player > 11)
)
(players-current-age target-player == feudal-age)
(players-military-population target-player > 4)
=>
(set-goal enemy-goal flush)
)
#end-if ; <- no pocket
(defrule
(players-current-age target-player == dark-age)
(or (goal ffa-game-goal 1)
(players-civilian-population target-player >= 26))
(goal enemy-goal flush)
=>
(set-goal enemy-goal 0)
)
#load-if-defined CHINESE-CIV
(defrule
(players-current-age target-player == dark-age)
(or (starting-resources >= medium-resources); don't false trigger flush if chinese are able to keep their villager advantage
(regicide-game))
(goal enemy-goal flush)
=>
(set-goal enemy-goal 0)
)
#end-if
(defrule
(players-current-age target-player == castle-age)
(game-time < 1200)
(players-military-population target-player < 3); enemy fast castle without military could be rush so better be prepared
(nor
(goal enemy-goal rush)
(goal enemy-goal eagle-warrior)
)
=>
(set-goal enemy-goal rush)
)
(defrule
(game-time < 1260)
(players-current-age target-player >= castle-age)
(players-military-population target-player > 5)
(goal enemy-goal flush)
=>
(set-goal enemy-goal skirmisher)
(chat-to-player my-player-number "The enemy isn't flushing.")
)
(defrule
(game-time < 1720)
(or
(and
(players-current-age target-player == feudal-age)
(up-compare-goal enemy-goal != flush)
)
(players-unit-type-count target-player skirmisher-line > 8)
)
(players-military-population target-player >= 6)
=>
(set-goal enemy-goal skirmisher)
(chat-to-player my-player-number "Enemy trash-unit strategy detected.")
(disable-self)
)
(defrule
(game-time < 1500)
(or
(or
(players-unit-type-count target-player eagle-warrior-line > 7)
(and
(players-building-type-count target-player barracks > 2)
(players-unit-type-count target-player militiaman-line < 3)
)
)
(and
(game-time < 1200)
(and
(players-building-type-count target-player barracks > 1)
(players-military-population target-player < 2)
)
)
)
=>
(set-goal enemy-goal eagle-warrior)
(chat-to-player my-player-number "24Enemy EW rush detected.")
(disable-self)
)
(defrule
(game-time < 1500)
(players-unit-type-count target-player eagle-warrior-line > 4)
(players-current-age-time target-player < 150)
=>
(set-goal enemy-goal eagle-warrior)
(chat-to-player my-player-number "24Enemy EW rush detected.")
(disable-self)
)
(defrule
(game-time >= 1800)
(or
(players-unit-type-count target-player eagle-warrior-line < 5)
(game-time > 2400)
)
(players-unit-type-count target-player eagle-warrior-line < 20)
(goal enemy-goal eagle-warrior)
=>
(set-goal enemy-goal 0)
(disable-self)
)
#end-if
(defrule
(or
(or
(goal under-attack-goal 1)
(up-compare-goal patrol-goal >= 0)
)
(or
(and
(strategic-number sn-maximum-town-size >= 40)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands); TSA is not used on islands
)
(strategic-number sn-number-attack-groups > 0)
)
)
(building-type-count-total town-center > 0)
=>
(set-goal hostilities-goal 1)
)
;******************** STRATEGY SELECTION ********************
#load-if-not-defined POST-IMPERIAL-AGE-START
#load-if-not-defined UP-POCKET-POSITION
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(goal enemy-goal flush)
(up-compare-goal control-goal != aggressive-rush)
(up-compare-goal control-goal != shot)
(up-compare-goal strategy-goal != sling)
(up-compare-goal position-goal == flank)
(strategic-number sn-current-age == dark); not too early, if the enemy just had idle TC and we have no food for feudal
(food-amount >= 430)
=>
(set-goal strategy-goal flush)
(set-goal unit-goal default-flush-unit)
(set-strategic-number sn-task-ungrouped-soldiers 1); spread military to find forward towers, set back after 6 mins
(set-goal spread-military-goal 1)
(enable-timer spread-military-timer 360)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(goal enemy-goal flush)
(up-compare-goal control-goal != aggressive-rush)
(up-compare-goal control-goal != shot)
(up-compare-goal strategy-goal != sling)
(up-compare-goal position-goal == flank)
(players-current-age focus-player == feudal-age)
(strategic-number sn-current-age == df-transit)
=>
(set-goal strategy-goal flush)
(set-goal unit-goal default-flush-unit)
(set-strategic-number sn-task-ungrouped-soldiers 1); spread military to find forward towers, set back after 5 mins
(set-goal spread-military-goal 1)
(enable-timer spread-military-timer 300)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(goal enemy-goal flush)
(current-age == dark-age)
(goal control-goal aggressive-rush)
(up-compare-goal position-goal == flank)
=>
(set-goal strategy-goal flush)
(set-goal unit-goal default-flush-unit)
(set-goal control-goal 0)
(set-strategic-number sn-task-ungrouped-soldiers 1); spread military to find forward towers, set back after 5 mins
(set-goal spread-military-goal 1)
(enable-timer spread-military-timer 300)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(goal nr-map-goal -1)
(building-type-count stone-wall < 15); not on walled maps
(strategic-number sn-current-age == feudal)
(up-compare-goal strategy-goal != flush)
(up-compare-goal control-goal != shot)
(up-compare-goal position-goal == flank); hm
(building-type-count-total barracks > 0)
(or
(food-amount < 500)
(goal unit-goal skirmisher)
)
(players-military-population focus-player > 2)
=>
(set-goal strategy-goal flush)
(set-goal unit-goal default-flush-unit)
(set-goal control-goal belated-flush-defense); change gatherer percentages to collect more wood
(chat-to-player my-player-number "Counter-flushing. 1")
)
#load-if-not-defined BRITON-CIV
#load-if-not-defined MAYAN-CIV
#load-if-not-defined VIKING-CIV
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(building-type-count stone-wall < 15); not on walled maps
(strategic-number sn-current-age == feudal)
(goal strategy-goal rush)
(goal enemy-goal flush)
(up-compare-goal position-goal == flank); hm
(nor
(or
(goal control-goal aggressive-rush)
(goal control-goal shot)
)
(goal position-goal pocket)
)
(building-type-count barracks > 0)
=>
(set-goal strategy-goal flush)
(set-goal unit-goal default-flush-unit)
(set-goal control-goal belated-flush-defense); change gatherer percentages to collect more wood
(chat-to-player my-player-number "Counter-flushing. 2")
)
#else
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(building-type-count stone-wall < 15); not on walled maps
(strategic-number sn-current-age == feudal)
(goal strategy-goal rush)
(goal enemy-goal flush)
(goal position-goal flank)
(up-compare-goal control-goal != shot)
(building-type-count-total stable == 0)
(building-type-count barracks > 0)
=>
(set-goal strategy-goal flush)
(set-goal unit-goal archer)
(set-goal control-goal belated-flush-defense); change gatherer percentages to collect more wood
(chat-to-player my-player-number "Counter-flushing. 3")
)
#end-if
#end-if
#end-if
#end-if
#load-if-not-defined DIFFICULTY-MODERATE
#load-if-not-defined DIFFICULTY-HARD
#load-if-not-defined DIFFICULTY-HARDEST
;#load-if-not-defined DEATH-MATCH
(defrule
(current-age < feudal-age);(strategic-number sn-current-age == dark)
(goal strategy-goal flush)
=>
(set-goal strategy-goal boom); rush
(set-goal unit-goal default-unit)
(chat-local-to-self "Don't flush on easy difficulty-levels.")
)
;#end-if
#end-if
#end-if
#end-if
#load-if-defined DEATH-MATCH ; treat this as flush and build an army in feudal age.
;(defrule
; (strategic-number sn-current-age == df-transit)
;=>
; (set-goal enemy-goal flush)
; (set-goal strategy-goal flush)
; (set-goal unit-goal default-flush-unit)
; (disable-self)
;)
#else
#load-if-not-defined SARACEN-CIV
#load-if-not-defined DIFFICULTY-MODERATE
#load-if-not-defined DIFFICULTY-HARD
#load-if-not-defined DIFFICULTY-HARDEST
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(nor
(goal strategy-goal flush)
(goal strategy-goal sling)
)
(or
(building-type-count-total mining-camp == 0)
(dropsite-min-distance gold < 0)
)
(strategic-number sn-current-age == feudal)
(building-type-count-total market < 1)
(current-age-time < 10)
(nor
(town-under-attack)
(goal unit-goal eagle-warrior)
)
=>
(set-goal strategy-goal flush)
(set-goal unit-goal no-gold-flush-unit)
(set-strategic-number sn-maximum-gold-drop-distance 20)
)
#end-if
#end-if
#end-if
#end-if
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(goal unit-goal my-unique-unit-line)
(strategic-number sn-current-age == feudal)
(current-age-time < 10)
(or
(dropsite-min-distance stone < 0); no stone found
(dropsite-min-distance stone > 20); so switch strategy ; 33
)
=>
(set-goal unit-goal default-ranged); should work for all civs
(set-goal ranged-unit-type-goal default-ranged)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(or (civ-selected aztec)
(or (civ-selected hun)
(or (civ-selected incan)
(civ-selected persian))))
(goal unit-goal my-unique-unit-line)
=>
(chat-local-to-self "Trying to find an alternate strategy: No castledrop.")
(set-goal unit-goal default-ranged); should work for all civs
(set-goal ranged-unit-type-goal default-ranged)
(disable-self)
)
(defrule
(or (and (player-in-game any-human-enemy)
(or (or (map-type black-forest)
(cc-players-unit-type-count 0 tree-class > heavy-wood))
(or (map-type mongolia)
(map-type oasis))))
(building-type-count stone-wall-line > 15))
=>
(set-goal nr-map-goal 1)
(disable-self)
)
(defrule
(taunt-detected any-ally 38)
(taunt-detected any-ally 33)
=>
(acknowledge-taunt this-any-ally 38)
(acknowledge-taunt this-any-ally 33)
(chat-to-allies "1")
(chat-to-allies-using-id 7110); "Yes."
)
(defrule
(or (taunt-detected any-ally 32)
(taunt-detected any-ally 33))
(or (goal strategy-goal sling)
(goal control-goal shot))
=>
(acknowledge-taunt this-any-ally 32)
(acknowledge-taunt this-any-ally 33)
(chat-to-allies "2")
(chat-to-allies-using-id 7111); "No."
)
; *** STRATEGY DEPENDING ON CIV ***
#load-if-defined AZTEC-CIV
#load-if-not-defined ARABIA-MAP
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(game-time > 13)
(game-time < 60)
(random-number <= 20)
(or (goal position-goal pocket)
(or (map-size giant)
(map-size ludikris)))
;(nand (goal position-goal flank)
; (or (map-size large)
; (or (map-size giant)
; (map-size ludikris))))
=>
(set-goal strategy-goal boom)
(set-goal unit-goal archer)
(set-goal ranged-unit-type-goal archer)
(set-goal control-goal 0)
(disable-self)
)
(defrule
(game-time < 1500)
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(goal unit-goal archer)
(goal strategy-goal boom)
(up-compare-goal position-goal == flank)
(strategic-number sn-military-level < 0)
(building-type-count-total town-center > tc-level-one)
=>
(set-goal strategy-goal rush)
(set-goal control-goal 0)
(disable-self)
)
#else
#load-if-not-defined UP-POCKET-POSITION
#load-if-defined LOW-RESOURCES-START
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(game-time > 13)
(game-time < 60)
(random-number <= 20)
(up-compare-goal position-goal == flank)
(up-compare-goal control-goal != shot)
=>
(set-goal strategy-goal flush)
(set-goal unit-goal archer)
(set-goal ranged-unit-type-goal archer)
(set-goal control-goal 0)
(disable-self)
)
#end-if
#end-if
#end-if
(defrule
(or
(nand
(goal meso-enemy-goal 1)
(goal position-goal flank)
)
(goal nr-map-goal 1)
)
(random-number > 20)
(random-number <= 40)
(game-time > 13)
(game-time < 60)
=>
(set-goal strategy-goal rush)
(set-goal unit-goal monk)
(set-goal ranged-unit-type-goal monk)
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(or
(random-number <= 20)
(random-number > 86)
)
(goal position-goal pocket)
(game-time > 13)
(game-time < 60)
=>
(set-goal strategy-goal boom)
(set-goal unit-goal archer)
(set-goal control-goal 0)
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(goal ffa-game-goal -1)
(goal nr-map-goal -1)
(strategic-number sn-current-age <= fc-transit)
(nor
(players-civ any-ally briton); don't play with too much ranged
(players-civ any-ally mayan)
)
(random-number >= 70)
(game-time < 60)
=>
(set-goal strategy-goal rush)
(set-goal unit-goal archer)
(set-goal control-goal aggressive-rush)
(disable-self)
)
(defrule
(strategic-number sn-current-age == castle)
(or
(and
(goal strategy-goal boom)
(or
(goal unit-goal archer)
(goal unit-goal eagle-warrior)
)
)
(goal unit-goal skirmisher)
)
(building-type-count-total town-center >= tc-level-three)
(or
(building-type-count-total town-center >= tc-level-four)
(goal unit-goal eagle-warrior)
)
=>
(set-goal strategy-goal fast-imp)
)
(defrule
(or
(or
(players-unit-type-count focus-player huskarl-line > 15)
(players-unit-type-count focus-player samurai-line > 15)
)
(or
(and
(strategic-number sn-cavalry-threat > 3)
(goal anti-monk-threat-goal 0)
)
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
)
)
=>
(set-goal ranged-unit-type-goal monk)
(disable-self)
)
(defrule
(goal unit-goal monk)
(or
(and
(building-type-count-total barracks > 0)
(building-type-count-total monastery < 2)
)
(up-research-status c: ri-long-swordsman >= research-pending)
)
=>
(set-goal strategy-goal rush)
(set-goal unit-goal eagle-warrior)
)
(defrule
(strategic-number sn-current-age >= ci-transit)
(or
(or
(goal strategy-goal boom)
(goal strategy-goal fast-imp)
)
(and
(goal unit-goal skirmisher)
(goal ranged-unit-type-goal archer)
)
)
(up-compare-goal unit-goal != monk)
=>
(set-goal strategy-goal rush)
(set-goal unit-goal eagle-warrior)
)
(defrule
(strategic-number sn-current-age < ci-transit)
(goal unit-goal eagle-warrior)
(goal strategy-goal rush)
(or
(military-population > 60)
(unit-type-count-total eagle-warrior-line > 45)
)
=>
(set-goal unit-goal eagle-warrior)
(set-goal strategy-goal fast-imp)
(set-goal ranged-unit-type-goal 0)
)
(defrule
(goal unit-goal eagle-warrior)
(goal strategy-goal rush)
(or
(players-building-type-count focus-player castle > 0)
(or
(players-unit-type-count focus-player teutonic-knight-line > 0)
(players-unit-type-count focus-player cataphract-line > 0)
)
)
(game-time < 1500)
=>
(set-goal unit-goal eagle-warrior)
(set-goal strategy-goal fast-imp)
(set-goal ranged-unit-type-goal monk)
)
#load-if-defined UP-1-PLAYER-TEAM
(defrule
(nor
(goal control-goal my-unique-unit-line)
(goal unit-goal my-unique-unit-line)
)
(civilian-population > 90)
(or
(and
(strategic-number sn-current-age >= ci-transit)
(game-time > 3000)
)
(and
(food-amount > 400)
(gold-amount < 100)
)
)
(current-age-time > 300)
=>
(set-goal control-goal militiaman-line)
(chat-to-player my-player-number "Trying to research m@a and LSM.")
(disable-self)
)
#end-if
(defrule
(game-time < 2100)
(players-current-age focus-player == imperial-age)
(or
(goal unit-goal mix)
(goal unit-goal eagle-warrior)
)
(players-unit-type-count focus-player eagle-warrior-line > 5)
=>
(set-goal control-goal militiaman-line)
(chat-to-player my-player-number "Trying to research m@a and LSM.")
(disable-self)
)
(defrule
(food-amount > 150)
(or
(gold-amount < 50)
(food-amount > 300)
)
(or
(and
(up-research-status c: ri-iron-casting >= research-pending)
(and
(goal unit-goal eagle-warrior)
(goal enemy-goal eagle-warrior)
)
)
(and
(goal unit-goal monk)
(players-unit-type-count focus-player eagle-warrior-line > 7)
)
)
=>
(set-goal control-goal militiaman-line)
(chat-to-player my-player-number "Going for long-swordsmen to counter an EW rush.")
(disable-self)
)
#load-if-not-defined RIVERS-MAP
#load-if-not-defined BALTIC-MAP
(defrule
(or
(and
(strategic-number sn-current-age >= ci-transit)
(and
(goal control-goal militiaman-line)
(up-research-status c: ri-long-swordsman >= research-pending)
)
)
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
)
(nand
(unit-type-count-total eagle-warrior-line > 20); go for eew instead as some enemy still may have ranged units
(strategic-number sn-archer-threat > 0)
)
=>
(set-goal unit-goal militiaman-line)
(disable-self)
)
#end-if
#end-if
(defrule
(up-compare-goal control-goal != shot)
(strategic-number sn-infantry-threat >= 3)
(players-unit-type-count every-enemy samurai-line < 20)
(nand
(players-unit-type-count focus-player eagle-warrior-line > 20)
(goal control-goal militiaman-line)
)
(dropsite-min-distance stone < 5)
(building-type-count-total town-center >= tc-level-two)
=>
(set-goal control-goal my-unique-unit-line)
(set-goal uu-up-goal 1)
(disable-self)
)
(defrule
(building-type-count castle > 1)
(goal control-goal my-unique-unit-line)
=>
(set-goal unit-goal my-unique-unit-line)
(set-goal control-goal 0)
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock == water-mixed)
(or (map-type baltic)
(map-type rivers))
(current-age < castle-age)
(goal unit-goal eagle-warrior)
(players-unit-type-count any-enemy galley-line > 0)
=>
(set-strategic-number sn-minimum-water-body-size-for-dock water-islands)
(set-goal strategy-goal rush)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
(or
(map-type baltic)
(map-type rivers)
)
(goal unit-goal eagle-warrior)
(or
(goal enemy-boats-goal 0)
(warboat-count > 40)
)
=>
(set-strategic-number sn-minimum-water-body-size-for-dock water-mixed)
(set-goal strategy-goal rush)
(set-goal unit-goal eagle-warrior)
)
(defrule
(goal strategy-goal flush)
(strategic-number sn-current-age >= fc-transit)
(or
(players-building-type-count focus-player watch-tower > 3)
(and
(and
(players-unit-type-count focus-player skirmisher-line > 7)
(players-unit-type-count focus-player militiaman-line < 5)
)
(or
(players-unit-type-count focus-player skirmisher-line > 15)
(game-time < 1500)
)
)
)
=>
(set-goal strategy-goal rush)
(set-goal unit-goal eagle-warrior)
(disable-self)
)
(defrule
(goal strategy-goal flush)
(goal unit-goal archer)
(strategic-number sn-current-age == fc-transit)
=>
(set-goal strategy-goal rush)
(set-goal unit-goal archer)
(set-goal control-goal aggressive-rush)
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(taunt-detected any-ally 32)
=>
(acknowledge-taunt this-any-ally 32)
(set-goal strategy-goal rush)
(set-goal control-goal aggressive-rush)
(set-goal ranged-unit-type-goal archer)
(set-goal unit-goal archer)
(chat-to-allies-using-id 22155)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(taunt-detected any-ally 33)
=>
(acknowledge-taunt this-any-ally 33)
(set-goal strategy-goal boom)
(set-goal control-goal 0)
(set-goal unit-goal eagle-warrior)
(chat-to-allies-using-id 22156)
)
#end-if ; AZTEC CIV STRATEGY
#load-if-defined BRITON-CIV
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(or
(or
(random-number <= 20)
(regicide-game)
)
(goal nr-map-goal 1)
)
(game-time > 13)
(game-time < 60)
=>
(set-goal unit-goal my-unique-unit-line)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal 0)
(set-goal strategy-goal boom)
(set-goal uu-up-goal 1)
(disable-self)
)
#load-if-defined UP-POCKET-POSITION
(defrule
(random-number > 80)
(game-time > 15)
(game-time < 60)
=>
(set-goal unit-goal knight)
(set-goal strategy-goal rush)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal 0)
(disable-self)
)
(defrule
(goal unit-goal knight)
(up-compare-goal control-goal != my-unique-unit-line)
(unit-type-count villager > fourty-percent-pop)
(dropsite-min-distance stone < 5)
=>
(set-goal control-goal my-unique-unit-line)
(set-goal uu-up-goal 1)
(set-goal ranged-unit-type-goal 0)
(chat-to-player my-player-number "Switching to unique units.")
)
(defrule
(building-type-count castle > 1)
=>
(set-goal unit-goal my-unique-unit-line)
(set-goal control-goal 0)
(set-goal uu-up-goal 1)
(set-goal ranged-unit-type-goal 0)
)
#end-if
(defrule
(random-number >= 60)
(game-time < 60)
(goal nr-map-goal -1)
=>
(set-goal unit-goal archer)
(set-goal strategy-goal rush)
(disable-self)
)
(defrule
(up-compare-goal control-goal != shot)
(or
(and
(goal strategy-goal flush)
(building-type-count-total town-center >= tc-level-three)
)
(and
(building-type-count castle > 0)
(goal unit-goal archer)
)
)
=>
(set-goal unit-goal mix)
(set-goal control-goal my-unique-unit-line)
(disable-self)
)
(defrule
(research-available ri-man-at-arms)
(or
(or
(players-unit-type-count focus-player eagle-warrior-line > 14)
(players-unit-type-count focus-player huskarl-line > 20)
)
(goal enemy-goal eagle-warrior)
)
=>
(set-goal control-goal militiaman-line)
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(up-compare-goal strategy-goal != flush)
(taunt-detected any-ally 32)
=>
(acknowledge-taunt this-any-ally 32)
(set-goal strategy-goal rush)
(set-goal control-goal aggressive-rush)
(set-goal ranged-unit-type-goal archer)
(set-goal unit-goal archer)
(chat-to-allies-using-id 22155)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(taunt-detected any-ally 33)
=>
(acknowledge-taunt this-any-ally 33)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal 0)
(set-goal strategy-goal boom)
(set-goal uu-up-goal 1)
(set-goal unit-goal my-unique-unit-line)
(chat-to-allies-using-id 22156)
)
#end-if ; BRITON STRATEGY
#load-if-defined BYZANTINE-CIV
(defrule
(goal unit-goal skirmisher)
(goal meso-enemy-goal 1)
(or
(goal enemy-goal eagle-warrior)
(and
(and
(game-time < 1200)
(players-building-type-count focus-player barracks > 0)
)
(or
(players-building-type-count focus-player barracks > 1)
(players-building-type-count focus-player market > 0)
)
)
)
(building-type-count castle == 0)
=>
(set-goal unit-goal mix)
(disable-self)
)
(defrule
(building-type-count castle > 1)
(up-compare-goal unit-goal != my-unique-unit-line)
=>
(set-goal unit-goal my-unique-unit-line)
(set-goal uu-up-goal 1)
(chat-to-player my-player-number "Switching to unique units.")
(disable-self)
)
(defrule
(random-number > 80)
(strategic-number sn-current-age == df-transit)
(building-type-count-total archery-range == 0)
(goal strategy-goal rush)
(up-compare-goal enemy-goal != flush)
(or
(or
(players-civ focus-player hun)
(players-civ focus-player mongol)
)
(or
(players-civ focus-player persian)
(players-civ focus-player frankish)
)
)
=>
(set-goal unit-goal knight)
)
(defrule
(or (building-type-count castle > 0)
(goal nr-map-goal 1))
(random-number >= 60)
(game-time > 13)
(game-time < 60)
=>
(set-goal strategy-goal boom)
(set-goal unit-goal my-unique-unit-line)
(set-goal control-goal 0)
(set-goal uu-up-goal 1)
(disable-self)
)
#load-if-defined UP-POCKET-POSITION
(defrule
(dropsite-min-distance stone < 5)
(building-type-count-total town-center >= tc-level-four)
(up-compare-goal unit-goal != my-unique-unit-line)
(up-compare-goal control-goal != my-unique-unit-line)
=>
(set-goal control-goal my-unique-unit-line)
(chat-to-player my-player-number "Preparing in order to train unique units later on.")
(disable-self)
)
(defrule
(random-number >= 60)
(game-time > 12)
(game-time < 60)
=>
(set-goal strategy-goal boom)
(set-goal unit-goal archer)
(set-goal control-goal 0)
(set-goal uu-up-goal 1)
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(taunt-detected any-ally 32)
=>
(acknowledge-taunt this-any-ally 32)
(set-goal strategy-goal rush)
(set-goal control-goal my-unique-unit-line)
(set-goal ranged-unit-type-goal archer)
(set-goal unit-goal archer)
(chat-to-allies-using-id 22155)
)
#else
(defrule
(dropsite-min-distance stone < 5)
(building-type-count-total town-center >= tc-level-three)
(up-compare-goal unit-goal != my-unique-unit-line)
(up-compare-goal control-goal != my-unique-unit-line)
=>
(set-goal control-goal my-unique-unit-line)
(chat-to-player my-player-number "Preparing in order to train unique units later on.")
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(up-compare-goal position-goal == flank); hm
(up-compare-goal strategy-goal != flush)
(taunt-detected any-ally 32)
=>
(acknowledge-taunt this-any-ally 32)
(set-goal strategy-goal flush)
(set-goal control-goal 0)
(set-goal unit-goal skirmisher)
(chat-to-allies-using-id 22155)
)
#load-if-defined ARABIA-MAP
#load-if-defined DIFFICULTY-HARDEST
#load-if-defined LOW-RESOURCES-START
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(strategic-number sn-current-age == dark)
(goal strategy-goal rush)
(unit-type-count-total villager < 27)
(food-amount > 420)
(up-compare-goal control-goal != shot)
(up-compare-goal position-goal == flank)
=>
(set-goal strategy-goal flush)
(set-goal unit-goal skirmisher)
(set-goal control-goal 0)
(disable-self)
)
#end-if
#end-if
#end-if
#end-if
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(taunt-detected any-ally 33)
=>
(acknowledge-taunt this-any-ally 33)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal 0)
(set-goal strategy-goal boom)
(set-goal uu-up-goal 1)
(set-goal unit-goal my-unique-unit-line)
(chat-to-allies-using-id 22156)
)
#end-if
#load-if-defined CELTIC-CIV
(defrule
(goal unit-goal militiaman-line)
(or
(strategic-number sn-current-age == fc-transit)
(research-available ri-long-swordsman)
)
(players-unit-type-count focus-player eagle-warrior-line < 5)
=>
(set-goal unit-goal skirmisher)
(set-goal control-goal 0)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(random-number < 25)
=>
(set-goal strategy-goal rush)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal archer)
(set-goal unit-goal archer)
(disable-self)
)
(defrule
(or
(and
(goal unit-goal knight)
(game-time > 1800)
)
(and
(goal unit-goal scorpion)
(building-type-count town-center >= tc-level-four)
)
)
(dropsite-min-distance stone < 6)
=>
(set-goal control-goal my-unique-unit-line)
(disable-self)
)
(defrule
(or
(goal unit-goal knight)
(or
(goal unit-goal scorpion)
(goal unit-goal archer)
)
)
(building-type-count castle > 0)
(or
(building-type-count castle > 1)
(strategic-number sn-current-age >= ci-transit)
)
=>
(set-goal unit-goal my-unique-unit-line)
(set-goal uu-up-goal 1)
(set-goal control-goal 0)
)
(defrule
(goal nr-map-goal -1)
(current-age == dark-age)
(random-number > 80)
(game-time > 25)
(game-time < 60)
=>
(set-goal unit-goal knight)
(set-goal strategy-goal rush)
(set-goal uu-up-goal 1)
(disable-self)
)
#load-if-defined UP-4-PLAYER-TEAM
(defrule
(goal nr-map-goal -1)
(building-type-count stone-wall < 10)
(goal unit-goal knight)
(goal strategy-goal boom)
=>
(set-goal unit-goal archer)
(set-goal ranged-unit-type-goal archer)
(disable-self)
)
(defrule
(goal unit-goal archer)
(building-type-count-total town-center >= tc-level-four)
(strategic-number sn-current-age >= ci-transit)
=>
(set-goal strategy-goal boom)
(set-goal unit-goal scorpion)
(set-goal ranged-unit-type-goal scorpion)
(set-goal uu-up-goal 1)
(disable-self)
)
#end-if
(defrule
(current-age == dark-age)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(random-number > 80)
(goal nr-map-goal 1)
(game-time > 13)
(game-time < 60)
=>
(set-goal unit-goal my-unique-unit-line)
(set-goal strategy-goal boom)
(set-goal uu-up-goal 1)
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(or
(goal nr-map-goal 1)
(and
(goal position-goal pocket)
(random-number > 50)
)
)
(random-number <= 80)
(game-time > 25)
(game-time < 60)
=>
(set-goal unit-goal scorpion)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal 0)
(set-goal strategy-goal boom)
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(up-compare-goal strategy-goal != flush)
(taunt-detected any-ally 32)
=>
(acknowledge-taunt this-any-ally 32)
(set-goal strategy-goal rush)
(set-goal control-goal aggressive-rush)
(set-goal ranged-unit-type-goal archer)
(set-goal unit-goal archer)
(chat-to-allies-using-id 22155)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(up-compare-goal strategy-goal != boom)
(taunt-detected any-ally 33)
=>
(acknowledge-taunt this-any-ally 33)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal scorpion)
(set-goal strategy-goal boom)
(set-goal uu-up-goal 1)
(set-goal unit-goal my-unique-unit-line)
(chat-to-allies-using-id 22156)
)
#end-if
#load-if-defined CHINESE-CIV
(defrule
(nor
(goal unit-goal knight)
(goal unit-goal my-unique-unit-line)
)
(or
(and
(goal strategy-goal flush)
(strategic-number sn-current-age == fc-transit)
)
(and
(goal unit-goal archer)
(goal forward-threat-goal 1)
)
)
=>
(set-goal unit-goal knight)
(chat-to-player my-player-number "Switching to knights.")
)
(defrule
(goal unit-goal knight)
(goal strategy-goal rush)
(strategic-number sn-current-age == fc-transit)
(goal ranged-unit-type-goal archer)
(up-research-status c: ri-bloodlines >= research-pending)
=>
(set-goal ranged-unit-type-goal cavalry-archer)
(disable-self)
)
(defrule
(goal unit-goal knight)
(up-compare-goal control-goal != shot)
(up-compare-goal control-goal != my-unique-unit-line)
(or
(and
(building-type-count-total archery-range > 0)
(building-type-count-total town-center >= tc-level-three)
)
(unit-type-count villager > fourty-percent-pop)
)
(dropsite-min-distance stone < 5)
=>
(set-goal control-goal my-unique-unit-line)
(set-goal uu-up-goal 1)
(chat-to-player my-player-number "Switching to unique units.")
)
#load-if-defined UP-1-PLAYER-TEAM
#load-if-not-defined UP-TURKISH-CIV-ENEMY
#load-if-not-defined UP-SARACEN-CIV-ENEMY
(defrule
(goal unit-goal knight)
(goal control-goal my-unique-unit-line)
(goal anti-cavalry-threat-goal 1)
(civilian-population > 80)
(building-type-count castle > 0)
=>
(set-goal unit-goal militiaman-line)
(disable-self)
)
#end-if
#end-if
#end-if
#load-if-defined ARABIA-MAP
(defrule
(strategic-number sn-current-age == dark)
(goal strategy-goal rush)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(or
(building-type-count castle > 0)
(random-number < 50)
)
=>
(set-goal unit-goal my-unique-unit-line)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal 0)
(set-goal strategy-goal boom)
(set-goal uu-up-goal 1)
(disable-self)
)
#else
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(or
(or
(goal nr-map-goal 1)
(building-type-count castle > 0)
)
(random-number < 30)
)
(game-time > 13)
(game-time < 60)
=>
(set-goal unit-goal my-unique-unit-line)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal 0)
(set-goal strategy-goal boom)
(set-goal uu-up-goal 1)
(disable-self)
)
(defrule
(goal nr-map-goal 1)
(random-number > 60)
(game-time > 13)
(game-time < 60)
=>
(set-goal unit-goal knight)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal 0)
(set-goal strategy-goal boom)
(set-goal uu-up-goal 1)
(disable-self)
)
#end-if
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(goal nr-map-goal -1)
(building-type-count-total castle == 0)
(random-number > 80)
(game-time < 60)
=>
(set-goal unit-goal archer)
(set-goal strategy-goal rush)
(set-goal control-goal aggressive-rush)
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(up-compare-goal strategy-goal != flush)
(taunt-detected any-ally 32)
=>
(acknowledge-taunt this-any-ally 32)
(set-goal strategy-goal rush)
(set-goal control-goal aggressive-rush)
(set-goal ranged-unit-type-goal archer)
(set-goal unit-goal archer)
(chat-to-allies-using-id 22155)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(taunt-detected any-ally 33)
=>
(acknowledge-taunt this-any-ally 33)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal 0)
(set-goal strategy-goal boom)
(set-goal uu-up-goal 1)
(set-goal unit-goal my-unique-unit-line)
(chat-to-allies-using-id 22156)
)
#end-if
#load-if-defined FRANKISH-CIV
(defrule
(goal unit-goal knight)
(players-unit-type-count focus-player camel-line > 10)
(dropsite-min-distance stone < 5)
(game-time >= 1800)
(research-available ri-man-at-arms)
=>
(set-goal control-goal my-unique-unit-line)
(set-goal uu-up-goal 1)
)
(defrule
(goal control-goal my-unique-unit-line)
(players-unit-type-count focus-player camel-line > 10)
(building-type-count-total castle > 0)
(research-available ri-man-at-arms)
(or
(building-type-count-total castle > 1)
(strategic-number sn-archer-threat < 2)
)
=>
(set-goal unit-goal my-unique-unit-line)
(set-goal uu-up-goal 1)
)
(defrule
(goal unit-goal knight)
(up-compare-goal control-goal != shot)
(goal anti-cavalry-threat-goal 1)
(or
(strategic-number sn-current-age >= ci-transit)
(and
(food-amount > 400)
(gold-amount < 100)
)
)
(research-available ri-man-at-arms)
(up-research-status c: ri-hand-cart >= research-pending)
(building-type-count-total castle > 0)
=>
(set-goal control-goal my-unique-unit-line)
(set-goal uu-up-goal 1)
)
#load-if-defined UP-1-PLAYER-TEAM
#load-if-not-defined UP-TURKISH-CIV-ENEMY
#load-if-not-defined UP-SARACEN-CIV-ENEMY
(defrule
(goal unit-goal knight)
(strategic-number sn-military-level < 0)
(goal anti-cavalry-threat-goal 1)
(building-type-count-total castle == 0)
(up-research-status c: ri-hand-cart >= research-pending)
=>
(set-goal control-goal militiaman-line)
)
(defrule
(goal unit-goal knight)
(up-compare-goal strategy-goal != boom)
(up-compare-goal control-goal != shot)
(up-compare-goal ranged-unit-type-goal != scorpion)
(goal anti-cavalry-threat-goal 1)
(building-type-count-total castle == 0)
(or
(strategic-number sn-current-age >= ci-transit)
(and
(food-amount > 400)
(gold-amount < 100)
)
)
(up-research-status c: ri-hand-cart >= research-pending)
=>
(set-goal control-goal militiaman-line)
)
#end-if
#end-if
#end-if
(defrule
(goal unit-goal knight)
(goal control-goal militiaman-line)
(players-unit-type-count focus-player spearman-line > 30)
(strategic-number sn-archer-threat < 2)
(up-research-status c: ri-long-swordsman >= research-pending)
(building-type-count-total barracks >= 3)
(up-compare-goal ranged-unit-type-goal != scorpion)
=>
(set-goal unit-goal militiaman-line)
(chat-to-player my-player-number "switching to militiaman-line.")
)
(defrule
(goal unit-goal militiaman-line)
(players-unit-type-count every-enemy spearman-line < 20)
(gold-amount > 500)
(strategic-number sn-current-age >= ci-transit)
=>
(set-goal unit-goal knight)
(chat-to-player my-player-number "Switching to knight-line.")
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(building-type-count-total stone-wall > 15)
(game-time > 13)
(game-time < 60)
(random-number > 40)
(or
(players-civ focus-player aztec)
(players-civ focus-player saracen)
)
=>
(set-goal control-goal aggressive-rush)
(set-goal strategy-goal rush)
(set-goal unit-goal scout-cavalry)
(disable-self)
)
(defrule
(current-age == castle-age)
(goal unit-goal scout-cavalry)
=>
(set-goal unit-goal knight)
(disable-self)
)
#load-if-defined UP-POCKET-POSITION
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(game-time > 13)
(game-time < 60)
(or
(and
(random-number > 50)
(or
(random-number > 70)
(goal nr-map-goal 1)
)
)
(building-type-count-total stone-wall >= 15)
)
=>
(set-goal control-goal 0)
(set-goal strategy-goal boom)
(set-goal unit-goal knight)
(set-goal ranged-unit-type-goal scorpion)
(disable-self)
)
#end-if
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(up-compare-goal strategy-goal != rush)
(taunt-detected any-ally 32)
=>
(acknowledge-taunt this-any-ally 32)
(set-goal strategy-goal rush)
(set-goal control-goal aggressive-rush)
(set-goal unit-goal knight)
(chat-to-allies-using-id 22155)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(taunt-detected any-ally 33)
=>
(acknowledge-taunt this-any-ally 33)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal scorpion)
(set-goal strategy-goal boom)
(set-goal unit-goal knight)
(chat-to-allies-using-id 22156)
)
#end-if ;french
#load-if-defined GOTHIC-CIV
(defrule
(strategic-number sn-resource-control <= 2)
(strategic-number sn-archer-threat >= 1)
(up-research-status c: ri-champion < research-pending)
(can-research my-unique-research)
=>
(research my-unique-research)
(set-goal unit-goal my-unique-unit-line)
(set-goal uu-up-goal 1)
(chat-to-player my-player-number "Switching to husks.")
)
(defrule
(strategic-number sn-resource-control <= 2)
(dropsite-min-distance stone < 6)
(building-type-count-total town-center >= tc-level-three)
(or
(or
(players-civ focus-player briton)
(players-civ focus-player hun)
)
(or
(or
(players-civ focus-player mongol)
(players-civ focus-player mayan)
)
(and
(current-age == imperial-age)
(goal unit-goal skirmisher)
)
)
)
=>
(set-goal control-goal my-unique-unit-line)
(set-goal uu-up-goal 1)
)
(defrule
(up-compare-goal control-goal != militiaman-line)
(or
(or
(players-unit-type-count focus-player eagle-warrior-line > 10)
(strategic-number sn-current-age >= ci-transit)
)
(and
(and
(food-amount > 500)
(gold-amount < 100)
)
(goal unit-goal knight)
)
)
=>
(set-goal control-goal militiaman-line)
)
(defrule
(goal unit-goal knight)
(up-research-status c: ri-long-swordsman >= research-pending)
=>
(set-goal unit-goal militiaman-line)
(set-goal control-goal 0)
)
(defrule
(or
(random-number >= 80)
(or
(goal nr-map-goal 1)
(building-type-count castle > 0)
)
)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(game-time > 13)
(game-time < 60)
=>
(set-goal strategy-goal rush)
(set-goal unit-goal my-unique-unit-line)
(set-goal uu-up-goal 1)
(set-goal ranged-unit-type-goal 0)
(disable-self)
)
#load-if-defined UP-POCKET-POSITION
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(taunt-detected any-ally 32)
=>
(acknowledge-taunt this-any-ally 32)
(set-goal strategy-goal rush)
(set-goal control-goal aggressive-rush)
(set-goal unit-goal knight)
(set-goal ranged-unit-type-goal 0)
(chat-to-allies-using-id 22155)
)
#else
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(up-compare-goal strategy-goal != flush)
(up-compare-goal position-goal == flank); hm
(taunt-detected any-ally 32)
=>
(acknowledge-taunt this-any-ally 32)
(set-goal strategy-goal flush)
(set-goal unit-goal militiaman-line)
(set-goal ranged-unit-type-goal archer)
(chat-to-allies-using-id 22155)
)
#end-if
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(taunt-detected any-ally 33)
=>
(acknowledge-taunt this-any-ally 33)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal scorpion)
(set-goal strategy-goal boom)
(set-goal uu-up-goal 1)
(set-goal unit-goal my-unique-unit-line)
(chat-to-allies-using-id 22156)
)
#end-if
#load-if-defined HUN-CIV
(defrule
(current-age >= castle-age)
(building-type-count archery-range >= 2)
(nor
(or
(goal unit-goal cavalry-archer)
(goal control-goal shot)
)
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
)
=>
(set-goal unit-goal cavalry-archer)
(set-goal control-goal 0)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(building-type-count-total stone-wall < 15)
(random-number > 60)
(or
(goal nr-map-goal 1)
(goal position-goal pocket)
)
(game-time > 13)
(game-time < 60)
=>
(set-goal strategy-goal boom)
(set-goal unit-goal cavalry-archer)
(set-goal control-goal 0)
(disable-self)
)
#load-if-not-defined UP-GAME-AGE2-X2
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(goal ffa-game-goal -1)
(goal nr-map-goal -1)
(building-type-count-total stone-wall < 15)
(random-number > 60)
(or
(player-in-game any-ally)
(random-number > 80)
)
(game-time > 13)
(game-time < 60)
=>
(set-goal control-goal aggressive-rush)
(set-goal strategy-goal rush)
(set-goal unit-goal cavalry-archer)
(disable-self)
)
#else
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(goal ffa-game-goal -1)
(goal nr-map-goal -1)
(building-type-count-total stone-wall < 15)
(random-number > 60)
(up-compare-goal position-goal == flank)
(or
(player-in-game any-ally)
(random-number > 80)
)
(game-time > 13)
(game-time < 60)
=>
(set-goal control-goal aggressive-rush)
(set-goal strategy-goal flush)
(set-goal unit-goal scout-cavalry)
(disable-self)
)
#end-if
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(up-compare-goal strategy-goal != flush)
(taunt-detected any-ally 32)
=>
(acknowledge-taunt this-any-ally 32)
(set-goal strategy-goal rush)
(set-goal control-goal aggressive-rush)
(set-goal unit-goal cavalry-archer)
(chat-to-allies-using-id 22155)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(taunt-detected any-ally 33)
=>
(acknowledge-taunt this-any-ally 33)
(set-goal control-goal 0)
(set-goal strategy-goal boom)
(set-goal unit-goal knight)
(chat-to-allies-using-id 22156)
)
#load-if-defined UP-POCKET-POSITION
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(game-time > 13)
(game-time < 60)
(building-type-count-total stone-wall >= 15)
=>
(set-goal control-goal 0)
(set-goal strategy-goal boom)
(set-goal unit-goal knight)
(disable-self)
)
#else
#load-if-defined ARABIA-MAP
#load-if-defined DIFFICULTY-HARDEST
#load-if-defined LOW-RESOURCES-START
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(strategic-number sn-current-age == dark)
(up-compare-goal control-goal != shot)
(up-compare-goal position-goal == flank)
(goal strategy-goal rush)
(unit-type-count-total villager < 26)
(food-amount > 420)
=>
(set-goal strategy-goal flush)
(set-goal unit-goal skirmisher)
(set-goal control-goal aggressive-rush)
(disable-self)
)
#end-if
#end-if
#end-if
#end-if
#end-if
#load-if-defined JAPANESE-CIV
(defrule
(strategic-number sn-current-age >= castle)
(or
(goal strategy-goal boom)
(or
(goal unit-goal knight)
(goal unit-goal skirmisher)
)
)
(building-type-count-total town-center >= tc-level-four)
=>
(set-goal control-goal my-unique-unit-line)
(set-goal uu-up-goal 1)
)
(defrule
(strategic-number sn-current-age == castle)
(up-research-status c: ri-long-swordsman < research-pending)
(unit-type-count-total militiaman-line < 10)
(goal strategy-goal flush)
=>
(set-goal unit-goal skirmisher)
(set-goal control-goal my-unique-unit-line)
)
(defrule
(or
(goal unit-goal skirmisher)
(and
(goal unit-goal knight)
(building-type-count-total castle > 1)
)
)
(building-type-count castle > 0)
(up-research-status c: ri-long-swordsman < research-pending)
=>
(set-goal unit-goal my-unique-unit-line)
(set-goal uu-up-goal 1)
)
#load-if-defined UP-1-PLAYER-TEAM
(defrule
(current-age == dark-age)
(or
(or
(and
(goal ffa-game-goal 1)
(random-number > 50)
)
(building-type-count castle > 0)
)
(and
(random-number >= 80)
(goal nr-map-goal 1)
)
)
(game-time > 12)
(game-time < 60)
=>
(set-goal unit-goal my-unique-unit-line)
(set-goal strategy-goal boom)
(set-goal uu-up-goal 1)
(disable-self)
)
(defrule
(current-age == dark-age)
(goal meso-enemy-goal 1)
(random-number >= 90)
(game-time > 12)
(game-time < 60)
=>
(set-goal unit-goal my-unique-unit-line)
(set-goal strategy-goal rush)
(set-goal control-goal 0)
(set-goal uu-up-goal 1)
(disable-self)
)
(defrule
(goal meso-enemy-goal -1)
(random-number < 8)
(game-time > 15)
(game-time < 60)
=>
(set-goal strategy-goal rush)
(set-goal unit-goal monk)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal monk)
(disable-self)
)
#end-if
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(goal strategy-goal flush)
(goal nr-map-goal 1)
=>
(set-goal unit-goal archer)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal archer)
(set-goal strategy-goal boom)
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(goal strategy-goal flush)
(unit-type-count villager > 27)
(strategic-number sn-current-age == dark)
=>
(set-goal unit-goal archer)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal archer)
(set-goal strategy-goal rush)
(disable-self)
)
#load-if-defined UP-POCKET-POSITION
#load-if-defined UP-GAME-AGE2-X2
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(taunt-detected any-ally 32)
=>
(acknowledge-taunt this-any-ally 32)
(set-goal strategy-goal rush)
(set-goal control-goal aggressive-rush)
(set-goal unit-goal knight)
(set-goal ranged-unit-type-goal archer)
(chat-to-allies-using-id 22155)
)
#else
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(taunt-detected any-ally 32)
=>
(acknowledge-taunt this-any-ally 32)
(set-goal strategy-goal rush)
(set-goal control-goal aggressive-rush)
(set-goal unit-goal archer)
(set-goal ranged-unit-type-goal archer)
(chat-to-allies-using-id 22156)
)
#end-if
#else
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(up-compare-goal position-goal == flank); hm
(up-compare-goal strategy-goal != flush)
(taunt-detected any-ally 32)
=>
(acknowledge-taunt this-any-ally 32)
(set-goal strategy-goal flush)
(set-goal unit-goal archer)
(set-goal ranged-unit-type-goal archer)
(chat-to-allies-using-id 22155)
)
#end-if
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(up-compare-goal strategy-goal != boom)
(taunt-detected any-ally 33)
=>
(acknowledge-taunt this-any-ally 33)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal archer)
(set-goal strategy-goal boom)
(set-goal uu-up-goal 1)
(set-goal unit-goal archer)
(chat-to-allies-using-id 22156)
)
#end-if
#load-if-defined KOREAN-CIV
(defrule
(goal strategy-goal flush)
=>
(set-goal unit-goal skirmisher)
(set-goal ranged-unit-type-goal archer)
(disable-self)
)
(defrule
(dropsite-min-distance stone < 5)
(building-type-count-total town-center >= tc-level-three)
(not (goal unit-goal my-unique-unit-line))
=>
(set-goal control-goal my-unique-unit-line)
(chat-to-player my-player-number "Preparing in order to train unique units later on.")
(disable-self)
)
(defrule
(building-type-count castle > 1)
(goal unit-goal militiaman-line)
(goal control-goal my-unique-unit-line)
=>
(set-goal unit-goal my-unique-unit-line)
(set-goal control-goal militiaman-line)
(set-goal uu-up-goal 1)
(disable-self)
)
(defrule
(building-type-count castle > 1)
(nor
(goal unit-goal militiaman-line)
(goal unit-goal my-unique-unit-line)
)
=>
(set-goal unit-goal my-unique-unit-line)
(set-goal uu-up-goal 1)
(disable-self)
)
(defrule
(current-age == dark-age)
(random-number > 25)
(random-number < 60)
(up-compare-goal position-goal == flank); hm
(goal nr-map-goal -1)
=>
(set-goal unit-goal skirmisher)
(set-goal strategy-goal flush)
(set-goal uu-up-goal 1)
(disable-self)
)
(defrule
(or
(and
(or
(random-number >= 60)
(players-civ every-enemy aztec)
)
(random-number > 40)
)
(building-type-count castle > 0)
)
(game-time < 60)
=>
(set-goal strategy-goal boom)
(set-goal unit-goal my-unique-unit-line)
(set-goal ranged-unit-type-goal 0)
(set-goal uu-up-goal 1)
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(goal nr-map-goal 1)
(game-time > 13)
(game-time < 60)
=>
(set-goal unit-goal my-unique-unit-line)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal 0)
(set-goal strategy-goal boom)
(set-goal uu-up-goal 1)
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(up-compare-goal strategy-goal != flush)
(taunt-detected any-ally 32)
=>
(acknowledge-taunt this-any-ally 32)
(set-goal strategy-goal rush)
(set-goal control-goal aggressive-rush)
(set-goal ranged-unit-type-goal archer)
(set-goal unit-goal archer)
(chat-to-allies-using-id 22155)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(taunt-detected any-ally 33)
=>
(acknowledge-taunt this-any-ally 33)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal 0)
(set-goal strategy-goal boom)
(set-goal uu-up-goal 1)
(set-goal unit-goal my-unique-unit-line)
(chat-to-allies-using-id 22156)
)
#end-if
#load-if-defined MAYAN-CIV
(defrule
(or
(and
(or
(up-research-status c: ri-heresy >= research-pending)
(strategic-number sn-current-age >= ci-transit)
)
(or
(goal strategy-goal boom)
(goal strategy-goal fast-imp)
)
)
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
)
=>
(set-goal strategy-goal rush)
(set-goal unit-goal eagle-warrior)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(goal unit-goal eagle-warrior)
(or
(players-civ focus-player gothic)
(players-civ focus-player japanese)
)
(up-compare-goal control-goal != shot)
(up-compare-goal position-goal == flank); hm
(goal nr-map-goal -1)
=>
(set-goal strategy-goal flush)
(set-goal unit-goal default-flush-unit)
(disable-self)
)
(defrule
(current-age == dark-age)
(random-number < 50)
(up-compare-goal position-goal == flank); hm
(goal nr-map-goal -1)
=>
(set-goal strategy-goal flush)
(set-goal unit-goal default-flush-unit)
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(goal nr-map-goal 1)
(game-time > 13)
(game-time < 60)
=>
(set-goal strategy-goal boom)
(set-goal uu-up-goal 1)
(set-goal unit-goal my-unique-unit-line)
(set-goal control-goal 0)
(disable-self)
)
(defrule
(random-number >= 50)
(game-time < 60)
(goal ffa-game-goal -1)
(building-type-count-total castle == 0)
=>
(set-goal strategy-goal rush)
(set-goal unit-goal archer)
(set-goal control-goal aggressive-rush)
(set-goal ranged-unit-type-goal archer)
(disable-self)
)
(defrule
(dropsite-min-distance stone < 5)
(building-type-count-total town-center >= tc-level-three)
(nor
(goal unit-goal my-unique-unit-line)
(or
(goal control-goal shot)
(goal control-goal aggressive-rush)
)
)
(or
(not (goal unit-goal eagle-warrior))
(strategic-number sn-current-age >= ci-transit)
)
=>
(set-goal control-goal my-unique-unit-line)
(set-goal uu-up-goal 1)
(chat-to-player my-player-number "Preparing in order to train unique units later on.")
(disable-self)
)
(defrule
(or (building-type-count castle > 1)
(regicide-game))
=>
(set-goal unit-goal my-unique-unit-line)
(set-goal uu-up-goal 1)
(chat-to-player my-player-number "Switching to unique units.")
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock == water-mixed)
(or (map-type baltic)
(map-type rivers))
(current-age < castle-age)
(goal unit-goal eagle-warrior)
(players-unit-type-count any-enemy galley-line > 0)
=>
(set-strategic-number sn-minimum-water-body-size-for-dock water-islands)
(set-goal strategy-goal rush)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
(or (map-type baltic)
(map-type rivers))
(goal unit-goal eagle-warrior)
(or (goal enemy-boats-goal 0)
(warboat-count > 40))
=>
(set-strategic-number sn-minimum-water-body-size-for-dock water-mixed)
(set-goal strategy-goal rush)
(set-goal unit-goal eagle-warrior)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock >= water-mixed)
(current-age < castle-age)
(goal unit-goal my-unique-unit-line)
(building-type-count-total castle == 0)
=>
(set-goal unit-goal eagle-warrior)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(up-compare-goal strategy-goal != flush)
(up-compare-goal strategy-goal != rush)
(taunt-detected any-ally 32)
=>
(acknowledge-taunt this-any-ally 32)
(set-goal strategy-goal rush)
(set-goal control-goal aggressive-rush)
(set-goal ranged-unit-type-goal archer)
(set-goal unit-goal archer)
(chat-to-allies-using-id 22155)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(taunt-detected any-ally 33)
=>
(acknowledge-taunt this-any-ally 33)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal 0)
(set-goal strategy-goal boom)
(set-goal uu-up-goal 1)
(set-goal unit-goal my-unique-unit-line)
(chat-to-allies-using-id 22156)
)
#end-if
#load-if-defined MONGOL-CIV
(defrule
(current-age == dark-age)
(game-time > 30)
(goal strategy-goal flush)
(random-number >= 40)
=>
(set-goal unit-goal default-flush-unit)
(disable-self)
)
(defrule
(current-age == dark-age)
(game-time > 30)
(goal strategy-goal flush)
(random-number < 40)
=>
(set-goal unit-goal skirmisher)
(disable-self)
)
(defrule
(strategic-number sn-current-age >= fc-transit)
(goal strategy-goal flush)
=>
(set-goal unit-goal knight)
(chat-to-player my-player-number "Switching to knights.")
(disable-self)
)
(defrule
(strategic-number sn-current-age >= fc-transit)
(unit-type-count archer-line > 12)
=>
(set-goal ranged-unit-type-goal archer)
(disable-self)
)
(defrule
(or
(goal unit-goal knight)
(goal unit-goal skirmisher)
)
(up-compare-goal control-goal != my-unique-unit-line)
(unit-type-count villager > fourty-percent-pop)
(dropsite-min-distance stone < 5)
=>
(set-goal control-goal my-unique-unit-line)
(set-goal uu-up-goal 1)
(chat-to-player my-player-number "Switching to unique units.")
)
(defrule
(or (up-research-status c: my-unique-unit-upgrade >= research-pending)
(building-type-count castle >= 3))
(up-compare-goal control-goal != my-unique-unit-line)
(building-type-count castle >= 1)
=>
(set-goal control-goal my-unique-unit-line)
(set-goal uu-up-goal 1)
(chat-to-player my-player-number "Switching to unique units."); test
)
#load-if-not-defined UP-TURKISH-CIV-ENEMY
#load-if-not-defined UP-SARACEN-CIV-ENEMY
(defrule
(goal unit-goal knight)
(goal control-goal my-unique-unit-line)
(or
(players-unit-type-count focus-player spearman-line > 20)
(players-unit-type-count focus-player camel-line > 12)
)
(unit-type-count villager > fourty-percent-pop)
(building-type-count castle > 0)
=>
(set-goal unit-goal militiaman-line)
(disable-self)
)
(defrule
(building-type-count castle > 2)
(or
(goal unit-goal militiaman-line)
(goal control-goal militiaman-line)
)
=>
(set-goal unit-goal my-unique-unit-line)
(set-goal control-goal militiaman-line)
(disable-self)
)
#end-if
#end-if
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-current-age == dark)
(unit-type-count villager > 27)
(goal strategy-goal flush)
=>
(set-goal unit-goal my-unique-unit-line)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal 0)
(set-goal strategy-goal boom)
(set-goal uu-up-goal 1)
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(or
(goal nr-map-goal 1)
(random-number >= 90)
)
(game-time > 13)
(game-time < 60)
=>
(set-goal unit-goal my-unique-unit-line)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal 0)
(set-goal strategy-goal boom)
(set-goal uu-up-goal 1)
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(goal nr-map-goal 1)
(random-number >= 70)
(game-time > 13)
(game-time < 60)
=>
(set-goal unit-goal knight)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal 0)
(set-goal strategy-goal boom)
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(up-compare-goal strategy-goal != flush)
(up-compare-goal strategy-goal != rush)
(taunt-detected any-ally 32)
=>
(acknowledge-taunt this-any-ally 32)
(set-goal strategy-goal rush)
(set-goal control-goal aggressive-rush)
(set-goal ranged-unit-type-goal cavalry-archer)
(set-goal unit-goal cavalry-archer)
(chat-to-allies-using-id 22155)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(taunt-detected any-ally 33)
=>
(acknowledge-taunt this-any-ally 33)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal 0)
(set-goal strategy-goal boom)
(set-goal uu-up-goal 1)
(set-goal unit-goal my-unique-unit-line)
(chat-to-allies-using-id 22156)
)
#end-if; mongol
#load-if-defined PERSIAN-CIV
(defrule
(strategic-number sn-current-age >= fc-transit)
(goal strategy-goal flush)
=>
(set-goal unit-goal knight)
(chat-to-player my-player-number "Switching to knights.")
(disable-self)
)
(defrule
(random-number >= 50)
(random-number < 80)
(game-time < 60)
(up-compare-goal position-goal == flank); hm
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
=>
(set-goal unit-goal scout-cavalry)
(set-goal strategy-goal flush)
(disable-self)
)
(defrule
(current-age == dark-age)
(or
(and
(or
(goal nr-map-goal 1)
(goal position-goal pocket)
)
(random-number < 60)
)
(building-type-count stone-wall > 15)
)
(game-time > 13)
(game-time < 60)
=>
(set-goal unit-goal knight)
(set-goal strategy-goal boom)
(set-goal control-goal 0)
(disable-self)
)
(defrule
(or
(goal position-goal pocket)
(goal nr-map-goal 1)
)
(random-number < 40)
(game-time > 13)
(game-time < 60)
=>
(set-goal unit-goal scorpion)
(set-goal strategy-goal boom)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal 0)
(disable-self)
)
(defrule
(goal unit-goal scorpion)
(or
(building-type-count town-center >= tc-level-four)
(strategic-number sn-current-age >= ci-transit)
)
=>
(set-goal control-goal my-unique-unit-line)
(set-goal uu-up-goal 1)
(set-goal ranged-unit-type-goal scorpion)
)
(defrule
(or
(and
(goal unit-goal scorpion)
(goal control-goal my-unique-unit-line)
)
(goal unit-goal skirmisher)
)
(building-type-count-total castle > 1)
=>
(set-goal unit-goal my-unique-unit-line)
(set-goal uu-up-goal 1)
(set-goal ranged-unit-type-goal scorpion)
)
(defrule
(random-number > 80)
(game-time < 60)
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
=>
(set-goal strategy-goal rush)
(set-goal unit-goal knight)
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(up-compare-goal strategy-goal != flush)
(up-compare-goal strategy-goal != rush)
(taunt-detected any-ally 32)
=>
(acknowledge-taunt this-any-ally 32)
(set-goal strategy-goal rush)
(set-goal control-goal aggressive-rush)
(set-goal unit-goal knight)
(chat-to-allies-using-id 22155)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(taunt-detected any-ally 33)
=>
(acknowledge-taunt this-any-ally 33)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal scorpion)
(set-goal strategy-goal boom)
(set-goal unit-goal my-unique-unit-line)
(chat-to-allies-using-id 22156)
)
#end-if ; persian
#load-if-defined SARACEN-CIV
(defrule
(current-age == dark-age)
(random-number <= 20)
(goal position-goal pocket)
(not (players-civ any-ally aztec))
(game-time < 30)
=>
(set-goal unit-goal monk)
(set-goal ranged-unit-type-goal monk)
(disable-self)
)
(defrule
(current-age == dark-age)
(random-number <= 50)
(up-compare-goal position-goal == flank); hm
(game-time < 60)
=>
(set-goal unit-goal scout-cavalry)
(set-goal strategy-goal flush)
(set-goal control-goal aggressive-rush)
(disable-self)
)
(defrule
(current-age == dark-age)
(random-number > 50)
(up-compare-goal position-goal == flank); hm
(game-time < 60)
=>
(set-goal unit-goal archer)
(set-goal strategy-goal flush)
(set-goal control-goal aggressive-rush)
(disable-self)
)
(defrule
(goal position-goal pocket)
(or
(and
(goal strategy-goal rush)
(goal unit-goal archer)
)
(goal strategy-goal flush)
)
(game-time > 60)
(game-time < 70)
=>
(set-goal strategy-goal boom)
(set-goal ranged-unit-type-goal archer)
)
(defrule
(current-age == dark-age)
(or
(or
(random-number > 70)
(building-type-count stone-wall > 15)
)
(and
(goal nr-map-goal 1)
(random-number < 25)
)
)
(game-time < 60)
=>
(set-goal unit-goal monk)
(set-goal strategy-goal rush)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal monk)
(disable-self)
)
(defrule
(strategic-number sn-current-age == fc-transit)
(goal strategy-goal flush)
(random-number <= 50)
=>
(set-goal unit-goal knight)
)
(defrule
(goal unit-goal knight)
(goal control-goal shot)
(strategic-number sn-current-age >= ci-transit)
(building-type-count-total castle > 0)
=>
(set-goal unit-goal my-unique-unit-line)
(set-goal ranged-unit-type-goal archer)
)
(defrule
(or
(and
(goal unit-goal knight)
(strategic-number sn-current-age >= ci-transit)
)
(and
(goal strategy-goal flush)
(and
(strategic-number sn-current-age == feudal)
(players-unit-type-count focus-player spearman-line > 6)
)
)
)
=>
(set-goal unit-goal archer)
(set-goal ranged-unit-type-goal archer)
(set-goal control-goal aggressive-rush); also stop slinging here, without even cavalier upgrade it is pretty pointless
)
(defrule
(or
(and
(goal nr-map-goal 1)
(building-type-count stone-wall-line < 15)
)
(and
(and
(random-number >= 70)
(regicide-game)
)
(goal unit-goal monk)
)
)
(game-time > 15)
(game-time < 60)
=>
(set-goal unit-goal my-unique-unit-line)
(set-goal strategy-goal boom)
(set-goal uu-up-goal 1)
(set-goal ranged-unit-type-goal monk)
(set-goal control-goal 0)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(up-compare-goal strategy-goal != flush)
(up-compare-goal strategy-goal != rush)
(taunt-detected any-ally 32)
=>
(acknowledge-taunt this-any-ally 32)
(set-goal strategy-goal rush)
(set-goal control-goal aggressive-rush)
(set-goal ranged-unit-type-goal archer)
(set-goal unit-goal archer)
(chat-to-allies-using-id 22155)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(taunt-detected any-ally 33)
=>
(acknowledge-taunt this-any-ally 33)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal archer)
(set-goal strategy-goal boom)
(set-goal unit-goal my-unique-unit-line)
(chat-to-allies-using-id 22156)
)
#end-if
#load-if-defined SPANISH-CIV
(defrule
(goal control-goal 0)
(or
(goal anti-cavalry-threat-goal 1)
(players-civ focus-player gothic)
)
(building-type-count-total town-center >= tc-level-three)
(dropsite-min-distance stone < 5)
(nand
(strategic-number sn-current-age == castle)
(goal strategy-goal boom)
)
=>
(set-goal control-goal my-unique-unit-line)
(chat-to-player my-player-number "Enable training of unique units.")
)
(defrule
(goal unit-goal knight)
(goal control-goal my-unique-unit-line)
(goal anti-cavalry-threat-goal 1)
(building-type-count castle >= 2)
(nand
(up-research-status c: ri-paladin >= research-pending)
(research-available my-unique-unit-upgrade)
)
=>
(set-goal unit-goal my-unique-unit-line)
(chat-to-player my-player-number "Switching to unique units.")
(set-goal uu-up-goal 1)
(disable-self)
)
(defrule
(goal strategy-goal flush)
(strategic-number sn-current-age == feudal)
(or
(players-unit-type-count focus-player spearman-line > 6)
(or
(players-civ focus-player mayan)
(players-civ focus-player briton)
)
)
=>
(set-goal unit-goal skirmisher)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(or
(goal nr-map-goal 1)
(and
(random-number < 20)
(goal position-goal pocket)
)
)
(game-time > 13)
(game-time < 60)
(up-compare-goal unit-goal != my-unique-unit-line)
=>
(set-goal unit-goal knight)
(set-goal control-goal 0)
(set-goal strategy-goal boom)
(set-goal ranged-unit-type-goal 0)
(disable-self)
)
(defrule
(random-number >= 50)
(or
(random-number >= 75)
(goal nr-map-goal 1)
)
(game-time > 15)
(game-time < 60)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
=>
(set-goal strategy-goal boom)
(set-goal uu-up-goal 1)
(set-goal unit-goal my-unique-unit-line)
(set-goal control-goal 0)
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(goal nr-map-goal -1)
(random-number >= 25)
(random-number < 35)
(game-time > 13)
(game-time < 60)
(not (players-civ any-ally aztec))
=>
(set-goal unit-goal monk)
(set-goal control-goal 0)
(set-goal strategy-goal rush)
(set-goal ranged-unit-type-goal monk)
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(up-compare-goal strategy-goal != flush)
(up-compare-goal strategy-goal != rush)
(taunt-detected any-ally 32)
=>
(acknowledge-taunt this-any-ally 32)
(set-goal strategy-goal rush)
(set-goal control-goal aggressive-rush)
(set-goal unit-goal knight)
(chat-to-allies-using-id 22155)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(up-compare-goal strategy-goal != boom)
(taunt-detected any-ally 33)
=>
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal 0)
(set-goal strategy-goal boom)
(set-goal unit-goal knight)
(chat-to-allies-using-id 22156)
(acknowledge-taunt this-any-ally 33)
)
#end-if; spanish
#load-if-defined TEUTONIC-CIV
(defrule
(goal unit-goal knight)
(goal control-goal 0)
(building-type-count castle > 0)
(strategic-number sn-archer-threat < 3)
(goal anti-cavalry-threat-goal 1)
(up-research-status c: ri-heavy-scorpion < research-pending)
=>
(set-goal control-goal my-unique-unit-line)
(set-goal uu-up-goal 1)
(set-goal ranged-unit-type-goal 0)
(disable-self)
)
(defrule
(strategic-number sn-current-age >= ci-transit)
(goal unit-goal knight)
(goal control-goal 0)
(building-type-count castle > 0)
(or
(players-unit-type-count target-player spearman-line > 35)
(players-unit-type-count target-player camel-line > 24)
)
=>
(set-goal control-goal my-unique-unit-line)
(set-goal uu-up-goal 1)
(disable-self)
)
(defrule
(goal unit-goal knight)
(goal control-goal my-unique-unit-line)
(or
(goal anti-cavalry-threat-goal 1)
(strategic-number sn-infantry-threat >= 1)
)
(nor
(players-civ every-enemy hun); dont switch to TK vs ca civs
(strategic-number sn-archer-threat > 1)
)
(building-type-count castle > 1)
=>
(set-goal unit-goal my-unique-unit-line)
(set-goal uu-up-goal 1)
(disable-self)
)
(defrule
(strategic-number sn-current-age == fc-transit)
(goal strategy-goal flush)
=>
(set-goal unit-goal knight)
(disable-self)
)
(defrule
(or
(building-type-count stone-wall > 15)
(random-number < 6)
)
(game-time > 13)
(game-time < 60)
(random-number <= 20)
(not (players-civ any-ally aztec))
=>
(set-goal strategy-goal rush)
(set-goal unit-goal monk)
(set-goal ranged-unit-type-goal monk)
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(random-number >= 70)
(goal position-goal pocket)
(game-time > 13)
(population-cap >= 200)
=>
(set-goal strategy-goal boom)
(set-goal uu-up-goal 0)
(set-goal unit-goal knight)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal 0)
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(or
(and
(random-number >= 80)
(nor
(players-civ focus-player briton)
(players-civ focus-player mayan)
)
)
(and
(building-type-count castle > 1)
(goal unit-goal monk)
)
)
=>
(set-goal strategy-goal boom)
(set-goal uu-up-goal 1)
(set-goal unit-goal my-unique-unit-line)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal monk)
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(goal nr-map-goal 1)
(not (goal ranged-unit-type-goal monk))
(game-time > 25)
=>
(set-goal unit-goal knight)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal 0)
(set-goal strategy-goal boom)
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(up-compare-goal strategy-goal != flush)
(up-compare-goal strategy-goal != rush)
(taunt-detected any-ally 32)
=>
(acknowledge-taunt this-any-ally 32)
(set-goal strategy-goal rush)
(set-goal control-goal aggressive-rush)
(set-goal unit-goal knight)
(chat-to-allies-using-id 22155)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(taunt-detected any-ally 33)
=>
(acknowledge-taunt this-any-ally 33)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal 0)
(set-goal strategy-goal boom)
(set-goal unit-goal knight)
(chat-to-allies-using-id 22156)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(up-research-status c: ri-paladin >= research-pending)
(goal anti-cavalry-threat-goal 1)
(or
(strategic-number sn-archer-threat >= 3)
(strategic-number sn-cavalry-threat < 3)
)
(up-compare-goal ranged-unit-type-goal != scorpion)
(up-compare-goal ranged-unit-type-goal != monk)
(unit-type-count trade-cart > 4)
=>
(set-goal ranged-unit-type-goal scorpion)
)
#end-if;teutonic
#load-if-defined TURKISH-CIV
(defrule
(goal nr-map-goal -1)
(up-compare-goal position-goal == flank); hm
(random-number < 40)
=>
(set-goal strategy-goal flush)
(set-goal unit-goal scout-cavalry)
(disable-self)
)
(defrule
(or
(and
(or
(goal ffa-game-goal 1)
(and
(random-number >= 50)
(goal nr-map-goal 1)
)
)
(goal strategy-goal flush)
)
(regicide-game)
)
(game-time > 13)
(game-time < 60)
=>
(set-goal strategy-goal boom)
(set-goal unit-goal knight)
(set-goal ranged-unit-type-goal 0)
(set-goal control-goal 0)
(disable-self)
)
(defrule
(goal strategy-goal flush)
(strategic-number sn-current-age == feudal)
(players-unit-type-count focus-player spearman-line > 6)
=>
(set-goal unit-goal archer)
(set-goal ranged-unit-type-goal archer)
)
(defrule
(strategic-number sn-current-age == fc-transit)
(goal strategy-goal flush)
(goal unit-goal default-ranged)
=>
(set-goal unit-goal knight)
(set-goal ranged-unit-type-goal archer)
)
(defrule
(goal unit-goal knight)
(goal control-goal militiaman-line)
(players-unit-type-count focus-player spearman-line > 30)
(strategic-number sn-archer-threat < 2)
(up-research-status c: ri-champion >= research-pending)
(building-type-count-total barracks >= 3)
=>
(set-goal unit-goal militiaman-line)
(chat-to-player my-player-number "Switching to militiaman-line.")
)
(defrule
(current-age == dark-age)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(building-type-count stone-wall > 15)
(game-time > 13)
(random-number < 50)
=>
(set-goal strategy-goal fast-imp)
(set-goal unit-goal gunpowder-class)
(set-goal ranged-unit-type-goal gunpowder-class)
(set-goal control-goal 0)
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(up-compare-goal strategy-goal != flush)
(up-compare-goal strategy-goal != rush)
(taunt-detected any-ally 32)
=>
(acknowledge-taunt this-any-ally 32)
(set-goal strategy-goal rush)
(set-goal control-goal aggressive-rush)
(set-goal unit-goal knight)
(chat-to-allies-using-id 22155)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(taunt-detected any-ally 33)
=>
(acknowledge-taunt this-any-ally 33)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal 0)
(set-goal strategy-goal boom)
(set-goal unit-goal knight)
(chat-to-allies-using-id 22156)
)
#end-if
#load-if-defined VIKING-CIV
(defrule
(random-number > 20)
(random-number < 40)
=>
(set-goal strategy-goal rush)
(set-goal unit-goal archer)
(disable-self)
)
#load-if-defined UP-POCKET-POSITION
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed); bug fix in maps that were previously falsely detected as water maps
(goal strategy-goal flush)
=>
(set-goal strategy-goal boom)
(set-goal unit-goal archer)
(disable-self)
)
#end-if
(defrule
(strategic-number sn-minimum-water-body-size-for-dock >= water-mixed)
(current-age < castle-age)
(up-compare-goal position-goal == flank); hm
(not (goal strategy-goal flush))
=>
(set-goal strategy-goal flush)
(set-goal unit-goal militiaman-line)
)
(defrule
(goal strategy-goal flush)
(strategic-number sn-current-age == fc-transit)
(military-population < 15)
(not (goal unit-goal knight))
=>
(set-goal unit-goal knight)
(set-goal control-goal militiaman-line)
(chat-to-player my-player-number "Switching to knights.")
)
#load-if-defined UP-GAME-AGE2-X2
(defrule
(goal control-goal 0)
(or
(goal strategy-goal boom)
(goal position-goal pocket)
)
(civilian-population > 90)
(strategic-number sn-cavalry-threat > 2)
=>
(set-goal control-goal my-unique-unit-line)
(set-goal uu-up-goal 1)
)
#end-if
(defrule
(goal control-goal 0)
(or
(and
(civilian-population > 90)
(or
(strategic-number sn-current-age >= ci-transit)
(and
(food-amount > 400)
(gold-amount < 200)
)
)
)
(or
(goal anti-cavalry-threat-goal 1)
(goal enemy-goal eagle-warrior)
)
)
(up-compare-goal strategy-goal != boom)
=>
(set-goal control-goal militiaman-line)
)
(defrule
(goal control-goal 0)
(or
(or
(goal enemy-goal eagle-warrior)
(and
(players-unit-type-count focus-player huskarl-line > 4)
(civilian-population > 60)
)
)
(and
(up-research-status c: ri-arbalest >= research-pending)
(up-research-status c: ri-ring-archer-armor >= research-pending)
)
)
(goal strategy-goal boom)
=>
(set-goal control-goal militiaman-line)
)
(defrule
(civilian-population >= 60)
(up-research-status c: ri-long-swordsman >= research-pending)
(not (goal unit-goal militiaman-line))
(strategic-number sn-current-age >= ci-transit)
=>
(set-goal strategy-goal rush)
(set-goal unit-goal militiaman-line)
(chat-to-player my-player-number "Switching to militiaman-line.")
)
(defrule
(goal strategy-goal rush)
(goal unit-goal default-unit)
(current-age < castle-age)
=>
(set-goal unit-goal knight)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(or
(goal nr-map-goal 1)
(random-number <= 20)
)
=>
(set-goal unit-goal archer)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal archer)
(set-goal strategy-goal boom)
(disable-self)
)
(defrule
(game-time > 25)
(game-time < 60)
(building-type-count castle > 0)
=>
(set-goal unit-goal my-unique-unit-line)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal archer)
(set-goal strategy-goal boom)
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(taunt-detected any-ally 32)
=>
(acknowledge-taunt this-any-ally 32)
(set-goal strategy-goal rush)
(set-goal control-goal aggressive-rush)
(set-goal ranged-unit-type-goal archer)
(set-goal unit-goal archer)
(chat-to-allies-using-id 22155)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(taunt-detected any-ally 33)
=>
(acknowledge-taunt this-any-ally 33)
(set-goal strategy-goal boom)
(set-goal control-goal 0)
(set-goal unit-goal archer)
(set-goal ranged-unit-type-goal archer)
(chat-to-allies-using-id 22156)
)
#end-if; viking-civ
#load-if-defined INCAN-CIV
(defrule
(strategic-number sn-current-age >= ci-transit)
(goal strategy-goal fast-imp)
=>
(set-goal strategy-goal rush)
(set-goal unit-goal eagle-warrior)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(random-number < 40)
(or
(random-number > 20)
(goal nr-map-goal 1)
)
(game-time > 13)
(or
(goal position-goal pocket)
(goal nr-map-goal 1)
)
=>
(set-goal unit-goal archer)
(set-goal control-goal 0)
(set-goal strategy-goal boom)
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(random-number >= 40)
(goal nr-map-goal 1)
(game-time > 13)
=>
(set-goal unit-goal eagle-warrior)
(set-goal control-goal 0)
(set-goal strategy-goal boom)
(disable-self)
)
(defrule
(current-age == castle-age)
(goal strategy-goal boom)
(building-type-count-total town-center >= tc-level-three)
=>
(set-goal strategy-goal fast-imp)
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(goal strategy-goal rush)
(goal unit-goal eagle-warrior)
(strategic-number sn-cavalry-threat == 0)
(strategic-number sn-infantry-threat > 0)
(up-research-status c: ri-arbalest < research-pending)
=>
(set-goal ranged-unit-type-goal slinger)
(disable-self)
)
(defrule
(random-number > 65)
(random-number < 90)
(building-type-count-total castle == 0)
=>
(set-goal strategy-goal boom)
(set-goal unit-goal my-unique-unit-line)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal archer)
(disable-self)
)
(defrule
(random-number >= 90)
(goal ffa-game-goal -1)
(building-type-count-total castle == 0)
=>
(set-goal strategy-goal rush)
(set-goal unit-goal archer)
(set-goal control-goal aggressive-rush)
(set-goal ranged-unit-type-goal archer)
(disable-self)
)
(defrule
(dropsite-min-distance stone < 5)
(building-type-count-total town-center >= tc-level-three)
(nor
(goal unit-goal my-unique-unit-line)
(goal control-goal shot)
)
(or
(or
(strategic-number sn-cavalry-threat > 2)
(strategic-number sn-infantry-threat > 2)
)
(and
(goal unit-goal archer)
(strategic-number sn-current-age >= ci-transit)
)
)
=>
(set-goal control-goal my-unique-unit-line)
(set-goal uu-up-goal 1)
(chat-to-player my-player-number "Preparing in order to train unique units later on.")
(disable-self)
)
(defrule
(building-type-count castle > 1)
=>
(set-goal unit-goal my-unique-unit-line)
(set-goal uu-up-goal 1)
(set-goal control-goal 0)
(chat-to-player my-player-number "Switching to unique units.")
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(taunt-detected any-ally 32)
=>
(acknowledge-taunt this-any-ally 32)
(set-goal strategy-goal rush)
(set-goal control-goal aggressive-rush)
(set-goal ranged-unit-type-goal archer)
(set-goal unit-goal archer)
(chat-to-allies-using-id 22155)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(taunt-detected any-ally 33)
=>
(acknowledge-taunt this-any-ally 33)
(set-goal strategy-goal boom)
(set-goal control-goal 0)
(set-goal unit-goal eagle-warrior)
(set-goal ranged-unit-type-goal archer)
(chat-to-allies-using-id 22156)
)
#end-if; INCAN-CIV
#load-if-defined MAGYAR-CIV
(defrule
(goal strategy-goal flush)
=>
(set-goal unit-goal scout-cavalry)
(disable-self)
)
(defrule
(strategic-number sn-current-age == fc-transit)
(goal strategy-goal flush)
(random-number > 70)
=>
(set-goal unit-goal knight)
(chat-to-player my-player-number "Switching to knights.")
(disable-self)
)
(defrule
(or
(strategic-number sn-current-age >= ci-transit)
(building-type-count-total town-center >= tc-level-four)
)
(dropsite-min-distance stone < 5)
=>
(set-goal uu-up-goal 1)
(set-goal control-goal my-unique-unit-line)
)
(defrule
(game-time > 13)
(random-number >= 70)
=>
(set-goal strategy-goal rush)
(set-goal unit-goal cavalry-archer)
(set-goal ranged-unit-type-goal cavalry-archer)
(set-goal control-goal my-unique-unit-line)
(disable-self)
)
(defrule
(or
(regicide-game)
(goal nr-map-goal 1)
)
(game-time > 13)
=>
(set-goal strategy-goal boom)
(set-goal unit-goal cavalry-archer)
(set-goal ranged-unit-type-goal cavalry-archer)
(set-goal control-goal 0)
(disable-self)
)
(defrule
(building-type-count castle == 0)
(building-type-count stone-wall-line > 15)
(or
(players-civ every-enemy aztec)
(players-civ every-enemy saracen)
)
(game-time >= 60)
=>
(set-goal strategy-goal rush)
(set-goal unit-goal scout-cavalry)
(set-goal control-goal aggressive-rush)
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(up-compare-goal strategy-goal != flush)
(taunt-detected any-ally 32)
=>
(acknowledge-taunt this-any-ally 32)
(set-goal strategy-goal rush)
(set-goal control-goal aggressive-rush)
(set-goal unit-goal knight)
(chat-to-allies-using-id 22155)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(taunt-detected any-ally 33)
=>
(acknowledge-taunt this-any-ally 33)
(set-goal control-goal 0)
(set-goal strategy-goal boom)
(set-goal ranged-unit-type-goal cavalry-archer)
(set-goal unit-goal cavalry-archer)
(chat-to-allies-using-id 22156)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(building-type-count stone-wall-line > 15)
(up-compare-goal unit-goal != scout-cavalry)
(game-time > 25)
=>
(set-goal control-goal 0)
(set-goal strategy-goal boom)
(disable-self)
)
#end-if
#load-if-defined INDIAN-CIV
(defrule
(game-time > 13)
(game-time < 60)
(or
(or
(players-civ every-enemy hun)
(players-civ every-enemy mongol)
)
(or
(or
(players-civ every-enemy persian)
(players-civ every-enemy teutonic)
)
(or
(players-civ every-enemy frankish)
(players-civ every-enemy magyar)
)
)
)
=>
(set-goal strategy-goal rush)
(set-goal unit-goal knight)
(disable-self)
)
#load-if-not-defined UP-POCKET-POSITION
(defrule
(goal nr-map-goal -1)
(random-number > 60)
(up-compare-goal position-goal == flank); hm
(game-time < 13)
=>
(set-goal strategy-goal flush)
(set-goal unit-goal scout-cavalry)
(disable-self)
)
#else
(defrule
(goal nr-map-goal -1)
(random-number < 30)
(game-time > 13)
=>
(set-goal strategy-goal boom)
(set-goal unit-goal archer)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal archer)
(disable-self)
)
#end-if
(defrule
(or
(goal unit-goal skirmisher)
(goal unit-goal archer)
)
(building-type-count stable > 1)
=>
(set-goal unit-goal knight)
(chat-to-player my-player-number "Enable training of camels.")
)
(defrule
(goal unit-goal skirmisher)
(building-type-count-total town-center >= tc-level-three)
(dropsite-min-distance stone < 6)
=>
(set-goal control-goal my-unique-unit-line)
(set-goal uu-up-goal 1)
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(up-compare-goal strategy-goal != flush)
(up-compare-goal strategy-goal != rush)
(taunt-detected any-ally 32)
=>
(acknowledge-taunt this-any-ally 32)
(set-goal strategy-goal rush)
(set-goal control-goal aggressive-rush)
(set-goal ranged-unit-type-goal archer)
(set-goal unit-goal archer)
(chat-to-allies-using-id 22155)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(taunt-detected any-ally 33)
=>
(acknowledge-taunt this-any-ally 33)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal 0)
(set-goal strategy-goal boom)
(set-goal unit-goal my-unique-unit-line)
(chat-to-allies-using-id 22156)
)
#end-if
#load-if-defined SLAVIC-CIV
(defrule
(or
(and
(goal unit-goal knight)
(game-time > 1800)
)
(and
(goal unit-goal scorpion)
(building-type-count-total town-center >= tc-level-four)
)
)
(dropsite-min-distance stone < 6)
=>
(set-goal control-goal my-unique-unit-line)
(set-goal uu-up-goal 1)
(disable-self)
)
(defrule
(or
(goal unit-goal knight)
(goal unit-goal scorpion)
)
(building-type-count castle > 0)
(or
(building-type-count castle > 1)
(goal unit-goal knight)
)
=>
(set-goal unit-goal my-unique-unit-line)
(set-goal uu-up-goal 1)
(set-goal control-goal 0)
)
(defrule
(food-amount > 150)
(or
(gold-amount < 50)
(food-amount > 300)
)
(or
(goal unit-goal monk)
(goal strategy-goal flush)
)
(or
(players-unit-type-count focus-player eagle-warrior-line > 7)
(goal enemy-goal eagle-warrior)
)
=>
(set-goal unit-goal militiaman-line)
(chat-to-player my-player-number "Training long-swordsmen to counter an EW rush.")
(disable-self)
)
(defrule
(strategic-number sn-current-age == dark)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(random-number > 80)
(or
(goal nr-map-goal 1)
(random-number > 90)
)
(game-time < 60)
=>
(set-goal unit-goal my-unique-unit-line)
(set-goal strategy-goal boom)
(set-goal uu-up-goal 1)
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(or
(goal nr-map-goal 1)
(goal position-goal pocket)
)
(random-number < 80)
(random-number > 60)
(game-time > 13)
(game-time < 60)
=>
(set-goal unit-goal scorpion)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal 0)
(set-goal strategy-goal boom)
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(random-number < 15)
(game-time < 60)
(game-time > 13)
=>
(set-goal unit-goal monk)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal monk)
(set-goal strategy-goal rush)
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(up-compare-goal strategy-goal != flush)
(up-compare-goal strategy-goal != rush)
(taunt-detected any-ally 32)
=>
(acknowledge-taunt this-any-ally 32)
(set-goal strategy-goal rush)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal monk)
(set-goal unit-goal monk)
(chat-to-allies-using-id 22155)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(taunt-detected any-ally 33)
=>
(acknowledge-taunt this-any-ally 33)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal 0)
(set-goal strategy-goal boom)
(set-goal unit-goal scorpion)
(chat-to-allies-using-id 22156)
)
#end-if; slavic-civ
#load-if-defined ITALIAN-CIV
(defrule
(game-time < 60)
(game-time > 16)
(or
(goal nr-map-goal 1)
(random-number < 40)
)
=>
(set-goal strategy-goal boom)
(set-goal unit-goal my-unique-unit-line)
(set-goal uu-up-goal 1)
(set-goal ranged-unit-type-goal 0)
(disable-self)
)
#load-if-not-defined UP-POCKET-POSITION
(defrule
(goal nr-map-goal -1)
(random-number > 60)
(up-compare-goal position-goal == flank); hm
(game-time > 13)
=>
(set-goal strategy-goal flush)
(set-goal unit-goal archer)
(disable-self)
)
#end-if
(defrule
(goal nr-map-goal -1)
(random-number >= 40)
(random-number < 61)
=>
(set-goal strategy-goal rush)
(set-goal unit-goal knight)
(disable-self)
)
(defrule
(random-number < 10)
(game-time > 20)
=>
(set-goal strategy-goal rush)
(set-goal unit-goal monk)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal monk)
(disable-self)
)
(defrule
(building-type-count-total town-center >= tc-level-three)
(goal unit-goal archer)
(strategic-number sn-cavalry-threat > 1)
=>
(set-goal control-goal my-unique-unit-line)
(set-goal uu-up-goal 1)
)
(defrule
(goal control-goal my-unique-unit-line)
(building-type-count castle > 0)
(not (goal unit-goal gunpowder-class))
=>
(set-goal unit-goal my-unique-unit-line)
(set-goal control-goal 0)
)
(defrule
(strategic-number sn-current-age >= ci-transit)
(or
(strategic-number sn-infantry-threat > 2)
(players-civ every-enemy gothic)
)
=>
(set-goal unit-goal gunpowder-class)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(up-compare-goal strategy-goal != flush)
(up-compare-goal strategy-goal != rush)
(taunt-detected any-ally 32)
=>
(acknowledge-taunt this-any-ally 32)
(set-goal strategy-goal rush)
(set-goal control-goal aggressive-rush)
(set-goal ranged-unit-type-goal archer)
(set-goal unit-goal archer)
(chat-to-allies-using-id 22155)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(game-time > 30)
(game-time < 300)
(taunt-detected any-ally 33)
=>
(acknowledge-taunt this-any-ally 33)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal 0)
(set-goal strategy-goal boom)
(set-goal unit-goal my-unique-unit-line)
(chat-to-allies-using-id 22156)
)
#end-if ;italy
#load-if-defined LOW-RESOURCES-START
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(or
(game-time < 850)
(and
(building-type-count-total monastery > 0)
(and
(players-current-age focus-player == feudal-age)
(players-military-population focus-player < 2)
)
)
)
(strategic-number sn-current-age >= fc-transit)
(goal unit-goal eagle-warrior)
(goal control-goal 0)
=>
(set-goal control-goal aggressive-rush)
(chat-to-player my-player-number "Going for an aggressive EW rush.")
)
#load-if-not-defined DIFFICULTY-MODERATE
(defrule
(strategic-number sn-current-age == dark)
(unit-type-count-total villager >= 28)
(goal strategy-goal flush)
(up-compare-goal enemy-goal != flush)
(or
(unit-type-count-total villager >= 30)
(and
(up-compare-goal unit-goal != militiaman-line)
(up-compare-goal unit-goal != scout-cavalry)
)
)
=>
(set-goal strategy-goal rush)
(set-goal unit-goal default-unit)
(chat-local-to-self "Had a bad dark-age, switching to a fast castle-age strategy.")
)
#end-if
#end-if
#load-if-defined LUDIKRIS-MAP
#load-if-defined UP-POCKET-POSITION
(defrule
(up-compare-goal strategy-goal == flush)
=>
(set-goal strategy-goal boom)
(set-goal unit-goal default-unit)
(disable-self))
#else
(defrule
(up-compare-goal strategy-goal == flush)
=>
(set-goal strategy-goal rush)
(set-goal unit-goal default-unit)
(disable-self))
#end-if
#end-if
#load-if-not-defined UP-POCKET-POSITION
#load-if-not-defined BRITON-CIV
#load-if-not-defined CHINESE-CIV
#load-if-not-defined MAYAN-CIV
#load-if-not-defined MONGOL-CIV
#load-if-not-defined KOREAN-CIV
(defrule
(goal unit-goal my-unique-unit-line)
(goal train-civ-goal 1)
(strategic-number sn-resource-control == 0)
(unit-type-count-total my-unique-unit-line < 3)
(building-type-count castle > 0)
(building-type-count stone-wall-line < 15)
(current-age-time < 300)
(current-age == castle-age)
(food-amount < unique-unit-food)
=>
(set-goal train-civ-goal -1)
)
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if ; NOT DM
#load-if-defined DEATH-MATCH
#load-if-defined KOREAN-CIV
(defrule
(starting-age < imperial-age)
=>
(set-goal unit-goal my-unique-unit-line)
(set-goal control-goal militiaman-line)
(set-goal uu-up-goal 1)
(disable-self)
)
#end-if
#load-if-defined TURKISH-CIV
(defrule
(strategic-number sn-infantry-threat > 1)
(research-completed ri-chemistry)
=>
(set-goal ranged-unit-type-goal gunpowder-class)
(disable-self)
)
#end-if
#end-if
#load-if-not-defined BRITON-CIV
#load-if-not-defined CELTIC-CIV
#load-if-not-defined FRANKISH-CIV
#load-if-not-defined GOTHIC-CIV
#load-if-not-defined HUN-CIV
#load-if-not-defined KOREAN-CIV
#load-if-not-defined MAYAN-CIV
#load-if-not-defined MONGOL-CIV
#load-if-not-defined PERSIAN-CIV
#load-if-not-defined VIKING-CIV
#load-if-not-defined MAGYAR-CIV
#load-if-not-defined INCAN-CIV
#load-if-not-defined INDIAN-CIV
(defrule
(or (taunt-detected any-computer 230)
(taunt-detected any-human 230))
(current-age <= castle-age); dark
; (game-time > 30)
(game-time < 300)
=>
(set-goal strategy-goal rush)
(set-goal unit-goal monk)
(set-goal ranged-unit-type-goal monk)
(chat-to-player this-any-computer "30Going for a mush.")
(chat-to-player this-any-human "30Going for a mush.")
(acknowledge-taunt this-any-computer 230)
(acknowledge-taunt this-any-human 230))
#load-if-not-defined AZTEC-CIV
(defrule
(goal strategy-goal flush)
(goal ranged-unit-type-goal monk)
=>
(set-goal ranged-unit-type-goal default-ranged)
)
(defrule
(goal unit-goal monk)
(strategic-number sn-archer-threat > 1)
(or
(and
(building-type-count-total monastery < 3)
(game-time < 1500)
)
(or
(or
(civ-selected japanese)
(civ-selected chinese)
)
(or
(civ-selected slavic)
(civ-selected teutonic)
)
)
)
=>
(set-goal unit-goal scorpion)
(set-goal ranged-unit-type-goal monk)
)
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
(defrule
(strategic-number sn-current-age == feudal)
(goal strategy-goal flush)
(goal unit-goal militiaman-line)
(or
(strategic-number sn-archer-threat > 1)
(and
(players-building-type-count focus-player archery-range > 1)
(goal enemy-goal skirmisher)
)
)
(strategic-number sn-infantry-threat == 0)
=>
(set-goal unit-goal skirmisher)
(chat-to-player my-player-number "Switching to skirmishers.")
)
#load-if-not-defined AZTEC-CIV
#load-if-not-defined VIKING-CIV
#load-if-not-defined MAYAN-CIV
(defrule
(goal strategy-goal fast-imp)
(up-compare-goal unit-goal != gunpowder-class)
(strategic-number sn-current-age >= ci-transit)
=>
(set-goal strategy-goal rush)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock >= water-islands)
(current-age < castle-age)
(goal unit-goal my-unique-unit-line); change it or it will bug as no extra stone will be gathered during castle age advance
(building-type-count-total castle == 0)
=>
(set-goal unit-goal militiaman-line)
)
#end-if
#load-if-not-defined BYZANTINE-CIV
#load-if-not-defined INDIAN-CIV
(defrule
(goal strategy-goal rush)
(or
(goal unit-goal skirmisher)
(goal unit-goal mix)
)
(not (goal control-goal my-unique-unit-line))
(research-available imperial-age)
(dropsite-min-distance stone < 6)
=>
(set-goal unit-goal default-unit)
(chat-to-player my-player-number "Switching to my default unit.")
)
#end-if
#end-if
#end-if
#end-if
(defrule
(goal strategy-goal flush)
(goal unit-goal scout-cavalry)
(gold-amount > 250)
(building-type-count stable > 0); training scouts doesn't depend on the unit-goal, building a stable does
=>
(set-goal unit-goal skirmisher); use this to decrease gold gatherer percentage
)
#load-if-not-defined BYZANTINE-CIV
#load-if-not-defined CELTIC-CIV
(defrule
(goal strategy-goal flush)
(or
(goal unit-goal scout-cavalry)
(goal unit-goal skirmisher)
)
(strategic-number sn-current-age == fc-transit)
=>
(set-goal unit-goal default-ranged)
(set-goal ranged-unit-type-goal default-ranged)
(chat-to-player my-player-number "Switching to my default ranged unit.")
)
#end-if
(defrule
(goal strategy-goal flush)
(goal unit-goal default-ranged)
(or
(or
(civ-selected frankish)
(civ-selected persian)
)
(or
(civ-selected spanish)
(civ-selected teutonic)
)
)
=>
(set-goal unit-goal knight)
(chat-to-player my-player-number "Switching to knights.")
)
(defrule
(goal strategy-goal flush)
(goal unit-goal default-ranged)
(or
(civ-selected gothic)
(civ-selected celtic)
)
=>
(set-goal unit-goal militiaman-line)
(chat-to-player my-player-number "Switching to militiaman-line.")
)
#end-if
#else ; not PIDM
(defrule
(not (goal unit-goal cavalry-archer))
(up-research-status c: ri-bloodlines >= research-pending)
(up-research-status c: ri-paladin >= research-pending)
=>
(set-goal unit-goal knight)
)
(defrule
(nor
(up-research-status c: ri-bloodlines >= research-pending)
(up-research-status c: ri-paladin >= research-pending)
)
=>
(set-goal unit-goal my-unique-unit-line)
)
#end-if ;PIDM
(defrule
(true) ; provisory but can leave it in
=>
(set-goal aofe-game-goal 1)
(disable-self)
)
(defrule
(gold-amount < 50)
(unit-type-count fishing-ship >= 10)
(up-research-status c: ri-hand-cart >= research-pending)
(can-research ri-gillnets)
=>
(research ri-gillnets)
)
(defrule
(or
(unit-type-count eagle-warrior > 12)
(strategic-number sn-resource-control == ri-elite-eagle-warrior)
)
(can-research-with-escrow ri-eagle-warrior)
=>
(release-escrow food)(release-escrow gold)
(research ri-eagle-warrior)
)
(defrule
(or
(or
(unit-type-count genoese-crossbowman > 10)
(unit-type-count kamayuk > 10)
)
(or
(unit-type-count magyar-huszar > 10)
(or
(unit-type-count elephant-archer > 10)
(unit-type-count boyar > 10)
)
)
)
(can-research-with-escrow my-unique-unit-upgrade);fix for the fact that new uu don't count as my-uu-line
=>
(release-escrow food)(release-escrow gold)
(research my-unique-unit-upgrade)
(set-goal uu-up-goal 0)
)
#load-if-defined AZTEC-CIV
(defrule
(strategic-number sn-resource-control <= 2)
(unit-type-count skirmisher-line > 15)
(or
(unit-type-count battering-ram-line > 3)
(unit-type-count trebuchet-set > 0)
)
(can-research-with-escrow ri-atlatl)
=>
(release-escrow food)(release-escrow gold)
(research ri-atlatl)
)
(defrule
(building-type-count castle > 0)
(research-available my-unique-research)
(up-research-status c: ri-blast-furnace >= research-pending)
(up-research-status c: ri-plate-mail >= research-pending)
(nand
(or
(unit-type-count eagle-warrior-line > 10)
(unit-type-count heavy-eagle-warrior > 10)
)
(research-available ri-elite-eagle-warrior)
)
=>
(set-strategic-number sn-resource-control 2)
)
(defrule
(up-research-status c: ri-blast-furnace >= research-pending)
(up-research-status c: ri-plate-mail >= research-pending)
(can-research-with-escrow my-unique-research)
(nand
(or
(unit-type-count eagle-warrior-line > 10)
(unit-type-count heavy-eagle-warrior > 10)
)
(research-available ri-elite-eagle-warrior)
)
=>
(release-escrow food)(release-escrow gold)
(research my-unique-research)
)
#end-if
#load-if-defined BRITON-CIV
(defrule
(strategic-number sn-resource-control < 1)
(unit-type-count trebuchet-set > 3)
(up-research-status c: my-unique-research >= research-pending)
(can-research ri-war-wolf)
=>
(research ri-war-wolf)
)
(defrule
(strategic-number sn-resource-control < 1)
(building-type-count castle > 0)
(research-available my-unique-research)
(population >= del-civ-pop)
=>
(set-strategic-number sn-resource-control 2)
)
#end-if
#load-if-defined BYZANTINE-CIV
(defrule
(strategic-number sn-resource-control <= 2)
(unit-type-count fire-ship-line > 3)
(can-research-with-escrow ri-greek-fire)
=>
(release-escrow food)(release-escrow gold)
(research ri-greek-fire)
)
(defrule
(up-compare-goal ranged-unit-type-goal != archer)
(up-research-status c: ri-halberdier >= research-pending)
(food-amount < 300)
(gold-amount > 700)
(wood-amount > 400)
=>
(set-goal ranged-unit-type-goal archer)
)
#end-if
#load-if-defined CELTIC-CIV
(defrule
(strategic-number sn-resource-control < 1)
(population > max-civ-pop)
(can-research ri-stronghold)
=>
(research ri-stronghold)
)
#end-if
#load-if-defined CHINESE-CIV
(defrule
(strategic-number sn-resource-control < 1)
(building-type-count bombard-tower > 1)
(can-research ri-great-wall)
=>
(research ri-great-wall)
)
#end-if
#load-if-defined FRANKISH-CIV
(defrule
(strategic-number sn-resource-control < 1)
(or
(population > del-civ-pop)
(death-match-game)
)
(can-research ri-chivalry)
=>
(research ri-chivalry)
)
(defrule
(unit-type-count trade-cart > 20)
(goal anti-cavalry-threat-goal 1)
(goal unit-goal militiaman-line)
(up-research-status c: ri-cavalier >= research-pending)
=>
(set-goal unit-goal knight)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal scorpion)
)
(defrule
(unit-type-count trade-cart > 20)
(goal anti-cavalry-threat-goal 1)
(goal control-goal militiaman-line)
=>
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal scorpion)
)
#end-if
#load-if-defined GOTHIC-CIV
(defrule
(true)
=>
(do-nothing); This is just to match the up-jump-rule.
(disable-self)
)
#end-if
#load-if-defined HUN-CIV
(defrule
(strategic-number sn-resource-control < 1)
(goal unit-goal my-unique-unit-line)
(can-research ri-marauders)
=>
(research ri-marauders)
)
#end-if
#load-if-defined JAPANESE-CIV
(defrule
(strategic-number sn-resource-control < 1)
(building-type-count watch-tower > 3)
(or
(up-research-status c: ri-masonry >= research-pending)
(goal under-attack-goal 1)
)
(can-research ri-yasama)
=>
(research ri-yasama)
)
(defrule
(up-research-status c: my-unique-unit-upgrade >= research-pending)
(unit-type-count trebuchet-set >= 4)
(can-research-with-escrow my-unique-research)
=>
(release-escrow wood)(release-escrow gold)
(research my-unique-research)
)
#end-if
#load-if-defined KOREAN-CIV
(defrule
(strategic-number sn-resource-control < 1)
(unit-type-count turtle-ship-line > 3)
(can-research ri-panokseon)
=>
(research ri-panokseon)
)
#end-if
#load-if-defined MAYAN-CIV
(defrule
(strategic-number sn-resource-control < 1)
(unit-type-count archer-line >= 18)
(goal team-coordination-goal 1); attacking
(can-research ri-obsidian-arrows)
=>
(research ri-obsidian-arrows)
)
#end-if
#load-if-defined MONGOL-CIV
(defrule
(strategic-number sn-resource-control < 1)
(wood-amount > 600)
(can-research ri-nomads)
=>
(research ri-nomads)
)
(defrule
(building-type-count house > 0)
(research-completed ri-nomads)
=>
(delete-building house)
)
#end-if
#load-if-defined PERSIAN-CIV
(defrule
(strategic-number sn-resource-control < 1)
(up-research-status c: ri-murder-holes >= research-pending)
(can-research ri-boiling-oil)
=>
(research ri-boiling-oil)
)
(defrule
(can-research-with-escrow my-unique-research)
(or (up-research-status c: my-unique-unit-upgrade >= research-pending)
(unit-type-count my-unique-unit-line > 4))
=>
(release-escrow food)(release-escrow gold)
(research my-unique-research)
)
#end-if
#load-if-defined SARACEN-CIV
(defrule
(strategic-number sn-resource-control <= 2)
(unit-type-count monk >= 11)
(or (strategic-number sn-current-age >= ci-transit)
(gold-amount < 500))
(can-research ri-madrasah)
=>
(research ri-madrasah)
)
#end-if
#load-if-defined SPANISH-CIV
(defrule
(or (strategic-number sn-resource-control <= 2)
(strategic-number sn-resource-control == ri-inquisition))
(unit-type-count monk > 7)
(strategic-number sn-current-age >= ci-transit)
(can-research-with-escrow ri-inquisition)
=>
(release-escrow food)(release-escrow gold)
(research ri-inquisition)
)
(defrule
(random-number < 90)
(goal strategy-goal boom)
(goal unit-goal my-unique-unit-line)
(current-age == castle-age)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-focus-player-number g:= closest-enemy-goal)
(or (or (players-civ focus-player gothic)
(players-civ focus-player indian))
(players-civ focus-player persian))
=>
(set-goal ranged-unit-type-goal monk)
(disable-self)
)
(defrule
(population > del-civ-pop)
(current-age-time > 300)
(can-research my-unique-research)
=>
(research my-unique-research)
(set-strategic-number sn-allow-civilian-defense 3)
)
#end-if
#load-if-defined TEUTONIC-CIV
(defrule
(strategic-number sn-resource-control < 1)
(strategic-number sn-current-age >= ci-transit)
(can-research ri-ironclad)
=>
(research ri-ironclad)
)
(defrule
(goal unit-goal knight)
(goal control-goal 0)
(strategic-number sn-archer-threat >= 2)
(goal anti-cavalry-threat-goal 1)
(up-research-status c: my-unique-unit-upgrade < research-pending)
=>
(set-goal control-goal 0)
(set-goal uu-up-goal 0)
(set-goal ranged-unit-type-goal scorpion)
(disable-self)
)
#end-if
#load-if-defined TURKISH-CIV
(defrule
(strategic-number sn-resource-control < 1)
(unit-type-count cavalry-archer-class > high-min-number-upgrade)
(can-research ri-sipahi)
=>
(research ri-sipahi)
)
#end-if
#load-if-defined VIKING-CIV
(defrule
(strategic-number sn-resource-control < 3)
(unit-type-count berserk-line > mid-min-number-upgrade)
(up-research-status c: my-unique-unit-upgrade >= research-pending)
(strategic-number sn-cavalry-threat > 1)
(can-research ri-chieftains)
=>
(research ri-chieftains)
)
(defrule
(can-research-with-escrow my-unique-research)
(up-research-status c: my-unique-unit-upgrade >= research-pending)
=>
(release-escrow food)(release-escrow gold)
(research my-unique-research)
)
#end-if
#load-if-defined MAGYAR-CIV
(defrule
(strategic-number sn-resource-control <= 2)
(or (strategic-number sn-current-age >= ci-transit)
(game-time > 3000))
(can-research-with-escrow ri-mercenaries)
=>
(release-escrow food)(release-escrow gold)
(research ri-mercenaries)
)
(defrule
(strategic-number sn-resource-control < 1)
(unit-type-count cavalry-archer-class > high-min-number-upgrade)
(can-research ri-recurve-bow)
=>
(research ri-recurve-bow)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(goal nr-map-goal 1)
=>
(set-goal unit-goal knight)
(set-goal strategy-goal rush)
(disable-self)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(building-type-count-total stone-wall < 15)
(random-number < 3)
=>
(set-goal unit-goal archer)
(set-goal strategy-goal rush)
(disable-self)
)
#end-if
#load-if-defined INCAN-CIV
(defrule
(strategic-number sn-resource-control <= 2)
(or (strategic-number sn-resource-control < 1)
(goal hostilities-goal 1))
(or (unit-type-count skirmisher-line > 15)
(unit-type-count slinger > 9))
(can-research ri-andean-sling)
=>
(research ri-andean-sling)
)
(defrule
(strategic-number sn-resource-control < 1)
(up-research-status c: ri-conscription >= research-pending)
(can-research my-unique-research)
=>
(research my-unique-research)
)
(defrule
(dropsite-min-distance stone < 5)
(or (up-compare-goal control-goal != shot)
(up-research-status c: ri-elite-eagle-warrior >= research-pending))
(strategic-number sn-cavalry-threat > 1)
=>
(set-goal control-goal my-unique-unit-line)
(set-goal uu-up-goal 1)
(chat-to-player my-player-number "Preparing in order to train unique units later on.")
(disable-self)
)
#end-if
#load-if-defined SLAVIC-CIV
(defrule
(or (strategic-number sn-resource-control <= 2)
(strategic-number sn-resource-control == ri-orthodoxy))
(unit-type-count monk >= 7)
(or (strategic-number sn-current-age >= ci-transit)
(goal hostilities-goal 1))
(can-research-with-escrow ri-orthodoxy)
=>
(release-escrow gold)
(research ri-orthodoxy)
)
(defrule
(strategic-number sn-resource-control < 1)
(or (up-research-status c: ri-halberdier >= research-pending)
(up-research-status c: ri-champion >= research-pending))
(unit-type-count infantry-class > 20)
(can-research my-unique-research)
=>
(research my-unique-research)
)
#end-if
#load-if-defined INDIAN-CIV
(defrule
(strategic-number sn-resource-control <= 2)
(unit-type-count camel-line > 7)
(can-research-with-escrow ri-imperial-camel)
=>
(release-escrow food)(release-escrow gold)
(research ri-imperial-camel)
)
(defrule
(strategic-number sn-resource-control <= 2)
(or
(gold-amount < 100)
(strategic-number sn-current-age >= ci-transit)
)
(can-research ri-sultans)
=>
(research ri-sultans)
)
(defrule
(strategic-number sn-resource-control <= 2)
(unit-type-count hand-cannoneer > 7)
(can-research ri-shatagni)
=>
(research ri-shatagni)
)
#end-if
#load-if-defined ITALIAN-CIV
(defrule
(strategic-number sn-resource-control <= 2)
(or
(goal hostilities-goal 1)
(strategic-number sn-resource-control < 1)
)
(or
(unit-type-count genoese-crossbowman > 10)
(up-research-status c: my-unique-unit-upgrade >= research-pending)
)
(can-research ri-pavise)
=>
(research ri-pavise)
)
#end-if
#load-if-defined AZTEC-CIV
(defrule
(strategic-number sn-current-age == castle)
(game-time > 1800)
(goal unit-goal monk)
(wood-amount > 400)
(food-amount > 800)
(gold-amount < 300)
=>
(set-goal unit-goal skirmisher)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal monk)
)
#else
(defrule
(strategic-number sn-current-age == castle)
(game-time > 1800)
(goal unit-goal monk)
(wood-amount > 400)
(food-amount > 800)
(gold-amount < 300)
=>
(set-goal unit-goal my-unique-unit-line)
(set-goal control-goal 0)
(set-goal ranged-unit-type-goal monk)
)
#end-if
(defrule
(game-time > 3000)
(goal ranged-unit-type-goal monk)
(unit-type-count trade-cart < 6)
(dropsite-min-distance gold > 10)
=>
(set-goal ranged-unit-type-goal 0)
)
#load-if-defined BALTIC-MAP
(defrule
(strategic-number sn-minimum-water-body-size-for-dock == water-mixed)
(goal position-goal pocket)
(or (game-time < 1800)
(and (goal enemy-boats-goal 1)
(unit-type-count warship-class < 35)))
=>
(set-goal strategy-goal rush)
(set-strategic-number sn-minimum-water-body-size-for-dock water-islands)
)
(defrule
(game-time > 1800)
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
(goal position-goal pocket)
(or
(goal enemy-boats-goal 0)
(unit-type-count warship-class > 50)
)
=>
(set-strategic-number sn-minimum-water-body-size-for-dock water-mixed); water secured, train land army
)
#end-if
; end strategy section
;******************** BOAR HUNTING **************************************
#load-if-not-defined DIFFICULTY-EASIEST
#load-if-not-defined DIFFICULTY-EASY
(defrule
(unit-type-count villager >= 9); 8
(dropsite-min-distance live-boar <= 32)
(can-research ri-loom)
=>
(research ri-loom))
(defrule ; split rule
(or (dropsite-min-distance live-boar <= -1)
(or (unit-type-count 216 >= 1); male hunter
(or (unit-type-count 122 >= 1); female hunter
(or (unit-type-count villager < 9)
(up-research-status c: ri-loom != research-complete)))))
=>
(up-jump-rule 2))
(defrule
; (timer-triggered tensec)
(dropsite-min-distance live-boar s:<= sn-maximum-hunt-drop-distance)
; nn (dropsite-min-distance boar-hunting >= 5); no slain boar left
;(or
; j (unit-type-count villager >= 9)
; (unit-type-count 958 <= 0)); living domestic animals ; not working?
;(or (unit-type-count villager >= 14)
;(or (food-amount >= 50)
;(or (up-pending-objects c: villager >= 1)
; (building-type-count-total farm >= 3))))
=>
(set-strategic-number sn-enable-boar-hunting 2)
(set-strategic-number sn-minimum-boar-hunt-group-size 1)
(set-strategic-number sn-minimum-number-hunters 1)
(set-strategic-number sn-maximum-food-drop-distance 16) ; "failed" hunt
(set-strategic-number sn-maximum-hunt-drop-distance 32)
; (up-retask-gatherers food c: 1)
(up-request-hunters c: 1)
; (chat-local-to-self "Trying to start a hunt.")
)
(defrule
(dropsite-min-distance live-boar <= 32)
(dropsite-min-distance live-boar >= 0)
(strategic-number sn-enable-boar-hunting == 2)
(strategic-number sn-minimum-boar-hunt-group-size == 1)
(strategic-number sn-minimum-number-hunters == 1)
(unit-type-count 216 <= 0); male hunter
(unit-type-count 122 <= 0); female hunter
=>
(up-retask-gatherers food c: 1)
(disable-self)); test
(defrule
(dropsite-min-distance live-boar <= 16)
(strategic-number sn-enable-boar-hunting >= 1)
(unit-type-count 216 < 2); male hunter
(unit-type-count 122 < 2); female hunter
(or (unit-type-count 216 >= 1); male hunter
(unit-type-count 122 >= 1)); female hunter
=>
(set-strategic-number sn-minimum-number-hunters 2)
(up-request-hunters c: 1)
; (chat-local-to-self "Requesting a support hunter.")
)
(defrule
(dropsite-min-distance live-boar <= 10) ; else the risc of a dead vill is still too high
(dropsite-min-distance live-boar >= 0)
(unit-type-count 216 <= 2); male hunter
(unit-type-count 122 <= 2); female hunter
(strategic-number sn-enable-boar-hunting >= 1)
;(or (unit-type-count 216 >= 1); at least 1 hunter = the boar is not just standing too close to the mill
; (unit-type-count 122 >= 1))
=>
(set-strategic-number sn-minimum-boar-hunt-group-size 7)
(set-strategic-number sn-minimum-number-hunters 7)
(up-retask-gatherers food c: 1)
(up-request-hunters c: 6)
; (chat-local-to-self "Adding more hunters.")
)
(defrule
(or (dropsite-min-distance live-boar s:> sn-maximum-hunt-drop-distance)
(and (dropsite-min-distance live-boar >= 11)
(dropsite-min-distance boar-hunting <= 10))); eating a boar right now
(strategic-number sn-minimum-number-hunters > 2)
=>
(set-strategic-number sn-minimum-boar-hunt-group-size 1)
(set-strategic-number sn-minimum-number-hunters 2)
; (chat-local-to-self "Lowering min-hunters.")
)
(defrule
(or (dropsite-min-distance live-boar > 32)
(dropsite-min-distance live-boar <= -1))
(or (building-type-count-total mill >= 2)
(unit-type-count villager >= 12))
(or (unit-type-count villager >= 18)
(and (cc-players-unit-type-count 0 48 == 0); no boar on the map
(cc-players-unit-type-count 0 822 == 0)))
(strategic-number sn-enable-boar-hunting != 1)
=>
(set-strategic-number sn-enable-boar-hunting 1); enable hunting of all kinds
(set-strategic-number sn-minimum-boar-hunt-group-size 2)
(set-strategic-number sn-minimum-number-hunters 2)
; (chat-local-to-self "Disabling hunting restrictions.")
)
#end-if
#end-if
;******************** RESOURCE MANAGEMENT AND AGE UP ********************
(defrule
(or (strategic-number sn-minimum-water-body-size-for-dock >= water-islands)
(building-type-count-total town-center == 0))
=>
(up-jump-rule 27)
)
(defrule
(game-time < 2400)
(or (goal strategy-goal boom)
(civ-selected indian)); camel + pikes would be overkill
(goal unit-goal knight)
=>
(up-jump-rule 1)
)
(defrule
(goal train-civ-goal 1)
(strategic-number sn-cavalry-threat >= 1)
(strategic-number sn-resource-control <= 2)
(strategic-number sn-military-level >= 0)
(military-population > 10)
(building-type-count barracks > 0)
(nand (goal unit-goal knight)
(unit-type-count villager < 60))
(research-available ri-pikeman)
=>
(set-strategic-number sn-resource-control ri-pikeman)
(set-goal train-civ-goal ri-pikeman)
;debug (chat-to-player my-player-number "Saving resources for ri-pikeman")
)
(defrule
(strategic-number sn-resource-control <= 2)
(goal train-civ-goal 1)
(goal strategy-goal rush)
(goal unit-goal eagle-warrior)
(research-available ri-chain-mail)
=>
(set-goal train-civ-goal ri-chain-mail); stop villager training only EWs
;debug (chat-to-player my-player-number "Saving resources for ri-chain-mail")
)
(defrule
(strategic-number sn-resource-control <= 2)
(goal train-civ-goal ri-chain-mail)
(goal strategy-goal rush)
(goal unit-goal eagle-warrior)
(up-research-status c: ri-pikeman >= research-pending)
(research-available ri-chain-mail)
=>
(set-strategic-number sn-resource-control ri-chain-mail);stop all units; vils remain stopped
;debug (chat-to-player my-player-number "Saving resources for ri-chain-mail")
)
(defrule
(building-type-count town-center > 0)
(current-age >= castle-age)
(unit-type-count villager > villager-siege-workshop)
(building-type-count-total siege-workshop < 1)
(goal forward-threat-goal 1); don't check wood to block other buildings if enemy forwarded us
(nand
(unit-type-count ranged-unit-class < 5)
(strategic-number sn-military-level < 0)
)
(wood-amount < 260); some buffer
=>
(set-goal increase-town-size-goal siege-workshop)
(set-strategic-number sn-resource-control battering-ram)
(set-goal save-wood-goal 1)
;debug;debug (chat-to-player my-player-number "Saving resources for siege-workshop")
)
(defrule
(building-type-count-total town-center >= tc-level-two)
(goal unit-goal my-unique-unit-line)
(or
(and
(goal monk-threat-goal 1)
(map-type arena)
)
(or
(players-unit-type-count focus-player mangonel-line > 1)
(players-unit-type-count focus-player scorpion-line > 4)
)
)
(wood-amount >= 200)
(current-age >= castle-age)
(building-type-count-total siege-workshop < 1)
=>
(set-goal increase-town-size-goal siege-workshop)
(enable-timer increase-town-size-timer 4)
)
(defrule
(strategic-number sn-archer-threat > 1)
(goal unit-goal my-unique-unit-line)
(wood-amount >= 200)
(current-age == castle-age)
(building-type-count-total siege-workshop < 1)
=>
(set-goal increase-town-size-goal siege-workshop)
(enable-timer increase-town-size-timer 4)
)
(defrule
(wood-amount >= 800)
(current-age == castle-age)
(building-type-count-total university < 1)
(building-type-count-total castle < 1)
(building-type-count-total siege-workshop < 1)
=>
(set-goal increase-town-size-goal siege-workshop)
(enable-timer increase-town-size-timer 4)
)
#load-if-not-defined BYZANTINE-CIV
#load-if-not-defined HUN-CIV
#load-if-not-defined VIKING-CIV
(defrule
(wood-amount >= 200)
(current-age >= castle-age)
(strategic-number sn-resource-control < 2)
(building-type-count-total town-center < tc-level-four)
(goal strategy-goal boom)
(or
(goal unit-goal knight)
(civ-selected teutonic)
)
(strategic-number sn-archer-threat < 2)
=>
(up-jump-rule 1)
)
(defrule
(wood-amount >= 200)
(current-age >= castle-age)
(strategic-number sn-resource-control < 2)
(building-type-count-total town-center >= tc-level-three)
(or
(goal unit-goal knight)
(civ-selected teutonic)
)
(building-type-count-total siege-workshop < 1)
=>
(set-goal increase-town-size-goal siege-workshop)
(enable-timer increase-town-size-timer 4)
)
#load-if-not-defined UP-POCKET-POSITION
(defrule
(current-age == castle-age)
(or
(strategic-number sn-archer-threat > 1)
(players-building-type-count focus-player siege-workshop > 1)
)
(or
(goal unit-goal knight)
(goal ranged-unit-type-goal monk)
)
(building-type-count-total siege-workshop < 1)
(wood-amount < 200)
(game-time < 1500)
=>
(set-goal save-wood-goal siege-workshop)
(chat-local-to-self "Saving resources for siege-workshop")
)
(defrule
(can-build siege-workshop)
(or
(strategic-number sn-archer-threat > 1)
(and
(players-building-type-count focus-player siege-workshop > 1)
(game-time < 1500)
)
)
(or
(goal unit-goal knight)
(goal ranged-unit-type-goal monk)
)
(building-type-count-total siege-workshop < 1)
=>
(set-goal increase-town-size-goal siege-workshop)
(enable-timer increase-town-size-timer 4)
(build siege-workshop)
)
#end-if
#end-if
#end-if
#end-if
(defrule
(current-age >= castle-age)
(wood-amount >= 200)
(goal save-wood-goal 0)
(goal unit-goal cavalry-archer)
(building-type-count-total town-center == 1)
(building-type-count-total stable == 1)
(building-type-count-total archery-range > 3)
(building-type-count-total siege-workshop < 1)
(or
(up-compare-goal position-goal == flank)
(players-building-type-count focus-player watch-tower > 1)
)
=>
(set-goal increase-town-size-goal siege-workshop)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal strategy-goal flush)
(goal save-wood-goal 0)
(building-type-count town-center > 0)
(building-type-count-total monastery > 0)
(up-research-status c: ri-bodkin-arrow >= research-pending)
(strategic-number sn-military-level > 0)
(building-type-count-total siege-workshop < 1)
(can-build siege-workshop)
=>
(set-goal increase-town-size-goal siege-workshop)
(enable-timer increase-town-size-timer 4)
)
(defrule
(building-type-count town-center > 0)
(or
(strategic-number sn-military-level > 1)
(goal team-coordination-goal 1)
)
(or
(and
(players-building-type-count any-enemy castle > 0)
(strategic-number sn-military-level > 2)
)
(and
(goal unit-goal default-ranged)
(up-compare-goal strategy-goal != boom)
)
)
(goal under-attack-goal 0)
(building-type-count-total siege-workshop < 1)
(can-build siege-workshop)
=>
(set-goal increase-town-size-goal siege-workshop)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal control-goal shot)
(building-type-count-total town-center < tc-level-three)
(players-building-type-count focus-player castle > 0)
=>
(up-jump-rule 2)
)
(defrule
(current-age >= castle-age)
(wood-amount >= 200)
(goal strategy-goal rush)
(goal unit-goal eagle-warrior)
(or
(or
(strategic-number sn-archer-threat > 1)
(players-unit-type-count focus-player scorpion-line > 9)
)
(or
(building-type-count-total stone-wall-line > 10)
(players-building-type-count any-enemy castle > 0)
)
)
(building-type-count-total siege-workshop < 1)
=>
(set-goal increase-town-size-goal siege-workshop)
(enable-timer increase-town-size-timer 4)
)
(defrule
(building-type-count town-center > 0)
(current-age >= castle-age)
(goal increase-town-size-goal 0)
(or
(building-type-count monastery > 2); get fast imp with mush
(or
(goal strategy-goal fast-imp)
(goal control-goal shot)
)
)
(building-type-count-total siege-workshop < 1)
(wood-amount >= 200)
=>
(set-goal increase-town-size-goal siege-workshop)
(enable-timer increase-town-size-timer 4)
)
(defrule
(strategic-number sn-resource-control == 0)
(strategic-number sn-military-level > 1)
(current-age == castle-age)
(or (nor (goal strategy-goal fast-imp); don't delay fast imp or booms
(goal strategy-goal boom))
(goal control-goal shot)); except if meso shot
(building-type-count siege-workshop > 0)
; (unit-type-count-total siege-unit-class == 0)
(unit-type-count-total battering-ram-line < 3)
=>
(set-strategic-number sn-resource-control battering-ram)
;debug (chat-to-player my-player-number "Saving resources for battering-ram")
)
(defrule
(strategic-number sn-resource-control == 0)
(current-age == castle-age)
(or (goal strategy-goal rush)
(goal strategy-goal flush))
(strategic-number sn-military-level > 1)
(goal unit-goal default-ranged)
(building-type-count siege-workshop > 0)
(unit-type-count-total battering-ram-line < 2)
;(nand (unit-type-count spearman-line < 6)
; (strategic-number sn-cavalry-threat > 0))
=>
(set-strategic-number sn-resource-control battering-ram)
;debug (chat-to-player my-player-number "Saving resources for battering-ram")
)
(defrule
(goal unit-goal knight)
(building-type-count siege-workshop > 0)
(strategic-number sn-archer-threat > 1)
(strategic-number sn-military-level < 0)
(unit-type-count-total mangonel-line < 1)
=>
(up-jump-rule 7)
)
(defrule
(goal forward-threat-goal 1)
(building-type-count siege-workshop > 0)
(or (unit-type-count-total battering-ram-line == 0)
(players-building-type-count focus-player watch-tower > 3))
(unit-type-count-total battering-ram-line < 3)
(unit-type-count-total trebuchet-set == 0)
(nand (strategic-number sn-military-level < 0)
(goal under-attack-goal 1))
(civilian-population > 22)
=>
(set-strategic-number sn-resource-control battering-ram)
;debug (chat-to-player my-player-number "Saving resources for battering-ram")
)
(defrule
(goal forward-threat-goal 1)
(building-type-count siege-workshop > 0)
(players-building-type-count focus-player watch-tower > 5)
(unit-type-count-total battering-ram-line < 6)
(unit-type-count-total trebuchet-set == 0)
(nand (strategic-number sn-military-level < 0)
(goal under-attack-goal 1))
=>
(set-strategic-number sn-resource-control battering-ram)
;debug (chat-to-player my-player-number "Saving resources for battering-ram")
)
(defrule
(building-type-count siege-workshop > 0)
(unit-type-count-total battering-ram-line < 1)
(unit-type-count-total trebuchet-set == 0)
(goal team-coordination-goal 1); attacking
(players-building-type-count target-player stone-wall-line >= 8)
=>
(set-strategic-number sn-resource-control battering-ram)
;debug (chat-to-player my-player-number "Saving resources for battering-ram")
)
(defrule
(building-type-count siege-workshop > 0)
(unit-type-count battering-ram-line == 0)
(or (cc-players-unit-type-count any-enemy castle-arrow > 0)
(cc-players-unit-type-count any-enemy watch-tower-arrow > 0))
(or (up-compare-goal under-attack-goal == 1)
(goal forward-threat-goal 1))
(strategic-number sn-military-level >= 0)
=>
(set-strategic-number sn-resource-control battering-ram)
;debug (chat-to-player my-player-number "Saving resources for battering-ram")
)
(defrule
(strategic-number sn-resource-control < 3)
(goal control-goal shot)
(building-type-count siege-workshop > 0)
(unit-type-count-total battering-ram-line < 1)
(current-age == castle-age)
(strategic-number sn-military-level >= 0)
=>
(set-strategic-number sn-resource-control battering-ram)
;debug (chat-to-player my-player-number "Saving resources for battering-ram")
)
(defrule
(strategic-number sn-resource-control == battering-ram)
(wood-amount < 175)
=>
(set-goal save-wood-goal 1)
)
(defrule
(or (and (goal forward-threat-goal 1)
(unit-type-count battering-ram-line < 2))
(strategic-number sn-resource-control == battering-ram))
(can-train-with-escrow battering-ram-line)
=>
(release-escrow wood)(release-escrow gold)
(train battering-ram-line)
(set-strategic-number sn-resource-control 0)
)
(defrule
(goal increase-town-size-goal siege-workshop)
(or (or (goal unit-goal skirmisher)
(goal strategy-goal boom))
(or (goal unit-goal my-unique-unit-line)
(goal unit-goal mix)))
(up-compare-goal forward-threat-goal != 1); don't build an aggressive siege-workshop with these strategies
(building-type-count-total town-center < tc-level-two)
=>
(set-goal increase-town-size-goal 0)
)
(defrule
(current-age >= castle-age)
(player-in-game any-ally)
(military-population > 15)
(nand (or (goal position-goal pocket)
(goal strategy-goal boom))
(players-building-type-count any-ally siege-workshop > 0))
(players-military-population target-player < 5)
(building-type-count-total siege-workshop < 1)
(wood-amount < 200)
=>
(set-goal save-wood-goal 1)
)
(defrule
(current-age >= castle-age)
(player-in-game any-ally)
(military-population > 12)
(or
(nor
(goal position-goal pocket)
(goal strategy-goal boom)
)
(players-building-type-count target-player watch-tower > 0)
)
(players-military-population target-player < 5)
(building-type-count-total siege-workshop < 1)
(wood-amount >= 200)
=>
(set-goal increase-town-size-goal siege-workshop)
(enable-timer increase-town-size-goal 3)
)
#load-if-not-defined DEATH-MATCH
(defrule
(building-type-count town-center > 0)
(current-age >= castle-age)
(goal increase-town-size-goal 0)
(goal unit-goal archer)
(or
(and
(goal control-goal aggressive-rush)
(civ-selected mayan)
)
(and
(players-building-type-count focus-player watch-tower > 0)
(goal strategy-goal rush)
)
)
(building-type-count-total siege-workshop < 1)
(wood-amount >= 200)
(up-compare-goal position-goal == flank)
=>
(set-goal increase-town-size-goal siege-workshop)
(enable-timer increase-town-size-timer 4)
)
#end-if
(defrule
(current-age >= castle-age)
(goal increase-town-size-goal 0)
(goal save-wood-goal 0)
(building-type-count-total town-center >= tc-level-four)
(or
(goal ranged-unit-type-goal scorpion)
(up-research-status c: ri-heavy-scorpion >= research-pending)
)
(building-type-count-total siege-workshop < 3)
(wood-amount >= 400)
=>
(set-goal increase-town-size-goal siege-workshop)
(enable-timer increase-town-size-timer 4)
)
#load-if-not-defined DIFFICULTY-EASIEST
#load-if-not-defined DIFFICULTY-EASY
(defrule
(strategic-number sn-maximum-town-size >= 60)
(goal increase-town-size-goal 0)
(goal save-wood-goal 0)
(building-type-count-total town-center >= tc-level-four)
(wood-amount > 1400)
(up-research-status c: ri-siege-ram >= research-pending)
(building-type-count-total siege-workshop < 3)
=>
(set-goal forward-goal siege-workshop)
)
#end-if
#end-if
(defrule
(goal increase-town-size-goal 0)
(current-age >= castle-age)
(goal save-wood-goal 0)
(building-type-count-total town-center >= tc-level-four)
(or
(or
(building-type-count-total town-center >= tc-level-five)
(unit-type-count-total villager >= max-civ)
)
(and
(up-compare-goal strategy-goal != boom)
(population-cap < 250)
)
)
(building-type-count-total siege-workshop < 1)
(wood-amount >= 200)
=>
(set-goal increase-town-size-goal siege-workshop)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal increase-town-size-goal 0)
(current-age >= castle-age)
(strategic-number sn-resource-control != ri-elite-skirmisher)
(goal strategy-goal rush)
(goal unit-goal scorpion)
(building-type-count-total siege-workshop < 3)
(wood-amount >= 200)
=>
(set-goal increase-town-size-goal siege-workshop)
(enable-timer increase-town-size-timer 4)
)
#load-if-not-defined UP-POCKET-POSITION
#load-if-not-defined GOTHIC-CIV
(defrule
(goal increase-town-size-goal 0)
(current-age >= castle-age)
(strategic-number sn-resource-control != ri-elite-skirmisher)
(strategic-number sn-archer-threat > 0)
(strategic-number sn-military-level < 0)
(building-type-count-total town-center >= tc-level-two)
(building-type-count-total siege-workshop < 1)
(wood-amount >= 200)
=>
(set-goal increase-town-size-goal siege-workshop)
(enable-timer increase-town-size-timer 4)
)
#end-if
#else
(defrule
(goal increase-town-size-goal 0)
(current-age >= castle-age)
(strategic-number sn-resource-control != ri-elite-skirmisher)
(goal unit-goal scorpion)
(building-type-count-total town-center >= tc-level-two)
(building-type-count-total siege-workshop < 1)
(wood-amount >= 200)
=>
(set-goal increase-town-size-goal siege-workshop)
(enable-timer increase-town-size-timer 4)
)
#end-if
#load-if-defined CELTIC-CIV
(defrule
(current-age >= castle-age)
(goal increase-town-size-goal 0)
(building-type-count-total town-center >= tc-level-two)
(goal save-wood-goal 0)
(or
(building-type-count-total town-center >= tc-level-four)
(and
(or
(goal unit-goal knight)
(building-type-count-total town-center >= tc-level-three)
)
(building-type-count-total siege-workshop == 0)
)
)
(building-type-count-total siege-workshop < 3)
(wood-amount >= 200)
=>
(set-goal increase-town-size-goal siege-workshop)
(enable-timer increase-town-size-timer 4)
)
#end-if
#load-if-defined SLAVIC-CIV
(defrule
(goal save-wood-goal 0)
(current-age >= castle-age)
(goal increase-town-size-goal 0)
(building-type-count-total town-center >= tc-level-two)
(or
(building-type-count-total town-center >= tc-level-three)
(building-type-count-total siege-workshop == 0)
)
(or
(building-type-count-total town-center >= tc-level-four)
(building-type-count-total siege-workshop == 1)
)
(building-type-count-total siege-workshop < 3)
(wood-amount >= 200)
=>
(set-goal increase-town-size-goal siege-workshop)
(enable-timer increase-town-size-timer 4)
)
(defrule
(strategic-number sn-resource-control == 0)
(strategic-number sn-current-age >= ci-transit)
(unit-type-count scorpion-line > 9)
(up-research-status c: ri-heavy-scorpion < research-pending)
(goal unit-goal scorpion)
=>
(set-strategic-number sn-resource-control 2)
(set-goal save-wood-goal 1)
)
#end-if
#load-if-defined DEATH-MATCH
(defrule
(game-time > 120)
(up-compare-goal increase-town-size-goal != siege-workshop)
(building-type-count-total siege-workshop == 0)
(wood-amount >= 200)
(current-age == castle-age)
=>
(set-goal increase-town-size-goal siege-workshop)
(enable-timer increase-town-size-timer 4)
)
#end-if
(defrule
(goal increase-town-size-goal siege-workshop)
(up-pending-objects c: siege-workshop > 0)
=>
(set-goal increase-town-size-goal 0)
)
(defrule
(goal increase-town-size-goal siege-workshop)
(can-build siege-workshop)
=>
(build siege-workshop)
(set-goal increase-town-size-goal 2)
)
#end-if ; NOT WONDER RACE
(defrule
(game-time > 20)
(or
(or
(map-type scandanavia)
(death-match-game)
)
(and
(or
(dropsite-min-distance boar-hunting < 30)
(dropsite-min-distance deer-hunting < 32)
)
(unit-type-count-total villager > 14)
)
)
(research-available ri-loom)
=>
(research ri-loom)
(set-goal need-loom-goal 1)
)
(defrule
(or (players-military-population any-enemy >= 3); loom fast when enemy looks dangerous
(or (current-age >= castle-age); loom anyways at some point
(or (goal need-loom-goal 1); loom needed before hunting
(and (up-pending-objects c: villager == 0)
(food-amount < 50)))))
(can-research ri-loom)
=>
(research ri-loom)
)
(defrule
(or (population >= 6)
(building-type-count-total house <= 0))
(housing-headroom == 0)
(can-research ri-loom)
=>
(research ri-loom)
)
(defrule
(building-type-count-total town-center > 0)
(or
(housing-headroom < housing-headroom1); too late actually, but if we have no food we can't train vils anyways.
(and
(population > 10)
(housing-headroom < 4)
)
)
(population-headroom > 0)
=>
(set-goal housing-goal 1)
)
#load-if-not-defined WONDER-RACE
(defrule
(housing-headroom < 10)
(or
(goal strategy-goal flush)
(building-type-count-total blacksmith > 0)
)
(nand
(goal unit-goal my-unique-unit-line)
(strategic-number sn-current-age == fc-transit); build additonal houses in castle age to get builder for the castle
)
(strategic-number sn-current-age >= feudal)
(population < eighty-five-percent-pop)
(housing-headroom < housing-headroom2)
(population-headroom > 0)
=>
(set-goal housing-goal 1)
)
(defrule
(or
(population > 60)
(and
(strategic-number sn-current-age >= castle)
(or
(goal unit-goal eagle-warrior)
(goal unit-goal archer)
)
)
)
(strategic-number sn-current-age >= feudal)
(or
(housing-headroom < housing-headroom2)
(population > seventy-five-percent-pop)
)
(population-headroom > 0)
(nand
(goal strategy-goal boom)
(building-type-count-total town-center < 2)
)
=>
(set-goal housing-goal 1)
)
#end-if
(defrule
(strategic-number sn-current-age == dark)
(building-type-count town-center == 0)
(or
(or
(civ-selected hun); on LN, collect more wood for houses or be huns
(civ-selected chinese)
)
(or
(building-type-count-total house > 0)
(wood-amount > 300)
)
)
=>
(up-assign-builders c: 621 c: 6)
(set-goal housing-goal 0)
)
#load-if-defined DEATH-MATCH
(defrule
(strategic-number sn-current-age == dark)
(building-type-count-total house > 1)
=>
(set-goal housing-goal 0)
)
#end-if
#load-if-not-defined HUN-CIV
#load-if-not-defined CHINESE-CIV
#load-if-not-defined SPANISH-CIV ; speed bonus on buildings
(defrule
(building-type-count-total house == 0)
(goal housing-goal 1)
(or (or (civ-selected aztec)
(civ-selected mayan))
(not (map-type scandanavia))); go for early loom
(nor (up-research-status c: ri-treadmill-crane >= research-pending)
(and (death-match-game)
(starting-age == dark-age)))
=>
(up-assign-builders c: house c: 2)
(disable-self)
)
(defrule
(building-type-count house > 0)
=>
(up-assign-builders c: house c: 1)
(disable-self)
)
#end-if
#end-if
#end-if
(defrule
(goal housing-goal 1)
(or
(up-pending-objects c: house < 1)
(and
(and
(population > 90)
(housing-headroom < 5)
)
(or
(up-pending-objects c: house < 2)
(population > pop-house)
)
)
)
(up-pending-objects c: house < 3)
(can-build house)
=>
(build house)
(set-goal housing-goal 0)
(set-goal increase-town-size-goal house)
)
(defrule
(up-pending-objects c: house == 0)
(housing-headroom <= 4)
(population-headroom > 0)
(or (building-type-count-total dock >= 1)
(and (goal strategy-goal drush)
(building-type-count-total barracks >= 1)))
(building-type-count-total town-center >= 1)
(strategic-number sn-current-age == dark)
(can-build house)
=>
(build house)
(set-goal housing-goal 0)
(set-goal increase-town-size-goal house)
)
#load-if-defined DEATH-MATCH
(defrule
(goal housing-goal 1)
(or
(building-type-count-total barracks > 0)
(building-type-count-total stable > 0)
)
(or
(up-pending-objects c: house < 2)
(current-age >= feudal-age)
)
(or
(up-pending-objects c: house < 3)
(starting-age == post-imperial-age)
)
(up-pending-objects c: house < 5)
(can-build house)
=>
(build house)
(set-goal housing-goal 0)
(set-goal increase-town-size-goal house)
)
#end-if
(defrule
(goal housing-goal 1)
(population > 150)
(population-cap >= 225)
(up-pending-objects c: house < 5)
(can-build house)
=>
(build house)
(set-goal housing-goal 0)
(set-goal increase-town-size-goal house)
)
#load-if-not-defined WONDER-RACE
(defrule
(current-age == dark-age)
(civilian-population < max-civ); difficulty
(building-type-count town-center > 1); double arabia
(unit-type-count villager < 40)
(food-amount < 420)
(can-train villager)
=>
(disable-timer FDrop)
(enable-timer FDrop 21)
(train villager)
(set-strategic-number sn-total-number-explorers 2)
(set-strategic-number sn-number-explore-groups 2)
)
#end-if
(defrule
(strategic-number sn-current-age == dark)
(unit-type-count-total villager > 24)
(or (unit-type-count-total villager > 25)
(or (goal unit-goal archer)
(goal unit-goal skirmisher)))
(goal strategy-goal flush)
(food-amount > 440); 460
=>
(set-goal train-civ-goal -1)
)
#load-if-not-defined DIFFICULTY-EASIEST; test
;#load-if-defined DEATH-MATCH
(defrule
(or (food-amount >= 1400)
(and (food-amount >= 820)
(unit-type-count-total villager >= 15)))
(can-research feudal-age)
=>
(set-strategic-number sn-current-age df-transit)
(set-strategic-number sn-maximum-gold-drop-distance 14)
(set-strategic-number sn-maximum-stone-drop-distance 14)
(set-strategic-number sn-maximum-town-size 12)
(set-strategic-number sn-maximum-food-drop-distance 15)
(set-strategic-number sn-maximum-wood-drop-distance 15)
; (chat-to-allies-using-id 8101); "Advance to Feudal Age"
(research feudal-age)
)
;#end-if
(defrule
(or (unit-type-count-total villager >= 31)
(civilian-population >= max-civ))
(up-pending-objects c: villager <= 0)
(can-research feudal-age)
=>
(set-strategic-number sn-current-age df-transit)
(set-strategic-number sn-maximum-gold-drop-distance 14)
(set-strategic-number sn-maximum-stone-drop-distance 14)
(set-strategic-number sn-maximum-town-size 10)
(set-strategic-number sn-maximum-food-drop-distance 15)
; (chat-to-allies-using-id 8101); "Advance to Feudal Age"
(research feudal-age)
)
(defrule
(unit-type-count-total villager >= villager-feudal)
(or (unit-type-count fishing-ship > 3)
(map-type yucatan))
(can-research feudal-age)
=>
(set-strategic-number sn-current-age df-transit)
(set-strategic-number sn-maximum-gold-drop-distance 14)
(set-strategic-number sn-maximum-stone-drop-distance 14)
(set-strategic-number sn-maximum-town-size 10)
(set-strategic-number sn-maximum-food-drop-distance 15)
; (chat-to-allies-using-id 8101); "Advance to Feudal Age"
(research feudal-age)
)
(defrule
(civilian-population >= villager-flush)
(or (unit-type-count-total villager >= 25)
(up-compare-goal unit-goal != militiaman-line))
(goal strategy-goal flush)
(can-research feudal-age)
=>
(set-strategic-number sn-current-age df-transit)
(set-strategic-number sn-maximum-gold-drop-distance 14)
(set-strategic-number sn-maximum-stone-drop-distance 14)
(set-strategic-number sn-maximum-town-size 10)
(set-strategic-number sn-maximum-food-drop-distance 15)
; (chat-to-allies-using-id 8101); "Advance to Feudal Age"
(research feudal-age)
)
(defrule
(unit-type-count villager >= dark-age-villager)
(or (food-amount >= 620)
(or (unit-type-count-total villager >= 30)
(goal control-goal shot)))
(up-compare-goal strategy-goal != fast-imp)
(can-research feudal-age)
=>
(set-strategic-number sn-current-age df-transit)
(set-strategic-number sn-maximum-gold-drop-distance 14)
(set-strategic-number sn-maximum-stone-drop-distance 14)
(set-strategic-number sn-maximum-town-size 10)
(set-strategic-number sn-maximum-food-drop-distance 15)
; (chat-to-allies-using-id 8101); "Advance to Feudal Age"
(research feudal-age)
)
(defrule
(or (unit-type-count villager >= 33)
(goal unit-goal wonder))
(unit-type-count villager >= villager-wonder-dark)
(goal strategy-goal fast-imp)
(can-research feudal-age)
=>
(set-strategic-number sn-current-age df-transit)
(set-strategic-number sn-maximum-gold-drop-distance 14)
(set-strategic-number sn-maximum-stone-drop-distance 14)
(set-strategic-number sn-maximum-town-size 10)
(set-strategic-number sn-maximum-food-drop-distance 15)
; (chat-to-allies-using-id 8101); "Advance to Feudal Age"
(research feudal-age)
)
(defrule
(or (or (game-type == 8)
(difficulty != hardest))
(or (population-cap == 25)
(starting-resources != low-resources)))
(unit-type-count-total villager >= villager-feudal)
(can-research feudal-age)
=>
(set-strategic-number sn-current-age df-transit)
(set-strategic-number sn-maximum-gold-drop-distance 14)
(set-strategic-number sn-maximum-stone-drop-distance 14)
(set-strategic-number sn-maximum-food-drop-distance 15)
(set-strategic-number sn-maximum-wood-drop-distance 15)
; (chat-to-allies-using-id 8101); "Advance to Feudal Age"
(research feudal-age)
)
#else; test
(defrule
(or (players-current-age any-enemy >= feudal-age)
(or (players-current-age any-ally >= feudal-age)
(not (player-in-game any-human))))
(can-research feudal-age)
=>
(set-strategic-number sn-current-age df-transit)
(set-strategic-number sn-maximum-gold-drop-distance 14)
(set-strategic-number sn-maximum-stone-drop-distance 14)
(set-strategic-number sn-maximum-food-drop-distance 15)
(set-strategic-number sn-maximum-wood-drop-distance 15)
; (chat-to-allies-using-id 8101); "Advance to Feudal Age"
(research feudal-age)
)
#end-if; test
#load-if-not-defined DIFFICULTY-EASIEST
#load-if-not-defined DIFFICULTY-EASY
(defrule
(current-age == feudal-age)
(unit-type-count villager >= 15); pretend dark age if feudal age start
=>
(enable-timer lumber-timer 60)
(set-strategic-number sn-maximum-town-size 10)
(set-strategic-number sn-current-age feudal)
(set-strategic-number sn-maximum-gold-drop-distance 14)
(set-strategic-number sn-maximum-stone-drop-distance 14)
(set-strategic-number sn-minimum-number-hunters 0)
(disable-self))
#end-if
#end-if
(defrule
(or (difficulty == easiest)
(difficulty == easy))
(current-age == feudal-age)
(unit-type-count villager >= 5); pretend dark age if feudal age start
=>
(enable-timer lumber-timer 60)
(set-strategic-number sn-maximum-town-size 10)
(set-strategic-number sn-current-age feudal)
(set-strategic-number sn-maximum-gold-drop-distance 14)
(set-strategic-number sn-maximum-stone-drop-distance 14)
(set-strategic-number sn-minimum-number-hunters 0)
(disable-self))
(defrule
(strategic-number sn-current-age == fc-transit)
=>
(up-assign-builders c: bombard-tower c: 3)
(up-assign-builders c: castle c: 4)
(up-assign-builders c: archery-range c: 1)
(up-assign-builders c: stable c: 1)
(up-assign-builders c: market c: 1)
(up-assign-builders c: mining-camp c: 1)
)
#load-if-not-defined WONDER-RACE
#load-if-defined LOW-RESOURCES-START
(defrule
(strategic-number sn-current-age == feudal)
(or
(gold-amount < 200)
(or
(and
(goal unit-goal eagle-warrior)
(up-compare-goal position-goal == flank)
)
(goal unit-goal monk)
)
)
(food-amount >= 700)
(nor
(goal strategy-goal boom)
(goal control-goal shot)
)
(can-sell-commodity stone)
=>
(sell-commodity stone)
)
#end-if
#load-if-defined SARACEN-CIV
(defrule
(game-time < 1800); don't do this late game
(nor
(goal strategy-goal sling)
(and
(goal unit-goal my-unique-unit-line)
(building-type-count castle == 0)
)
)
(commodity-selling-price stone > 95)
(or
(wood-amount < 300); prevent sell/buy for TC loop
(stone-amount >= 200)
)
(can-sell-commodity stone)
=>
(sell-commodity stone)
)
#end-if
(defrule
(current-age >= imperial-age)
(game-time > 1800)
(current-age-time > 180)
(gold-amount > 900)
(stone-amount < 650)
(goal under-attack-goal 0)
(building-type-count-total castle < 4)
(or
(up-research-status c: my-unique-unit-upgrade >= research-pending)
(building-type-count-total castle < 2)
)
(or
(gold-amount > 1600)
(building-type-count-total castle == 0)
)
(can-buy-commodity stone)
=>
(buy-commodity stone)
(chat-local-to-self "6 buy stone for a castle")
)
(defrule
(strategic-number sn-resource-control != ri-heresy)
(game-time < 1800)
(goal monk-threat-goal 1)
(or
(and
(research-available ri-light-cavalry)
(gold-amount >= 200)
)
(unit-type-count scout-cavalry-line < 6)
)
(goal enemy-goal rush)
(food-amount < 80)
(building-type-count stable > 0)
(can-buy-commodity food)
=>
(buy-commodity food)
)
(defrule
;(or (cc-players-unit-type-count 0 tree-class < 150)
(dropsite-min-distance wood > 20);)
(wood-amount < 200)
(or
(gold-amount > 200)
(wood-amount < 60)
)
(can-buy-commodity wood)
=>
(buy-commodity wood)
(chat-to-player my-player-number "buy wood")
)
(defrule
(game-time < 1500)
(wood-amount < 120)
(gold-amount > 350)
(or
(unit-type-count-total 219 >= 1)
(unit-type-count-total 228 >= 1); dead lumberjacks
)
(can-buy-commodity wood)
=>
(buy-commodity wood)
(chat-to-player my-player-number "buy wood")
)
#load-if-not-defined AZTEC-CIV
#load-if-not-defined MAYAN-CIV
#load-if-not-defined INCAN-CIV
(defrule
(strategic-number sn-resource-control < 2)
(goal monk-threat-goal 1)
(building-type-count stable > 0)
(building-type-count market > 0)
(or
(unit-type-count scout-cavalry-line < 6)
(research-available ri-light-cavalry)
)
=>
(set-strategic-number sn-resource-control 2)
)
#end-if
#end-if
#end-if
#load-if-defined SARACEN-CIV
(defrule
(strategic-number sn-current-age == feudal)
(goal strategy-goal rush)
(or
(food-amount < 650)
(gold-amount > 320)
)
(food-amount < 800)
(commodity-buying-price food < 120)
(can-buy-commodity food)
=>
(buy-commodity food)
(chat-to-player my-player-number "3 Special Saracen Market Rule")
)
(defrule
(or
(game-time < 2100)
(research-available ri-horse-collar)
)
(or
(food-amount < 120)
(and
(up-compare-goal unit-goal != monk)
(and
(food-amount < 200)
(gold-amount > 275)
)
)
)
(gold-amount > 200)
(commodity-buying-price food < 140)
(can-buy-commodity food)
=>
(buy-commodity food)
(chat-to-player my-player-number "3 Special Saracen Market Rule")
)
(defrule
(game-time < 1500)
(building-type-count-total stable < 2)
(building-type-count-total archery-range < 2)
(wood-amount < 200)
(or
(wood-amount < 120)
(gold-amount > 500)
)
(gold-amount > 200)
(or
(unit-type-count-total 219 >= 1)
(unit-type-count-total 228 >= 1); dead lumberjacks
)
(commodity-buying-price wood < 120)
(can-buy-commodity wood)
=>
(buy-commodity wood)
(chat-to-player my-player-number "4 Special Saracen Market Rule")
)
#end-if
(defrule
(goal train-civ-goal 1)
(building-type-count-total town-center >= tc-level-two)
(gold-amount > 250)
(food-amount < 50)
(civilian-population < max-civ)
(civilian-population < 85)
(commodity-buying-price food < 150)
(can-buy-commodity food)
=>
(buy-commodity food)
(chat-to-player my-player-number "3 buy food for villagers")
)
(defrule
(strategic-number sn-resource-control != ri-heresy)
(gold-amount > 500)
(food-amount < 200)
(unit-type-count trade-cart > 15)
(commodity-buying-price food < 70)
(can-buy-commodity food)
=>
(buy-commodity food)
(chat-to-player my-player-number "3 buy cheap food with trade cart gold")
)
#load-if-defined POST-IMPERIAL-AGE-START
(defrule
(can-sell-commodity stone)
(stone-amount > 750)
(food-amount > 2000)
(wood-amount > 2000)
(gold-amount < 1000)
(commodity-selling-price stone > 40)
(building-type-count-total castle > 1)
=>
(sell-commodity stone)
)
#end-if
#end-if ; NOT WONDER-RACE
#load-if-defined DEATH-MATCH
#load-if-not-defined BRITON-CIV
#load-if-not-defined MONGOL-CIV
#load-if-not-defined KOREAN-CIV
#load-if-not-defined CHINESE-CIV
#load-if-not-defined MAYAN-CIV
#load-if-not-defined ISLANDS-MAP
#load-if-not-defined TEAM-ISLANDS-MAP
(defrule
(can-sell-commodity wood)
(commodity-selling-price wood > 40)
=>
(sell-commodity wood)
(sell-commodity wood)
(sell-commodity wood)
(sell-commodity wood)
(sell-commodity wood)
(sell-commodity wood)
(sell-commodity wood)
(sell-commodity wood)
(sell-commodity wood)
(sell-commodity wood)
(sell-commodity wood)
(sell-commodity wood)
(sell-commodity wood)(disable-self)
)
(defrule
(can-sell-commodity wood)
(commodity-selling-price wood > 30)
=>
(sell-commodity wood)
(sell-commodity wood)
(sell-commodity wood)
(sell-commodity wood)
(sell-commodity wood)
(sell-commodity wood)
(sell-commodity wood)
(sell-commodity wood)
(sell-commodity wood)
(sell-commodity wood)
(sell-commodity wood)
(sell-commodity wood)
(sell-commodity wood)(disable-self)
)
#end-if
#end-if
(defrule
(can-sell-commodity stone)
(commodity-selling-price stone > 70)
=>
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)(disable-self))
(defrule
(can-sell-commodity stone)
(commodity-selling-price stone > 70)
=>
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)(disable-self))
#else
#load-if-not-defined POST-IMPERIAL-AGE-START
(defrule
(can-sell-commodity stone)
(commodity-selling-price stone > 70)
=>
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)(disable-self))
#end-if
#end-if
#else
#load-if-not-defined POST-IMPERIAL-AGE-START
(defrule
(can-sell-commodity stone)
(commodity-selling-price stone > 70)
=>
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)
(sell-commodity stone)(disable-self)
)
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
(defrule
(research-available castle-age)
(strategic-number sn-current-age >= fc-transit)
=>
(set-strategic-number sn-current-age feudal)
(chat-to-player my-player-number "castle-age research failed!"); castle research failed, set our age-tracking back
)
#load-if-not-defined DIFFICULTY-EASIEST; test
(defrule
(can-research castle-age)
=>
(set-strategic-number sn-current-age fc-transit)
(set-strategic-number sn-maximum-town-size 10)
(research castle-age)
; (chat-to-allies-using-id 8102); "Advance to Castle Age"
)
#else; test
(defrule
(or (players-current-age any-enemy >= feudal-age)
(or (players-current-age any-ally >= feudal-age)
(not (player-in-game any-human))))
(can-research castle-age)
=>
(set-strategic-number sn-current-age fc-transit)
(set-strategic-number sn-maximum-town-size 10)
(research castle-age)
; (chat-to-allies-using-id 8102); "Advance to Castle Age"
)
#end-if; test
#load-if-not-defined DIFFICULTY-EASIEST
#load-if-not-defined DIFFICULTY-EASY
(defrule
(current-age == castle-age)
(unit-type-count villager >= 15)
=>
(set-strategic-number sn-camp-max-distance castle-age-camp-distance)
(set-strategic-number sn-maximum-fish-boat-drop-distance -1)
(set-strategic-number sn-maximum-town-size 12)
(set-strategic-number sn-maximum-hunt-drop-distance 18)
(set-strategic-number sn-maximum-gold-drop-distance 14)
(set-strategic-number sn-maximum-stone-drop-distance 14)
(set-strategic-number sn-wood-dropsite-distance 3)
(set-strategic-number sn-current-age castle)
(disable-self))
#end-if
#end-if
(defrule
(or (difficulty == easiest)
(difficulty == easy))
(current-age == castle-age)
(unit-type-count villager >= 15)
=>
(set-strategic-number sn-camp-max-distance castle-age-camp-distance)
(set-strategic-number sn-maximum-fish-boat-drop-distance -1)
(set-strategic-number sn-maximum-town-size 12)
(set-strategic-number sn-maximum-hunt-drop-distance 18)
(set-strategic-number sn-maximum-gold-drop-distance 14)
(set-strategic-number sn-maximum-stone-drop-distance 14)
(set-strategic-number sn-wood-dropsite-distance 3)
(set-strategic-number sn-current-age castle)
(disable-self))
(defrule
(or (strategic-number sn-gold-dropsite-distance >= 40); reset distances after forced camp
(strategic-number sn-stone-dropsite-distance >= 40))
=>
(set-strategic-number sn-gold-dropsite-distance 3)
(set-strategic-number sn-stone-dropsite-distance 3)
(set-strategic-number sn-maximum-gold-drop-distance 14)
(set-strategic-number sn-maximum-gold-drop-distance 14)
)
#load-if-not-defined POST-IMPERIAL-AGE-START
#load-if-not-defined DEATH-MATCH
(defrule
(or (and (goal strategy-goal flush)
(wood-amount > 420))
(and (stone-amount == 0); if there are many players selling stone for castle age advance, not everyone gets enough gold
(and (gold-amount < 200)
(food-amount > 750))))
(research-available castle-age)
(strategic-number sn-current-age == feudal)
(commodity-selling-price wood > 40)
(can-sell-commodity wood)
=>
(sell-commodity wood)
(chat-to-player my-player-number "sell excess wood")
)
#end-if
(defrule
(or (research-available imperial-age)
(current-age >= imperial-age))
(wood-amount > 430)
(commodity-selling-price wood > 40)
(or (building-type-count town-center >= tc-level-four)
(and (strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(stone-amount < 50)))
(cc-players-unit-type-count 0 tree-class > 150)
(gold-amount < 800)
(can-sell-commodity wood)
=>
(sell-commodity wood)
(chat-to-player my-player-number "sell excess wood")
)
#end-if
(defrule
(current-age >= imperial-age)
(food-amount > 2000)
(gold-amount < 1250)
(population > eighty-five-percent-pop)
(can-sell-commodity food)
(commodity-buying-price wood < 120); don't run into a buy wood, farm and sell food cycle, it's not worth
=>
(sell-commodity food)
(chat-to-player my-player-number "sell excess food")
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(food-amount < 2000)
(wood-amount > 2000)
(cc-players-unit-type-count 0 tree-class > 150)
(dropsite-min-distance wood < 7)
(gold-amount < 1200)
(population > eighty-five-percent-pop)
(can-sell-commodity wood)
=>
(sell-commodity wood)
(chat-to-player my-player-number "sell excess wood")
)
(defrule
(current-age >= imperial-age)
(food-amount > 600)
(or (and (commodity-selling-price food > 40)
(gold-amount < 150))
(and (food-amount > 1650)
(gold-amount < 800)))
(commodity-buying-price wood < 135)
(can-sell-commodity food)
=>
(sell-commodity food)
(chat-to-player my-player-number "sell excess food")
)
(defrule
(or (strategic-number sn-minimum-water-body-size-for-dock < water-islands); don't sell too much on water maps, we can't gatherer on other islands
(commodity-selling-price wood > 40))
(cc-players-unit-type-count 0 tree-class > 100)
(food-amount < 2000); sell food first
(wood-amount > 1200)
(dropsite-min-distance wood < 7)
(gold-amount < 800)
(or (starting-age < post-imperial-age)
(or (commodity-selling-price wood > 40)
(food-amount < 800)))
(can-sell-commodity wood)
=>
(sell-commodity wood)
(chat-to-player my-player-number "sell excess wood")
)
(defrule
(strategic-number sn-resource-control == ri-heresy)
(wood-amount > 220)
(gold-amount < 1100)
(commodity-selling-price wood > 20)
(can-sell-commodity wood)
=>
(sell-commodity wood)
(chat-to-player my-player-number "emergency sell wood - need ri-heresy")
)
(defrule
(strategic-number sn-resource-control == ri-heresy)
(food-amount > 300)
(gold-amount < 1100)
(commodity-selling-price food > 20)
(up-research-status c: ri-light-cavalry < research-pending)
(can-sell-commodity food)
=>
(sell-commodity food)
(chat-to-player my-player-number "emergency sell food - need ri-heresy")
)
(defrule
(research-available imperial-age)
(civilian-population >= max-civ)
(players-unit-type-count every-ally villager >= 95)
(food-amount < 500)
(gold-amount >= 800)
=>
(set-goal tribute-goal 3)
)
(defrule
(strategic-number sn-resource-control != ri-heresy)
(goal under-attack-goal 1)
(civilian-population < fourty-percent-pop)
(food-amount < 100)
(gold-amount > 350)
(commodity-buying-price food < 170)
(can-buy-commodity food)
=>
(buy-commodity food)
(set-goal tribute-goal 3)
)
(defrule
(wood-amount >= 275)
(stone-amount < 100)
(building-type-count-total town-center == 0)
(can-buy-commodity stone)
(unit-type-count villager > 0)
=>
(buy-commodity stone)
)
(defrule
(wood-amount > 375)
(stone-amount < 100)
(gold-amount < 300)
(unit-type-count villager > 0)
(building-type-count-total town-center == 0)
(building-type-count market > 0)
=>
(release-escrow wood)
(sell-commodity wood)
)
(defrule
(wood-amount >= 275)
(stone-amount < 100)
(building-type-count-total town-center == 0)
(unit-type-count villager > 0)
=>
(set-goal tribute-goal 6)
)
(defrule
(wood-amount < 275)
(stone-amount >= 100)
(building-type-count-total town-center == 0)
(unit-type-count villager > 0)
=>
(set-goal tribute-goal 4)
)
(defrule
(strategic-number sn-resource-control < 2)
(wood-amount >= 330)
(stone-amount < 100)
(civilian-population < 80)
(or (current-age-time > 300)
(gold-amount > 400))
(current-age >= castle-age)
(building-type-count-total town-center < 3)
(up-compare-goal strategy-goal != fast-imp)
(up-pending-objects c: town-center == 0)
(can-buy-commodity stone)
=>
(buy-commodity stone)
(chat-to-player my-player-number "6")
)
(defrule
(stone-amount < 650)
(civilian-population < 80)
(current-age >= imperial-age)
(building-type-count-total castle == 0)
(gold-amount > 400)
(unit-type-count trade-cart > 4)
(or (dropsite-min-distance stone > 20)
(dropsite-min-distance stone < 0))
(can-buy-commodity stone)
=>
(buy-commodity stone)
(chat-to-player my-player-number "6")
)
(defrule
(research-available imperial-age)
(strategic-number sn-current-age >= ci-transit)
=>
(set-strategic-number sn-current-age castle)
(chat-to-player my-player-number "imperial-age research failed!"); imperial research failed, set our age-tracking back
)
(defrule
(research-available imperial-age)
(civilian-population > 95)
(game-time >= 2400)
(or (population > seventy-five-percent-pop)
(population-cap >= 250))
(population > sixty-percent-pop)
=>
(set-escrow-percentage food 10)(set-escrow-percentage gold 20)
)
#load-if-not-defined DIFFICULTY-EASIEST; test
(defrule
(can-research-with-escrow imperial-age)
=>
(release-escrow food)(release-escrow gold)
(set-escrow-percentage food 0)(set-escrow-percentage gold 0)
(set-strategic-number sn-current-age ci-transit)
(set-strategic-number sn-percent-building-cancellation 75)
; (chat-to-allies-using-id 8103); "Advance to Imperial Age"
(research imperial-age)
)
#else; test
(defrule
(or (players-current-age any-enemy >= feudal-age)
(or (players-current-age any-ally >= feudal-age)
(not (player-in-game any-human))))
(can-research-with-escrow imperial-age)
=>
(release-escrow food)(release-escrow gold)
(set-escrow-percentage food 0)(set-escrow-percentage gold 0)
(set-strategic-number sn-current-age ci-transit)
(set-strategic-number sn-percent-building-cancellation 75)
; (chat-to-allies-using-id 8103); "Advance to Imperial Age"
(research imperial-age)
)
#end-if; test
(defrule
(or
(population < sixty-percent-pop)
(military-population < 20)
)
(goal under-attack-goal 1)
(strategic-number sn-military-level < 0)
=>
(release-escrow food)(release-escrow gold)
)
(defrule
(or (unit-type-count villager >= 15)
(or (death-match-game)
(or (difficulty == easiest)
(or (difficulty == easy)
(and (starting-resources == high-resources)
(game-time > 90))))))
(current-age == imperial-age)
=>
(set-strategic-number sn-current-age imperial)
(set-strategic-number sn-maximum-gold-drop-distance 14)
(set-strategic-number sn-maximum-stone-drop-distance 14)
(disable-self))
;================================================================
; Stone in general
;================================================================
(defrule
(unit-type-count 124 == 0); stone-miners
(unit-type-count 220 == 0)
(building-type-count-total town-center <= 0)
(wood-amount >= 275)
(stone-amount < 100)
(can-buy-commodity stone)
=>
(chat-local-to-self "Buying stone for a towncenter.")
(buy-commodity stone))
;================================================================
#load-if-not-defined WONDER-RACE
#load-if-not-defined HUN-CIV
(defrule
(strategic-number sn-military-level >= 0)
(building-type-count-total castle == 0)
(stone-amount < castle-stone)
(gold-amount > 300)
(or (strategic-number sn-current-age >= imperial)
(gold-amount > 1100))
; (building-available castle)
(can-buy-commodity stone)
=>
(chat-local-to-self "Buying stone for a castle.")
(buy-commodity stone))
(defrule
(strategic-number sn-military-level >= 0)
(building-type-count-total castle < 3)
(or (building-type-count-total castle < 2)
(gold-amount > 2000))
(stone-amount < castle-stone)
(gold-amount > 800); 300 in the rule above
(strategic-number sn-current-age >= imperial)
; (building-available castle)
(commodity-buying-price stone < 600)
(can-buy-commodity stone)
=>
(chat-local-to-self "Buying stone for a castle.")
(buy-commodity stone))
#end-if
#end-if
;================================================================
(defrule
(building-type-count-total castle < 5)
(stone-amount < castle-stone)
(or (gold-amount > 8000)
(and (or (unit-type-count-total trade-cart >= 15)
(unit-type-count-total trade-cog >= 15))
(gold-amount > 5000)))
; (building-available castle)
(commodity-buying-price stone < 600)
(can-buy-commodity stone)
=>
(chat-local-to-self "Buying stone for a castle.")
(buy-commodity stone))
;================================================================
(defrule
(building-type-count-total castle < 10)
(stone-amount < castle-stone)
(or (gold-amount > 10200)
(and (or (unit-type-count-total trade-cart >= 20)
(unit-type-count-total trade-cog >= 20))
(gold-amount > 5500)))
; (building-available castle)
(commodity-buying-price stone < 600)
(can-buy-commodity stone)
=>
(chat-local-to-self "Buying stone for a castle.")
(buy-commodity stone))
;================================================================
(defrule
(civilian-population < max-civ)
(building-type-count-total town-center < 4)
(current-age >= castle-age)
(or (strategic-number sn-military-level >= 2)
(and (goal strategy-goal boom)
(or (unit-type-count-total monk >= 1)
(building-type-count-total monastery <= 0))))
(wood-amount >= 275)
(stone-amount < 100)
(can-buy-commodity stone)
=>
(chat-local-to-self "Buying stone for a towncenter.")
(buy-commodity stone))
;================================================================
(defrule
(building-type-count-total castle >= 3)
(building-type-count-total town-center >= 3)
(players-military-population focus-player >= 50)
(military-population < 30)
(gold-amount < 100)
(commodity-selling-price stone > 200)
(can-sell-commodity stone)
=>
(chat-local-to-self "Selling stone.")
(sell-commodity stone))
;================================================================
; Food excess
;================================================================
#load-if-defined CAPTURE-THE-RELIC
(defrule
(food-amount > 200)
(gold-amount < 100)
(unit-type-count-total monk <= 0)
(unit-type-count-total 134 <= 0); dead monk
(can-sell-commodity food)
=>
(chat-local-to-self "Selling food for a monk.")
(sell-commodity food))
#end-if
;================================================================
(defrule
(food-amount > 700)
(gold-amount < 100)
(commodity-selling-price food > 40)
(can-sell-commodity food)
=>
(chat-local-to-self "Selling food.")
(sell-commodity food))
;================================================================
(defrule
(food-amount > 1000)
(gold-amount < 100)
(can-sell-commodity food)
=>
(chat-local-to-self "Selling food.")
(sell-commodity food))
;================================================================
(defrule
(food-amount > 10000)
(gold-amount < 200)
(can-sell-commodity food)
=>
(chat-local-to-self "Selling food.")
(sell-commodity food))
;================================================================
(defrule
(food-amount > 1500)
(gold-amount < 300)
(commodity-selling-price food > 30)
(can-sell-commodity food)
=>
(chat-local-to-self "Selling food.")
(sell-commodity food))
;================================================================
(defrule
(food-amount > 2300)
(gold-amount < 600)
(or (cc-players-unit-type-count 0 gold-mine < 1)
(commodity-selling-price food > 40))
(can-sell-commodity food)
=>
(chat-local-to-self "Selling food.")
(sell-commodity food))
;================================================================
(defrule
(food-amount > 400)
(gold-amount < 200)
(wood-amount < 100)
(cc-players-unit-type-count 0 tree-class < 30)
(can-sell-commodity food)
=>
(chat-local-to-self "Selling food.")
(sell-commodity food))
;================================================================
(defrule
(food-amount > 100)
(gold-amount < 200)
(wood-amount < 60)
(or (cc-players-unit-type-count 0 tree-class < 20)
(dropsite-min-distance wood > 25))
(can-sell-commodity food)
=>
(chat-local-to-self "Selling food.")
(sell-commodity food))
;================================================================
; Buying food
;================================================================
(defrule
(gold-amount > 1800)
(food-amount < 200)
(can-buy-commodity food)
=>
(chat-local-to-self "Buying food.")
(buy-commodity food))
;================================================================
(defrule
(gold-amount > 1000)
(food-amount < 100)
(can-buy-commodity food)
=>
(chat-local-to-self "Buying food.")
(buy-commodity food))
;================================================================
(defrule
(gold-amount > 2500)
(food-amount < 300)
(can-buy-commodity food)
=>
(chat-local-to-self "Buying food.")
(buy-commodity food))
;================================================================
(defrule
(food-amount < 4100)
(or (gold-amount > 10000)
(and (or (unit-type-count-total trade-cart >= 15)
(unit-type-count-total trade-cog >= 15))
(gold-amount > 5200)))
(can-buy-commodity food)
=>
(chat-local-to-self "Buying food.")
(buy-commodity food))
;================================================================
; Wood excess
;================================================================
#load-if-defined CAPTURE-THE-RELIC
(defrule
(wood-amount > 200)
(gold-amount < 100)
(unit-type-count-total monk <= 0)
(unit-type-count-total 134 <= 0); dead monk
(can-sell-commodity wood)
=>
(chat-local-to-self "Selling wood for a monk.")
(sell-commodity wood))
#end-if
;================================================================
(defrule
(or (cc-players-unit-type-count 0 tree-class > 300)
(dropsite-min-distance wood < 15))
(wood-amount > 1100)
(gold-amount < 200)
(commodity-selling-price wood > 45)
(can-sell-commodity wood)
=>
(chat-local-to-self "Selling wood.")
(sell-commodity wood))
;================================================================
(defrule
(or (cc-players-unit-type-count 0 tree-class > 300)
(dropsite-min-distance wood < 15))
(wood-amount > 700)
(gold-amount < 100)
(commodity-selling-price wood > 30)
(can-sell-commodity wood)
=>
(chat-local-to-self "Selling wood.")
(sell-commodity wood))
;================================================================
(defrule
(or (cc-players-unit-type-count 0 tree-class > 300)
(dropsite-min-distance wood < 15))
(wood-amount > 900)
(gold-amount < 100)
(can-sell-commodity wood)
=>
(chat-local-to-self "Selling wood.")
(sell-commodity wood))
;================================================================
(defrule
(or (cc-players-unit-type-count 0 tree-class > 300)
(dropsite-min-distance wood < 15))
(wood-amount > 1500)
(gold-amount < 300)
(or (cc-players-unit-type-count 0 gold-mine < 1)
(commodity-selling-price wood > 50))
(can-sell-commodity wood)
=>
(chat-local-to-self "Selling wood.")
(sell-commodity wood))
;================================================================
; Buying wood
;================================================================
;(defrule
; (wood-amount < 300)
; (gold-amount > 1200)
; (can-buy-commodity wood)
;=>
; (chat-local-to-self "Buying wood.")
; (buy-commodity wood))
;================================================================
;(defrule
; (wood-amount < 200)
; (gold-amount > 700)
; (can-buy-commodity wood)
;=>
; (chat-local-to-self "Buying wood.")
; (buy-commodity wood))
;================================================================
(defrule
(wood-amount < 200)
(gold-amount > 1200)
(or (players-building-type-count any-ally market >= 1)
(players-building-type-count any-ally dock >= 1))
(or (unit-type-count-total trade-cart >= 15)
(unit-type-count-total trade-cog >= 15))
(can-buy-commodity wood)
=>
(chat-local-to-self "Buying wood.")
(buy-commodity wood))
;================================================================
(defrule
(wood-amount < 60)
;(or (cc-players-unit-type-count 0 tree-class < 150)
(dropsite-min-distance wood > 25);)
(can-buy-commodity wood)
=>
(chat-local-to-self "Buying wood.")
(buy-commodity wood))
;================================================================
(defrule
(wood-amount < 100)
(gold-amount > 100)
;(or (cc-players-unit-type-count 0 tree-class < 150)
(dropsite-min-distance wood > 25);)
(can-buy-commodity wood)
=>
(chat-local-to-self "Buying wood.")
(buy-commodity wood))
;================================================================
(defrule
(wood-amount < 200)
(gold-amount > 300)
;(or (cc-players-unit-type-count 0 tree-class < 150)
(dropsite-min-distance wood > 25);)
(can-buy-commodity wood)
=>
(chat-local-to-self "Buying wood.")
(buy-commodity wood))
;================================================================
(defrule
(wood-amount < 4100)
(or (gold-amount > 10000)
(and (or (unit-type-count-total trade-cart >= 15)
(unit-type-count-total trade-cog >= 15))
(gold-amount > 5200)))
(can-buy-commodity wood)
=>
(chat-local-to-self "Buying wood.")
(buy-commodity wood))
;================================================================
; Trading to accomplish important goals
;================================================================
(defrule
(strategic-number sn-current-age == feudal)
(building-type-count blacksmith >= 1)
(gold-amount > 350)
(food-amount < 800)
(can-buy-commodity food)
(research-available castle-age)
=>
(chat-local-to-self "Buying food to advance to the next age.")
(buy-commodity food))
;================================================================
(defrule
(strategic-number sn-current-age == feudal)
(building-type-count blacksmith >= 1)
(gold-amount < 200)
(food-amount > 900)
(research-available castle-age)
(can-sell-commodity food)
=>
(chat-local-to-self "Selling food to advance to the next age.")
(sell-commodity food))
;================================================================
(defrule
(strategic-number sn-current-age == feudal)
(building-type-count blacksmith >= 1)
(food-amount >= 600)
(or (gold-amount < 200)
(food-amount < 800))
(wood-amount > 100)
(research-available castle-age)
(can-sell-commodity wood)
=>
(chat-local-to-self "Selling wood to advance to the next age.")
(sell-commodity wood))
;================================================================
#load-if-defined BYZANTINE-CIV
(defrule
(strategic-number sn-current-age == castle)
(population >= max-civ)
(or (building-type-count castle >= 1)
(or (building-type-count university >= 1)
(building-type-count siege-workshop >= 1)))
(food-amount >= 767)
(gold-amount < 536)
(research-available imperial-age)
(can-sell-commodity food)
=>
(chat-local-to-self "Selling food to advance to the next age.")
(sell-commodity food))
;================================================================
(defrule
(strategic-number sn-current-age == castle)
(population >= max-civ)
(or (building-type-count castle >= 1)
(or (building-type-count university >= 1)
(building-type-count siege-workshop >= 1)))
(food-amount <= 577)
(gold-amount >= 666)
(research-available imperial-age)
(can-buy-commodity food)
;(or
(up-research-status c: ri-hand-cart >= research-pending)
; (wood-amount <= 100))
=>
(chat-local-to-self "Buying food to advance to the next age.")
(buy-commodity food))
;================================================================
(defrule
(strategic-number sn-current-age == castle)
(population >= max-civ)
(or (building-type-count castle >= 1)
(or (building-type-count university >= 1)
(building-type-count siege-workshop >= 1)))
(food-amount >= 500); 667
(gold-amount < 536)
(wood-amount > 300)
(research-available imperial-age)
(can-sell-commodity wood)
=>
(chat-local-to-self "Selling wood to advance to the next age.")
(sell-commodity wood))
#else
(defrule
(strategic-number sn-current-age == castle)
(population >= max-civ)
(or (building-type-count castle >= 1)
(or (building-type-count university >= 1)
(building-type-count siege-workshop >= 1)))
(food-amount >= 1100)
(gold-amount < 800)
(research-available imperial-age)
(can-sell-commodity food)
=>
(chat-local-to-self "Selling food to advance to the next age.")
(sell-commodity food))
;================================================================
(defrule
(strategic-number sn-current-age == castle)
(population >= max-civ)
(or (building-type-count castle >= 1)
(or (building-type-count university >= 1)
(building-type-count siege-workshop >= 1)))
(food-amount <= 900)
(gold-amount >= 940)
(research-available imperial-age)
(can-buy-commodity food)
;(or
(up-research-status c: ri-hand-cart >= research-pending)
; (wood-amount <= 100))
=>
(chat-local-to-self "Buying food to advance to the next age.")
(buy-commodity food))
;================================================================
(defrule
(strategic-number sn-current-age == castle)
(population >= max-civ)
(or (building-type-count castle >= 1)
(or (building-type-count university >= 1)
(building-type-count siege-workshop >= 1)))
(food-amount >= 800); 1000
(gold-amount < 800)
(wood-amount > 300)
(research-available imperial-age)
(can-sell-commodity wood)
=>
(chat-local-to-self "Selling wood to advance to the next age.")
(sell-commodity wood))
#end-if
#load-if-defined CAPTURE-THE-RELIC
(defrule
(gold-amount < 100)
(unit-type-count-total monk <= 0)
(unit-type-count-total 134 <= 0); dead monk
=>
(set-strategic-number sn-resource-control monk))
(defrule
(unit-type-count-total monk < 1)
(can-train monk)
=>
(train monk))
(defrule
(unit-type-count-total monk >= 1)
(strategic-number sn-resource-control == monk)
=>
(set-strategic-number sn-resource-control 0))
#end-if
#load-if-not-defined WONDER-RACE
(defrule
(building-type-count dock > 0)
(strategic-number sn-resource-control <= 2)
(goal train-civ-goal 1)
(research-available ri-war-galley)
(goal enemy-boats-goal 1)
(or
(and
(unit-type-count fire-ship-line > 14)
(up-research-status c: ri-bow-saw >= research-pending)
)
(or
(civ-selected viking)
(unit-type-count galley-line > 6)
)
)
(food-amount < 230)
=>
(set-goal train-civ-goal navy)
(set-strategic-number sn-resource-control navy)
(chat-to-player my-player-number "save-resources for navy upgrades")
)
(defrule
(gold-amount > 300)
(food-amount < 200)
(strategic-number sn-resource-control == navy)
(or
(research-available ri-war-galley)
(research-available ri-careening)
)
(can-buy-commodity food)
=>
(buy-commodity food)
(chat-to-player my-player-number "3 buy food for navy-upgrades")
)
(defrule
(or
(strategic-number sn-resource-control == ri-long-swordsman)
(or
(goal train-civ-goal ri-chain-mail)
(goal train-civ-goal ri-pikeman)
)
)
(gold-amount > 300)
(food-amount < 150)
(can-buy-commodity food)
=>
(buy-commodity food)
)
(defrule
(strategic-number sn-resource-control <= 2)
(unit-type-count skirmisher-line > 7)
(research-available ri-elite-skirmisher)
(nor
(and
(wood-amount < 150)
(and
(food-amount > 250); get eskirms over 2nd TC or monastery
(gold-amount > 250); but don't slow down all other researches
)
)
(and
(wood-amount > 400); better spend the wood on buildings as gold is low.
(gold-amount < 75)
)
)
(goal strategy-goal flush)
=>
(set-goal save-wood-goal 1)
(set-strategic-number sn-resource-control ri-elite-skirmisher)
;debug (chat-to-player my-player-number "Saving resources for ri-elite-skirmisher")
)
(defrule
(strategic-number sn-resource-control <= 2)
(research-available ri-elite-skirmisher)
(or
(building-type-count-total town-center >= tc-level-three)
(strategic-number sn-archer-threat > 0)
)
(current-age-time > 120); don't immediately block everything
(unit-type-count skirmisher-line > 7)
(building-type-count archery-range > 0)
=>
(set-goal save-wood-goal 1)
(set-strategic-number sn-resource-control ri-elite-skirmisher)
;debug (chat-to-player my-player-number "Saving resources for ri-elite-skirmisher")
)
(defrule
(strategic-number sn-resource-control <= 2)
(strategic-number sn-archer-threat >= 1)
(research-available ri-elite-skirmisher)
(or
(nand
(town-under-attack)
(strategic-number sn-military-level < 0)
)
(building-type-count-total town-center >= tc-level-four)
)
(building-type-count-total town-center >= tc-level-three)
(military-population > 14)
(building-type-count archery-range > 0)
=>
(set-goal save-wood-goal 1)
(set-strategic-number sn-resource-control ri-elite-skirmisher)
;debug (chat-to-player my-player-number "Saving resources for ri-elite-skirmisher")
)
(defrule
(strategic-number sn-resource-control <= 2)
(strategic-number sn-archer-threat > 1)
(research-available ri-elite-skirmisher)
(or
(goal unit-goal archer)
(goal unit-goal cavalry-archer)
)
(or
(building-type-count-total town-center >= tc-level-two)
(building-type-count-total siege-workshop > 0)
)
(military-population > 19)
(building-type-count archery-range > 0)
=>
(set-goal save-wood-goal 1)
(set-strategic-number sn-resource-control ri-elite-skirmisher)
;debug (chat-to-player my-player-number "Saving resources for ri-elite-skirmisher")
)
(defrule
(strategic-number sn-resource-control <= 2)
(strategic-number sn-archer-threat > 1)
(research-available ri-elite-skirmisher)
(or
(goal unit-goal eagle-warrior)
(and
(goal unit-goal knight)
(goal control-goal aggressive-rush)
)
)
(building-type-count archery-range > 0)
(military-population > 14)
(unit-type-count-total mangonel-line == 0)
=>
(set-goal save-wood-goal 1)
(set-strategic-number sn-resource-control ri-elite-skirmisher)
;debug (chat-to-player my-player-number "Saving resources for ri-elite-skirmisher")
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-resource-control <= 2)
(goal train-civ-goal 1)
(or
(goal unit-goal archer)
(and
(and
(goal unit-goal knight)
(goal ranged-unit-type-goal archer)
)
(goal anti-cavalry-threat-goal 1)
)
)
(research-available ri-crossbow)
(building-type-count archery-range >= 1)
=>
(set-goal train-civ-goal ri-crossbow)
(set-strategic-number sn-resource-control ri-crossbow)
;debug (chat-to-player my-player-number "Saving resources for ri-crossbow")
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-resource-control <= 2)
(goal train-civ-goal 1)
(goal ranged-unit-type-goal archer)
(or
(and
(wood-amount > 150)
(food-amount < 70)
)
(goal enemy-goal eagle-warrior)
)
(gold-amount > 250)
(research-available ri-crossbow)
(building-type-count archery-range >= 1)
=>
(set-goal train-civ-goal ri-crossbow)
(set-strategic-number sn-resource-control ri-crossbow)
;debug (chat-to-player my-player-number "Saving resources for ri-crossbow")
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-resource-control <= 2)
(current-age == castle-age)
(goal train-civ-goal 1)
(or
(and
(goal unit-goal archer)
(building-type-count archery-range >= 1)
)
(and
(unit-type-count ranged-unit-class > 8)
(goal unit-goal my-unique-unit-line)
)
)
(research-available ri-fletching)
=>
(set-goal train-civ-goal ri-fletching)
)
(defrule
(strategic-number sn-military-level >= 0)
(strategic-number sn-resource-control <= 2)
(goal train-civ-goal 1)
(unit-type-count ranged-unit-class >= mid-min-number-upgrade)
(goal strategy-goal flush)
(not (research-available ri-long-swordsman))
(research-available ri-bodkin-arrow)
=>
(set-goal train-civ-goal ri-bodkin-arrow)
(set-strategic-number sn-resource-control ri-bodkin-arrow)
;debug (chat-to-player my-player-number "Saving resources for ri-bodkin-arrow")
)
#load-if-not-defined BRITON-CIV
(defrule
(strategic-number sn-resource-control <= 2)
(goal train-civ-goal 1)
(goal unit-goal archer)
(research-available ri-bodkin-arrow)
(unit-type-count ranged-unit-class >= mid-min-number-upgrade)
(nand
(strategic-number sn-cavalry-threat >= 1)
(unit-type-count spearman-line < 10)
)
(nor
(research-available ri-crossbow)
(or
(goal strategy-goal boom)
(goal strategy-goal fast-imp)
)
)
=>
(set-goal train-civ-goal ri-bodkin-arrow)
(set-strategic-number sn-resource-control ri-bodkin-arrow)
;debug (chat-to-player my-player-number "Saving resources for ri-bodkin-arrow")
)
#else
(defrule
(strategic-number sn-resource-control <= 2)
(goal train-civ-goal 1)
(goal unit-goal archer)
(research-available ri-bodkin-arrow)
(unit-type-count ranged-unit-class >= mid-min-number-upgrade)
(nand
(strategic-number sn-cavalry-threat >= 1)
(unit-type-count spearman-line < 10)
)
(up-research-status c: ri-crossbow >= research-pending)
(or
(building-type-count-total town-center == 1)
(unit-type-count villager > 55)
)
=>
(set-goal train-civ-goal ri-bodkin-arrow)
(set-strategic-number sn-resource-control ri-bodkin-arrow)
;debug (chat-to-player my-player-number "Saving resources for ri-bodkin-arrow")
)
#end-if
(defrule
(strategic-number sn-resource-control <= 2)
(goal train-civ-goal 1)
(or
(unit-type-count-total war-galley > 0)
(and
(building-type-count-total stable < 2)
(unit-type-count cavalry-archer-class >= high-min-number-upgrade)
)
)
(research-available ri-bodkin-arrow)
=>
(set-goal train-civ-goal ri-bodkin-arrow)
(set-strategic-number sn-resource-control ri-bodkin-arrow)
;debug (chat-to-player my-player-number "Saving resources for ri-bodkin-arrow")
)
#load-if-defined BRITON-CIV
(defrule
(can-research-with-escrow my-unique-research)
=>
(release-escrow wood)(release-escrow gold)
(research my-unique-research)
)
#end-if
#load-if-defined CHINESE-CIV
(defrule
(or
(unit-type-count my-unique-unit-line > 9)
(unit-type-count scorpion-line > 9)
)
(can-research my-unique-research)
=>
(research my-unique-research)
)
#end-if
#load-if-defined FRANKISH-CIV
(defrule
(strategic-number sn-resource-control <= 2)
(unit-type-count-total my-unique-unit-line > 10)
(can-research my-unique-research)
=>
(research my-unique-research)
)
#end-if
#load-if-defined GOTHIC-CIV
(defrule
(can-research-with-escrow ri-perfusion)
=>
(release-escrow wood)(release-escrow gold)
(research ri-perfusion)
)
#end-if
#load-if-defined MAYAN-CIV
(defrule
(not (research-available ri-elite-eagle-warrior))
(can-research my-unique-research)
=>
(research my-unique-research)
)
#end-if
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-resource-control <= 2)
(strategic-number sn-current-age >= ci-transit)
(strategic-number sn-military-level >= 0)
(research-available ri-eagle-warrior)
(goal unit-goal eagle-warrior)
=>
(set-strategic-number sn-resource-control ri-elite-eagle-warrior)
;debug (chat-to-player my-player-number "Saving resources for ri-eagle-warrior")
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-resource-control <= 2)
(or
(and
(and
(strategic-number sn-current-age == ci-transit)
(strategic-number sn-military-level >= 0)
)
(nand
(food-amount > 800)
(gold-amount > 500)
)
)
(research-available ri-elite-eagle-warrior)
)
(goal unit-goal eagle-warrior)
=>
(set-strategic-number sn-resource-control ri-elite-eagle-warrior)
;debug (chat-to-player my-player-number "Saving resources for ri-elite-eagle-warrior")
)
(defrule
(strategic-number sn-resource-control == ri-elite-eagle-warrior)
(food-amount < 800)
(gold-amount > 600)
(research-available ri-elite-eagle-warrior)
=>
(set-goal train-civ-goal ri-elite-eagle-warrior)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-resource-control <= 2)
(research-available ri-arbalest)
(or
(and
(food-amount > 350)
(gold-amount < 300)
)
(food-amount < 350)
)
(goal unit-goal archer)
=>
(set-strategic-number sn-resource-control ri-arbalest)
;debug (chat-to-player my-player-number "Saving resources for ri-arbalest")
)
#load-if-not-defined TURKISH-CIV; they get chemistry for free
(defrule
(strategic-number sn-resource-control <= 2)
(or
(research-available ri-chemistry)
(and
(strategic-number sn-current-age == ci-transit)
(or
(food-amount < 300)
(gold-amount < 200)
)
)
)
(building-type-count university > 0)
(goal unit-goal gunpowder-class)
=>
(set-strategic-number sn-resource-control ri-chemistry)
;debug (chat-to-player my-player-number "Saving resources for ri-chemistry")
)
#end-if
#load-if-not-defined RIVERS-MAP
#load-if-not-defined BALTIC-MAP
(defrule
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
(strategic-number sn-resource-control < 2)
(or
(soldier-count >= 45)
(game-time < 3600)
)
(soldier-count > 15)
(nand
(building-type-count dock == 0); we lost the naval battle so train more soldiers to defend
(and
(current-age >= castle-age)
(game-time > 1800)
)
)
(population-cap <= 250)
=>
(set-strategic-number sn-resource-control 1); train navy only
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
(population >= del-civ-pop)
(or (civilian-population > 70)
(game-time > 5400))
(players-unit-type-count every-enemy fire-ship-line < 12)
(players-unit-type-count every-enemy galley-line < 12)
(warboat-count > 40)
(or (and (soldier-count > 19)
(unit-type-count transport-ship < 2))
(soldier-count < 21))
(unit-type-count-total villager >= 12)
(population-cap <= 250)
=>
(set-goal train-civ-goal -1)
(delete-unit villager)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
(population >= del-civ-pop)
(current-age == imperial-age)
(or (warboat-count < 45)
(and (unit-type-count transport-ship > 1)
(or (dropsite-min-distance wood > 20)
(cc-players-unit-type-count 0 tree-class < 20))))
(building-type-count dock > 0)
(unit-type-count-total villager >= 12)
=>
(set-goal train-civ-goal -1)
(delete-unit villager)
)
#end-if
#end-if
#load-if-not-defined AZTEC-CIV
#load-if-not-defined MAYAN-CIV
(defrule
(strategic-number sn-resource-control <= 2)
(goal train-civ-goal 1)
(goal strategy-goal rush)
(goal unit-goal knight)
(research-available ri-chain-barding)
(gold-amount >= 150)
(goal control-goal shot)
(strategic-number sn-military-level >= 0)
=>
(set-goal train-civ-goal ri-chain-barding)
(set-strategic-number sn-resource-control ri-chain-barding)
;debug (chat-to-player my-player-number "Saving resources for ri-chain-barding")
)
#end-if
#end-if
; Place TC upgrades always before villager training or they won't fire unless you reached max villager
(defrule
(strategic-number sn-resource-control == 3)
(or
(not (research-available ri-hand-cart))
(unit-type-count-total villager < 55)
)
(research-completed ri-wheel-barrow)
=>
(release-escrow wood)(set-escrow-percentage wood 0)
(set-strategic-number sn-resource-control 0)
(set-goal train-civ-goal 1)
)
(defrule
(goal train-civ-goal 1)
(unit-type-count villager >= 40)
(can-train villager)
(research-available ri-wheel-barrow)
(can-buy-commodity food)
(food-amount >= 75)
(food-amount < 175)
(wood-amount >= 50); enough wood for it
=>
(buy-commodity food)
(chat-to-player my-player-number "Attempting to research ri-wheel-barrow: Buy Food")
(set-goal train-civ-goal 2)
(set-strategic-number sn-resource-control 3)
)
(defrule
(goal train-civ-goal 1)
(unit-type-count villager >= 50)
(research-available ri-wheel-barrow)
(strategic-number sn-military-level >= 0)
=>
(set-goal train-civ-goal 2)
(set-strategic-number sn-resource-control 3)
;debug (chat-to-player my-player-number "Saving resources for ri-wheel-barrow")
)
(defrule
(strategic-number sn-resource-control == 3)
(players-building-type-count any-ally market > 0)
(unit-type-count villager >= 60)
(research-available ri-hand-cart)
(food-amount > 300)
(wood-amount < 150)
=>
(set-goal tribute-goal 4)
)
(defrule
(nor
(town-under-attack)
(and
(building-type-count-total town-center == 1)
(up-research-status c: imperial-age == research-pending)
)
)
(goal train-civ-goal 1)
(strategic-number sn-resource-control < 4)
(unit-type-count villager >= 60)
(research-available ri-hand-cart)
(can-buy-commodity food)
(food-amount < 300)
=>
(set-escrow-percentage wood 100)
(buy-commodity food)
(chat-to-player my-player-number "Attempting to research ri-hand-cart: Buy Food")
(set-strategic-number sn-resource-control 3)
)
(defrule
(nor
(town-under-attack)
(and
(building-type-count-total town-center == 1)
(up-research-status c: imperial-age == research-pending)
)
)
(strategic-number sn-resource-control < 4)
(unit-type-count villager >= 60)
(research-available ri-hand-cart)
(can-buy-commodity wood)
(food-amount >= 300); enough food for it
(wood-amount >= 100)
(wood-amount < 200)
=>
(set-escrow-percentage wood 100)
(buy-commodity wood)
(chat-to-player my-player-number "Attempting to research ri-hand-cart: Buy Wood")
(set-strategic-number sn-resource-control 3)
)
(defrule
(strategic-number sn-resource-control == 3)
(research-available ri-hand-cart)
(escrow-amount wood >= 200)
=>
(set-escrow-percentage wood 0)
)
(defrule
(strategic-number sn-resource-control < 4)
(or
(or
(goal strategy-goal sling)
(goal strategy-goal flush)
)
(population-cap < 75)
)
(unit-type-count villager >= 16)
(can-research ri-wheel-barrow)
=>
(research ri-wheel-barrow)
(set-goal train-civ-goal 1)
(set-strategic-number sn-resource-control 0)
)
(defrule
(unit-type-count villager >= 29)
(strategic-number sn-resource-control < 4)
(or
(current-age >= castle-age)
(and
(current-age-time < 20)
(food-amount > 720)
)
)
(nand
(goal unit-goal my-unique-unit-line)
(research-available ri-stone-mining)
)
(can-research ri-wheel-barrow)
=>
(research ri-wheel-barrow)
(set-goal train-civ-goal 1)
(set-strategic-number sn-resource-control 0)
)
(defrule
(or
(unit-type-count-total villager >= 55)
(civilian-population >= max-civ)
)
(can-research-with-escrow ri-hand-cart)
=>
(release-escrow wood)(set-escrow-percentage wood 0)
(research ri-hand-cart)
(set-goal train-civ-goal 1)
(set-strategic-number sn-resource-control 0)
)
#end-if ; not WONDER-RACE
(defrule
(or
(or
(research-available ri-wheel-barrow)
(civ-selected viking)
)
(and
(gold-amount > 220)
(food-amount < 730)
)
)
(current-age >= feudal-age)
(can-research ri-loom)
=>
(research ri-loom)
)
#load-if-not-defined ALL-TECHS-ENABLED
(defrule
(can-research ri-loom)
(or
(civ-selected mayan)
(civ-selected chinese)
)
=>
(research ri-loom)
)
#end-if
#load-if-defined LOW-RESOURCES-START
#load-if-defined DIFFICULTY-HARDEST
#load-if-defined FORTRESS-MAP
(defrule
(goal train-civ-goal 1)
; (civilian-population < max-civ); hardest anyway
(or (and (current-age == feudal-age)
(gold-amount < 180))
(and (unit-type-count villager < 31)
(current-age == dark-age)))
(can-train villager)
=>
(disable-timer FDrop)
(enable-timer FDrop 21)
(train villager)
)
#end-if
#end-if
#end-if
#load-if-not-defined WONDER-RACE
(defrule
(goal train-civ-goal 1)
(current-age == feudal-age)
(civilian-population < max-civ); difficulty
(or (goal strategy-goal rush)
(goal strategy-goal boom))
(or (food-amount < 760)
(current-age-time < 30))
(or (current-age-time < 55)
(starting-age == feudal-age))
(can-train villager)
=>
(disable-timer FDrop)
(enable-timer FDrop 21)
(train villager)
)
#end-if
; try to push to castle age
(defrule
(goal strategy-goal flush)
(or
(or
(goal enemy-goal flush)
(goal enemy-goal eagle-warrior)
)
(current-age-time >= 720)
)
(research-available castle-age)
(strategic-number sn-resource-control == 0)
(strategic-number sn-military-level >= 0)
(goal under-attack-goal 0)
(game-time >= 1300)
=>
(set-strategic-number sn-resource-control 2)
;debug (chat-to-player my-player-number "Saving resources for castle-age")
)
(defrule
(goal strategy-goal flush)
(research-available castle-age)
(strategic-number sn-resource-control == 2)
(military-population < 15)
(goal under-attack-goal 1)
=>
(set-strategic-number sn-resource-control 0)
)
(defrule
(goal strategy-goal flush)
(strategic-number sn-current-age == feudal)
(strategic-number sn-resource-control == 0)
(strategic-number sn-minimum-water-body-size-for-dock >= water-mixed)
(wood-amount < 200)
(food-amount > 700)
(building-type-count-total blacksmith == 0)
=>
(set-strategic-number sn-resource-control 2)
;debug (chat-to-player my-player-number "Saving resources for castle-age")
)
(defrule
(players-military-population every-enemy < 5)
(goal strategy-goal flush)
(goal forward-threat-goal 1)
(strategic-number sn-current-age == feudal)
(strategic-number sn-resource-control == 0)
=>
(set-strategic-number sn-resource-control 2)
;debug (chat-to-player my-player-number "Saving resources for castle-age")
)
; try to push to imperial age
(defrule
(current-age-time > 600)
(strategic-number sn-current-age == castle)
(strategic-number sn-minimum-water-body-size-for-dock >= water-mixed)
(or (civilian-population >= 30)
(goal strategy-goal fast-imp))
(food-amount > 500)
(gold-amount > 400)
=>
(set-strategic-number sn-resource-control 2)
;debug (chat-to-player my-player-number "Saving resources for imperial-age")
)
(defrule
(strategic-number sn-current-age == castle)
(goal strategy-goal rush)
(building-type-count-total town-center >= tc-level-three)
(goal unit-goal knight)
(players-building-type-count focus-player castle > 0)
(or
(players-building-type-count focus-player castle > 1)
(players-building-type-count focus-player stone-wall-line > 15)
)
=>
(set-goal strategy-goal fast-imp)
(disable-self)
)
(defrule
(research-available imperial-age)
(strategic-number sn-resource-control == 0)
(building-type-count town-center >= tc-level-two)
(strategic-number sn-military-level >= 0)
(or (civilian-population >= 130)
(or (and (civilian-population >= 115)
(strategic-number sn-military-level >= 1))
(and (civilian-population >= 100)
(strategic-number sn-military-level >= 2))))
(nor (town-under-attack)
(enemy-buildings-in-town))
=>
(set-strategic-number sn-resource-control 2)
;debug (chat-to-player my-player-number "Saving resources for imperial-age")
)
(defrule
(research-available imperial-age)
(strategic-number sn-resource-control == 0)
(building-type-count town-center >= tc-level-two)
(population > 140)
(strategic-number sn-military-level >= 0)
(nor
(town-under-attack)
(and
(players-current-age focus-player == imperial-age)
(strategic-number sn-military-level >= 2)
)
)
=>
(set-strategic-number sn-resource-control 2)
;debug (chat-to-player my-player-number "Saving resources for imperial-age")
)
(defrule
(strategic-number sn-current-age == castle)
(strategic-number sn-resource-control == 0)
(or
(population >= 140)
(unit-type-count-total eagle-warrior-line > 40)
)
(or
(strategic-number sn-military-level >= -1)
(unit-type-count cavalry-unit-class > 20)
)
(goal under-attack-goal 0)
(or
(goal strategy-goal fast-imp)
(and
(goal strategy-goal boom)
(goal unit-goal knight)
)
)
=>
(set-strategic-number sn-resource-control 2)
;debug (chat-to-player my-player-number "Saving resources for imperial-age")
)
(defrule
(strategic-number sn-resource-control == 0)
(or
(and
(research-available ri-cavalier)
(or
(goal unit-goal knight-line)
(unit-type-count knight-line > 19)
)
)
(and
(research-available ri-hussar)
(nor
(goal unit-goal militiaman-line)
(civ-selected magyar)
)
)
)
(up-research-status c: ri-champion < research-pending)
=>
(set-strategic-number sn-resource-control 2)
)
(defrule
(strategic-number sn-resource-control == 0)
(or
(and
(or
(research-available ri-two-handed-swordsman)
(research-available ri-champion)
)
(or
(goal unit-goal militiaman-line)
(goal control-goal militiaman-line)
)
)
(and
(goal ranged-unit-type-goal archer)
(research-available ri-arbalest)
)
)
=>
(set-strategic-number sn-resource-control 2)
)
(defrule
(strategic-number sn-resource-control == 0)
(strategic-number sn-current-age >= ci-transit)
(or
(or
(research-available ri-blast-furnace)
(research-available ri-plate-mail)
)
(research-available ri-chain-mail)
)
(unit-type-count infantry-class > 12)
(or
(food-amount < 350)
(gold-amount < 225)
)
=>
(set-strategic-number sn-resource-control 2)
)
#load-if-not-defined AZTEC-CIV
#load-if-not-defined MAYAN-CIV
(defrule
(strategic-number sn-resource-control == 0)
(strategic-number sn-current-age >= ci-transit)
(or
(or
(research-available ri-blast-furnace)
(research-available ri-plate-barding)
)
(research-available ri-chain-barding)
)
(unit-type-count cavalry-unit-class > 12)
(or
(food-amount < 350)
(gold-amount < 225)
)
=>
(set-strategic-number sn-resource-control 2)
)
#load-if-defined UP-POCKET-POSITION
(defrule
(strategic-number sn-resource-control == 0)
(current-age == castle-age)
(building-type-count stone-wall > 5)
(goal unit-goal knight)
(or
(strategic-number sn-military-level >= 0)
(and
(unit-type-count cavalry-unit-class > 5)
(goal under-attack-goal 0)
)
)
=>
(set-strategic-number sn-resource-control 2)
)
(defrule
(strategic-number sn-resource-control == 0)
(strategic-number sn-current-age >= fc-transit)
(game-time < 1800)
(building-type-count stone-wall > 5)
(goal unit-goal skirmisher)
(building-type-count town-center < 3)
=>
(set-strategic-number sn-resource-control 2)
)
#end-if
(defrule
(strategic-number sn-resource-control == 0)
(current-age == castle-age)
(civilian-population > 90)
(goal unit-goal knight)
(or
(and
(strategic-number sn-military-level >= 0)
(unit-type-count cavalry-unit-class > 19)
)
(population >= eighty-five-percent-pop)
)
=>
(set-strategic-number sn-resource-control 2)
)
#load-if-defined PERSIAN-CIV
(defrule
(strategic-number sn-resource-control == 0)
(strategic-number sn-current-age >= ci-transit)
(goal unit-goal my-unique-unit-line)
(building-type-count castle > 0)
(or
(and
(up-research-status c: my-unique-unit-upgrade < research-pending); ri-elite-war-elephant
(or
(food-amount < 1600)
(gold-amount < 1200)
)
)
(research-available my-unique-unit-upgrade)
)
=>
(set-strategic-number sn-resource-control 2)
;debug (chat-to-player my-player-number "Saving resources for ewe")
)
#end-if
#load-if-not-defined INDIAN-CIV
#load-if-not-defined SARACEN-CIV
#load-if-not-defined TURKISH-CIV
#load-if-not-defined MONGOL-CIV
#load-if-not-defined CHINESE-CIV
(defrule
(strategic-number sn-resource-control == 0)
(strategic-number sn-current-age >= imperial); ci-transit
(goal unit-goal knight)
(unit-type-count knight-line > 16)
(or
(and
(up-research-status c: ri-cavalier == research-pending)
(or
(food-amount < 1300)
(gold-amount < 750)
)
)
(research-available ri-paladin)
)
=>
(set-strategic-number sn-resource-control 2)
;debug (chat-to-player my-player-number "Saving resources for ri-paladin")
)
#end-if
#end-if
#end-if
#end-if
#else
(defrule
(strategic-number sn-resource-control == 0)
(unit-type-count camel-line > 7)
(or
(research-available ri-heavy-camel)
(research-available ri-imperial-camel)
)
(population > eighty-five-percent-pop)
=>
(set-strategic-number sn-resource-control 2)
)
#end-if
#end-if
#end-if
(defrule
(strategic-number sn-resource-control == 0)
(or
(research-available ri-bracer)
(research-available ri-ring-archer-armor)
)
(or
(food-amount < 300)
(gold-amount < 250)
)
=>
(set-strategic-number sn-resource-control 2)
)
(defrule
(goal train-civ-goal ri-crossbow)
(strategic-number sn-resource-control == ri-crossbow)
(up-research-status c: ri-elite-skirmisher == research-pending)
(building-type-count archery-range == 1)
=>
(set-goal train-civ-goal 1)
(set-strategic-number sn-resource-control 0)
)
(defrule
(strategic-number sn-resource-control == 0)
(population > seventy-five-percent-pop)
(unit-type-count scorpion-line > 9)
(or
(research-available ri-heavy-scorpion)
(and
(civ-selected celtic)
(and
(building-type-count castle > 0)
(research-available my-unique-research)
)
)
)
=>
(set-strategic-number sn-resource-control 2)
(set-goal save-wood-goal 1)
)
(defrule
(goal uu-up-goal 1)
(population > eighty-five-percent-pop)
(research-available my-unique-unit-upgrade)
(building-type-count castle > 0)
(or
(or
(unit-type-count female-gold-miner > 0); don't start escrowing when gold income is low
(unit-type-count male-gold-miner > 0)
)
(unit-type-count trade-cart > 5)
)
=>
(set-escrow-percentage food 30)(set-escrow-percentage gold 30)
(set-goal escrow-purpose-goal my-unique-unit-line)
)
#load-if-not-defined AZTEC-CIV ; Jaguars aren't useful in trash wars
#load-if-not-defined BRITON-CIV ; Same as most ranged uu
#load-if-not-defined CHINESE-CIV
#load-if-not-defined MAYAN-CIV
#load-if-not-defined MONGOL-CIV
#load-if-not-defined KOREAN-CIV
(defrule
(goal escrow-purpose-goal my-unique-unit-line)
(unit-type-count female-gold-miner == 0)
(unit-type-count male-gold-miner == 0)
(unit-type-count trade-cart == 0)
=>
(release-escrow food)
(set-escrow-percentage food 0); pile up relic/market gold first, as this will take long
)
(defrule
(or
(and
(goal escrow-purpose-goal my-unique-unit-line)
(or
(escrow-amount food >= max-food-escrow)
(population < max-civ-pop)
)
)
(and
(research-available imperial-age)
(escrow-amount food >= imp-food)
)
)
=>
(set-escrow-percentage food 0)
)
(defrule
(or
(and
(goal escrow-purpose-goal my-unique-unit-line)
(escrow-amount gold >= max-gold-escrow)
)
(and
(research-available imperial-age)
(escrow-amount gold >= imp-gold)
)
)
=>
(set-escrow-percentage food 30)
(set-escrow-percentage gold 0)
)
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
(defrule
(goal escrow-purpose-goal my-unique-unit-line)
(or
(or
(not (research-available my-unique-unit-upgrade))
(building-type-count castle == 0); not included in check above
)
(and
(population < 160)
(goal under-attack-goal 1)
)
)
=>
(set-escrow-percentage food 0)(set-escrow-percentage gold 0)
(release-escrow food)(release-escrow gold)
(set-goal escrow-purpose-goal 0)
)
#load-if-defined SPANISH-CIV
(defrule
(strategic-number sn-resource-control <= 2)
(unit-type-count monastery-class > 12)
(up-research-status c: ri-theocracy >= research-pending)
(research-available ri-inquisition)
(building-type-count castle > 0)
=>
(set-strategic-number sn-resource-control ri-inquisition)
;debug (chat-to-player my-player-number "Saving resources for ri-inquisition")
)
#end-if
#load-if-defined SLAVIC-CIV
(defrule
(strategic-number sn-resource-control <= 2)
(unit-type-count monastery-class > 12)
(or
(strategic-number sn-current-age >= ci-transit)
(goal hostilities-goal 1)
)
(building-type-count castle > 0)
(research-available ri-orthodoxy)
=>
(set-strategic-number sn-resource-control ri-orthodoxy)
;debug (chat-to-player my-player-number "Saving resources for ri-orthodoxy")
)
#end-if
(defrule
(strategic-number sn-resource-control == 0)
(or
(or
(goal unit-goal monk)
(goal ranged-unit-type-goal monk)
)
(players-unit-type-count focus-player war-elephant-line > 12)
)
(unit-type-count-total monk > 5)
(or
(or
(research-available ri-theocracy)
(research-available ri-illumination)
)
(research-available ri-block-printing)
)
=>
(set-strategic-number sn-resource-control 2)
)
(defrule
(current-age == imperial-age)
(unit-type-count monastery-class > 20)
(strategic-number sn-resource-control == 0)
(goal unit-goal monk)
(gold-amount < 300)
(unit-type-count-total trebuchet-set == 0)
(building-type-count castle > 0)
=>
(set-strategic-number sn-resource-control 2)
)
(defrule
(current-age == imperial-age)
(unit-type-count monastery-class > 20)
(goal unit-goal monk)
(wood-amount < 200)
(unit-type-count-total trebuchet-set == 0)
(building-type-count castle > 0)
=>
(set-goal save-wood-goal 1)
)
(defrule
(research-available imperial-age)
(strategic-number sn-resource-control == 0)
(goal unit-goal monk)
(unit-type-count-total monk > 20)
=>
(set-strategic-number sn-resource-control 2)
;debug (chat-to-player my-player-number "Saving resources for imperial-age")
)
(defrule
(food-amount >= 175)
(or
(goal train-civ-goal ri-crossbow)
(and
(food-amount >= 265)
(goal train-civ-goal ri-pikeman)
)
)
=>
(set-goal train-civ-goal 1)
)
#load-if-defined DEATH-MATCH
(defrule
(strategic-number sn-resource-control < 2)
(civilian-population < fourty-percent-pop)
(population >= eighty-five-percent-pop)
(game-time < 1200)
=>
(set-strategic-number sn-resource-control 2)
)
#load-if-defined DARK-AGE-START
(defrule
(strategic-number sn-resource-control > 2)
(food-amount > 2000)
(gold-amount > 2000)
(wood-amount > 2000)
=>
(set-strategic-number sn-resource-control 0); resource control not needed in DM
(set-goal save-wood-goal 0)
)
#end-if
#end-if
#load-if-not-defined WONDER-RACE
(defrule
(research-completed ri-coinage)
(food-amount > 170)
(taunt-detected any-human-ally 38)
=>
(tribute-to-player this-any-ally food 100)
)
(defrule
(building-type-count town-center > 0)
(research-completed ri-coinage)
(wood-amount > 200)
(taunt-detected any-human-ally 38)
=>
(tribute-to-player this-any-ally wood 100)
)
(defrule
(research-completed ri-coinage)
(gold-amount > 150)
(taunt-detected any-human-ally 38)
=>
(tribute-to-player this-any-ally gold 100)
)
(defrule
(research-completed ri-coinage)
(stone-amount > 220)
(taunt-detected any-human-ally 38)
=>
(tribute-to-player this-any-ally stone 100)
)
(defrule
(or
(or
(players-tribute-memory any-computer-ally food == 100)
(players-tribute-memory any-computer-ally food == 200)
)
(players-tribute-memory any-computer-ally gold == 100)
)
(players-population any-computer-ally >= del-civ-pop)
=>
(clear-tribute-memory every-computer food)
(clear-tribute-memory every-computer gold)
(enable-timer tribute-timer 2); some scripts send only 100 of one res, even if they have tons of it, so keep asking if necessary.
)
(defrule
(game-time > 1200)
(building-type-count town-center > 0)
(or
(unit-type-count villager < 15)
(and
(players-civilian-population any-ally > fourty-percent-pop)
(or
(unit-type-count villager < twenty-five-percent-pop)
(players-population any-ally > eighty-five-percent-pop)
)
)
)
(unit-type-count villager < fourty-percent-pop)
(food-amount < 250)
(goal under-attack-goal 0)
=>
(set-goal tribute-goal 3)
)
(defrule
(building-type-count town-center >= tc-level-two)
(players-building-type-count any-ally market > 0)
(game-time > 1800)
(or
(unit-type-count villager < 90)
(strategic-number sn-resource-control == 2)
)
(food-amount < 100)
(gold-amount > 200)
=>
(set-goal tribute-goal 3)
)
(defrule
(building-type-count town-center >= tc-level-two)
(players-building-type-count any-ally market > 0)
(strategic-number sn-resource-control == 2)
(food-amount > 500)
(gold-amount < 200)
=>
(set-goal tribute-goal 5)
)
(defrule
(players-building-type-count any-ally market > 0)
(strategic-number sn-resource-control < 4)
(food-amount > 500)
(gold-amount > 400)
(wood-amount < 150)
=>
(set-goal tribute-goal 4)
)
(defrule
(taunt-detected any-ally 3)
(food-amount > 1000)
(strategic-number sn-resource-control < 1)
(research-completed ri-banking)
(building-type-count market > 0)
(current-age == imperial-age)
=>
(acknowledge-taunt this-any-ally 3)
(tribute-to-player this-any-ally food 400)
(chat-to-player-using-id this-any-ally 22077)
(chat-local-to-self "tribute food"))
(defrule
(taunt-detected any-ally 3)
(food-amount > 300)
(or (research-completed ri-banking)
(food-amount > 500))
(strategic-number sn-resource-control < 1)
(building-type-count market > 0)
=>
(acknowledge-taunt this-any-ally 3)
(tribute-to-player this-any-ally food 100)
(chat-to-player-using-id this-any-ally 22077)
(chat-local-to-self "tribute food"))
(defrule
(taunt-detected any-ally 4)
(wood-amount > 900)
(goal save-wood-goal 0)
(research-completed ri-banking)
(building-type-count market > 0)
=>
(acknowledge-taunt this-any-ally 4)
(tribute-to-player this-any-ally wood 400)
(chat-to-player-using-id this-any-ally 22076)
(chat-local-to-self "tribute wood"))
(defrule
(taunt-detected any-ally 4)
(wood-amount > 300)
(or (goal save-wood-goal 0)
(wood-amount > 1300)); just to be safe
(building-type-count market > 0)
=>
(acknowledge-taunt this-any-ally 4)
(tribute-to-player this-any-ally wood 100)
(chat-to-player-using-id this-any-ally 22076)
(chat-local-to-self "tribute wood"))
(defrule
(taunt-detected any-ally 5)
(gold-amount > 1500)
(research-completed ri-banking)
(building-type-count market > 0)
=>
(acknowledge-taunt this-any-ally 5)
(tribute-to-player this-any-ally gold 400)
(chat-to-player-using-id this-any-ally 22078)
(chat-local-to-self "tribute gold"))
(defrule
(taunt-detected any-ally 5)
(strategic-number sn-resource-control < 1)
(gold-amount > 300)
(or (research-completed ri-banking)
(gold-amount > 800))
(building-type-count market > 0)
=>
(acknowledge-taunt this-any-ally 5)
(tribute-to-player this-any-ally gold 100)
(chat-to-player-using-id this-any-ally 22078)
(chat-local-to-self "tribute gold"))
(defrule
(taunt-detected any-ally 6)
(building-type-count-total town-center > 0)
(or (stone-amount > 750)
(or (building-type-count-total castle >= 4)
(and (players-building-type-count any-ally town-center == 0)
(stone-amount >= 130))))
(building-type-count market > 0)
=>
(acknowledge-taunt this-any-ally 6)
(tribute-to-player this-any-ally stone 100)
(chat-to-player-using-id this-any-ally 22079)
(chat-local-to-self "tribute stone"))
(defrule
(or (taunt-detected any-ally 3)
(or (taunt-detected any-ally 4)
(or (taunt-detected any-ally 5)
(taunt-detected any-ally 6))))
(building-type-count market == 0)
=>
(chat-to-player-using-id this-any-ally 22164)
(acknowledge-taunt this-any-ally 3)
(acknowledge-taunt this-any-ally 4)
(acknowledge-taunt this-any-ally 5)
(acknowledge-taunt this-any-ally 6)
)
(defrule
(or (taunt-detected any-ally 3)
(or (taunt-detected any-ally 4)
(or (taunt-detected any-ally 5)
(taunt-detected any-ally 6))))
=>
(chat-to-allies-using-id 22118); "Alas, I cannot help that at this time."
(acknowledge-taunt this-any-ally 3)
(acknowledge-taunt this-any-ally 4)
(acknowledge-taunt this-any-ally 5)
(acknowledge-taunt this-any-ally 6)
)
(defrule
(up-compare-goal strategy-goal != sling)
(taunt-detected any-ally 130); cooperate with barbie's share resources
(wood-amount < 400)
(gold-amount > 800)
(food-amount > 1000)
=>
(chat-to-allies-using-id 22123)
(acknowledge-taunt this-any-ally 130)
)
(defrule
(up-compare-goal strategy-goal != sling)
(nand
(goal under-attack-goal 1)
(population < 45)
)
(taunt-detected any-ally 130)
(or
(food-amount < 1000)
(or
(wood-amount < 800)
(gold-amount < 700)
)
)
(building-type-count-total town-center > 0)
=>
(chat-to-allies "1")
(acknowledge-taunt this-any-ally 130)
(acknowledge-taunt my-player-number 1)
)
(defrule
(taunt-detected any-ally 130); if we need them, the other rules above would've triggered
=>
(chat-to-allies "2")
(acknowledge-taunt this-any-ally 130)
(acknowledge-taunt my-player-number 2)
)
(defrule
(up-timer-status tribute-timer != timer-running)
(goal tribute-goal 3)
(players-building-type-count any-ally market > 0)
=>
(enable-timer tribute-timer 120); 30
(chat-to-allies-using-id 22122)
)
(defrule
(up-timer-status tribute-timer != timer-running)
(goal tribute-goal 4)
(players-building-type-count any-ally market > 0)
=>
(enable-timer tribute-timer 120); 30
(chat-to-allies-using-id 22123)
)
(defrule
(up-timer-status tribute-timer != timer-running)
(goal tribute-goal 5)
(players-building-type-count any-ally market > 0)
=>
(enable-timer tribute-timer 120); 30
(chat-to-allies-using-id 22124)
)
(defrule
(up-timer-status tribute-timer != timer-running)
(goal tribute-goal 6)
(players-building-type-count any-ally market > 0)
=>
(enable-timer tribute-timer 120); 30
(chat-to-allies-using-id 22125)
)
#end-if ; NOT WONDER-RACE
;********************BASICS ********************
(defrule
(resource-found food)
; (goal buildmill yes)
(building-type-count town-center >= 1)
(game-time >= 120)
(or (unit-type-count-total villager >= 18)
(or (wood-amount >= 200)
(building-type-count-total lumber-camp >= 1)))
(building-type-count-total mill < 1)
(can-build mill)
=>
(set-strategic-number sn-allow-adjacent-dropsites 0)
(build mill)
; (chat-local-to-self "Building emergency mill. 1")
(disable-self))
(defrule
; (goal buildmill yes)
(building-type-count town-center >= 1)
(game-time >= 125)
(military-population >= 1); scout
(or (unit-type-count-total villager >= 18)
(or (wood-amount >= 200)
(building-type-count-total lumber-camp >= 1)))
(building-type-count-total mill < 1)
(can-build mill)
=>
(set-strategic-number sn-allow-adjacent-dropsites 0)
(set-strategic-number sn-mill-max-distance 17)
(build mill)
; (chat-local-to-self "Building emergency mill. 2")
(disable-self))
(defrule
; (goal buildmill yes)
(building-type-count town-center >= 1)
(game-time >= 130)
(military-population <= 0); no scout
(or (unit-type-count-total villager >= 18)
(or (wood-amount >= 200)
(building-type-count-total lumber-camp >= 1)))
(building-type-count-total mill < 1)
(can-build mill)
=>
(set-strategic-number sn-allow-adjacent-dropsites 0)
(set-strategic-number sn-mill-max-distance 8)
(build mill)
; (chat-local-to-self "Building emergency mill. 3")
(disable-self))
(defrule
; (goal buildmill yes)
(building-type-count town-center >= 1)
(game-time >= 150)
(or (unit-type-count-total villager >= 18)
(or (wood-amount >= 200)
(building-type-count-total lumber-camp >= 1)))
(building-type-count-total mill < 1)
(can-build mill)
=>
(set-strategic-number sn-allow-adjacent-dropsites 0)
(set-strategic-number sn-mill-max-distance 8)
(build mill)
; (chat-local-to-self "Building emergency mill. 4")
(disable-self))
(defrule
(strategic-number sn-current-age == dark)
(building-type-count town-center > 0)
(building-type-count-total mill == 0)
(resource-found food)
(or (wood-amount >= 300)
(or
(or
(unit-type-count male-forager > 0)
(unit-type-count female-forager > 0)
)
(and
(death-match-game)
(current-age == dark-age)
)
))
(can-build mill)
=>
(set-strategic-number sn-allow-adjacent-dropsites 0)
(build mill)
)
(defrule
(current-age == dark-age)
(building-type-count town-center > 0)
(building-type-count-total mill == 0); emergency mill for no berries
(game-time > 180)
(or
(unit-type-count-total villager >= 20); some other foood sources available
(and
(strategic-number sn-mill-max-distance > 30)
(building-type-count lumber-camp > 0)
)
)
(or
(wood-amount > 200)
(building-type-count lumber-camp > 0)
)
(can-build mill)
=>
(set-strategic-number sn-allow-adjacent-dropsites 0)
(build mill)
)
#load-if-defined SCANDANAVIA-MAP
(defrule
(building-type-count town-center > 0)
(strategic-number sn-current-age == dark)
(dropsite-min-distance deer-hunting > 8)
(dropsite-min-distance deer-hunting < 38)
(can-build mill)
(building-type-count-total mill < 1)
=>
(set-strategic-number sn-allow-adjacent-dropsites 1); test
(set-strategic-number sn-preferred-mill-placement 1); mill deer
(build mill)
)
#end-if
#load-if-not-defined DEATH-MATCH
(defrule
(building-type-count town-center >= 1); this idea from ER rarely fails
(game-time >= 15); increase lumber camp distance when we still found no wood after 15s
(or ; so the scout has some time to find a forest
(not (resource-found wood))
(building-type-count-total stone-wall > 15); also increase in walled maps, as we may find the forest with the wall
)
(strategic-number sn-mill-max-distance < 30)
=>
(set-strategic-number sn-camp-max-distance 18)
(disable-self)
)
(defrule
(building-type-count town-center >= 1)
(game-time >= 18); and even further when still no wood after 18s
(not (resource-found wood))
(strategic-number sn-mill-max-distance < 30)
=>
(set-strategic-number sn-camp-max-distance 21)
(disable-self)
)
(defrule
(building-type-count-total lumber-camp > 0)
(building-type-count-total stone-wall < 15)
(or (dropsite-min-distance gold > 12)
(building-type-count-total mining-camp > 0))
=>
(set-strategic-number sn-maximum-food-drop-distance 15)
(set-strategic-number sn-camp-max-distance 30)
(set-strategic-number sn-wood-dropsite-distance 3); move wood gatherers from far stragglers to the camp
(disable-self)
)
(defrule
(building-type-count-total lumber-camp > 1)
(building-type-count-total mining-camp == 0)
(dropsite-min-distance gold > 3)
(dropsite-min-distance gold < 12); close gold like in gold rush maps
=>
(set-strategic-number sn-camp-max-distance 12); so only a small camp max distance is required, else the gold will be skipped.
(set-strategic-number sn-wood-dropsite-distance 3)
(disable-self)
)
(defrule
(current-age == dark-age); don't trigger this later when initial gold is gone.
(building-type-count town-center >= 1); mainly a fix for nomad map where gold may be farther away
(building-type-count-total lumber-camp > 0); as the computer doesn't care about resources when placing the initial TC.
(unit-type-count villager >= 24)
(dropsite-min-distance gold > 24)
(dropsite-min-distance gold < 64)
=>
(set-strategic-number sn-camp-max-distance 60)
(disable-self)
)
(defrule
; (up-pending-objects c: lumber-camp < 1)
(game-time > lumber-delay)
(resource-found wood)
(or (dropsite-min-distance wood >= 7)
(or (and (wood-amount >= 300)
(strategic-number sn-wood-gatherer-percentage >= 7))
(or (building-type-count-total mill > 0)
(and (wood-amount > 200)
(strategic-number sn-mill-max-distance > 30)))))
(building-type-count-total lumber-camp == 0)
(can-build lumber-camp)
=>
(set-strategic-number sn-allow-adjacent-dropsites 1)
(build lumber-camp)
)
#end-if ; no DM
#load-if-not-defined DIFFICULTY-EASIEST
#load-if-not-defined DIFFICULTY-EASY
(defrule
(resource-found wood)
(unit-type-count villager >= 20)
(strategic-number sn-minimum-water-body-size-for-dock >= water-mixed)
(dropsite-min-distance wood < 4)
(wood-amount < 160)
(strategic-number sn-current-age == dark)
=>
(up-jump-rule 1)
)
(defrule ;build additional lumber camps
; (up-pending-objects c: lumber-camp < 1)
(resource-found wood)
(unit-type-count villager >= 20)
(or
(building-type-count-total lumber-camp < 2)
(unit-type-count villager >= 45)
)
(or
(building-type-count-total lumber-camp < 3)
(unit-type-count villager >= 60)
)
(building-type-count-total lumber-camp < 5)
(can-build lumber-camp)
=>
(set-strategic-number sn-allow-adjacent-dropsites 1)
(build lumber-camp)
(set-strategic-number sn-dropsite-separation-distance 3)
(set-strategic-number sn-maximum-wood-drop-distance 30)
)
#end-if
#end-if
; Lumber Camp Replacement when either fast when 1st lumber-camp placed really bad or in feudal-age when flushing or after castle-age is available
#load-if-not-defined POST-IMPERIAL-AGE-START
(defrule
(or (goal increase-town-size-goal 0)
(current-age <= feudal-age))
(building-type-count town-center > 0)
(or (and (building-type-count lumber-camp > 0)
(dropsite-min-distance wood > 3))
(and (unit-type-count-total villager >= villager-feudal)
(building-type-count-total lumber-camp == 0))); debug for no placement
(strategic-number sn-camp-max-distance < 35)
(can-build lumber-camp)
=>
(set-strategic-number sn-camp-max-distance 35)
(set-strategic-number sn-dropsite-separation-distance 3)
(chat-to-player my-player-number "bad lumber camp placement!: camp-max-distance 35")
)
(defrule
; (up-pending-objects c: mining-camp == 0)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(or (up-compare-goal strategy-goal != flush)
(building-type-count-total dock > 0))
(resource-found gold)
(strategic-number sn-current-age >= df-transit)
(can-build mining-camp)
(building-type-count-total mining-camp == 0)
=>
(set-strategic-number sn-allow-adjacent-dropsites 0)
(build mining-camp)
)
#end-if ; NOT PIDM
(defrule
; (up-pending-objects c: mining-camp == 0)
(strategic-number sn-current-age >= df-transit)
(resource-found gold)
(goal strategy-goal flush)
(or
(and
(or
(building-type-count-total stable > 0)
(building-type-count-total archery-range > 1)
)
(wood-amount > 135)
)
(and
(goal unit-goal militiaman-line)
(building-type-count-total barracks > 0)
)
)
(can-build mining-camp)
(building-type-count-total mining-camp == 0)
=>
(set-strategic-number sn-allow-adjacent-dropsites 0)
(build mining-camp)
)
(defrule
; (up-pending-objects c: mining-camp == 0)
(strategic-number sn-current-age >= feudal)
(resource-found gold)
(strategic-number sn-minimum-water-body-size-for-dock > water-mixed)
(building-type-count-total blacksmith > 0)
(building-type-count-total market > 0)
(can-build mining-camp)
(building-type-count-total mining-camp == 0)
=>
(set-strategic-number sn-allow-adjacent-dropsites 0)
(build mining-camp)
)
(defrule
(up-pending-objects c: mining-camp == 0)
(resource-found gold)
(or
(or
(unit-type-count-total 229 >= 1); dead miners detected
(unit-type-count-total 221 >= 1)
)
(strategic-number sn-gold-gatherer-percentage > 30)
)
(unit-type-count-total villager > 33)
(can-build mining-camp)
(building-type-count-total mining-camp < 2)
=>
(set-strategic-number sn-allow-adjacent-dropsites 0)
(build mining-camp)
(set-strategic-number sn-maximum-stone-drop-distance 40)
(set-strategic-number sn-stone-dropsite-distance 40)
(set-strategic-number sn-maximum-gold-drop-distance 3)
(set-strategic-number sn-gold-dropsite-distance 3)
)
(defrule
(up-pending-objects c: lumber-camp < 1)
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(resource-found wood)
(unit-type-count 979 > 0); lumberjack
(building-type-count-total lumber-camp < 1)
(or
(unit-type-count villager > 14)
(strategic-number sn-current-age > dark)
)
(wood-amount > 200)
(can-build lumber-camp)
=>
(set-strategic-number sn-allow-adjacent-dropsites 1)
(build lumber-camp)
)
(defrule
(up-pending-objects c: mining-camp < 1)
(resource-found gold)
(dropsite-min-distance gold > 5);rebuild bad camps
(dropsite-min-distance gold < 480)
(building-type-count mining-camp > 0)
(can-build mining-camp)
(or
(building-type-count mining-camp < 5)
(and
(strategic-number sn-camp-max-distance > 45)
(dropsite-min-distance gold > 13); don't spam camps if it's in an unreachable spot
)
)
(building-type-count-total mining-camp < 15)
=>
(set-strategic-number sn-allow-adjacent-dropsites 0)
(build mining-camp)
(set-strategic-number sn-dropsite-separation-distance 6)
)
(defrule
(up-pending-objects c: mining-camp < 1)
(resource-found stone)
(dropsite-min-distance stone > 5)
(dropsite-min-distance stone < 480)
(building-type-count mining-camp > 1)
(or
(building-type-count mining-camp < 4)
(and
(strategic-number sn-camp-max-distance > 45)
(dropsite-min-distance stone > 13)
)
)
(can-build mining-camp)
(strategic-number sn-stone-gatherer-percentage > 0)
(building-type-count-total mining-camp < 15)
=>
(set-strategic-number sn-allow-adjacent-dropsites 0)
(build mining-camp)
(set-strategic-number sn-dropsite-separation-distance 6)
)
(defrule
(up-pending-objects c: mining-camp < 1)
(wood-amount > 200)
(dropsite-min-distance gold > 1); build subsequent mining camps to avoid crowd
(dropsite-min-distance gold < 480); check for gold still on the map
(civilian-population > 80)
(game-time < 2400)
(can-build mining-camp)
(building-type-count-total mining-camp < 5)
=>
(set-strategic-number sn-allow-adjacent-dropsites 0)
(set-strategic-number sn-camp-max-distance 45)
(set-strategic-number sn-dropsite-separation-distance 12)
(build mining-camp)
)
#load-if-not-defined WONDER-RACE
(defrule
(up-pending-objects c: mining-camp < 1)
(strategic-number sn-resource-control != battering-ram)
(strategic-number sn-resource-control != ri-elite-skirmisher)
(or
(or
(up-research-status c: ri-bow-saw >= research-pending)
(building-type-count town-center >= tc-level-three)
)
(or
(strategic-number sn-stone-gatherer-percentage > 0)
(wood-amount > 210)
)
)
(stone-amount < 100)
(current-age-time > 90)
(building-type-count-total mining-camp < 4)
(dropsite-min-distance stone > 4)
(can-build mining-camp)
=>
(set-strategic-number sn-allow-adjacent-dropsites 0)
(build mining-camp)
)
#end-if
#load-if-defined SARACEN-CIV
(defrule
(up-pending-objects c: mining-camp < 1)
(strategic-number sn-resource-control <= 2)
(building-type-count-total market > 0)
(building-type-count-total blacksmith > 0)
(commodity-selling-price stone > 100)
(building-type-count-total mining-camp < 4)
(or
(and
(building-type-count-total mining-camp < 2)
(dropsite-min-distance stone > 5)
)
(and
(current-age == castle-age)
(building-type-count stable > 1)
)
)
(can-build mining-camp)
=>
(set-strategic-number sn-allow-adjacent-dropsites 0)
(build mining-camp)
)
#end-if
(defrule
(up-pending-objects c: mining-camp < 1)
(or
(goal unit-goal my-unique-unit-line)
(goal unit-goal wonder)
)
(building-type-count-total blacksmith > 0)
(building-type-count-total mining-camp == 1)
(dropsite-min-distance stone > 3)
(can-build mining-camp)
=>
(set-strategic-number sn-allow-adjacent-dropsites 0)
(build mining-camp)
)
#load-if-not-defined DEATH-MATCH
(defrule
(or
(game-time > 2100)
(dropsite-min-distance wood > 15)
)
(strategic-number sn-camp-max-distance < 60)
=>
(set-strategic-number sn-camp-max-distance 60)
)
(defrule
(game-time > 2700)
(goal ffa-game-goal -1)
(goal increase-town-size-goal 0)
(strategic-number sn-camp-max-distance < 90)
=>
(set-strategic-number sn-camp-max-distance 90)
)
#end-if
(defrule
(cc-players-unit-type-count 0 tree-class < heavy-wood)
(or
(game-time > 3600); 60min
(death-match-game)
)
(or
(goal ffa-game-goal -1)
(game-time > 5400); 90 min
)
(game-time > 900)
(goal increase-town-size-goal 0)
(strategic-number sn-camp-max-distance < 144)
=>
(set-strategic-number sn-camp-max-distance 144)
)
#load-if-not-defined DIFFICULTY-EASIEST
#load-if-not-defined DIFFICULTY-EASY
(defrule
(up-pending-objects c: lumber-camp < 1)
(dropsite-min-distance wood < 480)
(dropsite-min-distance wood > 3)
(strategic-number sn-current-age >= fc-transit)
(can-build lumber-camp)
; bug (cc-players-unit-type-count 0 tree-class > 25)
=>
(set-strategic-number sn-allow-adjacent-dropsites 1)
(build lumber-camp)
(set-strategic-number sn-dropsite-separation-distance 6)
)
(defrule
(up-pending-objects c: lumber-camp < 1)
(unit-type-count villager >= 75)
(can-build lumber-camp)
(dropsite-min-distance wood >= 0)
(dropsite-min-distance wood < 480)
(timer-triggered lumber-timer)
; bug (cc-players-unit-type-count 0 tree-class > 25)
=>
(set-strategic-number sn-allow-adjacent-dropsites 1)
(build lumber-camp)
(enable-timer lumber-timer 180)
(set-strategic-number sn-dropsite-separation-distance 4)
)
(defrule
(up-pending-objects c: lumber-camp < 1)
(or
(unit-type-count-total 219 >= 1)
(unit-type-count-total 228 >= 1)
)
(can-build lumber-camp)
(dropsite-min-distance wood > 1)
(dropsite-min-distance wood < 480)
(timer-triggered lumber-timer)
; bug (cc-players-unit-type-count 0 tree-class > 25)
=>
(set-strategic-number sn-allow-adjacent-dropsites 1)
(build lumber-camp)
(enable-timer lumber-timer 120)
(set-strategic-number sn-dropsite-separation-distance 12)
)
(defrule
(up-pending-objects c: lumber-camp == 0)
(resource-found wood)
(unit-type-count-total villager >= 10)
(dropsite-min-distance wood > 5)
(dropsite-min-distance wood < 255)
; bug (cc-players-unit-type-count 0 tree-class > 25)
(building-type-count-total mill >= 1)
(building-type-count-total town-center >= 1)
; (strategic-number sn-camp-max-distance < 30)
(strategic-number sn-camp-max-distance <= 476)
(can-build lumber-camp)
=>
(set-strategic-number sn-allow-adjacent-dropsites 1)
; (set-strategic-number sn-camp-max-distance 30)
(up-modify-sn sn-camp-max-distance c:+ 4)
(chat-local-to-self "Wood far away: New camp.")
(build lumber-camp))
(defrule
(building-type-count-total town-center == 1)
(or
(goal strategy-goal flush)
(building-type-count farm > 18)
)
(building-type-count farm > 15)
(building-type-count-total mill < 2)
(can-build mill)
=>
(set-strategic-number sn-allow-adjacent-dropsites 0)
(set-strategic-number sn-mill-max-distance 17)
(set-strategic-number sn-dropsite-separation-distance 10)
(build mill)
)
(defrule
(building-type-count farm > 24)
(or
(building-type-count farm > 27)
(building-type-count-total town-center == 1)
)
(building-type-count-total mill < 3)
(can-build mill)
=>
(set-strategic-number sn-allow-adjacent-dropsites 0)
(set-strategic-number sn-mill-max-distance 20)
(set-strategic-number sn-dropsite-separation-distance 10)
(set-strategic-number sn-preferred-mill-placement 0)
(build mill)
)
(defrule
(building-type-count farm > 33)
(or
(building-type-count-total mill < 4)
(building-type-count farm > 45)
)
(building-type-count-total mill < 5)
(can-build mill)
=>
(set-strategic-number sn-allow-adjacent-dropsites 0)
(set-strategic-number sn-mill-max-distance 23)
(set-strategic-number sn-dropsite-separation-distance 10)
(build mill)
)
(defrule
(up-pending-objects c: lumber-camp < 1)
(resource-found wood)
(or (unit-type-count-total 219 >= 1)
(unit-type-count-total 228 >= 1))
(or (building-type-count-total blacksmith > 0)
(strategic-number sn-current-age >= fc-transit))
(game-time < 1800)
(can-build lumber-camp)
(building-type-count-total lumber-camp < 5)
(strategic-number sn-camp-max-distance <= 35)
=>
(set-strategic-number sn-allow-adjacent-dropsites 1)
(build lumber-camp)
(set-strategic-number sn-camp-max-distance 35)
(set-strategic-number sn-dropsite-separation-distance 10)
(chat-to-player my-player-number "Dead Lumberjacks found, relocate camp!")
)
#end-if
#end-if
#load-if-not-defined DIFFICULTY-MODERATE
#load-if-not-defined DIFFICULTY-HARD
#load-if-not-defined DIFFICULTY-HARDEST
(defrule ;build additional lumber camps
; (up-pending-objects c: lumber-camp < 1)
(resource-found wood)
(unit-type-count villager >= 15)
(building-type-count-total lumber-camp < 2)
(building-type-count-total mill > 0)
(can-build lumber-camp)
=>
(set-strategic-number sn-allow-adjacent-dropsites 1)
(build lumber-camp)
(set-strategic-number sn-dropsite-separation-distance 3)
(set-strategic-number sn-maximum-wood-drop-distance 30)
)
(defrule
(up-pending-objects c: lumber-camp < 1)
(dropsite-min-distance wood < 480)
(dropsite-min-distance wood > 7); on low difficulty only rebuild really bad camps
(timer-triggered lumber-timer)
(can-build lumber-camp)
; bug (cc-players-unit-type-count 0 tree-class > 25)
=>
(set-strategic-number sn-allow-adjacent-dropsites 1)
(build lumber-camp)
(enable-timer lumber-timer 190)
)
#end-if
#end-if
#end-if
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(or
(strategic-number sn-current-age == dark)
(civ-selected japanese)
)
(or
(unit-type-count male-hunter >= 1)
(unit-type-count female-hunter >= 1)
)
(can-build mill)
(building-type-count-total mill >= 1)
(building-type-count-total lumber-camp >= 1)
=>
(set-strategic-number sn-allow-adjacent-dropsites 1); test
(set-strategic-number sn-mill-max-distance 30)
(set-strategic-number sn-preferred-mill-placement 1); mill deer
(build mill)
(disable-self)
)
#load-if-not-defined DEATH-MATCH
(defrule
(strategic-number sn-current-age == dark)
(or (unit-type-count villager > 13)
(wood-amount >= 130))
(or (unit-type-count villager < 20)
(building-type-count-total lumber-camp > 1))
(or (unit-type-count villager < 30)
(wood-amount >= 130))
(idle-farm-count < 1)
(building-type-count-total lumber-camp > 0)
=>
(set-goal farm-goal 1)
)
(defrule
(strategic-number sn-current-age == df-transit)
(wood-amount >= 385);175stable+150bs+60farm
(idle-farm-count < 1)
(building-type-count-total lumber-camp > 0)
=>
(set-goal farm-goal 1)
)
(defrule
(strategic-number sn-current-age == feudal)
(building-type-count-total market >= 1)
(or (building-type-count-total blacksmith >= 1)
(wood-amount >= 210)); test
(wood-amount >= 120)
(idle-farm-count < 1)
(building-type-count-total lumber-camp > 0)
=>
(set-goal farm-goal 1)
)
#end-if ; NOT DM
#load-if-not-defined WONDER-RACE
(defrule
(goal strategy-goal sling)
(strategic-number sn-current-age >= feudal)
(or (not (research-available ri-horse-collar))
(research-completed ri-horse-collar)); just to be sure
(idle-farm-count < 2)
=>
(set-goal farm-goal 1)
)
(defrule
(goal strategy-goal flush)
(strategic-number sn-current-age == feudal)
(or (or (and (building-type-count-total archery-range > 1)
(building-type-count-total blacksmith > 0))
(goal unit-goal militiaman-line))
(building-type-count-total stable > 0))
(building-type-count-total archery-range > 0)
=>
(set-goal farm-goal 1)
)
(defrule
(or (goal strategy-goal flush)
(food-amount < 400))
(strategic-number sn-current-age == feudal)
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
(up-compare-goal position-goal == flank); hm
(idle-farm-count < 1)
(wood-amount > 150)
=>
(set-goal strategy-goal flush)
(set-goal farm-goal 1)
)
(defrule
(strategic-number sn-current-age == fc-transit)
(not (research-available ri-horse-collar))
(or (or (building-type-count-total archery-range > 2)
(building-type-count-total stable > 1))
(and (goal unit-goal eagle-warrior)
(building-type-count-total barracks > 0)))
(idle-farm-count < 2)
=>
(set-goal farm-goal 1)
)
(defrule
(strategic-number sn-current-age == fc-transit)
(up-research-status c: ri-horse-collar >= research-pending)
(building-type-count-total farm < farm-count)
(nor (or (goal unit-goal my-unique-unit-line); delay farms until castle age to have more workers for the castle with uu startegy
(goal control-goal shot)); get food from ally
(or (goal unit-goal knight); use rule above
(goal unit-goal default-ranged)))
(idle-farm-count < 2)
=>
(set-goal farm-goal 1)
)
#load-if-not-defined SARACEN-CIV ;buy food with them instead of farming
(defrule
(strategic-number sn-current-age == feudal)
(or (and (goal strategy-goal rush)
(building-type-count-total blacksmith > 0))
(game-time > 1200))
(not (goal unit-goal my-unique-unit-line))
(idle-farm-count < 2)
=>
(set-goal farm-goal 1)
)
(defrule
(strategic-number sn-current-age == fc-transit)
(building-type-count-total blacksmith > 0)
(or (or (goal unit-goal mix)
(goal unit-goal skirmisher))
(and (goal strategy-goal boom)
(up-research-status c: ri-horse-collar >= research-pending)))
(building-type-count-total farm < 14)
=>
(set-goal farm-goal 1)
)
(defrule
(building-type-count town-center >= 1)
(strategic-number sn-current-age >= castle)
(or (idle-farm-count < 2)
(or (building-type-count-total town-center >= tc-level-three)
(and (building-type-count-total town-center >= tc-level-two)
(or (wood-amount > 335); 275 for 3rd TC + 60
(goal strategy-goal boom))))); build as many farms as possible after 2nd TC
=>
(set-goal farm-goal 1)
)
#else
(defrule
(building-type-count town-center >= 1)
(strategic-number sn-current-age >= castle)
(or (idle-farm-count < 2)
(building-type-count-total town-center >= tc-level-three))
(or (or (commodity-buying-price food > 130)
(commodity-selling-price stone < 100))
(or (or (goal strategy-goal boom)
(building-type-count farm < 8))
(game-time > 1800)))
=>
(set-goal farm-goal 1)
)
#end-if ;SARACEN-CIV
#end-if ;no WONDER-RACE
(defrule
(or (and (strategic-number sn-current-age > feudal)
(building-type-count-total farm < 8))
(and (building-type-count-total lumber-camp > 1)
(building-type-count-total farm < 4))); test
(food-amount < 50)
(idle-farm-count <= 0)
(building-type-count-total lumber-camp > 0)
=>
(set-goal farm-goal 1))
(defrule
(strategic-number current-age == castle)
(or (goal strategy-goal fast-imp)
(goal strategy-goal boom))
(not (research-available imperial-age))
(wood-amount < 200)
(food-amount > 400)
(gold-amount > 400)
=>
(set-goal farm-goal 0)
)
#load-if-not-defined TURKISH-CIV
(defrule
(strategic-number current-age >= ci-transit)
(goal unit-goal gunpowder-class)
(building-type-count-total university == 0)
(not (research-completed ri-chemistry))
(wood-amount < 200)
=>
(set-goal farm-goal 0)
)
#end-if
(defrule
(or (unit-type-count female-forager > 0)
(unit-type-count male-forager > 0))
(building-type-count mill == 1)
(sheep-and-forage-too-far); save for 2nd mill on maps with more berries, eg. yucatan
(wood-amount < 100)
=>
(set-goal farm-goal 0)
)
(defrule
(goal farm-goal 1)
(current-age == dark-age)
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
(or (wood-amount < 210); place farms only if still enough wood left for dock
(and (building-type-count-total dock > 0)
(wood-amount < 135)))
=>
(set-goal farm-goal 0)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
(or (and (strategic-number sn-current-age == df-transit)
(or (unit-type-count male-hunter > 0)
(unit-type-count female-hunter > 0)))
(or (and (current-age == feudal-age)
(up-compare-goal strategy-goal != flush))
(and (current-age >= castle-age)
(idle-farm-count > 2))))
=>
(set-goal farm-goal 0)
)
(defrule
(strategic-number sn-current-age == df-transit)
(wood-amount < 435); feudal buildings + (wheelbarrow) + farm
(or (building-type-count farm >= 4)
(idle-farm-count >= 1)); probably not necessary, but meh
(up-compare-goal farm-goal != 0)
=>
(set-goal farm-goal 0)
)
(defrule; esp for 'easiest' difficulty with barely any woodcutters
(strategic-number sn-current-age == feudal)
(building-type-count-total blacksmith < 1)
(wood-amount < 185); 150/160
(or (building-type-count farm >= 4)
(idle-farm-count >= 1)); probably not necessary, but meh
(up-compare-goal farm-goal != 0)
=>
(set-goal farm-goal 0)
)
#load-if-defined POST-IMPERIAL-AGE-START
(defrule
(game-time < 480)
(or (death-match-game)
(game-time < 300))
=>
(set-goal farm-goal 0)
)
#end-if
(defrule
(strategic-number sn-current-age == dark)
(or (or (map-type yucatan)
(and (building-type-count-total farm > 5)
(idle-farm-count > 0)))
(and (and (dropsite-min-distance deer-hunting > 15); deer found but not very close => save for hunting mill
(dropsite-min-distance deer-hunting < 32))
(unit-type-count-total villager > 22)))
(wood-amount < 120); sometimes there was still no hunting
=>
(set-goal farm-goal 0)
)
(defrule
(or (and (strategic-number sn-minimum-water-body-size-for-dock >= water-mixed)
(and (current-age == dark-age)
(wood-amount < 210))); place farms only if still enough wood left for dock
(wood-amount < farm-wood))
(goal farm-goal 1)
=>
(set-goal farm-goal 0)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock >= water-mixed)
(strategic-number sn-current-age == dark)
(wood-amount >= 250); high wood because dock was delayed for long
(goal farm-goal 1)
=>
(set-goal farm-goal 2); allow placing many farms, probably failed dock placement
)
(defrule
(strategic-number sn-current-age == df-transit)
(unit-type-count villager >= 30)
(unit-type-count villager > dark-age-villager)
(building-type-count-total farm < 12)
(or (building-type-count-total barracks > 0)
(civ-selected saracen))
(or (wood-amount >= 385); feudal buildings + farm
(food-amount < 400))
(or (goal strategy-goal rush)
(goal strategy-goal boom))
(idle-farm-count < 1)
(food-amount < 600)
=>
(set-goal farm-goal 1)
)
(defrule
(goal farm-goal 1)
(idle-farm-count > 2)
=>
(set-goal farm-goal 0)
)
(defrule
(goal farm-goal 1)
(or (and (building-type-count-total monastery > 0)
(building-type-count-total town-center >= tc-level-three))
(and (wood-amount > 120)
(and (building-type-count-total stable > 1)
(or (goal control-goal aggressive-rush)
(building-type-count town-center >= tc-level-two)))))
=>
(set-goal farm-goal 2)
)
(defrule
(or (strategic-number sn-current-age == dark)
(and (and (strategic-number sn-current-age == df-transit)
(wood-amount >= 435)); feudal buildings + (wheelbarrow) + farm
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)))
(wood-amount >= 130)
(or (and (unit-type-count villager > 20)
(building-type-count-total lumber-camp > 1))
(strategic-number sn-minimum-water-body-size-for-dock >= water-mixed)); fix if no docks could be placed
(can-build farm)
(goal farm-goal 1)
=>
(set-goal farm-goal 2)
)
(defrule
(wood-amount > 200)
(strategic-number sn-current-age == feudal)
(goal strategy-goal flush)
(current-age-time > 180); don't spend all wood into farms at the start of the age
(can-build farm)
(goal farm-goal 1)
=>
(set-goal farm-goal 2)
)
#load-if-not-defined WONDER-RACE
#load-if-not-defined POPULATION-CAP-25
(defrule
(strategic-number sn-minimum-water-body-size-for-dock == water-mixed)
(players-unit-type-count every-enemy longboat-line == 0)
(players-unit-type-count every-enemy galley-line == 0)
(players-unit-type-count every-enemy fire-ship-line == 0)
(building-type-count-total dock > 0)
=>
(up-jump-rule 5)
)
(defrule
(goal position-goal flank)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(building-type-count barracks < 3)
(building-type-count archery-range < 1)
(building-type-count stable < 1)
(building-type-count castle < 1)
(building-type-count siege-workshop < 2)
(building-type-count monastery < 2)
(wood-amount < 250)
(players-building-type-count target-player dock < 3)
(strategic-number sn-current-age < ci-transit)
(building-type-count-total dock >= 1); !
=>
(up-jump-rule 4))
(defrule
(goal save-wood-goal 0)
(goal enemy-boats-goal 1)
(building-type-count-total blacksmith > 0)
(building-type-count-total dock < 5)
(or (stone-amount < 200)
(building-type-count-total dock < 1))
(or (building-type-count-total dock < 2)
(civilian-population > 60))
(or (building-type-count-total dock < 4)
(civilian-population > 80))
(can-build dock)
=>
(build dock)
)
(defrule
(goal save-wood-goal 0)
(strategic-number sn-current-age == dark)
(strategic-number sn-minimum-water-body-size-for-dock >= water-mixed)
(building-type-count-total lumber-camp > 0); fish boom instead of farming is better with UP
(building-type-count-total mill > 0)
(building-type-count-total dock < 2)
(or (building-type-count-total dock < 1)
(and (unit-type-count-total villager > 28); high villager => low food
(food-amount < 400))); probably stupid stuff happened like fishing ship going to the exact opposite side to fish (rarely)
(can-build dock)
=>
(build dock)
)
(defrule
(strategic-number sn-current-age < fc-transit)
(strategic-number sn-current-age >= df-transit)
(strategic-number sn-minimum-water-body-size-for-dock >= water-mixed)
(goal save-wood-goal 0)
(goal enemy-boats-goal 1)
(wood-amount > 400)
(food-amount < 550); less food to even place a blacksmith, mainly on poor maps with bugged fishing near mill.
(can-build dock)
(building-type-count-total dock < 2)
=>
(build dock)
)
(defrule
(strategic-number sn-current-age >= df-transit)
(or (strategic-number sn-minimum-water-body-size-for-dock == water-islands)
(or (players-unit-type-count any-enemy galley-line > 0)
(players-unit-type-count any-enemy fire-ship-line > 0)))
(goal save-wood-goal 0)
(building-type-count-total dock < 3)
(or (goal strategy-goal flush)
(building-type-count-total blacksmith > 0))
(can-build dock)
=>
(build dock)
)
#end-if
(defrule
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
(or (building-type-count-total blacksmith > 0)
(starting-age == post-imperial-age))
(building-type-count-total dock < 9)
(or (building-type-count-total dock < 3)
(building-type-count-total town-center >= tc-level-two))
(or (building-type-count-total dock < 4)
(or (civilian-population > 80)
(death-match-game)))
(can-build dock)
=>
(build dock)
)
(defrule
(or (and (goal control-goal aggressive-rush)
(goal unit-goal knight))
(goal unit-goal skirmisher))
=>
(up-jump-rule 1)
)
(defrule
(current-age-time < 300)
(current-age == castle-age)
(building-type-count monastery == 1)
(strategic-number sn-resource-control <= 2)
(unit-type-count-total monk == 0)
(unit-type-count-total 134 == 0); dead monk
(unit-type-count-total 286 == 0); monk with relic
(building-type-count-total market == 0)
(cc-players-unit-type-count 0 relic > 0)
(gold-amount < 100)
=>
(set-strategic-number sn-resource-control monk)
;debug (chat-to-player my-player-number "Saving resources for monk")
)
(defrule
(current-age-time < 300)
(building-type-count monastery == 1)
(strategic-number sn-resource-control <= 2)
(unit-type-count-total monk == 0)
(unit-type-count-total 134 == 0); dead monk
(goal control-goal aggressive-rush)
(goal unit-goal knight)
(or
(strategic-number sn-cavalry-threat > 0); still get a monk if enemy is krushing, as they're good vs cavalry
(goal enemy-goal skirmisher); enemy spam trash so it's not likely we're going to attack quick
)
(cc-players-unit-type-count 0 relic > 0)
(gold-amount < 100)
=>
(set-strategic-number sn-resource-control monk)
;debug (chat-to-player my-player-number "Saving resources for monk")
)
(defrule
(strategic-number sn-resource-control == monk)
(or
(and
(unit-type-count female-gold-miner == 0)
(unit-type-count male-gold-miner == 0)
)
(and
(or
(town-under-attack)
(strategic-number sn-military-level < 0)
)
(strategic-number sn-military-level < 1)
)
)
=>
(set-strategic-number sn-resource-control 0)
)
(defrule
(current-age >= feudal-age); test
(strategic-number sn-camp-max-distance < 30)
=>
(set-strategic-number sn-camp-max-distance 30))
(defrule
(or (game-time > 1640)
(building-type-count-total town-center >= 3))
(or (game-time > 1200)
(and (goal under-attack-goal 0)
(strategic-number sn-military-level >= 1)))
(strategic-number sn-camp-max-distance < 40)
=>
(set-strategic-number sn-camp-max-distance 40))
(defrule
(or (game-time > 3000)
(and (game-time > 2100)
(strategic-number sn-military-level >= 2)))
(strategic-number sn-military-level >= 0)
(strategic-number sn-camp-max-distance < 70)
=>
(set-strategic-number sn-camp-max-distance 70))
(defrule
(game-time > 3150)
(or (game-time > 7800)
(or (strategic-number sn-military-level >= 2)
(up-compare-goal attack-goal >= 1)))
(or (population >= del-civ-pop)
(strategic-number sn-current-age >= imperial))
(strategic-number sn-camp-max-distance < 100)
=>
(set-strategic-number sn-camp-max-distance 100))
(defrule
(game-time > 3600)
(or (game-time > 12600)
(or (strategic-number sn-military-level >= 3)
(up-compare-goal attack-goal >= 1)))
(population >= del-civ-pop)
(strategic-number sn-camp-max-distance < 255)
=>
(set-strategic-number sn-camp-max-distance 255))
(defrule
(game-time > 7200)
(or (game-time > 18000)
(or (strategic-number sn-military-level >= 3)
(up-compare-goal attack-goal >= 1)))
(population >= del-civ-pop)
(strategic-number sn-camp-max-distance < 480)
=>
(set-strategic-number sn-camp-max-distance 480))
(defrule
(or (game-time > 1320)
(and (game-time > 1050)
(strategic-number sn-military-level >= 1)))
(or (strategic-number sn-maximum-wood-drop-distance < 22)
(strategic-number sn-maximum-food-drop-distance < 22))
=>
;extend walking distances
(set-strategic-number sn-maximum-wood-drop-distance 22)
(set-strategic-number sn-maximum-food-drop-distance 22)
(set-strategic-number sn-maximum-hunt-drop-distance 24)
(set-strategic-number sn-maximum-gold-drop-distance 10)
(set-strategic-number sn-maximum-stone-drop-distance 14))
(defrule
(or (game-time > 3000)
(and (game-time > 2400)
(strategic-number sn-military-level >= 1)))
(or (strategic-number sn-maximum-wood-drop-distance < 25)
(strategic-number sn-maximum-food-drop-distance < 25))
=>
(set-strategic-number sn-maximum-wood-drop-distance 25)
(set-strategic-number sn-maximum-food-drop-distance 25)
(set-strategic-number sn-maximum-hunt-drop-distance 25)
(set-strategic-number sn-maximum-gold-drop-distance 11)
(set-strategic-number sn-maximum-stone-drop-distance 15))
(defrule
(or (game-time > 3900)
(and (game-time > 3300)
(strategic-number sn-military-level >= 1)))
(or (strategic-number sn-maximum-wood-drop-distance < 30)
(strategic-number sn-maximum-food-drop-distance < 30))
=>
(set-strategic-number sn-maximum-wood-drop-distance 30)
(set-strategic-number sn-maximum-food-drop-distance 30)
(set-strategic-number sn-maximum-hunt-drop-distance 26)
(set-strategic-number sn-maximum-gold-drop-distance 13)
(set-strategic-number sn-maximum-stone-drop-distance 16))
(defrule
(or (game-time > 5100)
(and (game-time > 4500)
(strategic-number sn-military-level >= 2)))
(or (strategic-number sn-maximum-wood-drop-distance < 35)
(strategic-number sn-maximum-food-drop-distance < 35))
=>
(set-strategic-number sn-maximum-wood-drop-distance 35)
(set-strategic-number sn-maximum-food-drop-distance 35)
(set-strategic-number sn-maximum-hunt-drop-distance 27)
(set-strategic-number sn-maximum-gold-drop-distance 16)
(set-strategic-number sn-maximum-stone-drop-distance 18))
(defrule
(or (game-time > 7800)
(and (game-time > 7200)
(strategic-number sn-military-level >= 2)))
(or (strategic-number sn-maximum-wood-drop-distance < 40)
(strategic-number sn-maximum-food-drop-distance < 40))
=>
(set-strategic-number sn-maximum-wood-drop-distance 40)
(set-strategic-number sn-maximum-food-drop-distance 40)
(set-strategic-number sn-maximum-hunt-drop-distance 28)
(set-strategic-number sn-maximum-gold-drop-distance 18)
(set-strategic-number sn-maximum-stone-drop-distance 19))
(defrule
(or (game-time > 10200)
(and (game-time > 9600)
(strategic-number sn-military-level >= 2)))
(or (strategic-number sn-maximum-wood-drop-distance < 60)
(strategic-number sn-maximum-food-drop-distance < 50))
=>
(set-strategic-number sn-maximum-wood-drop-distance 60)
(set-strategic-number sn-maximum-food-drop-distance 50)
(set-strategic-number sn-maximum-hunt-drop-distance 30)
(set-strategic-number sn-maximum-gold-drop-distance 22)
(set-strategic-number sn-maximum-stone-drop-distance 22))
(defrule
(or (game-time > 12600)
(and (game-time > 12000)
(strategic-number sn-military-level >= 2)))
(or (strategic-number sn-maximum-wood-drop-distance < 255)
(strategic-number sn-maximum-food-drop-distance < 60))
=>
(set-strategic-number sn-maximum-wood-drop-distance 255)
(set-strategic-number sn-maximum-food-drop-distance 60)
(set-strategic-number sn-maximum-hunt-drop-distance 60)
(set-strategic-number sn-maximum-gold-drop-distance 25)
(set-strategic-number sn-maximum-stone-drop-distance 25))
(defrule
(or (game-time > 18000)
(and (game-time > 14400)
(strategic-number sn-military-level >= 3)))
(or (strategic-number sn-maximum-wood-drop-distance < 480)
(strategic-number sn-maximum-food-drop-distance < 75))
=>
(set-strategic-number sn-maximum-wood-drop-distance 480)
(set-strategic-number sn-maximum-food-drop-distance 75)
(set-strategic-number sn-maximum-hunt-drop-distance 75)
(set-strategic-number sn-maximum-gold-drop-distance 40)
(set-strategic-number sn-maximum-stone-drop-distance 40))
; ********** RESEARCH **********
(defrule
(or
(strategic-number sn-resource-control <= 2)
(goal train-civ-goal ri-chain-barding)
)
(or
(unit-type-count cavalry-unit-class > mid-min-number-upgrade)
(and
(or
(civ-selected saracen)
(goal control-goal shot)
)
(goal unit-goal knight)
)
)
(can-research-with-escrow ri-chain-barding)
=>
(release-escrow food)(release-escrow gold)
(research ri-chain-barding)
)
(defrule
(strategic-number sn-resource-control <= 2)
(can-research ri-bow-saw)
(goal train-civ-goal 1)
(or (goal position-goal pocket)
(or (current-age-time > 120)
(or (goal unit-goal my-unique-unit-line)
(or (goal unit-goal skirmisher)
(unit-type-count-total villager >= 55)))))
(up-compare-goal strategy-goal != fast-imp)
; test (building-type-count-total monastery > 0)
=>
(research ri-bow-saw)
)
(defrule
(strategic-number sn-resource-control <= 2)
(can-research ri-bow-saw)
(goal train-civ-goal 1)
(or (and (goal strategy-goal fast-imp)
(or (strategic-number sn-current-age >= ci-transit)
(unit-type-count villager > 40)))
(goal strategy-goal boom))
=>
(research ri-bow-saw)
)
(defrule
(strategic-number sn-resource-control <= 2)
(goal train-civ-goal 1)
(or
(or
(goal position-goal pocket)
(goal strategy-goal boom)
)
(or
(current-age-time > 120)
(goal unit-goal my-unique-unit-line)
)
)
(nand
(goal unit-goal default-ranged)
(research-available ri-bodkin-arrow)
)
(can-research ri-heavy-plow)
=>
(research ri-heavy-plow)
)
(defrule
(nand
(research-available ri-war-galley)
(civ-selected viking)
)
(warboat-count > 12)
(goal enemy-boats-goal 1)
(or
(strategic-number sn-resource-control < 2)
(players-unit-type-count any-enemy galley-line > 0)
)
(can-research ri-careening)
=>
(research ri-careening)
)
(defrule
(or
(up-research-status c: ri-bow-saw >= research-pending)
(or
(civ-selected viking)
(unit-type-count galley-line > 4)
)
)
(can-research-with-escrow ri-war-galley)
=>
(release-escrow food)(release-escrow gold)
(research ri-war-galley)
)
(defrule
(can-research-with-escrow ri-fast-fire-ship)
=>
(release-escrow wood)(release-escrow gold)
(set-escrow-percentage wood 0)(set-escrow-percentage gold 0)
(research ri-fast-fire-ship)
)
(defrule
(can-research-with-escrow ri-galleon)
=>
(release-escrow wood)(release-escrow food)
(set-escrow-percentage wood 0)(set-escrow-percentage food 0)
(research ri-galleon)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
(research-available ri-galleon)
(building-type-count dock > 0)
=>
(set-escrow-percentage wood 20)(set-escrow-percentage food 20)
(set-goal escrow-purpose-goal navy)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
(research-available ri-fast-fire-ship)
(building-type-count dock > 0)
=>
(set-escrow-percentage wood 20)(set-escrow-percentage gold 20)
(set-goal escrow-purpose-goal navy)
)
(defrule
(strategic-number sn-resource-control < 2)
(nor
(research-available ri-fast-fire-ship)
(research-available ri-galleon)
)
(research-available ri-cannon-galleon)
(unit-type-count warship-class > 30)
(strategic-number sn-military-level >= 0)
(players-unit-type-count every-enemy galley-line < 20)
(players-unit-type-count every-enemy fire-ship-line < 20)
(players-building-type-count any-enemy castle > 0)
(building-type-count dock > 0)
=>
(set-escrow-percentage wood 20)(set-escrow-percentage food 20)
(set-goal escrow-purpose-goal navy)
(set-strategic-number sn-resource-control navy)
(up-jump-rule 1)
)
(defrule
(goal escrow-purpose-goal navy)
(or
(nor
(research-available ri-fast-fire-ship)
(research-available ri-galleon)
)
(building-type-count dock == 0)
)
=>
(set-goal escrow-purpose-goal 0)
(release-escrow wood)(release-escrow food)(release-escrow gold)
(set-escrow-percentage wood 0)(set-escrow-percentage food 0)(set-escrow-percentage gold 0)
)
(defrule
(nor
(research-available ri-galleon)
(research-available ri-fast-fire-ship)
)
(can-research-with-escrow ri-cannon-galleon)
=>
(release-escrow food)(release-escrow wood)
(research ri-cannon-galleon)
)
(defrule
(nor
(research-available ri-galleon)
(research-available ri-fast-fire-ship)
)
(or
(can-research-with-escrow ri-shipwright)
(or
(can-research-with-escrow ri-dry-dock)
(can-research-with-escrow ri-deck-guns)
)
)
=>
(release-escrow food)(release-escrow gold)
(research ri-shipwright)
(research ri-dry-dock)
(research ri-deck-guns)
)
(defrule
(strategic-number sn-resource-control <= 1)
(building-type-count-total town-center > 0)
(or
(goal strategy-goal sling)
(or
(strategic-number sn-current-age >= fc-transit)
(goal strategy-goal flush)
)
)
(nand
(goal unit-goal my-unique-unit-line)
(research-available ri-stone-mining)
)
(can-research ri-double-bit-axe)
=>
(research ri-double-bit-axe)
)
#load-if-not-defined SARACEN-CIV
(defrule
(strategic-number sn-resource-control <= 1)
(building-type-count-total town-center > 0)
(strategic-number sn-current-age >= fc-transit)
(nand (goal unit-goal my-unique-unit-line)
(research-available ri-stone-mining))
(or (strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(up-research-status c: ri-bow-saw >= research-pending))
(can-research ri-horse-collar)
=>
(research ri-horse-collar)
)
#else
(defrule
(strategic-number sn-resource-control <= 1)
(strategic-number sn-current-age >= fc-transit)
(or
(or
(commodity-selling-price stone < 100)
(commodity-buying-price food > 130)
)
(or
(dropsite-min-distance stone > 5)
(or
(strategic-number sn-stone-gatherer-percentage == 0)
(goal strategy-goal boom)
)
)
)
(or
(building-type-count-total barracks > 0)
(goal unit-goal my-unique-unit-line)
)
(can-research ri-horse-collar)
=>
(research ri-horse-collar)
)
#end-if
(defrule
(strategic-number sn-resource-control <= 1)
(building-type-count-total town-center > 0)
(or
(and
(goal strategy-goal flush)
(or
(not (research-available ri-man-at-arms))
(or
(building-type-count-total archery-range > 1)
(building-type-count-total stable > 0)
)
)
)
(goal strategy-goal sling)
)
(can-research ri-horse-collar)
=>
(research ri-horse-collar)
)
(defrule
(strategic-number sn-resource-control <= 2)
(civilian-population >= 42)
(or
(and
(goal strategy-goal flush)
(or
(and
(food-amount > 600)
(gold-amount < 75)
)
(goal unit-goal archer)
)
)
(goal strategy-goal sling)
)
(can-research ri-gold-mining)
=>
(research ri-gold-mining)
)
(defrule
(strategic-number sn-resource-control <= 2)
(or
(or
(strategic-number sn-gold-gatherer-percentage >= 20)
(or
(and
(goal unit-goal knight)
(up-compare-goal position-goal == flank)
)
(goal unit-goal monk)
)
)
(civilian-population >= 50)
)
(strategic-number sn-current-age >= fc-transit)
(can-research ri-gold-mining)
=>
(research ri-gold-mining)
)
(defrule
(strategic-number sn-resource-control <= 2)
(or
(or
(or
(unit-type-count cavalry-unit-class > low-min-number-upgrade)
(unit-type-count cavalry-archer-class > low-min-number-upgrade)
)
(strategic-number sn-current-age >= ci-transit)
)
(or
(unit-type-count scout-cavalry > mid-min-number-upgrade);scouts do not count as cavalry-unit-class(!)
(unit-type-count conquistador-line > mid-min-number-upgrade)
)
)
(can-research ri-bloodlines)
=>
(research ri-bloodlines)
)
(defrule
(strategic-number sn-resource-control <= 2)
(strategic-number sn-current-age >= fc-transit)
(or
(goal unit-goal knight)
(goal unit-goal cavalry-archer)
)
(up-compare-goal strategy-goal != boom)
(can-research ri-bloodlines)
=>
(research ri-bloodlines)
)
(defrule
(strategic-number sn-resource-control <= 2)
(or
(unit-type-count infantry-class > mid-min-number-upgrade)
(and
(goal unit-goal eagle-warrior)
(building-type-count-total barracks > 0); don't research too early on islands
)
)
(or
(and
(strategic-number sn-current-age >= fc-transit)
(up-research-status c: ri-gold-mining >= research-pending)
)
(or
(goal hostilities-goal 1)
(death-match-game)
)
)
(can-research ri-scale-mail)
=>
(research ri-scale-mail)
)
(defrule
(strategic-number sn-resource-control <= 2)
(or
(or
(unit-type-count cavalry-unit-class > low-min-number-upgrade)
(unit-type-count scout-cavalry > mid-min-number-upgrade)
)
(and
(building-type-count-total stable > 1)
(food-amount > 300)
)
)
(strategic-number sn-current-age >= fc-transit)
(can-research ri-scale-barding)
=>
(research ri-scale-barding)
)
(defrule
(or
(and
(strategic-number sn-resource-control <= 2)
(or
(or
(and
(building-type-count-total siege-workshop > 0)
(nand
(goal enemy-goal eagle-warrior)
(strategic-number sn-archer-threat == 0)
)
)
(strategic-number sn-archer-threat >= 1)
)
(unit-type-count-total skirmisher-line > mid-min-number-upgrade)
)
)
(strategic-number sn-resource-control == ri-elite-skirmisher)
)
(can-research ri-elite-skirmisher)
=>
(research ri-elite-skirmisher)
)
(defrule
(or
(or
(unit-type-count eagle-warrior-line > 11)
(and
(not (civ-selected aztec))
(current-age-time >= 300)
)
)
(goal unit-goal eagle-warrior)
)
(can-research-with-escrow ri-elite-eagle-warrior)
=>
(release-escrow food)(release-escrow gold)
(set-escrow-percentage food 0)(set-escrow-percentage gold 0)
(research ri-elite-eagle-warrior)
)
(defrule
(strategic-number sn-resource-control <= 2)
(or
(unit-type-count monk > 4)
(and
(goal enemy-goal flush)
(goal ranged-unit-type-goal monk)
)
)
=>
(research ri-sanctity)
(research ri-theocracy)
(research ri-illumination)
(research ri-block-printing)
)
(defrule
(strategic-number sn-resource-control <= 2)
(up-research-status c: ri-sanctity >= research-pending)
(unit-type-count monk > 4)
(or
(civ-selected aztec); bugged, movement speed bonus only counts for monks with relics in 1.0c
(goal aofe-game-goal 1); bug is fixed in AoFE
)
(can-research ri-fervor)
=>
(research ri-fervor)
)
#load-if-defined AZTEC-CIV
(defrule
(strategic-number sn-resource-control <= 2)
(up-research-status c: ri-sanctity >= research-pending)
(unit-type-count monk > 4)
(can-research ri-fervor)
=>
(research ri-fervor)
)
(defrule
(strategic-number sn-resource-control < 1)
(building-type-count-total monastery > 2)
(unit-type-count monk > 19)
(current-age == imperial-age)
(population >= max-pop)
(can-research ri-herbal-medicine)
=>
(research ri-herbal-medicine)
)
#end-if
(defrule
(strategic-number sn-resource-control < 1)
(goal ranged-unit-type-goal monk); redemption will lure monks into death so avoid it unless enemy tries to counter monks with siege
(or
(players-unit-type-count any-enemy scorpion-line > 2)
(or
(players-unit-type-count any-enemy bombard-cannon > 0)
(players-unit-type-count any-enemy mangonel-line > 0)
)
)
(can-research ri-redemption)
=>
(research ri-redemption)
)
(defrule
(or
(strategic-number sn-resource-control < 1)
(strategic-number sn-resource-control == ri-heresy)
)
(or
(and
(and
(unit-type-count monk > 12)
(strategic-number sn-current-age >= ci-transit)
)
(unit-type-count monk > 5)
)
(and
(players-unit-type-count any-enemy monk > 3)
(goal ranged-unit-type-goal monk)
)
)
(can-research ri-atonement)
=>
(research ri-atonement)
)
#load-if-defined CELTIC-CIV
(defrule
(strategic-number sn-resource-control <= 2)
(or
(can-research-with-escrow ri-heavy-scorpion)
(can-research-with-escrow my-unique-research)
)
=>
(release-escrow wood)(release-escrow food)(release-escrow gold)
(research ri-heavy-scorpion)
(research my-unique-research)
)
#else
(defrule
(strategic-number sn-resource-control <= 2)
(or
(unit-type-count scorpion-line > low-min-number-upgrade)
(goal ranged-unit-type-goal scorpion)
)
(can-research ri-heavy-scorpion)
=>
(research ri-heavy-scorpion)
)
(defrule
(or
(civ-selected japanese)
(civ-selected viking)
)
(strategic-number sn-resource-control < 1)
(players-unit-type-count focus-player skirmisher-line > 20)
(unit-type-count trade-cart > 5)
(can-research ri-heavy-scorpion)
=>
(research ri-heavy-scorpion)
)
#end-if
(defrule
(or
(unit-type-count-total my-unique-unit-line >= high-min-number-upgrade)
(goal uu-up-goal 1)
)
(can-research-with-escrow my-unique-unit-upgrade)
=>
(release-escrow wood)(release-escrow food)(release-escrow gold)
(research my-unique-unit-upgrade)
(set-goal uu-up-goal 0)
)
(defrule
(current-age-time > 300)
(game-time > 1800); not in DM
(gold-amount > 2000)
(or (or (civ-selected saracen)(civ-selected turkish))(civ-selected japanese))
(can-research-with-escrow my-unique-unit-upgrade)
=>
(release-escrow food)(release-escrow gold)
(research my-unique-unit-upgrade)
(set-goal uu-up-goal 0)
)
(defrule
(population >= del-civ-pop)
(current-age-time > 300)
(or (gold-amount > 2000)
(or (unit-type-count-total my-unique-unit-line >= 10)
(and (civ-selected saracen)
(unit-type-count-total camel-line >= 10))))
(or (civ-selected saracen)
(civ-selected byzantine))
(can-research-with-escrow my-unique-research)
=>
(release-escrow food)(release-escrow gold)
(research my-unique-research)
)
#load-if-defined TURKISH-CIV
(defrule
(population >= del-civ-pop)
(unit-type-count bombard-tower > 4)
(can-research-with-escrow my-unique-research)
=>
(release-escrow gold)(release-escrow stone)
(research my-unique-research)
)
#end-if
#load-if-defined GOTHIC-CIV
(defrule
(strategic-number sn-resource-control != ri-long-swordsman)
(goal unit-goal knight)
(building-type-count town-center < tc-level-three)
(unit-type-count-total militiaman-line < 6); test
(goal control-goal militiaman-line)
=>
(up-jump-rule 4)
)
#end-if
(defrule
(or (strategic-number sn-resource-control <= 2)
(strategic-number sn-resource-control == ri-long-swordsman))
(or (unit-type-count-total militiaman-line >= 6)
(or (goal unit-goal militiaman-line)
(goal control-goal militiaman-line)))
(or (unit-type-count-total militiaman-line >= 6)
(or (goal strategy-goal flush)
(strategic-number sn-current-age >= fc-transit)))
(can-research ri-man-at-arms)
=>
(research ri-man-at-arms)
)
(defrule
(or (strategic-number sn-resource-control <= 2)
(strategic-number sn-resource-control == ri-long-swordsman))
(or (unit-type-count-total militiaman-line >= 6)
(or (goal unit-goal militiaman-line)
(goal control-goal militiaman-line)))
(can-research ri-long-swordsman)
=>
(research ri-long-swordsman)
)
(defrule
(strategic-number sn-resource-control <= 2)
(or (unit-type-count-total militiaman-line >= 6)
(or (goal unit-goal militiaman-line)
(goal control-goal militiaman-line)))
(can-research ri-two-handed-swordsman)
=>
(research ri-two-handed-swordsman)
)
(defrule
(strategic-number sn-resource-control <= 2)
(or (unit-type-count-total militiaman-line >= 6)
(or (goal unit-goal militiaman-line)
(goal control-goal militiaman-line)))
(can-research ri-champion)
=>
(research ri-champion)
)
(defrule
(or (and (strategic-number sn-resource-control <= 2)
(or (goal strategy-goal flush)
(current-age-time > 240)))
(strategic-number sn-resource-control == ri-crossbow))
(or (goal ranged-unit-type-goal archer)
(or (strategic-number sn-resource-control == ri-crossbow)
(and (unit-type-count archer > 8)
(goal hostilities-goal 1))))
(can-research ri-crossbow)
=>
(research ri-crossbow)
)
(defrule
(or
(strategic-number sn-resource-control <= 2)
(strategic-number sn-resource-control == ri-arbalest)
)
(or
(goal ranged-unit-type-goal archer)
(and
(unit-type-count archer-line > 10)
(goal hostilities-goal 1)
)
)
(can-research ri-arbalest)
=>
(research ri-arbalest)
)
(defrule
(strategic-number sn-resource-control <= 2)
(unit-type-count knight-line > 12)
(can-research ri-cavalier)
=>
(research ri-cavalier)
)
(defrule
(or (or (civ-selected slavic); get more uu instead
(civ-selected mongol))
(civ-selected persian))
(up-compare-goal unit-goal != knight)
=>
(up-jump-rule 1)
)
(defrule
(strategic-number sn-resource-control <= 2)
(or (goal anti-cavalry-threat-goal 0)
(goal unit-goal knight))
(or (up-research-status c: ri-bloodlines >= research-pending)
(civ-selected frankish))
(can-research ri-cavalier)
=>
(research ri-cavalier)
)
(defrule
(strategic-number sn-resource-control <= 2)
(or (up-research-status c: ri-bloodlines >= research-pending)
(civ-selected frankish))
(can-research-with-escrow ri-paladin)
=>
(release-escrow food)(release-escrow gold)
(research ri-paladin)
)
(defrule
(strategic-number sn-resource-control <= 2)
(or (unit-type-count ranged-unit-class > mid-min-number-upgrade)
(unit-type-count cavalry-archer-class > mid-min-number-upgrade))
(or (or (gold-amount < 200)
(strategic-number sn-current-age >= ci-transit))
(goal hostilities-goal 1))
(can-research-with-escrow ri-thumb-ring)
=>
(release-escrow wood)(release-escrow food)
(research ri-thumb-ring)
)
#load-if-not-defined GOTHIC-CIV
(defrule
(strategic-number sn-resource-control <= 2)
(or (up-research-status c: ri-bloodlines >= research-pending)
(research-available ri-bloodlines))
(or (unit-type-count villager >= 40); dont research this at castle age start when rushing
(population >= del-civ-pop))
(or (and (food-amount > 350)
(or (gold-amount < 200)
(strategic-number sn-current-age >= ci-transit)))
(unit-type-count scout-cavalry > 6))
(can-research ri-light-cavalry)
=>
(research ri-light-cavalry)
)
(defrule
(or (goal monk-threat-goal 1)
(and (strategic-number sn-resource-control <= 2)
(and (and (food-amount > 400)
(gold-amount < 100))
(or (civ-selected frankish)
(civ-selected briton)))))
(can-research ri-light-cavalry)
=>
(research ri-light-cavalry)
)
(defrule
(game-time < 1500)
(or (players-building-type-count every-enemy monastery > 1)
(and (players-building-type-count every-enemy castle > 0)
(players-unit-type-count every-enemy monk > 3)))
(can-research ri-light-cavalry)
=>
(research ri-light-cavalry)
)
#end-if
(defrule
(nand (civ-selected magyar)
(goal monk-threat-goal 0)); get UU instead
(strategic-number sn-resource-control <= 2)
(can-research ri-hussar)
=>
(research ri-hussar)
)
(defrule
(strategic-number sn-resource-control <= 2)
(or (unit-type-count cavalry-archer-line >= high-min-number-upgrade)
(or (goal unit-goal cavalry-archer)
(and (civ-selected hun)
(unit-type-count trade-cart > 5))))
(unit-type-count cavalry-archer-line >= mid-min-number-upgrade)
(can-research ri-heavy-cavalry-archer)
=>
(research ri-heavy-cavalry-archer)
)
(defrule
(strategic-number sn-resource-control <= 2)
(or
(or
(up-research-status c: ri-crossbow >= research-pending)
(unit-type-count cavalry-archer-class > mid-min-number-upgrade)
)
(or
(or
(unit-type-count ranged-unit-class > mid-min-number-upgrade)
(goal strategy-goal flush)
)
(or
(unit-type-count galley-line > 4)
(up-research-status c: ri-chemistry >= research-pending)
)
)
)
(can-research ri-fletching)
=>
(research ri-fletching)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(or
(strategic-number sn-resource-control <= 2)
(strategic-number sn-resource-control == ri-fletching)
)
(strategic-number sn-current-age >= fc-transit)
(or
(or
(goal unit-goal cavalry-archer)
(goal unit-goal archer)
)
(goal unit-goal skirmisher)
)
(can-research ri-fletching)
=>
(research ri-fletching)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(or
(strategic-number sn-resource-control <= 2)
(strategic-number sn-resource-control == ri-fletching)
)
(current-age >= castle-age)
(building-type-count castle > 0)
(or
(unit-type-count ranged-unit-class > 0)
(unit-type-count cavalry-archer-class > 0)
)
(can-research ri-fletching)
=>
(research ri-fletching)
)
(defrule
(strategic-number sn-resource-control <= 2)
(or
(or
(unit-type-count ranged-unit-class > mid-min-number-upgrade)
(unit-type-count cavalry-archer-class > mid-min-number-upgrade)
)
(or
(unit-type-count galley-line > 0)
(and
(goal unit-goal skirmisher)
(current-age-time > 60)
)
)
)
(can-research ri-bodkin-arrow)
=>
(research ri-bodkin-arrow)
)
(defrule
(or
(and
(goal strategy-goal rush)
(or
(goal unit-goal cavalry-archer)
(goal unit-goal archer)
)
)
(or
(and
(building-type-count castle > 1)
(population >= max-civ-pop)
)
(strategic-number sn-resource-control == ri-bodkin-arrow)
)
)
(can-research ri-bodkin-arrow)
=>
(research ri-bodkin-arrow)
)
(defrule
(or
(and
(unit-type-count infantry-class > mid-min-number-upgrade)
(strategic-number sn-resource-control <= 2)
)
(goal train-civ-goal ri-chain-mail)
)
(can-research-with-escrow ri-chain-mail)
=>
(release-escrow food)(release-escrow gold)
(research ri-chain-mail)
)
#load-if-not-defined DIFFICULTY-EASIEST; test
(defrule
(strategic-number sn-resource-control <= 2)
(current-age-time > 60)
(can-research ri-conscription)
=>
(research ri-conscription)
)
(defrule
(strategic-number sn-resource-control <= 2)
(population > sixty-percent-pop)
(unit-type-count cavalry-unit-class > high-min-number-upgrade)
(research-available ri-plate-barding)
=>
(set-escrow-percentage food 20)(set-escrow-percentage gold 20)
(set-goal escrow-purpose-goal blacksmith)
)
(defrule
(strategic-number sn-resource-control <= 2)
(unit-type-count cavalry-unit-class > mid-min-number-upgrade)
(can-research-with-escrow ri-plate-barding)
=>
(release-escrow food)(release-escrow gold)
(set-escrow-percentage food 0)(set-escrow-percentage gold 0)
(set-goal escrow-purpose-goal 0)
(research ri-plate-barding)
)
#load-if-not-defined DIFFICULTY-EASY
(defrule
(strategic-number sn-resource-control <= 2)
(population > sixty-percent-pop)
(not (can-research-with-escrow ri-bracer))
(research-available ri-bracer)
=>
(set-escrow-percentage food 20)(set-escrow-percentage gold 20)
)
(defrule
(strategic-number sn-resource-control <= 2)
(can-research-with-escrow ri-bracer)
=>
(release-escrow food)(release-escrow gold)
(set-escrow-percentage food 0)(set-escrow-percentage gold 0)
(research ri-bracer)
)
#end-if; test
#end-if
(defrule
(strategic-number sn-resource-control <= 2)
(or
(unit-type-count infantry-class < low-min-number-upgrade)
(up-research-status c: ri-scale-mail >= research-pending)
)
(up-research-status c: ri-scale-barding >= research-pending)
(unit-type-count cavalry-unit-class > low-min-number-upgrade)
(strategic-number sn-current-age >= fc-transit)
(can-research ri-forging)
=>
(research ri-forging)
)
(defrule
(strategic-number sn-resource-control <= 2)
(nand
(goal unit-goal eagle-warrior)
(research-available ri-chain-mail)
)
(or
(unit-type-count cavalry-unit-class < low-min-number-upgrade)
(up-research-status c: ri-scale-barding >= research-pending)
)
(unit-type-count infantry-class > low-min-number-upgrade)
(up-research-status c: ri-scale-mail >= research-pending)
(nand
(goal strategy-goal boom)
(goal hostilities-goal 0)
)
(strategic-number sn-current-age >= fc-transit)
(can-research ri-forging)
=>
(research ri-forging)
)
(defrule
(strategic-number sn-resource-control <= 0)
(or
(up-research-status c: ri-chain-barding >= research-pending)
(up-research-status c: ri-chain-mail >= research-pending)
)
(or
(or
(strategic-number sn-current-age >= ci-transit)
(goal hostilities-goal 1)
)
(and
(goal unit-goal eagle-warrior)
(up-compare-goal strategy-goal != fast-imp)
)
)
(can-research-with-escrow ri-iron-casting)
=>
(release-escrow food)(release-escrow gold)
(research ri-iron-casting)
)
#load-if-not-defined DIFFICULTY-EASIEST; test
(defrule
(strategic-number sn-resource-control <= 2)
(population > sixty-percent-pop)
(or
(unit-type-count infantry-class > high-min-number-upgrade)
(unit-type-count cavalry-unit-class > high-min-number-upgrade)
)
(not (can-research-with-escrow ri-blast-furnace))
(research-available ri-blast-furnace)
=>
(set-escrow-percentage food 20)(set-escrow-percentage gold 20)
(set-goal escrow-purpose-goal blacksmith)
)
(defrule
(strategic-number sn-resource-control <= 2)
(nand
(research-available ri-plate-mail)
(unit-type-count infantry-class > high-min-number-upgrade)
)
(nand
(research-available ri-plate-barding)
(unit-type-count cavalry-unit-class > high-min-number-upgrade)
)
(can-research-with-escrow ri-blast-furnace)
=>
(release-escrow food)(release-escrow gold)
(set-escrow-percentage food 0)(set-escrow-percentage gold 0)
(research ri-blast-furnace)
(set-goal escrow-purpose-goal 0)
)
#end-if; test
(defrule
(goal unit-goal knight)
(unit-type-count knight-line > 12)
(game-time < 2700)
(not (up-research-status c: ri-paladin >= research-pending))
=>
(up-jump-rule 2)
)
(defrule
(strategic-number sn-resource-control <= 2)
(population > sixty-percent-pop)
(building-type-count university > 0)
(not (can-research-with-escrow ri-chemistry))
(research-available ri-chemistry)
=>
(set-escrow-percentage food 20)(set-escrow-percentage gold 20)
)
(defrule
(or
(strategic-number sn-resource-control <= 2)
(strategic-number sn-resource-control == ri-chemistry)
)
(or
(current-age-time > 120)
(or
(goal unit-goal gunpowder-class)
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
)
)
(can-research-with-escrow ri-chemistry)
=>
(release-escrow food)(release-escrow gold)
(set-escrow-percentage food 0)(set-escrow-percentage gold 0)
(research ri-chemistry)
)
#load-if-not-defined PERSIAN-CIV
#load-if-not-defined SPANISH-CIV
(defrule
(strategic-number sn-resource-control <= 2)
(or (unit-type-count cavalry-archer-line >= high-min-number-upgrade)
(or (goal unit-goal cavalry-archer)
(and (civ-selected hun)
(unit-type-count trade-cart > 5))))
(unit-type-count cavalry-archer-line >= mid-min-number-upgrade)
(can-research ri-parthian-tactics)
=>
(research ri-parthian-tactics)
)
#end-if
#end-if
#load-if-not-defined DIFFICULTY-EASIEST; test
(defrule
(strategic-number sn-resource-control <= 2)
(population > sixty-percent-pop)
(unit-type-count infantry-class > high-min-number-upgrade)
(research-available ri-plate-mail)
=>
(set-escrow-percentage food 20)(set-escrow-percentage gold 20)
(set-goal escrow-purpose-goal blacksmith)
)
(defrule
(strategic-number sn-resource-control <= 2)
(unit-type-count infantry-class > mid-min-number-upgrade)
(can-research-with-escrow ri-plate-mail)
=>
(release-escrow food)(release-escrow gold)
(set-escrow-percentage food 0)(set-escrow-percentage gold 0)
(set-goal escrow-purpose-goal 0)
(research ri-plate-mail)
)
#end-if; test
(defrule
(strategic-number sn-resource-control <= 2)
(or
(or
(unit-type-count gunpowder-class > low-min-number-upgrade)
(unit-type-count conquistador-line > low-min-number-upgrade)
)
(and
(up-research-status c: ri-fletching >= research-pending)
(or
(or
(unit-type-count ranged-unit-class > mid-min-number-upgrade)
(unit-type-count cavalry-archer-class > mid-min-number-upgrade)
)
(and
(goal hostilities-goal 1)
(goal strategy-goal flush)
)
)
)
)
(can-research ri-padded-archer-armor)
=>
(research ri-padded-archer-armor)
)
(defrule
(strategic-number sn-resource-control <= 2)
(or
(unit-type-count ranged-unit-class > low-min-number-upgrade)
(unit-type-count cavalry-archer-class > low-min-number-upgrade)
)
(up-research-status c: ri-bodkin-arrow >= research-pending)
(or
(strategic-number sn-current-age >= ci-transit)
(goal hostilities-goal 1)
)
(can-research-with-escrow ri-leather-archer-armor)
=>
(release-escrow food)(release-escrow gold)
(research ri-leather-archer-armor)
)
(defrule
(strategic-number sn-resource-control <= 2)
(or
(unit-type-count gunpowder-class > low-min-number-upgrade)
(unit-type-count conquistador-line > low-min-number-upgrade)
)
(or
(strategic-number sn-current-age >= ci-transit)
(goal hostilities-goal 1)
)
(can-research-with-escrow ri-leather-archer-armor)
=>
(release-escrow food)(release-escrow gold)
(research ri-leather-archer-armor)
)
#load-if-not-defined DIFFICULTY-EASIEST; test
(defrule
(strategic-number sn-resource-control <= 2)
(not (research-available ri-bracer))
(or
(or
(unit-type-count ranged-unit-class > low-min-number-upgrade)
(unit-type-count cavalry-archer-class > low-min-number-upgrade)
)
(or
(unit-type-count gunpowder-class > low-min-number-upgrade)
(unit-type-count conquistador-line > low-min-number-upgrade)
)
)
(can-research-with-escrow ri-ring-archer-armor)
=>
(release-escrow food)(release-escrow gold)
(research ri-ring-archer-armor)
)
#end-if; test
(defrule
(strategic-number sn-resource-control <= 2)
(or
(strategic-number sn-current-age >= ci-transit)
(and
(gold-amount < 200)
(or
(food-amount > 500)
(goal hostilities-goal 1)
)
)
)
(unit-type-count infantry-class > mid-min-number-upgrade)
(can-research ri-squires)
=>
(research ri-squires)
)
(defrule
(strategic-number sn-resource-control <= 2)
(or
(or
(gold-amount < 200)
(strategic-number sn-current-age >= ci-transit)
)
(goal hostilities-goal 1)
)
(or
(unit-type-count cavalry-unit-class > mid-min-number-upgrade)
(or
(unit-type-count cavalry-archer-class > mid-min-number-upgrade)
(unit-type-count conquistador-line > mid-min-number-upgrade)
)
)
(can-research ri-husbandry)
=>
(research ri-husbandry)
)
(defrule
(or
(unit-type-count spearman-line > 7)
(strategic-number sn-cavalry-threat >= 1)
)
(nand
(and
(goal unit-goal knight)
(game-time < 2400)
)
(or
(civ-selected indian)
(goal strategy-goal boom)
)
)
(can-research ri-pikeman)
=>
(research ri-pikeman)
)
(defrule
(unit-type-count spearman-line > high-min-number-upgrade)
(research-available ri-halberdier)
(not (goal escrow-purpose-goal blacksmith))
=>
(set-escrow-percentage gold 67)
(set-goal escrow-purpose-goal ri-halberdier)
)
(defrule
(or
(and
(escrow-amount gold >= 225)
(not (goal escrow-purpose-goal ri-halberdier))
)
(escrow-amount gold >= 600)
)
(not (goal escrow-purpose-goal my-unique-unit-line))
(current-age == imperial-age)
=>
(set-escrow-percentage food 30)
(set-escrow-percentage gold 0); stop escrowing gold when we have enough
)
(defrule
(or
(unit-type-count spearman-line > mid-min-number-upgrade)
(strategic-number sn-minimum-water-body-size-for-dock > water-mixed)
)
(can-research-with-escrow ri-halberdier)
=>
(release-escrow food)(release-escrow gold)
(set-escrow-percentage food 0)(set-escrow-percentage gold 0)
(research ri-halberdier)
(set-goal escrow-purpose-goal 0)
)
(defrule
(or
(and
(unit-type-count spearman-line < 10)
(goal escrow-purpose-goal ri-halberdier)
)
(and
(and
(unit-type-count infantry-class < 10)
(unit-type-count cavalry-unit-class < 10)
)
(goal escrow-purpose-goal blacksmith)
)
)
=>
(release-escrow food)(release-escrow gold)
(set-escrow-percentage food 0)(set-escrow-percentage gold 0)
(set-goal escrow-purpose-goal 0)
)
(defrule
(up-research-status c: ri-elite-eagle-warrior >= research-pending); try to press advatange with as many EEW as possivle in early imp
(current-age-time < 600)
(population < del-civ-pop)
=>
(release-escrow food)(release-escrow wood)(release-escrow gold)
(set-escrow-percentage food 0)(set-escrow-percentage wood 0)(set-escrow-percentage gold 0)
(set-goal escrow-purpose-goal 0)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(current-age-time > 180)
(strategic-number sn-resource-control <= 2)
(can-research ri-capped-ram)
(unit-type-count-total battering-ram-line > 0)
=>
(research ri-capped-ram)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(population > max-civ-pop)
(strategic-number sn-resource-control <= 1)
(can-research ri-siege-ram)
(unit-type-count-total battering-ram-line > 3)
=>
(research ri-siege-ram)
)
(defrule
(goal save-wood-goal 0)
(strategic-number sn-resource-control <= 1)
(or
(strategic-number sn-current-age >= ci-transit)
(or
(building-type-count-total monastery > 2); mush
(and
(food-amount > 400)
(gold-amount < 200)
)
)
)
(can-research ri-gold-shaft-mining)
=>
(research ri-gold-shaft-mining)
)
(defrule
(or
(strategic-number sn-stone-gatherer-percentage > 9)
(strategic-number sn-current-age >= ci-transit)
)
(strategic-number sn-stone-gatherer-percentage > 3)
(strategic-number sn-current-age >= fc-transit)
(or
(building-type-count-total barracks > 0); for saracens, to finish the barracks first to drop the other military buildings before castle age
(or
(goal unit-goal my-unique-unit-line)
(strategic-number sn-current-age >= ci-transit)
)
)
(can-research ri-stone-mining)
=>
(research ri-stone-mining)
)
(defrule
(or
(can-research ri-crop-rotation)
(can-research ri-two-man-saw)
)
=>
(research ri-crop-rotation)
(research ri-two-man-saw)
)
#load-if-not-defined DIFFICULTY-EASIEST; test
#load-if-not-defined DIFFICULTY-EASY
(defrule; back-up blacksmith research rules
(strategic-number sn-resource-control != 0)
(strategic-number sn-resource-control != 2)
(strategic-number sn-number-attack-groups < 2)
(nand (strategic-number sn-maximum-town-size >= 40)
(enemy-buildings-in-town))
(or (population < del-civ-pop)
(and (population < eighty-five-percent-pop)
(current-age < imperial-age)))
=>
(up-jump-rule 2))
(defrule
(strategic-number sn-current-age >= fc-transit)
(or (building-type-count watch-tower >= 3)
(or (building-type-count castle >= 3)
(or (unit-type-count-total 900 >= high-min-number-upgrade)
(or (unit-type-count-total slinger >= high-min-number-upgrade)
(unit-type-count-total 936 >= high-min-number-upgrade)))))
=>
(research ri-fletching)
(research ri-bodkin-arrow)
(research ri-bracer))
(defrule
(strategic-number sn-current-age >= fc-transit)
(or (unit-type-count-total scout-cavalry >= high-min-number-upgrade)
(or (unit-type-count-total 912 >= high-min-number-upgrade)
(or (unit-type-count-total magyar-huszar >= high-min-number-upgrade)
(unit-type-count-total boyar >= high-min-number-upgrade))))
=>
(research ri-scale-barding)
(research ri-chain-barding)
(research ri-plate-barding))
(defrule
(strategic-number sn-current-age >= fc-transit)
(or (unit-type-count-total 906 >= high-min-number-upgrade)
(or (unit-type-count-total kamayuk >= high-min-number-upgrade)
(unit-type-count-total condottiero >= high-min-number-upgrade)))
=>
(research ri-scale-mail)
(research ri-chain-mail)
(research ri-plate-mail))
(defrule
(up-research-status c: ri-bodkin-arrow >= research-pending)
(or (unit-type-count-total 900 >= high-min-number-upgrade)
(or (unit-type-count-total 936 >= high-min-number-upgrade)
(or (unit-type-count-total slinger >= high-min-number-upgrade)
(or (unit-type-count-total elephant-archer >= high-min-number-upgrade)
(unit-type-count-total genoese-crossbowman >= high-min-number-upgrade)))))
=>
(research ri-padded-archer-armor)
(research ri-leather-archer-armor)
(research ri-ring-archer-armor))
(defrule
(strategic-number sn-current-age >= fc-transit)
(or (unit-type-count-total 944 >= high-min-number-upgrade)
(unit-type-count-total conquistador-line >= high-min-number-upgrade))
=>
(research ri-padded-archer-armor)
(research ri-leather-archer-armor)
(research ri-ring-archer-armor))
(defrule
(up-research-status c: ri-chain-mail >= research-pending)
(or (unit-type-count-total 906 >= high-min-number-upgrade)
(or (unit-type-count-total kamayuk >= high-min-number-upgrade)
(unit-type-count-total condottiero >= high-min-number-upgrade)))
=>
(research ri-forging)
(research ri-iron-casting)
(research ri-blast-furnace))
(defrule
(up-research-status c: ri-chain-barding >= research-pending)
(or (unit-type-count-total scout-cavalry >= high-min-number-upgrade)
(or (unit-type-count-total 912 >= high-min-number-upgrade)
(or (unit-type-count-total magyar-huszar >= high-min-number-upgrade)
(unit-type-count-total boyar >= high-min-number-upgrade))))
=>
(research ri-forging)
(research ri-iron-casting)
(research ri-blast-furnace))
#end-if; test
#end-if
;********** SIEGE UNITS **********
#load-if-not-defined POPULATION-CAP-25
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(goal enemy-fortifications-goal 1)
(building-type-count castle > 0)
(current-age == imperial-age)
(unit-type-count-total trebuchet-set < 3)
(population >= max-civ-pop)
(game-time < 1200)
=>
(set-goal save-wood-goal 1)
(set-strategic-number sn-resource-control 2)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(or
(unit-type-count battering-ram-line < 3)
(or
(players-building-type-count any-enemy castle > 1)
(players-building-type-count any-enemy stone-wall-line > 10)
)
)
(unit-type-count trebuchet-set == 0)
(building-type-count castle > 0)
(up-research-status c: ri-conscription != research-pending)
(current-age == imperial-age)
(unit-type-count trebuchet-set < 1)
(population >= max-civ-pop)
(wood-amount < 300)
=>
(set-goal save-wood-goal 1)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(or
(unit-type-count battering-ram-line < 3)
(or
(players-building-type-count any-enemy castle > 1)
(players-building-type-count any-enemy stone-wall-line > 10)
)
)
(unit-type-count trebuchet-set == 0)
(building-type-count castle > 0)
(up-research-status c: ri-conscription != research-pending)
(current-age == imperial-age)
(unit-type-count trebuchet-set < 1)
(population >= max-civ-pop)
(wood-amount < 300)
=>
(set-strategic-number sn-resource-control 2)
)
(defrule
(current-age >= imperial-age)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-resource-control == 2)
(unit-type-count trebuchet-set < 3)
(or (goal enemy-fortifications-goal 1)
(unit-type-count-total trebuchet-set < 1))
(population >= del-civ-pop)
=>
(set-goal save-wood-goal 1)
(set-goal train-civ-goal -1)
)
(defrule
(population >= del-civ-pop)
(population-cap <= 250)
(unit-type-count battering-ram-line < 4)
(building-type-count siege-workshop > 0)
(unit-type-count trebuchet-set < 1)
(current-age == imperial-age)
(current-age-time > 180)
(wood-amount > 175)
(gold-amount > 75)
(unit-type-count-total villager >= 12)
=>
(delete-unit villager)
(set-goal train-civ-goal -1)
(set-strategic-number sn-resource-control 2)
)
(defrule
(population-cap <= 250)
(players-building-count any-enemy > 0)
(population >= del-civ-pop)
(civilian-population > max-civ)
(gold-amount > 1500)
(food-amount > 1500)
(current-age == imperial-age)
(current-age-time > 300)
(unit-type-count-total villager >= 12)
=>
(delete-unit villager)
(set-goal train-civ-goal -1)
)
(defrule
(building-type-count castle > 0)
(current-age == imperial-age)
(population >= del-civ-pop)
(population-cap <= 250)
(unit-type-count-total trebuchet-set < 4)
(or (goal enemy-fortifications-goal 1)
(unit-type-count-total trebuchet-set < 1))
(wood-amount > 200)
(gold-amount > 200)
(can-afford-unit trebuchet)
(unit-type-count-total villager >= 12)
=>
(delete-unit villager)
(set-goal train-civ-goal -1)
(set-strategic-number sn-resource-control 2)
)
#load-if-not-defined HIGHLAND-MAP
#load-if-not-defined YUCATAN-MAP
(defrule
(population-cap <= 250)
(strategic-number sn-minimum-water-body-size-for-dock >= water-mixed)
(building-type-count-total dock > 0)
(or (warboat-count < 25)
(and (civilian-population > 50)
(and (can-afford-unit cannon-galleon-line)
(unit-type-count cannon-galleon-line < 6))))
(population >= max-pop)
(unit-type-count-total villager >= 12)
=>
(delete-unit villager)
(set-goal train-civ-goal -1)
(set-strategic-number sn-resource-control 1)
(chat-to-player my-player-number "Execute villagers to make room for a bigger navy.")
)
#end-if
#end-if
#else
(defrule
(strategic-number sn-minimum-water-body-size-for-dock >= water-mixed)
(building-type-count-total dock > 0)
(or (and (unit-type-count villager >= max-civ)
(current-age == castle-age))
(up-research-status c: ri-cannon-galleon >= research-pending))
(population >= max-pop)
(unit-type-count-total villager >= 12)
=>
(delete-unit villager)
(set-goal train-civ-goal -1)
(set-strategic-number sn-resource-control 1)
(chat-to-player my-player-number "Execute villagers to make room for a bigger navy.")
)
(defrule
(population >= max-pop)
(or (strategic-number sn-resource-control == battering-ram)
(and (or (goal forward-threat-goal 1)
(military-population > 5))
(and (unit-type-count battering-ram-line < 2)
(unit-type-count trebuchet-set < 1))))
(unit-type-count-total villager >= 12)
=>
(delete-unit villager)
(set-goal train-civ-goal -1)
)
(defrule
(current-age == imperial-age)
(current-age-time > 300)
(population > del-civ-pop)
(strategic-number sn-resource-control < 2); no siege required from rules above
(up-compare-goal uu-up-goal != 1)
(goal escrow-purpose-goal 0)
(unit-type-count villager >= max-civ)
(unit-type-count-total villager >= 12)
=>
(delete-unit villager)
(set-goal train-civ-goal -1)
)
#end-if
(defrule
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
(or (wood-amount >= 2000)
(or (food-amount >= 2000)
(gold-amount >= 2000)))
(unit-type-count-total fishing-ship > 1)
(unit-type-count-total transport-ship < 1)
(population >= max-pop)
(current-age >= imperial-age)
(building-type-count dock >= 1)
=>
(delete-unit fishing-ship))
(defrule
(timer-triggered two-minute-timer)
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
(or (wood-amount >= 2000)
(or (food-amount >= 2000)
(gold-amount >= 2000)))
(unit-type-count-total fishing-ship < 1)
(unit-type-count-total transport-ship < 1)
(population >= max-pop)
(current-age >= imperial-age)
(building-type-count dock >= 1)
(unit-type-count-total villager >= 12)
=>
(delete-unit villager))
(defrule
(unit-type-count fishing-ship > 0)
(population >= del-civ-pop)
(housing-headroom < 10)
(or
(and
(food-amount > 500)
(goal train-civ-goal -1)
)
(and
(cc-players-unit-type-count 0 sea-fish == 0)
(cc-players-unit-type-count 0 shore-fish == 0)
)
)
=>
(delete-unit fishing-ship)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands); not on water maps
(dropsite-min-distance wood > 0)
(dropsite-min-distance wood < 20)
(goal train-civ-goal -1)
(strategic-number sn-resource-control < 1); no siege required from rules above
(civilian-population <= fourty-percent-pop); already deleted lots of villagers
=>
(set-goal train-civ-goal 1); restart villager training
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock == water-mixed)
(strategic-number sn-resource-control == 1)
(warboat-count >= 25)
(or
(up-research-status c: ri-cannon-galleon < research-pending)
(unit-type-count cannon-galleon-line > 7)
)
=>
(set-strategic-number sn-resource-control 0)
)
; order of rules does matter as 1st rule that will be executed 1st, so next rules may not spend the resources
; so put siege training above building
#load-if-not-defined AZTEC-CIV
#load-if-not-defined INCAN-CIV
#load-if-not-defined MAYAN-CIV
(defrule
(strategic-number sn-resource-control < 2)
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
(up-research-status c: ri-cannon-galleon < research-pending)
(warboat-count > 30)
(civilian-population > 100)
(strategic-number sn-military-level >= 0)
(players-building-type-count any-enemy castle > 0)
(nand
(up-compare-goal aofe-game-goal != 1)
(civ-selected briton)
)
(nand
(up-compare-goal aofe-game-goal == 1)
(civ-selected hun)
)
=>
(set-strategic-number sn-resource-control 2)
;debug (chat-to-player my-player-number "Saving resources for cannon-galleon")
)
#end-if
#end-if
#end-if
(defrule
(wood-amount < 200)
(gold-amount > 500)
(unit-type-count trade-cart > 4)
(or
(or
(strategic-number sn-resource-control == 2)
(gold-amount > 1500)
)
(and
(commodity-buying-price wood < 30)
(gold-amount > 800)
)
)
(commodity-buying-price wood < 80)
=>
(buy-commodity wood)
(chat-local-to-self "4 Buy cheap wood with trade cart gold")
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock >= water-mixed)
(warboat-count >= 17)
(or
(or
(cc-players-unit-type-count any-enemy castle-arrow > 0)
(cc-players-unit-type-count any-enemy castle-arrow-chemistry > 0)
)
(cc-players-unit-type-count any-enemy 506 > 0)
)
(unit-type-count cannon-galleon-line < 4)
(can-train-with-escrow cannon-galleon-line)
=>
(release-escrow wood)(release-escrow gold)
(train cannon-galleon-line)
)
#load-if-defined DEFEND-WONDER
(defrule
(building-type-count wonder == 0)
(unit-type-count-total trebuchet-set < 2)
(can-train trebuchet)
=>
(train trebuchet)
)
#end-if
(defrule
(unit-type-count-total trebuchet-set < 2)
(or
(unit-type-count-total monastery-class > 20)
(difficulty < moderate)
)
(can-train-with-escrow trebuchet)
=>
(release-escrow wood)(release-escrow gold)
(train trebuchet)
)
(defrule
(population > max-civ-pop)
(or
(or
(unit-type-count trebuchet-set < 2)
(game-time < 1200); start in DM
)
(or
(goal enemy-fortifications-goal 1)
(players-building-type-count any-enemy castle > 1)
)
)
(unit-type-count trebuchet-set < 5)
(can-train trebuchet)
=>
(train trebuchet)
)
(defrule
(strategic-number sn-resource-control <= 2)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(unit-type-count-total battering-ram-line < number-rams)
(population >= seventy-five-percent-pop)
(can-train battering-ram-line)
=>
(train battering-ram-line)
)
#load-if-defined POPULATION-CAP-200
(defrule
(building-type-count-total town-center < 3)
(or
(and
(strategic-number sn-military-level < 2)
(population-cap >= 225)
)
(goal unit-goal knight)
)
(strategic-number sn-military-level < 2)
=>
(up-jump-rule 1)
)
(defrule
(strategic-number sn-resource-control < 1)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(or
(and
(building-type-count-total town-center >= 3)
(wood-amount > 300)
)
(and
(unit-type-count-total battering-ram-line < 2)
(strategic-number sn-military-level > 0)
)
)
(military-population > 10)
(or
(strategic-number sn-military-level >= 0)
(population >= del-civ-pop)
)
(unit-type-count-total battering-ram-line < 5)
(can-train battering-ram-line)
=>
(train battering-ram-line)
)
#end-if
(defrule
(strategic-number sn-current-age == castle)
(strategic-number sn-resource-control < 3)
(unit-type-count mangonel-line < 2)
(or
(unit-type-count ranged-unit-class > high-min-number-upgrade)
(unit-type-count cavalry-archer-class > mid-min-number-upgrade)
)
(players-unit-type-count focus-player skirmisher-line > 12)
(can-train mangonel-line)
=>
(train mangonel-line)
)
(defrule
(strategic-number sn-current-age == castle)
(strategic-number sn-resource-control < 3)
(unit-type-count mangonel-line < 2)
(building-type-count-total town-center >= tc-level-two)
(goal unit-goal my-unique-unit-line)
(players-current-age focus-player == feudal-age)
(wood-amount >= 200)
(current-age >= castle-age)
(can-train mangonel-line)
=>
(train mangonel-line)
)
(defrule
(strategic-number sn-resource-control < 3)
(unit-type-count mangonel-line < 1)
(or
(and
(goal unit-goal my-unique-unit-line); assume we have a ranged uu
(unit-type-count ranged-unit-class > mid-min-number-upgrade)
)
(goal unit-goal scorpion)
)
(or
(players-unit-type-count focus-player mangonel-line > 1)
(players-unit-type-count focus-player scorpion-line > 4)
)
(can-train mangonel-line)
=>
(train mangonel-line)
)
(defrule
(up-compare-goal control-goal != shot)
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(strategic-number sn-resource-control != battering-ram)
(strategic-number sn-resource-control != ri-elite-skirmisher)
(strategic-number sn-archer-threat > 1)
(current-age == castle-age)
(unit-type-count-total mangonel-line < 1)
(building-type-count siege-workshop >= 1)
(nor
(can-afford-unit mangonel-line)
(up-research-status c: ri-elite-skirmisher >= research-pending)
)
=>
(set-strategic-number sn-resource-control mangonel)
(set-goal save-wood-goal 1)
;debug (chat-to-player my-player-number "Saving resources for mangonel")
)
(defrule
(strategic-number sn-resource-control < 1)
(or
(strategic-number sn-archer-threat > 1)
(players-unit-type-count focus-player scorpion-line > 5)
)
(or
(current-age == castle-age)
(or
(strategic-number sn-archer-threat > 2)
(players-unit-type-count focus-player scorpion-line > 11)
)
)
(unit-type-count mangonel-line < 1)
(can-train mangonel-line)
=>
(train mangonel-line)
)
(defrule
(or
(strategic-number sn-resource-control < 3)
(and
(strategic-number sn-resource-control == ri-elite-eagle-warrior)
(food-amount < 700)
)
)
(up-research-status c: ri-elite-eagle-warrior < research-complete); EW die to massed ranged, EEW don't
(or
(strategic-number sn-archer-threat > 2)
(players-unit-type-count focus-player scorpion-line > 11)
)
(unit-type-count-total mangonel-line < 2)
(goal unit-goal eagle-warrior)
(up-compare-goal control-goal != shot)
(can-train mangonel-line)
=>
(train mangonel-line)
)
(defrule
(strategic-number sn-resource-control < 1)
(or
(or
(strategic-number sn-archer-threat > 3)
(players-unit-type-count focus-player scorpion-line > 15)
)
(and
(or
(strategic-number sn-archer-threat > 2)
(players-unit-type-count focus-player scorpion-line > 8)
)
(unit-type-count trade-cart > 15)
)
)
=>
(research ri-onager)
(research ri-siege-onager)
(research 445); ri-shinkichon
)
(defrule
(strategic-number sn-resource-control < 1)
(players-unit-type-count focus-player galley-line > 20)
(or
(warboat-count < 15)
(strategic-number sn-minimum-water-body-size-for-dock == water-mixed)
)
=>
(research ri-onager)
(research ri-siege-onager)
(research 445); ri-shinkichon
)
(defrule
(strategic-number sn-resource-control < 1)
(or
(strategic-number sn-archer-threat > 2)
(or
(players-unit-type-count focus-player scorpion-line > 8)
(players-unit-type-count focus-player galley-line > 15)
)
)
(up-research-status c: ri-onager >= research-pending)
(unit-type-count mangonel-line < 4)
(can-train mangonel-line)
=>
(train mangonel-line)
)
#load-if-not-defined POPULATION-CAP-25
#load-if-defined DEATH-MATCH
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-resource-control < 1)
(military-population > 20)
(unit-type-count battering-ram-line < 5)
(or
(strategic-number sn-military-level >= 0)
(population > sixty-percent-pop)
)
(can-train battering-ram-line)
=>
(train battering-ram-line)
)
#else
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-resource-control < 1)
(goal unit-goal monk)
(nand
(unit-available trebuchet)
(unit-type-count trebuchet-set < 1)
)
(military-population > 20)
(unit-type-count battering-ram-line < 2)
(or
(strategic-number sn-military-level >= 0)
(population > sixty-percent-pop)
)
(can-train battering-ram-line)
=>
(train battering-ram-line)
)
#end-if
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-resource-control != ri-elite-skirmisher)
(population > max-civ-pop)
(or
(unit-type-count battering-ram-line < 4)
(up-research-status c: ri-siege-ram >= research-pending)
)
(or
(goal enemy-fortifications-goal 1)
(unit-type-count battering-ram-line < 6)
)
(unit-type-count battering-ram-line < 12)
(can-train battering-ram-line)
=>
(train battering-ram-line)
)
; Relic Monks
(defrule
(or (strategic-number sn-resource-control < 1)
(gold-amount > 250))
(current-age == castle-age)
(current-age-time < 480)
(unit-type-count-total monk < 3)
(unit-type-count-total 134 == 0); 134 = dead monk; dont make monks when they're dying while trying to collect relics behind enemy bases.
(can-train monk)
=>
(train monk)
)
#end-if
(defrule
(or (strategic-number sn-resource-control < 1)
(strategic-number sn-resource-control == monk))
(unit-type-count-total monk == 0)
(unit-type-count-total 134 == 0); 134 = dead monk; dont make monks when they're dying while trying to collect relics behind enemy bases.
(can-train monk)
=>
(train monk)
)
; Trade
(defrule
(nor (research-available ri-double-bit-axe)
(research-available ri-horse-collar))
(goal strategy-goal sling)
(can-research ri-coinage)
=>
(research ri-coinage)
)
(defrule
(strategic-number sn-resource-control <= 2)
(or (strategic-number sn-current-age >= ci-transit)
(and (and (food-amount > 500)
(gold-amount < 200))
(unit-type-count villager > villager-coinage)))
(or (unit-type-count villager > villager-coinage)
(unit-type-count villager >= max-civ))
(players-building-type-count any-ally market > 0)
(can-research ri-coinage)
=>
(research ri-coinage)
)
(defrule
(or (and (strategic-number sn-resource-control <= 2)
(strategic-number sn-current-age >= ci-transit))
(strategic-number sn-resource-control == sling))
(players-building-type-count any-ally market > 0)
(can-research ri-banking)
=>
(research ri-banking)
)
(defrule
(strategic-number sn-resource-control <= 2)
(or (unit-type-count-total trade-cart >= 6)
(unit-type-count-total trade-cog >= 6))
(can-research-with-escrow ri-caravan)
=>
(release-escrow food)(release-escrow gold)
(research ri-caravan)
)
#load-if-not-defined DEFEND-WONDER
#load-if-not-defined POPULATION-CAP-25
#load-if-not-defined POPULATION-CAP-50
#load-if-defined ITALIAN-CIV
(defrule
(unit-type-count trade-cart < 15)
(player-in-game any-ally)
(can-research ri-silk-road)
=>
(research ri-silk-road)
)
#end-if
(defrule
(or (or (not(player-in-game any-ally))
(or (players-building-type-count every-ally market == 0)
(building-type-count town-center == 0)))
(or (unit-type-count-total trade-cart >= max-trade-pop); depending on popcap and difficulty
(unit-type-count-total trade-cart >= max-trade-cart))); depending on map size
=>
(up-jump-rule 2); rule too long
)
(defrule
(strategic-number sn-resource-control <= 2)
(or (research-available imperial-age)
(strategic-number sn-current-age >= ci-transit))
(or (strategic-number sn-minimum-water-body-size-for-dock <= water-mixed)
(map-type team-islands))
(or (or (game-time > 2100);35 min
(and (unit-type-count battering-ram-line > 1)
(goal unit-goal monk)))
(death-match-game))
(can-train trade-cart)
=>
(train trade-cart)
)
(defrule
(strategic-number sn-resource-control <= 2)
(goal strategy-goal sling)
(goal under-attack-goal 0)
(strategic-number sn-minimum-water-body-size-for-dock <= water-mixed)
(game-time > 1800)
(can-train trade-cart)
=>
(train trade-cart)
)
(defrule
(or (unit-type-count 178 > 0);dead trade cart (empty/loaded)
(unit-type-count 205 > 0))
=>
(set-strategic-number sn-preferred-trade-distance 60)
)
(defrule
(unit-type-count 178 == 0)
(unit-type-count 205 == 0)
=>
(set-strategic-number sn-preferred-trade-distance trade-distance)
)
#end-if
#end-if
#end-if
#end-if ; NO WONDER-RACE
; VILLAGERS
(defrule
(strategic-number sn-current-age == dark)
(unit-type-count-total villager >= villager-feudal); object-type-count-total ; also for others below
(or (or (difficulty != hardest)
(game-type == 8))
(or (starting-resources != low-resources)
(or (strategic-number sn-minimum-water-body-size-for-dock >= water-mixed)
(map-type yucatan))))
=>
(set-strategic-number sn-enable-training-queue 0)
)
(defrule
(strategic-number sn-current-age == dark)
(unit-type-count-total villager >= villager-flush)
(or (goal strategy-goal flush)
(and (unit-type-count-total villager >= dark-age-villager)
(or (unit-type-count-total villager >= 32); allows better boom if pocket
(or (up-compare-goal position-goal == flank)
(or (goal unit-goal my-unique-unit-line); but don't do with UU, to get the castle faster (prevent rush)
(goal unit-goal monk))))))
=>
(set-strategic-number sn-enable-training-queue 0)
)
(defrule
(or (and (current-age == feudal-age)
(or (food-amount > 500)
(strategic-number sn-current-age == fc-transit)))
(or (and (goal need-loom-goal 1)
(research-available ri-loom))
(and (current-age < imperial-age)
(death-match-game))))
=>
(set-strategic-number sn-enable-training-queue 0)
)
(defrule
(current-age >= castle-age)
(or (up-compare-goal strategy-goal != boom)
(or (strategic-number sn-resource-control > 2)
(and (research-available imperial-age); (strategic-number sn-current-age == castle)
(and (food-amount >= imp-f2)
(gold-amount >= imp-g2)))))
=>
(set-strategic-number sn-enable-training-queue 0)
)
(defrule
(current-age == castle-age)
(strategic-number sn-current-age == castle)
(research-available imperial-age)
(food-amount >= imp-food)
(gold-amount >= imp-gold)
=>
(set-strategic-number sn-enable-training-queue 0)
)
(defrule
(or (and (strategic-number sn-current-age >= ci-transit)
(strategic-number sn-resource-control >= 1))
(or (population >= max-civ-pop)
(and (goal strategy-goal flush)
(current-age-time < 300))))
(current-age >= feudal-age)
=>
(set-strategic-number sn-enable-training-queue 0)
)
#load-if-not-defined DEATH-MATCH
#load-if-not-defined HIGH-RESOURCES-START
#load-if-not-defined MEDIUM-RESOURCES-START
(defrule
(civilian-population < max-civ); difficulty
(or (and (current-age == dark-age)
(unit-type-count villager < 33))
(current-age == feudal-age))
(up-compare-goal unit-goal != wonder)
(unit-type-count villager < 35)
(goal strategy-goal fast-imp)
(goal train-civ-goal 1)
(can-train villager)
=>
(disable-timer FDrop)
(enable-timer FDrop 21)
(train villager)
; (chat-local-to-self "Fast-imp test.")
)
#load-if-defined WONDER-RACE
(defrule
(civilian-population < max-civ); difficulty
(or (or (and (current-age == dark-age)
(unit-type-count villager < villager-wonder-dark))
(and (current-age >= feudal-age)
(unit-type-count villager < villager-wonder-feudal)))
(current-age == imperial-age))
(goal train-civ-goal 1)
(can-train villager)
=>
(disable-timer FDrop)
(enable-timer FDrop 21)
(train villager)
)
#end-if
#end-if
#end-if
#end-if
#load-if-not-defined WONDER-RACE
(defrule
(civilian-population >= max-civ); difficulty
=>
(up-jump-rule 6))
(defrule
(strategic-number sn-current-age == dark)
(unit-type-count villager < 31)
(nor (goal strategy-goal flush)
(strategic-number sn-minimum-water-body-size-for-dock == water-islands))
(or (unit-type-count villager < dark-age-villager)
(or (food-amount < 700); 620
(unit-type-count villager < villager-feudal)))
(or (food-amount < 820)
(unit-type-count villager < 23))
(goal train-civ-goal 1)
(can-train villager)
=>
(disable-timer FDrop)
(enable-timer FDrop 21)
(train villager))
(defrule
(strategic-number sn-current-age == dark)
(unit-type-count villager < 31)
;(or (unit-type-count villager < villager-feudal)
(or (goal strategy-goal flush)
(strategic-number sn-minimum-water-body-size-for-dock == water-islands))
(or (unit-type-count villager < villager-feudal)
(food-amount < 430))
(goal train-civ-goal 1)
(can-train villager)
=>
(disable-timer FDrop)
(enable-timer FDrop 21)
(train villager))
(defrule
(goal train-civ-goal 1)
(current-age == feudal-age)
(or (goal strategy-goal flush)
(goal strategy-goal sling))
(or (not (research-available castle-age))
(or (food-amount < 740)
(gold-amount < 160)))
(unit-type-count-total villager < max-civ)
(population < max-civ-pop)
(can-train villager)
=>
(disable-timer FDrop)
(enable-timer FDrop 21)
(train villager))
(defrule
(goal train-civ-goal 1)
(food-amount < 500) ; else escrow
(strategic-number sn-current-age == feudal)
(population < max-civ-pop)
(can-train villager)
=>
(disable-timer FDrop)
(enable-timer FDrop 21)
(train villager))
(defrule
(goal train-civ-goal 1)
(up-pending-objects c: villager <= 0)
(food-amount >= 750)
; (building-type-count blacksmith == 0)
(building-type-count archery-range == 0)
(building-type-count stable == 0)
(building-type-count market == 0)
(strategic-number sn-current-age == feudal)
(population < max-civ-pop)
(can-train villager)
=>
(disable-timer FDrop)
(enable-timer FDrop 21)
(train villager))
(defrule
(goal train-civ-goal 1)
(current-age >= castle-age)
(civilian-population < max-civ)
(or (population < max-civ-pop)
(game-time < 1800)); keep training villagers in DM
(can-train villager)
=>
(disable-timer FDrop)
(enable-timer FDrop 21)
(train villager)); End jump
#load-if-defined POPULATION-CAP-200
#load-if-not-defined DIFFICULTY-EASIEST
#load-if-not-defined DIFFICULTY-EASY
#load-if-not-defined DIFFICULTY-MODERATE
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(civilian-population < max-civ); difficulty
(goal train-civ-goal 1)
(strategic-number sn-current-age == castle)
(food-amount > 200)
(gold-amount < 600)
(population < max-civ-pop)
(civilian-population < 140)
(or (goal unit-goal knight); train extra villagers with knights or elephants
(civ-selected persian))
(can-train villager)
=>
(disable-timer FDrop)
(enable-timer FDrop 21)
(train villager)
)
#end-if
#end-if
#end-if
#end-if
#load-if-not-defined DIFFICULTY-EASIEST
#load-if-not-defined DIFFICULTY-EASY
(defrule
(strategic-number sn-current-age != dark)
=>
(up-jump-rule 5))
(defrule
(or (game-time >= 76)
(civ-selected chinese))
; (unit-type-count-total villager >= 7);7
(up-pending-objects c: villager <= 1)
(up-research-status c: ri-loom != research-pending)
(timer-triggered FDrop)
;j (strategic-number sn-current-age == dark)
(or (and (food-amount < 50)
(housing-headroom > 0))
(and (food-amount < 500)
(and (unit-type-count villager >= 20)
(food-amount >= 400))));hopefully boar food too
=>
(chat-to-player my-player-number "123"))
(defrule
(or (game-time >= 76)
(civ-selected chinese))
(up-pending-objects c: villager == 0)
(up-research-status c: ri-loom != research-pending)
(up-timer-status FDrop != timer-running)
;j (strategic-number sn-current-age == dark)
(or (and (food-amount < 50)
(housing-headroom > 0))
(and (food-amount < 500)
(and (unit-type-count villager >= 20)
(food-amount >= 400))));hopefully boar food too
=>
(chat-to-player my-player-number "123"))
(defrule
(taunt-detected my-player-number 123)
(up-pending-objects c: villager <= 1)
(up-research-status c: ri-loom != research-pending)
;j (strategic-number sn-current-age == dark)
=>
(acknowledge-taunt my-player-number 123)
(disable-timer FDrop)
; (enable-timer FDrop 2)
; (chat-local-to-self "Forced drop.")
(up-drop-resources forage-food c: 4)
(up-drop-resources sheep-food c: 4)
(up-drop-resources boar-food c: 4))
(defrule
(taunt-detected my-player-number 123)
=>
(disable-timer FDrop)
; (enable-timer FDrop 2)
; (chat-local-to-self "Denying forced drop.")
(acknowledge-taunt my-player-number 123))
(defrule
(timer-triggered FDrop)
(up-pending-objects c: villager >= 2)
(building-type-count town-center <= 1)
=>
(disable-timer FDrop)
; (chat-local-to-self "Denying forced drop2.")
)
(defrule
(building-type-count-total blacksmith >= 1)
=>
(enable-timer FDrop 15)
(disable-self))
(defrule
(timer-triggered FDrop)
(strategic-number sn-current-age == feudal)
(food-amount < 800)
(food-amount >= 700)
(gold-amount >= 165)
=>
(chat-to-player my-player-number "123"))
(defrule
(strategic-number sn-current-age == feudal)
(building-type-count-total blacksmith >= 1)
(up-research-status c: ri-wheel-barrow != research-pending)
(taunt-detected my-player-number 123)
=>
(acknowledge-taunt my-player-number 123)
(disable-timer FDrop)
(enable-timer FDrop 2)
; (chat-local-to-self "Forced drop.")
(up-drop-resources food c: 4))
(defrule
(timer-triggered FDrop)
(strategic-number sn-current-age == feudal)
(food-amount >= 740)
(gold-amount < 200)
(gold-amount >= 165)
=>
(chat-to-player my-player-number "124"))
(defrule
(strategic-number sn-current-age == feudal)
(building-type-count-total blacksmith >= 1)
(up-research-status c: ri-wheel-barrow != research-pending)
(taunt-detected my-player-number 124)
=>
(acknowledge-taunt my-player-number 124)
(disable-timer FDrop)
(enable-timer FDrop 2)
; (chat-local-to-self "Forced drop.")
(up-drop-resources gold c: 5))
(defrule
(timer-triggered FDrop)
(strategic-number sn-current-age > feudal)
=>
(disable-timer FDrop)
(disable-self))
(defrule
(or (taunt-detected my-player-number 123)
(taunt-detected my-player-number 124))
(strategic-number sn-current-age > feudal)
=>
(acknowledge-taunt my-player-number 123)
(acknowledge-taunt my-player-number 124)
(disable-self))
#end-if
#end-if
;********** BUILDINGS **********
#load-if-defined VICTORY-STANDARD
(defrule
(goal nomad no)
(goal landnomad no)
(building-type-count-total wonder >= 1)
=>
(enable-wall-placement 2)
(disable-self))
(defrule
(goal nomad no)
(goal landnomad no)
(building-type-count-total wonder >= 1)
(building-type-count-total gate < 5)
(can-build-gate 2)
=>
(build-gate 2))
(defrule
(goal nomad no)
(goal landnomad no)
(building-type-count-total wonder >= 1)
(can-build-wall 2 stone-wall-line)
=>
(build-wall 2 stone-wall-line))
(defrule
(building-type-count-total wonder < 1)
(players-building-type-count every-ally wonder < 1)
(can-build wonder)
=>
(build wonder))
#end-if
#load-if-not-defined DARK-AGE-END; in case it gets implemented later
#load-if-not-defined FEUDAL-AGE-END
#load-if-not-defined UP-SCENARIO-GAME; don't want to screw up beautiful scenarios
(defrule
(building-type-count wall-class <= 0)
(building-type-count gate-class <= 0)
=>
(up-jump-rule 1))
(defrule
(game-time > 300)
(building-type-count-total wonder <= 0)
(not (hold-relics)); for now
(or (population >= del-civ-pop)
(and (civilian-population >= max-civ)
(military-population >= 50)))
=>
(delete-building 939); gate
(delete-building stone-wall-line))
#end-if
#end-if
#end-if
#load-if-defined VICTORY-STANDARD
(defrule
(taunt-detected any-ally 37)
(building-available wonder)
(building-type-count-total wonder < 1)
(wood-amount >= 1100)
(gold-amount < 1000)
(can-sell-commodity wood)
=>
(sell-commodity wood))
(defrule
(taunt-detected any-ally 37)
(building-available wonder)
(building-type-count-total wonder < 1)
(wood-amount < 1000)
(gold-amount >= 1175)
(commodity-buying-price wood <= 175)
=>
(buy-commodity wood))
(defrule
(taunt-detected any-ally 37)
(building-available wonder)
(building-type-count-total wonder < 1)
(food-amount >= 1100); for now
(gold-amount < 1000)
(can-sell-commodity food)
=>
(sell-commodity food))
(defrule
(taunt-detected any-ally 37)
(building-available wonder)
(building-type-count-total wonder < 1)
(stone-amount < 1000)
(gold-amount >= 1250)
(commodity-buying-price stone <= 250)
=>
(buy-commodity stone))
(defrule
(taunt-detected any-ally 37)
(building-type-count-total wonder < 1)
(can-build wonder)
=>
(build wonder)
(acknowledge-taunt every-ally 37))
#end-if
(defrule
(taunt-detected any-ally 37)
(building-type-count-total wonder >= 1)
=>
(chat-to-allies-using-id 22118); "Alas, I cannot help that at this time."
(acknowledge-taunt every-ally 37))
#load-if-not-defined VICTORY-STANDARD
(defrule
(taunt-detected any-ally 37)
=>
(chat-to-allies-using-id 22118); "Alas, I cannot help that at this time."
(acknowledge-taunt every-ally 37))
#end-if
#load-if-defined VICTORY-STANDARD
(defrule
(taunt-detected any-ally 37)
(stone-amount < 1650)
=>
(up-jump-rule 4)); block until we have a wonder
#end-if
(defrule
(up-pending-objects c: castle < 2)
(unit-type-count-total villager >= villager-castle)
(building-available castle)
(stone-amount >= castle-stone)
(goal increase-town-size-goal 0)
=>
(set-goal increase-town-size-goal castle)
(enable-timer increase-town-size-timer 4))
(defrule
(goal increase-town-size-goal castle)
(stone-amount < castle-stone)
=>
(set-goal increase-town-size-goal 2))
(defrule
(goal increase-town-size-goal castle)
(strategic-number sn-maximum-town-size >= 60)
(strategic-number sn-target-player-number g:== closest-enemy-goal); up-compare-sn ; same for others below
(building-type-count castle > 0)
;(or (up-compare-const allow-forward-castle == 1)
(building-type-count-total castle > 2);)
(stone-amount >= castle-stone)
(can-build castle)
=>
(build-forward castle)
(set-goal forward-goal 1)
(set-goal increase-town-size-goal 2))
(defrule
(goal increase-town-size-goal castle)
; (stone-amount >= castle-stone)
(can-build castle)
=>
(build castle)
(set-goal increase-town-size-goal 2))
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(up-research-status c: ri-bombard-tower >= research-pending)
(or (building-type-count-total bombard-tower < 10)
(gold-amount > 2500))
(unit-type-count trade-cart > 14)
(unit-type-count 42 > 0); trebuchets in siege mode
(population > del-civ-pop); high pop
(can-buy-commodity stone)
(gold-amount >= 900)
(stone-amount < 100)
(commodity-buying-price stone < 400)
=>
(buy-commodity stone)
(chat-to-player my-player-number "6Buying stone to push with bbt.")
)
(defrule
(or (strategic-number sn-archer-threat > 1)
(players-unit-type-count focus-player scorpion-line > 9))
(goal unit-goal monk)
(building-type-count-total siege-workshop < 1)
(building-type-count-total monastery > 0)
=>
(up-jump-rule 1)
)
(defrule
(building-type-count town-center > 0)
(goal increase-town-size-goal 0)
(goal unit-goal monk)
(or
(and
(building-type-count-total monastery < 3)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
)
(and
(current-age == imperial-age)
(current-age-time > 180)
)
)
(goal save-wood-goal 0)
(building-type-count-total monastery < 5)
(can-build monastery)
=>
(build monastery)
(set-goal increase-town-size-goal 2)
)
(defrule
(building-type-count town-center > 0)
(goal increase-town-size-goal 0)
(goal ranged-unit-type-goal monk)
(strategic-number sn-current-age >= ci-transit)
(building-type-count-total monastery < 3)
(wood-amount > 300)
(goal save-wood-goal 0)
(can-build monastery)
=>
(build monastery)
(set-goal increase-town-size-goal 2)
)
#load-if-defined CAPTURE-THE-RELIC ; for scenarios etc
(defrule
(building-type-count town-center > 0)
(goal increase-town-size-goal 0)
(strategic-number sn-current-age >= ci-transit)
(building-type-count-total monastery < 1)
(wood-amount > 200); 300
(goal save-wood-goal 0)
(can-build monastery)
=>
(build monastery)
(set-goal increase-town-size-goal 2)
)
#end-if
#load-if-defined AZTEC-CIV
#load-if-not-defined POST-IMPERIAL-AGE-START
(defrule
(goal increase-town-size-goal 0)
(goal save-wood-goal 0)
(building-type-count-total siege-workshop > 0)
(building-type-count-total town-center >= tc-level-three)
(or
(building-type-count-total monastery < 2)
(strategic-number sn-current-age >= ci-transit)
)
(building-type-count-total monastery < 3)
(nor
(goal enemy-goal eagle-warrior)
(or
(goal unit-goal archer)
(goal unit-goal eagle-warrior)
)
)
(can-build monastery)
=>
(build monastery)
)
(defrule
(goal increase-town-size-goal 0)
(goal save-wood-goal 0)
(building-type-count-total town-center >= tc-level-two)
(or
(building-type-count-total town-center >= tc-level-three)
(building-type-count-total monastery < 2)
)
(or
(building-type-count-total town-center >= tc-level-four)
(building-type-count-total monastery < 3)
)
(building-type-count-total monastery < 5)
(goal ranged-unit-type-goal monk)
(can-build monastery)
=>
(build monastery)
)
#else
(defrule
(unit-type-count villager > villager-monastery)
(or
(or
(players-civ every-enemy indian)
(players-civ every-enemy slavic)
)
(or
(or
(players-civ every-enemy gothic)
(players-civ every-enemy persian)
)
(or
(players-civ every-enemy korean)
(players-civ every-enemy chinese)
)
)
)
(building-type-count-total monastery < 5)
(can-build monastery)
=>
(build monastery)
)
#end-if
#end-if
#load-if-not-defined DEATH-MATCH
#load-if-defined BRITON-CIV
(defrule
(up-compare-goal strategy-goal != boom)
(or
(and
(and
(goal unit-goal archer)
(goal control-goal aggressive-rush)
)
(or
(building-type-count-total archery-range < 4); don't mess up build order because british TC discount
(building-type-count-total siege-workshop < 1)
)
)
(and
(building-type-count-total monastery < 1)
(building-type-count-total town-center > 1)
)
)
=>
(up-jump-rule 2)
)
#end-if
(defrule
(or
(or
(and
(goal strategy-goal fast-imp)
(and
(current-age < imperial-age)
(wood-amount < 400)
)
)
(and
(goal strategy-goal shot)
(building-type-count-total siege-workshop == 0)
)
)
(and
(goal unit-goal my-unique-unit-line)
(building-type-count-total castle == 0)
)
)
=>
(up-jump-rule 1)
)
(defrule
(goal save-wood-goal 0)
(current-age >= castle-age)
(can-afford-building town-center)
(building-type-count-total town-center < 5)
(goal increase-town-size-goal 0)
=>
(enable-timer increase-town-size-timer 6)
(set-goal increase-town-size-goal town-center)
)
(defrule
(goal increase-town-size-goal town-center)
(strategic-number sn-current-age == castle)
(building-type-count town-center >= 1)
(goal unit-goal monk)
(not (research-available imperial-age))
=>
(disable-timer increase-town-size-timer)
(set-goal increase-town-size-goal 0)
)
(defrule
(building-type-count town-center > 0)
(current-age >= castle-age)
(goal increase-town-size-goal town-center)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(goal unit-goal archer)
(goal strategy-goal rush)
(players-building-type-count focus-player watch-tower > 0)
(building-type-count-total siege-workshop < 1)
=>
(set-goal increase-town-size-goal 0)
)
(defrule
(building-type-count town-center > 0)
(goal save-wood-goal 0)
(goal increase-town-size-goal town-center)
(building-type-count-total town-center < 5)
(can-build town-center)
=>
(build town-center)
)
#else; => DM
#load-if-not-defined POST-IMPERIAL-AGE-START
(defrule
(goal save-wood-goal 0)
(building-type-count-total monastery > 0)
(building-type-count-total siege-workshop > 0)
(building-type-count-total town-center < 5)
(goal increase-town-size-goal 0)
(can-build town-center)
=>
(build town-center)
)
(defrule
(unit-type-count villager < 15)
(building-type-count-total town-center >= 1); test
(goal increase-town-size-goal town-center)
=>
(set-goal increase-town-size-goal 0)
)
#end-if
#end-if
#end-if; NOT WONDER-RACE
#load-if-not-defined DEATH-MATCH
(defrule
(current-age == feudal-age)
(or
(up-research-status c: ri-wheel-barrow != research-pending)
(current-age-time > 40)
)
(current-age-time > 20)
(food-amount > 700)
(up-compare-goal strategy-goal != flush)
(building-type-count-total blacksmith == 0)
=>
(up-assign-builders c: blacksmith c: 3)(disable-self)
)
(defrule
(current-age-time < 10)
(current-age == feudal-age)
(or
(and
(up-pending-objects c: villager > 0)
(food-amount > 700)
)
(or
(goal strategy-goal flush)
(goal strategy-goal sling)
)
)
=>
(up-assign-builders c: archery-range c: 2)
(up-assign-builders c: stable c: 2)
(up-assign-builders c: market c: 2)(disable-self)
)
#end-if
#load-if-not-defined POST-IMPERIAL-AGE-START
(defrule
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
(building-type-count-total town-center < 3)
=>
(set-goal increase-town-size-goal 0)
(up-jump-rule 3)
)
(defrule
(goal save-wood-goal 0)
(goal increase-town-size-goal 0)
(current-age >= castle-age)
(building-type-count-total town-center > 0)
(player-in-game any-ally)
(up-compare-goal strategy-goal != boom)
(or
(building-type-count-total town-center >= tc-level-two)
(nor
(goal unit-goal knight)
(goal unit-goal archer)
)
)
(building-type-count-total monastery == 0)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal monastery)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal save-wood-goal 0)
(goal increase-town-size-goal 0)
(current-age >= castle-age)
(building-type-count-total town-center > 0)
(or
(and
(goal strategy-goal boom)
(building-type-count-total town-center >= tc-boom-monastery)
)
(goal strategy-goal fast-imp)
)
(building-type-count-total monastery == 0)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal monastery)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal increase-town-size-goal 0)
(current-age >= castle-age)
(building-type-count-total town-center > 0)
(or
(goal unit-goal wonder)
(not (player-in-game any-ally))
)
(building-type-count-total monastery == 0)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal monastery)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal increase-town-size-goal 0)
(current-age >= castle-age)
(building-type-count-total town-center > 0)
(strategic-number sn-minimum-water-body-size-for-dock >= water-mixed)
(building-type-count-total monastery == 0)
(wood-amount >= 175)
(food-amount > 500)
(gold-amount > 400)
=>
(set-goal increase-town-size-goal monastery)
(enable-timer increase-town-size-timer 4)
)
#load-if-defined DEATH-MATCH
(defrule
(goal increase-town-size-goal 0)
(current-age >= castle-age)
(up-compare-goal increase-town-size-goal != monastery)
(building-type-count-total siege-workshop > 0)
(building-type-count-total monastery == 0)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal monastery)
(enable-timer increase-town-size-timer 4)
)
#end-if
#load-if-not-defined WONDER-RACE
(defrule
(building-type-count-total town-center == 0); rebuild tc and no stone => get a market and buy some.
(stone-amount < 100)
(building-type-count-total market == 0)
(dropsite-min-distance wood < 10)
(can-afford-building market)
(building-available market)
=>
(set-goal increase-town-size-goal market)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal increase-town-size-goal 0)
(or (or (building-type-count-total town-center >= tc-level-four)
(strategic-number sn-resource-control == sling))
(and (wood-amount > 430)
(or (building-type-count-total town-center >= tc-level-three)
(wood-amount > 1000))))
(goal save-wood-goal 0)
(building-type-count-total market == 0)
(can-afford-building market)
(building-available market)
=>
(set-goal increase-town-size-goal market)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal increase-town-size-goal 0)
(current-age >= castle-age)
(or (and (unit-type-count villager > 60)
(or (goal strategy-goal boom)
(player-in-game any-ally)))
(and (research-available imperial-age)
(goal strategy-goal fast-imp)))
(building-type-count-total market == 0)
(can-afford-building market)
=>
(set-goal increase-town-size-goal market)
(enable-timer increase-town-size-timer 4)
)
#load-if-not-defined POPULATION-CAP-25
#load-if-not-defined POPULATION-CAP-50
#load-if-not-defined SMALL-MAP
#load-if-not-defined TINY-MAP
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(building-type-count town-center > 0)
(wood-amount > 400)
(or (game-time > market-time)
(building-type-count-total town-center > 4))
(player-in-game any-ally)
(players-building-type-count any-ally market > 0)
(building-type-count-total market < number-markets)
(can-build market)
=>
(build market)
)
#end-if
#end-if
#end-if
#end-if
#load-if-not-defined AZTEC-CIV
#load-if-not-defined INCAN-CIV
#load-if-not-defined MAYAN-CIV
(defrule
(goal increase-town-size-goal 0)
(goal strategy-goal flush)
(up-research-status c: ri-bloodlines >= research-available)
(strategic-number sn-current-age >= fc-transit)
(game-time < 1560); don't build them too late e.g. after slinging
(building-type-count-total stable < 1)
(wood-amount >= 245)
=>
(set-goal increase-town-size-goal stable)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal increase-town-size-goal 0)
(or
(goal strategy-goal flush)
(goal unit-goal mix)
)
(building-type-count-total archery-range > 0)
(or
(or
(goal unit-goal scout-cavalry)
(goal monk-threat-goal 1)
)
(and
(goal strategy-goal mix)
(strategic-number sn-current-age >= fc-transit)
)
)
(building-type-count-total stable < 1)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal stable)
(enable-timer increase-town-size-timer 4)
)
#load-if-defined BRITON-CIV
(defrule
(goal increase-town-size-goal 0)
(research-available ri-man-at-arms)
(players-unit-type-count every-enemy skirmisher-line > 24)
(or
(and
(building-type-count-total town-center >= tc-level-three)
(building-type-count-total stable < 1)
)
(unit-type-count-total villager > 90)
)
(building-type-count-total stable < 2)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal stable)
(enable-timer increase-town-size-timer 4)
)
#end-if
(defrule
(goal increase-town-size-goal 0)
(goal unit-goal archer)
(building-type-count-total stable < 1)
(building-type-count-total archery-range > 2)
(research-available ri-man-at-arms)
(players-civ focus-player aztec)
(or
(goal enemy-goal eagle-warrior)
(or
(players-building-type-count focus-player market > 0)
(players-building-type-count focus-player barracks > 1)
)
)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal stable)
(enable-timer increase-town-size-timer 4)
)
#load-if-defined CHINESE-CIV
(defrule
(goal increase-town-size-goal 0)
(goal unit-goal my-unique-unit-line)
(building-type-count-total town-center >= tc-level-four)
(unit-type-count-total villager > 90)
(building-type-count-total stable < 2)
(wood-amount >= 175)
(food-amount > 600)
(gold-amount < 75)
=>
(set-goal increase-town-size-goal stable)
(enable-timer increase-town-size-timer 4)
)
#end-if
#load-if-not-defined BYZANTINE-CIV
#load-if-not-defined KOREAN-CIV
(defrule
(goal increase-town-size-goal 0)
(or
(or
(or
(unit-type-count-total cavalry-unit-class > 11)
(unit-type-count-total cavalry-archer-class > 11)
)
(unit-type-count-total conquistador-line > 11)
)
(strategic-number sn-current-age >= ci-transit)
)
(wood-amount >= 175)
(building-type-count-total stable < 1)
=>
(set-goal increase-town-size-goal stable)
(enable-timer increase-town-size-timer 4)
)
#end-if
#end-if
#load-if-defined SARACEN-CIV
(defrule
(goal increase-town-size-goal 0)
(unit-type-count-total mameluke-line > 11)
(building-type-count-total stable < 1)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal stable)
(enable-timer increase-town-size-timer 4)
)
#load-if-not-defined DIFFICULTY-EASIEST
#load-if-not-defined DIFFICULTY-EASY
(defrule
(goal increase-town-size-goal 0)
(up-research-status c: ri-hussar >= research-pending)
(food-amount > 1200)
(wood-amount > 400)
(building-type-count-total stable < 7)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal stable)
(enable-timer increase-town-size-timer 4)
)
#end-if
#end-if
#end-if
#load-if-not-defined VIKING-CIV
(defrule
(goal increase-town-size-goal 0)
(goal unit-goal archer)
(building-type-count-total archery-range > 3)
(building-type-count-total town-center >= tc-level-two)
(building-type-count-total stable < 2)
(research-available ri-man-at-arms)
(or
(strategic-number sn-current-age >= ci-transit)
(and
(unit-type-count villager > 50)
(and
(food-amount > 400)
(gold-amount < 150)
)
)
)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal stable)
(enable-timer increase-town-size-timer 4)
)
#end-if
(defrule
(goal increase-town-size-goal 0)
(goal unit-goal gunpowder-class)
(building-type-count-total stable < 1)
(building-type-count-total archery-range > 1)
(or
(and
(civ-selected turkish)
(strategic-number sn-cavalry-threat > 1); get camels vs cavalry with turks
)
(and
(building-type-count-total archery-range > 5)
(building-type-count-total university > 0)
)
)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal stable)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal increase-town-size-goal 0)
(or
(building-type-count-total town-center >= tc-level-four)
(or
(goal monk-threat-goal 1)
(and
(goal meso-enemy-goal 1)
(or
(goal enemy-goal rush)
(goal enemy-goal eagle-warrior)
)
)
)
)
(building-type-count-total stable < 1)
(current-age >= castle-age)
(goal unit-goal skirmisher)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal stable)
(enable-timer increase-town-size-timer 4)
)
#load-if-defined INDIAN-CIV
(defrule
(goal increase-town-size-goal 0)
(building-type-count-total town-center >= tc-level-three)
(building-type-count-total stable < 3)
(up-research-status c: imperial-age >= research-available)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal stable)
(enable-timer increase-town-size-timer 4)
)
#end-if
(defrule
(goal increase-town-size-goal 0)
(building-type-count-total stable < 1)
(goal strategy-goal boom)
(goal monk-threat-goal 1)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal stable)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal increase-town-size-goal 0)
(building-type-count-total stable < 2)
(or
(and
(building-type-count-total blacksmith > 0)
(up-compare-goal strategy-goal != boom)
)
(building-type-count-total stable < 1)
)
(or
(goal unit-goal knight)
(and
(goal unit-goal scout-cavalry)
(goal strategy-goal rush)
)
)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal stable)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal increase-town-size-goal 0)
(building-type-count-total stable < 1)
(goal unit-goal cavalry-archer)
(or
(building-type-count-total monastery > 0)
(building-type-count-total town-center >= tc-level-two)
)
(building-type-count-total archery-range > 2)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal stable)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal increase-town-size-goal 0)
(goal unit-goal knight)
(goal control-goal shot)
(building-type-count-total blacksmith > 0)
(building-type-count-total stable < 3)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal stable)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal increase-town-size-goal 0)
(building-type-count-total university > 0)
(up-research-status c: ri-light-cavalry >= research-pending)
(or
(building-type-count-total stable < 3)
(and
(wood-amount > 350)
(strategic-number sn-current-age >= ci-transit)
)
)
(building-type-count-total stable < 4)
(wood-amount >= 225)
=>
(set-goal increase-town-size-goal stable)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal increase-town-size-goal 0)
(building-type-count-total town-center >= tc-level-four)
(goal unit-goal knight)
(or
(and
(building-type-count-total stable < 4)
(strategic-number sn-military-level < 0)
)
(strategic-number sn-current-age >= ci-transit)
)
(building-type-count-total stable < 6)
(wood-amount >= 225)
=>
(set-goal increase-town-size-goal stable)
(enable-timer increase-town-size-timer 4)
)
#load-if-not-defined HUN-CIV
(defrule
(goal increase-town-size-goal 0)
(goal unit-goal knight)
(goal strategy-goal boom)
(building-type-count town-center >= tc-level-three)
(or
(building-type-count-total stable < 2)
(building-type-count-total town-center >= tc-level-four)
)
(strategic-number sn-military-level < 0)
(goal position-goal flank)
(building-type-count-total stable < 4)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal stable)
(enable-timer increase-town-size-timer 4)
)
#end-if
(defrule
(goal increase-town-size-goal 0)
(goal strategy-goal flush)
(building-type-count town-center >= tc-level-two)
(goal unit-goal default-ranged)
(or
(or
(civ-selected frankish)
(civ-selected persian)
)
(or
(civ-selected spanish)
(civ-selected teutonic)
)
)
(building-type-count-total stable < 2)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal stable)
(enable-timer increase-town-size-timer 4)
)
#load-if-defined DEATH-MATCH
(defrule
(or
(building-type-count-total stable < 1)
(or
(building-type-count-total blacksmith > 0)
(current-age >= castle-age)
)
)
(or
(or
(building-type-count-total stable < 6)
(civ-selected hun)
)
(building-type-count-total siege-workshop > 0)
)
(building-type-count-total stable < number-stables)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal stable)
(enable-timer increase-town-size-timer 4)
)
#end-if
#end-if; NOT AZTEC
#end-if; NOT INCAN
#end-if; NOT MAYAN
#load-if-defined INCAN-CIV
(defrule
(goal increase-town-size-goal 0)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(building-type-count-total archery-range < 2)
(building-type-count-total monastery > 0)
(or
(strategic-number sn-infantry-threat > 1)
(players-civ focus-player gothic)
)
(or
(building-type-count-total archery-range < 1)
(building-type-count-total siege-workshop > 0)
)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal archery-range)
(enable-timer increase-town-size-timer 4)
)
#end-if
(defrule
(goal increase-town-size-goal 0)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(building-type-count-total barracks > 2)
(goal unit-goal eagle-warrior)
(players-unit-type-count every-enemy eagle-warrior-line < 6)
(strategic-number sn-cavalry-threat == 0)
(wood-amount > 350)
(food-amount > 150)
(gold-amount < 50)
(building-type-count-total archery-range < 2)
=>
(set-goal increase-town-size-goal archery-range)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal increase-town-size-goal 0)
(strategic-number sn-minimum-water-body-size-for-dock > water-mixed)
(strategic-number sn-current-age >= ci-transit)
(building-type-count-total town-center >= tc-level-three)
(or
(building-type-count-total archery-range < 1)
(and
(building-type-count-total town-center >= tc-level-four)
(or
(up-research-status c: ri-crossbow >= research-pending)
(civ-selected hun)
)
)
)
(building-type-count-total archery-range < 2)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal archery-range)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal increase-town-size-goal 0)
(goal strategy-goal flush)
(or
(goal enemy-goal flush)
(and
(current-age-time > 200)
(wood-amount > 270)
)
)
(building-type-count-total archery-range < 3)
(strategic-number sn-current-age == feudal)
(building-type-count-total blacksmith > 0)
(wood-amount >= 220)
=>
(set-goal increase-town-size-goal archery-range)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal increase-town-size-goal 0)
(goal strategy-goal flush)
(building-type-count-total archery-range < 4)
(strategic-number sn-current-age == fc-transit)
(or
(strategic-number sn-military-level < 0)
(and
(players-current-age focus-player == castle-age)
(or
(players-unit-type-count focus-player archer-line > 15)
(players-building-type-count focus-player archery-range > 2)
)
)
)
(up-compare-goal unit-goal != knight)
(wood-amount >= 220)
=>
(set-goal increase-town-size-goal archery-range)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal increase-town-size-goal 0)
(current-age == feudal-age)
(not (goal unit-goal knight))
(building-type-count-total market < 1)
(building-type-count-total archery-range < 1)
(building-type-count barracks > 0)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal archery-range)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal increase-town-size-goal 0)
(building-type-count-total market > 0)
(building-type-count-total town-center >= tc-level-three)
(building-type-count-total university > 0)
(building-type-count-total archery-range < 1)
(building-type-count barracks > 0)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal archery-range)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal increase-town-size-goal 0)
(goal strategy-goal flush)
(building-type-count-total archery-range < 2)
(building-type-count-total blacksmith > 0)
(or
(strategic-number sn-archer-threat > 1)
(and
(players-building-type-count focus-player archery-range > 1)
(goal enemy-goal skirmisher); enemy probably going for xbow rush
)
)
(strategic-number sn-infantry-threat == 0)
(strategic-number sn-cavalry-threat == 0)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal archery-range)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal increase-town-size-goal 0)
(goal strategy-goal flush)
(building-type-count barracks > 0)
(or
(and
(building-type-count-total archery-range < 2)
(and
(research-available ri-man-at-arms)
(or
(building-type-count-total stable == 0)
(strategic-number sn-current-age >= fc-transit)
)
)
)
(goal unit-goal archer)
)
(building-type-count-total archery-range < 3)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal archery-range)
(enable-timer increase-town-size-timer 4)
)
#load-if-defined UP-POCKET-POSITION
(defrule
(goal strategy-goal rush)
(goal unit-goal archer)
(building-type-count-total archery-range == 2)
(building-type-count-total town-center < tc-level-three)
=>
(up-jump-rule 1)
)
#end-if
(defrule
(goal increase-town-size-goal 0)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(building-type-count-total blacksmith > 0)
(or
(goal strategy-goal rush)
(goal strategy-goal flush)
)
(building-type-count-total archery-range < 4)
(or
(building-type-count-total archery-range < 3)
(or
(building-type-count-total town-center >= tc-level-three)
(unit-type-count-total battering-ram-line > 0)
)
)
(goal unit-goal archer)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal archery-range)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal increase-town-size-goal 0)
(or
(goal unit-goal archer)
(goal unit-goal cavalry-archer)
)
(goal strategy-goal boom)
(building-type-count-total town-center >= tc-level-three)
(or
(building-type-count-total archery-range < 3)
(building-type-count-total town-center >= tc-level-four)
)
(building-type-count-total archery-range < 5)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal archery-range)
(enable-timer increase-town-size-timer 4)
)
#load-if-defined VIKING-CIV
(defrule
(goal increase-town-size-goal 0)
(goal unit-goal archer)
(goal strategy-goal boom)
(building-type-count-total town-center >= 3)
(or
(research-available imperial-age)
(strategic-number sn-current-age >= ci-transit)
)
(building-type-count-total archery-range < 8)
(civilian-population > 80)
(wood-amount >= 220)
=>
(set-goal increase-town-size-goal archery-range)
(enable-timer increase-town-size-timer 4)
)
#end-if
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(goal increase-town-size-goal 0)
(strategic-number sn-current-age >= ci-transit)
(goal unit-goal gunpowder-class)
(or
(building-type-count-total archery-range < 2)
(or
(building-type-count-total town-center >= 2)
(civilian-population > 80)
)
)
(or
(building-type-count-total archery-range < 4)
(civilian-population > 100)
)
(building-type-count-total archery-range < 8)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal archery-range)
(enable-timer increase-town-size-timer 4)
)
#load-if-defined UP-POCKET-POSITION
(defrule
(building-type-count-total town-center < tc-level-five)
(or
(building-type-count-total archery-range < 4)
(building-type-count-total town-center < tc-level-three)
)
(or
(goal nr-map-goal 1)
(building-type-count stone-wall-line > 10)
)
=>
(up-jump-rule 2)
)
#end-if
(defrule
(or
(goal increase-town-size-goal 0)
(goal increase-town-size-goal monastery)
)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(building-type-count-total town-center >= 1)
(building-type-count-total archery-range < 2)
(strategic-number sn-archer-threat >= 1)
(strategic-number sn-military-level < 0)
(goal unit-goal skirmisher)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal archery-range)
(enable-timer increase-town-size-timer 4)
)
#load-if-defined BYZANTINE-CIV
(defrule
(goal increase-town-size-goal 0)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(building-type-count-total town-center >= tc-level-two)
(or
(building-type-count-total archery-range < 2)
(and
(building-type-count-total town-center >= 3)
(strategic-number sn-cavalry-threat < 2)
)
)
(or
(strategic-number sn-cavalry-threat < 1)
(building-type-count-total barracks > 1)
)
(building-type-count-total archery-range < 4)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal archery-range)
(enable-timer increase-town-size-timer 4)
)
#else
(defrule
(goal increase-town-size-goal 0)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(building-type-count-total town-center >= tc-level-two)
(building-type-count-total archery-range < 2)
(or
(strategic-number sn-cavalry-threat < 1)
(building-type-count-total barracks > 1)
)
(or
(goal unit-goal skirmisher)
(goal unit-goal mix)
)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal archery-range)
(enable-timer increase-town-size-timer 4)
)
#end-if
#load-if-not-defined CELTIC-CIV
#load-if-not-defined SLAVIC-CIV
#load-if-not-defined BRITON-CIV
#load-if-not-defined BYZANTINE-CIV
#load-if-not-defined HUN-CIV
#load-if-not-defined VIKING-CIV
(defrule
(goal increase-town-size-goal 0)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(goal unit-goal knight)
(goal strategy-goal rush)
(strategic-number sn-archer-threat > 1)
(building-type-count-total town-center < tc-level-three)
(building-type-count-total siege-workshop > 0)
(unit-type-count mangonel-line == 0)
(current-age >= castle-age)
=>
(up-jump-rule 3)
)
(defrule
(goal increase-town-size-goal 0)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(goal unit-goal knight)
(goal strategy-goal rush)
(building-type-count-total town-center >= tc-level-two)
(building-type-count siege-workshop == 0)
(current-age >= castle-age)
(goal anti-cavalry-threat-goal 0)
=>
(up-jump-rule 2)
)
#end-if
#end-if
#end-if
(defrule
(goal increase-town-size-goal 0)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(goal unit-goal knight)
(goal strategy-goal rush)
(or
(building-type-count-total town-center >= tc-level-three)
(goal enemy-goal eagle-warrior); he will come with pikes
)
(or
(up-research-status c: ri-crossbow >= research-pending)
(building-type-count-total archery-range < 1)
)
(building-type-count-total archery-range < 2)
(wood-amount >= 175)
(current-age >= castle-age)
=>
(set-goal increase-town-size-goal archery-range)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal increase-town-size-goal 0)
(goal unit-goal knight)
(building-type-count-total town-center >= tc-level-two)
(or
(or
(goal anti-cavalry-threat-goal 1)
(strategic-number sn-archer-threat > 1)
)
(or
(goal enemy-goal flush)
(goal enemy-goal skirmisher)
)
)
(up-compare-goal position-goal == flank)
(building-type-count-total archery-range < 1)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal archery-range)
(enable-timer increase-town-size-timer 4)
)
#load-if-defined UP-1-PLAYER-TEAM
(defrule
(goal increase-town-size-goal 0)
(goal unit-goal knight)
(players-unit-type-count focus-player spearman-line > 6)
(building-type-count-total archery-range < 1)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal archery-range)
(enable-timer increase-town-size-timer 4)
)
#end-if
#end-if
#end-if
#end-if
#load-if-defined MAYAN-CIV
(defrule
(goal increase-town-size-goal 0)
(or
(goal strategy-goal flush)
(and
(building-type-count-total monastery > 0)
(goal unit-goal archer)
)
)
(players-civ every-enemy gothic)
(strategic-number sn-current-age >= fc-transit)
(building-type-count-total archery-range < 4)
(wood-amount >= 175)
=>
(set-goal control-goal aggressive-rush)
(set-goal increase-town-size-goal archery-range)
(enable-timer increase-town-size-timer 4)
)
#end-if
(defrule
(goal increase-town-size-goal 0)
(building-type-count-total blacksmith > 0)
(or
(building-type-count-total stable > 0)
(building-type-count-total archery-range < 3)
)
(or
(building-type-count-total siege-workshop > 0)
(building-type-count-total archery-range < 4)
)
(building-type-count-total archery-range < 6)
(or
(goal unit-goal cavalry-archer)
(goal strategy-goal flush)
)
(goal control-goal aggressive-rush)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal archery-range)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal increase-town-size-goal 0)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(goal unit-goal knight)
(goal strategy-goal rush)
(or
(not (civ-selected celtic))
(up-research-status c: ri-elite-skirmisher >= research-pending)
)
(building-type-count-total town-center >= tc-level-five)
(building-type-count-total archery-range < 4)
(not (goal control-goal my-unique-unit-line))
(wood-amount >= 225)
=>
(set-goal increase-town-size-goal archery-range)
(enable-timer increase-town-size-timer 4)
)
#load-if-not-defined POPULATION-CAP-25
#load-if-not-defined POPULATION-CAP-50
#load-if-not-defined DIFFICULTY-EASIEST
#load-if-not-defined DIFFICULTY-EASY
(defrule
(goal increase-town-size-goal 0)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(building-type-count-total university > 0)
(building-type-count-total siege-workshop > 0)
(up-research-status c: ri-elite-skirmisher >= research-pending)
(wood-amount > 360); excess wood
(or
(building-type-count-total archery-range < 6)
(wood-amount > 600)
)
(building-type-count-total archery-range < 8)
=>
(set-goal increase-town-size-goal archery-range)
(enable-timer increase-town-size-timer 4)
)
#end-if
#end-if
#end-if
#end-if
(defrule
(goal increase-town-size-goal archery-range)
(nor
(goal ranged-unit-type-goal archer)
(goal ranged-unit-type-goal cavalry-archer)
)
(wood-amount < 800)
(building-type-count-total archery-range > 3)
(strategic-number sn-archer-threat < 3)
=>
(set-goal increase-town-size-goal 0)
)
(defrule
(goal increase-town-size-goal archery-range)
(goal unit-goal eagle-warrior)
(goal control-goal shot)
(building-type-count-total town-center < tc-level-three)
(building-type-count-total barracks < 6)
(current-age >= castle-age)
=>
(set-goal increase-town-size-goal 0)
)
#load-if-defined DEATH-MATCH
(defrule
(game-time > 60)
(or
(building-type-count-total archery-range < 1)
(building-type-count-total blacksmith > 0)
)
(or
(or
(building-type-count-total archery-range < 4)
(civ-selected hun)
)
(building-type-count-total university > 0)
)
(building-type-count-total archery-range < number-archery-ranges)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal archery-range)
(enable-timer increase-town-size-timer 4)
)
#end-if
(defrule
(or
(or
(building-type-count barracks == 0); prerequisites missing
(current-age == dark-age)
)
(goal save-wood-goal 1)
)
(or
(goal increase-town-size-goal archery-range)
(goal increase-town-size-goal stable)
)
=>
(set-goal increase-town-size-goal 0)
)
(defrule
(goal increase-town-size-goal 0)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-current-age >= df-transit)
(building-type-count-total barracks < 1)
(building-type-count town-center > 0)
(goal strategy-goal flush)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal barracks)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal increase-town-size-goal barracks)
(goal enemy-boats-goal 1)
(goal strategy-goal flush)
(strategic-number sn-current-age >= df-transit)
(building-type-count-total dock < 2)
(players-building-type-count every-enemy barracks == 0)
(players-building-type-count every-enemy archery-range == 0)
(players-building-type-count every-enemy stable == 0)
=>
(set-goal increase-town-size-goal 0); skip barracks for more boats
(disable-timer increase-town-size-timer)
)
#load-if-not-defined SARACEN-CIV
(defrule
(goal increase-town-size-goal 0)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-current-age >= df-transit)
(building-type-count-total barracks < 1)
(building-type-count town-center > 0)
(goal strategy-goal rush)
(nor (goal unit-goal monk)
(or (goal unit-goal eagle-warrior)
(goal unit-goal my-unique-unit-line)))
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal barracks)
(enable-timer increase-town-size-timer 4)
)
#end-if
#load-if-not-defined UP-POCKET-POSITION
(defrule
(goal increase-town-size-goal 0)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(building-type-count-total barracks < 1)
(building-type-count town-center > 0)
(goal unit-goal monk)
(or (or (goal anti-monk-threat-goal 1)
(strategic-number sn-cavalry-threat > 1))
(building-type-count town-center >= tc-level-three))
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal barracks)
(enable-timer increase-town-size-timer 4)
)
#load-if-not-defined TURKISH-CIV
(defrule
(goal increase-town-size-goal 0)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-current-age >= df-transit)
(building-type-count-total barracks < 1)
(building-type-count town-center > 0)
(goal strategy-goal boom)
(or (nor (goal unit-goal my-unique-unit-line)
(goal unit-goal scorpion))
(or (strategic-number sn-cavalry-threat > 1)
(goal monk-threat-goal 1)))
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal barracks)
(enable-timer increase-town-size-timer 4)
)
#else
(defrule
(goal increase-town-size-goal 0)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-current-age >= df-transit)
(building-type-count-total barracks < 1)
(building-type-count town-center > 0)
(goal strategy-goal boom)
(or (nor (goal unit-goal my-unique-unit-line)
(goal unit-goal scorpion))
(goal monk-threat-goal 1))
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal barracks)
(enable-timer increase-town-size-timer 4)
)
#end-if
#else
(defrule
(goal increase-town-size-goal 0)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(building-type-count-total barracks < 1)
(building-type-count town-center > 0)
(goal unit-goal monk)
(or (goal anti-monk-threat-goal 1)
(building-type-count town-center >= tc-level-three))
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal barracks)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal increase-town-size-goal 0)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(building-type-count-total town-center < tc-level-four)
(building-type-count-total barracks > 0)
(goal unit-goal knight)
(goal strategy-goal boom)
=>
(up-jump-rule 12)
)
(defrule
(goal increase-town-size-goal 0)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(building-type-count-total town-center < tc-level-four)
(goal unit-goal my-unique-unit-line)
(goal strategy-goal boom)
(or (or (or (civ-selected mongol)
(civ-selected saracen))
(civ-selected spanish))
(or (civ-selected italian)
(civ-selected teutonic)))
=>
(up-jump-rule 11)
)
(defrule
(goal increase-town-size-goal 0)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-current-age >= df-transit)
(building-type-count-total barracks < 1)
(or (goal unit-goal my-unique-unit-line)
(goal unit-goal scorpion))
(strategic-number sn-cavalry-threat > 1)
(building-type-count-total town-center >= tc-level-two)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal barracks)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal increase-town-size-goal 0)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-current-age >= df-transit)
(building-type-count-total barracks < 1)
(building-type-count town-center > 0)
(goal strategy-goal boom)
(up-compare-goal unit-goal != my-unique-unit-line)
(up-compare-goal unit-goal != scorpion)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal barracks)
(enable-timer increase-town-size-timer 4)
)
#end-if
(defrule
(goal increase-town-size-goal 0)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(building-type-count-total barracks < 3)
(building-type-count-total blacksmith > 0)
(building-type-count town-center > 0)
(or (goal strategy-goal boom)
(goal strategy-goal fast-imp))
(or (building-type-count-total barracks < 2)
(building-type-count-total siege-workshop > 0))
(goal unit-goal eagle-warrior)
(strategic-number sn-military-level < 0)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal barracks)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal increase-town-size-goal 0)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-current-age >= ci-transit)
(building-type-count-total barracks < 1)
(building-type-count town-center > 0)
(or (goal strategy-goal fast-imp)
(goal unit-goal my-unique-unit-line))
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal barracks)
(enable-timer increase-town-size-timer 4)
)
#load-if-defined SARACEN-CIV
(defrule
(goal increase-town-size-goal 0)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(building-type-count-total barracks < 1)
(building-type-count-total blacksmith > 0)
(building-type-count town-center > 0)
(goal strategy-goal rush)
(up-compare-goal unit-goal != monk)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal barracks)
(enable-timer increase-town-size-timer 4)
)
#end-if
#load-if-not-defined POPULATION-CAP-25
#load-if-not-defined POPULATION-CAP-50
(defrule
(goal increase-town-size-goal 0)
(strategic-number sn-minimum-water-body-size-for-dock > water-mixed)
(building-type-count-total town-center >= tc-level-three)
(building-type-count-total blacksmith > 0)
(building-type-count-total market > 0)
(or (building-type-count-total barracks < 1)
(and (building-type-count-total town-center >= tc-level-four)
(or (up-research-status c: ri-long-swordsman >= research-pending)
(unit-available eagle-warrior-line))))
(building-type-count-total barracks < 3)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal barracks)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal increase-town-size-goal 0)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(building-type-count-total monastery > 0)
(building-type-count-total town-center >= tc-level-two)
(strategic-number sn-cavalry-threat > 0)
(or (building-type-count-total barracks < 2)
(and (building-type-count-total town-center >= tc-level-four)
(up-research-status c: ri-pikeman >= research-pending)))
(building-type-count-total barracks < 4)
(goal unit-goal skirmisher)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal barracks)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal increase-town-size-goal 0)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(or (building-type-count-total town-center >= tc-level-three)
(building-type-count-total barracks < 2))
(strategic-number sn-cavalry-threat > 1)
(building-type-count-total town-center >= tc-level-two)
(building-type-count-total barracks < 3)
(up-research-status c: ri-pikeman >= research-pending)
(goal strategy-goal rush)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal barracks)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal increase-town-size-goal 0)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(or (building-type-count-total town-center >= tc-level-four)
(building-type-count-total barracks < 2))
(building-type-count-total town-center >= tc-level-three)
(building-type-count-total blacksmith > 0)
(building-type-count-total barracks < 3)
(up-research-status c: ri-pikeman >= research-pending)
(goal strategy-goal boom)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal barracks)
(enable-timer increase-town-size-timer 4)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(goal increase-town-size-goal 0)
(building-type-count-total blacksmith > 0)
(building-type-count-total barracks < 4)
(or (goal unit-goal eagle-warrior)
(up-research-status c: ri-halberdier >= research-pending))
(or (building-type-count-total town-center >= tc-level-three)
(building-type-count-total barracks < 3))
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal barracks)
(enable-timer increase-town-size-timer 4)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(goal increase-town-size-goal 0)
(building-type-count-total barracks < 10)
(strategic-number sn-current-age >= ci-transit)
(building-type-count-total town-center >= tc-level-three)
(or (building-type-count-total barracks < 6)
(wood-amount > 400))
(wood-amount > 220)
(or (goal unit-goal eagle-warrior)
(up-research-status c: ri-halberdier >= research-pending))
=>
(set-goal increase-town-size-goal barracks)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal increase-town-size-goal barracks)
(goal strategy-goal boom)
(goal unit-goal eagle-warrior)
(or (building-type-count-total barracks > 0)
(strategic-number sn-current-age < fc-transit))
(nand (building-type-count-total barracks < 2)
(building-type-count-total town-center >= tc-level-three))
=>
(set-goal increase-town-size-goal 0)
(disable-timer increase-town-size-timer)
)
(defrule
(goal increase-town-size-goal barracks)
(goal strategy-goal fast-imp)
(building-type-count-total barracks > 0)
(not (research-available imperial-age))
=>
(set-goal increase-town-size-goal 0)
(disable-timer increase-town-size-timer)
)
(defrule
(goal increase-town-size-goal 0)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(building-type-count-total blacksmith > 0)
(building-type-count-total barracks < 4)
(goal unit-goal eagle-warrior)
(goal strategy-goal rush)
(or (building-type-count-total monastery > 0)
(goal control-goal aggressive-rush))
(nand (building-type-count-total siege-workshop == 0)
(building-type-count-total stone-wall-line > 10))
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal barracks)
(enable-timer increase-town-size-timer 4)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(goal increase-town-size-goal 0)
(goal strategy-goal flush)
(goal unit-goal militiaman-line)
(or (and (goal enemy-goal eagle-warrior)
(current-age == feudal-age))
(and (up-research-status c: ri-elite-skirmisher >= research-pending)
(building-type-count-total town-center >= tc-level-two)))
(building-type-count-total barracks < 2)
(building-type-count-total blacksmith > 0)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal barracks)
(enable-timer increase-town-size-timer 4)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(goal increase-town-size-goal 0)
(goal strategy-goal rush)
(goal unit-goal militiaman-line)
(building-type-count-total barracks < 2)
(building-type-count-total blacksmith > 0)
(up-research-status c: ri-double-bit-axe >= research-pending)
(up-research-status c: ri-horse-collar >= research-pending)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal barracks)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal increase-town-size-goal 0)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(or (or (goal unit-goal militiaman-line)
(goal control-goal militiaman-line))
(up-research-status c: ri-pikeman >= research-pending))
(building-type-count-total barracks < 8)
(building-type-count-total university > 0)
(building-type-count-total siege-workshop > 0)
(wood-amount > 420)
=>
(set-goal increase-town-size-goal barracks)
(enable-timer increase-town-size-timer 4)
)
#end-if
#end-if
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(goal increase-town-size-goal 0)
(or (and (goal strategy-goal flush)
(strategic-number sn-cavalry-threat > 1))
(and (population-cap < 75)
(up-research-status c: ri-pikeman >= research-pending)))
(building-type-count-total barracks < 2)
(building-type-count-total blacksmith > 0)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal barracks)
(enable-timer increase-town-size-timer 4)
)
#load-if-defined DARK-AGE-START
#load-if-not-defined UP-POCKET-POSITION
(defrule
(players-building-type-count focus-player barracks > 0)
(game-time < 490)
(building-type-count-total barracks < 1)
(up-pending-objects c: barracks == 0)
(can-build barracks)
=>
(set-goal increase-town-size-goal barracks)
(enable-timer increase-town-size-timer 4)
)
#end-if
#end-if
#load-if-defined DEATH-MATCH
(defrule
(or (building-type-count-total barracks < 1)
(or (or (building-type-count-total lumber-camp > 0)
(building-type-count-total mill > 0))
(building-type-count-total blacksmith > 0)))
(or (building-type-count-total barracks < 5)
(building-type-count-total siege-workshop > 0))
(building-type-count-total barracks < number-barracks)
(wood-amount >= 175)
=>
(set-goal increase-town-size-goal barracks)
(enable-timer increase-town-size-timer 4)
)
#end-if
(defrule
(or (goal increase-town-size-goal siege-workshop)
(or (or (goal increase-town-size-goal barracks)
(goal increase-town-size-goal archery-range))
(goal increase-town-size-goal stable)))
(building-type-count-total town-center == 0)
=>
(set-goal increase-town-size-goal 0)
)
(defrule
(wood-amount < 200)
(or (goal increase-town-size-goal siege-workshop)
(and (wood-amount < 175)
(or (or (goal increase-town-size-goal barracks)
(goal increase-town-size-goal archery-range))
(goal increase-town-size-goal stable))))
=>
(set-goal increase-town-size-goal 0)
(chat-local-to-self "Not enough wood to build.")
)
(defrule; don't build if we want to save wood
(or (strategic-number sn-resource-control == 3); hand-cart upgrade
(or (and (strategic-number sn-resource-control == ri-elite-skirmisher)
(building-type-count archery-range > 0))
(and (or (strategic-number sn-resource-control == battering-ram)
(goal save-wood-goal 1))
(building-type-count siege-workshop > 0))))
=>
(set-goal increase-town-size-goal 0)
)
#end-if; NOT WONDER-RACE
(defrule
(goal increase-town-size-goal 0)
(strategic-number sn-current-age == feudal)
(or (building-type-count-total barracks == 0); no rax => market+bs start
(or (and (goal strategy-goal rush); fail save for maps with a rax at start
(civ-selected saracen)); use saracen market advantage
(or (goal strategy-goal sling)
(strategic-number sn-resource-control == sling))))
(building-type-count-total market < 1)
(can-afford-building market)
=>
(set-goal increase-town-size-goal market)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal increase-town-size-goal 0)
(strategic-number sn-current-age <= feudal)
(current-age-time >= 10)
(building-type-count-total blacksmith >= 1)
(wood-amount >= 200)
(or (food-amount < 800)
(or (gold-amount < 200)
(wood-amount >= 400)))
(building-type-count-total market < 1)
(can-afford-building market)
=>
(set-goal increase-town-size-goal market)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal increase-town-size-goal market)
(or (or (building-type-count-total market > 0)
(or (and (wood-amount < 100)
(civ-selected saracen))
(wood-amount < 175)))
(or (or (strategic-number sn-current-age == fc-transit)
(strategic-number sn-resource-control == 3))
(strategic-number sn-resource-control == ri-elite-skirmisher)))
=>
(set-goal increase-town-size-goal 0)
)
(defrule
(or (building-type-count-total town-center <= 0)
(or (current-age <= feudal-age)
(building-type-count-total blacksmith >= number-blacksmiths)))
(or (building-type-count-total town-center <= 0)
(building-type-count-total blacksmith >= 1)); at least one
=>
(up-jump-rule 4)) ; temporary(?) debug rule
(defrule
(up-compare-goal strategy-goal != flush)
(goal increase-town-size-goal 0)
(food-amount > 300)
(nand (goal strategy-goal sling)
(current-age-time < 600))
(building-type-count town-center > 0)
(or (building-type-count-total stable > 0)
(or (building-type-count-total archery-range > 0)
(building-type-count-total market > 0)))
(building-type-count-total blacksmith < number-blacksmiths)
(can-afford-building blacksmith)
=>
(enable-timer increase-town-size-timer 4)
(set-goal increase-town-size-goal blacksmith))
(defrule
(wood-amount > 200)
(goal strategy-goal flush)
(goal increase-town-size-goal 0)
(or (and (building-type-count-total archery-range > 0)
(or (building-type-count-total stable > 0)
(up-research-status c: ri-man-at-arms >= research-pending)))
(building-type-count-total archery-range > 1))
(building-type-count-total mining-camp > 0)
(building-type-count-total blacksmith < 1)
(can-afford-building blacksmith)
=>
(enable-timer increase-town-size-timer 4)
(set-goal increase-town-size-goal blacksmith))
(defrule
(goal increase-town-size-goal 0)
(strategic-number sn-current-age == feudal)
(or (food-amount > 600)
(gold-amount > 400))
(or (gold-amount > 100)
(food-amount > 1000))
(building-type-count town-center > 0)
(or (building-type-count-total stable > 0)
(or (building-type-count-total archery-range > 0)
(building-type-count-total market > 0)))
(building-type-count-total blacksmith < 1)
(can-afford-building blacksmith)
=>
(enable-timer increase-town-size-timer 4)
(set-goal increase-town-size-goal blacksmith))
(defrule
(goal increase-town-size-goal 0)
(strategic-number sn-current-age == feudal)
(wood-amount >= 325)
(building-type-count town-center > 0)
(or (building-type-count-total stable > 0)
(or (building-type-count-total archery-range > 0)
(building-type-count-total market > 0)))
(building-type-count-total blacksmith < 1)
(can-afford-building blacksmith)
=>
(enable-timer increase-town-size-timer 4)
(set-goal increase-town-size-goal blacksmith))
(defrule
(goal increase-town-size-goal blacksmith)
(can-build blacksmith)
=>
(build blacksmith)
(set-goal increase-town-size-goal 2)
)
#end-if
(defrule
(or (goal increase-town-size-goal market)
(goal increase-town-size-goal barracks))
(goal save-wood-goal 1)
=>
(set-goal increase-town-size-goal 0)
)
#load-if-not-defined BLACK-FOREST-MAP
#load-if-not-defined DIFFICULTY-EASIEST
#load-if-not-defined DIFFICULTY-EASY
#load-if-not-defined DIFFICULTY-MODERATE
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(strategic-number sn-maximum-town-size >= 60)
(goal unit-goal archer)
(or (civ-selected viking)
(civ-selected japanese))
(or (wood-amount > 700)
(goal increase-town-size-goal archery-range))
(building-type-count-total archery-range < 12)
(building-type-count-total archery-range > 3)
(can-build archery-range)
=>
(build-forward archery-range)
)
#load-if-not-defined BYZANTINE-CIV
#load-if-not-defined CELTIC-CIV
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(strategic-number sn-maximum-town-size >= 60)
(or
(up-research-status c: ri-paladin >= research-pending)
(up-research-status c: ri-heavy-camel >= research-pending)
)
(gold-amount > 500)
(wood-amount > 1300)
(building-type-count-total stable < 15)
(building-type-count-total stable > 3)
(can-build stable)
=>
(build-forward stable)
)
#end-if
#end-if
#load-if-defined GOTHIC-CIV
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(strategic-number sn-maximum-town-size >= 60)
(or (up-research-status c: ri-champion >= research-pending)
(up-research-status c: ri-anarchy >= research-pending))
(or (wood-amount > 700)
(goal increase-town-size-goal barracks))
(building-type-count-total barracks < 15)
(building-type-count-total barracks > 5)
(can-build barracks)
=>
(build-forward barracks)
)
#end-if
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(strategic-number sn-maximum-town-size >= 60)
(up-research-status c: ri-heavy-scorpion >= research-pending)
(gold-amount > 500)
(wood-amount > 600)
(building-type-count-total siege-workshop < 5)
(can-build siege-workshop)
=>
(build-forward siege-workshop)
)
#end-if
#end-if
#end-if
#end-if
(defrule
(building-type-count-total monastery == 0)
(goal increase-town-size-goal monastery)
(can-build monastery)
=>
(build monastery)
(set-goal increase-town-size-goal 2)
)
(defrule
(goal increase-town-size-goal market)
(building-type-count-total market < 1)
(can-build-with-escrow market)
=>
(release-escrow wood)
(build market)
(set-goal increase-town-size-goal 2)
)
(defrule
(goal increase-town-size-goal stable)
(can-build stable)
=>
(build stable)
(set-goal increase-town-size-goal 2)
)
(defrule
(goal increase-town-size-goal barracks)
(can-build barracks)
=>
(build barracks)
(set-goal increase-town-size-goal 2)
)
(defrule
(goal increase-town-size-goal archery-range)
(can-build archery-range)
=>
(build archery-range)
(set-goal increase-town-size-goal 2)
)
#load-if-not-defined POST-IMPERIAL-AGE-START
#load-if-defined DEATH-MATCH
(defrule
(game-time > 60)
=>
(set-strategic-number sn-maximum-town-size 12)
(disable-self)
)
(defrule
(game-time > 120)
=>
(set-strategic-number sn-maximum-town-size 14)
(disable-self)
)
#load-if-not-defined FEUDAL-AGE-START
(defrule
(current-age == feudal-age)
(current-age-time > 20)
=>
(set-strategic-number sn-maximum-town-size 14)
)
(defrule
(current-age == feudal-age)
(current-age-time > 90)
=>
(set-strategic-number sn-maximum-town-size 16)
)
(defrule
(current-age == feudal-age)
(current-age-time > 180)
=>
(set-strategic-number sn-maximum-town-size 20)
)
#end-if
#end-if
#else
(defrule
(game-time < 90)
=>
(set-strategic-number sn-maximum-town-size 8)
(set-strategic-number sn-percent-building-cancellation 5)(disable-self)
)
(defrule
(game-time > 90)
=>
(set-strategic-number sn-maximum-town-size 12)
(set-strategic-number sn-maximum-gold-drop-distance 14)
(set-strategic-number sn-maximum-stone-drop-distance 14)
(set-strategic-number sn-maximum-wood-drop-distance 30)
(set-strategic-number sn-maximum-food-drop-distance 15)
(set-strategic-number sn-maximum-hunt-drop-distance 24)
(set-strategic-number sn-gold-gatherer-percentage 100)
(set-strategic-number sn-cap-civilian-builders 100)
(set-strategic-number sn-cap-civilian-gatherers 100)(disable-self)
)
(defrule
(game-time > 120)
=>
(set-strategic-number sn-maximum-town-size 15)(disable-self)
)
(defrule
(game-time > 180)
=>
(set-strategic-number sn-maximum-town-size 18)(disable-self)
)
(defrule
(game-time > 240)
=>
(set-strategic-number sn-maximum-town-size 22)
(set-strategic-number sn-camp-max-distance 50)(disable-self)
)
(defrule
(game-time > 300)
(strategic-number sn-maximum-town-size < 26)
=>
(set-strategic-number sn-maximum-town-size 26)
(set-strategic-number sn-percent-building-cancellation 75)(disable-self)
)
(defrule
(game-time > 480)
(strategic-number sn-maximum-town-size < 30)
=>
(set-strategic-number sn-maximum-town-size 30)(disable-self)
)
#end-if
#load-if-not-defined POST-IMPERIAL-AGE-START
(defrule
(current-age == castle-age)
(building-type-count-total town-center < tc-level-five)
(or
(goal unit-goal my-unique-unit-line)
(goal unit-goal knight)
)
=>
(up-jump-rule 1)
)
(defrule
(current-age >= castle-age)
(or
(building-type-count-total town-center >= tc-level-four)
(unit-type-count-total villager >= max-civ)
)
(can-afford-building university)
(building-type-count-total university == 0)
(goal increase-town-size-goal 0)
=>
(set-goal increase-town-size-goal university)
(enable-timer increase-town-size-timer 4)
)
(defrule
(goal increase-town-size-goal 0)
(current-age >= castle-age)
(building-type-count-total town-center > 0)
(strategic-number sn-minimum-water-body-size-for-dock >= water-mixed)
(building-type-count-total monastery > 0)
(building-type-count-total university == 0)
(wood-amount >= 200)
(food-amount > 500)
(gold-amount > 400)
=>
(set-goal increase-town-size-goal university)
(enable-timer increase-town-size-timer 4)
)
#load-if-not-defined TURKISH-CIV
(defrule
(strategic-number sn-current-age >= ci-transit)
(goal unit-goal gunpowder-class)
(can-afford-building university)
(building-type-count-total university == 0)
(goal increase-town-size-goal 0)
=>
(set-goal increase-town-size-goal university)
(enable-timer increase-town-size-timer 4)
)
#end-if
(defrule
(or
(or
(building-type-count-total university > 0)
(wood-amount < 200)
)
(or
(up-compare-goal save-wood-goal != 0)
(and
(goal strategy-goal boom)
(and
(building-type-count-total town-center < tc-level-five)
(or
(food-amount < 600)
(gold-amount < 500)
)
)
)
)
)
(goal increase-town-size-goal university)
=>
(set-goal increase-town-size-goal 0)
)
(defrule
(goal increase-town-size-goal university)
(building-type-count-total university < 1)
(can-build university)
=>
(build university)
(set-goal increase-town-size-goal 2)
)
#else
(defrule
(up-pending-objects c: dock < 6)
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
(building-type-count-total dock < 12)
(can-build dock)
=>
(build dock)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
(not (can-build dock))
(unit-type-count eagle-warrior-line > 0)
(building-type-count-total barracks == 0)
(can-build barracks)
=>
(build barracks)
(set-strategic-number sn-number-explore-groups 3)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
(not (can-build dock))
(building-type-count-total stable == 0)
(can-build stable)
=>
(build stable)
(set-strategic-number sn-number-explore-groups 3)
)
(defrule
(building-type-count town-center > 0)
(unit-type-count villager > villager-siege-workshop)
(building-type-count-total siege-workshop < 1)
(can-build siege-workshop)
=>
(build siege-workshop)
)
(defrule
(or
(and
(unit-type-count villager >= villager-monastery)
(or
(goal position-goal pocket)
(not (player-in-game any-ally))
)
)
(or
(unit-type-count villager >= 18)
(civ-selected aztec)
)
)
(can-build monastery)
(building-type-count-total monastery < 1)
=>
(build monastery)
)
(defrule
(unit-type-count villager >= 13)
(can-build town-center)
(building-type-count-total town-center < 6)
=>
(build town-center)
)
(defrule
(or (building-type-count-total market < 1)
(building-type-count farm > 0))
(unit-type-count villager >= villager-stable)
(building-type-count-total stable < number-stables)
(can-build stable)
=>
(build stable)
)
(defrule
(or (unit-type-count villager >= villager-archery-range)
(and (building-type-count-total market < 1)
(civ-selected hun)))
(building-type-count-total archery-range < number-archery-ranges)
(can-build archery-range)
=>
(build archery-range)
)
(defrule
(or (or (up-research-status c: ri-champion >= research-pending)
(civ-selected mayan))
(strategic-number sn-cavalry-threat >= 1))
(unit-type-count villager >= villager-barracks)
(building-type-count-total barracks < number-barracks)
(can-build barracks)
=>
(build barracks)
)
(defrule
(building-type-count-total market < 1)
(unit-type-count villager >= villager-market)
(can-build market)
=>
(build market)
)
(defrule
(building-type-count town-center > 0)
(or (up-research-status c: ri-heavy-scorpion >= research-pending)
(and (civ-selected hun)
(building-type-count-total siege-workshop < 2)))
(unit-type-count villager > villager-siege-workshop)
(building-type-count-total siege-workshop < 3)
(can-build siege-workshop)
=>
(build siege-workshop)
)
#load-if-not-defined DEFEND-WONDER
(defrule
(up-pending-objects c: mining-camp < 1)
(or (unit-type-count villager >= villager-mining-camp)
(and (unit-type-count villager >= villager-town-center)
(building-type-count-total mining-camp == 0)))
(building-type-count-total mining-camp < 6)
(or (resource-found gold)
(resource-found stone))
(can-build mining-camp)
=>
(set-strategic-number sn-allow-adjacent-dropsites 0)
(build mining-camp)
)
#end-if
#end-if ;PIDM
(defrule
(building-type-count-total town-center >= 1)
(or (cc-players-unit-type-count 0 gold-mine < 6)
(or (wood-amount >= 745)
(strategic-number sn-current-age >= imperial)))
(unit-type-count villager >= villager-stable)
(or (up-research-status c: ri-hand-cart >= research-pending)
(food-amount < 300))
(building-type-count-total stable < number-stables)
(can-build stable)
=>
(build stable)
)
(defrule
(building-type-count-total town-center >= 1)
(or (cc-players-unit-type-count 0 gold-mine < 6)
(or (wood-amount >= 745)
(strategic-number sn-current-age >= imperial)))
(unit-type-count villager >= villager-archery-range)
(or (up-research-status c: ri-hand-cart >= research-pending)
(food-amount < 300))
(building-type-count-total archery-range < number-archery-ranges)
(can-build archery-range)
=>
(build archery-range)
)
(defrule
(building-type-count-total town-center >= 1)
(or (cc-players-unit-type-count 0 gold-mine < 6)
(or (wood-amount >= 745)
(strategic-number sn-current-age >= imperial)))
(unit-type-count villager >= villager-barracks)
(or (up-research-status c: ri-hand-cart >= research-pending)
(food-amount < 300))
(building-type-count-total barracks < number-barracks)
(can-build barracks)
=>
(build barracks)
)
(defrule
(building-type-count town-center > 0)
(strategic-number sn-resource-control != ri-elite-skirmisher)
(strategic-number sn-resource-control != battering-ram)
(or (dropsite-min-distance wood < wood-distance-farm); make sure we don't run out of wood
(wood-amount > 800))
(game-time > 180)
(or (and (goal farm-goal 1)
(up-pending-objects c: farm < 2))
(goal farm-goal 2))
(goal save-wood-goal 0)
(up-pending-objects c: farm < 6)
(can-build farm)
=>
(build farm)
)
;********** UNITS **********
#load-if-defined DIFFICULTY-EASIEST
(defrule
(strategic-number sn-current-age >= fc-transit)
(strategic-number sn-resource-control == 0)
(or (strategic-number sn-military-level >= 2)
(or (population >= fourty-percent-pop)
(and (strategic-number sn-military-level >= 1)
(population >= twenty-five-percent-pop))))
; test (population-cap >= 175)
(military-population >= 5); 25
; test (strategic-number sn-military-level >= 0)
=>
(set-strategic-number sn-resource-control 2)
; (chat-to-player my-player-number "Hold back resources on this difficulty level.")
)
(defrule
(true)
=>
(set-escrow-percentage wood 4)
(set-escrow-percentage food 4)
(set-escrow-percentage gold 4)
(set-escrow-percentage stone 4))
#end-if
#load-if-defined DIFFICULTY-EASY
(defrule
(strategic-number sn-current-age >= fc-transit)
(strategic-number sn-resource-control == 0)
(or (strategic-number sn-military-level >= 3)
(or (population >= sixty-percent-pop)
(and (strategic-number sn-military-level >= 2)
(population >= fourty-percent-pop))))
; test (population-cap >= 175)
(military-population >= 15); 25
; test (strategic-number sn-military-level >= 1)
=>
(set-strategic-number sn-resource-control 2)
; (chat-to-player my-player-number "Hold back resources on this difficulty level.")
)
(defrule
(true)
=>
(set-escrow-percentage wood 2)
(set-escrow-percentage food 2)
(set-escrow-percentage gold 2)
(set-escrow-percentage stone 2))
#end-if
#load-if-defined DEATH-MATCH
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(game-time < 180)
(players-building-count every-enemy == 0)
(unit-type-count scout-cavalry-line < 3)
=>
(train scout-cavalry-line)
(set-strategic-number sn-number-explore-groups 5)
(set-strategic-number sn-minimum-explore-group-size 1)
)
#end-if
(defrule
(players-building-count every-enemy > 0)
=>
(set-strategic-number sn-number-explore-groups 1)
(set-strategic-number sn-total-number-explorers 1)
(up-modify-sn sn-target-player-number g:= closest-enemy-goal)
(disable-self)
)
; *** NAVY ***
#load-if-not-defined RIVERS-MAP
#load-if-not-defined BALTIC-MAP
(defrule
(strategic-number sn-minimum-water-body-size-for-dock >= water-islands)
(can-train transport-ship)
(players-unit-type-count every-enemy fire-ship-line < 15)
(players-unit-type-count every-enemy galley-line < 15)
(strategic-number sn-resource-control != 2)
(current-age == imperial-age)
(unit-type-count-total transport-ship < 5)
(or (population >= del-civ-pop)
(and (warboat-count >= 30)
(soldier-count >= 20)))
=>
(train transport-ship)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock >= water-islands)
(can-train transport-ship)
(or (population >= max-civ-pop)
(goal team-coordination-goal 1)); attacking
(or (population >= max-civ-pop)
(and (soldier-count >= 25)
(or (warboat-count >= 11)
(goal enemy-boats-goal 0))))
(unit-type-count-total transport-ship < 5)
=>
(train transport-ship)
)
#end-if
#end-if
#load-if-defined KOREAN-CIV
(defrule
(strategic-number sn-minimum-water-body-size-for-dock >= water-islands)
(can-train turtle-ship-line)
(or (unit-type-count turtle-ship-line < 12)
(can-research ri-elite-turtle-ship))
=>
(research ri-elite-turtle-ship)
(train turtle-ship-line)
)
#end-if
(defrule
(strategic-number sn-minimum-water-body-size-for-dock >= water-islands)
(can-train cannon-galleon-line)
(warboat-count >= 20)
(or (unit-type-count cannon-galleon-line < 8)
(warboat-count >= 50))
(unit-type-count cannon-galleon-line < 16)
=>
(train cannon-galleon-line)
)
#load-if-not-defined POPULATION-CAP-25
#load-if-not-defined POPULATION-CAP-50
#load-if-not-defined POPULATION-CAP-75
(defrule
(game-time < 1800)
(strategic-number sn-minimum-water-body-size-for-dock >= water-islands)
(strategic-number sn-resource-control <= 2)
(strategic-number sn-military-level > 0)
(warboat-count > 15)
(or (cc-players-unit-type-count 0 shore-fish >= shorefishreq2); a bit
(cc-players-unit-type-count 0 sea-fish >= deepfishreq2)); a bit
(dropsite-min-distance wood < 4)
(civilian-population < max-civ)
(population < max-civ-pop)
(unit-type-count fishing-ship < 16)
(can-train fishing-ship)
=>
(train fishing-ship)
)
#end-if
#end-if
#end-if
#load-if-defined VIKING-CIV
(defrule
(strategic-number sn-minimum-water-body-size-for-dock >= water-islands)
(can-research-with-escrow ri-elite-longboat)
=>
(release-escrow food)(release-escrow gold)
(research ri-elite-longboat)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock >= water-islands)
(up-research-status c: ri-elite-longboat >= research-pending)
(warboat-count < max-fleet)
(can-train longboat-line)
=>
(train longboat-line)
)
#end-if
(defrule
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
(strategic-number sn-resource-control < 2)
(or (current-age == castle-age)
(up-research-status c: ri-fast-fire-ship >= research-pending))
(unit-type-count fire-ship-line < 24)
(warboat-count < max-fleet)
(can-train fire-ship-line)
=>
(train fire-ship-line)
)
(defrule
(strategic-number sn-resource-control < 2)
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
(up-research-status c: ri-war-galley >= research-pending)
(warboat-count < max-fleet)
(can-train galley-line)
=>
(train galley-line)
)
(defrule
(goal position-goal flank)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(building-type-count barracks < 3)
(building-type-count archery-range < 1)
(building-type-count stable < 1)
(building-type-count castle < 1)
(building-type-count siege-workshop < 2)
(building-type-count monastery < 2)
(wood-amount < 250)
(players-building-type-count target-player dock < 3)
(strategic-number sn-current-age < ci-transit)
=>
(up-jump-rule 2)
)
(defrule
(strategic-number sn-resource-control < 2)
(unit-type-count fire-ship-line < 6)
(or (current-age == castle-age)
(up-research-status c: ri-fast-fire-ship >= research-pending))
(goal enemy-boats-goal 1)
(or (or (warboat-count < 15)
(unit-type-count fire-ship-line < 6))
(and (civ-selected aztec)
(warboat-count < 25)))
(can-train fire-ship-line)
=>
(train fire-ship-line)
)
(defrule
(strategic-number sn-resource-control < 2)
(or (goal strategy-goal flush)
(current-age > feudal-age))
(nor (research-available ri-war-galley)
(research-available ri-galleon))
(or (and (goal enemy-boats-goal 1)
(warboat-count < max-warships))
(strategic-number sn-minimum-water-body-size-for-dock == water-islands))
(warboat-count < max-fleet)
(can-train galley-line)
=>
(train galley-line)
)
; counter units
#load-if-not-defined TEUTONIC-CIV
(defrule
(or (and (strategic-number sn-resource-control <= 2)
(or (strategic-number sn-resource-control < 1)
(unit-type-count scout-cavalry-line < 6)))
(strategic-number sn-resource-control == ri-heresy))
(or (food-amount > 200)
(unit-type-count scout-cavalry-line < 6))
(goal monk-threat-goal 1)
(not (research-available ri-light-cavalry))
(can-train scout-cavalry-line)
=>
(train scout-cavalry-line)
)
#else
(defrule
(nand (game-time > 1800)
(players-unit-type-count every-enemy monk < 10))
(or (and (food-amount > 200)
(strategic-number sn-resource-control < 2))
(unit-type-count scout-cavalry-line < 6))
(goal monk-threat-goal 1)
(can-train scout-cavalry-line)
=>
(train scout-cavalry-line)
)
#end-if
(defrule
(strategic-number sn-resource-control >= 2)
=>
(up-jump-rule 26)
)
(defrule
(strategic-number sn-resource-control < 1)
(goal strategy-goal rush)
(goal unit-goal scout-cavalry)
(nor
(research-available ri-double-bit-axe)
(research-available ri-horse-collar)
)
(unit-type-count scout-cavalry-line < 5)
(can-train scout-cavalry-line)
=>
(train scout-cavalry-line)
)
#load-if-defined ITALIAN-CIV
(defrule
(strategic-number sn-resource-control < 1)
(or
(and
(unit-type-count my-unique-unit-line < 20)
(strategic-number sn-cavalry-threat >= 1)
)
(up-research-status c: my-unique-unit-upgrade >= research-pending)
)
(gold-amount > 100)
(can-train genoese-crossbowman)
=>
(train genoese-crossbowman)
)
#end-if
#load-if-not-defined UP-POCKET-POSITION
(defrule
(strategic-number sn-resource-control < 1)
(goal strategy-goal rush); when using fast castle strategy
(unit-type-count spearman-line < 4)
(strategic-number sn-current-age == fc-transit)
(players-current-age every-enemy == castle-age)
(players-current-age-time every-enemy >= 60); enemy at least 60s ahead of us in castle age
(goal enemy-goal rush); possible enemy krush
(goal meso-enemy-goal -1)
(can-train spearman-line); make spearman so enemy won't raid us with knights
=>
(train spearman-line)
)
(defrule
(strategic-number sn-resource-control < 1)
(unit-type-count spearman-line < 6)
(current-age == feudal-age)
(players-unit-type-count focus-player scout-cavalry-line > 3)
(strategic-number sn-focus-player-number g:== closest-enemy-goal)
(can-train spearman-line)
=>
(train spearman-line)
)
(defrule
(strategic-number sn-resource-control < 1)
(unit-type-count spearman-line < 6)
(current-age == feudal-age)
(goal threat-source-goal 947)
(goal threat-target-goal villager-class)
(up-compare-goal threat-time-goal < 5000)
(players-unit-type-count focus-player scout-cavalry-line > 1)
(can-train spearman-line); enemy going scout flush
=>
(train spearman-line)
)
#end-if
#load-if-defined INDIAN-CIV
(defrule
(strategic-number sn-resource-control < 1)
(or
(or
(goal unit-goal knight)
(up-research-status c: ri-imperial-camel >= research-pending)
)
(unit-type-count camel-line < 12)
)
(can-train camel-line)
=>
(train camel-line)
)
#end-if
#load-if-not-defined SARACEN-CIV
#load-if-not-defined TURKISH-CIV
#load-if-not-defined INDIAN-CIV
(defconst extra-anti-cav-unit spearman-line)
#else
(defconst extra-anti-cav-unit camel-line)
#end-if
#else
(defconst extra-anti-cav-unit camel-line)
#end-if
#else
(defconst extra-anti-cav-unit camel-line)
#end-if
#load-if-not-defined DIFFICULTY-EASIEST
#load-if-not-defined DIFFICULTY-EASY
#load-if-defined POST-IMPERIAL-AGE-START
(defrule
(strategic-number sn-resource-control < 1)
(strategic-number sn-cavalry-threat >= 1)
(or
(players-unit-type-count focus-player paladin > 0)
(and
(players-unit-type-count focus-player camel-line > 10)
(players-civ focus-player saracen)
)
)
(up-research-status c: ri-halberdier >= research-pending)
(unit-type-count extra-anti-cav-unit < 40)
(can-train extra-anti-cav-unit)
=>
(train extra-anti-cav-unit)
)
#end-if
#load-if-defined SARACEN-CIV
#load-if-defined POST-IMPERIAL-AGE-START
#load-if-defined DEATH-MATCH
(defrule
(strategic-number sn-resource-control < 1)
(population < seventy-five-percent-pop)
(game-time < 480)
(can-train camel-line)
=>
(train camel-line)
)
#end-if
#end-if
#end-if
(defrule
(current-age <= castle-age)
(strategic-number sn-resource-control < 1)
(goal strategy-goal flush)
(building-type-count-total archery-range > 0)
(strategic-number sn-cavalry-threat >= 1)
(or
(current-age == feudal-age)
(up-research-status c: ri-pikeman >= research-pending)
)
(unit-type-count spearman-line < 20)
(unit-type-count camel-line < 12)
(unit-type-count villager > 30); or we never make it anywhere if we lose villagers to knights
(can-train spearman-line)
=>
(train spearman-line)
)
#end-if ;NOT EASY
#end-if ;NOT EASIEST
#load-if-defined BYZANTINE-CIV
(defrule
(starting-age == post-imperial-age)
(game-time > 600)
(building-type-count castle > 0)
=>
(up-jump-rule 1)
)
#end-if
(defrule
(strategic-number sn-resource-control < 1)
(up-research-status c: ri-paladin >= research-pending)
(or
(or
(and
(players-unit-type-count focus-player spearman-line < 25)
(players-unit-type-count focus-player camel-line < 20)
)
(and
(civ-selected celtic)
(gold-amount > 2000)
)
)
(or
(strategic-number sn-archer-threat > 1)
(players-unit-type-count focus-player scorpion-line > 10)
)
)
(can-train knight-line)
=>
(train knight-line)
)
(defrule
(strategic-number sn-resource-control < 1)
(unit-type-count my-unique-unit-line < 20)
(strategic-number sn-infantry-threat >= 1)
(or
(gold-amount > 100)
(up-research-status c: my-unique-unit-upgrade >= research-pending)
)
(or
(or
(civ-selected aztec)
(civ-selected byzantine)
)
(or
(civ-selected spanish)
(up-research-status c: ri-elite-teutonic-knight >= research-pending)
)
)
(can-train my-unique-unit-line)
=>
(train my-unique-unit-line)
)
(defrule
(strategic-number sn-resource-control < 1)
(can-train my-unique-unit-line)
(unit-type-count my-unique-unit-line < 12)
(goal enemy-goal eagle-warrior)
(or
(or
(civ-selected aztec)
(civ-selected byzantine)
)
(or
(civ-selected japanese)
(civ-selected teutonic)
)
)
=>
(train my-unique-unit-line)
)
#load-if-defined INCAN-CIV
(defrule
(strategic-number sn-resource-control < 1)
(unit-type-count slinger < 20)
(or
(strategic-number sn-infantry-threat > 1)
(goal ranged-unit-type-goal slinger)
)
(or
(gold-amount > 100)
(current-age == castle-age)
)
(can-train slinger)
=>
(train slinger)
)
(defrule
(strategic-number sn-resource-control < 1)
(or
(unit-type-count villager > 75)
(food-amount >= unique-unit-food)
)
(or
(gold-amount > 100)
(current-age == castle-age)
)
(or
(unit-type-count my-unique-unit-line < 20)
(or
(strategic-number sn-cavalry-threat > 1)
(unit-type-count-total archer-line > 15)
)
)
(can-train kamayuk)
=>
(train kamayuk)
)
#end-if
(defrule
(strategic-number sn-resource-control < 1)
(unit-type-count condottiero < 12)
(players-unit-type-count focus-player hand-cannoneer > 6)
(gold-amount > 70)
(or
(unit-type-count teutonic-knight-line > high-min-number-upgrade)
(civ-selected gothic)
)
(can-train condottiero)
=>
(train condottiero)
)
#load-if-defined GOTHIC-CIV
(defrule
(not (player-in-game any-ally))
(up-research-status c: ri-champion >= research-pending)
(players-unit-type-count every-enemy teutonic-knight-line < 10)
(gold-amount < 500)
=>
(up-jump-rule 1)
)
#end-if
(defrule
(strategic-number sn-resource-control < 1)
(or
(unit-type-count hand-cannoneer < 30)
(unit-type-count trade-cart > 20)
)
(or
(goal unit-goal gunpowder-class)
(and
(goal ranged-unit-type-goal gunpowder-class)
(or
(unit-type-count hand-cannoneer < 15)
(death-match-game)
)
)
)
(gold-amount > 100)
(can-train hand-cannoneer)
=>
(train hand-cannoneer)
)
(defrule
(strategic-number sn-resource-control < 1)
(unit-type-count bombard-cannon < 3)
(goal unit-goal gunpowder-class)
(can-train bombard-cannon)
=>
(train bombard-cannon)
)
#load-if-not-defined TURKISH-CIV
(defrule
(up-research-status c: ri-heavy-scorpion >= research-pending)
(wood-amount > 300)
(players-unit-type-count every-enemy huskarl-line < 10)
(unit-type-count scorpion-line > 4)
=>
(up-jump-rule 1)
)
#end-if
(defrule
(strategic-number sn-resource-control < 1)
(nand
(or
(civ-selected teutonic)
(civ-selected byzantine)
)
(building-type-count castle > 0)
)
(unit-type-count hand-cannoneer < 20)
(or
(strategic-number sn-infantry-threat >= 1)
(players-unit-type-count focus-player huskarl-line > 4)
)
(gold-amount > 150)
(can-train hand-cannoneer)
=>
(train hand-cannoneer)
)
(defrule
(strategic-number sn-resource-control < 1)
(up-research-status c: ri-long-swordsman >= research-pending)
(goal enemy-goal eagle-warrior)
(unit-type-count militiaman-line < 12)
(can-train militiaman-line)
=>
(train militiaman-line)
)
(defrule
(strategic-number sn-resource-control < 1)
(can-train my-unique-unit-line)
(or
(current-age == castle-age)
(gold-amount > 120)
)
(or
(or
(civ-selected mongol)
(civ-selected briton)
)
(and
(strategic-number sn-archer-threat >= 1)
(civ-selected gothic)
)
)
=>
(train my-unique-unit-line)
)
(defrule
(strategic-number sn-resource-control < 1)
(strategic-number sn-cavalry-threat > 0)
(or
(game-time < 900); in DM
(strategic-number sn-cavalry-threat > 2)
)
(can-train camel-line)
(gold-amount > 250)
(or
(unit-type-count camel-line < 16)
(strategic-number sn-cavalry-threat > 3)
)
(or
(unit-type-count camel-line < 24)
(game-time < 600)
)
=>
(train camel-line)
)
(defrule
(strategic-number sn-resource-control < 1)
(game-time < 900)
(can-train camel-line)
(players-civ focus-player hun)
(gold-amount > 250)
=>
(train camel-line)
)
#load-if-not-defined WONDER-RACE
(defrule
(strategic-number sn-resource-control < 1)
(goal ranged-unit-type-goal monk)
(up-research-status c: ri-sanctity >= research-pending)
(or
(unit-type-count-total monk < 12)
(and
(or
(players-unit-type-count every-enemy monk < 5)
(up-research-status c: ri-atonement >= research-pending)
)
(or
(and
(players-unit-type-count every-enemy mangonel-line == 0)
(players-unit-type-count every-enemy scorpion-line < 5)
)
(up-research-status c: ri-redemption >= research-pending)
)
)
)
(can-train monk)
=>
(train monk)
)
(defrule
(strategic-number sn-resource-control < 1)
(up-research-status c: ri-sanctity >= research-available)
(up-research-status c: ri-block-printing >= research-available)
(gold-amount > 175)
(or
(civ-selected aztec)
(or
(players-unit-type-count focus-player war-elephant-line > 5)
(players-unit-type-count focus-player elephant-archer > 10)
)
)
(or
(goal anti-monk-threat-goal 0)
(and
(players-unit-type-count any-enemy war-elephant-line > 25)
(unit-type-count monastery-class < 15)
)
)
(can-train monk)
=>
(train monk)
)
#end-if
#load-if-not-defined TURKISH-CIV
#load-if-not-defined POPULATION-CAP-25
#load-if-not-defined UP-POCKET-POSITION
(defrule
(current-age >= castle-age)
(strategic-number sn-resource-control < 1)
(strategic-number sn-cavalry-threat >= 1)
(food-amount >= 85)
(nand
(building-type-count-total town-center == 1)
(and
(goal unit-goal knight)
(research-available ri-pikeman)
)
)
(or
(unit-type-count spearman-line < 10)
(up-research-status c: ri-pikeman >= research-pending)
)
(unit-type-count camel-line < 12); don't overdo anti cavalry
(unit-type-count imperial-camel < 12)
(can-train spearman-line)
=>
(train spearman-line)
)
(defrule
(not (player-valid 3))
(current-age >= castle-age)
(strategic-number sn-resource-control < 1)
(strategic-number sn-cavalry-threat > 1)
(strategic-number sn-military-level < 0)
(or
(unit-type-count spearman-line < 10)
(up-research-status c: ri-pikeman >= research-pending)
)
(unit-type-count spearman-line < 18)
(unit-type-count camel-line < 12)
(unit-type-count imperial-camel < 12)
(can-train spearman-line)
=>
(train spearman-line)
)
(defrule
(strategic-number sn-resource-control < 1)
(strategic-number sn-cavalry-threat >= 1)
(or
(food-amount >= 85)
(unit-type-count spearman-line < 6)
)
(or
(or
(goal unit-goal archer); ranged units are weak vs cavalry
(goal unit-goal skirmisher)
)
(strategic-number sn-military-level >= 1); or try to reach lvl2 and attack
)
(unit-type-count spearman-line < 15)
(unit-type-count camel-line < 12)
(unit-type-count imperial-camel < 12)
(up-research-status c: ri-pikeman >= research-pending)
(can-train spearman-line)
=>
(train spearman-line)
)
#else
(defrule
(strategic-number sn-current-age == castle)
(strategic-number sn-cavalry-threat < 3)
(or
(goal unit-goal knight)
(and
(goal unit-goal my-unique-unit-line)
(or
(civ-selected spanish)
(civ-selected persian)
)
)
)
(goal strategy-goal boom)
=>
(up-jump-rule 1)
)
(defrule
(current-age >= castle-age)
(strategic-number sn-resource-control < 1)
(strategic-number sn-cavalry-threat >= 1)
(food-amount >= 85)
(or
(current-age-time > 420)
(goal unit-goal archer)
)
(or
(unit-type-count spearman-line < 8)
(up-research-status c: ri-pikeman >= research-pending)
)
(gold-amount < 200)
(can-train spearman-line)
=>
(train spearman-line)
)
#end-if
#else
(defrule
(strategic-number sn-resource-control < 1)
(strategic-number sn-cavalry-threat >= 1)
(food-amount >= 85)
(up-research-status c: ri-pikeman >= research-pending)
(unit-type-count spearman-line < 4)
(can-train spearman-line)
=>
(train spearman-line)
)
#end-if
#else
(defrule
(strategic-number sn-resource-control < 1)
(can-train camel-line)
(or
(strategic-number sn-cavalry-threat >= 1)
(players-unit-type-count focus-player cavalry-archer-line >= 15)
)
(or
(gold-amount > 100)
(unit-type-count camel-line < 6)
)
=>
(train camel-line)
)
#end-if
#load-if-defined BYZANTINE-CIV
(defrule
(strategic-number sn-resource-control < 1)
(goal unit-goal knight)
(or
(or
(players-unit-type-count focus-player knight-line >= 5); in RM train camels vs mass knights
(or
(players-unit-type-count focus-player scout-cavalry-line >= 5); or vs scouts + ca
(players-unit-type-count focus-player cavalry-archer-line >= 15)
)
)
(or
(strategic-number sn-cavalry-threat >= 1)
(unit-type-count camel-line < 8)
)
)
(can-train camel-line)
=>
(train camel-line)
)
#end-if
(defrule
(strategic-number sn-resource-control < 1)
(up-research-status c: ri-pikeman >= research-pending)
(gold-amount < 50)
(food-amount > 200)
(wood-amount > 200)
(or
(or
(civ-selected aztec)
(civ-selected viking)
)
(up-research-status c: ri-halberdier >= research-pending)
)
(unit-type-count spearman-line < 20)
(can-train spearman-line)
=>
(train spearman-line)
)
(defrule
(or (strategic-number sn-resource-control < 1)
(or (civ-selected turkish)
(civ-selected indian)))
(or (and (or (strategic-number sn-cavalry-threat >= 1)
(or (players-unit-type-count focus-player cavalry-archer-line >= 15)
(unit-type-count camel-line > high-min-number-upgrade)))
(unit-type-count camel-line > mid-min-number-upgrade))
(civ-selected indian))
(can-research ri-heavy-camel)
=>
(research ri-heavy-camel)
)
(defrule
(strategic-number sn-resource-control < 1) ; anticipate knight defense
(goal unit-goal eagle-warrior); so better make some spears and spend our gold to collect relics
(food-amount >= 85)
(goal enemy-goal rush)
(or
(or
(players-civ focus-player hun)
(players-civ focus-player frankish)
)
(or
(players-civ focus-player teutonic)
(players-civ focus-player viking)
)
)
(unit-type-count-total monk == 0)
(building-type-count-total monastery > 0)
(unit-type-count spearman-line < 5)
(can-train spearman-line)
=>
(train spearman-line)
)
(defrule
(strategic-number sn-resource-control < 1)
(up-research-status c: ri-elite-eagle-warrior >= research-pending)
(or
(current-age-time < 300)
(gold-amount > 114)
)
(nor
(players-unit-type-count focus-player teutonic-knight-line > 11)
(players-unit-type-count focus-player militiaman-line > 19)
)
(can-train eagle-warrior-line)
=>
(train eagle-warrior-line)
)
(defrule
(strategic-number sn-resource-control < 1)
(nand
(goal train-civ-goal ri-chain-mail)
(gold-amount < 160)
)
(or
(food-amount >= 52); one food drop left to train next villager
(or
(town-under-attack)
(and
(goal control-goal aggressive-rush)
(current-age-time < 240)
)
)
)
(goal unit-goal eagle-warrior)
(goal strategy-goal rush)
(can-train eagle-warrior-line)
=>
(train eagle-warrior-line)
)
(defrule
(current-age == castle-age)
(strategic-number sn-resource-control < 1)
(or
(gold-amount > 120)
(strategic-number sn-military-level < 0)
)
(food-amount >= 52)
(goal unit-goal mix)
(goal strategy-goal rush)
(can-train eagle-warrior-line)
=>
(train eagle-warrior-line)
)
#load-if-defined MAYAN-CIV
(defrule
(strategic-number sn-resource-control < 1)
(players-unit-type-count focus-player huskarl-line > 3)
(or
(players-unit-type-count any-enemy militiaman-line < 12)
(or
(unit-type-count archer-line > 12)
(unit-type-count plumed-archer-line > 12)
)
)
(can-train eagle-warrior-line)
=>
(train eagle-warrior-line)
)
#end-if
(defrule
(strategic-number sn-resource-control < 1)
(or
(gold-amount > 150)
(current-age == castle-age)
)
(or
(players-unit-type-count focus-player monk > 5)
(goal control-goal shot)
)
(unit-type-count eagle-warrior < 15)
(can-train eagle-warrior-line)
=>
(train eagle-warrior-line)
)
(defrule
(goal unit-goal eagle-warrior)
(strategic-number sn-resource-control < 1)
(food-amount > 70)
(gold-amount > 150)
(unit-type-count eagle-warrior < 15)
(can-train eagle-warrior-line)
=>
(train eagle-warrior-line)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-resource-control < 1)
(gold-amount > 120)
(players-unit-type-count focus-player skirmisher-line > 15)
(or
(civ-selected japanese)
(civ-selected viking)
)
(up-research-status c: ri-heavy-scorpion >= research-pending)
(can-train scorpion-line)
=>
(train scorpion-line)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-resource-control < 1)
(strategic-number sn-archer-threat >= 2)
(or
(gold-amount > 220)
(and
(or
(strategic-number sn-cavalry-threat < 2)
(or
(unit-type-count camel-line > mid-min-number-upgrade)
(unit-type-count spearman-line > high-min-number-upgrade)
)
)
(players-unit-type-count every-enemy eagle-warrior-line < high-min-number-upgrade)
)
)
(up-research-status c: ri-heavy-scorpion >= research-pending)
(can-train scorpion-line)
=>
(train scorpion-line)
)
(defrule
(strategic-number sn-resource-control < 1)
(current-age == feudal-age)
(or
(and
(strategic-number sn-current-age == fc-transit)
(goal control-goal aggressive-rush)
)
(and
(building-type-count-total blacksmith > 0)
(gold-amount > 245)
)
)
(goal unit-goal archer)
(can-train archer-line)
=>
(train archer-line)
)
(defrule
(strategic-number sn-resource-control < 1)
(up-research-status c: ri-crossbow >= research-pending)
(goal ranged-unit-type-goal archer)
(nor (can-train longbowman-line)
(can-train plumed-archer-line))
(nor (can-train war-wagon-line)
(goal strategy-goal boom))
(gold-amount > 120)
(can-train archer-line)
=>
(train archer-line)
)
(defrule
(strategic-number sn-resource-control < 1)
(wood-amount > 100)
(gold-amount >= 145)
(strategic-number sn-current-age >= fc-transit)
(or
(game-time < 1800)
(civ-selected viking)
)
(goal ranged-unit-type-goal archer)
(goal strategy-goal boom)
(can-train archer-line)
=>
(train archer-line)
)
#load-if-not-defined SARACEN-CIV
(defrule
(or
(strategic-number sn-resource-control < 1)
(and
(or
(or
(strategic-number sn-resource-control == ri-pikeman)
(strategic-number sn-resource-control == ri-bodkin-arrow)
)
(strategic-number sn-resource-control == ri-crossbow)
)
(gold-amount >= 145); don't stop producing archers if we need only food for our research
)
)
(strategic-number sn-current-age >= fc-transit)
(game-time < 1800)
(goal unit-goal archer)
(goal strategy-goal rush)
(can-train archer-line)
=>
(train archer-line)
)
#else
(defrule
(strategic-number sn-resource-control < 1); buy food instead if with saracen
(strategic-number sn-current-age >= fc-transit)
(game-time < 1800)
(goal unit-goal archer)
(goal strategy-goal rush)
(can-train archer-line)
=>
(train archer-line)
)
#end-if
#load-if-defined MAGYAR-CIV
(defrule
(or
(strategic-number sn-resource-control < 1)
(and
(research-available imperial-age)
(and
(food-amount > 1070)
(gold-amount < 700)
)
)
)
(food-amount >= unique-unit-food); > 150
(can-train magyar-huszar)
=>
(train magyar-huszar)
)
#end-if
#load-if-defined SLAVIC-CIV
(defrule
(strategic-number sn-resource-control < 1)
(or
(current-age == castle-age)
(gold-amount > 120)
)
(or
(unit-type-count villager > 75)
(food-amount >= unique-unit-food)
)
(can-train boyar)
=>
(train boyar)
)
#end-if
#load-if-not-defined DIFFICULTY-EASIEST
#load-if-not-defined DIFFICULTY-EASY
#load-if-defined CELTIC-CIV
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-resource-control < 1)
(strategic-number sn-current-age == fc-transit)
(goal strategy-goal flush)
(wood-amount > 200)
(can-train skirmisher-line)
=>
(train skirmisher-line)
)
#end-if
#load-if-not-defined UP-MULTIPLE-ENEMIES
(defrule
(current-age >= castle-age)
(strategic-number sn-resource-control == 2)
(up-research-status c: ri-pikeman >= research-pending)
(wood-amount > 400); gold shortage while getting imperial researches
(food-amount > 400); so keep slots filled
(gold-amount < 200); with non-gold units
(population < max-civ-pop)
(nand
(up-research-status c: ri-bracer >= research-pending)
(unit-type-count spearman-line > 40)
)
(can-train spearman-line)
=>
(train spearman-line)
)
#end-if
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-resource-control <= 2)
(up-research-status c: ri-pikeman >= research-pending)
(research-available imperial-age)
(population < max-civ-pop)
(or
(food-amount > imp-food)
(gold-amount < 300)
)
(food-amount > 400)
(gold-amount < imp-gold)
(wood-amount >= 100)
(can-train spearman-line)
=>
(train spearman-line)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-resource-control <= 2)
(up-research-status c: ri-elite-skirmisher >= research-available)
(research-available imperial-age)
(population < max-civ-pop)
(or
(food-amount > imp-food)
(gold-amount < 300)
)
(food-amount > 400)
(gold-amount < imp-gold)
(wood-amount >= 100)
(can-train skirmisher-line)
=>
(train skirmisher-line)
)
#end-if; NOT EASY
#end-if; NOT EASIEST
#load-if-not-defined GOTHIC-CIV
#load-if-not-defined SPANISH-CIV
#load-if-not-defined BRITON-CIV
#load-if-not-defined BYZANTINE-CIV
#load-if-not-defined KOREAN-CIV
(defrule
(strategic-number sn-resource-control < 1)
(goal unit-goal my-unique-unit-line)
(goal strategy-goal rush)
(strategic-number sn-current-age == castle)
(unit-type-count knight-line < 12)
(can-train knight-line)
=>
(train knight-line)
)
#end-if
#end-if
#end-if
(defrule
(strategic-number sn-resource-control < 1)
(or
(and
(goal unit-goal cavalry-archer)
(up-research-status c: ri-bloodlines >= research-pending)
)
(goal unit-goal mix)
)
(or
(building-type-count-total archery-range < 6)
(goal enemy-goal eagle-warrior)
)
(goal strategy-goal rush)
(current-age == castle-age)
(unit-type-count knight-line < 12)
(can-train knight-line)
=>
(train knight-line)
)
#end-if
#end-if
(defrule
(strategic-number sn-resource-control < 1)
(goal unit-goal skirmisher)
(or
(players-unit-type-count focus-player eagle-warrior-line > 5)
(strategic-number sn-military-level >= 2)
)
(nand
(civ-selected byzantine)
(building-type-count castle > 0)
)
(goal strategy-goal rush)
(current-age == castle-age)
(unit-type-count knight-line < 12)
(can-train knight-line)
=>
(train knight-line)
)
#load-if-not-defined DEATH-MATCH
(defrule
(strategic-number sn-resource-control < 1)
(goal unit-goal archer)
(up-compare-goal position-goal == flank)
(game-time < 1800)
(or
(goal enemy-goal eagle-warrior)
(or
(up-compare-goal enemy-goal != flush)
(or
(players-building-type-count focus-player market > 0)
(players-building-type-count focus-player barracks > 1)
)
)
)
(unit-type-count knight-line < 6)
(can-train knight-line)
=>
(train knight-line)
)
#end-if
#load-if-not-defined POST-IMPERIAL-AGE-START
(defrule
(strategic-number sn-resource-control < 1)
(or
(and
(goal strategy-goal flush)
(current-age == castle-age)
)
(and
(up-research-status c: ri-cavalier >= research-pending)
(gold-amount > 150)
)
)
(or
(or
(goal anti-cavalry-threat-goal 0)
(military-population < 30)
)
(death-match-game)
)
(can-train knight-line)
=>
(train knight-line)
)
#else
#load-if-not-defined SLAVIC-CIV
#load-if-not-defined GOTHIC-CIV
(defrule
(strategic-number sn-resource-control < 1)
(up-research-status c: ri-cavalier >= research-pending)
(or
(up-research-status c: ri-bloodlines >= research-pending)
(up-research-status c: ri-paladin >= research-pending)
)
(or
(goal anti-cavalry-threat-goal 0)
(or
(game-time < 480)
(and
(civ-selected hun)
(death-match-game)
)
)
)
(can-train knight-line)
=>
(train knight-line)
)
#end-if
#end-if
(defrule
(game-time < 240)
(can-train monk)
=>
(train monk)
)
#end-if
(defrule
(strategic-number sn-resource-control < 1)
(or
(goal unit-goal knight)
(and
(up-research-status c: ri-paladin >= research-pending)
(players-unit-type-count every-enemy spearman-line < 25)
)
)
(or
(current-age == castle-age)
(gold-amount > 100)
)
(can-train knight-line)
=>
(train knight-line)
)
; balance resources
#load-if-defined ITALIAN-CIV
(defrule
(strategic-number sn-resource-control != ri-elite-skirmisher)
(strategic-number sn-resource-control != ri-heresy)
(gold-amount > 250)
(food-amount < 200)
(or
(food-amount < 80)
(gold-amount > 400)
)
(can-train genoese-crossbowman); same rule as below, because my-uu-line doesn't work with aofe uu
=>
(train genoese-crossbowman)
)
#end-if
#load-if-not-defined INCAN-CIV
#load-if-not-defined INDIAN-CIV
#load-if-not-defined MAGYAR-CIV
#load-if-not-defined SLAVIC-CIV
#load-if-not-defined AZTEC-CIV
#load-if-not-defined CELTIC-CIV
#load-if-not-defined FRANKISH-CIV
#load-if-not-defined GOTHIC-CIV
#load-if-not-defined HUN-CIV
#load-if-not-defined JAPANESE-CIV
#load-if-not-defined PERSIAN-CIV
#load-if-not-defined SARACEN-CIV
#load-if-not-defined SPANISH-CIV
#load-if-not-defined TEUTONIC-CIV
#load-if-not-defined TURKISH-CIV
#load-if-not-defined VIKING-CIV
#load-if-not-defined BYZANTINE-CIV
(defrule
(strategic-number sn-resource-control != ri-elite-skirmisher)
(strategic-number sn-resource-control != ri-heresy)
(gold-amount > 250)
(food-amount < 200)
(or
(food-amount < 80)
(gold-amount > 400)
)
(can-train my-unique-unit-line); ranged uu
=>
(train my-unique-unit-line)
)
#end-if
(defrule
(current-age >= castle-age)
(or
(and
(and
(or
(civ-selected briton)
(civ-selected mayan)
)
(goal unit-goal my-unique-unit-line)
)
(goal strategy-goal rush)
)
(building-type-count castle >= 2)
)
=>
(set-goal ranged-unit-type-goal 0)
(set-goal uu-up-goal 1)
(disable-self)
)
(defrule
(current-age >= castle-age)
(goal unit-goal knight)
(goal strategy-goal rush)
(building-type-count castle > 0)
(or
(or
(civ-selected mongol)
(civ-selected chinese)
)
(civ-selected briton)
)
=>
(set-goal ranged-unit-type-goal uu)
(set-goal uu-up-goal 1)
(disable-self)
)
(defrule
(game-time > 20)
(game-time < 60)
(goal strategy-goal boom)
(goal unit-goal my-unique-unit-line)
(up-compare-goal ranged-unit-type-goal != scorpion)
(up-compare-goal ranged-unit-type-goal != monk)
(up-compare-goal ranged-unit-type-goal != gunpowder-class)
=>
(set-goal ranged-unit-type-goal uu)
)
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#load-if-not-defined INCAN-CIV
#load-if-not-defined AZTEC-CIV
#load-if-not-defined BRITON-CIV
#load-if-not-defined BYZANTINE-CIV
#load-if-not-defined CHINESE-CIV
#load-if-not-defined HUN-CIV
#load-if-not-defined ITALIAN-CIV
#load-if-not-defined JAPANESE-CIV
#load-if-not-defined KOREAN-CIV
#load-if-not-defined MAYAN-CIV
#load-if-not-defined MAGYAR-CIV
#load-if-not-defined MONGOL-CIV
#load-if-not-defined SARACEN-CIV
#load-if-not-defined VIKING-CIV
(defrule
(nand
(up-research-status c: ri-crossbow >= research-pending)
(game-time < 2400)
)
(or
(or
(building-type-count siege-workshop > 0)
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
)
(goal strategy-goal boom)
)
(up-compare-goal unit-goal g:!= ranged-unit-type-goal)
(up-compare-goal ranged-unit-type-goal != scorpion)
(up-compare-goal ranged-unit-type-goal != monk)
(up-compare-goal ranged-unit-type-goal != gunpowder-class)
=>
(set-goal ranged-unit-type-goal 0)
)
#load-if-defined DEATH-MATCH
#load-if-not-defined TURKISH-CIV
(defrule
(up-compare-goal ranged-unit-type-goal != 0)
=>
(set-goal ranged-unit-type-goal 0)
)
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
(defrule
(strategic-number sn-resource-control < 1)
(goal ranged-unit-type-goal cavalry-archer)
(or
(gold-amount > 125)
(goal unit-goal cavalry-archer)
)
(or
(gold-amount > 100)
(and
(goal control-goal aggressive-rush)
(current-age == castle-age)
)
)
(or
(dropsite-min-distance wood < 4)
(wood-amount > 140)
)
(can-train cavalry-archer-line)
=>
(train cavalry-archer-line)
)
#load-if-not-defined HUN-CIV
(defrule
(strategic-number sn-resource-control != battering-ram)
(strategic-number sn-resource-control != ri-elite-skirmisher)
(strategic-number sn-resource-control != ri-heresy)
(up-research-status c: ri-crossbow >= research-pending)
(goal ranged-unit-type-goal archer)
(wood-amount > 90)
(gold-amount > 250)
(food-amount < 200)
(or
(food-amount < 80)
(gold-amount > 400)
)
(can-train archer-line)
=>
(train archer-line)
)
#end-if
(defrule
(strategic-number sn-resource-control != ri-elite-skirmisher)
(strategic-number sn-resource-control != ri-heresy)
(nor (can-train chu-ko-nu-line)
(can-train mangudai-line))
(goal ranged-unit-type-goal cavalry-archer)
(wood-amount > 90)
(gold-amount > 250)
(or
(food-amount < 200)
(game-time < 720)
)
(or
(food-amount < 80)
(gold-amount > 400)
)
(can-train cavalry-archer-line)
=>
(train cavalry-archer-line)
)
(defrule
(current-age >= castle-age)
(strategic-number sn-resource-control < 1)
(goal unit-goal militiaman-line)
(goal strategy-goal rush)
(not (research-available ri-long-swordsman))
(unit-type-count militiaman-line < 15)
(game-time < 1800); this strategy is currently only used that early against EW rush
(can-train militiaman-line)
=>
(train militiaman-line)
)
(defrule
(strategic-number sn-resource-control < 1)
(or (goal unit-goal militiaman-line)
(goal control-goal militiaman-line))
(food-amount > 100)
(or (and (and (current-age == castle-age)
(up-research-status c: ri-long-swordsman >= research-pending))
(unit-type-count militiaman-line < 30))
(and (up-research-status c: ri-two-handed-swordsman >= research-pending)
(gold-amount > 90)))
(can-train militiaman-line)
=>
(train militiaman-line)
)
#load-if-defined GOTHIC-CIV
(defrule
(strategic-number sn-resource-control < 1)
(food-amount > 100)
(gold-amount > 90)
(can-train rax-husky-line)
=>
(train rax-husky-line)
(set-goal unit-goal my-unique-unit-line)
)
#end-if
#load-if-defined INDIAN-CIV
(defrule
(strategic-number sn-resource-control < 1)
(can-train elephant-archer)
(or
(or
(unit-type-count villager > 75)
(goal train-civ-goal -1)
)
(food-amount >= unique-unit-food)
)
(or
(current-age == castle-age)
(gold-amount > 100)
)
=>
(train elephant-archer)
)
#end-if
#load-if-not-defined HUN-CIV
(defrule
(strategic-number sn-resource-control < 1)
(can-train my-unique-unit-line)
(or
(up-research-status c: my-unique-unit-upgrade >= research-pending)
(or
(goal unit-goal my-unique-unit-line)
(goal control-goal my-unique-unit-line)
)
)
(or
(or
(unit-type-count villager > 75)
(goal train-civ-goal -1)
)
(food-amount >= unique-unit-food)
)
(or
(current-age == castle-age)
(gold-amount > 100)
)
=>
(train my-unique-unit-line)
)
(defrule
(goal unit-goal my-unique-unit-line)
(can-train my-unique-unit-line)
(or
(and
(unit-type-count-total my-unique-unit-line < 5)
(civ-selected byzantine)
)
(civ-selected gothic)
)
(unit-type-count-total my-unique-unit-line < 12)
(current-age == castle-age)
=>
(train my-unique-unit-line)
)
#end-if
#load-if-not-defined AZTEC-CIV
#load-if-not-defined BRITON-CIV
#load-if-not-defined CHINESE-CIV
#load-if-not-defined KOREAN-CIV
#load-if-not-defined MONGOL-CIV
#load-if-not-defined SARACEN-CIV
#load-if-not-defined TURKISH-CIV
#load-if-not-defined SLAVIC-CIV
#load-if-not-defined ITALIAN-CIV
(defrule
(up-research-status c: my-unique-unit-upgrade >= research-pending)
(building-type-count castle > 2)
=>
(up-jump-rule 1)
)
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
(defrule
(strategic-number sn-resource-control < 1)
(up-research-status c: ri-champion >= research-pending)
(food-amount > 100)
(gold-amount > 200)
(can-train militiaman-line)
=>
(train militiaman-line)
)
#load-if-defined DARK-AGE-END
(defrule
(strategic-number sn-resource-control < 1)
(can-train militiaman-line)
=>
(train militiaman-line)
)
#end-if
; Flush
(defrule
(strategic-number sn-resource-control < 1)
(goal strategy-goal flush)
(or
(food-amount >= 130)
(current-age-time < 120)
)
(current-age == feudal-age)
(or
(current-age-time < 480)
(and
(food-amount < 500)
(players-military-population every-enemy < 8)
)
)
(up-research-status c: ri-man-at-arms < research-pending)
(can-train scout-cavalry-line)
=>
(train scout-cavalry-line)
)
#load-if-defined FEUDAL-AGE-END
(defrule
(strategic-number sn-resource-control < 1)
(food-amount >= 130)
(current-age == feudal-age)
(or
(up-research-status c: ri-man-at-arms < research-pending)
(players-unit-type-count focus-player skirmisher-line > 18)
)
(can-train scout-cavalry-line)
=>
(train scout-cavalry-line)
)
#end-if
(defrule
(goal strategy-goal flush)
(strategic-number sn-gold-gatherer-percentage > 10)
(strategic-number sn-current-age == feudal)
(or
(and
(food-amount < 600)
(strategic-number sn-resource-control < 1)
)
(and
(gold-amount >= 245)
(strategic-number sn-resource-control <= 2)
)
)
(can-train archer-line)
=>
(train archer-line)
)
(defrule
(current-age-time < 180)
(strategic-number sn-resource-control < 1)
(goal strategy-goal flush)
(current-age == feudal-age)
(players-building-type-count focus-player stable == 0)
(players-military-population focus-player > 4)
(or
(military-population < 3)
(players-military-population focus-player > 8)
)
(military-population < 6)
(strategic-number sn-current-age == feudal)
(can-train skirmisher-line)
=>
(train skirmisher-line)
)
(defrule
(strategic-number sn-resource-control <= 2)
(goal strategy-goal flush)
(current-age == feudal-age)
(or
(strategic-number sn-gold-gatherer-percentage <= 10)
(and
(strategic-number sn-current-age == fc-transit)
(goal ranged-unit-type-goal archer)
)
)
(gold-amount >= 245)
(can-train archer-line)
=>
(train archer-line)
)
(defrule
(strategic-number sn-resource-control < 1)
(goal strategy-goal flush)
(wood-amount > 70);dont run out of stock while spaming skirmishers
(food-amount > 74)
(or
(food-amount < 700)
(and
(food-amount >= 825)
(building-type-count-total blacksmith > 0)
)
)
(nand
(up-research-status c: ri-man-at-arms >= research-pending)
(goal enemy-goal eagle-warrior)
)
(strategic-number sn-current-age == feudal)
(can-train skirmisher-line)
=>
(train skirmisher-line)
)
(defrule
(strategic-number sn-resource-control < 1)
(goal strategy-goal flush)
(nand
(up-research-status c: ri-man-at-arms >= research-pending)
(goal enemy-goal eagle-warrior)
)
(building-type-count-total blacksmith > 0); castle age advancement is already prepared
(current-age == feudal-age); as no resource restriction on this rule
(strategic-number sn-military-level < 0); use this only to catch up with enemy military
(can-train skirmisher-line)
=>
(train skirmisher-line)
)
(defrule
(strategic-number sn-resource-control < 1)
(goal strategy-goal flush)
(goal enemy-goal flush)
(strategic-number sn-current-age == fc-transit)
(strategic-number sn-military-level < 1)
(wood-amount > 250)
(can-train skirmisher-line)
=>
(train skirmisher-line)
)
(defrule
(current-age == feudal-age)
(strategic-number sn-resource-control < 1)
(goal strategy-goal flush)
(up-research-status c: ri-man-at-arms >= research-pending)
(goal unit-goal militiaman-line)
(or (goal enemy-goal eagle-warrior)
(or (current-age-time < 480)
(and (strategic-number sn-current-age == fc-transit)
(food-amount >= 260))))
(food-amount > 100)
(can-train militiaman-line)
=>
(train militiaman-line)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(current-age == dark-age)
(goal unit-goal militiaman-line)
(strategic-number sn-current-age == df-transit)
(food-amount > 260)
(nand (civ-selected gothic)
(not (death-match-game)))
(can-train militiaman-line)
=>
(train militiaman-line)
)
(defrule
(game-time < 900)
(strategic-number sn-current-age == feudal)
(goal strategy-goal flush)
(or (players-civ focus-player hun)
(players-civ focus-player mongol))
(players-building-type-count focus-player archery-range < 2)
(unit-type-count spearman-line < 2)
(not (goal unit-goal militiaman-line))
(can-train spearman-line); make spearman fast so the flush won't die vs quick scouts.
=>
(train spearman-line)
)
(defrule
(strategic-number sn-current-age == feudal)
(goal strategy-goal flush)
(unit-type-count spearman-line < 5)
(or
(and
(and
(building-type-count-total archery-range > 0); archery-range not yet finished
(building-type-count archery-range == 0)
)
(players-military-population focus-player > 2); enemy is very fast
)
(goal enemy-goal rush)
)
(goal meso-enemy-goal -1)
(can-train spearman-line); make spearman to keep up with military production
=>
(train spearman-line)
)
#load-if-not-defined WONDER-RACE ;Wonderrace ends too fast to make gold from relics
(defrule
(strategic-number sn-resource-control < 1)
(goal ranged-unit-type-goal monk)
(or
(goal enemy-goal flush)
(and
(up-compare-goal position-goal == flank)
(strategic-number sn-archer-threat > 1)
)
)
(research-available ri-sanctity)
(building-type-count monastery > 0)
=>
(set-strategic-number sn-resource-control 2)
)
#load-if-defined AZTEC-CIV
(defrule
(goal strategy-goal boom)
(goal unit-goal archer)
=>
(up-jump-rule 3)
)
(defrule
(strategic-number sn-resource-control < 1)
(goal train-civ-goal 1)
(or
(and
(up-compare-goal ranged-unit-type-goal != monk)
(up-research-status c: ri-sanctity >= research-pending)
)
(unit-type-count monk < 6)
)
(food-amount < 150)
(gold-amount > 200)
(goal anti-monk-threat-goal 0)
(can-train monk)
=>
(train monk)
)
(defrule
(strategic-number sn-resource-control < 1)
(nand
(goal unit-goal eagle-warrior)
(strategic-number sn-cavalry-threat == 0)
)
(or
(unit-type-count monk < 8)
(and
(food-amount < 600)
(gold-amount > 750)
)
)
(goal anti-monk-threat-goal 0)
(can-train monk)
=>
(train monk)
)
(defrule
(strategic-number sn-resource-control < 1)
(strategic-number sn-current-age >= ci-transit)
(gold-amount > 175)
(or
(players-unit-type-count every-enemy monk < 5)
(up-research-status c: ri-atonement >= research-pending)
)
(or
(and
(players-unit-type-count every-enemy mangonel-line == 0)
(players-unit-type-count every-enemy scorpion-line < 5)
)
(up-research-status c: ri-redemption >= research-pending)
)
(goal anti-monk-threat-goal 0)
(can-train monk)
=>
(train monk)
)
#end-if
(defrule
(strategic-number sn-resource-control < 1)
(goal ranged-unit-type-goal monk)
(unit-type-count monk < 6)
(can-train monk)
=>
(train monk)
)
(defrule
(strategic-number sn-resource-control < 1)
(goal train-civ-goal 1)
(or
(up-research-status c: ri-sanctity >= research-pending)
(unit-type-count monk < 6)
)
(up-research-status c: ri-pikeman >= research-pending)
(goal anti-monk-threat-goal 0)
(strategic-number sn-cavalry-threat >= 1)
(or
(goal unit-goal mix)
(goal unit-goal skirmisher)
)
(can-train monk)
=>
(train monk)
)
(defrule
(strategic-number sn-resource-control < 1)
(goal train-civ-goal 1)
(or
(up-research-status c: ri-sanctity >= research-pending)
(unit-type-count monk < 6)
)
(food-amount < 100)
(gold-amount > 300)
(current-age == castle-age)
(goal anti-monk-threat-goal 0)
(strategic-number sn-cavalry-threat > 1)
(can-train monk)
=>
(train monk)
)
(defrule
(strategic-number sn-resource-control < 1)
(goal train-civ-goal 1)
(or
(up-research-status c: ri-sanctity >= research-pending)
(unit-type-count monk < 6)
)
(gold-amount > 200)
(current-age == castle-age)
(goal anti-monk-threat-goal 0)
(strategic-number sn-cavalry-threat > 1)
(goal unit-goal cavalry-archer)
(goal control-goal aggressive-rush)
(can-train monk)
=>
(train monk)
)
(defrule
(or (player-resigned every-ally)
(not (player-in-game any-ally)))
(players-building-type-count every-ally market == 0)
(housing-headroom < 10)
(or (unit-type-count trade-cart > 0)
(unit-type-count trade-cog > 0))
=>
(delete-unit trade-cart)
(delete-unit trade-cog)
)
(defrule
(gold-amount > 200)
(population >= del-civ-pop)
(housing-headroom < 10)
(or (unit-type-count-total villager >= 1)
(building-type-count-total town-center >= 1))
(unit-type-count-total trade-cart > 80)
=>
(delete-unit trade-cart))
(defrule
(gold-amount > 200)
(population >= del-civ-pop)
(housing-headroom < 10)
(or (unit-type-count-total villager >= 1)
(building-type-count-total town-center >= 1))
(unit-type-count-total trade-cog > 80)
=>
(delete-unit trade-cog))
#end-if ;not WONDER-RACE
#load-if-not-defined POST-IMPERIAL-AGE-START
(defrule
(strategic-number sn-resource-control < 1)
(food-amount > 200)
(or
(gold-amount < 100)
(and
(strategic-number sn-current-age >= ci-transit)
(population < max-civ-pop)
)
)
(up-research-status c: ri-light-cavalry >= research-pending)
(nor
(and
(up-research-status c: ri-bloodlines < research-pending)
(goal anti-cavalry-threat-goal 1)
)
(can-train magyar-huszar)
)
(can-train scout-cavalry-line)
=>
(train scout-cavalry-line)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-resource-control <= 2)
(up-research-status c: ri-light-cavalry >= research-pending)
(research-available imperial-age)
(not (can-train magyar-huszar))
(food-amount > 1070)
(gold-amount < 700)
(can-train scout-cavalry-line)
=>
(train scout-cavalry-line)
)
#else
(defrule
(strategic-number sn-resource-control < 1)
(population < seventy-five-percent-pop)
(gold-amount > 1000)
(up-research-status c: ri-cavalier >= research-pending)
(can-train knight-line)
=>
(train knight-line)
)
(defrule
(strategic-number sn-resource-control < 1)
(food-amount > 400)
(gold-amount < 100)
(not (can-train magyar-huszar))
(up-research-status c: ri-light-cavalry >= research-pending)
(can-train scout-cavalry-line)
=>
(train scout-cavalry-line)
)
#end-if
#load-if-not-defined TURKISH-CIV
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-resource-control < 1)
(unit-type-count skirmisher-line < 20)
(strategic-number sn-archer-threat >= 1)
(or
(up-research-status c: ri-elite-skirmisher >= research-pending)
(unit-type-count skirmisher-line < 7)
)
(nand
(gold-amount > 400)
(unit-type-count trade-cart > 20)
)
(wood-amount > 145)
(current-age >= castle-age)
(can-train skirmisher-line)
=>
(train skirmisher-line)
)
#end-if
(defrule
(strategic-number sn-resource-control < 1)
(strategic-number sn-current-age >= fc-transit)
(goal strategy-goal rush)
(or
(and
(gold-amount >= 145)
(wood-amount >= 100)
)
(players-unit-type-count focus-player militiaman-line > 0)
)
(goal ranged-unit-type-goal archer)
(or
(goal unit-goal mix)
(goal unit-goal skirmisher)
)
(military-population < 8)
(can-train archer-line)
=>
(train archer-line)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-resource-control <= 2)
(gold-amount < 750)
(up-research-status c: ri-elite-skirmisher >= research-pending)
(or
(and
(research-available my-unique-research)
(civ-selected aztec)
)
(research-available ri-hussar)
)
(wood-amount > 250)
(food-amount > 500)
(can-train skirmisher-line)
=>
(train skirmisher-line)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-resource-control <= 2)
(unit-type-count spearman-line > 14)
(research-available ri-halberdier)
(nor
(research-available ri-blast-furnace)
(research-available ri-bracer)
)
(nor
(research-available ri-plate-mail)
(research-available ri-plate-barding)
)
(up-research-status c: ri-chemistry >= research-pending)
(wood-amount > 250)
(food-amount > 350)
(gold-amount < 600)
(can-train skirmisher-line)
=>
(train skirmisher-line)
)
(defrule
(strategic-number sn-resource-control < 1)
(strategic-number sn-current-age >= fc-transit)
(game-time < 1320)
(unit-type-count spearman-line < 4)
(goal strategy-goal rush)
(goal unit-goal skirmisher)
(goal enemy-goal rush)
(goal meso-enemy-goal -1)
(can-train spearman-line); make spearman so enemy won't raid us with knights
=>
(train spearman-line)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(or
(game-time < 1800)
(strategic-number sn-current-age >= ci-transit)
)
(strategic-number sn-resource-control < 1)
(building-type-count-total town-center >= tc-level-two)
(goal unit-goal skirmisher)
(wood-amount > 115)
(food-amount > 85)
(goal strategy-goal rush)
(unit-type-count spearman-line < 10)
(can-train spearman-line)
=>
(train spearman-line)
)
#load-if-not-defined AZTEC-CIV
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-resource-control < 1)
(strategic-number sn-current-age >= fc-transit)
(or
(military-population < 4)
(building-type-count-total monastery > 0)
)
(goal strategy-goal rush)
(or
(goal unit-goal mix)
(goal unit-goal skirmisher)
)
(food-amount > 90)
(wood-amount > 95)
(can-train skirmisher-line)
=>
(train skirmisher-line)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-resource-control < 1)
(strategic-number sn-current-age >= fc-transit)
(goal strategy-goal rush)
(goal unit-goal skirmisher)
(or
(goal enemy-goal skirmisher)
(and
(players-military-population focus-player > 4)
(players-current-age focus-player == feudal-age)
)
)
(or
(military-population < 8)
(strategic-number sn-military-level < 0)
)
(can-train skirmisher-line)
=>
(train skirmisher-line)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-resource-control < 1)
(strategic-number sn-current-age == fc-transit)
(military-population < 8)
(goal strategy-goal rush)
(goal unit-goal skirmisher)
(goal enemy-goal flush)
(up-research-status c: ri-double-bit-axe >= research-pending)
(can-train skirmisher-line)
=>
(train skirmisher-line)
)
#end-if
(defrule
(strategic-number sn-resource-control < 1)
(or
(strategic-number sn-current-age == fc-transit)
(and
(gold-amount > 145)
(building-type-count-total monastery > 0)
)
)
(wood-amount > 85)
(goal strategy-goal rush)
(goal ranged-unit-type-goal archer)
(goal unit-goal skirmisher)
(can-train archer-line)
=>
(train archer-line)
)
(defrule
(current-age == castle-age)
(current-age-time < 400)
(strategic-number sn-resource-control < 1)
;tl (food-amount >= 85)
(goal strategy-goal rush)
(goal unit-goal archer)
(nor
(research-available ri-crossbow)
(goal enemy-goal flush)
)
(or
(or
(players-civ focus-player frankish)
(players-civ focus-player persian)
)
(players-civ any-enemy hun)
)
(unit-type-count spearman-line < 8)
(can-train spearman-line)
=>
(train spearman-line)
)
#load-if-not-defined UP-POCKET-POSITION
(defrule
(current-age == castle-age)
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(strategic-number sn-resource-control != battering-ram)
(strategic-number sn-archer-threat > 1)
(unit-type-count scorpion-line < 8)
(or
(goal unit-goal eagle-warrior)
(goal unit-goal monk)
)
(can-train scorpion-line)
=>
(train scorpion-line)
)
#end-if
#load-if-not-defined CHINESE-CIV
#load-if-not-defined MONGOL-CIV
#load-if-not-defined MAYAN-CIV
#load-if-not-defined BRITON-CIV
#load-if-not-defined BYZANTINE-CIV
#load-if-not-defined AZTEC-CIV
(defrule
(goal unit-goal gunpowder-class)
(goal strategy-goal fast-imp)
(building-type-count-total castle == 0)
=>
(up-jump-rule 6)
)
#load-if-not-defined UP-POCKET-POSITION
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(goal save-wood-goal 0)
(strategic-number sn-archer-threat >= 1)
(unit-type-count scorpion-line < 5)
(or
(and
(food-amount < 50)
(strategic-number sn-military-level < 0)
)
(and
(up-research-status c: ri-elite-skirmisher < research-complete)
(up-compare-goal unit-goal != eagle-warrior)
)
)
(can-train scorpion-line)
=>
(train scorpion-line)
)
#end-if
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-resource-control < 1)
(players-unit-type-count focus-player spearman-line > 20)
(unit-type-count scorpion-line < 15)
(unit-type-count cavalry-unit-class > 20)
(up-research-status c: ri-heavy-scorpion >= research-pending)
(can-train scorpion-line)
=>
(train scorpion-line)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-resource-control < 1)
(strategic-number sn-archer-threat >= 1)
(unit-type-count scorpion-line < 12)
(or
(and
(gold-amount > 150)
(food-amount < 75)
)
(civ-selected turkish)
)
(can-train scorpion-line)
=>
(train scorpion-line)
)
#load-if-not-defined SLAVIC-CIV
#load-if-not-defined CELTIC-CIV
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(nor (goal strategy-goal fast-imp)
(goal unit-goal default-ranged))
(strategic-number sn-resource-control < 1)
(can-train scorpion-line)
(unit-type-count scorpion-line < 12)
(wood-amount > 400); excess wood and gold
(gold-amount > 300)
(food-amount < 200)
=>
(train scorpion-line)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(up-research-status c: ri-elite-skirmisher < research-pending)
(goal unit-goal monk)
(strategic-number sn-resource-control < 1)
(can-train scorpion-line)
(strategic-number sn-archer-threat >= 1)
(unit-type-count scorpion-line < 6)
(wood-amount > 200)
=>
(train scorpion-line)
)
#end-if
#end-if
(defrule
(or
(or
(civ-selected celtic)
(civ-selected slavic)
)
(or
(goal ranged-unit-type-goal scorpion)
(goal unit-goal scorpion)
)
)
(or
(strategic-number sn-resource-control < 1)
(and
(strategic-number sn-resource-control == 2)
(food-amount < 100)
)
)
(population < del-civ-pop)
(can-train scorpion-line)
(gold-amount > scorpion-gold-min)
=>
(train scorpion-line)
)
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#load-if-defined BYZANTINE-CIV
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(strategic-number sn-resource-control < 1)
(can-train archer-line)
(up-research-status c: ri-arbalest >= research-pending)
(wood-amount > 400); excess wood and gold
(gold-amount > 300)
(food-amount < 200)
=>
(train archer-line)
)
#end-if
#load-if-not-defined MAGYAR-CIV
(defrule
(strategic-number sn-resource-control == 2)
(or
(and
(wood-amount < 300)
(not (research-available ri-champion))
)
(goal monk-threat-goal 1)
)
(food-amount > 580); hussar + lc food cost
(gold-amount < 600); hussar gold cost
(population < max-civ-pop)
(up-research-status c: ri-light-cavalry >= research-pending)
(can-train scout-cavalry-line)
=>
(train scout-cavalry-line)
)
#end-if
#load-if-not-defined AZTEC-CIV
#load-if-not-defined BRITON-CIV
#load-if-not-defined BYZANTINE-CIV
#load-if-not-defined CHINESE-CIV
#load-if-not-defined HUN-CIV
#load-if-not-defined JAPANESE-CIV
#load-if-not-defined KOREAN-CIV
#load-if-not-defined MAYAN-CIV
#load-if-not-defined MONGOL-CIV
#load-if-not-defined SARACEN-CIV
#load-if-not-defined SPANISH-CIV
#load-if-not-defined TURKISH-CIV
#load-if-not-defined VIKING-CIV
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-resource-control < 1)
(strategic-number sn-current-age >= ci-transit)
(or
(gold-amount <= 90)
(goal escrow-purpose-goal ri-halberdier)
)
(food-amount > 200)
(wood-amount > 200)
(or
(unit-type-count spearman-line < 10)
(up-research-status c: ri-pikeman >= research-pending)
)
(nor
(up-research-status c: ri-elite-teutonic-knight >= research-pending)
(up-research-status c: ri-elite-throwing-axeman >= research-pending)
)
(can-train spearman-line)
=>
(train spearman-line)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-resource-control == 2)
(wood-amount > 400)
(food-amount > 400)
(or
(dropsite-min-distance gold > 5)
(gold-amount < 100)
)
(nor
(up-research-status c: ri-elite-teutonic-knight >= research-pending)
(up-research-status c: ri-elite-throwing-axeman >= research-pending)
)
(can-research-with-escrow ri-pikeman)
(strategic-number sn-military-level < 1)
=>
(release-escrow food)(release-escrow gold)
(research ri-pikeman)
)
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-resource-control < 1)
(wood-amount > 300)
(food-amount > 175)
(population < max-civ-pop)
(or
(dropsite-min-distance gold > 5)
(gold-amount < 100)
)
(nand
(gold-amount > 400)
(unit-type-count trade-cart > 20)
)
(up-research-status c: ri-elite-skirmisher >= research-pending)
(can-train skirmisher-line)
=>
(train skirmisher-line)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-resource-control == 2)
(wood-amount > 400)
(food-amount > 400)
(or
(dropsite-min-distance gold > 5)
(gold-amount < 100)
)
(up-research-status c: ri-elite-teutonic-knight < research-pending)
(strategic-number sn-cavalry-threat > 1)
(up-research-status c: ri-pikeman >= research-pending)
(population < max-civ-pop)
(strategic-number sn-military-level < 1)
(can-train spearman-line)
=>
(train spearman-line)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-resource-control == 2)
(wood-amount > 400)
(food-amount > 400)
(population < max-civ-pop)
(or
(dropsite-min-distance gold > 5)
(gold-amount < 100)
)
(strategic-number sn-military-level < 1)
(up-research-status c: ri-elite-skirmisher >= research-pending)
(can-train skirmisher-line)
=>
(train skirmisher-line)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-resource-control <= 2)
(wood-amount > 400)
(food-amount > 400)
(strategic-number sn-cavalry-threat > 1)
(up-research-status c: ri-halberdier >= research-pending)
(population < del-civ-pop)
(goal uu-up-goal 1)
(research-available my-unique-unit-upgrade)
(strategic-number sn-military-level < 0)
(unit-type-count spearman-line < 30)
(can-train spearman-line)
=>
(train spearman-line)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-resource-control <= 2)
(wood-amount > 400)
(food-amount > 400)
(or
(and
(goal uu-up-goal 1)
(research-available my-unique-unit-upgrade)
)
(and
(unit-type-count knight-line > 19)
(research-available ri-paladin)
)
)
(population < del-civ-pop)
(strategic-number sn-military-level < 0)
(up-research-status c: ri-elite-skirmisher >= research-pending)
(can-train skirmisher-line)
=>
(train skirmisher-line)
)
#load-if-defined DEATH-MATCH
#load-if-defined DARK-AGE-START
(defrule
(current-age <= castle-age)
(or (and (strategic-number sn-military-level < 0)
(current-age == feudal-age))
(goal ranged-unit-type-goal archer))
(can-train archer-line)
=>
(train archer-line)
)
(defrule
(unit-type-count militiaman-line > 10)
=>
(research ri-man-at-arms)
(research ri-two-handed-swordsman)
(research ri-long-swordsman)
)
(defrule
(strategic-number sn-current-age <= castle); train militias to keep up with dark age militias
(or (strategic-number sn-military-level < 0)
(current-age <= feudal-age))
(can-train militiaman-line)
=>
(train militiaman-line)
)
#end-if
#end-if
; ********** OTHER RESEARCHES **********
#load-if-defined DIFFICULTY-EASIEST
(defrule
; (current-age >= imperial-age)
(strategic-number sn-resource-control == 2)
; (population >= fourty-percent-pop)
(population < fourty-percent-pop)
=>
(set-strategic-number sn-resource-control 0)
)
#end-if
#load-if-defined MONGOL-CIV
(defrule
(unit-type-count battering-ram-line > 3)
(up-research-status c: ri-siege-ram >= research-pending)
(can-research my-unique-research)
=>
(research my-unique-research)
)
#end-if
(defrule
(strategic-number sn-current-age >= ci-transit)
(strategic-number sn-resource-control < 1)
(or
(population > del-civ-pop)
(goal unit-goal wonder)
)
(can-research ri-stonecutting)
=>
(research ri-stonecutting)
)
#load-if-not-defined WONDER-RACE
(defrule
(strategic-number sn-resource-control <= 2)
(or
(food-amount < 300)
(strategic-number sn-current-age >= ci-transit)
)
(can-research ri-ballistics)
=>
(research ri-ballistics)
)
(defrule
(strategic-number sn-resource-control <= 2)
(or
(wood-amount > 800)
(food-amount > 800)
)
(or
(current-age-time > 30)
(gold-amount < 400)
)
(can-research-with-escrow ri-guilds)
=>
(release-escrow food)(release-escrow gold)
(research ri-guilds)
)
(defrule
(cc-players-unit-type-count 0 stone-mine > 5); stone left on map
(or
(unit-type-count 124 > 0)
(unit-type-count 220 > 0)
)
(or
(strategic-number sn-resource-control < 1)
(strategic-number sn-stone-gatherer-percentage > 15)
)
(strategic-number sn-current-age >= ci-transit)
(strategic-number sn-stone-gatherer-percentage > 4)
(can-research ri-stone-shaft-mining)
=>
(research ri-stone-shaft-mining)
)
(defrule
(can-research ri-cartography)
=>
(research ri-cartography)
)
(defrule
(or (building-type-count-total wonder >= 1)
(and (current-age >= imperial-age)
(and (population > del-civ-pop)
(strategic-number sn-resource-control < 1))))
(can-research ri-treadmill-crane)
=>
(research ri-treadmill-crane))
(defrule
(strategic-number sn-resource-control < 1)
(current-age >= imperial-age)
(or
(gold-amount < 100)
(population > del-civ-pop)
)
(food-amount > 400)
(wood-amount > 400)
(can-research ri-masonry)
=>
(research ri-masonry)
)
(defrule
(strategic-number sn-resource-control < 1)
(or
(gold-amount < 100)
(population > del-civ-pop)
)
(food-amount > 400)
(wood-amount > 400)
(can-research ri-architecture)
=>
(research ri-architecture)
)
(defrule
(strategic-number sn-resource-control < 1)
(or
(gold-amount < 100)
(population > del-civ-pop)
)
(food-amount > 400)
(wood-amount > 400)
(building-type-count castle >= 2)
(can-research ri-hoardings)
=>
(research ri-hoardings)
)
(defrule
(strategic-number sn-resource-control < 1)
(population > del-civ-pop)
(can-research ri-siege-engineers)
=>
(research ri-siege-engineers)
)
(defrule
(strategic-number sn-resource-control < 1)
(food-amount > 1200)
(current-age-time > 300)
(population > del-civ-pop)
(can-research ri-town-watch)
=>
(research ri-town-watch)
)
(defrule
(strategic-number sn-resource-control < 1)
(or
(town-under-attack)
(population > del-civ-pop)
)
(building-type-count castle > 0)
(can-research ri-murder-holes)
=>
(research ri-murder-holes)
)
(defrule
(strategic-number sn-resource-control < 1)
(population > del-civ-pop)
(unit-type-count infantry-class > 11)
(can-research ri-tracking)
=>
(research ri-tracking)
)
(defrule
(strategic-number sn-resource-control < 1)
(population > del-civ-pop)
(building-type-count castle > 0)
(can-research ri-bombard-tower)
=>
(research ri-bombard-tower)
)
(defrule
(strategic-number sn-resource-control == ri-heresy)
(can-research-with-escrow ri-heresy)
=>
(release-escrow gold)
(research ri-heresy)
)
(defrule
(strategic-number sn-resource-control < 2)
(players-unit-type-count focus-player monk > 19)
(can-research-with-escrow ri-faith)
=>
(release-escrow food)(release-escrow gold)
(research ri-faith)
)
#load-if-not-defined DEFEND-WONDER
(defrule
(game-time > 300)
(building-type-count-total bombard-tower < 6)
(game-time < 900); build them defensively early in DM
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(can-build bombard-tower)
=>
(build bombard-tower)
)
#else
(defrule
(game-time > 300)
(building-type-count-total bombard-tower < 9)
(or (building-type-count-total castle >= 3)
(stone-amount >= 700))
(building-type-count-total wonder > 0)
(can-build bombard-tower)
=>
(build bombard-tower)
)
#end-if
#load-if-defined CAPTURE-THE-RELIC
(defrule
(current-age <= feudal-age)
(players-current-age focus-player >= castle-age)
(unit-type-count-total 213 < 2) ; Dead female builder
(unit-type-count-total 225 < 2) ; Dead male builder
(or (unit-type-count-total 134 == 0); dead monk
(strategic-number sn-military-level > 0))
(can-build watch-tower)
=>
(build-forward watch-tower)
(disable-self))
(defrule
(building-type-count monastery >= 1); (unit-type-count monk >= 1)
(unit-type-count-total 213 < 3) ; Dead female builder
(unit-type-count-total 225 < 3) ; Dead male builder
(or (unit-type-count-total 134 == 0); dead monk
(strategic-number sn-military-level > 0))
(can-research ri-bombard-tower)
=>
(research ri-bombard-tower))
(defrule
(or (building-type-count-total bombard-tower < 3)
(and (building-type-count-total castle >= 3)
(building-type-count-total bombard-tower < 15)))
(or (building-type-count-total castle >= 3)
(stone-amount >= 700))
(unit-type-count monk >= 1)
(unit-type-count-total 213 < 3) ; Dead female builder
(unit-type-count-total 225 < 3) ; Dead male builder
(or (unit-type-count-total 134 == 0); dead monk
(strategic-number sn-military-level > 0))
(can-build bombard-tower)
=>
(build-forward bombard-tower))
#end-if
#load-if-defined KING-OF-THE-HILL
(defrule
(building-type-count castle > 0)
(strategic-number sn-military-level > 0)
(can-research ri-bombard-tower)
=>
(research ri-bombard-tower))
(defrule
(or (building-type-count-total bombard-tower < 3)
(and (building-type-count-total castle >= 3)
(building-type-count-total bombard-tower < 15)))
(or (building-type-count-total castle >= 3)
(stone-amount >= 700))
(unit-type-count-total 213 < 3) ; Dead female builder
(unit-type-count-total 225 < 3) ; Dead male builder
(or (strategic-number sn-maximum-town-size >= 40)
(strategic-number sn-number-attack-groups > 1))
(strategic-number sn-military-level > 0)
(can-build bombard-tower)
=>
(build-forward bombard-tower))
#end-if
#load-if-defined TEUTONIC-CIV
(defrule
(up-research-status c: ri-hoardings >= research-pending)
(building-type-count castle > 1)
(can-research my-unique-research)
=>
(research my-unique-research)
)
#end-if
#load-if-defined TURKISH-CIV
(defrule
(or
(building-type-count bombard-tower > 1)
(unit-type-count cannon-galleon-line > 3)
)
(can-research my-unique-research)
=>
(research my-unique-research)
)
#end-if
(defrule
(current-age == imperial-age)
(unit-type-count transport-ship > 0)
(strategic-number sn-resource-control <= 1)
=>
(research ri-padded-archer-armor)
(research ri-leather-archer-armor)
(research ri-ring-archer-armor)
(research ri-chain-mail)
(research ri-plate-mail)
(research ri-scale-barding)
(research ri-chain-barding)
(research ri-plate-barding)
(research ri-forging)
(research ri-iron-casting)
(research ri-blast-furnace)
)
; ********** FARMS/FISHING SHIPs ********** ; Put them at the end for low priority
#load-if-not-defined POPULATION-CAP-25
(defrule
(strategic-number sn-current-age == df-transit)
(or (cc-players-unit-type-count 0 shore-fish >= shorefishreq2); a bit
(cc-players-unit-type-count 0 sea-fish >= deepfishreq2)); a bit
(or (and (strategic-number sn-minimum-water-body-size-for-dock >= water-mixed)
(wood-amount >= 385))
(goal strategy-goal flush))
(wood-amount >= 235)
(unit-type-count-total fishing-ship < 16)
(can-train fishing-ship)
=>
(train fishing-ship); make more fishing ships during feudal transit on islands
)
(defrule
(strategic-number sn-current-age == dark)
(or (cc-players-unit-type-count 0 shore-fish >= shorefishreq2); a bit
(cc-players-unit-type-count 0 sea-fish >= deepfishreq2)); a bit
(or (building-type-count-total lumber-camp > 0)
(and (civ-selected persian)
(unit-type-count-total fishing-ship < 3)))
(unit-type-count-total fishing-ship < 16)
(or (dropsite-min-distance wood < 4)
(wood-amount >= 120))
(can-train fishing-ship)
=>
(train fishing-ship)
)
(defrule
(strategic-number sn-resource-control <= 2)
(or (unit-type-count-total fishing-ship < 10)
(current-age == feudal-age))
(or (cc-players-unit-type-count 0 shore-fish >= shorefishreq2); a bit
(cc-players-unit-type-count 0 sea-fish >= deepfishreq2)); a bit
(wood-amount >= 225)
(game-time < 2100)
(dropsite-min-distance wood < 5)
(population < max-civ-pop)
(unit-type-count revealer == 0); no enemy attacking us
(building-type-count-total market > 0)
(unit-type-count-total fishing-ship < 16)
(can-train fishing-ship)
=>
(train fishing-ship)
)
(defrule
(strategic-number sn-resource-control <= 2)
(or (wood-amount > 200)
(food-amount < 150))
(unit-type-count fishing-ship < 8)
(population < max-civ-pop)
(or (cc-players-unit-type-count 0 shore-fish >= shorefishreq2); a bit
(cc-players-unit-type-count 0 sea-fish >= deepfishreq2)); a bit
(or (warboat-count >= 20)
(strategic-number sn-minimum-water-body-size-for-dock == water-mixed))
(game-time < 2100)
(warboat-count > 6)
(unit-type-count-total fishing-ship < 16)
(can-train fishing-ship)
=>
(train fishing-ship)
)
#load-if-defined VIKING-CIV
(defrule
(current-age == castle-age)
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
(or (not (unit-available war-galley))
(strategic-number sn-resource-control == ri-bodkin-arrow))
(or (cc-players-unit-type-count 0 shore-fish >= shorefishreq2); a bit
(cc-players-unit-type-count 0 sea-fish >= deepfishreq2)); a bit
(unit-type-count fishing-ship < 16)
(can-train fishing-ship)
=>
(train fishing-ship)
)
#end-if
#end-if
#end-if ; NOT WONDER-RACE
; ********** GATHERER PERCENTAGES **********
#load-if-not-defined POST-IMPERIAL-AGE-START
#load-if-not-defined DEATH-MATCH
#load-if-not-defined HUN-CIV
(defrule
; (strategic-number sn-current-age == dark)
(building-type-count-total town-center >= 1)
(unit-type-count villager <= 10)
(up-pending-objects c: house <= 0)
(housing-headroom < 5)
(wood-amount < 30)
(population < max-civ)
(or (strategic-number sn-wood-gatherer-percentage < 33)
(strategic-number sn-wood-gatherer-percentage >= 100))
=>
(set-strategic-number sn-food-gatherer-percentage 33)
(set-strategic-number sn-wood-gatherer-percentage 67)
(set-strategic-number sn-gold-gatherer-percentage 0)
(set-strategic-number sn-stone-gatherer-percentage 0)
; (set-strategic-number sn-cap-civilian-gatherers 1000)
(set-strategic-number sn-maximum-wood-drop-distance wood-distance2)
)
#end-if
(defrule
; (strategic-number sn-current-age == dark)
(building-type-count-total town-center >= 1)
(unit-type-count villager <= 8)
(or (up-pending-objects c: house >= 1)
(or (housing-headroom >= 5)
(or (wood-amount >= 30)
(population >= max-civ))))
(or (strategic-number sn-food-gatherer-percentage != 96)
(strategic-number sn-wood-gatherer-percentage != 4))
=>
(set-strategic-number sn-food-gatherer-percentage 96)
(set-strategic-number sn-wood-gatherer-percentage 4)
(set-strategic-number sn-gold-gatherer-percentage 0)
(set-strategic-number sn-stone-gatherer-percentage 0)
; (set-strategic-number sn-cap-civilian-gatherers 1000)
)
#load-if-defined DIFFICULTY-EASIEST
(defrule
(strategic-number sn-current-age == dark)
(civilian-population >= max-civ)
(strategic-number sn-wood-gatherer-percentage < 25)
=>
(set-strategic-number sn-food-gatherer-percentage 75)
(set-strategic-number sn-wood-gatherer-percentage 25)
(set-strategic-number sn-gold-gatherer-percentage 0)
(set-strategic-number sn-stone-gatherer-percentage 0)
(set-strategic-number sn-maximum-wood-drop-distance wood-distance2))
#end-if
(defrule
(strategic-number sn-current-age == dark)
(unit-type-count villager == 9)
(or (up-pending-objects c: house >= 1)
(or (housing-headroom >= 3)
(or (wood-amount >= 30)
(population >= max-civ))))
(strategic-number sn-food-gatherer-percentage != 89)
=>
(set-strategic-number sn-food-gatherer-percentage 89)
(set-strategic-number sn-wood-gatherer-percentage 11)
(set-strategic-number sn-gold-gatherer-percentage 0)
(set-strategic-number sn-stone-gatherer-percentage 0)
(set-strategic-number sn-maximum-wood-drop-distance wood-distance2))
(defrule
(strategic-number sn-current-age == dark)
(unit-type-count villager == 10)
(or (up-pending-objects c: house >= 1)
(or (housing-headroom >= 3)
(or (wood-amount >= 30)
(population >= max-civ))))
(strategic-number sn-food-gatherer-percentage != 80)
=>
(set-strategic-number sn-food-gatherer-percentage 80)
(set-strategic-number sn-wood-gatherer-percentage 20)
(set-strategic-number sn-gold-gatherer-percentage 0)
(set-strategic-number sn-stone-gatherer-percentage 0)
(set-strategic-number sn-maximum-wood-drop-distance wood-distance2))
(defrule
(unit-type-count villager == 11)
=>
(set-strategic-number sn-food-gatherer-percentage 73)
(set-strategic-number sn-wood-gatherer-percentage 27)
(set-strategic-number sn-maximum-wood-drop-distance wood-distance2)
(disable-self)
)
(defrule
(unit-type-count villager == 12)
=>
(set-strategic-number sn-food-gatherer-percentage 67)
(set-strategic-number sn-wood-gatherer-percentage 33)
(set-strategic-number sn-maximum-wood-drop-distance wood-distance2)
(disable-self)
)
#load-if-not-defined POPULATION-CAP-25
(defrule
(strategic-number sn-current-age == dark)
(unit-type-count villager == 13)
=>
(set-strategic-number sn-food-gatherer-percentage 62)
(set-strategic-number sn-wood-gatherer-percentage 38)
)
#end-if
(defrule
(strategic-number sn-current-age == dark)
(unit-type-count villager == 14)
=>
(set-strategic-number sn-food-gatherer-percentage 64)
(set-strategic-number sn-wood-gatherer-percentage 36)
)
(defrule
(strategic-number sn-current-age == dark)
(unit-type-count villager == 15)
=>
(set-strategic-number sn-food-gatherer-percentage 67)
(set-strategic-number sn-wood-gatherer-percentage 33)
)
(defrule
(strategic-number sn-current-age == dark)
(unit-type-count villager == 16)
=>
(set-strategic-number sn-food-gatherer-percentage 69)
(set-strategic-number sn-wood-gatherer-percentage 31)
)
(defrule
(strategic-number sn-current-age == dark)
(unit-type-count villager == 17)
=>
(set-strategic-number sn-food-gatherer-percentage 71)
(set-strategic-number sn-wood-gatherer-percentage 29)
)
(defrule
(strategic-number sn-current-age == dark)
(unit-type-count villager == 18)
=>
(set-strategic-number sn-food-gatherer-percentage 71)
(set-strategic-number sn-wood-gatherer-percentage 29)
)
(defrule
(strategic-number sn-current-age == dark)
(unit-type-count villager == 19)
=>
(set-strategic-number sn-food-gatherer-percentage 72)
(set-strategic-number sn-wood-gatherer-percentage 28)
)
(defrule
(strategic-number sn-current-age == dark)
(unit-type-count villager == 20)
=>
(set-strategic-number sn-food-gatherer-percentage 70)
(set-strategic-number sn-wood-gatherer-percentage 30)
)
(defrule
(strategic-number sn-current-age == dark)
(unit-type-count villager == 21)
=>
(set-strategic-number sn-food-gatherer-percentage 67)
(set-strategic-number sn-wood-gatherer-percentage 33)
)
(defrule
(strategic-number sn-current-age == dark)
(unit-type-count villager >= 22)
=>
(set-strategic-number sn-food-gatherer-percentage 64)
(set-strategic-number sn-wood-gatherer-percentage 36)
)
(defrule
(strategic-number sn-current-age == dark)
(unit-type-count villager == 23)
=>
(set-strategic-number sn-food-gatherer-percentage 65)
(set-strategic-number sn-wood-gatherer-percentage 35)
)
(defrule
(strategic-number sn-current-age == dark)
(unit-type-count villager == 24)
=>
(set-strategic-number sn-food-gatherer-percentage 67)
(set-strategic-number sn-wood-gatherer-percentage 33)
)
(defrule
(strategic-number sn-current-age == dark)
(unit-type-count villager == 25)
=>
(set-strategic-number sn-food-gatherer-percentage 68)
(set-strategic-number sn-wood-gatherer-percentage 32)
)
(defrule
(strategic-number sn-current-age == dark)
(unit-type-count villager == 26)
=>
(set-strategic-number sn-food-gatherer-percentage 69)
(set-strategic-number sn-wood-gatherer-percentage 31)
)
(defrule
(strategic-number sn-current-age == dark)
(unit-type-count villager == 27)
=>
(set-strategic-number sn-food-gatherer-percentage 70)
(set-strategic-number sn-wood-gatherer-percentage 30)
)
#end-if ; <= no DM
#else; PI =>
(defrule
(unit-type-count villager >= 12)
=>
(set-strategic-number sn-maximum-food-drop-distance 15)
(set-strategic-number sn-maximum-gold-drop-distance 14)
(set-strategic-number sn-maximum-stone-drop-distance 14)
(set-strategic-number sn-maximum-hunt-drop-distance 24)
(set-strategic-number sn-cap-civilian-builders 100)
(set-strategic-number sn-cap-civilian-gatherers 100)
(disable-self))
#end-if
#load-if-defined LOW-RESOURCES-START
(defrule
(strategic-number sn-current-age == df-transit)
=>
(set-strategic-number sn-food-gatherer-percentage 50)
(set-strategic-number sn-wood-gatherer-percentage 38)
(set-strategic-number sn-gold-gatherer-percentage 12)
)
(defrule
(strategic-number sn-current-age == df-transit);will overwrite rule above
(goal strategy-goal flush)
(or
(up-compare-goal unit-goal != militiaman-line)
(civ-selected gothic)
)
=>
(set-strategic-number sn-food-gatherer-percentage 40)
(set-strategic-number sn-wood-gatherer-percentage 60)
(set-strategic-number sn-gold-gatherer-percentage 0)
)
(defrule
(strategic-number sn-current-age >= df-transit)
(goal strategy-goal sling)
=>
(set-strategic-number sn-food-gatherer-percentage 40)
(set-strategic-number sn-wood-gatherer-percentage 40)
(set-strategic-number sn-gold-gatherer-percentage 20)
)
#load-if-defined SARACEN-CIV
(defrule
(strategic-number sn-current-age == df-transit)
(goal strategy-goal rush)
(goal control-goal aggressive-rush)
=>
(set-strategic-number sn-food-gatherer-percentage 50)
(set-strategic-number sn-wood-gatherer-percentage 50)
(set-strategic-number sn-gold-gatherer-percentage 0)
)
#end-if
#end-if
(defrule
(or
(and
(strategic-number sn-current-age == feudal)
(not (goal strategy-goal flush))
)
(and
(regicide-game)
(strategic-number sn-current-age == df-transit)
)
)
=>
(set-strategic-number sn-food-gatherer-percentage 52); testing
(set-strategic-number sn-wood-gatherer-percentage 36)
(set-strategic-number sn-gold-gatherer-percentage 12)
;old (set-strategic-number sn-food-gatherer-percentage 48)
;old (set-strategic-number sn-wood-gatherer-percentage 33)
;old (set-strategic-number sn-gold-gatherer-percentage 19)
)
(defrule
(strategic-number sn-current-age == df-transit)
(or
(and
(goal enemy-boats-goal 1)
(unit-type-count fishing-ship > 4)
)
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
)
(goal strategy-goal flush)
=>
(set-strategic-number sn-food-gatherer-percentage 25)
(set-strategic-number sn-wood-gatherer-percentage 70)
(set-strategic-number sn-gold-gatherer-percentage 5)
)
(defrule
(strategic-number sn-current-age == feudal)
(goal strategy-goal flush)
(or
(goal unit-goal militiaman-line)
(goal unit-goal scout-cavalry)
)
(building-type-count-total mining-camp > 0)
=>
(set-strategic-number sn-food-gatherer-percentage 40)
(set-strategic-number sn-wood-gatherer-percentage 45)
(set-strategic-number sn-gold-gatherer-percentage 15)
)
(defrule
(strategic-number sn-current-age == feudal)
(goal strategy-goal flush)
(or
(goal unit-goal militiaman-line)
(goal unit-goal scout-cavalry)
)
(building-type-count-total blacksmith > 0)
(building-type-count-total mining-camp > 0)
=>
(set-strategic-number sn-food-gatherer-percentage 55)
(set-strategic-number sn-wood-gatherer-percentage 29)
(set-strategic-number sn-gold-gatherer-percentage 16)
)
(defrule
(strategic-number sn-current-age == feudal)
(goal strategy-goal flush)
(or
(and
(goal unit-goal militiaman-line)
(goal enemy-goal flush)
)
(or
(goal unit-goal skirmisher)
(strategic-number sn-cavalry-threat > 1)
)
)
(building-type-count-total blacksmith > 0)
(building-type-count-total mining-camp > 0)
=>
(set-strategic-number sn-food-gatherer-percentage 48)
(set-strategic-number sn-wood-gatherer-percentage 38)
(set-strategic-number sn-gold-gatherer-percentage 14)
)
(defrule
(strategic-number sn-current-age == feudal)
(goal strategy-goal flush)
(strategic-number sn-cavalry-threat > 1)
(or
(and
(or
(building-type-count farm < 16)
(unit-type-count villager > 41)
)
(and
(building-type-count farm < 20)
(unit-type-count villager > 38)
)
)
(building-type-count-total barracks == 0)
)
(building-type-count-total blacksmith > 0)
=>
(set-strategic-number sn-food-gatherer-percentage 40)
(set-strategic-number sn-wood-gatherer-percentage 50)
(set-strategic-number sn-gold-gatherer-percentage 10)
)
(defrule
(strategic-number sn-current-age == feudal)
(goal strategy-goal flush)
(goal unit-goal archer)
(building-type-count-total mining-camp > 0)
=>
(set-strategic-number sn-food-gatherer-percentage 35)
(set-strategic-number sn-wood-gatherer-percentage 50)
(set-strategic-number sn-gold-gatherer-percentage 15)
)
(defrule
(strategic-number sn-current-age == feudal)
(goal strategy-goal flush)
(goal unit-goal archer)
(building-type-count-total blacksmith > 0)
=>
(set-strategic-number sn-food-gatherer-percentage 45)
(set-strategic-number sn-wood-gatherer-percentage 35)
(set-strategic-number sn-gold-gatherer-percentage 20)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(strategic-number sn-current-age == feudal)
(goal strategy-goal flush)
(building-type-count-total blacksmith > 0)
(current-age-time < 400)
(goal control-goal belated-flush-defense)
=>
(set-strategic-number sn-food-gatherer-percentage 45)
(set-strategic-number sn-wood-gatherer-percentage 50)
(set-strategic-number sn-gold-gatherer-percentage 5)
)
#load-if-defined AZTEC-CIV
#load-if-not-defined REGICIDE
(defrule
(building-type-count barracks == 0)
(or
(strategic-number sn-current-age == df-transit);will overwrite rule above
(strategic-number sn-current-age == feudal)
)
(goal strategy-goal rush)
(or
(and
(goal unit-goal eagle-warrior)
(up-compare-goal position-goal == flank)
)
(goal unit-goal monk)
)
(up-compare-goal control-goal != shot); shot won't sell stone for additional TCs, so mine more gold
=>
(set-strategic-number sn-food-gatherer-percentage 50)
(set-strategic-number sn-wood-gatherer-percentage 47)
(set-strategic-number sn-gold-gatherer-percentage 3)
)
#end-if
#end-if
(defrule
(strategic-number sn-current-age == feudal)
(or
(goal unit-goal my-unique-unit-line)
(civ-selected saracen)
)
(nor
(goal strategy-goal flush)
(goal strategy-goal sling)
)
(dropsite-min-distance stone < 6)
(stone-amount < 700)
=>
(set-strategic-number sn-food-gatherer-percentage 40)
(set-strategic-number sn-wood-gatherer-percentage 40)
(set-strategic-number sn-gold-gatherer-percentage 15)
(set-strategic-number sn-stone-gatherer-percentage 5)
)
(defrule
(or
(and
(strategic-number sn-current-age == feudal)
(goal strategy-goal sling)
)
(and
(strategic-number sn-wood-gatherer-percentage == 100); end of rebuild code
(building-type-count town-center > 0); use this in case not other percentages are loaded for some reason.
)
)
(game-time > 1200)
=>
(set-strategic-number sn-food-gatherer-percentage 45)
(set-strategic-number sn-wood-gatherer-percentage 30)
(set-strategic-number sn-gold-gatherer-percentage 20)
(set-strategic-number sn-stone-gatherer-percentage 5)
)
#load-if-not-defined SARACEN-CIV
(defrule
(goal strategy-goal rush)
(or
(goal unit-goal eagle-warrior)
(goal unit-goal monk)
)
(strategic-number sn-current-age == fc-transit)
=>
(set-strategic-number sn-food-gatherer-percentage 37)
(set-strategic-number sn-wood-gatherer-percentage 43)
(set-strategic-number sn-gold-gatherer-percentage 20)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
(defrule
(goal unit-goal eagle-warrior)
(goal control-goal shot)
(strategic-number sn-current-age >= fc-transit)
(building-type-count-total town-center < tc-level-three)
=>
(set-strategic-number sn-food-gatherer-percentage 30)
(set-strategic-number sn-wood-gatherer-percentage 50)
(set-strategic-number sn-gold-gatherer-percentage 20)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
(defrule
(or
(goal strategy-goal rush)
(goal strategy-goal boom)
)
(or
(or
(goal unit-goal mix)
(goal unit-goal skirmisher)
)
(or
(goal unit-goal militiaman-line)
(goal unit-goal scorpion)
)
)
(strategic-number sn-current-age == fc-transit)
=>
(set-strategic-number sn-food-gatherer-percentage 42)
(set-strategic-number sn-wood-gatherer-percentage 48)
(set-strategic-number sn-gold-gatherer-percentage 10)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
(defrule
(goal strategy-goal boom)
(goal unit-goal knight)
(strategic-number sn-current-age >= fc-transit)
(or
(stone-amount >= 100)
(dropsite-min-distance stone > 5)
)
(building-type-count-total town-center < tc-level-three)
=>
(set-strategic-number sn-food-gatherer-percentage 42)
(set-strategic-number sn-wood-gatherer-percentage 46)
(set-strategic-number sn-gold-gatherer-percentage 12)
(set-strategic-number sn-stone-gatherer-percentage 0)
(up-jump-rule 2)
)
(defrule
(goal unit-goal knight)
(strategic-number sn-current-age >= fc-transit)
=>
(set-strategic-number sn-food-gatherer-percentage 48)
(set-strategic-number sn-wood-gatherer-percentage 37)
(set-strategic-number sn-gold-gatherer-percentage 15)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
(defrule
(goal unit-goal knight)
(goal position-goal pocket)
(up-compare-goal control-goal != aggressive-rush)
(strategic-number sn-current-age >= fc-transit)
=>
(set-strategic-number sn-food-gatherer-percentage 40)
(set-strategic-number sn-wood-gatherer-percentage 45)
(set-strategic-number sn-gold-gatherer-percentage 15)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
(defrule
(goal strategy-goal rush)
(or
(goal unit-goal scout-cavalry)
(and
(goal unit-goal skirmisher)
(goal monk-threat-goal 1)
)
)
(strategic-number sn-current-age >= fc-transit)
=>
(set-strategic-number sn-food-gatherer-percentage 55)
(set-strategic-number sn-wood-gatherer-percentage 35)
(set-strategic-number sn-gold-gatherer-percentage 10)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
(defrule
(or
(and
(goal strategy-goal rush)
(goal unit-goal cavalry-archer)
)
(goal strategy-goal flush)
)
(strategic-number sn-current-age == fc-transit)
=>
(set-strategic-number sn-food-gatherer-percentage 32)
(set-strategic-number sn-wood-gatherer-percentage 48)
(set-strategic-number sn-gold-gatherer-percentage 20)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
(defrule
(strategic-number sn-current-age == fc-transit)
(or
(goal unit-goal archer)
(and
(or
(civ-selected mayan)
(civ-selected aztec)
)
(goal strategy-goal flush)
)
)
=>
(set-strategic-number sn-food-gatherer-percentage 29)
(set-strategic-number sn-wood-gatherer-percentage 42)
(set-strategic-number sn-gold-gatherer-percentage 29)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
(defrule
(strategic-number sn-current-age == fc-transit)
(nor
(goal unit-goal my-unique-unit-line)
(goal unit-goal knight)
)
(goal strategy-goal boom)
=>
(set-strategic-number sn-food-gatherer-percentage 35)
(set-strategic-number sn-wood-gatherer-percentage 50)
(set-strategic-number sn-gold-gatherer-percentage 15)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
(defrule
(strategic-number sn-current-age == fc-transit)
(goal control-goal aggressive-rush)
(goal unit-goal archer)
=>
(set-strategic-number sn-food-gatherer-percentage 23)
(set-strategic-number sn-wood-gatherer-percentage 42)
(set-strategic-number sn-gold-gatherer-percentage 35)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
#load-if-not-defined HIGH-RESOURCES-START
(defrule
(strategic-number sn-current-age >= fc-transit)
(building-type-count-total castle == 0)
(goal strategy-goal rush)
(goal unit-goal my-unique-unit-line)
=>
(set-strategic-number sn-food-gatherer-percentage 37)
(set-strategic-number sn-wood-gatherer-percentage 27)
(set-strategic-number sn-gold-gatherer-percentage 6)
(set-strategic-number sn-stone-gatherer-percentage 30)
)
(defrule
(strategic-number sn-current-age >= fc-transit)
(building-type-count-total castle == 0)
(goal strategy-goal boom)
(goal unit-goal my-unique-unit-line)
=>
(set-strategic-number sn-food-gatherer-percentage 27)
(set-strategic-number sn-wood-gatherer-percentage 40)
(set-strategic-number sn-gold-gatherer-percentage 3)
(set-strategic-number sn-stone-gatherer-percentage 30)
)
(defrule
(strategic-number sn-current-age >= fc-transit)
(unit-type-count villager > 50)
(building-type-count-total castle == 0)
(goal unit-goal my-unique-unit-line)
=>
(set-strategic-number sn-food-gatherer-percentage 37)
(set-strategic-number sn-wood-gatherer-percentage 27)
(set-strategic-number sn-gold-gatherer-percentage 26)
(set-strategic-number sn-stone-gatherer-percentage 10)
)
#end-if
(defrule
(strategic-number sn-current-age >= fc-transit)
(goal strategy-goal fast-imp)
(nand
(and
(goal unit-goal eagle-warrior)
(goal control-goal shot)
)
(building-type-count-total town-center < 3)
)
=>
(set-strategic-number sn-food-gatherer-percentage 45)
(set-strategic-number sn-wood-gatherer-percentage 22)
(set-strategic-number sn-gold-gatherer-percentage 33)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
(defrule
(strategic-number sn-current-age == ci-transit)
(goal strategy-goal fast-imp)
=>
(set-strategic-number sn-food-gatherer-percentage 40)
(set-strategic-number sn-wood-gatherer-percentage 40)
(set-strategic-number sn-gold-gatherer-percentage 20)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
#else; => #load-if-defined SARACEN-CIV
(defrule
(goal unit-goal knight)
(goal control-goal aggressive-rush)
(building-type-count market > 0)
(building-type-count-total stable < 2)
(strategic-number sn-current-age >= fc-transit)
(game-time < 1800)
=>
(set-strategic-number sn-food-gatherer-percentage 20)
(set-strategic-number sn-wood-gatherer-percentage 35)
(set-strategic-number sn-gold-gatherer-percentage 22)
(set-strategic-number sn-stone-gatherer-percentage 23)
)
(defrule
(strategic-number sn-current-age >= fc-transit)
(goal unit-goal archer)
(goal control-goal aggressive-rush)
(building-type-count market > 0)
(building-type-count-total archery-range < 3)
(unit-type-count villager > 20)
(game-time < 1800)
=>
(set-strategic-number sn-food-gatherer-percentage 10)
(set-strategic-number sn-wood-gatherer-percentage 45)
(set-strategic-number sn-gold-gatherer-percentage 20)
(set-strategic-number sn-stone-gatherer-percentage 25)
)
(defrule
(strategic-number sn-current-age >= fc-transit)
(or
(and
(goal unit-goal monk)
(building-type-count-total monastery < 3)
)
(goal unit-goal scorpion)
)
(unit-type-count villager > 20)
(game-time < 1800)
=>
(set-strategic-number sn-food-gatherer-percentage 20)
(set-strategic-number sn-wood-gatherer-percentage 35)
(set-strategic-number sn-gold-gatherer-percentage 22)
(set-strategic-number sn-stone-gatherer-percentage 23)
)
(defrule
(goal unit-goal monk)
(building-type-count-total monastery > 2)
(commodity-selling-price stone > 104)
(unit-type-count villager > 20)
(game-time < 1800)
=>
(set-strategic-number sn-food-gatherer-percentage 25)
(set-strategic-number sn-wood-gatherer-percentage 20)
(set-strategic-number sn-gold-gatherer-percentage 30)
(set-strategic-number sn-stone-gatherer-percentage 25)
)
(defrule
(strategic-number sn-current-age >= fc-transit)
(strategic-number sn-minimum-water-body-size-for-dock == water-mixed)
(goal control-goal aggressive-rush)
(building-type-count market > 0)
(building-type-count-total archery-range < 3)
(building-type-count-total stable < 2)
(building-type-count-total monastery < 3)
(commodity-selling-price stone > 104)
(unit-type-count villager > 20)
(game-time < 1800)
=>
(set-strategic-number sn-food-gatherer-percentage 10)
(set-strategic-number sn-wood-gatherer-percentage 50)
(set-strategic-number sn-gold-gatherer-percentage 20)
(set-strategic-number sn-stone-gatherer-percentage 20)
)
#end-if ; SARACEN-CIV
(defrule
(game-time < 1800)
(strategic-number sn-current-age >= ci-transit)
(goal strategy-goal fast-imp)
(goal unit-goal gunpowder-class)
=>
(set-strategic-number sn-food-gatherer-percentage 38)
(set-strategic-number sn-wood-gatherer-percentage 45)
(set-strategic-number sn-gold-gatherer-percentage 17)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
(defrule
(or
(building-type-count-total town-center == 1)
(goal enemy-fortifications-goal 1)
)
(strategic-number sn-current-age >= ci-transit)
(goal strategy-goal fast-imp)
(building-type-count-total archery-range > 2)
(goal unit-goal gunpowder-class)
=>
(set-strategic-number sn-food-gatherer-percentage 35)
(set-strategic-number sn-wood-gatherer-percentage 35)
(set-strategic-number sn-gold-gatherer-percentage 27)
(set-strategic-number sn-stone-gatherer-percentage 3)
)
(defrule
(strategic-number sn-current-age == fc-transit)
(goal unit-goal wonder)
=>
(set-strategic-number sn-food-gatherer-percentage 30)
(set-strategic-number sn-wood-gatherer-percentage 25)
(set-strategic-number sn-gold-gatherer-percentage 35)
(set-strategic-number sn-stone-gatherer-percentage 10)
)
(defrule
(goal strategy-goal rush)
(or
(and
(goal unit-goal eagle-warrior)
(strategic-number sn-cavalry-threat >= 1)
)
(goal unit-goal mix)
)
(unit-type-count villager > 20)
(building-type-count-total monastery > 0)
=>
(set-strategic-number sn-food-gatherer-percentage 38)
(set-strategic-number sn-wood-gatherer-percentage 37)
(set-strategic-number sn-gold-gatherer-percentage 25)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
(defrule
(strategic-number sn-current-age >= fc-transit)
(goal strategy-goal rush)
(goal unit-goal eagle-warrior)
(strategic-number sn-cavalry-threat == 0)
(building-type-count-total barracks > 2)
(or
(and
(building-type-count-total barracks > 3)
(building-type-count-total monastery > 0)
)
(goal control-goal aggressive-rush)
)
=>
(set-strategic-number sn-food-gatherer-percentage 34)
(set-strategic-number sn-wood-gatherer-percentage 26)
(set-strategic-number sn-gold-gatherer-percentage 40)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
(defrule
(or
(strategic-number sn-current-age == fc-transit)
(and
(current-age == castle-age)
(current-age-time < 120)
)
)
(goal strategy-goal rush)
(goal unit-goal eagle-warrior)
(strategic-number sn-cavalry-threat == 0)
(building-type-count-total barracks > 2)
(goal control-goal aggressive-rush)
=>
(set-strategic-number sn-food-gatherer-percentage 40)
(set-strategic-number sn-wood-gatherer-percentage 26)
(set-strategic-number sn-gold-gatherer-percentage 34)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
(defrule
(strategic-number sn-current-age == fc-transit)
(goal unit-goal my-unique-unit-line)
(dropsite-min-distance stone < 6)
(stone-amount < 700)
(building-type-count castle > 0)
=>
(set-strategic-number sn-food-gatherer-percentage 34)
(set-strategic-number sn-wood-gatherer-percentage 45)
(set-strategic-number sn-gold-gatherer-percentage 15)
(set-strategic-number sn-stone-gatherer-percentage 6)
(research ri-stone-mining); debug, dba and hc are blocked
)
#load-if-not-defined SARACEN-CIV
(defrule
(goal strategy-goal rush)
(up-compare-goal control-goal != shot)
(goal unit-goal knight)
(strategic-number sn-current-age == castle)
(current-age-time < 300)
=>
(set-strategic-number sn-food-gatherer-percentage 50)
(set-strategic-number sn-wood-gatherer-percentage 30)
(set-strategic-number sn-gold-gatherer-percentage 20)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
(defrule
(goal strategy-goal rush)
(goal unit-goal knight)
(up-compare-goal control-goal != shot)
(strategic-number sn-current-age == castle)
(building-type-count-total stable > 1)
(building-type-count-total siege-workshop > 0)
(game-time < 1500)
=>
(set-strategic-number sn-food-gatherer-percentage 33)
(set-strategic-number sn-wood-gatherer-percentage 38)
(set-strategic-number sn-gold-gatherer-percentage 29)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
#end-if
(defrule
(strategic-number sn-current-age == castle)
(building-type-count-total town-center < tc-level-three)
(stone-amount >= 100)
(goal unit-goal archer)
(goal strategy-goal boom)
=>
(set-strategic-number sn-food-gatherer-percentage 30)
(set-strategic-number sn-wood-gatherer-percentage 50)
(set-strategic-number sn-gold-gatherer-percentage 20)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
(defrule
(goal strategy-goal rush)
(goal unit-goal cavalry-archer)
(goal control-goal aggressive-rush)
(strategic-number sn-current-age == castle)
(unit-type-count villager > 20)
(building-type-count-total stable < 2)
=>
(set-strategic-number sn-food-gatherer-percentage 27)
(set-strategic-number sn-wood-gatherer-percentage 38)
(set-strategic-number sn-gold-gatherer-percentage 35)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
(defrule
(goal strategy-goal rush)
(goal unit-goal cavalry-archer)
(goal control-goal aggressive-rush)
(strategic-number sn-cavalry-threat > 1)
(strategic-number sn-current-age == castle)
(unit-type-count villager > 20)
(building-type-count-total stable < 2)
=>
(set-strategic-number sn-food-gatherer-percentage 35)
(set-strategic-number sn-wood-gatherer-percentage 38)
(set-strategic-number sn-gold-gatherer-percentage 27)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
(defrule
(goal strategy-goal rush)
(goal unit-goal cavalry-archer)
(building-type-count-total town-center >= tc-level-two)
(building-type-count-total archery-range > 2)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 37)
(set-strategic-number sn-wood-gatherer-percentage 35)
(set-strategic-number sn-gold-gatherer-percentage 28)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
(defrule
(goal strategy-goal rush)
(or (and (goal unit-goal archer)
(stone-amount >= 100))
(goal unit-goal scorpion))
(building-type-count-total stable == 0)
(strategic-number sn-current-age == castle)
(commodity-selling-price stone < 96)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 25)
(set-strategic-number sn-wood-gatherer-percentage 45)
(set-strategic-number sn-gold-gatherer-percentage 30)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
(defrule
(goal strategy-goal rush)
(goal unit-goal archer)
(building-type-count-total stable == 0)
(strategic-number sn-current-age == castle)
(stone-amount >= 100)
(commodity-selling-price stone < 96)
(unit-type-count villager > 20)
(or (up-research-status c: ri-pikeman >= research-pending)
(up-research-status c: ri-elite-skirmisher >= research-pending))
=>
(set-strategic-number sn-food-gatherer-percentage 32)
(set-strategic-number sn-wood-gatherer-percentage 43)
(set-strategic-number sn-gold-gatherer-percentage 25)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
(defrule
(goal strategy-goal flush)
(or (goal unit-goal archer)
(goal unit-goal mix))
(unit-type-count villager > 20)
(strategic-number sn-current-age == castle)
=>
(set-strategic-number sn-food-gatherer-percentage 20)
(set-strategic-number sn-wood-gatherer-percentage 50)
(set-strategic-number sn-gold-gatherer-percentage 30)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
(defrule
(or (goal strategy-goal flush)
(goal strategy-goal rush))
(goal unit-goal archer)
(building-type-count-total town-center >= tc-level-three)
(commodity-selling-price stone < 96)
(dropsite-min-distance stone < 5)
(strategic-number sn-current-age == castle)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 33)
(set-strategic-number sn-wood-gatherer-percentage 43)
(set-strategic-number sn-gold-gatherer-percentage 22)
(set-strategic-number sn-stone-gatherer-percentage 2)
)
(defrule
(strategic-number sn-current-age == castle)
(goal strategy-goal flush)
(or (goal unit-goal cavalry-archer)
(goal unit-goal mix))
(unit-type-count villager > 20)
(building-type-count-total town-center >= tc-level-two)
=>
(set-strategic-number sn-food-gatherer-percentage 38)
(set-strategic-number sn-wood-gatherer-percentage 37)
(set-strategic-number sn-gold-gatherer-percentage 25)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
(defrule
(or (goal strategy-goal flush)
(up-research-status c: ri-bodkin-arrow >= research-pending))
(or (goal unit-goal archer)
(goal unit-goal cavalry-archer))
(stone-amount < 100)
(building-type-count-total town-center < tc-level-three)
(strategic-number sn-current-age == castle)
(up-compare-goal control-goal != my-unique-unit-line)
=>
(set-strategic-number sn-food-gatherer-percentage 20)
(set-strategic-number sn-wood-gatherer-percentage 45)
(set-strategic-number sn-gold-gatherer-percentage 30)
(set-strategic-number sn-stone-gatherer-percentage 5)
)
(defrule
(strategic-number sn-current-age == castle)
(goal strategy-goal flush)
(goal unit-goal mix)
(or (building-type-count-total town-center >= tc-level-three)
(stone-amount < 100))
(dropsite-min-distance stone < 5)
(up-compare-goal control-goal != my-unique-unit-line)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 41)
(set-strategic-number sn-wood-gatherer-percentage 36)
(set-strategic-number sn-gold-gatherer-percentage 20)
(set-strategic-number sn-stone-gatherer-percentage 2)
)
#load-if-not-defined CELTIC-CIV
(defrule
(goal unit-goal skirmisher)
(up-compare-goal control-goal != my-unique-unit-line)
(strategic-number sn-current-age >= castle)
(or (and (building-type-count-total town-center >= tc-level-three)
(goal strategy-goal rush))
(stone-amount < 100))
(dropsite-min-distance stone < 5)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 40)
(set-strategic-number sn-wood-gatherer-percentage 45)
(set-strategic-number sn-gold-gatherer-percentage 12)
(set-strategic-number sn-stone-gatherer-percentage 3)
)
(defrule
(strategic-number sn-current-age == castle)
(goal strategy-goal flush)
(goal unit-goal militiaman-line)
(building-type-count-total town-center >= tc-level-two)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 45)
(set-strategic-number sn-wood-gatherer-percentage 32)
(set-strategic-number sn-gold-gatherer-percentage 23)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
(defrule
(strategic-number sn-current-age == castle)
(goal strategy-goal flush)
(goal unit-goal militiaman-line)
(stone-amount < 100)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 48)
(set-strategic-number sn-wood-gatherer-percentage 25)
(set-strategic-number sn-gold-gatherer-percentage 20)
(set-strategic-number sn-stone-gatherer-percentage 2)
)
#else
(defrule
(goal strategy-goal rush)
(goal unit-goal skirmisher)
(strategic-number sn-current-age >= castle)
(building-type-count-total town-center < 3)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 38)
(set-strategic-number sn-wood-gatherer-percentage 48)
(set-strategic-number sn-gold-gatherer-percentage 14)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
(defrule
(goal strategy-goal flush)
(dropsite-min-distance stone < 6)
(strategic-number sn-current-age >= castle)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 39)
(set-strategic-number sn-wood-gatherer-percentage 45)
(set-strategic-number sn-gold-gatherer-percentage 13)
(set-strategic-number sn-stone-gatherer-percentage 3)
)
(defrule
(goal unit-goal militiaman-line)
(dropsite-min-distance stone < 6)
(strategic-number sn-current-age >= castle)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 45)
(set-strategic-number sn-wood-gatherer-percentage 33)
(set-strategic-number sn-gold-gatherer-percentage 17)
(set-strategic-number sn-stone-gatherer-percentage 5)
)
#end-if
(defrule
(goal strategy-goal rush)
(goal unit-goal skirmisher)
(strategic-number sn-cavalry-threat == 0)
(players-unit-type-count every-enemy militiaman-line < 8)
(not (goal control-goal my-unique-unit-line))
(strategic-number sn-current-age >= castle)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 42)
(set-strategic-number sn-wood-gatherer-percentage 48)
(set-strategic-number sn-gold-gatherer-percentage 10)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
#load-if-defined GOTHIC-CIV
(defrule
(goal strategy-goal flush)
(goal unit-goal militiaman-line)
(building-type-count-total town-center >= tc-level-three)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 45)
(set-strategic-number sn-wood-gatherer-percentage 32)
(set-strategic-number sn-gold-gatherer-percentage 18)
(set-strategic-number sn-stone-gatherer-percentage 5)
)
#end-if
#load-if-not-defined VIKING-CIV
#load-if-not-defined TURKISH-CIV
(defrule
(not (goal strategy-goal boom))
(goal unit-goal knight)
(strategic-number sn-current-age == castle)
(building-type-count town-center >= tc-level-two)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 42); 42
(set-strategic-number sn-wood-gatherer-percentage 35); 38
(set-strategic-number sn-gold-gatherer-percentage 23)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
#else
(defrule
(not (goal strategy-goal boom))
(goal unit-goal knight)
(strategic-number sn-current-age == castle)
(building-type-count town-center >= tc-level-two)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 43)
(set-strategic-number sn-wood-gatherer-percentage 40)
(set-strategic-number sn-gold-gatherer-percentage 17)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
#end-if
#end-if
(defrule
(goal strategy-goal boom)
(or
(goal unit-goal archer)
(goal unit-goal scorpion)
)
(building-type-count-total town-center < 3)
(stone-amount < 100); gather stone when TC disrupted
=>
(set-strategic-number sn-food-gatherer-percentage 23)
(set-strategic-number sn-wood-gatherer-percentage 46)
(set-strategic-number sn-gold-gatherer-percentage 28)
(set-strategic-number sn-stone-gatherer-percentage 3)
)
(defrule
(goal strategy-goal boom)
(goal unit-goal scorpion)
(building-type-count-total town-center >= tc-level-three)
=>
(set-strategic-number sn-food-gatherer-percentage 35)
(set-strategic-number sn-wood-gatherer-percentage 48)
(set-strategic-number sn-gold-gatherer-percentage 15)
(set-strategic-number sn-stone-gatherer-percentage 2)
)
(defrule
(goal strategy-goal boom)
(or
(goal unit-goal archer)
(and
(goal unit-goal scorpion)
(up-research-status c: ri-light-cavalry >= research-pending)
)
)
(building-type-count-total town-center >= tc-level-three)
=>
(set-strategic-number sn-food-gatherer-percentage 40)
(set-strategic-number sn-wood-gatherer-percentage 40)
(set-strategic-number sn-gold-gatherer-percentage 15)
(set-strategic-number sn-stone-gatherer-percentage 5)
)
(defrule
(goal strategy-goal boom)
(goal unit-goal archer)
(or
(building-type-count-total town-center >= tc-level-four)
(current-age-time > 300)
)
(strategic-number sn-current-age >= castle-age)
=>
(set-strategic-number sn-food-gatherer-percentage 37)
(set-strategic-number sn-wood-gatherer-percentage 43)
(set-strategic-number sn-gold-gatherer-percentage 18)
(set-strategic-number sn-stone-gatherer-percentage 2)
)
(defrule
(goal strategy-goal boom)
(goal unit-goal archer)
(strategic-number sn-current-age >= ci-transit)
=>
(set-strategic-number sn-food-gatherer-percentage 26)
(set-strategic-number sn-wood-gatherer-percentage 42)
(set-strategic-number sn-gold-gatherer-percentage 30)
(set-strategic-number sn-stone-gatherer-percentage 2)
)
#load-if-defined AZTEC-CIV
(defrule
(goal strategy-goal fast-imp)
(strategic-number sn-current-age >= fc-transit)
; (building-type-count-total town-center >= tc-level-three)
=>
(set-strategic-number sn-food-gatherer-percentage 44)
(set-strategic-number sn-wood-gatherer-percentage 30)
(set-strategic-number sn-gold-gatherer-percentage 26)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
(defrule
(goal strategy-goal boom)
(goal unit-goal archer)
(building-type-count-total town-center >= tc-level-three)
=>
(set-strategic-number sn-food-gatherer-percentage 40)
(set-strategic-number sn-wood-gatherer-percentage 46)
(set-strategic-number sn-gold-gatherer-percentage 12)
(set-strategic-number sn-stone-gatherer-percentage 2)
)
#end-if
#load-if-defined PERSIAN-CIV
(defrule
(strategic-number sn-current-age == castle)
(building-type-count-total town-center >= tc-level-four)
(dropsite-min-distance stone <= 6)
(goal control-goal my-unique-unit-line)
(building-type-count-total castle == 0)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 45)
(set-strategic-number sn-wood-gatherer-percentage 30)
(set-strategic-number sn-gold-gatherer-percentage 15)
(set-strategic-number sn-stone-gatherer-percentage 10)
)
#end-if
#load-if-defined INDIAN-CIV
(defrule
(strategic-number sn-current-age == castle)
(building-type-count-total town-center >= tc-level-three)
(goal strategy-goal fast-imp)
(goal unit-goal gunpowder-class)
=>
(set-strategic-number sn-food-gatherer-percentage 55)
(set-strategic-number sn-wood-gatherer-percentage 30)
(set-strategic-number sn-gold-gatherer-percentage 15)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
#end-if
#load-if-not-defined TEUTONIC-CIV
(defrule
(goal unit-goal knight)
(strategic-number sn-current-age == castle)
(building-type-count-total town-center >= tc-level-three)
(building-type-count-total archery-range > 0)
(dropsite-min-distance stone <= 6)
(goal control-goal my-unique-unit-line)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 35)
(set-strategic-number sn-wood-gatherer-percentage 34)
(set-strategic-number sn-gold-gatherer-percentage 18)
(set-strategic-number sn-stone-gatherer-percentage 13)
)
(defrule
(goal unit-goal knight)
(strategic-number sn-current-age == castle)
(building-type-count-total town-center >= tc-level-three)
(dropsite-min-distance stone <= 6)
(up-research-status c: ri-elite-skirmisher >= research-pending)
(goal control-goal my-unique-unit-line)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 37)
(set-strategic-number sn-wood-gatherer-percentage 36)
(set-strategic-number sn-gold-gatherer-percentage 15)
(set-strategic-number sn-stone-gatherer-percentage 12)
)
#end-if
(defrule
(goal unit-goal knight)
(strategic-number sn-current-age == castle)
(building-type-count-total town-center >= tc-level-two)
(dropsite-min-distance stone <= 6)
(goal control-goal my-unique-unit-line)
(or(civ-selected frankish)(civ-selected briton))
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 45)
(set-strategic-number sn-wood-gatherer-percentage 30)
(set-strategic-number sn-gold-gatherer-percentage 15)
(set-strategic-number sn-stone-gatherer-percentage 10)
)
(defrule
(goal unit-goal knight)
(goal control-goal shot)
(strategic-number sn-current-age == castle)
(building-type-count-total town-center >= tc-level-two)
(dropsite-min-distance stone <= 6)
(unit-type-count villager > 20)
(or(civ-selected mongol)(civ-selected chinese))
=>
(set-strategic-number sn-food-gatherer-percentage 35)
(set-strategic-number sn-wood-gatherer-percentage 30)
(set-strategic-number sn-gold-gatherer-percentage 22)
(set-strategic-number sn-stone-gatherer-percentage 13)
)
(defrule
(goal unit-goal knight)
(strategic-number sn-current-age >= castle)
(building-type-count-total castle > 0)
(goal control-goal my-unique-unit-line)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 42)
(set-strategic-number sn-wood-gatherer-percentage 36)
(set-strategic-number sn-gold-gatherer-percentage 20)
(set-strategic-number sn-stone-gatherer-percentage 2)
)
(defrule
(goal strategy-goal rush)
(or
(goal unit-goal eagle-warrior)
(goal unit-goal militiaman-line)
)
(strategic-number sn-current-age >= castle)
(dropsite-min-distance stone <= 6)
(or
(building-type-count-total town-center >= tc-level-two)
(and
(stone-amount < 100)
(up-research-status c: ri-pikeman >= research-pending)
)
)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 38)
(set-strategic-number sn-wood-gatherer-percentage 33)
(set-strategic-number sn-gold-gatherer-percentage 26)
(set-strategic-number sn-stone-gatherer-percentage 3)
)
(defrule
(goal strategy-goal rush)
(goal unit-goal eagle-warrior)
(or
(strategic-number sn-cavalry-threat == 0)
(strategic-number sn-current-age >= ci-transit)
)
(dropsite-min-distance stone <= 6)
(unit-type-count villager > 60)
=>
(set-strategic-number sn-food-gatherer-percentage 33)
(set-strategic-number sn-wood-gatherer-percentage 26)
(set-strategic-number sn-gold-gatherer-percentage 38)
(set-strategic-number sn-stone-gatherer-percentage 3)
)
(defrule
(goal strategy-goal rush)
(goal unit-goal eagle-warrior)
(strategic-number sn-cavalry-threat == 0)
(strategic-number sn-current-age == ci-transit)
(building-type-count town-center == 3)
=>
(set-strategic-number sn-food-gatherer-percentage 41)
(set-strategic-number sn-wood-gatherer-percentage 26)
(set-strategic-number sn-gold-gatherer-percentage 30)
(set-strategic-number sn-stone-gatherer-percentage 3)
)
#load-if-not-defined AZTEC-CIV
(defrule
(goal strategy-goal rush)
(goal unit-goal mix)
(building-type-count-total town-center < 3)
(stone-amount != 100)
(stone-amount != 200)
(dropsite-min-distance stone < 5)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 36)
(set-strategic-number sn-wood-gatherer-percentage 36)
(set-strategic-number sn-gold-gatherer-percentage 25)
(set-strategic-number sn-stone-gatherer-percentage 3)
)
#else
(defrule
(goal strategy-goal boom)
(goal unit-goal eagle-warrior)
(building-type-count-total town-center >= tc-level-three)
(dropsite-min-distance stone < 5)
=>
(set-strategic-number sn-food-gatherer-percentage 35)
(set-strategic-number sn-wood-gatherer-percentage 47)
(set-strategic-number sn-gold-gatherer-percentage 14)
(set-strategic-number sn-stone-gatherer-percentage 4)
)
(defrule
(goal strategy-goal rush)
(goal unit-goal mix)
(building-type-count-total town-center < 3)
(stone-amount != 100)
(stone-amount != 200)
(dropsite-min-distance stone < 5)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 30)
(set-strategic-number sn-wood-gatherer-percentage 34)
(set-strategic-number sn-gold-gatherer-percentage 29)
(set-strategic-number sn-stone-gatherer-percentage 7)
)
(defrule
(goal unit-goal militiaman-line)
(strategic-number sn-current-age >= ci-transit)
(game-time < 2400)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 46)
(set-strategic-number sn-wood-gatherer-percentage 33)
(set-strategic-number sn-gold-gatherer-percentage 19)
(set-strategic-number sn-stone-gatherer-percentage 2)
)
#end-if
#load-if-not-defined AZTEC-CIV
#load-if-not-defined FRANKISH-CIV
#load-if-not-defined GOTHIC-CIV
#load-if-not-defined HUN-CIV
#load-if-not-defined ITALIAN-CIV
#load-if-not-defined MAYAN-CIV
#load-if-not-defined SARACEN-CIV
(defrule
(not (goal unit-goal my-unique-unit-line))
(goal control-goal my-unique-unit-line)
(strategic-number sn-current-age >= ci-transit)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage ci-uu-switch-food)
(set-strategic-number sn-wood-gatherer-percentage ci-uu-switch-wood)
(set-strategic-number sn-gold-gatherer-percentage ci-uu-switch-gold)
(set-strategic-number sn-stone-gatherer-percentage ci-uu-switch-stone)
)
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#load-if-not-defined BYZANTINE-CIV
#load-if-not-defined CELTIC-CIV
#load-if-not-defined KOREAN-CIV
#load-if-not-defined SLAVIC-CIV
(defrule
(building-type-count-total town-center >= tc-level-three)
(dropsite-min-distance stone <= 4)
(nor (goal unit-goal archer)
(goal unit-goal knight))
(goal control-goal my-unique-unit-line)
(strategic-number sn-current-age == castle)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 41)
(set-strategic-number sn-wood-gatherer-percentage 27)
(set-strategic-number sn-gold-gatherer-percentage 18)
(set-strategic-number sn-stone-gatherer-percentage 14)
)
#else
(defrule
(building-type-count-total town-center >= tc-level-three)
(dropsite-min-distance stone <= 4)
(goal unit-goal scorpion)
(goal control-goal my-unique-unit-line)
(building-type-count-total castle >= 0)
(unit-type-count villager > 20)
(strategic-number sn-current-age >= castle)
=>
(set-strategic-number sn-food-gatherer-percentage 34)
(set-strategic-number sn-wood-gatherer-percentage 33)
(set-strategic-number sn-gold-gatherer-percentage 27)
(set-strategic-number sn-stone-gatherer-percentage 6)
)
#end-if ;SLAVIC-CIV
#else
(defrule
(building-type-count-total town-center >= tc-level-three)
(dropsite-min-distance stone <= 4)
(goal control-goal my-unique-unit-line)
(or
(strategic-number sn-current-age == castle)
(building-type-count-total castle == 0)
)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 37)
(set-strategic-number sn-wood-gatherer-percentage 39)
(set-strategic-number sn-gold-gatherer-percentage 16)
(set-strategic-number sn-stone-gatherer-percentage 10)
)
#end-if ;KOREAN-CIV
#else
(defrule
(building-type-count-total town-center >= tc-level-three)
(dropsite-min-distance stone <= 4)
(goal control-goal my-unique-unit-line)
(strategic-number sn-current-age == castle)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 36)
(set-strategic-number sn-wood-gatherer-percentage 39)
(set-strategic-number sn-gold-gatherer-percentage 12)
(set-strategic-number sn-stone-gatherer-percentage 13)
)
#end-if ;CELTIC-CIV
#else
(defrule
(building-type-count-total town-center >= tc-level-three)
(dropsite-min-distance stone <= 4)
(goal control-goal my-unique-unit-line)
(strategic-number sn-current-age == castle)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 35)
(set-strategic-number sn-wood-gatherer-percentage 37)
(set-strategic-number sn-gold-gatherer-percentage 13)
(set-strategic-number sn-stone-gatherer-percentage 15)
)
(defrule
(building-type-count-total town-center >= tc-level-three)
(dropsite-min-distance stone <= 4)
(goal control-goal my-unique-unit-line)
(strategic-number sn-current-age == castle)
(goal enemy-goal skirmisher)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 39)
(set-strategic-number sn-wood-gatherer-percentage 41)
(set-strategic-number sn-gold-gatherer-percentage 5)
(set-strategic-number sn-stone-gatherer-percentage 15)
)
(defrule
(goal position-point pocket)
(building-type-count stone-wall-line > 5)
(building-type-count-total town-center >= tc-level-three)
(dropsite-min-distance stone <= 4)
(goal control-goal my-unique-unit-line)
(strategic-number sn-current-age == castle)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 39)
(set-strategic-number sn-wood-gatherer-percentage 41)
(set-strategic-number sn-gold-gatherer-percentage 12)
(set-strategic-number sn-stone-gatherer-percentage 8)
)
#end-if ;BYZANTINE-CIV
#load-if-not-defined KOREAN-CIV
(defrule
(strategic-number sn-current-age == castle)
(building-type-count-total castle == 1)
(goal unit-goal my-unique-unit-line)
(unit-type-count villager > 20)
(nand
(wood-amount > 300)
(stone-amount < 100)
)
=>
(set-strategic-number sn-food-gatherer-percentage 30)
(set-strategic-number sn-wood-gatherer-percentage 45)
(set-strategic-number sn-gold-gatherer-percentage 18)
(set-strategic-number sn-stone-gatherer-percentage 7)
)
(defrule
(strategic-number sn-current-age == castle)
(building-type-count-total town-center >= tc-level-three);3
(building-type-count-total castle == 1)
(goal unit-goal my-unique-unit-line)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 31)
(set-strategic-number sn-wood-gatherer-percentage 37)
(set-strategic-number sn-gold-gatherer-percentage 24)
(set-strategic-number sn-stone-gatherer-percentage 8)
)
#else
(defrule
(strategic-number sn-current-age == castle)
(building-type-count-total castle == 1)
(goal unit-goal my-unique-unit-line)
(unit-type-count villager > 20)
(nand
(wood-amount > 300)
(stone-amount < 100)
)
=>
(set-strategic-number sn-food-gatherer-percentage 31)
(set-strategic-number sn-wood-gatherer-percentage 52)
(set-strategic-number sn-gold-gatherer-percentage 13)
(set-strategic-number sn-stone-gatherer-percentage 4)
)
#end-if
(defrule
(building-type-count-total castle == 1)
(goal control-goal shot)
(goal unit-goal my-unique-unit-line)
=>
(set-strategic-number sn-food-gatherer-percentage 45)
(set-strategic-number sn-wood-gatherer-percentage 20)
(set-strategic-number sn-gold-gatherer-percentage 20)
(set-strategic-number sn-stone-gatherer-percentage 13)
)
#load-if-not-defined BRITON-CIV
#load-if-not-defined CHINESE-CIV
#load-if-not-defined KOREAN-CIV
#load-if-not-defined MAYAN-CIV
#load-if-not-defined MONGOL-CIV
(defrule
(strategic-number sn-current-age == feudal)
(goal unit-goal my-unique-unit-line)
(goal strategy-goal boom)
(dropsite-min-distance stone < 6)
(stone-amount < 600)
=>
(set-strategic-number sn-food-gatherer-percentage 40)
(set-strategic-number sn-wood-gatherer-percentage 30)
(set-strategic-number sn-gold-gatherer-percentage 15)
(set-strategic-number sn-stone-gatherer-percentage 15)
)
#load-if-not-defined TEUTONIC-CIV
(defrule
(strategic-number sn-current-age == castle)
(building-type-count-total town-center >= tc-level-two)
(building-type-count-total castle >= 1)
(goal unit-goal my-unique-unit-line)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 50)
(set-strategic-number sn-wood-gatherer-percentage 30)
(set-strategic-number sn-gold-gatherer-percentage 17)
(set-strategic-number sn-stone-gatherer-percentage 3)
)
(defrule
(strategic-number sn-current-age == castle)
(building-type-count-total town-center >= tc-level-two)
(building-type-count-total castle >= 1)
(goal unit-goal my-unique-unit-line)
(unit-type-count villager > 20)
(current-age-time > 420)
=>
(set-strategic-number sn-food-gatherer-percentage 48)
(set-strategic-number sn-wood-gatherer-percentage 34)
(set-strategic-number sn-gold-gatherer-percentage 15)
(set-strategic-number sn-stone-gatherer-percentage 3)
)
#load-if-defined SLAVIC-CIV
(defrule
(strategic-number sn-current-age == castle)
(building-type-count-total town-center >= tc-level-two)
(goal unit-goal my-unique-unit-line)
(unit-type-count villager > 100)
=>
(set-strategic-number sn-food-gatherer-percentage 42)
(set-strategic-number sn-wood-gatherer-percentage 34)
(set-strategic-number sn-gold-gatherer-percentage 21)
(set-strategic-number sn-stone-gatherer-percentage 3)
)
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#else
(defrule
(strategic-number sn-current-age == castle)
(building-type-count-total town-center >= tc-level-five)
(unit-type-count villager > 20)
(civilian-population < max-civ)
=>
(set-strategic-number sn-food-gatherer-percentage 45)
(set-strategic-number sn-wood-gatherer-percentage 35)
(set-strategic-number sn-gold-gatherer-percentage 16)
(set-strategic-number sn-stone-gatherer-percentage 4)
)
#end-if
(defrule
(goal unit-goal my-unique-unit-line)
(building-type-count-total castle > 1)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage uu-food2)
(set-strategic-number sn-wood-gatherer-percentage uu-wood2)
(set-strategic-number sn-gold-gatherer-percentage uu-gold2)
(set-strategic-number sn-stone-gatherer-percentage uu-stone2)
)
#load-if-defined CELTIC-CIV
(defrule
(or
(up-research-status c: my-unique-unit-upgrade >= research-pending)
(up-research-status c: ri-champion >= research-pending)
)
(up-research-status c: ri-halberdier >= research-pending)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 36)
(set-strategic-number sn-wood-gatherer-percentage 40)
(set-strategic-number sn-gold-gatherer-percentage 20)
(set-strategic-number sn-stone-gatherer-percentage 4)
)
#end-if
(defrule
(current-age == castle-age)
(goal unit-goal my-unique-unit-line)
(building-type-count-total castle > 1)
(unit-type-count villager > 20)
(or
(or
(civ-selected byzantine)
(civ-selected spanish)
)
(or
(civ-selected japanese)
(civ-selected gothic)
)
)
=>
(set-strategic-number sn-food-gatherer-percentage 45)
(set-strategic-number sn-wood-gatherer-percentage 27)
(set-strategic-number sn-gold-gatherer-percentage 25)
(set-strategic-number sn-stone-gatherer-percentage 3)
)
#load-if-defined BYZANTINE-CIV
(defrule
(not (goal strategy-goal boom))
(goal uu-up-goal 1)
(goal unit-goal my-unique-unit-line)
(building-type-count-total castle > 1)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 44)
(set-strategic-number sn-wood-gatherer-percentage 28)
(set-strategic-number sn-gold-gatherer-percentage 25)
(set-strategic-number sn-stone-gatherer-percentage 3)
)
(defrule
(goal strategy-goal boom)
(strategic-number sn-current-age == ci-transit)
(goal unit-goal my-unique-unit-line)
(building-type-count-total castle > 1)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 24)
(set-strategic-number sn-wood-gatherer-percentage 48)
(set-strategic-number sn-gold-gatherer-percentage 25)
(set-strategic-number sn-stone-gatherer-percentage 3)
)
#end-if
#load-if-not-defined TEUTONIC-CIV
#load-if-not-defined HUN-CIV
(defrule
(goal unit-goal knight)
(strategic-number sn-current-age == castle)
(dropsite-min-distance stone <= 6)
(or
(building-type-count-total town-center >= tc-level-three)
(stone-amount < 100)
)
(not (goal control-goal my-unique-unit-line))
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 44)
(set-strategic-number sn-wood-gatherer-percentage 33)
(set-strategic-number sn-gold-gatherer-percentage 19)
(set-strategic-number sn-stone-gatherer-percentage 4)
)
(defrule
(goal strategy-goal rush)
(goal unit-goal knight)
(strategic-number sn-current-age == castle)
(building-type-count-total town-center == 2)
(unit-type-count-total 970 > 2); monk
(unit-type-count villager > 20)
(stone-amount >= 100)
(nor
(goal enemy-goal eagle-warrior)
(civ-selected viking)
)
(goal anti-cavalry-threat-goal 0)
=>
(set-strategic-number sn-food-gatherer-percentage 47)
(set-strategic-number sn-wood-gatherer-percentage 36)
(set-strategic-number sn-gold-gatherer-percentage 17)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
(defrule
(goal unit-goal knight)
(strategic-number sn-current-age == castle)
(dropsite-min-distance stone <= 6)
(building-type-count-total town-center >= tc-level-three)
(up-research-status c: ri-crossbow < research-pending)
(goal control-goal my-unique-unit-line)
(unit-type-count villager > 20)
(civilian-population < 100)
=>
(set-strategic-number sn-food-gatherer-percentage 48)
(set-strategic-number sn-wood-gatherer-percentage 34)
(set-strategic-number sn-gold-gatherer-percentage 16)
(set-strategic-number sn-stone-gatherer-percentage 2)
)
(defrule
(goal strategy-goal boom)
(goal unit-goal knight)
(strategic-number sn-current-age == castle)
(dropsite-min-distance stone <= 6)
(building-type-count-total town-center >= tc-level-three)
(building-type-count-total town-center < tc-level-five)
(unit-type-count villager > 20)
(civilian-population < 100)
=>
(set-strategic-number sn-food-gatherer-percentage 47)
(set-strategic-number sn-wood-gatherer-percentage 39)
(set-strategic-number sn-gold-gatherer-percentage 12)
(set-strategic-number sn-stone-gatherer-percentage 2)
)
#load-if-defined UP-2-PLAYER-GAME
(defrule
(goal unit-goal knight)
(strategic-number sn-current-age == castle)
(or
(building-type-count-total town-center >= tc-level-three)
(goal strategy-goal flush)
)
(not (goal control-goal my-unique-unit-line))
(unit-type-count villager > 20)
(strategic-number sn-military-level < 0)
(current-age-time < 600)
=>
(set-strategic-number sn-food-gatherer-percentage 46)
(set-strategic-number sn-wood-gatherer-percentage 35)
(set-strategic-number sn-gold-gatherer-percentage 19)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
(defrule
(goal unit-goal knight)
(strategic-number sn-current-age == castle)
(goal strategy-goal flush)
(stone-amount < 100)
(building-type-count-total town-center < tc-level-three)
(not (goal control-goal my-unique-unit-line))
(unit-type-count villager > 20)
(current-age-time < 600)
=>
(set-strategic-number sn-food-gatherer-percentage 44)
(set-strategic-number sn-wood-gatherer-percentage 35)
(set-strategic-number sn-gold-gatherer-percentage 18)
(set-strategic-number sn-stone-gatherer-percentage 3)
)
(defrule
(goal unit-goal knight)
(strategic-number sn-current-age == castle)
(civilian-population >= max-civ)
(not (goal control-goal my-unique-unit-line))
=>
(set-strategic-number sn-food-gatherer-percentage 41)
(set-strategic-number sn-wood-gatherer-percentage 30)
(set-strategic-number sn-gold-gatherer-percentage 26)
(set-strategic-number sn-stone-gatherer-percentage 3)
)
#else
#load-if-not-defined UP-POCKET-POSITION
(defrule
(goal unit-goal knight)
(strategic-number sn-current-age == castle)
(unit-type-count-total villager > 100)
(not (goal control-goal my-unique-unit-line))
=>
(set-strategic-number sn-food-gatherer-percentage 44)
(set-strategic-number sn-wood-gatherer-percentage 26)
(set-strategic-number sn-gold-gatherer-percentage 28)
(set-strategic-number sn-stone-gatherer-percentage 2)
)
#else
(defrule
(goal unit-goal knight)
(strategic-number sn-current-age == castle)
(unit-type-count-total villager > 100)
(research-available imperial-age)
(not (goal control-goal my-unique-unit-line))
=>
(set-strategic-number sn-food-gatherer-percentage 40)
(set-strategic-number sn-wood-gatherer-percentage 24)
(set-strategic-number sn-gold-gatherer-percentage 34)
(set-strategic-number sn-stone-gatherer-percentage 2)
)
#end-if
#end-if
(defrule
(or
(game-time > 2400)
(strategic-number sn-current-age >= ci-transit)
)
(goal unit-goal knight)
(up-compare-goal ranged-unit-type-goal != cavalry-archer)
(up-compare-goal control-goal != my-unique-unit-line)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 41)
(set-strategic-number sn-wood-gatherer-percentage 27)
(set-strategic-number sn-gold-gatherer-percentage 30)
(set-strategic-number sn-stone-gatherer-percentage 2)
)
#else
(defrule
(goal unit-goal knight)
(strategic-number sn-current-age == castle)
(dropsite-min-distance stone <= 6)
(stone-amount < 100)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 44)
(set-strategic-number sn-wood-gatherer-percentage 32)
(set-strategic-number sn-gold-gatherer-percentage 20)
(set-strategic-number sn-stone-gatherer-percentage 4)
)
#end-if
#else
(defrule
(goal strategy-goal boom)
(building-type-count-total town-center >= tc-level-two)
(building-type-count-total castle > 0)
(goal unit-goal my-unique-unit-line)
=>
(set-strategic-number sn-food-gatherer-percentage 53)
(set-strategic-number sn-wood-gatherer-percentage 24)
(set-strategic-number sn-gold-gatherer-percentage 20)
(set-strategic-number sn-stone-gatherer-percentage 3)
)
(defrule
(or
(building-type-count-total town-center == tc-level-three)
(stone-amount < 100)
)
(dropsite-min-distance stone <= 4)
(strategic-number sn-current-age == castle)
(unit-type-count villager > 20)
(strategic-number sn-stone-gatherer-percentage < 10); if we started gathering stone don't stop or keep retasking
=>
(set-strategic-number sn-food-gatherer-percentage 50)
(set-strategic-number sn-wood-gatherer-percentage 27)
(set-strategic-number sn-gold-gatherer-percentage 20)
(set-strategic-number sn-stone-gatherer-percentage 3)
)
(defrule
(building-type-count-total town-center == tc-level-three)
(building-type-count-total barracks > 1)
(up-research-status c: ri-pikeman >= research-pending)
(dropsite-min-distance stone <= 4)
(strategic-number sn-current-age == castle)
(unit-type-count villager > 20)
(strategic-number sn-stone-gatherer-percentage < 10)
=>
(set-strategic-number sn-food-gatherer-percentage 50)
(set-strategic-number sn-wood-gatherer-percentage 32)
(set-strategic-number sn-gold-gatherer-percentage 15)
(set-strategic-number sn-stone-gatherer-percentage 3)
)
(defrule
(building-type-count-total town-center >= tc-level-four)
(dropsite-min-distance stone <= 4)
(strategic-number sn-current-age == castle)
(unit-type-count villager > 20)
(strategic-number sn-stone-gatherer-percentage < 10)
=>
(set-strategic-number sn-food-gatherer-percentage 48)
(set-strategic-number sn-wood-gatherer-percentage 27)
(set-strategic-number sn-gold-gatherer-percentage 23)
(set-strategic-number sn-stone-gatherer-percentage 2)
)
(defrule
(dropsite-min-distance stone <= 4)
(strategic-number sn-current-age >= castle)
(or
(building-type-count-total castle > 0)
(strategic-number sn-stone-gatherer-percentage < 10)
)
(civilian-population >= max-civ-pop)
=>
(set-strategic-number sn-food-gatherer-percentage 40)
(set-strategic-number sn-wood-gatherer-percentage 30)
(set-strategic-number sn-gold-gatherer-percentage 28)
(set-strategic-number sn-stone-gatherer-percentage 2)
)
(defrule
(building-type-count-total town-center >= tc-level-three)
(dropsite-min-distance stone <= 4)
(strategic-number sn-archer-threat < 3)
(goal anti-cavalry-threat-goal 1)
(up-research-status c: ri-heavy-scorpion < research-pending)
(unit-type-count villager > 20)
(goal unit-goal knight)
(nand
(goal strategy-goal boom); better boom as pocket and go hscorps later
(goal position-goal pocket)
)
=>
(set-strategic-number sn-food-gatherer-percentage 44)
(set-strategic-number sn-wood-gatherer-percentage 25)
(set-strategic-number sn-gold-gatherer-percentage 21)
(set-strategic-number sn-stone-gatherer-percentage 10)
)
#end-if ;teutonic civ
(defrule
(goal strategy-goal rush)
(goal unit-goal cavalry-archer)
(goal control-goal aggressive-rush)
(strategic-number sn-current-age == castle)
(unit-type-count villager > 20)
(building-type-count-total stable < 2)
(building-type-count-total archery-range > 3)
(strategic-number sn-cavalry-threat < 2)
=>
(set-strategic-number sn-food-gatherer-percentage 24)
(set-strategic-number sn-wood-gatherer-percentage 38)
(set-strategic-number sn-gold-gatherer-percentage 38)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
(defrule
(goal strategy-goal rush)
(goal unit-goal cavalry-archer)
(goal control-goal aggressive-rush)
(strategic-number sn-current-age == castle)
(unit-type-count villager > 20)
(building-type-count-total stable < 2)
(building-type-count-total archery-range > 3)
(or
(strategic-number sn-cavalry-threat > 1)
(up-research-status c: ri-elite-skirmisher >= research-pending)
)
=>
(set-strategic-number sn-food-gatherer-percentage 38)
(set-strategic-number sn-wood-gatherer-percentage 38)
(set-strategic-number sn-gold-gatherer-percentage 24)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
#load-if-defined UP-2-PLAYER-GAME
#load-if-not-defined TEUTONIC-CIV
(defrule
(goal unit-goal knight)
(strategic-number sn-current-age == castle)
(game-time < 1800)
(unit-type-count villager > 20)
(goal monk-threat-goal 1)
=>
(set-strategic-number sn-food-gatherer-percentage 58); too much food actually, but we want early light cavalry
(set-strategic-number sn-wood-gatherer-percentage 30)
(set-strategic-number sn-gold-gatherer-percentage 12)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
#end-if
(defrule
(strategic-number sn-current-age == castle)
(goal strategy-goal boom)
(goal unit-goal knight)
(unit-type-count villager > 20)
(or
(strategic-number sn-archer-threat > 0)
(building-type-count-total stone-wall-line > 10)
)
(building-type-count-total siege-workshop == 0); get a siege work shop early in arena
(unit-type-count 980 == 0); still no stone gatherers, so keep percentage from castle transit
=>
(set-strategic-number sn-food-gatherer-percentage 42)
(set-strategic-number sn-wood-gatherer-percentage 48)
(set-strategic-number sn-gold-gatherer-percentage 10)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
#end-if
(defrule
(goal unit-goal cavalry-archer)
(strategic-number sn-current-age == castle)
(dropsite-min-distance stone <= 6)
(or
(building-type-count-total town-center >= tc-level-three)
(stone-amount < 100)
)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 42)
(set-strategic-number sn-wood-gatherer-percentage 34)
(set-strategic-number sn-gold-gatherer-percentage 20)
(set-strategic-number sn-stone-gatherer-percentage 4)
)
(defrule
(goal unit-goal cavalry-archer)
(strategic-number sn-current-age == castle)
(building-type-count stable > 1)
(dropsite-min-distance stone <= 6)
(or
(building-type-count-total town-center >= tc-level-three)
(stone-amount < 100)
)
(goal enemy-goal eagle-warrior)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 47)
(set-strategic-number sn-wood-gatherer-percentage 27)
(set-strategic-number sn-gold-gatherer-percentage 24)
(set-strategic-number sn-stone-gatherer-percentage 2)
)
(defrule
(goal unit-goal cavalry-archer)
(unit-type-count villager > 95)
=>
(set-strategic-number sn-food-gatherer-percentage 36)
(set-strategic-number sn-wood-gatherer-percentage 32)
(set-strategic-number sn-gold-gatherer-percentage 29)
(set-strategic-number sn-stone-gatherer-percentage 3)
)
(defrule
(goal unit-goal cavalry-archer)
(unit-type-count villager > 95)
(building-type-count-total castle > 0)
=>
(set-strategic-number sn-food-gatherer-percentage 38)
(set-strategic-number sn-wood-gatherer-percentage 33)
(set-strategic-number sn-gold-gatherer-percentage 29)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
#load-if-defined TURKISH-CIV
(defrule
(unit-type-count villager > 95)
=>
(set-strategic-number sn-food-gatherer-percentage 44)
(set-strategic-number sn-wood-gatherer-percentage 26)
(set-strategic-number sn-gold-gatherer-percentage 28)
(set-strategic-number sn-stone-gatherer-percentage 2)
)
#end-if
(defrule
(strategic-number sn-current-age >= ci-transit)
(goal control-goal shot)
(building-type-count-total town-center >= tc-level-three)
(dropsite-min-distance stone <= 6)
(unit-type-count villager > 20)
(building-type-count-total castle == 0)
(or
(goal unit-goal knight)
(up-research-status c: ri-elite-eagle-warrior >= research-pending)
)
=>
(set-strategic-number sn-food-gatherer-percentage 35)
(set-strategic-number sn-wood-gatherer-percentage 35)
(set-strategic-number sn-gold-gatherer-percentage 25)
(set-strategic-number sn-stone-gatherer-percentage 5)
)
#load-if-defined SPANISH-CIV
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
(strategic-number sn-current-age == feudal)
(goal strategy-goal flush)
(gold-amount > 170)
(building-type-count blacksmith > 0)
=>
(set-strategic-number sn-food-modifier-percentage 4)
(set-strategic-number sn-wood-modifier-percentage 3)
(set-strategic-number sn-gold-modifier-percentage -7); don't go for archers with the spanish
)
#end-if
(defrule
(strategic-number sn-current-age == feudal)
(goal strategy-goal sling)
(or
(players-civ any-ally aztec)
(or
(players-civ any-ally mayan)
(players-civ any-ally slavic)
)
)
(players-current-age any-ally == imperial-age)
(players-building-type-count every-ally castle < 1)
=>
(set-strategic-number sn-food-modifier-percentage -7)
(set-strategic-number sn-stone-modifier-percentage 7)
)
(defrule
(current-age == castle-age)
(research-available imperial-age)
(food-amount >= 700)
(gold-amount < 200)
=>
(set-strategic-number sn-food-modifier-percentage -7)
(set-strategic-number sn-gold-modifier-percentage 7)
)
(defrule
(current-age >= castle-age)
(unit-type-count villager > 85)
(unit-type-count fishing-ship > 4)
(food-amount > 600)
(wood-amount < 200)
=>
(set-strategic-number sn-food-modifier-percentage -5)
(set-strategic-number sn-wood-modifier-percentage 5)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(players-building-type-count any-enemy watch-tower > 4)
(game-time < 1800)
(current-age >= castle-age)
(strategic-number sn-gold-gatherer-percentage > 19)
(not (player-in-game any-ally))
=>
(set-strategic-number sn-wood-modifier-percentage 10)
(set-strategic-number sn-gold-modifier-percentage -10)
)
(defrule
(strategic-number sn-current-age >= ci-transit)
(building-type-count-total castle == 0)
(or
(or
(goal enemy-fortifications-goal 1)
(players-building-type-count any-enemy castle > 0)
)
(or
(population-cap < 100)
(civ-selected magyar)
)
)
(strategic-number sn-stone-gatherer-percentage == 0)
=>
(set-strategic-number sn-food-modifier-percentage -3)
(set-strategic-number sn-wood-modifier-percentage -3)
(set-strategic-number sn-stone-modifier-percentage 6)
)
(defrule
(building-type-count-total town-center < 2)
(building-type-count-total dock > 0)
(strategic-number sn-minimum-water-body-size-for-dock == water-mixed)
(strategic-number sn-current-age == castle)
(stone-amount > 100)
(not(goal unit-goal my-unique-unit-line))
=>
(set-strategic-number sn-food-gatherer-percentage 30)
(set-strategic-number sn-wood-gatherer-percentage 48)
(set-strategic-number sn-gold-gatherer-percentage 22)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
(defrule
(or
(not (research-available imperial-age))
(stone-amount < 100)
)
(not(goal unit-goal my-unique-unit-line))
(building-type-count-total dock > 0)
(strategic-number sn-minimum-water-body-size-for-dock == water-mixed)
(strategic-number sn-current-age == castle)
(dropsite-min-distance stone < 6)
=>
(set-strategic-number sn-food-gatherer-percentage 30)
(set-strategic-number sn-wood-gatherer-percentage 47)
(set-strategic-number sn-gold-gatherer-percentage 20)
(set-strategic-number sn-stone-gatherer-percentage 3)
)
(defrule
(or
(strategic-number sn-current-age == df-transit)
(and
(strategic-number sn-current-age == feudal)
(not (civ-selected viking))
)
)
(up-compare-goal strategy-goal != boom)
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
=>
(set-strategic-number sn-food-gatherer-percentage 57)
(set-strategic-number sn-wood-gatherer-percentage 43)
(set-strategic-number sn-gold-gatherer-percentage 0)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
(defrule
(strategic-number sn-current-age == feudal)
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
(or
(civ-selected viking)
(goal strategy-goal flush)
)
=>
(set-strategic-number sn-food-gatherer-percentage 30)
(set-strategic-number sn-wood-gatherer-percentage 50)
(set-strategic-number sn-gold-gatherer-percentage 20)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
(defrule
(current-age < imperial-age)
(strategic-number sn-current-age >= fc-transit)
(or
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
(and
(building-type-count dock > 1)
(current-age-time < 420)
)
)
(nand
(goal unit-goal my-unique-unit-line)
(building-type-count castle == 0)
)
=>
(set-strategic-number sn-food-gatherer-percentage 20)
(set-strategic-number sn-wood-gatherer-percentage 60)
(set-strategic-number sn-gold-gatherer-percentage 20)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
(defrule
(current-age < imperial-age)
(strategic-number sn-current-age >= fc-transit)
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
(unit-type-count fishing-ship > 11)
=>
(set-strategic-number sn-food-gatherer-percentage 0)
(set-strategic-number sn-wood-gatherer-percentage 67)
(set-strategic-number sn-gold-gatherer-percentage 33)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
(defrule
(current-age == castle-age)
(current-age-time > 180)
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
(civilian-population < 61)
(dropsite-min-distance stone <= 6)
=>
(set-strategic-number sn-food-gatherer-percentage 12)
(set-strategic-number sn-wood-gatherer-percentage 57)
(set-strategic-number sn-gold-gatherer-percentage 28)
(set-strategic-number sn-stone-gatherer-percentage 3)
)
(defrule
(civilian-population > 60)
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
(unit-type-count-total trade-cart > 10)
=>
(set-strategic-number sn-food-gatherer-percentage 18)
(set-strategic-number sn-wood-gatherer-percentage 53)
(set-strategic-number sn-gold-gatherer-percentage 26)
(set-strategic-number sn-stone-gatherer-percentage 3)
)
#load-if-not-defined VIKING-CIV
(defrule
(civilian-population > 60)
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
(unit-type-count-total trade-cart < 11)
=>
(set-strategic-number sn-food-gatherer-percentage 16)
(set-strategic-number sn-wood-gatherer-percentage 50)
(set-strategic-number sn-gold-gatherer-percentage 31)
(set-strategic-number sn-stone-gatherer-percentage 3)
)
#else
(defrule
(civilian-population > 60)
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
(unit-type-count-total trade-cart < 11)
=>
(set-strategic-number sn-food-gatherer-percentage 21)
(set-strategic-number sn-wood-gatherer-percentage 50)
(set-strategic-number sn-gold-gatherer-percentage 26)
(set-strategic-number sn-stone-gatherer-percentage 3)
)
#end-if
(defrule
(or
(strategic-number sn-current-age == df-transit)
(strategic-number current-age == feudal)
)
(goal strategy-goal flush)
(strategic-number sn-minimum-water-body-size-for-dock >= water-islands)
(or (cc-players-unit-type-count 0 shore-fish >= shorefishreq2); a bit
(cc-players-unit-type-count 0 sea-fish >= deepfishreq2)); a bit
(unit-type-count fishing-ship > 1)
=>
(up-modify-sn sn-food-gatherer-percentage c:- 6); provisory
(up-modify-sn sn-wood-gatherer-percentage c:+ 6)
)
#load-if-not-defined KOREAN-CIV
(defrule
(game-time >= 3600)
(unit-type-count female-gold-miner == 0); no gold miners
(unit-type-count male-gold-miner == 0)
(unit-type-count-total 229 == 0); no dead miners so enemy didn't kill them
(unit-type-count-total 221 == 0); so there's no gold available
=>
(set-strategic-number sn-food-gatherer-percentage 48)
(set-strategic-number sn-wood-gatherer-percentage 45)
(set-strategic-number sn-gold-gatherer-percentage 2)
(set-strategic-number sn-stone-gatherer-percentage 5)
)
(defrule
(game-time >= 3600)
(unit-type-count female-gold-miner == 0); no gold miners
(unit-type-count male-gold-miner == 0)
(unit-type-count-total 229 == 0); no dead miners so enemy didn't kill them
(unit-type-count-total 221 == 0); so there's no gold available
(or
(up-research-status c: ri-champion >= research-pending)
(and
(up-research-status c: ri-light-cavalry >= research-pending)
(up-research-status c: ri-bloodlines >= research-pending)
)
)
=>
(set-strategic-number sn-food-gatherer-percentage 55)
(set-strategic-number sn-wood-gatherer-percentage 38)
(set-strategic-number sn-gold-gatherer-percentage 2)
(set-strategic-number sn-stone-gatherer-percentage 5)
)
#end-if
#load-if-defined DEATH-MATCH
#load-if-not-defined CELTIC-CIV
(defrule
(civilian-population < max-civ)
(wood-amount > 1500)
=>
(set-strategic-number sn-wood-gatherer-percentage 0)
(set-strategic-number sn-food-gatherer-percentage 70)
(set-strategic-number sn-gold-gatherer-percentage 30)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
(defrule
(civilian-population < max-civ)
(wood-amount < 500)
=>
(set-strategic-number sn-wood-gatherer-percentage 25)
(set-strategic-number sn-food-gatherer-percentage 50)
(set-strategic-number sn-gold-gatherer-percentage 20)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
#end-if
#end-if
#load-if-defined SARACEN-CIV
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(commodity-buying-price food < 136)
(commodity-selling-price stone > 95)
(building-type-count market > 0)
(dropsite-min-distance stone < 6)
(goal unit-goal knight)
(game-time < 1800)
(building-type-count-total stable > 1)
=>
(set-strategic-number sn-food-gatherer-percentage 16)
(set-strategic-number sn-wood-gatherer-percentage 14)
(set-strategic-number sn-gold-gatherer-percentage 35)
(set-strategic-number sn-stone-gatherer-percentage 35)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(commodity-selling-price stone > 95)
(building-type-count market > 0)
(dropsite-min-distance stone < 6)
(goal strategy-goal rush)
(goal unit-goal archer)
(game-time < 1800)
(building-type-count-total archery-range > 2)
=>
(set-strategic-number sn-food-gatherer-percentage 10)
(set-strategic-number sn-wood-gatherer-percentage 30)
(set-strategic-number sn-gold-gatherer-percentage 30)
(set-strategic-number sn-stone-gatherer-percentage 30)
)
#end-if
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(goal strategy-goal rush)
(goal unit-goal monk)
(current-age == castle-age)
(commodity-selling-price stone < 105)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 28)
(set-strategic-number sn-wood-gatherer-percentage 28)
(set-strategic-number sn-gold-gatherer-percentage 44)
(set-strategic-number sn-stone-gatherer-percentage 0)
)
(defrule
(goal unit-goal monk)
(strategic-number sn-current-age >= ci-transit)
(building-type-count-total castle > 0)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 28)
(set-strategic-number sn-wood-gatherer-percentage 28)
(set-strategic-number sn-gold-gatherer-percentage 42)
(set-strategic-number sn-stone-gatherer-percentage 2)
)
(defrule
(goal unit-goal monk)
(strategic-number sn-current-age >= ci-transit)
(building-type-count-total castle == 0)
(unit-type-count villager > 20)
=>
(set-strategic-number sn-food-gatherer-percentage 20)
(set-strategic-number sn-wood-gatherer-percentage 27)
(set-strategic-number sn-gold-gatherer-percentage 40)
(set-strategic-number sn-stone-gatherer-percentage 13)
)
(defrule
(strategic-number sn-current-age == castle)
(goal unit-goal wonder)
=>
(set-goal train-civ-goal wonder)
(set-strategic-number sn-food-gatherer-percentage 25)
(set-strategic-number sn-wood-gatherer-percentage 20)
(set-strategic-number sn-gold-gatherer-percentage 45)
(set-strategic-number sn-stone-gatherer-percentage 10)
)
(defrule
(strategic-number sn-current-age >= ci-transit)
(goal unit-goal wonder)
=>
(set-strategic-number sn-food-gatherer-percentage 0)
(set-strategic-number sn-wood-gatherer-percentage 30)
(set-strategic-number sn-gold-gatherer-percentage 40)
(set-strategic-number sn-stone-gatherer-percentage 30)
(set-strategic-number sn-wood-dropsite-distance 3)
)
#load-if-defined DEFEND-WONDER
(defrule
(unit-type-count-total villager < twenty-five-percent-pop)
=>
(set-strategic-number sn-food-gatherer-percentage 60)
(set-strategic-number sn-wood-gatherer-percentage 33)
(set-strategic-number sn-gold-gatherer-percentage 5)
(set-strategic-number sn-stone-gatherer-percentage 3)
)
#load-if-not-defined INCAN-CIV
#load-if-not-defined INDIAN-CIV
#load-if-not-defined MAGYAR-CIV
#load-if-not-defined SLAVIC-CIV
#load-if-not-defined AZTEC-CIV
#load-if-not-defined CELTIC-CIV
#load-if-not-defined FRANKISH-CIV
#load-if-not-defined GOTHIC-CIV
#load-if-not-defined HUN-CIV
#load-if-not-defined JAPANESE-CIV
#load-if-not-defined PERSIAN-CIV
#load-if-not-defined SARACEN-CIV
#load-if-not-defined SPANISH-CIV
#load-if-not-defined TEUTONIC-CIV
#load-if-not-defined TURKISH-CIV
#load-if-not-defined VIKING-CIV
(defrule
(unit-type-count-total villager < twenty-five-percent-pop)
=>
(set-strategic-number sn-food-gatherer-percentage 40)
(set-strategic-number sn-wood-gatherer-percentage 50)
(set-strategic-number sn-gold-gatherer-percentage 8)
(set-strategic-number sn-stone-gatherer-percentage 3)
)
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#end-if
#load-if-defined POST-IMPERIAL-AGE-START
(defrule
(timer-triggered one-minute-timer)
(food-amount < 2500)
(or
(food-amount < 1500)
(unit-type-count-total villager < fourty-percent-pop)
)
(wood-amount > 1500)
=>
(set-strategic-number sn-food-gatherer-percentage 50)
(set-strategic-number sn-wood-gatherer-percentage 10)
(set-strategic-number sn-gold-gatherer-percentage 35)
(set-strategic-number sn-stone-gatherer-percentage 5)
)
(defrule
(timer-triggered one-minute-timer)
(food-amount < 1500)
(wood-amount < 1500)
(unit-type-count-total villager >= fourty-percent-pop)
=>
(set-strategic-number sn-food-gatherer-percentage pidm-food2)
(set-strategic-number sn-wood-gatherer-percentage pidm-wood2)
(set-strategic-number sn-gold-gatherer-percentage pidm-gold2)
(set-strategic-number sn-stone-gatherer-percentage pidm-stone2)
)
(defrule
(timer-triggered one-minute-timer)
(food-amount < 1500)
(wood-amount < 1500)
(unit-type-count-total villager < fourty-percent-pop)
=>
(set-strategic-number sn-food-gatherer-percentage 47)
(set-strategic-number sn-wood-gatherer-percentage 25)
(set-strategic-number sn-gold-gatherer-percentage 25)
(set-strategic-number sn-stone-gatherer-percentage 3)
)
(defrule
(timer-triggered one-minute-timer)
(food-amount > 1500)
(wood-amount < 1500)
=>
(set-strategic-number sn-food-gatherer-percentage 14)
(set-strategic-number sn-wood-gatherer-percentage 40)
(set-strategic-number sn-gold-gatherer-percentage 41)
(set-strategic-number sn-stone-gatherer-percentage 5)
)
(defrule
(timer-triggered one-minute-timer)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(food-amount > 1500)
(wood-amount > 1500)
=>
(set-strategic-number sn-food-gatherer-percentage pidm-food)
(set-strategic-number sn-wood-gatherer-percentage pidm-wood)
(set-strategic-number sn-gold-gatherer-percentage pidm-gold)
(set-strategic-number sn-stone-gatherer-percentage pidm-stone)
)
(defrule
(timer-triggered one-minute-timer)
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
(food-amount > 1500)
=>
(set-strategic-number sn-food-gatherer-percentage 0)
(set-strategic-number sn-wood-gatherer-percentage 55)
(set-strategic-number sn-gold-gatherer-percentage 40)
(set-strategic-number sn-stone-gatherer-percentage 5)
)
#end-if
; ********** ATTACK RULES **********
(defrule
(strategic-number sn-maximum-town-size < 42)
(enemy-buildings-in-town)
(up-compare-goal forward-threat-goal != 1)
=>
(set-strategic-number sn-maximum-hunt-drop-distance 0); disable hunting and prevent villagers to run into those towers
(set-goal forward-threat-goal 1)
(chat-to-player my-player-number "forward buildings detected")
)
(defrule
(strategic-number sn-maximum-town-size >= 38)
(not (enemy-buildings-in-town))
(goal forward-threat-goal 1)
=>
(set-goal forward-threat-goal -1)
(chat-to-player my-player-number "The forward threat has been eliminated")
)
; Retreat Rules
(defrule
(goal enemy-fortifications-goal -1)
(or
(players-building-type-count any-enemy castle > 3)
(and
(nand
(building-type-count stone-wall > 10); arena map
(unit-type-count battering-ram-line > 0)
)
(and
(players-building-type-count any-enemy castle > 0)
(players-building-type-count any-enemy stone-wall > 10)
)
)
)
=>
(set-goal enemy-fortifications-goal 1)
)
(defrule
(goal enemy-fortifications-goal 1)
(players-building-type-count every-enemy castle < 2)
(or
(players-building-type-count every-enemy stone-wall < 10)
(and
(building-type-count stone-wall > 10)
(unit-type-count battering-ram-line > 0)
)
)
=>
(set-goal enemy-fortifications-goal -1)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(game-time > 1080); not when rushing in DM
(unit-type-count trebuchet-set < 1)
(unit-type-count battering-ram-line == 0)
(cc-players-unit-type-count target-player castle-arrow > 0)
=>
(set-goal retreat-now-goal 1)
(set-goal attack-status-goal retreat)
(set-goal attack-goal 0)
(enable-timer attack-timer 60)
(set-goal reset 1); to avoid reset-spamming
(chat-to-player my-player-number "retreat out of castle fire")
)
(defrule
(current-age == feudal-age)
(goal threat-source-goal tower-class)
(cc-players-unit-type-count target-player watch-tower-arrow > 0)
=>
(chat-to-player my-player-number "retreat out of watch-tower")
(set-goal retreat-now-goal 1)
(set-goal attack-status-goal retreat)
(set-goal attack-goal 0)
(set-goal reset 1); to avoid reset-spamming
(enable-timer attack-timer 9)
)
(defrule
(goal threat-source-goal tower-class)
(cc-players-unit-type-count target-player watch-tower-arrow > 0)
(unit-type-count battering-ram-line == 0)
(unit-type-count trebuchet == 0)
(timer-triggered attack-timer)
(or (unit-type-count ranged-unit-class > 4)
(unit-type-count cavalry-archer-class > 4))
(unit-type-count knight-line < 6)
=>
(set-goal retreat-now-goal 1)
(set-goal attack-status-goal retreat)
(set-goal attack-goal 0)
(enable-timer attack-timer 9)
(set-goal reset 1); to avoid reset-spamming
(chat-to-player my-player-number "retreat out of tower fire")
)
(defrule
(current-age == feudal-age)
(or (cc-players-unit-type-count target-player tc-arrow > 0)
(and (cc-players-unit-type-count target-player castle-arrow > 0)
(goal threat-source-goal castle-arrow)))
=>
(set-goal retreat-now-goal 1)
(set-goal attack-status-goal retreat); always retreat out of TC fire when flushing
(set-goal attack-goal 0)
(set-goal reset 1); to avoid reset-spamming
(chat-to-player my-player-number "retreat out of TC fire")
(enable-timer attack-timer 9)
)
(defrule
(goal team-coordination-goal 1)
(game-time < 1800)
(goal unit-goal knight)
(goal threat-source-goal monastery-class)
(goal monk-threat-goal 1)
(nor (up-research-status c: ri-heresy >= research-pending)
(unit-type-count scout-cavalry-line > 3))
(strategic-number sn-military-level <= 0)
=>
(set-goal retreat-now-goal 1)
(set-goal attack-status-goal retreat)
(set-goal attack-goal 0)
(enable-timer attack-timer 60)
(chat-to-player my-player-number "retreat from monks")
)
(defrule
(current-age >= castle-age)
(population < seventy-five-percent-pop)
(or (strategic-number sn-military-level < 2)
(nor (goal threat-target-goal cavalry-unit-class)
(goal unit-goal eagle-warrior)))
(strategic-number sn-military-level < 3)
(cc-players-unit-type-count target-player tc-arrow > 0)
(unit-type-count battering-ram-line < 1)
(unit-type-count trebuchet-set < 1)
=>
(set-goal attack-goal 0)
(set-goal retreat-now-goal 1)
(enable-timer attack-timer 60)
(set-goal reset 1); to avoid reset-spamming
; (chat-to-player my-player-number "retreat out of TC fire as not enough military superiority")
)
(defrule
(current-age >= castle-age)
(population < eighty-five-percent-pop)
(unit-type-count battering-ram-line < 1)
(unit-type-count trebuchet-set < 1)
(or (cc-players-unit-type-count target-player castle-arrow > 0)
(cc-players-unit-type-count target-player castle-arrow-chemistry > 0))
(up-compare-goal threat-target-goal != siege-unit-class)
=>
(set-goal attack-goal 0)
(set-goal retreat-now-goal 1)
(enable-timer attack-timer 60)
(set-goal reset 1); to avoid reset-spamming
(chat-to-player my-player-number "retreat out of castle fire as not enough military superiority")
)
(defrule
(game-time > 600); not when rushing in PIDM
(goal attack-goal 0)
(unit-type-count trebuchet-set < 1)
(unit-type-count battering-ram-line == 0)
(cc-players-unit-type-count target-player tc-arrow > 0)
(players-military-population target-player > 5)
(up-compare-goal under-attack-goal != 1)
(timer-triggered attack-timer)
=>
(set-goal retreat-now-goal 1)
(enable-timer attack-timer 60)
(set-goal reset 1); to avoid reset-spamming
(chat-to-player my-player-number "retreat out of TC fire")
)
(defrule
(cc-players-unit-type-count target-player tc-arrow == 0)
(current-age == feudal-age)
(goal strategy-goal flush)
(timer-triggered retreat-timer); test
(goal retreat-now-goal 0); test
(goal reset 1); to avoid spamming
(strategic-number sn-military-level > 1)
=>
(up-reset-unit c: -1)
(set-goal reset 0)
(enable-timer attack-timer 3)
(chat-to-player my-player-number "reset as attackers are out of TC")
)
(defrule
(timer-triggered attack-timer)
(up-timer-status help-ally-timer == timer-running)
=>
(up-modify-sn sn-focus-player-number g:= closest-ally-goal)
)
(defrule
(timer-triggered attack-timer)
(up-timer-status help-ally-timer == timer-running)
(strategic-number sn-military-level >= -1)
(strategic-number sn-target-evaluation-ally-proximity == 1)
=>
(set-goal attack-goal 4)
)
(defrule
(true)
=>
(up-modify-sn sn-focus-player-number g:= closest-enemy-goal)
)
(defrule
(strategic-number sn-military-level < 3)
(goal enemy-goal flush)
(goal strategy-goal flush)
(military-population < 15)
(players-military-population target-player > 5)
=>
(up-jump-rule 1)
)
(defrule
(strategic-number sn-military-level >= 2); military superiority so
(or (strategic-number sn-current-age != fc-transit)
(strategic-number sn-military-level >= 3))
=>
(set-goal attack-goal 1); attack might be an idea, check other conditions
)
(defrule
(population > max-civ)
(strategic-number sn-military-level >= 2)
(current-age >= imperial-age)
(or (unit-type-count battering-ram-line >= 6)
(or (unit-type-count trebuchet-set >= 3)
(strategic-number sn-military-level >= 3)))
(players-current-age target-player <= castle-age)
(up-compare-goal attack-goal < 1)
=>
(set-goal attack-goal 1); attack might be an idea, check other conditions
; (chat-local-to-self "Attack now! They're still not in the imperial-age.")
)
(defrule
(population > max-civ)
(strategic-number sn-military-level >= 2)
(current-age >= castle-age)
(or (unit-type-count battering-ram-line >= 3)
(or (unit-type-count trebuchet-set >= 1)
(strategic-number sn-military-level >= 3)))
(players-current-age target-player <= feudal-age)
(up-compare-goal attack-goal < 1)
=>
(set-goal attack-goal 1); attack might be an idea, check other conditions
; (chat-local-to-self "Attack now! They're still not in the castle-age.")
)
(defrule
(population > max-civ)
(strategic-number sn-military-level >= 2)
(current-age >= feudal-age)
(or (unit-type-count battering-ram-line >= 1)
(or (unit-type-count trebuchet-set >= 1)
(strategic-number sn-military-level >= 3)))
(players-current-age target-player <= dark-age)
(up-compare-goal attack-goal < 1)
=>
(set-goal attack-goal 1); attack might be an idea, check other conditions
; (chat-local-to-self "Attack now! They're still not in the feudal-age.")
)
#load-if-not-defined DEATH-MATCH
(defrule
(strategic-number sn-military-level >= 1); more aggressive in team play
(unit-type-count cavalry-unit-class > 5)
(current-age >= castle-age)
(current-age-time >= 240)
(player-in-game any-ally)
=>
(set-goal attack-goal 1)
)
(defrule
(current-age == castle-age)
(military-population > 16)
(strategic-number sn-resource-control < 2)
(or
(strategic-number sn-military-level >= military-level-flush)
(and
(strategic-number sn-military-level >= military-level-flush-aggressive)
(current-age-time < 300)
)
)
(goal forward-threat-goal -1)
(strategic-number sn-cavalry-threat == 0)
(goal strategy-goal flush)
(up-research-status c: ri-bodkin-arrow >= research-pending)
(players-building-type-count focus-player castle == 0); not if enemy has a castle
=>
(set-goal attack-goal 1)
; (up-modify-sn sn-target-player-number g:= closest-enemy-goal)
)
(defrule
(unit-type-count ranged-unit-class > 19)
(strategic-number sn-military-level >= 0)
(players-current-age focus-player == feudal-age)
(goal strategy-goal rush)
(or
(goal control-goal aggressive-rush); xbow or ca with bodkin should beat feudal age stuff
(civ-selected briton)
)
(up-research-status c: ri-bodkin-arrow >= research-pending)
=>
(set-goal attack-goal 1)
; (up-modify-sn sn-target-player-number g:= closest-enemy-goal)
)
(defrule
(game-time < 1620)
(goal strategy-goal rush)
(goal unit-goal knight)
(or
(goal enemy-goal skirmisher)
(or
(strategic-number sn-archer-threat > 1)
(players-unit-type-count focus-player skirmisher-line > 7)
)
)
(or
(or
(up-research-status c: ri-chain-barding >= research-pending)
(civ-selected saracen)
)
(strategic-number sn-military-level >= 1)
)
(strategic-number sn-military-level >= 0)
(unit-type-count knight-line > 12)
=>
(set-goal attack-goal 1)
)
(defrule
(game-time < 1620)
(goal attack-goal 0)
(goal strategy-goal rush)
(goal unit-goal knight)
(up-research-status c: ri-bloodlines >= research-pending)
(or
(up-research-status c: ri-chain-barding >= research-pending)
(civ-selected saracen)
)
(food-amount < 60)
(gold-amount < 80)
(unit-type-count knight-line > 8)
(players-unit-type-count focus-player camel-line < 8)
(players-unit-type-count focus-player knight-line < 8)
(goal monk-threat-goal 0)
=>
(set-goal attack-goal 1)
; (up-modify-sn sn-target-player-number g:= closest-enemy-goal)
)
(defrule
(game-time < 1800)
(goal attack-goal 0)
(goal unit-goal eagle-warrior)
(or
(or
(goal anti-cavalry-threat-goal 1)
(players-unit-type-count focus-player skirmisher-line > 7)
)
(and
(players-current-age focus-player == feudal-age)
(players-unit-type-count focus-player militiaman-line < 1)
)
)
(strategic-number sn-military-level >= 0)
(unit-type-count eagle-warrior-line > 20)
=>
(set-goal attack-goal 1)
; (up-modify-sn sn-target-player-number g:= closest-enemy-goal)
)
(defrule
(game-time < 1680)
(goal attack-goal 0)
(goal strategy-goal flush)
(goal enemy-goal skirmisher); vs enemy that trys to stall flushes with tons of trash to keep military level high
(strategic-number sn-military-level >= 0)
(unit-type-count knight-line > 0)
(up-research-status c: ri-bodkin-arrow >= research-pending)
(players-building-type-count focus-player castle == 0); not in 1v1 if enemy has a castle
=>
(set-goal attack-goal 1)
; (up-modify-sn sn-target-player-number g:= closest-enemy-goal)
)
(defrule
(goal attack-goal 0)
(goal unit-goal monk)
(unit-type-count trebuchet-set > 0)
(up-research-status c: ri-block-printing != research-available)
(up-research-status c: ri-theocracy != research-available)
(up-research-status c: ri-illumination != research-available)
(current-age == imperial-age)
(unit-type-count monk > 20)
(goal anti-monk-threat-goal 0)
=>
(set-goal attack-goal 1)
; (up-modify-sn sn-target-player-number g:= closest-enemy-goal)
)
(defrule
(goal attack-goal 0)
(goal unit-goal scorpion)
(goal strategy-goal rush)
(unit-type-count battering-ram-line > 1)
(unit-type-count scorpion-line > 20)
(strategic-number sn-military-level >= 0)
=>
(set-goal attack-goal 1)
; (up-modify-sn sn-target-player-number g:= closest-enemy-goal)
)
(defrule
(goal attack-goal 0)
(players-military-population every-enemy < 3)
(or
; (and
(or
(unit-type-count scout-cavalry > 2)
(and
(goal strategy-goal flush)
(military-population > 8)
)
)
; (up-player-distance target-player < 70)
; )
(unit-type-count cavalry-unit-class > 3)
)
=>
(set-goal attack-goal 1)
)
(defrule
(goal attack-goal 0)
(players-building-count focus-player > 0)
(players-building-type-count focus-player watch-tower < 2)
(players-building-type-count focus-player castle == 0)
(players-military-population focus-player < 2)
(goal strategy-goal flush)
(military-population > 6)
=>
; (up-modify-sn sn-target-player-number g:= closest-enemy-goal)
(set-goal attack-goal 1)
)
(defrule
(building-type-count stable == 1)
(building-type-count town-center == 1)
(military-population >= 70)
(goal attack-goal 0)
(goal unit-goal cavalry-archer)
(up-research-status c: ri-thumb-ring >= research-pending)
(strategic-number sn-current-age >= castle);high military
(players-current-age focus-player == castle-age); while enemy is in castle-age
=>
(set-goal attack-goal 1)
; (up-modify-sn sn-target-player-number g:= closest-enemy-goal)
)
#end-if
(defrule
(goal attack-goal 0)
(population > max-civ-pop)
(strategic-number sn-current-age >= ci-transit); advancing to or already in imperial age with nearlyfull pop
(players-current-age every-enemy == castle-age); while enemy is in castle-age
(strategic-number sn-resource-control < 2)
(strategic-number sn-military-level >= 0)
(players-building-type-count focus-player castle < 2)
=>
(set-goal attack-goal 1); attack and try to hold him in castle age
)
(defrule
(goal strategy-goal flush)
(players-current-age focus-player == feudal-age)
(strategic-number sn-military-level >= 0)
(up-research-status c: ri-bodkin-arrow >= research-pending)
(or
(up-research-status c: ri-crossbow >= research-pending)
(up-compare-goal ranged-unit-type-goal != archer)
)
(or
(unit-type-count militiaman-line <= 6)
(up-research-status c: ri-long-swordsman >= research-pending)
)
=>
(set-goal attack-goal 1)
; (up-modify-sn sn-target-player-number g:= closest-enemy-goal)
)
(defrule
(goal strategy-goal flush)
(current-age == castle-age)
(players-current-age focus-player == feudal-age)
(strategic-number sn-military-level >= 0)
(nor (research-available ri-bodkin-arrow)
(research-available ri-crossbow))
(goal ranged-unit-type-goal archer)
(military-population > 40)
=>
(set-goal attack-goal 1)
; (up-modify-sn sn-target-player-number g:= closest-enemy-goal)
)
(defrule
(current-age-time > 240)
(current-age >= imperial-age)
(players-current-age target-player <= castle-age)
(strategic-number sn-military-level >= 1)
(military-population > 40)
=>
(set-goal attack-goal 1)
)
(defrule
(population >= max-pop)
(strategic-number sn-military-level >= 1)
(strategic-number sn-current-age >= imperial)
(current-age-time > 180)
(goal escrow-purpose-goal 0)
(or (research-completed ri-bracer)
(or (research-completed ri-plate-mail)
(or (research-completed ri-plate-barding)
(or (research-completed ri-blast-furnace)
(research-completed ri-ring-archer-armor)))))
=>
(set-goal attack-goal 1)
)
(defrule
(goal enemy-fortifications-goal 1)
(unit-type-count trebuchet-set < 1)
(unit-type-count battering-ram-line < 3)
=>
(set-goal attack-goal 0)
(chat-local-to-self "no attack vs enemy fortifications")
)
(defrule
(goal attack-goal 1)
(goal strategy-goal flush)
(current-age == feudal-age)
(or
(or
(and
(players-current-age focus-player == castle-age)
(players-military-population focus-player > 10)
)
(strategic-number sn-resource-control == 2)
)
(players-military-population focus-player > 16)
)
(strategic-number sn-military-level < 3)
=>
(set-goal attack-goal 0); better go castle age and attack then
)
(defrule
(goal attack-goal 1)
(goal strategy-goal flush)
(current-age == feudal-age)
(players-building-type-count focus-player watch-tower > 0)
(or
(strategic-number sn-military-level < 3)
(and
(players-military-population focus-player > 9)
(players-current-age focus-player >= castle-age)
)
)
=>
(set-goal attack-goal 0)
)
(defrule
(goal attack-goal 1)
(goal strategy-goal flush)
(current-age == feudal-age)
(not (goal unit-goal militiaman-line))
(goal enemy-goal eagle-warrior)
(players-military-population focus-player > 9)
=>
(set-goal attack-goal 0)
)
(defrule
(players-current-age focus-player > feudal-age)
(goal attack-goal 1)
(or (and (goal strategy-goal flush)
(current-age == feudal-age))
(and (or (goal unit-goal eagle-warrior)
(goal unit-goal archer))
(unit-type-count spearman-line < 10)))
(strategic-number sn-cavalry-threat >= 1); enemy cavalry found
(unit-type-count spearman-line < 5); no anti cavalry
(population < max-civ-pop); test
=>
(set-goal attack-goal 0)
)
(defrule
(goal attack-goal 1)
(goal strategy-goal flush)
(current-age == feudal-age)
(or
(players-unit-type-count any-enemy knight-line >= 8)
(goal forward-threat-goal 1)
)
=>
(set-goal attack-goal 0)
)
(defrule
(goal attack-goal 1)
(goal strategy-goal flush)
(current-age >= castle-age)
(or (and (unit-type-count spearman-line >= 6)
(research-available ri-pikeman))
(and (unit-type-count militiaman-line >= 12)
(research-available ri-long-swordsman)))
=>
(set-goal attack-goal 0)
)
(defrule
(goal attack-goal 1)
(game-time < 1800)
(goal monk-threat-goal 1)
(unit-type-count eagle-warrior-line < 4)
(unit-type-count scout-cavalry-line < 4)
(nor
(up-research-status c: ri-heresy >= research-pending)
(goal unit-goal archer)
)
=>
(set-goal attack-goal 0)
)
(defrule
(goal attack-goal 1)
(or (goal unit-goal skirmisher)
(or (and (goal unit-goal archer)
(strategic-number sn-cavalry-threat > 0))
(or (goal unit-goal my-unique-unit-line)
(goal unit-goal mix))))
(goal strategy-goal rush)
(or (population < max-civ-pop); test
(current-age < imperial-age))
(strategic-number sn-military-level < 3)
=>
(set-goal attack-goal 0)
)
(defrule
(goal attack-goal 1)
(up-research-status c: ri-bodkin-arrow < research-pending)
(or
(or
(goal unit-goal skirmisher)
(goal unit-goal archer)
)
(or
(goal unit-goal my-unique-unit-line)
(goal unit-goal mix)
)
)
(current-age >= castle-age)
(unit-type-count ranged-unit-class > 12)
=>
(set-goal attack-goal 0)
)
(defrule
(goal attack-goal 1)
(goal ranged-unit-type-goal archer)
(current-age >= castle-age)
(unit-type-count archer > 10)
(up-research-status c: ri-crossbow < research-pending)
=>
(set-goal attack-goal 0)
)
(defrule
(goal attack-goal 1)
(or
(goal unit-goal skirmisher)
(goal unit-goal mix)
)
(or
(goal enemy-goal skirmisher)
(unit-type-count skirmisher-line > 9)
)
(or
(research-available ri-elite-skirmisher)
(research-available ri-bodkin-arrow)
)
=>
(set-goal attack-goal 0)
)
(defrule
; (strategic-number sn-military-level < 3)
(goal attack-goal 1)
(or
(strategic-number sn-resource-control == ri-elite-eagle-warrior)
(or
(goal strategy-goal fast-imp)
(goal strategy-goal boom)
)
)
(or
(current-age < imperial-age)
(current-age-time < 120)
)
=>
(set-goal attack-goal 0)
)
(defrule
(goal attack-goal 1)
(unit-type-count monk > 30)
(or
(current-age < imperial-age)
(or
(research-available ri-theocracy)
(research-available ri-illumination)
)
)
(strategic-number sn-military-level < 3)
=>
(set-goal attack-goal 0)
)
(defrule
(goal attack-goal 1)
(or (players-building-count every-enemy == 0); no attack when enemy is not yet found.
(or (and (strategic-number sn-resource-control == ri-pikeman)
(research-available ri-pikeman))
(and (goal unit-goal eagle-warrior)
(research-available ri-chain-mail))))
=>
(set-goal attack-goal 0)
)
(defrule
(current-age == feudal-age)
(goal strategy-goal flush)
(or
(and
(goal enemy-goal eagle-warrior)
(unit-type-count militiaman-line < 5)
)
(and
(strategic-number sn-archer-threat > 1)
(players-building-type-count target-player watch-tower > 0)
)
)
=>
(set-goal retreat-now-goal 2)
)
(defrule
(goal attack-goal 1)
(players-building-type-count focus-player castle < 3)
(or
(and
(unit-type-count battering-ram > 1)
(military-population > 50)
)
(players-building-type-count focus-player castle == 0)
)
(goal enemy-fortifications-goal -1)
=>
(set-goal attack-goal 2)
; (chat-local-to-self "military advantage attack")
)
#load-if-defined POST-IMPERIAL-AGE-START
(defrule
(current-age == imperial-age)
(population > seventy-five-percent-pop)
(players-building-count any-enemy > 0)
(unit-type-count paladin > 30)
(game-time < 900)
=>
(set-goal attack-goal 2)
)
#end-if
#load-if-defined DEFEND-WONDER
(defrule
(current-age == imperial-age)
(unit-type-count trebuchet-set > 0)
(strategic-number sn-military-level > 0)
(players-building-type-count any-enemy wonder > 0)
=>
(set-goal attack-goal 2)
)
#end-if
(defrule
(goal attack-goal 1)
(unit-type-count battering-ram > 0)
(players-building-type-count focus-player castle == 1)
(strategic-number sn-military-level > 1)
(goal enemy-fortifications-goal -1)
=>
(set-goal attack-goal 2)
; (chat-local-to-self "military advantage attack2")
)
(defrule
(goal attack-goal 1)
(unit-type-count battering-ram-line > 0)
(players-building-type-count focus-player castle < 2)
(strategic-number sn-military-level > 1)
(or (unit-type-count cavalry-unit-class > 5)
(strategic-number sn-military-level > 2))
(nand (or (goal enemy-fortifications-goal 1)
(players-building-type-count focus-player stone-wall > 10))
(unit-type-count trebuchet-set == 0))
=>
(set-goal attack-goal 2)
)
#load-if-not-defined DIFFICULTY-MODERATE
#load-if-not-defined DIFFICULTY-HARD
#load-if-not-defined DIFFICULTY-HARDEST
(defrule
(current-age == imperial-age)
(current-age-time > 150)
(population > sixty-percent-pop)
(strategic-number sn-military-level >= 0)
(unit-type-count trebuchet-set > 0)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands); not on islands
=>
(set-goal attack-goal 2)
)
#end-if
#end-if
#end-if
(defrule
(current-age == imperial-age)
(population >= seventy-five-percent-pop)
(players-building-count any-enemy > 0)
(up-research-status c: ri-elite-eagle-warrior >= research-pending)
(players-current-age every-enemy <= castle-age)
(goal enemy-fortifications-goal -1)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands); not on islands
=>
(set-goal attack-goal 2)
)
(defrule
(current-age == imperial-age)
(current-age-time > 150)
(population >= del-civ-pop)
(players-building-count any-enemy > 0)
(or (unit-type-count battering-ram-line >= 3)
(unit-type-count trebuchet-set > 0))
(up-research-status c: ri-paladin != research-pending)
(goal enemy-fortifications-goal -1)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands); not on islands
=>
(set-goal attack-goal 2)
; (chat-local-to-self "High pop attack.")
)
(defrule
(current-age == imperial-age)
(current-age-time > 150)
(population >= del-civ-pop)
(unit-type-count trebuchet-set > 0)
(players-building-count any-enemy > 0)
(or (and (unit-type-count-total 579 < 1) ;Male gold miner
(unit-type-count-total 581 < 1)) ;female gold miner
(unit-type-count trebuchet-set > 2))
(strategic-number sn-minimum-water-body-size-for-dock < water-islands); not on islands
=>
(set-goal attack-goal 2)
; (chat-local-to-self "High pop attack. 2")
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(or (population >= del-civ-pop)
(game-time < 1200))
(population >= max-civ-pop)
(goal enemy-fortifications-goal 1); enemy fortifications
(or (and (unit-type-count trebuchet-set < 1); no trebs, but
(and (building-type-count castle == 0); no castle
(dropsite-min-distance stone > 10))); no stone available
(starting-age == post-imperial-age))
(unit-type-count battering-ram-line > 3); so still attack if we have rams to prevent idling
=>
(set-goal attack-goal 2)
; (chat-local-to-self "High pop attack. 3")
)
(defrule
(goal attack-goal 0)
(or (population >= del-civ-pop)
(or (unit-type-count trebuchet-set >= 1)
(unit-type-count battering-ram-line >= 3)))
(or (players-building-type-count any-enemy wonder > 0)
(enemy-captured-relics))
=>
(set-goal attack-goal 2)
; (chat-local-to-self "Win-condition attack.")
)
#load-if-defined FOR-DEBUGGING
(defrule
(up-compare-goal attack-goal != 0)
(or (strategic-number sn-minimum-water-body-size-for-dock == water-islands)
(and (or (dropsite-min-distance wood > 20)
(cc-players-unit-type-count 0 tree-class < 25))
(or (population < del-civ-pop)
(unit-type-count siege-unit-class < 3))))
=>
(set-goal attack-goal 0)
(chat-local-to-self "No attack - low wood/islands.")
)
#end-if
#load-if-not-defined DIFFICULTY-MODERATE
#load-if-not-defined DIFFICULTY-HARD
#load-if-not-defined DIFFICULTY-HARDEST
(defrule
(or (population >= del-civ-pop)
(strategic-number sn-resource-control == 2)); holding back resources due to the difficulty level
(strategic-number sn-military-level >= 1); 2
(or (strategic-number sn-current-age != fc-transit)
(strategic-number sn-military-level >= 2)); 3
=>
(set-goal attack-goal 1); attack might be an idea, check other conditions
)
(defrule
(up-compare-goal attack-goal != 0)
; test (population < max-pop); attack at some point
(or (strategic-number sn-military-level >= 3)
(or (and (strategic-number sn-military-level >= 2)
(game-time < 4200))
(and (strategic-number sn-military-level >= 1)
(game-time < 3000))))
=>
(set-goal attack-goal 0)
; (chat-local-to-self "Wait longer with attacking on this difficulty level.")
)
(defrule
(up-compare-goal attack-goal != 0)
(population < max-pop); attack at some point
(strategic-number sn-military-level >= 0); 1
(player-in-game target-player)
(stance-toward target-player enemy)
(or (players-current-age target-player <= castle-age)
(players-current-age-time target-player <= 600))
=>
(set-goal attack-goal 0)
; (chat-local-to-self "Wait longer with attacking on this difficulty level.")
)
#end-if
#end-if
#end-if
#load-if-defined DIFFICULTY-MODERATE
(defrule
(up-compare-goal attack-goal != 0)
(population < max-pop); attack at some point
(or (game-time < 360)
(or (and (strategic-number sn-military-level >= 2)
(game-time < 1320))
(and (strategic-number sn-military-level >= 1)
(game-time < 1020))))
=>
(set-goal attack-goal 0)
; (chat-local-to-self "Wait longer with attacking on this difficulty level.")
)
#end-if
#load-if-defined DIFFICULTY-HARD
(defrule
(up-compare-goal attack-goal != 0)
(population < max-pop); attack at some point
(or (game-time < 180)
(or (and (strategic-number sn-military-level >= 2)
(game-time < 600))
(and (strategic-number sn-military-level >= 1)
(game-time < 300))))
=>
(set-goal attack-goal 0)
; (chat-local-to-self "Wait longer with attacking on this difficulty level.")
)
#end-if
(defrule
(timer-triggered attack-timer)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(strategic-number sn-maximum-town-size >= 40)
(population > eighty-five-percent-pop); keep attacking when pop is high
(or (nand (goal enemy-fortifications-goal 1)
(unit-type-count trebuchet-set < 1)); except if the enemy has fortifications and we don't have siege
(unit-type-count siege-ram > 4))
=>
(set-goal attack-goal 4)
; (chat-local-to-self "Keep attacking.")
)
(defrule
(taunt-detected any-ally 31)
(taunt-detected any-human-ally 36)
=>
(acknowledge-taunt this-any-human-ally 36)
)
(defrule
(taunt-detected any-ally 31); standard attack taunt
(strategic-number sn-military-level < 1)
(military-population < 30)
(or (strategic-number sn-resource-control == ri-pikeman); we want pikemen vs knights
(and (strategic-number sn-cavalry-threat >= 1)
(unit-type-count spearman-line < 5)))
(or (goal unit-goal archer)
(or (goal unit-goal skirmisher)
(goal unit-goal my-unique-unit-line)))
(population < del-civ-pop); almost full pop => attack anyway
=>
(acknowledge-taunt this-any-ally 31)
(chat-to-allies-using-id 22118); "Alas, I cannot help that at this time."
)
(defrule
(taunt-detected any-ally 31)
(strategic-number sn-military-level < 1)
(military-population < 30)
(or (and (strategic-number sn-military-level < 0)
(population < max-civ-pop))
(military-population < 5))
(population < eighty-five-percent-pop)
=>
(acknowledge-taunt this-any-ally 31)
(chat-to-allies-using-id 22118); "Alas, I cannot help that at this time."
)
(defrule
(taunt-detected any-ally 31)
(strategic-number sn-military-level < 2); 3
(players-building-type-count focus-player castle > 0)
(or (players-building-type-count focus-player castle > 1)
(and (players-building-type-count focus-player stone-wall-line > 10)
(unit-type-count battering-ram-line < 1)))
(unit-type-count trebuchet-set < 1)
(unit-type-count battering-ram-line < 2)
(population < del-civ-pop); almost full pop => attack anyway
=>
(acknowledge-taunt this-any-ally 31)
(chat-to-allies-using-id 22118); "Alas, I cannot help that at this time."
)
(defrule
(taunt-detected any-ally 31)
(goal strategy-goal flush)
(current-age == feudal-age)
(or (or (and (players-current-age focus-player == castle-age)
(players-military-population focus-player > 10))
(strategic-number sn-resource-control == 2))
(players-military-population focus-player > 16))
(population < del-civ-pop); almost full pop => attack anyway
(strategic-number sn-military-level < 2)
=>
(acknowledge-taunt this-any-ally 31)
(chat-to-allies-using-id 22118); "Alas, I cannot help that at this time."
)
(defrule
(taunt-detected any-ally 222)
(or (military-population >= 15)
(or (population >= sixty-percent-pop)
(or (population >= max-civ-pop)
(strategic-number sn-military-level >= 0))))
(military-population >= 4)
=>
(set-goal attack-goal 4)
(enable-timer help-ally-timer 210)
; (set-strategic-number sn-target-evaluation-ally-proximity 1)
; (acknowledge-taunt this-any-ally 222)
; (chat-to-allies-using-id 22153); "At once, sire!"
)
(defrule
(taunt-detected any-ally 31)
(or (military-population >= 40)
(or (population >= eighty-five-percent-pop)
(or (population >= del-civ-pop)
(strategic-number sn-military-level >= 1))))
(military-population >= 8)
=>
(set-goal attack-goal 4)
(enable-timer help-ally-timer 210)
; (set-strategic-number sn-target-evaluation-ally-proximity 1)
; (acknowledge-taunt this-any-ally 31)
; (chat-to-allies-using-id 22153); "At once, sire!"
)
(defrule
(building-type-count town-center > 0)
(players-building-type-count target-player stone-wall > 0)
(strategic-number sn-maximum-town-size >= 40)
(strategic-number sn-maximum-town-size < 680); 480
(enemy-buildings-in-town)
(timer-triggered one-minute-timer); wild guess work
=>
(up-modify-sn sn-maximum-town-size c:+ 25); increase TS to reach buildings behind the wall
)
(defrule
(game-time > 1200)
(timer-triggered micro-timer)
(up-compare-goal threat-time-goal > 5000)
(strategic-number sn-number-attack-groups > 0)
(strategic-number sn-minimum-attack-group-size < 2)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(unit-type-count monastery-class < 12)
(unit-type-count trebuchet-set == 0)
=>
(enable-timer micro-timer 25)
(set-strategic-number sn-group-form-distance 30)
(set-strategic-number sn-number-attack-groups 500)
(set-strategic-number sn-minimum-attack-group-size 40)
(set-strategic-number sn-maximum-attack-group-size 40)
(set-strategic-number sn-attack-group-gather-spacing 3)
(chat-to-player my-player-number "no enemy activites detected - large groups")
)
(defrule
(goal retargetenemy yes)
; (building-type-count-total town-center >= 1)
(players-building-count any-enemy > 0)
=>
(up-find-player enemy find-closest closest-enemy-goal)
(up-modify-sn sn-target-player-number g:= closest-enemy-goal)
(up-modify-sn sn-focus-player-number g:= closest-enemy-goal))
(defrule
(goal retargetenemy 3); wonder/relics
(players-building-type-count every-enemy wonder <= 0)
(not (enemy-captured-relics))
=>
(set-goal retargetenemy yes)
(chat-to-player my-player-number "Retargeting to closest enemy.")
(set-strategic-number sn-special-attack-type1 0)
(set-strategic-number sn-special-attack-influence1 1)
(set-strategic-number sn-special-attack-type3 0)
; (set-strategic-number sn-special-attack-influence3 1)
)
#load-if-defined VICTORY-STANDARD
(defrule
(players-building-count any-enemy > 0)
(enemy-captured-relics)
(up-compare-goal retargetenemy != 3)
=>
(up-modify-sn sn-target-player-number g:= winning-player)
(up-modify-sn sn-focus-player-number g:= winning-player)
(set-strategic-number sn-special-attack-type1 1)
(set-strategic-number sn-special-attack-influence1 10000)
(chat-to-player my-player-number "Retargeting to player with relics.")
(set-goal retargetenemy 3)); blocks retargeting to closest player
(defrule
(players-building-count any-enemy > 0)
(players-building-type-count target-player wonder == 0)
(players-building-type-count any-enemy wonder > 0)
=>
(up-modify-sn sn-target-player-number g:= winning-player)
(up-modify-sn sn-focus-player-number g:= winning-player)
(set-strategic-number sn-special-attack-type3 1)
; (set-strategic-number sn-special-attack-influence3 10000)
(chat-to-player my-player-number "Retargeting to player with wonder.")
(set-goal retargetenemy 3)); blocks retargeting to closest player
(defrule
(goal retargetenemy 3); wonder/relics
(up-compare-goal victory-time >= 0)
(up-compare-goal victory-time < 1000)
(goal under-attack-goal 0)
(or (players-building-type-count target-player wonder > 0)
(and (enemy-captured-relics)
(players-building-type-count target-player monastery > 0)))
(strategic-number sn-maximum-town-size < 40)
(up-compare-goal attack-goal < 1)
=>
(set-goal attack-goal 1)
(up-reset-unit c: -1));max-ts?
#end-if
#load-if-defined KING-OF-THE-HILL
(defrule
(up-compare-goal victory-time >= 0)
(up-compare-goal victory-time < 1000); someone has the monument
(players-building-count any-enemy > 0)
(or (strategic-number sn-target-player-number != winning-player)
(strategic-number sn-focus-player-number != winning-player))
=>
(up-modify-sn sn-target-player-number g:= winning-player)
(up-modify-sn sn-focus-player-number g:= winning-player)
(chat-to-player my-player-number "Retargeting to player with monument.")
(set-goal retargetenemy 4)); blocks retargeting to closest player
#end-if
(defrule
(or (strategic-number sn-target-player-number == 0)
(or (player-resigned target-player)
(or (not (player-valid target-player))
(not (player-in-game target-player)))))
(player-in-game any-enemy)
(players-building-count any-enemy > 0)
=>
(set-goal retargetenemy yes)
(up-find-player enemy find-closest closest-enemy-goal)
(up-modify-sn sn-target-player-number g:= closest-enemy-goal)
(up-modify-sn sn-focus-player-number g:= closest-enemy-goal)
; (up-chat-data-to-self "Focus-player: %d" g: closest-enemy-goal)
; (chat-to-player every-computer "Retargeting to the closest living enemy.")
)
(defrule
(or (stance-toward target-player ally)
(players-building-count target-player <= 0))
(player-in-game any-enemy)
(players-building-count any-enemy > 0)
=>
(set-goal retargetenemy yes)
(up-find-player enemy find-closest closest-enemy-goal)
(up-modify-sn sn-target-player-number g:= closest-enemy-goal)
(up-modify-sn sn-focus-player-number g:= closest-enemy-goal)
; (up-chat-data-to-self "Focus-player: %d" g: closest-enemy-goal)
; (chat-to-player every-computer "Retargeting to the closest living enemy.")
)
#load-if-defined DEATH-MATCH
(defrule
(strategic-number sn-number-attack-groups > 0)
(strategic-number sn-maximum-town-size < 40)
(up-compare-goal attack-goal < 2)
(nand (strategic-number sn-target-evaluation-ally-proximity > 0)
(up-timer-status help-ally-timer == timer-running))
=>
(set-strategic-number sn-number-attack-groups 0)
(set-goal retreat-now-goal 1)
)
#end-if
(defrule
(strategic-number sn-target-player-number != 0)
(timer-triggered help-ally-timer)
(timer-triggered attack-timer)
=>
(set-strategic-number sn-target-evaluation-ally-proximity 0)
)
(defrule
(goal retreat-now-goal 1)
(not (town-under-attack))
(military-population >= 30)
(strategic-number sn-resource-control < 1)
(unit-type-count-total monk == 0); train a single monk for healing
(can-train monk)
=>
(train monk)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(goal retreat-now-goal 1)
(timer-triggered retreat-timer)
=>
(enable-timer retreat-timer 6)
(up-retreat-now)
(set-strategic-number sn-number-attack-groups 0)
(set-strategic-number sn-enemy-sighted-response-distance 0)
(set-strategic-number sn-maximum-town-size 12)
(set-goal retreat-now-goal 0)
(set-goal attack-status-goal retreat)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(goal retreat-now-goal 2)
(or (strategic-number sn-maximum-town-size >= 40)
(strategic-number sn-number-attack-groups > 0))
(timer-triggered retreat-timer)
=>
(enable-timer retreat-timer 6)
(up-retreat-now)
(set-strategic-number sn-number-attack-groups 0)
(set-strategic-number sn-enemy-sighted-response-distance 0)
(set-strategic-number sn-maximum-town-size 12)
(set-goal retreat-now-goal 0)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock == water-islands)
=>
(up-jump-rule 10); TSA doesn't work on islands
)
(defrule
(strategic-number sn-number-explore-groups <= 0)
(or (and (cc-players-unit-type-count 0 tree-class > 50)
(and (population > seventy-five-percent-pop)
(players-population target-player < twenty-five-percent-pop)))
(or (players-building-count every-enemy <= 0)
(and (player-in-game every-enemy)
(players-building-count any-enemy <= 0))))
=>
(set-strategic-number sn-number-explore-groups 1)); search for the enemy to prevent him from hiding
(defrule
(strategic-number sn-number-explore-groups <= 0)
(player-in-game target-player)
(players-building-count target-player <= 0)
(strategic-number sn-number-explore-groups <= 0)
=>
(set-strategic-number sn-number-explore-groups 1)); search for the enemy to prevent him from hiding
(defrule
(nand (enemy-buildings-in-town)
(strategic-number sn-military-level >= 2)); else it may be a forward castle or sth like that
(or (unit-type-count castle-arrow > 0)
(or (unit-type-count castle-arrow-chemistry > 0)
(unit-type-count tc-arrow > 0)))
(population < del-civ-pop); shouldn't make a huge difference
=>
(up-jump-rule 2); or it won't react to town under attack
; (chat-local-to-self "Fortification fire detected, prevent attacks this rule pass.")
)
(defrule
(building-type-count town-center > 0)
(strategic-number sn-maximum-town-size < 680); 480
(strategic-number sn-maximum-town-size >= 40)
(or (population >= del-civ-pop)
(or (map-size giant)
(map-size ludikris)))
(not (enemy-buildings-in-town))
=>
(up-modify-sn sn-maximum-town-size c:+ tsa-increment)
(enable-timer reset-town-size-timer 92)
; debug (up-chat-data-to-self "TSA = %d" s: sn-maximum-town-size)
)
(defrule
(building-type-count town-center > 0)
(strategic-number sn-maximum-town-size < 680); 480
(strategic-number sn-maximum-town-size >= 40)
(nor (population >= del-civ-pop)
(or (map-size giant)
(map-size ludikris)))
(not (enemy-buildings-in-town))
=>
(up-modify-sn sn-maximum-town-size c:+ 6)
(enable-timer reset-town-size-timer 92)
; debug (up-chat-data-to-self "TSA = %d" s: sn-maximum-town-size)
)
#load-if-defined DEATH-MATCH
#load-if-not-defined POST-IMPERIAL-AGE-START
(defrule
(up-compare-goal attack-goal >= 2)
(strategic-number sn-target-player-number > 0)
(players-building-count target-player > 0)
(game-time < 900)
=>
(set-strategic-number sn-number-attack-groups 500)
(set-strategic-number sn-minimum-attack-group-size 1)
(set-strategic-number sn-maximum-attack-group-size 1)
(set-strategic-number sn-group-form-distance 5)
(set-goal attack-goal 0)
(set-goal attack-status-goal groups)
(enable-timer attack-timer 120)
)
#else
(defrule
(up-compare-goal attack-goal >= 2)
(strategic-number sn-target-player-number > 0)
(players-building-count target-player > 0)
(game-time < 420)
=>
(set-strategic-number sn-number-attack-groups 500)
(set-strategic-number sn-minimum-attack-group-size 1)
(set-strategic-number sn-maximum-attack-group-size 1)
(set-strategic-number sn-group-form-distance 5)
(set-goal attack-goal 0)
(set-goal attack-status-goal groups)
(enable-timer attack-timer 120)
)
#end-if
#end-if
(defrule
(up-compare-goal attack-goal >= 2)
(taunt-detected any-human-ally 36)
=>
(set-goal attack-goal 0)
)
(defrule ; A.
(up-compare-goal attack-goal >= 2000); disabled, rule not commented out because there's a jump above
(timer-triggered attack-timer); and i might enable the rule later again (>= 2)
(or (strategic-number sn-military-level >= 3); test
(or (players-building-type-count focus-player stone-wall-line >= 1)
(players-building-type-count focus-player 939 >= 1))); gates
(strategic-number sn-target-player-number > 0)
(players-building-count target-player > 0)
(strategic-number sn-number-attack-groups < 500)
=>
(set-strategic-number sn-number-attack-groups 500)
(set-strategic-number sn-minimum-attack-group-size 1)
(set-strategic-number sn-maximum-attack-group-size 1)
; (set-strategic-number sn-group-form-distance 5)
(set-goal attack-goal 0)
(set-goal attack-status-goal groups)
(enable-timer attack-timer 30)
)
(defrule
(goal attack-goal 2)
(timer-triggered attack-timer)
(strategic-number sn-target-player-number > 0)
(players-building-count target-player > 0)
(strategic-number sn-maximum-town-size < 40); got something else to reduce high town-size
=>
(set-goal attack-goal 0)
(set-goal attack-status-goal tsa)
(set-strategic-number sn-maximum-town-size 40)
(enable-timer attack-timer 30); 60
(enable-timer reset-town-size-timer 92)
(chat-local-to-self "Starting TSA.")
)
(defrule
(goal attack-goal 4)
(timer-triggered attack-timer)
(strategic-number sn-target-player-number > 0)
(players-building-count target-player > 0)
(strategic-number sn-maximum-town-size < 40); got something else to reduce high town-size
=>
(set-goal attack-goal 0)
(set-goal attack-status-goal tsa)
(set-strategic-number sn-maximum-town-size 40)
(enable-timer attack-timer 30); 60
(enable-timer reset-town-size-timer 92)
(chat-local-to-self "Starting TSA.")
)
(defrule
(timer-triggered attack-timer)
(strategic-number sn-maximum-town-size < 40)
(strategic-number sn-number-attack-groups > 0)
=>
(up-reset-unit c: -1)
(set-strategic-number sn-number-attack-groups 0)
(set-strategic-number sn-minimum-attack-group-size 0)
(set-goal attack-status-goal 0)
(chat-local-to-self "Reset units.")
)
(defrule
(timer-triggered reset-town-size-timer)
(population >= 140)
=>
(disable-timer reset-town-size-timer)
(up-reset-unit c: -1)
(set-strategic-number sn-number-attack-groups 0)
(set-strategic-number sn-group-form-distance 0)
(set-strategic-number sn-maximum-town-size 24)
(set-goal attack-status-goal 0)
(chat-local-to-self "Reset town size triggered.")
)
(defrule
(timer-triggered reset-town-size-timer)
(population >= 90)
=>
(disable-timer reset-town-size-timer)
(up-reset-unit c: -1)
(set-strategic-number sn-number-attack-groups 0)
(set-strategic-number sn-group-form-distance 0)
(set-strategic-number sn-maximum-town-size 20)
(set-goal attack-status-goal 0)
(chat-local-to-self "Reset town size triggered.")
)
(defrule
(timer-triggered reset-town-size-timer)
(population >= 60)
=>
(disable-timer reset-town-size-timer)
(up-reset-unit c: -1)
(set-strategic-number sn-number-attack-groups 0)
(set-strategic-number sn-group-form-distance 0)
(set-strategic-number sn-maximum-town-size 16)
(set-goal attack-status-goal 0)
(chat-local-to-self "Reset town size triggered.")
)
(defrule
(timer-triggered reset-town-size-timer)
=>
(disable-timer reset-town-size-timer)
(up-reset-unit c: -1)
(set-strategic-number sn-number-attack-groups 0)
(set-strategic-number sn-group-form-distance 0)
(set-strategic-number sn-maximum-town-size 10)
(set-goal attack-status-goal 0)
(chat-local-to-self "Reset town size triggered.")
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed); not on islands
(strategic-number sn-military-level < 0)
(population < eighty-five-percent-pop)
=>
(set-strategic-number sn-task-ungrouped-soldiers 0)
(set-strategic-number sn-enemy-sighted-response-distance 0)
(set-strategic-number sn-sentry-distance 1)
)
(defrule
(game-time > 1200)
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(population > 50)
(population < 130)
(goal housing-goal 0)
(strategic-number sn-military-level < 0)
(military-population < 25)
(strategic-number sn-maximum-town-size > 20)
(strategic-number sn-maximum-town-size < 40)
(unit-type-count tc-arrow == 0)
(goal increase-town-size-goal 0); otherwise we can't build anything and lose as well.
=>
(set-strategic-number sn-maximum-town-size 20)
(set-strategic-number sn-defense-distance 0)
(set-strategic-number sn-enemy-sighted-response-distance 0)
; (set-strategic-number sn-cap-civilian-builders 10)
; (chat-to-player my-player-number "outnumbered - maximum TS = 18")
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(current-age == feudal-age)
(goal strategy-goal flush)
(or (goal enemy-goal flush)
(strategic-number sn-archer-threat > 1))
(players-current-age any-enemy == castle-age)
(strategic-number sn-maximum-town-size == 7)
(timer-triggered one-minute-timer)
=>
(up-retreat-now)
)
; NAVY MANAGEMENT
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-mixed)
=>
(up-jump-rule 6)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock >= water-mixed)
(warboat-count > 4)
(or (game-time < 1260)
(warboat-count > 9))
(or (game-time < 1620)
(warboat-count > 15))
(or (game-time < 2000)
(warboat-count > 21))
(or (game-time < 2700)
(strategic-number sn-minimum-water-body-size-for-dock == water-mixed)); not likely to get more ships on mixed maps
=>
(set-goal attack-goal 6)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock >= water-islands)
(game-time > 2100)
(warboat-count > 40)
(or (or (players-unit-type-count any-enemy galley-line > 12); eliminate remaining ships
(players-unit-type-count any-enemy fire-ship-line > 12))
(or (unit-type-count cannon-galleon-line > 7); or bring cannon-galleons against castles/tower
(not (research-available ri-cannon-galleon))))
=>
(set-goal attack-goal 6)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock >= water-islands)
(goal attack-goal 6)
(timer-triggered attack-timer)
(players-unit-type-count any-enemy galley-line < 15)
(players-unit-type-count any-enemy fire-ship-line < 15)
(unit-type-count transport-ship > 0)
(soldier-count >= 10)
=>
(set-strategic-number sn-percent-attack-soldiers 100)
(set-strategic-number sn-group-form-distance 30)
(set-strategic-number sn-attack-group-gather-spacing 30)
(attack-now)
(enable-timer attack-timer 240); 300
(set-strategic-number sn-special-attack-type2 -1)
(chat-local-to-self "Utilizing transports.")
)
(defrule
(goal attack-goal 6)
(timer-triggered navy-attack-timer)
(up-compare-goal threat-target-goal != warship-class)
(players-building-count any-enemy > 0)
(nand (cc-players-unit-type-count target-player castle-arrow > 0);(up-projectile-detected projectile-castle c:< 30000)
;(and
(unit-type-count cannon-galleon-line == 0)
;(up-projectile-target projectile-castle == warship-class);) provisory
)
=>
(set-strategic-number sn-minimum-boat-attack-group-size 1)
(set-strategic-number sn-maximum-boat-attack-group-size 1)
; (set-strategic-number sn-percent-attack-boats 100)
(set-strategic-number sn-number-boat-attack-groups 500)
(enable-timer navy-attack-timer 10)
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock >= water-islands)
(unit-type-count 42 == 0)
(or (goal threat-target-goal cavalry-unit-class); Enemy fighting our units with non warships
(goal threat-target-goal infantry-class)); This assumes we have successfully landed on the enemy island
(up-compare-goal threat-source-goal != warship-class)
(timer-triggered retreat-timer)
(unit-type-count transport-ship > 0)
=>
(up-reset-unit c: -1); disable the attack, attack now groups react horrible
(enable-timer retreat-timer 120)
(enable-timer attack-timer 60)
)
(defrule
(strategic-number sn-number-boat-attack-groups > 0)
(strategic-number sn-minimum-water-body-size-for-dock >= water-mixed)
(up-compare-goal attack-goal != 6)
=>
(set-strategic-number sn-minimum-boat-attack-group-size 0)
(set-strategic-number sn-maximum-boat-attack-group-size 0)
(set-strategic-number sn-number-boat-attack-groups 0)
; (set-strategic-number sn-percent-attack-boats 0)
)
;spread military to prevent blocking
(defrule
(goal spread-military-goal 0)
(timer-triggered spread-military-timer)
=>
(disable-timer spread-military-timer)
(set-strategic-number sn-task-ungrouped-soldiers 1)
(set-goal spread-military-goal 1)
(enable-timer spread-military-timer 3));5
(defrule
(goal spread-military-goal 1)
(timer-triggered spread-military-timer)
=>
(disable-timer spread-military-timer)
(set-strategic-number sn-task-ungrouped-soldiers 0)
(set-goal spread-military-goal 0); use a goal because sn-task-ungrouped-soldiers is always 1 when used as a fact
(enable-timer spread-military-timer spread-interval)
)
; check if out town under attack and not an annoying wolf
(defrule
(goal under-attack-goal 0)
(strategic-number sn-maximum-town-size < 40)
(players-military-population any-enemy > 1)
(town-under-attack)
=>
(set-goal under-attack-goal 2)
(enable-timer under-attack-timer 30)
)
(defrule
(town-under-attack)
(not (timer-triggered under-attack-timer))
(goal under-attack-goal 3)
=>
(set-strategic-number sn-target-evaluation-ally-proximity 0)
(set-goal under-attack-goal 1)
(chat-local-to-self "attack was not over yet")
)
(defrule
(timer-triggered under-attack-timer)
(town-under-attack)
(population > 25)
=>
(set-strategic-number sn-target-evaluation-ally-proximity 0)
(disable-timer under-attack-timer)
(enable-timer under-attack-timer 20)
(set-goal under-attack-goal 1)
)
(defrule
(timer-triggered under-attack-timer)
(town-under-attack)
(population < 26)
=>
(set-strategic-number sn-target-evaluation-ally-proximity 0)
(disable-timer under-attack-timer)
(enable-timer under-attack-timer 20)
(set-goal under-attack-goal 1)
)
(defrule
(not (town-under-attack))
(goal under-attack-goal 1)
=>
(enable-timer under-attack-timer 60)
(set-goal under-attack-goal 3)
)
(defrule
(or (strategic-number sn-maximum-town-size >= 40)
(or (and (timer-triggered under-attack-timer)
(goal under-attack-goal 3))
(and (not (town-under-attack))
(goal under-attack-goal 2))))
=>
(disable-timer under-attack-timer)
(set-goal under-attack-goal 0)
)
(defrule
(or (strategic-number sn-maximum-town-size >= 40)
(strategic-number sn-number-attack-groups >= 1))
(up-compare-goal team-coordination-goal != 1)
=>
(set-goal team-coordination-goal 1)
)
(defrule
(or (or (taunt-detected any-ally 222); if we could help, this taunt would have been acknowledged by now
(taunt-detected any-ally 211))
(or (taunt-detected any-ally 31)
(taunt-detected any-ally 100)))
(up-compare-goal team-coordination-goal != 1); not attacking
=>
(acknowledge-taunt this-any-ally 222)
(acknowledge-taunt this-any-ally 211)
(acknowledge-taunt this-any-ally 31)
(acknowledge-taunt this-any-ally 100)
(set-strategic-number sn-target-evaluation-ally-proximity 0)
(chat-to-allies-using-id 22118); "Alas, I cannot help that at this time."
)
(defrule
(or (or (taunt-detected any-ally 222); if we could help, this taunt would have been acknowledged by now
(taunt-detected any-ally 211))
(or (taunt-detected any-ally 31)
(taunt-detected any-ally 100)))
(goal team-coordination-goal 1); attacking
=>
(acknowledge-taunt this-any-ally 222)
(acknowledge-taunt this-any-ally 211)
(acknowledge-taunt this-any-ally 31)
(acknowledge-taunt this-any-ally 100)
(set-strategic-number sn-target-evaluation-ally-proximity 1)
(chat-to-allies-using-id 22153); "At once, sire!"
)
(defrule
; (game-time > 2)
(player-in-game any-ally)
(not (taunt-detected any-ally 31))
(up-compare-goal team-coordination-goal == 1); attacking
(goal attackchat 1)
=>
(set-goal attackchat 0)
(chat-to-player every-ally "31")
(chat-to-player-using-id every-ally 22117); "Attack now!"
(enable-timer attack-chat 300)); don't be too annoying
(defrule
(timer-triggered attack-chat)
=>
(disable-timer attack-chat)
(set-goal attackchat 1))
(defrule
(population < del-civ-pop)
(goal under-attack-goal 1)
(goal defendchat yes)
=>
; test (chat-to-player every-computer "31"); use this because every-computer-ally doesn't exist
(chat-to-player every-computer "222"); but enemies won't react to this taunt anyway
(chat-to-player-using-id every-ally 22115); "Help! The enemy is in my town!"
(set-goal defendchat no)
(enable-timer defend-timer 150))
(defrule
(timer-triggered defend-timer)
=>
(disable-timer defend-timer)
(set-goal defendchat yes))
; ********** OPTIONAL CHEATS ***********
#load-if-defined DIFFICULTY-HARDEST
(defrule
(taunt-detected any-human 200)
=>
(chat-to-all "Taunt 200 detected - Cheats enabled!")
(disable-self))
#else
(defrule
(taunt-detected any-human 200)
=>
(chat-to-all "Taunt 200 cheats only work on the 'hardest' difficulty level.")
(acknowledge-taunt this-any-human 200))
#end-if
(defrule
(taunt-detected any-human 200)
(building-type-count town-center < 1)
(building-type-count lumber-camp < 1); landnomad
(building-type-count-total lumber-camp >= 1)
=>
(cc-add-resource wood 50)
(cc-add-resource food 125)
(disable-self))
(defrule
(taunt-detected any-human 200)
(game-time >= 360)
=>
(cc-add-resource wood 100)
(cc-add-resource food 130)
(disable-self))
(defrule
(taunt-detected any-human 200)
(game-time >= 420)
=>
(cc-add-resource wood 40)
(cc-add-resource food 100)
(cc-add-resource gold 40)
(cc-add-resource stone 5)
(disable-self))
(defrule
(taunt-detected any-human 200)
(or (game-time >= 480)
(or (current-age >= feudal-age)
(or (players-current-age any-enemy >= feudal-age)
(players-current-age any-ally >= feudal-age))))
(timer-triggered thirty)
=>
(cc-add-resource wood 30)
(cc-add-resource food 30)
(cc-add-resource gold 30)
(cc-add-resource stone 5))
; ********** HUMAN COOPERATION ***********
(defrule
(nor (taunt-detected any-human-ally 231)
(or (taunt-detected any-human-ally 232)
(or (taunt-detected any-human-ally 233)
(or (taunt-detected any-human-ally 234)
(or (taunt-detected any-human-ally 235)
(or (taunt-detected any-human-ally 236)
(or (taunt-detected any-human-ally 237)
(taunt-detected any-human-ally 238))))))))
=>
(up-jump-rule 8))
(defrule
(taunt-detected any-human-ally 231)
(nor (stance-toward 1 ally)
(player-number 1))
(player-in-game 1)
(players-building-count 1 >= 1); eligible for targeting
=>
(set-strategic-number sn-target-player-number 1)
(set-strategic-number sn-focus-player-number 1)
(set-goal retargetenemy 4); block retargeting
(chat-to-allies "I will target this enemy for 10 minutes.")
(chat-to-allies "If i don't kill him faster than that...")
; (chat-to-allies-using-id 22153); "At once, sire!"
(enable-timer human-coop-timer 600)
(acknowledge-taunt every-ally 231))
(defrule
(taunt-detected any-human-ally 232)
(nor (stance-toward 2 ally)
(player-number 2))
(player-in-game 2)
(players-building-count 2 >= 1); eligible for targeting
=>
(set-strategic-number sn-target-player-number 2)
(set-strategic-number sn-focus-player-number 2)
(set-goal retargetenemy 4); block retargeting
(chat-to-allies "I will target this enemy for 10 minutes.")
(chat-to-allies "If i don't kill him faster than that...")
; (chat-to-allies-using-id 22153); "At once, sire!"
(enable-timer human-coop-timer 600)
(acknowledge-taunt every-ally 232))
(defrule
(taunt-detected any-human-ally 233)
(nor (stance-toward 3 ally)
(player-number 3))
(player-in-game 3)
(players-building-count 3 >= 1); eligible for targeting
=>
(set-strategic-number sn-target-player-number 3)
(set-strategic-number sn-focus-player-number 3)
(set-goal retargetenemy 4); block retargeting
(chat-to-allies "I will target this enemy for 10 minutes.")
(chat-to-allies "If i don't kill him faster than that...")
; (chat-to-allies-using-id 22153); "At once, sire!"
(enable-timer human-coop-timer 600)
(acknowledge-taunt every-ally 233))
(defrule
(taunt-detected any-human-ally 234)
(nor (stance-toward 4 ally)
(player-number 4))
(player-in-game 4)
(players-building-count 4 >= 1); eligible for targeting
=>
(set-strategic-number sn-target-player-number 4)
(set-strategic-number sn-focus-player-number 4)
(set-goal retargetenemy 4); block retargeting
(chat-to-allies "I will target this enemy for 10 minutes.")
(chat-to-allies "If i don't kill him faster than that...")
; (chat-to-allies-using-id 22153); "At once, sire!"
(enable-timer human-coop-timer 600)
(acknowledge-taunt every-ally 234))
(defrule
(taunt-detected any-human-ally 235)
(nor (stance-toward 5 ally)
(player-number 5))
(player-in-game 5)
(players-building-count 5 >= 1); eligible for targeting
=>
(set-strategic-number sn-target-player-number 5)
(set-strategic-number sn-focus-player-number 5)
(set-goal retargetenemy 4); block retargeting
(chat-to-allies "I will target this enemy for 10 minutes.")
(chat-to-allies "If i don't kill him faster than that...")
; (chat-to-allies-using-id 22153); "At once, sire!"
(enable-timer human-coop-timer 600)
(acknowledge-taunt every-ally 235))
(defrule
(taunt-detected any-human-ally 236)
(nor (stance-toward 6 ally)
(player-number 6))
(player-in-game 6)
(players-building-count 6 >= 1); eligible for targeting
=>
(set-strategic-number sn-target-player-number 6)
(set-strategic-number sn-focus-player-number 6)
(set-goal retargetenemy 4); block retargeting
(chat-to-allies "I will target this enemy for 10 minutes.")
(chat-to-allies "If i don't kill him faster than that...")
; (chat-to-allies-using-id 22153); "At once, sire!"
(enable-timer human-coop-timer 600)
(acknowledge-taunt every-ally 236))
(defrule
(taunt-detected any-human-ally 237)
(nor (stance-toward 7 ally)
(player-number 7))
(player-in-game 7)
(players-building-count 7 >= 1); eligible for targeting
=>
(set-strategic-number sn-target-player-number 7)
(set-strategic-number sn-focus-player-number 7)
(set-goal retargetenemy 4); block retargeting
(chat-to-allies "I will target this enemy for 10 minutes.")
(chat-to-allies "If i don't kill him faster than that...")
; (chat-to-allies-using-id 22153); "At once, sire!"
(enable-timer human-coop-timer 600)
(acknowledge-taunt every-ally 237))
(defrule
(taunt-detected any-human-ally 238)
(nor (stance-toward 8 ally)
(player-number 8))
(player-in-game 8)
(players-building-count 8 >= 1); eligible for targeting
=>
(set-strategic-number sn-target-player-number 8)
(set-strategic-number sn-focus-player-number 8)
(set-goal retargetenemy 4); block retargeting
(chat-to-allies "I will target this enemy for 10 minutes.")
(chat-to-allies "If i don't kill him faster than that...")
; (chat-to-allies-using-id 22153); "At once, sire!"
(enable-timer human-coop-timer 600)
(acknowledge-taunt every-ally 238))
(defrule; not an enemy / not alive / ...
(or (taunt-detected any-human-ally 231)
(or (taunt-detected any-human-ally 232)
(or (taunt-detected any-human-ally 233)
(taunt-detected any-human-ally 234))))
=>
(chat-to-allies "That is not a valid target player.")
; (chat-to-allies-using-id 22118); "Alas, I cannot help that at this time."
(acknowledge-taunt every-ally 231)
(acknowledge-taunt every-ally 232)
(acknowledge-taunt every-ally 233)
(acknowledge-taunt every-ally 234))
(defrule; not an enemy / not alive / ...
(or (taunt-detected any-human-ally 235)
(or (taunt-detected any-human-ally 236)
(or (taunt-detected any-human-ally 237)
(taunt-detected any-human-ally 238))))
=>
(chat-to-allies "That is not a valid target player.")
; (chat-to-allies-using-id 22118); "Alas, I cannot help that at this time."
(acknowledge-taunt every-ally 235)
(acknowledge-taunt every-ally 236)
(acknowledge-taunt every-ally 237)
(acknowledge-taunt every-ally 238))
(defrule
(timer-triggered human-coop-timer)
=>
(disable-timer human-coop-timer)
(chat-to-allies "I will select a target enemy on my own again.")
(set-goal retargetenemy yes)); allow retargeting
; ********** INCREASE TS CODE **********
#load-if-defined DEATH-MATCH
(defrule
(up-compare-goal increase-town-size-goal != 0)
(or (and (current-age == castle-age)
(current-age-time < 30))
(or (current-age < castle-age)
(starting-age == post-imperial-age)))
=>
(set-goal increase-town-size-goal 0); don't increase TS too early in DM, as there might be more building rules than builders!
)
#else
; in PIDM increase TS according to game time, everything else will be too slow
;These rules increase town-size by population as our TS increase system doesn't cover houses and farms
; Compact TS and prevent enemy lure us when under outnumbered.
(defrule
(strategic-number sn-maximum-town-size < pop60-town-size); Promisory debug backup
(or
(or
(population > 60)
(housing-headroom < 5)
)
(and
(strategic-number sn-military-level >= 0)
(building-type-count town-center > 1)
)
)
(population >= 40)
(population <= 90)
=>
(disable-timer reset-town-size-timer)
(set-strategic-number sn-maximum-town-size pop60-town-size)
)
(defrule
(or
(population > 90)
(and
(strategic-number sn-military-level >= 0)
(building-type-count town-center > 2)
)
)
(strategic-number sn-maximum-town-size < pop90-town-size)
=>
(set-strategic-number sn-maximum-town-size pop90-town-size)
)
(defrule
(or
(population > 120)
(and
(strategic-number sn-military-level >= 0)
(building-type-count town-center > 3)
)
)
(strategic-number sn-maximum-town-size < pop120-town-size)
=>
(set-strategic-number sn-maximum-town-size pop120-town-size)
)
(defrule
(game-time < 1800)
(building-type-count town-center > 0)
(goal strategy-goal flush)
(strategic-number sn-military-level < 0)
(strategic-number sn-allow-civilian-offense != 2)
(goal increase-town-size-goal 0); otherwise we can't build anything and lose as well.
=>
(set-strategic-number sn-maximum-town-size 7)
(set-strategic-number sn-task-ungrouped-soldiers 0)
(set-strategic-number sn-enemy-sighted-response-distance 0)
; (chat-to-player my-player-number "outnumbered - maximum TS = 7")
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(current-age == feudal-age)
(goal strategy-goal flush)
(or
(goal enemy-goal flush)
(strategic-number sn-archer-threat > 1)
)
(players-current-age every-enemy == castle-age)
(goal housing-goal 0)
(strategic-number sn-maximum-town-size > 7)
(goal increase-town-size-goal 0); otherwise we can't build anything and lose as well.
=>
(set-strategic-number sn-maximum-town-size 7)
(set-strategic-number sn-task-ungrouped-soldiers 0)
(set-strategic-number sn-enemy-sighted-response-distance 0)
(chat-to-player my-player-number "enemy castled faster, stay defenseive - maximum TS = 7")
)
(defrule
(or
(up-compare-goal increase-town-size-goal != 0); need to build something
(or
(strategic-number sn-military-level >= 0); military situation normalized
(military-population >= 6)
)
)
(strategic-number sn-maximum-town-size < 8)
=>
(set-strategic-number sn-maximum-town-size 12); make room for buildings
)
#end-if
(defrule
(population > max-civ-pop)
(or
(unit-type-count castle-arrow > 0)
(unit-type-count castle-arrow-chemistry > 0)
)
(strategic-number sn-maximum-town-size <= 39)
=>
(set-strategic-number sn-maximum-town-size 39)
(set-strategic-number sn-sentry-distance 12)
(set-strategic-number sn-enemy-sighted-response-distance 32)
)
(defrule
(strategic-number sn-military-level >= 0)
=>
(set-strategic-number sn-sentry-distance 12)
(set-strategic-number sn-enemy-sighted-response-distance 32)
)
(defrule
(taunt-detected my-player-number 247)
=>
(up-chat-data-to-player my-player-number "Food%: %d %" s: sn-food-gatherer-percentage)
(up-chat-data-to-player my-player-number "Wood%: %d %" s: sn-wood-gatherer-percentage)
(up-chat-data-to-player my-player-number "Gold%: %d %" s: sn-gold-gatherer-percentage)
(up-chat-data-to-player my-player-number "Stone%: %d %" s: sn-stone-gatherer-percentage)
(acknowledge-taunt my-player-number 247))
(defrule
(taunt-detected my-player-number 248)
=>
(up-chat-data-to-player my-player-number "increase-town-size-goal: %d" g: increase-town-size-goal)
(up-chat-data-to-player my-player-number "sn-military-level: %d" s: sn-military-level)
(up-chat-data-to-player my-player-number "sn-resource-control: %d" s: sn-resource-control)
(up-chat-data-to-player my-player-number "sn-minimum-water-body-size-for-dock: %d" s: sn-minimum-water-body-size-for-dock)
(acknowledge-taunt my-player-number 248))
(defrule
(idle-farm-count <= 0); provisory
(wood-amount >= 295); super provisory, hopefully keeping it safe and better than nothing ; needs changes
(goal farm-goal 1); provisory
(strategic-number sn-maximum-town-size < 31)
(building-type-count farm > 8)
(up-compare-goal threat-time-goal > 30000)
=>
(set-strategic-number sn-maximum-town-size 31)
(enable-timer reset-town-size-timer 3)
)
(defrule
(goal increase-town-size-goal watch-tower)
=>
(up-jump-rule 4)
)
(defrule
(strategic-number sn-maximum-town-size < 37)
(up-compare-goal increase-town-size-goal != 2)
(goal housing-goal 1)
(building-type-count town-center >= 1)
(up-pending-objects c: house < 1)
(wood-amount >= 30)
=>
(up-modify-sn sn-maximum-town-size c:+ 2)
(up-chat-data-to-player my-player-number "build town-size = %d" s: sn-maximum-town-size)
)
(defrule
(or (and (strategic-number sn-maximum-town-size < 40)
(goal increase-town-size-goal 2))
(goal increase-town-size-goal house))
=>
(set-goal increase-town-size-goal 0); building already placed, no need to increase TS
(disable-timer increase-town-size-timer)
)
(defrule
(timer-triggered increase-town-size-timer)
(or (strategic-number sn-maximum-town-size < 37)
(strategic-number sn-minimum-water-body-size-for-dock >= water-islands))
(strategic-number sn-maximum-town-size < 57)
(up-compare-goal increase-town-size-goal != 0)
(strategic-number sn-maximum-town-size >= 7)
=>
(enable-timer increase-town-size-timer 4)
(set-goal increase-town-size-goal 0)
(up-modify-sn sn-maximum-town-size c:+ 2)
(up-chat-data-to-self "build-town-size = %d." s: sn-maximum-town-size)
)
(defrule
(current-age == dark-age)
(building-type-count town-center > 0)
(building-type-count-total mill == 0)
(strategic-number sn-mill-max-distance > 30)
(wood-amount > 300)
=>
(set-strategic-number sn-mill-max-distance 8); reduce distance in case it couldn't be built due to insufficient exploration.
)
(defrule
(strategic-number sn-minimum-civilian-explorers > 0)
(or (and (or (unit-type-count 958 > 1); livestock
(resource-found food))
(strategic-number sn-mill-max-distance < 31))
(timer-triggered civ-explore-timer))
(building-type-count town-center >= 1); -total
=>
(disable-timer civ-explore-timer)
(set-strategic-number sn-minimum-civilian-explorers 0)
(set-strategic-number sn-percent-civilian-gatherers 0)
(set-strategic-number sn-percent-civilian-builders 0)
(set-strategic-number sn-percent-civilian-explorers 0)
)
(defrule
(game-time > 600)
(building-type-count-total town-center > 0)
(building-type-count town-center == 0)
(building-type-count farm > 0)
(population < 20)
=>
(delete-building farm); delete all farms to prevent losing villagers by walking back into the old town
(delete-building farm)
(delete-building farm)
(delete-building farm)
(delete-building farm)
(delete-building farm)
(delete-building farm)
(delete-building farm)
(delete-building farm)
(delete-building farm)
(delete-building farm)
)
(defrule
(up-pending-objects c: lumber-camp < 1)
(game-time > 33)
(resource-found wood)
(building-type-count-total town-center == 0)
(or (building-type-count-total lumber-camp == 0)
(dropsite-min-distance wood > 10))
(can-build lumber-camp)
=>
(set-strategic-number sn-allow-adjacent-dropsites 0); hmm, may be better here for less blocking
(build lumber-camp)
(up-assign-builders c: lumber-camp c: 6)
(set-strategic-number sn-maximum-wood-drop-distance -1)
(set-strategic-number sn-minimum-civilian-explorers 0)
(set-strategic-number sn-percent-civilian-gatherers 0)
(set-strategic-number sn-percent-civilian-builders 100)
(set-strategic-number sn-percent-civilian-explorers 0)
)
(defrule
; (building-type-count-total town-center >= 1)
; (up-pending-objects c: town-center >= 1)
(building-type-count town-center >= 1); temporary work-around
(goal nomad yes)
=>
(release-escrow wood)
(set-escrow-percentage wood 0)
(set-goal escrow-purpose-goal 0)
(set-strategic-number sn-mill-max-distance 31)
(set-strategic-number sn-maximum-town-size 30)
(set-strategic-number sn-camp-max-distance 35)
(set-strategic-number sn-percent-civilian-explorers 0)
(set-strategic-number sn-maximum-wood-drop-distance 25)
(set-strategic-number sn-minimum-civilian-explorers 0)
(disable-self) ; part of the work-around
)
(defrule
(strategic-number sn-minimum-water-body-size-for-dock < water-islands)
(goal increase-town-size-goal 2); building placed
(strategic-number sn-maximum-town-size >= 40); TSA in action
=>
(disable-timer increase-town-size-timer)
(set-strategic-number sn-maximum-town-size 18); build close
(set-goal increase-town-size-goal 0)
(enable-timer attack-timer 1); re-enable TSA immediately
(set-goal restart-attack-goal 1)
)
(defrule
(goal restart-attack-goal 1)
(strategic-number sn-target-evaluation-ally-proximity < 1)
(strategic-number sn-number-attack-groups > 0)
(strategic-number sn-minimum-attack-group-size > 1)
(strategic-number sn-maximum-town-size < 40)
=>
(up-reset-unit c: -1)
(set-strategic-number sn-number-attack-groups 0)
(set-strategic-number sn-minimum-attack-group-size 1)
(set-goal restart-attack-goal 0)
)
(defrule
(goal restart-attack-goal 1)
(strategic-number sn-target-evaluation-ally-proximity < 1)
=>
(set-goal restart-attack-goal 0)
)
(defrule
(building-type-count-total town-center == 0)
=>
(set-strategic-number sn-camp-max-distance 480)
(set-strategic-number sn-maximum-town-size 480)
; no (set-strategic-number sn-mill-max-distance 480)
(set-strategic-number sn-maximum-food-drop-distance 30)
(set-strategic-number sn-wood-gatherer-percentage 100)
(set-strategic-number sn-food-gatherer-percentage 0)
(set-strategic-number sn-gold-gatherer-percentage 0)
(set-escrow-percentage wood 100)
(set-goal escrow-purpose-goal town-center)
)
(defrule
(taunt-detected any-computer 248)
(not (taunt-detected my-player-number 248))
=>
(up-chat-data-to-all "focus-player: %d" s: sn-focus-player-number)
(up-chat-data-to-all "target-player: %d" s: sn-target-player-number)
(up-chat-data-to-all "number of attack groups: %d" s: sn-number-attack-groups)
(up-chat-data-to-all "minimum attack group size: %d" s: sn-minimum-attack-group-size)
(up-chat-data-to-all "sentry distance: %d" s: sn-sentry-distance)
(up-chat-data-to-all "enemy sighted response distance: %d" s: sn-enemy-sighted-response-distance)
(up-chat-data-to-all "maximum town size: %d" s: sn-maximum-town-size)
(up-chat-data-to-all "increase-town-size-goal: %d" g: increase-town-size-goal)
(acknowledge-taunt this-any-computer 248)
)
(defrule
(taunt-detected my-player-number 202)
=>
(up-chat-data-to-player my-player-number "focus-player: %d" s: sn-focus-player-number)
(up-chat-data-to-player my-player-number "target-player: %d" s: sn-target-player-number)
(up-chat-data-to-player my-player-number "attack-goal: %d" g: attack-goal)
(up-chat-data-to-player my-player-number "position: %d" g: position-goal)
(up-chat-data-to-player my-player-number "sn-number-attack-groups: %d" s: sn-number-attack-groups)
(up-chat-data-to-player my-player-number "sn-maximum-town-size: %d" s: sn-maximum-town-size)
(up-chat-data-to-player my-player-number "increase-town-size-goal: %d" g: increase-town-size-goal)
(up-chat-data-to-player my-player-number "housing-goal: %d" g: housing-goal)
(acknowledge-taunt my-player-number 202))
(defrule
(taunt-detected any-ally 203)
=>
(up-chat-data-to-all "focus-player: %d" s: sn-focus-player-number)
(up-chat-data-to-all "target-player: %d" s: sn-target-player-number)
(up-chat-data-to-all "attack-goal: %d" g: attack-goal)
(up-chat-data-to-all "position: %d" g: position-goal)
(up-chat-data-to-all "sn-number-attack-groups: %d" s: sn-number-attack-groups)
(up-chat-data-to-all "sn-maximum-town-size: %d" s: sn-maximum-town-size)
(up-chat-data-to-all "increase-town-size-goal: %d" g: increase-town-size-goal)
(up-chat-data-to-all "housing-goal: %d" g: housing-goal)
(acknowledge-taunt every-ally 203))
(defrule
(taunt-detected my-player-number 204)
=>
(up-chat-data-to-player my-player-number "sn-camp-max-distance: %d" s: sn-camp-max-distance)
(up-chat-data-to-player my-player-number "sn-number-explore-groups: %d" s: sn-number-explore-groups)
(up-chat-data-to-player my-player-number "sn-total-number-explorers: %d" s: sn-total-number-explorers)
(up-chat-data-to-player my-player-number "sn-cap-civilian-explorers: %d" s: sn-cap-civilian-explorers)
(up-chat-data-to-player my-player-number "sn-percent-civilian-explorers: %d" s: sn-percent-civilian-explorers)
(up-chat-data-to-player my-player-number "sn-cap-civilian-gatherers: %d" s: sn-cap-civilian-gatherers)
(up-chat-data-to-player my-player-number "sn-percent-civilian-gatherers: %d" s: sn-percent-civilian-gatherers)
(up-chat-data-to-player my-player-number "sn-current-age: %d" s: sn-current-age)
(acknowledge-taunt my-player-number 204))
(defrule
(taunt-detected my-player-number 246)
=>
(up-chat-data-to-player my-player-number "farm-goal: %d" g: farm-goal)
(up-chat-data-to-player my-player-number "sn-minimum-attack-group-size: %d" s: sn-minimum-attack-group-size)
(up-chat-data-to-player my-player-number "sn-sentry-distance: %d" s: sn-sentry-distance)
(up-chat-data-to-player my-player-number "sn-enemy-sighted-response-distance: %d" s: sn-enemy-sighted-response-distance)
(up-chat-data-to-player my-player-number "sn-minimum-water-body-size-for-dock: %d" s: sn-minimum-water-body-size-for-dock)
(up-chat-data-to-player my-player-number "team-coordination-goal: %d" g: team-coordination-goal)
(acknowledge-taunt my-player-number 246)
)
(defrule
(taunt-detected any-ally 247)
=>
(up-chat-data-to-all "farm-goal: %d" g: farm-goal)
(up-chat-data-to-all "sn-minimum-attack-group-size: %d" s: sn-minimum-attack-group-size)
(up-chat-data-to-all "sn-sentry-distance: %d" s: sn-sentry-distance)
(up-chat-data-to-all "sn-enemy-sighted-response-distance: %d" s: sn-enemy-sighted-response-distance)
(up-chat-data-to-all "sn-minimum-water-body-size-for-dock: %d" s: sn-minimum-water-body-size-for-dock)
(up-chat-data-to-all "team-coordination-goal: %d" g: team-coordination-goal)
(acknowledge-taunt every-ally 247)
)
#load-if-not-defined TEAMS-LOCKED
#load-if-not-defined UP-2-PLAYER-GAME
(defrule
(not (stance-toward 1 ally))
(or (player-resigned 1)
(not (player-in-game 1)))
(players-military-population 1 < 2)
(players-building-type-count 1 castle < 1)
(players-building-type-count 1 watch-tower < 1)
(players-building-type-count 1 bombard-tower < 1)
(players-unit-type-count 1 monk < 1)
=>
(set-stance 1 ally)
)
(defrule
(not (stance-toward 2 ally))
(or (player-resigned 2)
(not (player-in-game 2)))
(players-military-population 2 < 2)
(players-building-type-count 2 castle < 1)
(players-building-type-count 2 watch-tower < 1)
(players-building-type-count 2 bombard-tower < 1)
(players-unit-type-count 2 monk < 1)
=>
(set-stance 2 ally)
)
(defrule
(not (stance-toward 3 ally))
(or (player-resigned 3)
(not (player-in-game 3)))
(players-military-population 3 < 2)
(players-building-type-count 3 castle < 1)
(players-building-type-count 3 watch-tower < 1)
(players-building-type-count 3 bombard-tower < 1)
(players-unit-type-count 3 monk < 1)
=>
(set-stance 3 ally)
)
(defrule
(not (stance-toward 4 ally))
(or (player-resigned 4)
(not (player-in-game 4)))
(players-military-population 4 < 2)
(players-building-type-count 4 castle < 1)
(players-building-type-count 4 watch-tower < 1)
(players-building-type-count 4 bombard-tower < 1)
(players-unit-type-count 4 monk < 1)
=>
(set-stance 4 ally)
)
(defrule
(not (stance-toward 5 ally))
(or (player-resigned 5)
(not (player-in-game 5)))
(players-military-population 5 < 2)
(players-building-type-count 5 castle < 1)
(players-building-type-count 5 watch-tower < 1)
(players-building-type-count 5 bombard-tower < 1)
(players-unit-type-count 5 monk < 1)
=>
(set-stance 5 ally)
)
(defrule
(not (stance-toward 6 ally))
(or (player-resigned 6)
(not (player-in-game 6)))
(players-military-population 6 < 2)
(players-building-type-count 6 castle < 1)
(players-building-type-count 6 watch-tower < 1)
(players-building-type-count 6 bombard-tower < 1)
(players-unit-type-count 6 monk < 1)
=>
(set-stance 6 ally)
)
(defrule
(not (stance-toward 7 ally))
(or (player-resigned 7)
(not (player-in-game 7)))
(players-military-population 7 < 2)
(players-building-type-count 7 castle < 1)
(players-building-type-count 7 watch-tower < 1)
(players-building-type-count 7 bombard-tower < 1)
(players-unit-type-count 7 monk < 1)
=>
(set-stance 7 ally)
)
(defrule
(not (stance-toward 8 ally))
(or (player-resigned 8)
(not (player-in-game 8)))
(players-military-population 8 < 2)
(players-building-type-count 8 castle < 1)
(players-building-type-count 8 watch-tower < 1)
(players-building-type-count 8 bombard-tower < 1)
(players-unit-type-count 8 monk < 1)
=>
(set-stance 8 ally)
)
(defrule
(timer-triggered tribute-timer2)
=>
(disable-timer tribute-timer2))
(defrule
(or (players-stance any-human-ally neutral)
(players-stance any-human-ally enemy))
(up-timer-status tribute-timer2 != timer-running)
(goal stanceg 0)
=>
(chat-to-player-using-id this-any-human-ally 22017); "Set thy stance to Ally with me!"
(set-stance this-any-human-ally neutral)
(enable-timer stance 20)
(set-goal stanceg 1))
(defrule
(nor (players-stance any-human-neutral ally)
(players-stance any-human-enemy ally))
(up-compare-goal request == 1)
=>
(set-goal request 0))
(defrule
(players-stance any-human-neutral ally)
(goal request 0)
(goal stanceg 0)
=>
(chat-to-player-using-id this-any-human-neutral 22004); "Send me 200 each of wood, food, gold, and stone!"
(chat-to-player-using-id this-any-human-neutral 22005); "If thou dost this thing, I shall join thy side."
(set-goal request 1))
(defrule
(players-stance any-human-enemy ally)
(goal request 0)
(goal stanceg 0)
=>
(chat-to-player-using-id this-any-human-enemy 22006); "Send me 500 each of wood, food, gold, and stone!"
(chat-to-player-using-id this-any-human-enemy 22005); "If thou dost this thing, I shall join thy side."
(set-goal request 1))
;(defrule
; (timer-triggered two-minute-timer)
; (game-time >= 300)
;; (random-number < 10); of 100
; (goal request2 1)
;=>
; (chat-to-player-using-id every-human 2304); "Alas! We could have made an unstoppable team."
; (set-goal request2 0)
; (disable-self))
(defrule
(timer-triggered two-minute-timer)
(game-time >= 300)
(not (stance-toward any-human ally))
(or (players-population any-human >= 50)
(players-population any-human >= max-civ))
(unit-type-count-total villager >= 1)
(random-number < 15); of 100
(goal request2 0)
(players-building-type-count any-human market >= 1)
=>
(chat-to-player-using-id every-human 22006); "Send me 500 each of wood, food, gold, and stone!"
(chat-to-player-using-id every-human 22005); "If thou dost this thing, I shall join thy side."
(set-goal request2 1)
(disable-self))
(defrule
(players-tribute-memory any-human-neutral wood >= 500)
(players-tribute-memory any-human-neutral food >= 500)
(players-tribute-memory any-human-neutral gold >= 500)
(players-tribute-memory any-human-neutral stone >= 500)
(goal request2 1)
=>
(clear-tribute-memory this-any-human-neutral wood)
(clear-tribute-memory this-any-human-neutral food)
(clear-tribute-memory this-any-human-neutral gold)
(clear-tribute-memory this-any-human-neutral stone)
(chat-to-player-using-id this-any-human-neutral 22002);"I am grateful for thy tribute."
(chat-to-player-using-id this-any-human-neutral 22003);"Let us be friends henceforth!"
(enable-timer tribute-timer2 10)
(set-stance this-any-human-enemy ally))
(defrule
(players-tribute-memory any-human-enemy wood >= 500)
(players-tribute-memory any-human-enemy food >= 500)
(players-tribute-memory any-human-enemy gold >= 500)
(players-tribute-memory any-human-enemy stone >= 500)
(goal request2 1)
=>
(clear-tribute-memory this-any-human-enemy wood)
(clear-tribute-memory this-any-human-enemy food)
(clear-tribute-memory this-any-human-enemy gold)
(clear-tribute-memory this-any-human-enemy stone)
(chat-to-player-using-id this-any-human-enemy 2303); "You have made a wise choice -- together we shall rule the world."
(enable-timer tribute-timer2 10)
(set-stance this-any-human-enemy ally))
(defrule
(players-tribute-memory any-human-neutral wood >= 200)
(players-tribute-memory any-human-neutral food >= 200)
(players-tribute-memory any-human-neutral gold >= 200)
(players-tribute-memory any-human-neutral stone >= 200)
(goal request 1)
=>
(clear-tribute-memory this-any-human-neutral wood)
(clear-tribute-memory this-any-human-neutral food)
(clear-tribute-memory this-any-human-neutral gold)
(clear-tribute-memory this-any-human-neutral stone)
(chat-to-player-using-id this-any-human-neutral 22002);"I am grateful for thy tribute."
(chat-to-player-using-id this-any-human-neutral 22003);"Let us be friends henceforth!"
(set-stance this-any-human-neutral ally)
(set-goal request 0))
(defrule
(players-tribute-memory any-human-enemy wood >= 500)
(players-tribute-memory any-human-enemy food >= 500)
(players-tribute-memory any-human-enemy gold >= 500)
(players-tribute-memory any-human-enemy stone >= 500)
(goal request 1)
=>
(clear-tribute-memory this-any-human-enemy wood)
(clear-tribute-memory this-any-human-enemy food)
(clear-tribute-memory this-any-human-enemy gold)
(clear-tribute-memory this-any-human-enemy stone)
(chat-to-player-using-id this-any-human-enemy 2303); "You have made a wise choice -- together we shall rule the world."
(set-stance this-any-human-enemy ally)
(set-goal request 0))
(defrule
(timer-triggered stance)
(goal stanceg 1)
(players-stance any-human-neutral ally)
=>
(chat-to-player-using-id this-any-human-neutral 2302); "It was wise to do as I requested."
(set-stance this-any-human-neutral ally)
(disable-timer stance)
(set-goal stanceg 0))
(defrule
(timer-triggered stance)
(goal stanceg 1)
(or (players-stance any-human-neutral neutral)
(players-stance any-human-neutral enemy))
=>
(chat-to-player-using-id this-any-human-neutral 2305); "You dare defy me?! Prepare to die!"
(set-stance this-any-human-neutral enemy)
(disable-timer stance)
(set-goal stanceg 0))
#end-if
#end-if
#load-if-defined UP-ALLY-IN-GAME
(defrule ; large amounts of res required so that it doesn't chat every 60 seconds
(or (players-tribute-memory any-human-ally wood >= 5001)
(or (players-tribute-memory any-human-ally food >= 5001)
(or (players-tribute-memory any-human-ally gold >= 5001)
(players-tribute-memory any-human-ally stone >= 1501))))
=>
(chat-to-player-using-id this-any-human-ally 22114); "Thanks! It will be wisely spent."
(clear-tribute-memory this-any-human-ally wood)
(clear-tribute-memory this-any-human-ally food)
(clear-tribute-memory this-any-human-ally gold)
(clear-tribute-memory this-any-human-ally stone))
(defrule
(taunt-detected any-ally 42)
(current-age == dark-age)
=>
(chat-to-player-using-id this-any-ally 22165)
(acknowledge-taunt this-any-ally 42)
)
(defrule
(taunt-detected any-ally 42)
(current-age == feudal-age)
=>
(chat-to-player-using-id this-any-ally 22166)
(acknowledge-taunt this-any-ally 42)
)
(defrule
(taunt-detected any-ally 42)
(current-age == castle-age)
=>
(chat-to-player-using-id this-any-ally 22167)
(acknowledge-taunt this-any-ally 42)
)
(defrule
(taunt-detected any-ally 42)
(current-age == imperial-age)
=>
(chat-to-player-using-id this-any-ally 22168)
(acknowledge-taunt this-any-ally 42)
)
#end-if
(defrule
(taunt-detected any-human-enemy 250)
=>
(chat-to-player this-any-human-enemy "The official HD AI - created by Archon and Promiskuitiv.")
(acknowledge-taunt this-any-human-enemy 250))
(defrule
(or (taunt-detected any-computer 250)
(taunt-detected any-human 250))
=>
(chat-to-player this-any-computer "The official HD AI - created by Archon and Promiskuitiv.")
(chat-to-player this-any-human "The official HD AI - created by Archon and Promiskuitiv."))
(defrule
(or (taunt-detected any-computer 250)
(taunt-detected any-human 250))
(goal strategy-goal sling)
=>
(chat-to-player this-any-computer "I am slinging.")
(chat-to-player this-any-human-ally "I am slinging.")
(acknowledge-taunt any-computer 250)
(acknowledge-taunt any-human-ally 250))
(defrule
(or (taunt-detected any-computer 250)
(taunt-detected any-human 250))
(goal control-goal shot)
=>
(chat-to-player this-any-computer "I am the shot.")
(chat-to-player this-any-human-ally "I am the shot."))
(defrule
(or (taunt-detected any-computer 250)
(taunt-detected any-human 250))
(goal strategy-goal rush)
=>
(chat-to-player this-any-computer "I'm going for a fast castle age.")
(chat-to-player this-any-human-ally "I'm going for a fast castle age."))
(defrule
(or (taunt-detected any-computer 250)
(taunt-detected any-human 250))
(goal strategy-goal flush)
=>
(chat-to-player this-any-computer "I'm going train an army in the feudal age.")
(chat-to-player this-any-human-ally "I'm going train an army in the feudal age."))
(defrule
(or (taunt-detected any-computer 250)
(taunt-detected any-human 250))
(goal strategy-goal fast-imp)
=>
(chat-to-player this-any-computer "I'm going for a fast imperial age.")
(chat-to-player this-any-human-ally "I'm going for a fast imperial age."))
(defrule
(or (taunt-detected any-computer 250)
(taunt-detected any-human 250))
(goal strategy-goal boom)
=>
(chat-to-player this-any-computer "I will boom.")
(chat-to-player this-any-human-ally "I will boom."))
(defrule
(or (taunt-detected any-computer 250)
(taunt-detected any-human 250))
(goal unit-goal monk)
=>
(chat-to-player this-any-computer "I'll focus on monks.")
(chat-to-player this-any-human-ally "I'll focus on monks.")
(acknowledge-taunt any-computer 250)
(acknowledge-taunt any-human-ally 250))
(defrule
(or (taunt-detected any-computer 250)
(taunt-detected any-human 250))
(goal unit-goal eagle-warrior)
=>
(chat-to-player this-any-computer "I'll focus on eagle warriors.")
(chat-to-player this-any-human-ally "I'll focus on eagle warriors.")
(acknowledge-taunt any-computer 250)
(acknowledge-taunt any-human-ally 250))
(defrule
(or (taunt-detected any-computer 250)
(taunt-detected any-human 250))
(or (civ-selected byzantine)
(civ-selected indian))
(goal unit-goal knight)
=>
(chat-to-player this-any-computer "I'll focus on camels.")
(chat-to-player this-any-human-ally "I'll focus on camels.")
(acknowledge-taunt any-computer 250)
(acknowledge-taunt any-human-ally 250))
(defrule
(or (taunt-detected any-computer 250)
(taunt-detected any-human 250))
(goal unit-goal knight)
=>
(chat-to-player this-any-computer "I'll focus on knights.")
(chat-to-player this-any-human-ally "I'll focus on knights.")
(acknowledge-taunt any-computer 250)
(acknowledge-taunt any-human-ally 250))
(defrule
(or (taunt-detected any-computer 250)
(taunt-detected any-human 250))
(goal unit-goal archer)
=>
(chat-to-player this-any-computer "I'll focus on archers.")
(chat-to-player this-any-human-ally "I'll focus on archers.")
(acknowledge-taunt any-computer 250)
(acknowledge-taunt any-human-ally 250))
(defrule
(or (taunt-detected any-computer 250)
(taunt-detected any-human 250))
(goal unit-goal cavalry-archer)
=>
(chat-to-player this-any-computer "I'll focus on cavalry archers.")
(chat-to-player this-any-human-ally "I'll focus on cavalry archers.")
(acknowledge-taunt any-computer 250)
(acknowledge-taunt any-human-ally 250))
(defrule
(or (taunt-detected any-computer 250)
(taunt-detected any-human 250))
(goal unit-goal skirmisher)
=>
(chat-to-player this-any-computer "I'll focus on trash units.")
(chat-to-player this-any-human-ally "I'll focus on trash units.")
(acknowledge-taunt any-computer 250)
(acknowledge-taunt any-human-ally 250))
(defrule
(or (taunt-detected any-computer 250)
(taunt-detected any-human 250))
(goal unit-goal militiaman-line)
=>
(chat-to-player this-any-computer "I'll focus on infantry.")
(chat-to-player this-any-human-ally "I'll focus on infantry.")
(acknowledge-taunt any-computer 250)
(acknowledge-taunt any-human-ally 250))
(defrule
(or (taunt-detected any-computer 250)
(taunt-detected any-human 250))
(goal unit-goal my-unique-unit-line)
=>
(chat-to-player this-any-computer "I'll focus on unique units.")
(chat-to-player this-any-human-ally "I'll focus on unique units.")
(acknowledge-taunt any-computer 250)
(acknowledge-taunt any-human-ally 250))
(defrule
(or (taunt-detected any-computer 250)
(taunt-detected any-human 250))
(goal unit-goal scout-cavalry)
=>
(chat-to-player this-any-computer "I'll focus on scouts.")
(chat-to-player this-any-human-ally "I'll focus on scouts.")
(acknowledge-taunt any-computer 250)
(acknowledge-taunt any-human-ally 250))
(defrule
(or (taunt-detected any-computer 250)
(taunt-detected any-human 250))
(goal unit-goal gunpowder-class)
=>
(chat-to-player this-any-computer "I'll focus on guns.")
(chat-to-player this-any-human-ally "I'll focus on guns.")
(acknowledge-taunt any-computer 250)
(acknowledge-taunt any-human-ally 250))
(defrule
(or (taunt-detected any-computer 250)
(taunt-detected any-human 250))
(goal unit-goal scorpion)
=>
(chat-to-player this-any-computer "I'll focus scorpions.")
(chat-to-player this-any-human-ally "I'll focus scorpions.")
(acknowledge-taunt any-computer 250)
(acknowledge-taunt any-human-ally 250))
(defrule
(or (taunt-detected any-computer 250)
(taunt-detected any-human 250))
=>
(chat-to-player this-any-computer "I'm not focussing on any particular unit.")
(chat-to-player this-any-human-ally "I'm not focussing on any particular unit.")
(acknowledge-taunt any-computer 250)
(acknowledge-taunt any-human-ally 250))
(defrule
(taunt-detected any-human 250)
=>
(acknowledge-taunt any-human 250))
#load-if-defined DARK-AGE-START
(defrule
(players-current-age focus-player == dark-age)
(players-military-population focus-player > 1)
(game-time < 720)
(unit-type-count-total militiaman-line < 4)
(military-population < 5); no weird scenario
(can-train militiaman-line)
=>
(train militiaman-line)
)
#end-if
#load-if-defined UP-SCENARIO-GAME
(defrule
(true)
=>
(chat-to-player my-player-number "100")
(disable-self))
#end-if
(defrule
(or (taunt-detected any-human 101)
(taunt-detected my-player-number 101))
=>
(acknowledge-taunt every-human 100)
(acknowledge-taunt my-player-number 100)
(acknowledge-taunt every-human 101)
(acknowledge-taunt my-player-number 101))
(defrule
(or (taunt-detected any-human 100)
(taunt-detected my-player-number 100))
=>
(up-jump-rule 11))
(defrule
(or (and (population >= max-civ)
(population >= 4))
(or (military-population >= 25); test
(or (up-timer-status resign-timer >= timer-running)
(or (game-time < 600)
(or (hold-relics)
(or (building-type-count wonder >= 1)
(players-building-type-count any-ally wonder >= 1)))))))
=>
(up-jump-rule 10))
(defrule
(or (player-in-game any-human-enemy)
(not (player-in-game any-human-ally)))
(strategic-number sn-military-level <= -1); -3
(population < 50)
(nand (player-in-game any-ally)
(players-population any-ally >= 75))
(players-population any-enemy >= 175)
=>
(enable-timer resign-timer 4)
(disable-self))
(defrule
(strategic-number sn-military-level <= -1); -3
(or (nand (player-in-game any-ally)
(players-population any-ally >= 75))
(not (player-in-game any-ally)))
(unit-type-count-total villager < 1)
(unit-type-count-total monk < 1)
(building-type-count town-center < 1)
(building-type-count monastery < 1)
=>
(enable-timer resign-timer 4)
(disable-self))
(defrule
(or (player-in-game any-human-enemy)
(and (population <= 1); scout
(housing-headroom <= 0)))
(unit-type-count-total villager < 1)
(unit-type-count-total monk < 1)
(building-type-count market < 1)
(building-type-count dock < 1)
(building-type-count town-center < 1)
(building-type-count monastery < 1)
=>
(enable-timer resign-timer 4)
(disable-self))
(defrule
; (player-in-game any-human-enemy)
(strategic-number sn-military-level <= -1); -3
(or (nand (player-in-game any-ally)
(players-population any-ally >= 60))
(not (player-in-game any-ally)))
; (building-type-count town-center < 1)
(population < 5)
(players-population any-enemy >= 60)
;(not (player-in-game every-ally))
=>
(enable-timer resign-timer 4)
(disable-self))
(defrule
; (player-in-game any-human-enemy)
(strategic-number sn-military-level <= -1); -3
(or (nand (player-in-game any-ally)
(players-population any-ally >= 75))
(not (player-in-game any-ally)))
; (building-type-count town-center < 1)
(population < 10)
(players-population any-enemy >= 90)
;(not (player-in-game every-ally))
=>
(enable-timer resign-timer 4)
(disable-self))
(defrule
; (player-in-game any-human-enemy)
(strategic-number sn-military-level <= -1); -3
(or (nand (player-in-game any-ally)
(players-population any-ally >= 75))
(not (player-in-game any-ally)))
; (building-type-count town-center < 1)
(population < 22)
(players-population any-enemy >= 120)
;(not (player-in-game every-ally))
=>
(enable-timer resign-timer 4)
(disable-self))
(defrule
(player-in-game any-human-enemy)
(strategic-number sn-military-level <= -1); -3
(or (nand (player-in-game any-ally)
(players-population any-ally >= 75))
(not (player-in-game any-ally)))
; (building-type-count town-center < 1)
(population < 35); potentially more in the rule below
(players-population any-enemy >= 150)
;(not (player-in-game every-ally))
=>
(enable-timer resign-timer 4)
(disable-self))
(defrule
(player-in-game any-human-enemy)
(strategic-number sn-military-level <= -1); -3
(or (nand (player-in-game any-ally)
(players-population any-ally >= fourty-percent-pop))
(not (player-in-game any-ally)))
; (building-type-count town-center < 1)
(population < 60)
(population < twenty-five-percent-pop)
(players-population any-enemy > eighty-five-percent-pop)
;(not (player-in-game every-ally))
=>
(enable-timer resign-timer 4)
(disable-self))
(defrule
(or (population >= max-civ)
(or (player-in-game any-human-ally)
(player-in-game every-ally))); also got other resign rules
=>
(up-jump-rule 1))
(defrule
(player-in-game any-human-enemy)
; (goal Multiplayer yes)
(strategic-number sn-military-level <= -1); -3
(or (nand (player-in-game any-ally)
(players-population any-ally >= 80))
(not (player-in-game any-ally)))
(population < 60)
(or (population < 50)
(player-resigned any-ally))
(players-population any-enemy >= 175)
; j(not (player-in-game every-ally))
=>
(enable-timer resign-timer 4)
(disable-self))
(defrule
(up-timer-status resign-timer >= timer-running)
=>
(chat-to-all-using-range 22300 22)
(chat-to-all-using-id 22322)
(disable-self))
(defrule
(timer-triggered resign-timer)
(player-in-game any-ally)
=>
(tribute-to-player this-any-ally wood 99999)
(tribute-to-player this-any-ally food 99999)
(tribute-to-player this-any-ally gold 99999)
(tribute-to-player this-any-ally stone 99999)
(resign))
(defrule
(timer-triggered resign-timer)
(not (player-in-game any-ally))
=>
(resign))
#load-if-not-defined DIFFICULTY-HARDEST
#load-if-not-defined DIFFICULTY-HARD
#load-if-not-defined DIFFICULTY-MODERATE
(defrule
(up-timer-status resign-timer >= timer-running)
(or (building-type-count watch-tower >= 1)
(or (building-type-count guard-tower >= 1)
(or (building-type-count keep >= 1)
(or (building-type-count bombard-tower >= 1)
(building-type-count castle >= 1)))))
=>
(delete-building watch-tower)
(delete-building guard-tower)
(delete-building keep)
(delete-building bombard-tower)
(delete-building castle))
#end-if
#end-if
#end-if
(defrule
(timer-triggered tensec)
=>
(disable-timer tensec)
(enable-timer tensec 10))
(defrule
(timer-triggered thirty)
=>
(disable-timer thirty)
(enable-timer thirty 30))
(defrule
(timer-triggered two-minute-timer)
=>
(disable-timer two-minute-timer)
(enable-timer two-minute-timer 120))
(defrule
(timer-triggered one-minute-timer)
=>
(disable-timer one-minute-timer)
(set-strategic-number sn-food-modifier-percentage 0)
(set-strategic-number sn-wood-modifier-percentage 0)
(set-strategic-number sn-gold-modifier-percentage 0)
(set-strategic-number sn-stone-modifier-percentage 0)
(enable-timer one-minute-timer 60))
(defrule
(taunt-detected any-computer 247)
=>
(up-chat-data-to-all "Food%: %d %" s: sn-food-gatherer-percentage)
(up-chat-data-to-all "Wood%: %d %" s: sn-wood-gatherer-percentage)
(up-chat-data-to-all "Gold%: %d %" s: sn-gold-gatherer-percentage)
(up-chat-data-to-all "Stone%: %d %" s: sn-stone-gatherer-percentage)
(acknowledge-taunt this-any-computer 247)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment