/** * @param WeaponlikeCode $weaponlikeCode * @return array|string[] */ private function getWeaponTypesByWeaponCode(WeaponlikeCode $weaponlikeCode) { $types = []; if ($weaponlikeCode->isMelee()) { $types[] = self::MELEE; } if ($weaponlikeCode->isShootingWeapon()) { $types[] = self::SHOOTING; } if ($weaponlikeCode->isThrowingWeapon()) { $types[] = self::THROWING; } return $types; }
/** * If you want to use shield as a PROTECTIVE item, there is no base of wounds malus from that. * * @param WeaponlikeCode $weaponlikeCode * @param MissingWeaponSkillTable $missingWeaponSkillsTable * @param bool $fightsWithTwoWeapons * @return int * @throws Exceptions\UnknownTypeOfWeapon */ public function getMalusToBaseOfWoundsWithWeaponlike(WeaponlikeCode $weaponlikeCode, MissingWeaponSkillTable $missingWeaponSkillsTable, $fightsWithTwoWeapons) { if ($weaponlikeCode->isMelee() || $weaponlikeCode->isThrowingWeapon()) { /** @noinspection ExceptionsAnnotatingAndHandlingInspection */ return $this->getPhysicalSkills()->getMalusToBaseOfWoundsWithWeaponlike($weaponlikeCode, $missingWeaponSkillsTable, $fightsWithTwoWeapons); } if ($weaponlikeCode->isShootingWeapon()) { /** @noinspection ExceptionsAnnotatingAndHandlingInspection */ return $this->getCombinedSkills()->getMalusToBaseOfWoundsWithShootingWeapon($weaponlikeCode->convertToRangedWeaponCodeEquivalent(), $missingWeaponSkillsTable); } if ($weaponlikeCode->isProjectile()) { return 0; } throw new Exceptions\UnknownTypeOfWeapon($weaponlikeCode); }