• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisionc19bc750fc340e274d6766340efa641f8fd7059f (tree)
Time2019-06-29 00:55:00
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/melee1.c
+++ b/src/melee1.c
@@ -3396,7 +3396,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
33963396
33973397 if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
33983398
3399- (void)drain_exp(d, d / 10, 95);
3399+ (void)drain_exp(p_ptr, d, d / 10, 95);
34003400 break;
34013401 }
34023402
@@ -3410,7 +3410,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
34103410
34113411 if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
34123412
3413- (void)drain_exp(d, d / 10, 90);
3413+ (void)drain_exp(p_ptr, d, d / 10, 90);
34143414 break;
34153415 }
34163416
@@ -3424,7 +3424,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
34243424
34253425 if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
34263426
3427- (void)drain_exp(d, d / 10, 75);
3427+ (void)drain_exp(p_ptr, d, d / 10, 75);
34283428 break;
34293429 }
34303430
@@ -3438,7 +3438,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
34383438
34393439 if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
34403440
3441- (void)drain_exp(d, d / 10, 50);
3441+ (void)drain_exp(p_ptr, d, d / 10, 50);
34423442 break;
34433443 }
34443444
@@ -3546,7 +3546,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
35463546
35473547 if (p_ptr->is_dead || CHECK_MULTISHADOW()) break;
35483548
3549- resist_drain = !drain_exp(d, d / 10, 50);
3549+ resist_drain = !drain_exp(p_ptr, d, d / 10, 50);
35503550
35513551 /* Heal the attacker? */
35523552 if (p_ptr->mimic_form)
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -4053,12 +4053,12 @@ void lose_exp(s32b amount)
40534053 * Drain experience
40544054 * If resisted to draining, return FALSE
40554055 */
4056-bool drain_exp(s32b drain, s32b slip, int hold_exp_prob)
4056+bool drain_exp(player_type *creature_ptr, s32b drain, s32b slip, int hold_exp_prob)
40574057 {
40584058 /* Androids and their mimics are never drained */
4059- if (p_ptr->prace == RACE_ANDROID) return FALSE;
4059+ if (creature_ptr->prace == RACE_ANDROID) return FALSE;
40604060
4061- if (p_ptr->hold_exp && (randint0(100) < hold_exp_prob))
4061+ if (creature_ptr->hold_exp && (randint0(100) < hold_exp_prob))
40624062 {
40634063 /* Hold experience */
40644064 msg_print(_("しかし自己の経験値を守りきった!", "You keep hold of your experience!"));
@@ -4066,7 +4066,7 @@ bool drain_exp(s32b drain, s32b slip, int hold_exp_prob)
40664066 }
40674067
40684068 /* Hold experience failed */
4069- if (p_ptr->hold_exp)
4069+ if (creature_ptr->hold_exp)
40704070 {
40714071 msg_print(_("経験値を少し吸い取られた気がする!", "You feel your experience slipping away!"));
40724072 lose_exp(slip);
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -70,7 +70,7 @@ extern void gain_exp_64(s32b amount, u32b amount_frac);
7070 extern void gain_exp(s32b amount);
7171 extern void calc_android_exp(player_type *creature_ptr);
7272 extern void lose_exp(s32b amount);
73-extern bool drain_exp(s32b drain, s32b slip, int hold_exp_prob);
73+extern bool drain_exp(player_type *creature_ptr, s32b drain, s32b slip, int hold_exp_prob);
7474 extern void do_poly_self(player_type *creature_ptr);
7575 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);
--- a/src/spells1.c
+++ b/src/spells1.c
@@ -4278,7 +4278,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
42784278 dam *= 6; dam /= (randint1(4) + 7);
42794279 }
42804280 }
4281- else if (!CHECK_MULTISHADOW()) drain_exp(200 + (p_ptr->exp / 100), 200 + (p_ptr->exp / 1000), 75);
4281+ else if (!CHECK_MULTISHADOW()) drain_exp(p_ptr, 200 + (p_ptr->exp / 100), 200 + (p_ptr->exp / 1000), 75);
42824282
42834283 if (PRACE_IS_(p_ptr, RACE_SPECTRE) && !CHECK_MULTISHADOW())
42844284 {
@@ -4347,7 +4347,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
43474347 }
43484348 if (!p_ptr->resist_neth && !p_ptr->resist_chaos)
43494349 {
4350- drain_exp(5000 + (p_ptr->exp / 100), 500 + (p_ptr->exp / 1000), 75);
4350+ drain_exp(p_ptr, 5000 + (p_ptr->exp / 100), 500 + (p_ptr->exp / 1000), 75);
43514351 }
43524352
43534353 if (!p_ptr->resist_chaos || one_in_(9))
Show on old repository browser