OSDN Git Service

[Refactor] #38997 place_monster*()、alloc_*()、set_pet()、multiply_monster()、summon_...
authorHourier <hourier@users.sourceforge.jp>
Fri, 17 Jan 2020 15:37:20 +0000 (00:37 +0900)
committerHourier <hourier@users.sourceforge.jp>
Fri, 17 Jan 2020 15:37:40 +0000 (00:37 +0900)
39 files changed:
src/chest.c
src/cmd/cmd-activate.c
src/cmd/cmd-basic.c
src/cmd/cmd-mane.c
src/cmd/cmd-read.c
src/cmd/cmd-usestaff.c
src/core.c
src/dungeon-file.c
src/floor-generate.c
src/floor-save.c
src/floor.c
src/mind.c
src/monster-process.c
src/monster-status.c
src/monster.h
src/monster1.c
src/monster2.c
src/mspells3.c
src/mspells4.c
src/mutation.c
src/patron.c
src/realm-arcane.c
src/realm-craft.c
src/realm-crusade.c
src/realm-daemon.c
src/realm-nature.c
src/rooms-pitnest.c
src/rooms-pitnest.h
src/rooms-special.c
src/rooms-vault.c
src/rooms.c
src/spells-summon.c
src/spells-summon.h
src/spells1.c
src/spells2.c
src/spells3.c
src/trap.c
src/wild.c
src/wizard2.c

index 36f41c9..2351612 100644 (file)
@@ -196,7 +196,7 @@ void chest_trap(player_type *target_ptr, POSITION y, POSITION x, OBJECT_IDX o_id
                        if (randint1(100)<target_ptr->current_floor_ptr->dun_level)
                                activate_hi_summon(target_ptr, target_ptr->y, target_ptr->x, FALSE);
                        else
-                               (void)summon_specific(0, y, x, mon_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
+                               (void)summon_specific(target_ptr, 0, y, x, mon_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
                }
        }
 
@@ -206,7 +206,7 @@ void chest_trap(player_type *target_ptr, POSITION y, POSITION x, OBJECT_IDX o_id
                msg_print(_("宝を守るためにエレメンタルが現れた!", "Elemental beings appear to protect their treasures!"));
                for (i = 0; i < randint1(3) + 5; i++)
                {
-                       (void)summon_specific(0, y, x, mon_level, SUMMON_ELEMENTAL, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
+                       (void)summon_specific(target_ptr, 0, y, x, mon_level, SUMMON_ELEMENTAL, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
                }
        }
 
@@ -220,7 +220,7 @@ void chest_trap(player_type *target_ptr, POSITION y, POSITION x, OBJECT_IDX o_id
 
                for (i = 0; i < randint1(5) + o_ptr->pval / 5; i++)
                {
-                       (void)summon_specific(0, y, x, mon_level, SUMMON_BIRD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
+                       (void)summon_specific(target_ptr, 0, y, x, mon_level, SUMMON_BIRD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
                }
        }
 
@@ -234,7 +234,7 @@ void chest_trap(player_type *target_ptr, POSITION y, POSITION x, OBJECT_IDX o_id
                        for (i = 0; i < randint1(3) + 2; i++)
                        {
                                (void)fire_meteor(target_ptr, -1, GF_FIRE, y, x, 10, 5);
-                               (void)summon_specific(0, y, x, mon_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
+                               (void)summon_specific(target_ptr, 0, y, x, mon_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
                        }
                }
 
@@ -244,7 +244,7 @@ void chest_trap(player_type *target_ptr, POSITION y, POSITION x, OBJECT_IDX o_id
                        msg_print(_("暗闇にドラゴンの影がぼんやりと現れた!", "Draconic forms loom out of the darkness!"));
                        for (i = 0; i < randint1(3) + 2; i++)
                        {
-                               (void)summon_specific(0, y, x, mon_level, SUMMON_DRAGON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
+                               (void)summon_specific(target_ptr, 0, y, x, mon_level, SUMMON_DRAGON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
                        }
                }
 
@@ -254,7 +254,7 @@ void chest_trap(player_type *target_ptr, POSITION y, POSITION x, OBJECT_IDX o_id
                        msg_print(_("奇妙な姿の怪物が襲って来た!", "Creatures strange and twisted assault you!"));
                        for (i = 0; i < randint1(5) + 3; i++)
                        {
-                               (void)summon_specific(0, y, x, mon_level, SUMMON_HYBRID, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
+                               (void)summon_specific(target_ptr, 0, y, x, mon_level, SUMMON_HYBRID, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
                        }
                }
 
@@ -264,7 +264,7 @@ void chest_trap(player_type *target_ptr, POSITION y, POSITION x, OBJECT_IDX o_id
                        msg_print(_("渦巻が合体し、破裂した!", "Vortices coalesce and wreak destruction!"));
                        for (i = 0; i < randint1(3) + 2; i++)
                        {
-                               (void)summon_specific(0, y, x, mon_level, SUMMON_VORTEX, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
+                               (void)summon_specific(target_ptr, 0, y, x, mon_level, SUMMON_VORTEX, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
                        }
                }
        }
index 75f6948..5fa6f94 100644 (file)
@@ -539,7 +539,7 @@ void exe_activate(player_type *user_ptr, INVENTORY_IDX item)
                        if (!get_direction(user_ptr, &dir, FALSE, FALSE)) return;
                        if (monster_can_enter(user_ptr->y + ddy[dir], user_ptr->x + ddx[dir], &r_info[o_ptr->pval], 0))
                        {
-                               if (place_monster_aux(0, user_ptr->y + ddy[dir], user_ptr->x + ddx[dir], o_ptr->pval, (PM_FORCE_PET | PM_NO_KAGE)))
+                               if (place_monster_aux(user_ptr, 0, user_ptr->y + ddy[dir], user_ptr->x + ddx[dir], o_ptr->pval, (PM_FORCE_PET | PM_NO_KAGE)))
                                {
                                        if (o_ptr->xtra3) user_ptr->current_floor_ptr->m_list[hack_m_idx_ii].mspeed = o_ptr->xtra3;
                                        if (o_ptr->xtra5) user_ptr->current_floor_ptr->m_list[hack_m_idx_ii].max_maxhp = o_ptr->xtra5;
@@ -1189,14 +1189,14 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
 
        case ACT_SUMMON_ANIMAL:
        {
-               (void)summon_specific(-1, user_ptr->y, user_ptr->x, plev, SUMMON_ANIMAL_RANGER, (PM_ALLOW_GROUP | PM_FORCE_PET));
+               (void)summon_specific(user_ptr, -1, user_ptr->y, user_ptr->x, plev, SUMMON_ANIMAL_RANGER, (PM_ALLOW_GROUP | PM_FORCE_PET));
                break;
        }
 
        case ACT_SUMMON_PHANTOM:
        {
                msg_print(_("幻霊を召喚した。", "You summon a phantasmal servant."));
-               (void)summon_specific(-1, user_ptr->y, user_ptr->x, user_ptr->current_floor_ptr->dun_level, SUMMON_PHANTOM, (PM_ALLOW_GROUP | PM_FORCE_PET));
+               (void)summon_specific(user_ptr, -1, user_ptr->y, user_ptr->x, user_ptr->current_floor_ptr->dun_level, SUMMON_PHANTOM, (PM_ALLOW_GROUP | PM_FORCE_PET));
                break;
        }
 
@@ -1221,7 +1221,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
        case ACT_SUMMON_DAWN:
        {
                msg_print(_("暁の師団を召喚した。", "You summon the Legion of the Dawn."));
-               (void)summon_specific(-1, user_ptr->y, user_ptr->x, user_ptr->current_floor_ptr->dun_level, SUMMON_DAWN, (PM_ALLOW_GROUP | PM_FORCE_PET));
+               (void)summon_specific(user_ptr, -1, user_ptr->y, user_ptr->x, user_ptr->current_floor_ptr->dun_level, SUMMON_DAWN, (PM_ALLOW_GROUP | PM_FORCE_PET));
                break;
        }
 
index eb117f8..5ba7bd7 100644 (file)
@@ -2673,7 +2673,7 @@ bool do_cmd_throw(player_type *creature_ptr, int mult, bool boomerang, OBJECT_ID
        {
                j = 100;
 
-               if (!(summon_named_creature(0, y, x, q_ptr->pval, !(object_is_cursed(q_ptr)) ? PM_FORCE_PET : 0L)))
+               if (!(summon_named_creature(creature_ptr, 0, y, x, q_ptr->pval, !(object_is_cursed(q_ptr)) ? PM_FORCE_PET : 0L)))
                        msg_print(_("人形は捻じ曲がり砕け散ってしまった!", "The Figurine writhes and then shatters."));
                else if (object_is_cursed(q_ptr))
                        msg_print(_("これはあまり良くない気がする。", "You have a bad feeling about this."));
index e68509c..0664bb1 100644 (file)
@@ -750,7 +750,7 @@ static bool use_mane(player_type *caster_ptr, int spell)
                msg_print(_("援軍を召喚した。", "You summon minions."));
                for (k = 0;k < 4; k++)
                {
-                       (void)summon_kin_player(plev, target_row, target_col, (PM_FORCE_PET | PM_ALLOW_GROUP));
+                       (void)summon_kin_player(caster_ptr, plev, target_row, target_col, (PM_FORCE_PET | PM_ALLOW_GROUP));
                }
                break;
        }
@@ -762,7 +762,7 @@ static bool use_mane(player_type *caster_ptr, int spell)
                msg_print(_("サイバーデーモンを召喚した!", "You summon Cyberdemons!"));
                if (max_cyber > 4) max_cyber = 4;
                for (k = 0;k < max_cyber; k++)
-                       summon_specific(-1, target_row, target_col, plev, SUMMON_CYBER, mode);
+                       summon_specific(caster_ptr, -1, target_row, target_col, plev, SUMMON_CYBER, mode);
                break;
        }
        case MS_S_MONSTER:
@@ -771,7 +771,7 @@ static bool use_mane(player_type *caster_ptr, int spell)
                if (!target_set(caster_ptr, TARGET_KILL)) return FALSE;
                msg_print(_("仲間を召喚した。", "You summon help."));
                for (k = 0;k < 1; k++)
-                       summon_specific(-1, target_row, target_col, plev, 0, (mode | u_mode));
+                       summon_specific(caster_ptr, -1, target_row, target_col, plev, 0, (mode | u_mode));
                break;
        }
        case MS_S_MONSTERS:
@@ -780,7 +780,7 @@ static bool use_mane(player_type *caster_ptr, int spell)
                if (!target_set(caster_ptr, TARGET_KILL)) return FALSE;
                msg_print(_("モンスターを召喚した!", "You summon monsters!"));
                for (k = 0; k < 6; k++)
-                       summon_specific(-1, target_row, target_col, plev, 0, (mode | u_mode));
+                       summon_specific(caster_ptr, -1, target_row, target_col, plev, 0, (mode | u_mode));
                break;
        }
        case MS_S_ANT:
@@ -789,7 +789,7 @@ static bool use_mane(player_type *caster_ptr, int spell)
                if (!target_set(caster_ptr, TARGET_KILL)) return FALSE;
                msg_print(_("アリを召喚した。", "You summon ants."));
                for (k = 0; k < 6; k++)
-                       summon_specific(-1, target_row, target_col, plev, SUMMON_ANT, mode);
+                       summon_specific(caster_ptr, -1, target_row, target_col, plev, SUMMON_ANT, mode);
                break;
        }
        case MS_S_SPIDER:
@@ -798,7 +798,7 @@ static bool use_mane(player_type *caster_ptr, int spell)
                if (!target_set(caster_ptr, TARGET_KILL)) return FALSE;
                msg_print(_("蜘蛛を召喚した。", "You summon spiders."));
                for (k = 0; k < 6; k++)
-                       summon_specific(-1, target_row, target_col, plev, SUMMON_SPIDER, mode);
+                       summon_specific(caster_ptr, -1, target_row, target_col, plev, SUMMON_SPIDER, mode);
                break;
        }
        case MS_S_HOUND:
@@ -807,7 +807,7 @@ static bool use_mane(player_type *caster_ptr, int spell)
                if (!target_set(caster_ptr, TARGET_KILL)) return FALSE;
                msg_print(_("ハウンドを召喚した。", "You summon hounds."));
                for (k = 0; k < 4; k++)
-                       summon_specific(-1, target_row, target_col, plev, SUMMON_HOUND, mode);
+                       summon_specific(caster_ptr, -1, target_row, target_col, plev, SUMMON_HOUND, mode);
                break;
        }
        case MS_S_HYDRA:
@@ -816,7 +816,7 @@ static bool use_mane(player_type *caster_ptr, int spell)
                if (!target_set(caster_ptr, TARGET_KILL)) return FALSE;
                msg_print(_("ヒドラを召喚した。", "You summon hydras."));
                for (k = 0; k < 4; k++)
-                       summon_specific(-1, target_row, target_col, plev, SUMMON_HYDRA, mode);
+                       summon_specific(caster_ptr, -1, target_row, target_col, plev, SUMMON_HYDRA, mode);
                break;
        }
        case MS_S_ANGEL:
@@ -825,7 +825,7 @@ static bool use_mane(player_type *caster_ptr, int spell)
                if (!target_set(caster_ptr, TARGET_KILL)) return FALSE;
                msg_print(_("天使を召喚した!", "You summon angel!"));
                for (k = 0; k < 1; k++)
-                       summon_specific(-1, target_row, target_col, plev, SUMMON_ANGEL, mode);
+                       summon_specific(caster_ptr, -1, target_row, target_col, plev, SUMMON_ANGEL, mode);
                break;
        }
        case MS_S_DEMON:
@@ -834,7 +834,7 @@ static bool use_mane(player_type *caster_ptr, int spell)
                if (!target_set(caster_ptr, TARGET_KILL)) return FALSE;
                msg_print(_("混沌の宮廷から悪魔を召喚した!", "You summon a demon from the Courts of Chaos!"));
                for (k = 0; k < 1; k++)
-                       summon_specific(-1, target_row, target_col, plev, SUMMON_DEMON, (mode | u_mode));
+                       summon_specific(caster_ptr, -1, target_row, target_col, plev, SUMMON_DEMON, (mode | u_mode));
                break;
        }
        case MS_S_UNDEAD:
@@ -843,7 +843,7 @@ static bool use_mane(player_type *caster_ptr, int spell)
                if (!target_set(caster_ptr, TARGET_KILL)) return FALSE;
                msg_print(_("アンデッドの強敵を召喚した!", "You summon an undead adversary!"));
                for (k = 0; k < 1; k++)
-                       summon_specific(-1, target_row, target_col, plev, SUMMON_UNDEAD, (mode | u_mode));
+                       summon_specific(caster_ptr, -1, target_row, target_col, plev, SUMMON_UNDEAD, (mode | u_mode));
                break;
        }
        case MS_S_DRAGON:
@@ -852,7 +852,7 @@ static bool use_mane(player_type *caster_ptr, int spell)
                if (!target_set(caster_ptr, TARGET_KILL)) return FALSE;
                msg_print(_("ドラゴンを召喚した!", "You summon dragon!"));
                for (k = 0; k < 1; k++)
-                       summon_specific(-1, target_row, target_col, plev, SUMMON_DRAGON, (mode | u_mode));
+                       summon_specific(caster_ptr, -1, target_row, target_col, plev, SUMMON_DRAGON, (mode | u_mode));
                break;
        }
        case MS_S_HI_UNDEAD:
@@ -861,7 +861,7 @@ static bool use_mane(player_type *caster_ptr, int spell)
                if (!target_set(caster_ptr, TARGET_KILL)) return FALSE;
                msg_print(_("強力なアンデッドを召喚した!", "You summon greater undead!"));
                for (k = 0; k < 6; k++)
-                       summon_specific(-1, target_row, target_col, plev, SUMMON_HI_UNDEAD, (mode | u_mode));
+                       summon_specific(caster_ptr, -1, target_row, target_col, plev, SUMMON_HI_UNDEAD, (mode | u_mode));
                break;
        }
        case MS_S_HI_DRAGON:
@@ -870,7 +870,7 @@ static bool use_mane(player_type *caster_ptr, int spell)
                if (!target_set(caster_ptr, TARGET_KILL)) return FALSE;
                msg_print(_("古代ドラゴンを召喚した!", "You summon ancient dragons!"));
                for (k = 0; k < 4; k++)
-                       summon_specific(-1, target_row, target_col, plev, SUMMON_HI_DRAGON, (mode | u_mode));
+                       summon_specific(caster_ptr, -1, target_row, target_col, plev, SUMMON_HI_DRAGON, (mode | u_mode));
                break;
        }
        case MS_S_AMBERITE:
@@ -879,7 +879,7 @@ static bool use_mane(player_type *caster_ptr, int spell)
                if (!target_set(caster_ptr, TARGET_KILL)) return FALSE;
                msg_print(_("アンバーの王族を召喚した!", "You summon Lords of Amber!"));
                for (k = 0; k < 4; k++)
-                       summon_specific(-1, target_row, target_col, plev, SUMMON_AMBERITES, (mode | PM_ALLOW_UNIQUE));
+                       summon_specific(caster_ptr, -1, target_row, target_col, plev, SUMMON_AMBERITES, (mode | PM_ALLOW_UNIQUE));
                break;
        }
        case MS_S_UNIQUE:
@@ -888,9 +888,9 @@ static bool use_mane(player_type *caster_ptr, int spell)
                if (!target_set(caster_ptr, TARGET_KILL)) return FALSE;
                msg_print(_("特別な強敵を召喚した!", "You summon special opponents!"));
                for (k = 0;k < 4; k++)
-                       if (summon_specific(-1, target_row, target_col, plev, SUMMON_UNIQUE, (mode | PM_ALLOW_UNIQUE))) count++;
+                       if (summon_specific(caster_ptr, -1, target_row, target_col, plev, SUMMON_UNIQUE, (mode | PM_ALLOW_UNIQUE))) count++;
                for (k = count;k < 4; k++)
-                       summon_specific(-1, target_row, target_col, plev, SUMMON_HI_UNDEAD, (mode | u_mode));
+                       summon_specific(caster_ptr, -1, target_row, target_col, plev, SUMMON_HI_UNDEAD, (mode | u_mode));
                break;
        }
        default:
