• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision6b21e1dcc0d10b31dea9e847b4649324f04fb5f3 (tree)
Zeit2019-12-03 19:44:29
Autordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38997 blow_damcalc() に player_type * 引数を追加. / Add player_type * argument to blow_damcalc().

Ändern Zusammenfassung

Diff

--- a/src/warning.c
+++ b/src/warning.c
@@ -320,7 +320,7 @@ void spell_damcalc_by_spellnum(int spell_num, EFFECT_ID typ, MONSTER_IDX m_idx,
320320 * @param blow_ptr モンスターの打撃能力の構造体参照ポインタ
321321 * @return 算出された最大ダメージを返す。
322322 */
323-static int blow_damcalc(monster_type *m_ptr, monster_blow *blow_ptr)
323+static int blow_damcalc(monster_type *m_ptr, player_type *target_ptr, monster_blow *blow_ptr)
324324 {
325325 int dam = blow_ptr->d_dice * blow_ptr->d_side;
326326 int dummy_max = 0;
@@ -328,7 +328,7 @@ static int blow_damcalc(monster_type *m_ptr, monster_blow *blow_ptr)
328328
329329 if (blow_ptr->method != RBM_EXPLODE)
330330 {
331- ARMOUR_CLASS ac = p_ptr->ac + p_ptr->to_a;
331+ ARMOUR_CLASS ac = target_ptr->ac + target_ptr->to_a;
332332
333333 switch (blow_ptr->effect)
334334 {
@@ -345,25 +345,25 @@ static int blow_damcalc(monster_type *m_ptr, monster_blow *blow_ptr)
345345 break;
346346
347347 case RBE_ACID:
348- spell_damcalc(p_ptr, m_ptr, GF_ACID, dam, &dummy_max);
348+ spell_damcalc(target_ptr, m_ptr, GF_ACID, dam, &dummy_max);
349349 dam = dummy_max;
350350 check_wraith_form = FALSE;
351351 break;
352352
353353 case RBE_ELEC:
354- spell_damcalc(p_ptr, m_ptr, GF_ELEC, dam, &dummy_max);
354+ spell_damcalc(target_ptr, m_ptr, GF_ELEC, dam, &dummy_max);
355355 dam = dummy_max;
356356 check_wraith_form = FALSE;
357357 break;
358358
359359 case RBE_FIRE:
360- spell_damcalc(p_ptr, m_ptr, GF_FIRE, dam, &dummy_max);
360+ spell_damcalc(target_ptr, m_ptr, GF_FIRE, dam, &dummy_max);
361361 dam = dummy_max;
362362 check_wraith_form = FALSE;
363363 break;
364364
365365 case RBE_COLD:
366- spell_damcalc(p_ptr, m_ptr, GF_COLD, dam, &dummy_max);
366+ spell_damcalc(target_ptr, m_ptr, GF_COLD, dam, &dummy_max);
367367 dam = dummy_max;
368368 check_wraith_form = FALSE;
369369 break;
@@ -374,7 +374,7 @@ static int blow_damcalc(monster_type *m_ptr, monster_blow *blow_ptr)
374374 break;
375375 }
376376
377- if (check_wraith_form && p_ptr->wraith_form)
377+ if (check_wraith_form && target_ptr->wraith_form)
378378 {
379379 dam /= 2;
380380 if (!dam) dam = 1;
@@ -383,7 +383,7 @@ static int blow_damcalc(monster_type *m_ptr, monster_blow *blow_ptr)
383383 else
384384 {
385385 dam = (dam + 1) / 2;
386- spell_damcalc(p_ptr, m_ptr, mbe_info[blow_ptr->effect].explode_type, dam, &dummy_max);
386+ spell_damcalc(target_ptr, m_ptr, mbe_info[blow_ptr->effect].explode_type, dam, &dummy_max);
387387 dam = dummy_max;
388388 }
389389
@@ -482,7 +482,7 @@ bool process_warning(POSITION xx, POSITION yy)
482482 if (!r_ptr->blow[m].method || (r_ptr->blow[m].method == RBM_SHOOT)) continue;
483483
484484 /* Extract the attack info */
485- dam_melee += blow_damcalc(m_ptr, &r_ptr->blow[m]);
485+ dam_melee += blow_damcalc(m_ptr, p_ptr, &r_ptr->blow[m]);
486486 if (r_ptr->blow[m].method == RBM_EXPLODE) break;
487487 }
488488 if (dam_melee > dam_max0) dam_max0 = dam_melee;
Show on old repository browser