mirror of
https://github.com/paradizelost/screeps.git
synced 2024-11-25 02:14:44 -06:00
Mining changes
This commit is contained in:
parent
2a94fffaae
commit
aa2d7fdfce
@ -1,6 +1,6 @@
|
||||
let assignMiners = {
|
||||
tick: function(roomname) {
|
||||
let sources = Game.rooms[roomname].find(FIND_SOURCES );
|
||||
let sources = Game.rooms[roomname].find(FIND_SOURCES);
|
||||
for(let source of sources){
|
||||
let allminers = Game.rooms[roomname].find(FIND_MY_CREEPS, {filter: (creep) =>{return ( creep.memory.role=='sourceminer'|| creep.memory.role == ("phase" + Game.rooms[roomname].memory.phase + "worker") )}});
|
||||
//let allstorage = Game.rooms[name].find(FIND_STRUCTURES, {filter: (s) => {return ( s.structureType == STRUCTURE_CONTAINER || s.structureType == STRUCTURE_STORAGE)}})
|
||||
|
@ -49,7 +49,7 @@ let Phase0Worker = {
|
||||
let droppedenergy = creep.pos.findClosestByRange(FIND_DROPPED_RESOURCES, {filter: {resourceType: RESOURCE_ENERGY}});
|
||||
let ruins=creep.pos.findClosestByRange(FIND_RUINS, {filter: ruin => ruin.store.getUsedCapacity(RESOURCE_ENERGY) > 0});
|
||||
if(droppedenergy == undefined && ruins==undefined){
|
||||
if(Game.getObjectById(creep.memory.destsource.id)==undefined){creep.memory.destsource=undefined}
|
||||
if((Game.getObjectById(creep.memory.destsource.id)==undefined)){creep.memory.destsource=undefined}
|
||||
let mysource=Game.getObjectById(creep.memory.destsource.id)
|
||||
//mysource=creep.pos.findClosestByRange( FIND_SOURCES )
|
||||
if(creep.harvest(mysource) == ERR_NOT_IN_RANGE){
|
||||
|
Loading…
Reference in New Issue
Block a user