OSDN Git Service

[Refactor] #37353 グローバル変数 dungeon_type を他の慣例に従い dungeon_idx に改名。 / Rename dungeon_typ...
[hengband/hengband.git] / src / spells2.c
index 3e99e39..189f447 100644 (file)
@@ -12,6 +12,7 @@
  */
 
 #include "angband.h"
+#include "cmd-pet.h"
 #include "grid.h"
 #include "trap.h"
 #include "monsterrace-hook.h"
@@ -24,6 +25,7 @@
 #include "avatar.h"
 
 #include "spells-status.h"
+#include "realm-hex.h"
 
 /*!
  * @brief プレイヤー周辺の地形を感知する
@@ -38,7 +40,7 @@ static bool detect_feat_flag(POSITION range, int flag, bool known)
        bool detect = FALSE;
        cave_type *c_ptr;
 
-       if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
+       if (d_info[dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
 
        /* Scan the current panel */
        for (y = 1; y < cur_hgt - 1; y++)
@@ -170,7 +172,7 @@ bool detect_objects_gold(POSITION range)
 
        bool detect = FALSE;
 
-       if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range2 /= 3;
+       if (d_info[dungeon_idx].flags1 & DF1_DARKNESS) range2 /= 3;
 
        /* Scan objects */
        for (i = 1; i < o_max; i++)
@@ -225,7 +227,7 @@ bool detect_objects_normal(POSITION range)
 
        bool detect = FALSE;
 
-       if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range2 /= 3;
+       if (d_info[dungeon_idx].flags1 & DF1_DARKNESS) range2 /= 3;
 
        /* Scan objects */
        for (i = 1; i < o_max; i++)
@@ -288,7 +290,7 @@ bool detect_objects_magic(POSITION range)
 
        bool detect = FALSE;
 
