OSDN Git Service

キャラクター生成中やオプション設定中に'?'を押すとヘルプファイルの中の
[hengbandforosx/hengbandosx.git] / src / mspells1.c
index 408a7b8..91a8d27 100644 (file)
@@ -489,7 +489,7 @@ bool clean_shot(int y1, int x1, int y2, int x2, bool friend)
  */
 static void bolt(int m_idx, int typ, int dam_hp, int monspell, bool learnable)
 {
-       int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_PLAYER;
+       int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_PLAYER | PROJECT_REFLECTABLE;
 
        /* Target the player with a bolt attack */
        (void)project(m_idx, 0, py, px, dam_hp, typ, flg, (learnable ? monspell : -1));
@@ -497,7 +497,7 @@ static void bolt(int m_idx, int typ, int dam_hp, int monspell, bool learnable)
 
 static void beam(int m_idx, int typ, int dam_hp, int monspell, bool learnable)
 {
-       int flg = PROJECT_BEAM | PROJECT_KILL | PROJECT_THRU | PROJECT_PLAYER | PROJECT_NO_REF;
+       int flg = PROJECT_BEAM | PROJECT_KILL | PROJECT_THRU | PROJECT_PLAYER;
 
        /* Target the player with a bolt attack */
        (void)project(m_idx, 0, py, px, dam_hp, typ, flg, (learnable ? monspell : -1));
@@ -523,6 +523,9 @@ static void breath(int y, int x, int m_idx, int typ, int dam_hp, int rad, bool b
        if (breath) rad = 0 - rad;
 
        if (typ == GF_ROCKET) flg |= PROJECT_STOP;
+       if (typ == GF_MIND_BLAST || typ == GF_BRAIN_SMASH ||
+           typ == GF_CAUSE_1 || typ == GF_CAUSE_2 || typ == GF_CAUSE_3 ||
+           typ == GF_CAUSE_4 || typ == GF_HAND_DOOM) flg |= PROJECT_HIDE;
 
        /* Target the player with a ball attack */
        (void)project(m_idx, rad, y, x, dam_hp, typ, flg, (learnable ? monspell : -1));
@@ -540,6 +543,10 @@ u32b get_curse(int power, object_type *o_ptr)
                {
                        if (!(new_curse & TRC_HEAVY_MASK)) continue;
                }
+               else if (power == 1)
+               {
+                       if (new_curse & TRC_SPECIAL_MASK) continue;
+               }
                else if (power == 0)
                {
                        if (new_curse & TRC_HEAVY_MASK) continue;
@@ -556,7 +563,7 @@ void curse_equipment(int chance, int heavy_chance)
        bool        changed = FALSE;
        int         curse_power = 0;
        u32b        new_curse;
-       u32b        o1, o2, o3;
+       u32b oflgs[TR_FLAG_SIZE];
        object_type *o_ptr = &inventory[INVEN_RARM + randint0(12)];
        char o_name[MAX_NLEN];
 
@@ -564,12 +571,12 @@ void curse_equipment(int chance, int heavy_chance)
 
        if (!o_ptr->k_idx) return;
 
-       object_flags(o_ptr, &o1, &o2, &o3);
+       object_flags(o_ptr, oflgs);
 
        object_desc(o_name, o_ptr, FALSE, 0);
 
        /* Extra, biased saving throw for blessed items */
-       if ((o3 & TR3_BLESSED) && (randint1(888) > chance))
+       if (have_flag(oflgs, TR_BLESSED) && (randint1(888) > chance))
        {
 #ifdef JP
 msg_format("%s¤Ï¼ö¤¤¤òÄ·¤ÍÊÖ¤·¤¿¡ª", o_name,
@@ -597,7 +604,7 @@ msg_format("%s
                        changed = TRUE;
                o_ptr->curse_flags |= TRC_CURSED;
        }
-       if (heavy_chance >= 50) curse_power = 2;
+       if (heavy_chance >= 50) curse_power++;
 
        new_curse = get_curse(curse_power, o_ptr);
        if (!(o_ptr->curse_flags & new_curse))
@@ -1071,7 +1078,12 @@ static int choose_attack_spell(int m_idx, byte spells[], byte num)
                        case MON_BANORLUPART:
                                if (randint0(100) < 70) success = TRUE;
                                break;
-                       default: break;
+                       case MON_BANOR:
+                       case MON_LUPART:
+                                break;
+                       default:
+                                if (randint0(100) < 50) success = TRUE;
+                                break;
                }
                if (success) return (special[randint0(special_num)]);
        }
@@ -1234,6 +1246,7 @@ bool make_attack_spell(int m_idx)
        bool            no_inate = FALSE;
        bool            do_disi = FALSE;
        int             dam = 0;
+       u32b mode = 0L;
        int s_num_6 = (easy_band ? 2 : 6);
        int s_num_4 = (easy_band ? 1 : 4);
 
@@ -1496,7 +1509,7 @@ bool make_attack_spell(int m_idx)
        if (!num) return (FALSE);
 
        /* Stop if player is dead or gone */
-       if (!alive || death) return (FALSE);
+       if (!p_ptr->playing || p_ptr->is_dead) return (FALSE);
 
        /* Stop if player is leaving */
        if (p_ptr->leaving) return (FALSE);
@@ -1555,6 +1568,7 @@ msg_format("%^s
                }
        }
 
+
        /* Cast the spell. */
        switch (thrown_spell)
        {
@@ -1619,6 +1633,8 @@ msg_format("%^s
                        set_tim_ffall(0, TRUE);
                        set_tim_sh_touki(0, TRUE);
                        set_tim_sh_fire(0, TRUE);
+                       set_tim_sh_holy(0, TRUE);
+                       set_tim_eyeeye(0, TRUE);
                        set_magicdef(0, TRUE);
                        set_resist_magic(0, TRUE);
                        set_oppose_acid(0, TRUE);
@@ -1664,7 +1680,7 @@ msg_format("%^s
                                /* Window stuff */
                                p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
 
-                               p_ptr->energy -= 100;
+                               p_ptr->energy_need += ENERGY_NEED();
                        }
                        if (p_ptr->riding)
                        {
@@ -2603,43 +2619,7 @@ msg_format("%^s
                        }
 
                        dam = damroll(7, 7);
-                       if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
-                       {
-#ifdef JP
-msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
-#else
-                               msg_print("You resist the effects!");
-#endif
-                               learn_spell(MS_MIND_BLAST);
-                       }
-                       else
-                       {
-#ifdef JP
-msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
-#else
-                               msg_print("Your mind is blasted by psyonic energy.");
-#endif
-
-                               if (!p_ptr->resist_conf)
-                               {
-                                       (void)set_confused(p_ptr->confused + randint0(4) + 4);
-                               }
-
-                               if (!p_ptr->resist_chaos && one_in_(3))
-                               {
-                                       (void)set_image(p_ptr->image + randint0(250) + 150);
-                               }
-
-                               p_ptr->csp -= 50;
-                               if (p_ptr->csp < 0)
-                               {
-                                       p_ptr->csp = 0;
-                                       p_ptr->csp_frac = 0;
-                               }
-                               p_ptr->redraw |= PR_MANA;
-
-                               take_hit(DAMAGE_ATTACK, dam, ddesc, MS_MIND_BLAST);
-                       }
+                       breath(y, x, m_idx, GF_MIND_BLAST, dam, 0, FALSE, MS_MIND_BLAST, learnable);
                        break;
                }
 
@@ -2669,56 +2649,7 @@ msg_format("%^s
                        }
 
                        dam = damroll(12, 12);
-                       if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
-                       {
-#ifdef JP
-msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
-#else
-                               msg_print("You resist the effects!");
-#endif
-                               learn_spell(MS_BRAIN_SMASH);
-                       }
-                       else
-                       {
-#ifdef JP
-msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
-#else
-                               msg_print("Your mind is blasted by psionic energy.");
-#endif
-
-                               p_ptr->csp -= 100;
-                               if (p_ptr->csp < 0)
-                               {
-                                       p_ptr->csp = 0;
-                                       p_ptr->csp_frac = 0;
-                               }
-                               p_ptr->redraw |= PR_MANA;
-
-                               take_hit(DAMAGE_ATTACK, dam, ddesc, MS_BRAIN_SMASH);
-                               if (!p_ptr->resist_blind)
-                               {
-                                       (void)set_blind(p_ptr->blind + 8 + randint0(8));
-                               }
-                               if (!p_ptr->resist_conf)
-                               {
-                                       (void)set_confused(p_ptr->confused + randint0(4) + 4);
-                               }
-                               if (!p_ptr->free_act)
-                               {
-                                       (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
-                               }
-                               (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
-
-                               while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
-                                       (void)do_dec_stat(A_INT);
-                               while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
-                                       (void)do_dec_stat(A_WIS);
-
-                               if (!p_ptr->resist_chaos)
-                               {
-                                       (void)set_image(p_ptr->image + randint0(250) + 150);
-                               }
-                       }
+                       breath(y, x, m_idx, GF_BRAIN_SMASH, dam, 0, FALSE, MS_BRAIN_SMASH, learnable);
                        break;
                }
 
@@ -2741,20 +2672,7 @@ else msg_format("%^s
 #endif
 
                        dam = damroll(3, 8);
-                       if (randint0(100 + rlev/2) < p_ptr->skill_sav)
-                       {
-#ifdef JP
-msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
-#else
-                               msg_print("You resist the effects!");
-#endif
-                               learn_spell(MS_CAUSE_1);
-                       }
-                       else
-                       {
-                               curse_equipment(33, 0);
-                               take_hit(DAMAGE_ATTACK, dam, ddesc, MS_CAUSE_1);
-                       }
+                       breath(y, x, m_idx, GF_CAUSE_1, dam, 0, FALSE, MS_CAUSE_1, learnable);
                        break;
                }
 
@@ -2777,20 +2695,7 @@ else msg_format("%^s
 #endif
 
                        dam = damroll(8, 8);
-                       if (randint0(100 + rlev/2) < p_ptr->skill_sav)
-                       {
-#ifdef JP
-msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
-#else
-                               msg_print("You resist the effects!");
-#endif
-                               learn_spell(MS_CAUSE_2);
-                       }
-                       else
-                       {
-                               curse_equipment(50, 5);
-                               take_hit(DAMAGE_ATTACK, dam, ddesc, MS_CAUSE_2);
-                       }
+                       breath(y, x, m_idx, GF_CAUSE_2, dam, 0, FALSE, MS_CAUSE_2, learnable);
                        break;
                }
 
@@ -2813,20 +2718,7 @@ else msg_format("%^s
 #endif
 
                        dam = damroll(10, 15);
-                       if (randint0(100 + rlev/2) < p_ptr->skill_sav)
-                       {
-#ifdef JP
-msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
-#else
-                               msg_print("You resist the effects!");
-#endif
-                               learn_spell(MS_CAUSE_3);
-                       }
-                       else
-                       {
-                               curse_equipment(80, 15);
-                               take_hit(DAMAGE_ATTACK, dam, ddesc, MS_CAUSE_3);
-                       }
+                       breath(y, x, m_idx, GF_CAUSE_3, dam, 0, FALSE, MS_CAUSE_3, learnable);
                        break;
                }
 
@@ -2849,20 +2741,7 @@ else msg_format("%^s
 #endif
 
                        dam = damroll(15, 15);
-                       if ((randint0(100 + rlev/2) < p_ptr->skill_sav) && !(m_ptr->r_idx == MON_KENSHIROU))
-                       {
-#ifdef JP
-msg_print("¤·¤«¤·È빦¤òÄ·¤ÍÊÖ¤·¤¿¡ª");
-#else
-                               msg_print("You resist the effects!");
-#endif
-                               learn_spell(MS_CAUSE_4);
-                       }
-                       else
-                       {
-                               take_hit(DAMAGE_ATTACK, dam, ddesc, MS_CAUSE_4);
-                               (void)set_cut(p_ptr->cut + damroll(10, 10));
-                       }
+                       breath(y, x, m_idx, GF_CAUSE_4, dam, 0, FALSE, MS_CAUSE_4, learnable);
                        break;
                }
 
@@ -3390,31 +3269,8 @@ msg_format("%^s
 #else
                        msg_format("%^s invokes the Hand of Doom!", m_name);
 #endif
-
-                       if (randint0(100 + rlev/2) < p_ptr->skill_sav)
-                       {
-#ifdef JP
-msg_format("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
-#else
-                               msg_format("You resist the effects!");
-#endif
-                               learn_spell(MS_HAND_DOOM);
-
-                       }
-                       else
-                       {
-                               int dummy = (((s32b) ((40 + randint1(20)) * (p_ptr->chp))) / 100);
-#ifdef JP
-msg_print("¤¢¤Ê¤¿¤ÏÌ¿¤¬Çö¤Þ¤Ã¤Æ¤¤¤¯¤è¤¦¤Ë´¶¤¸¤¿¡ª");
-#else
-                               msg_print("Your feel your life fade away!");
-#endif
-
-                               take_hit(DAMAGE_ATTACK, dummy, m_name, MS_HAND_DOOM);
-                               curse_equipment(100, 20);
-
-                               if (p_ptr->chp < 1) p_ptr->chp = 1;
-                       }
+                       dam = (((s32b) ((40 + randint1(20)) * (p_ptr->chp))) / 100);
+                       breath(y, x, m_idx, GF_HAND_DOOM, dam, 0, FALSE, MS_HAND_DOOM, learnable);
                        break;
                }
 
@@ -3570,7 +3426,7 @@ msg_format("%^s
                case 160+5:
                {
                        int i, oldfy, oldfx;
-                       u32b f1 = 0 , f2 = 0 , f3 = 0;
+                       u32b flgs[TR_FLAG_SIZE];
                        object_type *o_ptr;
 
                        oldfy = m_ptr->fy;
@@ -3592,9 +3448,9 @@ msg_format("%^s
                                        o_ptr = &inventory[i];
                                        if(!cursed_p(o_ptr))
                                        {
-                                               object_flags(o_ptr, &f1, &f2, &f3);
+                                               object_flags(o_ptr, flgs);
 
-                                               if((f3 & TR3_TELEPORT) || (p_ptr->muta1 & MUT1_VTELEPORT) || (p_ptr->pclass == CLASS_IMITATOR))
+                                               if((have_flag(flgs, TR_TELEPORT)) || (p_ptr->muta1 & MUT1_VTELEPORT) || (p_ptr->pclass == CLASS_IMITATOR))
                                                {
 #ifdef JP
                                                        if(get_check_strict("¤Ä¤¤¤Æ¤¤¤­¤Þ¤¹¤«¡©", CHECK_OKAY_CANCEL))
@@ -3612,7 +3468,7 @@ msg_format("%^s
 #endif
                                                                }
                                                                else teleport_player_to(m_ptr->fy, m_ptr->fx, TRUE);
-                                                               p_ptr->energy -= 100;
+                                                               p_ptr->energy_need += ENERGY_NEED();
                                                        }
                                                        break;
                                                }
@@ -3646,7 +3502,7 @@ msg_format("%^s
                                if (p_ptr->inside_arena || p_ptr->inside_battle) return FALSE;
                                for (k = 0; k < 6; k++)
                                {
-                                       count += summon_specific(m_idx, m_ptr->fy, m_ptr->fx, rlev, SUMMON_BIZARRE1, TRUE, FALSE, FALSE, FALSE, FALSE);
+                                       count += summon_specific(m_idx, m_ptr->fy, m_ptr->fx, rlev, SUMMON_BIZARRE1, PM_ALLOW_GROUP);
                                }
                                return FALSE;
                                
@@ -3659,10 +3515,10 @@ msg_format("%^s
 
                                        if (p_ptr->inside_arena || p_ptr->inside_battle || !summon_possible(m_ptr->fy, m_ptr->fx)) return FALSE;
                                        delete_monster_idx(cave[m_ptr->fy][m_ptr->fx].m_idx);
-                                       summon_named_creature(dummy_y, dummy_x, MON_BANOR, FALSE, FALSE, is_friendly(m_ptr), FALSE);
+                                       summon_named_creature(0, dummy_y, dummy_x, MON_BANOR, mode);
                                        m_list[hack_m_idx_ii].hp = dummy_hp;
                                        m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
-                                       summon_named_creature(dummy_y, dummy_x, MON_LUPART, FALSE, FALSE, is_friendly(m_ptr), FALSE);
+                                       summon_named_creature(0, dummy_y, dummy_x, MON_LUPART, mode);
                                        m_list[hack_m_idx_ii].hp = dummy_hp;
                                        m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
 
@@ -3697,7 +3553,7 @@ msg_format("%^s
                                                        delete_monster_idx(k);
                                                }
                                        }
-                                       summon_named_creature(dummy_y, dummy_x, MON_BANORLUPART, FALSE, FALSE, is_friendly(m_ptr), FALSE);
+                                       summon_named_creature(0, dummy_y, dummy_x, MON_BANORLUPART, mode);
                                        m_list[hack_m_idx_ii].hp = dummy_hp;
                                        m_list[hack_m_idx_ii].maxhp = dummy_maxhp;
 
@@ -3709,7 +3565,79 @@ msg_format("%^s
 
                                        break;
                                }
-                               default: return FALSE;
+
+                        default:
+                                if (r_ptr->d_char == 'B')
+                                {
+                                        if (!direct) break;
+                                        disturb(1, 0);
+                                        if (one_in_(3) || x!=px || y!=py)
+                                        {
+#ifdef JP
+                                                msg_format("%^s¤ÏÆÍÁ³»ë³¦¤«¤é¾Ã¤¨¤¿!", m_name);
+#else
+                                                msg_format("%^s suddenly go out of your sight!", m_name);
+#endif
+                                                teleport_away(m_idx, 10, FALSE);
+                                                p_ptr->update |= (PU_MONSTERS | PU_MON_LITE);
+                                                break;
+                                        }
+                                        else
+                                        {
+                                                int dam = damroll(4, 8);
+                                               int get_damage = 0;
+#ifdef JP
+                                                msg_format("%^s¤¬¤¢¤Ê¤¿¤òÄϤó¤Ç¶õÃ椫¤éÅꤲÍ¤¿¡£", m_name);
+#else
+                                                msg_format("%^s holds you, and drops from the sky.", m_name);
+#endif
+                                                teleport_player_to(m_ptr->fy, m_ptr->fx, FALSE);
+
+                                                sound(SOUND_FALL);
+
+                                                if (p_ptr->ffall)
+                                                {
+#ifdef JP
+                                                        msg_print("¤¢¤Ê¤¿¤ÏÀŤ«¤ËÃåÃϤ·¤¿¡£");
+#else
+                                                        msg_print("You float gently down to the ground.");
+#endif
+                                                }
+                                                else
+                                                {
+#ifdef JP
+                                                        msg_print("¤¢¤Ê¤¿¤ÏÃÏÌ̤Ë᤭¤Ä¤±¤é¤ì¤¿¡£");
+#else
+                                                        msg_print("You crashed into the ground.");
+#endif
+                                                        dam += damroll(6, 8);
+                                                }
+
+                                               /* Mega hack -- this special action deals damage to the player. Therefore the code of "eyeeye" is necessary.
+                                                  -- henkma
+                                                */
+                                                get_damage = take_hit(DAMAGE_NOESCAPE, dam, m_name, -1);
+                                               if (p_ptr->tim_eyeeye && get_damage > 0 && !p_ptr->is_dead)
+                                               {
+#ifdef JP
+                                                       msg_format("¹¶·â¤¬%s¼«¿È¤ò½ý¤Ä¤±¤¿¡ª", m_name);
+#else
+                                                       char m_name_self[80];
+               
+                                                       /* hisself */
+                                                       monster_desc(m_name_self, m_ptr, 0x23);
+
+                                                       msg_format("The attack of %s has wounded %s!", m_name, m_name_self);
+#endif
+                                                       project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
+                                                       set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
+                                               }
+                                        }
+                                        break;
+                                }
+
+                                /* Something is wrong */
+                                else return FALSE;
                        }
                        break;
                }
@@ -3978,17 +3906,28 @@ else msg_format("%^s
                        if(m_ptr->r_idx == MON_ROLENTO)
                        {
                                int num = 1 + randint1(3);
+
                                for (k = 0; k < num; k++)
                                {
-                                       count += summon_named_creature(y, x, MON_SHURYUUDAN, FALSE, FALSE, is_friendly(m_ptr), is_pet(m_ptr));
+                                       count += summon_named_creature(m_idx, y, x, MON_SHURYUUDAN, mode);
                                }
                        }
+                       else if(m_ptr->r_idx == MON_THORONDOR ||
+                                m_ptr->r_idx == MON_GWAIHIR ||
+                                m_ptr->r_idx == MON_MENELDOR)
+                        {
+                               int num = 4 + randint1(3);
+                               for (k = 0; k < num; k++)
+                               {
+                                       count += summon_specific(m_idx, y, x, rlev, SUMMON_EAGLES, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
+                               }
+                        }
                        else if(m_ptr->r_idx == MON_LOUSY)
                        {
                                int num = 2 + randint1(3);
                                for (k = 0; k < num; k++)
                                {
-                                       count += summon_specific(m_idx, y, x, rlev, SUMMON_LOUSE, TRUE, FALSE, FALSE, FALSE, FALSE);
+                                       count += summon_specific(m_idx, y, x, rlev, SUMMON_LOUSE, PM_ALLOW_GROUP);
                                }
                        }
                        else if(m_ptr->r_idx == MON_BULLGATES)
@@ -3996,7 +3935,7 @@ else msg_format("%^s
                                int num = 2 + randint1(3);
                                for (k = 0; k < num; k++)
                                {
-                                       count += summon_named_creature(y, x, 921, FALSE, FALSE, is_friendly(m_ptr), is_pet(m_ptr));
+                                       count += summon_named_creature(m_idx, y, x, 921, mode);
                                }
                        }
                        else if (m_ptr->r_idx == MON_CALDARM)
@@ -4004,7 +3943,7 @@ else msg_format("%^s
                                int num = randint1(3);
                                for (k = 0; k < num; k++)
                                {
-                                       count += summon_named_creature(y, x, 930, FALSE, FALSE, is_friendly(m_ptr), is_pet(m_ptr));
+                                       count += summon_named_creature(m_idx, y, x, 930, mode);
                                }
                        }
                        else if (m_ptr->r_idx == MON_SERPENT || m_ptr->r_idx == MON_ZOMBI_SERPENT)
@@ -4023,7 +3962,7 @@ else msg_format("%^s
 
                                for (k = 0; k < num; k++)
                                {
-                                       count += summon_specific(m_idx, y, x, rlev, SUMMON_GUARDIANS, TRUE, FALSE, FALSE, TRUE, FALSE);
+                                       count += summon_specific(m_idx, y, x, rlev, SUMMON_GUARDIANS, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
                                }
                        }
                        else
@@ -4033,7 +3972,7 @@ else msg_format("%^s
 
                                for (k = 0; k < 4; k++)
                                {
-                                       count += summon_specific(m_idx, y, x, rlev, SUMMON_KIN, TRUE, FALSE, FALSE, FALSE, FALSE);
+                                       count += summon_specific(m_idx, y, x, rlev, SUMMON_KIN, PM_ALLOW_GROUP);
                                }
                        }
 #ifdef JP
@@ -4090,7 +4029,7 @@ else msg_format("%^s
 
                        for (k = 0; k < 1; k++)
                        {
-                               count += summon_specific(m_idx, y, x, rlev, 0, TRUE, FALSE, FALSE, TRUE, FALSE);
+                               count += summon_specific(m_idx, y, x, rlev, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
                        }
 #ifdef JP
 if (blind && count) msg_print("²¿¤«¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
@@ -4119,7 +4058,7 @@ else msg_format("%^s
 
                        for (k = 0; k < s_num_6; k++)
                        {
-                               count += summon_specific(m_idx, y, x, rlev, 0, TRUE, FALSE, FALSE, TRUE, FALSE);
+                               count += summon_specific(m_idx, y, x, rlev, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
                        }
 #ifdef JP
 if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
@@ -4148,7 +4087,7 @@ else msg_format("%^s
 
                        for (k = 0; k < s_num_6; k++)
                        {
-                               count += summon_specific(m_idx, y, x, rlev, SUMMON_ANT, TRUE, FALSE, FALSE, FALSE, FALSE);
+                               count += summon_specific(m_idx, y, x, rlev, SUMMON_ANT, PM_ALLOW_GROUP);
                        }
 #ifdef JP
 if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
@@ -4177,7 +4116,7 @@ else msg_format("%^s
 
                        for (k = 0; k < s_num_6; k++)
                        {
-                               count += summon_specific(m_idx, y, x, rlev, SUMMON_SPIDER, TRUE, FALSE, FALSE, FALSE, FALSE);
+                               count += summon_specific(m_idx, y, x, rlev, SUMMON_SPIDER, PM_ALLOW_GROUP);
                        }
 #ifdef JP
 if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
@@ -4206,7 +4145,7 @@ else msg_format("%^s
 
                        for (k = 0; k < s_num_4; k++)
                        {
-                               count += summon_specific(m_idx, y, x, rlev, SUMMON_HOUND, TRUE, FALSE, FALSE, FALSE, FALSE);
+                               count += summon_specific(m_idx, y, x, rlev, SUMMON_HOUND, PM_ALLOW_GROUP);
                        }
 #ifdef JP
 if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
@@ -4235,7 +4174,7 @@ else msg_format("%^s
 
                        for (k = 0; k < s_num_4; k++)
                        {
-                               count += summon_specific(m_idx, y, x, rlev, SUMMON_HYDRA, TRUE, FALSE, FALSE, FALSE, FALSE);
+                               count += summon_specific(m_idx, y, x, rlev, SUMMON_HYDRA, PM_ALLOW_GROUP);
                        }
 #ifdef JP
 if (blind && count) msg_print("¿¤¯¤Î¤â¤Î¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
@@ -4271,7 +4210,7 @@ else msg_format("%^s
 
                        for (k = 0; k < num; k++)
                        {
-                               count += summon_specific(m_idx, y, x, rlev, SUMMON_ANGEL, TRUE, FALSE, FALSE, FALSE, FALSE);
+                               count += summon_specific(m_idx, y, x, rlev, SUMMON_ANGEL, PM_ALLOW_GROUP);
                        }
 
                        if (count < 2)
@@ -4312,7 +4251,7 @@ else msg_format("%^s
 
                        for (k = 0; k < 1; k++)
                        {
-                               count += summon_specific(m_idx, y, x, rlev, SUMMON_DEMON, TRUE, FALSE, FALSE, FALSE, FALSE);
+                               count += summon_specific(m_idx, y, x, rlev, SUMMON_DEMON, PM_ALLOW_GROUP);
                        }
 #ifdef JP
 if (blind && count) msg_print("²¿¤«¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
@@ -4341,7 +4280,7 @@ else msg_format("%^s
 
                        for (k = 0; k < 1; k++)
                        {
-                               count += summon_specific(m_idx, y, x, rlev, SUMMON_UNDEAD, TRUE, FALSE, FALSE, FALSE, FALSE);
+                               count += summon_specific(m_idx, y, x, rlev, SUMMON_UNDEAD, PM_ALLOW_GROUP);
                        }
 #ifdef JP
 if (blind && count) msg_print("²¿¤«¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
@@ -4370,7 +4309,7 @@ else msg_format("%^s
 
                        for (k = 0; k < 1; k++)
                        {
-                               count += summon_specific(m_idx, y, x, rlev, SUMMON_DRAGON, TRUE, FALSE, FALSE, FALSE, FALSE);
+                               count += summon_specific(m_idx, y, x, rlev, SUMMON_DRAGON, PM_ALLOW_GROUP);
                        }
 #ifdef JP
 if (blind && count) msg_print("²¿¤«¤¬´Ö¶á¤Ë¸½¤ì¤¿²»¤¬¤¹¤ë¡£");
@@ -4418,7 +4357,7 @@ else msg_format("%^s
                                        }
                                        if (!cave_floor_bold(cy, cx)) continue;
 
-                                       if (summon_named_creature(cy, cx, MON_NAZGUL, FALSE, FALSE, is_friendly(m_ptr), is_pet(m_ptr)))
+                                       if (summon_named_creature(m_idx, cy, cx, MON_NAZGUL, mode))
                                        {
                                                y = cy;
                                                x = cx;
@@ -4461,7 +4400,7 @@ else msg_format("%^s
 
                                for (k = 0; k < s_num_6; k++)
                                {
-                                       count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_UNDEAD, TRUE, FALSE, FALSE, TRUE, FALSE);
+                                       count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
                                }
                        }
                        if (blind && count)
@@ -4494,7 +4433,7 @@ else msg_format("%^s
 
                        for (k = 0; k < s_num_4; k++)
                        {
-                               count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_DRAGON, TRUE, FALSE, FALSE, TRUE, FALSE);
+                               count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_DRAGON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
                        }
                        if (blind && count)
                        {
@@ -4528,7 +4467,7 @@ else msg_format("%^s
 
                        for (k = 0; k < s_num_4; k++)
                        {
-                               count += summon_specific(m_idx, y, x, rlev, SUMMON_AMBERITES, TRUE, FALSE, FALSE, TRUE, FALSE);
+                               count += summon_specific(m_idx, y, x, rlev, SUMMON_AMBERITES, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
                        }
                        if (blind && count)
                        {
@@ -4560,20 +4499,20 @@ else msg_format("%^s
 
                        for (k = 0; k < s_num_4; k++)
                        {
-                               count += summon_specific(m_idx, y, x, rlev, SUMMON_UNIQUE, TRUE, FALSE, FALSE, TRUE, FALSE);
+                               count += summon_specific(m_idx, y, x, rlev, SUMMON_UNIQUE, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
                        }
                        if (r_ptr->flags3 & RF3_GOOD)
                        {
                                for (k = count; k < s_num_4; k++)
                                {
-                                       count += summon_specific(m_idx, y, x, rlev, SUMMON_ANGEL, TRUE, FALSE, FALSE, TRUE, FALSE);
+                                       count += summon_specific(m_idx, y, x, rlev, SUMMON_ANGEL, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
                                }
                        }
                        else
                        {
                                for (k = count; k < s_num_4; k++)
                                {
-                                       count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_UNDEAD, TRUE, FALSE, FALSE, TRUE, FALSE);
+                                       count += summon_specific(m_idx, y, x, rlev, SUMMON_HI_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
                                }
                        }
                        if (blind && count)
@@ -4598,19 +4537,19 @@ msg_print("¿
        {
                if (thrown_spell != 167)
                {
-                       if (mane_num == MAX_MANE)
+                       if (p_ptr->mane_num == MAX_MANE)
                        {
                                int i;
-                               mane_num--;
-                               for (i = 0;i < mane_num;i++)
+                               p_ptr->mane_num--;
+                               for (i = 0;i < p_ptr->mane_num;i++)
                                {
-                                       mane_spell[i] = mane_spell[i+1];
-                                       mane_dam[i] = mane_dam[i+1];
+                                       p_ptr->mane_spell[i] = p_ptr->mane_spell[i+1];
+                                       p_ptr->mane_dam[i] = p_ptr->mane_dam[i+1];
                                }
                        }
-                       mane_spell[mane_num] = thrown_spell - 96;
-                       mane_dam[mane_num] = dam;
-                       mane_num++;
+                       p_ptr->mane_spell[p_ptr->mane_num] = thrown_spell - 96;
+                       p_ptr->mane_dam[p_ptr->mane_num] = dam;
+                       p_ptr->mane_num++;
                        new_mane = TRUE;
 
                        p_ptr->redraw |= (PR_MANE);
@@ -4644,7 +4583,7 @@ msg_print("¿
 
 
        /* Always take note of monsters that kill you */
-       if (death && (r_ptr->r_deaths < MAX_SHORT) && !p_ptr->inside_arena)
+       if (p_ptr->is_dead && (r_ptr->r_deaths < MAX_SHORT) && !p_ptr->inside_arena)
        {
                r_ptr->r_deaths++;
        }