OSDN Git Service

[Refactor] #38997 brand_weapon() に player_type * 引数を追加. / Add player_type * argument...
authordeskull <deskull@users.sourceforge.jp>
Tue, 5 Nov 2019 15:38:26 +0000 (00:38 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Tue, 5 Nov 2019 15:38:26 +0000 (00:38 +0900)
src/realm-chaos.c
src/realm-craft.c
src/realm-crusade.c
src/realm-daemon.c
src/realm-death.c
src/realm-nature.c
src/realm-trump.c
src/spells-object.c
src/spells-object.h

index 9cadcfd..cd291a8 100644 (file)
@@ -445,7 +445,7 @@ concptr do_chaos_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
                {
                        if (cast)
                        {
-                               brand_weapon(2);
+                               brand_weapon(caster_ptr, 2);
                        }
                }
                break;
index c02c5d9..e17c301 100644 (file)
@@ -475,7 +475,7 @@ concptr do_craft_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
                {
                        if (cast)
                        {
-                               brand_weapon(randint0(18));
+                               brand_weapon(caster_ptr, randint0(18));
                        }
                }
                break;
index 1389520..669987b 100644 (file)
@@ -363,7 +363,7 @@ concptr do_crusade_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mod
                {
                        if (cast)
                        {
-                               brand_weapon(13);
+                               brand_weapon(caster_ptr, 13);
                        }
                }
                break;
index bf7d625..00fa3f0 100644 (file)
@@ -276,7 +276,7 @@ concptr do_daemon_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
                {
                        if (cast)
                        {
-                               brand_weapon(1);
+                               brand_weapon(caster_ptr, 1);
                        }
                }
                break;
index 652cb23..6f8dae5 100644 (file)
@@ -285,7 +285,7 @@ concptr do_death_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
                {
                        if (cast)
                        {
-                               brand_weapon(3);
+                               brand_weapon(caster_ptr, 3);
                        }
                }
                break;
@@ -443,7 +443,7 @@ concptr do_death_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
                {
                        if (cast)
                        {
-                               brand_weapon(4);
+                               brand_weapon(caster_ptr, 4);
                        }
                }
                break;
index 3422813..103612b 100644 (file)
@@ -542,7 +542,7 @@ concptr do_nature_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
                {
                        if (cast)
                        {
-                               brand_weapon(randint0(2));
+                               brand_weapon(caster_ptr, randint0(2));
                        }
                }
                break;
index 0289376..e9dcfc2 100644 (file)
@@ -442,7 +442,7 @@ concptr do_trump_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
                {
                        if (cast)
                        {
-                               brand_weapon(5);
+                               brand_weapon(caster_ptr, 5);
                        }
                }
                break;
index 5433273..bfb78b0 100644 (file)
@@ -1342,7 +1342,7 @@ bool enchant_spell(HIT_PROB num_hit, HIT_POINT num_dam, ARMOUR_CLASS num_ac)
  * @param brand_type エゴ化ID(e_info.txtとは連動していない)
  * @return なし
  */
-void brand_weapon(int brand_type)
+void brand_weapon(player_type *caster_ptr, int brand_type)
 {
        OBJECT_IDX item;
        object_type *o_ptr;
@@ -1354,7 +1354,7 @@ void brand_weapon(int brand_type)
        q = _("どの武器を強化しますか? ", "Enchant which weapon? ");
        s = _("強化できる武器がない。", "You have nothing to enchant.");
 
-       o_ptr = choose_object(p_ptr, &item, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0);
+       o_ptr = choose_object(caster_ptr, &item, q, s, (USE_EQUIP | IGNORE_BOTHHAND_SLOT), 0);
        if (!o_ptr) return;
 
        /* you can never modify artifacts / ego-items */
@@ -1380,7 +1380,7 @@ void brand_weapon(int brand_type)
                                act = _("は鋭さを増した!", "becomes very sharp!");
 
                                o_ptr->name2 = EGO_SHARPNESS;
-                               o_ptr->pval = (PARAMETER_VALUE)m_bonus(5, p_ptr->current_floor_ptr->dun_level) + 1;
+                               o_ptr->pval = (PARAMETER_VALUE)m_bonus(5, caster_ptr->current_floor_ptr->dun_level) + 1;
 
                                if ((o_ptr->sval == SV_HAYABUSA) && (o_ptr->pval > 2))
                                        o_ptr->pval = 2;
@@ -1389,7 +1389,7 @@ void brand_weapon(int brand_type)
                        {
                                act = _("は破壊力を増した!", "seems very powerful.");
                                o_ptr->name2 = EGO_EARTHQUAKES;
-                               o_ptr->pval = (PARAMETER_VALUE)m_bonus(3, p_ptr->current_floor_ptr->dun_level);
+                               o_ptr->pval = (PARAMETER_VALUE)m_bonus(3, caster_ptr->current_floor_ptr->dun_level);
                        }
                        break;
                case 16:
@@ -1467,14 +1467,14 @@ void brand_weapon(int brand_type)
                enchant(o_ptr, randint0(3) + 4, ENCH_TOHIT | ENCH_TODAM);
 
                o_ptr->discount = 99;
-               chg_virtue(p_ptr, V_ENCHANT, 2);
+               chg_virtue(caster_ptr, V_ENCHANT, 2);
        }
        else
        {
                if (flush_failure) flush();
 
                msg_print(_("属性付加に失敗した。", "The Branding failed."));
-               chg_virtue(p_ptr, V_ENCHANT, -2);
+               chg_virtue(caster_ptr, V_ENCHANT, -2);
        }
-       calc_android_exp(p_ptr);
+       calc_android_exp(caster_ptr);
 }
index 02a9412..5b4d876 100644 (file)
@@ -25,4 +25,4 @@ extern bool pulish_shield(void);
 #define ENCH_FORCE      0x08 /*!< 装備強化処理: 無条件に成功させる / Force enchantment */
 extern bool enchant(object_type *o_ptr, int n, int eflag);
 extern bool enchant_spell(HIT_PROB num_hit, HIT_POINT num_dam, ARMOUR_CLASS num_ac);
-extern void brand_weapon(int brand_type);
+extern void brand_weapon(player_type *caster_ptr, int brand_type);