TooAngel / screeps

TooAngel NPC / bot / source code for screeps
https://screeps.com
GNU Affero General Public License v3.0
600 stars 154 forks source link

[LOGIC REFINE]when in a room which have your controller, but no your spawn, let builder be able to extract energy from everywhere, as it need to rebuild spawn at any cost. #656

Closed XenoAmess closed 1 year ago

XenoAmess commented 1 year ago

i understand you point, i would wish to disable this feature, maybe if some config is set like

Room.prototype.isConstructingSpawn = function() {
  if (!this.controller || !this.controller.my || !config.myRoom.enableGetEnergyFromAnyStructures) {
    return false;
  }
  if (this.findPropertyFilter(FIND_MY_STRUCTURES, 'structureType', [STRUCTURE_SPAWN], {}).length > 0) {
    return false;
  }
  return true;
};

Configuration added. please review when you have time.

Have a nice weekend.

TooAngel commented 1 year ago

This pull request was merged by worlddriven.