1 Star 0 Fork 0

Leviaton/Screeps

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
hardcode.room.js 1.98 KB
一键复制 编辑 原始数据 按行查看 历史
Lev 提交于 2020-02-17 12:50 . first commit
var config = require('config.room');
var tasks = require('tasks');
module.exports = {
W35N28: function(){
var storage = Game.rooms['W35N28'].storage;
var fac = Game.getObjectById(config.W35N28.factory);
if(storage.store['energy'] > config.W35N28.energy){
if(Game.creeps['HCW35N28_energy'] && !Game.creeps['HCW35N28_energy'].spawning) tasks.transport(Game.rooms['W35N28'].storage, fac, 'energy', Game.creeps['HCW35N28_energy']);
else if(!Game.spawns['R1S2'].spawning) Game.spawns['R1S2'].spawnCreep([CARRY,CARRY,CARRY,CARRY,CARRY,CARRY,MOVE,MOVE,MOVE],'HCW35N28_energy');
}
if(storage.store['L'] > config.W35N28.L){
if(Game.creeps['HCW35N28_L'] && !Game.creeps['HCW35N28_L'].spawning) tasks.transport(Game.rooms['W35N28'].storage, fac, 'L', Game.creeps['HCW35N28_L']);
else if(!Game.spawns['R1S2'].spawning) Game.spawns['R1S2'].spawnCreep([CARRY,CARRY,CARRY,CARRY,CARRY,CARRY,MOVE,MOVE,MOVE],'HCW35N28_L');
}
if(fac.store['battery'] || (Game.creeps['BTW35N28_all'] && Game.creeps['BTW35N28_all'].store)){
if(Game.creeps['BTW35N28_all'] && !Game.creeps['BTW35N28_all'].spawning) tasks.transport(fac, storage, 'battery', Game.creeps['BTW35N28_all']);
else if(!Game.spawns['R1S2'].spawning) Game.spawns['R1S2'].spawnCreep([CARRY,CARRY,CARRY,CARRY,CARRY,CARRY,MOVE,MOVE,MOVE],'BTW35N28_all');
}else if(fac.store['lemergium_bar']){
if(Game.creeps['BTW35N28_all'] && !Game.creeps['BTW35N28_all'].spawning) tasks.transport(fac, storage, 'lemergium_bar', Game.creeps['BTW35N28_all']);
else if(!Game.spawns['R1S2'].spawning) Game.spawns['R1S2'].spawnCreep([CARRY,CARRY,CARRY,CARRY,CARRY,CARRY,MOVE,MOVE,MOVE],'BTW35N28_all');
}
if(fac.store['L'] > 500 && fac.store['energy'] > 200 && fac.cooldown == 0) fac.produce('lemergium_bar');
if(fac.store.getFreeCapacity() < 0.5*fac.store.getCapacity() && fac.cooldown == 0) fac.produce('battery');
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/Chorolop/Screeps.git
git@gitee.com:Chorolop/Screeps.git
Chorolop
Screeps
Screeps
master

搜索帮助