OSDN Git Service

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