* @param k ベースアイテムID
* @return なし
*/
-static void kind_info(char *buf, char *dam, char *wgt, char *chance, 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;
}
/* Chance */
- sprintf(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 ? "/" : ""), 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));
}
{
int i, k, s, t, n = 0, group_start = 0;
- u16b who[200];
+ OBJECT_IDX who[200];
char buf[1024];
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, 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, chance, &e, &v, who[s]);
/* 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 */
if (k_ptr->gen_flags & (TRG_INSTA_ART)) continue;
/* Save the index */
- who[n++] = k;
+ who[n++] = (u16b)k;
}
}
artifact_type *a_ptr = &a_info[o_ptr->name1];
#ifdef JP
- sprintf(misc_desc, "レベル %u, 希少度 %u, %d.%d kg, $%ld",
- a_ptr->level, a_ptr->rarity,
+ sprintf(misc_desc, "レベル %d, 希少度 %u, %d.%d kg, $%ld",
+ (int)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,
+ sprintf(misc_desc, "Level %d, Rarity %u, %d.%d lbs, %ld Gold",
+ (int)a_ptr->level, a_ptr->rarity,
a_ptr->weight / 10, a_ptr->weight % 10, a_ptr->cost);
#endif
}
* @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];
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;
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 */
/* 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)
cptr r;
/* Line buffer */
- static unsigned char roff_buf[256];
+ static char roff_buf[256];
/* Delay buffer */
- static unsigned char roff_waiting_buf[256];
+ static char roff_waiting_buf[256];
#ifdef JP
bool iskanji_flag = FALSE;
#endif
/* Current pointer into line roff_buf */
- static unsigned char *roff_p = roff_buf;
+ static char *roff_p = roff_buf;
/* Last space saved into roff_buf */
- static unsigned char *roff_s = NULL;
+ static char *roff_s = NULL;
/* Mega-Hack -- Delayed output */
static bool waiting_output = FALSE;
for (; *str; str++)
{
#ifdef JP
- unsigned char cbak;
+ char cbak;
bool k_flag = iskanji((unsigned char)(*str));
#endif
- unsigned char ch = *str;
+ char ch = *str;
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
bool k_flag_local;
bool iskanji_flag_local = FALSE;
- ucptr tail = str + (k_flag ? 2 : 1);
+ cptr tail = str + (k_flag ? 2 : 1);
#else
- ucptr tail = str + 1;
+ cptr tail = str + 1;
#endif
for (; *tail; tail++)
#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;
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 */
spoil_out(buf);
/* Level */
- sprintf(buf, "Lev:%d ", r_ptr->level);
+ sprintf(buf, "Lev:%d ", (int)r_ptr->level);
spoil_out(buf);
/* Rarity */
/* 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 */