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/stuff-handler.h"
9 #include "dungeon/dungeon-flag-types.h"
10 #include "effect/attribute-types.h"
11 #include "effect/effect-characteristics.h"
12 #include "effect/effect-processor.h"
13 #include "effect/spells-effect-util.h"
14 #include "floor/cave.h"
15 #include "floor/geometry.h"
16 #include "grid/feature-flag-types.h"
17 #include "grid/feature.h"
18 #include "grid/grid.h"
19 #include "inventory/inventory-slot-types.h"
20 #include "io/input-key-acceptor.h"
21 #include "io/input-key-requester.h"
22 #include "mind/mind-ninja.h"
23 #include "monster-race/monster-race-hook.h"
24 #include "monster-race/monster-race.h"
25 #include "monster-race/race-brightness-mask.h"
26 #include "monster-race/race-flags7.h"
27 #include "monster/monster-describer.h"
28 #include "monster/monster-info.h"
29 #include "monster/monster-update.h"
30 #include "object-enchant/tr-types.h"
31 #include "object/object-flags.h"
32 #include "player-info/equipment-info.h"
33 #include "player/player-damage.h"
34 #include "player/player-move.h"
35 #include "spell-kind/earthquake.h"
36 #include "spell-kind/spells-detection.h"
37 #include "spell-kind/spells-launcher.h"
38 #include "spell-kind/spells-perception.h"
39 #include "spell-kind/spells-sight.h"
40 #include "spell-kind/spells-teleport.h"
41 #include "spell/technic-info-table.h"
42 #include "status/bad-status-setter.h"
43 #include "system/dungeon-info.h"
44 #include "system/floor-type-definition.h"
45 #include "system/grid-type-definition.h"
46 #include "system/item-entity.h"
47 #include "system/monster-entity.h"
48 #include "system/monster-race-info.h"
49 #include "system/player-type-definition.h"
50 #include "system/redrawing-flags-updater.h"
51 #include "target/grid-selector.h"
52 #include "target/projection-path-calculator.h"
53 #include "target/target-getter.h"
54 #include "term/screen-processor.h"
55 #include "timed-effect/player-cut.h"
56 #include "timed-effect/timed-effects.h"
57 #include "util/bit-flags-calculator.h"
58 #include "view/display-messages.h"
59 #include "world/world.h"
63 * @param player_ptr プレイヤーへの参照ポインタ
65 * @param mode 処理内容 (SpellProcessType::NAME / SPELL_DESC / SpellProcessType::CAST)
66 * @return SpellProcessType::NAME / SPELL_DESC 時には文字列を返す。SpellProcessType::CAST時は std::nullopt を返す。
68 std::optional<std::string> do_hissatsu_spell(PlayerType *player_ptr, SPELL_IDX spell, SpellProcessType mode)
70 bool name = mode == SpellProcessType::NAME;
71 bool desc = mode == SpellProcessType::DESCRIPTION;
72 bool cast = mode == SpellProcessType::CAST;
75 PLAYER_LEVEL plev = player_ptr->lev;
80 return _("飛飯綱", "Tobi-Izuna");
83 return _("2マス離れたところにいるモンスターを攻撃する。", "Attacks a monster two squares away.");
88 if (!get_aim_dir(player_ptr, &dir)) {
92 project_hook(player_ptr, AttributeType::ATTACK, dir, HISSATSU_2, PROJECT_STOP | PROJECT_KILL);
98 return _("五月雨斬り", "3-Way Attack");
101 return _("3方向に対して攻撃する。", "Attacks in 3 directions at one time.");
108 if (!get_direction(player_ptr, &dir, false, false)) {
115 for (cdir = 0; cdir < 8; cdir++) {
116 if (cdd[cdir] == dir) {
125 y = player_ptr->y + ddy_cdd[cdir];
126 x = player_ptr->x + ddx_cdd[cdir];
127 if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
128 do_cmd_attack(player_ptr, y, x, HISSATSU_NONE);
130 msg_print(_("攻撃は空を切った。", "You attack the empty air."));
133 y = player_ptr->y + ddy_cdd[(cdir + 7) % 8];
134 x = player_ptr->x + ddx_cdd[(cdir + 7) % 8];
135 if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
136 do_cmd_attack(player_ptr, y, x, HISSATSU_NONE);
138 msg_print(_("攻撃は空を切った。", "You attack the empty air."));
141 y = player_ptr->y + ddy_cdd[(cdir + 1) % 8];
142 x = player_ptr->x + ddx_cdd[(cdir + 1) % 8];
143 if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
144 do_cmd_attack(player_ptr, y, x, HISSATSU_NONE);
146 msg_print(_("攻撃は空を切った。", "You attack the empty air."));
153 return _("ブーメラン", "Boomerang");
157 "武器を手元に戻ってくるように投げる。戻ってこないこともある。", "Throws current weapon. It'll return to your hand unless the action failed.");
161 if (!ThrowCommand(player_ptr).do_cmd_throw(1, true, -1)) {
169 return _("焔霊", "Burning Strike");
172 return _("火炎耐性のないモンスターに大ダメージを与える。", "Attacks a monster with more damage unless it has resistance to fire.");
178 if (!get_direction(player_ptr, &dir, false, false)) {
185 y = player_ptr->y + ddy[dir];
186 x = player_ptr->x + ddx[dir];
188 if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
189 do_cmd_attack(player_ptr, y, x, HISSATSU_FIRE);
191 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
199 return _("殺気感知", "Detect Ferocity");
202 return _("近くの思考することができるモンスターを感知する。", "Detects all monsters except the mindless in your vicinity.");
206 detect_monsters_mind(player_ptr, DETECT_RAD_DEFAULT);
212 return _("みね打ち", "Strike to Stun");
215 return _("相手にダメージを与えないが、朦朧とさせる。", "Attempts to stun a monster next to you.");
221 if (!get_direction(player_ptr, &dir, false, false)) {
228 y = player_ptr->y + ddy[dir];
229 x = player_ptr->x + ddx[dir];
231 if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
232 do_cmd_attack(player_ptr, y, x, HISSATSU_MINEUCHI);
234 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
242 return _("カウンター", "Counter");
245 return _("相手に攻撃されたときに反撃する。反撃するたびにMPを消費。",
246 "Prepares to counterattack. When attacked by a monster, strikes back using SP each time.");
250 if (player_ptr->riding) {
251 msg_print(_("乗馬中には無理だ。", "You cannot do it when riding."));
254 msg_print(_("相手の攻撃に対して身構えた。", "You prepare to counterattack."));
255 player_ptr->counter = true;
261 return _("払い抜け", "Harainuke");
264 return _("攻撃した後、反対側に抜ける。",
265 "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.");
271 if (player_ptr->riding) {
272 msg_print(_("乗馬中には無理だ。", "You cannot do it when riding."));
276 if (!get_direction(player_ptr, &dir, false, false)) {
283 y = player_ptr->y + ddy[dir];
284 x = player_ptr->x + ddx[dir];
286 const auto *floor_ptr = player_ptr->current_floor_ptr;
287 const auto &grid = floor_ptr->grid_array[y][x];
289 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
293 do_cmd_attack(player_ptr, y, x, HISSATSU_NONE);
294 if (!player_can_enter(player_ptr, grid.feat, 0) || is_trap(player_ptr, grid.feat)) {
301 if (player_can_enter(player_ptr, grid.feat, 0) && !is_trap(player_ptr, grid.feat) && !grid.m_idx) {
303 (void)move_player_effect(player_ptr, y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP);
310 return _("サーペンツタン", "Serpent's Tongue");
313 return _("毒耐性のないモンスターに大ダメージを与える。", "Attacks a monster with more damage unless it has resistance to poison.");
319 if (!get_direction(player_ptr, &dir, false, false)) {
326 y = player_ptr->y + ddy[dir];
327 x = player_ptr->x + ddx[dir];
329 if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
330 do_cmd_attack(player_ptr, y, x, HISSATSU_POISON);
332 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
340 return _("斬魔剣弐の太刀", "Zammaken");
343 return _("生命のない邪悪なモンスターに大ダメージを与えるが、他のモンスターには全く効果がない。",
344 "Attacks an evil unliving monster with great damage. Has no effect on other monsters.");
350 if (!get_direction(player_ptr, &dir, false, false)) {
357 y = player_ptr->y + ddy[dir];
358 x = player_ptr->x + ddx[dir];
360 if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
361 do_cmd_attack(player_ptr, y, x, HISSATSU_ZANMA);
363 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
371 return _("裂風剣", "Wind Blast");
374 return _("攻撃した相手を後方へ吹き飛ばす。", "Attacks an adjacent monster and blows it away.");
380 if (!get_direction(player_ptr, &dir, false, false)) {
387 y = player_ptr->y + ddy[dir];
388 x = player_ptr->x + ddx[dir];
390 const auto &floor = *player_ptr->current_floor_ptr;
391 if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
392 do_cmd_attack(player_ptr, y, x, HISSATSU_NONE);
394 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
397 if (dungeons_info[floor.dungeon_idx].flags.has(DungeonFeatureType::NO_MELEE)) {
400 if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
402 POSITION ty = y, tx = x;
403 POSITION oy = y, ox = x;
404 MONSTER_IDX m_idx = player_ptr->current_floor_ptr->grid_array[y][x].m_idx;
405 auto *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
406 const auto m_name = monster_desc(player_ptr, m_ptr, 0);
408 for (i = 0; i < 5; i++) {
411 if (is_cave_empty_bold(player_ptr, y, x)) {
418 if ((ty != oy) || (tx != ox)) {
419 msg_format(_("%sを吹き飛ばした!", "You blow %s away!"), m_name.data());
420 player_ptr->current_floor_ptr->grid_array[oy][ox].m_idx = 0;
421 player_ptr->current_floor_ptr->grid_array[ty][tx].m_idx = m_idx;
425 update_monster(player_ptr, m_idx, true);
426 lite_spot(player_ptr, oy, ox);
427 lite_spot(player_ptr, ty, tx);
429 if (monraces_info[m_ptr->r_idx].brightness_flags.has_any_of(ld_mask)) {
430 RedrawingFlagsUpdater::get_instance().set_flag(StatusRedrawingFlag::MONSTER_LITE);
439 return _("刀匠の目利き", "Judge");
442 return _("武器・防具を1つ識別する。レベル45以上で武器・防具の能力を完全に知ることができる。",
443 "Identifies a weapon or armor. *Identifies* the item at level 45.");
448 if (!identify_fully(player_ptr, true)) {
452 if (!ident_spell(player_ptr, true)) {
461 return _("破岩斬", "Rock Smash");
464 return _("岩を壊し、岩石系のモンスターに大ダメージを与える。", "Breaks rock or greatly damages a monster made of rocks.");
470 if (!get_direction(player_ptr, &dir, false, false)) {
477 y = player_ptr->y + ddy[dir];
478 x = player_ptr->x + ddx[dir];
480 if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
481 do_cmd_attack(player_ptr, y, x, HISSATSU_HAGAN);
484 if (!cave_has_flag_bold(player_ptr->current_floor_ptr, y, x, TerrainCharacteristics::HURT_ROCK)) {
488 /* Destroy the feature */
489 cave_alter_feat(player_ptr, y, x, TerrainCharacteristics::HURT_ROCK);
490 RedrawingFlagsUpdater::get_instance().set_flag(StatusRedrawingFlag::FLOW);
496 return _("乱れ雪月花", "Midare-Setsugekka");
499 return _("攻撃回数が増え、冷気耐性のないモンスターに大ダメージを与える。",
500 "Attacks a monster with an increased number of attacks and more damage unless it has resistance to cold.");
506 if (!get_direction(player_ptr, &dir, false, false)) {
513 y = player_ptr->y + ddy[dir];
514 x = player_ptr->x + ddx[dir];
516 if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
517 do_cmd_attack(player_ptr, y, x, HISSATSU_COLD);
519 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
527 return _("急所突き", "Spot Aiming");
530 return _("モンスターを一撃で倒す攻撃を繰り出す。失敗すると1点しかダメージを与えられない。",
531 "Attempts to kill a monster instantly. If that fails, causes only 1HP of damage.");
537 if (!get_direction(player_ptr, &dir, false, false)) {
544 y = player_ptr->y + ddy[dir];
545 x = player_ptr->x + ddx[dir];
547 if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
548 do_cmd_attack(player_ptr, y, x, HISSATSU_KYUSHO);
550 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
558 return _("魔神斬り", "Majingiri");
561 return _("会心の一撃で攻撃する。攻撃がかわされやすい。", "Attempts to attack with a critical hit, but this attack is easy to evade for a monster.");
567 if (!get_direction(player_ptr, &dir, false, false)) {
574 y = player_ptr->y + ddy[dir];
575 x = player_ptr->x + ddx[dir];
577 if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
578 do_cmd_attack(player_ptr, y, x, HISSATSU_MAJIN);
580 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
588 return _("捨て身", "Desperate Attack");
591 return _("強力な攻撃を繰り出す。次のターンまでの間、食らうダメージが増える。",
592 "Attacks with all of your power, but all damage you take will be doubled for one turn.");
598 if (!get_direction(player_ptr, &dir, false, false)) {
605 y = player_ptr->y + ddy[dir];
606 x = player_ptr->x + ddx[dir];
608 if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
609 do_cmd_attack(player_ptr, y, x, HISSATSU_SUTEMI);
611 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
614 player_ptr->sutemi = true;
620 return _("雷撃鷲爪斬", "Lightning Eagle");
623 return _("電撃耐性のないモンスターに非常に大きいダメージを与える。", "Attacks a monster with more damage unless it has resistance to electricity.");
629 if (!get_direction(player_ptr, &dir, false, false)) {
636 y = player_ptr->y + ddy[dir];
637 x = player_ptr->x + ddx[dir];
639 if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
640 do_cmd_attack(player_ptr, y, x, HISSATSU_ELEC);
642 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
650 return _("入身", "Rush Attack");
653 return _("素早く相手に近寄り攻撃する。", "Steps close to a monster and attacks at the same time.");
657 if (!rush_attack(player_ptr, nullptr)) {
665 return _("赤流渦", "Bloody Maelstrom");
669 return _("自分自身も傷を作りつつ、その傷が深いほど大きい威力で全方向の敵を攻撃できる。生きていないモンスターには効果がない。",
670 "Attacks all adjacent monsters with power corresponding to your cuts. Then increases your cuts. Has no effect on unliving monsters.");
674 POSITION y = 0, x = 0;
675 auto current_cut = player_ptr->effects()->cut()->current();
676 short new_cut = current_cut < 300 ? current_cut + 300 : current_cut * 2;
677 (void)BadStatusSetter(player_ptr).set_cut(new_cut);
678 for (dir = 0; dir < 8; dir++) {
679 y = player_ptr->y + ddy_ddd[dir];
680 x = player_ptr->x + ddx_ddd[dir];
681 auto *g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x];
682 auto *m_ptr = &player_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
683 if ((g_ptr->m_idx == 0) || (!m_ptr->ml && !cave_has_flag_bold(player_ptr->current_floor_ptr, y, x, TerrainCharacteristics::PROJECT))) {
687 if (m_ptr->has_living_flag()) {
688 do_cmd_attack(player_ptr, y, x, HISSATSU_SEKIRYUKA);
692 const auto m_name = monster_desc(player_ptr, m_ptr, 0);
693 msg_format(_("%sには効果がない!", "%s is unharmed!"), m_name.data());
700 return _("激震撃", "Earthquake Blow");
703 return _("地震を起こす。", "Shakes dungeon structure, and results in random swapping of floors and walls.");
709 if (!get_direction(player_ptr, &dir, false, false)) {
716 y = player_ptr->y + ddy[dir];
717 x = player_ptr->x + ddx[dir];
719 if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
720 do_cmd_attack(player_ptr, y, x, HISSATSU_QUAKE);
722 earthquake(player_ptr, player_ptr->y, player_ptr->x, 10, 0);
729 return _("地走り", "Crack");
732 return _("衝撃波のビームを放つ。", "Fires a shock wave as a beam.");
736 int total_damage = 0, basedam, i;
738 if (!get_aim_dir(player_ptr, &dir)) {
741 msg_print(_("武器を大きく振り下ろした。", "You swing your weapon downward."));
742 for (i = 0; i < 2; i++) {
745 if (!has_melee_weapon(player_ptr, INVEN_MAIN_HAND + i)) {
748 o_ptr = &player_ptr->inventory_list[INVEN_MAIN_HAND + i];
749 basedam = (o_ptr->dd * (o_ptr->ds + 1)) * 50;
750 damage = o_ptr->to_d * 100;
751 auto flags = object_flags(o_ptr);
754 if (o_ptr->is_specific_artifact(FixedArtifactId::VORPAL_BLADE) || o_ptr->is_specific_artifact(FixedArtifactId::CHAINSWORD)) {
758 } else if (flags.has(TR_VORPAL)) {
759 /* vorpal flag only */
764 damage *= player_ptr->num_blow[i];
765 total_damage += damage / 200;
767 total_damage = total_damage * 7 / 10;
770 fire_beam(player_ptr, AttributeType::FORCE, dir, total_damage);
776 return _("気迫の雄叫び", "War Cry");
779 return _("視界内の全モンスターに対して轟音の攻撃を行う。さらに、近くにいるモンスターを怒らせる。",
780 "Damages all monsters in sight with sound. Aggravates nearby monsters.");
784 msg_print(_("雄叫びをあげた!", "You roar!"));
785 project_all_los(player_ptr, AttributeType::SOUND, randint1(plev * 3));
786 aggravate_monsters(player_ptr, 0);
792 return _("無双三段", "Musou-Sandan");
795 return _("強力な3段攻撃を繰り出す。", "Attacks with three powerful strikes.");
801 if (!get_direction(player_ptr, &dir, false, false)) {
808 const auto &floor = *player_ptr->current_floor_ptr;
809 for (i = 0; i < 3; i++) {
814 MonsterEntity *m_ptr;
816 y = player_ptr->y + ddy[dir];
817 x = player_ptr->x + ddx[dir];
818 g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x];
821 do_cmd_attack(player_ptr, y, x, HISSATSU_3DAN);
823 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
827 if (dungeons_info[floor.dungeon_idx].flags.has(DungeonFeatureType::NO_MELEE)) {
831 /* Monster is dead? */
838 m_idx = g_ptr->m_idx;
839 m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
841 /* Monster cannot move back? */
842 if (!monster_can_enter(player_ptr, ny, nx, &monraces_info[m_ptr->r_idx], 0)) {
851 player_ptr->current_floor_ptr->grid_array[ny][nx].m_idx = m_idx;
855 update_monster(player_ptr, m_idx, true);
857 /* Redraw the old spot */
858 lite_spot(player_ptr, y, x);
860 /* Redraw the new spot */
861 lite_spot(player_ptr, ny, nx);
863 /* Player can move forward? */
864 if (player_can_enter(player_ptr, g_ptr->feat, 0)) {
865 if (!move_player_effect(player_ptr, y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP)) {
882 return _("吸血鬼の牙", "Vampire's Fang");
885 return _("攻撃した相手の体力を吸いとり、自分の体力を回復させる。生命を持たないモンスターには通じない。",
886 "Attacks with vampiric strikes which absorb HP from a monster and heal you. Has no effect on unliving monsters.");
892 if (!get_direction(player_ptr, &dir, false, false)) {
899 y = player_ptr->y + ddy[dir];
900 x = player_ptr->x + ddx[dir];
902 if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
903 do_cmd_attack(player_ptr, y, x, HISSATSU_DRAIN);
905 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
913 return _("幻惑", "Moon Dazzling");
916 return _("視界内の起きている全モンスターに朦朧、混乱、眠りを与えようとする。", "Attempts to stun, confuse and put to sleep all waking monsters.");
920 msg_print(_("武器を不規則に揺らした...", "You irregularly wave your weapon..."));
921 project_all_los(player_ptr, AttributeType::ENGETSU, plev * 4);
927 return _("百人斬り", "Hundred Slaughter");
930 return _("連続して入身でモンスターを攻撃する。攻撃するたびにMPを消費。MPがなくなるか、モンスターを倒せなかったら百人斬りは終了する。",
931 "Performs a series of rush attacks. The series continues as long as the attacked monster dies and you have sufficient SP.");
935 const int mana_cost_per_monster = 8;
940 if (!rush_attack(player_ptr, &mdeath)) {
944 /* Reserve needed mana point */
945 player_ptr->csp -= technic_info[REALM_HISSATSU - MIN_TECHNIC][26].smana;
948 player_ptr->csp -= mana_cost_per_monster;
956 RedrawingFlagsUpdater::get_instance().set_flag(MainWindowRedrawingFlag::MP);
957 handle_stuff(player_ptr);
958 } while (player_ptr->csp > mana_cost_per_monster);
964 /* Restore reserved mana */
965 player_ptr->csp += technic_info[REALM_HISSATSU - MIN_TECHNIC][26].smana;
971 return _("天翔龍閃", "Dragonic Flash");
974 return _("視界内の場所を指定して、その場所と自分の間にいる全モンスターを攻撃し、その場所に移動する。",
975 "Runs toward given location while attacking all monsters on the path.");
981 if (!tgt_pt(player_ptr, &x, &y)) {
985 const auto is_teleportable = cave_player_teleportable_bold(player_ptr, y, x, TELEPORT_SPONTANEOUS);
986 const auto dist = distance(y, x, player_ptr->y, player_ptr->x);
987 if (!is_teleportable || (dist > MAX_PLAYER_SIGHT / 2) || !projectable(player_ptr, player_ptr->y, player_ptr->x, y, x)) {
988 msg_print(_("失敗!", "You cannot move to that place!"));
991 if (player_ptr->anti_tele) {
992 msg_print(_("不思議な力がテレポートを防いだ!", "A mysterious force prevents you from teleporting!"));
995 project(player_ptr, 0, 0, y, x, HISSATSU_ISSEN, AttributeType::ATTACK, PROJECT_BEAM | PROJECT_KILL);
996 teleport_player_to(player_ptr, y, x, TELEPORT_SPONTANEOUS);
1002 return _("二重の剣撃", "Twin Slash");
1005 return _("1ターンで2度攻撃を行う。", "Attack twice in one turn.");
1011 if (!get_rep_dir(player_ptr, &dir, false)) {
1012 return std::nullopt;
1015 y = player_ptr->y + ddy[dir];
1016 x = player_ptr->x + ddx[dir];
1018 if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
1019 do_cmd_attack(player_ptr, y, x, HISSATSU_NONE);
1020 if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
1021 handle_stuff(player_ptr);
1022 do_cmd_attack(player_ptr, y, x, HISSATSU_NONE);
1025 msg_print(_("その方向にはモンスターはいません。", "You don't see any monster in this direction"));
1026 return std::nullopt;
1033 return _("虎伏絶刀勢", "Kofuku-Zettousei");
1036 return _("強力な攻撃を行い、近くの場所にも効果が及ぶ。", "Performs a powerful attack which even affects nearby monsters.");
1040 int total_damage = 0, basedam, i;
1044 if (!get_direction(player_ptr, &dir, false, false)) {
1045 return std::nullopt;
1048 return std::nullopt;
1051 y = player_ptr->y + ddy[dir];
1052 x = player_ptr->x + ddx[dir];
1054 auto &floor = *player_ptr->current_floor_ptr;
1055 if (dungeons_info[floor.dungeon_idx].flags.has(DungeonFeatureType::NO_MELEE)) {
1056 msg_print(_("なぜか攻撃することができない。", "Something prevents you from attacking."));
1059 msg_print(_("武器を大きく振り下ろした。", "You swing your weapon downward."));
1060 for (i = 0; i < 2; i++) {
1062 if (!has_melee_weapon(player_ptr, INVEN_MAIN_HAND + i)) {
1065 o_ptr = &player_ptr->inventory_list[INVEN_MAIN_HAND + i];
1066 basedam = (o_ptr->dd * (o_ptr->ds + 1)) * 50;
1067 damage = o_ptr->to_d * 100;
1068 auto flags = object_flags(o_ptr);
1070 // @todo ヴォーパルの多重定義.
1071 if (o_ptr->is_specific_artifact(FixedArtifactId::VORPAL_BLADE) || o_ptr->is_specific_artifact(FixedArtifactId::CHAINSWORD)) {
1075 } else if (flags.has(TR_VORPAL)) {
1076 /* vorpal flag only */
1081 damage += player_ptr->to_d[i] * 100;
1082 damage *= player_ptr->num_blow[i];
1083 total_damage += (damage / 100);
1086 const auto is_bold = cave_has_flag_bold(&floor, y, x, TerrainCharacteristics::PROJECT);
1087 constexpr auto flags = PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM;
1088 project(player_ptr, 0, (is_bold ? 5 : 0), y, x, total_damage * 3 / 2, AttributeType::METEOR, flags);
1094 return _("慶雲鬼忍剣", "Keiun-Kininken");
1097 return _("自分もダメージをくらうが、相手に非常に大きなダメージを与える。アンデッドには特に効果がある。",
1098 "Attacks a monster with extremely powerful damage, but you also take some damage. Hurts an undead monster greatly.");
1104 if (!get_direction(player_ptr, &dir, false, false)) {
1105 return std::nullopt;
1108 return std::nullopt;
1111 y = player_ptr->y + ddy[dir];
1112 x = player_ptr->x + ddx[dir];
1114 if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
1115 do_cmd_attack(player_ptr, y, x, HISSATSU_UNDEAD);
1117 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
1118 return std::nullopt;
1120 take_hit(player_ptr, DAMAGE_NOESCAPE, 100 + randint1(100), _("慶雲鬼忍剣を使った衝撃", "exhaustion on using Keiun-Kininken"));
1126 return _("切腹", "Harakiri");
1129 return _("「武士道とは、死ぬことと見つけたり。」", "'Bushido, the way of warriors, is found in death'");
1134 if (!get_check(_("本当に自殺しますか?", "Do you really want to commit suicide? "))) {
1135 return std::nullopt;
1137 /* Special Verification for suicide */
1138 prt(_("確認のため '@' を押して下さい。", "Please verify SUICIDE by typing the '@' sign: "), 0, 0);
1144 return std::nullopt;
1146 if (w_ptr->total_winner) {
1147 take_hit(player_ptr, DAMAGE_FORCE, 9999, "Seppuku");
1148 w_ptr->total_winner = true;
1150 msg_print(_("武士道とは、死ぬことと見つけたり。", "The meaning of bushido is found in death."));
1151 take_hit(player_ptr, DAMAGE_FORCE, 9999, "Seppuku");