OSDN Git Service

[Refactor] #38997 lose_all_mutations() に player_type * 引数を追加.
[hengband/hengband.git] / src / mutation.c
index 2139cfd..3123740 100644 (file)
  */
 
 #include "angband.h"
+#include "core.h"
+#include "util.h"
+
+#include "cmd-dump.h"
+#include "mutation.h"
+
+#include "selfinfo.h"
+#include "spells-summon.h"
+#include "avatar.h"
+#include "player-status.h"
+#include "player-effects.h"
+#include "player-personality.h"
+#include "player-class.h"
+#include "player-damage.h"
+#include "spells-status.h"
+#include "spells-floor.h"
+#include "object-hook.h"
+#include "spells.h"
+#include "cmd-basic.h"
+#include "files.h"
+#include "floor.h"
+#include "targeting.h"
+#include "player-race.h"
 
 /*!
  * @brief プレイヤーに突然変異を与える
  * @param choose_mut 与えたい突然変異のID、0ならばランダムに選択
  * @return なし
  */
-bool gain_random_mutation(int choose_mut)
+bool gain_mutation(player_type *creature_ptr, MUTATION_IDX choose_mut)
 {
-       int     attempts_left = 20;
-       cptr    muta_desc = "";
-       bool    muta_chosen = FALSE;
-       u32b    muta_which = 0;
-       u32b    *muta_class = NULL;
+       int attempts_left = 20;
+       concptr muta_desc = "";
+       bool muta_chosen = FALSE;
+       BIT_FLAGS muta_which = 0;
+       BIT_FLAGS *muta_class = NULL;
 
        if (choose_mut) attempts_left = 1;
 
        while (attempts_left--)
        {
-               switch (choose_mut ? choose_mut : (p_ptr->pclass == CLASS_BERSERKER ? 74+randint1(119) : randint1(193)))
+               switch (choose_mut ? choose_mut : (creature_ptr->pclass == CLASS_BERSERKER ? 74+randint1(119) : randint1(193)))
                {
                case 1: case 2: case 3: case 4:
-                       muta_class = &(p_ptr->muta1);
+                       muta_class = &(creature_ptr->muta1);
                        muta_which = MUT1_SPIT_ACID;
                        muta_desc = _("酸を吐く能力を得た。", "You gain the ability to spit acid.");
                        break;
                        
                case 5: case 6: case 7:
-                       muta_class = &(p_ptr->muta1);
+                       muta_class = &(creature_ptr->muta1);
                        muta_which = MUT1_BR_FIRE;
                        muta_desc = _("火を吐く能力を得た。", "You gain the ability to breathe fire.");
                        break;
                        
                case 8: case 9:
-                       muta_class = &(p_ptr->muta1);
+                       muta_class = &(creature_ptr->muta1);
                        muta_which = MUT1_HYPN_GAZE;
                        muta_desc = _("催眠眼の能力を得た。", "Your eyes look mesmerizing...");
                        break;
                        
                case 10: case 11:
-                       muta_class = &(p_ptr->muta1);
+                       muta_class = &(creature_ptr->muta1);
                        muta_which = MUT1_TELEKINES;
                        muta_desc = _("物体を念動力で動かす能力を得た。", "You gain the ability to move objects telekinetically.");
                        break;
                        
                case 12: case 13: case 14:
-                       muta_class = &(p_ptr->muta1);
+                       muta_class = &(creature_ptr->muta1);
                        muta_which = MUT1_VTELEPORT;
                        muta_desc = _("自分の意思でテレポートする能力を得た。", "You gain the power of teleportation at will.");
                        break;
                        
                case 15: case 16:
-                       muta_class = &(p_ptr->muta1);
+                       muta_class = &(creature_ptr->muta1);
                        muta_which = MUT1_MIND_BLST;
                        muta_desc = _("精神攻撃の能力を得た。", "You gain the power of Mind Blast.");
                        break;
                        
                case 17: case 18:
-                       muta_class = &(p_ptr->muta1);
+                       muta_class = &(creature_ptr->muta1);
                        muta_which = MUT1_RADIATION;
                        muta_desc = _("あなたは強い放射線を発生し始めた。", "You start emitting hard radiation.");
                        break;
                        
                case 19: case 20:
-                       muta_class = &(p_ptr->muta1);
+                       muta_class = &(creature_ptr->muta1);
                        muta_which = MUT1_VAMPIRISM;
                        muta_desc = _("生命力を吸収できるようになった。", "You become vampiric.");
                        break;
                        
                case 21: case 22: case 23:
-                       muta_class = &(p_ptr->muta1);
+                       muta_class = &(creature_ptr->muta1);
                        muta_which = MUT1_SMELL_MET;
                        muta_desc = _("金属の匂いを嗅ぎ分けられるようになった。", "You smell a metallic odor.");
                        break;
                        
                case 24: case 25: case 26: case 27:
-                       muta_class = &(p_ptr->muta1);
+                       muta_class = &(creature_ptr->muta1);
                        muta_which = MUT1_SMELL_MON;
                        muta_desc = _("モンスターの臭いを嗅ぎ分けられるようになった。", "You smell filthy monsters.");
                        break;
                        
                case 28: case 29: case 30:
-                       muta_class = &(p_ptr->muta1);
+                       muta_class = &(creature_ptr->muta1);
                        muta_which = MUT1_BLINK;
                        muta_desc = _("近距離テレポートの能力を得た。", "You gain the power of minor teleportation.");
                        break;
                        
                case 31: case 32:
-                       muta_class = &(p_ptr->muta1);
+                       muta_class = &(creature_ptr->muta1);
                        muta_which = MUT1_EAT_ROCK;
                        muta_desc = _("壁が美味しそうに見える。", "The walls look delicious.");
                        break;
                        
                case 33: case 34:
-                       muta_class = &(p_ptr->muta1);
+                       muta_class = &(creature_ptr->muta1);
                        muta_which = MUT1_SWAP_POS;
                        muta_desc = _("他人の靴で一マイル歩くような気分がする。", "You feel like walking a mile in someone else's shoes.");
                        break;
                        
                case 35: case 36: case 37:
-                       muta_class = &(p_ptr->muta1);
+                       muta_class = &(creature_ptr->muta1);
                        muta_which = MUT1_SHRIEK;
                        muta_desc = _("あなたの声は相当強くなった。", "Your vocal cords get much tougher.");
                        break;
                        
                case 38: case 39: case 40:
-                       muta_class = &(p_ptr->muta1);
+                       muta_class = &(creature_ptr->muta1);
                        muta_which = MUT1_ILLUMINE;
                        muta_desc = _("あなたは光り輝いて部屋を明るくするようになった。", "You can light up rooms with your presence.");
                        break;
                        
                case 41: case 42:
-                       muta_class = &(p_ptr->muta1);
+                       muta_class = &(creature_ptr->muta1);
                        muta_which = MUT1_DET_CURSE;
                        muta_desc = _("邪悪な魔法を感知できるようになった。", "You can feel evil magics.");
                        break;
                        
                case 43: case 44: case 45:
-                       muta_class = &(p_ptr->muta1);
+                       muta_class = &(creature_ptr->muta1);
                        muta_which = MUT1_BERSERK;
                        muta_desc = _("制御できる激情を感じる。", "You feel a controlled rage.");
                        break;
                        
                case 46:
-                       muta_class = &(p_ptr->muta1);
+                       muta_class = &(creature_ptr->muta1);
                        muta_which = MUT1_POLYMORPH;
                        muta_desc = _("体が変異しやすくなった。", "Your body seems mutable.");
                        break;
                        
                case 47: case 48:
-                       muta_class = &(p_ptr->muta1);
+                       muta_class = &(creature_ptr->muta1);
                        muta_which = MUT1_MIDAS_TCH;
                        muta_desc = _("「ミダス王の手」の能力を得た。", "You gain the Midas touch.");/*トゥームレイダースにありましたね。 */
                        break;
                        
                case 49:
-                       muta_class = &(p_ptr->muta1);
+                       muta_class = &(creature_ptr->muta1);
                        muta_which = MUT1_GROW_MOLD;
                        muta_desc = _("突然カビに親しみを覚えた。", "You feel a sudden affinity for mold.");
                        break;
                        
                case 50: case 51: case 52:
-                       muta_class = &(p_ptr->muta1);
+                       muta_class = &(creature_ptr->muta1);
                        muta_which = MUT1_RESIST;
                        muta_desc = _("あなたは自分自身を守れる気がする。", "You feel like you can protect yourself.");
                        break;
                        
                case 53: case 54: case 55:
-                       muta_class = &(p_ptr->muta1);
+                       muta_class = &(creature_ptr->muta1);
                        muta_which = MUT1_EARTHQUAKE;
                        muta_desc = _("ダンジョンを破壊する能力を得た。", "You gain the ability to wreck the dungeon.");
                        break;
                        
                case 56:
-                       muta_class = &(p_ptr->muta1);
+                       muta_class = &(creature_ptr->muta1);
                        muta_which = MUT1_EAT_MAGIC;
                        muta_desc = _("魔法のアイテムが美味そうに見える。", "Your magic items look delicious.");
                        break;
                        
                case 57: case 58:
-                       muta_class = &(p_ptr->muta1);
+                       muta_class = &(creature_ptr->muta1);
                        muta_which = MUT1_WEIGH_MAG;
                        muta_desc = _("あなたは周囲にある魔法をより良く理解できる気がする。", "You feel you can better understand the magic around you.");
                        break;
                        
                case 59:
-                       muta_class = &(p_ptr->muta1);
+                       muta_class = &(creature_ptr->muta1);
                        muta_which = MUT1_STERILITY;
                        muta_desc = _("周りの全ての者に頭痛を起こすことができる。", "You can give everything around you a headache.");
                        break;
                case 60: case 61:
-                       muta_class = &(p_ptr->muta1);
+                       muta_class = &(creature_ptr->muta1);
                        muta_which = MUT1_PANIC_HIT;
                        muta_desc = _("突然、泥棒の気分が分かるようになった。", "You suddenly understand how thieves feel.");
                        break;
                        
                case 62: case 63: case 64:
-                       muta_class = &(p_ptr->muta1);
+                       muta_class = &(creature_ptr->muta1);
                        muta_which = MUT1_DAZZLE;
                        muta_desc = _("眩い閃光を発する能力を得た。", "You gain the ability to emit dazzling lights.");
                        break;
                        
                case 65: case 66: case 67:
-                       muta_class = &(p_ptr->muta1);
+                       muta_class = &(creature_ptr->muta1);
                        muta_which = MUT1_LASER_EYE;
                        muta_desc = _("あなたの目は一瞬焼け付いた。", "Your eyes burn for a moment.");
                        break;
                        
                case 68: case 69:
-                       muta_class = &(p_ptr->muta1);
+                       muta_class = &(creature_ptr->muta1);
                        muta_which = MUT1_RECALL;
                        muta_desc = _("少しだけホームシックになったが、すぐ直った。", "You feel briefly homesick, but it passes.");
                        break;
                        
                case 70:
-                       muta_class = &(p_ptr->muta1);
+                       muta_class = &(creature_ptr->muta1);
                        muta_which = MUT1_BANISH;
                        muta_desc = _("神聖な怒りの力に満たされた。", "You feel a holy wrath fill you.");
                        break;
                        
                case 71: case 72:
-                       muta_class = &(p_ptr->muta1);
+                       muta_class = &(creature_ptr->muta1);
                        muta_which = MUT1_COLD_TOUCH;
                        muta_desc = _("あなたの両手はとても冷たくなった。", "Your hands get very cold.");
                        break;
                        
                case 73: case 74:
-                       muta_class = &(p_ptr->muta1);
+                       muta_class = &(creature_ptr->muta1);
                        muta_which = MUT1_LAUNCHER;
                        muta_desc = _("あなたの物を投げる手はかなり強くなった気がする。", "Your throwing arm feels much stronger.");
                        break;
                        
                case 75:
-                       muta_class = &(p_ptr->muta2);
+                       muta_class = &(creature_ptr->muta2);
                        muta_which = MUT2_BERS_RAGE;
                        muta_desc = _("あなたは狂暴化の発作を起こすようになった!", "You become subject to fits of berserk rage!");
                        break;
                        
                case 76:
-                       muta_class = &(p_ptr->muta2);
+                       muta_class = &(creature_ptr->muta2);
                        muta_which = MUT2_COWARDICE;
                        muta_desc = _("信じられないくらい臆病になった!", "You become an incredible coward!");
                        break;
                        
                case 77:
-                       muta_class = &(p_ptr->muta2);
+                       muta_class = &(creature_ptr->muta2);
                        muta_which = MUT2_RTELEPORT;
                        muta_desc = _("あなたの位置は非常に不確定になった。", "Your position seems very uncertain...");
                        break;
                        
                case 78:
-                       muta_class = &(p_ptr->muta2);
+                       muta_class = &(creature_ptr->muta2);
                        muta_which = MUT2_ALCOHOL;
                        muta_desc = _("あなたはアルコールを分泌するようになった。", "Your body starts producing alcohol!");
                        break;
                        
                case 79:
-                       muta_class = &(p_ptr->muta2);
+                       muta_class = &(creature_ptr->muta2);
                        muta_which = MUT2_HALLU;
                        muta_desc = _("あなたは幻覚を引き起こす精神錯乱に侵された。", "You are afflicted by a hallucinatory insanity!");
                        break;
                        
                case 80:
-                       muta_class = &(p_ptr->muta2);
+                       muta_class = &(creature_ptr->muta2);
                        muta_which = MUT2_FLATULENT;
                        muta_desc = _( "あなたは制御不能な強烈な屁をこくようになった。",  "You become subject to uncontrollable flatulence.");
 
                        break;
                case 81: case 82:
-                       muta_class = &(p_ptr->muta2);
+                       muta_class = &(creature_ptr->muta2);
                        muta_which = MUT2_SCOR_TAIL;
                        muta_desc = _( "サソリの尻尾が生えてきた!",  "You grow a scorpion tail!");
 
                        break;
                case 83: case 84:
-                       muta_class = &(p_ptr->muta2);
+                       muta_class = &(creature_ptr->muta2);
                        muta_which = MUT2_HORNS;
                        muta_desc = _( "額に角が生えた!",  "Horns pop forth into your forehead!");
 
                        break;
                case 85: case 86:
-                       muta_class = &(p_ptr->muta2);
+                       muta_class = &(creature_ptr->muta2);
                        muta_which = MUT2_BEAK;
                        muta_desc = _( "口が鋭く強いクチバシに変化した!",  "Your mouth turns into a sharp, powerful beak!");
 
                        break;
                case 87: case 88:
-                       muta_class = &(p_ptr->muta2);
+                       muta_class = &(creature_ptr->muta2);
                        muta_which = MUT2_ATT_DEMON;
                        muta_desc = _( "悪魔を引き付けるようになった。",  "You start attracting demons.");
 
                        break;
                case 89:
-                       muta_class = &(p_ptr->muta2);
+                       muta_class = &(creature_ptr->muta2);
                        muta_which = MUT2_PROD_MANA;
                        muta_desc = _( "あなたは制御不能な魔法のエネルギーを発生するようになった。",  "You start producing magical energy uncontrollably.");
 
                        break;
                case 90: case 91:
-                       muta_class = &(p_ptr->muta2);
+                       muta_class = &(creature_ptr->muta2);
                        muta_which = MUT2_SPEED_FLUX;
                        muta_desc = _( "あなたは躁鬱質になった。",  "You become manic-depressive.");
 
                        break;
                case 92: case 93:
-                       muta_class = &(p_ptr->muta2);
+                       muta_class = &(creature_ptr->muta2);
                        muta_which = MUT2_BANISH_ALL;
                        muta_desc = _( "恐ろしい力があなたの背後に潜んでいる気がする。",  "You feel a terrifying power lurking behind you.");
 
                        break;
                case 94:
-                       muta_class = &(p_ptr->muta2);
+                       muta_class = &(creature_ptr->muta2);
                        muta_which = MUT2_EAT_LIGHT;
                        muta_desc = _( "あなたはウンゴリアントに奇妙な親しみを覚えるようになった。",  "You feel a strange kinship with Ungoliant.");
 
                        break;
                case 95: case 96:
-                       muta_class = &(p_ptr->muta2);
+                       muta_class = &(creature_ptr->muta2);
                        muta_which = MUT2_TRUNK;
                        muta_desc = _( "あなたの鼻は伸びて象の鼻のようになった。",  "Your nose grows into an elephant-like trunk.");
 
                        break;
                case 97:
-                       muta_class = &(p_ptr->muta2);
+                       muta_class = &(creature_ptr->muta2);
                        muta_which = MUT2_ATT_ANIMAL;
                        muta_desc = _( "動物を引き付けるようになった。",  "You start attracting animals.");
 
                        break;
                case 98:
-                       muta_class = &(p_ptr->muta2);
+                       muta_class = &(creature_ptr->muta2);
                        muta_which = MUT2_TENTACLES;
                        muta_desc = _( "邪悪な触手が体の両側に生えてきた。",  "Evil-looking tentacles sprout from your sides.");
 
                        break;
                case 99:
-                       muta_class = &(p_ptr->muta2);
+                       muta_class = &(creature_ptr->muta2);
                        muta_which = MUT2_RAW_CHAOS;
                        muta_desc = _( "周囲の空間が不安定になった気がする。",  "You feel the universe is less stable around you.");
 
                        break;
                case 100: case 101: case 102:
-                       muta_class = &(p_ptr->muta2);
+                       muta_class = &(creature_ptr->muta2);
                        muta_which = MUT2_NORMALITY;
                        muta_desc = _( "あなたは奇妙なほど普通になった気がする。",  "You feel strangely normal.");
 
                        break;
                case 103:
-                       muta_class = &(p_ptr->muta2);
+                       muta_class = &(creature_ptr->muta2);
                        muta_which = MUT2_WRAITH;
                        muta_desc = _( "あなたは幽体化したり実体化したりするようになった。",  "You start to fade in and out of the physical world.");
 
                        break;
                case 104:
-                       muta_class = &(p_ptr->muta2);
+                       muta_class = &(creature_ptr->muta2);
                        muta_which = MUT2_POLY_WOUND;
                        muta_desc = _( "あなたはカオスの力が古い傷に入り込んでくるのを感じた。",  "You feel forces of chaos entering your old scars.");
 
                        break;
                case 105:
-                       muta_class = &(p_ptr->muta2);
+                       muta_class = &(creature_ptr->muta2);
                        muta_which = MUT2_WASTING;
                        muta_desc = _( "あなたは突然おぞましい衰弱病にかかった。",  "You suddenly contract a horrible wasting disease.");
 
                        break;
                case 106:
-                       muta_class = &(p_ptr->muta2);
+                       muta_class = &(creature_ptr->muta2);
                        muta_which = MUT2_ATT_DRAGON;
                        muta_desc = _( "あなたはドラゴンを引きつけるようになった。",  "You start attracting dragons.");
 
                        break;
                case 107: case 108:
-                       muta_class = &(p_ptr->muta2);
+                       muta_class = &(creature_ptr->muta2);
                        muta_which = MUT2_WEIRD_MIND;
                        muta_desc = _( "あなたの思考は突然おかしな方向に向き始めた。",  "Your thoughts suddenly take off in strange directions.");
 
                        break;
                case 109:
-                       muta_class = &(p_ptr->muta2);
+                       muta_class = &(creature_ptr->muta2);
                        muta_which = MUT2_NAUSEA;
                        muta_desc = _( "胃袋がピクピクしはじめた。",  "Your stomach starts to roil nauseously.");
 
                        break;
                case 110: case 111:
                        /* Chaos warriors already have a chaos deity */
-                       if (p_ptr->pclass != CLASS_CHAOS_WARRIOR)
+                       if (creature_ptr->pclass != CLASS_CHAOS_WARRIOR)
                        {
-                               muta_class = &(p_ptr->muta2);
+                               muta_class = &(creature_ptr->muta2);
                                muta_which = MUT2_CHAOS_GIFT;
                        muta_desc = _( "あなたはカオスの守護悪魔の注意を惹くようになった。",  "You attract the notice of a chaos deity!");
 
                        }
                        break;
                case 112:
-                       muta_class = &(p_ptr->muta2);
+                       muta_class = &(creature_ptr->muta2);
                        muta_which = MUT2_WALK_SHAD;
                        muta_desc = _( "あなたは現実が紙のように薄いと感じるようになった。",  "You feel like reality is as thin as paper.");
 
                        break;
                case 113: case 114:
-                       muta_class = &(p_ptr->muta2);
+                       muta_class = &(creature_ptr->muta2);
                        muta_which = MUT2_WARNING;
                        muta_desc = _( "あなたは突然パラノイアになった気がする。",  "You suddenly feel paranoid.");
 
                        break;
                case 115:
-                       muta_class = &(p_ptr->muta2);
+                       muta_class = &(creature_ptr->muta2);
                        muta_which = MUT2_INVULN;
                        muta_desc = _( "あなたは祝福され、無敵状態になる発作を起こすようになった。",  "You are blessed with fits of invulnerability.");
 
                        break;
                case 116: case 117:
-                       muta_class = &(p_ptr->muta2);
+                       muta_class = &(creature_ptr->muta2);
                        muta_which = MUT2_SP_TO_HP;
                        muta_desc = _( "魔法の治癒の発作を起こすようになった。",  "You are subject to fits of magical healing.");
 
                        break;
                case 118:
-                       muta_class = &(p_ptr->muta2);
+                       muta_class = &(creature_ptr->muta2);
                        muta_which = MUT2_HP_TO_SP;
                        muta_desc = _( "痛みを伴う精神明瞭化の発作を起こすようになった。",  "You are subject to fits of painful clarity.");
 
                        break;
                case 119:
-                       muta_class = &(p_ptr->muta2);
+                       muta_class = &(creature_ptr->muta2);
                        muta_which = MUT2_DISARM;
                        muta_desc = _( "あなたの脚は長さが四倍になった。",  "Your feet grow to four times their former size.");
 
                        break;
                case 120: case 121: case 122:
-                       muta_class = &(p_ptr->muta3);
+                       muta_class = &(creature_ptr->muta3);
                        muta_which = MUT3_HYPER_STR;
-                       muta_desc = _( "超人的に強くなった!",  "You turn into a superhuman he-man!");
+                       muta_desc = _( "超人的に強くなった!",  "You current_world_ptr->game_turn into a superhuman he-man!");
 
                        break;
                case 123: case 124: case 125:
-                       muta_class = &(p_ptr->muta3);
+                       muta_class = &(creature_ptr->muta3);
                        muta_which = MUT3_PUNY;
                        muta_desc = _( "筋肉が弱ってしまった...",  "Your muscles wither away...");
 
                        break;
                case 126: case 127: case 128:
-                       muta_class = &(p_ptr->muta3);
+                       muta_class = &(creature_ptr->muta3);
                        muta_which = MUT3_HYPER_INT;
                        muta_desc = _( "あなたの脳は生体コンピュータに進化した!",  "Your brain evolves into a living computer!");
 
                        break;
                case 129: case 130: case 131:
-                       muta_class = &(p_ptr->muta3);
+                       muta_class = &(creature_ptr->muta3);
                        muta_which = MUT3_MORONIC;
                        muta_desc = _( "脳が萎縮してしまった...",  "Your brain withers away...");
 
                        break;
                case 132: case 133:
-                       muta_class = &(p_ptr->muta3);
+                       muta_class = &(creature_ptr->muta3);
                        muta_which = MUT3_RESILIENT;
                        muta_desc = _( "並外れてタフになった。",  "You become extraordinarily resilient.");
 
                        break;
                case 134: case 135:
-                       muta_class = &(p_ptr->muta3);
+                       muta_class = &(creature_ptr->muta3);
                        muta_which = MUT3_XTRA_FAT;
                        muta_desc = _( "あなたは気持ち悪いくらい太った!",  "You become sickeningly fat!");
 
                        break;
                case 136: case 137:
-                       muta_class = &(p_ptr->muta3);
+                       muta_class = &(creature_ptr->muta3);
                        muta_which = MUT3_ALBINO;
-                       muta_desc = _( "アルビノになった!弱くなった気がする...",  "You turn into an albino! You feel frail...");
+                       muta_desc = _( "アルビノになった!弱くなった気がする...",  "You current_world_ptr->game_turn into an albino! You feel frail...");
 
                        break;
                case 138: case 139: case 140:
-                       muta_class = &(p_ptr->muta3);
+                       muta_class = &(creature_ptr->muta3);
                        muta_which = MUT3_FLESH_ROT;
                        muta_desc = _( "あなたの肉体は腐敗する病気に侵された!",  "Your flesh is afflicted by a rotting disease!");
 
                        break;
                case 141: case 142:
-                       muta_class = &(p_ptr->muta3);
+                       muta_class = &(creature_ptr->muta3);
                        muta_which = MUT3_SILLY_VOI;
                        muta_desc = _( "声が間抜けなキーキー声になった!",  "Your voice turns into a ridiculous squeak!");
 
                        break;
                case 143: case 144:
-                       muta_class = &(p_ptr->muta3);
+                       muta_class = &(creature_ptr->muta3);
                        muta_which = MUT3_BLANK_FAC;
                        muta_desc = _( "のっぺらぼうになった!",  "Your face becomes completely featureless!");
 
                        break;
                case 145:
-                       muta_class = &(p_ptr->muta3);
+                       muta_class = &(creature_ptr->muta3);
                        muta_which = MUT3_ILL_NORM;
                        muta_desc = _( "心の安らぐ幻影を映し出すようになった。",  "You start projecting a reassuring image.");
 
                        break;
                case 146: case 147: case 148:
-                       muta_class = &(p_ptr->muta3);
+                       muta_class = &(creature_ptr->muta3);
                        muta_which = MUT3_XTRA_EYES;
                        muta_desc = _( "新たに二つの目が出来た!",  "You grow an extra pair of eyes!");
 
                        break;
                case 149: case 150:
-                       muta_class = &(p_ptr->muta3);
+                       muta_class = &(creature_ptr->muta3);
                        muta_which = MUT3_MAGIC_RES;
                        muta_desc = _( "魔法への耐性がついた。",  "You become resistant to magic.");
 
                        break;
                case 151: case 152: case 153:
-                       muta_class = &(p_ptr->muta3);
+                       muta_class = &(creature_ptr->muta3);
                        muta_which = MUT3_XTRA_NOIS;
                        muta_desc = _( "あなたは奇妙な音を立て始めた!",  "You start making strange noise!");
 
                        break;
                case 154: case 155: case 156:
-                       muta_class = &(p_ptr->muta3);
+                       muta_class = &(creature_ptr->muta3);
                        muta_which = MUT3_INFRAVIS;
                        muta_desc = _( "赤外線視力が増した。",  "Your infravision is improved.");
 
                        break;
                case 157: case 158:
-                       muta_class = &(p_ptr->muta3);
+                       muta_class = &(creature_ptr->muta3);
                        muta_which = MUT3_XTRA_LEGS;
                        muta_desc = _( "新たに二本の足が生えてきた!",  "You grow an extra pair of legs!");
 
                        break;
                case 159: case 160:
-                       muta_class = &(p_ptr->muta3);
+                       muta_class = &(creature_ptr->muta3);
                        muta_which = MUT3_SHORT_LEG;
-                       muta_desc = _( "足が短い突起になってしまった!",  "Your legs turn into short stubs!");
+                       muta_desc = _( "足が短い突起になってしまった!",  "Your legs current_world_ptr->game_turn into short stubs!");
 
                        break;
                case 161: case 162:
-                       muta_class = &(p_ptr->muta3);
+                       muta_class = &(creature_ptr->muta3);
                        muta_which = MUT3_ELEC_TOUC;
                        muta_desc = _( "血管を電流が流れ始めた!",  "Electricity starts running through you!");
 
                        break;
                case 163: case 164:
-                       muta_class = &(p_ptr->muta3);
+                       muta_class = &(creature_ptr->muta3);
                        muta_which = MUT3_FIRE_BODY;
                        muta_desc = _( "あなたの体は炎につつまれている。",  "Your body is enveloped in flames!");
 
                        break;
                case 165: case 166: case 167:
-                       muta_class = &(p_ptr->muta3);
+                       muta_class = &(creature_ptr->muta3);
                        muta_which = MUT3_WART_SKIN;
                        muta_desc = _( "気持ち悪いイボイボが体中にできた!",  "Disgusting warts appear everywhere on you!");
 
                        break;
                case 168: case 169: case 170:
-                       muta_class = &(p_ptr->muta3);
+                       muta_class = &(creature_ptr->muta3);
                        muta_which = MUT3_SCALES;
                        muta_desc = _( "肌が黒い鱗に変わった!",  "Your skin turns into black scales!");
 
                        break;
                case 171: case 172:
-                       muta_class = &(p_ptr->muta3);
+                       muta_class = &(creature_ptr->muta3);
                        muta_which = MUT3_IRON_SKIN;
                        muta_desc = _( "あなたの肌は鉄になった!",  "Your skin turns to steel!");
 
                        break;
                case 173: case 174:
-                       muta_class = &(p_ptr->muta3);
+                       muta_class = &(creature_ptr->muta3);
                        muta_which = MUT3_WINGS;
                        muta_desc = _( "背中に羽が生えた。",  "You grow a pair of wings.");
 
                        break;
                case 175: case 176: case 177:
-                       muta_class = &(p_ptr->muta3);
+                       muta_class = &(creature_ptr->muta3);
                        muta_which = MUT3_FEARLESS;
                        muta_desc = _( "完全に怖れ知らずになった。",  "You become completely fearless.");
 
                        break;
                case 178: case 179:
-                       muta_class = &(p_ptr->muta3);
+                       muta_class = &(creature_ptr->muta3);
                        muta_which = MUT3_REGEN;
                        muta_desc = _( "急速に回復し始めた。",  "You start regenerating.");
 
                        break;
                case 180: case 181:
-                       muta_class = &(p_ptr->muta3);
+                       muta_class = &(creature_ptr->muta3);
                        muta_which = MUT3_ESP;
                        muta_desc = _( "テレパシーの能力を得た!",  "You develop a telepathic ability!");
 
                        break;
                case 182: case 183: case 184:
-                       muta_class = &(p_ptr->muta3);
+                       muta_class = &(creature_ptr->muta3);
                        muta_which = MUT3_LIMBER;
                        muta_desc = _( "筋肉がしなやかになった。",  "Your muscles become limber.");
 
                        break;
                case 185: case 186: case 187:
-                       muta_class = &(p_ptr->muta3);
+                       muta_class = &(creature_ptr->muta3);
                        muta_which = MUT3_ARTHRITIS;
                        muta_desc = _( "関節が突然痛み出した。",  "Your joints suddenly hurt.");
 
                        break;
                case 188:
-                       if (p_ptr->pseikaku == SEIKAKU_LUCKY) break;
-                       muta_class = &(p_ptr->muta3);
+                       if (creature_ptr->pseikaku == SEIKAKU_LUCKY) break;
+                       muta_class = &(creature_ptr->muta3);
                        muta_which = MUT3_BAD_LUCK;
                        muta_desc = _( "悪意に満ちた黒いオーラがあなたをとりまいた...",  "There is a malignant black aura surrounding you...");
 
                        break;
                case 189:
-                       muta_class = &(p_ptr->muta3);
+                       muta_class = &(creature_ptr->muta3);
                        muta_which = MUT3_VULN_ELEM;
                        muta_desc = _( "妙に無防備になった気がする。",  "You feel strangely exposed.");
 
                        break;
                case 190: case 191: case 192:
-                       muta_class = &(p_ptr->muta3);
+                       muta_class = &(creature_ptr->muta3);
                        muta_which = MUT3_MOTION;
                        muta_desc = _( "体の動作がより正確になった。",  "You move with new assurance.");
 
                        break;
                case 193:
-                       muta_class = &(p_ptr->muta3);
+                       muta_class = &(creature_ptr->muta3);
                        muta_which = MUT3_GOOD_LUCK;
                        muta_desc = _( "慈悲深い白いオーラがあなたをとりまいた...",  "There is a benevolent white aura surrounding you...");
 
@@ -643,51 +666,51 @@ bool gain_random_mutation(int choose_mut)
                                                        --- henkma
                */
                if(!choose_mut){
-                       if (p_ptr->prace == RACE_VAMPIRE &&
-                         !(p_ptr->muta1 & MUT1_HYPN_GAZE) &&
+                       if (creature_ptr->prace == RACE_VAMPIRE &&
+                         !(creature_ptr->muta1 & MUT1_HYPN_GAZE) &&
                           (randint1(10) < 7))
                        {
-                               muta_class = &(p_ptr->muta1);
+                               muta_class = &(creature_ptr->muta1);
                                muta_which = MUT1_HYPN_GAZE;
                        muta_desc = _( "眼が幻惑的になった...",  "Your eyes look mesmerizing...");
 
                        }
 
-                       else if (p_ptr->prace == RACE_IMP &&
-                                !(p_ptr->muta2 & MUT2_HORNS) &&
+                       else if (creature_ptr->prace == RACE_IMP &&
+                                !(creature_ptr->muta2 & MUT2_HORNS) &&
                                 (randint1(10) < 7))
                          {
-                               muta_class = &(p_ptr->muta2);
+                               muta_class = &(creature_ptr->muta2);
                                muta_which = MUT2_HORNS;
                        muta_desc = _( "角が額から生えてきた!",  "Horns pop forth into your forehead!");
 
                        }
 
-                       else if (p_ptr->prace == RACE_YEEK &&
-                               !(p_ptr->muta1 & MUT1_SHRIEK) &&
+                       else if (creature_ptr->prace == RACE_YEEK &&
+                               !(creature_ptr->muta1 & MUT1_SHRIEK) &&
                                (randint1(10) < 7))
                        {
-                               muta_class = &(p_ptr->muta1);
+                               muta_class = &(creature_ptr->muta1);
                                muta_which = MUT1_SHRIEK;
                        muta_desc = _( "声質がかなり強くなった。",  "Your vocal cords get much tougher.");
 
                        }
 
-                       else if (p_ptr->prace == RACE_BEASTMAN &&
-                               !(p_ptr->muta1 & MUT1_POLYMORPH) &&
+                       else if (creature_ptr->prace == RACE_BEASTMAN &&
+                               !(creature_ptr->muta1 & MUT1_POLYMORPH) &&
                                (randint1(10) < 2))
                        {
-                               muta_class = &(p_ptr->muta1);
+                               muta_class = &(creature_ptr->muta1);
                                muta_which = MUT1_POLYMORPH;
                        muta_desc = _( "あなたの肉体は変化できるようになった、",  "Your body seems mutable.");
 
                        }
 
-                       else if (p_ptr->prace == RACE_MIND_FLAYER &&
-                               !(p_ptr->muta2 & MUT2_TENTACLES) &&
+                       else if (creature_ptr->prace == RACE_MIND_FLAYER &&
+                               !(creature_ptr->muta2 & MUT2_TENTACLES) &&
                                (randint1(10) < 7))
                        {
-                               muta_class = &(p_ptr->muta2);
+                               muta_class = &(creature_ptr->muta2);
                                muta_which = MUT2_TENTACLES;
                        muta_desc = _( "邪悪な触手が口の周りに生えた。",  "Evil-looking tentacles sprout from your mouth.");
 
@@ -698,154 +721,154 @@ bool gain_random_mutation(int choose_mut)
                msg_print(muta_desc);
                *muta_class |= muta_which;
 
-               if (muta_class == &(p_ptr->muta3))
+               if (muta_class == &(creature_ptr->muta3))
                {
                        if (muta_which == MUT3_PUNY)
                        {
-                               if (p_ptr->muta3 & MUT3_HYPER_STR)
+                               if (creature_ptr->muta3 & MUT3_HYPER_STR)
                                {
                                        msg_print(_("あなたはもう超人的に強くはない!", "You no longer feel super-strong!"));
 
-                                       p_ptr->muta3 &= ~(MUT3_HYPER_STR);
+                                       creature_ptr->muta3 &= ~(MUT3_HYPER_STR);
                                }
                        }
                        else if (muta_which == MUT3_HYPER_STR)
                        {
-                               if (p_ptr->muta3 & MUT3_PUNY)
+                               if (creature_ptr->muta3 & MUT3_PUNY)
                                {
                                        msg_print(_("あなたはもう虚弱ではない!", "You no longer feel puny!"));
 
-                                       p_ptr->muta3 &= ~(MUT3_PUNY);
+                                       creature_ptr->muta3 &= ~(MUT3_PUNY);
                                }
                        }
                        else if (muta_which == MUT3_MORONIC)
                        {
-                               if (p_ptr->muta3 & MUT3_HYPER_INT)
+                               if (creature_ptr->muta3 & MUT3_HYPER_INT)
                                {
                                        msg_print(_("あなたの脳はもう生体コンピュータではない。", "Your brain is no longer a living computer."));
 
-                                       p_ptr->muta3 &= ~(MUT3_HYPER_INT);
+                                       creature_ptr->muta3 &= ~(MUT3_HYPER_INT);
                                }
                        }
                        else if (muta_which == MUT3_HYPER_INT)
                        {
-                               if (p_ptr->muta3 & MUT3_MORONIC)
+                               if (creature_ptr->muta3 & MUT3_MORONIC)
                                {
                                        msg_print(_("あなたはもう精神薄弱ではない。", "You are no longer moronic."));
 
-                                       p_ptr->muta3 &= ~(MUT3_MORONIC);
+                                       creature_ptr->muta3 &= ~(MUT3_MORONIC);
                                }
                        }
                        else if (muta_which == MUT3_IRON_SKIN)
                        {
-                               if (p_ptr->muta3 & MUT3_SCALES)
+                               if (creature_ptr->muta3 & MUT3_SCALES)
                                {
                                        msg_print(_("鱗がなくなった。", "You lose your scales."));
 
-                                       p_ptr->muta3 &= ~(MUT3_SCALES);
+                                       creature_ptr->muta3 &= ~(MUT3_SCALES);
                                }
-                               if (p_ptr->muta3 & MUT3_FLESH_ROT)
+                               if (creature_ptr->muta3 & MUT3_FLESH_ROT)
                                {
                                        msg_print(_("肉体が腐乱しなくなった。", "Your flesh rots no longer."));
 
-                                       p_ptr->muta3 &= ~(MUT3_FLESH_ROT);
+                                       creature_ptr->muta3 &= ~(MUT3_FLESH_ROT);
                                }
-                               if (p_ptr->muta3 & MUT3_WART_SKIN)
+                               if (creature_ptr->muta3 & MUT3_WART_SKIN)
                                {
                                        msg_print(_("肌のイボイボがなくなった。", "You lose your warts."));
 
-                                       p_ptr->muta3 &= ~(MUT3_WART_SKIN);
+                                       creature_ptr->muta3 &= ~(MUT3_WART_SKIN);
                                }
                        }
                        else if (muta_which == MUT3_WART_SKIN || muta_which == MUT3_SCALES
                                || muta_which == MUT3_FLESH_ROT)
                        {
-                               if (p_ptr->muta3 & MUT3_IRON_SKIN)
+                               if (creature_ptr->muta3 & MUT3_IRON_SKIN)
                                {
                                        msg_print(_("あなたの肌はもう鉄ではない。", "Your skin is no longer made of steel."));
 
-                                       p_ptr->muta3 &= ~(MUT3_IRON_SKIN);
+                                       creature_ptr->muta3 &= ~(MUT3_IRON_SKIN);
                                }
                        }
                        else if (muta_which == MUT3_FEARLESS)
                        {
-                               if (p_ptr->muta2 & MUT2_COWARDICE)
+                               if (creature_ptr->muta2 & MUT2_COWARDICE)
                                {
                                        msg_print(_("臆病でなくなった。", "You are no longer cowardly."));
 
-                                       p_ptr->muta2 &= ~(MUT2_COWARDICE);
+                                       creature_ptr->muta2 &= ~(MUT2_COWARDICE);
                                }
                        }
                        else if (muta_which == MUT3_FLESH_ROT)
                        {
-                               if (p_ptr->muta3 & MUT3_REGEN)
+                               if (creature_ptr->muta3 & MUT3_REGEN)
                                {
                                        msg_print(_("急速に回復しなくなった。", "You stop regenerating."));
 
-                                       p_ptr->muta3 &= ~(MUT3_REGEN);
+                                       creature_ptr->muta3 &= ~(MUT3_REGEN);
                                }
                        }
                        else if (muta_which == MUT3_REGEN)
                        {
-                               if (p_ptr->muta3 & MUT3_FLESH_ROT)
+                               if (creature_ptr->muta3 & MUT3_FLESH_ROT)
                                {
                                        msg_print(_("肉体が腐乱しなくなった。", "Your flesh stops rotting."));
 
-                                       p_ptr->muta3 &= ~(MUT3_FLESH_ROT);
+                                       creature_ptr->muta3 &= ~(MUT3_FLESH_ROT);
                                }
                        }
                        else if (muta_which == MUT3_LIMBER)
                        {
-                               if (p_ptr->muta3 & MUT3_ARTHRITIS)
+                               if (creature_ptr->muta3 & MUT3_ARTHRITIS)
                                {
                                        msg_print(_("関節が痛くなくなった。", "Your joints stop hurting."));
 
-                                       p_ptr->muta3 &= ~(MUT3_ARTHRITIS);
+                                       creature_ptr->muta3 &= ~(MUT3_ARTHRITIS);
                                }
                        }
                        else if (muta_which == MUT3_ARTHRITIS)
                        {
-                               if (p_ptr->muta3 & MUT3_LIMBER)
+                               if (creature_ptr->muta3 & MUT3_LIMBER)
                                {
                                        msg_print(_("あなたはしなやかでなくなった。", "You no longer feel limber."));
 
-                                       p_ptr->muta3 &= ~(MUT3_LIMBER);
+                                       creature_ptr->muta3 &= ~(MUT3_LIMBER);
                                }
                        }
                }
-               else if (muta_class == &(p_ptr->muta2))
+               else if (muta_class == &(creature_ptr->muta2))
                {
                        if (muta_which == MUT2_COWARDICE)
                        {
-                               if (p_ptr->muta3 & MUT3_FEARLESS)
+                               if (creature_ptr->muta3 & MUT3_FEARLESS)
                                {
                                        msg_print(_("恐れ知らずでなくなった。", "You no longer feel fearless."));
 
-                                       p_ptr->muta3 &= ~(MUT3_FEARLESS);
+                                       creature_ptr->muta3 &= ~(MUT3_FEARLESS);
                                }
                        }
                        if (muta_which == MUT2_BEAK)
                        {
-                               if (p_ptr->muta2 & MUT2_TRUNK)
+                               if (creature_ptr->muta2 & MUT2_TRUNK)
                                {
                                        msg_print(_("あなたの鼻はもう象の鼻のようではなくなった。", "Your nose is no longer elephantine."));
 
-                                       p_ptr->muta2 &= ~(MUT2_TRUNK);
+                                       creature_ptr->muta2 &= ~(MUT2_TRUNK);
                                }
                        }
                        if (muta_which == MUT2_TRUNK)
                        {
-                               if (p_ptr->muta2 & MUT2_BEAK)
+                               if (creature_ptr->muta2 & MUT2_BEAK)
                                {
                                        msg_print(_("硬いクチバシがなくなった。", "You no longer have a hard beak."));
 
-                                       p_ptr->muta2 &= ~(MUT2_BEAK);
+                                       creature_ptr->muta2 &= ~(MUT2_BEAK);
                                }
                        }
                }
 
-               mutant_regenerate_mod = calc_mutant_regenerate_mod();
-               p_ptr->update |= PU_BONUS;
+               p_ptr->mutant_regenerate_mod = calc_mutant_regenerate_mod();
+               creature_ptr->update |= PU_BONUS;
                handle_stuff();
                return TRUE;
        }
@@ -856,13 +879,13 @@ bool gain_random_mutation(int choose_mut)
  * @param choose_mut 取り除きたい突然変異のID、0ならばランダムに消去
  * @return なし
  */
-bool lose_mutation(int choose_mut)
+bool lose_mutation(MUTATION_IDX choose_mut)
 {
        int attempts_left = 20;
-       cptr muta_desc = "";
+       concptr muta_desc = "";
        bool muta_chosen = FALSE;
-       u32b muta_which = 0;
-       u32b *muta_class = NULL;
+       BIT_FLAGS muta_which = 0;
+       BIT_FLAGS *muta_class = NULL;
 
        if (choose_mut) attempts_left = 1;
 
@@ -1473,21 +1496,21 @@ bool lose_mutation(int choose_mut)
 
                p_ptr->update |= PU_BONUS;
                handle_stuff();
-               mutant_regenerate_mod = calc_mutant_regenerate_mod();
+               p_ptr->mutant_regenerate_mod = calc_mutant_regenerate_mod();
                return TRUE;
        }
 }
 
-void lose_all_mutations(void)
+void lose_all_mutations(player_type *creature_ptr)
 {
-       if (p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3)
+       if (creature_ptr->muta1 || creature_ptr->muta2 || creature_ptr->muta3)
        {
                chg_virtue(V_CHANCE, -5);
                msg_print(_("全ての突然変異が治った。", "You are cured of all mutations."));
-               p_ptr->muta1 = p_ptr->muta2 = p_ptr->muta3 = 0;
-               p_ptr->update |= PU_BONUS;
+               creature_ptr->muta1 = creature_ptr->muta2 = creature_ptr->muta3 = 0;
+               creature_ptr->update |= PU_BONUS;
                handle_stuff();
-               mutant_regenerate_mod = calc_mutant_regenerate_mod();
+               creature_ptr->mutant_regenerate_mod = calc_mutant_regenerate_mod();
        }
 }
 
@@ -1594,7 +1617,7 @@ void dump_mutations(FILE *OutFile)
                }
                if (p_ptr->muta1 & MUT1_MIDAS_TCH)
                {
-                       fprintf(OutFile, _(" あなたは通常アイテムを金に変えることができる。\n", " You can turn ordinary items to gold.\n"));
+                       fprintf(OutFile, _(" あなたは通常アイテムを金に変えることができる。\n", " You can current_world_ptr->game_turn ordinary items to gold.\n"));
 
                }
                if (p_ptr->muta1 & MUT1_GROW_MOLD)
@@ -2000,41 +2023,20 @@ void dump_mutations(FILE *OutFile)
 void do_cmd_knowledge_mutations(void)
 {
        FILE *fff;
-       char file_name[1024];
+       GAME_TEXT file_name[1024];
 
        /* Open a new file */
        fff = my_fopen_temp(file_name, 1024);
 
        /* Dump the mutations to file */
        if (fff) dump_mutations(fff);
-
-       /* Close the file */
        my_fclose(fff);
 
        /* Display the file contents */
        show_file(TRUE, file_name, _("突然変異", "Mutations"), 0, 0);
-
-       /* Remove the file */
        fd_kill(file_name);
 }
 
-/*!
- * @brief 符号なし32ビット整数のビット数を返す。
- * @param x ビット数を調べたい変数
- * @return ビット数
- */
-int count_bits(BIT_FLAGS x)
-{
-       int n = 0;
-
-       if (x) do
-       {
-               n++;
-       }
-       while (0 != (x = x&(x-1)));
-
-       return (n);
-}
 
 /*!
  * @brief 現在プレイヤー得ている突然変異の数を返す。
@@ -2082,133 +2084,72 @@ int calc_mutant_regenerate_mod(void)
        return (regen);
 }
 
-/*!
- * @brief 突然変異レイシャル上で口を使うよりを行った際に歌や呪術を停止する /
- * @return なし
- */
-static void mutation_stop_mouth(void)
-{
-       if (music_singing_any()) stop_singing();
-       if (hex_spelling_any()) stop_hex_spell_all();
-}
-
 
 /*!
  * @brief 突然変異のレイシャル効果実装
- * @return 発動させる突然変異レイシャルのID
+ * @param power 発動させる突然変異レイシャルのID
  * @return レイシャルを実行した場合TRUE、キャンセルした場合FALSEを返す
  */
-bool mutation_power_aux(u32b power)
+bool mutation_power_aux(player_type *creature_ptr, int power)
 {
-       int     dir = 0;
-       int     lvl = p_ptr->lev;
-
+       DIRECTION dir = 0;
+       PLAYER_LEVEL lvl = creature_ptr->lev;
 
        switch (power)
        {
                case MUT1_SPIT_ACID:
                        if (!get_aim_dir(&dir)) return FALSE;
-                       mutation_stop_mouth();
+                       stop_mouth();
                        msg_print(_("酸を吐きかけた...", "You spit acid..."));
-
                        fire_ball(GF_ACID, dir, lvl, 1 + (lvl / 30));
                        break;
 
                case MUT1_BR_FIRE:
                        if (!get_aim_dir(&dir)) return FALSE;
-                       mutation_stop_mouth();
+                       stop_mouth();
                        msg_print(_("あなたは火炎のブレスを吐いた...", "You breathe fire..."));
-
-                       fire_ball(GF_FIRE, dir, lvl * 2, -1 - (lvl / 20));
+                       fire_breath(GF_FIRE, dir, lvl * 2, 1 + (lvl / 20));
                        break;
 
                case MUT1_HYPN_GAZE:
                        if (!get_aim_dir(&dir)) return FALSE;
                        msg_print(_("あなたの目は幻惑的になった...", "Your eyes look mesmerizing..."));
-
                        (void)charm_monster(dir, lvl);
                        break;
 
                case MUT1_TELEKINES:
                        if (!get_aim_dir(&dir)) return FALSE;
                        msg_print(_("集中している...", "You concentrate..."));
-
                        fetch(dir, lvl * 10, TRUE);
                        break;
 
                case MUT1_VTELEPORT:
                        msg_print(_("集中している...", "You concentrate..."));
-
                        teleport_player(10 + 4 * lvl, 0L);
                        break;
 
                case MUT1_MIND_BLST:
                        if (!get_aim_dir(&dir)) return FALSE;
                        msg_print(_("集中している...", "You concentrate..."));
-
                        fire_bolt(GF_PSI, dir, damroll(3 + ((lvl - 1) / 5), 3));
                        break;
 
                case MUT1_RADIATION:
                        msg_print(_("体から放射能が発生した!", "Radiation flows from your body!"));
-
                        fire_ball(GF_NUKE, 0, (lvl * 2), 3 + (lvl / 20));
                        break;
 
                case MUT1_VAMPIRISM:
-                       {
-                               int x, y, dummy;
-                               cave_type *c_ptr;
-
-                               /* Only works on adjacent monsters */
-                               if (!get_rep_dir2(&dir)) return FALSE;
-                               y = p_ptr->y + ddy[dir];
-                               x = p_ptr->x + ddx[dir];
-                               c_ptr = &cave[y][x];
-
-                               mutation_stop_mouth();
-
-                               if (!(c_ptr->m_idx))
-                               {
-                                       msg_print(_("何もない場所に噛みついた!", "You bite into thin air!"));
-
-                                       break;
-                               }
-
-                               msg_print(_("あなたはニヤリとして牙をむいた...", "You grin and bare your fangs..."));
-
-
-                               dummy = lvl * 2;
-
-                               if (drain_life(dir, dummy))
-                               {
-                                       if (p_ptr->food < PY_FOOD_FULL)
-                                               /* No heal if we are "full" */
-                                               (void)hp_player(dummy);
-                                       else
-                                               msg_print(_("あなたは空腹ではありません。", "You were not hungry."));
-
-                                       /* Gain nutritional sustenance: 150/hp drained */
-                                       /* A Food ration gives 5000 food points (by contrast) */
-                                       /* Don't ever get more than "Full" this way */
-                                       /* But if we ARE Gorged,  it won't cure us */
-                                       dummy = p_ptr->food + MIN(5000, 100 * dummy);
-                                       if (p_ptr->food < PY_FOOD_MAX)   /* Not gorged already */
-                                               (void)set_food(dummy >= PY_FOOD_MAX ? PY_FOOD_MAX-1 : dummy);
-                               }
-                               else
-                                       msg_print(_("げぇ!ひどい味だ。", "Yechh. That tastes foul."));
-
-                       }
+                       vampirism();
                        break;
 
                case MUT1_SMELL_MET:
-                       mutation_stop_mouth();
+                       stop_mouth();
                        (void)detect_treasure(DETECT_RAD_DEFAULT);
                        break;
 
                case MUT1_SMELL_MON:
-                       mutation_stop_mouth();
+                       stop_mouth();
                        (void)detect_monsters_normal(DETECT_RAD_DEFAULT);
                        break;
 
@@ -2217,68 +2158,7 @@ bool mutation_power_aux(u32b power)
                        break;
 
                case MUT1_EAT_ROCK:
-                       {
-                               int x, y;
-                               cave_type *c_ptr;
-                               feature_type *f_ptr, *mimic_f_ptr;
-
-                               if (!get_rep_dir2(&dir)) return FALSE;
-                               y = p_ptr->y + ddy[dir];
-                               x = p_ptr->x + ddx[dir];
-                               c_ptr = &cave[y][x];
-                               f_ptr = &f_info[c_ptr->feat];
-                               mimic_f_ptr = &f_info[get_feat_mimic(c_ptr)];
-
-                               mutation_stop_mouth();
-
-                               if (!have_flag(mimic_f_ptr->flags, FF_HURT_ROCK))
-                               {
-                                       msg_print(_("この地形は食べられない。", "You cannot eat this feature."));
-                                       break;
-                               }
-                               else if (have_flag(f_ptr->flags, FF_PERMANENT))
-                               {
-                                       msg_format(_("いてっ!この%sはあなたの歯より硬い!", "Ouch!  This %s is harder than your teeth!"), f_name + mimic_f_ptr->name);
-                                       break;
-                               }
-                               else if (c_ptr->m_idx)
-                               {
-                                       monster_type *m_ptr = &m_list[c_ptr->m_idx];
-                                       msg_print(_("何かが邪魔しています!", "There's something in the way!"));
-
-                                       if (!m_ptr->ml || !is_pet(m_ptr)) py_attack(y, x, 0);
-                                       break;
-                               }
-                               else if (have_flag(f_ptr->flags, FF_TREE))
-                               {
-                                       msg_print(_("木の味は好きじゃない!", "You don't like the woody taste!"));
-                                       break;
-                               }
-                               else if (have_flag(f_ptr->flags, FF_GLASS))
-                               {
-                                       msg_print(_("ガラスの味は好きじゃない!", "You don't like the glassy taste!"));
-                                       break;
-                               }
-                               else if (have_flag(f_ptr->flags, FF_DOOR) || have_flag(f_ptr->flags, FF_CAN_DIG))
-                               {
-                                       (void)set_food(p_ptr->food + 3000);
-                               }
-                               else if (have_flag(f_ptr->flags, FF_MAY_HAVE_GOLD) || have_flag(f_ptr->flags, FF_HAS_GOLD))
-                               {
-                                       (void)set_food(p_ptr->food + 5000);
-                               }
-                               else
-                               {
-                                       msg_format(_("この%sはとてもおいしい!", "This %s is very filling!"), f_name + mimic_f_ptr->name);
-                                       (void)set_food(p_ptr->food + 10000);
-                               }
-
-                               /* Destroy the wall */
-                               cave_alter_feat(y, x, FF_HURT_ROCK);
-
-                               /* Move the player */
-                               (void)move_player_effect(y, x, MPE_DONT_PICKUP);
-                       }
+                       return eat_lock();
                        break;
 
                case MUT1_SWAP_POS:
@@ -2293,7 +2173,7 @@ bool mutation_power_aux(u32b power)
                        break;
 
                case MUT1_SHRIEK:
-                       mutation_stop_mouth();
+                       stop_mouth();
                        (void)fire_ball(GF_SOUND, 0, 2 * lvl, 8);
                        (void)aggravate_monsters(0);
                        break;
@@ -2308,7 +2188,7 @@ bool mutation_power_aux(u32b power)
 
                                for (i = 0; i < INVEN_TOTAL; i++)
                                {
-                                       object_type *o_ptr = &inventory[i];
+                                       object_type *o_ptr = &creature_ptr->inventory_list[i];
 
                                        if (!o_ptr->k_idx) continue;
                                        if (!object_is_cursed(o_ptr)) continue;
@@ -2319,14 +2199,12 @@ bool mutation_power_aux(u32b power)
                        break;
 
                case MUT1_BERSERK:
-                       (void)set_shero(randint1(25) + 25, FALSE);
-                       (void)hp_player(30);
-                       (void)set_afraid(0);
+                       (void)berserk(randint1(25) + 25);
                        break;
 
                case MUT1_POLYMORPH:
                        if (!get_check(_("変身します。よろしいですか?", "You will polymorph your self. Are you sure? "))) return FALSE;
-                       do_poly_self();
+                       do_poly_self(creature_ptr);
                        break;
 
                case MUT1_MIDAS_TCH:
@@ -2336,10 +2214,10 @@ bool mutation_power_aux(u32b power)
                /* Summon pet molds around the player */
                case MUT1_GROW_MOLD:
                        {
-                               int i;
+                               DIRECTION i;
                                for (i = 0; i < 8; i++)
                                {
-                                       summon_specific(-1, p_ptr->y, p_ptr->x, lvl, SUMMON_MOLD, PM_FORCE_PET);
+                                       summon_specific(-1, creature_ptr->y, creature_ptr->x, lvl, SUMMON_MOLD, PM_FORCE_PET);
                                }
                        }
                        break;
@@ -2351,38 +2229,38 @@ bool mutation_power_aux(u32b power)
 
                                if (randint0(5) < num)
                                {
-                                       (void)set_oppose_acid(dur, FALSE);
+                                       (void)set_oppose_acid(creature_ptr, dur, FALSE);
                                        num--;
                                }
                                if (randint0(4) < num)
                                {
-                                       (void)set_oppose_elec(dur, FALSE);
+                                       (void)set_oppose_elec(creature_ptr, dur, FALSE);
                                        num--;
                                }
                                if (randint0(3) < num)
                                {
-                                       (void)set_oppose_fire(dur, FALSE);
+                                       (void)set_oppose_fire(creature_ptr, dur, FALSE);
                                        num--;
                                }
                                if (randint0(2) < num)
                                {
-                                       (void)set_oppose_cold(dur, FALSE);
+                                       (void)set_oppose_cold(creature_ptr, dur, FALSE);
                                        num--;
                                }
                                if (num)
                                {
-                                       (void)set_oppose_pois(dur, FALSE);
+                                       (void)set_oppose_pois(creature_ptr, dur, FALSE);
                                        num--;
                                }
                        }
                        break;
 
                case MUT1_EARTHQUAKE:
-                       (void)earthquake(p_ptr->y, p_ptr->x, 10);
+                       (void)earthquake(creature_ptr->y, creature_ptr->x, 10, 0);
                        break;
 
                case MUT1_EAT_MAGIC:
-                       if (!eat_magic(p_ptr->lev * 2)) return FALSE;
+                       if (!eat_magic(creature_ptr->lev * 2)) return FALSE;
                        break;
 
                case MUT1_WEIGH_MAG:
@@ -2390,39 +2268,13 @@ bool mutation_power_aux(u32b power)
                        break;
 
                case MUT1_STERILITY:
-                       /* Fake a population explosion. */
-#ifdef JP
-                       msg_print("突然頭が痛くなった!");
-                       take_hit(DAMAGE_LOSELIFE, randint1(17) + 17, "禁欲を強いた疲労", -1);
-#else
-                       msg_print("You suddenly have a headache!");
-                       take_hit(DAMAGE_LOSELIFE, randint1(17) + 17, "the strain of forcing abstinence", -1);
-#endif
-
-                       num_repro += MAX_REPRO;
+                       msg_print(_("突然頭が痛くなった!", "You suddenly have a headache!"));
+                       take_hit(DAMAGE_LOSELIFE, randint1(17) + 17, _("禁欲を強いた疲労", "the strain of forcing abstinence"), -1);
+                       current_floor_ptr->num_repro += MAX_REPRO;
                        break;
 
                case MUT1_PANIC_HIT:
-                       {
-                               int x, y;
-
-                               if (!get_rep_dir2(&dir)) return FALSE;
-                               y = p_ptr->y + ddy[dir];
-                               x = p_ptr->x + ddx[dir];
-                               if (cave[y][x].m_idx)
-                               {
-                                       py_attack(y, x, 0);
-                                       if (randint0(p_ptr->skill_dis) < 7)
-                                               msg_print(_("うまく逃げられなかった。", "You failed to teleport."));
-                                       else teleport_player(30, 0L);
-                               }
-                               else
-                               {
-                                       msg_print(_("その方向にはモンスターはいません。", "You don't see any monster in this direction"));
-
-                                       msg_print(NULL);
-                               }
-                       }
+                       if(!panic_hit()) return FALSE;
                        break;
 
                case MUT1_DAZZLE:
@@ -2437,55 +2289,51 @@ bool mutation_power_aux(u32b power)
                        break;
 
                case MUT1_RECALL:
-                       if (!word_of_recall()) return FALSE;
+                       if (!recall_player(creature_ptr, randint0(21) + 15)) return FALSE;
                        break;
 
                case MUT1_BANISH:
                        {
-                               int x, y;
-                               cave_type *c_ptr;
+                               POSITION x, y;
+                               grid_type *g_ptr;
                                monster_type *m_ptr;
                                monster_race *r_ptr;
+                               if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
+                               y = creature_ptr->y + ddy[dir];
+                               x = creature_ptr->x + ddx[dir];
+                               g_ptr = &current_floor_ptr->grid_array[y][x];
 
-                               if (!get_rep_dir2(&dir)) return FALSE;
-                               y = p_ptr->y + ddy[dir];
-                               x = p_ptr->x + ddx[dir];
-                               c_ptr = &cave[y][x];
-
-                               if (!c_ptr->m_idx)
+                               if (!g_ptr->m_idx)
                                {
                                        msg_print(_("邪悪な存在を感じとれません!", "You sense no evil there!"));
 
                                        break;
                                }
 
-                               m_ptr = &m_list[c_ptr->m_idx];
+                               m_ptr = &current_floor_ptr->m_list[g_ptr->m_idx];
                                r_ptr = &r_info[m_ptr->r_idx];
 
                                if ((r_ptr->flags3 & RF3_EVIL) &&
                                    !(r_ptr->flags1 & RF1_QUESTOR) &&
                                    !(r_ptr->flags1 & RF1_UNIQUE) &&
-                                   !p_ptr->inside_arena && !p_ptr->inside_quest &&
-                                       (r_ptr->level < randint1(p_ptr->lev+50)) &&
+                                   !creature_ptr->inside_arena && !creature_ptr->inside_quest &&
+                                       (r_ptr->level < randint1(creature_ptr->lev+50)) &&
                                        !(m_ptr->mflag2 & MFLAG2_NOGENO))
                                {
                                        if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
                                        {
-                                               char m_name[80];
-
+                                               GAME_TEXT m_name[MAX_NLEN];
                                                monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
                                                do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_GENOCIDE, m_name);
                                        }
-
                                        /* Delete the monster, rather than killing it. */
-                                       delete_monster_idx(c_ptr->m_idx);
+                                       delete_monster_idx(g_ptr->m_idx);
                                        msg_print(_("その邪悪なモンスターは硫黄臭い煙とともに消え去った!", "The evil creature vanishes in a puff of sulfurous smoke!"));
 
                                }
                                else
                                {
                                        msg_print(_("祈りは効果がなかった!", "Your invocation is ineffectual!"));
-
                                        if (one_in_(13)) m_ptr->mflag2 |= MFLAG2_NOGENO;
                                }
                        }
@@ -2493,15 +2341,13 @@ bool mutation_power_aux(u32b power)
 
                case MUT1_COLD_TOUCH:
                        {
-                               int x, y;
-                               cave_type *c_ptr;
-
-                               if (!get_rep_dir2(&dir)) return FALSE;
-                               y = p_ptr->y + ddy[dir];
-                               x = p_ptr->x + ddx[dir];
-                               c_ptr = &cave[y][x];
-
-                               if (!c_ptr->m_idx)
+                               POSITION x, y;
+                               grid_type *g_ptr;
+                               if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
+                               y = creature_ptr->y + ddy[dir];
+                               x = creature_ptr->x + ddx[dir];
+                               g_ptr = &current_floor_ptr->grid_array[y][x];
+                               if (!g_ptr->m_idx)
                                {
                                        msg_print(_("あなたは何もない場所で手を振った。", "You wave your hands in the air."));
 
@@ -2511,16 +2357,32 @@ bool mutation_power_aux(u32b power)
                        }
                        break;
 
-               /* XXX_XXX_XXX Hack!  MUT1_LAUNCHER is negative, see above */
+               /* XXX_XXX_XXX Hack! MUT1_LAUNCHER is negative, see above */
                case 3: /* MUT1_LAUNCHER */
                        /* Gives a multiplier of 2 at first, up to 3 at 40th */
-                       if (!do_cmd_throw_aux(2 + lvl / 40, FALSE, -1)) return FALSE;
+                       if (!do_cmd_throw(2 + lvl / 40, FALSE, -1)) return FALSE;
                        break;
 
                default:
-                       p_ptr->energy_use = 0;
+                       free_turn(creature_ptr);
                        msg_format(_("能力 %s は実装されていません。", "Power %s not implemented. Oops."), power);
        }
 
        return TRUE;
 }
+
+void become_living_trump(player_type *creature_ptr)
+{
+       MUTATION_IDX mutation;
+
+       if (one_in_(7))
+               mutation = 12; /* Teleport control */
+       else
+               mutation = 77; /* Random teleportation (uncontrolled) */
+
+       /* Gain the mutation */
+       if (gain_mutation(creature_ptr, mutation))
+       {
+               msg_print(_("あなたは生きているカードに変わった。", "You have turned into a Living Trump."));
+       }
+}