X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fio%2Finput-key-processor.c;h=d0641abb91ab288c4bef662c818716facc04fdfe;hb=bd6bcecb485d48590a0ac1635618d5e896c85bad;hp=c27e5469531a9b5dfff29340f1b94e3e72f5c2dd;hpb=0ff86d69711cb28c1beb4910a59281dc75cce4d9;p=hengband%2Fhengband.git diff --git a/src/io/input-key-processor.c b/src/io/input-key-processor.c index c27e54695..d0641abb9 100644 --- a/src/io/input-key-processor.c +++ b/src/io/input-key-processor.c @@ -5,63 +5,89 @@ * @author Hourier */ -#include "system/angband.h" #include "io/input-key-processor.h" -#include "world/world.h" -#include "core/special-internal-keys.h" -#include "dungeon/dungeon.h" -#include "mind/mind-sniper.h" #include "autopick/autopick-pref-processor.h" -#include "store/store-util.h" -#include "main/sound-definitions-table.h" -#include "io/write-diary.h" -#include "inventory/player-inventory.h" -#include "player/player-effects.h" -#include "store/store.h" // do_cmd_store() がある。後で移設する. -#include "dungeon/quest.h" // do_cmd_quest() がある。後で移設する. -#include "floor/wild.h" -#include "spell/spells-object.h" -#include "mind/mind.h" // do_cmd_mind_browse() がある。後で移設する. -#include "mspell/monster-spell.h" // do_cmd_cast_learned() がある。後で移設する. -#include "mind/racial.h" // do_cmd_racial_power() がある。ファイル名変更?. -#include "view/display-main-window.h" -#include "knowledge/knowledge-autopick.h" -#include "knowledge/knowledge-quests.h" -#include "io/chuukei.h" -#include "player/player-move.h" // do_cmd_travel() がある。後で移設する. -#include "io/files-util.h" - -#include "cmd-item/cmd-activate.h" -#include "cmd-io/cmd-autopick.h" +#include "cmd-action/cmd-hissatsu.h" +#include "cmd-action/cmd-mane.h" +#include "cmd-action/cmd-mind.h" +#include "cmd-action/cmd-move.h" +#include "cmd-action/cmd-open-close.h" +#include "cmd-action/cmd-others.h" +#include "cmd-action/cmd-pet.h" +#include "cmd-action/cmd-racial.h" +#include "cmd-action/cmd-shoot.h" +#include "cmd-action/cmd-spell.h" +#include "cmd-action/cmd-travel.h" +#include "cmd-action/cmd-tunnel.h" #include "cmd-building/cmd-building.h" +#include "cmd-building/cmd-store.h" +#include "cmd-io/cmd-autopick.h" #include "cmd-io/cmd-diary.h" -#include "cmd/cmd-draw.h" #include "cmd-io/cmd-dump.h" +#include "cmd-io/cmd-floor.h" +#include "cmd-io/cmd-gameoption.h" +#include "cmd-io/cmd-help.h" +#include "cmd-io/cmd-knowledge.h" +#include "cmd-io/cmd-lore.h" +#include "cmd-io/cmd-macro.h" #include "cmd-io/cmd-process-screen.h" +#include "cmd-io/cmd-save.h" +#include "cmd-item/cmd-destroy.h" #include "cmd-item/cmd-eat.h" -#include "cmd-io/cmd-help.h" -#include "cmd-action/cmd-hissatsu.h" +#include "cmd-item/cmd-equipment.h" #include "cmd-item/cmd-item.h" -#include "cmd-io/cmd-knowledge.h" #include "cmd-item/cmd-magiceat.h" -#include "cmd-action/cmd-mane.h" -#include "cmd-io/cmd-macro.h" #include "cmd-item/cmd-quaff.h" #include "cmd-item/cmd-read.h" -#include "cmd-io/cmd-save.h" +#include "cmd-item/cmd-refill.h" #include "cmd-item/cmd-smith.h" -#include "cmd-action/cmd-spell.h" +#include "cmd-item/cmd-throw.h" #include "cmd-item/cmd-usestaff.h" #include "cmd-item/cmd-zaprod.h" #include "cmd-item/cmd-zapwand.h" -#include "cmd-action/cmd-pet.h" -#include "cmd/cmd-basic.h" -#include "cmd/cmd-visuals.h" -#include "wizard/wizard-spoiler.h" -#include "wizard/wizard-special-process.h" - -// todo command-processor.h と util.h が相互依存している。後で別な場所に移す. -COMMAND_CODE now_message; +#include "cmd-visual/cmd-draw.h" +#include "cmd-visual/cmd-map.h" +#include "cmd-visual/cmd-visuals.h" +#include "core/asking-player.h" +#include "core/player-redraw-types.h" +#include "core/player-update-types.h" +#include "core/special-internal-keys.h" +#include "dungeon/dungeon-flag-types.h" +#include "dungeon/dungeon.h" +#include "dungeon/quest.h" // do_cmd_quest() がある。後で移設する. +#include "floor/wild.h" +#include "game-option/birth-options.h" +#include "game-option/disturbance-options.h" +#include "game-option/game-play-options.h" +#include "game-option/input-options.h" +#include "game-option/runtime-arguments.h" +#include "io-dump/random-art-info-dumper.h" +#include "io/chuukei.h" +#include "io/command-repeater.h" +#include "io/files-util.h" +#include "io/input-key-requester.h" // todo 相互依存している、後で何とかする. +#include "io/write-diary.h" +#include "knowledge/knowledge-autopick.h" +#include "knowledge/knowledge-quests.h" +#include "main/sound-definitions-table.h" +#include "main/sound-of-music.h" +#include "mind/mind-blue-mage.h" +#include "mind/mind-magic-eater.h" +#include "mind/mind-sniper.h" +#include "mind/snipe-types.h" +#include "player/attack-defense-types.h" +#include "player/player-class.h" +#include "player/special-defense-types.h" +#include "status/action-setter.h" +#include "store/home.h" +#include "store/store-util.h" +#include "system/floor-type-definition.h" +#include "term/screen-processor.h" +#include "util/int-char-converter.h" +#include "view/display-messages.h" +#include "window/display-sub-windows.h" +#include "wizard/cmd-wizard.h" +#include "world/world.h" /*! * @brief ウィザードモードへの導入処理 @@ -69,7 +95,7 @@ COMMAND_CODE now_message; * @param player_ptr プレーヤーへの参照ポインタ * @return 実際にウィザードモードへ移行したらTRUEを返す。 */ -bool enter_wizard_mode(player_type* player_ptr) +bool enter_wizard_mode(player_type *player_ptr) { if (!current_world_ptr->noscore) { if (!allow_debug_opts || arg_wizard) { @@ -84,7 +110,8 @@ bool enter_wizard_mode(player_type* player_ptr) return FALSE; } - exe_write_diary(player_ptr, DIARY_DESCRIPTION, 0, _("ウィザードモードに突入してスコアを残せなくなった。", "gave up recording score to enter wizard mode.")); + exe_write_diary( + player_ptr, DIARY_DESCRIPTION, 0, _("ウィザードモードに突入してスコアを残せなくなった。", "gave up recording score to enter wizard mode.")); current_world_ptr->noscore |= 0x0002; } @@ -97,7 +124,7 @@ bool enter_wizard_mode(player_type* player_ptr) * @param player_ptr プレーヤーへの参照ポインタ * @return 実際にデバッグコマンドへ移行したらTRUEを返す。 */ -static bool enter_debug_mode(player_type* player_ptr) +static bool enter_debug_mode(player_type *player_ptr) { if (!current_world_ptr->noscore) { if (!allow_debug_opts) { @@ -112,7 +139,8 @@ static bool enter_debug_mode(player_type* player_ptr) return FALSE; } - exe_write_diary(player_ptr, DIARY_DESCRIPTION, 0, _("デバッグモードに突入してスコアを残せなくなった。", "gave up sending score to use debug commands.")); + exe_write_diary( + player_ptr, DIARY_DESCRIPTION, 0, _("デバッグモードに突入してスコアを残せなくなった。", "gave up sending score to use debug commands.")); current_world_ptr->noscore |= 0x0008; } @@ -125,7 +153,7 @@ static bool enter_debug_mode(player_type* player_ptr) * @todo Make some "blocks" * @return なし */ -void process_command(player_type* creature_ptr) +void process_command(player_type *creature_ptr) { COMMAND_CODE old_now_message = now_message; repeat_check(); @@ -133,7 +161,7 @@ void process_command(player_type* creature_ptr) if ((creature_ptr->pclass == CLASS_SNIPER) && (creature_ptr->concent)) creature_ptr->reset_concent = TRUE; - floor_type* floor_ptr = creature_ptr->current_floor_ptr; + floor_type *floor_ptr = creature_ptr->current_floor_ptr; switch (command_cmd) { case ESCAPE: case ' ': @@ -325,7 +353,8 @@ void process_command(player_type* creature_ptr) break; } case 'b': { - if ((creature_ptr->pclass == CLASS_MINDCRAFTER) || (creature_ptr->pclass == CLASS_BERSERKER) || (creature_ptr->pclass == CLASS_NINJA) || (creature_ptr->pclass == CLASS_MIRROR_MASTER)) + if ((creature_ptr->pclass == CLASS_MINDCRAFTER) || (creature_ptr->pclass == CLASS_BERSERKER) || (creature_ptr->pclass == CLASS_NINJA) + || (creature_ptr->pclass == CLASS_MIRROR_MASTER)) do_cmd_mind_browse(creature_ptr); else if (creature_ptr->pclass == CLASS_SMITH) do_cmd_kaji(creature_ptr, TRUE); @@ -342,7 +371,8 @@ void process_command(player_type* creature_ptr) if (!creature_ptr->wild_mode) { if ((creature_ptr->pclass == CLASS_WARRIOR) || (creature_ptr->pclass == CLASS_ARCHER) || (creature_ptr->pclass == CLASS_CAVALRY)) { msg_print(_("呪文を唱えられない!", "You cannot cast spells!")); - } else if (floor_ptr->dun_level && (d_info[creature_ptr->dungeon_idx].flags1 & DF1_NO_MAGIC) && (creature_ptr->pclass != CLASS_BERSERKER) && (creature_ptr->pclass != CLASS_SMITH)) { + } else if (floor_ptr->dun_level && (d_info[creature_ptr->dungeon_idx].flags1 & DF1_NO_MAGIC) && (creature_ptr->pclass != CLASS_BERSERKER) + && (creature_ptr->pclass != CLASS_SMITH)) { msg_print(_("ダンジョンが魔法を吸収した!", "The dungeon absorbs all attempted magic!")); msg_print(NULL); } else if (creature_ptr->anti_magic && (creature_ptr->pclass != CLASS_BERSERKER) && (creature_ptr->pclass != CLASS_SMITH)) { @@ -366,7 +396,8 @@ void process_command(player_type* creature_ptr) msg_format(_("狂戦士化していて頭が回らない!", "You cannot think directly!")); free_turn(creature_ptr); } else { - if ((creature_ptr->pclass == CLASS_MINDCRAFTER) || (creature_ptr->pclass == CLASS_BERSERKER) || (creature_ptr->pclass == CLASS_NINJA) || (creature_ptr->pclass == CLASS_MIRROR_MASTER)) + if ((creature_ptr->pclass == CLASS_MINDCRAFTER) || (creature_ptr->pclass == CLASS_BERSERKER) || (creature_ptr->pclass == CLASS_NINJA) + || (creature_ptr->pclass == CLASS_MIRROR_MASTER)) do_cmd_mind(creature_ptr); else if (creature_ptr->pclass == CLASS_IMITATOR) do_cmd_mane(creature_ptr, FALSE); @@ -481,7 +512,7 @@ void process_command(player_type* creature_ptr) break; } case '!': { - (void)Term_user(0); + (void)term_user(0); break; } case '"': { @@ -511,8 +542,8 @@ void process_command(player_type* creature_ptr) break; } case '=': { - do_cmd_options(); - (void)combine_and_reorder_home(STORE_HOME); + do_cmd_options(creature_ptr); + (void)combine_and_reorder_home(creature_ptr, STORE_HOME); do_cmd_redraw(creature_ptr); break; } @@ -579,7 +610,7 @@ void process_command(player_type* creature_ptr) break; } case ']': { - prepare_movie_hooks(); + prepare_movie_hooks(creature_ptr); break; } case KTRL('V'): {