#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"
#include "view/display-messages.h"
*/
static bool is_healthy_stay(PlayerType *player_ptr)
{
- if (!player_ptr->poisoned && !player_ptr->effects()->cut()->is_cut()) {
+ const auto effects = player_ptr->effects();
+ if (!effects->poison()->is_poisoned() && !effects->cut()->is_cut()) {
return true;
}
#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"
#include "timed-effect/timed-effects.h"
(void)set_ultimate_res(player_ptr, player_ptr->ult_res - 1, true);
}
- if (player_ptr->poisoned) {
+ if (effects->poison()->is_poisoned()) {
int adjust = adj_con_fix[player_ptr->stat_index[A_CON]] + 1;
(void)bss.mod_poison(-adjust);
}
#include "system/object-type-definition.h"
#include "system/player-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"
#include "view/display-messages.h"
bool cave_no_regen = false;
int upkeep_factor = 0;
int regen_amount = PY_REGEN_NORMAL;
- if (player_ptr->poisoned && !is_invuln(player_ptr)) {
+ const auto effects = player_ptr->effects();
+ const auto player_poison = effects->poison();
+ if (player_poison->is_poisoned() && !is_invuln(player_ptr)) {
if (take_hit(player_ptr, DAMAGE_NOESCAPE, 1, _("毒", "poison")) > 0) {
sound(SOUND_DAMAGE_OVER_TIME);
}
}
- auto player_cut = player_ptr->effects()->cut();
+ const auto player_cut = effects->cut();
if (player_cut->is_cut() && !is_invuln(player_ptr)) {
auto dam = player_cut->get_damage();
if (take_hit(player_ptr, DAMAGE_NOESCAPE, dam, _("致命傷", "a mortal wound")) > 0) {
}
}
- if (player_ptr->poisoned) {
+ if (player_poison->is_poisoned()) {
regen_amount = 0;
}
if (player_cut->is_cut()) {
#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"
#include "timed-effect/timed-effects.h"
#include "world/world.h"
*/
static void rd_status(PlayerType *player_ptr)
{
- auto effects = player_ptr->effects();
+ const auto effects = player_ptr->effects();
effects->acceleration()->set(rd_s16b());
effects->deceleration()->set(rd_s16b());
effects->fear()->set(rd_s16b());
effects->cut()->set(rd_s16b());
effects->stun()->set(rd_s16b());
- player_ptr->poisoned = rd_s16b();
+ effects->poison()->set(rd_s16b());
effects->hallucination()->set(rd_s16b());
player_ptr->protevil = rd_s16b();
player_ptr->invuln = rd_s16b();
#include "system/object-type-definition.h"
#include "system/player-type-definition.h"
#include "timed-effect/player-acceleration.h"
+#include "timed-effect/player-poison.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
#include "view/display-messages.h"
return set_tim_infra(this->player_ptr, this->player_ptr->tim_infra + 100 + randint1(100), false);
case SV_POTION_DETECT_INVIS:
return set_tim_invis(this->player_ptr, this->player_ptr->tim_invis + 12 + randint1(12), false);
- case SV_POTION_SLOW_POISON:
- return BadStatusSetter(this->player_ptr).poison(this->player_ptr->poisoned / 2);
+ case SV_POTION_SLOW_POISON: {
+ const auto player_poison = this->player_ptr->effects()->poison();
+ return BadStatusSetter(this->player_ptr).poison(player_poison->current() / 2);
+ }
case SV_POTION_CURE_POISON:
return BadStatusSetter(this->player_ptr).poison(0);
case SV_POTION_BOLDNESS:
#include "timed-effect/player-cut.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"
#include "timed-effect/timed-effects.h"
#include "view/display-self-info.h"
self_ptr->info[self_ptr->line++] = _("あなたはもうろうとしている。", "You are stunned.");
}
- if (player_ptr->poisoned) {
+ if (effects->poison()->is_poisoned()) {
self_ptr->info[self_ptr->line++] = _("あなたは毒に侵されている。", "You are poisoned.");
}
info[i++] = _("あなたは恐怖に侵されている", "You are terrified");
}
- if (player_ptr->poisoned) {
- info2[i] = report_magics_aux(player_ptr->poisoned);
+ const auto player_poison = effects->poison();
+ if (player_poison->is_poisoned()) {
+ info2[i] = report_magics_aux(player_poison->current());
info[i++] = _("あなたは毒に侵されている", "You are poisoned");
}
#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"
#include "timed-effect/timed-effects.h"
#include "world/world.h"
wr_s16b(effects->fear()->current());
wr_s16b(effects->cut()->current());
wr_s16b(effects->stun()->current());
- wr_s16b(player_ptr->poisoned);
+ wr_s16b(effects->poison()->current());
wr_s16b(effects->hallucination()->current());
wr_s16b(player_ptr->protevil);
wr_s16b(player_ptr->invuln);
#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"
#include "timed-effect/timed-effects.h"
#include "view/display-messages.h"
return false;
}
+ const auto player_poison = this->player_ptr->effects()->poison();
+ const auto is_poisoned = player_poison->is_poisoned();
if (v > 0) {
- if (!this->player_ptr->poisoned) {
+ if (!is_poisoned) {
msg_print(_("毒に侵されてしまった!", "You are poisoned!"));
notice = true;
}
} else {
- if (this->player_ptr->poisoned) {
+ if (is_poisoned) {
msg_print(_("やっと毒の痛みがなくなった。", "You are no longer poisoned."));
notice = true;
}
}
- this->player_ptr->poisoned = v;
+ player_poison->set(v);
this->player_ptr->redraw |= PR_STATUS;
if (!notice) {
return false;
bool BadStatusSetter::mod_poison(const TIME_EFFECT tmp_v)
{
- return this->poison(this->player_ptr->poisoned + tmp_v);
+ return this->poison(this->player_ptr->effects()->poison()->current() + tmp_v);
}
/*!
#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"
#include "timed-effect/timed-effects.h"
#include "view/display-messages.h"
effects->confusion()->reset();
effects->fear()->reset();
effects->hallucination()->reset();
- player_ptr->poisoned = 0; /* Timed -- Poisoned */
+ effects->poison()->reset();
effects->cut()->reset();
effects->stun()->reset();
#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"
#include "timed-effect/timed-effects.h"
#include "world/world.h"
is_fully_healthy &= this->csp >= this->msp;
is_fully_healthy &= !this->blind;
is_fully_healthy &= !effects->confusion()->is_confused();
- is_fully_healthy &= !this->poisoned;
+ 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();
uint32_t count{};
TIME_EFFECT blind{}; /* Timed -- Blindness */
- TIME_EFFECT poisoned{}; /* Timed -- Poisoned */
TIME_EFFECT protevil{}; /* Timed -- Protection */
TIME_EFFECT invuln{}; /* Timed -- Invulnerable */
#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_stun(std::make_shared<PlayerStun>())
, player_acceleration(std::make_shared<PlayerAcceleration>())
, player_deceleration(std::make_shared<PlayerDeceleration>())
+ , player_poison(std::make_shared<PlayerPoison>())
{
}
{
return this->player_deceleration;
}
+
+std::shared_ptr<PlayerPoison> TimedEffects::poison() const
+{
+ return this->player_poison;
+}
class PlayerFear;
class PlayerHallucination;
class PlayerParalysis;
+class PlayerPoison;
class PlayerCut;
class PlayerStun;
class TimedEffects {
std::shared_ptr<PlayerStun> stun() const;
std::shared_ptr<PlayerAcceleration> acceleration() const;
std::shared_ptr<PlayerDeceleration> deceleration() const;
+ std::shared_ptr<PlayerPoison> poison() const;
private:
std::shared_ptr<PlayerConfusion> player_confusion;
std::shared_ptr<PlayerStun> player_stun;
std::shared_ptr<PlayerAcceleration> player_acceleration;
std::shared_ptr<PlayerDeceleration> player_deceleration;
+ std::shared_ptr<PlayerPoison> player_poison;
};
#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"
#include "timed-effect/timed-effects.h"
#include "view/status-bars-table.h"
ADD_BAR_FLAG(BAR_CONFUSE);
}
- if (player_ptr->poisoned) {
+ if (effects->poison()->is_poisoned()) {
ADD_BAR_FLAG(BAR_POISONED);
}