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__weight(self): """ Überprüft die Berechnung der Körpergröße. """ weight = 70 for val_1 in range(1, ATTRIBUTE_MAX + 1): for val_2 in range(1, ATTRIBUTE_MAX + 1): for shape in SHAPES: if shape in SHAPES[0]: self.assertEqual( CalcShapes.weight(weight, val_1, val_2, shape), weight ) elif shape in SHAPES[1]: ## 12.5 bis 25 kg zusätzliches Gewicht self.assertGreaterEqual( CalcShapes.weight(weight, val_1, val_2, shape), weight + 12.5 ) self.assertLessEqual( CalcShapes.weight(weight, val_1, val_2, shape), weight + 25 ) elif shape in SHAPES[2]: ## 100 bis 150 kg zusätzliches Gewicht self.assertGreaterEqual( CalcShapes.weight(weight, val_1, val_2, shape), weight + 100 ) self.assertLessEqual( CalcShapes.weight(weight, val_1, val_2, shape), weight + 150 ) elif shape in SHAPES[3]: ## 90% des Gauru-Gewichts self.assertAlmostEqual( CalcShapes.weight(weight, val_1, val_2, shape), .9 * CalcShapes.weight(weight, val_1, val_2, SHAPES[2]) ) else: ## Wölfe Wiegen 35 bis 67 kg self.assertGreaterEqual( CalcShapes.weight(weight, val_1, val_2, shape), 35 ) self.assertLessEqual( CalcShapes.weight(weight, val_1, val_2, shape), 67 )
def test__height(self): """ Überprüft die Berechnung der Körpergröße. """ height = 1.70 for val_1 in range(1, ATTRIBUTE_MAX + 1): for val_2 in range(1, ATTRIBUTE_MAX + 1): for shape in SHAPES: if shape == SHAPES[1]: ## Zwischen 4 in bis 6 in Größe mehr self.assertGreaterEqual( CalcShapes.height(height, val_1, val_2, shape), height + 4 * Config.INCH_IN_METER ) self.assertLessEqual( CalcShapes.height(height, val_1, val_2, shape), height + 6 * Config.INCH_IN_METER ) elif shape == SHAPES[2]: ## Zwischen 2 ft bis 3 ft Größe mehr self.assertGreaterEqual( CalcShapes.height(height, val_1, val_2, shape), height + 2 * Config.FOOT_IN_METER ) self.assertLessEqual( CalcShapes.height(height, val_1, val_2, shape), height + 3 * Config.FOOT_IN_METER ) elif shape == SHAPES[3]: ## Zwischen 3 ft bis 5 ft Größe 1 ft = 0,3048 self.assertGreaterEqual( CalcShapes.height(height, val_1, val_2, shape), 3 * Config.FOOT_IN_METER ) self.assertLessEqual( CalcShapes.height(height, val_1, val_2, shape), 5 * Config.FOOT_IN_METER ) elif shape == SHAPES[4]: ## Zwischen 70 bis 90 cm Größe self.assertGreaterEqual( CalcShapes.height(height, val_1, val_2, shape), .7 ) self.assertLessEqual( CalcShapes.height(height, val_1, val_2, shape), .9 ) else: self.assertEqual( CalcShapes.height(height, val_1, val_2, shape), height )
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 setShapeHealth(self): if self.__character.species == "Werewolf": value = self.ui.dots_health.value self.ui.label_healthShapes.setHidden(False) self.ui.label_healthShapes.setText("{}, {}, {}, {}".format( CalcShapes.health(value, Config.SHAPES_WEREWOLF[1]), CalcShapes.health(value, Config.SHAPES_WEREWOLF[2]), CalcShapes.health(value, Config.SHAPES_WEREWOLF[3]), CalcShapes.health(value, Config.SHAPES_WEREWOLF[4]), )) else: self.ui.label_healthShapes.setHidden(True)
def setShapeSpeed(self): if self.__character.species == "Werewolf": value = int(self.ui.label_speed.text()) self.ui.label_speedShapes.setHidden(False) self.ui.label_speedShapes.setText(", {}, {}, {}, {}".format( CalcShapes.speed(value, Config.SHAPES_WEREWOLF[1]), CalcShapes.speed(value, Config.SHAPES_WEREWOLF[2]), CalcShapes.speed(value, Config.SHAPES_WEREWOLF[3]), CalcShapes.speed(value, Config.SHAPES_WEREWOLF[4]), )) else: self.ui.label_speedShapes.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 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__initiative(self): """ Überprüft die Berechnung der Initiative. """ for val_1 in range(1, ATTRIBUTE_MAX + 1): for shape in SHAPES: self.assertIn( CalcShapes.initiative(val_1, shape), range( val_1, val_1 + 3 ) )
def test__size(self): """ Überprüft ide Berechnung der Größe. """ for val_1 in range(1, ATTRIBUTE_MAX + 1): for shape in SHAPES: self.assertIn( CalcShapes.size(val_1, shape), range( val_1 - 1, val_1 + 3 ) )
def test__speed(self): """ Überprüft die Berechnung der Geschwindigkeit. """ for val_1 in range(1, ATTRIBUTE_MAX + 1): for shape in SHAPES: self.assertIn( CalcShapes.speed(val_1, shape), range( val_1, val_1 + 8 ) )
def test__health(self): """ Überprüft die Berechnung der Gesundheit. """ for val_1 in range(1, ATTRIBUTE_MAX + 1): for shape in SHAPES: self.assertGreaterEqual( CalcShapes.health(val_1, shape), val_1 )
def test__manipulation(self): """ Überprüft ide Berechnung der Manipulation. """ for val_1 in range(1, ATTRIBUTE_MAX + 1): for shape in SHAPES: self.assertLessEqual( CalcShapes.manipulation(val_1, shape), val_1 )
def test__health(self): """ Überprüft die Berechnung der Gesundheit. """ for val_1 in range(1, ATTRIBUTE_MAX + 1): for shape in SHAPES: self.assertGreaterEqual(CalcShapes.health(val_1, shape), val_1)
def test__dexterity(self): """ Überprüft die Berechnung des Geschicks. """ for val_1 in range(1, ATTRIBUTE_MAX + 1): for shape in SHAPES: self.assertGreaterEqual( CalcShapes.dexterity(val_1, shape), val_1 )
def test__stamina(self): """ Überprüft die Berechnung der Widerstandsfähigkeit. """ for val_1 in range(1, ATTRIBUTE_MAX + 1): for shape in SHAPES: self.assertGreaterEqual( CalcShapes.stamina(val_1, shape), val_1 )
def test__strength(self): """ Überprüft die Berechnung der Stärke. """ for val_1 in range(1, ATTRIBUTE_MAX + 1): for shape in SHAPES: self.assertGreaterEqual( CalcShapes.strength(val_1, shape), val_1 )
def test__strength(self): """ Überprüft die Berechnung der Stärke. """ for val_1 in range(1, ATTRIBUTE_MAX + 1): for shape in SHAPES: self.assertGreaterEqual(CalcShapes.strength(val_1, shape), val_1)
def test__dexterity(self): """ Überprüft die Berechnung des Geschicks. """ for val_1 in range(1, ATTRIBUTE_MAX + 1): for shape in SHAPES: self.assertGreaterEqual(CalcShapes.dexterity(val_1, shape), val_1)
def test__speed(self): """ Überprüft die Berechnung der Geschwindigkeit. """ for val_1 in range(1, ATTRIBUTE_MAX + 1): for shape in SHAPES: self.assertIn(CalcShapes.speed(val_1, shape), range(val_1, val_1 + 8))
def test__stamina(self): """ Überprüft die Berechnung der Widerstandsfähigkeit. """ for val_1 in range(1, ATTRIBUTE_MAX + 1): for shape in SHAPES: self.assertGreaterEqual(CalcShapes.stamina(val_1, shape), val_1)
def test__manipulation(self): """ Überprüft ide Berechnung der Manipulation. """ for val_1 in range(1, ATTRIBUTE_MAX + 1): for shape in SHAPES: self.assertLessEqual(CalcShapes.manipulation(val_1, shape), val_1)
def test__initiative(self): """ Überprüft die Berechnung der Initiative. """ for val_1 in range(1, ATTRIBUTE_MAX + 1): for shape in SHAPES: self.assertIn(CalcShapes.initiative(val_1, shape), range(val_1, val_1 + 3))
def test__size(self): """ Überprüft ide Berechnung der Größe. """ for val_1 in range(1, ATTRIBUTE_MAX + 1): for shape in SHAPES: self.assertIn(CalcShapes.size(val_1, shape), range(val_1 - 1, val_1 + 3))
def test__height(self): """ Überprüft die Berechnung der Körpergröße. """ height = 1.70 for val_1 in range(1, ATTRIBUTE_MAX + 1): for val_2 in range(1, ATTRIBUTE_MAX + 1): for shape in SHAPES: if shape == SHAPES[1]: ## Zwischen 4 in bis 6 in Größe mehr self.assertGreaterEqual( CalcShapes.height(height, val_1, val_2, shape), height + 4 * Config.INCH_IN_METER) self.assertLessEqual( CalcShapes.height(height, val_1, val_2, shape), height + 6 * Config.INCH_IN_METER) elif shape == SHAPES[2]: ## Zwischen 2 ft bis 3 ft Größe mehr self.assertGreaterEqual( CalcShapes.height(height, val_1, val_2, shape), height + 2 * Config.FOOT_IN_METER) self.assertLessEqual( CalcShapes.height(height, val_1, val_2, shape), height + 3 * Config.FOOT_IN_METER) elif shape == SHAPES[3]: ## Zwischen 3 ft bis 5 ft Größe 1 ft = 0,3048 self.assertGreaterEqual( CalcShapes.height(height, val_1, val_2, shape), 3 * Config.FOOT_IN_METER) self.assertLessEqual( CalcShapes.height(height, val_1, val_2, shape), 5 * Config.FOOT_IN_METER) elif shape == SHAPES[4]: ## Zwischen 70 bis 90 cm Größe self.assertGreaterEqual( CalcShapes.height(height, val_1, val_2, shape), .7) self.assertLessEqual( CalcShapes.height(height, val_1, val_2, shape), .9) else: self.assertEqual( CalcShapes.height(height, val_1, val_2, shape), height)
def test__weight(self): """ Überprüft die Berechnung der Körpergröße. """ weight = 70 for val_1 in range(1, ATTRIBUTE_MAX + 1): for val_2 in range(1, ATTRIBUTE_MAX + 1): for shape in SHAPES: if shape in SHAPES[0]: self.assertEqual( CalcShapes.weight(weight, val_1, val_2, shape), weight) elif shape in SHAPES[1]: ## 12.5 bis 25 kg zusätzliches Gewicht self.assertGreaterEqual( CalcShapes.weight(weight, val_1, val_2, shape), weight + 12.5) self.assertLessEqual( CalcShapes.weight(weight, val_1, val_2, shape), weight + 25) elif shape in SHAPES[2]: ## 100 bis 150 kg zusätzliches Gewicht self.assertGreaterEqual( CalcShapes.weight(weight, val_1, val_2, shape), weight + 100) self.assertLessEqual( CalcShapes.weight(weight, val_1, val_2, shape), weight + 150) elif shape in SHAPES[3]: ## 90% des Gauru-Gewichts self.assertAlmostEqual( CalcShapes.weight(weight, val_1, val_2, shape), .9 * CalcShapes.weight(weight, val_1, val_2, SHAPES[2])) else: ## Wölfe Wiegen 35 bis 67 kg self.assertGreaterEqual( CalcShapes.weight(weight, val_1, val_2, shape), 35) self.assertLessEqual( CalcShapes.weight(weight, val_1, val_2, shape), 67)