OSDN Git Service

[Refactor] #2523 confusion() をset_confusion() に差し替えた
authorHourier <66951241+Hourier@users.noreply.github.com>
Sun, 4 Sep 2022 01:52:56 +0000 (10:52 +0900)
committerHourier <66951241+Hourier@users.noreply.github.com>
Mon, 5 Sep 2022 14:19:39 +0000 (23:19 +0900)
src/cmd-building/cmd-inn.cpp
src/cmd-item/cmd-eat.cpp
src/object-use/quaff/quaff-effects.cpp
src/spell/spells-status.cpp
src/status/bad-status-setter.cpp
src/status/bad-status-setter.h

index c5e034d..8097b8d 100644 (file)
@@ -132,7 +132,7 @@ static void back_to_health(PlayerType *player_ptr)
 {
     BadStatusSetter bss(player_ptr);
     (void)bss.set_blindness(0);
-    (void)bss.confusion(0);
+    (void)bss.set_confusion(0);
     player_ptr->effects()->stun()->reset();
     player_ptr->chp = player_ptr->mhp;
     player_ptr->csp = player_ptr->msp;
index cf4e784..e0ce26c 100644 (file)
@@ -109,7 +109,7 @@ bool exe_eat_food_type_object(PlayerType *player_ptr, ObjectType *o_ptr)
     case SV_FOOD_CURE_PARANOIA:
         return bss.fear(0);
     case SV_FOOD_CURE_CONFUSION:
-        return bss.confusion(0);
+        return bss.set_confusion(0);
     case SV_FOOD_CURE_SERIOUS:
         return cure_serious_wounds(player_ptr, 4, 8);
     case SV_FOOD_RESTORE_STR:
index 889c90f..88a0aad 100644 (file)
@@ -262,7 +262,7 @@ bool QuaffEffects::booze()
     }
 
     BadStatusSetter bss(this->player_ptr);
-    if (!has_resist_conf(this->player_ptr) && bss.confusion(randint0(20) + 15)) {
+    if (!has_resist_conf(this->player_ptr) && bss.set_confusion(randint0(20) + 15)) {
         ident = true;
     }
 
index 730e3c7..a88db80 100644 (file)
@@ -292,7 +292,7 @@ bool life_stream(PlayerType *player_ptr, bool message, bool virtue_change)
     BadStatusSetter bss(player_ptr);
     (void)bss.set_poison(0);
     (void)bss.set_blindness(0);
-    (void)bss.confusion(0);
+    (void)bss.set_confusion(0);
     (void)bss.hallucination(0);
     (void)bss.stun(0);
     (void)bss.cut(0);
@@ -376,7 +376,7 @@ bool cure_serious_wounds(PlayerType *player_ptr, DICE_NUMBER dice, DICE_SID side
         ident = true;
     }
 
-    if (bss.confusion(0)) {
+    if (bss.set_confusion(0)) {
         ident = true;
     }
 
@@ -403,7 +403,7 @@ bool cure_critical_wounds(PlayerType *player_ptr, int pow)
         ident = true;
     }
 
-    if (bss.confusion(0)) {
+    if (bss.set_confusion(0)) {
         ident = true;
     }
 
@@ -438,7 +438,7 @@ bool true_healing(PlayerType *player_ptr, int pow)
         ident = true;
     }
 
-    if (bss.confusion(0)) {
+    if (bss.set_confusion(0)) {
         ident = true;
     }
 
index e6f6ed6..6afa859 100644 (file)
@@ -109,7 +109,7 @@ bool BadStatusSetter::mod_blindness(const TIME_EFFECT tmp_v)
  * @param v 継続時間
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool BadStatusSetter::confusion(const TIME_EFFECT tmp_v)
+bool BadStatusSetter::set_confusion(const TIME_EFFECT tmp_v)
 {
     auto notice = false;
     auto v = std::clamp<short>(tmp_v, 0, 10000);
@@ -177,7 +177,7 @@ bool BadStatusSetter::confusion(const TIME_EFFECT tmp_v)
 
 bool BadStatusSetter::mod_confusion(const TIME_EFFECT tmp_v)
 {
-    return this->confusion(this->player_confusion->current() + tmp_v);
+    return this->set_confusion(this->player_confusion->current() + tmp_v);
 }
 
 /*!
index 7cc5202..56213ec 100644 (file)
@@ -18,7 +18,7 @@ public:
 
     bool set_blindness(const TIME_EFFECT tmp_v);
     bool mod_blindness(const TIME_EFFECT tmp_v);
-    bool confusion(const TIME_EFFECT tmp_v);
+    bool set_confusion(const TIME_EFFECT tmp_v);
     bool mod_confusion(const TIME_EFFECT tmp_v);
     bool set_poison(const TIME_EFFECT tmp_v);
     bool mod_poison(const TIME_EFFECT tmp_v);