Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/ai/petra/attackPlan.js
Show First 20 Lines • Show All 186 Lines • ▼ Show 20 Lines | for (let cat in this.unitStat) | ||||
this.unitStat[cat].minSize = Math.min(this.unitStat[cat].minSize, this.unitStat[cat].targetSize); | this.unitStat[cat].minSize = Math.min(this.unitStat[cat].minSize, this.unitStat[cat].targetSize); | ||||
} | } | ||||
// change the sizes according to max population | // change the sizes according to max population | ||||
this.neededShips = Math.ceil(this.Config.popScaling * this.neededShips); | this.neededShips = Math.ceil(this.Config.popScaling * this.neededShips); | ||||
for (let cat in this.unitStat) | for (let cat in this.unitStat) | ||||
{ | { | ||||
this.unitStat[cat].targetSize = Math.round(this.Config.popScaling * this.unitStat[cat].targetSize); | this.unitStat[cat].targetSize = Math.round(this.Config.popScaling * this.unitStat[cat].targetSize); | ||||
this.unitStat[cat].minSize = Math.floor(this.Config.popScaling * this.unitStat[cat].minSize); | this.unitStat[cat].minSize = Math.ceil(this.Config.popScaling * this.unitStat[cat].minSize); | ||||
} | } | ||||
// TODO: there should probably be one queue per type of training building | // TODO: there should probably be one queue per type of training building | ||||
gameState.ai.queueManager.addQueue("plan_" + this.name, priority); | gameState.ai.queueManager.addQueue("plan_" + this.name, priority); | ||||
gameState.ai.queueManager.addQueue("plan_" + this.name +"_champ", priority+1); | gameState.ai.queueManager.addQueue("plan_" + this.name +"_champ", priority+1); | ||||
gameState.ai.queueManager.addQueue("plan_" + this.name +"_siege", priority); | gameState.ai.queueManager.addQueue("plan_" + this.name +"_siege", priority); | ||||
// each array is [ratio, [associated classes], associated EntityColl, associated unitStat, name ] | // each array is [ratio, [associated classes], associated EntityColl, associated unitStat, name ] | ||||
▲ Show 20 Lines • Show All 1,958 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator