OSDN Git Service

アリーナ/モンスター格闘場外で待機中のペットを現在のペットリストに, 名
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Thu, 12 Jun 2003 17:51:42 +0000 (17:51 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Thu, 12 Jun 2003 17:51:42 +0000 (17:51 +0000)
前付きであればダンプにも載せるように修正. また, ペットリストでも(乗馬
中)表記がかぶらないように修正. なお, この過程でlook_mon_desc()はm_idx
渡しではなくm_ptr渡しに変更. また, monster_desc()には待機中のペットと
仮定して表記するモードを追加.

src/cmd4.c
src/externs.h
src/files.c
src/monster2.c
src/xtra2.c

index d2d0908..19e0b5a 100644 (file)
@@ -6975,6 +6975,7 @@ static void do_cmd_knowledge_pets(void)
        int             i;
        FILE            *fff;
        monster_type    *m_ptr;
+       char            pet_name[80];
        int             t_friends = 0;
        int             show_upkeep = 0;
        char            file_name[1024];
@@ -7004,20 +7005,28 @@ static void do_cmd_knowledge_pets(void)
                /* Calculate "upkeep" for pets */
                if (is_pet(m_ptr))
                {
-                       char pet_name[80];
                        t_friends++;
                        monster_desc(pet_name, m_ptr, 0x88);
-                       fprintf(fff, "%s (%s)", pet_name, look_mon_desc(i, 0x00));
-                       if (p_ptr->riding == i)
-#ifdef JP
-                               fprintf(fff, " ¾èÇÏÃæ");
-#else
-                               fprintf(fff, " Riding");
-#endif
-                       fprintf(fff, "\n");
+                       fprintf(fff, "%s (%s)\n", pet_name, look_mon_desc(m_ptr, 0x00));
                }
        }
 
+       /* Process the waiting pets (backwards) */
+       for (i = MAX_PARTY_MON - 1; i >= 0; i--)
+       {
+               /* Access the monster */
+               m_ptr = &party_mon[i];
+
+               /* Ignore "dead" monsters */
+               if (!m_ptr->r_idx) continue;
+
+               t_friends++;
+
+               /* List waiting pets */
+               monster_desc(pet_name, m_ptr, 0x488);
+               fprintf(fff, "%s (%s)\n", pet_name, look_mon_desc(m_ptr, 0x00));
+       }
+
        show_upkeep = calculate_upkeep();
 
        fprintf(fff, "----------------------------------------------\n");
index 39f3e6f..7d94d4c 100644 (file)
@@ -1328,7 +1328,7 @@ extern void resize_map(void);
 extern void redraw_window(void);
 extern bool change_panel(int dy, int dx);
 extern void verify_panel(void);
-extern cptr look_mon_desc(int m_idx, u32b mode);
+extern cptr look_mon_desc(monster_type *m_ptr, u32b mode);
 extern void ang_sort_aux(vptr u, vptr v, int p, int q);
 extern void ang_sort(vptr u, vptr v, int n);
 extern bool target_able(int m_idx);
index f47dada..9331d76 100644 (file)
@@ -4072,11 +4072,11 @@ errr make_character_dump(FILE *fff)
 
        {
                bool pet = FALSE;
+               char pet_name[80];
 
                for (i = m_max - 1; i >= 1; i--)
                {
                        monster_type *m_ptr = &m_list[i];
-                       char pet_name[80];
 
                        if (!m_ptr->r_idx) continue;
                        if (!is_pet(m_ptr)) continue;
@@ -4093,6 +4093,26 @@ errr make_character_dump(FILE *fff)
                        monster_desc(pet_name, m_ptr, 0x88);
                        fprintf(fff, "%s\n", pet_name);
                }
+
+               for (i = MAX_PARTY_MON - 1; i >= 0; i--)
+               {
+                       monster_type *m_ptr = &party_mon[i];
+
+                       if (!m_ptr->r_idx) continue;
+                       if (!m_ptr->nickname) continue;
+                       if (!pet)
+                       {
+#ifdef JP
+                               fprintf(fff, "\n  [¼ç¤Ê¥Ú¥Ã¥È]\n\n");
+#else
+                               fprintf(fff, "\n  [leading pets]\n\n");
+#endif
+                               pet = TRUE;
+                       }
+                       monster_desc(pet_name, m_ptr, 0x488);
+                       fprintf(fff, "%s\n", pet_name);
+               }
+
                if (pet) fprintf(fff, "\n");
        }
 
index c93a4c9..f2b1276 100644 (file)
@@ -1524,6 +1524,7 @@ s16b get_mon_num(int level)
  *   0x80 --> Assume the monster is visible
  *  0x100 --> Chameleon's true name
  *  0x200 --> Ignore hallucination, and penetrate shape change
+ *  0x400 --> Assume this monster pet waiting outside the floor
  *
  * Useful Modes:
  *   0x00 --> Full nominative name ("the kobold") or "it"
@@ -1838,6 +1839,15 @@ if (!get_rnd_line("silly_j.txt", m_ptr->r_idx, silly_name))
                        strcat(desc, format("(%s)", r_name + r_info[m_ptr->r_idx].name));
                }
 
+               if (mode & 0x400)
+               {
+#ifdef JP
+                       strcat(desc,"(ÂÔµ¡Ãæ)");
+#else
+                       strcat(desc,"(waiting)");
+#endif
+               }
+
                /* Handle the Possessive as a special afterthought */
                if (mode & 0x02)
                {
index 8b90199..498cde4 100644 (file)
@@ -2422,9 +2422,8 @@ void verify_panel(void)
 /*
  * Monster health description
  */
-cptr look_mon_desc(int m_idx, u32b mode)
+cptr look_mon_desc(monster_type *m_ptr, u32b mode)
 {
-       monster_type *m_ptr = &m_list[m_idx];
        monster_race *ap_r_ptr = &r_info[m_ptr->ap_r_idx];
        bool         living;
        int          perc;
@@ -3212,9 +3211,9 @@ static int target_set_aux(int y, int x, int mode, cptr info)
                        evaluate_monster_exp(acount, m_ptr);
 
 #ifdef JP
-                       sprintf(out_val, "[%s]%s%s(%s)%s%s [r»× %s%s]", acount, s1, m_name, look_mon_desc(c_ptr->m_idx, 0x01), s2, s3, x_info, info);
+                       sprintf(out_val, "[%s]%s%s(%s)%s%s [r»× %s%s]", acount, s1, m_name, look_mon_desc(m_ptr, 0x01), s2, s3, x_info, info);
 #else
-                       sprintf(out_val, "[%s]%s%s%s%s(%s) [r, %s%s]", acount, s1, s2, s3, m_name, look_mon_desc(c_ptr->m_idx, 0x01), x_info, info);
+                       sprintf(out_val, "[%s]%s%s%s%s(%s) [r, %s%s]", acount, s1, s2, s3, m_name, look_mon_desc(m_ptr, 0x01), x_info, info);
 #endif
 
                        prt(out_val, 0, 0);