OSDN Git Service

GF_ICE属性の攻撃に対し、目には目を等の反撃ダメージが発動しないバグを修正。
[hengband/hengband.git] / src / cmd6.c
index b7af32b..059f0ea 100644 (file)
@@ -59,6 +59,9 @@ static void do_cmd_eat_food_aux(int item)
        int ident, lev;
        object_type *o_ptr;
 
+       if (music_singing_any()) stop_singing();
+       if (hex_spelling_any()) stop_hex_spell_all();
+
        /* Get the item (in the pack) */
        if (item >= 0)
        {
@@ -726,9 +729,10 @@ static void do_cmd_quaff_potion_aux(int item)
                return;
        }
 
-       if((p_ptr->pclass == CLASS_BARD) && p_ptr->magic_num1[0])
+       if (music_singing_any()) stop_singing();
+       if (hex_spelling_any())
        {
-               stop_singing();
+               if (!hex_spelling(HEX_INHAIL)) stop_hex_spell_all();
        }
 
        /* Get the item (in the pack) */
@@ -884,11 +888,11 @@ static void do_cmd_quaff_potion_aux(int item)
                                        ident = TRUE;
                                        if (one_in_(3)) lose_all_info();
                                        else wiz_dark();
-                                       teleport_player(100, TRUE);
+                                       (void)teleport_player_aux(100, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
                                        wiz_dark();
 #ifdef JP
-msg_print("ÃΤé¤Ê¤¤¾ì½ê¤ÇÌܤ¬Àä᤿¡£Æ¬Äˤ¬¤¹¤ë¡£");
-msg_print("²¿¤â»×¤¤½Ð¤»¤Ê¤¤¡£¤É¤¦¤ä¤Ã¤Æ¤³¤³¤ØÍ褿¤Î¤«¤âʬ¤«¤é¤Ê¤¤¡ª");
+                                       msg_print("ÃΤé¤Ê¤¤¾ì½ê¤ÇÌܤ¬Àä᤿¡£Æ¬Äˤ¬¤¹¤ë¡£");
+                                       msg_print("²¿¤â»×¤¤½Ð¤»¤Ê¤¤¡£¤É¤¦¤ä¤Ã¤Æ¤³¤³¤ØÍ褿¤Î¤«¤âʬ¤«¤é¤Ê¤¤¡ª");
 #else
                                        msg_print("You wake up somewhere with a sore head...");
                                        msg_print("You can't remember a thing, or how you got here!");
@@ -1472,7 +1476,7 @@ msg_print("
                                set_food(p_ptr->food + ((o_ptr->pval) / 20));
                                break;
                        case RACE_ANDROID:
-                               if (o_ptr->tval == TV_FLASK)
+                               if (q_ptr->tval == TV_FLASK)
                                {
 #ifdef JP
                                        msg_print("¥ª¥¤¥ë¤òÊäµë¤·¤¿¡£");
@@ -1615,10 +1619,10 @@ static void do_cmd_read_scroll_aux(int item, bool known)
                return;
        }
 
-       if((p_ptr->pclass == CLASS_BARD) && p_ptr->magic_num1[0])
-       {
-               stop_singing();
-       }
+       if (music_singing_any()) stop_singing();
+
+       /* Hex */
+       if (hex_spelling_any() && ((p_ptr->lev < 35) || hex_spell_fully())) stop_hex_spell_all();
 
        /* Not identified yet */
        ident = FALSE;
@@ -1665,7 +1669,14 @@ static void do_cmd_read_scroll_aux(int item, bool known)
 
                case SV_SCROLL_CURSE_WEAPON:
                {
-                       if (curse_weapon(FALSE, INVEN_RARM)) ident = TRUE;
+                       k = 0;
+                       if (buki_motteruka(INVEN_RARM))
+                       {
+                               k = INVEN_RARM;
+                               if (buki_motteruka(INVEN_LARM) && one_in_(2)) k = INVEN_LARM;
+                       }
+                       else if (buki_motteruka(INVEN_LARM)) k = INVEN_LARM;
+                       if (k && curse_weapon(FALSE, k)) ident = TRUE;
                        break;
                }
 
@@ -1719,14 +1730,14 @@ static void do_cmd_read_scroll_aux(int item, bool known)
 
                case SV_SCROLL_PHASE_DOOR:
                {
-                       teleport_player(10, FALSE);
+                       teleport_player(10, 0L);
                        ident = TRUE;
                        break;
                }
 
                case SV_SCROLL_TELEPORT:
                {
-                       teleport_player(100, FALSE);
+                       teleport_player(100, 0L);
                        ident = TRUE;
                        break;
                }
@@ -2370,7 +2381,7 @@ static int staff_effect(int sval, bool *use_charge, bool magic, bool known)
 
                case SV_STAFF_TELEPORTATION:
                {
-                       teleport_player(100, FALSE);
+                       teleport_player(100, 0L);
                        ident = TRUE;
                        break;
                }
@@ -2431,7 +2442,7 @@ static int staff_effect(int sval, bool *use_charge, bool magic, bool known)
                                {
                                        scatter(&y, &x, py, px, 4, 0);
 
-                                       if (!have_flag(f_flags_bold(y, x), FF_PROJECT)) continue;
+                                       if (!cave_have_flag_bold(y, x, FF_PROJECT)) continue;
 
                                        if (!player_bold(y, x)) break;
                                }
@@ -4194,7 +4205,7 @@ static void do_cmd_activate_aux(int item)
                        case ART_GALADRIEL:
                        {
 #ifdef JP
-                               msg_print("ààÎÜÉÓ¤«¤éÀ¡¤ó¤À¸÷¤¬¤¢¤Õ¤ì½Ð¤¿...");
+                               msg_print("ààÍþÉÓ¤«¤éÀ¡¤ó¤À¸÷¤¬¤¢¤Õ¤ì½Ð¤¿...");
 #else
                                msg_print("The phial wells with clear light...");
 #endif
@@ -4401,7 +4412,7 @@ msg_print("
                                        {
                                                scatter(&y, &x, py, px, 4, 0);
 
-                                               if (!have_flag(f_flags_bold(y, x), FF_PROJECT)) continue;
+                                               if (!cave_have_flag_bold(y, x, FF_PROJECT)) continue;
 
                                                if (!player_bold(y, x)) break;
                                        }
@@ -4472,6 +4483,7 @@ msg_print("ŷ
                                (void)set_stun(0);
                                (void)set_confused(0);
                                (void)set_blind(0);
+                               (void)set_afraid(0);
                                (void)set_hero(randint1(25) + 25, FALSE);
                                (void)hp_player(777);
                                o_ptr->timeout = 300;
@@ -4597,7 +4609,7 @@ msg_print("ŷ
                                msg_print("Your cloak twists space around you...");
 #endif
 
-                               teleport_player(100, FALSE);
+                               teleport_player(100, 0L);
                                o_ptr->timeout = 45;
                                break;
                        }
@@ -4615,6 +4627,18 @@ msg_print("ŷ
                                break;
                        }
 
+                       case ART_HEAVENLY_MAIDEN:
+                       {
+#ifdef JP
+                               msg_print("¥¯¥í¡¼¥¯¤¬½À¤é¤«¤¯Çò¤¯µ±¤¤¤¿...");
+#else
+                               msg_print("Your cloak glows soft white...");
+#endif
+                               if (!word_of_recall()) return;
+                               o_ptr->timeout = 200;
+                               break;
+                       }
+
                        case ART_CAMMITHRIM:
                        {
 #ifdef JP
@@ -4816,10 +4840,10 @@ msg_print("ŷ
                                switch (randint1(13))
                                {
                                case 1: case 2: case 3: case 4: case 5:
-                                       teleport_player(10, FALSE);
+                                       teleport_player(10, 0L);
                                        break;
                                case 6: case 7: case 8: case 9: case 10:
-                                       teleport_player(222, FALSE);
+                                       teleport_player(222, 0L);
                                        break;
                                case 11: case 12:
                                        (void)stair_creation();
@@ -4844,7 +4868,7 @@ if (get_check("
 
                        case ART_KAMUI:
                        {
-                               teleport_player(222, FALSE);
+                               teleport_player(222, 0L);
                                o_ptr->timeout = 25;
                                break;
                        }
@@ -5123,6 +5147,7 @@ msg_print("
                        }
 
                        case ART_BRAND:
+                       case ART_HELLFIRE:
                        {
 #ifdef JP
                                msg_print("¥¯¥í¥¹¥Ü¥¦¤¬¿¼¹È¤Ëµ±¤¤¤¿...");
@@ -5282,6 +5307,8 @@ msg_print("
 
                        case ART_BOROMIR:
                        {
+                               if (music_singing_any()) stop_singing();
+                               if (hex_spelling_any()) stop_hex_spell_all();
 #ifdef JP
                                msg_print("¤¢¤Ê¤¿¤ÏÎ϶¯¤¤ÆÍÉ÷¤ò¿á¤­ÌĤ餷¤¿¡£¼þ°Ï¤ÎŨ¤¬¿Ì¤¨¾å¤Ã¤Æ¤¤¤ë!");
 #else
@@ -5407,7 +5434,7 @@ msg_print("
                                y = py+ddy[dir];
                                x = px+ddx[dir];
                                tsuri_dir = dir;
-                               if (!have_flag(f_flags_bold(y, x), FF_WATER))
+                               if (!cave_have_flag_bold(y, x, FF_WATER))
                                {
 #ifdef JP
                                        msg_print("¤½¤³¤Ï¿åÊդǤϤʤ¤¡£");
@@ -5438,7 +5465,7 @@ msg_print("
 #ifdef JP
                                msg_print("¥à¥Á¤ò¿­¤Ð¤·¤¿¡£");
 #else
-                               msg_print("You stretched your wip.");
+                               msg_print("You stretched your whip.");
 #endif
 
                                fetch(dir, 500, TRUE);
@@ -5572,6 +5599,7 @@ msg_print("
                        case ART_MATOI:
                        case ART_AEGISFANG:
                        {
+                               (void)set_afraid(0);
                                set_hero(randint1(25)+25, FALSE);
                                hp_player(10);
                                o_ptr->timeout = randint0(30) + 30;
@@ -5614,32 +5642,12 @@ msg_print("
                        }
                        case ART_BLOOD:
                        {
-                               int dummy, i;
 #ifdef JP
                                msg_print("³ù¤¬ÌÀ¤ë¤¯µ±¤¤¤¿...");
 #else
                                msg_print("Your scythe glows brightly!");
 #endif
-                               for (i = 0; i < TR_FLAG_SIZE; i++)
-                                       o_ptr->art_flags[i] = a_info[ART_BLOOD].flags[i];
-
-                               dummy = randint1(2)+randint1(2);
-                               for (i = 0; i < dummy; i++)
-                               {
-                                       int flag = randint0(19);
-                                       if (flag == 18) add_flag(o_ptr->art_flags, TR_SLAY_HUMAN);
-                                       else add_flag(o_ptr->art_flags, TR_CHAOTIC + flag);
-                               }
-                               dummy = randint1(2);
-                               for (i = 0; i < dummy; i++)
-                                       one_resistance(o_ptr);
-                               dummy = 2;
-                               for (i = 0; i < dummy; i++)
-                               {
-                                       int tmp = randint0(11);
-                                       if (tmp < 6) add_flag(o_ptr->art_flags, TR_STR + tmp);
-                                       else add_flag(o_ptr->art_flags, TR_STEALTH + tmp - 6);
-                               }
+                               get_bloody_moon_flags(o_ptr);
                                o_ptr->timeout = 3333;
                                if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
                                p_ptr->update |= (PU_BONUS | PU_HP);
@@ -5652,6 +5660,7 @@ msg_print("
 #else
                                msg_print("You stamp. (as if you are in a ring.)");
 #endif
+                               (void)set_afraid(0);
                                (void)set_hero(randint1(20) + 20, FALSE);
                                dispel_evil(p_ptr->lev * 3);
                                o_ptr->timeout = 100 + randint1(100);
@@ -5722,6 +5731,25 @@ msg_print("
                                break;
                        }
 
+                       case ART_AESCULAPIUS:
+                       {
+#ifdef JP
+                               msg_print("Ï»¼ÜËÀ¤ÏÇ»Îп§¤Ëµ±¤¤¤Æ¤¤¤ë...");
+#else
+                               msg_print("The jo staff glows a deep green...");
+#endif
+
+                               (void)do_res_stat(A_STR);
+                               (void)do_res_stat(A_INT);
+                               (void)do_res_stat(A_WIS);
+                               (void)do_res_stat(A_DEX);
+                               (void)do_res_stat(A_CON);
+                               (void)do_res_stat(A_CHR);
+                               (void)restore_level();
+                               o_ptr->timeout = 750;
+                               break;
+                       }
+
                        case ART_NIGHT:
                        {
 #ifdef JP
@@ -5857,7 +5885,7 @@ msg_print("
 
        if (o_ptr->name2 == EGO_TRUMP)
        {
-               teleport_player(100, FALSE);
+               teleport_player(100, 0L);
                o_ptr->timeout = 50 + randint1(50);
 
                /* Window stuff */
@@ -5905,7 +5933,7 @@ msg_print("
 
        if (o_ptr->name2 == EGO_JUMP)
        {
-               teleport_player(10, FALSE);
+               teleport_player(10, 0L);
                o_ptr->timeout = 10 + randint1(10);
 
                /* Window stuff */
@@ -5922,6 +5950,9 @@ msg_print("
                /* Get a direction for breathing (or abort) */
                if (!get_aim_dir(&dir)) return;
 
+               if (music_singing_any()) stop_singing();
+               if (hex_spelling_any()) stop_hex_spell_all();
+
                /* Branch on the sub-type */
                switch (o_ptr->sval)
                {
@@ -6172,7 +6203,7 @@ msg_print("
                                break;
                        case EGO_RING_ACID_BOLT:
                                if (!get_aim_dir(&dir)) return;
-                               fire_bolt(GF_FIRE, dir, damroll(5, 8));
+                               fire_bolt(GF_ACID, dir, damroll(5, 8));
                                o_ptr->timeout = randint0(6) + 6;
                                break;
                        case EGO_RING_MANA_BOLT:
@@ -6235,6 +6266,7 @@ msg_print("
                                o_ptr->timeout = 100;
                                break;
                        case EGO_RING_BERSERKER:
+                               (void)set_afraid(0);
                                (void)set_shero(randint1(25) + 25, FALSE);
                                o_ptr->timeout = randint0(75)+75;
                                break;
@@ -6327,11 +6359,11 @@ msg_print("
                                o_ptr->timeout = 200;
                                break;
                        case EGO_AMU_JUMP:
-                               teleport_player(10, FALSE);
+                               teleport_player(10, 0L);
                                o_ptr->timeout = randint0(10) + 10;
                                break;
                        case EGO_AMU_TELEPORT:
-                               teleport_player(100, FALSE);
+                               teleport_player(100, 0L);
                                o_ptr->timeout = randint0(50) + 50;
                                break;
                        case EGO_AMU_D_DOOR:
@@ -6365,6 +6397,9 @@ msg_print("
 
        else if (o_ptr->tval == TV_WHISTLE)
        {
+               if (music_singing_any()) stop_singing();
+               if (hex_spelling_any()) stop_hex_spell_all();
+
 #if 0
                if (object_is_cursed(o_ptr))
                {
@@ -6403,7 +6438,7 @@ msg_print("
                        for (i = 0; i < max_pet; i++)
                        {
                                pet_ctr = who[i];
-                               teleport_monster_to(pet_ctr, py, px, 100);
+                               teleport_monster_to(pet_ctr, py, px, 100, TELEPORT_PASSIVE);
                        }
 
                        /* Free the "who" array */
@@ -6841,7 +6876,7 @@ static int select_magic_eater(bool only_browse)
                        prt(format(" %s staff", (menu_line == 1) ? "> " : "  "), 2, 14);
                        prt(format(" %s wand", (menu_line == 2) ? "> " : "  "), 3, 14);
                        prt(format(" %s rod", (menu_line == 3) ? "> " : "  "), 4, 14);
-                       prt("Which type of magic do you usu?", 0, 0);
+                       prt("Which type of magic do you use?", 0, 0);
 #endif
                        choice = inkey();
                        switch(choice)