OSDN Git Service

randint() == 1, rand_int() == 0, rand_int() == 1 を全て one_in_()に、
[hengband/hengband.git] / src / object2.c
index bb54639..7aedf3a 100644 (file)
@@ -169,10 +169,6 @@ void delete_object_idx(int o_idx)
                lite_spot(y, x);
        }
 
-#ifdef USE_SCRIPT
-       object_delete_callback(j_ptr);
-#endif /* USE_SCRIPT */
-
        /* Wipe the object */
        object_wipe(j_ptr);
 
@@ -209,10 +205,6 @@ void delete_object(int y, int x)
                /* Acquire next object */
                next_o_idx = o_ptr->next_o_idx;
 
-#ifdef USE_SCRIPT
-               object_delete_callback(o_ptr);
-#endif /* USE_SCRIPT */
-
                /* Wipe the object */
                object_wipe(o_ptr);
 
@@ -306,10 +298,6 @@ static void compact_objects_aux(int i1, int i2)
        /* Structure copy */
        o_list[i2] = o_list[i1];
 
-#ifdef USE_SCRIPT
-       object_delete_callback(o_ptr);
-#endif /* USE_SCRIPT */
-
        /* Wipe the hole */
        object_wipe(o_ptr);
 }
@@ -339,7 +327,7 @@ void compact_objects(int size)
        {
                /* Message */
 #ifdef JP
-msg_print("¥¢¥¤¥Æ¥à¾ðÊó¤ò°µ½Ì¤·¤Æ¤¤¤Þ¤¹...");
+               msg_print("¥¢¥¤¥Æ¥à¾ðÊó¤ò°µ½Ì¤·¤Æ¤¤¤Þ¤¹...");
 #else
                msg_print("Compacting objects...");
 #endif
@@ -498,10 +486,6 @@ void wipe_o_list(void)
                        c_ptr->o_idx = 0;
                }
 
-#ifdef USE_SCRIPT
-               object_delete_callback(o_ptr);
-#endif /* USE_SCRIPT */
-
                /* Wipe the object */
                object_wipe(o_ptr);
        }
@@ -563,7 +547,7 @@ s16b o_pop(void)
 
        /* Warn the player (except during dungeon creation) */
 #ifdef JP
-if (character_dungeon) msg_print("¥¢¥¤¥Æ¥à¤¬Â¿¤¹¤®¤ë¡ª");
+       if (character_dungeon) msg_print("¥¢¥¤¥Æ¥à¤¬Â¿¤¹¤®¤ë¡ª");
 #else
        if (character_dungeon) msg_print("Too many objects!");
 #endif
