OSDN Git Service

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