Exemple #1
0
    def _slots_str_minimal(self, level: int):
        """Returns the slot level string if there are slots of this level, otherwise empty string."""
        assert 0 < level < 10
        _max = self.get_max_slots(level)
        remaining = self.get_slots(level)

        if level == self.pact_slot_level and _max:
            max_non_pact = _max - self.max_pact_slots
            remaining_non_pact = remaining - self.num_pact_slots
            nonpact_slot_bubbles = bubble_format(remaining_non_pact, max_non_pact)
            pact_slot_bubbles = bubble_format(
                self.num_pact_slots, self.max_pact_slots,
                used_char=constants.EMPTY_BUBBLE_ALT, unused_char=constants.FILLED_BUBBLE_ALT
            )
            return f"`{level}` {nonpact_slot_bubbles}{pact_slot_bubbles}"

        return f"`{level}` {bubble_format(remaining, _max)}" if _max else ''
Exemple #2
0
    def __str__(self):
        _max = self.get_max()

        if self.display_type == 'bubble':
            assert self.max is not None
            out = bubble_format(self.value, _max)
        else:
            if self.max is not None:
                out = f"{self.value}/{_max}"
            else:
                out = str(self.value)

        return out
Exemple #3
0
 def __str__(self):
     successes = bubble_format(self.successes, 3)
     fails = bubble_format(self.fails, 3, True)
     return f"F {fails} | {successes} S"