def get_next_creature(self, rules_engine):
        """
        Get the character who is next to take action

        :param rules_engine: engine containing rules
        :type rules_engine: RulesEngine
        :returns: Character to act next
        :rtype: Character
        """
        level = self.player.level

        if level is None:
            return None

        creatures = list(get_characters(level))

        while 1:
            for creature in creatures:
                if creature.tick <= 0:
                    return creature

            for creature in creatures:
                creature.tick = creature.tick - 1
                for effect in creature.get_effects():
                    if effect.tick is not None:
                        effect.tick = effect.tick - 1
                        if effect.tick <= 0:
                            effect.trigger(rules_engine.dying_rules)
                creature.remove_expired_effects()
                for skill, limit in creature.cooldowns.items():
                    if limit > 0:
                        creature.cooldowns[skill] = limit - 1
dataset/ETHPy150Open tuturto/pyherc/src/pyherc/data/model.py/Model.get_next_creature/original