OSDN Git Service

[Refactor] #38997 remove_curse(), remove_all_curse(), remove_curse_aux() に player_typ...
authordeskull <deskull@users.sourceforge.jp>
Sat, 2 Nov 2019 23:56:06 +0000 (08:56 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sat, 2 Nov 2019 23:56:06 +0000 (08:56 +0900)
src/cmd/cmd-activate.c
src/cmd/cmd-read.c
src/cmd/cmd-usestaff.c
src/realm-craft.c
src/realm-crusade.c
src/realm-life.c
src/spells.h
src/spells3.c

index fb36cf8..4a029b4 100644 (file)
@@ -1626,7 +1626,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        case ACT_DISP_CURSE_XTRA:
        {
                msg_format(_("%sが真実を照らし出す...", "The %s exhibits the truth..."), name);
-               (void)remove_all_curse();
+               (void)remove_all_curse(user_ptr);
                (void)probing();
                break;
        }
index c677fc0..ef8cf1b 100644 (file)
@@ -209,7 +209,7 @@ void exe_read(player_type *creature_ptr, INVENTORY_IDX item, bool known)
 
                case SV_SCROLL_REMOVE_CURSE:
                {
-                       if (remove_curse())
+                       if (remove_curse(creature_ptr))
                        {
                                ident = TRUE;
                        }
@@ -218,7 +218,7 @@ void exe_read(player_type *creature_ptr, INVENTORY_IDX item, bool known)
 
                case SV_SCROLL_STAR_REMOVE_CURSE:
                {
-                       if (remove_all_curse())
+                       if (remove_all_curse(creature_ptr))
                        {
                                ident = TRUE;
                        }
index 9088a55..00846a9 100644 (file)
@@ -94,7 +94,7 @@ int staff_effect(player_type *creature_ptr, OBJECT_SUBTYPE_VALUE sval, bool *use
 
                case SV_STAFF_REMOVE_CURSE:
                {
-                       bool result = powerful ? remove_all_curse() : remove_curse();
+                       bool result = powerful ? remove_all_curse(creature_ptr) : remove_curse(creature_ptr);
                        if (result)
                        {
                                ident = TRUE;
index fb51096..c02c5d9 100644 (file)
@@ -179,7 +179,7 @@ concptr do_craft_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
                if (desc) return _("アイテムにかかった弱い呪いを解除する。", "Removes normal curses from equipped items.");
 
                {
-                       if (cast) (void)remove_curse();
+                       if (cast) (void)remove_curse(caster_ptr);
                }
                break;
 
@@ -428,7 +428,7 @@ concptr do_craft_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
                if (desc) return _("アイテムにかかった強力な呪いを解除する。", "Removes normal and heavy curse from equipped items.");
 
                {
-                       if (cast) (void)remove_all_curse();
+                       if (cast) (void)remove_all_curse(caster_ptr);
                }
                break;
 
index f1ad778..1389520 100644 (file)
@@ -199,7 +199,7 @@ concptr do_crusade_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mod
                if (name) return _("解呪", "Remove Curse");
                if (desc) return _("アイテムにかかった弱い呪いを解除する。", "Removes normal curses from equipped items.");
                {
-                       if (cast) (void)remove_curse();
+                       if (cast) (void)remove_curse(caster_ptr);
                }
                break;
 
@@ -437,7 +437,7 @@ concptr do_crusade_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mod
                if (desc) return _("アイテムにかかった強力な呪いを解除する。", "Removes normal and heavy curse from equipped items.");
 
                {
-                       if (cast) (void)remove_all_curse();
+                       if (cast) (void)remove_all_curse(caster_ptr);
                }
                break;
 
index b62227c..8af9d9f 100644 (file)
@@ -141,7 +141,7 @@ concptr do_life_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
                if (name) return _("解呪", "Remove Curse");
                if (desc) return _("アイテムにかかった弱い呪いを解除する。", "Removes normal curses from equipped items.");
                {
-                       if (cast) (void)remove_curse();
+                       if (cast) (void)remove_curse(caster_ptr);
                }
                break;
 
@@ -248,7 +248,7 @@ concptr do_life_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
                if (name) return _("*解呪*", "Dispel Curse");
                if (desc) return _("アイテムにかかった強力な呪いを解除する。", "Removes normal and heavy curse from equipped items.");
                {
-                       if (cast) (void)remove_all_curse();
+                       if (cast) (void)remove_all_curse(caster_ptr);
                }
                break;
 
index b35e618..d16f2ec 100644 (file)
@@ -299,8 +299,8 @@ extern void call_the_(void);
 extern void fetch(player_type *caster_ptr, DIRECTION dir, WEIGHT wgt, bool require_los);
 extern void alter_reality(void);
 extern void identify_pack(void);
-extern int remove_curse(void);
-extern int remove_all_curse(void);
+extern int remove_curse(player_type *caster_ptr);
+extern int remove_all_curse(player_type *caster_ptr);
 extern bool alchemy(void);
 
 extern bool artifact_scroll(void);
index 803151b..1a885f8 100644 (file)
@@ -1406,14 +1406,14 @@ void identify_pack(void)
  * will not be uncursed.
  * </pre>
  */
-static int remove_curse_aux(int all)
+static int remove_curse_aux(player_type *creature_ptr, int all)
 {
        int i, cnt = 0;
 
        /* Attempt to uncurse items being worn */
        for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
        {
-               object_type *o_ptr = &p_ptr->inventory_list[i];
+               object_type *o_ptr = &creature_ptr->inventory_list[i];
                if (!o_ptr->k_idx) continue;
 
                /* Uncursed already */
@@ -1433,8 +1433,8 @@ static int remove_curse_aux(int all)
                o_ptr->ident |= (IDENT_SENSE);
                o_ptr->feeling = FEEL_NONE;
 
-               p_ptr->update |= (PU_BONUS);
-               p_ptr->window |= (PW_EQUIP);
+               creature_ptr->update |= (PU_BONUS);
+               creature_ptr->window |= (PW_EQUIP);
 
                /* Count the uncursings */
                cnt++;
@@ -1454,9 +1454,9 @@ static int remove_curse_aux(int all)
  * Remove most curses
  * @return 解呪に成功した装備数
  */
-int remove_curse(void)
+int remove_curse(player_type *caster_ptr)
 {
-       return (remove_curse_aux(FALSE));
+       return (remove_curse_aux(caster_ptr, FALSE));
 }
 
 /*!
@@ -1464,9 +1464,9 @@ int remove_curse(void)
  * Remove all curses
  * @return 解呪に成功した装備数
  */
-int remove_all_curse(void)
+int remove_all_curse(player_type *caster_ptr)
 {
-       return (remove_curse_aux(TRUE));
+       return (remove_curse_aux(caster_ptr, TRUE));
 }