1 #include "mind/mind-monk.h"
2 #include "action/action-limited.h"
3 #include "core/player-redraw-types.h"
4 #include "core/player-update-types.h"
5 #include "io/input-key-acceptor.h"
6 #include "mind/stances-table.h"
7 #include "player-base/player-class.h"
8 #include "player-info/monk-data-type.h"
9 #include "player/attack-defense-types.h"
10 #include "player/special-defense-types.h"
11 #include "status/action-setter.h"
12 #include "system/player-type-definition.h"
13 #include "system/redrawing-flags-updater.h"
14 #include "term/screen-processor.h"
15 #include "term/z-form.h"
16 #include "util/int-char-converter.h"
17 #include "view/display-messages.h"
19 static void set_stance(PlayerType *player_ptr, const MonkStanceType new_stance)
21 set_action(player_ptr, ACTION_MONK_STANCE);
22 PlayerClass pc(player_ptr);
23 if (pc.monk_stance_is(new_stance)) {
24 msg_print(_("構え直した。", "You reassume a stance."));
28 auto &rfu = RedrawingFlagsUpdater::get_instance();
29 rfu.set_flag(StatusRedrawingFlag::BONUS);
30 player_ptr->redraw |= PR_ACTION;
31 msg_format(_("%sの構えをとった。", "You assume the %s stance."), monk_stances[enum2i(new_stance) - 1].desc);
32 pc.set_monk_stance(new_stance);
37 * @return 構えを変化させたらTRUE、構え不能かキャンセルしたらFALSEを返す。
39 bool choose_monk_stance(PlayerType *player_ptr)
41 if (cmd_limit_confused(player_ptr)) {
46 prt(_(" a) 構えをとく", " a) No form"), 2, 20);
47 for (auto i = 0U; i < monk_stances.size(); i++) {
48 if (player_ptr->lev >= monk_stances[i].min_level) {
50 strnfmt(buf, sizeof(buf), " %c) %-12s %s", I2A(i + 1), monk_stances[i].desc, monk_stances[i].info);
56 prt(_(" どの構えをとりますか?", " Choose Stance: "), 1, 14);
58 auto new_stance = MonkStanceType::NONE;
60 char choice = inkey();
61 if (choice == ESCAPE) {
66 if ((choice == 'a') || (choice == 'A')) {
67 if (player_ptr->action == ACTION_MONK_STANCE) {
68 set_action(player_ptr, ACTION_NONE);
70 msg_print(_("もともと構えていない。", "You are not in a special stance."));
76 if ((choice == 'b') || (choice == 'B')) {
77 new_stance = MonkStanceType::GENBU;
79 } else if (((choice == 'c') || (choice == 'C')) && (player_ptr->lev > 29)) {
80 new_stance = MonkStanceType::BYAKKO;
82 } else if (((choice == 'd') || (choice == 'D')) && (player_ptr->lev > 34)) {
83 new_stance = MonkStanceType::SEIRYU;
85 } else if (((choice == 'e') || (choice == 'E')) && (player_ptr->lev > 39)) {
86 new_stance = MonkStanceType::SUZAKU;
91 set_stance(player_ptr, new_stance);
92 player_ptr->redraw |= PR_ACTION;