OSDN Git Service

Add new option -- show_ammo_detail / show_ammo_no_crit
[hengband/hengband.git] / src / cmd6.c
index 44e0555..6405293 100644 (file)
@@ -1580,7 +1580,6 @@ static void do_cmd_read_scroll_aux(int item, bool known)
 {
        int         k, used_up, ident, lev;
        object_type *o_ptr;
-       char        Rumor[1024];
 
 
        /* Get the item (in the pack) */
@@ -2108,6 +2107,20 @@ take_hit(DAMAGE_NOESCAPE, 111+randint1(111), "
                        if (!reset_recall()) used_up = FALSE;
                        break;
                }
+
+               case SV_SCROLL_AMUSEMENT:
+               {
+                       ident = TRUE;
+                       amusement(py, px, 1, FALSE);
+                       break;
+               }
+
+               case SV_SCROLL_STAR_AMUSEMENT:
+               {
+                       ident = TRUE;
+                       amusement(py, px,  randint1(2) + 1, FALSE);
+                       break;
+               }
        }
        }
        else if (o_ptr->name1 == ART_GHB)
@@ -2306,10 +2319,12 @@ void do_cmd_read_scroll(void)
 }
 
 
-static int staff_effect(int sval, bool *use_charge, bool magic, bool known)
+static int staff_effect(int sval, bool *use_charge, bool powerful, bool magic, bool known)
 {
        int k;
        int ident = FALSE;
+       int lev = powerful ? p_ptr->lev * 2 : p_ptr->lev;
+       int detect_rad = powerful ? DETECT_RAD_DEFAULT * 3 / 2 : DETECT_RAD_DEFAULT;
 
        /* Analyze the staff */
        switch (sval)
@@ -2320,7 +2335,7 @@ static int staff_effect(int sval, bool *use_charge, bool magic, bool known)
                        {
                                if (set_blind(p_ptr->blind + 3 + randint1(5))) ident = TRUE;
                        }
-                       if (unlite_area(10, 3)) ident = TRUE;
+                       if (unlite_area(10, (powerful ? 6 : 3))) ident = TRUE;
                        break;
                }
 
