OSDN Git Service

Changed Japanese translation for "New" to match what was suggested in hengbandforosx...
[hengbandforosx/hengbandosx.git] / src / realm-arcane.c
1 #include "angband.h"
2 #include "cmd-spell.h"
3 #include "projection.h"
4 #include "avatar.h"
5
6 #include "spells-floor.h"
7 #include "spells-object.h"
8 #include "spells-summon.h"
9 #include "spells-status.h"
10
11 /*!
12 * @brief 秘術領域魔法の各処理を行う
13 * @param spell 魔法ID
14 * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
15 * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
16 */
17 concptr do_arcane_spell(SPELL_IDX spell, BIT_FLAGS mode)
18 {
19         bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
20         bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
21         bool info = (mode == SPELL_INFO) ? TRUE : FALSE;
22         bool cast = (mode == SPELL_CAST) ? TRUE : FALSE;
23
24         DIRECTION dir;
25         PLAYER_LEVEL plev = p_ptr->lev;
26
27         switch (spell)
28         {
29         case 0:
30                 if (name) return _("電撃", "Zap");
31                 if (desc) return _("電撃のボルトもしくはビームを放つ。", "Fires a bolt or beam of lightning.");
32
33                 {
34                         DICE_NUMBER dice = 3 + (plev - 1) / 5;
35                         DICE_SID sides = 3;
36
37                         if (info) return info_damage(dice, sides, 0);
38
39                         if (cast)
40                         {
41                                 if (!get_aim_dir(&dir)) return NULL;
42
43                                 fire_bolt_or_beam(beam_chance() - 10, GF_ELEC, dir, damroll(dice, sides));
44                         }
45                 }
46                 break;
47
48         case 1:
49                 if (name) return _("魔法の施錠", "Wizard Lock");
50                 if (desc) return _("扉に鍵をかける。", "Locks a door.");
51
52                 {
53                         if (cast)
54                         {
55                                 if (!get_aim_dir(&dir)) return NULL;
56
57                                 wizard_lock(dir);
58                         }
59                 }
60                 break;
61
62         case 2:
63                 if (name) return _("透明体感知", "Detect Invisibility");
64                 if (desc) return _("近くの透明なモンスターを感知する。", "Detects all invisible monsters in your vicinity.");
65
66                 {
67                         POSITION rad = DETECT_RAD_DEFAULT;
68
69                         if (info) return info_radius(rad);
70
71                         if (cast)
72                         {
73                                 detect_monsters_invis(rad);
74                         }
75                 }
76                 break;
77
78         case 3:
79                 if (name) return _("モンスター感知", "Detect Monsters");
80                 if (desc) return _("近くの全ての見えるモンスターを感知する。", "Detects all monsters in your vicinity unless invisible.");
81
82                 {
83                         POSITION rad = DETECT_RAD_DEFAULT;
84
85                         if (info) return info_radius(rad);
86
87                         if (cast)
88                         {
89                                 detect_monsters_normal(rad);
90                         }
91                 }
92                 break;
93
94         case 4:
95                 if (name) return _("ショート・テレポート", "Blink");
96                 if (desc) return _("近距離のテレポートをする。", "Teleports you a short distance.");
97
98                 {
99                         POSITION range = 10;
100
101                         if (info) return info_range(range);
102
103                         if (cast)
104                         {
105                                 teleport_player(range, 0L);
106                         }
107                 }
108                 break;
109
110         case 5:
111                 if (name) return _("ライト・エリア", "Light Area");
112                 if (desc) return _("光源が照らしている範囲か部屋全体を永久に明るくする。", "Lights up nearby area and the inside of a room permanently.");
113
114                 {
115                         DICE_NUMBER dice = 2;
116                         DICE_SID sides = plev / 2;
117                         POSITION rad = plev / 10 + 1;
118
119                         if (info) return info_damage(dice, sides, 0);
120
121                         if (cast)
122                         {
123                                 lite_area(damroll(dice, sides), rad);
124                         }
125                 }
126                 break;
127
128         case 6:
129                 if (name) return _("罠と扉 破壊", "Trap & Door Destruction");
130                 if (desc) return _("一直線上の全ての罠と扉を破壊する。", "Fires a beam which destroy traps and doors.");
131
132                 {
133                         if (cast)
134                         {
135                                 if (!get_aim_dir(&dir)) return NULL;
136
137                                 destroy_door(dir);
138                         }
139                 }
140                 break;
141
142         case 7:
143                 if (name) return _("軽傷の治癒", "Cure Light Wounds");
144                 if (desc) return _("怪我と体力を少し回復させる。", "Heals cuts and HP a little.");
145
146                 {
147                         DICE_NUMBER dice = 2;
148                         DICE_SID sides = 8;
149
150                         if (info) return info_heal(dice, sides, 0);
151                         if (cast) (void)cure_light_wounds(dice, sides);
152                 }
153                 break;
154
155         case 8:
156                 if (name) return _("罠と扉 感知", "Detect Doors & Traps");
157                 if (desc) return _("近くの全ての罠と扉と階段を感知する。", "Detects traps, doors, and stairs in your vicinity.");
158
159                 {
160                         POSITION rad = DETECT_RAD_DEFAULT;
161
162                         if (info) return info_radius(rad);
163
164                         if (cast)
165                         {
166                                 detect_traps(rad, TRUE);
167                                 detect_doors(rad);
168                                 detect_stairs(rad);
169                         }
170                 }
171                 break;
172
173         case 9:
174                 if (name) return _("燃素", "Phlogiston");
175                 if (desc) return _("光源に燃料を補給する。", "Adds more turns of light to a lantern or torch.");
176
177                 {
178                         if (cast)
179                         {
180                                 phlogiston();
181                         }
182                 }
183                 break;
184
185         case 10:
186                 if (name) return _("財宝感知", "Detect Treasure");
187                 if (desc) return _("近くの財宝を感知する。", "Detects all treasures in your vicinity.");
188
189                 {
190                         POSITION rad = DETECT_RAD_DEFAULT;
191
192                         if (info) return info_radius(rad);
193
194                         if (cast)
195                         {
196                                 detect_treasure(rad);
197                                 detect_objects_gold(rad);
198                         }
199                 }
200                 break;
201
202         case 11:
203                 if (name) return _("魔法 感知", "Detect Enchantment");
204                 if (desc) return _("近くの魔法がかかったアイテムを感知する。", "Detects all magical items in your vicinity.");
205
206                 {
207                         POSITION rad = DETECT_RAD_DEFAULT;
208
209                         if (info) return info_radius(rad);
210
211                         if (cast)
212                         {
213                                 detect_objects_magic(rad);
214                         }
215                 }
216                 break;
217
218         case 12:
219                 if (name) return _("アイテム感知", "Detect Objects");
220                 if (desc) return _("近くの全てのアイテムを感知する。", "Detects all items in your vicinity.");
221
222                 {
223                         POSITION rad = DETECT_RAD_DEFAULT;
224
225                         if (info) return info_radius(rad);
226
227                         if (cast)
228                         {
229                                 detect_objects_normal(rad);
230                         }
231                 }
232                 break;
233
234         case 13:
235                 if (name) return _("解毒", "Cure Poison");
236                 if (desc) return _("毒を体内から完全に取り除く。", "Cures poison status.");
237
238                 {
239                         if (cast)
240                         {
241                                 set_poisoned(0);
242                         }
243                 }
244                 break;
245
246         case 14:
247                 if (name) return _("耐冷", "Resist Cold");
248                 if (desc) return _("一定時間、冷気への耐性を得る。装備による耐性に累積する。", "Gives resistance to cold. This resistance can be added to that from equipment for more powerful resistance.");
249
250                 {
251                         int base = 20;
252
253                         if (info) return info_duration(base, base);
254
255                         if (cast)
256                         {
257                                 set_oppose_cold(randint1(base) + base, FALSE);
258                         }
259                 }
260                 break;
261
262         case 15:
263                 if (name) return _("耐火", "Resist Fire");
264                 if (desc) return _("一定時間、炎への耐性を得る。装備による耐性に累積する。",
265                         "Gives resistance to fire. This resistance can be added to that from equipment for more powerful resistance.");
266
267                 {
268                         int base = 20;
269
270                         if (info) return info_duration(base, base);
271
272                         if (cast)
273                         {
274                                 set_oppose_fire(randint1(base) + base, FALSE);
275                         }
276                 }
277                 break;
278
279         case 16:
280                 if (name) return _("耐電", "Resist Lightning");
281                 if (desc) return _("一定時間、電撃への耐性を得る。装備による耐性に累積する。",
282                         "Gives resistance to electricity. This resistance can be added to that from equipment for more powerful resistance.");
283
284                 {
285                         int base = 20;
286
287                         if (info) return info_duration(base, base);
288
289                         if (cast)
290                         {
291                                 set_oppose_elec(randint1(base) + base, FALSE);
292                         }
293                 }
294                 break;
295
296         case 17:
297                 if (name) return _("耐酸", "Resist Acid");
298                 if (desc) return _("一定時間、酸への耐性を得る。装備による耐性に累積する。",
299                         "Gives resistance to acid. This resistance can be added to that from equipment for more powerful resistance.");
300
301                 {
302                         int base = 20;
303
304                         if (info) return info_duration(base, base);
305
306                         if (cast)
307                         {
308                                 set_oppose_acid(randint1(base) + base, FALSE);
309                         }
310                 }
311                 break;
312
313         case 18:
314                 if (name) return _("重傷の治癒", "Cure Medium Wounds");
315                 if (desc) return _("怪我と体力を中程度回復させる。", "Heals cuts and HP.");
316
317                 {
318                         DICE_NUMBER dice = 4;
319                         DICE_SID sides = 8;
320
321                         if (info) return info_heal(dice, sides, 0);
322                         if (cast) (void)cure_serious_wounds(4, 8);
323                 }
324                 break;
325
326         case 19:
327                 if (name) return _("テレポート", "Teleport");
328                 if (desc) return _("遠距離のテレポートをする。", "Teleports you a long distance.");
329
330                 {
331                         POSITION range = plev * 5;
332
333                         if (info) return info_range(range);
334
335                         if (cast)
336                         {
337                                 teleport_player(range, 0L);
338                         }
339                 }
340                 break;
341
342         case 20:
343                 if (name) return _("鑑定", "Identify");
344                 if (desc) return _("アイテムを識別する。", "Identifies an item.");
345
346                 {
347                         if (cast)
348                         {
349                                 if (!ident_spell(FALSE)) return NULL;
350                         }
351                 }
352                 break;
353
354         case 21:
355                 if (name) return _("岩石溶解", "Stone to Mud");
356                 if (desc) return _("壁を溶かして床にする。", "Turns one rock square to mud.");
357
358                 {
359                         DICE_NUMBER dice = 1;
360                         DICE_SID sides = 30;
361                         int base = 20;
362
363                         if (info) return info_damage(dice, sides, base);
364
365                         if (cast)
366                         {
367                                 if (!get_aim_dir(&dir)) return NULL;
368
369                                 wall_to_mud(dir, 20 + randint1(30));
370                         }
371                 }
372                 break;
373
374         case 22:
375                 if (name) return _("閃光", "Ray of Light");
376                 if (desc) return _("光線を放つ。光りを嫌うモンスターに効果がある。", "Fires a beam of light which damages to light-sensitive monsters.");
377
378                 {
379                         DICE_NUMBER dice = 6;
380                         DICE_SID sides = 8;
381
382                         if (info) return info_damage(dice, sides, 0);
383
384                         if (cast)
385                         {
386                                 if (!get_aim_dir(&dir)) return NULL;
387
388                                 msg_print(_("光線が放たれた。", "A line of light appears."));
389                                 lite_line(dir, damroll(6, 8));
390                         }
391                 }
392                 break;
393
394         case 23:
395                 if (name) return _("空腹充足", "Satisfy Hunger");
396                 if (desc) return _("満腹にする。", "Satisfies hunger.");
397
398                 {
399                         if (cast)
400                         {
401                                 set_food(PY_FOOD_MAX - 1);
402                         }
403                 }
404                 break;
405
406         case 24:
407                 if (name) return _("透明視認", "See Invisible");
408                 if (desc) return _("一定時間、透明なものが見えるようになる。", "Gives see invisible for a while.");
409
410                 {
411                         int base = 24;
412
413                         if (info) return info_duration(base, base);
414
415                         if (cast)
416                         {
417                                 set_tim_invis(randint1(base) + base, FALSE);
418                         }
419                 }
420                 break;
421
422         case 25:
423                 if (name) return _("エレメンタル召喚", "Conjure Elemental");
424                 if (desc) return _("1体のエレメンタルを召喚する。", "Summons an elemental.");
425                 {
426                         if (cast)
427                         {
428                                 if (!summon_specific(-1, p_ptr->y, p_ptr->x, plev, SUMMON_ELEMENTAL, (PM_ALLOW_GROUP | PM_FORCE_PET), '\0'))
429                                 {
430                                         msg_print(_("エレメンタルは現れなかった。", "No Elementals arrive."));
431                                 }
432                         }
433                 }
434                 break;
435
436         case 26:
437                 if (name) return _("テレポート・レベル", "Teleport Level");
438                 if (desc) return _("瞬時に上か下の階にテレポートする。", "Instantly teleports you up or down a level.");
439
440                 {
441                         if (cast)
442                         {
443                                 if (!get_check(_("本当に他の階にテレポートしますか?", "Are you sure? (Teleport Level)"))) return NULL;
444                                 teleport_level(0);
445                         }
446                 }
447                 break;
448
449         case 27:
450                 if (name) return _("テレポート・モンスター", "Teleport Away");
451                 if (desc) return _("モンスターをテレポートさせるビームを放つ。抵抗されると無効。", "Teleports all monsters on the line away unless resisted.");
452
453                 {
454                         int power = plev;
455
456                         if (info) return info_power(power);
457
458                         if (cast)
459                         {
460                                 if (!get_aim_dir(&dir)) return NULL;
461
462                                 fire_beam(GF_AWAY_ALL, dir, power);
463                         }
464                 }
465                 break;
466
467         case 28:
468                 if (name) return _("元素の球", "Elemental Ball");
469                 if (desc) return _("炎、電撃、冷気、酸のどれかの球を放つ。", "Fires a ball of some elements.");
470
471                 {
472                         HIT_POINT dam = 75 + plev;
473                         POSITION rad = 2;
474
475                         if (info) return info_damage(0, 0, dam);
476
477                         if (cast)
478                         {
479                                 int type;
480
481                                 if (!get_aim_dir(&dir)) return NULL;
482
483                                 switch (randint1(4))
484                                 {
485                                 case 1:  type = GF_FIRE; break;
486                                 case 2:  type = GF_ELEC; break;
487                                 case 3:  type = GF_COLD; break;
488                                 default: type = GF_ACID; break;
489                                 }
490
491                                 fire_ball(type, dir, dam, rad);
492                         }
493                 }
494                 break;
495
496         case 29:
497                 if (name) return _("全感知", "Detection");
498                 if (desc) return _("近くの全てのモンスター、罠、扉、階段、財宝、そしてアイテムを感知する。",
499                         "Detects all monsters, traps, doors, stairs, treasures and items in your vicinity.");
500
501                 {
502                         POSITION rad = DETECT_RAD_DEFAULT;
503
504                         if (info) return info_radius(rad);
505
506                         if (cast)
507                         {
508                                 detect_all(rad);
509                         }
510                 }
511                 break;
512
513         case 30:
514                 if (name) return _("帰還の呪文", "Word of Recall");
515                 if (desc) return _("地上にいるときはダンジョンの最深階へ、ダンジョンにいるときは地上へと移動する。",
516                         "Recalls player from dungeon to town or from town to the deepest level of dungeon.");
517
518                 {
519                         int base = 15;
520                         DICE_SID sides = 20;
521
522                         if (info) return info_delay(base, sides);
523
524                         if (cast)
525                         {
526                                 if (!recall_player(p_ptr, randint0(21) + 15)) return NULL;
527                         }
528                 }
529                 break;
530
531         case 31:
532                 if (name) return _("千里眼", "Clairvoyance");
533                 if (desc) return _("その階全体を永久に照らし、ダンジョン内すべてのアイテムを感知する。さらに、一定時間テレパシー能力を得る。",
534                         "Maps and lights whole dungeon level. Reveals locations of all objects. Gives telepathy for a while.");
535
536                 {
537                         int base = 25;
538                         DICE_SID sides = 30;
539
540                         if (info) return info_duration(base, sides);
541
542                         if (cast)
543                         {
544                                 chg_virtue(V_KNOWLEDGE, 1);
545                                 chg_virtue(V_ENLIGHTEN, 1);
546
547                                 wiz_lite(FALSE);
548
549                                 if (!p_ptr->telepathy)
550                                 {
551                                         set_tim_esp(randint1(sides) + base, FALSE);
552                                 }
553                         }
554                 }
555                 break;
556         }
557
558         return "";
559 }