OSDN Git Service

[Refactor] #38997 do_inc_stat() に player_type * 引数を追加.
authordeskull <deskull@users.sourceforge.jp>
Wed, 26 Jun 2019 15:10:33 +0000 (00:10 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Wed, 26 Jun 2019 15:10:33 +0000 (00:10 +0900)
src/cmd-activate.c
src/cmd-quaff.c
src/patron.c
src/player-effects.c
src/player-effects.h
src/player-status.c

index 76228f5..521c3ad 100644 (file)
@@ -1748,7 +1748,7 @@ bool activate_artifact(object_type *o_ptr)
                if (get_check(_("本当に使いますか?", "Are you sure?!")))
                {
                        msg_print(_("村正が震えた...", "The Muramasa pulsates..."));
-                       do_inc_stat(A_STR);
+                       do_inc_stat(p_ptr, A_STR);
                        if (one_in_(2))
                        {
                                msg_print(_("村正は壊れた!", "The Muramasa is destroyed!"));
index 2645533..6159370 100644 (file)
@@ -369,36 +369,36 @@ void exe_quaff_potion(INVENTORY_IDX item)
                        break;
 
                case SV_POTION_INC_STR:
-                       if (do_inc_stat(A_STR)) ident = TRUE;
+                       if (do_inc_stat(p_ptr, A_STR)) ident = TRUE;
                        break;
 
                case SV_POTION_INC_INT:
-                       if (do_inc_stat(A_INT)) ident = TRUE;
+                       if (do_inc_stat(p_ptr, A_INT)) ident = TRUE;
                        break;
 
                case SV_POTION_INC_WIS:
-                       if (do_inc_stat(A_WIS)) ident = TRUE;
+                       if (do_inc_stat(p_ptr, A_WIS)) ident = TRUE;
                        break;
 
                case SV_POTION_INC_DEX:
-                       if (do_inc_stat(A_DEX)) ident = TRUE;
+                       if (do_inc_stat(p_ptr, A_DEX)) ident = TRUE;
                        break;
 
                case SV_POTION_INC_CON:
-                       if (do_inc_stat(A_CON)) ident = TRUE;
+                       if (do_inc_stat(p_ptr, A_CON)) ident = TRUE;
                        break;
 
                case SV_POTION_INC_CHR:
-                       if (do_inc_stat(A_CHR)) ident = TRUE;
+                       if (do_inc_stat(p_ptr, A_CHR)) ident = TRUE;
                        break;
 
                case SV_POTION_AUGMENTATION:
-                       if (do_inc_stat(A_STR)) ident = TRUE;
-                       if (do_inc_stat(A_INT)) ident = TRUE;
-                       if (do_inc_stat(A_WIS)) ident = TRUE;
-                       if (do_inc_stat(A_DEX)) ident = TRUE;
-                       if (do_inc_stat(A_CON)) ident = TRUE;
-                       if (do_inc_stat(A_CHR)) ident = TRUE;
+                       if (do_inc_stat(p_ptr, A_STR)) ident = TRUE;
+                       if (do_inc_stat(p_ptr, A_INT)) ident = TRUE;
+                       if (do_inc_stat(p_ptr, A_WIS)) ident = TRUE;
+                       if (do_inc_stat(p_ptr, A_DEX)) ident = TRUE;
+                       if (do_inc_stat(p_ptr, A_CON)) ident = TRUE;
+                       if (do_inc_stat(p_ptr, A_CHR)) ident = TRUE;
                        break;
 
                case SV_POTION_ENLIGHTENMENT:
@@ -415,8 +415,8 @@ void exe_quaff_potion(INVENTORY_IDX item)
                        chg_virtue(V_ENLIGHTEN, 2);
                        msg_print(NULL);
                        wiz_lite(FALSE);
-                       (void)do_inc_stat(A_INT);
-                       (void)do_inc_stat(A_WIS);
+                       (void)do_inc_stat(p_ptr, A_INT);
+                       (void)do_inc_stat(p_ptr, A_WIS);
                        (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
                        (void)detect_doors(DETECT_RAD_DEFAULT);
                        (void)detect_stairs(DETECT_RAD_DEFAULT);
index 35a8556..ffcf6f7 100644 (file)
@@ -417,9 +417,9 @@ void gain_level_reward(int chosen_reward)
                        msg_print(_("「留まるのだ、下僕よ。余が汝の肉体を鍛えん。」", "'Stay, mortal, and let me mold thee.'"));
 
                        if (one_in_(3) && !(chaos_stats[p_ptr->chaos_patron] < 0))
-                               do_inc_stat(chaos_stats[p_ptr->chaos_patron]);
+                               do_inc_stat(p_ptr, chaos_stats[p_ptr->chaos_patron]);
                        else
-                               do_inc_stat(randint0(6));
+                               do_inc_stat(p_ptr, randint0(6));
                        reward = _("能力値が上がった。", "increasing a stat");
                        break;
 
@@ -465,7 +465,7 @@ void gain_level_reward(int chosen_reward)
 
                        for (dummy = 0; dummy < A_MAX; dummy++)
                        {
-                               (void)do_inc_stat(dummy);
+                               (void)do_inc_stat(p_ptr, dummy);
                        }
                        reward = _("全能力値が上がった。", "increasing all stats");
                        break;
index 3bca880..40da1bd 100644 (file)
@@ -3570,15 +3570,15 @@ bool do_res_stat(player_type *creature_ptr, int stat)
 /*
  * Gain a "point" in a stat
  */
-bool do_inc_stat(int stat)
+bool do_inc_stat(player_type *creature_ptr, int stat)
 {
        bool res;
 
        /* Restore strength */
-       res = res_stat(p_ptr, stat);
+       res = res_stat(creature_ptr, stat);
 
        /* Attempt to increase */
-       if (inc_stat(p_ptr, stat))
+       if (inc_stat(creature_ptr, stat))
        {
                if (stat == A_WIS)
                {
index 22c5009..e85c48e 100644 (file)
@@ -63,7 +63,7 @@ extern bool res_stat(player_type *creature_ptr, int stat);
 extern bool hp_player(player_type *creature_ptr, int num);
 extern bool do_dec_stat(player_type *creature_ptr, int stat);
 extern bool do_res_stat(player_type *creature_ptr, int stat);
-extern bool do_inc_stat(int stat);
+extern bool do_inc_stat(player_type *creature_ptr, int stat);
 extern bool restore_level(void);
 extern bool lose_all_info(void);
 extern void gain_exp_64(s32b amount, u32b amount_frac);
index 0781997..9181aa0 100644 (file)
@@ -5598,11 +5598,11 @@ void check_experience(void)
                                                        prt("", n + 2, 14);
                                        if (get_check(_("よろしいですか?", "Are you sure? "))) break;
                                }
-                               do_inc_stat(choice - 'a');
+                               do_inc_stat(p_ptr, choice - 'a');
                                screen_load();
                        }
                        else if (!(p_ptr->max_plv % 2))
-                               do_inc_stat(randint0(6));
+                               do_inc_stat(p_ptr, randint0(6));
                }
 
                if (level_mutation)