• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision98ce3af682ca9297a5af4d628e542d92fdc02d77 (tree)
Time2019-06-27 11:48:42
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/cmd-basic.c
+++ b/src/cmd-basic.c
@@ -2207,7 +2207,7 @@ void do_cmd_rest(void)
22072207
22082208 if (command_arg > 9999) command_arg = 9999;
22092209
2210- if (p_ptr->special_defense & NINJA_S_STEALTH) set_superstealth(FALSE);
2210+ if (p_ptr->special_defense & NINJA_S_STEALTH) set_superstealth(p_ptr, FALSE);
22112211
22122212 /* Take a current_world_ptr->game_turn (?) */
22132213 take_turn(p_ptr, 100);
--- a/src/core.c
+++ b/src/core.c
@@ -5038,7 +5038,7 @@ static void dungeon(bool load_game)
50385038 #endif
50395039 }
50405040
5041- if (!load_game && (p_ptr->special_defense & NINJA_S_STEALTH)) set_superstealth(FALSE);
5041+ if (!load_game && (p_ptr->special_defense & NINJA_S_STEALTH)) set_superstealth(p_ptr, FALSE);
50425042
50435043 /*** Process this dungeon level ***/
50445044
--- a/src/floor-events.c
+++ b/src/floor-events.c
@@ -51,7 +51,7 @@ void day_break()
5151
5252 if (p_ptr->special_defense & NINJA_S_STEALTH)
5353 {
54- if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
54+ if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(p_ptr, FALSE);
5555 }
5656
5757 }
@@ -99,7 +99,7 @@ void night_falls(void)
9999
100100 if (p_ptr->special_defense & NINJA_S_STEALTH)
101101 {
102- if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
102+ if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(p_ptr, FALSE);
103103 }
104104
105105 }
--- a/src/floor-save.c
+++ b/src/floor-save.c
@@ -873,7 +873,7 @@ void leave_floor(BIT_FLAGS floor_mode)
873873 /* Remove all mirrors without explosion */
874874 remove_all_mirrors(FALSE);
875875
876- if (p_ptr->special_defense & NINJA_S_STEALTH) set_superstealth(FALSE);
876+ if (p_ptr->special_defense & NINJA_S_STEALTH) set_superstealth(p_ptr, FALSE);
877877
878878 /* New floor is not yet prepared */
879879 new_floor_id = 0;
--- a/src/grid.c
+++ b/src/grid.c
@@ -1968,7 +1968,7 @@ void cave_set_feat(POSITION y, POSITION x, FEAT_IDX feat)
19681968
19691969 if (p_ptr->special_defense & NINJA_S_STEALTH)
19701970 {
1971- if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
1971+ if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(p_ptr, FALSE);
19721972 }
19731973 }
19741974 }
--- a/src/monster-status.c
+++ b/src/monster-status.c
@@ -1040,7 +1040,7 @@ bool mon_take_hit(MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, concptr note)
10401040 /* Hack - Cancel any special player stealth magics. -LM- */
10411041 if (p_ptr->special_defense & NINJA_S_STEALTH)
10421042 {
1043- set_superstealth(FALSE);
1043+ set_superstealth(p_ptr, FALSE);
10441044 }
10451045
10461046 /* Genocided by chaos patron */
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -1682,51 +1682,51 @@ bool set_tim_stealth(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
16821682 * @param set TRUEならば超隠密状態になる。
16831683 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
16841684 */
1685-bool set_superstealth(bool set)
1685+bool set_superstealth(player_type *creature_ptr, bool set)
16861686 {
16871687 bool notice = FALSE;
16881688
1689- if (p_ptr->is_dead) return FALSE;
1689+ if (creature_ptr->is_dead) return FALSE;
16901690
16911691 /* Open */
16921692 if (set)
16931693 {
1694- if (!(p_ptr->special_defense & NINJA_S_STEALTH))
1694+ if (!(creature_ptr->special_defense & NINJA_S_STEALTH))
16951695 {
1696- if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_MNLT)
1696+ if (current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x].info & CAVE_MNLT)
16971697 {
16981698 msg_print(_("敵の目から薄い影の中に覆い隠された。", "You are mantled in weak shadow from ordinary eyes."));
1699- p_ptr->monlite = p_ptr->old_monlite = TRUE;
1699+ creature_ptr->monlite = creature_ptr->old_monlite = TRUE;
17001700 }
17011701 else
17021702 {
17031703 msg_print(_("敵の目から影の中に覆い隠された!", "You are mantled in shadow from ordinary eyes!"));
1704- p_ptr->monlite = p_ptr->old_monlite = FALSE;
1704+ creature_ptr->monlite = creature_ptr->old_monlite = FALSE;
17051705 }
17061706
17071707 notice = TRUE;
17081708
17091709 /* Use the value */
1710- p_ptr->special_defense |= NINJA_S_STEALTH;
1710+ creature_ptr->special_defense |= NINJA_S_STEALTH;
17111711 }
17121712 }
17131713
17141714 /* Shut */
17151715 else
17161716 {
1717- if (p_ptr->special_defense & NINJA_S_STEALTH)
1717+ if (creature_ptr->special_defense & NINJA_S_STEALTH)
17181718 {
17191719 msg_print(_("再び敵の目にさらされるようになった。", "You are exposed to common sight once more."));
17201720 notice = TRUE;
17211721
17221722 /* Use the value */
1723- p_ptr->special_defense &= ~(NINJA_S_STEALTH);
1723+ creature_ptr->special_defense &= ~(NINJA_S_STEALTH);
17241724 }
17251725 }
17261726
17271727 /* Nothing to notice */
17281728 if (!notice) return (FALSE);
1729- p_ptr->redraw |= (PR_STATUS);
1729+ creature_ptr->redraw |= (PR_STATUS);
17301730
17311731 if (disturb_state) disturb(FALSE, FALSE);
17321732 return (TRUE);
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -79,7 +79,7 @@ extern bool choose_ele_attack(void);
7979 extern bool choose_ele_immune(TIME_EFFECT turn);
8080 extern bool set_wraith_form(TIME_EFFECT v, bool do_dec);
8181 extern bool set_tim_esp(TIME_EFFECT v, bool do_dec);
82-extern bool set_superstealth(bool set);
82+extern bool set_superstealth(player_type *creature_ptr, bool set);
8383 extern void do_poly_wounds(player_type *creature_ptr);
8484 extern void change_race(player_type *creature_ptr, CHARACTER_IDX new_race, concptr effect_msg);
8585
--- a/src/player-move.c
+++ b/src/player-move.c
@@ -668,8 +668,8 @@ bool move_player_effect(POSITION ny, POSITION nx, BIT_FLAGS mpe_mode)
668668
669669 if (p_ptr->pclass == CLASS_NINJA)
670670 {
671- if (g_ptr->info & (CAVE_GLOW)) set_superstealth(FALSE);
672- else if (p_ptr->cur_lite <= 0) set_superstealth(TRUE);
671+ if (g_ptr->info & (CAVE_GLOW)) set_superstealth(p_ptr, FALSE);
672+ else if (p_ptr->cur_lite <= 0) set_superstealth(p_ptr, TRUE);
673673 }
674674
675675 if ((p_ptr->action == ACTION_HAYAGAKE) &&
--- a/src/player-status.c
+++ b/src/player-status.c
@@ -4162,7 +4162,7 @@ static void calc_torch(void)
41624162 p_ptr->old_lite = p_ptr->cur_lite;
41634163
41644164 if ((p_ptr->cur_lite > 0) && (p_ptr->special_defense & NINJA_S_STEALTH))
4165- set_superstealth(FALSE);
4165+ set_superstealth(p_ptr, FALSE);
41664166 }
41674167 }
41684168
--- a/src/spells-floor.c
+++ b/src/spells-floor.c
@@ -123,7 +123,7 @@ void wiz_lite(bool ninja)
123123
124124 if (p_ptr->special_defense & NINJA_S_STEALTH)
125125 {
126- if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
126+ if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(p_ptr, FALSE);
127127 }
128128 }
129129
@@ -706,7 +706,7 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate)
706706
707707 if (p_ptr->special_defense & NINJA_S_STEALTH)
708708 {
709- if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
709+ if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(p_ptr, FALSE);
710710 }
711711 }
712712
@@ -1151,7 +1151,7 @@ bool earthquake(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
11511151
11521152 if (p_ptr->special_defense & NINJA_S_STEALTH)
11531153 {
1154- if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
1154+ if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(p_ptr, FALSE);
11551155 }
11561156
11571157 /* Success */
--- a/src/spells1.c
+++ b/src/spells1.c
@@ -586,7 +586,7 @@ static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
586586
587587 if (p_ptr->special_defense & NINJA_S_STEALTH)
588588 {
589- if (player_bold(y, x)) set_superstealth(FALSE);
589+ if (player_bold(y, x)) set_superstealth(p_ptr, FALSE);
590590 }
591591 }
592592
--- a/src/spells2.c
+++ b/src/spells2.c
@@ -1779,7 +1779,7 @@ void lite_room(POSITION y1, POSITION x1)
17791779
17801780 if (p_ptr->special_defense & NINJA_S_STEALTH)
17811781 {
1782- if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
1782+ if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(p_ptr, FALSE);
17831783 }
17841784 }
17851785
Show on old repository browser