index da99fff..d7f474c 100644 (file)
@@ -122,7 +122,7 @@ void exe_read(player_type *creature_ptr, INVENTORY_IDX item, bool known)
                {
                        for (k = 0; k < randint1(3); k++)
                        {
-                               if (summon_specific(0, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
+                               if (summon_specific(creature_ptr, 0, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
                                {
                                        ident = TRUE;
                                }
@@ -134,7 +134,7 @@ void exe_read(player_type *creature_ptr, INVENTORY_IDX item, bool known)
                {
                        for (k = 0; k < randint1(3); k++)
                        {
-                               if (summon_specific(0, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
+                               if (summon_specific(creature_ptr, 0, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
                                {
                                        ident = TRUE;
                                }
@@ -144,7 +144,7 @@ void exe_read(player_type *creature_ptr, INVENTORY_IDX item, bool known)
 
                case SV_SCROLL_SUMMON_PET:
                {
-                       if (summon_specific(-1, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_FORCE_PET)))
+                       if (summon_specific(creature_ptr, -1, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_FORCE_PET)))
                        {
                                ident = TRUE;
                        }
@@ -153,7 +153,7 @@ void exe_read(player_type *creature_ptr, INVENTORY_IDX item, bool known)
 
                case SV_SCROLL_SUMMON_KIN:
                {
-                       if (summon_kin_player(creature_ptr->lev, creature_ptr->y, creature_ptr->x, (PM_FORCE_PET | PM_ALLOW_GROUP)))
+                       if (summon_kin_player(creature_ptr, creature_ptr->lev, creature_ptr->y, creature_ptr->x, (PM_FORCE_PET | PM_ALLOW_GROUP)))
                        {
                                ident = TRUE;
                        }
index 6dcb467..78ac618 100644 (file)
@@ -65,7 +65,7 @@ int staff_effect(player_type *creature_ptr, OBJECT_SUBTYPE_VALUE sval, bool *use
                        const int times = randint1(powerful ? 8 : 4);
                        for (k = 0; k < times; k++)
                        {
-                               if (summon_specific(0, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
+                               if (summon_specific(creature_ptr, 0, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
                                {
                                        ident = TRUE;
                                }
index 7fc52a1..c11df92 100644 (file)
@@ -2267,7 +2267,7 @@ static void process_world_aux_mutation(player_type *creature_ptr)
                if (pet) mode |= PM_FORCE_PET;
                else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
 
-               if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, SUMMON_DEMON, mode))
+               if (summon_specific(creature_ptr, (pet ? -1 : 0), creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, SUMMON_DEMON, mode))
                {
                        msg_print(_("あなたはデーモンを引き寄せた!", "You have attracted a demon!"));
                        disturb(creature_ptr, FALSE, TRUE);
@@ -2375,7 +2375,7 @@ static void process_world_aux_mutation(player_type *creature_ptr)
                if (pet) mode |= PM_FORCE_PET;
                else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
 
-               if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, SUMMON_ANIMAL, mode))
+               if (summon_specific(creature_ptr, (pet ? -1 : 0), creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, SUMMON_ANIMAL, mode))
                {
                        msg_print(_("動物を引き寄せた!", "You have attracted an animal!"));
                        disturb(creature_ptr, FALSE, TRUE);
@@ -2453,7 +2453,7 @@ static void process_world_aux_mutation(player_type *creature_ptr)
                if (pet) mode |= PM_FORCE_PET;
                else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
 
-               if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, SUMMON_DRAGON, mode))
+               if (summon_specific(creature_ptr, (pet ? -1 : 0), creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, SUMMON_DRAGON, mode))
                {
                        msg_print(_("ドラゴンを引き寄せた!", "You have attracted a dragon!"));
                        disturb(creature_ptr, FALSE, TRUE);
@@ -2716,7 +2716,7 @@ static void process_world_aux_curse(player_type *creature_ptr)
                /* Call animal */
                if ((creature_ptr->cursed & TRC_CALL_ANIMAL) && one_in_(2500))
                {
-                       if (summon_specific(0, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, SUMMON_ANIMAL, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
+                       if (summon_specific(creature_ptr, 0, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, SUMMON_ANIMAL, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
                        {
                                GAME_TEXT o_name[MAX_NLEN];
 
@@ -2728,7 +2728,7 @@ static void process_world_aux_curse(player_type *creature_ptr)
                /* Call demon */
                if ((creature_ptr->cursed & TRC_CALL_DEMON) && one_in_(1111))
                {
-                       if (summon_specific(0, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
+                       if (summon_specific(creature_ptr, 0, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
                        {
                                GAME_TEXT o_name[MAX_NLEN];
 
@@ -2740,7 +2740,7 @@ static void process_world_aux_curse(player_type *creature_ptr)
                /* Call dragon */
                if ((creature_ptr->cursed & TRC_CALL_DRAGON) && one_in_(800))
                {
-                       if (summon_specific(0, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, SUMMON_DRAGON,
+                       if (summon_specific(creature_ptr, 0, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, SUMMON_DRAGON,
                                (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
                        {
                                GAME_TEXT o_name[MAX_NLEN];
@@ -2753,7 +2753,7 @@ static void process_world_aux_curse(player_type *creature_ptr)
                /* Call undead */
                if ((creature_ptr->cursed & TRC_CALL_UNDEAD) && one_in_(1111))
                {
-                       if (summon_specific(0, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, SUMMON_UNDEAD,
+                       if (summon_specific(creature_ptr, 0, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, SUMMON_UNDEAD,
                                (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
                        {
                                GAME_TEXT o_name[MAX_NLEN];
@@ -3273,7 +3273,7 @@ static void process_world(player_type *player_ptr)
                !floor_ptr->inside_arena && !floor_ptr->inside_quest && !player_ptr->phase_out)
        {
                /* Make a new monster */
-               (void)alloc_monster(MAX_SIGHT + 5, 0);
+               (void)alloc_monster(player_ptr, MAX_SIGHT + 5, 0);
        }
 
        /* Hack -- Check for creature regeneration */
@@ -4382,7 +4382,7 @@ static void process_fishing(player_type *creature_ptr)
                        POSITION y, x;
                        y = creature_ptr->y + ddy[creature_ptr->fishing_dir];
                        x = creature_ptr->x + ddx[creature_ptr->fishing_dir];
-                       if (place_monster_aux(0, y, x, r_idx, PM_NO_KAGE))
+                       if (place_monster_aux(creature_ptr, 0, y, x, r_idx, PM_NO_KAGE))
                        {
                                GAME_TEXT m_name[MAX_NLEN];
                                monster_desc(m_name, &creature_ptr->current_floor_ptr->m_list[creature_ptr->current_floor_ptr->grid_array[y][x].m_idx], 0);
@@ -5581,7 +5581,7 @@ void play_game(player_type *player_ptr, bool new_game)
                monster_type *m_ptr;
                MONRACE_IDX pet_r_idx = ((player_ptr->pclass == CLASS_CAVALRY) ? MON_HORSE : MON_YASE_HORSE);
                monster_race *r_ptr = &r_info[pet_r_idx];
-               place_monster_aux(0, player_ptr->y, player_ptr->x - 1, pet_r_idx,
+               place_monster_aux(player_ptr, 0, player_ptr->y, player_ptr->x - 1, pet_r_idx,
                        (PM_FORCE_PET | PM_NO_KAGE));
                m_ptr = &floor_ptr->m_list[hack_m_idx_ii];
                m_ptr->mspeed = r_ptr->speed;
index 408d2a9..831a872 100644 (file)
@@ -3767,7 +3767,7 @@ static errr process_dungeon_file_aux(player_type *player_ptr, char *buf, int ymi
                        {
                                floor_ptr->monster_level = floor_ptr->base_level + monster_index;
 
-                               place_monster(*y, *x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
+                               place_monster(player_ptr, *y, *x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
 
                                floor_ptr->monster_level = floor_ptr->base_level;
                        }
@@ -3802,7 +3802,7 @@ static errr process_dungeon_file_aux(player_type *player_ptr, char *buf, int ymi
                                }
 
                                /* Place it */
-                               place_monster_aux(0, *y, *x, monster_index, (PM_ALLOW_SLEEP | PM_NO_KAGE));
+                               place_monster_aux(player_ptr, 0, *y, *x, monster_index, (PM_ALLOW_SLEEP | PM_NO_KAGE));
                                if (clone)
                                {
                                        /* clone */
index 14139f9..67eabef 100644 (file)
@@ -464,7 +464,7 @@ bool place_quest_monsters(player_type *creature_ptr)
                                if (!l) return FALSE;
 
                                /* Try to place the monster */
-                               if (place_monster_aux(0, y, x, quest[i].r_idx, mode))
+                               if (place_monster_aux(creature_ptr, 0, y, x, quest[i].r_idx, mode))
                                {
                                        /* Success */
                                        break;
@@ -953,7 +953,7 @@ static bool cave_gen(player_type *player_ptr)
        /* Put some monsters in the dungeon */
        for (i = i + k; i > 0; i--)
        {
-               (void)alloc_monster(0, PM_ALLOW_SLEEP);
+               (void)alloc_monster(player_ptr, 0, PM_ALLOW_SLEEP);
        }
 
        /* Place some traps in the dungeon */
@@ -980,7 +980,7 @@ static bool cave_gen(player_type *player_ptr)
        floor_ptr->object_level = floor_ptr->base_level;
 
        /* Put the Guardian */
-       if (!alloc_guardian(TRUE)) return FALSE;
+       if (!alloc_guardian(player_ptr, TRUE)) return FALSE;
 
        bool is_empty_or_dark = dun->empty_level;
        is_empty_or_dark &= !one_in_(DARK_EMPTY) || (randint1(100) > floor_ptr->dun_level);
@@ -1095,15 +1095,15 @@ static void generate_challenge_arena(floor_type *floor_ptr, player_type *challan
        build_arena(floor_ptr, &y, &x);
        player_place(challanger_ptr, y, x);
 
-       if(!place_monster_aux(0, challanger_ptr->y + 5, challanger_ptr->x, arena_info[challanger_ptr->arena_number].r_idx, (PM_NO_KAGE | PM_NO_PET)))
+       if(!place_monster_aux(challanger_ptr, 0, challanger_ptr->y + 5, challanger_ptr->x, arena_info[challanger_ptr->arena_number].r_idx, (PM_NO_KAGE | PM_NO_PET)))
        {
                challanger_ptr->exit_bldg = TRUE;
                challanger_ptr->arena_number++;
                msg_print(_("相手は欠場した。あなたの不戦勝だ。", "The enemy is unable appear. You won by default."));
        }
-
 }
 
+
 /*!
  * @brief モンスター闘技場のフロア生成 / Builds the arena after it is entered -KMW-
  * @return なし
@@ -1210,7 +1210,7 @@ static void generate_gambling_arena(player_type *creature_ptr)
 
        for(i = 0; i < 4; i++)
        {
-               place_monster_aux(0, creature_ptr->y + 8 + (i/2)*4, creature_ptr->x - 2 + (i%2)*4, battle_mon[i], (PM_NO_KAGE | PM_NO_PET));
+               place_monster_aux(creature_ptr, 0, creature_ptr->y + 8 + (i/2)*4, creature_ptr->x - 2 + (i%2)*4, battle_mon[i], (PM_NO_KAGE | PM_NO_PET));
                set_friendly(&floor_ptr->m_list[floor_ptr->grid_array[creature_ptr->y+8+(i/2)*4][creature_ptr->x-2+(i%2)*4].m_idx]);
        }
        for(i = 1; i < floor_ptr->m_max; i++)
index abdefe7..e1b5e51 100644 (file)
@@ -1292,7 +1292,7 @@ void change_floor(player_type *creature_ptr)
                        for (i = 0; i < alloc_times; i++)
                        {
                                /* Make a (group of) new monster */
-                               (void)alloc_monster(0, 0);
+                               (void)alloc_monster(creature_ptr, 0, 0);
                        }
 
                }
index 2b45271..c183430 100644 (file)
@@ -580,7 +580,7 @@ void vault_monsters(player_type *player_ptr, POSITION y1, POSITION x1, int num)
 
                        /* Place the monster (allow groups) */
                        floor_ptr->monster_level = floor_ptr->base_level + 2;
-                       (void)place_monster(y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
+                       (void)place_monster(player_ptr, y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
                        floor_ptr->monster_level = floor_ptr->base_level;
                }
        }
index 3288d51..d64aa28 100644 (file)
@@ -1256,7 +1256,7 @@ static bool cast_force_spell(player_type *caster_ptr, int spell)
                bool success = FALSE;
 
                for (i = 0; i < 1 + boost/100; i++)
-                       if (summon_specific(-1, caster_ptr->y, caster_ptr->x, plev, SUMMON_PHANTOM, PM_FORCE_PET))
+                       if (summon_specific(caster_ptr, -1, caster_ptr->y, caster_ptr->x, plev, SUMMON_PHANTOM, PM_FORCE_PET))
                                success = TRUE;
                if (success)
                {
index 88feb1d..07cb8da 100644 (file)
@@ -1491,7 +1491,7 @@ void process_monster(player_type *target_ptr, MONSTER_IDX m_idx)
                if ((k < 4) && (!k || !randint0(k * MON_MULT_ADJ)))
                {
                        /* Try to multiply */
-                       if (multiply_monster(m_idx, FALSE, (is_pet(m_ptr) ? PM_FORCE_PET : 0)))
+                       if (multiply_monster(target_ptr, m_idx, FALSE, (is_pet(m_ptr) ? PM_FORCE_PET : 0)))
                        {
                                /* Take note if visible */
                                if (target_ptr->current_floor_ptr->m_list[hack_m_idx_ii].ml && is_original_ap_and_seen(m_ptr))
@@ -1520,7 +1520,7 @@ void process_monster(player_type *target_ptr, MONSTER_IDX m_idx)
 
                                        for (k = 0; k < A_MAX; k++)
                                        {
-                                               if (summon_specific(m_idx, m_ptr->fy, m_ptr->fx, rlev, SUMMON_MOLD, (PM_ALLOW_GROUP | p_mode)))
+                                               if (summon_specific(target_ptr, m_idx, m_ptr->fy, m_ptr->fx, rlev, SUMMON_MOLD, (PM_ALLOW_GROUP | p_mode)))
                                                {
                                                        if (target_ptr->current_floor_ptr->m_list[hack_m_idx_ii].ml) count++;
                                                }
index 413383e..d8029e9 100644 (file)
@@ -1394,7 +1394,7 @@ bool mon_take_hit(player_type *target_ptr, MONSTER_IDX m_idx, HIT_POINT dam, boo
                        BIT_FLAGS mode = 0L;
                        if (is_pet(m_ptr)) mode |= PM_FORCE_PET;
                        delete_monster_idx(m_idx);
-                       if (summon_named_creature(0, dummy_y, dummy_x, MON_BIKETAL, mode))
+                       if (summon_named_creature(target_ptr, 0, dummy_y, dummy_x, MON_BIKETAL, mode))
                        {
                                msg_print(_("「ハァッハッハッハ!!私がバイケタルだ!!」", "Uwa-hahaha!  *I* am Biketal!"));
                        }
index 3c0c366..60d09a6 100644 (file)
@@ -412,11 +412,11 @@ struct monster_type
 #define PM_KAGE           0x00000200    /*!< モンスター生成フラグ: 必ずあやしい影として生成する */
 #define PM_MULTIPLY       0x00000400    /*!< モンスター生成フラグ: 増殖処理時として生成する */
 
-extern bool place_monster_aux(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode);
-extern bool place_monster(POSITION y, POSITION x, BIT_FLAGS mode);
-extern bool alloc_horde(POSITION y, POSITION x);
-extern bool alloc_guardian(bool def_val);
-extern bool alloc_monster(POSITION dis, BIT_FLAGS mode);
+extern bool place_monster_aux(player_type *player_ptr, MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode);
+extern bool place_monster(player_type *player_ptr, POSITION y, POSITION x, BIT_FLAGS mode);
+extern bool alloc_horde(player_type *player_ptr, POSITION y, POSITION x);
+extern bool alloc_guardian(player_type *player_ptr, bool def_val);
+extern bool alloc_monster(player_type *player_ptr, POSITION dis, BIT_FLAGS mode);
 
 extern void monster_desc(char *desc, monster_type *m_ptr, BIT_FLAGS mode);
 /* Bit flags for monster_desc() */
@@ -444,7 +444,7 @@ extern void monster_death(player_type *player_ptr, MONSTER_IDX m_idx, bool drop_
 extern monsterrace_hook_type get_monster_hook(player_type *player_ptr);
 extern monsterrace_hook_type get_monster_hook2(player_type *player_ptr, POSITION y, POSITION x);
 extern void set_friendly(monster_type *m_ptr);
-extern void set_pet(monster_type *m_ptr);
+extern void set_pet(player_type *player_ptr, monster_type *m_ptr);
 extern void set_hostile(monster_type *m_ptr);
 extern void anger_monster(player_type *player_ptr, monster_type *m_ptr);
 
@@ -478,8 +478,9 @@ extern int lore_do_probe(MONRACE_IDX r_idx);
 extern void lore_treasure(MONSTER_IDX m_idx, ITEM_NUMBER num_item, ITEM_NUMBER num_gold);
 extern void update_monster(player_type *subject_ptr, MONSTER_IDX m_idx, bool full);
 extern void update_monsters(bool full);
-extern bool multiply_monster(MONSTER_IDX m_idx, bool clone, BIT_FLAGS mode);
-
+extern bool multiply_monster(player_type *player_ptr, MONSTER_IDX m_idx, bool clone, BIT_FLAGS mode);
+extern bool summon_specific(player_type *player_ptr, MONSTER_IDX who, POSITION y1, POSITION x1, DEPTH lev, int type, BIT_FLAGS mode);
+extern bool summon_named_creature(player_type *player_ptr, MONSTER_IDX who, POSITION oy, POSITION ox, MONRACE_IDX r_idx, BIT_FLAGS mode);
 
 /*
  * Some things which induce learning
index 86e3b50..a72fede 100644 (file)
@@ -2225,12 +2225,13 @@ void set_friendly(monster_type *m_ptr)
 
 /*!
  * @brief モンスターをペットにする
+ * @param player_type プレーヤーへの参照ポインタ
  * @param m_ptr モンスター情報構造体の参照ポインタ
  * @return なし
  */
-void set_pet(monster_type *m_ptr)
+void set_pet(player_type *player_ptr, monster_type *m_ptr)
 {
-       check_quest_completion(p_ptr, m_ptr);
+       check_quest_completion(player_ptr, m_ptr);
 
        m_ptr->smart |= SM_PET;
        if (!(r_info[m_ptr->r_idx].flags3 & (RF3_EVIL | RF3_GOOD)))
@@ -2706,7 +2707,7 @@ void monster_death(player_type *player_ptr, MONSTER_IDX m_idx, bool drop_item)
 
                                if (pet) mode |= PM_FORCE_PET;
 
-                               if (summon_specific((pet ? -1 : m_idx), wy, wx, 100, SUMMON_BLUE_HORROR, mode))
+                               if (summon_specific(player_ptr, (pet ? -1 : m_idx), wy, wx, 100, SUMMON_BLUE_HORROR, mode))
                                {
                                        if (player_can_see_bold(player_ptr, wy, wx)) notice = TRUE;
                                }
@@ -2771,7 +2772,7 @@ void monster_death(player_type *player_ptr, MONSTER_IDX m_idx, bool drop_item)
                                        BIT_FLAGS mode = 0L;
                                        if (pet) mode |= PM_FORCE_PET;
 
-                                       if (summon_specific((pet ? -1 : m_idx), wy, wx, 100, SUMMON_DAWN, mode))
+                                       if (summon_specific(player_ptr, (pet ? -1 : m_idx), wy, wx, 100, SUMMON_DAWN, mode))
                                        {
                                                if (player_can_see_bold(player_ptr, wy, wx))
                                                        msg_print(_("新たな戦士が現れた!", "A new warrior steps forth!"));
index b3e4e8d..d8a5735 100644 (file)
@@ -2476,6 +2476,7 @@ SPEED get_mspeed(monster_race *r_ptr)
 
 /*!
  * @brief モンスターを一体生成する / Attempt to place a monster of the given race at the given location.
+ * @param player_ptr プレーヤーへの参照ポインタ
  * @param who 召喚を行ったモンスターID
  * @param y 生成位置y座標
  * @param x 生成位置x座標
@@ -2499,9 +2500,9 @@ SPEED get_mspeed(monster_race *r_ptr)
  * This is the only function which may place a monster in the dungeon,
  * except for the savefile loading code.
  */
-static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode)
+static bool place_monster_one(player_type *player_ptr, MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode)
 {
-       floor_type *floor_ptr = p_ptr->current_floor_ptr;
+       floor_type *floor_ptr = player_ptr->current_floor_ptr;
        grid_type               *g_ptr = &floor_ptr->grid_array[y][x];
        monster_type    *m_ptr;
        monster_race    *r_ptr = &r_info[r_idx];
@@ -2510,7 +2511,7 @@ static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_I
        int cmi;
 
        /* DO NOT PLACE A MONSTER IN THE SMALL SCALE WILDERNESS !!! */
-       if (p_ptr->wild_mode) return FALSE;
+       if (player_ptr->wild_mode) return FALSE;
 
        if (!in_bounds(floor_ptr, y, x)) return FALSE;
        if (!r_idx) return FALSE;
@@ -2525,7 +2526,7 @@ static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_I
                if (!monster_can_enter(y, x, r_ptr, 0)) return FALSE;
        }
 
-       if (!p_ptr->phase_out)
+       if (!player_ptr->phase_out)
        {
                /* Hack -- "unique" monsters must be "unique" */
                if (((r_ptr->flags1 & (RF1_UNIQUE)) ||
@@ -2557,9 +2558,9 @@ static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_I
                }
        }
 
-       if (quest_number(p_ptr, floor_ptr->dun_level))
+       if (quest_number(player_ptr, floor_ptr->dun_level))
        {
-               int hoge = quest_number(p_ptr, floor_ptr->dun_level);
+               int hoge = quest_number(player_ptr, floor_ptr->dun_level);
                if ((quest[hoge].type == QUEST_TYPE_KILL_LEVEL) || (quest[hoge].type == QUEST_TYPE_RANDOM))
                {
                        if (r_idx == quest[hoge].r_idx)
@@ -2696,7 +2697,7 @@ static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_I
        /* Pet? */
        if (mode & PM_FORCE_PET)
        {
-               set_pet(m_ptr);
+               set_pet(player_ptr, m_ptr);
        }
        /* Friendly? */
        else if ((r_ptr->flags7 & RF7_FRIENDLY) ||
@@ -2712,7 +2713,7 @@ static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_I
        if ((mode & PM_ALLOW_SLEEP) && r_ptr->sleep && !ironman_nightmare)
        {
                int val = r_ptr->sleep;
-               (void)set_monster_csleep(p_ptr, g_ptr->m_idx, (val * 2) + randint1(val * 10));
+               (void)set_monster_csleep(player_ptr, g_ptr->m_idx, (val * 2) + randint1(val * 10));
        }
 
        /* Assign maximal hitpoints */
@@ -2748,7 +2749,7 @@ static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_I
        /* Extract the monster base speed */
        m_ptr->mspeed = get_mspeed(r_ptr);
 
-       if (mode & PM_HASTE) (void)set_monster_fast(p_ptr, g_ptr->m_idx, 100);
+       if (mode & PM_HASTE) (void)set_monster_fast(player_ptr, g_ptr->m_idx, 100);
 
        /* Give a random starting energy */
        if (!ironman_nightmare)
@@ -2780,10 +2781,10 @@ static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_I
 
 
        if (r_ptr->flags7 & RF7_SELF_LD_MASK)
-               p_ptr->update |= (PU_MON_LITE);
+               player_ptr->update |= (PU_MON_LITE);
        else if ((r_ptr->flags7 & RF7_HAS_LD_MASK) && !MON_CSLEEP(m_ptr))
-               p_ptr->update |= (PU_MON_LITE);
-       update_monster(p_ptr, g_ptr->m_idx, TRUE);
+               player_ptr->update |= (PU_MON_LITE);
+       update_monster(player_ptr, g_ptr->m_idx, TRUE);
 
 
        /* Count the monsters on the level */
@@ -2795,12 +2796,12 @@ static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_I
         */
        if (current_world_ptr->character_dungeon &&
                ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL)))
-               real_r_ptr(m_ptr)->floor_id = p_ptr->floor_id;
+               real_r_ptr(m_ptr)->floor_id = player_ptr->floor_id;
 
        /* Hack -- Count the number of "reproducers" */
        if (r_ptr->flags2 & RF2_MULTIPLY) floor_ptr->num_repro++;
 
-       if (p_ptr->warning && current_world_ptr->character_dungeon)
+       if (player_ptr->warning && current_world_ptr->character_dungeon)
        {
                if (r_ptr->flags1 & RF1_UNIQUE)
                {
@@ -2808,20 +2809,20 @@ static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_I
                        object_type *o_ptr;
                        GAME_TEXT o_name[MAX_NLEN];
 
-                       if (r_ptr->level > p_ptr->lev + 30)
+                       if (r_ptr->level > player_ptr->lev + 30)
                                color = _("黒く", "black");
-                       else if (r_ptr->level > p_ptr->lev + 15)
+                       else if (r_ptr->level > player_ptr->lev + 15)
                                color = _("紫色に", "purple");
-                       else if (r_ptr->level > p_ptr->lev + 5)
+                       else if (r_ptr->level > player_ptr->lev + 5)
                                color = _("ルビー色に", "deep red");
-                       else if (r_ptr->level > p_ptr->lev - 5)
+                       else if (r_ptr->level > player_ptr->lev - 5)
                                color = _("赤く", "red");
-                       else if (r_ptr->level > p_ptr->lev - 15)
+                       else if (r_ptr->level > player_ptr->lev - 15)
                                color = _("ピンク色に", "pink");
                        else
                                color = _("白く", "white");
 
-                       o_ptr = choose_warning_item(p_ptr);
+                       o_ptr = choose_warning_item(player_ptr);
                        if (o_ptr)
                        {
                                object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
@@ -2843,7 +2844,7 @@ static bool place_monster_one(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_I
                        if (g_ptr->info & CAVE_MARK)
                        {
                                msg_print(_("ルーンが爆発した!", "The rune explodes!"));
-                               project(p_ptr, 0, 2, y, x, 2 * (p_ptr->lev + damroll(7, 7)), GF_MANA, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
+                               project(player_ptr, 0, 2, y, x, 2 * (player_ptr->lev + damroll(7, 7)), GF_MANA, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
                        }
                }
                else
@@ -2960,7 +2961,7 @@ static bool mon_scatter(MONRACE_IDX r_idx, POSITION *yp, POSITION *xp, POSITION
  * @param mode 生成オプション
  * @return 成功したらtrue
  */
-static bool place_monster_group(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode)
+static bool place_monster_group(player_type *player_ptr, MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode)
 {
        monster_race *r_ptr = &r_info[r_idx];
 
@@ -3027,7 +3028,7 @@ static bool place_monster_group(MONSTER_IDX who, POSITION y, POSITION x, MONRACE
                        if (!cave_empty_bold2(floor_ptr, my, mx)) continue;
 
                        /* Attempt to place another monster */
-                       if (place_monster_one(who, my, mx, r_idx, mode))
+                       if (place_monster_one(player_ptr, who, my, mx, r_idx, mode))
                        {
                                /* Add it to the "hack" set */
                                hack_y[hack_n] = my;
@@ -3100,6 +3101,7 @@ static bool place_monster_can_escort(MONRACE_IDX r_idx)
 
 /*!
  * @brief 一般的なモンスター生成処理のサブルーチン / Attempt to place a monster of the given race at the given location
+ * @param player_ptr プレーヤーへの参照ポインタ
  * @param who 召喚主のモンスター情報ID
  * @param y 生成地点y座標
  * @param x 生成地点x座標
@@ -3122,7 +3124,7 @@ static bool place_monster_can_escort(MONRACE_IDX r_idx)
  * Note the use of the new "monster allocation table" code to restrict
  * the "get_mon_num()" function to "legal" escort types.
  */
-bool place_monster_aux(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode)
+bool place_monster_aux(player_type *player_ptr, MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_idx, BIT_FLAGS mode)
 {
        int             i, j, n;
        monster_race    *r_ptr = &r_info[r_idx];
@@ -3131,7 +3133,7 @@ bool place_monster_aux(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_id
                mode |= PM_KAGE;
 
        /* Place one monster, or fail */
-       if (!place_monster_one(who, y, x, r_idx, mode)) return FALSE;
+       if (!place_monster_one(player_ptr, who, y, x, r_idx, mode)) return FALSE;
 
        /* Require the "group" flag */
        if (!(mode & PM_ALLOW_GROUP)) return TRUE;
@@ -3147,7 +3149,7 @@ bool place_monster_aux(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_id
                {
                        POSITION nx, ny, d = 7;
                        scatter(p_ptr, &ny, &nx, y, x, d, 0);
-                       (void)place_monster_one(place_monster_m_idx, ny, nx, r_ptr->reinforce_id[i], mode);
+                       (void)place_monster_one(player_ptr, place_monster_m_idx, ny, nx, r_ptr->reinforce_id[i], mode);
                }
        }
 
@@ -3155,7 +3157,7 @@ bool place_monster_aux(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_id
        if (r_ptr->flags1 & (RF1_FRIENDS))
        {
                /* Attempt to place a group */
-               (void)place_monster_group(who, y, x, r_idx, mode);
+               (void)place_monster_group(player_ptr, who, y, x, r_idx, mode);
        }
 
        /* Escorts for certain monsters */
@@ -3184,14 +3186,14 @@ bool place_monster_aux(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_id
                        if (!z) break;
 
                        /* Place a single escort */
-                       (void)place_monster_one(place_monster_m_idx, ny, nx, z, mode);
+                       (void)place_monster_one(player_ptr, place_monster_m_idx, ny, nx, z, mode);
 
                        /* Place a "group" of escorts if needed */
                        if ((r_info[z].flags1 & RF1_FRIENDS) ||
                                (r_ptr->flags1 & RF1_ESCORTS))
                        {
                                /* Place a group of monsters */
-                               (void)place_monster_group(place_monster_m_idx, ny, nx, z, mode);
+                               (void)place_monster_group(player_ptr, place_monster_m_idx, ny, nx, z, mode);
                        }
                }
        }
@@ -3202,12 +3204,13 @@ bool place_monster_aux(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_id
 
 /*!
  * @brief 一般的なモンスター生成処理のメインルーチン / Attempt to place a monster of the given race at the given location
+ * @param player_ptr プレーヤーへの参照ポインタ
  * @param y 生成地点y座標
  * @param x 生成地点x座標
  * @param mode 生成オプション
  * @return 生成に成功したらtrue
  */
-bool place_monster(POSITION y, POSITION x, BIT_FLAGS mode)
+bool place_monster(player_type *player_ptr, POSITION y, POSITION x, BIT_FLAGS mode)
 {
        MONRACE_IDX r_idx;
        get_mon_num_prep(get_monster_hook(p_ptr), get_monster_hook2(p_ptr, y, x));
@@ -3219,18 +3222,19 @@ bool place_monster(POSITION y, POSITION x, BIT_FLAGS mode)
        if (!r_idx) return FALSE;
 
        /* Attempt to place the monster */
-       if (place_monster_aux(0, y, x, r_idx, mode)) return TRUE;
+       if (place_monster_aux(player_ptr, 0, y, x, r_idx, mode)) return TRUE;
 
        return FALSE;
 }
 
 /*!
  * @brief 指定地点に1種類のモンスター種族による群れを生成する
+ * @param player_ptr プレーヤーへの参照ポインタ
  * @param y 生成地点y座標
  * @param x 生成地点x座標
  * @return 生成に成功したらtrue
  */
-bool alloc_horde(POSITION y, POSITION x)
+bool alloc_horde(player_type *player_ptr, POSITION y, POSITION x)
 {
        monster_race *r_ptr = NULL;
        MONRACE_IDX r_idx = 0;
@@ -3263,7 +3267,7 @@ bool alloc_horde(POSITION y, POSITION x)
        while (--attempts)
        {
                /* Attempt to place the monster */
-               if (place_monster_aux(0, y, x, r_idx, 0L)) break;
+               if (place_monster_aux(player_ptr, 0, y, x, r_idx, 0L)) break;
        }
 
        if (attempts < 1) return FALSE;
@@ -3276,7 +3280,7 @@ bool alloc_horde(POSITION y, POSITION x)
        {
                scatter(p_ptr, &cy, &cx, y, x, 5, 0);
 
-               (void)summon_specific(m_idx, cy, cx, floor_ptr->dun_level + 5, SUMMON_KIN, PM_ALLOW_GROUP);
+               (void)summon_specific(player_ptr, m_idx, cy, cx, floor_ptr->dun_level + 5, SUMMON_KIN, PM_ALLOW_GROUP);
 
                y = cy;
                x = cx;
@@ -3288,10 +3292,11 @@ bool alloc_horde(POSITION y, POSITION x)
 
 /*!
  * @brief ダンジョンの主生成を試みる / Put the Guardian
+ * @param player_ptr プレーヤーへの参照ポインタ
  * @param def_val 現在の主の生成状態
  * @return 生成に成功したらtrue
  */
-bool alloc_guardian(bool def_val)
+bool alloc_guardian(player_type *player_ptr, bool def_val)
 {
        MONRACE_IDX guardian = d_info[p_ptr->dungeon_idx].final_guardian;
 
@@ -3313,7 +3318,7 @@ bool alloc_guardian(bool def_val)
                        if (cave_empty_bold2(floor_ptr, oy, ox) && monster_can_cross_terrain(floor_ptr->grid_array[oy][ox].feat, &r_info[guardian], 0))
                        {
                                /* Place the guardian */
-                               if (place_monster_aux(0, oy, ox, guardian, (PM_ALLOW_GROUP | PM_NO_KAGE | PM_NO_PET))) return TRUE;
+                               if (place_monster_aux(player_ptr, 0, oy, ox, guardian, (PM_ALLOW_GROUP | PM_NO_KAGE | PM_NO_PET))) return TRUE;
                        }
 
                        /* One less try count */
@@ -3337,13 +3342,13 @@ bool alloc_guardian(bool def_val)
  * Use "slp" to choose the initial "sleep" status
  * Use "floor_ptr->monster_level" for the monster level
  */
-bool alloc_monster(POSITION dis, BIT_FLAGS mode)
+bool alloc_monster(player_type *player_ptr, POSITION dis, BIT_FLAGS mode)
 {
        POSITION y = 0, x = 0;
        int attempts_left = 10000;
 
        /* Put the Guardian */
-       if (alloc_guardian(FALSE)) return TRUE;
+       if (alloc_guardian(player_ptr, FALSE)) return TRUE;
 
        /* Find a legal, distant, unoccupied, space */
        floor_type *floor_ptr = p_ptr->current_floor_ptr;
@@ -3380,7 +3385,7 @@ bool alloc_monster(POSITION dis, BIT_FLAGS mode)
 
        if (randint1(5000) <= floor_ptr->dun_level)
        {
-               if (alloc_horde(y, x))
+               if (alloc_horde(player_ptr, y, x))
                {
                        return TRUE;
                }
@@ -3388,7 +3393,7 @@ bool alloc_monster(POSITION dis, BIT_FLAGS mode)
        else
        {
                /* Attempt to place the monster, allow groups */
-               if (place_monster(y, x, (mode | PM_ALLOW_GROUP))) return TRUE;
+               if (place_monster(player_ptr, y, x, (mode | PM_ALLOW_GROUP))) return TRUE;
        }
 
        return FALSE;
@@ -3445,6 +3450,7 @@ static bool summon_specific_okay(MONRACE_IDX r_idx)
 
 /*!
  * @brief モンスターを召喚により配置する / Place a monster (of the specified "type") near the given location. Return TRUE if a monster was actually summoned.
+ * @param player_ptr プレーヤーへの参照ポインタ
  * @param who 召喚主のモンスター情報ID
  * @param y1 目標地点y座標
  * @param x1 目標地点x座標
@@ -3474,7 +3480,7 @@ static bool summon_specific_okay(MONRACE_IDX r_idx)
  *
  * Note that this function may not succeed, though this is very rare.
  */
-bool summon_specific(MONSTER_IDX who, POSITION y1, POSITION x1, DEPTH lev, int type, BIT_FLAGS mode)
+bool summon_specific(player_type *player_ptr, MONSTER_IDX who, POSITION y1, POSITION x1, DEPTH lev, int type, BIT_FLAGS mode)
 {
        POSITION x, y;
        MONRACE_IDX r_idx;
@@ -3506,7 +3512,7 @@ bool summon_specific(MONSTER_IDX who, POSITION y1, POSITION x1, DEPTH lev, int t
        if ((type == SUMMON_BLUE_HORROR) || (type == SUMMON_DAWN)) mode |= PM_NO_KAGE;
 
        /* Attempt to place the monster (awake, allow groups) */
-       if (!place_monster_aux(who, y, x, r_idx, mode))
+       if (!place_monster_aux(player_ptr, who, y, x, r_idx, mode))
        {
                summon_specific_type = 0;
                return FALSE;
@@ -3521,6 +3527,7 @@ bool summon_specific(MONSTER_IDX who, POSITION y1, POSITION x1, DEPTH lev, int t
 
 /*!
  * @brief 特定モンスター種族を召喚により生成する / A "dangerous" function, creates a pet of the specified type
+ * @param player_ptr プレーヤーへの参照ポインタ
  * @param who 召喚主のモンスター情報ID
  * @param oy 目標地点y座標
  * @param ox 目標地点x座標
@@ -3528,7 +3535,7 @@ bool summon_specific(MONSTER_IDX who, POSITION y1, POSITION x1, DEPTH lev, int t
  * @param mode 生成オプション
  * @return 召喚できたらtrueを返す
  */
-bool summon_named_creature(MONSTER_IDX who, POSITION oy, POSITION ox, MONRACE_IDX r_idx, BIT_FLAGS mode)
+bool summon_named_creature(player_type *player_ptr, MONSTER_IDX who, POSITION oy, POSITION ox, MONRACE_IDX r_idx, BIT_FLAGS mode)
 {
        POSITION x, y;
        /* if (!r_idx) return; */
@@ -3541,12 +3548,13 @@ bool summon_named_creature(MONSTER_IDX who, POSITION oy, POSITION ox, MONRACE_ID
        if (!mon_scatter(r_idx, &y, &x, oy, ox, 2)) return FALSE;
 
        /* Place it (allow groups) */
-       return place_monster_aux(who, y, x, r_idx, (mode | PM_NO_KAGE));
+       return place_monster_aux(player_ptr, who, y, x, r_idx, (mode | PM_NO_KAGE));
 }
 
 
 /*!
  * @brief モンスターを増殖生成する / Let the given monster attempt to reproduce.
+ * @param player_ptr プレーヤーへの参照ポインタ
  * @param m_idx 増殖するモンスター情報ID
  * @param clone クローン・モンスター処理ならばtrue
  * @param mode 生成オプション
@@ -3554,7 +3562,7 @@ bool summon_named_creature(MONSTER_IDX who, POSITION oy, POSITION ox, MONRACE_ID
  * @details
  * Note that "reproduction" REQUIRES empty space.
  */
-bool multiply_monster(MONSTER_IDX m_idx, bool clone, BIT_FLAGS mode)
+bool multiply_monster(player_type *player_ptr, MONSTER_IDX m_idx, bool clone, BIT_FLAGS mode)
 {
        floor_type *floor_ptr = p_ptr->current_floor_ptr;
        monster_type *m_ptr = &floor_ptr->m_list[m_idx];
@@ -3566,7 +3574,7 @@ bool multiply_monster(MONSTER_IDX m_idx, bool clone, BIT_FLAGS mode)
        if (m_ptr->mflag2 & MFLAG2_NOPET) mode |= PM_NO_PET;
 
        /* Create a new monster (awake, no groups) */
-       if (!place_monster_aux(m_idx, y, x, m_ptr->r_idx, (mode | PM_NO_KAGE | PM_MULTIPLY)))
+       if (!place_monster_aux(player_ptr, m_idx, y, x, m_ptr->r_idx, (mode | PM_NO_KAGE | PM_MULTIPLY)))
                return FALSE;
 
        /* Hack -- Transfer "clone" flag */
@@ -3580,7 +3588,6 @@ bool multiply_monster(MONSTER_IDX m_idx, bool clone, BIT_FLAGS mode)
 }
 
 
-
 /*!
  * @brief ダメージを受けたモンスターの様子を記述する / Dump a message describing a monster's reaction to damage
  * @param m_idx モンスター情報ID
index a511925..bdc1940 100644 (file)
@@ -1383,7 +1383,7 @@ static bool cast_learned_spell(player_type *caster_ptr, int spell, bool success)
         msg_print(_("援軍を召喚した。", "You summon minions."));
                for (int k = 0;k < 1; k++)
                {
-                       if (summon_kin_player(summon_lev, caster_ptr->y, caster_ptr->x, (pet ? PM_FORCE_PET : 0L)))
+                       if (summon_kin_player(caster_ptr, summon_lev, caster_ptr->y, caster_ptr->x, (pet ? PM_FORCE_PET : 0L)))
                        {
                                if (!pet) msg_print(_("召喚された仲間は怒っている!", "Summoned fellows are angry!"));
                        }
@@ -1400,7 +1400,7 @@ static bool cast_learned_spell(player_type *caster_ptr, int spell, bool success)
         msg_print(_("サイバーデーモンを召喚した!", "You summon a Cyberdemon!"));
                for (int k = 0; k < 1; k++)
                {
-                       if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_CYBER, p_mode))
+                       if (summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_CYBER, p_mode))
                        {
                                if (!pet)
                                        msg_print(_("召喚されたサイバーデーモンは怒っている!", "The summoned Cyberdemon are angry!"));
@@ -1417,7 +1417,7 @@ static bool cast_learned_spell(player_type *caster_ptr, int spell, bool success)
         msg_print(_("仲間を召喚した。", "You summon help."));
                for (int k = 0; k < 1; k++)
                {
-                       if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, 0, p_mode))
+                       if (summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, 0, p_mode))
                        {
                                if (!pet)
                                        msg_print(_("召喚されたモンスターは怒っている!", "The summoned monster is angry!"));
@@ -1435,7 +1435,7 @@ static bool cast_learned_spell(player_type *caster_ptr, int spell, bool success)
         msg_print(_("モンスターを召喚した!", "You summon monsters!"));
                for (int k = 0; k < plev / 15 + 2; k++)
                {
-                       if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, 0, (p_mode | u_mode)))
+                       if (summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, 0, (p_mode | u_mode)))
                        {
                                if (!pet)
                                        msg_print(_("召喚されたモンスターは怒っている!", "The summoned monsters are angry!"));
@@ -1451,7 +1451,7 @@ static bool cast_learned_spell(player_type *caster_ptr, int spell, bool success)
        case MS_S_ANT:
        {
         msg_print(_("アリを召喚した。", "You summon ants."));
-               if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_ANT, (PM_ALLOW_GROUP | p_mode)))
+               if (summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_ANT, (PM_ALLOW_GROUP | p_mode)))
                {
                        if (!pet)
                                msg_print(_("召喚されたアリは怒っている!", "The summoned ants are angry!"));
@@ -1465,7 +1465,7 @@ static bool cast_learned_spell(player_type *caster_ptr, int spell, bool success)
        case MS_S_SPIDER:
        {
         msg_print(_("蜘蛛を召喚した。", "You summon spiders."));
-               if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_SPIDER, (PM_ALLOW_GROUP | p_mode)))
+               if (summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_SPIDER, (PM_ALLOW_GROUP | p_mode)))
                {
                        if (!pet)
                                msg_print(_("召喚された蜘蛛は怒っている!", "Summoned spiders are angry!"));
@@ -1480,7 +1480,7 @@ static bool cast_learned_spell(player_type *caster_ptr, int spell, bool success)
        case MS_S_HOUND:
        {
         msg_print(_("ハウンドを召喚した。", "You summon hounds."));
-               if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_HOUND, (PM_ALLOW_GROUP | p_mode)))
+               if (summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_HOUND, (PM_ALLOW_GROUP | p_mode)))
                {
                        if (!pet)
                                msg_print(_("召喚されたハウンドは怒っている!", "Summoned hounds are angry!"));
@@ -1495,7 +1495,7 @@ static bool cast_learned_spell(player_type *caster_ptr, int spell, bool success)
        case MS_S_HYDRA:
        {
         msg_print(_("ヒドラを召喚した。", "You summon a hydras."));
-               if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_HYDRA, (g_mode | p_mode)))
+               if (summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_HYDRA, (g_mode | p_mode)))
                {
                        if (!pet)
                                msg_print(_("召喚されたヒドラは怒っている!", "Summoned hydras are angry!"));
@@ -1510,7 +1510,7 @@ static bool cast_learned_spell(player_type *caster_ptr, int spell, bool success)
        case MS_S_ANGEL:
        {
         msg_print(_("天使を召喚した!", "You summon an angel!"));
-               if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_ANGEL, (g_mode | p_mode)))
+               if (summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_ANGEL, (g_mode | p_mode)))
                {
                        if (!pet)
                                msg_print(_("召喚された天使は怒っている!", "Summoned angels are angry!"));
@@ -1525,7 +1525,7 @@ static bool cast_learned_spell(player_type *caster_ptr, int spell, bool success)
        case MS_S_DEMON:
        {
         msg_print(_("混沌の宮廷から悪魔を召喚した!", "You summon a demon from the Courts of Chaos!"));
-               if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_DEMON, (g_mode | p_mode)))
+               if (summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_DEMON, (g_mode | p_mode)))
                {
                        if (!pet)
                                msg_print(_("召喚されたデーモンは怒っている!", "Summoned demons are angry!"));
@@ -1540,7 +1540,7 @@ static bool cast_learned_spell(player_type *caster_ptr, int spell, bool success)
        case MS_S_UNDEAD:
        {
         msg_print(_("アンデッドの強敵を召喚した!", "You summon an undead adversary!"));
-               if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_UNDEAD, (g_mode | p_mode)))
+               if (summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_UNDEAD, (g_mode | p_mode)))
                {
                        if (!pet)
                                msg_print(_("召喚されたアンデッドは怒っている!", "Summoned undeads are angry!"));
@@ -1555,7 +1555,7 @@ static bool cast_learned_spell(player_type *caster_ptr, int spell, bool success)
        case MS_S_DRAGON:
        {
         msg_print(_("ドラゴンを召喚した!", "You summon a dragon!"));
-               if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_DRAGON, (g_mode | p_mode)))
+               if (summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_DRAGON, (g_mode | p_mode)))
                {
                        if (!pet)
                                msg_print(_("召喚されたドラゴンは怒っている!", "Summoned dragons are angry!"));
@@ -1570,7 +1570,7 @@ static bool cast_learned_spell(player_type *caster_ptr, int spell, bool success)
        case MS_S_HI_UNDEAD:
        {
         msg_print(_("強力なアンデッドを召喚した!", "You summon a greater undead!"));
-               if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_HI_UNDEAD, (g_mode | p_mode | u_mode)))
+               if (summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_HI_UNDEAD, (g_mode | p_mode | u_mode)))
                {
                        if (!pet)
                                msg_print(_("召喚された上級アンデッドは怒っている!", "Summoned greater undeads are angry!"));
@@ -1585,7 +1585,7 @@ static bool cast_learned_spell(player_type *caster_ptr, int spell, bool success)
        case MS_S_HI_DRAGON:
        {
                msg_print(_("古代ドラゴンを召喚した!", "You summon an ancient dragon!"));
-               if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_HI_DRAGON, (g_mode | p_mode | u_mode)))
+               if (summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_HI_DRAGON, (g_mode | p_mode | u_mode)))
                {
                        if (!pet)
                                msg_print(_("召喚された古代ドラゴンは怒っている!", "Summoned ancient dragons are angry!"));
@@ -1600,7 +1600,7 @@ static bool cast_learned_spell(player_type *caster_ptr, int spell, bool success)
        case MS_S_AMBERITE:
        {
         msg_print(_("アンバーの王族を召喚した!", "You summon a Lord of Amber!"));
-               if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_AMBERITES, (g_mode | p_mode | u_mode)))
+               if (summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_AMBERITES, (g_mode | p_mode | u_mode)))
                {
                        if (!pet)
                                msg_print(_("召喚されたアンバーの王族は怒っている!", "Summoned Lords of Amber are angry!"));
@@ -1617,7 +1617,7 @@ static bool cast_learned_spell(player_type *caster_ptr, int spell, bool success)
                msg_print(_("特別な強敵を召喚した!", "You summon a special opponent!"));
                for (k = 0; k < 1; k++)
                {
-                       if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_UNIQUE, (g_mode | p_mode | PM_ALLOW_UNIQUE)))
+                       if (summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_UNIQUE, (g_mode | p_mode | PM_ALLOW_UNIQUE)))
                        {
                                count++;
                                if (!pet)
@@ -1627,7 +1627,7 @@ static bool cast_learned_spell(player_type *caster_ptr, int spell, bool success)
 
                for (k = count; k < 1; k++)
                {
-                       if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_HI_UNDEAD, (g_mode | p_mode | PM_ALLOW_UNIQUE)))
+                       if (summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_HI_UNDEAD, (g_mode | p_mode | PM_ALLOW_UNIQUE)))
                        {
                                count++;
                                if (!pet)
index fee1dd6..c5479d4 100644 (file)
@@ -2100,10 +2100,10 @@ HIT_POINT spell_RF6_SPECIAL_BANORLUPART(player_type *target_ptr, MONSTER_IDX m_i
                        return -1;
 
                delete_monster_idx(floor_ptr->grid_array[m_ptr->fy][m_ptr->fx].m_idx);
-               summon_named_creature(0, dummy_y, dummy_x, MON_BANOR, mode);
+               summon_named_creature(target_ptr, 0, dummy_y, dummy_x, MON_BANOR, mode);
                floor_ptr->m_list[hack_m_idx_ii].hp = dummy_hp;
                floor_ptr->m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
-               summon_named_creature(0, dummy_y, dummy_x, MON_LUPART, mode);
+               summon_named_creature(target_ptr, 0, dummy_y, dummy_x, MON_LUPART, mode);
                floor_ptr->m_list[hack_m_idx_ii].hp = dummy_hp;
                floor_ptr->m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
 
@@ -2132,7 +2132,7 @@ HIT_POINT spell_RF6_SPECIAL_BANORLUPART(player_type *target_ptr, MONSTER_IDX m_i
                                delete_monster_idx(k);
                        }
                }
-               summon_named_creature(0, dummy_y, dummy_x, MON_BANORLUPART, mode);
+               summon_named_creature(target_ptr, 0, dummy_y, dummy_x, MON_BANORLUPART, mode);
                floor_ptr->m_list[hack_m_idx_ii].hp = dummy_hp;
                floor_ptr->m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
 
@@ -2168,7 +2168,7 @@ HIT_POINT spell_RF6_SPECIAL_ROLENTO(player_type *target_ptr, POSITION y, POSITIO
 
        for (k = 0; k < num; k++)
        {
-               count += summon_named_creature(m_idx, y, x, MON_SHURYUUDAN, mode);
+               count += summon_named_creature(target_ptr, m_idx, y, x, MON_SHURYUUDAN, mode);
        }
 
        if (target_ptr->blind && count)
@@ -2706,19 +2706,20 @@ void spell_RF6_RAISE_DEAD(player_type *target_ptr, MONSTER_IDX m_idx, MONSTER_ID
 
 /*!
 * @brief 鷹召喚の処理。 /
+* @param target_ptr プレーヤーへの参照ポインタ
 * @param y 対象の地点のy座標
 * @param x 対象の地点のx座標
 * @param rlev 呪文を唱えるモンスターのレベル
 * @param m_idx 呪文を唱えるモンスターID
 * @return 召喚したモンスターの数を返す。
 */
-MONSTER_NUMBER summon_EAGLE(POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx)
+MONSTER_NUMBER summon_EAGLE(player_type *target_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx)
 {
        int count = 0;
        int num = 4 + randint1(3);
        for (int k = 0; k < num; k++)
        {
-               count += summon_specific(m_idx, y, x, rlev, SUMMON_EAGLES, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
+               count += summon_specific(target_ptr, m_idx, y, x, rlev, SUMMON_EAGLES, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
        }
 
        return count;
@@ -2727,20 +2728,21 @@ MONSTER_NUMBER summon_EAGLE(POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx)
 
 /*!
  * @brief インターネット・エクスプローダー召喚の処理。 /
+ * @param target_ptr プレーヤーへの参照ポインタ
  * @param y 対象の地点のy座標
  * @param x 対象の地点のx座標
  * @param rlev 呪文を唱えるモンスターのレベル
  * @param m_idx 呪文を唱えるモンスターID
  * @return 召喚したモンスターの数を返す。
  */
-MONSTER_NUMBER summon_IE(POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx)
+MONSTER_NUMBER summon_IE(player_type *target_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx)
 {
        BIT_FLAGS mode = 0L;
        int count = 0;
        int num = 2 + randint1(1 + rlev / 20);
        for (int k = 0; k < num; k++)
        {
-               count += summon_named_creature(m_idx, y, x, MON_IE, mode);
+               count += summon_named_creature(target_ptr, m_idx, y, x, MON_IE, mode);
        }
 
        return count;
@@ -2780,7 +2782,7 @@ MONSTER_NUMBER summon_guardian(player_type *target_ptr, POSITION y, POSITION x,
        int count = 0;
        for (int k = 0; k < num; k++)
        {
-               count += summon_specific(m_idx, y, x, rlev, SUMMON_GUARDIANS, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
+               count += summon_specific(target_ptr, m_idx, y, x, rlev, SUMMON_GUARDIANS, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
        }
 
        return count;
@@ -2789,19 +2791,20 @@ MONSTER_NUMBER summon_guardian(player_type *target_ptr, POSITION y, POSITION x,
 
 /*!
 * @brief ロックのクローン召喚の処理。 /
+* @param target_ptr プレーヤーへの参照ポインタ
 * @param y 対象の地点のy座標
 * @param x 対象の地点のx座標
 * @param m_idx 呪文を唱えるモンスターID
 * @return 召喚したモンスターの数を返す。
 */
-MONSTER_NUMBER summon_LOCKE_CLONE(POSITION y, POSITION x, MONSTER_IDX m_idx)
+MONSTER_NUMBER summon_LOCKE_CLONE(player_type *target_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx)
 {
        BIT_FLAGS mode = 0L;
        int count = 0;
        int num = randint1(3);
        for (int k = 0; k < num; k++)
        {
-               count += summon_named_creature(m_idx, y, x, MON_LOCKE_CLONE, mode);
+               count += summon_named_creature(target_ptr, m_idx, y, x, MON_LOCKE_CLONE, mode);
        }
 
        return count;
@@ -2810,19 +2813,20 @@ MONSTER_NUMBER summon_LOCKE_CLONE(POSITION y, POSITION x, MONSTER_IDX m_idx)
 
 /*!
 * @brief シラミ召喚の処理。 /
+* @param target_ptr プレーヤーへの参照ポインタ
 * @param y 対象の地点のy座標
 * @param x 対象の地点のx座標
 * @param rlev 呪文を唱えるモンスターのレベル
 * @param m_idx 呪文を唱えるモンスターID
 * @return 召喚したモンスターの数を返す。
 */
-MONSTER_NUMBER summon_LOUSE(POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx)
+MONSTER_NUMBER summon_LOUSE(player_type *target_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx)
 {
        int count = 0;
        int num = 2 + randint1(3);
        for (int k = 0; k < num; k++)
        {
-               count += summon_specific(m_idx, y, x, rlev, SUMMON_LOUSE, PM_ALLOW_GROUP);
+               count += summon_specific(target_ptr, m_idx, y, x, rlev, SUMMON_LOUSE, PM_ALLOW_GROUP);
        }
 
        return count;
@@ -2831,18 +2835,19 @@ MONSTER_NUMBER summon_LOUSE(POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx)
 
 /*!
 * @brief 救援召喚の通常処理。同シンボルのモンスターを召喚する。 /
+* @param target_ptr プレーヤーへの参照ポインタ
 * @param y 対象の地点のy座標
 * @param x 対象の地点のx座標
 * @param rlev 呪文を唱えるモンスターのレベル
 * @param m_idx 呪文を唱えるモンスターID
 * @return 召喚したモンスターの数を返す。
 */
-MONSTER_NUMBER summon_Kin(POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx)
+MONSTER_NUMBER summon_Kin(player_type *target_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx)
 {
        int count = 0;
        for (int k = 0; k < 4; k++)
        {
-               count += summon_specific(m_idx, y, x, rlev, SUMMON_KIN, PM_ALLOW_GROUP);
+               count += summon_specific(target_ptr, m_idx, y, x, rlev, SUMMON_KIN, PM_ALLOW_GROUP);
        }
 
        return count;
@@ -2912,11 +2917,11 @@ void spell_RF6_S_KIN(player_type *target_ptr, POSITION y, POSITION x, MONSTER_ID
        case MON_MENELDOR:
        case MON_GWAIHIR:
        case MON_THORONDOR:
-               count += summon_EAGLE(y, x, rlev, m_idx);
+               count += summon_EAGLE(target_ptr, y, x, rlev, m_idx);
                break;
 
        case MON_BULLGATES:
-               count += summon_IE(y, x, rlev, m_idx);
+               count += summon_IE(target_ptr, y, x, rlev, m_idx);
                break;
 
        case MON_SERPENT:
@@ -2925,15 +2930,15 @@ void spell_RF6_S_KIN(player_type *target_ptr, POSITION y, POSITION x, MONSTER_ID
                break;
 
        case MON_CALDARM:
-               count += summon_LOCKE_CLONE(y, x, m_idx);
+               count += summon_LOCKE_CLONE(target_ptr, y, x, m_idx);
                break;
 
        case MON_LOUSY:
-               count += summon_LOUSE(y, x, rlev, m_idx);
+               count += summon_LOUSE(target_ptr, y, x, rlev, m_idx);
                break;
 
        default:
-               count += summon_Kin(y, x, rlev, m_idx);
+               count += summon_Kin(target_ptr, y, x, rlev, m_idx);
                break;
        }
 
@@ -2972,11 +2977,11 @@ void spell_RF6_S_CYBER(player_type *target_ptr, POSITION y, POSITION x, MONSTER_
 
        if (is_friendly(m_ptr) && mon_to_mon)
        {
-               count += summon_specific(m_idx, y, x, rlev, SUMMON_CYBER, (PM_ALLOW_GROUP));
+               count += summon_specific(target_ptr, m_idx, y, x, rlev, SUMMON_CYBER, (PM_ALLOW_GROUP));
        }
        else
        {
-               count += summon_cyber(floor_ptr, m_idx, y, x);
+               count += summon_cyber(target_ptr, m_idx, y, x);
        }
 
        if (target_ptr->blind && count && mon_to_player)
@@ -2986,6 +2991,7 @@ void spell_RF6_S_CYBER(player_type *target_ptr, POSITION y, POSITION x, MONSTER_
                floor_ptr->monster_noise = TRUE;
 }
 
+
 /*!
 * @brief RF6_S_MONSTERの処理。モンスター一体召喚。 /
 * @param target_ptr プレーヤーへの参照ポインタ
@@ -3012,10 +3018,10 @@ void spell_RF6_S_MONSTER(player_type *target_ptr, POSITION y, POSITION x, MONSTE
        for (int k = 0; k < 1; k++)
        {
                if (mon_to_player)
-                       count += summon_specific(m_idx, y, x, rlev, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
+                       count += summon_specific(target_ptr, m_idx, y, x, rlev, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
 
                if (mon_to_mon)
-                       count += summon_specific(m_idx, y, x, rlev, 0, (monster_u_mode(floor_ptr, m_idx)));
+                       count += summon_specific(target_ptr, m_idx, y, x, rlev, 0, (monster_u_mode(floor_ptr, m_idx)));
        }
 
        if (target_ptr->blind && count && mon_to_player)
@@ -3052,10 +3058,10 @@ void spell_RF6_S_MONSTERS(player_type *target_ptr, POSITION y, POSITION x, MONST
        for (int k = 0; k < S_NUM_6; k++)
        {
                if (mon_to_player)
-                       count += summon_specific(m_idx, y, x, rlev, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
+                       count += summon_specific(target_ptr, m_idx, y, x, rlev, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
 
                if (mon_to_mon)
-                       count += summon_specific(m_idx, y, x, rlev, 0, (PM_ALLOW_GROUP | monster_u_mode(floor_ptr, m_idx)));
+                       count += summon_specific(target_ptr, m_idx, y, x, rlev, 0, (PM_ALLOW_GROUP | monster_u_mode(floor_ptr, m_idx)));
        }
 
        if (target_ptr->blind && count && mon_to_player)
@@ -3091,7 +3097,7 @@ void spell_RF6_S_ANT(player_type *target_ptr, POSITION y, POSITION x, MONSTER_ID
        bool mon_to_player = (TARGET_TYPE == MONSTER_TO_PLAYER);
        for (int k = 0; k < S_NUM_6; k++)
        {
-               count += summon_specific(m_idx, y, x, rlev, SUMMON_ANT, PM_ALLOW_GROUP);
+               count += summon_specific(target_ptr, m_idx, y, x, rlev, SUMMON_ANT, PM_ALLOW_GROUP);
        }
 
        if (target_ptr->blind && count && mon_to_player)
@@ -3127,7 +3133,7 @@ void spell_RF6_S_SPIDER(player_type *target_ptr, POSITION y, POSITION x, MONSTER
        DEPTH rlev = monster_level_idx(floor_ptr, m_idx);
        for (int k = 0; k < S_NUM_6; k++)
        {
-               count += summon_specific(m_idx, y, x, rlev, SUMMON_SPIDER, PM_ALLOW_GROUP);
+               count += summon_specific(target_ptr, m_idx, y, x, rlev, SUMMON_SPIDER, PM_ALLOW_GROUP);
        }
 
        if (target_ptr->blind && count && mon_to_player)
@@ -3163,7 +3169,7 @@ void spell_RF6_S_HOUND(player_type *target_ptr, POSITION y, POSITION x, MONSTER_
        bool mon_to_player = (TARGET_TYPE == MONSTER_TO_PLAYER);
        for (int k = 0; k < S_NUM_4; k++)
        {
-               count += summon_specific(m_idx, y, x, rlev, SUMMON_HOUND, PM_ALLOW_GROUP);
+               count += summon_specific(target_ptr, m_idx, y, x, rlev, SUMMON_HOUND, PM_ALLOW_GROUP);
        }
 
        if (target_ptr->blind && count && mon_to_player)
@@ -3199,7 +3205,7 @@ void spell_RF6_S_HYDRA(player_type *target_ptr, POSITION y, POSITION x, MONSTER_
        bool mon_to_player = (TARGET_TYPE == MONSTER_TO_PLAYER);
        for (int k = 0; k < S_NUM_4; k++)
        {
-               count += summon_specific(m_idx, y, x, rlev, SUMMON_HYDRA, PM_ALLOW_GROUP);
+               count += summon_specific(target_ptr, m_idx, y, x, rlev, SUMMON_HYDRA, PM_ALLOW_GROUP);
        }
 
        if (target_ptr->blind && count && mon_to_player)
@@ -3241,7 +3247,7 @@ void spell_RF6_S_ANGEL(player_type *target_ptr, POSITION y, POSITION x, MONSTER_
        int count = 0;
        for (int k = 0; k < num; k++)
        {
-               count += summon_specific(m_idx, y, x, rlev, SUMMON_ANGEL, PM_ALLOW_GROUP);
+               count += summon_specific(target_ptr, m_idx, y, x, rlev, SUMMON_ANGEL, PM_ALLOW_GROUP);
        }
 
        if (count < 2)
@@ -3284,7 +3290,7 @@ void spell_RF6_S_DEMON(player_type *target_ptr, POSITION y, POSITION x, MONSTER_
        int count = 0;
        for (int k = 0; k < 1; k++)
        {
-               count += summon_specific(m_idx, y, x, rlev, SUMMON_DEMON, PM_ALLOW_GROUP);
+               count += summon_specific(target_ptr, m_idx, y, x, rlev, SUMMON_DEMON, PM_ALLOW_GROUP);
        }
 
        if (target_ptr->blind && count)
@@ -3319,7 +3325,7 @@ void spell_RF6_S_UNDEAD(player_type *target_ptr, POSITION y, POSITION x, MONSTER
        int count = 0;
        for (int k = 0; k < 1; k++)
        {
-               count += summon_specific(m_idx, y, x, rlev, SUMMON_UNDEAD, PM_ALLOW_GROUP);
+               count += summon_specific(target_ptr, m_idx, y, x, rlev, SUMMON_UNDEAD, PM_ALLOW_GROUP);
        }
 
        if (target_ptr->blind && count)
@@ -3354,7 +3360,7 @@ void spell_RF6_S_DRAGON(player_type *target_ptr, POSITION y, POSITION x, MONSTER
        int count = 0;
        for (int k = 0; k < 1; k++)
        {
-               count += summon_specific(m_idx, y, x, rlev, SUMMON_DRAGON, PM_ALLOW_GROUP);
+               count += summon_specific(target_ptr, m_idx, y, x, rlev, SUMMON_DRAGON, PM_ALLOW_GROUP);
        }
 
        if (target_ptr->blind && count)
@@ -3407,7 +3413,7 @@ MONSTER_NUMBER summon_NAZGUL(player_type *target_ptr, POSITION y, POSITION x, MO
 
                if (!cave_empty_bold(floor_ptr, cy, cx)) continue;
 
-               if (!summon_named_creature(m_idx, cy, cx, MON_NAZGUL, mode)) continue;
+               if (!summon_named_creature(target_ptr, m_idx, cy, cx, MON_NAZGUL, mode)) continue;
 
                y = cy;
                x = cx;
@@ -3469,10 +3475,10 @@ void spell_RF6_S_HI_UNDEAD(player_type *target_ptr, POSITION y, POSITION x, MONS
                for (int k = 0; k < S_NUM_6; k++)
                {
                        if (mon_to_player)
-                               count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
+                               count += summon_specific(target_ptr, m_idx, y, x, rlev, SUMMON_HI_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
 
                        if (mon_to_mon)
-                               count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_UNDEAD, (PM_ALLOW_GROUP | monster_u_mode(floor_ptr, m_idx)));
+                               count += summon_specific(target_ptr, m_idx, y, x, rlev, SUMMON_HI_UNDEAD, (PM_ALLOW_GROUP | monster_u_mode(floor_ptr, m_idx)));
                }
        }
 
@@ -3511,10 +3517,10 @@ void spell_RF6_S_HI_DRAGON(player_type *target_ptr, POSITION y, POSITION x, MONS
        for (int k = 0; k < S_NUM_4; k++)
        {
                if (mon_to_player)
-                       count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_DRAGON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
+                       count += summon_specific(target_ptr, m_idx, y, x, rlev, SUMMON_HI_DRAGON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
 
                if (mon_to_mon)
-                       count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_DRAGON, (PM_ALLOW_GROUP | monster_u_mode(floor_ptr, m_idx)));
+                       count += summon_specific(target_ptr, m_idx, y, x, rlev, SUMMON_HI_DRAGON, (PM_ALLOW_GROUP | monster_u_mode(floor_ptr, m_idx)));
        }
 
        if (target_ptr->blind && count && mon_to_player)
@@ -3552,7 +3558,7 @@ void spell_RF6_S_AMBERITES(player_type *target_ptr, POSITION y, POSITION x, MONS
        bool mon_to_player = (TARGET_TYPE == MONSTER_TO_PLAYER);
        for (int k = 0; k < S_NUM_4; k++)
        {
-               count += summon_specific(m_idx, y, x, rlev, SUMMON_AMBERITES, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
+               count += summon_specific(target_ptr, m_idx, y, x, rlev, SUMMON_AMBERITES, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
        }
 
        if (target_ptr->blind && count && mon_to_player)
@@ -3592,7 +3598,7 @@ void spell_RF6_S_UNIQUE(player_type *target_ptr, POSITION y, POSITION x, MONSTER
        int count = 0;
        for (int k = 0; k < S_NUM_4; k++)
        {
-               count += summon_specific(m_idx, y, x, rlev, SUMMON_UNIQUE, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
+               count += summon_specific(target_ptr, m_idx, y, x, rlev, SUMMON_UNIQUE, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
        }
 
        if (count) uniques_are_summoned = TRUE;
@@ -3605,7 +3611,7 @@ void spell_RF6_S_UNIQUE(player_type *target_ptr, POSITION y, POSITION x, MONSTER
 
        for (int k = count; k < S_NUM_4; k++)
        {
-               count += summon_specific(m_idx, y, x, rlev, non_unique_type, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
+               count += summon_specific(target_ptr, m_idx, y, x, rlev, non_unique_type, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
        }
 
        if (target_ptr->blind && count && mon_to_player)
index 30ec028..2c3f0a7 100644 (file)
@@ -2213,7 +2213,7 @@ bool exe_mutation_power(player_type *creature_ptr, int power)
                                DIRECTION i;
                                for (i = 0; i < 8; i++)
                                {
-                                       summon_specific(-1, creature_ptr->y, creature_ptr->x, lvl, SUMMON_MOLD, PM_FORCE_PET);
+                                       summon_specific(creature_ptr, -1, creature_ptr->y, creature_ptr->x, lvl, SUMMON_MOLD, PM_FORCE_PET);
                                }
                        }
                        break;
index 25ec5e8..50a99d6 100644 (file)
@@ -387,7 +387,7 @@ void gain_level_reward(player_type *creature_ptr, int chosen_reward)
 
                        for (dummy = 0; dummy < randint1(5) + 1; dummy++)
                        {
-                               (void)summon_specific(0, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
+                               (void)summon_specific(creature_ptr, 0, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
                        }
                        reward = _("モンスターを召喚された。", "summoning hostile monsters");
                        break;
@@ -633,7 +633,7 @@ void gain_level_reward(player_type *creature_ptr, int chosen_reward)
 
                        msg_format(_("%sは褒美として悪魔の使いをよこした!", "%s rewards you with a demonic servant!"), chaos_patrons[creature_ptr->chaos_patron]);
 
-                       if (!summon_specific(-1, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, SUMMON_DEMON, PM_FORCE_PET))
+                       if (!summon_specific(creature_ptr, -1, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, SUMMON_DEMON, PM_FORCE_PET))
                                msg_print(_("何も現れなかった...", "Nobody ever turns up..."));
                        else
                                reward = _("悪魔がペットになった。", "a demonic servant");
@@ -643,7 +643,7 @@ void gain_level_reward(player_type *creature_ptr, int chosen_reward)
                case REW_SER_MONS:
                        msg_format(_("%sは褒美として使いをよこした!", "%s rewards you with a servant!"), chaos_patrons[creature_ptr->chaos_patron]);
 
-                       if (!summon_specific(-1, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, 0, PM_FORCE_PET))
+                       if (!summon_specific(creature_ptr, -1, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, 0, PM_FORCE_PET))
                                msg_print(_("何も現れなかった...", "Nobody ever turns up..."));
                        else
                                reward = _("モンスターがペットになった。", "a servant");
@@ -653,7 +653,7 @@ void gain_level_reward(player_type *creature_ptr, int chosen_reward)
                case REW_SER_UNDE:
                        msg_format(_("%sは褒美としてアンデッドの使いをよこした。", "%s rewards you with an undead servant!"), chaos_patrons[creature_ptr->chaos_patron]);
 
-                       if (!summon_specific(-1, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, SUMMON_UNDEAD, PM_FORCE_PET))
+                       if (!summon_specific(creature_ptr, -1, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, SUMMON_UNDEAD, PM_FORCE_PET))
                                msg_print(_("何も現れなかった...", "Nobody ever turns up..."));
                        else
                                reward = _("アンデッドがペットになった。", "an undead servant");
index 8aaae4e..38b99a7 100644 (file)
@@ -432,7 +432,7 @@ concptr do_arcane_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
                {
                        if (cast)
                        {
-                               if (!summon_specific(-1, caster_ptr->y, caster_ptr->x, plev, SUMMON_ELEMENTAL, (PM_ALLOW_GROUP | PM_FORCE_PET)))
+                               if (!summon_specific(caster_ptr, -1, caster_ptr->y, caster_ptr->x, plev, SUMMON_ELEMENTAL, (PM_ALLOW_GROUP | PM_FORCE_PET)))
                                {
                                        msg_print(_("エレメンタルは現れなかった。", "No Elementals arrive."));
                                }
index 335c2ec..143396c 100644 (file)
@@ -382,7 +382,7 @@ concptr do_craft_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
                {
                        if (cast)
                        {
-                               if (summon_specific(-1, caster_ptr->y, caster_ptr->x, plev, SUMMON_GOLEM, PM_FORCE_PET))
+                               if (summon_specific(caster_ptr, -1, caster_ptr->y, caster_ptr->x, plev, SUMMON_GOLEM, PM_FORCE_PET))
                                {
                                        msg_print(_("ゴーレムを作った。", "You make a golem."));
                                }
index c829ff3..b89ebb1 100644 (file)
@@ -403,7 +403,7 @@ concptr do_crusade_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mod
                                else flg |= PM_NO_PET;
                                if (!(pet && (plev < 50))) flg |= PM_ALLOW_GROUP;
 
-                               if (summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, (plev * 3) / 2, SUMMON_ANGEL, flg))
+                               if (summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x, (plev * 3) / 2, SUMMON_ANGEL, flg))
                                {
                                        if (pet)
                                        {
@@ -565,7 +565,7 @@ concptr do_crusade_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mod
                                                if (cave_empty_bold2(caster_ptr->current_floor_ptr, my, mx)) break;
                                        }
                                        if (attempt < 0) continue;
-                                       summon_specific(-1, my, mx, plev, SUMMON_KNIGHTS, (PM_ALLOW_GROUP | PM_FORCE_PET | PM_HASTE));
+                                       summon_specific(caster_ptr, -1, my, mx, plev, SUMMON_KNIGHTS, (PM_ALLOW_GROUP | PM_FORCE_PET | PM_HASTE));
                                }
                                set_hero(caster_ptr, randint1(base) + base, FALSE);
                                set_blessed(caster_ptr, randint1(base) + base, FALSE);
index b03388f..64fcd01 100644 (file)
@@ -147,7 +147,7 @@ concptr do_daemon_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
                {
                        if (cast)
                        {
-                               if (!summon_specific(-1, caster_ptr->y, caster_ptr->x, (plev * 3) / 2, SUMMON_MANES, (PM_ALLOW_GROUP | PM_FORCE_PET)))
+                               if (!summon_specific(caster_ptr, -1, caster_ptr->y, caster_ptr->x, (plev * 3) / 2, SUMMON_MANES, (PM_ALLOW_GROUP | PM_FORCE_PET)))
                                {
                                        msg_print(_("古代の死霊は現れなかった。", "No Manes arrive."));
                                }
index 37875df..3ff09fc 100644 (file)
@@ -303,7 +303,7 @@ concptr do_nature_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
                {
                        if (cast)
                        {
-                               if (!(summon_specific(-1, caster_ptr->y, caster_ptr->x, plev, SUMMON_ANIMAL_RANGER, (PM_ALLOW_GROUP | PM_FORCE_PET))))
+                               if (!(summon_specific(caster_ptr, -1, caster_ptr->y, caster_ptr->x, plev, SUMMON_ANIMAL_RANGER, (PM_ALLOW_GROUP | PM_FORCE_PET))))
                                {
                                        msg_print(_("動物は現れなかった。", "No animals arrive."));
                                }
index e3507c8..02743c1 100644 (file)
@@ -429,7 +429,7 @@ bool build_type5(player_type *player_ptr)
                        r_idx = nest_mon_info[i].r_idx;
 
                        /* Place that "random" monster (no groups) */
-                       (void)place_monster_aux(0, y, x, r_idx, 0L);
+                       (void)place_monster_aux(player_ptr, 0, y, x, r_idx, 0L);
 
                        nest_mon_info[i].used = TRUE;
                }
@@ -658,51 +658,51 @@ bool build_type6(player_type *player_ptr)
        /* Top and bottom rows */
        for (x = xval - 9; x <= xval + 9; x++)
        {
-               place_monster_aux(0, yval - 2, x, what[0], PM_NO_KAGE);
-               place_monster_aux(0, yval + 2, x, what[0], PM_NO_KAGE);
+               place_monster_aux(player_ptr, 0, yval - 2, x, what[0], PM_NO_KAGE);
+               place_monster_aux(player_ptr, 0, yval + 2, x, what[0], PM_NO_KAGE);
        }
 
        /* Middle columns */
        for (y = yval - 1; y <= yval + 1; y++)
        {
-               place_monster_aux(0, y, xval - 9, what[0], PM_NO_KAGE);
-               place_monster_aux(0, y, xval + 9, what[0], PM_NO_KAGE);
+               place_monster_aux(player_ptr, 0, y, xval - 9, what[0], PM_NO_KAGE);
+               place_monster_aux(player_ptr, 0, y, xval + 9, what[0], PM_NO_KAGE);
 
-               place_monster_aux(0, y, xval - 8, what[1], PM_NO_KAGE);
-               place_monster_aux(0, y, xval + 8, what[1], PM_NO_KAGE);
+               place_monster_aux(player_ptr, 0, y, xval - 8, what[1], PM_NO_KAGE);
+               place_monster_aux(player_ptr, 0, y, xval + 8, what[1], PM_NO_KAGE);
 
-               place_monster_aux(0, y, xval - 7, what[1], PM_NO_KAGE);
-               place_monster_aux(0, y, xval + 7, what[1], PM_NO_KAGE);
+               place_monster_aux(player_ptr, 0, y, xval - 7, what[1], PM_NO_KAGE);
+               place_monster_aux(player_ptr, 0, y, xval + 7, what[1], PM_NO_KAGE);
 
-               place_monster_aux(0, y, xval - 6, what[2], PM_NO_KAGE);
-               place_monster_aux(0, y, xval + 6, what[2], PM_NO_KAGE);
+               place_monster_aux(player_ptr, 0, y, xval - 6, what[2], PM_NO_KAGE);
+               place_monster_aux(player_ptr, 0, y, xval + 6, what[2], PM_NO_KAGE);
 
-               place_monster_aux(0, y, xval - 5, what[2], PM_NO_KAGE);
-               place_monster_aux(0, y, xval + 5, what[2], PM_NO_KAGE);
+               place_monster_aux(player_ptr, 0, y, xval - 5, what[2], PM_NO_KAGE);
+               place_monster_aux(player_ptr, 0, y, xval + 5, what[2], PM_NO_KAGE);
 
-               place_monster_aux(0, y, xval - 4, what[3], PM_NO_KAGE);
-               place_monster_aux(0, y, xval + 4, what[3], PM_NO_KAGE);
+               place_monster_aux(player_ptr, 0, y, xval - 4, what[3], PM_NO_KAGE);
+               place_monster_aux(player_ptr, 0, y, xval + 4, what[3], PM_NO_KAGE);
 
-               place_monster_aux(0, y, xval - 3, what[3], PM_NO_KAGE);
-               place_monster_aux(0, y, xval + 3, what[3], PM_NO_KAGE);
+               place_monster_aux(player_ptr, 0, y, xval - 3, what[3], PM_NO_KAGE);
+               place_monster_aux(player_ptr, 0, y, xval + 3, what[3], PM_NO_KAGE);
 
-               place_monster_aux(0, y, xval - 2, what[4], PM_NO_KAGE);
-               place_monster_aux(0, y, xval + 2, what[4], PM_NO_KAGE);
+               place_monster_aux(player_ptr, 0, y, xval - 2, what[4], PM_NO_KAGE);
+               place_monster_aux(player_ptr, 0, y, xval + 2, what[4], PM_NO_KAGE);
        }
 
        /* Above/Below the center monster */
        for (x = xval - 1; x <= xval + 1; x++)
        {
-               place_monster_aux(0, yval + 1, x, what[5], PM_NO_KAGE);
-               place_monster_aux(0, yval - 1, x, what[5], PM_NO_KAGE);
+               place_monster_aux(player_ptr, 0, yval + 1, x, what[5], PM_NO_KAGE);
+               place_monster_aux(player_ptr, 0, yval - 1, x, what[5], PM_NO_KAGE);
        }
 
        /* Next to the center monster */
-       place_monster_aux(0, yval, xval + 1, what[6], PM_NO_KAGE);
-       place_monster_aux(0, yval, xval - 1, what[6], PM_NO_KAGE);
+       place_monster_aux(player_ptr, 0, yval, xval + 1, what[6], PM_NO_KAGE);
+       place_monster_aux(player_ptr, 0, yval, xval - 1, what[6], PM_NO_KAGE);
 
        /* Center monster */
-       place_monster_aux(0, yval, xval, what[7], PM_NO_KAGE);
+       place_monster_aux(player_ptr, 0, yval, xval, what[7], PM_NO_KAGE);
 
        return TRUE;
 }
@@ -770,7 +770,7 @@ static bool vault_aux_trapped_pit(MONRACE_IDX r_idx)
 *\n
 * Note that "monster pits" will never contain "unique" monsters.\n
 */
-bool build_type13(floor_type *floor_ptr)
+bool build_type13(player_type *player_ptr)
 {
        static int placing[][3] = {
                { -2, -9, 0 },{ -2, -8, 0 },{ -3, -7, 0 },{ -3, -6, 0 },
@@ -810,6 +810,7 @@ bool build_type13(floor_type *floor_ptr)
 
        grid_type *g_ptr;
 
+       floor_type *floor_ptr = player_ptr->current_floor_ptr;
        int cur_pit_type = pick_vault_type(floor_ptr, pit_types, d_info[floor_ptr->dungeon_idx].pit);
        vault_aux_type *n_ptr;
 
@@ -1001,7 +1002,7 @@ bool build_type13(floor_type *floor_ptr)
        {
                y = yval + placing[i][0];
                x = xval + placing[i][1];
-               place_monster_aux(0, y, x, what[placing[i][2]], PM_NO_KAGE);
+               place_monster_aux(player_ptr, 0, y, x, what[placing[i][2]], PM_NO_KAGE);
        }
 
        return TRUE;
index 7c9547a..3795c45 100644 (file)
@@ -9,4 +9,4 @@ nest_mon_info_type;
 
 extern bool build_type5(player_type *player_ptr);
 extern bool build_type6(player_type *player_ptr);
-extern bool build_type13(floor_type *floor_ptr);
+extern bool build_type13(player_type *player_ptr);
index 8aecef3..79b0d0d 100644 (file)
@@ -89,7 +89,7 @@ bool build_type15(player_type *player_ptr)
 
                        y = yval + 2 * ddy_ddd[dir1];
                        x = xval + 2 * ddx_ddd[dir1];
-                       if (r_idx) place_monster_aux(0, y, x, r_idx, PM_ALLOW_SLEEP);
+                       if (r_idx) place_monster_aux(player_ptr, 0, y, x, r_idx, PM_ALLOW_SLEEP);
 
                        /* Walls around the breather */
                        for (dir2 = 0; dir2 < 8; dir2++)
@@ -150,7 +150,7 @@ bool build_type15(player_type *player_ptr)
                get_mon_num_prep(vault_aux_lite, NULL);
 
                r_idx = get_mon_num(floor_ptr->dun_level);
-               if (r_idx) place_monster_aux(0, yval, xval, r_idx, 0L);
+               if (r_idx) place_monster_aux(player_ptr, 0, yval, xval, r_idx, 0L);
 
                /* Walls around the breather */
                for (dir1 = 0; dir1 < 8; dir1++)
@@ -216,7 +216,7 @@ bool build_type15(player_type *player_ptr)
 
                        y = yval + ddy_ddd[dir1];
                        x = xval + ddx_ddd[dir1];
-                       if (r_idx) place_monster_aux(0, y, x, r_idx, 0L);
+                       if (r_idx) place_monster_aux(player_ptr, 0, y, x, r_idx, 0L);
                }
 
                /* Place two potions */
index fdcf8aa..92e3455 100644 (file)
@@ -574,7 +574,7 @@ static void build_vault(player_type *player_ptr, POSITION yval, POSITION xval, P
                                case '&':
                                {
                                        floor_ptr->monster_level = floor_ptr->base_level + 5;
-                                       place_monster(y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
+                                       place_monster(player_ptr, y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
                                        floor_ptr->monster_level = floor_ptr->base_level;
                                        break;
                                }
@@ -583,7 +583,7 @@ static void build_vault(player_type *player_ptr, POSITION yval, POSITION xval, P
                                case '@':
                                {
                                        floor_ptr->monster_level = floor_ptr->base_level + 11;
-                                       place_monster(y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
+                                       place_monster(player_ptr, y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
                                        floor_ptr->monster_level = floor_ptr->base_level;
                                        break;
                                }
@@ -592,7 +592,7 @@ static void build_vault(player_type *player_ptr, POSITION yval, POSITION xval, P
                                case '9':
                                {
                                        floor_ptr->monster_level = floor_ptr->base_level + 9;
-                                       place_monster(y, x, PM_ALLOW_SLEEP);
+                                       place_monster(player_ptr, y, x, PM_ALLOW_SLEEP);
                                        floor_ptr->monster_level = floor_ptr->base_level;
                                        floor_ptr->object_level = floor_ptr->base_level + 7;
                                        place_object(player_ptr, y, x, AM_GOOD);
@@ -604,7 +604,7 @@ static void build_vault(player_type *player_ptr, POSITION yval, POSITION xval, P
                                case '8':
                                {
                                        floor_ptr->monster_level = floor_ptr->base_level + 40;
-                                       place_monster(y, x, PM_ALLOW_SLEEP);
+                                       place_monster(player_ptr, y, x, PM_ALLOW_SLEEP);
                                        floor_ptr->monster_level = floor_ptr->base_level;
                                        floor_ptr->object_level = floor_ptr->base_level + 20;
                                        place_object(player_ptr, y, x, AM_GOOD | AM_GREAT);
@@ -618,7 +618,7 @@ static void build_vault(player_type *player_ptr, POSITION yval, POSITION xval, P
                                        if (randint0(100) < 50)
                                        {
                                                floor_ptr->monster_level = floor_ptr->base_level + 3;
-                                               place_monster(y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
+                                               place_monster(player_ptr, y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
                                                floor_ptr->monster_level = floor_ptr->base_level;
                                        }
                                        if (randint0(100) < 50)
index 7e73ef0..de075b3 100644 (file)
@@ -1383,7 +1383,7 @@ void fill_treasure(player_type *player_ptr, POSITION x1, POSITION x2, POSITION y
                                {
                                        /* Meanest monster + treasure */
                                        floor_ptr->monster_level = floor_ptr->base_level + 40;
-                                       place_monster(y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
+                                       place_monster(player_ptr, y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
                                        floor_ptr->monster_level = floor_ptr->base_level;
                                        floor_ptr->object_level = floor_ptr->base_level + 20;
                                        place_object(player_ptr, y, x, AM_GOOD);
@@ -1393,7 +1393,7 @@ void fill_treasure(player_type *player_ptr, POSITION x1, POSITION x2, POSITION y
                                {
                                        /* Mean monster +treasure */
                                        floor_ptr->monster_level = floor_ptr->base_level + 20;
-                                       place_monster(y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
+                                       place_monster(player_ptr, y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
                                        floor_ptr->monster_level = floor_ptr->base_level;
                                        floor_ptr->object_level = floor_ptr->base_level + 10;
                                        place_object(player_ptr, y, x, AM_GOOD);
@@ -1402,7 +1402,7 @@ void fill_treasure(player_type *player_ptr, POSITION x1, POSITION x2, POSITION y
                                else if (value < 10)
                                {
                                        floor_ptr->monster_level = floor_ptr->base_level + 9;
-                                       place_monster(y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
+                                       place_monster(player_ptr, y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
                                        floor_ptr->monster_level = floor_ptr->base_level;
                                }
                                else if (value < 17)
@@ -1432,7 +1432,7 @@ void fill_treasure(player_type *player_ptr, POSITION x1, POSITION x2, POSITION y
                                {
                                        /* Monster and trap */
                                        floor_ptr->monster_level = floor_ptr->base_level + 5;
-                                       place_monster(y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
+                                       place_monster(player_ptr, y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
                                        floor_ptr->monster_level = floor_ptr->base_level;
                                        place_trap(player_ptr, y, x);
                                }
@@ -1442,7 +1442,7 @@ void fill_treasure(player_type *player_ptr, POSITION x1, POSITION x2, POSITION y
                                        if (randint0(100) < 50)
                                        {
                                                floor_ptr->monster_level = floor_ptr->base_level + 3;
-                                               place_monster(y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
+                                               place_monster(player_ptr, y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
                                                floor_ptr->monster_level = floor_ptr->base_level;
                                        }
                                        if (randint0(100) < 50)
@@ -1464,7 +1464,7 @@ void fill_treasure(player_type *player_ptr, POSITION x1, POSITION x2, POSITION y
                                        /* 20% monster, 40% trap, 20% object, 20% blank space */
                                        if (randint0(100) < 20)
                                        {
-                                               place_monster(y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
+                                               place_monster(player_ptr, y, x, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
                                        }
                                        else if (randint0(100) < 50)
                                        {
@@ -2070,7 +2070,7 @@ static bool room_build(player_type *player_ptr, EFFECT_ID typ)
        case ROOM_T_RANDOM_VAULT:  return build_type10(player_ptr);
        case ROOM_T_OVAL:          return build_type11(floor_ptr);
        case ROOM_T_CRYPT:         return build_type12(player_ptr);
-       case ROOM_T_TRAP_PIT:      return build_type13(floor_ptr);
+       case ROOM_T_TRAP_PIT:      return build_type13(player_ptr);
        case ROOM_T_TRAP:          return build_type14(floor_ptr);
        case ROOM_T_GLASS:         return build_type15(player_ptr);
        case ROOM_T_ARCADE:        return build_type16(player_ptr);
index ce409e5..27e5f94 100644 (file)
@@ -53,7 +53,7 @@ bool trump_summoning(player_type *caster_ptr, int num, bool pet, POSITION y, POS
        bool success = FALSE;
        for (int i = 0; i < num; i++)
        {
-               if (summon_specific(who, y, x, lev, type, mode))
+               if (summon_specific(caster_ptr, who, y, x, lev, type, mode))
                        success = TRUE;
        }
 
@@ -74,7 +74,7 @@ bool cast_summon_demon(player_type *caster_ptr, int power)
        else flg |= PM_NO_PET;
        if (!(pet && (caster_ptr->lev < 50))) flg |= PM_ALLOW_GROUP;
 
-       if (!summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, power, SUMMON_DEMON, flg))
+       if (!summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x, power, SUMMON_DEMON, flg))
                return TRUE;
 
        msg_print(_("硫黄の悪臭が充満した。", "The area fills with a stench of sulphur and brimstone."));
@@ -101,7 +101,7 @@ bool cast_summon_undead(player_type *creature_ptr, int power)
        if (pet) mode |= PM_FORCE_PET;
        else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
 
-       if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, power, type, mode))
+       if (summon_specific(creature_ptr, (pet ? -1 : 0), creature_ptr->y, creature_ptr->x, power, type, mode))
        {
                msg_print(_("冷たい風があなたの周りに吹き始めた。それは腐敗臭を運んでいる...",
                        "Cold winds begin to blow around you, carrying with them the stench of decay..."));
@@ -123,7 +123,7 @@ bool cast_summon_hound(player_type *creature_ptr, int power)
        if (pet) mode |= PM_FORCE_PET;
        else mode |= PM_NO_PET;
 
-       if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, power, SUMMON_HOUND, mode))
+       if (summon_specific(creature_ptr, (pet ? -1 : 0), creature_ptr->y, creature_ptr->x, power, SUMMON_HOUND, mode))
        {
                if (pet)
                        msg_print(_("ハウンドがあなたの下僕として出現した。", "A group of hounds appear as your servant."));
@@ -143,7 +143,7 @@ bool cast_summon_elemental(player_type *creature_ptr, int power)
        if (pet) mode |= PM_FORCE_PET;
        else mode |= PM_NO_PET;
 
-       if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, power, SUMMON_ELEMENTAL, mode))
+       if (summon_specific(creature_ptr, (pet ? -1 : 0), creature_ptr->y, creature_ptr->x, power, SUMMON_ELEMENTAL, mode))
        {
                msg_print(_("エレメンタルが現れた...", "An elemental materializes..."));
                if (pet)
@@ -161,7 +161,7 @@ bool cast_summon_octopus(player_type *creature_ptr)
        BIT_FLAGS mode = PM_ALLOW_GROUP;
        bool pet = !one_in_(5);
        if (pet) mode |= PM_FORCE_PET;
-       if (summon_named_creature(0, creature_ptr->y, creature_ptr->x, MON_JIZOTAKO, mode))
+       if (summon_named_creature(creature_ptr, 0, creature_ptr->y, creature_ptr->x, MON_JIZOTAKO, mode))
        {
                if (pet)
                        msg_print(_("蛸があなたの下僕として出現した。", "A group of octopuses appear as your servant."));
@@ -204,7 +204,7 @@ bool cast_summon_greater_demon(player_type *caster_ptr)
        PLAYER_LEVEL plev = caster_ptr->lev;
        int summon_lev = plev * 2 / 3 + r_info[o_ptr->pval].level;
 
-       if (summon_specific(-1, caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_HI_DEMON, (PM_ALLOW_GROUP | PM_FORCE_PET)))
+       if (summon_specific(caster_ptr, -1, caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_HI_DEMON, (PM_ALLOW_GROUP | PM_FORCE_PET)))
        {
                msg_print(_("硫黄の悪臭が充満した。", "The area fills with a stench of sulphur and brimstone."));
                msg_print(_("「ご用でございますか、ご主人様」", "'What is thy bidding... Master?'"));
@@ -221,31 +221,34 @@ bool cast_summon_greater_demon(player_type *caster_ptr)
 
 /*!
  * @brief 同族召喚(援軍)処理
+ * @param player_ptr プレーヤーへの参照ポインタ
  * @param level 召喚基準レベル
  * @param y 召喚先Y座標
  * @param x 召喚先X座標
  * @param mode 召喚オプション
  * @return ターンを消費した場合TRUEを返す
  */
-bool summon_kin_player(DEPTH level, POSITION y, POSITION x, BIT_FLAGS mode)
+bool summon_kin_player(player_type *creature_ptr, DEPTH level, POSITION y, POSITION x, BIT_FLAGS mode)
 {
        bool pet = (bool)(mode & PM_FORCE_PET);
        if (!pet) mode |= PM_NO_PET;
-       return summon_specific((pet ? -1 : 0), y, x, level, SUMMON_KIN, mode);
+       return summon_specific(creature_ptr, (pet ? -1 : 0), y, x, level, SUMMON_KIN, mode);
 }
 
 
 /*!
  * @brief サイバーデーモンの召喚
+ * @param player_ptr プレーヤーへの参照ポインタ
  * @param who 召喚主のモンスターID(0ならばプレイヤー)
  * @param y 召喚位置Y座標
  * @param x 召喚位置X座標
  * @return 作用が実際にあった場合TRUEを返す
  */
-int summon_cyber(floor_type *floor_ptr, MONSTER_IDX who, POSITION y, POSITION x)
+int summon_cyber(player_type *creature_ptr, MONSTER_IDX who, POSITION y, POSITION x)
 {
        /* Summoned by a monster */
        BIT_FLAGS mode = PM_ALLOW_GROUP;
+       floor_type *floor_ptr = creature_ptr->current_floor_ptr;
        if (who > 0)
        {
                monster_type *m_ptr = &floor_ptr->m_list[who];
@@ -258,7 +261,7 @@ int summon_cyber(floor_type *floor_ptr, MONSTER_IDX who, POSITION y, POSITION x)
        int count = 0;
        for (int i = 0; i < max_cyber; i++)
        {
-               count += summon_specific(who, y, x, 100, SUMMON_CYBER, mode);
+               count += summon_specific(creature_ptr, who, y, x, 100, SUMMON_CYBER, mode);
        }
 
        return count;
@@ -269,14 +272,14 @@ void mitokohmon(player_type *kohmon_ptr)
 {
        int count = 0;
        concptr sukekakusan = "";
-       if (summon_named_creature(0, kohmon_ptr->y, kohmon_ptr->x, MON_SUKE, PM_FORCE_PET))
+       if (summon_named_creature(kohmon_ptr, 0, kohmon_ptr->y, kohmon_ptr->x, MON_SUKE, PM_FORCE_PET))
        {
                msg_print(_("『助さん』が現れた。", "Suke-san apperars."));
                sukekakusan = "Suke-san";
                count++;
        }
 
-       if (summon_named_creature(0, kohmon_ptr->y, kohmon_ptr->x, MON_KAKU, PM_FORCE_PET))
+       if (summon_named_creature(kohmon_ptr, 0, kohmon_ptr->y, kohmon_ptr->x, MON_KAKU, PM_FORCE_PET))
        {
                msg_print(_("『格さん』が現れた。", "Kaku-san appears."));
                sukekakusan = "Kaku-san";
index 235f949..9c05db8 100644 (file)
@@ -53,9 +53,6 @@
 #define SUMMON_ARMAGE_GOOD          66 /*!< 召喚タイプ: ハルマゲドン・トラップ用天使陣営 */
 #define SUMMON_ARMAGE_EVIL          67 /*!< 召喚タイプ: ハルマゲドン・トラップ用悪魔陣営 */
 
-extern bool summon_specific(MONSTER_IDX who, POSITION y1, POSITION x1, DEPTH lev, int type, BIT_FLAGS mode);
-extern bool summon_named_creature(MONSTER_IDX who, POSITION oy, POSITION ox, MONRACE_IDX r_idx, BIT_FLAGS mode);
-
 extern bool trump_summoning(player_type *caster_ptr, int num, bool pet, POSITION y, POSITION x, DEPTH lev, int type, BIT_FLAGS mode);
 extern bool cast_summon_demon(player_type *creature_ptr, int power);
 extern bool cast_summon_undead(player_type *creature_ptr, int power);
@@ -64,7 +61,7 @@ extern bool cast_summon_elemental(player_type *creature_ptr, int power);
 extern bool cast_summon_octopus(player_type *creature_ptr);
 extern bool item_tester_offer(object_type *o_ptr);
 extern bool cast_summon_greater_demon(player_type *caster_ptr);
-extern bool summon_kin_player(DEPTH level, POSITION y, POSITION x, BIT_FLAGS mode);
-extern int summon_cyber(floor_type *floor_ptr, MONSTER_IDX who, POSITION y, POSITION x);
+extern bool summon_kin_player(player_type *creature_ptr, DEPTH level, POSITION y, POSITION x, BIT_FLAGS mode);
+extern int summon_cyber(player_type *creature_ptr, MONSTER_IDX who, POSITION y, POSITION x);
 
 extern void mitokohmon(player_type *kohmon_ptr);
index e91dc6a..2ed7760 100644 (file)
@@ -1005,7 +1005,7 @@ static bool project_o(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSI
                                                }
                                                continue;
                                        }
-                                       else if (summon_named_creature(who, y, x, o_ptr->pval, mode))
+                                       else if (summon_named_creature(caster_ptr, who, y, x, o_ptr->pval, mode))
                                        {
                                                note_kill = _("生き返った。", " revived.");
                                        }
@@ -1977,7 +1977,7 @@ static bool project_m(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSI
                                if (!common_saving_throw_charm(caster_ptr, dam, m_ptr))
                                {
                                        note = _("があなたに隷属した。", " is in your thrall!");
-                                       set_pet(m_ptr);
+                                       set_pet(caster_ptr, m_ptr);
                                }
                                else
                                {
@@ -2110,7 +2110,7 @@ static bool project_m(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSI
                                m_ptr->hp = m_ptr->maxhp;
 
                                /* Attempt to clone. */
-                               if (multiply_monster(g_ptr->m_idx, TRUE, 0L))
+                               if (multiply_monster(caster_ptr, g_ptr->m_idx, TRUE, 0L))
                                {
                                        note = _("が分裂した!", " spawns!");
                                }
@@ -2385,7 +2385,7 @@ static bool project_m(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSI
                        else
                        {
                                note = _("は突然友好的になったようだ!", " suddenly seems friendly!");
-                               set_pet(m_ptr);
+                               set_pet(caster_ptr, m_ptr);
 
                                chg_virtue(caster_ptr, V_INDIVIDUALISM, -1);
                                if (r_ptr->flags3 & RF3_ANIMAL)
@@ -2432,7 +2432,7 @@ static bool project_m(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSI
                        else
                        {
                                note = _("は既にあなたの奴隷だ!", " is in your thrall!");
-                               set_pet(m_ptr);
+                               set_pet(caster_ptr, m_ptr);
                        }
 
                        /* No "real" damage */
@@ -2475,7 +2475,7 @@ static bool project_m(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSI
                        else
                        {
                                note = _("は既にあなたの奴隷だ!", " is in your thrall!");
-                               set_pet(m_ptr);
+                               set_pet(caster_ptr, m_ptr);
                        }
 
                        /* No "real" damage */
@@ -2519,7 +2519,7 @@ static bool project_m(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSI
                        else
                        {
                                note = _("はなついた。", " is tamed!");
-                               set_pet(m_ptr);
+                               set_pet(caster_ptr, m_ptr);
                                if (r_ptr->flags3 & RF3_ANIMAL)
                                        chg_virtue(caster_ptr, V_NATURE, 1);
                        }
@@ -2569,7 +2569,7 @@ static bool project_m(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSI
                        else
                        {
                                note = _("を支配した。", " is tamed!");
-                               set_pet(m_ptr);
+                               set_pet(caster_ptr, m_ptr);
                                if (r_ptr->flags3 & RF3_ANIMAL)
                                        chg_virtue(caster_ptr, V_NATURE, 1);
                        }
@@ -3563,7 +3563,7 @@ static bool project_m(player_type *caster_ptr, MONSTER_IDX who, POSITION r, POSI
                                else
                                {
                                        note = _("を支配した。", " is tamed!");
-                                       set_pet(m_ptr);
+                                       set_pet(caster_ptr, m_ptr);
                                        (void)set_monster_fast(caster_ptr, g_ptr->m_idx, MON_FAST(m_ptr) + 100);
 
                                        /* Learn about type */
index b2956aa..92cd601 100644 (file)
@@ -2645,7 +2645,7 @@ bool activate_ty_curse(player_type *target_ptr, bool stop_ty, int *count)
                        (*count) += activate_hi_summon(target_ptr, target_ptr->y, target_ptr->x, FALSE);
                        if (!one_in_(6)) break;
                case 7: case 8: case 9: case 18:
-                       (*count) += summon_specific(0, target_ptr->y, target_ptr->x, floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
+                       (*count) += summon_specific(target_ptr, 0, target_ptr->y, target_ptr->x, floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
                        if (!one_in_(6)) break;
                case 10: case 11: case 12:
                        msg_print(_("経験値が体から吸い取られた気がする!", "You feel your experience draining away..."));
@@ -2677,7 +2677,7 @@ bool activate_ty_curse(player_type *target_ptr, bool stop_ty, int *count)
                case 25:
                        if ((floor_ptr->dun_level > 65) && !stop_ty)
                        {
-                               (*count) += summon_cyber(floor_ptr, -1, target_ptr->y, target_ptr->x);
+                               (*count) += summon_cyber(target_ptr, -1, target_ptr->y, target_ptr->x);
                                stop_ty = TRUE;
                                break;
                        }
@@ -2737,51 +2737,51 @@ int activate_hi_summon(player_type *caster_ptr, POSITION y, POSITION x, bool can
                switch (randint1(25) + (dungeon_level / 20))
                {
                case 1: case 2:
-                       count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_ANT, mode);
+                       count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, summon_lev, SUMMON_ANT, mode);
                        break;
                case 3: case 4:
-                       count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_SPIDER, mode);
+                       count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, summon_lev, SUMMON_SPIDER, mode);
                        break;
                case 5: case 6:
-                       count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HOUND, mode);
+                       count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, summon_lev, SUMMON_HOUND, mode);
                        break;
                case 7: case 8:
-                       count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HYDRA, mode);
+                       count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, summon_lev, SUMMON_HYDRA, mode);
                        break;
                case 9: case 10:
-                       count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_ANGEL, mode);
+                       count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, summon_lev, SUMMON_ANGEL, mode);
                        break;
                case 11: case 12:
-                       count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_UNDEAD, mode);
+                       count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, summon_lev, SUMMON_UNDEAD, mode);
                        break;
                case 13: case 14:
-                       count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_DRAGON, mode);
+                       count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, summon_lev, SUMMON_DRAGON, mode);
                        break;
                case 15: case 16:
-                       count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_DEMON, mode);
+                       count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, summon_lev, SUMMON_DEMON, mode);
                        break;
                case 17:
                        if (can_pet) break;
-                       count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_AMBERITES, (mode | PM_ALLOW_UNIQUE));
+                       count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, summon_lev, SUMMON_AMBERITES, (mode | PM_ALLOW_UNIQUE));
                        break;
                case 18: case 19:
                        if (can_pet) break;
-                       count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_UNIQUE, (mode | PM_ALLOW_UNIQUE));
+                       count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, summon_lev, SUMMON_UNIQUE, (mode | PM_ALLOW_UNIQUE));
                        break;
                case 20: case 21:
                        if (!can_pet) mode |= PM_ALLOW_UNIQUE;
-                       count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HI_UNDEAD, mode);
+                       count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, summon_lev, SUMMON_HI_UNDEAD, mode);
                        break;
                case 22: case 23:
                        if (!can_pet) mode |= PM_ALLOW_UNIQUE;
-                       count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HI_DRAGON, mode);
+                       count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, summon_lev, SUMMON_HI_DRAGON, mode);
                        break;
                case 24:
-                       count += summon_specific((pet ? -1 : 0), y, x, 100, SUMMON_CYBER, mode);
+                       count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, 100, SUMMON_CYBER, mode);
                        break;
                default:
                        if (!can_pet) mode |= PM_ALLOW_UNIQUE;
-                       count += summon_specific((pet ? -1 : 0), y, x, pet ? summon_lev : (((summon_lev * 3) / 2) + 5), 0, mode);
+                       count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, pet ? summon_lev : (((summon_lev * 3) / 2) + 5), 0, mode);
                }
        }
 
@@ -3336,7 +3336,7 @@ void wild_magic(player_type *caster_ptr, int spell)
        case 35:
                for (int counter = 0; counter < 8; counter++)
                {
-                       (void)summon_specific(0, caster_ptr->y, caster_ptr->x, (floor_ptr->dun_level * 3) / 2, type, (PM_ALLOW_GROUP | PM_NO_PET));
+                       (void)summon_specific(caster_ptr, 0, caster_ptr->y, caster_ptr->x, (floor_ptr->dun_level * 3) / 2, type, (PM_ALLOW_GROUP | PM_NO_PET));
                }
 
                break;
@@ -3345,7 +3345,7 @@ void wild_magic(player_type *caster_ptr, int spell)
                activate_hi_summon(caster_ptr, caster_ptr->y, caster_ptr->x, FALSE);
                break;
        case 38:
-               (void)summon_cyber(floor_ptr, -1, caster_ptr->y, caster_ptr->x);
+               (void)summon_cyber(caster_ptr, -1, caster_ptr->y, caster_ptr->x);
                break;
        default:
        {
@@ -3710,7 +3710,7 @@ void cast_invoke_spirits(player_type *caster_ptr, DIRECTION dir)
                msg_print(_("なんてこった!あなたの周りの地面から朽ちた人影が立ち上がってきた!",
                        "Oh no! Mouldering forms rise from the earth around you!"));
 
-               (void)summon_specific(0, caster_ptr->y, caster_ptr->x, caster_ptr->current_floor_ptr->dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
+               (void)summon_specific(caster_ptr, 0, caster_ptr->y, caster_ptr->x, caster_ptr->current_floor_ptr->dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
                chg_virtue(caster_ptr, V_UNLIFE, 1);
        }
        else if (die < 14)
@@ -3878,7 +3878,7 @@ void cast_shuffle(player_type *caster_ptr)
        if (die < 14)
        {
                msg_print(_("なんてこった!《悪魔》だ!", "Oh no! It's the Devil!"));
-               summon_specific(0, caster_ptr->y, caster_ptr->x, floor_ptr->dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
+               summon_specific(caster_ptr, 0, caster_ptr->y, caster_ptr->x, floor_ptr->dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
                return;
        }
        
@@ -4660,7 +4660,7 @@ bool rodeo(player_type *creature_ptr)
                && (rlev < creature_ptr->lev * 3 / 2 + randint0(creature_ptr->lev / 5)))
        {
                msg_format(_("%sを手なずけた。", "You tame %s."), m_name);
-               set_pet(m_ptr);
+               set_pet(creature_ptr, m_ptr);
        }
        else
        {
index 51443c9..be292e1 100644 (file)
@@ -2761,7 +2761,7 @@ bool polymorph_monster(player_type *caster_ptr, POSITION y, POSITION x)
 
        /* Create a new monster (no groups) */
        bool polymorphed = FALSE;
-       if (place_monster_aux(0, y, x, new_r_idx, mode))
+       if (place_monster_aux(caster_ptr, 0, y, x, new_r_idx, mode))
        {
                floor_ptr->m_list[hack_m_idx_ii].nickname = back_m.nickname;
                floor_ptr->m_list[hack_m_idx_ii].parent_m_idx = back_m.parent_m_idx;
@@ -2773,7 +2773,7 @@ bool polymorph_monster(player_type *caster_ptr, POSITION y, POSITION x)
        else
        {
                /* Placing the new monster failed */
-               if (place_monster_aux(0, y, x, old_r_idx, (mode | PM_NO_KAGE | PM_IGNORE_TERRAIN)))
+               if (place_monster_aux(caster_ptr, 0, y, x, old_r_idx, (mode | PM_NO_KAGE | PM_IGNORE_TERRAIN)))
                {
                        floor_ptr->m_list[hack_m_idx_ii] = back_m;
 
@@ -3343,7 +3343,7 @@ void blood_curse_to_enemy(player_type *caster_ptr, MONSTER_IDX m_idx)
                        if (pet) mode |= PM_FORCE_PET;
                        else mode |= (PM_NO_PET | PM_FORCE_FRIENDLY);
 
-                       count += summon_specific((pet ? -1 : 0), caster_ptr->y, caster_ptr->x, (pet ? caster_ptr->lev * 2 / 3 + randint1(caster_ptr->lev / 2) : caster_ptr->current_floor_ptr->dun_level), 0, mode);
+                       count += summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x, (pet ? caster_ptr->lev * 2 / 3 + randint1(caster_ptr->lev / 2) : caster_ptr->current_floor_ptr->dun_level), 0, mode);
                        if (!one_in_(6)) break;
                }
                case 23: case 24: case 25:
index a2eb0b9..3059c66 100644 (file)
@@ -469,7 +469,7 @@ void hit_trap(player_type *trapped_ptr, bool break_trap)
                num = 2 + randint1(3);
                for (i = 0; i < num; i++)
                {
-                       (void)summon_specific(0, y, x, trapped_ptr->current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
+                       (void)summon_specific(trapped_ptr, 0, y, x, trapped_ptr->current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
                }
 
                if (trapped_ptr->current_floor_ptr->dun_level > randint1(100)) /* No nasty effect for low levels */
@@ -630,10 +630,10 @@ void hit_trap(player_type *trapped_ptr, bool break_trap)
                                /* Require line of projection */
                                if (!projectable(trapped_ptr, trapped_ptr->y, trapped_ptr->x, y1, x1)) continue;
 
-                               if (summon_specific(0, y1, x1, lev, SUMMON_ARMAGE_EVIL, (PM_NO_PET)))
+                               if (summon_specific(trapped_ptr, 0, y1, x1, lev, SUMMON_ARMAGE_EVIL, (PM_NO_PET)))
                                        evil_idx = hack_m_idx_ii;
 
-                               if (summon_specific(0, y1, x1, lev, SUMMON_ARMAGE_GOOD, (PM_NO_PET)))
+                               if (summon_specific(trapped_ptr, 0, y1, x1, lev, SUMMON_ARMAGE_GOOD, (PM_NO_PET)))
                                {
                                        good_idx = hack_m_idx_ii;
                                }
@@ -664,7 +664,7 @@ void hit_trap(player_type *trapped_ptr, bool break_trap)
                num = 1 + trapped_ptr->current_floor_ptr->dun_level / 20;
                for (i = 0; i < num; i++)
                {
-                       (void)summon_specific(0, y, x, trapped_ptr->current_floor_ptr->dun_level, SUMMON_PIRANHAS, (PM_ALLOW_GROUP | PM_NO_PET));
+                       (void)summon_specific(trapped_ptr, 0, y, x, trapped_ptr->current_floor_ptr->dun_level, SUMMON_PIRANHAS, (PM_ALLOW_GROUP | PM_NO_PET));
                }
                break;
        }
index f3f0d9c..22faffa 100644 (file)
@@ -676,7 +676,7 @@ void wilderness_gen(player_type *creature_ptr)
                        mode |= PM_ALLOW_SLEEP;
 
                /* Make a resident */
-               (void)alloc_monster(generate_encounter ? 0 : 3, mode);
+               (void)alloc_monster(creature_ptr, generate_encounter ? 0 : 3, mode);
        }
 
        if(generate_encounter) creature_ptr->ambush_flag = TRUE;
index 8d53d53..a5b9721 100644 (file)
@@ -200,7 +200,7 @@ static void do_cmd_summon_horde(player_type *caster_ptr)
                if (cave_empty_bold(caster_ptr->current_floor_ptr, wy, wx)) break;
        }
 
-       (void)alloc_horde(wy, wx);
+       (void)alloc_horde(caster_ptr, wy, wx);
 }
 
 /*!
@@ -1478,7 +1478,7 @@ static void do_cmd_wiz_summon(player_type *caster_ptr, int num)
 {
        for (int i = 0; i < num; i++)
        {
-               (void)summon_specific(0, caster_ptr->y, caster_ptr->x, caster_ptr->current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
+               (void)summon_specific(caster_ptr, 0, caster_ptr->y, caster_ptr->x, caster_ptr->current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
        }
 }
 
@@ -1493,7 +1493,7 @@ static void do_cmd_wiz_summon(player_type *caster_ptr, int num)
  */
 static void do_cmd_wiz_named(player_type *summoner_ptr, MONRACE_IDX r_idx)
 {
-       (void)summon_named_creature(0, summoner_ptr->y, summoner_ptr->x, r_idx, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
+       (void)summon_named_creature(summoner_ptr, 0, summoner_ptr->y, summoner_ptr->x, r_idx, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
 }
 
 
@@ -1507,7 +1507,7 @@ static void do_cmd_wiz_named(player_type *summoner_ptr, MONRACE_IDX r_idx)
  */
 static void do_cmd_wiz_named_friendly(player_type *summoner_ptr, MONRACE_IDX r_idx)
 {
-       (void)summon_named_creature(0, summoner_ptr->y, summoner_ptr->x, r_idx, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP | PM_FORCE_PET));
+       (void)summon_named_creature(summoner_ptr, 0, summoner_ptr->y, summoner_ptr->x, r_idx, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP | PM_FORCE_PET));
 }