OSDN Git Service

update year to 2020
[jnethack/source.git] / src / sounds.c
1 /* NetHack 3.6  sounds.c        $NHDT-Date: 1570844005 2019/10/12 01:33:25 $  $NHDT-Branch: NetHack-3.6 $:$NHDT-Revision: 1.83 $ */
2 /*      Copyright (c) 1989 Janet Walz, Mike Threepoint */
3 /* NetHack may be freely redistributed.  See license for details. */
4
5 /* JNetHack Copyright */
6 /* (c) Issei Numata, Naoki Hamada, Shigehiro Miyashita, 1994-2000  */
7 /* For 3.4-, Copyright (c) SHIRAKATA Kentaro, 2002-2020            */
8 /* JNetHack may be freely redistributed.  See license for details. */
9
10 #include "hack.h"
11
12 STATIC_DCL boolean FDECL(mon_is_gecko, (struct monst *));
13 STATIC_DCL int FDECL(domonnoise, (struct monst *));
14 STATIC_DCL int NDECL(dochat);
15 STATIC_DCL int FDECL(mon_in_room, (struct monst *, int));
16
17 /* this easily could be a macro, but it might overtax dumb compilers */
18 STATIC_OVL int
19 mon_in_room(mon, rmtyp)
20 struct monst *mon;
21 int rmtyp;
22 {
23     int rno = levl[mon->mx][mon->my].roomno;
24     if (rno >= ROOMOFFSET)
25         return rooms[rno - ROOMOFFSET].rtype == rmtyp;
26     return FALSE;
27 }
28
29 void
30 dosounds()
31 {
32     register struct mkroom *sroom;
33     register int hallu, vx, vy;
34 #if defined(AMIGA) && defined(AZTEC_C_WORKAROUND)
35     int xx;
36 #endif
37     struct monst *mtmp;
38
39     if (Deaf || !flags.acoustics || u.uswallow || Underwater)
40         return;
41
42     hallu = Hallucination ? 1 : 0;
43
44     if (level.flags.nfountains && !rn2(400)) {
45 #if 0 /*JP:T*/
46         static const char *const fountain_msg[4] = {
47             "bubbling water.", "water falling on coins.",
48             "the splashing of a naiad.", "a soda fountain!",
49 #else
50         static const char *const fountain_msg[4] = {
51             "\83S\83{\83S\83{\82Æ\82¢\82¤\89¹\82ð\95·\82¢\82½\81D", "\83s\83`\83\83\83s\83`\83\83\82Æ\82¢\82¤\89¹\82ð\95·\82¢\82½\81D",
52             "\83o\83V\83\83\83o\83V\83\83\82Æ\82¢\82¤\89¹\82ð\95·\82¢\82½\81D", "\92Y\8e_\88ù\97¿\82Ì\83V\83\85\81[\82Æ\82¢\82¤\89¹\82ð\95·\82¢\82½\81I",
53 #endif
54         };
55         You_hear1(fountain_msg[rn2(3) + hallu]);
56     }
57     if (level.flags.nsinks && !rn2(300)) {
58 #if 0 /*JP:T*/
59         static const char *const sink_msg[3] = {
60             "a slow drip.", "a gurgling noise.", "dishes being washed!",
61 #else
62         static const char *const sink_msg[3] = {
63             "\90\85\82ª\82Û\82½\82Û\82½\82Æ\97\8e\82¿\82é\89¹\82ð\95·\82¢\82½\81D",
64             "\82ª\82ç\82ª\82ç\82Æ\82¢\82¤\89¹\82ð\95·\82¢\82½\81D",
65             "\8eM\82ð\90ô\82¤\89¹\82ð\95·\82¢\82½\81I",
66 #endif
67         };
68         You_hear1(sink_msg[rn2(2) + hallu]);
69     }
70     if (level.flags.has_court && !rn2(200)) {
71 #if 0 /*JP:T*/
72         static const char *const throne_msg[4] = {
73             "the tones of courtly conversation.",
74             "a sceptre pounded in judgment.",
75             "Someone shouts \"Off with %s head!\"", "Queen Beruthiel's cats!",
76 #else
77         static const char *const throne_msg[4] = {
78             "\8fã\95i\82È\98b\82µ\90º\82ð\95·\82¢\82½\81D",
79             "\8dÙ\94»\82Åâ\94\82ð\93Ë\82­\89¹\82ð\95·\82¢\82½\81D",
80             "\82¾\82ê\82©\82ª\81u\82»\82Ì\82à\82Ì\82Ì\8eñ\82ð\82Í\82Ë\82æ\81I\81v\82Æ\8b©\82Ô\90º\82ð\95·\82¢\82½\81D",
81             "\83x\83\8b\83V\83G\83\8b\89¤\94Ü\82Ì\94L\82Ì\90º\82ð\95·\82¢\82½\81I",
82 #endif
83         };
84         for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
85             if (DEADMONSTER(mtmp))
86                 continue;
87             if ((mtmp->msleeping || is_lord(mtmp->data)
88                  || is_prince(mtmp->data)) && !is_animal(mtmp->data)
89                 && mon_in_room(mtmp, COURT)) {
90                 /* finding one is enough, at least for now */
91                 int which = rn2(3) + hallu;
92
93                 if (which != 2)
94                     You_hear1(throne_msg[which]);
95                 else
96                     pline(throne_msg[2], uhis());
97                 return;
98             }
99         }
100     }
101     if (level.flags.has_swamp && !rn2(200)) {
102 #if 0 /*JP:T*/
103         static const char *const swamp_msg[3] = {
104             "hear mosquitoes!", "smell marsh gas!", /* so it's a smell...*/
105             "hear Donald Duck!",
106 #else
107         static const char *const swamp_msg[3] = {
108             "\89á\82Ì\89H\89¹\82ð\95·\82¢\82½\81D",
109             "\95\85\82Á\82½\93õ\82¢\82ª\82µ\82½\81I",       /* so it's a smell...*/
110             "\83h\83i\83\8b\83h\83_\83b\83N\82Ì\90º\82ð\95·\82¢\82½\81I",
111 #endif
112         };
113         You1(swamp_msg[rn2(2) + hallu]);
114         return;
115     }
116     if (level.flags.has_vault && !rn2(200)) {
117         if (!(sroom = search_special(VAULT))) {
118             /* strange ... */
119             level.flags.has_vault = 0;
120             return;
121         }
122         if (gd_sound())
123             switch (rn2(2) + hallu) {
124             case 1: {
125                 boolean gold_in_vault = FALSE;
126
127                 for (vx = sroom->lx; vx <= sroom->hx; vx++)
128                     for (vy = sroom->ly; vy <= sroom->hy; vy++)
129                         if (g_at(vx, vy))
130                             gold_in_vault = TRUE;
131 #if defined(AMIGA) && defined(AZTEC_C_WORKAROUND)
132                 /* Bug in aztec assembler here. Workaround below */
133                 xx = ROOM_INDEX(sroom) + ROOMOFFSET;
134                 xx = (xx != vault_occupied(u.urooms));
135                 if (xx)
136 #else
137                 if (vault_occupied(u.urooms)
138                     != (ROOM_INDEX(sroom) + ROOMOFFSET))
139 #endif /* AZTEC_C_WORKAROUND */
140                 {
141                     if (gold_in_vault)
142 #if 0 /*JP:T*/
143                         You_hear(!hallu
144                                      ? "someone counting money."
145                                      : "the quarterback calling the play.");
146 #else
147                         You_hear(!hallu
148                                  ? "\92N\82©\82ª\82¨\8bà\82ð\90\94\82¦\82Ä\82¢\82é\89¹\82ð\95·\82¢\82½\81D"
149                                  : "\83N\83H\81[\83^\83o\83b\83N\82ª\8ew\8e¦\82ð\82·\82é\90º\82ð\95·\82¢\82½\81D");
150 #endif
151                     else
152 /*JP
153                         You_hear("someone searching.");
154 */
155                         You_hear("\92N\82©\82ª\91{\8dõ\82µ\82Ä\82¢\82é\89¹\82ð\95·\82¢\82½\81D");
156                     break;
157                 }
158             }
159                 /*FALLTHRU*/
160             case 0:
161 /*JP
162                 You_hear("the footsteps of a guard on patrol.");
163 */
164                 You_hear("\8cx\94õ\88õ\82Ì\83p\83g\83\8d\81[\83\8b\82·\82é\89¹\82ð\95·\82¢\82½\81D");
165                 break;
166             case 2:
167 /*JP
168                 You_hear("Ebenezer Scrooge!");
169 */
170                 You_hear("\82±\82¿\8bT\82Ì\97¼\82³\82ñ\82Ì\90º\82ð\95·\82¢\82½\81I");
171                 break;
172             }
173         return;
174     }
175     if (level.flags.has_beehive && !rn2(200)) {
176         for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
177             if (DEADMONSTER(mtmp))
178                 continue;
179             if ((mtmp->data->mlet == S_ANT && is_flyer(mtmp->data))
180                 && mon_in_room(mtmp, BEEHIVE)) {
181                 switch (rn2(2) + hallu) {
182                 case 0:
183 /*JP
184                     You_hear("a low buzzing.");
185 */
186                     You_hear("\82Ô\81[\82ñ\82Æ\82¢\82¤\89¹\82ð\95·\82¢\82½\81D");
187                     break;
188                 case 1:
189 /*JP
190                     You_hear("an angry drone.");
191 */
192                     You_hear("\8b»\95±\82µ\82½\97Y\83o\83`\82Ì\89¹\82ð\95·\82¢\82½\81D");
193                     break;
194                 case 2:
195 #if 0 /*JP:T*/
196                     You_hear("bees in your %sbonnet!",
197                              uarmh ? "" : "(nonexistent) ");
198 #else
199                     You_hear("\83n\83`\82ª\82 \82È\82½\82Ì\96X\8eq%s\82Ì\92\86\82É\82¢\82é\89¹\82ð\95·\82¢\82½\81I",
200                              uarmh ? "" : "(\94í\82Á\82Ä\82È\82¢\82¯\82Ç)");
201 #endif
202                     break;
203                 }
204                 return;
205             }
206         }
207     }
208     if (level.flags.has_morgue && !rn2(200)) {
209         for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
210             if (DEADMONSTER(mtmp))
211                 continue;
212             if ((is_undead(mtmp->data) || is_vampshifter(mtmp))
213                 && mon_in_room(mtmp, MORGUE)) {
214 #if 0 /*JP*/
215                 const char *hair = body_part(HAIR); /* hair/fur/scales */
216 #endif
217
218                 switch (rn2(2) + hallu) {
219                 case 0:
220 /*JP
221                     You("suddenly realize it is unnaturally quiet.");
222 */
223                     You("\95s\8e©\91R\82È\82­\82ç\82¢\90Ã\82©\82È\82Ì\82É\8bC\82Ã\82¢\82½\81D");
224                     break;
225                 case 1:
226 #if 0 /*JP:T*/
227                     pline_The("%s on the back of your %s %s up.", hair,
228                               body_part(NECK), vtense(hair, "stand"));
229 #else
230                     pline("\82 \82È\82½\82Ì%s\82Ì\82¤\82µ\82ë\82Ì%s\82ª\8bt\97§\82Á\82½\81D",
231                           body_part(NECK), body_part(HAIR));
232 #endif
233                     break;
234                 case 2:
235 #if 0 /*JP:T*/
236                     pline_The("%s on your %s %s to stand up.", hair,
237                               body_part(HEAD), vtense(hair, "seem"));
238 #else
239                     pline("\82 \82È\82½\82Ì%s\82Ì%s\82Í\8bt\97§\82Á\82½\81D",
240                           body_part(HEAD), body_part(HAIR));
241 #endif
242                     break;
243                 }
244                 return;
245             }
246         }
247     }
248     if (level.flags.has_barracks && !rn2(200)) {
249         static const char *const barracks_msg[4] = {
250 #if 0 /*JP:T*/
251             "blades being honed.", "loud snoring.", "dice being thrown.",
252             "General MacArthur!",
253 #else
254             "\90n\95¨\82ð\8c¤\82®\89¹\82ð\95·\82¢\82½\81D",
255             "\91å\82«\82È\82¢\82Ñ\82«\82ð\95·\82¢\82½\81D",
256             "\83_\83C\83X\82ª\90U\82ç\82ê\82é\89¹\82ð\95·\82¢\82½\81D",
257             "\83}\83b\83J\81[\83T\81[\8f«\8cR\82Ì\90º\82ð\95·\82¢\82½\81I",
258 #endif
259         };
260         int count = 0;
261
262         for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
263             if (DEADMONSTER(mtmp))
264                 continue;
265             if (is_mercenary(mtmp->data)
266 #if 0 /* don't bother excluding these */
267                 && !strstri(mtmp->data->mname, "watch")
268                 && !strstri(mtmp->data->mname, "guard")
269 #endif
270                 && mon_in_room(mtmp, BARRACKS)
271                 /* sleeping implies not-yet-disturbed (usually) */
272                 && (mtmp->msleeping || ++count > 5)) {
273                 You_hear1(barracks_msg[rn2(3) + hallu]);
274                 return;
275             }
276         }
277     }
278     if (level.flags.has_zoo && !rn2(200)) {
279         static const char *const zoo_msg[3] = {
280 #if 0 /*JP:T*/
281             "a sound reminiscent of an elephant stepping on a peanut.",
282             "a sound reminiscent of a seal barking.", "Doctor Dolittle!",
283 #else
284             "\8fÛ\82ª\83s\81[\83i\83b\83c\82Ì\8fã\82Å\97x\82é\82æ\82¤\82È\89¹\82ð\95·\82¢\82½\81D",
285             "\83A\83V\83J\82ª\96i\82¦\82é\82æ\82¤\82È\89¹\82ð\95·\82¢\82½\81D",
286             "\83h\83\8a\83g\83\8b\90æ\90\82Ì\90º\82ð\95·\82¢\82½\81I",
287 #endif
288         };
289         for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
290             if (DEADMONSTER(mtmp))
291                 continue;
292             if ((mtmp->msleeping || is_animal(mtmp->data))
293                 && mon_in_room(mtmp, ZOO)) {
294                 You_hear1(zoo_msg[rn2(2) + hallu]);
295                 return;
296             }
297         }
298     }
299     if (level.flags.has_shop && !rn2(200)) {
300         if (!(sroom = search_special(ANY_SHOP))) {
301             /* strange... */
302             level.flags.has_shop = 0;
303             return;
304         }
305         if (tended_shop(sroom)
306             && !index(u.ushops, (int) (ROOM_INDEX(sroom) + ROOMOFFSET))) {
307             static const char *const shop_msg[3] = {
308 #if 0 /*JP:T*/
309                 "someone cursing shoplifters.",
310                 "the chime of a cash register.", "Neiman and Marcus arguing!",
311 #else
312                 "\92N\82©\82ª\93D\96_\82ð\82Ì\82Ì\82µ\82é\90º\82ð\95·\82¢\82½\81D",
313                 "\83\8c\83W\82Ì\83`\81[\83\93\82Æ\82¢\82¤\89¹\82ð\95·\82¢\82½\81D",
314                 "\83C\83g\81[\82Æ\83\88\81[\83J\83h\81[\82Ì\8bc\98_\82ð\95·\82¢\82½\81I",
315 #endif
316             };
317             You_hear1(shop_msg[rn2(2) + hallu]);
318         }
319         return;
320     }
321     if (level.flags.has_temple && !rn2(200)
322         && !(Is_astralevel(&u.uz) || Is_sanctum(&u.uz))) {
323         for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
324             if (DEADMONSTER(mtmp))
325                 continue;
326             if (mtmp->ispriest && inhistemple(mtmp)
327                 /* priest must be active */
328                 && mtmp->mcanmove && !mtmp->msleeping
329                 /* hero must be outside this temple */
330                 && temple_occupied(u.urooms) != EPRI(mtmp)->shroom)
331                 break;
332         }
333         if (mtmp) {
334             /* Generic temple messages; no attempt to match topic or tone
335                to the pantheon involved, let alone to the specific deity.
336                These are assumed to be coming from the attending priest;
337                asterisk means that the priest must be capable of speech;
338                pound sign (octathorpe,&c--don't go there) means that the
339                priest and the altar must not be directly visible (we don't
340                care if telepathy or extended detection reveals that the
341                priest is not currently standing on the altar; he's mobile). */
342             static const char *const temple_msg[] = {
343 #if 0 /*JP:T*/
344                 "*someone praising %s.", "*someone beseeching %s.",
345                 "#an animal carcass being offered in sacrifice.",
346                 "*a strident plea for donations.",
347 #else
348                 "*\92N\82©\82ª%s\82ð\8e^\94ü\82µ\82Ä\82¢\82é\82Ì\82ð\95·\82¢\82½\81D",
349                 "*\92N\82©\82ª%s\82ð\94M\96]\82µ\82Ä\82¢\82é\82Ì\82ð\95·\82¢\82½\81D",
350                 "#\93®\95¨\82Ì\8e\80\91Ì\82ð\90\82¯æÑ\82É\95ù\82°\82é\90º\82ð\95·\82¢\82½\81D",
351                 "*\8e·\9dX\82É\8añ\95t\82ð\97v\8b\81\82µ\82Ä\82¢\82é\82Ì\82ð\95·\82¢\82½\81D",
352 #endif
353             };
354             const char *msg;
355             int trycount = 0, ax = EPRI(mtmp)->shrpos.x,
356                 ay = EPRI(mtmp)->shrpos.y;
357             boolean speechless = (mtmp->data->msound <= MS_ANIMAL),
358                     in_sight = canseemon(mtmp) || cansee(ax, ay);
359
360             do {
361                 msg = temple_msg[rn2(SIZE(temple_msg) - 1 + hallu)];
362                 if (index(msg, '*') && speechless)
363                     continue;
364                 if (index(msg, '#') && in_sight)
365                     continue;
366                 break; /* msg is acceptable */
367             } while (++trycount < 50);
368             while (!letter(*msg))
369                 ++msg; /* skip control flags */
370             if (index(msg, '%'))
371                 You_hear(msg, halu_gname(EPRI(mtmp)->shralign));
372             else
373                 You_hear1(msg);
374             return;
375         }
376     }
377     if (Is_oracle_level(&u.uz) && !rn2(400)) {
378         /* make sure the Oracle is still here */
379         for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
380             if (DEADMONSTER(mtmp))
381                 continue;
382             if (mtmp->data == &mons[PM_ORACLE])
383                 break;
384         }
385         /* and don't produce silly effects when she's clearly visible */
386         if (mtmp && (hallu || !canseemon(mtmp))) {
387             static const char *const ora_msg[5] = {
388 #if 0 /*JP:T*/
389                 "a strange wind.",     /* Jupiter at Dodona */
390                 "convulsive ravings.", /* Apollo at Delphi */
391                 "snoring snakes.",     /* AEsculapius at Epidaurus */
392                 "someone say \"No more woodchucks!\"",
393                 "a loud ZOT!" /* both rec.humor.oracle */
394 #else
395                 "\8aï\96­\82È\95\97\82Ì\89¹\82ð\95·\82¢\82½\81D",
396                 "\94¼\8b\97\90\82Ì\90º\82ð\95·\82¢\82½\81D",
397                 "\8eÖ\82Ì\82¢\82Ñ\82«\82ð\95·\82¢\82½\81D",
398                 "\92N\82©\82ª\81u\82à\82¤\83E\83b\83h\83`\83\83\83b\83N\82Í\82¢\82ç\82È\82¢\81I\81v\82Æ\8c¾\82Á\82Ä\82¢\82é\90º\82ð\95·\82¢\82½\81D",
399                 "\91å\82«\82È\82y\82n\82s\82ð\95·\82¢\82½\81I"
400 #endif
401             };
402             You_hear1(ora_msg[rn2(3) + hallu * 2]);
403         }
404         return;
405     }
406 }
407
408 static const char *const h_sounds[] = {
409 #if 0 /*JP:T*/
410     "beep",   "boing",   "sing",   "belche", "creak",   "cough",
411     "rattle", "ululate", "pop",    "jingle", "sniffle", "tinkle",
412     "eep",    "clatter", "hum",    "sizzle", "twitter", "wheeze",
413     "rustle", "honk",    "lisp",   "yodel",  "coo",     "burp",
414     "moo",    "boom",    "murmur", "oink",   "quack",   "rumble",
415     "twang",  "bellow",  "toot",   "gargle", "hoot",    "warble"
416 #else
417     "\83s\81[\83b\82Æ\96Â\82¢\82½",
418     "\91\9b\82¬\82½\82Ä\82½",
419     "\89Ì\82Á\82½",
420     "\82°\82Á\82Õ\82ð\82µ\82½",
421     "\83L\81[\83L\81[\82Æ\96Â\82¢\82½",
422     "\82¹\82«\8d\9e\82ñ\82¾",
423
424     "\83J\83^\83J\83^\96Â\82Á\82½",
425     "\83E\83H\83\93\83E\83H\83\93\96Â\82¢\82½",
426     "\83|\83\93\82Æ\96Â\82Á\82½",
427     "\83`\83\83\83\8a\83\93\82Æ\96Â\82Á\82½",
428     "\83N\83\93\83N\83\93\96Â\82¢\82½",
429     "\83`\83\8a\83\93\83`\83\8a\83\93\82Æ\96Â\82Á\82½",
430
431     "\83C\81[\83b\82Æ\96Â\82¢\82½",
432     "\83J\83`\83\83\83J\83`\83\83\89¹\82ð\97§\82Ä\82½",
433     "\83n\83~\83\93\83O\82µ\82½",
434     "\83W\83\85\81[\83b\82Æ\89¹\82ð\97§\82Ä\82½",
435     "\83s\83\88\83s\83\88\96Â\82¢\82½",
436     "\83[\83C\83[\83C\91§\82ð\82µ\82½",
437
438     "\83J\83T\83J\83T\89¹\82ð\97§\82Ä\82½",
439     "\8cx\93J\82ð\96Â\82ç\82µ\82½",
440     "\90ã\91«\82ç\82¸\82É\82µ\82á\82×\82Á\82½",
441     "\83\88\81[\83f\83\8b\82ð\89Ì\82Á\82½",
442     "\83N\81[\83N\81[\96Â\82¢\82½",
443     "\82°\82Á\82Õ\82ð\82µ\82½",
444
445     "\83\82\81[\82Æ\96Â\82¢\82½",
446     "\94\9a\94­\89¹\82ð\8b¿\82©\82¹\82½",
447     "\83u\83c\83u\83c\82Â\82Ô\82â\82¢\82½",
448     "\83u\81[\83u\81[\96Â\82¢\82½",
449     "\83N\83\8f\83b\83N\83\8f\83b\82Æ\96Â\82¢\82½",
450     "\83S\83\8d\83S\83\8d\96Â\82Á\82½",
451
452     "\83|\83\8d\83\8d\83\93\82Æ\96Â\82Á\82½",
453     "\82Ç\82È\82Á\82½",
454     "\83\89\83b\83p\82Ì\89¹\82ð\96Â\82ç\82µ\82½",
455     "\83K\83\89\83K\83\89\90º\82ð\8fo\82µ\82½",
456     "\83z\81[\83z\81[\96Â\82¢\82½",
457     "\82³\82¦\82¸\82Á\82½"
458 #endif
459 };
460
461 const char *
462 growl_sound(mtmp)
463 register struct monst *mtmp;
464 {
465     const char *ret;
466
467     switch (mtmp->data->msound) {
468     case MS_MEW:
469     case MS_HISS:
470 /*JP
471         ret = "hiss";
472 */
473         ret = "\83V\81[\83b\82Æ\96Â\82¢\82½";
474         break;
475     case MS_BARK:
476     case MS_GROWL:
477 /*JP
478         ret = "growl";
479 */
480         ret = "\82Í\82°\82µ\82­\96i\82¦\82½";
481         break;
482     case MS_ROAR:
483 /*JP
484         ret = "roar";
485 */
486         ret = "\96i\82¦\82½";
487         break;
488     case MS_BUZZ:
489 /*JP
490         ret = "buzz";
491 */
492         ret = "\83u\81[\83b\82Æ\96Â\82¢\82½";
493         break;
494     case MS_SQEEK:
495 /*JP
496         ret = "squeal";
497 */
498         ret = "\83L\81[\83L\81[\96Â\82¢\82½";
499         break;
500     case MS_SQAWK:
501 /*JP
502         ret = "screech";
503 */
504         ret = "\8bà\90Ø\82è\90º\82ð\97§\82Ä\82½";
505         break;
506     case MS_NEIGH:
507 /*JP
508         ret = "neigh";
509 */
510         ret = "\82¢\82È\82È\82¢\82½";
511         break;
512     case MS_WAIL:
513 /*JP
514         ret = "wail";
515 */
516         ret = "\94ß\82µ\82­\96Â\82¢\82½";
517         break;
518     case MS_SILENT:
519 /*JP
520         ret = "commotion";
521 */
522         ret = "\8b»\95±\82µ\82½";
523         break;
524     default:
525 /*JP
526         ret = "scream";
527 */
528         ret = "\8bà\90Ø\82è\90º\82ð\82 \82°\82½";
529     }
530     return ret;
531 }
532
533 /* the sounds of a seriously abused pet, including player attacking it */
534 void
535 growl(mtmp)
536 register struct monst *mtmp;
537 {
538     register const char *growl_verb = 0;
539
540     if (mtmp->msleeping || !mtmp->mcanmove || !mtmp->data->msound)
541         return;
542
543     /* presumably nearness and soundok checks have already been made */
544     if (Hallucination)
545         growl_verb = h_sounds[rn2(SIZE(h_sounds))];
546     else
547         growl_verb = growl_sound(mtmp);
548     if (growl_verb) {
549 /*JP
550         pline("%s %s!", Monnam(mtmp), vtense((char *) 0, growl_verb));
551 */
552         pline("%s\82Í%s\81I", Monnam(mtmp), growl_verb);
553         if (context.run)
554             nomul(0);
555         wake_nearto(mtmp->mx, mtmp->my, mtmp->data->mlevel * 18);
556     }
557 }
558
559 /* the sounds of mistreated pets */
560 void
561 yelp(mtmp)
562 register struct monst *mtmp;
563 {
564     register const char *yelp_verb = 0;
565
566     if (mtmp->msleeping || !mtmp->mcanmove || !mtmp->data->msound)
567         return;
568
569     /* presumably nearness and soundok checks have already been made */
570     if (Hallucination)
571         yelp_verb = h_sounds[rn2(SIZE(h_sounds))];
572     else
573         switch (mtmp->data->msound) {
574         case MS_MEW:
575 /*JP
576             yelp_verb = (!Deaf) ? "yowl" : "arch";
577 */
578             yelp_verb = (!Deaf) ? "\94ß\82µ\82­\96Â\82¢\82½" : "\8b|\82È\82è\82É\82È\82Á\82½";
579             break;
580         case MS_BARK:
581         case MS_GROWL:
582 /*JP
583             yelp_verb = (!Deaf) ? "yelp" : "recoil";
584 */
585             yelp_verb = (!Deaf) ? "\83L\83\83\83\93\83L\83\83\83\93\96Â\82¢\82½" : "\90K\8d\9e\82Ý\82µ\82½";
586             break;
587         case MS_ROAR:
588 /*JP
589             yelp_verb = (!Deaf) ? "snarl" : "bluff";
590 */
591             yelp_verb = (!Deaf) ? "\82¤\82È\82Á\82½" : "\82â\82¹\89ä\96\9d\82µ\82½";
592             break;
593         case MS_SQEEK:
594 /*JP
595             yelp_verb = (!Deaf) ? "squeal" : "quiver";
596 */
597             yelp_verb = (!Deaf) ? "\83L\81[\83L\81[\96Â\82¢\82½" : "\90k\82¦\82½";
598             break;
599         case MS_SQAWK:
600 /*JP
601             yelp_verb = (!Deaf) ? "screak" : "thrash";
602 */
603             yelp_verb = (!Deaf) ? "\8bà\90Ø\82è\90º\82ð\97§\82Ä\82½" : "\82Ì\82½\82¤\82¿\89ñ\82Á\82½";
604             break;
605         case MS_WAIL:
606 /*JP
607             yelp_verb = (!Deaf) ? "wail" : "cringe";
608 */
609             yelp_verb = (!Deaf) ? "\94ß\82µ\82­\96Â\82¢\82½" : "\90g\82ð\82·\82­\82ß\82½";
610             break;
611         }
612     if (yelp_verb) {
613 /*JP
614         pline("%s %s!", Monnam(mtmp), vtense((char *) 0, yelp_verb));
615 */
616         pline("%s\82Í%s\81I", Monnam(mtmp), yelp_verb);
617         if (context.run)
618             nomul(0);
619         wake_nearto(mtmp->mx, mtmp->my, mtmp->data->mlevel * 12);
620     }
621 }
622
623 /* the sounds of distressed pets */
624 void
625 whimper(mtmp)
626 register struct monst *mtmp;
627 {
628     register const char *whimper_verb = 0;
629
630     if (mtmp->msleeping || !mtmp->mcanmove || !mtmp->data->msound)
631         return;
632
633     /* presumably nearness and soundok checks have already been made */
634     if (Hallucination)
635         whimper_verb = h_sounds[rn2(SIZE(h_sounds))];
636     else
637         switch (mtmp->data->msound) {
638         case MS_MEW:
639         case MS_GROWL:
640 /*JP
641             whimper_verb = "whimper";
642 */
643             whimper_verb = "\83N\83\93\83N\83\93\96Â\82¢\82½";
644             break;
645         case MS_BARK:
646 /*JP
647             whimper_verb = "whine";
648 */
649             whimper_verb = "\83N\81[\83\93\82Æ\96Â\82¢\82½";
650             break;
651         case MS_SQEEK:
652 /*JP
653             whimper_verb = "squeal";
654 */
655             whimper_verb = "\83L\81[\83L\81[\96Â\82¢\82½";
656             break;
657         }
658     if (whimper_verb) {
659 /*JP
660         pline("%s %s.", Monnam(mtmp), vtense((char *) 0, whimper_verb));
661 */
662         pline("%s\82Í%s\81D", Monnam(mtmp), whimper_verb);
663         if (context.run)
664             nomul(0);
665         wake_nearto(mtmp->mx, mtmp->my, mtmp->data->mlevel * 6);
666     }
667 }
668
669 /* pet makes "I'm hungry" noises */
670 void
671 beg(mtmp)
672 register struct monst *mtmp;
673 {
674     if (mtmp->msleeping || !mtmp->mcanmove
675         || !(carnivorous(mtmp->data) || herbivorous(mtmp->data)))
676         return;
677
678     /* presumably nearness and soundok checks have already been made */
679     if (!is_silent(mtmp->data) && mtmp->data->msound <= MS_ANIMAL)
680         (void) domonnoise(mtmp);
681     else if (mtmp->data->msound >= MS_HUMANOID) {
682         if (!canspotmon(mtmp))
683             map_invisible(mtmp->mx, mtmp->my);
684 /*JP
685         verbalize("I'm hungry.");
686 */
687         verbalize("\82Í\82ç\82Ø\82±\82¾\81D");
688     }
689 }
690
691 /* return True if mon is a gecko or seems to look like one (hallucination) */
692 STATIC_OVL boolean
693 mon_is_gecko(mon)
694 struct monst *mon;
695 {
696     int glyph;
697
698     /* return True if it is actually a gecko */
699     if (mon->data == &mons[PM_GECKO])
700         return TRUE;
701     /* return False if it is a long worm; we might be chatting to its tail
702        (not strictly needed; long worms are MS_SILENT so won't get here) */
703     if (mon->data == &mons[PM_LONG_WORM])
704         return FALSE;
705     /* result depends upon whether map spot shows a gecko, which will
706        be due to hallucination or to mimickery since mon isn't one */
707     glyph = glyph_at(mon->mx, mon->my);
708     return (boolean) (glyph_to_mon(glyph) == PM_GECKO);
709 }
710
711 STATIC_OVL int
712 domonnoise(mtmp)
713 register struct monst *mtmp;
714 {
715     char verbuf[BUFSZ];
716     register const char *pline_msg = 0, /* Monnam(mtmp) will be prepended */
717         *verbl_msg = 0,                 /* verbalize() */
718         *verbl_msg_mcan = 0;            /* verbalize() if cancelled */
719     struct permonst *ptr = mtmp->data;
720     int msound = ptr->msound, gnomeplan = 0;
721
722     /* presumably nearness and sleep checks have already been made */
723     if (Deaf)
724         return 0;
725     if (is_silent(ptr))
726         return 0;
727
728     /* leader might be poly'd; if he can still speak, give leader speech */
729     if (mtmp->m_id == quest_status.leader_m_id && msound > MS_ANIMAL)
730         msound = MS_LEADER;
731     /* make sure it's your role's quest guardian; adjust if not */
732     else if (msound == MS_GUARDIAN && ptr != &mons[urole.guardnum])
733         msound = mons[genus(monsndx(ptr), 1)].msound;
734     /* some normally non-speaking types can/will speak if hero is similar */
735     else if (msound == MS_ORC         /* note: MS_ORC is same as MS_GRUNT */
736              && ((same_race(ptr, youmonst.data)          /* current form, */
737                   || same_race(ptr, &mons[Race_switch])) /* unpoly'd form */
738                  || Hallucination))
739         msound = MS_HUMANOID;
740     /* silliness, with slight chance to interfere with shopping */
741     else if (Hallucination && mon_is_gecko(mtmp))
742         msound = MS_SELL;
743
744     /* be sure to do this before talking; the monster might teleport away, in
745      * which case we want to check its pre-teleport position
746      */
747     if (!canspotmon(mtmp))
748         map_invisible(mtmp->mx, mtmp->my);
749
750     switch (msound) {
751     case MS_ORACLE:
752         return doconsult(mtmp);
753     case MS_PRIEST:
754         priest_talk(mtmp);
755         break;
756     case MS_LEADER:
757     case MS_NEMESIS:
758     case MS_GUARDIAN:
759         quest_chat(mtmp);
760         break;
761     case MS_SELL: /* pitch, pay, total */
762         if (!Hallucination || (mtmp->isshk && !rn2(2))) {
763             shk_chat(mtmp);
764         } else {
765             /* approximation of GEICO's advertising slogan (it actually
766                concludes with "save you 15% or more on car insurance.") */
767 /*JP
768             Sprintf(verbuf, "15 minutes could save you 15 %s.",
769 */
770             Sprintf(verbuf, "15\95ª\92¸\82¯\82ê\82Î15%s\90ß\96ñ\82Å\82«\82Ü\82·\81D",
771                     currency(15L)); /* "zorkmids" */
772             verbl_msg = verbuf;
773         }
774         break;
775     case MS_VAMPIRE: {
776         /* vampire messages are varied by tameness, peacefulness, and time of
777          * night */
778         boolean isnight = night();
779         boolean kindred = (Upolyd && (u.umonnum == PM_VAMPIRE
780                                       || u.umonnum == PM_VAMPIRE_LORD));
781         boolean nightchild =
782             (Upolyd && (u.umonnum == PM_WOLF || u.umonnum == PM_WINTER_WOLF
783                         || u.umonnum == PM_WINTER_WOLF_CUB));
784 #if 0 /*JP*/
785         const char *racenoun =
786             (flags.female && urace.individual.f)
787                 ? urace.individual.f
788                 : (urace.individual.m) ? urace.individual.m : urace.noun;
789 #else
790         const char *racenoun = (flags.female) ? "\82 \82È\82½" : "\82¨\82Ü\82¦" ;
791 #endif
792
793         if (mtmp->mtame) {
794             if (kindred) {
795 #if 0 /*JP:T*/
796                 Sprintf(verbuf, "Good %s to you Master%s",
797                         isnight ? "evening" : "day",
798                         isnight ? "!" : ".  Why do we not rest?");
799 #else
800                 Sprintf(verbuf, "\82²\8eå\90l\97l\81C%s%s",
801                         isnight ? "\82±\82ñ\82Î\82ñ\82Í" : "\82±\82ñ\82É\82¿\82Í",
802                         isnight ? "\81I" : "\81D\82¨\8bx\82Ý\82É\82È\82è\82Ü\82¹\82ñ\82©\81H");
803 #endif
804                 verbl_msg = verbuf;
805             } else {
806 #if 0 /*JP:T*/
807                 Sprintf(verbuf, "%s%s",
808                         nightchild ? "Child of the night, " : "",
809                         midnight()
810                          ? "I can stand this craving no longer!"
811                          : isnight
812                           ? "I beg you, help me satisfy this growing craving!"
813                           : "I find myself growing a little weary.");
814 #else
815                 Sprintf(verbuf,"%s%s",
816                         nightchild ? "\96é\82Ì\8ee\82æ\81C" : "",
817                         midnight()
818                         ? "\8e\84\82Í\82±\82ê\88È\8fã\8a\89\96]\82ð\97}\82¦\82ç\82ê\82È\82¢\81I"
819                         : isnight
820                          ? "\82Ó\82­\82ê\82 \82ª\82é\8a\89\96]\82ð\96\9e\82½\82·\82Ì\82ð\8f\95\82¯\82Ä\82­\82ê\82È\82¢\82©\81H\97\8a\82Þ\81I"
821                          : "\8e\84\82Í\8f­\81X\94æ\82ê\82½\82æ\82¤\82¾\81D");
822 #endif
823                 verbl_msg = verbuf;
824             }
825         } else if (mtmp->mpeaceful) {
826             if (kindred && isnight) {
827 #if 0 /*JP:T*/
828                 Sprintf(verbuf, "Good feeding %s!",
829                         flags.female ? "sister" : "brother");
830 #else
831                 Sprintf(verbuf, "\82æ\82¤\8cZ\92í\81I");
832 #endif
833                 verbl_msg = verbuf;
834             } else if (nightchild && isnight) {
835 /*JP
836                 Sprintf(verbuf, "How nice to hear you, child of the night!");
837 */
838                 Sprintf(verbuf, "\96é\82Ì\8ee\82æ\81C\8c³\8bC\82»\82¤\82¾\82È\81I");
839                 verbl_msg = verbuf;
840             } else
841 /*JP
842                 verbl_msg = "I only drink... potions.";
843 */
844                 verbl_msg = "\8e\84\82Í\96ò\81D\81D\82µ\82©\88ù\82Ü\82È\82¢\81D";
845         } else {
846             static const char *const vampmsg[] = {
847                 /* These first two (0 and 1) are specially handled below */
848 /*JP
849                 "I vant to suck your %s!",
850 */
851                 "\82¨\91O\82Ì%s\82ð\82æ\82±\82¹\81I",
852 /*JP
853                 "I vill come after %s without regret!",
854 */
855                 "\91\95ª\82É%s\82ð\92Ç\8c\82\82³\82¹\82Ä\82à\82ç\82¨\82¤\81I",
856                 /* other famous vampire quotes can follow here if desired */
857             };
858             int vampindex;
859
860             if (kindred)
861                 verbl_msg =
862 /*JP
863                     "This is my hunting ground that you dare to prowl!";
864 */
865                     "\82¨\82Ü\82¦\82ª\82¤\82ë\82Â\82¢\82Ä\82¢\82é\82±\82Ì\82 \82½\82è\82Í\8e\84\82Ì\8eë\8fê\82¾\81I";
866             else if (youmonst.data == &mons[PM_SILVER_DRAGON]
867                      || youmonst.data == &mons[PM_BABY_SILVER_DRAGON]) {
868                 /* Silver dragons are silver in color, not made of silver */
869 #if 0 /*JP*/
870                 Sprintf(verbuf, "%s!  Your silver sheen does not frighten me!",
871                         youmonst.data == &mons[PM_SILVER_DRAGON]
872                             ? "Fool"
873                             : "Young Fool");
874                 verbl_msg = verbuf;
875 #else
876                 verbl_msg = "\82Î\82©\82ß\81I\82¨\82Ü\82¦\82Ì\8bâ\82Ì\8bP\82«\82È\82Ç\95|\82­\82È\82¢\82¼\81I";
877 #endif
878             } else {
879                 vampindex = rn2(SIZE(vampmsg));
880                 if (vampindex == 0) {
881                     Sprintf(verbuf, vampmsg[vampindex], body_part(BLOOD));
882                     verbl_msg = verbuf;
883                 } else if (vampindex == 1) {
884                     Sprintf(verbuf, vampmsg[vampindex],
885                             Upolyd ? an(mons[u.umonnum].mname)
886                                    : an(racenoun));
887                     verbl_msg = verbuf;
888                 } else
889                     verbl_msg = vampmsg[vampindex];
890             }
891         }
892     } break;
893     case MS_WERE:
894         if (flags.moonphase == FULL_MOON && (night() ^ !rn2(13))) {
895 #if 0 /*JP:T*/
896             pline("%s throws back %s head and lets out a blood curdling %s!",
897                   Monnam(mtmp), mhis(mtmp),
898                   ptr == &mons[PM_HUMAN_WERERAT] ? "shriek" : "howl");
899 #else
900             pline("%s\82Í\93ª\82ð\82Ì\82¯\82¼\82ç\82µ\94w\8bØ\82ª\93\80\82é\82æ\82¤\82È%s\82ð\82 \82°\82½\81I",
901                   Monnam(mtmp),
902                   ptr == &mons[PM_HUMAN_WERERAT] ? "\8bà\90Ø\82è\90º" : "\99ô\9aK");
903 #endif
904             wake_nearto(mtmp->mx, mtmp->my, 11 * 11);
905         } else
906             pline_msg =
907 /*JP
908                 "whispers inaudibly.  All you can make out is \"moon\".";
909 */
910                 "\95·\82«\82Æ\82ê\82È\82¢\82æ\82¤\82È\90º\82Å\82³\82³\82â\82¢\82½\81D\82©\82ë\82¤\82\82Ä\81w\8c\8e\81x\82Æ\82¢\82¤\8c¾\97t\82¾\82¯\82ª\95·\82«\82Æ\82ê\82½\81D";
911         break;
912     case MS_BARK:
913         if (flags.moonphase == FULL_MOON && night()) {
914 /*JP
915             pline_msg = "howls.";
916 */
917             pline_msg = "\96i\82¦\82½\81D";
918         } else if (mtmp->mpeaceful) {
919             if (mtmp->mtame
920                 && (mtmp->mconf || mtmp->mflee || mtmp->mtrapped
921                     || moves > EDOG(mtmp)->hungrytime || mtmp->mtame < 5))
922 /*JP
923                 pline_msg = "whines.";
924 */
925                 pline_msg = "\83N\83\93\83N\83\93\96Â\82¢\82½\81D";
926             else if (mtmp->mtame && EDOG(mtmp)->hungrytime > moves + 1000)
927 /*JP
928                 pline_msg = "yips.";
929 */
930                 pline_msg = "\83L\83\83\83\93\83L\83\83\83\93\96Â\82¢\82½\81D";
931             else {
932                 if (mtmp->data
933                     != &mons[PM_DINGO]) /* dingos do not actually bark */
934 /*JP
935                     pline_msg = "barks.";
936 */
937                     pline_msg = "\83\8f\83\93\83\8f\83\93\96i\82¦\82½\81D";
938             }
939         } else {
940 /*JP
941             pline_msg = "growls.";
942 */
943             pline_msg = "\82¤\82È\82Á\82½\81D";
944         }
945         break;
946     case MS_MEW:
947         if (mtmp->mtame) {
948             if (mtmp->mconf || mtmp->mflee || mtmp->mtrapped
949                 || mtmp->mtame < 5)
950 /*JP
951                 pline_msg = "yowls.";
952 */
953                 pline_msg = "\94ß\82µ\82­\96Â\82¢\82½\81D";
954             else if (moves > EDOG(mtmp)->hungrytime)
955 /*JP
956                 pline_msg = "meows.";
957 */
958                 pline_msg = "\83j\83\83\81[\83\93\82Æ\96Â\82¢\82½\81D";
959             else if (EDOG(mtmp)->hungrytime > moves + 1000)
960 /*JP
961                 pline_msg = "purrs.";
962 */
963                 pline_msg = "\83S\83\8d\83S\83\8d\82Æ\96Â\82¢\82½\81D";
964             else
965 /*JP
966                 pline_msg = "mews.";
967 */
968                 pline_msg = "\83j\83\83\81[\83j\83\83\81[\96Â\82¢\82½\81D";
969             break;
970         }
971         /*FALLTHRU*/
972     case MS_GROWL:
973 /*JP
974         pline_msg = mtmp->mpeaceful ? "snarls." : "growls!";
975 */
976         pline_msg = mtmp->mpeaceful ? "\82¤\82È\82Á\82½\81D" : "\8c\83\82µ\82­\82¤\82È\82Á\82½\81I";
977         break;
978     case MS_ROAR:
979 /*JP
980         pline_msg = mtmp->mpeaceful ? "snarls." : "roars!";
981 */
982         pline_msg = mtmp->mpeaceful ? "\82¤\82È\82Á\82½\81D" : "\82Æ\82Ä\82à\8c\83\82µ\82­\96i\82¦\82½\81I";
983         break;
984     case MS_SQEEK:
985 /*JP
986         pline_msg = "squeaks.";
987 */
988         pline_msg = "\83L\81[\83L\81[\96Â\82¢\82½\81D";
989         break;
990     case MS_SQAWK:
991         if (ptr == &mons[PM_RAVEN] && !mtmp->mpeaceful)
992 /*JP
993             verbl_msg = "Nevermore!";
994 */
995             verbl_msg = "\81u\82à\82¤\93ñ\93x\82Æ\81I\81v";
996         else
997 /*JP
998             pline_msg = "squawks.";
999 */
1000             pline_msg = "\83L\81[\83L\81[\96Â\82¢\82½\81D";
1001         break;
1002     case MS_HISS:
1003         if (!mtmp->mpeaceful)
1004 /*JP
1005             pline_msg = "hisses!";
1006 */
1007             pline_msg = "\83V\81[\83b\82Æ\96Â\82¢\82½\81I";
1008         else
1009             return 0; /* no sound */
1010         break;
1011     case MS_BUZZ:
1012 /*JP
1013         pline_msg = mtmp->mpeaceful ? "drones." : "buzzes angrily.";
1014 */
1015         pline_msg = mtmp->mpeaceful ? "\82Ô\81[\82ñ\82Æ\96Â\82Á\82½\81D" : "\82Ô\82ñ\82Ô\82ñ\96Â\82Á\82½\81D";
1016         break;
1017     case MS_GRUNT:
1018 /*JP
1019         pline_msg = "grunts.";
1020 */
1021         pline_msg = "\82Ô\81[\82Ô\81[\96Â\82¢\82½\81D";
1022         break;
1023     case MS_NEIGH:
1024         if (mtmp->mtame < 5)
1025 /*JP
1026             pline_msg = "neighs.";
1027 */
1028             pline_msg = "\82¢\82È\82È\82¢\82½\81D";
1029         else if (moves > EDOG(mtmp)->hungrytime)
1030 /*JP
1031             pline_msg = "whinnies.";
1032 */
1033             pline_msg = "\83q\83q\81[\83\93\82Æ\96Â\82¢\82½\81D";
1034         else
1035 /*JP
1036             pline_msg = "whickers.";
1037 */
1038             pline_msg = "\83q\83q\83q\81[\83\93\82Æ\96Â\82¢\82½\81D";
1039         break;
1040     case MS_WAIL:
1041 /*JP
1042         pline_msg = "wails mournfully.";
1043 */
1044         pline_msg = "\94ß\82µ\82°\82É\96Â\82¢\82½\81D";
1045         break;
1046     case MS_GURGLE:
1047 /*JP
1048         pline_msg = "gurgles.";
1049 */
1050         pline_msg = "\82²\82ë\82²\82ë\8dA\82ð\96Â\82ç\82µ\82½\81D";
1051         break;
1052     case MS_BURBLE:
1053 /*JP
1054         pline_msg = "burbles.";
1055 */
1056         pline_msg = "\82Ø\82¿\82á\82­\82¿\82á\82µ\82á\82×\82Á\82½\81D";
1057         break;
1058     case MS_SHRIEK:
1059 /*JP
1060         pline_msg = "shrieks.";
1061 */
1062         pline_msg = "\8bà\90Ø\82è\90º\82ð\82 \82°\82½\81D";
1063         aggravate();
1064         break;
1065     case MS_IMITATE:
1066 /*JP
1067         pline_msg = "imitates you.";
1068 */
1069         pline_msg = "\82 \82È\82½\82Ì\90^\8e\97\82ð\82µ\82½\81D";
1070         break;
1071     case MS_BONES:
1072 /*JP
1073         pline("%s rattles noisily.", Monnam(mtmp));
1074 */
1075         pline("%s\82Í\83P\83^\83P\83^\82Æ\8fÎ\82¢\82¾\82µ\82½\81D",Monnam(mtmp));
1076 /*JP
1077         You("freeze for a moment.");
1078 */
1079         You("\88ê\8fu\93\80\82è\82Â\82¢\82½\81D");
1080         nomul(-2);
1081 /*JP
1082         multi_reason = "scared by rattling";
1083 */
1084         multi_reason = "\8d\9c\82Ì\83J\83^\83J\83^\8c¾\82¤\89¹\82É\82¨\82Ñ\82¦\82½\8c\84\82É";
1085         nomovemsg = 0;
1086         break;
1087     case MS_LAUGH: {
1088         static const char *const laugh_msg[4] = {
1089 /*JP
1090             "giggles.", "chuckles.", "snickers.", "laughs.",
1091 */
1092             "\82­\82·\82­\82·\8fÎ\82Á\82½\81D", "\82­\82·\82Á\82Æ\8fÎ\82Á\82½\81D", "\82Î\82©\82É\82µ\82½\82æ\82¤\82É\8fÎ\82Á\82½\81D", "\8fÎ\82Á\82½\81D",
1093         };
1094         pline_msg = laugh_msg[rn2(4)];
1095     } break;
1096     case MS_MUMBLE:
1097 /*JP
1098         pline_msg = "mumbles incomprehensibly.";
1099 */
1100         pline_msg = "\95s\89Â\89ð\82È\8c¾\97t\82ð\82Â\82Ô\82â\82¢\82½\81D";
1101         break;
1102     case MS_DJINNI:
1103         if (mtmp->mtame) {
1104 /*JP
1105             verbl_msg = "Sorry, I'm all out of wishes.";
1106 */
1107             verbl_msg = "\8e\84\82ð\8f\95\82¯\82Ä\82­\82ê\82½\82±\82Æ\82ð\8a´\8eÓ\82·\82é\81I";
1108         } else if (mtmp->mpeaceful) {
1109             if (ptr == &mons[PM_WATER_DEMON])
1110 /*JP
1111                 pline_msg = "gurgles.";
1112 */
1113                 pline_msg = "\83S\83{\83S\83{\83S\83{\83S\83{\81D";
1114             else
1115 /*JP
1116                 verbl_msg = "I'm free!";
1117 */
1118                 verbl_msg = "\82â\82Á\82Æ\8e©\97R\82É\82È\82Á\82½\81I";
1119         } else {
1120             if (ptr != &mons[PM_PRISONER])
1121 /*JP
1122                 verbl_msg = "This will teach you not to disturb me!";
1123 */
1124                 verbl_msg = "\82\82á\82Ü\82ð\82µ\82È\82¢\82Å\82­\82ê\81I";
1125 #if 0
1126             else
1127                 verbl_msg = "??????????";
1128 #endif
1129         }
1130         break;
1131     case MS_BOAST: /* giants */
1132         if (!mtmp->mpeaceful) {
1133             switch (rn2(4)) {
1134             case 0:
1135 #if 0 /*JP:T*/
1136                 pline("%s boasts about %s gem collection.", Monnam(mtmp),
1137                       mhis(mtmp));
1138 #else
1139                 pline("%s\82Í\8e©\95ª\82Ì\95ó\90Î\82Ì\83R\83\8c\83N\83V\83\87\83\93\82ð\8e©\96\9d\82µ\82½\81D", Monnam(mtmp));
1140 #endif
1141                 break;
1142             case 1:
1143 /*JP
1144                 pline_msg = "complains about a diet of mutton.";
1145 */
1146                 pline_msg = "\96\88\93ú\97r\82Î\82©\82è\90H\82×\82Ä\82¢\82é\8e\96\82ð\8bð\92s\82Á\82½\81D";
1147                 break;
1148             default:
1149 /*JP
1150                 pline_msg = "shouts \"Fee Fie Foe Foo!\" and guffaws.";
1151 */
1152                 pline_msg = "\81w\82í\82Á\82Í\82Á\82Í\82Á\82Í\81I\81x\82Æ\82Î\82©\8fÎ\82¢\82µ\82½\81D";
1153                 wake_nearto(mtmp->mx, mtmp->my, 7 * 7);
1154                 break;
1155             }
1156             break;
1157         }
1158         /*FALLTHRU*/
1159     case MS_HUMANOID:
1160         if (!mtmp->mpeaceful) {
1161             if (In_endgame(&u.uz) && is_mplayer(ptr))
1162                 mplayer_talk(mtmp);
1163             else
1164 /*JP
1165                 pline_msg = "threatens you.";
1166 */
1167                 pline_msg = "\82 \82È\82½\82ð\88Ð\8ad\82µ\82½\81D";
1168             break;
1169         }
1170         /* Generic peaceful humanoid behaviour. */
1171         if (mtmp->mflee)
1172 /*JP
1173             pline_msg = "wants nothing to do with you.";
1174 */
1175             pline_msg = "\82 \82È\82½\82Æ\8aÖ\82í\82è\82½\82­\82È\82¢\82æ\82¤\82¾\81D";
1176         else if (mtmp->mhp < mtmp->mhpmax / 4)
1177 /*JP
1178             pline_msg = "moans.";
1179 */
1180             pline_msg = "\82¤\82ß\82«\90º\82ð\82 \82°\82½\81D";
1181         else if (mtmp->mconf || mtmp->mstun)
1182 /*JP
1183             verbl_msg = !rn2(3) ? "Huh?" : rn2(2) ? "What?" : "Eh?";
1184 */
1185             verbl_msg = !rn2(3) ? "\82Ö\81H" : rn2(2) ? "\89½\81H" : "\82¦\81H";
1186         else if (!mtmp->mcansee)
1187 /*JP
1188             verbl_msg = "I can't see!";
1189 */
1190             verbl_msg = "\89½\82à\8c©\82¦\82È\82¢\81I";
1191         else if (mtmp->mtrapped) {
1192             struct trap *t = t_at(mtmp->mx, mtmp->my);
1193
1194             if (t)
1195                 t->tseen = 1;
1196 /*JP
1197             verbl_msg = "I'm trapped!";
1198 */
1199             verbl_msg = "ã©\82É\82Í\82Ü\82Á\82Ä\82µ\82Ü\82Á\82½\81I";
1200         } else if (mtmp->mhp < mtmp->mhpmax / 2)
1201 /*JP
1202             pline_msg = "asks for a potion of healing.";
1203 */
1204             pline_msg = "\89ñ\95\9c\82Ì\96ò\82ð\8e\9d\82Á\82Ä\82È\82¢\82©\90q\82Ë\82½\81D";
1205         else if (mtmp->mtame && !mtmp->isminion
1206                  && moves > EDOG(mtmp)->hungrytime)
1207 /*JP
1208             verbl_msg = "I'm hungry.";
1209 */
1210             verbl_msg = "\95 \82ª\8c¸\82Á\82½\82È\81D";
1211         /* Specific monsters' interests */
1212         else if (is_elf(ptr))
1213 /*JP
1214             pline_msg = "curses orcs.";
1215 */
1216             pline_msg = "\83I\81[\83N\82ð\8eô\82Á\82½\81D";
1217         else if (is_dwarf(ptr))
1218 /*JP
1219             pline_msg = "talks about mining.";
1220 */
1221             pline_msg = "\8dÌ\8c@\82É\82Â\82¢\82Ä\98b\82µ\82½\81D";
1222         else if (likes_magic(ptr))
1223 /*JP
1224             pline_msg = "talks about spellcraft.";
1225 */
1226             pline_msg = "\96\82\8fp\82Ì\92b\98B\82É\82Â\82¢\82Ä\98b\82µ\82½\81D";
1227         else if (ptr->mlet == S_CENTAUR)
1228 /*JP
1229             pline_msg = "discusses hunting.";
1230 */
1231             pline_msg = "\97Â\82É\82Â\82¢\82Ä\8bc\98_\82µ\82½\81D";
1232         else if (is_gnome(ptr) && Hallucination && (gnomeplan = rn2(4)) % 2)
1233             /* skipped for rn2(4) result of 0 or 2;
1234                gag from an early episode of South Park called "Gnomes";
1235                initially, Tweek (introduced in that episode) is the only
1236                one aware of the tiny gnomes after spotting them sneaking
1237                about; they are embarked upon a three-step business plan;
1238                a diagram of the plan shows:
1239                          Phase 1         Phase 2      Phase 3
1240                    Collect underpants       ?          Profit
1241                and they never verbalize step 2 so we don't either */
1242 #if 0 /*JP:T*/
1243             verbl_msg = (gnomeplan == 1) ? "Phase one, collect underpants."
1244                                          : "Phase three, profit!";
1245 #else
1246             verbl_msg = (gnomeplan == 1) ? "\82»\82Ì\82P\81C\83p\83\93\83c\82ð\8fW\82ß\82é\81D"
1247                                          : "\82»\82Ì\82R\81C\8eû\89v\89»\81I";
1248 #endif
1249         else
1250             switch (monsndx(ptr)) {
1251             case PM_HOBBIT:
1252                 pline_msg =
1253                     (mtmp->mhpmax - mtmp->mhp >= 10)
1254 /*JP
1255                         ? "complains about unpleasant dungeon conditions."
1256 */
1257                         ? "\95s\96ù\89õ\82È\96À\8b{\82Ì\8fó\91Ô\82É\82Â\82¢\82Ä\95s\96\9e\82ð\8fq\82×\82½\81D"
1258 /*JP
1259                         : "asks you about the One Ring.";
1260 */
1261                         : "\81u\88ê\82Â\82Ì\8ew\97Ö\81v\82É\82Â\82¢\82Ä\90q\82Ë\82½\81D";
1262                 break;
1263             case PM_ARCHEOLOGIST:
1264                 pline_msg =
1265 /*JP
1266                 "describes a recent article in \"Spelunker Today\" magazine.";
1267 */
1268                 "\81u\93ú\8a§\93´\8cA\81v\82Ì\8dÅ\90V\82Ì\8bL\8e\96\82ð\8e·\95M\82µ\82Ä\82¢\82é\81D";
1269                 break;
1270             case PM_TOURIST:
1271 /*JP
1272                 verbl_msg = "Aloha.";
1273 */
1274                 verbl_msg = "\83A\83\8d\81[\83n\81D";
1275                 break;
1276             default:
1277 /*JP
1278                 pline_msg = "discusses dungeon exploration.";
1279 */
1280                 pline_msg = "\96À\8b{\92T\8c\9f\82É\82Â\82¢\82Ä\8bc\98_\82µ\82½\81D";
1281                 break;
1282             }
1283         break;
1284     case MS_SEDUCE: {
1285         int swval;
1286
1287         if (SYSOPT_SEDUCE) {
1288             if (ptr->mlet != S_NYMPH
1289                 && could_seduce(mtmp, &youmonst, (struct attack *) 0) == 1) {
1290                 (void) doseduce(mtmp);
1291                 break;
1292             }
1293             swval = ((poly_gender() != (int) mtmp->female) ? rn2(3) : 0);
1294         } else
1295             swval = ((poly_gender() == 0) ? rn2(3) : 0);
1296         switch (swval) {
1297         case 2:
1298 #if 0 /*JP*/
1299             verbl_msg = "Hello, sailor.";
1300 #else
1301             switch (poly_gender()) {
1302               case 0:
1303                 verbl_msg = "\82±\82ñ\82É\82¿\82Í\81D\82 \82ç\82¢\82¢\92j\82Ë\81D";
1304                 break;
1305               case 1:
1306                 verbl_msg = "\82±\82ñ\82É\82¿\82Í\81C\82¨\8fì\82³\82ñ\81D";
1307                 break;
1308               default:
1309                 verbl_msg = "\82±\82ñ\82É\82¿\82Í\81D";
1310                 break;
1311             }
1312 #endif
1313             break;
1314         case 1:
1315 /*JP
1316             pline_msg = "comes on to you.";
1317 */
1318             pline_msg = "\82 \82È\82½\82Ì\82Ù\82¤\82Ö\82â\82Á\82Ä\82«\82½\81D";
1319             break;
1320         default:
1321 /*JP
1322             pline_msg = "cajoles you.";
1323 */
1324             pline_msg = "\82 \82È\82½\82ð\82¨\82¾\82Ä\82½\81D";
1325         }
1326     } break;
1327     case MS_ARREST:
1328         if (mtmp->mpeaceful)
1329 #if 0 /*JP:T*/
1330             verbalize("Just the facts, %s.", flags.female ? "Ma'am" : "Sir");
1331 #else
1332             verbalize("\8e\96\8eÀ\82¾\82¯\82ª\92m\82è\82½\82¢\82ñ\82Å\82·\82æ\81C%s\81D", flags.female ? "\89\9c\82³\82ñ" : "\92U\93ß");
1333 #endif
1334         else {
1335             static const char *const arrest_msg[3] = {
1336 #if 0 /*JP:T*/
1337                 "Anything you say can be used against you.",
1338                 "You're under arrest!", "Stop in the name of the Law!",
1339 #else
1340                 "\82¨\82Ü\82¦\82Ì\8c¾\82¤\82±\82Æ\82Í\82¨\82Ü\82¦\82É\82Æ\82Á\82Ä\95s\97\98\82È\8fØ\8b\92\82Æ\82È\82é\82±\82Æ\82ª\82 \82é\81I",
1341                 "\82¨\82Ü\82¦\82ð\91ß\95ß\82·\82é\81I",
1342                 "\96@\82Ì\96¼\82Ì\82à\82Æ\92¼\82¿\82É\92\86\8e~\82¹\82æ\81I",
1343 #endif
1344             };
1345             verbl_msg = arrest_msg[rn2(3)];
1346         }
1347         break;
1348     case MS_BRIBE:
1349         if (mtmp->mpeaceful && !mtmp->mtame) {
1350             (void) demon_talk(mtmp);
1351             break;
1352         }
1353     /* fall through */
1354     case MS_CUSS:
1355         if (!mtmp->mpeaceful)
1356             cuss(mtmp);
1357         else if (is_lminion(mtmp))
1358 /*JP
1359             verbl_msg = "It's not too late.";
1360 */
1361             verbl_msg = "\82Ü\82¾\92x\82­\82Í\82È\82¢\81D";
1362         else
1363 /*JP
1364             verbl_msg = "We're all doomed.";
1365 */
1366             verbl_msg = "\82Ý\82ñ\82È\82à\82¤\82¨\82µ\82Ü\82¢\82¾\81D";
1367         break;
1368     case MS_SPELL:
1369         /* deliberately vague, since it's not actually casting any spell */
1370 /*JP
1371         pline_msg = "seems to mutter a cantrip.";
1372 */
1373         pline_msg = "\82Ô\82Â\82Ô\82Â\82Æ\82Â\82Ô\82â\82¢\82Ä\82¢\82é\81D";
1374         break;
1375     case MS_NURSE:
1376 /*JP
1377         verbl_msg_mcan = "I hate this job!";
1378 */
1379         verbl_msg_mcan = "\82±\82ñ\82È\8ed\8e\96\8c\99\82¢\81I";
1380         if (uwep && (uwep->oclass == WEAPON_CLASS || is_weptool(uwep)))
1381 /*JP
1382             verbl_msg = "Put that weapon away before you hurt someone!";
1383 */
1384             verbl_msg = "\95\90\8aí\82ð\82¨\82³\82ß\82È\82³\82¢\81I\82»\82ê\82Í\90l\82ð\8f\9d\82Â\82¯\82é\82à\82Ì\82æ\81I";
1385         else if (uarmc || uarm || uarmh || uarms || uarmg || uarmf)
1386             verbl_msg = Role_if(PM_HEALER)
1387 /*JP
1388                             ? "Doc, I can't help you unless you cooperate."
1389 */
1390                             ? "\90æ\90\81C\82 \82È\82½\82Ì\8b¦\97Í\82È\82µ\82Å\82Í\82Ç\82¤\82µ\82æ\82¤\82à\82 \82è\82Ü\82¹\82ñ\82í\81D"
1391 /*JP
1392                             : "Please undress so I can examine you.";
1393 */
1394                             : "\95\9e\82ð\92E\82¢\82Å\82­\82¾\82³\82¢\81D\82 \82È\82½\82ð\90f\8e@\82µ\82Ü\82·\82í\81D";
1395         else if (uarmu)
1396 /*JP
1397             verbl_msg = "Take off your shirt, please.";
1398 */
1399             verbl_msg = "\83V\83\83\83c\82ð\92E\82¢\82Å\82­\82¾\82³\82¢\81D";
1400         else
1401 /*JP
1402             verbl_msg = "Relax, this won't hurt a bit.";
1403 */
1404             verbl_msg = "\82¨\82¿\82Â\82¢\82Ä\81D\82¿\82Á\82Æ\82à\92É\82­\82È\82¢\82í\82æ\81D";
1405         break;
1406     case MS_GUARD:
1407         if (money_cnt(invent))
1408 /*JP
1409             verbl_msg = "Please drop that gold and follow me.";
1410 */
1411             verbl_msg = "\8bà\82ð\92u\82¢\82Ä\82Â\82¢\82Ä\82«\82Ä\82­\82¾\82³\82¢\81D";
1412         else
1413 /*JP
1414             verbl_msg = "Please follow me.";
1415 */
1416             verbl_msg = "\82Â\82¢\82Ä\82«\82Ä\82­\82¾\82³\82¢\81D";
1417         break;
1418     case MS_SOLDIER: {
1419         static const char
1420             *const soldier_foe_msg[3] =
1421                 {
1422 #if 0 /*JP:T*/
1423                   "Resistance is useless!", "You're dog meat!", "Surrender!",
1424 #else
1425                     "\92ï\8dR\82µ\82Ä\82à\96³\91Ê\82¾\81I",
1426                     "\8c¢\82É\8bò\82í\82ê\82¿\82Ü\82¦\81I",
1427                     "\8d~\95\9a\82µ\82ë\81I",
1428 #endif
1429                 },
1430                    *const soldier_pax_msg[3] = {
1431 #if 0 /*JP:T*/
1432                        "What lousy pay we're getting here!",
1433                        "The food's not fit for Orcs!",
1434                        "My feet hurt, I've been on them all day!",
1435 #else
1436                        "\82È\82ñ\82Ä\8bà\95¥\82¢\82ª\88«\82¢\82ñ\82¾\81I",
1437                        "\82È\82ñ\82¾\82¢\81H\83I\81[\83N\82Å\82à\8bò\82¦\82Ë\82¥\82º\81I",
1438                        "\91«\82ð\89ö\89ä\82µ\82½\81C\82¸\82Á\82Æ\82±\82Ì\92²\8eq\82¾\81I",
1439 #endif
1440                    };
1441         verbl_msg = mtmp->mpeaceful ? soldier_pax_msg[rn2(3)]
1442                                     : soldier_foe_msg[rn2(3)];
1443         break;
1444     }
1445     case MS_RIDER: {
1446         const char *tribtitle;
1447         struct obj *book = 0;
1448         boolean ms_Death = (ptr == &mons[PM_DEATH]);
1449
1450         /* 3.6 tribute */
1451         if (ms_Death && !context.tribute.Deathnotice
1452             && (book = u_have_novel()) != 0) {
1453             if ((tribtitle = noveltitle(&book->novelidx)) != 0) {
1454 /*JP
1455                 Sprintf(verbuf, "Ah, so you have a copy of /%s/.", tribtitle);
1456 */
1457                 Sprintf(verbuf, "\82 \82 \81A/%s/\82ð\8e\9d\82Á\82Ä\82¢\82é\82Ì\82©\81D", tribtitle);
1458                 /* no Death featured in these two, so exclude them */
1459                 if (strcmpi(tribtitle, "Snuff")
1460                     && strcmpi(tribtitle, "The Wee Free Men"))
1461 /*JP
1462                     Strcat(verbuf, "  I may have been misquoted there.");
1463 */
1464                     Strcat(verbuf, "  \82±\82±\82Å\82Í\88ø\97p\82ª\8aÔ\88á\82Á\82Ä\82¢\82é\82©\82à\82µ\82ê\82È\82¢\81D");
1465                 verbl_msg = verbuf;
1466             }
1467             context.tribute.Deathnotice = 1;
1468         } else if (ms_Death && rn2(3) && Death_quote(verbuf, sizeof verbuf)) {
1469             verbl_msg = verbuf;
1470         /* end of tribute addition */
1471
1472         } else if (ms_Death && !rn2(10)) {
1473 /*JP
1474             pline_msg = "is busy reading a copy of Sandman #8.";
1475 */
1476             pline_msg = "\81u\83T\83\93\83h\83}\83\93\81v\82Ì8\8aª\82ð\93Ç\82Þ\82Ì\82É\96Z\82µ\82¢\81D";
1477         } else
1478 /*JP
1479             verbl_msg = "Who do you think you are, War?";
1480 */
1481             verbl_msg = "\83E\83H\81[\82æ\81C\8e©\95ª\82ª\89½\8eÒ\82©\8dl\82¦\82½\82±\82Æ\82ª\82 \82é\82©\81H";
1482         break;
1483     } /* case MS_RIDER */
1484     } /* switch */
1485
1486     if (pline_msg) {
1487 /*JP
1488         pline("%s %s", Monnam(mtmp), pline_msg);
1489 */
1490         pline("%s\82Í%s", Monnam(mtmp), pline_msg);
1491     } else if (mtmp->mcan && verbl_msg_mcan) {
1492         verbalize1(verbl_msg_mcan);
1493     } else if (verbl_msg) {
1494 #if 0 /*JP*//*\83f\83X\82ð\93Á\95Ê\88µ\82¢\82µ\82È\82¢*/
1495         /* more 3.6 tribute */
1496         if (ptr == &mons[PM_DEATH]) {
1497             /* Death talks in CAPITAL LETTERS
1498                and without quotation marks */
1499             char tmpbuf[BUFSZ];
1500
1501             pline1(ucase(strcpy(tmpbuf, verbl_msg)));
1502         } else {
1503             verbalize1(verbl_msg);
1504         }
1505 #else
1506         verbalize1(verbl_msg);
1507 #endif
1508     }
1509     return 1;
1510 }
1511
1512 /* #chat command */
1513 int
1514 dotalk()
1515 {
1516     int result;
1517
1518     result = dochat();
1519     return result;
1520 }
1521
1522 STATIC_OVL int
1523 dochat()
1524 {
1525     struct monst *mtmp;
1526     int tx, ty;
1527     struct obj *otmp;
1528
1529     if (is_silent(youmonst.data)) {
1530 /*JP
1531         pline("As %s, you cannot speak.", an(youmonst.data->mname));
1532 */
1533         pline("\82 \82È\82½\82Í%s\82È\82Ì\82Å\81C\98b\82·\82±\82Æ\82ª\82Å\82«\82È\82¢\81D", youmonst.data->mname);
1534         return 0;
1535     }
1536     if (Strangled) {
1537 /*JP
1538         You_cant("speak.  You're choking!");
1539 */
1540         You("\98b\82¹\82È\82¢\81D\82 \82È\82½\82Í\8eñ\82ð\8di\82ß\82ç\82ê\82Ä\82¢\82é\81I");
1541         return 0;
1542     }
1543     if (u.uswallow) {
1544 /*JP
1545         pline("They won't hear you out there.");
1546 */
1547         You("\8aO\82Ö\8cü\82Á\82Ä\98b\82ð\82µ\82½\82ª\81C\92N\82à\95·\82«\82¢\82ê\82È\82©\82Á\82½\81D");
1548         return 0;
1549     }
1550     if (Underwater) {
1551 /*JP
1552         Your("speech is unintelligible underwater.");
1553 */
1554         pline("\90\85\96Ê\89º\82Å\82Í\81C\82 \82È\82½\82Ì\98b\82Í\82ë\82­\82É\97\9d\89ð\82³\82ê\82È\82¢\81D");
1555         return 0;
1556     }
1557     if (Deaf) {
1558 /*JP
1559         pline("How can you hold a conversation when you cannot hear?");
1560 */
1561         pline("\95·\82­\82±\82Æ\82ª\82Å\82«\82È\82¢\82Ì\82É\82Ç\82¤\82â\82Á\82Ä\89ï\98b\82·\82é\82Ì\81H");
1562         return 0;
1563     }
1564
1565     if (!Blind && (otmp = shop_object(u.ux, u.uy)) != (struct obj *) 0) {
1566         /* standing on something in a shop and chatting causes the shopkeeper
1567            to describe the price(s).  This can inhibit other chatting inside
1568            a shop, but that shouldn't matter much.  shop_object() returns an
1569            object iff inside a shop and the shopkeeper is present and willing
1570            (not angry) and able (not asleep) to speak and the position
1571            contains any objects other than just gold.
1572         */
1573         price_quote(otmp);
1574         return 1;
1575     }
1576
1577 /*JP
1578     if (!getdir("Talk to whom? (in what direction)")) {
1579 */
1580     if (!getdir("\92N\82Æ\98b\82µ\82Ü\82·\82©\81H[\95û\8cü\82ð\93ü\82ê\82Ä\82Ë]")) {
1581         /* decided not to chat */
1582         return 0;
1583     }
1584
1585     if (u.usteed && u.dz > 0) {
1586         if (!u.usteed->mcanmove || u.usteed->msleeping) {
1587 /*JP
1588             pline("%s seems not to notice you.", Monnam(u.usteed));
1589 */
1590             pline("%s\82Í\82 \82È\82½\82É\8bC\82ª\82Â\82¢\82Ä\82¢\82È\82¢\82æ\82¤\82¾\81D", Monnam(u.usteed));
1591             return 1;
1592         } else
1593             return domonnoise(u.usteed);
1594     }
1595
1596     if (u.dz) {
1597 /*JP
1598         pline("They won't hear you %s there.", u.dz < 0 ? "up" : "down");
1599 */
1600         pline("%s\8cü\82©\82Á\82Ä\98b\82ð\82µ\82Ä\82à\88Ó\96¡\82ª\82È\82¢\81D", u.dz < 0 ? "\8fã\82É" : "\89º\82É");
1601         return 0;
1602     }
1603
1604     if (u.dx == 0 && u.dy == 0) {
1605         /*
1606          * Let's not include this.
1607          * It raises all sorts of questions: can you wear
1608          * 2 helmets, 2 amulets, 3 pairs of gloves or 6 rings as a marilith,
1609          * etc...  --KAA
1610         if (u.umonnum == PM_ETTIN) {
1611             You("discover that your other head makes boring conversation.");
1612             return 1;
1613         }
1614          */
1615 /*JP
1616         pline("Talking to yourself is a bad habit for a dungeoneer.");
1617 */
1618         pline("\88ê\90l\8c¾\82Í\96À\8b{\92T\8c\9f\8eÒ\82Ì\88«\82¢\95È\82¾\81D");
1619         return 0;
1620     }
1621
1622     tx = u.ux + u.dx;
1623     ty = u.uy + u.dy;
1624
1625     if (!isok(tx, ty))
1626         return 0;
1627
1628     mtmp = m_at(tx, ty);
1629
1630     if ((!mtmp || mtmp->mundetected)
1631         && (otmp = vobj_at(tx, ty)) != 0 && otmp->otyp == STATUE) {
1632         /* Talking to a statue */
1633         if (!Blind) {
1634 #if 0 /*JP:T*/
1635             pline_The("%s seems not to notice you.",
1636                       /* if hallucinating, you can't tell it's a statue */
1637                       Hallucination ? rndmonnam((char *) 0) : "statue");
1638 #else
1639             pline_The("%s\82Í\82 \82È\82½\82É\8bC\82ª\82Â\82¢\82Ä\82¢\82È\82¢\82æ\82¤\82¾\81D",
1640                       Hallucination ? rndmonnam((char *) 0) : "\90Î\91\9c");
1641 #endif
1642         }
1643         return 0;
1644     }
1645
1646     if (!mtmp || mtmp->mundetected || M_AP_TYPE(mtmp) == M_AP_FURNITURE
1647         || M_AP_TYPE(mtmp) == M_AP_OBJECT)
1648         return 0;
1649
1650     /* sleeping monsters won't talk, except priests (who wake up) */
1651     if ((!mtmp->mcanmove || mtmp->msleeping) && !mtmp->ispriest) {
1652         /* If it is unseen, the player can't tell the difference between
1653            not noticing him and just not existing, so skip the message. */
1654         if (canspotmon(mtmp))
1655 /*JP
1656             pline("%s seems not to notice you.", Monnam(mtmp));
1657 */
1658             pline("%s\82Í\82 \82È\82½\82É\8bC\82ª\82Â\82¢\82Ä\82¢\82È\82¢\82æ\82¤\82¾\81D", Monnam(mtmp));
1659         return 0;
1660     }
1661
1662     /* if this monster is waiting for something, prod it into action */
1663     mtmp->mstrategy &= ~STRAT_WAITMASK;
1664
1665     if (mtmp->mtame && mtmp->meating) {
1666         if (!canspotmon(mtmp))
1667             map_invisible(mtmp->mx, mtmp->my);
1668 /*JP
1669         pline("%s is eating noisily.", Monnam(mtmp));
1670 */
1671         pline("%s\82Í\83o\83\8a\83o\83\8a\82Æ\95¨\82ð\90H\82×\82Ä\82¢\82é\81D", Monnam(mtmp));
1672         return 0;
1673     }
1674
1675     return domonnoise(mtmp);
1676 }
1677
1678 #ifdef USER_SOUNDS
1679
1680 extern void FDECL(play_usersound, (const char *, int));
1681
1682 typedef struct audio_mapping_rec {
1683     struct nhregex *regex;
1684     char *filename;
1685     int volume;
1686     struct audio_mapping_rec *next;
1687 } audio_mapping;
1688
1689 static audio_mapping *soundmap = 0;
1690
1691 char *sounddir = ".";
1692
1693 /* adds a sound file mapping, returns 0 on failure, 1 on success */
1694 int
1695 add_sound_mapping(mapping)
1696 const char *mapping;
1697 {
1698     char text[256];
1699     char filename[256];
1700     char filespec[256];
1701     int volume;
1702
1703     if (sscanf(mapping, "MESG \"%255[^\"]\"%*[\t ]\"%255[^\"]\" %d", text,
1704                filename, &volume) == 3) {
1705         audio_mapping *new_map;
1706
1707         if (strlen(sounddir) + strlen(filename) > 254) {
1708             raw_print("sound file name too long");
1709             return 0;
1710         }
1711         Sprintf(filespec, "%s/%s", sounddir, filename);
1712
1713         if (can_read_file(filespec)) {
1714             new_map = (audio_mapping *) alloc(sizeof(audio_mapping));
1715             new_map->regex = regex_init();
1716             new_map->filename = dupstr(filespec);
1717             new_map->volume = volume;
1718             new_map->next = soundmap;
1719
1720             if (!regex_compile(text, new_map->regex)) {
1721                 raw_print(regex_error_desc(new_map->regex));
1722                 regex_free(new_map->regex);
1723                 free(new_map->filename);
1724                 free(new_map);
1725                 return 0;
1726             } else {
1727                 soundmap = new_map;
1728             }
1729         } else {
1730             Sprintf(text, "cannot read %.243s", filespec);
1731             raw_print(text);
1732             return 0;
1733         }
1734     } else {
1735         raw_print("syntax error in SOUND");
1736         return 0;
1737     }
1738
1739     return 1;
1740 }
1741
1742 void
1743 play_sound_for_message(msg)
1744 const char *msg;
1745 {
1746     audio_mapping *cursor = soundmap;
1747
1748     while (cursor) {
1749         if (regex_match(msg, cursor->regex)) {
1750             play_usersound(cursor->filename, cursor->volume);
1751         }
1752         cursor = cursor->next;
1753     }
1754 }
1755
1756 #endif /* USER_SOUNDS */
1757
1758 /*sounds.c*/