OSDN Git Service

[Refactor] #37353 型の置換。 / Type replacement.
[hengband/hengband.git] / src / spells3.c
index f22e7be..96c5a75 100644 (file)
@@ -118,7 +118,7 @@ bool teleport_away(MONSTER_IDX m_idx, POSITION dis, BIT_FLAGS mode)
        reset_target(m_ptr);
 
        /* Update the monster (new location) */
-       update_mon(m_idx, TRUE);
+       update_monster(m_idx, TRUE);
 
        /* Redraw the old grid */
        lite_spot(oy, ox);
@@ -158,7 +158,6 @@ void teleport_monster_to(MONSTER_IDX m_idx, POSITION ty, POSITION tx, int power,
        /* "Skill" test */
        if(randint1(100) > power) return;
 
-       /* Initialize */
        ny = m_ptr->fy;
        nx = m_ptr->fx;
 
@@ -224,7 +223,7 @@ void teleport_monster_to(MONSTER_IDX m_idx, POSITION ty, POSITION tx, int power,
        m_ptr->fx = nx;
 
        /* Update the monster (new location) */
-       update_mon(m_idx, TRUE);
+       update_monster(m_idx, TRUE);
 
        /* Redraw the old grid */
        lite_spot(oy, ox);
@@ -377,11 +376,11 @@ bool teleport_player_aux(POSITION dis, BIT_FLAGS mode)
  */
 void teleport_player(POSITION dis, BIT_FLAGS mode)
 {
-       int yy, xx;
+       POSITION yy, xx;
 
        /* Save the old location */
-       int oy = p_ptr->y;
-       int ox = p_ptr->x;
+       POSITION oy = p_ptr->y;
+       POSITION ox = p_ptr->x;
 
        if (!teleport_player_aux(dis, mode)) return;
 
@@ -421,11 +420,11 @@ void teleport_player(POSITION dis, BIT_FLAGS mode)
  */
 void teleport_player_away(MONSTER_IDX m_idx, POSITION dis)
 {
-       int yy, xx;
+       POSITION yy, xx;
 
        /* Save the old location */
-       int oy = p_ptr->y;
-       int ox = p_ptr->x;
+       POSITION oy = p_ptr->y;
+       POSITION ox = p_ptr->x;
 
        if (!teleport_player_aux(dis, TELEPORT_PASSIVE)) return;
 
@@ -516,10 +515,10 @@ void teleport_player_to(POSITION ny, POSITION nx, BIT_FLAGS mode)
 void teleport_away_followable(MONSTER_IDX m_idx)
 {
        monster_type *m_ptr = &m_list[m_idx];
-       int          oldfy = m_ptr->fy;
-       int          oldfx = m_ptr->fx;
-       bool         old_ml = m_ptr->ml;
-       int          old_cdis = m_ptr->cdis;
+       POSITION oldfy = m_ptr->fy;
+       POSITION oldfx = m_ptr->fx;
+       bool old_ml = m_ptr->ml;
+       POSITION old_cdis = m_ptr->cdis;
 
        teleport_away(m_idx, MAX_SIGHT * 2 + 5, 0L);
 
@@ -532,7 +531,7 @@ void teleport_away_followable(MONSTER_IDX m_idx)
                {
                        BIT_FLAGS flgs[TR_FLAG_SIZE];
                        object_type *o_ptr;
-                       int i;
+                       INVENTORY_IDX i;
 
                        for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
                        {
@@ -974,7 +973,6 @@ bool apply_disenchant(BIT_FLAGS mode)
                case 8: t = INVEN_FEET; break;
        }
 
-       /* Get the item */
        o_ptr = &inventory[t];
 
        /* No item, nothing happens */
@@ -992,7 +990,6 @@ bool apply_disenchant(BIT_FLAGS mode)
        }
 
 
-       /* Describe the object */
        object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
 
 
@@ -1008,7 +1005,6 @@ msg_format("%s(%c)は劣化を跳ね返した!",o_name, index_to_label(t) );
 #endif
 
 
-               /* Notice */
                return (TRUE);
        }
 
@@ -1053,13 +1049,11 @@ msg_format("%s(%c)は劣化を跳ね返した!",o_name, index_to_label(t) );
                /* Recalculate bonuses */
                p_ptr->update |= (PU_BONUS);
 
-               /* Window stuff */
                p_ptr->window |= (PW_EQUIP | PW_PLAYER);
 
                calc_android_exp();
        }
 
-       /* Notice */
        return (TRUE);
 }
 
@@ -1186,7 +1180,6 @@ void phlogiston(void)
 
        msg_print(_("照明用アイテムに燃素を補充した。", "You add phlogiston to your light item."));
 
-       /* Comment */
        if (o_ptr->xtra4 >= max_flog)
        {
                o_ptr->xtra4 = (XTRA16)max_flog;
@@ -1215,7 +1208,6 @@ void brand_weapon(int brand_type)
        item_tester_hook = object_allow_enchant_melee_weapon;
        item_tester_no_ryoute = TRUE;
 
-       /* Get an item */
        q = _("どの武器を強化しますか? ", "Enchant which weapon? ");
        s = _("強化できる武器がない。", "You have nothing to enchant.");
 
@@ -1364,11 +1356,11 @@ void brand_weapon(int brand_type)
  */
 static bool vanish_dungeon(void)
 {
-       int          y, x;
-       cave_type    *c_ptr;
+       POSITION y, x;
+       cave_type *c_ptr;
        feature_type *f_ptr;
        monster_type *m_ptr;
-       char         m_name[80];
+       char m_name[80];
 
        /* Prevent vasishing of quest levels and town */
        if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !dun_level)
@@ -1484,16 +1476,13 @@ static bool vanish_dungeon(void)
        /* Mega-Hack -- Forget the view and lite */
        p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
 
-       /* Update stuff */
        p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE);
 
        /* Update the monsters */
        p_ptr->update |= (PU_MONSTERS);
 
-       /* Redraw map */
        p_ptr->redraw |= (PR_MAP);
 
-       /* Window stuff */
        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 
        return TRUE;
@@ -1725,7 +1714,6 @@ void alter_reality(void)
  */
 bool warding_glyph(void)
 {
-       /* XXX XXX XXX */
        if (!cave_clean_bold(p_ptr->y, p_ptr->x))
        {
                msg_print(_("床上のアイテムが呪文を跳ね返した。", "The object resists the spell."));
@@ -1736,10 +1724,8 @@ bool warding_glyph(void)
        cave[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
        cave[p_ptr->y][p_ptr->x].mimic = feat_glyph;
 
-       /* Notice */
        note_spot(p_ptr->y, p_ptr->x);
 
-       /* Redraw */
        lite_spot(p_ptr->y, p_ptr->x);
 
        return TRUE;
@@ -1751,7 +1737,6 @@ bool warding_glyph(void)
  */
 bool place_mirror(void)
 {
-       /* XXX XXX XXX */
        if (!cave_clean_bold(p_ptr->y, p_ptr->x))
        {
                msg_print(_("床上のアイテムが呪文を跳ね返した。", "The object resists the spell."));
@@ -1765,10 +1750,8 @@ bool place_mirror(void)
        /* Turn on the light */
        cave[p_ptr->y][p_ptr->x].info |= CAVE_GLOW;
 
-       /* Notice */
        note_spot(p_ptr->y, p_ptr->x);
 
-       /* Redraw */
        lite_spot(p_ptr->y, p_ptr->x);
 
        update_local_illumination(p_ptr->y, p_ptr->x);
@@ -1784,7 +1767,6 @@ bool place_mirror(void)
  */
 bool explosive_rune(void)
 {
-       /* XXX XXX XXX */
        if (!cave_clean_bold(p_ptr->y, p_ptr->x))
        {
                msg_print(_("床上のアイテムが呪文を跳ね返した。", "The object resists the spell."));
@@ -1795,10 +1777,8 @@ bool explosive_rune(void)
        cave[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
        cave[p_ptr->y][p_ptr->x].mimic = feat_explosive_rune;
 
-       /* Notice */
        note_spot(p_ptr->y, p_ptr->x);
        
-       /* Redraw */
        lite_spot(p_ptr->y, p_ptr->x);
 
        return TRUE;
@@ -1900,7 +1880,6 @@ static int remove_curse_aux(int all)
                /* Recalculate the bonuses */
                p_ptr->update |= (PU_BONUS);
 
-               /* Window stuff */
                p_ptr->window |= (PW_EQUIP);
 
                /* Count the uncursings */
@@ -1958,7 +1937,6 @@ bool alchemy(void)
        /* Hack -- force destruction */
        if (command_arg > 0) force = TRUE;
 
-       /* Get an item */
        q = _("どのアイテムを金に変えますか?", "Turn which item to gold? ");
        s = _("金に変えられる物がありません。", "You have nothing to turn to gold.");
 
@@ -1988,7 +1966,6 @@ bool alchemy(void)
        }
 
 
-       /* Describe the object */
        old_number = o_ptr->number;
        o_ptr->number = amt;
        object_desc(o_name, o_ptr, 0);
@@ -2033,7 +2010,6 @@ bool alchemy(void)
                /* Redraw gold */
                p_ptr->redraw |= (PR_GOLD);
 
-               /* Window stuff */
                p_ptr->window |= (PW_PLAYER);
 
        }
@@ -2188,7 +2164,6 @@ bool enchant(object_type *o_ptr, int n, int eflag)
        /* Combine / Reorder the pack (later) */
        p_ptr->notice |= (PN_COMBINE | PN_REORDER);
 
-       /* Window stuff */
        p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
 
        calc_android_exp();
@@ -2225,7 +2200,6 @@ bool enchant_spell(HIT_PROB num_hit, HIT_POINT num_dam, ARMOUR_CLASS num_ac)
        /* Enchant armor if requested */
        if (num_ac) item_tester_hook = object_is_armour;
 
-       /* Get an item */
        q = _("どのアイテムを強化しますか? ", "Enchant which item? ");
        s = _("強化できるアイテムがない。", "You have nothing to enchant.");
 
@@ -2243,21 +2217,13 @@ bool enchant_spell(HIT_PROB num_hit, HIT_POINT num_dam, ARMOUR_CLASS num_ac)
                o_ptr = &o_list[0 - item];
        }
 
-
-       /* Description */
        object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
-
-       /* Describe */
 #ifdef JP
-msg_format("%s は明るく輝いた!",
-    o_name);
+       msg_format("%s は明るく輝いた!", o_name);
 #else
-       msg_format("%s %s glow%s brightly!",
-                  ((item >= 0) ? "Your" : "The"), o_name,
-                  ((o_ptr->number > 1) ? "" : "s"));
+       msg_format("%s %s glow%s brightly!", ((item >= 0) ? "Your" : "The"), o_name, ((o_ptr->number > 1) ? "" : "s"));
 #endif
 
-
        /* Enchant */
        if (enchant(o_ptr, num_hit, ENCH_TOHIT)) okay = TRUE;
        if (enchant(o_ptr, num_dam, ENCH_TODAM)) okay = TRUE;
@@ -2266,11 +2232,8 @@ msg_format("%s は明るく輝いた!",
        /* Failure */
        if (!okay)
        {
-               /* Flush */
                if (flush_failure) flush();
-
                msg_print(_("強化に失敗した。", "The enchantment failed."));
-
                if (one_in_(3)) chg_virtue(V_ENCHANT, -1);
        }
        else
@@ -2301,7 +2264,6 @@ bool artifact_scroll(void)
        /* Enchant weapon/armour */
        item_tester_hook = item_tester_hook_nameless_weapon_armour;
 
-       /* Get an item */
        q = _("どのアイテムを強化しますか? ", "Enchant which item? ");
        s = _("強化できるアイテムがない。", "You have nothing to enchant.");
 
@@ -2312,24 +2274,17 @@ bool artifact_scroll(void)
        {
                o_ptr = &inventory[item];
        }
-
        /* Get the item (on the floor) */
        else
        {
                o_ptr = &o_list[0 - item];
        }
 
-
-       /* Description */
        object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
-
-       /* Describe */
 #ifdef JP
        msg_format("%s は眩い光を発した!",o_name);
 #else
-       msg_format("%s %s radiate%s a blinding light!",
-                 ((item >= 0) ? "Your" : "The"), o_name,
-                 ((o_ptr->number > 1) ? "" : "s"));
+       msg_format("%s %s radiate%s a blinding light!", ((item >= 0) ? "Your" : "The"), o_name, ((o_ptr->number > 1) ? "" : "s"));
 #endif
 
        if (object_is_artifact(o_ptr))
@@ -2337,9 +2292,7 @@ bool artifact_scroll(void)
 #ifdef JP
                msg_format("%sは既に伝説のアイテムです!", o_name  );
 #else
-               msg_format("The %s %s already %s!",
-                   o_name, ((o_ptr->number > 1) ? "are" : "is"),
-                   ((o_ptr->number > 1) ? "artifacts" : "an artifact"));
+               msg_format("The %s %s already %s!", o_name, ((o_ptr->number > 1) ? "are" : "is"), ((o_ptr->number > 1) ? "artifacts" : "an artifact"));
 #endif
 
                okay = FALSE;
@@ -2396,18 +2349,14 @@ bool artifact_scroll(void)
        /* Failure */
        if (!okay)
        {
-               /* Flush */
                if (flush_failure) flush();
-
                msg_print(_("強化に失敗した。", "The enchantment failed."));
-
                if (one_in_(3)) chg_virtue(V_ENCHANT, -1);
        }
        else
        {
                if (record_rand_art)
                {
-                       /* Description */
                        object_desc(o_name, o_ptr, OD_NAME_ONLY);
                        do_cmd_write_nikki(NIKKI_ART_SCROLL, 0, o_name);
                }
@@ -2432,7 +2381,6 @@ bool identify_item(object_type *o_ptr)
        bool old_known = FALSE;
        char o_name[MAX_NLEN];
 
-       /* Description */
        object_desc(o_name, o_ptr, 0);
 
        if (o_ptr->ident & IDENT_KNOWN)
@@ -2457,13 +2405,11 @@ bool identify_item(object_type *o_ptr)
        /* Combine / Reorder the pack (later) */
        p_ptr->notice |= (PN_COMBINE | PN_REORDER);
 
-       /* Window stuff */
        p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
 
        strcpy(record_o_name, o_name);
        record_turn = turn;
 
-       /* Description */
        object_desc(o_name, o_ptr, OD_NAME_ONLY);
 
        if(record_fix_art && !old_known && object_is_fixed_artifact(o_ptr))
@@ -2512,7 +2458,6 @@ bool ident_spell(bool only_equip)
                q = _("すべて鑑定済みです。 ", "All items are identified. ");
        }
 
-       /* Get an item */
        s = _("鑑定するべきアイテムがない。", "You have nothing to identify.");
 
        if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return (FALSE);
@@ -2532,10 +2477,7 @@ bool ident_spell(bool only_equip)
        /* Identify it */
        old_known = identify_item(o_ptr);
 
-       /* Description */
        object_desc(o_name, o_ptr, 0);
-
-       /* Describe */
        if (item >= INVEN_RARM)
        {
                msg_format(_("%^s: %s(%c)。", "%^s: %s (%c)."), describe_use(item), o_name, index_to_label(item));
@@ -2578,7 +2520,6 @@ bool mundane_spell(bool only_equip)
        if (only_equip) item_tester_hook = object_is_weapon_armour_ammo;
        item_tester_no_ryoute = TRUE;
 
-       /* Get an item */
        q = _("どれを使いますか?", "Use which item? ");
        s = _("使えるものがありません。", "You have nothing you can use.");
 
@@ -2596,7 +2537,6 @@ bool mundane_spell(bool only_equip)
                o_ptr = &o_list[0 - item];
        }
 
-       /* Oops */
        msg_print(_("まばゆい閃光が走った!", "There is a bright flash of light!"));
        {
                POSITION iy = o_ptr->iy;                 /* Y-position on map, or zero */
@@ -2659,7 +2599,6 @@ bool identify_fully(bool only_equip)
                q = _("すべて*鑑定*済みです。 ", "All items are *identified*. ");
        }
 
-       /* Get an item */
        s = _("*鑑定*するべきアイテムがない。", "You have nothing to *identify*.");
 
        if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return (FALSE);
@@ -2681,14 +2620,9 @@ bool identify_fully(bool only_equip)
 
        /* Mark the item as fully known */
        o_ptr->ident |= (IDENT_MENTAL);
-
-       /* Handle stuff */
        handle_stuff();
 
-       /* Description */
        object_desc(o_name, o_ptr, 0);
-
-       /* Describe */
        if (item >= INVEN_RARM)
        {
                msg_format(_("%^s: %s(%c)。", "%^s: %s (%c)."), describe_use(item), o_name, index_to_label(item));
@@ -2732,7 +2666,7 @@ bool identify_fully(bool only_equip)
  * strongly they recharge.  Staffs, however, each get fewer charges if
  * stacked.
  *
- * XXX XXX XXX Beware of "sliding index errors".
+ * Beware of "sliding index errors".
  */
 bool recharge(int power)
 {
@@ -2753,7 +2687,6 @@ bool recharge(int power)
        /* Only accept legal items */
        item_tester_hook = item_tester_hook_recharge;
 
-       /* Get an item */
        q = _("どのアイテムに魔力を充填しますか? ", "Recharge which item? ");
        s = _("魔力を充填すべきアイテムがない。", "You have nothing to recharge.");
 
@@ -3014,7 +2947,6 @@ bool recharge(int power)
        /* Combine / Reorder the pack (later) */
        p_ptr->notice |= (PN_COMBINE | PN_REORDER);
 
-       /* Window stuff */
        p_ptr->window |= (PW_INVEN);
 
        /* Something was done */
@@ -3040,7 +2972,6 @@ bool bless_weapon(void)
        /* Bless only weapons */
        item_tester_hook = object_is_weapon;
 
-       /* Get an item */
        q = _("どのアイテムを祝福しますか?", "Bless which weapon? ");
        s = _("祝福できる武器がありません。", "You have weapon to bless.");
 
@@ -3059,8 +2990,6 @@ bool bless_weapon(void)
                o_ptr = &o_list[0 - item];
        }
 
-
-       /* Description */
        object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
 
        /* Extract the flags */
@@ -3074,22 +3003,18 @@ bool bless_weapon(void)
                    (o_ptr->curse_flags & TRC_PERMA_CURSE))
                {
 #ifdef JP
-msg_format("%sを覆う黒いオーラは祝福を跳ね返した!",
-    o_name);
+                       msg_format("%sを覆う黒いオーラは祝福を跳ね返した!", o_name);
 #else
-                       msg_format("The black aura on %s %s disrupts the blessing!",
-                           ((item >= 0) ? "your" : "the"), o_name);
+                       msg_format("The black aura on %s %s disrupts the blessing!", ((item >= 0) ? "your" : "the"), o_name);
 #endif
 
                        return TRUE;
                }
 
 #ifdef JP
-msg_format("%s から邪悪なオーラが消えた。",
-    o_name);
+               msg_format("%s から邪悪なオーラが消えた。", o_name);
 #else
-               msg_format("A malignant aura leaves %s %s.",
-                   ((item >= 0) ? "your" : "the"), o_name);
+               msg_format("A malignant aura leaves %s %s.", ((item >= 0) ? "your" : "the"), o_name);
 #endif
 
 
@@ -3105,7 +3030,6 @@ msg_format("%s から邪悪なオーラが消えた。",
                /* Recalculate the bonuses */
                p_ptr->update |= (PU_BONUS);
 
-               /* Window stuff */
                p_ptr->window |= (PW_EQUIP);
        }
 
@@ -3133,10 +3057,8 @@ msg_format("%s は既に祝福されている。",
 
        if (!(object_is_artifact(o_ptr) || object_is_ego(o_ptr)) || one_in_(3))
        {
-               /* Describe */
 #ifdef JP
-msg_format("%sは輝いた!",
-     o_name);
+               msg_format("%sは輝いた!", o_name);
 #else
                msg_format("%s %s shine%s!",
                    ((item >= 0) ? "Your" : "The"), o_name,
@@ -3197,7 +3119,6 @@ msg_format("%s は劣化した!",
        /* Recalculate bonuses */
        p_ptr->update |= (PU_BONUS);
 
-       /* Window stuff */
        p_ptr->window |= (PW_EQUIP | PW_PLAYER);
 
        calc_android_exp();
@@ -3223,7 +3144,6 @@ bool pulish_shield(void)
        /* Assume enchant weapon */
        item_tester_tval = TV_SHIELD;
 
-       /* Get an item */
        q = _("どの盾を磨きますか?", "Pulish which weapon? ");
        s = _("磨く盾がありません。", "You have weapon to pulish.");
 
@@ -3242,8 +3162,6 @@ bool pulish_shield(void)
                o_ptr = &o_list[0 - item];
        }
 
-
-       /* Description */
        object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
 
        /* Extract the flags */
@@ -3253,11 +3171,9 @@ bool pulish_shield(void)
            !object_is_cursed(o_ptr) && (o_ptr->sval != SV_MIRROR_SHIELD))
        {
 #ifdef JP
-msg_format("%sは輝いた!", o_name);
+               msg_format("%sは輝いた!", o_name);
 #else
-               msg_format("%s %s shine%s!",
-                   ((item >= 0) ? "Your" : "The"), o_name,
-                   ((o_ptr->number > 1) ? "" : "s"));
+               msg_format("%s %s shine%s!", ((item >= 0) ? "Your" : "The"), o_name, ((o_ptr->number > 1) ? "" : "s"));
 #endif
                o_ptr->name2 = EGO_REFLECTION;
                enchant(o_ptr, randint0(3) + 4, ENCH_TOAC);
@@ -3453,17 +3369,17 @@ bool potion_smash_effect(MONSTER_IDX who, POSITION y, POSITION x, KIND_OBJECT_ID
  * Hack -- Display all known spells in a window
  * return なし
  * @details
- * XXX XXX XXX Need to analyze size of the window.
- * XXX XXX XXX Need more color coding.
+ * Need to analyze size of the window.
+ * Need more color coding.
  */
 void display_spell_list(void)
 {
-       int             i, j;
-       int             y, x;
-       int             m[9];
+       int i, j;
+       TERM_LEN y, x;
+       int m[9];
        const magic_type *s_ptr;
-       char            name[80];
-       char            out_val[160];
+       char name[80];
+       char out_val[160];
 
 
        /* Erase window */
@@ -3473,7 +3389,6 @@ void display_spell_list(void)
        if (p_ptr->pclass == CLASS_SORCERER) return;
        if (p_ptr->pclass == CLASS_RED_MAGE) return;
 
-       /* Snipers */
        if (p_ptr->pclass == CLASS_SNIPER)
        {
                display_snipe_list();
@@ -3674,7 +3589,7 @@ void display_spell_list(void)
  * @param use_realm 魔法領域
  * @return 経験値
  */
-s16b experience_of_spell(int spell, int use_realm)
+EXP experience_of_spell(SPELL_IDX spell, REALM_IDX use_realm)
 {
        if (p_ptr->pclass == CLASS_SORCERER) return SPELL_EXP_MASTER;
        else if (p_ptr->pclass == CLASS_RED_MAGE) return SPELL_EXP_SKILLED;
@@ -3692,7 +3607,7 @@ s16b experience_of_spell(int spell, int use_realm)
  * @param realm 魔法領域
  * @return 消費MP
  */
-int mod_need_mana(int need_mana, int spell, int realm)
+MANA_POINT mod_need_mana(MANA_POINT need_mana, SPELL_IDX spell, REALM_IDX realm)
 {
 #define MANA_CONST   2400
 #define MANA_DIV        4
@@ -3866,7 +3781,7 @@ PERCENTAGE spell_chance(SPELL_IDX spell, REALM_IDX use_realm)
        if ((use_realm == p_ptr->realm1) || (use_realm == p_ptr->realm2)
            || (p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_RED_MAGE))
        {
-               s16b exp = experience_of_spell(spell, use_realm);
+               EXP exp = experience_of_spell(spell, use_realm);
                if (exp >= SPELL_EXP_EXPERT) chance--;
                if (exp >= SPELL_EXP_MASTER) chance--;
        }
@@ -3944,18 +3859,19 @@ bool spell_okay(int spell, bool learned, bool study_pray, int use_realm)
  */
 void print_spells(SPELL_IDX target_spell, SPELL_IDX *spells, int num, TERM_LEN y, TERM_LEN x, REALM_IDX use_realm)
 {
-       int             i, spell, exp_level, increment = 64;
+       int i;
+       SPELL_IDX spell;
+       int  exp_level, increment = 64;
        const magic_type *s_ptr;
-       cptr            comment;
-       char            info[80];
-       char            out_val[160];
-       byte            line_attr;
-       int             need_mana;
-       char            ryakuji[5];
-       char            buf[256];
+       cptr comment;
+       char info[80];
+       char out_val[160];
+       byte line_attr;
+       MANA_POINT need_mana;
+       char ryakuji[5];
+       char buf[256];
        bool max = FALSE;
 
-
        if (((use_realm <= REALM_NONE) || (use_realm > MAX_REALM)) && p_ptr->wizard)
        msg_print(_("警告! print_spell が領域なしに呼ばれた", "Warning! print_spells called with null realm"));
 
@@ -3976,10 +3892,8 @@ void print_spells(SPELL_IDX target_spell, SPELL_IDX *spells, int num, TERM_LEN y
        /* Dump the spells */
        for (i = 0; i < num; i++)
        {
-               /* Access the spell */
                spell = spells[i];
 
-               /* Access the spell */
                if (!is_magic(use_realm))
                {
                        s_ptr = &technic_info[use_realm - MIN_TECHNIC][spell];
@@ -3993,7 +3907,7 @@ void print_spells(SPELL_IDX target_spell, SPELL_IDX *spells, int num, TERM_LEN y
                        need_mana = s_ptr->smana;
                else
                {
-                       s16b exp = experience_of_spell(spell, use_realm);
+                       EXP exp = experience_of_spell(spell, use_realm);
 
                        /* Extract mana consumption rate */
                        need_mana = mod_need_mana(s_ptr->smana, spell, use_realm);
@@ -4102,598 +4016,6 @@ void print_spells(SPELL_IDX target_spell, SPELL_IDX *spells, int num, TERM_LEN y
 }
 
 
-/*!
- * @brief アイテムが酸で破損するかどうかを判定する
- * @param o_ptr アイテムの情報参照ポインタ
- * @return 破損するならばTRUEを返す
- * Note that amulets, rods, and high-level spell books are immune
- * to "inventory damage" of any kind.  Also sling ammo and shovels.
- * Does a given class of objects (usually) hate acid?
- * Note that acid can either melt or corrode something.
- */
-bool hates_acid(object_type *o_ptr)
-{
-       /* Analyze the type */
-       switch (o_ptr->tval)
-       {
-               /* Wearable items */
-               case TV_ARROW:
-               case TV_BOLT:
-               case TV_BOW:
-               case TV_SWORD:
-               case TV_HAFTED:
-               case TV_POLEARM:
-               case TV_HELM:
-               case TV_CROWN:
-               case TV_SHIELD:
-               case TV_BOOTS:
-               case TV_GLOVES:
-               case TV_CLOAK:
-               case TV_SOFT_ARMOR:
-               case TV_HARD_ARMOR:
-               case TV_DRAG_ARMOR:
-               {
-                       return (TRUE);
-               }
-
-               /* Staffs/Scrolls are wood/paper */
-               case TV_STAFF:
-               case TV_SCROLL:
-               {
-                       return (TRUE);
-               }
-
-               /* Ouch */
-               case TV_CHEST:
-               {
-                       return (TRUE);
-               }
-
-               /* Junk is useless */
-               case TV_SKELETON:
-               case TV_BOTTLE:
-               case TV_JUNK:
-               {
-                       return (TRUE);
-               }
-       }
-
-       return (FALSE);
-}
-
-
-/*!
- * @brief アイテムが電撃で破損するかどうかを判定する /
- * Does a given object (usually) hate electricity?
- * @param o_ptr アイテムの情報参照ポインタ
- * @return 破損するならばTRUEを返す
- */
-bool hates_elec(object_type *o_ptr)
-{
-       switch (o_ptr->tval)
-       {
-               case TV_RING:
-               case TV_WAND:
-               {
-                       return (TRUE);
-               }
-       }
-
-       return (FALSE);
-}
-
-
-/*!
- * @brief アイテムが火炎で破損するかどうかを判定する /
- * Does a given object (usually) hate fire?
- * @param o_ptr アイテムの情報参照ポインタ
- * @return 破損するならばTRUEを返す
- * @details
- * Hafted/Polearm weapons have wooden shafts.
- * Arrows/Bows are mostly wooden.
- */
-bool hates_fire(object_type *o_ptr)
-{
-       /* Analyze the type */
-       switch (o_ptr->tval)
-       {
-               /* Wearable */
-               case TV_LITE:
-               case TV_ARROW:
-               case TV_BOW:
-               case TV_HAFTED:
-               case TV_POLEARM:
-               case TV_BOOTS:
-               case TV_GLOVES:
-               case TV_CLOAK:
-               case TV_SOFT_ARMOR:
-               {
-                       return (TRUE);
-               }
-
-               /* Books */
-               case TV_LIFE_BOOK:
-               case TV_SORCERY_BOOK:
-               case TV_NATURE_BOOK:
-               case TV_CHAOS_BOOK:
-               case TV_DEATH_BOOK:
-               case TV_TRUMP_BOOK:
-               case TV_ARCANE_BOOK:
-               case TV_CRAFT_BOOK:
-               case TV_DAEMON_BOOK:
-               case TV_CRUSADE_BOOK:
-               case TV_MUSIC_BOOK:
-               case TV_HISSATSU_BOOK:
-               case TV_HEX_BOOK:
-               {
-                       return (TRUE);
-               }
-
-               /* Chests */
-               case TV_CHEST:
-               {
-                       return (TRUE);
-               }
-
-               /* Staffs/Scrolls burn */
-               case TV_STAFF:
-               case TV_SCROLL:
-               {
-                       return (TRUE);
-               }
-       }
-
-       return (FALSE);
-}
-
-
-/*!
- * @brief アイテムが冷気で破損するかどうかを判定する /
- * Does a given object (usually) hate cold?
- * @param o_ptr アイテムの情報参照ポインタ
- * @return 破損するならばTRUEを返す
- */
-bool hates_cold(object_type *o_ptr)
-{
-       switch (o_ptr->tval)
-       {
-               case TV_POTION:
-               case TV_FLASK:
-               case TV_BOTTLE:
-               {
-                       return (TRUE);
-               }
-       }
-
-       return (FALSE);
-}
-
-
-/*!
- * @brief アイテムが酸で破損するかどうかを判定する(メインルーチン) /
- * Melt something
- * @param o_ptr アイテムの情報参照ポインタ
- * @return 破損するならばTRUEを返す
- * @todo 統合を検討
- */
-int set_acid_destroy(object_type *o_ptr)
-{
-       BIT_FLAGS flgs[TR_FLAG_SIZE];
-       if (!hates_acid(o_ptr)) return (FALSE);
-       object_flags(o_ptr, flgs);
-       if (have_flag(flgs, TR_IGNORE_ACID)) return (FALSE);
-       return (TRUE);
-}
-
-
-/*!
- * @brief アイテムが電撃で破損するかどうかを判定する(メインルーチン) /
- * Electrical damage
- * @param o_ptr アイテムの情報参照ポインタ
- * @return 破損するならばTRUEを返す
- * @todo 統合を検討
- */
-int set_elec_destroy(object_type *o_ptr)
-{
-       BIT_FLAGS flgs[TR_FLAG_SIZE];
-       if (!hates_elec(o_ptr)) return (FALSE);
-       object_flags(o_ptr, flgs);
-       if (have_flag(flgs, TR_IGNORE_ELEC)) return (FALSE);
-       return (TRUE);
-}
-
-
-/*!
- * @brief アイテムが火炎で破損するかどうかを判定する(メインルーチン) /
- * Burn something
- * @param o_ptr アイテムの情報参照ポインタ
- * @return 破損するならばTRUEを返す
- * @todo 統合を検討
- */
-int set_fire_destroy(object_type *o_ptr)
-{
-       BIT_FLAGS flgs[TR_FLAG_SIZE];
-       if (!hates_fire(o_ptr)) return (FALSE);
-       object_flags(o_ptr, flgs);
-       if (have_flag(flgs, TR_IGNORE_FIRE)) return (FALSE);
-       return (TRUE);
-}
-
-
-/*!
- * @brief アイテムが冷気で破損するかどうかを判定する(メインルーチン) /
- * Freeze things
- * @param o_ptr アイテムの情報参照ポインタ
- * @return 破損するならばTRUEを返す
- * @todo 統合を検討
- */
-int set_cold_destroy(object_type *o_ptr)
-{
-       BIT_FLAGS flgs[TR_FLAG_SIZE];
-       if (!hates_cold(o_ptr)) return (FALSE);
-       object_flags(o_ptr, flgs);
-       if (have_flag(flgs, TR_IGNORE_COLD)) return (FALSE);
-       return (TRUE);
-}
-
-
-/*!
- * @brief アイテムが指定確率で破損するかどうかを判定する /
- * Destroys a type of item on a given percent chance
- * @param typ 破損判定関数ポインタ
- * @param perc 基本確率
- * @return 破損したアイテムの数
- * @details
- * Note that missiles are no longer necessarily all destroyed
- * Destruction taken from "melee.c" code for "stealing".
- * New-style wands and rods handled correctly. -LM-
- * Returns number of items destroyed.
- */
-int inven_damage(inven_func typ, int perc)
-{
-       INVENTORY_IDX i;
-       int j, k, amt;
-       object_type *o_ptr;
-       char o_name[MAX_NLEN];
-
-       if (CHECK_MULTISHADOW()) return 0;
-
-       if (p_ptr->inside_arena) return 0;
-
-       /* Count the casualties */
-       k = 0;
-
-       /* Scan through the slots backwards */
-       for (i = 0; i < INVEN_PACK; i++)
-       {
-               o_ptr = &inventory[i];
-
-               /* Skip non-objects */
-               if (!o_ptr->k_idx) continue;
-
-               /* Hack -- for now, skip artifacts */
-               if (object_is_artifact(o_ptr)) continue;
-
-               /* Give this item slot a shot at death */
-               if ((*typ)(o_ptr))
-               {
-                       /* Count the casualties */
-                       for (amt = j = 0; j < o_ptr->number; ++j)
-                       {
-                               if (randint0(100) < perc) amt++;
-                       }
-
-                       /* Some casualities */
-                       if (amt)
-                       {
-                               /* Get a description */
-                               object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
-
-                               msg_format(_("%s(%c)が%s壊れてしまった!", "%sour %s (%c) %s destroyed!"),
-
-#ifdef JP
-o_name, index_to_label(i),
-    ((o_ptr->number > 1) ?
-    ((amt == o_ptr->number) ? "全部" :
-    (amt > 1 ? "何個か" : "一個")) : "")    );
-#else
-                                   ((o_ptr->number > 1) ?
-                                   ((amt == o_ptr->number) ? "All of y" :
-                                   (amt > 1 ? "Some of y" : "One of y")) : "Y"),
-                                   o_name, index_to_label(i),
-                                   ((amt > 1) ? "were" : "was"));
-#endif
-
-#ifdef JP
-                               if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON))
-                                       msg_print("やりやがったな!");
-#endif
-
-                               /* Potions smash open */
-                               if (object_is_potion(o_ptr))
-                               {
-                                       (void)potion_smash_effect(0, p_ptr->y, p_ptr->x, o_ptr->k_idx);
-                               }
-
-                               /* Reduce the charges of rods/wands */
-                               reduce_charges(o_ptr, amt);
-
-                               /* Destroy "amt" items */
-                               inven_item_increase(i, -amt);
-                               inven_item_optimize(i);
-
-                               /* Count the casualties */
-                               k += amt;
-                       }
-               }
-       }
-
-       /* Return the casualty count */
-       return (k);
-}
-
-
-/*!
- * @brief 酸攻撃による装備のAC劣化処理 /
- * Acid has hit the player, attempt to affect some armor.
- * @return ACが実際に劣化したらTRUEを返す
- * @details
- * Note that the "base armor" of an object never changes.
- * If any armor is damaged (or resists), the player takes less damage.
- */
-static int minus_ac(void)
-{
-       object_type *o_ptr = NULL;
-       BIT_FLAGS flgs[TR_FLAG_SIZE];
-       char        o_name[MAX_NLEN];
-
-
-       /* Pick a (possibly empty) inventory slot */
-       switch (randint1(7))
-       {
-               case 1: o_ptr = &inventory[INVEN_RARM]; break;
-               case 2: o_ptr = &inventory[INVEN_LARM]; break;
-               case 3: o_ptr = &inventory[INVEN_BODY]; break;
-               case 4: o_ptr = &inventory[INVEN_OUTER]; break;
-               case 5: o_ptr = &inventory[INVEN_HANDS]; break;
-               case 6: o_ptr = &inventory[INVEN_HEAD]; break;
-               case 7: o_ptr = &inventory[INVEN_FEET]; break;
-       }
-
-       /* Nothing to damage */
-       if (!o_ptr->k_idx) return (FALSE);
-
-       if (!object_is_armour(o_ptr)) return (FALSE);
-
-       /* No damage left to be done */
-       if (o_ptr->ac + o_ptr->to_a <= 0) return (FALSE);
-
-
-       /* Describe */
-       object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
-
-       /* Extract the flags */
-       object_flags(o_ptr, flgs);
-
-       /* Object resists */
-       if (have_flag(flgs, TR_IGNORE_ACID))
-       {
-               msg_format(_("しかし%sには効果がなかった!", "Your %s is unaffected!"), o_name);
-               return (TRUE);
-       }
-
-       msg_format(_("%sがダメージを受けた!", "Your %s is damaged!"), o_name);
-
-       /* Damage the item */
-       o_ptr->to_a--;
-
-       /* Calculate bonuses */
-       p_ptr->update |= (PU_BONUS);
-
-       /* Window stuff */
-       p_ptr->window |= (PW_EQUIP | PW_PLAYER);
-
-       calc_android_exp();
-
-       /* Item was damaged */
-       return (TRUE);
-}
-
-
-/*!
- * @brief 酸属性によるプレイヤー損害処理 /
- * Hurt the player with Acid
- * @param dam 基本ダメージ量
- * @param kb_str ダメージ原因記述
- * @param monspell 原因となったモンスター特殊攻撃ID
- * @param aura オーラよるダメージが原因ならばTRUE
- * @return 修正HPダメージ量
- */
-int acid_dam(HIT_POINT dam, cptr kb_str, int monspell, bool aura)
-{
-       int get_damage;  
-       int inv = (dam < 30) ? 1 : (dam < 60) ? 2 : 3;
-       bool double_resist = IS_OPPOSE_ACID();
-
-       /* Total Immunity */
-       if (p_ptr->immune_acid || (dam <= 0))
-       {
-               learn_spell(monspell);
-               return 0;
-       }
-
-       /* Vulnerability (Ouch!) */
-       if (p_ptr->muta3 & MUT3_VULN_ELEM) dam *= 2;
-       if (p_ptr->special_defense & KATA_KOUKIJIN) dam += dam / 3;
-
-       /* Resist the damage */
-       if (p_ptr->resist_acid) dam = (dam + 2) / 3;
-       if (double_resist) dam = (dam + 2) / 3;
-
-       if (aura || !CHECK_MULTISHADOW())
-       {
-               if ((!(double_resist || p_ptr->resist_acid)) &&
-                   one_in_(HURT_CHANCE))
-                       (void)do_dec_stat(A_CHR);
-
-               /* If any armor gets hit, defend the player */
-               if (minus_ac()) dam = (dam + 1) / 2;
-       }
-
-       /* Take damage */
-       get_damage = take_hit(aura ? DAMAGE_NOESCAPE : DAMAGE_ATTACK, dam, kb_str, monspell);
-
-       /* Inventory damage */
-       if (!aura && !(double_resist && p_ptr->resist_acid))
-               inven_damage(set_acid_destroy, inv);
-       return get_damage;
-}
-
-
-/*!
- * @brief 電撃属性によるプレイヤー損害処理 /
- * Hurt the player with electricity
- * @param dam 基本ダメージ量
- * @param kb_str ダメージ原因記述
- * @param monspell 原因となったモンスター特殊攻撃ID
- * @param aura オーラよるダメージが原因ならばTRUE
- * @return 修正HPダメージ量
- */
-int elec_dam(HIT_POINT dam, cptr kb_str, int monspell, bool aura)
-{
-       int get_damage;  
-       int inv = (dam < 30) ? 1 : (dam < 60) ? 2 : 3;
-       bool double_resist = IS_OPPOSE_ELEC();
-
-       /* Total immunity */
-       if (p_ptr->immune_elec || (dam <= 0))
-       {
-               learn_spell(monspell);
-               return 0;
-       }
-
-       /* Vulnerability (Ouch!) */
-       if (p_ptr->muta3 & MUT3_VULN_ELEM) dam *= 2;
-       if (p_ptr->special_defense & KATA_KOUKIJIN) dam += dam / 3;
-       if (prace_is_(RACE_ANDROID)) dam += dam / 3;
-
-       /* Resist the damage */
-       if (p_ptr->resist_elec) dam = (dam + 2) / 3;
-       if (double_resist) dam = (dam + 2) / 3;
-
-       if (aura || !CHECK_MULTISHADOW())
-       {
-               if ((!(double_resist || p_ptr->resist_elec)) &&
-                   one_in_(HURT_CHANCE))
-                       (void)do_dec_stat(A_DEX);
-       }
-
-       /* Take damage */
-       get_damage = take_hit(aura ? DAMAGE_NOESCAPE : DAMAGE_ATTACK, dam, kb_str, monspell);
-
-       /* Inventory damage */
-       if (!aura && !(double_resist && p_ptr->resist_elec))
-               inven_damage(set_elec_destroy, inv);
-
-       return get_damage;
-}
-
-
-/*!
- * @brief 火炎属性によるプレイヤー損害処理 /
- * Hurt the player with Fire
- * @param dam 基本ダメージ量
- * @param kb_str ダメージ原因記述
- * @param monspell 原因となったモンスター特殊攻撃ID
- * @param aura オーラよるダメージが原因ならばTRUE
- * @return 修正HPダメージ量
- */
-int fire_dam(HIT_POINT dam, cptr kb_str, int monspell, bool aura)
-{
-       int get_damage;  
-       int inv = (dam < 30) ? 1 : (dam < 60) ? 2 : 3;
-       bool double_resist = IS_OPPOSE_FIRE();
-
-       /* Totally immune */
-       if (p_ptr->immune_fire || (dam <= 0))
-       {
-               learn_spell(monspell);
-               return 0;
-       }
-
-       /* Vulnerability (Ouch!) */
-       if (p_ptr->muta3 & MUT3_VULN_ELEM) dam *= 2;
-       if (prace_is_(RACE_ENT)) dam += dam / 3;
-       if (p_ptr->special_defense & KATA_KOUKIJIN) dam += dam / 3;
-
-       /* Resist the damage */
-       if (p_ptr->resist_fire) dam = (dam + 2) / 3;
-       if (double_resist) dam = (dam + 2) / 3;
-
-       if (aura || !CHECK_MULTISHADOW())
-       {
-               if ((!(double_resist || p_ptr->resist_fire)) &&
-                   one_in_(HURT_CHANCE))
-                       (void)do_dec_stat(A_STR);
-       }
-
-       /* Take damage */
-       get_damage = take_hit(aura ? DAMAGE_NOESCAPE : DAMAGE_ATTACK, dam, kb_str, monspell);
-
-       /* Inventory damage */
-       if (!aura && !(double_resist && p_ptr->resist_fire))
-               inven_damage(set_fire_destroy, inv);
-
-       return get_damage;
-}
-
-
-/*!
- * @brief 冷気属性によるプレイヤー損害処理 /
- * Hurt the player with Cold
- * @param dam 基本ダメージ量
- * @param kb_str ダメージ原因記述
- * @param monspell 原因となったモンスター特殊攻撃ID
- * @param aura オーラよるダメージが原因ならばTRUE
- * @return 修正HPダメージ量
- */
-int cold_dam(HIT_POINT dam, cptr kb_str, int monspell, bool aura)
-{
-       int get_damage;  
-       int inv = (dam < 30) ? 1 : (dam < 60) ? 2 : 3;
-       bool double_resist = IS_OPPOSE_COLD();
-
-       /* Total immunity */
-       if (p_ptr->immune_cold || (dam <= 0))
-       {
-               learn_spell(monspell);
-               return 0;
-       }
-
-       /* Vulnerability (Ouch!) */
-       if (p_ptr->muta3 & MUT3_VULN_ELEM) dam *= 2;
-       if (p_ptr->special_defense & KATA_KOUKIJIN) dam += dam / 3;
-
-       /* Resist the damage */
-       if (p_ptr->resist_cold) dam = (dam + 2) / 3;
-       if (double_resist) dam = (dam + 2) / 3;
-
-       if (aura || !CHECK_MULTISHADOW())
-       {
-               if ((!(double_resist || p_ptr->resist_cold)) &&
-                   one_in_(HURT_CHANCE))
-                       (void)do_dec_stat(A_STR);
-       }
-
-       /* Take damage */
-       get_damage = take_hit(aura ? DAMAGE_NOESCAPE : DAMAGE_ATTACK, dam, kb_str, monspell);
-
-       /* Inventory damage */
-       if (!aura && !(double_resist && p_ptr->resist_cold))
-               inven_damage(set_cold_destroy, inv);
-
-       return get_damage;
-}
 
 /*!
  * @brief 防具の錆止め防止処理
@@ -4710,7 +4032,6 @@ bool rustproof(void)
        /* Select a piece of armour */
        item_tester_hook = object_is_armour;
 
-       /* Get an item */
        q = _("どの防具に錆止めをしますか?", "Rustproof which piece of armour? ");
        s = _("錆止めできるものがありません。", "You have nothing to rustproof.");
 
@@ -4728,8 +4049,6 @@ bool rustproof(void)
                o_ptr = &o_list[0 - item];
        }
 
-
-       /* Description */
        object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
 
        add_flag(o_ptr->art_flags, TR_IGNORE_ACID);
@@ -4737,27 +4056,21 @@ bool rustproof(void)
        if ((o_ptr->to_a < 0) && !object_is_cursed(o_ptr))
        {
 #ifdef JP
-msg_format("%sは新品同様になった!",o_name);
+               msg_format("%sは新品同様になった!",o_name);
 #else
-               msg_format("%s %s look%s as good as new!",
-                       ((item >= 0) ? "Your" : "The"), o_name,
-                       ((o_ptr->number > 1) ? "" : "s"));
+               msg_format("%s %s look%s as good as new!", ((item >= 0) ? "Your" : "The"), o_name, ((o_ptr->number > 1) ? "" : "s"));
 #endif
 
                o_ptr->to_a = 0;
        }
 
 #ifdef JP
-msg_format("%sは腐食しなくなった。", o_name);
+       msg_format("%sは腐食しなくなった。", o_name);
 #else
-       msg_format("%s %s %s now protected against corrosion.",
-               ((item >= 0) ? "Your" : "The"), o_name,
-               ((o_ptr->number > 1) ? "are" : "is"));
+       msg_format("%s %s %s now protected against corrosion.", ((item >= 0) ? "Your" : "The"), o_name, ((o_ptr->number > 1) ? "are" : "is"));
 #endif
 
-
        calc_android_exp();
-
        return TRUE;
 }
 
@@ -4781,8 +4094,6 @@ bool curse_armor(void)
        /* Nothing to curse */
        if (!o_ptr->k_idx) return (FALSE);
 
-
-       /* Describe */
        object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
 
        /* Attempt a saving throw for artifacts */
@@ -4802,7 +4113,6 @@ msg_format("%sが%sを包み込もうとしたが、%sはそれを跳ね返し
        /* not artifact or failed save... */
        else
        {
-               /* Oops */
                msg_format(_("恐怖の暗黒オーラがあなたの%sを包み込んだ!", "A terrible black aura blasts your %s!"), o_name);
                chg_virtue(V_ENCHANT, -5);
 
@@ -4831,7 +4141,6 @@ msg_format("%sが%sを包み込もうとしたが、%sはそれを跳ね返し
                /* Recalculate mana */
                p_ptr->update |= (PU_MANA);
 
-               /* Window stuff */
                p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
        }
 
@@ -4852,8 +4161,6 @@ bool curse_weapon_object(bool force, object_type *o_ptr)
 
        /* Nothing to curse */
        if (!o_ptr->k_idx) return (FALSE);
-
-       /* Describe */
        object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
 
        /* Attempt a saving throw */
@@ -4872,7 +4179,6 @@ bool curse_weapon_object(bool force, object_type *o_ptr)
        /* not artifact or failed save... */
        else
        {
-               /* Oops */
                if (!force) msg_format(_("恐怖の暗黒オーラがあなたの%sを包み込んだ!", "A terrible black aura blasts your %s!"), o_name);
                chg_virtue(V_ENCHANT, -5);
 
@@ -4901,11 +4207,9 @@ bool curse_weapon_object(bool force, object_type *o_ptr)
                /* Recalculate mana */
                p_ptr->update |= (PU_MANA);
 
-               /* Window stuff */
                p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
        }
 
-       /* Notice */
        return (TRUE);
 }
 
@@ -4954,21 +4258,15 @@ bool brand_bolts(void)
 
                /* Ego-item */
                o_ptr->name2 = EGO_FLAME;
-
-               /* Enchant */
                enchant(o_ptr, randint0(3) + 4, ENCH_TOHIT | ENCH_TODAM);
-
-               /* Notice */
                return (TRUE);
        }
 
-       /* Flush */
        if (flush_failure) flush();
 
        /* Fail */
        msg_print(_("炎で強化するのに失敗した。", "The fiery enchantment failed."));
 
-       /* Notice */
        return (TRUE);
 }
 
@@ -5021,8 +4319,6 @@ static IDX poly_r_idx(MONRACE_IDX r_idx)
 
                break;
        }
-
-       /* Result */
        return (r_idx);
 }
 
@@ -5100,7 +4396,6 @@ bool polymorph_monster(POSITION y, POSITION x)
                {
                        for (this_o_idx = back_m.hold_o_idx; this_o_idx; this_o_idx = next_o_idx)
                        {
-                               /* Acquire object */
                                object_type *o_ptr = &o_list[this_o_idx];
 
                                /* Acquire next object */
@@ -5118,7 +4413,6 @@ bool polymorph_monster(POSITION y, POSITION x)
                                /* Acquire next object */
                                next_o_idx = o_list[this_o_idx].next_o_idx;
 
-                               /* Delete the object */
                                delete_object_idx(this_o_idx);
                        }
                }
@@ -5223,7 +4517,6 @@ bool eat_magic(int power)
 
        item_tester_hook = item_tester_hook_recharge;
 
-       /* Get an item */
        q = _("どのアイテムから魔力を吸収しますか?", "Drain which item? ");
        s = _("魔力を吸収できるアイテムがありません。", "You have nothing to drain.");
 
@@ -5290,8 +4583,6 @@ bool eat_magic(int power)
                                {
                                        object_type forge;
                                        object_type *q_ptr;
-
-                                       /* Get local object */
                                        q_ptr = &forge;
 
                                        /* Obtain a local object */
@@ -5631,7 +4922,7 @@ bool eat_lock(void)
        feature_type *f_ptr, *mimic_f_ptr;
        DIRECTION dir;
 
-       if (!get_rep_dir2(&dir)) return FALSE;
+       if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
        y = p_ptr->y + ddy[dir];
        x = p_ptr->x + ddx[dir];
        c_ptr = &cave[y][x];
@@ -5739,7 +5030,7 @@ bool shock_power(void)
                                m_ptr->fy = (byte_hack)ty;
                                m_ptr->fx = (byte_hack)tx;
 
-                               update_mon(m_idx, TRUE);
+                               update_monster(m_idx, TRUE);
                                lite_spot(oy, ox);
                                lite_spot(ty, tx);