@@ -636,7 +620,7 @@ s16b get_obj_num(int level)
        if ((level > 0) && !(d_info[dungeon_type].flags1 & DF1_BEGINNER))
        {
                /* Occasional "boost" */
-               if (rand_int(GREAT_OBJ) == 0)
+               if (one_in_(GREAT_OBJ))
                {
                        /* What a bizarre calculation */
                        level = 1 + (level * MAX_DEPTH / randint(MAX_DEPTH));
@@ -1017,6 +1001,7 @@ s32b flag_cost(object_type * o_ptr, int plusses)
        if (f3 & TR3_TELEPATHY) total += 20000;
        if (f3 & TR3_SLOW_DIGEST) total += 750;
        if (f3 & TR3_REGEN) total += 2500;
+       if (f3 & TR3_WARNING) total += 2000;
        if (f3 & TR3_XTRA_MIGHT) total += 2250;
        if (f3 & TR3_XTRA_SHOTS) total += 10000;
        if (f3 & TR3_IGNORE_ACID) total += 100;
@@ -1808,7 +1793,7 @@ s16b lookup_kind(int tval, int sval)
 #if 0
        /* Oops */
 #ifdef JP
-msg_format("¥¢¥¤¥Æ¥à¤¬¤Ê¤¤ (%d,%d)", tval, sval);
+       msg_format("¥¢¥¤¥Æ¥à¤¬¤Ê¤¤ (%d,%d)", tval, sval);
 #else
        msg_format("No object (%d,%d)", tval, sval);
 #endif
@@ -1837,10 +1822,6 @@ void object_copy(object_type *o_ptr, object_type *j_ptr)
 {
        /* Copy the structure */
        COPY(o_ptr, j_ptr, object_type);
-
-#ifdef USE_SCRIPT
-       j_ptr->python = object_copy_callback(o_ptr, j_ptr);
-#endif /* USE_SCRIPT */
 }
 
 
@@ -1985,7 +1966,7 @@ static void object_mention(object_type *o_ptr)
        {
                /* Silly message */
 #ifdef JP
-msg_format("ÅÁÀâ¤Î¥¢¥¤¥Æ¥à (%s)", o_name);
+               msg_format("ÅÁÀâ¤Î¥¢¥¤¥Æ¥à (%s)", o_name);
 #else
                msg_format("Artifact (%s)", o_name);
 #endif
@@ -1996,7 +1977,7 @@ msg_format("
        else if (o_ptr->art_name)
        {
 #ifdef JP
-msg_print("¥é¥ó¥À¥à¡¦¥¢¡¼¥Æ¥£¥Õ¥¡¥¯¥È");
+               msg_print("¥é¥ó¥À¥à¡¦¥¢¡¼¥Æ¥£¥Õ¥¡¥¯¥È");
 #else
                msg_print("Random artifact");
 #endif
@@ -2008,7 +1989,7 @@ msg_print("
        {
                /* Silly message */
 #ifdef JP
-msg_format("̾¤Î¤¢¤ë¥¢¥¤¥Æ¥à (%s)", o_name);
+               msg_format("̾¤Î¤¢¤ë¥¢¥¤¥Æ¥à (%s)", o_name);
 #else
                msg_format("Ego-item (%s)", o_name);
 #endif
@@ -2020,7 +2001,7 @@ msg_format("̾
        {
                /* Silly message */
 #ifdef JP
-msg_format("¥¢¥¤¥Æ¥à (%s)", o_name);
+               msg_format("¥¢¥¤¥Æ¥à (%s)", o_name);
 #else
                msg_format("Object (%s)", o_name);
 #endif
@@ -2046,6 +2027,9 @@ static bool make_artifact_special(object_type *o_ptr)
        /* No artifacts in the town */
        if (!dun_level) return (FALSE);
 
+       /* Themed object */
+       if (get_obj_num_hook) return (FALSE);
+
        /* Check the artifact list (just the "specials") */
        for (i = 0; i < max_a_idx; i++)
        {
@@ -2067,11 +2051,11 @@ static bool make_artifact_special(object_type *o_ptr)
                        int d = (a_ptr->level - dun_level) * 2;
 
                        /* Roll for out-of-depth creation */
-                       if (rand_int(d) != 0) continue;
+                       if (!one_in_(d)) continue;
                }
 
                /* Artifact "rarity roll" */
-               if (rand_int(a_ptr->rarity) != 0) continue;
+               if (!one_in_(a_ptr->rarity)) continue;
 
                /* Find the base object */
                k_idx = lookup_kind(a_ptr->tval, a_ptr->sval);
@@ -2083,7 +2067,7 @@ static bool make_artifact_special(object_type *o_ptr)
                        int d = (k_info[k_idx].level - object_level) * 5;
 
                        /* Roll for out-of-depth creation */
-                       if (rand_int(d) != 0) continue;
+                       if (!one_in_(d)) continue;
                }
 
                /* Assign the template */
@@ -2148,11 +2132,11 @@ static bool make_artifact(object_type *o_ptr)
                        int d = (a_ptr->level - dun_level) * 2;
 
                        /* Roll for out-of-depth creation */
-                       if (rand_int(d) != 0) continue;
+                       if (!one_in_(d)) continue;
                }
 
                /* We must make the "rarity roll" */
-               if (rand_int(a_ptr->rarity) != 0) continue;
+               if (!one_in_(a_ptr->rarity)) continue;
 
                /* Hack -- mark the item as an artifact */
                o_ptr->name1 = i;
@@ -2279,7 +2263,7 @@ static void a_m_aux_1(object_type *o_ptr, int level, int power)
                        /* Very good */
                        if (power > 1)
                        {
-                               if (randint(30) == 1)
+                               if (one_in_(30))
                                        create_artifact(o_ptr, FALSE);
                                else
                                        /* Special Ego-item */
@@ -2311,7 +2295,7 @@ static void a_m_aux_1(object_type *o_ptr, int level, int power)
                        /* Very Good */
                        if (power > 1)
                        {
-                               if (one_in_((o_ptr->tval == TV_POLEARM) ? 42 : 44))
+                               if (one_in_(40))
                                {
                                        create_artifact(o_ptr, FALSE);
                                        break;
@@ -2330,11 +2314,11 @@ static void a_m_aux_1(object_type *o_ptr, int level, int power)
                                switch (o_ptr->name2)
                                {
                                case EGO_HA:
-                                       if ((randint(4) == 1) && (level > 40))
+                                       if (one_in_(4) && (level > 40))
                                                o_ptr->art_flags1 |= TR1_BLOWS;
                                        break;
                                case EGO_DF:
-                                       if (randint(3) == 1)
+                                       if (one_in_(3))
                                                o_ptr->art_flags2 |= TR2_RES_POIS;
                                        random_resistance(o_ptr, FALSE, randint(22)+16);
                                        break;
@@ -2343,18 +2327,18 @@ static void a_m_aux_1(object_type *o_ptr, int level, int power)
                                        break;
                                case EGO_KILL_DRAGON:
                                        random_resistance(o_ptr, FALSE, randint(12) + 4);
-                                       if (randint(3) == 1)
+                                       if (one_in_(3))
                                                o_ptr->art_flags2 |= TR2_RES_POIS;
                                        random_resistance(o_ptr, FALSE, randint(14) + 4);
                                case EGO_WEST:
-                                       if (randint(3) == 1)
+                                       if (one_in_(3))
                                                o_ptr->art_flags2 |= TR2_RES_FEAR;
                                        break;
                                case EGO_CHAOTIC:
                                        random_resistance(o_ptr, FALSE, (randint(34) + 4));
                                        break;
                                case EGO_SLAYING_WEAPON:
-                                       if (randint(3) == 1) /* double damage */
+                                       if (one_in_(3)) /* double damage */
                                                o_ptr->dd *= 2;
                                        else
                                        {
@@ -2362,35 +2346,35 @@ static void a_m_aux_1(object_type *o_ptr, int level, int power)
                                                {
                                                        o_ptr->dd++;
                                                }
-                                               while (randint(o_ptr->dd) == 1);
+                                               while (one_in_(o_ptr->dd));
                                                
                                                do
                                                {
                                                        o_ptr->ds++;
                                                }
-                                               while (randint(o_ptr->ds) == 1);
+                                               while (one_in_(o_ptr->ds));
                                        }
                                        
-                                       if (randint(5) == 1)
+                                       if (one_in_(5))
                                        {
                                                o_ptr->art_flags1 |= TR1_BRAND_POIS;
                                        }
-                                       if (o_ptr->tval == TV_SWORD && (randint(3) == 1))
+                                       if (o_ptr->tval == TV_SWORD && one_in_(3))
                                        {
                                                o_ptr->art_flags1 |= TR1_VORPAL;
                                        }
                                        break;
                                case EGO_TRUMP:
                                        random_resistance(o_ptr, FALSE, (randint(22) + 16));
-                                       if (randint(5) == 1)
+                                       if (one_in_(5))
                                                o_ptr->art_flags1 |= TR1_SLAY_DEMON;
                                        break;
                                case EGO_PATTERN:
-                                       if (randint(3) == 1)
+                                       if (one_in_(3))
                                                o_ptr->art_flags2 |= TR2_HOLD_LIFE;
-                                       if (randint(3) == 1)
+                                       if (one_in_(3))
                                                o_ptr->art_flags1 |= TR1_DEX;
-                                       if (randint(5) == 1)
+                                       if (one_in_(5))
                                                o_ptr->art_flags2 |= TR2_RES_FEAR;
                                        random_resistance(o_ptr, FALSE, (randint(22) + 16));
                                        break;
@@ -2398,7 +2382,7 @@ static void a_m_aux_1(object_type *o_ptr, int level, int power)
                                        o_ptr->pval = m_bonus(5, level) + 1;
                                        break;
                                case EGO_EARTHQUAKES:
-                                       if ((randint(3) == 1) && (level > 60))
+                                       if (one_in_(3) && (level > 60))
                                                o_ptr->art_flags1 |= TR1_BLOWS;
                                        else
                                                o_ptr->pval = m_bonus(3, level);
@@ -2408,7 +2392,7 @@ static void a_m_aux_1(object_type *o_ptr, int level, int power)
                                if (!o_ptr->art_name)
                                {
                                        /* Hack -- Super-charge the damage dice */
-                                       while (rand_int(10L * o_ptr->dd * o_ptr->ds) == 0) o_ptr->dd++;
+                                       while (one_in_(10L * o_ptr->dd * o_ptr->ds)) o_ptr->dd++;
 
                                        /* Hack -- Lower the damage dice */
                                        if (o_ptr->dd > 9) o_ptr->dd = 9;
@@ -2439,7 +2423,7 @@ static void a_m_aux_1(object_type *o_ptr, int level, int power)
                        /* Very good */
                        if (power > 1)
                        {
-                               if (one_in_(21))
+                               if (one_in_(20))
                                {
                                        create_artifact(o_ptr, FALSE);
                                        break;
@@ -2475,7 +2459,7 @@ static void a_m_aux_1(object_type *o_ptr, int level, int power)
                                }
 
                                /* Hack -- super-charge the damage dice */
-                               while (rand_int(10L * o_ptr->dd * o_ptr->ds) == 0) o_ptr->dd++;
+                               while (one_in_(10L * o_ptr->dd * o_ptr->ds)) o_ptr->dd++;
 
                                /* Hack -- restrict the damage dice */
                                if (o_ptr->dd > 9) o_ptr->dd = 9;
@@ -2503,12 +2487,12 @@ static void dragon_resist(object_type * o_ptr)
        {
                artifact_bias = 0;
 
-               if (randint(4) == 1)
+               if (one_in_(4))
                        random_resistance(o_ptr, FALSE, (randint(14) + 4));
                else
                        random_resistance(o_ptr, FALSE, (randint(22) + 16));
        }
-       while (randint(2) == 1);
+       while (one_in_(2));
 }
 
 
@@ -2565,7 +2549,7 @@ static void a_m_aux_2(object_type *o_ptr, int level, int power)
                {
                        /* Rating boost */
                        rating += 30;
-                       if(rand_int(50) == 1)
+                       if(one_in_(50))
                                create_artifact(o_ptr, FALSE);
 
                        /* Mention the item */
@@ -2598,7 +2582,7 @@ static void a_m_aux_2(object_type *o_ptr, int level, int power)
                                        break;
                                }
 
-                               if (one_in_((o_ptr->tval == TV_HARD_ARMOR) ? 21 : 19))
+                               if (one_in_(20))
                                {
                                        create_artifact(o_ptr, FALSE);
                                        break;
@@ -2625,7 +2609,7 @@ static void a_m_aux_2(object_type *o_ptr, int level, int power)
                                                }
                                                else
                                                {
-                                                       if (randint(4) == 1)
+                                                       if (one_in_(4))
                                                                o_ptr->art_flags1 |= TR1_CON;
                                                        break;
                                                }
@@ -2650,13 +2634,13 @@ static void a_m_aux_2(object_type *o_ptr, int level, int power)
                                /* Mention the item */
                                if (cheat_peek) object_mention(o_ptr);
                                dragon_resist(o_ptr);
-                               if (randint(3) != 1) break;
+                               if (!one_in_(3)) break;
                        }
 
                        /* Very good */
                        if (power > 1)
                        {
-                               if (one_in_(23))
+                               if (one_in_(20))
                                {
                                        create_artifact(o_ptr, FALSE);
                                        break;
@@ -2688,7 +2672,7 @@ static void a_m_aux_2(object_type *o_ptr, int level, int power)
                                /* Mention the item */
                                if (cheat_peek) object_mention(o_ptr);
                                dragon_resist(o_ptr);
-                               if (randint(3) != 1) break;
+                               if (!one_in_(3)) break;
                        }
                        if (power > 1)
                        {
@@ -2726,7 +2710,7 @@ static void a_m_aux_2(object_type *o_ptr, int level, int power)
                                /* Mention the item */
                                if (cheat_peek) object_mention(o_ptr);
                                dragon_resist(o_ptr);
-                               if (randint(3) != 1) break;
+                               if (!one_in_(3)) break;
                        }
                        /* Very good */
                        if (power > 1)
@@ -2817,7 +2801,7 @@ static void a_m_aux_2(object_type *o_ptr, int level, int power)
                                /* Mention the item */
                                if (cheat_peek) object_mention(o_ptr);
                                dragon_resist(o_ptr);
-                               if (randint(3) != 1) break;
+                               if (!one_in_(3)) break;
                        }
 
                        /* Very good */
@@ -3009,7 +2993,7 @@ static void a_m_aux_3(object_type *o_ptr, int level, int power)
                                        {
                                                random_resistance(o_ptr, FALSE, randint(20) + 18);
                                        }
-                                       while (randint(4) == 1);
+                                       while (one_in_(4));
 
                                        /* Bonus to armor class */
                                        o_ptr->to_a = 10 + randint(5) + m_bonus(10, level);
@@ -3206,7 +3190,7 @@ static void a_m_aux_3(object_type *o_ptr, int level, int power)
                                        break;
                                }
                        }
-                       if (randint(400) == 1 && (power > 0) && !(o_ptr->ident & IDENT_CURSED) && (level > 79))
+                       if (one_in_(400) && (power > 0) && !(o_ptr->ident & IDENT_CURSED) && (level > 79))
                        {
                                o_ptr->pval = MIN(o_ptr->pval,4);
                                /* Randart amulet */
@@ -3468,8 +3452,8 @@ static void a_m_aux_3(object_type *o_ptr, int level, int power)
 
                                case SV_AMULET_RESISTANCE:
                                {
-                                       if (randint(3) == 1) random_resistance(o_ptr, FALSE, (randint(34) + 4));
-                                       if (randint(5) == 1) o_ptr->art_flags2 |= TR2_RES_POIS;
+                                       if (one_in_(3)) random_resistance(o_ptr, FALSE, (randint(34) + 4));
+                                       if (one_in_(5)) o_ptr->art_flags2 |= TR2_RES_POIS;
                                }
                                break;
 
@@ -3546,7 +3530,7 @@ static void a_m_aux_3(object_type *o_ptr, int level, int power)
                                        break;
                                }
                        }
-                       if (randint(150) == 1 && (power > 0) && !(o_ptr->ident & IDENT_CURSED) && (level > 79))
+                       if (one_in_(150) && (power > 0) && !(o_ptr->ident & IDENT_CURSED) && (level > 79))
                        {
                                o_ptr->pval = MIN(o_ptr->pval,4);
                                /* Randart amulet */
@@ -3867,7 +3851,7 @@ static void a_m_aux_4(object_type *o_ptr, int level, int power)
                        if (cheat_peek)
                        {
 #ifdef JP
-msg_format("%s¤Î¿Í·Á, ¿¼¤µ +%d%s",
+                               msg_format("%s¤Î¿Í·Á, ¿¼¤µ +%d%s",
 #else
                                msg_format("Figurine of %s, depth +%d%s",
 #endif
@@ -3926,7 +3910,7 @@ msg_format("%s
                        if (cheat_peek)
                        {
 #ifdef JP
-msg_format("%s¤Î»àÂÎ,¿¼¤µ +%d",
+                               msg_format("%s¤Î»àÂÎ,¿¼¤µ +%d",
 #else
                                msg_format("Corpse of %s, depth +%d",
 #endif
@@ -3963,7 +3947,7 @@ msg_format("%s
                        if (cheat_peek)
                        {
 #ifdef JP
-msg_format("%s¤ÎÁü,", r_name + r_ptr->name);
+                               msg_format("%s¤ÎÁü,", r_name + r_ptr->name);
 #else
                                msg_format("Statue of %s", r_name + r_ptr->name);
 #endif
@@ -4275,7 +4259,7 @@ void apply_magic(object_type *o_ptr, int lev, bool okay, bool good, bool great,
                        /* Trump weapon */
                        case EGO_TRUMP:
                        {
-                               if (randint(7) == 1) o_ptr->xtra1 = EGO_XTRA_ABILITY;
+                               if (one_in_(7)) o_ptr->xtra1 = EGO_XTRA_ABILITY;
                                break;
                        }
 
@@ -4522,7 +4506,7 @@ bool make_object(object_type *j_ptr, bool good, bool great)
 
 
        /* Generate a special object, or a normal object */
-       if ((rand_int(prob) != 0) || !make_artifact_special(j_ptr))
+       if (!one_in_(prob) || !make_artifact_special(j_ptr))
        {
                int k_idx;
 
@@ -4654,10 +4638,6 @@ void place_object(int y, int x, bool good, bool great)
                /* Place the object */
                c_ptr->o_idx = o_idx;
 
-#ifdef USE_SCRIPT
-               o_ptr->python = object_create_callback(o_ptr);
-#endif /* USE_SCRIPT */
-
                /* Notice */
                note_spot(y, x);
 
@@ -4691,7 +4671,7 @@ bool make_gold(object_type *j_ptr)
        i = ((randint(object_level + 2) + 2) / 2) - 1;
 
        /* Apply "extra" magic */
-       if (rand_int(GREAT_OBJ) == 0)
+       if (one_in_(GREAT_OBJ))
        {
                i += randint(object_level + 1);
        }
@@ -4775,10 +4755,6 @@ void place_gold(int y, int x)
                /* Place the object */
                c_ptr->o_idx = o_idx;
 
-#ifdef USE_SCRIPT
-               o_ptr->python = object_create_callback(o_ptr);
-#endif /* USE_SCRIPT */
-
                /* Notice */
                note_spot(y, x);
 
@@ -4848,7 +4824,7 @@ s16b drop_near(object_type *j_ptr, int chance, int y, int x)
 
                /* Debug */
 #ifdef JP
-if (wizard) msg_print("(ÇË»)");
+               if (wizard) msg_print("(ÇË»)");
 #else
                if (wizard) msg_print("(breakage)");
 #endif
@@ -4945,7 +4921,7 @@ if (wizard) msg_print("(
                        if (s > bs) bn = 0;
 
                        /* Apply the randomizer to equivalent values */
-                       if ((++bn >= 2) && (rand_int(bn) != 0)) continue;
+                       if ((++bn >= 2) && !one_in_(bn)) continue;
 
                        /* Keep score */
                        bs = s;
@@ -4974,7 +4950,7 @@ if (wizard) msg_print("(
 
                /* Debug */
 #ifdef JP
-if (wizard) msg_print("(¾²¥¹¥Ú¡¼¥¹¤¬¤Ê¤¤)");
+               if (wizard) msg_print("(¾²¥¹¥Ú¡¼¥¹¤¬¤Ê¤¤)");
 #else
                if (wizard) msg_print("(no floor space)");
 #endif
@@ -5069,7 +5045,7 @@ if (wizard) msg_print("(
 
                /* Debug */
 #ifdef JP
-if (wizard) msg_print("(¥¢¥¤¥Æ¥à¤¬Â¿²á¤®¤ë)");
+               if (wizard) msg_print("(¥¢¥¤¥Æ¥à¤¬Â¿²á¤®¤ë)");
 #else
                if (wizard) msg_print("(too many objects)");
 #endif
@@ -5125,7 +5101,7 @@ if (wizard) msg_print("(
        if (chance && (by == py) && (bx == px))
        {
 #ifdef JP
-msg_print("²¿¤«¤¬Â­²¼¤Ëž¤¬¤Ã¤Æ¤­¤¿¡£");
+               msg_print("²¿¤«¤¬Â­²¼¤Ëž¤¬¤Ã¤Æ¤­¤¿¡£");
 #else
                msg_print("You feel something roll beneath your feet.");
 #endif
@@ -5165,10 +5141,6 @@ void acquirement(int y1, int x1, int num, bool great, bool known)
                        object_known(i_ptr);
                }
 
-#ifdef USE_SCRIPT
-               i_ptr->python = object_create_callback(i_ptr);
-#endif /* USE_SCRIPT */
-
                /* Drop the object */
                (void)drop_near(i_ptr, -1, y1, x1);
        }
@@ -5396,10 +5368,6 @@ void inven_item_optimize(int item)
                /* One less item */
                inven_cnt--;
 
-#ifdef USE_SCRIPT
-               object_delete_callback(&inventory[item]);
-#endif /* USE_SCRIPT */
-
                /* Slide everything down */
                for (i = item; i < INVEN_PACK; i++)
                {
@@ -5420,10 +5388,6 @@ void inven_item_optimize(int item)
                /* One less item */
                equip_cnt--;
 
-#ifdef USE_SCRIPT
-               object_delete_callback(&inventory[item]);
-#endif /* USE_SCRIPT */
-
                /* Erase the empty slot */
                object_wipe(&inventory[item]);
 
@@ -5724,11 +5688,6 @@ s16b inven_carry(object_type *o_ptr)
                        object_copy(&inventory[k+1], &inventory[k]);
                }
 
-#ifdef USE_SCRIPT
-               /* Not a real deletion */
-               /* object_delete_callback(&inventory[i]); */
-#endif /* USE_SCRIPT */
-
                /* Wipe the empty slot */
                object_wipe(&inventory[i]);
        }
@@ -5821,7 +5780,7 @@ s16b inven_takeoff(int item, int amt)
        if (item == INVEN_RARM)
        {
 #ifdef JP
-act = "¤òÁõÈ÷¤«¤é¤Ï¤º¤·¤¿";
+               act = "¤òÁõÈ÷¤«¤é¤Ï¤º¤·¤¿";
 #else
                act = "You were wielding";
 #endif
@@ -5832,7 +5791,7 @@ act = "
        else if (item == INVEN_BOW)
        {
 #ifdef JP
-act = "¤òÁõÈ÷¤«¤é¤Ï¤º¤·¤¿";
+               act = "¤òÁõÈ÷¤«¤é¤Ï¤º¤·¤¿";
 #else
                act = "You were holding";
 #endif
@@ -5843,7 +5802,7 @@ act = "
        else if (item == INVEN_LITE)
        {
 #ifdef JP
-act = "¤ò¸÷¸»¤«¤é¤Ï¤º¤·¤¿";
+               act = "¤ò¸÷¸»¤«¤é¤Ï¤º¤·¤¿";
 #else
                act = "You were holding";
 #endif
@@ -5854,7 +5813,7 @@ act = "
        else
        {
 #ifdef JP
-act = "¤òÁõÈ÷¤«¤é¤Ï¤º¤·¤¿";
+               act = "¤òÁõÈ÷¤«¤é¤Ï¤º¤·¤¿";
 #else
                act = "You were wearing";
 #endif
@@ -5934,7 +5893,7 @@ void inven_drop(int item, int amt)
 
        /* Message */
 #ifdef JP
-msg_format("%s(%c)¤òÍî¤È¤·¤¿¡£", o_name, index_to_label(item));
+       msg_format("%s(%c)¤òÍî¤È¤·¤¿¡£", o_name, index_to_label(item));
 #else
        msg_format("You drop %s (%c).", o_name, index_to_label(item));
 #endif
@@ -6000,10 +5959,6 @@ void combine_pack(void)
                                        inventory[k] = inventory[k+1];
                                }
 
-#ifdef USE_SCRIPT
-                               object_delete_callback(&inventory[k]);
-#endif /* USE_SCRIPT */
-
                                /* Erase the "final" slot */
                                object_wipe(&inventory[k]);
 
@@ -6018,7 +5973,7 @@ void combine_pack(void)
 
        /* Message */
 #ifdef JP
-if (flag) msg_print("¥¶¥Ã¥¯¤ÎÃæ¤Î¥¢¥¤¥Æ¥à¤ò¤Þ¤È¤áľ¤·¤¿¡£");
+       if (flag) msg_print("¥¶¥Ã¥¯¤ÎÃæ¤Î¥¢¥¤¥Æ¥à¤ò¤Þ¤È¤áľ¤·¤¿¡£");
 #else
        if (flag) msg_print("You combine some items in your pack.");
 #endif
@@ -6140,7 +6095,7 @@ void reorder_pack(void)
 
        /* Message */
 #ifdef JP
-if (flag) msg_print("¥¶¥Ã¥¯¤ÎÃæ¤Î¥¢¥¤¥Æ¥à¤òÊ¤Ùľ¤·¤¿¡£");
+       if (flag) msg_print("¥¶¥Ã¥¯¤ÎÃæ¤Î¥¢¥¤¥Æ¥à¤òÊ¤Ùľ¤·¤¿¡£");
 #else
        if (flag) msg_print("You reorder some items in your pack.");
 #endif
@@ -6218,38 +6173,76 @@ void display_koff(int k_idx)
        }
 }
 
+/* Choose one of items that have warning flag */
+object_type *choose_warning_item(void)
+{
+       int i;
+       int choices[INVEN_TOTAL-INVEN_RARM];
+       int number = 0;
+
+       /* Paranoia -- Player has no warning-item */
+       if (!p_ptr->warning) return (NULL);
+
+       /* Search Inventry */
+       for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
+       {
+               u32b f1, f2, f3;
+               object_type *o_ptr = &inventory[i];
+
+               object_flags(o_ptr, &f1, &f2, &f3);
+               if (f3 & (TR3_WARNING))
+               {
+                       choices[number] = i;
+                       number++;
+               }
+       }
+
+       /* Choice one of them */
+       return (&inventory[choices[rand_int(number)]]);
+}
+
 /* Examine the grid (xx,yy) and warn the player if there are any danger */
-bool process_frakir(int xx, int yy){
-  int mx,my;
-  cave_type *c_ptr;
+bool process_frakir(int xx, int yy)
+{
+       int mx,my;
+       cave_type *c_ptr;
+       char o_name[MAX_NLEN];
 
 #define FRAKIR_AWARE_RANGE 12
-  int dam_max=0;
-  static int old_damage = 0;
-  
-  for (mx=xx-FRAKIR_AWARE_RANGE;mx<xx+FRAKIR_AWARE_RANGE+1;mx++){
-    for (my=yy-FRAKIR_AWARE_RANGE;my<yy+FRAKIR_AWARE_RANGE+1;my++){
-      if (!in_bounds(my,mx) || (distance(my,mx,yy,xx)>FRAKIR_AWARE_RANGE))continue;
-      
-      c_ptr = &cave[my][mx];
-      if (c_ptr->m_idx > 0){
-       
-       int dam_max0=0;
-       int m_idx = c_ptr->m_idx;
-       monster_type *m_ptr = &m_list[m_idx];
-       monster_race *r_ptr = &r_info[m_ptr->r_idx];
+       int dam_max = 0;
+       static int old_damage = 0;
+
+       for (mx = xx-FRAKIR_AWARE_RANGE; mx < xx+FRAKIR_AWARE_RANGE+1; mx++)
+       {
+               for (my = yy-FRAKIR_AWARE_RANGE; my < yy+FRAKIR_AWARE_RANGE+1; my++)
+               {
+                       int dam_max0=0;
+                       monster_type *m_ptr;
+                       monster_race *r_ptr;
+                       u32b f4, f5, f6;
+                       int rlev;
 
-       u32b  f4 = r_ptr->flags4;
-       u32b  f5 = r_ptr->flags5;
-       u32b  f6 = r_ptr->flags6;
+                       if (!in_bounds(my,mx) || (distance(my,mx,yy,xx)>FRAKIR_AWARE_RANGE)) continue;
 
-       int   rlev = ((r_ptr->level >= 1) ? r_ptr->level : 1);
+                       c_ptr = &cave[my][mx];
 
-       if (m_ptr->csleep) continue;
-       if (is_pet(m_ptr)) continue;
+                       if (!c_ptr->m_idx) continue;
 
-       /* Monster spells (only powerful ones)*/
-       if(projectable(my,mx,yy,xx)){
+                       m_ptr = &m_list[c_ptr->m_idx];
+                       r_ptr = &r_info[m_ptr->r_idx];
+
+                       f4 = r_ptr->flags4;
+                       f5 = r_ptr->flags5;
+                       f6 = r_ptr->flags6;
+
+                       rlev = ((r_ptr->level >= 1) ? r_ptr->level : 1);
+
+                       if (m_ptr->csleep) continue;
+                       if (is_pet(m_ptr)) continue;
+
+                       /* Monster spells (only powerful ones)*/
+                       if(projectable(my,mx,yy,xx))
+                       {
 
 #define DAMCALC(f,val,max,im,vln,res,resx,resy,op,opx,opy,dmax) \
           if (f){ int dam = (val)>(max)? (max):(val); \
@@ -6260,169 +6253,173 @@ bool process_frakir(int xx, int yy){
            if (dam>dmax) dmax = dam; \
            }
 
-           DAMCALC(f4 & (RF4_BR_FIRE), m_ptr->hp / 3, 1600, 
-                   p_ptr->immune_fire, p_ptr->muta3 & MUT3_VULN_ELEM,
-                   p_ptr->resist_fire, 1, 3,
-                   p_ptr->oppose_fire, 1, 3, dam_max0);
+                               DAMCALC(f4 & (RF4_BR_FIRE), m_ptr->hp / 3, 1600, 
+                                       p_ptr->immune_fire, p_ptr->muta3 & MUT3_VULN_ELEM,
+                                       p_ptr->resist_fire, 1, 3,
+                                       p_ptr->oppose_fire, 1, 3, dam_max0);
 
-           DAMCALC(f4 & (RF4_BR_COLD), m_ptr->hp / 3, 1600, 
-                   p_ptr->immune_cold, p_ptr->muta3 & MUT3_VULN_ELEM,
-                   p_ptr->resist_cold, 1, 3,
-                   p_ptr->oppose_cold, 1, 3, dam_max0);
+                               DAMCALC(f4 & (RF4_BR_COLD), m_ptr->hp / 3, 1600, 
+                                       p_ptr->immune_cold, p_ptr->muta3 & MUT3_VULN_ELEM,
+                                       p_ptr->resist_cold, 1, 3,
+                                       p_ptr->oppose_cold, 1, 3, dam_max0);
 
-           DAMCALC(f4 & (RF4_BR_ELEC), m_ptr->hp / 3, 1600, 
-                   p_ptr->immune_elec, p_ptr->muta3 & MUT3_VULN_ELEM,
-                   p_ptr->resist_elec, 1, 3,
-                   p_ptr->oppose_elec, 1, 3, dam_max0);
+                               DAMCALC(f4 & (RF4_BR_ELEC), m_ptr->hp / 3, 1600, 
+                                       p_ptr->immune_elec, p_ptr->muta3 & MUT3_VULN_ELEM,
+                                       p_ptr->resist_elec, 1, 3,
+                                       p_ptr->oppose_elec, 1, 3, dam_max0);
 
-           DAMCALC(f4 & (RF4_BR_ACID), m_ptr->hp / 3, 1600, 
-                   p_ptr->immune_acid, p_ptr->muta3 & MUT3_VULN_ELEM,
-                   p_ptr->resist_acid, 1, 3,
-                   p_ptr->oppose_acid, 1, 3, dam_max0);
+                               DAMCALC(f4 & (RF4_BR_ACID), m_ptr->hp / 3, 1600, 
+                                       p_ptr->immune_acid, p_ptr->muta3 & MUT3_VULN_ELEM,
+                                       p_ptr->resist_acid, 1, 3,
+                                       p_ptr->oppose_acid, 1, 3, dam_max0);
 
-           DAMCALC(f4 & (RF4_BR_POIS), m_ptr->hp / 3, 800,
-                   FALSE , FALSE,
-                   p_ptr->resist_pois, 1, 3,
-                   p_ptr->oppose_pois, 1, 3, dam_max0);
+                               DAMCALC(f4 & (RF4_BR_POIS), m_ptr->hp / 3, 800,
+                                       FALSE , FALSE,
+                                       p_ptr->resist_pois, 1, 3,
+                                       p_ptr->oppose_pois, 1, 3, dam_max0);
 
 
-           DAMCALC(f4 & (RF4_BR_NETH), m_ptr->hp / 6, 550, FALSE , FALSE,
-                   p_ptr->resist_neth, 6, 9, FALSE, 1, 1, dam_max0);
+                               DAMCALC(f4 & (RF4_BR_NETH), m_ptr->hp / 6, 550, FALSE , FALSE,
+                                       p_ptr->resist_neth, 6, 9, FALSE, 1, 1, dam_max0);
 
-           DAMCALC(f4 & (RF4_BR_LITE), m_ptr->hp / 6, 400, FALSE , FALSE,
-                   p_ptr->resist_lite, 4, 9, FALSE, 1, 1, dam_max0);
+                               DAMCALC(f4 & (RF4_BR_LITE), m_ptr->hp / 6, 400, FALSE , FALSE,
+                                       p_ptr->resist_lite, 4, 9, FALSE, 1, 1, dam_max0);
 
-           DAMCALC(f4 & (RF4_BR_DARK), m_ptr->hp / 6, 400, FALSE , FALSE,
-                   p_ptr->resist_dark, 4, 9, FALSE, 1, 1, dam_max0);
+                               DAMCALC(f4 & (RF4_BR_DARK), m_ptr->hp / 6, 400, FALSE , FALSE,
+                                       p_ptr->resist_dark, 4, 9, FALSE, 1, 1, dam_max0);
 
-           DAMCALC(f4 & (RF4_BR_CONF), m_ptr->hp / 6, 450, FALSE , FALSE,
-                   p_ptr->resist_conf, 5, 9, FALSE, 1, 1, dam_max0);
+                               DAMCALC(f4 & (RF4_BR_CONF), m_ptr->hp / 6, 450, FALSE , FALSE,
+                                       p_ptr->resist_conf, 5, 9, FALSE, 1, 1, dam_max0);
 
-           DAMCALC(f4 & (RF4_BR_SOUN), m_ptr->hp / 6, 450, FALSE , FALSE,
-                   p_ptr->resist_sound, 5, 9, FALSE, 1, 1, dam_max0);
+                               DAMCALC(f4 & (RF4_BR_SOUN), m_ptr->hp / 6, 450, FALSE , FALSE,
+                                       p_ptr->resist_sound, 5, 9, FALSE, 1, 1, dam_max0);
 
-           DAMCALC(f4 & (RF4_BR_CHAO), m_ptr->hp / 6, 600, FALSE , FALSE,
-                   p_ptr->resist_chaos, 6, 9, FALSE, 1, 1, dam_max0);
+                               DAMCALC(f4 & (RF4_BR_CHAO), m_ptr->hp / 6, 600, FALSE , FALSE,
+                                       p_ptr->resist_chaos, 6, 9, FALSE, 1, 1, dam_max0);
 
-           DAMCALC(f4 & (RF4_BR_DISE), m_ptr->hp / 6, 500, FALSE , FALSE,
-                   p_ptr->resist_disen, 6, 9, FALSE, 1, 1, dam_max0);
+                               DAMCALC(f4 & (RF4_BR_DISE), m_ptr->hp / 6, 500, FALSE , FALSE,
+                                       p_ptr->resist_disen, 6, 9, FALSE, 1, 1, dam_max0);
 
-           DAMCALC(f4 & (RF4_BR_NEXU), m_ptr->hp / 3, 250, FALSE , FALSE,
-                   p_ptr->resist_nexus, 6, 9, FALSE, 1, 1, dam_max0);
+                               DAMCALC(f4 & (RF4_BR_NEXU), m_ptr->hp / 3, 250, FALSE , FALSE,
+                                       p_ptr->resist_nexus, 6, 9, FALSE, 1, 1, dam_max0);
 
-           DAMCALC(f4 & (RF4_BR_TIME), m_ptr->hp / 3, 150, FALSE , FALSE,
-                   FALSE, 1, 1, FALSE, 1, 1, dam_max0);
+                               DAMCALC(f4 & (RF4_BR_TIME), m_ptr->hp / 3, 150, FALSE , FALSE,
+                                       FALSE, 1, 1, FALSE, 1, 1, dam_max0);
 
-           DAMCALC(f4 & (RF4_BR_INER), m_ptr->hp / 6, 200, FALSE , FALSE,
-                   FALSE, 1, 1, FALSE, 1, 1, dam_max0);
+                               DAMCALC(f4 & (RF4_BR_INER), m_ptr->hp / 6, 200, FALSE , FALSE,
+                                       FALSE, 1, 1, FALSE, 1, 1, dam_max0);
 
-           DAMCALC(f4 & (RF4_BR_GRAV), m_ptr->hp / 3, 200, FALSE , FALSE,
-                   FALSE, 1, 1, FALSE, 1, 1, dam_max0);
+                               DAMCALC(f4 & (RF4_BR_GRAV), m_ptr->hp / 3, 200, FALSE , FALSE,
+                                       FALSE, 1, 1, FALSE, 1, 1, dam_max0);
 
-           DAMCALC(f4 & (RF4_BR_SHAR), m_ptr->hp / 6, 500, FALSE , FALSE,
-                   p_ptr->resist_shard, 6, 9, FALSE, 1, 1, dam_max0);
+                               DAMCALC(f4 & (RF4_BR_SHAR), m_ptr->hp / 6, 500, FALSE , FALSE,
+                                       p_ptr->resist_shard, 6, 9, FALSE, 1, 1, dam_max0);
 
-           DAMCALC(f4 & (RF4_BR_PLAS), m_ptr->hp / 6, 150, FALSE , FALSE,
-                   FALSE, 1, 1, FALSE, 1, 1, dam_max0);
+                               DAMCALC(f4 & (RF4_BR_PLAS), m_ptr->hp / 6, 150, FALSE , FALSE,
+                                       FALSE, 1, 1, FALSE, 1, 1, dam_max0);
 
-           DAMCALC(f4 & (RF4_BR_WALL), m_ptr->hp / 6, 200, FALSE , FALSE,
-                   FALSE, 1, 1, FALSE, 1, 1, dam_max0);
+                               DAMCALC(f4 & (RF4_BR_WALL), m_ptr->hp / 6, 200, FALSE , FALSE,
+                                       FALSE, 1, 1, FALSE, 1, 1, dam_max0);
 
-           DAMCALC(f4 & (RF4_BR_MANA), m_ptr->hp / 3, 250, FALSE , FALSE,
-                   FALSE, 1, 1, FALSE, 1, 1, dam_max0);
+                               DAMCALC(f4 & (RF4_BR_MANA), m_ptr->hp / 3, 250, FALSE , FALSE,
+                                       FALSE, 1, 1, FALSE, 1, 1, dam_max0);
 
-           DAMCALC(f4 & (RF4_BR_NUKE), m_ptr->hp / 3, 800, FALSE , FALSE,
-                   p_ptr->resist_pois, 2, 5, 
-                   p_ptr->oppose_pois, 2, 5, dam_max0);
+                               DAMCALC(f4 & (RF4_BR_NUKE), m_ptr->hp / 3, 800, FALSE , FALSE,
+                                       p_ptr->resist_pois, 2, 5, 
+                                       p_ptr->oppose_pois, 2, 5, dam_max0);
 
-           DAMCALC(f4 & (RF4_BR_DISI), m_ptr->hp / 3, 300, FALSE , FALSE,
-                   FALSE, 1, 1, FALSE, 1, 1, dam_max0);
+                               DAMCALC(f4 & (RF4_BR_DISI), m_ptr->hp / 3, 300, FALSE , FALSE,
+                                       FALSE, 1, 1, FALSE, 1, 1, dam_max0);
 
 
-           DAMCALC(f4 & (RF4_ROCKET), m_ptr->hp / 4, 800, FALSE , FALSE,
-                   p_ptr->resist_shard, 1, 2, FALSE, 1, 1, dam_max0);
+                               DAMCALC(f4 & (RF4_ROCKET), m_ptr->hp / 4, 800, FALSE , FALSE,
+                                       p_ptr->resist_shard, 1, 2, FALSE, 1, 1, dam_max0);
 
-           DAMCALC(f5 & (RF5_BA_MANA), rlev*4 + 150, 9999, FALSE , FALSE,
-                   FALSE, 1, 1, FALSE, 1, 1, dam_max0);
+                               DAMCALC(f5 & (RF5_BA_MANA), rlev*4 + 150, 9999, FALSE , FALSE,
+                                       FALSE, 1, 1, FALSE, 1, 1, dam_max0);
 
-           DAMCALC(f5 & (RF5_BA_DARK), rlev*4 + 150, 9999, FALSE , FALSE,
-                   p_ptr->resist_dark, 4, 9, FALSE, 1, 1, dam_max0);
+                               DAMCALC(f5 & (RF5_BA_DARK), rlev*4 + 150, 9999, FALSE , FALSE,
+                                       p_ptr->resist_dark, 4, 9, FALSE, 1, 1, dam_max0);
 
-           DAMCALC(f5 & (RF5_BA_LITE), rlev*4 + 150, 9999, FALSE , FALSE,
-                   p_ptr->resist_lite, 4, 9, FALSE, 1, 1, dam_max0);
+                               DAMCALC(f5 & (RF5_BA_LITE), rlev*4 + 150, 9999, FALSE , FALSE,
+                                       p_ptr->resist_lite, 4, 9, FALSE, 1, 1, dam_max0);
 
 
-           DAMCALC(f4 & (RF4_ROCKET),m_ptr->hp / 4, 800, FALSE , FALSE,
-                   p_ptr->resist_shard, 1, 2, FALSE, 1, 1, dam_max0);
+                               DAMCALC(f6 & (RF6_HAND_DOOM), p_ptr->chp*6/10, 9999, FALSE , FALSE,
+                                       FALSE, 1, 1, FALSE, 1, 1, dam_max0);
 
-           DAMCALC(f6 & (RF6_HAND_DOOM), p_ptr->chp*6/10, 9999, FALSE , FALSE,
-                   FALSE, 1, 1, FALSE, 1, 1, dam_max0);
+                       }
 
-       }
+                       /* Monster melee attacks */
+                       if(mx <= xx+1 && mx >= xx-1 && my <=yy+1 && my >= yy-1)
+                       {
+                               int m;
+                               int dam_melee=0;
+                               for (m = 0; m < 4; m++)
+                               {
+                                       int d1, d2;
+
+                                       /* Skip non-attacks */
+                                       if (!r_ptr->blow[m].method) continue;
+
+                                       /* Extract the attack info */
+                                       d1 = r_ptr->blow[m].d_dice;
+                                       d2 = r_ptr->blow[m].d_side;
+
+                                       dam_melee += d1*d2;
+                               }
+                               if(dam_melee>dam_max0)dam_max0=dam_melee;
+                       }
 
-       /* Monster melee attacks */
-       if( mx <= xx+1 && mx >= xx-1 && my <=yy+1 && my >= yy-1 ){
-         int m;
-         int dam_melee=0;
-         for (m = 0; m < 4; m++)
-           {
-             int d1, d2;
-             
-             /* Skip non-attacks */
-             if (!r_ptr->blow[m].method) continue;
-             
-             /* Extract the attack info */
-             d1 = r_ptr->blow[m].d_dice;
-             d2 = r_ptr->blow[m].d_side;
-             
-             dam_melee += d1*d2;
-           }
-        if(dam_melee>dam_max0)dam_max0=dam_melee;
+                       /* Contribution from this monster */
+                       dam_max+=dam_max0;
+               }
        }
 
-       /* Contribution from this monster */
-       dam_max+=dam_max0;
-      }
-      
-      
-    }
-  }
+       /* Prevent excessive warning */
+       if(dam_max > old_damage)
+       {
+               old_damage=dam_max * 3 / 2;
+
+               if (dam_max>(p_ptr->chp)/2)
+               {
+                       object_type *o_ptr = choose_warning_item();
 
-  /* Prevent excessive warning */
-  if(dam_max>old_damage){
-    old_damage=dam_max * 3 / 2;
-    
-    if (dam_max>(p_ptr->chp)/2){
+                       object_desc(o_name, o_ptr, FALSE, 0);
 #ifdef JP
-      msg_print("»ØÎؤ¬±Ô¤¯¿Ì¤¨¤¿¡ª");
+                       msg_format("%s¤¬±Ô¤¯¿Ì¤¨¤¿¡ª", o_name);
 #else
-      msg_print("The Ring pulsates sharply!");
+                       msg_format("%s pulsates sharply!", o_name);
 #endif
-      disturb(0,0);
+                       disturb(0,0);
 #ifdef JP
-      return(get_check("ËÜÅö¤Ë¤³¤Î¤Þ¤Þ¿Ê¤à¤«¡©"));
+                       return (get_check("ËÜÅö¤Ë¤³¤Î¤Þ¤Þ¿Ê¤à¤«¡©"));
 #else
-      return(get_check("Realy want to go ahead? "));
+                       return (get_check("Realy want to go ahead? "));
 #endif
-    }
-  }
-  else old_damage = old_damage/2;
+               }
+       }
+       else old_damage = old_damage/2;
 
-  c_ptr = &cave[yy][xx];
-  if (((is_trap(c_ptr->feat) && !easy_disarm) || (c_ptr->info & CAVE_TRAP)) && randint(13)!=1){
+       c_ptr = &cave[yy][xx];
+       if (((is_trap(c_ptr->feat) && !easy_disarm) || (c_ptr->info & CAVE_TRAP)) && !one_in_(13))
+       {
+               object_type *o_ptr = choose_warning_item();
+
+               object_desc(o_name, o_ptr, FALSE, 0);
 #ifdef JP
-    msg_print("»ØÎؤ¬¿Ì¤¨¤¿¡ª");
+               msg_format("%s¤¬¿Ì¤¨¤¿¡ª", o_name);
 #else
-    msg_print("The Ring pulsates!");
+               msg_format("%s pulsates!", o_name);
 #endif
-    disturb(0,0);
+               disturb(0,0);
 #ifdef JP
-      return(get_check("ËÜÅö¤Ë¤³¤Î¤Þ¤Þ¿Ê¤à¤«¡©"));
+               return (get_check("ËÜÅö¤Ë¤³¤Î¤Þ¤Þ¿Ê¤à¤«¡©"));
 #else
-      return(get_check("Realy want to go ahead? "));
+               return (get_check("Realy want to go ahead? "));
 #endif
-  }
-  return(TRUE);
+       }
+       return(TRUE);
 }
 
 
@@ -6734,8 +6731,8 @@ static void drain_essence(void)
 
        /* Get an item */
 #ifdef JP
-q = "¤É¤Î¥¢¥¤¥Æ¥à¤«¤éÃê½Ð¤·¤Þ¤¹¤«¡©";
-s = "Ãê½Ð¤Ç¤­¤ë¥¢¥¤¥Æ¥à¤¬¤¢¤ê¤Þ¤»¤ó¡£";
+       q = "¤É¤Î¥¢¥¤¥Æ¥à¤«¤éÃê½Ð¤·¤Þ¤¹¤«¡©";
+       s = "Ãê½Ð¤Ç¤­¤ë¥¢¥¤¥Æ¥à¤¬¤¢¤ê¤Þ¤»¤ó¡£";
 #else
        q = "Extract from which item? ";
        s = "You have nothing you can extract from.";
@@ -7091,7 +7088,7 @@ static void add_essence(int mode)
 
        /* Build a prompt */
 #ifdef JP
-(void) strnfmt(out_val, 78, "('*'¤Ç°ìÍ÷, ESC¤ÇÃæÃÇ) ¤É¤ÎǽÎϤòÉղä·¤Þ¤¹¤«¡©");
+       (void) strnfmt(out_val, 78, "('*'¤Ç°ìÍ÷, ESC¤ÇÃæÃÇ) ¤É¤ÎǽÎϤòÉղä·¤Þ¤¹¤«¡©");
 #else
        (void)strnfmt(out_val, 78, "(*=List, ESC=exit) Add which ability? ");
 #endif
@@ -7368,8 +7365,8 @@ static void add_essence(int mode)
 
        /* Get an item */
 #ifdef JP
-q = "¤É¤Î¥¢¥¤¥Æ¥à¤ò²þÎɤ·¤Þ¤¹¤«¡©";
-s = "²þÎɤǤ­¤ë¥¢¥¤¥Æ¥à¤¬¤¢¤ê¤Þ¤»¤ó¡£";
+       q = "¤É¤Î¥¢¥¤¥Æ¥à¤ò²þÎɤ·¤Þ¤¹¤«¡©";
+       s = "²þÎɤǤ­¤ë¥¢¥¤¥Æ¥à¤¬¤¢¤ê¤Þ¤»¤ó¡£";
 #else
        q = "Improve which item? ";
        s = "You have nothing to improve.";
@@ -7680,8 +7677,8 @@ void erase_essence(void)
 
        /* Get an item */
 #ifdef JP
-q = "¤É¤Î¥¢¥¤¥Æ¥à¤Î¥¨¥Ã¥»¥ó¥¹¤ò¾Ãµî¤·¤Þ¤¹¤«¡©";
-s = "¥¨¥Ã¥»¥ó¥¹¤òÉղä·¤¿¥¢¥¤¥Æ¥à¤¬¤¢¤ê¤Þ¤»¤ó¡£";
+       q = "¤É¤Î¥¢¥¤¥Æ¥à¤Î¥¨¥Ã¥»¥ó¥¹¤ò¾Ãµî¤·¤Þ¤¹¤«¡©";
+       s = "¥¨¥Ã¥»¥ó¥¹¤òÉղä·¤¿¥¢¥¤¥Æ¥à¤¬¤¢¤ê¤Þ¤»¤ó¡£";
 #else
        q = "Remove from which item? ";
        s = "You have nothing to remove essence.";
@@ -7744,7 +7741,7 @@ void do_cmd_kaji(bool only_browse)
                if (p_ptr->confused)
                {
 #ifdef JP
-msg_print("º®Í𤷤Ƥ¤¤Æºî¶È¤Ç¤­¤Ê¤¤¡ª");
+                       msg_print("º®Í𤷤Ƥ¤¤Æºî¶È¤Ç¤­¤Ê¤¤¡ª");
 #else
                        msg_print("You are too confused!");
 #endif
@@ -7754,7 +7751,7 @@ msg_print("
                if (p_ptr->blind)
                {
 #ifdef JP
-msg_print("Ìܤ¬¸«¤¨¤Ê¤¯¤Æºî¶È¤Ç¤­¤Ê¤¤¡ª");
+                       msg_print("Ìܤ¬¸«¤¨¤Ê¤¯¤Æºî¶È¤Ç¤­¤Ê¤¤¡ª");
 #else
                        msg_print("You are blind!");
 #endif
@@ -7764,7 +7761,7 @@ msg_print("
                if (p_ptr->image)
                {
 #ifdef JP
-msg_print("¤¦¤Þ¤¯¸«¤¨¤Ê¤¯¤Æºî¶È¤Ç¤­¤Ê¤¤¡ª");
+                       msg_print("¤¦¤Þ¤¯¸«¤¨¤Ê¤¯¤Æºî¶È¤Ç¤­¤Ê¤¤¡ª");
 #else
                        msg_print("You are hullcinating!");
 #endif