OSDN Git Service

[Refactor] #3286 Removed player-redraw-types.h
[hengbandforosx/hengbandosx.git] / src / racial / racial-kutar.cpp
index 60c5d04..42fa066 100644 (file)
@@ -1,10 +1,9 @@
 #include "racial/racial-kutar.h"
 #include "core/disturbance.h"
-#include "core/player-redraw-types.h"
-#include "core/player-update-types.h"
 #include "core/stuff-handler.h"
 #include "game-option/disturbance-options.h"
 #include "system/player-type-definition.h"
+#include "system/redrawing-flags-updater.h"
 #include "view/display-messages.h"
 
 /*!
  * @param do_dec 現在の継続時間より長い値のみ上書きする
  * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
  */
-bool set_leveling(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
+bool set_leveling(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec)
 {
     bool notice = false;
-    v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
+    v = (v > 10000) ? 10000 : (v < 0) ? 0
+                                      : v;
 
-    if (creature_ptr->is_dead)
+    if (player_ptr->is_dead) {
         return false;
+    }
 
     if (v) {
-        if (creature_ptr->tsubureru && !do_dec) {
-            if (creature_ptr->tsubureru > v)
+        if (player_ptr->tsubureru && !do_dec) {
+            if (player_ptr->tsubureru > v) {
                 return false;
-        } else if (!creature_ptr->tsubureru) {
+            }
+        } else if (!player_ptr->tsubureru) {
             msg_print(_("横に伸びた。", "Your body expands horizontally."));
             notice = true;
         }
     } else {
-        if (creature_ptr->tsubureru) {
+        if (player_ptr->tsubureru) {
             msg_print(_("もう横に伸びていない。", "Your body returns to normal."));
             notice = true;
         }
     }
 
-    creature_ptr->tsubureru = v;
-    creature_ptr->redraw |= (PR_STATUS);
-
-    if (!notice)
+    player_ptr->tsubureru = v;
+    auto &rfu = RedrawingFlagsUpdater::get_instance();
+    rfu.set_flag(MainWindowRedrawingFlag::TIMED_EFFECT);
+    if (!notice) {
         return false;
+    }
+
+    if (disturb_state) {
+        disturb(player_ptr, false, false);
+    }
 
-    if (disturb_state)
-        disturb(creature_ptr, false, false);
-    creature_ptr->update |= (PU_BONUS);
-    handle_stuff(creature_ptr);
+    rfu.set_flag(StatusRedrawingFlag::BONUS);
+    handle_stuff(player_ptr);
     return true;
 }