#include "object/object-info.h"
#include "object/object-kind.h"
#include "perception/object-perception.h"
+#include "player-base/player-class.h"
#include "player-info/equipment-info.h"
#include "player-status/player-energy.h"
#include "player/attack-defense-types.h"
break;
}
case SV_SCROLL_SPELL: {
- if ((this->player_ptr->pclass == PlayerClassType::WARRIOR) || (this->player_ptr->pclass == PlayerClassType::IMITATOR) || (this->player_ptr->pclass == PlayerClassType::MINDCRAFTER)
- || (this->player_ptr->pclass == PlayerClassType::SORCERER) || (this->player_ptr->pclass == PlayerClassType::ARCHER) || (this->player_ptr->pclass == PlayerClassType::MAGIC_EATER)
- || (this->player_ptr->pclass == PlayerClassType::RED_MAGE) || (this->player_ptr->pclass == PlayerClassType::SAMURAI) || (this->player_ptr->pclass == PlayerClassType::BLUE_MAGE)
- || (this->player_ptr->pclass == PlayerClassType::CAVALRY) || (this->player_ptr->pclass == PlayerClassType::BERSERKER) || (this->player_ptr->pclass == PlayerClassType::SMITH)
- || (this->player_ptr->pclass == PlayerClassType::MIRROR_MASTER) || (this->player_ptr->pclass == PlayerClassType::NINJA) || (this->player_ptr->pclass == PlayerClassType::SNIPER))
+ if (!PlayerClass(this->player_ptr).has_number_of_spells_learned()) {
break;
+ }
this->player_ptr->add_spells++;
this->player_ptr->update |= PU_SPELLS;
#include "object/object-info.h"
#include "object/object-kind.h"
#include "perception/object-perception.h"
+#include "player-base/player-class.h"
#include "player-status/player-energy.h"
#include "status/experience.h"
#include "system/object-type-definition.h"
chance = USE_DEVICE;
}
- if ((chance < USE_DEVICE) || (randint1(chance) < USE_DEVICE) || (this->player_ptr->pclass == PlayerClassType::BERSERKER)) {
+ if ((chance < USE_DEVICE) || (randint1(chance) < USE_DEVICE) || PlayerClass(this->player_ptr).equals(PlayerClassType::BERSERKER)) {
if (flush_failure) {
flush();
}
return is_every_magic;
}
+/*!
+ * @brief 「覚えた呪文の数」という概念を持つクラスかをチェックする.
+ * @return 呪文の数を持つか否か
+ */
+bool PlayerClass::has_number_of_spells_learned() const
+{
+ auto has_number_of_spells_learned = this->equals(PlayerClassType::MAGE);
+ has_number_of_spells_learned |= this->equals(PlayerClassType::PRIEST);
+ has_number_of_spells_learned |= this->equals(PlayerClassType::ROGUE);
+ has_number_of_spells_learned |= this->equals(PlayerClassType::RANGER);
+ has_number_of_spells_learned |= this->equals(PlayerClassType::PALADIN);
+ has_number_of_spells_learned |= this->equals(PlayerClassType::WARRIOR_MAGE);
+ has_number_of_spells_learned |= this->equals(PlayerClassType::CHAOS_WARRIOR);
+ has_number_of_spells_learned |= this->equals(PlayerClassType::MONK);
+ has_number_of_spells_learned |= this->equals(PlayerClassType::HIGH_MAGE);
+ has_number_of_spells_learned |= this->equals(PlayerClassType::TOURIST);
+ has_number_of_spells_learned |= this->equals(PlayerClassType::BEASTMASTER);
+ has_number_of_spells_learned |= this->equals(PlayerClassType::BARD);
+ has_number_of_spells_learned |= this->equals(PlayerClassType::FORCETRAINER);
+ return has_number_of_spells_learned;
+}
+
bool PlayerClass::lose_balance()
{
if (this->player_ptr->pclass != PlayerClassType::SAMURAI) {
bool is_soldier() const;
bool is_wizard() const;
bool is_every_magic() const;
+ bool has_number_of_spells_learned() const;
bool lose_balance();
void break_samurai_stance(std::initializer_list<SamuraiStanceType> stance_list);