OSDN Git Service

[Refactor] #38997 tot_dam_aux() に player_type * 引数を追加. / Add player_type * argument...
authordeskull <deskull@users.sourceforge.jp>
Sun, 1 Sep 2019 12:41:31 +0000 (21:41 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sun, 1 Sep 2019 12:41:31 +0000 (21:41 +0900)
src/cmd/cmd-basic.c
src/combat/melee.h
src/combat/melee1.c

index 67b91c2..793c344 100644 (file)
@@ -2627,7 +2627,7 @@ bool do_cmd_throw(player_type *creature_ptr, int mult, bool boomerang, OBJECT_ID
                                torch_dice(q_ptr, &dd, &ds); /* throwing a torch */
                                tdam = damroll(dd, ds);
                                /* Apply special damage */
-                               tdam = tot_dam_aux(q_ptr, tdam, m_ptr, 0, TRUE);
+                               tdam = tot_dam_aux(creature_ptr, q_ptr, tdam, m_ptr, 0, TRUE);
                                tdam = critical_shot(q_ptr->weight, q_ptr->to_h, 0, tdam);
                                if (q_ptr->to_d > 0)
                                        tdam += q_ptr->to_d;
index 4fbbe95..359781a 100644 (file)
@@ -152,7 +152,7 @@ extern const int monk_ave_damage[PY_MAX_LEVEL + 1][3];
 
 extern bool test_hit_norm(HIT_RELIABILITY chance, ARMOUR_CLASS ac, bool visible);
 extern PERCENTAGE hit_chance(HIT_RELIABILITY chance, ARMOUR_CLASS ac);
-extern HIT_POINT tot_dam_aux(object_type *o_ptr, HIT_POINT tdam, monster_type *m_ptr, BIT_FLAGS mode, bool thrown);
+extern HIT_POINT tot_dam_aux(player_type *attacker_ptr, object_type *o_ptr, HIT_POINT tdam, monster_type *m_ptr, BIT_FLAGS mode, bool thrown);
 extern HIT_POINT critical_norm(WEIGHT weight, int plus, HIT_POINT dam, s16b meichuu, BIT_FLAGS mode);
 extern bool py_attack(POSITION y, POSITION x, COMBAT_OPTION_IDX mode);
 extern bool make_attack_normal(MONSTER_IDX m_idx);
index 1dad2f4..c761d07 100644 (file)
@@ -845,7 +845,7 @@ static MULTIPLY mult_hissatsu(MULTIPLY mult, BIT_FLAGS *flgs, monster_type *m_pt
  * Note that most brands and slays are x3, except Slay Animal (x2),\n
  * Slay Evil (x2), and Kill dragon (x5).\n
  */
-HIT_POINT tot_dam_aux(object_type *o_ptr, HIT_POINT tdam, monster_type *m_ptr, BIT_FLAGS mode, bool thrown)
+HIT_POINT tot_dam_aux(player_type *attacker_ptr, object_type *o_ptr, HIT_POINT tdam, monster_type *m_ptr, BIT_FLAGS mode, bool thrown)
 {
        MULTIPLY mult = 10;
 
@@ -855,11 +855,11 @@ HIT_POINT tot_dam_aux(object_type *o_ptr, HIT_POINT tdam, monster_type *m_ptr, B
 
        if (!thrown)
        {
-               if (p_ptr->special_attack & (ATTACK_ACID)) add_flag(flgs, TR_BRAND_ACID);
-               if (p_ptr->special_attack & (ATTACK_COLD)) add_flag(flgs, TR_BRAND_COLD);
-               if (p_ptr->special_attack & (ATTACK_ELEC)) add_flag(flgs, TR_BRAND_ELEC);
-               if (p_ptr->special_attack & (ATTACK_FIRE)) add_flag(flgs, TR_BRAND_FIRE);
-               if (p_ptr->special_attack & (ATTACK_POIS)) add_flag(flgs, TR_BRAND_POIS);
+               if (attacker_ptr->special_attack & (ATTACK_ACID)) add_flag(flgs, TR_BRAND_ACID);
+               if (attacker_ptr->special_attack & (ATTACK_COLD)) add_flag(flgs, TR_BRAND_COLD);
+               if (attacker_ptr->special_attack & (ATTACK_ELEC)) add_flag(flgs, TR_BRAND_ELEC);
+               if (attacker_ptr->special_attack & (ATTACK_FIRE)) add_flag(flgs, TR_BRAND_FIRE);
+               if (attacker_ptr->special_attack & (ATTACK_POIS)) add_flag(flgs, TR_BRAND_POIS);
        }
 
        if (hex_spelling(HEX_RUNESWORD)) add_flag(flgs, TR_SLAY_GOOD);
@@ -879,15 +879,15 @@ HIT_POINT tot_dam_aux(object_type *o_ptr, HIT_POINT tdam, monster_type *m_ptr, B
 
                mult = mult_brand(mult, flgs, m_ptr);
 
-               if (p_ptr->pclass == CLASS_SAMURAI)
+               if (attacker_ptr->pclass == CLASS_SAMURAI)
                {
                        mult = mult_hissatsu(mult, flgs, m_ptr, mode);
                }
 
-               if ((p_ptr->pclass != CLASS_SAMURAI) && (have_flag(flgs, TR_FORCE_WEAPON)) && (p_ptr->csp > (o_ptr->dd * o_ptr->ds / 5)))
+               if ((attacker_ptr->pclass != CLASS_SAMURAI) && (have_flag(flgs, TR_FORCE_WEAPON)) && (attacker_ptr->csp > (o_ptr->dd * o_ptr->ds / 5)))
                {
-                       p_ptr->csp -= (1 + (o_ptr->dd * o_ptr->ds / 5));
-                       p_ptr->redraw |= (PR_MANA);
+                       attacker_ptr->csp -= (1 + (o_ptr->dd * o_ptr->ds / 5));
+                       attacker_ptr->redraw |= (PR_MANA);
                        mult = mult * 3 / 2 + 20;
                }
 
@@ -1638,7 +1638,7 @@ static void py_attack_aux(player_type *attacker_ptr, POSITION y, POSITION x, boo
                        else if (o_ptr->k_idx)
                        {
                                k = damroll(o_ptr->dd + attacker_ptr->to_dd[hand], o_ptr->ds + attacker_ptr->to_ds[hand]);
-                               k = tot_dam_aux(o_ptr, k, m_ptr, mode, FALSE);
+                               k = tot_dam_aux(attacker_ptr, o_ptr, k, m_ptr, mode, FALSE);
 
                                if (backstab)
                                {