}
-errr make_character_dump(FILE *fff)
+/*
+ *
+ */
+static void dump_aux_display_player(FILE *fff)
{
- int i, x, y;
- byte a;
- char c;
- cptr paren = ")";
- store_type *st_ptr;
- char o_name[MAX_NLEN];
+ int x, y, i;
+ byte a;
+ char c;
char buf[1024];
- int *quest_num;
- int dummy;
-
-#ifdef JP
- fprintf(fff, " [ÊѶòÈÚÅÜ %d.%d.%d ¥¥ã¥é¥¯¥¿¾ðÊó]\n\n",
- FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
-#else
- fprintf(fff, " [Hengband %d.%d.%d Character Dump]\n\n",
- FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
-#endif
-
- update_playtime();
/* Display player */
display_player(0);
fprintf(fff, "\n");
for (i = 0; (unsigned int) i < (p_ptr->count % 80); i++)
fprintf(fff, " ");
+}
+
+
+/*
+ *
+ */
+static void dump_aux_pet(FILE *fff)
+{
+ int i;
+ bool pet = FALSE;
+ char pet_name[80];
+ for (i = m_max - 1; i >= 1; i--)
{
- bool pet = FALSE;
- char pet_name[80];
+ monster_type *m_ptr = &m_list[i];
- for (i = m_max - 1; i >= 1; i--)
+ if (!m_ptr->r_idx) continue;
+ if (!is_pet(m_ptr)) continue;
+ if (!m_ptr->nickname && (p_ptr->riding != i)) continue;
+ if (!pet)
{
- monster_type *m_ptr = &m_list[i];
-
- if (!m_ptr->r_idx) continue;
- if (!is_pet(m_ptr)) continue;
- if (!m_ptr->nickname && (p_ptr->riding != i)) continue;
- if (!pet)
- {
#ifdef JP
- fprintf(fff, "\n [¼ç¤Ê¥Ú¥Ã¥È]\n\n");
+ fprintf(fff, "\n [¼ç¤Ê¥Ú¥Ã¥È]\n\n");
#else
- fprintf(fff, "\n [leading pets]\n\n");
+ fprintf(fff, "\n [leading pets]\n\n");
#endif
- pet = TRUE;
- }
- monster_desc(pet_name, m_ptr, MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
- fprintf(fff, "%s\n", pet_name);
+ pet = TRUE;
}
-
- if (pet) fprintf(fff, "\n");
+ monster_desc(pet_name, m_ptr, MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
+ fprintf(fff, "%s\n", pet_name);
}
+ if (pet) fprintf(fff, "\n");
+}
- if (p_ptr->pclass == CLASS_BLUE_MAGE) {
- int i = 0;
- int j = 0;
- int l1 = 0;
- int l2 = 0;
- int num = 0;
- int spellnum[MAX_MONSPELLS];
- s32b f4 = 0, f5 = 0, f6 = 0;
- char p[60][80];
- int col = 0;
- bool pcol = FALSE;
+/*
+ *
+ */
+static void dump_aux_class_special(FILE *fff)
+{
+ if (p_ptr->pclass == CLASS_BLUE_MAGE)
+ {
+ int i = 0;
+ int j = 0;
+ int l1 = 0;
+ int l2 = 0;
+ int num = 0;
+ int spellnum[MAX_MONSPELLS];
+ s32b f4 = 0, f5 = 0, f6 = 0;
+ char p[60][80];
+ int col = 0;
+ bool pcol = FALSE;
for (i=0;i<60;i++) { p[i][0] = '\0'; }
fprintf(fff, p[i]);
}
}
+}
- fprintf(fff, "\n");
+
+/*
+ *
+ */
+static void dump_aux_quest(FILE *fff)
+{
+ int i;
+ int *quest_num;
+ int dummy;
#ifdef JP
- fprintf(fff, "\n [¥¯¥¨¥¹¥È¾ðÊó]\n");
+ fprintf(fff, "\n\n [¥¯¥¨¥¹¥È¾ðÊó]\n");
#else
- fprintf(fff, "\n [Quest information]\n");
+ fprintf(fff, "\n\n [Quest information]\n");
#endif
/* Allocate Memory */
/* Free Memory */
C_KILL(quest_num, max_quests, int);
+}
+
+/*
+ *
+ */
+static void dump_aux_last_message(FILE *fff)
+{
if (p_ptr->is_dead)
{
if (!p_ptr->total_winner)
{
+ int i;
+
#ifdef JP
fprintf(fff, "\n [»à¤ÌľÁ°¤Î¥á¥Ã¥»¡¼¥¸]\n\n");
#else
fprintf(fff," %s\n", p_ptr->last_message);
}
}
+}
-#ifdef JP
- fprintf(fff, "\n [¤½¤Î¾¤Î¾ðÊó]\n");
-#else
- fprintf(fff, "\n [Miscellaneous information]\n");
-#endif
+
+/*
+ *
+ */
+static void dump_aux_recall(FILE *fff)
+{
+ int y;
#ifdef JP
- fprintf(fff, "\n µ¢´Ô¾ì½ê:\n");
+ fprintf(fff, "\n\n [µ¢´Ô¾ì½ê]\n\n");
#else
- fprintf(fff, "\n Recall Depth:\n");
+ fprintf(fff, "\n\n [Recall Depth]\n\n");
#endif
+
for (y = 1; y < max_d_idx; y++)
{
bool seiha = FALSE;
fprintf(fff, " %c%-16s: level %3d\n", seiha ? '!' : ' ', d_name+d_info[y].name, max_dlv[y]);
#endif
}
+}
+
+
+/*
+ *
+ */
+static void dump_aux_options(FILE *fff)
+{
+#ifdef JP
+ fprintf(fff, "\n [¥ª¥×¥·¥ç¥óÀßÄê]\n");
+#else
+ fprintf(fff, "\n [Option settings]\n");
+#endif
+
if (preserve_mode)
#ifdef JP
fprintf(fff, "\n Num. Random Quests: %d", number_of_quests());
#endif
- fprintf(fff, "\n");
+ fprintf(fff,"\n");
- if (!lite_town && !vanilla_town)
- {
- if (p_ptr->arena_number < 0)
- {
- if (p_ptr->arena_number <= ARENA_DEFEATED_OLD_VER)
- {
+ if (p_ptr->noscore)
#ifdef JP
- fprintf(fff, "\n Æ®µ»¾ì: ÇÔËÌ\n");
+ fprintf(fff, "\n ²¿¤«ÉÔÀµ¤Ê¤³¤È¤ò¤·¤Æ¤·¤Þ¤Ã¤Æ¤¤¤Þ¤¹¡£");
#else
- fprintf(fff, "\n Arena: Defeated\n");
+ fprintf(fff, "\n You have done something illegal.");
#endif
- }
- else
- {
+
+ fprintf(fff,"\n");
+}
+
+
+/*
+ *
+ */
+static void dump_aux_arena(FILE *fff)
+{
+ if (lite_town || vanilla_town) return;
+
+ if (p_ptr->arena_number < 0)
+ {
+ if (p_ptr->arena_number <= ARENA_DEFEATED_OLD_VER)
+ {
#ifdef JP
- fprintf(fff, "\n Æ®µ»¾ì: %d²óÀï¤Ç%s¤ÎÁ°¤ËÇÔËÌ\n", -p_ptr->arena_number,
- r_name + r_info[arena_info[-1 - p_ptr->arena_number].r_idx].name);
+ fprintf(fff, "\n Æ®µ»¾ì: ÇÔËÌ\n");
#else
- fprintf(fff, "\n Arena: Defeated by %s in the %d%s fight\n",
- r_name + r_info[arena_info[-1 - p_ptr->arena_number].r_idx].name,
- -p_ptr->arena_number, get_ordinal_number_suffix(-p_ptr->arena_number));
+ fprintf(fff, "\n Arena: Defeated\n");
#endif
- }
}
- else if (p_ptr->arena_number > MAX_ARENA_MONS + 2)
+ else
{
#ifdef JP
- fprintf(fff, "\n Æ®µ»¾ì: ¿¿¤Î¥Á¥ã¥ó¥Ô¥ª¥ó\n");
+ fprintf(fff, "\n Æ®µ»¾ì: %d²óÀï¤Ç%s¤ÎÁ°¤ËÇÔËÌ\n", -p_ptr->arena_number,
+ r_name + r_info[arena_info[-1 - p_ptr->arena_number].r_idx].name);
#else
- fprintf(fff, "\n Arena: True Champion\n");
+ fprintf(fff, "\n Arena: Defeated by %s in the %d%s fight\n",
+ r_name + r_info[arena_info[-1 - p_ptr->arena_number].r_idx].name,
+ -p_ptr->arena_number, get_ordinal_number_suffix(-p_ptr->arena_number));
#endif
}
- else if (p_ptr->arena_number > MAX_ARENA_MONS - 1)
- {
+ }
+ else if (p_ptr->arena_number > MAX_ARENA_MONS + 2)
+ {
#ifdef JP
- fprintf(fff, "\n Æ®µ»¾ì: ¥Á¥ã¥ó¥Ô¥ª¥ó\n");
+ fprintf(fff, "\n Æ®µ»¾ì: ¿¿¤Î¥Á¥ã¥ó¥Ô¥ª¥ó\n");
#else
- fprintf(fff, "\n Arena: Champion\n");
+ fprintf(fff, "\n Arena: True Champion\n");
#endif
- }
- else
- {
+ }
+ else if (p_ptr->arena_number > MAX_ARENA_MONS - 1)
+ {
#ifdef JP
- fprintf(fff, "\n Æ®µ»¾ì: %2d¾¡\n", (p_ptr->arena_number > MAX_ARENA_MONS ? MAX_ARENA_MONS : p_ptr->arena_number));
+ fprintf(fff, "\n Æ®µ»¾ì: ¥Á¥ã¥ó¥Ô¥ª¥ó\n");
#else
- fprintf(fff, "\n Arena: %2d Victor%s\n", (p_ptr->arena_number > MAX_ARENA_MONS ? MAX_ARENA_MONS : p_ptr->arena_number), (p_ptr->arena_number > 1) ? "ies" : "y");
+ fprintf(fff, "\n Arena: Champion\n");
#endif
- }
}
-
- if (p_ptr->noscore)
+ else
+ {
#ifdef JP
- fprintf(fff, "\n ²¿¤«ÉÔÀµ¤Ê¤³¤È¤ò¤·¤Æ¤·¤Þ¤Ã¤Æ¤Þ¤¹¡£");
+ fprintf(fff, "\n Æ®µ»¾ì: %2d¾¡\n", (p_ptr->arena_number > MAX_ARENA_MONS ? MAX_ARENA_MONS : p_ptr->arena_number));
#else
- fprintf(fff, "\n You have done something illegal.");
+ fprintf(fff, "\n Arena: %2d Victor%s\n", (p_ptr->arena_number > MAX_ARENA_MONS ? MAX_ARENA_MONS : p_ptr->arena_number), (p_ptr->arena_number > 1) ? "ies" : "y");
#endif
+ }
+ fprintf(fff, "\n");
+}
- fprintf(fff,"\n");
+/*
+ *
+ */
+static void dump_aux_monsters(FILE *fff)
+{
/* Monsters slain */
+
+ int k;
+ unsigned long uniq_total = 0;
+ unsigned long norm_total = 0;
+ s16b *who;
+
+ /* Sort by monster level */
+ u16b why = 2;
+
+#ifdef JP
+ fprintf(fff, "\n [Åݤ·¤¿¥â¥ó¥¹¥¿¡¼]\n\n");
+#else
+ fprintf(fff, "\n [Defeated monsters]\n\n");
+#endif
+
+ /* Allocate the "who" array */
+ C_MAKE(who, max_r_idx, s16b);
+
+ /* Count monster kills */
+ for (k = 1; k < max_r_idx; k++)
{
- int k;
- s32b Total = 0;
+ monster_race *r_ptr = &r_info[k];
- for (k = 1; k < max_r_idx; k++)
- {
- monster_race *r_ptr = &r_info[k];
+ /* Ignore unused index */
+ if (!r_ptr->name) continue;
- if (r_ptr->flags1 & RF1_UNIQUE)
+ /* Unique monsters */
+ if (r_ptr->flags1 & RF1_UNIQUE)
+ {
+ bool dead = (r_ptr->max_num == 0);
+ if (dead)
{
- bool dead = (r_ptr->max_num == 0);
- if (dead)
- {
- Total++;
- }
+ norm_total++;
+
+ /* Add a unique monster to the list */
+ who[uniq_total++] = k;
}
- else
+ }
+
+ /* Normal monsters */
+ else
+ {
+ if (r_ptr->r_pkills > 0)
{
- s16b This = r_ptr->r_pkills;
- if (This > 0)
- {
- Total += This;
- }
+ norm_total += r_ptr->r_pkills;
}
}
+ }
+
- if (Total < 1)
+ /* No monsters is defeated */
+ if (norm_total < 1)
+ {
#ifdef JP
- fprintf(fff,"\n ¤Þ¤ÀŨ¤òÅݤ·¤Æ¤¤¤Þ¤»¤ó¡£\n");
+ fprintf(fff,"¤Þ¤ÀŨ¤òÅݤ·¤Æ¤¤¤Þ¤»¤ó¡£\n");
#else
- fprintf(fff,"\n You have defeated no enemies yet.\n");
+ fprintf(fff,"You have defeated no enemies yet.\n");
#endif
+ }
- else if (Total == 1)
+ /* Defeated more than one normal monsters */
+ else if (uniq_total == 0)
+ {
#ifdef JP
- fprintf(fff,"\n °ìÂΤÎŨ¤òÅݤ·¤Æ¤¤¤Þ¤¹¡£\n");
+ fprintf(fff,"%luÂΤÎŨ¤òÅݤ·¤Æ¤¤¤Þ¤¹¡£\n", norm_total);
#else
- fprintf(fff,"\n You have defeated one enemy.\n");
+ fprintf(fff,"You have defeated %lu %s.\n", norm_total, norm_total == 1 ? "enemy" : "enemies");
#endif
+ }
+
+ /* Defeated more than one unique monsters */
+ else /* if (uniq_total > 0) */
+ {
+#ifdef JP
+ fprintf(fff, "%luÂΤΥæ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼¤ò´Þ¤à¡¢¹ç·×%luÂΤÎŨ¤òÅݤ·¤Æ¤¤¤Þ¤¹¡£\n", uniq_total, norm_total);
+#else
+ fprintf(fff, "You have defeated %lu %s including %lu unique monster%s in total.\n", norm_total, norm_total == 1 ? "enemy" : "enemies", uniq_total, (uniq_total == 1 ? "" : "s"));
+#endif
+
+
+ /* Select the sort method */
+ ang_sort_comp = ang_sort_comp_hook;
+ ang_sort_swap = ang_sort_swap_hook;
+
+ /* Sort the array by dungeon depth of monsters */
+ ang_sort(who, &why, uniq_total);
+
+#ifdef JP
+ fprintf(fff, "\n¡Ô¾å°Ì%luÂΤΥæ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼¡Õ\n", MIN(uniq_total, 10));
+#else
+ fprintf(fff, "\n< Unique monsters top %lu >\n", MIN(uniq_total, 10));
+#endif
+
+ /* Print top 10 */
+ for (k = MIN(10, uniq_total); k >= 0; k--)
+ {
+ monster_race *r_ptr = &r_info[who[k]];
- else
#ifdef JP
- fprintf(fff,"\n %lu ÂΤÎŨ¤òÅݤ·¤Æ¤¤¤Þ¤¹¡£\n", Total);
+ fprintf(fff, " %-40s (¥ì¥Ù¥ë%3d)\n", (r_name + r_ptr->name), r_ptr->level);
#else
- fprintf(fff,"\n You have defeated %lu enemies.\n", Total);
+ fprintf(fff, " %-40s (level %3d)\n", (r_name + r_ptr->name), r_ptr->level);
#endif
+ }
}
+ /* Free the "who" array */
+ C_KILL(who, max_r_idx, s16b);
+}
+
+/*
+ *
+ */
+static void dump_aux_race_history(FILE *fff)
+{
if (p_ptr->old_race1 || p_ptr->old_race2)
{
+ int i;
+
#ifdef JP
fprintf(fff, "\n\n ¤¢¤Ê¤¿¤Ï%s¤È¤·¤ÆÀ¸¤Þ¤ì¤¿¡£", race_info[p_ptr->start_race].title);
#else
#endif
}
}
+}
+
+/*
+ *
+ */
+static void dump_aux_realm_history(FILE *fff)
+{
if (p_ptr->old_realm)
{
+ int i;
+
for (i = 0; i < MAX_MAGIC; i++)
{
if (!(p_ptr->old_realm & 1L << i)) continue;
#endif
}
}
+}
+
+/*
+ *
+ */
+static void dump_aux_virtues(FILE *fff)
+{
#ifdef JP
fprintf(fff, "\n\n [¥×¥ì¥¤¥ä¡¼¤ÎÆÁ]\n\n");
#else
#else
fprintf(fff, "Your alighnment : %s\n", your_alignment());
#endif
+
fprintf(fff, "\n");
dump_virtues(fff);
+}
+
+/*
+ *
+ */
+static void dump_aux_mutations(FILE *fff)
+{
if (p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3)
{
#ifdef JP
dump_mutations(fff);
}
-
/* Skip some lines */
fprintf(fff, "\n\n");
+}
+
+/*
+ *
+ */
+static void dump_aux_equipment_inventory(FILE *fff)
+{
+ int i;
+ char o_name[MAX_NLEN];
/* Dump the equipment */
if (equip_cnt)
#else
strcpy(o_name, "(wielding with two-hands)");
#endif
- fprintf(fff, "%c%s %s\n",
- index_to_label(i), paren, o_name);
+
+ fprintf(fff, "%c) %s\n",
+ index_to_label(i), o_name);
}
fprintf(fff, "\n\n");
}
/* Dump the inventory slots */
object_desc(o_name, &inventory[i], TRUE, 3);
- fprintf(fff, "%c%s %s\n", index_to_label(i), paren, o_name);
+ fprintf(fff, "%c) %s\n", index_to_label(i), o_name);
}
/* Add an empty line */
fprintf(fff, "\n\n");
+}
- process_dungeon_file("w_info.txt", 0, 0, max_wild_y, max_wild_x);
- /* Print all homes in the different towns */
+/*
+ *
+ */
+static void dump_aux_home_museum(FILE *fff)
+{
+ char o_name[MAX_NLEN];
+ store_type *st_ptr;
+
+ /* Do we need it?? */
+ /* process_dungeon_file("w_info.txt", 0, 0, max_wild_y, max_wild_x); */
+
+ /* Print the home */
st_ptr = &town[1].store[STORE_HOME];
/* Home -- if anything there */
if (st_ptr->stock_num)
{
- /* Header with name of the town */
+ int i;
+ int x = 1;
+
#ifdef JP
fprintf(fff, " [²æ¤¬²È¤Î¥¢¥¤¥Æ¥à]\n");
#else
fprintf(fff, " [Home Inventory]\n");
#endif
- x = 1;
/* Dump all available items */
for (i = 0; i < st_ptr->stock_num; i++)
fprintf(fff, "\n ( page %d )\n", x++);
#endif
object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
- fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
+ fprintf(fff, "%c) %s\n", I2A(i%12), o_name);
}
/* Add an empty line */
}
- /* Print all homes in the different towns */
+ /* Print the home */
st_ptr = &town[1].store[STORE_MUSEUM];
/* Home -- if anything there */
if (st_ptr->stock_num)
{
- /* Header with name of the town */
+ int i;
+ int x = 1;
+
#ifdef JP
fprintf(fff, " [Çîʪ´Û¤Î¥¢¥¤¥Æ¥à]\n");
#else
fprintf(fff, " [Museum]\n");
#endif
- x = 1;
/* Dump all available items */
for (i = 0; i < st_ptr->stock_num; i++)
#ifdef JP
if ((i % 12) == 0) fprintf(fff, "\n ( %d ¥Ú¡¼¥¸ )\n", x++);
object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
- fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
+ fprintf(fff, "%c) %s\n", I2A(i%12), o_name);
#else
if ((i % 12) == 0) fprintf(fff, "\n ( page %d )\n", x++);
object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
- fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
+ fprintf(fff, "%c) %s\n", I2A(i%12), o_name);
#endif
}
/* Add an empty line */
fprintf(fff, "\n\n");
}
+}
+
+
+/*
+ * Output the character dump to a file
+ */
+errr make_character_dump(FILE *fff)
+{
+#ifdef JP
+ fprintf(fff, " [ÊѶòÈÚÅÜ %d.%d.%d ¥¥ã¥é¥¯¥¿¾ðÊó]\n\n",
+ FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
+#else
+ fprintf(fff, " [Hengband %d.%d.%d Character Dump]\n\n",
+ FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
+#endif
+
+ update_playtime();
+
+ dump_aux_display_player(fff);
+ dump_aux_last_message(fff);
+ dump_aux_options(fff);
+ dump_aux_recall(fff);
+ dump_aux_quest(fff);
+ dump_aux_arena(fff);
+ dump_aux_monsters(fff);
+ dump_aux_virtues(fff);
+ dump_aux_race_history(fff);
+ dump_aux_realm_history(fff);
+ dump_aux_class_special(fff);
+ dump_aux_mutations(fff);
+ dump_aux_pet(fff);
+ dump_aux_equipment_inventory(fff);
+ dump_aux_home_museum(fff);
#ifdef JP
fprintf(fff, " [¥Á¥§¥Ã¥¯¥µ¥à: \"%s\"]\n\n", get_check_sum());