public function __construct(HeightInCm $heightInCm, DistanceTable $distanceTable) { $heightInMeters = $heightInCm->getValue() / 100; /** @noinspection ExceptionsAnnotatingAndHandlingInspection */ $distance = new Distance($heightInMeters, Distance::M, $distanceTable); // height is bonus of distance in fact $this->value = $distance->getBonus()->getValue(); }
/** * @param Race $race * @param GenderCode $genderCode * @param ExceptionalityProperties $exceptionalityProperties * @param ProfessionLevels $professionLevels * @param WeightInKg $weightInKgAdjustment * @param HeightInCm $heightInCmAdjustment * @param Age $age * @param Tables $tables * @throws Exceptions\TooLowStrengthAdjustment */ public function __construct(Race $race, GenderCode $genderCode, ExceptionalityProperties $exceptionalityProperties, ProfessionLevels $professionLevels, WeightInKg $weightInKgAdjustment, HeightInCm $heightInCmAdjustment, Age $age, Tables $tables) { $this->exceptionalityProperties = $exceptionalityProperties; $this->setUpBaseProperties($race, $genderCode, $exceptionalityProperties, $professionLevels, $tables); $this->firstLevelWeightInKgAdjustment = $weightInKgAdjustment; $this->firstLevelWeightInKg = $this->createFirstLevelWeightInKg($race, $genderCode, $weightInKgAdjustment, $tables); $this->firstLevelSize = $this->createFirstLevelSize($race, $genderCode, $tables, $exceptionalityProperties, $professionLevels); $this->firstLevelHeightInCmAdjustment = $heightInCmAdjustment; $this->firstLevelHeightInCm = HeightInCm::getIt($race->getHeightInCm($tables->getRacesTable()) + $heightInCmAdjustment->getValue()); $this->firstLevelHeight = new Height($this->firstLevelHeightInCm, $tables->getDistanceTable()); $this->firstLevelAge = $age; }
/** * @test * @expectedException \DrdPlus\PropertiesByLevels\Exceptions\TooLowStrengthAdjustment */ public function I_can_not_get_it_with_too_low_strength() { $exceptionalityProperties = $this->createExceptionalityProperties(-1, 0, 0, 0, 0, 0); new FirstLevelProperties(CommonHuman::getIt(), GenderCode::getIt(GenderCode::MALE), $exceptionalityProperties, $this->createProfessionLevels(), WeightInKg::getIt(0), HeightInCm::getIt(123), Age::getIt(20), new Tables()); }
public function getCombination() { $male = GenderCode::getIt(GenderCode::MALE); $female = GenderCode::getIt(GenderCode::FEMALE); $exceptionalityProperties = $this->createExceptionalityProperties(); $professionLevels = $this->createProfessionLevels(); $tables = new Tables(); $weightInKgAdjustment = WeightInKg::getIt(0.001); $heightInCm = HeightInCm::getIt(123.4); $age = Age::getIt(15); $baseOfExpectedStrength = $professionLevels->getNextLevelsStrengthModifier() + 3; /* default max strength increment */ $baseOfExpectedAgility = $professionLevels->getNextLevelsAgilityModifier() + 3; /* default max agility increment */ $baseOfExpectedKnack = $professionLevels->getNextLevelsKnackModifier() + 3; /* default max knack increment */ $baseOfExpectedWill = $professionLevels->getNextLevelsWillModifier() + 3; /* default max knack increment */ $baseOfExpectedIntelligence = $professionLevels->getNextLevelsIntelligenceModifier() + 3; /* default max knack increment */ $baseOfExpectedCharisma = $professionLevels->getNextLevelsCharismaModifier() + 3; /* default max charisma increment */ return [[$commonHuman = CommonHuman::getIt(), $male, $exceptionalityProperties, $professionLevels, $tables, $weightInKgAdjustment, $heightInCm, $age, $baseOfExpectedStrength, $baseOfExpectedAgility, $baseOfExpectedKnack, $baseOfExpectedWill, $baseOfExpectedIntelligence, $baseOfExpectedCharisma], [$commonHuman, $female, $exceptionalityProperties, $professionLevels, $tables, $weightInKgAdjustment, $heightInCm, $age, $baseOfExpectedStrength - 1, $baseOfExpectedAgility, $baseOfExpectedKnack, $baseOfExpectedWill, $baseOfExpectedIntelligence, $baseOfExpectedCharisma + 1]]; }
private function createPersonEntity(Tables $tables, ExceptionalityPropertiesFactory $exceptionalityPropertiesFactory) { return new Person(CommonHuman::getIt(), Male::getIt(), Name::getIt('foo'), new Exceptionality(PlayerDecision::getIt(), $fate = FateOfGoodRear::getIt(), $exceptionalityPropertiesFactory->createChosenProperties($fate, $professionFirstLevel = ProfessionFirstLevel::createFirstLevel(Fighter::getIt()), 0, 1, 1, 0, 1, 0)), new Memories(), $professionLevels = new ProfessionLevels(ProfessionZeroLevel::createZeroLevel(Commoner::getIt()), $professionFirstLevel), $background = Background::createIt($fate, 4, 3, 5), Skills::createSkills($professionLevels, $background->getBackgroundSkillPoints(), new PhysicalSkills(ProfessionZeroLevel::createZeroLevel(Commoner::getIt())), new PsychicalSkills(ProfessionZeroLevel::createZeroLevel(Commoner::getIt())), new CombinedSkills(ProfessionZeroLevel::createZeroLevel(Commoner::getIt())), $tables), WeightInKg::getIt(123.45), HeightInCm::getIt(78.89), Age::getIt(56), $tables); }