def setShapeDefense(self): if self.__character.species == "Werewolf": wits = self.__character.traits["Attribute"]["Mental"]["Wits"].value dexterity = self.__character.traits["Attribute"]["Physical"]["Dexterity"].value self.ui.label_defenseShapes.setHidden(False) self.ui.label_defenseShapes.setText(", {}, {}, {}, {}".format( CalcShapes.defense(wits, dexterity, Config.SHAPES_WEREWOLF[1]), CalcShapes.defense(wits, dexterity, Config.SHAPES_WEREWOLF[2]), CalcShapes.defense(wits, dexterity, Config.SHAPES_WEREWOLF[3]), CalcShapes.defense(wits, dexterity, Config.SHAPES_WEREWOLF[4]), )) else: self.ui.label_defenseShapes.setHidden(True)
def setShapeDefense(self): if self.__character.species == "Werewolf": wits = self.__character.traits["Attribute"]["Mental"]["Wits"].value dexterity = self.__character.traits["Attribute"]["Physical"][ "Dexterity"].value self.ui.label_defenseShapes.setHidden(False) self.ui.label_defenseShapes.setText(", {}, {}, {}, {}".format( CalcShapes.defense(wits, dexterity, Config.SHAPES_WEREWOLF[1]), CalcShapes.defense(wits, dexterity, Config.SHAPES_WEREWOLF[2]), CalcShapes.defense(wits, dexterity, Config.SHAPES_WEREWOLF[3]), CalcShapes.defense(wits, dexterity, Config.SHAPES_WEREWOLF[4]), )) else: self.ui.label_defenseShapes.setHidden(True)
def test__defense(self): """ Überprüft die Berechnung der Defense. """ for val_1 in range(1, ATTRIBUTE_MAX + 1): for val_2 in range(1, ATTRIBUTE_MAX + 1): for shape in SHAPES: self.assertEqual( CalcShapes.defense(val_1, val_2, shape), min( val_1, CalcShapes.dexterity( val_2, shape ) ) )
def test__defense(self): """ Überprüft die Berechnung der Defense. """ for val_1 in range(1, ATTRIBUTE_MAX + 1): for val_2 in range(1, ATTRIBUTE_MAX + 1): for shape in SHAPES: self.assertEqual( CalcShapes.defense(val_1, val_2, shape), min(val_1, CalcShapes.dexterity(val_2, shape)))