• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisiond999e7f0ca75c8310871a877e1771c1610378188 (tree)
Time2019-08-12 23:30:01
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/racial.c
+++ b/src/racial.c
@@ -248,7 +248,7 @@ struct power_desc_type
248248 * @param pd_ptr 発動したいレイシャル・パワー情報の構造体参照ポインタ
249249 * @return 成功率(%)を返す
250250 */
251-static PERCENTAGE racial_chance(power_desc_type *pd_ptr)
251+static PERCENTAGE racial_chance(player_type *creature_ptr, power_desc_type *pd_ptr)
252252 {
253253 PLAYER_LEVEL min_level = pd_ptr->level;
254254 PERCENTAGE difficulty = pd_ptr->fail;
@@ -256,10 +256,10 @@ static PERCENTAGE racial_chance(power_desc_type *pd_ptr)
256256 int i;
257257 int val;
258258 int sum = 0;
259- BASE_STATUS stat = p_ptr->stat_cur[pd_ptr->stat];
259+ BASE_STATUS stat = creature_ptr->stat_cur[pd_ptr->stat];
260260
261261 /* No chance for success */
262- if ((p_ptr->lev < min_level) || p_ptr->confused)
262+ if ((creature_ptr->lev < min_level) || creature_ptr->confused)
263263 {
264264 return (0);
265265 }
@@ -267,13 +267,13 @@ static PERCENTAGE racial_chance(power_desc_type *pd_ptr)
267267 if (difficulty == 0) return 100;
268268
269269 /* Calculate difficulty */
270- if (p_ptr->stun)
270+ if (creature_ptr->stun)
271271 {
272- difficulty += (PERCENTAGE)p_ptr->stun;
272+ difficulty += (PERCENTAGE)creature_ptr->stun;
273273 }
274- else if (p_ptr->lev > min_level)
274+ else if (creature_ptr->lev > min_level)
275275 {
276- PERCENTAGE lev_adj = (PERCENTAGE)((p_ptr->lev - min_level) / 3);
276+ PERCENTAGE lev_adj = (PERCENTAGE)((creature_ptr->lev - min_level) / 3);
277277 if (lev_adj > 10) lev_adj = 10;
278278 difficulty -= lev_adj;
279279 }
@@ -1919,7 +1919,7 @@ if (!repeat_pull(&i) || i<0 || i>=num) {
19191919 }
19201920 strcat(dummy, format("%-23.23s %2d %4d %3d%%",
19211921 power_desc[ctr].name, power_desc[ctr].level, power_desc[ctr].cost,
1922- 100 - racial_chance(&power_desc[ctr])));
1922+ 100 - racial_chance(p_ptr, &power_desc[ctr])));
19231923 prt(dummy, y1, x1);
19241924 ctr++;
19251925 }
Show on old repository browser