Index: ps/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js =================================================================== --- ps/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js +++ ps/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js @@ -355,7 +355,7 @@ return false; let civ = gameState.getPlayerCiv(); - let classes = [[ "Siege", "Melee"], ["Siege", "Ranged"], ["Elephant", "Melee", "Champion"]]; + let classes = [["Siege", "Melee"], ["Siege", "Ranged"], ["Elephant", "Melee"]]; let hasTrainer = [false, false, false]; for (let ent of gameState.getOwnTrainingFacilities().values()) { Index: ps/trunk/binaries/data/mods/public/simulation/ai/petra/baseManager.js =================================================================== --- ps/trunk/binaries/data/mods/public/simulation/ai/petra/baseManager.js +++ ps/trunk/binaries/data/mods/public/simulation/ai/petra/baseManager.js @@ -82,7 +82,7 @@ this.units.updateEnt(ent); this.workers.updateEnt(ent); this.buildings.updateEnt(ent); - if (ent.resourceDropsiteTypes() && !ent.hasClass("Elephant")) + if (ent.resourceDropsiteTypes() && !ent.hasClass("Unit")) this.assignResourceToDropsite(gameState, ent); }; @@ -512,8 +512,6 @@ { if (ent.hasClass("Worker") || ent.hasClass("CitizenSoldier") || ent.hasClass("FishingBoat")) ent.setMetadata(PlayerID, "role", "worker"); - else if (ent.hasClass("Support") && ent.hasClass("Elephant")) - ent.setMetadata(PlayerID, "role", "worker"); } }; @@ -618,12 +616,6 @@ // Check that the worker isn't garrisoned if (!ent.position()) continue; - // Support elephant can only be builders - if (ent.hasClass("Support") && ent.hasClass("Elephant")) - { - ent.setMetadata(PlayerID, "subrole", "idle"); - continue; - } if (ent.hasClass("Worker")) { @@ -848,15 +840,10 @@ let time = target.buildTime(); nonBuilderWorkers.sort((workerA, workerB) => { let coeffA = API3.SquareVectorDistance(target.position(), workerA.position()); - // elephant moves slowly, so when far away they are only useful if build time is long - if (workerA.hasClass("Elephant")) - coeffA *= 0.5 * (1 + Math.sqrt(coeffA)/5/time); - else if (workerA.getMetadata(PlayerID, "gather-type") == "food") + if (workerA.getMetadata(PlayerID, "gather-type") == "food") coeffA *= 3; let coeffB = API3.SquareVectorDistance(target.position(), workerB.position()); - if (workerB.hasClass("Elephant")) - coeffB *= 0.5 * (1 + Math.sqrt(coeffB)/5/time); - else if (workerB.getMetadata(PlayerID, "gather-type") == "food") + if (workerB.getMetadata(PlayerID, "gather-type") == "food") coeffB *= 3; return coeffA - coeffB; }); Index: ps/trunk/binaries/data/mods/public/simulation/ai/petra/entityExtend.js =================================================================== --- ps/trunk/binaries/data/mods/public/simulation/ai/petra/entityExtend.js +++ ps/trunk/binaries/data/mods/public/simulation/ai/petra/entityExtend.js @@ -1,7 +1,7 @@ /** returns true if this unit should be considered as a siege unit */ PETRA.isSiegeUnit = function(ent) { - return ent.hasClass("Siege") || ent.hasClass("Elephant") && ent.hasClass("Melee") && ent.hasClass("Champion"); + return ent.hasClass("Siege") || ent.hasClass("Elephant") && ent.hasClass("Melee"); }; /** returns true if this unit should be considered as "fast". */ Index: ps/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js =================================================================== --- ps/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js +++ ps/trunk/binaries/data/mods/public/simulation/ai/petra/headquarters.js @@ -950,7 +950,7 @@ halfSize = +template.get("Footprint/Circle/@radius"); let ccEnts = gameState.updatingGlobalCollection("allCCs", API3.Filters.byClass("CivCentre")); - let dpEnts = gameState.getOwnDropsites().filter(API3.Filters.not(API3.Filters.byClassesOr(["CivCentre", "Elephant"]))); + let dpEnts = gameState.getOwnDropsites().filter(API3.Filters.not(API3.Filters.byClassesOr(["CivCentre", "Unit"]))); let ccList = []; for (let cc of ccEnts.values()) ccList.push({ "ent": cc, "pos": cc.position(), "ally": gameState.isPlayerAlly(cc.owner()) }); Index: ps/trunk/binaries/data/mods/public/simulation/ai/petra/startingStrategy.js =================================================================== --- ps/trunk/binaries/data/mods/public/simulation/ai/petra/startingStrategy.js +++ ps/trunk/binaries/data/mods/public/simulation/ai/petra/startingStrategy.js @@ -304,7 +304,7 @@ let startingPoint = []; for (let ent of gameState.getOwnUnits().values()) { - if (!ent.hasClass("Worker") && !(ent.hasClass("Support") && ent.hasClass("Elephant"))) + if (!ent.hasClass("Worker")) continue; if (PETRA.isFastMoving(ent)) continue; @@ -317,7 +317,7 @@ pos = holder.position(); } let gamepos = gameState.ai.accessibility.gamePosToMapPos(pos); - let index = gamepos[0] + gamepos[1]*gameState.ai.accessibility.width; + let index = gamepos[0] + gamepos[1] * gameState.ai.accessibility.width; let land = gameState.ai.accessibility.landPassMap[index]; let sea = gameState.ai.accessibility.navalPassMap[index]; let found = false; Index: ps/trunk/binaries/data/mods/public/simulation/ai/petra/worker.js =================================================================== --- ps/trunk/binaries/data/mods/public/simulation/ai/petra/worker.js +++ ps/trunk/binaries/data/mods/public/simulation/ai/petra/worker.js @@ -331,10 +331,7 @@ { ent.setMetadata(PlayerID, "subrole", "idle"); ent.setMetadata(PlayerID, "target-foundation", undefined); - // If worker elephant, move away to avoid being trapped in between constructions - if (ent.hasClass("Elephant")) - this.moveToGatherer(gameState, ent, true); - else if (this.baseID != gameState.ai.HQ.baseManagers[0].ID) + if (this.baseID != gameState.ai.HQ.baseManagers[0].ID) { // reassign it to something useful this.base.reassignIdleWorkers(gameState, [ent]);