diff -aurN JNetHack-3.4.3-0.10/README.menucolor JNetHack-3.4.3-0.10-7pcs/README.menucolor --- JNetHack-3.4.3-0.10/README.menucolor 1970-01-01 09:00:00.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/README.menucolor 2008-08-12 16:16:29.000000000 +0900 @@ -0,0 +1,102 @@ + + This is version 1.4 of the menucolors patch. + + This patch allows the user to define in what color menus are shown. + For example, putting + + OPTIONS=menucolors + MENUCOLOR=" blessed "=green + MENUCOLOR=" holy "=green + MENUCOLOR=" cursed "=red + MENUCOLOR=" unholy "=red + MENUCOLOR=" cursed .* (being worn)"=orange&underline + + in the configuration file makes all known blessed items + show up in green, all cursed items show up in red and + all cursed worn items show up in orange and underlined + when viewing inventory. + + If you have regex.h but it is not GNU (e.g. DJGPP, *BSD), uncomment + #define MENU_COLOR_REGEX_POSIX in include/config.h + + If you do not have regex.h, comment + #define MENU_COLOR_REGEX out from include/config.h + and replace the MENUCOLOR lines in your config file with these: + + MENUCOLOR="* blessed *"=green + MENUCOLOR="* holy *"=green + MENUCOLOR="* cursed *"=red + MENUCOLOR="* unholy *"=red + MENUCOLOR="* cursed * (being worn)"=orange&underline + + + Colors: black, red, green, brown, blue, magenta, cyan, gray, orange, + lightgreen, yellow, lightblue, lightmagenta, lightcyan, white. + Attributes: none, bold, dim, underline, blink, inverse. + + Note that the terminal is free to interpret the attributes however + it wants. + + + TODO/BUGS: + + o Only works with TTY + o You can't use '=' or '&' in the match-string. + o Maybe add color-field to tty_menu_item in include/wintty.h + (so there's no need to find the color for the line again) + o Guidebook is not up to date + o Better place to put the functions, colornames[] and attrnames[]? + o Some menus do not need coloring; maybe add new parameter + to process_menu_window()? + + + FIXES: + + v1.4: + o Option to use standard instead of GNU regex functions. + + v1.3: + o Updated to use 3.4.3 codebase. + o Added a text to #version to show menucolors is compiled in. + + v1.2: + o Updated to use 3.4.2 codebase. + + v1.1: + o Updated to use 3.4.1 codebase. + o replaced USE_REGEX_MATCH with MENU_COLOR_REGEX + + v1.04: + o Oops! 1.03 worked only on *nixes... (GNU regex.h) + o Compile-time option USE_REGEX_MATCH: if it's defined, use regex, + otherwise use globbing. ('?' and '*' wildcards) + + v1.03: + + o Now using Nethack 3.4.0 codebase + o Compile-time option MENU_COLOR + o Strings match using regular expressions instead of globbing + o You can use attribute with color (attr must come after '&') + o Use ``MENUCOLOR="foo"=color'' instead of ``OPTIONS=menucolor=...'' + (Both work, but OPTIONS complains if you define menucolor + more than once) + + v1.02: + + o Should now work with OS/2, thanks to Jukka Lahtinen + o Strings match now using simple globbing. ('?' and '*' wildcards) + + v1.01: + + o Moved 'menucolors' boolean option, so now the options-menu + is in alphabetical order. + o Fixed 'menucolor' description in dat/opthelp. + o menu_colorings is now initialized to null in src/decl.c. + + v1.0: + + o Initial release + +-- + Pasi Kallinen + pkalli@cs.joensuu.fi diff -aurN JNetHack-3.4.3-0.10/dat/jalias.dat JNetHack-3.4.3-0.10-7pcs/dat/jalias.dat --- JNetHack-3.4.3-0.10/dat/jalias.dat 1970-01-01 09:00:00.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/dat/jalias.dat 2008-08-12 16:16:29.000000000 +0900 @@ -0,0 +1,375 @@ +# +# Japanese NetHack Copyright (c) Issei Numata 2000 +# For 3.4, (c) Kentaro Shirakata 2003-2004 +# For Japanese alias, (c) Kiyotomo Ide 2005 +# JNetHack may be freely redistributed. See license for details. +# +# 別名から正式名称へ変換するためのテーブル +# 正式名称: 別名: +# で定義 +# 循環した変換を作らないよう注意 +# +# Monster +# +@dingo: ディンゴ: +@pyrolisk: パイロリスク: +@Death: 死: +@Pestilence: 疫病: +@Famine: 飢餓: +@scorpion: 蠍: +@quantum mechanic: 量子場: +@quantum mechanic: 量子力学: +@quantum mechanic: 量子物理学: +@quantum mechanic: 量子物理: +@garter snake: 小さな蛇: +@snake: 蛇: +@water moccasin: 水蛇: +@pit viper: 穴蛇: +@python: 錦蛇: +@straw golem: かかし: +@straw golem: 案山子: +@ghost: 霊: +@Vlad the Impaler: ヴラド侯: +@Lord Carnarvon: ケナーヴェン卿: +@Pelias: ピーリエス: +@Shaman Karnov: カルノフ: +@Twoflower: トゥフロア: +@Lord Surtur: サーター卿: +@phantom: お化け: +@lizard: 蜥蜴: +@crocodile: 鰐: +@crocodile: クロコダイル: +@fox: キツネ: +@fox: きつね: +@little dog: 子犬: +@little dog: 小犬: +@winter wolf cub: 冬狼の仔: +@hell hound pup: ヘルハウンドの子: +@gas spore: 胞子ガス: +@floating eye: さまよう眼: +@freezing sphere: 凍った球体: +@kitten: 仔猫: +@kitten: 子猫: +@housecat: 猫: +@lynx: リュンクス: +@lynx: リンクス: +@panther: ヒョウ: +@panther: 豹: +@winged gargoyle: 羽の有るガーゴイル: + +@mind flayer: マインドフレイア: +@mind flayer: マインドフレイアー: +@mind flayer: マインドフレイヤ: +@mind flayer: マインドフレイヤー: +@mind flayer: マインドフレアー: +@mind flayer: マインドフレヤ: +@mind flayer: マインドフレヤー: + +@master mind flayer: マスターマインドフレイア: +@master mind flayer: マスターマインドフレイアー: +@master mind flayer: マスターマインドフレイヤ: +@master mind flayer: マスターマインドフレイヤー: +@master mind flayer: マスターマインドフレアー: +@master mind flayer: マスターマインドフレヤ: +@master mind flayer: マスターマインドフレヤー: + + +@kobold: コボルト: +@large kobold: 大きなコボルト: +@kobold lord: コボルトの貴族: +@kobold shaman: コボルトの呪術師: +@rabid rat: 凶暴ネズミ: +@rabid rat: 狂暴ネズミ: +@wererat: ネズミ人間: +@rock mole: 岩モグラ: +@cave spider: 洞窟蜘蛛: +@centipede: 百足: +@giant spider: 巨大蜘蛛: +@pony: 子馬: +@pony: 小馬: +@fog cloud: 霧の曇: +@couatl: コアトル: +@bat: コウモリ: +@bat: 蝙蝠: +@giant bat: 巨大コウモリ: +@giant bat: 巨大蝙蝠: +@raven: レイブン: +@raven: 大鴉: +@raven: 大烏: +@vampire bat: 吸血コウモリ: +@vampire bat: 吸血蝙蝠: +@baby red dragon: 赤ドラゴンの子供: +@red dragon: 赤ドラゴン: +@kobold mummy: コボルトのミイラ: +@red naga hatchling: 赤ナーガの雛: +@red naga: 赤ナーガ: +@ogre lord: オーガの貴族: +@monkey: 小猿: +@ape: 大猿: +@carnivorous ape: 人食い猿: +@kobold zombie: コボルトのゾンビ: +@skeleton: スケルトン: +@leather golem: 革のゴーレム: +@shopkeeper: 店長: +@high priest: 高僧: +@water demon: 水の悪魔: +@barbed devil: 髭の悪魔: +@pit fiend: ピットフィーンド: +@Geryon: ゲーリューオン: +@Dispater: ディスペーター: +@Orcus: オルクス: +@jellyfish: くらげ: +@shark: 鮫: +@baby crocodile: 鰐の子供: +@crocodile: 鰐: +@Caveman: 洞穴人: +#@Cavewoman: 洞穴人: +#@caveman: 洞穴人: +#@cavewoman: 洞穴人: +@Monk: 武道家: +#@monk: 武道家: +@Wizard: 魔術師: +#@wizard: 魔術師: + +# +# bogus monster +# +@rot grub: 赤蛆: +@Ancient Multi-Hued Dragon: 老齢のマスタードラゴン: +@Evil Iggy: 邪悪なイギー: +@killer bunny: 凶悪ウサちゃん: +@white rabbit: 白兎: +@Barney the dinosaur: 恐竜バーニーちゃん: +@questing beast: 倒された伝説の怪物: +@mother-in-law: 義理の母: + +# +# Objects +# +)throwing star: 星型の金属板: +)dwarvish mattock: ドワーフの鶴嘴: +)broad pick: 幅広の鶴嘴: +)heavy pick: 重い鶴嘴: +)pruning hook: 刈り込み鎌: +)pruning hook: 刈込み鎌: +)sling: 投石機: +)crossbow: 弩: +)pick-axe: 鶴嘴: +)crossbow bolt: クロスボウボルト: +)crossbow: クロスボウ: +)scimitar: 三日月刀: +)tsurugi: 剣: +)bec de corbin: ベク・ド・コルバン: +)voulge: ボルゲ: +)voulge: バウルジ: +)pole cleaver: 肉切り包丁: +)fauchard: 槍剣: +)pole sickle: かま: +)pole sickle: 鎌: +)hooked polearm: 鈎付の長斧: +)hooked polearm: 鈎付きの長斧: +)beaked polearm: 槍つきの長斧: +)beaked polearm: 槍付きの長斧: + +]fedora: フィードラ: +]fedora: フェドーラ: +]fedora: 中折れ帽子: +]fedora: 中折帽子: +]low boots: 踵の低い靴: +]high boots: 踵の高い靴: +]high boots: ハイヒール: +]speed boots: 早さの靴: +]speed boots: 速さの靴: +]kicking boots: 蹴り上げ靴: +]dwarvish iron helm: ドワーフの兜: +]etched helmet: 模様入りの兜: +]visored helmet: 面頬つきの兜: +]red dragon scale mail: 赤ドラゴンの鱗鎧: +]red dragon scales: 赤ドラゴンの鱗: +]leather armor: 皮鎧: +]leather jacket: 皮の服: +]alchemy smock: 錬金術師の仕事着: +]leather cloak: 皮のクローク: +]dwarvish roundshield: ドワーフの盾: +]leather gloves: 革の小手: +]old gloves: 古い小手: +]padded gloves: 詰めもののある小手: +]riding gloves: 乗馬用の小手: + +=shock resistance: 耐衝撃の指輪: +=shock resistance: 対電撃の指輪: +=shock resistance: 耐電撃の指輪: +=slow digestion: 消化遅延の指輪: +=coral: サンゴの指輪: +=black onyx: 黒碼碯の指輪: +=black onyx: 黒メノウの指輪: +=jade: 翡翠の指輪: +=jade: ヒスイの指輪: +=agate: 碼碯の指輪: +=agate: メノウの指輪: +=sapphire: サファイヤの指輪: +=diamond: ダイアモンドの指輪: + +(bag of holding: 保存の鞄: +(tallow candle: 獣脂の蝋燭: +(candle: 蝋燭: +(wax candle: 蜜蝋の蝋燭: +(brass lantern: 懐中電灯: +(bell: 鐘: + +(pick-axe: 鶴嘴: +(lock pick: 鍵開け道具: +(tinning kit: 缶詰作成器具: +(magic marker: 魔法のマーカー: +(grappling hook: 引っかけ棒: + +/light: 光の杖: +/slow monster: 遅くなる杖: +/slow monster: 遅くする杖: +/speed monster: 早くなる杖: +/speed monster: 速くなる杖: +/speed monster: 早くする杖: +/speed monster: 速くする杖: +/undead turning: 死人返しの杖: +/create monster: 怪物を作る杖: +/create monster: 怪物を創る杖: +/nothing: ただの杖: +/nothing: 只の杖: +/make invisible: 透明の杖: +/make invisible: 透明にする杖: +/probing: 探査の杖: +/probing: 調査の杖: +/magic missile: 魔法の矢の杖: +/secret door detection: 秘密の扉探索の杖: + +*dilithium crystal: ダイリチウムの結晶: +*dilithium crystal: ディリチウムの結晶: +*diamond: ダイアモンド: +*sapphire: サファイヤ: +*jade: 翡翠: +*jade: ヒスイ: +*agate: 碼碯: +*agate: メノウ: +*obsidian: 黒曜石: +*loadstone: 漬物石: +*loadstone: 漬け物石: + +# +# special tools +# +(Bell of Opening: 解放のベル: +(Bell of Opening: 解放の鐘: +(Bell of Opening: 開放の鐘: +(silver bell: 銀の鐘: + +%tripe ration: 乾肉: +%tripe ration: 干肉: +%tripe ration: 干し肉: +%tripe ration: ペットフード: +%food ration: 食糧: +%gunyoki: 兵糧丸: +%kelp frond: 昆布: +%kelp frond: 海草: +%kelp frond: 海藻: +%clove of garlic: 大蒜: +%clove of garlic: 蒜: +%clove of garlic: ニンニク: +%carrot: 人参: +%carrot: ニンジン: + +!speed: 速くする薬: +!speed: 早くする薬: + +?taming: 怪物を飼い慣らす巻物: +?taming: 怪物を飼い馴らす巻物: +?taming: 魅了の巻物: +?light: 灯りの巻物: +?stinking cloud: 悪臭の巻物: +?magic mapping: 魔法の地図の巻物: + ++light: 光の魔法書: ++cure sickness: 病気を治す魔法書: ++haste self: 早くする魔法書: ++haste self: 速くする魔法書: ++haste self: 素早さの魔法書: ++haste self: 加速の魔法書: ++slow monster: 遅くする魔法書: ++slow monster: 怪物を遅くする魔法書: ++slow monster: 減速の魔法書: ++charm monster: 怪物を飼いならす魔法書: ++charm monster: 怪物を飼い慣らす魔法書: ++charm monster: 怪物を飼い馴らす魔法書: ++charm monster: 怪物を魅了する魔法書: ++create monster: 怪物を作る魔法書: ++create monster: 怪物を創る魔法書: ++turn undead: 死人返しの魔法書: ++magic missile: 魔法の矢の魔法書: ++confuse monster: 怪物を混乱させる魔法書: ++detect unseen: 見えないものを探す魔法書: ++remove curse: 呪いを解く魔法書: ++magic mapping: 魔法の地図の魔法書: ++create familiar: 使い魔を作る魔法書: ++turn monster: 耐アンデッドの魔法書: + +)wakizashi: 脇差: +)naginata: 薙刀: +(osaku: さく: + +# +# Artifacts +# +ASting: つらぬき丸: + +AMjollnir: ミョルニル: +AMjollnir: ミョルニール: +AMjollnir: ミョッルニル: +AMjollnir: ミュルニル: +AMjollnir: トールハンマー: +AMjollnir: トゥールハンマー: + +AVorpal Blade: ヴォーパルブレード: +AVorpal Blade: けしにぐの剣: +AVorpal Blade: ひるめく剣: +AVorpal Blade: ことしえる剣: +AVorpal Blade: まきれもなぎな剣: +AVorpal Blade: ねれたる刃: + +AThe Staff of Aesculapius: アエスキュラピスの杖: +AThe Eyes of the Overworld: 超世界の眼: +AThe Tsurugi of Muramasa: 村正: +AThe Eye of the Aethiopica: エチオピアの眼: + +# +# Others +# +dFort Ludios: フォートローディオス: + +# +# For TNG +# +@Max: ボルン: +@Wolfgang: パウリ: +@Louis: ド・ブロイ: +@Erwin: シュレディンガー: +@Erwin: シュレーディンガー: +@Werner: ハイゼンベルク: +@Niels: ボーア: +@Paul: ディラック: +@Pascual: ジョルダン: +@Pascual: ヨルダン: +@Pascual: エルンスト・パスクアル・ヨルダン: +@Pascual: エルンスト・パスカル・ヨルダン: +@Dick: ファインマン: +@Sam: ベケット: + +=gain constitution: 健康の指輪: +(chemistry set: 実験道具: +(transistor: トランジスター: +(god-o-meter: ゴドメーター: +(IC: 集積回路: +(IC: IC: +(IC: LSI: +(pack of floppies: CD―ROM: +(pack of floppies: CD-ROM: +(pack of floppies: CD―R: +(pack of floppies: CD-R: diff -aurN JNetHack-3.4.3-0.10/dat/jopthelp JNetHack-3.4.3-0.10-7pcs/dat/jopthelp --- JNetHack-3.4.3-0.10/dat/jopthelp 2008-08-12 15:49:46.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/dat/jopthelp 2008-08-12 16:30:46.000000000 +0900 @@ -68,10 +68,21 @@ コンパイル時に SCORE_ON_BOTL が設定されているならば: showscore スコアを表示する [FALSE] +コンパイル時に SHOW_DMG が設定されているならば: +showdmg 攻撃したとき/受けたときのダメージをメッセージ行 [FALSE] + に表示する. + +コンパイル時に SHOW_WEIGHT が設定されているならば: +invweight アイテム一覧にて大括弧'[]'つきで重さを表示します [FALSE] +showweight 所持品の重さの総計を最下行に表示します [FALSE] + コンパイル時に TEXTCOLOR が設定されているならば: color 画面の物の色々な色を使用する [TRUE for micros] hilite_pet ペットを強調表示する [FALSE] +コンパイル時に TEXTCOLOR 及び MENU_COLOR が設定されているならば: +menucolor アイテムメニューの祝呪状態の色設定ができる [TRUE for micros] + コンパイル時に TIMED_DELAY が設定されているならば(tty インターフェースのみ): timed_delay UNIXやVMSではディスプレイへ表示をポーズする代りに [TRUE] タイマーを使う.MSDOSで termcapライブラリを使用し @@ -171,6 +182,8 @@ 1 文字を指定するだけでよい.male や female オプションも使用でき るが,gender オプションが優先する. horsename 冒険を供にする最初の馬の名前 [NONE] +menucolor menucolor オプションの設定の詳細については、README.menucolorを + 参照のこと.(英文) menu_* メニューコマンドで使用する一文字のキャラクタ.以下にあるのは 全てのコマンドのメニューである.それぞれに続く( )内文字の意味 は次の通り: 'x' = x11, 't' = tty, 'g' = Gem, 'a' = Amiga. diff -aurN JNetHack-3.4.3-0.10/dat/opthelp JNetHack-3.4.3-0.10-7pcs/dat/opthelp --- JNetHack-3.4.3-0.10/dat/opthelp 2003-12-08 08:39:13.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/dat/opthelp 2008-08-12 16:30:46.000000000 +0900 @@ -67,10 +67,20 @@ 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] +Boolean option if TEXTCOLOR and MENU_COLOR were set at compile time: +menucolors use different colors for menus [TRUE for micros] + Boolean option if TIMED_DELAY was set at compile time (tty interface only): timed_delay on unix and VMS, use a timer instead of sending extra screen output when attempting to pause for @@ -169,6 +179,21 @@ still denote your gender using the "male" and "female" options, the "gender" option will take precedence. [RANDOM] horsename the name of your first horse [NONE] +menucolor Set colors for menus. (menucolor:"regex_string"=color) + If boolean option ``menucolors'' is true, menus will be shown + with different colors. + For example, setting ``menucolor:" blessed "=green'' shows + all lines in a menu with the text " blessed " in green. + The string is matched using regular expressions. + Valid values for the color are black, red, green, brown, blue, + magenta, cyan, gray, orange, lightgreen, yellow, lightblue, + lightmagenta, lightcyan and white. + You can define menucolor as many times as you wish; those + defined later will take precedence. + Instead of using this with OPTIONS, consider using + MENUCOLOR="regex_string"=color in the configuration file. + Setting menucolor has effect only if TEXTCOLOR and MENU_COLOR + were set at compile time. [NONE] menu_* create single character accelerators for menu commands. Below is a list of all commands. Each is followed by a list of window- ports that implement them: 'x' is X11, 't' is tty, 'g' is Gem, diff -aurN JNetHack-3.4.3-0.10/default.css JNetHack-3.4.3-0.10-7pcs/default.css --- JNetHack-3.4.3-0.10/default.css 1970-01-01 09:00:00.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/default.css 2008-08-12 16:16:29.000000000 +0900 @@ -0,0 +1,70 @@ +/*********************************/ +/** CSS for NetHack HTMLDUMP **/ +/*********************************/ + +/* dump html body style */ +.nhBody { + color:white ; + background-color:#202020 ; +} + +DT { + font-weight:bold; +} + +/* version display style */ +.nhVer { + color:#A8A854; + text-align:left; +} + +/* message */ +.nhMSG { + color:white; + text-align:left; +} + +/* enlightenment */ +.nhEL { + color:white; + text-align:left; +} + +/* death */ +.nhCAUSE { + color:pink; + text-align:left; +} + +/* screen dump style */ +.nhScreen { + background-color:black; +} + +/* pet style on the screen dump */ +.nhPet { + background-color:#A8A8A8; +} + +/* player style on the screen dump */ +.nhPlayer { + border-bottom:2px solid white; /* 2px white underline */ +} + +/* NetHack color style */ +.nh0 { color:#A8A8A8; } /* CLR_BLACK */ +.nh1 { color:#A80000; } /* CLR_RED */ +.nh2 { color:#00A800; } /* CLR_GREEN */ +.nh3 { color:#A8A800; } /* CLR_BROWN */ +.nh4 { color:#5454FC; } /* CLR_BLUE */ +.nh5 { color:#A800A8; } /* CLR_MAGENTA */ +.nh6 { color:#00A8A8; } /* CLR_CYAN */ +.nh7 { color:#A8A8A8; } /* CLR_GRAY */ +.nh8 { color:#A8A8A8; } /* NO_COLOR */ +.nh9 { color:#FC5454; } /* CLR_ORANGE */ +.nh10 { color:#54FC54; } /* CLR_BRIGHT_GREEN */ +.nh11 { color:#FCFC54; } /* CLR_YELLOW */ +.nh12 { color:#0000FC; } /* CLR_BRIGHT_BLUE */ +.nh13 { color:#FC00FC; } /* CLR_BRIGHT_MAGENTA */ +.nh14 { color:#00FCFC; } /* CLR_BRIGHT_CYAN */ +.nh15 { color:#FCFCFC; } /* CLR_WHITE */ diff -aurN JNetHack-3.4.3-0.10/doc/Guidebook.mn JNetHack-3.4.3-0.10-7pcs/doc/Guidebook.mn --- JNetHack-3.4.3-0.10/doc/Guidebook.mn 2003-12-08 08:39:13.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/doc/Guidebook.mn 2008-08-12 16:30:46.000000000 +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.10/doc/Guidebook.tex JNetHack-3.4.3-0.10-7pcs/doc/Guidebook.tex --- JNetHack-3.4.3-0.10/doc/Guidebook.tex 2003-12-08 08:39:13.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/doc/Guidebook.tex 2008-08-12 16:30:46.000000000 +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.10/doc/Guidebook.txt JNetHack-3.4.3-0.10-7pcs/doc/Guidebook.txt --- JNetHack-3.4.3-0.10/doc/Guidebook.txt 2003-12-08 08:39:13.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/doc/Guidebook.txt 2008-08-12 16:30:46.000000000 +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.10/doc/jGuidebook.mn JNetHack-3.4.3-0.10-7pcs/doc/jGuidebook.mn --- JNetHack-3.4.3-0.10/doc/jGuidebook.mn 2008-08-12 15:49:47.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/doc/jGuidebook.mn 2008-08-12 16:30:46.000000000 +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.10/doc/jGuidebook.txt JNetHack-3.4.3-0.10-7pcs/doc/jGuidebook.txt --- JNetHack-3.4.3-0.10/doc/jGuidebook.txt 2008-08-12 15:49:47.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/doc/jGuidebook.txt 2008-08-12 16:30:47.000000000 +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.10/htmldump.readme JNetHack-3.4.3-0.10-7pcs/htmldump.readme --- JNetHack-3.4.3-0.10/htmldump.readme 1970-01-01 09:00:00.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/htmldump.readme 2008-08-12 16:16:30.000000000 +0900 @@ -0,0 +1,185 @@ +HTML出力機能追加パッチ(JNetHaack3.4.3-0.6用) +version β1.0(2005/5/13登録) + + +JNetHackに画面HTML出力、キャラDUMP HTML出力、ゲームオーバー時のDUMP HTML +出力を追加するパッチです。 + +使い方 + ゲーム中に、"#html screen"と入力すると画面HTML出力を行います。 + ゲーム中に、"#html status"と入力するとキャラDUMP HTML出力を行います。 + ゲーム終了後、「DUMPを出力しますか?」という問いに'y'と入力するとキャラ + DUMP HTML出力を行います。 + + いずれの場合もファイル名の入力を求めるのでファイル名を入力してください。 + + dump_discloseオプションが追加されています。このオプションはdiscloseオプ + ションと同じような書式でダンプに出力する情報の種類を選択することができ + ます。 + 指定できる情報の種別は以下のとおりです。 + 'h' ... Html dump ゲーム終了後のHTML DUMPそのもの + 'm' ... Map screen マップ画面と画面下部のステータス情報 + 'e' ... Enlightenment list 簡易状況リスト(と詳細状況リスト) + 'c' ... Conduct list 自発的な挑戦達成状況 + 'k' ... sKills list スキル一覧 + 's' ... Spells list 呪文一覧 + 'p' ... Pets list ペット一覧 + 'i' ... Inventory アイテム一覧 + 'u' ... items Under you 足元にあるアイテム一覧 + 't' ... last message Text 直前のメッセージ(最終のメッセージ) + 'v' ... Vanquished monsters (予約:未実装) モンスターごとの倒した数 + 'g' ... Genocided monsters (予約:未実装) 虐殺したモンスター一覧 + 各種別コードの前に'y', 'n', '+', '-'を指定することにより出力を制御でき + ます。 + 'y' ... 出力有無を尋ねます。(デフォルトyes) + 'n' ... 出力有無を尋ねます。(デフォルトno) + '+' ... 出力有無を尋ねずに出力します。 + '-' ... 出力しません。 + デフォルトは yh +m +e +c +k +s +p +i -u +v +g +t です。 + 例1:(自発的挑戦とペット一覧は出力しない) + dump_disclose:+h -c -p + + 例2:(足元にあるアイテムも出力) + dump_disclose:+u + + + dump_cssオプションにてCascading Style-Sheetファイルを指定することができ + ます。これを指定するとそのスタイルシートを外部ファイル指定するHTMLを + 出力するようになります。デフォルトは指定なしで、その場合は内部スタイル + シートによるスタイル指定となります。 + 例: + dump_css:default.css + + dump_autonameオプションを指定するとダンプなどを保存する際、ファイル名を + 自動でつけて保存するようになります。基本的にsave時と同様なファイル名と + なります。保存名は次のようになります。 + Windows系 [USER名]-[PLAYER名]???.html + UNIX系 [USERID]-[PLAYER名]???.html + ???は000〜999の値を順にとります。同じファイル名があった場合はこの部分を + 変更して重ならないファイル名を探します。もし000〜999が全て埋まっていた + 場合はファイル名の入力を求めます。 + なお、DOSやAMIGAやVMSでは正常に動作するかわかりません。 + + +注意事項 + このパッチはもともとRubissh JNetHack用に作成したものをJNetHack3.4.0用に + 書きなおし、さらに拡張、改造して、その差分を取ったものです。 + 一部、綾波使いさんが手直しされた部分が含まれています。 + 綾波使いさんありがとうございます。 + このパッチは他のNetHack系ヴァリアントなど、別のプログラムに流用してもか + まいません。 + まだコードをイロイロいじっている最中ですので、動かない場合があるかもし + れません。 + + +known bugs: + end.cにてかなり強引にメッセージ取得を行ったため、非常に汚いコードとなっ + ています。 + + 直前のメッセージが、ttyモードの場合のみしか出力されません。 + また、表示される行数はOPTIONSのmsghistoryに依存します。 + + Windows2000のコンソール版、Windows98SEでのコンソール版、タイル版でのみ + 動作確認を行っております。 + それ以外の、UNIX系等での動作確認はとっておりません。 + + +履歴 + β1.0 2005/5/12 + JNetHack3.4.3-0.5からJNetHack3.4.3-0.6に移行しました。 + 倒したモンスター数および虐殺したモンスターの出力をいまさら実装。 + ゲーム終了時にのみ出力します。 + + β0.9b 2005/1/21 + Linux上で問題がないのに「HTML ファイルへの保存に失敗した.」と出てしま + う問題を修正。 + UNIX/Linuxで自動ファイル名を使用したときに".html"が"_html"になってしま + う問題を修正。 + + β0.9a 2005/1/21 + パッチ作成時にミスがあったため、パッチを再作成してリリース。 + + β0.9 2005/1/12 + JNetHack3.4.3-0.4からJNetHack3.4.3-0.5に移行しました。 + 啓蒙が実行されたときにDUMP出力を行うかを尋ねるようにしました。 + + β0.8 2004/8/10 + JNetHack3.4.3-0.2からJNetHack3.4.3-0.4に移行しました。 + 足元のアイテムをダンプに出力できる機能を追加しました。 + ただし、デフォルトでは出力しません。 + + β0.7d 2004/1/3 + JNetHack3.4.3-0.1からJNetHack3.4.3-0.2に移行しました。 + β0.7aからモンスターに攻撃されて死亡したときの最終メッセージにおいて + 死因が正常に表示されていなかったのを修正。ついでに「魔除けを手にして」 + 等も出力されるように死因情報取得位置を後方に移動。 + + β0.7c 2004/1/3 + JNetHack3.4.2-0.2からJNetHack3.4.3-0.1に移行しました。 + + β0.7b 2003/12/19 + JNetHack3.4.2-0.1からJNetHack3.4.2-0.2に移行しました。 + discloseオプションの拡張を取止め。普通のJNetHack3.4.2-0.2から + セーブファイルを移行できるようになりました。 + 新規オプションdump_discloseを追加。 + + β0.7a 2003/11/13 + JNetHack3.4.1-0.4からJNetHack3.4.2-0.1に移行しました。 + + β0.7 2003/10/16 + バグフィックス (HTML文法修正とコードの整理しました。) + + β0.6c 2003/09/21 + JNetHack3.4.1-0.3からJNetHack3.4.1-0.4に移行しました。 + + β0.6b 2003/08/10 + JNetHack3.4.1-0.2からJNetHack3.4.1-0.3に移行しました。 + + β0.6a 2003/06/10 + JNetHack3.4.1-0.1からJNetHack3.4.1-0.2に移行しました。 + + β0.6 2003/04/16 + JNetHack3.4.0-0.10からJNetHack3.4.1-0.1に移行しました。 + ゲームオーバー時のみで出力していた「直前のメッセージ」を#html status + による出力にも追加しました。 + パッチが短くなることを期待してminimal_enlightenmentに対する実装を内部 + 的に変更しました。 + + β0.5a 2003/02/16 + JNetHack3.4.0-0.9からJNetHack3.4.0-0.10に移行しました。 + + β0.5 2003/02/11 + 騎乗しているのに騎乗モンスターが画面に表示されていなかったバグを修正 + しました。 + ダンプ出力に現在階のペット一覧を追加。 + + β0.4 2003/01/15 + 骨ファイル生成時に所持アイテム一覧が出力されていなかったバグを修正し + ました。これに伴い、直前のメッセージ、最終メッセージの出力がDUMPの最 + 後に移動されました。 + 死因(墓に刻まれているメッセージ)が最終メッセージに出力されるように + しました。 + + 2003/01/13 + http://nethack-users.sourceforge.jp/ にて配布されるようになりました。 + + β0.3 2002/12/20 + ステータスダンプ中に使用可能な魔法とその成功率の出力を追加しました。 + 「直前のメッセージ」にHTML出力の有無等を尋ねるメッセージが出ないよ + うにしました。 + + β0.2 2002/12/17 + 「直前のメッセージ」関係のバグフィックスしました。 + + β0.1 2002/12/15 + 出力ファイル名の自動設定機能を付加しました。 + 「直前のメッセージ」関係のバグフィックスしました。 + + α0.7 2002/12/10 + ネットハックのバージョン情報を出力するようにしました。 + スタイルシートの外部ファイル指定出力に対応しました。 + 細かいバグフィックス。 + +mail-to:so-miya@mma.gr.jp +URL:http://www31.ocn.ne.jp/~so_miya/ +URL(Windows binary):http://nethack-users.sourceforge.jp/ diff -aurN JNetHack-3.4.3-0.10/include/color.h JNetHack-3.4.3-0.10-7pcs/include/color.h --- JNetHack-3.4.3-0.10/include/color.h 2003-12-08 08:39:13.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/include/color.h 2008-08-12 16:30:47.000000000 +0900 @@ -5,6 +5,12 @@ #ifndef COLOR_H #define COLOR_H +#ifdef MENU_COLOR +# ifdef MENU_COLOR_REGEX +# include +# endif +#endif + /* * The color scheme used is tailored for an IBM PC. It consists of the * standard 8 colors, folowed by their bright counterparts. There are @@ -49,4 +55,20 @@ #define DRAGON_SILVER CLR_BRIGHT_CYAN #define HI_ZAP CLR_BRIGHT_BLUE +#ifdef MENU_COLOR +struct menucoloring { +# ifdef MENU_COLOR_REGEX +# ifdef MENU_COLOR_REGEX_POSIX + regex_t match; +# else + struct re_pattern_buffer match; +# endif +# else + char *match; +# endif + int color, attr; + struct menucoloring *next; +}; +#endif /* MENU_COLOR */ + #endif /* COLOR_H */ diff -aurN JNetHack-3.4.3-0.10/include/config.h JNetHack-3.4.3-0.10-7pcs/include/config.h --- JNetHack-3.4.3-0.10/include/config.h 2008-08-12 15:50:20.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/include/config.h 2008-08-12 16:30:47.000000000 +0900 @@ -36,6 +36,8 @@ /* Hint: if you're not developing code, don't define ULTRIX_PROTO. */ +#define HPMON /* HP color monitor */ + #include "config1.h" /* should auto-detect MSDOS, MAC, AMIGA, and WIN32 */ @@ -353,10 +355,14 @@ #endif #define EXP_ON_BOTL /* Show experience on bottom line */ -/* #define SCORE_ON_BOTL */ /* added by Gary Erickson (erickson@ucivax) */ +#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 */ +# define USE_MAKESINGULAR /* Enable singularize */ #endif /* @@ -367,9 +373,27 @@ * bugs left here. */ +#ifdef TTY_GRAPHICS +# define MENU_COLOR +/*# define MENU_COLOR_REGEX */ +/*# define MENU_COLOR_REGEX_POSIX */ +/* if MENU_COLOR_REGEX is defined, use regular expressions (regex.h, + * GNU specific functions by default, POSIX functions with + * MENU_COLOR_REGEX_POSIX). + * otherwise use pmatch() to match menu color lines. + * pmatch() provides basic globbing: '*' and '?' wildcards. + */ +#endif + /*#define GOLDOBJ */ /* Gold is kept on obj chains - Helge Hafting */ /*#define AUTOPICKUP_EXCEPTIONS */ /* exceptions to autopickup */ + +/* + * OUTPUT SCREEN & STATUS DUMP of HTML + */ +#define HTMLDUMP + /* End of Section 5 */ #include "global.h" /* Define everything else according to choices above */ diff -aurN JNetHack-3.4.3-0.10/include/decl.h JNetHack-3.4.3-0.10-7pcs/include/decl.h --- JNetHack-3.4.3-0.10/include/decl.h 2008-08-12 15:50:20.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/include/decl.h 2008-08-12 16:30:47.000000000 +0900 @@ -170,6 +170,9 @@ E NEARDATA long yn_number; E const char disclosure_options[]; +#ifdef HTMLDUMP +E const char htmldump_disclosure_options[]; +#endif /*HTMLDUMP*/ E NEARDATA int smeq[]; E NEARDATA int doorindex; diff -aurN JNetHack-3.4.3-0.10/include/display.h JNetHack-3.4.3-0.10-7pcs/include/display.h --- JNetHack-3.4.3-0.10/include/display.h 2003-12-08 08:39:13.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/include/display.h 2008-08-12 16:30:47.000000000 +0900 @@ -92,6 +92,14 @@ #define canspotmon(mon) \ (canseemon(mon) || sensemon(mon)) +/* + * canspotmons(mon) + * + * This function is variation of canspotmon() which returns TRUE if + * you can spot any monsters in the same place as mon's. + */ +#define canspotmons canspotmon + /* knowninvisible(mon) * This one checks to see if you know a monster is both there and invisible. * 1) If you can see the monster and have see invisible, it is assumed the diff -aurN JNetHack-3.4.3-0.10/include/extern.h JNetHack-3.4.3-0.10-7pcs/include/extern.h --- JNetHack-3.4.3-0.10/include/extern.h 2008-08-12 15:50:20.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/include/extern.h 2008-08-12 16:30:47.000000000 +0900 @@ -131,6 +131,12 @@ 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 +#ifdef HTMLDUMP +E int FDECL(output_html_bot, (FILE *)); +#endif /*HTMLDUMP*/ /* ### cmd.c ### */ @@ -179,6 +185,17 @@ E void NDECL(sanity_check); #endif E char FDECL(yn_function, (const char *, const char *, CHAR_P)); +#ifdef HTMLDUMP +E int NDECL(output_screen_html); +E int NDECL(output_normal_dump_html); +E int FDECL(output_final_dump_html_start, (int)); +E int FDECL(output_final_dump_html_mesg, (const char *)); +E int FDECL(output_final_dump_html_title, (const char *)); +E int FDECL(output_final_dump_html_end, (int)); +E void FDECL(set_dump_css, (char *)); +E boolean FDECL(should_query_htmldump_disclose_option, (int,char *)); +#endif /*HTMLDUMP*/ + /* ### dbridge.c ### */ @@ -285,6 +302,9 @@ E int FDECL(zapdir_to_glyph, (int,int,int)); E int FDECL(glyph_at, (XCHAR_P,XCHAR_P)); E void NDECL(set_wall_state); +#ifdef HTMLDUMP +E int FDECL(output_html_screen, (FILE *)); +#endif /*HTMLDUMP*/ /* ### do.c ### */ @@ -696,6 +716,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); @@ -1413,6 +1436,9 @@ E int FDECL(add_autopickup_exception, (const char *)); E void NDECL(free_autopickup_exceptions); #endif /* AUTOPICKUP_EXCEPTIONS */ +#ifdef MENU_COLOR +E boolean FDECL(add_menu_coloring, (char *)); +#endif /* MENU_COLOR */ /* ### pager.c ### */ @@ -1905,6 +1931,9 @@ E void NDECL(losespells); E int NDECL(dovspell); E void FDECL(initialspell, (struct obj *)); +#ifdef HTMLDUMP +E int FDECL(output_html_spells, (FILE *)) ; +#endif /*HTMLDUMP*/ /* ### steal.c ### */ @@ -2124,6 +2153,9 @@ E char *FDECL(version_string, (char *)); E char *FDECL(getversionstring, (char *)); +#ifdef HTMLDUMP +E char *FDECL(getjversionstring, (char *)); +#endif /*HTMLDUMP*/ E int NDECL(doversion); E int NDECL(doextversion); #ifdef MICRO @@ -2262,6 +2294,10 @@ E int FDECL(weapon_hit_bonus, (struct obj *)); E int FDECL(weapon_dam_bonus, (struct obj *)); E void FDECL(skill_init, (const struct def_skill *)); +#ifdef HTMLDUMP +E int FDECL(output_html_skills, (FILE *)); +#endif /* HTMLDUMP */ +E int NDECL(weapon_range); /* ### were.c ### */ diff -aurN JNetHack-3.4.3-0.10/include/flag.h JNetHack-3.4.3-0.10-7pcs/include/flag.h --- JNetHack-3.4.3-0.10/include/flag.h 2003-12-08 08:39:13.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/include/flag.h 2008-08-12 16:30:47.000000000 +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 */ @@ -183,6 +192,9 @@ char prevmsg_window; /* type of old message window to use */ boolean extmenu; /* extended commands use menu interface */ #endif +#ifdef MENU_COLOR + boolean use_menu_color; /* use color in menus; only if wc_color */ +#endif #ifdef MFLOPPY boolean checkspace; /* check disk space before writing files */ /* (in iflags to allow restore after moving @@ -280,6 +292,15 @@ #define MAX_ALTKEYHANDLER 25 char altkeyhandler[MAX_ALTKEYHANDLER]; #endif +#ifdef HTMLDUMP + boolean htmldump_dump_htmlname_is_auto; /* automatical setting filename for dump html */ +#define NUM_HTMLDUMP_DISCLOSURE_OPTIONS 12 +#define HTMLDUMP_PROMPT_DEFAULT_YES DISCLOSE_PROMPT_DEFAULT_YES +#define HTMLDUMP_PROMPT_DEFAULT_NO DISCLOSE_PROMPT_DEFAULT_NO +#define HTMLDUMP_YES_WITHOUT_PROMPT DISCLOSE_YES_WITHOUT_PROMPT +#define HTMLDUMP_NO_WITHOUT_PROMPT DISCLOSE_NO_WITHOUT_PROMPT + char htmldump_disclose[NUM_HTMLDUMP_DISCLOSURE_OPTIONS + 1]; +#endif }; /* diff -aurN JNetHack-3.4.3-0.10/include/obj.h JNetHack-3.4.3-0.10-7pcs/include/obj.h --- JNetHack-3.4.3-0.10/include/obj.h 2003-12-08 08:39:13.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/include/obj.h 2008-08-12 16:30:47.000000000 +0900 @@ -140,6 +140,7 @@ otmp->oclass == TOOL_CLASS) && \ (objects[otmp->otyp].oc_skill == P_POLEARMS || \ objects[otmp->otyp].oc_skill == P_LANCE)) +#define is_ranged(otmp) is_pole(otmp) #define is_spear(otmp) (otmp->oclass == WEAPON_CLASS && \ objects[otmp->otyp].oc_skill >= P_SPEAR && \ objects[otmp->otyp].oc_skill <= P_JAVELIN) diff -aurN JNetHack-3.4.3-0.10/include/you.h JNetHack-3.4.3-0.10-7pcs/include/you.h --- JNetHack-3.4.3-0.10/include/you.h 2008-08-12 15:50:20.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/include/you.h 2008-08-12 16:30:47.000000000 +0900 @@ -369,4 +369,6 @@ #define Upolyd (u.umonnum != u.umonster) +extern NEARDATA struct monst *ulasttgt; /* last monster you targeted */ + #endif /* YOU_H */ diff -aurN JNetHack-3.4.3-0.10/readme-swsd JNetHack-3.4.3-0.10-7pcs/readme-swsd --- JNetHack-3.4.3-0.10/readme-swsd 1970-01-01 09:00:00.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/readme-swsd 2008-08-12 16:16:30.000000000 +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.10/src/apply.c JNetHack-3.4.3-0.10-7pcs/src/apply.c --- JNetHack-3.4.3-0.10/src/apply.c 2008-08-12 15:50:21.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/src/apply.c 2008-08-12 16:30:47.000000000 +0900 @@ -3322,11 +3322,16 @@ if (getpos(&cc, TRUE, "狙う場所") < 0) return 0; /* user pressed ESC */ +/* move to weapon.c */ +#if 0 /* Calculate range */ typ = uwep_skill_type(); if (typ == P_NONE || P_SKILL(typ) <= P_BASIC) max_range = 4; else if (P_SKILL(typ) == P_SKILLED) max_range = 5; else max_range = 8; +#else + max_range = weapon_range(); +#endif if (distu(cc.x, cc.y) > max_range) { /*JP pline("Too far!"); diff -aurN JNetHack-3.4.3-0.10/src/attrib.c JNetHack-3.4.3-0.10-7pcs/src/attrib.c --- JNetHack-3.4.3-0.10/src/attrib.c 2008-08-12 15:50:21.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/src/attrib.c 2008-08-12 16:36:38.000000000 +0900 @@ -581,7 +581,7 @@ void -init_attr(np) +init_attr_(np) register int np; { register int i, x, tryct; @@ -630,6 +630,112 @@ } } +static char +get_acception() +{ + char c; + +/*JP pline("St:");*/ + pline("強:"); + if (ACURR(A_STR) > 118) { + pline("%2d",ACURR(A_STR) - 100); + } else if (ACURR(A_STR) == 118) { + pline("18/**"); /*OZAWA: for Emacs matching mechanism*/ + } else if (ACURR(A_STR) > 18) { + pline("18/%02d",ACURR(A_STR) - 18); + } else { + pline("%-1d",ACURR(A_STR)); + } +/*JP pline(" Dx:%-1d Co:%-1d In:%-1d Wi:%-1d Ch:%-1d ",ACURR(A_DEX),ACURR(A_CON),ACURR(A_INT),ACURR(A_WIS),ACURR(A_CHA));*/ + pline(" 早:%-1d 耐:%-1d 知:%-1d 賢:%-1d 魅:%-1d ",ACURR(A_DEX),ACURR(A_CON),ACURR(A_INT),ACURR(A_WIS),ACURR(A_CHA)); +/*JP c = yn_function("Accept?","ynrq",'n');*/ + c = yn_function("よろしいですか?","ynrq",'n'); + return(c); +} + +void +init_attr(np) +int np; +{ + char c; + boolean forced,askforce,ok,done; + schar att; + int aval; + char buf[BUFSZ]; + int i; + + askforce = TRUE; + done = FALSE; + do { + if (askforce) { + askforce = FALSE; +/*JP c = yn_function("Do you want to force anything?","yn",'n');*/ + c = yn_function("能力値にリクエストはありますか?","yn",'n'); + if (c == 'n') { + forced = FALSE; + } else { + forced = TRUE; +/*JP c = yn_function("What do you want to force?","sdciwh",'\0');*/ + c = yn_function("どの能力値?","sdciwh",'\0'); + switch (c) { + case 's': att = A_STR; break; + case 'd': att = A_DEX; break; + case 'c': att = A_CON; break; + case 'i': att = A_INT; break; + case 'w': att = A_WIS; break; + case 'h': + default: att = A_CHA; break; + } + while (1) { + ok = TRUE; +/*JP getlin("What is the minimum value?",buf);*/ + getlin("最低いくつが希望ですか?",buf); + i = 0; + while (buf[i]) { + if (!isdigit(buf[i])) ok = FALSE; + i++; + } + if (!ok) continue; + aval = atoi(buf); + if (aval < ATTRMIN(att) || aval > ATTRMAX(att)) continue; + break; + } + } + } + i = 0; + ok = FALSE; +/*JP pline("Trying ... ");*/ + pline("作成中..."); + while (i < 2000 && !ok) { + init_attr_(np); + if (forced) { + if (ACURR(att) >= aval) ok = TRUE; + } else { + ok = TRUE; + } + i++; + } + if (!ok) { +/*JP c = yn_function("This doesn't seem to work. Try again?","yn",'n');*/ + c = yn_function("なかなかうまく行かないようですが,まだやってみますか?","yn",'n'); + if (c == 'n') askforce = TRUE; + done = FALSE; + continue; + } + c = get_acception(); + switch (c) { + case 'y': done = TRUE; + break; + case 'r': askforce = TRUE; /* fall through */ + case 'n': done = FALSE; + break; + case 'q': exit_nhwindows(NULL); + terminate(0); + } + } while (!done); +} + + void redist_attr() { diff -aurN JNetHack-3.4.3-0.10/src/botl.c JNetHack-3.4.3-0.10-7pcs/src/botl.c --- JNetHack-3.4.3-0.10/src/botl.c 2008-08-12 15:50:22.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/src/botl.c 2008-08-12 16:30:47.000000000 +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,8 +53,31 @@ #endif }; +const char *enc_abbrev_stat[] = { +#if 0 /*JP*/ + "", + "Brd", + "Ssd", + "Snd", + "Otd", + "Old" +#else + "", + "蹌", + "圧", + "限", + "重", + "過" +#endif +}; + +#ifdef HTMLDUMP +STATIC_DCL void FDECL(bot1, (FILE *)); +STATIC_DCL void FDECL(bot2, (FILE *)); +#else /*HTMLDUMP*/ STATIC_DCL void NDECL(bot1); STATIC_DCL void NDECL(bot2); +#endif /*HTMLDUMP*/ #endif /* OVL0 */ /* MAXCO must hold longest uncompressed status line, and must be larger @@ -181,8 +225,14 @@ } #endif +#ifdef HTMLDUMP +STATIC_OVL void +bot1(fp) +FILE *fp ; +#else /*HTMLDUMP*/ STATIC_OVL void bot1() +#endif /*HTMLDUMP*/ { char newbot1[MAXCO]; register char *nb; @@ -265,6 +315,12 @@ */ Sprintf(nb = eos(nb), "%ld点", botl_score()); #endif +#ifdef HTMLDUMP + if ( fp ) { + fputs(newbot1, fp) ; + return ; + } +#endif /*HTMLDUMP*/ curs(WIN_STATUS, 1, 0); putstr(WIN_STATUS, 0, newbot1); } @@ -304,10 +360,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 +373,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,61 +410,141 @@ */ 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]); +} + +#ifdef HTMLDUMP +STATIC_OVL void +bot2(fp) +FILE *fp ; +#else /*HTMLDUMP*/ +STATIC_OVL void +bot2() +#endif /*HTMLDUMP*/ +{ + char newbot2[MAXCO]; + + bot2str(newbot2); +#ifdef HTMLDUMP + if ( fp ) { + fputs(newbot2, fp) ; + return ; + } +#endif /*HTMLDUMP*/ 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() { +#ifdef HTMLDUMP + bot1((FILE *)0); + bot2((FILE *)0); +#else /*HTMLDUMP*/ bot1(); bot2(); +#endif /*HTMLDUMP*/ flags.botl = flags.botlx = 0; } +#ifdef HTMLDUMP +int +output_html_bot(FILE *fp) +{ + bot1(fp); + fputs("\n", fp) ; + bot2(fp); + + return 0; +} +#endif /*HTMLDUMP*/ + #endif /* OVL0 */ /*botl.c*/ diff -aurN JNetHack-3.4.3-0.10/src/cmd.c JNetHack-3.4.3-0.10-7pcs/src/cmd.c --- JNetHack-3.4.3-0.10/src/cmd.c 2008-08-12 15:50:22.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/src/cmd.c 2008-08-12 16:30:47.000000000 +0900 @@ -13,6 +13,13 @@ #include "func_tab.h" /* #define DEBUG */ /* uncomment for debugging */ +#if defined(HTMLDUMP) && defined(UNIX) +#include +#endif /*HTMLDUMP&&UNIX*/ +#if defined(HTMLDUMP) && defined(TTY_GRAPHICS) +#include "wintty.h" +#endif /*HTMLDUMP&&TTY_GRAPHICS*/ + /* * Some systems may have getchar() return EOF for various reasons, and * we should not quit before seeing at least NR_OF_EOFS consecutive EOFs. @@ -151,6 +158,12 @@ STATIC_PTR int NDECL(doconduct); /**/ STATIC_PTR boolean NDECL(minimal_enlightenment); +/* AUTOTHRUST */ +STATIC_DCL int NDECL(dovattack); /* autothrust */ +STATIC_DCL int NDECL(autothrust); /* autothrust */ +STATIC_DCL struct monst* FDECL(findtarget, (int, int)); /* autothrust */ +STATIC_DCL struct monst* FDECL(autotarget, (int)); /* autothrust */ + #ifdef OVLB STATIC_DCL void FDECL(enlght_line, (const char *,const char *,const char *)); STATIC_DCL char *FDECL(enlght_combatinc, (const char *,int,int,char *)); @@ -158,6 +171,24 @@ static void NDECL(end_of_input); #endif #endif /* OVLB */ +#ifdef HTMLDUMP +extern const char *killed_by_prefix[]; +STATIC_DCL int FDECL(output_normal_dump_html_main, (boolean)); +STATIC_DCL int FDECL(output_final_dump_html_puts, (const char *)) ; +STATIC_DCL int FDECL(output_dump_html_status, (int, boolean)) ; +STATIC_DCL void FDECL(set_htmlfile_name, (const char *)) ; +STATIC_DCL void NDECL(set_auto_htmlfile_name) ; +STATIC_DCL void NDECL(set_last_message_to_html) ; +STATIC_DCL int FDECL(output_html_last_message, (FILE *)) ; +STATIC_DCL int FDECL(output_html_header, (FILE *)) ; +STATIC_DCL int FDECL(output_html_footer, (FILE *)) ; +STATIC_DCL int FDECL(output_html_objectlist, (FILE *, struct obj *, boolean, boolean)) ; +STATIC_DCL int FDECL(output_html_container, (FILE *, struct obj *, boolean, boolean, boolean)) ; +STATIC_DCL int FDECL(output_html_pets, (FILE *)) ; +STATIC_DCL int FDECL(htmldump_vanquished, (FILE *)) ; +STATIC_DCL int FDECL(htmldump_genocided, (FILE *)) ; +STATIC_OVL boolean FDECL(yn_function_htmldump_disclose_option, (char *, int)) ; +#endif /* HTMLDUMP */ static const char* readchar_queue=""; @@ -854,6 +885,9 @@ have_been[] = "have been ", have_never[] = "have never ", never[] = "never "; #endif +#ifdef HTMLDUMP + static FILE *html_fp = (FILE *)0 ; +#endif #if 0 /*JP*/ #define enl_msg(prefix,present,past,suffix) \ @@ -879,6 +913,16 @@ { char buf[BUFSZ]; +#ifdef HTMLDUMP + if ( html_fp ) { +#if 0 /*JP*/ + fprintf(html_fp, "
%s%s%s.
", start, middle, end) ; +#else + fprintf(html_fp, "
%s%s%s.
", start, middle, end) ; +#endif + return ; + } +#endif /*HTMLDUMP*/ #if 0 /*JP*/ Sprintf(buf, "%s%s%s.", start, middle, end); #else @@ -946,12 +990,25 @@ int ltmp; char buf[BUFSZ]; +#ifdef HTMLDUMP + if ( !html_fp ) { +#endif /*HTMLDUMP*/ en_win = create_nhwindow(NHW_MENU); /*JP putstr(en_win, 0, final ? "Final Attributes:" : "Current Attributes:"); */ putstr(en_win, 0, final ? "最終属性:" : "現在の属性:"); putstr(en_win, 0, ""); +#ifdef HTMLDUMP + } else { + en_win = 0 ; +#if 0 /*JP*/ + fprintf(html_fp, "
%s Attributes:
\n
\n
\n", (final)?"Final":"Current") ; +#else + fprintf(html_fp, "
%s属性:
\n
\n
\n", (final)?"最終":"現在") ; +#endif + } +#endif /*HTMLDUMP*/ #ifdef ELBERETH if (u.uevent.uhand_of_elbereth) { @@ -1544,11 +1601,31 @@ if (p) enl_msg(You_, "死んでいる", p, buf); } +#ifdef HTMLDUMP + if ( html_fp ) { + fputs("
\n

