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/bad-status-setter.h"
7 #include "player/player-class.h"
8 #include "player/player-damage.h"
9 #include "player/player-effects.h"
10 #include "player/player-race.h"
11 #include "spell-kind/spells-charm.h"
12 #include "spell-kind/spells-detection.h"
13 #include "spell-kind/spells-floor.h"
14 #include "spell-kind/spells-launcher.h"
15 #include "spell-kind/spells-pet.h"
16 #include "spell-kind/spells-sight.h"
17 #include "spell/spells-diceroll.h"
18 #include "spell/spells-object.h"
19 #include "spell/spells-status.h"
20 #include "spell/spells-summon.h"
21 #include "spell/spell-types.h"
22 #include "view/display-messages.h"
25 * @brief 悪魔領域魔法の各処理を行う
26 * @param caster_ptr プレーヤーへの参照ポインタ
28 * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
29 * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
31 concptr do_daemon_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type mode)
33 bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
34 bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
35 bool info = (mode == SPELL_INFO) ? TRUE : FALSE;
36 bool cast = (mode == SPELL_CAST) ? TRUE : FALSE;
39 PLAYER_LEVEL plev = caster_ptr->lev;
44 if (name) return _("マジック・ミサイル", "Magic Missile");
45 if (desc) return _("弱い魔法の矢を放つ。", "Fires a weak bolt of magic.");
48 DICE_NUMBER dice = 3 + (plev - 1) / 5;
51 if (info) return info_damage(dice, sides, 0);
55 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
57 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr) - 10, GF_MISSILE, dir, damroll(dice, sides));
63 if (name) return _("無生命感知", "Detect Unlife");
64 if (desc) return _("近くの生命のないモンスターを感知する。", "Detects all nonliving monsters in your vicinity.");
67 POSITION rad = DETECT_RAD_DEFAULT;
69 if (info) return info_radius(rad);
73 detect_monsters_nonliving(caster_ptr, rad);
79 if (name) return _("邪なる祝福", "Evil Bless");
80 if (desc) return _("一定時間、命中率とACにボーナスを得る。", "Gives a bonus to hit and AC for a few turns.");
85 if (info) return info_duration(base, base);
89 set_blessed(caster_ptr, randint1(base) + base, FALSE);
95 if (name) return _("耐火炎", "Resist Fire");
96 if (desc) return _("一定時間、炎への耐性を得る。装備による耐性に累積する。",
97 "Gives resistance to fire, cold and electricity for a while. These resistances can be added to those from equipment for more powerful resistances.");
102 if (info) return info_duration(base, base);
106 set_oppose_fire(caster_ptr, randint1(base) + base, FALSE);
112 if (name) return _("恐慌", "Horrify");
113 if (desc) return _("モンスター1体を恐怖させ、朦朧させる。抵抗されると無効。", "Attempts to scare and stun a monster.");
116 PLAYER_LEVEL power = plev;
118 if (info) return info_power(power);
122 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
124 fear_monster(caster_ptr, dir, power);
125 stun_monster(caster_ptr, dir, power);
131 if (name) return _("地獄の矢", "Nether Bolt");
132 if (desc) return _("地獄のボルトもしくはビームを放つ。", "Fires a bolt or beam of nether.");
135 DICE_NUMBER dice = 6 + (plev - 5) / 4;
138 if (info) return info_damage(dice, sides, 0);
142 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
144 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr), GF_NETHER, dir, damroll(dice, sides));
150 if (name) return _("古代の死霊召喚", "Summon Manes");
151 if (desc) return _("古代の死霊を召喚する。", "Summons a manes.");
156 if (!summon_specific(caster_ptr, -1, caster_ptr->y, caster_ptr->x, (plev * 3) / 2, SUMMON_MANES, (PM_ALLOW_GROUP | PM_FORCE_PET)))
158 msg_print(_("古代の死霊は現れなかった。", "No Manes arrive."));
165 if (name) return _("地獄の焔", "Hellish Flame");
166 if (desc) return _("邪悪な力を持つボールを放つ。善良なモンスターには大きなダメージを与える。",
167 "Fires a ball of evil power. Hurts good monsters greatly.");
170 DICE_NUMBER dice = 3;
172 POSITION rad = (plev < 30) ? 2 : 3;
175 if (IS_WIZARD_CLASS(caster_ptr))
176 base = plev + plev / 2;
178 base = plev + plev / 4;
181 if (info) return info_damage(dice, sides, base);
185 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
187 fire_ball(caster_ptr, GF_HELL_FIRE, dir, damroll(dice, sides) + base, rad);
193 if (name) return _("デーモン支配", "Dominate Demon");
194 if (desc) return _("悪魔1体を魅了する。抵抗されると無効", "Attempts to charm a demon.");
199 if (info) return info_power(power);
203 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
205 control_one_demon(caster_ptr, dir, plev);
211 if (name) return _("ビジョン", "Vision");
212 if (desc) return _("周辺の地形を感知する。", "Maps nearby area.");
215 POSITION rad = DETECT_RAD_MAP;
217 if (info) return info_radius(rad);
221 map_area(caster_ptr, rad);
227 if (name) return _("耐地獄", "Resist Nether");
228 if (desc) return _("一定時間、地獄への耐性を得る。", "Gives resistance to nether for a while.");
233 if (info) return info_duration(base, base);
237 set_tim_res_nether(caster_ptr, randint1(base) + base, FALSE);
243 if (name) return _("プラズマ・ボルト", "Plasma bolt");
244 if (desc) return _("プラズマのボルトもしくはビームを放つ。", "Fires a bolt or beam of plasma.");
247 DICE_NUMBER dice = 11 + (plev - 5) / 4;
250 if (info) return info_damage(dice, sides, 0);
254 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
256 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr), GF_PLASMA, dir, damroll(dice, sides));
262 if (name) return _("ファイア・ボール", "Fire Ball");
263 if (desc) return _("炎の球を放つ。", "Fires a ball of fire.");
266 HIT_POINT dam = plev + 55;
269 if (info) return info_damage(0, 0, dam);
273 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
275 fire_ball(caster_ptr, GF_FIRE, dir, dam, rad);
281 if (name) return _("炎の刃", "Fire Branding");
282 if (desc) return _("武器に炎の属性をつける。", "Makes current weapon fire branded.");
287 brand_weapon(caster_ptr, 1);
293 if (name) return _("地獄球", "Nether Ball");
294 if (desc) return _("大きな地獄の球を放つ。", "Fires a huge ball of nether.");
297 HIT_POINT dam = plev * 3 / 2 + 100;
298 POSITION rad = plev / 20 + 2;
300 if (info) return info_damage(0, 0, dam);
304 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
306 fire_ball(caster_ptr, GF_NETHER, dir, dam, rad);
312 if (name) return _("デーモン召喚", "Summon Demon");
313 if (desc) return _("悪魔1体を召喚する。", "Summons a demon.");
318 cast_summon_demon(caster_ptr, plev * 2 / 3 + randint1(plev / 2));
324 if (name) return _("悪魔の目", "Devilish Eye");
325 if (desc) return _("一定時間、テレパシー能力を得る。", "Gives telepathy for a while.");
331 if (info) return info_duration(base, sides);
335 set_tim_esp(caster_ptr, randint1(sides) + base, FALSE);
341 if (name) return _("悪魔のクローク", "Devil Cloak");
342 if (desc) return _("恐怖を取り除き、一定時間、炎と冷気の耐性、炎のオーラを得る。耐性は装備による耐性に累積する。",
343 "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.");
346 TIME_EFFECT base = 20;
348 if (info) return info_duration(base, base);
352 TIME_EFFECT dur = randint1(base) + base;
354 set_oppose_fire(caster_ptr, dur, FALSE);
355 set_oppose_cold(caster_ptr, dur, FALSE);
356 set_tim_sh_fire(caster_ptr, dur, FALSE);
357 set_afraid(caster_ptr, 0);
364 if (name) return _("溶岩流", "The Flow of Lava");
365 if (desc) return _("自分を中心とした炎の球を作り出し、床を溶岩に変える。",
366 "Generates a ball of fire centered on you which transforms floors to magma.");
369 HIT_POINT dam = (55 + plev) * 2;
372 if (info) return info_damage(0, 0, dam / 2);
376 fire_ball(caster_ptr, GF_FIRE, 0, dam, rad);
377 fire_ball_hide(caster_ptr, GF_LAVA_FLOW, 0, 2 + randint1(2), rad);
383 if (name) return _("プラズマ球", "Plasma Ball");
384 if (desc) return _("プラズマの球を放つ。", "Fires a ball of plasma.");
387 HIT_POINT dam = plev * 3 / 2 + 80;
388 POSITION rad = 2 + plev / 40;
390 if (info) return info_damage(0, 0, dam);
394 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
396 fire_ball(caster_ptr, GF_PLASMA, dir, dam, rad);
402 if (name) return _("悪魔変化", "Polymorph Demon");
403 if (desc) return _("一定時間、悪魔に変化する。変化している間は本来の種族の能力を失い、代わりに悪魔としての能力を得る。",
404 "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.");
407 int base = 10 + plev / 2;
409 if (info) return info_duration(base, base);
413 set_mimic(caster_ptr, base + randint1(base), MIMIC_DEMON, FALSE);
419 if (name) return _("地獄の波動", "Nather Wave");
420 if (desc) return _("視界内の全てのモンスターにダメージを与える。善良なモンスターに特に大きなダメージを与える。",
421 "Damages all monsters in sight. Hurts good monsters greatly.");
424 int sides1 = plev * 2;
425 int sides2 = plev * 2;
427 if (info) return format("%sd%d+d%d", KWD_DAM, sides1, sides2);
431 dispel_monsters(caster_ptr, randint1(sides1));
432 dispel_good(caster_ptr, randint1(sides2));
438 if (name) return _("サキュバスの接吻", "Kiss of Succubus");
439 if (desc) return _("因果混乱の球を放つ。", "Fires a ball of nexus.");
442 HIT_POINT dam = 100 + plev * 2;
445 if (info) return info_damage(0, 0, dam);
449 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
450 fire_ball(caster_ptr, GF_NEXUS, dir, dam, rad);
456 if (name) return _("破滅の手", "Doom Hand");
457 if (desc) return _("破滅の手を放つ。食らったモンスターはそのときのHPの半分前後のダメージを受ける。", "Attempts to cut a monster's HP roughly in half.");
462 if (!get_aim_dir(caster_ptr, &dir))
465 msg_print(_("<破滅の手>を放った!", "You invoke the Hand of Doom!"));
467 fire_ball_hide(caster_ptr, GF_HAND_DOOM, dir, plev * 2, 0);
473 if (name) return _("士気高揚", "Raise the Morale");
474 if (desc) return _("一定時間、ヒーロー気分になる。", "Removes fear. Gives a bonus to hit for a while. Heals you for 10 HP.");
478 if (info) return info_duration(base, base);
479 if (cast)heroism(caster_ptr, base);
484 if (name) return _("不滅の肉体", "Immortal Body");
485 if (desc) return _("一定時間、時間逆転への耐性を得る。", "Gives resistance to time for a while.");
490 if (info) return info_duration(base, base);
494 set_tim_res_time(caster_ptr, randint1(base) + base, FALSE);
500 if (name) return _("狂気の円環", "Insanity Circle");
501 if (desc) return _("自分を中心としたカオスの球、混乱の球を発生させ、近くのモンスターを魅了する。",
502 "Generates balls of chaos, confusion and charm centered on you.");
505 HIT_POINT dam = 50 + plev;
506 int power = 20 + plev;
507 POSITION rad = 3 + plev / 20;
509 if (info) return format("%s%d+%d", KWD_DAM, dam / 2, dam / 2);
513 fire_ball(caster_ptr, GF_CHAOS, 0, dam, rad);
514 fire_ball(caster_ptr, GF_CONFUSION, 0, dam, rad);
515 fire_ball(caster_ptr, GF_CHARM, 0, power, rad);
521 if (name) return _("ペット爆破", "Explode Pets");
522 if (desc) return _("全てのペットを強制的に爆破させる。", "Makes all pets explode.");
527 discharge_minion(caster_ptr);
533 if (name) return _("グレーターデーモン召喚", "Summon Greater Demon");
534 if (desc) return _("上級デーモンを召喚する。召喚するには人間('p','h','t'で表されるモンスター)の死体を捧げなければならない。",
535 "Summons greater demon. Requires the sacrifice of a human corpse ('p', 'h' or 't').");
540 if (!cast_summon_greater_demon(caster_ptr)) return NULL;
546 if (name) return _("地獄嵐", "Nether Storm");
547 if (desc) return _("超巨大な地獄の球を放つ。", "Generates a huge ball of nether.");
550 HIT_POINT dam = plev * 15;
551 POSITION rad = plev / 5;
553 if (info) return info_damage(0, 0, dam);
557 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
559 fire_ball(caster_ptr, GF_NETHER, dir, dam, rad);
565 if (name) return _("血の呪い", "Bloody Curse");
566 if (desc) return _("自分がダメージを受けることによって対象に呪いをかけ、ダメージを与え様々な効果を引き起こす。",
567 "Puts blood curse, which damages and causes various effects, on a monster. You also take damage.");
573 if (info) return info_damage(0, 0, dam);
577 if (!get_aim_dir(caster_ptr, &dir)) return NULL;
579 fire_ball_hide(caster_ptr, GF_BLOOD_CURSE, dir, dam, rad);
580 take_hit(caster_ptr, DAMAGE_USELIFE, 20 + randint1(30), _("血の呪い", "Blood curse"), -1);
586 if (name) return _("魔王変化", "Polymorph Demonlord");
587 if (desc) return _("悪魔の王に変化する。変化している間は本来の種族の能力を失い、代わりに悪魔の王としての能力を得、壁を破壊しながら歩く。",
588 "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.");
593 if (info) return info_duration(base, base);
597 set_mimic(caster_ptr, base + randint1(base), MIMIC_DEMON_LORD, FALSE);