#include "io/input-key-acceptor.h"
#include "io/write-diary.h"
#include "main/sound-of-music.h"
+#include "player-base/player-class.h"
#include "player/player-personality.h"
-#include "player/player-realm.h"
#include "system/player-type-definition.h"
#include "term/screen-processor.h"
#include "util/angband-files.h"
if (creature_ptr->pclass == CLASS_WARRIOR || creature_ptr->pclass == CLASS_MONK || creature_ptr->pclass == CLASS_SAMURAI
|| creature_ptr->pclass == CLASS_BERSERKER)
strcpy(tmp, subtitle[randint0(MAX_SUBTITLE - 1)]);
- else if (is_wizard_class(creature_ptr))
+ else if (PlayerClass(creature_ptr).is_wizard())
strcpy(tmp, subtitle[randint0(MAX_SUBTITLE - 1) + 1]);
else
strcpy(tmp, subtitle[randint0(MAX_SUBTITLE - 2) + 1]);
#include "object/item-tester-hooker.h"
#include "object/item-use-flags.h"
#include "object/object-kind.h"
-#include "player/player-realm.h"
+#include "player-base/player-class.h"
#include "system/object-type-definition.h"
#include "system/player-type-definition.h"
#include "view/display-messages.h"
describe_flavor(caster_ptr, o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
/* Mages recharge objects more safely. */
- if (is_wizard_class(caster_ptr)) {
+ if (PlayerClass(caster_ptr).is_wizard()) {
/* 10% chance to blow up one rod, otherwise draining. */
if (o_ptr->tval == TV_ROD) {
if (one_in_(10))
{
return (this->player_ptr->pclass == CLASS_BERSERKER) && (this->player_ptr->lev > 34);
}
+
+bool PlayerClass::is_wizard() const
+{
+ auto is_wizard = this->player_ptr->pclass == CLASS_MAGE;
+ is_wizard |= this->player_ptr->pclass == CLASS_HIGH_MAGE;
+ is_wizard |= this->player_ptr->pclass == CLASS_SORCERER;
+ is_wizard |= this->player_ptr->pclass == CLASS_MAGIC_EATER;
+ is_wizard |= this->player_ptr->pclass == CLASS_BLUE_MAGE;
+ is_wizard |= this->player_ptr->pclass == CLASS_ELEMENTALIST;
+ return is_wizard;
+}
virtual ~PlayerClass() = default;
bool can_resist_stun() const;
+ bool is_wizard() const;
private:
player_type *player_ptr;
int16_t get_realm1_book(player_type *player_ptr) { return player_ptr->realm1 + TV_LIFE_BOOK - 1; }
int16_t get_realm2_book(player_type *player_ptr) { return player_ptr->realm2 + TV_LIFE_BOOK - 1; }
-
-bool is_wizard_class(player_type *player_ptr)
-{
- return (player_ptr->pclass == CLASS_MAGE || player_ptr->pclass == CLASS_HIGH_MAGE || player_ptr->pclass == CLASS_SORCERER || player_ptr->pclass == CLASS_MAGIC_EATER
- || player_ptr->pclass == CLASS_BLUE_MAGE || player_ptr->pclass == CLASS_ELEMENTALIST);
-}
struct player_type;
int16_t get_realm1_book(player_type *player_ptr);
int16_t get_realm2_book(player_type *player_ptr);
-bool is_wizard_class(player_type *player_ptr);
#include "core/player-redraw-types.h"
#include "effect/effect-characteristics.h"
#include "effect/effect-processor.h"
+#include "player-base/player-class.h"
#include "player/attack-defense-types.h"
-#include "player/player-realm.h"
#include "spell-kind/magic-item-recharger.h"
#include "spell-kind/spells-floor.h"
#include "spell-kind/spells-launcher.h"
POSITION rad = (plev < 30) ? 2 : 3;
int base;
- if (is_wizard_class(caster_ptr))
+ if (PlayerClass(caster_ptr).is_wizard())
base = plev + plev / 2;
else
base = plev + plev / 4;
#include "effect/effect-characteristics.h"
#include "effect/effect-processor.h"
#include "hpmp/hp-mp-processor.h"
+#include "player-base/player-class.h"
#include "player-info/race-info.h"
#include "player/digestion-processor.h"
#include "player/player-damage.h"
-#include "player/player-realm.h"
#include "spell-kind/spells-charm.h"
#include "spell-kind/spells-detection.h"
#include "spell-kind/spells-genocide.h"
POSITION rad = (plev < 30) ? 2 : 3;
int base;
- if (is_wizard_class(caster_ptr))
+ if (PlayerClass(caster_ptr).is_wizard())
base = plev + plev / 2;
else
base = plev + plev / 4;
#include "cmd-action/cmd-spell.h"
#include "monster-floor/monster-summon.h"
#include "monster-floor/place-monster-types.h"
+#include "player-base/player-class.h"
#include "player-info/race-info.h"
#include "player/player-damage.h"
-#include "player/player-realm.h"
#include "spell-kind/spells-charm.h"
#include "spell-kind/spells-detection.h"
#include "spell-kind/spells-floor.h"
POSITION rad = (plev < 30) ? 2 : 3;
int base;
- if (is_wizard_class(caster_ptr))
+ if (PlayerClass(caster_ptr).is_wizard())
base = plev + plev / 2;
else
base = plev + plev / 4;
#include "object/item-tester-hooker.h"
#include "object/item-use-flags.h"
#include "object/object-kind.h"
-#include "player/player-realm.h"
+#include "player-base/player-class.h"
#include "system/player-type-definition.h"
#include "system/object-type-definition.h"
#include "view/display-messages.h"
describe_flavor(caster_ptr, o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
- if (is_wizard_class(caster_ptr) || caster_ptr->pclass == CLASS_MAGIC_EATER || caster_ptr->pclass == CLASS_BLUE_MAGE) {
+ if (PlayerClass(caster_ptr).is_wizard()) {
/* 10% chance to blow up one rod, otherwise draining. */
if (o_ptr->tval == TV_ROD) {
if (one_in_(10))