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)) {
329 pline("'m' prefix has no effect for this command.");
330 iflags.menu_requested = FALSE;
333 } while (func == doextlist);
338 /* here after #? - now list all full-word commands */
342 register const struct ext_func_tab *efp;
346 datawin = create_nhwindow(NHW_TEXT);
347 putstr(datawin, 0, "");
349 putstr(datawin, 0, " Extended Commands List");
351 putstr(datawin, 0, "
\8ag
\92£
\83R
\83}
\83\93\83h
\88ê
\97\97");
352 putstr(datawin, 0, "");
354 putstr(datawin, 0, " Press '#', then type:");
356 putstr(datawin, 0, " '#'
\82ð
\89\9f\82µ
\82½
\82 \82Æ
\83^
\83C
\83v
\82¹
\82æ:");
357 putstr(datawin, 0, "");
359 for (efp = extcmdlist; efp->ef_txt; efp++) {
360 Sprintf(buf, " %-15s - %s.", efp->ef_txt, efp->ef_desc);
361 putstr(datawin, 0, buf);
363 display_nhwindow(datawin, FALSE);
364 destroy_nhwindow(datawin);
369 #define MAX_EXT_CMD 50 /* Change if we ever have > 50 ext cmds */
372 * This is currently used only by the tty port and is
373 * controlled via runtime option 'extmenu'.
374 * ``# ?'' is counted towards the limit of the number of commands,
375 * so we actually support MAX_EXT_CMD-1 "real" extended commands.
377 * Here after # - now show pick-list of possible commands.
382 const struct ext_func_tab *efp;
383 menu_item *pick_list = (menu_item *) 0;
386 const struct ext_func_tab *choices[MAX_EXT_CMD + 1];
388 char cbuf[QBUFSZ], prompt[QBUFSZ], fmtstr[20];
389 int i, n, nchoices, acount;
391 int accelerator, prevaccelerator;
400 /* populate choices */
401 for (efp = extcmdlist; efp->ef_txt; efp++) {
402 if (!matchlevel || !strncmp(efp->ef_txt, cbuf, matchlevel)) {
404 if ((int) strlen(efp->ef_desc) > biggest) {
405 biggest = strlen(efp->ef_desc);
406 Sprintf(fmtstr, "%%-%ds", biggest + 15);
408 if (++i > MAX_EXT_CMD) {
411 "Exceeded %d extended commands in doextcmd() menu; 'extmenu' disabled.",
419 choices[i] = (struct ext_func_tab *) 0;
421 /* if we're down to one, we have our selection so get out of here */
423 for (i = 0; extcmdlist[i].ef_txt != (char *) 0; i++)
424 if (!strncmpi(extcmdlist[i].ef_txt, cbuf, matchlevel)) {
432 win = create_nhwindow(NHW_MENU);
434 accelerator = prevaccelerator = 0;
436 for (i = 0; choices[i]; ++i) {
437 accelerator = choices[i]->ef_txt[matchlevel];
438 if (accelerator != prevaccelerator || nchoices < (ROWNO - 3)) {
440 /* flush extended cmds for that letter already in buf */
441 Sprintf(buf, fmtstr, prompt);
442 any.a_char = prevaccelerator;
443 add_menu(win, NO_GLYPH, &any, any.a_char, 0, ATR_NONE,
448 prevaccelerator = accelerator;
449 if (!acount || nchoices < (ROWNO - 3)) {
450 Sprintf(prompt, "%s [%s]", choices[i]->ef_txt,
451 choices[i]->ef_desc);
452 } else if (acount == 1) {
454 Sprintf(prompt, "%s or %s", choices[i - 1]->ef_txt,
456 Sprintf(prompt, "%s
\82Ü
\82½
\82Í %s", choices[i-1]->ef_txt,
460 Strcat(prompt, " or ");
462 Strcat(prompt,"
\82Ü
\82½
\82Í ");
463 Strcat(prompt, choices[i]->ef_txt);
469 Sprintf(buf, fmtstr, prompt);
470 any.a_char = prevaccelerator;
471 add_menu(win, NO_GLYPH, &any, any.a_char, 0, ATR_NONE, buf,
475 Sprintf(prompt, "Extended Command: %s", cbuf);
477 Sprintf(prompt, "
\8ag
\92£
\83R
\83}
\83\93\83h: %s", cbuf);
478 end_menu(win, prompt);
479 n = select_menu(win, PICK_ONE, &pick_list);
480 destroy_nhwindow(win);
482 if (matchlevel > (QBUFSZ - 2)) {
483 free((genericptr_t) pick_list);
485 impossible("Too many chars (%d) entered in extcmd_via_menu()",
490 cbuf[matchlevel++] = pick_list[0].item.a_char;
491 cbuf[matchlevel] = '\0';
492 free((genericptr_t) pick_list);
504 #endif /* TTY_GRAPHICS */
506 /* #monster command - use special monster ability while polymorphed */
508 domonability(VOID_ARGS)
510 if (can_breathe(youmonst.data))
512 else if (attacktype(youmonst.data, AT_SPIT))
514 else if (youmonst.data->mlet == S_NYMPH)
516 else if (attacktype(youmonst.data, AT_GAZE))
518 else if (is_were(youmonst.data))
520 else if (webmaker(youmonst.data))
522 else if (is_hider(youmonst.data))
524 else if (is_mind_flayer(youmonst.data))
525 return domindblast();
526 else if (u.umonnum == PM_GREMLIN) {
527 if (IS_FOUNTAIN(levl[u.ux][u.uy].typ)) {
528 if (split_mon(&youmonst, (struct monst *) 0))
529 dryup(u.ux, u.uy, TRUE);
532 There("is no fountain here.");
534 pline("
\82±
\82±
\82É
\82Í
\90ò
\82Í
\82È
\82¢
\81D");
535 } else if (is_unicorn(youmonst.data)) {
536 use_unicorn_horn((struct obj *) 0);
538 } else if (youmonst.data->msound == MS_SHRIEK) {
542 You("
\8bà
\90Ø
\82è
\90º
\82ð
\82 \82°
\82½
\81D");
545 pline("Unfortunately sound does not carry well through rock.");
547 pline("
\8ec
\94O
\82È
\82ª
\82ç
\89¹
\82Í
\8aâ
\82ð
\82¤
\82Ü
\82
\93`
\82í
\82ç
\82È
\82¢
\81D");
550 } else if (youmonst.data->mlet == S_VAMPIRE)
554 pline("Any special ability you may have is purely reflexive.");
556 pline("
\82 \82È
\82½
\82Ì
\8e\9d\82Á
\82Ä
\82¢
\82é
\93Á
\8eê
\94\
\97Í
\82Í
\82Ç
\82ê
\82à
\8eó
\93®
\93I
\82¾
\81D");
559 You("don't have a special ability in your normal form!");
561 You("
\95\81\92i
\82Ì
\8ep
\82Å
\82Ì
\93Á
\8eê
\94\
\97Í
\82ð
\8e\9d\82Á
\82Ä
\82¢
\82È
\82¢
\81I");
566 enter_explore_mode(VOID_ARGS)
570 You("are in debug mode.");
572 You("
\82·
\82Å
\82É
\83f
\83o
\83b
\83O
\83\82\81[
\83h
\82¾
\81D");
573 } else if (discover) {
575 You("are already in explore mode.");
577 You("
\82·
\82Å
\82É
\92T
\8c\9f\83\82\81[
\83h
\82¾
\81D");
581 if (!sysopt.explorers || !sysopt.explorers[0]
582 || !check_user_string(sysopt.explorers)) {
584 You("cannot access explore mode.");
586 You("
\92T
\8c\9f\83\82\81[
\83h
\82É
\83A
\83N
\83Z
\83X
\82Å
\82«
\82È
\82¢
\81D");
593 "Beware! From explore mode there will be no return to normal game.");
595 "
\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");
596 if (paranoid_query(ParanoidQuit,
598 "Do you want to enter explore mode?")) {
600 "
\94
\8c©
\83\82\81[
\83h
\82É
\88Ú
\82è
\82Ü
\82·
\82©
\81H")) {
601 clear_nhwindow(WIN_MESSAGE);
603 You("are now in non-scoring explore mode.");
605 You("
\83X
\83R
\83A
\82ª
\82Ì
\82ç
\82È
\82¢
\94
\8c©
\83\82\81[
\83h
\82É
\88Ú
\8ds
\82µ
\82½
\81D");
608 clear_nhwindow(WIN_MESSAGE);
610 pline("Resuming normal game.");
612 pline("
\92Ê
\8fí
\83\82\81[
\83h
\82ð
\91±
\82¯
\82é
\81D");
619 dooverview_or_wiz_where(VOID_ARGS)
628 /* ^W command - wish for something */
630 wiz_wish(VOID_ARGS) /* Unlimited wishes for debug mode by Paul Polderman */
633 boolean save_verbose = flags.verbose;
635 flags.verbose = FALSE;
637 flags.verbose = save_verbose;
638 (void) encumber_msg();
641 pline("Unavailable command '%s'.",
643 pline("'%s'
\83R
\83}
\83\93\83h
\82Í
\8eg
\82¦
\82È
\82¢
\81D",
644 visctrl((int) cmd_from_func(wiz_wish)));
648 /* ^I command - reveal and optionally identify hero's inventory */
650 wiz_identify(VOID_ARGS)
653 iflags.override_ID = (int) cmd_from_func(wiz_identify);
654 if (display_inventory((char *) 0, TRUE) == -1)
655 identify_pack(0, FALSE);
656 iflags.override_ID = 0;
659 pline("Unavailable command '%s'.",
661 pline("'%s'
\83R
\83}
\83\93\83h
\82Í
\8eg
\82¦
\82È
\82¢
\81D",
662 visctrl((int) cmd_from_func(wiz_identify)));
666 /* ^F command - reveal the level map and any traps on it */
672 long save_Hconf = HConfusion, save_Hhallu = HHallucination;
674 HConfusion = HHallucination = 0L;
675 for (t = ftrap; t != 0; t = t->ntrap) {
680 HConfusion = save_Hconf;
681 HHallucination = save_Hhallu;
684 pline("Unavailable command '%s'.",
686 pline("'%s'
\83R
\83}
\83\93\83h
\82Í
\8eg
\82¦
\82È
\82¢
\81D",
687 visctrl((int) cmd_from_func(wiz_map)));
691 /* ^G command - generate monster(s); a count prefix will be honored */
693 wiz_genesis(VOID_ARGS)
696 (void) create_particular();
699 pline("Unavailable command '%s'.",
701 pline("'%s'
\83R
\83}
\83\93\83h
\82Í
\8eg
\82¦
\82È
\82¢
\81D",
702 visctrl((int) cmd_from_func(wiz_genesis)));
706 /* ^O command - display dungeon layout */
711 (void) print_dungeon(FALSE, (schar *) 0, (xchar *) 0);
714 pline("Unavailable command '%s'.",
716 pline("'%s'
\83R
\83}
\83\93\83h
\82Í
\8eg
\82¦
\82È
\82¢
\81D",
717 visctrl((int) cmd_from_func(wiz_where)));
721 /* ^E command - detect unseen (secret doors, traps, hidden monsters) */
723 wiz_detect(VOID_ARGS)
729 pline("Unavailable command '%s'.",
731 pline("'%s'
\83R
\83}
\83\93\83h
\82Í
\8eg
\82¦
\82È
\82¢
\81D",
732 visctrl((int) cmd_from_func(wiz_detect)));
736 /* ^V command - level teleport */
738 wiz_level_tele(VOID_ARGS)
744 pline("Unavailable command '%s'.",
746 pline("'%s'
\83R
\83}
\83\93\83h
\82Í
\8eg
\82¦
\82È
\82¢
\81D",
747 visctrl((int) cmd_from_func(wiz_level_tele)));
751 /* #monpolycontrol command - choose new form for shapechangers, polymorphees */
753 wiz_mon_polycontrol(VOID_ARGS)
755 iflags.mon_polycontrol = !iflags.mon_polycontrol;
757 pline("Monster polymorph control is %s.",
758 iflags.mon_polycontrol ? "on" : "off");
760 pline("
\89ö
\95¨
\82Ì
\95Ï
\89»
\90§
\8cä: %s",
761 iflags.mon_polycontrol ? "
\83I
\83\93" : "
\83I
\83t");
766 /* #levelchange command - adjust hero's experience level */
768 wiz_level_change(VOID_ARGS)
775 getlin("To what experience level do you want to be set?", buf);
777 getlin("
\8co
\8c±
\83\8c\83x
\83\8b\82ð
\82¢
\82
\82Â
\82É
\90Ý
\92è
\82µ
\82Ü
\82·
\82©
\81H", buf);
778 (void) mungspaces(buf);
779 if (buf[0] == '\033' || buf[0] == '\0')
782 ret = sscanf(buf, "%d", &newlevel);
788 if (newlevel == u.ulevel) {
790 You("are already that experienced.");
792 You("
\82·
\82Å
\82É
\82»
\82Ì
\8co
\8c±
\83\8c\83x
\83\8b\82¾
\81D");
793 } else if (newlevel < u.ulevel) {
796 You("are already as inexperienced as you can get.");
798 You("
\82·
\82Å
\82É
\89Â
\94\
\82È
\8cÀ
\82è
\82Ì
\8dÅ
\92á
\82Ì
\8co
\8c±
\83\8c\83x
\83\8b\82¾
\81D");
803 while (u.ulevel > newlevel)
805 losexp("#levelchange");
807 losexp("#levelchange
\83R
\83}
\83\93\83h
\82Å");
809 if (u.ulevel >= MAXULEV) {
811 You("are already as experienced as you can get.");
813 You("
\82·
\82Å
\82É
\89Â
\94\
\82È
\8cÀ
\82è
\82Ì
\8dÅ
\91å
\82Ì
\8co
\8c±
\83\8c\83x
\83\8b\82¾
\81D");
816 if (newlevel > MAXULEV)
818 while (u.ulevel < newlevel)
821 u.ulevelmax = u.ulevel;
825 /* #panic command - test program's panic handling */
830 if (yn("Do you want to call panic() and end your game?") == 'y')
832 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')
833 panic("Crash test.");
837 /* #polyself command - change hero's form */
839 wiz_polyself(VOID_ARGS)
847 wiz_show_seenv(VOID_ARGS)
850 int x, y, v, startx, stopx, curx;
853 win = create_nhwindow(NHW_TEXT);
855 * Each seenv description takes up 2 characters, so center
856 * the seenv display around the hero.
858 startx = max(1, u.ux - (COLNO / 4));
859 stopx = min(startx + (COLNO / 2), COLNO);
860 /* can't have a line exactly 80 chars long */
861 if (stopx - startx == COLNO / 2)
864 for (y = 0; y < ROWNO; y++) {
865 for (x = startx, curx = 0; x < stopx; x++, curx += 2) {
866 if (x == u.ux && y == u.uy) {
867 row[curx] = row[curx + 1] = '@';
869 v = levl[x][y].seenv & 0xff;
871 row[curx] = row[curx + 1] = ' ';
873 Sprintf(&row[curx], "%02x", v);
876 /* remove trailing spaces */
877 for (x = curx - 1; x >= 0; x--)
884 display_nhwindow(win, TRUE);
885 destroy_nhwindow(win);
889 /* #vision command */
891 wiz_show_vision(VOID_ARGS)
897 win = create_nhwindow(NHW_TEXT);
898 Sprintf(row, "Flags: 0x%x could see, 0x%x in sight, 0x%x temp lit",
899 COULD_SEE, IN_SIGHT, TEMP_LIT);
902 for (y = 0; y < ROWNO; y++) {
903 for (x = 1; x < COLNO; x++) {
904 if (x == u.ux && y == u.uy)
907 v = viz_array[y][x]; /* data access should be hidden */
911 row[x] = '0' + viz_array[y][x];
914 /* remove trailing spaces */
915 for (x = COLNO - 1; x >= 1; x--)
920 putstr(win, 0, &row[1]);
922 display_nhwindow(win, TRUE);
923 destroy_nhwindow(win);
929 wiz_show_wmodes(VOID_ARGS)
935 boolean istty = !strcmp(windowprocs.name, "tty");
937 win = create_nhwindow(NHW_TEXT);
939 putstr(win, 0, ""); /* tty only: blank top line */
940 for (y = 0; y < ROWNO; y++) {
941 for (x = 0; x < COLNO; x++) {
943 if (x == u.ux && y == u.uy)
945 else if (IS_WALL(lev->typ) || lev->typ == SDOOR)
946 row[x] = '0' + (lev->wall_info & WM_MASK);
947 else if (lev->typ == CORR)
949 else if (IS_ROOM(lev->typ) || IS_DOOR(lev->typ))
955 /* map column 0, levl[0][], is off the left edge of the screen */
956 putstr(win, 0, &row[1]);
958 display_nhwindow(win, TRUE);
959 destroy_nhwindow(win);
963 /* wizard mode variant of #terrain; internal levl[][].typ values in base-36 */
965 wiz_map_levltyp(VOID_ARGS)
970 boolean istty = !strcmp(windowprocs.name, "tty");
972 win = create_nhwindow(NHW_TEXT);
973 /* map row 0, levl[][0], is drawn on the second line of tty screen */
975 putstr(win, 0, ""); /* tty only: blank top line */
976 for (y = 0; y < ROWNO; y++) {
977 /* map column 0, levl[0][], is off the left edge of the screen;
978 it should always have terrain type "undiggable stone" */
979 for (x = 1; x < COLNO; x++) {
980 terrain = levl[x][y].typ;
981 /* assumes there aren't more than 10+26+26 terrain types */
982 row[x - 1] = (char) ((terrain == 0 && !may_dig(x, y))
988 : 'A' + terrain - 36);
990 if (levl[0][y].typ != 0 || may_dig(0, y))
998 s_level *slev = Is_special(&u.uz);
1000 Sprintf(dsc, "D:%d,L:%d", u.uz.dnum, u.uz.dlevel);
1001 /* [dungeon branch features currently omitted] */
1002 /* special level features */
1004 Sprintf(eos(dsc), " \"%s\"", slev->proto);
1005 /* special level flags (note: dungeon.def doesn't set `maze'
1006 or `hell' for any specific levels so those never show up) */
1007 if (slev->flags.maze_like)
1008 Strcat(dsc, " mazelike");
1009 if (slev->flags.hellish)
1010 Strcat(dsc, " hellish");
1011 if (slev->flags.town)
1012 Strcat(dsc, " town");
1013 if (slev->flags.rogue_like)
1014 Strcat(dsc, " roguelike");
1015 /* alignment currently omitted to save space */
1017 /* level features */
1018 if (level.flags.nfountains)
1019 Sprintf(eos(dsc), " %c:%d", defsyms[S_fountain].sym,
1020 (int) level.flags.nfountains);
1021 if (level.flags.nsinks)
1022 Sprintf(eos(dsc), " %c:%d", defsyms[S_sink].sym,
1023 (int) level.flags.nsinks);
1024 if (level.flags.has_vault)
1025 Strcat(dsc, " vault");
1026 if (level.flags.has_shop)
1027 Strcat(dsc, " shop");
1028 if (level.flags.has_temple)
1029 Strcat(dsc, " temple");
1030 if (level.flags.has_court)
1031 Strcat(dsc, " throne");
1032 if (level.flags.has_zoo)
1033 Strcat(dsc, " zoo");
1034 if (level.flags.has_morgue)
1035 Strcat(dsc, " morgue");
1036 if (level.flags.has_barracks)
1037 Strcat(dsc, " barracks");
1038 if (level.flags.has_beehive)
1039 Strcat(dsc, " hive");
1040 if (level.flags.has_swamp)
1041 Strcat(dsc, " swamp");
1043 if (level.flags.noteleport)
1044 Strcat(dsc, " noTport");
1045 if (level.flags.hardfloor)
1046 Strcat(dsc, " noDig");
1047 if (level.flags.nommap)
1048 Strcat(dsc, " noMMap");
1049 if (!level.flags.hero_memory)
1050 Strcat(dsc, " noMem");
1051 if (level.flags.shortsighted)
1052 Strcat(dsc, " shortsight");
1053 if (level.flags.graveyard)
1054 Strcat(dsc, " graveyard");
1055 if (level.flags.is_maze_lev)
1056 Strcat(dsc, " maze");
1057 if (level.flags.is_cavernous_lev)
1058 Strcat(dsc, " cave");
1059 if (level.flags.arboreal)
1060 Strcat(dsc, " tree");
1062 Strcat(dsc, " sokoban-rules");
1063 /* non-flag info; probably should include dungeon branching
1064 checks (extra stairs and magic portals) here */
1065 if (Invocation_lev(&u.uz))
1066 Strcat(dsc, " invoke");
1067 if (On_W_tower_level(&u.uz))
1068 Strcat(dsc, " tower");
1069 /* append a branch identifier for completeness' sake */
1071 Strcat(dsc, " dungeon");
1072 else if (u.uz.dnum == mines_dnum)
1073 Strcat(dsc, " mines");
1074 else if (In_sokoban(&u.uz))
1075 Strcat(dsc, " sokoban");
1076 else if (u.uz.dnum == quest_dnum)
1077 Strcat(dsc, " quest");
1078 else if (Is_knox(&u.uz))
1079 Strcat(dsc, " ludios");
1080 else if (u.uz.dnum == 1)
1081 Strcat(dsc, " gehennom");
1082 else if (u.uz.dnum == tower_dnum)
1083 Strcat(dsc, " vlad");
1084 else if (In_endgame(&u.uz))
1085 Strcat(dsc, " endgame");
1087 /* somebody's added a dungeon branch we're not expecting */
1088 const char *brname = dungeons[u.uz.dnum].dname;
1090 if (!brname || !*brname)
1092 if (!strncmpi(brname, "the ", 4))
1094 Sprintf(eos(dsc), " %s", brname);
1096 /* limit the line length to map width */
1097 if (strlen(dsc) >= COLNO)
1098 dsc[COLNO - 1] = '\0'; /* truncate */
1099 putstr(win, 0, dsc);
1102 display_nhwindow(win, TRUE);
1103 destroy_nhwindow(win);
1107 /* temporary? hack, since level type codes aren't the same as screen
1108 symbols and only the latter have easily accessible descriptions */
1109 static const char *levltyp[] = {
1110 "stone", "vertical wall", "horizontal wall", "top-left corner wall",
1111 "top-right corner wall", "bottom-left corner wall",
1112 "bottom-right corner wall", "cross wall", "tee-up wall", "tee-down wall",
1113 "tee-left wall", "tee-right wall", "drawbridge wall", "tree",
1114 "secret door", "secret corridor", "pool", "moat", "water",
1115 "drawbridge up", "lava pool", "iron bars", "door", "corridor", "room",
1116 "stairs", "ladder", "fountain", "throne", "sink", "grave", "altar", "ice",
1117 "drawbridge down", "air", "cloud",
1118 /* not a real terrain type, but used for undiggable stone
1119 by wiz_map_levltyp() */
1120 "unreachable/undiggable",
1121 /* padding in case the number of entries above is odd */
1125 /* explanation of base-36 output from wiz_map_levltyp() */
1127 wiz_levltyp_legend(VOID_ARGS)
1131 const char *dsc, *fmt;
1134 win = create_nhwindow(NHW_TEXT);
1135 putstr(win, 0, "#terrain encodings:");
1137 fmt = " %c - %-28s"; /* TODO: include tab-separated variant for win32 */
1139 /* output in pairs, left hand column holds [0],[1],...,[N/2-1]
1140 and right hand column holds [N/2],[N/2+1],...,[N-1];
1141 N ('last') will always be even, and may or may not include
1142 the empty string entry to pad out the final pair, depending
1143 upon how many other entries are present in levltyp[] */
1144 last = SIZE(levltyp) & ~1;
1145 for (i = 0; i < last / 2; ++i)
1146 for (j = i; j < last; j += last / 2) {
1149 : !strncmp(dsc, "unreachable", 11) ? '*'
1150 /* same int-to-char conversion as wiz_map_levltyp() */
1151 : (j < 10) ? '0' + j
1152 : (j < 36) ? 'a' + j - 10
1154 Sprintf(eos(buf), fmt, c, dsc);
1156 putstr(win, 0, buf);
1160 display_nhwindow(win, TRUE);
1161 destroy_nhwindow(win);
1165 /* #wizsmell command - test usmellmon(). */
1167 wiz_smell(VOID_ARGS)
1170 int mndx; /* monster index */
1171 coord cc; /* screen pos of unknown glyph */
1172 int glyph; /* glyph at selected position */
1176 mndx = 0; /* gcc -Wall lint */
1177 if (!olfaction(youmonst.data)) {
1178 You("are incapable of detecting odors in your present form.");
1182 pline("You can move the cursor to a monster that you want to smell.");
1184 pline("Pick a monster to smell.");
1185 ans = getpos(&cc, TRUE, "a monster");
1186 if (ans < 0 || cc.x < 0) {
1187 return 0; /* done */
1189 /* Convert the glyph at the selected position to a mndxbol. */
1190 glyph = glyph_at(cc.x, cc.y);
1191 if (glyph_is_monster(glyph))
1192 mndx = glyph_to_mon(glyph);
1195 /* Is it a monster? */
1197 if (!usmellmon(&mons[mndx]))
1198 pline("That monster seems to give off no smell.");
1200 pline("That is not a monster.");
1205 /* #wizrumorcheck command - verify each rumor access */
1207 wiz_rumor_check(VOID_ARGS)
1213 /* #terrain command -- show known map, inspired by crawl's '|' command */
1215 doterrain(VOID_ARGS)
1224 * normal play: choose between known map without mons, obj, and traps
1225 * (to see underlying terrain only), or
1226 * known map without mons and objs (to see traps under mons and objs), or
1227 * known map without mons (to see objects under monsters);
1228 * explore mode: normal choices plus full map (w/o mons, objs, traps);
1229 * wizard mode: normal and explore choices plus
1230 * a dump of the internal levl[][].typ codes w/ level flags, or
1231 * a legend for the levl[][].typ codes dump
1233 men = create_nhwindow(NHW_MENU);
1236 add_menu(men, NO_GLYPH, &any, 0, 0, ATR_NONE,
1237 "known map without monsters, objects, and traps",
1240 add_menu(men, NO_GLYPH, &any, 0, 0, ATR_NONE,
1241 "known map without monsters and objects",
1244 add_menu(men, NO_GLYPH, &any, 0, 0, ATR_NONE,
1245 "known map without monsters",
1247 if (discover || wizard) {
1249 add_menu(men, NO_GLYPH, &any, 0, 0, ATR_NONE,
1250 "full map without monsters, objects, and traps",
1254 add_menu(men, NO_GLYPH, &any, 0, 0, ATR_NONE,
1255 "internal levl[][].typ codes in base-36",
1258 add_menu(men, NO_GLYPH, &any, 0, 0, ATR_NONE,
1259 "legend of base-36 levl[][].typ codes",
1263 end_menu(men, "View which?");
1265 n = select_menu(men, PICK_ONE, &sel);
1266 destroy_nhwindow(men);
1268 * n < 0: player used ESC to cancel;
1269 * n == 0: preselected entry was explicitly chosen and got toggled off;
1270 * n == 1: preselected entry was implicitly chosen via <space>|<enter>;
1271 * n == 2: another entry was explicitly chosen, so skip preselected one.
1273 which = (n < 0) ? -1 : (n == 0) ? 1 : sel[0].item.a_int;
1274 if (n > 1 && which == 1)
1275 which = sel[1].item.a_int;
1277 free((genericptr_t) sel);
1280 case 1: reveal_terrain(0, 0); break; /* known map */
1281 case 2: reveal_terrain(0, 1); break; /* known map with traps */
1282 case 3: reveal_terrain(0, 1|2); break; /* known map w/ traps & objs */
1283 case 4: reveal_terrain(1, 0); break; /* full map */
1284 case 5: wiz_map_levltyp(); break; /* map internals */
1285 case 6: wiz_levltyp_legend(); break; /* internal details */
1288 return 0; /* no time elapses */
1291 /* -enlightenment and conduct- */
1292 static winid en_win = WIN_ERR;
1294 static const char You_[] = "You ", are[] = "are ", were[] = "were ",
1295 have[] = "have ", had[] = "had ", can[] = "can ",
1298 static const char You_[] = "
\82 \82È
\82½
\82Í",
1299 are[] = "
\82Å
\82 \82é", were[] = "
\82Å
\82 \82Á
\82½",
1300 have[] = "
\82ð
\82à
\82Á
\82Ä
\82¢
\82é", had[] = "
\82ð
\82à
\82Á
\82Ä
\82¢
\82½",
1301 can[] = "
\82Å
\82«
\82é", could[] = "
\82Å
\82«
\82½",
1302 iru[] = "
\82¢
\82é", ita[] = "
\82¢
\82½";
1304 #if 0 /*JP*//* not used */
1305 static const char have_been[] = "have been ", have_never[] = "have never ",
1310 #define enl_msg(prefix, present, past, suffix, ps) \
1311 enlght_line(prefix, final ? past : present, suffix, ps)
1313 #define enl_msg(prefix, present, past, suffix, ps) \
1314 enlght_line(prefix, ps, suffix, final ? past : present)
1316 #define you_are(attr, ps) enl_msg(You_, are, were, attr, ps)
1317 #define you_have(attr, ps) enl_msg(You_, have, had, attr, ps)
1318 #define you_can(attr, ps) enl_msg(You_, can, could, attr, ps)
1320 #define you_have_been(goodthing) enl_msg(You_, have_been, were, goodthing, "")
1322 #define you_have_been(goodthing) enl_msg(You_, are, were, goodthing, "")
1324 #define you_have_never(badthing) \
1325 enl_msg(You_, have_never, never, badthing, "")
1327 #define you_have_never(badthing) \
1328 enl_msg(badthing, "
\82Ä
\82¢
\82È
\82¢", "
\82È
\82©
\82Á
\82½", "", "")
1331 #define you_have_X(something) \
1332 enl_msg(You_, have, (const char *) "", something, "")
1334 #define you_have_X(something) \
1335 enl_msg(something, "
\82Ä
\82¢
\82é", "
\82½", "", "")
1338 #define you_are_ing(goodthing, ps) enl_msg(You_, iru, ita, goodthing, ps)
1342 enlght_line(start, middle, end, ps)
1343 const char *start, *middle, *end, *ps;
1348 Sprintf(buf, " %s%s%s%s.", start, middle, end, ps);
1350 Sprintf(buf, "%s%s%s%s
\81D", start, middle, end, ps);
1351 putstr(en_win, 0, buf);
1354 /* format increased chance to hit or damage or defense (Protection) */
1356 enlght_combatinc(inctyp, incamt, final, outbuf)
1361 const char *modif, *bonus;
1365 absamt = abs(incamt);
1366 /* Protection amount is typically larger than damage or to-hit;
1367 reduce magnitude by a third in order to stretch modifier ranges
1368 (small:1..5, moderate:6..10, large:11..19, huge:20+) */
1369 if (!strcmp(inctyp, "defense"))
1370 absamt = (absamt * 2) / 3;
1376 modif = "
\8bÍ
\82©
\82È";
1377 else if (absamt <= 6)
1381 modif = "
\92\86\92ö
\93x
\82Ì";
1382 else if (absamt <= 12)
1386 modif = "
\91å
\82«
\82È";
1391 modif = "
\8b
\91å
\82È";
1394 modif = !incamt ? "no" : an(modif); /* ("no" case shouldn't happen) */
1397 bonus = (incamt >= 0) ? "bonus" : "penalty";
1399 bonus = (incamt > 0) ? "
\83{
\81[
\83i
\83X" : "
\83y
\83i
\83\8b\83e
\83B";
1400 /* "bonus <foo>" (to hit) vs "<bar> bonus" (damage, defense) */
1401 invrt = strcmp(inctyp, "to hit") ? TRUE : FALSE;
1404 Sprintf(outbuf, "%s %s %s", modif, invrt ? inctyp : bonus,
1405 invrt ? bonus : inctyp);
1407 Sprintf(outbuf, "%s
\82É%s%s", inctyp, modif, bonus);
1409 if (final || wizard)
1410 Sprintf(eos(outbuf), " (%s%d)", (incamt > 0) ? "+" : "", incamt);
1415 /* report half physical or half spell damage */
1417 enlght_halfdmg(category, final)
1421 const char *category_name;
1426 category_name = "physical";
1429 category_name = "spell";
1432 category_name = "unknown";
1435 Sprintf(buf, " %s %s damage", (final || wizard) ? "half" : "reduced",
1437 enl_msg(You_, "take", "took", buf, from_what(category));
1440 /* is hero actively using water walking capability on water (or lava)? */
1444 if (u.uinwater || Levitation || Flying)
1446 return (boolean) (Wwalking
1447 && (is_pool(u.ux, u.uy) || is_lava(u.ux, u.uy)));
1450 /* check whether hero is wearing something that player definitely knows
1451 confers the target property; item must have been seen and its type
1452 discovered but it doesn't necessarily have to be fully identified */
1454 cause_known(propindx)
1455 int propindx; /* index of a property which can be conveyed by worn item */
1457 register struct obj *o;
1458 long mask = W_ARMOR | W_AMUL | W_RING | W_TOOL;
1460 /* simpler than from_what()/what_gives(); we don't attempt to
1461 handle artifacts and we deliberately ignore wielded items */
1462 for (o = invent; o; o = o->nobj) {
1463 if (!(o->owornmask & mask))
1465 if ((int) objects[o->otyp].oc_oprop == propindx
1466 && objects[o->otyp].oc_name_known && o->dknown)
1472 /* format a characteristic value, accommodating Strength's strangeness */
1474 attrval(attrindx, attrvalue, resultbuf)
1475 int attrindx, attrvalue;
1476 char resultbuf[]; /* should be at least [7] to hold "18/100\0" */
1478 if (attrindx != A_STR || attrvalue <= 18)
1479 Sprintf(resultbuf, "%d", attrvalue);
1480 else if (attrvalue > STR18(100)) /* 19 to 25 */
1481 Sprintf(resultbuf, "%d", attrvalue - 100);
1482 else /* simplify "18/ **" to be "18/100" */
1483 Sprintf(resultbuf, "18/%02d", attrvalue - 18);
1488 enlightenment(mode, final)
1489 int mode; /* BASICENLIGHTENMENT | MAGICENLIGHTENMENT (| both) */
1490 int final; /* ENL_GAMEINPROGRESS:0, ENL_GAMEOVERALIVE, ENL_GAMEOVERDEAD */
1492 char buf[BUFSZ], tmpbuf[BUFSZ];
1494 Strcpy(tmpbuf, plname);
1495 *tmpbuf = highc(*tmpbuf); /* same adjustment as bottom line */
1496 /* as in background_enlightenment, when poly'd we need to use the saved
1497 gender in u.mfemale rather than the current you-as-monster gender */
1499 Sprintf(buf, "%s the %s's attributes:", tmpbuf,
1500 ((Upolyd ? u.mfemale : flags.female) && urole.name.f)
1504 Sprintf(buf, "%s
\82Ì%s
\82Ì
\91®
\90«:",
1505 ((Upolyd ? u.mfemale : flags.female) && urole.name.f)
1511 en_win = create_nhwindow(NHW_MENU);
1513 putstr(en_win, 0, buf); /* "Conan the Archeologist's attributes:" */
1514 /* background and characteristics; ^X or end-of-game disclosure */
1515 if (mode & BASICENLIGHTENMENT) {
1516 /* role, race, alignment, deities */
1517 background_enlightenment(mode, final);
1518 /* strength, dexterity, &c */
1519 characteristics_enlightenment(mode, final);
1521 /* expanded status line information, including things which aren't
1522 included there due to space considerations--such as obvious
1523 alternative movement indicators (riding, levitation, &c), and
1524 various troubles (turning to stone, trapped, confusion, &c);
1525 shown for both basic and magic enlightenment */
1526 status_enlightenment(mode, final);
1527 /* remaining attributes; shown for potion,&c or wizard mode and
1528 explore mode ^X or end of game disclosure */
1529 if (mode & MAGICENLIGHTENMENT) {
1530 /* intrinsics and other traditional enlightenment feedback */
1531 attributes_enlightenment(mode, final);
1533 display_nhwindow(en_win, TRUE);
1534 destroy_nhwindow(en_win);
1539 /* display role, race, alignment and such to en_win */
1541 background_enlightenment(unused_mode, final)
1542 int unused_mode UNUSED;
1545 const char *role_titl, *rank_titl;
1546 int innategend, difgend, difalgn;
1547 char buf[BUFSZ], tmpbuf[BUFSZ];
1549 /* note that if poly'd, we need to use u.mfemale instead of flags.female
1550 to access hero's saved gender-as-human/elf/&c rather than current one */
1551 innategend = (Upolyd ? u.mfemale : flags.female) ? 1 : 0;
1552 role_titl = (innategend && urole.name.f) ? urole.name.f : urole.name.m;
1553 rank_titl = rank_of(u.ulevel, Role_switch, innategend);
1555 putstr(en_win, 0, ""); /* separator after title */
1557 putstr(en_win, 0, "Background:");
1559 putstr(en_win, 0, "
\94w
\8ci
\8fî
\95ñ:");
1561 /* if polymorphed, report current shape before underlying role;
1562 will be repeated as first status: "you are transformed" and also
1563 among various attributes: "you are in beast form" (after being
1564 told about lycanthropy) or "you are polymorphed into <a foo>"
1565 (with countdown timer appended for wizard mode); we really want
1566 the player to know he's not a samurai at the moment... */
1568 struct permonst *uasmon = youmonst.data;
1571 /* here we always use current gender, not saved role gender */
1572 if (!is_male(uasmon) && !is_female(uasmon) && !is_neuter(uasmon))
1574 Sprintf(tmpbuf, "%s ", genders[flags.female ? 1 : 0].adj);
1576 Sprintf(tmpbuf, "%s
\82Ì", genders[flags.female ? 1 : 0].adj);
1578 Sprintf(buf, "%sin %s%s form", !final ? "currently " : "", tmpbuf,
1581 Sprintf(buf, "%s%s%s
\82Ì
\8ep", !final ? "
\8d¡
\82Ì
\82Æ
\82±
\82ë" : "", tmpbuf,
1587 /* report role; omit gender if it's redundant (eg, "female priestess") */
1590 && ((urole.allow & ROLE_GENDMASK) == (ROLE_MALE | ROLE_FEMALE)
1591 || innategend != flags.initgend))
1593 Sprintf(tmpbuf, "%s ", genders[innategend].adj);
1595 Sprintf(tmpbuf, "%s", genders[innategend].adj);
1599 Strcpy(buf, "actually "); /* "You are actually a ..." */
1601 Strcpy(buf, "
\8eÀ
\8dÛ
\82É
\82Í"); /* "
\82 \82È
\82½
\82Í
\8eÀ
\8dÛ
\82É
\82Í..." */
1603 if (!strcmpi(rank_titl, role_titl)) {
1604 /* omit role when rank title matches it */
1606 Sprintf(eos(buf), "%s, level %d %s%s", an(rank_titl), u.ulevel,
1607 tmpbuf, urace.noun);
1609 Sprintf(eos(buf), "
\83\8c\83x
\83\8b%d
\82Ì%s
\82Ì%s%s", u.ulevel,
1610 tmpbuf, urace.adj, role_titl);
1614 Sprintf(eos(buf), "%s, a level %d %s%s %s", an(rank_titl), u.ulevel,
1615 tmpbuf, urace.adj, role_titl);
1617 Sprintf(eos(buf), "
\83\8c\83x
\83\8b%d
\82Ì%s
\82Ì%s%s
\82Ì%s", u.ulevel,
1618 tmpbuf, urace.adj, role_titl, rank_titl);
1623 /* report alignment (bypass you_are() in order to omit ending period) */
1625 Sprintf(buf, " %s%s%s, %son a mission for %s",
1626 You_, !final ? are : were,
1627 align_str(u.ualign.type),
1628 /* helm of opposite alignment (might hide conversion) */
1629 (u.ualign.type != u.ualignbase[A_CURRENT]) ? "temporarily "
1630 /* permanent conversion */
1631 : (u.ualign.type != u.ualignbase[A_ORIGINAL]) ? "now "
1632 /* atheist (ignored in very early game) */
1633 : (!u.uconduct.gnostic && moves > 1000L) ? "nominally "
1634 /* lastly, normal case */
1638 Sprintf(buf, "
\82 \82È
\82½
\82Í%s
\82Å, %s%s
\82Ì
\82½
\82ß
\82Ì
\94C
\96±
\82ð
\8ds
\82Á
\82Ä%s
\81D",
1639 align_str(u.ualign.type),
1640 /* helm of opposite alignment (might hide conversion) */
1641 (u.ualign.type != u.ualignbase[A_CURRENT]) ? "
\88ê
\8e\9e\93I
\82É"
1642 /* permanent conversion */
1643 : (u.ualign.type != u.ualignbase[A_ORIGINAL]) ? "
\8c»
\8dÝ"
1644 /* atheist (ignored in very early game) */
1645 : (!u.uconduct.gnostic && moves > 1000L) ? "
\96¼
\8b`
\8fã"
1646 /* lastly, normal case */
1648 u_gname(), !final ? iru : ita);
1650 putstr(en_win, 0, buf);
1651 /* show the rest of this game's pantheon (finishes previous sentence)
1652 [appending "also Moloch" at the end would allow for straightforward
1653 trailing "and" on all three aligned entries but looks too verbose] */
1655 Sprintf(buf, " who %s opposed by", !final ? "is" : "was");
1657 Strcpy(buf, "
\82 \82È
\82½
\82Í");
1659 if (u.ualign.type != A_LAWFUL)
1661 Sprintf(eos(buf), " %s (%s) and", align_gname(A_LAWFUL),
1662 align_str(A_LAWFUL));
1664 Sprintf(eos(buf), "%s(%s)
\82¨
\82æ
\82Ñ", align_gname(A_LAWFUL),
1665 align_str(A_LAWFUL));
1667 if (u.ualign.type != A_NEUTRAL)
1669 Sprintf(eos(buf), " %s (%s)%s", align_gname(A_NEUTRAL),
1670 align_str(A_NEUTRAL),
1671 (u.ualign.type != A_CHAOTIC) ? " and" : "");
1673 Sprintf(eos(buf), "%s(%s)%s", align_gname(A_NEUTRAL),
1674 align_str(A_NEUTRAL),
1675 (u.ualign.type != A_CHAOTIC) ? "
\82¨
\82æ
\82Ñ" : "");
1678 if (u.ualign.type != A_CHAOTIC)
1679 Sprintf(eos(buf), " %s (%s)", align_gname(A_CHAOTIC),
1680 align_str(A_CHAOTIC));
1682 if (u.ualign.type != A_CHAOTIC)
1683 Sprintf(eos(buf), "%s(%s)", align_gname(A_CHAOTIC),
1684 align_str(A_CHAOTIC));
1687 Strcat(buf, "."); /* terminate sentence */
1689 Sprintf(eos(buf), "
\82Æ
\91Î
\97§
\82µ
\82Ä%s
\81D", !final ? iru : ita);
1691 putstr(en_win, 0, buf);
1693 /* show original alignment,gender,race,role if any have been changed;
1694 giving separate message for temporary alignment change bypasses need
1695 for tricky phrasing otherwise necessitated by possibility of having
1696 helm of opposite alignment mask a permanent alignment conversion */
1697 difgend = (innategend != flags.initgend);
1698 difalgn = (((u.ualign.type != u.ualignbase[A_CURRENT]) ? 1 : 0)
1699 + ((u.ualignbase[A_CURRENT] != u.ualignbase[A_ORIGINAL])
1701 if (difalgn & 1) { /* have temporary alignment so report permanent one */
1703 Sprintf(buf, "actually %s", align_str(u.ualignbase[A_CURRENT]));
1705 Sprintf(buf, "
\8eÀ
\8dÛ
\82É
\82Í%s", align_str(u.ualignbase[A_CURRENT]));
1707 difalgn &= ~1; /* suppress helm from "started out <foo>" message */
1709 if (difgend || difalgn) { /* sex change or perm align change or both */
1711 Sprintf(buf, " You started out %s%s%s.",
1712 difgend ? genders[flags.initgend].adj : "",
1713 (difgend && difalgn) ? " and " : "",
1714 difalgn ? align_str(u.ualignbase[A_ORIGINAL]) : "");
1716 Sprintf(buf, "
\82 \82È
\82½
\82Í%s%s%s
\82Å
\8aJ
\8en
\82µ
\82½
\81D",
1717 difgend ? genders[flags.initgend].adj : "",
1718 (difgend && difalgn) ? "
\82©
\82Â" : "",
1719 difalgn ? align_str(u.ualignbase[A_ORIGINAL]) : "");
1721 putstr(en_win, 0, buf);
1725 /* characteristics: expanded version of bottom line strength, dexterity, &c */
1727 characteristics_enlightenment(mode, final)
1731 putstr(en_win, 0, ""); /* separator after background */
1734 final ? "Final Characteristics:" : "Current Characteristics:");
1736 final ? "
\8dÅ
\8fI
\91®
\90«
\81F" : "
\8c»
\8dÝ
\82Ì
\91®
\90«
\81F");
1738 /* bottom line order */
1739 one_characteristic(mode, final, A_STR); /* strength */
1740 one_characteristic(mode, final, A_DEX); /* dexterity */
1741 one_characteristic(mode, final, A_CON); /* constitution */
1742 one_characteristic(mode, final, A_INT); /* intelligence */
1743 one_characteristic(mode, final, A_WIS); /* wisdom */
1744 one_characteristic(mode, final, A_CHA); /* charisma */
1747 /* display one attribute value for characteristics_enlightenment() */
1749 one_characteristic(mode, final, attrindx)
1750 int mode, final, attrindx;
1752 boolean hide_innate_value = FALSE, interesting_alimit;
1753 int acurrent, abase, apeak, alimit;
1754 const char *attrname, *paren_pfx;
1755 char subjbuf[BUFSZ], valubuf[BUFSZ], valstring[32];
1757 /* being polymorphed or wearing certain cursed items prevents
1758 hero from reliably tracking changes to characteristics so
1759 we don't show base & peak values then; when the items aren't
1760 cursed, hero could take them off to check underlying values
1761 and we show those in such case so that player doesn't need
1762 to actually resort to doing that */
1764 hide_innate_value = TRUE;
1765 } else if (Fixed_abil) {
1766 if (stuck_ring(uleft, RIN_SUSTAIN_ABILITY)
1767 || stuck_ring(uright, RIN_SUSTAIN_ABILITY))
1768 hide_innate_value = TRUE;
1773 attrname = "strength";
1775 attrname = "
\8b
\82³";
1776 if (uarmg && uarmg->otyp == GAUNTLETS_OF_POWER && uarmg->cursed)
1777 hide_innate_value = TRUE;
1781 attrname = "dexterity";
1783 attrname = "
\91f
\91\81\82³";
1787 attrname = "constitution";
1789 attrname = "
\91Ï
\8bv
\97Í";
1793 attrname = "intelligence";
1795 attrname = "
\92m
\97Í";
1796 if (uarmh && uarmh->otyp == DUNCE_CAP && uarmh->cursed)
1797 hide_innate_value = TRUE;
1801 attrname = "wisdom";
1803 attrname = "
\8c«
\82³";
1804 if (uarmh && uarmh->otyp == DUNCE_CAP && uarmh->cursed)
1805 hide_innate_value = TRUE;
1809 attrname = "charisma";
1811 attrname = "
\96£
\97Í";
1814 return; /* impossible */
1816 /* note: final disclosure includes MAGICENLIGHTENTMENT */
1817 if ((mode & MAGICENLIGHTENMENT) && !Upolyd)
1818 hide_innate_value = FALSE;
1820 acurrent = ACURR(attrindx);
1821 (void) attrval(attrindx, acurrent, valubuf); /* Sprintf(valubuf,"%d",) */
1823 Sprintf(subjbuf, "Your %s ", attrname);
1825 Sprintf(subjbuf, "
\82 \82È
\82½
\82Ì%s
\82Í", attrname);
1827 if (!hide_innate_value) {
1828 /* show abase, amax, and/or attrmax if acurr doesn't match abase
1829 (a magic bonus or penalty is in effect) or abase doesn't match
1830 amax (some points have been lost to poison or exercise abuse
1831 and are restorable) or attrmax is different from normal human
1832 (while game is in progress; trying to reduce dependency on
1833 spoilers to keep track of such stuff) or attrmax was different
1834 from abase (at end of game; this attribute wasn't maxed out) */
1835 abase = ABASE(attrindx);
1836 apeak = AMAX(attrindx);
1837 alimit = ATTRMAX(attrindx);
1838 /* criterium for whether the limit is interesting varies */
1839 interesting_alimit =
1840 final ? TRUE /* was originally `(abase != alimit)' */
1841 : (alimit != (attrindx != A_STR ? 18 : STR18(100)));
1843 paren_pfx = final ? " (" : " (current; ";
1845 paren_pfx = final ? " (" : " (
\8c»
\8dÝ; ";
1846 if (acurrent != abase) {
1848 Sprintf(eos(valubuf), "%sbase:%s", paren_pfx,
1849 attrval(attrindx, abase, valstring));
1851 Sprintf(eos(valubuf), "%s
\8aî
\96{:%s", paren_pfx,
1852 attrval(attrindx, abase, valstring));
1856 if (abase != apeak) {
1858 Sprintf(eos(valubuf), "%speak:%s", paren_pfx,
1859 attrval(attrindx, apeak, valstring));
1861 Sprintf(eos(valubuf), "%s
\8dÅ
\91å:%s", paren_pfx,
1862 attrval(attrindx, apeak, valstring));
1866 if (interesting_alimit) {
1868 Sprintf(eos(valubuf), "%s%slimit:%s", paren_pfx,
1869 /* more verbose if exceeding 'limit' due to magic bonus */
1870 (acurrent > alimit) ? "innate " : "",
1871 attrval(attrindx, alimit, valstring));
1873 Sprintf(eos(valubuf), "%s%s
\8fã
\8cÀ:%s", paren_pfx,
1874 /* more verbose if exceeding 'limit' due to magic bonus */
1875 (acurrent > alimit) ? "
\96{
\97\88\82Ì" : "",
1876 attrval(attrindx, alimit, valstring));
1878 /* paren_pfx = ", "; */
1880 if (acurrent != abase || abase != apeak || interesting_alimit)
1881 Strcat(valubuf, ")");
1884 enl_msg(subjbuf, "is ", "was ", valubuf, "");
1886 enl_msg(subjbuf, "
\82¾", "
\82¾
\82Á
\82½", valubuf, "");
1889 /* status: selected obvious capabilities, assorted troubles */
1891 status_enlightenment(mode, final)
1895 boolean magic = (mode & MAGICENLIGHTENMENT) ? TRUE : FALSE;
1897 char buf[BUFSZ], youtoo[BUFSZ];
1898 boolean Riding = (u.usteed
1899 /* if hero dies while dismounting, u.usteed will still
1900 be set; we want to ignore steed in that situation */
1901 && !(final == ENL_GAMEOVERDEAD
1903 && !strcmp(killer.name, "riding accident")));
1905 && !strcmp(killer.name, "
\8bR
\8fæ
\8e\96\8cÌ
\82Å")));
1906 const char *steedname = (!Riding ? (char *) 0
1907 : x_monnam(u.usteed,
1908 u.usteed->mtame ? ARTICLE_YOUR : ARTICLE_THE,
1910 (SUPPRESS_SADDLE | SUPPRESS_HALLUCINATION),
1914 * Status (many are abbreviated on bottom line; others are or
1915 * should be discernible to the hero hence to the player)
1917 putstr(en_win, 0, ""); /* separator after title or characteristics */
1919 putstr(en_win, 0, final ? "Final Status:" : "Current Status:");
1921 putstr(en_win, 0, final ? "
\8dÅ
\8fI
\8fó
\91Ô:" : "
\8c»
\8dÝ
\82Ì
\8fó
\91Ô:");
1923 Strcpy(youtoo, You_);
1924 /* not a traditional status but inherently obvious to player; more
1925 detail given below (attributes section) for magic enlightenment */
1928 you_are("transformed", "");
1930 you_are_ing("
\95Ï
\89»
\82µ
\82Ä", "");
1931 /* not a trouble, but we want to display riding status before maybe
1932 reporting steed as trapped or hero stuck to cursed saddle */
1935 Sprintf(buf, "riding %s", steedname);
1938 Sprintf(buf, "%s
\82É
\8fæ
\82Á
\82Ä", steedname);
1939 you_are_ing(buf, "");
1942 Sprintf(eos(youtoo), "and %s ", steedname);
1944 Sprintf(youtoo, "
\82 \82È
\82½
\82Æ%s
\82Í", steedname);
1946 /* other movement situations that hero should always know */
1948 if (Lev_at_will && magic)
1950 you_are("levitating, at will", "");
1952 you_are_ing("
\8e©
\95ª
\82Ì
\88Ó
\8eu
\82Å
\95\82\97V
\82µ
\82Ä", "");
1955 enl_msg(youtoo, are, were, "levitating", from_what(LEVITATION));
1957 enl_msg(youtoo, "
\82¢
\82é", "
\82¢
\82½", "
\95\82\97V
\82µ
\82Ä", from_what(LEVITATION));
1958 } else if (Flying) { /* can only fly when not levitating */
1960 enl_msg(youtoo, are, were, "flying", from_what(FLYING));
1962 enl_msg(youtoo, "
\82¢
\82é", "
\82¢
\82½", "
\94ò
\82ñ
\82Å", from_what(FLYING));
1966 you_are("underwater", "");
1968 enl_msg(You_, "
\82¢
\82é", "
\82¢
\82½", "
\90\85\96Ê
\89º
\82É", "");
1969 } else if (u.uinwater) {
1971 you_are(Swimming ? "swimming" : "in water", from_what(SWIMMING));
1973 enl_msg(You_, Swimming ? "
\89j
\82¢
\82Å" : "
\90\85\92\86\82É", "
\82¢
\82é", "
\82¢
\82½", from_what(SWIMMING));
1974 } else if (walking_on_water()) {
1975 /* show active Wwalking here, potential Wwalking elsewhere */
1977 Sprintf(buf, "walking on %s",
1978 is_pool(u.ux, u.uy) ? "water"
1979 : is_lava(u.ux, u.uy) ? "lava"
1980 : surface(u.ux, u.uy)); /* catchall; shouldn't happen */
1981 you_are(buf, from_what(WWALKING));
1983 Sprintf(buf, "%
\82Ì
\8fã
\82ð
\95à
\82¢
\82Ä",
1984 is_pool(u.ux, u.uy) ? "
\90\85"
1985 : is_lava(u.ux, u.uy) ? "
\97n
\8aâ"
1986 : surface(u.ux, u.uy)); /* catchall; shouldn't happen */
1987 you_are_ing(buf, from_what(WWALKING));
1990 if (Upolyd && (u.uundetected || youmonst.m_ap_type != M_AP_NOTHING))
1991 youhiding(TRUE, final);
1993 /* internal troubles, mostly in the order that prayer ranks them */
1996 you_are("turning to stone", "");
1998 enl_msg("
\82 \82È
\82½
\82Í", "
\82È
\82è
\82Â
\82Â
\82 \82é", "
\82È
\82Á
\82½", "
\90Î
\82É", "");
2001 you_are("turning into slime", "");
2003 enl_msg("
\82 \82È
\82½
\82Í", "
\82È
\82è
\82Â
\82Â
\82 \82é", "
\82È
\82Á
\82½", "
\83X
\83\89\83C
\83\80\82É", "");
2007 you_are("buried", "");
2009 you_are_ing("
\92\82\91§
\82µ
\82Ä", "");
2012 Strcpy(buf, "being strangled");
2014 Strcpy(buf, "
\8eñ
\82ð
\8di
\82ß
\82ç
\82ê
\82Ä");
2016 Sprintf(eos(buf), " (%ld)", (Strangled & TIMEOUT));
2018 you_are(buf, from_what(STRANGLED));
2020 enl_msg("
\82 \82È
\82½
\82Í", "
\82¢
\82é", "
\82¢
\82½", buf, from_what(STRANGLED));
2024 /* prayer lumps these together; botl puts Ill before FoodPois */
2025 if (u.usick_type & SICK_NONVOMITABLE)
2027 you_are("terminally sick from illness", "");
2029 enl_msg("
\82 \82È
\82½
\82Í
\95a
\8bC
\82Å
\92v
\96½
\93I
\82É
\8bC
\95ª
\82ª
\88«", "
\82¢", "
\82©
\82Á
\82½", "", "");
2030 if (u.usick_type & SICK_VOMITABLE)
2032 you_are("terminally sick from food poisoning", "");
2034 enl_msg("
\82 \82È
\82½
\82Í
\90H
\92\86\93Å
\82Å
\92v
\96½
\93I
\82É
\8bC
\95ª
\82ª
\88«", "
\82¢", "
\82©
\82Á
\82½", "", "");
2038 you_are("nauseated", "");
2040 enl_msg(You_, "
\93f
\82«
\8bC
\82ª", "
\82 \82é", "
\82 \82Á
\82½", "");
2043 you_are("stunned", "");
2045 you_are("
\82
\82ç
\82
\82ç
\8fó
\91Ô", "");
2048 you_are("confused", "");
2050 you_are("
\8d¬
\97\90\8fó
\91Ô", "");
2053 you_are("hallucinating", "");
2055 you_are("
\8c¶
\8ao
\8fó
\91Ô", "");
2057 /* from_what() (currently wizard-mode only) checks !haseyes()
2058 before u.uroleplay.blind, so we should too */
2060 Sprintf(buf, "%s blind",
2061 !haseyes(youmonst.data) ? "innately"
2062 : u.uroleplay.blind ? "permanently"
2063 /* better phrasing desperately wanted... */
2064 : Blindfolded_only ? "deliberately"
2067 Sprintf(buf, "%s
\96Ó
\96Ú",
2068 !haseyes(youmonst.data) ? "
\90¶
\82Ü
\82ê
\82È
\82ª
\82ç
\82É"
2069 : u.uroleplay.blind ? "
\8dP
\8bv
\93I
\82É"
2070 /* better phrasing desperately wanted... */
2071 : Blindfolded_only ? "
\8cÌ
\88Ó
\82É"
2072 : "
\88ê
\8e\9e\93I
\82É");
2074 if (wizard && (Blinded & TIMEOUT) != 0L
2075 && !u.uroleplay.blind && haseyes(youmonst.data))
2076 Sprintf(eos(buf), " (%ld)", (Blinded & TIMEOUT));
2077 /* !haseyes: avoid "you are innately blind innately" */
2078 you_are(buf, !haseyes(youmonst.data) ? "" : from_what(BLINDED));
2082 you_are("deaf", from_what(DEAF));
2084 you_are("
\8e¨
\82ª
\95·
\82±
\82¦
\82È
\82¢
\8fó
\91Ô", from_what(DEAF));
2086 /* external troubles, more or less */
2090 Sprintf(buf, "chained to %s", ansimpleoname(uball));
2092 Sprintf(buf, "%s
\82É
\82Â
\82È
\82ª
\82ê
\82Ä", ansimpleoname(uball));
2094 impossible("Punished without uball?");
2096 Strcpy(buf, "punished");
2098 Strcpy(buf, "
\94±
\82ð
\8eó
\82¯
\82Ä");
2103 you_are_ing(buf, "");
2106 char predicament[BUFSZ];
2108 boolean anchored = (u.utraptype == TT_BURIEDBALL);
2112 Strcpy(predicament, "tethered to something buried");
2114 Strcpy(predicament, "
\89½
\82©
\96\84\82Ü
\82Á
\82Ä
\82¢
\82é
\82à
\82Ì
\82É
\82Â
\82È
\82ª
\82ê
\82Ä");
2115 } else if (u.utraptype == TT_INFLOOR || u.utraptype == TT_LAVA) {
2117 Sprintf(predicament, "stuck in %s", the(surface(u.ux, u.uy)));
2119 Sprintf(predicament, "%s
\82É
\96\84\82Ü
\82Á
\82Ä", surface(u.ux, u.uy));
2122 Strcpy(predicament, "trapped");
2123 if ((t = t_at(u.ux, u.uy)) != 0)
2124 Sprintf(eos(predicament), " in %s",
2125 an(defsyms[trap_to_defsym(t->ttyp)].explanation));
2127 predicament[0] = '\0';
2128 if ((t = t_at(u.ux, u.uy)) != 0)
2129 Sprintf(predicament, "%s
\82É",
2130 defsyms[trap_to_defsym(t->ttyp)].explanation);
2131 Strcat(predicament, "
\82Ð
\82Á
\82©
\82©
\82Á
\82Ä");
2134 if (u.usteed) { /* not `Riding' here */
2136 Sprintf(buf, "%s%s ", anchored ? "you and " : "", steedname);
2138 enl_msg(buf, (anchored ? "are " : "is "),
2139 (anchored ? "were " : "was "), predicament, "");
2141 Sprintf(buf, "%s%s
\82Í", anchored ? "
\82 \82È
\82½
\82Æ" : "", steedname);
2142 enl_msg(buf, "
\82¢
\82é", "
\82¢
\82½" , predicament, "");
2145 you_are(predicament, "");
2149 Sprintf(buf, "swallowed by %s", a_monnam(u.ustuck));
2151 Sprintf(buf, "%s
\82É
\88ù
\82Ý
\8d\9e\82Ü
\82ê
\82Ä", a_monnam(u.ustuck));
2153 Sprintf(eos(buf), " (%u)", u.uswldtim);
2155 } else if (u.ustuck) {
2157 Sprintf(buf, "%s %s",
2158 (Upolyd && sticks(youmonst.data)) ? "holding" : "held by",
2159 a_monnam(u.ustuck));
2162 Sprintf(buf, "%s%s",
2164 (Upolyd && sticks(youmonst.data)) ? "
\82ð
\95ß
\82Ü
\82¦
\82Ä" : "
\82É
\95ß
\82Ü
\82Á
\82Ä");
2165 you_are_ing(buf, "");
2169 struct obj *saddle = which_armor(u.usteed, W_SADDLE);
2171 if (saddle && saddle->cursed) {
2172 Sprintf(buf, "stuck to %s %s", s_suffix(steedname),
2173 simpleonames(saddle));
2178 /* when mounted, Wounded_legs applies to steed rather than to
2179 hero; we only report steed's wounded legs in wizard mode */
2180 if (u.usteed) { /* not `Riding' here */
2181 if (wizard && steedname) {
2183 Strcpy(buf, steedname);
2185 enl_msg(buf, " has", " had", " wounded legs", "");
2187 enl_msg(buf, iru, ita, "
\82Í
\8e\88\82ð
\89ö
\89ä
\82µ
\82Ä", "");
2192 Sprintf(buf, "wounded %s", makeplural(body_part(LEG)));
2195 Sprintf(buf, "%s
\82ð
\89ö
\89ä
\82µ
\82Ä", makeplural(body_part(LEG)));
2196 you_are_ing(buf, "");
2202 Sprintf(buf, "slippery %s", makeplural(body_part(FINGER)));
2205 Sprintf(buf, "%s
\82ª
\82Ê
\82é
\82Ê
\82é
\82µ
\82Ä", body_part(FINGER));
2206 enl_msg(buf, iru, ita, "", "");
2210 if (magic || cause_known(FUMBLING))
2212 enl_msg(You_, "fumble", "fumbled", "", from_what(FUMBLING));
2214 you_are_ing("
\95s
\8aí
\97p
\82É
\82È
\82Á
\82Ä", from_what(FUMBLING));
2217 if (magic || cause_known(SLEEPY)) {
2218 Strcpy(buf, from_what(SLEEPY));
2220 Sprintf(eos(buf), " (%ld)", (HSleepy & TIMEOUT));
2222 enl_msg("You ", "fall", "fell", " asleep uncontrollably", buf);
2224 you_are_ing("
\96°
\82Á
\82Ä", buf);
2227 /* hunger/nutrition */
2229 if (magic || cause_known(HUNGER))
2231 enl_msg(You_, "hunger", "hungered", " rapidly",
2234 enl_msg("
\82 \82È
\82½
\82Í
\82·
\82®
\82É
\95 \82ª
\8c¸
\82é
\8fó
\91Ô", "
\82Å
\82 \82é", "
\82¾
\82Á
\82½", "", "");
2237 Strcpy(buf, hu_stat[u.uhs]); /* hunger status; omitted if "normal" */
2238 mungspaces(buf); /* strip trailing spaces */
2241 *buf = lowc(*buf); /* override capitalization */
2242 if (!strcmp(buf, "weak"))
2243 Strcat(buf, " from severe hunger");
2244 else if (!strncmp(buf, "faint", 5)) /* fainting, fainted */
2245 Strcat(buf, " due to starvation");
2248 Strcat(buf, "
\8fó
\91Ô");
2253 if ((cap = near_capacity()) > UNENCUMBERED) {
2255 const char *adj = "?_?"; /* (should always get overridden) */
2257 Strcpy(buf, enc_stat[cap]);
2262 break; /* burdened */
2265 break; /* stressed */
2268 break; /* strained */
2271 break; /* overtaxed */
2273 adj = "not possible";
2276 Sprintf(eos(buf), "; movement %s %s%s", !final ? "is" : "was", adj,
2277 (cap < OVERLOADED) ? " slowed" : "");
2280 Sprintf(buf, "
\89×
\95¨
\82É
\82æ
\82Á
\82Ä%s
\8fó
\91Ô", enc_stat[cap]);
2284 /* last resort entry, guarantees Status section is non-empty
2285 (no longer needed for that purpose since weapon status added;
2286 still useful though) */
2288 you_are("unencumbered", "");
2290 you_are("
\89×
\95¨
\82Í
\8e×
\96\82\82É
\82È
\82ç
\82È
\82¢
\8fó
\91Ô", "");
2292 /* report being weaponless; distinguish whether gloves are worn */
2295 you_are(uarmg ? "empty handed" /* gloves imply hands */
2296 : humanoid(youmonst.data)
2297 /* hands but no weapon and no gloves */
2299 /* alternate phrasing for paws or lack of hands */
2300 : "not wielding anything",
2303 enl_msg(You_, "
\82¢", "
\82©
\82Á
\82½", "
\95\90\8aí
\82ð
\91\95\94õ
\82µ
\82Ä
\82¢
\82È", "");
2305 /* two-weaponing implies a weapon (not other odd stuff) in each hand */
2306 } else if (u.twoweap) {
2308 you_are("wielding two weapons at once", "");
2310 you_are("
\93ñ
\93\81\97¬", "");
2311 /* report most weapons by their skill class (so a katana will be
2312 described as a long sword, for instance; mattock and hook are
2313 exceptions), or wielded non-weapon item by its object class */
2315 const char *what = weapon_descr(uwep);
2318 if (!strcmpi(what, "armor") || !strcmpi(what, "food")
2319 || !strcmpi(what, "venom"))
2320 Sprintf(buf, "wielding some %s", what);
2322 Sprintf(buf, "wielding %s",
2323 (uwep->quan == 1L) ? an(what) : makeplural(what));
2326 Sprintf(buf, "%s
\82ð
\91\95\94õ
\82µ
\82Ä", what);
2327 enl_msg(You_, "
\82¢
\82é", "
\82¢
\82½", buf, "");
2330 /* report 'nudity' */
2331 if (!uarm && !uarmu && !uarmc && !uarmg && !uarmf && !uarmh) {
2332 if (u.uroleplay.nudist)
2334 enl_msg(You_, "do", "did", " not wear any armor", "");
2336 enl_msg(You_, "
\82¢", "
\82©
\82Á
\82½", "
\89½
\82Ì
\8aZ
\82à
\91\95\94õ
\82µ
\82È", "");
2340 you_are("not wearing any armor", "");
2342 enl_msg(You_, "
\82¢", "
\82©
\82Á
\82½", "
\89½
\82Ì
\8aZ
\82à
\91\95\94õ
\82µ
\82Ä
\82¢
\82È", "");
2347 /* attributes: intrinsics and the like, other non-obvious capabilities */
2349 attributes_enlightenment(unused_mode, final)
2350 int unused_mode UNUSED;
2353 static NEARDATA const char if_surroundings_permitted[] =
2354 " if surroundings permitted";
2361 putstr(en_win, 0, "");
2363 putstr(en_win, 0, final ? "Final Attributes:" : "Current Attributes:");
2365 putstr(en_win, 0, final ? "
\8dÅ
\8fI
\91®
\90«:" : "
\8c»
\8dÝ
\82Ì
\91®
\90«:");
2367 if (u.uevent.uhand_of_elbereth) {
2369 static const char *const hofe_titles[3] = { "the Hand of Elbereth",
2370 "the Envoy of Balance",
2371 "the Glory of Arioch" };
2373 static const char *const hofe_titles[3] = { "
\83G
\83\8b\83x
\83\8c\83X
\82Ì
\8cä
\8eè",
2374 "
\92²
\98a
\82Ì
\8eg
\8eÒ",
2375 "
\83A
\83\8a\83I
\83b
\83`
\82Ì
\96¼
\97_" };
2377 you_are(hofe_titles[u.uevent.uhand_of_elbereth - 1], "");
2380 /* note: piousness 20 matches MIN_QUEST_ALIGN (quest.h) */
2381 if (u.ualign.record >= 20)
2383 you_are("piously aligned", "");
2385 you_have("
\8chåi
\82È
\90M
\8bÂ
\90S", "");
2386 else if (u.ualign.record > 13)
2388 you_are("devoutly aligned", "");
2390 you_have("
\90S
\82©
\82ç
\82Ì
\90M
\8bÂ
\90S", "");
2391 else if (u.ualign.record > 8)
2393 you_are("fervently aligned", "");
2395 you_have("
\94M
\90S
\82È
\90M
\8bÂ
\90S", "");
2396 else if (u.ualign.record > 3)
2398 you_are("stridently aligned", "");
2400 you_have("
\82¨
\82¨
\82°
\82³
\82È
\90M
\8bÂ
\90S", "");
2401 else if (u.ualign.record == 3)
2403 you_are("aligned", "");
2405 you_have("
\95\81\92Ê
\82Ì
\90M
\8bÂ
\90S", "");
2406 else if (u.ualign.record > 0)
2408 you_are("haltingly aligned", "");
2410 you_have("çSçO
\82µ
\82È
\82ª
\82ç
\82à
\90M
\8bÂ
\90S", "");
2411 else if (u.ualign.record == 0)
2413 you_are("nominally aligned", "");
2415 you_have("
\8c`
\82¾
\82¯
\82Ì
\90M
\8bÂ
\90S", "");
2416 else if (u.ualign.record >= -3)
2418 you_have("strayed", "");
2420 you_are_ing("
\90M
\8bÂ
\82É
\96À
\82¢
\82ð
\82à
\82Á
\82Ä", "");
2421 else if (u.ualign.record >= -8)
2423 you_have("sinned", "");
2425 you_are_ing("
\8dß
\82ð
\95\89\82Á
\82Ä", "");
2428 you_have("transgressed", "");
2430 you_are_ing("
\90M
\8bÂ
\82©
\82ç
\88í
\92E
\82µ
\82Ä", "");
2433 Sprintf(buf, " %d", u.ualign.record);
2434 enl_msg("Your alignment ", "is", "was", buf, "");
2436 Sprintf(buf, "
\82 \82È
\82½
\82Ì
\91®
\90«
\92l
\82Í%d", u.ualign.record);
2437 enl_msg(buf, "
\82Å
\82 \82é", "
\82¾
\82Á
\82½", "", "");
2441 /*** Resistances to troubles ***/
2444 you_are("invulnerable", from_what(INVULNERABLE));
2446 you_are("
\95s
\8e\80\90g", from_what(INVULNERABLE));
2449 you_are("magic-protected", from_what(ANTIMAGIC));
2451 you_have("
\96\82\96@
\96h
\8cä
\94\
\97Í", from_what(ANTIMAGIC));
2452 if (Fire_resistance)
2454 you_are("fire resistant", from_what(FIRE_RES));
2456 you_have("
\89Î
\82Ö
\82Ì
\91Ï
\90«", from_what(FIRE_RES));
2457 if (Cold_resistance)
2459 you_are("cold resistant", from_what(COLD_RES));
2461 you_have("
\8a¦
\82³
\82Ö
\82Ì
\91Ï
\90«", from_what(COLD_RES));
2462 if (Sleep_resistance)
2464 you_are("sleep resistant", from_what(SLEEP_RES));
2466 you_have("
\96°
\82è
\82Ö
\82Ì
\91Ï
\90«", from_what(SLEEP_RES));
2467 if (Disint_resistance)
2469 you_are("disintegration-resistant", from_what(DISINT_RES));
2471 you_have("
\95²
\8dÓ
\82Ö
\82Ì
\91Ï
\90«", from_what(DISINT_RES));
2472 if (Shock_resistance)
2474 you_are("shock resistant", from_what(SHOCK_RES));
2476 you_have("
\93d
\8c\82\82Ö
\82Ì
\91Ï
\90«", from_what(SHOCK_RES));
2477 if (Poison_resistance)
2479 you_are("poison resistant", from_what(POISON_RES));
2481 you_have("
\93Å
\82Ö
\82Ì
\91Ï
\90«", from_what(POISON_RES));
2482 if (Acid_resistance)
2484 you_are("acid resistant", from_what(ACID_RES));
2486 you_have("
\8e_
\82Ö
\82Ì
\91Ï
\90«", from_what(ACID_RES));
2487 if (Drain_resistance)
2489 you_are("level-drain resistant", from_what(DRAIN_RES));
2491 you_have("
\83\8c\83x
\83\8b\83_
\83E
\83\93\82Ö
\82Ì
\91Ï
\90«", from_what(DRAIN_RES));
2492 if (Sick_resistance)
2494 you_are("immune to sickness", from_what(SICK_RES));
2496 you_have("
\95a
\8bC
\82É
\91Î
\82·
\82é
\96Æ
\89u", from_what(SICK_RES));
2497 if (Stone_resistance)
2499 you_are("petrification resistant", from_what(STONE_RES));
2501 you_have("
\90Î
\89»
\82Ö
\82Ì
\91Ï
\90«", from_what(STONE_RES));
2502 if (Halluc_resistance)
2504 enl_msg(You_, "resist", "resisted", " hallucinations",
2505 from_what(HALLUC_RES));
2507 you_have("
\8c¶
\8ao
\82Ö
\82Ì
\91Ï
\90«", from_what(HALLUC_RES));
2511 you_can("recognize detrimental food", "");
2513 you_can("
\97L
\8aQ
\82È
\90H
\97¿
\82ð
\8e¯
\95Ê", "");
2515 /*** Vision and senses ***/
2516 if (!Blind && (Blinded || !haseyes(youmonst.data)))
2517 you_can("see", from_what(-BLINDED)); /* Eyes of the Overworld */
2518 if (See_invisible) {
2521 enl_msg(You_, "see", "saw", " invisible", from_what(SEE_INVIS));
2523 enl_msg("
\82 \82È
\82½
\82Í
\93§
\96¾
\82È
\82à
\82Ì
\82ð
\8c©
\82ç
\82ê", "
\82é", "
\82½", "", from_what(SEE_INVIS));
2526 enl_msg(You_, "will see", "would have seen",
2527 " invisible when not blind", from_what(SEE_INVIS));
2529 enl_msg(You_, "
\82é", "
\82½",
2530 "
\96Ó
\96Ú
\82Å
\82È
\82¢
\82Æ
\82«
\82É
\82Í
\93§
\96¾
\82È
\82à
\82Ì
\82ð
\8c©
\82ç
\82ê", from_what(SEE_INVIS));
2535 you_are("telepathic", from_what(TELEPAT));
2537 you_have("
\83e
\83\8c\83p
\83V
\81[", from_what(TELEPAT));
2540 you_are("warned", from_what(WARNING));
2542 you_have("
\8cx
\89ú
\94\
\97Í", from_what(WARNING));
2543 if (Warn_of_mon && context.warntype.obj) {
2545 Sprintf(buf, "aware of the presence of %s",
2546 (context.warntype.obj & M2_ORC) ? "orcs"
2547 : (context.warntype.obj & M2_ELF) ? "elves"
2548 : (context.warntype.obj & M2_DEMON) ? "demons" : something);
2549 you_are(buf, from_what(WARN_OF_MON));
2551 Sprintf(buf, "%s
\82Ì
\91¶
\8dÝ
\82ð
\8a´
\82¶
\82é
\94\
\97Í",
2552 (context.warntype.obj & M2_ORC) ? "
\83I
\81[
\83N"
2553 : (context.warntype.obj & M2_ELF) ? "
\83G
\83\8b\83t"
2554 : (context.warntype.obj & M2_DEMON) ? "
\88«
\96\82" : something);
2558 if (Warn_of_mon && context.warntype.polyd) {
2560 Sprintf(buf, "aware of the presence of %s",
2561 ((context.warntype.polyd & (M2_HUMAN | M2_ELF))
2562 == (M2_HUMAN | M2_ELF))
2563 ? "humans and elves"
2564 : (context.warntype.polyd & M2_HUMAN)
2566 : (context.warntype.polyd & M2_ELF)
2568 : (context.warntype.polyd & M2_ORC)
2570 : (context.warntype.polyd & M2_DEMON)
2572 : "certain monsters");
2575 Sprintf(buf, "%s
\82Ì
\91¶
\8dÝ
\82ð
\8a´
\82¶
\82é
\94\
\97Í",
2576 ((context.warntype.polyd & (M2_HUMAN | M2_ELF))
2577 == (M2_HUMAN | M2_ELF))
2578 ? "
\90l
\8aÔ
\82Æ
\83G
\83\8b\83t"
2579 : (context.warntype.polyd & M2_HUMAN)
2581 : (context.warntype.polyd & M2_ELF)
2583 : (context.warntype.polyd & M2_ORC)
2585 : (context.warntype.polyd & M2_DEMON)
2587 : "
\82 \82é
\8eí
\82Ì
\89ö
\95¨");
2591 if (Warn_of_mon && context.warntype.speciesidx) {
2593 Sprintf(buf, "aware of the presence of %s",
2594 makeplural(mons[context.warntype.speciesidx].mname));
2595 you_are(buf, from_what(WARN_OF_MON));
2597 Sprintf(buf, "%s
\82Ì
\91¶
\8dÝ
\82ð
\8a´
\82¶
\82é
\94\
\97Í",
2598 mons[context.warntype.speciesidx].mname);
2599 you_have(buf, from_what(WARN_OF_MON));
2604 you_are("warned of undead", from_what(WARN_UNDEAD));
2606 you_have("
\95s
\8e\80\82Ì
\90¶
\95¨
\82Ö
\82Ì
\8cx
\89ú
\94\
\97Í", from_what(WARN_UNDEAD));
2609 you_have("automatic searching", from_what(SEARCHING));
2611 you_have("
\92T
\8d¸
\94\
\97Í", from_what(SEARCHING));
2614 you_are("clairvoyant", from_what(CLAIRVOYANT));
2616 you_have("
\90ç
\97¢
\8aá
\94\
\97Í", from_what(CLAIRVOYANT));
2617 else if ((HClairvoyant || EClairvoyant) && BClairvoyant) {
2618 Strcpy(buf, from_what(-CLAIRVOYANT));
2620 if (!strncmp(buf, " because of ", 12))
2621 /* overwrite substring; strncpy doesn't add terminator */
2622 (void) strncpy(buf, " if not for ", 12);
2623 enl_msg(You_, "could be", "could have been", " clairvoyant", buf);
2625 /*JP:
\81u
\81c
\82É
\82æ
\82Á
\82Ä
\81v*/
2626 if (!strncmp(buf, "
\82É
\82æ
\82Á
\82Ä", 8))
2627 /*JP:
\81u
\81c
\82ª
\82È
\82¯
\82ê
\82Î
\81v
\82É
\8f\91\82«
\8a·
\82¦
\82é*/
2628 strcpy(eos(buf) - 8, "
\82ª
\82È
\82¯
\82ê
\82Î");
2629 you_have("
\90ç
\97¢
\8aá
\94\
\97Í", buf);
2634 you_have("infravision", from_what(INFRAVISION));
2636 you_have("
\88Ã
\88Å
\82Å
\95¨
\82ð
\8c©
\82é
\94\
\97Í", from_what(INFRAVISION));
2637 if (Detect_monsters)
2639 you_are("sensing the presence of monsters", "");
2641 you_have("
\89ö
\95¨
\82ð
\92T
\82·
\94\
\97Í", "");
2644 you_are("going to confuse monsters", "");
2646 you_have("
\89ö
\95¨
\82ð
\8d¬
\97\90\82³
\82¹
\82é
\94\
\97Í", "");
2648 /*** Appearance and behavior ***/
2652 if (uleft && uleft->otyp == RIN_ADORNMENT)
2653 adorn += uleft->spe;
2654 if (uright && uright->otyp == RIN_ADORNMENT)
2655 adorn += uright->spe;
2656 /* the sum might be 0 (+0 ring or two which negate each other);
2657 that yields "you are charismatic" (which isn't pointless
2658 because it potentially impacts seduction attacks) */
2660 Sprintf(buf, "%scharismatic",
2661 (adorn > 0) ? "more " : (adorn < 0) ? "less " : "");
2662 you_are(buf, from_what(ADORNED));
2664 Sprintf(buf, "
\96£
\97Í%s
\82Ä",
2665 (adorn > 0) ? "
\82ª
\91\9d\89Á
\82µ" : (adorn < 0) ? "
\82ª
\8c¸
\8f
\82µ" : "
\93I
\82É
\82È
\82Á");
2666 enl_msg(You_, "
\82Ä
\82¢
\82é", "
\82½", buf, "");
2671 you_are("invisible", from_what(INVIS));
2673 you_are("
\93§
\96¾", from_what(INVIS));
2676 you_are("invisible to others", from_what(INVIS));
2678 you_are("
\91¼
\90l
\82É
\91Î
\82µ
\82Ä
\93§
\96¾", from_what(INVIS));
2679 /* ordinarily "visible" is redundant; this is a special case for
2680 the situation when invisibility would be an expected attribute */
2681 else if ((HInvis || EInvis) && BInvis)
2683 you_are("visible", from_what(-INVIS));
2685 you_are("
\95s
\93§
\96¾", from_what(-INVIS));
2688 you_are("displaced", from_what(DISPLACED));
2690 you_have("
\8c¶
\89e
\94\
\97Í", from_what(DISPLACED));
2693 you_are("stealthy", from_what(STEALTH));
2695 you_have("
\90l
\96Ú
\82ð
\93\90\82Þ
\94\
\97Í", from_what(STEALTH));
2696 if (Aggravate_monster)
2698 enl_msg("You aggravate", "", "d", " monsters",
2699 from_what(AGGRAVATE_MONSTER));
2701 you_are_ing("
\94½
\8a´
\82ð
\82©
\82Á
\82Ä", from_what(AGGRAVATE_MONSTER));
2705 enl_msg("You cause", "", "d", " conflict", from_what(CONFLICT));
2707 you_are_ing("
\93¬
\91\88\82ð
\88ø
\82«
\8bN
\82±
\82µ
\82Ä", from_what(CONFLICT));
2709 /*** Transportation ***/
2712 you_can("jump", from_what(JUMPING));
2714 you_can("
\92µ
\96ô
\82·
\82é
\82±
\82Æ
\82ª", from_what(JUMPING));
2717 you_can("teleport", from_what(TELEPORT));
2719 you_can("
\8fu
\8aÔ
\88Ú
\93®
\82ª", from_what(TELEPORT));
2720 if (Teleport_control)
2722 you_have("teleport control", from_what(TELEPORT_CONTROL));
2724 you_have("
\8fu
\8aÔ
\88Ú
\93®
\82Ì
\90§
\8cä
\94\
\97Í", from_what(TELEPORT_CONTROL));
2725 /* actively levitating handled earlier as a status condition */
2726 if (BLevitation) { /* levitation is blocked */
2727 long save_BLev = BLevitation;
2732 enl_msg(You_, "would levitate", "would have levitated",
2733 if_surroundings_permitted, "");
2735 you_are("
\95\82\97V
\8fó
\91Ô", "");
2737 BLevitation = save_BLev;
2739 /* actively flying handled earlier as a status condition */
2740 if (BFlying) { /* flight is blocked */
2741 long save_BFly = BFlying;
2746 enl_msg(You_, "would fly", "would have flown",
2748 ? "if you weren't levitating"
2749 : (save_BFly == FROMOUTSIDE)
2750 ? if_surroundings_permitted
2751 /* both surroundings and [latent] levitation */
2752 : " if circumstances permitted",
2755 you_can("
\94ò
\82Ô
\82±
\82Æ
\82ª", "");
2757 BFlying = save_BFly;
2759 /* actively walking on water handled earlier as a status condition */
2760 if (Wwalking && !walking_on_water())
2762 you_can("walk on water", from_what(WWALKING));
2764 you_can("
\90\85\82Ì
\8fã
\82ð
\95à
\82
\82±
\82Æ
\82ª", from_what(WWALKING));
2765 /* actively swimming (in water but not under it) handled earlier */
2766 if (Swimming && (Underwater || !u.uinwater))
2768 you_can("swim", from_what(SWIMMING));
2770 you_can("
\89j
\82®
\82±
\82Æ
\82ª", from_what(SWIMMING));
2773 you_can("survive without air", from_what(MAGICAL_BREATHING));
2775 you_can("
\8bó
\8bC
\82È
\82µ
\82Å
\90¶
\82«
\89\84\82Ñ
\82é
\82±
\82Æ
\82ª", from_what(MAGICAL_BREATHING));
2776 else if (Amphibious)
2778 you_can("breathe water", from_what(MAGICAL_BREATHING));
2780 you_can("
\90\85\92\86\82Å
\8cÄ
\8bz
\82ª", from_what(MAGICAL_BREATHING));
2783 you_can("walk through walls", from_what(PASSES_WALLS));
2785 you_can("
\95Ç
\82ð
\92Ê
\82è
\94²
\82¯
\82é
\82±
\82Æ
\82ª", from_what(PASSES_WALLS));
2787 /*** Physical attributes ***/
2790 enl_msg("You regenerate", "", "d", "", from_what(REGENERATION));
2792 you_have("
\8dÄ
\90¶
\94\
\97Í", from_what(REGENERATION));
2795 you_have("slower digestion", from_what(SLOW_DIGESTION));
2797 enl_msg("
\90H
\95¨
\82Ì
\8fÁ
\89»
\82ª
\92x", "
\82¢", "
\82©
\82Á
\82½", "", from_what(SLOW_DIGESTION));
2800 you_have(enlght_combatinc("to hit", u.uhitinc, final, buf), "");
2802 you_have(enlght_combatinc("
\96½
\92\86\97¦", u.uhitinc, final, buf), "");
2805 you_have(enlght_combatinc("damage", u.udaminc, final, buf), "");
2807 you_have(enlght_combatinc("
\83_
\83\81\81[
\83W", u.udaminc, final, buf), "");
2808 if (u.uspellprot || Protection) {
2811 if (uleft && uleft->otyp == RIN_PROTECTION)
2813 if (uright && uright->otyp == RIN_PROTECTION)
2814 prot += uright->spe;
2815 if (HProtection & INTRINSIC)
2817 prot += u.uspellprot;
2820 you_have(enlght_combatinc("defense", prot, final, buf), "");
2822 you_have(enlght_combatinc("
\96h
\8cä", prot, final, buf), "");
2824 if ((armpro = magic_negation(&youmonst)) > 0) {
2825 /* magic cancellation factor, conferred by worn armor */
2826 static const char *const mc_types[] = {
2828 "" /*ordinary*/, "warded", "guarded", "protected",
2830 "" /*ordinary*/, "
\89q
\82ç
\82ê
\82Ä", "
\8cì
\82ç
\82ê
\82Ä", "
\8eç
\82ç
\82ê
\82Ä",
2834 if (armpro >= SIZE(mc_types))
2835 armpro = SIZE(mc_types) - 1;
2837 you_are(mc_types[armpro], "");
2839 you_are_ing(mc_types[armpro], "");
2841 if (Half_physical_damage)
2842 enlght_halfdmg(HALF_PHDAM, final);
2843 if (Half_spell_damage)
2844 enlght_halfdmg(HALF_SPDAM, final);
2845 /* polymorph and other shape change */
2846 if (Protection_from_shape_changers)
2848 you_are("protected from shape changers",
2849 from_what(PROT_FROM_SHAPE_CHANGERS));
2851 you_have("
\95Ï
\89»
\89ö
\95¨
\82Ö
\82Ì
\91Ï
\90«", from_what(PROT_FROM_SHAPE_CHANGERS));
2854 const char *what = 0;
2856 if (!Upolyd) /* Upolyd handled below after current form */
2858 you_can("not change from your current form",
2860 you_are("
\8c»
\8dÝ
\82Ì
\8ep
\82©
\82ç
\95Ï
\89»
\82Å
\82«
\82È
\82¢
\8fó
\91Ô",
2861 from_what(UNCHANGING));
2862 /* blocked shape changes */
2865 what = !final ? "polymorph" : "have polymorphed";
2867 what = "
\95Ï
\89»
\82µ
\82Ä";
2868 else if (u.ulycn >= LOW_PM)
2870 what = !final ? "change shape" : "have changed shape";
2872 what = "
\8ep
\82ð
\95Ï
\82¦
\82Ä";
2875 Sprintf(buf, "would %s periodically", what);
2876 /* omit from_what(UNCHANGING); too verbose */
2877 enl_msg(You_, buf, buf, " if not locked into your current form",
2880 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);
2881 you_are_ing(buf, "");
2884 } else if (Polymorph) {
2886 you_are("polymorphing periodically", from_what(POLYMORPH));
2888 you_are("
\92è
\8aú
\93I
\82É
\95Ï
\89»
\82µ
\82Ä", from_what(POLYMORPH));
2890 if (Polymorph_control)
2892 you_have("polymorph control", from_what(POLYMORPH_CONTROL));
2894 you_have("
\95Ï
\89»
\82Ì
\90§
\8cä
\94\
\97Í", from_what(POLYMORPH_CONTROL));
2895 if (Upolyd && u.umonnum != u.ulycn) {
2896 /* foreign shape (except were-form which is handled below) */
2898 Sprintf(buf, "polymorphed into %s", an(youmonst.data->mname));
2900 Sprintf(buf, "%s
\82É
\95Ï
\89»
\82µ
\82Ä", youmonst.data->mname);
2902 Sprintf(eos(buf), " (%d)", u.mtimedone);
2906 you_are_ing(buf, "");
2908 if (lays_eggs(youmonst.data) && flags.female) /* Upolyd */
2910 you_can("lay eggs", "");
2912 you_can("
\97\91\82ð
\8eY
\82Þ
\82±
\82Æ
\82ª", "");
2913 if (u.ulycn >= LOW_PM) {
2915 /* "you are a werecreature [in beast form]" */
2916 Strcpy(buf, an(mons[u.ulycn].mname));
2917 if (u.umonnum == u.ulycn) {
2918 Strcat(buf, " in beast form");
2920 Sprintf(eos(buf), " (%d)", u.mtimedone);
2923 /*JP:
\81u
\82 \82È
\82½
\82Í[
\8fb
\82Ì
\8ep
\82Ì]
\81\9b\81\9b\90l
\8aÔ
\82Å
\82 \82é
\81v*/
2925 if (u.umonnum == u.ulycn) {
2926 Strcpy(buf, "
\8fb
\82Ì
\8ep
\82Ì");
2928 Sprintf(eos(buf), " (%d)", u.mtimedone);
2930 Strcat(buf, mons[u.ulycn].mname);
2934 if (Unchanging && Upolyd) /* !Upolyd handled above */
2936 you_can("not change from your current form", from_what(UNCHANGING));
2938 enl_msg("
\8d¡
\82Ì
\8ep
\82©
\82ç
\95Ï
\89»
\82·
\82é
\82±
\82Æ
\82ª
\82Å
\82«
\82È", "
\82¢", "
\82©
\82Á
\82½", "", from_what(UNCHANGING));
2940 you_are("harmed by silver", "");
2941 /* movement and non-armor-based protection */
2944 you_are(Very_fast ? "very fast" : "fast", from_what(FAST));
2946 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));
2949 you_have("reflection", from_what(REFLECTING));
2951 you_have("
\94½
\8eË
\94\
\97Í", from_what(REFLECTING));
2954 you_have("free action", from_what(FREE_ACTION));
2956 you_have("
\8dS
\91©
\82³
\82ê
\82È
\82¢
\94\
\97Í", from_what(FREE_ACTION));
2959 you_have("fixed abilities", from_what(FIXED_ABIL));
2961 enl_msg("
\94\
\97Í
\82ª
\95Ï
\89»
\82µ
\82È", "
\82¢", "
\82©
\82Á
\82½", "", from_what(FIXED_ABIL));
2964 enl_msg("Your life ", "will be", "would have been", " saved", "");
2966 enl_msg("
\82 \82È
\82½
\82Ì
\90¶
\96½
\82Í
\95Û
\91¶
\82³
\82ê
\82Ä", iru, ita, "", "");
2968 /*** Miscellany ***/
2970 ltmp = abs((int) Luck);
2972 Sprintf(buf, "%s%slucky",
2973 ltmp >= 10 ? "extremely " : ltmp >= 5 ? "very " : "",
2974 Luck < 0 ? "un" : "");
2976 Sprintf(buf, "%s%s",
2977 ltmp >= 10 ? "
\96Ò
\97ó
\82É" : ltmp >= 5 ? "
\82Æ
\82Ä
\82à" : "",
2978 Luck < 0 ? "
\95s
\8dK" : "
\8dK
\95\9f");
2981 Sprintf(eos(buf), " (%d)", Luck);
2985 enl_msg("Your luck ", "is", "was", " zero", "");
2987 enl_msg("
\82 \82È
\82½
\82Ì
\89^
\82Í
\83[
\83\8d", "
\82Å
\82 \82é", "
\82¾
\82Á
\82½", "", "");
2990 you_have("extra luck", "");
2992 you_have("
\82³
\82ç
\82È
\82é
\8dK
\89^", "");
2993 else if (u.moreluck < 0)
2995 you_have("reduced luck", "");
2997 you_have("
\82³
\82ç
\82È
\82é
\95s
\89^", "");
2998 if (carrying(LUCKSTONE) || stone_luck(TRUE)) {
2999 ltmp = stone_luck(0);
3002 enl_msg("Bad luck ", "does", "did", " not time out for you", "");
3004 enl_msg("
\95s
\89^
\82Í
\8e\9e\8aÔ
\90Ø
\82ê
\82É
\82È
\82ç
\82È", "
\82¢", "
\82©
\82Á
\82½", "", "");
3007 enl_msg("Good luck ", "does", "did", " not time out for you", "");
3009 enl_msg("
\8dK
\89^
\82Í
\8e\9e\8aÔ
\90Ø
\82ê
\82É
\82È
\82ç
\82È", "
\82¢", "
\82©
\82Á
\82½", "", "");
3014 Sprintf(buf, " %sangry with you",
3015 u.ugangr > 6 ? "extremely " : u.ugangr > 3 ? "very " : "");
3017 Sprintf(buf, "%s
\82Í%s
\93{
\82Á
\82Ä%s", u_gname(),
3018 u.ugangr > 6 ? "
\96Ò
\97ó
\82É" : u.ugangr > 3 ? "
\82Æ
\82Ä
\82à" : "", final ? ita : iru);
3021 Sprintf(eos(buf), " (%d)", u.ugangr);
3023 enl_msg(u_gname(), " is", " was", buf, "");
3025 enl_msg(buf, "", "", "", "");
3029 * We need to suppress this when the game is over, because death
3030 * can change the value calculated by can_pray(), potentially
3031 * resulting in a false claim that you could have prayed safely.
3036 /* "can [not] safely pray" vs "could [not] have safely prayed" */
3037 Sprintf(buf, "%s%ssafely pray%s", can_pray(FALSE) ? "" : "not ",
3038 final ? "have " : "", final ? "ed" : "");
3040 Sprintf(buf, "%ssafely pray", can_pray(FALSE) ? "" : "not ");
3043 Sprintf(eos(buf), " (%d)", u.ublesscnt);
3046 Sprintf(buf, "
\82 \82È
\82½
\82Í
\88À
\91S
\82É
\8bF
\82é
\82±
\82Æ
\82ª");
3047 Strcat(buf, can_pray(FALSE) ? can : "
\82Å
\82«
\82È
\82¢");
3049 Sprintf(eos(buf), " (%d)", u.ublesscnt);
3050 enl_msg(buf, "", "", "", "");
3055 /* named fruit debugging (doesn't really belong here...) */
3061 for (f = ffruit; f; f = f->nextf) {
3063 Sprintf(buf, "Fruit %d ", ++fcount);
3065 Sprintf(buf, "fruit %d
\82Í", ++fcount);
3066 Sprintf(buf2, "%s (id %d)", f->fname, f->fid);
3068 enl_msg(buf, "is ", "was ", buf2, "");
3070 enl_msg(buf, "
\82¾", "
\82¾
\82Á
\82½", buf2, "");
3073 enl_msg("The current fruit ", "is ", "was ", pl_fruit, "");
3075 enl_msg("
\8c»
\8dÝ
\82Ì fruit
\82Í", "
\82¾", "
\82¾
\82Á
\82½", pl_fruit, "");
3076 Sprintf(buf, "%d", flags.made_fruit);
3078 enl_msg("The made fruit flag ", "is ", "was ", buf, "");
3080 enl_msg("made fruit flag
\82Í", "
\82¾", "
\82¾
\82Á
\82½", buf, "");
3087 if (final < 2) { /* still in progress, or quit/escaped/ascended */
3089 p = "survived after being killed ";
3091 p = "
\8e\80\82ñ
\82¾
\8cã
\95\9c\8a\88\82µ
\82Ä
\82¢
\82½";
3092 switch (u.umortality) {
3095 p = !final ? (char *) 0 : "survived";
3097 p = !final ? (char *)0 : "
\90¶
\82«
\89\84\82Ñ
\82½";
3101 Strcpy(buf, "once");
3103 Strcpy(buf, "
\88ê
\93x");
3107 Strcpy(buf, "twice");
3109 Strcpy(buf, "
\93ñ
\93x");
3113 Strcpy(buf, "thrice");
3115 Strcpy(buf, "
\8eO
\93x");
3119 Sprintf(buf, "%d times", u.umortality);
3121 Sprintf(buf, "%d
\89ñ", u.umortality);
3124 } else { /* game ended in character's death */
3128 p = "
\8e\80\82ñ
\82Å
\82¢
\82é";
3129 switch (u.umortality) {
3131 impossible("dead without dying?");
3133 break; /* just "are dead" */
3136 Sprintf(buf, " (%d%s time!)", u.umortality,
3137 ordin(u.umortality));
3139 Sprintf(buf, "(%d
\89ñ
\81I)", u.umortality);
3146 enl_msg(You_, "have been killed ", p, buf, "");
3148 enl_msg(You_, "
\8e\80\82ñ
\82Å
\82¢
\82é", p, buf, "");
3152 #if 0 /* no longer used */
3153 STATIC_DCL boolean NDECL(minimal_enlightenment);
3156 * Courtesy function for non-debug, non-explorer mode players
3157 * to help refresh them about who/what they are.
3158 * Returns FALSE if menu cancelled (dismissed with ESC), TRUE otherwise.
3161 minimal_enlightenment()
3164 menu_item *selected;
3167 char buf[BUFSZ], buf2[BUFSZ];
3168 static const char untabbed_fmtstr[] = "%-15s: %-12s";
3169 static const char untabbed_deity_fmtstr[] = "%-17s%s";
3170 static const char tabbed_fmtstr[] = "%s:\t%-12s";
3171 static const char tabbed_deity_fmtstr[] = "%s\t%s";
3172 static const char *fmtstr;
3173 static const char *deity_fmtstr;
3175 fmtstr = iflags.menu_tab_sep ? tabbed_fmtstr : untabbed_fmtstr;
3176 deity_fmtstr = iflags.menu_tab_sep ? tabbed_deity_fmtstr
3177 : untabbed_deity_fmtstr;
3179 buf[0] = buf2[0] = '\0';
3180 tmpwin = create_nhwindow(NHW_MENU);
3182 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, iflags.menu_headings,
3188 /* Starting name, race, role, gender */
3190 Sprintf(buf, fmtstr, "name", plname);
3192 Sprintf(buf, fmtstr, "
\96¼
\91O", plname);
3193 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
3195 Sprintf(buf, fmtstr, "race", urace.noun);
3197 Sprintf(buf, fmtstr, "
\8eí
\91°", urace.noun);
3198 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
3200 Sprintf(buf, fmtstr, "role",
3202 Sprintf(buf, fmtstr, "
\90E
\8bÆ",
3203 (flags.initgend && urole.name.f) ? urole.name.f : urole.name.m);
3204 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
3206 Sprintf(buf, fmtstr, "gender", genders[flags.initgend].adj);
3208 Sprintf(buf, fmtstr, "
\90«
\95Ê", genders[flags.initgend].adj);
3209 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
3211 /* Starting alignment */
3213 Sprintf(buf, fmtstr, "alignment", align_str(u.ualignbase[A_ORIGINAL]));
3215 Sprintf(buf, fmtstr, "
\91®
\90«", align_str(u.ualignbase[A_ORIGINAL]));
3216 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
3218 /* Current name, race, role, gender */
3219 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "", FALSE);
3220 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, iflags.menu_headings,
3226 Sprintf(buf, fmtstr, "race", Upolyd ? youmonst.data->mname : urace.noun);
3228 Sprintf(buf, fmtstr, "
\8eí
\91°", Upolyd ? youmonst.data->mname : urace.noun);
3229 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
3232 Sprintf(buf, fmtstr, "role (base)",
3234 Sprintf(buf, fmtstr, "
\90E
\8bÆ(
\8aî
\96{)",
3235 (u.mfemale && urole.name.f) ? urole.name.f
3237 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
3240 Sprintf(buf, fmtstr, "role",
3242 Sprintf(buf, fmtstr, "
\90E
\8bÆ",
3243 (flags.female && urole.name.f) ? urole.name.f
3245 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
3247 /* don't want poly_gender() here; it forces `2' for non-humanoids */
3248 genidx = is_neuter(youmonst.data) ? 2 : flags.female;
3250 Sprintf(buf, fmtstr, "gender", genders[genidx].adj);
3252 Sprintf(buf, fmtstr, "
\90«
\95Ê", genders[genidx].adj);
3253 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
3254 if (Upolyd && (int) u.mfemale != genidx) {
3256 Sprintf(buf, fmtstr, "gender (base)", genders[u.mfemale].adj);
3258 Sprintf(buf, fmtstr, "
\90«
\95Ê(
\8aî
\96{)", genders[u.mfemale].adj);
3259 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
3262 /* Current alignment */
3264 Sprintf(buf, fmtstr, "alignment", align_str(u.ualign.type));
3266 Sprintf(buf, fmtstr, "
\91®
\90«", align_str(u.ualign.type));
3267 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
3270 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "", FALSE);
3271 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, iflags.menu_headings,
3277 Sprintf(buf2, deity_fmtstr, align_gname(A_CHAOTIC),
3278 (u.ualignbase[A_ORIGINAL] == u.ualign.type
3279 && u.ualign.type == A_CHAOTIC) ? " (s,c)"
3280 : (u.ualignbase[A_ORIGINAL] == A_CHAOTIC) ? " (s)"
3281 : (u.ualign.type == A_CHAOTIC) ? " (c)" : "");
3283 Sprintf(buf2, deity_fmtstr, align_gname(A_CHAOTIC),
3284 (u.ualignbase[A_ORIGINAL] == u.ualign.type
3285 && u.ualign.type == A_CHAOTIC) ? " (
\8f\89\81C
\8c»)"
3286 : (u.ualignbase[A_ORIGINAL] == A_CHAOTIC) ? " (
\8f\89)"
3287 : (u.ualign.type == A_CHAOTIC) ? " (
\8c»)" : "");
3290 Sprintf(buf, fmtstr, "Chaotic", buf2);
3292 Sprintf(buf, fmtstr, "
\8d¬
\93×", buf2);
3293 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
3296 Sprintf(buf2, deity_fmtstr, align_gname(A_NEUTRAL),
3297 (u.ualignbase[A_ORIGINAL] == u.ualign.type
3298 && u.ualign.type == A_NEUTRAL) ? " (s,c)"
3299 : (u.ualignbase[A_ORIGINAL] == A_NEUTRAL) ? " (s)"
3300 : (u.ualign.type == A_NEUTRAL) ? " (c)" : "");
3302 Sprintf(buf2, deity_fmtstr, align_gname(A_NEUTRAL),
3303 (u.ualignbase[A_ORIGINAL] == u.ualign.type
3304 && u.ualign.type == A_NEUTRAL) ? " (
\8f\89\81C
\8c»)"
3305 : (u.ualignbase[A_ORIGINAL] == A_NEUTRAL) ? " (
\8f\89)"
3306 : (u.ualign.type == A_NEUTRAL) ? " (
\8c»)" : "");
3309 Sprintf(buf, fmtstr, "Neutral", buf2);
3311 Sprintf(buf, fmtstr, "
\92\86\97§", buf2);
3312 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
3315 Sprintf(buf2, deity_fmtstr, align_gname(A_LAWFUL),
3316 (u.ualignbase[A_ORIGINAL] == u.ualign.type
3317 && u.ualign.type == A_LAWFUL) ? " (s,c)"
3318 : (u.ualignbase[A_ORIGINAL] == A_LAWFUL) ? " (s)"
3319 : (u.ualign.type == A_LAWFUL) ? " (c)" : "");
3321 Sprintf(buf2, deity_fmtstr, align_gname(A_LAWFUL),
3322 (u.ualignbase[A_ORIGINAL] == u.ualign.type
3323 && u.ualign.type == A_LAWFUL) ? " (
\8f\89\81C
\8c»)"
3324 : (u.ualignbase[A_ORIGINAL] == A_LAWFUL) ? " (
\8f\89)"
3325 : (u.ualign.type == A_LAWFUL) ? " (
\8c»)" : "");
3328 Sprintf(buf, fmtstr, "Lawful", buf2);
3330 Sprintf(buf, fmtstr, "
\92\81\8f\98", buf2);
3331 add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE);
3334 end_menu(tmpwin, "Base Attributes");
3336 end_menu(tmpwin, "
\8aî
\96{
\91®
\90«");
3337 n = select_menu(tmpwin, PICK_NONE, &selected);
3338 destroy_nhwindow(tmpwin);
3339 return (boolean) (n != -1);
3345 doattributes(VOID_ARGS)
3347 int mode = BASICENLIGHTENMENT;
3349 /* show more--as if final disclosure--for wizard and explore modes */
3350 if (wizard || discover)
3351 mode |= MAGICENLIGHTENMENT;
3353 enlightenment(mode, ENL_GAMEINPROGRESS);
3358 youhiding(via_enlghtmt, msgflag)
3359 boolean via_enlghtmt; /* englightment line vs topl message */
3360 int msgflag; /* for variant message phrasing */
3362 char *bp, buf[BUFSZ];
3365 Strcpy(buf, "hiding");
3367 Strcpy(buf, "
\89B
\82ê");
3368 if (youmonst.m_ap_type != M_AP_NOTHING) {
3369 /* mimic; hero is only able to mimic a strange object or gold
3370 or hallucinatory alternative to gold, so we skip the details
3371 for the hypothetical furniture and monster cases */
3372 #if 0 /*JP*//*
\8cã
\82ë
\82É
\89ñ
\82·*/
3373 bp = eos(strcpy(buf, "mimicking"));
3375 if (youmonst.m_ap_type == M_AP_OBJECT) {
3377 Sprintf(bp, " %s", an(simple_typename(youmonst.mappearance)));
3379 Strcpy(buf, simple_typename(youmonst.mappearance));
3380 } else if (youmonst.m_ap_type == M_AP_FURNITURE) {
3382 Strcpy(bp, " something");
3384 Strcpy(buf, "
\89½
\82©");
3385 } else if (youmonst.m_ap_type == M_AP_MONSTER) {
3387 Strcpy(bp, " someone");
3389 Strcpy(buf, "
\89½
\8eÒ
\82©");
3391 ; /* something unexpected; leave 'buf' as-is */
3393 #if 1 /*JP*//*
\82±
\82±
\82Å
\92Ç
\89Á*/
3394 Strcat(buf, "
\82Ì
\82Ó
\82è
\82ð
\82µ");
3396 } else if (u.uundetected) {
3397 bp = eos(buf); /* points past "hiding" */
3398 if (youmonst.data->mlet == S_EEL) {
3399 if (is_pool(u.ux, u.uy))
3401 Sprintf(bp, " in the %s", waterbody_name(u.ux, u.uy));
3403 Sprintf(bp, "%s
\82Ì
\92\86\82É", waterbody_name(u.ux, u.uy));
3404 } else if (hides_under(youmonst.data)) {
3405 struct obj *o = level.objects[u.ux][u.uy];
3409 Sprintf(bp, " underneath %s", ansimpleoname(o));
3411 Sprintf(bp, "%s
\82Ì
\89º
\82É", ansimpleoname(o));
3412 } else if (is_clinger(youmonst.data) || Flying) {
3413 /* Flying: 'lurker above' hides on ceiling but doesn't cling */
3415 Sprintf(bp, " on the %s", ceiling(u.ux, u.uy));
3417 Sprintf(bp, "%s
\82É", ceiling(u.ux, u.uy));
3419 /* on floor; is_hider() but otherwise not special: 'trapper' */
3420 if (u.utrap && u.utraptype == TT_PIT) {
3421 struct trap *t = t_at(u.ux, u.uy);
3424 Sprintf(bp, " in a %spit",
3425 (t && t->ttyp == SPIKED_PIT) ? "spiked " : "");
3427 Sprintf(bp, "%s
\97\8e\82µ
\8c\8a\82Ì
\92\86\82É",
3428 (t && t->ttyp == SPIKED_PIT) ? "
\83g
\83Q
\82¾
\82ç
\82¯
\82Ì" : "");
3432 Sprintf(bp, " on the %s", surface(u.ux, u.uy));
3434 Sprintf(bp, "%s
\82É", surface(u.ux, u.uy));
3436 #if 1 /*JP*//*
\82±
\82±
\82Å
\92Ç
\89Á*/
3437 Strcat(buf, "
\89B
\82ê");
3440 ; /* shouldn't happen; will result in generic "you are hiding" */
3444 int final = msgflag; /* 'final' is used by you_are() macro */
3449 enl_msg(buf, "
\82Ä
\82¢
\82é", "
\82Ä
\82¢
\82½", "", "");
3451 /* for dohide(), when player uses '#monster' command */
3453 You("are %s %s.", msgflag ? "already" : "now", buf);
3456 You("
\82·
\82Å
\82É%s
\82Ä
\82¢
\82é
\81D", buf);
3458 You("%s
\82½
\81D", buf);
3465 * (shares enlightenment's tense handling)
3468 doconduct(VOID_ARGS)
3481 /* Create the conduct window */
3482 en_win = create_nhwindow(NHW_MENU);
3484 putstr(en_win, 0, "Voluntary challenges:");
3486 putstr(en_win, 0, "
\8e©
\94
\93I
\92§
\90í:");
3488 if (u.uroleplay.blind)
3490 you_have_been("blind from birth");
3492 you_have_been("
\90¶
\82Ü
\82ê
\82È
\82ª
\82ç
\82É
\96Ó
\96Ú");
3493 if (u.uroleplay.nudist)
3495 you_have_been("faithfully nudist");
3497 you_have_been("
\92\89\8eÀ
\82È
\97\87\91°");
3499 if (!u.uconduct.food)
3501 enl_msg(You_, "have gone", "went", " without food", "");
3503 enl_msg("
\82 \82È
\82½
\82Í
\90H
\8e\96\82ð
\82µ", "
\82Ä
\82¢
\82È
\82¢", "
\82È
\82©
\82Á
\82½", "", "");
3504 /* But beverages are okay */
3505 else if (!u.uconduct.unvegan)
3507 you_have_X("followed a strict vegan diet");
3509 you_have_been("
\8cµ
\8ai
\82È
\8dØ
\90H
\8eå
\8b`
\8eÒ");
3510 else if (!u.uconduct.unvegetarian)
3512 you_have_been("vegetarian");
3514 you_have_been("
\8dØ
\90H
\8eå
\8b`
\8eÒ");
3516 if (!u.uconduct.gnostic)
3518 you_have_been("an atheist");
3520 you_have_been("
\96³
\90_
\98_
\8eÒ");
3522 if (!u.uconduct.weaphit) {
3524 you_have_never("hit with a wielded weapon");
3526 you_have_never("
\82 \82È
\82½
\82Í
\91\95\94õ
\82µ
\82Ä
\82¢
\82é
\95\90\8aí
\82Å
\8dU
\8c\82\82µ");
3527 } else if (wizard) {
3529 Sprintf(buf, "used a wielded weapon %ld time%s", u.uconduct.weaphit,
3530 plur(u.uconduct.weaphit));
3533 Sprintf(buf, "
\82 \82È
\82½
\82Í%ld
\89ñ
\91\95\94õ
\82µ
\82½
\95\90\8aí
\82ð
\8eg
\97p
\82µ", u.uconduct.weaphit);
3537 if (!u.uconduct.killer)
3539 you_have_been("a pacifist");
3541 you_have_been("
\95½
\98a
\8eå
\8b`
\8eÒ");
3543 if (!u.uconduct.literate) {
3545 you_have_been("illiterate");
3547 you_have_never("
\82 \82È
\82½
\82Í
\93Ç
\82Ý
\8f\91\82«
\82µ");
3548 } else if (wizard) {
3550 Sprintf(buf, "read items or engraved %ld time%s", u.uconduct.literate,
3551 plur(u.uconduct.literate));
3554 Sprintf(buf, "%ld
\89ñ
\93Ç
\82ñ
\82¾
\82è
\8f\91\82¢
\82½
\82è
\82µ", u.uconduct.literate);
3559 ngenocided = num_genocides();
3560 if (ngenocided == 0) {
3562 you_have_never("genocided any monsters");
3564 you_have_never("
\82 \82È
\82½
\82Í
\89ö
\95¨
\82ð
\8bs
\8eE
\82µ");
3567 Sprintf(buf, "genocided %d type%s of monster%s", ngenocided,
3568 plur(ngenocided), plur(ngenocided));
3571 Sprintf(buf, "%d
\8eí
\82Ì
\89ö
\95¨
\82ð
\8bs
\8eE
\82µ", ngenocided);
3576 if (!u.uconduct.polypiles) {
3578 you_have_never("polymorphed an object");
3580 you_have_never("
\82 \82È
\82½
\82Í
\95¨
\91Ì
\82ð
\95Ï
\89»
\82³
\82¹");
3581 } else if (wizard) {
3583 Sprintf(buf, "polymorphed %ld item%s", u.uconduct.polypiles,
3584 plur(u.uconduct.polypiles));
3587 Sprintf(buf, "%ld
\8cÂ
\82Ì
\93¹
\8bï
\82ð
\95Ï
\89»
\82³
\82¹", u.uconduct.polypiles);
3592 if (!u.uconduct.polyselfs) {
3594 you_have_never("changed form");
3596 you_have_never("
\82 \82È
\82½
\82Í
\95Ï
\89»
\82µ");
3597 } else if (wizard) {
3599 Sprintf(buf, "changed form %ld time%s", u.uconduct.polyselfs,
3600 plur(u.uconduct.polyselfs));
3603 Sprintf(buf, "%ld
\89ñ
\8ep
\82ð
\95Ï
\82¦", u.uconduct.polyselfs);
3608 if (!u.uconduct.wishes) {
3610 you_have_X("used no wishes");
3612 you_have_never("
\82 \82È
\82½
\82Í
\8aè
\82¢
\8e\96\82ð
\82µ");
3615 Sprintf(buf, "used %ld wish%s", u.uconduct.wishes,
3616 (u.uconduct.wishes > 1L) ? "es" : "");
3619 Sprintf(buf, "%ld
\89ñ
\8aè
\82¢
\8e\96\82ð
\82µ", u.uconduct.wishes);
3623 if (!u.uconduct.wisharti)
3625 enl_msg(You_, "have not wished", "did not wish",
3626 " for any artifacts", "");
3628 enl_msg("
\82 \82È
\82½
\82Í
\90¹
\8aí
\82ð
\8aè", "
\82Á
\82Ä
\82¢
\82È
\82¢", "
\82í
\82È
\82©
\82Á
\82½", "", "");
3632 /* Pop up the window and wait for a key */
3633 display_nhwindow(en_win, TRUE);
3634 destroy_nhwindow(en_win);
3640 #define M(c) (0x80 | (c))
3642 #define M(c) ((c) -128)
3646 #define C(c) (0x1f & (c))
3649 static const struct func_tab cmdlist[] = {
3650 { C('d'), FALSE, dokick }, /* "D" is for door!...? Msg is in dokick.c */
3651 { C('e'), TRUE, wiz_detect },
3652 { C('f'), TRUE, wiz_map },
3653 { C('g'), TRUE, wiz_genesis },
3654 { C('i'), TRUE, wiz_identify },
3655 { C('l'), TRUE, doredraw }, /* if number_pad is set */
3656 { C('n'), TRUE, donamelevel }, /* if number_pad is set */
3657 { C('o'), TRUE, dooverview_or_wiz_where }, /* depends on wizard status */
3658 { C('p'), TRUE, doprev_message },
3659 { C('r'), TRUE, doredraw },
3660 { C('t'), TRUE, dotele },
3661 { C('v'), TRUE, wiz_level_tele },
3662 { C('w'), TRUE, wiz_wish },
3663 { C('x'), TRUE, doattributes },
3664 { C('z'), TRUE, dosuspend_core },
3665 { 'a', FALSE, doapply },
3666 { 'A', FALSE, doddoremarm },
3667 { M('a'), TRUE, doorganize },
3668 { M('A'), TRUE, donamelevel }, /* #annotate */
3669 /* 'b', 'B' : go sw */
3670 { 'c', FALSE, doclose },
3671 { 'C', TRUE, docallcmd },
3672 { M('c'), TRUE, dotalk },
3673 { M('C'), TRUE, doconduct }, /* #conduct */
3674 { 'd', FALSE, dodrop },
3675 { 'D', FALSE, doddrop },
3676 { M('d'), FALSE, dodip },
3677 { 'e', FALSE, doeat },
3678 { 'E', FALSE, doengrave },
3679 { M('e'), TRUE, enhance_weapon_skill },
3680 { 'f', FALSE, dofire },
3681 /* 'F' : fight (one time) */
3682 { M('f'), FALSE, doforce },
3683 /* 'g', 'G' : multiple go */
3684 /* 'h', 'H' : go west */
3685 { 'h', TRUE, dohelp }, /* if number_pad is set */
3686 { 'i', TRUE, ddoinv },
3687 { 'I', TRUE, dotypeinv }, /* Robert Viduya */
3688 { M('i'), TRUE, doinvoke },
3689 /* 'j', 'J', 'k', 'K', 'l', 'L', 'm', 'M', 'n', 'N' : move commands */
3690 { 'j', FALSE, dojump }, /* if number_pad is on */
3691 { M('j'), FALSE, dojump },
3692 { 'k', FALSE, dokick }, /* if number_pad is on */
3693 { 'l', FALSE, doloot }, /* if number_pad is on */
3694 { M('l'), FALSE, doloot },
3695 /* 'n' prefixes a count if number_pad is on */
3696 { M('m'), TRUE, domonability },
3697 { 'N', TRUE, docallcmd }, /* if number_pad is on */
3698 { M('n'), TRUE, docallcmd },
3699 { M('N'), TRUE, docallcmd },
3700 { 'o', FALSE, doopen },
3701 { 'O', TRUE, doset },
3702 { M('o'), FALSE, dosacrifice },
3703 { M('O'), TRUE, dooverview }, /* #overview */
3704 { 'p', FALSE, dopay },
3705 { 'P', FALSE, doputon },
3706 { M('p'), TRUE, dopray },
3707 { 'q', FALSE, dodrink },
3708 { 'Q', FALSE, dowieldquiver },
3709 { M('q'), TRUE, done2 },
3710 { 'r', FALSE, doread },
3711 { 'R', FALSE, doremring },
3712 { M('r'), FALSE, dorub },
3713 { M('R'), FALSE, doride }, /* #ride */
3715 { 's', TRUE, dosearch, "searching" },
3717 { 's', TRUE, dosearch, "
\91{
\82·" },
3718 { 'S', TRUE, dosave },
3719 { M('s'), FALSE, dosit },
3720 { 't', FALSE, dothrow },
3721 { 'T', FALSE, dotakeoff },
3722 { M('t'), TRUE, doturn },
3723 { M('T'), FALSE, dotip }, /* #tip */
3724 /* 'u', 'U' : go ne */
3725 { 'u', FALSE, dountrap }, /* if number_pad is on */
3726 { M('u'), FALSE, dountrap },
3727 { 'v', TRUE, doversion },
3728 { 'V', TRUE, dohistory },
3729 { M('v'), TRUE, doextversion },
3730 { 'w', FALSE, dowield },
3731 { 'W', FALSE, dowear },
3732 { M('w'), FALSE, dowipe },
3733 { 'x', FALSE, doswapweapon },
3734 { 'X', FALSE, dotwoweapon },
3735 /* 'y', 'Y' : go nw */
3736 { 'z', FALSE, dozap },
3737 { 'Z', TRUE, docast },
3738 { '<', FALSE, doup },
3739 { '>', FALSE, dodown },
3740 { '/', TRUE, dowhatis },
3741 { '&', TRUE, dowhatdoes },
3742 { '?', TRUE, dohelp },
3743 { M('?'), TRUE, doextlist },
3745 { '!', TRUE, dosh },
3748 { '.', TRUE, donull, "waiting" },
3750 { '.', TRUE, donull, "
\8bx
\8ce
\82·
\82é" },
3752 { ' ', TRUE, donull, "waiting" },
3754 { ' ', TRUE, donull, "
\8bx
\8ce
\82·
\82é" },
3755 { ',', FALSE, dopickup },
3756 { ':', TRUE, dolook },
3757 { ';', TRUE, doquickwhatis },
3758 { '^', TRUE, doidtrap },
3759 { '\\', TRUE, dodiscovered }, /* Robert Viduya */
3760 { '`', TRUE, doclassdisco },
3761 { '@', TRUE, dotogglepickup },
3762 { M('2'), FALSE, dotwoweapon },
3763 { WEAPON_SYM, TRUE, doprwep },
3764 { ARMOR_SYM, TRUE, doprarm },
3765 { RING_SYM, TRUE, doprring },
3766 { AMULET_SYM, TRUE, dopramulet },
3767 { TOOL_SYM, TRUE, doprtool },
3768 { '*', TRUE, doprinuse }, /* inventory of all equipment in use */
3769 { GOLD_SYM, TRUE, doprgold },
3770 { SPBOOK_SYM, TRUE, dovspell }, /* Mike Stephenson */
3771 { '#', TRUE, doextcmd },
3772 { '_', TRUE, dotravel },
3776 struct ext_func_tab extcmdlist[] = {
3778 { "adjust", "adjust inventory letters", doorganize, TRUE },
3780 { "adjust", "
\8e\9d\82¿
\95¨
\88ê
\97\97\82Ì
\92²
\90®", doorganize, TRUE },
3782 { "annotate", "name current level", donamelevel, TRUE },
3784 { "annotate", "
\8c»
\8dÝ
\82Ì
\8aK
\82É
\96¼
\91O
\82ð
\82Â
\82¯
\82é", donamelevel, TRUE },
3786 { "chat", "talk to someone", dotalk, TRUE }, /* converse? */
3788 { "chat", "
\92N
\82©
\82Æ
\98b
\82·", dotalk, TRUE }, /* converse? */
3791 { "conduct", "list voluntary challenges you have maintained", doconduct,
3794 { "conduct", "
\82Ç
\82¤
\82¢
\82¤
\8ds
\93®
\82ð
\82Æ
\82Á
\82½
\82©
\8c©
\82é", doconduct, TRUE },
3797 { "dip", "dip an object into something", dodip, FALSE },
3799 { "dip", "
\89½
\82©
\82É
\95¨
\82ð
\90Z
\82·", dodip, FALSE },
3801 { "enhance", "advance or check weapon and spell skills",
3802 enhance_weapon_skill, TRUE },
3804 { "enhance", "
\95\90\8aí
\8fn
\97û
\93x
\82ð
\8d\82\82ß
\82é", enhance_weapon_skill, TRUE },
3807 { "exploremode", "enter explore mode", enter_explore_mode, TRUE },
3809 { "exploremode", "
\92T
\8c\9f\83\82\81[
\83h
\82É
\93ü
\82é", enter_explore_mode, TRUE },
3811 { "force", "force a lock", doforce, FALSE },
3813 { "force", "
\8c®
\82ð
\82±
\82¶
\82 \82¯
\82é", doforce, FALSE },
3815 { "invoke", "invoke an object's powers", doinvoke, TRUE },
3817 { "invoke", "
\95¨
\82Ì
\93Á
\95Ê
\82È
\97Í
\82ð
\8eg
\82¤", doinvoke, TRUE },
3819 { "jump", "jump to a location", dojump, FALSE },
3821 { "jump", "
\91¼
\82Ì
\88Ê
\92u
\82É
\94ò
\82Ñ
\82¤
\82Â
\82é", dojump, FALSE },
3823 { "loot", "loot a box on the floor", doloot, FALSE },
3825 { "loot", "
\8f°
\82Ì
\8fã
\82Ì
\94 \82ð
\8aJ
\82¯
\82é", doloot, TRUE },
3827 { "monster", "use a monster's special ability", domonability, TRUE },
3829 { "monster", "
\89ö
\95¨
\82Ì
\93Á
\95Ê
\94\
\97Í
\82ð
\8eg
\82¤", domonability, TRUE },
3831 { "name", "name a monster or an object", docallcmd, TRUE },
3833 { "name", "
\83A
\83C
\83e
\83\80\82â
\95¨
\82É
\96¼
\91O
\82ð
\82Â
\82¯
\82é", docallcmd, TRUE },
3835 { "offer", "offer a sacrifice to the gods", dosacrifice, FALSE },
3837 { "offer", "
\90_
\82É
\8b\9f\95¨
\82ð
\95ù
\82°
\82é", dosacrifice, FALSE },
3839 { "overview", "show an overview of the dungeon", dooverview, TRUE },
3841 { "overview", "
\96À
\8b{
\82Ì
\8aT
\97v
\82ð
\95\
\8e¦
\82·
\82é", dooverview, TRUE },
3843 { "pray", "pray to the gods for help", dopray, TRUE },
3845 { "pray", "
\90_
\82É
\8bF
\82é", dopray, TRUE },
3847 { "quit", "exit without saving current game", done2, TRUE },
3849 { "quit", "
\83Z
\81[
\83u
\82µ
\82È
\82¢
\82Å
\8fI
\97¹", done2, TRUE },
3851 { "ride", "ride (or stop riding) a monster", doride, FALSE },
3853 { "ride", "
\89ö
\95¨
\82É
\8fæ
\82é(
\82Ü
\82½
\82Í
\8d~
\82è
\82é)", doride, FALSE },
3855 { "rub", "rub a lamp or a stone", dorub, FALSE },
3857 { "rub", "
\83\89\83\93\83v
\82ð
\82±
\82·
\82é", dorub, FALSE },
3859 { "sit", "sit down", dosit, FALSE },
3861 { "sit", "
\8dÀ
\82é", dosit, FALSE },
3863 { "terrain", "show map without obstructions", doterrain, TRUE },
3865 { "terrain", "
\8e×
\96\82\82³
\82ê
\82¸
\82É
\92n
\90}
\82ð
\8c©
\82é", doterrain, TRUE },
3867 { "tip", "empty a container", dotip, FALSE },
3869 { "tip", "
\93ü
\82ê
\95¨
\82ð
\8bó
\82É
\82·
\82é", dotip, FALSE },
3871 { "turn", "turn undead", doturn, TRUE },
3873 { "turn", "
\83A
\83\93\83f
\83b
\83g
\82ð
\93y
\82É
\95Ô
\82·", doturn, TRUE },
3875 { "twoweapon", "toggle two-weapon combat", dotwoweapon, FALSE },
3877 { "twoweapon", "
\97¼
\8eè
\8e\9d\82¿
\82Ì
\90Ø
\82è
\91Ö
\82¦", dotwoweapon, FALSE },
3879 { "untrap", "untrap something", dountrap, FALSE },
3881 { "untrap", "ã©
\82ð
\82Í
\82¸
\82·", dountrap, FALSE },
3883 { "version", "list compile time options for this version of NetHack",
3884 doextversion, TRUE },
3886 { "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 },
3889 { "wipe", "wipe off your face", dowipe, FALSE },
3891 { "wipe", "
\8aç
\82ð
\90@
\82¤", dowipe, FALSE },
3893 { "?", "get this list of extended commands", doextlist, TRUE },
3895 { "?", "
\82±
\82Ì
\8ag
\92£
\83R
\83}
\83\93\83h
\88ê
\97\97\82ð
\95\
\8e¦
\82·
\82é", doextlist, TRUE },
3897 * There must be a blank entry here for every entry in the table
3900 { (char *) 0, (char *) 0, donull, TRUE }, /* levelchange */
3901 { (char *) 0, (char *) 0, donull, TRUE }, /* lightsources */
3902 #ifdef DEBUG_MIGRATING_MONS
3903 { (char *) 0, (char *) 0, donull, TRUE }, /* migratemons */
3905 { (char *) 0, (char *) 0, donull, TRUE }, /* monpolycontrol */
3906 { (char *) 0, (char *) 0, donull, TRUE }, /* panic */
3907 { (char *) 0, (char *) 0, donull, TRUE }, /* polyself */
3909 { (char *) 0, (char *) 0, donull, TRUE }, /* portdebug */
3911 { (char *) 0, (char *) 0, donull, TRUE }, /* seenv */
3912 { (char *) 0, (char *) 0, donull, TRUE }, /* stats */
3913 { (char *) 0, (char *) 0, donull, TRUE }, /* timeout */
3914 { (char *) 0, (char *) 0, donull, TRUE }, /* vanquished */
3915 { (char *) 0, (char *) 0, donull, TRUE }, /* vision */
3916 { (char *) 0, (char *) 0, donull, TRUE }, /* wizsmell */
3918 { (char *) 0, (char *) 0, donull, TRUE }, /* wizdebug_traveldisplay */
3919 { (char *) 0, (char *) 0, donull, TRUE }, /* wizdebug_bury */
3921 { (char *) 0, (char *) 0, donull, TRUE }, /* wizrumorcheck */
3922 { (char *) 0, (char *) 0, donull, TRUE }, /* wmode */
3923 { (char *) 0, (char *) 0, donull, TRUE } /* sentinel */
3926 /* there must be a placeholder in the table above for every entry here */
3927 static const struct ext_func_tab debug_extcmdlist[] = {
3929 { "levelchange", "change experience level", wiz_level_change, TRUE },
3931 { "levelchange", "
\8co
\8c±
\83\8c\83x
\83\8b\82ð
\95Ï
\82¦
\82é", wiz_level_change, TRUE},
3933 { "lightsources", "show mobile light sources", wiz_light_sources, TRUE },
3935 { "light sources", "
\88Ú
\93®
\8cõ
\8c¹
\82ð
\8c©
\82é", wiz_light_sources, TRUE},
3936 #ifdef DEBUG_MIGRATING_MONS
3938 { "migratemons", "migrate n random monsters", wiz_migrate_mons, TRUE },
3940 { "migratemons", "
\83\89\83\93\83_
\83\80\82È
\89ö
\95¨
\82ð
\89½
\91Ì
\82©
\88Ú
\8fZ
\82³
\82¹
\82é", wiz_migrate_mons, TRUE },
3943 { "monpolycontrol", "control monster polymorphs", wiz_mon_polycontrol,
3945 { "monpoly_control", "
\89ö
\95¨
\82Ö
\82Ì
\95Ï
\89»
\82ð
\90§
\8cä
\82·
\82é", wiz_mon_polycontrol,
3948 { "panic", "test panic routine (fatal to game)", wiz_panic, TRUE },
3950 { "panic", "
\83p
\83j
\83b
\83N
\83\8b\81[
\83`
\83\93\82ð
\83e
\83X
\83g
\82·
\82é(
\92v
\96½
\93I)", wiz_panic, TRUE},
3952 { "polyself", "polymorph self", wiz_polyself, TRUE },
3954 { "polyself", "
\95Ï
\89»
\82·
\82é", wiz_polyself, TRUE},
3957 { "portdebug", "wizard port debug command", wiz_port_debug, TRUE },
3959 { "portdebug", "
\83E
\83B
\83U
\81[
\83h
\83|
\81[
\83g
\83f
\83o
\83b
\83O
\83R
\83}
\83\93\83h", wiz_port_debug, TRUE },
3962 { "seenv", "show seen vectors", wiz_show_seenv, TRUE },
3964 { "seenv", "
\8e\8b\90ü
\83x
\83N
\83g
\83\8b\82ð
\8c©
\82é", wiz_show_seenv, TRUE},
3966 { "stats", "show memory statistics", wiz_show_stats, TRUE },
3968 { "stats", "
\83\81\83\82\83\8a\8fó
\91Ô
\82ð
\8c©
\82é", wiz_show_stats, TRUE},
3970 { "timeout", "look at timeout queue", wiz_timeout_queue, TRUE },
3972 { "timeout", "
\8e\9e\8aÔ
\90Ø
\82ê
\83L
\83\85\81[
\82ð
\8c©
\82é", wiz_timeout_queue, TRUE},
3974 { "vanquished", "list vanquished monsters", dovanquished, TRUE },
3976 { "vanquished", "
\93|
\82µ
\82½
\89ö
\95¨
\82Ì
\88ê
\97\97\82ð
\8c©
\82é", dovanquished, TRUE },
3978 { "vision", "show vision array", wiz_show_vision, TRUE },
3980 { "vision", "
\8e\8b\8aE
\94z
\97ñ
\82ð
\8c©
\82é", wiz_show_vision, TRUE},
3982 { "wizsmell", "smell monster", wiz_smell, TRUE },
3984 { "wizsmell", "
\89ö
\95¨
\82Ì
\93õ
\82¢
\82ð
\9ak
\82®", wiz_smell, TRUE },
3987 { "wizdebug_traveldisplay", "wizard debug: toggle travel display",
3989 { "wizdebug_traveldisplay", "
\83E
\83B
\83U
\81[
\83h
\83f
\83o
\83b
\83O:
\88Ú
\93®
\95\
\8e¦
\82ð
\90Ø
\82è
\91Ö
\82¦
\82é",
3990 wiz_debug_cmd_traveldisplay, TRUE },
3992 { "wizdebug_bury", "wizard debug: bury objs under and around you",
3994 { "wizdebug_bury", "
\83E
\83B
\83U
\81[
\83h
\82Å
\83o
\83b
\83O:
\95¨
\82ð
\82 \82È
\82½
\82Ì
\8eü
\82è
\82É
\96\84\82ß
\82é",
3995 wiz_debug_cmd_bury, TRUE },
3998 { "wizrumorcheck", "verify rumor boundaries", wiz_rumor_check, TRUE },
4000 { "wizrumorcheck", "
\89\
\82Ì
\8b«
\8aE
\82ð
\8c\9f\8fØ
\82·
\82é", wiz_rumor_check, TRUE },
4002 { "wmode", "show wall modes", wiz_show_wmodes, TRUE },
4004 { "wmode", "
\95Ç
\83\82\81[
\83h
\82ð
\8c©
\82é", wiz_show_wmodes, TRUE},
4005 { (char *) 0, (char *) 0, donull, TRUE }
4009 * Insert debug commands into the extended command list. This function
4010 * assumes that the last entry will be the help entry.
4012 * You must add entries in ext_func_tab every time you add one to the
4013 * debug_extcmdlist().
4016 add_debug_extended_commands()
4020 /* count the # of help entries */
4021 for (n = 0; extcmdlist[n].ef_txt[0] != '?'; n++)
4024 for (i = 0; debug_extcmdlist[i].ef_txt; i++) {
4025 /* need enough room for "?" entry plus terminator */
4026 if (n + 2 >= SIZE(extcmdlist))
4027 panic("Too many debugging commands!");
4028 for (j = 0; j < n; j++)
4029 if (strcmp(debug_extcmdlist[i].ef_txt, extcmdlist[j].ef_txt) < 0)
4032 /* insert i'th debug entry into extcmdlist[j], pushing down */
4033 for (k = n; k >= j; --k)
4034 extcmdlist[k + 1] = extcmdlist[k];
4035 extcmdlist[j] = debug_extcmdlist[i];
4036 n++; /* now an extra entry */
4045 for (i = 0; i < SIZE(cmdlist); ++i)
4046 if (cmdlist[i].f_funct == fn)
4047 return cmdlist[i].f_char;
4051 static const char template[] = "%-18s %4ld %6ld";
4052 static const char count_str[] = " count bytes";
4053 static const char separator[] = "------------------ ----- ------";
4059 int sz = (int) sizeof(struct obj);
4062 sz += (int) sizeof(struct oextra);
4064 sz += (int) strlen(ONAME(otmp)) + 1;
4066 sz += (int) sizeof(struct monst);
4068 sz += (int) sizeof(unsigned);
4070 sz += (int) sizeof(long);
4072 sz += (int) strlen(OMAILCMD(otmp)) + 1;
4078 count_obj(chain, total_count, total_size, top, recurse)
4088 for (count = size = 0, obj = chain; obj; obj = obj->nobj) {
4091 size += size_obj(obj);
4093 if (recurse && obj->cobj)
4094 count_obj(obj->cobj, total_count, total_size, TRUE, TRUE);
4096 *total_count += count;
4097 *total_size += size;
4101 obj_chain(win, src, chain, total_count, total_size)
4109 long count = 0, size = 0;
4111 count_obj(chain, &count, &size, TRUE, FALSE);
4112 *total_count += count;
4113 *total_size += size;
4114 Sprintf(buf, template, src, count, size);
4115 putstr(win, 0, buf);
4119 mon_invent_chain(win, src, chain, total_count, total_size)
4122 struct monst *chain;
4127 long count = 0, size = 0;
4130 for (mon = chain; mon; mon = mon->nmon)
4131 count_obj(mon->minvent, &count, &size, TRUE, FALSE);
4132 *total_count += count;
4133 *total_size += size;
4134 Sprintf(buf, template, src, count, size);
4135 putstr(win, 0, buf);
4139 contained(win, src, total_count, total_size)
4146 long count = 0, size = 0;
4149 count_obj(invent, &count, &size, FALSE, TRUE);
4150 count_obj(fobj, &count, &size, FALSE, TRUE);
4151 count_obj(level.buriedobjlist, &count, &size, FALSE, TRUE);
4152 count_obj(migrating_objs, &count, &size, FALSE, TRUE);
4153 /* DEADMONSTER check not required in this loop since they have no
4155 for (mon = fmon; mon; mon = mon->nmon)
4156 count_obj(mon->minvent, &count, &size, FALSE, TRUE);
4157 for (mon = migrating_mons; mon; mon = mon->nmon)
4158 count_obj(mon->minvent, &count, &size, FALSE, TRUE);
4160 *total_count += count;
4161 *total_size += size;
4163 Sprintf(buf, template, src, count, size);
4164 putstr(win, 0, buf);
4171 int sz = (int) sizeof(struct monst);
4174 sz += (int) sizeof(struct mextra);
4176 sz += (int) strlen(MNAME(mtmp)) + 1;
4178 sz += (int) sizeof(struct egd);
4180 sz += (int) sizeof(struct epri);
4182 sz += (int) sizeof(struct eshk);
4184 sz += (int) sizeof(struct emin);
4186 sz += (int) sizeof(struct edog);
4187 /* mextra->mcorpsenm doesn't point to more memory */
4193 mon_chain(win, src, chain, total_count, total_size)
4196 struct monst *chain;
4204 for (count = size = 0, mon = chain; mon; mon = mon->nmon) {
4206 size += size_monst(mon);
4208 *total_count += count;
4209 *total_size += size;
4210 Sprintf(buf, template, src, count, size);
4211 putstr(win, 0, buf);
4215 * Display memory usage of all monsters and objects on the level.
4222 long total_obj_size = 0, total_obj_count = 0;
4223 long total_mon_size = 0, total_mon_count = 0;
4225 win = create_nhwindow(NHW_TEXT);
4226 putstr(win, 0, "Current memory statistics:");
4228 Sprintf(buf, "Objects, size %d", (int) sizeof(struct obj));
4229 putstr(win, 0, buf);
4231 putstr(win, 0, count_str);
4233 obj_chain(win, "invent", invent, &total_obj_count, &total_obj_size);
4234 obj_chain(win, "fobj", fobj, &total_obj_count, &total_obj_size);
4235 obj_chain(win, "buried", level.buriedobjlist, &total_obj_count,
4237 obj_chain(win, "migrating obj", migrating_objs, &total_obj_count,
4239 mon_invent_chain(win, "minvent", fmon, &total_obj_count, &total_obj_size);
4240 mon_invent_chain(win, "migrating minvent", migrating_mons,
4241 &total_obj_count, &total_obj_size);
4243 contained(win, "contained", &total_obj_count, &total_obj_size);
4245 putstr(win, 0, separator);
4246 Sprintf(buf, template, "Total", total_obj_count, total_obj_size);
4247 putstr(win, 0, buf);
4251 Sprintf(buf, "Monsters, size %d", (int) sizeof(struct monst));
4252 putstr(win, 0, buf);
4255 mon_chain(win, "fmon", fmon, &total_mon_count, &total_mon_size);
4256 mon_chain(win, "migrating", migrating_mons, &total_mon_count,
4259 putstr(win, 0, separator);
4260 Sprintf(buf, template, "Total", total_mon_count, total_mon_size);
4261 putstr(win, 0, buf);
4263 #if defined(__BORLANDC__) && !defined(_WIN32)
4264 show_borlandc_stats(win);
4267 display_nhwindow(win, FALSE);
4268 destroy_nhwindow(win);
4276 timer_sanity_check();
4278 light_sources_sanity_check();
4281 #ifdef DEBUG_MIGRATING_MONS
4287 struct permonst *ptr;
4291 getlin("How many random monsters to migrate? [0]", inbuf);
4292 if (*inbuf == '\033')
4294 mcount = atoi(inbuf);
4295 if (mcount < 0 || mcount > (COLNO * ROWNO) || Is_botlevel(&u.uz))
4297 while (mcount > 0) {
4298 if (Is_stronghold(&u.uz))
4299 assign_level(&tolevel, &valley_level);
4301 get_level(&tolevel, depth(&u.uz) + 1);
4303 mtmp = makemon(ptr, 0, 0, NO_MM_FLAGS);
4305 migrate_to_level(mtmp, ledger_no(&tolevel), MIGR_RANDOM,
4313 #define unctrl(c) ((c) <= C('z') ? (0x60 | (c)) : (c))
4314 #define unmeta(c) (0x7f & (c))
4316 /* called at startup and after number_pad is twiddled */
4318 reset_commands(initial)
4321 static const char sdir[] = "hykulnjb><",
4322 sdir_swap_yz[] = "hzkulnjb><",
4323 ndir[] = "47896321><",
4324 ndir_phone_layout[] = "41236987><";
4325 static const int ylist[] = {
4326 'y', 'Y', C('y'), M('y'), M('Y'), M(C('y'))
4328 const struct func_tab *cmdtmp;
4330 int c, i, updated = 0;
4334 for (i = 0; i < SIZE(cmdlist); i++) {
4335 c = cmdlist[i].f_char & 0xff;
4336 Cmd.commands[c] = &cmdlist[i];
4338 Cmd.num_pad = FALSE;
4339 Cmd.pcHack_compat = Cmd.phone_layout = Cmd.swap_yz = FALSE;
4342 flagtemp = iflags.num_pad;
4343 if (flagtemp != Cmd.num_pad) {
4344 Cmd.num_pad = flagtemp;
4347 /* swap_yz mode (only applicable for !num_pad) */
4348 flagtemp = (iflags.num_pad_mode & 1) ? !Cmd.num_pad : FALSE;
4349 if (flagtemp != Cmd.swap_yz) {
4350 Cmd.swap_yz = flagtemp;
4352 /* Cmd.swap_yz has been toggled;
4353 perform the swap (or reverse previous one) */
4354 for (i = 0; i < SIZE(ylist); i++) {
4355 c = ylist[i] & 0xff;
4356 cmdtmp = Cmd.commands[c]; /* tmp = [y] */
4357 Cmd.commands[c] = Cmd.commands[c + 1]; /* [y] = [z] */
4358 Cmd.commands[c + 1] = cmdtmp; /* [z] = tmp */
4361 /* MSDOS compatibility mode (only applicable for num_pad) */
4362 flagtemp = (iflags.num_pad_mode & 1) ? Cmd.num_pad : FALSE;
4363 if (flagtemp != Cmd.pcHack_compat) {
4364 Cmd.pcHack_compat = flagtemp;
4366 /* pcHack_compat has been toggled */
4368 cmdtmp = Cmd.commands['5'];
4369 Cmd.commands['5'] = Cmd.commands[c];
4370 Cmd.commands[c] = cmdtmp;
4372 Cmd.commands[c] = Cmd.pcHack_compat ? Cmd.commands['I'] : 0;
4374 /* phone keypad layout (only applicable for num_pad) */
4375 flagtemp = (iflags.num_pad_mode & 2) ? Cmd.num_pad : FALSE;
4376 if (flagtemp != Cmd.phone_layout) {
4377 Cmd.phone_layout = flagtemp;
4379 /* phone_layout has been toggled */
4380 for (i = 0; i < 3; i++) {
4381 c = '1' + i; /* 1,2,3 <-> 7,8,9 */
4382 cmdtmp = Cmd.commands[c]; /* tmp = [1] */
4383 Cmd.commands[c] = Cmd.commands[c + 6]; /* [1] = [7] */
4384 Cmd.commands[c + 6] = cmdtmp; /* [7] = tmp */
4385 c = (M('1') & 0xff) + i; /* M-1,M-2,M-3 <-> M-7,M-8,M-9 */
4386 cmdtmp = Cmd.commands[c]; /* tmp = [M-1] */
4387 Cmd.commands[c] = Cmd.commands[c + 6]; /* [M-1] = [M-7] */
4388 Cmd.commands[c + 6] = cmdtmp; /* [M-7] = tmp */
4395 Cmd.dirchars = !Cmd.num_pad
4396 ? (!Cmd.swap_yz ? sdir : sdir_swap_yz)
4397 : (!Cmd.phone_layout ? ndir : ndir_phone_layout);
4398 Cmd.alphadirchars = !Cmd.num_pad ? Cmd.dirchars : sdir;
4400 Cmd.move_W = Cmd.dirchars[0];
4401 Cmd.move_NW = Cmd.dirchars[1];
4402 Cmd.move_N = Cmd.dirchars[2];
4403 Cmd.move_NE = Cmd.dirchars[3];
4404 Cmd.move_E = Cmd.dirchars[4];
4405 Cmd.move_SE = Cmd.dirchars[5];
4406 Cmd.move_S = Cmd.dirchars[6];
4407 Cmd.move_SW = Cmd.dirchars[7];
4411 accept_menu_prefix(cmd_func)
4412 int NDECL((*cmd_func));
4414 if (cmd_func == dopickup || cmd_func == dotip
4415 || cmd_func == doextcmd || cmd_func == doextlist)
4424 boolean do_walk, do_rush, prefix_seen, bad_command,
4425 firsttime = (cmd == 0);
4427 iflags.menu_requested = FALSE;
4429 if (program_state.done_hup)
4436 if (*cmd == '\033') {
4437 context.move = FALSE;
4440 if (*cmd == DOAGAIN && !in_doagain && saveq[0]) {
4443 rhack((char *) 0); /* read and execute command */
4447 /* Special case of *cmd == ' ' handled better below */
4448 if (!*cmd || *cmd == (char) 0377) {
4450 context.move = FALSE;
4451 return; /* probably we just had an interrupt */
4454 /* handle most movement commands */
4455 do_walk = do_rush = prefix_seen = FALSE;
4456 context.travel = context.travel1 = 0;
4459 if (movecmd(cmd[1])) {
4467 break; /* else FALLTHRU */
4469 if (movecmd(lowc(cmd[1]))) {
4477 break; /* else FALLTHRU */
4478 /* Effects of movement commands and invisible monsters:
4479 * m: always move onto space (even if 'I' remembered)
4480 * F: always attack space (even if 'I' not remembered)
4481 * normal movement: attack if 'I', move otherwise.
4484 if (movecmd(cmd[1])) {
4485 context.forcefight = 1;
4491 if (movecmd(cmd[1]) || u.dz) {
4497 cmd[0] = cmd[1]; /* "m<" or "m>" */
4502 if (movecmd(lowc(cmd[1]))) {
4512 (void) ddoinv(); /* a convenience borrowed from the PC */
4513 context.move = FALSE;
4517 if (iflags.clicklook) {
4518 context.move = FALSE;
4519 do_look(2, &clicklook_cc);
4523 if (flags.travelcmd) {
4525 context.travel1 = 1;
4533 if (movecmd(*cmd)) { /* ordinary movement */
4534 context.run = 0; /* only matters here if it was 8 */
4536 } else if (movecmd(Cmd.num_pad ? unmeta(*cmd) : lowc(*cmd))) {
4539 } else if (movecmd(unctrl(*cmd))) {
4546 /* some special prefix handling */
4547 /* overload 'm' prefix to mean "request a menu" */
4548 if (prefix_seen && cmd[0] == 'm') {
4549 /* (for func_tab cast, see below) */
4550 const struct func_tab *ft = Cmd.commands[cmd[1] & 0xff];
4551 int NDECL((*func)) = ft ? ((struct func_tab *) ft)->f_funct : 0;
4553 if (func && accept_menu_prefix(func)) {
4554 iflags.menu_requested = TRUE;
4559 if ((do_walk || do_rush) && !context.travel && !dxdy_moveok()) {
4560 /* trying to move diagonally as a grid bug;
4561 this used to be treated by movecmd() as not being
4562 a movement attempt, but that didn't provide for any
4563 feedback and led to strangeness if the key pressed
4564 ('u' in particular) was overloaded for num_pad use */
4565 You_cant("get there from here...");
4567 context.nopick = context.forcefight = FALSE;
4568 context.move = context.mv = FALSE;
4577 context.forcefight = 0;
4579 } else if (do_rush) {
4582 multi = max(COLNO, ROWNO);
4583 u.last_str_turn = 0;
4588 } else if (prefix_seen && cmd[1] == '\033') { /* <prefix><escape> */
4589 /* don't report "unknown command" for change of heart... */
4590 bad_command = FALSE;
4591 } else if (*cmd == ' ' && !flags.rest_on_space) {
4592 bad_command = TRUE; /* skip cmdlist[] loop */
4594 /* handle all other commands */
4596 register const struct func_tab *tlist;
4597 int res, NDECL((*func));
4600 /* obsolete - scan through the cmdlist array looking for *cmd */
4601 for (tlist = cmdlist; tlist->f_char; tlist++) {
4602 if ((*cmd & 0xff) != (tlist->f_char & 0xff))
4605 /* current - use *cmd to directly index cmdlist array */
4606 if ((tlist = Cmd.commands[*cmd & 0xff]) != 0) {
4608 if (u.uburied && !tlist->can_if_buried) {
4610 You_cant("do that while you are buried!");
4612 You("
\96\84\82Ü
\82Á
\82Ä
\82¢
\82é
\8e\9e\82É
\82»
\82ñ
\82È
\82±
\82Æ
\82Í
\82Å
\82«
\82È
\82¢
\81I");
4615 /* we discard 'const' because some compilers seem to have
4616 trouble with the pointer passed to set_occupation() */
4617 func = ((struct func_tab *) tlist)->f_funct;
4618 if (tlist->f_text && !occupation && multi)
4619 set_occupation(func, tlist->f_text, multi);
4620 res = (*func)(); /* perform the command */
4623 context.move = FALSE;
4628 /* if we reach here, cmd wasn't found in cmdlist[] */
4634 register char c, *cp = expcmd;
4636 while ((c = *cmd++) != '\0'
4637 && (int) (cp - expcmd) < (int) (sizeof expcmd - 3)) {
4638 if (c >= 040 && c < 0177) {
4640 } else if (c & 0200) {
4650 if (!prefix_seen || !iflags.cmdassist
4652 || !help_dir(0, "Invalid direction key!"))
4654 || !help_dir(0, "
\96³
\8cø
\82È
\95û
\8cü
\8ew
\92è
\82Å
\82·
\81I"))
4656 Norep("Unknown command '%s'.", expcmd);
4658 Norep("'%s'
\83R
\83}
\83\93\83h
\81H", expcmd);
4661 context.move = FALSE;
4666 /* convert an x,y pair into a direction code */
4673 for (dd = 0; dd < 8; dd++)
4674 if (x == xdir[dd] && y == ydir[dd])
4679 /* convert a direction code into an x,y pair */
4690 /* also sets u.dz, but returns false for <> */
4695 register const char *dp = index(Cmd.dirchars, sym);
4700 u.dx = xdir[dp - Cmd.dirchars];
4701 u.dy = ydir[dp - Cmd.dirchars];
4702 u.dz = zdir[dp - Cmd.dirchars];
4703 #if 0 /* now handled elsewhere */
4704 if (u.dx && u.dy && NODIAG(u.umonnum)) {
4712 /* grid bug handling which used to be in movecmd() */
4716 if (u.dx && u.dy && NODIAG(u.umonnum))
4718 return u.dx || u.dy;
4721 /* decide whether a character (user input keystroke) requests screen repaint */
4726 return (boolean) (c == C('r') || (Cmd.num_pad && c == C('l')));
4730 * uses getdir() but unlike getdir() it specifically
4731 * produces coordinates using the direction from getdir()
4732 * and verifies that those coordinates are ok.
4734 * If the call to getdir() returns 0, Never_mind is displayed.
4735 * If the resulting coordinates are not okay, emsg is displayed.
4737 * Returns non-zero if coordinates in cc are valid.
4740 get_adjacent_loc(prompt, emsg, x, y, cc)
4741 const char *prompt, *emsg;
4746 if (!getdir(prompt)) {
4752 if (cc && isok(new_x, new_y)) {
4771 if (in_doagain || *readchar_queue)
4772 dirsym = readchar();
4775 dirsym = yn_function((s && *s != '^') ? s : "In what direction?",
4777 dirsym = yn_function((s && *s != '^') ? s : "
\82Ç
\82Ì
\95û
\8cü
\81H",
4779 /* remove the prompt string so caller won't have to */
4780 clear_nhwindow(WIN_MESSAGE);
4782 if (redraw_cmd(dirsym)) { /* ^R */
4783 docrt(); /* redraw */
4788 if (dirsym == '.' || dirsym == 's') {
4789 u.dx = u.dy = u.dz = 0;
4790 } else if (!(is_mov = movecmd(dirsym)) && !u.dz) {
4791 boolean did_help = FALSE, help_requested;
4793 if (!index(quitchars, dirsym)) {
4794 help_requested = (dirsym == '?');
4795 if (help_requested || iflags.cmdassist) {
4797 help_dir((s && *s == '^') ? dirsym : 0,
4798 help_requested ? (const char *) 0
4800 : "Invalid direction key!");
4802 : "
\96³
\8cø
\82È
\95û
\8cü
\8ew
\92è
\82Å
\82·
\81I");
4808 pline("What a strange direction!");
4810 pline("
\82¸
\82¢
\82Ô
\82ñ
\82Æ
\8aï
\96
\82È
\95û
\8cü
\82¾
\81I");
4813 } else if (is_mov && !dxdy_moveok()) {
4815 You_cant("orient yourself that direction.");
4817 You_cant("
\8cü
\82«
\82É
\8e©
\95ª
\8e©
\90g
\82ð
\8ew
\92è
\82Å
\82«
\82È
\82¢
\81D");
4820 if (!u.dz && (Stunned || (Confusion && !rn2(5))))
4832 static const char wiz_only_list[] = "EFGIOVW";
4833 char buf[BUFSZ], buf2[BUFSZ], *explain;
4835 win = create_nhwindow(NHW_TEXT);
4839 Sprintf(buf, "cmdassist: %s", msg);
4840 putstr(win, 0, buf);
4845 ctrl = (sym - 'A') + 1;
4846 if ((explain = dowhatdoes_core(ctrl, buf2))
4847 && (!index(wiz_only_list, sym) || wizard)) {
4848 Sprintf(buf, "Are you trying to use ^%c%s?", sym,
4849 index(wiz_only_list, sym)
4851 : " as specified in the Guidebook");
4852 putstr(win, 0, buf);
4854 putstr(win, 0, explain);
4856 putstr(win, 0, "To use that command, you press");
4857 Sprintf(buf, "the <Ctrl> key, and the <%c> key at the same time.",
4859 putstr(win, 0, buf);
4863 if (NODIAG(u.umonnum)) {
4864 putstr(win, 0, "Valid direction keys in your current form are:");
4865 Sprintf(buf, " %c ", Cmd.move_N);
4866 putstr(win, 0, buf);
4867 putstr(win, 0, " | ");
4868 Sprintf(buf, " %c- . -%c", Cmd.move_W, Cmd.move_E);
4869 putstr(win, 0, buf);
4870 putstr(win, 0, " | ");
4871 Sprintf(buf, " %c ", Cmd.move_S);
4872 putstr(win, 0, buf);
4874 putstr(win, 0, "Valid direction keys are:");
4875 Sprintf(buf, " %c %c %c", Cmd.move_NW, Cmd.move_N,
4877 putstr(win, 0, buf);
4878 putstr(win, 0, " \\ | / ");
4879 Sprintf(buf, " %c- . -%c", Cmd.move_W, Cmd.move_E);
4880 putstr(win, 0, buf);
4881 putstr(win, 0, " / | \\ ");
4882 Sprintf(buf, " %c %c %c", Cmd.move_SW, Cmd.move_S,
4884 putstr(win, 0, buf);
4887 putstr(win, 0, " < up");
4888 putstr(win, 0, " > down");
4889 putstr(win, 0, " . direct at yourself");
4891 /* non-null msg means that this wasn't an explicit user request */
4895 "(Suppress this message with !cmdassist in config file.)");
4897 "(
\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)");
4899 display_nhwindow(win, FALSE);
4900 destroy_nhwindow(win);
4907 register int x = NODIAG(u.umonnum) ? 2 * rn2(4) : rn2(8);
4918 static NEARDATA const char *const dirnames[] = {
4919 "west", "northwest", "north", "northeast", "east",
4920 "southeast", "south", "southwest", "down", "up",
4923 if (dir < 0 || dir >= SIZE(dirnames))
4925 return dirnames[dir];
4932 /* x corresponds to curx, so x==1 is the first column. Ach. %% */
4933 return x >= 1 && x <= COLNO - 1 && y >= 0 && y <= ROWNO - 1;
4936 static NEARDATA int last_multi;
4939 * convert a MAP window position into a movecmd
4942 click_to_cmd(x, y, mod)
4949 if (iflags.clicklook && mod == CLICK_2) {
4952 cmd[0] = CMD_CLICKLOOK;
4959 if (flags.travelcmd) {
4960 if (abs(x) <= 1 && abs(y) <= 1) {
4961 x = sgn(x), y = sgn(y);
4965 cmd[0] = CMD_TRAVEL;
4969 if (x == 0 && y == 0) {
4971 if (IS_FOUNTAIN(levl[u.ux][u.uy].typ)
4972 || IS_SINK(levl[u.ux][u.uy].typ)) {
4973 cmd[0] = mod == CLICK_1 ? 'q' : M('d');
4975 } else if (IS_THRONE(levl[u.ux][u.uy].typ)) {
4978 } else if ((u.ux == xupstair && u.uy == yupstair)
4979 || (u.ux == sstairs.sx && u.uy == sstairs.sy
4981 || (u.ux == xupladder && u.uy == yupladder)) {
4983 } else if ((u.ux == xdnstair && u.uy == ydnstair)
4984 || (u.ux == sstairs.sx && u.uy == sstairs.sy
4986 || (u.ux == xdnladder && u.uy == ydnladder)) {
4988 } else if (OBJ_AT(u.ux, u.uy)) {
4990 Is_container(level.objects[u.ux][u.uy]) ? M('l') : ',';
4993 return "."; /* just rest */
4997 /* directional commands */
5001 if (!m_at(u.ux + x, u.uy + y)
5002 && !test_move(u.ux, u.uy, x, y, TEST_MOVE)) {
5003 cmd[1] = Cmd.dirchars[dir];
5005 if (IS_DOOR(levl[u.ux + x][u.uy + y].typ)) {
5006 /* slight assistance to the player: choose kick/open for them
5008 if (levl[u.ux + x][u.uy + y].doormask & D_LOCKED) {
5012 if (levl[u.ux + x][u.uy + y].doormask & D_CLOSED) {
5017 if (levl[u.ux + x][u.uy + y].typ <= SCORR) {
5024 /* convert without using floating point, allowing sloppy clicking */
5027 else if (y > 2 * abs(x))
5029 else if (x < -2 * abs(y))
5031 else if (y < -2 * abs(x))
5034 x = sgn(x), y = sgn(y);
5036 if (x == 0 && y == 0) /* map click on player to "rest" command */
5042 /* move, attack, etc. */
5044 if (mod == CLICK_1) {
5045 cmd[0] = Cmd.dirchars[dir];
5047 cmd[0] = (Cmd.num_pad
5048 ? M(Cmd.dirchars[dir])
5049 : (Cmd.dirchars[dir] - 'a' + 'A')); /* run command */
5058 #ifdef LINT /* static char in_line[COLNO]; */
5059 char in_line[COLNO];
5061 static char in_line[COLNO];
5064 boolean prezero = FALSE;
5068 flush_screen(1); /* Flush screen buffer. Put the cursor on the hero. */
5071 alt_esc = iflags.altmeta; /* readchar() hack */
5073 if (!Cmd.num_pad || (foo = readchar()) == 'n')
5076 if (foo >= '0' && foo <= '9') {
5077 multi = 10 * multi + foo - '0';
5078 if (multi < 0 || multi >= LARGEST_INT)
5079 multi = LARGEST_INT;
5081 clear_nhwindow(WIN_MESSAGE);
5083 Sprintf(in_line, "Count: %d", multi);
5085 Sprintf(in_line, "
\90\94: %d", multi);
5090 if (!multi && foo == '0')
5093 break; /* not a digit */
5096 alt_esc = FALSE; /* readchar() reset */
5099 if (foo == '\033') { /* esc cancels count (TH) */
5100 clear_nhwindow(WIN_MESSAGE);
5101 multi = last_multi = 0;
5102 } else if (foo == DOAGAIN || in_doagain) {
5106 savech(0); /* reset input queue */
5114 save_cm = (char *) 0;
5116 /* in 3.4.3 this was in rhack(), where it was too late to handle M-5 */
5117 if (Cmd.pcHack_compat) {
5118 /* This handles very old inconsistent DOS/Windows behaviour
5119 in a different way: earlier, the keyboard handler mapped
5120 these, which caused counts to be strange when entered
5121 from the number pad. Now do not map them until here. */
5139 if (foo == 'g' || foo == 'G' || foo == 'm' || foo == 'M' || foo == 'F'
5140 || (Cmd.num_pad && (foo == '5' || foo == '-'))) {
5146 clear_nhwindow(WIN_MESSAGE);
5148 in_line[0] = '\033';
5152 #ifdef HANGUPHANDLING
5153 /* some very old systems, or descendents of such systems, expect signal
5154 handlers to have return type `int', but they don't actually inspect
5155 the return value so we should be safe using `void' unconditionally */
5158 hangup(sig_unused) /* called as signal() handler, so sent at least one arg */
5159 int sig_unused UNUSED;
5161 if (program_state.exiting)
5162 program_state.in_moveloop = 0;
5165 /* When using SAFERHANGUP, the done_hup flag it tested in rhack
5166 and a couple of other places; actual hangup handling occurs then.
5167 This is 'safer' because it disallows certain cheats and also
5168 protects against losing objects in the process of being thrown,
5169 but also potentially riskier because the disconnected program
5170 must continue running longer before attempting a hangup save. */
5171 program_state.done_hup++;
5172 /* defer hangup iff game appears to be in progress */
5173 if (program_state.in_moveloop && program_state.something_worth_saving)
5175 #endif /* SAFERHANGUP */
5182 #ifdef NOSAVEONHANGUP
5184 if (flags.ins_chkpt && program_state.something_worth_saving)
5185 program_statue.preserve_locks = 1; /* keep files for recovery */
5187 program_state.something_worth_saving = 0; /* don't save */
5191 if (!program_state.done_hup++)
5193 if (program_state.something_worth_saving)
5195 if (iflags.window_inited)
5196 exit_nhwindows((char *) 0);
5198 terminate(EXIT_SUCCESS);
5199 /*NOTREACHED*/ /* not necessarily true for vms... */
5202 #endif /* HANGUPHANDLING */
5208 int x = u.ux, y = u.uy, mod = 0;
5210 if (*readchar_queue)
5211 sym = *readchar_queue++;
5213 sym = in_doagain ? pgetchar() : nh_poskey(&x, &y, &mod);
5217 register int cnt = NR_OF_EOFS;
5219 * Some SYSV systems seem to return EOFs for various reasons
5220 * (?like when one hits break or for interrupted systemcalls?),
5221 * and we must see several before we quit.
5224 clearerr(stdin); /* omit if clearerr is undefined */
5226 } while (--cnt && sym == EOF);
5228 #endif /* NR_OF_EOFS */
5231 #ifdef HANGUPHANDLING
5232 hangup(0); /* call end_of_input() or set program_state.done_hup */
5236 } else if (sym == '\033' && alt_esc) {
5237 /* iflags.altmeta: treat two character ``ESC c'' as single `M-c' */
5238 sym = *readchar_queue ? *readchar_queue++ : pgetchar();
5239 if (sym == EOF || sym == 0)
5241 else if (sym != '\033')
5242 sym |= 0200; /* force 8th bit on */
5244 } else if (sym == 0) {
5246 readchar_queue = click_to_cmd(x, y, mod);
5247 sym = *readchar_queue++;
5255 /* Keyboard travel command */
5259 if (!flags.travelcmd)
5262 cc.x = iflags.travelcc.x;
5263 cc.y = iflags.travelcc.y;
5264 if (cc.x == -1 && cc.y == -1) {
5265 /* No cached destination, start attempt from current position */
5270 pline("Where do you want to travel to?");
5272 pline("
\82Ç
\82±
\82É
\88Ú
\93®
\82·
\82é
\81H");
5274 if (getpos(&cc, TRUE, "the desired destination") < 0) {
5276 if (getpos(&cc, TRUE, "
\88Ú
\93®
\90æ") < 0) {
5277 /* user pressed ESC */
5280 iflags.travelcc.x = u.tx = cc.x;
5281 iflags.travelcc.y = u.ty = cc.y;
5282 cmd[0] = CMD_TRAVEL;
5283 readchar_queue = cmd;
5288 extern void NDECL(win32con_debug_keystrokes);
5289 extern void NDECL(win32con_handler_info);
5298 int num_menu_selections;
5299 struct menu_selection_struct {
5302 } menu_selections[] = {
5304 { "test win32 keystrokes (tty only)", win32con_debug_keystrokes },
5305 { "show keystroke handler information (tty only)",
5306 win32con_handler_info },
5308 { (char *) 0, (void NDECL((*) )) 0 } /* array terminator */
5311 num_menu_selections = SIZE(menu_selections) - 1;
5312 if (num_menu_selections > 0) {
5313 menu_item *pick_list;
5314 win = create_nhwindow(NHW_MENU);
5316 for (k = 0; k < num_menu_selections; ++k) {
5318 add_menu(win, NO_GLYPH, &any, item++, 0, ATR_NONE,
5319 menu_selections[k].menutext, MENU_UNSELECTED);
5321 end_menu(win, "Which port debugging feature?");
5322 n = select_menu(win, PICK_ONE, &pick_list);
5323 destroy_nhwindow(win);
5325 n = pick_list[0].item.a_int - 1;
5326 free((genericptr_t) pick_list);
5327 /* execute the function */
5328 (*menu_selections[n].fn)();
5331 pline("No port-specific debug capability defined.");
5334 #endif /*PORT_DEBUG*/
5337 * Parameter validator for generic yes/no function to prevent
5338 * the core from sending too long a prompt string to the
5339 * window port causing a buffer overflow there.
5342 yn_function(query, resp, def)
5343 const char *query, *resp;
5348 iflags.last_msg = PLNMSG_UNKNOWN; /* most recent pline is clobbered */
5350 /* maximum acceptable length is QBUFSZ-1 */
5351 if (strlen(query) < QBUFSZ)
5352 return (*windowprocs.win_yn_function)(query, resp, def);
5354 /* caller shouldn't have passed anything this long */
5355 paniclog("Query truncated: ", query);
5356 (void) strncpy(qbuf, query, QBUFSZ - 1 - 3);
5357 Strcpy(&qbuf[QBUFSZ - 1 - 3], "...");
5358 return (*windowprocs.win_yn_function)(qbuf, resp, def);
5361 /* for paranoid_confirm:quit,die,attack prompting */
5363 paranoid_query(be_paranoid, prompt)
5364 boolean be_paranoid;
5367 boolean confirmed_ok;
5369 /* when paranoid, player must respond with "yes" rather than just 'y'
5370 to give the go-ahead for this query; default is "no" unless the
5371 ParanoidConfirm flag is set in which case there's no default */
5373 char qbuf[QBUFSZ], ans[BUFSZ];
5374 const char *promptprefix = "", *responsetype = ParanoidConfirm
5377 int trylimit = 6; /* 1 normal, 5 more with "Yes or No:" prefix */
5379 /* in addition to being paranoid about this particular
5380 query, we might be even more paranoid about all paranoia
5381 responses (ie, ParanoidConfirm is set) in which case we
5382 require "no" to reject in addition to "yes" to confirm
5383 (except we won't loop if response is ESC; it means no) */
5385 Sprintf(qbuf, "%s%s %s", promptprefix, prompt, responsetype);
5387 (void) mungspaces(ans);
5388 confirmed_ok = !strcmpi(ans, "yes");
5389 if (confirmed_ok || *ans == '\033')
5391 promptprefix = "\"Yes\" or \"No\": ";
5392 } while (ParanoidConfirm && strcmpi(ans, "no") && --trylimit);
5394 confirmed_ok = (yn(prompt) == 'y');
5396 return confirmed_ok;
5403 /* Does current window system support suspend? */
5404 if ((*windowprocs.win_can_suspend)()) {
5405 /* NB: SYSCF SHELLERS handled in port code. */
5409 Norep("Suspend command not available.");