Differential D3343 Diff 16470 ps/trunk/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
Show First 20 Lines • Show All 310 Lines • ▼ Show 20 Lines | PETRA.ConstructionPlan.prototype.findGoodPosition = function(gameState) | ||||
// note: not for houses and dropsites who ought to be closer to either each other or a resource. | // note: not for houses and dropsites who ought to be closer to either each other or a resource. | ||||
// also not for fields who can be stacked quite a bit | // also not for fields who can be stacked quite a bit | ||||
let obstructions = PETRA.createObstructionMap(gameState, 0, template); | let obstructions = PETRA.createObstructionMap(gameState, 0, template); | ||||
// obstructions.dumpIm(template.buildPlacementType() + "_obstructions.png"); | // obstructions.dumpIm(template.buildPlacementType() + "_obstructions.png"); | ||||
let radius = 0; | let radius = 0; | ||||
if (template.hasClass("Fortress") || template.hasClass("Arsenal") || | if (template.hasClass("Fortress") || template.hasClass("Arsenal") || | ||||
this.type == gameState.applyCiv("structures/{civ}/elephant_stables")) | this.type == gameState.applyCiv("structures/{civ}/elephant_stable")) | ||||
radius = Math.floor((template.obstructionRadius().max + 8) / obstructions.cellSize); | radius = Math.floor((template.obstructionRadius().max + 8) / obstructions.cellSize); | ||||
else if (template.resourceDropsiteTypes() === undefined && !template.hasClass("House") && | else if (template.resourceDropsiteTypes() === undefined && !template.hasClass("House") && | ||||
!template.hasClass("Field") && !template.hasClass("Market")) | !template.hasClass("Field") && !template.hasClass("Market")) | ||||
radius = Math.ceil((template.obstructionRadius().max + 4) / obstructions.cellSize); | radius = Math.ceil((template.obstructionRadius().max + 4) / obstructions.cellSize); | ||||
else | else | ||||
radius = Math.ceil(template.obstructionRadius().max / obstructions.cellSize); | radius = Math.ceil(template.obstructionRadius().max / obstructions.cellSize); | ||||
let bestTile; | let bestTile; | ||||
▲ Show 20 Lines • Show All 619 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator