OSDN Git Service

[Refactor] ダンジョンフラグをFlagGroup化
[hengbandforosx/hengbandosx.git] / src / realm / realm-hissatsu.cpp
1 #include "realm/realm-hissatsu.h"
2 #include "artifact/fixed-art-types.h"
3 #include "cmd-action/cmd-attack.h"
4 #include "cmd-action/cmd-spell.h"
5 #include "cmd-item/cmd-throw.h"
6 #include "combat/combat-options-type.h"
7 #include "core/asking-player.h"
8 #include "core/player-redraw-types.h"
9 #include "core/player-update-types.h"
10 #include "core/stuff-handler.h"
11 #include "dungeon/dungeon-flag-types.h"
12 #include "dungeon/dungeon.h"
13 #include "effect/effect-characteristics.h"
14 #include "effect/effect-processor.h"
15 #include "effect/spells-effect-util.h"
16 #include "floor/cave.h"
17 #include "floor/geometry.h"
18 #include "grid/feature-flag-types.h"
19 #include "grid/feature.h"
20 #include "grid/grid.h"
21 #include "inventory/inventory-slot-types.h"
22 #include "io/input-key-acceptor.h"
23 #include "io/input-key-requester.h"
24 #include "mind/mind-ninja.h"
25 #include "monster-race/monster-race-hook.h"
26 #include "monster-race/monster-race.h"
27 #include "monster-race/race-flags7.h"
28 #include "monster/monster-describer.h"
29 #include "monster/monster-info.h"
30 #include "monster/monster-update.h"
31 #include "object-enchant/tr-types.h"
32 #include "object/object-flags.h"
33 #include "player-info/equipment-info.h"
34 #include "player/player-damage.h"
35 #include "player/player-move.h"
36 #include "spell-kind/earthquake.h"
37 #include "spell-kind/spells-detection.h"
38 #include "spell-kind/spells-launcher.h"
39 #include "spell-kind/spells-perception.h"
40 #include "spell-kind/spells-sight.h"
41 #include "spell-kind/spells-teleport.h"
42 #include "spell/spell-types.h"
43 #include "spell/technic-info-table.h"
44 #include "status/bad-status-setter.h"
45 #include "system/floor-type-definition.h"
46 #include "system/monster-race-definition.h"
47 #include "system/monster-type-definition.h"
48 #include "system/object-type-definition.h"
49 #include "system/player-type-definition.h"
50 #include "target/grid-selector.h"
51 #include "target/projection-path-calculator.h"
52 #include "target/target-getter.h"
53 #include "term/screen-processor.h"
54 #include "util/bit-flags-calculator.h"
55 #include "view/display-messages.h"
56 #include "world/world.h"
57
58 /*!
59  * @brief 剣術の各処理を行う
60  * @param caster_ptr プレーヤーへの参照ポインタ
61  * @param spell 剣術ID
62  * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_CAST)
63  * @return SPELL_NAME / SPELL_DESC 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
64  */
65 concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type mode)
66 {
67     bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
68     bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
69     bool cast = (mode == SPELL_CAST) ? TRUE : FALSE;
70
71     DIRECTION dir;
72     PLAYER_LEVEL plev = caster_ptr->lev;
73
74     switch (spell) {
75     case 0:
76         if (name)
77             return _("飛飯綱", "Tobi-Izuna");
78         if (desc)
79             return _("2マス離れたところにいるモンスターを攻撃する。", "Attacks a monster two squares away.");
80
81         if (cast) {
82             project_length = 2;
83             if (!get_aim_dir(caster_ptr, &dir))
84                 return NULL;
85
86             project_hook(caster_ptr, GF_ATTACK, dir, HISSATSU_2, PROJECT_STOP | PROJECT_KILL);
87         }
88         break;
89
90     case 1:
91         if (name)
92             return _("五月雨斬り", "3-Way Attack");
93         if (desc)
94             return _("3方向に対して攻撃する。", "Attacks in 3 directions at one time.");
95
96         if (cast) {
97             DIRECTION cdir;
98             POSITION y, x;
99
100             if (!get_direction(caster_ptr, &dir, FALSE, FALSE))
101                 return NULL;
102             if (dir == 5)
103                 return NULL;
104
105             for (cdir = 0; cdir < 8; cdir++) {
106                 if (cdd[cdir] == dir)
107                     break;
108             }
109
110             if (cdir == 8)
111                 return NULL;
112
113             y = caster_ptr->y + ddy_cdd[cdir];
114             x = caster_ptr->x + ddx_cdd[cdir];
115             if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
116                 do_cmd_attack(caster_ptr, y, x, HISSATSU_NONE);
117             else
118                 msg_print(_("攻撃は空を切った。", "You attack the empty air."));
119
120             y = caster_ptr->y + ddy_cdd[(cdir + 7) % 8];
121             x = caster_ptr->x + ddx_cdd[(cdir + 7) % 8];
122             if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
123                 do_cmd_attack(caster_ptr, y, x, HISSATSU_NONE);
124             else
125                 msg_print(_("攻撃は空を切った。", "You attack the empty air."));
126
127             y = caster_ptr->y + ddy_cdd[(cdir + 1) % 8];
128             x = caster_ptr->x + ddx_cdd[(cdir + 1) % 8];
129             if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
130                 do_cmd_attack(caster_ptr, y, x, HISSATSU_NONE);
131             else
132                 msg_print(_("攻撃は空を切った。", "You attack the empty air."));
133         }
134         break;
135
136     case 2:
137         if (name)
138             return _("ブーメラン", "Boomerang");
139         if (desc)
140             return _(
141                 "武器を手元に戻ってくるように投げる。戻ってこないこともある。", "Throws current weapon. It'll return to your hand unless the action failed.");
142
143         if (cast) {
144             if (!do_cmd_throw(caster_ptr, 1, TRUE, -1))
145                 return NULL;
146         }
147         break;
148
149     case 3:
150         if (name)
151             return _("焔霊", "Burning Strike");
152         if (desc)
153             return _("火炎耐性のないモンスターに大ダメージを与える。", "Attacks a monster with more damage unless it has resistance to fire.");
154
155         if (cast) {
156             POSITION y, x;
157
158             if (!get_direction(caster_ptr, &dir, FALSE, FALSE))
159                 return NULL;
160             if (dir == 5)
161                 return NULL;
162
163             y = caster_ptr->y + ddy[dir];
164             x = caster_ptr->x + ddx[dir];
165
166             if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
167                 do_cmd_attack(caster_ptr, y, x, HISSATSU_FIRE);
168             else {
169                 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
170                 return NULL;
171             }
172         }
173         break;
174
175     case 4:
176         if (name)
177             return _("殺気感知", "Detect Ferocity");
178         if (desc)
179             return _("近くの思考することができるモンスターを感知する。", "Detects all monsters except the mindless in your vicinity.");
180
181         if (cast) {
182             detect_monsters_mind(caster_ptr, DETECT_RAD_DEFAULT);
183         }
184         break;
185
186     case 5:
187         if (name)
188             return _("みね打ち", "Strike to Stun");
189         if (desc)
190             return _("相手にダメージを与えないが、朦朧とさせる。", "Attempts to stun a monster next to you.");
191
192         if (cast) {
193             POSITION y, x;
194
195             if (!get_direction(caster_ptr, &dir, FALSE, FALSE))
196                 return NULL;
197             if (dir == 5)
198                 return NULL;
199
200             y = caster_ptr->y + ddy[dir];
201             x = caster_ptr->x + ddx[dir];
202
203             if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
204                 do_cmd_attack(caster_ptr, y, x, HISSATSU_MINEUCHI);
205             else {
206                 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
207                 return NULL;
208             }
209         }
210         break;
211
212     case 6:
213         if (name)
214             return _("カウンター", "Counter");
215         if (desc)
216             return _("相手に攻撃されたときに反撃する。反撃するたびにMPを消費。",
217                 "Prepares to counterattack. When attacked by a monster, strikes back using SP each time.");
218
219         if (cast) {
220             if (caster_ptr->riding) {
221                 msg_print(_("乗馬中には無理だ。", "You cannot do it when riding."));
222                 return NULL;
223             }
224             msg_print(_("相手の攻撃に対して身構えた。", "You prepare to counterattack."));
225             caster_ptr->counter = TRUE;
226         }
227         break;
228
229     case 7:
230         if (name)
231             return _("払い抜け", "Harainuke");
232         if (desc)
233             return _("攻撃した後、反対側に抜ける。",
234                 "In one action, attacks a monster with your weapons normally and then moves to the space beyond the monster if that space is not blocked.");
235
236         if (cast) {
237             POSITION y, x;
238
239             if (caster_ptr->riding) {
240                 msg_print(_("乗馬中には無理だ。", "You cannot do it when riding."));
241                 return NULL;
242             }
243
244             if (!get_direction(caster_ptr, &dir, FALSE, FALSE))
245                 return NULL;
246
247             if (dir == 5)
248                 return NULL;
249             y = caster_ptr->y + ddy[dir];
250             x = caster_ptr->x + ddx[dir];
251
252             if (!caster_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
253                 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
254                 return NULL;
255             }
256
257             do_cmd_attack(caster_ptr, y, x, HISSATSU_NONE);
258
259             if (!player_can_enter(caster_ptr, caster_ptr->current_floor_ptr->grid_array[y][x].feat, 0)
260                 || is_trap(caster_ptr, caster_ptr->current_floor_ptr->grid_array[y][x].feat))
261                 break;
262
263             y += ddy[dir];
264             x += ddx[dir];
265
266             if (player_can_enter(caster_ptr, caster_ptr->current_floor_ptr->grid_array[y][x].feat, 0)
267                 && !is_trap(caster_ptr, caster_ptr->current_floor_ptr->grid_array[y][x].feat) && !caster_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
268                 msg_print(NULL);
269                 (void)move_player_effect(caster_ptr, y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP);
270             }
271         }
272         break;
273
274     case 8:
275         if (name)
276             return _("サーペンツタン", "Serpent's Tongue");
277         if (desc)
278             return _("毒耐性のないモンスターに大ダメージを与える。", "Attacks a monster with more damage unless it has resistance to poison.");
279
280         if (cast) {
281             POSITION y, x;
282
283             if (!get_direction(caster_ptr, &dir, FALSE, FALSE))
284                 return NULL;
285             if (dir == 5)
286                 return NULL;
287
288             y = caster_ptr->y + ddy[dir];
289             x = caster_ptr->x + ddx[dir];
290
291             if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
292                 do_cmd_attack(caster_ptr, y, x, HISSATSU_POISON);
293             else {
294                 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
295                 return NULL;
296             }
297         }
298         break;
299
300     case 9:
301         if (name)
302             return _("斬魔剣弐の太刀", "Zammaken");
303         if (desc)
304             return _("生命のない邪悪なモンスターに大ダメージを与えるが、他のモンスターには全く効果がない。",
305                 "Attacks an evil unliving monster with great damage. Has no effect on other monsters.");
306
307         if (cast) {
308             POSITION y, x;
309
310             if (!get_direction(caster_ptr, &dir, FALSE, FALSE))
311                 return NULL;
312             if (dir == 5)
313                 return NULL;
314
315             y = caster_ptr->y + ddy[dir];
316             x = caster_ptr->x + ddx[dir];
317
318             if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
319                 do_cmd_attack(caster_ptr, y, x, HISSATSU_ZANMA);
320             else {
321                 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
322                 return NULL;
323             }
324         }
325         break;
326
327     case 10:
328         if (name)
329             return _("裂風剣", "Wind Blast");
330         if (desc)
331             return _("攻撃した相手を後方へ吹き飛ばす。", "Attacks an adjacent monster and blows it away.");
332
333         if (cast) {
334             POSITION y, x;
335
336             if (!get_direction(caster_ptr, &dir, FALSE, FALSE))
337                 return NULL;
338             if (dir == 5)
339                 return NULL;
340
341             y = caster_ptr->y + ddy[dir];
342             x = caster_ptr->x + ddx[dir];
343
344             if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
345                 do_cmd_attack(caster_ptr, y, x, HISSATSU_NONE);
346             else {
347                 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
348                 return NULL;
349             }
350             if (d_info[caster_ptr->dungeon_idx].flags.has(DF::NO_MELEE)) {
351                 return "";
352             }
353             if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
354                 int i;
355                 POSITION ty = y, tx = x;
356                 POSITION oy = y, ox = x;
357                 MONSTER_IDX m_idx = caster_ptr->current_floor_ptr->grid_array[y][x].m_idx;
358                 monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[m_idx];
359                 GAME_TEXT m_name[MAX_NLEN];
360
361                 monster_desc(caster_ptr, m_name, m_ptr, 0);
362
363                 for (i = 0; i < 5; i++) {
364                     y += ddy[dir];
365                     x += ddx[dir];
366                     if (is_cave_empty_bold(caster_ptr, y, x)) {
367                         ty = y;
368                         tx = x;
369                     } else
370                         break;
371                 }
372                 if ((ty != oy) || (tx != ox)) {
373                     msg_format(_("%sを吹き飛ばした!", "You blow %s away!"), m_name);
374                     caster_ptr->current_floor_ptr->grid_array[oy][ox].m_idx = 0;
375                     caster_ptr->current_floor_ptr->grid_array[ty][tx].m_idx = m_idx;
376                     m_ptr->fy = ty;
377                     m_ptr->fx = tx;
378
379                     update_monster(caster_ptr, m_idx, TRUE);
380                     lite_spot(caster_ptr, oy, ox);
381                     lite_spot(caster_ptr, ty, tx);
382
383                     if (r_info[m_ptr->r_idx].flags7 & (RF7_LITE_MASK | RF7_DARK_MASK))
384                         caster_ptr->update |= (PU_MON_LITE);
385                 }
386             }
387         }
388         break;
389
390     case 11:
391         if (name)
392             return _("刀匠の目利き", "Judge");
393         if (desc)
394             return _("武器・防具を1つ識別する。レベル45以上で武器・防具の能力を完全に知ることができる。",
395                 "Identifies a weapon or armor. *Identifies* the item at level 45.");
396
397         if (cast) {
398             if (plev > 44) {
399                 if (!identify_fully(caster_ptr, TRUE, TV_NONE))
400                     return NULL;
401             } else {
402                 if (!ident_spell(caster_ptr, TRUE, TV_NONE))
403                     return NULL;
404             }
405         }
406         break;
407
408     case 12:
409         if (name)
410             return _("破岩斬", "Rock Smash");
411         if (desc)
412             return _("岩を壊し、岩石系のモンスターに大ダメージを与える。", "Breaks rock or greatly damages a monster made of rocks.");
413
414         if (cast) {
415             POSITION y, x;
416
417             if (!get_direction(caster_ptr, &dir, FALSE, FALSE))
418                 return NULL;
419             if (dir == 5)
420                 return NULL;
421
422             y = caster_ptr->y + ddy[dir];
423             x = caster_ptr->x + ddx[dir];
424
425             if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
426                 do_cmd_attack(caster_ptr, y, x, HISSATSU_HAGAN);
427
428             if (!cave_has_flag_bold(caster_ptr->current_floor_ptr, y, x, FF_HURT_ROCK))
429                 break;
430
431             /* Destroy the feature */
432             cave_alter_feat(caster_ptr, y, x, FF_HURT_ROCK);
433             caster_ptr->update |= (PU_FLOW);
434         }
435         break;
436
437     case 13:
438         if (name)
439             return _("乱れ雪月花", "Midare-Setsugekka");
440         if (desc)
441             return _("攻撃回数が増え、冷気耐性のないモンスターに大ダメージを与える。",
442                 "Attacks a monster with an increased number of attacks and more damage unless it has resistance to cold.");
443
444         if (cast) {
445             POSITION y, x;
446
447             if (!get_direction(caster_ptr, &dir, FALSE, FALSE))
448                 return NULL;
449             if (dir == 5)
450                 return NULL;
451
452             y = caster_ptr->y + ddy[dir];
453             x = caster_ptr->x + ddx[dir];
454
455             if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
456                 do_cmd_attack(caster_ptr, y, x, HISSATSU_COLD);
457             else {
458                 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
459                 return NULL;
460             }
461         }
462         break;
463
464     case 14:
465         if (name)
466             return _("急所突き", "Spot Aiming");
467         if (desc)
468             return _("モンスターを一撃で倒す攻撃を繰り出す。失敗すると1点しかダメージを与えられない。",
469                 "Attempts to kill a monster instantly. If that fails, causes only 1HP of damage.");
470
471         if (cast) {
472             POSITION y, x;
473
474             if (!get_direction(caster_ptr, &dir, FALSE, FALSE))
475                 return NULL;
476             if (dir == 5)
477                 return NULL;
478
479             y = caster_ptr->y + ddy[dir];
480             x = caster_ptr->x + ddx[dir];
481
482             if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
483                 do_cmd_attack(caster_ptr, y, x, HISSATSU_KYUSHO);
484             else {
485                 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
486                 return NULL;
487             }
488         }
489         break;
490
491     case 15:
492         if (name)
493             return _("魔神斬り", "Majingiri");
494         if (desc)
495             return _("会心の一撃で攻撃する。攻撃がかわされやすい。", "Attempts to attack with a critical hit, but this attack is easy to evade for a monster.");
496
497         if (cast) {
498             POSITION y, x;
499
500             if (!get_direction(caster_ptr, &dir, FALSE, FALSE))
501                 return NULL;
502             if (dir == 5)
503                 return NULL;
504
505             y = caster_ptr->y + ddy[dir];
506             x = caster_ptr->x + ddx[dir];
507
508             if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
509                 do_cmd_attack(caster_ptr, y, x, HISSATSU_MAJIN);
510             else {
511                 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
512                 return NULL;
513             }
514         }
515         break;
516
517     case 16:
518         if (name)
519             return _("捨て身", "Desperate Attack");
520         if (desc)
521             return _("強力な攻撃を繰り出す。次のターンまでの間、食らうダメージが増える。",
522                 "Attacks with all of your power, but all damage you take will be doubled for one turn.");
523
524         if (cast) {
525             POSITION y, x;
526
527             if (!get_direction(caster_ptr, &dir, FALSE, FALSE))
528                 return NULL;
529             if (dir == 5)
530                 return NULL;
531
532             y = caster_ptr->y + ddy[dir];
533             x = caster_ptr->x + ddx[dir];
534
535             if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
536                 do_cmd_attack(caster_ptr, y, x, HISSATSU_SUTEMI);
537             else {
538                 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
539                 return NULL;
540             }
541             caster_ptr->sutemi = TRUE;
542         }
543         break;
544
545     case 17:
546         if (name)
547             return _("雷撃鷲爪斬", "Lightning Eagle");
548         if (desc)
549             return _("電撃耐性のないモンスターに非常に大きいダメージを与える。", "Attacks a monster with more damage unless it has resistance to electricity.");
550
551         if (cast) {
552             POSITION y, x;
553
554             if (!get_direction(caster_ptr, &dir, FALSE, FALSE))
555                 return NULL;
556             if (dir == 5)
557                 return NULL;
558
559             y = caster_ptr->y + ddy[dir];
560             x = caster_ptr->x + ddx[dir];
561
562             if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
563                 do_cmd_attack(caster_ptr, y, x, HISSATSU_ELEC);
564             else {
565                 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
566                 return NULL;
567             }
568         }
569         break;
570
571     case 18:
572         if (name)
573             return _("入身", "Rush Attack");
574         if (desc)
575             return _("素早く相手に近寄り攻撃する。", "Steps close to a monster and attacks at the same time.");
576
577         if (cast) {
578             if (!rush_attack(caster_ptr, NULL))
579                 return NULL;
580         }
581         break;
582
583     case 19:
584         if (name)
585             return _("赤流渦", "Bloody Maelstrom");
586         if (desc)
587             return _("自分自身も傷を作りつつ、その傷が深いほど大きい威力で全方向の敵を攻撃できる。生きていないモンスターには効果がない。",
588                 "Attacks all adjacent monsters with power corresponding to your cuts. Then increases your cuts. Has no effect on unliving monsters.");
589
590         if (cast) {
591             POSITION y = 0, x = 0;
592
593             grid_type *g_ptr;
594             monster_type *m_ptr;
595
596             if (caster_ptr->cut < 300)
597                 set_cut(caster_ptr, caster_ptr->cut + 300);
598             else
599                 set_cut(caster_ptr, caster_ptr->cut * 2);
600
601             for (dir = 0; dir < 8; dir++) {
602                 y = caster_ptr->y + ddy_ddd[dir];
603                 x = caster_ptr->x + ddx_ddd[dir];
604                 g_ptr = &caster_ptr->current_floor_ptr->grid_array[y][x];
605                 m_ptr = &caster_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
606
607                 /* Hack -- attack monsters */
608                 if (g_ptr->m_idx && (m_ptr->ml || cave_has_flag_bold(caster_ptr->current_floor_ptr, y, x, FF_PROJECT))) {
609                     if (!monster_living(m_ptr->r_idx)) {
610                         GAME_TEXT m_name[MAX_NLEN];
611
612                         monster_desc(caster_ptr, m_name, m_ptr, 0);
613                         msg_format(_("%sには効果がない!", "%s is unharmed!"), m_name);
614                     } else
615                         do_cmd_attack(caster_ptr, y, x, HISSATSU_SEKIRYUKA);
616                 }
617             }
618         }
619         break;
620
621     case 20:
622         if (name)
623             return _("激震撃", "Earthquake Blow");
624         if (desc)
625             return _("地震を起こす。", "Shakes dungeon structure, and results in random swapping of floors and walls.");
626
627         if (cast) {
628             POSITION y, x;
629
630             if (!get_direction(caster_ptr, &dir, FALSE, FALSE))
631                 return NULL;
632             if (dir == 5)
633                 return NULL;
634
635             y = caster_ptr->y + ddy[dir];
636             x = caster_ptr->x + ddx[dir];
637
638             if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
639                 do_cmd_attack(caster_ptr, y, x, HISSATSU_QUAKE);
640             else
641                 earthquake(caster_ptr, caster_ptr->y, caster_ptr->x, 10, 0);
642         }
643         break;
644
645     case 21:
646         if (name)
647             return _("地走り", "Crack");
648         if (desc)
649             return _("衝撃波のビームを放つ。", "Fires a shock wave as a beam.");
650
651         if (cast) {
652             int total_damage = 0, basedam, i;
653             BIT_FLAGS flgs[TR_FLAG_SIZE];
654             object_type *o_ptr;
655             if (!get_aim_dir(caster_ptr, &dir))
656                 return NULL;
657             msg_print(_("武器を大きく振り下ろした。", "You swing your weapon downward."));
658             for (i = 0; i < 2; i++) {
659                 int damage;
660
661                 if (!has_melee_weapon(caster_ptr, INVEN_MAIN_HAND + i))
662                     break;
663                 o_ptr = &caster_ptr->inventory_list[INVEN_MAIN_HAND + i];
664                 basedam = (o_ptr->dd * (o_ptr->ds + 1)) * 50;
665                 damage = o_ptr->to_d * 100;
666                 object_flags(caster_ptr, o_ptr, flgs);
667                 if ((o_ptr->name1 == ART_VORPAL_BLADE) || (o_ptr->name1 == ART_CHAINSWORD)) {
668                     /* vorpal blade */
669                     basedam *= 5;
670                     basedam /= 3;
671                 } else if (has_flag(flgs, TR_VORPAL)) {
672                     /* vorpal flag only */
673                     basedam *= 11;
674                     basedam /= 9;
675                 }
676                 damage += basedam;
677                 damage *= caster_ptr->num_blow[i];
678                 total_damage += damage / 200;
679                 if (i)
680                     total_damage = total_damage * 7 / 10;
681             }
682             fire_beam(caster_ptr, GF_FORCE, dir, total_damage);
683         }
684         break;
685
686     case 22:
687         if (name)
688             return _("気迫の雄叫び", "War Cry");
689         if (desc)
690             return _("視界内の全モンスターに対して轟音の攻撃を行う。さらに、近くにいるモンスターを怒らせる。",
691                 "Damages all monsters in sight with sound. Aggravates nearby monsters.");
692
693         if (cast) {
694             msg_print(_("雄叫びをあげた!", "You roar!"));
695             project_all_los(caster_ptr, GF_SOUND, randint1(plev * 3));
696             aggravate_monsters(caster_ptr, 0);
697         }
698         break;
699
700     case 23:
701         if (name)
702             return _("無双三段", "Musou-Sandan");
703         if (desc)
704             return _("強力な3段攻撃を繰り出す。", "Attacks with three powerful strikes.");
705
706         if (cast) {
707             int i;
708
709             if (!get_direction(caster_ptr, &dir, FALSE, FALSE))
710                 return NULL;
711             if (dir == 5)
712                 return NULL;
713
714             for (i = 0; i < 3; i++) {
715                 POSITION y, x;
716                 POSITION ny, nx;
717                 MONSTER_IDX m_idx;
718                 grid_type *g_ptr;
719                 monster_type *m_ptr;
720
721                 y = caster_ptr->y + ddy[dir];
722                 x = caster_ptr->x + ddx[dir];
723                 g_ptr = &caster_ptr->current_floor_ptr->grid_array[y][x];
724
725                 if (g_ptr->m_idx)
726                     do_cmd_attack(caster_ptr, y, x, HISSATSU_3DAN);
727                 else {
728                     msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
729                     return NULL;
730                 }
731
732                 if (d_info[caster_ptr->dungeon_idx].flags.has(DF::NO_MELEE)) {
733                     return "";
734                 }
735
736                 /* Monster is dead? */
737                 if (!g_ptr->m_idx)
738                     break;
739
740                 ny = y + ddy[dir];
741                 nx = x + ddx[dir];
742                 m_idx = g_ptr->m_idx;
743                 m_ptr = &caster_ptr->current_floor_ptr->m_list[m_idx];
744
745                 /* Monster cannot move back? */
746                 if (!monster_can_enter(caster_ptr, ny, nx, &r_info[m_ptr->r_idx], 0)) {
747                     /* -more- */
748                     if (i < 2)
749                         msg_print(NULL);
750                     continue;
751                 }
752
753                 g_ptr->m_idx = 0;
754                 caster_ptr->current_floor_ptr->grid_array[ny][nx].m_idx = m_idx;
755                 m_ptr->fy = ny;
756                 m_ptr->fx = nx;
757
758                 update_monster(caster_ptr, m_idx, TRUE);
759
760                 /* Redraw the old spot */
761                 lite_spot(caster_ptr, y, x);
762
763                 /* Redraw the new spot */
764                 lite_spot(caster_ptr, ny, nx);
765
766                 /* Player can move forward? */
767                 if (player_can_enter(caster_ptr, g_ptr->feat, 0)) {
768                     if (!move_player_effect(caster_ptr, y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP))
769                         break;
770                 } else {
771                     break;
772                 }
773
774                 /* -more- */
775                 if (i < 2)
776                     msg_print(NULL);
777             }
778         }
779         break;
780
781     case 24:
782         if (name)
783             return _("吸血鬼の牙", "Vampire's Fang");
784         if (desc)
785             return _("攻撃した相手の体力を吸いとり、自分の体力を回復させる。生命を持たないモンスターには通じない。",
786                 "Attacks with vampiric strikes which absorb HP from a monster and heal you. Has no effect on unliving monsters.");
787
788         if (cast) {
789             POSITION y, x;
790
791             if (!get_direction(caster_ptr, &dir, FALSE, FALSE))
792                 return NULL;
793             if (dir == 5)
794                 return NULL;
795
796             y = caster_ptr->y + ddy[dir];
797             x = caster_ptr->x + ddx[dir];
798
799             if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
800                 do_cmd_attack(caster_ptr, y, x, HISSATSU_DRAIN);
801             else {
802                 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
803                 return NULL;
804             }
805         }
806         break;
807
808     case 25:
809         if (name)
810             return _("幻惑", "Moon Dazzling");
811         if (desc)
812             return _("視界内の起きている全モンスターに朦朧、混乱、眠りを与えようとする。", "Attempts to stun, confuse and put to sleep all waking monsters.");
813
814         if (cast) {
815             msg_print(_("武器を不規則に揺らした...", "You irregularly wave your weapon..."));
816             project_all_los(caster_ptr, GF_ENGETSU, plev * 4);
817         }
818         break;
819
820     case 26:
821         if (name)
822             return _("百人斬り", "Hundred Slaughter");
823         if (desc)
824             return _("連続して入身でモンスターを攻撃する。攻撃するたびにMPを消費。MPがなくなるか、モンスターを倒せなかったら百人斬りは終了する。",
825                 "Performs a series of rush attacks. The series continues as long as the attacked monster dies and you have sufficient SP.");
826
827         if (cast) {
828             const int mana_cost_per_monster = 8;
829             bool is_new = TRUE;
830             bool mdeath;
831
832             do {
833                 if (!rush_attack(caster_ptr, &mdeath))
834                     break;
835                 if (is_new) {
836                     /* Reserve needed mana point */
837                     caster_ptr->csp -= technic_info[REALM_HISSATSU - MIN_TECHNIC][26].smana;
838                     is_new = FALSE;
839                 } else
840                     caster_ptr->csp -= mana_cost_per_monster;
841
842                 if (!mdeath)
843                     break;
844                 command_dir = 0;
845
846                 caster_ptr->redraw |= PR_MANA;
847                 handle_stuff(caster_ptr);
848             } while (caster_ptr->csp > mana_cost_per_monster);
849
850             if (is_new)
851                 return NULL;
852
853             /* Restore reserved mana */
854             caster_ptr->csp += technic_info[REALM_HISSATSU - MIN_TECHNIC][26].smana;
855         }
856         break;
857
858     case 27:
859         if (name)
860             return _("天翔龍閃", "Dragonic Flash");
861         if (desc)
862             return _("視界内の場所を指定して、その場所と自分の間にいる全モンスターを攻撃し、その場所に移動する。",
863                 "Runs toward given location while attacking all monsters on the path.");
864
865         if (cast) {
866             POSITION y, x;
867
868             if (!tgt_pt(caster_ptr, &x, &y))
869                 return NULL;
870
871             if (!cave_player_teleportable_bold(caster_ptr, y, x, TELEPORT_SPONTANEOUS) || (distance(y, x, caster_ptr->y, caster_ptr->x) > MAX_SIGHT / 2)
872                 || !projectable(caster_ptr, caster_ptr->y, caster_ptr->x, y, x)) {
873                 msg_print(_("失敗!", "You cannot move to that place!"));
874                 break;
875             }
876             if (caster_ptr->anti_tele) {
877                 msg_print(_("不思議な力がテレポートを防いだ!", "A mysterious force prevents you from teleporting!"));
878                 break;
879             }
880             project(caster_ptr, 0, 0, y, x, HISSATSU_ISSEN, GF_ATTACK, PROJECT_BEAM | PROJECT_KILL);
881             teleport_player_to(caster_ptr, y, x, TELEPORT_SPONTANEOUS);
882         }
883         break;
884
885     case 28:
886         if (name)
887             return _("二重の剣撃", "Twin Slash");
888         if (desc)
889             return _("1ターンで2度攻撃を行う。", "Attack twice in one turn.");
890
891         if (cast) {
892             POSITION x, y;
893
894             if (!get_rep_dir(caster_ptr, &dir, FALSE))
895                 return NULL;
896
897             y = caster_ptr->y + ddy[dir];
898             x = caster_ptr->x + ddx[dir];
899
900             if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
901                 do_cmd_attack(caster_ptr, y, x, HISSATSU_NONE);
902                 if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
903                     handle_stuff(caster_ptr);
904                     do_cmd_attack(caster_ptr, y, x, HISSATSU_NONE);
905                 }
906             } else {
907                 msg_print(_("その方向にはモンスターはいません。", "You don't see any monster in this direction"));
908                 return NULL;
909             }
910         }
911         break;
912
913     case 29:
914         if (name)
915             return _("虎伏絶刀勢", "Kofuku-Zettousei");
916         if (desc)
917             return _("強力な攻撃を行い、近くの場所にも効果が及ぶ。", "Performs a powerful attack which even affects nearby monsters.");
918
919         if (cast) {
920             int total_damage = 0, basedam, i;
921             POSITION y, x;
922             BIT_FLAGS flgs[TR_FLAG_SIZE];
923             object_type *o_ptr;
924
925             if (!get_direction(caster_ptr, &dir, FALSE, FALSE))
926                 return NULL;
927             if (dir == 5)
928                 return NULL;
929
930             y = caster_ptr->y + ddy[dir];
931             x = caster_ptr->x + ddx[dir];
932
933             if (d_info[caster_ptr->dungeon_idx].flags.has(DF::NO_MELEE)) {
934                 msg_print(_("なぜか攻撃することができない。", "Something prevents you from attacking."));
935                 return "";
936             }
937             msg_print(_("武器を大きく振り下ろした。", "You swing your weapon downward."));
938             for (i = 0; i < 2; i++) {
939                 int damage;
940                 if (!has_melee_weapon(caster_ptr, INVEN_MAIN_HAND + i))
941                     break;
942                 o_ptr = &caster_ptr->inventory_list[INVEN_MAIN_HAND + i];
943                 basedam = (o_ptr->dd * (o_ptr->ds + 1)) * 50;
944                 damage = o_ptr->to_d * 100;
945                 object_flags(caster_ptr, o_ptr, flgs);
946                 if ((o_ptr->name1 == ART_VORPAL_BLADE) || (o_ptr->name1 == ART_CHAINSWORD)) {
947                     /* vorpal blade */
948                     basedam *= 5;
949                     basedam /= 3;
950                 } else if (has_flag(flgs, TR_VORPAL)) {
951                     /* vorpal flag only */
952                     basedam *= 11;
953                     basedam /= 9;
954                 }
955                 damage += basedam;
956                 damage += caster_ptr->to_d[i] * 100;
957                 damage *= caster_ptr->num_blow[i];
958                 total_damage += (damage / 100);
959             }
960             project(caster_ptr, 0, (cave_has_flag_bold(caster_ptr->current_floor_ptr, y, x, FF_PROJECT) ? 5 : 0), y, x, total_damage * 3 / 2, GF_METEOR,
961                 PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM);
962         }
963         break;
964
965     case 30:
966         if (name)
967             return _("慶雲鬼忍剣", "Keiun-Kininken");
968         if (desc)
969             return _("自分もダメージをくらうが、相手に非常に大きなダメージを与える。アンデッドには特に効果がある。",
970                 "Attacks a monster with extremely powerful damage, but you also take some damage. Hurts an undead monster greatly.");
971
972         if (cast) {
973             POSITION y, x;
974
975             if (!get_direction(caster_ptr, &dir, FALSE, FALSE))
976                 return NULL;
977             if (dir == 5)
978                 return NULL;
979
980             y = caster_ptr->y + ddy[dir];
981             x = caster_ptr->x + ddx[dir];
982
983             if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
984                 do_cmd_attack(caster_ptr, y, x, HISSATSU_UNDEAD);
985             else {
986                 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
987                 return NULL;
988             }
989             take_hit(caster_ptr, DAMAGE_NOESCAPE, 100 + randint1(100), _("慶雲鬼忍剣を使った衝撃", "exhaustion on using Keiun-Kininken"));
990         }
991         break;
992
993     case 31:
994         if (name)
995             return _("切腹", "Harakiri");
996         if (desc)
997             return _("「武士道とは、死ぬことと見つけたり。」", "'Bushido, the way of warriors, is found in death'");
998
999         if (cast) {
1000             int i;
1001             if (!get_check(_("本当に自殺しますか?", "Do you really want to commit suicide? ")))
1002                 return NULL;
1003             /* Special Verification for suicide */
1004             prt(_("確認のため '@' を押して下さい。", "Please verify SUICIDE by typing the '@' sign: "), 0, 0);
1005
1006             flush();
1007             i = inkey();
1008             prt("", 0, 0);
1009             if (i != '@')
1010                 return NULL;
1011             if (current_world_ptr->total_winner) {
1012                 take_hit(caster_ptr, DAMAGE_FORCE, 9999, "Seppuku");
1013                 current_world_ptr->total_winner = TRUE;
1014             } else {
1015                 msg_print(_("武士道とは、死ぬことと見つけたり。", "The meaning of bushido is found in death."));
1016                 take_hit(caster_ptr, DAMAGE_FORCE, 9999, "Seppuku");
1017             }
1018         }
1019         break;
1020     }
1021
1022     return "";
1023 }