<ClCompile Include="..\..\src\cmd-io\cmd-lore.c" />\r
<ClCompile Include="..\..\src\cmd-io\cmd-menu-content-table.c" />\r
<ClCompile Include="..\..\src\cmd-io\macro-util.c" />\r
+ <ClCompile Include="..\..\src\core\asking-player.c" />\r
<ClCompile Include="..\..\src\core\visuals-reseter.c" />\r
<ClCompile Include="..\..\src\floor\fixed-map-generator.c" />\r
<ClCompile Include="..\..\src\game-option\auto-destruction-options.c" />\r
<ClInclude Include="..\..\src\cmd-io\cmd-lore.h" />\r
<ClInclude Include="..\..\src\cmd-io\cmd-menu-content-table.h" />\r
<ClInclude Include="..\..\src\cmd-io\macro-util.h" />\r
+ <ClInclude Include="..\..\src\core\asking-player.h" />\r
<ClInclude Include="..\..\src\core\visuals-reseter.h" />\r
<ClInclude Include="..\..\src\floor\fixed-map-generator.h" />\r
<ClInclude Include="..\..\src\game-option\auto-destruction-options.h" />\r
<ClCompile Include="..\..\src\view\display-messages.c">
<Filter>view</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\core\asking-player.c">
+ <Filter>core</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\cmd\cmd-basic.h">
<ClInclude Include="..\..\src\locale\english.h">
<Filter>locale</Filter>
</ClInclude>
+ <ClInclude Include="..\..\src\core\asking-player.h">
+ <Filter>core</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\src\wall.bmp" />
combat/vorpal-weapon.c combat/vorpal-weapon.h \
combat/shoot.c combat/shoot.h \
\
- core/game-play.c core/game-play.h \
- core/show-file.c core/show-file.h \
- core/stuff-handler.c core/stuff-handler.h \
- core/special-internal-keys.h \
- core/output-updater.c core/output-updater.h \
+ core/asking-player.c core/asking-player.h \
core/game-closer.c core/game-closer.h \
- core/turn-compensator.c core/turn-compensator.h \
- core/hp-mp-regenerator.c core/hp-mp-regenerator.h \
+ core/game-play.c core/game-play.h \
core/hp-mp-processor.c core/hp-mp-processor.h \
+ core/hp-mp-regenerator.c core/hp-mp-regenerator.h \
core/magic-effects-timeout-reducer.c core/magic-effects-timeout-reducer.h \
+ core/output-updater.c core/output-updater.h \
core/player-processor.c core/player-processor.h \
core/scores.c core/scores.h \
+ core/show-file.c core/show-file.h \
core/sort.c core/sort.h \
+ core/special-internal-keys.h \
core/speed-table.c core/speed-table.h \
+ core/stuff-handler.c core/stuff-handler.h \
+ core/turn-compensator.c core/turn-compensator.h \
core/visuals-reseter.c core/visuals-reseter.h \
\
dungeon/dungeon.c dungeon/dungeon.h \
#include "autopick/autopick-inserter-killer.h"
#include "autopick/autopick-methods-table.h"
#include "autopick/autopick-reader-writer.h"
+#include "core/asking-player.h"
#include "core/show-file.h"
#include "game-option/input-options.h"
#include "term/term-color-types.h"
#include "autopick/autopick-finder.h"
#include "autopick/autopick-methods-table.h"
#include "autopick/autopick-reader-writer.h"
+#include "core/asking-player.h"
#include "io/files-util.h"
#include "object-enchant/item-feeling.h"
#include "perception/object-perception.h"
#include "autopick/autopick-finder.h"
#include "autopick/autopick-menu-data-table.h"
#include "autopick/autopick-methods-table.h"
+#include "core/asking-player.h"
#include "floor/floor.h"
#include "floor/floor-object.h"
#include "inventory/inventory-object.h"
#include "birth/birth-select-realm.h"
#include "birth/birth-explanations-table.h"
#include "birth/birth-util.h"
+#include "core/asking-player.h"
#include "io/input-key-acceptor.h"
#include "term/term-color-types.h"
#include "birth/quick-start.h"
#include "cmd-io/cmd-gameoption.h"
#include "cmd-io/cmd-help.h"
+#include "core/asking-player.h"
#include "game-option/birth-options.h"
#include "io/input-key-acceptor.h"
#include "main/sound-definitions-table.h"
#include "art-definition/art-sword-types.h"
#include "combat/attack-accuracy.h"
#include "combat/attack-criticality.h"
-#include "player-attack/player-attack.h"
+#include "core/asking-player.h"
#include "dungeon/dungeon.h"
#include "effect/effect-characteristics.h"
#include "main/sound-definitions-table.h"
#include "monster-race/race-flags2.h"
#include "monster-race/race-flags3.h"
#include "monster/monster-describer.h"
-#include "monster/monster-status.h"
#include "monster/monster-info.h"
+#include "monster/monster-status.h"
#include "object/item-use-flags.h"
+#include "player-attack/player-attack.h"
#include "player/avatar.h"
#include "player/player-damage.h"
#include "player/player-effects.h"
return FALSE;
}
- if (monster_csleep_remaining(m_ptr))
- {
+ if (monster_csleep_remaining(m_ptr)) {
if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5))
chg_virtue(attacker_ptr, V_COMPASSION, -1);
if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5))
#include "cmd-action/cmd-spell.h"
#include "cmd/cmd-basic.h"
+#include "core/asking-player.h"
#include "core/stuff-handler.h"
#include "game-option/disturbance-options.h"
#include "game-option/text-display-options.h"
#include "cmd-action/cmd-spell.h"
#include "cmd/cmd-basic.h"
+#include "core/asking-player.h"
#include "core/stuff-handler.h"
#include "floor/floor.h"
#include "game-option/disturbance-options.h"
#include "cmd-action/cmd-attack.h"
#include "cmd-io/cmd-dump.h"
#include "cmd/cmd-basic.h"
+#include "core/asking-player.h"
#include "core/sort.h"
#include "core/stuff-handler.h"
#include "effect/spells-effect-util.h"
#include "autopick/autopick-reader-writer.h"
#include "cmd-io/cmd-dump.h"
#include "cmd/cmd-basic.h"
+#include "core/asking-player.h"
#include "core/stuff-handler.h"
#include "floor/floor.h"
#include "game-option/disturbance-options.h"
#include "cmd-action/cmd-spell.h"
#include "cmd-io/cmd-dump.h"
#include "cmd-building/cmd-inn.h"
+#include "core/asking-player.h"
#include "core/scores.h"
#include "core/show-file.h"
#include "core/special-internal-keys.h"
#include "cmd-io/cmd-diary.h"
#include "cmd-io/diary-subtitle-table.h"
+#include "core/asking-player.h"
#include "core/show-file.h"
#include "game-option/play-record-options.h"
#include "main/sound-of-music.h"
/*!
- * @file cmd-dump.c
* @brief プレイヤーのインターフェイスに関するコマンドの実装 / Interface commands
* @date 2014/01/02
* @author
- * <pre>
* Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
* This software may be copied and distributed for educational, research,
* and not for profit purposes provided that this copyright and statement
* are included in all such copies. Other copyrights may also apply.
- * </pre>
- * @details
- * <pre>
- * A set of functions to maintain automatic dumps of various kinds.
- * The dump commands of original Angband simply add new lines to
- * existing files; these files will become bigger and bigger unless
- * an user deletes some or all of these files by hand at some
- * point.
- * These three functions automatically delete old dumped lines
- * before adding new ones. Since there are various kinds of automatic
- * dumps in a single file, we add a header and a footer with a type
- * name for every automatic dump, and kill old lines only when the
- * lines have the correct type of header and footer.
- * We need to be quite paranoid about correctness; the user might
- * (mistakenly) edit the file by hand, and see all their work come
- * to nothing on the next auto dump otherwise. The current code only
- * detects changes by noting inconsistencies between the actual number
- * of lines and the number written in the footer. Note that this will
- * not catch single-line edits.
- * </pre>
+ * 2020 Hourier Rearranged
*/
#include "cmd-io/cmd-dump.h"
#include "art-definition/art-bow-types.h"
#include "cmd-io/feeling-table.h"
+#include "core/asking-player.h"
#include "dungeon/quest.h"
#include "floor/floor-town.h"
#include "floor/floor.h"
#include "cmd-io/cmd-lore.h"
+#include "core/asking-player.h"
#include "core/sort.h"
#include "core/stuff-handler.h"
#include "game-option/game-play-options.h"
#include "cmd-io/cmd-macro.h"
#include "cmd-io/cmd-gameoption.h"
#include "cmd-io/macro-util.h"
+#include "core/asking-player.h"
#include "game-option/input-options.h"
#include "io/files-util.h"
#include "io/input-key-acceptor.h"
#include "cmd-io/cmd-process-screen.h"
#include "cmd/cmd-draw.h"
+#include "core/asking-player.h"
#include "core/stuff-handler.h"
#include "core/visuals-reseter.h"
#include "game-option/special-options.h"
#include "art-definition/random-art-effects.h"
#include "cmd-io/cmd-save.h"
#include "cmd/cmd-basic.h"
+#include "core/asking-player.h"
#include "core/sort.h"
#include "effect/effect-characteristics.h"
#include "effect/spells-effect-util.h"
#include "cmd-item/cmd-zaprod.h"
#include "cmd-item/cmd-zapwand.h"
#include "cmd/cmd-basic.h"
+#include "core/asking-player.h"
#include "core/stuff-handler.h"
#include "dungeon/quest.h"
#include "floor/floor-object.h"
#include "cmd-item/cmd-zaprod.h"
#include "cmd-item/cmd-zapwand.h"
#include "cmd/cmd-basic.h"
+#include "core/asking-player.h"
#include "game-option/disturbance-options.h"
#include "game-option/text-display-options.h"
#include "io/input-key-acceptor.h"
#include "cmd-item/cmd-smith.h"
#include "autopick/autopick.h"
#include "cmd/cmd-basic.h"
+#include "core/asking-player.h"
#include "game-option/text-display-options.h"
#include "inventory/player-inventory.h"
#include "io/input-key-acceptor.h"
#include "combat/attack-power-table.h"
#include "combat/shoot.h"
#include "combat/slaying.h"
+#include "core/asking-player.h"
#include "core/output-updater.h"
#include "core/stuff-handler.h"
#include "dungeon/dungeon.h"
#include "cmd/cmd-draw.h"
+#include "core/asking-player.h"
#include "core/stuff-handler.h"
#include "io/files-util.h"
#include "io/input-key-acceptor.h"
#include "cmd/cmd-visuals.h"
#include "cmd/cmd-draw.h"
+#include "core/asking-player.h"
#include "core/visuals-reseter.h"
#include "game-option/special-options.h"
#include "io/files-util.h"
--- /dev/null
+#include "core/asking-player.h"
+#include "core/stuff-handler.h"
+#include "game-option/input-options.h"
+#include "io/input-key-acceptor.h"
+#include "main/sound-of-music.h"
+#include "term/term-color-types.h"
+#include "view/display-messages.h"
+
+/*
+ * Get some string input at the cursor location.
+ * Assume the buffer is initialized to a default string.
+ *
+ * The default buffer is in Overwrite mode and displayed in yellow at
+ * first. Normal chars clear the yellow text and append the char in
+ * white text.
+ *
+ * LEFT (^B) and RIGHT (^F) movement keys move the cursor position.
+ * If the text is still displayed in yellow (Overwite mode), it will
+ * turns into white (Insert mode) when cursor moves.
+ *
+ * DELETE (^D) deletes a char at the cursor position.
+ * BACKSPACE (^H) deletes a char at the left of cursor position.
+ * ESCAPE clears the buffer and the window and returns FALSE.
+ * RETURN accepts the current buffer contents and returns TRUE.
+ */
+bool askfor_aux(char *buf, int len, bool numpad_cursor)
+{
+ /*
+ * Text color
+ * TERM_YELLOW : Overwrite mode
+ * TERM_WHITE : Insert mode
+ */
+ byte color = TERM_YELLOW;
+
+ int y, x;
+ Term_locate(&x, &y);
+ if (len < 1)
+ len = 1;
+ if ((x < 0) || (x >= 80))
+ x = 0;
+ if (x + len > 80)
+ len = 80 - x;
+
+ buf[len] = '\0';
+
+ int pos = 0;
+ while (TRUE) {
+ Term_erase(x, y, len);
+ Term_putstr(x, y, -1, color, buf);
+
+ Term_gotoxy(x + pos, y);
+ int skey = inkey_special(numpad_cursor);
+
+ switch (skey) {
+ case SKEY_LEFT:
+ case KTRL('b'): {
+ int i = 0;
+ color = TERM_WHITE;
+
+ if (0 == pos)
+ break;
+ while (TRUE) {
+ int next_pos = i + 1;
+#ifdef JP
+ if (iskanji(buf[i]))
+ next_pos++;
+#endif
+ if (next_pos >= pos)
+ break;
+
+ i = next_pos;
+ }
+
+ pos = i;
+ break;
+ }
+
+ case SKEY_RIGHT:
+ case KTRL('f'):
+ color = TERM_WHITE;
+ if ('\0' == buf[pos])
+ break;
+
+#ifdef JP
+ if (iskanji(buf[pos]))
+ pos += 2;
+ else
+ pos++;
+#else
+ pos++;
+#endif
+ break;
+
+ case ESCAPE:
+ buf[0] = '\0';
+ return FALSE;
+
+ case '\n':
+ case '\r':
+ return TRUE;
+
+ case '\010': {
+ int i = 0;
+ color = TERM_WHITE;
+ if (0 == pos)
+ break;
+ while (TRUE) {
+ int next_pos = i + 1;
+#ifdef JP
+ if (iskanji(buf[i]))
+ next_pos++;
+#endif
+ if (next_pos >= pos)
+ break;
+
+ i = next_pos;
+ }
+
+ pos = i;
+ }
+ /* Fall through */
+
+ case 0x7F:
+ case KTRL('d'): {
+ color = TERM_WHITE;
+ if ('\0' == buf[pos])
+ break;
+ int src = pos + 1;
+#ifdef JP
+ if (iskanji(buf[pos]))
+ src++;
+#endif
+
+ int dst = pos;
+ while ('\0' != (buf[dst++] = buf[src++]))
+ ;
+ break;
+ }
+
+ default: {
+ char tmp[100];
+ if (skey & SKEY_MASK)
+ break;
+ char c = (char)skey;
+
+ if (color == TERM_YELLOW) {
+ buf[0] = '\0';
+ color = TERM_WHITE;
+ }
+
+ strcpy(tmp, buf + pos);
+#ifdef JP
+ if (iskanji(c)) {
+ inkey_base = TRUE;
+ char next = inkey();
+ if (pos + 1 < len) {
+ buf[pos++] = c;
+ buf[pos++] = next;
+ } else {
+ bell();
+ }
+ } else
+#endif
+ {
+#ifdef JP
+ if (pos < len && (isprint(c) || iskana(c)))
+#else
+ if (pos < len && isprint(c))
+#endif
+ {
+ buf[pos++] = c;
+ } else {
+ bell();
+ }
+ }
+
+ buf[pos] = '\0';
+ angband_strcat(buf, tmp, len + 1);
+
+ break;
+ }
+ }
+ }
+}
+
+/*
+ * Get some string input at the cursor location.
+ *
+ * Allow to use numpad keys as cursor keys.
+ */
+bool askfor(char *buf, int len) { return askfor_aux(buf, len, TRUE); }
+
+/*
+ * Get a string from the user
+ *
+ * The "prompt" should take the form "Prompt: "
+ *
+ * Note that the initial contents of the string is used as
+ * the default response, so be sure to "clear" it if needed.
+ *
+ * We clear the input, and return FALSE, on "ESCAPE".
+ */
+bool get_string(concptr prompt, char *buf, int len)
+{
+ bool res;
+ msg_print(NULL);
+ prt(prompt, 0, 0);
+ res = askfor(buf, len);
+ prt("", 0, 0);
+ return (res);
+}
+
+/*
+ * Verify something with the user
+ *
+ * The "prompt" should take the form "Query? "
+ *
+ * Note that "[y/n]" is appended to the prompt.
+ */
+bool get_check(concptr prompt) { return get_check_strict(p_ptr, prompt, 0); }
+
+/*
+ * Verify something with the user strictly
+ *
+ * mode & CHECK_OKAY_CANCEL : force user to answer 'O'kay or 'C'ancel
+ * mode & CHECK_NO_ESCAPE : don't allow ESCAPE key
+ * mode & CHECK_NO_HISTORY : no message_add
+ * mode & CHECK_DEFAULT_Y : accept any key as y, except n and Esc.
+ */
+bool get_check_strict(player_type *player_ptr, concptr prompt, BIT_FLAGS mode)
+{
+ char buf[80];
+ if (auto_more) {
+ player_ptr->window |= PW_MESSAGE;
+ handle_stuff(player_ptr);
+ num_more = 0;
+ }
+
+ msg_print(NULL);
+ if (!rogue_like_commands)
+ mode &= ~CHECK_OKAY_CANCEL;
+
+ if (mode & CHECK_OKAY_CANCEL) {
+ angband_strcpy(buf, prompt, sizeof(buf) - 15);
+ strcat(buf, "[(O)k/(C)ancel]");
+ } else if (mode & CHECK_DEFAULT_Y) {
+ angband_strcpy(buf, prompt, sizeof(buf) - 5);
+ strcat(buf, "[Y/n]");
+ } else {
+ angband_strcpy(buf, prompt, sizeof(buf) - 5);
+ strcat(buf, "[y/n]");
+ }
+
+ prt(buf, 0, 0);
+ if (!(mode & CHECK_NO_HISTORY) && player_ptr->playing) {
+ message_add(buf);
+ player_ptr->window |= (PW_MESSAGE);
+ handle_stuff(player_ptr);
+ }
+
+ bool flag = FALSE;
+ while (TRUE) {
+ int i = inkey();
+
+ if (!(mode & CHECK_NO_ESCAPE)) {
+ if (i == ESCAPE) {
+ flag = FALSE;
+ break;
+ }
+ }
+
+ if (mode & CHECK_OKAY_CANCEL) {
+ if (i == 'o' || i == 'O') {
+ flag = TRUE;
+ break;
+ } else if (i == 'c' || i == 'C') {
+ flag = FALSE;
+ break;
+ }
+ } else {
+ if (i == 'y' || i == 'Y') {
+ flag = TRUE;
+ break;
+ } else if (i == 'n' || i == 'N') {
+ flag = FALSE;
+ break;
+ }
+ }
+
+ if (mode & CHECK_DEFAULT_Y) {
+ flag = TRUE;
+ break;
+ }
+
+ bell();
+ }
+
+ prt("", 0, 0);
+ return flag;
+}
+
+/*
+ * Prompts for a keypress
+ *
+ * The "prompt" should take the form "Command: "
+ *
+ * Returns TRUE unless the character is "Escape"
+ */
+bool get_com(concptr prompt, char *command, bool z_escape)
+{
+ msg_print(NULL);
+ prt(prompt, 0, 0);
+ if (get_com_no_macros)
+ *command = (char)inkey_special(FALSE);
+ else
+ *command = inkey();
+
+ prt("", 0, 0);
+ if (*command == ESCAPE)
+ return FALSE;
+ if (z_escape && ((*command == 'z') || (*command == 'Z')))
+ return FALSE;
+
+ return TRUE;
+}
+
+/*
+ * Request a "quantity" from the user
+ *
+ * Hack -- allow "command_arg" to specify a quantity
+ */
+QUANTITY get_quantity(concptr prompt, QUANTITY max)
+{
+ bool res;
+ char tmp[80];
+ char buf[80];
+
+ QUANTITY amt;
+ if (command_arg) {
+ amt = command_arg;
+ command_arg = 0;
+ if (amt > max)
+ amt = max;
+
+ return (amt);
+ }
+
+ COMMAND_CODE code;
+ bool result = repeat_pull(&code);
+ amt = (QUANTITY)code;
+ if ((max != 1) && result) {
+ if (amt > max)
+ amt = max;
+ if (amt < 0)
+ amt = 0;
+
+ return (amt);
+ }
+
+ if (!prompt) {
+ sprintf(tmp, _("いくつですか (1-%d): ", "Quantity (1-%d): "), max);
+ prompt = tmp;
+ }
+
+ msg_print(NULL);
+ prt(prompt, 0, 0);
+ amt = 1;
+ sprintf(buf, "%d", amt);
+
+ /*
+ * Ask for a quantity
+ * Don't allow to use numpad as cursor key.
+ */
+ res = askfor_aux(buf, 6, FALSE);
+
+ prt("", 0, 0);
+ if (!res)
+ return 0;
+
+ amt = (COMMAND_CODE)atoi(buf);
+ if (isalpha(buf[0]))
+ amt = max;
+ if (amt > max)
+ amt = max;
+ if (amt < 0)
+ amt = 0;
+ if (amt)
+ repeat_push((COMMAND_CODE)amt);
+
+ return (amt);
+}
+
+/*
+ * Pause for user response
+ */
+void pause_line(int row)
+{
+ prt("", row, 0);
+ put_str(_("[ 何かキーを押して下さい ]", "[Press any key to continue]"), row, _(26, 23));
+
+ (void)inkey();
+ prt("", row, 0);
+}
--- /dev/null
+#pragma once
+
+#include "system/angband.h"
+
+/*
+ * Bit flags for control of get_check_strict()
+ */
+#define CHECK_OKAY_CANCEL 0x01
+#define CHECK_NO_ESCAPE 0x02
+#define CHECK_NO_HISTORY 0x04
+#define CHECK_DEFAULT_Y 0x08
+
+bool askfor_aux(char *buf, int len, bool numpad_cursor);
+bool askfor(char *buf, int len);
+bool get_string(concptr prompt, char *buf, int len);
+bool get_check(concptr prompt);
+bool get_check_strict(player_type *player_ptr, concptr prompt, BIT_FLAGS mode);
+bool get_com(concptr prompt, char *command, bool z_escape);
+QUANTITY get_quantity(concptr prompt, QUANTITY max);
+void pause_line(int row);
#include "core/game-closer.h"
#include "cmd-io/cmd-save.h"
+#include "core/asking-player.h"
#include "core/scores.h"
#include "core/stuff-handler.h"
#include "game-option/cheat-options.h"
#include "birth/character-builder.h"
#include "birth/inventory-initializer.h"
#include "cmd-io/cmd-gameoption.h"
+#include "core/asking-player.h"
#include "core/game-closer.h"
#include "core/output-updater.h"
#include "core/player-processor.h"
#include "core/scores.h"
#include "cmd-io/cmd-dump.h"
+#include "core/asking-player.h"
#include "core/turn-compensator.h"
#include "dungeon/dungeon.h"
#include "floor/floor.h"
#include "core/show-file.h"
+#include "core/asking-player.h"
#include "io/files-util.h"
#include "io/input-key-acceptor.h"
#include "main/sound-of-music.h"
#include "dungeon/quest.h"
#include "art-definition/art-bow-types.h"
#include "cmd-io/cmd-dump.h"
+#include "core/asking-player.h"
#include "dungeon/dungeon.h"
#include "floor/floor-events.h"
#include "floor/floor-object.h"
#include "cmd-building/cmd-building.h"
#include "cmd-io/cmd-dump.h"
#include "cmd/cmd-basic.h"
+#include "core/asking-player.h"
#include "dungeon/dungeon.h"
#include "dungeon/quest.h"
#include "floor/floor-events.h"
#include "floor/pattern-walk.h"
#include "cmd-io/cmd-save.h"
+#include "core/asking-player.h"
#include "dungeon/dungeon.h"
#include "dungeon/quest.h"
#include "game-option/birth-options.h"
*/
#include "floor/wild.h"
-#include "info-reader/fixed-map-parser.h"
+#include "core/asking-player.h"
#include "dungeon/dungeon.h"
#include "dungeon/quest.h"
#include "floor/floor-town.h"
#include "game-option/map-screen-options.h"
#include "grid/feature.h"
#include "grid/grid.h"
+#include "info-reader/fixed-map-parser.h"
#include "info-reader/parse-error-types.h"
#include "io/files-util.h"
#include "io/tokenizer.h"
#include "monster-floor/monster-generator.h"
#include "monster-floor/monster-remover.h"
#include "monster-floor/monster-summon.h"
+#include "monster-floor/place-monster-types.h"
+#include "monster/monster-info.h"
#include "monster/monster-status.h"
#include "monster/monster-util.h"
-#include "monster/monster-info.h"
-#include "monster-floor/place-monster-types.h"
#include "player/player-effects.h"
#include "player/player-status.h"
#include "realm/realm-names-table.h"
#include "inventory/inventory-curse.h"
#include "art-definition/art-accessory-types.h"
+#include "core/asking-player.h"
#include "io/files-util.h"
#include "monster-floor/monster-summon.h"
#include "monster-floor/place-monster-types.h"
#include "inventory/player-inventory.h"
+#include "core/asking-player.h"
#include "core/stuff-handler.h"
#include "floor/floor-object.h"
#include "floor/floor.h"
#include "io/chuukei.h"
#include "cmd-io/cmd-dump.h"
#include "cmd/cmd-draw.h"
+#include "core/asking-player.h"
#include "io/files-util.h"
#include "io/inet.h"
#include "io/signal-handlers.h"
*/
#include "io/files-util.h"
+#include "core/asking-player.h"
#include "io-dump/character-dump.h"
#include "io/input-key-acceptor.h"
#include "io/uid-checker.h"
#include "cmd/cmd-basic.h"
#include "cmd/cmd-draw.h"
#include "cmd/cmd-visuals.h"
+#include "core/asking-player.h"
#include "core/special-internal-keys.h"
#include "dungeon/dungeon.h"
#include "dungeon/quest.h" // do_cmd_quest() がある。後で移設する.
#include "io/read-pref-file.h"
#include "autopick/autopick-pref-processor.h"
#include "autopick/autopick-reader-writer.h"
+#include "core/asking-player.h"
#include "io-dump/dump-remover.h"
#include "io/files-util.h"
#include "io/interpret-pref-file.h"
*/
#include "io/report.h"
+#include "core/asking-player.h"
#include "core/stuff-handler.h"
#include "core/turn-compensator.h"
#include "core/visuals-reseter.h"
#include "io/targeting.h"
#include "cmd-action/cmd-pet.h"
#include "cmd-building/cmd-building.h"
+#include "core/asking-player.h"
#include "core/sort.h"
#include "core/stuff-handler.h"
#include "info-reader/fixed-map-parser.h"
#include "autopick/autopick-entry.h"
#include "autopick/autopick-methods-table.h"
#include "autopick/autopick-reader-writer.h"
+#include "core/asking-player.h"
#include "core/show-file.h"
#include "io-dump/dump-util.h"
#include "util/angband-files.h"
#include "market/arena.h"
+#include "core/asking-player.h"
#include "core/show-file.h"
#include "core/stuff-handler.h"
#include "dungeon/dungeon.h"
#include "market/bounty.h"
#include "autopick/autopick.h"
+#include "core/asking-player.h"
#include "core/stuff-handler.h"
#include "dungeon/dungeon.h"
#include "floor/floor.h"
#include "market/building-craft-fix.h"
#include "art-definition/art-sword-types.h"
+#include "core/asking-player.h"
#include "core/stuff-handler.h"
#include "inventory/inventory-object.h"
#include "inventory/player-inventory.h"
#include "market/building-monster.h"
+#include "core/asking-player.h"
#include "core/sort.h"
#include "core/stuff-handler.h"
#include "game-option/game-play-options.h"
#include "market/building-recharger.h"
#include "autopick/autopick.h"
+#include "core/asking-player.h"
#include "inventory/player-inventory.h"
#include "market/building-util.h"
#include "object/item-use-flags.h"
#include "play-gamble.h"
+#include "core/asking-player.h"
#include "core/show-file.h"
#include "io/input-key-acceptor.h"
#include "market/building-actions-table.h"
#include "mind/mind-sniper.h"
#include "cmd/cmd-basic.h"
+#include "core/asking-player.h"
#include "core/stuff-handler.h"
#include "floor/floor.h"
#include "game-option/text-display-options.h"
#include "cmd-action/cmd-attack.h"
#include "cmd-action/cmd-spell.h"
#include "cmd/cmd-basic.h"
+#include "core/asking-player.h"
#include "core/stuff-handler.h"
#include "effect/effect-characteristics.h"
#include "effect/spells-effect-util.h"
/*!
- * @file racial.c
* @brief レイシャルと突然変異の技能処理 / Racial powers (and mutations)
* @date 2014/01/08
* @author
#include "cmd-item/cmd-magiceat.h"
#include "cmd-item/cmd-zapwand.h"
#include "cmd/cmd-basic.h"
+#include "core/asking-player.h"
#include "core/stuff-handler.h"
#include "effect/spells-effect-util.h"
#include "game-option/disturbance-options.h"
#include "system/angband.h"
#include "cmd-action/cmd-spell.h"
#include "cmd/cmd-basic.h"
+#include "core/asking-player.h"
#include "core/stuff-handler.h"
#include "floor/floor.h"
#include "game-option/disturbance-options.h"
#include "mutation/mutation.h"
#include "cmd-io/cmd-dump.h"
#include "cmd/cmd-basic.h"
+#include "core/asking-player.h"
#include "core/show-file.h"
#include "core/stuff-handler.h"
#include "effect/spells-effect-util.h"
#include "art-definition/art-weapon-types.h"
#include "art-definition/random-art-effects.h"
#include "cmd-item/cmd-smith.h"
+#include "core/asking-player.h"
#include "floor/floor-object.h"
#include "floor/floor.h"
#include "grid/grid.h"
#include "object/warning.h"
#include "art-definition/art-sword-types.h"
+#include "core/asking-player.h"
#include "dungeon/dungeon.h"
#include "floor/floor.h"
#include "game-option/input-options.h"
#include "autopick/autopick-pref-processor.h"
#include "cmd-building/cmd-building.h"
#include "cmd-io/cmd-process-screen.h"
+#include "core/asking-player.h"
#include "core/stuff-handler.h"
#include "dungeon/quest.h"
#include "floor/floor.h"
#include "autopick/autopick.h"
#include "cmd-action/cmd-attack.h"
#include "cmd/cmd-basic.h"
+#include "core/asking-player.h"
#include "core/special-internal-keys.h"
#include "core/stuff-handler.h"
#include "dungeon/dungeon.h"
#include "cmd-io/cmd-dump.h"
#include "cmd-item/cmd-magiceat.h"
#include "combat/attack-power-table.h"
+#include "core/asking-player.h"
#include "core/stuff-handler.h"
#include "dungeon/dungeon.h"
#include "dungeon/quest.h"
*/
#include "process-death.h"
+#include "core/asking-player.h"
#include "core/stuff-handler.h"
#include "floor/floor-town.h"
#include "floor/floor.h"
#include "player/process-name.h"
#include "autopick/autopick-reader-writer.h"
+#include "core/asking-player.h"
#include "io/files-util.h"
#include "player/player-personality.h"
#include "term/term-color-types.h"
#include "realm/realm-arcane.h"
#include "cmd-action/cmd-spell.h"
+#include "core/asking-player.h"
#include "io/targeting.h"
#include "monster-floor/monster-summon.h"
#include "monster-floor/place-monster-types.h"
#include "realm/realm-chaos.h"
#include "cmd-action/cmd-spell.h"
+#include "core/asking-player.h"
#include "effect/effect-characteristics.h"
#include "io/targeting.h"
#include "player/player-class.h"
/*!
- * @file hex.c
* @brief 呪術の処理実装 / Hex code
* @date 2014/01/14
* @author
#include "realm/realm-hex.h"
#include "cmd-action/cmd-spell.h"
#include "cmd-item/cmd-quaff.h"
+#include "core/asking-player.h"
#include "effect/effect-characteristics.h"
#include "floor/floor.h"
#include "grid/grid.h"
#include "cmd-action/cmd-spell.h"
#include "cmd/cmd-basic.h"
#include "combat/combat-options-type.h"
+#include "core/asking-player.h"
#include "core/stuff-handler.h"
#include "dungeon/dungeon.h"
#include "effect/effect-characteristics.h"
#include "realm/realm-sorcery.h"
#include "cmd-action/cmd-spell.h"
+#include "core/asking-player.h"
#include "io/targeting.h"
#include "player/avatar.h"
#include "player/player-effects.h"
#include "realm/realm-trump.h"
#include "cmd-action/cmd-spell.h"
+#include "core/asking-player.h"
#include "effect/spells-effect-util.h"
#include "game-option/input-options.h"
#include "io/targeting.h"
#include "spell-kind/spells-genocide.h"
+#include "core/asking-player.h"
#include "core/stuff-handler.h"
#include "dungeon/quest.h"
#include "floor/floor.h"
#include "spell-kind/spells-pet.h"
+#include "core/asking-player.h"
#include "effect/effect-characteristics.h"
#include "floor/floor.h"
#include "game-option/play-record-options.h"
#include "spell-kind/spells-teleport.h"
#include "art-definition/art-bow-types.h"
#include "cmd-io/cmd-save.h"
+#include "core/asking-player.h"
#include "dungeon/dungeon.h"
#include "dungeon/quest.h"
#include "effect/effect-characteristics.h"
-#include "system/angband.h"
-#include "spell-kind/spells-world.h"
-#include "util/util.h"
+#include "spell-kind/spells-world.h"
+#include "core/asking-player.h"
#include "world/world.h"
/*!
return TRUE;
}
-
-extern bool set_gametime(void);
+#pragma once
+
+#include "system/angband.h"
+
+bool set_gametime(void);
#include "spell-realm/spells-hex.h"
+#include "core/asking-player.h"
#include "floor/floor.h"
#include "player/player-effects.h" // todo 相互参照している.
#include "player/player-skill.h"
#include "art-definition/art-weapon-types.h"
#include "autopick/autopick.h"
#include "cmd/cmd-basic.h"
+#include "core/asking-player.h"
#include "floor/floor-object.h"
#include "floor/floor.h"
#include "game-option/disturbance-options.h"
#include "cmd-action/cmd-spell.h"
#include "cmd-building/cmd-building.h"
#include "cmd-io/cmd-dump.h"
+#include "core/asking-player.h"
#include "core/speed-table.h"
#include "core/stuff-handler.h"
#include "dungeon/dungeon.h"
#include "cmd/cmd-basic.h"
#include "cmd/cmd-draw.h"
#include "cmd/cmd-visuals.h"
+#include "core/asking-player.h"
#include "mind/mind-sniper.h"
#include "core/stuff-handler.h"
#include "floor/floor-events.h"
#include "cmd-io/cmd-dump.h"
#include "cmd-io/cmd-menu-content-table.h"
#include "cmd-io/macro-util.h"
+#include "core/asking-player.h"
#include "core/output-updater.h"
#include "core/stuff-handler.h"
#include "dungeon/quest.h"
/*
- * Get some string input at the cursor location.
- * Assume the buffer is initialized to a default string.
- *
- * The default buffer is in Overwrite mode and displayed in yellow at
- * first. Normal chars clear the yellow text and append the char in
- * white text.
- *
- * LEFT (^B) and RIGHT (^F) movement keys move the cursor position.
- * If the text is still displayed in yellow (Overwite mode), it will
- * turns into white (Insert mode) when cursor moves.
- *
- * DELETE (^D) deletes a char at the cursor position.
- * BACKSPACE (^H) deletes a char at the left of cursor position.
- * ESCAPE clears the buffer and the window and returns FALSE.
- * RETURN accepts the current buffer contents and returns TRUE.
- */
-bool askfor_aux(char *buf, int len, bool numpad_cursor)
-{
- /*
- * Text color
- * TERM_YELLOW : Overwrite mode
- * TERM_WHITE : Insert mode
- */
- byte color = TERM_YELLOW;
-
- int y, x;
- Term_locate(&x, &y);
- if (len < 1) len = 1;
- if ((x < 0) || (x >= 80)) x = 0;
- if (x + len > 80) len = 80 - x;
-
- buf[len] = '\0';
-
- int pos = 0;
- while (TRUE)
- {
- Term_erase(x, y, len);
- Term_putstr(x, y, -1, color, buf);
-
- Term_gotoxy(x + pos, y);
- int skey = inkey_special(numpad_cursor);
-
- switch (skey)
- {
- case SKEY_LEFT:
- case KTRL('b'):
- {
- int i = 0;
- color = TERM_WHITE;
-
- if (0 == pos) break;
- while (TRUE)
- {
- int next_pos = i + 1;
-#ifdef JP
- if (iskanji(buf[i])) next_pos++;
-#endif
- if (next_pos >= pos) break;
-
- i = next_pos;
- }
-
- pos = i;
- break;
- }
-
- case SKEY_RIGHT:
- case KTRL('f'):
- color = TERM_WHITE;
- if ('\0' == buf[pos]) break;
-
-#ifdef JP
- if (iskanji(buf[pos])) pos += 2;
- else pos++;
-#else
- pos++;
-#endif
- break;
-
- case ESCAPE:
- buf[0] = '\0';
- return FALSE;
-
- case '\n':
- case '\r':
- return TRUE;
-
- case '\010':
- {
- int i = 0;
- color = TERM_WHITE;
- if (0 == pos) break;
- while (TRUE)
- {
- int next_pos = i + 1;
-#ifdef JP
- if (iskanji(buf[i])) next_pos++;
-#endif
- if (next_pos >= pos) break;
-
- i = next_pos;
- }
-
- pos = i;
- }
- /* Fall through */
-
- case 0x7F:
- case KTRL('d'):
- {
- color = TERM_WHITE;
- if ('\0' == buf[pos]) break;
- int src = pos + 1;
-#ifdef JP
- if (iskanji(buf[pos])) src++;
-#endif
-
- int dst = pos;
- while ('\0' != (buf[dst++] = buf[src++]));
- break;
- }
-
- default:
- {
- char tmp[100];
- if (skey & SKEY_MASK) break;
- char c = (char)skey;
-
- if (color == TERM_YELLOW)
- {
- buf[0] = '\0';
- color = TERM_WHITE;
- }
-
- strcpy(tmp, buf + pos);
-#ifdef JP
- if (iskanji(c))
- {
- inkey_base = TRUE;
- char next = inkey();
- if (pos + 1 < len)
- {
- buf[pos++] = c;
- buf[pos++] = next;
- }
- else
- {
- bell();
- }
- }
- else
-#endif
- {
-#ifdef JP
- if (pos < len && (isprint(c) || iskana(c)))
-#else
- if (pos < len && isprint(c))
-#endif
- {
- buf[pos++] = c;
- }
- else
- {
- bell();
- }
- }
-
- buf[pos] = '\0';
- angband_strcat(buf, tmp, len + 1);
-
- break;
- }
- }
-
- }
-}
-
-
-/*
- * Get some string input at the cursor location.
- *
- * Allow to use numpad keys as cursor keys.
- */
-bool askfor(char *buf, int len)
-{
- return askfor_aux(buf, len, TRUE);
-}
-
-
-/*
- * Get a string from the user
- *
- * The "prompt" should take the form "Prompt: "
- *
- * Note that the initial contents of the string is used as
- * the default response, so be sure to "clear" it if needed.
- *
- * We clear the input, and return FALSE, on "ESCAPE".
- */
-bool get_string(concptr prompt, char *buf, int len)
-{
- bool res;
- msg_print(NULL);
- prt(prompt, 0, 0);
- res = askfor(buf, len);
- prt("", 0, 0);
- return (res);
-}
-
-
-/*
- * Verify something with the user
- *
- * The "prompt" should take the form "Query? "
- *
- * Note that "[y/n]" is appended to the prompt.
- */
-bool get_check(concptr prompt)
-{
- return get_check_strict(p_ptr, prompt, 0);
-}
-
-
-/*
- * Verify something with the user strictly
- *
- * mode & CHECK_OKAY_CANCEL : force user to answer 'O'kay or 'C'ancel
- * mode & CHECK_NO_ESCAPE : don't allow ESCAPE key
- * mode & CHECK_NO_HISTORY : no message_add
- * mode & CHECK_DEFAULT_Y : accept any key as y, except n and Esc.
- */
-bool get_check_strict(player_type *player_ptr, concptr prompt, BIT_FLAGS mode)
-{
- char buf[80];
- if (auto_more)
- {
- player_ptr->window |= PW_MESSAGE;
- handle_stuff(player_ptr);
- num_more = 0;
- }
-
- msg_print(NULL);
- if (!rogue_like_commands)
- mode &= ~CHECK_OKAY_CANCEL;
-
- if (mode & CHECK_OKAY_CANCEL)
- {
- angband_strcpy(buf, prompt, sizeof(buf) - 15);
- strcat(buf, "[(O)k/(C)ancel]");
- }
- else if (mode & CHECK_DEFAULT_Y)
- {
- angband_strcpy(buf, prompt, sizeof(buf) - 5);
- strcat(buf, "[Y/n]");
- }
- else
- {
- angband_strcpy(buf, prompt, sizeof(buf) - 5);
- strcat(buf, "[y/n]");
- }
-
- prt(buf, 0, 0);
- if (!(mode & CHECK_NO_HISTORY) && player_ptr->playing)
- {
- message_add(buf);
- player_ptr->window |= (PW_MESSAGE);
- handle_stuff(player_ptr);
- }
-
- bool flag = FALSE;
- while (TRUE)
- {
- int i = inkey();
-
- if (!(mode & CHECK_NO_ESCAPE))
- {
- if (i == ESCAPE)
- {
- flag = FALSE;
- break;
- }
- }
-
- if (mode & CHECK_OKAY_CANCEL)
- {
- if (i == 'o' || i == 'O')
- {
- flag = TRUE;
- break;
- }
- else if (i == 'c' || i == 'C')
- {
- flag = FALSE;
- break;
- }
- }
- else
- {
- if (i == 'y' || i == 'Y')
- {
- flag = TRUE;
- break;
- }
- else if (i == 'n' || i == 'N')
- {
- flag = FALSE;
- break;
- }
- }
-
- if (mode & CHECK_DEFAULT_Y)
- {
- flag = TRUE;
- break;
- }
-
- bell();
- }
-
- prt("", 0, 0);
- return flag;
-}
-
-
-/*
- * Prompts for a keypress
- *
- * The "prompt" should take the form "Command: "
- *
- * Returns TRUE unless the character is "Escape"
- */
-bool get_com(concptr prompt, char *command, bool z_escape)
-{
- msg_print(NULL);
- prt(prompt, 0, 0);
- if (get_com_no_macros)
- *command = (char)inkey_special(FALSE);
- else
- *command = inkey();
-
- prt("", 0, 0);
- if (*command == ESCAPE) return FALSE;
- if (z_escape && ((*command == 'z') || (*command == 'Z'))) return FALSE;
-
- return TRUE;
-}
-
-
-/*
- * Request a "quantity" from the user
- *
- * Hack -- allow "command_arg" to specify a quantity
- */
-QUANTITY get_quantity(concptr prompt, QUANTITY max)
-{
- bool res;
- char tmp[80];
- char buf[80];
-
- QUANTITY amt;
- if (command_arg)
- {
- amt = command_arg;
- command_arg = 0;
- if (amt > max) amt = max;
-
- return (amt);
- }
-
- COMMAND_CODE code;
- bool result = repeat_pull(&code);
- amt = (QUANTITY)code;
- if ((max != 1) && result)
- {
- if (amt > max) amt = max;
- if (amt < 0) amt = 0;
-
- return (amt);
- }
-
- if (!prompt)
- {
- sprintf(tmp, _("いくつですか (1-%d): ", "Quantity (1-%d): "), max);
- prompt = tmp;
- }
-
- msg_print(NULL);
- prt(prompt, 0, 0);
- amt = 1;
- sprintf(buf, "%d", amt);
-
- /*
- * Ask for a quantity
- * Don't allow to use numpad as cursor key.
- */
- res = askfor_aux(buf, 6, FALSE);
-
- prt("", 0, 0);
- if (!res) return 0;
-
- amt = (COMMAND_CODE)atoi(buf);
- if (isalpha(buf[0])) amt = max;
- if (amt > max) amt = max;
- if (amt < 0) amt = 0;
- if (amt) repeat_push((COMMAND_CODE)amt);
-
- return (amt);
-}
-
-
-/*
- * Pause for user response
- */
-void pause_line(int row)
-{
- prt("", row, 0);
- put_str(_("[ 何かキーを押して下さい ]", "[Press any key to continue]"), row, _(26, 23));
-
- (void)inkey();
- prt("", row, 0);
-}
-
-/*
* Hack -- special buffer to hold the action of the current keymap
*/
static char request_command_buffer[256];
extern void c_roff(TERM_COLOR attr, concptr str);
extern void roff(concptr str);
extern void clear_from(int row);
-extern bool askfor_aux(char *buf, int len, bool numpad_cursor);
-extern bool askfor(char *buf, int len);
-extern bool get_string(concptr prompt, char *buf, int len);
-/*
- * Bit flags for control of get_check_strict()
- */
-#define CHECK_OKAY_CANCEL 0x01
-#define CHECK_NO_ESCAPE 0x02
-#define CHECK_NO_HISTORY 0x04
-#define CHECK_DEFAULT_Y 0x08
-extern bool get_check(concptr prompt);
-extern bool get_check_strict(player_type *player_ptr, concptr prompt, BIT_FLAGS mode);
-
-extern bool get_com(concptr prompt, char *command, bool z_escape);
-extern QUANTITY get_quantity(concptr prompt, QUANTITY max);
-extern void pause_line(int row);
extern void request_command(player_type *player_ptr, int shopping);
extern bool is_a_vowel(int ch);
extern int get_keymap_dir(char ch);
#include "cmd-io/cmd-help.h"
#include "cmd-io/cmd-save.h"
#include "cmd/cmd-draw.h"
+#include "core/asking-player.h"
#include "core/stuff-handler.h"
#include "dungeon/dungeon.h"
#include "dungeon/quest.h"