OSDN Git Service

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