OSDN Git Service

[Refactor] #38997 ident_spell() に player_type * 引数を追加. / Add player_type * argument...
authordeskull <deskull@users.sourceforge.jp>
Sat, 14 Dec 2019 06:24:16 +0000 (15:24 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sat, 14 Dec 2019 06:24:16 +0000 (15:24 +0900)
16 files changed:
src/bldg.c
src/cmd/cmd-activate.c
src/cmd/cmd-read.c
src/cmd/cmd-usestaff.c
src/cmd/cmd-zaprod.c
src/mind.c
src/racial.c
src/realm-arcane.c
src/realm-death.c
src/realm-hissatsu.c
src/realm-life.c
src/realm-sorcery.c
src/spells-object.c
src/spells.h
src/spells3.c
src/wizard2.c

index f27acdd..7ae447c 100644 (file)
@@ -3962,7 +3962,7 @@ static void bldg_process_command(building_type *bldg, int i)
                paid = TRUE;
                break;
        case BACT_IDENT_ONE: /* needs work */
-               paid = ident_spell(FALSE);
+               paid = ident_spell(p_ptr, FALSE);
                break;
        case BACT_LEARN:
                do_cmd_study(p_ptr);
index 3d1eec0..15c6667 100644 (file)
@@ -1472,7 +1472,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
 
        case ACT_ID_PLAIN:
        {
-               if (!ident_spell(FALSE)) return FALSE;
+               if (!ident_spell(user_ptr, FALSE)) return FALSE;
                break;
        }
 
index 4965859..a62609c 100644 (file)
@@ -195,7 +195,7 @@ void exe_read(player_type *creature_ptr, INVENTORY_IDX item, bool known)
 
                case SV_SCROLL_IDENTIFY:
                {
-                       if (!ident_spell(FALSE)) used_up = FALSE;
+                       if (!ident_spell(creature_ptr, FALSE)) used_up = FALSE;
                        ident = TRUE;
                        break;
                }
index b764b9e..ffc080f 100644 (file)
@@ -86,7 +86,7 @@ int staff_effect(player_type *creature_ptr, OBJECT_SUBTYPE_VALUE sval, bool *use
                                if (!identify_fully(FALSE)) *use_charge = FALSE;
                        }
                        else {
-                               if (!ident_spell(FALSE)) *use_charge = FALSE;
+                               if (!ident_spell(creature_ptr, FALSE)) *use_charge = FALSE;
                        }
                        ident = TRUE;
                        break;
index c22c5ee..936a964 100644 (file)
@@ -57,7 +57,7 @@ int rod_effect(player_type *creature_ptr, OBJECT_SUBTYPE_VALUE sval, DIRECTION d
                        if (!identify_fully(FALSE)) *use_charge = FALSE;
                }
                else {
-                       if (!ident_spell(FALSE)) *use_charge = FALSE;
+                       if (!ident_spell(creature_ptr, FALSE)) *use_charge = FALSE;
                }
                ident = TRUE;
                break;
index f772097..b7b5329 100644 (file)
@@ -1115,7 +1115,7 @@ static bool cast_mindcrafter_spell(player_type *caster_ptr, int spell)
                if (plev < 25)
                        return psychometry();
                else
-                       return ident_spell(FALSE);
+                       return ident_spell(caster_ptr, FALSE);
        case 8:
                /* Mindwave */
                msg_print(_("精神を捻じ曲げる波動を発生させた!", "Mind-warping forces emanate from your brain!"));
@@ -1596,7 +1596,7 @@ static bool cast_ninja_spell(player_type *caster_ptr, int spell)
                break;
        }
        case 7:
-               return ident_spell(FALSE);
+               return ident_spell(caster_ptr, FALSE);
        case 8:
                set_tim_levitation(caster_ptr, randint1(20) + 20, FALSE);
                break;
index 25cf247..3838752 100644 (file)
@@ -605,7 +605,7 @@ static bool exe_racial_power(player_type *creature_ptr, s32b command)
                        }
                        else
                        {
-                               if (!ident_spell(TRUE)) return FALSE;
+                               if (!ident_spell(creature_ptr, TRUE)) return FALSE;
                        }
                        break;
                }
