Index: binaries/data/mods/public/simulation/ai/petra/attackPlan.js =================================================================== --- binaries/data/mods/public/simulation/ai/petra/attackPlan.js +++ binaries/data/mods/public/simulation/ai/petra/attackPlan.js @@ -119,7 +119,7 @@ priority = 250; this.unitStat.Infantry = { "priority": 1, "minSize": 10, "targetSize": 20, "batchSize": 2, "classes": ["Infantry"], "interests": [["strength", 1], ["costsResource", 0.5, "stone"], ["costsResource", 0.6, "metal"]] }; - this.unitStat.Cavalry = { "priority": 1, "minSize": 2, "targetSize": 4, "batchSize": 2, "classes": ["Cavalry", "CitizenSoldier"], + this.unitStat.Mounted = { "priority": 1, "minSize": 2, "targetSize": 4, "batchSize": 2, "classes": ["Mounted", "CitizenSoldier"], "interests": [["strength", 1]] }; if (data && data.targetSize) this.unitStat.Infantry.targetSize = data.targetSize; @@ -128,7 +128,7 @@ else if (type == "Raid") { priority = 150; - this.unitStat.Cavalry = { "priority": 1, "minSize": 3, "targetSize": 4, "batchSize": 2, "classes": ["Cavalry", "CitizenSoldier"], + this.unitStat.Mounted = { "priority": 1, "minSize": 3, "targetSize": 4, "batchSize": 2, "classes": ["Mounted", "CitizenSoldier"], "interests": [ ["strength", 1] ] }; this.neededShips = 1; } @@ -144,13 +144,13 @@ "interests": [["strength", 3]] }; this.unitStat.ChampMeleeInfantry = { "priority": 1, "minSize": 3, "targetSize": 18, "batchSize": 3, "classes": ["Infantry", "Melee", "Champion"], "interests": [["strength", 3]] }; - this.unitStat.RangedCavalry = { "priority": 0.7, "minSize": 4, "targetSize": 20, "batchSize": 4, "classes": ["Cavalry", "Ranged", "CitizenSoldier"], + this.unitStat.RangedMounted = { "priority": 0.7, "minSize": 4, "targetSize": 20, "batchSize": 4, "classes": ["Mounted", "Ranged", "CitizenSoldier"], "interests": [["strength", 2]] }; - this.unitStat.MeleeCavalry = { "priority": 0.7, "minSize": 4, "targetSize": 20, "batchSize": 4, "classes": ["Cavalry", "Melee", "CitizenSoldier"], + this.unitStat.MeleeMounted = { "priority": 0.7, "minSize": 4, "targetSize": 20, "batchSize": 4, "classes": ["Mounted", "Melee", "CitizenSoldier"], "interests": [["strength", 2]] }; - this.unitStat.ChampRangedCavalry = { "priority": 1, "minSize": 3, "targetSize": 15, "batchSize": 3, "classes": ["Cavalry", "Ranged", "Champion"], + this.unitStat.ChampRangedMounted = { "priority": 1, "minSize": 3, "targetSize": 15, "batchSize": 3, "classes": ["Mounted", "Ranged", "Champion"], "interests": [["strength", 3]] }; - this.unitStat.ChampMeleeCavalry = { "priority": 1, "minSize": 3, "targetSize": 15, "batchSize": 3, "classes": ["Cavalry", "Melee", "Champion"], + this.unitStat.ChampMeleeMounted = { "priority": 1, "minSize": 3, "targetSize": 15, "batchSize": 3, "classes": ["Mounted", "Melee", "Champion"], "interests": [["strength", 2]] }; this.unitStat.Hero = { "priority": 1, "minSize": 0, "targetSize": 1, "batchSize": 1, "classes": ["Hero"], "interests": [["strength", 2]] }; @@ -163,7 +163,7 @@ "interests": [["canGather", 1], ["strength", 1.6], ["costsResource", 0.3, "stone"], ["costsResource", 0.3, "metal"]] }; this.unitStat.MeleeInfantry = { "priority": 1, "minSize": 6, "targetSize": 16, "batchSize": 3, "classes": ["Infantry", "Melee"], "interests": [["canGather", 1], ["strength", 1.6], ["costsResource", 0.3, "stone"], ["costsResource", 0.3, "metal"]] }; - this.unitStat.Cavalry = { "priority": 1, "minSize": 2, "targetSize": 6, "batchSize": 2, "classes": ["Cavalry", "CitizenSoldier"], + this.unitStat.Mounted = { "priority": 1, "minSize": 2, "targetSize": 6, "batchSize": 2, "classes": ["Mounted", "CitizenSoldier"], "interests": [["strength", 1]] }; this.neededShips = 3; } @@ -669,11 +669,11 @@ if (this.type == "Raid") { - // Raid are fast cavalry attack: assign all cav except some for hunting + // Raid are fast attack: assign all mounted units except some for hunting let num = 0; for (let ent of gameState.getOwnUnits().values()) { - if (!ent.hasClass("Cavalry") || !this.isAvailableUnit(gameState, ent)) + if (!ent.hasClass("Mounted") || !this.isAvailableUnit(gameState, ent)) continue; if (num++ < 2) continue; @@ -756,7 +756,7 @@ { if (!ent.position() || ent.getMetadata(PlayerID, "transport") !== undefined) continue; - if (!ent.hasClass("Cavalry") || !ent.hasClass("CitizenSoldier")) + if (!ent.hasClass("Mounted") || !ent.hasClass("CitizenSoldier")) continue; let raid = gameState.ai.HQ.attackManager.getAttackInPreparation("Raid"); ent.setMetadata(PlayerID, "plan", raid.name); @@ -1507,7 +1507,7 @@ maybeUpdate = true; else if (attackedByStructure[ent.id()] && target.hasClass("Field")) maybeUpdate = true; - else if (!ent.hasClass("Cavalry") && !ent.hasClass("Ranged") && + else if (!ent.hasClass("Mounted") && !ent.hasClass("Ranged") && target.hasClass("FemaleCitizen") && target.unitAIState().split(".")[1] == "FLEEING") maybeUpdate = true; } @@ -1536,7 +1536,7 @@ } else if (attackTypes && attackTypes.indexOf("Ranged") !== -1) range = 30 + ent.attackRange("Ranged").max; - else if (ent.hasClass("Cavalry")) + else if (ent.hasClass("Mounted")) range += 30; range = range * range; let entAccess = PETRA.getLandAccess(gameState, ent); @@ -1594,7 +1594,7 @@ } else { - let nearby = !ent.hasClass("Cavalry") && !ent.hasClass("Ranged"); + let nearby = !ent.hasClass("Mounted") && !ent.hasClass("Ranged"); let mUnit = enemyUnits.filter(enemy => { if (!enemy.position()) return false; Index: binaries/data/mods/public/simulation/ai/petra/baseManager.js =================================================================== --- binaries/data/mods/public/simulation/ai/petra/baseManager.js +++ binaries/data/mods/public/simulation/ai/petra/baseManager.js @@ -648,7 +648,7 @@ } } } - else if (ent.hasClass("Cavalry")) + else if (ent.hasClass("Mounted")) ent.setMetadata(PlayerID, "subrole", "hunter"); else if (ent.hasClass("FishingBoat")) ent.setMetadata(PlayerID, "subrole", "fisher"); Index: binaries/data/mods/public/simulation/ai/petra/startingStrategy.js =================================================================== --- binaries/data/mods/public/simulation/ai/petra/startingStrategy.js +++ binaries/data/mods/public/simulation/ai/petra/startingStrategy.js @@ -306,7 +306,7 @@ { if (!ent.hasClass("Worker") && !(ent.hasClass("Support") && ent.hasClass("Elephant"))) continue; - if (ent.hasClass("Cavalry")) + if (ent.hasClass("Mounted")) continue; let pos = ent.position(); if (!pos) Index: binaries/data/mods/public/simulation/ai/petra/worker.js =================================================================== --- binaries/data/mods/public/simulation/ai/petra/worker.js +++ binaries/data/mods/public/simulation/ai/petra/worker.js @@ -112,7 +112,7 @@ } else if (!gameState.isPlayerAlly(territoryOwner)) { - let distanceSquare = ent.hasClass("Cavalry") ? 90000 : 30000; + let distanceSquare = ent.hasClass("Mounted") ? 90000 : 30000; let targetAccess = PETRA.getLandAccess(gameState, target); let foodDropsites = gameState.playerData.hasSharedDropsites ? gameState.getAnyDropsites("food") : gameState.getOwnDropsites("food"); @@ -744,7 +744,7 @@ let nearestSupplyDist = Math.min(); let nearestSupply; - let isCavalry = this.ent.hasClass("Cavalry"); + let isMounted = this.ent.hasClass("Mounted"); let isRanged = this.ent.hasClass("Ranged"); let entPosition = position ? position : this.ent.position(); let foodDropsites = gameState.playerData.hasSharedDropsites ? @@ -784,41 +784,41 @@ if (PETRA.IsSupplyFull(gameState, supply)) continue; - // check if available resource is worth one additionnal gatherer (except for farms) + // Check if available resource is worth one additionnal gatherer (except for farms). let nbGatherers = supply.resourceSupplyNumGatherers() + gameState.ai.HQ.GetTCGatherer(supply.id()); if (nbGatherers > 0 && supply.resourceSupplyAmount()/(1+nbGatherers) < 30) continue; let canFlee = !supply.hasClass("Domestic") && supply.templateName().indexOf("resource|") == -1; - // Only cavalry and range units should hunt fleeing animals - if (canFlee && !isCavalry && !isRanged) + // Only mounted or ranged units should hunt fleeing animals. + if (canFlee && !isMounted && !isRanged) continue; let supplyAccess = PETRA.getLandAccess(gameState, supply); if (supplyAccess != this.entAccess) continue; - // measure the distance to the resource + // Measure the distance to the resource. let dist = API3.SquareVectorDistance(entPosition, supply.position()); if (dist > nearestSupplyDist) continue; - // Only cavalry should hunt faraway - if (!isCavalry && dist > 25000) + // Only mounted units should hunt far away. + if (!isMounted && dist > 25000) continue; - // Avoid ennemy territory + // Avoid ennemy territory. let territoryOwner = gameState.ai.HQ.territoryMap.getOwner(supply.position()); - if (territoryOwner != 0 && !gameState.isPlayerAlly(territoryOwner)) // player is its own ally + if (territoryOwner != 0 && !gameState.isPlayerAlly(territoryOwner)) // Player is its own ally. continue; - // And if in ally territory, don't hunt this ally's cattle + // And if in ally territory, don't hunt this ally's cattle. if (territoryOwner != 0 && territoryOwner != PlayerID && supply.owner() == territoryOwner) continue; - // Only cavalry should hunt far from dropsite (specially for non domestic animals which flee) - if (!isCavalry && canFlee && territoryOwner == 0) + // Only mounted units should hunt far from dropsite (especially for non-domestic animals, which can flee). + if (!isMounted && canFlee && territoryOwner == 0) continue; - let distanceSquare = isCavalry ? 35000 : (canFlee ? 7000 : 12000); + let distanceSquare = isMounted ? 35000 : (canFlee ? 7000 : 12000); if (!hasFoodDropsiteWithinDistance(supply.position(), supplyAccess, distanceSquare)) continue; Index: binaries/data/mods/public/simulation/components/Identity.js =================================================================== --- binaries/data/mods/public/simulation/components/Identity.js +++ binaries/data/mods/public/simulation/components/Identity.js @@ -57,7 +57,7 @@ "" + "" + "" + - "" + + "" + "" + "tokens" + "" + Index: binaries/data/mods/public/simulation/templates/template_unit_cavalry.xml =================================================================== --- binaries/data/mods/public/simulation/templates/template_unit_cavalry.xml +++ binaries/data/mods/public/simulation/templates/template_unit_cavalry.xml @@ -36,7 +36,7 @@ 160 - Human CitizenSoldier + Human CitizenSoldier Mounted Citizen Soldier Cavalry Cavalry Basic Index: binaries/data/mods/public/simulation/templates/template_unit_champion_cavalry.xml =================================================================== --- binaries/data/mods/public/simulation/templates/template_unit_champion_cavalry.xml +++ binaries/data/mods/public/simulation/templates/template_unit_champion_cavalry.xml @@ -23,6 +23,7 @@ 240 + Mounted Cavalry Champion Cavalry Index: binaries/data/mods/public/simulation/templates/template_unit_champion_elephant.xml =================================================================== --- binaries/data/mods/public/simulation/templates/template_unit_champion_elephant.xml +++ binaries/data/mods/public/simulation/templates/template_unit_champion_elephant.xml @@ -23,6 +23,7 @@ 750 + Mounted Elephant War Elephant gaia/fauna_elephant.png Index: binaries/data/mods/public/simulation/templates/template_unit_dog.xml =================================================================== --- binaries/data/mods/public/simulation/templates/template_unit_dog.xml +++ binaries/data/mods/public/simulation/templates/template_unit_dog.xml @@ -36,7 +36,7 @@ 90 - Human + Human Mounted Dog Melee War Dog Basic Index: binaries/data/mods/public/simulation/templates/template_unit_hero_cavalry.xml =================================================================== --- binaries/data/mods/public/simulation/templates/template_unit_hero_cavalry.xml +++ binaries/data/mods/public/simulation/templates/template_unit_hero_cavalry.xml @@ -21,6 +21,7 @@ 1500 + Mounted Cavalry Hero Cavalry Index: binaries/data/mods/public/simulation/templates/template_unit_hero_elephant_melee.xml =================================================================== --- binaries/data/mods/public/simulation/templates/template_unit_hero_elephant_melee.xml +++ binaries/data/mods/public/simulation/templates/template_unit_hero_elephant_melee.xml @@ -34,6 +34,7 @@ 2000 + Mounted Elephant Melee