OSDN Git Service

帰還に関する変更.
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Tue, 2 Sep 2003 19:13:22 +0000 (19:13 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Tue, 2 Sep 2003 19:13:22 +0000 (19:13 +0000)
* トランプの塔での階層指定テレポート時のダンジョン選択メニュー表示部
  分を帰還とフロア・リセットで用いられるchoose_dungeon()に統合. この
  都合で, 階層指定テレポート時の表示レイアウトが少しだけ変わった.
* vanilla_town, lite_town, ironman_downward時は入れるダンジョンは鉄獄
  だけであるため, 複数ダンジョンが選べるような操作ではメニューを出さ
  ずに自動的に鉄獄だけが選ばれるように変更.
* 入ったダンジョンが1つもない場合はメニューの代わりにエラーメッセージ
  を出すように変更. エラーメッセージはどのキーを押しても消える.

src/bldg.c
src/externs.h
src/spells3.c

index 487e4f7..6424768 100644 (file)
@@ -4743,66 +4743,16 @@ msg_print("
        case BACT_TELEPORT_LEVEL:
        {
                int select_dungeon;
-               int i, num = 0;
-               s16b *dun;
                int max_depth;
 
-               /* Allocate the "dun" array */
-               C_MAKE(dun, max_d_idx, s16b);
-
-               screen_save();
                clear_bldg(4, 20);
-
-               for(i = 1; i < max_d_idx; i++)
-               {
-                       char buf[80];
-                       bool seiha = FALSE;
-
-                       if (!d_info[i].maxdepth) continue;
-                       if (!max_dlv[i]) continue;
-                       if (d_info[i].final_guardian)
-                       {
-                               if (!r_info[d_info[i].final_guardian].max_num) seiha = TRUE;
-                       }
-                       else if (max_dlv[i] == d_info[i].maxdepth) seiha = TRUE;
-
 #ifdef JP
-                       sprintf(buf,"%c) %c%-12s : ºÇÂç %d ³¬", 'a'+num, seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
+               select_dungeon = choose_dungeon("¤Ë¥Æ¥ì¥Ý¡¼¥È", 4, 0);
 #else
-                       sprintf(buf,"%c) %c%-12s : Max level %d", 'a'+num, seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
+               select_dungeon = choose_dungeon("teleport", 4, 0);
 #endif
-                       put_str(buf, 4+num, 5);
-                       dun[num] = i;
-                       num++;
-               }
-#ifdef JP
-               prt("¤É¤Î¥À¥ó¥¸¥ç¥ó¤Ë¥Æ¥ì¥Ý¡¼¥È¤·¤Þ¤¹¤«:", 0, 0);
-#else
-               prt("Which dungeon do you teleport?: ", 0, 0);
-#endif
-               while(1)
-               {
-                       i = inkey();
-
-                       if (i == ESCAPE)
-                       {
-                               /* Free the "dun" array */
-                               C_KILL(dun, max_d_idx, s16b);
-
-                               screen_load();
-                               return;
-                       }
-                       if (i >= 'a' && i <('a'+num))
-                       {
-                               select_dungeon = dun[i-'a'];
-                               break;
-                       }
-                       else bell();
-               }
-               screen_load();
-
-               /* Free the "dun" array */
-               C_KILL(dun, max_d_idx, s16b);
+               show_building(bldg);
+               if (!select_dungeon) return;
 
                max_depth = d_info[select_dungeon].maxdepth;
 
index ed9e82a..bc276fb 100644 (file)
@@ -1077,6 +1077,7 @@ extern void teleport_monster_to(int m_idx, int ty, int tx, int power);
 extern void teleport_player(int dis);
 extern void teleport_player_to(int ny, int nx, bool no_tele);
 extern void teleport_level(int m_idx);
+extern int choose_dungeon(cptr note, int y, int x);
 extern bool recall_player(int turns);
 extern bool word_of_recall(void);
 extern bool reset_recall(void);
index 81021d2..10aae70 100644 (file)
@@ -697,12 +697,28 @@ void teleport_level(int m_idx)
 
 
 
-static int choose_dungeon(cptr note)
+int choose_dungeon(cptr note, int y, int x)
 {
        int select_dungeon;
        int i, num = 0;
        s16b *dun;
 
+       /* Hack -- No need to choose dungeon in some case */
+       if (lite_town || vanilla_town || ironman_downward)
+       {
+               if (max_dlv[DUNGEON_ANGBAND]) return DUNGEON_ANGBAND;
+               else
+               {
+#ifdef JP
+                       msg_format("¤Þ¤À%s¤ËÆþ¤Ã¤¿¤³¤È¤Ï¤Ê¤¤¡£", d_name + d_info[DUNGEON_ANGBAND].name);
+#else
+                       msg_format("You haven't entered %s yet.", d_name + d_info[DUNGEON_ANGBAND].name);
+#endif
+                       msg_print(NULL);
+                       return 0;
+               }
+       }
+
        /* Allocate the "dun" array */
        C_MAKE(dun, max_d_idx, s16b);
 
@@ -725,9 +741,19 @@ static int choose_dungeon(cptr note)
 #else
                sprintf(buf,"      %c) %c%-16s : Max level %d", 'a'+num, seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
 #endif
-               prt(buf, 2+num, 14);
+               prt(buf, y + num, x);
                dun[num++] = i;
        }
+
+       if (!num)
+       {
+#ifdef JP
+               prt("      Áª¤Ù¤ë¥À¥ó¥¸¥ç¥ó¤¬¤Ê¤¤¡£", y, x);
+#else
+               prt("      No dungeon is available.", y, x);
+#endif
+       }
+
 #ifdef JP
        prt(format("¤É¤Î¥À¥ó¥¸¥ç¥ó%s¤·¤Þ¤¹¤«:", note), 0, 0);
 #else
@@ -736,7 +762,7 @@ static int choose_dungeon(cptr note)
        while(1)
        {
                i = inkey();
-               if (i == ESCAPE)
+               if ((i == ESCAPE) || !num)
                {
                        /* Free the "dun" array */
                        C_KILL(dun, max_d_idx, s16b);
@@ -806,9 +832,9 @@ if (get_check("
                {
                        int select_dungeon;
 #ifdef JP
-                       select_dungeon = choose_dungeon("¤Ëµ¢´Ô");
+                       select_dungeon = choose_dungeon("¤Ëµ¢´Ô", 2, 14);
 #else
-                       select_dungeon = choose_dungeon("recall");
+                       select_dungeon = choose_dungeon("recall", 2, 14);
 #endif
                        if (!select_dungeon) return FALSE;
                        p_ptr->recall_dungeon = select_dungeon;
@@ -850,9 +876,9 @@ bool reset_recall(void)
        char tmp_val[160];
 
 #ifdef JP
-       select_dungeon = choose_dungeon("¤ò¥»¥Ã¥È");
+       select_dungeon = choose_dungeon("¤ò¥»¥Ã¥È", 2, 14);
 #else
-       select_dungeon = choose_dungeon("reset");
+       select_dungeon = choose_dungeon("reset", 2, 14);
 #endif
 
        /* Ironman option */