Skip to content

Instantly share code, notes, and snippets.

@cjsaylor
Created November 21, 2013 19:03
Show Gist options
  • Save cjsaylor/7587575 to your computer and use it in GitHub Desktop.
Save cjsaylor/7587575 to your computer and use it in GitHub Desktop.
Eliminate those pesky flyers
// Find a flyer that's at the maximum range
var flyer = _.find(roundInfo.getMobs(), function(mob) {
return mob.type === 'flyer' && mob.position === 5;
});
if (flyer) {
commander.target(flyer.id);
commander.attackMode('ranged');
return;
}
// Didn't find a flyer so fallback to the first enemy
commander.target(_.first(roundInfo.getMobs()).id);
commander.attackMode('power');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment