• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision12fa525a291598300c8d7b17694100724c63c4d7 (tree)
Time2019-06-29 00:56:47
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/cmd-quaff.c
+++ b/src/cmd-quaff.c
@@ -199,7 +199,7 @@ void exe_quaff_potion(INVENTORY_IDX item)
199199 msg_print(_("過去の記憶が薄れていく気がする。", "You feel your memories fade."));
200200 chg_virtue(V_KNOWLEDGE, -5);
201201
202- lose_exp(p_ptr->exp / 4);
202+ lose_exp(p_ptr, p_ptr->exp / 4);
203203 ident = TRUE;
204204 }
205205 break;
--- a/src/cmd-spell.c
+++ b/src/cmd-spell.c
@@ -1263,7 +1263,7 @@ void do_cmd_cast(void)
12631263 take_hit(DAMAGE_LOSELIFE, damroll(o_ptr->sval + 1, 6), _("暗黒魔法の逆流", "a miscast Death spell"), -1);
12641264
12651265 if ((spell > 15) && one_in_(6) && !p_ptr->hold_exp)
1266- lose_exp(spell * 250);
1266+ lose_exp(p_ptr, spell * 250);
12671267 }
12681268 }
12691269 else if ((o_ptr->tval == TV_MUSIC_BOOK) && (randint1(200) < spell))
--- a/src/melee1.c
+++ b/src/melee1.c
@@ -3482,7 +3482,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
34823482 {
34833483 if (p_ptr->prace == RACE_ANDROID) break;
34843484 msg_print(_("人生が逆戻りした気がする。", "You feel life has clocked back."));
3485- lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
3485+ lose_exp(p_ptr, 100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
34863486 break;
34873487 }
34883488
--- a/src/patron.c
+++ b/src/patron.c
@@ -325,7 +325,7 @@ void gain_level_reward(int chosen_reward)
325325 }
326326 else
327327 {
328- lose_exp(p_ptr->exp / 6);
328+ lose_exp(p_ptr, p_ptr->exp / 6);
329329 reward = _("経験値を失った。", "losing experience");
330330 }
331331 break;
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -4034,15 +4034,15 @@ void calc_android_exp(player_type *creature_ptr)
40344034 /*
40354035 * Lose experience
40364036 */
4037-void lose_exp(s32b amount)
4037+void lose_exp(player_type *creature_ptr, s32b amount)
40384038 {
4039- if (p_ptr->prace == RACE_ANDROID) return;
4039+ if (creature_ptr->prace == RACE_ANDROID) return;
40404040
40414041 /* Never drop below zero experience */
4042- if (amount > p_ptr->exp) amount = p_ptr->exp;
4042+ if (amount > creature_ptr->exp) amount = creature_ptr->exp;
40434043
40444044 /* Lose some experience */
4045- p_ptr->exp -= amount;
4045+ creature_ptr->exp -= amount;
40464046
40474047 /* Check Experience */
40484048 check_experience();
@@ -4069,12 +4069,12 @@ bool drain_exp(player_type *creature_ptr, s32b drain, s32b slip, int hold_exp_pr
40694069 if (creature_ptr->hold_exp)
40704070 {
40714071 msg_print(_("経験値を少し吸い取られた気がする!", "You feel your experience slipping away!"));
4072- lose_exp(slip);
4072+ lose_exp(p_ptr, slip);
40734073 }
40744074 else
40754075 {
40764076 msg_print(_("経験値が体から吸い取られた気がする!", "You feel your experience draining away!"));
4077- lose_exp(drain);
4077+ lose_exp(p_ptr, drain);
40784078 }
40794079
40804080 return TRUE;
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -69,7 +69,7 @@ extern bool lose_all_info(player_type *creature_ptr);
6969 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);
72-extern void lose_exp(s32b amount);
72+extern void lose_exp(player_type *creature_ptr, s32b amount);
7373 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);
--- a/src/spells1.c
+++ b/src/spells1.c
@@ -4579,7 +4579,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
45794579 {
45804580 if (p_ptr->prace == RACE_ANDROID) break;
45814581 msg_print(_("人生が逆戻りした気がする。", "You feel life has clocked back."));
4582- lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
4582+ lose_exp(p_ptr, 100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
45834583 break;
45844584 }
45854585
--- a/src/spells2.c
+++ b/src/spells2.c
@@ -2597,7 +2597,7 @@ bool activate_ty_curse(bool stop_ty, int *count)
25972597 if (!one_in_(6)) break;
25982598 case 10: case 11: case 12:
25992599 msg_print(_("経験値が体から吸い取られた気がする!", "You feel your experience draining away..."));
2600- lose_exp(p_ptr->exp / 16);
2600+ lose_exp(p_ptr, p_ptr->exp / 16);
26012601 if (!one_in_(6)) break;
26022602 case 13: case 14: case 15: case 19: case 20:
26032603 if (stop_ty || (p_ptr->free_act && (randint1(125) < p_ptr->skill_sav)) || (p_ptr->pclass == CLASS_BERSERKER))
--- a/src/spells3.c
+++ b/src/spells3.c
@@ -3532,8 +3532,8 @@ void blood_curse_to_enemy(MONSTER_IDX m_idx)
35323532 if (p_ptr->hold_exp && (randint0(100) < 75)) break;
35333533 msg_print(_("経験値が体から吸い取られた気がする!", "You feel your experience draining away..."));
35343534
3535- if (p_ptr->hold_exp) lose_exp(p_ptr->exp / 160);
3536- else lose_exp(p_ptr->exp / 16);
3535+ if (p_ptr->hold_exp) lose_exp(p_ptr, p_ptr->exp / 160);
3536+ else lose_exp(p_ptr, p_ptr->exp / 16);
35373537 if (!one_in_(6)) break;
35383538 case 26: case 27: case 28:
35393539 {
Show on old repository browser