OSDN Git Service

[Refactor] #37287 #37353 型の置換。 / Type replacement.
[hengband/hengband.git] / src / realm-life.c
1 #include "angband.h"
2 #include "cmd-spell.h"
3
4 /*!
5 * @brief 生命領域魔法の各処理を行う
6 * @param spell 魔法ID
7 * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
8 * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
9 */
10 cptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
11 {
12         bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
13         bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
14         bool info = (mode == SPELL_INFO) ? TRUE : FALSE;
15         bool cast = (mode == SPELL_CAST) ? TRUE : FALSE;
16
17         DIRECTION dir;
18         int plev = p_ptr->lev;
19
20         switch (spell)
21         {
22         case 0:
23                 if (name) return _("軽傷の治癒", "Cure Light Wounds");
24                 if (desc) return _("怪我と体力を少し回復させる。", "Heals cut and HP a little.");
25                 {
26                         int dice = 2;
27                         int sides = 10;
28                         if (info) return info_heal(dice, sides, 0);
29                         if (cast) (void)cure_light_wounds(dice, sides);                 
30                 }
31                 break;
32
33         case 1:
34                 if (name) return _("祝福", "Bless");
35                 if (desc) return _("一定時間、命中率とACにボーナスを得る。", "Gives bonus to hit and AC for a few turns.");
36                 {
37                         int base = 12;
38
39                         if (info) return info_duration(base, base);
40
41                         if (cast)
42                         {
43                                 set_blessed(randint1(base) + base, FALSE);
44                         }
45                 }
46                 break;
47
48         case 2:
49                 if (name) return _("軽傷", "Cause Light Wounds");
50                 if (desc) return _("1体のモンスターに小ダメージを与える。抵抗されると無効。", "Wounds a monster a little unless resisted.");
51                 {
52                         int dice = 3 + (plev - 1) / 5;
53                         int sides = 4;
54
55                         if (info) return info_damage(dice, sides, 0);
56
57                         if (cast)
58                         {
59                                 if (!get_aim_dir(&dir)) return NULL;
60                                 fire_ball_hide(GF_WOUNDS, dir, damroll(dice, sides), 0);
61                         }
62                 }
63                 break;
64
65         case 3:
66                 if (name) return _("光の召喚", "Call Light");
67                 if (desc) return _("光源が照らしている範囲か部屋全体を永久に明るくする。", "Lights up nearby area and the inside of a room permanently.");
68                 {
69                         int dice = 2;
70                         int sides = plev / 2;
71                         int rad = plev / 10 + 1;
72
73                         if (info) return info_damage(dice, sides, 0);
74
75                         if (cast)
76                         {
77                                 lite_area(damroll(dice, sides), rad);
78                         }
79                 }
80                 break;
81
82         case 4:
83                 if (name) return _("罠 & 隠し扉感知", "Detect Doors & Traps");
84                 if (desc) return _("近くの全ての罠と扉と階段を感知する。", "Detects traps, doors, and stairs in your vicinity.");
85                 {
86                         int rad = DETECT_RAD_DEFAULT;
87
88                         if (info) return info_radius(rad);
89
90                         if (cast)
91                         {
92                                 detect_traps(rad, TRUE);
93                                 detect_doors(rad);
94                                 detect_stairs(rad);
95                         }
96                 }
97                 break;
98
99         case 5:
100                 if (name) return _("重傷の治癒", "Cure Medium Wounds");
101                 if (desc) return _("怪我と体力を中程度回復させる。", "Heals cut and HP more.");
102                 {
103                         int dice = 4;
104                         int sides = 10;
105
106                         if (info) return info_heal(dice, sides, 0);
107                         if (cast) (void)cure_serious_wounds(dice, sides);
108                 }
109                 break;
110
111         case 6:
112                 if (name) return _("解毒", "Cure Poison");
113                 if (desc) return _("体内の毒を取り除く。", "Cure poison status.");
114                 {
115                         if (cast)
116                         {
117                                 set_poisoned(0);
118                         }
119                 }
120                 break;
121
122         case 7:
123                 if (name) return _("空腹充足", "Satisfy Hunger");
124                 if (desc) return _("満腹にする。", "Satisfies hunger.");
125                 {
126                         if (cast)
127                         {
128                                 set_food(PY_FOOD_MAX - 1);
129                         }
130                 }
131                 break;
132
133         case 8:
134                 if (name) return _("解呪", "Remove Curse");
135                 if (desc) return _("アイテムにかかった弱い呪いを解除する。", "Removes normal curses from equipped items.");
136                 {
137                         if (cast)
138                         {
139                                 if (remove_curse())
140                                 {
141                                         msg_print(_("誰かに見守られているような気がする。", "You feel as if someone is watching over you."));
142                                 }
143                         }
144                 }
145                 break;
146
147         case 9:
148                 if (name) return _("重傷", "Cause Medium Wounds");
149                 if (desc) return _("1体のモンスターに中ダメージを与える。抵抗されると無効。", "Wounds a monster unless resisted.");
150                 {
151                         int sides = 8 + (plev - 5) / 4;
152                         int dice = 8;
153
154                         if (info) return info_damage(dice, sides, 0);
155
156                         if (cast)
157                         {
158                                 if (!get_aim_dir(&dir)) return NULL;
159                                 fire_ball_hide(GF_WOUNDS, dir, damroll(dice, sides), 0);
160                         }
161                 }
162                 break;
163
164         case 10:
165                 if (name) return _("致命傷の治癒", "Cure Critical Wounds");
166                 if (desc) return _("体力を大幅に回復させ、負傷と朦朧状態も全快する。", "Heals cut, stun and HP greatly.");
167                 {
168                         int dice = 8;
169                         int sides = 10;
170
171                         if (info) return info_heal(dice, sides, 0);
172                         if (cast) (void)cure_critical_wounds(damroll(dice, sides));
173                 }
174                 break;
175
176         case 11:
177                 if (name) return _("耐熱耐寒", "Resist Heat and Cold");
178                 if (desc) return _("一定時間、火炎と冷気に対する耐性を得る。装備による耐性に累積する。",
179                         "Gives resistance to fire and cold. These resistances can be added to which from equipment for more powerful resistances.");
180
181                 {
182                         int base = 20;
183
184                         if (info) return info_duration(base, base);
185
186                         if (cast)
187                         {
188                                 set_oppose_cold(randint1(base) + base, FALSE);
189                                 set_oppose_fire(randint1(base) + base, FALSE);
190                         }
191                 }
192                 break;
193
194         case 12:
195                 if (name) return _("周辺感知", "Sense Surroundings");
196                 if (desc) return _("周辺の地形を感知する。", "Maps nearby area.");
197
198                 {
199                         int rad = DETECT_RAD_MAP;
200
201                         if (info) return info_radius(rad);
202
203                         if (cast)
204                         {
205                                 map_area(rad);
206                         }
207                 }
208                 break;
209
210         case 13:
211                 if (name) return _("パニック・アンデッド", "Turn Undead");
212                 if (desc) return _("視界内のアンデッドを恐怖させる。抵抗されると無効。", "Attempts to scare undead monsters in sight.");
213
214                 {
215                         if (cast)
216                         {
217                                 turn_undead();
218                         }
219                 }
220                 break;
221
222         case 14:
223                 if (name) return _("体力回復", "Healing");
224                 if (desc) return _("極めて強力な回復呪文で、負傷と朦朧状態も全快する。", "Much powerful healing magic, and heals cut and stun completely.");
225
226                 {
227                         int heal = 300;
228                         if (info) return info_heal(0, 0, heal);
229                         if (cast) (void)cure_critical_wounds(heal);
230                 }
231                 break;
232
233         case 15:
234                 if (name) return _("結界の紋章", "Glyph of Warding");
235                 if (desc) return _("自分のいる床の上に、モンスターが通り抜けたり召喚されたりすることができなくなるルーンを描く。",
236                         "Sets a glyph on the floor beneath you. Monsters cannot attack you if you are on a glyph, but can try to break glyph.");
237
238                 {
239                         if (cast)
240                         {
241                                 warding_glyph();
242                         }
243                 }
244                 break;
245
246         case 16:
247                 if (name) return _("*解呪*", "Dispel Curse");
248                 if (desc) return _("アイテムにかかった強力な呪いを解除する。", "Removes normal and heavy curse from equipped items.");
249
250                 {
251                         if (cast)
252                         {
253                                 if (remove_all_curse())
254                                 {
255                                         msg_print(_("誰かに見守られているような気がする。", "You feel as if someone is watching over you."));
256                                 }
257                         }
258                 }
259                 break;
260
261         case 17:
262                 if (name) return _("鑑識", "Perception");
263                 if (desc) return _("アイテムを識別する。", "Identifies an item.");
264
265                 {
266                         if (cast)
267                         {
268                                 if (!ident_spell(FALSE)) return NULL;
269                         }
270                 }
271                 break;
272
273         case 18:
274                 if (name) return _("アンデッド退散", "Dispel Undead");
275                 if (desc) return _("視界内の全てのアンデッドにダメージを与える。", "Damages all undead monsters in sight.");
276
277                 {
278                         int dice = 1;
279                         int sides = plev * 5;
280
281                         if (info) return info_damage(dice, sides, 0);
282
283                         if (cast)
284                         {
285                                 dispel_undead(damroll(dice, sides));
286                         }
287                 }
288                 break;
289
290         case 19:
291                 if (name) return _("凪の刻", "Day of the Dove");
292                 if (desc) return _("視界内の全てのモンスターを魅了する。抵抗されると無効。", "Attempts to charm all monsters in sight.");
293
294                 {
295                         int power = plev * 2;
296
297                         if (info) return info_power(power);
298
299                         if (cast)
300                         {
301                                 charm_monsters(power);
302                         }
303                 }
304                 break;
305
306         case 20:
307                 if (name) return _("致命傷", "Cause Critical Wounds");
308                 if (desc) return _("1体のモンスターに大ダメージを与える。抵抗されると無効。", "Wounds a monster critically unless resisted.");
309
310                 {
311                         int dice = 5 + (plev - 5) / 3;
312                         int sides = 15;
313
314                         if (info) return info_damage(dice, sides, 0);
315
316                         if (cast)
317                         {
318                                 if (!get_aim_dir(&dir)) return NULL;
319                                 fire_ball_hide(GF_WOUNDS, dir, damroll(dice, sides), 0);
320                         }
321                 }
322                 break;
323
324         case 21:
325                 if (name) return _("帰還の詔", "Word of Recall");
326                 if (desc) return _("地上にいるときはダンジョンの最深階へ、ダンジョンにいるときは地上へと移動する。", "Recalls player from dungeon to town, or from town to the deepest level of dungeon.");
327
328                 {
329                         int base = 15;
330                         int sides = 20;
331
332                         if (info) return info_delay(base, sides);
333
334                         if (cast)
335                         {
336                                 if (!word_of_recall()) return NULL;
337                         }
338                 }
339                 break;
340
341         case 22:
342                 if (name) return _("真実の祭壇", "Alter Reality");
343                 if (desc) return _("現在の階を再構成する。", "Recreates current dungeon level.");
344
345                 {
346                         int base = 15;
347                         int sides = 20;
348
349                         if (info) return info_delay(base, sides);
350
351                         if (cast)
352                         {
353                                 alter_reality();
354                         }
355                 }
356                 break;
357
358         case 23:
359                 if (name) return _("真・結界", "Warding True");
360                 if (desc) return _("自分のいる床と周囲8マスの床の上に、モンスターが通り抜けたり召喚されたりすることができなくなるルーンを描く。", "Creates glyphs in all adjacent squares and under you.");
361
362                 {
363                         int rad = 1;
364
365                         if (info) return info_radius(rad);
366
367                         if (cast)
368                         {
369                                 warding_glyph();
370                                 glyph_creation();
371                         }
372                 }
373                 break;
374
375         case 24:
376                 if (name) return _("不毛化", "Sterilization");
377                 if (desc) return _("この階の増殖するモンスターが増殖できなくなる。", "Prevents any breeders on current level from breeding.");
378
379                 {
380                         if (cast)
381                         {
382                                 num_repro += MAX_REPRO;
383                         }
384                 }
385                 break;
386
387         case 25:
388                 if (name) return _("全感知", "Detection");
389                 if (desc) return _("近くの全てのモンスター、罠、扉、階段、財宝、そしてアイテムを感知する。", "Detects all monsters, traps, doors, stairs, treasures and items in your vicinity.");
390
391                 {
392                         int rad = DETECT_RAD_DEFAULT;
393
394                         if (info) return info_radius(rad);
395
396                         if (cast)
397                         {
398                                 detect_all(rad);
399                         }
400                 }
401                 break;
402
403         case 26:
404                 if (name) return _("アンデッド消滅", "Annihilate Undead");
405                 if (desc) return _("自分の周囲にいるアンデッドを現在の階から消し去る。抵抗されると無効。",
406                         "Eliminates all nearby undead monsters, exhausting you.  Powerful or unique monsters may be able to resist.");
407
408                 {
409                         int power = plev + 50;
410
411                         if (info) return info_power(power);
412
413                         if (cast)
414                         {
415                                 mass_genocide_undead(power, TRUE);
416                         }
417                 }
418                 break;
419
420         case 27:
421                 if (name) return _("千里眼", "Clairvoyance");
422                 if (desc) return _("その階全体を永久に照らし、ダンジョン内すべてのアイテムを感知する。", "Maps and lights whole dungeon level. Knows all objects location. And gives telepathy for a while.");
423
424                 {
425                         if (cast)
426                         {
427                                 wiz_lite(FALSE);
428                         }
429                 }
430                 break;
431
432         case 28:
433                 if (name) return _("全復活", "Restoration");
434                 if (desc) return _("すべてのステータスと経験値を回復する。", "Restores all stats and experience.");
435
436                 {
437                         if (cast)
438                         {
439                                 (void)restore_all_status();
440                                 restore_level();
441                         }
442                 }
443                 break;
444
445         case 29:
446                 if (name) return _("*体力回復*", "Healing True");
447                 if (desc) return _("最強の治癒の魔法で、負傷と朦朧状態も全快する。", "The greatest healing magic. Heals all HP, cut and stun.");
448
449                 {
450                         int heal = 2000;
451                         if (info) return info_heal(0, 0, heal);
452                         if (cast) (void)cure_critical_wounds(heal);
453                 }
454                 break;
455
456         case 30:
457                 if (name) return _("聖なるビジョン", "Holy Vision");
458                 if (desc) return _("アイテムの持つ能力を完全に知る。", "*Identifies* an item.");
459
460                 {
461                         if (cast)
462                         {
463                                 if (!identify_fully(FALSE)) return NULL;
464                         }
465                 }
466                 break;
467
468         case 31:
469                 if (name) return _("究極の耐性", "Ultimate Resistance");
470                 if (desc) return _("一定時間、あらゆる耐性を付け、ACと魔法防御能力を上昇させる。", "Gives ultimate resistance, bonus to AC and speed.");
471
472                 {
473                         TIME_EFFECT base = (TIME_EFFECT)plev / 2;
474
475                         if (info) return info_duration(base, base);
476
477                         if (cast)
478                         {
479                                 TIME_EFFECT v = randint1(base) + base;
480                                 set_fast(v, FALSE);
481                                 set_oppose_acid(v, FALSE);
482                                 set_oppose_elec(v, FALSE);
483                                 set_oppose_fire(v, FALSE);
484                                 set_oppose_cold(v, FALSE);
485                                 set_oppose_pois(v, FALSE);
486                                 set_ultimate_res(v, FALSE);
487                         }
488                 }
489                 break;
490         }
491
492         return "";
493 }