-       if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
+       if (d_info[dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
 
        /* Scan all objects */
        for (i = 1; i < o_max; i++)
@@ -363,7 +365,7 @@ bool detect_monsters_normal(POSITION range)
        POSITION y, x;
        bool flag = FALSE;
 
-       if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
+       if (d_info[dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
 
        for (i = 1; i < m_max; i++)
        {
@@ -411,7 +413,7 @@ bool detect_monsters_invis(POSITION range)
        POSITION y, x;
        bool flag = FALSE;
 
-       if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
+       if (d_info[dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
 
        for (i = 1; i < m_max; i++)
        {
@@ -464,7 +466,7 @@ bool detect_monsters_evil(POSITION range)
        POSITION y, x;
        bool flag = FALSE;
 
-       if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
+       if (d_info[dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
 
        for (i = 1; i < m_max; i++)
        {
@@ -521,7 +523,7 @@ bool detect_monsters_nonliving(POSITION range)
        POSITION y, x;
        bool flag = FALSE;
 
-       if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
+       if (d_info[dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
 
        for (i = 1; i < m_max; i++)
        {
@@ -571,7 +573,7 @@ bool detect_monsters_mind(POSITION range)
        POSITION y, x;
        bool flag = FALSE;
 
-       if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
+       if (d_info[dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
 
        for (i = 1; i < m_max; i++)
        {
@@ -624,7 +626,7 @@ bool detect_monsters_string(POSITION range, concptr Match)
        POSITION y, x;
        bool flag = FALSE;
 
-       if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
+       if (d_info[dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
 
        for (i = 1; i < m_max; i++)
        {
@@ -679,7 +681,7 @@ bool detect_monsters_xxx(POSITION range, u32b match_flag)
        bool flag = FALSE;
        concptr desc_monsters = _("変なモンスター", "weird monsters");
 
-       if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
+       if (d_info[dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
 
        for (i = 1; i < m_max; i++)
        {
@@ -926,9 +928,9 @@ bool cleansing_nova(player_type *creature_ptr, bool magic, bool powerful)
 bool unleash_mana_storm(player_type *creature_ptr, bool powerful)
 {
        msg_print(_("強力な魔力が敵を引き裂いた!", "Mighty magics rend your enemies!"));
-       project(0, (powerful ? 7 : 5), p_ptr->y, p_ptr->x,
+       project(0, (powerful ? 7 : 5), creature_ptr->y, creature_ptr->x,
        (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))
+       if ((creature_ptr->pclass != CLASS_MAGE) && (creature_ptr->pclass != CLASS_HIGH_MAGE) && (creature_ptr->pclass != CLASS_SORCERER) && (creature_ptr->pclass != CLASS_MAGIC_EATER) && (creature_ptr->pclass != CLASS_BLUE_MAGE))
        {
                (void)take_hit(DAMAGE_NOESCAPE, 50, _("コントロールし難い強力な魔力の解放", "unleashing magics too mighty to control"), -1);
        }
@@ -970,8 +972,8 @@ bool crusade(void)
 void aggravate_monsters(MONSTER_IDX who)
 {
        MONSTER_IDX i;
-       bool    sleep = FALSE;
-       bool    speed = FALSE;
+       bool sleep = FALSE;
+       bool speed = FALSE;
 
        /* Aggravate everyone nearby */
        for (i = 1; i < m_max; i++)
@@ -1039,7 +1041,6 @@ bool genocide_aux(MONSTER_IDX m_idx, int power, bool player_cast, int dam_side,
        else if (player_cast && (r_ptr->level > randint0(power))) resist = TRUE;
        else if (player_cast && (m_ptr->mflag2 & MFLAG2_NOGENO)) resist = TRUE;
 
-
        else
        {
                if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
@@ -1541,7 +1542,7 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate)
                                        else
                                        {
                                                /* Create floor */
-                                               cave_set_feat(y, x, floor_type[randint0(100)]);
+                                               cave_set_feat(y, x, feat_ground_type[randint0(100)]);
                                        }
                                }
                                else /* In generation */
@@ -1592,7 +1593,7 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate)
                                c_ptr = &cave[y][x];
 
                                if (is_mirror_grid(c_ptr)) c_ptr->info |= CAVE_GLOW;
-                               else if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS))
+                               else if (!(d_info[dungeon_idx].flags1 & DF1_DARKNESS))
                                {
                                        DIRECTION i;
                                        POSITION yy, xx;
@@ -2039,7 +2040,7 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                                else
                                {
                                        /* Create floor */
-                                       cave_set_feat(yy, xx, floor_type[randint0(100)]);
+                                       cave_set_feat(yy, xx, feat_ground_type[randint0(100)]);
                                }
                        }
                }
@@ -2062,7 +2063,7 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
                        c_ptr = &cave[yy][xx];
 
                        if (is_mirror_grid(c_ptr)) c_ptr->info |= CAVE_GLOW;
-                       else if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS))
+                       else if (!(d_info[dungeon_idx].flags1 & DF1_DARKNESS))
                        {
                                DIRECTION ii;
                                POSITION yyy, xxx;
@@ -2085,7 +2086,6 @@ bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
        }
 
        /* Mega-Hack -- Forget the view and lite */
-       /* Update the health bar */
        p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE | PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_MONSTERS);
        p_ptr->redraw |= (PR_HEALTH | PR_UHEALTH | PR_MAP);
        p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
@@ -2237,11 +2237,8 @@ static void cave_temp_room_lite(void)
                        }
                }
 
-               /* Note */
                note_spot(y, x);
-
                lite_spot(y, x);
-
                update_local_illumination(y, x);
        }
 
@@ -2287,8 +2284,8 @@ static void cave_temp_room_unlite(void)
                        {
                                for (j = 0; j < 9; j++)
                                {
-                                       int by = y + ddy_ddd[j];
-                                       int bx = x + ddx_ddd[j];
+                                       POSITION by = y + ddy_ddd[j];
+                                       POSITION bx = x + ddx_ddd[j];
 
                                        if (in_bounds2(by, bx))
                                        {
@@ -2312,7 +2309,6 @@ static void cave_temp_room_unlite(void)
                        {
                                /* Forget the grid */
                                if (!view_torch_grids) c_ptr->info &= ~(CAVE_MARK);
-
                                note_spot(y, x);
                        }
 
@@ -2323,7 +2319,6 @@ static void cave_temp_room_unlite(void)
                        }
 
                        lite_spot(y, x);
-
                        update_local_illumination(y, x);
                }
        }
@@ -2603,7 +2598,7 @@ bool starlight(bool magic)
                        if (!player_bold(y, x)) break;
                }
 
-               project(0, 0, p_ptr->y, p_ptr->x, damroll(6 + p_ptr->lev / 8, 10), GF_LITE_WEAK,
+               project(0, 0, y, x, damroll(6 + p_ptr->lev / 8, 10), GF_LITE_WEAK,
                        (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_KILL | PROJECT_LOS), -1);
        }
        return TRUE;
@@ -2621,13 +2616,12 @@ bool lite_area(HIT_POINT dam, POSITION rad)
 {
        BIT_FLAGS flg = PROJECT_GRID | PROJECT_KILL;
 
-       if (d_info[dungeon_type].flags1 & DF1_DARKNESS)
+       if (d_info[dungeon_idx].flags1 & DF1_DARKNESS)
        {
                msg_print(_("ダンジョンが光を吸収した。", "The darkness of this dungeon absorb your light."));
                return FALSE;
        }
 
-       /* Hack -- Message */
        if (!p_ptr->blind)
        {
                msg_print(_("白い光が辺りを覆った。", "You are surrounded by a white light."));
@@ -2636,7 +2630,6 @@ bool lite_area(HIT_POINT dam, POSITION rad)
        /* Hook into the "project()" function */
        (void)project(0, rad, p_ptr->y, p_ptr->x, dam, GF_LITE_WEAK, flg, -1);
 
-       /* Lite up the room */
        lite_room(p_ptr->y, p_ptr->x);
 
        /* Assume seen */
@@ -2663,7 +2656,6 @@ bool unlite_area(HIT_POINT dam, POSITION rad)
        /* Hook into the "project()" function */
        (void)project(0, rad, p_ptr->y, p_ptr->x, dam, GF_DARK_WEAK, flg, -1);
 
-       /* Lite up the room */
        unlite_room(p_ptr->y, p_ptr->x);
 
        /* Assume seen */
@@ -2924,16 +2916,12 @@ bool teleport_swap(DIRECTION dir)
        if (!c_ptr->m_idx || (c_ptr->m_idx == p_ptr->riding))
        {
                msg_print(_("それとは場所を交換できません。", "You can't trade places with that!"));
-
-               /* Failure */
                return FALSE;
        }
 
        if ((c_ptr->info & CAVE_ICKY) || (distance(ty, tx, p_ptr->y, p_ptr->x) > p_ptr->lev * 3 / 2 + 10))
        {
                msg_print(_("失敗した。", "Failed to swap."));
-
-               /* Failure */
                return FALSE;
        }
 
@@ -2945,10 +2933,7 @@ bool teleport_swap(DIRECTION dir)
        if (r_ptr->flagsr & RFR_RES_TELE)
        {
                msg_print(_("テレポートを邪魔された!", "Your teleportation is blocked!"));
-
                if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
-
-               /* Failure */
                return FALSE;
        }
 
@@ -3200,13 +3185,9 @@ bool glyph_creation(void)
 bool wall_stone(void)
 {
        BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
-
        bool dummy = (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_STONE_WALL, flg, -1));
-
        p_ptr->update |= (PU_FLOW);
-
        p_ptr->redraw |= (PR_MAP);
-
        return dummy;
 }
 
@@ -3319,8 +3300,7 @@ void call_chaos(void)
  */
 bool activate_ty_curse(bool stop_ty, int *count)
 {
-       int     i = 0;
-
+       int i = 0;
        BIT_FLAGS flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
 
        do
@@ -3512,38 +3492,6 @@ int activate_hi_summon(POSITION y, POSITION x, bool can_pet)
        return count;
 }
 
-
-/*!
- * @brief サイバーデーモンの召喚
- * @param who 召喚主のモンスターID(0ならばプレイヤー)
- * @param y 召喚位置Y座標
- * @param x 召喚位置X座標
- * @return 作用が実際にあった場合TRUEを返す
- */
-int summon_cyber(MONSTER_IDX who, POSITION y, POSITION x)
-{
-       int i;
-       int max_cyber = (easy_band ? 1 : (dun_level / 50) + randint1(2));
-       int count = 0;
-       BIT_FLAGS mode = PM_ALLOW_GROUP;
-
-       /* Summoned by a monster */
-       if (who > 0)
-       {
-               monster_type *m_ptr = &m_list[who];
-               if (is_pet(m_ptr)) mode |= PM_FORCE_PET;
-       }
-
-       if (max_cyber > 4) max_cyber = 4;
-
-       for (i = 0; i < max_cyber; i++)
-       {
-               count += summon_specific(who, y, x, 100, SUMMON_CYBER, mode, '\0');
-       }
-
-       return count;
-}
-
 /*!
  * @brief 周辺破壊効果(プレイヤー中心)
  * @return 作用が実際にあった場合TRUEを返す
@@ -3967,10 +3915,7 @@ void ring_of_power(DIRECTION dir)
        case 3:
        {
                msg_print(_("あなたは強力なオーラに包み込まれた。", "You are surrounded by a powerful aura."));
-
-               /* Dispel monsters */
                dispel_monsters(1000);
-
                break;
        }
 
@@ -3978,9 +3923,7 @@ void ring_of_power(DIRECTION dir)
        case 5:
        case 6:
        {
-               /* Mana Ball */
                fire_ball(GF_MANA, dir, 600, 3);
-
                break;
        }
 
@@ -3989,9 +3932,7 @@ void ring_of_power(DIRECTION dir)
        case 9:
        case 10:
        {
-               /* Mana Bolt */
                fire_bolt(GF_MANA, dir, 500);
-
                break;
        }
        }
@@ -4627,7 +4568,7 @@ void cast_shuffle(void)
        else if (die < 111)
        {
                msg_print(_("《審判》だ。", "It's the Judgement."));
-               do_cmd_rerate(FALSE);
+               roll_hitdice(0L);
                lose_all_mutations();
        }
        else if (die < 120)
@@ -4650,145 +4591,6 @@ void cast_shuffle(void)
        }
 }
 
-bool_hack life_stream(bool_hack message, bool_hack virtue_change)
-{
-       if(virtue_change)
-       {
-               chg_virtue(V_VITALITY, 1);
-               chg_virtue(V_UNLIFE, -5);
-       }
-       if(message)
-       {
-               msg_print(_("体中に生命力が満ちあふれてきた!", "You feel life flow through your body!"));
-       }
-       restore_level();
-       (void)set_poisoned(0);
-       (void)set_blind(0);
-       (void)set_confused(0);
-       (void)set_image(0);
-       (void)set_stun(0);
-       (void)set_cut(0);
-       (void)restore_all_status();
-       (void)set_shero(0, TRUE);
-       handle_stuff();
-       hp_player(5000);
-
-       return TRUE;
-}
-
-bool_hack heroism(int base)
-{
-       bool_hack ident = FALSE;
-       if(set_afraid(0)) ident = TRUE;
-       if(set_hero(p_ptr->hero + randint1(base) + base, FALSE)) ident = TRUE;
-       if(hp_player(10)) ident = TRUE;
-       return ident;
-}
-
-bool_hack berserk(int base)
-{
-       bool_hack ident = FALSE;
-       if (set_afraid(0)) ident = TRUE;
-       if (set_shero(p_ptr->hero + randint1(base) + base, FALSE)) ident = TRUE;
-       if (hp_player(30)) ident = TRUE;
-       return ident;
-}
-
-bool_hack cure_light_wounds(DICE_NUMBER dice, DICE_SID sides)
-{
-       bool_hack ident = FALSE;
-       if (hp_player(damroll(dice, sides))) ident = TRUE;
-       if (set_blind(0)) ident = TRUE;
-       if (set_cut(p_ptr->cut - 10)) ident = TRUE;
-       if (set_shero(0, TRUE)) ident = TRUE;
-       return ident;
-}
-
-bool_hack cure_serious_wounds(DICE_NUMBER dice, DICE_SID sides)
-{
-       bool_hack ident = FALSE;
-       if (hp_player(damroll(dice, sides))) ident = TRUE;
-       if (set_blind(0)) ident = TRUE;
-       if (set_confused(0)) ident = TRUE;
-       if (set_cut((p_ptr->cut / 2) - 50)) ident = TRUE;
-       if (set_shero(0, TRUE)) ident = TRUE;
-       return ident;
-}
-
-bool_hack cure_critical_wounds(HIT_POINT pow)
-{
-       bool_hack ident = FALSE;
-       if (hp_player(pow)) ident = TRUE;
-       if (set_blind(0)) ident = TRUE;
-       if (set_confused(0)) ident = TRUE;
-       if (set_poisoned(0)) ident = TRUE;
-       if (set_stun(0)) ident = TRUE;
-       if (set_cut(0)) ident = TRUE;
-       if (set_shero(0, TRUE)) ident = TRUE;
-       return ident;
-}
-
-bool_hack true_healing(HIT_POINT pow)
-{
-       bool_hack ident = FALSE;
-       if (hp_player(pow)) ident = TRUE;
-       if (set_blind(0)) ident = TRUE;
-       if (set_confused(0)) ident = TRUE;
-       if (set_poisoned(0)) ident = TRUE;
-       if (set_stun(0)) ident = TRUE;
-       if (set_cut(0)) ident = TRUE;
-       if (set_image(0)) ident = TRUE;
-       return ident;
-}
-
-bool_hack restore_mana(bool_hack magic_eater)
-{
-       bool_hack ident = FALSE;
-
-       if (p_ptr->pclass == CLASS_MAGIC_EATER && magic_eater)
-       {
-               int i;
-               for (i = 0; i < EATER_EXT * 2; i++)
-               {
-                       p_ptr->magic_num1[i] += (p_ptr->magic_num2[i] < 10) ? EATER_CHARGE * 3 : p_ptr->magic_num2[i] * EATER_CHARGE / 3;
-                       if (p_ptr->magic_num1[i] > p_ptr->magic_num2[i] * EATER_CHARGE) p_ptr->magic_num1[i] = p_ptr->magic_num2[i] * EATER_CHARGE;
-               }
-               for (; i < EATER_EXT * 3; i++)
-               {
-                       KIND_OBJECT_IDX k_idx = lookup_kind(TV_ROD, i - EATER_EXT * 2);
-                       p_ptr->magic_num1[i] -= ((p_ptr->magic_num2[i] < 10) ? EATER_ROD_CHARGE * 3 : p_ptr->magic_num2[i] * EATER_ROD_CHARGE / 3)*k_info[k_idx].pval;
-                       if (p_ptr->magic_num1[i] < 0) p_ptr->magic_num1[i] = 0;
-               }
-               msg_print(_("頭がハッキリとした。", "You feel your head clear."));
-               p_ptr->window |= (PW_PLAYER);
-               ident = TRUE;
-       }
-       else if (p_ptr->csp < p_ptr->msp)
-       {
-               p_ptr->csp = p_ptr->msp;
-               p_ptr->csp_frac = 0;
-               msg_print(_("頭がハッキリとした。", "You feel your head clear."));
-               p_ptr->redraw |= (PR_MANA);
-               p_ptr->window |= (PW_PLAYER);
-               p_ptr->window |= (PW_SPELL);
-               ident = TRUE;
-       }
-
-       return ident;
-}
-
-bool restore_all_status(void)
-{
-       bool ident = FALSE; 
-       if (do_res_stat(A_STR)) ident = TRUE;
-       if (do_res_stat(A_INT)) ident = TRUE;
-       if (do_res_stat(A_WIS)) ident = TRUE;
-       if (do_res_stat(A_DEX)) ident = TRUE;
-       if (do_res_stat(A_CON)) ident = TRUE;
-       if (do_res_stat(A_CHR)) ident = TRUE;
-       return ident;
-}
-
 /*!
  * @brief 口を使う継続的な処理を中断する
  * @return なし
@@ -4807,7 +4609,7 @@ bool_hack vampirism(void)
        int dummy;
        cave_type *c_ptr;
 
-       if (d_info[dungeon_type].flags1 & DF1_NO_MELEE)
+       if (d_info[dungeon_idx].flags1 & DF1_NO_MELEE)
        {
                msg_print(_("なぜか攻撃することができない。", "Something prevent you from attacking."));
                return FALSE;
@@ -4893,7 +4695,7 @@ bool panic_hit(void)
 bool psychometry(void)
 {
        OBJECT_IDX      item;
-       object_type     *o_ptr;
+       object_type *o_ptr;
        GAME_TEXT o_name[MAX_NLEN];
        byte            feel;
        concptr            q, s;
@@ -4933,18 +4735,11 @@ bool psychometry(void)
 #endif
 
 
-       /* We have "felt" it */
        o_ptr->ident |= (IDENT_SENSE);
-
-       /* "Inscribe" it */
        o_ptr->feeling = feel;
-
-       /* Player touches it */
        o_ptr->marked |= OM_TOUCHED;
 
-       /* Combine / Reorder the pack (later) */
        p_ptr->update |= (PU_COMBINE | PU_REORDER);
-
        p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
 
        /* Valid "tval" codes */
@@ -4982,3 +4777,444 @@ bool psychometry(void)
        /* Something happened */
        return (TRUE);
 }
+
+
+bool draconian_breath(player_type *creature_ptr)
+{
+       DIRECTION dir;
+       int Type = (one_in_(3) ? GF_COLD : GF_FIRE);
+       concptr Type_desc = ((Type == GF_COLD) ? _("冷気", "cold") : _("炎", "fire"));
+
+       if (!get_aim_dir(&dir)) return FALSE;
+
+       if (randint1(100) < creature_ptr->lev)
+       {
+               switch (creature_ptr->pclass)
+               {
+               case CLASS_WARRIOR:
+               case CLASS_BERSERKER:
+               case CLASS_RANGER:
+               case CLASS_TOURIST:
+               case CLASS_IMITATOR:
+               case CLASS_ARCHER:
+               case CLASS_SMITH:
+                       if (one_in_(3))
+                       {
+                               Type = GF_MISSILE;
+                               Type_desc = _("エレメント", "the elements");
+                       }
+                       else
+                       {
+                               Type = GF_SHARDS;
+                               Type_desc = _("破片", "shards");
+                       }
+                       break;
+               case CLASS_MAGE:
+               case CLASS_WARRIOR_MAGE:
+               case CLASS_HIGH_MAGE:
+               case CLASS_SORCERER:
+               case CLASS_MAGIC_EATER:
+               case CLASS_RED_MAGE:
+               case CLASS_BLUE_MAGE:
+               case CLASS_MIRROR_MASTER:
+                       if (one_in_(3))
+                       {
+                               Type = GF_MANA;
+                               Type_desc = _("魔力", "mana");
+                       }
+                       else
+                       {
+                               Type = GF_DISENCHANT;
+                               Type_desc = _("劣化", "disenchantment");
+                       }
+                       break;
+               case CLASS_CHAOS_WARRIOR:
+                       if (!one_in_(3))
+                       {
+                               Type = GF_CONFUSION;
+                               Type_desc = _("混乱", "confusion");
+                       }
+                       else
+                       {
+                               Type = GF_CHAOS;
+                               Type_desc = _("カオス", "chaos");
+                       }
+                       break;
+               case CLASS_MONK:
+               case CLASS_SAMURAI:
+               case CLASS_FORCETRAINER:
+                       if (!one_in_(3))
+                       {
+                               Type = GF_CONFUSION;
+                               Type_desc = _("混乱", "confusion");
+                       }
+                       else
+                       {
+                               Type = GF_SOUND;
+                               Type_desc = _("轟音", "sound");
+                       }
+                       break;
+               case CLASS_MINDCRAFTER:
+                       if (!one_in_(3))
+                       {
+                               Type = GF_CONFUSION;
+                               Type_desc = _("混乱", "confusion");
+                       }
+                       else
+                       {
+                               Type = GF_PSI;
+                               Type_desc = _("精神エネルギー", "mental energy");
+                       }
+                       break;
+               case CLASS_PRIEST:
+               case CLASS_PALADIN:
+                       if (one_in_(3))
+                       {
+                               Type = GF_HELL_FIRE;
+                               Type_desc = _("地獄の劫火", "hellfire");
+                       }
+                       else
+                       {
+                               Type = GF_HOLY_FIRE;
+                               Type_desc = _("聖なる炎", "holy fire");
+                       }
+                       break;
+               case CLASS_ROGUE:
+               case CLASS_NINJA:
+                       if (one_in_(3))
+                       {
+                               Type = GF_DARK;
+                               Type_desc = _("暗黒", "darkness");
+                       }
+                       else
+                       {
+                               Type = GF_POIS;
+                               Type_desc = _("毒", "poison");
+                       }
+                       break;
+               case CLASS_BARD:
+                       if (!one_in_(3))
+                       {
+                               Type = GF_SOUND;
+                               Type_desc = _("轟音", "sound");
+                       }
+                       else
+                       {
+                               Type = GF_CONFUSION;
+                               Type_desc = _("混乱", "confusion");
+                       }
+                       break;
+               }
+       }
+
+       stop_mouth();
+       msg_format(_("あなたは%sのブレスを吐いた。", "You breathe %s."), Type_desc);
+
+       fire_breath(Type, dir, creature_ptr->lev * 2, (creature_ptr->lev / 15) + 1);
+       return TRUE;
+}
+
+bool android_inside_weapon(player_type *creature_ptr)
+{
+       DIRECTION dir;
+       if (!get_aim_dir(&dir)) return FALSE;
+       if (creature_ptr->lev < 10)
+       {
+               msg_print(_("レイガンを発射した。", "You fire your ray gun."));
+               fire_bolt(GF_MISSILE, dir, (creature_ptr->lev + 1) / 2);
+       }
+       else if (creature_ptr->lev < 25)
+       {
+               msg_print(_("ブラスターを発射した。", "You fire your blaster."));
+               fire_bolt(GF_MISSILE, dir, creature_ptr->lev);
+       }
+       else if (creature_ptr->lev < 35)
+       {
+               msg_print(_("バズーカを発射した。", "You fire your bazooka."));
+               fire_ball(GF_MISSILE, dir, creature_ptr->lev * 2, 2);
+       }
+       else if (creature_ptr->lev < 45)
+       {
+               msg_print(_("ビームキャノンを発射した。", "You fire a beam cannon."));
+               fire_beam(GF_MISSILE, dir, creature_ptr->lev * 2);
+       }
+       else
+       {
+               msg_print(_("ロケットを発射した。", "You fire a rocket."));
+               fire_rocket(GF_ROCKET, dir, creature_ptr->lev * 5, 2);
+       }
+       return TRUE;
+}
+
+bool create_ration(player_type *crature_ptr)
+{
+       object_type *q_ptr;
+       object_type forge;
+       q_ptr = &forge;
+
+       /* Create the food ration */
+       object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_RATION));
+
+       /* Drop the object from heaven */
+       (void)drop_near(q_ptr, -1, crature_ptr->y, crature_ptr->x);
+       msg_print(_("食事を料理して作った。", "You cook some food."));
+       return TRUE;
+}
+
+void hayagake(player_type *creature_ptr)
+{
+       if (creature_ptr->action == ACTION_HAYAGAKE)
+       {
+               set_action(ACTION_NONE);
+       }
+       else
+       {
+               cave_type *c_ptr = &cave[creature_ptr->y][creature_ptr->x];
+               feature_type *f_ptr = &f_info[c_ptr->feat];
+
+               if (!have_flag(f_ptr->flags, FF_PROJECT) ||
+                       (!creature_ptr->levitation && have_flag(f_ptr->flags, FF_DEEP)))
+               {
+                       msg_print(_("ここでは素早く動けない。", "You cannot run in here."));
+               }
+               else
+               {
+                       set_action(ACTION_HAYAGAKE);
+               }
+       }
+       creature_ptr->energy_use = 0;
+}
+
+bool double_attack(player_type *creature_ptr)
+{
+       DIRECTION dir;
+       POSITION x, y;
+
+       if (!get_rep_dir(&dir, FALSE)) return FALSE;
+       y = creature_ptr->y + ddy[dir];
+       x = creature_ptr->x + ddx[dir];
+       if (cave[y][x].m_idx)
+       {
+               if (one_in_(3))
+                       msg_print(_("あーたたたたたたたたたたたたたたたたたたたたたた!!!",
+                               "Ahhhtatatatatatatatatatatatatatataatatatatattaaaaa!!!!"));
+               else if(one_in_(2))
+                       msg_print(_("無駄無駄無駄無駄無駄無駄無駄無駄無駄無駄無駄無駄!!!",
+                               "Mudamudamudamudamudamudamudamudamudamudamudamudamuda!!!!"));
+               else
+                       msg_print(_("オラオラオラオラオラオラオラオラオラオラオラオラ!!!",
+                               "Oraoraoraoraoraoraoraoraoraoraoraoraoraoraoraoraora!!!!"));
+
+               py_attack(y, x, 0);
+               if (cave[y][x].m_idx)
+               {
+                       handle_stuff();
+                       py_attack(y, x, 0);
+               }
+               creature_ptr->energy_need += ENERGY_NEED();
+       }
+       else
+       {
+               msg_print(_("その方向にはモンスターはいません。", "You don't see any monster in this direction"));
+               msg_print(NULL);
+       }
+       return TRUE;
+}
+
+bool comvert_hp_to_mp(player_type *creature_ptr)
+{
+       int gain_sp = take_hit(DAMAGE_USELIFE, creature_ptr->lev, _("HPからMPへの無謀な変換", "thoughtless convertion from HP to SP"), -1) / 5;
+       if (gain_sp)
+       {
+               creature_ptr->csp += gain_sp;
+               if (creature_ptr->csp > creature_ptr->msp)
+               {
+                       creature_ptr->csp = creature_ptr->msp;
+                       creature_ptr->csp_frac = 0;
+               }
+       }
+       else
+       {
+               msg_print(_("変換に失敗した。", "You failed to convert."));
+       }
+       creature_ptr->redraw |= (PR_HP | PR_MANA);
+       return TRUE;
+}
+
+bool comvert_mp_to_hp(player_type *creature_ptr)
+{
+       if (creature_ptr->csp >= creature_ptr->lev / 5)
+       {
+               creature_ptr->csp -= creature_ptr->lev / 5;
+               hp_player(creature_ptr->lev);
+       }
+       else
+       {
+               msg_print(_("変換に失敗した。", "You failed to convert."));
+       }
+       creature_ptr->redraw |= (PR_HP | PR_MANA);
+       return TRUE;
+}
+
+bool demonic_breath(player_type *creature_ptr)
+{
+       DIRECTION dir;
+       int type = (one_in_(2) ? GF_NETHER : GF_FIRE);
+       if (!get_aim_dir(&dir)) return FALSE;
+       stop_mouth();
+       msg_format(_("あなたは%sのブレスを吐いた。", "You breathe %s."), ((type == GF_NETHER) ? _("地獄", "nether") : _("火炎", "fire")));
+       fire_breath(type, dir, creature_ptr->lev * 3, (creature_ptr->lev / 15) + 1);
+       return TRUE;
+}
+
+bool mirror_concentration(player_type *creature_ptr)
+{
+       if (total_friends)
+       {
+               msg_print(_("今はペットを操ることに集中していないと。", "You need concentration on the pets now."));
+               return FALSE;
+       }
+       if (is_mirror_grid(&cave[creature_ptr->y][creature_ptr->x]))
+       {
+               msg_print(_("少し頭がハッキリした。", "You feel your head clear a little."));
+
+               creature_ptr->csp += (5 + creature_ptr->lev * creature_ptr->lev / 100);
+               if (creature_ptr->csp >= creature_ptr->msp)
+               {
+                       creature_ptr->csp = creature_ptr->msp;
+                       creature_ptr->csp_frac = 0;
+               }
+               creature_ptr->redraw |= (PR_MANA);
+       }
+       else
+       {
+               msg_print(_("鏡の上でないと集中できない!", "Here are not any mirrors!"));
+       }
+       return TRUE;
+}
+
+bool sword_dancing(player_type *creature_ptr)
+{
+       DIRECTION dir;
+       POSITION y = 0, x = 0;
+       int i;
+       cave_type *c_ptr;
+
+       for (i = 0; i < 6; i++)
+       {
+               dir = randint0(8);
+               y = creature_ptr->y + ddy_ddd[dir];
+               x = creature_ptr->x + ddx_ddd[dir];
+               c_ptr = &cave[y][x];
+
+               /* Hack -- attack monsters */
+               if (c_ptr->m_idx)
+                       py_attack(y, x, 0);
+               else
+               {
+                       msg_print(_("攻撃が空をきった。", "You attack the empty air."));
+               }
+       }
+       return TRUE;
+}
+
+bool confusing_light(player_type *creature_ptr)
+{
+       msg_print(_("辺りを睨んだ...", "You glare nearby monsters..."));
+       slow_monsters(creature_ptr->lev);
+       stun_monsters(creature_ptr->lev * 4);
+       confuse_monsters(creature_ptr->lev * 4);
+       turn_monsters(creature_ptr->lev * 4);
+       stasis_monsters(creature_ptr->lev * 4);
+       return TRUE;
+}
+
+bool rodeo(player_type *creature_ptr)
+{
+       GAME_TEXT m_name[MAX_NLEN];
+       monster_type *m_ptr;
+       monster_race *r_ptr;
+       int rlev;
+
+       if (creature_ptr->riding)
+       {
+               msg_print(_("今は乗馬中だ。", "You ARE riding."));
+               return FALSE;
+       }
+       if (!do_riding(TRUE)) return TRUE;
+
+       m_ptr = &m_list[creature_ptr->riding];
+       r_ptr = &r_info[m_ptr->r_idx];
+       monster_desc(m_name, m_ptr, 0);
+       msg_format(_("%sに乗った。", "You ride on %s."), m_name);
+
+       if (is_pet(m_ptr)) return TRUE;
+
+       rlev = r_ptr->level;
+
+       if (r_ptr->flags1 & RF1_UNIQUE) rlev = rlev * 3 / 2;
+       if (rlev > 60) rlev = 60 + (rlev - 60) / 2;
+       if ((randint1(creature_ptr->skill_exp[GINOU_RIDING] / 120 + creature_ptr->lev * 2 / 3) > rlev)
+               && one_in_(2) && !creature_ptr->inside_arena && !creature_ptr->inside_battle
+               && !(r_ptr->flags7 & (RF7_GUARDIAN)) && !(r_ptr->flags1 & (RF1_QUESTOR))
+               && (rlev < creature_ptr->lev * 3 / 2 + randint0(creature_ptr->lev / 5)))
+       {
+               msg_format(_("%sを手なずけた。", "You tame %s."), m_name);
+               set_pet(m_ptr);
+       }
+       else
+       {
+               msg_format(_("%sに振り落とされた!", "You have thrown off by %s."), m_name);
+               rakuba(1, TRUE);
+
+               /* Paranoia */
+               /* 落馬処理に失敗してもとにかく乗馬解除 */
+               creature_ptr->riding = 0;
+       }
+       return TRUE;
+}
+
+bool clear_mind(player_type *creature_ptr)
+{
+       if (total_friends)
+       {
+               msg_print(_("今はペットを操ることに集中していないと。", "You need concentration on the pets now."));
+               return FALSE;
+       }
+       msg_print(_("少し頭がハッキリした。", "You feel your head clear a little."));
+
+       creature_ptr->csp += (3 + creature_ptr->lev / 20);
+       if (creature_ptr->csp >= creature_ptr->msp)
+       {
+               creature_ptr->csp = creature_ptr->msp;
+               creature_ptr->csp_frac = 0;
+       }
+       creature_ptr->redraw |= (PR_MANA);
+       return TRUE;
+}
+
+bool concentration(player_type *creature_ptr)
+{
+       int max_csp = MAX(creature_ptr->msp * 4, creature_ptr->lev * 5 + 5);
+
+       if (total_friends)
+       {
+               msg_print(_("今はペットを操ることに集中していないと。", "You need concentration on the pets now."));
+               return FALSE;
+       }
+       if (creature_ptr->special_defense & KATA_MASK)
+       {
+               msg_print(_("今は構えに集中している。", "You need concentration on your form."));
+               return FALSE;
+       }
+       msg_print(_("精神を集中して気合いを溜めた。", "You concentrate to charge your power."));
+
+       creature_ptr->csp += creature_ptr->msp / 2;
+       if (creature_ptr->csp >= max_csp)
+       {
+               creature_ptr->csp = max_csp;
+               creature_ptr->csp_frac = 0;
+       }
+       creature_ptr->redraw |= (PR_MANA);
+       return TRUE;
+}