@@ -2338,7 +2353,8 @@ static int staff_effect(int sval, bool *use_charge, bool magic, bool known)
 
                case SV_STAFF_SUMMONING:
                {
-                       for (k = 0; k < randint1(4); k++)
+                       const int times = randint1(powerful ? 8 : 4);
+                       for (k = 0; k < times; k++)
                        {
                                if (summon_specific(0, py, px, dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
                                {
@@ -2350,21 +2366,26 @@ static int staff_effect(int sval, bool *use_charge, bool magic, bool known)
 
                case SV_STAFF_TELEPORTATION:
                {
-                       teleport_player(100, 0L);
+                       teleport_player((powerful ? 150 : 100), 0L);
                        ident = TRUE;
                        break;
                }
 
                case SV_STAFF_IDENTIFY:
                {
-                       if (!ident_spell(FALSE)) *use_charge = FALSE;
+                       if (powerful) {
+                               if (!identify_fully(FALSE)) *use_charge = FALSE;
+                       } else {
+                               if (!ident_spell(FALSE)) *use_charge = FALSE;
+                       }
                        ident = TRUE;
                        break;
                }
 
                case SV_STAFF_REMOVE_CURSE:
                {
-                       if (remove_curse())
+                       bool result = powerful ? remove_all_curse() : remove_curse();
+                       if (result)
                        {
                                if (magic)
                                {
@@ -2416,7 +2437,7 @@ static int staff_effect(int sval, bool *use_charge, bool magic, bool known)
                                        if (!player_bold(y, x)) break;
                                }
 
-                               project(0, 0, y, x, damroll(6 + p_ptr->lev / 8, 10), GF_LITE_WEAK,
+                               project(0, 0, y, x, damroll(6 + lev / 8, 10), GF_LITE_WEAK,
                                                  (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_KILL), -1);
                        }
                        ident = TRUE;
@@ -2425,58 +2446,63 @@ static int staff_effect(int sval, bool *use_charge, bool magic, bool known)
 
                case SV_STAFF_LITE:
                {
-                       if (lite_area(damroll(2, 8), 2)) ident = TRUE;
+                       if (lite_area(damroll(2, 8), (powerful ? 4 : 2))) ident = TRUE;
                        break;
                }
 
                case SV_STAFF_MAPPING:
                {
-                       map_area(DETECT_RAD_MAP);
+                       map_area(powerful ? DETECT_RAD_MAP * 3 / 2 : DETECT_RAD_MAP);
                        ident = TRUE;
                        break;
                }
 
                case SV_STAFF_DETECT_GOLD:
                {
-                       if (detect_treasure(DETECT_RAD_DEFAULT)) ident = TRUE;
-                       if (detect_objects_gold(DETECT_RAD_DEFAULT)) ident = TRUE;
+                       if (detect_treasure(detect_rad)) ident = TRUE;
+                       if (detect_objects_gold(detect_rad)) ident = TRUE;
                        break;
                }
 
                case SV_STAFF_DETECT_ITEM:
                {
-                       if (detect_objects_normal(DETECT_RAD_DEFAULT)) ident = TRUE;
+                       if (detect_objects_normal(detect_rad)) ident = TRUE;
                        break;
                }
 
                case SV_STAFF_DETECT_TRAP:
                {
-                       if (detect_traps(DETECT_RAD_DEFAULT, known)) ident = TRUE;
+                       if (detect_traps(detect_rad, known)) ident = TRUE;
                        break;
                }
 
                case SV_STAFF_DETECT_DOOR:
                {
-                       if (detect_doors(DETECT_RAD_DEFAULT)) ident = TRUE;
-                       if (detect_stairs(DETECT_RAD_DEFAULT)) ident = TRUE;
+                       if (detect_doors(detect_rad)) ident = TRUE;
+                       if (detect_stairs(detect_rad)) ident = TRUE;
                        break;
                }
 
                case SV_STAFF_DETECT_INVIS:
                {
-                       if (detect_monsters_invis(DETECT_RAD_DEFAULT)) ident = TRUE;
+                       if (detect_monsters_invis(detect_rad)) ident = TRUE;
                        break;
                }
 
                case SV_STAFF_DETECT_EVIL:
                {
-                       if (detect_monsters_evil(DETECT_RAD_DEFAULT)) ident = TRUE;
+                       if (detect_monsters_evil(detect_rad)) ident = TRUE;
                        break;
                }
 
                case SV_STAFF_CURE_LIGHT:
                {
-                       if (hp_player(damroll(2, 8))) ident = TRUE;
+                       if (hp_player(damroll((powerful ? 4 : 2), 8))) ident = TRUE;
+                       if (powerful) {
+                               if (set_blind(0)) ident = TRUE;
+                               if (set_poisoned(0)) ident = TRUE;
+                               if (set_cut(p_ptr->cut - 10)) ident = TRUE;
+                       }
                        if (set_shero(0,TRUE)) ident = TRUE;
                        break;
                }
@@ -2495,7 +2521,7 @@ static int staff_effect(int sval, bool *use_charge, bool magic, bool known)
 
                case SV_STAFF_HEALING:
                {
-                       if (hp_player(300)) ident = TRUE;
+                       if (hp_player(powerful ? 500 : 300)) ident = TRUE;
                        if (set_stun(0)) ident = TRUE;
                        if (set_cut(0)) ident = TRUE;
                        if (set_shero(0,TRUE)) ident = TRUE;
@@ -2526,19 +2552,19 @@ static int staff_effect(int sval, bool *use_charge, bool magic, bool known)
 
                case SV_STAFF_SLEEP_MONSTERS:
                {
-                       if (sleep_monsters()) ident = TRUE;
+                       if (sleep_monsters(lev)) ident = TRUE;
                        break;
                }
 
                case SV_STAFF_SLOW_MONSTERS:
                {
-                       if (slow_monsters()) ident = TRUE;
+                       if (slow_monsters(lev)) ident = TRUE;
                        break;
                }
 
                case SV_STAFF_SPEED:
                {
-                       if (set_fast(randint1(30) + 15, FALSE)) ident = TRUE;
+                       if (set_fast(randint1(30) + (powerful ? 30 : 15), FALSE)) ident = TRUE;
                        break;
                }
 
@@ -2551,20 +2577,20 @@ static int staff_effect(int sval, bool *use_charge, bool magic, bool known)
 
                case SV_STAFF_DISPEL_EVIL:
                {
-                       if (dispel_evil(80)) ident = TRUE;
+                       if (dispel_evil(powerful ? 120 : 80)) ident = TRUE;
                        break;
                }
 
                case SV_STAFF_POWER:
                {
-                       if (dispel_monsters(150)) ident = TRUE;
+                       if (dispel_monsters(powerful ? 225 : 150)) ident = TRUE;
                        break;
                }
 
                case SV_STAFF_HOLINESS:
                {
-                       if (dispel_evil(150)) ident = TRUE;
-                       k = 3 * p_ptr->lev;
+                       if (dispel_evil(powerful ? 225 : 150)) ident = TRUE;
+                       k = 3 * lev;
                        if (set_protevil((magic ? 0 : p_ptr->protevil) + randint1(25) + k, FALSE)) ident = TRUE;
                        if (set_poisoned(0)) ident = TRUE;
                        if (set_afraid(0)) ident = TRUE;
@@ -2576,14 +2602,14 @@ static int staff_effect(int sval, bool *use_charge, bool magic, bool known)
 
                case SV_STAFF_GENOCIDE:
                {
-                       (void)symbol_genocide((magic ? p_ptr->lev + 50 : 200), TRUE);
+                       (void)symbol_genocide((magic ? lev + 50 : 200), TRUE);
                        ident = TRUE;
                        break;
                }
 
                case SV_STAFF_EARTHQUAKES:
                {
-                       if (earthquake(py, px, 10))
+                       if (earthquake(py, px, (powerful ? 15 : 10)))
                                ident = TRUE;
                        else
 #ifdef JP
@@ -2598,7 +2624,7 @@ msg_print("
 
                case SV_STAFF_DESTRUCTION:
                {
-                       if (destroy_area(py, px, 13 + randint0(5), FALSE))
+                       if (destroy_area(py, px, (powerful ? 18 : 13) + randint0(5), FALSE))
                                ident = TRUE;
 
                        break;
@@ -2619,8 +2645,8 @@ msg_print("
 #else
                        msg_print("Mighty magics rend your enemies!");
 #endif
-                       project(0, 5, py, px,
-                               (randint1(200) + 300) * 2, GF_MANA, PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID, -1);
+                       project(0, (powerful ? 7 : 5), py, px,
+                               (randint1(200) + (powerful ? 500 : 300)) * 2, GF_MANA, PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID, -1);
                        if ((p_ptr->pclass != CLASS_MAGE) && (p_ptr->pclass != CLASS_HIGH_MAGE) && (p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_MAGIC_EATER) && (p_ptr->pclass != CLASS_BLUE_MAGE))
                        {
 #ifdef JP
@@ -2769,7 +2795,7 @@ static void do_cmd_use_staff_aux(int item)
        /* Sound */
        sound(SOUND_ZAP);
 
-       ident = staff_effect(o_ptr->sval, &use_charge, FALSE, object_is_aware(o_ptr));
+       ident = staff_effect(o_ptr->sval, &use_charge, FALSE, FALSE, object_is_aware(o_ptr));
 
        if (!(object_is_aware(o_ptr)))
        {
@@ -2876,9 +2902,11 @@ void do_cmd_use_staff(void)
 }
 
 
-static int wand_effect(int sval, int dir, bool magic)
+static int wand_effect(int sval, int dir, bool powerful, bool magic)
 {
        int ident = FALSE;
+       int lev = powerful ? p_ptr->lev * 2 : p_ptr->lev;
+       int rad = powerful ? 3 : 2;
 
        /* XXX Hack -- Wand of wonder can do anything before it */
        if (sval == SV_WAND_WONDER)
@@ -2908,13 +2936,14 @@ static int wand_effect(int sval, int dir, bool magic)
        {
                case SV_WAND_HEAL_MONSTER:
                {
-                       if (heal_monster(dir, damroll(10, 10))) ident = TRUE;
+                       int dam = damroll((powerful ? 20 : 10), 10);
+                       if (heal_monster(dir, dam)) ident = TRUE;
                        break;
                }
 
                case SV_WAND_HASTE_MONSTER:
                {
-                       if (speed_monster(dir)) ident = TRUE;
+                       if (speed_monster(dir, lev)) ident = TRUE;
                        break;
                }
 
@@ -2926,143 +2955,148 @@ static int wand_effect(int sval, int dir, bool magic)
 
                case SV_WAND_TELEPORT_AWAY:
                {
-                       if (teleport_monster(dir)) ident = TRUE;
+                       int distance = MAX_SIGHT * (powerful ? 8 : 5);
+                       if (teleport_monster(dir, distance)) ident = TRUE;
                        break;
                }
 
                case SV_WAND_DISARMING:
                {
                        if (disarm_trap(dir)) ident = TRUE;
+                       if (powerful && disarm_traps_touch()) ident = TRUE;
                        break;
                }
 
                case SV_WAND_TRAP_DOOR_DEST:
                {
                        if (destroy_door(dir)) ident = TRUE;
+                       if (powerful && destroy_doors_touch()) ident = TRUE;
                        break;
                }
 
                case SV_WAND_STONE_TO_MUD:
                {
-                       if (wall_to_mud(dir)) ident = TRUE;
+                       int dam = powerful ? 40 + randint1(60) : 20 + randint1(30);
+                       if (wall_to_mud(dir, dam)) ident = TRUE;
                        break;
                }
 
                case SV_WAND_LITE:
                {
+                       int dam = damroll((powerful ? 12 : 6), 8);
 #ifdef JP
                        msg_print("ÀĤ¯µ±¤¯¸÷Àþ¤¬Êü¤¿¤ì¤¿¡£");
 #else
                        msg_print("A line of blue shimmering light appears.");
 #endif
 
-                       (void)lite_line(dir);
+                       (void)lite_line(dir, dam);
                        ident = TRUE;
                        break;
                }
 
                case SV_WAND_SLEEP_MONSTER:
                {
-                       if (sleep_monster(dir)) ident = TRUE;
+                       if (sleep_monster(dir, lev)) ident = TRUE;
                        break;
                }
 
                case SV_WAND_SLOW_MONSTER:
                {
-                       if (slow_monster(dir)) ident = TRUE;
+                       if (slow_monster(dir, lev)) ident = TRUE;
                        break;
                }
 
                case SV_WAND_CONFUSE_MONSTER:
                {
-                       if (confuse_monster(dir, p_ptr->lev)) ident = TRUE;
+                       if (confuse_monster(dir, lev)) ident = TRUE;
                        break;
                }
 
                case SV_WAND_FEAR_MONSTER:
                {
-                       if (fear_monster(dir, p_ptr->lev)) ident = TRUE;
+                       if (fear_monster(dir, lev)) ident = TRUE;
                        break;
                }
 
                case SV_WAND_DRAIN_LIFE:
                {
-                       if (drain_life(dir, 80 + p_ptr->lev)) ident = TRUE;
+                       if (drain_life(dir, 80 + lev)) ident = TRUE;
                        break;
                }
 
                case SV_WAND_POLYMORPH:
                {
-                       if (poly_monster(dir)) ident = TRUE;
+                       if (poly_monster(dir, lev)) ident = TRUE;
                        break;
                }
 
                case SV_WAND_STINKING_CLOUD:
                {
-                       fire_ball(GF_POIS, dir, 12 + p_ptr->lev / 4, 2);
+                       fire_ball(GF_POIS, dir, 12 + lev / 4, rad);
                        ident = TRUE;
                        break;
                }
 
                case SV_WAND_MAGIC_MISSILE:
                {
-                       fire_bolt_or_beam(20, GF_MISSILE, dir, damroll(2 + p_ptr->lev / 10, 6));
+                       fire_bolt_or_beam(20, GF_MISSILE, dir, damroll(2 + lev / 10, 6));
                        ident = TRUE;
                        break;
                }
 
                case SV_WAND_ACID_BOLT:
                {
-                       fire_bolt_or_beam(20, GF_ACID, dir, damroll(6 + p_ptr->lev / 7, 8));
+                       fire_bolt_or_beam(20, GF_ACID, dir, damroll(6 + lev / 7, 8));
                        ident = TRUE;
                        break;
                }
 
                case SV_WAND_CHARM_MONSTER:
                {
-                       if (charm_monster(dir, MAX(20, p_ptr->lev)))
+                       if (charm_monster(dir, MAX(20, lev)))
                        ident = TRUE;
                        break;
                }
 
                case SV_WAND_FIRE_BOLT:
                {
-                       fire_bolt_or_beam(20, GF_FIRE, dir, damroll(7 + p_ptr->lev / 6, 8));
+                       fire_bolt_or_beam(20, GF_FIRE, dir, damroll(7 + lev / 6, 8));
                        ident = TRUE;
                        break;
                }
 
                case SV_WAND_COLD_BOLT:
                {
-                       fire_bolt_or_beam(20, GF_COLD, dir, damroll(5 + p_ptr->lev / 8, 8));
+                       fire_bolt_or_beam(20, GF_COLD, dir, damroll(5 + lev / 8, 8));
                        ident = TRUE;
                        break;
                }
 
                case SV_WAND_ACID_BALL:
                {
-                       fire_ball(GF_ACID, dir, 60 + 3 * p_ptr->lev / 4, 2);
+                       fire_ball(GF_ACID, dir, 60 + 3 * lev / 4, rad);
                        ident = TRUE;
                        break;
                }
 
                case SV_WAND_ELEC_BALL:
                {
-                       fire_ball(GF_ELEC, dir, 40 + 3 * p_ptr->lev / 4, 2);
+                       fire_ball(GF_ELEC, dir, 40 + 3 * lev / 4, rad);
                        ident = TRUE;
                        break;
                }
 
                case SV_WAND_FIRE_BALL:
                {
-                       fire_ball(GF_FIRE, dir, 70 + 3 * p_ptr->lev / 4, 2);
+                       fire_ball(GF_FIRE, dir, 70 + 3 * lev / 4, rad);
                        ident = TRUE;
                        break;
                }
 
                case SV_WAND_COLD_BALL:
                {
-                       fire_ball(GF_COLD, dir, 50 + 3 * p_ptr->lev / 4, 2);
+                       fire_ball(GF_COLD, dir, 50 + 3 * lev / 4, rad);
                        ident = TRUE;
                        break;
                }
@@ -3080,60 +3114,58 @@ static int wand_effect(int sval, int dir, bool magic)
 
                case SV_WAND_DRAGON_FIRE:
                {
-                       fire_ball(GF_FIRE, dir, 200, -3);
+                       fire_ball(GF_FIRE, dir, (powerful ? 300 : 200), -3);
                        ident = TRUE;
                        break;
                }
 
                case SV_WAND_DRAGON_COLD:
                {
-                       fire_ball(GF_COLD, dir, 180, -3);
+                       fire_ball(GF_COLD, dir, (powerful ? 270 : 180), -3);
                        ident = TRUE;
                        break;
                }
 
                case SV_WAND_DRAGON_BREATH:
                {
+                       int dam;
+                       int typ;
+
                        switch (randint1(5))
                        {
                                case 1:
-                               {
-                                       fire_ball(GF_ACID, dir, 240, -3);
+                                       dam = 240;
+                                       typ = GF_ACID;
                                        break;
-                               }
-
                                case 2:
-                               {
-                                       fire_ball(GF_ELEC, dir, 210, -3);
+                                       dam = 210;
+                                       typ = GF_ELEC;
                                        break;
-                               }
-
                                case 3:
-                               {
-                                       fire_ball(GF_FIRE, dir, 240, -3);
+                                       dam = 240;
+                                       typ = GF_FIRE;
                                        break;
-                               }
-
                                case 4:
-                               {
-                                       fire_ball(GF_COLD, dir, 210, -3);
+                                       dam = 210;
+                                       typ = GF_COLD;
                                        break;
-                               }
-
                                default:
-                               {
-                                       fire_ball(GF_POIS, dir, 180, -3);
+                                       dam = 180;
+                                       typ = GF_POIS;
                                        break;
-                               }
                        }
 
+                       if (powerful) dam = (dam * 3) / 2;
+
+                       fire_ball(typ, dir, dam, -3);
+
                        ident = TRUE;
                        break;
                }
 
                case SV_WAND_DISINTEGRATE:
                {
-                       fire_ball(GF_DISINTEGRATE, dir, 200 + randint1(p_ptr->lev * 2), 2);
+                       fire_ball(GF_DISINTEGRATE, dir, 200 + randint1(lev * 2), rad);
                        ident = TRUE;
                        break;
                }
@@ -3146,21 +3178,21 @@ msg_print("
                        msg_print("You launch a rocket!");
 #endif
 
-                       fire_rocket(GF_ROCKET, dir, 250 + p_ptr->lev * 3, 2);
+                       fire_rocket(GF_ROCKET, dir, 250 + lev * 3, rad);
                        ident = TRUE;
                        break;
                }
 
                case SV_WAND_STRIKING:
                {
-                       fire_bolt(GF_METEOR, dir, damroll(15 + p_ptr->lev / 3, 13));
+                       fire_bolt(GF_METEOR, dir, damroll(15 + lev / 3, 13));
                        ident = TRUE;
                        break;
                }
 
                case SV_WAND_GENOCIDE:
                {
-                       fire_ball_hide(GF_GENOCIDE, dir, magic ? p_ptr->lev + 50 : 250, 0);
+                       fire_ball_hide(GF_GENOCIDE, dir, magic ? lev + 50 : 250, 0);
                        ident = TRUE;
                        break;
                }
@@ -3302,7 +3334,7 @@ static void do_cmd_aim_wand_aux(int item)
        /* Sound */
        sound(SOUND_ZAP);
 
-       ident = wand_effect(o_ptr->sval, dir, FALSE);
+       ident = wand_effect(o_ptr->sval, dir, FALSE, FALSE);
 
        /* Combine / Reorder the pack (later) */
        p_ptr->notice |= (PN_COMBINE | PN_REORDER);
@@ -3374,9 +3406,12 @@ void do_cmd_aim_wand(void)
 }
 
 
-static int rod_effect(int sval, int dir, bool *use_charge, bool magic)
+static int rod_effect(int sval, int dir, bool *use_charge, bool powerful, bool magic)
 {
        int ident = FALSE;
+       int lev = powerful ? p_ptr->lev * 2 : p_ptr->lev;
+       int detect_rad = powerful ? DETECT_RAD_DEFAULT * 3 / 2 : DETECT_RAD_DEFAULT;
+       int rad = powerful ? 3 : 2;
 
        /* Unused */
        (void)magic;
@@ -3386,20 +3421,24 @@ static int rod_effect(int sval, int dir, bool *use_charge, bool magic)
        {
                case SV_ROD_DETECT_TRAP:
                {
-                       if (detect_traps(DETECT_RAD_DEFAULT, (bool)(dir ? FALSE : TRUE))) ident = TRUE;
+                       if (detect_traps(detect_rad, (bool)(dir ? FALSE : TRUE))) ident = TRUE;
                        break;
                }
 
                case SV_ROD_DETECT_DOOR:
                {
-                       if (detect_doors(DETECT_RAD_DEFAULT)) ident = TRUE;
-                       if (detect_stairs(DETECT_RAD_DEFAULT)) ident = TRUE;
+                       if (detect_doors(detect_rad)) ident = TRUE;
+                       if (detect_stairs(detect_rad)) ident = TRUE;
                        break;
                }
 
                case SV_ROD_IDENTIFY:
                {
-                       if (!ident_spell(FALSE)) *use_charge = FALSE;
+                       if (powerful) {
+                               if (!identify_fully(FALSE)) *use_charge = FALSE;
+                       } else {
+                               if (!ident_spell(FALSE)) *use_charge = FALSE;
+                       }
                        ident = TRUE;
                        break;
                }
@@ -3413,20 +3452,20 @@ static int rod_effect(int sval, int dir, bool *use_charge, bool magic)
 
                case SV_ROD_ILLUMINATION:
                {
-                       if (lite_area(damroll(2, 8), 2)) ident = TRUE;
+                       if (lite_area(damroll(2, 8), (powerful ? 4 : 2))) ident = TRUE;
                        break;
                }
 
                case SV_ROD_MAPPING:
                {
-                       map_area(DETECT_RAD_MAP);
+                       map_area(powerful ? DETECT_RAD_MAP * 3 / 2 : DETECT_RAD_MAP);
                        ident = TRUE;
                        break;
                }
 
                case SV_ROD_DETECTION:
                {
-                       detect_all(DETECT_RAD_DEFAULT);
+                       detect_all(detect_rad);
                        ident = TRUE;
                        break;
                }
@@ -3452,7 +3491,7 @@ static int rod_effect(int sval, int dir, bool *use_charge, bool magic)
 
                case SV_ROD_HEALING:
                {
-                       if (hp_player(500)) ident = TRUE;
+                       if (hp_player(powerful ? 750 : 500)) ident = TRUE;
                        if (set_stun(0)) ident = TRUE;
                        if (set_cut(0)) ident = TRUE;
                        if (set_shero(0,TRUE)) ident = TRUE;
@@ -3473,117 +3512,120 @@ static int rod_effect(int sval, int dir, bool *use_charge, bool magic)
 
                case SV_ROD_SPEED:
                {
-                       if (set_fast(randint1(30) + 15, FALSE)) ident = TRUE;
+                       if (set_fast(randint1(30) + (powerful ? 30 : 15), FALSE)) ident = TRUE;
                        break;
                }
 
                case SV_ROD_PESTICIDE:
                {
-                       if (dispel_monsters(4)) ident = TRUE;
+                       if (dispel_monsters(powerful ? 8 : 4)) ident = TRUE;
                        break;
                }
 
                case SV_ROD_TELEPORT_AWAY:
                {
-                       if (teleport_monster(dir)) ident = TRUE;
+                       int distance = MAX_SIGHT * (powerful ? 8 : 5);
+                       if (teleport_monster(dir, distance)) ident = TRUE;
                        break;
                }
 
                case SV_ROD_DISARMING:
                {
                        if (disarm_trap(dir)) ident = TRUE;
+                       if (powerful && disarm_traps_touch()) ident = TRUE;
                        break;
                }
 
                case SV_ROD_LITE:
                {
+                       int dam = damroll((powerful ? 12 : 6), 8);
 #ifdef JP
                        msg_print("ÀĤ¯µ±¤¯¸÷Àþ¤¬Êü¤¿¤ì¤¿¡£");
 #else
                        msg_print("A line of blue shimmering light appears.");
 #endif
 
-                       (void)lite_line(dir);
+                       (void)lite_line(dir, dam);
                        ident = TRUE;
                        break;
                }
 
                case SV_ROD_SLEEP_MONSTER:
                {
-                       if (sleep_monster(dir)) ident = TRUE;
+                       if (sleep_monster(dir, lev)) ident = TRUE;
                        break;
                }
 
                case SV_ROD_SLOW_MONSTER:
                {
-                       if (slow_monster(dir)) ident = TRUE;
+                       if (slow_monster(dir, lev)) ident = TRUE;
                        break;
                }
 
                case SV_ROD_DRAIN_LIFE:
                {
-                       if (drain_life(dir, 70 + 3 * p_ptr->lev / 2)) ident = TRUE;
+                       if (drain_life(dir, 70 + 3 * lev / 2)) ident = TRUE;
                        break;
                }
 
                case SV_ROD_POLYMORPH:
                {
-                       if (poly_monster(dir)) ident = TRUE;
+                       if (poly_monster(dir, lev)) ident = TRUE;
                        break;
                }
 
                case SV_ROD_ACID_BOLT:
                {
-                       fire_bolt_or_beam(10, GF_ACID, dir, damroll(6 + p_ptr->lev / 7, 8));
+                       fire_bolt_or_beam(10, GF_ACID, dir, damroll(6 + lev / 7, 8));
                        ident = TRUE;
                        break;
                }
 
                case SV_ROD_ELEC_BOLT:
                {
-                       fire_bolt_or_beam(10, GF_ELEC, dir, damroll(4 + p_ptr->lev / 9, 8));
+                       fire_bolt_or_beam(10, GF_ELEC, dir, damroll(4 + lev / 9, 8));
                        ident = TRUE;
                        break;
                }
 
                case SV_ROD_FIRE_BOLT:
                {
-                       fire_bolt_or_beam(10, GF_FIRE, dir, damroll(7 + p_ptr->lev / 6, 8));
+                       fire_bolt_or_beam(10, GF_FIRE, dir, damroll(7 + lev / 6, 8));
                        ident = TRUE;
                        break;
                }
 
                case SV_ROD_COLD_BOLT:
                {
-                       fire_bolt_or_beam(10, GF_COLD, dir, damroll(5 + p_ptr->lev / 8, 8));
+                       fire_bolt_or_beam(10, GF_COLD, dir, damroll(5 + lev / 8, 8));
                        ident = TRUE;
                        break;
                }
 
                case SV_ROD_ACID_BALL:
                {
-                       fire_ball(GF_ACID, dir, 60 + p_ptr->lev, 2);
+                       fire_ball(GF_ACID, dir, 60 + lev, rad);
                        ident = TRUE;
                        break;
                }
 
                case SV_ROD_ELEC_BALL:
                {
-                       fire_ball(GF_ELEC, dir, 40 + p_ptr->lev, 2);
+                       fire_ball(GF_ELEC, dir, 40 + lev, rad);
                        ident = TRUE;
                        break;
                }
 
                case SV_ROD_FIRE_BALL:
                {
-                       fire_ball(GF_FIRE, dir, 70 + p_ptr->lev, 2);
+                       fire_ball(GF_FIRE, dir, 70 + lev, rad);
                        ident = TRUE;
                        break;
                }
 
                case SV_ROD_COLD_BALL:
                {
-                       fire_ball(GF_COLD, dir, 50 + p_ptr->lev, 2);
+                       fire_ball(GF_COLD, dir, 50 + lev, rad);
                        ident = TRUE;
                        break;
                }
@@ -3597,7 +3639,8 @@ static int rod_effect(int sval, int dir, bool *use_charge, bool magic)
 
                case SV_ROD_STONE_TO_MUD:
                {
-                       if (wall_to_mud(dir)) ident = TRUE;
+                       int dam = powerful ? 40 + randint1(60) : 20 + randint1(30);
+                       if (wall_to_mud(dir, dam)) ident = TRUE;
                        break;
                }
 
@@ -3755,7 +3798,7 @@ msg_print("
        /* Sound */
        sound(SOUND_ZAP);
 
-       ident = rod_effect(o_ptr->sval, dir, &use_charge, FALSE);
+       ident = rod_effect(o_ptr->sval, dir, &use_charge, FALSE, FALSE);
 
        /* Increase the timeout by the rod kind's pval. -LM- */
        if (use_charge) o_ptr->timeout += k_ptr->pval;
@@ -3941,6 +3984,7 @@ static bool ang_sort_comp_pet(vptr u, vptr v, int a, int b)
        return w1 <= w2;
 }
 
+
 /*
  * Activate a wielded object.  Wielded objects never stack.
  * And even if they did, activatable objects never stack.
@@ -3953,7 +3997,7 @@ static bool ang_sort_comp_pet(vptr u, vptr v, int a, int b)
  */
 static void do_cmd_activate_aux(int item)
 {
-       int         k, dir, lev, chance, fail;
+       int         dir, lev, chance, fail;
        object_type *o_ptr;
        bool success;
 
@@ -3978,103 +4022,11 @@ static void do_cmd_activate_aux(int item)
 
        /* Hack -- use artifact level instead */
        if (object_is_fixed_artifact(o_ptr)) lev = a_info[o_ptr->name1].level;
-       else if (o_ptr->art_name)
+       else if (object_is_random_artifact(o_ptr))
        {
-               switch (o_ptr->xtra2)
-               {
-                       case ACT_SUNLIGHT:
-                       case ACT_BO_MISS_1:
-                       case ACT_BA_POIS_1:
-                       case ACT_CONFUSE:
-                       case ACT_SLEEP:
-                       case ACT_CURE_LW:
-                       case ACT_CURE_POISON:
-                       case ACT_BERSERK:
-                       case ACT_LIGHT:
-                       case ACT_DEST_DOOR:
-                       case ACT_TELEPORT:
-                               lev = 10;
-                               break;
-                       case ACT_BO_ELEC_1:
-                       case ACT_BO_ACID_1:
-                       case ACT_BO_COLD_1:
-                       case ACT_BO_FIRE_1:
-                       case ACT_MAP_LIGHT:
-                       case ACT_STONE_MUD:
-                       case ACT_CURE_MW:
-                       case ACT_QUAKE:
-                               lev = 20;
-                               break;
-                       case ACT_DRAIN_1:
-                       case ACT_TELE_AWAY:
-                       case ACT_ESP:
-                       case ACT_RESIST_ALL:
-                       case ACT_DETECT_ALL:
-                       case ACT_RECALL:
-                       case ACT_SATIATE:
-                       case ACT_RECHARGE:
-                               lev = 30;
-                               break;
-                       case ACT_BA_COLD_1:
-                       case ACT_BA_FIRE_1:
-                       case ACT_BA_FIRE_2:
-                       case ACT_TERROR:
-                       case ACT_PROT_EVIL:
-                       case ACT_ID_PLAIN:
-                       case ACT_REST_LIFE:
-                       case ACT_SPEED:
-                       case ACT_BANISH_EVIL:
-                               lev = 40;
-                               break;
-                       case ACT_DRAIN_2:
-                       case ACT_VAMPIRE_1:
-                       case ACT_BO_MISS_2:
-                       case ACT_BA_FIRE_3:
-                       case ACT_WHIRLWIND:
-                       case ACT_CHARM_ANIMAL:
-                       case ACT_SUMMON_ANIMAL:
-                       case ACT_DISP_EVIL:
-                       case ACT_DISP_GOOD:
-                       case ACT_XTRA_SPEED:
-                       case ACT_DETECT_XTRA:
-                       case ACT_ID_FULL:
-                               lev = 50;
-                               break;
-                       case ACT_VAMPIRE_2:
-                       case ACT_BA_COLD_3:
-                       case ACT_BA_ELEC_3:
-                       case ACT_GENOCIDE:
-                       case ACT_CHARM_UNDEAD:
-                       case ACT_CHARM_OTHER:
-                       case ACT_SUMMON_PHANTOM:
-                       case ACT_SUMMON_ELEMENTAL:
-                       case ACT_RUNE_EXPLO:
-                               lev = 60;
-                               break;
-                       case ACT_MASS_GENO:
-                       case ACT_CHARM_ANIMALS:
-                       case ACT_CHARM_OTHERS:
-                       case ACT_CURE_700:
-                       case ACT_RUNE_PROT:
-                       case ACT_ALCHEMY:
-                       case ACT_REST_ALL:
-                               lev = 70;
-                               break;
-                       case ACT_CALL_CHAOS:
-                       case ACT_ROCKET:
-                       case ACT_BA_MISS_3:
-                       case ACT_CURE_1000:
-                       case ACT_DIM_DOOR:
-                       case ACT_SUMMON_UNDEAD:
-                       case ACT_SUMMON_DEMON:
-                               lev = 80;
-                               break;
-                       case ACT_WRAITH:
-                       case ACT_INVULN:
-                               lev = 100;
-                               break;
-                       default:
-                               lev = 0;
+               const activation_type* const act_ptr = find_activation_info(o_ptr);
+               if (act_ptr) {
+                       lev = act_ptr->level;
                }
        }
        else if (((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)) && o_ptr->name2) lev = e_info[o_ptr->name2].level;
@@ -4099,7 +4051,6 @@ static void do_cmd_activate_aux(int item)
 #else
                msg_print("It shows no reaction.");
 #endif
-
                sound(SOUND_FAIL);
                return;
        }
@@ -4125,7 +4076,6 @@ static void do_cmd_activate_aux(int item)
 #else
                msg_print("You failed to activate it properly.");
 #endif
-
                sound(SOUND_FAIL);
                return;
        }
@@ -4138,716 +4088,37 @@ static void do_cmd_activate_aux(int item)
 #else
                msg_print("It whines, glows and fades...");
 #endif
-
-               return;
-       }
-
-
-       /* Activate the artifact */
-#ifdef JP
-       msg_print("»ÏÆ°¤µ¤»¤¿...");
-#else
-       msg_print("You activate it...");
-#endif
-
-
-       /* Sound */
-       sound(SOUND_ZAP);
-
-       if (o_ptr->name1)
-       {
-               if (!o_ptr->xtra2) o_ptr->xtra2 = a_info[o_ptr->name1].act_idx;
-       }
-
-       if (object_is_artifact(o_ptr) && o_ptr->xtra2)
-       {
-               (void)activate_random_artifact(o_ptr);
-
-               /* Window stuff */
-               p_ptr->window |= (PW_INVEN | PW_EQUIP);
-
-               /* Success */
-               return;
-       }
-
-       /* Artifacts */
-       else if (object_is_fixed_artifact(o_ptr))
-       {
-               /* Choose effect */
-               switch (o_ptr->name1)
-               {
-                       case ART_CRIMSON:
-                       {
-                               int num = 1;
-                               int i;
-                               int flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
-                               int tx, ty;
-#ifdef JP
-                               msg_print("¤»¤Ã¤«¤¯¤À¤«¤é¡Ø¥¯¥ê¥à¥¾¥ó¡Ù¤ò¤Ö¤Ã¤Ñ¤Ê¤¹¤¼¡ª");
-#else
-                               msg_print("I'll fire CRIMSON! SEKKAKUDAKARA!");
-#endif
-
-                               if (!get_aim_dir(&dir)) return;
-
-                               /* Use the given direction */
-                               tx = px + 99 * ddx[dir];
-                               ty = py + 99 * ddy[dir];
-
-                               /* Hack -- Use an actual "target" */
-                               if ((dir == 5) && target_okay())
-                               {
-                                       tx = target_col;
-                                       ty = target_row;
-                               }
-
-                               if (p_ptr->pclass == CLASS_ARCHER)
-                               {
-                                       /* Extra shot at level 10 */
-                                       if (p_ptr->lev >= 10) num++;
-
-                                       /* Extra shot at level 30 */
-                                       if (p_ptr->lev >= 30) num++;
-
-                                       /* Extra shot at level 45 */
-                                       if (p_ptr->lev >= 45) num++;
-                               }
-
-                               for (i = 0; i < num; i++)
-                                       project(0, p_ptr->lev/20+1, ty, tx, p_ptr->lev*p_ptr->lev*6/50, GF_ROCKET, flg, -1);
-                               o_ptr->timeout = 15;
-                               break;
-                       }
-
-                       case ART_BOROMIR:
-                       {
-                               if (music_singing_any()) stop_singing();
-                               if (hex_spelling_any()) stop_hex_spell_all();
-#ifdef JP
-                               msg_print("¤¢¤Ê¤¿¤ÏÎ϶¯¤¤ÆÍÉ÷¤ò¿á¤­ÌĤ餷¤¿¡£¼þ°Ï¤ÎŨ¤¬¿Ì¤¨¾å¤Ã¤Æ¤¤¤ë!");
-#else
-                               msg_print("You wind a mighty blast; your enemies tremble!");
-#endif
-                               (void)turn_monsters((3 * p_ptr->lev / 2) + 10);
-                               o_ptr->timeout = randint0(40) + 40;
-                               break;
-                       }
-                       case ART_MURAMASA:
-                       {
-#ifdef JP
-                               if (get_check("ËÜÅö¤Ë»È¤¤¤Þ¤¹¤«¡©"))
-#else
-                               if (get_check("Are you sure?!"))
-#endif
-                               {
-#ifdef JP
-                                       msg_print("¼Àµ¤¬¿Ì¤¨¤¿¡¥¡¥¡¥");
-#else
-                                       msg_print("The Muramasa pulsates...");
-#endif
-                                       do_inc_stat(A_STR);
-                                       if (one_in_(2))
-                                       {
-#ifdef JP
-                                               msg_print("¼Àµ¤Ï²õ¤ì¤¿¡ª");
-#else
-                                               msg_print("The Muramasa is destroyed!");
-#endif
-                                               curse_weapon(TRUE, item);
-                                       }
-                               }
-                               break;
-                       }
-                       case ART_INROU:
-                       {
-                               int count = 0, i;
-                               monster_type *m_ptr;
-#ifndef JP
-                               cptr kakusan = "";
-#endif
-
-                               if (summon_named_creature(0, py, px, MON_SUKE, PM_FORCE_PET))
-                               {
-#ifdef JP
-                                       msg_print("¡Ø½õ¤µ¤ó¡Ù¤¬¸½¤ì¤¿¡£");
-#else
-                                       msg_print("Suke-san apperars.");
-                                       kakusan = "Suke-san";
-#endif
-                                       count++;
-                               }
-                               if (summon_named_creature(0, py, px, MON_KAKU, PM_FORCE_PET))
-                               {
-#ifdef JP
-                                       msg_print("¡Ø³Ê¤µ¤ó¡Ù¤¬¸½¤ì¤¿¡£");
-#else
-                                       msg_print("Kaku-san appears.");
-                                       kakusan = "Kaku-san";
-#endif
-                                       count++;
-                               }
-                               if (!count)
-                               {
-                                       for (i = m_max - 1; i > 0; i--)
-                                       {
-                                               m_ptr = &m_list[i];
-                                               if (!m_ptr->r_idx) continue;
-                                               if (!((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) continue;
-                                               if (!los(m_ptr->fy, m_ptr->fx, py, px)) continue;
-                                               if (!projectable(m_ptr->fy, m_ptr->fx, py, px)) continue;
-                                               count++;
-                                               break;
-                                       }
-                               }
-
-                               if (count)
-                               {
-#ifdef JP
-                                       msg_print("¡Ö¼Ô¤É¤â¡¢¤Ò¤«¤¨¤ª¤í¤¦¡ª¡ª¡ª¤³¤Î¤ªÊý¤ò¤É¤Ê¤¿¤È¤³¤³¤í¤¨¤ë¡£¡×");
-#else
-                                       msg_format("%^s says 'WHO do you think this person is! Bow your head, down your knees!'", kakusan);
-#endif
-
-                                       sukekaku = TRUE;
-                                       stun_monsters(120);
-                                       confuse_monsters(120);
-                                       turn_monsters(120);
-                                       stasis_monsters(120);
-                                       sukekaku = FALSE;
-                               }
-                               else
-                               {
-#ifdef JP
-                                       msg_print("¤·¤«¤·¡¢²¿¤âµ¯¤­¤Ê¤«¤Ã¤¿¡£");
-#else
-                                       msg_print("Nothing happen.");
-#endif
-                               }
-                               o_ptr->timeout = randint0(150) + 150;
-                               break;
-                       }
-
-                       case ART_HYOUSIGI:
-                       {
-#ifdef JP
-                               msg_print("Çï»ÒÌÚ¤òÂǤä¿¡£");
-#else
-                               msg_print("You beat Your wooden clappers.");
-#endif
-                               aggravate_monsters(0);
-                               break;
-                       }
-                       case ART_BLOOD:
-                       {
-#ifdef JP
-                               msg_print("³ù¤¬ÌÀ¤ë¤¯µ±¤¤¤¿...");
-#else
-                               msg_print("Your scythe glows brightly!");
-#endif
-                               get_bloody_moon_flags(o_ptr);
-                               o_ptr->timeout = 3333;
-                               if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
-                               p_ptr->update |= (PU_BONUS | PU_HP);
-                               break;
-                       }
-               }
-
-               /* Window stuff */
-               p_ptr->window |= (PW_INVEN | PW_EQUIP);
-
-               /* Done */
                return;
        }
 
-       if (object_is_smith(o_ptr))
+       /* Some lights need enough fuel for activation */
+       if (!o_ptr->xtra4 && (o_ptr->tval == TV_FLASK) &&
+               ((o_ptr->sval == SV_LITE_TORCH) || (o_ptr->sval == SV_LITE_LANTERN)))
        {
-               switch (o_ptr->xtra3-1)
-               {
-               case ESSENCE_TMP_RES_ACID:
-                       (void)set_oppose_acid(randint1(20) + 20, FALSE);
-                       o_ptr->timeout = randint0(50) + 50;
-                       return;
-
-               case ESSENCE_TMP_RES_ELEC:
-                       (void)set_oppose_elec(randint1(20) + 20, FALSE);
-                       o_ptr->timeout = randint0(50) + 50;
-                       return;
-
-               case ESSENCE_TMP_RES_FIRE:
-                       (void)set_oppose_fire(randint1(20) + 20, FALSE);
-                       o_ptr->timeout = randint0(50) + 50;
-                       return;
-
-               case ESSENCE_TMP_RES_COLD:
-                       (void)set_oppose_cold(randint1(20) + 20, FALSE);
-                       o_ptr->timeout = randint0(50) + 50;
-                       return;
-
-               case TR_IMPACT:
-                       earthquake(py, px, 5);
-                       o_ptr->timeout = 100 + randint1(100);
-                       
-                       /* Window stuff */
-                       p_ptr->window |= (PW_INVEN | PW_EQUIP);
-
-                       /* Done */
-                       return;
-               }
-       }
-
-
-       if (o_ptr->name2 == EGO_TRUMP)
-       {
-               teleport_player(100, 0L);
-               o_ptr->timeout = 50 + randint1(50);
-
-               /* Window stuff */
-               p_ptr->window |= (PW_INVEN | PW_EQUIP);
-
-               /* Done */
-               return;
-       }
-
-
-       if (o_ptr->name2 == EGO_LITE_ILLUMINATION)
-       {
-               if (!o_ptr->xtra4 && ((o_ptr->sval == SV_LITE_TORCH) || (o_ptr->sval == SV_LITE_LANTERN)))
-               {
 #ifdef JP
-                       msg_print("dzÎÁ¤¬¤Ê¤¤¡£");
+               msg_print("dzÎÁ¤¬¤Ê¤¤¡£");
 #else
-                       msg_print("It has no fuel.");
+               msg_print("It has no fuel.");
 #endif
-                       energy_use = 0;
-                       return;
-               }
-               lite_area(damroll(2, 15), 3);
-               o_ptr->timeout = randint0(10) + 10;
-
-               /* Window stuff */
-               p_ptr->window |= (PW_INVEN | PW_EQUIP);
-
-               return;
-       }
-
-
-       if (o_ptr->name2 == EGO_EARTHQUAKES)
-       {
-               earthquake(py, px, 5);
-               o_ptr->timeout = 100 + randint1(100);
-
-               /* Window stuff */
-               p_ptr->window |= (PW_INVEN | PW_EQUIP);
-
-               /* Done */
-               return;
-       }
-
-
-       if (o_ptr->name2 == EGO_JUMP)
-       {
-               teleport_player(10, 0L);
-               o_ptr->timeout = 10 + randint1(10);
-
-               /* Window stuff */
-               p_ptr->window |= (PW_INVEN | PW_EQUIP);
-
-               /* Done */
+               energy_use = 0;
                return;
        }
 
-
-       /* Hack -- Dragon Scale Mail can be activated as well */
-       if (o_ptr->tval == TV_DRAG_ARMOR)
-       {
-               /* Get a direction for breathing (or abort) */
-               if (!get_aim_dir(&dir)) return;
-
-               if (music_singing_any()) stop_singing();
-               if (hex_spelling_any()) stop_hex_spell_all();
-
-               /* Branch on the sub-type */
-               switch (o_ptr->sval)
-               {
-                       case SV_DRAGON_BLUE:
-                       {
-#ifdef JP
-                               msg_print("¤¢¤Ê¤¿¤Ï°ðºÊ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
-#else
-                               msg_print("You breathe lightning.");
-#endif
-
-                               fire_ball(GF_ELEC, dir, 100, -2);
-                               o_ptr->timeout = randint0(150) + 150;
-                               break;
-                       }
-
-                       case SV_DRAGON_WHITE:
-                       {
-#ifdef JP
-                               msg_print("¤¢¤Ê¤¿¤ÏÎ䵤¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
-#else
-                               msg_print("You breathe frost.");
-#endif
-
-                               fire_ball(GF_COLD, dir, 110, -2);
-                               o_ptr->timeout = randint0(150) + 150;
-                               break;
-                       }
-
-                       case SV_DRAGON_BLACK:
-                       {
-#ifdef JP
-                               msg_print("¤¢¤Ê¤¿¤Ï»À¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
-#else
-                               msg_print("You breathe acid.");
-#endif
-
-                               fire_ball(GF_ACID, dir, 130, -2);
-                               o_ptr->timeout = randint0(150) + 150;
-                               break;
-                       }
-
-                       case SV_DRAGON_GREEN:
-                       {
-#ifdef JP
-                               msg_print("¤¢¤Ê¤¿¤ÏÆÇ¥¬¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
-#else
-                               msg_print("You breathe poison gas.");
-#endif
-
-                               fire_ball(GF_POIS, dir, 150, -2);
-                               o_ptr->timeout = randint0(180) + 180;
-                               break;
-                       }
-
-                       case SV_DRAGON_RED:
-                       {
-#ifdef JP
-                               msg_print("¤¢¤Ê¤¿¤Ï²Ð±ê¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
-#else
-                               msg_print("You breathe fire.");
-#endif
-
-                               fire_ball(GF_FIRE, dir, 200, -2);
-                               o_ptr->timeout = randint0(200) + 200;
-                               break;
-                       }
-
-                       case SV_DRAGON_MULTIHUED:
-                       {
-                               chance = randint0(5);
-#ifdef JP
-                               msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
-                                          ((chance == 1) ? "°ðºÊ" :
-                                           ((chance == 2) ? "Î䵤" :
-                                            ((chance == 3) ? "»À" :
-                                             ((chance == 4) ? "ÆÇ¥¬¥¹" : "²Ð±ê")))));
-#else
-                               msg_format("You breathe %s.",
-                                          ((chance == 1) ? "lightning" :
-                                           ((chance == 2) ? "frost" :
-                                            ((chance == 3) ? "acid" :
-                                             ((chance == 4) ? "poison gas" : "fire")))));
-#endif
-
-                               fire_ball(((chance == 1) ? GF_ELEC :
-                                          ((chance == 2) ? GF_COLD :
-                                           ((chance == 3) ? GF_ACID :
-                                            ((chance == 4) ? GF_POIS : GF_FIRE)))),
-                                         dir, 250, -2);
-                               o_ptr->timeout = randint0(200) + 200;
-                               break;
-                       }
-
-                       case SV_DRAGON_BRONZE:
-                       {
-#ifdef JP
-                               msg_print("¤¢¤Ê¤¿¤Ïº®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
-#else
-                               msg_print("You breathe confusion.");
-#endif
-
-                               fire_ball(GF_CONFUSION, dir, 120, -2);
-                               o_ptr->timeout = randint0(180) + 180;
-                               break;
-                       }
-
-                       case SV_DRAGON_GOLD:
-                       {
-#ifdef JP
-                               msg_print("¤¢¤Ê¤¿¤Ï¹ì²»¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
-#else
-                               msg_print("You breathe sound.");
-#endif
-
-                               fire_ball(GF_SOUND, dir, 130, -2);
-                               o_ptr->timeout = randint0(180) + 180;
-                               break;
-                       }
-
-                       case SV_DRAGON_CHAOS:
-                       {
-                               chance = randint0(2);
-#ifdef JP
-                               msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
-                                          ((chance == 1 ? "¥«¥ª¥¹" : "Îô²½")));
-#else
-                               msg_format("You breathe %s.",
-                                          ((chance == 1 ? "chaos" : "disenchantment")));
-#endif
-
-                               fire_ball((chance == 1 ? GF_CHAOS : GF_DISENCHANT),
-                                         dir, 220, -2);
-                               o_ptr->timeout = randint0(200) + 200;
-                               break;
-                       }
-
-                       case SV_DRAGON_LAW:
-                       {
-                               chance = randint0(2);
-#ifdef JP
-                               msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
-                                          ((chance == 1 ? "¹ì²»" : "ÇËÊÒ")));
-#else
-                               msg_format("You breathe %s.",
-                                          ((chance == 1 ? "sound" : "shards")));
-#endif
-
-                               fire_ball((chance == 1 ? GF_SOUND : GF_SHARDS),
-                                         dir, 230, -2);
-                               o_ptr->timeout = randint0(200) + 200;
-                               break;
-                       }
-
-                       case SV_DRAGON_BALANCE:
-                       {
-                               chance = randint0(4);
-#ifdef JP
-                               msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿",
-                                          ((chance == 1) ? "¥«¥ª¥¹" :
-                                           ((chance == 2) ? "Îô²½" :
-                                            ((chance == 3) ? "¹ì²»" : "ÇËÊÒ"))));
-#else
-                               msg_format("You breathe %s.",
-                                          ((chance == 1) ? "chaos" :
-                                           ((chance == 2) ? "disenchantment" :
-                                            ((chance == 3) ? "sound" : "shards"))));
-#endif
-
-                               fire_ball(((chance == 1) ? GF_CHAOS :
-                                          ((chance == 2) ? GF_DISENCHANT :
-                                           ((chance == 3) ? GF_SOUND : GF_SHARDS))),
-                                         dir, 250, -2);
-                               o_ptr->timeout = randint0(200) + 200;
-                               break;
-                       }
-
-                       case SV_DRAGON_SHINING:
-                       {
-                               chance = randint0(2);
-#ifdef JP
-                               msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
-                                          ((chance == 0 ? "Á®¸÷" : "°Å¹õ")));
-#else
-                               msg_format("You breathe %s.",
-                                          ((chance == 0 ? "light" : "darkness")));
-#endif
-
-                               fire_ball((chance == 0 ? GF_LITE : GF_DARK), dir, 200, -2);
-                               o_ptr->timeout = randint0(200) + 200;
-                               break;
-                       }
-
-                       case SV_DRAGON_POWER:
-                       {
+       /* Activate the artifact */
 #ifdef JP
-msg_print("¤¢¤Ê¤¿¤Ï¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
+       msg_print("»ÏÆ°¤µ¤»¤¿...");
 #else
-                               msg_print("You breathe the elements.");
+       msg_print("You activate it...");
 #endif
 
-                               fire_ball(GF_MISSILE, dir, 300, -3);
-                               o_ptr->timeout = randint0(200) + 200;
-                               break;
-                       }
-               }
 
-               /* Window stuff */
-               p_ptr->window |= (PW_INVEN | PW_EQUIP);
-
-               /* Success */
-               return;
-       }
+       /* Sound */
+       sound(SOUND_ZAP);
 
-       else if (o_ptr->tval == TV_RING)
+       /* Activate object */
+       if (activation_index(o_ptr))
        {
-               if (object_is_ego(o_ptr))
-               {
-                       bool success = TRUE;
-
-                       switch (o_ptr->name2)
-                       {
-                       case EGO_RING_HERO:
-                               (void)set_afraid(0);
-                               (void)set_hero(randint1(25) + 25, FALSE);
-                               (void)hp_player(10);
-                               o_ptr->timeout = randint1(100)+100;
-                               break;
-                       case EGO_RING_MAGIC_MIS:
-                               if (!get_aim_dir(&dir)) return;
-                               fire_bolt(GF_MISSILE, dir, damroll(2, 6));
-                               o_ptr->timeout = 2;
-                               break;
-                       case EGO_RING_FIRE_BOLT:
-                               if (!get_aim_dir(&dir)) return;
-                               fire_bolt(GF_FIRE, dir, damroll(9, 8));
-                               o_ptr->timeout = randint0(8) + 8;
-                               break;
-                       case EGO_RING_COLD_BOLT:
-                               if (!get_aim_dir(&dir)) return;
-                               fire_bolt(GF_COLD, dir, damroll(6, 8));
-                               o_ptr->timeout = randint0(7) + 7;
-                               break;
-                       case EGO_RING_ELEC_BOLT:
-                               if (!get_aim_dir(&dir)) return;
-                               fire_bolt(GF_ELEC, dir, damroll(4, 8));
-                               o_ptr->timeout = randint0(5) + 5;
-                               break;
-                       case EGO_RING_ACID_BOLT:
-                               if (!get_aim_dir(&dir)) return;
-                               fire_bolt(GF_ACID, dir, damroll(5, 8));
-                               o_ptr->timeout = randint0(6) + 6;
-                               break;
-                       case EGO_RING_MANA_BOLT:
-                               if (!get_aim_dir(&dir)) return;
-                               fire_bolt(GF_MANA, dir, 120);
-                               o_ptr->timeout = randint0(120)+120;
-                               break;
-                       case EGO_RING_FIRE_BALL:
-                               if (!get_aim_dir(&dir)) return;
-                               fire_ball(GF_FIRE, dir, 100, 2);
-                               o_ptr->timeout = randint0(80) + 80;
-                               break;
-                       case EGO_RING_COLD_BALL:
-                               if (!get_aim_dir(&dir)) return;
-                               fire_ball(GF_COLD, dir, 100, 2);
-                               o_ptr->timeout = randint0(80) + 80;
-                               break;
-                       case EGO_RING_ELEC_BALL:
-                               if (!get_aim_dir(&dir)) return;
-                               fire_ball(GF_ELEC, dir, 100, 2);
-                               o_ptr->timeout = randint0(80) + 80;
-                               break;
-                       case EGO_RING_ACID_BALL:
-                               if (!get_aim_dir(&dir)) return;
-                               fire_ball(GF_ACID, dir, 100, 2);
-                               o_ptr->timeout = randint0(80) + 80;
-                               break;
-                       case EGO_RING_MANA_BALL:
-                               if (!get_aim_dir(&dir)) return;
-                               fire_ball(GF_MANA, dir, 250, 2);
-                               o_ptr->timeout = 300;
-                               break;
-                       case EGO_RING_DRAGON_F:
-                               if (!get_aim_dir(&dir)) return;
-                               fire_ball(GF_FIRE, dir, 200, -2);
-                               if (o_ptr->sval == SV_RING_FLAMES)
-                               {
-                                       (void)set_oppose_fire(randint1(20) + 20, FALSE);
-                                       o_ptr->timeout = 200;
-                               }
-                               else o_ptr->timeout = 250;
-                               break;
-                       case EGO_RING_DRAGON_C:
-                               if (!get_aim_dir(&dir)) return;
-                               fire_ball(GF_COLD, dir, 200, -2);
-                               if (o_ptr->sval == SV_RING_ICE)
-                               {
-                                       (void)set_oppose_cold(randint1(20) + 20, FALSE);
-                                       o_ptr->timeout = 200;
-                               }
-                               else o_ptr->timeout = 250;
-                               break;
-                       case EGO_RING_M_DETECT:
-                               (void)detect_monsters_invis(255);
-                               (void)detect_monsters_normal(255);
-                               o_ptr->timeout = 150;
-                               break;
-                       case EGO_RING_D_SPEED:
-                               (void)set_fast(randint1(30) + 15, FALSE);
-                               o_ptr->timeout = 100;
-                               break;
-                       case EGO_RING_BERSERKER:
-                               (void)set_afraid(0);
-                               (void)set_shero(randint1(25) + 25, FALSE);
-                               o_ptr->timeout = randint0(75)+75;
-                               break;
-                       case EGO_RING_TELE_AWAY:
-                               if (!get_aim_dir(&dir)) return;
-                               teleport_monster(dir);
-                               o_ptr->timeout = 150;
-                               break;
-                       case EGO_RING_TRUE:
-                       {
-                               int v = randint1(25)+25;
-                               (void)set_afraid(0);
-                               (void)set_hero(v, FALSE);
-                               (void)hp_player(10);
-                               (void)set_blessed(v, FALSE);
-                               (void)set_oppose_acid(v, FALSE);
-                               (void)set_oppose_elec(v, FALSE);
-                               (void)set_oppose_fire(v, FALSE);
-                               (void)set_oppose_cold(v, FALSE);
-                               (void)set_oppose_pois(v, FALSE);
-                               (void)set_ultimate_res(v, FALSE);
-                               o_ptr->timeout = 777;
-                               break;
-                       }
-                       default:
-                               success = FALSE;
-                               break;
-                       }
-                       if (success) return;
-               }
-
-               /* Get a direction for breathing (or abort) */
-               if (!get_aim_dir(&dir)) return;
-
-               switch (o_ptr->sval)
-               {
-                       case SV_RING_ACID:
-                       {
-                               fire_ball(GF_ACID, dir, 100, 2);
-                               (void)set_oppose_acid(randint1(20) + 20, FALSE);
-                               o_ptr->timeout = randint0(50) + 50;
-                               break;
-                       }
-
-                       case SV_RING_ICE:
-                       {
-                               fire_ball(GF_COLD, dir, 100, 2);
-                               (void)set_oppose_cold(randint1(20) + 20, FALSE);
-                               o_ptr->timeout = randint0(50) + 50;
-                               break;
-                       }
-
-                       case SV_RING_FLAMES:
-                       {
-                               fire_ball(GF_FIRE, dir, 100, 2);
-                               (void)set_oppose_fire(randint1(20) + 20, FALSE);
-                               o_ptr->timeout = randint0(50) + 50;
-                               break;
-                       }
-
-                       case SV_RING_ELEC:
-                       {
-                               fire_ball(GF_ELEC, dir, 100, 2);
-                               (void)set_oppose_elec(randint1(20) + 20, FALSE);
-                               o_ptr->timeout = randint0(50) + 50;
-                               break;
-                       }
-               }
+               (void)activate_random_artifact(o_ptr);
 
                /* Window stuff */
                p_ptr->window |= (PW_INVEN | PW_EQUIP);
@@ -4856,58 +4127,7 @@ msg_print("
                return;
        }
 
-       else if (o_ptr->tval == TV_AMULET)
-       {
-               if (object_is_ego(o_ptr))
-               {
-                       switch (o_ptr->name2)
-                       {
-                       case EGO_AMU_IDENT:
-                               if (!ident_spell(FALSE)) return;
-                               o_ptr->timeout = 10;
-                               break;
-                       case EGO_AMU_CHARM:
-                               if (!get_aim_dir(&dir)) return;
-                               charm_monster(dir, MAX(20, p_ptr->lev));
-                               o_ptr->timeout = 200;
-                               break;
-                       case EGO_AMU_JUMP:
-                               teleport_player(10, 0L);
-                               o_ptr->timeout = randint0(10) + 10;
-                               break;
-                       case EGO_AMU_TELEPORT:
-                               teleport_player(100, 0L);
-                               o_ptr->timeout = randint0(50) + 50;
-                               break;
-                       case EGO_AMU_D_DOOR:
-                               (void)dimension_door();
-                               o_ptr->timeout = 200;
-                               break;
-                       case EGO_AMU_RES_FIRE_:
-                               (void)set_oppose_fire(randint1(20) + 20, FALSE);
-                               o_ptr->timeout = randint0(50) + 50;
-                               break;
-                       case EGO_AMU_RES_COLD_:
-                               (void)set_oppose_cold(randint1(20) + 20, FALSE);
-                               o_ptr->timeout = randint0(50) + 50;
-                               break;
-                       case EGO_AMU_RES_ELEC_:
-                               (void)set_oppose_elec(randint1(20) + 20, FALSE);
-                               o_ptr->timeout = randint0(50) + 50;
-                               break;
-                       case EGO_AMU_RES_ACID_:
-                               (void)set_oppose_acid(randint1(20) + 20, FALSE);
-                               o_ptr->timeout = randint0(50) + 50;
-                               break;
-                       case EGO_AMU_DETECTION:
-                               detect_all(DETECT_RAD_DEFAULT);
-                               o_ptr->timeout = randint0(55)+55;
-                               break;
-                       }
-               }
-               return;
-       }
-
+       /* Special items */
        else if (o_ptr->tval == TV_WHISTLE)
        {
                if (music_singing_any()) stop_singing();
@@ -5384,13 +4604,15 @@ static int select_magic_eater(bool only_browse)
                        prt(format(" %s ¾ó", (menu_line == 1) ? "¡Õ" : "  "), 2, 14);
                        prt(format(" %s ËâË¡ËÀ", (menu_line == 2) ? "¡Õ" : "  "), 3, 14);
                        prt(format(" %s ¥í¥Ã¥É", (menu_line == 3) ? "¡Õ" : "  "), 4, 14);
-                       prt("¤É¤Î¼ïÎà¤ÎËâË¡¤ò»È¤¤¤Þ¤¹¤«¡©", 0, 0);
 #else
                        prt(format(" %s staff", (menu_line == 1) ? "> " : "  "), 2, 14);
                        prt(format(" %s wand", (menu_line == 2) ? "> " : "  "), 3, 14);
                        prt(format(" %s rod", (menu_line == 3) ? "> " : "  "), 4, 14);
-                       prt("Which type of magic do you use?", 0, 0);
 #endif
+
+                       if (only_browse) prt(_("¤É¤Î¼ïÎà¤ÎËâË¡¤ò¸«¤Þ¤¹¤«¡©", "Which type of magic do you browse?"), 0, 0);
+                       else prt(_("¤É¤Î¼ïÎà¤ÎËâË¡¤ò»È¤¤¤Þ¤¹¤«¡©", "Which type of magic do you use?"), 0, 0);
+
                        choice = inkey();
                        switch(choice)
                        {
@@ -5476,11 +4698,10 @@ static int select_magic_eater(bool only_browse)
        flag = FALSE;
 
        /* Build a prompt */
-#ifdef JP
-(void) strnfmt(out_val, 78, "('*'¤Ç°ìÍ÷, ESC¤ÇÃæÃÇ) ¤É¤ÎËâÎϤò»È¤¤¤Þ¤¹¤«¡©");
-#else
-       (void)strnfmt(out_val, 78, "(*=List, ESC=exit) Use which power? ");
-#endif
+       if (only_browse) strnfmt(out_val, 78, _("('*'¤Ç°ìÍ÷, ESC¤ÇÃæÃÇ) ¤É¤ÎËâÎϤò¸«¤Þ¤¹¤«¡©",
+                                                                                       "(*=List, ESC=exit) Browse which power? "));
+       else strnfmt(out_val, 78, _("('*'¤Ç°ìÍ÷, ESC¤ÇÃæÃÇ) ¤É¤ÎËâÎϤò»È¤¤¤Þ¤¹¤«¡©",
+                                                               "(*=List, ESC=exit) Use which power? "));
        
        /* Save the screen */
        screen_save();
@@ -5786,13 +5007,7 @@ static int select_magic_eater(bool only_browse)
                                prt(&temp[j], line, 10);
                                line++;
                        }
-       
-#ifdef JP
-                       prt("²¿¤«¥­¡¼¤ò²¡¤·¤Æ²¼¤µ¤¤¡£",0,0);
-#else
-                       prt("Hit any key.",0,0);
-#endif
-                       (void)inkey();
+
                        continue;
                }
 
@@ -5815,7 +5030,7 @@ static int select_magic_eater(bool only_browse)
 /*
  *  Use eaten rod, wand or staff
  */
-void do_cmd_magic_eater(bool only_browse)
+bool do_cmd_magic_eater(bool only_browse, bool powerful)
 {
        int item, chance, level, k_idx, tval, sval;
        bool use_charge = TRUE;
@@ -5829,14 +5044,14 @@ msg_print("
                msg_print("You are too confused!");
 #endif
 
-               return;
+               return FALSE;
        }
 
        item = select_magic_eater(only_browse);
        if (item == -1)
        {
                energy_use = 0;
-               return;
+               return FALSE;
        }
        if (item >= EATER_EXT*2) {tval = TV_ROD;sval = item - EATER_EXT*2;}
        else if (item >= EATER_EXT) {tval = TV_WAND;sval = item - EATER_EXT;}
@@ -5876,7 +5091,7 @@ msg_print("
                        chg_virtue(V_CHANCE,-1);
                energy_use = 100;
 
-               return;
+               return TRUE;
        }
        else
        {
@@ -5885,19 +5100,19 @@ msg_print("
                if (tval == TV_ROD)
                {
                        if ((sval >= SV_ROD_MIN_DIRECTION) && (sval != SV_ROD_HAVOC) && (sval != SV_ROD_AGGRAVATE) && (sval != SV_ROD_PESTICIDE))
-                               if (!get_aim_dir(&dir)) return;
-                       rod_effect(sval, dir, &use_charge, TRUE);
-                       if (!use_charge) return;
+                               if (!get_aim_dir(&dir)) return FALSE;
+                       rod_effect(sval, dir, &use_charge, powerful, TRUE);
+                       if (!use_charge) return FALSE;
                }
                else if (tval == TV_WAND)
                {
-                       if (!get_aim_dir(&dir)) return;
-                       wand_effect(sval, dir, TRUE);
+                       if (!get_aim_dir(&dir)) return FALSE;
+                       wand_effect(sval, dir, powerful, TRUE);
                }
                else
                {
-                       staff_effect(sval, &use_charge, TRUE, TRUE);
-                       if (!use_charge) return;
+                       staff_effect(sval, &use_charge, powerful, TRUE, TRUE);
+                       if (!use_charge) return FALSE;
                }
                if (randint1(100) < chance)
                        chg_virtue(V_CHANCE,1);
@@ -5905,4 +5120,6 @@ msg_print("
        energy_use = 100;
        if (tval == TV_ROD) p_ptr->magic_num1[item] += k_info[k_idx].pval * EATER_ROD_CHARGE;
        else p_ptr->magic_num1[item] -= EATER_CHARGE;
+
+        return TRUE;
 }