• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisionbf76214e3abd2e5f14ba8fe63b14c4b0b59f2d45 (tree)
Time2019-06-27 00:23:08
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/mutation.c
+++ b/src/mutation.c
@@ -2204,7 +2204,7 @@ bool mutation_power_aux(int power)
22042204
22052205 case MUT1_POLYMORPH:
22062206 if (!get_check(_("変身します。よろしいですか?", "You will polymorph your self. Are you sure? "))) return FALSE;
2207- do_poly_self();
2207+ do_poly_self(p_ptr);
22082208 break;
22092209
22102210 case MUT1_MIDAS_TCH:
--- a/src/patron.c
+++ b/src/patron.c
@@ -290,7 +290,7 @@ void gain_level_reward(int chosen_reward)
290290 msg_format(_("%sの声が響き渡った:", "The voice of %s booms out:"), chaos_patrons[p_ptr->chaos_patron]);
291291 msg_print(_("「汝、新たなる姿を必要とせり!」", "'Thou needst a new form, mortal!'"));
292292
293- do_poly_self();
293+ do_poly_self(p_ptr);
294294 reward = _("変異した。", "polymorphing");
295295 break;
296296
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -3769,14 +3769,14 @@ void change_race(CHARACTER_IDX new_race, concptr effect_msg)
37693769 }
37703770
37713771
3772-void do_poly_self(void)
3772+void do_poly_self(player_type *creature_ptr)
37733773 {
3774- int power = p_ptr->lev;
3774+ int power = creature_ptr->lev;
37753775
37763776 msg_print(_("あなたは変化の訪れを感じた...", "You feel a change coming over you..."));
37773777 chg_virtue(V_CHANCE, 1);
37783778
3779- if ((power > randint0(20)) && one_in_(3) && (p_ptr->prace != RACE_ANDROID))
3779+ if ((power > randint0(20)) && one_in_(3) && (creature_ptr->prace != RACE_ANDROID))
37803780 {
37813781 char effect_msg[80] = "";
37823782 CHARACTER_IDX new_race;
@@ -3789,16 +3789,16 @@ void do_poly_self(void)
37893789 /* sex change */
37903790 power -= 2;
37913791
3792- if (p_ptr->psex == SEX_MALE)
3792+ if (creature_ptr->psex == SEX_MALE)
37933793 {
3794- p_ptr->psex = SEX_FEMALE;
3795- sp_ptr = &sex_info[p_ptr->psex];
3794+ creature_ptr->psex = SEX_FEMALE;
3795+ sp_ptr = &sex_info[creature_ptr->psex];
37963796 sprintf(effect_msg, _("女性の", "female "));
37973797 }
37983798 else
37993799 {
3800- p_ptr->psex = SEX_MALE;
3801- sp_ptr = &sex_info[p_ptr->psex];
3800+ creature_ptr->psex = SEX_MALE;
3801+ sp_ptr = &sex_info[creature_ptr->psex];
38023802 sprintf(effect_msg, _("男性の", "male "));
38033803 }
38043804 }
@@ -3814,14 +3814,14 @@ void do_poly_self(void)
38143814 {
38153815 if (one_in_(2))
38163816 {
3817- (void)dec_stat(p_ptr, tmp, randint1(6) + 6, one_in_(3));
3817+ (void)dec_stat(creature_ptr, tmp, randint1(6) + 6, one_in_(3));
38183818 power -= 1;
38193819 }
38203820 tmp++;
38213821 }
38223822
38233823 /* Deformities are discriminated against! */
3824- (void)dec_stat(p_ptr, A_CHR, randint1(6), TRUE);
3824+ (void)dec_stat(creature_ptr, A_CHR, randint1(6), TRUE);
38253825
38263826 if (effect_msg[0])
38273827 {
@@ -3848,7 +3848,7 @@ void do_poly_self(void)
38483848 {
38493849 new_race = (CHARACTER_IDX)randint0(MAX_RACES);
38503850 }
3851- while ((new_race == p_ptr->prace) || (new_race == RACE_ANDROID));
3851+ while ((new_race == creature_ptr->prace) || (new_race == RACE_ANDROID));
38523852
38533853 change_race(new_race, effect_msg);
38543854 }
@@ -3859,17 +3859,17 @@ void do_poly_self(void)
38593859
38603860 /* Abomination! */
38613861 power -= 20;
3862- msg_format(_("%sの構成が変化した!", "Your internal organs are rearranged!"), p_ptr->prace == RACE_ANDROID ? "機械" : "内臓");
3862+ msg_format(_("%sの構成が変化した!", "Your internal organs are rearranged!"), creature_ptr->prace == RACE_ANDROID ? "機械" : "内臓");
38633863
38643864 while (tmp < A_MAX)
38653865 {
3866- (void)dec_stat(p_ptr, tmp, randint1(6) + 6, one_in_(3));
3866+ (void)dec_stat(creature_ptr, tmp, randint1(6) + 6, one_in_(3));
38673867 tmp++;
38683868 }
38693869 if (one_in_(6))
38703870 {
38713871 msg_print(_("現在の姿で生きていくのは困難なようだ!", "You find living difficult in your present form!"));
3872- take_hit(DAMAGE_LOSELIFE, damroll(randint1(10), p_ptr->lev), _("致命的な突然変異", "a lethal mutation"), -1);
3872+ take_hit(DAMAGE_LOSELIFE, damroll(randint1(10), creature_ptr->lev), _("致命的な突然変異", "a lethal mutation"), -1);
38733873
38743874 power -= 10;
38753875 }
@@ -3880,13 +3880,13 @@ void do_poly_self(void)
38803880 power -= 10;
38813881
38823882 get_max_stats();
3883- roll_hitdice(p_ptr, 0L);
3883+ roll_hitdice(creature_ptr, 0L);
38843884 }
38853885
38863886 while ((power > randint0(15)) && one_in_(3))
38873887 {
38883888 power -= 7;
3889- (void)gain_mutation(p_ptr, 0);
3889+ (void)gain_mutation(creature_ptr, 0);
38903890 }
38913891
38923892 if (power > randint0(5))
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -71,7 +71,7 @@ extern void gain_exp(s32b amount);
7171 extern void calc_android_exp(player_type *creature_ptr);
7272 extern void lose_exp(s32b amount);
7373 extern bool drain_exp(s32b drain, s32b slip, int hold_exp_prob);
74-extern void do_poly_self(void);
74+extern void do_poly_self(player_type *creature_ptr);
7575 extern bool set_ultimate_res(TIME_EFFECT v, bool do_dec);
7676 extern bool set_tim_res_nether(TIME_EFFECT v, bool do_dec);
7777 extern bool set_tim_res_time(TIME_EFFECT v, bool do_dec);
--- a/src/realm-chaos.c
+++ b/src/realm-chaos.c
@@ -536,7 +536,7 @@ concptr do_chaos_spell(SPELL_IDX spell, BIT_FLAGS mode)
536536 if (cast)
537537 {
538538 if (!get_check(_("変身します。よろしいですか?", "You will polymorph yourself. Are you sure? "))) return NULL;
539- do_poly_self();
539+ do_poly_self(p_ptr);
540540 }
541541 }
542542 break;
--- a/src/spells1.c
+++ b/src/spells1.c
@@ -4189,7 +4189,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
41894189 {
41904190 msg_print(_("奇形的な変身を遂げた!", "You undergo a freakish metamorphosis!"));
41914191 if (one_in_(4)) /* 4 */
4192- do_poly_self();
4192+ do_poly_self(p_ptr);
41934193 else
41944194 status_shuffle();
41954195 }
Show on old repository browser