/** * Bows get bonus to range from used strength (up to maximal strength applicable for given bow). * Other ranged weapons gets no range bonus (zero) from strength. * * @param RangedWeaponCode $rangedWeaponCode * @param Strength $currentStrength * @return int * @throws CanNotUseWeaponBecauseOfMissingStrength * @throws UnknownBow * @throws UnknownRangedWeapon */ private function getEncounterRangeBonusByStrength(RangedWeaponCode $rangedWeaponCode, Strength $currentStrength) { if (!$rangedWeaponCode->isBow()) { return 0; } $currentStrength = $this->getApplicableStrength($rangedWeaponCode, $currentStrength); // the range bonus for bow is equal to strength applicable for it return min($this->tables->getBowsTable()->getMaximalApplicableStrengthOf($rangedWeaponCode), $currentStrength->getValue()); }