• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision2a4a2dea93d05f6b2798ff297ad78463267160c0 (tree)
Time2019-07-03 23:44:58
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/birth.c
+++ b/src/birth.c
@@ -1195,52 +1195,52 @@ void get_max_stats(player_type *creature_ptr)
11951195 * @brief その他「オートローラ中は算出の対象にしない」副次ステータスを処理する / Roll for some info that the auto-roller ignores
11961196 * @return なし
11971197 */
1198-static void get_extra(bool roll_hitdie)
1198+static void get_extra(player_type *creature_ptr, bool roll_hitdie)
11991199 {
12001200 int i, j;
12011201
12021202 /* Experience factor */
1203- if (p_ptr->prace == RACE_ANDROID) p_ptr->expfact = rp_ptr->r_exp;
1204- else p_ptr->expfact = rp_ptr->r_exp + cp_ptr->c_exp;
1203+ if (creature_ptr->prace == RACE_ANDROID) creature_ptr->expfact = rp_ptr->r_exp;
1204+ else creature_ptr->expfact = rp_ptr->r_exp + cp_ptr->c_exp;
12051205
1206- if (((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER) || (p_ptr->pclass == CLASS_NINJA)) && ((p_ptr->prace == RACE_KLACKON) || (p_ptr->prace == RACE_SPRITE)))
1207- p_ptr->expfact -= 15;
1206+ if (((creature_ptr->pclass == CLASS_MONK) || (creature_ptr->pclass == CLASS_FORCETRAINER) || (creature_ptr->pclass == CLASS_NINJA)) && ((creature_ptr->prace == RACE_KLACKON) || (creature_ptr->prace == RACE_SPRITE)))
1207+ creature_ptr->expfact -= 15;
12081208
12091209 /* Reset record of race/realm changes */
1210- p_ptr->start_race = p_ptr->prace;
1211- p_ptr->old_race1 = 0L;
1212- p_ptr->old_race2 = 0L;
1213- p_ptr->old_realm = 0;
1210+ creature_ptr->start_race = creature_ptr->prace;
1211+ creature_ptr->old_race1 = 0L;
1212+ creature_ptr->old_race2 = 0L;
1213+ creature_ptr->old_realm = 0;
12141214
12151215 for (i = 0; i < 64; i++)
12161216 {
1217- if (p_ptr->pclass == CLASS_SORCERER) p_ptr->spell_exp[i] = SPELL_EXP_MASTER;
1218- else if (p_ptr->pclass == CLASS_RED_MAGE) p_ptr->spell_exp[i] = SPELL_EXP_SKILLED;
1219- else p_ptr->spell_exp[i] = SPELL_EXP_UNSKILLED;
1217+ if (creature_ptr->pclass == CLASS_SORCERER) creature_ptr->spell_exp[i] = SPELL_EXP_MASTER;
1218+ else if (creature_ptr->pclass == CLASS_RED_MAGE) creature_ptr->spell_exp[i] = SPELL_EXP_SKILLED;
1219+ else creature_ptr->spell_exp[i] = SPELL_EXP_UNSKILLED;
12201220 }
12211221
12221222 for (i = 0; i < 5; i++)
12231223 for (j = 0; j < 64; j++)
1224- p_ptr->weapon_exp[i][j] = s_info[p_ptr->pclass].w_start[i][j];
1225- if ((p_ptr->pseikaku == SEIKAKU_SEXY) && (p_ptr->weapon_exp[TV_HAFTED-TV_WEAPON_BEGIN][SV_WHIP] < WEAPON_EXP_BEGINNER))
1224+ creature_ptr->weapon_exp[i][j] = s_info[creature_ptr->pclass].w_start[i][j];
1225+ if ((creature_ptr->pseikaku == SEIKAKU_SEXY) && (creature_ptr->weapon_exp[TV_HAFTED-TV_WEAPON_BEGIN][SV_WHIP] < WEAPON_EXP_BEGINNER))
12261226 {
1227- p_ptr->weapon_exp[TV_HAFTED-TV_WEAPON_BEGIN][SV_WHIP] = WEAPON_EXP_BEGINNER;
1227+ creature_ptr->weapon_exp[TV_HAFTED-TV_WEAPON_BEGIN][SV_WHIP] = WEAPON_EXP_BEGINNER;
12281228 }
12291229
12301230 for (i = 0; i < GINOU_MAX; i++)
1231- p_ptr->skill_exp[i] = s_info[p_ptr->pclass].s_start[i];
1231+ creature_ptr->skill_exp[i] = s_info[creature_ptr->pclass].s_start[i];
12321232
12331233 /* Hitdice */
1234- if (p_ptr->pclass == CLASS_SORCERER)
1235- p_ptr->hitdie = rp_ptr->r_mhp/2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
1234+ if (creature_ptr->pclass == CLASS_SORCERER)
1235+ creature_ptr->hitdie = rp_ptr->r_mhp/2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
12361236 else
1237- p_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
1237+ creature_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
12381238
12391239 /* Roll for hit point unless quick-start */
1240- if (roll_hitdie) roll_hitdice(p_ptr, SPOP_NO_UPDATE);
1240+ if (roll_hitdie) roll_hitdice(creature_ptr, SPOP_NO_UPDATE);
12411241
12421242 /* Initial hitpoints */
1243- p_ptr->mhp = p_ptr->player_hp[0];
1243+ creature_ptr->mhp = creature_ptr->player_hp[0];
12441244 }
12451245
12461246
@@ -4358,7 +4358,7 @@ static bool player_birth_aux(void)
43584358 mode = 0;
43594359
43604360 /* Roll for base hitpoints */
4361- get_extra(TRUE);
4361+ get_extra(p_ptr, TRUE);
43624362
43634363 /* Roll for gold */
43644364 get_money();
@@ -4552,7 +4552,7 @@ static bool ask_quick_start(void)
45524552 ap_ptr = &seikaku_info[p_ptr->pseikaku];
45534553
45544554 /* Calc hitdie, but don't roll */
4555- get_extra(FALSE);
4555+ get_extra(p_ptr, FALSE);
45564556
45574557 p_ptr->update |= (PU_BONUS | PU_HP);
45584558 update_creature(p_ptr);
Show on old repository browser