• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisionde8ba7af9d1666154419f34a217c1b460814f0db (tree)
Time2019-06-27 23:55:55
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/core.c
+++ b/src/core.c
@@ -1917,7 +1917,7 @@ static void process_world_aux_timeout(void)
19171917 /* Timed resist nether */
19181918 if (p_ptr->tim_res_nether)
19191919 {
1920- (void)set_tim_res_nether(p_ptr->tim_res_nether - 1, TRUE);
1920+ (void)set_tim_res_nether(p_ptr, p_ptr->tim_res_nether - 1, TRUE);
19211921 }
19221922
19231923 /* Timed resist time */
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -302,7 +302,7 @@ void dispel_player(void)
302302 (void)set_invuln(p_ptr, 0, TRUE);
303303 (void)set_wraith_form(p_ptr, 0, TRUE);
304304 (void)set_kabenuke(p_ptr, 0, TRUE);
305- (void)set_tim_res_nether(0, TRUE);
305+ (void)set_tim_res_nether(p_ptr, 0, TRUE);
306306 (void)set_tim_res_time(p_ptr, 0, TRUE);
307307 /* by henkma */
308308 (void)set_tim_reflect(p_ptr, 0,TRUE);
@@ -4125,21 +4125,21 @@ bool set_ultimate_res(TIME_EFFECT v, bool do_dec)
41254125 return (TRUE);
41264126 }
41274127
4128-bool set_tim_res_nether(TIME_EFFECT v, bool do_dec)
4128+bool set_tim_res_nether(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
41294129 {
41304130 bool notice = FALSE;
41314131 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
41324132
4133- if (p_ptr->is_dead) return FALSE;
4133+ if (creature_ptr->is_dead) return FALSE;
41344134
41354135 /* Open */
41364136 if (v)
41374137 {
4138- if (p_ptr->tim_res_nether && !do_dec)
4138+ if (creature_ptr->tim_res_nether && !do_dec)
41394139 {
4140- if (p_ptr->tim_res_nether > v) return FALSE;
4140+ if (creature_ptr->tim_res_nether > v) return FALSE;
41414141 }
4142- else if (!p_ptr->tim_res_nether)
4142+ else if (!creature_ptr->tim_res_nether)
41434143 {
41444144 msg_print(_("地獄の力に対して耐性がついた気がする!", "You feel nether resistant!"));
41454145 notice = TRUE;
@@ -4149,7 +4149,7 @@ bool set_tim_res_nether(TIME_EFFECT v, bool do_dec)
41494149 /* Shut */
41504150 else
41514151 {
4152- if (p_ptr->tim_res_nether)
4152+ if (creature_ptr->tim_res_nether)
41534153 {
41544154 msg_print(_("地獄の力に対する耐性が薄れた気がする。", "You feel less nether resistant"));
41554155 notice = TRUE;
@@ -4157,14 +4157,14 @@ bool set_tim_res_nether(TIME_EFFECT v, bool do_dec)
41574157 }
41584158
41594159 /* Use the value */
4160- p_ptr->tim_res_nether = v;
4161- p_ptr->redraw |= (PR_STATUS);
4160+ creature_ptr->tim_res_nether = v;
4161+ creature_ptr->redraw |= (PR_STATUS);
41624162
41634163 /* Nothing to notice */
41644164 if (!notice) return (FALSE);
41654165
41664166 if (disturb_state) disturb(FALSE, FALSE);
4167- p_ptr->update |= (PU_BONUS);
4167+ creature_ptr->update |= (PU_BONUS);
41684168 handle_stuff();
41694169 return (TRUE);
41704170 }
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -73,7 +73,7 @@ extern void lose_exp(s32b amount);
7373 extern bool drain_exp(s32b drain, s32b slip, int hold_exp_prob);
7474 extern void do_poly_self(player_type *creature_ptr);
7575 extern bool set_ultimate_res(TIME_EFFECT v, bool do_dec);
76-extern bool set_tim_res_nether(TIME_EFFECT v, bool do_dec);
76+extern bool set_tim_res_nether(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
7777 extern bool set_tim_res_time(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
7878 extern bool choose_ele_attack(player_type *creature_ptr);
7979 extern bool choose_ele_immune(player_type *creature_ptr, TIME_EFFECT turn);
--- a/src/realm-daemon.c
+++ b/src/realm-daemon.c
@@ -226,7 +226,7 @@ concptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
226226
227227 if (cast)
228228 {
229- set_tim_res_nether(randint1(base) + base, FALSE);
229+ set_tim_res_nether(p_ptr, randint1(base) + base, FALSE);
230230 }
231231 }
232232 break;
Show on old repository browser