tick function takes the player as argument

This commit is contained in:
Yohann D'ANELLO 2020-12-18 17:40:52 +01:00
parent dadafc84eb
commit e1918ab066
1 changed files with 3 additions and 3 deletions

View File

@ -57,17 +57,17 @@ class TestEntities(unittest.TestCase):
self.map.add_entity(entity)
entity.move(15, 44)
# Move randomly
self.map.tick()
self.map.tick(self.player)
self.assertFalse(entity.y == 15 and entity.x == 44)
# Move to the player
entity.move(3, 6)
self.map.tick()
self.map.tick(self.player)
self.assertTrue(entity.y == 2 and entity.x == 6)
# Rabbit should fight
old_health = self.player.health
self.map.tick()
self.map.tick(self.player)
self.assertTrue(entity.y == 2 and entity.x == 6)
self.assertEqual(old_health - entity.strength, self.player.health)
self.assertEqual(self.map.logs.messages[-1],