~kylep/blunder_crawl

6365897bc433cce247ee491f25e9410bce7e8861 — Kyle Perik 2 years ago b4e42d0 master
Bug fixes
1 files changed, 4 insertions(+), 1 deletions(-)

M src/enemy.js
M src/enemy.js => src/enemy.js +4 -1
@@ 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))))
    }
  }