\n
\n", html_fp) ; + return ; + } +#endif /*HTMLDUMP*/ display_nhwindow(en_win, TRUE); destroy_nhwindow(en_win); + +#ifdef HTMLDUMP + if (!final) { + char c = yn_function("DUMPにも出力しますか?", ynchars, 'y') ; + if ( c == 'y' ) + (void)output_normal_dump_html_main(TRUE) ; + } +#endif /*HTMLDUMP*/ return; } +#ifndef HTMLDUMP +#define add_menu_view(a1,a2,a3,a4,a5,attr,str,a6) add_menu((a1), (a2), (a3), (a4), (a5), (attr), (str), (a6)) +#else +#define add_menu_view(a1,a2,a3,a4,a5,attr,str,a6) if ( html_fp ) { fprintf(html_fp, ((attr)!=ATR_NONE)?"
%s
\n":"
%s
\n", (str)) ; \ + } else { add_menu((a1), (a2), (a3), (a4), (a5), (attr), (str), (a6)) ; } +#endif /*HTMLDUMP*/ /* * Courtesy function for non-debug, non-explorer mode players * to help refresh them about who/what they are. @@ -1574,24 +1651,36 @@ tabbed_deity_fmtstr : untabbed_deity_fmtstr; any.a_void = 0; buf[0] = buf2[0] = '\0'; +#ifdef HTMLDUMP + if ( html_fp ) { +#if 0 /*JP*/ + fputs("
Base Attributes:
\n
\n
\n", html_fp) ; +#else + fputs("
基本属性:
\n
\n
\n", html_fp) ; +#endif + } else { +#endif /*HTMLDUMP*/ tmpwin = create_nhwindow(NHW_MENU); start_menu(tmpwin); +#ifdef HTMLDUMP + } +#endif /*HTMLDUMP*/ /*JP - add_menu(tmpwin, NO_GLYPH, &any, 0, 0, iflags.menu_headings, "Starting", FALSE); + add_menu_view(tmpwin, NO_GLYPH, &any, 0, 0, iflags.menu_headings, "Starting", FALSE); */ - add_menu(tmpwin, NO_GLYPH, &any, 0, 0, iflags.menu_headings, "開始", FALSE); + add_menu_view(tmpwin, NO_GLYPH, &any, 0, 0, iflags.menu_headings, "開始", FALSE); /* Starting name, race, role, gender */ /*JP Sprintf(buf, fmtstr, "name", plname); */ Sprintf(buf, fmtstr, "名前", plname); - add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE); + add_menu_view(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE); /*JP Sprintf(buf, fmtstr, "race", urace.noun); */ Sprintf(buf, fmtstr, "種族", urace.j); - add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE); + add_menu_view(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE); #if 0 /*JP*/ Sprintf(buf, fmtstr, "role", (flags.initgend && urole.name.f) ? urole.name.f : urole.name.m); @@ -1599,30 +1688,30 @@ Sprintf(buf, fmtstr, "職業", (flags.initgend && urole.jname.f) ? urole.jname.f : urole.jname.m); #endif - add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE); + add_menu_view(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE); /*JP Sprintf(buf, fmtstr, "gender", genders[flags.initgend].adj); */ Sprintf(buf, fmtstr, "性別", genders[flags.initgend].j); - add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE); + add_menu_view(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE); /* Starting alignment */ /*JP Sprintf(buf, fmtstr, "alignment", align_str(u.ualignbase[A_ORIGINAL])); */ Sprintf(buf, fmtstr, "属性", align_str(u.ualignbase[A_ORIGINAL])); - add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE); + add_menu_view(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE); /* Current name, race, role, gender */ - add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "", FALSE); + add_menu_view(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "", FALSE); #if 0 /*JP*/ - add_menu(tmpwin, NO_GLYPH, &any, 0, 0, iflags.menu_headings, "Current", FALSE); + add_menu_view(tmpwin, NO_GLYPH, &any, 0, 0, iflags.menu_headings, "Current", FALSE); Sprintf(buf, fmtstr, "race", Upolyd ? youmonst.data->mname : urace.noun); #else - add_menu(tmpwin, NO_GLYPH, &any, 0, 0, iflags.menu_headings, "現在", FALSE); + add_menu_view(tmpwin, NO_GLYPH, &any, 0, 0, iflags.menu_headings, "現在", FALSE); Sprintf(buf, fmtstr, "種族", Upolyd ? jtrns_mon_gen(youmonst.data->mname, flags.female) : urace.j); #endif - add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE); + add_menu_view(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE); if (Upolyd) { #if 0 /*JP*/ Sprintf(buf, fmtstr, "role (base)", @@ -1631,7 +1720,7 @@ Sprintf(buf, fmtstr, "職業(基本)", (u.mfemale && urole.jname.f) ? urole.jname.f : urole.jname.m); #endif - add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE); + add_menu_view(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE); } else { #if 0 /*JP*/ Sprintf(buf, fmtstr, "role", @@ -1640,7 +1729,7 @@ Sprintf(buf, fmtstr, "職業", (flags.female && urole.jname.f) ? urole.jname.f : urole.jname.m); #endif - add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE); + add_menu_view(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE); } /* don't want poly_gender() here; it forces `2' for non-humanoids */ genidx = is_neuter(youmonst.data) ? 2 : flags.female; @@ -1648,13 +1737,13 @@ Sprintf(buf, fmtstr, "gender", genders[genidx].adj); */ Sprintf(buf, fmtstr, "性別", genders[genidx].j); - add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE); + add_menu_view(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE); if (Upolyd && (int)u.mfemale != genidx) { /*JP Sprintf(buf, fmtstr, "gender (base)", genders[u.mfemale].adj); */ Sprintf(buf, fmtstr, "性別(基本)", genders[u.mfemale].j); - add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE); + add_menu_view(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE); } /* Current alignment */ @@ -1662,14 +1751,17 @@ Sprintf(buf, fmtstr, "alignment", align_str(u.ualign.type)); */ Sprintf(buf, fmtstr, "属性", align_str(u.ualign.type)); - add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE); + add_menu_view(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE); /* Deity list */ - add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "", FALSE); +#ifdef HTMLDUMP + if ( !html_fp ) +#endif /*HTMLDUMP*/ + add_menu_view(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, "", FALSE); /*JP - add_menu(tmpwin, NO_GLYPH, &any, 0, 0, iflags.menu_headings, "Deities", FALSE); + add_menu_view(tmpwin, NO_GLYPH, &any, 0, 0, iflags.menu_headings, "Deities", FALSE); */ - add_menu(tmpwin, NO_GLYPH, &any, 0, 0, iflags.menu_headings, "神", FALSE); + add_menu_view(tmpwin, NO_GLYPH, &any, 0, 0, iflags.menu_headings, "神", FALSE); Sprintf(buf2, deity_fmtstr, align_gname(A_CHAOTIC), #if 0 /*JP*/ (u.ualignbase[A_ORIGINAL] == u.ualign.type @@ -1686,7 +1778,7 @@ Sprintf(buf, fmtstr, "Chaotic", buf2); */ Sprintf(buf, fmtstr, "混沌", buf2); - add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE); + add_menu_view(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE); Sprintf(buf2, deity_fmtstr, align_gname(A_NEUTRAL), #if 0 /*JP*/ @@ -1704,7 +1796,7 @@ Sprintf(buf, fmtstr, "Neutral", buf2); */ Sprintf(buf, fmtstr, "中立", buf2); - add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE); + add_menu_view(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE); Sprintf(buf2, deity_fmtstr, align_gname(A_LAWFUL), #if 0 /*JP*/ @@ -1722,8 +1814,14 @@ Sprintf(buf, fmtstr, "Lawful", buf2); */ Sprintf(buf, fmtstr, "秩序", buf2); - add_menu(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE); + add_menu_view(tmpwin, NO_GLYPH, &any, 0, 0, ATR_NONE, buf, FALSE); +#ifdef HTMLDUMP + if ( html_fp ) { + fputs("
\n

