#include "system/redrawing-flags-updater.h"
#include "system/terrain-type-definition.h"
#include "target/target-getter.h"
-#include "timed-effect/player-cut.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
#include "status/bad-status-setter.h"
#include "store/rumor.h"
#include "system/player-type-definition.h"
-#include "timed-effect/player-cut.h"
#include "timed-effect/player-poison.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
static bool is_healthy_stay(PlayerType *player_ptr)
{
const auto effects = player_ptr->effects();
- if (!effects->poison()->is_poisoned() && !effects->cut()->is_cut()) {
+ if (!effects->poison()->is_poisoned() && !effects->cut().is_cut()) {
return true;
}
#include "status/temporary-resistance.h"
#include "system/player-type-definition.h"
#include "timed-effect/player-acceleration.h"
-#include "timed-effect/player-cut.h"
#include "timed-effect/player-deceleration.h"
#include "timed-effect/player-fear.h"
#include "timed-effect/player-hallucination.h"
(void)bss.mod_stun(-adjust);
}
- auto player_cut = effects->cut();
- if (player_cut->is_cut()) {
+ auto &player_cut = effects->cut();
+ if (player_cut.is_cut()) {
short adjust = adj_con_fix[player_ptr->stat_index[A_CON]] + 1;
- if (player_cut->get_rank() == PlayerCutRank::MORTAL) {
+ if (player_cut.get_rank() == PlayerCutRank::MORTAL) {
adjust = 0;
}
#include "system/player-type-definition.h"
#include "system/terrain-type-definition.h"
#include "term/z-form.h"
-#include "timed-effect/player-cut.h"
#include "timed-effect/player-hallucination.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
return false;
}
- auto is_cut = player_ptr->effects()->cut()->is_cut();
+ const auto is_cut = player_ptr->effects()->cut().is_cut();
if ((PlayerRace(player_ptr).equals(PlayerRaceType::AMBERITE)) && is_cut && one_in_(10)) {
wreck_the_pattern(player_ptr);
}
#include "system/player-type-definition.h"
#include "system/redrawing-flags-updater.h"
#include "system/terrain-type-definition.h"
-#include "timed-effect/player-cut.h"
#include "timed-effect/player-poison.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
}
}
- const auto player_cut = effects->cut();
- if (player_cut->is_cut() && !is_invuln(player_ptr)) {
- auto dam = player_cut->get_damage();
+ const auto &player_cut = effects->cut();
+ if (player_cut.is_cut() && !is_invuln(player_ptr)) {
+ const auto dam = player_cut.get_damage();
if (take_hit(player_ptr, DAMAGE_NOESCAPE, dam, _("致命傷", "a mortal wound")) > 0) {
sound(SOUND_DAMAGE_OVER_TIME);
}
if (player_poison->is_poisoned()) {
regen_amount = 0;
}
- if (player_cut->is_cut()) {
+ if (player_cut.is_cut()) {
regen_amount = 0;
}
if (cave_no_regen) {
#include "system/floor-type-definition.h"
#include "system/player-type-definition.h"
#include "timed-effect/player-acceleration.h"
-#include "timed-effect/player-cut.h"
#include "timed-effect/player-deceleration.h"
#include "timed-effect/player-fear.h"
#include "timed-effect/player-hallucination.h"
effects->acceleration()->set(rd_s16b());
effects->deceleration()->set(rd_s16b());
effects->fear()->set(rd_s16b());
- effects->cut()->set(rd_s16b());
+ effects->cut().set(rd_s16b());
effects->stun()->set(rd_s16b());
effects->poison()->set(rd_s16b());
effects->hallucination()->set(rd_s16b());
#include "system/redrawing-flags-updater.h"
#include "term/screen-processor.h"
#include "term/z-form.h"
-#include "timed-effect/player-cut.h"
#include "timed-effect/player-fear.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
*/
static void hissatsu_bloody_maelstroem(PlayerType *player_ptr, samurai_slaying_type *samurai_slaying_ptr)
{
- auto player_cut = player_ptr->effects()->cut();
- if ((samurai_slaying_ptr->mode == HISSATSU_SEKIRYUKA) && player_cut->is_cut() && samurai_slaying_ptr->m_ptr->has_living_flag()) {
- auto tmp = std::min<short>(100, std::max<short>(10, player_cut->current() / 10));
+ const auto &player_cut = player_ptr->effects()->cut();
+ if ((samurai_slaying_ptr->mode == HISSATSU_SEKIRYUKA) && player_cut.is_cut() && samurai_slaying_ptr->m_ptr->has_living_flag()) {
+ auto tmp = std::min<short>(100, std::max<short>(10, player_cut.current() / 10));
if (samurai_slaying_ptr->mult < tmp) {
samurai_slaying_ptr->mult = tmp;
}
#include "system/monster-race-info.h"
#include "system/player-type-definition.h"
#include "system/redrawing-flags-updater.h"
-#include "timed-effect/player-cut.h"
#include "timed-effect/player-hallucination.h"
#include "timed-effect/player-stun.h"
#include "timed-effect/timed-effects.h"
#include "system/monster-entity.h"
#include "system/monster-race-info.h"
#include "system/player-type-definition.h"
-#include "timed-effect/player-cut.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
#include "util/string-processor.h"
pa_ptr->attack_damage = 0;
}
- auto is_cut = player_ptr->effects()->cut()->is_cut();
+ auto is_cut = player_ptr->effects()->cut().is_cut();
if ((pa_ptr->mode == HISSATSU_SEKIRYUKA) && !is_cut) {
pa_ptr->attack_damage /= 2;
}
#include "term/gameterm.h"
#include "term/screen-processor.h"
#include "term/z-form.h"
-#include "timed-effect/player-cut.h"
#include "timed-effect/player-fear.h"
#include "timed-effect/player-hallucination.h"
#include "timed-effect/player-poison.h"
self_ptr->info_list.emplace_back(_("あなたは恐怖に侵されている。", "You are terrified."));
}
- if (effects->cut()->is_cut()) {
+ if (effects->cut().is_cut()) {
self_ptr->info_list.emplace_back(_("あなたは出血している。", "You are bleeding."));
}
#include "target/projection-path-calculator.h"
#include "target/target-getter.h"
#include "term/screen-processor.h"
-#include "timed-effect/player-cut.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
#include "view/display-messages.h"
}
if (cast) {
- auto current_cut = player_ptr->effects()->cut()->current();
+ const auto current_cut = player_ptr->effects()->cut().current();
short new_cut = current_cut < 300 ? current_cut + 300 : current_cut * 2;
(void)BadStatusSetter(player_ptr).set_cut(new_cut);
const auto &floor = *player_ptr->current_floor_ptr;
#include "system/floor-type-definition.h"
#include "system/player-type-definition.h"
#include "timed-effect/player-acceleration.h"
-#include "timed-effect/player-cut.h"
#include "timed-effect/player-deceleration.h"
#include "timed-effect/player-fear.h"
#include "timed-effect/player-hallucination.h"
wr_s16b(effects->acceleration()->current());
wr_s16b(effects->deceleration()->current());
wr_s16b(effects->fear()->current());
- wr_s16b(effects->cut()->current());
+ wr_s16b(effects->cut().current());
wr_s16b(effects->stun()->current());
wr_s16b(effects->poison()->current());
wr_s16b(effects->hallucination()->current());
#include "system/redrawing-flags-updater.h"
#include "target/target-getter.h"
#include "timed-effect/player-acceleration.h"
-#include "timed-effect/player-cut.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
#include "view/display-messages.h"
ident = true;
}
- if (bss.set_cut((player_ptr->effects()->cut()->current() / 2) - 50)) {
+ if (bss.set_cut((player_ptr->effects()->cut().current() / 2) - 50)) {
ident = true;
}
#include "system/angband-exceptions.h"
#include "system/player-type-definition.h"
#include "system/redrawing-flags-updater.h"
-#include "timed-effect/player-cut.h"
#include "timed-effect/player-deceleration.h"
#include "timed-effect/player-fear.h"
#include "timed-effect/player-hallucination.h"
}
auto notice = this->process_cut_effect(v);
- this->player_ptr->effects()->cut()->set(v);
+ this->player_ptr->effects()->cut().set(v);
if (!notice) {
return false;
}
bool BadStatusSetter::mod_cut(const TIME_EFFECT tmp_v)
{
- return this->set_cut(this->player_ptr->effects()->cut()->current() + tmp_v);
+ return this->set_cut(this->player_ptr->effects()->cut().current() + tmp_v);
}
bool BadStatusSetter::process_stun_effect(const short v)
bool BadStatusSetter::process_cut_effect(const short v)
{
- auto player_cut = this->player_ptr->effects()->cut();
- auto old_rank = player_cut->get_rank();
- auto new_rank = player_cut->get_rank(v);
+ const auto &player_cut = this->player_ptr->effects()->cut();
+ auto old_rank = player_cut.get_rank();
+ auto new_rank = player_cut.get_rank(v);
if (new_rank > old_rank) {
this->decrease_charisma(new_rank, v);
return true;
#include "system/player-type-definition.h"
#include "system/redrawing-flags-updater.h"
#include "timed-effect/player-acceleration.h"
-#include "timed-effect/player-cut.h"
#include "timed-effect/player-deceleration.h"
#include "timed-effect/player-fear.h"
#include "timed-effect/player-hallucination.h"
effects->fear()->reset();
effects->hallucination()->reset();
effects->poison()->reset();
- effects->cut()->reset();
+ effects->cut().reset();
effects->stun()->reset();
player_ptr->protevil = 0; /* Timed -- Protection */
#include "status/base-status.h"
#include "system/player-type-definition.h"
#include "system/redrawing-flags-updater.h"
-#include "timed-effect/player-cut.h"
#include "timed-effect/timed-effects.h"
#include "util/enum-converter.h"
#include "view/display-messages.h"
int16_t hit_p = (player_ptr->mhp - player_ptr->chp);
int16_t change = damroll(player_ptr->lev, 5);
auto nasty_effect = one_in_(5);
- auto player_cut = player_ptr->effects()->cut();
- if (!player_cut->is_cut() && (hit_p == 0) && !nasty_effect) {
+ const auto &player_cut = player_ptr->effects()->cut();
+ if (!player_cut.is_cut() && (hit_p == 0) && !nasty_effect) {
return;
}
#include "market/arena-info-table.h"
#include "system/angband-exceptions.h"
#include "system/redrawing-flags-updater.h"
-#include "timed-effect/player-cut.h"
#include "timed-effect/player-deceleration.h"
#include "timed-effect/player-fear.h"
#include "timed-effect/player-hallucination.h"
is_fully_healthy &= !effects->poison()->is_poisoned();
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->cut().is_cut();
is_fully_healthy &= !effects->deceleration()->is_slow();
is_fully_healthy &= !effects->paralysis()->is_paralyzed();
is_fully_healthy &= !effects->hallucination()->is_hallucinated();
class PlayerCut {
public:
PlayerCut() = default;
- virtual ~PlayerCut() = default;
+ ~PlayerCut() = default;
+ PlayerCut(const PlayerCut &) = delete;
+ PlayerCut(PlayerCut &&) = delete;
+ PlayerCut &operator=(const PlayerCut &) = delete;
+ PlayerCut &operator=(PlayerCut &&) = delete;
static PlayerCutRank get_rank(short value);
static std::string get_cut_mes(PlayerCutRank stun_rank);
#include "timed-effect/timed-effects.h"
#include "timed-effect/player-acceleration.h"
-#include "timed-effect/player-cut.h"
#include "timed-effect/player-deceleration.h"
#include "timed-effect/player-fear.h"
#include "timed-effect/player-hallucination.h"
#include "timed-effect/player-stun.h"
TimedEffects::TimedEffects()
- : player_cut(std::make_shared<PlayerCut>())
- , player_fear(std::make_shared<PlayerFear>())
+ : player_fear(std::make_shared<PlayerFear>())
, player_hallucination(std::make_shared<PlayerHallucination>())
, player_paralysis(std::make_shared<PlayerParalysis>())
, player_stun(std::make_shared<PlayerStun>())
return this->player_confusion;
}
-std::shared_ptr<PlayerCut> TimedEffects::cut() const
+PlayerCut &TimedEffects::cut()
+{
+ return this->player_cut;
+}
+
+const PlayerCut &TimedEffects::cut() const
{
return this->player_cut;
}
#include "timed-effect/player-blindness.h"
#include "timed-effect/player-confusion.h"
+#include "timed-effect/player-cut.h"
#include <memory>
class PlayerAcceleration;
class PlayerHallucination;
class PlayerParalysis;
class PlayerPoison;
-class PlayerCut;
class PlayerStun;
class TimedEffects {
public:
const PlayerBlindness &blindness() const;
PlayerConfusion &confusion();
const PlayerConfusion &confusion() const;
- std::shared_ptr<PlayerCut> cut() const;
+ PlayerCut &cut();
+ const PlayerCut &cut() const;
std::shared_ptr<PlayerFear> fear() const;
std::shared_ptr<PlayerHallucination> hallucination() const;
std::shared_ptr<PlayerParalysis> paralysis() const;
private:
PlayerBlindness player_blindness{};
PlayerConfusion player_confusion{};
- std::shared_ptr<PlayerCut> player_cut;
+ PlayerCut player_cut{};
std::shared_ptr<PlayerFear> player_fear;
std::shared_ptr<PlayerHallucination> player_hallucination;
std::shared_ptr<PlayerParalysis> player_paralysis;
#include "term/screen-processor.h"
#include "term/term-color-types.h"
#include "term/z-form.h"
-#include "timed-effect/player-cut.h"
#include "timed-effect/player-deceleration.h"
#include "timed-effect/player-fear.h"
#include "timed-effect/player-hallucination.h"
*/
void print_cut(PlayerType *player_ptr)
{
- auto player_cut = player_ptr->effects()->cut();
- if (!player_cut->is_cut()) {
+ const auto &player_cut = player_ptr->effects()->cut();
+ if (!player_cut.is_cut()) {
put_str(" ", ROW_CUT, COL_CUT);
return;
}
- auto [color, stat] = player_cut->get_expr();
+ auto [color, stat] = player_cut.get_expr();
c_put_str(color, stat, ROW_CUT, COL_CUT);
}