OSDN Git Service

[Refactor] #37353 コメント整理 / Refactor comments.
[hengband/hengband.git] / src / wizard1.c
index 332f56c..9f622dd 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;
 
@@ -365,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.");
@@ -468,7 +466,6 @@ static void spoil_obj_desc(cptr fname)
                return;
        }
 
-       /* Message */
        msg_print("Successfully created a spoiler file.");
 }
 
@@ -1032,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)
 {
@@ -1074,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;
 
@@ -1130,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);
 
@@ -1151,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);
 
@@ -1172,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);
 
@@ -1193,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);
 
@@ -1214,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);
 
@@ -1251,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);
@@ -1260,8 +1257,7 @@ static void analyze_misc_magic(object_type *o_ptr, cptr *misc_list)
        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.
@@ -1278,12 +1274,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));
@@ -1384,13 +1380,10 @@ 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, "レベル %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 %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
 }
@@ -1428,8 +1421,7 @@ static void print_header(void)
 {
        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);
 }
 
@@ -1582,7 +1574,6 @@ static void spoiler_outlist(cptr header, cptr *list, char separator)
 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 */
@@ -1597,20 +1588,11 @@ static void spoiler_print_art(obj_desc_list *art_ptr)
        }
 
        /* 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])
@@ -1639,17 +1621,14 @@ static void spoiler_print_art(obj_desc_list *art_ptr)
 static bool make_fake_artifact(object_type *o_ptr, IDX name1)
 {
        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 */
@@ -1686,12 +1665,9 @@ static void spoil_artifact(cptr fname)
 
        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);
 
@@ -1701,7 +1677,6 @@ static void spoil_artifact(cptr fname)
        /* Open the file */
        fff = my_fopen(buf, "w");
 
-       /* Oops */
        if (!fff)
        {
                msg_print("Cannot create spoiler file.");
@@ -1732,8 +1707,6 @@ static void spoil_artifact(cptr fname)
 
                        /* Get local object */
                        q_ptr = &forge;
-
-                       /* Wipe the object */
                        object_wipe(q_ptr);
 
                        /* Attempt to "forge" the artifact */
@@ -1754,7 +1727,6 @@ static void spoil_artifact(cptr fname)
                return;
        }
 
-       /* Message */
        msg_print("Successfully created a spoiler file.");
 }
 
@@ -1791,7 +1763,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.");
@@ -1839,9 +1810,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))
@@ -2118,7 +2089,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;
@@ -2132,7 +2103,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.");
@@ -2411,7 +2381,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.");
@@ -2520,7 +2489,6 @@ static void spoil_mon_evol(cptr fname)
                return;
        }
 
-       /* Message */
        msg_print("Successfully created a spoiler file.");
 }
 
@@ -2594,7 +2562,6 @@ void do_cmd_spoilers(void)
                        spoil_mon_evol("mon-evol.txt");
                        break;
 
-               /* Oops */
                default:
                        bell();
                        break;
@@ -2737,7 +2704,6 @@ void spoil_random_artifact(cptr fname)
        /* Open the file */
        fff = my_fopen(buf, "w");
 
-       /* Oops */
        if (!fff)
        {
                msg_print("Cannot create list file.");
@@ -2789,7 +2755,6 @@ void spoil_random_artifact(cptr fname)
                return;
        }
 
-       /* Message */
        msg_print("Successfully created a list file.");
 }