\n
\n", html_fp) ; + return FALSE ; + } +#endif /*HTMLDUMP*/ /*JP end_menu(tmpwin, "Base Attributes"); */ @@ -1760,6 +1858,9 @@ char buf[BUFSZ]; int ngenocided; +#ifdef HTMLDUMP + if ( !html_fp ) { +#endif /*HTMLDUMP*/ /* Create the conduct window */ en_win = create_nhwindow(NHW_MENU); /*JP @@ -1767,6 +1868,14 @@ */ putstr(en_win, 0, "自発的挑戦:"); putstr(en_win, 0, ""); +#ifdef HTMLDUMP + } else { +/*JP + fputs("
Voluntary challenges:
\n
\n
\n", html_fp) ; +*/ + fputs("
自発的挑戦:
\n
\n
\n", html_fp) ; + } +#endif /*HTMLDUMP*/ if (!u.uconduct.food) /*JP @@ -1915,6 +2024,12 @@ #endif } +#ifdef HTMLDUMP + if ( html_fp ) { + fputs("
\n

\n
\n", html_fp) ; + return ; + } +#endif /*HTMLDUMP*/ /* Pop up the window and wait for a key */ display_nhwindow(en_win, TRUE); destroy_nhwindow(en_win); @@ -2022,6 +2137,7 @@ {M('w'), FALSE, dowipe}, {'x', FALSE, doswapweapon}, {'X', TRUE, enter_explore_mode}, + {M('x'), TRUE, dovattack}, /* 'y', 'Y' : go nw */ {'z', FALSE, dozap}, {'Z', TRUE, docast}, @@ -2073,6 +2189,10 @@ {"enhance", "advance or check weapons skills", enhance_weapon_skill, TRUE}, {"force", "force a lock", doforce, FALSE}, +#ifdef HTMLDUMP + {"html map", "dump screen to HTML", output_screen_html, TRUE}, + {"html status", "dump status to HTML", output_normal_dump_html, TRUE}, +#endif /*HTMLDUMP*/ {"invoke", "invoke an object's powers", doinvoke, TRUE}, {"jump", "jump to a location", dojump, FALSE}, {"loot", "loot a box on the floor", doloot, FALSE}, @@ -2100,6 +2220,10 @@ {"dip", "何かに物を浸す", dodip, FALSE}, {"enhance", "武器熟練度を高める", enhance_weapon_skill, TRUE}, {"force", "鍵をこじあける", doforce, FALSE}, +#ifdef HTMLDUMP + {"html map", "画面を HTML ファイルにダンプする", output_screen_html, TRUE}, + {"html status", "状況を HTML ファイルにダンプする", output_normal_dump_html, TRUE}, +#endif /*HTMLDUMP*/ {"invoke", "物の特別な力を使う", doinvoke, TRUE}, {"jump", "他の位置に飛びうつる", dojump, FALSE}, {"loot", "床の上の箱を開ける", doloot, TRUE}, @@ -3168,6 +3292,1071 @@ return 0; } +#ifdef HTMLDUMP + +static char htmlname_buf[BUFSZ] ; +static char htmlbuf[6000] ; +static char *html_css_name = (char*)0 ; +static int html_counter = 0 ; + +int +output_screen_html() +{ + FILE *fp = (FILE *)0; + int ret = 0; +#ifdef UNIX + int status; +#endif /* UNIX */ + +#if 0 /*JP*/ + set_htmlfile_name("Please input HTML file name for screen dump:") ; +#else + set_htmlfile_name("HTMLで画面を保存します.ファイル名を入力してください:") ; +#endif + if ( !*htmlname_buf ) return 0; + +#ifdef UNIX + if (fork()) { + wait(&status); + ret = WEXITSTATUS(status); + } else { + struct passwd *pwd; + + seteuid(getuid()); + setegid(getgid()); + pwd = getpwuid(getuid()); + if (pwd && pwd->pw_dir) chdir(pwd->pw_dir); +#endif /* UNIX */ + + fp = fopen(htmlname_buf, "w") ; + + if (fp) { + disablegraphics(); + + if (ret>=0) ret = output_html_header(fp); + if (ret>=0) ret = output_html_screen(fp); + if (ret>=0) ret = output_html_footer(fp); + + restoregraphics(); + } else { + ret = 1; + } + +#ifdef UNIX + + exit(ret); + + } /* if (fork()) */ + + if (ret>=0) docrt(); + +#endif /* UNIX */ + + if (fp) fclose(fp); + *htmlname_buf = '\0' ; + +#if 0 /*JP*/ + if (ret<0) + pline("Failure to the HTML file of screen dump."); + else + pline("HTML file saved."); +#else + if (ret<0) + pline("画面の HTML ファイルへの保存に失敗した."); + else + pline("HTML ファイルを保存しました."); +#endif + + return ret; +} + + + +int +output_normal_dump_html() +{ + return output_normal_dump_html_main(FALSE) ; +} + +int +output_normal_dump_html_main(eflag) +boolean eflag; +{ + FILE *fp = (FILE *)0; + int ret = 0; + boolean ask; +#ifdef UNIX + int status; +#endif /* UNIX */ + + /* 直前のメッセージをhtmlbufに格納・・・ + * set_htmlfile_nameの出力結果をメッセージに含めないため! + */ + *htmlbuf = '\0' ; + set_last_message_to_html() ; + +#if 0 /*JP*/ + set_htmlfile_name("Please input HTML file name for status dump:") ; +#else + set_htmlfile_name("HTMLで状況を保存します.ファイル名を入力してください:") ; +#endif + if ( !*htmlname_buf ) return 0; + +#ifdef UNIX + if (fork()) { + wait(&status); + ret = WEXITSTATUS(status); + } else { + struct passwd *pwd; + + seteuid(getuid()); + setegid(getgid()); + pwd = getpwuid(getuid()); + if (pwd && pwd->pw_dir) chdir(pwd->pw_dir); +#endif /* UNIX */ + + fp = fopen(htmlname_buf, "w") ; + if ( !fp ) return -1; + + if (ret>=0) ret = output_html_header(fp) ; + if (ret>=0) ret = fputs("
\n", fp) ; + +#if 0 /*JP*/ + ask = yn_function_htmldump_disclose_option("Do you want to dump screen?", 'm'); +#else + ask = yn_function_htmldump_disclose_option("画面を出力しますか?", 'm'); +#endif + if (ask) { + if (ret>=0) { +#if 0 /*JP*/ + ret = fputs("
Screen:
\n
\n", fp) ; +#else + ret = fputs("
画面:
\n
\n", fp) ; +#endif + } + disablegraphics(); + if (ret>=0) ret = output_html_screen(fp) ; + restoregraphics(); + if (ret>=0) { + ret = fputs("

