1 #include "realm/realm-demon.h"
2 #include "cmd-action/cmd-spell.h"
3 #include "io/targeting.h"
4 #include "monster-floor/monster-summon.h"
5 #include "monster-floor/place-monster-types.h"
6 #include "player/player-class.h"
7 #include "player/player-damage.h"
8 #include "player/player-race.h"
9 #include "spell-kind/spells-charm.h"
10 #include "spell-kind/spells-detection.h"
11 #include "spell-kind/spells-floor.h"
12 #include "spell-kind/spells-launcher.h"
13 #include "spell-kind/spells-pet.h"
14 #include "spell-kind/spells-sight.h"
15 #include "spell-realm/spells-demon.h"
16 #include "spell/spells-diceroll.h"
17 #include "spell/spells-object.h"
18 #include "spell/spells-status.h"
19 #include "spell/spells-summon.h"
20 #include "spell/spell-types.h"
21 #include "status/bad-status-setter.h"
22 #include "status/buff-setter.h"
23 #include "status/element-resistance.h"
24 #include "status/shape-changer.h"
25 #include "status/sight-setter.h"
26 #include "status/temporary-resistance.h"
27 #include "view/display-messages.h"
30 * @brief 悪魔領域魔法の各処理を行う
31 * @param caster_ptr プレーヤーへの参照ポインタ
33 * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
34 * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
36 concptr do_daemon_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type mode)
38 bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
39 bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
40 bool info = (mode == SPELL_INFO) ? TRUE : FALSE;
41 bool cast = (mode == SPELL_CAST) ? TRUE : FALSE;
44 PLAYER_LEVEL plev = caster_ptr->lev;
49 if (name) return _("マジック・ミサイル", "Magic Missile");
50 if (desc) return _("弱い魔法の矢を放つ。", "Fires a weak bolt of magic.");
53 DICE_NUMBER dice = 3 + (plev - 1) / 5;
56 if (info) return info_damage(dice, sides, 0);
60 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
62 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr) - 10, GF_MISSILE, dir, damroll(dice, sides));
68 if (name) return _("無生命感知", "Detect Unlife");
69 if (desc) return _("近くの生命のないモンスターを感知する。", "Detects all nonliving monsters in your vicinity.");
72 POSITION rad = DETECT_RAD_DEFAULT;
74 if (info) return info_radius(rad);
78 detect_monsters_nonliving(caster_ptr, rad);
84 if (name) return _("邪なる祝福", "Evil Bless");
85 if (desc) return _("一定時間、命中率とACにボーナスを得る。", "Gives a bonus to hit and AC for a few turns.");
90 if (info) return info_duration(base, base);
94 set_blessed(caster_ptr, randint1(base) + base, FALSE);
100 if (name) return _("耐火炎", "Resist Fire");
101 if (desc) return _("一定時間、炎への耐性を得る。装備による耐性に累積する。",
102 "Gives resistance to fire, cold and electricity for a while. These resistances can be added to those from equipment for more powerful resistances.");
107 if (info) return info_duration(base, base);
111 set_oppose_fire(caster_ptr, randint1(base) + base, FALSE);
117 if (name) return _("恐慌", "Horrify");
118 if (desc) return _("モンスター1体を恐怖させ、朦朧させる。抵抗されると無効。", "Attempts to scare and stun a monster.");
121 PLAYER_LEVEL power = plev;
123 if (info) return info_power(power);
127 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
129 fear_monster(caster_ptr, dir, power);
130 stun_monster(caster_ptr, dir, power);
136 if (name) return _("地獄の矢", "Nether Bolt");
137 if (desc) return _("地獄のボルトもしくはビームを放つ。", "Fires a bolt or beam of nether.");
140 DICE_NUMBER dice = 6 + (plev - 5) / 4;
143 if (info) return info_damage(dice, sides, 0);
147 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
149 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr), GF_NETHER, dir, damroll(dice, sides));
155 if (name) return _("古代の死霊召喚", "Summon Manes");
156 if (desc) return _("古代の死霊を召喚する。", "Summons a manes.");
161 if (!summon_specific(caster_ptr, -1, caster_ptr->y, caster_ptr->x, (plev * 3) / 2, SUMMON_MANES, (PM_ALLOW_GROUP | PM_FORCE_PET)))
163 msg_print(_("古代の死霊は現れなかった。", "No Manes arrive."));
170 if (name) return _("地獄の焔", "Hellish Flame");
171 if (desc) return _("邪悪な力を持つボールを放つ。善良なモンスターには大きなダメージを与える。",
172 "Fires a ball of evil power. Hurts good monsters greatly.");
175 DICE_NUMBER dice = 3;
177 POSITION rad = (plev < 30) ? 2 : 3;
180 if (IS_WIZARD_CLASS(caster_ptr))
181 base = plev + plev / 2;
183 base = plev + plev / 4;
186 if (info) return info_damage(dice, sides, base);
190 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
192 fire_ball(caster_ptr, GF_HELL_FIRE, dir, damroll(dice, sides) + base, rad);
198 if (name) return _("デーモン支配", "Dominate Demon");
199 if (desc) return _("悪魔1体を魅了する。抵抗されると無効", "Attempts to charm a demon.");
204 if (info) return info_power(power);
208 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
210 control_one_demon(caster_ptr, dir, plev);
216 if (name) return _("ビジョン", "Vision");
217 if (desc) return _("周辺の地形を感知する。", "Maps nearby area.");
220 POSITION rad = DETECT_RAD_MAP;
222 if (info) return info_radius(rad);
226 map_area(caster_ptr, rad);
232 if (name) return _("耐地獄", "Resist Nether");
233 if (desc) return _("一定時間、地獄への耐性を得る。", "Gives resistance to nether for a while.");
238 if (info) return info_duration(base, base);
242 set_tim_res_nether(caster_ptr, randint1(base) + base, FALSE);
248 if (name) return _("プラズマ・ボルト", "Plasma bolt");
249 if (desc) return _("プラズマのボルトもしくはビームを放つ。", "Fires a bolt or beam of plasma.");
252 DICE_NUMBER dice = 11 + (plev - 5) / 4;
255 if (info) return info_damage(dice, sides, 0);
259 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
261 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr), GF_PLASMA, dir, damroll(dice, sides));
267 if (name) return _("ファイア・ボール", "Fire Ball");
268 if (desc) return _("炎の球を放つ。", "Fires a ball of fire.");
271 HIT_POINT dam = plev + 55;
274 if (info) return info_damage(0, 0, dam);
278 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
280 fire_ball(caster_ptr, GF_FIRE, dir, dam, rad);
286 if (name) return _("炎の刃", "Fire Branding");
287 if (desc) return _("武器に炎の属性をつける。", "Makes current weapon fire branded.");
292 brand_weapon(caster_ptr, 1);
298 if (name) return _("地獄球", "Nether Ball");
299 if (desc) return _("大きな地獄の球を放つ。", "Fires a huge ball of nether.");
302 HIT_POINT dam = plev * 3 / 2 + 100;
303 POSITION rad = plev / 20 + 2;
305 if (info) return info_damage(0, 0, dam);
309 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
311 fire_ball(caster_ptr, GF_NETHER, dir, dam, rad);
317 if (name) return _("デーモン召喚", "Summon Demon");
318 if (desc) return _("悪魔1体を召喚する。", "Summons a demon.");
323 cast_summon_demon(caster_ptr, plev * 2 / 3 + randint1(plev / 2));
329 if (name) return _("悪魔の目", "Devilish Eye");
330 if (desc) return _("一定時間、テレパシー能力を得る。", "Gives telepathy for a while.");
336 if (info) return info_duration(base, sides);
340 set_tim_esp(caster_ptr, randint1(sides) + base, FALSE);
346 if (name) return _("悪魔のクローク", "Devil Cloak");
347 if (desc) return _("恐怖を取り除き、一定時間、炎と冷気の耐性、炎のオーラを得る。耐性は装備による耐性に累積する。",
348 "Removes fear. Gives resistance to fire and cold, and aura of fire. These resistances can be added to those from equipment for more powerful resistances.");
351 TIME_EFFECT base = 20;
353 if (info) return info_duration(base, base);
357 TIME_EFFECT dur = randint1(base) + base;
359 set_oppose_fire(caster_ptr, dur, FALSE);
360 set_oppose_cold(caster_ptr, dur, FALSE);
361 set_tim_sh_fire(caster_ptr, dur, FALSE);
362 set_afraid(caster_ptr, 0);
369 if (name) return _("溶岩流", "The Flow of Lava");
370 if (desc) return _("自分を中心とした炎の球を作り出し、床を溶岩に変える。",
371 "Generates a ball of fire centered on you which transforms floors to magma.");
374 HIT_POINT dam = (55 + plev) * 2;
377 if (info) return info_damage(0, 0, dam / 2);
381 fire_ball(caster_ptr, GF_FIRE, 0, dam, rad);
382 fire_ball_hide(caster_ptr, GF_LAVA_FLOW, 0, 2 + randint1(2), rad);
388 if (name) return _("プラズマ球", "Plasma Ball");
389 if (desc) return _("プラズマの球を放つ。", "Fires a ball of plasma.");
392 HIT_POINT dam = plev * 3 / 2 + 80;
393 POSITION rad = 2 + plev / 40;
395 if (info) return info_damage(0, 0, dam);
399 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
401 fire_ball(caster_ptr, GF_PLASMA, dir, dam, rad);
407 if (name) return _("悪魔変化", "Polymorph Demon");
408 if (desc) return _("一定時間、悪魔に変化する。変化している間は本来の種族の能力を失い、代わりに悪魔としての能力を得る。",
409 "Causes you to mimic a demon for a while. You lose the abilities of your original race and get the abilities of a demon for that time.");
412 int base = 10 + plev / 2;
414 if (info) return info_duration(base, base);
418 set_mimic(caster_ptr, base + randint1(base), MIMIC_DEMON, FALSE);
424 if (name) return _("地獄の波動", "Nather Wave");
425 if (desc) return _("視界内の全てのモンスターにダメージを与える。善良なモンスターに特に大きなダメージを与える。",
426 "Damages all monsters in sight. Hurts good monsters greatly.");
429 int sides1 = plev * 2;
430 int sides2 = plev * 2;
432 if (info) return format("%sd%d+d%d", KWD_DAM, sides1, sides2);
436 dispel_monsters(caster_ptr, randint1(sides1));
437 dispel_good(caster_ptr, randint1(sides2));
443 if (name) return _("サキュバスの接吻", "Kiss of Succubus");
444 if (desc) return _("因果混乱の球を放つ。", "Fires a ball of nexus.");
447 HIT_POINT dam = 100 + plev * 2;
450 if (info) return info_damage(0, 0, dam);
454 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
455 fire_ball(caster_ptr, GF_NEXUS, dir, dam, rad);
461 if (name) return _("破滅の手", "Doom Hand");
462 if (desc) return _("破滅の手を放つ。食らったモンスターはそのときのHPの半分前後のダメージを受ける。", "Attempts to cut a monster's HP roughly in half.");
467 if (!get_aim_dir(caster_ptr, &dir))
470 msg_print(_("<破滅の手>を放った!", "You invoke the Hand of Doom!"));
472 fire_ball_hide(caster_ptr, GF_HAND_DOOM, dir, plev * 2, 0);
478 if (name) return _("士気高揚", "Raise the Morale");
479 if (desc) return _("一定時間、ヒーロー気分になる。", "Removes fear. Gives a bonus to hit for a while. Heals you for 10 HP.");
483 if (info) return info_duration(base, base);
484 if (cast)heroism(caster_ptr, base);
489 if (name) return _("不滅の肉体", "Immortal Body");
490 if (desc) return _("一定時間、時間逆転への耐性を得る。", "Gives resistance to time for a while.");
495 if (info) return info_duration(base, base);
499 set_tim_res_time(caster_ptr, randint1(base) + base, FALSE);
505 if (name) return _("狂気の円環", "Insanity Circle");
506 if (desc) return _("自分を中心としたカオスの球、混乱の球を発生させ、近くのモンスターを魅了する。",
507 "Generates balls of chaos, confusion and charm centered on you.");
510 HIT_POINT dam = 50 + plev;
511 int power = 20 + plev;
512 POSITION rad = 3 + plev / 20;
514 if (info) return format("%s%d+%d", KWD_DAM, dam / 2, dam / 2);
518 fire_ball(caster_ptr, GF_CHAOS, 0, dam, rad);
519 fire_ball(caster_ptr, GF_CONFUSION, 0, dam, rad);
520 fire_ball(caster_ptr, GF_CHARM, 0, power, rad);
526 if (name) return _("ペット爆破", "Explode Pets");
527 if (desc) return _("全てのペットを強制的に爆破させる。", "Makes all pets explode.");
532 discharge_minion(caster_ptr);
538 if (name) return _("グレーターデーモン召喚", "Summon Greater Demon");
539 if (desc) return _("上級デーモンを召喚する。召喚するには人間('p','h','t'で表されるモンスター)の死体を捧げなければならない。",
540 "Summons greater demon. Requires the sacrifice of a human corpse ('p', 'h' or 't').");
545 if (!cast_summon_greater_demon(caster_ptr)) return NULL;
551 if (name) return _("地獄嵐", "Nether Storm");
552 if (desc) return _("超巨大な地獄の球を放つ。", "Generates a huge ball of nether.");
555 HIT_POINT dam = plev * 15;
556 POSITION rad = plev / 5;
558 if (info) return info_damage(0, 0, dam);
562 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
564 fire_ball(caster_ptr, GF_NETHER, dir, dam, rad);
570 if (name) return _("血の呪い", "Bloody Curse");
571 if (desc) return _("自分がダメージを受けることによって対象に呪いをかけ、ダメージを与え様々な効果を引き起こす。",
572 "Puts blood curse, which damages and causes various effects, on a monster. You also take damage.");
578 if (info) return info_damage(0, 0, dam);
582 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
584 fire_ball_hide(caster_ptr, GF_BLOOD_CURSE, dir, dam, rad);
585 take_hit(caster_ptr, DAMAGE_USELIFE, 20 + randint1(30), _("血の呪い", "Blood curse"), -1);
591 if (name) return _("魔王変化", "Polymorph Demonlord");
592 if (desc) return _("悪魔の王に変化する。変化している間は本来の種族の能力を失い、代わりに悪魔の王としての能力を得、壁を破壊しながら歩く。",
593 "Causes you to mimic a demon lord for a while. You lose the abilities of your original race and get the great abilities of a demon lord for that time. Even hard walls can't stop your walking.");
598 if (info) return info_duration(base, base);
602 set_mimic(caster_ptr, base + randint1(base), MIMIC_DEMON_LORD, FALSE);