//============================================================================== /* C:\work\Spartan\main\age4\age4-dev\age4w\ai\CORE\Age2_EconBoom_Hardcore.xs This file is auto-generated. Edits will be lost when the file is regenerated. */ //============================================================================== include "aiHeader.xs"; // Gets global vars, function forward declarations include "aiUtil.xs"; // Misc. shared AI utility functions include "aiEcon.xs"; // All of the AI's econ functionality include "aiMilitary.xs"; // All of the AI's military functionality include "aiNavy.xs"; // All of the AI's naval functionality include "aiEventHandlers.xs"; // Event handler methods for the AI include "aiMain.xs"; // The bulk of the AI extern int palintononQuery = -1; extern int villagerQuery = -1; rule makePalintononsAttack active minInterval 3 { kbLookAtAllUnitsOnMap(); if(palintononQuery == -1) { palintononQuery = kbUnitQueryCreate("Palintonon Query"); kbUnitQuerySetPlayerID(palintononQuery, cMyID); kbUnitQuerySetUnitType(palintononQuery, cUnitTypeUnitTypeSiegeTrebuchet1); kbUnitQuerySetState(palintononQuery, cUnitStateAlive); } if(villagerQuery == -1) { villagerQuery = kbUnitQueryCreate("Villager Query"); kbUnitQuerySetPlayerID(villagerQuery, 1); kbUnitQuerySetUnitType(villagerQuery, cUnitTypeUnitTypeVillager1); kbUnitQuerySetState(villagerQuery, cUnitStateAlive); kbUnitQuerySetSeeableOnly(villagerQuery, false); } kbUnitQueryResetResults(palintononQuery); int palCount = kbUnitQueryExecute(palintononQuery); kbUnitQueryResetResults(villagerQuery); int vilCount = kbUnitQueryExecute(villagerQuery); aiEcho("PALINTONON COUNT " + palCount); aiEcho("VILLAGER COUNT " + vilCount); if(palCount < 1 || vilCount < 1) return; for(i = 0; < palCount) { // get the first one int ID = kbUnitQueryGetResult(palintononQuery, i); aiTaskUnitWork(ID, kbUnitQueryGetResult(villagerQuery, i / vilCount)); } } //============================================================================== /* preInit() This function is called in main() before any of the normal initialization happens. Use it to override default values of variables as needed for personality or scenario effects. */ //============================================================================== void preInit(void) { aiEcho("preInit() starting."); btRushBoom = 1; btTargetAge1ArmyCount = 6; btTargetAge2ArmyCount = 7; btTargetAge3ArmyCount = 8; btTargetAge4ArmyCount = 10; btAttackGroups = 2; btMilitaryCap = 30; cvNumTowers = 0; btTargetAge1VilCount = 15; btTargetAge4VilCount = 64; cvMaxAge = 2 - 1; gAttackMissionInterval = 140 * 1000; gDefendMissionInterval = 10 * 1000; btBiasInf = aiGetInfantryBias(); btBiasCav = aiGetCavalryBias(); btBiasArcher = aiGetArcherBias(); btBiasArt = aiGetSiegeBias(); btBaselineHandicap = aiGetEconHandicap() + 1; // We add one since the tool's range is -1 to 1, and we use the value as a multiplier. btBiasNavy = aiGetNavyBias(); btRevealEnemyBases = aiGetOKToAutoReveal(); cvOkToAttack = aiGetOKToAttack(); cvOkToTrainArmy = aiGetOKToTrainArmy(); cvOkToTrainNavy = aiGetOKToTrainNavy(); cvOkToFish = aiGetOKToFish(); cvOkToResign = aiGetOKToResign(); cvOkToExplore = aiGetOKToScout(); cvOKToResearchEcon = aiGetOKToResearchEcon(); cvOKToResearchMilitary = aiGetOKToResearchMilitary(); } //============================================================================== /* postInit() This function is called in main() after the normal initialization is complete. Use it to override settings and decisions made by the startup logic. */ //============================================================================== void postInit(void) { aiEcho("postInit() starting."); }