• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision8b613b5d199584ecf496fd3f8fcc6b367337daed (tree)
Time2019-07-13 20:03:38
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38997 calc_score() に player_type * 引数を追加.

Change Summary

Incremental Difference

--- a/src/player-status.c
+++ b/src/player-status.c
@@ -5727,12 +5727,12 @@ s16b modify_stat_value(int value, int amount)
57275727 * @return なし
57285728 * @details
57295729 */
5730-long calc_score(void)
5730+long calc_score(player_type *creature_ptr)
57315731 {
57325732 int i, mult = 100;
57335733 DEPTH max_dl = 0;
57345734 u32b point, point_h, point_l;
5735- int arena_win = MIN(p_ptr->arena_number, MAX_ARENA_MONS);
5735+ int arena_win = MIN(creature_ptr->arena_number, MAX_ARENA_MONS);
57365736
57375737 if (!preserve_mode) mult += 10;
57385738 if (!autoroller) mult += 10;
@@ -5751,7 +5751,7 @@ long calc_score(void)
57515751 if (max_dlv[i] > max_dl)
57525752 max_dl = max_dlv[i];
57535753
5754- point_l = (p_ptr->max_max_exp + (100 * max_dl));
5754+ point_l = (creature_ptr->max_max_exp + (100 * max_dl));
57555755 point_h = point_l / 0x10000L;
57565756 point_l = point_l % 0x10000L;
57575757 point_h *= mult;
@@ -5764,20 +5764,20 @@ long calc_score(void)
57645764 point_l /= 100;
57655765
57665766 point = (point_h << 16) + (point_l);
5767- if (p_ptr->arena_number >= 0)
5767+ if (creature_ptr->arena_number >= 0)
57685768 point += (arena_win * arena_win * (arena_win > 29 ? 1000 : 100));
57695769
57705770 if (ironman_downward) point *= 2;
5771- if (p_ptr->pclass == CLASS_BERSERKER)
5771+ if (creature_ptr->pclass == CLASS_BERSERKER)
57725772 {
5773- if (p_ptr->prace == RACE_SPECTRE)
5773+ if (creature_ptr->prace == RACE_SPECTRE)
57745774 point = point / 5;
57755775 }
57765776
5777- if ((p_ptr->pseikaku == SEIKAKU_MUNCHKIN) && point)
5777+ if ((creature_ptr->pseikaku == SEIKAKU_MUNCHKIN) && point)
57785778 {
57795779 point = 1;
5780- if (p_ptr->total_winner) point = 2;
5780+ if (creature_ptr->total_winner) point = 2;
57815781 }
57825782 if (easy_band) point = (0 - point);
57835783
--- a/src/player-status.h
+++ b/src/player-status.h
@@ -751,7 +751,7 @@ extern void check_experience(player_type *creature_ptr);
751751 extern void wreck_the_pattern(player_type *creature_ptr);
752752 extern void cnv_stat(int val, char *out_val);
753753 extern s16b modify_stat_value(int value, int amount);
754-extern long calc_score(void);
754+extern long calc_score(player_type *creature_ptr);
755755
756756 extern const s32b player_exp[PY_MAX_LEVEL];
757757 extern const s32b player_exp_a[PY_MAX_LEVEL];
--- a/src/report.c
+++ b/src/report.c
@@ -482,7 +482,7 @@ errr report_score(void)
482482 buf_sprintf(score, "version: Hengband %d.%d.%d\n",
483483 FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
484484 #endif
485- buf_sprintf(score, "score: %d\n", calc_score());
485+ buf_sprintf(score, "score: %d\n", calc_score(p_ptr));
486486 buf_sprintf(score, "level: %d\n", p_ptr->lev);
487487 buf_sprintf(score, "depth: %d\n", current_floor_ptr->dun_level);
488488 buf_sprintf(score, "maxlv: %d\n", p_ptr->max_plv);
--- a/src/scores.c
+++ b/src/scores.c
@@ -494,7 +494,7 @@ errr top_twenty(void)
494494 FAKE_VER_MAJOR, FAKE_VER_MINOR, FAKE_VER_PATCH);
495495
496496 /* Calculate and save the points */
497- sprintf(the_score.pts, "%9ld", (long)calc_score());
497+ sprintf(the_score.pts, "%9ld", (long)calc_score(p_ptr));
498498 the_score.pts[9] = '\0';
499499
500500 /* Save the current gold */
@@ -617,7 +617,7 @@ errr predict_score(void)
617617 FAKE_VER_MAJOR, FAKE_VER_MINOR, FAKE_VER_PATCH);
618618
619619 /* Calculate and save the points */
620- sprintf(the_score.pts, "%9ld", (long)calc_score());
620+ sprintf(the_score.pts, "%9ld", (long)calc_score(p_ptr));
621621
622622 /* Save the current gold */
623623 sprintf(the_score.gold, "%9lu", (long)p_ptr->au);
Show on old repository browser