• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision3ee2e78075b96a3c75631331d30886bc430bcb4a (tree)
Time2019-07-13 22:23:40
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38997 player-effects.c 内の変数参照修正.

Change Summary

Incremental Difference

--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -443,7 +443,7 @@ bool set_blind(player_type *creature_ptr, TIME_EFFECT v)
443443 }
444444
445445 notice = TRUE;
446- chg_virtue(p_ptr, V_ENLIGHTEN, -1);
446+ chg_virtue(creature_ptr, V_ENLIGHTEN, -1);
447447 }
448448 }
449449
@@ -536,7 +536,7 @@ bool set_confused(player_type *creature_ptr, TIME_EFFECT v)
536536
537537 notice = TRUE;
538538 creature_ptr->counter = FALSE;
539- chg_virtue(p_ptr, V_HARMONY, -1);
539+ chg_virtue(creature_ptr, V_HARMONY, -1);
540540 }
541541 }
542542
@@ -641,7 +641,7 @@ bool set_afraid(player_type *creature_ptr, TIME_EFFECT v)
641641
642642 notice = TRUE;
643643 creature_ptr->counter = FALSE;
644- chg_virtue(p_ptr, V_VALOUR, -1);
644+ chg_virtue(creature_ptr, V_VALOUR, -1);
645645 }
646646 }
647647
@@ -799,8 +799,8 @@ bool set_fast(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
799799 {
800800 msg_print(_("素早く動けるようになった!", "You feel yourself moving much faster!"));
801801 notice = TRUE;
802- chg_virtue(p_ptr, V_PATIENCE, -1);
803- chg_virtue(p_ptr, V_DILIGENCE, 1);
802+ chg_virtue(creature_ptr, V_PATIENCE, -1);
803+ chg_virtue(creature_ptr, V_DILIGENCE, 1);
804804 }
805805 }
806806
@@ -852,8 +852,8 @@ bool set_lightspeed(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
852852 {
853853 msg_print(_("非常に素早く動けるようになった!", "You feel yourself moving extremely faster!"));
854854 notice = TRUE;
855- chg_virtue(p_ptr, V_PATIENCE, -1);
856- chg_virtue(p_ptr, V_DILIGENCE, 1);
855+ chg_virtue(creature_ptr, V_PATIENCE, -1);
856+ chg_virtue(creature_ptr, V_DILIGENCE, 1);
857857 }
858858 }
859859
@@ -1312,10 +1312,10 @@ bool set_wraith_form(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
13121312 {
13131313 msg_print(_("物質界を離れて幽鬼のような存在になった!", "You leave the physical world and current_world_ptr->game_turn into a wraith-being!"));
13141314 notice = TRUE;
1315- chg_virtue(p_ptr, V_UNLIFE, 3);
1316- chg_virtue(p_ptr, V_HONOUR, -2);
1317- chg_virtue(p_ptr, V_SACRIFICE, -2);
1318- chg_virtue(p_ptr, V_VALOUR, -5);
1315+ chg_virtue(creature_ptr, V_UNLIFE, 3);
1316+ chg_virtue(creature_ptr, V_HONOUR, -2);
1317+ chg_virtue(creature_ptr, V_SACRIFICE, -2);
1318+ chg_virtue(creature_ptr, V_VALOUR, -5);
13191319
13201320 creature_ptr->redraw |= (PR_MAP);
13211321 creature_ptr->update |= (PU_MONSTERS);
@@ -1378,10 +1378,10 @@ bool set_invuln(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
13781378 msg_print(_("無敵だ!", "Invulnerability!"));
13791379 notice = TRUE;
13801380
1381- chg_virtue(p_ptr, V_UNLIFE, -2);
1382- chg_virtue(p_ptr, V_HONOUR, -2);
1383- chg_virtue(p_ptr, V_SACRIFICE, -3);
1384- chg_virtue(p_ptr, V_VALOUR, -5);
1381+ chg_virtue(creature_ptr, V_UNLIFE, -2);
1382+ chg_virtue(creature_ptr, V_HONOUR, -2);
1383+ chg_virtue(creature_ptr, V_SACRIFICE, -3);
1384+ chg_virtue(creature_ptr, V_VALOUR, -5);
13851385
13861386 creature_ptr->redraw |= (PR_MAP);
13871387 creature_ptr->update |= (PU_MONSTERS);
@@ -2254,7 +2254,7 @@ bool set_tsuyoshi(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
22542254 {
22552255 msg_print(_("「オクレ兄さん!」", "Brother OKURE!"));
22562256 notice = TRUE;
2257- chg_virtue(p_ptr, V_VITALITY, 2);
2257+ chg_virtue(creature_ptr, V_VITALITY, 2);
22582258 }
22592259 }
22602260
@@ -2269,7 +2269,7 @@ bool set_tsuyoshi(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
22692269 (void)dec_stat(creature_ptr, A_STR, 20, TRUE);
22702270
22712271 notice = TRUE;
2272- chg_virtue(p_ptr, V_VITALITY, -3);
2272+ chg_virtue(creature_ptr, V_VITALITY, -3);
22732273 }
22742274 }
22752275
@@ -3118,13 +3118,13 @@ bool set_food(player_type *creature_ptr, TIME_EFFECT v)
31183118 }
31193119
31203120 if (old_aux < 1 && new_aux > 0)
3121- chg_virtue(p_ptr, V_PATIENCE, 2);
3121+ chg_virtue(creature_ptr, V_PATIENCE, 2);
31223122 else if (old_aux < 3 && (old_aux != new_aux))
3123- chg_virtue(p_ptr, V_PATIENCE, 1);
3123+ chg_virtue(creature_ptr, V_PATIENCE, 1);
31243124 if (old_aux == 2)
3125- chg_virtue(p_ptr, V_TEMPERANCE, 1);
3125+ chg_virtue(creature_ptr, V_TEMPERANCE, 1);
31263126 if (old_aux == 0)
3127- chg_virtue(p_ptr, V_TEMPERANCE, -1);
3127+ chg_virtue(creature_ptr, V_TEMPERANCE, -1);
31283128
31293129 /* Food increase */
31303130 if (new_aux > old_aux)
@@ -3147,9 +3147,9 @@ bool set_food(player_type *creature_ptr, TIME_EFFECT v)
31473147 /* Bloated */
31483148 case 5:
31493149 msg_print(_("食べ過ぎだ!", "You have gorged yourself!"));
3150- chg_virtue(p_ptr, V_HARMONY, -1);
3151- chg_virtue(p_ptr, V_PATIENCE, -1);
3152- chg_virtue(p_ptr, V_TEMPERANCE, -2);
3150+ chg_virtue(creature_ptr, V_HARMONY, -1);
3151+ chg_virtue(creature_ptr, V_PATIENCE, -1);
3152+ chg_virtue(creature_ptr, V_TEMPERANCE, -2);
31533153
31543154 break;
31553155 }
@@ -3341,9 +3341,9 @@ bool dec_stat(player_type *creature_ptr, int stat, int amount, int permanent)
33413341 /* Damage "max" value */
33423342 if (permanent && (max > 3))
33433343 {
3344- chg_virtue(p_ptr, V_SACRIFICE, 1);
3344+ chg_virtue(creature_ptr, V_SACRIFICE, 1);
33453345 if (stat == A_WIS || stat == A_INT)
3346- chg_virtue(p_ptr, V_ENLIGHTEN, -2);
3346+ chg_virtue(creature_ptr, V_ENLIGHTEN, -2);
33473347
33483348 /* Handle "low" values */
33493349 if (max <= 18)
@@ -3421,7 +3421,7 @@ bool res_stat(player_type *creature_ptr, int stat)
34213421 bool hp_player(player_type *creature_ptr, int num)
34223422 {
34233423 int vir;
3424- vir = virtue_number(p_ptr, V_VITALITY);
3424+ vir = virtue_number(creature_ptr, V_VITALITY);
34253425
34263426 if(num <= 0) return (FALSE);
34273427
@@ -3433,7 +3433,7 @@ bool hp_player(player_type *creature_ptr, int num)
34333433 if (creature_ptr->chp < creature_ptr->mhp)
34343434 {
34353435 if ((num > 0) && (creature_ptr->chp < (creature_ptr->mhp/3)))
3436- chg_virtue(p_ptr, V_TEMPERANCE, 1);
3436+ chg_virtue(creature_ptr, V_TEMPERANCE, 1);
34373437 /* Gain hitpoints */
34383438 creature_ptr->chp += num;
34393439
@@ -3582,16 +3582,16 @@ bool do_inc_stat(player_type *creature_ptr, int stat)
35823582 {
35833583 if (stat == A_WIS)
35843584 {
3585- chg_virtue(p_ptr, V_ENLIGHTEN, 1);
3586- chg_virtue(p_ptr, V_FAITH, 1);
3585+ chg_virtue(creature_ptr, V_ENLIGHTEN, 1);
3586+ chg_virtue(creature_ptr, V_FAITH, 1);
35873587 }
35883588 else if (stat == A_INT)
35893589 {
3590- chg_virtue(p_ptr, V_KNOWLEDGE, 1);
3591- chg_virtue(p_ptr, V_ENLIGHTEN, 1);
3590+ chg_virtue(creature_ptr, V_KNOWLEDGE, 1);
3591+ chg_virtue(creature_ptr, V_ENLIGHTEN, 1);
35923592 }
35933593 else if (stat == A_CON)
3594- chg_virtue(p_ptr, V_VITALITY, 1);
3594+ chg_virtue(creature_ptr, V_VITALITY, 1);
35953595
35963596 msg_format(_("ワーオ!とても%sなった!", "Wow! You feel very %s!"), desc_stat_pos[stat]);
35973597
@@ -3625,7 +3625,7 @@ bool restore_level(player_type *creature_ptr)
36253625 creature_ptr->exp = creature_ptr->max_exp;
36263626
36273627 /* Check the experience */
3628- check_experience(p_ptr);
3628+ check_experience(creature_ptr);
36293629
36303630 /* Did something */
36313631 return (TRUE);
@@ -3642,8 +3642,8 @@ bool lose_all_info(player_type *creature_ptr)
36423642 {
36433643 int i;
36443644
3645- chg_virtue(p_ptr, V_KNOWLEDGE, -5);
3646- chg_virtue(p_ptr, V_ENLIGHTEN, -5);
3645+ chg_virtue(creature_ptr, V_KNOWLEDGE, -5);
3646+ chg_virtue(creature_ptr, V_ENLIGHTEN, -5);
36473647
36483648 /* Forget info about objects */
36493649 for (i = 0; i < INVEN_TOTAL; i++)
@@ -3694,7 +3694,7 @@ void do_poly_wounds(player_type *creature_ptr)
36943694 if (Nasty_effect)
36953695 {
36963696 msg_print(_("新たな傷ができた!", "A new wound was created!"));
3697- take_hit(p_ptr, DAMAGE_LOSELIFE, change / 2, _("変化した傷", "a polymorphed wound"), -1);
3697+ take_hit(creature_ptr, DAMAGE_LOSELIFE, change / 2, _("変化した傷", "a polymorphed wound"), -1);
36983698 set_cut(creature_ptr,change);
36993699 }
37003700 else
@@ -3718,7 +3718,7 @@ void change_race(player_type *creature_ptr, CHARACTER_IDX new_race, concptr effe
37183718 msg_format("You current_world_ptr->game_turn into %s %s%s!", (!effect_msg[0] && is_a_vowel(title[0]) ? "an" : "a"), effect_msg, title);
37193719 #endif
37203720
3721- chg_virtue(p_ptr, V_CHANCE, 2);
3721+ chg_virtue(creature_ptr, V_CHANCE, 2);
37223722
37233723 if (creature_ptr->prace < 32)
37243724 {
@@ -3742,7 +3742,7 @@ void change_race(player_type *creature_ptr, CHARACTER_IDX new_race, concptr effe
37423742 creature_ptr->expfact -= 15;
37433743
37443744 /* Get character's height and weight */
3745- get_height_weight(p_ptr);
3745+ get_height_weight(creature_ptr);
37463746
37473747 /* Hitdice */
37483748 if (creature_ptr->pclass == CLASS_SORCERER)
@@ -3753,7 +3753,7 @@ void change_race(player_type *creature_ptr, CHARACTER_IDX new_race, concptr effe
37533753 roll_hitdice(creature_ptr, 0L);
37543754
37553755 /* The experience level may be modified */
3756- check_experience(p_ptr);
3756+ check_experience(creature_ptr);
37573757
37583758 creature_ptr->redraw |= (PR_BASIC);
37593759
@@ -3774,7 +3774,7 @@ void do_poly_self(player_type *creature_ptr)
37743774 int power = creature_ptr->lev;
37753775
37763776 msg_print(_("あなたは変化の訪れを感じた...", "You feel a change coming over you..."));
3777- chg_virtue(p_ptr, V_CHANCE, 1);
3777+ chg_virtue(creature_ptr, V_CHANCE, 1);
37783778
37793779 if ((power > randint0(20)) && one_in_(3) && (creature_ptr->prace != RACE_ANDROID))
37803780 {
@@ -3840,7 +3840,7 @@ void do_poly_self(player_type *creature_ptr)
38403840 /* Polymorph into a less mutated form */
38413841 power -= 10;
38423842
3843- if (!lose_mutation(p_ptr, 0))
3843+ if (!lose_mutation(creature_ptr, 0))
38443844 msg_print(_("奇妙なくらい普通になった気がする。", "You feel oddly normal."));
38453845 }
38463846
@@ -3869,7 +3869,7 @@ void do_poly_self(player_type *creature_ptr)
38693869 if (one_in_(6))
38703870 {
38713871 msg_print(_("現在の姿で生きていくのは困難なようだ!", "You find living difficult in your present form!"));
3872- take_hit(p_ptr, DAMAGE_LOSELIFE, damroll(randint1(10), creature_ptr->lev), _("致命的な突然変異", "a lethal mutation"), -1);
3872+ take_hit(creature_ptr, DAMAGE_LOSELIFE, damroll(randint1(10), creature_ptr->lev), _("致命的な突然変異", "a lethal mutation"), -1);
38733873
38743874 power -= 10;
38753875 }
@@ -3879,7 +3879,7 @@ void do_poly_self(player_type *creature_ptr)
38793879 {
38803880 power -= 10;
38813881
3882- get_max_stats(p_ptr);
3882+ get_max_stats(creature_ptr);
38833883 roll_hitdice(creature_ptr, 0L);
38843884 }
38853885
@@ -3922,7 +3922,7 @@ void gain_exp_64(player_type *creature_ptr, s32b amount, u32b amount_frac)
39223922 creature_ptr->max_exp += amount / 5;
39233923 }
39243924
3925- check_experience(p_ptr);
3925+ check_experience(creature_ptr);
39263926 }
39273927
39283928
@@ -4019,12 +4019,12 @@ void calc_android_exp(player_type *creature_ptr)
40194019 if (value > 100000L)
40204020 exp += (value - 100000L) / 4 * level;
40214021 }
4022- if ((((i == INVEN_RARM) || (i == INVEN_LARM)) && (has_melee_weapon(p_ptr, i))) || (i == INVEN_BOW)) total_exp += exp / 48;
4022+ if ((((i == INVEN_RARM) || (i == INVEN_LARM)) && (has_melee_weapon(creature_ptr, i))) || (i == INVEN_BOW)) total_exp += exp / 48;
40234023 else total_exp += exp / 16;
40244024 if (i == INVEN_BODY) total_exp += exp / 32;
40254025 }
40264026 creature_ptr->exp = creature_ptr->max_exp = total_exp;
4027- check_experience(p_ptr);
4027+ check_experience(creature_ptr);
40284028 }
40294029
40304030
@@ -4038,7 +4038,7 @@ void lose_exp(player_type *creature_ptr, s32b amount)
40384038
40394039 creature_ptr->exp -= amount;
40404040
4041- check_experience(p_ptr);
4041+ check_experience(creature_ptr);
40424042 }
40434043
40444044
@@ -4216,7 +4216,7 @@ bool choose_ele_attack(player_type *creature_ptr)
42164216
42174217 char choice;
42184218
4219- if (!has_melee_weapon(p_ptr, INVEN_RARM) && !has_melee_weapon(p_ptr, INVEN_LARM))
4219+ if (!has_melee_weapon(creature_ptr, INVEN_RARM) && !has_melee_weapon(creature_ptr, INVEN_LARM))
42204220 {
42214221 msg_format(_("武器を持たないと魔法剣は使えない。", "You cannot use temporary branding with no weapon."));
42224222 return FALSE;
Show on old repository browser