return is_tough;
}
+bool PlayerClass::is_martial_arts_pro() const
+{
+ auto is_martial_arts_pro = this->equals(PlayerClassType::MONK);
+ is_martial_arts_pro |= this->equals(PlayerClassType::FORCETRAINER);
+ return is_martial_arts_pro;
+}
+
bool PlayerClass::is_every_magic() const
{
auto is_every_magic = this->equals(PlayerClassType::SORCERER);
bool can_browse() const;
bool has_listed_magics() const;
bool is_tough() const;
+ bool is_martial_arts_pro() const;
bool is_every_magic() const;
bool has_number_of_spells_learned() const;
bool heavy_armor(PlayerType *player_ptr)
{
PlayerClass pc(player_ptr);
- if (!pc.equals(PlayerClassType::MONK) && !pc.equals(PlayerClassType::FORCETRAINER) && !pc.equals(PlayerClassType::NINJA))
+ if (!pc.is_martial_arts_pro() && !pc.equals(PlayerClassType::NINJA)) {
return false;
+ }
WEIGHT monk_arm_wgt = 0;
- if (player_ptr->inventory_list[INVEN_MAIN_HAND].tval > ItemKindType::SWORD)
+ if (player_ptr->inventory_list[INVEN_MAIN_HAND].tval > ItemKindType::SWORD) {
monk_arm_wgt += player_ptr->inventory_list[INVEN_MAIN_HAND].weight;
- if (player_ptr->inventory_list[INVEN_SUB_HAND].tval > ItemKindType::SWORD)
+ }
+
+ if (player_ptr->inventory_list[INVEN_SUB_HAND].tval > ItemKindType::SWORD) {
monk_arm_wgt += player_ptr->inventory_list[INVEN_SUB_HAND].weight;
+ }
+
monk_arm_wgt += player_ptr->inventory_list[INVEN_BODY].weight;
monk_arm_wgt += player_ptr->inventory_list[INVEN_HEAD].weight;
monk_arm_wgt += player_ptr->inventory_list[INVEN_OUTER].weight;
auto tval = player_ptr->inventory_list[INVEN_MAIN_HAND + i].tval;
auto sval = player_ptr->inventory_list[INVEN_MAIN_HAND + i].sval;
PlayerClass pc(player_ptr);
- return (pc.equals(PlayerClassType::MONK) || pc.equals(PlayerClassType::FORCETRAINER)) && (player_ptr->weapon_exp_max[tval][sval] == PlayerSkill::weapon_exp_at(PlayerSkillRank::UNSKILLED));
+ return pc.is_martial_arts_pro() && (player_ptr->weapon_exp_max[tval][sval] == PlayerSkill::weapon_exp_at(PlayerSkillRank::UNSKILLED));
}
bool has_good_luck(PlayerType *player_ptr)
ac += 25;
}
- if ((pc.equals(PlayerClassType::MONK) || pc.equals(PlayerClassType::FORCETRAINER)) && !heavy_armor(player_ptr)) {
+ if (pc.is_martial_arts_pro() && !heavy_armor(player_ptr)) {
if (!(player_ptr->inventory_list[INVEN_BODY].k_idx)) {
ac += (player_ptr->lev * 3) / 2;
}
}
PlayerClass pc(player_ptr);
- if ((pc.equals(PlayerClassType::MONK) || pc.equals(PlayerClassType::FORCETRAINER) || pc.equals(PlayerClassType::NINJA))
- && (heavy_armor(player_ptr) != player_ptr->monk_notify_aux)) {
+ if ((pc.is_martial_arts_pro() || pc.equals(PlayerClassType::NINJA)) && (heavy_armor(player_ptr) != player_ptr->monk_notify_aux)) {
if (heavy_armor(player_ptr)) {
msg_print(_("装備が重くてバランスを取れない。", "The weight of your armor disrupts your balance."));
if (w_ptr->is_loading_now) {
int basedam;
damage[i] = player_ptr->dis_to_d[i] * 100;
PlayerClass pc(player_ptr);
- if ((pc.equals(PlayerClassType::MONK) || pc.equals(PlayerClassType::FORCETRAINER)) && (empty_hands(player_ptr, true) & EMPTY_HAND_MAIN)) {
+ if (pc.is_martial_arts_pro() && (empty_hands(player_ptr, true) & EMPTY_HAND_MAIN)) {
if (!calc_weapon_damage_limit(player_ptr, i, damage, &basedam, o_ptr))
break;