#endif
}
- /* Oops */
#ifdef JP000
return "変な";
#else
*/
typedef struct
{
- byte tval;
+ OBJECT_TYPE_VALUE tval;
cptr name;
} grouper;
* @param dam ダメージダイス記述を返すバッファ参照ポインタ
* @param wgt 重量記述を返すバッファ参照ポインタ
* @param lev 生成階記述を返すバッファ参照ポインタ
+ * @param chance 生成機会を返すバッファ参照ポインタ
* @param val 価値を返すバッファ参照ポインタ
* @param k ベースアイテムID
* @return なし
*/
-static void kind_info(char *buf, char *dam, char *wgt, int *lev, s32b *val, int k)
+static void kind_info(char *buf, char *dam, char *wgt, char *chance, DEPTH *lev, PRICE *val, OBJECT_IDX k)
{
object_type forge;
object_type *q_ptr;
-
+ int i;
/* Get local object */
q_ptr = &forge;
/* Hack */
- if (!buf || !dam || !wgt) return;
+ if (!buf || !dam || !chance || !wgt) return;
/* Description (too brief) */
}
}
+ /* Chance */
+ strcpy(chance, "");
+ for(i = 0; i < 4; i++)
+ {
+ char chance_aux[20] = "";
+ if(k_info[q_ptr->k_idx].chance[i] > 0)
+ {
+ 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));
}
{
int i, k, s, t, n = 0, group_start = 0;
- u16b who[200];
+ OBJECT_IDX who[200];
char buf[1024];
char wgt[80];
+ char chance[80];
char dam[80];
/* Open the file */
fff = my_fopen(buf, "w");
- /* Oops */
if (!fff)
{
msg_print("Cannot create spoiler file.");
/* Header */
- fprintf(fff, "Spoiler File -- Basic Items (Hengband %d.%d.%d)\n\n\n",
- FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
+ fprintf(fff, "Spoiler File -- Basic Items (Hengband %d.%d.%d.%d)\n\n\n",
+ FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH, FAKE_VER_EXTRA);
/* More Header */
- fprintf(fff, "%-45s %8s%7s%5s%9s\n",
- "Description", "Dam/AC", "Wgt", "Lev", "Cost");
- fprintf(fff, "%-45s %8s%7s%5s%9s\n",
- "----------------------------------------",
- "------", "---", "---", "----");
+ fprintf(fff, "%-37s%8s%7s%5s %40s%9s\n",
+ "Description", "Dam/AC", "Wgt", "Lev", "Chance", "Cost");
+ fprintf(fff, "%-37s%8s%7s%5s %40s%9s\n",
+ "-------------------------------------", "------", "---", "---", "----------------", "----");
/* List the groups */
for (i = 0; TRUE; i++)
int i1 = t;
int i2 = t + 1;
- int e1;
- int e2;
+ DEPTH e1;
+ DEPTH e2;
- s32b t1;
- s32b t2;
+ PRICE t1;
+ PRICE t2;
- kind_info(NULL, NULL, NULL, &e1, &t1, who[i1]);
- kind_info(NULL, NULL, NULL, &e2, &t2, who[i2]);
+ kind_info(NULL, NULL, NULL, NULL, &e1, &t1, who[i1]);
+ kind_info(NULL, NULL, NULL, NULL, &e2, &t2, who[i2]);
if ((t1 > t2) || ((t1 == t2) && (e1 > e2)))
{
- int tmp = who[i1];
+ u16b tmp = who[i1];
who[i1] = who[i2];
who[i2] = tmp;
}
/* Spoil each item */
for (s = 0; s < n; s++)
{
- int e;
- s32b v;
+ DEPTH e;
+ PRICE v;
/* Describe the kind */
- kind_info(buf, dam, wgt, &e, &v, who[s]);
+ kind_info(buf, dam, wgt, chance, &e, &v, who[s]);
/* Dump it */
- fprintf(fff, " %-45s%8s%7s%5d%9ld\n",
- buf, dam, wgt, e, (long)(v));
+ fprintf(fff, " %-35s%8s%7s%5d %-40s%9ld\n",
+ buf, dam, wgt, (int)e, chance, (long)(v));
}
/* Start a new set */
if (k_ptr->gen_flags & (TRG_INSTA_ART)) continue;
/* Save the index */
- who[n++] = k;
+ who[n++] = (u16b)k;
}
}
return;
}
- /* Message */
msg_print("Successfully created a spoiler file.");
}
* The possibly updated description pointer is returned.
* </pre>
*/
-static cptr *spoiler_flag_aux(const u32b art_flags[TR_FLAG_SIZE],
+static cptr *spoiler_flag_aux(const BIT_FLAGS art_flags[TR_FLAG_SIZE],
const flag_desc *flag_ptr,
cptr *desc_ptr, const int n_elmnts)
{
* @param p_ptr pval修正構造体の参照ポインタ
* @return なし
*/
-static void analyze_pval(object_type *o_ptr, pval_info_type *p_ptr)
+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;
if (!o_ptr->pval)
{
/* An "empty" pval description indicates that pval == 0 */
- p_ptr->pval_desc[0] = '\0';
+ pi_ptr->pval_desc[0] = '\0';
return;
}
/* Extract the flags */
object_flags(o_ptr, flgs);
- affects_list = p_ptr->pval_affects;
+ affects_list = pi_ptr->pval_affects;
/* Create the "+N" string */
- sprintf(p_ptr->pval_desc, "%s%d", POSITIZE(o_ptr->pval), o_ptr->pval);
+ sprintf(pi_ptr->pval_desc, "%s%d", POSITIZE(o_ptr->pval), o_ptr->pval);
/* First, check to see if the pval affects all stats */
if (have_flag(flgs, TR_STR) && have_flag(flgs, TR_INT) &&
*/
static void analyze_slay(object_type *o_ptr, cptr *slay_list)
{
- u32b flgs[TR_FLAG_SIZE];
+ BIT_FLAGS flgs[TR_FLAG_SIZE];
object_flags(o_ptr, flgs);
*/
static void analyze_brand(object_type *o_ptr, cptr *brand_list)
{
- u32b flgs[TR_FLAG_SIZE];
+ BIT_FLAGS flgs[TR_FLAG_SIZE];
object_flags(o_ptr, flgs);
*/
static void analyze_resist(object_type *o_ptr, cptr *resist_list)
{
- u32b flgs[TR_FLAG_SIZE];
+ BIT_FLAGS flgs[TR_FLAG_SIZE];
object_flags(o_ptr, flgs);
*/
static void analyze_immune(object_type *o_ptr, cptr *immune_list)
{
- u32b flgs[TR_FLAG_SIZE];
+ BIT_FLAGS flgs[TR_FLAG_SIZE];
object_flags(o_ptr, flgs);
*/
static void analyze_sustains(object_type *o_ptr, cptr *sustain_list)
{
- u32b flgs[TR_FLAG_SIZE];
+ BIT_FLAGS flgs[TR_FLAG_SIZE];
object_flags(o_ptr, flgs);
*/
static void analyze_misc_magic(object_type *o_ptr, cptr *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);
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));
{
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
}
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])
* @param name1 生成するアーティファクトID
* @return 生成が成功した場合TRUEを返す
*/
-static bool make_fake_artifact(object_type *o_ptr, int name1)
+static bool make_fake_artifact(object_type *o_ptr, IDX name1)
{
- int i;
-
+ 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 */
- o_ptr->name1 = name1;
+ o_ptr->name1 = (byte_hack)name1;
/* Extract the fields */
o_ptr->pval = a_ptr->pval;
*/
static void spoil_artifact(cptr fname)
{
- int i, j;
+ 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);
/* Open the file */
fff = my_fopen(buf, "w");
- /* Oops */
if (!fff)
{
msg_print("Cannot create spoiler file.");
/* 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.");
}
/* Open the file */
fff = my_fopen(buf, "w");
- /* Oops */
if (!fff)
{
msg_print("Cannot create spoiler file.");
monster_race *r_ptr = &r_info[i];
/* Use that monster */
- if (r_ptr->name) who[n++] = i;
+ if (r_ptr->name) who[n++] = (s16b)i;
}
/* Select the sort method */
/* 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))
/* Level */
- sprintf(lev, "%d", r_ptr->level);
+ sprintf(lev, "%d", (int)r_ptr->level);
/* Rarity */
- sprintf(rar, "%d", r_ptr->rarity);
+ sprintf(rar, "%d", (int)r_ptr->rarity);
/* Speed */
if (r_ptr->speed >= 110)
bool wrap = (ch == '\n');
#ifdef JP
- if (!isprint(ch) && !k_flag && !iskanji_flag) ch = ' ';
+ if (!isprint((unsigned char)ch) && !k_flag && !iskanji_flag) ch = ' ';
iskanji_flag = k_flag && !iskanji_flag;
#else
if (!isprint(ch)) ch = ' ';
#ifdef JP
k_flag_local = iskanji((unsigned char)(*tail));
- if (isprint(*tail) || k_flag_local || iskanji_flag_local) break;
+ if (isprint((unsigned char)*tail) || k_flag_local || iskanji_flag_local) break;
iskanji_flag_local = k_flag_local && !iskanji_flag_local;
#else
if (isprint(*tail)) break;
{
char buf[1024];
int i, l, n = 0;
- u32b flags1;
+ BIT_FLAGS flags1;
u16b why = 2;
s16b *who;
/* Open the file */
fff = my_fopen(buf, "w");
- /* Oops */
if (!fff)
{
msg_print("Cannot create spoiler file.");
monster_race *r_ptr = &r_info[i];
/* Use that monster */
- if (r_ptr->name) who[n++] = i;
+ if (r_ptr->name) who[n++] = (s16b)i;
}
/* Select the sort method */
}
/* Name */
- sprintf(buf, _("%s/%s (", "%s ("), (r_name + r_ptr->name),(r_name+r_ptr->E_name)); /* ---)--- */
+ sprintf(buf, _("%s/%s (", "%s ("), (r_name + r_ptr->name), _(r_name+r_ptr->E_name, "")); /* ---)--- */
spoil_out(buf);
spoil_out(buf);
/* Level */
- sprintf(buf, "Lev:%d ", r_ptr->level);
+ sprintf(buf, "Lev:%d ", (int)r_ptr->level);
spoil_out(buf);
/* Rarity */
/* Open the file */
fff = my_fopen(buf, "w");
- /* Oops */
if (!fff)
{
msg_print("Cannot create spoiler file.");
/* Trace the evolution tree */
r_ptr = &r_info[r_idx];
-#ifdef JP
- fprintf(fff, "[%d]: %s (レベル%d, '%c')\n", r_idx,
- r_name + r_ptr->name, r_ptr->level, r_ptr->d_char);
-#else
- fprintf(fff, "[%d]: %s (Level %d, '%c')\n", r_idx,
- r_name + r_ptr->name, r_ptr->level, r_ptr->d_char);
-#endif
+ fprintf(fff, _("[%d]: %s (レベル%d, '%c')\n", "[%d]: %s (Level %d, '%c')\n"),
+ r_idx, r_name + r_ptr->name, (int)r_ptr->level, r_ptr->d_char);
+
for (n = 1; r_ptr->next_exp; n++)
{
fprintf(fff, "%*s-(%ld)-> ", n * 2, "", (long int)r_ptr->next_exp);
fprintf(fff, "[%d]: ", r_ptr->next_r_idx);
r_ptr = &r_info[r_ptr->next_r_idx];
-#ifdef JP
- fprintf(fff, "%s (レベル%d, '%c')\n",
- r_name + r_ptr->name, r_ptr->level, r_ptr->d_char);
-#else
- fprintf(fff, "%s (Level %d, '%c')\n",
- r_name + r_ptr->name, r_ptr->level, r_ptr->d_char);
-#endif
+ fprintf(fff, _("%s (レベル%d, '%c')\n", "%s (Level %d, '%c')\n"),
+ r_name + r_ptr->name, (int)r_ptr->level, r_ptr->d_char);
}
/* End of evolution tree */
return;
}
- /* Message */
msg_print("Successfully created a spoiler file.");
}
prt("Create a spoiler file.", 2, 0);
/* Prompt for a file */
- prt("(1) Brief Object Info (obj-desc.spo)", 5, 5);
- prt("(2) Brief Artifact Info (artifact.spo)", 6, 5);
- prt("(3) Brief Monster Info (mon-desc.spo)", 7, 5);
- prt("(4) Full Monster Info (mon-info.spo)", 8, 5);
- prt("(5) Monster Evolution Info (mon-evol.spo)", 9, 5);
+ prt("(1) Brief Object Info (obj-desc.txt)", 5, 5);
+ prt("(2) Brief Artifact Info (artifact.txt)", 6, 5);
+ prt("(3) Brief Monster Info (mon-desc.txt)", 7, 5);
+ prt("(4) Full Monster Info (mon-info.txt)", 8, 5);
+ prt("(5) Monster Evolution Info (mon-evol.txt)", 9, 5);
/* Prompt */
prt(_("コマンド:", "Command: "), _(18, 12), 0);
/* Option (1) */
case '1':
- spoil_obj_desc("obj-desc.spo");
+ spoil_obj_desc("obj-desc.txt");
break;
/* Option (2) */
case '2':
- spoil_artifact("artifact.spo");
+ spoil_artifact("artifact.txt");
break;
/* Option (3) */
case '3':
- spoil_mon_desc("mon-desc.spo");
+ spoil_mon_desc("mon-desc.txt");
break;
/* Option (4) */
case '4':
- spoil_mon_info("mon-info.spo");
+ spoil_mon_info("mon-info.txt");
break;
/* Option (5) */
case '5':
- spoil_mon_evol("mon-evol.spo");
+ spoil_mon_evol("mon-evol.txt");
break;
- /* Oops */
default:
bell();
break;
/* Open the file */
fff = my_fopen(buf, "w");
- /* Oops */
if (!fff)
{
msg_print("Cannot create list file.");
return;
}
- /* Message */
msg_print("Successfully created a list file.");
}