Merge branch 'master' into 'moreitems'
# Conflicts: # squirrelbattle/entities/items.py # squirrelbattle/interfaces.py # squirrelbattle/tests/game_test.py
This commit is contained in:
@ -43,7 +43,9 @@ class Monster(FightingEntity):
|
||||
# that targets the player.
|
||||
# If they can not move and are already close to the player,
|
||||
# they hit.
|
||||
if target and (self.y, self.x) in target.paths:
|
||||
if target and (self.y, self.x) in target.paths and \
|
||||
self.map.is_visible_from(self.y, self.x,
|
||||
target.y, target.x, 5):
|
||||
# Moves to target player by choosing the best available path
|
||||
for next_y, next_x in target.paths[(self.y, self.x)]:
|
||||
moved = self.check_move(next_y, next_x, True)
|
||||
|
Reference in New Issue
Block a user