screeps-scripts/strategy.creepSize.js

19 lines
652 B
JavaScript

var strategyCreepSize = {
/** @param {energyCapacity} energyCapacity **/
choose: function(energyCapacity) {
var newSize = [];
if(energyCapacity < 500){
newSize = [WORK, WORK, MOVE, CARRY];
} else if (energyCapacity >= 500 && energyCapacity < 700){
newSize = [WORK, WORK, WORK, MOVE, MOVE, CARRY, CARRY];
} else {
newSize = [WORK, WORK, WORK, WORK, MOVE, MOVE, MOVE, MOVE, CARRY, CARRY];
}
//console.log('newCreepSize: with energy: ' + energyCapacity + ' returning ' + newSize.length);
return newSize;
}
};
module.exports = strategyCreepSize;