X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fdetect.c;h=7e142525be106d831295e62cc363f4cc7f5a872f;hb=a9d33728cf6768508371f0544fff9bbbe3892067;hp=1e5b23edc8a1ed8c73ee01d7180c262a91bd65cb;hpb=a4c1eb849dac77e75f386da143ca16b6594ee544;p=jnethack%2Fsource.git diff --git a/src/detect.c b/src/detect.c index 1e5b23e..7e14252 100644 --- a/src/detect.c +++ b/src/detect.c @@ -7,6 +7,11 @@ * command. */ +/* JNetHack Copyright */ +/* (c) Issei Numata, Naoki Hamada, Shigehiro Miyashita, 1994-2000 */ +/* For 3.4-, Copyright (c) SHIRAKATA Kentaro, 2002-2016 */ +/* JNetHack may be freely redistributed. See license for details. */ + #include "hack.h" #include "artifact.h" @@ -208,12 +213,21 @@ register struct obj *sobj; if (sobj) { char buf[BUFSZ]; if (youmonst.data == &mons[PM_GOLD_GOLEM]) { +/*JP Sprintf(buf, "You feel like a million %s!", currency(2L)); +*/ + Strcpy(buf, "‚ ‚È‚½‚Í‹àŽ‚¿‚É‚È‚Á‚½‚悤‚ÉŠ´‚¶‚½I"); } else if (hidden_gold() || money_cnt(invent)) Strcpy(buf, +/*JP "You feel worried about your future financial situation."); +*/ + "‚ ‚È‚½‚͏«—ˆ‚ÌŒoÏó‹µ‚ªS”z‚É‚È‚Á‚½D"); else +/*JP Strcpy(buf, "You feel materially poor."); +*/ + Strcpy(buf, "‚ ‚È‚½‚Í‚Ð‚à‚¶‚³‚ðŠ´‚¶‚½D"); strange_feeling(sobj, buf); } return 1; @@ -221,7 +235,10 @@ register struct obj *sobj; /* only under me - no separate display required */ if (stale) docrt(); +/*JP You("notice some gold between your %s.", makeplural(body_part(FOOT))); +*/ + You("%s‚ÌŠÔ‚É‹à‰Ý‚ª—Ž‚¿‚Ä‚¢‚邱‚Æ‚É‹C‚ª‚‚¢‚½D", body_part(FOOT)); return 0; outgoldmap: @@ -271,7 +288,10 @@ outgoldmap: } newsym(u.ux, u.uy); u.uinwater = iflags.save_uinwater, u.uburied = iflags.save_uburied; +/*JP You_feel("very greedy, and sense gold!"); +*/ + You("‚Ç‚ñ—~‚É‚È‚Á‚½‚悤‚È‹C‚ª‚µ‚½C‚»‚µ‚Ä‹à‰Ý‚̈ʒu‚ðŠ´’m‚µ‚½I"); exercise(A_WIS, TRUE); display_nhwindow(WIN_MAP, TRUE); docrt(); @@ -293,7 +313,10 @@ register struct obj *sobj; register int ct = 0, ctu = 0; boolean confused = (Confusion || (sobj && sobj->cursed)), stale; char oclass = confused ? POTION_CLASS : FOOD_CLASS; +/*JP const char *what = confused ? something : "food"; +*/ + const char *what = confused ? "ƒnƒ‰ƒwƒŠ" : "H‚ו¨"; stale = clear_stale_map(oclass, 0); @@ -318,18 +341,31 @@ register struct obj *sobj; known = stale && !confused; if (stale) { docrt(); +/*JP You("sense a lack of %s nearby.", what); +*/ + You("%s‚ªŒ¸‚Á‚Ä‚¢‚é‚Ì‚É‹C‚ª‚‚¢‚½D",what); if (sobj && sobj->blessed) { if (!u.uedibility) +/*JP Your("%s starts to tingle.", body_part(NOSE)); +*/ + Your("%s‚ª‚Ò‚­‚Á‚Æ“®‚¢‚½D", body_part(NOSE)); u.uedibility = 1; } } else if (sobj) { char buf[BUFSZ]; +#if 0 /*JP*/ Sprintf(buf, "Your %s twitches%s.", body_part(NOSE), (sobj->blessed && !u.uedibility) ? " then starts to tingle" : ""); +#else + Sprintf(buf, "‚ ‚È‚½‚Ì%s‚ª‚Ђ­‚Ђ­‚Æ“®‚¢%sD", body_part(NOSE), + (sobj->blessed && !u.uedibility) + ? "‚āC‚¤‚¸‚¤‚¸‚µ‚¾‚µ‚½" + : "‚½"); +#endif if (sobj->blessed && !u.uedibility) { boolean savebeginner = flags.beginner; @@ -377,13 +413,24 @@ register struct obj *sobj; u.uinwater = iflags.save_uinwater, u.uburied = iflags.save_uburied; if (sobj) { if (sobj->blessed) { +#if 0 /*JP*/ Your("%s %s to tingle and you smell %s.", body_part(NOSE), u.uedibility ? "continues" : "starts", what); +#else + Your("%s‚Í‚¤‚¸‚¤‚¸‚µ%sC%s‚Ì“õ‚¢‚ðšk‚¬‚Æ‚Á‚½D", body_part(NOSE), + u.uedibility ? "‘±‚¯" : "Žn‚ß", what); +#endif u.uedibility = 1; } else +/*JP Your("%s tingles and you smell %s.", body_part(NOSE), what); +*/ + Your("%s‚Í‚¤‚¸‚¤‚¸‚µC%s‚Ì“õ‚¢‚ðšk‚¬‚Æ‚Á‚½D", body_part(NOSE), what); } else +/*JP You("sense %s.", what); +*/ + You("%s‚ðŠ´’m‚µ‚½D", what); display_nhwindow(WIN_MAP, TRUE); exercise(A_WIS, TRUE); docrt(); @@ -435,9 +482,15 @@ int class; /* an object class, 0 for all */ if (Hallucination || (Confusion && class == SCROLL_CLASS)) Strcpy(stuff, something); else +/*JP Strcpy(stuff, class ? def_oc_syms[class].name : "objects"); +*/ + Strcpy(stuff, class ? def_oc_syms[class].name : "•¨‘Ì"); if (boulder && class != ROCK_CLASS) +/*JP Strcat(stuff, " and/or large stones"); +*/ + Strcat(stuff, "‚Æ‹Šâ"); if (do_dknown) for (obj = invent; obj; obj = obj->nobj) @@ -486,11 +539,17 @@ int class; /* an object class, 0 for all */ if (!clear_stale_map(!class ? ALL_CLASSES : class, 0) && !ct) { if (!ctu) { if (detector) +/*JP strange_feeling(detector, "You feel a lack of something."); +*/ + strange_feeling(detector, "‚ ‚È‚½‚͉½‚©‚ªŒ‡–R‚µ‚Ä‚¢‚é‚悤‚È‹C‚ª‚µ‚½D"); return 1; } +/*JP You("sense %s nearby.", stuff); +*/ + You("‹ß‚­‚Ì%s‚ðŠ´’m‚µ‚½D", stuff); return 0; } @@ -574,7 +633,10 @@ int class; /* an object class, 0 for all */ newsym(u.ux, u.uy); u.uinwater = iflags.save_uinwater, u.uburied = iflags.save_uburied; +/*JP You("detect the %s of %s.", ct ? "presence" : "absence", stuff); +*/ + You("%s%sD", stuff, ct ? "‚ð”­Œ©‚µ‚½" : "‚͉½‚à‚È‚¢‚±‚Æ‚ª‚í‚©‚Á‚½" ); display_nhwindow(WIN_MAP, TRUE); /* * What are we going to do when the hero does an object detect while blind @@ -617,8 +679,14 @@ int mclass; /* monster class, 0 for all */ if (!mcnt) { if (otmp) strange_feeling(otmp, Hallucination +/*JP ? "You get the heebie jeebies." +*/ + ? "‚ ‚È‚½‚Í‹à’¹‚̉ĂŃLƒ“ƒ`ƒ‡[‚µ‚½D" +/*JP : "You feel threatened."); +*/ + : "‚ ‚È‚½‚Í‹°•|‚Å‚¼‚­‚¼‚­‚µ‚½D"); return 1; } else { boolean woken = FALSE; @@ -649,9 +717,15 @@ int mclass; /* monster class, 0 for all */ } } display_self(); +/*JP You("sense the presence of monsters."); +*/ + You("‰ö•¨‚Ì‘¶Ý‚ðšk‚¬‚‚¯‚½D"); if (woken) +/*JP pline("Monsters sense the presence of you."); +*/ + pline("‰ö•¨‚Í‚ ‚È‚½‚Ì‘¶Ý‚ðšk‚¬‚‚¯‚½D"); display_nhwindow(WIN_MAP, TRUE); docrt(); if (Underwater) @@ -787,12 +861,18 @@ register struct obj *sobj; if (!found) { char buf[BUFSZ]; +/*JP Sprintf(buf, "Your %s stop itching.", makeplural(body_part(TOE))); +*/ + Sprintf(buf, "‚ ‚È‚½‚Ì%s‚Ì‚Þ‚¸‚Þ‚¸‚Í‚¨‚³‚Ü‚Á‚½D", makeplural(body_part(TOE))); strange_feeling(sobj, buf); return 1; } /* traps exist, but only under me - no separate display required */ +/*JP Your("%s itch.", makeplural(body_part(TOE))); +*/ + Your("%s‚Í‚Þ‚¸‚Þ‚¸‚µ‚½D", makeplural(body_part(TOE))); return 0; outtrapmap: cls(); @@ -826,7 +906,10 @@ outtrapmap: newsym(u.ux, u.uy); u.uinwater = iflags.save_uinwater, u.uburied = iflags.save_uburied; +/*JP You_feel("%s.", cursed_src ? "very greedy" : "entrapped"); +*/ + You("%s‹CŽ‚É‚È‚Á‚½D", cursed_src ? "‚Æ‚Ä‚à‚Ç‚ñ—~‚È" : "‚¾‚Ü‚³‚ê‚Ä‚¢‚é‚悤‚È"); /* wait for user to respond, then reset map display to normal */ display_nhwindow(WIN_MAP, TRUE); docrt(); @@ -847,47 +930,101 @@ d_level *where; if (ll < 0) { if (ll < (-8 - rn2(3))) if (!indun) +/*JP return "far away"; +*/ + return "‚Í‚é‚©”Þ•û‚É"; else +/*JP return "far below"; +*/ + return "‚Í‚é‚©‰º•û‚É"; else if (ll < -1) if (!indun) +/*JP return "away below you"; +*/ + return "‚¸‚Á‚Ɖº•û‚É"; else +/*JP return "below you"; +*/ + return "‰º•û‚É"; else if (!indun) +/*JP return "in the distance"; +*/ + return "‰“‚­‚É"; else +/*JP return "just below"; +*/ + return "^‰º‚É"; } else if (ll > 0) { if (ll > (8 + rn2(3))) if (!indun) +/*JP return "far away"; +*/ + return "‚Í‚é‚©”Þ•û‚É"; else +/*JP return "far above"; +*/ + return "‚Í‚é‚©ã•û‚É"; else if (ll > 1) if (!indun) +/*JP return "away above you"; +*/ + return "‚¸‚Á‚Əã•û‚É"; else +/*JP return "above you"; +*/ + return "ã•û‚É"; else if (!indun) +/*JP return "in the distance"; +*/ + return "‰“‚­‚É"; else +/*JP return "just above"; +*/ + return "^ã‚É"; } else if (!indun) +/*JP return "in the distance"; +*/ + return "‰“‚­‚É"; else +/*JP return "near you"; +*/ + return "‹ß‚­‚É"; } static const struct { const char *what; d_level *where; } level_detects[] = { +/*JP { "Delphi", &oracle_level }, +*/ + { "ƒfƒ‹ƒtƒ@ƒC", &oracle_level }, +/*JP { "Medusa's lair", &medusa_level }, +*/ + { "ƒƒfƒ…[ƒT‚̏Z‚Ý‚©", &medusa_level }, +/*JP { "a castle", &stronghold_level }, +*/ + { "é", &stronghold_level }, +/*JP { "the Wizard of Yendor's tower", &wiz1_level }, +*/ + { "ƒCƒFƒ“ƒ_[‚Ì–‚–@Žg‚¢‚Ì“ƒ", &wiz1_level }, }; void @@ -899,41 +1036,68 @@ struct obj **optr; struct obj *obj = *optr; if (Blind) { +/*JP pline("Too bad you can't see %s.", the(xname(obj))); +*/ + pline("‚È‚ñ‚Ä‚±‚Æ‚¾D%s‚ðŒ©‚é‚±‚Æ‚ª‚Å‚«‚È‚¢D", the(xname(obj))); return; } oops = (rnd(20) > ACURR(A_INT) || obj->cursed); if (oops && (obj->spe > 0)) { switch (rnd(obj->oartifact ? 4 : 5)) { case 1: +/*JP pline("%s too much to comprehend!", Tobjnam(obj, "are")); +*/ + pline("%s‚ð”`‚¢‚½‚ª‰½‚Ì‚±‚Æ‚¾‚©‚³‚Á‚Ï‚è‚í‚©‚ç‚È‚©‚Á‚½I", xname(obj)); break; case 2: +/*JP pline("%s you!", Tobjnam(obj, "confuse")); +*/ + pline("%s‚ð”`‚¢‚Ä‚é‚Æ‚Ó‚ç‚‚¢‚Ä‚«‚½I", xname(obj)); make_confused((HConfusion & TIMEOUT) + (long) rnd(100), FALSE); break; case 3: if (!resists_blnd(&youmonst)) { +/*JP pline("%s your vision!", Tobjnam(obj, "damage")); +*/ + pline("%s‚ð”`‚¢‚Ä‚¢‚é‚ÆŽ‹Šo‚ª‚¨‚©‚µ‚­‚È‚Á‚Ä‚«‚½I", xname(obj)); make_blinded((Blinded & TIMEOUT) + (long) rnd(100), FALSE); if (!Blind) Your1(vision_clears); } else { +/*JP pline("%s your vision.", Tobjnam(obj, "assault")); +*/ + pline("%s‚ª‚ ‚È‚½‚ÌŽ‹ŠE‚É”—‚Á‚Ä‚«‚½D", xname(obj)); +/*JP You("are unaffected!"); +*/ + pline("‚µ‚©‚µC‚ ‚È‚½‚͉e‹¿‚ðŽó‚¯‚È‚©‚Á‚½I"); } break; case 4: +/*JP pline("%s your mind!", Tobjnam(obj, "zap")); +*/ + pline("%s‚ð”`‚¢‚Ä‚¢‚é‚ƌ܊´‚ª‚¨‚©‚µ‚­‚È‚Á‚Ä‚«‚½I", xname(obj)); (void) make_hallucinated( (HHallucination & TIMEOUT) + (long) rnd(100), FALSE, 0L); break; case 5: +/*JP pline("%s!", Tobjnam(obj, "explode")); +*/ + pline("%s‚Í”š”­‚µ‚½I", xname(obj)); useup(obj); *optr = obj = 0; /* it's gone */ /* physical damage cause by the shards and force */ +/*JP losehp(Maybe_Half_Phys(rnd(30)), "exploding crystal ball", +*/ + losehp(Maybe_Half_Phys(rnd(30)), "…»‹Ê‚Ì”š”­‚Å", KILLED_BY_AN); break; } @@ -944,30 +1108,54 @@ struct obj **optr; if (Hallucination) { if (!obj->spe) { +/*JP pline("All you see is funky %s haze.", hcolor((char *) 0)); +*/ + pline("‚¨‚¨Iƒtƒ@ƒ“ƒL[ƒ‚ƒ“ƒL[‚È%s‚à‚₪Œ©‚¦‚éD", hcolor((char *)0)); } else { switch (rnd(6)) { case 1: +/*JP You("grok some groovy globs of incandescent lava."); +*/ + You("…–å‚ÌŒ®‚ð‚à‚Á‚½…ŒË‰©–傪•Ç‚̉e‚ɉB‚ê‚Ä‚¢‚é‚Ì‚ªŒ©‚¦‚½D"); break; case 2: +#if 0 /*JP:T*/ pline("Whoa! Psychedelic colors, %s!", poly_gender() == 1 ? "babe" : "dude"); +#else + pline("ƒ[ƒIIƒ‰ƒŠ‚Á‚Ä‚é‚©‚¢H%sI", + poly_gender() == 1 ? "ƒxƒCƒr[" : "ƒ†["); +#endif break; case 3: +/*JP pline_The("crystal pulses with sinister %s light!", +*/ + pline("…»‚Í•s‹g‚È%sƒpƒ‹ƒX‚ð”­‚µ‚½I", hcolor((char *) 0)); break; case 4: +/*JP You_see("goldfish swimming above fluorescent rocks."); +*/ + You("ŒuŒõŠâ‚̏ã‚ð‹à‹›‚ª‰j‚¢‚Å‚¢‚é‚Ì‚ðŒ©‚½D"); break; case 5: +#if 0 /*JP*/ You_see( "tiny snowflakes spinning around a miniature farmhouse."); +#else + You("¬‚³‚¢á•Ð‚ªƒ~ƒjƒ`ƒ…ƒA‚Ì”_‰Æ‚̉Ƃ̂܂í‚è‚ð•‘‚Á‚Ä‚é‚Ì‚ðŒ©‚½D"); +#endif break; default: +/*JP pline("Oh wow... like a kaleidoscope!"); - break; +*/ + pline("ƒ[ƒID–œ‰Ø‹¾‚̂悤‚¾I"); + break; } consume_obj_charge(obj, TRUE); } @@ -976,20 +1164,32 @@ struct obj **optr; /* read a single character */ if (flags.verbose) +/*JP You("may look for an object or monster symbol."); +*/ + You("•¨‘Ì‚â‰ö•¨‚Ì‹L†‚ð’T‚¹‚éD"); +/*JP ch = yn_function("What do you look for?", (char *) 0, '\0'); +*/ + ch = yn_function("‰½‚ð’T‚µ‚Ü‚·‚©H", (char *)0, '\0'); /* Don't filter out ' ' here; it has a use */ if ((ch != def_monsyms[S_GHOST].sym) && index(quitchars, ch)) { if (flags.verbose) pline1(Never_mind); return; } +/*JP You("peer into %s...", the(xname(obj))); +*/ + You("%s‚ð”`‚«‚±‚ñ‚¾DDD", the(xname(obj))); nomul(-rnd(10)); multi_reason = "gazing into a crystal ball"; nomovemsg = ""; if (obj->spe <= 0) +/*JP pline_The("vision is unclear."); +*/ + pline("‰f‘œ‚Í•s‘N–¾‚¾‚Á‚½D"); else { int class; int ret = 0; @@ -1016,8 +1216,13 @@ struct obj **optr; break; default: { int i = rn2(SIZE(level_detects)); +#if 0 /*JP*/ You_see("%s, %s.", level_detects[i].what, level_distance(level_detects[i].where)); +#else + You_see("%s‚ð%sŒ©‚½D", level_detects[i].what, + level_distance(level_detects[i].where)); +#endif } ret = 0; break; @@ -1025,9 +1230,15 @@ struct obj **optr; if (ret) { if (!rn2(100)) /* make them nervous */ +/*JP You_see("the Wizard of Yendor gazing out at you."); +*/ + You("ƒCƒFƒ“ƒ_[‚Ì–‚–@Žg‚¢‚ª‚ ‚È‚½‚ð‚É‚ç‚ñ‚Å‚¢‚é‚Ì‚ðŒ©‚½D"); else +/*JP pline_The("vision is unclear."); +*/ + pline("‰f‘œ‚Í•s‘N–¾‚É‚È‚Á‚½D"); } } return; @@ -1206,11 +1417,20 @@ genericptr_t num; cvt_sdoor_to_door(&levl[zx][zy]); /* .typ = DOOR */ if (levl[zx][zy].doormask & D_TRAPPED) { if (distu(zx, zy) < 3) +/*JP b_trapped("door", 0); +*/ + b_trapped("”à", 0); else +#if 0 /*JP*/ Norep("You %s an explosion!", cansee(zx, zy) ? "see" : (!Deaf ? "hear" : "feel the shock of")); +#else + Norep("‚ ‚È‚½‚Í”š”­%sI", + cansee(zx, zy) ? "‚ðŒ©‚½" : (!Deaf ? "‰¹‚ð•·‚¢‚½" + : "‚̏Ռ‚‚ðŠ´‚¶‚½")); +#endif wake_nearto(zx, zy, 11 * 11); levl[zx][zy].doormask = D_NODOOR; } else @@ -1264,9 +1484,15 @@ openit() if (u.uswallow) { if (is_animal(u.ustuck->data)) { if (Blind) +/*JP pline("Its mouth opens!"); +*/ + pline("‰½ŽÒ‚©‚ÌŒû‚ªŠJ‚¢‚½I"); else +/*JP pline("%s opens its mouth!", Monnam(u.ustuck)); +*/ + pline("%s‚ÍŒû‚ðŠJ‚¢‚½I", Monnam(u.ustuck)); } expels(u.ustuck, u.ustuck->data, TRUE); return -1; @@ -1303,7 +1529,10 @@ struct trap *trap; cleared = TRUE; } +/*JP You("find %s.", an(defsyms[trap_to_defsym(tt)].explanation)); +*/ + You("%s‚ðŒ©‚Â‚¯‚½D", defsyms[trap_to_defsym(tt)].explanation); if (cleared) { display_nhwindow(WIN_MAP, TRUE); /* wait */ @@ -1330,7 +1559,10 @@ register int aflag; /* intrinsic autosearch vs explicit searching */ if (u.uswallow) { if (!aflag) +/*JP pline("What are you looking for? The exit?"); +*/ + pline("‰½‚ð’T‚·‚ñ‚¾‚¢H”ñíŒûH"); } else { int fund = (uwep && uwep->oartifact && spec_ability(uwep, SPFX_SEARCH)) ? uwep->spe : 0; @@ -1383,11 +1615,17 @@ register int aflag; /* intrinsic autosearch vs explicit searching */ */ continue; } else { +/*JP You_feel("an unseen monster!"); +*/ + You("Œ©‚¦‚È‚¢‰ö•¨‚Ì‹C”z‚ðŠ´‚¶‚½I"); map_invisible(x, y); } } else if (!sensemon(mtmp)) +/*JP You("find %s.", mtmp->mtame +*/ + You("%s‚ðŒ©‚Â‚¯‚½D", mtmp->mtame ? y_monnam(mtmp) : a_monnam(mtmp)); return 1;