OSDN Git Service

[Refactor] #2521 slowness() をset_deceleration() に改名した
authorHourier <66951241+Hourier@users.noreply.github.com>
Fri, 5 Aug 2022 09:47:20 +0000 (18:47 +0900)
committerHourier <66951241+Hourier@users.noreply.github.com>
Tue, 9 Aug 2022 12:22:44 +0000 (21:22 +0900)
14 files changed:
src/cmd-action/cmd-shoot.cpp
src/cmd-item/cmd-usestaff.cpp
src/core/magic-effects-timeout-reducer.cpp
src/effect/effect-player-oldies.cpp
src/effect/effect-player-resist-hurt.cpp
src/effect/effect-player-spirit.cpp
src/grid/trap.cpp
src/monster-attack/monster-attack-switcher.cpp
src/mspell/mspell-dispel.cpp
src/mspell/mspell-status.cpp
src/mutation/mutation-processor.cpp
src/object-use/quaff/quaff-effects.cpp
src/status/bad-status-setter.cpp
src/status/bad-status-setter.h

index e278837..886ed33 100644 (file)
@@ -76,7 +76,7 @@ void do_cmd_fire(PlayerType *player_ptr, SPELL_IDX snipe_type)
     if (snipe_type == SP_FINAL) {
         msg_print(_("射撃の反動が体を襲った。", "The weapon's recoil stuns you. "));
         BadStatusSetter bss(player_ptr);
-        (void)bss.mod_slowness(randint0(7) + 7, false);
+        (void)bss.mod_deceleration(randint0(7) + 7, false);
         (void)bss.mod_stun(randint1(25));
     }
 }
