| | 418 | |
| | 419 | |
| | 420 | /* Dump character history to a file, which we assume is already open. */ |
| | 421 | void dump_history(ang_file *file) |
| | 422 | { |
| | 423 | int i; |
| | 424 | char buf[90]; |
| | 425 | |
| | 426 | file_putf(file, "============================================================\n"); |
| | 427 | file_putf(file, " CHAR.\n"); |
| | 428 | file_putf(file, "| TURN | DEPTH |LEVEL| EVENT\n"); |
| | 429 | file_putf(file, "============================================================\n"); |
| | 430 | |
| | 431 | for (i = 0; i < (last_printable_item() + 1); i++) |
| | 432 | { |
| | 433 | /* Skip not-yet-IDd artifacts */ |
| | 434 | if (history_masked(i)) continue; |
| | 435 | |
| | 436 | strnfmt(buf, sizeof(buf), "%10d%7d\'%5d %s", |
| | 437 | history_list[i].turn, |
| | 438 | history_list[i].dlev * 50, |
| | 439 | history_list[i].clev, |
| | 440 | history_list[i].event); |
| | 441 | |
| | 442 | if (history_list[i].type & HISTORY_ARTIFACT_LOST) |
| | 443 | my_strcat(buf, " (LOST)", sizeof(buf)); |
| | 444 | |
| | 445 | file_putf(file, buf); |
| | 446 | file_putf(file, "\n"); |
| | 447 | } |
| | 448 | |
| | 449 | return; |
| | 450 | } |