• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revision5dcd2deff960c51c2edf8d15b3b56400b44dac76 (tree)
Time2019-02-23 20:29:03
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #37353 釣りの処理を fishing() に分離。 / Separate fishingpole of Taikobo to fishing().

Change Summary

Incremental Difference

--- a/src/cmd-activate.c
+++ b/src/cmd-activate.c
@@ -1897,36 +1897,12 @@ bool activate_artifact(object_type *o_ptr)
18971897 }
18981898
18991899 case ACT_FISHING:
1900- {
1901- POSITION x, y;
1902-
1903- if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
1904- y = p_ptr->y + ddy[dir];
1905- x = p_ptr->x + ddx[dir];
1906- p_ptr->fishing_dir = dir;
1907- if (!cave_have_flag_bold(y, x, FF_WATER))
1908- {
1909- msg_print(_("そこは水辺ではない。", "There is no fishing place."));
1910- return FALSE;
1911- }
1912- else if (grid_array[y][x].m_idx)
1913- {
1914- GAME_TEXT m_name[MAX_NLEN];
1915- monster_desc(m_name, &m_list[grid_array[y][x].m_idx], 0);
1916- msg_format(_("%sが邪魔だ!", "%^s is stand in your way."), m_name);
1917- free_turn(p_ptr);
1918- return FALSE;
1919- }
1920- set_action(ACTION_FISH);
1921- p_ptr->redraw |= (PR_STATE);
1900+ if(!fishing(p_ptr)) return FALSE;
19221901 break;
1923- }
19241902
19251903 case ACT_INROU:
1926- {
19271904 mitokohmon();
19281905 break;
1929- }
19301906
19311907 case ACT_MURAMASA:
19321908 {
@@ -1957,13 +1933,10 @@ bool activate_artifact(object_type *o_ptr)
19571933 }
19581934
19591935 case ACT_CRIMSON:
1960- {
1961- /* Only for Crimson */
19621936 if (o_ptr->name1 != ART_CRIMSON) return FALSE;
19631937 msg_print(_("せっかくだから『クリムゾン』をぶっぱなすぜ!", "I'll fire CRIMSON! SEKKAKUDAKARA!"));
19641938 if(!fire_crimson()) return FALSE;
19651939 break;
1966- }
19671940
19681941 default:
19691942 {
--- a/src/spells-status.c
+++ b/src/spells-status.c
@@ -1,5 +1,6 @@
11 #include "angband.h"
22 #include "avatar.h"
3+#include "player-status.h"
34 #include "spells-status.h"
45 #include "projection.h"
56 #include "spells.h"
@@ -389,3 +390,30 @@ bool restore_all_status(void)
389390 if (do_res_stat(A_CHR)) ident = TRUE;
390391 return ident;
391392 }
393+
394+bool fishing(player_type *creature_ptr)
395+{
396+ DIRECTION dir;
397+ POSITION x, y;
398+
399+ if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
400+ y = creature_ptr->y + ddy[dir];
401+ x = creature_ptr->x + ddx[dir];
402+ creature_ptr->fishing_dir = dir;
403+ if (!cave_have_flag_bold(y, x, FF_WATER))
404+ {
405+ msg_print(_("そこは水辺ではない。", "There is no fishing place."));
406+ return FALSE;
407+ }
408+ else if (grid_array[y][x].m_idx)
409+ {
410+ GAME_TEXT m_name[MAX_NLEN];
411+ monster_desc(m_name, &m_list[grid_array[y][x].m_idx], 0);
412+ msg_format(_("%sが邪魔だ!", "%^s is stand in your way."), m_name);
413+ free_turn(creature_ptr);
414+ return FALSE;
415+ }
416+ set_action(ACTION_FISH);
417+ creature_ptr->redraw |= (PR_STATE);
418+ return TRUE;
419+}
--- a/src/spells-status.h
+++ b/src/spells-status.h
@@ -23,3 +23,5 @@ extern bool_hack true_healing(HIT_POINT pow);
2323 extern bool_hack restore_mana(bool_hack magic_eater);
2424 extern bool restore_all_status(void);
2525
26+extern bool fishing(player_type *creature_ptr);
27+
Show on old repository browser