• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision15cc5c970af0d0e2444d2d5da7ad81ab77ee2907 (tree)
Time2019-05-06 22:43:02
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #37353 process_player() から process_fishing() 処理を分離.

Change Summary

Incremental Difference

--- a/src/core.c
+++ b/src/core.c
@@ -4374,6 +4374,37 @@ static void process_upkeep_with_speed(void)
43744374 }
43754375 }
43764376
4377+static void process_fishing(void)
4378+{
4379+ Term_xtra(TERM_XTRA_DELAY, 10);
4380+ if (one_in_(1000))
4381+ {
4382+ MONRACE_IDX r_idx;
4383+ bool success = FALSE;
4384+ get_mon_num_prep(monster_is_fishing_target, NULL);
4385+ r_idx = get_mon_num(current_floor_ptr->dun_level ? current_floor_ptr->dun_level : wilderness[p_ptr->wilderness_y][p_ptr->wilderness_x].level);
4386+ msg_print(NULL);
4387+ if (r_idx && one_in_(2))
4388+ {
4389+ POSITION y, x;
4390+ y = p_ptr->y + ddy[p_ptr->fishing_dir];
4391+ x = p_ptr->x + ddx[p_ptr->fishing_dir];
4392+ if (place_monster_aux(0, y, x, r_idx, PM_NO_KAGE))
4393+ {
4394+ GAME_TEXT m_name[MAX_NLEN];
4395+ monster_desc(m_name, &current_floor_ptr->m_list[current_floor_ptr->grid_array[y][x].m_idx], 0);
4396+ msg_format(_("%sが釣れた!", "You have a good catch!"), m_name);
4397+ success = TRUE;
4398+ }
4399+ }
4400+ if (!success)
4401+ {
4402+ msg_print(_("餌だけ食われてしまった!くっそ~!", "Damn! The fish stole your bait!"));
4403+ }
4404+ disturb(FALSE, TRUE);
4405+ }
4406+}
4407+
43774408 /*!
43784409 * @brief プレイヤーの行動処理 / Process the player
43794410 * @return なし
@@ -4461,36 +4492,7 @@ static void process_player(void)
44614492 }
44624493 }
44634494
4464- if (p_ptr->action == ACTION_FISH)
4465- {
4466- Term_xtra(TERM_XTRA_DELAY, 10);
4467- if (one_in_(1000))
4468- {
4469- MONRACE_IDX r_idx;
4470- bool success = FALSE;
4471- get_mon_num_prep(monster_is_fishing_target,NULL);
4472- r_idx = get_mon_num(current_floor_ptr->dun_level ? current_floor_ptr->dun_level : wilderness[p_ptr->wilderness_y][p_ptr->wilderness_x].level);
4473- msg_print(NULL);
4474- if (r_idx && one_in_(2))
4475- {
4476- POSITION y, x;
4477- y = p_ptr->y + ddy[p_ptr->fishing_dir];
4478- x = p_ptr->x + ddx[p_ptr->fishing_dir];
4479- if (place_monster_aux(0, y, x, r_idx, PM_NO_KAGE))
4480- {
4481- GAME_TEXT m_name[MAX_NLEN];
4482- monster_desc(m_name, &current_floor_ptr->m_list[current_floor_ptr->grid_array[y][x].m_idx], 0);
4483- msg_format(_("%sが釣れた!", "You have a good catch!"), m_name);
4484- success = TRUE;
4485- }
4486- }
4487- if (!success)
4488- {
4489- msg_print(_("餌だけ食われてしまった!くっそ~!", "Damn! The fish stole your bait!"));
4490- }
4491- disturb(FALSE, TRUE);
4492- }
4493- }
4495+ if (p_ptr->action == ACTION_FISH) process_fishing();
44944496
44954497 /* Handle "abort" */
44964498 if (check_abort)
Show on old repository browser