• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revision661411e2da6094b0f45f89131cc6fddf659dd641 (tree)
Time2019-08-26 23:02:05
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38997 status_shuffle() に player_type * 引数を追加. / Add player_type * argument to status_shuffle().

Change Summary

Incremental Difference

--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -3810,7 +3810,7 @@ void do_poly_self(player_type *creature_ptr)
38103810 /* Note: earlier deductions may have left power < 0 already. */
38113811 while (power > 0)
38123812 {
3813- status_shuffle();
3813+ status_shuffle(creature_ptr);
38143814 power--;
38153815 }
38163816 }
--- a/src/spells-status.c
+++ b/src/spells-status.c
@@ -518,7 +518,7 @@ void apply_nexus(monster_type *m_ptr)
518518 }
519519
520520 msg_print(_("体がねじれ始めた...", "Your body starts to scramble..."));
521- status_shuffle();
521+ status_shuffle(p_ptr);
522522 break;
523523 }
524524 }
@@ -528,7 +528,7 @@ void apply_nexus(monster_type *m_ptr)
528528 * @brief プレイヤーのステータスシャッフル処理
529529 * @return なし
530530 */
531-void status_shuffle(void)
531+void status_shuffle(player_type *creature_ptr)
532532 {
533533 BASE_STATUS max1, cur1, max2, cur2;
534534 int ii, jj, i;
@@ -537,21 +537,21 @@ void status_shuffle(void)
537537 ii = randint0(A_MAX);
538538 for (jj = ii; jj == ii; jj = randint0(A_MAX)) /* loop */;
539539
540- max1 = p_ptr->stat_max[ii];
541- cur1 = p_ptr->stat_cur[ii];
542- max2 = p_ptr->stat_max[jj];
543- cur2 = p_ptr->stat_cur[jj];
540+ max1 = creature_ptr->stat_max[ii];
541+ cur1 = creature_ptr->stat_cur[ii];
542+ max2 = creature_ptr->stat_max[jj];
543+ cur2 = creature_ptr->stat_cur[jj];
544544
545- p_ptr->stat_max[ii] = max2;
546- p_ptr->stat_cur[ii] = cur2;
547- p_ptr->stat_max[jj] = max1;
548- p_ptr->stat_cur[jj] = cur1;
545+ creature_ptr->stat_max[ii] = max2;
546+ creature_ptr->stat_cur[ii] = cur2;
547+ creature_ptr->stat_max[jj] = max1;
548+ creature_ptr->stat_cur[jj] = cur1;
549549
550550 for (i = 0; i < A_MAX; i++)
551551 {
552- if (p_ptr->stat_max[i] > p_ptr->stat_max_max[i]) p_ptr->stat_max[i] = p_ptr->stat_max_max[i];
553- if (p_ptr->stat_cur[i] > p_ptr->stat_max_max[i]) p_ptr->stat_cur[i] = p_ptr->stat_max_max[i];
552+ if (creature_ptr->stat_max[i] > creature_ptr->stat_max_max[i]) creature_ptr->stat_max[i] = creature_ptr->stat_max_max[i];
553+ if (creature_ptr->stat_cur[i] > creature_ptr->stat_max_max[i]) creature_ptr->stat_cur[i] = creature_ptr->stat_max_max[i];
554554 }
555555
556- p_ptr->update |= (PU_BONUS);
556+ creature_ptr->update |= (PU_BONUS);
557557 }
--- a/src/spells-status.h
+++ b/src/spells-status.h
@@ -26,4 +26,4 @@ extern bool restore_all_status(void);
2626 extern bool fishing(player_type *creature_ptr);
2727 extern bool cosmic_cast_off(player_type *creature_ptr, object_type *o_ptr);
2828 extern void apply_nexus(monster_type *m_ptr);
29-extern void status_shuffle(void);
29+extern void status_shuffle(player_type *creature_ptr);
--- a/src/spells1.c
+++ b/src/spells1.c
@@ -4191,7 +4191,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
41914191 if (one_in_(4)) /* 4 */
41924192 do_poly_self(p_ptr);
41934193 else
4194- status_shuffle();
4194+ status_shuffle(p_ptr);
41954195 }
41964196
41974197 if (one_in_(6))
Show on old repository browser