<ClCompile Include="..\..\src\action\action-limited.c" />\r
<ClCompile Include="..\..\src\action\open-close-execution.c" />\r
<ClCompile Include="..\..\src\action\open-util.c" />\r
+ <ClCompile Include="..\..\src\action\tunnel-execution.c" />\r
<ClCompile Include="..\..\src\birth\auto-roller.c" />\r
<ClCompile Include="..\..\src\birth\birth-body-spec.c" />\r
<ClCompile Include="..\..\src\birth\birth-select-class.c" />\r
<ClInclude Include="..\..\src\action\action-limited.h" />\r
<ClInclude Include="..\..\src\action\open-close-execution.h" />\r
<ClInclude Include="..\..\src\action\open-util.h" />\r
+ <ClInclude Include="..\..\src\action\tunnel-execution.h" />\r
<ClInclude Include="..\..\src\art-definition\art-accessory-types.h" />\r
<ClInclude Include="..\..\src\art-definition\art-armor-types.h" />\r
<ClInclude Include="..\..\src\art-definition\art-bow-types.h" />\r
<ClCompile Include="..\..\src\action\open-close-execution.c">
<Filter>action</Filter>
</ClCompile>
+ <ClCompile Include="..\..\src\action\tunnel-execution.c">
+ <Filter>action</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\cmd\cmd-basic.h">
<ClInclude Include="..\..\src\action\open-close-execution.h">
<Filter>action</Filter>
</ClInclude>
+ <ClInclude Include="..\..\src\action\tunnel-execution.h">
+ <Filter>action</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\src\wall.bmp" />
action/action-limited.c action/action-limited.h \
action/open-util.c action/open-util.h \
action/open-close-execution.c action/open-close-execution.h \
- cmd-action/cmd-open-close.c cmd-action/cmd-open-close.h \
+ action/tunnel-execution.c action/tunnel-execution.h \
\
art-definition/art-accessory-types.h \
art-definition/art-armor-types.h \
cmd-action/cmd-hissatsu.c cmd-action/cmd-hissatsu.h \
cmd-action/cmd-mane.c cmd-action/cmd-mane.h \
cmd-action/cmd-move.c cmd-action/cmd-move.h \
+ cmd-action/cmd-open-close.c cmd-action/cmd-open-close.h \
cmd-action/cmd-pet.c cmd-action/cmd-pet.h \
cmd-action/cmd-spell.c cmd-action/cmd-spell.h \
\
--- /dev/null
+#include "action/tunnel-execution.h"
+#include "core/player-update-types.h"
+#include "floor/floor.h"
+#include "grid/feature.h"
+#include "grid/grid.h"
+#include "main/sound-definitions-table.h"
+#include "main/sound-of-music.h"
+#include "player/avatar.h"
+#include "player/player-move.h"
+#include "util/bit-flags-calculator.h"
+#include "view/display-messages.h"
+
+/*!
+ * @brief 「掘る」コマンドを該当のマスに行えるかの判定と結果メッセージの表示 /
+ * Determine if a given grid may be "tunneled"
+ * @param y 対象を行うマスのY座標
+ * @param x 対象を行うマスのX座標
+ * @return
+ */
+static bool do_cmd_tunnel_test(floor_type *floor_ptr, POSITION y, POSITION x)
+{
+ grid_type *g_ptr = &floor_ptr->grid_array[y][x];
+ if (!(g_ptr->info & CAVE_MARK)) {
+ msg_print(_("そこには何も見当たらない。", "You see nothing there."));
+ return FALSE;
+ }
+
+ if (!cave_have_flag_grid(g_ptr, FF_TUNNEL)) {
+ msg_print(_("そこには掘るものが見当たらない。", "You see nothing there to tunnel."));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/*!
+ * @brief 「掘る」動作コマンドのサブルーチン /
+ * Perform the basic "tunnel" command
+ * @param y 対象を行うマスのY座標
+ * @param x 対象を行うマスのX座標
+ * @return 実際に処理が行われた場合TRUEを返す。
+ * @details
+ * Assumes that no monster is blocking the destination
+ * Do not use twall anymore
+ * Returns TRUE if repeated commands may continue
+ */
+bool exe_tunnel(player_type *creature_ptr, POSITION y, POSITION x)
+{
+ grid_type *g_ptr;
+ feature_type *f_ptr, *mimic_f_ptr;
+ int power;
+ concptr name;
+ bool more = FALSE;
+ if (!do_cmd_tunnel_test(creature_ptr->current_floor_ptr, y, x))
+ return FALSE;
+
+ take_turn(creature_ptr, 100);
+ g_ptr = &creature_ptr->current_floor_ptr->grid_array[y][x];
+ f_ptr = &f_info[g_ptr->feat];
+ power = f_ptr->power;
+ mimic_f_ptr = &f_info[get_feat_mimic(g_ptr)];
+ name = f_name + mimic_f_ptr->name;
+ sound(SOUND_DIG);
+ if (have_flag(f_ptr->flags, FF_PERMANENT)) {
+ if (have_flag(mimic_f_ptr->flags, FF_PERMANENT))
+ msg_print(_("この岩は硬すぎて掘れないようだ。", "This seems to be permanent rock."));
+ else
+ msg_print(_("そこは掘れない!", "You can't tunnel through that!"));
+ } else if (have_flag(f_ptr->flags, FF_CAN_DIG)) {
+ if (creature_ptr->skill_dig > randint0(20 * power)) {
+ msg_format(_("%sをくずした。", "You have removed the %s."), name);
+ cave_alter_feat(creature_ptr, y, x, FF_TUNNEL);
+ creature_ptr->update |= PU_FLOW;
+ } else {
+ msg_format(_("%sをくずしている。", "You dig into the %s."), name);
+ more = TRUE;
+ }
+ } else {
+ bool tree = have_flag(mimic_f_ptr->flags, FF_TREE);
+ if (creature_ptr->skill_dig > power + randint0(40 * power)) {
+ if (tree)
+ msg_format(_("%sを切り払った。", "You have cleared away the %s."), name);
+ else {
+ msg_print(_("穴を掘り終えた。", "You have finished the tunnel."));
+ creature_ptr->update |= (PU_FLOW);
+ }
+
+ if (have_flag(f_ptr->flags, FF_GLASS))
+ sound(SOUND_GLASS);
+
+ cave_alter_feat(creature_ptr, y, x, FF_TUNNEL);
+ chg_virtue(creature_ptr, V_DILIGENCE, 1);
+ chg_virtue(creature_ptr, V_NATURE, -1);
+ } else {
+ if (tree) {
+ msg_format(_("%sを切っている。", "You chop away at the %s."), name);
+ if (randint0(100) < 25)
+ search(creature_ptr);
+ } else {
+ msg_format(_("%sに穴を掘っている。", "You tunnel into the %s."), name);
+ }
+
+ more = TRUE;
+ }
+ }
+
+ if (is_hidden_door(creature_ptr, g_ptr) && (randint0(100) < 25))
+ search(creature_ptr);
+
+ return more;
+}
--- /dev/null
+#pragma once
+
+#include "system/angband.h"
+
+bool exe_tunnel(player_type *creature_ptr, POSITION y, POSITION x);
#include "cmd/cmd-basic.h"
#include "action/action-limited.h"
#include "action/open-close-execution.h"
+#include "action/tunnel-execution.h"
#include "action/open-util.h"
#include "art-definition/art-weapon-types.h"
#include "cmd-action/cmd-attack.h"
}
/*!
- * @brief 「掘る」コマンドを該当のマスに行えるかの判定と結果メッセージの表示 /
- * Determine if a given grid may be "tunneled"
- * @param y 対象を行うマスのY座標
- * @param x 対象を行うマスのX座標
- * @return
- */
-static bool do_cmd_tunnel_test(floor_type *floor_ptr, POSITION y, POSITION x)
-{
- grid_type *g_ptr = &floor_ptr->grid_array[y][x];
- if (!(g_ptr->info & CAVE_MARK)) {
- msg_print(_("そこには何も見当たらない。", "You see nothing there."));
- return FALSE;
- }
-
- if (!cave_have_flag_grid(g_ptr, FF_TUNNEL)) {
- msg_print(_("そこには掘るものが見当たらない。", "You see nothing there to tunnel."));
- return FALSE;
- }
-
- return TRUE;
-}
-
-/*!
- * @brief 「掘る」動作コマンドのサブルーチン /
- * Perform the basic "tunnel" command
- * @param y 対象を行うマスのY座標
- * @param x 対象を行うマスのX座標
- * @return 実際に処理が行われた場合TRUEを返す。
- * @details
- * Assumes that no monster is blocking the destination
- * Do not use twall anymore
- * Returns TRUE if repeated commands may continue
- */
-static bool exe_tunnel(player_type *creature_ptr, POSITION y, POSITION x)
-{
- grid_type *g_ptr;
- feature_type *f_ptr, *mimic_f_ptr;
- int power;
- concptr name;
- bool more = FALSE;
- if (!do_cmd_tunnel_test(creature_ptr->current_floor_ptr, y, x))
- return FALSE;
-
- take_turn(creature_ptr, 100);
- g_ptr = &creature_ptr->current_floor_ptr->grid_array[y][x];
- f_ptr = &f_info[g_ptr->feat];
- power = f_ptr->power;
- mimic_f_ptr = &f_info[get_feat_mimic(g_ptr)];
- name = f_name + mimic_f_ptr->name;
- sound(SOUND_DIG);
- if (have_flag(f_ptr->flags, FF_PERMANENT)) {
- if (have_flag(mimic_f_ptr->flags, FF_PERMANENT))
- msg_print(_("この岩は硬すぎて掘れないようだ。", "This seems to be permanent rock."));
- else
- msg_print(_("そこは掘れない!", "You can't tunnel through that!"));
- } else if (have_flag(f_ptr->flags, FF_CAN_DIG)) {
- if (creature_ptr->skill_dig > randint0(20 * power)) {
- msg_format(_("%sをくずした。", "You have removed the %s."), name);
- cave_alter_feat(creature_ptr, y, x, FF_TUNNEL);
- creature_ptr->update |= (PU_FLOW);
- } else {
- msg_format(_("%sをくずしている。", "You dig into the %s."), name);
- more = TRUE;
- }
- } else {
- bool tree = have_flag(mimic_f_ptr->flags, FF_TREE);
- if (creature_ptr->skill_dig > power + randint0(40 * power)) {
- if (tree)
- msg_format(_("%sを切り払った。", "You have cleared away the %s."), name);
- else {
- msg_print(_("穴を掘り終えた。", "You have finished the tunnel."));
- creature_ptr->update |= (PU_FLOW);
- }
-
- if (have_flag(f_ptr->flags, FF_GLASS))
- sound(SOUND_GLASS);
-
- cave_alter_feat(creature_ptr, y, x, FF_TUNNEL);
- chg_virtue(creature_ptr, V_DILIGENCE, 1);
- chg_virtue(creature_ptr, V_NATURE, -1);
- } else {
- if (tree) {
- msg_format(_("%sを切っている。", "You chop away at the %s."), name);
- if (randint0(100) < 25)
- search(creature_ptr);
- } else {
- msg_format(_("%sに穴を掘っている。", "You tunnel into the %s."), name);
- }
-
- more = TRUE;
- }
- }
-
- if (is_hidden_door(creature_ptr, g_ptr) && (randint0(100) < 25))
- search(creature_ptr);
-
- return more;
-}
-
-/*!
* @brief 「掘る」動作コマンドのメインルーチン /
* Tunnels through "walls" (including rubble and closed doors)
* @return なし