* @brief スコアの過去二十位内ランキングを表示する
* Enters a players name on a hi-score table, if "legal", and in any
* case, displays some relevant portion of the high score list.
+ * @param current_player_ptr スコアに適用するための現在プレイヤークリーチャー参照ポインタ
* @return エラーコード
* @details
* Assumes "signals_ignore_tstp()" has been called.
*/
-errr top_twenty(void)
+errr top_twenty(player_type *current_player_ptr)
{
int j;
FAKE_VER_MAJOR, FAKE_VER_MINOR, FAKE_VER_PATCH);
/* Calculate and save the points */
- sprintf(the_score.pts, "%9ld", (long)calc_score(p_ptr));
+ sprintf(the_score.pts, "%9ld", (long)calc_score(current_player_ptr));
the_score.pts[9] = '\0';
/* Save the current gold */
- sprintf(the_score.gold, "%9lu", (long)p_ptr->au);
+ sprintf(the_score.gold, "%9lu", (long)current_player_ptr->au);
the_score.gold[9] = '\0';
/* Save the current turn */
#endif
/* Save the player name (15 chars) */
- sprintf(the_score.who, "%-.15s", p_ptr->name);
+ sprintf(the_score.who, "%-.15s", current_player_ptr->name);
/* Save the player info */
- sprintf(the_score.uid, "%7u", p_ptr->player_uid);
- sprintf(the_score.sex, "%c", (p_ptr->psex ? 'm' : 'f'));
- sprintf(the_score.p_r, "%2d", MIN(p_ptr->prace, MAX_RACES));
- sprintf(the_score.p_c, "%2d", MIN(p_ptr->pclass, MAX_CLASS));
- sprintf(the_score.p_a, "%2d", MIN(p_ptr->pseikaku, MAX_SEIKAKU));
+ sprintf(the_score.uid, "%7u", current_player_ptr->player_uid);
+ sprintf(the_score.sex, "%c", (current_player_ptr->psex ? 'm' : 'f'));
+ sprintf(the_score.p_r, "%2d", MIN(current_player_ptr->prace, MAX_RACES));
+ sprintf(the_score.p_c, "%2d", MIN(current_player_ptr->pclass, MAX_CLASS));
+ sprintf(the_score.p_a, "%2d", MIN(current_player_ptr->pseikaku, MAX_SEIKAKU));
/* Save the level and such */
- sprintf(the_score.cur_lev, "%3d", MIN((u16b)p_ptr->lev, 999));
- sprintf(the_score.cur_dun, "%3d", (int)p_ptr->current_floor_ptr->dun_level);
- sprintf(the_score.max_lev, "%3d", MIN((u16b)p_ptr->max_plv, 999));
- sprintf(the_score.max_dun, "%3d", (int)max_dlv[p_ptr->dungeon_idx]);
+ sprintf(the_score.cur_lev, "%3d", MIN((u16b)current_player_ptr->lev, 999));
+ sprintf(the_score.cur_dun, "%3d", (int)current_player_ptr->current_floor_ptr->dun_level);
+ sprintf(the_score.max_lev, "%3d", MIN((u16b)current_player_ptr->max_plv, 999));
+ sprintf(the_score.max_dun, "%3d", (int)max_dlv[current_player_ptr->dungeon_idx]);
/* Save the cause of death (31 chars) */
- if (strlen(p_ptr->died_from) >= sizeof(the_score.how))
+ if (strlen(current_player_ptr->died_from) >= sizeof(the_score.how))
{
#ifdef JP
- my_strcpy(the_score.how, p_ptr->died_from, sizeof(the_score.how) - 2);
+ my_strcpy(the_score.how, current_player_ptr->died_from, sizeof(the_score.how) - 2);
strcat(the_score.how, "…");
#else
- my_strcpy(the_score.how, p_ptr->died_from, sizeof(the_score.how) - 3);
+ my_strcpy(the_score.how, current_player_ptr->died_from, sizeof(the_score.how) - 3);
strcat(the_score.how, "...");
#endif
}
else
{
- strcpy(the_score.how, p_ptr->died_from);
+ strcpy(the_score.how, current_player_ptr->died_from);
}
/* Grab permissions */