OSDN Git Service

add type casting for fprintf
[hengband/hengband.git] / src / spells2.c
index 8846584..2359722 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;
@@ -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 */
@@ -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];