Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/ai/petra/attackPlan.js
Show First 20 Lines • Show All 971 Lines • ▼ Show 20 Lines | PETRA.AttackPlan.prototype.defaultTargetFinder = function(gameState, playerEnemy) | ||||
if (!targets.hasEntities()) | if (!targets.hasEntities()) | ||||
targets = gameState.getEntities(playerEnemy).filter(API3.Filters.byClass("ConquestCritical")). | targets = gameState.getEntities(playerEnemy).filter(API3.Filters.byClass("ConquestCritical")). | ||||
filter(API3.Filters.not(API3.Filters.byClass("Ship"))); | filter(API3.Filters.not(API3.Filters.byClass("Ship"))); | ||||
return targets; | return targets; | ||||
}; | }; | ||||
PETRA.AttackPlan.prototype.isValidTarget = function(ent) | PETRA.AttackPlan.prototype.isValidTarget = function(ent) | ||||
{ | { | ||||
if (!ent.position()) | if (!ent.position() || ent.isCamouflaged()) | ||||
return false; | return false; | ||||
if (this.sameLand && PETRA.getLandAccess(this.gameState, ent) != this.sameLand) | if (this.sameLand && PETRA.getLandAccess(this.gameState, ent) != this.sameLand) | ||||
return false; | return false; | ||||
Freagarach: I would add this to L980 (saves getting the land access). | |||||
Done Inline Actionsyeah, true marder: yeah, true | |||||
return !ent.decaying() || ent.getDefaultArrow() || ent.isGarrisonHolder() && ent.garrisoned().length; | return !ent.decaying() || ent.getDefaultArrow() || ent.isGarrisonHolder() && ent.garrisoned().length; | ||||
}; | }; | ||||
/** Rush target finder aims at isolated non-defended buildings */ | /** Rush target finder aims at isolated non-defended buildings */ | ||||
PETRA.AttackPlan.prototype.rushTargetFinder = function(gameState, playerEnemy) | PETRA.AttackPlan.prototype.rushTargetFinder = function(gameState, playerEnemy) | ||||
{ | { | ||||
let targets = new API3.EntityCollection(gameState.sharedScript); | let targets = new API3.EntityCollection(gameState.sharedScript); | ||||
let buildings; | let buildings; | ||||
▲ Show 20 Lines • Show All 1,197 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
I would add this to L980 (saves getting the land access).