• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision60e384d3329aeb5e8eb43acef97c41b4eed631d9 (tree)
Time2019-06-20 00:14:33
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38997 do_cmd_go_down() に player_type * 引数を追加.

Change Summary

Incremental Difference

--- a/src/cmd-basic.c
+++ b/src/cmd-basic.c
@@ -322,16 +322,16 @@ void do_cmd_go_up(player_type *creature_ptr)
322322 * @brief 階段を使って階層を降りる処理 / Go down one level
323323 * @return なし
324324 */
325-void do_cmd_go_down(void)
325+void do_cmd_go_down(player_type *creature_ptr)
326326 {
327327 /* Player grid */
328- grid_type *g_ptr = &current_floor_ptr->grid_array[p_ptr->y][p_ptr->x];
328+ grid_type *g_ptr = &current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x];
329329 feature_type *f_ptr = &f_info[g_ptr->feat];
330330
331331 bool fall_trap = FALSE;
332332 int down_num = 0;
333333
334- if (p_ptr->special_defense & KATA_MUSOU)
334+ if (creature_ptr->special_defense & KATA_MUSOU)
335335 {
336336 set_action(ACTION_NONE);
337337 }
@@ -355,9 +355,9 @@ void do_cmd_go_down(void)
355355 else if (have_flag(f_ptr->flags, FF_QUEST))
356356 {
357357 /* Confirm Leaving */
358- if(!confirm_leave_level(p_ptr, TRUE)) return;
358+ if(!confirm_leave_level(creature_ptr, TRUE)) return;
359359
360- if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (p_ptr->inventory_list[INVEN_BOW].name1 == ART_CRIMSON))
360+ if ((creature_ptr->pseikaku == SEIKAKU_COMBAT) || (creature_ptr->inventory_list[INVEN_BOW].name1 == ART_CRIMSON))
361361 msg_print(_("なんだこの階段は!", "What's this STAIRWAY!"));
362362 else
363363 msg_print(_("下の階に降りた。", "You enter the down staircase."));
@@ -365,29 +365,29 @@ void do_cmd_go_down(void)
365365 leave_quest_check();
366366 leave_tower_check();
367367
368- p_ptr->inside_quest = g_ptr->special;
368+ creature_ptr->inside_quest = g_ptr->special;
369369
370370 /* Activate the quest */
371- if (!quest[p_ptr->inside_quest].status)
371+ if (!quest[creature_ptr->inside_quest].status)
372372 {
373- if (quest[p_ptr->inside_quest].type != QUEST_TYPE_RANDOM)
373+ if (quest[creature_ptr->inside_quest].type != QUEST_TYPE_RANDOM)
374374 {
375375 init_flags = INIT_ASSIGN;
376376 process_dungeon_file("q_info.txt", 0, 0, 0, 0);
377377 }
378- quest[p_ptr->inside_quest].status = QUEST_STATUS_TAKEN;
378+ quest[creature_ptr->inside_quest].status = QUEST_STATUS_TAKEN;
379379 }
380380
381381 /* Leaving a quest */
382- if (!p_ptr->inside_quest)
382+ if (!creature_ptr->inside_quest)
383383 {
384384 current_floor_ptr->dun_level = 0;
385385 }
386- p_ptr->leaving = TRUE;
387- p_ptr->oldpx = 0;
388- p_ptr->oldpy = 0;
386+ creature_ptr->leaving = TRUE;
387+ creature_ptr->oldpx = 0;
388+ creature_ptr->oldpy = 0;
389389
390- take_turn(p_ptr, 100);
390+ take_turn(creature_ptr, 100);
391391 }
392392
393393 else
@@ -411,9 +411,9 @@ void do_cmd_go_down(void)
411411 }
412412
413413 /* Save old player position */
414- p_ptr->oldpx = p_ptr->x;
415- p_ptr->oldpy = p_ptr->y;
416- p_ptr->dungeon_idx = target_dungeon;
414+ creature_ptr->oldpx = creature_ptr->x;
415+ creature_ptr->oldpy = creature_ptr->y;
416+ creature_ptr->dungeon_idx = target_dungeon;
417417
418418 /*
419419 * Clear all saved floors
@@ -422,7 +422,7 @@ void do_cmd_go_down(void)
422422 prepare_change_floor_mode(CFM_FIRST_FLOOR);
423423 }
424424
425- take_turn(p_ptr, 100);
425+ take_turn(creature_ptr, 100);
426426
427427 if (autosave_l) do_cmd_save_game(TRUE);
428428
@@ -433,8 +433,8 @@ void do_cmd_go_down(void)
433433 if (!current_floor_ptr->dun_level)
434434 {
435435 /* Enter the dungeon just now */
436- p_ptr->enter_dungeon = TRUE;
437- down_num = d_info[p_ptr->dungeon_idx].mindepth;
436+ creature_ptr->enter_dungeon = TRUE;
437+ down_num = d_info[creature_ptr->dungeon_idx].mindepth;
438438 }
439439
440440 if (record_stair)
@@ -452,18 +452,18 @@ void do_cmd_go_down(void)
452452 /* Success */
453453 if (target_dungeon)
454454 {
455- msg_format(_("%sへ入った。", "You entered %s."), d_text + d_info[p_ptr->dungeon_idx].text);
455+ msg_format(_("%sへ入った。", "You entered %s."), d_text + d_info[creature_ptr->dungeon_idx].text);
456456 }
457457 else
458458 {
459- if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (p_ptr->inventory_list[INVEN_BOW].name1 == ART_CRIMSON))
459+ if ((creature_ptr->pseikaku == SEIKAKU_COMBAT) || (creature_ptr->inventory_list[INVEN_BOW].name1 == ART_CRIMSON))
460460 msg_print(_("なんだこの階段は!", "What's this STAIRWAY!"));
461461 else
462462 msg_print(_("階段を下りて新たなる迷宮へと足を踏み入れた。", "You enter a maze of down staircases."));
463463 }
464464 }
465465
466- p_ptr->leaving = TRUE;
466+ creature_ptr->leaving = TRUE;
467467
468468 if (fall_trap)
469469 {
--- a/src/cmd-basic.h
+++ b/src/cmd-basic.h
@@ -10,7 +10,7 @@ extern bool cmd_limit_image(player_type *creature_ptr);
1010 extern bool cmd_limit_stun(player_type *creature_ptr);
1111 extern void forget_travel_flow(void);
1212 extern void do_cmd_go_up(player_type *creature_ptr);
13-extern void do_cmd_go_down(void);
13+extern void do_cmd_go_down(player_type *creature_ptr);
1414 extern void do_cmd_search(void);
1515 extern void do_cmd_open(void);
1616 extern void do_cmd_close(void);
--- a/src/core.c
+++ b/src/core.c
@@ -3776,7 +3776,7 @@ static void process_command(void)
37763776 if (p_ptr->wild_mode)
37773777 change_wild_mode(FALSE);
37783778 else
3779- do_cmd_go_down();
3779+ do_cmd_go_down(p_ptr);
37803780 break;
37813781 }
37823782
Show on old repository browser