Exemple #1
0
class HasEquipment(object):

    """Creatures with this mixin class have an equipment and a bag."""

    def __init__(self, *args, **kwargs):
        self.equipment = Equipment()
        super().__init__(*args, **kwargs)

    def get_damage_info(self):
        damage_info = self.equipment.get_damage_info()
        if damage_info is not None:
            dices, highest_side, addition = damage_info
            addition += self.damage
        else:
            dices = self.unarmed_dices
            highest_side = self.unarmed_sides
            addition = self.damage
        return Dice(dices, highest_side, addition)
Exemple #2
0
class HasEquipment(object):

    """Creatures with this mixin class have an equipment and a bag."""

    def __init__(self, *args, **kwargs):
        self.equipment = Equipment()
        super().__init__(*args, **kwargs)

    def get_damage_info(self):
        damage_info = self.equipment.get_damage_info()
        if damage_info is not None:
            dices, highest_side, addition = damage_info
            addition += self.damage
        else:
            dices = self.unarmed_dices
            highest_side = self.unarmed_sides
            addition = self.damage
        return Dice(dices, highest_side, addition)