codecombat emphasis-on-aim

// The following runs whenever the tower needs
// something to do.

var unit = this.getNearestCombatant();
if (unit) {
    this.say('Perish, ' + unit.id + ' of the ' + unit.team);
    if(unit.team=="ogres")
    this.attack(unit);
}
else {
    this.say('All clear.');
}

// This tower is too bloodthirsty!
// Have it check the unit's team before opening fire.
// There are three teams: "ogres", "allies", and "humans".
// If you need help, press Guide at the top.



你可能感兴趣的:(codecombat emphasis-on-aim)