/** * @param Strength $strength * @param Agility $agility * @param Height $height */ public function __construct(Strength $strength, Agility $agility, Height $height) { /** @noinspection ExceptionsAnnotatingAndHandlingInspection */ parent::__construct(SumAndRound::average($strength->getValue(), $agility->getValue()) + SumAndRound::ceil($height->getValue() / 3) - 2); }
/** * @param Strength $strength * @param Will $will */ public function __construct(Strength $strength, Will $will) { /** @noinspection ExceptionsAnnotatingAndHandlingInspection */ parent::__construct(SumAndRound::average($strength->getValue(), $will->getValue())); }
/** * See PPH page 91, right column * * @param ArmamentCode $armamentCode * @param Size $bodySize * @param Strength $currentStrength * @return int positive number * @throws \DrdPlus\Tables\Armaments\Exceptions\UnknownArmament */ public function getMissingStrengthForArmament(ArmamentCode $armamentCode, Strength $currentStrength, Size $bodySize) { $requiredStrength = $this->tables->getArmamentsTableByArmamentCode($armamentCode)->getRequiredStrengthOf($armamentCode); $missingStrength = $requiredStrength - $currentStrength->getValue(); if ($armamentCode instanceof ArmorCode) { // only armor weight is related to body size $missingStrength += $bodySize->getValue(); } if ($missingStrength < 0) { // missing strength can not be negative, of course return 0; } return $missingStrength; }
/** * @return int 0+ */ public function getStrengthLossBecauseOfLimit() { return $this->firstLevelUnlimitedStrength->getValue() - $this->getFirstLevelStrength()->getValue(); }
/** * @param Strength $strength * @param RaceCode $raceCode * @param SubRaceCode $subraceCode * @param RacesTable $racesTable */ public function __construct(Strength $strength, RaceCode $raceCode, SubRaceCode $subraceCode, RacesTable $racesTable) { /** @noinspection ExceptionsAnnotatingAndHandlingInspection */ parent::__construct($strength->getValue() + $racesTable->getToughness($raceCode, $subraceCode)); }
private function sumProperties(Strength $strengthIncrement, Agility $agilityIncrement, Knack $knackIncrement, Will $willIncrement, Intelligence $intelligenceIncrement, Charisma $charismaIncrement) { return $strengthIncrement->getValue() + $agilityIncrement->getValue() + $knackIncrement->getValue() + $willIncrement->getValue() + $intelligenceIncrement->getValue() + $charismaIncrement->getValue(); }
/** * Affects activities using strength, agility or knack, see PPH page 113, right column, bottom. * @param Strength $strength * @param Weight $cargoWeight * @return int negative number or zero * @throws \DrdPlus\Tables\Measurements\Partials\Exceptions\BonusRequiresInteger */ public function getMalusFromLoad(Strength $strength, Weight $cargoWeight) { $requiredStrength = $cargoWeight->getBonus()->getValue(); $missingStrength = $requiredStrength - $strength->getValue(); $malus = -SumAndRound::half($missingStrength); // see PPH page 113, right column if ($malus > 0) { return 0; } return $malus; }
/** * @param Strength $strength * @param Athletics $athletics */ public function __construct(Strength $strength, Athletics $athletics) { /** @noinspection ExceptionsAnnotatingAndHandlingInspection */ parent::__construct($strength->getValue() + 21 + $athletics->getAthleticsBonus()->getValue()); }