OSDN Git Service

[Refactor] #37287 #37353 型の置換。 / Type replacement.
[hengbandforosx/hengbandosx.git] / src / realm-daemon.c
1 
2 #include "angband.h"
3 #include "cmd-spell.h"
4 #include "spells-summon.h"
5
6 /*!
7 * @brief 悪魔領域魔法の各処理を行う
8 * @param spell 魔法ID
9 * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
10 * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
11 */
12 cptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
13 {
14         bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
15         bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
16         bool info = (mode == SPELL_INFO) ? TRUE : FALSE;
17         bool cast = (mode == SPELL_CAST) ? TRUE : FALSE;
18         static const char s_dam[] = _("損傷:", "dam ");
19
20         DIRECTION dir;
21         int plev = p_ptr->lev;
22
23         switch (spell)
24         {
25         case 0:
26                 if (name) return _("マジック・ミサイル", "Magic Missile");
27                 if (desc) return _("弱い魔法の矢を放つ。", "Fires a weak bolt of magic.");
28
29                 {
30                         int dice = 3 + (plev - 1) / 5;
31                         int sides = 4;
32
33                         if (info) return info_damage(dice, sides, 0);
34
35                         if (cast)
36                         {
37                                 if (!get_aim_dir(&dir)) return NULL;
38
39                                 fire_bolt_or_beam(beam_chance() - 10, GF_MISSILE, dir, damroll(dice, sides));
40                         }
41                 }
42                 break;
43
44         case 1:
45                 if (name) return _("無生命感知", "Detect Unlife");
46                 if (desc) return _("近くの生命のないモンスターを感知する。", "Detects all nonliving monsters in your vicinity.");
47
48                 {
49                         POSITION rad = DETECT_RAD_DEFAULT;
50
51                         if (info) return info_radius(rad);
52
53                         if (cast)
54                         {
55                                 detect_monsters_nonliving(rad);
56                         }
57                 }
58                 break;
59
60         case 2:
61                 if (name) return _("邪なる祝福", "Evil Bless");
62                 if (desc) return _("一定時間、命中率とACにボーナスを得る。", "Gives bonus to hit and AC for a few turns.");
63
64                 {
65                         int base = 12;
66
67                         if (info) return info_duration(base, base);
68
69                         if (cast)
70                         {
71                                 set_blessed(randint1(base) + base, FALSE);
72                         }
73                 }
74                 break;
75
76         case 3:
77                 if (name) return _("耐火炎", "Resist Fire");
78                 if (desc) return _("一定時間、炎への耐性を得る。装備による耐性に累積する。",
79                         "Gives resistance to fire, cold and electricity for a while. These resistances can be added to which from equipment for more powerful resistances.");
80
81                 {
82                         int base = 20;
83
84                         if (info) return info_duration(base, base);
85
86                         if (cast)
87                         {
88                                 set_oppose_fire(randint1(base) + base, FALSE);
89                         }
90                 }
91                 break;
92
93         case 4:
94                 if (name) return _("恐慌", "Horrify");
95                 if (desc) return _("モンスター1体を恐怖させ、朦朧させる。抵抗されると無効。", "Attempts to scare and stun a monster.");
96
97                 {
98                         int power = plev;
99
100                         if (info) return info_power(power);
101
102                         if (cast)
103                         {
104                                 if (!get_aim_dir(&dir)) return NULL;
105
106                                 fear_monster(dir, power);
107                                 stun_monster(dir, power);
108                         }
109                 }
110                 break;
111
112         case 5:
113                 if (name) return _("地獄の矢", "Nether Bolt");
114                 if (desc) return _("地獄のボルトもしくはビームを放つ。", "Fires a bolt or beam of nether.");
115
116                 {
117                         int dice = 6 + (plev - 5) / 4;
118                         int sides = 8;
119
120                         if (info) return info_damage(dice, sides, 0);
121
122                         if (cast)
123                         {
124                                 if (!get_aim_dir(&dir)) return NULL;
125
126                                 fire_bolt_or_beam(beam_chance(), GF_NETHER, dir, damroll(dice, sides));
127                         }
128                 }
129                 break;
130
131         case 6:
132                 if (name) return _("古代の死霊召喚", "Summon Manes");
133                 if (desc) return _("古代の死霊を召喚する。", "Summons a manes.");
134
135                 {
136                         if (cast)
137                         {
138                                 if (!summon_specific(-1, p_ptr->y, p_ptr->x, (plev * 3) / 2, SUMMON_MANES, (PM_ALLOW_GROUP | PM_FORCE_PET)))
139                                 {
140                                         msg_print(_("古代の死霊は現れなかった。", "No Manes arrive."));
141                                 }
142                         }
143                 }
144                 break;
145
146         case 7:
147                 if (name) return _("地獄の焔", "Hellish Flame");
148                 if (desc) return _("邪悪な力を持つボールを放つ。善良なモンスターには大きなダメージを与える。",
149                         "Fires a ball of evil power. Hurts good monsters greatly.");
150
151                 {
152                         int dice = 3;
153                         int sides = 6;
154                         POSITION rad = (plev < 30) ? 2 : 3;
155                         int base;
156
157                         if (IS_WIZARD_CLASS())
158                                 base = plev + plev / 2;
159                         else
160                                 base = plev + plev / 4;
161
162
163                         if (info) return info_damage(dice, sides, base);
164
165                         if (cast)
166                         {
167                                 if (!get_aim_dir(&dir)) return NULL;
168
169                                 fire_ball(GF_HELL_FIRE, dir, damroll(dice, sides) + base, rad);
170                         }
171                 }
172                 break;
173
174         case 8:
175                 if (name) return _("デーモン支配", "Dominate Demon");
176                 if (desc) return _("悪魔1体を魅了する。抵抗されると無効", "Attempts to charm a demon.");
177
178                 {
179                         int power = plev;
180
181                         if (info) return info_power(power);
182
183                         if (cast)
184                         {
185                                 if (!get_aim_dir(&dir)) return NULL;
186
187                                 control_one_demon(dir, power);
188                         }
189                 }
190                 break;
191
192         case 9:
193                 if (name) return _("ビジョン", "Vision");
194                 if (desc) return _("周辺の地形を感知する。", "Maps nearby area.");
195
196                 {
197                         POSITION rad = DETECT_RAD_MAP;
198
199                         if (info) return info_radius(rad);
200
201                         if (cast)
202                         {
203                                 map_area(rad);
204                         }
205                 }
206                 break;
207
208         case 10:
209                 if (name) return _("耐地獄", "Resist Nether");
210                 if (desc) return _("一定時間、地獄への耐性を得る。", "Gives resistance to nether for a while.");
211
212                 {
213                         int base = 20;
214
215                         if (info) return info_duration(base, base);
216
217                         if (cast)
218                         {
219                                 set_tim_res_nether(randint1(base) + base, FALSE);
220                         }
221                 }
222                 break;
223
224         case 11:
225                 if (name) return _("プラズマ・ボルト", "Plasma bolt");
226                 if (desc) return _("プラズマのボルトもしくはビームを放つ。", "Fires a bolt or beam of plasma.");
227
228                 {
229                         int dice = 11 + (plev - 5) / 4;
230                         int sides = 8;
231
232                         if (info) return info_damage(dice, sides, 0);
233
234                         if (cast)
235                         {
236                                 if (!get_aim_dir(&dir)) return NULL;
237
238                                 fire_bolt_or_beam(beam_chance(), GF_PLASMA, dir, damroll(dice, sides));
239                         }
240                 }
241                 break;
242
243         case 12:
244                 if (name) return _("ファイア・ボール", "Fire Ball");
245                 if (desc) return _("炎の球を放つ。", "Fires a ball of fire.");
246
247                 {
248                         HIT_POINT dam = plev + 55;
249                         POSITION rad = 2;
250
251                         if (info) return info_damage(0, 0, dam);
252
253                         if (cast)
254                         {
255                                 if (!get_aim_dir(&dir)) return NULL;
256
257                                 fire_ball(GF_FIRE, dir, dam, rad);
258                         }
259                 }
260                 break;
261
262         case 13:
263                 if (name) return _("炎の刃", "Fire Branding");
264                 if (desc) return _("武器に炎の属性をつける。", "Makes current weapon fire branded.");
265
266                 {
267                         if (cast)
268                         {
269                                 brand_weapon(1);
270                         }
271                 }
272                 break;
273
274         case 14:
275                 if (name) return _("地獄球", "Nether Ball");
276                 if (desc) return _("大きな地獄の球を放つ。", "Fires a huge ball of nether.");
277
278                 {
279                         HIT_POINT dam = plev * 3 / 2 + 100;
280                         POSITION rad = plev / 20 + 2;
281
282                         if (info) return info_damage(0, 0, dam);
283
284                         if (cast)
285                         {
286                                 if (!get_aim_dir(&dir)) return NULL;
287
288                                 fire_ball(GF_NETHER, dir, dam, rad);
289                         }
290                 }
291                 break;
292
293         case 15:
294                 if (name) return _("デーモン召喚", "Summon Demon");
295                 if (desc) return _("悪魔1体を召喚する。", "Summons a demon.");
296
297                 {
298                         if (cast)
299                         {
300                                 bool pet = !one_in_(3);
301                                 u32b flg = 0L;
302
303                                 if (pet) flg |= PM_FORCE_PET;
304                                 else flg |= PM_NO_PET;
305                                 if (!(pet && (plev < 50))) flg |= PM_ALLOW_GROUP;
306
307                                 if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, plev * 2 / 3 + randint1(plev / 2), SUMMON_DEMON, flg))
308                                 {
309                                         msg_print(_("硫黄の悪臭が充満した。", "The area fills with a stench of sulphur and brimstone."));
310
311                                         if (pet)
312                                         {
313                                                 msg_print(_("「ご用でございますか、ご主人様」", "'What is thy bidding... Master?'"));
314                                         }
315                                         else
316                                         {
317                                                 msg_print(_("「卑しき者よ、我は汝の下僕にあらず! お前の魂を頂くぞ!」",
318                                                         "'NON SERVIAM! Wretch! I shall feast on thy mortal soul!'"));
319                                         }
320                                 }
321                                 else
322                                 {
323                                         msg_print(_("悪魔は現れなかった。", "No demons arrive."));
324                                 }
325                                 break;
326                         }
327                 }
328                 break;
329
330         case 16:
331                 if (name) return _("悪魔の目", "Devilish Eye");
332                 if (desc) return _("一定時間、テレパシー能力を得る。", "Gives telepathy for a while.");
333
334                 {
335                         int base = 30;
336                         int sides = 25;
337
338                         if (info) return info_duration(base, sides);
339
340                         if (cast)
341                         {
342                                 set_tim_esp(randint1(sides) + base, FALSE);
343                         }
344                 }
345                 break;
346
347         case 17:
348                 if (name) return _("悪魔のクローク", "Devil Cloak");
349                 if (desc) return _("恐怖を取り除き、一定時間、炎と冷気の耐性、炎のオーラを得る。耐性は装備による耐性に累積する。",
350                         "Removes fear. Gives resistance to fire and cold, and aura of fire. These resistances can be added to which from equipment for more powerful resistances.");
351
352                 {
353                         TIME_EFFECT base = 20;
354
355                         if (info) return info_duration(base, base);
356
357                         if (cast)
358                         {
359                                 TIME_EFFECT dur = randint1(base) + base;
360
361                                 set_oppose_fire(dur, FALSE);
362                                 set_oppose_cold(dur, FALSE);
363                                 set_tim_sh_fire(dur, FALSE);
364                                 set_afraid(0);
365                                 break;
366                         }
367                 }
368                 break;
369
370         case 18:
371                 if (name) return _("溶岩流", "The Flow of Lava");
372                 if (desc) return _("自分を中心とした炎の球を作り出し、床を溶岩に変える。",
373                         "Generates a ball of fire centered on you which transforms floors to magma.");
374
375                 {
376                         HIT_POINT dam = (55 + plev) * 2;
377                         POSITION rad = 3;
378
379                         if (info) return info_damage(0, 0, dam / 2);
380
381                         if (cast)
382                         {
383                                 fire_ball(GF_FIRE, 0, dam, rad);
384                                 fire_ball_hide(GF_LAVA_FLOW, 0, 2 + randint1(2), rad);
385                         }
386                 }
387                 break;
388
389         case 19:
390                 if (name) return _("プラズマ球", "Plasma Ball");
391                 if (desc) return _("プラズマの球を放つ。", "Fires a ball of plasma.");
392
393                 {
394                         HIT_POINT dam = plev * 3 / 2 + 80;
395                         POSITION rad = 2 + plev / 40;
396
397                         if (info) return info_damage(0, 0, dam);
398
399                         if (cast)
400                         {
401                                 if (!get_aim_dir(&dir)) return NULL;
402
403                                 fire_ball(GF_PLASMA, dir, dam, rad);
404                         }
405                 }
406                 break;
407
408         case 20:
409                 if (name) return _("悪魔変化", "Polymorph Demon");
410                 if (desc) return _("一定時間、悪魔に変化する。変化している間は本来の種族の能力を失い、代わりに悪魔としての能力を得る。",
411                         "Mimic a demon for a while. Loses abilities of original race and gets abilities as a demon.");
412
413                 {
414                         int base = 10 + plev / 2;
415
416                         if (info) return info_duration(base, base);
417
418                         if (cast)
419                         {
420                                 set_mimic(base + randint1(base), MIMIC_DEMON, FALSE);
421                         }
422                 }
423                 break;
424
425         case 21:
426                 if (name) return _("地獄の波動", "Nather Wave");
427                 if (desc) return _("視界内の全てのモンスターにダメージを与える。善良なモンスターに特に大きなダメージを与える。",
428                         "Damages all monsters in sight. Hurts good monsters greatly.");
429
430                 {
431                         int sides1 = plev * 2;
432                         int sides2 = plev * 2;
433
434                         if (info) return format("%sd%d+d%d", s_dam, sides1, sides2);
435
436                         if (cast)
437                         {
438                                 dispel_monsters(randint1(sides1));
439                                 dispel_good(randint1(sides2));
440                         }
441                 }
442                 break;
443
444         case 22:
445                 if (name) return _("サキュバスの接吻", "Kiss of Succubus");
446                 if (desc) return _("因果混乱の球を放つ。", "Fires a ball of nexus.");
447
448                 {
449                         HIT_POINT dam = 100 + plev * 2;
450                         POSITION rad = 4;
451
452                         if (info) return info_damage(0, 0, dam);
453
454                         if (cast)
455                         {
456                                 if (!get_aim_dir(&dir)) return NULL;
457                                 fire_ball(GF_NEXUS, dir, dam, rad);
458                         }
459                 }
460                 break;
461
462         case 23:
463                 if (name) return _("破滅の手", "Doom Hand");
464                 if (desc) return _("破滅の手を放つ。食らったモンスターはそのときのHPの半分前後のダメージを受ける。", "Attempts to make a monster's HP almost half.");
465
466                 {
467                         if (cast)
468                         {
469                                 if (!get_aim_dir(&dir))
470                                         return NULL;
471                                 else
472                                         msg_print(_("<破滅の手>を放った!", "You invoke the Hand of Doom!"));
473
474                                 fire_ball_hide(GF_HAND_DOOM, dir, plev * 2, 0);
475                         }
476                 }
477                 break;
478
479         case 24:
480                 if (name) return _("士気高揚", "Raise the Morale");
481                 if (desc) return _("一定時間、ヒーロー気分になる。", "Removes fear, and gives bonus to hit and 10 more HP for a while.");
482
483                 {
484                         int base = 25;
485                         if (info) return info_duration(base, base);
486                         if (cast)heroism(base);
487                 }
488                 break;
489
490         case 25:
491                 if (name) return _("不滅の肉体", "Immortal Body");
492                 if (desc) return _("一定時間、時間逆転への耐性を得る。", "Gives resistance to time for a while.");
493
494                 {
495                         int base = 20;
496
497                         if (info) return info_duration(base, base);
498
499                         if (cast)
500                         {
501                                 set_tim_res_time(randint1(base) + base, FALSE);
502                         }
503                 }
504                 break;
505
506         case 26:
507                 if (name) return _("狂気の円環", "Insanity Circle");
508                 if (desc) return _("自分を中心としたカオスの球、混乱の球を発生させ、近くのモンスターを魅了する。",
509                         "Generate balls of chaos, confusion and charm centered on you.");
510
511                 {
512                         HIT_POINT dam = 50 + plev;
513                         int power = 20 + plev;
514                         POSITION rad = 3 + plev / 20;
515
516                         if (info) return format("%s%d+%d", s_dam, dam / 2, dam / 2);
517
518                         if (cast)
519                         {
520                                 fire_ball(GF_CHAOS, 0, dam, rad);
521                                 fire_ball(GF_CONFUSION, 0, dam, rad);
522                                 fire_ball(GF_CHARM, 0, power, rad);
523                         }
524                 }
525                 break;
526
527         case 27:
528                 if (name) return _("ペット爆破", "Explode Pets");
529                 if (desc) return _("全てのペットを強制的に爆破させる。", "Makes all pets explode.");
530
531                 {
532                         if (cast)
533                         {
534                                 discharge_minion();
535                         }
536                 }
537                 break;
538
539         case 28:
540                 if (name) return _("グレーターデーモン召喚", "Summon Greater Demon");
541                 if (desc) return _("上級デーモンを召喚する。召喚するには人間('p','h','t'で表されるモンスター)の死体を捧げなければならない。",
542                         "Summons greater demon. It need to sacrifice a corpse of human ('p','h' or 't').");
543
544                 {
545                         if (cast)
546                         {
547                                 if (!cast_summon_greater_demon()) return NULL;
548                         }
549                 }
550                 break;
551
552         case 29:
553                 if (name) return _("地獄嵐", "Nether Storm");
554                 if (desc) return _("超巨大な地獄の球を放つ。", "Generate a huge ball of nether.");
555
556                 {
557                         HIT_POINT dam = plev * 15;
558                         POSITION rad = plev / 5;
559
560                         if (info) return info_damage(0, 0, dam);
561
562                         if (cast)
563                         {
564                                 if (!get_aim_dir(&dir)) return NULL;
565
566                                 fire_ball(GF_NETHER, dir, dam, rad);
567                         }
568                 }
569                 break;
570
571         case 30:
572                 if (name) return _("血の呪い", "Bloody Curse");
573                 if (desc) return _("自分がダメージを受けることによって対象に呪いをかけ、ダメージを与え様々な効果を引き起こす。",
574                         "Puts blood curse which damages and causes various effects on a monster. You also take damage.");
575
576                 {
577                         HIT_POINT dam = 600;
578                         POSITION rad = 0;
579
580                         if (info) return info_damage(0, 0, dam);
581
582                         if (cast)
583                         {
584                                 if (!get_aim_dir(&dir)) return NULL;
585
586                                 fire_ball_hide(GF_BLOOD_CURSE, dir, dam, rad);
587                                 take_hit(DAMAGE_USELIFE, 20 + randint1(30), _("血の呪い", "Blood curse"), -1);
588                         }
589                 }
590                 break;
591
592         case 31:
593                 if (name) return _("魔王変化", "Polymorph Demonlord");
594                 if (desc) return _("悪魔の王に変化する。変化している間は本来の種族の能力を失い、代わりに悪魔の王としての能力を得、壁を破壊しながら歩く。",
595                         "Mimic a demon lord for a while. Loses abilities of original race and gets great abilities as a demon lord. Even hard walls can't stop your walking.");
596
597                 {
598                         int base = 15;
599
600                         if (info) return info_duration(base, base);
601
602                         if (cast)
603                         {
604                                 set_mimic(base + randint1(base), MIMIC_DEMON_LORD, FALSE);
605                         }
606                 }
607                 break;
608         }
609
610         return "";
611 }
612