OSDN Git Service

AM_OKAY、ホソソオカ、ユ、ヒ、キ, AM_NO_FIXED_ART、ネハムケケ.
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sun, 8 Jun 2003 15:14:35 +0000 (15:14 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sun, 8 Jun 2003 15:14:35 +0000 (15:14 +0000)
13 files changed:
src/birth.c
src/cmd2.c
src/defines.h
src/generate.c
src/grid.c
src/init1.c
src/object2.c
src/racial.c
src/rooms.c
src/spells1.c
src/store.c
src/wizard2.c
src/xtra2.c

index 1f61609..84607dd 100644 (file)
@@ -3749,7 +3749,7 @@ void player_outfit(void)
                object_prep(q_ptr, lookup_kind(TV_FLASK, SV_ANY));
 
                /* Fuel with oil (move pval to xtra4) */
-               apply_magic(q_ptr, 1, 0L);
+               apply_magic(q_ptr, 1, AM_NO_FIXED_ART);
 
                q_ptr->number = (byte)rand_range(7, 12);
                object_aware(q_ptr);
index e8f6abf..067784f 100644 (file)
@@ -440,7 +440,7 @@ static void chest_death(bool scatter, int y, int x, s16b o_idx)
        int number;
 
        bool small;
-       u32b mode = AM_OKAY | AM_GOOD;
+       u32b mode = AM_GOOD;
 
        object_type forge;
        object_type *q_ptr;
@@ -1724,7 +1724,7 @@ static bool do_cmd_tunnel_aux(int y, int x)
                        if (randint0(100) < (15 - dun_level/2))
                        {
                                /* Create a simple object */
-                               place_object(y, x, AM_OKAY);
+                               place_object(y, x, 0L);
 
                                /* Observe new object */
                                if (player_can_see_bold(y, x))
index 1d8bddf..4bb5000 100644 (file)
 /*
  * Bit flags for apply_magic() (etc)
  */
-#define AM_OKAY    0x00000001 /* Allow roll for fixed artifacts */
-#define AM_GOOD    0x00000002 /* Generate good items */
-#define AM_GREAT   0x00000004 /* Generate great items */
-#define AM_SPECIAL 0x00000008 /* Generate artifacts (for debug mode only) */
-#define AM_CURSED  0x00000010 /* Generate cursed/worthless items */
+#define AM_NO_FIXED_ART 0x00000001 /* Don't allow roll for fixed artifacts */
+#define AM_GOOD         0x00000002 /* Generate good items */
+#define AM_GREAT        0x00000004 /* Generate great items */
+#define AM_SPECIAL      0x00000008 /* Generate artifacts (for debug mode only) */
+#define AM_CURSED       0x00000010 /* Generate cursed/worthless items */
 
 
 /*** Monster blow constants ***/
index a0b3b2d..dac60fe 100644 (file)
@@ -282,7 +282,7 @@ msg_print("
 
                        case ALLOC_TYP_OBJECT:
                        {
-                               place_object(y, x, AM_OKAY);
+                               place_object(y, x, 0L);
                                break;
                        }
                }
index aa67e18..444351a 100644 (file)
@@ -295,7 +295,7 @@ msg_print("
                        /* Place an item */
                        if (randint0(100) < 75)
                        {
-                               place_object(j, k, AM_OKAY);
+                               place_object(j, k, 0L);
                        }
 
                        /* Place gold */
index e4ed438..306248e 100644 (file)
@@ -3339,7 +3339,7 @@ static errr process_dungeon_file_aux(char *buf, int ymin, int xmin, int ymax, in
                                 */
                                if (randint0(100) < 75)
                                {
-                                       place_object(*y, *x, AM_OKAY);
+                                       place_object(*y, *x, 0L);
                                }
                                else
                                {
@@ -3354,11 +3354,11 @@ static errr process_dungeon_file_aux(char *buf, int ymin, int xmin, int ymax, in
 
                                /* Create an out of deep object */
                                if (randint0(100) < 75)
-                                       place_object(*y, *x, AM_OKAY);
+                                       place_object(*y, *x, 0L);
                                else if (randint0(100) < 80)
-                                       place_object(*y, *x, AM_OKAY | AM_GOOD);
+                                       place_object(*y, *x, AM_GOOD);
                                else
-                                       place_object(*y, *x, AM_OKAY | AM_GOOD | AM_GREAT);
+                                       place_object(*y, *x, AM_GOOD | AM_GREAT);
 
                                object_level = base_level;
                        }
@@ -3389,7 +3389,7 @@ static errr process_dungeon_file_aux(char *buf, int ymin, int xmin, int ymax, in
                                }
 
                                /* Apply magic (no messages, no artifacts) */
-                               apply_magic(o_ptr, base_level, AM_GOOD);
+                               apply_magic(o_ptr, base_level, AM_NO_FIXED_ART | AM_GOOD);
 
                                (void)drop_near(o_ptr, -1, *y, *x);
                        }
index 7992d0e..1294cb3 100644 (file)
@@ -4240,7 +4240,7 @@ void apply_magic(object_type *o_ptr, int lev, u32b mode)
        if (mode & (AM_GREAT | AM_SPECIAL)) rolls = 4;
 
        /* Hack -- Get no rolls if not allowed */
-       if (!(mode & AM_OKAY) || o_ptr->name1) rolls = 0;
+       if ((mode & AM_NO_FIXED_ART) || o_ptr->name1) rolls = 0;
 
        /* Roll for artifacts if allowed */
        for (i = 0; i < rolls; i++)
@@ -5232,7 +5232,7 @@ void acquirement(int y1, int x1, int num, bool great, bool known)
 {
        object_type *i_ptr;
        object_type object_type_body;
-       u32b mode = AM_OKAY | AM_GOOD | (great ? AM_GREAT : 0L);
+       u32b mode = AM_GOOD | (great ? AM_GREAT : 0L);
 
        /* Acquirement */
        while (num--)
index 832a767..e42acc6 100644 (file)
@@ -124,7 +124,7 @@ static bool do_cmd_archer(void)
                        q_ptr->number = (byte)rand_range(15,30);
                        object_aware(q_ptr);
                        object_known(q_ptr);
-                       apply_magic(q_ptr, p_ptr->lev, 0L);
+                       apply_magic(q_ptr, p_ptr->lev, AM_NO_FIXED_ART);
                        q_ptr->discount = 99;
 
                        (void)inven_carry(q_ptr);
@@ -185,10 +185,10 @@ static bool do_cmd_archer(void)
 
                /* Hack -- Give the player some small firestones */
                object_prep(q_ptr, lookup_kind(TV_ARROW, m_bonus(1, p_ptr->lev)+ 1));
-               q_ptr->number = (byte)rand_range(5,10);
+               q_ptr->number = (byte)rand_range(5, 10);
                object_aware(q_ptr);
                object_known(q_ptr);
-               apply_magic(q_ptr, p_ptr->lev, 0L);
+               apply_magic(q_ptr, p_ptr->lev, AM_NO_FIXED_ART);
 
                q_ptr->discount = 99;
 
@@ -242,17 +242,17 @@ static bool do_cmd_archer(void)
                else
                {
                        q_ptr = &o_list[0 - item];
-               }       
+               }
 
                /* Get local object */
                q_ptr = &forge;
 
                /* Hack -- Give the player some small firestones */
                object_prep(q_ptr, lookup_kind(TV_BOLT, m_bonus(1, p_ptr->lev)+1));
-               q_ptr->number = (byte)rand_range(4,8);
+               q_ptr->number = (byte)rand_range(4, 8);
                object_aware(q_ptr);
                object_known(q_ptr);
-               apply_magic(q_ptr, p_ptr->lev, 0L);
+               apply_magic(q_ptr, p_ptr->lev, AM_NO_FIXED_ART);
 
                q_ptr->discount = 99;
 
index 027954f..86435d2 100644 (file)
@@ -745,7 +745,7 @@ static void build_type3(int by0, int bx0)
                        }
 
                        /* Place a treasure in the vault */
-                       place_object(yval, xval, AM_OKAY);
+                       place_object(yval, xval, 0L);
 
                        /* Let's guard the treasure well */
                        vault_monsters(yval, xval, randint0(2) + 3);
@@ -961,7 +961,7 @@ static void build_type4(int by0, int bx0)
                        /* Object (80%) */
                        if (randint0(100) < 80)
                        {
-                               place_object(yval, xval, AM_OKAY);
+                               place_object(yval, xval, 0L);
                        }
 
                        /* Stairs (20%) */
@@ -1044,8 +1044,8 @@ static void build_type4(int by0, int bx0)
                                vault_monsters(yval, xval + 2, randint1(2));
 
                                /* Objects */
-                               if (one_in_(3)) place_object(yval, xval - 2, AM_OKAY);
-                               if (one_in_(3)) place_object(yval, xval + 2, AM_OKAY);
+                               if (one_in_(3)) place_object(yval, xval - 2, 0L);
+                               if (one_in_(3)) place_object(yval, xval + 2, 0L);
                        }
 
                        break;
@@ -2515,7 +2515,7 @@ static void build_vault(int yval, int xval, int ymax, int xmax, cptr data,
                        case '*':
                                if (randint0(100) < 75)
                                {
-                                       place_object(y, x, AM_OKAY);
+                                       place_object(y, x, 0L);
                                }
                                else
                                {
@@ -2571,7 +2571,7 @@ static void build_vault(int yval, int xval, int ymax, int xmax, cptr data,
                        case 'A':
                                /* Reward for Pattern walk */
                                object_level = base_level + 12;
-                               place_object(y, x, AM_OKAY | AM_GOOD);
+                               place_object(y, x, AM_GOOD);
                                object_level = base_level;
                                break;
                        }
@@ -2636,7 +2636,7 @@ static void build_vault(int yval, int xval, int ymax, int xmax, cptr data,
                                        place_monster(y, x, PM_ALLOW_SLEEP);
                                        monster_level = base_level;
                                        object_level = base_level + 7;
-                                       place_object(y, x, AM_OKAY | AM_GOOD);
+                                       place_object(y, x, AM_GOOD);
                                        object_level = base_level;
                                        break;
                                }
@@ -2648,7 +2648,7 @@ static void build_vault(int yval, int xval, int ymax, int xmax, cptr data,
                                        place_monster(y, x, PM_ALLOW_SLEEP);
                                        monster_level = base_level;
                                        object_level = base_level + 20;
-                                       place_object(y, x, AM_OKAY | AM_GOOD | AM_GREAT);
+                                       place_object(y, x, AM_GOOD | AM_GREAT);
                                        object_level = base_level;
                                        break;
                                }
@@ -2665,7 +2665,7 @@ static void build_vault(int yval, int xval, int ymax, int xmax, cptr data,
                                        if (randint0(100) < 50)
                                        {
                                                object_level = base_level + 7;
-                                               place_object(y, x, AM_OKAY);
+                                               place_object(y, x, 0L);
                                                object_level = base_level;
                                        }
                                        break;
@@ -3892,7 +3892,7 @@ static void fill_treasure(int x1, int x2, int y1, int y2, int difficulty)
                                        place_monster(y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
                                        monster_level = base_level;
                                        object_level = base_level + 20;
-                                       place_object(y, x, AM_OKAY | AM_GOOD);
+                                       place_object(y, x, AM_GOOD);
                                        object_level = base_level;
                                }
                                else if (value < 5)
@@ -3902,7 +3902,7 @@ static void fill_treasure(int x1, int x2, int y1, int y2, int difficulty)
                                        place_monster(y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
                                        monster_level = base_level;
                                        object_level = base_level + 10;
-                                       place_object(y, x, AM_OKAY | AM_GOOD);
+                                       place_object(y, x, AM_GOOD);
                                        object_level = base_level;
                                }
                                else if (value < 10)
@@ -3928,7 +3928,7 @@ static void fill_treasure(int x1, int x2, int y1, int y2, int difficulty)
                                        /* Object or trap */
                                        if (randint0(100) < 25)
                                        {
-                                               place_object(y, x, AM_OKAY);
+                                               place_object(y, x, 0L);
                                        }
                                        else
                                        {
@@ -3955,7 +3955,7 @@ static void fill_treasure(int x1, int x2, int y1, int y2, int difficulty)
                                        if (randint0(100) < 50)
                                        {
                                                object_level = base_level + 7;
-                                               place_object(y, x, AM_OKAY);
+                                               place_object(y, x, 0L);
                                                object_level = base_level;
                                        }
                                }
@@ -3979,7 +3979,7 @@ static void fill_treasure(int x1, int x2, int y1, int y2, int difficulty)
                                        }
                                        else if (randint0(100) < 50)
                                        {
-                                               place_object(y, x, AM_OKAY);
+                                               place_object(y, x, 0L);
                                        }
                                }
 
@@ -5314,7 +5314,7 @@ static void build_type12(int by0, int bx0)
                build_small_room(x0, y0);
 
                /* Place a treasure in the vault */
-               place_object(y0, x0, AM_OKAY);
+               place_object(y0, x0, 0L);
 
                /* Let's guard the treasure well */
                vault_monsters(y0, x0, randint0(2) + 3);
index 2a198b1..b4e038f 100644 (file)
@@ -968,8 +968,8 @@ msg_print("
                                                obvious = TRUE;
                                        }
 
-                                       /* Place gold */
-                                       place_object(y, x, AM_OKAY);
+                                       /* Place object */
+                                       place_object(y, x, 0L);
                                }
                        }
 
index 7b0385c..800e832 100644 (file)
@@ -1923,7 +1923,7 @@ static void store_create(void)
                object_prep(q_ptr, i);
 
                /* Apply some "low-level" magic (no artifacts) */
-               apply_magic(q_ptr, level, 0L);
+               apply_magic(q_ptr, level, AM_NO_FIXED_ART);
 
                /* Require valid object */
                if (!store_will_buy(q_ptr)) continue;
index f9cc28d..ba5b81a 100644 (file)
@@ -917,42 +917,42 @@ static void wiz_reroll_item(object_type *o_ptr)
                        case 'w': case 'W':
                        {
                                object_prep(q_ptr, o_ptr->k_idx);
-                               apply_magic(q_ptr, dun_level, AM_GOOD | AM_GREAT | AM_CURSED);
+                               apply_magic(q_ptr, dun_level, AM_NO_FIXED_ART | AM_GOOD | AM_GREAT | AM_CURSED);
                                break;
                        }
                        /* Apply bad magic, but first clear object */
                        case 'c': case 'C':
                        {
                                object_prep(q_ptr, o_ptr->k_idx);
-                               apply_magic(q_ptr, dun_level, AM_GOOD | AM_CURSED);
+                               apply_magic(q_ptr, dun_level, AM_NO_FIXED_ART | AM_GOOD | AM_CURSED);
                                break;
                        }
                        /* Apply normal magic, but first clear object */
                        case 'n': case 'N':
                        {
                                object_prep(q_ptr, o_ptr->k_idx);
-                               apply_magic(q_ptr, dun_level, 0L);
+                               apply_magic(q_ptr, dun_level, AM_NO_FIXED_ART);
                                break;
                        }
                        /* Apply good magic, but first clear object */
                        case 'g': case 'G':
                        {
                                object_prep(q_ptr, o_ptr->k_idx);
-                               apply_magic(q_ptr, dun_level, AM_GOOD);
+                               apply_magic(q_ptr, dun_level, AM_NO_FIXED_ART | AM_GOOD);
                                break;
                        }
                        /* Apply great magic, but first clear object */
                        case 'e': case 'E':
                        {
                                object_prep(q_ptr, o_ptr->k_idx);
-                               apply_magic(q_ptr, dun_level, AM_GOOD | AM_GREAT);
+                               apply_magic(q_ptr, dun_level, AM_NO_FIXED_ART | AM_GOOD | AM_GREAT);
                                break;
                        }
                        /* Apply special magic, but first clear object */
                        case 's': case 'S':
                        {
                                object_prep(q_ptr, o_ptr->k_idx);
-                               apply_magic(q_ptr, dun_level, AM_OKAY | AM_GOOD | AM_GREAT | AM_SPECIAL);
+                               apply_magic(q_ptr, dun_level, AM_GOOD | AM_GREAT | AM_SPECIAL);
 
                                /* Failed to create artifact; make a random one */
                                if (!artifact_p(q_ptr) && !q_ptr->art_name) create_artifact(q_ptr, FALSE);
@@ -1031,17 +1031,17 @@ static void wiz_statistics(object_type *o_ptr)
 
                if (ch == 'n' || ch == 'N')
                {
-                       mode = AM_OKAY;
+                       mode = 0L;
                        quality = "normal";
                }
                else if (ch == 'g' || ch == 'G')
                {
-                       mode = AM_OKAY | AM_GOOD;
+                       mode = AM_GOOD;
                        quality = "good";
                }
                else if (ch == 'e' || ch == 'E')
                {
-                       mode = AM_OKAY | AM_GOOD | AM_GREAT;
+                       mode = AM_GOOD | AM_GREAT;
                        quality = "excellent";
                }
                else
@@ -1416,7 +1416,7 @@ static void wiz_create_item(void)
        object_prep(q_ptr, k_idx);
 
        /* Apply magic */
-       apply_magic(q_ptr, dun_level, 0L);
+       apply_magic(q_ptr, dun_level, AM_NO_FIXED_ART);
 
        /* Drop the object from heaven */
        (void)drop_near(q_ptr, -1, py, px);
index a478cfd..1a0d72f 100644 (file)
@@ -606,7 +606,7 @@ msg_print("
                        object_wipe(q_ptr);
 
                        /* Make a great object */
-                       make_object(q_ptr, AM_OKAY | AM_GOOD | AM_GREAT);
+                       make_object(q_ptr, AM_GOOD | AM_GREAT);
 
                        /* Drop it in the dungeon */
                        (void)drop_near(q_ptr, -1, y, x);
@@ -643,7 +643,7 @@ void monster_death(int m_idx, bool drop_item)
 
        bool visible = (m_ptr->ml || (r_ptr->flags1 & RF1_UNIQUE));
 
-       u32b mo_mode = AM_OKAY;
+       u32b mo_mode = 0L;
 
        bool do_gold = (!(r_ptr->flags1 & RF1_ONLY_ITEM));
        bool do_item = (!(r_ptr->flags1 & RF1_ONLY_GOLD));
@@ -741,7 +741,7 @@ msg_print("
                        /* Prepare to make a prize */
                        object_prep(q_ptr, lookup_kind(arena_info[p_ptr->arena_number].tval, arena_info[p_ptr->arena_number].sval));
 
-                       apply_magic(q_ptr, object_level, 0L);
+                       apply_magic(q_ptr, object_level, AM_NO_FIXED_ART);
 
                        /* Drop it in the dungeon */
                        (void)drop_near(q_ptr, -1, y, x);
@@ -802,7 +802,7 @@ msg_print("
                /* Prepare to make an object */
                object_prep(q_ptr, lookup_kind(TV_CORPSE, (corpse ? SV_CORPSE : SV_SKELETON)));
 
-               apply_magic(q_ptr, object_level, 0L);
+               apply_magic(q_ptr, object_level, AM_NO_FIXED_ART);
 
                q_ptr->pval = m_ptr->r_idx;
 
@@ -855,7 +855,7 @@ msg_print("
                        /* Prepare to make a Blade of Chaos */
                        object_prep(q_ptr, lookup_kind(TV_SWORD, SV_BLADE_OF_CHAOS));
 
-                       apply_magic(q_ptr, object_level, 0L);
+                       apply_magic(q_ptr, object_level, AM_NO_FIXED_ART);
 
                        /* Drop it in the dungeon */
                        (void)drop_near(q_ptr, -1, y, x);
@@ -881,7 +881,7 @@ msg_print("
                        get_obj_num_prep();
 
                        /* Make a book */
-                       make_object(q_ptr, AM_OKAY);
+                       make_object(q_ptr, 0L);
 
                        /* Drop it in the dungeon */
                        (void)drop_near(q_ptr, -1, y, x);
@@ -983,7 +983,7 @@ msg_print("
                q_ptr->name1 = ART_GROND;
 
                /* Mega-Hack -- Actually create "Grond" */
-               apply_magic(q_ptr, -1, AM_OKAY | AM_GOOD | AM_GREAT);
+               apply_magic(q_ptr, -1, AM_GOOD | AM_GREAT);
 
                /* Drop it in the dungeon */
                (void)drop_near(q_ptr, -1, y, x);
@@ -998,7 +998,7 @@ msg_print("
                q_ptr->name1 = ART_CHAOS;
 
                /* Mega-Hack -- Actually create "Chaos" */
-               apply_magic(q_ptr, -1, AM_OKAY | AM_GOOD | AM_GREAT);
+               apply_magic(q_ptr, -1, AM_GOOD | AM_GREAT);
 
                /* Drop it in the dungeon */
                (void)drop_near(q_ptr, -1, y, x);
@@ -1029,7 +1029,7 @@ msg_print("
                        /* Prepare to make a Can of Toys */
                        object_prep(q_ptr, lookup_kind(TV_CHEST, SV_CHEST_KANDUME));
 
-                       apply_magic(q_ptr, object_level, 0L);
+                       apply_magic(q_ptr, object_level, AM_NO_FIXED_ART);
 
                        /* Drop it in the dungeon */
                        (void)drop_near(q_ptr, -1, y, x);
@@ -1064,7 +1064,7 @@ msg_print("
                                get_obj_num_prep();
 
                                /* Make a cloak */
-                               make_object(q_ptr, AM_OKAY);
+                               make_object(q_ptr, 0L);
 
                                /* Drop it in the dungeon */
                                (void)drop_near(q_ptr, -1, y, x);
@@ -1087,7 +1087,7 @@ msg_print("
                                get_obj_num_prep();
 
                                /* Make a poleweapon */
-                               make_object(q_ptr, AM_OKAY);
+                               make_object(q_ptr, 0L);
 
                                /* Drop it in the dungeon */
                                (void)drop_near(q_ptr, -1, y, x);
@@ -1110,7 +1110,7 @@ msg_print("
                                get_obj_num_prep();
 
                                /* Make a hard armor */
-                               make_object(q_ptr, AM_OKAY);
+                               make_object(q_ptr, 0L);
 
                                /* Drop it in the dungeon */
                                (void)drop_near(q_ptr, -1, y, x);
@@ -1133,7 +1133,7 @@ msg_print("
                                get_obj_num_prep();
 
                                /* Make a sword */
-                               make_object(q_ptr, AM_OKAY);
+                               make_object(q_ptr, 0L);
 
                                /* Drop it in the dungeon */
                                (void)drop_near(q_ptr, -1, y, x);
@@ -1357,7 +1357,7 @@ msg_print("
                                /* Prepare to make a reward */
                                object_prep(q_ptr, k_idx);
 
-                               apply_magic(q_ptr, object_level, AM_GOOD);
+                               apply_magic(q_ptr, object_level, AM_NO_FIXED_ART | AM_GOOD);
 
                                /* Drop it in the dungeon */
                                (void)drop_near(q_ptr, -1, y, x);