public function getMissingStrengthForArmament(
        ArmamentCode $armamentCode,
        Strength $currentStrength,
        Size $bodySize
    ): int
    {
        $requiredStrength = $this->tables->getArmamentsTableByArmamentCode($armamentCode)->getRequiredStrengthOf($armamentCode);
        if ($requiredStrength === false) { // no strength is required, like for a hand
            return 0;
        }
        $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;
    }
public function getMissingStrengthForArmament(
        ArmamentCode $armamentCode,
        Strength $currentStrength,
        Size $bodySize
    ): int
    {
        $requiredStrength = $this->tables->getArmamentsTableByArmamentCode($armamentCode)->getRequiredStrengthOf($armamentCode);
        if ($requiredStrength === false) { // no strength is required, like for a hand
            return 0;
        }
        $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;
    }
public function getMissingStrengthForArmament ( ArmamentCode $ armamentCode , Strength $ currentStrength , Size $ bodySize ) : int { $ requiredStrength = $ this -> tables -> getArmamentsTableByArmamentCode ( $ armamentCode ) -> getRequiredStrengthOf ( $ armamentCode ) ; if ( $ requiredStrength === false ) { // no strength is required, like for a hand return 0 ; } $ 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 ; }
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
See PPH page 91 right column