Calculate all the things
This commit is contained in:
parent
0aeab1cf36
commit
0ada42efb3
@ -2,8 +2,14 @@ var battle = require('battle')
|
|||||||
|
|
||||||
var roleGuard = {
|
var roleGuard = {
|
||||||
getLastFlag: function(){
|
getLastFlag: function(){
|
||||||
|
let patrolFlags = _.filter(Game.flags, function(flag){
|
||||||
return 4; // TODO. calculate me.
|
return flag.name.indexOf("patrol_") == 0;
|
||||||
|
});
|
||||||
|
let flagNumbers = _.map(patrolFlags, function(flag){
|
||||||
|
return parseInt(flag.name.substring("patrol_".length, flag.name.length));
|
||||||
|
});
|
||||||
|
let max = Math.max.apply(Math, flagNumbers);
|
||||||
|
return max;
|
||||||
},
|
},
|
||||||
run: function(creep){
|
run: function(creep){
|
||||||
console.log(creep, 'running Guard')
|
console.log(creep, 'running Guard')
|
||||||
|
Loading…
Reference in New Issue
Block a user