• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision0d3a06150e27154b15e2d927ecd52c8b1ad6a9a9 (tree)
Time2019-06-24 23:05:17
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/core.c
+++ b/src/core.c
@@ -1947,7 +1947,7 @@ static void process_world_aux_timeout(void)
19471947 /* Timed infra-vision */
19481948 if (p_ptr->kabenuke)
19491949 {
1950- (void)set_kabenuke(p_ptr->kabenuke - 1, TRUE);
1950+ (void)set_kabenuke(p_ptr, p_ptr->kabenuke - 1, TRUE);
19511951 }
19521952
19531953 /* Paralysis */
--- a/src/mind.c
+++ b/src/mind.c
@@ -1718,7 +1718,7 @@ static bool cast_ninja_spell(int spell)
17181718 explosive_rune();
17191719 break;
17201720 case 16:
1721- (void)set_kabenuke(randint1(plev/2) + plev/2, FALSE);
1721+ (void)set_kabenuke(p_ptr, randint1(plev/2) + plev/2, FALSE);
17221722 set_oppose_acid((TIME_EFFECT)plev, FALSE);
17231723 break;
17241724 case 17:
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -301,7 +301,7 @@ void dispel_player(void)
301301 (void)set_protevil(p_ptr, 0, TRUE);
302302 (void)set_invuln(p_ptr, 0, TRUE);
303303 (void)set_wraith_form(0, TRUE);
304- (void)set_kabenuke(0, TRUE);
304+ (void)set_kabenuke(p_ptr, 0, TRUE);
305305 (void)set_tim_res_nether(0, TRUE);
306306 (void)set_tim_res_time(0, TRUE);
307307 /* by henkma */
@@ -2186,21 +2186,21 @@ bool set_dustrobe(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
21862186 * @param do_dec 現在の継続時間より長い値のみ上書きする
21872187 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
21882188 */
2189-bool set_kabenuke(TIME_EFFECT v, bool do_dec)
2189+bool set_kabenuke(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
21902190 {
21912191 bool notice = FALSE;
21922192 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
21932193
2194- if (p_ptr->is_dead) return FALSE;
2194+ if (creature_ptr->is_dead) return FALSE;
21952195
21962196 /* Open */
21972197 if (v)
21982198 {
2199- if (p_ptr->kabenuke && !do_dec)
2199+ if (creature_ptr->kabenuke && !do_dec)
22002200 {
2201- if (p_ptr->kabenuke > v) return FALSE;
2201+ if (creature_ptr->kabenuke > v) return FALSE;
22022202 }
2203- else if (!p_ptr->kabenuke)
2203+ else if (!creature_ptr->kabenuke)
22042204 {
22052205 msg_print(_("体が半物質の状態になった。", "You became ethereal form."));
22062206 notice = TRUE;
@@ -2210,7 +2210,7 @@ bool set_kabenuke(TIME_EFFECT v, bool do_dec)
22102210 /* Shut */
22112211 else
22122212 {
2213- if (p_ptr->kabenuke)
2213+ if (creature_ptr->kabenuke)
22142214 {
22152215 msg_print(_("体が物質化した。", "You are no longer in an ethereal form."));
22162216 notice = TRUE;
@@ -2218,14 +2218,14 @@ bool set_kabenuke(TIME_EFFECT v, bool do_dec)
22182218 }
22192219
22202220 /* Use the value */
2221- p_ptr->kabenuke = v;
2222- p_ptr->redraw |= (PR_STATUS);
2221+ creature_ptr->kabenuke = v;
2222+ creature_ptr->redraw |= (PR_STATUS);
22232223
22242224 /* Nothing to notice */
22252225 if (!notice) return (FALSE);
22262226
22272227 if (disturb_state) disturb(FALSE, FALSE);
2228- p_ptr->update |= (PU_BONUS);
2228+ creature_ptr->update |= (PU_BONUS);
22292229 handle_stuff();
22302230 return (TRUE);
22312231 }
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -45,7 +45,7 @@ extern bool set_resist_magic(player_type *creature_ptr, TIME_EFFECT v, bool do_d
4545 extern bool set_tim_reflect(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
4646 extern bool set_multishadow(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
4747 extern bool set_dustrobe(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
48-extern bool set_kabenuke(TIME_EFFECT v, bool do_dec);
48+extern bool set_kabenuke(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
4949 extern bool set_tsuyoshi(TIME_EFFECT v, bool do_dec);
5050 extern bool set_ele_attack(u32b attack_type, TIME_EFFECT v);
5151 extern bool set_ele_immune(u32b immune_type, TIME_EFFECT v);
--- a/src/realm-craft.c
+++ b/src/realm-craft.c
@@ -358,7 +358,7 @@ concptr do_craft_spell(SPELL_IDX spell, BIT_FLAGS mode)
358358
359359 if (cast)
360360 {
361- set_kabenuke(randint1(base) + base, FALSE);
361+ set_kabenuke(p_ptr, randint1(base) + base, FALSE);
362362 }
363363 }
364364 break;
Show on old repository browser