OSDN Git Service

Vanillaにならって、キャラクターの状態を表わすグローバル変数の多くを
[hengband/hengband.git] / src / cmd2.c
index 047a47d..7471da3 100644 (file)
@@ -656,7 +656,7 @@ static void chest_trap(int y, int x, s16b o_idx)
                        if (randint1(100)<dun_level)
                                activate_hi_summon(py, px, FALSE);
                        else
-                               (void)summon_specific(0, y, x, mon_level, 0, TRUE, FALSE, FALSE, TRUE, TRUE);
+                               (void)summon_specific(0, y, x, mon_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
                }
        }
 
@@ -670,7 +670,7 @@ static void chest_trap(int y, int x, s16b o_idx)
 #endif
                for (i = 0; i < randint1(3) + 5; i++)
                {
-                       (void)summon_specific(0, y, x, mon_level, SUMMON_ELEMENTAL, TRUE, FALSE, FALSE, TRUE, TRUE);
+                       (void)summon_specific(0, y, x, mon_level, SUMMON_ELEMENTAL, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
                }
        }
 
@@ -688,7 +688,7 @@ static void chest_trap(int y, int x, s16b o_idx)
 
                for (i = 0; i < randint1(5) + o_ptr->pval / 5; i++)
                {
-                       (void)summon_specific(0, y, x, mon_level, SUMMON_BIRD, TRUE, FALSE, FALSE, TRUE, TRUE);
+                       (void)summon_specific(0, y, x, mon_level, SUMMON_BIRD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
                }
        }
 
@@ -707,7 +707,7 @@ static void chest_trap(int y, int x, s16b o_idx)
                        for (i = 0; i < randint1(3) + 2; i++)
                        {
                                (void)fire_meteor(-1, GF_FIRE, y, x, 10, 5);
-                               (void)summon_specific(0, y, x, mon_level, SUMMON_DEMON, TRUE, FALSE, FALSE, TRUE, TRUE);
+                               (void)summon_specific(0, y, x, mon_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
                        }
                }
 
@@ -722,7 +722,7 @@ static void chest_trap(int y, int x, s16b o_idx)
 
                        for (i = 0; i < randint1(3) + 2; i++)
                        {
-                               (void)summon_specific(0, y, x, mon_level, SUMMON_DRAGON, TRUE, FALSE, FALSE, TRUE, TRUE);
+                               (void)summon_specific(0, y, x, mon_level, SUMMON_DRAGON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
                        }
                }
 
@@ -737,7 +737,7 @@ static void chest_trap(int y, int x, s16b o_idx)
 
                        for (i = 0; i < randint1(5) + 3; i++)
                        {
-                               (void)summon_specific(0, y, x, mon_level, SUMMON_HYBRID, TRUE, FALSE, FALSE, TRUE, TRUE);
+                               (void)summon_specific(0, y, x, mon_level, SUMMON_HYBRID, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
                        }
                }
 
@@ -752,7 +752,7 @@ static void chest_trap(int y, int x, s16b o_idx)
 
                        for (i = 0; i < randint1(3) + 2; i++)
                        {
-                               (void)summon_specific(0, y, x, mon_level, SUMMON_VORTEX, TRUE, FALSE, FALSE, TRUE, TRUE);
+                               (void)summon_specific(0, y, x, mon_level, SUMMON_VORTEX, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
                        }
                }
        }
@@ -1502,8 +1502,6 @@ static bool twall(int y, int x, byte feat)
 
        /* Forget the wall */
        c_ptr->info &= ~(CAVE_MARK);
-       c_ptr->info &= ~(CAVE_MASK);
-       c_ptr->info |= (CAVE_FLOOR);
 
        /* Remove the feature */
        cave_set_feat(y, x, feat);
@@ -2251,8 +2249,6 @@ static bool do_cmd_disarm_aux(int y, int x, int dir)
 
                /* Remove the trap */
                c_ptr->feat = floor_type[randint0(100)];
-               c_ptr->info &= ~(CAVE_MASK);
-               c_ptr->info |= CAVE_FLOOR;
                note_spot(y, x);
                lite_spot(y, x);
 
@@ -3062,7 +3058,7 @@ void do_cmd_stay(int pickup)
 
                energy_use = 0;
                /* Hack -- enter store */
-               command_new = 253;
+               command_new = SPECIAL_KEY_STORE;
        }
 
        /* Hack -- enter a building if we are on one -KMW- */
@@ -3074,7 +3070,7 @@ void do_cmd_stay(int pickup)
 
                energy_use = 0;
                /* Hack -- enter building */
-               command_new = 254;
+               command_new = SPECIAL_KEY_BUILDING;
        }
 
        /* Exit a quest if reach the quest exit */
@@ -3243,7 +3239,7 @@ static int breakage_chance(object_type *o_ptr)
 }
 
 
