*/
#include "angband.h"
+#include "util.h"
+#include "term.h"
+
+#include "core.h"
+#include "artifact.h"
+#include "sort.h"
+#include "store.h"
+#include "monster.h"
+#include "object-flavor.h"
+#include "object-hook.h"
+#include "object-ego.h"
+#include "objectkind.h"
+#include "floor-town.h"
+#include "files.h"
#ifdef ALLOW_SPOILERS
* @param r_ptr モンスター種族の構造体ポインタ
* @return シンボル職の記述名
*/
-static cptr attr_to_text(monster_race *r_ptr)
+static concptr attr_to_text(monster_race *r_ptr)
{
#ifdef JP000
if (r_ptr->flags1 & RF1_ATTR_CLEAR) return "透明な";
#endif
}
- /* Oops */
#ifdef JP000
return "変な";
#else
*/
typedef struct
{
- byte tval;
- cptr name;
+ OBJECT_TYPE_VALUE tval;
+ concptr name;
} grouper;
{ TV_SHIELD, NULL },
{ TV_CLOAK, NULL },
-#ifdef JP
- { TV_LITE, "光源" },
- { TV_AMULET, "アミュレット" },
- { TV_RING, "指輪" },
-#else
- { TV_LITE, "Light Sources" },
- { TV_AMULET, "Amulets" },
- { TV_RING, "Rings" },
-#endif
-
-#ifdef JP
- { TV_STAFF, "杖" },
- { TV_WAND, "魔法棒" },
- { TV_ROD, "ロッド" },
-#else
- { TV_STAFF, "Staffs" },
- { TV_WAND, "Wands" },
- { TV_ROD, "Rods" },
-#endif
-
-#ifdef JP
- { TV_SCROLL, "巻物" },
- { TV_POTION, "薬" },
- { TV_FOOD, "食料" },
-#else
- { TV_SCROLL, "Scrolls" },
- { TV_POTION, "Potions" },
- { TV_FOOD, "Food" },
-#endif
-
-#ifdef JP
- { TV_LIFE_BOOK, "魔法書 (生命)" },
- { TV_SORCERY_BOOK, "魔法書 (仙術)" },
- { TV_NATURE_BOOK, "魔法書 (自然)" },
- { TV_CHAOS_BOOK, "魔法書 (カオス)" },
- { TV_DEATH_BOOK, "魔法書 (暗黒)" },
- { TV_TRUMP_BOOK, "魔法書 (トランプ)" },
- { TV_ARCANE_BOOK, "魔法書 (秘術)" },
- { TV_CRAFT_BOOK, "魔法書 (匠)" },
- { TV_DAEMON_BOOK, "魔法書 (悪魔)" },
- { TV_CRUSADE_BOOK, "魔法書 (破邪)" },
- { TV_MUSIC_BOOK, "歌集" },
- { TV_HISSATSU_BOOK, "武芸の書" },
- { TV_HEX_BOOK, "魔法書 (呪術)" },
-#else
- { TV_LIFE_BOOK, "Books (Life)" },
- { TV_SORCERY_BOOK, "Books (Sorcery)" },
- { TV_NATURE_BOOK, "Books (Nature)" },
- { TV_CHAOS_BOOK, "Books (Chaos)" },
- { TV_DEATH_BOOK, "Books (Death)" },
- { TV_TRUMP_BOOK, "Books (Trump)" },
- { TV_ARCANE_BOOK, "Books (Arcane)" },
- { TV_CRAFT_BOOK, "Books (Craft)" },
- { TV_DAEMON_BOOK, "Books (Daemon)" },
- { TV_CRUSADE_BOOK, "Books (Crusade)" },
- { TV_MUSIC_BOOK, "Song Books" },
- { TV_HISSATSU_BOOK, "Books (Kendo)" },
- { TV_HEX_BOOK, "Books (Hex)" },
-#endif
-
-#ifdef JP
- { TV_WHISTLE, "笛" },
- { TV_CAPTURE, "キャプチャー・ボール" },
- { TV_CARD, "エクスプレスカード" },
-#else
- { TV_WHISTLE, "Whistle" },
- { TV_CAPTURE, "Capture Ball" },
- { TV_CARD, "Express Card" },
-#endif
+ { TV_LITE, _("光源", "Light Sources") },
+ { TV_AMULET, _("アミュレット", "Amulets" )},
+ { TV_RING, _("指輪", "Rings") },
+ { TV_STAFF, _("杖", "Staffs") },
+ { TV_WAND, _("魔法棒", "Wands") },
+ { TV_ROD, _("ロッド", "Rods") },
+ { TV_SCROLL, _("巻物", "Scrolls") },
+ { TV_POTION, _("薬", "Potions") },
+ { TV_FOOD, _("食料", "Food") },
+
+ { TV_LIFE_BOOK, _("魔法書 (生命)", "Books (Life)") },
+ { TV_SORCERY_BOOK, _("魔法書 (仙術)", "Books (Sorcery)") },
+ { TV_NATURE_BOOK, _("魔法書 (自然)", "Books (Nature)") },
+ { TV_CHAOS_BOOK, _("魔法書 (カオス)", "Books (Chaos)") },
+ { TV_DEATH_BOOK, _("魔法書 (暗黒)", "Books (Death)") },
+ { TV_TRUMP_BOOK, _("魔法書 (トランプ)", "Books (Trump)") },
+ { TV_ARCANE_BOOK, _("魔法書 (秘術)", "Books (Arcane)") },
+ { TV_CRAFT_BOOK, _("魔法書 (匠)", "Books (Craft)") },
+ { TV_DAEMON_BOOK, _("魔法書 (悪魔)", "Books (Daemon)") },
+ { TV_CRUSADE_BOOK, _("魔法書 (破邪)", "Books (Crusade)") },
+ { TV_MUSIC_BOOK, _("歌集", "Song Books") },
+ { TV_HISSATSU_BOOK, _("武芸の書", "Books (Kendo)") },
+ { TV_HEX_BOOK, _("魔法書 (呪術)", "Books (Hex)") },
+
+ { TV_WHISTLE, _("笛", "Whistle") },
+ { TV_CAPTURE, _("キャプチャー・ボール", "Capture Ball") },
+ { TV_CARD, _("エクスプレスカード", "Express Card") },
{ TV_CHEST, _("箱", "Chests") },
-#ifdef JP
- { TV_FIGURINE, "人形" },
- { TV_STATUE, "像" },
- { TV_CORPSE, "死体" },
-#else
- { TV_FIGURINE, "Magical Figurines" },
- { TV_STATUE, "Statues" },
- { TV_CORPSE, "Corpses" },
-#endif
+ { TV_FIGURINE, _("人形", "Magical Figurines") },
+ { TV_STATUE, _("像", "Statues") },
+ { TV_CORPSE, _("死体", "Corpses") },
{ TV_SKELETON, _("その他", "Misc") },
{ TV_BOTTLE, NULL },
object_type forge;
object_type *q_ptr;
int i;
-
- /* Get local object */
q_ptr = &forge;
/* Prepare a fake item */
q_ptr->to_h = 0;
q_ptr->to_d = 0;
-
- /* Level */
(*lev) = k_info[q_ptr->k_idx].level;
-
- /* Value */
(*val) = object_value(q_ptr);
-
- /* Hack */
if (!buf || !dam || !chance || !wgt) return;
-
/* Description (too brief) */
object_desc(buf, q_ptr, (OD_NAME_ONLY | OD_STORE));
-
/* Misc info */
strcpy(dam, "");
char chance_aux[20] = "";
if(k_info[q_ptr->k_idx].chance[i] > 0)
{
- sprintf(chance_aux, "%s%3dF:%+4d", (i != 0 ? "/" : ""), k_info[q_ptr->k_idx].locale[i], 100/k_info[q_ptr->k_idx].chance[i]);
+ sprintf(chance_aux, "%s%3dF:%+4d", (i != 0 ? "/" : ""),
+ (int)k_info[q_ptr->k_idx].locale[i], 100/k_info[q_ptr->k_idx].chance[i]);
strcat(chance, chance_aux);
}
}
/* Weight */
- sprintf(wgt, "%3d.%d", q_ptr->weight / 10, q_ptr->weight % 10);
+ sprintf(wgt, "%3d.%d", (int)(q_ptr->weight / 10), (int)(q_ptr->weight % 10));
}
* @param fname ファイル名
* @return なし
*/
-static void spoil_obj_desc(cptr fname)
+static void spoil_obj_desc(concptr fname)
{
int i, k, s, t, n = 0, group_start = 0;
char chance[80];
char dam[80];
-
- /* Build the filename */
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
/* File type is "TEXT" */
/* Open the file */
fff = my_fopen(buf, "w");
- /* Oops */
if (!fff)
{
msg_print("Cannot create spoiler file.");
/* Dump it */
fprintf(fff, " %-35s%8s%7s%5d %-40s%9ld\n",
- buf, dam, wgt, e, chance, (long)(v));
+ buf, dam, wgt, (int)e, chance, (long)(v));
}
/* Start a new set */
return;
}
- /* Message */
msg_print("Successfully created a spoiler file.");
}
struct flag_desc
{
const int flag;
- const char *const desc;
+ concptr const desc;
};
*
* This list includes extra attacks, for simplicity.
*/
- cptr pval_affects[N_ELEMENTS(stat_flags_desc) - 1 +
+ concptr pval_affects[N_ELEMENTS(stat_flags_desc) - 1 +
N_ELEMENTS(pval_flags1_desc) + 1];
} pval_info_type;
pval_info_type pval_info;
/* A list of an object's slaying preferences */
- cptr slays[N_ELEMENTS(slay_flags_desc) + 1];
+ concptr slays[N_ELEMENTS(slay_flags_desc) + 1];
/* A list if an object's elemental brands */
- cptr brands[N_ELEMENTS(brand_flags_desc) + 1];
+ concptr brands[N_ELEMENTS(brand_flags_desc) + 1];
/* A list of immunities granted by an object */
- cptr immunities[N_ELEMENTS(immune_flags_desc) + 1];
+ concptr immunities[N_ELEMENTS(immune_flags_desc) + 1];
/* A list of resistances granted by an object */
- cptr resistances[N_ELEMENTS(resist_flags_desc) + 1];
+ concptr resistances[N_ELEMENTS(resist_flags_desc) + 1];
/* A list of stats sustained by an object */
- cptr sustains[N_ELEMENTS(sustain_flags_desc) - 1 + 1];
+ concptr sustains[N_ELEMENTS(sustain_flags_desc) - 1 + 1];
/* A list of various magical qualities an object may have */
- cptr misc_magic[N_ELEMENTS(misc_flags2_desc) + N_ELEMENTS(misc_flags3_desc)
+ concptr misc_magic[N_ELEMENTS(misc_flags2_desc) + N_ELEMENTS(misc_flags3_desc)
+ 1 /* Permanent Light */
+ 1 /* TY curse */
+ 1 /* type of curse */
char addition[80];
/* A string describing an artifact's activation */
- cptr activation;
+ concptr activation;
/* "Level 20, Rarity 30, 3.0 lbs, 20000 Gold" */
char misc_desc[80];
* @param str 出力したい文字列
* @return なし
*/
-static void spoiler_underline(cptr str)
+static void spoiler_underline(concptr str)
{
fprintf(fff, "%s\n", str);
spoiler_out_n_chars(strlen(str), '-');
* The possibly updated description pointer is returned.
* </pre>
*/
-static cptr *spoiler_flag_aux(const u32b art_flags[TR_FLAG_SIZE],
+static concptr *spoiler_flag_aux(const BIT_FLAGS art_flags[TR_FLAG_SIZE],
const flag_desc *flag_ptr,
- cptr *desc_ptr, const int n_elmnts)
+ concptr *desc_ptr, const int n_elmnts)
{
int i;
*/
static void analyze_pval(object_type *o_ptr, pval_info_type *pi_ptr)
{
- u32b flgs[TR_FLAG_SIZE];
+ BIT_FLAGS flgs[TR_FLAG_SIZE];
- cptr *affects_list;
+ concptr *affects_list;
/* If pval == 0, there is nothing to do. */
if (!o_ptr->pval)
pi_ptr->pval_desc[0] = '\0';
return;
}
-
- /* Extract the flags */
object_flags(o_ptr, flgs);
affects_list = pi_ptr->pval_affects;
* @param slay_list 種族スレイ構造体の参照ポインタ
* @return なし
*/
-static void analyze_slay(object_type *o_ptr, cptr *slay_list)
+static void analyze_slay(object_type *o_ptr, concptr *slay_list)
{
- u32b flgs[TR_FLAG_SIZE];
+ BIT_FLAGS flgs[TR_FLAG_SIZE];
object_flags(o_ptr, flgs);
* @param brand_list 属性ブランド構造体の参照ポインタ
* @return なし
*/
-static void analyze_brand(object_type *o_ptr, cptr *brand_list)
+static void analyze_brand(object_type *o_ptr, concptr *brand_list)
{
- u32b flgs[TR_FLAG_SIZE];
+ BIT_FLAGS flgs[TR_FLAG_SIZE];
object_flags(o_ptr, flgs);
* @param resist_list 通常耐性構造体の参照ポインタ
* @return なし
*/
-static void analyze_resist(object_type *o_ptr, cptr *resist_list)
+static void analyze_resist(object_type *o_ptr, concptr *resist_list)
{
- u32b flgs[TR_FLAG_SIZE];
+ BIT_FLAGS flgs[TR_FLAG_SIZE];
object_flags(o_ptr, flgs);
* @param immune_list 免疫構造体の参照ポインタ
* @return なし
*/
-static void analyze_immune(object_type *o_ptr, cptr *immune_list)
+static void analyze_immune(object_type *o_ptr, concptr *immune_list)
{
- u32b flgs[TR_FLAG_SIZE];
+ BIT_FLAGS flgs[TR_FLAG_SIZE];
object_flags(o_ptr, flgs);
* @param sustain_list 維持特性構造体の参照ポインタ
* @return なし
*/
-static void analyze_sustains(object_type *o_ptr, cptr *sustain_list)
+static void analyze_sustains(object_type *o_ptr, concptr *sustain_list)
{
- u32b flgs[TR_FLAG_SIZE];
+ BIT_FLAGS flgs[TR_FLAG_SIZE];
object_flags(o_ptr, flgs);
* @param misc_list その他の特性構造体の参照ポインタ
* @return なし
*/
-static void analyze_misc_magic(object_type *o_ptr, cptr *misc_list)
+static void analyze_misc_magic(object_type *o_ptr, concptr *misc_list)
{
- u32b flgs[TR_FLAG_SIZE];
- int rad;
+ BIT_FLAGS flgs[TR_FLAG_SIZE];
+ POSITION rad;
char desc[256];
object_flags(o_ptr, flgs);
misc_list = spoiler_flag_aux(flgs, misc_flags2_desc, misc_list,
N_ELEMENTS(misc_flags2_desc));
- misc_list = spoiler_flag_aux(flgs, misc_flags3_desc, misc_list,
- N_ELEMENTS(misc_flags3_desc));
+ misc_list = spoiler_flag_aux(flgs, misc_flags3_desc, misc_list, N_ELEMENTS(misc_flags3_desc));
/*
* Glowing artifacts -- small radius light.
if (have_flag(flgs, TR_LITE_FUEL))
{
- if(rad > 0) sprintf(desc, _("それは燃料補給によって明かり(半径 %d)を授ける。", "It provides light (radius %d) when fueled."), rad);
+ if(rad > 0) sprintf(desc, _("それは燃料補給によって明かり(半径 %d)を授ける。", "It provides light (radius %d) when fueled."), (int)rad);
}
else
{
- if(rad > 0) sprintf(desc, _("永久光源(半径 %d)", "Permanent Light(radius %d)"), rad);
- if(rad < 0) sprintf(desc, _("永久光源(半径-%d)。", "Permanent Light(radius -%d)"), -rad);
+ if(rad > 0) sprintf(desc, _("永久光源(半径 %d)", "Permanent Light(radius %d)"), (int)rad);
+ if(rad < 0) sprintf(desc, _("永久光源(半径-%d)。", "Permanent Light(radius -%d)"), (int)-rad);
}
if(rad != 0) *misc_list++ = quark_str(quark_add(desc));
/* Init */
strcpy(addition, "");
-#ifdef JP
- if ((a_ptr->gen_flags & TRG_XTRA_POWER) && (a_ptr->gen_flags & TRG_XTRA_H_RES)) strcat(addition, "能力and耐性");
+ if ((a_ptr->gen_flags & TRG_XTRA_POWER) && (a_ptr->gen_flags & TRG_XTRA_H_RES)) strcat(addition, _("能力and耐性", "Ability and Resistance"));
else if (a_ptr->gen_flags & TRG_XTRA_POWER)
{
- strcat(addition, "能力");
- if (a_ptr->gen_flags & TRG_XTRA_RES_OR_POWER) strcat(addition, "(1/2でand耐性)");
+ strcat(addition, _("能力", "Ability"));
+ if (a_ptr->gen_flags & TRG_XTRA_RES_OR_POWER) strcat(addition, _("(1/2でand耐性)", "(plus Resistance about 1/2)"));
}
else if (a_ptr->gen_flags & TRG_XTRA_H_RES)
{
- strcat(addition, "耐性");
- if (a_ptr->gen_flags & TRG_XTRA_RES_OR_POWER) strcat(addition, "(1/2でand能力)");
- }
- else if (a_ptr->gen_flags & TRG_XTRA_RES_OR_POWER) strcat(addition, "能力or耐性");
-#else
- if ((a_ptr->gen_flags & TRG_XTRA_POWER) && (a_ptr->gen_flags & TRG_XTRA_H_RES)) strcat(addition, "Ability and Resistance");
- else if (a_ptr->gen_flags & TRG_XTRA_POWER)
- {
- strcat(addition, "Ability");
- if (a_ptr->gen_flags & TRG_XTRA_RES_OR_POWER) strcat(addition, "(plus Resistance about 1/2)");
+ strcat(addition, _("耐性", "Resistance"));
+ if (a_ptr->gen_flags & TRG_XTRA_RES_OR_POWER) strcat(addition, _("(1/2でand能力)", "(plus Ability about 1/2)"));
}
- else if (a_ptr->gen_flags & TRG_XTRA_H_RES)
- {
- strcat(addition, "Resistance");
- if (a_ptr->gen_flags & TRG_XTRA_RES_OR_POWER) strcat(addition, "(plus Ability about 1/2)");
- }
- else if (a_ptr->gen_flags & TRG_XTRA_RES_OR_POWER) strcat(addition, "Ability or Resistance");
-#endif
+ else if (a_ptr->gen_flags & TRG_XTRA_RES_OR_POWER) strcat(addition, _("能力or耐性", "Ability or Resistance"));
}
{
artifact_type *a_ptr = &a_info[o_ptr->name1];
+ sprintf(misc_desc, _("レベル %d, 希少度 %u, %d.%d kg, $%ld", "Level %d, Rarity %u, %d.%d lbs, %ld Gold"), (int)a_ptr->level, a_ptr->rarity,
#ifdef JP
- sprintf(misc_desc, "レベル %u, 希少度 %u, %d.%d kg, $%ld",
- a_ptr->level, a_ptr->rarity,
lbtokg1(a_ptr->weight), lbtokg2(a_ptr->weight), (long int)a_ptr->cost);
#else
- sprintf(misc_desc, "Level %u, Rarity %u, %d.%d lbs, %ld Gold",
- a_ptr->level, a_ptr->rarity,
a_ptr->weight / 10, a_ptr->weight % 10, a_ptr->cost);
#endif
}
{
char buf[80];
- sprintf(buf, "Artifact Spoilers for Hengband Version %d.%d.%d",
- FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
+ sprintf(buf, "Artifact Spoilers for Hengband Version %d.%d.%d",FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
spoiler_underline(buf);
}
* @param separator フラグ表示の区切り記号
* @return なし
*/
-static void spoiler_outlist(cptr header, cptr *list, char separator)
+static void spoiler_outlist(concptr header, concptr *list, char separator)
{
int line_len, buf_len;
char line[MAX_LINE_LEN+1], buf[80];
static void spoiler_print_art(obj_desc_list *art_ptr)
{
pval_info_type *pval_ptr = &art_ptr->pval_info;
-
char buf[80];
/* Don't indent the first line */
}
/* Now deal with the description lists */
-
-#ifdef JP
- spoiler_outlist("対:", art_ptr->slays, ITEM_SEP);
- spoiler_outlist("武器属性:", art_ptr->brands, LIST_SEP);
- spoiler_outlist("免疫:", art_ptr->immunities, ITEM_SEP);
- spoiler_outlist("耐性:", art_ptr->resistances, ITEM_SEP);
- spoiler_outlist("維持:", art_ptr->sustains, ITEM_SEP);
-#else
- spoiler_outlist("Slay", art_ptr->slays, ITEM_SEP);
- spoiler_outlist("", art_ptr->brands, LIST_SEP);
- spoiler_outlist("Immunity to", art_ptr->immunities, ITEM_SEP);
- spoiler_outlist("Resist", art_ptr->resistances, ITEM_SEP);
- spoiler_outlist("Sustain", art_ptr->sustains, ITEM_SEP);
-#endif
+ spoiler_outlist(_("対:", "Slay"), art_ptr->slays, ITEM_SEP);
+ spoiler_outlist(_("武器属性:", ""), art_ptr->brands, LIST_SEP);
+ spoiler_outlist(_("免疫:", "Immunity to"), art_ptr->immunities, ITEM_SEP);
+ spoiler_outlist(_("耐性:", "Resist"), art_ptr->resistances, ITEM_SEP);
+ spoiler_outlist(_("維持:", "Sustain"), art_ptr->sustains, ITEM_SEP);
spoiler_outlist("", art_ptr->misc_magic, LIST_SEP);
if (art_ptr->addition[0])
*/
static bool make_fake_artifact(object_type *o_ptr, IDX name1)
{
- IDX i;
-
+ OBJECT_IDX i;
artifact_type *a_ptr = &a_info[name1];
-
/* Ignore "empty" artifacts */
if (!a_ptr->name) return FALSE;
/* Acquire the "kind" index */
i = lookup_kind(a_ptr->tval, a_ptr->sval);
- /* Oops */
if (!i) return (FALSE);
- /* Create the artifact */
object_prep(o_ptr, i);
/* Save the name */
* @param fname 生成ファイル名
* @return なし
*/
-static void spoil_artifact(cptr fname)
+static void spoil_artifact(concptr fname)
{
int i;
IDX j;
object_type forge;
object_type *q_ptr;
-
obj_desc_list artifact;
-
char buf[1024];
-
-
- /* Build the filename */
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
/* File type is "TEXT" */
/* Open the file */
fff = my_fopen(buf, "w");
- /* Oops */
if (!fff)
{
msg_print("Cannot create spoiler file.");
/* We only want objects in the current group */
if (a_ptr->tval != group_artifact[i].tval) continue;
-
- /* Get local object */
q_ptr = &forge;
-
- /* Wipe the object */
object_wipe(q_ptr);
/* Attempt to "forge" the artifact */
return;
}
- /* Message */
msg_print("Successfully created a spoiler file.");
}
* @param fname 生成ファイル名
* @return なし
*/
-static void spoil_mon_desc(cptr fname)
+static void spoil_mon_desc(concptr fname)
{
int i, n = 0;
u16b why = 2;
- s16b *who;
+ MONRACE_IDX *who;
char buf[1024];
char ac[80];
char hp[80];
char exp[80];
-
- /* Build the filename */
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
/* File type is "TEXT" */
/* Open the file */
fff = my_fopen(buf, "w");
- /* Oops */
if (!fff)
{
msg_print("Cannot create spoiler file.");
}
/* Allocate the "who" array */
- C_MAKE(who, max_r_idx, s16b);
+ C_MAKE(who, max_r_idx, MONRACE_IDX);
/* Dump the header */
fprintf(fff, "Monster Spoilers for Hengband Version %d.%d.%d\n",
if (r_ptr->name) who[n++] = (s16b)i;
}
- /* 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, n);
+ ang_sort(who, &why, n, ang_sort_comp_hook, ang_sort_swap_hook);
/* Scan again */
for (i = 0; i < n; i++)
{
monster_race *r_ptr = &r_info[who[i]];
- cptr name = (r_name + r_ptr->name);
+ concptr name = (r_name + r_ptr->name);
if (r_ptr->flags7 & (RF7_KAGE)) continue;
/* Get the "name" */
/*
- else if (r_ptr->flags1 & (RF1_QUESTOR))
+ else if (r_ptr->flags3 & (RF3_NO_CONF))
{
- sprintf(nam, "[Q] %s", name);
+ sprintf(nam, "[*] %s", name);
}
*/
else if (r_ptr->flags1 & (RF1_UNIQUE))
sprintf(nam, _(" %s", "The %s"), name);
}
-
/* Level */
sprintf(lev, "%d", (int)r_ptr->level);
/* Rarity */
sprintf(rar, "%d", (int)r_ptr->rarity);
- /* Speed */
if (r_ptr->speed >= 110)
{
sprintf(spd, "+%d", (r_ptr->speed - 110));
* @param str 文字列参照ポインタ
* @return なし
*/
-static void spoil_out(cptr str)
+static void spoil_out(concptr str)
{
- cptr r;
+ concptr r;
/* Line buffer */
static char roff_buf[256];
#ifdef JP
bool k_flag_local;
bool iskanji_flag_local = FALSE;
- cptr tail = str + (k_flag ? 2 : 1);
+ concptr tail = str + (k_flag ? 2 : 1);
#else
- cptr tail = str + 1;
+ concptr tail = str + 1;
#endif
for (; *tail; tail++)
* @param str 文字列参照ポインタ
* @return なし
*/
-static void roff_func(byte attr, cptr str)
+static void roff_func(TERM_COLOR attr, concptr str)
{
/* Unused */
(void)attr;
* @param fname ファイル名
* @return なし
*/
-static void spoil_mon_info(cptr fname)
+static void spoil_mon_info(concptr fname)
{
char buf[1024];
int i, l, n = 0;
- u32b flags1;
+ BIT_FLAGS flags1;
u16b why = 2;
- s16b *who;
-
- /* Build the filename */
+ MONRACE_IDX *who;
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
/* File type is "TEXT" */
/* Open the file */
fff = my_fopen(buf, "w");
- /* Oops */
if (!fff)
{
msg_print("Cannot create spoiler file.");
spoil_out("------------------------------------------\n\n");
/* Allocate the "who" array */
- C_MAKE(who, max_r_idx, s16b);
+ C_MAKE(who, max_r_idx, MONRACE_IDX);
/* Scan the monsters */
for (i = 1; i < max_r_idx; i++)
if (r_ptr->name) who[n++] = (s16b)i;
}
- /* 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, n);
-
+ ang_sort(who, &why, n, ang_sort_comp_hook, ang_sort_swap_hook);
/*
* List all monsters in order
for (l = 0; l < n; l++)
{
monster_race *r_ptr = &r_info[who[l]];
-
- /* Extract the flags */
flags1 = r_ptr->flags1;
/* Prefix */
sprintf(buf, "Rar:%d ", r_ptr->rarity);
spoil_out(buf);
- /* Speed */
if (r_ptr->speed >= 110)
{
sprintf(buf, "Spd:+%d ", (r_ptr->speed - 110));
return FALSE;
}
-
-/*!
- * @brief 進化ツリーをソートするためモンスター種族の判定関数 /
- * Sorting hook -- Comp function
- * @param u 進化木構造データ
- * @param v 未使用
- * @param a 比較したいモンスター種族ID1
- * @param b 比較したいモンスター種族ID2
- * @return 2が大きければTRUEを返す
- */
-static bool ang_sort_comp_evol_tree(vptr u, vptr v, int a, int b)
-{
- int **evol_tree = (int **)u;
-
- int w1 = evol_tree[a][0];
- int w2 = evol_tree[b][0];
- monster_race *r1_ptr = &r_info[w1];
- monster_race *r2_ptr = &r_info[w2];
-
- /* Unused */
- (void)v;
-
- /* Used tree first */
- if (w1 && !w2) return TRUE;
- if (!w1 && w2) return FALSE;
-
- /* Sort by monster level */
- if (r1_ptr->level < r2_ptr->level) return TRUE;
- if (r1_ptr->level > r2_ptr->level) return FALSE;
-
- /* Sort by monster experience */
- if (r1_ptr->mexp < r2_ptr->mexp) return TRUE;
- if (r1_ptr->mexp > r2_ptr->mexp) return FALSE;
-
- /* Compare indexes */
- return w1 <= w2;
-}
-
-/*!
- * @brief 進化ツリーをソートするため木構造のスワップ関数 /
- * Sorting hook -- Swap function
- * @param u 進化木構造データ
- * @param v 未使用
- * @param a スワップしたい木構造1
- * @param b スワップしたい木構造2
- * @return 2が大きければTRUEを返す
- */
-static void ang_sort_swap_evol_tree(vptr u, vptr v, int a, int b)
-{
- int **evol_tree = (int **)u;
- int *holder;
-
- /* Unused */
- (void)v;
-
- /* Swap */
- holder = evol_tree[a];
- evol_tree[a] = evol_tree[b];
- evol_tree[b] = holder;
-}
-
/*!
* @brief 進化ツリーをスポイラー出力するメインルーチン /
* Print monsters' evolution information to file
* @param fname 出力ファイル名
* @return なし
*/
-static void spoil_mon_evol(cptr fname)
+static void spoil_mon_evol(concptr fname)
{
char buf[1024];
monster_race *r_ptr;
int **evol_tree, i, j, n, r_idx;
int *evol_tree_zero; /* For C_KILL() */
-
- /* Build the filename */
path_build(buf, sizeof buf, ANGBAND_DIR_USER, fname);
/* File type is "TEXT" */
/* Open the file */
fff = my_fopen(buf, "w");
- /* Oops */
if (!fff)
{
msg_print("Cannot create spoiler file.");
}
/* Step 3: Sort the evolution trees */
-
- /* Select the sort method */
- ang_sort_comp = ang_sort_comp_evol_tree;
- ang_sort_swap = ang_sort_swap_evol_tree;
-
- /* Sort the array */
- ang_sort(evol_tree, NULL, max_r_idx);
+ ang_sort(evol_tree, NULL, max_r_idx, ang_sort_comp_evol_tree, ang_sort_swap_evol_tree);
/* Step 4: Print the evolution trees */
for (i = 0; i < max_r_idx; i++)
return;
}
- /* Message */
msg_print("Successfully created a spoiler file.");
}
-
-/*
- * Forward declare
- */
-extern void do_cmd_spoilers(void);
-
/*!
* @brief スポイラー出力を行うコマンドのメインルーチン /
* Create Spoiler files -BEN-
*/
void do_cmd_spoilers(void)
{
- /* Save the screen */
screen_save();
/* Interact */
while (1)
{
- /* Clear screen */
Term_clear();
/* Info */
{
/* Escape */
case ESCAPE:
- /* Restore the screen */
screen_load();
return;
spoil_mon_evol("mon-evol.txt");
break;
- /* Oops */
default:
bell();
break;
}
- /* Flush messages */
- msg_print(NULL);
+ msg_erase();
}
}
/* Now deal with the description lists */
-#ifdef JP
- spoiler_outlist("対:", art_ptr->slays, ITEM_SEP);
- spoiler_outlist("武器属性:", art_ptr->brands, LIST_SEP);
- spoiler_outlist("免疫:", art_ptr->immunities, ITEM_SEP);
- spoiler_outlist("耐性:", art_ptr->resistances, ITEM_SEP);
- spoiler_outlist("維持:", art_ptr->sustains, ITEM_SEP);
-#else
- spoiler_outlist("Slay", art_ptr->slays, ITEM_SEP);
- spoiler_outlist("", art_ptr->brands, LIST_SEP);
- spoiler_outlist("Immunity to", art_ptr->immunities, ITEM_SEP);
- spoiler_outlist("Resist", art_ptr->resistances, ITEM_SEP);
- spoiler_outlist("Sustain", art_ptr->sustains, ITEM_SEP);
-#endif
+ spoiler_outlist(_("対:", "Slay"), art_ptr->slays, ITEM_SEP);
+ spoiler_outlist(_("武器属性:", ""), art_ptr->brands, LIST_SEP);
+ spoiler_outlist(_("免疫:", "Immunity to"), art_ptr->immunities, ITEM_SEP);
+ spoiler_outlist(_("耐性:", "Resist"), art_ptr->resistances, ITEM_SEP);
+ spoiler_outlist(_("維持:", "Sustain"), art_ptr->sustains, ITEM_SEP);
spoiler_outlist("", art_ptr->misc_magic, LIST_SEP);
/* Write out the possible activation at the primary indention level */
* @param fname 出力ファイル名
* @return なし
*/
-void spoil_random_artifact(cptr fname)
+void spoil_random_artifact(concptr fname)
{
int i,j;
object_type *q_ptr;
char buf[1024];
-
-
- /* Build the filename */
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
/* File type is "TEXT" */
/* Open the file */
fff = my_fopen(buf, "w");
- /* Oops */
if (!fff)
{
msg_print("Cannot create list file.");
/* random artifacts wielding */
for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
{
- q_ptr = &inventory[i];
+ q_ptr = &p_ptr->inventory_list[i];
spoil_random_artifact_aux(q_ptr, j);
}
- /* random artifacts in inventory */
+ /* random artifacts in p_ptr->inventory_list */
for (i = 0; i < INVEN_PACK; i++)
{
- q_ptr = &inventory[i];
+ q_ptr = &p_ptr->inventory_list[i];
spoil_random_artifact_aux(q_ptr, j);
}
/* random artifacts in home */
- st_ptr = &town[1].store[STORE_HOME];
+ st_ptr = &town_info[1].store[STORE_HOME];
for (i = 0; i < st_ptr->stock_num; i++)
{
q_ptr = &st_ptr->stock[i];
}
/* random artifacts in museum */
- st_ptr = &town[1].store[STORE_MUSEUM];
+ st_ptr = &town_info[1].store[STORE_MUSEUM];
for (i = 0; i < st_ptr->stock_num; i++)
{
q_ptr = &st_ptr->stock[i];
return;
}
- /* Message */
msg_print("Successfully created a list file.");
}