\n
\n", fp) ; + } + } + + html_fp = fp ; + if (ret>=0) ret = output_dump_html_status(0, eflag); + html_fp = (FILE *)0 ; + + /** output last message */ +#if 0 /*JP*/ + ask = yn_function_htmldump_disclose_option("Do you want to dump last message and etc?", 't'); +#else + ask = yn_function_htmldump_disclose_option("直前のメッセージを出力しますか?", 't'); +#endif + if (ask) { + if (ret>=0) ret = output_html_last_message(fp) ; + } + + if (ret>=0) ret = fputs("
\n", fp) ; + if (ret>=0) ret = output_html_footer(fp) ; + +#ifdef UNIX + exit(ret); + } /* if (fork()) */ + if (ret>=0) docrt(); +#endif /* UNIX */ + + if ( fp ) fclose(fp) ; + *htmlname_buf = '\0' ; + +#if 0 /*JP*/ + if (ret<0) + pline("Failure to the HTML file of status dump."); + else + pline("HTML file saved."); +#else + if (ret<0) + pline("HTML ファイルへの保存に失敗した.") ; + else + pline("HTML ファイルを保存しました."); +#endif + + return ret; +} + + + +int +output_final_dump_html_start(how) +int how; +{ + FILE *fp = 0; + int ret = 0; + int final = (how >= PANICKED ? 1 : 2) ; + boolean ask ; +#ifdef UNIX + int status; +#endif /* UNIX */ + + /* 直前のメッセージをhtmlbufに格納・・・ + * set_htmlfile_nameの出力結果をメッセージに含めないため! + */ + *htmlbuf = '\0' ; + set_last_message_to_html() ; + + *htmlname_buf = '\0' ; +#if 0 /*JP*/ + set_htmlfile_name("Please input HTML file name for result dump:") ; +#else + set_htmlfile_name("HTMLで結果を保存します.ファイル名を入力してください:") ; +#endif + if ( !*htmlname_buf ) return 0; + +#ifdef UNIX + if (fork()) { + wait(&status); + ret = WEXITSTATUS(status); + } else { + struct passwd *pwd; + + seteuid(getuid()); + setegid(getgid()); + pwd = getpwuid(getuid()); + if (pwd && pwd->pw_dir) chdir(pwd->pw_dir); +#endif /* UNIX */ + + fp = fopen(htmlname_buf, "w") ; + if ( !fp ) return -1; + + ret = output_html_header(fp) ; + if (ret>=0) ret = fputs("
\n", fp) ; + +#if 0 /*JP*/ + ask = yn_function_htmldump_disclose_option("Do you want to dump screen?", 'm'); +#else + ask = yn_function_htmldump_disclose_option("画面を出力しますか?", 'm'); +#endif + if (ask) { + if (ret>=0) { +#if 0 /*JP*/ + ret = fputs("
Screen:
\n
\n", fp) ; +#else + ret = fputs("
画面:
\n
\n", fp) ; +#endif + } + disablegraphics(); + display_self() ; + if (ret>=0) ret = output_html_screen(fp) ; + restoregraphics(); + if (ret>=0) ret = fputs("

\n
\n", fp) ; + } + + html_fp = fp ; + if (ret>=0) ret = output_dump_html_status(final, FALSE); + html_fp = (FILE *)0 ; + + + /** output vanquished monsters */ + if (ret>=0) ret = htmldump_vanquished(fp); + + /** output genocided monsters */ + if (ret>=0) ret = htmldump_genocided(fp); + + /** output last message */ +#if 0 /*JP*/ + ask = yn_function_htmldump_disclose_option("Do you want to dump last message and etc?", 't'); +#else + ask = yn_function_htmldump_disclose_option("直前のメッセージを出力しますか?", 't'); +#endif + if (ask) { + if (ret>=0) ret = output_html_last_message(fp) ; + } + +#ifdef UNIX + exit(ret); + } /* if (fork()) */ + if (ret>=0) docrt(); +#endif /* UNIX */ + +#if 0 /*JP*/ + if (ret<0) pline("Failure to the HTML file of final status dump."); +#else + if (ret<0) pline("HTML ファイルへの保存に失敗した.") ; +#endif + + if ( fp ) fclose(fp) ; + *htmlbuf = '\0' ; + + return ret ; +} + +int +output_final_dump_html_title(title) +const char *title; +{ + if ( !output_final_dump_html_puts("


\n
") ) + if ( !output_final_dump_html_puts(title) ) + return output_final_dump_html_puts("
\n") ; + return -1 ; +} + +int +output_final_dump_html_mesg(mesg) +const char *mesg; +{ + if ( !output_final_dump_html_puts("
") ) + if ( !output_final_dump_html_puts(mesg) ) + return output_final_dump_html_puts("
\n") ; + return -1 ; +} + +int +output_final_dump_html_puts(str) +const char *str ; +{ + int ret = 0 ; + + if ( *htmlname_buf && htmlbuf ) { + int slen = strlen(str) ; + if ( strlen(htmlbuf) + slen > sizeof(htmlbuf) ) { + /* ゲームオーバーメッセージのオーバーフローエラー + * びっしり3画面分(80×25×3=6000byte)以上 + * のデータがないと起きないはず。 + */ + ret = -1 ; + } else + strcat(htmlbuf, str) ; + } + + return ret ; +} + +int +output_final_dump_html_end(how) +int how; +{ + FILE *fp = 0; + int ret = 0; + int final = (how >= PANICKED ? 1 : 2) ; + boolean ask ; +#ifdef UNIX + int status; +#endif /* UNIX */ + + if ( !*htmlname_buf ) return 0 ; + +#ifdef UNIX + if (fork()) { + wait(&status); + ret = WEXITSTATUS(status); + } else { + struct passwd *pwd; + + seteuid(getuid()); + setegid(getgid()); + pwd = getpwuid(getuid()); + if (pwd && pwd->pw_dir) chdir(pwd->pw_dir); +#endif /* UNIX */ + + fp = fopen(htmlname_buf, "a") ; + if ( !fp ) return -1; + +#if 0 /*JP*/ + ask = yn_function_htmldump_disclose_option("Do you want to dump final message?", 't'); +#else + ask = yn_function_htmldump_disclose_option("最後のメッセージを出力しますか?", 't'); +#endif + if ( ask && *htmlbuf ) { +#if 0 /*JP*/ + ret = fputs("
Final messages
\n", fp) ; +#else + ret = fputs("
最終メッセージ
\n", fp) ; +#endif + /* 死因の出力 */ + if ( ret>=0 ) ret = fputs("
", fp) ; + if ( ret>=0 ) { +#if 0 /*JP*/ + ret = fprintf(fp, "%s, %s%s." + , plname + , killed_by_prefix[how] + , (killer_format == KILLED_BY_AN) ? an(killer) : (killer_format != NO_KILLER_PREFIX) ? killer : "" + ) ; +#else + ret = fprintf(fp, "%sは%s%s." + , plname + , (killer_format == KILLED_BY_AN) ? an(killer) : (killer_format != NO_KILLER_PREFIX) ? killer : "" + , (killer_format == KILLED_SUFFIX) ? "に殺された" : killed_by_prefix[how] + ) ; +#endif + } + if (ret>=0) ret = fputs("

