#include "system/floor-type-definition.h"
#include "system/player-type-definition.h"
#include "term/screen-processor.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "view/display-messages.h"
bool cmd_limit_image(PlayerType *player_ptr)
{
- if (player_ptr->effects()->hallucination()->is_hallucinated()) {
+ if (player_ptr->effects()->hallucination().is_hallucinated()) {
msg_print(_("幻覚が見えて集中できない!", "Your hallucinations prevent you from concentrating!"));
return true;
}
#include "system/player-type-definition.h"
#include "system/redrawing-flags-updater.h"
#include "system/terrain-type-definition.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
bool do_past = false;
if (grid.has_monster() && (m_ptr->ml || p_can_enter || p_can_kill_walls)) {
auto *r_ptr = &m_ptr->get_monrace();
- auto effects = player_ptr->effects();
- auto is_stunned = effects->stun()->is_stunned();
+ const auto effects = player_ptr->effects();
+ const auto is_stunned = effects->stun()->is_stunned();
auto can_cast = !effects->confusion().is_confused();
- auto is_hallucinated = effects->hallucination()->is_hallucinated();
+ const auto is_hallucinated = effects->hallucination().is_hallucinated();
can_cast &= !is_hallucinated;
can_cast &= m_ptr->ml;
can_cast &= !is_stunned;
lite_spot(player_ptr, pos.y, pos.x);
}
} else {
- auto effects = player_ptr->effects();
- auto is_confused = effects->confusion().is_confused();
- auto is_stunned = effects->stun()->is_stunned();
- auto is_hallucinated = effects->hallucination()->is_hallucinated();
+ const auto effects = player_ptr->effects();
+ const auto is_confused = effects->confusion().is_confused();
+ const auto is_stunned = effects->stun()->is_stunned();
+ const auto is_hallucinated = effects->hallucination().is_hallucinated();
if (boundary_floor(grid, terrain, terrain_mimic)) {
msg_print(_("それ以上先には進めない。", "You cannot go any more."));
if (!(is_confused || is_stunned || is_hallucinated)) {
}
if (can_move && !pattern_seq(player_ptr, pos)) {
- auto effects = player_ptr->effects();
- auto is_confused = effects->confusion().is_confused();
- auto is_stunned = effects->stun()->is_stunned();
- auto is_hallucinated = effects->hallucination()->is_hallucinated();
+ const auto effects = player_ptr->effects();
+ const auto is_confused = effects->confusion().is_confused();
+ const auto is_stunned = effects->stun()->is_stunned();
+ const auto is_hallucinated = effects->hallucination().is_hallucinated();
if (!(is_confused || is_stunned || is_hallucinated)) {
energy.reset_player_turn();
}
#include "system/player-type-definition.h"
#include "system/terrain-type-definition.h"
#include "term/screen-processor.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
#include "view/display-messages.h"
i = i / 10;
}
- if (effects->confusion().is_confused() || effects->hallucination()->is_hallucinated()) {
+ if (effects->confusion().is_confused() || effects->hallucination().is_hallucinated()) {
i = i / 10;
}
power_disarm = power_disarm / 10;
}
- if (effects->confusion().is_confused() || effects->hallucination()->is_hallucinated()) {
+ if (effects->confusion().is_confused() || effects->hallucination().is_hallucinated()) {
power_disarm = power_disarm / 10;
}
i = i / 10;
}
- if (effects->confusion().is_confused() || effects->hallucination()->is_hallucinated()) {
+ if (effects->confusion().is_confused() || effects->hallucination().is_hallucinated()) {
i = i / 10;
}
i = i / 10;
}
- if (effects->confusion().is_confused() || effects->hallucination()->is_hallucinated()) {
+ if (effects->confusion().is_confused() || effects->hallucination().is_hallucinated()) {
i = i / 10;
}
#include "system/angband.h"
#include "system/player-type-definition.h"
#include "system/redrawing-flags-updater.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/player-paralysis.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
const auto is_confused = effects->confusion().is_confused();
const auto is_blind = effects->blindness().is_blind();
const auto is_stunned = effects->stun()->is_stunned();
- const auto is_hallucinated = effects->hallucination()->is_hallucinated();
+ const auto is_hallucinated = effects->hallucination().is_hallucinated();
const auto is_paralyzed = effects->paralysis()->is_paralyzed();
if (is_confused || is_blind || is_hallucinated || is_stunned || is_paralyzed) {
return;
#include "system/monster-entity.h"
#include "system/monster-race-info.h"
#include "system/player-type-definition.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
}
const auto m_name = monster_desc(player_ptr, m_ptr, 0);
- auto effects = player_ptr->effects();
- auto is_hallucinated = effects->hallucination()->is_hallucinated();
+ const auto effects = player_ptr->effects();
+ const auto is_hallucinated = effects->hallucination().is_hallucinated();
if (m_ptr->ml) {
if (!is_hallucinated) {
monster_race_track(player_ptr, m_ptr->ap_r_idx);
health_track(player_ptr, g_ptr->m_idx);
}
- auto is_confused = effects->confusion().is_confused();
- auto is_stunned = effects->stun()->is_stunned();
+ const auto is_confused = effects->confusion().is_confused();
+ const auto is_stunned = effects->stun()->is_stunned();
if (is_female(*r_ptr) && !(is_stunned || is_confused || is_hallucinated || !m_ptr->ml)) {
// @todo 「特定の武器を装備している」旨のメソッドを別途作る
constexpr auto zantetsu = FixedArtifactId::ZANTETSU;
#include "system/terrain-type-definition.h"
#include "target/target-getter.h"
#include "term/screen-processor.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
#include "view/display-messages.h"
i = i / 10;
}
- if (effects->confusion().is_confused() || effects->hallucination()->is_hallucinated()) {
+ if (effects->confusion().is_confused() || effects->hallucination().is_hallucinated()) {
i = i / 10;
}
#include "target/target-setter.h"
#include "target/target-types.h"
#include "term/screen-processor.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
#include "util/int-char-converter.h"
power_desc[num] = _("ペットを放す", "dismiss pets");
powers[num++] = PET_DISMISS;
- auto is_hallucinated = player_ptr->effects()->hallucination()->is_hallucinated();
- auto taget_of_pet = player_ptr->current_floor_ptr->m_list[player_ptr->pet_t_m_idx].get_appearance_monrace().name.data();
- auto target_of_pet_appearance = is_hallucinated ? _("何か奇妙な物", "something strange") : taget_of_pet;
- auto mes = _("ペットのターゲットを指定 (現在:%s)", "specify a target of pet (now:%s)");
- auto target_name = player_ptr->pet_t_m_idx > 0 ? target_of_pet_appearance : _("指定なし", "nothing");
- auto target_ask = format(mes, target_name);
+ const auto is_hallucinated = player_ptr->effects()->hallucination().is_hallucinated();
+ const auto taget_of_pet = player_ptr->current_floor_ptr->m_list[player_ptr->pet_t_m_idx].get_appearance_monrace().name.data();
+ const auto target_of_pet_appearance = is_hallucinated ? _("何か奇妙な物", "something strange") : taget_of_pet;
+ const auto mes = _("ペットのターゲットを指定 (現在:%s)", "specify a target of pet (now:%s)");
+ const auto target_name = player_ptr->pet_t_m_idx > 0 ? target_of_pet_appearance : _("指定なし", "nothing");
+ const auto target_ask = format(mes, target_name);
power_desc[num] = target_ask;
powers[num++] = PET_TARGET;
power_desc[num] = _("近くにいろ", "stay close");
#include "term/gameterm.h"
#include "term/screen-processor.h"
#include "term/term-color-types.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/timed-effects.h"
#include "util/angband-files.h"
#include "util/int-char-converter.h"
constexpr auto mes = _("%s日目, 時刻は%d:%02d %sです。", "This is day %s. The time is %d:%02d %s.");
msg_format(mes, day_buf.data(), (hour % 12 == 0) ? 12 : (hour % 12), min, (hour < 12) ? "AM" : "PM");
std::filesystem::path path;
- if (!randint0(10) || player_ptr->effects()->hallucination()->is_hallucinated()) {
+ if (!randint0(10) || player_ptr->effects()->hallucination().is_hallucinated()) {
path = path_build(ANGBAND_DIR_FILE, _("timefun_j.txt", "timefun.txt"));
} else {
path = path_build(ANGBAND_DIR_FILE, _("timenorm_j.txt", "timenorm.txt"));
#include "target/projection-path-calculator.h"
#include "target/target-checker.h"
#include "target/target-getter.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
#include "view/display-messages.h"
msg_format(_("%sが%sに命中した。", "The %s hits %s."), item_name.data(), m_name.data());
if (m_ptr->ml) {
- if (!player_ptr->effects()->hallucination()->is_hallucinated()) {
+ if (!player_ptr->effects()->hallucination().is_hallucinated()) {
monster_race_track(player_ptr, m_ptr->ap_r_idx);
}
#include "system/player-type-definition.h"
#include "timed-effect/player-acceleration.h"
#include "timed-effect/player-deceleration.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/player-paralysis.h"
#include "timed-effect/player-poison.h"
#include "timed-effect/player-stun.h"
BadStatusSetter bss(player_ptr);
const auto effects = player_ptr->effects();
- if (effects->hallucination()->is_hallucinated()) {
+ if (effects->hallucination().is_hallucinated()) {
(void)bss.mod_hallucination(-1);
}
#include "system/redrawing-flags-updater.h"
#include "term/screen-processor.h"
#include "timed-effect/player-cut.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/player-paralysis.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
player_ptr->energy_need += (int16_t)((int32_t)player_ptr->energy_use * ENERGY_NEED() / 100L);
}
- if (effects->hallucination()->is_hallucinated()) {
+ if (effects->hallucination().is_hallucinated()) {
rfu.set_flag(MainWindowRedrawingFlag::MAP);
}
#include "system/monster-race-info.h"
#include "system/player-type-definition.h"
#include "target/projection-path-calculator.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
#include "view/display-messages.h"
if (grid.has_monster()) {
auto &monster = floor.m_list[grid.m_idx];
if (monster.ml) {
- if (!player_ptr->effects()->hallucination()->is_hallucinated()) {
+ if (!player_ptr->effects()->hallucination().is_hallucinated()) {
monster_race_track(player_ptr, monster.ap_r_idx);
}
#include "system/player-type-definition.h"
#include "system/terrain-type-definition.h"
#include "term/z-form.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
const auto effects = player_ptr->effects();
const auto is_stunned = effects->stun()->is_stunned();
const auto is_confused = effects->confusion().is_confused();
- const auto is_hallucinated = effects->hallucination()->is_hallucinated();
+ const auto is_hallucinated = effects->hallucination().is_hallucinated();
if (is_pattern_tile_cur || is_confused || is_stunned || is_hallucinated) {
return true;
}
#include "system/player-type-definition.h"
#include "timed-effect/player-acceleration.h"
#include "timed-effect/player-deceleration.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/player-paralysis.h"
#include "timed-effect/player-poison.h"
#include "timed-effect/player-stun.h"
effects->cut().set(rd_s16b());
effects->stun()->set(rd_s16b());
effects->poison()->set(rd_s16b());
- effects->hallucination()->set(rd_s16b());
+ effects->hallucination().set(rd_s16b());
player_ptr->protevil = rd_s16b();
player_ptr->invuln = rd_s16b();
if (h_older_than(0, 0, 0)) {
#include "system/monster-entity.h"
#include "system/monster-race-info.h"
#include "system/player-type-definition.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/timed-effects.h"
mam_type *initialize_mam_type(PlayerType *player_ptr, mam_type *mam_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx)
mam_ptr->ac = tr_ptr->ac;
mam_ptr->rlev = ((r_ptr->level >= 1) ? r_ptr->level : 1);
mam_ptr->blinked = false;
- mam_ptr->do_silly_attack = (one_in_(2) && player_ptr->effects()->hallucination()->is_hallucinated());
+ mam_ptr->do_silly_attack = (one_in_(2) && player_ptr->effects()->hallucination().is_hallucinated());
mam_ptr->power = 0;
mam_ptr->obvious = false;
mam_ptr->known = (mam_ptr->m_ptr->cdis <= MAX_PLAYER_SIGHT) || (mam_ptr->t_ptr->cdis <= MAX_PLAYER_SIGHT);
#include "target/projection-path-calculator.h"
#include "target/target-checker.h"
#include "target/target-getter.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/player-paralysis.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
const auto effects = player_ptr->effects();
const auto is_confused = effects->confusion().is_confused();
const auto is_blind = effects->blindness().is_blind();
- const auto is_hallucinated = effects->hallucination()->is_hallucinated();
+ const auto is_hallucinated = effects->hallucination().is_hallucinated();
const auto is_paralyzed = effects->paralysis()->is_paralyzed();
if (is_confused || is_blind || is_paralyzed || is_hallucinated) {
return false;
#include "system/monster-race-info.h"
#include "system/player-type-definition.h"
#include "system/redrawing-flags-updater.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
, m_ptr(&player_ptr->current_floor_ptr->m_list[m_idx])
, method(RaceBlowMethodType::NONE)
, effect(RaceBlowEffectType::NONE)
- , do_silly_attack(one_in_(2) && player_ptr->effects()->hallucination()->is_hallucinated())
+ , do_silly_attack(one_in_(2) && player_ptr->effects()->hallucination().is_hallucinated())
, player_ptr(player_ptr)
{
}
#include "system/player-type-definition.h"
#include "system/redrawing-flags-updater.h"
#include "system/system-variables.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
#include "view/display-messages.h"
auto *floor_ptr = player_ptr->current_floor_ptr;
floor_ptr->object_level = floor_ptr->base_level;
coin_type = 0;
- bool visible = (md_ptr->m_ptr->ml && !player_ptr->effects()->hallucination()->is_hallucinated()) || (md_ptr->r_ptr->kind_flags.has(MonsterKindType::UNIQUE));
+ auto visible = md_ptr->m_ptr->ml && !player_ptr->effects()->hallucination().is_hallucinated();
+ visible |= (md_ptr->r_ptr->kind_flags.has(MonsterKindType::UNIQUE));
if (visible && (dump_item || dump_gold)) {
lore_treasure(player_ptr, md_ptr->m_idx, dump_item, dump_gold);
}
#include "system/monster-race-info.h"
#include "system/player-type-definition.h"
#include "system/redrawing-flags-updater.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
#include "view/display-messages.h"
{
auto *m_ptr = &this->player_ptr->current_floor_ptr->m_list[this->m_idx];
auto &r_ref = m_ptr->get_real_monrace();
- auto is_hallucinated = this->player_ptr->effects()->hallucination()->is_hallucinated();
+ auto is_hallucinated = this->player_ptr->effects()->hallucination().is_hallucinated();
if (((m_ptr->ml == 0) || is_hallucinated) && r_ref.kind_flags.has_not(MonsterKindType::UNIQUE)) {
return;
}
#include "system/monster-entity.h"
#include "system/monster-race-info.h"
#include "system/player-type-definition.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
#include "util/string-processor.h"
static std::optional<std::string> get_fake_monster_name(const PlayerType &player, const MonsterEntity &monster, const std::string &name, const BIT_FLAGS mode)
{
const auto &monrace = monster.get_appearance_monrace();
- const auto is_hallucinated = player.effects()->hallucination()->is_hallucinated();
+ const auto is_hallucinated = player.effects()->hallucination().is_hallucinated();
if (monrace.kind_flags.has_not(MonsterKindType::UNIQUE) || (is_hallucinated && none_bits(mode, MD_IGNORE_HALLU))) {
return std::nullopt;
}
return *pronoun_self;
}
- const auto is_hallucinated = player_ptr->effects()->hallucination()->is_hallucinated();
+ const auto is_hallucinated = player_ptr->effects()->hallucination().is_hallucinated();
const auto name = get_describing_monster_name(*m_ptr, is_hallucinated, mode);
std::stringstream ss;
if (m_ptr->is_pet() && !m_ptr->is_original_ap()) {
#include "system/monster-race-info.h"
#include "system/player-type-definition.h"
#include "system/terrain-type-definition.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
#include "util/string-processor.h"
bool is_original_ap_and_seen(PlayerType *player_ptr, const MonsterEntity *m_ptr)
{
- return m_ptr->ml && !player_ptr->effects()->hallucination()->is_hallucinated() && m_ptr->is_original_ap();
+ return m_ptr->ml && !player_ptr->effects()->hallucination().is_hallucinated() && m_ptr->is_original_ap();
}
/*!
#include "system/monster-race-info.h"
#include "system/player-type-definition.h"
#include "system/redrawing-flags-updater.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
#include "view/display-messages.h"
m_ptr->exp = 0;
if (m_ptr->is_pet() || m_ptr->ml) {
- auto is_hallucinated = player_ptr->effects()->hallucination()->is_hallucinated();
+ const auto is_hallucinated = player_ptr->effects()->hallucination().is_hallucinated();
if (!ignore_unview || player_can_see_bold(player_ptr, m_ptr->fy, m_ptr->fx)) {
if (is_hallucinated) {
MonsterRaceInfo *hallucinated_race = nullptr;
#include "system/player-type-definition.h"
#include "system/redrawing-flags-updater.h"
#include "target/projection-path-calculator.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
#include "world/world.h"
um_ptr->flag = true;
m_ptr->mflag.set(MonsterTemporaryFlagType::ESP);
- if (m_ptr->is_original_ap() && !player_ptr->effects()->hallucination()->is_hallucinated()) {
+ if (m_ptr->is_original_ap() && !player_ptr->effects()->hallucination().is_hallucinated()) {
r_ptr->r_misc_flags.set(MonsterMiscType::WEIRD_MIND);
update_smart_stupid_flags(r_ptr);
}
{
auto *m_ptr = um_ptr->m_ptr;
auto *r_ptr = &m_ptr->get_monrace();
+ const auto is_hallucinated = player_ptr->effects()->hallucination().is_hallucinated();
if (PlayerClass(player_ptr).samurai_stance_is(SamuraiStanceType::MUSOU)) {
um_ptr->flag = true;
um_ptr->m_ptr->mflag.set(MonsterTemporaryFlagType::ESP);
- if (um_ptr->m_ptr->is_original_ap() && !player_ptr->effects()->hallucination()->is_hallucinated()) {
+ if (um_ptr->m_ptr->is_original_ap() && !is_hallucinated) {
update_smart_stupid_flags(r_ptr);
}
return;
}
- auto is_hallucinated = player_ptr->effects()->hallucination()->is_hallucinated();
if (r_ptr->misc_flags.has(MonsterMiscType::EMPTY_MIND)) {
if (m_ptr->is_original_ap() && !is_hallucinated) {
r_ptr->r_misc_flags.set(MonsterMiscType::EMPTY_MIND);
{
auto *m_ptr = um_ptr->m_ptr;
auto *r_ptr = &m_ptr->get_monrace();
- auto is_hallucinated = player_ptr->effects()->hallucination()->is_hallucinated();
+ const auto is_hallucinated = player_ptr->effects()->hallucination().is_hallucinated();
if ((player_ptr->esp_animal) && r_ptr->kind_flags.has(MonsterKindType::ANIMAL)) {
um_ptr->flag = true;
m_ptr->mflag.set(MonsterTemporaryFlagType::ESP);
bool do_cold_blood = check_cold_blood(player_ptr, um_ptr, distance);
bool do_invisible = check_invisible(player_ptr, um_ptr);
- if (!um_ptr->flag || !m_ptr->is_original_ap() || player_ptr->effects()->hallucination()->is_hallucinated()) {
+ if (!um_ptr->flag || !m_ptr->is_original_ap() || player_ptr->effects()->hallucination().is_hallucinated()) {
return;
}
rfu.set_flag(MainWindowRedrawingFlag::UHEALTH);
}
- if (!player_ptr->effects()->hallucination()->is_hallucinated()) {
+ if (!player_ptr->effects()->hallucination().is_hallucinated()) {
auto *r_ptr = &m_ptr->get_monrace();
if ((m_ptr->ap_r_idx == MonsterRaceId::KAGE) && (monraces_info[MonsterRaceId::KAGE].r_sights < MAX_SHORT)) {
monraces_info[MonsterRaceId::KAGE].r_sights++;
#include "target/target-checker.h"
#include "target/target-getter.h"
#include "term/screen-processor.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
#include "util/string-processor.h"
return;
}
- if (!this->player_ptr->effects()->hallucination()->is_hallucinated()) {
+ if (!this->player_ptr->effects()->hallucination().is_hallucinated()) {
monster_race_track(this->player_ptr, this->m_ptr->ap_r_idx);
}
#include "term/gameterm.h"
#include "term/screen-processor.h"
#include "term/z-form.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/player-poison.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
self_ptr->info_list.emplace_back(_("あなたは毒に侵されている。", "You are poisoned."));
}
- if (effects->hallucination()->is_hallucinated()) {
+ if (effects->hallucination().is_hallucinated()) {
self_ptr->info_list.emplace_back(_("あなたは幻覚を見ている。", "You are hallucinating."));
}
}
_("あなたは毒に侵されている", "You are poisoned"));
}
- const auto hallucination = effects->hallucination();
- if (hallucination->is_hallucinated()) {
- info.emplace_back(report_magics_aux(hallucination->current()),
+ const auto &hallucination = effects->hallucination();
+ if (hallucination.is_hallucinated()) {
+ info.emplace_back(report_magics_aux(hallucination.current()),
_("あなたは幻覚を見ている", "You are hallucinating"));
}
#include "system/monster-race-info.h"
#include "system/player-type-definition.h"
#include "system/redrawing-flags-updater.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/timed-effects.h"
#include "view/display-messages.h"
#include "world/world.h"
static bool process_mod_hallucination(PlayerType *player_ptr, std::string_view m_name, const MonsterRaceInfo &monrace)
{
- if (!player_ptr->effects()->hallucination()->is_hallucinated()) {
+ if (!player_ptr->effects()->hallucination().is_hallucinated()) {
return false;
}
#include "system/redrawing-flags-updater.h"
#include "term/screen-processor.h"
#include "term/term-color-types.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/player-paralysis.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
player_ptr->died_from = _("切腹", "Seppuku");
}
} else {
- auto effects = player_ptr->effects();
- auto is_hallucinated = effects->hallucination()->is_hallucinated();
+ const auto effects = player_ptr->effects();
+ const auto is_hallucinated = effects->hallucination().is_hallucinated();
auto paralysis_state = "";
if (effects->paralysis()->is_paralyzed()) {
paralysis_state = player_ptr->free_act ? _("彫像状態で", " while being the statue") : _("麻痺状態で", " while paralyzed");
sound(SOUND_WARN);
if (record_danger && (old_chp > warning)) {
- if (player_ptr->effects()->hallucination()->is_hallucinated() && damage_type == DAMAGE_ATTACK) {
+ if (player_ptr->effects()->hallucination().is_hallucinated() && damage_type == DAMAGE_ATTACK) {
hit_from = _("何か", "something");
}
#include "system/redrawing-flags-updater.h"
#include "system/terrain-type-definition.h"
#include "target/target-checker.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
#include "util/enum-converter.h"
chance = chance / 10;
}
- if (effects->confusion().is_confused() || effects->hallucination()->is_hallucinated()) {
+ if (effects->confusion().is_confused() || effects->hallucination().is_hallucinated()) {
chance = chance / 10;
}
#include "system/player-type-definition.h"
#include "timed-effect/player-acceleration.h"
#include "timed-effect/player-deceleration.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/player-paralysis.h"
#include "timed-effect/player-poison.h"
#include "timed-effect/player-stun.h"
wr_s16b(effects->cut().current());
wr_s16b(effects->stun()->current());
wr_s16b(effects->poison()->current());
- wr_s16b(effects->hallucination()->current());
+ wr_s16b(effects->hallucination().current());
wr_s16b(player_ptr->protevil);
wr_s16b(player_ptr->invuln);
wr_s16b(player_ptr->ult_res);
#include "target/grid-selector.h"
#include "target/projection-path-calculator.h"
#include "target/target-checker.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
#include "view/display-messages.h"
const auto &grid = floor.grid_array[project_m_y][project_m_x];
const auto &monster = floor.m_list[grid.m_idx];
if (project_m_n == 1 && grid.has_monster() && monster.ml) {
- if (!this->player_ptr->effects()->hallucination()->is_hallucinated()) {
+ if (!this->player_ptr->effects()->hallucination().is_hallucinated()) {
monster_race_track(this->player_ptr, monster.ap_r_idx);
}
health_track(this->player_ptr, grid.m_idx);
const auto *g_ptr = &floor_ptr->grid_array[project_m_y][project_m_x];
const auto *m_ptr = &floor_ptr->m_list[g_ptr->m_idx];
if (project_m_n == 1 && g_ptr->has_monster() && m_ptr->ml) {
- if (!player_ptr->effects()->hallucination()->is_hallucinated()) {
+ if (!player_ptr->effects()->hallucination().is_hallucinated()) {
monster_race_track(player_ptr, m_ptr->ap_r_idx);
}
health_track(player_ptr, g_ptr->m_idx);
#include "target/target-checker.h"
#include "target/target-setter.h"
#include "target/target-types.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
#include "view/display-messages.h"
}
if (monster.ml) {
- if (!player_ptr->effects()->hallucination()->is_hallucinated()) {
+ if (!player_ptr->effects()->hallucination().is_hallucinated()) {
monster_race_track(player_ptr, monster.ap_r_idx);
}
#include "system/player-type-definition.h"
#include "system/redrawing-flags-updater.h"
#include "timed-effect/player-deceleration.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/player-paralysis.h"
#include "timed-effect/player-poison.h"
#include "timed-effect/player-stun.h"
v = 0;
}
- auto hallucination = this->player_ptr->effects()->hallucination();
+ auto &hallucination = this->player_ptr->effects()->hallucination();
if (v > 0) {
set_tsuyoshi(this->player_ptr, 0, true);
- if (!hallucination->is_hallucinated()) {
+ if (!hallucination.is_hallucinated()) {
msg_print(_("ワーオ!何もかも虹色に見える!", "Oh, wow! Everything looks so cosmic now!"));
reset_concentration(this->player_ptr, true);
notice = true;
}
} else {
- if (hallucination->is_hallucinated()) {
+ if (hallucination.is_hallucinated()) {
msg_print(_("やっとはっきりと物が見えるようになった。", "You can see clearly again."));
notice = true;
}
}
- hallucination->set(v);
+ hallucination.set(v);
auto &rfu = RedrawingFlagsUpdater::get_instance();
rfu.set_flag(MainWindowRedrawingFlag::TIMED_EFFECT);
if (!notice) {
bool BadStatusSetter::mod_hallucination(const TIME_EFFECT tmp_v)
{
- return this->hallucination(this->player_ptr->effects()->hallucination()->current() + tmp_v);
+ return this->hallucination(this->player_ptr->effects()->hallucination().current() + tmp_v);
}
/*!
#include "system/redrawing-flags-updater.h"
#include "timed-effect/player-acceleration.h"
#include "timed-effect/player-deceleration.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/player-paralysis.h"
#include "timed-effect/player-poison.h"
#include "timed-effect/player-stun.h"
effects->paralysis()->reset();
effects->confusion().reset();
effects->fear().reset();
- effects->hallucination()->reset();
+ effects->hallucination().reset();
effects->poison()->reset();
effects->cut().reset();
effects->stun()->reset();
#include "system/angband-exceptions.h"
#include "system/redrawing-flags-updater.h"
#include "timed-effect/player-deceleration.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/player-paralysis.h"
#include "timed-effect/player-poison.h"
#include "timed-effect/player-stun.h"
is_fully_healthy &= !effects->cut().is_cut();
is_fully_healthy &= !effects->deceleration()->is_slow();
is_fully_healthy &= !effects->paralysis()->is_paralyzed();
- is_fully_healthy &= !effects->hallucination()->is_hallucinated();
+ is_fully_healthy &= !effects->hallucination().is_hallucinated();
is_fully_healthy &= !this->word_recall;
is_fully_healthy &= !this->alter_reality;
return is_fully_healthy;
#include "target/target-checker.h"
#include "target/target-sorter.h"
#include "term/screen-processor.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/timed-effects.h"
#include "util/int-char-converter.h"
#include "view/display-messages.h"
return true;
}
- if (player_ptr->effects()->hallucination()->is_hallucinated()) {
+ if (player_ptr->effects()->hallucination().is_hallucinated()) {
return false;
}
#include "term/screen-processor.h"
#include "term/term-color-types.h"
#include "term/z-form.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
#include "view/display-lore.h"
static ProcessResult describe_hallucinated_target(PlayerType *player_ptr, GridExamination *ge_ptr)
{
- if (!player_ptr->effects()->hallucination()->is_hallucinated()) {
+ if (!player_ptr->effects()->hallucination().is_hallucinated()) {
return ProcessResult::PROCESS_CONTINUE;
}
#include "target/projection-path-calculator.h"
#include "target/target-sorter.h"
#include "target/target-types.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
#include "window/main-window-util.h"
return false;
}
- if (player_ptr->effects()->hallucination()->is_hallucinated()) {
+ if (player_ptr->effects()->hallucination().is_hallucinated()) {
return false;
}
return true;
}
- if (player_ptr->effects()->hallucination()->is_hallucinated()) {
+ if (player_ptr->effects()->hallucination().is_hallucinated()) {
return false;
}
monster_list.clear();
// 幻覚時は正常に感知できない
- if (player_ptr->effects()->hallucination()->is_hallucinated()) {
+ if (player_ptr->effects()->hallucination().is_hallucinated()) {
return;
}
class PlayerHallucination {
public:
PlayerHallucination() = default;
+ ~PlayerHallucination() = default;
+ PlayerHallucination(const PlayerHallucination &) = delete;
+ PlayerHallucination(PlayerHallucination &&) = delete;
+ PlayerHallucination &operator=(const PlayerHallucination &) = delete;
+ PlayerHallucination &operator=(PlayerHallucination &&) = delete;
short current() const;
bool is_hallucinated() const;
#include "timed-effect/timed-effects.h"
#include "timed-effect/player-acceleration.h"
#include "timed-effect/player-deceleration.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/player-paralysis.h"
#include "timed-effect/player-poison.h"
#include "timed-effect/player-stun.h"
TimedEffects::TimedEffects()
- : player_hallucination(std::make_shared<PlayerHallucination>())
- , player_paralysis(std::make_shared<PlayerParalysis>())
+ : player_paralysis(std::make_shared<PlayerParalysis>())
, player_stun(std::make_shared<PlayerStun>())
, player_acceleration(std::make_shared<PlayerAcceleration>())
, player_deceleration(std::make_shared<PlayerDeceleration>())
return this->player_fear;
}
-std::shared_ptr<PlayerHallucination> TimedEffects::hallucination() const
+PlayerHallucination &TimedEffects::hallucination()
+{
+ return this->player_hallucination;
+}
+
+const PlayerHallucination &TimedEffects::hallucination() const
{
return this->player_hallucination;
}
#include "timed-effect/player-confusion.h"
#include "timed-effect/player-cut.h"
#include "timed-effect/player-fear.h"
+#include "timed-effect/player-hallucination.h"
#include <memory>
class PlayerAcceleration;
class PlayerDeceleration;
-class PlayerHallucination;
class PlayerParalysis;
class PlayerPoison;
class PlayerStun;
const PlayerCut &cut() const;
PlayerFear &fear();
const PlayerFear &fear() const;
- std::shared_ptr<PlayerHallucination> hallucination() const;
+ PlayerHallucination &hallucination();
+ const PlayerHallucination &hallucination() const;
std::shared_ptr<PlayerParalysis> paralysis() const;
std::shared_ptr<PlayerStun> stun() const;
std::shared_ptr<PlayerAcceleration> acceleration() const;
PlayerConfusion player_confusion{};
PlayerCut player_cut{};
PlayerFear player_fear{};
- std::shared_ptr<PlayerHallucination> player_hallucination;
+ PlayerHallucination player_hallucination{};
std::shared_ptr<PlayerParalysis> player_paralysis;
std::shared_ptr<PlayerStun> player_stun;
std::shared_ptr<PlayerAcceleration> player_acceleration;
#include "system/player-type-definition.h"
#include "system/terrain-type-definition.h"
#include "term/term-color-types.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
#include "view/display-symbol.h"
}
DisplaySymbolPair symbol_pair = { symbol_config, symbol_config };
- const auto is_hallucinated = player_ptr->effects()->hallucination()->is_hallucinated();
+ const auto is_hallucinated = player_ptr->effects()->hallucination().is_hallucinated();
if (is_hallucinated && one_in_(256)) {
symbol_pair.symbol_foreground = image_random();
}
#include "target/target-preparation.h"
#include "term/gameterm.h"
#include "term/screen-processor.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "util/buffer-shaper.h"
const auto &monrace = monster.get_appearance_monrace();
const auto name = monster_desc(player_ptr, &monster, MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE | MD_NO_OWNER);
const auto &[bar_color, bar_len] = monster.get_hp_bar_data();
- const auto is_visible = monster.ml && !player_ptr->effects()->hallucination()->is_hallucinated();
+ const auto is_visible = monster.ml && !player_ptr->effects()->hallucination().is_hallucinated();
term_erase(0, y);
if (is_visible) {
std::string line;
// 先頭行を書く。
- auto is_hallucinated = player_ptr->effects()->hallucination()->is_hallucinated();
+ const auto is_hallucinated = player_ptr->effects()->hallucination().is_hallucinated();
if (player_ptr->is_located_at(pos)) {
line = format(_("(X:%03d Y:%03d) あなたの足元のアイテム一覧", "Items at (%03d,%03d) under you"), pos.x, pos.y);
} else if (const auto *m_ptr = monster_on_floor_items(&floor, &grid); m_ptr != nullptr) {
#include "term/screen-processor.h"
#include "term/term-color-types.h"
#include "term/z-form.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/timed-effects.h"
#include "util/string-processor.h"
#include "window/main-window-row-column.h"
const auto &monster = player_ptr->current_floor_ptr->m_list[*monster_idx];
- if ((!monster.ml) || (player_ptr->effects()->hallucination()->is_hallucinated()) || monster.is_dead()) {
+ if ((!monster.ml) || (player_ptr->effects()->hallucination().is_hallucinated()) || monster.is_dead()) {
term_putstr(col, row, max_width, TERM_WHITE, "[----------]");
return;
}
#include "term/term-color-types.h"
#include "term/z-form.h"
#include "timed-effect/player-deceleration.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/player-paralysis.h"
#include "timed-effect/player-poison.h"
#include "timed-effect/player-stun.h"
ADD_BAR_FLAG(BAR_TSUYOSHI);
}
- if (effects->hallucination()->is_hallucinated()) {
+ if (effects->hallucination().is_hallucinated()) {
ADD_BAR_FLAG(BAR_HALLUCINATION);
}
#include "term/gameterm.h"
#include "term/screen-processor.h"
#include "term/term-color-types.h"
-#include "timed-effect/player-hallucination.h"
#include "timed-effect/timed-effects.h"
#include "view/display-map.h"
#include "view/display-symbol.h"
{
auto item_name = describe_flavor(player_ptr, o_ptr, (OD_NO_FLAVOR | OD_OMIT_PREFIX | OD_NAME_ONLY));
auto attr = tval_to_attr[enum2i(o_ptr->bi_key.tval()) % 128];
- if (player_ptr->effects()->hallucination()->is_hallucinated()) {
+ if (player_ptr->effects()->hallucination().is_hallucinated()) {
attr = TERM_WHITE;
item_name = _("何か奇妙な物", "something strange");
}