3 * @brief ハイスコア処理 / Highscores handling
6 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
7 * This software may be copied and distributed for educational, research,
8 * and not for profit purposes provided that this copyright and statement
9 * are included in all such copies. Other copyrights may also apply.
10 * 2014 Deskull rearranged comment for Doxygen.
13 #include "core/scores.h"
14 #include "cmd-io/cmd-dump.h"
15 #include "core/asking-player.h"
16 #include "core/turn-compensator.h"
17 #include "dungeon/dungeon.h"
18 #include "game-option/birth-options.h"
19 #include "game-option/game-play-options.h"
20 #include "io/input-key-acceptor.h"
21 #include "io/report.h"
22 #include "io/signal-handlers.h"
23 #include "io/uid-checker.h"
24 #include "io/write-diary.h"
25 #include "player/player-class.h"
26 #include "player/player-personality.h"
27 #include "player/player-sex.h"
28 #include "player/player-status.h"
29 #include "player/race-info-table.h"
30 #include "system/angband-version.h"
31 #include "system/floor-type-definition.h"
32 #include "system/player-type-definition.h"
33 #include "term/screen-processor.h"
34 #include "term/term-color-types.h"
35 #include "util/angband-files.h"
36 #include "util/int-char-converter.h"
37 #include "util/string-processor.h"
38 #include "view/display-messages.h"
39 #include "world/world.h"
42 #include "locale/japanese.h"
46 * The "highscore" file descriptor, if available.
48 int highscore_fd = -1;
51 * @brief i番目のスコア情報にバッファ位置をシークする / Seek score 'i' in the highscore file
55 static int highscore_seek(int i)
57 /* Seek for the requested record */
58 return (fd_seek(highscore_fd, (huge)(i) * sizeof(high_score)));
62 * @brief 所定ポインタからスコア情報を読み取る / Read one score from the highscore file
63 * @param score スコア情報参照ポインタ
66 static errr highscore_read(high_score *score)
68 /* Read the record, note failure */
69 return (fd_read(highscore_fd, (char *)(score), sizeof(high_score)));
73 * @brief 所定ポインタへスコア情報を書き込む / Write one score to the highscore file
74 * @param score スコア情報参照ポインタ
75 * @return エラーコード(問題がなければ0を返す)
77 static int highscore_write(high_score *score)
79 /* Write the record, note failure */
80 return (fd_write(highscore_fd, (char *)(score), sizeof(high_score)));
84 * @brief スコア情報を全て得るまで繰り返し取得する / Just determine where a new score *would* be placed
85 * @param score スコア情報参照ポインタ
86 * @return 正常ならば(MAX_HISCORES - 1)、問題があれば-1を返す
88 static int highscore_where(high_score *score)
90 /* Paranoia -- it may not have opened */
94 /* Go to the start of the highscore file */
95 if (highscore_seek(0))
98 /* Read until we get to a higher score */
100 int my_score = atoi(score->pts);
101 for (int i = 0; i < MAX_HISCORES; i++) {
103 if (highscore_read(&the_score))
105 old_score = atoi(the_score.pts);
106 if (my_score > old_score)
110 /* The "last" entry is always usable */
111 return MAX_HISCORES - 1;
115 * @brief スコア情報をバッファの末尾に追加する / Actually place an entry into the high score file
116 * @param score スコア情報参照ポインタ
117 * @return 正常ならば書き込んだスロット位置、問題があれば-1を返す / Return the location (0 is best) or -1 on "failure"
119 static int highscore_add(high_score *score)
121 /* Paranoia -- it may not have opened */
122 if (highscore_fd < 0)
125 /* Determine where the score should go */
126 int slot = highscore_where(score);
128 /* Hack -- Not on the list */
132 /* Hack -- prepare to dump the new score */
133 high_score the_score = (*score);
135 /* Slide all the scores down one */
138 for (int i = slot; !done && (i < MAX_HISCORES); i++) {
139 /* Read the old guy, note errors */
140 if (highscore_seek(i))
142 if (highscore_read(&tmpscore))
145 /* Back up and dump the score we were holding */
146 if (highscore_seek(i))
148 if (highscore_write(&the_score))
151 /* Hack -- Save the old score, for the next pass */
152 the_score = tmpscore;
155 /* Return location used */
160 * @brief 指定された順位範囲でスコアを並べて表示する / Display the scores in a given range.
163 * @param note 黄色表示でハイライトする順位
164 * @param score スコア配列参照ポインタ
167 * Assumes the high score list is already open.
168 * Only five entries per line, too much info.
170 * Mega-Hack -- allow "fake" entry at the given position.
173 void display_scores_aux(int from, int to, int note, high_score *score)
175 int i, j, k, n, place;
178 high_score the_score;
180 GAME_TEXT out_val[256];
181 GAME_TEXT tmp_val[160];
183 TERM_LEN wid, hgt, per_screen;
185 term_get_size(&wid, &hgt);
186 per_screen = (hgt - 4) / 4;
188 /* Paranoia -- it may not have opened */
189 if (highscore_fd < 0)
192 /* Assume we will show the first 10 */
197 if (to > MAX_HISCORES)
200 /* Seek to the beginning */
201 if (highscore_seek(0))
204 /* Hack -- Count the high scores */
205 for (i = 0; i < MAX_HISCORES; i++) {
206 if (highscore_read(&the_score))
210 /* Hack -- allow "fake" entry to be last */
211 if ((note == i) && score)
214 /* Forget about the last entries */
218 /* Show per_screen per page, until "done" */
219 for (k = from, place = k + 1; k < i; k += per_screen) {
223 put_str(_(" 変愚蛮怒: 勇者の殿堂", " Hengband Hall of Fame"), 0, 0);
225 /* Indicate non-top scores */
227 sprintf(tmp_val, _("( %d 位以下 )", "(from position %d)"), k + 1);
228 put_str(tmp_val, 0, 40);
231 /* Dump per_screen entries */
232 for (j = k, n = 0; j < i && n < per_screen; place++, j++, n++) {
233 int pr, pc, pa, clev, mlev, cdun, mdun;
235 concptr user, gold, when, aged;
237 /* Hack -- indicate death in yellow */
238 attr = (j == note) ? TERM_YELLOW : TERM_WHITE;
240 /* Mega-Hack -- insert a "fake" record */
241 if ((note == j) && score) {
242 the_score = (*score);
249 /* Read a normal record */
251 /* Read the proper record */
252 if (highscore_seek(j))
254 if (highscore_read(&the_score))
258 /* Extract the race/class */
259 pr = atoi(the_score.p_r);
260 pc = atoi(the_score.p_c);
261 pa = atoi(the_score.p_a);
263 /* Extract the level info */
264 clev = atoi(the_score.cur_lev);
265 mlev = atoi(the_score.max_lev);
266 cdun = atoi(the_score.cur_dun);
267 mdun = atoi(the_score.max_dun);
269 /* Hack -- extract the gold and such */
270 for (user = the_score.uid; iswspace(*user); user++) /* loop */
272 for (when = the_score.day; iswspace(*when); when++) /* loop */
274 for (gold = the_score.gold; iswspace(*gold); gold++) /* loop */
276 for (aged = the_score.turns; iswspace(*aged); aged++) /* loop */
279 /* Clean up standard encoded form of "when" */
280 if ((*when == '@') && strlen(when) == 9) {
281 sprintf(tmp_val, "%.4s-%.2s-%.2s", when + 1, when + 5, when + 7);
287 /*sprintf(out_val, "%3d.%9s %s%s%sという名の%sの%s (レベル %d)", */
288 sprintf(out_val, "%3d.%9s %s%s%s - %s%s (レベル %d)", place, the_score.pts, personality_info[pa].title, (personality_info[pa].no ? "の" : ""),
289 the_score.who, race_info[pr].title, class_info[pc].title, clev);
292 sprintf(out_val, "%3d.%9s %s %s the %s %s, Level %d", place, the_score.pts, personality_info[pa].title, the_score.who, race_info[pr].title,
293 class_info[pc].title, clev);
296 /* Append a "maximum level" */
298 strcat(out_val, format(_(" (最高%d)", " (Max %d)"), mlev));
300 /* Dump the first line */
301 c_put_str(attr, out_val, n * 4 + 2, 0);
303 /* Another line of info */
306 sprintf(out_val, " 最高%3d階", mdun);
308 sprintf(out_val, " ");
310 /* 死亡原因をオリジナルより細かく表示 */
311 if (streq(the_score.how, "yet")) {
312 sprintf(out_val + 13, " まだ生きている (%d%s)", cdun, "階");
313 } else if (streq(the_score.how, "ripe")) {
314 sprintf(out_val + 13, " 勝利の後に引退 (%d%s)", cdun, "階");
315 } else if (streq(the_score.how, "Seppuku")) {
316 sprintf(out_val + 13, " 勝利の後に切腹 (%d%s)", cdun, "階");
318 codeconv(the_score.how);
320 /* Some people die outside of the dungeon */
322 sprintf(out_val + 13, " 地上で%sに殺された", the_score.how);
324 sprintf(out_val + 13, " %d階で%sに殺された", cdun, the_score.how);
328 /* Some people die outside of the dungeon */
330 sprintf(out_val, " Killed by %s on the surface", the_score.how);
332 sprintf(out_val, " Killed by %s on %s %d", the_score.how, "Dungeon Level", cdun);
334 /* Append a "maximum level" */
336 strcat(out_val, format(" (Max %d)", mdun));
340 c_put_str(attr, out_val, n * 4 + 3, 0);
342 /* And still another line of info */
347 /* 日付を 19yy/mm/dd の形式に変更する */
348 if (strlen(when) == 8 && when[2] == '/' && when[5] == '/') {
349 sprintf(buf, "%d%s/%.5s", 19 + (when[6] < '8'), when + 6, when);
352 sprintf(out_val, " (ユーザー:%s, 日付:%s, 所持金:%s, ターン:%s)", user, when, gold, aged);
356 sprintf(out_val, " (User %s, Date %s, Gold %s, Turn %s).", user, when, gold, aged);
359 c_put_str(attr, out_val, n * 4 + 4, 0);
362 /* Wait for response */
363 prt(_("[ ESCで中断, その他のキーで続けます ]", "[Press ESC to quit, any other key to continue.]"), hgt - 1, _(21, 17));
368 /* Hack -- notice Escape */
375 * @brief スコア表示処理メインルーチン / Hack -- Display the scores in a given range and quit.
380 * This function is only called from "main.c" when the user asks
381 * to see the "high scores".
384 void display_scores(int from, int to)
387 path_build(buf, sizeof(buf), ANGBAND_DIR_APEX, "scores.raw");
389 /* Open the binary high score file, for reading */
390 highscore_fd = fd_open(buf, O_RDONLY);
392 /* Paranoia -- No score file */
393 if (highscore_fd < 0)
394 quit(_("スコア・ファイルが使用できません。", "Score file unavailable."));
397 /* Display the scores */
398 display_scores_aux(from, to, -1, NULL);
400 /* Shut the high score file */
401 (void)fd_close(highscore_fd);
403 /* Forget the high score fd */
411 * @brief スコアサーバへの転送処理
412 * @param current_player_ptr プレーヤーへの参照ポインタ
413 * @param do_send 実際に転送ア処置を行うか否か
414 * @return 転送が成功したらTRUEを返す
415 * @todo プリプロが邪魔していて最初のif文を削除すると到達不能コードが発生する
417 bool send_world_score(player_type *current_player_ptr, bool do_send, display_player_pf display_player)
420 if (send_score && do_send) {
422 msg_print(_("初心者モードではワールドスコアに登録できません。", "Since you are in the Easy Mode, you cannot send score to world score server."));
426 bool is_registration = get_check_strict(current_player_ptr,
427 _("スコアをスコア・サーバに登録しますか? ", "Do you send score to the world score server? "), (CHECK_NO_ESCAPE | CHECK_NO_HISTORY));
428 if (!is_registration)
433 prt(_("送信中..", "Sending..."), 0, 0);
436 err = report_score(current_player_ptr, display_player);
441 prt(_("完了。何かキーを押してください。", "Completed. Hit any key."), 0, 0);
445 (void)current_player_ptr;
447 (void)display_player;
453 * @brief スコアの過去二十位内ランキングを表示する
454 * Enters a players name on a hi-score table, if "legal", and in any
455 * case, displays some relevant portion of the high score list.
456 * @param current_player_ptr スコアに適用するための現在プレイヤークリーチャー参照ポインタ
459 * Assumes "signals_ignore_tstp()" has been called.
461 errr top_twenty(player_type *current_player_ptr)
463 high_score the_score;
465 (void)WIPE(&the_score, high_score);
467 /* Save the version */
468 sprintf(the_score.what, "%u.%u.%u", FAKE_VER_MAJOR, FAKE_VER_MINOR, FAKE_VER_PATCH);
470 /* Calculate and save the points */
471 sprintf(the_score.pts, "%9ld", (long)calc_score(current_player_ptr));
472 the_score.pts[9] = '\0';
474 /* Save the current gold */
475 sprintf(the_score.gold, "%9lu", (long)current_player_ptr->au);
476 the_score.gold[9] = '\0';
478 /* Save the current turn */
479 sprintf(the_score.turns, "%9lu", (long)turn_real(current_player_ptr, current_world_ptr->game_turn));
480 the_score.turns[9] = '\0';
482 time_t ct = time((time_t *)0);
484 /* Save the date in standard encoded form (9 chars) */
485 strftime(the_score.day, 10, "@%Y%m%d", localtime(&ct));
487 /* Save the player name (15 chars) */
488 sprintf(the_score.who, "%-.15s", current_player_ptr->name);
490 /* Save the player info */
491 sprintf(the_score.uid, "%7u", current_player_ptr->player_uid);
492 sprintf(the_score.sex, "%c", (current_player_ptr->psex ? 'm' : 'f'));
493 snprintf(buf, sizeof(buf), "%2d", MIN(current_player_ptr->prace, MAX_RACES));
494 memcpy(the_score.p_r, buf, 3);
495 snprintf(buf, sizeof(buf), "%2d", MIN(current_player_ptr->pclass, MAX_CLASS));
496 memcpy(the_score.p_c, buf, 3);
497 snprintf(buf, sizeof(buf), "%2d", MIN(current_player_ptr->pseikaku, MAX_PERSONALITIES));
498 memcpy(the_score.p_a, buf, 3);
500 /* Save the level and such */
501 sprintf(the_score.cur_lev, "%3d", MIN((u16b)current_player_ptr->lev, 999));
502 sprintf(the_score.cur_dun, "%3d", (int)current_player_ptr->current_floor_ptr->dun_level);
503 sprintf(the_score.max_lev, "%3d", MIN((u16b)current_player_ptr->max_plv, 999));
504 sprintf(the_score.max_dun, "%3d", (int)max_dlv[current_player_ptr->dungeon_idx]);
506 /* Save the cause of death (31 chars) */
507 if (strlen(current_player_ptr->died_from) >= sizeof(the_score.how)) {
509 angband_strcpy(the_score.how, current_player_ptr->died_from, sizeof(the_score.how) - 2);
510 strcat(the_score.how, "…");
512 angband_strcpy(the_score.how, current_player_ptr->died_from, sizeof(the_score.how) - 3);
513 strcat(the_score.how, "...");
516 strcpy(the_score.how, current_player_ptr->died_from);
519 /* Grab permissions */
520 safe_setuid_grab(current_player_ptr);
522 /* Lock (for writing) the highscore file, or fail */
523 errr err = fd_lock(highscore_fd, F_WRLCK);
525 /* Drop permissions */
531 /* Add a new entry to the score list, see where it went */
532 int j = highscore_add(&the_score);
534 /* Grab permissions */
535 safe_setuid_grab(current_player_ptr);
537 /* Unlock the highscore file, or fail */
538 err = fd_lock(highscore_fd, F_UNLCK);
540 /* Drop permissions */
546 /* Hack -- Display the top fifteen scores */
548 display_scores_aux(0, 15, j, NULL);
552 /* Display the scores surrounding the player */
553 display_scores_aux(0, 5, j, NULL);
554 display_scores_aux(j - 2, j + 7, j, NULL);
559 * @brief プレイヤーの現在のスコアをランキングに挟む /
560 * Predict the players location, and display it.
563 errr predict_score(player_type *current_player_ptr)
565 high_score the_score;
569 if (highscore_fd < 0) {
570 msg_print(_("スコア・ファイルが使用できません。", "Score file unavailable."));
575 /* Save the version */
576 sprintf(the_score.what, "%u.%u.%u", FAKE_VER_MAJOR, FAKE_VER_MINOR, FAKE_VER_PATCH);
578 /* Calculate and save the points */
579 sprintf(the_score.pts, "%9ld", (long)calc_score(current_player_ptr));
581 /* Save the current gold */
582 sprintf(the_score.gold, "%9lu", (long)current_player_ptr->au);
584 /* Save the current turn */
585 sprintf(the_score.turns, "%9lu", (long)turn_real(current_player_ptr, current_world_ptr->game_turn));
587 /* Hack -- no time needed */
588 strcpy(the_score.day, _("今日", "TODAY"));
590 /* Save the player name (15 chars) */
591 sprintf(the_score.who, "%-.15s", current_player_ptr->name);
593 /* Save the player info */
594 sprintf(the_score.uid, "%7u", current_player_ptr->player_uid);
595 sprintf(the_score.sex, "%c", (current_player_ptr->psex ? 'm' : 'f'));
596 snprintf(buf, sizeof(buf), "%2d", MIN(current_player_ptr->prace, MAX_RACES));
597 memcpy(the_score.p_r, buf, 3);
598 snprintf(buf, sizeof(buf), "%2d", MIN(current_player_ptr->pclass, MAX_CLASS));
599 memcpy(the_score.p_c, buf, 3);
600 snprintf(buf, sizeof(buf), "%2d", MIN(current_player_ptr->pseikaku, MAX_PERSONALITIES));
601 memcpy(the_score.p_a, buf, 3);
603 /* Save the level and such */
604 sprintf(the_score.cur_lev, "%3d", MIN((u16b)current_player_ptr->lev, 999));
605 sprintf(the_score.cur_dun, "%3d", (int)current_player_ptr->current_floor_ptr->dun_level);
606 sprintf(the_score.max_lev, "%3d", MIN((u16b)current_player_ptr->max_plv, 999));
607 sprintf(the_score.max_dun, "%3d", (int)max_dlv[current_player_ptr->dungeon_idx]);
609 /* Hack -- no cause of death */
610 /* まだ死んでいないときの識別文字 */
611 strcpy(the_score.how, _("yet", "nobody (yet!)"));
613 /* See where the entry would be placed */
614 int j = highscore_where(&the_score);
616 /* Hack -- Display the top fifteen scores */
618 display_scores_aux(0, 15, j, &the_score);
622 display_scores_aux(0, 5, -1, NULL);
623 display_scores_aux(j - 2, j + 7, j, &the_score);
628 * @brief スコアランキングの簡易表示 /
629 * show_highclass - selectively list highscores based on class -KMW-
631 void show_highclass(player_type *current_player_ptr)
634 char buf[1024], out_val[256];
635 path_build(buf, sizeof(buf), ANGBAND_DIR_APEX, "scores.raw");
637 highscore_fd = fd_open(buf, O_RDONLY);
639 if (highscore_fd < 0) {
640 msg_print(_("スコア・ファイルが使用できません。", "Score file unavailable."));
645 if (highscore_seek(0))
648 high_score the_score;
649 for (int i = 0; i < MAX_HISCORES; i++)
650 if (highscore_read(&the_score))
655 PLAYER_LEVEL clev = 0;
657 while ((m < 9) && (j < MAX_HISCORES)) {
658 if (highscore_seek(j))
660 if (highscore_read(&the_score))
662 pr = atoi(the_score.p_r);
663 clev = (PLAYER_LEVEL)atoi(the_score.cur_lev);
666 sprintf(out_val, " %3d) %sの%s (レベル %2d)", (m + 1), race_info[pr].title, the_score.who, clev);
668 sprintf(out_val, "%3d) %s the %s (Level %2d)", (m + 1), the_score.who, race_info[pr].title, clev);
671 prt(out_val, (m + 7), 0);
677 sprintf(out_val, "あなた) %sの%s (レベル %2d)", race_info[current_player_ptr->prace].title, current_player_ptr->name, current_player_ptr->lev);
679 sprintf(out_val, "You) %s the %s (Level %2d)", current_player_ptr->name, race_info[current_player_ptr->prace].title, current_player_ptr->lev);
682 prt(out_val, (m + 8), 0);
684 (void)fd_close(highscore_fd);
686 prt(_("何かキーを押すとゲームに戻ります", "Hit any key to continue"), 0, 0);
690 for (j = 5; j < 18; j++)
696 * @brief スコアランキングの簡易表示(種族毎)サブルーチン /
698 * @param race_num 種族ID
700 void race_score(player_type *current_player_ptr, int race_num)
703 int pr, clev, lastlev;
704 high_score the_score;
705 char buf[1024], out_val[256], tmp_str[80];
709 /* rr9: TODO - pluralize the race */
710 sprintf(tmp_str, _("最高の%s", "The Greatest of all the %s"), race_info[race_num].title);
713 path_build(buf, sizeof(buf), ANGBAND_DIR_APEX, "scores.raw");
715 highscore_fd = fd_open(buf, O_RDONLY);
717 if (highscore_fd < 0) {
718 msg_print(_("スコア・ファイルが使用できません。", "Score file unavailable."));
723 if (highscore_seek(0))
726 for (i = 0; i < MAX_HISCORES; i++) {
727 if (highscore_read(&the_score))
734 while ((m < 10) || (j < MAX_HISCORES)) {
735 if (highscore_seek(j))
737 if (highscore_read(&the_score))
739 pr = atoi(the_score.p_r);
740 clev = atoi(the_score.cur_lev);
742 if (pr == race_num) {
744 sprintf(out_val, " %3d) %sの%s (レベル %2d)", (m + 1), race_info[pr].title, the_score.who, clev);
746 sprintf(out_val, "%3d) %s the %s (Level %3d)", (m + 1), the_score.who, race_info[pr].title, clev);
749 prt(out_val, (m + 7), 0);
756 /* add player if qualified */
757 if ((current_player_ptr->prace == race_num) && (current_player_ptr->lev >= lastlev)) {
759 sprintf(out_val, "あなた) %sの%s (レベル %2d)", race_info[current_player_ptr->prace].title, current_player_ptr->name, current_player_ptr->lev);
761 sprintf(out_val, "You) %s the %s (Level %3d)", current_player_ptr->name, race_info[current_player_ptr->prace].title, current_player_ptr->lev);
764 prt(out_val, (m + 8), 0);
767 (void)fd_close(highscore_fd);
772 * @brief スコアランキングの簡易表示(種族毎)メインルーチン /
775 void race_legends(player_type *current_player_ptr)
777 for (int i = 0; i < MAX_RACES; i++) {
778 race_score(current_player_ptr, i);
779 msg_print(_("何かキーを押すとゲームに戻ります", "Hit any key to continue"));
781 for (int j = 5; j < 19; j++)
787 * @brief 勝利者用の引退演出処理 /
788 * Change the player into a King! -RAK-
790 void kingly(player_type *winner_ptr)
794 bool seppuku = streq(winner_ptr->died_from, "Seppuku");
796 /* Hack -- retire in town */
797 winner_ptr->current_floor_ptr->dun_level = 0;
802 (void)strcpy(winner_ptr->died_from, _("ripe", "Ripe Old Age"));
804 /* Restore the experience */
805 winner_ptr->exp = winner_ptr->max_exp;
807 /* Restore the level */
808 winner_ptr->lev = winner_ptr->max_plv;
810 term_get_size(&wid, &hgt);
814 /* Hack -- Instant Gold */
815 winner_ptr->au += 10000000L;
818 /* Display a crown */
819 put_str("#", cy - 11, cx - 1);
820 put_str("#####", cy - 10, cx - 3);
821 put_str("#", cy - 9, cx - 1);
822 put_str(",,, $$$ ,,,", cy - 8, cx - 7);
823 put_str(",,=$ \"$$$$$\" $=,,", cy - 7, cx - 11);
824 put_str(",$$ $$$ $$,", cy - 6, cx - 13);
825 put_str("*> <*> <*", cy - 5, cx - 13);
826 put_str("$$ $$$ $$", cy - 4, cx - 13);
827 put_str("\"$$ $$$ $$\"", cy - 3, cx - 13);
828 put_str("\"$$ $$$ $$\"", cy - 2, cx - 12);
829 put_str("*#########*#########*", cy - 1, cx - 11);
830 put_str("*#########*#########*", cy, cx - 11);
832 /* Display a message */
834 put_str("Veni, Vidi, Vici!", cy + 3, cx - 9);
835 put_str("来た、見た、勝った!", cy + 4, cx - 10);
836 put_str(format("偉大なる%s万歳!", sp_ptr->winner), cy + 5, cx - 11);
838 put_str("Veni, Vidi, Vici!", cy + 3, cx - 9);
839 put_str("I came, I saw, I conquered!", cy + 4, cx - 14);
840 put_str(format("All Hail the Mighty %s!", sp_ptr->winner), cy + 5, cx - 13);
843 /* If player did Seppuku, that is already written in playrecord */
845 exe_write_diary(winner_ptr, DIARY_DESCRIPTION, 0, _("ダンジョンの探索から引退した。", "retired exploring dungeons."));
846 exe_write_diary(winner_ptr, DIARY_GAMESTART, 1, _("-------- ゲームオーバー --------", "-------- Game Over --------"));
847 exe_write_diary(winner_ptr, DIARY_DESCRIPTION, 1, "\n\n\n\n");
853 /* Wait for response */
859 * Display some character info
861 bool check_score(player_type *current_player_ptr)
866 if (highscore_fd < 0) {
867 msg_print(_("スコア・ファイルが使用できません。", "Score file unavailable."));
872 /* Wizard-mode pre-empts scoring */
873 if (current_world_ptr->noscore & 0x000F) {
874 msg_print(_("ウィザード・モードではスコアが記録されません。", "Score not registered for wizards."));
879 /* Cheaters are not scored */
880 if (current_world_ptr->noscore & 0xFF00) {
881 msg_print(_("詐欺をやった人はスコアが記録されません。", "Score not registered for cheaters."));
887 if (!current_world_ptr->total_winner && streq(current_player_ptr->died_from, _("強制終了", "Interrupting"))) {
888 msg_print(_("強制終了のためスコアが記録されません。", "Score not registered due to interruption."));
894 if (!current_world_ptr->total_winner && streq(current_player_ptr->died_from, _("途中終了", "Quitting"))) {
895 msg_print(_("途中終了のためスコアが記録されません。", "Score not registered due to quitting."));