\n", fp) ; + + if (ret>=0) ret = fputs(htmlbuf, fp) ; + if (ret>=0) ret = fputs("


\n", fp) ; + } + + if (ret>=0) ret = fputs("
", fp) ; + if (ret>=0) ret = output_html_footer(fp) ; + +#ifdef UNIX + exit(ret); + } /* if (fork()) */ +#endif /* UNIX */ + + if ( fp ) fclose(fp) ; + *htmlname_buf = '\0' ; + +#if 0 /*JP*/ + if (ret<0) pline("Failure to the HTML file of final status dump."); +#else + if (ret<0) pline("HTML ファイルへの保存に失敗した.") ; +#endif + return ret ; +} + + +void +set_dump_css(op) +char *op; +{ + static char buf[40] ; + + if ( op && *op && strlen(op) < 40 ) { + strcpy(buf, op) ; + html_css_name = buf ; + } else { + html_css_name = (char *)0 ; + } +} + + + +void +set_htmlfile_name(mesg) +const char *mesg; +{ + if ( iflags.htmldump_dump_htmlname_is_auto ) { + int i = 0 ; + FILE *fp ; + do { + set_auto_htmlfile_name() ; + fp = fopen(htmlname_buf, "r") ; + if ( !fp ) break ; + fclose(fp) ; + } while( ++i < 1000 ) ; + if ( !fp ) return ; +#if 0 /*JP*/ + pline("Failure auto setting filename of HTML") ; +#else + pline("ファイル名の自動設定に失敗しました.") ; +#endif + } + + getlin(mesg, htmlname_buf); + if( htmlname_buf[0] == '\033' ) htmlname_buf[0] = 0; +} + + +void +set_auto_htmlfile_name() +{ + htmlname_buf[0] = '\0' ; +#ifdef VMS + Sprintf(htmlname_buf, "[.html]%d%s%03d", getuid(), plnamem, html_counter); + regularize(htmlname_buf+7); + Strcat(htmlname_buf, ";1"); +#else +# if defined(MICRO) && !defined(WIN32) + Strcpy(htmlname_buf, SAVEP); +# ifdef AMIGA + strncat(htmlname_buf, bbs_id, PATHLEN); +# endif + { + int i = strlen(SAVEP); + char buf[4] ; + Sprintf(buf, "%03d", html_counter) ; +# ifdef AMIGA + (void)strncat(htmlname_buf, plname, FILENAME - i - 7); +# else + (void)strncat(htmlname_buf, plname, 5); +# endif + (void)strcat(htmlname_buf, buf); + regularize(htmlname_buf+i); + } + Strcat(htmlname_buf, ".htm"); +# else +# if defined(WIN32) + Sprintf(htmlname_buf, "%s-%s%03d",get_username(0), plname, html_counter); +# else + Sprintf(htmlname_buf, "%d-%s%03d", (int)getuid(), plname, html_counter); + regularize(htmlname_buf); /* avoid . or / in name */ + Strcat(htmlname_buf, ".html"); +# endif /* WIN32 */ +# endif /* MICRO */ +#endif /* VMS */ + html_counter = (html_counter + 1) % 1000 ; +} + + +void +set_last_message_to_html() +{ +#ifdef TTY_GRAPHICS + int i ; + struct WinDesc *cw = wins[WIN_MESSAGE]; + if (!cw) return; + i = cw->maxcol ; + do { + if ( cw->data[i] && strlen(htmlbuf) + strlen(cw->data[i]) + 10 > sizeof(htmlbuf) ) break ; + if ( cw->data[i] && strcmp(cw->data[i], "") ) { + strcat(htmlbuf, "
") ; + strcat(htmlbuf, cw->data[i]) ; + strcat(htmlbuf, "
\n") ; + } + i = (i + 1) % cw->rows; + } while ( i != cw->maxcol) ; +#endif /*TTY_GRAPHICS*/ +} + + +int +output_html_last_message(fp) +FILE *fp; +{ + int ret = 0 ; + if ( htmlbuf && *htmlbuf ) { +#if 0 /*JP*/ + if (ret>=0) ret = fputs("
Last messages:
\n", fp) ; +#else + if (ret>=0) ret = fputs("
直前のメッセージ:
\n", fp) ; +#endif + if (ret>=0) ret = fputs(htmlbuf, fp) ; + if (ret>=0) ret = fputs("


\n", fp) ; + } + + return ret ; +} + +int +output_html_header(fp) +FILE *fp; +{ + int ret = 0 ; + char buf[BUFSZ]; + + if (!fp) return 1; + + ret = fputs("\n\n", fp) ; + if ( html_css_name ) { + if (ret>=0) + ret = fprintf(fp, "\n", html_css_name) ; + } else { + if (ret>=0) ret = fputs("\n", fp) ; + } + if (ret>=0) ret = fputs("\n\n", fp) ; + + + if (ret>=0) ret = fprintf(fp, "
[%s]
\n", getversionstring(buf)) ; + if (ret>=0) ret = fprintf(fp, "
[%s]
\n", getjversionstring(buf)) ; + + return ret; +} + + + +int +output_html_footer(fp) +FILE *fp; +{ + int ret = 0 ; + + if (!fp) return -1; + + ret = fputs("\n\n", fp) ; + + return ret; +} + + + +int +output_dump_html_status(final, eflag) +int final; +boolean eflag; +{ + int ret = 0 ; + boolean ask ; + + if (!html_fp) return -1; + +#if 0 /*JP*/ + ask = yn_function_htmldump_disclose_option("Do you want to dump charactor status?", 'e'); +#else + ask = yn_function_htmldump_disclose_option("キャラクターの状態を出力しますか?", 'e'); +#endif + if ( ask ) { + (void)minimal_enlightenment(); + + if (final || wizard || discover || eflag) enlightenment(final); + } + +#if 0 /*JP*/ + ask = yn_function_htmldump_disclose_option("Do you want to dump voluntary challenges?", 'c'); +#else + ask = yn_function_htmldump_disclose_option("自発的な挑戦を出力しますか?", 'c'); +#endif + if ( ask ) show_conduct(final); + +#if 0 /*JP*/ + ask = yn_function_htmldump_disclose_option("Do you want to dump skills list?", 'k'); +#else + ask = yn_function_htmldump_disclose_option("スキルの一覧を出力しますか?", 'k'); +#endif + if ( ask && ret>=0 ) ret = output_html_skills(html_fp); + +#if 0 /*JP*/ + ask = yn_function_htmldump_disclose_option("Do you want to dump spells list?", 's'); +#else + ask = yn_function_htmldump_disclose_option("呪文一覧を出力しますか?", 's'); +#endif + if ( ask && ret>=0 ) ret = output_html_spells(html_fp); + +#if 0 /*JP*/ + ask = yn_function_htmldump_disclose_option("Do you want to dump pets list?", 'p'); +#else + ask = yn_function_htmldump_disclose_option("ペット一覧を出力しますか?", 'p'); +#endif + if ( ask && ret>=0 ) ret = output_html_pets(html_fp); + +#if 0 /*JP*/ + ask = yn_function_htmldump_disclose_option("Do you want to dump items list?", 'i'); +#else + ask = yn_function_htmldump_disclose_option("アイテム一覧を出力しますか?", 'i'); +#endif + if ( ask ) { + struct obj *objchain ; + boolean nextthere ; +#if 0 /*JP*/ + if (ret>=0) ret = fputs("
Inventory:
\n
\n", html_fp) ; +#else + if (ret>=0) ret = fputs("
所持アイテム:
\n
\n", html_fp) ; +#endif + if (ret>=0) ret = output_html_objectlist(html_fp, invent, (final)?TRUE:FALSE, FALSE) ; + if (ret>=0) ret = fputs("

\n
\n
", html_fp) ; + if (ret>=0) ret = output_html_container(html_fp, invent, (final)?TRUE:FALSE, TRUE, FALSE) ; + if (ret>=0) ret = fputs("

\n
\n", html_fp) ; + + if (!u.uswallow) { + objchain = level.objects[u.ux][u.uy] ; + nextthere = TRUE ; + } else { + objchain = u.ustuck->minvent ; + nextthere = FALSE ; + } + if ( objchain ) { +#if 0 /*JP*/ + ask = yn_function_htmldump_disclose_option("Do you want to dump items list under you?", 'u'); +#else + ask = yn_function_htmldump_disclose_option("足元にあるアイテムの一覧を出力しますか?", 'u'); +#endif + if ( ask ) { +#if 0 /*JP*/ + if (ret>=0) ret = fputs("
Items beneath you:
\n
\n", html_fp) ; +#else + if (ret>=0) ret = fputs("
足元のアイテム:
\n
\n", html_fp) ; +#endif + if (ret>=0) ret = output_html_objectlist(html_fp, objchain, (final)?TRUE:FALSE, nextthere) ; + if (ret>=0) ret = fputs("

\n
\n
", html_fp) ; + if (ret>=0) ret = output_html_container(html_fp, objchain, (final)?TRUE:FALSE, TRUE, nextthere) ; + if (ret>=0) ret = fputs("

\n
\n", html_fp) ; + } + } + } + + if (ret<0 && html_fp) { + fclose(html_fp) ; + html_fp = (FILE*)0 ; + } + return ret; +} + + + +int +output_html_objectlist(fp, list, identified, nextthere) +FILE *fp; +struct obj *list; +boolean identified, nextthere; +{ +#ifdef WIZARD + static char venom_inv[] = { VENOM_CLASS, 0 }; +#endif + struct obj *otmp ; + char *invlet = flags.inv_order; + int classcount; + int ret = 0 ; + + ret = fputs("
", fp) ; + if (ret<0) return -1; +nextclass: + classcount = 0; + for(otmp = list; otmp; otmp = (nextthere) ? otmp->nexthere : otmp->nobj) { + if (!flags.sortpack || otmp->oclass == *invlet) { + if (flags.sortpack && !classcount) { + if (ret>=0) ret = fprintf(fp, "
%s
\n", let_to_name(*invlet, FALSE)) ; + classcount++; + } + if (identified) { + makeknown(otmp->otyp); + otmp->known = otmp->bknown = + otmp->dknown = otmp->rknown = 1; + } + if (ret>=0) ret = fputs("
", fp) ; + if ( otmp->where == OBJ_INVENT && ret>=0 ) + ret = fprintf(fp, "%c - ", otmp->invlet) ; + if (ret>=0) ret = fprintf(fp, "%s
\n" + , objects[otmp->otyp].oc_color, doname(otmp)) ; + if (ret<0) return -1; + } + } + if (flags.sortpack) { + if (*++invlet) goto nextclass; +#ifdef WIZARD + if (--invlet != venom_inv) { + invlet = venom_inv; + goto nextclass; + } +#endif + } + if (ret>=0) ret = fputs("
\n", fp) ; + + return ret; +} + + + +int +output_html_container(fp, list, identified, all_containers, nextthere) +FILE *fp; +struct obj *list; +boolean identified, all_containers, nextthere; +{ + register struct obj *box ; + int ret = 0 ; + + for (box = list; box; box = (nextthere) ? box->nexthere : box->nobj) { + if (Is_container(box) && box->otyp != BAG_OF_TRICKS) { + if (identified) { + makeknown(box->otyp); + box->known = box->bknown = + box->dknown = box->rknown = 1; + } + if (box->cobj) { +/*JP ret = fprintf(fp, "
\n
Contents of %s
\n
", the(doname(box)));*/ + ret = fprintf(fp, "
\n
%sの中身:
\n
", the(doname(box))); + if (ret<0) return -1; + ret = output_html_objectlist(fp, box->cobj, identified, FALSE) ; + if (ret) return -1; + if (all_containers) + ret = output_html_container(fp, box->cobj, identified, TRUE, FALSE); + if (ret) return -1; + ret = fputs("
\n
", fp) ; + if (ret<0) return -1; + } else { +/*JP ret = fprintf(fp, "%s is empty.", The(xname(box)));*/ + ret = fprintf(fp, "%sは空っぽだ.", The(xname(box))); + if (ret<0) return -1; + } + } + if (!all_containers) + break; + } + + return 0 ; +} + + + +int +output_html_pets(fp) +FILE *fp; +{ + int ret = 0 ; + register struct monst *mtmp; + boolean flag = FALSE ; + + for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) if ( mtmp->mtame ) flag = TRUE ; + + if ( flag ) { +#if 0 /*JP*/ + if (ret>=0) ret = fputs("
Pets:
\n
\n
\n", html_fp) ; +#else + if (ret>=0) ret = fputs("
ペット:
\n
\n
\n", html_fp) ; +#endif + for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) { + if ( mtmp->mtame ) { + fprintf(fp, "
%s%s
\n", + mtmp->data->mcolor, + (x_monnam(mtmp, ARTICLE_THE, (char*)0, SUPPRESS_IT, TRUE)), +#if 0 /*JP*/ + (mtmp == u.usteed) ? " (Riding)" : "") ; +#else + (mtmp == u.usteed) ? " (騎乗している)" : "") ; +#endif + } + } + if (ret>=0) ret = fputs("


\n
\n", html_fp) ; + } + + return ret; +} + + +int +htmldump_vanquished(fp) +FILE *fp; +{ + register int i, lev; + int ntypes = 0, max_lev = 0, nkilled, ret = 0 ; + long total_killed = 0L; + char buf[BUFSZ]; + boolean ask; + + /* get totals first */ + for (i = LOW_PM; i < NUMMONS; i++) { + if (mvitals[i].died) ntypes++; + total_killed += (long)mvitals[i].died; + if (mons[i].mlevel > max_lev) max_lev = mons[i].mlevel; + } + + /* vanquished creatures list; + * includes all dead monsters, not just those killed by the player + */ + if (ntypes != 0) { +#if 0 /*JP*/ + ask = yn_function_htmldump_disclose_option("Do you want to dump an account of creatures vanquished?", 'v'); +#else + ask = yn_function_htmldump_disclose_option("倒したモンスター出力しますか?", 'v'); +#endif + if (!ask) return ret ; +#if 0 /*JP*/ + if (ret>=0) ret = fputs("
vanquished creatures list
\n", fp) ; +#else + if (ret>=0) ret = fputs("
倒したモンスター一覧:
\n", fp) ; +#endif + + /* countdown by monster "toughness" */ + for (lev = max_lev; lev >= 0; lev--) + for (i = LOW_PM; i < NUMMONS; i++) + if (mons[i].mlevel == lev && (nkilled = mvitals[i].died) > 0) { + if ((mons[i].geno & G_UNIQ) && i != PM_HIGH_PRIEST) { +#if 0 /*JP*/ + Sprintf(buf, "%s%s", + mons[i].mcolor, + !type_is_pname(&mons[i]) ? "The " : "", + mons[i].mname); +#else + Sprintf(buf, "%s", + mons[i].mcolor, jtrns_mon(mons[i].mname)); +#endif + if (nkilled > 1) { +#if 0 /*JP*/ + switch (nkilled) { + case 2: Sprintf(eos(buf)," (twice)"); break; + case 3: Sprintf(eos(buf)," (thrice)"); break; + default: Sprintf(eos(buf)," (%d time%s)", + nkilled, plur(nkilled)); + break; + } +#else + Sprintf(eos(buf)," (%d回)", nkilled); +#endif + } + } else { + /* trolls or undead might have come back, + but we don't keep track of that */ + if (nkilled == 1) +#if 0 /*JP*/ + Sprintf(buf, "%s", + mons[i].mcolor, an(mons[i].mname)); +#else + Sprintf(buf, "%s", + mons[i].mcolor, jtrns_mon(mons[i].mname)); +#endif + else +#if 0 /*JP*/ + Sprintf(buf, "%d %s", + nkilled, mons[i].mcolor, makeplural(mons[i].mname)); +#else + Sprintf(buf, "%d体の%s", + nkilled, mons[i].mcolor, jtrns_mon(mons[i].mname)); +#endif + } + if (ret>=0) ret = fprintf(fp, "
%s
\n", buf); + } + + if (ntypes > 1) { +#if 0 /*JP*/ + if (ret>=0) ret = fprintf(fp, "

%ld creatures vanquished.
\n", total_killed); +#else + if (ret>=0) ret = fprintf(fp, "

合計%ld匹のモンスターを倒した.
\n", total_killed); +#endif + } + } else { +#if 0 /*JP*/ + if (ret>=0) ret = fputs("
You are not once vanquished monster.
\n", fp); +#else + if (ret>=0) ret = fputs("
あなたはモンスターを一体も倒していない.
\n", fp); +#endif + } + + if (ret>=0) ret = fputs("


\n", fp); + + return ret; +} + + +int +htmldump_genocided(fp) +FILE *fp; +{ + register int i; + int ngenocided = 0, ret = 0; + char buf[BUFSZ]; + boolean ask; + + for (i = LOW_PM; i < NUMMONS; ++i) + if (mvitals[i].mvflags & G_GENOD) ngenocided++; + + /* genocided species list */ + if (ngenocided != 0) { +#if 0 /*JP*/ + ask = yn_function_htmldump_disclose_option("Do you want to dump a list of species genocided?", 'g'); +#else + ask = yn_function_htmldump_disclose_option("虐殺した種別を出力しますか?", 'g'); +#endif + if (!ask) return ret; +#if 0 /*JP*/ + if (ret>=0) ret = fputs("
Genocided species list:
\n", fp) ; +#else + if (ret>=0) ret = fputs("
虐殺した種別一覧:
\n", fp) ; +#endif + + for (i = LOW_PM; i < NUMMONS; i++) + if (mvitals[i].mvflags & G_GENOD) { +#if 0 /*JP*/ + if ((mons[i].geno & G_UNIQ) && i != PM_HIGH_PRIEST) + Sprintf(buf, "%s%s", + !type_is_pname(&mons[i]) ? "" : "the ", + mons[i].mname); + else + Strcpy(buf, makeplural(mons[i].mname)); +#else + Strcpy(buf, jtrns_mon(mons[i].mname)); +#endif + if (ret>=0) ret = fprintf(fp, + "
%s
\n", + mons[i].mcolor, buf); + } + +#if 0 /*JP*/ + if (ret>=0) ret = fprintf(fp, "

%d species genocided.", ngenocided); +#else + if (ret>=0) ret = fprintf(fp, "

%d種類の種を虐殺した.
", ngenocided); +#endif + } else { +#if 0 /*JP*/ + if (ret>=0) ret = fputs("
You don't genocided monster.
\n", fp); +#else + if (ret>=0) ret = fputs("
あなたはモンスターを虐殺しなかった.
\n", fp); +#endif + } + + if (ret>=0) ret = fputs("


