• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision4e5da4a9f0597958799ec4efad58690fdd7077b9 (tree)
Time2019-06-27 23:58:03
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/cmd-activate.c
+++ b/src/cmd-activate.c
@@ -1693,7 +1693,7 @@ bool activate_artifact(object_type *o_ptr)
16931693 (void)set_oppose_fire(p_ptr, v, FALSE);
16941694 (void)set_oppose_cold(p_ptr, v, FALSE);
16951695 (void)set_oppose_pois(p_ptr, v, FALSE);
1696- (void)set_ultimate_res(v, FALSE);
1696+ (void)set_ultimate_res(p_ptr, v, FALSE);
16971697 break;
16981698 }
16991699
--- a/src/core.c
+++ b/src/core.c
@@ -2072,7 +2072,7 @@ static void process_world_aux_timeout(void)
20722072
20732073 if (p_ptr->ult_res)
20742074 {
2075- (void)set_ultimate_res(p_ptr->ult_res - 1, TRUE);
2075+ (void)set_ultimate_res(p_ptr, p_ptr->ult_res - 1, TRUE);
20762076 }
20772077
20782078 /*** Poison and Stun and Cut ***/
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -326,7 +326,7 @@ void dispel_player(void)
326326 (void)set_oppose_fire(p_ptr, 0, TRUE);
327327 (void)set_oppose_cold(p_ptr, 0, TRUE);
328328 (void)set_oppose_pois(p_ptr, 0, TRUE);
329- (void)set_ultimate_res(0, TRUE);
329+ (void)set_ultimate_res(p_ptr, 0, TRUE);
330330 (void)set_mimic(p_ptr, 0, 0, TRUE);
331331 (void)set_ele_attack(p_ptr, 0, 0);
332332 (void)set_ele_immune(p_ptr, 0, 0);
@@ -4081,21 +4081,21 @@ bool drain_exp(s32b drain, s32b slip, int hold_exp_prob)
40814081 }
40824082
40834083
4084-bool set_ultimate_res(TIME_EFFECT v, bool do_dec)
4084+bool set_ultimate_res(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
40854085 {
40864086 bool notice = FALSE;
40874087 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
40884088
4089- if (p_ptr->is_dead) return FALSE;
4089+ if (creature_ptr->is_dead) return FALSE;
40904090
40914091 /* Open */
40924092 if (v)
40934093 {
4094- if (p_ptr->ult_res && !do_dec)
4094+ if (creature_ptr->ult_res && !do_dec)
40954095 {
4096- if (p_ptr->ult_res > v) return FALSE;
4096+ if (creature_ptr->ult_res > v) return FALSE;
40974097 }
4098- else if (!p_ptr->ult_res)
4098+ else if (!creature_ptr->ult_res)
40994099 {
41004100 msg_print(_("あらゆることに対して耐性がついた気がする!", "You feel resistant!"));
41014101 notice = TRUE;
@@ -4105,7 +4105,7 @@ bool set_ultimate_res(TIME_EFFECT v, bool do_dec)
41054105 /* Shut */
41064106 else
41074107 {
4108- if (p_ptr->ult_res)
4108+ if (creature_ptr->ult_res)
41094109 {
41104110 msg_print(_("あらゆることに対する耐性が薄れた気がする。", "You feel less resistant"));
41114111 notice = TRUE;
@@ -4113,14 +4113,14 @@ bool set_ultimate_res(TIME_EFFECT v, bool do_dec)
41134113 }
41144114
41154115 /* Use the value */
4116- p_ptr->ult_res = v;
4117- p_ptr->redraw |= (PR_STATUS);
4116+ creature_ptr->ult_res = v;
4117+ creature_ptr->redraw |= (PR_STATUS);
41184118
41194119 /* Nothing to notice */
41204120 if (!notice) return (FALSE);
41214121
41224122 if (disturb_state) disturb(FALSE, FALSE);
4123- p_ptr->update |= (PU_BONUS);
4123+ creature_ptr->update |= (PU_BONUS);
41244124 handle_stuff();
41254125 return (TRUE);
41264126 }
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -72,7 +72,7 @@ extern void calc_android_exp(player_type *creature_ptr);
7272 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);
75-extern bool set_ultimate_res(TIME_EFFECT v, bool do_dec);
75+extern bool set_ultimate_res(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
7676 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);
--- a/src/realm-life.c
+++ b/src/realm-life.c
@@ -477,7 +477,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
477477 set_oppose_fire(p_ptr, v, FALSE);
478478 set_oppose_cold(p_ptr, v, FALSE);
479479 set_oppose_pois(p_ptr, v, FALSE);
480- set_ultimate_res(v, FALSE);
480+ set_ultimate_res(p_ptr, v, FALSE);
481481 }
482482 }
483483 break;
Show on old repository browser