Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js
Show First 20 Lines • Show All 735 Lines • ▼ Show 20 Lines | |||||
}; | }; | ||||
/** | /** | ||||
* fast check if we can build a dock: returns false if nearest land is farther than the dock dimension | * fast check if we can build a dock: returns false if nearest land is farther than the dock dimension | ||||
* if the (object) wantedLand is given, this nearest land should have one of these accessibility | * if the (object) wantedLand is given, this nearest land should have one of these accessibility | ||||
* if wantedSea is given, this tile should be inside this sea | * if wantedSea is given, this tile should be inside this sea | ||||
*/ | */ | ||||
const around = [[ 1.0, 0.0], [ 0.87, 0.50], [ 0.50, 0.87], [ 0.0, 1.0], [-0.50, 0.87], [-0.87, 0.50], | const around = [[ 1.0, 0.0], [ 0.87, 0.50], [ 0.50, 0.87], [ 0.0, 1.0], [-0.50, 0.87], [-0.87, 0.50], | ||||
[-1.0, 0.0], [-0.87,-0.50], [-0.50,-0.87], [ 0.0,-1.0], [ 0.50,-0.87], [ 0.87,-0.50]]; | [-1.0, 0.0], [-0.87, -0.50], [-0.50, -0.87], [ 0.0, -1.0], [ 0.50, -0.87], [ 0.87, -0.50]]; | ||||
PETRA.ConstructionPlan.prototype.isDockLocation = function(gameState, j, dimension, wantedLand, wantedSea) | PETRA.ConstructionPlan.prototype.isDockLocation = function(gameState, j, dimension, wantedLand, wantedSea) | ||||
{ | { | ||||
let width = gameState.ai.HQ.territoryMap.width; | let width = gameState.ai.HQ.territoryMap.width; | ||||
let cellSize = gameState.ai.HQ.territoryMap.cellSize; | let cellSize = gameState.ai.HQ.territoryMap.cellSize; | ||||
let dimLand = dimension + 1.5 * cellSize; | let dimLand = dimension + 1.5 * cellSize; | ||||
let dimSea = dimension + 2 * cellSize; | let dimSea = dimension + 2 * cellSize; | ||||
▲ Show 20 Lines • Show All 193 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator