OSDN Git Service

[Refactor] #4169 TimedEffects::PlayerBlindness をshared_ptr から普通のクラスに差し替えた
authorHourier <66951241+Hourier@users.noreply.github.com>
Mon, 27 May 2024 14:13:53 +0000 (23:13 +0900)
committerHourier <66951241+Hourier@users.noreply.github.com>
Tue, 28 May 2024 13:02:50 +0000 (22:02 +0900)
52 files changed:
src/action/action-limited.cpp
src/action/open-close-execution.cpp
src/action/travel-execution.cpp
src/blue-magic/blue-magic-checker.cpp
src/cmd-action/cmd-open-close.cpp
src/cmd-action/cmd-spell.cpp
src/core/magic-effects-timeout-reducer.cpp
src/core/player-processor.cpp
src/effect/effect-feature.cpp
src/effect/effect-player-oldies.cpp
src/effect/effect-player-resist-hurt.cpp
src/effect/effect-player.cpp
src/effect/effect-processor.cpp
src/floor/floor-changer.cpp
src/floor/geometry.cpp
src/grid/grid.cpp
src/load/player-info-loader.cpp
src/melee/melee-spell.cpp
src/mind/mind-mirror-master.cpp
src/mind/mind-ninja.cpp
src/monster-attack/monster-eating.cpp
src/monster/monster-status.cpp
src/monster/monster-update.cpp
src/mspell/mspell-attack.cpp
src/mspell/mspell-attack/mspell-ball.cpp
src/mspell/mspell-attack/mspell-breath.cpp
src/mspell/mspell-attack/mspell-curse.cpp
src/mspell/mspell-floor.cpp
src/mspell/mspell-learn-checker.cpp
src/mspell/mspell-special.cpp
src/mspell/mspell-status.cpp
src/mspell/mspell-summon.cpp
src/mspell/mspell-util.cpp
src/mspell/specified-summon.cpp
src/object-use/throw-execution.cpp
src/object/lite-processor.cpp
src/object/warning.cpp
src/player-base/player-class.cpp
src/player-info/self-info.cpp
src/player/player-move.cpp
src/player/player-status-flags.cpp
src/save/player-writer.cpp
src/spell-class/spells-mirror-master.cpp
src/spell-kind/spells-lite.cpp
src/status/bad-status-setter.cpp
src/status/buff-setter.cpp
src/system/player-type-definition.cpp
src/timed-effect/player-blindness.h
src/timed-effect/timed-effects.cpp
src/timed-effect/timed-effects.h
src/view/display-map.cpp
src/window/main-window-stat-poster.cpp

index cffd369..d73c58e 100644 (file)
@@ -15,7 +15,6 @@
 #include "system/floor-type-definition.h"
 #include "system/player-type-definition.h"
 #include "term/screen-processor.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/player-confusion.h"
 #include "timed-effect/player-hallucination.h"
 #include "timed-effect/player-stun.h"
@@ -91,7 +90,7 @@ bool cmd_limit_arena(PlayerType *player_ptr)
 
 bool cmd_limit_blind(PlayerType *player_ptr)
 {
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         msg_print(_("目が見えない。", "You can't see anything."));
         return true;
     }
index c8a23b9..5797497 100644 (file)
@@ -28,7 +28,6 @@
 #include "system/player-type-definition.h"
 #include "system/terrain-type-definition.h"
 #include "term/screen-processor.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/player-confusion.h"
 #include "timed-effect/player-hallucination.h"
 #include "timed-effect/timed-effects.h"
@@ -62,7 +61,7 @@ bool exe_open(PlayerType *player_ptr, POSITION y, POSITION x)
 
     int i = player_ptr->skill_dis;
     const auto effects = player_ptr->effects();
-    if (effects->blindness()->is_blind() || no_lite(player_ptr)) {
+    if (effects->blindness().is_blind() || no_lite(player_ptr)) {
         i = i / 10;
     }
 
@@ -163,7 +162,7 @@ bool easy_open_door(PlayerType *player_ptr, POSITION y, POSITION x)
     } else if (terrain.power) {
         auto power_disarm = player_ptr->skill_dis;
         const auto effects = player_ptr->effects();
-        if (effects->blindness()->is_blind() || no_lite(player_ptr)) {
+        if (effects->blindness().is_blind() || no_lite(player_ptr)) {
             power_disarm = power_disarm / 10;
         }
 
@@ -218,7 +217,7 @@ bool exe_disarm_chest(PlayerType *player_ptr, POSITION y, POSITION x, OBJECT_IDX
     PlayerEnergy(player_ptr).set_player_turn_energy(100);
     int i = player_ptr->skill_dis;
     const auto effects = player_ptr->effects();
-    if (effects->blindness()->is_blind() || no_lite(player_ptr)) {
+    if (effects->blindness().is_blind() || no_lite(player_ptr)) {
         i = i / 10;
     }
 
@@ -283,7 +282,7 @@ bool exe_disarm(PlayerType *player_ptr, POSITION y, POSITION x, DIRECTION dir)
     int i = player_ptr->skill_dis;
     PlayerEnergy(player_ptr).set_player_turn_energy(100);
     auto effects = player_ptr->effects();
-    if (effects->blindness()->is_blind() || no_lite(player_ptr)) {
+    if (effects->blindness().is_blind() || no_lite(player_ptr)) {
         i = i / 10;
     }
 
index 6c99c0a..1848134 100644 (file)
@@ -19,7 +19,6 @@
 #include "system/grid-type-definition.h"
 #include "system/monster-entity.h"
 #include "system/player-type-definition.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/timed-effects.h"
 #include "view/display-messages.h"
 
@@ -34,8 +33,8 @@ travel_type travel;
  */
 static DIRECTION travel_test(PlayerType *player_ptr, DIRECTION prev_dir)
 {
-    const auto blindness = player_ptr->effects()->blindness();
-    if (blindness->is_blind() || no_lite(player_ptr)) {
+    const auto &blindness = player_ptr->effects()->blindness();
+    if (blindness.is_blind() || no_lite(player_ptr)) {
         msg_print(_("目が見えない!", "You cannot see!"));
         return 0;
     }
index f2ec72c..0b8a864 100644 (file)
@@ -22,7 +22,6 @@
 #include "system/angband.h"
 #include "system/player-type-definition.h"
 #include "system/redrawing-flags-updater.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/player-confusion.h"
 #include "timed-effect/player-hallucination.h"
 #include "timed-effect/player-paralysis.h"
@@ -47,7 +46,7 @@ void learn_spell(PlayerType *player_ptr, MonsterAbilityType monspell)
 
     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_blind = effects->blindness().is_blind();
     const auto is_stunned = effects->stun()->is_stunned();
     const auto is_hallucinated = effects->hallucination()->is_hallucinated();
     const auto is_paralyzed = effects->paralysis()->is_paralyzed();
index 8d041a9..d7fd2fa 100644 (file)
@@ -28,7 +28,6 @@
 #include "system/terrain-type-definition.h"
 #include "target/target-getter.h"
 #include "term/screen-processor.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/player-confusion.h"
 #include "timed-effect/player-hallucination.h"
 #include "timed-effect/timed-effects.h"
@@ -55,7 +54,7 @@ static bool exe_open_chest(PlayerType *player_ptr, const Pos2D &pos, OBJECT_IDX
         flag = false;
         int i = player_ptr->skill_dis;
         const auto effects = player_ptr->effects();
-        if (effects->blindness()->is_blind() || no_lite(player_ptr)) {
+        if (effects->blindness().is_blind() || no_lite(player_ptr)) {
             i = i / 10;
         }
 
index 50c2422..895fd34 100644 (file)
@@ -63,7 +63,6 @@
 #include "system/redrawing-flags-updater.h"
 #include "term/screen-processor.h"
 #include "term/z-form.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/timed-effects.h"
 #include "util/bit-flags-calculator.h"
 #include "util/int-char-converter.h"
@@ -947,7 +946,7 @@ bool do_cmd_cast(PlayerType *player_ptr)
         return false;
     }
 
-    if (player_ptr->effects()->blindness()->is_blind() || no_lite(player_ptr)) {
+    if (player_ptr->effects()->blindness().is_blind() || no_lite(player_ptr)) {
         if (pc.equals(PlayerClassType::FORCETRAINER)) {
             confirm_use_force(player_ptr, false);
         } else {
index 1b57208..fe9779b 100644 (file)
@@ -18,7 +18,6 @@
 #include "status/temporary-resistance.h"
 #include "system/player-type-definition.h"
 #include "timed-effect/player-acceleration.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/player-confusion.h"
 #include "timed-effect/player-cut.h"
 #include "timed-effect/player-deceleration.h"
@@ -45,7 +44,7 @@ void reduce_magic_effects_timeout(PlayerType *player_ptr)
         (void)bss.mod_hallucination(-1);
     }
 
-    if (effects->blindness()->is_blind()) {
+    if (effects->blindness().is_blind()) {
         (void)bss.mod_blindness(-1);
     }
 
index 3b45728..93e7bb4 100644 (file)
@@ -55,7 +55,6 @@
 #include "system/player-type-definition.h"
 #include "system/redrawing-flags-updater.h"
 #include "term/screen-processor.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/player-confusion.h"
 #include "timed-effect/player-cut.h"
 #include "timed-effect/player-hallucination.h"
@@ -180,7 +179,7 @@ void process_player(PlayerType *player_ptr)
     }
 
     const auto effects = player_ptr->effects();
-    if (player_ptr->riding && !effects->confusion()->is_confused() && !effects->blindness()->is_blind()) {
+    if (player_ptr->riding && !effects->confusion()->is_confused() && !effects->blindness().is_blind()) {
         auto *m_ptr = &player_ptr->current_floor_ptr->m_list[player_ptr->riding];
         auto *r_ptr = &m_ptr->get_monrace();
         if (m_ptr->is_asleep()) {
index 78d3d65..9afb81c 100644 (file)
@@ -23,7 +23,6 @@
 #include "system/player-type-definition.h"
 #include "system/redrawing-flags-updater.h"
 #include "system/terrain-type-definition.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/timed-effects.h"
 #include "util/bit-flags-calculator.h"
 #include "view/display-messages.h"
@@ -197,7 +196,7 @@ bool affect_feature(PlayerType *player_ptr, MONSTER_IDX src_idx, POSITION r, POS
             }
         }
 
-        if (player_ptr->effects()->blindness()->is_blind() || !grid.has_los()) {
+        if (player_ptr->effects()->blindness().is_blind() || !grid.has_los()) {
             break;
         }
 
@@ -216,7 +215,7 @@ bool affect_feature(PlayerType *player_ptr, MONSTER_IDX src_idx, POSITION r, POS
             cave_alter_feat(player_ptr, y, x, TerrainCharacteristics::TUNNEL);
         }
 
-        if (player_ptr->effects()->blindness()->is_blind() || !grid.has_los()) {
+        if (player_ptr->effects()->blindness().is_blind() || !grid.has_los()) {
             break;
         }
 
index 4e505d1..66c3172 100644 (file)
@@ -8,13 +8,12 @@
 #include "status/buff-setter.h"
 #include "system/player-type-definition.h"
 #include "timed-effect/player-acceleration.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/timed-effects.h"
 #include "view/display-messages.h"
 
 void effect_player_old_heal(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 {
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         msg_print(_("何らかの攻撃によって気分がよくなった。", "You are hit by something invigorating!"));
     }
 
@@ -24,7 +23,7 @@ void effect_player_old_heal(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 
 void effect_player_old_speed(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 {
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         msg_print(_("何かで攻撃された!", "You are hit by something!"));
     }
 
@@ -34,7 +33,7 @@ void effect_player_old_speed(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 
 void effect_player_old_slow(PlayerType *player_ptr)
 {
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         msg_print(_("何か遅いもので攻撃された!", "You are hit by something slow!"));
     }
 
@@ -47,7 +46,7 @@ void effect_player_old_sleep(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
         return;
     }
 
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         msg_print(_("眠ってしまった!", "You fall asleep!"));
     }
 
index da2eca9..d4b5868 100644 (file)
@@ -29,7 +29,6 @@
 #include "system/item-entity.h"
 #include "system/player-type-definition.h"
 #include "system/redrawing-flags-updater.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/timed-effects.h"
 #include "view/display-messages.h"
 #include "world/world.h"
@@ -38,7 +37,7 @@
 void effect_player_elements(
     PlayerType *player_ptr, EffectPlayerType *ep_ptr, std::string_view attack_message, int (*damage_func)(PlayerType *, int, std::string_view, bool))
 {
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         msg_print(attack_message);
     }
 
@@ -48,7 +47,7 @@ void effect_player_elements(
 void effect_player_poison(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 {
     bool double_resist = is_oppose_pois(player_ptr);
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         msg_print(_("毒で攻撃された!", "You are hit by poison!"));
     }
 
@@ -68,7 +67,7 @@ void effect_player_poison(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 void effect_player_nuke(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 {
     bool double_resist = is_oppose_pois(player_ptr);
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         msg_print(_("放射能で攻撃された!", "You are hit by radiation!"));
     }
 
@@ -97,7 +96,7 @@ void effect_player_nuke(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 
 void effect_player_missile(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 {
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         msg_print(_("何かで攻撃された!", "You are hit by something!"));
     }
 
@@ -106,7 +105,7 @@ void effect_player_missile(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 
 void effect_player_holy_fire(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 {
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         msg_print(_("何かで攻撃された!", "You are hit by something!"));
     }
 
@@ -117,7 +116,7 @@ void effect_player_holy_fire(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 
 void effect_player_hell_fire(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 {
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         msg_print(_("何かで攻撃された!", "You are hit by something!"));
     }
 
@@ -128,7 +127,7 @@ void effect_player_hell_fire(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 
 void effect_player_arrow(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 {
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         sound(SOUND_SHOOT_HIT);
         msg_print(_("何か鋭いもので攻撃された!", "You are hit by something sharp!"));
         ep_ptr->get_damage = take_hit(player_ptr, DAMAGE_ATTACK, ep_ptr->dam, ep_ptr->killer);
@@ -146,7 +145,7 @@ void effect_player_arrow(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 
 void effect_player_plasma(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 {
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         msg_print(_("何かとても熱いもので攻撃された!", "You are hit by something *HOT*!"));
     }
 
@@ -172,7 +171,7 @@ void effect_player_plasma(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 
 void effect_player_nether(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 {
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         msg_print(_("地獄の力で攻撃された!", "You are hit by nether forces!"));
     }
 
@@ -204,7 +203,7 @@ void effect_player_nether(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
  */
 void effect_player_water(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 {
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         msg_print(_("何か湿ったもので攻撃された!", "You are hit by something wet!"));
     }
 
@@ -236,7 +235,7 @@ void effect_player_water(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 
 void effect_player_chaos(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 {
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         msg_print(_("無秩序の波動で攻撃された!", "You are hit by a wave of anarchy!"));
     }
 
@@ -272,7 +271,7 @@ void effect_player_chaos(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 
 void effect_player_shards(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 {
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         msg_print(_("何か鋭いもので攻撃された!", "You are hit by something sharp!"));
     }
 
@@ -291,7 +290,7 @@ void effect_player_shards(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 
 void effect_player_sound(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 {
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         msg_print(_("轟音で攻撃された!", "You are hit by a loud noise!"));
     }
 
@@ -311,7 +310,7 @@ void effect_player_sound(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 
 void effect_player_confusion(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 {
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         msg_print(_("何か混乱するもので攻撃された!", "You are hit by something puzzling!"));
     }
 
@@ -326,7 +325,7 @@ void effect_player_confusion(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 
 void effect_player_disenchant(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 {
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         msg_print(_("何かさえないもので攻撃された!", "You are hit by something static!"));
     }
 
@@ -341,7 +340,7 @@ void effect_player_disenchant(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 
 void effect_player_nexus(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 {
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         msg_print(_("何か奇妙なもので攻撃された!", "You are hit by something strange!"));
     }
 
@@ -356,7 +355,7 @@ void effect_player_nexus(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 
 void effect_player_force(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 {
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         msg_print(_("運動エネルギーで攻撃された!", "You are hit by kinetic force!"));
     }
     if (!has_resist_sound(player_ptr) && !check_multishadow(player_ptr)) {
@@ -368,7 +367,7 @@ void effect_player_force(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 
 void effect_player_rocket(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 {
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         msg_print(_("爆発があった!", "There is an explosion!"));
     }
 
@@ -391,7 +390,7 @@ void effect_player_rocket(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 
 void effect_player_inertial(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 {
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         msg_print(_("何か遅いもので攻撃された!", "You are hit by something slow!"));
     }
 
@@ -404,7 +403,7 @@ void effect_player_inertial(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 
 void effect_player_lite(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 {
-    const auto is_blind = player_ptr->effects()->blindness()->is_blind();
+    const auto is_blind = player_ptr->effects()->blindness().is_blind();
     if (is_blind) {
         msg_print(_("何かで攻撃された!", "You are hit by something!"));
     }
@@ -447,7 +446,7 @@ void effect_player_lite(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 
 void effect_player_dark(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 {
-    const auto is_blind = player_ptr->effects()->blindness()->is_blind();
+    const auto is_blind = player_ptr->effects()->blindness().is_blind();
     if (is_blind) {
         msg_print(_("何かで攻撃された!", "You are hit by something!"));
     }
@@ -501,7 +500,7 @@ static void effect_player_time_addition(PlayerType *player_ptr)
  */
 void effect_player_time(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 {
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         msg_print(_("過去からの衝撃に攻撃された!", "You are hit by a blast from the past!"));
     }
 
@@ -522,7 +521,7 @@ void effect_player_time(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 
 void effect_player_gravity(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 {
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         msg_print(_("何か重いもので攻撃された!", "You are hit by something heavy!"));
     }
 
@@ -551,7 +550,7 @@ void effect_player_gravity(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 
 void effect_player_disintegration(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 {
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         msg_print(_("純粋なエネルギーで攻撃された!", "You are hit by pure energy!"));
     }
 
@@ -560,7 +559,7 @@ void effect_player_disintegration(PlayerType *player_ptr, EffectPlayerType *ep_p
 
 void effect_player_death_ray(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 {
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         msg_print(_("何か非常に冷たいもので攻撃された!", "You are hit by something extremely cold!"));
     }
 
@@ -570,7 +569,7 @@ void effect_player_death_ray(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 
 void effect_player_mana(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 {
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         msg_print(_("魔法のオーラで攻撃された!", "You are hit by an aura of magic!"));
     }
 
@@ -579,7 +578,7 @@ void effect_player_mana(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 
 void effect_player_psy_spear(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 {
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         msg_print(_("エネルギーの塊で攻撃された!", "You are hit by an energy!"));
     }
 
@@ -588,7 +587,7 @@ void effect_player_psy_spear(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 
 void effect_player_meteor(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 {
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         msg_print(_("何かが空からあなたの頭上に落ちてきた!", "Something falls from the sky on you!"));
     }
 
@@ -603,7 +602,7 @@ void effect_player_meteor(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 
 void effect_player_icee(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 {
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         msg_print(_("何か鋭く冷たいもので攻撃された!", "You are hit by something sharp and cold!"));
     }
 
@@ -648,8 +647,8 @@ void effect_player_hand_doom(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 
 void effect_player_void(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 {
-    auto effect_mes = player_ptr->effects()->blindness()->is_blind() ? _("何かに身体が引っ張りこまれる!", "Something absorbs you!")
-                                                                     : _("周辺の空間が歪んだ。", "Sight warps around you.");
+    auto effect_mes = player_ptr->effects()->blindness().is_blind() ? _("何かに身体が引っ張りこまれる!", "Something absorbs you!")
+                                                                    : _("周辺の空間が歪んだ。", "Sight warps around you.");
     msg_print(effect_mes);
     if (!check_multishadow(player_ptr) && !player_ptr->levitation && !player_ptr->anti_tele) {
         (void)BadStatusSetter(player_ptr).mod_deceleration(randint0(4) + 4, false);
@@ -664,7 +663,7 @@ void effect_player_void(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 
 void effect_player_abyss(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
 {
-    const auto is_blind = player_ptr->effects()->blindness()->is_blind();
+    const auto is_blind = player_ptr->effects()->blindness().is_blind();
     const auto effect_mes = is_blind ? _("身体が沈み込む気がする!", "You feel you are sinking into something!")
                                      : _("深淵があなたを誘い込んでいる!", "You are falling into the abyss!");
     msg_print(effect_mes);
index 4a739db..a11f749 100644 (file)
@@ -33,7 +33,6 @@
 #include "system/monster-race-info.h"
 #include "system/player-type-definition.h"
 #include "target/projection-path-calculator.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/timed-effects.h"
 #include "util/bit-flags-calculator.h"
 #include "util/string-processor.h"
@@ -82,7 +81,7 @@ static bool process_bolt_reflection(PlayerType *player_ptr, EffectPlayerType *ep
     sound(SOUND_REFLECT);
 
     std::string mes;
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         mes = _("何かが跳ね返った!", "Something bounces!");
     } else if (PlayerClass(player_ptr).samurai_stance_is(SamuraiStanceType::FUUJIN)) {
         mes = _("風の如く武器を振るって弾き返した!", "The attack bounces!");
index 0d211a3..6711897 100644 (file)
@@ -35,7 +35,6 @@
 #include "system/monster-race-info.h"
 #include "system/player-type-definition.h"
 #include "target/projection-path-calculator.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/player-hallucination.h"
 #include "timed-effect/timed-effects.h"
 #include "util/bit-flags-calculator.h"
@@ -146,7 +145,7 @@ ProjectResult project(PlayerType *player_ptr, const MONSTER_IDX src_idx, POSITIO
     auto ox = x1;
     auto visual = false;
     bool see_s_msg = true;
-    const auto is_blind = player_ptr->effects()->blindness()->is_blind();
+    const auto is_blind = player_ptr->effects()->blindness().is_blind();
     auto &floor = *player_ptr->current_floor_ptr;
     for (const auto &[ny, nx] : path_g) {
         const Pos2D pos(ny, nx);
index 4981a43..edb8626 100644 (file)
@@ -39,7 +39,6 @@
 #include "system/monster-race-info.h"
 #include "system/player-type-definition.h"
 #include "system/terrain-type-definition.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/timed-effects.h"
 #include "util/bit-flags-calculator.h"
 #include "view/display-messages.h"
@@ -375,7 +374,7 @@ static void cut_off_the_upstair(PlayerType *player_ptr)
         return;
     }
 
-    if (!player_ptr->effects()->blindness()->is_blind()) {
+    if (!player_ptr->effects()->blindness().is_blind()) {
         msg_print(_("突然階段が塞がれてしまった。", "Suddenly the stairs is blocked!"));
     } else {
         msg_print(_("ゴトゴトと何か音がした。", "You hear some noises."));
index 404442a..38c0b93 100644 (file)
@@ -9,7 +9,6 @@
 #include "system/monster-entity.h"
 #include "system/player-type-definition.h"
 #include "target/projection-path-calculator.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/timed-effects.h"
 #include "util/bit-flags-calculator.h"
 
@@ -114,7 +113,7 @@ DIRECTION coords_to_dir(PlayerType *player_ptr, POSITION y, POSITION x)
 bool player_can_see_bold(PlayerType *player_ptr, POSITION y, POSITION x)
 {
     /* Blind players see nothing */
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         return false;
     }
 
index 6cac264..e7f7802 100644 (file)
@@ -54,7 +54,6 @@
 #include "system/terrain-type-definition.h"
 #include "term/gameterm.h"
 #include "term/term-color-types.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/timed-effects.h"
 #include "util/bit-flags-calculator.h"
 #include "util/enum-converter.h"
@@ -327,7 +326,7 @@ void note_spot(PlayerType *player_ptr, POSITION y, POSITION x)
     auto &grid = floor.get_grid(pos);
 
     /* Blind players see nothing */
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         return;
     }
 
index 8cd1011..497a5f9 100644 (file)
@@ -25,7 +25,6 @@
 #include "system/floor-type-definition.h"
 #include "system/player-type-definition.h"
 #include "timed-effect/player-acceleration.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/player-confusion.h"
 #include "timed-effect/player-cut.h"
 #include "timed-effect/player-deceleration.h"
@@ -338,7 +337,7 @@ static void rd_bad_status(PlayerType *player_ptr)
 {
     auto effects = player_ptr->effects();
     strip_bytes(2); /* Old "rest" */
-    effects->blindness()->set(rd_s16b());
+    effects->blindness().set(rd_s16b());
     effects->paralysis()->set(rd_s16b());
     effects->confusion()->set(rd_s16b());
     player_ptr->food = rd_s16b();
index c314ec3..24eefaa 100644 (file)
@@ -18,7 +18,6 @@
 #include "system/monster-race-info.h"
 #include "system/player-type-definition.h"
 #include "system/redrawing-flags-updater.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/timed-effects.h"
 #include "util/string-processor.h"
 #include "view/display-messages.h"
@@ -65,7 +64,7 @@ static void process_special_melee_spell(PlayerType *player_ptr, melee_spell_type
     bool is_special_magic = ms_ptr->m_ptr->ml;
     is_special_magic &= ms_ptr->maneable;
     is_special_magic &= w_ptr->timewalk_m_idx == 0;
-    is_special_magic &= !player_ptr->effects()->blindness()->is_blind();
+    is_special_magic &= !player_ptr->effects()->blindness().is_blind();
     is_special_magic &= pc.equals(PlayerClassType::IMITATOR);
     is_special_magic &= ms_ptr->thrown_spell != MonsterAbilityType::SPECIAL;
     if (!is_special_magic) {
index 84f29bb..9902894 100644 (file)
@@ -45,7 +45,6 @@
 #include "target/grid-selector.h"
 #include "target/projection-path-calculator.h"
 #include "target/target-getter.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/timed-effects.h"
 #include "util/bit-flags-calculator.h"
 #include "view/display-messages.h"
@@ -151,7 +150,7 @@ bool binding_field(PlayerType *player_ptr, int dam)
             }
 
             if (floor.has_los(pos) && projectable(player_ptr, player_ptr->y, player_ptr->x, y, x)) {
-                if (!(player_ptr->effects()->blindness()->is_blind()) && panel_contains(y, x)) {
+                if (!(player_ptr->effects()->blindness().is_blind()) && panel_contains(y, x)) {
                     print_bolt_pict(player_ptr, y, x, y, x, AttributeType::MANA);
                     move_cursor_relative(y, x);
                     term_fresh();
index bd7eacf..97cf913 100644 (file)
@@ -56,7 +56,6 @@
 #include "target/projection-path-calculator.h"
 #include "target/target-checker.h"
 #include "target/target-getter.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/player-confusion.h"
 #include "timed-effect/player-hallucination.h"
 #include "timed-effect/player-paralysis.h"
@@ -84,7 +83,7 @@ bool kawarimi(PlayerType *player_ptr, bool success)
 
     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_blind = effects->blindness().is_blind();
     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) {
index a97f5f7..fb6f93b 100644 (file)
@@ -28,7 +28,6 @@
 #include "system/monster-entity.h"
 #include "system/player-type-definition.h"
 #include "system/redrawing-flags-updater.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/player-paralysis.h"
 #include "timed-effect/timed-effects.h"
 #include "util/bit-flags-calculator.h"
@@ -205,7 +204,7 @@ void process_eat_lite(PlayerType *player_ptr, MonsterAttackPlayer *monap_ptr)
         monap_ptr->o_ptr->fuel = 1;
     }
 
-    if (!player_ptr->effects()->blindness()->is_blind()) {
+    if (!player_ptr->effects()->blindness().is_blind()) {
         msg_print(_("明かりが暗くなってしまった。", "Your light dims."));
         monap_ptr->obvious = true;
     }
index 1a19590..528a0a6 100644 (file)
@@ -20,7 +20,6 @@
 #include "system/monster-race-info.h"
 #include "system/player-type-definition.h"
 #include "system/redrawing-flags-updater.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/player-hallucination.h"
 #include "timed-effect/timed-effects.h"
 #include "util/bit-flags-calculator.h"
@@ -92,7 +91,7 @@ int mon_damage_mod(PlayerType *player_ptr, MonsterEntity *m_ptr, int dam, bool i
     }
 
     if (is_psy_spear) {
-        if (!player_ptr->effects()->blindness()->is_blind() && is_seen(player_ptr, m_ptr)) {
+        if (!player_ptr->effects()->blindness().is_blind() && is_seen(player_ptr, m_ptr)) {
             msg_print(_("バリアを切り裂いた!", "The barrier is penetrated!"));
         }
 
index 0831bbc..780971c 100644 (file)
@@ -38,7 +38,6 @@
 #include "system/player-type-definition.h"
 #include "system/redrawing-flags-updater.h"
 #include "target/projection-path-calculator.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/player-hallucination.h"
 #include "timed-effect/timed-effects.h"
 #include "util/bit-flags-calculator.h"
@@ -463,7 +462,7 @@ static void decide_sight_invisible_monster(PlayerType *player_ptr, um_type *um_p
         update_specific_race_telepathy(player_ptr, um_ptr);
     }
 
-    if (!player_ptr->current_floor_ptr->has_los({ um_ptr->fy, um_ptr->fx }) || player_ptr->effects()->blindness()->is_blind()) {
+    if (!player_ptr->current_floor_ptr->has_los({ um_ptr->fy, um_ptr->fx }) || player_ptr->effects()->blindness().is_blind()) {
         return;
     }
 
index 7f03064..412d04d 100644 (file)
@@ -34,7 +34,6 @@
 #include "system/player-type-definition.h"
 #include "system/redrawing-flags-updater.h"
 #include "target/projection-path-calculator.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/timed-effects.h"
 #include "util/string-processor.h"
 #include "view/display-messages.h"
@@ -266,7 +265,7 @@ static bool check_thrown_mspell(PlayerType *player_ptr, msa_type *msa_ptr)
 
 static void check_mspell_imitation(PlayerType *player_ptr, msa_type *msa_ptr)
 {
-    const auto seen = (!player_ptr->effects()->blindness()->is_blind() && msa_ptr->m_ptr->ml);
+    const auto seen = (!player_ptr->effects()->blindness().is_blind() && msa_ptr->m_ptr->ml);
     const auto can_imitate = player_ptr->current_floor_ptr->has_los({ msa_ptr->m_ptr->fy, msa_ptr->m_ptr->fx });
     PlayerClass pc(player_ptr);
     if (!seen || !can_imitate || (w_ptr->timewalk_m_idx != 0) || !pc.equals(PlayerClassType::IMITATOR)) {
index b07be7e..2c22a60 100644 (file)
@@ -17,7 +17,6 @@
 #include "system/floor-type-definition.h"
 #include "system/monster-entity.h"
 #include "system/player-type-definition.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/timed-effects.h"
 #include "view/display-messages.h"
 
@@ -54,7 +53,7 @@ static bool message_water_ball(PlayerType *player_ptr, MONSTER_IDX m_idx, MONSTE
 
     if (mon_to_player) {
         msg_format(_("あなたは渦巻きに飲み込まれた。", "You are engulfed in a whirlpool."));
-    } else if (mon_to_mon && known && see_either && !player_ptr->effects()->blindness()->is_blind()) {
+    } else if (mon_to_mon && known && see_either && !player_ptr->effects()->blindness().is_blind()) {
         msg_format(_("%s^は渦巻に飲み込まれた。", "%s^ is engulfed in a whirlpool."), t_name.data());
     }
     return result;
index 77dda1a..5f50e03 100644 (file)
@@ -17,7 +17,6 @@
 #include "system/floor-type-definition.h"
 #include "system/monster-entity.h"
 #include "system/player-type-definition.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/timed-effects.h"
 #include "view/display-messages.h"
 
@@ -60,7 +59,7 @@ static void message_breath(PlayerType *player_ptr, MONSTER_IDX m_idx, MONSTER_ID
     const auto t_name = monster_name(player_ptr, t_idx);
 
     if (!spell_RF4_BREATH_special_message(m_ptr->r_idx, GF_TYPE, m_name.data())) {
-        if (player_ptr->effects()->blindness()->is_blind()) {
+        if (player_ptr->effects()->blindness().is_blind()) {
             if (mon_to_player || (mon_to_mon && known && see_either)) {
                 msg_format(_("%s^が何かのブレスを吐いた。", "%s^ breathes."), m_name.data());
             }
index cf78859..94a4a7f 100644 (file)
@@ -10,7 +10,6 @@
 #include "mspell/mspell-result.h"
 #include "mspell/mspell-util.h"
 #include "system/floor-type-definition.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/timed-effects.h"
 #include "view/display-messages.h"
 
@@ -21,7 +20,7 @@ static bool message_curse(PlayerType *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX
 
     if (target_type == MONSTER_TO_PLAYER) {
         disturb(player_ptr, true, true);
-        if (player_ptr->effects()->blindness()->is_blind()) {
+        if (player_ptr->effects()->blindness().is_blind()) {
             msg_format(msg1.data(), m_name.data());
         } else {
             msg_format(msg2.data(), m_name.data());
index d18b210..ba276aa 100644 (file)
@@ -39,7 +39,6 @@
 #include "system/monster-race-info.h"
 #include "system/player-type-definition.h"
 #include "system/redrawing-flags-updater.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/timed-effects.h"
 #include "util/bit-flags-calculator.h"
 #include "view/display-messages.h"
@@ -460,7 +459,7 @@ MonsterSpellResult spell_RF6_TRAPS(PlayerType *player_ptr, POSITION y, POSITION
     const auto m_name = monster_name(player_ptr, m_idx);
     disturb(player_ptr, true, true);
 
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         msg_format(_("%s^が何かをつぶやいて邪悪に微笑んだ。", "%s^ mumbles, and then cackles evilly."), m_name.data());
     } else {
         msg_format(_("%s^が呪文を唱えて邪悪に微笑んだ。", "%s^ casts a spell and cackles evilly."), m_name.data());
index fc19d9e..da9b686 100644 (file)
@@ -3,7 +3,6 @@
 #include "system/floor-type-definition.h"
 #include "system/monster-entity.h"
 #include "system/player-type-definition.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/timed-effects.h"
 #include "world/world.h"
 
@@ -19,7 +18,7 @@ bool spell_learnable(PlayerType *player_ptr, MONSTER_IDX m_idx)
 {
     const auto &floor = *player_ptr->current_floor_ptr;
     const auto &monster = floor.m_list[m_idx];
-    const auto seen = (!player_ptr->effects()->blindness()->is_blind() && monster.ml);
+    const auto seen = (!player_ptr->effects()->blindness().is_blind() && monster.ml);
     const auto maneable = floor.has_los({ monster.fy, monster.fx });
     return seen && maneable && (w_ptr->timewalk_m_idx == 0);
 }
index 71733f1..2d46176 100644 (file)
@@ -35,7 +35,6 @@
 #include "system/monster-race-info.h"
 #include "system/player-type-definition.h"
 #include "system/redrawing-flags-updater.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/timed-effects.h"
 #include "view/display-messages.h"
 #include <algorithm>
@@ -161,7 +160,7 @@ static MonsterSpellResult spell_RF6_SPECIAL_ROLENTO(PlayerType *player_ptr, POSI
     for (k = 0; k < num; k++) {
         count += summon_named_creature(player_ptr, m_idx, y, x, MonsterRaceId::GRENADE, mode);
     }
-    if (player_ptr->effects()->blindness()->is_blind() && count) {
+    if (player_ptr->effects()->blindness().is_blind() && count) {
         msg_print(_("多くのものが間近にばらまかれる音がする。", "You hear many things scattered nearby."));
     }
 
index b9ebd19..6fa2241 100644 (file)
@@ -33,7 +33,6 @@
 #include "system/monster-race-info.h"
 #include "system/player-type-definition.h"
 #include "system/redrawing-flags-updater.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/timed-effects.h"
 #include "view/display-messages.h"
 
@@ -67,7 +66,7 @@ void spell_badstatus_message_to_player(PlayerType *player_ptr, MONSTER_IDX m_idx
     const auto m_name = monster_name(player_ptr, m_idx);
 
     disturb(player_ptr, true, true);
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         msg_format(msgs.blind, m_name.data());
     } else {
         msg_format(msgs.not_blind, m_name.data());
@@ -175,7 +174,7 @@ MonsterSpellResult spell_RF5_DRAIN_MANA(PlayerType *player_ptr, POSITION y, POSI
 MonsterSpellResult spell_RF5_MIND_BLAST(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int target_type)
 {
     auto *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
-    bool seen = (!player_ptr->effects()->blindness()->is_blind() && m_ptr->ml);
+    bool seen = (!player_ptr->effects()->blindness().is_blind() && m_ptr->ml);
     const auto m_name = monster_name(player_ptr, m_idx);
     const auto t_name = monster_name(player_ptr, t_idx);
 
@@ -213,7 +212,7 @@ MonsterSpellResult spell_RF5_MIND_BLAST(PlayerType *player_ptr, POSITION y, POSI
 MonsterSpellResult spell_RF5_BRAIN_SMASH(PlayerType *player_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int target_type)
 {
     auto *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
-    bool seen = (!player_ptr->effects()->blindness()->is_blind() && m_ptr->ml);
+    bool seen = (!player_ptr->effects()->blindness().is_blind() && m_ptr->ml);
     const auto m_name = monster_name(player_ptr, m_idx);
     const auto t_name = monster_name(player_ptr, t_idx);
 
@@ -494,7 +493,7 @@ MonsterSpellResult spell_RF6_HASTE(PlayerType *player_ptr, MONSTER_IDX m_idx, MO
         _("%s^が自分の体に念を送った。", format("%%s^ concentrates on %s body.", m_poss.data())),
         _("%s^が自分の体に念を送った。", format("%%s^ concentrates on %s body.", m_poss.data())));
 
-    monspell_message_base(player_ptr, m_idx, t_idx, msg, player_ptr->effects()->blindness()->is_blind(), target_type);
+    monspell_message_base(player_ptr, m_idx, t_idx, msg, player_ptr->effects()->blindness().is_blind(), target_type);
 
     if (set_monster_fast(player_ptr, m_idx, m_ptr->get_remaining_acceleration() + 100)) {
         if (target_type == MONSTER_TO_PLAYER || (target_type == MONSTER_TO_MONSTER && see_m)) {
@@ -587,7 +586,7 @@ MonsterSpellResult spell_RF6_HEAL(PlayerType *player_ptr, MONSTER_IDX m_idx, MON
     auto *floor_ptr = player_ptr->current_floor_ptr;
     auto *m_ptr = &floor_ptr->m_list[m_idx];
     DEPTH rlev = monster_level_idx(floor_ptr, m_idx);
-    const auto is_blind = player_ptr->effects()->blindness()->is_blind();
+    const auto is_blind = player_ptr->effects()->blindness().is_blind();
     const auto seen = (!is_blind && m_ptr->ml);
     const auto m_poss = monster_desc(player_ptr, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE);
 
@@ -650,7 +649,7 @@ MonsterSpellResult spell_RF6_HEAL(PlayerType *player_ptr, MONSTER_IDX m_idx, MON
 MonsterSpellResult spell_RF6_INVULNER(PlayerType *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int target_type)
 {
     auto *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
-    bool seen = (!player_ptr->effects()->blindness()->is_blind() && m_ptr->ml);
+    bool seen = (!player_ptr->effects()->blindness().is_blind() && m_ptr->ml);
     mspell_cast_msg msg(_("%s^が何かを力強くつぶやいた。", "%s^ mumbles powerfully."),
         _("%s^が何かを力強くつぶやいた。", "%s^ mumbles powerfully."), _("%sは無傷の球の呪文を唱えた。", "%s^ casts a Globe of Invulnerability."),
         _("%sは無傷の球の呪文を唱えた。", "%s^ casts a Globe of Invulnerability."));
index 1f40dc3..904c01f 100644 (file)
@@ -23,7 +23,6 @@
 #include "system/monster-entity.h"
 #include "system/monster-race-info.h"
 #include "system/player-type-definition.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/timed-effects.h"
 #include "util/bit-flags-calculator.h"
 #include "view/display-messages.h"
@@ -104,7 +103,7 @@ static void decide_summon_kin_caster(
 
     summon_disturb(player_ptr, target_type, known, see_either);
 
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         if (mon_to_player) {
             msg_format(_("%s^が何かをつぶやいた。", "%s^ mumbles."), m_name);
         }
@@ -210,7 +209,7 @@ MonsterSpellResult spell_RF6_S_KIN(PlayerType *player_ptr, POSITION y, POSITION
         break;
     }
 
-    if (player_ptr->effects()->blindness()->is_blind() && count && (target_type == MONSTER_TO_PLAYER)) {
+    if (player_ptr->effects()->blindness().is_blind() && count && (target_type == MONSTER_TO_PLAYER)) {
         msg_print(_("多くのものが間近に現れた音がする。", "You hear many things appear nearby."));
     }
 
@@ -258,7 +257,7 @@ MonsterSpellResult spell_RF6_S_CYBER(PlayerType *player_ptr, POSITION y, POSITIO
         count += summon_cyber(player_ptr, m_idx, y, x);
     }
 
-    if (player_ptr->effects()->blindness()->is_blind() && count && mon_to_player) {
+    if (player_ptr->effects()->blindness().is_blind() && count && mon_to_player) {
         msg_print(_("重厚な足音が近くで聞こえる。", "You hear heavy steps nearby."));
     }
 
@@ -309,7 +308,7 @@ MonsterSpellResult spell_RF6_S_MONSTER(PlayerType *player_ptr, POSITION y, POSIT
         }
     }
 
-    if (player_ptr->effects()->blindness()->is_blind() && count && mon_to_player) {
+    if (player_ptr->effects()->blindness().is_blind() && count && mon_to_player) {
         msg_print(_("何かが間近に現れた音がする。", "You hear something appear nearby."));
     }
 
@@ -360,7 +359,7 @@ MonsterSpellResult spell_RF6_S_MONSTERS(PlayerType *player_ptr, POSITION y, POSI
         }
     }
 
-    if (player_ptr->effects()->blindness()->is_blind() && count && mon_to_player) {
+    if (player_ptr->effects()->blindness().is_blind() && count && mon_to_player) {
         msg_print(_("多くのものが間近に現れた音がする。", "You hear many things appear nearby."));
     }
 
@@ -405,7 +404,7 @@ MonsterSpellResult spell_RF6_S_ANT(PlayerType *player_ptr, POSITION y, POSITION
         count += summon_specific(player_ptr, m_idx, y, x, rlev, SUMMON_ANT, PM_ALLOW_GROUP);
     }
 
-    if (player_ptr->effects()->blindness()->is_blind() && count && mon_to_player) {
+    if (player_ptr->effects()->blindness().is_blind() && count && mon_to_player) {
         msg_print(_("多くのものが間近に現れた音がする。", "You hear many things appear nearby."));
     }
 
@@ -450,7 +449,7 @@ MonsterSpellResult spell_RF6_S_SPIDER(PlayerType *player_ptr, POSITION y, POSITI
         count += summon_specific(player_ptr, m_idx, y, x, rlev, SUMMON_SPIDER, PM_ALLOW_GROUP);
     }
 
-    if (player_ptr->effects()->blindness()->is_blind() && count && mon_to_player) {
+    if (player_ptr->effects()->blindness().is_blind() && count && mon_to_player) {
         msg_print(_("多くのものが間近に現れた音がする。", "You hear many things appear nearby."));
     }
 
@@ -495,7 +494,7 @@ MonsterSpellResult spell_RF6_S_HOUND(PlayerType *player_ptr, POSITION y, POSITIO
         count += summon_specific(player_ptr, m_idx, y, x, rlev, SUMMON_HOUND, PM_ALLOW_GROUP);
     }
 
-    if (player_ptr->effects()->blindness()->is_blind() && count && mon_to_player) {
+    if (player_ptr->effects()->blindness().is_blind() && count && mon_to_player) {
         msg_print(_("多くのものが間近に現れた音がする。", "You hear many things appear nearby."));
     }
 
@@ -540,7 +539,7 @@ MonsterSpellResult spell_RF6_S_HYDRA(PlayerType *player_ptr, POSITION y, POSITIO
         count += summon_specific(player_ptr, m_idx, y, x, rlev, SUMMON_HYDRA, PM_ALLOW_GROUP);
     }
 
-    if (player_ptr->effects()->blindness()->is_blind() && count && mon_to_player) {
+    if (player_ptr->effects()->blindness().is_blind() && count && mon_to_player) {
         msg_print(_("多くのものが間近に現れた音がする。", "You hear many things appear nearby."));
     }
 
@@ -591,7 +590,7 @@ MonsterSpellResult spell_RF6_S_ANGEL(PlayerType *player_ptr, POSITION y, POSITIO
         count += summon_specific(player_ptr, m_idx, y, x, rlev, SUMMON_ANGEL, PM_ALLOW_GROUP);
     }
 
-    const auto is_blind = player_ptr->effects()->blindness()->is_blind();
+    const auto is_blind = player_ptr->effects()->blindness().is_blind();
     if (count < 2) {
         if (is_blind && count) {
             msg_print(_("何かが間近に現れた音がする。", "You hear something appear nearby."));
@@ -643,7 +642,7 @@ MonsterSpellResult spell_RF6_S_DEMON(PlayerType *player_ptr, POSITION y, POSITIO
         count += summon_specific(player_ptr, m_idx, y, x, rlev, SUMMON_DEMON, PM_ALLOW_GROUP);
     }
 
-    if (player_ptr->effects()->blindness()->is_blind() && count) {
+    if (player_ptr->effects()->blindness().is_blind() && count) {
         msg_print(_("何かが間近に現れた音がする。", "You hear something appear nearby."));
     }
 
@@ -688,7 +687,7 @@ MonsterSpellResult spell_RF6_S_UNDEAD(PlayerType *player_ptr, POSITION y, POSITI
         count += summon_specific(player_ptr, m_idx, y, x, rlev, SUMMON_UNDEAD, PM_ALLOW_GROUP);
     }
 
-    if (player_ptr->effects()->blindness()->is_blind() && count) {
+    if (player_ptr->effects()->blindness().is_blind() && count) {
         msg_print(_("何かが間近に現れた音がする。", "You hear something appear nearby."));
     }
 
@@ -737,7 +736,7 @@ MonsterSpellResult spell_RF6_S_DRAGON(PlayerType *player_ptr, POSITION y, POSITI
         count += summon_specific(player_ptr, m_idx, y, x, rlev, SUMMON_DRAGON, (PM_ALLOW_GROUP | monster_u_mode(floor_ptr, m_idx)));
     }
 
-    if (player_ptr->effects()->blindness()->is_blind() && count) {
+    if (player_ptr->effects()->blindness().is_blind() && count) {
         msg_print(_("何かが間近に現れた音がする。", "You hear something appear nearby."));
     }
 
@@ -795,7 +794,7 @@ MonsterSpellResult spell_RF6_S_HI_UNDEAD(PlayerType *player_ptr, POSITION y, POS
         }
     }
 
-    if (player_ptr->effects()->blindness()->is_blind() && count && mon_to_player) {
+    if (player_ptr->effects()->blindness().is_blind() && count && mon_to_player) {
         msg_print(_("間近で何か多くのものが這い回る音が聞こえる。", "You hear many creepy things appear nearby."));
     }
 
@@ -847,7 +846,7 @@ MonsterSpellResult spell_RF6_S_HI_DRAGON(PlayerType *player_ptr, POSITION y, POS
         }
     }
 
-    if (player_ptr->effects()->blindness()->is_blind() && count && mon_to_player) {
+    if (player_ptr->effects()->blindness().is_blind() && count && mon_to_player) {
         msg_print(_("多くの力強いものが間近に現れた音が聞こえる。", "You hear many powerful things appear nearby."));
     }
 
@@ -893,7 +892,7 @@ MonsterSpellResult spell_RF6_S_AMBERITES(PlayerType *player_ptr, POSITION y, POS
         count += summon_specific(player_ptr, m_idx, y, x, rlev, SUMMON_AMBERITES, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
     }
 
-    if (player_ptr->effects()->blindness()->is_blind() && count && mon_to_player) {
+    if (player_ptr->effects()->blindness().is_blind() && count && mon_to_player) {
         msg_print(_("何者かが次元を超えて現れた気配がした。", "You feel shadow shifting by immortal beings."));
     }
 
@@ -956,7 +955,7 @@ MonsterSpellResult spell_RF6_S_UNIQUE(PlayerType *player_ptr, POSITION y, POSITI
         count += summon_specific(player_ptr, m_idx, y, x, rlev, non_unique_type, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
     }
 
-    if (player_ptr->effects()->blindness()->is_blind() && count && mon_to_player) {
+    if (player_ptr->effects()->blindness().is_blind() && count && mon_to_player) {
         msg_format(_("多くの%sが間近に現れた音が聞こえる。", "You hear many %s appear nearby."),
             uniques_are_summoned ? _("力強いもの", "powerful things") : _("もの", "things"));
     }
@@ -1003,7 +1002,7 @@ MonsterSpellResult spell_RF6_S_DEAD_UNIQUE(PlayerType *player_ptr, POSITION y, P
         count += summon_specific(player_ptr, m_idx, y, x, rlev, SUMMON_DEAD_UNIQUE, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_CLONE));
     }
 
-    if (player_ptr->effects()->blindness()->is_blind() && count && mon_to_player) {
+    if (player_ptr->effects()->blindness().is_blind() && count && mon_to_player) {
         msg_format(_("多くの力強いものが間近に蘇った音が聞こえる。", "You hear many powerful things animate nearby."));
     }
 
index 478242f..0bd5111 100644 (file)
@@ -6,7 +6,6 @@
 #include "system/floor-type-definition.h"
 #include "system/monster-entity.h"
 #include "system/player-type-definition.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/timed-effects.h"
 #include "view/display-messages.h"
 
@@ -111,7 +110,7 @@ bool monspell_message_base(PlayerType *player_ptr, MONSTER_IDX m_idx, MONSTER_ID
 bool monspell_message(PlayerType *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, const mspell_cast_msg_blind &msgs, int target_type)
 {
     mspell_cast_msg mcm(msgs.blind, msgs.blind, msgs.to_player, msgs.to_mons);
-    const auto is_blind = player_ptr->effects()->blindness()->is_blind();
+    const auto is_blind = player_ptr->effects()->blindness().is_blind();
     return monspell_message_base(player_ptr, m_idx, t_idx, mcm, is_blind, target_type);
 }
 
@@ -126,6 +125,6 @@ bool monspell_message(PlayerType *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_i
 void simple_monspell_message(PlayerType *player_ptr, MONSTER_IDX m_idx, MONSTER_IDX t_idx, const mspell_cast_msg_simple &msgs, int target_type)
 {
     mspell_cast_msg mcm(msgs.to_player, msgs.to_mons, msgs.to_player, msgs.to_mons);
-    const auto is_blind = player_ptr->effects()->blindness()->is_blind();
+    const auto is_blind = player_ptr->effects()->blindness().is_blind();
     monspell_message_base(player_ptr, m_idx, t_idx, mcm, is_blind, target_type);
 }
index 539d7f8..6a36847 100644 (file)
@@ -14,7 +14,6 @@
 #include "spell/summon-types.h"
 #include "system/monster-race-info.h"
 #include "system/player-type-definition.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/timed-effects.h"
 #include "view/display-messages.h"
 
@@ -181,7 +180,7 @@ MONSTER_NUMBER summon_NAZGUL(PlayerType *player_ptr, POSITION y, POSITION x, MON
     POSITION cx = x;
     const auto m_name = monster_name(player_ptr, m_idx);
 
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         msg_format(_("%s^が何かをつぶやいた。", "%s^ mumbles."), m_name.data());
     } else {
         msg_format(_("%s^が魔法で幽鬼戦隊を召喚した!", "%s^ magically summons rangers of Nazgul!"), m_name.data());
index ecca928..9ee7ab7 100644 (file)
@@ -61,7 +61,6 @@
 #include "target/target-checker.h"
 #include "target/target-getter.h"
 #include "term/screen-processor.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/player-hallucination.h"
 #include "timed-effect/timed-effects.h"
 #include "util/bit-flags-calculator.h"
@@ -548,7 +547,7 @@ void ObjectThrowEntity::process_boomerang_throw()
 
 void ObjectThrowEntity::display_boomerang_throw()
 {
-    const auto is_blind = this->player_ptr->effects()->blindness()->is_blind();
+    const auto is_blind = this->player_ptr->effects()->blindness().is_blind();
     if ((this->back_chance > 37) && !is_blind && (this->i_idx >= 0)) {
         msg_format(_("%sが手元に返ってきた。", "%s comes back to you."), this->o2_name.data());
         this->come_back = true;
index 2e94dbc..2ce5629 100644 (file)
@@ -9,7 +9,6 @@
 #include "system/item-entity.h"
 #include "system/player-type-definition.h"
 #include "system/redrawing-flags-updater.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/timed-effects.h"
 #include "view/display-messages.h"
 #include "world/world.h"
@@ -52,7 +51,7 @@ void notice_lite_change(PlayerType *player_ptr, ItemEntity *o_ptr)
         rfu.set_flag(SubWindowRedrawingFlag::EQUIPMENT);
     }
 
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         if (o_ptr->fuel == 0) {
             o_ptr->fuel++;
         }
index 9bba96d..683535c 100644 (file)
@@ -33,7 +33,6 @@
 #include "system/monster-race-info.h"
 #include "system/player-type-definition.h"
 #include "target/projection-path-calculator.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/timed-effects.h"
 #include "util/bit-flags-calculator.h"
 #include "view/display-messages.h"
@@ -119,7 +118,7 @@ static void spell_damcalc(PlayerType *player_ptr, MonsterEntity *m_ptr, Attribut
         break;
 
     case AttributeType::MONSTER_SHOOT:
-        if (!player_ptr->effects()->blindness()->is_blind() && (has_invuln_arrow(player_ptr))) {
+        if (!player_ptr->effects()->blindness().is_blind() && (has_invuln_arrow(player_ptr))) {
             dam = 0;
             ignore_wraith_form = true;
         }
index 30a9dbc..a45eb6e 100644 (file)
@@ -28,7 +28,6 @@
 #include "system/item-entity.h"
 #include "system/player-type-definition.h"
 #include "system/redrawing-flags-updater.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/timed-effects.h"
 #include "util/bit-flags-calculator.h"
 
@@ -226,7 +225,7 @@ TrFlags PlayerClass::stance_tr_flags() const
 
     switch (this->get_samurai_stance()) {
     case SamuraiStanceType::FUUJIN:
-        if (!this->player_ptr->effects()->blindness()->is_blind()) {
+        if (!this->player_ptr->effects()->blindness().is_blind()) {
             flags.set(TR_REFLECT);
         }
         break;
index 1430e22..692ffd8 100644 (file)
@@ -30,7 +30,6 @@
 #include "term/gameterm.h"
 #include "term/screen-processor.h"
 #include "term/z-form.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/player-confusion.h"
 #include "timed-effect/player-cut.h"
 #include "timed-effect/player-fear.h"
@@ -43,7 +42,7 @@
 static void set_bad_status_info(PlayerType *player_ptr, self_info_type *self_ptr)
 {
     auto effects = player_ptr->effects();
-    if (effects->blindness()->is_blind()) {
+    if (effects->blindness().is_blind()) {
         self_ptr->info_list.emplace_back(_("あなたは目が見えない。", "You cannot see."));
     }
 
@@ -323,9 +322,9 @@ void report_magics(PlayerType *player_ptr)
     concptr info[128];
     int info2[128];
     const auto effects = player_ptr->effects();
-    const auto blindness = effects->blindness();
-    if (blindness->is_blind()) {
-        info2[i] = report_magics_aux(blindness->current());
+    const auto &blindness = effects->blindness();
+    if (blindness.is_blind()) {
+        info2[i] = report_magics_aux(blindness.current());
         info[i++] = _("あなたは目が見えない", "You cannot see");
     }
 
index 9f04f6e..f97d1fa 100644 (file)
@@ -46,7 +46,6 @@
 #include "system/redrawing-flags-updater.h"
 #include "system/terrain-type-definition.h"
 #include "target/target-checker.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/player-confusion.h"
 #include "timed-effect/player-hallucination.h"
 #include "timed-effect/timed-effects.h"
@@ -108,7 +107,7 @@ void search(PlayerType *player_ptr)
 {
     PERCENTAGE chance = player_ptr->skill_srh;
     const auto effects = player_ptr->effects();
-    if (effects->blindness()->is_blind() || no_lite(player_ptr)) {
+    if (effects->blindness().is_blind() || no_lite(player_ptr)) {
         chance = chance / 10;
     }
 
@@ -186,7 +185,7 @@ bool move_player_effect(PlayerType *player_ptr, POSITION ny, POSITION nx, BIT_FL
             SubWindowRedrawingFlag::DUNGEON,
         };
         rfu.set_flags(flags_swrf);
-        if ((!player_ptr->effects()->blindness()->is_blind() && !no_lite(player_ptr)) || !is_trap(player_ptr, grid_new.feat)) {
+        if ((!player_ptr->effects()->blindness().is_blind() && !no_lite(player_ptr)) || !is_trap(player_ptr, grid_new.feat)) {
             grid_new.info &= ~(CAVE_UNSAFE);
         }
 
index 88de08d..34c0688 100644 (file)
@@ -42,7 +42,6 @@
 #include "system/monster-entity.h"
 #include "system/monster-race-info.h"
 #include "system/player-type-definition.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/timed-effects.h"
 #include "util/bit-flags-calculator.h"
 #include "util/string-processor.h"
@@ -694,7 +693,7 @@ BIT_FLAGS has_no_ac(PlayerType *player_ptr)
 
 BIT_FLAGS has_invuln_arrow(PlayerType *player_ptr)
 {
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         return 0;
     }
 
index 583bc0a..35c32a8 100644 (file)
@@ -12,7 +12,6 @@
 #include "system/floor-type-definition.h"
 #include "system/player-type-definition.h"
 #include "timed-effect/player-acceleration.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/player-confusion.h"
 #include "timed-effect/player-cut.h"
 #include "timed-effect/player-deceleration.h"
@@ -161,7 +160,7 @@ void wr_player(PlayerType *player_ptr)
 
     auto effects = player_ptr->effects();
     wr_s16b(0); /* old "rest" */
-    wr_s16b(effects->blindness()->current());
+    wr_s16b(effects->blindness().current());
     wr_s16b(effects->paralysis()->current());
     wr_s16b(effects->confusion()->current());
     wr_s16b(player_ptr->food);
index f09d924..17e4236 100644 (file)
@@ -37,7 +37,6 @@
 #include "target/grid-selector.h"
 #include "target/projection-path-calculator.h"
 #include "target/target-checker.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/player-hallucination.h"
 #include "timed-effect/timed-effects.h"
 #include "util/bit-flags-calculator.h"
@@ -286,7 +285,7 @@ void SpellsMirrorMaster::project_seeker_ray(int target_x, int target_y, int dam)
             const auto &[oy, ox] = *(path_g_ite == path_g.begin() ? path_g.begin() : path_g_ite - 1);
             const auto &[ny, nx] = *path_g_ite;
 
-            if (delay_factor > 0 && !this->player_ptr->effects()->blindness()->is_blind()) {
+            if (delay_factor > 0 && !this->player_ptr->effects()->blindness().is_blind()) {
                 if (panel_contains(ny, nx) && floor.has_los({ ny, nx })) {
                     print_bolt_pict(this->player_ptr, oy, ox, ny, nx, typ);
                     move_cursor_relative(ny, nx);
index b8dace3..29648f5 100644 (file)
@@ -25,7 +25,6 @@
 #include "system/player-type-definition.h"
 #include "system/terrain-type-definition.h"
 #include "target/projection-path-calculator.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/timed-effects.h"
 #include "util/bit-flags-calculator.h"
 #include "util/point-2d.h"
@@ -374,7 +373,7 @@ void unlite_room(PlayerType *player_ptr, const POSITION y1, const POSITION x1)
  */
 bool starlight(PlayerType *player_ptr, bool magic)
 {
-    if (!player_ptr->effects()->blindness()->is_blind() && !magic) {
+    if (!player_ptr->effects()->blindness().is_blind() && !magic) {
         msg_print(_("杖の先が明るく輝いた...", "The end of the staff glows brightly..."));
     }
 
@@ -416,7 +415,7 @@ bool lite_area(PlayerType *player_ptr, int dam, POSITION rad)
         return false;
     }
 
-    if (!player_ptr->effects()->blindness()->is_blind()) {
+    if (!player_ptr->effects()->blindness().is_blind()) {
         msg_print(_("白い光が辺りを覆った。", "You are surrounded by a white light."));
     }
 
@@ -437,7 +436,7 @@ bool lite_area(PlayerType *player_ptr, int dam, POSITION rad)
  */
 bool unlite_area(PlayerType *player_ptr, int dam, POSITION rad)
 {
-    if (!player_ptr->effects()->blindness()->is_blind()) {
+    if (!player_ptr->effects()->blindness().is_blind()) {
         msg_print(_("暗闇が辺りを覆った。", "Darkness surrounds you."));
     }
 
index abd3e5d..32b59e2 100644 (file)
@@ -19,7 +19,6 @@
 #include "system/angband-exceptions.h"
 #include "system/player-type-definition.h"
 #include "system/redrawing-flags-updater.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/player-confusion.h"
 #include "timed-effect/player-cut.h"
 #include "timed-effect/player-deceleration.h"
@@ -57,8 +56,8 @@ bool BadStatusSetter::set_blindness(const TIME_EFFECT tmp_v)
     }
 
     PlayerRace pr(this->player_ptr);
-    const auto blindness = this->player_ptr->effects()->blindness();
-    const auto is_blind = blindness->is_blind();
+    auto &blindness = this->player_ptr->effects()->blindness();
+    const auto is_blind = blindness.is_blind();
     if (v > 0) {
         if (!is_blind) {
             if (pr.equals(PlayerRaceType::ANDROID)) {
@@ -82,7 +81,7 @@ bool BadStatusSetter::set_blindness(const TIME_EFFECT tmp_v)
         }
     }
 
-    blindness->set(v);
+    blindness.set(v);
     auto &rfu = RedrawingFlagsUpdater::get_instance();
     rfu.set_flag(MainWindowRedrawingFlag::TIMED_EFFECT);
     if (!notice) {
@@ -114,7 +113,7 @@ bool BadStatusSetter::set_blindness(const TIME_EFFECT tmp_v)
 
 bool BadStatusSetter::mod_blindness(const TIME_EFFECT tmp_v)
 {
-    return this->set_blindness(this->player_ptr->effects()->blindness()->current() + tmp_v);
+    return this->set_blindness(this->player_ptr->effects()->blindness().current() + tmp_v);
 }
 
 /*!
index b09c0e1..c96ce9a 100644 (file)
@@ -19,7 +19,6 @@
 #include "system/player-type-definition.h"
 #include "system/redrawing-flags-updater.h"
 #include "timed-effect/player-acceleration.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/player-confusion.h"
 #include "timed-effect/player-cut.h"
 #include "timed-effect/player-deceleration.h"
@@ -40,7 +39,7 @@ void reset_tim_flags(PlayerType *player_ptr)
     effects->acceleration()->reset();
     player_ptr->lightspeed = 0;
     effects->deceleration()->reset();
-    effects->blindness()->reset();
+    effects->blindness().reset();
     effects->paralysis()->reset();
     effects->confusion()->reset();
     effects->fear()->reset();
index c40c5ed..b3aef89 100644 (file)
@@ -3,7 +3,6 @@
 #include "market/arena-info-table.h"
 #include "system/angband-exceptions.h"
 #include "system/redrawing-flags-updater.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/player-confusion.h"
 #include "timed-effect/player-cut.h"
 #include "timed-effect/player-deceleration.h"
@@ -50,7 +49,7 @@ bool PlayerType::is_fully_healthy() const
     auto effects = this->effects();
     auto is_fully_healthy = this->chp == this->mhp;
     is_fully_healthy &= this->csp >= this->msp;
-    is_fully_healthy &= !effects->blindness()->is_blind();
+    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();
index 4e3e78c..59e7ab8 100644 (file)
@@ -3,6 +3,11 @@
 class PlayerBlindness {
 public:
     PlayerBlindness() = default;
+    ~PlayerBlindness() = default;
+    PlayerBlindness(const PlayerBlindness &) = delete;
+    PlayerBlindness(PlayerBlindness &&) = delete;
+    PlayerBlindness &operator=(const PlayerBlindness &) = delete;
+    PlayerBlindness &operator=(PlayerBlindness &&) = delete;
 
     short current() const;
     bool is_blind() const;
index 5eb4a09..9a407bb 100644 (file)
@@ -6,7 +6,6 @@
 
 #include "timed-effect/timed-effects.h"
 #include "timed-effect/player-acceleration.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/player-confusion.h"
 #include "timed-effect/player-cut.h"
 #include "timed-effect/player-deceleration.h"
@@ -17,8 +16,7 @@
 #include "timed-effect/player-stun.h"
 
 TimedEffects::TimedEffects()
-    : player_blindness(std::make_shared<PlayerBlindness>())
-    , player_confusion(std::make_shared<PlayerConfusion>())
+    : player_confusion(std::make_shared<PlayerConfusion>())
     , player_cut(std::make_shared<PlayerCut>())
     , player_fear(std::make_shared<PlayerFear>())
     , player_hallucination(std::make_shared<PlayerHallucination>())
@@ -30,7 +28,12 @@ TimedEffects::TimedEffects()
 {
 }
 
-std::shared_ptr<PlayerBlindness> TimedEffects::blindness() const
+PlayerBlindness &TimedEffects::blindness()
+{
+    return this->player_blindness;
+}
+
+const PlayerBlindness &TimedEffects::blindness() const
 {
     return this->player_blindness;
 }
index c175d14..9823fa4 100644 (file)
@@ -1,9 +1,9 @@
 #pragma once
 
+#include "timed-effect/player-blindness.h"
 #include <memory>
 
 class PlayerAcceleration;
-class PlayerBlindness;
 class PlayerConfusion;
 class PlayerDeceleration;
 class PlayerFear;
@@ -15,9 +15,14 @@ class PlayerStun;
 class TimedEffects {
 public:
     TimedEffects();
-    virtual ~TimedEffects() = default;
+    ~TimedEffects() = default;
+    TimedEffects(const TimedEffects &) = delete;
+    TimedEffects(TimedEffects &&) = delete;
+    TimedEffects &operator=(const TimedEffects &) = delete;
+    TimedEffects &operator=(TimedEffects &&) = delete;
 
-    std::shared_ptr<PlayerBlindness> blindness() const;
+    PlayerBlindness &blindness();
+    const PlayerBlindness &blindness() const;
     std::shared_ptr<PlayerConfusion> confusion() const;
     std::shared_ptr<PlayerCut> cut() const;
     std::shared_ptr<PlayerFear> fear() const;
@@ -29,7 +34,7 @@ public:
     std::shared_ptr<PlayerPoison> poison() const;
 
 private:
-    std::shared_ptr<PlayerBlindness> player_blindness;
+    PlayerBlindness player_blindness{};
     std::shared_ptr<PlayerConfusion> player_confusion;
     std::shared_ptr<PlayerCut> player_cut;
     std::shared_ptr<PlayerFear> player_fear;
index ad91138..b97c82a 100644 (file)
@@ -21,7 +21,6 @@
 #include "system/player-type-definition.h"
 #include "system/terrain-type-definition.h"
 #include "term/term-color-types.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/player-hallucination.h"
 #include "timed-effect/timed-effects.h"
 #include "util/bit-flags-calculator.h"
@@ -149,7 +148,7 @@ DisplaySymbolPair map_info(PlayerType *player_ptr, const Pos2D &pos)
         auto is_visible = any_bits(grid.info, (CAVE_MARK | CAVE_LITE | CAVE_MNLT));
         auto is_glowing = match_bits(grid.info, CAVE_GLOW | CAVE_MNDK, CAVE_GLOW);
         auto can_view = grid.is_view() && (is_glowing || player_ptr->see_nocto);
-        const auto is_blind = player_ptr->effects()->blindness()->is_blind();
+        const auto is_blind = player_ptr->effects()->blindness().is_blind();
         if (!is_blind && (is_visible || can_view)) {
             symbol_config = terrain_mimic_ptr->symbol_configs[F_LIT_STANDARD];
             if (player_ptr->wild_mode) {
@@ -181,7 +180,7 @@ DisplaySymbolPair map_info(PlayerType *player_ptr, const Pos2D &pos)
     } else {
         if (grid.is_mark() && is_revealed_wall(floor, pos)) {
             symbol_config = terrain_mimic_ptr->symbol_configs[F_LIT_STANDARD];
-            const auto is_blind = player_ptr->effects()->blindness()->is_blind();
+            const auto is_blind = player_ptr->effects()->blindness().is_blind();
             if (player_ptr->wild_mode) {
                 if (view_granite_lite && (is_blind || !w_ptr->is_daytime())) {
                     symbol_config = terrain_mimic_ptr->symbol_configs[F_LIT_DARK];
index 06b36d1..c3283ee 100644 (file)
@@ -23,7 +23,6 @@
 #include "term/screen-processor.h"
 #include "term/term-color-types.h"
 #include "term/z-form.h"
-#include "timed-effect/player-blindness.h"
 #include "timed-effect/player-confusion.h"
 #include "timed-effect/player-cut.h"
 #include "timed-effect/player-deceleration.h"
@@ -459,7 +458,7 @@ void print_status(PlayerType *player_ptr)
         ADD_BAR_FLAG(BAR_HALLUCINATION);
     }
 
-    if (player_ptr->effects()->blindness()->is_blind()) {
+    if (player_ptr->effects()->blindness().is_blind()) {
         ADD_BAR_FLAG(BAR_BLINDNESS);
     }