-s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
+static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
 {
        int mult = 10;
 
@@ -3571,9 +3567,9 @@ void do_cmd_fire_aux(int item, object_type *j_ptr)
        /* Actually "fire" the object */
        bonus = (p_ptr->to_h_b + o_ptr->to_h + j_ptr->to_h);
        if ((j_ptr->sval == SV_LIGHT_XBOW) || (j_ptr->sval == SV_HEAVY_XBOW))
-               chance = (p_ptr->skill_thb + ((weapon_exp[0][j_ptr->sval])/400 + bonus) * BTH_PLUS_ADJ);
+               chance = (p_ptr->skill_thb + ((p_ptr->weapon_exp[0][j_ptr->sval])/400 + bonus) * BTH_PLUS_ADJ);
        else
-               chance = (p_ptr->skill_thb + ((weapon_exp[0][j_ptr->sval]-4000)/200 + bonus) * BTH_PLUS_ADJ);
+               chance = (p_ptr->skill_thb + ((p_ptr->weapon_exp[0][j_ptr->sval]-4000)/200 + bonus) * BTH_PLUS_ADJ);
 
        energy_use = bow_energy(j_ptr->sval);
        tmul = bow_tmul(j_ptr->sval);
@@ -3725,7 +3721,7 @@ void do_cmd_fire_aux(int item, object_type *j_ptr)
 
                        if ((r_ptr->level + 10) > p_ptr->lev)
                        {
-                               int now_exp = weapon_exp[0][j_ptr->sval];
+                               int now_exp = p_ptr->weapon_exp[0][j_ptr->sval];
                                if (now_exp < s_info[p_ptr->pclass].w_max[0][j_ptr->sval])
                                {
                                        int amount = 0;
@@ -3733,16 +3729,16 @@ void do_cmd_fire_aux(int item, object_type *j_ptr)
                                        else if (now_exp <  6000) amount = 25;
                                        else if ((now_exp < 7000) && (p_ptr->lev > 19)) amount = 10;
                                        else if (p_ptr->lev > 34) amount = 2;
-                                       weapon_exp[0][j_ptr->sval] += amount;
+                                       p_ptr->weapon_exp[0][j_ptr->sval] += amount;
                                        p_ptr->update |= (PU_BONUS);
                                }
                        }
 
                        if (p_ptr->riding)
                        {
-                               if (skill_exp[GINOU_RIDING] < s_info[p_ptr->pclass].s_max[GINOU_RIDING] && ((skill_exp[GINOU_RIDING] - 1000) / 200 < r_info[m_list[p_ptr->riding].r_idx].level) && one_in_(2))
+                               if (p_ptr->skill_exp[GINOU_RIDING] < s_info[p_ptr->pclass].s_max[GINOU_RIDING] && ((p_ptr->skill_exp[GINOU_RIDING] - 1000) / 200 < r_info[m_list[p_ptr->riding].r_idx].level) && one_in_(2))
                                {
-                                       skill_exp[GINOU_RIDING]+=1;
+                                       p_ptr->skill_exp[GINOU_RIDING]+=1;
                                        p_ptr->update |= (PU_BONUS);
                                }
                        }
@@ -3832,7 +3828,7 @@ note_dies = "
                                tdam = mon_damage_mod(m_ptr, tdam, FALSE);
 
                                /* Complex message */
-                               if (wizard || cheat_xtra)
+                               if (p_ptr->wizard || cheat_xtra)
                                {
 #ifdef JP
                                        msg_format("%d/%d ¤Î¥À¥á¡¼¥¸¤òÍ¿¤¨¤¿¡£",
@@ -4133,11 +4129,25 @@ bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken)
                msg_print("Hmmm, it seems to be cursed.");
 #endif
 
-
                /* Nope */
                return FALSE;
        }
 
+       if (p_ptr->inside_arena)
+       {
+               if (o_ptr->tval != 5)
+               {
+#ifdef JP
+                       msg_print("¥¢¥ê¡¼¥Ê¤Ç¤Ï¥¢¥¤¥Æ¥à¤ò»È¤¨¤Ê¤¤¡ª");
+#else
+                       msg_print("You're in the arena now. This is hand-to-hand!");
+#endif
+                       msg_print(NULL);
+
+                       /* Nope */
+                       return FALSE;
+               }
+       }
 
        /* Get local object */
        q_ptr = &forge;
@@ -4423,7 +4433,7 @@ note_dies = "
                                tdam = mon_damage_mod(m_ptr, tdam, FALSE);
 
                                /* Complex message */
-                               if (wizard)
+                               if (p_ptr->wizard)
                                {
 #ifdef JP
                                        msg_format("%d/%d¤Î¥À¥á¡¼¥¸¤òÍ¿¤¨¤¿¡£",
@@ -4486,8 +4496,8 @@ note_dies = "
        {
                j = 100;
 
-               if (!(summon_named_creature(y, x, q_ptr->pval, FALSE, FALSE, FALSE,
-                     (bool)!(cursed_p(q_ptr)))))
+               if (!(summon_named_creature(0, y, x, q_ptr->pval,
+                                           !(cursed_p(q_ptr)) ? PM_FORCE_PET : 0L)))
 #ifdef JP
 msg_print("¿Í·Á¤ÏDZ¤¸¶Ê¤¬¤êºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
 #else