OSDN Git Service

New Magic-Eater's class power, 'Powerful Activation' is added
[hengband/hengband.git] / src / spells2.c
index 6236502..ae68634 100644 (file)
@@ -109,9 +109,9 @@ sprintf(Dummy, "
        info[i++] = "";
 
 #ifdef JP
-       sprintf(Dummy, "¸½ºß¤Î°À­ : %s(%ld)", your_alignment(), p_ptr->align);
+       sprintf(Dummy, "¸½ºß¤Î°À­ : %s(%ld)", your_alignment(), (long int)p_ptr->align);
 #else
-       sprintf(Dummy, "Your alighnment : %s(%ld)", your_alignment(), p_ptr->align);
+       sprintf(Dummy, "Your alighnment : %s(%ld)", your_alignment(), (long int)p_ptr->align);
 #endif
        strcpy(buf[1], Dummy);
        info[i++] = buf[1];
@@ -528,7 +528,7 @@ sprintf(Dummy, "
 
                        info[i++] = Dummy;
                        break;
-               case RACE_KUTA:
+               case RACE_KUTAR:
                        if (plev > 19)
 #ifdef JP
 info[i++] = "¤¢¤Ê¤¿¤Ï d20+30 ¥¿¡¼¥ó¤Î´Ö²£¤Ë¿­¤Ó¤ë¤³¤È¤¬¤Ç¤­¤ë¡£(15 MP)";
@@ -588,8 +588,9 @@ info[i++] = "
 #endif
                        }
                        break;
-               case CLASS_MAGE:
                case CLASS_HIGH_MAGE:
+                       if (p_ptr->realm1 == REALM_HEX) break;
+               case CLASS_MAGE:
                case CLASS_SORCERER:
                        if (plev > 24)
                        {
@@ -773,9 +774,9 @@ info[i++] = "
                        if (plev > 47)
                        {
 #ifdef JP
-info[i++] = "¤¢¤Ê¤¿¤Ï1¥¿¡¼¥ó¤Ë2²óËâË¡¤ò¾§¤¨¤ë¤³¤È¤¬¤Ç¤­¤ë¡£(77 MP)";
+info[i++] = "¤¢¤Ê¤¿¤Ï1¥¿¡¼¥ó¤Ë2²óËâË¡¤ò¾§¤¨¤ë¤³¤È¤¬¤Ç¤­¤ë¡£(20 MP)";
 #else
-                               info[i++] = "You can cast two spells in one time (cost 77).";
+                               info[i++] = "You can cast two spells in one time (cost 20).";
 #endif
                        }
                        break;
@@ -1924,7 +1925,7 @@ info[i++] = "
        if (IS_BLESSED())
        {
 #ifdef JP
-info[i++] = "¤¢¤Ê¤¿¤Ï¸øÀµ¤µ¤ò´¶¤¸¤Æ¤¤¤ë¡£";
+info[i++] = "¤¢¤Ê¤¿¤Ï¹â·é¤µ¤ò´¶¤¸¤Æ¤¤¤ë¡£";
 #else
                info[i++] = "You feel rightous.";
 #endif
@@ -3248,7 +3249,7 @@ void report_magics(void)
        {
                info2[i]  = report_magics_aux(p_ptr->blind);
 #ifdef JP
-info[i++] = "¤¢¤Ê¤¿¤ÏÌܤ¬¸«¤¨¤Ê¤¤¡£";
+info[i++] = "¤¢¤Ê¤¿¤ÏÌܤ¬¸«¤¨¤Ê¤¤";
 #else
                info[i++] = "You cannot see";
 #endif
@@ -3258,7 +3259,7 @@ info[i++] = "
        {
                info2[i]  = report_magics_aux(p_ptr->confused);
 #ifdef JP
-info[i++] = "¤¢¤Ê¤¿¤Ïº®Í𤷤Ƥ¤¤ë¡£";
+info[i++] = "¤¢¤Ê¤¿¤Ïº®Í𤷤Ƥ¤¤ë";
 #else
                info[i++] = "You are confused";
 #endif
@@ -3268,7 +3269,7 @@ info[i++] = "
        {
                info2[i]  = report_magics_aux(p_ptr->afraid);
 #ifdef JP
-info[i++] = "¤¢¤Ê¤¿¤Ï¶²Éݤ˿¯¤µ¤ì¤Æ¤¤¤ë¡£";
+info[i++] = "¤¢¤Ê¤¿¤Ï¶²Éݤ˿¯¤µ¤ì¤Æ¤¤¤ë";
 #else
                info[i++] = "You are terrified";
 #endif
@@ -3278,7 +3279,7 @@ info[i++] = "
        {
                info2[i]  = report_magics_aux(p_ptr->poisoned);
 #ifdef JP
-info[i++] = "¤¢¤Ê¤¿¤ÏÆǤ˿¯¤µ¤ì¤Æ¤¤¤ë¡£";
+info[i++] = "¤¢¤Ê¤¿¤ÏÆǤ˿¯¤µ¤ì¤Æ¤¤¤ë";
 #else
                info[i++] = "You are poisoned";
 #endif
@@ -3288,7 +3289,7 @@ info[i++] = "
        {
                info2[i]  = report_magics_aux(p_ptr->image);
 #ifdef JP
-info[i++] = "¤¢¤Ê¤¿¤Ï¸¸³Ð¤ò¸«¤Æ¤¤¤ë¡£";
+info[i++] = "¤¢¤Ê¤¿¤Ï¸¸³Ð¤ò¸«¤Æ¤¤¤ë";
 #else
                info[i++] = "You are hallucinating";
 #endif
@@ -3298,7 +3299,7 @@ info[i++] = "
        {
                info2[i]  = report_magics_aux(p_ptr->blessed);
 #ifdef JP
-info[i++] = "¤¢¤Ê¤¿¤Ï¸øÀµ¤µ¤ò´¶¤¸¤Æ¤¤¤ë¡£";
+info[i++] = "¤¢¤Ê¤¿¤Ï¹â·é¤µ¤ò´¶¤¸¤Æ¤¤¤ë";
 #else
                info[i++] = "You feel rightous";
 #endif
@@ -3308,7 +3309,7 @@ info[i++] = "
        {
                info2[i]  = report_magics_aux(p_ptr->hero);
 #ifdef JP
-info[i++] = "¤¢¤Ê¤¿¤Ï¥Ò¡¼¥í¡¼µ¤Ê¬¤À¡£";
+info[i++] = "¤¢¤Ê¤¿¤Ï¥Ò¡¼¥í¡¼µ¤Ê¬¤À";
 #else
                info[i++] = "You feel heroic";
 #endif
@@ -3318,7 +3319,7 @@ info[i++] = "
        {
                info2[i]  = report_magics_aux(p_ptr->shero);
 #ifdef JP
-info[i++] = "¤¢¤Ê¤¿¤ÏÀïÆ®¶¸¤À¡£";
+info[i++] = "¤¢¤Ê¤¿¤ÏÀïÆ®¶¸¤À";
 #else
                info[i++] = "You are in a battle rage";
 #endif
@@ -3328,7 +3329,7 @@ info[i++] = "
        {
                info2[i]  = report_magics_aux(p_ptr->protevil);
 #ifdef JP
-info[i++] = "¤¢¤Ê¤¿¤Ï¼Ù°­¤Ê¤ë¸ºß¤«¤é¼é¤é¤ì¤Æ¤¤¤ë¡£";
+info[i++] = "¤¢¤Ê¤¿¤Ï¼Ù°­¤Ê¤ë¸ºß¤«¤é¼é¤é¤ì¤Æ¤¤¤ë";
 #else
                info[i++] = "You are protected from evil";
 #endif
@@ -3338,7 +3339,7 @@ info[i++] = "
        {
                info2[i]  = report_magics_aux(p_ptr->shield);
 #ifdef JP
-info[i++] = "¤¢¤Ê¤¿¤Ï¿ÀÈë¤Î¥·¡¼¥ë¥É¤Ç¼é¤é¤ì¤Æ¤¤¤ë¡£";
+info[i++] = "¤¢¤Ê¤¿¤Ï¿ÀÈë¤Î¥·¡¼¥ë¥É¤Ç¼é¤é¤ì¤Æ¤¤¤ë";
 #else
                info[i++] = "You are protected by a mystic shield";
 #endif
@@ -3348,7 +3349,7 @@ info[i++] = "
        {
                info2[i]  = report_magics_aux(p_ptr->invuln);
 #ifdef JP
-info[i++] = "̵Ũ¤Ç¤¤¤é¤ì¤ë¡£";
+info[i++] = "¤¢¤Ê¤¿¤Ï̵Ũ¤À";
 #else
                info[i++] = "You are invulnerable";
 #endif
@@ -3358,7 +3359,7 @@ info[i++] = "̵Ũ
        {
                info2[i]  = report_magics_aux(p_ptr->wraith_form);
 #ifdef JP
-info[i++] = "Í©Âβ½¤Ç¤­¤ë¡£";
+info[i++] = "¤¢¤Ê¤¿¤ÏÍ©Â⽤·¤Æ¤¤¤ë";
 #else
                info[i++] = "You are incorporeal";
 #endif
@@ -3368,7 +3369,7 @@ info[i++] = "ͩ
        {
                info2[i]  = 7;
 #ifdef JP
-info[i++] = "¤¢¤Ê¤¿¤Î¼ê¤ÏÀÖ¤¯µ±¤¤¤Æ¤¤¤ë¡£";
+info[i++] = "¤¢¤Ê¤¿¤Î¼ê¤ÏÀÖ¤¯µ±¤¤¤Æ¤¤¤ë";
 #else
                info[i++] = "Your hands are glowing dull red.";
 #endif
@@ -3378,7 +3379,7 @@ info[i++] = "
        {
                info2[i]  = report_magics_aux(p_ptr->word_recall);
 #ifdef JP
-               info[i++] = "¤³¤Î¸åµ¢´Ô¤Î¾Û¤òȯư¤¹¤ë¡£";
+               info[i++] = "¤³¤Î¸åµ¢´Ô¤Î¾Û¤¬È¯Æ°¤¹¤ë";
 #else
                info[i++] = "You are waiting to be recalled";
 #endif
@@ -3388,7 +3389,7 @@ info[i++] = "
        {
                info2[i]  = report_magics_aux(p_ptr->alter_reality);
 #ifdef JP
-               info[i++] = "¤³¤Î¸å¸½¼ÂÊÑÍƤ¬È¯Æ°¤¹¤ë¡£";
+               info[i++] = "¤³¤Î¸å¸½¼ÂÊÑÍƤ¬È¯Æ°¤¹¤ë";
 #else
                info[i++] = "You waiting to be altered";
 #endif
@@ -3398,7 +3399,7 @@ info[i++] = "
        {
                info2[i]  = report_magics_aux(p_ptr->oppose_acid);
 #ifdef JP
-info[i++] = "¤¢¤Ê¤¿¤Ï»À¤Ø¤ÎÂÑÀ­¤ò»ý¤Ã¤Æ¤¤¤ë¡£";
+info[i++] = "¤¢¤Ê¤¿¤Ï»À¤Ø¤ÎÂÑÀ­¤ò»ý¤Ã¤Æ¤¤¤ë";
 #else
                info[i++] = "You are resistant to acid";
 #endif
@@ -3408,7 +3409,7 @@ info[i++] = "
        {
                info2[i]  = report_magics_aux(p_ptr->oppose_elec);
 #ifdef JP
-info[i++] = "¤¢¤Ê¤¿¤ÏÅÅ·â¤Ø¤ÎÂÑÀ­¤ò»ý¤Ã¤Æ¤¤¤ë¡£";
+info[i++] = "¤¢¤Ê¤¿¤ÏÅÅ·â¤Ø¤ÎÂÑÀ­¤ò»ý¤Ã¤Æ¤¤¤ë";
 #else
                info[i++] = "You are resistant to lightning";
 #endif
@@ -3418,7 +3419,7 @@ info[i++] = "
        {
                info2[i]  = report_magics_aux(p_ptr->oppose_fire);
 #ifdef JP
-info[i++] = "¤¢¤Ê¤¿¤Ï²Ð¤Ø¤ÎÂÑÀ­¤ò»ý¤Ã¤Æ¤¤¤ë¡£";
+info[i++] = "¤¢¤Ê¤¿¤Ï²Ð¤Ø¤ÎÂÑÀ­¤ò»ý¤Ã¤Æ¤¤¤ë";
 #else
                info[i++] = "You are resistant to fire";
 #endif
@@ -3428,7 +3429,7 @@ info[i++] = "
        {
                info2[i]  = report_magics_aux(p_ptr->oppose_cold);
 #ifdef JP
-info[i++] = "¤¢¤Ê¤¿¤ÏÎ䵤¤Ø¤ÎÂÑÀ­¤ò»ý¤Ã¤Æ¤¤¤ë¡£";
+info[i++] = "¤¢¤Ê¤¿¤ÏÎ䵤¤Ø¤ÎÂÑÀ­¤ò»ý¤Ã¤Æ¤¤¤ë";
 #else
                info[i++] = "You are resistant to cold";
 #endif
@@ -3438,7 +3439,7 @@ info[i++] = "
        {
                info2[i]  = report_magics_aux(p_ptr->oppose_pois);
 #ifdef JP
-info[i++] = "¤¢¤Ê¤¿¤ÏÆǤؤÎÂÑÀ­¤ò»ý¤Ã¤Æ¤¤¤ë¡£";
+info[i++] = "¤¢¤Ê¤¿¤ÏÆǤؤÎÂÑÀ­¤ò»ý¤Ã¤Æ¤¤¤ë";
 #else
                info[i++] = "You are resistant to poison";
 #endif
@@ -3453,7 +3454,7 @@ info[i++] = "
 
        /* Label the information */
 #ifdef JP
-prt("           ËâË¡        :", 1, 15);
+prt("    ¸½ºß¤«¤«¤Ã¤Æ¤¤¤ëËâË¡     :", 1, 15);
 #else
        prt("     Your Current Magic:", 1, 15);
 #endif
@@ -3464,7 +3465,7 @@ prt("           
        {
                /* Show the info */
 #ifdef JP
-sprintf(Dummy, "¤¢¤Ê¤¿¤Ï%s%s", info[j],
+               sprintf(Dummy, "%-28s : ´ü´Ö - %s ", info[j],
 #else
                sprintf(Dummy, "%s %s.", info[j],
 #endif
@@ -3850,6 +3851,7 @@ bool detect_objects_magic(int range)
                        (tv == TV_CRUSADE_BOOK) ||
                        (tv == TV_MUSIC_BOOK) ||
                        (tv == TV_HISSATSU_BOOK) ||
+                       (tv == TV_HEX_BOOK) ||
                    ((o_ptr->to_a > 0) || (o_ptr->to_h + o_ptr->to_d > 0)))
                {
                        /* Memorize the item */
@@ -4483,17 +4485,17 @@ bool speed_monsters(void)
 /*
  * Slow monsters
  */
-bool slow_monsters(void)
+bool slow_monsters(int power)
 {
-       return (project_hack(GF_OLD_SLOW, p_ptr->lev));
+       return (project_hack(GF_OLD_SLOW, power));
 }
 
 /*
  * Sleep monsters
  */
-bool sleep_monsters(void)
+bool sleep_monsters(int power)
 {
-       return (project_hack(GF_OLD_SLEEP, p_ptr->lev));
+       return (project_hack(GF_OLD_SLEEP, power));
 }
 
 
@@ -4655,14 +4657,25 @@ bool genocide_aux(int m_idx, int power, bool player_cast, int dam_side, cptr spe
 
        else if (m_idx == p_ptr->riding) resist = TRUE;
 
-       else if (p_ptr->inside_quest || p_ptr->inside_arena || p_ptr->inside_battle) resist = TRUE;
+       else if ((p_ptr->inside_quest && !random_quest_number(dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle) resist = TRUE;
 
        else if (player_cast && (r_ptr->level > randint0(power))) resist = TRUE;
 
        else if (player_cast && (m_ptr->mflag2 & MFLAG2_NOGENO)) resist = TRUE;
 
        /* Delete the monster */
-       else delete_monster_idx(m_idx);
+       else
+       {
+               if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
+               {
+                       char m_name[80];
+
+                       monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
+                       do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_GENOCIDE, m_name);
+               }
+
+               delete_monster_idx(m_idx);
+       }
 
        if (resist && player_cast)
        {
@@ -4681,7 +4694,7 @@ bool genocide_aux(int m_idx, int power, bool player_cast, int dam_side, cptr spe
                if (MON_CSLEEP(m_ptr))
                {
                        (void)set_monster_csleep(m_idx, 0);
-                       if (see_m)
+                       if (m_ptr->ml)
                        {
 #ifdef JP
                                msg_format("%^s¤¬Ìܤò³Ð¤Þ¤·¤¿¡£", m_name);
@@ -5140,7 +5153,7 @@ bool destroy_area(int y1, int x1, int r, bool in_generate)
                                                char m_name[80];
 
                                                monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
-                                               do_cmd_write_nikki(NIKKI_NAMED_PET, 6, m_name);
+                                               do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_DESTROY, m_name);
                                        }
 
                                        /* Delete the monster (if any) */
@@ -5687,7 +5700,7 @@ bool earthquake_aux(int cy, int cx, int r, int m_idx)
                                                                char m2_name[80];
 
                                                                monster_desc(m2_name, m_ptr, MD_INDEF_VISIBLE);
-                                                               do_cmd_write_nikki(NIKKI_NAMED_PET, 7, m2_name);
+                                                               do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_EARTHQUAKE, m2_name);
                                                        }
                                                }
 
@@ -5909,6 +5922,15 @@ void discharge_minion(void)
                project(i, 2+(r_ptr->level/20), m_ptr->fy,
                        m_ptr->fx, dam, GF_PLASMA, 
                        PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL, -1);
+
+               if (record_named_pet && m_ptr->nickname)
+               {
+                       char m_name[80];
+
+                       monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
+                       do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_BLAST, m_name);
+               }
+
                delete_monster_idx(i);
        }
 }
@@ -5975,7 +5997,7 @@ static void cave_temp_room_lite(void)
                                (void)set_monster_csleep(c_ptr->m_idx, 0);
 
                                /* Notice the "waking up" */
-                               if (is_seen(m_ptr))
+                               if (m_ptr->ml)
                                {
                                        char m_name[80];
 
@@ -6660,7 +6682,8 @@ bool project_hook(int typ, int dir, int dam, int flg)
  */
 bool fire_bolt(int typ, int dir, int dam)
 {
-       int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE | PROJECT_GRID;
+       int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_GRID;
+       if (typ != GF_ARROW) flg |= PROJECT_REFLECTABLE;
        return (project_hook(typ, dir, dam, flg));
 }
 
@@ -6696,10 +6719,10 @@ bool fire_bolt_or_beam(int prob, int typ, int dir, int dam)
 /*
  * Some of the old functions
  */
-bool lite_line(int dir)
+bool lite_line(int dir, int dam)
 {
        int flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_KILL;
-       return (project_hook(GF_LITE_WEAK, dir, damroll(6, 8), flg));
+       return (project_hook(GF_LITE_WEAK, dir, dam, flg));
 }
 
 
@@ -6710,10 +6733,10 @@ bool drain_life(int dir, int dam)
 }
 
 
-bool wall_to_mud(int dir)
+bool wall_to_mud(int dir, int dam)
 {
        int flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
-       return (project_hook(GF_KILL_WALL, dir, 20 + randint1(30), flg));
+       return (project_hook(GF_KILL_WALL, dir, dam, flg));
 }
 
 
@@ -6745,24 +6768,24 @@ bool heal_monster(int dir, int dam)
 }
 
 
-bool speed_monster(int dir)
+bool speed_monster(int dir, int power)
 {
        int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
-       return (project_hook(GF_OLD_SPEED, dir, p_ptr->lev, flg));
+       return (project_hook(GF_OLD_SPEED, dir, power, flg));
 }
 
 
-bool slow_monster(int dir)
+bool slow_monster(int dir, int power)
 {
        int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
-       return (project_hook(GF_OLD_SLOW, dir, p_ptr->lev, flg));
+       return (project_hook(GF_OLD_SLOW, dir, power, flg));
 }
 
 
-bool sleep_monster(int dir)
+bool sleep_monster(int dir, int power)
 {
        int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
-       return (project_hook(GF_OLD_SLEEP, dir, p_ptr->lev, flg));
+       return (project_hook(GF_OLD_SLEEP, dir, power, flg));
 }
 
 
@@ -6792,10 +6815,10 @@ bool stun_monster(int dir, int plev)
 }
 
 
-bool poly_monster(int dir)
+bool poly_monster(int dir, int power)
 {
        int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
-       bool tester = (project_hook(GF_OLD_POLY, dir, p_ptr->lev, flg));
+       bool tester = (project_hook(GF_OLD_POLY, dir, power, flg));
        if (tester)
                chg_virtue(V_CHANCE, 1);
        return(tester);
@@ -6823,10 +6846,10 @@ bool death_ray(int dir, int plev)
 }
 
 
-bool teleport_monster(int dir)
+bool teleport_monster(int dir, int distance)
 {
        int flg = PROJECT_BEAM | PROJECT_KILL;
-       return (project_hook(GF_AWAY_ALL, dir, MAX_SIGHT * 5, flg));
+       return (project_hook(GF_AWAY_ALL, dir, distance, flg));
 }
 
 /*
@@ -6882,6 +6905,11 @@ bool destroy_doors_touch(void)
        return (project(0, 1, py, px, 0, GF_KILL_DOOR, flg, -1));
 }
 
+bool disarm_traps_touch(void)
+{
+       int flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
+       return (project(0, 1, py, px, 0, GF_KILL_TRAP, flg, -1));
+}
 
 bool sleep_monsters_touch(void)
 {
@@ -7379,14 +7407,15 @@ bool charm_living(int dir, int plev)
 }
 
 
-void kawarimi(bool success)
+bool kawarimi(bool success)
 {
        object_type forge;
        object_type *q_ptr = &forge;
        int y, x;
 
-       if (p_ptr->confused || p_ptr->blind || p_ptr->paralyzed || p_ptr->image) return;
-       if (randint0(200) < p_ptr->stun) return;
+       if (p_ptr->is_dead) return FALSE;
+       if (p_ptr->confused || p_ptr->blind || p_ptr->paralyzed || p_ptr->image) return FALSE;
+       if (randint0(200) < p_ptr->stun) return FALSE;
 
        if (!success && one_in_(3))
        {
@@ -7397,7 +7426,7 @@ void kawarimi(bool success)
 #endif
                p_ptr->special_defense &= ~(NINJA_KAWARIMI);
                p_ptr->redraw |= (PR_STATUS);
-               return;
+               return FALSE;
        }
 
        y = py;
@@ -7424,6 +7453,9 @@ void kawarimi(bool success)
 
        p_ptr->special_defense &= ~(NINJA_KAWARIMI);
        p_ptr->redraw |= (PR_STATUS);
+
+       /* Teleported */
+       return TRUE;
 }