1 /* NetHack 3.6 cmd.c $NHDT-Date: 1446975462 2015/11/08 09:37:42 $ $NHDT-Branch: master $:$NHDT-Revision: 1.206 $ */
2 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3 /* NetHack may be freely redistributed. See license for details. */
5 /* JNetHack Copyright */
6 /* (c) Issei Numata, Naoki Hamada, Shigehiro Miyashita, 1994-2000 */
7 /* For 3.4-, Copyright (c) SHIRAKATA Kentaro, 2002-2016 */
8 /* JNetHack may be freely redistributed. See license for details. */
14 STATIC_VAR boolean alt_esc = FALSE;
17 struct cmd Cmd = { 0 }; /* flag.h */
19 extern const char *hu_stat[]; /* hunger status from eat.c */
20 extern const char *enc_stat[]; /* encumbrance status from botl.c */
24 * Some systems may have getchar() return EOF for various reasons, and
25 * we should not quit before seeing at least NR_OF_EOFS consecutive EOFs.
27 #if defined(SYSV) || defined(DGUX) || defined(HPUX)
32 #define CMD_TRAVEL (char) 0x90
33 #define CMD_CLICKLOOK (char) 0x8F
36 extern int NDECL(wiz_debug_cmd_bury);
37 extern int NDECL(wiz_debug_cmd_traveldisplay);
40 #ifdef DUMB /* stuff commented out in extern.h, but needed here */
41 extern int NDECL(doapply); /**/
42 extern int NDECL(dorub); /**/
43 extern int NDECL(dojump); /**/
44 extern int NDECL(doextlist); /**/
45 extern int NDECL(enter_explore_mode); /**/
46 extern int NDECL(dodrop); /**/
47 extern int NDECL(doddrop); /**/
48 extern int NDECL(dodown); /**/
49 extern int NDECL(doup); /**/
50 extern int NDECL(donull); /**/
51 extern int NDECL(dowipe); /**/
52 extern int NDECL(docallcnd); /**/
53 extern int NDECL(dotakeoff); /**/
54 extern int NDECL(doremring); /**/
55 extern int NDECL(dowear); /**/
56 extern int NDECL(doputon); /**/
57 extern int NDECL(doddoremarm); /**/
58 extern int NDECL(dokick); /**/
59 extern int NDECL(dofire); /**/
60 extern int NDECL(dothrow); /**/
61 extern int NDECL(doeat); /**/
62 extern int NDECL(done2); /**/
63 extern int NDECL(vanquished); /**/
64 extern int NDECL(doengrave); /**/
65 extern int NDECL(dopickup); /**/
66 extern int NDECL(ddoinv); /**/
67 extern int NDECL(dotypeinv); /**/
68 extern int NDECL(dolook); /**/
69 extern int NDECL(doprgold); /**/
70 extern int NDECL(doprwep); /**/
71 extern int NDECL(doprarm); /**/
72 extern int NDECL(doprring); /**/
73 extern int NDECL(dopramulet); /**/
74 extern int NDECL(doprtool); /**/
75 extern int NDECL(dosuspend); /**/
76 extern int NDECL(doforce); /**/
77 extern int NDECL(doopen); /**/
78 extern int NDECL(doclose); /**/
79 extern int NDECL(dosh); /**/
80 extern int NDECL(dodiscovered); /**/
81 extern int NDECL(doclassdisco); /**/
82 extern int NDECL(doset); /**/
83 extern int NDECL(dotogglepickup); /**/
84 extern int NDECL(dowhatis); /**/
85 extern int NDECL(doquickwhatis); /**/
86 extern int NDECL(dowhatdoes); /**/
87 extern int NDECL(dohelp); /**/
88 extern int NDECL(dohistory); /**/
89 extern int NDECL(doloot); /**/
90 extern int NDECL(dodrink); /**/
91 extern int NDECL(dodip); /**/
92 extern int NDECL(dosacrifice); /**/
93 extern int NDECL(dopray); /**/
94 extern int NDECL(dotip); /**/
95 extern int NDECL(doturn); /**/
96 extern int NDECL(doredraw); /**/
97 extern int NDECL(doread); /**/
98 extern int NDECL(dosave); /**/
99 extern int NDECL(dosearch); /**/
100 extern int NDECL(doidtrap); /**/
101 extern int NDECL(dopay); /**/
102 extern int NDECL(dosit); /**/
103 extern int NDECL(dotalk); /**/
104 extern int NDECL(docast); /**/
105 extern int NDECL(dovspell); /**/
106 extern int NDECL(dotele); /**/
107 extern int NDECL(dountrap); /**/
108 extern int NDECL(doversion); /**/
109 extern int NDECL(doextversion); /**/
110 extern int NDECL(doswapweapon); /**/
111 extern int NDECL(dowield); /**/
112 extern int NDECL(dowieldquiver); /**/
113 extern int NDECL(dozap); /**/
114 extern int NDECL(doorganize); /**/
117 static int NDECL(dosuspend_core); /**/
119 static int NDECL((*timed_occ_fn));
121 STATIC_PTR int NDECL(doprev_message);
122 STATIC_PTR int NDECL(timed_occupation);
123 STATIC_PTR int NDECL(doextcmd);
124 STATIC_PTR int NDECL(domonability);
125 STATIC_PTR int NDECL(dooverview_or_wiz_where);
126 STATIC_PTR int NDECL(dotravel);
127 STATIC_PTR int NDECL(doterrain);
128 STATIC_PTR int NDECL(wiz_wish);
129 STATIC_PTR int NDECL(wiz_identify);
130 STATIC_PTR int NDECL(wiz_map);
131 STATIC_PTR int NDECL(wiz_genesis);
132 STATIC_PTR int NDECL(wiz_where);
133 STATIC_PTR int NDECL(wiz_detect);
134 STATIC_PTR int NDECL(wiz_panic);
135 STATIC_PTR int NDECL(wiz_polyself);
136 STATIC_PTR int NDECL(wiz_level_tele);
137 STATIC_PTR int NDECL(wiz_level_change);
138 STATIC_PTR int NDECL(wiz_show_seenv);
139 STATIC_PTR int NDECL(wiz_show_vision);
140 STATIC_PTR int NDECL(wiz_smell);
141 STATIC_PTR int NDECL(wiz_mon_polycontrol);
142 STATIC_PTR int NDECL(wiz_show_wmodes);
143 STATIC_DCL void NDECL(wiz_map_levltyp);
144 STATIC_DCL void NDECL(wiz_levltyp_legend);
145 #if defined(__BORLANDC__) && !defined(_WIN32)
146 extern void FDECL(show_borlandc_stats, (winid));
148 #ifdef DEBUG_MIGRATING_MONS
149 STATIC_PTR int NDECL(wiz_migrate_mons);
151 STATIC_DCL int FDECL(size_monst, (struct monst *));
152 STATIC_DCL int FDECL(size_obj, (struct obj *));
153 STATIC_DCL void FDECL(count_obj, (struct obj *, long *, long *,
154 BOOLEAN_P, BOOLEAN_P));
155 STATIC_DCL void FDECL(obj_chain, (winid, const char *, struct obj *,
157 STATIC_DCL void FDECL(mon_invent_chain, (winid, const char *, struct monst *,
159 STATIC_DCL void FDECL(mon_chain, (winid, const char *, struct monst *,
161 STATIC_DCL void FDECL(contained, (winid, const char *, long *, long *));
162 STATIC_PTR int NDECL(wiz_show_stats);
163 STATIC_DCL boolean FDECL(accept_menu_prefix, (int NDECL((*))));
165 STATIC_DCL int NDECL(wiz_port_debug);
167 STATIC_PTR int NDECL(wiz_rumor_check);
168 STATIC_DCL char FDECL(cmd_from_func, (int NDECL((*))));
169 STATIC_PTR int NDECL(doattributes);
170 STATIC_PTR int NDECL(doconduct); /**/
172 STATIC_DCL void FDECL(enlght_line, (const char *, const char *, const char *,
174 STATIC_DCL char *FDECL(enlght_combatinc, (const char *, int, int, char *));
175 STATIC_DCL void FDECL(enlght_halfdmg, (int, int));
176 STATIC_DCL boolean NDECL(walking_on_water);
177 STATIC_DCL boolean FDECL(cause_known, (int));
178 STATIC_DCL char *FDECL(attrval, (int, int, char *));
179 STATIC_DCL void FDECL(background_enlightenment, (int, int));
180 STATIC_DCL void FDECL(characteristics_enlightenment, (int, int));
181 STATIC_DCL void FDECL(one_characteristic, (int, int, int));
182 STATIC_DCL void FDECL(status_enlightenment, (int, int));
183 STATIC_DCL void FDECL(attributes_enlightenment, (int, int));
185 static const char *readchar_queue = "";
186 static coord clicklook_cc;
188 STATIC_DCL char *NDECL(parse);
189 STATIC_DCL boolean FDECL(help_dir, (CHAR_P, const char *));
192 doprev_message(VOID_ARGS)
194 return nh_doprev_message();
197 /* Count down by decrementing multi */
199 timed_occupation(VOID_ARGS)
207 /* If you have moved since initially setting some occupations, they
208 * now shouldn't be able to restart.
210 * The basic rule is that if you are carrying it, you can continue
211 * since it is with you. If you are acting on something at a distance,
212 * your orientation to it must have changed when you moved.
214 * The exception to this is taking off items, since they can be taken
215 * off in a number of ways in the intervening time, screwing up ordering.
217 * Currently: Take off all armor.
218 * Picking Locks / Forcing Chests.
229 /* If a time is given, use it to timeout this function, otherwise the
230 * function times out by its own means.
233 set_occupation(fn, txt, xtime)
239 occupation = timed_occupation;
248 STATIC_DCL char NDECL(popch);
250 /* Provide a means to redo the last command. The flag `in_doagain' is set
251 * to true while redoing the command. This flag is tested in commands that
252 * require additional input (like `throw' which requires a thing and a
253 * direction), and the input prompt is not shown. Also, while in_doagain is
254 * TRUE, no keystrokes can be saved into the saveq.
257 static char pushq[BSIZE], saveq[BSIZE];
258 static NEARDATA int phead, ptail, shead, stail;
263 /* If occupied, return '\0', letting tgetch know a character should
264 * be read from the keyboard. If the character read is not the
265 * ABORT character (as checked in pcmain.c), that character will be
266 * pushed back on the pushq.
271 return (char) ((shead != stail) ? saveq[stail++] : '\0');
273 return (char) ((phead != ptail) ? pushq[ptail++] : '\0');
277 pgetchar() /* courtesy of aeb@cwi.nl */
286 /* A ch == 0 resets the pushq */
298 /* A ch == 0 resets the saveq. Only save keystrokes when not
299 * replaying a previous command.
307 phead = ptail = shead = stail = 0;
308 else if (shead < BSIZE)
314 /* here after # - now read a full-word command */
321 /* keep repeating until we don't run help or quit */
327 func = extcmdlist[idx].ef_funct;
328 if (iflags.menu_requested && !accept_menu_prefix(func)) {
330 pline("'m' prefix has no effect for this command.");
332 pline("'m'
\90Ú
\93ª
\8e«
\82Í
\82±
\82Ì
\83R
\83}
\83\93\83h
\82É
\82Í
\96³
\8cø
\81D");
333 iflags.menu_requested = FALSE;
336 } while (func == doextlist);
341 /* here after #? - now list all full-word commands */
345 register const struct ext_func_tab *efp;
349 datawin = create_nhwindow(NHW_TEXT);
350 putstr(datawin, 0, "");
352 putstr(datawin, 0, " Extended Commands List");
354 putstr(datawin, 0, "
\8ag
\92£
\83R
\83}
\83\93\83h
\88ê
\97\97");
355 putstr(datawin, 0, "");
357 putstr(datawin, 0, " Press '#', then type:");
359 putstr(datawin, 0, " '#'
\82ð
\89\9f\82µ
\82½
\82 \82Æ
\83^
\83C
\83v
\82¹
\82æ:");
360 putstr(datawin, 0, "");
362 for (efp = extcmdlist; efp->ef_txt; efp++) {
363 Sprintf(buf, " %-15s - %s.", efp->ef_txt, efp->ef_desc);
364 putstr(datawin, 0, buf);
366 display_nhwindow(datawin, FALSE);
367 destroy_nhwindow(datawin);
372 #define MAX_EXT_CMD 50 /* Change if we ever have > 50 ext cmds */
375 * This is currently used only by the tty port and is
376 * controlled via runtime option 'extmenu'.
377 * ``# ?'' is counted towards the limit of the number of commands,
378 * so we actually support MAX_EXT_CMD-1 "real" extended commands.
380 * Here after # - now show pick-list of possible commands.
385 const struct ext_func_tab *efp;
386 menu_item *pick_list = (menu_item *) 0;
389 const struct ext_func_tab *choices[MAX_EXT_CMD + 1];
391 char cbuf[QBUFSZ], prompt[QBUFSZ], fmtstr[20];
392 int i, n, nchoices, acount;
394 int accelerator, prevaccelerator;
403 /* populate choices */
404 for (efp = extcmdlist; efp->ef_txt; efp++) {
405 if (!matchlevel || !strncmp(efp->ef_txt, cbuf, matchlevel)) {
407 if ((int) strlen(efp->ef_desc) > biggest) {
408 biggest = strlen(efp->ef_desc);
409 Sprintf(fmtstr, "%%-%ds", biggest + 15);
411 if (++i > MAX_EXT_CMD) {
414 "Exceeded %d extended commands in doextcmd() menu; 'extmenu' disabled.",
422 choices[i] = (struct ext_func_tab *) 0;
424 /* if we're down to one, we have our selection so get out of here */
426 for (i = 0; extcmdlist[i].ef_txt != (char *) 0; i++)
427 if (!strncmpi(extcmdlist[i].ef_txt, cbuf, matchlevel)) {
435 win = create_nhwindow(NHW_MENU);
437 accelerator = prevaccelerator = 0;
439 for (i = 0; choices[i]; ++i) {
440 accelerator = choices[i]->ef_txt[matchlevel];
441 if (accelerator != prevaccelerator || nchoices < (ROWNO - 3)) {
443 /* flush extended cmds for that letter already in buf */
444 Sprintf(buf, fmtstr, prompt);
445 any.a_char = prevaccelerator;
446 add_menu(win, NO_GLYPH, &any, any.a_char, 0, ATR_NONE,
451 prevaccelerator = accelerator;
452 if (!acount || nchoices < (ROWNO - 3)) {
453 Sprintf(prompt, "%s [%s]", choices[i]->ef_txt,
454 choices[i]->ef_desc);
455 } else if (acount == 1) {
457 Sprintf(prompt, "%s or %s", choices[i - 1]->ef_txt,
459 Sprintf(prompt, "%s
\82Ü
\82½
\82Í %s", choices[i-1]->ef_txt,
463 Strcat(prompt, " or ");
465 Strcat(prompt,"
\82Ü
\82½
\82Í ");
466 Strcat(prompt, choices[i]->ef_txt);
472 Sprintf(buf, fmtstr, prompt);
473 any.a_char = prevaccelerator;
474 add_menu(win, NO_GLYPH, &any, any.a_char, 0, ATR_NONE, buf,
478 Sprintf(prompt, "Extended Command: %s", cbuf);
480 Sprintf(prompt, "
\8ag
\92£
\83R
\83}
\83\93\83h: %s", cbuf);
481 end_menu(win, prompt);
482 n = select_menu(win, PICK_ONE, &pick_list);
483 destroy_nhwindow(win);
485 if (matchlevel > (QBUFSZ - 2)) {
486 free((genericptr_t) pick_list);
488 impossible("Too many chars (%d) entered in extcmd_via_menu()",
493 cbuf[matchlevel++] = pick_list[0].item.a_char;
494 cbuf[matchlevel] = '\0';
495 free((genericptr_t) pick_list);
507 #endif /* TTY_GRAPHICS */
509 /* #monster command - use special monster ability while polymorphed */
511 domonability(VOID_ARGS)
513 if (can_breathe(youmonst.data))
515 else if (attacktype(youmonst.data, AT_SPIT))
517 else if (youmonst.data->mlet == S_NYMPH)
519 else if (attacktype(youmonst.data, AT_GAZE))
521 else if (is_were(youmonst.data))
523 else if (webmaker(youmonst.data))
525 else if (is_hider(youmonst.data))
527 else if (is_mind_flayer(youmonst.data))
528 return domindblast();
529 else if (u.umonnum == PM_GREMLIN) {
530 if (IS_FOUNTAIN(levl[u.ux][u.uy].typ)) {
531 if (split_mon(&youmonst, (struct monst *) 0))
532 dryup(u.ux, u.uy, TRUE);
535 There("is no fountain here.");
537 pline("
\82±
\82±
\82É
\82Í
\90ò
\82Í
\82È
\82¢
\81D");
538 } else if (is_unicorn(youmonst.data)) {
539 use_unicorn_horn((struct obj *) 0);
541 } else if (youmonst.data->msound == MS_SHRIEK) {
545 You("
\8bà
\90Ø
\82è
\90º
\82ð
\82 \82°
\82½
\81D");
548 pline("Unfortunately sound does not carry well through rock.");
550 pline("
\8ec
\94O
\82È
\82ª
\82ç
\89¹
\82Í
\8aâ
\82ð
\82¤
\82Ü
\82
\93`
\82í
\82ç
\82È
\82¢
\81D");
553 } else if (youmonst.data->mlet == S_VAMPIRE)
557 pline("Any special ability you may have is purely reflexive.");
559 pline("
\82 \82È
\82½
\82Ì
\8e\9d\82Á
\82Ä
\82¢
\82é
\93Á
\8eê
\94\
\97Í
\82Í
\82Ç
\82ê
\82à
\8eó
\93®
\93I
\82¾
\81D");
562 You("don't have a special ability in your normal form!");
564 You("
\95\81\92i
\82Ì
\8ep
\82Å
\82Ì
\93Á
\8eê
\94\
\97Í
\82ð
\8e\9d\82Á
\82Ä
\82¢
\82È
\82¢
\81I");
569 enter_explore_mode(VOID_ARGS)
573 You("are in debug mode.");
575 You("
\82·
\82Å
\82É
\83f
\83o
\83b
\83O
\83\82\81[
\83h
\82¾
\81D");
576 } else if (discover) {
578 You("are already in explore mode.");
580 You("
\82·
\82Å
\82É
\92T
\8c\9f\83\82\81[
\83h
\82¾
\81D");
584 if (!sysopt.explorers || !sysopt.explorers[0]
585 || !check_user_string(sysopt.explorers)) {
587 You("cannot access explore mode.");
589 You("
\92T
\8c\9f\83\82\81[
\83h
\82É
\83A
\83N
\83Z
\83X
\82Å
\82«
\82È
\82¢
\81D");
596 "Beware! From explore mode there will be no return to normal game.");
598 "
\8cx
\8d\90\81I
\94
\8c©
\83\82\81[
\83h
\82É
\93ü
\82Á
\82½
\82ç
\92Ê
\8fí
\83\82\81[
\83h
\82É
\82Í
\96ß
\82ê
\82È
\82¢
\81D");
599 if (paranoid_query(ParanoidQuit,
601 "Do you want to enter explore mode?")) {
603 "
\94
\8c©
\83\82\81[
\83h
\82É
\88Ú
\82è
\82Ü
\82·
\82©
\81H")) {
604 clear_nhwindow(WIN_MESSAGE);
606 You("are now in non-scoring explore mode.");
608 You("
\83X
\83R
\83A
\82ª
\82Ì
\82ç
\82È
\82¢
\94
\8c©
\83\82\81[
\83h
\82É
\88Ú
\8ds
\82µ
\82½
\81D");
611 clear_nhwindow(WIN_MESSAGE);
613 pline("Resuming normal game.");
615 pline("
\92Ê
\8fí
\83\82\81[
\83h
\82ð
\91±
\82¯
\82é
\81D");
622 dooverview_or_wiz_where(VOID_ARGS)
631 /* ^W command - wish for something */
633 wiz_wish(VOID_ARGS) /* Unlimited wishes for debug mode by Paul Polderman */
636 boolean save_verbose = flags.verbose;
638 flags.verbose = FALSE;
640 flags.verbose = save_verbose;
641 (void) encumber_msg();
644 pline("Unavailable command '%s'.",
646 pline("'%s'
\83R
\83}
\83\93\83h
\82Í
\8eg
\82¦
\82È
\82¢
\81D",
647 visctrl((int) cmd_from_func(wiz_wish)));
651 /* ^I command - reveal and optionally identify hero's inventory */
653 wiz_identify(VOID_ARGS)
656 iflags.override_ID = (int) cmd_from_func(wiz_identify);
657 if (display_inventory((char *) 0, TRUE) == -1)
658 identify_pack(0, FALSE);
659 iflags.override_ID = 0;
662 pline("Unavailable command '%s'.",
664 pline("'%s'
\83R
\83}
\83\93\83h
\82Í
\8eg
\82¦
\82È
\82¢
\81D",
665 visctrl((int) cmd_from_func(wiz_identify)));
669 /* ^F command - reveal the level map and any traps on it */
675 long save_Hconf = HConfusion, save_Hhallu = HHallucination;
677 HConfusion = HHallucination = 0L;
678 for (t = ftrap; t != 0; t = t->ntrap) {
683 HConfusion = save_Hconf;
684 HHallucination = save_Hhallu;
687 pline("Unavailable command '%s'.",
689 pline("'%s'
\83R
\83}
\83\93\83h
\82Í
\8eg
\82¦
\82È
\82¢
\81D",
690 visctrl((int) cmd_from_func(wiz_map)));
694 /* ^G command - generate monster(s); a count prefix will be honored */
696 wiz_genesis(VOID_ARGS)
699 (void) create_particular();
702 pline("Unavailable command '%s'.",
704 pline("'%s'
\83R
\83}
\83\93\83h
\82Í
\8eg
\82¦
\82È
\82¢
\81D",
705 visctrl((int) cmd_from_func(wiz_genesis)));
709 /* ^O command - display dungeon layout */
714 (void) print_dungeon(FALSE, (schar *) 0, (xchar *) 0);
717 pline("Unavailable command '%s'.",
719 pline("'%s'
\83R
\83}
\83\93\83h
\82Í
\8eg
\82¦
\82È
\82¢
\81D",
720 visctrl((int) cmd_from_func(wiz_where)));
724 /* ^E command - detect unseen (secret doors, traps, hidden monsters) */
726 wiz_detect(VOID_ARGS)
732 pline("Unavailable command '%s'.",
734 pline("'%s'
\83R
\83}
\83\93\83h
\82Í
\8eg
\82¦
\82È
\82¢
\81D",
735 visctrl((int) cmd_from_func(wiz_detect)));
739 /* ^V command - level teleport */
741 wiz_level_tele(VOID_ARGS)
747 pline("Unavailable command '%s'.",
749 pline("'%s'
\83R
\83}
\83\93\83h
\82Í
\8eg
\82¦
\82È
\82¢
\81D",
750 visctrl((int) cmd_from_func(wiz_level_tele)));
754 /* #monpolycontrol command - choose new form for shapechangers, polymorphees */
756 wiz_mon_polycontrol(VOID_ARGS)
758 iflags.mon_polycontrol = !iflags.mon_polycontrol;
760 pline("Monster polymorph control is %s.",
761 iflags.mon_polycontrol ? "on" : "off");
763 pline("
\89ö
\95¨
\82Ì
\95Ï
\89»
\90§
\8cä: %s",
764 iflags.mon_polycontrol ? "
\83I
\83\93" : "
\83I
\83t");
769 /* #levelchange command - adjust hero's experience level */
771 wiz_level_change(VOID_ARGS)
778 getlin("To what experience level do you want to be set?", buf);
780 getlin("
\8co
\8c±
\83\8c\83x
\83\8b\82ð
\82¢
\82
\82Â
\82É
\90Ý
\92è
\82µ
\82Ü
\82·
\82©
\81H", buf);
781 (void) mungspaces(buf);
782 if (buf[0] == '\033' || buf[0] == '\0')
785 ret = sscanf(buf, "%d", &newlevel);
791 if (newlevel == u.ulevel) {
793 You("are already that experienced.");
795 You("
\82·
\82Å
\82É
\82»
\82Ì
\8co
\8c±
\83\8c\83x
\83\8b\82¾
\81D");
796 } else if (newlevel < u.ulevel) {
799 You("are already as inexperienced as you can get.");
801 You("
\82·
\82Å
\82É
\89Â
\94\
\82È
\8cÀ
\82è
\82Ì
\8dÅ
\92á
\82Ì
\8co
\8c±
\83\8c\83x
\83\8b\82¾
\81D");
806 while (u.ulevel > newlevel)
808 losexp("#levelchange");
810 losexp("#levelchange
\83R
\83}
\83\93\83h
\82Å");
812 if (u.ulevel >= MAXULEV) {
814 You("are already as experienced as you can get.");
816 You("
\82·
\82Å
\82É
\89Â
\94\
\82È
\8cÀ
\82è
\82Ì
\8dÅ
\91å
\82Ì
\8co
\8c±
\83\8c\83x
\83\8b\82¾
\81D");
819 if (newlevel > MAXULEV)
821 while (u.ulevel < newlevel)
824 u.ulevelmax = u.ulevel;
828 /* #panic command - test program's panic handling */
833 if (yn("Do you want to call panic() and end your game?") == 'y')
835 if (yn("panic()
\8aÖ
\90\94\82ð
\8cÄ
\82Ñ
\8fo
\82µ
\82Ä
\83Q
\81[
\83\80\82ð
\8fI
\97¹
\82³
\82¹
\82Ü
\82·
\82©
\81H") == 'y')
836 panic("Crash test.");
840 /* #polyself command - change hero's form */
842 wiz_polyself(VOID_ARGS)
850 wiz_show_seenv(VOID_ARGS)
853 int x, y, v, startx, stopx, curx;
856 win = create_nhwindow(NHW_TEXT);
858 * Each seenv description takes up 2 characters, so center
859 * the seenv display around the hero.
861 startx = max(1, u.ux - (COLNO / 4));
862 stopx = min(startx + (COLNO / 2), COLNO);
863 /* can't have a line exactly 80 chars long */
864 if (stopx - startx == COLNO / 2)
867 for (y = 0; y < ROWNO; y++) {
868 for (x = startx, curx = 0; x < stopx; x++, curx += 2) {
869 if (x == u.ux && y == u.uy) {
870 row[curx] = row[curx + 1] = '@';
872 v = levl[x][y].seenv & 0xff;
874 row[curx] = row[curx + 1] = ' ';
876 Sprintf(&row[curx], "%02x", v);
879 /* remove trailing spaces */
880 for (x = curx - 1; x >= 0; x--)
887 display_nhwindow(win, TRUE);
888 destroy_nhwindow(win);
892 /* #vision command */
894 wiz_show_vision(VOID_ARGS)
900 win = create_nhwindow(NHW_TEXT);
901 Sprintf(row, "Flags: 0x%x could see, 0x%x in sight, 0x%x temp lit",
902 COULD_SEE, IN_SIGHT, TEMP_LIT);
905 for (y = 0; y < ROWNO; y++) {
906 for (x = 1; x < COLNO; x++) {
907 if (x == u.ux && y == u.uy)
910 v = viz_array[y][x]; /* data access should be hidden */
914 row[x] = '0' + viz_array[y][x];
917 /* remove trailing spaces */
918 for (x = COLNO - 1; x >= 1; x--)
923 putstr(win, 0, &row[1]);
925 display_nhwindow(win, TRUE);
926 destroy_nhwindow(win);
932 wiz_show_wmodes(VOID_ARGS)
938 boolean istty = !strcmp(windowprocs.name, "tty");
940 win = create_nhwindow(NHW_TEXT);
942 putstr(win, 0, ""); /* tty only: blank top line */
943 for (y = 0; y < ROWNO; y++) {
944 for (x = 0; x < COLNO; x++) {
946 if (x == u.ux && y == u.uy)
948 else if (IS_WALL(lev->typ) || lev->typ == SDOOR)
949 row[x] = '0' + (lev->wall_info & WM_MASK);
950 else if (lev->typ == CORR)
952 else if (IS_ROOM(lev->typ) || IS_DOOR(lev->typ))
958 /* map column 0, levl[0][], is off the left edge of the screen */
959 putstr(win, 0, &row[1]);
961 display_nhwindow(win, TRUE);
962 destroy_nhwindow(win);
966 /* wizard mode variant of #terrain; internal levl[][].typ values in base-36 */
968 wiz_map_levltyp(VOID_ARGS)
973 boolean istty = !strcmp(windowprocs.name, "tty");
975 win = create_nhwindow(NHW_TEXT);
976 /* map row 0, levl[][0], is drawn on the second line of tty screen */
978 putstr(win, 0, ""); /* tty only: blank top line */
979 for (y = 0; y < ROWNO; y++) {
980 /* map column 0, levl[0][], is off the left edge of the screen;
981 it should always have terrain type "undiggable stone" */
982 for (x = 1; x < COLNO; x++) {
983 terrain = levl[x][y].typ;
984 /* assumes there aren't more than 10+26+26 terrain types */
985 row[x - 1] = (char) ((terrain == 0 && !may_dig(x, y))
991 : 'A' + terrain - 36);
993 if (levl[0][y].typ != 0 || may_dig(0, y))
1001 s_level *slev = Is_special(&u.uz);
1003 Sprintf(dsc, "D:%d,L:%d", u.uz.dnum, u.uz.dlevel);
1004 /* [dungeon branch features currently omitted] */
1005 /* special level features */
1007 Sprintf(eos(dsc), " \"%s\"", slev->proto);
1008 /* special level flags (note: dungeon.def doesn't set `maze'
1009 or `hell' for any specific levels so those never show up) */
1010 if (slev->flags.maze_like)
1011 Strcat(dsc, " mazelike");
1012 if (slev->flags.hellish)
1013 Strcat(dsc, " hellish");
1014 if (slev->flags.town)
1015 Strcat(dsc, " town");
1016 if (slev->flags.rogue_like)
1017 Strcat(dsc, " roguelike");
1018 /* alignment currently omitted to save space */
1020 /* level features */
1021 if (level.flags.nfountains)
1022 Sprintf(eos(dsc), " %c:%d", defsyms[S_fountain].sym,
1023 (int) level.flags.nfountains);
1024 if (level.flags.nsinks)
1025 Sprintf(eos(dsc), " %c:%d", defsyms[S_sink].sym,
1026 (int) level.flags.nsinks);
1027 if (level.flags.has_vault)
1028 Strcat(dsc, " vault");
1029 if (level.flags.has_shop)
1030 Strcat(dsc, " shop");
1031 if (level.flags.has_temple)
1032 Strcat(dsc, " temple");
1033 if (level.flags.has_court)
1034 Strcat(dsc, " throne");
1035 if (level.flags.has_zoo)
1036 Strcat(dsc, " zoo");
1037 if (level.flags.has_morgue)
1038 Strcat(dsc, " morgue");
1039 if (level.flags.has_barracks)
1040 Strcat(dsc, " barracks");
1041 if (level.flags.has_beehive)
1042 Strcat(dsc, " hive");
1043 if (level.flags.has_swamp)
1044 Strcat(dsc, " swamp");
1046 if (level.flags.noteleport)
1047 Strcat(dsc, " noTport");
1048 if (level.flags.hardfloor)
1049 Strcat(dsc, " noDig");
1050 if (level.flags.nommap)
1051 Strcat(dsc, " noMMap");
1052 if (!level.flags.hero_memory)
1053 Strcat(dsc, " noMem");
1054 if (level.flags.shortsighted)
1055 Strcat(dsc, " shortsight");
1056 if (level.flags.graveyard)
1057 Strcat(dsc, " graveyard");
1058 if (level.flags.is_maze_lev)
1059 Strcat(dsc, " maze");
1060 if (level.flags.is_cavernous_lev)
1061 Strcat(dsc, " cave");
1062 if (level.flags.arboreal)
1063 Strcat(dsc, " tree");
1065 Strcat(dsc, " sokoban-rules");
1066 /* non-flag info; probably should include dungeon branching
1067 checks (extra stairs and magic portals) here */
1068 if (Invocation_lev(&u.uz))
1069 Strcat(dsc, " invoke");
1070 if (On_W_tower_level(&u.uz))
1071 Strcat(dsc, " tower");
1072 /* append a branch identifier for completeness' sake */
1074 Strcat(dsc, " dungeon");
1075 else if (u.uz.dnum == mines_dnum)
1076 Strcat(dsc, " mines");
1077 else if (In_sokoban(&u.uz))
1078 Strcat(dsc, " sokoban");
1079 else if (u.uz.dnum == quest_dnum)
1080 Strcat(dsc, " quest");
1081 else if (Is_knox(&u.uz))
1082 Strcat(dsc, " ludios");
1083 else if (u.uz.dnum == 1)
1084 Strcat(dsc, " gehennom");
1085 else if (u.uz.dnum == tower_dnum)
1086 Strcat(dsc, " vlad");
1087 else if (In_endgame(&u.uz))
1088 Strcat(dsc, " endgame");
1090 /* somebody's added a dungeon branch we're not expecting */
1091 const char *brname = dungeons[u.uz.dnum].dname;
1093 if (!brname || !*brname)
1095 if (!strncmpi(brname, "the ", 4))
1097 Sprintf(eos(dsc), " %s", brname);
1099 /* limit the line length to map width */
1100 if (strlen(dsc) >= COLNO)
1101 dsc[COLNO - 1] = '\0'; /* truncate */
1102 putstr(win, 0, dsc);
1105 display_nhwindow(win, TRUE);
1106 destroy_nhwindow(win);
1110 /* temporary? hack, since level type codes aren't the same as screen
1111 symbols and only the latter have easily accessible descriptions */
1112 static const char *levltyp[] = {
1113 "stone", "vertical wall", "horizontal wall", "top-left corner wall",
1114 "top-right corner wall", "bottom-left corner wall",
1115 "bottom-right corner wall", "cross wall", "tee-up wall", "tee-down wall",
1116 "tee-left wall", "tee-right wall", "drawbridge wall", "tree",
1117 "secret door", "secret corridor", "pool", "moat", "water",
1118 "drawbridge up", "lava pool", "iron bars", "door", "corridor", "room",
1119 "stairs", "ladder", "fountain", "throne", "sink", "grave", "altar", "ice",
1120 "drawbridge down", "air", "cloud",
1121 /* not a real terrain type, but used for undiggable stone
1122 by wiz_map_levltyp() */
1123 "unreachable/undiggable",
1124 /* padding in case the number of entries above is odd */
1128 /* explanation of base-36 output from wiz_map_levltyp() */
1130 wiz_levltyp_legend(VOID_ARGS)
1134 const char *dsc, *fmt;
1137 win = create_nhwindow(NHW_TEXT);
1138 putstr(win, 0, "#terrain encodings:");
1140 fmt = " %c - %-28s"; /* TODO: include tab-separated variant for win32 */
1142 /* output in pairs, left hand column holds [0],[1],...,[N/2-1]
1143 and right hand column holds [N/2],[N/2+1],...,[N-1];
1144 N ('last') will always be even, and may or may not include
1145 the empty string entry to pad out the final pair, depending
1146 upon how many other entries are present in levltyp[] */
1147 last = SIZE(levltyp) & ~1;
1148 for (i = 0; i < last / 2; ++i)
1149 for (j = i; j < last; j += last / 2) {
1152 : !strncmp(dsc, "unreachable", 11) ? '*'
1153 /* same int-to-char conversion as wiz_map_levltyp() */
1154 : (j < 10) ? '0' + j
1155 : (j < 36) ? 'a' + j - 10
1157 Sprintf(eos(buf), fmt, c, dsc);
1159 putstr(win, 0, buf);
1163 display_nhwindow(win, TRUE);
1164 destroy_nhwindow(win);
1168 /* #wizsmell command - test usmellmon(). */
1170 wiz_smell(VOID_ARGS)
1173 int mndx; /* monster index */
1174 coord cc; /* screen pos of unknown glyph */
1175 int glyph; /* glyph at selected position */
1179 mndx = 0; /* gcc -Wall lint */
1180 if (!olfaction(youmonst.data)) {
1181 You("are incapable of detecting odors in your present form.");
1185 pline("You can move the cursor to a monster that you want to smell.");
1187 pline("Pick a monster to smell.");
1188 ans = getpos(&cc, TRUE, "a monster");
1189 if (ans < 0 || cc.x < 0) {
1190 return 0; /* done */
1192 /* Convert the glyph at the selected position to a mndxbol. */
1193 glyph = glyph_at(cc.x, cc.y);
1194 if (glyph_is_monster(glyph))
1195 mndx = glyph_to_mon(glyph);
1198 /* Is it a monster? */
1200 if (!usmellmon(&mons[mndx]))
1201 pline("That monster seems to give off no smell.");
1203 pline("That is not a monster.");
1208 /* #wizrumorcheck command - verify each rumor access */
1210 wiz_rumor_check(VOID_ARGS)
1216 /* #terrain command -- show known map, inspired by crawl's '|' command */
1218 doterrain(VOID_ARGS)
1227 * normal play: choose between known map without mons, obj, and traps
1228 * (to see underlying terrain only), or
1229 * known map without mons and objs (to see traps under mons and objs), or
1230 * known map without mons (to see objects under monsters);
1231 * explore mode: normal choices plus full map (w/o mons, objs, traps);
1232 * wizard mode: normal and explore choices plus
1233 * a dump of the internal levl[][].typ codes w/ level flags, or
1234 * a legend for the levl[][].typ codes dump
1236 men = create_nhwindow(NHW_MENU);
1239 add_menu(men, NO_GLYPH, &any, 0, 0, ATR_NONE,
1240 "known map without monsters, objects, and traps",
1243 add_menu(men, NO_GLYPH, &any, 0, 0, ATR_NONE,
1244 "known map without monsters and objects",
1247 add_menu(men, NO_GLYPH, &any, 0, 0, ATR_NONE,
1248 "known map without monsters",
1250 if (discover || wizard) {
1252 add_menu(men, NO_GLYPH, &any, 0, 0, ATR_NONE,
1253 "full map without monsters, objects, and traps",
1257 add_menu(men, NO_GLYPH, &any, 0, 0, ATR_NONE,
1258 "internal levl[][].typ codes in base-36",
1261 add_menu(men, NO_GLYPH, &any, 0, 0, ATR_NONE,
1262 "legend of base-36 levl[][].typ codes",
1266 end_menu(men, "View which?");
1268 n = select_menu(men, PICK_ONE, &sel);
1269 destroy_nhwindow(men);
1271 * n < 0: player used ESC to cancel;
1272 * n == 0: preselected entry was explicitly chosen and got toggled off;
1273 * n == 1: preselected entry was implicitly chosen via <space>|<enter>;
1274 * n == 2: another entry was explicitly chosen, so skip preselected one.
1276 which = (n < 0) ? -1 : (n == 0) ? 1 : sel[0].item.a_int;
1277 if (n > 1 && which == 1)
1278 which = sel[1].item.a_int;
1280 free((genericptr_t) sel);
1283 case 1: reveal_terrain(0, 0); break; /* known map */
1284 case 2: reveal_terrain(0, 1); break; /* known map with traps */
1285 case 3: reveal_terrain(0, 1|2); break; /* known map w/ traps & objs */
1286 case 4: reveal_terrain(1, 0); break; /* full map */
1287 case 5: wiz_map_levltyp(); break; /* map internals */
1288 case 6: wiz_levltyp_legend(); break; /* internal details */
1291 return 0; /* no time elapses */
1294 /* -enlightenment and conduct- */
1295 static winid en_win = WIN_ERR;
1297 static const char You_[] = "You ", are[] = "are ", were[] = "were ",
1298 have[] = "have ", had[] = "had ", can[] = "can ",
1301 static const char You_[] = "
\82 \82È
\82½
\82Í",
1302 are[] = "
\82Å
\82 \82é", were[] = "
\82Å
\82 \82Á
\82½",
1303 have[] = "
\82ð
\82à
\82Á
\82Ä
\82¢
\82é", had[] = "
\82ð
\82à
\82Á
\82Ä
\82¢
\82½",
1304 can[] = "
\82Å
\82«
\82é", could[] = "
\82Å
\82«
\82½",
1305 iru[] = "
\82¢
\82é", ita[] = "
\82¢
\82½";
1307 #if 0 /*JP*//* not used */
1308 static const char have_been[] = "have been ", have_never[] = "have never ",
1313 #define enl_msg(prefix, present, past, suffix, ps) \
1314 enlght_line(prefix, final ? past : present, suffix, ps)
1316 #define enl_msg(prefix, present, past, suffix, ps) \
1317 enlght_line(prefix, ps, suffix, final ? past : present)
1319 #define you_are(attr, ps) enl_msg(You_, are, were, attr, ps)
1320 #define you_have(attr, ps) enl_msg(You_, have, had, attr, ps)
1321 #define you_can(attr, ps) enl_msg(You_, can, could, attr, ps)
1323 #define you_have_been(goodthing) enl_msg(You_, have_been, were, goodthing, "")
1325 #define you_have_been(goodthing) enl_msg(You_, are, were, goodthing, "")
1327 #define you_have_never(badthing) \
1328 enl_msg(You_, have_never, never, badthing, "")
1330 #define you_have_never(badthing) \
1331 enl_msg(badthing, "
\82Ä
\82¢
\82È
\82¢", "
\82È
\82©
\82Á
\82½", "", "")
1334 #define you_have_X(something) \
1335 enl_msg(You_, have, (const char *) "", something, "")
1337 #define you_have_X(something) \
1338 enl_msg(something, "
\82Ä
\82¢
\82é", "
\82½", "", "")
1341 #define you_are_ing(goodthing, ps) enl_msg(You_, iru, ita, goodthing, ps)
1345 enlght_line(start, middle, end, ps)
1346 const char *start, *middle, *end, *ps;
1351 Sprintf(buf, " %s%s%s%s.", start, middle, end, ps);
1353 Sprintf(buf, "%s%s%s%s
\81D", start, middle, end, ps);
1354 putstr(en_win, 0, buf);
1357 /* format increased chance to hit or damage or defense (Protection) */
1359 enlght_combatinc(inctyp, incamt, final, outbuf)
1364 const char *modif, *bonus;
1368 absamt = abs(incamt);
1369 /* Protection amount is typically larger than damage or to-hit;
1370 reduce magnitude by a third in order to stretch modifier ranges
1371 (small:1..5, moderate:6..10, large:11..19, huge:20+) */
1372 if (!strcmp(inctyp, "defense"))
1373 absamt = (absamt * 2) / 3;
1379 modif = "
\8bÍ
\82©
\82È";
1380 else if (absamt <= 6)
1384 modif = "
\92\86\92ö
\93x
\82Ì";
1385 else if (absamt <= 12)
1389 modif = "
\91å
\82«
\82È";
1394 modif = "
\8b
\91å
\82È";
1397 modif = !incamt ? "no" : an(modif); /* ("no" case shouldn't happen) */
1400 bonus = (incamt >= 0) ? "bonus" : "penalty";
1402 bonus = (incamt > 0) ? "
\83{
\81[
\83i
\83X" : "
\83y
\83i
\83\8b\83e
\83B";
1403 /* "bonus <foo>" (to hit) vs "<bar> bonus" (damage, defense) */
1404 invrt = strcmp(inctyp, "to hit") ? TRUE : FALSE;
1407 Sprintf(outbuf, "%s %s %s", modif, invrt ? inctyp : bonus,
1408 invrt ? bonus : inctyp);
1410 Sprintf(outbuf, "%s
\82É%s%s", inctyp, modif, bonus);
1412 if (final || wizard)
1413 Sprintf(eos(outbuf), " (%s%d)", (incamt > 0) ? "+" : "", incamt);
1418 /* report half physical or half spell damage */
1420 enlght_halfdmg(category, final)
1424 const char *category_name;
1429 category_name = "physical";
1432 category_name = "spell";
1435 category_name = "unknown";
1438 Sprintf(buf, " %s %s damage", (final || wizard) ? "half" : "reduced",
1440 enl_msg(You_, "take", "took", buf, from_what(category));
1443 /* is hero actively using water walking capability on water (or lava)? */
1447 if (u.uinwater || Levitation || Flying)
1449 return (boolean) (Wwalking
1450 && (is_pool(u.ux, u.uy) || is_lava(u.ux, u.uy)));
1453 /* check whether hero is wearing something that player definitely knows
1454 confers the target property; item must have been seen and its type
1455 discovered but it doesn't necessarily have to be fully identified */
1457 cause_known(propindx)
1458 int propindx; /* index of a property which can be conveyed by worn item */
1460 register struct obj *o;
1461 long mask = W_ARMOR | W_AMUL | W_RING | W_TOOL;
1463 /* simpler than from_what()/what_gives(); we don't attempt to
1464 handle artifacts and we deliberately ignore wielded items */
1465 for (o = invent; o; o = o->nobj) {
1466 if (!(o->owornmask & mask))
1468 if ((int) objects[o->otyp].oc_oprop == propindx
1469 && objects[o->otyp].oc_name_known && o->dknown)
1475 /* format a characteristic value, accommodating Strength's strangeness */
1477 attrval(attrindx, attrvalue, resultbuf)
1478 int attrindx, attrvalue;
1479 char resultbuf[]; /* should be at least [7] to hold "18/100\0" */
1481 if (attrindx != A_STR || attrvalue <= 18)
1482 Sprintf(resultbuf, "%d", attrvalue);
1483 else if (attrvalue > STR18(100)) /* 19 to 25 */
1484 Sprintf(resultbuf, "%d", attrvalue - 100);
1485 else /* simplify "18/ **" to be "18/100" */
1486 Sprintf(resultbuf, "18/%02d", attrvalue - 18);
1491 enlightenment(mode, final)
1492 int mode; /* BASICENLIGHTENMENT | MAGICENLIGHTENMENT (| both) */
1493 int final; /* ENL_GAMEINPROGRESS:0, ENL_GAMEOVERALIVE, ENL_GAMEOVERDEAD */
1495 char buf[BUFSZ], tmpbuf[BUFSZ];
1497 Strcpy(tmpbuf, plname);
1498 *tmpbuf = highc(*tmpbuf); /* same adjustment as bottom line */
1499 /* as in background_enlightenment, when poly'd we need to use the saved
1500 gender in u.mfemale rather than the current you-as-monster gender */
1502 Sprintf(buf, "%s the %s's attributes:", tmpbuf,
1503 ((Upolyd ? u.mfemale : flags.female) && urole.name.f)
1507 Sprintf(buf, "%s
\82Ì%s
\82Ì
\91®
\90«:",
1508 ((Upolyd ? u.mfemale : flags.female) && urole.name.f)
1514 en_win = create_nhwindow(NHW_MENU);
1516 putstr(en_win, 0, buf); /* "Conan the Archeologist's attributes:" */
1517 /* background and characteristics; ^X or end-of-game disclosure */
1518 if (mode & BASICENLIGHTENMENT) {
1519 /* role, race, alignment, deities */
1520 background_enlightenment(mode, final);
1521 /* strength, dexterity, &c */
1522 characteristics_enlightenment(mode, final);
1524 /* expanded status line information, including things which aren't
1525 included there due to space considerations--such as obvious
1526 alternative movement indicators (riding, levitation, &c), and
1527 various troubles (turning to stone, trapped, confusion, &c);
1528 shown for both basic and magic enlightenment */
1529 status_enlightenment(mode, final);
1530 /* remaining attributes; shown for potion,&c or wizard mode and
1531 explore mode ^X or end of game disclosure */
1532 if (mode & MAGICENLIGHTENMENT) {
1533 /* intrinsics and other traditional enlightenment feedback */
1534 attributes_enlightenment(mode, final);
1536 display_nhwindow(en_win, TRUE);
1537 destroy_nhwindow(en_win);
1542 /* display role, race, alignment and such to en_win */
1544 background_enlightenment(unused_mode, final)
1545 int unused_mode UNUSED;
1548 const char *role_titl, *rank_titl;
1549 int innategend, difgend, difalgn;
1550 char buf[BUFSZ], tmpbuf[BUFSZ];
1552 /* note that if poly'd, we need to use u.mfemale instead of flags.female
1553 to access hero's saved gender-as-human/elf/&c rather than current one */
1554 innategend = (Upolyd ? u.mfemale : flags.female) ? 1 : 0;
1555 role_titl = (innategend && urole.name.f) ? urole.name.f : urole.name.m;
1556 rank_titl = rank_of(u.ulevel, Role_switch, innategend);
1558 putstr(en_win, 0, ""); /* separator after title */
1560 putstr(en_win, 0, "Background:");
1562 putstr(en_win, 0, "
\94w
\8ci
\8fî
\95ñ:");
1564 /* if polymorphed, report current shape before underlying role;
1565 will be repeated as first status: "you are transformed" and also
1566 among various attributes: "you are in beast form" (after being
1567 told about lycanthropy) or "you are polymorphed into <a foo>"
1568 (with countdown timer appended for wizard mode); we really want
1569 the player to know he's not a samurai at the moment... */
1571 struct permonst *uasmon = youmonst.data;
1574 /* here we always use current gender, not saved role gender */
1575 if (!is_male(uasmon) && !is_female(uasmon) && !is_neuter(uasmon))
1577 Sprintf(tmpbuf, "%s ", genders[flags.female ? 1 : 0].adj);
1579 Sprintf(tmpbuf, "%s
\82Ì", genders[flags.female ? 1 : 0].adj);
1581 Sprintf(buf, "%sin %s%s form", !final ? "currently " : "", tmpbuf,
1584 Sprintf(buf, "%s%s%s
\82Ì
\8ep", !final ? "
\8d¡
\82Ì
\82Æ
\82±
\82ë" : "", tmpbuf,
1590 /* report role; omit gender if it's redundant (eg, "female priestess") */
1593 && ((urole.allow & ROLE_GENDMASK) == (ROLE_MALE | ROLE_FEMALE)
1594 || innategend != flags.initgend))
1596 Sprintf(tmpbuf, "%s ", genders[innategend].adj);
1598 Sprintf(tmpbuf, "%s", genders[innategend].adj);
1602 Strcpy(buf, "actually "); /* "You are actually a ..." */
1604 Strcpy(buf, "
\8eÀ
\8dÛ
\82É
\82Í"); /* "
\82 \82È
\82½
\82Í
\8eÀ
\8dÛ
\82É
\82Í..." */
1606 if (!strcmpi(rank_titl, role_titl)) {
1607 /* omit role when rank title matches it */
1609 Sprintf(eos(buf), "%s, level %d %s%s", an(rank_titl), u.ulevel,
1610 tmpbuf, urace.noun);
1612 Sprintf(eos(buf), "
\83\8c\83x
\83\8b%d
\82Ì%s
\82Ì%s%s", u.ulevel,
1613 tmpbuf, urace.adj, role_titl);
1617 Sprintf(eos(buf), "%s, a level %d %s%s %s", an(rank_titl), u.ulevel,
1618 tmpbuf, urace.adj, role_titl);
1620 Sprintf(eos(buf), "
\83\8c\83x
\83\8b%d
\82Ì%s
\82Ì%s%s
\82Ì%s", u.ulevel,
1621 tmpbuf, urace.adj, role_titl, rank_titl);
1626 /* report alignment (bypass you_are() in order to omit ending period) */
1628 Sprintf(buf, " %s%s%s, %son a mission for %s",
1629 You_, !final ? are : were,
1630 align_str(u.ualign.type),
1631 /* helm of opposite alignment (might hide conversion) */
1632 (u.ualign.type != u.ualignbase[A_CURRENT]) ? "temporarily "
1633 /* permanent conversion */
1634 : (u.ualign.type != u.ualignbase[A_ORIGINAL]) ? "now "
1635 /* atheist (ignored in very early game) */
1636 : (!u.uconduct.gnostic && moves > 1000L) ? "nominally "
1637 /* lastly, normal case */
1641 Sprintf(buf, "
\82 \82È
\82½
\82Í%s
\82Å, %s%s
\82Ì
\82½
\82ß
\82Ì
\94C
\96±
\82ð
\8ds
\82Á
\82Ä%s
\81D",
1642 align_str(u.ualign.type),
1643 /* helm of opposite alignment (might hide conversion) */
1644 (u.ualign.type != u.ualignbase[A_CURRENT]) ? "
\88ê
\8e\9e\93I
\82É"
1645 /* permanent conversion */
1646 : (u.ualign.type != u.ualignbase[A_ORIGINAL]) ? "
\8c»
\8dÝ"
1647 /* atheist (ignored in very early game) */
1648 : (!u.uconduct.gnostic && moves > 1000L) ? "
\96¼
\8b`
\8fã"
1649 /* lastly, normal case */
1651 u_gname(), !final ? iru : ita);
1653 putstr(en_win, 0, buf);
1654 /* show the rest of this game's pantheon (finishes previous sentence)
1655 [appending "also Moloch" at the end would allow for straightforward
1656 trailing "and" on all three aligned entries but looks too verbose] */
1658 Sprintf(buf, " who %s opposed by", !final ? "is" : "was");
1660 Strcpy(buf, "
\82 \82È
\82½
\82Í");
1662 if (u.ualign.type != A_LAWFUL)
1664 Sprintf(eos(buf), " %s (%s) and", align_gname(A_LAWFUL),
1665 align_str(A_LAWFUL));
1667 Sprintf(eos(buf), "%s(%s)
\82¨
\82æ
\82Ñ", align_gname(A_LAWFUL),
1668 align_str(A_LAWFUL));
1670 if (u.ualign.type != A_NEUTRAL)
1672 Sprintf(eos(buf), " %s (%s)%s", align_gname(A_NEUTRAL),
1673 align_str(A_NEUTRAL),
1674 (u.ualign.type != A_CHAOTIC) ? " and" : "");
1676 Sprintf(eos(buf), "%s(%s)%s", align_gname(A_NEUTRAL),
1677 align_str(A_NEUTRAL),
1678 (u.ualign.type != A_CHAOTIC) ? "
\82¨
\82æ
\82Ñ" : "");
1681 if (u.ualign.type != A_CHAOTIC)
1682 Sprintf(eos(buf), " %s (%s)", align_gname(A_CHAOTIC),
1683 align_str(A_CHAOTIC));
1685 if (u.ualign.type != A_CHAOTIC)
1686 Sprintf(eos(buf), "%s(%s)", align_gname(A_CHAOTIC),
1687 align_str(A_CHAOTIC));
1690 Strcat(buf, "."); /* terminate sentence */
1692 Sprintf(eos(buf), "
\82Æ
\91Î
\97§
\82µ
\82Ä%s
\81D", !final ? iru : ita);
1694 putstr(en_win, 0, buf);
1696 /* show original alignment,gender,race,role if any have been changed;
1697 giving separate message for temporary alignment change bypasses need
1698 for tricky phrasing otherwise necessitated by possibility of having
1699 helm of opposite alignment mask a permanent alignment conversion */
1700 difgend = (innategend != flags.initgend);
1701 difalgn = (((u.ualign.type != u.ualignbase[A_CURRENT]) ? 1 : 0)
1702 + ((u.ualignbase[A_CURRENT] != u.ualignbase[A_ORIGINAL])
1704 if (difalgn & 1) { /* have temporary alignment so report permanent one */
1706 Sprintf(buf, "actually %s", align_str(u.ualignbase[A_CURRENT]));
1708 Sprintf(buf, "
\8eÀ
\8dÛ
\82É
\82Í%s", align_str(u.ualignbase[A_CURRENT]));
1710 difalgn &= ~1; /* suppress helm from "started out <foo>" message */
1712 if (difgend || difalgn) { /* sex change or perm align change or both */
1714 Sprintf(buf, " You started out %s%s%s.",
1715 difgend ? genders[flags.initgend].adj : "",
1716 (difgend && difalgn) ? " and " : "",
1717 difalgn ? align_str(u.ualignbase[A_ORIGINAL]) : "");
1719 Sprintf(buf, "
\82 \82È
\82½
\82Í%s%s%s
\82Å
\8aJ
\8en
\82µ
\82½
\81D",
1720 difgend ? genders[flags.initgend].adj : "",
1721 (difgend && difalgn) ? "
\82©
\82Â" : "",
1722 difalgn ? align_str(u.ualignbase[A_ORIGINAL]) : "");
1724 putstr(en_win, 0, buf);
1728 /* characteristics: expanded version of bottom line strength, dexterity, &c */
1730 characteristics_enlightenment(mode, final)
1734 putstr(en_win, 0, ""); /* separator after background */
1737 final ? "Final Characteristics:" : "Current Characteristics:");
1739 final ? "
\8dÅ
\8fI
\91®
\90«
\81F" : "
\8c»
\8dÝ
\82Ì
\91®
\90«
\81F");
1741 /* bottom line order */
1742 one_characteristic(mode, final, A_STR); /* strength */
1743 one_characteristic(mode, final, A_DEX); /* dexterity */
1744 one_characteristic(mode, final, A_CON); /* constitution */
1745 one_characteristic(mode, final, A_INT); /* intelligence */
1746 one_characteristic(mode, final, A_WIS); /* wisdom */
1747 one_characteristic(mode, final, A_CHA); /* charisma */
1750 /* display one attribute value for characteristics_enlightenment() */
1752 one_characteristic(mode, final, attrindx)
1753 int mode, final, attrindx;
1755 boolean hide_innate_value = FALSE, interesting_alimit;
1756 int acurrent, abase, apeak, alimit;
1757 const char *attrname, *paren_pfx;
1758 char subjbuf[BUFSZ], valubuf[BUFSZ], valstring[32];
1760 /* being polymorphed or wearing certain cursed items prevents
1761 hero from reliably tracking changes to characteristics so
1762 we don't show base & peak values then; when the items aren't
1763 cursed, hero could take them off to check underlying values
1764 and we show those in such case so that player doesn't need
1765 to actually resort to doing that */
1767 hide_innate_value = TRUE;
1768 } else if (Fixed_abil) {
1769 if (stuck_ring(uleft, RIN_SUSTAIN_ABILITY)
1770 || stuck_ring(uright, RIN_SUSTAIN_ABILITY))
1771 hide_innate_value = TRUE;
1776 attrname = "strength";
1778 attrname = "
\8b
\82³";
1779 if (uarmg && uarmg->otyp == GAUNTLETS_OF_POWER && uarmg->cursed)
1780 hide_innate_value = TRUE;
1784 attrname = "dexterity";
1786 attrname = "
\91f
\91\81\82³";
1790 attrname = "constitution";
1792 attrname = "
\91Ï
\8bv
\97Í";
1796 attrname = "intelligence";
1798 attrname = "
\92m
\97Í";
1799 if (uarmh && uarmh->otyp == DUNCE_CAP && uarmh->cursed)
1800 hide_innate_value = TRUE;
1804 attrname = "wisdom";
1806 attrname = "
\8c«
\82³";
1807 if (uarmh && uarmh->otyp == DUNCE_CAP && uarmh->cursed)
1808 hide_innate_value = TRUE;
1812 attrname = "charisma";
1814 attrname = "
\96£
\97Í";
1817 return; /* impossible */
1819 /* note: final disclosure includes MAGICENLIGHTENTMENT */
1820 if ((mode & MAGICENLIGHTENMENT) && !Upolyd)
1821 hide_innate_value = FALSE;
1823 acurrent = ACURR(attrindx);
1824 (void) attrval(attrindx, acurrent, valubuf); /* Sprintf(valubuf,"%d",) */
1826 Sprintf(subjbuf, "Your %s ", attrname);
1828 Sprintf(subjbuf, "
\82 \82È
\82½
\82Ì%s
\82Í", attrname);
1830 if (!hide_innate_value) {
1831 /* show abase, amax, and/or attrmax if acurr doesn't match abase
1832 (a magic bonus or penalty is in effect) or abase doesn't match
1833 amax (some points have been lost to poison or exercise abuse
1834 and are restorable) or attrmax is different from normal human
1835 (while game is in progress; trying to reduce dependency on
1836 spoilers to keep track of such stuff) or attrmax was different
1837 from abase (at end of game; this attribute wasn't maxed out) */
1838 abase = ABASE(attrindx);
1839 apeak = AMAX(attrindx);
1840 alimit = ATTRMAX(attrindx);
1841 /* criterium for whether the limit is interesting varies */
1842 interesting_alimit =
1843 final ? TRUE /* was originally `(abase != alimit)' */
1844 : (alimit != (attrindx != A_STR ? 18 : STR18(100)));
1846 paren_pfx = final ? " (" : " (current; ";
1848 paren_pfx = final ? " (" : " (
\8c»
\8dÝ; ";
1849 if (acurrent != abase) {
1851 Sprintf(eos(valubuf), "%sbase:%s", paren_pfx,
1852 attrval(attrindx, abase, valstring));
1854 Sprintf(eos(valubuf), "%s
\8aî
\96{:%s", paren_pfx,
1855 attrval(attrindx, abase, valstring));
1859 if (abase != apeak) {
1861 Sprintf(eos(valubuf), "%speak:%s", paren_pfx,
1862 attrval(attrindx, apeak, valstring));
1864 Sprintf(eos(valubuf), "%s
\8dÅ
\91å:%s", paren_pfx,
1865 attrval(attrindx, apeak, valstring));
1869 if (interesting_alimit) {
1871 Sprintf(eos(valubuf), "%s%slimit:%s", paren_pfx,
1872 /* more verbose if exceeding 'limit' due to magic bonus */
1873 (acurrent > alimit) ? "innate " : "",
1874 attrval(attrindx, alimit, valstring));
1876 Sprintf(eos(valubuf), "%s%s
\8fã
\8cÀ:%s", paren_pfx,
1877 /* more verbose if exceeding 'limit' due to magic bonus */
1878 (acurrent > alimit) ? "
\96{
\97\88\82Ì" : "",
1879 attrval(attrindx, alimit, valstring));
1881 /* paren_pfx = ", "; */
1883 if (acurrent != abase || abase != apeak || interesting_alimit)
1884 Strcat(valubuf, ")");
1887 enl_msg(subjbuf, "is ", "was ", valubuf, "");
1889 enl_msg(subjbuf, "
\82¾", "
\82¾
\82Á
\82½", valubuf, "");
1892 /* status: selected obvious capabilities, assorted troubles */
1894 status_enlightenment(mode, final)
1898 boolean magic = (mode & MAGICENLIGHTENMENT) ? TRUE : FALSE;
1900 char buf[BUFSZ], youtoo[BUFSZ];
1901 boolean Riding = (u.usteed
1902 /* if hero dies while dismounting, u.usteed will still
1903 be set; we want to ignore steed in that situation */
1904 && !(final == ENL_GAMEOVERDEAD
1906 && !strcmp(killer.name, "riding accident")));
1908 && !strcmp(killer.name, "
\8bR
\8fæ
\8e\96\8cÌ
\82Å")));
1909 const char *steedname = (!Riding ? (char *) 0
1910 : x_monnam(u.usteed,
1911 u.usteed->mtame ? ARTICLE_YOUR : ARTICLE_THE,
1913 (SUPPRESS_SADDLE | SUPPRESS_HALLUCINATION),
1917 * Status (many are abbreviated on bottom line; others are or
1918 * should be discernible to the hero hence to the player)
1920 putstr(en_win, 0, ""); /* separator after title or characteristics */
1922 putstr(en_win, 0, final ? "Final Status:" : "Current Status:");
1924 putstr(en_win, 0, final ? "
\8dÅ
\8fI
\8fó
\91Ô:" : "
\8c»
\8dÝ
\82Ì
\8fó
\91Ô:");
1926 Strcpy(youtoo, You_);
1927 /* not a traditional status but inherently obvious to player; more
1928 detail given below (attributes section) for magic enlightenment */
1931 you_are("transformed", "");
1933 you_are_ing("
\95Ï
\89»
\82µ
\82Ä", "");
1934 /* not a trouble, but we want to display riding status before maybe
1935 reporting steed as trapped or hero stuck to cursed saddle */
1938 Sprintf(buf, "riding %s", steedname);
1941 Sprintf(buf, "%s
\82É
\8fæ
\82Á
\82Ä", steedname);
1942 you_are_ing(buf, "");
1945 Sprintf(eos(youtoo), "and %s ", steedname);
1947 Sprintf(youtoo, "
\82 \82È
\82½
\82Æ%s
\82Í", steedname);
1949 /* other movement situations that hero should always know */
1951 if (Lev_at_will && magic)
1953 you_are("levitating, at will", "");
1955 you_are_ing("
\8e©
\95ª
\82Ì
\88Ó
\8eu
\82Å
\95\82\97V
\82µ
\82Ä", "");
1958 enl_msg(youtoo, are, were, "levitating", from_what(LEVITATION));
1960 enl_msg(youtoo, "
\82¢
\82é", "
\82¢
\82½", "
\95\82\97V
\82µ
\82Ä", from_what(LEVITATION));
1961 } else if (Flying) { /* can only fly when not levitating */
1963 enl_msg(youtoo, are, were, "flying", from_what(FLYING));
1965 enl_msg(youtoo, "
\82¢
\82é", "
\82¢
\82½", "
\94ò
\82ñ
\82Å", from_what(FLYING));
1969 you_are("underwater", "");
1971 enl_msg(You_, "
\82¢
\82é", "
\82¢
\82½", "
\90\85\96Ê
\89º
\82É", "");
1972 } else if (u.uinwater) {
1974 you_are(Swimming ? "swimming" : "in water", from_what(SWIMMING));
1976 enl_msg(You_, Swimming ? "
\89j
\82¢
\82Å" : "
\90\85\92\86\82É", "
\82¢
\82é", "
\82¢
\82½", from_what(SWIMMING));
1977 } else if (walking_on_water()) {
1978 /* show active Wwalking here, potential Wwalking elsewhere */
1980 Sprintf(buf, "walking on %s",
1981 is_pool(u.ux, u.uy) ? "water"
1982 : is_lava(u.ux, u.uy) ? "lava"
1983 : surface(u.ux, u.uy)); /* catchall; shouldn't happen */
1984 you_are(buf, from_what(WWALKING));
1986 Sprintf(buf, "%s
\82Ì
\8fã
\82ð
\95à
\82¢
\82Ä",
1987 is_pool(u.ux, u.uy) ? "
\90\85"
1988 : is_lava(u.ux, u.uy) ? "
\97n
\8aâ"
1989 : surface(u.ux, u.uy)); /* catchall; shouldn't happen */
1990 you_are_ing(buf, from_what(WWALKING));
1993 if (Upolyd && (u.uundetected || youmonst.m_ap_type != M_AP_NOTHING))
1994 youhiding(TRUE, final);
1996 /* internal troubles, mostly in the order that prayer ranks them */
1999 you_are("turning to stone", "");
2001 enl_msg("
\82 \82È
\82½
\82Í", "
\82È
\82è
\82Â
\82Â
\82 \82é", "
\82È
\82Á
\82½", "
\90Î
\82É", "");
2004 you_are("turning into slime", "");
2006 enl_msg("
\82 \82È
\82½
\82Í", "
\82È
\82è
\82Â
\82Â
\82 \82é", "
\82È
\82Á
\82½", "
\83X
\83\89\83C
\83\80\82É", "");
2010 you_are("buried", "");
2012 you_are_ing("
\92\82\91§
\82µ
\82Ä", "");
2015 Strcpy(buf, "being strangled");
2017 Strcpy(buf, "
\8eñ
\82ð
\8di
\82ß
\82ç
\82ê
\82Ä");
2019 Sprintf(eos(buf), " (%ld)", (Strangled & TIMEOUT));
2021 you_are(buf, from_what(STRANGLED));
2023 enl_msg("
\82 \82È
\82½
\82Í", "
\82¢
\82é", "
\82¢
\82½", buf, from_what(STRANGLED));
2027 /* prayer lumps these together; botl puts Ill before FoodPois */
2028 if (u.usick_type & SICK_NONVOMITABLE)
2030 you_are("terminally sick from illness", "");
2032 enl_msg("
\82 \82È
\82½
\82Í
\95a
\8bC
\82Å
\92v
\96½
\93I
\82É
\8bC
\95ª
\82ª
\88«", "
\82¢", "
\82©
\82Á
\82½", "", "");
2033 if (u.usick_type & SICK_VOMITABLE)
2035 you_are("terminally sick from food poisoning", "");
2037 enl_msg("
\82 \82È
\82½
\82Í
\90H
\92\86\93Å
\82Å
\92v
\96½
\93I
\82É
\8bC
\95ª
\82ª
\88«", "
\82¢", "
\82©
\82Á
\82½", "", "");
2041 you_are("nauseated", "");
2043 enl_msg(You_, "
\93f
\82«
\8bC
\82ª", "
\82 \82é", "
\82 \82Á
\82½", "");
2046 you_are("stunned", "");
2048 you_are("
\82
\82ç
\82
\82ç
\8fó
\91Ô", "");
2051 you_are("confused", "");
2053 you_are("
\8d¬
\97\90\8fó
\91Ô", "");
2056 you_are("hallucinating", "");
2058 you_are("
\8c¶
\8ao
\8fó
\91Ô", "");
2060 /* from_what() (currently wizard-mode only) checks !haseyes()
2061 before u.uroleplay.blind, so we should too */
2063 Sprintf(buf, "%s blind",
2064 !haseyes(youmonst.data) ? "innately"
2065 : u.uroleplay.blind ? "permanently"
2066 /* better phrasing desperately wanted... */
2067 : Blindfolded_only ? "deliberately"
2070 Sprintf(buf, "%s
\96Ó
\96Ú",
2071 !haseyes(youmonst.data) ? "
\90¶
\82Ü
\82ê
\82È
\82ª
\82ç
\82É"
2072 : u.uroleplay.blind ? "
\8dP
\8bv
\93I
\82É"
2073 /* better phrasing desperately wanted... */
2074 : Blindfolded_only ? "
\8cÌ
\88Ó
\82É"
2075 : "
\88ê
\8e\9e\93I
\82É");
2077 if (wizard && (Blinded & TIMEOUT) != 0L
2078 && !u.uroleplay.blind && haseyes(youmonst.data))
2079 Sprintf(eos(buf), " (%ld)", (Blinded & TIMEOUT));
2080 /* !haseyes: avoid "you are innately blind innately" */
2081 you_are(buf, !haseyes(youmonst.data) ? "" : from_what(BLINDED));
2085 you_are("deaf", from_what(DEAF));
2087 you_are("
\8e¨
\82ª
\95·
\82±
\82¦
\82È
\82¢
\8fó
\91Ô", from_what(DEAF));
2089 /* external troubles, more or less */
2093 Sprintf(buf, "chained to %s", ansimpleoname(uball));
2095 Sprintf(buf, "%s
\82É
\82Â
\82È
\82ª
\82ê
\82Ä", ansimpleoname(uball));
2097 impossible("Punished without uball?");
2099 Strcpy(buf, "punished");
2101 Strcpy(buf, "
\94±
\82ð
\8eó
\82¯
\82Ä");
2106 you_are_ing(buf, "");
2109 char predicament[BUFSZ];
2111 boolean anchored = (u.utraptype == TT_BURIEDBALL);
2115 Strcpy(predicament, "tethered to something buried");
2117 Strcpy(predicament, "
\89½
\82©
\96\84\82Ü
\82Á
\82Ä
\82¢
\82é
\82à
\82Ì
\82É
\82Â
\82È
\82ª
\82ê
\82Ä");
2118 } else if (u.utraptype == TT_INFLOOR || u.utraptype == TT_LAVA) {
2120 Sprintf(predicament, "stuck in %s", the(surface(u.ux, u.uy)));
2122 Sprintf(predicament, "%s
\82É
\96\84\82Ü
\82Á
\82Ä", surface(u.ux, u.uy));
2125 Strcpy(predicament, "trapped");
2126 if ((t = t_at(u.ux, u.uy)) != 0)
2127 Sprintf(eos(predicament), " in %s",
2128 an(defsyms[trap_to_defsym(t->ttyp)].explanation));
2130 predicament[0] = '\0';
2131 if ((t = t_at(u.ux, u.uy)) != 0)
2132 Sprintf(predicament, "%s
\82É",
2133 defsyms[trap_to_defsym(t->ttyp)].explanation);
2134 Strcat(predicament, "
\82Ð
\82Á
\82©
\82©
\82Á
\82Ä");
2137 if (u.usteed) { /* not `Riding' here */
2139 Sprintf(buf, "%s%s ", anchored ? "you and " : "", steedname);
2141 enl_msg(buf, (anchored ? "are " : "is "),
2142 (anchored ? "were " : "was "), predicament, "");
2144 Sprintf(buf, "%s%s
\82Í", anchored ? "
\82 \82È
\82½
\82Æ" : "", steedname);
2145 enl_msg(buf, "
\82¢
\82é", "
\82¢
\82½" , predicament, "");
2148 you_are(predicament, "");
2152 Sprintf(buf, "swallowed by %s", a_monnam(u.ustuck));
2154 Sprintf(buf, "%s
\82É
\88ù
\82Ý
\8d\9e\82Ü
\82ê
\82Ä", a_monnam(u.ustuck));
2156 Sprintf(eos(buf), " (%u)", u.uswldtim);
2158 } else if (u.ustuck) {
2160 Sprintf(buf, "%s %s",
2161 (Upolyd && sticks(youmonst.data)) ? "holding" : "held by",
2162 a_monnam(u.ustuck));
2165 Sprintf(buf, "%s%s",
2167 (Upolyd && sticks(youmonst.data)) ? "
\82ð
\95ß
\82Ü
\82¦
\82Ä" : "
\82É
\95ß
\82Ü
\82Á
\82Ä");
2168 you_are_ing(buf, "");
2172 struct obj *saddle = which_armor(u.usteed, W_SADDLE);
2174 if (saddle && saddle->cursed) {
2175 Sprintf(buf, "stuck to %s %s", s_suffix(steedname),
2176 simpleonames(saddle));
2181 /* when mounted, Wounded_legs applies to steed rather than to
2182 hero; we only report steed's wounded legs in wizard mode */
2183 if (u.usteed) { /* not `Riding' here */
2184 if (wizard && steedname) {
2186 Strcpy(buf, steedname);
2188 enl_msg(buf, " has", " had", " wounded legs", "");
2190 enl_msg(buf, iru, ita, "
\82Í
\8e\88\82ð
\89ö
\89ä
\82µ
\82Ä", "");
2195 Sprintf(buf, "wounded %s", makeplural(body_part(LEG)));
2198 Sprintf(buf, "%s
\82ð
\89ö
\89ä
\82µ
\82Ä", makeplural(body_part(LEG)));
2199 you_are_ing(buf, "");
2205 Sprintf(buf, "slippery %s", makeplural(body_part(FINGER)));
2208 Sprintf(buf, "%s
\82ª
\82Ê
\82é
\82Ê
\82é
\82µ
\82Ä", body_part(FINGER));
2209 enl_msg(buf, iru, ita, "", "");
2213 if (magic || cause_known(FUMBLING))
2215 enl_msg(You_, "fumble", "fumbled", "", from_what(FUMBLING));
2217 you_are_ing("
\95s
\8aí
\97p
\82É
\82È
\82Á
\82Ä", from_what(FUMBLING));
2220 if (magic || cause_known(SLEEPY)) {
2221 Strcpy(buf, from_what(SLEEPY));
2223 Sprintf(eos(buf), " (%ld)", (HSleepy & TIMEOUT));
2225 enl_msg("You ", "fall", "fell", " asleep uncontrollably", buf);
2227 you_are_ing("
\96°
\82Á
\82Ä", buf);
2230 /* hunger/nutrition */
2232 if (magic || cause_known(HUNGER))
2234 enl_msg(You_, "hunger", "hungered", " rapidly",
2237 enl_msg("
\82 \82È
\82½
\82Í
\82·
\82®
\82É
\95 \82ª
\8c¸
\82é
\8fó
\91Ô", "
\82Å
\82 \82é", "
\82¾
\82Á
\82½", "", "");
2240 Strcpy(buf, hu_stat[u.uhs]); /* hunger status; omitted if "normal" */
2241 mungspaces(buf); /* strip trailing spaces */
2244 *buf = lowc(*buf); /* override capitalization */
2245 if (!strcmp(buf, "weak"))
2246 Strcat(buf, " from severe hunger");
2247 else if (!strncmp(buf, "faint", 5)) /* fainting, fainted */
2248 Strcat(buf, " due to starvation");
2251 Strcat(buf, "
\8fó
\91Ô");
2256 if ((cap = near_capacity()) > UNENCUMBERED) {
2258 const char *adj = "?_?"; /* (should always get overridden) */
2260 Strcpy(buf, enc_stat[cap]);
2265 break; /* burdened */
2268 break; /* stressed */
2271 break; /* strained */
2274 break; /* overtaxed */
2276 adj = "not possible";
2279 Sprintf(eos(buf), "; movement %s %s%s", !final ? "is" : "was", adj,
2280 (cap < OVERLOADED) ? " slowed" : "");
2283 Sprintf(buf, "
\89×
\95¨
\82É
\82æ
\82Á
\82Ä%s
\8fó
\91Ô", enc_stat[cap]);
2287 /* last resort entry, guarantees Status section is non-empty
2288 (no longer needed for that purpose since weapon status added;
2289 still useful though) */
2291 you_are("unencumbered", "");
2293 you_are("
\89×
\95¨
\82Í
\8e×
\96\82\82É
\82È
\82ç
\82È
\82¢
\8fó
\91Ô", "");
2295 /* report being weaponless; distinguish whether gloves are worn */
2298 you_are(uarmg ? "empty handed" /* gloves imply hands */
2299 : humanoid(youmonst.data)
2300 /* hands but no weapon and no gloves */
2302 /* alternate phrasing for paws or lack of hands */
2303 : "not wielding anything",
2306 enl_msg(You_, "
\82¢", "
\82©
\82Á
\82½", "
\95\90\8aí
\82ð
\91\95\94õ
\82µ
\82Ä
\82¢
\82È", "");
2308 /* two-weaponing implies a weapon (not other odd stuff) in each hand */
2309 } else if (u.twoweap) {
2311 you_are("wielding two weapons at once", "");
2313 you_are("
\93ñ
\93\81\97¬", "");
2314 /* report most weapons by their skill class (so a katana will be
2315 described as a long sword, for instance; mattock and hook are
2316 exceptions), or wielded non-weapon item by its object class */
2318 const char *what = weapon_descr(uwep);
2321 if (!strcmpi(what, "armor") || !strcmpi(what, "food")
2322 || !strcmpi(what, "venom"))
2323 Sprintf(buf, "wielding some %s", what);
2325 Sprintf(buf, "wielding %s",
2326 (uwep->quan == 1L) ? an(what) : makeplural(what));
2329 Sprintf(buf, "%s
\82ð
\91\95\94õ
\82µ
\82Ä", what);
2330 enl_msg(You_, "
\82¢
\82é", "
\82¢
\82½", buf, "");
2333 /* report 'nudity' */
2334 if (!uarm && !uarmu && !uarmc && !uarmg && !uarmf && !uarmh) {
2335 if (u.uroleplay.nudist)
2337 enl_msg(You_, "do", "did", " not wear any armor", "");
2339 enl_msg(You_, "
\82¢", "
\82©
\82Á
\82½", "
\89½
\82Ì
\8aZ
\82à
\91\95\94õ
\82µ
\82È", "");
2343 you_are("not wearing any armor", "");
2345 enl_msg(You_, "
\82¢", "
\82©
\82Á
\82½", "
\89½
\82Ì
\8aZ
\82à
\91\95\94õ
\82µ
\82Ä
\82¢
\82È", "");
2350 /* attributes: intrinsics and the like, other non-obvious capabilities */
2352 attributes_enlightenment(unused_mode, final)
2353 int unused_mode UNUSED;
2356 static NEARDATA const char if_surroundings_permitted[] =
2357 " if surroundings permitted";
2364 putstr(en_win, 0, "");
2366 putstr(en_win, 0, final ? "Final Attributes:" : "Current Attributes:");
2368 putstr(en_win, 0, final ? "
\8dÅ
\8fI
\91®
\90«:" : "
\8c»
\8dÝ
\82Ì
\91®
\90«:");
2370 if (u.uevent.uhand_of_elbereth) {
2372 static const char *const hofe_titles[3] = { "the Hand of Elbereth",
2373 "the Envoy of Balance",
2374 "the Glory of Arioch" };
2376 static const char *const hofe_titles[3] = { "
\83G
\83\8b\83x
\83\8c\83X
\82Ì
\8cä
\8eè",
2377 "
\92²
\98a
\82Ì
\8eg
\8eÒ",
2378 "
\83A
\83\8a\83I
\83b
\83`
\82Ì
\96¼
\97_" };
2380 you_are(hofe_titles[u.uevent.uhand_of_elbereth - 1], "");
2383 /* note: piousness 20 matches MIN_QUEST_ALIGN (quest.h) */
2384 if (u.ualign.record >= 20)
2386 you_are("piously aligned", "");
2388 you_have("
\8chåi
\82È
\90M
\8bÂ
\90S", "");
2389 else if (u.ualign.record > 13)
2391 you_are("devoutly aligned", "");
2393 you_have("
\90S
\82©
\82ç
\82Ì
\90M
\8bÂ
\90S", "");
2394 else if (u.ualign.record > 8)
2396 you_are("fervently aligned", "");
2398 you_have("
\94M
\90S
\82È
\90M
\8bÂ
\90S", "");
2399 else if (u.ualign.record > 3)
2401 you_are("stridently aligned", "");
2403 you_have("
\82¨
\82¨
\82°
\82³
\82È
\90M
\8bÂ
\90S", "");
2404 else if (u.ualign.record == 3)
2406 you_are("aligned", "");
2408 you_have("
\95\81\92Ê
\82Ì
\90M
\8bÂ
\90S", "");
2409 else if (u.ualign.record > 0)
2411 you_are("haltingly aligned", "");
2413 you_have("çSçO
\82µ
\82È
\82ª
\82ç
\82à
\90M
\8bÂ
\90S", "");
2414 else if (u.ualign.record == 0)
2416 you_are("nominally aligned", "");
2418 you_have("
\8c`
\82¾
\82¯
\82Ì
\90M
\8bÂ
\90S", "");
2419 else if (u.ualign.record >= -3)
2421 you_have("strayed", "");
2423 you_are_ing("
\90M
\8bÂ
\82É
\96À
\82¢
\82ð
\82à
\82Á
\82Ä", "");
2424 else if (u.ualign.record >= -8)
2426 you_have("sinned", "");
2428 you_are_ing("
\8dß
\82ð
\95\89\82Á
\82Ä", "");
2431 you_have("transgressed", "");
2433 you_are_ing("
\90M
\8bÂ
\82©
\82ç
\88í
\92E
\82µ
\82Ä", "");
2436 Sprintf(buf, " %d", u.ualign.record);
2437 enl_msg("Your alignment ", "is", "was", buf, "");
2439 Sprintf(buf, "
\82 \82È
\82½
\82Ì
\91®
\90«
\92l
\82Í%d", u.ualign.record);
2440 enl_msg(buf, "
\82Å
\82 \82é", "
\82¾
\82Á
\82½", "", "");
2444 /*** Resistances to troubles ***/
2447 you_are("invulnerable", from_what(INVULNERABLE));
2449 you_are("
\95s
\8e\80\90g", from_what(INVULNERABLE));
2452 you_are("magic-protected", from_what(ANTIMAGIC));
2454 you_have("
\96\82\96@
\96h
\8cä
\94\
\97Í", from_what(ANTIMAGIC));
2455 if (Fire_resistance)
2457 you_are("fire resistant", from_what(FIRE_RES));
2459 you_have("
\89Î
\82Ö
\82Ì
\91Ï
\90«", from_what(FIRE_RES));
2460 if (Cold_resistance)
2462 you_are("cold resistant", from_what(COLD_RES));
2464 you_have("
\8a¦
\82³
\82Ö
\82Ì
\91Ï
\90«", from_what(COLD_RES));
2465 if (Sleep_resistance)
2467 you_are("sleep resistant", from_what(SLEEP_RES));
2469 you_have("
\96°
\82è
\82Ö
\82Ì
\91Ï
\90«", from_what(SLEEP_RES));
2470 if (Disint_resistance)
2472 you_are("disintegration-resistant", from_what(DISINT_RES));
2474 you_have("
\95²
\8dÓ
\82Ö
\82Ì
\91Ï
\90«", from_what(DISINT_RES));
2475 if (Shock_resistance)
2477 you_are("shock resistant", from_what(SHOCK_RES));
2479 you_have("
\93d
\8c\82\82Ö
\82Ì
\91Ï
\90«", from_what(SHOCK_RES));
2480 if (Poison_resistance)
2482 you_are("poison resistant", from_what(POISON_RES));
2484 you_have("
\93Å
\82Ö
\82Ì
\91Ï
\90«", from_what(POISON_RES));
2485 if (Acid_resistance)
2487 you_are("acid resistant", from_what(ACID_RES));
2489 you_have("
\8e_
\82Ö
\82Ì
\91Ï
\90«", from_what(ACID_RES));
2490 if (Drain_resistance)
2492 you_are("level-drain resistant", from_what(DRAIN_RES));
2494 you_have("
\83\8c\83x
\83\8b\83_
\83E
\83\93\82Ö
\82Ì
\91Ï
\90«", from_what(DRAIN_RES));
2495 if (Sick_resistance)
2497 you_are("immune to sickness", from_what(SICK_RES));
2499 you_have("
\95a
\8bC
\82É
\91Î
\82·
\82é
\96Æ
\89u", from_what(SICK_RES));
2500 if (Stone_resistance)
2502 you_are("petrification resistant", from_what(STONE_RES));
2504 you_have("
\90Î
\89»
\82Ö
\82Ì
\91Ï
\90«", from_what(STONE_RES));
2505 if (Halluc_resistance)
2507 enl_msg(You_, "resist", "resisted", " hallucinations",
2508 from_what(HALLUC_RES));
2510 you_have("
\8c¶
\8ao
\82Ö
\82Ì
\91Ï
\90«", from_what(HALLUC_RES));
2514 you_can("recognize detrimental food", "");
2516 you_can("
\97L
\8aQ
\82È
\90H
\97¿
\82ð
\8e¯
\95Ê", "");
2518 /*** Vision and senses ***/
2519 if (!Blind && (Blinded || !haseyes(youmonst.data)))
2520 you_can("see", from_what(-BLINDED)); /* Eyes of the Overworld */
2521 if (See_invisible) {
2524 enl_msg(You_, "see", "saw", " invisible", from_what(SEE_INVIS));
2526 enl_msg("
\82 \82È
\82½
\82Í
\93§
\96¾
\82È
\82à
\82Ì
\82ð
\8c©
\82ç
\82ê", "
\82é", "
\82½", "", from_what(SEE_INVIS));
2529 enl_msg(You_, "will see", "would have seen",
2530 " invisible when not blind", from_what(SEE_INVIS));
2532 enl_msg(You_, "
\82é", "
\82½",
2533 "
\96Ó
\96Ú
\82Å
\82È
\82¢
\82Æ
\82«
\82É
\82Í
\93§
\96¾
\82È
\82à
\82Ì
\82ð
\8c©
\82ç
\82ê", from_what(SEE_INVIS));
2538 you_are("telepathic", from_what(TELEPAT));
2540 you_have("
\83e
\83\8c\83p
\83V
\81[", from_what(TELEPAT));
2543 you_are("warned", from_what(WARNING));
2545 you_have("
\8cx
\89ú
\94\
\97Í", from_what(WARNING));
2546 if (Warn_of_mon && context.warntype.obj) {
2548 Sprintf(buf, "aware of the presence of %s",
2549 (context.warntype.obj & M2_ORC) ? "orcs"
2550 : (context.warntype.obj & M2_ELF) ? "elves"
2551 : (context.warntype.obj & M2_DEMON) ? "demons" : something);
2552 you_are(buf, from_what(WARN_OF_MON));
2554 Sprintf(buf, "%s
\82Ì
\91¶
\8dÝ
\82ð
\8a´
\82¶
\82é
\94\
\97Í",
2555 (context.warntype.obj & M2_ORC) ? "
\83I
\81[
\83N"
2556 : (context.warntype.obj & M2_ELF) ? "
\83G
\83\8b\83t"
2557 : (context.warntype.obj & M2_DEMON) ? "
\88«
\96\82" : something);
2561 if (Warn_of_mon && context.warntype.polyd) {
2563 Sprintf(buf, "aware of the presence of %s",
2564 ((context.warntype.polyd & (M2_HUMAN | M2_ELF))
2565 == (M2_HUMAN | M2_ELF))
2566 ? "humans and elves"
2567 : (context.warntype.polyd & M2_HUMAN)
2569 : (context.warntype.polyd & M2_ELF)
2571 : (context.warntype.polyd & M2_ORC)
2573 : (context.warntype.polyd & M2_DEMON)
2575 : "certain monsters");
2578 Sprintf(buf, "%s
\82Ì
\91¶
\8dÝ
\82ð
\8a´
\82¶
\82é
\94\
\97Í",
2579 ((context.warntype.polyd & (M2_HUMAN | M2_ELF))
2580 == (M2_HUMAN | M2_ELF))
2581 ? "
\90l
\8aÔ
\82Æ
\83G
\83\8b\83t"
2582 : (context.warntype.polyd & M2_HUMAN)
2584 : (context.warntype.polyd & M2_ELF)
2586 : (context.warntype.polyd & M2_ORC)
2588 : (context.warntype.polyd & M2_DEMON)
2590 : "
\82 \82é
\8eí
\82Ì
\89ö
\95¨");
2594 if (Warn_of_mon && context.warntype.speciesidx) {
2596 Sprintf(buf, "aware of the presence of %s",
2597 makeplural(mons[context.warntype.speciesidx].mname));
2598 you_are(buf, from_what(WARN_OF_MON));
2600 Sprintf(buf, "%s
\82Ì
\91¶
\8dÝ
\82ð
\8a´
\82¶
\82é
\94\
\97Í",
2601 mons[context.warntype.speciesidx].mname);
2602 you_have(buf, from_what(WARN_OF_MON));
2607 you_are("warned of undead", from_what(WARN_UNDEAD));
2609 you_have("
\95s
\8e\80\82Ì
\90¶
\95¨
\82Ö
\82Ì
\8cx
\89ú
\94\
\97Í", from_what(WARN_UNDEAD));
2612 you_have("automatic searching", from_what(SEARCHING));
2614 you_have("
\92T
\8d¸
\94\
\97Í", from_what(SEARCHING));
2617 you_are("clairvoyant", from_what(CLAIRVOYANT));
2619 you_have("
\90ç
\97¢
\8aá
\94\
\97Í", from_what(CLAIRVOYANT));
2620 else if ((HClairvoyant || EClairvoyant) && BClairvoyant) {
2621 Strcpy(buf, from_what(-CLAIRVOYANT));
2623 if (!strncmp(buf, " because of ", 12))
2624 /* overwrite substring; strncpy doesn't add terminator */
2625 (void) strncpy(buf, " if not for ", 12);
2626 enl_msg(You_, "could be", "could have been", " clairvoyant", buf);
2628 /*JP:
\81u
\81c
\82É
\82æ
\82Á
\82Ä
\81v*/
2629 if (!strncmp(buf, "
\82É
\82æ
\82Á
\82Ä", 8))
2630 /*JP:
\81u
\81c
\82ª
\82È
\82¯
\82ê
\82Î
\81v
\82É
\8f\91\82«
\8a·
\82¦
\82é*/
2631 strcpy(eos(buf) - 8, "
\82ª
\82È
\82¯
\82ê
\82Î");
2632 you_have("
\90ç
\97¢
\8aá
\94\
\97Í", buf);
2637 you_have("infravision", from_what(INFRAVISION));
2639 you_have("
\90Ô
\8aO
\90ü
\82ª
\8c©
\82¦
\82é
\8e\8b\8ao", from_what(INFRAVISION));
2640 if (Detect_monsters)
2642 you_are("sensing the presence of monsters", "");
2644 you_have("
\89ö
\95¨
\82ð
\92T
\82·
\94\
\97Í", "");
2647 you_are("going to confuse monsters", "");
2649 you_have("
\89ö
\95¨
\82ð
\8d¬
\97\90\82³
\82¹
\82é
\94\
\97Í", "");
2651 /*** Appearance and behavior ***/
2655 if (uleft && uleft->otyp == RIN_ADORNMENT)
2656 adorn += uleft->spe;
2657 if (uright && uright->otyp == RIN_ADORNMENT)
2658 adorn += uright->spe;
2659 /* the sum might be 0 (+0 ring or two which negate each other);
2660 that yields "you are charismatic" (which isn't pointless
2661 because it potentially impacts seduction attacks) */
2663 Sprintf(buf, "%scharismatic",
2664 (adorn > 0) ? "more " : (adorn < 0) ? "less " : "");
2665 you_are(buf, from_what(ADORNED));
2667 Sprintf(buf, "
\96£
\97Í%s
\82Ä",
2668 (adorn > 0) ? "
\82ª
\91\9d\89Á
\82µ" : (adorn < 0) ? "
\82ª
\8c¸
\8f
\82µ" : "
\93I
\82É
\82È
\82Á");
2669 enl_msg(You_, "
\82Ä
\82¢
\82é", "
\82½", buf, "");
2674 you_are("invisible", from_what(INVIS));
2676 you_are("
\93§
\96¾", from_what(INVIS));
2679 you_are("invisible to others", from_what(INVIS));
2681 you_are("
\91¼
\90l
\82É
\91Î
\82µ
\82Ä
\93§
\96¾", from_what(INVIS));
2682 /* ordinarily "visible" is redundant; this is a special case for
2683 the situation when invisibility would be an expected attribute */
2684 else if ((HInvis || EInvis) && BInvis)
2686 you_are("visible", from_what(-INVIS));
2688 you_are("
\95s
\93§
\96¾", from_what(-INVIS));
2691 you_are("displaced", from_what(DISPLACED));
2693 you_have("
\8c¶
\89e
\94\
\97Í", from_what(DISPLACED));
2696 you_are("stealthy", from_what(STEALTH));
2698 you_have("
\90l
\96Ú
\82ð
\93\90\82Þ
\94\
\97Í", from_what(STEALTH));
2699 if (Aggravate_monster)
2701 enl_msg("You aggravate", "", "d", " monsters",
2702 from_what(AGGRAVATE_MONSTER));
2704 you_are_ing("
\94½
\8a´
\82ð
\82©
\82Á
\82Ä", from_what(AGGRAVATE_MONSTER));
2708 enl_msg("You cause", "", "d", " conflict", from_what(CONFLICT));
2710 you_are_ing("
\93¬
\91\88\82ð
\88ø
\82«
\8bN
\82±
\82µ
\82Ä", from_what(CONFLICT));
2712 /*** Transportation ***/
2715 you_can("jump", from_what(JUMPING));
2717 you_can("
\92µ
\96ô
\82·
\82é
\82±
\82Æ
\82ª", from_what(JUMPING));
2720 you_can("teleport", from_what(TELEPORT));
2722 you_can("
\8fu
\8aÔ
\88Ú
\93®
\82ª", from_what(TELEPORT));
2723 if (Teleport_control)
2725 you_have("teleport control", from_what(TELEPORT_CONTROL));
2727 you_have("
\8fu
\8aÔ
\88Ú
\93®
\82Ì
\90§
\8cä
\94\
\97Í", from_what(TELEPORT_CONTROL));
2728 /* actively levitating handled earlier as a status condition */
2729 if (BLevitation) { /* levitation is blocked */
2730 long save_BLev = BLevitation;
2735 enl_msg(You_, "would levitate", "would have levitated",
2736 if_surroundings_permitted, "");
2738 you_are("
\95\82\97V
\8fó
\91Ô", "");
2740 BLevitation = save_BLev;
2742 /* actively flying handled earlier as a status condition */
2743 if (BFlying) { /* flight is blocked */
2744 long save_BFly = BFlying;
2749 enl_msg(You_, "would fly", "would have flown",
2751 ? "if you weren't levitating"
2752 : (save_BFly == FROMOUTSIDE)
2753 ? if_surroundings_permitted
2754 /* both surroundings and [latent] levitation */
2755 : " if circumstances permitted",
2758 you_can("
\94ò
\82Ô
\82±
\82Æ
\82ª", "");
2760 BFlying = save_BFly;
2762 /* actively walking on water handled earlier as a status condition */
2763 if (Wwalking && !walking_on_water())
2765 you_can("walk on water", from_what(WWALKING));
2767 you_can("
\90\85\82Ì
\8fã
\82ð
\95à
\82
\82±
\82Æ
\82ª", from_what(WWALKING));
2768 /* actively swimming (in water but not under it) handled earlier */
2769 if (Swimming && (Underwater || !u.uinwater))
2771 you_can("swim", from_what(SWIMMING));
2773 you_can("
\89j
\82®
\82±
\82Æ
\82ª", from_what(SWIMMING));
2776 you_can("survive without air", from_what(MAGICAL_BREATHING));
2778 you_can("
\8bó
\8bC
\82È
\82µ
\82Å
\90¶
\82«
\89\84\82Ñ
\82é
\82±
\82Æ
\82ª", from_what(MAGICAL_BREATHING));
2779 else if (Amphibious)
2781 you_can("breathe water", from_what(MAGICAL_BREATHING));
2783 you_can("
\90\85\92\86\82Å
\8cÄ
\8bz
\82ª", from_what(MAGICAL_BREATHING));
2786 you_can("walk through walls", from_what(PASSES_WALLS));
2788 you_can("
\95Ç
\82ð
\92Ê
\82è
\94²
\82¯
\82é
\82±
\82Æ
\82ª", from_what(PASSES_WALLS));
2790 /*** Physical attributes ***/
2793 enl_msg("You regenerate", "", "d", "", from_what(REGENERATION));
2795 you_have("
\8dÄ
\90¶
\94\
\97Í", from_what(REGENERATION));
2798 you_have("slower digestion", from_what(SLOW_DIGESTION));
2800 enl_msg("
\90H
\95¨
\82Ì
\8fÁ
\89»
\82ª
\92x", "
\82¢", "
\82©
\82Á
\82½", "", from_what(SLOW_DIGESTION));
2803 you_have(enlght_combatinc("to hit", u.uhitinc, final, buf), "");
2805 you_have(enlght_combatinc("
\96½
\92\86\97¦", u.uhitinc, final, buf), "");
2808 you_have(enlght_combatinc("damage", u.udaminc, final, buf), "");
2810 you_have(enlght_combatinc("
\83_
\83\81\81[
\83W", u.udaminc, final, buf), "");
2811 if (u.uspellprot || Protection) {
2814 if (uleft && uleft->otyp == RIN_PROTECTION)
2816 if (uright && uright->otyp == RIN_PROTECTION)
2817 prot += uright->spe;
2818 if (HProtection & INTRINSIC)
2820 prot += u.uspellprot;
2823 you_have(enlght_combatinc("defense", prot, final, buf), "");
2825 you_have(enlght_combatinc("
\96h
\8cä", prot, final, buf), "");
2827 if ((armpro = magic_negation(&youmonst)) > 0) {
2828 /* magic cancellation factor, conferred by worn armor */
2829 static const char *const mc_types[] = {
2831 "" /*ordinary*/, "warded", "guarded", "protected",
2833 "" /*ordinary*/, "
\89q
\82ç
\82ê
\82Ä", "
\8cì
\82ç
\82ê
\82Ä", "
\8eç
\82ç
\82ê
\82Ä",
2837 if (armpro >= SIZE(mc_types))
2838 armpro = SIZE(mc_types) - 1;
2840 you_are(mc_types[armpro], "");
2842 you_are_ing(mc_types[armpro], "");
2844 if (Half_physical_damage)
2845 enlght_halfdmg(HALF_PHDAM, final);
2846 if (Half_spell_damage)
2847 enlght_halfdmg(HALF_SPDAM, final);
2848 /* polymorph and other shape change */
2849 if (Protection_from_shape_changers)
2851 you_are("protected from shape changers",
2852 from_what(PROT_FROM_SHAPE_CHANGERS));
2854 you_have("
\95Ï
\89»
\89ö
\95¨
\82Ö
\82Ì
\91Ï
\90«", from_what(PROT_FROM_SHAPE_CHANGERS));
2857 const char *what = 0;
2859 if (!Upolyd) /* Upolyd handled below after current form */
2861 you_can("not change from your current form",
2863 you_are("
\8c»
\8dÝ
\82Ì
\8ep
\82©
\82ç
\95Ï
\89»
\82Å
\82«
\82È
\82¢
\8fó
\91Ô",
2864 from_what(UNCHANGING));
2865 /* blocked shape changes */
2868 what = !final ? "polymorph" : "have polymorphed";
2870 what = "
\95Ï
\89»
\82µ
\82Ä";
2871 else if (u.ulycn >= LOW_PM)
2873 what = !final ? "change shape" : "have changed shape";
2875 what = "
\8ep
\82ð
\95Ï
\82¦
\82Ä";
2878 Sprintf(buf, "would %s periodically", what);
2879 /* omit from_what(UNCHANGING); too verbose */
2880 enl_msg(You_, buf, buf, " if not locked into your current form",
2883 Sprintf(buf, "
\82à
\82µ
\8c»
\8dÝ
\82Ì
\8ep
\82É
\8cÅ
\92è
\82³
\82ê
\82Ä
\82¢
\82È
\82¯
\82ê
\82Î
\92è
\8aú
\93I
\82É%s", what);
2884 you_are_ing(buf, "");
2887 } else if (Polymorph) {
2889 you_are("polymorphing periodically", from_what(POLYMORPH));
2891 you_are("
\92è
\8aú
\93I
\82É
\95Ï
\89»
\82µ
\82Ä", from_what(POLYMORPH));
2893 if (Polymorph_control)
2895 you_have("polymorph control", from_what(POLYMORPH_CONTROL));
2897 you_have("
\95Ï
\89»
\82Ì
\90§
\8cä
\94\
\97Í", from_what(POLYMORPH_CONTROL));
2898 if (Upolyd && u.umonnum != u.ulycn) {
2899 /* foreign shape (except were-form which is handled below) */
2901 Sprintf(buf, "polymorphed into %s", an(youmonst.data->mname));
2903 Sprintf(buf, "%s
\82É
\95Ï
\89»
\82µ
\82Ä", youmonst.data->mname);
2905 Sprintf(eos(buf), " (%d)", u.mtimedone);
2909 you_are_ing(buf, "");
2911 if (lays_eggs(youmonst.data) && flags.female) /* Upolyd */
2913 you_can("lay eggs", "");
2915 you_can("
\97\91\82ð
\8eY
\82Þ
\82±
\82Æ
\82ª", "");
2916 if (u.ulycn >= LOW_PM) {
2918 /* "you are a werecreature [in beast form]" */
2919 Strcpy(buf, an(mons[u.ulycn].mname));
2920 if (u.umonnum == u.ulycn) {
2921 Strcat(buf, " in beast form");
2923 Sprintf(eos(buf), " (%d)", u.mtimedone);
2926 /*JP:
\81u
\82 \82È
\82½
\82Í[
\8fb
\82Ì
\8ep
\82Ì]
\81\9b\81\9b\90l
\8aÔ
\82Å
\82 \82é
\81v*/
2928 if (u.umonnum == u.ulycn) {
2929 Strcpy(buf, "
\8fb
\82Ì
\8ep
\82Ì");
2931 Sprintf(eos(buf), " (%d)", u.mtimedone);
2933 Strcat(buf, mons[u.ulycn].mname);
2937 if (Unchanging && Upolyd) /* !Upolyd handled above */
2939 you_can("not change from your current form", from_what(UNCHANGING));
2941 enl_msg("
\8d¡
\82Ì
\8ep
\82©
\82ç
\95Ï
\89»
\82·
\82é
\82±
\82Æ
\82ª
\82Å
\82«
\82È", "
\82¢", "
\82©
\82Á
\82½", "", from_what(UNCHANGING));
2943 you_are("harmed by silver", "");
2944 /* movement and non-armor-based protection */
2947 you_are(Very_fast ? "very fast" : "fast", from_what(FAST));
2949 you_have(Very_fast ? "
\82Æ
\82Ä
\82à
\91f
\91\81\82
\8ds
\93®
\82·
\82é
\94\
\97Í" : "
\91f
\91\81\82
\8ds
\93®
\82·
\82é
\94\
\97Í", from_what(FAST));
2952 you_have("reflection", from_what(REFLECTING));
2954 you_have("
\94½
\8eË
\94\
\97Í", from_what(REFLECTING));
2957 you_have("free action", from_what(FREE_ACTION));
2959 you_have("
\8dS
\91©
\82³
\82ê
\82È
\82¢
\94\
\97Í", from_what(FREE_ACTION));
2962 you_have("fixed abilities", from_what(FIXED_ABIL));
2964 enl_msg("
\94\
\97Í
\82ª
\95Ï
\89»
\82µ
\82È", "
\82¢", "
\82©
\82Á
\82½", "", from_what(FIXED_ABIL));
2967 enl_msg("Your life ", "will be", "would have been", " saved", "");
2969 enl_msg("
\82 \82È
\82½
\82Ì
\90¶
\96½
\82Í
\95Û
\91¶
\82³
\82ê
\82Ä", iru, ita, "", "");
2971 /*** Miscellany ***/
2973 ltmp = abs((int) Luck);
2975 Sprintf(buf, "%s%slucky",
2976 ltmp >= 10 ? "extremely " : ltmp >= 5 ? "very " : "",
2977 Luck < 0 ? "un" : "");
2979 Sprintf(buf, "%s%s",
2980 ltmp >= 10 ? "
\96Ò
\97ó
\82É" : ltmp >= 5 ? "
\82Æ
\82Ä
\82à" : "",
2981 Luck < 0 ? "
\95s
\8dK" : "
\8dK
\95\9f");
2984 Sprintf(eos(buf), " (%d)", Luck);
2988 enl_msg("Your luck ", "is", "was", " zero", "");
2990 enl_msg("
\82 \82È
\82½
\82Ì
\89^
\82Í
\83[
\83\8d", "
\82Å
\82 \82é", "
\82¾
\82Á
\82½", "", "");
2993 you_have("extra luck", "");
2995 you_have("
\82³
\82ç
\82È
\82é
\8dK
\89^", "");
2996 else if (u.moreluck < 0)
2998 you_have("reduced luck", "");
3000 you_have("
\82³
\82ç
\82È
\82é
\95s
\89^", "");
3001 if (carrying(LUCKSTONE) || stone_luck(TRUE)) {
3002 ltmp = stone_luck(0);
3005 enl_msg("Bad luck ", "does", "did", " not time out for you", "");
3007 enl_msg("
\95s
\89^
\82Í
\8e\9e\8aÔ
\90Ø
\82ê
\82É
\82È
\82ç
\82È", "
\82¢", "
\82©
\82Á
\82½", "", "");
3010 enl_msg("Good luck ", "does", "did", " not time out for you", "");
3012 enl_msg("
\8dK
\89^
\82Í
\8e\9e\8aÔ
\90Ø
\82ê
\82É
\82È
\82ç
\82È", "
\82¢", "
\82©
\82Á
\82½", "", "");
3017 Sprintf(buf, " %sangry with you",
3018 u.ugangr > 6 ? "extremely " : u.ugangr > 3 ? "very " : "");
3020 Sprintf(buf, "%s
\82Í%s
\93{
\82Á
\82Ä%s", u_gname(),
3021 u.ugangr > 6 ? "
\96Ò
\97ó
\82É" : u.ugangr > 3 ? "
\82Æ
\82Ä
\82à" : "", final ? ita : iru);
3024 Sprintf(eos(buf), " (%d)", u.ugangr);
3026 enl_msg(u_gname(), " is", " was", buf, "");
3028 enl_msg(buf, "", "", "", "");
3032 * We need to suppress this when the game is over, because death
3033 * can change the value calculated by can_pray(), potentially
3034 * resulting in a false claim that you could have prayed safely.
3039 /* "can [not] safely pray" vs "could [not] have safely prayed" */
3040 Sprintf(buf, "%s%ssafely pray%s", can_pray(FALSE) ? "" : "not ",
3041 final ? "have " : "", final ? "ed" : "");
3043 Sprintf(buf, "%ssafely pray", can_pray(FALSE) ? "" : "not ");
3046 Sprintf(eos(buf), " (%d)", u.ublesscnt);
3049 Sprintf(buf, "
\82 \82È
\82½
\82Í
\88À
\91S
\82É
\8bF
\82é
\82±
\82Æ
\82ª");
3050 Strcat(buf, can_pray(FALSE) ? can : "
\82Å
\82«
\82È
\82¢");
3052 Sprintf(eos(buf), " (%d)", u.ublesscnt);
3053 enl_msg(buf, "", "", "", "");
3058 /* named fruit debugging (doesn't really belong here...) */
3064 for (f = ffruit; f; f = f->nextf) {
3066 Sprintf(buf, "Fruit %d ", ++fcount);
3068 Sprintf(buf, "fruit %d
\82Í", ++fcount);
3069 Sprintf(buf2, "%s (id %d)", f->fname, f->fid);
3071 enl_msg(buf, "is ", "was ", buf2, "");
3073 enl_msg(buf, "
\82¾", "
\82¾
\82Á
\82½", buf2, "");
3076 enl_msg("The current fruit ", "is ", "was ", pl_fruit, "");
3078 enl_msg("
\8c»
\8dÝ
\82Ì fruit
\82Í", "
\82¾", "
\82¾
\82Á
\82½", pl_fruit, "");
3079 Sprintf(buf, "%d", flags.made_fruit);
3081 enl_msg("The made fruit flag ", "is ", "was ", buf, "");
3083 enl_msg("made fruit flag
\82Í", "
\82¾", "
\82¾
\82Á
\82½", buf, "");
3090 if (final < 2) { /* still in progress, or quit/escaped/ascended */
3092 p = "survived after being killed ";
3094 p = "
\8e\80\82ñ
\82¾
\8cã
\95\9c\8a\88\82µ
\82Ä
\82¢
\82½";
3095 switch (u.umortality) {
3098 p = !final ? (char *) 0 : "survived";
3100 p = !final ? (char *)0 : "
\90¶
\82«
\89\84\82Ñ
\82½";
3104 Strcpy(buf, "once");
3106 Strcpy(buf, "
\88ê
\93x");
3110 Strcpy(buf, "twice");
3112 Strcpy(buf, "
\93ñ
\93x");
3116 Strcpy(buf, "thrice");
3118 Strcpy(buf, "
\8eO
\93x");
3122 Sprintf(buf, "%d times", u.umortality);
3124 Sprintf(buf, "%d
\89ñ", u.umortality);
3127 } else { /* game ended in character's death */
3131 p = "
\8e\80\82ñ
\82Å
\82¢
\82é";
3132 switch (u.umortality) {
3134 impossible("dead without dying?");
3136 break; /* just "are dead" */
3139 Sprintf(buf, " (%d%s time!)", u.umortality,
3140 ordin(u.umortality));
3142 Sprintf(buf, "(%d
\89ñ
\81I)", u.umortality);
3149 enl_msg(You_, "have been killed ", p, buf, "");
3151 enl_msg(You_, "
\8e\80\82ñ
\82Å
\82¢
\82é", p, buf, "");
3155 #if 0 /* no longer used */
3156 STATIC_DCL boolean NDECL(minimal_enlightenment);
3159 * Courtesy function for non-debug, non-explorer mode players
3160 * to help refresh them about who/what they are.
3161 * Returns FALSE if menu cancelled (dismissed with ESC), TRUE otherwise.
3164 minimal_enlightenment()
3167 menu_item *selected;
3170 char buf[BUFSZ], buf2[BUFSZ];
3171 static const char untabbed_fmtstr[] = "%-15s: %-12s";
3172 static const char untabbed_deity_fmtstr[] = "%-17s%s";
3173 static const char tabbed_fmtstr[] = "%s:\t%-12s";
3174 static const char tabbed_deity_fmtstr[] = "%s\t%s";
3175 static const char *fmtstr;
3176 static const char *deity_fmtstr;
3178 fmtstr = iflags.menu_tab_sep ? tabbed_fmtstr : untabbed_fmtstr;
3179 deity_fmtstr = iflags.menu_tab_sep ? tabbed_deity_fmtstr
3180 : untabbed_deity_fmtstr;
3182 buf[0] = buf2[0] = '\0';
3183 tmpwin = create_nhwindow(NHW_MENU);
3185 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, iflags.menu_headings,
3191 /* Starting name, race, role, gender */
3193 Sprintf(buf, fmtstr, "name", plname);
3195 Sprintf(buf, fmtstr, "
\96¼
\91O", plname);
3196 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
3198 Sprintf(buf, fmtstr, "race", urace.noun);
3200 Sprintf(buf, fmtstr, "
\8eí
\91°", urace.noun);
3201 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
3203 Sprintf(buf, fmtstr, "role",
3205 Sprintf(buf, fmtstr, "
\90E
\8bÆ",
3206 (flags.initgend && urole.name.f) ? urole.name.f : urole.name.m);
3207 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
3209 Sprintf(buf, fmtstr, "gender", genders[flags.initgend].adj);
3211 Sprintf(buf, fmtstr, "
\90«
\95Ê", genders[flags.initgend].adj);
3212 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
3214 /* Starting alignment */
3216 Sprintf(buf, fmtstr, "alignment", align_str(u.ualignbase[A_ORIGINAL]));
3218 Sprintf(buf, fmtstr, "
\91®
\90«", align_str(u.ualignbase[A_ORIGINAL]));
3219 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
3221 /* Current name, race, role, gender */
3222 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "", FALSE);
3223 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, iflags.menu_headings,
3229 Sprintf(buf, fmtstr, "race", Upolyd ? youmonst.data->mname : urace.noun);
3231 Sprintf(buf, fmtstr, "
\8eí
\91°", Upolyd ? youmonst.data->mname : urace.noun);
3232 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
3235 Sprintf(buf, fmtstr, "role (base)",
3237 Sprintf(buf, fmtstr, "
\90E
\8bÆ(
\8aî
\96{)",
3238 (u.mfemale && urole.name.f) ? urole.name.f
3240 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
3243 Sprintf(buf, fmtstr, "role",
3245 Sprintf(buf, fmtstr, "
\90E
\8bÆ",
3246 (flags.female && urole.name.f) ? urole.name.f
3248 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
3250 /* don't want poly_gender() here; it forces `2' for non-humanoids */
3251 genidx = is_neuter(youmonst.data) ? 2 : flags.female;
3253 Sprintf(buf, fmtstr, "gender", genders[genidx].adj);
3255 Sprintf(buf, fmtstr, "
\90«
\95Ê", genders[genidx].adj);
3256 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
3257 if (Upolyd && (int) u.mfemale != genidx) {
3259 Sprintf(buf, fmtstr, "gender (base)", genders[u.mfemale].adj);
3261 Sprintf(buf, fmtstr, "
\90«
\95Ê(
\8aî
\96{)", genders[u.mfemale].adj);
3262 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
3265 /* Current alignment */
3267 Sprintf(buf, fmtstr, "alignment", align_str(u.ualign.type));
3269 Sprintf(buf, fmtstr, "
\91®
\90«", align_str(u.ualign.type));
3270 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
3273 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "", FALSE);
3274 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, iflags.menu_headings,
3280 Sprintf(buf2, deity_fmtstr, align_gname(A_CHAOTIC),
3281 (u.ualignbase[A_ORIGINAL] == u.ualign.type
3282 && u.ualign.type == A_CHAOTIC) ? " (s,c)"
3283 : (u.ualignbase[A_ORIGINAL] == A_CHAOTIC) ? " (s)"
3284 : (u.ualign.type == A_CHAOTIC) ? " (c)" : "");
3286 Sprintf(buf2, deity_fmtstr, align_gname(A_CHAOTIC),
3287 (u.ualignbase[A_ORIGINAL] == u.ualign.type
3288 && u.ualign.type == A_CHAOTIC) ? " (
\8f\89\81C
\8c»)"
3289 : (u.ualignbase[A_ORIGINAL] == A_CHAOTIC) ? " (
\8f\89)"
3290 : (u.ualign.type == A_CHAOTIC) ? " (
\8c»)" : "");
3293 Sprintf(buf, fmtstr, "Chaotic", buf2);
3295 Sprintf(buf, fmtstr, "
\8d¬
\93×", buf2);
3296 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
3299 Sprintf(buf2, deity_fmtstr, align_gname(A_NEUTRAL),
3300 (u.ualignbase[A_ORIGINAL] == u.ualign.type
3301 && u.ualign.type == A_NEUTRAL) ? " (s,c)"
3302 : (u.ualignbase[A_ORIGINAL] == A_NEUTRAL) ? " (s)"
3303 : (u.ualign.type == A_NEUTRAL) ? " (c)" : "");
3305 Sprintf(buf2, deity_fmtstr, align_gname(A_NEUTRAL),
3306 (u.ualignbase[A_ORIGINAL] == u.ualign.type
3307 && u.ualign.type == A_NEUTRAL) ? " (
\8f\89\81C
\8c»)"
3308 : (u.ualignbase[A_ORIGINAL] == A_NEUTRAL) ? " (
\8f\89)"
3309 : (u.ualign.type == A_NEUTRAL) ? " (
\8c»)" : "");
3312 Sprintf(buf, fmtstr, "Neutral", buf2);
3314 Sprintf(buf, fmtstr, "
\92\86\97§", buf2);
3315 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
3318 Sprintf(buf2, deity_fmtstr, align_gname(A_LAWFUL),
3319 (u.ualignbase[A_ORIGINAL] == u.ualign.type
3320 && u.ualign.type == A_LAWFUL) ? " (s,c)"
3321 : (u.ualignbase[A_ORIGINAL] == A_LAWFUL) ? " (s)"
3322 : (u.ualign.type == A_LAWFUL) ? " (c)" : "");
3324 Sprintf(buf2, deity_fmtstr, align_gname(A_LAWFUL),
3325 (u.ualignbase[A_ORIGINAL] == u.ualign.type
3326 && u.ualign.type == A_LAWFUL) ? " (
\8f\89\81C
\8c»)"
3327 : (u.ualignbase[A_ORIGINAL] == A_LAWFUL) ? " (
\8f\89)"
3328 : (u.ualign.type == A_LAWFUL) ? " (
\8c»)" : "");
3331 Sprintf(buf, fmtstr, "Lawful", buf2);
3333 Sprintf(buf, fmtstr, "
\92\81\8f\98", buf2);
3334 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
3337 end_menu(tmpwin, "Base Attributes");
3339 end_menu(tmpwin, "
\8aî
\96{
\91®
\90«");
3340 n = select_menu(tmpwin, PICK_NONE, &selected);
3341 destroy_nhwindow(tmpwin);
3342 return (boolean) (n != -1);
3348 doattributes(VOID_ARGS)
3350 int mode = BASICENLIGHTENMENT;
3352 /* show more--as if final disclosure--for wizard and explore modes */
3353 if (wizard || discover)
3354 mode |= MAGICENLIGHTENMENT;
3356 enlightenment(mode, ENL_GAMEINPROGRESS);
3361 youhiding(via_enlghtmt, msgflag)
3362 boolean via_enlghtmt; /* englightment line vs topl message */
3363 int msgflag; /* for variant message phrasing */
3365 char *bp, buf[BUFSZ];
3368 Strcpy(buf, "hiding");
3370 Strcpy(buf, "
\89B
\82ê");
3371 if (youmonst.m_ap_type != M_AP_NOTHING) {
3372 /* mimic; hero is only able to mimic a strange object or gold
3373 or hallucinatory alternative to gold, so we skip the details
3374 for the hypothetical furniture and monster cases */
3375 #if 0 /*JP*//*
\8cã
\82ë
\82É
\89ñ
\82·*/
3376 bp = eos(strcpy(buf, "mimicking"));
3378 if (youmonst.m_ap_type == M_AP_OBJECT) {
3380 Sprintf(bp, " %s", an(simple_typename(youmonst.mappearance)));
3382 Strcpy(buf, simple_typename(youmonst.mappearance));
3383 } else if (youmonst.m_ap_type == M_AP_FURNITURE) {
3385 Strcpy(bp, " something");
3387 Strcpy(buf, "
\89½
\82©");
3388 } else if (youmonst.m_ap_type == M_AP_MONSTER) {
3390 Strcpy(bp, " someone");
3392 Strcpy(buf, "
\89½
\8eÒ
\82©");
3394 ; /* something unexpected; leave 'buf' as-is */
3396 #if 1 /*JP*//*
\82±
\82±
\82Å
\92Ç
\89Á*/
3397 Strcat(buf, "
\82Ì
\82Ó
\82è
\82ð
\82µ");
3399 } else if (u.uundetected) {
3400 bp = eos(buf); /* points past "hiding" */
3401 if (youmonst.data->mlet == S_EEL) {
3402 if (is_pool(u.ux, u.uy))
3404 Sprintf(bp, " in the %s", waterbody_name(u.ux, u.uy));
3406 Sprintf(bp, "%s
\82Ì
\92\86\82É", waterbody_name(u.ux, u.uy));
3407 } else if (hides_under(youmonst.data)) {
3408 struct obj *o = level.objects[u.ux][u.uy];
3412 Sprintf(bp, " underneath %s", ansimpleoname(o));
3414 Sprintf(bp, "%s
\82Ì
\89º
\82É", ansimpleoname(o));
3415 } else if (is_clinger(youmonst.data) || Flying) {
3416 /* Flying: 'lurker above' hides on ceiling but doesn't cling */
3418 Sprintf(bp, " on the %s", ceiling(u.ux, u.uy));
3420 Sprintf(bp, "%s
\82É", ceiling(u.ux, u.uy));
3422 /* on floor; is_hider() but otherwise not special: 'trapper' */
3423 if (u.utrap && u.utraptype == TT_PIT) {
3424 struct trap *t = t_at(u.ux, u.uy);
3427 Sprintf(bp, " in a %spit",
3428 (t && t->ttyp == SPIKED_PIT) ? "spiked " : "");
3430 Sprintf(bp, "%s
\97\8e\82µ
\8c\8a\82Ì
\92\86\82É",
3431 (t && t->ttyp == SPIKED_PIT) ? "
\83g
\83Q
\82¾
\82ç
\82¯
\82Ì" : "");
3435 Sprintf(bp, " on the %s", surface(u.ux, u.uy));
3437 Sprintf(bp, "%s
\82É", surface(u.ux, u.uy));
3439 #if 1 /*JP*//*
\82±
\82±
\82Å
\92Ç
\89Á*/
3440 Strcat(buf, "
\89B
\82ê");
3443 ; /* shouldn't happen; will result in generic "you are hiding" */
3447 int final = msgflag; /* 'final' is used by you_are() macro */
3452 enl_msg(buf, "
\82Ä
\82¢
\82é", "
\82Ä
\82¢
\82½", "", "");
3454 /* for dohide(), when player uses '#monster' command */
3456 You("are %s %s.", msgflag ? "already" : "now", buf);
3459 You("
\82·
\82Å
\82É%s
\82Ä
\82¢
\82é
\81D", buf);
3461 You("%s
\82½
\81D", buf);
3468 * (shares enlightenment's tense handling)
3471 doconduct(VOID_ARGS)
3484 /* Create the conduct window */
3485 en_win = create_nhwindow(NHW_MENU);
3487 putstr(en_win, 0, "Voluntary challenges:");
3489 putstr(en_win, 0, "
\8e©
\94
\93I
\92§
\90í:");
3491 if (u.uroleplay.blind)
3493 you_have_been("blind from birth");
3495 you_have_been("
\90¶
\82Ü
\82ê
\82È
\82ª
\82ç
\82É
\96Ó
\96Ú");
3496 if (u.uroleplay.nudist)
3498 you_have_been("faithfully nudist");
3500 you_have_been("
\92\89\8eÀ
\82È
\97\87\91°");
3502 if (!u.uconduct.food)
3504 enl_msg(You_, "have gone", "went", " without food", "");
3506 enl_msg("
\82 \82È
\82½
\82Í
\90H
\8e\96\82ð
\82µ", "
\82Ä
\82¢
\82È
\82¢", "
\82È
\82©
\82Á
\82½", "", "");
3507 /* But beverages are okay */
3508 else if (!u.uconduct.unvegan)
3510 you_have_X("followed a strict vegan diet");
3512 you_have_been("
\8cµ
\8ai
\82È
\8dØ
\90H
\8eå
\8b`
\8eÒ");
3513 else if (!u.uconduct.unvegetarian)
3515 you_have_been("vegetarian");
3517 you_have_been("
\8dØ
\90H
\8eå
\8b`
\8eÒ");
3519 if (!u.uconduct.gnostic)
3521 you_have_been("an atheist");
3523 you_have_been("
\96³
\90_
\98_
\8eÒ");
3525 if (!u.uconduct.weaphit) {
3527 you_have_never("hit with a wielded weapon");
3529 you_have_never("
\82 \82È
\82½
\82Í
\91\95\94õ
\82µ
\82Ä
\82¢
\82é
\95\90\8aí
\82Å
\8dU
\8c\82\82µ");
3530 } else if (wizard) {
3532 Sprintf(buf, "used a wielded weapon %ld time%s", u.uconduct.weaphit,
3533 plur(u.uconduct.weaphit));
3536 Sprintf(buf, "
\82 \82È
\82½
\82Í%ld
\89ñ
\91\95\94õ
\82µ
\82½
\95\90\8aí
\82ð
\8eg
\97p
\82µ", u.uconduct.weaphit);
3540 if (!u.uconduct.killer)
3542 you_have_been("a pacifist");
3544 you_have_been("
\95½
\98a
\8eå
\8b`
\8eÒ");
3546 if (!u.uconduct.literate) {
3548 you_have_been("illiterate");
3550 you_have_never("
\82 \82È
\82½
\82Í
\93Ç
\82Ý
\8f\91\82«
\82µ");
3551 } else if (wizard) {
3553 Sprintf(buf, "read items or engraved %ld time%s", u.uconduct.literate,
3554 plur(u.uconduct.literate));
3557 Sprintf(buf, "%ld
\89ñ
\93Ç
\82ñ
\82¾
\82è
\8f\91\82¢
\82½
\82è
\82µ", u.uconduct.literate);
3562 ngenocided = num_genocides();
3563 if (ngenocided == 0) {
3565 you_have_never("genocided any monsters");
3567 you_have_never("
\82 \82È
\82½
\82Í
\89ö
\95¨
\82ð
\8bs
\8eE
\82µ");
3570 Sprintf(buf, "genocided %d type%s of monster%s", ngenocided,
3571 plur(ngenocided), plur(ngenocided));
3574 Sprintf(buf, "%d
\8eí
\82Ì
\89ö
\95¨
\82ð
\8bs
\8eE
\82µ", ngenocided);
3579 if (!u.uconduct.polypiles) {
3581 you_have_never("polymorphed an object");
3583 you_have_never("
\82 \82È
\82½
\82Í
\95¨
\91Ì
\82ð
\95Ï
\89»
\82³
\82¹");
3584 } else if (wizard) {
3586 Sprintf(buf, "polymorphed %ld item%s", u.uconduct.polypiles,
3587 plur(u.uconduct.polypiles));
3590 Sprintf(buf, "%ld
\8cÂ
\82Ì
\93¹
\8bï
\82ð
\95Ï
\89»
\82³
\82¹", u.uconduct.polypiles);
3595 if (!u.uconduct.polyselfs) {
3597 you_have_never("changed form");
3599 you_have_never("
\82 \82È
\82½
\82Í
\95Ï
\89»
\82µ");
3600 } else if (wizard) {
3602 Sprintf(buf, "changed form %ld time%s", u.uconduct.polyselfs,
3603 plur(u.uconduct.polyselfs));
3606 Sprintf(buf, "%ld
\89ñ
\8ep
\82ð
\95Ï
\82¦", u.uconduct.polyselfs);
3611 if (!u.uconduct.wishes) {
3613 you_have_X("used no wishes");
3615 you_have_never("
\82 \82È
\82½
\82Í
\8aè
\82¢
\8e\96\82ð
\82µ");
3618 Sprintf(buf, "used %ld wish%s", u.uconduct.wishes,
3619 (u.uconduct.wishes > 1L) ? "es" : "");
3622 Sprintf(buf, "%ld
\89ñ
\8aè
\82¢
\8e\96\82ð
\82µ", u.uconduct.wishes);
3626 if (!u.uconduct.wisharti)
3628 enl_msg(You_, "have not wished", "did not wish",
3629 " for any artifacts", "");
3631 enl_msg("
\82 \82È
\82½
\82Í
\90¹
\8aí
\82ð
\8aè", "
\82Á
\82Ä
\82¢
\82È
\82¢", "
\82í
\82È
\82©
\82Á
\82½", "", "");
3635 /* Pop up the window and wait for a key */
3636 display_nhwindow(en_win, TRUE);
3637 destroy_nhwindow(en_win);
3643 #define M(c) (0x80 | (c))
3645 #define M(c) ((c) -128)
3649 #define C(c) (0x1f & (c))
3652 static const struct func_tab cmdlist[] = {
3653 { C('d'), FALSE, dokick }, /* "D" is for door!...? Msg is in dokick.c */
3654 { C('e'), TRUE, wiz_detect },
3655 { C('f'), TRUE, wiz_map },
3656 { C('g'), TRUE, wiz_genesis },
3657 { C('i'), TRUE, wiz_identify },
3658 { C('l'), TRUE, doredraw }, /* if number_pad is set */
3659 { C('n'), TRUE, donamelevel }, /* if number_pad is set */
3660 { C('o'), TRUE, dooverview_or_wiz_where }, /* depends on wizard status */
3661 { C('p'), TRUE, doprev_message },
3662 { C('r'), TRUE, doredraw },
3663 { C('t'), TRUE, dotele },
3664 { C('v'), TRUE, wiz_level_tele },
3665 { C('w'), TRUE, wiz_wish },
3666 { C('x'), TRUE, doattributes },
3667 { C('z'), TRUE, dosuspend_core },
3668 { 'a', FALSE, doapply },
3669 { 'A', FALSE, doddoremarm },
3670 { M('a'), TRUE, doorganize },
3671 { M('A'), TRUE, donamelevel }, /* #annotate */
3672 /* 'b', 'B' : go sw */
3673 { 'c', FALSE, doclose },
3674 { 'C', TRUE, docallcmd },
3675 { M('c'), TRUE, dotalk },
3676 { M('C'), TRUE, doconduct }, /* #conduct */
3677 { 'd', FALSE, dodrop },
3678 { 'D', FALSE, doddrop },
3679 { M('d'), FALSE, dodip },
3680 { 'e', FALSE, doeat },
3681 { 'E', FALSE, doengrave },
3682 { M('e'), TRUE, enhance_weapon_skill },
3683 { 'f', FALSE, dofire },
3684 /* 'F' : fight (one time) */
3685 { M('f'), FALSE, doforce },
3686 /* 'g', 'G' : multiple go */
3687 /* 'h', 'H' : go west */
3688 { 'h', TRUE, dohelp }, /* if number_pad is set */
3689 { 'i', TRUE, ddoinv },
3690 { 'I', TRUE, dotypeinv }, /* Robert Viduya */
3691 { M('i'), TRUE, doinvoke },
3692 /* 'j', 'J', 'k', 'K', 'l', 'L', 'm', 'M', 'n', 'N' : move commands */
3693 { 'j', FALSE, dojump }, /* if number_pad is on */
3694 { M('j'), FALSE, dojump },
3695 { 'k', FALSE, dokick }, /* if number_pad is on */
3696 { 'l', FALSE, doloot }, /* if number_pad is on */
3697 { M('l'), FALSE, doloot },
3698 /* 'n' prefixes a count if number_pad is on */
3699 { M('m'), TRUE, domonability },
3700 { 'N', TRUE, docallcmd }, /* if number_pad is on */
3701 { M('n'), TRUE, docallcmd },
3702 { M('N'), TRUE, docallcmd },
3703 { 'o', FALSE, doopen },
3704 { 'O', TRUE, doset },
3705 { M('o'), FALSE, dosacrifice },
3706 { M('O'), TRUE, dooverview }, /* #overview */
3707 { 'p', FALSE, dopay },
3708 { 'P', FALSE, doputon },
3709 { M('p'), TRUE, dopray },
3710 { 'q', FALSE, dodrink },
3711 { 'Q', FALSE, dowieldquiver },
3712 { M('q'), TRUE, done2 },
3713 { 'r', FALSE, doread },
3714 { 'R', FALSE, doremring },
3715 { M('r'), FALSE, dorub },
3716 { M('R'), FALSE, doride }, /* #ride */
3718 { 's', TRUE, dosearch, "searching" },
3720 { 's', TRUE, dosearch, "
\91{
\82·" },
3721 { 'S', TRUE, dosave },
3722 { M('s'), FALSE, dosit },
3723 { 't', FALSE, dothrow },
3724 { 'T', FALSE, dotakeoff },
3725 { M('t'), TRUE, doturn },
3726 { M('T'), FALSE, dotip }, /* #tip */
3727 /* 'u', 'U' : go ne */
3728 { 'u', FALSE, dountrap }, /* if number_pad is on */
3729 { M('u'), FALSE, dountrap },
3730 { 'v', TRUE, doversion },
3731 { 'V', TRUE, dohistory },
3732 { M('v'), TRUE, doextversion },
3733 { 'w', FALSE, dowield },
3734 { 'W', FALSE, dowear },
3735 { M('w'), FALSE, dowipe },
3736 { 'x', FALSE, doswapweapon },
3737 { 'X', FALSE, dotwoweapon },
3738 /* 'y', 'Y' : go nw */
3739 { 'z', FALSE, dozap },
3740 { 'Z', TRUE, docast },
3741 { '<', FALSE, doup },
3742 { '>', FALSE, dodown },
3743 { '/', TRUE, dowhatis },
3744 { '&', TRUE, dowhatdoes },
3745 { '?', TRUE, dohelp },
3746 { M('?'), TRUE, doextlist },
3748 { '!', TRUE, dosh },
3751 { '.', TRUE, donull, "waiting" },
3753 { '.', TRUE, donull, "
\8bx
\8ce
\82·
\82é" },
3755 { ' ', TRUE, donull, "waiting" },
3757 { ' ', TRUE, donull, "
\8bx
\8ce
\82·
\82é" },
3758 { ',', FALSE, dopickup },
3759 { ':', TRUE, dolook },
3760 { ';', TRUE, doquickwhatis },
3761 { '^', TRUE, doidtrap },
3762 { '\\', TRUE, dodiscovered }, /* Robert Viduya */
3763 { '`', TRUE, doclassdisco },
3764 { '@', TRUE, dotogglepickup },
3765 { M('2'), FALSE, dotwoweapon },
3766 { WEAPON_SYM, TRUE, doprwep },
3767 { ARMOR_SYM, TRUE, doprarm },
3768 { RING_SYM, TRUE, doprring },
3769 { AMULET_SYM, TRUE, dopramulet },
3770 { TOOL_SYM, TRUE, doprtool },
3771 { '*', TRUE, doprinuse }, /* inventory of all equipment in use */
3772 { GOLD_SYM, TRUE, doprgold },
3773 { SPBOOK_SYM, TRUE, dovspell }, /* Mike Stephenson */
3774 { '#', TRUE, doextcmd },
3775 { '_', TRUE, dotravel },
3779 struct ext_func_tab extcmdlist[] = {
3781 { "adjust", "adjust inventory letters", doorganize, TRUE },
3783 { "adjust", "
\8e\9d\82¿
\95¨
\88ê
\97\97\82Ì
\92²
\90®", doorganize, TRUE },
3785 { "annotate", "name current level", donamelevel, TRUE },
3787 { "annotate", "
\8c»
\8dÝ
\82Ì
\8aK
\82É
\96¼
\91O
\82ð
\82Â
\82¯
\82é", donamelevel, TRUE },
3789 { "chat", "talk to someone", dotalk, TRUE }, /* converse? */
3791 { "chat", "
\92N
\82©
\82Æ
\98b
\82·", dotalk, TRUE }, /* converse? */
3794 { "conduct", "list voluntary challenges you have maintained", doconduct,
3797 { "conduct", "
\82Ç
\82¤
\82¢
\82¤
\8ds
\93®
\82ð
\82Æ
\82Á
\82½
\82©
\8c©
\82é", doconduct, TRUE },
3800 { "dip", "dip an object into something", dodip, FALSE },
3802 { "dip", "
\89½
\82©
\82É
\95¨
\82ð
\90Z
\82·", dodip, FALSE },
3804 { "enhance", "advance or check weapon and spell skills",
3805 enhance_weapon_skill, TRUE },
3807 { "enhance", "
\95\90\8aí
\8fn
\97û
\93x
\82ð
\8d\82\82ß
\82é", enhance_weapon_skill, TRUE },
3810 { "exploremode", "enter explore mode", enter_explore_mode, TRUE },
3812 { "exploremode", "
\92T
\8c\9f\83\82\81[
\83h
\82É
\93ü
\82é", enter_explore_mode, TRUE },
3814 { "force", "force a lock", doforce, FALSE },
3816 { "force", "
\8c®
\82ð
\82±
\82¶
\82 \82¯
\82é", doforce, FALSE },
3818 { "invoke", "invoke an object's powers", doinvoke, TRUE },
3820 { "invoke", "
\95¨
\82Ì
\93Á
\95Ê
\82È
\97Í
\82ð
\8eg
\82¤", doinvoke, TRUE },
3822 { "jump", "jump to a location", dojump, FALSE },
3824 { "jump", "
\91¼
\82Ì
\88Ê
\92u
\82É
\94ò
\82Ñ
\82¤
\82Â
\82é", dojump, FALSE },
3826 { "loot", "loot a box on the floor", doloot, FALSE },
3828 { "loot", "
\8f°
\82Ì
\8fã
\82Ì
\94 \82ð
\8aJ
\82¯
\82é", doloot, TRUE },
3830 { "monster", "use a monster's special ability", domonability, TRUE },
3832 { "monster", "
\89ö
\95¨
\82Ì
\93Á
\95Ê
\94\
\97Í
\82ð
\8eg
\82¤", domonability, TRUE },
3834 { "name", "name a monster or an object", docallcmd, TRUE },
3836 { "name", "
\83A
\83C
\83e
\83\80\82â
\95¨
\82É
\96¼
\91O
\82ð
\82Â
\82¯
\82é", docallcmd, TRUE },
3838 { "offer", "offer a sacrifice to the gods", dosacrifice, FALSE },
3840 { "offer", "
\90_
\82É
\8b\9f\95¨
\82ð
\95ù
\82°
\82é", dosacrifice, FALSE },
3842 { "overview", "show an overview of the dungeon", dooverview, TRUE },
3844 { "overview", "
\96À
\8b{
\82Ì
\8aT
\97v
\82ð
\95\
\8e¦
\82·
\82é", dooverview, TRUE },
3846 { "pray", "pray to the gods for help", dopray, TRUE },
3848 { "pray", "
\90_
\82É
\8bF
\82é", dopray, TRUE },
3850 { "quit", "exit without saving current game", done2, TRUE },
3852 { "quit", "
\83Z
\81[
\83u
\82µ
\82È
\82¢
\82Å
\8fI
\97¹", done2, TRUE },
3854 { "ride", "ride (or stop riding) a monster", doride, FALSE },
3856 { "ride", "
\89ö
\95¨
\82É
\8fæ
\82é(
\82Ü
\82½
\82Í
\8d~
\82è
\82é)", doride, FALSE },
3858 { "rub", "rub a lamp or a stone", dorub, FALSE },
3860 { "rub", "
\83\89\83\93\83v
\82ð
\82±
\82·
\82é", dorub, FALSE },
3862 { "sit", "sit down", dosit, FALSE },
3864 { "sit", "
\8dÀ
\82é", dosit, FALSE },
3866 { "terrain", "show map without obstructions", doterrain, TRUE },
3868 { "terrain", "
\8e×
\96\82\82³
\82ê
\82¸
\82É
\92n
\90}
\82ð
\8c©
\82é", doterrain, TRUE },
3870 { "tip", "empty a container", dotip, FALSE },
3872 { "tip", "
\93ü
\82ê
\95¨
\82ð
\8bó
\82É
\82·
\82é", dotip, FALSE },
3874 { "turn", "turn undead", doturn, TRUE },
3876 { "turn", "
\83A
\83\93\83f
\83b
\83g
\82ð
\93y
\82É
\95Ô
\82·", doturn, TRUE },
3878 { "twoweapon", "toggle two-weapon combat", dotwoweapon, FALSE },
3880 { "twoweapon", "
\97¼
\8eè
\8e\9d\82¿
\82Ì
\90Ø
\82è
\91Ö
\82¦", dotwoweapon, FALSE },
3882 { "untrap", "untrap something", dountrap, FALSE },
3884 { "untrap", "ã©
\82ð
\82Í
\82¸
\82·", dountrap, FALSE },
3886 { "version", "list compile time options for this version of NetHack",
3887 doextversion, TRUE },
3889 { "version", "
\83R
\83\93\83p
\83C
\83\8b\8e\9e\82Ì
\83I
\83v
\83V
\83\87\83\93\82ð
\95\
\8e¦
\82·
\82é", doextversion, TRUE },
3892 { "wipe", "wipe off your face", dowipe, FALSE },
3894 { "wipe", "
\8aç
\82ð
\90@
\82¤", dowipe, FALSE },
3896 { "?", "get this list of extended commands", doextlist, TRUE },
3898 { "?", "
\82±
\82Ì
\8ag
\92£
\83R
\83}
\83\93\83h
\88ê
\97\97\82ð
\95\
\8e¦
\82·
\82é", doextlist, TRUE },
3900 * There must be a blank entry here for every entry in the table
3903 { (char *) 0, (char *) 0, donull, TRUE }, /* levelchange */
3904 { (char *) 0, (char *) 0, donull, TRUE }, /* lightsources */
3905 #ifdef DEBUG_MIGRATING_MONS
3906 { (char *) 0, (char *) 0, donull, TRUE }, /* migratemons */
3908 { (char *) 0, (char *) 0, donull, TRUE }, /* monpolycontrol */
3909 { (char *) 0, (char *) 0, donull, TRUE }, /* panic */
3910 { (char *) 0, (char *) 0, donull, TRUE }, /* polyself */
3912 { (char *) 0, (char *) 0, donull, TRUE }, /* portdebug */
3914 { (char *) 0, (char *) 0, donull, TRUE }, /* seenv */
3915 { (char *) 0, (char *) 0, donull, TRUE }, /* stats */
3916 { (char *) 0, (char *) 0, donull, TRUE }, /* timeout */
3917 { (char *) 0, (char *) 0, donull, TRUE }, /* vanquished */
3918 { (char *) 0, (char *) 0, donull, TRUE }, /* vision */
3919 { (char *) 0, (char *) 0, donull, TRUE }, /* wizsmell */
3921 { (char *) 0, (char *) 0, donull, TRUE }, /* wizdebug_traveldisplay */
3922 { (char *) 0, (char *) 0, donull, TRUE }, /* wizdebug_bury */
3924 { (char *) 0, (char *) 0, donull, TRUE }, /* wizrumorcheck */
3925 { (char *) 0, (char *) 0, donull, TRUE }, /* wmode */
3926 { (char *) 0, (char *) 0, donull, TRUE } /* sentinel */
3929 /* there must be a placeholder in the table above for every entry here */
3930 static const struct ext_func_tab debug_extcmdlist[] = {
3932 { "levelchange", "change experience level", wiz_level_change, TRUE },
3934 { "levelchange", "
\8co
\8c±
\83\8c\83x
\83\8b\82ð
\95Ï
\82¦
\82é", wiz_level_change, TRUE},
3936 { "lightsources", "show mobile light sources", wiz_light_sources, TRUE },
3938 { "light sources", "
\88Ú
\93®
\8cõ
\8c¹
\82ð
\8c©
\82é", wiz_light_sources, TRUE},
3939 #ifdef DEBUG_MIGRATING_MONS
3941 { "migratemons", "migrate n random monsters", wiz_migrate_mons, TRUE },
3943 { "migratemons", "
\83\89\83\93\83_
\83\80\82È
\89ö
\95¨
\82ð
\89½
\91Ì
\82©
\88Ú
\8fZ
\82³
\82¹
\82é", wiz_migrate_mons, TRUE },
3946 { "monpolycontrol", "control monster polymorphs", wiz_mon_polycontrol,
3948 { "monpoly_control", "
\89ö
\95¨
\82Ö
\82Ì
\95Ï
\89»
\82ð
\90§
\8cä
\82·
\82é", wiz_mon_polycontrol,
3951 { "panic", "test panic routine (fatal to game)", wiz_panic, TRUE },
3953 { "panic", "
\83p
\83j
\83b
\83N
\83\8b\81[
\83`
\83\93\82ð
\83e
\83X
\83g
\82·
\82é(
\92v
\96½
\93I)", wiz_panic, TRUE},
3955 { "polyself", "polymorph self", wiz_polyself, TRUE },
3957 { "polyself", "
\95Ï
\89»
\82·
\82é", wiz_polyself, TRUE},
3960 { "portdebug", "wizard port debug command", wiz_port_debug, TRUE },
3962 { "portdebug", "
\83E
\83B
\83U
\81[
\83h
\83|
\81[
\83g
\83f
\83o
\83b
\83O
\83R
\83}
\83\93\83h", wiz_port_debug, TRUE },
3965 { "seenv", "show seen vectors", wiz_show_seenv, TRUE },
3967 { "seenv", "
\8e\8b\90ü
\83x
\83N
\83g
\83\8b\82ð
\8c©
\82é", wiz_show_seenv, TRUE},
3969 { "stats", "show memory statistics", wiz_show_stats, TRUE },
3971 { "stats", "
\83\81\83\82\83\8a\8fó
\91Ô
\82ð
\8c©
\82é", wiz_show_stats, TRUE},
3973 { "timeout", "look at timeout queue", wiz_timeout_queue, TRUE },
3975 { "timeout", "
\8e\9e\8aÔ
\90Ø
\82ê
\83L
\83\85\81[
\82ð
\8c©
\82é", wiz_timeout_queue, TRUE},
3977 { "vanquished", "list vanquished monsters", dovanquished, TRUE },
3979 { "vanquished", "
\93|
\82µ
\82½
\89ö
\95¨
\82Ì
\88ê
\97\97\82ð
\8c©
\82é", dovanquished, TRUE },
3981 { "vision", "show vision array", wiz_show_vision, TRUE },
3983 { "vision", "
\8e\8b\8aE
\94z
\97ñ
\82ð
\8c©
\82é", wiz_show_vision, TRUE},
3985 { "wizsmell", "smell monster", wiz_smell, TRUE },
3987 { "wizsmell", "
\89ö
\95¨
\82Ì
\93õ
\82¢
\82ð
\9ak
\82®", wiz_smell, TRUE },
3990 { "wizdebug_traveldisplay", "wizard debug: toggle travel display",
3992 { "wizdebug_traveldisplay", "
\83E
\83B
\83U
\81[
\83h
\83f
\83o
\83b
\83O:
\88Ú
\93®
\95\
\8e¦
\82ð
\90Ø
\82è
\91Ö
\82¦
\82é",
3993 wiz_debug_cmd_traveldisplay, TRUE },
3995 { "wizdebug_bury", "wizard debug: bury objs under and around you",
3997 { "wizdebug_bury", "
\83E
\83B
\83U
\81[
\83h
\82Å
\83o
\83b
\83O:
\95¨
\82ð
\82 \82È
\82½
\82Ì
\8eü
\82è
\82É
\96\84\82ß
\82é",
3998 wiz_debug_cmd_bury, TRUE },
4001 { "wizrumorcheck", "verify rumor boundaries", wiz_rumor_check, TRUE },
4003 { "wizrumorcheck", "
\89\
\82Ì
\8b«
\8aE
\82ð
\8c\9f\8fØ
\82·
\82é", wiz_rumor_check, TRUE },
4005 { "wmode", "show wall modes", wiz_show_wmodes, TRUE },
4007 { "wmode", "
\95Ç
\83\82\81[
\83h
\82ð
\8c©
\82é", wiz_show_wmodes, TRUE},
4008 { (char *) 0, (char *) 0, donull, TRUE }
4012 * Insert debug commands into the extended command list. This function
4013 * assumes that the last entry will be the help entry.
4015 * You must add entries in ext_func_tab every time you add one to the
4016 * debug_extcmdlist().
4019 add_debug_extended_commands()
4023 /* count the # of help entries */
4024 for (n = 0; extcmdlist[n].ef_txt[0] != '?'; n++)
4027 for (i = 0; debug_extcmdlist[i].ef_txt; i++) {
4028 /* need enough room for "?" entry plus terminator */
4029 if (n + 2 >= SIZE(extcmdlist))
4030 panic("Too many debugging commands!");
4031 for (j = 0; j < n; j++)
4032 if (strcmp(debug_extcmdlist[i].ef_txt, extcmdlist[j].ef_txt) < 0)
4035 /* insert i'th debug entry into extcmdlist[j], pushing down */
4036 for (k = n; k >= j; --k)
4037 extcmdlist[k + 1] = extcmdlist[k];
4038 extcmdlist[j] = debug_extcmdlist[i];
4039 n++; /* now an extra entry */
4048 for (i = 0; i < SIZE(cmdlist); ++i)
4049 if (cmdlist[i].f_funct == fn)
4050 return cmdlist[i].f_char;
4054 static const char template[] = "%-18s %4ld %6ld";
4055 static const char count_str[] = " count bytes";
4056 static const char separator[] = "------------------ ----- ------";
4062 int sz = (int) sizeof(struct obj);
4065 sz += (int) sizeof(struct oextra);
4067 sz += (int) strlen(ONAME(otmp)) + 1;
4069 sz += (int) sizeof(struct monst);
4071 sz += (int) sizeof(unsigned);
4073 sz += (int) sizeof(long);
4075 sz += (int) strlen(OMAILCMD(otmp)) + 1;
4081 count_obj(chain, total_count, total_size, top, recurse)
4091 for (count = size = 0, obj = chain; obj; obj = obj->nobj) {
4094 size += size_obj(obj);
4096 if (recurse && obj->cobj)
4097 count_obj(obj->cobj, total_count, total_size, TRUE, TRUE);
4099 *total_count += count;
4100 *total_size += size;
4104 obj_chain(win, src, chain, total_count, total_size)
4112 long count = 0, size = 0;
4114 count_obj(chain, &count, &size, TRUE, FALSE);
4115 *total_count += count;
4116 *total_size += size;
4117 Sprintf(buf, template, src, count, size);
4118 putstr(win, 0, buf);
4122 mon_invent_chain(win, src, chain, total_count, total_size)
4125 struct monst *chain;
4130 long count = 0, size = 0;
4133 for (mon = chain; mon; mon = mon->nmon)
4134 count_obj(mon->minvent, &count, &size, TRUE, FALSE);
4135 *total_count += count;
4136 *total_size += size;
4137 Sprintf(buf, template, src, count, size);
4138 putstr(win, 0, buf);
4142 contained(win, src, total_count, total_size)
4149 long count = 0, size = 0;
4152 count_obj(invent, &count, &size, FALSE, TRUE);
4153 count_obj(fobj, &count, &size, FALSE, TRUE);
4154 count_obj(level.buriedobjlist, &count, &size, FALSE, TRUE);
4155 count_obj(migrating_objs, &count, &size, FALSE, TRUE);
4156 /* DEADMONSTER check not required in this loop since they have no
4158 for (mon = fmon; mon; mon = mon->nmon)
4159 count_obj(mon->minvent, &count, &size, FALSE, TRUE);
4160 for (mon = migrating_mons; mon; mon = mon->nmon)
4161 count_obj(mon->minvent, &count, &size, FALSE, TRUE);
4163 *total_count += count;
4164 *total_size += size;
4166 Sprintf(buf, template, src, count, size);
4167 putstr(win, 0, buf);
4174 int sz = (int) sizeof(struct monst);
4177 sz += (int) sizeof(struct mextra);
4179 sz += (int) strlen(MNAME(mtmp)) + 1;
4181 sz += (int) sizeof(struct egd);
4183 sz += (int) sizeof(struct epri);
4185 sz += (int) sizeof(struct eshk);
4187 sz += (int) sizeof(struct emin);
4189 sz += (int) sizeof(struct edog);
4190 /* mextra->mcorpsenm doesn't point to more memory */
4196 mon_chain(win, src, chain, total_count, total_size)
4199 struct monst *chain;
4207 for (count = size = 0, mon = chain; mon; mon = mon->nmon) {
4209 size += size_monst(mon);
4211 *total_count += count;
4212 *total_size += size;
4213 Sprintf(buf, template, src, count, size);
4214 putstr(win, 0, buf);
4218 * Display memory usage of all monsters and objects on the level.
4225 long total_obj_size = 0, total_obj_count = 0;
4226 long total_mon_size = 0, total_mon_count = 0;
4228 win = create_nhwindow(NHW_TEXT);
4229 putstr(win, 0, "Current memory statistics:");
4231 Sprintf(buf, "Objects, size %d", (int) sizeof(struct obj));
4232 putstr(win, 0, buf);
4234 putstr(win, 0, count_str);
4236 obj_chain(win, "invent", invent, &total_obj_count, &total_obj_size);
4237 obj_chain(win, "fobj", fobj, &total_obj_count, &total_obj_size);
4238 obj_chain(win, "buried", level.buriedobjlist, &total_obj_count,
4240 obj_chain(win, "migrating obj", migrating_objs, &total_obj_count,
4242 mon_invent_chain(win, "minvent", fmon, &total_obj_count, &total_obj_size);
4243 mon_invent_chain(win, "migrating minvent", migrating_mons,
4244 &total_obj_count, &total_obj_size);
4246 contained(win, "contained", &total_obj_count, &total_obj_size);
4248 putstr(win, 0, separator);
4249 Sprintf(buf, template, "Total", total_obj_count, total_obj_size);
4250 putstr(win, 0, buf);
4254 Sprintf(buf, "Monsters, size %d", (int) sizeof(struct monst));
4255 putstr(win, 0, buf);
4258 mon_chain(win, "fmon", fmon, &total_mon_count, &total_mon_size);
4259 mon_chain(win, "migrating", migrating_mons, &total_mon_count,
4262 putstr(win, 0, separator);
4263 Sprintf(buf, template, "Total", total_mon_count, total_mon_size);
4264 putstr(win, 0, buf);
4266 #if defined(__BORLANDC__) && !defined(_WIN32)
4267 show_borlandc_stats(win);
4270 display_nhwindow(win, FALSE);
4271 destroy_nhwindow(win);
4279 timer_sanity_check();
4281 light_sources_sanity_check();
4284 #ifdef DEBUG_MIGRATING_MONS
4290 struct permonst *ptr;
4294 getlin("How many random monsters to migrate? [0]", inbuf);
4295 if (*inbuf == '\033')
4297 mcount = atoi(inbuf);
4298 if (mcount < 0 || mcount > (COLNO * ROWNO) || Is_botlevel(&u.uz))
4300 while (mcount > 0) {
4301 if (Is_stronghold(&u.uz))
4302 assign_level(&tolevel, &valley_level);
4304 get_level(&tolevel, depth(&u.uz) + 1);
4306 mtmp = makemon(ptr, 0, 0, NO_MM_FLAGS);
4308 migrate_to_level(mtmp, ledger_no(&tolevel), MIGR_RANDOM,
4316 #define unctrl(c) ((c) <= C('z') ? (0x60 | (c)) : (c))
4317 #define unmeta(c) (0x7f & (c))
4319 /* called at startup and after number_pad is twiddled */
4321 reset_commands(initial)
4324 static const char sdir[] = "hykulnjb><",
4325 sdir_swap_yz[] = "hzkulnjb><",
4326 ndir[] = "47896321><",
4327 ndir_phone_layout[] = "41236987><";
4328 static const int ylist[] = {
4329 'y', 'Y', C('y'), M('y'), M('Y'), M(C('y'))
4331 const struct func_tab *cmdtmp;
4333 int c, i, updated = 0;
4337 for (i = 0; i < SIZE(cmdlist); i++) {
4338 c = cmdlist[i].f_char & 0xff;
4339 Cmd.commands[c] = &cmdlist[i];
4341 Cmd.num_pad = FALSE;
4342 Cmd.pcHack_compat = Cmd.phone_layout = Cmd.swap_yz = FALSE;
4345 flagtemp = iflags.num_pad;
4346 if (flagtemp != Cmd.num_pad) {
4347 Cmd.num_pad = flagtemp;
4350 /* swap_yz mode (only applicable for !num_pad) */
4351 flagtemp = (iflags.num_pad_mode & 1) ? !Cmd.num_pad : FALSE;
4352 if (flagtemp != Cmd.swap_yz) {
4353 Cmd.swap_yz = flagtemp;
4355 /* Cmd.swap_yz has been toggled;
4356 perform the swap (or reverse previous one) */
4357 for (i = 0; i < SIZE(ylist); i++) {
4358 c = ylist[i] & 0xff;
4359 cmdtmp = Cmd.commands[c]; /* tmp = [y] */
4360 Cmd.commands[c] = Cmd.commands[c + 1]; /* [y] = [z] */
4361 Cmd.commands[c + 1] = cmdtmp; /* [z] = tmp */
4364 /* MSDOS compatibility mode (only applicable for num_pad) */
4365 flagtemp = (iflags.num_pad_mode & 1) ? Cmd.num_pad : FALSE;
4366 if (flagtemp != Cmd.pcHack_compat) {
4367 Cmd.pcHack_compat = flagtemp;
4369 /* pcHack_compat has been toggled */
4371 cmdtmp = Cmd.commands['5'];
4372 Cmd.commands['5'] = Cmd.commands[c];
4373 Cmd.commands[c] = cmdtmp;
4375 Cmd.commands[c] = Cmd.pcHack_compat ? Cmd.commands['I'] : 0;
4377 /* phone keypad layout (only applicable for num_pad) */
4378 flagtemp = (iflags.num_pad_mode & 2) ? Cmd.num_pad : FALSE;
4379 if (flagtemp != Cmd.phone_layout) {
4380 Cmd.phone_layout = flagtemp;
4382 /* phone_layout has been toggled */
4383 for (i = 0; i < 3; i++) {
4384 c = '1' + i; /* 1,2,3 <-> 7,8,9 */
4385 cmdtmp = Cmd.commands[c]; /* tmp = [1] */
4386 Cmd.commands[c] = Cmd.commands[c + 6]; /* [1] = [7] */
4387 Cmd.commands[c + 6] = cmdtmp; /* [7] = tmp */
4388 c = (M('1') & 0xff) + i; /* M-1,M-2,M-3 <-> M-7,M-8,M-9 */
4389 cmdtmp = Cmd.commands[c]; /* tmp = [M-1] */
4390 Cmd.commands[c] = Cmd.commands[c + 6]; /* [M-1] = [M-7] */
4391 Cmd.commands[c + 6] = cmdtmp; /* [M-7] = tmp */
4398 Cmd.dirchars = !Cmd.num_pad
4399 ? (!Cmd.swap_yz ? sdir : sdir_swap_yz)
4400 : (!Cmd.phone_layout ? ndir : ndir_phone_layout);
4401 Cmd.alphadirchars = !Cmd.num_pad ? Cmd.dirchars : sdir;
4403 Cmd.move_W = Cmd.dirchars[0];
4404 Cmd.move_NW = Cmd.dirchars[1];
4405 Cmd.move_N = Cmd.dirchars[2];
4406 Cmd.move_NE = Cmd.dirchars[3];
4407 Cmd.move_E = Cmd.dirchars[4];
4408 Cmd.move_SE = Cmd.dirchars[5];
4409 Cmd.move_S = Cmd.dirchars[6];
4410 Cmd.move_SW = Cmd.dirchars[7];
4414 accept_menu_prefix(cmd_func)
4415 int NDECL((*cmd_func));
4417 if (cmd_func == dopickup || cmd_func == dotip
4418 || cmd_func == doextcmd || cmd_func == doextlist)
4427 boolean do_walk, do_rush, prefix_seen, bad_command,
4428 firsttime = (cmd == 0);
4430 iflags.menu_requested = FALSE;
4432 if (program_state.done_hup)
4439 if (*cmd == '\033') {
4440 context.move = FALSE;
4443 if (*cmd == DOAGAIN && !in_doagain && saveq[0]) {
4446 rhack((char *) 0); /* read and execute command */
4450 /* Special case of *cmd == ' ' handled better below */
4451 if (!*cmd || *cmd == (char) 0377) {
4453 context.move = FALSE;
4454 return; /* probably we just had an interrupt */
4457 /* handle most movement commands */
4458 do_walk = do_rush = prefix_seen = FALSE;
4459 context.travel = context.travel1 = 0;
4462 if (movecmd(cmd[1])) {
4470 break; /* else FALLTHRU */
4472 if (movecmd(lowc(cmd[1]))) {
4480 break; /* else FALLTHRU */
4481 /* Effects of movement commands and invisible monsters:
4482 * m: always move onto space (even if 'I' remembered)
4483 * F: always attack space (even if 'I' not remembered)
4484 * normal movement: attack if 'I', move otherwise.
4487 if (movecmd(cmd[1])) {
4488 context.forcefight = 1;
4494 if (movecmd(cmd[1]) || u.dz) {
4500 cmd[0] = cmd[1]; /* "m<" or "m>" */
4505 if (movecmd(lowc(cmd[1]))) {
4515 (void) ddoinv(); /* a convenience borrowed from the PC */
4516 context.move = FALSE;
4520 if (iflags.clicklook) {
4521 context.move = FALSE;
4522 do_look(2, &clicklook_cc);
4526 if (flags.travelcmd) {
4528 context.travel1 = 1;
4536 if (movecmd(*cmd)) { /* ordinary movement */
4537 context.run = 0; /* only matters here if it was 8 */
4539 } else if (movecmd(Cmd.num_pad ? unmeta(*cmd) : lowc(*cmd))) {
4542 } else if (movecmd(unctrl(*cmd))) {
4549 /* some special prefix handling */
4550 /* overload 'm' prefix to mean "request a menu" */
4551 if (prefix_seen && cmd[0] == 'm') {
4552 /* (for func_tab cast, see below) */
4553 const struct func_tab *ft = Cmd.commands[cmd[1] & 0xff];
4554 int NDECL((*func)) = ft ? ((struct func_tab *) ft)->f_funct : 0;
4556 if (func && accept_menu_prefix(func)) {
4557 iflags.menu_requested = TRUE;
4562 if ((do_walk || do_rush) && !context.travel && !dxdy_moveok()) {
4563 /* trying to move diagonally as a grid bug;
4564 this used to be treated by movecmd() as not being
4565 a movement attempt, but that didn't provide for any
4566 feedback and led to strangeness if the key pressed
4567 ('u' in particular) was overloaded for num_pad use */
4568 You_cant("get there from here...");
4570 context.nopick = context.forcefight = FALSE;
4571 context.move = context.mv = FALSE;
4580 context.forcefight = 0;
4582 } else if (do_rush) {
4585 multi = max(COLNO, ROWNO);
4586 u.last_str_turn = 0;
4591 } else if (prefix_seen && cmd[1] == '\033') { /* <prefix><escape> */
4592 /* don't report "unknown command" for change of heart... */
4593 bad_command = FALSE;
4594 } else if (*cmd == ' ' && !flags.rest_on_space) {
4595 bad_command = TRUE; /* skip cmdlist[] loop */
4597 /* handle all other commands */
4599 register const struct func_tab *tlist;
4600 int res, NDECL((*func));
4603 /* obsolete - scan through the cmdlist array looking for *cmd */
4604 for (tlist = cmdlist; tlist->f_char; tlist++) {
4605 if ((*cmd & 0xff) != (tlist->f_char & 0xff))
4608 /* current - use *cmd to directly index cmdlist array */
4609 if ((tlist = Cmd.commands[*cmd & 0xff]) != 0) {
4611 if (u.uburied && !tlist->can_if_buried) {
4613 You_cant("do that while you are buried!");
4615 You("
\96\84\82Ü
\82Á
\82Ä
\82¢
\82é
\8e\9e\82É
\82»
\82ñ
\82È
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81I");
4618 /* we discard 'const' because some compilers seem to have
4619 trouble with the pointer passed to set_occupation() */
4620 func = ((struct func_tab *) tlist)->f_funct;
4621 if (tlist->f_text && !occupation && multi)
4622 set_occupation(func, tlist->f_text, multi);
4623 res = (*func)(); /* perform the command */
4626 context.move = FALSE;
4631 /* if we reach here, cmd wasn't found in cmdlist[] */
4637 register char c, *cp = expcmd;
4639 while ((c = *cmd++) != '\0'
4640 && (int) (cp - expcmd) < (int) (sizeof expcmd - 3)) {
4641 if (c >= 040 && c < 0177) {
4643 } else if (c & 0200) {
4653 if (!prefix_seen || !iflags.cmdassist
4655 || !help_dir(0, "Invalid direction key!"))
4657 || !help_dir(0, "
\96³
\8cø
\82È
\95û
\8cü
\8ew
\92è
\82Å
\82·
\81I"))
4659 Norep("Unknown command '%s'.", expcmd);
4661 Norep("'%s'
\83R
\83}
\83\93\83h
\81H", expcmd);
4664 context.move = FALSE;
4669 /* convert an x,y pair into a direction code */
4676 for (dd = 0; dd < 8; dd++)
4677 if (x == xdir[dd] && y == ydir[dd])
4682 /* convert a direction code into an x,y pair */
4693 /* also sets u.dz, but returns false for <> */
4698 register const char *dp = index(Cmd.dirchars, sym);
4703 u.dx = xdir[dp - Cmd.dirchars];
4704 u.dy = ydir[dp - Cmd.dirchars];
4705 u.dz = zdir[dp - Cmd.dirchars];
4706 #if 0 /* now handled elsewhere */
4707 if (u.dx && u.dy && NODIAG(u.umonnum)) {
4715 /* grid bug handling which used to be in movecmd() */
4719 if (u.dx && u.dy && NODIAG(u.umonnum))
4721 return u.dx || u.dy;
4724 /* decide whether a character (user input keystroke) requests screen repaint */
4729 return (boolean) (c == C('r') || (Cmd.num_pad && c == C('l')));
4733 * uses getdir() but unlike getdir() it specifically
4734 * produces coordinates using the direction from getdir()
4735 * and verifies that those coordinates are ok.
4737 * If the call to getdir() returns 0, Never_mind is displayed.
4738 * If the resulting coordinates are not okay, emsg is displayed.
4740 * Returns non-zero if coordinates in cc are valid.
4743 get_adjacent_loc(prompt, emsg, x, y, cc)
4744 const char *prompt, *emsg;
4749 if (!getdir(prompt)) {
4755 if (cc && isok(new_x, new_y)) {
4774 if (in_doagain || *readchar_queue)
4775 dirsym = readchar();
4778 dirsym = yn_function((s && *s != '^') ? s : "In what direction?",
4780 dirsym = yn_function((s && *s != '^') ? s : "
\82Ç
\82Ì
\95û
\8cü
\81H",
4782 /* remove the prompt string so caller won't have to */
4783 clear_nhwindow(WIN_MESSAGE);
4785 if (redraw_cmd(dirsym)) { /* ^R */
4786 docrt(); /* redraw */
4791 if (dirsym == '.' || dirsym == 's') {
4792 u.dx = u.dy = u.dz = 0;
4793 } else if (!(is_mov = movecmd(dirsym)) && !u.dz) {
4794 boolean did_help = FALSE, help_requested;
4796 if (!index(quitchars, dirsym)) {
4797 help_requested = (dirsym == '?');
4798 if (help_requested || iflags.cmdassist) {
4800 help_dir((s && *s == '^') ? dirsym : 0,
4801 help_requested ? (const char *) 0
4803 : "Invalid direction key!");
4805 : "
\96³
\8cø
\82È
\95û
\8cü
\8ew
\92è
\82Å
\82·
\81I");
4811 pline("What a strange direction!");
4813 pline("
\82¸
\82¢
\82Ô
\82ñ
\82Æ
\8aï
\96
\82È
\95û
\8cü
\82¾
\81I");
4816 } else if (is_mov && !dxdy_moveok()) {
4818 You_cant("orient yourself that direction.");
4820 You_cant("
\8cü
\82«
\82É
\8e©
\95ª
\8e©
\90g
\82ð
\8ew
\92è
\82Å
\82«
\82È
\82¢
\81D");
4823 if (!u.dz && (Stunned || (Confusion && !rn2(5))))
4835 static const char wiz_only_list[] = "EFGIOVW";
4836 char buf[BUFSZ], buf2[BUFSZ], *explain;
4838 win = create_nhwindow(NHW_TEXT);
4842 Sprintf(buf, "cmdassist: %s", msg);
4843 putstr(win, 0, buf);
4848 ctrl = (sym - 'A') + 1;
4849 if ((explain = dowhatdoes_core(ctrl, buf2))
4850 && (!index(wiz_only_list, sym) || wizard)) {
4851 Sprintf(buf, "Are you trying to use ^%c%s?", sym,
4852 index(wiz_only_list, sym)
4854 : " as specified in the Guidebook");
4855 putstr(win, 0, buf);
4857 putstr(win, 0, explain);
4859 putstr(win, 0, "To use that command, you press");
4860 Sprintf(buf, "the <Ctrl> key, and the <%c> key at the same time.",
4862 putstr(win, 0, buf);
4866 if (NODIAG(u.umonnum)) {
4867 putstr(win, 0, "Valid direction keys in your current form are:");
4868 Sprintf(buf, " %c ", Cmd.move_N);
4869 putstr(win, 0, buf);
4870 putstr(win, 0, " | ");
4871 Sprintf(buf, " %c- . -%c", Cmd.move_W, Cmd.move_E);
4872 putstr(win, 0, buf);
4873 putstr(win, 0, " | ");
4874 Sprintf(buf, " %c ", Cmd.move_S);
4875 putstr(win, 0, buf);
4877 putstr(win, 0, "Valid direction keys are:");
4878 Sprintf(buf, " %c %c %c", Cmd.move_NW, Cmd.move_N,
4880 putstr(win, 0, buf);
4881 putstr(win, 0, " \\ | / ");
4882 Sprintf(buf, " %c- . -%c", Cmd.move_W, Cmd.move_E);
4883 putstr(win, 0, buf);
4884 putstr(win, 0, " / | \\ ");
4885 Sprintf(buf, " %c %c %c", Cmd.move_SW, Cmd.move_S,
4887 putstr(win, 0, buf);
4890 putstr(win, 0, " < up");
4891 putstr(win, 0, " > down");
4892 putstr(win, 0, " . direct at yourself");
4894 /* non-null msg means that this wasn't an explicit user request */
4898 "(Suppress this message with !cmdassist in config file.)");
4900 "(
\82±
\82Ì
\83\81\83b
\83Z
\81[
\83W
\82ð
\95\
\8e¦
\82µ
\82½
\82
\82È
\82¢
\8fê
\8d\87\82Í
\90Ý
\92è
\83t
\83@
\83C
\83\8b\82É !cmdassist
\82ð
\90Ý
\92è
\82µ
\82Ä
\82
\82¾
\82³
\82¢
\81D)");
4902 display_nhwindow(win, FALSE);
4903 destroy_nhwindow(win);
4910 register int x = NODIAG(u.umonnum) ? 2 * rn2(4) : rn2(8);
4921 static NEARDATA const char *const dirnames[] = {
4922 "west", "northwest", "north", "northeast", "east",
4923 "southeast", "south", "southwest", "down", "up",
4926 if (dir < 0 || dir >= SIZE(dirnames))
4928 return dirnames[dir];
4935 /* x corresponds to curx, so x==1 is the first column. Ach. %% */
4936 return x >= 1 && x <= COLNO - 1 && y >= 0 && y <= ROWNO - 1;
4939 static NEARDATA int last_multi;
4942 * convert a MAP window position into a movecmd
4945 click_to_cmd(x, y, mod)
4952 if (iflags.clicklook && mod == CLICK_2) {
4955 cmd[0] = CMD_CLICKLOOK;
4962 if (flags.travelcmd) {
4963 if (abs(x) <= 1 && abs(y) <= 1) {
4964 x = sgn(x), y = sgn(y);
4968 cmd[0] = CMD_TRAVEL;
4972 if (x == 0 && y == 0) {
4974 if (IS_FOUNTAIN(levl[u.ux][u.uy].typ)
4975 || IS_SINK(levl[u.ux][u.uy].typ)) {
4976 cmd[0] = mod == CLICK_1 ? 'q' : M('d');
4978 } else if (IS_THRONE(levl[u.ux][u.uy].typ)) {
4981 } else if ((u.ux == xupstair && u.uy == yupstair)
4982 || (u.ux == sstairs.sx && u.uy == sstairs.sy
4984 || (u.ux == xupladder && u.uy == yupladder)) {
4986 } else if ((u.ux == xdnstair && u.uy == ydnstair)
4987 || (u.ux == sstairs.sx && u.uy == sstairs.sy
4989 || (u.ux == xdnladder && u.uy == ydnladder)) {
4991 } else if (OBJ_AT(u.ux, u.uy)) {
4993 Is_container(level.objects[u.ux][u.uy]) ? M('l') : ',';
4996 return "."; /* just rest */
5000 /* directional commands */
5004 if (!m_at(u.ux + x, u.uy + y)
5005 && !test_move(u.ux, u.uy, x, y, TEST_MOVE)) {
5006 cmd[1] = Cmd.dirchars[dir];
5008 if (IS_DOOR(levl[u.ux + x][u.uy + y].typ)) {
5009 /* slight assistance to the player: choose kick/open for them
5011 if (levl[u.ux + x][u.uy + y].doormask & D_LOCKED) {
5015 if (levl[u.ux + x][u.uy + y].doormask & D_CLOSED) {
5020 if (levl[u.ux + x][u.uy + y].typ <= SCORR) {
5027 /* convert without using floating point, allowing sloppy clicking */
5030 else if (y > 2 * abs(x))
5032 else if (x < -2 * abs(y))
5034 else if (y < -2 * abs(x))
5037 x = sgn(x), y = sgn(y);
5039 if (x == 0 && y == 0) /* map click on player to "rest" command */
5045 /* move, attack, etc. */
5047 if (mod == CLICK_1) {
5048 cmd[0] = Cmd.dirchars[dir];
5050 cmd[0] = (Cmd.num_pad
5051 ? M(Cmd.dirchars[dir])
5052 : (Cmd.dirchars[dir] - 'a' + 'A')); /* run command */
5061 #ifdef LINT /* static char in_line[COLNO]; */
5062 char in_line[COLNO];
5064 static char in_line[COLNO];
5067 boolean prezero = FALSE;
5071 flush_screen(1); /* Flush screen buffer. Put the cursor on the hero. */
5074 alt_esc = iflags.altmeta; /* readchar() hack */
5076 if (!Cmd.num_pad || (foo = readchar()) == 'n')
5079 if (foo >= '0' && foo <= '9') {
5080 multi = 10 * multi + foo - '0';
5081 if (multi < 0 || multi >= LARGEST_INT)
5082 multi = LARGEST_INT;
5084 clear_nhwindow(WIN_MESSAGE);
5086 Sprintf(in_line, "Count: %d", multi);
5088 Sprintf(in_line, "
\90\94: %d", multi);
5093 if (!multi && foo == '0')
5096 break; /* not a digit */
5099 alt_esc = FALSE; /* readchar() reset */
5102 if (foo == '\033') { /* esc cancels count (TH) */
5103 clear_nhwindow(WIN_MESSAGE);
5104 multi = last_multi = 0;
5105 } else if (foo == DOAGAIN || in_doagain) {
5109 savech(0); /* reset input queue */
5117 save_cm = (char *) 0;
5119 /* in 3.4.3 this was in rhack(), where it was too late to handle M-5 */
5120 if (Cmd.pcHack_compat) {
5121 /* This handles very old inconsistent DOS/Windows behaviour
5122 in a different way: earlier, the keyboard handler mapped
5123 these, which caused counts to be strange when entered
5124 from the number pad. Now do not map them until here. */
5142 if (foo == 'g' || foo == 'G' || foo == 'm' || foo == 'M' || foo == 'F'
5143 || (Cmd.num_pad && (foo == '5' || foo == '-'))) {
5149 clear_nhwindow(WIN_MESSAGE);
5151 in_line[0] = '\033';
5155 #ifdef HANGUPHANDLING
5156 /* some very old systems, or descendents of such systems, expect signal
5157 handlers to have return type `int', but they don't actually inspect
5158 the return value so we should be safe using `void' unconditionally */
5161 hangup(sig_unused) /* called as signal() handler, so sent at least one arg */
5162 int sig_unused UNUSED;
5164 if (program_state.exiting)
5165 program_state.in_moveloop = 0;
5168 /* When using SAFERHANGUP, the done_hup flag it tested in rhack
5169 and a couple of other places; actual hangup handling occurs then.
5170 This is 'safer' because it disallows certain cheats and also
5171 protects against losing objects in the process of being thrown,
5172 but also potentially riskier because the disconnected program
5173 must continue running longer before attempting a hangup save. */
5174 program_state.done_hup++;
5175 /* defer hangup iff game appears to be in progress */
5176 if (program_state.in_moveloop && program_state.something_worth_saving)
5178 #endif /* SAFERHANGUP */
5185 #ifdef NOSAVEONHANGUP
5187 if (flags.ins_chkpt && program_state.something_worth_saving)
5188 program_statue.preserve_locks = 1; /* keep files for recovery */
5190 program_state.something_worth_saving = 0; /* don't save */
5194 if (!program_state.done_hup++)
5196 if (program_state.something_worth_saving)
5198 if (iflags.window_inited)
5199 exit_nhwindows((char *) 0);
5201 terminate(EXIT_SUCCESS);
5202 /*NOTREACHED*/ /* not necessarily true for vms... */
5205 #endif /* HANGUPHANDLING */
5211 int x = u.ux, y = u.uy, mod = 0;
5213 if (*readchar_queue)
5214 sym = *readchar_queue++;
5216 sym = in_doagain ? pgetchar() : nh_poskey(&x, &y, &mod);
5220 register int cnt = NR_OF_EOFS;
5222 * Some SYSV systems seem to return EOFs for various reasons
5223 * (?like when one hits break or for interrupted systemcalls?),
5224 * and we must see several before we quit.
5227 clearerr(stdin); /* omit if clearerr is undefined */
5229 } while (--cnt && sym == EOF);
5231 #endif /* NR_OF_EOFS */
5234 #ifdef HANGUPHANDLING
5235 hangup(0); /* call end_of_input() or set program_state.done_hup */
5239 } else if (sym == '\033' && alt_esc) {
5240 /* iflags.altmeta: treat two character ``ESC c'' as single `M-c' */
5241 sym = *readchar_queue ? *readchar_queue++ : pgetchar();
5242 if (sym == EOF || sym == 0)
5244 else if (sym != '\033')
5245 sym |= 0200; /* force 8th bit on */
5247 } else if (sym == 0) {
5249 readchar_queue = click_to_cmd(x, y, mod);
5250 sym = *readchar_queue++;
5258 /* Keyboard travel command */
5262 if (!flags.travelcmd)
5265 cc.x = iflags.travelcc.x;
5266 cc.y = iflags.travelcc.y;
5267 if (cc.x == -1 && cc.y == -1) {
5268 /* No cached destination, start attempt from current position */
5273 pline("Where do you want to travel to?");
5275 pline("
\82Ç
\82±
\82É
\88Ú
\93®
\82·
\82é
\81H");
5277 if (getpos(&cc, TRUE, "the desired destination") < 0) {
5279 if (getpos(&cc, TRUE, "
\88Ú
\93®
\90æ") < 0) {
5280 /* user pressed ESC */
5283 iflags.travelcc.x = u.tx = cc.x;
5284 iflags.travelcc.y = u.ty = cc.y;
5285 cmd[0] = CMD_TRAVEL;
5286 readchar_queue = cmd;
5291 extern void NDECL(win32con_debug_keystrokes);
5292 extern void NDECL(win32con_handler_info);
5301 int num_menu_selections;
5302 struct menu_selection_struct {
5305 } menu_selections[] = {
5307 { "test win32 keystrokes (tty only)", win32con_debug_keystrokes },
5308 { "show keystroke handler information (tty only)",
5309 win32con_handler_info },
5311 { (char *) 0, (void NDECL((*) )) 0 } /* array terminator */
5314 num_menu_selections = SIZE(menu_selections) - 1;
5315 if (num_menu_selections > 0) {
5316 menu_item *pick_list;
5317 win = create_nhwindow(NHW_MENU);
5319 for (k = 0; k < num_menu_selections; ++k) {
5321 add_menu(win, NO_GLYPH, &any, item++, 0, ATR_NONE,
5322 menu_selections[k].menutext, MENU_UNSELECTED);
5324 end_menu(win, "Which port debugging feature?");
5325 n = select_menu(win, PICK_ONE, &pick_list);
5326 destroy_nhwindow(win);
5328 n = pick_list[0].item.a_int - 1;
5329 free((genericptr_t) pick_list);
5330 /* execute the function */
5331 (*menu_selections[n].fn)();
5334 pline("No port-specific debug capability defined.");
5337 #endif /*PORT_DEBUG*/
5340 * Parameter validator for generic yes/no function to prevent
5341 * the core from sending too long a prompt string to the
5342 * window port causing a buffer overflow there.
5345 yn_function(query, resp, def)
5346 const char *query, *resp;
5351 iflags.last_msg = PLNMSG_UNKNOWN; /* most recent pline is clobbered */
5353 /* maximum acceptable length is QBUFSZ-1 */
5354 if (strlen(query) < QBUFSZ)
5355 return (*windowprocs.win_yn_function)(query, resp, def);
5357 /* caller shouldn't have passed anything this long */
5358 paniclog("Query truncated: ", query);
5359 (void) strncpy(qbuf, query, QBUFSZ - 1 - 3);
5360 Strcpy(&qbuf[QBUFSZ - 1 - 3], "...");
5361 return (*windowprocs.win_yn_function)(qbuf, resp, def);
5364 /* for paranoid_confirm:quit,die,attack prompting */
5366 paranoid_query(be_paranoid, prompt)
5367 boolean be_paranoid;
5370 boolean confirmed_ok;
5372 /* when paranoid, player must respond with "yes" rather than just 'y'
5373 to give the go-ahead for this query; default is "no" unless the
5374 ParanoidConfirm flag is set in which case there's no default */
5376 char qbuf[QBUFSZ], ans[BUFSZ];
5377 const char *promptprefix = "", *responsetype = ParanoidConfirm
5380 int trylimit = 6; /* 1 normal, 5 more with "Yes or No:" prefix */
5382 /* in addition to being paranoid about this particular
5383 query, we might be even more paranoid about all paranoia
5384 responses (ie, ParanoidConfirm is set) in which case we
5385 require "no" to reject in addition to "yes" to confirm
5386 (except we won't loop if response is ESC; it means no) */
5388 Sprintf(qbuf, "%s%s %s", promptprefix, prompt, responsetype);
5390 (void) mungspaces(ans);
5391 confirmed_ok = !strcmpi(ans, "yes");
5392 if (confirmed_ok || *ans == '\033')
5394 promptprefix = "\"Yes\" or \"No\": ";
5395 } while (ParanoidConfirm && strcmpi(ans, "no") && --trylimit);
5397 confirmed_ok = (yn(prompt) == 'y');
5399 return confirmed_ok;
5406 /* Does current window system support suspend? */
5407 if ((*windowprocs.win_can_suspend)()) {
5408 /* NB: SYSCF SHELLERS handled in port code. */
5412 Norep("Suspend command not available.");