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/attack-defense-types.h"
8 #include "player/special-defense-types.h"
9 #include "status/action-setter.h"
10 #include "term/screen-processor.h"
11 #include "util/int-char-converter.h"
12 #include "view/display-messages.h"
14 static void set_stance(player_type *creature_ptr, const int new_stance)
16 set_action(creature_ptr, ACTION_KAMAE);
17 if (creature_ptr->special_defense & (KAMAE_GENBU << new_stance)) {
18 msg_print(_("構え直した。", "You reassume a stance."));
22 creature_ptr->special_defense &= ~(KAMAE_MASK);
23 creature_ptr->update |= PU_BONUS;
24 creature_ptr->redraw |= PR_STATE;
25 msg_format(_("%sの構えをとった。", "You assume the %s stance."), monk_stances[new_stance].desc);
26 creature_ptr->special_defense |= (KAMAE_GENBU << new_stance);
31 * @return 構えを変化させたらTRUE、構え不能かキャンセルしたらFALSEを返す。
33 bool choose_monk_stance(player_type *creature_ptr)
35 if (cmd_limit_confused(creature_ptr))
39 prt(_(" a) 構えをとく", " a) No form"), 2, 20);
40 for (int i = 0; i < MAX_KAMAE; i++) {
41 if (creature_ptr->lev >= monk_stances[i].min_level) {
43 sprintf(buf, " %c) %-12s %s", I2A(i + 1), monk_stances[i].desc, monk_stances[i].info);
49 prt(_(" どの構えをとりますか?", " Choose Stance: "), 1, 14);
53 char choice = inkey();
54 if (choice == ESCAPE) {
59 if ((choice == 'a') || (choice == 'A')) {
60 if (creature_ptr->action == ACTION_KAMAE) {
61 set_action(creature_ptr, ACTION_NONE);
63 msg_print(_("もともと構えていない。", "You are not in a special stance."));
68 if ((choice == 'b') || (choice == 'B')) {
71 } else if (((choice == 'c') || (choice == 'C')) && (creature_ptr->lev > 29)) {
74 } else if (((choice == 'd') || (choice == 'D')) && (creature_ptr->lev > 34)) {
77 } else if (((choice == 'e') || (choice == 'E')) && (creature_ptr->lev > 39)) {
83 set_stance(creature_ptr, new_stance);
84 creature_ptr->redraw |= PR_STATE;