Skip to content
Snippets Groups Projects

cooldown for tower repair and creep.action.idle

Open username-removed-1441561 requested to merge cooldown into dev
3 unresolved threads
  • added a cooldown/switch parameter to tower repair and tower urgentRepair
  • added a cooldown parameter for creep.action.idle so it will not looking for action in every tick

all of them for save CPU if needed.

Edited by username-removed-1441561

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
14 delete creep.data.targetId;
16 action.step = function (creep) {
17 if (global.CHATTY)
18 creep.say(this.name, global.SAY_PUBLIC);
19 if (creep.getStrategyHandler([action.name], 'idleMove', creep))
20 creep.idleMove();
21
22 if (_.isUndefined(creep.data.idleCooldown))
23 creep.data.idleCooldown = COOLDOWN.CREEP_IDLE;
24 else
25 creep.data.idleCooldown--;
26
27 if (creep.data.idleCooldown === 0) {
28 delete creep.data.actionName;
29 delete creep.data.targetId;
30 delete creep.data.idleCooldown;
  • 1 1 let mod = {};
    2 2 module.exports = mod;
    3 mod.loop = function(room){
    3 mod.loop = function (room) {
    4 4 var run = tower => this.run(tower);
    5 5 _.forEach(room.structures.towers, run);
    6 6 };
    7 mod.run = function(tower){
    8 if(tower) {
    9 const p = Util.startProfiling(tower.room.name + ':tower:' + tower.id, {enabled:PROFILING.ROOMS});
    7 mod.run = function (tower) {
  • 1 1 let mod = {};
    2 2 module.exports = mod;
    3 mod.loop = function(room){
    3 mod.loop = function (room) {
  • Seems to have been working for people in canary, if someone running canary can approve I think this should be merged.

  • Please register or sign in to reply
    Loading