\n", fp); + + return ret; +} + + +STATIC_OVL boolean +yn_function_htmldump_disclose_option(text, category) +char *text; +int category; +{ + char c = 0, defquery; + boolean ask = should_query_htmldump_disclose_option(category, &defquery); + + if (ask) c = yn_function(text, ynchars, defquery) ; + return ((!ask && defquery == 'y' ) || (ask && c == 'y')) ; +} + + +boolean +should_query_htmldump_disclose_option(category, defquery) +int category; +char *defquery; +{ + int idx; + char *dop = index(htmldump_disclosure_options, category); + + if (dop && defquery) { + idx = dop - htmldump_disclosure_options; + if (idx < 0 || idx > (NUM_HTMLDUMP_DISCLOSURE_OPTIONS - 1)) { + impossible( + "should_query_htmldump_disclose_option: bad disclosure index %d %c", + idx, category); + *defquery = HTMLDUMP_PROMPT_DEFAULT_YES; + return TRUE; + } + if (iflags.htmldump_disclose[idx] == HTMLDUMP_YES_WITHOUT_PROMPT) { + *defquery = 'y'; + return FALSE; + } else if (iflags.htmldump_disclose[idx] == HTMLDUMP_NO_WITHOUT_PROMPT) { + *defquery = 'n'; + return FALSE; + } else if (iflags.htmldump_disclose[idx] == HTMLDUMP_PROMPT_DEFAULT_YES) { + *defquery = 'y'; + return TRUE; + } else if (iflags.htmldump_disclose[idx] == HTMLDUMP_PROMPT_DEFAULT_NO) { + *defquery = 'n'; + return TRUE; + } + } + if (defquery) + impossible("should_query_disclose_option: bad category %c", category); + else + impossible("should_query_disclose_option: null defquery"); + return TRUE; +} +#endif /*HTMLDUMP*/ + #ifdef PORT_DEBUG # ifdef WIN32CON extern void NDECL(win32con_debug_keystrokes); @@ -3246,4 +4435,122 @@ } #endif +/* AUTOTHRUST */ +/* versatile supplemental weapon attack command */ +STATIC_PTR int +dovattack() +{ + /* autothrust */ + if (!uwep) { +/*JP You("are not wielding a weapon.");*/ + You("武器を装備していない."); + return 0; + } + if (uwep && is_ranged(uwep)) return autothrust(); +/*JP pline("Your wielding weapon has no other use than a melee combat.");*/ + pline("あなたの装備している武器は接近戦専用だ."); + return 0; +} + +struct monst * +findtarget(x, y) +int x, y; +{ + struct monst *mtmp; + if (!isok(x, y)) return (struct monst *)0; + mtmp = m_at(x, y); + if (couldsee(x, y) && /* your weapon should not be blocked */ + mtmp && canspotmons(mtmp) && /* you can see the target */ + !(mtmp->m_ap_type && !Protection_from_shape_changers && + !sensemon(mtmp)) && /* do not count mimics */ + (((Confusion || Stunned) && !rn2(3)) || + (Hallucination && mtmp) || + (!mtmp->mpeaceful && !mtmp->mtame))) + return mtmp; + return (struct monst *)0; +} + +struct monst * +autotarget(rangelimit) +int rangelimit; +{ + int x = u.ux, y = u.uy; + int dx = 1, dy = 0; + struct monst *mtmp = (struct monst *)0; + +#if 0 + /* prefer near monster */ + for (dx = 0; dx < 4; dx++ ) { + for (dy = 0; dy <= dx; dy++ ) { + if ((dx*dx + dy*dy) > rangelimit) break; +#else + /* prefer far monster */ + for (dx = 3; dx >= 0; dx-- ) { + for (dy = dx; dy >= 0; dy-- ) { + if ((dx*dx + dy*dy) > rangelimit) continue; +#endif + if ( (mtmp = findtarget(x+dx, y+dy))) return mtmp; + if (dx && (mtmp = findtarget(x-dx, y+dy))) return mtmp; + if ( dy && (mtmp = findtarget(x+dx, y-dy))) return mtmp; + if (dx && dy && (mtmp = findtarget(x-dx, y-dy))) return mtmp; + if (dx == dy) continue; + if ( (mtmp = findtarget(x+dy, y+dx))) return mtmp; + if (dy && (mtmp = findtarget(x-dy, y+dx))) return mtmp; + if ( dx && (mtmp = findtarget(x+dy, y-dx))) return mtmp; + if (dy && dx && (mtmp = findtarget(x-dy, y-dx))) return mtmp; + } + } + return mtmp; +} + +int +autothrust() +{ + int x, y; + struct monst *mtmp; + + if (!uwep || !is_ranged(uwep)) { +/*JP You("don't wield any long range weapon.");*/ + You("長距離用の武器を装備していない."); + return FALSE; + } + if (u.uswallow) { + if (u.ustuck) attack(u.ustuck); + return TRUE; + } + if (ulasttgt) { /* if last target is alive and in range, attack it */ + x = ulasttgt->mx; + y = ulasttgt->my; + mtmp = findtarget(x, y); + if (mtmp && distu(x, y) <= weapon_range()) { + (void) attack(mtmp); + u.dx = sgn(x - u.ux); /* hero's direction */ + u.dy = sgn(y - u.uy); + u.dz = 0; + return TRUE; + } + } /* else find another target */ + if (mtmp = autotarget(weapon_range())) { + (void) attack(mtmp); + u.dx = sgn(mtmp->mx - u.ux); /* hero's direction */ + u.dy = sgn(mtmp->my - u.uy); + u.dz = 0; + } else { + if (Confusion || Stunned) { +#if 0 /*JP*/ + You("%s your weapon wildly into thin air.", + objects[uwep->otyp].oc_dir ? "thrust" : "swing"); +#else + You("手にした武器を勢いよく空中%s.", + objects[uwep->otyp].oc_dir ? "に突き出した" : "で振り回した"); +#endif + return TRUE; + } +/*JP You("don't see any target in range.");*/ + You("射程内にターゲットを見つけられない."); + return FALSE; + } + return TRUE; +} + /*cmd.c*/ diff -aurN JNetHack-3.4.3-0.10/src/decl.c JNetHack-3.4.3-0.10-7pcs/src/decl.c --- JNetHack-3.4.3-0.10/src/decl.c 2008-08-12 15:50:22.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/src/decl.c 2008-08-12 16:30:47.000000000 +0900 @@ -85,6 +85,24 @@ const char disclosure_options[] = "iavgc"; +#ifdef HTMLDUMP +const char htmldump_disclosure_options[] = "hmeckspiuvgt"; +/* + * h ... last Htmldump + * m ... Map screen + * e ... Enlightenment list + * c ... Conduct list + * k ... sKills list + * s ... Spells list + * p ... Pets list + * i ... Inventory + * u ... Underfoot items + * v ... Vanquished monster count list (DEFERRED) + * g ... Genocided monster list (DEFERRED) + * t ... last message Text + */ +#endif /*HTMLDUMP*/ + #if defined(MICRO) || defined(WIN32) char hackdir[PATHLEN]; /* where rumors, help, record are */ # ifdef MICRO @@ -152,6 +170,8 @@ NEARDATA struct instance_flags iflags = DUMMY; NEARDATA struct you u = DUMMY; +NEARDATA struct monst *ulasttgt = (struct monst *)0; + NEARDATA struct obj *invent = (struct obj *)0, *uwep = (struct obj *)0, *uarm = (struct obj *)0, *uswapwep = (struct obj *)0, @@ -269,6 +289,10 @@ #endif }; +#ifdef MENU_COLOR +struct menucoloring *menu_colorings = 0; +#endif + struct c_common_strings c_common_strings = { #if 0 /*JP*/ "Nothing happens.", "That's enough tries!", diff -aurN JNetHack-3.4.3-0.10/src/display.c JNetHack-3.4.3-0.10-7pcs/src/display.c --- JNetHack-3.4.3-0.10/src/display.c 2003-12-08 08:39:13.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/src/display.c 2008-08-12 16:30:47.000000000 +0900 @@ -2193,4 +2193,119 @@ return idx; } +#ifdef HTMLDUMP +int +output_html_screen(fp) +FILE *fp; +{ + register int prev_color, def_color, x, y ; + boolean reverse_flag ; + int ret = 0 ; + + docrt(); + +#ifdef TEXTCOLOR + prev_color = def_color = 7 ; +#else + prev_color = def_color = NO_COLOR ; +#endif + ret = fprintf(fp, "
", def_color) ;
+	if (ret<0) return -1;
+
+	for (y = 0; y < ROWNO; y++) {
+		register gbuf_entry *gptr = &gbuf[y][(int)gbuf_start[y]];
+		if ( gbuf_stop[y] == 0 && y > 0 ) {
+			fputs("\n", fp) ;
+			continue ;
+		}
+		for (x=0; x < gbuf_start[y]; x++) {
+			ret = fputs(" ", fp) ;
+			if (ret<0) return -1;
+		}
+		for (; x <= gbuf_stop[y]; gptr++, x++) {
+			uchar ch;
+			unsigned sp ;
+			int glyph = gptr->glyph ;
+			int color, ochar ;
+
+			mapglyph(glyph, &ochar, &color, &sp, x, y) ;
+			ch = (char)ochar ;
+/*
+	spの値が示すもの
+		define MG_CORPSE	0x01	死体
+		define MG_INVIS		0x02	透明
+		define MG_DETECT	0x04	発見されたモンスター
+		define MG_PET		0x08	ペット
+		define MG_RIDDEN	0x10	乗馬中
+*/
+			if ( x == u.ux && y == u.uy ) {
+				if ( u.usteed ) {
+					ch = monsyms[u.usteed->data->mlet] ;
+#ifdef TEXTCOLOR
+					color = u.usteed->data->mcolor ;
+#endif
+				} else {
+					ch = monsyms[youmonst.data->mlet] ;
+#ifdef TEXTCOLOR
+					color = youmonst.data->mcolor ;
+#endif
+				}
+			}
+			reverse_flag = FALSE ;
+			if ( ( ((sp & MG_PET) && iflags.hilite_pet) || ((sp & MG_DETECT) && iflags.use_inverse) ) ) {
+				reverse_flag = TRUE ;
+				switch(color) {
+				case CLR_WHITE:
+				case CLR_GRAY:
+				case NO_COLOR:
+				case CLR_BLACK:
+					color = -1 ;
+				}
+			}
+			if ( color != prev_color ) {
+				if ( ch == ' ' ) {
+					color = prev_color ;
+				} else if ( color != def_color ) {
+					if ( prev_color != def_color ) ret = fputs("", fp) ;
+					if ( color >= 0 )
+						ret = fprintf(fp, "", color) ;
+					else
+						ret = fputs("", fp) ;
+				} else {
+					ret = fputs("", fp) ;
+				}
+				if (ret<0) return -1;
+			}
+			if ( reverse_flag ) {
+				ret = fputs("", fp) ;
+			} else if ( x == u.ux && y == u.uy ) {
+				ret = fputs("", fp) ;
+			}
+			if (ret<0) return -1;
+			switch( ch ) {
+			case '&': ret = fputs("&", fp) ;	break ;
+			case '<': ret = fputs("<", fp) ;	break ;
+			case '>': ret = fputs(">", fp) ;	break ;
+			case '"': ret = fputs(""", fp) ;	break ;
+			default : ret = fputc(ch, fp) ;		break ;
+			}
+			if (ret<0) return -1;
+			if ( reverse_flag || ( x == u.ux && y == u.uy ) ) {
+				ret = fputs("", fp) ;
+			}
+			if (ret<0) return -1;
+			prev_color = color ;
+		}
+		ret = fputs("\n", fp) ;
+		if (ret<0) return -1;
+	}
+
+	if ( prev_color != def_color ) ret = fputs("", fp) ;
+	if (ret>=0) ret = output_html_bot(fp) ;
+	if (ret>=0) ret = fprintf(fp, "\n
\n") ; + + return ret; +} +#endif /*HTMLDUMP*/ + /*display.c*/ diff -aurN JNetHack-3.4.3-0.10/src/do.c JNetHack-3.4.3-0.10-7pcs/src/do.c --- JNetHack-3.4.3-0.10/src/do.c 2008-08-12 15:50:22.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/src/do.c 2008-08-12 16:30:47.000000000 +0900 @@ -1360,6 +1360,7 @@ keepdogs(FALSE); if (u.uswallow) /* idem */ u.uswldtim = u.uswallow = 0; + ulasttgt = (struct monst *)0; /* autothrust */ /* * We no longer see anything on the level. Make sure that this * follows u.uswallow set to null since uswallow overrides all diff -aurN JNetHack-3.4.3-0.10/src/dokick.c JNetHack-3.4.3-0.10-7pcs/src/dokick.c --- JNetHack-3.4.3-0.10/src/dokick.c 2008-08-12 15:50:22.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/src/dokick.c 2008-08-12 16:30:47.000000000 +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.10/src/end.c JNetHack-3.4.3-0.10-7pcs/src/end.c --- JNetHack-3.4.3-0.10/src/end.c 2008-08-12 15:50:22.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/src/end.c 2008-08-12 16:30:48.000000000 +0900 @@ -76,6 +76,10 @@ #define putchar(x) {} #endif +#ifdef HTMLDUMP +int htmldump_flag = 0; +#endif /*HTMLDUMP*/ + #if 0 /*JP*/ /* * The order of these needs to match the macros in hack.h. @@ -445,6 +449,20 @@ char c = 0, defquery; char qbuf[QBUFSZ]; boolean ask; +#ifdef HTMLDUMP + int htmldump_tmpflag = 0 ; + + /* 直前のメッセージ出力に質問が出力されないように先頭で実行 */ + ask = should_query_htmldump_disclose_option('h', &defquery); + if (!done_stopprint) { + if (ask) + c = yn_function("DUMPを出力しますか?", ynqchars, defquery) ; + if ((!ask && defquery == 'y' ) || (ask && c == 'y')) + (void) output_final_dump_html_start(how) ; + if (ask && c == 'q') done_stopprint++; + htmldump_tmpflag = 1 ; + } +#endif /*HTMLDUMP*/ if (invent) { if(taken) @@ -513,6 +531,9 @@ show_conduct(how >= PANICKED ? 1 : 2); if (c == 'q') done_stopprint++; } +#ifdef HTMLDUMP + htmldump_flag = htmldump_tmpflag ; +#endif /*HTMLDUMP*/ } /* try to get the player back in a viable state after being killed */ @@ -643,6 +664,11 @@ jtrns_obj(' ', OBJ_NAME(objects[otmp->otyp])), value, currency(value), points); #endif +#ifdef HTMLDUMP + if ( htmldump_flag ) + output_final_dump_html_mesg(pbuf) ; + if ( !done_stopprint ) +#endif /*HTMLDUMP*/ putstr(endwin, 0, pbuf); } } @@ -958,7 +984,11 @@ /* don't bother counting to see whether it should be plural */ } - if (!done_stopprint) { + if (!done_stopprint +#ifdef HTMLDUMP + || htmldump_flag +#endif /*HTMLDUMP*/ + ) { #if 0 /*JP*/ Sprintf(pbuf, "%s %s the %s...", Goodbye(), plname, how != ASCENDED ? @@ -973,8 +1003,15 @@ (const char *) (flags.female ? "女神" : "神"), plname); #endif +#ifdef HTMLDUMP + if ( !done_stopprint ) { +#endif /*HTMLDUMP*/ putstr(endwin, 0, pbuf); putstr(endwin, 0, ""); +#ifdef HTMLDUMP + } + if ( htmldump_flag ) output_final_dump_html_mesg(pbuf) ; +#endif /*HTMLDUMP*/ } if (how == ESCAPED || how == ASCENDED) { @@ -1021,6 +1058,10 @@ if (!done_stopprint) Strcat(pbuf, "は"); #endif if (!done_stopprint) putstr(endwin, 0, pbuf); +#ifdef HTMLDUMP + if ( htmldump_flag ) + output_final_dump_html_mesg(pbuf) ; +#endif /*HTMLDUMP*/ pbuf[0] = '\0'; } else { /*JP @@ -1028,7 +1069,11 @@ */ if (!done_stopprint) Strcat(pbuf, "は"); } - if (!done_stopprint) { + if (!done_stopprint +#ifdef HTMLDUMP + || htmldump_flag +#endif /*HTMLDUMP*/ + ) { #if 0 /*JP*/ Sprintf(eos(pbuf), "%s with %ld point%s,", how==ASCENDED ? "went to your reward" : @@ -1039,10 +1084,19 @@ u.urexp, how==ASCENDED ? "昇天した" : "迷宮から脱出した"); #endif +#ifdef HTMLDUMP + if ( htmldump_flag ) + output_final_dump_html_mesg(pbuf) ; + if ( !done_stopprint ) +#endif /*HTMLDUMP*/ putstr(endwin, 0, pbuf); } - if (!done_stopprint) + if (!done_stopprint +#ifdef HTMLDUMP + || htmldump_flag +#endif /*HTMLDUMP*/ + ) artifact_score(invent, FALSE, endwin); /* list artifacts */ /* list valuables here */ @@ -1079,10 +1133,18 @@ #endif } putstr(endwin, 0, pbuf); +#ifdef HTMLDUMP + if ( htmldump_flag ) + output_final_dump_html_mesg(pbuf) ; +#endif /*HTMLDUMP*/ } } - } else if (!done_stopprint) { + } else if (!done_stopprint +#ifdef HTMLDUMP + || htmldump_flag +#endif /*HTMLDUMP*/ + ) { /* did not escape or ascend */ if (u.uz.dnum == 0 && u.uz.dlevel <= 0) { /* level teleported out of the dungeon; `how' is DIED, @@ -1121,10 +1183,19 @@ Sprintf(eos(pbuf), " %ldポイントをマークし,", u.urexp); #endif +#ifdef HTMLDUMP + if ( htmldump_flag ) + output_final_dump_html_mesg(pbuf) ; + if ( !done_stopprint ) +#endif /*HTMLDUMP*/ putstr(endwin, 0, pbuf); } - if (!done_stopprint) { + if (!done_stopprint +#ifdef HTMLDUMP + || htmldump_flag +#endif /*HTMLDUMP*/ + ) { #if 0 /*JP*/ Sprintf(pbuf, "and %ld piece%s of gold, after %ld move%s.", umoney, plur(umoney), moves, plur(moves)); @@ -1132,9 +1203,18 @@ Sprintf(pbuf, "%ld枚の金貨を持って,%ld歩動いた.", u.ugold, moves); #endif +#ifdef HTMLDUMP + if ( htmldump_flag ) + output_final_dump_html_mesg(pbuf) ; + if ( !done_stopprint ) +#endif /*HTMLDUMP*/ putstr(endwin, 0, pbuf); } - if (!done_stopprint) { + if (!done_stopprint +#ifdef HTMLDUMP + || htmldump_flag +#endif /*HTMLDUMP*/ + ) { #if 0 /*JP*/ Sprintf(pbuf, "You were level %d with a maximum of %d hit point%s when you %s.", @@ -1144,13 +1224,25 @@ "%sとき,あなたはレベル%uで,最大体力は%dであった.", ends[how],u.ulevel, u.uhpmax); #endif +#ifdef HTMLDUMP + if ( htmldump_flag ) + output_final_dump_html_mesg(pbuf) ; + if ( !done_stopprint ) { +#endif /*HTMLDUMP*/ putstr(endwin, 0, pbuf); putstr(endwin, 0, ""); +#ifdef HTMLDUMP + } +#endif /*HTMLDUMP*/ } if (!done_stopprint) display_nhwindow(endwin, TRUE); if (endwin != WIN_ERR) destroy_nhwindow(endwin); +#ifdef HTMLDUMP + if ( htmldump_flag ) + output_final_dump_html_end(how) ; +#endif /*HTMLDUMP*/ /* "So when I die, the first thing I will see in Heaven is a * score list?" */ diff -aurN JNetHack-3.4.3-0.10/src/explode.c JNetHack-3.4.3-0.10-7pcs/src/explode.c --- JNetHack-3.4.3-0.10/src/explode.c 2008-08-12 15:50:23.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/src/explode.c 2008-08-12 16:30:48.000000000 +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.10/src/files.c JNetHack-3.4.3-0.10-7pcs/src/files.c --- JNetHack-3.4.3-0.10/src/files.c 2008-08-12 15:50:23.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/src/files.c 2008-08-12 16:30:48.000000000 +0900 @@ -1822,6 +1822,10 @@ } else if (match_varname(buf, "BOULDER", 3)) { (void) get_uchars(fp, buf, bufp, &iflags.bouldersym, TRUE, 1, "BOULDER"); + } else if (match_varname(buf, "MENUCOLOR", 9)) { +#ifdef MENU_COLOR + (void) add_menu_coloring(bufp); +#endif } else if (match_varname(buf, "GRAPHICS", 4)) { len = get_uchars(fp, buf, bufp, translate, FALSE, MAXPCHARS, "GRAPHICS"); diff -aurN JNetHack-3.4.3-0.10/src/hack.c JNetHack-3.4.3-0.10-7pcs/src/hack.c --- JNetHack-3.4.3-0.10/src/hack.c 2008-08-12 15:50:23.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/src/hack.c 2008-08-12 16:30:48.000000000 +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.10/src/mhitu.c JNetHack-3.4.3-0.10-7pcs/src/mhitu.c --- JNetHack-3.4.3-0.10/src/mhitu.c 2008-08-12 15:50:23.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/src/mhitu.c 2008-08-12 16:30:48.000000000 +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.10/src/mon.c JNetHack-3.4.3-0.10-7pcs/src/mon.c --- JNetHack-3.4.3-0.10/src/mon.c 2008-08-12 15:50:23.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/src/mon.c 2008-08-12 16:30:48.000000000 +0900 @@ -1443,6 +1443,9 @@ if(mtmp) mtmp->nmon = mon->nmon; else panic("relmon: mon not in list."); } + + /* AUTOTHRUST */ + if(mon == ulasttgt) ulasttgt = (struct monst *)0; } /* remove effects of mtmp from other data structures */ @@ -1465,6 +1468,10 @@ if(mtmp->isshk) shkgone(mtmp); if(mtmp->wormno) wormgone(mtmp); + + /* AUTOTHRUST */ + if(ulasttgt == mtmp) ulasttgt = (struct monst *)0; + iflags.purge_monsters++; } diff -aurN JNetHack-3.4.3-0.10/src/objnam.c JNetHack-3.4.3-0.10-7pcs/src/objnam.c --- JNetHack-3.4.3-0.10/src/objnam.c 2008-08-12 15:50:23.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/src/objnam.c 2008-08-12 16:16:31.000000000 +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; } @@ -2524,6 +2545,10 @@ S("と言う名の", " named "); S("という名の", " named "); + S("ほうれん草", "ホウレン草"); + S("ほうれんそう", "ホウレン草"); + S("法蓮草", "ホウレン草"); + S("菠薐草", "ホウレン草"); T("ホウレン草の"); S("ホウレン草の", " of spinach "); @@ -2533,15 +2558,20 @@ T("の死骸"); S("の死骸", " corpse of "); + S("の彫像", "の像"); T("の像"); S("の像", " statue of "); T("の人形"); S("の人形", " figurine of "); + S("たまご", "卵"); + S("タマゴ", "卵"); + S("玉子", "卵"); T("の卵"); S("の卵", " egg of "); + S("缶詰", "缶"); S("の肉の缶", "の缶"); T("の缶"); S("の缶", " tin of "); @@ -2589,10 +2619,11 @@ D("一式"); + S("魔避け", "魔除け"); + S("巻き物", "巻物"); + if(strlen(buf)>4 && !strcmp(buf + strlen(buf) - 4, "巻物")) Strcpy(pfx, "scroll of "); - else if(strlen(buf)>6 && !strcmp(buf + strlen(buf) - 6, "巻き物")) - Strcpy(pfx, "scroll of "); else if(strlen(buf)>6 && !strcmp(buf + strlen(buf) - 6, "魔法書")) Strcpy(pfx, "spellbook of "); else if(strlen(buf)>2 && !strcmp(buf + strlen(buf) - 2, "杖")) diff -aurN JNetHack-3.4.3-0.10/src/options.c JNetHack-3.4.3-0.10-7pcs/src/options.c --- JNetHack-3.4.3-0.10/src/options.c 2008-08-12 15:50:23.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/src/options.c 2008-08-12 16:30:49.000000000 +0900 @@ -80,6 +80,9 @@ #else {"DECgraphics", (boolean *)0, FALSE, SET_IN_FILE}, #endif +#ifdef HTMLDUMP + {"dump_autoname", &iflags.htmldump_dump_htmlname_is_auto, FALSE, SET_IN_FILE}, +#endif {"eight_bit_tty", &iflags.wc_eight_bit_input, FALSE, SET_IN_GAME}, /*WC*/ #ifdef TTY_GRAPHICS {"extmenu", &iflags.extmenu, FALSE, SET_IN_GAME}, @@ -111,6 +114,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}, @@ -125,6 +133,15 @@ #else {"mail", (boolean *)0, TRUE, SET_IN_FILE}, #endif +#ifdef MENU_COLOR +# ifdef MICRO + {"menucolors", &iflags.use_menu_color, TRUE, SET_IN_GAME}, +# else + {"menucolors", &iflags.use_menu_color, FALSE, SET_IN_GAME}, +# endif +#else + {"menucolors", (boolean *)0, FALSE, SET_IN_GAME}, +#endif #ifdef WIZARD /* for menu debugging only*/ {"menu_tab_sep", &iflags.menu_tab_sep, FALSE, SET_IN_GAME}, @@ -171,6 +188,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}, @@ -243,6 +271,13 @@ SET_IN_GAME }, { "dogname", "the name of your (first) dog (e.g., dogname:Fang)", PL_PSIZ, DISP_IN_GAME }, +#ifdef HTMLDUMP + { "dump_css", "the filename of cascading style sheet for dump html files", + 40, SET_IN_FILE }, + { "dump_disclose", "the kinds of information to disclose at dumped html", + sizeof(iflags.htmldump_disclose) * 2, + SET_IN_FILE }, +#endif /*HTMLDUMP*/ { "dungeon", "the symbols to use in drawing the dungeon map", MAXDCHARS+1, SET_IN_FILE }, #else /*JP*/ @@ -305,6 +340,7 @@ #endif /*JP*/ #if 0 /*JP*/ { "map_mode", "map display mode under Windows", 20, DISP_IN_GAME }, /*WC*/ + { "menucolor", "set menu colors", PL_PSIZ, SET_IN_FILE }, { "menustyle", "user interface for object selection", MENUTYPELEN, SET_IN_GAME }, { "menu_deselect_all", "deselect all items in a menu", 4, SET_IN_FILE }, @@ -728,6 +764,13 @@ for (i = 0; i < NUM_DISCLOSURE_OPTIONS; i++) flags.end_disclose[i] = DISCLOSE_PROMPT_DEFAULT_NO; +#ifdef HTMLDUMP + iflags.htmldump_disclose[0] = HTMLDUMP_PROMPT_DEFAULT_YES; + for (i = 1; i < NUM_HTMLDUMP_DISCLOSURE_OPTIONS; i++) + iflags.htmldump_disclose[i] = HTMLDUMP_YES_WITHOUT_PROMPT; + i = index(htmldump_disclosure_options, 'u') - htmldump_disclosure_options ; + iflags.htmldump_disclose[i] = HTMLDUMP_NO_WITHOUT_PROMPT; +#endif /*HTMLDUMP*/ switch_graphics(ASCII_GRAPHICS); /* set default characters */ #if defined(UNIX) && defined(TTY_GRAPHICS) /* @@ -1152,6 +1195,133 @@ } } +#ifdef MENU_COLOR +extern struct menucoloring *menu_colorings; + +static const struct { + const char *name; + const int color; +} colornames[] = { + {"black", CLR_BLACK}, + {"red", CLR_RED}, + {"green", CLR_GREEN}, + {"brown", CLR_BROWN}, + {"blue", CLR_BLUE}, + {"magenta", CLR_MAGENTA}, + {"cyan", CLR_CYAN}, + {"gray", CLR_GRAY}, + {"orange", CLR_ORANGE}, + {"lightgreen", CLR_BRIGHT_GREEN}, + {"yellow", CLR_YELLOW}, + {"lightblue", CLR_BRIGHT_BLUE}, + {"lightmagenta", CLR_BRIGHT_MAGENTA}, + {"lightcyan", CLR_BRIGHT_CYAN}, + {"white", CLR_WHITE} +}; + +static const struct { + const char *name; + const int attr; +} attrnames[] = { + {"none", ATR_NONE}, + {"bold", ATR_BOLD}, + {"dim", ATR_DIM}, + {"underline", ATR_ULINE}, + {"blink", ATR_BLINK}, + {"inverse", ATR_INVERSE} + +}; + +/* parse '"regex_string"=color&attr' and add it to menucoloring */ +boolean +add_menu_coloring(str) +char *str; +{ + int i, c = NO_COLOR, a = ATR_NONE; + struct menucoloring *tmp; + char *tmps, *cs = strchr(str, '='); +#ifdef MENU_COLOR_REGEX_POSIX + int errnum; + char errbuf[80]; +#endif + const char *err = (char *)0; + + if (!cs || !str) return FALSE; + + tmps = cs; + tmps++; + while (*tmps && isspace(*tmps)) tmps++; + + for (i = 0; i < SIZE(colornames); i++) + if (strstri(tmps, colornames[i].name) == tmps) { + c = colornames[i].color; + break; + } + if ((i == SIZE(colornames)) && (*tmps >= '0' && *tmps <='9')) + c = atoi(tmps); + + if (c > 15) return FALSE; + + tmps = strchr(str, '&'); + if (tmps) { + tmps++; + while (*tmps && isspace(*tmps)) tmps++; + for (i = 0; i < SIZE(attrnames); i++) + if (strstri(tmps, attrnames[i].name) == tmps) { + a = attrnames[i].attr; + break; + } + if ((i == SIZE(attrnames)) && (*tmps >= '0' && *tmps <='9')) + a = atoi(tmps); + } + + *cs = '\0'; + tmps = str; + if ((*tmps == '"') || (*tmps == '\'')) { + cs--; + while (isspace(*cs)) cs--; + if (*cs == *tmps) { + *cs = '\0'; + tmps++; + } + } + + tmp = (struct menucoloring *)alloc(sizeof(struct menucoloring)); +#ifdef MENU_COLOR_REGEX +#ifdef MENU_COLOR_REGEX_POSIX + errnum = regcomp(&tmp->match, tmps, REG_EXTENDED | REG_NOSUB); + if (errnum != 0) + { + regerror(errnum, &tmp->match, errbuf, sizeof(errbuf)); + err = errbuf; + } +#else + tmp->match.translate = 0; + tmp->match.fastmap = 0; + tmp->match.buffer = 0; + tmp->match.allocated = 0; + tmp->match.regs_allocated = REGS_FIXED; + err = re_compile_pattern(tmps, strlen(tmps), &tmp->match); +#endif +#else + tmp->match = (char *)alloc(strlen(tmps)+1); + (void) memcpy((genericptr_t)tmp->match, (genericptr_t)tmps, strlen(tmps)+1); +#endif + if (err) { + raw_printf("\nMenucolor regex error: %s\n", err); + wait_synch(); + free(tmp); + return FALSE; + } else { + tmp->next = menu_colorings; + tmp->color = c; + tmp->attr = a; + menu_colorings = tmp; + return TRUE; + } +} +#endif /* MENU_COLOR */ + void parseoptions(opts, tinitial, tfrom_file) register char *opts; @@ -1333,6 +1503,18 @@ return; } + /* menucolor:"regex_string"=color */ + fullname = "menucolor"; + if (match_optname(opts, fullname, 9, TRUE)) { +#ifdef MENU_COLOR + if (negated) bad_negation(fullname, FALSE); + else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) + if (!add_menu_coloring(op)) + badoption(opts); +#endif + return; + } + fullname = "msghistory"; if (match_optname(opts, fullname, 3, TRUE)) { op = string_for_env_opt(fullname, opts, negated); @@ -2020,6 +2202,77 @@ return; } #endif +#ifdef HTMLDUMP + fullname = "dump_css"; + if (match_optname(opts, fullname, 8, TRUE)) { + if (negated) + bad_negation(fullname, FALSE); + else if ((op = string_for_env_opt(fullname, opts, FALSE)) != 0) + set_dump_css(op); + return; + } + + /* things to disclose at dumped html */ + fullname = "dump_disclose"; + if (match_optname(opts, fullname, 8, TRUE)) { + boolean badopt = FALSE; + int idx, prefix_val; + + op = string_for_opt(opts, TRUE); + if (op && negated) { + bad_negation(fullname, TRUE); + return; + } + /* "disclose" without a value means "all with prompting" + and negated means "none without prompting" */ + if (!op || !strcmpi(op, "all") || !strcmpi(op, "none")) { + if (op && !strcmpi(op, "none")) negated = TRUE; + iflags.htmldump_disclose[0] = negated ? + HTMLDUMP_NO_WITHOUT_PROMPT : + HTMLDUMP_PROMPT_DEFAULT_YES; + for (num = 1; num < NUM_HTMLDUMP_DISCLOSURE_OPTIONS; num++) + iflags.htmldump_disclose[num] = negated ? + HTMLDUMP_NO_WITHOUT_PROMPT : + HTMLDUMP_YES_WITHOUT_PROMPT; + return; + } + + num = 0; + prefix_val = -1; + while (*op && num < sizeof iflags.htmldump_disclose - 1) { + register char c, *dop; + static char valid_settings[] = { + HTMLDUMP_PROMPT_DEFAULT_YES, + HTMLDUMP_PROMPT_DEFAULT_NO, + HTMLDUMP_YES_WITHOUT_PROMPT, + HTMLDUMP_NO_WITHOUT_PROMPT, + '\0' + }; + c = lowc(*op); + dop = index(htmldump_disclosure_options, c); + if (dop) { + idx = dop - htmldump_disclosure_options; + if (idx < 0 || idx > NUM_HTMLDUMP_DISCLOSURE_OPTIONS - 1) { + impossible("bad htmldump disclosure index %d %c", idx, c); + continue; + } + if (prefix_val != -1) { + iflags.htmldump_disclose[idx] = prefix_val; + prefix_val = -1; + } else + iflags.htmldump_disclose[idx] = HTMLDUMP_YES_WITHOUT_PROMPT; + } else if (index(valid_settings, c)) { + prefix_val = c; + } else if (c == ' ') { + /* do nothing */ + } else + badopt = TRUE; + op++; + } + if (badopt) badoption(opts); + return; + } +#endif /*HTMLDUMP*/ /* scores:5t[op] 5a[round] o[wn] */ if (match_optname(opts, "scores", 4, TRUE)) { @@ -2419,6 +2672,9 @@ #ifdef SCORE_ON_BOTL || (boolopt[i].addr) == &flags.showscore #endif +#ifdef SHOW_WEIGHT + || (boolopt[i].addr) == &flags.showweight +#endif ) flags.botl = TRUE; @@ -4350,6 +4606,82 @@ return 1; } +#ifdef HTMLDUMP +static int DECgraphics = 0; +static int IBMgraphics = 0; +static int MACgraphics = 0; + +static enum {DEC = 0x01, IBM = 0x02, MAC = 0x04} graphicsBits; + +void +disablegraphics() +{ + int i; + + graphicsBits = 0; + DECgraphics = IBMgraphics = MACgraphics = 0; + for (i = 0; boolopt[i].name ; i++) + { + if (graphicsBits & (DEC|IBM|MAC)) break; + if (strcmp(boolopt[i].name, "DECgraphics") == 0) { + if (boolopt[i].addr && boolopt[i].addr[0]) { + DECgraphics = 1; + parseoptions("!DECgraphics", FALSE, FALSE); + } + graphicsBits |= DEC; + continue; + } + if (strcmp(boolopt[i].name, "IBMgraphics") == 0) { + if (boolopt[i].addr && boolopt[i].addr[0]) { + IBMgraphics = 1; + parseoptions("!IBMgraphics", FALSE, FALSE); + } + graphicsBits |= IBM; + continue; + } + if (strcmp(boolopt[i].name, "Macgraphics") == 0) { + if (boolopt[i].addr && boolopt[i].addr[0]) { + MACgraphics = 1; + parseoptions("!Macgraphics", FALSE, FALSE); + } + graphicsBits |= MAC; + continue; + } + } + +} + +void +restoregraphics() +{ + int i; + + if (!(DECgraphics || IBMgraphics || MACgraphics)) goto RET; + graphicsBits = 0; + for (i = 0; boolopt[i].name ; i++) + { + if (graphicsBits & (DEC|IBM|MAC)) break; + if (strcmp(boolopt[i].name, "DECgraphics") == 0) { + if (DECgraphics) parseoptions("DECgraphics", FALSE, FALSE); + graphicsBits |= DEC; + continue; + } + if (strcmp(boolopt[i].name, "IBMgraphics") == 0) { + if (IBMgraphics) parseoptions("IBMgraphics", FALSE, FALSE); + graphicsBits |= IBM; + continue; + } + if (strcmp(boolopt[i].name, "Macgraphics") == 0) { + if (MACgraphics) parseoptions("Macgraphics", FALSE, FALSE); + graphicsBits |= MAC; + continue; + } + } +RET: + return; +} +#endif /*HTMLDUMP*/ + #endif /* OPTION_LISTS_ONLY */ /*options.c*/ diff -aurN JNetHack-3.4.3-0.10/src/save.c JNetHack-3.4.3-0.10-7pcs/src/save.c --- JNetHack-3.4.3-0.10/src/save.c 2008-08-12 15:50:24.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/src/save.c 2008-08-12 16:30:49.000000000 +0900 @@ -55,6 +55,10 @@ #define HUP #endif +#ifdef MENU_COLOR +extern struct menucoloring *menu_colorings; +#endif + /* need to preserve these during save to avoid accessing freed memory */ static unsigned ustuck_id = 0, usteed_id = 0; @@ -975,12 +979,34 @@ return; } +#ifdef MENU_COLOR +void +free_menu_coloring() +{ + struct menucoloring *tmp = menu_colorings; + + while (tmp) { + struct menucoloring *tmp2 = tmp->next; +# ifdef MENU_COLOR_REGEX + (void) regfree(&tmp->match); +# else + free(tmp->match); +# endif + free(tmp); + tmp = tmp2; + } +} +#endif /* MENU_COLOR */ + void freedynamicdata() { unload_qtlist(); free_invbuf(); /* let_to_name (invent.c) */ free_youbuf(); /* You_buf,&c (pline.c) */ +#ifdef MENU_COLOR + free_menu_coloring(); +#endif tmp_at(DISP_FREEMEM, 0); /* temporary display effects */ #ifdef FREE_ALL_MEMORY # define freeobjchn(X) (saveobjchn(0, X, FREE_SAVE), X = 0) diff -aurN JNetHack-3.4.3-0.10/src/spell.c JNetHack-3.4.3-0.10-7pcs/src/spell.c --- JNetHack-3.4.3-0.10/src/spell.c 2008-08-12 15:50:24.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/src/spell.c 2008-08-12 16:30:49.000000000 +0900 @@ -1548,4 +1548,46 @@ return; } +#ifdef HTMLDUMP +int +output_html_spells(fp) +FILE *fp; +{ + int ret = 0, i ; + + if (spellid(0) == NO_SPELL) return 0 ; + + if (ret>=0) ret = fputs("
魔法:
\n
\n" + "\n" +#if 0 /*JP*/ + "" + "\n" +#else + "" + "\n" +#endif + , fp) ; + + for (i = 0; i < MAXSPELL && spellid(i) != NO_SPELL; i++) { + if (ret>=0) ret = fprintf(fp, + "" + "\n", +#if 0 /*JP*/ + spellname(i), spellev(i), + spellknow(i) ? " " : "*", + spelltypemnemonic(spell_skilltype(spellid(i))), + 100 - percent_success(i) +#else + jtrns_obj('+', spellname(i)), spellev(i), + spellknow(i) ? " " : "*", + spelltypemnemonic(spell_skilltype(spellid(i))), + percent_success(i) +#endif + ); + } + if (ret>=0) ret = fputs("
NameLevelCategoryFail
魔法名レベル分類成功率
%s%d%s%s%d%%
\n

\n
\n", fp) ; + + return ret ; +} +#endif /*HTMLDUMP*/ /*spell.c*/ diff -aurN JNetHack-3.4.3-0.10/src/u_init.c JNetHack-3.4.3-0.10-7pcs/src/u_init.c --- JNetHack-3.4.3-0.10/src/u_init.c 2003-12-08 08:39:13.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/src/u_init.c 2008-08-12 16:30:49.000000000 +0900 @@ -596,6 +596,8 @@ u.nv_range = 1; u.xray_range = -1; + /* initialize last monster you targeted */ + ulasttgt = (struct monst *)0; /*** Role-specific initializations ***/ switch (Role_switch) { diff -aurN JNetHack-3.4.3-0.10/src/uhitm.c JNetHack-3.4.3-0.10-7pcs/src/uhitm.c --- JNetHack-3.4.3-0.10/src/uhitm.c 2008-08-12 15:50:24.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/src/uhitm.c 2008-08-12 16:30:49.000000000 +0900 @@ -402,6 +402,9 @@ if(check_capacity("あなたは物をたくさん持ちすぎて戦えない.")) goto atk_done; + /* AUTOTHRUST */ + if(ulasttgt != mtmp) ulasttgt = mtmp; /* you targetted it */ + if (u.twoweap && !can_twoweapon()) untwoweapon(); @@ -1272,6 +1275,9 @@ } } +#ifdef SHOW_DMG + if (!destroyed) showdmg(tmp); +#endif return((boolean)(destroyed ? FALSE : TRUE)); } @@ -1766,6 +1772,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 +2009,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.10/src/version.c JNetHack-3.4.3-0.10-7pcs/src/version.c --- JNetHack-3.4.3-0.10/src/version.c 2008-08-12 15:50:24.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/src/version.c 2008-08-12 16:30:49.000000000 +0900 @@ -48,13 +48,27 @@ return buf; } +#ifdef HTMLDUMP +/* binary的にJVERSION_IDは一箇所だけにする*/ +char * +getjversionstring(buf) +char *buf; +{ + return strcpy(buf, JVERSION_ID); +} +#endif /*HTMLDUMP*/ + int doversion() { char buf[BUFSZ]; pline("%s", getversionstring(buf)); +#ifdef HTMLDUMP + pline("%s", getjversionstring(buf)); +#else pline(JVERSION_ID); +#endif /*HTMLDUMP*/ return 0; } diff -aurN JNetHack-3.4.3-0.10/src/weapon.c JNetHack-3.4.3-0.10-7pcs/src/weapon.c --- JNetHack-3.4.3-0.10/src/weapon.c 2008-08-12 15:50:24.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/src/weapon.c 2008-08-12 16:30:49.000000000 +0900 @@ -1440,6 +1440,87 @@ obj->owornmask &= ~W_WEP; } + +#ifdef HTMLDUMP +int +output_html_skills(fp) +FILE *fp; +{ + int ret = 0 ; + int pass, i, maxxed_cnt; + char sklnambuf[BUFSZ]; + + ret = fputs( +#if 0 /*JP*/ + "
Skills:
\n
\n" +#else + "
スキル:
\n
\n" +#endif + "\n" + "" + "" + "", fp) ; +#ifdef WIZARD + if ( wizard ) { + if (ret>=0) ret = fputs("", fp) ; + } +#endif + if (ret>=0) ret = fputs("\n", fp) ; + + for (pass = 0; pass < SIZE(skill_ranges); pass++) { + maxxed_cnt = 0; + for (i = skill_ranges[pass].first; i <= skill_ranges[pass].last; i++) { + if ( P_SKILL(i) <= P_UNSKILLED ) continue; + maxxed_cnt++; + } + if (!maxxed_cnt) continue; + + for (i = skill_ranges[pass].first; i <= skill_ranges[pass].last; i++) { + /* Print headings for skill types */ + if (i == skill_ranges[pass].first) + if (ret>=0) ret = fprintf(fp, "\n", skill_ranges[pass].name) ; + + if ( P_RESTRICTED(i) ) continue; + if ( P_SKILL(i) <= P_UNSKILLED ) continue; + + if (ret>=0) { + (void) skill_level_name(i, sklnambuf); + ret = fprintf(fp, "" + , can_advance(i, FALSE) ? "" : could_advance(i) ? "*" : peaked_skill(i) ? "#" : "" + , P_NAME(i) + , sklnambuf + ) ; + } +#ifdef WIZARD + if ( wizard ) { + if (ret>=0) { + ret = fprintf(fp, "" + , P_ADVANCE(i) + , practice_needed_to_advance(P_SKILL(i))); + } + } +#endif + if (ret>=0) ret = fputs("\n", fp) ; + } + } + if (ret>=0) ret = fputs("
%s
%s%s %s%5d(%4d)
\n

\n
\n", fp) ; + + return ret; +} +#endif /*HTMLDUMP*/ + +/* Calculate weapon range from skill */ +int +weapon_range() +{ + int max_range; + int typ = uwep_skill_type(); + if (typ == P_NONE || P_SKILL(typ) <= P_BASIC) max_range = 4; + else if (P_SKILL(typ) == P_SKILLED) max_range = 5; + else max_range = 8; + return max_range; +} + #endif /* OVLB */ /*weapon.c*/ diff -aurN JNetHack-3.4.3-0.10/src/zap.c JNetHack-3.4.3-0.10-7pcs/src/zap.c --- JNetHack-3.4.3-0.10/src/zap.c 2008-08-12 15:50:24.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/src/zap.c 2008-08-12 16:30:49.000000000 +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.10/sys/msdos/Makefile.GCC JNetHack-3.4.3-0.10-7pcs/sys/msdos/Makefile.GCC --- JNetHack-3.4.3-0.10/sys/msdos/Makefile.GCC 2008-08-12 15:50:24.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/sys/msdos/Makefile.GCC 2008-08-12 16:30:49.000000000 +0900 @@ -835,7 +835,7 @@ $(O)ppmwrit2.o: $(CONFIG_H) $(WSHR)/tile.h ppmwrite.c $(CC) $(cflags) -DTILE_X=8 -o$@ ppmwrite.c -$(INCL)/jdata.h: $(U)makedefs.exe $(DAT)/jtrnsobj.dat $(DAT)/jtrnsmon.dat +$(INCL)/jdata.h: $(U)makedefs.exe $(DAT)/jtrnsobj.dat $(DAT)/jtrnsmon.dat $(DAT)/jalias.dat -$(subst /,\,$(U)makedefs -j) # diff -aurN JNetHack-3.4.3-0.10/sys/unix/Makefile.src JNetHack-3.4.3-0.10-7pcs/sys/unix/Makefile.src --- JNetHack-3.4.3-0.10/sys/unix/Makefile.src 2008-08-12 15:50:25.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/sys/unix/Makefile.src 2008-08-12 16:30:49.000000000 +0900 @@ -506,7 +506,7 @@ tile.c: ../win/share/tilemap.c $(HACK_H) @( cd ../util ; $(MAKE) ../src/tile.c ) #JP by issei(94/07/13) -../include/jdata.h: $(MAKEDEFS) ../dat/jtrnsobj.dat ../dat/jtrnsmon.dat +../include/jdata.h: $(MAKEDEFS) ../dat/jtrnsobj.dat ../dat/jtrnsmon.dat ../dat/jalias.dat @( cd ../util ; $(MAKE) ../include/jdata.h ) ../win/gnome/gn_rip.h: ../win/X11/rip.xpm diff -aurN JNetHack-3.4.3-0.10/sys/unix/Makefile.utl JNetHack-3.4.3-0.10-7pcs/sys/unix/Makefile.utl --- JNetHack-3.4.3-0.10/sys/unix/Makefile.utl 2008-08-12 15:50:25.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/sys/unix/Makefile.utl 2008-08-12 16:30:49.000000000 +0900 @@ -191,7 +191,7 @@ ./makedefs -m ../include/vis_tab.h: makedefs ./makedefs -z -../include/jdata.h: makedefs ../dat/jtrnsmon.dat ../dat/jtrnsobj.dat +../include/jdata.h: makedefs ../dat/jtrnsmon.dat ../dat/jtrnsobj.dat ../dat/jalias.dat ./makedefs -j # makedefs -z makes both vis_tab.h and vis_tab.c, but writes the .h first ../src/vis_tab.c: ../include/vis_tab.h diff -aurN JNetHack-3.4.3-0.10/sys/winnt/Makefile.bcc JNetHack-3.4.3-0.10-7pcs/sys/winnt/Makefile.bcc --- JNetHack-3.4.3-0.10/sys/winnt/Makefile.bcc 2008-08-12 15:50:26.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/sys/winnt/Makefile.bcc 2008-08-12 16:30:49.000000000 +0900 @@ -915,7 +915,7 @@ $(INCL)\win32api.h: $(NTSYS)\win32api.h copy $(NTSYS)\win32api.h $@ -$(INCL)\jdata.h: $(U)makedefs.exe $(DAT)\jtrnsobj.dat $(DAT)\jtrnsmon.dat +$(INCL)\jdata.h: $(U)makedefs.exe $(DAT)\jtrnsobj.dat $(DAT)\jtrnsmon.dat $(DAT)\jalias.dat $(U)makedefs -j diff -aurN JNetHack-3.4.3-0.10/sys/winnt/Makefile.msc JNetHack-3.4.3-0.10-7pcs/sys/winnt/Makefile.msc --- JNetHack-3.4.3-0.10/sys/winnt/Makefile.msc 2008-08-12 15:50:26.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/sys/winnt/Makefile.msc 2008-08-12 16:30:49.000000000 +0900 @@ -661,7 +661,7 @@ @if not exist $(OBJ)\*.* mkdir $(OBJ) @$(CC) $(CFLAGSU) -Fo$@ $(U)makedefs.c -$(INCL)\jdata.h: $(U)makedefs.exe $(DAT)\jtrnsobj.dat $(DAT)\jtrnsmon.dat +$(INCL)\jdata.h: $(U)makedefs.exe $(DAT)\jtrnsobj.dat $(DAT)\jtrnsmon.dat $(DAT)\jalias.dat $(U)makedefs -j # diff -aurN JNetHack-3.4.3-0.10/util/makedefs.c JNetHack-3.4.3-0.10-7pcs/util/makedefs.c --- JNetHack-3.4.3-0.10/util/makedefs.c 2008-08-12 15:50:26.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/util/makedefs.c 2008-08-12 16:30:50.000000000 +0900 @@ -100,6 +100,7 @@ #if 1 /*JP*/ #define JOBJ_FILE "jtrnsobj.dat" #define JMON_FILE "jtrnsmon.dat" +#define JALIAS_FILE "jalias.dat" #define JDATA "jdata.h" #endif /* locations for those files */ @@ -772,6 +773,13 @@ #ifdef MAIL "mail daemon", #endif +#ifdef MENU_COLOR +# ifdef MENU_COLOR_REGEX + "menu colors via regular expressions", +# else + "menu colors via pmatch", +# endif +#endif #ifdef GNUDOS "MSDOS protected mode", #endif @@ -829,6 +837,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 @@ -2453,6 +2467,31 @@ ++i; } } + fclose(fpr); + + sprintf(fnamer, DATA_TEMPLATE, JALIAS_FILE); + if((fpr = fopen(fnamer, RDMODE)) == (void *)NULL) + fprintf(stderr, "Warning: Can't open %s\n", fnamer); + else { + while(fgets((char *)buf, BUFSZ, fpr) != NULL){ + if(split_string(buf, key, val)){ + rhval = hash_val(val); + + if(*key == '\'') + fprintf(fpw, " {'\\%c', %d, %d, \"%s\", \"%s\"},\n", + *key, -1, rhash_tab[rhval], + key + 1, val); + else + fprintf(fpw, " {'%c', %d, %d, \"%s\", \"%s\"},\n", + *key, -1, rhash_tab[rhval], + key + 1, val); + + rhash_tab[rhval] = i; + + ++i; + } + } + } } fclose(fpr); fprintf(fpw, " {'\\0', -1, -1, (void *)0, (void *)0},\n"); diff -aurN JNetHack-3.4.3-0.10/win/Qt/qt_win.cpp JNetHack-3.4.3-0.10-7pcs/win/Qt/qt_win.cpp --- JNetHack-3.4.3-0.10/win/Qt/qt_win.cpp 2003-12-08 08:39:13.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/win/Qt/qt_win.cpp 2008-08-12 16:30:50.000000000 +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.10/win/X11/winstat.c JNetHack-3.4.3-0.10-7pcs/win/X11/winstat.c --- JNetHack-3.4.3-0.10/win/X11/winstat.c 2008-08-12 15:50:27.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/win/X11/winstat.c 2008-08-12 16:30:50.000000000 +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: { /* diff -aurN JNetHack-3.4.3-0.10/win/tty/wintty.c JNetHack-3.4.3-0.10-7pcs/win/tty/wintty.c --- JNetHack-3.4.3-0.10/win/tty/wintty.c 2008-08-12 15:50:27.000000000 +0900 +++ JNetHack-3.4.3-0.10-7pcs/win/tty/wintty.c 2008-08-12 16:30:50.000000000 +0900 @@ -131,6 +131,10 @@ static char winpanicstr[] = "Bad window id %d"; char defmorestr[] = "--More--"; +#ifdef MENU_COLOR +extern struct menucoloring *menu_colorings; +#endif + #ifdef CLIPPING # if defined(USE_TILES) && defined(MSDOS) boolean clipping = FALSE; /* clipping on? */ @@ -1267,6 +1271,32 @@ } } +#ifdef MENU_COLOR +STATIC_OVL boolean +get_menu_coloring(str, color, attr) +char *str; +int *color, *attr; +{ + struct menucoloring *tmpmc; + if (iflags.use_menu_color) + for (tmpmc = menu_colorings; tmpmc; tmpmc = tmpmc->next) +# ifdef MENU_COLOR_REGEX +# ifdef MENU_COLOR_REGEX_POSIX + if (regexec(&tmpmc->match, str, 0, NULL, 0) == 0) { +# else + if (re_search(&tmpmc->match, str, strlen(str), 0, 9999, 0) >= 0) { +# endif +# else + if (pmatch(tmpmc->match, str)) { +# endif + *color = tmpmc->color; + *attr = tmpmc->attr; + return TRUE; + } + return FALSE; +} +#endif /* MENU_COLOR */ + STATIC_OVL void process_menu_window(window, cw) winid window; @@ -1343,6 +1373,10 @@ for (page_lines = 0, curr = page_start; curr != page_end; page_lines++, curr = curr->next) { +#ifdef MENU_COLOR + int color = NO_COLOR, attr = ATR_NONE; + boolean menucolr = FALSE; +#endif if (curr->selector) *rp++ = curr->selector; @@ -1362,6 +1396,13 @@ * actually output the character. We're faster doing * this. */ +#ifdef MENU_COLOR + if (iflags.use_menu_color && + (menucolr = get_menu_coloring(curr->str, &color,&attr))) { + term_start_attr(attr); + if (color != NO_COLOR) term_start_color(color); + } else +#endif term_start_attr(curr->attr); for (n = 0, cp = curr->str; #ifndef WIN32CON @@ -1391,6 +1432,12 @@ #else (void) jputchar(*cp); #endif +#ifdef MENU_COLOR + if (iflags.use_menu_color && menucolr) { + if (color != NO_COLOR) term_end_color(); + term_end_attr(attr); + } else +#endif term_end_attr(curr->attr); } } else { @@ -1940,9 +1987,14 @@ 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 +#ifdef HPMON + const char *hp_start = NULL, *hp_end = NULL; + int hpcolor = NO_COLOR, hpattr = ATR_NONE; +#endif /* Assume there's a real problem if the window is missing -- * probably a panic message @@ -1982,7 +2034,54 @@ 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; +#ifdef HPMON +#ifdef TEXTCOLOR + if (iflags.use_color) { + hp_start = strstr(str, +/*JP + "HP:" + */ + "体:" + ); + + if (hp_start) { + int hp, hpmax; + + hp = Upolyd ? u.mh : u.uhp; + hpmax = Upolyd ? u.mhmax : u.uhpmax; + + hp_start += 3; + hp_end = index(hp_start, ' '); + + if(hp == hpmax){ + hpcolor = NO_COLOR; + } else if(hp > (hpmax*2/3)) { + hpcolor = CLR_GREEN; + } else if(hp <= (hpmax/3)) { + hpcolor = CLR_RED; + if(hp<=(hpmax/10)) + hpattr = ATR_BLINK; + } else { + hpcolor = CLR_YELLOW; + } + } + } +#endif /* TEXTCOLOR */ +#endif /* HPMON */ + for(i = cw->curx+1, n0 = cw->cols; i < n0; i++, nb++) { if(!*nb) { if(*ob || flags.botlx) { @@ -1992,6 +2091,17 @@ } break; } +#ifdef HPMON +#ifdef TEXTCOLOR + if (nb == hp_start) { + if (hpcolor != NO_COLOR) term_start_color(hpcolor); + if (hpattr != ATR_NONE) term_start_attr(hpattr); + } else if (nb == hp_end) { + if (hpattr != ATR_NONE) term_end_attr(hpattr); + if (hpcolor != NO_COLOR) term_end_color(); + } +#endif /* TEXTCOLOR */ +#endif /* HPMON */ #if 0 /*JP*/ if(*ob != *nb) #else /* this code updates all status line at any time */ @@ -2034,6 +2144,12 @@ else if (*nb != *ob) #endif tty_putsym(WIN_STATUS, i, cw->cury, *nb); +#ifdef HPMON +#ifdef TEXTCOLOR + else if (hp_end && nb >= hp_start && nb < hp_end) + tty_putsym(WIN_STATUS, i, cw->cury, *nb); +#endif /* TEXTCOLOR */ +#endif /* HPMON */ if(*ob) ob++; }