OSDN Git Service

[Refactor] #38997 brand_bolts() にplayer_type * を追加 / Added player_type * to brand_bolts()
authorHourier <hourier@users.sourceforge.jp>
Sat, 4 Jan 2020 15:06:29 +0000 (00:06 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sat, 4 Jan 2020 15:06:29 +0000 (00:06 +0900)
src/cmd/cmd-activate.c
src/spells-object.c
src/spells-object.h

index 13d957f..a577a21 100644 (file)
@@ -688,6 +688,7 @@ static bool activate_dragon_breath(player_type *user_ptr, object_type *o_ptr)
 
 /*!
  * @brief アイテムの発動効果を処理する。
+ * @param user_ptr プレーヤーへの参照ポインタ
  * @param o_ptr 対象のオブジェクト構造体ポインタ
  * @return 発動実行の是非を返す。
  */
@@ -1634,7 +1635,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        case ACT_BRAND_FIRE_BOLTS:
        {
                msg_format(_("%sが深紅に輝いた...", "Your %s glows deep red..."), name);
-               (void)brand_bolts();
+               brand_bolts(user_ptr);
                break;
        }
 
index 11b141e..4eaac6b 100644 (file)
@@ -249,6 +249,7 @@ bool create_ammo(player_type *creature_ptr)
        return TRUE;
 }
 
+
 /*!
  * @brief 魔道具術師の魔力取り込み処理
  * @param user_ptr アイテムを取り込むクリーチャー
@@ -331,6 +332,7 @@ bool import_magic_device(player_type *user_ptr)
        return TRUE;
 }
 
+
 /*!
  * @brief 誰得ドロップを行う。
  * @param y1 配置したいフロアのY座標
@@ -418,7 +420,6 @@ void amusement(POSITION y1, POSITION x1, int num, bool known)
 }
 
 
-
 /*!
  * @brief 獲得ドロップを行う。
  * Scatter some "great" objects near the player
@@ -455,6 +456,7 @@ void acquirement(POSITION y1, POSITION x1, int num, bool great, bool special, bo
        }
 }
 
+
 void acquire_chaos_weapon(player_type *creature_ptr)
 {
        object_type forge;
@@ -622,6 +624,7 @@ bool curse_armor(player_type *owner_ptr)
        return (TRUE);
 }
 
+
 /*!
  * @brief 武器呪縛処理 /
  * Curse the players weapon
@@ -683,6 +686,7 @@ bool curse_weapon_object(player_type *owner_ptr, bool force, object_type *o_ptr)
        return (TRUE);
 }
 
+
 /*!
  * @brief 武器呪縛処理のメインルーチン /
  * Curse the players weapon
@@ -742,19 +746,19 @@ bool rustproof(player_type *caster_ptr)
        return TRUE;
 }
 
+
 /*!
  * @brief ボルトのエゴ化処理(火炎エゴのみ) /
  * Enchant some bolts
- * @return 常にTRUEを返す
+ * @param caster_ptr プレーヤーへの参照ポインタ
+ * @return なし
  */
-bool brand_bolts(void)
+void brand_bolts(player_type *caster_ptr)
 {
-       int i;
-
        /* Use the first acceptable bolts */
-       for (i = 0; i < INVEN_PACK; i++)
+       for (int i = 0; i < INVEN_PACK; i++)
        {
-               object_type *o_ptr = &p_ptr->inventory_list[i];
+               object_type *o_ptr = &caster_ptr->inventory_list[i];
 
                /* Skip non-bolts */
                if (o_ptr->tval != TV_BOLT) continue;
@@ -774,15 +778,11 @@ bool brand_bolts(void)
                /* Ego-item */
                o_ptr->name2 = EGO_FLAME;
                enchant(o_ptr, randint0(3) + 4, ENCH_TOHIT | ENCH_TODAM);
-               return (TRUE);
+               return;
        }
 
        if (flush_failure) flush();
-
-       /* Fail */
        msg_print(_("炎で強化するのに失敗した。", "The fiery enchantment failed."));
-
-       return (TRUE);
 }
 
 
@@ -827,6 +827,7 @@ bool perilous_secrets(player_type *user_ptr)
 
 }
 
+
 /*!
  * @brief 固定アーティファクト『ブラッディムーン』の特性を変更する。
  * @details スレイ2d2種、及びone_resistance()による耐性1d2種、pval2種を得る。
@@ -861,6 +862,7 @@ void get_bloody_moon_flags(object_type *o_ptr)
        }
 }
 
+
 /*!
  * @brief 寿命つき光源の燃素追加処理 /
  * Charge a lite (torch or latern)
@@ -909,6 +911,7 @@ void phlogiston(player_type *caster_ptr)
        caster_ptr->update |= (PU_TORCH);
 }
 
+
 /*!
  * @brief 武器の祝福処理 /
  * Bless a weapon
@@ -1108,6 +1111,7 @@ bool pulish_shield(player_type *caster_ptr)
        return FALSE;
 }
 
+
 /*!
  * @brief 呪いの打ち破り処理 /
  * Break the curse of an item
@@ -1126,6 +1130,7 @@ static void break_curse(object_type *o_ptr)
        }
 }
 
+
 /*!
  * @brief 装備修正強化処理 /
  * Enchants a plus onto an item. -RAK-
@@ -1299,7 +1304,6 @@ bool enchant_spell(HIT_PROB num_hit, HIT_POINT num_dam, ARMOUR_CLASS num_ac)
 }
 
 
-
 /*!
  * @brief 武器へのエゴ付加処理 /
  * Brand the current weapon
@@ -1440,5 +1444,6 @@ void brand_weapon(player_type *caster_ptr, int brand_type)
                msg_print(_("属性付加に失敗した。", "The Branding failed."));
                chg_virtue(caster_ptr, V_ENCHANT, -2);
        }
+
        calc_android_exp(caster_ptr);
 }
index e99a79a..1e7e22b 100644 (file)
@@ -9,7 +9,7 @@ extern bool curse_armor(player_type *owner_ptr);
 extern bool curse_weapon_object(player_type *creature_ptr, bool force, object_type *o_ptr);
 extern bool curse_weapon(bool force, int slot);
 extern bool rustproof(player_type *caster_ptr);
-extern bool brand_bolts(void);
+extern void brand_bolts(player_type *caster_ptr);
 extern bool perilous_secrets(player_type *user_ptr);
 extern void get_bloody_moon_flags(object_type *o_ptr);
 extern void phlogiston(player_type *caster_ptr);