5 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
7 * This software may be copied and distributed for educational, research,
8 * and not for profit purposes provided that this copyright and statement
9 * are included in all such copies. Other copyrights may also apply.
11 * 2013 Deskull rearranged comment for Doxygen.
14 #include "status/action-setter.h"
15 #include "core/player-redraw-types.h"
16 #include "player-base/player-class.h"
17 #include "player-info/bluemage-data-type.h"
18 #include "player-info/monk-data-type.h"
19 #include "player-info/samurai-data-type.h"
20 #include "player-status/player-energy.h"
21 #include "player/attack-defense-types.h"
22 #include "player/special-defense-types.h"
23 #include "spell-realm/spells-hex.h"
24 #include "spell-realm/spells-song.h"
25 #include "system/player-type-definition.h"
26 #include "system/redrawing-flags-updater.h"
27 #include "view/display-messages.h"
30 * @brief プレイヤーの継続行動を設定する。
32 * NONE / SEARCH / REST / LEARN / FISH / MONK_STANCE / SAMURAI_STANCE / SING / HAYAGAKE / SPELL
35 void set_action(PlayerType *player_ptr, uint8_t typ)
37 auto prev_typ = player_ptr->action;
38 if (typ == prev_typ) {
42 auto &rfu = RedrawingFlagsUpdater::get_instance();
45 msg_print(_("探索をやめた。", "You no longer walk carefully."));
46 rfu.set_flag(MainWindowRedrawingFlag::SPEED);
49 player_ptr->resting = 0;
52 msg_print(_("学習をやめた。", "You stop learning."));
53 auto bluemage_data = PlayerClass(player_ptr).get_specific_data<bluemage_data_type>();
54 bluemage_data->new_magic_learned = false;
57 case ACTION_MONK_STANCE:
58 msg_print(_("構えをといた。", "You stop assuming the special stance."));
59 PlayerClass(player_ptr).set_monk_stance(MonkStanceType::NONE);
61 case ACTION_SAMURAI_STANCE:
62 msg_print(_("型を崩した。", "You stop assuming the special stance."));
63 PlayerClass(player_ptr).set_samurai_stance(SamuraiStanceType::NONE);
64 rfu.set_flag(StatusRedrawingFlag::MONSTER_STATUSES);
65 rfu.set_flag(MainWindowRedrawingFlag::TIMED_EFFECT);
68 msg_print(_("歌うのをやめた。", "You stop singing."));
71 msg_print(_("足が重くなった。", "You are no longer walking extremely fast."));
72 PlayerEnergy(player_ptr).set_player_turn_energy(100);
75 msg_print(_("呪文の詠唱を中断した。", "You stopped casting."));
79 player_ptr->action = typ;
81 /* If we are requested other action, stop singing */
82 if (prev_typ == ACTION_SING) {
83 stop_singing(player_ptr);
86 if (prev_typ == ACTION_SPELL) {
87 SpellHex spell_hex(player_ptr);
88 if (spell_hex.is_spelling_any()) {
89 spell_hex.stop_all_spells();
93 switch (player_ptr->action) {
95 msg_print(_("注意深く歩き始めた。", "You begin to walk carefully."));
96 rfu.set_flag(MainWindowRedrawingFlag::SPEED);
99 msg_print(_("学習を始めた。", "You begin learning"));
102 msg_print(_("水面に糸を垂らした...", "You begin fishing..."));
104 case ACTION_HAYAGAKE:
105 msg_print(_("足が羽のように軽くなった。", "You begin to walk extremely fast."));
111 rfu.set_flag(StatusRedrawingFlag::BONUS);
112 rfu.set_flag(MainWindowRedrawingFlag::ACTION);