change minimums
This commit is contained in:
parent
cf4be001c4
commit
b8ada37da4
8
main.js
8
main.js
@ -7,17 +7,17 @@ var creepRolePriority = ['harvester', 'builder', 'upgrader'];
|
||||
var creepsConfig = {
|
||||
harvester: {
|
||||
bodyParts: [WORK, CARRY, MOVE, MOVE],
|
||||
minimumCreeps: 3,
|
||||
minimumCreeps: 6,
|
||||
role: roleHarvester
|
||||
},
|
||||
builder: {
|
||||
bodyParts: [WORK, CARRY, MOVE, MOVE],
|
||||
minimumCreeps: 3,
|
||||
minimumCreeps: 1,
|
||||
role: roleBuilder
|
||||
},
|
||||
upgrader: {
|
||||
bodyParts: [WORK, CARRY, MOVE, MOVE],
|
||||
minimumCreeps: 3,
|
||||
minimumCreeps: 1,
|
||||
role: roleUpgrader
|
||||
}
|
||||
};
|
||||
@ -39,7 +39,7 @@ module.exports.loop = function(){
|
||||
var roleName = creepRolePriority[i];
|
||||
var defaults = creepsConfig[roleName];
|
||||
|
||||
var creepsOfKind = _.filter(Game.creeps, (creep) => {return creep.memory.role == roleName});
|
||||
let creepsOfKind = _.filter(Game.creeps, (creep) => {return creep.memory.role == roleName});
|
||||
if (creepsOfKind.length < defaults.minimumCreeps){
|
||||
var newName = Game.spawns.Spawn1.createCreep(defaults.bodyParts,
|
||||
helpers.generateName(roleName), // Make names show the roles. Change me to undefined if this gets annoying.
|
||||
|
Loading…
Reference in New Issue
Block a user