@@ 47,7 47,7 @@ export default class Enemy {
'spawner': 'Spawner: Spawns an enemy once every 3 moves.',
'gremlin': 'Gremlin: Can move to any square in a 4 block radius, attacks any surrounding space.',
'dragon': 'Dragon: Can move to any surrounding space, and can attack diagonally from any distance.',
- 'archer': 'Archer: Moves like a chess knight and can attack long range cardinally.',
+ 'archer': 'Archer: Moves like a chess knight and can attack long range diagonally.',
'soldier': 'Soldier: Can move to or attack 2 squares cardinally.',
'mage': 'Mage: Moves 1 space cardinally and can attack all spaces within a 3 square radius.',
'queen': 'Queen: Can move to or attack all spaces in any direction.',
@@ 165,6 165,9 @@ export default class Enemy {
const squares = SURROUNDING.map(side => side.add(this.pos)).filter(side => {
return !gameData.player.pos.eq(side) && !gameData.enemies.some(enemy => enemy.pos.eq(side)) && inBounds(side)
})
+ if (squares.length === 0) {
+ return
+ }
gameData.enemies.push(new Enemy(choose(squares), getEnemyType(Math.floor(Math.random() * 20))))
}
}