Ejemplo n.º 1
0
    def test_failed_attack_action(self):
        game_state = GameState(InfiniteMap(), self.avatar_manager)
        action.AttackAction(self.avatar, {'x': 0, 'y': 1}).process(game_state.world_map)

        target_location = NORTH_OF_ORIGIN

        self.assertEqual(self.avatar.location, ORIGIN)
        self.assertEqual(self.other_avatar.location, EAST_OF_ORIGIN)
        self.assertEqual(self.avatar.events, [event.FailedAttackEvent(target_location)])
        self.assertEqual(self.other_avatar.events, [])
Ejemplo n.º 2
0
    def test_failed_attack_action(self):
        game_state = GameState(InfiniteMap(), self.avatar_manager)
        action.AttackAction(self.avatar, {
            "x": 0,
            "y": 1
        }).process(game_state.world_map)

        target_location = NORTH_OF_ORIGIN

        assert self.avatar.location == ORIGIN
        assert self.other_avatar.location == EAST_OF_ORIGIN
        assert self.avatar.events == [event.FailedAttackEvent(target_location)]
        assert self.other_avatar.events == []