変愚蛮怒のメインリポジトリです
Revision | 5dcd2deff960c51c2edf8d15b3b56400b44dac76 (tree) |
---|---|
Time | 2019-02-23 20:29:03 |
Author | deskull <deskull@user...> |
Commiter | deskull |
[Refactor] #37353 釣りの処理を fishing() に分離。 / Separate fishingpole of Taikobo to fishing().
@@ -1897,36 +1897,12 @@ bool activate_artifact(object_type *o_ptr) | ||
1897 | 1897 | } |
1898 | 1898 | |
1899 | 1899 | 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; | |
1922 | 1901 | break; |
1923 | - } | |
1924 | 1902 | |
1925 | 1903 | case ACT_INROU: |
1926 | - { | |
1927 | 1904 | mitokohmon(); |
1928 | 1905 | break; |
1929 | - } | |
1930 | 1906 | |
1931 | 1907 | case ACT_MURAMASA: |
1932 | 1908 | { |
@@ -1957,13 +1933,10 @@ bool activate_artifact(object_type *o_ptr) | ||
1957 | 1933 | } |
1958 | 1934 | |
1959 | 1935 | case ACT_CRIMSON: |
1960 | - { | |
1961 | - /* Only for Crimson */ | |
1962 | 1936 | if (o_ptr->name1 != ART_CRIMSON) return FALSE; |
1963 | 1937 | msg_print(_("せっかくだから『クリムゾン』をぶっぱなすぜ!", "I'll fire CRIMSON! SEKKAKUDAKARA!")); |
1964 | 1938 | if(!fire_crimson()) return FALSE; |
1965 | 1939 | break; |
1966 | - } | |
1967 | 1940 | |
1968 | 1941 | default: |
1969 | 1942 | { |
@@ -1,5 +1,6 @@ | ||
1 | 1 | #include "angband.h" |
2 | 2 | #include "avatar.h" |
3 | +#include "player-status.h" | |
3 | 4 | #include "spells-status.h" |
4 | 5 | #include "projection.h" |
5 | 6 | #include "spells.h" |
@@ -389,3 +390,30 @@ bool restore_all_status(void) | ||
389 | 390 | if (do_res_stat(A_CHR)) ident = TRUE; |
390 | 391 | return ident; |
391 | 392 | } |
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 | +} |
@@ -23,3 +23,5 @@ extern bool_hack true_healing(HIT_POINT pow); | ||
23 | 23 | extern bool_hack restore_mana(bool_hack magic_eater); |
24 | 24 | extern bool restore_all_status(void); |
25 | 25 | |
26 | +extern bool fishing(player_type *creature_ptr); | |
27 | + |