Skip to content

Instantly share code, notes, and snippets.

@cjsaylor cjsaylor/flyer.js
Created Nov 21, 2013

Embed
What would you like to do?
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
You can’t perform that action at this time.