#include "system/monster-entity.h"
#include "system/monster-race-info.h"
#include "system/player-type-definition.h"
-#include "timed-effect/player-fear.h"
#include "timed-effect/player-hallucination.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
}
}
- if (effects->fear()->is_fearful()) {
+ if (effects->fear().is_fearful()) {
if (m_ptr->ml) {
sound(SOUND_ATTACK_FAILED);
msg_format(_("恐くて%sを攻撃できない!", "You are too fearful to attack %s!"), m_name.data());
#include "system/player-type-definition.h"
#include "timed-effect/player-acceleration.h"
#include "timed-effect/player-deceleration.h"
-#include "timed-effect/player-fear.h"
#include "timed-effect/player-hallucination.h"
#include "timed-effect/player-paralysis.h"
#include "timed-effect/player-poison.h"
(void)bss.mod_confusion(-1);
}
- if (effects->fear()->is_fearful()) {
+ if (effects->fear().is_fearful()) {
(void)bss.mod_fear(-1);
}
#include "system/player-type-definition.h"
#include "timed-effect/player-acceleration.h"
#include "timed-effect/player-deceleration.h"
-#include "timed-effect/player-fear.h"
#include "timed-effect/player-hallucination.h"
#include "timed-effect/player-paralysis.h"
#include "timed-effect/player-poison.h"
const auto effects = player_ptr->effects();
effects->acceleration()->set(rd_s16b());
effects->deceleration()->set(rd_s16b());
- effects->fear()->set(rd_s16b());
+ effects->fear().set(rd_s16b());
effects->cut().set(rd_s16b());
effects->stun()->set(rd_s16b());
effects->poison()->set(rd_s16b());
#include "system/redrawing-flags-updater.h"
#include "term/screen-processor.h"
#include "term/z-form.h"
-#include "timed-effect/player-fear.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
return false;
}
- if (effects->fear()->is_fearful()) {
+ if (effects->fear().is_fearful()) {
msg_print(_("体が震えて構えられない!", "You are trembling with fear!"));
return false;
}
#include "term/gameterm.h"
#include "term/screen-processor.h"
#include "term/z-form.h"
-#include "timed-effect/player-fear.h"
#include "timed-effect/player-hallucination.h"
#include "timed-effect/player-poison.h"
#include "timed-effect/player-stun.h"
self_ptr->info_list.emplace_back(_("あなたは混乱している。", "You are confused."));
}
- if (effects->fear()->is_fearful()) {
+ if (effects->fear().is_fearful()) {
self_ptr->info_list.emplace_back(_("あなたは恐怖に侵されている。", "You are terrified."));
}
_("あなたは混乱している", "You are confused"));
}
- if (effects->fear()->is_fearful()) {
- info.emplace_back(report_magics_aux(effects->fear()->current()),
+ const auto &fear = effects->fear();
+ if (fear.is_fearful()) {
+ info.emplace_back(report_magics_aux(fear.current()),
_("あなたは恐怖に侵されている", "You are terrified"));
}
_("あなたは毒に侵されている", "You are poisoned"));
}
- auto hallucination = effects->hallucination();
+ const auto hallucination = effects->hallucination();
if (hallucination->is_hallucinated()) {
info.emplace_back(report_magics_aux(hallucination->current()),
_("あなたは幻覚を見ている", "You are hallucinating"));
#include "system/player-type-definition.h"
#include "timed-effect/player-acceleration.h"
#include "timed-effect/player-deceleration.h"
-#include "timed-effect/player-fear.h"
#include "timed-effect/player-hallucination.h"
#include "timed-effect/player-paralysis.h"
#include "timed-effect/player-poison.h"
wr_s16b(player_ptr->enchant_energy_need);
wr_s16b(effects->acceleration()->current());
wr_s16b(effects->deceleration()->current());
- wr_s16b(effects->fear()->current());
+ wr_s16b(effects->fear().current());
wr_s16b(effects->cut().current());
wr_s16b(effects->stun()->current());
wr_s16b(effects->poison()->current());
#include "system/player-type-definition.h"
#include "system/redrawing-flags-updater.h"
#include "timed-effect/player-deceleration.h"
-#include "timed-effect/player-fear.h"
#include "timed-effect/player-hallucination.h"
#include "timed-effect/player-paralysis.h"
#include "timed-effect/player-poison.h"
return false;
}
- auto fear = this->player_ptr->effects()->fear();
+ auto &fear = this->player_ptr->effects()->fear();
if (v > 0) {
- if (!fear->is_fearful()) {
+ if (!fear.is_fearful()) {
msg_print(_("何もかも恐くなってきた!", "You are terrified!"));
if (PlayerClass(this->player_ptr).lose_balance()) {
msg_print(_("型が崩れた。", "You lose your stance."));
chg_virtue(this->player_ptr, Virtue::VALOUR, -1);
}
} else {
- if (fear->is_fearful()) {
+ if (fear.is_fearful()) {
msg_print(_("やっと恐怖を振り払った。", "You feel bolder now."));
notice = true;
}
}
- fear->set(v);
+ fear.set(v);
RedrawingFlagsUpdater::get_instance().set_flag(MainWindowRedrawingFlag::TIMED_EFFECT);
if (!notice) {
return false;
bool BadStatusSetter::mod_fear(const TIME_EFFECT tmp_v)
{
- return this->set_fear(this->player_ptr->effects()->fear()->current() + tmp_v);
+ return this->set_fear(this->player_ptr->effects()->fear().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-fear.h"
#include "timed-effect/player-hallucination.h"
#include "timed-effect/player-paralysis.h"
#include "timed-effect/player-poison.h"
effects->blindness().reset();
effects->paralysis()->reset();
effects->confusion().reset();
- effects->fear()->reset();
+ effects->fear().reset();
effects->hallucination()->reset();
effects->poison()->reset();
effects->cut().reset();
#include "system/angband-exceptions.h"
#include "system/redrawing-flags-updater.h"
#include "timed-effect/player-deceleration.h"
-#include "timed-effect/player-fear.h"
#include "timed-effect/player-hallucination.h"
#include "timed-effect/player-paralysis.h"
#include "timed-effect/player-poison.h"
is_fully_healthy &= !effects->blindness().is_blind();
is_fully_healthy &= !effects->confusion().is_confused();
is_fully_healthy &= !effects->poison()->is_poisoned();
- is_fully_healthy &= !effects->fear()->is_fearful();
+ is_fully_healthy &= !effects->fear().is_fearful();
is_fully_healthy &= !effects->stun()->is_stunned();
is_fully_healthy &= !effects->cut().is_cut();
is_fully_healthy &= !effects->deceleration()->is_slow();
class PlayerFear {
public:
PlayerFear() = default;
+ ~PlayerFear() = default;
+ PlayerFear(const PlayerFear &) = delete;
+ PlayerFear(PlayerFear &&) = delete;
+ PlayerFear &operator=(const PlayerFear &) = delete;
+ PlayerFear &operator=(PlayerFear &&) = delete;
short current() const;
bool is_fearful() const;
#include "timed-effect/timed-effects.h"
#include "timed-effect/player-acceleration.h"
#include "timed-effect/player-deceleration.h"
-#include "timed-effect/player-fear.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_fear(std::make_shared<PlayerFear>())
- , player_hallucination(std::make_shared<PlayerHallucination>())
+ : player_hallucination(std::make_shared<PlayerHallucination>())
, player_paralysis(std::make_shared<PlayerParalysis>())
, player_stun(std::make_shared<PlayerStun>())
, player_acceleration(std::make_shared<PlayerAcceleration>())
return this->player_cut;
}
-std::shared_ptr<PlayerFear> TimedEffects::fear() const
+PlayerFear &TimedEffects::fear()
+{
+ return this->player_fear;
+}
+
+const PlayerFear &TimedEffects::fear() const
{
return this->player_fear;
}
#include "timed-effect/player-blindness.h"
#include "timed-effect/player-confusion.h"
#include "timed-effect/player-cut.h"
+#include "timed-effect/player-fear.h"
#include <memory>
class PlayerAcceleration;
class PlayerDeceleration;
-class PlayerFear;
class PlayerHallucination;
class PlayerParalysis;
class PlayerPoison;
const PlayerConfusion &confusion() const;
PlayerCut &cut();
const PlayerCut &cut() const;
- std::shared_ptr<PlayerFear> fear() const;
+ PlayerFear &fear();
+ const PlayerFear &fear() const;
std::shared_ptr<PlayerHallucination> hallucination() const;
std::shared_ptr<PlayerParalysis> paralysis() const;
std::shared_ptr<PlayerStun> stun() const;
PlayerBlindness player_blindness{};
PlayerConfusion player_confusion{};
PlayerCut player_cut{};
- std::shared_ptr<PlayerFear> player_fear;
+ PlayerFear player_fear{};
std::shared_ptr<PlayerHallucination> player_hallucination;
std::shared_ptr<PlayerParalysis> player_paralysis;
std::shared_ptr<PlayerStun> player_stun;
#include "term/term-color-types.h"
#include "term/z-form.h"
#include "timed-effect/player-deceleration.h"
-#include "timed-effect/player-fear.h"
#include "timed-effect/player-hallucination.h"
#include "timed-effect/player-paralysis.h"
#include "timed-effect/player-poison.h"
ADD_BAR_FLAG(BAR_ALTER);
}
- if (effects->fear()->is_fearful()) {
+ if (effects->fear().is_fearful()) {
ADD_BAR_FLAG(BAR_AFRAID);
}