OSDN Git Service

[Refactor] #37353 tsuri_dir を fishing_dir に改名して player_type 構造体に移動。
[hengband/hengband.git] / src / wizard1.c
index 642b939..360a7aa 100644 (file)
@@ -80,7 +80,6 @@ static cptr attr_to_text(monster_race *r_ptr)
 #endif
        }
 
-       /* Oops */
 #ifdef JP000
        return "変な";
 #else
@@ -95,7 +94,7 @@ static cptr attr_to_text(monster_race *r_ptr)
  */
 typedef struct
 {
-       byte tval;
+       OBJECT_TYPE_VALUE tval;
        cptr name;
 } grouper;
 
@@ -234,7 +233,7 @@ static grouper group_item[] =
  * @param k ベースアイテムID
  * @return なし
  */
-static void kind_info(char *buf, char *dam, char *wgt, char *chance, DEPTH *lev, s32b *val, IDX 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;
@@ -325,14 +324,15 @@ static void kind_info(char *buf, char *dam, char *wgt, char *chance, DEPTH *lev,
                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));
 }
 
 
@@ -346,7 +346,7 @@ static void spoil_obj_desc(cptr fname)
 {
        int i, k, s, t, n = 0, group_start = 0;
 
-       u16b who[200];
+       OBJECT_IDX who[200];
 
        char buf[1024];
 
@@ -364,7 +364,6 @@ static void spoil_obj_desc(cptr fname)
        /* Open the file */
        fff = my_fopen(buf, "w");
 
-       /* Oops */
        if (!fff)
        {
                msg_print("Cannot create spoiler file.");
@@ -398,11 +397,11 @@ static void spoil_obj_desc(cptr fname)
                                                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]);
@@ -421,15 +420,15 @@ static void spoil_obj_desc(cptr fname)
                                /* 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 */
@@ -467,7 +466,6 @@ static void spoil_obj_desc(cptr fname)
                return;
        }
 
-       /* Message */
        msg_print("Successfully created a spoiler file.");
 }
 
@@ -1031,7 +1029,7 @@ static void spoiler_underline(cptr str)
  * 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)
 {
@@ -1073,7 +1071,7 @@ static void analyze_general(object_type *o_ptr, char *desc_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;
 
@@ -1129,7 +1127,7 @@ static void analyze_pval(object_type *o_ptr, pval_info_type *pi_ptr)
  */
 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);
 
@@ -1150,7 +1148,7 @@ static void analyze_slay(object_type *o_ptr, cptr *slay_list)
  */
 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);
 
@@ -1171,7 +1169,7 @@ static void analyze_brand(object_type *o_ptr, cptr *brand_list)
  */
 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);
 
@@ -1192,7 +1190,7 @@ static void analyze_resist(object_type *o_ptr, cptr *resist_list)
  */
 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);
 
@@ -1213,7 +1211,7 @@ static void analyze_immune(object_type *o_ptr, cptr *immune_list)
  */
 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);
 
@@ -1250,8 +1248,8 @@ static void analyze_sustains(object_type *o_ptr, cptr *sustain_list)
  */
 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);
@@ -1277,12 +1275,12 @@ static void analyze_misc_magic(object_type *o_ptr, cptr *misc_list)
 
        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));
@@ -1383,13 +1381,11 @@ static void analyze_misc(object_type *o_ptr, char *misc_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
 }
@@ -1648,7 +1644,6 @@ static bool make_fake_artifact(object_type *o_ptr, IDX name1)
        /* Acquire the "kind" index */
        i = lookup_kind(a_ptr->tval, a_ptr->sval);
 
-       /* Oops */
        if (!i) return (FALSE);
 
        /* Create the artifact */
@@ -1700,7 +1695,6 @@ static void spoil_artifact(cptr fname)
        /* Open the file */
        fff = my_fopen(buf, "w");
 
-       /* Oops */
        if (!fff)
        {
                msg_print("Cannot create spoiler file.");
@@ -1753,7 +1747,6 @@ static void spoil_artifact(cptr fname)
                return;
        }
 
-       /* Message */
        msg_print("Successfully created a spoiler file.");
 }
 
@@ -1790,7 +1783,6 @@ static void spoil_mon_desc(cptr fname)
        /* Open the file */
        fff = my_fopen(buf, "w");
 
-       /* Oops */
        if (!fff)
        {
                msg_print("Cannot create spoiler file.");
@@ -1838,9 +1830,9 @@ static void spoil_mon_desc(cptr fname)
 
                /* 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))
@@ -2117,7 +2109,7 @@ static void spoil_mon_info(cptr fname)
 {
        char buf[1024];
        int i, l, n = 0;
-       u32b flags1;
+       BIT_FLAGS flags1;
 
        u16b why = 2;
        s16b *who;
@@ -2131,7 +2123,6 @@ static void spoil_mon_info(cptr fname)
        /* Open the file */
        fff = my_fopen(buf, "w");
 
-       /* Oops */
        if (!fff)
        {
                msg_print("Cannot create spoiler file.");
@@ -2410,7 +2401,6 @@ static void spoil_mon_evol(cptr fname)
        /* Open the file */
        fff = my_fopen(buf, "w");
 
-       /* Oops */
        if (!fff)
        {
                msg_print("Cannot create spoiler file.");
@@ -2519,7 +2509,6 @@ static void spoil_mon_evol(cptr fname)
                return;
        }
 
-       /* Message */
        msg_print("Successfully created a spoiler file.");
 }
 
@@ -2593,7 +2582,6 @@ void do_cmd_spoilers(void)
                        spoil_mon_evol("mon-evol.txt");
                        break;
 
-               /* Oops */
                default:
                        bell();
                        break;
@@ -2736,7 +2724,6 @@ void spoil_random_artifact(cptr fname)
        /* Open the file */
        fff = my_fopen(buf, "w");
 
-       /* Oops */
        if (!fff)
        {
                msg_print("Cannot create list file.");
@@ -2788,7 +2775,6 @@ void spoil_random_artifact(cptr fname)
                return;
        }
 
-       /* Message */
        msg_print("Successfully created a list file.");
 }