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;
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);
-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);
#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
while(1)
{
i = inkey();
- if (i == ESCAPE)
+ if ((i == ESCAPE) || !num)
{
/* Free the "dun" array */
C_KILL(dun, max_d_idx, s16b);
{
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;
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 */