OSDN Git Service

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