Skip to content

Instantly share code, notes, and snippets.

@rveitch
Created January 4, 2018 20:05
Show Gist options
  • Select an option

  • Save rveitch/777394c7411e40164a31049a4e2c9c32 to your computer and use it in GitHub Desktop.

Select an option

Save rveitch/777394c7411e40164a31049a4e2c9c32 to your computer and use it in GitHub Desktop.
getCurrentBestBodyParts.js
getCurrentBestBodyParts(Game) {
const roomEnergy = energyController.getRoomEnergyInfo(Game);
const energyAvailable = roomEnergy.sourceEnergy.sourceEnergy;
if (energyAvailable <= 300) {
return [WORK,WORK,CARRY,MOVE];
}
if (energyAvailable <= 400) {
return [WORK,WORK,WORK,CARRY,MOVE];
}
if (energyAvailable <= 550) {
return [WORK,WORK,WORK,CARRY,CARRY,MOVE,MOVE];
}
if (energyAvailable <= 600 || energyAvailable <= 650 || energyAvailable >= 650) {
return [WORK,WORK,WORK,WORK,CARRY,CARRY,MOVE,MOVE];
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment