change minimums

This commit is contained in:
Tyrel Souza 2016-06-28 22:50:37 -04:00
parent cf4be001c4
commit b8ada37da4

View File

@ -7,17 +7,17 @@ var creepRolePriority = ['harvester', 'builder', 'upgrader'];
var creepsConfig = { var creepsConfig = {
harvester: { harvester: {
bodyParts: [WORK, CARRY, MOVE, MOVE], bodyParts: [WORK, CARRY, MOVE, MOVE],
minimumCreeps: 3, minimumCreeps: 6,
role: roleHarvester role: roleHarvester
}, },
builder: { builder: {
bodyParts: [WORK, CARRY, MOVE, MOVE], bodyParts: [WORK, CARRY, MOVE, MOVE],
minimumCreeps: 3, minimumCreeps: 1,
role: roleBuilder role: roleBuilder
}, },
upgrader: { upgrader: {
bodyParts: [WORK, CARRY, MOVE, MOVE], bodyParts: [WORK, CARRY, MOVE, MOVE],
minimumCreeps: 3, minimumCreeps: 1,
role: roleUpgrader role: roleUpgrader
} }
}; };
@ -39,7 +39,7 @@ module.exports.loop = function(){
var roleName = creepRolePriority[i]; var roleName = creepRolePriority[i];
var defaults = creepsConfig[roleName]; 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){ if (creepsOfKind.length < defaults.minimumCreeps){
var newName = Game.spawns.Spawn1.createCreep(defaults.bodyParts, var newName = Game.spawns.Spawn1.createCreep(defaults.bodyParts,
helpers.generateName(roleName), // Make names show the roles. Change me to undefined if this gets annoying. helpers.generateName(roleName), // Make names show the roles. Change me to undefined if this gets annoying.