3 * @brief 突然変異ルールの実装 / Mutation effects (and racial powers)
6 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke\n
8 * This software may be copied and distributed for educational, research,\n
9 * and not for profit purposes provided that this copyright and statement\n
10 * are included in all such copies. Other copyrights may also apply.\n
11 * 2014 Deskull rearranged comment for Doxygen.\n
14 #include "mutation/mutation.h"
15 #include "cmd-io/cmd-dump.h"
16 #include "cmd-item/cmd-throw.h"
17 #include "core/asking-player.h"
18 #include "core/player-update-types.h"
19 #include "core/show-file.h"
20 #include "core/stuff-handler.h"
21 #include "effect/spells-effect-util.h"
22 #include "game-option/play-record-options.h"
23 #include "grid/grid.h"
24 #include "inventory/inventory-slot-types.h"
25 #include "io/write-diary.h"
26 #include "mind/mind-mage.h"
27 #include "mind/mind-warrior.h"
28 #include "monster-floor/monster-remover.h"
29 #include "monster-floor/monster-summon.h"
30 #include "monster-floor/place-monster-types.h"
31 #include "monster-race/monster-race.h"
32 #include "monster-race/race-flags1.h"
33 #include "monster-race/race-flags3.h"
34 #include "monster/monster-describer.h"
35 #include "monster/monster-description-types.h"
36 #include "monster/monster-flag-types.h"
37 #include "monster/monster-info.h"
38 #include "monster/smart-learn-types.h"
39 #include "mutation/gain-mutation-switcher.h"
40 #include "mutation/gain-mutation-util.h"
41 #include "mutation/mutation-flag-types.h"
42 #include "mutation/mutation-investor.h" // todo 相互依存している、このファイルからの依存はOK.
43 #include "mutation/mutation-techniques.h"
44 #include "object-enchant/item-feeling.h"
45 #include "object-hook/hook-checker.h"
46 #include "player/avatar.h"
47 #include "player/player-class.h"
48 #include "player/player-damage.h"
49 #include "player/player-personalities-types.h"
50 #include "player/player-race-types.h"
51 #include "player/selfinfo.h"
52 #include "racial/racial-vampire.h"
53 #include "spell-kind/earthquake.h"
54 #include "spell-kind/spells-charm.h"
55 #include "spell-kind/spells-detection.h"
56 #include "spell-kind/spells-fetcher.h"
57 #include "spell-kind/spells-launcher.h"
58 #include "spell-kind/spells-lite.h"
59 #include "spell-kind/spells-sight.h"
60 #include "spell-kind/spells-teleport.h"
61 #include "spell-kind/spells-world.h"
62 #include "spell-realm/spells-sorcery.h"
63 #include "spell/spell-types.h"
64 #include "spell/spells-status.h"
65 #include "spell/spells-summon.h"
66 #include "status/element-resistance.h"
67 #include "status/shape-changer.h"
68 #include "system/floor-type-definition.h"
69 #include "system/object-type-definition.h"
70 #include "target/target-getter.h"
71 #include "view/display-messages.h"
74 * @brief プレイヤーから突然変異を取り除く
75 * @param choose_mut 取り除きたい突然変異のID、0ならばランダムに消去
78 bool lose_mutation(player_type *creature_ptr, MUTATION_IDX choose_mut)
80 int attempts_left = 20;
81 concptr muta_desc = "";
82 bool muta_chosen = FALSE;
83 int muta_which = 0; // mutation_flag_type_1 とmutation_flag_type_2 の両対応とするため、敢えてint型で定義する
84 BIT_FLAGS *muta_class = NULL;
88 while (attempts_left--) {
89 switch (choose_mut ? choose_mut : randint1(193)) {
94 muta_class = &(creature_ptr->muta1);
95 muta_which = MUT1_SPIT_ACID;
96 muta_desc = _("酸を吹きかける能力を失った。", "You lose the ability to spit acid.");
101 muta_class = &(creature_ptr->muta1);
102 muta_which = MUT1_BR_FIRE;
103 muta_desc = _("炎のブレスを吐く能力を失った。", "You lose the ability to breathe fire.");
107 muta_class = &(creature_ptr->muta1);
108 muta_which = MUT1_HYPN_GAZE;
109 muta_desc = _("あなたの目はつまらない目になった。", "Your eyes look uninteresting.");
113 muta_class = &(creature_ptr->muta1);
114 muta_which = MUT1_TELEKINES;
115 muta_desc = _("念動力で物を動かす能力を失った。", "You lose the ability to move objects telekinetically.");
120 muta_class = &(creature_ptr->muta1);
121 muta_which = MUT1_VTELEPORT;
122 muta_desc = _("自分の意思でテレポートする能力を失った。", "You lose the power of teleportation at will.");
126 muta_class = &(creature_ptr->muta1);
127 muta_which = MUT1_MIND_BLST;
128 muta_desc = _("精神攻撃の能力を失った。", "You lose the power of Mind Blast.");
132 muta_class = &(creature_ptr->muta1);
133 muta_which = MUT1_RADIATION;
134 muta_desc = _("あなたは放射能を発生しなくなった。", "You stop emitting hard radiation.");
138 muta_class = &(creature_ptr->muta1);
139 muta_which = MUT1_VAMPIRISM;
140 muta_desc = _("吸血の能力を失った。", "You are no longer vampiric.");
145 muta_class = &(creature_ptr->muta1);
146 muta_which = MUT1_SMELL_MET;
147 muta_desc = _("金属の臭いを嗅げなくなった。", "You no longer smell a metallic odor.");
153 muta_class = &(creature_ptr->muta1);
154 muta_which = MUT1_SMELL_MON;
155 muta_desc = _("不潔なモンスターの臭いを嗅げなくなった。", "You no longer smell filthy monsters.");
160 muta_class = &(creature_ptr->muta1);
161 muta_which = MUT1_BLINK;
162 muta_desc = _("近距離テレポートの能力を失った。", "You lose the power of minor teleportation.");
166 muta_class = &(creature_ptr->muta1);
167 muta_which = MUT1_EAT_ROCK;
168 muta_desc = _("壁は美味しそうに見えなくなった。", "The walls look unappetizing.");
172 muta_class = &(creature_ptr->muta1);
173 muta_which = MUT1_SWAP_POS;
174 muta_desc = _("あなたは自分の靴に留まる感じがする。", "You feel like staying in your own shoes.");
179 muta_class = &(creature_ptr->muta1);
180 muta_which = MUT1_SHRIEK;
181 muta_desc = _("あなたの声質は弱くなった。", "Your vocal cords get much weaker.");
186 muta_class = &(creature_ptr->muta1);
187 muta_which = MUT1_ILLUMINE;
188 muta_desc = _("部屋を明るく照らすことが出来なくなった。", "You can no longer light up rooms with your presence.");
192 muta_class = &(creature_ptr->muta1);
193 muta_which = MUT1_DET_CURSE;
194 muta_desc = _("邪悪な魔法を感じられなくなった。", "You can no longer feel evil magics.");
199 muta_class = &(creature_ptr->muta1);
200 muta_which = MUT1_BERSERK;
201 muta_desc = _("制御できる激情を感じなくなった。", "You no longer feel a controlled rage.");
204 muta_class = &(creature_ptr->muta1);
205 muta_which = MUT1_POLYMORPH;
206 muta_desc = _("あなたの体は安定したように見える。", "Your body seems stable.");
210 muta_class = &(creature_ptr->muta1);
211 muta_which = MUT1_MIDAS_TCH;
212 muta_desc = _("ミダスの手の能力を失った。", "You lose the Midas touch.");
215 muta_class = &(creature_ptr->muta1);
216 muta_which = MUT1_GROW_MOLD;
217 muta_desc = _("突然カビが嫌いになった。", "You feel a sudden dislike for mold.");
222 muta_class = &(creature_ptr->muta1);
223 muta_which = MUT1_RESIST;
224 muta_desc = _("傷つき易くなった気がする。", "You feel like you might be vulnerable.");
229 muta_class = &(creature_ptr->muta1);
230 muta_which = MUT1_EARTHQUAKE;
231 muta_desc = _("ダンジョンを壊す能力を失った。", "You lose the ability to wreck the dungeon.");
234 muta_class = &(creature_ptr->muta1);
235 muta_which = MUT1_EAT_MAGIC;
236 muta_desc = _("魔法のアイテムはもう美味しそうに見えなくなった。", "Your magic items no longer look delicious.");
240 muta_class = &(creature_ptr->muta1);
241 muta_which = MUT1_WEIGH_MAG;
242 muta_desc = _("魔力を感じられなくなった。", "You no longer sense magic.");
245 muta_class = &(creature_ptr->muta1);
246 muta_which = MUT1_STERILITY;
247 muta_desc = _("たくさんの安堵の吐息が聞こえた。", "You hear a massed sigh of relief.");
251 muta_class = &(creature_ptr->muta1);
252 muta_which = MUT1_HIT_AND_AWAY;
253 muta_desc = _("あちこちへ跳べる気分がなくなった。", "You no longer feel jumpy.");
258 muta_class = &(creature_ptr->muta1);
259 muta_which = MUT1_DAZZLE;
260 muta_desc = _("まばゆい閃光を発する能力を失った。", "You lose the ability to emit dazzling lights.");
265 muta_class = &(creature_ptr->muta1);
266 muta_which = MUT1_LASER_EYE;
267 muta_desc = _("眼が少しの間焼き付いて、痛みが和らいだ。", "Your eyes burn for a moment, then feel soothed.");
271 muta_class = &(creature_ptr->muta1);
272 muta_which = MUT1_RECALL;
273 muta_desc = _("少しの間ホームシックになった。", "You feel briefly homesick.");
276 muta_class = &(creature_ptr->muta1);
277 muta_which = MUT1_BANISH;
278 muta_desc = _("神聖な怒りの力を感じなくなった。", "You no longer feel a holy wrath.");
282 muta_class = &(creature_ptr->muta1);
283 muta_which = MUT1_COLD_TOUCH;
284 muta_desc = _("手が暖かくなった。", "Your hands warm up.");
288 muta_class = &(creature_ptr->muta1);
289 muta_which = MUT1_LAUNCHER;
290 muta_desc = _("物を投げる手が弱くなった気がする。", "Your throwing arm feels much weaker.");
293 muta_class = &(creature_ptr->muta2);
294 muta_which = MUT2_BERS_RAGE;
295 muta_desc = _("凶暴化の発作にさらされなくなった!", "You are no longer subject to fits of berserk rage!");
298 muta_class = &(creature_ptr->muta2);
299 muta_which = MUT2_COWARDICE;
300 muta_desc = _("もう信じがたいほど臆病ではなくなった!", "You are no longer an incredible coward!");
303 muta_class = &(creature_ptr->muta2);
304 muta_which = MUT2_RTELEPORT;
305 muta_desc = _("あなたの位置はより確定的になった。", "Your position seems more certain.");
308 muta_class = &(creature_ptr->muta2);
309 muta_which = MUT2_ALCOHOL;
310 muta_desc = _("あなたはアルコールを分泌しなくなった!", "Your body stops producing alcohol!");
313 muta_class = &(creature_ptr->muta2);
314 muta_which = MUT2_HALLU;
315 muta_desc = _("幻覚をひき起こす精神障害を起こさなくなった!", "You are no longer afflicted by a hallucinatory insanity!");
318 muta_class = &(creature_ptr->muta2);
319 muta_which = MUT2_FLATULENT;
320 muta_desc = _("もう強烈な屁はこかなくなった。", "You are no longer subject to uncontrollable flatulence.");
324 muta_class = &(creature_ptr->muta2);
325 muta_which = MUT2_SCOR_TAIL;
326 muta_desc = _("サソリの尻尾がなくなった!", "You lose your scorpion tail!");
330 muta_class = &(creature_ptr->muta2);
331 muta_which = MUT2_HORNS;
332 muta_desc = _("額から角が消えた!", "Your horns vanish from your forehead!");
336 muta_class = &(creature_ptr->muta2);
337 muta_which = MUT2_BEAK;
338 muta_desc = _("口が普通に戻った!", "Your mouth reverts to normal!");
342 muta_class = &(creature_ptr->muta2);
343 muta_which = MUT2_ATT_DEMON;
344 muta_desc = _("デーモンを引き寄せなくなった。", "You stop attracting demons.");
347 muta_class = &(creature_ptr->muta2);
348 muta_which = MUT2_PROD_MANA;
349 muta_desc = _("制御不能な魔法のエネルギーを発生しなくなった。", "You stop producing magical energy uncontrollably.");
353 muta_class = &(creature_ptr->muta2);
354 muta_which = MUT2_SPEED_FLUX;
355 muta_desc = _("躁鬱質でなくなった。", "You are no longer manic-depressive.");
359 muta_class = &(creature_ptr->muta2);
360 muta_which = MUT2_BANISH_ALL;
361 muta_desc = _("背後に恐ろしい力を感じなくなった。", "You no longer feel a terrifying power lurking behind you.");
364 muta_class = &(creature_ptr->muta2);
365 muta_which = MUT2_EAT_LIGHT;
366 muta_desc = _("世界が明るいと感じる。", "You feel the world's a brighter place.");
370 muta_class = &(creature_ptr->muta2);
371 muta_which = MUT2_TRUNK;
372 muta_desc = _("鼻が普通の長さに戻った。", "Your nose returns to a normal length.");
375 muta_class = &(creature_ptr->muta2);
376 muta_which = MUT2_ATT_ANIMAL;
377 muta_desc = _("動物を引き寄せなくなった。", "You stop attracting animals.");
380 muta_class = &(creature_ptr->muta2);
381 muta_which = MUT2_TENTACLES;
382 muta_desc = _("触手が消えた。", "Your tentacles vanish from your sides.");
385 muta_class = &(creature_ptr->muta2);
386 muta_which = MUT2_RAW_CHAOS;
387 muta_desc = _("周囲の空間が安定した気がする。", "You feel the universe is more stable around you.");
392 muta_class = &(creature_ptr->muta2);
393 muta_which = MUT2_NORMALITY;
394 muta_desc = _("普通に奇妙な感じがする。", "You feel normally strange.");
397 muta_class = &(creature_ptr->muta2);
398 muta_which = MUT2_WRAITH;
399 muta_desc = _("あなたは物質世界にしっかり存在している。", "You are firmly in the physical world.");
402 muta_class = &(creature_ptr->muta2);
403 muta_which = MUT2_POLY_WOUND;
404 muta_desc = _("古い傷からカオスの力が去っていった。", "You feel forces of chaos departing your old scars.");
407 muta_class = &(creature_ptr->muta2);
408 muta_which = MUT2_WASTING;
409 muta_desc = _("おぞましい衰弱病が治った!", "You are cured of the horrible wasting disease!");
412 muta_class = &(creature_ptr->muta2);
413 muta_which = MUT2_ATT_DRAGON;
414 muta_desc = _("ドラゴンを引き寄せなくなった。", "You stop attracting dragons.");
418 muta_class = &(creature_ptr->muta2);
419 muta_which = MUT2_WEIRD_MIND;
420 muta_desc = _("思考が退屈な方向に戻った。", "Your thoughts return to boring paths.");
423 muta_class = &(creature_ptr->muta2);
424 muta_which = MUT2_NAUSEA;
425 muta_desc = _("胃が痙攣しなくなった。", "Your stomach stops roiling.");
429 muta_class = &(creature_ptr->muta2);
430 muta_which = MUT2_CHAOS_GIFT;
431 muta_desc = _("混沌の神々の興味を惹かなくなった。", "You lose the attention of the chaos deities.");
434 muta_class = &(creature_ptr->muta2);
435 muta_which = MUT2_WALK_SHAD;
436 muta_desc = _("物質世界に捕らわれている気がする。", "You feel like you're trapped in reality.");
440 muta_class = &(creature_ptr->muta2);
441 muta_which = MUT2_WARNING;
442 muta_desc = _("パラノイアでなくなった。", "You no longer feel paranoid.");
445 muta_class = &(creature_ptr->muta2);
446 muta_which = MUT2_INVULN;
447 muta_desc = _("無敵状態の発作を起こさなくなった。", "You are no longer blessed with fits of invulnerability.");
451 muta_class = &(creature_ptr->muta2);
452 muta_which = MUT2_SP_TO_HP;
453 muta_desc = _("魔法の治癒の発作に襲われなくなった。", "You are no longer subject to fits of magical healing.");
456 muta_class = &(creature_ptr->muta2);
457 muta_which = MUT2_HP_TO_SP;
458 muta_desc = _("痛みを伴う精神明瞭化の発作に襲われなくなった。", "You are no longer subject to fits of painful clarity.");
461 muta_class = &(creature_ptr->muta2);
462 muta_which = MUT2_DISARM;
463 muta_desc = _("脚が元の大きさに戻った。", "Your feet shrink to their former size.");
468 muta_class = &(creature_ptr->muta3);
469 muta_which = MUT3_HYPER_STR;
470 muta_desc = _("筋肉が普通に戻った。", "Your muscles revert to normal.");
475 muta_class = &(creature_ptr->muta3);
476 muta_which = MUT3_PUNY;
477 muta_desc = _("筋肉が普通に戻った。", "Your muscles revert to normal.");
482 muta_class = &(creature_ptr->muta3);
483 muta_which = MUT3_HYPER_INT;
484 muta_desc = _("脳が普通に戻った。", "Your brain reverts to normal.");
489 muta_class = &(creature_ptr->muta3);
490 muta_which = MUT3_MORONIC;
491 muta_desc = _("脳が普通に戻った。", "Your brain reverts to normal.");
495 muta_class = &(creature_ptr->muta3);
496 muta_which = MUT3_RESILIENT;
497 muta_desc = _("普通の丈夫さに戻った。", "You become ordinarily resilient again.");
501 muta_class = &(creature_ptr->muta3);
502 muta_which = MUT3_XTRA_FAT;
503 muta_desc = _("奇跡的なダイエットに成功した!", "You benefit from a miracle diet!");
507 muta_class = &(creature_ptr->muta3);
508 muta_which = MUT3_ALBINO;
509 muta_desc = _("アルビノでなくなった!", "You are no longer an albino!");
514 muta_class = &(creature_ptr->muta3);
515 muta_which = MUT3_FLESH_ROT;
516 muta_desc = _("肉体を腐敗させる病気が治った!", "Your flesh is no longer afflicted by a rotting disease!");
520 muta_class = &(creature_ptr->muta3);
521 muta_which = MUT3_SILLY_VOI;
522 muta_desc = _("声質が普通に戻った。", "Your voice returns to normal.");
526 muta_class = &(creature_ptr->muta3);
527 muta_which = MUT3_BLANK_FAC;
528 muta_desc = _("顔に目鼻が戻った。", "Your facial features return.");
531 muta_class = &(creature_ptr->muta3);
532 muta_which = MUT3_ILL_NORM;
533 muta_desc = _("心が安らぐ幻影を映し出さなくなった。", "You stop projecting a reassuring image.");
538 muta_class = &(creature_ptr->muta3);
539 muta_which = MUT3_XTRA_EYES;
540 muta_desc = _("余分な目が消えてしまった!", "Your extra eyes vanish!");
544 muta_class = &(creature_ptr->muta3);
545 muta_which = MUT3_MAGIC_RES;
546 muta_desc = _("魔法に弱くなった。", "You become susceptible to magic again.");
551 muta_class = &(creature_ptr->muta3);
552 muta_which = MUT3_XTRA_NOIS;
553 muta_desc = _("奇妙な音を立てなくなった!", "You stop making strange noise!");
558 muta_class = &(creature_ptr->muta3);
559 muta_which = MUT3_INFRAVIS;
560 muta_desc = _("赤外線視力が落ちた。", "Your infravision is degraded.");
564 muta_class = &(creature_ptr->muta3);
565 muta_which = MUT3_XTRA_LEGS;
566 muta_desc = _("余分な脚が消えてしまった!", "Your extra legs disappear!");
570 muta_class = &(creature_ptr->muta3);
571 muta_which = MUT3_SHORT_LEG;
572 muta_desc = _("脚の長さが普通に戻った。", "Your legs lengthen to normal.");
576 muta_class = &(creature_ptr->muta3);
577 muta_which = MUT3_ELEC_TOUC;
578 muta_desc = _("体を電流が流れなくなった。", "Electricity stops running through you.");
582 muta_class = &(creature_ptr->muta3);
583 muta_which = MUT3_FIRE_BODY;
584 muta_desc = _("体が炎に包まれなくなった。", "Your body is no longer enveloped in flames.");
589 muta_class = &(creature_ptr->muta3);
590 muta_which = MUT3_WART_SKIN;
591 muta_desc = _("イボイボが消えた!", "Your warts disappear!");
596 muta_class = &(creature_ptr->muta3);
597 muta_which = MUT3_SCALES;
598 muta_desc = _("鱗が消えた!", "Your scales vanish!");
602 muta_class = &(creature_ptr->muta3);
603 muta_which = MUT3_IRON_SKIN;
604 muta_desc = _("肌が肉にもどった!", "Your skin reverts to flesh!");
608 muta_class = &(creature_ptr->muta3);
609 muta_which = MUT3_WINGS;
610 muta_desc = _("背中の羽根が取れ落ちた。", "Your wings fall off.");
615 muta_class = &(creature_ptr->muta3);
616 muta_which = MUT3_FEARLESS;
617 muta_desc = _("再び恐怖を感じるようになった。", "You begin to feel fear again.");
621 muta_class = &(creature_ptr->muta3);
622 muta_which = MUT3_REGEN;
623 muta_desc = _("急速回復しなくなった。", "You stop regenerating.");
627 muta_class = &(creature_ptr->muta3);
628 muta_which = MUT3_ESP;
629 muta_desc = _("テレパシーの能力を失った!", "You lose your telepathic ability!");
634 muta_class = &(creature_ptr->muta3);
635 muta_which = MUT3_LIMBER;
636 muta_desc = _("筋肉が硬くなった。", "Your muscles stiffen.");
641 muta_class = &(creature_ptr->muta3);
642 muta_which = MUT3_ARTHRITIS;
643 muta_desc = _("関節が痛くなくなった。", "Your joints stop hurting.");
646 muta_class = &(creature_ptr->muta3);
647 muta_which = MUT3_BAD_LUCK;
648 muta_desc = _("黒いオーラは渦巻いて消えた。", "Your black aura swirls and fades.");
651 muta_class = &(creature_ptr->muta3);
652 muta_which = MUT3_VULN_ELEM;
653 muta_desc = _("無防備な感じはなくなった。", "You feel less exposed.");
658 muta_class = &(creature_ptr->muta3);
659 muta_which = MUT3_MOTION;
660 muta_desc = _("動作の正確さがなくなった。", "You move with less assurance.");
663 if (creature_ptr->pseikaku == PERSONALITY_LUCKY)
665 muta_class = &(creature_ptr->muta3);
666 muta_which = MUT3_GOOD_LUCK;
667 muta_desc = _("白いオーラは輝いて消えた。", "Your white aura shimmers and fades.");
675 if (muta_class && muta_which) {
676 if (*(muta_class)&muta_which) {
681 if (muta_chosen == TRUE)
688 msg_print(muta_desc);
689 *muta_class &= ~(muta_which);
690 creature_ptr->update |= PU_BONUS;
691 handle_stuff(creature_ptr);
692 creature_ptr->mutant_regenerate_mod = calc_mutant_regenerate_mod(creature_ptr);
696 void lose_all_mutations(player_type *creature_ptr)
698 if (creature_ptr->muta1 || creature_ptr->muta2 || creature_ptr->muta3) {
699 chg_virtue(creature_ptr, V_CHANCE, -5);
700 msg_print(_("全ての突然変異が治った。", "You are cured of all mutations."));
701 creature_ptr->muta1 = creature_ptr->muta2 = creature_ptr->muta3 = 0;
702 creature_ptr->update |= PU_BONUS;
703 handle_stuff(creature_ptr);
704 creature_ptr->mutant_regenerate_mod = calc_mutant_regenerate_mod(creature_ptr);
709 * @brief 現在プレイヤー得ている突然変異の数を返す。
710 * @return 現在得ている突然変異の数
712 static int count_mutations(player_type *creature_ptr)
714 return count_bits(creature_ptr->muta1) + count_bits(creature_ptr->muta2) + count_bits(creature_ptr->muta3);
718 * @brief 突然変異による自然回復ペナルティをパーセント値で返す /
719 * Return the modifier to the regeneration rate (in percent)
722 * Beastman get 10 "free" mutations and only 5% decrease per additional mutation.
723 * Max 90% decrease in regeneration speed.
725 int calc_mutant_regenerate_mod(player_type *creature_ptr)
729 int count = count_mutations(creature_ptr);
730 if (creature_ptr->pseikaku == PERSONALITY_LUCKY)
733 if (creature_ptr->prace == RACE_BEASTMAN) {
741 regen = 100 - count * mod;
749 * @brief 突然変異のレイシャル効果実装
750 * @param creature_ptr プレーヤーへの参照ポインタ
751 * @param power 発動させる突然変異レイシャルのID
752 * @return レイシャルを実行した場合TRUE、キャンセルした場合FALSEを返す
754 bool exe_mutation_power(player_type *creature_ptr, int power)
757 PLAYER_LEVEL lvl = creature_ptr->lev;
760 if (!get_aim_dir(creature_ptr, &dir))
763 stop_mouth(creature_ptr);
764 msg_print(_("酸を吐きかけた...", "You spit acid..."));
765 fire_ball(creature_ptr, GF_ACID, dir, lvl, 1 + (lvl / 30));
768 if (!get_aim_dir(creature_ptr, &dir))
771 stop_mouth(creature_ptr);
772 msg_print(_("あなたは火炎のブレスを吐いた...", "You breathe fire..."));
773 fire_breath(creature_ptr, GF_FIRE, dir, lvl * 2, 1 + (lvl / 20));
776 if (!get_aim_dir(creature_ptr, &dir))
779 msg_print(_("あなたの目は幻惑的になった...", "Your eyes look mesmerizing..."));
780 (void)charm_monster(creature_ptr, dir, lvl);
783 if (!get_aim_dir(creature_ptr, &dir))
786 msg_print(_("集中している...", "You concentrate..."));
787 fetch_item(creature_ptr, dir, lvl * 10, TRUE);
790 msg_print(_("集中している...", "You concentrate..."));
791 teleport_player(creature_ptr, 10 + 4 * lvl, TELEPORT_SPONTANEOUS);
794 if (!get_aim_dir(creature_ptr, &dir))
797 msg_print(_("集中している...", "You concentrate..."));
798 fire_bolt(creature_ptr, GF_PSI, dir, damroll(3 + ((lvl - 1) / 5), 3));
801 msg_print(_("体から放射能が発生した!", "Radiation flows from your body!"));
802 fire_ball(creature_ptr, GF_NUKE, 0, (lvl * 2), 3 + (lvl / 20));
805 vampirism(creature_ptr);
808 stop_mouth(creature_ptr);
809 (void)detect_treasure(creature_ptr, DETECT_RAD_DEFAULT);
812 stop_mouth(creature_ptr);
813 (void)detect_monsters_normal(creature_ptr, DETECT_RAD_DEFAULT);
816 teleport_player(creature_ptr, 10, TELEPORT_SPONTANEOUS);
819 return eat_rock(creature_ptr);
822 if (!get_aim_dir(creature_ptr, &dir)) {
827 (void)teleport_swap(creature_ptr, dir);
831 stop_mouth(creature_ptr);
832 (void)fire_ball(creature_ptr, GF_SOUND, 0, 2 * lvl, 8);
833 (void)aggravate_monsters(creature_ptr, 0);
836 (void)lite_area(creature_ptr, damroll(2, (lvl / 2)), (lvl / 10) + 1);
839 for (int i = 0; i < INVEN_TOTAL; i++) {
840 object_type *o_ptr = &creature_ptr->inventory_list[i];
841 if ((o_ptr->k_idx == 0) || !object_is_cursed(o_ptr))
844 o_ptr->feeling = FEEL_CURSED;
849 (void)berserk(creature_ptr, randint1(25) + 25);
852 if (!get_check(_("変身します。よろしいですか?", "You will polymorph your self. Are you sure? ")))
855 do_poly_self(creature_ptr);
858 return alchemy(creature_ptr);
860 for (DIRECTION i = 0; i < 8; i++)
861 summon_specific(creature_ptr, -1, creature_ptr->y, creature_ptr->x, lvl, SUMMON_MOLD, PM_FORCE_PET);
866 TIME_EFFECT dur = randint1(20) + 20;
867 if (randint0(5) < num) {
868 (void)set_oppose_acid(creature_ptr, dur, FALSE);
872 if (randint0(4) < num) {
873 (void)set_oppose_elec(creature_ptr, dur, FALSE);
877 if (randint0(3) < num) {
878 (void)set_oppose_fire(creature_ptr, dur, FALSE);
882 if (randint0(2) < num) {
883 (void)set_oppose_cold(creature_ptr, dur, FALSE);
888 (void)set_oppose_pois(creature_ptr, dur, FALSE);
894 case MUT1_EARTHQUAKE:
895 (void)earthquake(creature_ptr, creature_ptr->y, creature_ptr->x, 10, 0);
898 return eat_magic(creature_ptr, creature_ptr->lev * 2);
900 report_magics(creature_ptr);
903 msg_print(_("突然頭が痛くなった!", "You suddenly have a headache!"));
904 take_hit(creature_ptr, DAMAGE_LOSELIFE, randint1(17) + 17, _("禁欲を強いた疲労", "the strain of forcing abstinence"), -1);
905 creature_ptr->current_floor_ptr->num_repro += MAX_REPRO;
907 case MUT1_HIT_AND_AWAY:
908 return hit_and_away(creature_ptr);
910 stun_monsters(creature_ptr, lvl * 4);
911 confuse_monsters(creature_ptr, lvl * 4);
912 turn_monsters(creature_ptr, lvl * 4);
915 if (!get_aim_dir(creature_ptr, &dir))
918 fire_beam(creature_ptr, GF_LITE, dir, 2 * lvl);
921 return recall_player(creature_ptr, randint0(21) + 15);
923 if (!get_direction(creature_ptr, &dir, FALSE, FALSE))
926 POSITION y = creature_ptr->y + ddy[dir];
927 POSITION x = creature_ptr->x + ddx[dir];
929 g_ptr = &creature_ptr->current_floor_ptr->grid_array[y][x];
932 msg_print(_("邪悪な存在を感じとれません!", "You sense no evil there!"));
937 m_ptr = &creature_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
939 r_ptr = &r_info[m_ptr->r_idx];
940 if ((r_ptr->flags3 & RF3_EVIL) && !(r_ptr->flags1 & RF1_QUESTOR) && !(r_ptr->flags1 & RF1_UNIQUE) && !creature_ptr->current_floor_ptr->inside_arena
941 && !creature_ptr->current_floor_ptr->inside_quest && (r_ptr->level < randint1(creature_ptr->lev + 50)) && !(m_ptr->mflag2 & MFLAG2_NOGENO)) {
942 if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname) {
943 GAME_TEXT m_name[MAX_NLEN];
944 monster_desc(creature_ptr, m_name, m_ptr, MD_INDEF_VISIBLE);
945 exe_write_diary(creature_ptr, DIARY_NAMED_PET, RECORD_NAMED_PET_GENOCIDE, m_name);
948 delete_monster_idx(creature_ptr, g_ptr->m_idx);
949 msg_print(_("その邪悪なモンスターは硫黄臭い煙とともに消え去った!", "The evil creature vanishes in a puff of sulfurous smoke!"));
953 msg_print(_("祈りは効果がなかった!", "Your invocation is ineffectual!"));
955 m_ptr->mflag2 |= MFLAG2_NOGENO;
959 case MUT1_COLD_TOUCH: {
960 if (!get_direction(creature_ptr, &dir, FALSE, FALSE))
963 POSITION y = creature_ptr->y + ddy[dir];
964 POSITION x = creature_ptr->x + ddx[dir];
966 g_ptr = &creature_ptr->current_floor_ptr->grid_array[y][x];
968 msg_print(_("あなたは何もない場所で手を振った。", "You wave your hands in the air."));
972 fire_bolt(creature_ptr, GF_COLD, dir, 2 * lvl);
976 return do_cmd_throw(creature_ptr, 2 + lvl / 40, FALSE, -1);
978 free_turn(creature_ptr);
979 msg_format(_("能力 %s は実装されていません。", "Power %s not implemented. Oops."), power);
984 void become_living_trump(player_type *creature_ptr)
986 /* 1/7 Teleport control and 6/7 Random teleportation (uncontrolled) */
987 MUTATION_IDX mutation = one_in_(7) ? 12 : 77;
988 if (gain_mutation(creature_ptr, mutation))
989 msg_print(_("あなたは生きているカードに変わった。", "You have turned into a Living Trump."));
992 void set_mutation_flags(player_type *creature_ptr)
994 if (creature_ptr->muta3 == 0)
997 if (creature_ptr->muta3 & MUT3_FLESH_ROT)
998 creature_ptr->regenerate = FALSE;
1000 if (creature_ptr->muta3 & MUT3_ELEC_TOUC)
1001 creature_ptr->sh_elec = TRUE;
1003 if (creature_ptr->muta3 & MUT3_FIRE_BODY) {
1004 creature_ptr->sh_fire = TRUE;
1005 creature_ptr->lite = TRUE;
1008 if (creature_ptr->muta3 & MUT3_WINGS)
1009 creature_ptr->levitation = TRUE;
1011 if (creature_ptr->muta3 & MUT3_FEARLESS)
1012 creature_ptr->resist_fear = TRUE;
1014 if (creature_ptr->muta3 & MUT3_REGEN)
1015 creature_ptr->regenerate = TRUE;
1017 if (creature_ptr->muta3 & MUT3_ESP)
1018 creature_ptr->telepathy = TRUE;
1020 if (creature_ptr->muta3 & MUT3_MOTION)
1021 creature_ptr->free_act = TRUE;