• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision0ec6821206a1f6fea769799fa9b156f537194776 (tree)
Time2019-06-24 23:09:28
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/cmd-quaff.c
+++ b/src/cmd-quaff.c
@@ -476,7 +476,7 @@ void exe_quaff_potion(INVENTORY_IDX item)
476476
477477 case SV_POTION_NEO_TSUYOSHI:
478478 (void)set_image(p_ptr, 0);
479- (void)set_tsuyoshi(p_ptr->tsuyoshi + randint1(100) + 100, FALSE);
479+ (void)set_tsuyoshi(p_ptr, p_ptr->tsuyoshi + randint1(100) + 100, FALSE);
480480 ident = TRUE;
481481 break;
482482
@@ -484,7 +484,7 @@ void exe_quaff_potion(INVENTORY_IDX item)
484484 msg_print(_("「オクレ兄さん!」", "Brother OKURE!"));
485485 msg_print(NULL);
486486 p_ptr->tsuyoshi = 1;
487- (void)set_tsuyoshi(0, TRUE);
487+ (void)set_tsuyoshi(p_ptr, 0, TRUE);
488488 if (!p_ptr->resist_chaos)
489489 {
490490 (void)set_image(p_ptr, 50 + randint1(50));
--- a/src/core.c
+++ b/src/core.c
@@ -2037,7 +2037,7 @@ static void process_world_aux_timeout(void)
20372037 /* Tsuyoshi */
20382038 if (p_ptr->tsuyoshi)
20392039 {
2040- (void)set_tsuyoshi(p_ptr->tsuyoshi - 1, TRUE);
2040+ (void)set_tsuyoshi(p_ptr, p_ptr->tsuyoshi - 1, TRUE);
20412041 }
20422042
20432043 /* Oppose Acid */
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -295,7 +295,7 @@ void dispel_player(void)
295295 (void)set_slow(p_ptr, 0, TRUE);
296296 (void)set_shield(p_ptr, 0, TRUE);
297297 (void)set_blessed(p_ptr, 0, TRUE);
298- (void)set_tsuyoshi(0, TRUE);
298+ (void)set_tsuyoshi(p_ptr, 0, TRUE);
299299 (void)set_hero(p_ptr, 0, TRUE);
300300 (void)set_shero(p_ptr, 0, TRUE);
301301 (void)set_protevil(p_ptr, 0, TRUE);
@@ -736,7 +736,7 @@ bool set_image(player_type *creature_ptr, TIME_EFFECT v)
736736 /* Open */
737737 if (v)
738738 {
739- set_tsuyoshi(0, TRUE);
739+ set_tsuyoshi(p_ptr, 0, TRUE);
740740 if (!creature_ptr->image)
741741 {
742742 msg_print(_("ワーオ!何もかも虹色に見える!", "Oh, wow! Everything looks so cosmic now!"));
@@ -2236,21 +2236,21 @@ bool set_kabenuke(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
22362236 * @param do_dec 現在の継続時間より長い値のみ上書きする
22372237 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
22382238 */
2239-bool set_tsuyoshi(TIME_EFFECT v, bool do_dec)
2239+bool set_tsuyoshi(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
22402240 {
22412241 bool notice = FALSE;
22422242 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
22432243
2244- if (p_ptr->is_dead) return FALSE;
2244+ if (creature_ptr->is_dead) return FALSE;
22452245
22462246 /* Open */
22472247 if (v)
22482248 {
2249- if (p_ptr->tsuyoshi && !do_dec)
2249+ if (creature_ptr->tsuyoshi && !do_dec)
22502250 {
2251- if (p_ptr->tsuyoshi > v) return FALSE;
2251+ if (creature_ptr->tsuyoshi > v) return FALSE;
22522252 }
2253- else if (!p_ptr->tsuyoshi)
2253+ else if (!creature_ptr->tsuyoshi)
22542254 {
22552255 msg_print(_("「オクレ兄さん!」", "Brother OKURE!"));
22562256 notice = TRUE;
@@ -2261,12 +2261,12 @@ bool set_tsuyoshi(TIME_EFFECT v, bool do_dec)
22612261 /* Shut */
22622262 else
22632263 {
2264- if (p_ptr->tsuyoshi)
2264+ if (creature_ptr->tsuyoshi)
22652265 {
22662266 msg_print(_("肉体が急速にしぼんでいった。", "Your body had quickly shriveled."));
22672267
2268- (void)dec_stat(p_ptr, A_CON, 20, TRUE);
2269- (void)dec_stat(p_ptr, A_STR, 20, TRUE);
2268+ (void)dec_stat(creature_ptr, A_CON, 20, TRUE);
2269+ (void)dec_stat(creature_ptr, A_STR, 20, TRUE);
22702270
22712271 notice = TRUE;
22722272 chg_virtue(V_VITALITY, -3);
@@ -2274,17 +2274,17 @@ bool set_tsuyoshi(TIME_EFFECT v, bool do_dec)
22742274 }
22752275
22762276 /* Use the value */
2277- p_ptr->tsuyoshi = v;
2278- p_ptr->redraw |= (PR_STATUS);
2277+ creature_ptr->tsuyoshi = v;
2278+ creature_ptr->redraw |= (PR_STATUS);
22792279
22802280 /* Nothing to notice */
22812281 if (!notice) return (FALSE);
22822282
22832283 if (disturb_state) disturb(FALSE, FALSE);
2284- p_ptr->update |= (PU_BONUS);
2284+ creature_ptr->update |= (PU_BONUS);
22852285
22862286 /* Recalculate hitpoints */
2287- p_ptr->update |= (PU_HP);
2287+ creature_ptr->update |= (PU_HP);
22882288 handle_stuff();
22892289 return (TRUE);
22902290 }
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -46,7 +46,7 @@ extern bool set_tim_reflect(player_type *creature_ptr, TIME_EFFECT v, bool do_de
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);
4848 extern bool set_kabenuke(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
49-extern bool set_tsuyoshi(TIME_EFFECT v, bool do_dec);
49+extern bool set_tsuyoshi(player_type *creature_ptr, 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);
5252 extern bool set_oppose_acid(TIME_EFFECT v, bool do_dec);
Show on old repository browser