OSDN Git Service

#37353 (2.2.0.23) dungeon_info_typeのm_flags5/m_flags6をm_a_ability_flags1/m_a_ability_...
[hengband/hengband.git] / src / cmd6.c
index 1a45776..cc125d5 100644 (file)
@@ -84,7 +84,7 @@ static void do_cmd_eat_food_aux(int item)
        sound(SOUND_EAT);
 
        /* Take a turn */
-       energy_use = 100;
+       p_ptr->energy_use = 100;
 
        /* Identity not known yet */
        ident = FALSE;
@@ -502,7 +502,7 @@ static void do_cmd_eat_food_aux(int item)
                        object_prep(q_ptr, lookup_kind(o_ptr->tval, o_ptr->sval));
 
                        /* Drop the object from heaven */
-                       (void)drop_near(q_ptr, -1, py, px);
+                       (void)drop_near(q_ptr, -1, p_ptr->y, p_ptr->x);
                }
                else
                {
@@ -636,7 +636,7 @@ static void do_cmd_quaff_potion_aux(int item)
 
 
        /* Take a turn */
-       energy_use = 100;
+       p_ptr->energy_use = 100;
 
        if (world_player)
        {
@@ -809,14 +809,8 @@ static void do_cmd_quaff_potion_aux(int item)
                                {
                                        msg_print(_("恐ろしい光景が頭に浮かんできた。", "A horrible vision enters your mind."));
 
-                                       /* Pick a nightmare */
-                                       get_mon_num_prep(get_nightmare, NULL);
-
                                        /* Have some nightmares */
-                                       have_nightmare(get_mon_num(MAX_DEPTH));
-
-                                       /* Remove the monster restriction */
-                                       get_mon_num_prep(NULL, NULL);
+                                       sanity_blast(NULL, FALSE);
                                }
                                if (set_paralyzed(p_ptr->paralyzed + randint0(4) + 4))
                                {
@@ -1247,7 +1241,7 @@ static void do_cmd_quaff_potion_aux(int item)
        if (prace_is_(RACE_SKELETON))
        {
                msg_print(_("液体の一部はあなたのアゴを素通りして落ちた!", "Some of the fluid falls through your jaws!"));
-               (void)potion_smash_effect(0, py, px, q_ptr->k_idx);
+               (void)potion_smash_effect(0, p_ptr->y, p_ptr->x, q_ptr->k_idx);
        }
 
        /* Combine / Reorder the pack (later) */
@@ -1406,7 +1400,7 @@ static void do_cmd_read_scroll_aux(int item, bool known)
 
 
        /* Take a turn */
-       energy_use = 100;
+       p_ptr->energy_use = 100;
 
        if (world_player)
        {
@@ -1482,7 +1476,7 @@ static void do_cmd_read_scroll_aux(int item, bool known)
                {
                        for (k = 0; k < randint1(3); k++)
                        {
-                               if (summon_specific(0, py, px, dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
+                               if (summon_specific(0, p_ptr->y, p_ptr->x, dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
                                {
                                        ident = TRUE;
                                }
@@ -1494,7 +1488,7 @@ static void do_cmd_read_scroll_aux(int item, bool known)
                {
                        for (k = 0; k < randint1(3); k++)
                        {
-                               if (summon_specific(0, py, px, dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
+                               if (summon_specific(0, p_ptr->y, p_ptr->x, dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
                                {
                                        ident = TRUE;
                                }
@@ -1504,7 +1498,7 @@ static void do_cmd_read_scroll_aux(int item, bool known)
 
                case SV_SCROLL_SUMMON_PET:
                {
-                       if (summon_specific(-1, py, px, dun_level, 0, (PM_ALLOW_GROUP | PM_FORCE_PET)))
+                       if (summon_specific(-1, p_ptr->y, p_ptr->x, dun_level, 0, (PM_ALLOW_GROUP | PM_FORCE_PET)))
                        {
                                ident = TRUE;
                        }
@@ -1513,7 +1507,7 @@ static void do_cmd_read_scroll_aux(int item, bool known)
 
                case SV_SCROLL_SUMMON_KIN:
                {
-                       if (summon_kin_player(p_ptr->lev, py, px, (PM_FORCE_PET | PM_ALLOW_GROUP)))
+                       if (summon_kin_player(p_ptr->lev, p_ptr->y, p_ptr->x, (PM_FORCE_PET | PM_ALLOW_GROUP)))
                        {
                                ident = TRUE;
                        }
@@ -1522,7 +1516,7 @@ static void do_cmd_read_scroll_aux(int item, bool known)
 
                case SV_SCROLL_TRAP_CREATION:
                {
-                       if (trap_creation(py, px)) ident = TRUE;
+                       if (trap_creation(p_ptr->y, p_ptr->x)) ident = TRUE;
                        break;
                }
 
@@ -1740,7 +1734,7 @@ static void do_cmd_read_scroll_aux(int item, bool known)
 
                case SV_SCROLL_STAR_DESTRUCTION:
                {
-                       if (destroy_area(py, px, 13 + randint0(5), FALSE))
+                       if (destroy_area(p_ptr->y, p_ptr->x, 13 + randint0(5), FALSE))
                                ident = TRUE;
                        else
                                msg_print(_("ダンジョンが揺れた...", "The dungeon trembles..."));
@@ -1793,14 +1787,14 @@ static void do_cmd_read_scroll_aux(int item, bool known)
 
                case SV_SCROLL_ACQUIREMENT:
                {
-                       acquirement(py, px, 1, TRUE, FALSE, FALSE);
+                       acquirement(p_ptr->y, p_ptr->x, 1, TRUE, FALSE, FALSE);
                        ident = TRUE;
                        break;
                }
 
                case SV_SCROLL_STAR_ACQUIREMENT:
                {
-                       acquirement(py, px, randint1(2) + 1, TRUE, FALSE, FALSE);
+                       acquirement(p_ptr->y, p_ptr->x, randint1(2) + 1, TRUE, FALSE, FALSE);
                        ident = TRUE;
                        break;
                }
@@ -1867,14 +1861,14 @@ static void do_cmd_read_scroll_aux(int item, bool known)
                case SV_SCROLL_AMUSEMENT:
                {
                        ident = TRUE;
-                       amusement(py, px, 1, FALSE);
+                       amusement(p_ptr->y, p_ptr->x, 1, FALSE);
                        break;
                }
 
                case SV_SCROLL_STAR_AMUSEMENT:
                {
                        ident = TRUE;
-                       amusement(py, px,  randint1(2) + 1, FALSE);
+                       amusement(p_ptr->y, p_ptr->x,  randint1(2) + 1, FALSE);
                        break;
                }
        }
@@ -2091,7 +2085,7 @@ static int staff_effect(int sval, bool *use_charge, bool powerful, bool magic, b
                        const int times = randint1(powerful ? 8 : 4);
                        for (k = 0; k < times; k++)
                        {
-                               if (summon_specific(0, py, px, dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
+                               if (summon_specific(0, p_ptr->y, p_ptr->x, dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
                                {
                                        ident = TRUE;
                                }
@@ -2139,7 +2133,7 @@ static int staff_effect(int sval, bool *use_charge, bool powerful, bool magic, b
                case SV_STAFF_STARLITE:
                {
                        int num = damroll(5, 3);
-                       int y, x;
+                       int y = 0, x = 0;
                        int attempts;
 
                        if (!p_ptr->blind && !magic)
@@ -2152,7 +2146,7 @@ static int staff_effect(int sval, bool *use_charge, bool powerful, bool magic, b
 
                                while (attempts--)
                                {
-                                       scatter(&y, &x, py, px, 4, 0);
+                                       scatter(&y, &x, p_ptr->y, p_ptr->x, 4, 0);
 
                                        if (!cave_have_flag_bold(y, x, FF_PROJECT)) continue;
 
@@ -2327,7 +2321,7 @@ static int staff_effect(int sval, bool *use_charge, bool powerful, bool magic, b
 
                case SV_STAFF_EARTHQUAKES:
                {
-                       if (earthquake(py, px, (powerful ? 15 : 10)))
+                       if (earthquake(p_ptr->y, p_ptr->x, (powerful ? 15 : 10)))
                                ident = TRUE;
                        else
                                msg_print(_("ダンジョンが揺れた。", "The dungeon trembles."));
@@ -2337,7 +2331,7 @@ static int staff_effect(int sval, bool *use_charge, bool powerful, bool magic, b
 
                case SV_STAFF_DESTRUCTION:
                {
-                       if (destroy_area(py, px, (powerful ? 18 : 13) + randint0(5), FALSE))
+                       if (destroy_area(p_ptr->y, p_ptr->x, (powerful ? 18 : 13) + randint0(5), FALSE))
                                ident = TRUE;
 
                        break;
@@ -2345,7 +2339,7 @@ static int staff_effect(int sval, bool *use_charge, bool powerful, bool magic, b
 
                case SV_STAFF_ANIMATE_DEAD:
                {
-                       if (animate_dead(0, py, px))
+                       if (animate_dead(0, p_ptr->y, p_ptr->x))
                                ident = TRUE;
 
                        break;
@@ -2354,7 +2348,7 @@ static int staff_effect(int sval, bool *use_charge, bool powerful, bool magic, b
                case SV_STAFF_MSTORM:
                {
                        msg_print(_("強力な魔力が敵を引き裂いた!", "Mighty magics rend your enemies!"));
-                       project(0, (powerful ? 7 : 5), py, px,
+                       project(0, (powerful ? 7 : 5), p_ptr->y, p_ptr->x,
                                (randint1(200) + (powerful ? 500 : 300)) * 2, GF_MANA, PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID, -1);
                        if ((p_ptr->pclass != CLASS_MAGE) && (p_ptr->pclass != CLASS_HIGH_MAGE) && (p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_MAGIC_EATER) && (p_ptr->pclass != CLASS_BLUE_MAGE))
                        {
@@ -2418,7 +2412,7 @@ static void do_cmd_use_staff_aux(int item)
 
 
        /* Take a turn */
-       energy_use = 100;
+       p_ptr->energy_use = 100;
 
        /* Extract the item level */
        lev = k_info[o_ptr->k_idx].level;
@@ -2923,7 +2917,7 @@ static void do_cmd_aim_wand_aux(int item)
        target_pet = old_target_pet;
 
        /* Take a turn */
-       energy_use = 100;
+       p_ptr->energy_use = 100;
 
        /* Get the level */
        lev = k_info[o_ptr->k_idx].level;
@@ -3355,7 +3349,7 @@ static void do_cmd_zap_rod_aux(int item)
 
 
        /* Take a turn */
-       energy_use = 100;
+       p_ptr->energy_use = 100;
 
        /* Extract the item level */
        lev = k_info[o_ptr->k_idx].level;
@@ -3641,7 +3635,7 @@ static void do_cmd_activate_aux(int item)
        }
 
        /* Take a turn */
-       energy_use = 100;
+       p_ptr->energy_use = 100;
 
        /* Extract the item level */
        lev = k_info[o_ptr->k_idx].level;
@@ -3710,7 +3704,7 @@ static void do_cmd_activate_aux(int item)
                ((o_ptr->sval == SV_LITE_TORCH) || (o_ptr->sval == SV_LITE_LANTERN)))
        {
                msg_print(_("燃料がない。", "It has no fuel."));
-               energy_use = 0;
+               p_ptr->energy_use = 0;
                return;
        }
 
@@ -3772,7 +3766,7 @@ static void do_cmd_activate_aux(int item)
                        for (i = 0; i < max_pet; i++)
                        {
                                pet_ctr = who[i];
-                               teleport_monster_to(pet_ctr, py, px, 100, TELEPORT_PASSIVE);
+                               teleport_monster_to(pet_ctr, p_ptr->y, p_ptr->x, 100, TELEPORT_PASSIVE);
                        }
 
                        /* Free the "who" array */
@@ -3841,11 +3835,11 @@ static void do_cmd_activate_aux(int item)
                }
                else
                {
-                       bool success = FALSE;
+                       success = FALSE;
                        if (!get_rep_dir2(&dir)) return;
-                       if (monster_can_enter(py + ddy[dir], px + ddx[dir], &r_info[o_ptr->pval], 0))
+                       if (monster_can_enter(p_ptr->y + ddy[dir], p_ptr->x + ddx[dir], &r_info[o_ptr->pval], 0))
                        {
-                               if (place_monster_aux(0, py + ddy[dir], px + ddx[dir], o_ptr->pval, (PM_FORCE_PET | PM_NO_KAGE)))
+                               if (place_monster_aux(0, p_ptr->y + ddy[dir], p_ptr->x + ddx[dir], o_ptr->pval, (PM_FORCE_PET | PM_NO_KAGE)))
                                {
                                        if (o_ptr->xtra3) m_list[hack_m_idx_ii].mspeed = o_ptr->xtra3;
                                        if (o_ptr->xtra5) m_list[hack_m_idx_ii].max_maxhp = o_ptr->xtra5;
@@ -3915,6 +3909,7 @@ static void do_cmd_activate_aux(int item)
                        if (!success)
                                msg_print(_("おっと、解放に失敗した。", "Oops.  You failed to release your pet."));
                }
+               calc_android_exp();
                return;
        }
 
@@ -4598,7 +4593,7 @@ bool do_cmd_magic_eater(bool only_browse, bool powerful)
        item = select_magic_eater(only_browse);
        if (item == -1)
        {
-               energy_use = 0;
+               p_ptr->energy_use = 0;
                return FALSE;
        }
        if (item >= EATER_EXT*2) {tval = TV_ROD;sval = item - EATER_EXT*2;}
@@ -4632,7 +4627,7 @@ bool do_cmd_magic_eater(bool only_browse, bool powerful)
                sound(SOUND_FAIL);
                if (randint1(100) >= chance)
                        chg_virtue(V_CHANCE,-1);
-               energy_use = 100;
+               p_ptr->energy_use = 100;
 
                return TRUE;
        }
@@ -4660,7 +4655,7 @@ bool do_cmd_magic_eater(bool only_browse, bool powerful)
                if (randint1(100) < chance)
                        chg_virtue(V_CHANCE,1);
        }
-       energy_use = 100;
+       p_ptr->energy_use = 100;
        if (tval == TV_ROD) p_ptr->magic_num1[item] += k_info[k_idx].pval * EATER_ROD_CHARGE;
        else p_ptr->magic_num1[item] -= EATER_CHARGE;