index 9488d6e..c854f38 100644 (file)
@@ -72,7 +72,7 @@ int staff_effect(PlayerType *player_ptr, OBJECT_SUBTYPE_VALUE sval, bool *use_ch
 
         break;
     case SV_STAFF_SLOWNESS: {
-        if (bss.mod_slowness(randint1(30) + 15, false)) {
+        if (bss.mod_deceleration(randint1(30) + 15, false)) {
             ident = true;
         }
         break;
index 63262d7..366dac8 100644 (file)
@@ -150,7 +150,7 @@ void reduce_magic_effects_timeout(PlayerType *player_ptr)
     }
 
     if (effects->deceleration()->is_slow()) {
-        (void)bss.mod_slowness(-1, true);
+        (void)bss.mod_deceleration(-1, true);
     }
 
     if (player_ptr->protevil) {
index 1c7fef6..59be29a 100644 (file)
@@ -36,7 +36,7 @@ void effect_player_old_slow(PlayerType *player_ptr)
         msg_print(_("何か遅いもので攻撃された!", "You are hit by something slow!"));
     }
 
-    (void)BadStatusSetter(player_ptr).mod_slowness(randint0(4) + 4, false);
+    (void)BadStatusSetter(player_ptr).mod_deceleration(randint0(4) + 4, false);
 }
 
 void effect_player_old_sleep(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
index 8ef5802..c803232 100644 (file)
@@ -395,7 +395,7 @@ void effect_player_inertial(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
     }
 
     if (!check_multishadow(player_ptr)) {
-        (void)BadStatusSetter(player_ptr).mod_slowness(randint0(4) + 4, false);
+        (void)BadStatusSetter(player_ptr).mod_deceleration(randint0(4) + 4, false);
     }
 
     ep_ptr->get_damage = take_hit(player_ptr, DAMAGE_ATTACK, ep_ptr->dam, ep_ptr->killer);
@@ -572,7 +572,7 @@ void effect_player_gravity(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
         teleport_player(player_ptr, 5, TELEPORT_PASSIVE);
         BadStatusSetter bss(player_ptr);
         if (!player_ptr->levitation) {
-            (void)bss.mod_slowness(randint0(4) + 4, false);
+            (void)bss.mod_deceleration(randint0(4) + 4, false);
         }
 
         if (!(has_resist_sound(player_ptr) || player_ptr->levitation)) {
@@ -692,7 +692,7 @@ void effect_player_void(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
                                         : _("周辺の空間が歪んだ。", "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_slowness(randint0(4) + 4, false);
+        (void)BadStatusSetter(player_ptr).mod_deceleration(randint0(4) + 4, false);
     }
 
     ep_ptr->dam = ep_ptr->dam * calc_void_damage_rate(player_ptr, CALC_RAND) / 100;
@@ -714,7 +714,7 @@ void effect_player_abyss(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
     }
 
     if (!player_ptr->levitation) {
-        (void)bss.mod_slowness(randint0(4) + 4, false);
+        (void)bss.mod_deceleration(randint0(4) + 4, false);
     }
 
     if (player_ptr->blind) {
index fc318c4..60e80a1 100644 (file)
@@ -135,7 +135,7 @@ void effect_player_brain_smash(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
         (void)bss.mod_paralysis(randint0(4) + 4);
     }
 
-    (void)bss.mod_slowness(randint0(4) + 4, false);
+    (void)bss.mod_deceleration(randint0(4) + 4, false);
 
     while (randint0(100 + ep_ptr->rlev / 2) > (std::max<short>(5, player_ptr->skill_sav))) {
         (void)do_dec_stat(player_ptr, A_INT);
index cbfabf0..b29e7b5 100644 (file)
@@ -385,7 +385,7 @@ static void hit_trap_lose_stat(PlayerType *player_ptr, int stat)
 static void hit_trap_slow(PlayerType *player_ptr)
 {
     if (hit_trap_dart(player_ptr)) {
-        (void)BadStatusSetter(player_ptr).mod_slowness(randint0(20) + 20, false);
+        (void)BadStatusSetter(player_ptr).mod_deceleration(randint0(20) + 20, false);
     }
 }
 
index 7fcea58..a205eb8 100644 (file)
@@ -312,7 +312,7 @@ static void calc_blow_inertia(PlayerType *player_ptr, MonsterAttackPlayer *monap
         return;
     }
 
-    if (BadStatusSetter(player_ptr).mod_slowness(4 + randint0(monap_ptr->rlev / 10), false)) {
+    if (BadStatusSetter(player_ptr).mod_deceleration(4 + randint0(monap_ptr->rlev / 10), false)) {
         monap_ptr->obvious = true;
     }
 }
index efdb2bd..e4055c7 100644 (file)
@@ -38,7 +38,7 @@ static void dispel_player(PlayerType *player_ptr)
 {
     (void)set_acceleration(player_ptr, 0, true);
     set_lightspeed(player_ptr, 0, true);
-    (void)BadStatusSetter(player_ptr).slowness(0, true);
+    (void)BadStatusSetter(player_ptr).set_deceleration(0, true);
     (void)set_shield(player_ptr, 0, true);
     (void)set_blessed(player_ptr, 0, true);
     (void)set_tsuyoshi(player_ptr, 0, true);
index b235db4..05f651a 100644 (file)
@@ -543,7 +543,7 @@ MonsterSpellResult spell_RF5_SLOW(MONSTER_IDX m_idx, PlayerType *player_ptr, MON
         spell_badstatus_message_to_player(player_ptr, m_idx, msg, resist, saving_throw);
 
         if (!resist && !saving_throw) {
-            (void)BadStatusSetter(player_ptr).mod_slowness(randint0(4) + 4, false);
+            (void)BadStatusSetter(player_ptr).mod_deceleration(randint0(4) + 4, false);
         }
 
         update_smart_learn(player_ptr, m_idx, DRS_FREE);
index 1057870..2b1bd1c 100644 (file)
@@ -239,12 +239,12 @@ void process_world_aux_mutation(PlayerType *player_ptr)
             if (player_ptr->effects()->acceleration()->is_fast()) {
                 set_acceleration(player_ptr, 0, true);
             } else {
-                (void)bss.slowness(randint1(30) + 10, false);
+                (void)bss.set_deceleration(randint1(30) + 10, false);
             }
         } else {
             msg_print(_("精力的になった気がする。", "You feel more energetic."));
             if (player_ptr->effects()->deceleration()->is_slow()) {
-                (void)bss.slowness(0, true);
+                (void)bss.set_deceleration(0, true);
             } else {
                 set_acceleration(player_ptr, randint1(30) + 10, false);
             }
index 77bf5ae..bd5b72f 100644 (file)
@@ -67,7 +67,7 @@ bool QuaffEffects::influence(const ObjectType &o_ref)
         msg_print(_("のどの渇きが少しおさまった。", "You feel less thirsty."));
         return true;
     case SV_POTION_SLOWNESS:
-        return BadStatusSetter(this->player_ptr).slowness(randint1(25) + 15, false);
+        return BadStatusSetter(this->player_ptr).set_deceleration(randint1(25) + 15, false);
     case SV_POTION_SALT_WATER:
         return this->salt_water();
     case SV_POTION_POISON:
index 55141ca..895d9f0 100644 (file)
@@ -388,7 +388,7 @@ bool BadStatusSetter::mod_hallucination(const TIME_EFFECT tmp_v)
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool BadStatusSetter::slowness(const TIME_EFFECT tmp_v, bool do_dec)
+bool BadStatusSetter::set_deceleration(const TIME_EFFECT tmp_v, bool do_dec)
 {
     auto notice = false;
     auto v = std::clamp<short>(tmp_v, 0, 10000);
@@ -428,9 +428,9 @@ bool BadStatusSetter::slowness(const TIME_EFFECT tmp_v, bool do_dec)
     return true;
 }
 
-bool BadStatusSetter::mod_slowness(const TIME_EFFECT tmp_v, bool do_dec)
+bool BadStatusSetter::mod_deceleration(const TIME_EFFECT tmp_v, bool do_dec)
 {
-    return this->slowness(this->player_ptr->effects()->deceleration()->current() + tmp_v, do_dec);
+    return this->set_deceleration(this->player_ptr->effects()->deceleration()->current() + tmp_v, do_dec);
 }
 
 /*!
index 85c0255..f45d01b 100644 (file)
@@ -28,8 +28,8 @@ public:
     bool mod_paralysis(const TIME_EFFECT tmp_v);
     bool hallucination(const TIME_EFFECT tmp_v);
     bool mod_hallucination(const TIME_EFFECT tmp_v);
-    bool slowness(const TIME_EFFECT tmp_v, bool do_dec);
-    bool mod_slowness(const TIME_EFFECT tmp_v, bool do_dec);
+    bool set_deceleration(const TIME_EFFECT tmp_v, bool do_dec);
+    bool mod_deceleration(const TIME_EFFECT tmp_v, bool do_dec);
     bool stun(const TIME_EFFECT tmp_v);
     bool mod_stun(const TIME_EFFECT tmp_v);
     bool cut(const TIME_EFFECT tmp_v);