• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision684c96b740dd868a22045164bd8b43148045f76c (tree)
Time2019-06-29 02:05:22
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/cmd-basic.c
+++ b/src/cmd-basic.c
@@ -584,7 +584,7 @@ static bool exe_open_chest(player_type *creature_ptr, POSITION y, POSITION x, OB
584584 if (randint0(100) < j)
585585 {
586586 msg_print(_("鍵をはずした。", "You have picked the lock."));
587- gain_exp(1);
587+ gain_exp(p_ptr, 1);
588588 flag = TRUE;
589589 }
590590
@@ -784,7 +784,7 @@ static bool do_cmd_open_aux(POSITION y, POSITION x)
784784 sound(SOUND_OPENDOOR);
785785
786786 /* Experience */
787- gain_exp(1);
787+ gain_exp(p_ptr, 1);
788788 }
789789
790790 /* Failure */
@@ -1345,7 +1345,7 @@ bool easy_open_door(POSITION y, POSITION x)
13451345 sound(SOUND_OPENDOOR);
13461346
13471347 /* Experience */
1348- gain_exp(1);
1348+ gain_exp(p_ptr, 1);
13491349 }
13501350
13511351 /* Failure */
@@ -1428,7 +1428,7 @@ static bool do_cmd_disarm_chest(POSITION y, POSITION x, OBJECT_IDX o_idx)
14281428 else if (randint0(100) < j)
14291429 {
14301430 msg_print(_("箱に仕掛けられていたトラップを解除した。", "You have disarmed the chest."));
1431- gain_exp(o_ptr->pval);
1431+ gain_exp(p_ptr, o_ptr->pval);
14321432 o_ptr->pval = (0 - o_ptr->pval);
14331433 }
14341434
@@ -1503,7 +1503,7 @@ bool do_cmd_disarm_aux(POSITION y, POSITION x, DIRECTION dir)
15031503 msg_format(_("%sを解除した。", "You have disarmed the %s."), name);
15041504
15051505 /* Reward */
1506- gain_exp(power);
1506+ gain_exp(p_ptr, power);
15071507
15081508 /* Remove the trap */
15091509 cave_alter_feat(y, x, FF_DISARM);
--- a/src/cmd-eat.c
+++ b/src/cmd-eat.c
@@ -328,7 +328,7 @@ void exe_eat_food(INVENTORY_IDX item)
328328 if (ident && !object_is_aware(o_ptr))
329329 {
330330 object_aware(o_ptr);
331- gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
331+ gain_exp(p_ptr, (lev + (p_ptr->lev >> 1)) / p_ptr->lev);
332332 }
333333
334334 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
--- a/src/cmd-item.c
+++ b/src/cmd-item.c
@@ -798,7 +798,7 @@ void do_cmd_destroy(void)
798798 if (tester_exp<1) tester_exp = 1;
799799
800800 msg_print(_("更に経験を積んだような気がする。", "You feel more experienced."));
801- gain_exp(tester_exp * amt);
801+ gain_exp(p_ptr, tester_exp * amt);
802802 }
803803 if (item_tester_high_level_book(q_ptr) && q_ptr->tval == TV_LIFE_BOOK)
804804 {
--- a/src/cmd-quaff.c
+++ b/src/cmd-quaff.c
@@ -443,7 +443,7 @@ void exe_quaff_potion(INVENTORY_IDX item)
443443 EXP ee = (p_ptr->exp / 2) + 10;
444444 if (ee > 100000L) ee = 100000L;
445445 msg_print(_("更に経験を積んだような気がする。", "You feel more experienced."));
446- gain_exp(ee);
446+ gain_exp(p_ptr, ee);
447447 ident = TRUE;
448448 }
449449 break;
@@ -533,7 +533,7 @@ void exe_quaff_potion(INVENTORY_IDX item)
533533 if (ident && !object_is_aware(q_ptr))
534534 {
535535 object_aware(q_ptr);
536- gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
536+ gain_exp(p_ptr, (lev + (p_ptr->lev >> 1)) / p_ptr->lev);
537537 }
538538
539539 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
--- a/src/cmd-read.c
+++ b/src/cmd-read.c
@@ -581,7 +581,7 @@ void exe_read(INVENTORY_IDX item, bool known)
581581 if (ident && !object_is_aware(o_ptr))
582582 {
583583 object_aware(o_ptr);
584- gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
584+ gain_exp(p_ptr, (lev + (p_ptr->lev >> 1)) / p_ptr->lev);
585585 }
586586
587587 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
--- a/src/cmd-spell.c
+++ b/src/cmd-spell.c
@@ -1304,7 +1304,7 @@ void do_cmd_cast(void)
13041304 }
13051305
13061306 /* Gain experience */
1307- gain_exp(e * s_ptr->slevel);
1307+ gain_exp(p_ptr, e * s_ptr->slevel);
13081308
13091309 /* Redraw object recall */
13101310 p_ptr->window |= (PW_OBJECT);
--- a/src/cmd-usestaff.c
+++ b/src/cmd-usestaff.c
@@ -374,7 +374,7 @@ void exe_use_staff(INVENTORY_IDX item)
374374 if (ident && !object_is_aware(o_ptr))
375375 {
376376 object_aware(o_ptr);
377- gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
377+ gain_exp(p_ptr, (lev + (p_ptr->lev >> 1)) / p_ptr->lev);
378378 }
379379
380380 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
--- a/src/cmd-zaprod.c
+++ b/src/cmd-zaprod.c
@@ -388,7 +388,7 @@ void exe_zap_rod(INVENTORY_IDX item)
388388 if (ident && !object_is_aware(o_ptr))
389389 {
390390 object_aware(o_ptr);
391- gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
391+ gain_exp(p_ptr, (lev + (p_ptr->lev >> 1)) / p_ptr->lev);
392392 }
393393
394394 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
--- a/src/cmd-zapwand.c
+++ b/src/cmd-zapwand.c
@@ -428,7 +428,7 @@ void exe_aim_wand(INVENTORY_IDX item)
428428 if (ident && !object_is_aware(o_ptr))
429429 {
430430 object_aware(o_ptr);
431- gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
431+ gain_exp(p_ptr, (lev + (p_ptr->lev >> 1)) / p_ptr->lev);
432432 }
433433
434434 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
--- a/src/mspells3.c
+++ b/src/mspells3.c
@@ -1786,7 +1786,7 @@ void learn_spell(int monspell)
17861786 {
17871787 p_ptr->magic_num2[monspell] = 1;
17881788 msg_format(_("%sを学習した!", "You have learned %s!"), monster_powers[monspell].name);
1789- gain_exp(monster_powers[monspell].level * monster_powers[monspell].smana);
1789+ gain_exp(p_ptr, monster_powers[monspell].level * monster_powers[monspell].smana);
17901790
17911791 sound(SOUND_STUDY);
17921792
--- a/src/patron.c
+++ b/src/patron.c
@@ -309,7 +309,7 @@ void gain_level_reward(int chosen_reward)
309309 if (ee > 100000L) ee = 100000L;
310310 msg_print(_("更に経験を積んだような気がする。", "You feel more experienced."));
311311
312- gain_exp(ee);
312+ gain_exp(p_ptr, ee);
313313 reward = _("経験値を得た", "experience");
314314 }
315315 break;
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -3930,7 +3930,7 @@ void gain_exp_64(s32b amount, u32b amount_frac)
39303930 /*
39313931 * Gain experience
39323932 */
3933-void gain_exp(s32b amount)
3933+void gain_exp(player_type *creature_ptr, s32b amount)
39343934 {
39353935 gain_exp_64(amount, 0L);
39363936 }
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -67,7 +67,7 @@ extern bool do_inc_stat(player_type *creature_ptr, int stat);
6767 extern bool restore_level(player_type *creature_ptr);
6868 extern bool lose_all_info(player_type *creature_ptr);
6969 extern void gain_exp_64(s32b amount, u32b amount_frac);
70-extern void gain_exp(s32b amount);
70+extern void gain_exp(player_type *creature_ptr, s32b amount);
7171 extern void calc_android_exp(player_type *creature_ptr);
7272 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);
--- a/src/spells2.c
+++ b/src/spells2.c
@@ -3832,7 +3832,7 @@ void cast_shuffle(void)
38323832 s32b ee = (p_ptr->exp / 25) + 1;
38333833 if (ee > 5000) ee = 5000;
38343834 msg_print(_("更に経験を積んだような気がする。", "You feel more experienced."));
3835- gain_exp(ee);
3835+ gain_exp(p_ptr, ee);
38363836 }
38373837 }
38383838 }
--- a/src/wizard2.c
+++ b/src/wizard2.c
@@ -1922,7 +1922,7 @@ void do_cmd_debug(void)
19221922
19231923 /* Increase Experience */
19241924 case 'x':
1925- gain_exp(command_arg ? command_arg : (p_ptr->exp + 1));
1925+ gain_exp(p_ptr, command_arg ? command_arg : (p_ptr->exp + 1));
19261926 break;
19271927
19281928 /* Zap Monsters (Genocide) */
Show on old repository browser