index eeded9d..0284c2e 100644 (file)
@@ -351,7 +351,7 @@ concptr do_arcane_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
                {
                        if (cast)
                        {
-                               if (!ident_spell(FALSE)) return NULL;
+                               if (!ident_spell(caster_ptr, FALSE)) return NULL;
                        }
                }
                break;
index a61e3d1..21cf8a6 100644 (file)
@@ -540,7 +540,7 @@ concptr do_death_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
                        {
                                if (randint1(50) > plev)
                                {
-                                       if (!ident_spell(FALSE)) return NULL;
+                                       if (!ident_spell(caster_ptr, FALSE)) return NULL;
                                }
                                else
                                {
index 83eabfc..f52c777 100644 (file)
@@ -350,7 +350,7 @@ concptr do_hissatsu_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mo
                        }
                        else
                        {
-                               if (!ident_spell(TRUE)) return NULL;
+                               if (!ident_spell(caster_ptr, TRUE)) return NULL;
                        }
                }
                break;
index 84a12ba..4970fe2 100644 (file)
@@ -259,7 +259,7 @@ concptr do_life_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
                {
                        if (cast)
                        {
-                               if (!ident_spell(FALSE)) return NULL;
+                               if (!ident_spell(caster_ptr, FALSE)) return NULL;
                        }
                }
                break;
index 5ebe5d3..2c79de6 100644 (file)
@@ -188,7 +188,7 @@ concptr do_sorcery_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mod
                {
                        if (cast)
                        {
-                               if (!ident_spell(FALSE)) return NULL;
+                               if (!ident_spell(caster_ptr, FALSE)) return NULL;
                        }
                }
                break;
index 1e941e3..95286e9 100644 (file)
@@ -824,7 +824,7 @@ bool brand_bolts(void)
 
 bool perilous_secrets(player_type *user_ptr)
 {
-       if (!ident_spell(FALSE)) return FALSE;
+       if (!ident_spell(user_ptr, FALSE)) return FALSE;
 
        if (mp_ptr->spell_book)
        {
index f0e03ae..442de3b 100644 (file)
@@ -305,7 +305,7 @@ extern int remove_all_curse(player_type *caster_ptr);
 extern bool alchemy(void);
 
 extern bool artifact_scroll(void);
-extern bool ident_spell(bool only_equip);
+extern bool ident_spell(player_type *caster_ptr, bool only_equip);
 extern bool mundane_spell(bool only_equip);
 extern bool identify_item(object_type *o_ptr);
 extern bool identify_fully(bool only_equip);
index 37fdf92..7b0bad6 100644 (file)
@@ -1733,12 +1733,12 @@ bool identify_item(object_type *o_ptr)
  * This routine does *not* automatically combine objects.
  * Returns TRUE if something was identified, else FALSE.
  */
-bool ident_spell(bool only_equip)
+bool ident_spell(player_type *caster_ptr, bool only_equip)
 {
        OBJECT_IDX item;
        object_type *o_ptr;
        GAME_TEXT o_name[MAX_NLEN];
-       concptr            q, s;
+       concptr q, s;
        bool old_known;
 
        if (only_equip)
@@ -1762,7 +1762,7 @@ bool ident_spell(bool only_equip)
 
        s = _("鑑定するべきアイテムがない。", "You have nothing to identify.");
 
-       o_ptr = choose_object(p_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
+       o_ptr = choose_object(caster_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
        if (!o_ptr) return (FALSE);
 
        old_known = identify_item(o_ptr);
index b7b0c04..bc0481b 100644 (file)
@@ -1863,7 +1863,7 @@ void do_cmd_debug(player_type *creature_ptr)
 
        /* Identify */
        case 'i':
-               (void)ident_spell(FALSE);
+               (void)ident_spell(creature_ptr, FALSE);
                break;
 
        /* Go up or down in the dungeon */