OSDN Git Service

[Refactor] #38997 alchemy() に player_type * 引数を追加. / Add player_type * argument to...
authordeskull <deskull@users.sourceforge.jp>
Sun, 15 Dec 2019 04:01:00 +0000 (13:01 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sun, 15 Dec 2019 04:01:00 +0000 (13:01 +0900)
src/cmd/cmd-activate.c
src/mutation.c
src/realm-sorcery.c
src/spells.h
src/spells3.c

index 53d88a2..9791ce8 100644 (file)
@@ -1520,7 +1520,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        case ACT_ALCHEMY:
        {
                msg_print(_("明るい黄色に輝いている...", "It glows bright yellow..."));
-               (void)alchemy();
+               (void)alchemy(user_ptr);
                break;
        }
 
index bd04f4c..02b65e6 100644 (file)
@@ -2204,7 +2204,7 @@ bool exe_mutation_power(player_type *creature_ptr, int power)
                        break;
 
                case MUT1_MIDAS_TCH:
-                       if (!alchemy()) return FALSE;
+                       if (!alchemy(creature_ptr)) return FALSE;
                        break;
 
                /* Summon pet molds around the player */
index 2c79de6..b37d99a 100644 (file)
@@ -516,7 +516,7 @@ concptr do_sorcery_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mod
                {
                        if (cast)
                        {
-                               if (!alchemy()) return NULL;
+                               if (!alchemy(caster_ptr)) return NULL;
                        }
                }
                break;
index 60f088f..7f75388 100644 (file)
@@ -302,7 +302,7 @@ extern void reserve_alter_reality(player_type *caster_ptr);
 extern void identify_pack(void);
 extern int remove_curse(player_type *caster_ptr);
 extern int remove_all_curse(player_type *caster_ptr);
-extern bool alchemy(void);
+extern bool alchemy(player_type *caster_ptr);
 
 extern bool artifact_scroll(void);
 extern bool ident_spell(player_type *caster_ptr, bool only_equip);
index 560ed91..41b7cc7 100644 (file)
@@ -1478,7 +1478,7 @@ int remove_all_curse(player_type *caster_ptr)
  * Turns an object into gold, gain some of its value in a shop
  * @return 処理が実際に行われたらTRUEを返す
  */
-bool alchemy(void)
+bool alchemy(player_type *caster_ptr)
 {
        OBJECT_IDX item;
        int amt = 1;
@@ -1497,7 +1497,7 @@ bool alchemy(void)
        q = _("どのアイテムを金に変えますか?", "Turn which item to gold? ");
        s = _("金に変えられる物がありません。", "You have nothing to current_world_ptr->game_turn to gold.");
 
-       o_ptr = choose_object(p_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
+       o_ptr = choose_object(caster_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
        if (!o_ptr) return (FALSE);
 
        /* See how many items */
@@ -1548,9 +1548,9 @@ bool alchemy(void)
                if (price > 30000) price = 30000;
                msg_format(_("%sを$%d の金に変えた。", "You current_world_ptr->game_turn %s to %ld coins worth of gold."), o_name, price);
 
-               p_ptr->au += price;
-               p_ptr->redraw |= (PR_GOLD);
-               p_ptr->window |= (PW_PLAYER);
+               caster_ptr->au += price;
+               caster_ptr->redraw |= (PR_GOLD);
+               caster_ptr->window |= (PW_PLAYER);
        }
 
        /* Eliminate the item (from the pack) */