diff -aurN JNetHack-3.4.3-0.8-src/README.swsd JNetHack-3.4.3-0.8-swsd091/README.swsd --- JNetHack-3.4.3-0.8-src/README.swsd 1970-01-01 09:00:00.000000000 +0900 +++ JNetHack-3.4.3-0.8-swsd091/README.swsd 2006-06-11 22:05:12.359375000 +0900 @@ -0,0 +1,12 @@ +show weight+show damegeパッチ(SWSDパッチ)について + +これらのコードは、元々Slash'EM向けに下記の方々が作成されたものです。 +これらを元にaki@jnhwin(info@jnhwin.sakura.ne.jp)がJNetHack用への +ポートを手がけ、ide氏(ide@phys98.homeip.net)が手直しして下さりました。 + +>WAC made dmg reports optional (wac@intergate.bc.ca) + +>[max] added display of object weight when picking up and in inventory +> (madmax@fly.cc.fer.hr). (Originally added by zaga.) + +使い方につきましてはオプションのヘルプを参照してください。 diff -aurN JNetHack-3.4.3-0.8-src/dat/jopthelp JNetHack-3.4.3-0.8-swsd091/dat/jopthelp --- JNetHack-3.4.3-0.8-src/dat/jopthelp 2006-04-02 21:02:55.355748900 +0900 +++ JNetHack-3.4.3-0.8-swsd091/dat/jopthelp 2006-06-11 22:05:12.359375000 +0900 @@ -68,6 +68,14 @@ コンパイル時に SCORE_ON_BOTL が設定されているならば: showscore スコアを表示する [FALSE] +コンパイル時に SHOW_DMG が設定されているならば: +showdmg 攻撃したとき/受けたときのダメージをメッセージ行 [FALSE] + に表示する. + +コンパイル時に SHOW_WEIGHT が設定されているならば: +invweight アイテム一覧にて大括弧'[]'つきで重さを表示します [FALSE] +showweight 所持品の重さの総計を最下行に表示します [FALSE] + コンパイル時に TEXTCOLOR が設定されているならば: color 画面の物の色々な色を使用する [TRUE for micros] hilite_pet ペットを強調表示する [FALSE] diff -aurN JNetHack-3.4.3-0.8-src/dat/opthelp JNetHack-3.4.3-0.8-swsd091/dat/opthelp --- JNetHack-3.4.3-0.8-src/dat/opthelp 2003-12-08 08:39:13.000000000 +0900 +++ JNetHack-3.4.3-0.8-swsd091/dat/opthelp 2006-06-11 22:05:12.375000000 +0900 @@ -67,6 +67,13 @@ Boolean option if SCORE_ON_BOTL was set at compile time: showscore display your approximate accumulated score [FALSE] +Boolean option if SHOW_DMG was set at compile time: +showdmg display damage inflicted/received on message line [FALSE] + +Boolean options if SHOW_WEIGHT was set at compile time: +invweight display weights of items in inventory in braces [FALSE] +showweight display total weight in inventory on bottom line [FALSE] + Boolean options if TEXTCOLOR was set at compile time: color use different colors for objects on screen [TRUE for micros] hilite_pet display pets in a highlighted manner [FALSE] diff -aurN JNetHack-3.4.3-0.8-src/doc/Guidebook.mn JNetHack-3.4.3-0.8-swsd091/doc/Guidebook.mn --- JNetHack-3.4.3-0.8-src/doc/Guidebook.mn 2003-12-08 08:39:13.000000000 +0900 +++ JNetHack-3.4.3-0.8-swsd091/doc/Guidebook.mn 2006-06-11 22:05:12.375000000 +0900 @@ -285,6 +285,10 @@ totals, you gain an experience level. The more experienced you are, the better you fight and withstand magical attacks. Many dungeons show only your experience level here. +.lp Weight +The total weight of all items in your inventory, displayed if you have the +.op showweight +option set. The number after the slash is your carrying capacity. .lp "Time " The number of turns elapsed so far, displayed if you have the .op time @@ -1872,6 +1876,9 @@ even if you override the selections with your own graphics strings. .lp ignintr Ignore interrupt signals, including breaks (default off). +.lp invweight +Display the weights of items in your inventory (and at other times) +in braces (default off). .lp legacy Display an introductory message when starting the game (default on). .lp lit_corridor @@ -2096,6 +2103,12 @@ the appearance of the display, not the way the game treats you. .lp showscore Show your approximate accumulated score on bottom line (default off). +.lp showdmg +Show damage inflicted/damage received (default off). Inflicted +damage is only shown to characters who have become experienced +enough to quantify their damage. +.lp showweight +Show total weight in inventory on bottom line (default off). .lp "silent " Suppress terminal beeps (default on). .lp sortpack diff -aurN JNetHack-3.4.3-0.8-src/doc/Guidebook.tex JNetHack-3.4.3-0.8-swsd091/doc/Guidebook.tex --- JNetHack-3.4.3-0.8-src/doc/Guidebook.tex 2003-12-08 08:39:13.000000000 +0900 +++ JNetHack-3.4.3-0.8-swsd091/doc/Guidebook.tex 2006-06-11 22:05:12.375000000 +0900 @@ -387,6 +387,11 @@ the better you fight and withstand magical attacks. Many dungeons show only your experience level here. %.lp +\item[\bb{Weight}] +The total weight of all items in your inventory, displayed if you have the +{\it showweight\/} +option set. The number after the slash is your carrying capacity. +%.lp \item[\bb{Time}] The number of turns elapsed so far, displayed if you have the {\it time\/} option set. @@ -2318,6 +2323,10 @@ \item[\ib{ignintr}] Ignore interrupt signals, including breaks (default off). %.lp +\item[\ib{invweight}] +Display the weights of items in your inventory (and at other times) +in braces (default off). +%.lp \item[\ib{legacy}] Display an introductory message when starting the game (default on). %.lp @@ -2570,6 +2579,14 @@ \item[\ib{showscore}] Show your approximate accumulated score on bottom line (default off). %.lp +\item[\ib{showdmg}] +Show damage inflicted/damage received (default off). Inflicted +damage is only shown to characters who have become experienced +enough to quantify their damage. +%.lp +\item[\ib{showweight}] +Show total weight in inventory on bottom line (default off). +%.lp \item[\ib{silent}] Suppress terminal beeps (default on). %.lp diff -aurN JNetHack-3.4.3-0.8-src/doc/Guidebook.txt JNetHack-3.4.3-0.8-swsd091/doc/Guidebook.txt --- JNetHack-3.4.3-0.8-src/doc/Guidebook.txt 2003-12-08 08:39:13.000000000 +0900 +++ JNetHack-3.4.3-0.8-swsd091/doc/Guidebook.txt 2006-06-11 22:05:12.390625000 +0900 @@ -380,6 +380,11 @@ ical attacks. Many dungeons show only your experience level here. + Weight + The total weight of all items in your inventory, displayed + if you have the showweight option set. The number after the + slash is your carrying capacity. + Time The number of turns elapsed so far, displayed if you have the time option set. @@ -2409,6 +2414,10 @@ ignintr Ignore interrupt signals, including breaks (default off). + invweight + Display the weights of items in your inventory (and at other + times) in braces (default off). + legacy Display an introductory message when starting the game (default on). @@ -2720,6 +2729,14 @@ Show your approximate accumulated score on bottom line (default off). + showdmg + Show damage inflicted/damage received (default off). Inflicted + damage is only shown to characters who have become experienced + enough to quantify their damage. + + showweight + Show total weight in inventory on bottom line (default off). + silent Suppress terminal beeps (default on). diff -aurN JNetHack-3.4.3-0.8-src/doc/jGuidebook.mn JNetHack-3.4.3-0.8-swsd091/doc/jGuidebook.mn --- JNetHack-3.4.3-0.8-src/doc/jGuidebook.mn 2006-04-02 21:02:55.449732900 +0900 +++ JNetHack-3.4.3-0.8-swsd091/doc/jGuidebook.mn 2006-06-11 22:05:12.390625000 +0900 @@ -509,6 +509,14 @@ ができる。経験値の合計がある一定値まで達すると、経験レベルが上 がる。経験を積むにつれ、戦い方が上達し魔法の攻撃にも耐えられるよ うになる。多くのバージョンでは経験レベルだけが表示される。 +.\"O .lp Weight +.lp 重さ(Weight) +.\"O The total weight of all items in your inventory, displayed if you have the +.\"O .op showweight +.\"O option set. The number after the slash is your carrying capacity. +所持しているアイテムの全重量、これを表示したい場合、 +.op showweight +オプションがオンにする。 スラッシュの後ろの数字が(よろめかずに)持ち運べる最大重量である。 .\"O .lp "Time " .lp 時間(Time) .\"O The number of turns elapsed so far, displayed if you have the @@ -3241,6 +3249,8 @@ .lp ignintr .\"O Ignore interrupt signals, including breaks (default off). ブレークを含む割り込み信号を無視する(標準設定はオフ)。 +.lp invweight +あなたの所持品(とそれ以外)のアイテムの重さを括弧付きで表示する(標準設定はオフ)。 .lp legacy .\"O Display an introductory message when starting the game (default on). ゲーム開始時に説明メッセージを表示する(標準設定はオン)。 @@ -3663,6 +3673,15 @@ .lp showscore .\"O Show your approximate accumulated score on bottom line (default off). 最下行に現在のスコアを表示する(標準設定はオフ)。 +.lp showdmg +.\"O Show damage inflicted/damage received (default off). Inflicted +.\"O damage is only shown to characters who have become experienced +.\"O enough to quantify their damage. +ダメージを与えた/ダメージを受けたときに数値表示する(標準設定はオフ)。 +ダメージを与えたときの表示はダメージが充分だった場合のみ。 +.lp showweight +.\"O Show total weight in inventory on bottom line (default off). +所持品の総重量を最下行に表示する(標準設定はオフ)。 .lp "silent " .\"O Suppress terminal beeps (default on). 端末のビープ音を鳴らさない(標準設定はオン)。 diff -aurN JNetHack-3.4.3-0.8-src/doc/jGuidebook.txt JNetHack-3.4.3-0.8-swsd091/doc/jGuidebook.txt --- JNetHack-3.4.3-0.8-src/doc/jGuidebook.txt 2006-04-02 21:02:55.481060900 +0900 +++ JNetHack-3.4.3-0.8-swsd091/doc/jGuidebook.txt 2006-06-11 22:05:12.390625000 +0900 @@ -354,6 +354,11 @@ れるようになる。多くのバージョンでは経験レベルだけが表示され る。 + 重さ(Weight) + 所 持 し て い る ア イ テムの全重量、これを表示したい場合、 + showweight オプションがオンにする。 スラッシュの後ろの 数 字 + が(よろめかずに)持ち運べる最大重量である。 + 時間(Time) 経過したターン数である。 time オプションがオンのときに表示さ れる。 @@ -2235,6 +2240,9 @@ ignintr ブレークを含む割り込み信号を無視する(標準設定はオフ)。 + invweight + あなたの所持品(とそれ以外)のアイテムの重さを括弧付きで表示する( + 標準設定はオフ)。 @@ -2542,6 +2550,14 @@ showscore 最下行に現在のスコアを表示する(標準設定はオフ)。 + showdmg + ダメージを与えた/ダメージを受けたときに数値表示する(標準設定 は + オ フ)。 ダメージを与えたときの表示はダメージが充分だった場合の + み。 + + showweight + 所持品の総重量を最下行に表示する(標準設定はオフ)。 + silent 端末のビープ音を鳴らさない(標準設定はオン)。 diff -aurN JNetHack-3.4.3-0.8-src/include/config.h JNetHack-3.4.3-0.8-swsd091/include/config.h --- JNetHack-3.4.3-0.8-src/include/config.h 2006-05-30 14:13:19.232250000 +0900 +++ JNetHack-3.4.3-0.8-swsd091/include/config.h 2006-06-11 22:05:12.390625000 +0900 @@ -354,6 +354,10 @@ #define EXP_ON_BOTL /* Show experience on bottom line */ #define SCORE_ON_BOTL /* added by Gary Erickson (erickson@ucivax) */ +#define SHOW_DMG /* WAC made dmg reports optional (wac@intergate.bc.ca)*/ +#define SHOW_WEIGHT /* [max] added display of object weight when picking up */ + /* and in inventory (madmax@fly.cc.fer.hr). */ + /* Originally added by zaga. */ #ifdef JNETHACK # define USE_MAKESINGULAR /* Enable singularize */ diff -aurN JNetHack-3.4.3-0.8-src/include/extern.h JNetHack-3.4.3-0.8-swsd091/include/extern.h --- JNetHack-3.4.3-0.8-src/include/extern.h 2006-04-02 21:02:55.528052900 +0900 +++ JNetHack-3.4.3-0.8-swsd091/include/extern.h 2006-06-11 22:05:12.406250000 +0900 @@ -131,6 +131,9 @@ E int FDECL(describe_level, (char *)); E const char *FDECL(rank_of, (int,SHORT_P,BOOLEAN_P)); E void NDECL(bot); +#ifdef TTY_GRAPHICS +E const char * FDECL(shorten_bot2, (const char *, unsigned int)); +#endif /* ### cmd.c ### */ @@ -696,6 +699,9 @@ E int NDECL(monster_nearby); E void FDECL(nomul, (int)); E void FDECL(unmul, (const char *)); +#ifdef SHOW_DMG +E void FDECL(showdmg, (int)); +#endif E void FDECL(losehp, (int,const char *,BOOLEAN_P)); E int NDECL(weight_cap); E int NDECL(inv_weight); diff -aurN JNetHack-3.4.3-0.8-src/include/flag.h JNetHack-3.4.3-0.8-swsd091/include/flag.h --- JNetHack-3.4.3-0.8-src/include/flag.h 2003-12-08 08:39:13.000000000 +0900 +++ JNetHack-3.4.3-0.8-swsd091/include/flag.h 2006-06-11 22:05:12.406250000 +0900 @@ -48,6 +48,9 @@ boolean ins_chkpt; /* checkpoint as appropriate */ #endif boolean invlet_constant; /* let objects keep their inventory symbol */ +#ifdef SHOW_WEIGHT + boolean invweight; /* show weight in inventory and when picking up */ +#endif boolean legacy; /* print game entry "story" */ boolean lit_corridor; /* show a dark corr as lit if it is in sight */ boolean made_amulet; @@ -73,6 +76,12 @@ #ifdef SCORE_ON_BOTL boolean showscore; /* show score */ #endif +#ifdef SHOW_DMG + boolean showdmg; /* show damage */ +#endif +#ifdef SHOW_WEIGHT + boolean showweight; /* show weight on status line */ +#endif boolean silent; /* whether the bell rings or not */ boolean sortpack; /* sorted inventory */ boolean soundok; /* ok to tell about sounds heard */ diff -aurN JNetHack-3.4.3-0.8-src/src/botl.c JNetHack-3.4.3-0.8-swsd091/src/botl.c --- JNetHack-3.4.3-0.8-src/src/botl.c 2006-04-02 21:02:55.747348900 +0900 +++ JNetHack-3.4.3-0.8-swsd091/src/botl.c 2006-06-11 22:05:12.406250000 +0900 @@ -14,6 +14,27 @@ #ifdef OVL0 extern const char *hu_stat[]; /* defined in eat.c */ +const char *hu_abbrev_stat[] = { /* must be kept consistent with eat.c */ +#if 0 /*JP*/ + "Sat", + "", + "Hun", + "Wea", + "Ftg", + "Ftd", + "Sta" +#else + "満", + "", + "空", + "衰", + "飢", + "暈", + "餓" +#endif +}; + + const char * const enc_stat[] = { #if 0 /*JP*/ "", @@ -32,6 +53,24 @@ #endif }; +const char *enc_abbrev_stat[] = { +#if 0 /*JP*/ + "", + "Brd", + "Ssd", + "Snd", + "Otd", + "Old" +#else + "", + "蹌", + "圧", + "限", + "重", + "過" +#endif +}; + STATIC_DCL void NDECL(bot1); STATIC_DCL void NDECL(bot2); #endif /* OVL0 */ @@ -304,10 +343,11 @@ return ret; } +static int bot2_abbrev = 0; /* Line 2 abbreviation level (max 4) */ + STATIC_OVL void -bot2() +bot2str(char *newbot2) { - char newbot2[MAXCO]; register char *nb; int hp, hpmax; int cap = near_capacity(); @@ -316,23 +356,32 @@ hpmax = Upolyd ? u.mhmax : u.uhpmax; if(hp < 0) hp = 0; - (void) describe_level(newbot2); - Sprintf(nb = eos(newbot2), -/*JP - "%c:%-2ld HP:%d(%d) Pw:%d(%d) AC:%-2d", oc_syms[COIN_CLASS], -*/ - "%c:%-2ld 体:%d(%d) 魔:%d(%d) 鎧:%-2d", oc_syms[COIN_CLASS], + if (bot2_abbrev < 4) + (void) describe_level(newbot2); + else + newbot2[0] = '\0'; + if (bot2_abbrev < 1) + Sprintf(nb = eos(newbot2), "%c:%-2ld ", + oc_syms[COIN_CLASS], #ifndef GOLDOBJ - u.ugold, + u.ugold #else - money_cnt(invent), + money_cnt(invent) #endif + ); + else + nb = newbot2; + Sprintf(nb = eos(newbot2), +/*JP + "HP:%d(%d) Pw:%d(%d) AC:%-2d", +*/ + "体:%d(%d) 魔:%d(%d) 鎧:%-2d", hp, hpmax, u.uen, u.uenmax, u.uac); if (Upolyd) Sprintf(nb = eos(nb), " HD:%d", mons[u.umonnum].mlevel); #ifdef EXP_ON_BOTL - else if(flags.showexp) + else if(flags.showexp && bot2_abbrev < 3) /*JP Sprintf(nb = eos(nb), " Xp:%u/%-1ld", u.ulevel,u.uexp); */ @@ -344,52 +393,103 @@ */ Sprintf(nb = eos(nb), " 経験:%u", u.ulevel); - if(flags.time) +#ifdef SHOW_WEIGHT + if (flags.showweight && bot2_abbrev < 3) +#if 0 /*JP*/ + Sprintf(nb = eos(nb), " Wt:%ld/%ld", (long)(inv_weight()+weight_cap()), +#else + Sprintf(nb = eos(nb), " 荷重:%ld/%ld", (long)(inv_weight()+weight_cap()), +#endif + (long)weight_cap()); +#endif + + if(flags.time && bot2_abbrev < 3) /*JP Sprintf(nb = eos(nb), " T:%ld", moves); */ Sprintf(nb = eos(nb), " 歩:%ld", moves); - if(strcmp(hu_stat[u.uhs], " ")) { + if (bot2_abbrev >= 2) { + if (hu_abbrev_stat[u.uhs][0]!='\0') { + Sprintf(nb = eos(nb), " "); + Strcat(newbot2, hu_abbrev_stat[u.uhs]); + } + } else if(strcmp(hu_stat[u.uhs], " ")) { Sprintf(nb = eos(nb), " "); Strcat(newbot2, hu_stat[u.uhs]); } /*JP - if(Confusion) Sprintf(nb = eos(nb), " Conf"); + if(Confusion) Sprintf(nb = eos(nb), bot2_abbrev >= 2 ? " Cnf" : " Conf"); */ - if(Confusion) Sprintf(nb = eos(nb), " 混乱"); + if(Confusion) Sprintf(nb = eos(nb), bot2_abbrev >= 2 ? " 乱" : " 混乱"); if(Sick) { if (u.usick_type & SICK_VOMITABLE) /*JP - Sprintf(nb = eos(nb), " FoodPois"); + Sprintf(nb = eos(nb), bot2_abbrev >= 2 ? " FPs" : " FoodPois"); */ - Sprintf(nb = eos(nb), " 食毒"); + Sprintf(nb = eos(nb), bot2_abbrev >= 2 ? " 毒" : " 食毒"); if (u.usick_type & SICK_NONVOMITABLE) /*JP Sprintf(nb = eos(nb), " Ill"); */ - Sprintf(nb = eos(nb), " 病気"); + Sprintf(nb = eos(nb), bot2_abbrev >= 2 ? " 病" : " 病気"); } /*JP - if(Blind) Sprintf(nb = eos(nb), " Blind"); + if(Blind) Sprintf(nb = eos(nb), bot2_abbrev >= 2 ? " Bnd" : " Blind"); */ - if(Blind) Sprintf(nb = eos(nb), " 盲目"); + if(Blind) Sprintf(nb = eos(nb), bot2_abbrev >= 2 ? " 盲" : " 盲目"); /*JP - if(Stunned) Sprintf(nb = eos(nb), " Stun"); + if(Stunned) Sprintf(nb = eos(nb), bot2_abbrev >= 2 ? " Stn" : " Stun"); */ - if(Stunned) Sprintf(nb = eos(nb), " 眩暈"); + if(Stunned) Sprintf(nb = eos(nb), bot2_abbrev >= 2 ? " 眩" : " 眩暈"); /*JP - if(Hallucination) Sprintf(nb = eos(nb), " Hallu"); + if(Hallucination) Sprintf(nb = eos(nb), bot2_abbrev >= 2 ? " Hal" : " Hallu"); */ - if(Hallucination) Sprintf(nb = eos(nb), " 幻覚"); + if(Hallucination) Sprintf(nb = eos(nb), bot2_abbrev >= 2 ? " 幻" : " 幻覚"); /*JP - if(Slimed) Sprintf(nb = eos(nb), " Slime"); + if(Slimed) Sprintf(nb = eos(nb), bot2_abbrev >= 2 ? " Slm" : " Slime"); */ - if(Slimed) Sprintf(nb = eos(nb), " どろどろ"); + if(Slimed) Sprintf(nb = eos(nb), bot2_abbrev >= 2 ? " 溶" : " どろどろ"); if(cap > UNENCUMBERED) - Sprintf(nb = eos(nb), " %s", enc_stat[cap]); + Sprintf(nb = eos(nb), " %s", bot2_abbrev >= 2 ? enc_abbrev_stat[cap] : enc_stat[cap]); +} + +STATIC_OVL void +bot2() +{ + char newbot2[MAXCO]; + + bot2str(newbot2); curs(WIN_STATUS, 1, 1); + putstr(WIN_STATUS, 0, newbot2); + return; +} + +/* ALI -- Shorten bot2 to fit in len spaces. + * Currently only used by tty port + * After the forth attempt the longest practical bot2 becomes: + * HP:700(700) Pw:111(111) AC:-127 Exp:30 + * Sat Lev Cnf FPs Ill Bnd Stn Hal Slm Old + * -- or just under 80 characters + */ +#ifdef TTY_GRAPHICS +const char* +shorten_bot2(str, len) +const char *str; +unsigned int len; +{ + static char cbuf[MAXCO]; + for(bot2_abbrev = 1; bot2_abbrev <= 4; bot2_abbrev++) { + bot2str(cbuf); + if (strlen(cbuf) <= len) + break; + } + if (bot2_abbrev > 4) + cbuf[len] = '\0'; /* If all else fails, truncate the line */ + bot2_abbrev = 0; + return cbuf; } +#endif /* TTY_GRAPHICS */ void bot() diff -aurN JNetHack-3.4.3-0.8-src/src/dokick.c JNetHack-3.4.3-0.8-swsd091/src/dokick.c --- JNetHack-3.4.3-0.8-src/src/dokick.c 2006-04-02 21:02:55.919652900 +0900 +++ JNetHack-3.4.3-0.8-swsd091/src/dokick.c 2006-06-11 22:05:12.406250000 +0900 @@ -100,8 +100,12 @@ if (blessed_foot_damage) dmg += rnd(4); if (uarmf) dmg += uarmf->spe; dmg += u.udaminc; /* add ring(s) of increase damage */ - if (dmg > 0) + if (dmg > 0) { mon->mhp -= dmg; +#ifdef SHOW_DMG + showdmg(dmg); +#endif + } if (mon->mhp > 0 && martial() && !bigmonst(mon->data) && !rn2(3) && mon->mcanmove && mon != u.ustuck && !mon->mtrapped) { /* see if the monster has a place to move into */ diff -aurN JNetHack-3.4.3-0.8-src/src/explode.c JNetHack-3.4.3-0.8-swsd091/src/explode.c --- JNetHack-3.4.3-0.8-src/src/explode.c 2006-04-02 21:02:56.044964900 +0900 +++ JNetHack-3.4.3-0.8-swsd091/src/explode.c 2006-06-11 22:05:12.406250000 +0900 @@ -385,6 +385,10 @@ mdam *= 2; mtmp->mhp -= mdam; mtmp->mhp -= (idamres + idamnonres); +#ifdef SHOW_DMG + if (mtmp->mhp > 0) + showdmg(mdam + idamres + idamnonres); +#endif } if (mtmp->mhp <= 0) { /* KMH -- Don't blame the player for pets killing gas spores */ @@ -425,6 +429,9 @@ else u.uhp -= damu; flags.botl = 1; +#ifdef SHOW_DMG + if (flags.showdmg) pline("[%d pts.]", damu); +#endif } if (u.uhp <= 0 || (Upolyd && u.mh <= 0)) { diff -aurN JNetHack-3.4.3-0.8-src/src/hack.c JNetHack-3.4.3-0.8-swsd091/src/hack.c --- JNetHack-3.4.3-0.8-src/src/hack.c 2006-04-02 21:02:56.091956900 +0900 +++ JNetHack-3.4.3-0.8-swsd091/src/hack.c 2006-06-11 22:05:12.421875000 +0900 @@ -2638,12 +2638,46 @@ } } +#ifdef SHOW_DMG +/* Print the amount of damage inflicted */ +/* KMH -- Centralized to one function */ +void +showdmg(n) + register int n; +{ + int lev; + + + if (flags.showdmg && n > 1) { + switch (Role_switch) { + case PM_BARBARIAN: case PM_MONK: lev = 10; break; + case PM_CAVEMAN: case PM_VALKYRIE: lev = 12; break; + case PM_SAMURAI: case PM_KNIGHT: lev = 14; break; + default: lev = 17; break; + } + switch (Race_switch) { + case PM_GNOME: if (lev > 14) lev = 14; break; + } +#ifdef WIZARD + if (wizard) lev = 1; +#endif + if(u.ulevel >= lev) + pline("(%d pts.)", n); + } + return; +} +#endif + void losehp(n, knam, k_format) register int n; register const char *knam; boolean k_format; { +#ifdef SHOW_DMG + if (flags.showdmg && n > 0) pline("[%d pts.]", n); /* WAC see damage */ +#endif + if (Upolyd) { u.mh -= n; if (u.mhmax < u.mh) u.mhmax = u.mh; diff -aurN JNetHack-3.4.3-0.8-src/src/mhitu.c JNetHack-3.4.3-0.8-swsd091/src/mhitu.c --- JNetHack-3.4.3-0.8-src/src/mhitu.c 2006-04-02 21:02:56.248596900 +0900 +++ JNetHack-3.4.3-0.8-swsd091/src/mhitu.c 2006-06-11 22:05:12.421875000 +0900 @@ -2731,6 +2731,9 @@ register struct monst *mtmp; register int n; { +#ifdef SHOW_DMG + if (flags.showdmg) pline("[%d pts.]", n); +#endif flags.botl = 1; if (Upolyd) { u.mh -= n; diff -aurN JNetHack-3.4.3-0.8-src/src/objnam.c JNetHack-3.4.3-0.8-swsd091/src/objnam.c --- JNetHack-3.4.3-0.8-src/src/objnam.c 2006-04-02 21:02:56.420900900 +0900 +++ JNetHack-3.4.3-0.8-swsd091/src/objnam.c 2006-06-11 22:05:12.421875000 +0900 @@ -1364,6 +1364,17 @@ Strcpy(prefix, "an "); Strcpy(prefix+3, tmpbuf+2); } +#endif + +#ifdef SHOW_WEIGHT + /* [max] weight inventory */ + if ((obj->otyp != BOULDER) || !throws_rocks (youmonst.data)) + if ((obj->otyp < LUCKSTONE) && (obj->otyp != CHEST) && (obj->otyp != LARGE_BOX) && + (obj->otyp != ICE_BOX) && (!Hallucination && flags.invweight)) + Sprintf (eos(bp), " {%d}", obj->owt); +#endif + +#if 0 /*JP*/ bp = strprepend(bp, prefix); #else Strcat(preprefix,prefix); @@ -1492,6 +1503,9 @@ char *FDECL((*func), (OBJ_P)); { long savequan; +#ifdef SHOW_WEIGHT + unsigned saveowt; +#endif char *nam; /* Note: using xname for corpses will not give the monster type */ @@ -1500,8 +1514,15 @@ savequan = otmp->quan; otmp->quan = 1L; +#ifdef SHOW_WEIGHT + saveowt = otmp->owt; + otmp->owt = weight(otmp); +#endif nam = (*func)(otmp); otmp->quan = savequan; +#ifdef SHOW_WEIGHT + otmp->owt = saveowt; +#endif return nam; } diff -aurN JNetHack-3.4.3-0.8-src/src/options.c JNetHack-3.4.3-0.8-swsd091/src/options.c --- JNetHack-3.4.3-0.8-src/src/options.c 2006-04-02 21:02:56.452228900 +0900 +++ JNetHack-3.4.3-0.8-swsd091/src/options.c 2006-06-11 22:05:12.421875000 +0900 @@ -111,6 +111,11 @@ #else {"ignintr", (boolean *)0, FALSE, SET_IN_FILE}, #endif +#ifdef SHOW_WEIGHT + {"invweight", &flags.invweight, FALSE, SET_IN_GAME}, +#else + {"invweight", (boolean *)0, FALSE, SET_IN_FILE}, +#endif {"large_font", &iflags.obsolete, FALSE, SET_IN_FILE}, /* OBSOLETE */ {"legacy", &flags.legacy, TRUE, DISP_IN_GAME}, {"lit_corridor", &flags.lit_corridor, FALSE, SET_IN_GAME}, @@ -171,6 +176,17 @@ #else {"showscore", (boolean *)0, FALSE, SET_IN_FILE}, #endif +/* WAC made the [ xx pts] dmg display optional */ +#ifdef SHOW_DMG + {"showdmg", &flags.showdmg, FALSE, SET_IN_GAME}, +#else + {"showdmg", (boolean *)0, FALSE, SET_IN_FILE}, +#endif +#ifdef SHOW_WEIGHT + {"showweight", &flags.showweight, FALSE, SET_IN_GAME}, +#else + {"showweight", (boolean *)0, FALSE, SET_IN_FILE}, +#endif {"silent", &flags.silent, TRUE, SET_IN_GAME}, {"softkeyboard", &iflags.wc2_softkeyboard, FALSE, SET_IN_FILE}, {"sortpack", &flags.sortpack, TRUE, SET_IN_GAME}, @@ -2419,6 +2435,9 @@ #ifdef SCORE_ON_BOTL || (boolopt[i].addr) == &flags.showscore #endif +#ifdef SHOW_WEIGHT + || (boolopt[i].addr) == &flags.showweight +#endif ) flags.botl = TRUE; diff -aurN JNetHack-3.4.3-0.8-src/src/uhitm.c JNetHack-3.4.3-0.8-swsd091/src/uhitm.c --- JNetHack-3.4.3-0.8-src/src/uhitm.c 2006-04-02 21:02:56.749844900 +0900 +++ JNetHack-3.4.3-0.8-swsd091/src/uhitm.c 2006-06-11 22:05:12.437500000 +0900 @@ -1272,6 +1272,9 @@ } } +#ifdef SHOW_DMG + if (!destroyed) showdmg(tmp); +#endif return((boolean)(destroyed ? FALSE : TRUE)); } @@ -1766,6 +1769,9 @@ */ pline("%sは突然弱くなったように見えた!", Monnam(mdef)); mdef->mhpmax -= xtmp; +#ifdef SHOW_DMG + if (xtmp < mdef->mhp) showdmg(xtmp); +#endif if ((mdef->mhp -= xtmp) <= 0 || !mdef->m_lev) { /*JP pline("%s dies!", Monnam(mdef)); @@ -2000,6 +2006,10 @@ break; } +#ifdef SHOW_DMG + if (tmp < mdef->mhp) showdmg(tmp); +#endif + mdef->mstrategy &= ~STRAT_WAITFORU; /* in case player is very fast */ if((mdef->mhp -= tmp) < 1) { if (mdef->mtame && !cansee(mdef->mx,mdef->my)) { diff -aurN JNetHack-3.4.3-0.8-src/src/zap.c JNetHack-3.4.3-0.8-swsd091/src/zap.c --- JNetHack-3.4.3-0.8-src/src/zap.c 2006-04-02 21:02:56.875156900 +0900 +++ JNetHack-3.4.3-0.8-swsd091/src/zap.c 2006-06-11 22:05:12.437500000 +0900 @@ -3437,6 +3437,11 @@ pline("zapped monster hp = %d (= %d - %d)", mon->mhp-tmp,mon->mhp,tmp); #endif mon->mhp -= tmp; + +#ifdef SHOW_DMG + if (mon->mhp > 0) showdmg(tmp); +#endif + return(tmp); } diff -aurN JNetHack-3.4.3-0.8-src/util/makedefs.c JNetHack-3.4.3-0.8-swsd091/util/makedefs.c --- JNetHack-3.4.3-0.8-src/util/makedefs.c 2006-04-02 21:02:57.063124900 +0900 +++ JNetHack-3.4.3-0.8-swsd091/util/makedefs.c 2006-06-11 22:05:12.437500000 +0900 @@ -829,6 +829,12 @@ #ifdef SHELL "shell command", #endif +#ifdef SHOW_DMG + "show damage amounts", +#endif +#ifdef SHOW_WEIGHT + "show weight of inventory", +#endif #ifdef SINKS "sinks", #endif diff -aurN JNetHack-3.4.3-0.8-src/win/Qt/qt_win.cpp JNetHack-3.4.3-0.8-swsd091/win/Qt/qt_win.cpp --- JNetHack-3.4.3-0.8-src/win/Qt/qt_win.cpp 2003-12-08 08:39:13.000000000 +0900 +++ JNetHack-3.4.3-0.8-swsd091/win/Qt/qt_win.cpp 2006-06-11 22:05:12.453125000 +0900 @@ -2593,6 +2593,15 @@ { score.setLabel(""); } +#ifdef SHOW_WEIGHT + if (::flags.showweight) { + Sprintf(buf, "/%ld", (long)weight_cap()); + weight.setLabel("Weight:",(long)(inv_weight()+weight_cap()),buf); + } else +#endif + { + weight.setLabel(""); + } if (first_set) { diff -aurN JNetHack-3.4.3-0.8-src/win/X11/winstat.c JNetHack-3.4.3-0.8-swsd091/win/X11/winstat.c --- JNetHack-3.4.3-0.8-src/win/X11/winstat.c 2006-04-02 21:02:57.157108900 +0900 +++ JNetHack-3.4.3-0.8-swsd091/win/X11/winstat.c 2006-06-11 22:05:40.156250000 +0900 @@ -256,16 +256,18 @@ #define F_ALIGN 16 #define F_TIME 17 #define F_SCORE 18 +#define F_WEIGHT 19 +#define F_WEIGHTCAP 20 -#define F_HUNGER 19 -#define F_CONFUSED 20 -#define F_SICK 21 -#define F_BLIND 22 -#define F_STUNNED 23 -#define F_HALLU 24 -#define F_ENCUMBER 25 +#define F_HUNGER 21 +#define F_CONFUSED 22 +#define F_SICK 23 +#define F_BLIND 24 +#define F_STUNNED 25 +#define F_HALLU 26 +#define F_ENCUMBER 27 -#define NUM_STATS 26 +#define NUM_STATS 28 /* * Notes: @@ -295,12 +297,14 @@ { "Alignment", SV_VALUE, (Widget) 0, -2, 0, FALSE, FALSE }, { "Time", SV_VALUE, (Widget) 0, -1, 0, FALSE, FALSE }, { "Score", SV_VALUE, (Widget) 0, -1, 0, FALSE, FALSE }, + { "Weight", SV_VALUE, (Widget) 0, -1, 0, FALSE, FALSE }, + { "Max Weight", SV_VALUE, (Widget) 0, -1, 0, FALSE, FALSE }, /*20*/ { "", SV_NAME, (Widget) 0, -1, 0, FALSE, TRUE }, /* hunger*/ - { "Confused", SV_NAME, (Widget) 0, 0, 0, FALSE, TRUE }, /*20*/ + { "Confused", SV_NAME, (Widget) 0, 0, 0, FALSE, TRUE }, { "", SV_NAME, (Widget) 0, 0, 0, FALSE, TRUE }, /* sick */ { "Blind", SV_NAME, (Widget) 0, 0, 0, FALSE, TRUE }, - { "Stunned", SV_NAME, (Widget) 0, 0, 0, FALSE, TRUE }, + { "Stunned", SV_NAME, (Widget) 0, 0, 0, FALSE, TRUE }, /*25*/ { "Hallucinating", SV_NAME, (Widget) 0, 0, 0, FALSE, TRUE }, { "", SV_NAME, (Widget) 0, 0, 0, FALSE, TRUE }, /*encumbr*/ #else /*JP*/ @@ -324,12 +328,14 @@ { "属性", SV_VALUE, (Widget) 0, -2, 0, FALSE, FALSE }, { "時間", SV_VALUE, (Widget) 0, -1, 0, FALSE, FALSE }, { "スコア", SV_VALUE, (Widget) 0, -1, 0, FALSE, FALSE }, + { "重量", SV_VALUE, (Widget) 0, -1, 0, FALSE, FALSE }, + { "最大重量", SV_VALUE, (Widget) 0, -1, 0, FALSE, FALSE }, /*20*/ { "", SV_NAME, (Widget) 0, -1, 0, FALSE, TRUE }, /* hunger*/ - { " 混乱 ", SV_NAME, (Widget) 0, 0, 0, FALSE, TRUE }, /*20*/ + { " 混乱 ", SV_NAME, (Widget) 0, 0, 0, FALSE, TRUE }, { " 病気 ", SV_NAME, (Widget) 0, 0, 0, FALSE, TRUE }, { " 盲目 ", SV_NAME, (Widget) 0, 0, 0, FALSE, TRUE }, - { " 眩暈 ", SV_NAME, (Widget) 0, 0, 0, FALSE, TRUE }, + { " 眩暈 ", SV_NAME, (Widget) 0, 0, 0, FALSE, TRUE }, /*25*/ { " 幻覚 ", SV_NAME, (Widget) 0, 0, 0, FALSE, TRUE }, { "", SV_NAME, (Widget) 0, 0, 0, FALSE, TRUE }, /*encumbr*/ #endif /*JP*/ @@ -554,6 +560,53 @@ #endif } + /* special case: weight can be enabled & disabled - clive */ + else if (attr_rec == &shown_stats[F_WEIGHT]) { + static boolean flagweight = TRUE; +#ifdef SHOW_WEIGHT + + if(flags.showweight && !flagweight) { + set_name(attr_rec->w, shown_stats[F_WEIGHT].name); + force_update = TRUE; + flagweight = flags.showweight; + } else if(!flags.showweight && flagweight) { + set_name(attr_rec->w, ""); + set_value(attr_rec->w, ""); + flagweight = flags.showweight; + } + if(!flagweight) return; +#else + if (flagweight) { + set_name(attr_rec->w, ""); + set_value(attr_rec->w, ""); + flagweight = FALSE; + } + return; +#endif + } else if (attr_rec == &shown_stats[F_WEIGHTCAP]) { + static boolean flagweightcap = TRUE; +#ifdef SHOW_WEIGHT + + if(flags.showweight && !flagweightcap) { + set_name(attr_rec->w, shown_stats[F_WEIGHTCAP].name); + force_update = TRUE; + flagweightcap = flags.showweight; + } else if(!flags.showweight && flagweightcap) { + set_name(attr_rec->w, ""); + set_value(attr_rec->w, ""); + flagweightcap = flags.showweight; + } + if(!flagweightcap) return; +#else + if (flagweightcap) { + set_name(attr_rec->w, ""); + set_value(attr_rec->w, ""); + flagweightcap = FALSE; + } + return; +#endif + } + /* special case: when polymorphed, show "HD", disable exp */ else if (attr_rec == &shown_stats[F_LEVEL]) { static boolean lev_was_poly = FALSE; @@ -714,6 +767,16 @@ #else case F_SCORE: val = 0L; break; #endif +#ifdef SHOW_WEIGHT + case F_WEIGHT: val = (long) (flags.showweight ? + inv_weight() + weight_cap() : + 0); break; + case F_WEIGHTCAP: val = (long) (flags.showweight ? + weight_cap() : 0); break; +#else + case F_WEIGHT: val = 0L; break; + case F_WEIGHTCAP: val = 0L; break; +#endif default: { /* @@ -796,6 +859,8 @@ case F_ALIGN: return "Neutral"; case F_TIME: return "4294967295"; /* max ulong */ case F_SCORE: return "4294967295"; /* max ulong */ + case F_WEIGHT: return "4294967295"; /* max ulong */ + case F_WEIGHTCAP:return "4294967295"; /* max ulong */ } impossible("width_string: unknown index %d\n", sv_index); return ""; @@ -961,9 +1026,9 @@ F_STUNNED, F_HALLU, F_ENCUMBER, -1,0,0 }; static int col2_indices[] = { F_MAXHP, F_ALIGN, F_TIME, F_EXP, - F_MAXPOWER, -1,0,0 }; + F_MAXPOWER, F_WEIGHTCAP, -1,0,0 }; static int col1_indices[] = { F_HP, F_AC, F_GOLD, F_LEVEL, - F_POWER, F_SCORE, -1,0,0 }; + F_POWER, F_WEIGHT,F_SCORE, -1,0,0 }; /* diff -aurN JNetHack-3.4.3-0.8-src/win/tty/wintty.c JNetHack-3.4.3-0.8-swsd091/win/tty/wintty.c --- JNetHack-3.4.3-0.8-src/win/tty/wintty.c 2006-04-02 21:02:57.204100900 +0900 +++ JNetHack-3.4.3-0.8-swsd091/win/tty/wintty.c 2006-06-11 22:05:12.453125000 +0900 @@ -1940,6 +1940,7 @@ register char *ob; register const char *nb; register int i, j, n0; + register int k; #if 1 /*JP*/ int kchar2 = 0; /* if 1, kanji 2nd byte */ #endif @@ -1982,6 +1983,18 @@ if(nb && nb > str+2) str = nb - 2; } + k = 0; + /* WAC - attempt to break or shorten line 2 if it's too long */ + if(cw->cury && (int)strlen(str) >= CO) { + if(cw->cury < (cw->maxrow - 1)) + for(k = CO - 1; k && str[k] != ' ';) + k--; + if(!k || (int)strlen(str + k + 1) >= CO) { + str = shorten_bot2(str, CO); + k = 0; + } + } + nb = str; for(i = cw->curx+1, n0 = cw->cols; i < n0; i++, nb++) { if(!*nb) {