/** * Note about SHIELD: "weaponlike" means for attacking. If you provide a shield, it will considered as a weapon for * direct attack. If yu want fight number malus with shield as a protective armament, use @see * \DrdPlus\Skills\Physical\PhysicalSkills::getMalusToFightNumberWithProtective And one more note: RESTRICTION from * shield is NOT applied if the shield is used as a weapon * (malus is already included in FightWithShields skill). * * @param WeaponlikeCode $weaponlikeCode * @param MissingWeaponSkillTable $missingWeaponSkillsTable * @param bool $fightsWithTwoWeapons * @return int * @throws \DrdPlus\Skills\Physical\Exceptions\PhysicalSkillsDoNotKnowHowToUseThatWeapon */ public function getMalusToFightNumberWithWeaponlike(WeaponlikeCode $weaponlikeCode, MissingWeaponSkillTable $missingWeaponSkillsTable, $fightsWithTwoWeapons) { $fightWithWeaponRankValue = $this->getHighestRankForSuitableFightWithWeapon($weaponlikeCode); /** @noinspection ExceptionsAnnotatingAndHandlingInspection */ $malus = $missingWeaponSkillsTable->getFightNumberMalusForSkill($fightWithWeaponRankValue); if ($fightsWithTwoWeapons) { /** @noinspection ExceptionsAnnotatingAndHandlingInspection */ $malus += $missingWeaponSkillsTable->getFightNumberMalusForSkill($this->determineCurrentSkillRankValue($this->getFightWithTwoWeapons())); } return $malus; }
/** * Only for using shield as a weapon! * * @param MissingShieldSkillTable $missingShieldSkillsTable * @param int $shieldRestriction as a negative number * @param MissingWeaponSkillTable $missingWeaponSkillsTable * @return int negative number or zero * @throws \Granam\Integer\Tools\Exceptions\WrongParameterType * @throws \Granam\Integer\Tools\Exceptions\ValueLostOnCast * @throws \Granam\Integer\Tools\Exceptions\NegativeIntegerCanNotBePositive */ public function getMalusToFightNumber(MissingShieldSkillTable $missingShieldSkillsTable, $shieldRestriction, MissingWeaponSkillTable $missingWeaponSkillsTable) { /** @noinspection ExceptionsAnnotatingAndHandlingInspection */ return $this->getRestrictionWithShield($missingShieldSkillsTable, $shieldRestriction) + $missingWeaponSkillsTable->getFightNumberMalusForSkill(0); }
/** * @param RangedWeaponCode $rangeWeaponCode * @param MissingWeaponSkillTable $missingWeaponSkillsTable * @return int * @throws \DrdPlus\Skills\Combined\Exceptions\CombinedSkillsDoNotHowToUseThatWeapon */ public function getMalusToFightNumberWithShootingWeapon(RangedWeaponCode $rangeWeaponCode, MissingWeaponSkillTable $missingWeaponSkillsTable) { $rankValue = $this->getFightWithShootingWeaponRankValue($rangeWeaponCode); /** @noinspection ExceptionsAnnotatingAndHandlingInspection */ return $missingWeaponSkillsTable->getFightNumberMalusForSkill($rankValue); }