OSDN Git Service

Add Doxygen comment to cmd1.c.
[hengband/hengband.git] / src / init1.c
index 892be56..f290234 100644 (file)
@@ -507,7 +507,7 @@ static cptr r_info_flags7[] =
        "SELF_LITE_2",
        "GUARDIAN",
        "CHAMELEON",
-       "KILL_EXP",
+       "XXXX4XXX",
        "TANUKI",
        "HAS_DARK_1",
        "SELF_DARK_1",
@@ -730,7 +730,7 @@ static cptr k_info_flags[] =
        "WARNING",
        "HIDE_TYPE",
        "SHOW_MODS",
-       "XXX1",
+       "SLAY_GOOD",
        "LEVITATION",
        "LITE",
        "SEE_INVIS",
@@ -750,7 +750,7 @@ static cptr k_info_flags[] =
        "BLESSED",
        "XXX3", /* Fake flag for Smith */
        "XXX4", /* Fake flag for Smith */
-       "XXX5",
+       "KILL_GOOD",
 
        "KILL_ANIMAL",
        "KILL_EVIL",
@@ -776,9 +776,28 @@ static cptr k_info_flags[] =
        "FIXED_FLAVOR",
        "ADD_L_CURSE",
        "ADD_H_CURSE",
+       "DRAIN_HP",
+       "DRAIN_MANA",
+       
+       "LITE_2",
+       "LITE_3",
+       "LITE_M1",
+       "LITE_M2",
+       "LITE_M3",
+       "LITE_FUEL",
+       
+       "CALL_ANIMAL",
+       "CALL_DEMON",
+       "CALL_DRAGON",
+       "CALL_UNDEAD",
+       "COWARDICE",
+       "LOW_MELEE",
+       "LOW_AC",
+       "LOW_MAGIC",
+       "FAST_DIGEST",
+       "SLOW_REGEN",
 };
 
-
 static cptr k_info_gen_flags[] =
 {
        "INSTA_ART",
@@ -798,7 +817,7 @@ static cptr k_info_gen_flags[] =
        "RANDOM_CURSE1",
        "RANDOM_CURSE2",
        "XTRA_DICE",
-       "XXX",
+       "POWERFUL",
        "XXX",
        "XXX",
        "XXX",
@@ -832,7 +851,7 @@ static cptr d_info_flags1[] =
        "GLASS_DOOR",
        "CAVE",
        "CAVERN",
-       "XXX",
+       "ARCADE",
        "XXX",
        "XXX",
        "XXX",
@@ -1846,6 +1865,40 @@ static errr grab_one_kind_flag(object_kind *k_ptr, cptr what)
        return (1);
 }
 
+/*
+ * Grab one activation index flag
+ */
+static byte grab_one_activation_flag(cptr what)
+{
+       int i;
+
+       for (i = 0; ; i++)
+       {
+               if (activation_info[i].flag == NULL) break;
+
+               if (streq(what, activation_info[i].flag))
+               {
+                       return activation_info[i].index;
+               }
+       }
+
+       i = atoi(what);
+        if (i > 0)
+        {
+                return ((byte) i);
+        }
+
+       /* Oops */
+#ifdef JP
+       msg_format("̤ÃΤÎȯư¡¦¥Õ¥é¥° '%s'¡£", what);
+#else
+       msg_format("Unknown activation flag '%s'.", what);
+#endif
+
+       /* Error */
+       return (0);
+}
+
 
 /*
  * Initialize the "k_info" array, by parsing an ascii "template" file
@@ -2073,6 +2126,21 @@ errr parse_k_info(char *buf, header *head)
                k_ptr->to_a =  ta;
        }
 
+       /* Hack -- Process 'U' for activation index */
+       else if (buf[0] == 'U')
+       {
+               byte n;
+               n = grab_one_activation_flag(buf + 2);
+               if (n > 0)
+               {
+                       k_ptr->act_idx = n;
+               }
+               else
+               {
+                       return (5);
+               }
+       }
+
        /* Hack -- Process 'F' for flags */
        else if (buf[0] == 'F')
        {
@@ -2139,40 +2207,6 @@ static errr grab_one_artifact_flag(artifact_type *a_ptr, cptr what)
        return (1);
 }
 
-/*
- * Grab one activation index flag
- */
-static byte grab_one_activation_flag(cptr what)
-{
-       int i;
-
-       for (i = 0; ; i++)
-       {
-               if (activation_info[i].flag == NULL) break;
-
-               if (streq(what, activation_info[i].flag))
-               {
-                       return activation_info[i].index;
-               }
-       }
-
-       i = atoi(what);
-        if (i > 0)
-        {
-                return ((byte) i);
-        }
-
-       /* Oops */
-#ifdef JP
-       msg_format("̤ÃΤÎȯư¡¦¥Õ¥é¥° '%s'¡£", what);
-#else
-       msg_format("Unknown activation flag '%s'.", what);
-#endif
-
-       /* Error */
-       return (0);
-}
-
 
 /*
  * Initialize the "a_info" array, by parsing an ascii "template" file
@@ -2811,6 +2845,23 @@ errr parse_r_info(char *buf, header *head)
                r_ptr->next_r_idx = nextmon;
        }
 
+       /* Process 'R' for "Reinforcement" (up to six lines) */
+       else if (buf[0] == 'R')
+       {
+               int id, ds, dd;
+               /* Find the next empty blow slot (if any) */
+               for (i = 0; i < 6; i++) if (r_ptr->reinforce_id[i] == 0) break;
+
+               /* Oops, no more slots */
+               if (i == 6) return (1);
+
+               /* Scan for the values */
+               if (3 != sscanf(buf+2, "%d:%dd%d", &id, &dd, &ds)) return (1);
+               r_ptr->reinforce_id[i] = id;
+               r_ptr->reinforce_dd[i] = dd;
+               r_ptr->reinforce_ds[i] = ds;
+       }
+
        /* Process 'B' for "Blows" (up to four lines) */
        else if (buf[0] == 'B')
        {
@@ -3732,7 +3783,7 @@ static errr process_dungeon_file_aux(char *buf, int ymin, int xmin, int ymax, in
        if (!buf[0]) return (0);
 
        /* Skip "blank" lines */
-       if (isspace(buf[0])) return (0);
+       if (iswspace(buf[0])) return (0);
 
        /* Skip comments */
        if (buf[0] == '#') return (0);
@@ -4221,7 +4272,7 @@ static cptr process_dungeon_file_expr(char **sp, char *fp)
        s = (*sp);
 
        /* Skip spaces */
-       while (isspace(*s)) s++;
+       while (iswspace(*s)) s++;
 
        /* Save start */
        b = s;
@@ -4571,7 +4622,7 @@ errr process_dungeon_file(cptr name, int ymin, int xmin, int ymax, int xmax)
                if (!buf[0]) continue;
 
                /* Skip "blank" lines */
-               if (isspace(buf[0])) continue;
+               if (iswspace(buf[0])) continue;
 
                /* Skip comments */
                if (buf[0] == '#') continue;
@@ -4834,7 +4885,7 @@ void write_r_info_txt(void)
                        /* Start the line */
                        sprintf(buf, "D:");
 
-                       for (bc = 0, t = buf + 2; ((bc < 60) || !isspace(desc[j])) && (j < dlen); j++, bc++, t++)
+                       for (bc = 0, t = buf + 2; ((bc < 60) || !iswspace(desc[j])) && (j < dlen); j++, bc++, t++)
                        {
                                *t = desc[j];
                        }