OSDN Git Service

呪文の巻物の効果がスナイパーにも一部付加されていた不具合を修正。
[hengband/hengband.git] / src / cmd6.c
index cf82f4e..c1aa2f7 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)
        {
@@ -81,7 +84,7 @@ static void do_cmd_eat_food_aux(int item)
        ident = FALSE;
 
        /* Object level */
-       lev = get_object_level(o_ptr);
+       lev = k_info[o_ptr->k_idx].level;
 
        if (o_ptr->tval == TV_FOOD)
        {
@@ -378,7 +381,7 @@ static void do_cmd_eat_food_aux(int item)
        /* Combine / Reorder the pack (later) */
        p_ptr->notice |= (PN_COMBINE | PN_REORDER);
 
-       if (!(object_aware_p(o_ptr)))
+       if (!(object_is_aware(o_ptr)))
        {
                chg_virtue(V_KNOWLEDGE, -1);
                chg_virtue(V_PATIENCE, -1);
@@ -389,7 +392,7 @@ static void do_cmd_eat_food_aux(int item)
        if (o_ptr->tval == TV_FOOD) object_tried(o_ptr);
 
        /* The player is now aware of the object */
-       if (ident && !object_aware_p(o_ptr))
+       if (ident && !object_is_aware(o_ptr))
        {
                object_aware(o_ptr);
                gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
@@ -517,18 +520,21 @@ msg_print("
                        floor_item_charges(0 - item);
                }
 
+               /* Window stuff */
+               p_ptr->window |= (PW_INVEN | PW_EQUIP);
+
                /* Don't eat a staff/wand itself */
                return;
        }
        else if ((prace_is_(RACE_DEMON) ||
                 (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_DEMON)) &&
                 (o_ptr->tval == TV_CORPSE && o_ptr->sval == SV_CORPSE &&
-                 strchr("pht", r_info[o_ptr->pval].d_char)))
+                 my_strchr("pht", r_info[o_ptr->pval].d_char)))
        {
                /* Drain vitality of humanoids */
                char o_name[MAX_NLEN];
 
-               object_desc(o_name, o_ptr, FALSE, 0);
+               object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
 
 #ifdef JP
                msg_format("%s¤Ïdz¤¨¾å¤ê³¥¤Ë¤Ê¤Ã¤¿¡£ÀºÎϤòµÛ¼ý¤·¤¿µ¤¤¬¤¹¤ë¡£", o_name);
@@ -657,7 +663,7 @@ static bool item_tester_hook_eatable(object_type *o_ptr)
        {
                if (o_ptr->tval == TV_CORPSE &&
                    o_ptr->sval == SV_CORPSE &&
-                   strchr("pht", r_info[o_ptr->pval].d_char))
+                   my_strchr("pht", r_info[o_ptr->pval].d_char))
                        return TRUE;
        }
 
@@ -705,7 +711,7 @@ void do_cmd_eat_food(void)
 static void do_cmd_quaff_potion_aux(int item)
 {
        int         ident, lev;
-       object_type     *o_ptr;
+       object_type *o_ptr;
        object_type forge;
        object_type *q_ptr;
 
@@ -726,9 +732,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) */
@@ -776,7 +783,7 @@ static void do_cmd_quaff_potion_aux(int item)
        ident = FALSE;
 
        /* Object level */
-       lev = get_object_level(q_ptr);
+       lev = k_info[q_ptr->k_idx].level;
 
        /* Analyze the potion */
        if (q_ptr->tval == TV_POTION)
@@ -884,11 +891,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);
+                                       (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!");
@@ -1172,7 +1179,7 @@ msg_print("
 #ifdef JP
                                msg_print("Ƭ¤¬¥Ï¥Ã¥­¥ê¤È¤·¤¿¡£");
 #else
-                               msg_print("Your feel your head clear.");
+                               msg_print("You feel your head clear.");
 #endif
                                p_ptr->window |= (PW_PLAYER);
                                ident = TRUE;
@@ -1184,7 +1191,7 @@ msg_print("
 #ifdef JP
                                msg_print("Ƭ¤¬¥Ï¥Ã¥­¥ê¤È¤·¤¿¡£");
 #else
-                               msg_print("Your feel your head clear.");
+                               msg_print("You feel your head clear.");
 #endif
 
                                p_ptr->redraw |= (PR_MANA);
@@ -1433,7 +1440,7 @@ msg_print("
        /* Combine / Reorder the pack (later) */
        p_ptr->notice |= (PN_COMBINE | PN_REORDER);
 
-       if (!(object_aware_p(o_ptr)))
+       if (!(object_is_aware(q_ptr)))
        {
                chg_virtue(V_PATIENCE, -1);
                chg_virtue(V_CHANCE, 1);
@@ -1444,7 +1451,7 @@ msg_print("
        object_tried(q_ptr);
 
        /* An identification was made */
-       if (ident && !object_aware_p(q_ptr))
+       if (ident && !object_is_aware(q_ptr))
        {
                object_aware(q_ptr);
                gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
@@ -1460,7 +1467,7 @@ msg_print("
                switch (p_ptr->prace)
                {
                        case RACE_VAMPIRE:
-                               (void)set_food(p_ptr->food + (o_ptr->pval / 10));
+                               (void)set_food(p_ptr->food + (q_ptr->pval / 10));
                                break;
                        case RACE_SKELETON:
                                /* Do nothing */
@@ -1469,10 +1476,10 @@ msg_print("
                        case RACE_ZOMBIE:
                        case RACE_DEMON:
                        case RACE_SPECTRE:
-                               set_food(p_ptr->food + ((o_ptr->pval) / 20));
+                               set_food(p_ptr->food + ((q_ptr->pval) / 20));
                                break;
                        case RACE_ANDROID:
-                               if (o_ptr->tval == TV_FLASK)
+                               if (q_ptr->tval == TV_FLASK)
                                {
 #ifdef JP
                                        msg_print("¥ª¥¤¥ë¤òÊäµë¤·¤¿¡£");
@@ -1483,7 +1490,7 @@ msg_print("
                                }
                                else
                                {
-                                       set_food(p_ptr->food + ((o_ptr->pval) / 20));
+                                       set_food(p_ptr->food + ((q_ptr->pval) / 20));
                                }
                                break;
                        case RACE_ENT:
@@ -1492,22 +1499,22 @@ msg_print("
 #else
                                msg_print("You are moistened.");
 #endif
-                               set_food(MIN(p_ptr->food + o_ptr->pval + MAX(0, o_ptr->pval * 10) + 2000, PY_FOOD_MAX - 1));
+                               set_food(MIN(p_ptr->food + q_ptr->pval + MAX(0, q_ptr->pval * 10) + 2000, PY_FOOD_MAX - 1));
                                break;
                        default:
-                               (void)set_food(p_ptr->food + o_ptr->pval);
+                               (void)set_food(p_ptr->food + q_ptr->pval);
                                break;
                }
                break;
        case MIMIC_DEMON:
        case MIMIC_DEMON_LORD:
-               set_food(p_ptr->food + ((o_ptr->pval) / 20));
+               set_food(p_ptr->food + ((q_ptr->pval) / 20));
                break;
        case MIMIC_VAMPIRE:
-               (void)set_food(p_ptr->food + (o_ptr->pval / 10));
+               (void)set_food(p_ptr->food + (q_ptr->pval / 10));
                break;
        default:
-               (void)set_food(p_ptr->food + o_ptr->pval);
+               (void)set_food(p_ptr->food + q_ptr->pval);
                break;
        }
 }
@@ -1615,16 +1622,16 @@ 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;
 
        /* Object level */
-       lev = get_object_level(o_ptr);
+       lev = k_info[o_ptr->k_idx].level;
 
        /* Assume the scroll will get used up */
        used_up = TRUE;
@@ -1665,7 +1672,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 +1733,14 @@ static void do_cmd_read_scroll_aux(int item, bool known)
 
                case SV_SCROLL_PHASE_DOOR:
                {
-                       teleport_player(10);
+                       teleport_player(10, 0L);
                        ident = TRUE;
                        break;
                }
 
                case SV_SCROLL_TELEPORT:
                {
-                       teleport_player(100);
+                       teleport_player(100, 0L);
                        ident = TRUE;
                        break;
                }
@@ -1966,7 +1980,21 @@ msg_print("
 
                case SV_SCROLL_SPELL:
                {
-                       if ((p_ptr->pclass == CLASS_WARRIOR) || (p_ptr->pclass == CLASS_IMITATOR) || (p_ptr->pclass == CLASS_MINDCRAFTER) || (p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_ARCHER) || (p_ptr->pclass == CLASS_MAGIC_EATER) || (p_ptr->pclass == CLASS_RED_MAGE) || (p_ptr->pclass == CLASS_SAMURAI) || (p_ptr->pclass == CLASS_BLUE_MAGE) || (p_ptr->pclass == CLASS_CAVALRY) || (p_ptr->pclass == CLASS_BERSERKER) || (p_ptr->pclass == CLASS_SMITH) || (p_ptr->pclass == CLASS_MIRROR_MASTER) || (p_ptr->pclass == CLASS_NINJA)) break;
+                       if ((p_ptr->pclass == CLASS_WARRIOR) ||
+                               (p_ptr->pclass == CLASS_IMITATOR) ||
+                               (p_ptr->pclass == CLASS_MINDCRAFTER) ||
+                               (p_ptr->pclass == CLASS_SORCERER) ||
+                               (p_ptr->pclass == CLASS_ARCHER) ||
+                               (p_ptr->pclass == CLASS_MAGIC_EATER) ||
+                               (p_ptr->pclass == CLASS_RED_MAGE) ||
+                               (p_ptr->pclass == CLASS_SAMURAI) ||
+                               (p_ptr->pclass == CLASS_BLUE_MAGE) ||
+                               (p_ptr->pclass == CLASS_CAVALRY) ||
+                               (p_ptr->pclass == CLASS_BERSERKER) ||
+                               (p_ptr->pclass == CLASS_SMITH) ||
+                               (p_ptr->pclass == CLASS_MIRROR_MASTER) ||
+                               (p_ptr->pclass == CLASS_NINJA) ||
+                               (p_ptr->pclass == CLASS_SNIPER)) break;
                        p_ptr->add_spells++;
                        p_ptr->update |= (PU_SPELLS);
                        ident = TRUE;
@@ -2162,7 +2190,7 @@ msg_print("
 #endif
                used_up = FALSE;
        }
-       else if (o_ptr->tval==TV_PARCHEMENT)
+       else if (o_ptr->tval==TV_PARCHMENT)
        {
                cptr q;
                char o_name[MAX_NLEN];
@@ -2174,7 +2202,7 @@ msg_print("
                q=format("book-%d_jp.txt",o_ptr->sval);
 
                /* Display object description */
-               object_desc(o_name, o_ptr, TRUE, 0);
+               object_desc(o_name, o_ptr, OD_NAME_ONLY);
 
                /* Build the filename */
                path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, q);
@@ -2192,7 +2220,7 @@ msg_print("
        /* Combine / Reorder the pack (later) */
        p_ptr->notice |= (PN_COMBINE | PN_REORDER);
 
-       if (!(object_aware_p(o_ptr)))
+       if (!(object_is_aware(o_ptr)))
        {
                chg_virtue(V_PATIENCE, -1);
                chg_virtue(V_CHANCE, 1);
@@ -2203,7 +2231,7 @@ msg_print("
        object_tried(o_ptr);
 
        /* An identification was made */
-       if (ident && !object_aware_p(o_ptr))
+       if (ident && !object_is_aware(o_ptr))
        {
                object_aware(o_ptr);
                gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
@@ -2244,7 +2272,7 @@ msg_print("
  */
 static bool item_tester_hook_readable(object_type *o_ptr)
 {
-       if ((o_ptr->tval==TV_SCROLL) || (o_ptr->tval==TV_PARCHEMENT) || (o_ptr->name1 == ART_GHB) || (o_ptr->name1 == ART_POWER)) return (TRUE);
+       if ((o_ptr->tval==TV_SCROLL) || (o_ptr->tval==TV_PARCHMENT) || (o_ptr->name1 == ART_GHB) || (o_ptr->name1 == ART_POWER)) return (TRUE);
 
        /* Assume not */
        return (FALSE);
@@ -2322,7 +2350,7 @@ void do_cmd_read_scroll(void)
        }
 
        /* Read the scroll */
-       do_cmd_read_scroll_aux(item, object_aware_p(o_ptr));
+       do_cmd_read_scroll_aux(item, object_is_aware(o_ptr));
 }
 
 
@@ -2370,7 +2398,7 @@ static int staff_effect(int sval, bool *use_charge, bool magic, bool known)
 
                case SV_STAFF_TELEPORTATION:
                {
-                       teleport_player(100);
+                       teleport_player(100, 0L);
                        ident = TRUE;
                        break;
                }
@@ -2431,7 +2459,7 @@ static int staff_effect(int sval, bool *use_charge, bool magic, bool known)
                                {
                                        scatter(&y, &x, py, px, 4, 0);
 
-                                       if (!cave_floor_bold(y, x)) continue;
+                                       if (!cave_have_flag_bold(y, x, FF_PROJECT)) continue;
 
                                        if (!player_bold(y, x)) break;
                                }
@@ -2533,7 +2561,7 @@ static int staff_effect(int sval, bool *use_charge, bool magic, bool known)
 #ifdef JP
                                msg_print("Ƭ¤¬¥Ï¥Ã¥­¥ê¤È¤·¤¿¡£");
 #else
-                               msg_print("Your feel your head clear.");
+                               msg_print("You feel your head clear.");
 #endif
 
                                p_ptr->redraw |= (PR_MANA);
@@ -2721,7 +2749,7 @@ static void do_cmd_use_staff_aux(int item)
        energy_use = 100;
 
        /* Extract the item level */
-       lev = get_object_level(o_ptr);
+       lev = k_info[o_ptr->k_idx].level;
        if (lev > 50) lev = 50 + (lev - 50)/2;
 
        /* Base chance of success */
@@ -2789,9 +2817,9 @@ static void do_cmd_use_staff_aux(int item)
        /* Sound */
        sound(SOUND_ZAP);
 
-       ident = staff_effect(o_ptr->sval, &use_charge, FALSE, object_aware_p(o_ptr));
+       ident = staff_effect(o_ptr->sval, &use_charge, FALSE, object_is_aware(o_ptr));
 
-       if (!(object_aware_p(o_ptr)))
+       if (!(object_is_aware(o_ptr)))
        {
                chg_virtue(V_PATIENCE, -1);
                chg_virtue(V_CHANCE, 1);
@@ -2805,7 +2833,7 @@ static void do_cmd_use_staff_aux(int item)
        object_tried(o_ptr);
 
        /* An identification was made */
-       if (ident && !object_aware_p(o_ptr))
+       if (ident && !object_is_aware(o_ptr))
        {
                object_aware(o_ptr);
                gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
@@ -3241,7 +3269,7 @@ static void do_cmd_aim_wand_aux(int item)
 
 
        /* Allow direction to be cancelled for free */
-       if (object_aware_p(o_ptr) && (o_ptr->sval == SV_WAND_HEAL_MONSTER
+       if (object_is_aware(o_ptr) && (o_ptr->sval == SV_WAND_HEAL_MONSTER
                                      || o_ptr->sval == SV_WAND_HASTE_MONSTER))
                        target_pet = TRUE;
        if (!get_aim_dir(&dir))
@@ -3255,7 +3283,7 @@ static void do_cmd_aim_wand_aux(int item)
        energy_use = 100;
 
        /* Get the level */
-       lev = get_object_level(o_ptr);
+       lev = k_info[o_ptr->k_idx].level;
        if (lev > 50) lev = 50 + (lev - 50)/2;
 
        /* Base chance of success */
@@ -3327,7 +3355,7 @@ static void do_cmd_aim_wand_aux(int item)
        /* Combine / Reorder the pack (later) */
        p_ptr->notice |= (PN_COMBINE | PN_REORDER);
 
-       if (!(object_aware_p(o_ptr)))
+       if (!(object_is_aware(o_ptr)))
        {
                chg_virtue(V_PATIENCE, -1);
                chg_virtue(V_CHANCE, 1);
@@ -3338,7 +3366,7 @@ static void do_cmd_aim_wand_aux(int item)
        object_tried(o_ptr);
 
        /* Apply identification */
-       if (ident && !object_aware_p(o_ptr))
+       if (ident && !object_is_aware(o_ptr))
        {
                object_aware(o_ptr);
                gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
@@ -3681,7 +3709,7 @@ static void do_cmd_zap_rod_aux(int item)
 
        /* Get a direction (unless KNOWN not to need it) */
        if (((o_ptr->sval >= SV_ROD_MIN_DIRECTION) && (o_ptr->sval != SV_ROD_HAVOC) && (o_ptr->sval != SV_ROD_AGGRAVATE) && (o_ptr->sval != SV_ROD_PESTICIDE)) ||
-            !object_aware_p(o_ptr))
+            !object_is_aware(o_ptr))
        {
                /* Get a direction, allow cancel */
                if (!get_aim_dir(&dir)) return;
@@ -3692,7 +3720,7 @@ static void do_cmd_zap_rod_aux(int item)
        energy_use = 100;
 
        /* Extract the item level */
-       lev = get_object_level(o_ptr);
+       lev = k_info[o_ptr->k_idx].level;
 
        /* Base chance of success */
        chance = p_ptr->skill_dev;
@@ -3783,7 +3811,7 @@ msg_print("
        /* Combine / Reorder the pack (later) */
        p_ptr->notice |= (PN_COMBINE | PN_REORDER);
 
-       if (!(object_aware_p(o_ptr)))
+       if (!(object_is_aware(o_ptr)))
        {
                chg_virtue(V_PATIENCE, -1);
                chg_virtue(V_CHANCE, 1);
@@ -3794,7 +3822,7 @@ msg_print("
        object_tried(o_ptr);
 
        /* Successfully determined the object function */
-       if (ident && !object_aware_p(o_ptr))
+       if (ident && !object_is_aware(o_ptr))
        {
                object_aware(o_ptr);
                gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
@@ -3842,7 +3870,7 @@ static bool item_tester_hook_activate(object_type *o_ptr)
        u32b flgs[TR_FLAG_SIZE];
 
        /* Not known */
-       if (!object_known_p(o_ptr)) return (FALSE);
+       if (!object_is_known(o_ptr)) return (FALSE);
 
        /* Extract the flags */
        object_flags(o_ptr, flgs);
@@ -3994,10 +4022,10 @@ static void do_cmd_activate_aux(int item)
        energy_use = 100;
 
        /* Extract the item level */
-       lev = get_object_level(o_ptr);
+       lev = k_info[o_ptr->k_idx].level;
 
        /* Hack -- use artifact level instead */
-       if (artifact_p(o_ptr)) lev = a_info[o_ptr->name1].level;
+       if (object_is_fixed_artifact(o_ptr)) lev = a_info[o_ptr->name1].level;
        else if (o_ptr->art_name)
        {
                switch (o_ptr->xtra2)
@@ -4186,7 +4214,7 @@ static void do_cmd_activate_aux(int item)
        }
 
        /* Artifacts */
-       else if (o_ptr->name1)
+       else if (object_is_fixed_artifact(o_ptr))
        {
                /* Choose effect */
                switch (o_ptr->name1)
@@ -4194,7 +4222,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 +4429,7 @@ msg_print("
                                        {
                                                scatter(&y, &x, py, px, 4, 0);
 
-                                               if (!cave_floor_bold(y, x)) continue;
+                                               if (!cave_have_flag_bold(y, x, FF_PROJECT)) continue;
 
                                                if (!player_bold(y, x)) break;
                                        }
@@ -4472,6 +4500,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 +4626,7 @@ msg_print("ŷ
                                msg_print("Your cloak twists space around you...");
 #endif
 
-                               teleport_player(100);
+                               teleport_player(100, 0L);
                                o_ptr->timeout = 45;
                                break;
                        }
@@ -4615,6 +4644,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 +4857,10 @@ msg_print("ŷ
                                switch (randint1(13))
                                {
                                case 1: case 2: case 3: case 4: case 5:
-                                       teleport_player(10);
+                                       teleport_player(10, 0L);
                                        break;
                                case 6: case 7: case 8: case 9: case 10:
-                                       teleport_player(222);
+                                       teleport_player(222, 0L);
                                        break;
                                case 11: case 12:
                                        (void)stair_creation();
@@ -4844,7 +4885,7 @@ if (get_check("
 
                        case ART_KAMUI:
                        {
-                               teleport_player(222);
+                               teleport_player(222, 0L);
                                o_ptr->timeout = 25;
                                break;
                        }
@@ -5104,7 +5145,7 @@ msg_print("
                                detect_all(DETECT_RAD_DEFAULT);
                                probing();
                                identify_fully(FALSE);
-                               o_ptr->timeout = 1000;
+                               o_ptr->timeout = 100;
                                break;
                        }
 
@@ -5123,6 +5164,7 @@ msg_print("
                        }
 
                        case ART_BRAND:
+                       case ART_HELLFIRE:
                        {
 #ifdef JP
                                msg_print("¥¯¥í¥¹¥Ü¥¦¤¬¿¼¹È¤Ëµ±¤¤¤¿...");
@@ -5282,7 +5324,13 @@ msg_print("
 
                        case ART_BOROMIR:
                        {
+                               if (music_singing_any()) stop_singing();
+                               if (hex_spelling_any()) stop_hex_spell_all();
+#ifdef JP
+                               msg_print("¤¢¤Ê¤¿¤ÏÎ϶¯¤¤ÆÍÉ÷¤ò¿á¤­ÌĤ餷¤¿¡£¼þ°Ï¤ÎŨ¤¬¿Ì¤¨¾å¤Ã¤Æ¤¤¤ë!");
+#else
                                msg_print("You wind a mighty blast; your enemies tremble!");
+#endif
                                (void)turn_monsters((3 * p_ptr->lev / 2) + 10);
                                o_ptr->timeout = randint0(40) + 40;
                                break;
@@ -5403,10 +5451,10 @@ msg_print("
                                y = py+ddy[dir];
                                x = px+ddx[dir];
                                tsuri_dir = dir;
-                               if (!(cave[y][x].feat == FEAT_DEEP_WATER) && !(cave[y][x].feat == FEAT_SHAL_WATER))
+                               if (!cave_have_flag_bold(y, x, FF_WATER))
                                {
 #ifdef JP
-                                       msg_print("¤½¤³¤ÏΦÃϤÀ¡£");
+                                       msg_print("¤½¤³¤Ï¿åÊդǤϤʤ¤¡£");
 #else
                                        msg_print("There is no fishing place.");
 #endif
@@ -5434,7 +5482,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);
@@ -5521,6 +5569,7 @@ msg_print("
                                                if (!m_ptr->r_idx) continue;
                                                if (!((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) continue;
                                                if (!los(m_ptr->fy, m_ptr->fx, py, px)) continue;
+                                               if (!projectable(m_ptr->fy, m_ptr->fx, py, px)) continue;
                                                count++;
                                                break;
                                        }
@@ -5567,6 +5616,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;
@@ -5609,32 +5659,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);
@@ -5647,6 +5677,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);
@@ -5717,6 +5748,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
@@ -5729,6 +5779,81 @@ msg_print("
                                o_ptr->timeout = randint0(150) + 150;
                                break;
                        }
+                       case ART_HELL:
+                       {
+#ifdef JP
+                               msg_print("¼óÎؤ¬¿¼¤¤°Ç¤Ëʤ¤ï¤ì¤¿...");
+#else
+                               msg_print("Your collar harness is coverd in pitch-darkness...");
+#endif
+                               if (!get_aim_dir(&dir)) return;
+                               fire_ball(GF_DARK, dir, 250, 4);
+                               o_ptr->timeout = randint0(150) + 150;
+                               break;
+                       }
+                       case ART_SACRED_KNIGHTS:
+                       {
+#ifdef JP
+                               msg_print("¼ó¾þ¤ê¤¬¿¿¼Â¤ò¾È¤é¤·½Ð¤¹...");
+#else
+                               msg_print("Your amulet exhibits the truth...");
+#endif
+                               if (remove_all_curse())
+                               {
+#ifdef JP
+                                       msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
+#else
+                                       msg_print("You feel as if someone is watching over you.");
+#endif
+                               }
+                               (void)probing();
+                               break;
+                       }
+                       case ART_CHARMED:
+                       {
+#ifdef JP
+                               msg_print("¥Ú¥ó¥À¥ó¥È¤¬ÀÄÇò¤¯¸÷¤Ã¤¿¡¥¡¥¡¥");
+#else
+                               msg_print("Your pendant glows pale...");
+#endif
+                               if (p_ptr->pclass == CLASS_MAGIC_EATER)
+                               {
+                                       int i;
+                                       for (i = 0; i < EATER_EXT*2; i++)
+                                       {
+                                               p_ptr->magic_num1[i] += (p_ptr->magic_num2[i] < 10) ? EATER_CHARGE * 3 : p_ptr->magic_num2[i]*EATER_CHARGE/3;
+                                               if (p_ptr->magic_num1[i] > p_ptr->magic_num2[i]*EATER_CHARGE) p_ptr->magic_num1[i] = p_ptr->magic_num2[i]*EATER_CHARGE;
+                                       }
+                                       for (; i < EATER_EXT*3; i++)
+                                       {
+                                               int k_idx = lookup_kind(TV_ROD, i-EATER_EXT*2);
+                                               p_ptr->magic_num1[i] -= ((p_ptr->magic_num2[i] < 10) ? EATER_ROD_CHARGE*3 : p_ptr->magic_num2[i]*EATER_ROD_CHARGE/3)*k_info[k_idx].pval;
+                                               if (p_ptr->magic_num1[i] < 0) p_ptr->magic_num1[i] = 0;
+                                       }
+#ifdef JP
+                                       msg_print("Ƭ¤¬¥Ï¥Ã¥­¥ê¤È¤·¤¿¡£");
+#else
+                                       msg_print("You feel your head clear.");
+#endif
+                                       p_ptr->window |= (PW_PLAYER);
+                               }
+                               else if (p_ptr->csp < p_ptr->msp)
+                               {
+                                       p_ptr->csp = p_ptr->msp;
+                                       p_ptr->csp_frac = 0;
+#ifdef JP
+                                       msg_print("Ƭ¤¬¥Ï¥Ã¥­¥ê¤È¤·¤¿¡£");
+#else
+                                       msg_print("You feel your head clear.");
+#endif
+
+                                       p_ptr->redraw |= (PR_MANA);
+                                       p_ptr->window |= (PW_PLAYER);
+                                       p_ptr->window |= (PW_SPELL);
+                               }
+                               o_ptr->timeout = 777;
+                               break;
+                       }
                }
 
                /* Window stuff */
@@ -5738,7 +5863,7 @@ msg_print("
                return;
        }
 
-       if (item_tester_hook_smith(o_ptr))
+       if (object_is_smith(o_ptr))
        {
                switch (o_ptr->xtra3-1)
                {
@@ -5777,7 +5902,7 @@ msg_print("
 
        if (o_ptr->name2 == EGO_TRUMP)
        {
-               teleport_player(100);
+               teleport_player(100, 0L);
                o_ptr->timeout = 50 + randint1(50);
 
                /* Window stuff */
@@ -5825,7 +5950,7 @@ msg_print("
 
        if (o_ptr->name2 == EGO_JUMP)
        {
-               teleport_player(10);
+               teleport_player(10, 0L);
                o_ptr->timeout = 10 + randint1(10);
 
                /* Window stuff */
@@ -5842,6 +5967,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)
                {
@@ -6058,7 +6186,7 @@ msg_print("
 
        else if (o_ptr->tval == TV_RING)
        {
-               if (o_ptr->name2)
+               if (object_is_ego(o_ptr))
                {
                        bool success = TRUE;
 
@@ -6092,7 +6220,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:
@@ -6155,6 +6283,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;
@@ -6233,7 +6362,7 @@ msg_print("
 
        else if (o_ptr->tval == TV_AMULET)
        {
-               if (o_ptr->name2)
+               if (object_is_ego(o_ptr))
                {
                        switch (o_ptr->name2)
                        {
@@ -6247,11 +6376,11 @@ msg_print("
                                o_ptr->timeout = 200;
                                break;
                        case EGO_AMU_JUMP:
-                               teleport_player(10);
+                               teleport_player(10, 0L);
                                o_ptr->timeout = randint0(10) + 10;
                                break;
                        case EGO_AMU_TELEPORT:
-                               teleport_player(100);
+                               teleport_player(100, 0L);
                                o_ptr->timeout = randint0(50) + 50;
                                break;
                        case EGO_AMU_D_DOOR:
@@ -6285,8 +6414,11 @@ 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 (cursed_p(o_ptr))
+               if (object_is_cursed(o_ptr))
                {
 #ifdef JP
                        msg_print("¥«¥ó¹â¤¤²»¤¬¶Á¤­ÅϤä¿¡£");
@@ -6323,7 +6455,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 */
@@ -6394,7 +6526,7 @@ msg_print("
                {
                        bool success = FALSE;
                        if (!get_rep_dir2(&dir)) return;
-                       if (cave_floor_bold(py+ddy[dir],px+ddx[dir]))
+                       if (monster_can_enter(py + ddy[dir], px + 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)))
                                {
@@ -6544,7 +6676,7 @@ static bool item_tester_hook_use(object_type *o_ptr)
                        int i;
 
                        /* Not known */
-                       if (!object_known_p(o_ptr)) return (FALSE);
+                       if (!object_is_known(o_ptr)) return (FALSE);
 
                        /* HACK - only items from the equipment can be activated */
                        for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
@@ -6761,7 +6893,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)
@@ -6924,11 +7056,7 @@ static int select_magic_eater(bool only_browse)
                                {
                                        chance -= 3 * (p_ptr->lev - level);
                                }
-                               chance += p_ptr->to_m_chance;
-                               if (p_ptr->heavy_spell) chance += 20;
-                               if(p_ptr->dec_mana && p_ptr->easy_spell) chance-=4;
-                               else if (p_ptr->easy_spell) chance-=3;
-                               else if (p_ptr->dec_mana) chance-=2;
+                               chance = mod_spell_chance_1(chance);
                                chance = MAX(chance, adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]]);
                                /* Stunning makes spells harder */
                                if (p_ptr->stun > 50) chance += 25;
@@ -6936,8 +7064,7 @@ static int select_magic_eater(bool only_browse)
 
                                if (chance > 95) chance = 95;
 
-                               if(p_ptr->dec_mana) chance--;
-                               if (p_ptr->heavy_spell) chance += 5;
+                               chance = mod_spell_chance_2(chance);
 
                                col = TERM_WHITE;
 
@@ -7228,11 +7355,7 @@ msg_print("
        {
                chance -= 3 * (p_ptr->lev - level);
        }
-       chance += p_ptr->to_m_chance;
-       if (p_ptr->heavy_spell) chance += 20;
-       if(p_ptr->dec_mana && p_ptr->easy_spell) chance-=4;
-       else if (p_ptr->easy_spell) chance-=3;
-       else if (p_ptr->dec_mana) chance-=2;
+       chance = mod_spell_chance_1(chance);
        chance = MAX(chance, adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]]);
        /* Stunning makes spells harder */
        if (p_ptr->stun > 50) chance += 25;
@@ -7240,8 +7363,7 @@ msg_print("
 
        if (chance > 95) chance = 95;
 
-       if(p_ptr->dec_mana) chance--;
-       if (p_ptr->heavy_spell) chance += 5;
+       chance = mod_spell_chance_2(chance);
 
        if (randint0(100) < chance)
        {