OSDN Git Service

[Refactor] #38997 discharge_minion() に player_type * 引数を追加. / Add player_type * argum...
authordeskull <deskull@users.sourceforge.jp>
Sun, 15 Dec 2019 16:15:36 +0000 (01:15 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Sun, 15 Dec 2019 16:15:36 +0000 (01:15 +0900)
src/realm-daemon.c
src/spells.h
src/spells2.c

index 9a30991..00675b7 100644 (file)
@@ -516,7 +516,7 @@ concptr do_daemon_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
                {
                        if (cast)
                        {
-                               discharge_minion();
+                               discharge_minion(caster_ptr);
                        }
                }
                break;
index 8906346..bf7cb84 100644 (file)
@@ -244,7 +244,7 @@ extern bool teleport_swap(DIRECTION dir);
 extern bool project_hook(player_type *caster_ptr, EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, BIT_FLAGS flg);
 extern bool project_all_los(EFFECT_ID typ, HIT_POINT dam);
 extern bool eat_magic(player_type *caster_ptr, int power);
-extern void discharge_minion(void);
+extern void discharge_minion(player_type *caster_ptr);
 extern bool kawarimi(bool success);
 extern bool rush_attack(player_type *attacker_ptr, bool *mdeath);
 extern void remove_all_mirrors(bool explode);
index f4fcecd..e2f94b7 100644 (file)
@@ -1366,26 +1366,26 @@ bool probing(void)
  * @brief ペット爆破処理 /
  * @return なし
  */
-void discharge_minion(void)
+void discharge_minion(player_type *caster_ptr)
 {
        MONSTER_IDX i;
        bool okay = TRUE;
 
-       for (i = 1; i < p_ptr->current_floor_ptr->m_max; i++)
+       for (i = 1; i < caster_ptr->current_floor_ptr->m_max; i++)
        {
-               monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[i];
+               monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[i];
                if (!m_ptr->r_idx || !is_pet(m_ptr)) continue;
                if (m_ptr->nickname) okay = FALSE;
        }
-       if (!okay || p_ptr->riding)
+       if (!okay || caster_ptr->riding)
        {
                if (!get_check(_("本当に全ペットを爆破しますか?", "You will blast all pets. Are you sure? ")))
                        return;
        }
-       for (i = 1; i < p_ptr->current_floor_ptr->m_max; i++)
+       for (i = 1; i < caster_ptr->current_floor_ptr->m_max; i++)
        {
                HIT_POINT dam;
-               monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[i];
+               monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[i];
                monster_race *r_ptr;
 
                if (!m_ptr->r_idx || !is_pet(m_ptr)) continue;
@@ -1404,7 +1404,7 @@ void discharge_minion(void)
                if (dam > 100) dam = (dam - 100) / 2 + 100;
                if (dam > 400) dam = (dam - 400) / 2 + 400;
                if (dam > 800) dam = 800;
-               project(p_ptr, i, 2 + (r_ptr->level / 20), m_ptr->fy, m_ptr->fx, dam, GF_PLASMA, 
+               project(caster_ptr, i, 2 + (r_ptr->level / 20), m_ptr->fy, m_ptr->fx, dam, GF_PLASMA, 
                        PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL, -1);
 
                if (record_named_pet && m_ptr->nickname)
@@ -1412,7 +1412,7 @@ void discharge_minion(void)
                        GAME_TEXT m_name[MAX_NLEN];
 
                        monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
-                       exe_write_diary(p_ptr, NIKKI_NAMED_PET, RECORD_NAMED_PET_BLAST, m_name);
+                       exe_write_diary(caster_ptr, NIKKI_NAMED_PET, RECORD_NAMED_PET_BLAST, m_name);
                }
 
                delete_monster_idx(i);