birther previous_char;
/*!
- * オートローラーの内容を描画する間隔 /
+ * オートローラーの内容を描画する間隔 /
* How often the autoroller will update the display and pause
* to check for user interuptions.
* Bigger values will make the autoroller faster, but slower
*/
#define AUTOROLLER_STEP 5431L
-/*!
- * ランダムクエストのモンスターを確定するために試行する回数 / Maximum number of tries for selection of a proper quest monster
- */
+ /*!
+ * ランダムクエストのモンスターを確定するために試行する回数 / Maximum number of tries for selection of a proper quest monster
+ */
#define MAX_TRIES 100
-/* 選択可能な職業の最大数 */
+ /* 選択可能な職業の最大数 */
#define MAX_CLASS_CHOICE MAX_CLASS
{
#ifdef JP
"人間は基本となるキャラクタです。他の全ての種族は人間と比較されます。人間はどんな職業に就くこともでき、どの職業でも平均的にこなせます。人間は寿命が短いため、レベル上昇が他のどんな種族よりも早くなる傾向があります。また、特別な修正や特性は持っていません。",
-
+
"ハーフエルフは人間より賢いですが、強くはありません。彼らは探索, 解除, 魔法防御, 隠密行動, 射撃, そして魔法道具使用でわずかに優れています。しかし武器の取り扱いはそう得意ではありません。ハーフエルフはどの職業に就くこともでき、生まれつきの特性はありません。",
-
+
"エルフは人間より良い魔法使いになれますが、戦闘は苦手です。彼らは人間やハーフエルフよりも頭が良く、高い賢さを持っています。エルフは探索, 解除, 知覚, 隠密行動, 射撃, そして魔法道具使用で優れていますが、武器の扱いは得意ではありません。彼らは生まれつき光に対する耐性を持っています。",
-
+
"ホビット、またはハーフリングは弓や投擲に長け、魔法防御も優れています。また、探索, 解除, 知覚, そして隠密行動でもとても良い能力を示します。そのため、彼らは優れた盗賊となることができます(しかし、「忍びの者」と呼ばれることを好みます)。ホビットは人間より遥かに貧弱で、戦士としてはてんでダメです。彼らはかなり良い赤外線視力を持っており、温血動物を離れた場所から見つけることができます。彼らは経験値を保持する力が強く、経験値吸収攻撃に対して耐性を持っています。",
-
+
"ノームはドワーフより小さいですが、ホビットよりは大きい種族です。彼らはホビット同様地表の洞穴のような家に住んでいます。ノームはとても良い魔法防御を持ち、探索, 解除, 知覚, 隠密行動でも優れています。彼らは人間より低い腕力を持ち、武器を持っての戦闘は苦手です。ノームはかなり良い赤外線視力を持っており、温血動物を離れた場所から見つけることができます。ノームは生まれつき麻痺に対する耐性を持っています。",
-
+
"ドワーフは頑固な坑夫であり、伝説の戦士です。彼らは人間にくらべ強くタフですが、知能は劣ります。しかし、長命ゆえに彼らは非常に賢いです。彼らは良い魔法防御を持ち、探索, 知覚, 戦闘, 射撃では優れています。彼らは一つ大きな欠点を持っています。ドワーフの隠密行動は絶望的に悪いです。彼らは決して盲目にはなりません。",
-
+
"ハーフオークはよい戦士になれますが、魔法は期待できません。彼らはドワーフと同じくらい隠密行動が悪く、また探索や解除, 知覚もひどいです。ハーフオークは醜く、店での買い物ではより高い金額を要求されがちです。彼らは地下に住むことを好むため、ハーフオークは暗闇に対する耐性を備えています。",
-
+
"ハーフトロルは信じられないほど強く、他の大部分の種族より大きなHPを持ちます。彼らは不運にもとても愚かです。彼らの探索, 解除, 知覚, 隠密行動は悪く、その外見はハーフオークがしかめっ面をするほど醜悪です。ハーフトロルは腕力が下がることがありません。レベルが上がると、彼らは再生能力を手にいれ、戦士ならばさらに遅消化能力も獲得します。",
-
+
"アンバライトは多くのアドバンテージを授けられた、うわさによれば不死の種族です。彼らは知覚, 戦闘, 射撃に優れており、他の面でもかなり熟練しています。事実上あらゆるものを見てきており、新鮮なものはほとんどないため、彼らの成長は他のどの種族より遅いものです。彼らはとてもタフで頑強であり、彼らの耐久力が下がることはありません。また、怪我をすぐに治す再生能力があります。",
-
+
"ハイエルフは世界の始まりから存在する不死の種族です。彼らは全てのスキルに熟達しており、強く、知的で非常に人気があります - 誰もが彼らのことを好いています。ハイエルフは見えないものを見ることができ、普通のエルフ同様光に対する耐性を持っています。しかし、彼らにとって未知のものはほとんどなく、経験を得ることは大変に困難です。",
-
+
"野蛮人は北方から来た頑強な種族です。彼らは激しく戦い、彼らの激怒は世界中で恐れられています。戦闘が彼らの人生です。彼らは恐れを知らず、ハーフトロルよりもすぐに狂暴に戦闘に入ってしまうことを学びます。しかし、野蛮人は魔法を疑っており、そのため魔法の道具を使うことはかなり大変なこととなっています。",
-
+
"ハーフオーガはハーフオークに似ていますが、それだけではありません。彼らは大きく、邪悪で愚かです。戦士としては彼らは必要な資質を全て持っており、また魔法使いになることさえできます。結局、彼らはオーガ・メイジに関係があり、レベルが十分に上がったら彼らから罠のルーンをセットするスキルを学ぶのです。ハーフオークのように、彼らは暗闇に対する耐性を持ち、ハーフトロル同様に腕力が下がることはありません。",
-
+
"半巨人は大変力強いのですが、呪文を唱えられるほど利口ではありません。彼らはよい戦闘能力を持ちますが、それ以外のことは苦手です。彼らの厚い皮膚は破片に対する耐性を持ちます。また、ハーフオーガやハーフトロル同様腕力を下げられることがありません。",
-
+
"巨大なタイタンと人間の子孫であり、この強大な生物は他のほぼ全ての種族よりはるかに勝っています。彼らは多種族にみられるような魅力的な特殊能力は持っていませんが、その大変大きなHPはそれを補ってあまりあります。半タイタンはそこそこのスキルを持っていますが、その巨大さゆえに罠の解除やこっそり歩くことは困難です。法と秩序を愛する彼らは、カオスに対する耐性を持っています。",
-
+
"一つ目ではありますが、サイクロプスは多くの二つの目を持つ生物以上に見ることができます。サイクロプスは非常に力強いのですが、知的であるとはちょっと言えません。彼らに比べれば、ハーフトロルの方がハンサムに見えるということは言うまでもありません。サイクロプスは戦闘, 射撃に優れていますが、その他の大部分のスキルは苦手です。サイクロプスは音に対する耐性を持っています。",
-
+
"イークは最も哀れな生物の一つであり、並のモンスターであっても不注意なイークならば徹底的に打ちのめせるほど肉体的には強くありませんが、彼らはかなり知的でいくらか賢い生物です。イークは戦闘スキルは苦手ですが、他の分野では優れています。彼らの皮膚は、時間とともに酸への耐性を増していき、レベルが十分に上がれば完全に免疫を持つようになります。",
-
+
"クラッコンは奇怪な半知的の昆虫型生物です。彼らはすばらしい戦士になれますが、精神的な能力はひどく制限されています。彼らは探索を除けば大部分のスキルをそこそこにこなします。クラッコンは決して混乱させられることがなく、レベルが上がるごとに速くなります。",
-
+
"コボルドは弱いゴブリンの種族です。彼らは毒を持った武器を好み、毒矢(無制限に供給されます)を投げる能力を身につけることができます。コボルドはそこそこの戦士になれますが、その他のスキルは軒並み悪いです。彼らは生まれつき毒に対する耐性を持っています。",
-
+
"嫌われ、迫害されてきた小人族です。彼らは大抵のスキルをそつなくこなします。洞穴居住者である彼らは、暗闇に悩まされることはありませんし、生まれつき持っている魔法のアイテムに対する嗜好のため、彼らは装備による魔法のボーナスを奪う効果に耐性を持っています。",
-
+
"闇の、洞穴に住む種族であるダークエルフは魔法の知識に対する長い伝統を持っています。ダークエルフは魔法の道具をうまく使うことができ、他の多くの種族より簡単に呪文を唱えられるだけの知能を持っています。その鋭い視覚によって、彼らはハイエルフ同様見えないものをみる能力を学びますが、それはある程度レベルが上がったときです。ダークエルフは暗闇に対する耐性を持っています。",
-
+
"ドラゴンのような特性を持った人間型種族です。彼らはレベルが上がるにつれ、新しい元素への耐性を手にいれます。ドラコニアンは優れた能力値を持ってゲームを開始でき、大抵のスキルをうまくこなせます。その翼で、彼らは簡単に落とし穴や溶岩、水を無傷で飛び越えることができます。",
-
+
"秘密主義の神秘的な古代種族です。彼らの文明はこの惑星上の何よりも古いかもしれません。その肉体的資質は決して誉められたものではありませんが、彼らの知能と賢さはマインドフレアを他のどんな種族よりも強力な魔法使いにします。マインドフレアの知能と賢さは下がることがなく、レベルが上がれば見えないものをみる能力、テレパシー能力を獲得します。",
-
+
"地獄からやってきた悪魔的な生物です。彼らは他の種族から毛嫌いされていますが、大抵の職業をかなりうまくこなすことができます。インプは生まれつき火に耐性を持っており、レベルが上がれば見えないものを見る能力を獲得します。",
-
+
"ゴーレムは泥のような生命のない材料からつくられ、生命を吹き込まれた人工的な生物です。彼らには思考というものがほとんどなく、そのため魔法に依存する職業では役立たずです。しかし戦士としては大変にタフです。彼らは毒に耐性を持ち、見えないものを見ることができ、さらに麻痺知らずです。レベルが上がれば、彼らは生命力吸収攻撃に耐性を持つようになります。ゴーレムは通常の食物からはほとんど栄養を摂取できませんが、代わりに魔法棒や杖から魔力を吸収して動力源にする事ができます。また、その頑丈な身体のため、ACにボーナスを得ることができ、さらに決して気絶させられることがありません。",
-
+
"スケルトンには2つのタイプが存在します。普通の戦士タイプと、リッチと呼ばれる呪文を使うスケルトンです。アンデッドである彼らは、毒や生命力吸収攻撃を心配する必要はありません。彼らは物体を知覚するのに眼を利用していないため、見えない物に騙されません。彼らの骨はとがった破片のようなものに耐性を持ち、レベルが上がれば冷気に対する耐性を獲得します。薬や食物の持つ効果はスケルトンの胃(存在しませんが)を通過することなくその力を発揮しますが、薬や食物自体は彼の顎を通り抜けて落ちてしまい、栄養を吸収することはできません。その代わりに魔法棒や杖から魔力を吸収してエネルギー源にする事ができます。",
-
+
"ゾンビはアンデッドであり、生命力吸収攻撃に耐性を持ち、スケルトンのようにレベルが上がれば冷気の耐性を獲得します。また、毒に耐性を持ち見えないものを見ることができます。(スケルトンとは違い)切る攻撃には弱いですが、地獄に対する耐性を持っています。ゴーレムのように、彼らは食物からほとんど栄養を摂取できませんが、代わりに魔法棒や杖から魔力を吸収してエネルギー源にする事ができます。",
-
+
"強力なアンデッドの一種である吸血鬼は、畏敬の念を呼び起こす外見をしています。アンデッドの例にもれず、彼らも生命力を吸収されることがなく、地獄に対する耐性を持っています。また、冷気と毒に対する耐性も備えています。しかし、新鮮な血液に常に飢えており、それは近くにいる生物から血液を吸うことによってのみ満たされます。この強力な生物は深刻な弱点を持っています。太陽光線(や光源)は彼らの破滅を意味します。幸運にも、吸血鬼はその身体から「暗黒の光」のオーラを放出しています。一方、暗闇は彼らをより強力にするものです。",
-
+
"幽霊は強力なアンデッドの一種です。彼らは不気味な緑色の光に包まれています。半物質的な存在である彼らは、壁を通り抜けることができますが、そのときには壁の密度によって傷つけられてしまいます。他のアンデッド同様、彼らも生命力を吸収されることがなく、見えないものを見ることができ、毒と冷気に対して耐性を備え、さらに地獄に対する耐性も持っています。レベルが十分に上がると彼らはテレパシーを獲得します。幽霊は卓越した魔法使いになることができますが、その身体的特性は非常に貧弱です。彼らは食物からほとんど栄養を摂取できませんが、代わりに魔法棒や杖から魔力を吸収してエネルギー源にする事ができます。",
-
+
"妖精は非常に小さいです。彼らは小さな翼を持ち、罠や危険な地形を飛び越えることができます。彼らは日光を大変好み、光に対する耐性を持っています。身体的にはもっとも貧弱な種族の一つですが、妖精は魔法の面で大変な才能を持っており、非常に熟練した魔法使いになることができます。高レベルではより速く飛ぶことができるようになります。",
-
+
"この種族はカオスによってつくられた冒涜的で嫌悪される存在です。彼らは独立した種族ではなく、人間型種族、大抵は人間がカオスによって歪められた存在、もしくは人間と獣の悪夢のような交配種です。全ての獣人はカオスに盲従しており、そのため混乱と音に対して耐性を備えていますが、純粋なログルスはまだ彼らに対し効果を持っています。獣人は混沌を好み、それは彼らをさらに歪めます。獣人は突然変異を起こしやすい性質を持っています。彼らがつくられたとき、ランダムな変異を受けます。その後、レベルが上がるごとに違う変異を受ける可能性があります。",
-
+
"エントは非常に強く、賢いですが、その巨大さゆえに罠の解除やこっそりと歩くことは苦手です。成長するにつれて腕力や耐久力が上がりますが、器用さは下がっていきます。彼らには大きな欠点があり、炎によって通常よりも大きなダメージを受けてしまいます。彼らは食物からほとんど栄養を摂取できませんが、代わりに薬等から水分を摂取する事で活動できます。",
-
+
"天使の上位種であるアルコンは、全てのスキルに熟達しており、強くて賢く、非常に人気があります。彼らは目に見えないものを見ることができ、その翼で罠や危険な地形を飛び越えることができます。しかし、非常に成長が遅いという欠点もあります。",
-
+
"悪魔の上位種であるバルログは、強く、知的で、またタフでもあります。しかし、彼らは神を信じようとはせず、プリーストには全く向いていません。炎と地獄、経験値吸収への耐性を持っており、レベルが上がれば見えないものを見る能力を獲得します。また、地獄や火炎のブレスを吐くこともできます。彼等はほとんどの技能で優れていますが、静かに歩くことは苦手です。彼らは食物からほとんど栄養を摂取できませんが、人間タイプを生贄にする事で精力を回復する事ができます。",
-
+
"ドゥナダンは西方から来た屈強な種族です。このいにしえの種族は全ての領域において人間の能力を凌駕し、特に耐久力に関してはそれが顕著です。しかしながらこの種族は全てに卓越していることが災いして、この世界には新しい経験といったものがほとんどなく、レベルを上げることが非常に困難です。彼らはとてもタフで頑強であり、彼らの耐久力が下がることはありません。",
-
+
"影フェアリーは人間よりやや大きい妖精族で、翼を持ち、罠や危険な地形を飛び越えることができます。しかし、彼らは日光を嫌い、閃光によって通常よりも大きなダメージを受けてしまいます。肉体的には非常に貧弱ですが、魔法の面では優れた能力を持っています。彼らにはすばらしい長所が一つあり、モンスターの反感をかうような強力なアイテムを装備してもモンスターを怒らせることがありません。ただしその場合でも隠密行動能力が下がり、また、自分自身の性格によって反感をかっている場合には効果がありません。",
-
+
"クターとしている無表情の謎の生物です。彼らは外見がかわいらしいため、魅力が高いです。彼らは混乱しません。なぜなら、混乱してもクターとしているため変わりないからです。しかも、そのクターとしている外見から敵に見つかりにくいです。しかし、彼らは注意力が少ないため探索や知覚能力は悪いです。彼らはレベルが上がると横に伸びてACを上げる技を覚えますが、伸びている間は魔法防御能力は低くなってしまいます。",
-
+
"アンドロイドは機械の身体を持つ人工的な存在です。魔法をうまく使うことはできませんが、戦士としては非常に優れています。彼らは他の種族のように経験値を得て成長するということはありません。身体に身につける装備によって成長します。ただし、指輪、アミュレット、光源は成長に影響しません。彼らは毒の耐性を持ち、麻痺知らずで、生命力を吸収されることがありません。また、身体が頑丈なのでACにボーナスを得ます。しかし身体のいたるところに電子回路が組み込まれているため、電撃によって通常よりも大きなダメージを受けてしまいます。彼らは食物からほとんど動力を得られませんが、油を補給する事で動力源を得る事ができます。",
"マーフォーク実装中",
{
#ifdef JP
"戦士は、直面する問題のほとんどを細切れに叩き切ることで解決するキャラクタです。が、時折退却して魔法の道具の世話になることもあります。不運にも、高レベルなアイテムの多くは彼らが扱える範囲を越えています。",
-
+
"メイジは魔法使いであり、その機知によって生き延びなければなりません。戦士のように、単純に切りまくることで道を開くことは望めません。呪文書に加えて、メイジは助けになる魔法の道具を持ち運ぶべきです。これは他の何よりも遥かに簡単にマスターできます。魔法に必要な能力値は知能です。",
-
+
"プリーストは高貴な力を使うことに専念したキャラクタです。彼らは自身の神のためにダンジョンを探索し、もし宝を手にいれたなら、それは彼が信仰する宗教の栄光となります。プリーストは新しい祈りを神からの贈り物という形で受け取るため、どれを学ぶのか自分で選ぶことはできません。プリーストは魔法の道具の使い方をよく知っていますが、メイジほどうまくは使えません。刃のついた武器より鈍器を好み、祝福されていない刃のついた武器を装備すると不愉快な感覚に襲われ、戦闘能力が落ちてしまいます。魔法に必要な能力値は賢さです。",
-
+
"盗賊はその狡猾さで生き抜くことを好むキャラクタですが、肝心なときには戦闘で道を切り開くことができます、盗賊は罠やドアを見つける能力に優れ、罠の解除や鍵開けに熟達しています。盗賊は高い隠密行動を持ち、たくさんのモンスターの群れのそばを起こすことなく通り抜けたり、忍び寄って先制攻撃することができます。魔法に必要な能力値は知能です。",
-
+
"レンジャーは戦士とメイジを合わせたような職業で、身の回りの自然と特別な関係を作り上げています。彼はより戦士であり、弓のような遠距離武器を巧く使える職業です。レンジャーはよい隠密行動、よい知覚、よい探索、よい魔法防御を持ち、魔法の道具の使用にも長けています。魔法に必要な能力値は知能です。",
-
+
"パラディンは戦士とプリーストを合わせた職業です。パラディンはとてもよい戦士ですが、遠距離武器を扱うのは得意ではありません。パラディンには多くの能力が欠けています。隠密行動, 知覚, 探索, そして魔法道具使用が苦手ですが、その神との提携によって魔法防御はそこそこです。魔法に必要な能力値は賢さです。",
-
+
"魔法戦士はその名称が意味する通りの職業であり、戦士とメイジの資質をあわせ持ちます。彼らの同業者であるレンジャーが自然の魔法と生き抜くためのスキルに特化している一方、本当の魔法剣士はどちらの世界でも一番になろうとしています。戦士としては普通のメイジとは比べ物にならないほど優れています。しかし、実際には魔法でも戦闘でも専門の職業には及ばず、戦士とメイジの中間に位置するような職業です。魔法に必要な能力値は知能です。",
-
+
"混沌の戦士は恐るべきカオスの魔王の使いとして恐れられる存在です。混沌の戦士はパトロンとなる悪魔を持ち、レベルが上がる度に報酬を得ることがあります。彼は治療してくれたり、こちらを変化させたり、能力値を上げてくれるかもしれませんし、回りに怪物達を出現させたり、能力値や装備を奪うかも知れません。もしくは単にこちらを無視するだけかもしれません。カオスの魔王は無秩序で予測のつかない存在です。報酬の種類はパトロンとなる悪魔と偶然に依存します(違う悪魔は異なる報酬を与えます)。魔法に必要な能力値は知能です。",
-
+
"修行僧は他の職業とは著しく異なる職業です。彼らは他の職業同様武器と防具を使えますが、マーシャルアーツの訓練を積んでいるため、武器、防具なしでより強力な存在となります。高レベルでは、必要な耐性を身につけるためある種の防具を装備する必要がありますが、もしあまりに重すぎる防具を装備してしまうと、その体術に深刻な妨げとなります。レベルが上がると、彼らは新しい強力な攻撃法を学び、防御能力も上昇します。魔法に必要な能力値は賢さです。",
-
+
"超能力者は魔法のかわりにその精神の力を使う唯一の職業です。この力は超能力者独特のもので、単に超感覚的なものから他人の精神を支配するものまで様々です。彼らの力はある種の訓練によって開発されるものなので、超能力者は力を使うのに呪文書を必要としません。使える力は単純にキャラクタのレベルによって決まります。超能力に必要な能力値は賢さです。",
-
+
"ハイメイジは一つの領域に特化し、その領域を通常のメイジよりはるかに深く学んだメイジです。1つの領域に特化したおかげで、彼らは自らが選択した領域の呪文を唱える際の消費MP、最低レベル、失敗率で相当な恩恵を受けます。しかし、生命の領域ではプリーストほどうまくはなれないことには注意すべきです。魔法に必要な能力値は知能です。",
-
+
"観光客は観光のためにこの世界にやってきました。戦闘力が低く、強力な呪文を使うこともできないため、最も生きぬいていくのが厳しい職業と言えます。魔法に必要な能力値は知能です。",
-
+
"ものまね師は戦闘力はそこそこありますが、自分から特殊な能力を使うことは全くできません。しかし、自分の目の前にいる相手が特殊能力を使った場合、その能力と全く同じ能力をそっくりそのまま使うことができます。ものまねに必要な能力は基本的に器用さですが、まねる特殊能力に関係ある他の能力も必要です。",
-
+
"魔獣使いは変愚蛮怒世界のダンジョンに住む生物と心を通い合わせられます。彼らは最もうまくモンスターを乗りこなすことができ、召喚したり手なづけたりしたモンスターを自分の手足のように使います。魔法に必要な能力は魅力です。",
-
+
"スペルマスターは全ての魔法を極める者です。彼らは全分野において非常に優れた魔法使いであり、あらゆる魔法書のすべての呪文を学習の手間なく使いこなすことができます。その反面、彼らは戦士としては最低で、どんな武器も満足に扱えません。魔術師の杖だけは例外ですが、武器としては使い物にならないでしょう。すべての魔法をうまく生かさなければならないため、非常に上級者向けな職業と言えます。魔法に必要な能力は知能です。",
-
+
"アーチャーは魔法を使うことはできませんが、どんな職業よりも巧みに弓やスリングを使いこなします。大量の矢や弾を必要とするのは確かですが、岩石からスリング用の弾を作ったり、レベルが上がるとモンスターの骨やがらくたから矢を作ったりする技術を身につけます。また、戦士と比べて隠密行動、知覚、探索、魔法道具の使用などにも優れており、いざというときには魔法の道具に頼ることもできます。",
-
+
"魔道具術師は杖、魔法棒、ロッドといった魔法のアイテムから魔力を取り込むことによって魔法を使います。魔法のアイテムを発見することが他の職業よりもはるかに重要になります。戦闘力は高くはないですが、そこそこの強さがあります。魔法に必要な能力は知能です。",
-
+
"吟遊詩人は魔力を帯びた歌を歌うことができます。多くの歌は普通の魔法と異なり、歌を歌っている間継続して効果を発揮します。しかし、同時に2つの歌を歌うことができない、という欠点もあります。視界内全体に影響を及ぼす歌が多い、という特徴もあります。肉体的な能力は貧弱で、単純に切りまくることで道を開くことはできません。魔法に必要な能力は魅力です。",
-
+
"赤魔道師は下級魔法のほとんどを使うことができ、戦闘力も十分にあります。レベルが上がると強力な能力「連続魔」を身につけることができます。しかし、魔法を覚えるスピードは遅く、上級魔法を使えないので、メイジほどには魔法を頼りにすることができません。魔法道具使用と魔法防御はそこそこですが、それ以外の技能は苦手です。魔法に必要な能力は知能です。",
-
+
"剣術家は戦士に次ぐ戦闘力があり、様々な技を使うことができます。彼らのMPはレベルに依存せず、賢さだけで決まり、気合いをためることにより、最大値を越えてMPを増やすことができます。しかし、戦士と同様、高レベルの魔法のアイテムは彼らの扱える範囲を越えており、罠の解除や探索の能力も高いとはいえません。必殺技の使用に必要な能力は賢さです。",
-
+
"練気術師は「気」を使う達人です。修行僧と同様、武器や防具を持たずに戦うことを好み、武器・防具なしでより強力な存在となります。修行僧ほどの戦闘能力はありませんが、修行僧と同様の魔法が使え、さらに「気」の力を操ります。武器を持つことや、重すぎる防具を装備することは、「気」の力の使用を妨げます。魔法と練気術に必要な能力は賢さです。",
-
+
"青魔道師は優れた魔法使いであり、その機知によって生き延びなければなりません。メイジ等の他の魔法使いとの違いは魔法の覚え方で、青魔道師はモンスターの魔法の効果を受けることでその魔法を覚えます。覚えるためには「ラーニング」の状態になっていないといけません。魔法に必要な能力は知能です。",
-
+
"騎兵は馬に乗り戦場を駆け抜けるエリート戦士です。魔法は使えませんが、馬上からの圧倒的な攻撃力を誇る上に、高い機動力を生かした射撃をも得意としています。レベルが上がれば、野生のモンスターにまたがり無理矢理手なずけることができます。彼らは己の肉体と精神に誇りを持ち、魔法道具にはあまり頼ろうとはしません。",
-
+
"狂戦士は怒り狂って武器を振るう恐るべき戦士です。全職業中最高の肉体能力を誇り、恐怖と麻痺に対する耐性を持ち、レベルが上がればその強靭な肉体で矢の呪文を跳ね返すことができます。さらに武器なしで戦うことや、呪いのかけられた装備を力づくで剥がすことができ、いくつかの技を(反魔法状態でも)使うことができます。しかし、巻物や魔法道具は全く使うことができず、罠の解除や隠密行動、探索、魔法防御、飛び道具の技能に関しては絶望的です。ひたすら殴って道を開くしかありません。幽霊は非常に勝利しやすいですがスコアがかなり低く修正されます。",
"鍛冶師は武器や防具を自分で強化することができます。特殊効果を持つ武器や防具から特殊効果の元となるエッセンスを取り出し、別の武器や防具にエッセンスを付加することによってその特殊効果を付加できます。ある程度の戦闘能力も持ちますが、魔法は一切使用できず、隠密や魔法防御の技能も低くなります。",
/*! オートローラの試行回数 / Autoroll round */
static s32b auto_round;
-/*!
+/*!
* @brief プレイヤー作成を中断して変愚蛮怒を終了する
* @return なし
*/
*/
static byte choose_realm(player_type *creature_ptr, s32b choices, int *count)
{
- int picks[VALID_REALM] = {0};
+ int picks[VALID_REALM] = { 0 };
int k, i, cs, os;
byte auto_select = REALM_NONE;
int n = 0;
}
/* Extra info */
- put_str (_("注意:魔法の領域の選択によりあなたが習得する呪文のタイプが決まります。", "Note: The realm of magic will determine which spells you can learn."), 23, 5);
+ put_str(_("注意:魔法の領域の選択によりあなたが習得する呪文のタイプが決まります。", "Note: The realm of magic will determine which spells you can learn."), 23, 5);
cs = 0;
for (i = 0; i < 32; i++)
/* Analize realms */
if (choices & (1L << i))
{
- if (creature_ptr->realm1 == i+1)
+ if (creature_ptr->realm1 == i + 1)
{
if (creature_ptr->realm2 == 255)
cs = n;
else
continue;
}
- if (creature_ptr->realm2 == i+1)
+ if (creature_ptr->realm2 == i + 1)
cs = n;
sym[n] = I2A(n);
- sprintf(buf, "%c%c %s", sym[n], p2, realm_names[i+1]);
- put_str(buf, 12 + (n/5), 2 + 15 * (n%5));
- picks[n++] = i+1;
+ sprintf(buf, "%c%c %s", sym[n], p2, realm_names[i + 1]);
+ put_str(buf, 12 + (n / 5), 2 + 15 * (n % 5));
+ picks[n++] = i + 1;
}
}
sprintf(cur, "%c%c %s", '*', p2, _("ランダム", "Random"));
/* Get a realm */
k = -1;
os = n;
- while (TRUE) {
+ while (TRUE) {
/* Move Cursol */
if (cs != os)
{
- c_put_str(TERM_WHITE, cur, 12 + (os/5), 2 + 15 * (os%5));
+ c_put_str(TERM_WHITE, cur, 12 + (os / 5), 2 + 15 * (os % 5));
put_str(" ", 3, 40);
put_str(" ", 4, 40);
- if(cs == n)
+ if (cs == n)
{
sprintf(cur, "%c%c %s", '*', p2, _("ランダム", "Random"));
}
sprintf(buf, "%s", realm_names[picks[cs]]);
#ifdef JP
c_put_str(TERM_L_BLUE, buf, 3, 40);
- put_str("の特徴", 3, 40+strlen(buf));
+ put_str("の特徴", 3, 40 + strlen(buf));
#else
c_put_str(TERM_L_BLUE, realm_names[picks[cs]], 3, 40);
- put_str(": Characteristic", 3, 40+strlen(realm_names[picks[cs]]));
+ put_str(": Characteristic", 3, 40 + strlen(realm_names[picks[cs]]));
#endif
- put_str(realm_subinfo[technic2magic(picks[cs])-1], 4, 40);
+ put_str(realm_subinfo[technic2magic(picks[cs]) - 1], 4, 40);
}
- c_put_str(TERM_YELLOW, cur, 12 + (cs/5), 2 + 15 * (cs%5));
+ c_put_str(TERM_YELLOW, cur, 12 + (cs / 5), 2 + 15 * (cs % 5));
os = cs;
}
if (k >= 0) break;
- sprintf(buf, _("領域を選んで下さい(%c-%c) ('='初期オプション設定): ", "Choose a realm (%c-%c) ('=' for options): "), sym[0], sym[n-1]);
+ sprintf(buf, _("領域を選んで下さい(%c-%c) ('='初期オプション設定): ", "Choose a realm (%c-%c) ('=' for options): "), sym[0], sym[n - 1]);
put_str(buf, 10, 10);
c = inkey();
if (c == 'S') return 255;
if (c == ' ' || c == '\r' || c == '\n')
{
- if(cs == n)
+ if (cs == n)
{
k = randint0(n);
break;
screen_load();
}
- else if (c !='2' && c !='4' && c !='6' && c !='8') bell();
+ else if (c != '2' && c != '4' && c != '6' && c != '8') bell();
}
/* Clean up */
creature_ptr->realm2 = 255;
while (TRUE)
{
- char temp[80*10];
+ char temp[80 * 10];
concptr t;
count = 0;
creature_ptr->realm1 = choose_realm(creature_ptr, realm_choices1[creature_ptr->pclass], &count);
put_str(" ", 4, 40);
put_str(" ", 5, 40);
- roff_to_buf(realm_jouhou[technic2magic(creature_ptr->realm1)-1], 74, temp, sizeof(temp));
+ roff_to_buf(realm_jouhou[technic2magic(creature_ptr->realm1) - 1], 74, temp, sizeof(temp));
t = temp;
for (i = 0; i < 10; i++)
{
- if(t[0] == 0)
- break;
+ if (t[0] == 0)
+ break;
else
{
- prt(t, 12+i, 3);
+ prt(t, 12 + i, 3);
t += strlen(t) + 1;
}
}
/* Select the second realm */
while (TRUE)
{
- char temp[80*8];
+ char temp[80 * 8];
concptr t;
count = 0;
put_str(" ", 4, 40);
put_str(" ", 5, 40);
- roff_to_buf(realm_jouhou[technic2magic(creature_ptr->realm2)-1], 74, temp, sizeof(temp));
+ roff_to_buf(realm_jouhou[technic2magic(creature_ptr->realm2) - 1], 74, temp, sizeof(temp));
t = temp;
for (i = 0; i < A_MAX; i++)
{
- if(t[0] == 0)
- break;
+ if (t[0] == 0)
+ break;
else
{
- prt(t, 12+i, 3);
+ prt(t, 12 + i, 3);
t += strlen(t) + 1;
}
}
/* Apply penalty */
for (i = 0; i < (0 - amount); i++)
{
- if (value >= 18+10)
+ if (value >= 18 + 10)
{
value -= 10;
}
/* Roll some dice */
for (i = 0; i < 2; i++)
{
- s32b tmp = randint0(60*60*60);
+ s32b tmp = randint0(60 * 60 * 60);
BASE_STATUS val;
/* Extract 5 + 1d3 + 1d4 + 1d5 */
/* Save that value */
sum += val;
- creature_ptr->stat_cur[3*i] = creature_ptr->stat_max[3*i] = val;
+ creature_ptr->stat_cur[3 * i] = creature_ptr->stat_max[3 * i] = val;
/* Extract 5 + 1d3 + 1d4 + 1d5 */
val = 5 + 3;
/* Save that value */
sum += val;
- creature_ptr->stat_cur[3*i+1] = creature_ptr->stat_max[3*i+1] = val;
+ creature_ptr->stat_cur[3 * i + 1] = creature_ptr->stat_max[3 * i + 1] = val;
/* Extract 5 + 1d3 + 1d4 + 1d5 */
val = 5 + 3;
/* Save that value */
sum += val;
- creature_ptr->stat_cur[3*i+2] = creature_ptr->stat_max[3*i+2] = val;
+ creature_ptr->stat_cur[3 * i + 2] = creature_ptr->stat_max[3 * i + 2] = val;
}
/* Verify totals */
- if ((sum > 42+5*6) && (sum < 57+5*6)) break;
+ if ((sum > 42 + 5 * 6) && (sum < 57 + 5 * 6)) break;
/* 57 was 54... I hate 'magic numbers' :< TY */
}
}
/* Acquire the stats */
for (i = 0; i < A_MAX; i++)
{
- BASE_STATUS max_max = 18 + 60 + dice[i]*10;
+ BASE_STATUS max_max = 18 + 60 + dice[i] * 10;
/* Save that value */
creature_ptr->stat_max_max[i] = max_max;
for (i = 0; i < 5; i++)
for (j = 0; j < 64; j++)
creature_ptr->weapon_exp[i][j] = s_info[creature_ptr->pclass].w_start[i][j];
- if ((creature_ptr->pseikaku == SEIKAKU_SEXY) && (creature_ptr->weapon_exp[TV_HAFTED-TV_WEAPON_BEGIN][SV_WHIP] < WEAPON_EXP_BEGINNER))
+ if ((creature_ptr->pseikaku == SEIKAKU_SEXY) && (creature_ptr->weapon_exp[TV_HAFTED - TV_WEAPON_BEGIN][SV_WHIP] < WEAPON_EXP_BEGINNER))
{
- creature_ptr->weapon_exp[TV_HAFTED-TV_WEAPON_BEGIN][SV_WHIP] = WEAPON_EXP_BEGINNER;
+ creature_ptr->weapon_exp[TV_HAFTED - TV_WEAPON_BEGIN][SV_WHIP] = WEAPON_EXP_BEGINNER;
}
for (i = 0; i < GINOU_MAX; i++)
/* Hitdice */
if (creature_ptr->pclass == CLASS_SORCERER)
- creature_ptr->hitdie = rp_ptr->r_mhp/2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
+ creature_ptr->hitdie = rp_ptr->r_mhp / 2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
else
creature_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
/* Starting place */
switch (creature_ptr->prace)
{
- case RACE_AMBERITE:
- {
- chart = 67;
- break;
- }
- case RACE_HUMAN:
- case RACE_BARBARIAN:
- case RACE_DUNADAN:
- case RACE_MERFOLK:
- {
- chart = 1;
- break;
- }
- case RACE_HALF_ELF:
- {
- chart = 4;
- break;
- }
- case RACE_ELF:
- case RACE_HIGH_ELF:
- {
- chart = 7;
- break;
- }
- case RACE_HOBBIT:
- {
- chart = 10;
- break;
- }
- case RACE_GNOME:
- {
- chart = 13;
- break;
- }
- case RACE_DWARF:
- {
- chart = 16;
- break;
- }
- case RACE_HALF_ORC:
- {
- chart = 19;
- break;
- }
- case RACE_HALF_TROLL:
- {
- chart = 22;
- break;
- }
- case RACE_DARK_ELF:
- {
- chart = 69;
- break;
- }
- case RACE_HALF_OGRE:
- {
- chart = 74;
- break;
- }
- case RACE_HALF_GIANT:
- {
- chart = 75;
- break;
- }
- case RACE_HALF_TITAN:
- {
- chart = 76;
- break;
- }
- case RACE_CYCLOPS:
- {
- chart = 77;
- break;
- }
- case RACE_YEEK:
- {
- chart = 78;
- break;
- }
- case RACE_KOBOLD:
- {
- chart = 82;
- break;
- }
- case RACE_KLACKON:
- {
- chart = 84;
- break;
- }
- case RACE_NIBELUNG:
- {
- chart = 87;
- break;
- }
- case RACE_DRACONIAN:
- {
- chart = 89;
- break;
- }
- case RACE_MIND_FLAYER:
- {
- chart = 92;
- break;
- }
- case RACE_IMP:
- {
- chart = 94;
- break;
- }
- case RACE_GOLEM:
- {
- chart = 98;
- break;
- }
- case RACE_SKELETON:
- {
- chart = 102;
- break;
- }
- case RACE_ZOMBIE:
- {
- chart = 107;
- break;
- }
- case RACE_VAMPIRE:
- {
- chart = 113;
- break;
- }
- case RACE_SPECTRE:
- {
- chart = 118;
- break;
- }
- case RACE_SPRITE:
- {
- chart = 124;
- break;
- }
- case RACE_BEASTMAN:
- {
- chart = 129;
- break;
- }
- case RACE_ENT:
- {
- chart = 137;
- break;
- }
- case RACE_ANGEL:
- {
- chart = 142;
- break;
- }
- case RACE_DEMON:
- {
- chart = 145;
- break;
- }
- case RACE_S_FAIRY:
- {
- chart = 148;
- break;
- }
- case RACE_KUTAR:
- {
- chart = 154;
- break;
- }
- case RACE_ANDROID:
- {
- chart = 155;
- break;
- }
- default:
- {
- chart = 0;
- break;
- }
+ case RACE_AMBERITE:
+ {
+ chart = 67;
+ break;
+ }
+ case RACE_HUMAN:
+ case RACE_BARBARIAN:
+ case RACE_DUNADAN:
+ case RACE_MERFOLK:
+ {
+ chart = 1;
+ break;
+ }
+ case RACE_HALF_ELF:
+ {
+ chart = 4;
+ break;
+ }
+ case RACE_ELF:
+ case RACE_HIGH_ELF:
+ {
+ chart = 7;
+ break;
+ }
+ case RACE_HOBBIT:
+ {
+ chart = 10;
+ break;
+ }
+ case RACE_GNOME:
+ {
+ chart = 13;
+ break;
+ }
+ case RACE_DWARF:
+ {
+ chart = 16;
+ break;
+ }
+ case RACE_HALF_ORC:
+ {
+ chart = 19;
+ break;
+ }
+ case RACE_HALF_TROLL:
+ {
+ chart = 22;
+ break;
+ }
+ case RACE_DARK_ELF:
+ {
+ chart = 69;
+ break;
+ }
+ case RACE_HALF_OGRE:
+ {
+ chart = 74;
+ break;
+ }
+ case RACE_HALF_GIANT:
+ {
+ chart = 75;
+ break;
+ }
+ case RACE_HALF_TITAN:
+ {
+ chart = 76;
+ break;
+ }
+ case RACE_CYCLOPS:
+ {
+ chart = 77;
+ break;
+ }
+ case RACE_YEEK:
+ {
+ chart = 78;
+ break;
+ }
+ case RACE_KOBOLD:
+ {
+ chart = 82;
+ break;
+ }
+ case RACE_KLACKON:
+ {
+ chart = 84;
+ break;
+ }
+ case RACE_NIBELUNG:
+ {
+ chart = 87;
+ break;
+ }
+ case RACE_DRACONIAN:
+ {
+ chart = 89;
+ break;
+ }
+ case RACE_MIND_FLAYER:
+ {
+ chart = 92;
+ break;
+ }
+ case RACE_IMP:
+ {
+ chart = 94;
+ break;
+ }
+ case RACE_GOLEM:
+ {
+ chart = 98;
+ break;
+ }
+ case RACE_SKELETON:
+ {
+ chart = 102;
+ break;
+ }
+ case RACE_ZOMBIE:
+ {
+ chart = 107;
+ break;
+ }
+ case RACE_VAMPIRE:
+ {
+ chart = 113;
+ break;
+ }
+ case RACE_SPECTRE:
+ {
+ chart = 118;
+ break;
+ }
+ case RACE_SPRITE:
+ {
+ chart = 124;
+ break;
+ }
+ case RACE_BEASTMAN:
+ {
+ chart = 129;
+ break;
+ }
+ case RACE_ENT:
+ {
+ chart = 137;
+ break;
+ }
+ case RACE_ANGEL:
+ {
+ chart = 142;
+ break;
+ }
+ case RACE_DEMON:
+ {
+ chart = 145;
+ break;
+ }
+ case RACE_S_FAIRY:
+ {
+ chart = 148;
+ break;
+ }
+ case RACE_KUTAR:
+ {
+ chart = 154;
+ break;
+ }
+ case RACE_ANDROID:
+ {
+ chart = 155;
+ break;
+ }
+ default:
+ {
+ chart = 0;
+ break;
+ }
}
/* Kill trailing spaces */
- while ((n > 0) && (s[n-1] == ' ')) s[--n] = '\0';
+ while ((n > 0) && (s[n - 1] == ' ')) s[--n] = '\0';
- {
- char temp[64*4];
- roff_to_buf(s, 60, temp, sizeof(temp));
- t = temp;
- for(i=0 ; i<4 ; i++){
- if(t[0]==0)break;
- else {strcpy(creature_ptr->history[i], t);t += strlen(t)+1;}
- }
- }
+ {
+ char temp[64 * 4];
+ roff_to_buf(s, 60, temp, sizeof(temp));
+ t = temp;
+ for (i = 0; i < 4; i++) {
+ if (t[0] == 0)break;
+ else { strcpy(creature_ptr->history[i], t); t += strlen(t) + 1; }
+ }
+ }
}
/*!
{
creature_ptr->ht = randnor(rp_ptr->m_b_ht, rp_ptr->m_m_ht);
h_percent = (int)(creature_ptr->ht) * 100 / (int)(rp_ptr->m_b_ht);
- creature_ptr->wt = randnor((int)(rp_ptr->m_b_wt) * h_percent /100
- , (int)(rp_ptr->m_m_wt) * h_percent / 300 );
+ creature_ptr->wt = randnor((int)(rp_ptr->m_b_wt) * h_percent / 100
+ , (int)(rp_ptr->m_m_wt) * h_percent / 300);
}
-
+
/* Calculate the height/weight for females */
else if (creature_ptr->psex == SEX_FEMALE)
{
creature_ptr->ht = randnor(rp_ptr->f_b_ht, rp_ptr->f_m_ht);
h_percent = (int)(creature_ptr->ht) * 100 / (int)(rp_ptr->f_b_ht);
- creature_ptr->wt = randnor((int)(rp_ptr->f_b_wt) * h_percent /100
- , (int)(rp_ptr->f_m_wt) * h_percent / 300 );
+ creature_ptr->wt = randnor((int)(rp_ptr->f_b_wt) * h_percent / 100
+ , (int)(rp_ptr->f_m_wt) * h_percent / 300);
}
}
/* Social Class determines starting gold */
gold = (creature_ptr->sc * 6) + randint1(100) + 300;
if (creature_ptr->pclass == CLASS_TOURIST)
- gold += 2000;
+ gold += 2000;
/* Process the stats */
for (i = 0; i < A_MAX; i++)
/* Put the stat */
cnv_stat(m, buf);
- c_put_str(TERM_L_GREEN, buf, 3+i, col+24);
+ c_put_str(TERM_L_GREEN, buf, 3 + i, col + 24);
/* Put the percent */
if (stat_match[i])
{
p = 1000L * stat_match[i] / auto_round;
}
-
+
attr = (p < 100) ? TERM_YELLOW : TERM_L_GREEN;
- sprintf(buf, "%3d.%d%%", p/10, p%10);
- c_put_str(attr, buf, 3+i, col+13);
+ sprintf(buf, "%3d.%d%%", p / 10, p % 10);
+ c_put_str(attr, buf, 3 + i, col + 13);
}
/* Never happened */
else
{
- c_put_str(TERM_RED, _("(なし)", "(NONE)"), 3+i, col+13);
+ c_put_str(TERM_RED, _("(なし)", "(NONE)"), 3 + i, col + 13);
}
}
}
for (i = 0; i < max_q_idx; i++)
{
quest_type* const q_ptr = &quest[i];
-
+
q_ptr->status = QUEST_STATUS_UNTAKEN;
q_ptr->cur_num = 0;
creature_ptr->muta3 = 0;
/* Reset virtues */
- for (i = 0; i < 8; i++) creature_ptr->virtues[i]=0;
+ for (i = 0; i < 8; i++) creature_ptr->virtues[i] = 0;
creature_ptr->dungeon_idx = 0;
(creature_ptr->prace == RACE_SPECTRE))
{
/* Undead start just after midnight */
- current_world_ptr->game_turn = (TURNS_PER_TICK*3 * TOWN_DAWN) / 4 + 1;
+ current_world_ptr->game_turn = (TURNS_PER_TICK * 3 * TOWN_DAWN) / 4 + 1;
current_world_ptr->game_turn_limit = TURNS_PER_TICK * TOWN_DAWN * MAX_DAYS + TURNS_PER_TICK * TOWN_DAWN * 3 / 4;
}
else
* @brief 所持状態にあるアイテムの中から一部枠の装備可能なものを装備させる。
* @return なし
*/
-static void wield_all(player_type *creature_ptr)
-{
- object_type *o_ptr;
- object_type *i_ptr;
- object_type object_type_body;
-
- int slot;
- INVENTORY_IDX item;
-
- /* Scan through the slots backwards */
- for (item = INVEN_PACK - 1; item >= 0; item--)
- {
- o_ptr = &creature_ptr->inventory_list[item];
-
- /* Skip non-objects */
- if (!o_ptr->k_idx) continue;
-
- /* Make sure we can wield it and that there's nothing else in that slot */
- slot = wield_slot(creature_ptr, o_ptr);
- if (slot < INVEN_RARM) continue;
+static void wield_all(player_type *creature_ptr)
+{
+ object_type *o_ptr;
+ object_type *i_ptr;
+ object_type object_type_body;
+
+ int slot;
+ INVENTORY_IDX item;
+
+ /* Scan through the slots backwards */
+ for (item = INVEN_PACK - 1; item >= 0; item--)
+ {
+ o_ptr = &creature_ptr->inventory_list[item];
+
+ /* Skip non-objects */
+ if (!o_ptr->k_idx) continue;
+
+ /* Make sure we can wield it and that there's nothing else in that slot */
+ slot = wield_slot(creature_ptr, o_ptr);
+ if (slot < INVEN_RARM) continue;
if (slot == INVEN_LITE) continue; /* Does not wield toaches because buys a lantern soon */
- if (creature_ptr->inventory_list[slot].k_idx) continue;
-
- i_ptr = &object_type_body;
- object_copy(i_ptr, o_ptr);
- i_ptr->number = 1;
-
- /* Decrease the item (from the pack) */
- if (item >= 0)
- {
- inven_item_increase(creature_ptr, item, -1);
- inven_item_optimize(creature_ptr, item);
- }
-
- /* Decrease the item (from the floor) */
- else
- {
- floor_item_increase(creature_ptr->current_floor_ptr, 0 - item, -1);
+ if (creature_ptr->inventory_list[slot].k_idx) continue;
+
+ i_ptr = &object_type_body;
+ object_copy(i_ptr, o_ptr);
+ i_ptr->number = 1;
+
+ /* Decrease the item (from the pack) */
+ if (item >= 0)
+ {
+ inven_item_increase(creature_ptr, item, -1);
+ inven_item_optimize(creature_ptr, item);
+ }
+
+ /* Decrease the item (from the floor) */
+ else
+ {
+ floor_item_increase(creature_ptr->current_floor_ptr, 0 - item, -1);
floor_item_optimize(creature_ptr->current_floor_ptr, 0 - item);
- }
-
- o_ptr = &creature_ptr->inventory_list[slot];
- object_copy(o_ptr, i_ptr);
- creature_ptr->total_weight += i_ptr->weight;
-
- /* Increment the equip counter by hand */
+ }
+
+ o_ptr = &creature_ptr->inventory_list[slot];
+ object_copy(o_ptr, i_ptr);
+ creature_ptr->total_weight += i_ptr->weight;
+
+ /* Increment the equip counter by hand */
creature_ptr->equip_cnt++;
- }
- return;
-}
+ }
+ return;
+}
/*!
/* Auto-inscription */
autopick_alter_item(creature_ptr, slot, FALSE);
- /* Now try wielding everything */
- wield_all(creature_ptr);
+ /* Now try wielding everything */
+ wield_all(creature_ptr);
}
/* Demon can drain vitality from humanoid corpse */
get_mon_num_prep(monster_hook_human, NULL);
- for (i = rand_range(3,4); i > 0; i--)
+ for (i = rand_range(3, 4); i > 0; i--)
{
object_prep(q_ptr, lookup_kind(TV_CORPSE, SV_CORPSE));
q_ptr->pval = get_mon_num(2);
- if(q_ptr->pval)
+ if (q_ptr->pval)
{
q_ptr->number = 1;
add_outfit(creature_ptr, q_ptr);
else if (creature_ptr->pclass == CLASS_SORCERER)
{
OBJECT_TYPE_VALUE book_tval;
- for (book_tval = TV_LIFE_BOOK; book_tval <= TV_LIFE_BOOK+MAX_MAGIC-1; book_tval++)
+ for (book_tval = TV_LIFE_BOOK; book_tval <= TV_LIFE_BOOK + MAX_MAGIC - 1; book_tval++)
{
/* Hack -- Give the player some arrows */
object_prep(q_ptr, lookup_kind(book_tval, 0));
add_outfit(creature_ptr, q_ptr);
}
- if(creature_ptr->pseikaku == SEIKAKU_SEXY)
+ if (creature_ptr->pseikaku == SEIKAKU_SEXY)
{
player_init[creature_ptr->pclass][2][0] = TV_HAFTED;
player_init[creature_ptr->pclass][2][1] = SV_WHIP;
else if (tv == TV_DEATH_BOOK) tv = TV_LIFE_BOOK + creature_ptr->realm2 - 1;
else if (tv == TV_RING && sv == SV_RING_RES_FEAR &&
- creature_ptr->prace == RACE_BARBARIAN)
+ creature_ptr->prace == RACE_BARBARIAN)
/* Barbarians do not need a ring of resist fear */
sv = SV_RING_SUSTAIN_STR;
/* Move Cursol */
if (cs != os)
{
- c_put_str(TERM_WHITE, cur, 12 + (os/5), 1 + 16 * (os%5));
+ c_put_str(TERM_WHITE, cur, 12 + (os / 5), 1 + 16 * (os % 5));
put_str(" ", 3, 40);
- if(cs == MAX_RACES)
+ if (cs == MAX_RACES)
{
sprintf(cur, "%c%c%s", '*', p2, _("ランダム", "Random"));
put_str(" ", 4, 40);
rp_ptr->r_adj[4], rp_ptr->r_adj[5], (rp_ptr->r_exp - 100));
c_put_str(TERM_L_BLUE, buf, 5, 40);
}
- c_put_str(TERM_YELLOW, cur, 12 + (cs/5), 1 + 16 * (cs%5));
+ c_put_str(TERM_YELLOW, cur, 12 + (cs / 5), 1 + 16 * (cs % 5));
os = cs;
}
if (k >= 0) break;
- sprintf(buf, _("種族を選んで下さい (%c-%c) ('='初期オプション設定): ", "Choose a race (%c-%c) ('=' for options): "), sym[0], sym[MAX_RACES-1]);
+ sprintf(buf, _("種族を選んで下さい (%c-%c) ('='初期オプション設定): ", "Choose a race (%c-%c) ('=' for options): "), sym[0], sym[MAX_RACES - 1]);
put_str(buf, 10, 10);
c = inkey();
if (c == 'S') return FALSE;
if (c == ' ' || c == '\r' || c == '\n')
{
- if(cs == MAX_RACES)
+ if (cs == MAX_RACES)
{
k = randint0(MAX_RACES);
cs = k;
do_cmd_options_aux(OPT_PAGE_BIRTH, _("初期オプション((*)はスコアに影響)", "Birth Option((*)s effect score)"));
screen_load();
}
- else if (c !='2' && c !='4' && c !='6' && c !='8') bell();
+ else if (c != '2' && c != '4' && c != '6' && c != '8') bell();
}
/* Set race */
put_str(_("注意:《職業》によってキャラクターの先天的な能力やボーナスが変化します。",
"Note: Your 'class' determines various intrinsic abilities and bonuses."), 23, 5);
- put_str(_("()で囲まれた選択肢はこの種族には似合わない職業です。",
+ put_str(_("()で囲まれた選択肢はこの種族には似合わない職業です。",
"Any entries in parentheses should only be used by advanced players."), 11, 5);
else
sprintf(buf, "%c%c%s", sym[n], p2, str);
- put_str(buf, 13+ (n/4), 2 + 19 * (n%4));
+ put_str(buf, 13 + (n / 4), 2 + 19 * (n % 4));
}
sprintf(cur, "%c%c%s", '*', p2, _("ランダム", "Random"));
/* Move Cursol */
if (cs != os)
{
- c_put_str(TERM_WHITE, cur, 13 + (os/4), 2 + 19 * (os%4));
+ c_put_str(TERM_WHITE, cur, 13 + (os / 4), 2 + 19 * (os % 4));
put_str(" ", 3, 40);
- if(cs == MAX_CLASS_CHOICE)
+ if (cs == MAX_CLASS_CHOICE)
{
sprintf(cur, "%c%c%s", '*', p2, _("ランダム", "Random"));
put_str(" ", 4, 40);
if (k >= 0) break;
- sprintf(buf, _("職業を選んで下さい (%c-%c) ('='初期オプション設定): ", "Choose a class (%c-%c) ('=' for options): "), sym[0], sym[MAX_CLASS_CHOICE-1]);
+ sprintf(buf, _("職業を選んで下さい (%c-%c) ('='初期オプション設定): ", "Choose a class (%c-%c) ('=' for options): "), sym[0], sym[MAX_CLASS_CHOICE - 1]);
put_str(buf, 10, 10);
c = inkey();
if (c == 'S') return FALSE;
if (c == ' ' || c == '\r' || c == '\n')
{
- if(cs == MAX_CLASS_CHOICE)
+ if (cs == MAX_CLASS_CHOICE)
{
k = randint0(MAX_CLASS_CHOICE);
cs = k;
do_cmd_options_aux(OPT_PAGE_BIRTH, _("初期オプション((*)はスコアに影響)", "Birth Option((*)s effect score)"));
screen_load();
}
- else if (c !='2' && c !='4' && c !='6' && c !='8') bell();
+ else if (c != '2' && c != '4' && c != '6' && c != '8') bell();
}
/* Set class */
/* Dump seikakus */
for (n = 0; n < MAX_SEIKAKU; n++)
{
- if(seikaku_info[n].sex && (seikaku_info[n].sex != (creature_ptr->psex+1))) continue;
+ if (seikaku_info[n].sex && (seikaku_info[n].sex != (creature_ptr->psex + 1))) continue;
/* Analyze */
ap_ptr = &seikaku_info[n];
/* Display */
sprintf(buf, "%c%c%s", I2A(n), p2, str);
- put_str(buf, 12 + (n/4), 2 + 18 * (n%4));
+ put_str(buf, 12 + (n / 4), 2 + 18 * (n % 4));
}
sprintf(cur, "%c%c%s", '*', p2, _("ランダム", "Random"));
/* Move Cursol */
if (cs != os)
{
- c_put_str(TERM_WHITE, cur, 12 + (os/4), 2 + 18 * (os%4));
+ c_put_str(TERM_WHITE, cur, 12 + (os / 4), 2 + 18 * (os % 4));
put_str(" ", 3, 40);
- if(cs == MAX_SEIKAKU)
+ if (cs == MAX_SEIKAKU)
{
sprintf(cur, "%c%c%s", '*', p2, _("ランダム", "Random"));
put_str(" ", 4, 40);
str = ap_ptr->title;
sprintf(cur, "%c%c%s", sym[cs], p2, str);
c_put_str(TERM_L_BLUE, ap_ptr->title, 3, 40);
- put_str(_("の性格修正", ": Personality modification"), 3, 40+strlen(ap_ptr->title));
+ put_str(_("の性格修正", ": Personality modification"), 3, 40 + strlen(ap_ptr->title));
put_str(_("腕力 知能 賢さ 器用 耐久 魅力 ", "Str Int Wis Dex Con Chr "), 4, 40);
sprintf(buf, "%+3d %+3d %+3d %+3d %+3d %+3d ",
ap_ptr->a_adj[0], ap_ptr->a_adj[1], ap_ptr->a_adj[2], ap_ptr->a_adj[3],
ap_ptr->a_adj[4], ap_ptr->a_adj[5]);
c_put_str(TERM_L_BLUE, buf, 5, 40);
}
- c_put_str(TERM_YELLOW, cur, 12 + (cs/4), 2 + 18 * (cs%4));
+ c_put_str(TERM_YELLOW, cur, 12 + (cs / 4), 2 + 18 * (cs % 4));
os = cs;
}
if (k >= 0) break;
- sprintf(buf, _("性格を選んで下さい (%c-%c) ('='初期オプション設定): ", "Choose a personality (%c-%c) ('=' for options): "), sym[0], sym[MAX_SEIKAKU-1]);
+ sprintf(buf, _("性格を選んで下さい (%c-%c) ('='初期オプション設定): ", "Choose a personality (%c-%c) ('=' for options): "), sym[0], sym[MAX_SEIKAKU - 1]);
put_str(buf, 10, 10);
c = inkey();
if (c == 'S') return FALSE;
if (c == ' ' || c == '\r' || c == '\n')
{
- if(cs == MAX_SEIKAKU)
+ if (cs == MAX_SEIKAKU)
{
do
{
k = randint0(MAX_SEIKAKU);
- }
- while(seikaku_info[k].sex && (seikaku_info[k].sex != (creature_ptr->psex+1)));
+ } while (seikaku_info[k].sex && (seikaku_info[k].sex != (creature_ptr->psex + 1)));
cs = k;
continue;
}
do
{
k = randint0(n);
- }
- while(seikaku_info[k].sex && (seikaku_info[k].sex != (creature_ptr->psex+1)));
+ } while (seikaku_info[k].sex && (seikaku_info[k].sex != (creature_ptr->psex + 1)));
cs = k;
continue;
}
if (c == '8')
{
if (cs >= 4) cs -= 4;
- if (cs != MAX_SEIKAKU && seikaku_info[cs].sex && (seikaku_info[cs].sex != (creature_ptr->psex+1)))
+ if (cs != MAX_SEIKAKU && seikaku_info[cs].sex && (seikaku_info[cs].sex != (creature_ptr->psex + 1)))
{
- if((cs - 4) > 0)
+ if ((cs - 4) > 0)
cs -= 4;
else
cs += 4;
if (c == '4')
{
if (cs > 0) cs--;
- if (cs != MAX_SEIKAKU && seikaku_info[cs].sex && (seikaku_info[cs].sex != (creature_ptr->psex+1)))
+ if (cs != MAX_SEIKAKU && seikaku_info[cs].sex && (seikaku_info[cs].sex != (creature_ptr->psex + 1)))
{
- if((cs - 1) > 0)
+ if ((cs - 1) > 0)
cs--;
else
cs++;
if (c == '6')
{
if (cs < MAX_SEIKAKU) cs++;
- if (cs != MAX_SEIKAKU && seikaku_info[cs].sex && (seikaku_info[cs].sex != (creature_ptr->psex+1)))
+ if (cs != MAX_SEIKAKU && seikaku_info[cs].sex && (seikaku_info[cs].sex != (creature_ptr->psex + 1)))
{
- if((cs + 1) <= MAX_SEIKAKU)
+ if ((cs + 1) <= MAX_SEIKAKU)
cs++;
else
cs--;
if (c == '2')
{
if ((cs + 4) <= MAX_SEIKAKU) cs += 4;
- if (cs != MAX_SEIKAKU && seikaku_info[cs].sex && (seikaku_info[cs].sex != (creature_ptr->psex+1)))
+ if (cs != MAX_SEIKAKU && seikaku_info[cs].sex && (seikaku_info[cs].sex != (creature_ptr->psex + 1)))
{
- if((cs + 4) <= MAX_SEIKAKU)
+ if ((cs + 4) <= MAX_SEIKAKU)
cs += 4;
else
cs -= 4;
k = (islower(c) ? A2I(c) : -1);
if ((k >= 0) && (k < MAX_SEIKAKU))
{
- if((seikaku_info[k].sex == 0) || (seikaku_info[k].sex == (creature_ptr->psex+1)))
+ if ((seikaku_info[k].sex == 0) || (seikaku_info[k].sex == (creature_ptr->psex + 1)))
{
cs = k;
continue;
k = (isupper(c) ? (26 + c - 'A') : -1);
if ((k >= 26) && (k < MAX_SEIKAKU))
{
- if((seikaku_info[k].sex == 0) || (seikaku_info[k].sex == (creature_ptr->psex+1)))
+ if ((seikaku_info[k].sex == 0) || (seikaku_info[k].sex == (creature_ptr->psex + 1)))
{
cs = k;
continue;
do_cmd_options_aux(OPT_PAGE_BIRTH, _("初期オプション((*)はスコアに影響)", "Birth Option((*)s effect score)"));
screen_load();
}
- else if (c !='2' && c !='4' && c !='6' && c !='8') bell();
+ else if (c != '2' && c != '4' && c != '6' && c != '8') bell();
}
/* Set seikaku */
ap_ptr = &seikaku_info[creature_ptr->pseikaku];
#ifdef JP
strcpy(tmp, ap_ptr->title);
- if(ap_ptr->no == 1)
- strcat(tmp,"の");
+ if (ap_ptr->no == 1)
+ strcat(tmp, "の");
#else
strcpy(tmp, ap_ptr->title);
- strcat(tmp," ");
+ strcat(tmp, " ");
#endif
- strcat(tmp,creature_ptr->name);
+ strcat(tmp, creature_ptr->name);
c_put_str(TERM_L_BLUE, tmp, 1, 34);
/* Extra infomation */
put_str(_("最低限得たい能力値を設定して下さい。", "Set minimum stats."), 10, 10);
put_str(_("2/8で項目選択、4/6で値の増減、Enterで次へ", "2/8 for Select, 4/6 for Change value, Enter for Goto next"), 11, 10);
-
+
put_str(_(" 基本値 種族 職業 性格 合計値 最大値", " Base Rac Cla Per Total Maximum"), 13, 10);
/* Output the maximum stats */
{
sprintf(cur, "18/%02d", (m - 18));
}
-
+
/* From 3 to 18 */
else
{
{
sprintf(inp, "18/%02d", (m - 18));
}
-
+
/* From 3 to 18 */
else
{
sprintf(buf, "%6s %2d %+3d %+3d %+3d = %6s %6s",
stat_names[i], cval[i], rp_ptr->r_adj[i], cp_ptr->c_adj[i],
ap_ptr->a_adj[i], inp, cur);
-
+
/* Dump the prompt */
put_str(buf, 14 + i, 10);
}
-
+
/* Get a minimum stat */
cs = 0;
os = 6;
/* Move Cursol */
if (cs != os)
{
- if(os == 6)
+ if (os == 6)
{
c_put_str(TERM_WHITE, _("決定する", "Accept"), 21, 35);
}
- else if(os < A_MAX)
+ else if (os < A_MAX)
{
c_put_str(TERM_WHITE, cur, 14 + os, 10);
}
- if(cs == 6)
+ if (cs == 6)
{
c_put_str(TERM_YELLOW, _("決定する", "Accept"), 21, 35);
}
/* Obtain the current stat */
m = adjust_stat(cval[cs], j);
-
+
/* Above 18 */
if (m > 18)
{
sprintf(inp, "18/%02d", (m - 18));
}
-
+
/* From 3 to 18 */
else
{
sprintf(inp, "%2d", m);
}
-
+
/* Prepare a prompt */
sprintf(cur, "%6s %2d %+3d %+3d %+3d = %6s",
stat_names[cs], cval[cs], rp_ptr->r_adj[cs],
}
os = cs;
}
-
+
/* Prompt for the minimum stats */
c = inkey();
- switch ( c ){
+ switch (c) {
case 'Q':
birth_quit();
case 'S':
case ' ':
case '\r':
case '\n':
- if(cs == 6) break;
+ if (cs == 6) break;
cs++;
c = '2';
break;
}
break;
case 'm':
- if(cs != 6)
+ if (cs != 6)
{
cval[cs] = 17;
os = 7;
}
break;
case 'n':
- if(cs != 6)
+ if (cs != 6)
{
cval[cs] = 3;
os = 7;
bell();
break;
}
- if(c == ESCAPE || ((c == ' ' || c == '\r' || c == '\n') && cs == 6))break;
+ if (c == ESCAPE || ((c == ' ' || c == '\r' || c == '\n') && cs == 6))break;
}
-
+
for (i = 0; i < A_MAX; i++)
{
/* Save the minimum stat */
};
clear_from(10);
-
+
/* Prompt for the minimum stats */
put_str(_("2/4/6/8で項目選択、+/-で値の増減、Enterで次へ", "2/4/6/8 for Select, +/- for Change value, Enter for Goto next"), 11, 10);
put_str(_("注意:身長と体重の最大値/最小値ぎりぎりの値は非常に出現確率が低くなります。", "Caution: Values near minimum or maximum is extremery rare."), 23, 2);
-
+
if (creature_ptr->psex == SEX_MALE)
{
- max_percent = (int)(rp_ptr->m_b_ht+rp_ptr->m_m_ht*4-1) * 100 / (int)(rp_ptr->m_b_ht);
- min_percent = (int)(rp_ptr->m_b_ht-rp_ptr->m_m_ht*4+1) * 100 / (int)(rp_ptr->m_b_ht);
+ max_percent = (int)(rp_ptr->m_b_ht + rp_ptr->m_m_ht * 4 - 1) * 100 / (int)(rp_ptr->m_b_ht);
+ min_percent = (int)(rp_ptr->m_b_ht - rp_ptr->m_m_ht * 4 + 1) * 100 / (int)(rp_ptr->m_b_ht);
}
else
{
- max_percent = (int)(rp_ptr->f_b_ht+rp_ptr->f_m_ht*4-1) * 100 / (int)(rp_ptr->f_b_ht);
- min_percent = (int)(rp_ptr->f_b_ht-rp_ptr->f_m_ht*4+1) * 100 / (int)(rp_ptr->f_b_ht);
+ max_percent = (int)(rp_ptr->f_b_ht + rp_ptr->f_m_ht * 4 - 1) * 100 / (int)(rp_ptr->f_b_ht);
+ min_percent = (int)(rp_ptr->f_b_ht - rp_ptr->f_m_ht * 4 + 1) * 100 / (int)(rp_ptr->f_b_ht);
}
-
+
put_str(_("体格/地位の最小値/最大値を設定して下さい。", "Set minimum/maximum attribute."), 10, 10);
- put_str(_(" 項 目 最小値 最大値", " Parameter Min Max"), 13,20);
+ put_str(_(" 項 目 最小値 最大値", " Parameter Min Max"), 13, 20);
/* Output the maximum stats */
for (i = 0; i < MAXITEMS; i++)
break;
case 2: /* Minimum height */
- if (creature_ptr->psex == SEX_MALE) m = rp_ptr->m_b_ht-rp_ptr->m_m_ht*4+1;
- else m = rp_ptr->f_b_ht-rp_ptr->f_m_ht*4+1;
+ if (creature_ptr->psex == SEX_MALE) m = rp_ptr->m_b_ht - rp_ptr->m_m_ht * 4 + 1;
+ else m = rp_ptr->f_b_ht - rp_ptr->f_m_ht * 4 + 1;
break;
case 3: /* Maximum height */
- if (creature_ptr->psex == SEX_MALE) m = rp_ptr->m_b_ht+rp_ptr->m_m_ht*4-1;
- else m = rp_ptr->f_b_ht+rp_ptr->f_m_ht*4-1;
+ if (creature_ptr->psex == SEX_MALE) m = rp_ptr->m_b_ht + rp_ptr->m_m_ht * 4 - 1;
+ else m = rp_ptr->f_b_ht + rp_ptr->f_m_ht * 4 - 1;
break;
case 4: /* Minimum weight */
- if (creature_ptr->psex == SEX_MALE) m = (rp_ptr->m_b_wt * min_percent / 100) - (rp_ptr->m_m_wt * min_percent / 75) +1;
- else m = (rp_ptr->f_b_wt * min_percent / 100) - (rp_ptr->f_m_wt * min_percent / 75) +1;
+ if (creature_ptr->psex == SEX_MALE) m = (rp_ptr->m_b_wt * min_percent / 100) - (rp_ptr->m_m_wt * min_percent / 75) + 1;
+ else m = (rp_ptr->f_b_wt * min_percent / 100) - (rp_ptr->f_m_wt * min_percent / 75) + 1;
break;
case 5: /* Maximum weight */
- if (creature_ptr->psex == SEX_MALE) m = (rp_ptr->m_b_wt * max_percent / 100) + (rp_ptr->m_m_wt * max_percent / 75) -1;
- else m = (rp_ptr->f_b_wt * max_percent / 100) + (rp_ptr->f_m_wt * max_percent / 75) -1;
+ if (creature_ptr->psex == SEX_MALE) m = (rp_ptr->m_b_wt * max_percent / 100) + (rp_ptr->m_m_wt * max_percent / 75) - 1;
+ else m = (rp_ptr->f_b_wt * max_percent / 100) + (rp_ptr->f_m_wt * max_percent / 75) - 1;
break;
case 6: /* Minimum social class */
m = 1;
m = 1;
break;
}
-
+
/* Save the maximum or minimum */
mval[i] = m;
cval[i] = m;
for (i = 0; i < 4; i++)
{
/* Prepare a prompt */
- sprintf(buf, "%-12s (%3d - %3d)", itemname[i], mval[i*2], mval[i*2+1]);
+ sprintf(buf, "%-12s (%3d - %3d)", itemname[i], mval[i * 2], mval[i * 2 + 1]);
/* Dump the prompt */
put_str(buf, 14 + i, 20);
for (j = 0; j < 2; j++)
{
- sprintf(buf, " %3d", cval[i*2+j]);
+ sprintf(buf, " %3d", cval[i * 2 + j]);
put_str(buf, 14 + i, 45 + 8 * j);
}
}
-
+
/* Get a minimum stat */
cs = 0;
os = MAXITEMS;
{
const char accept[] = _("決定する", "Accept");
- if(os == MAXITEMS)
+ if (os == MAXITEMS)
{
c_put_str(TERM_WHITE, accept, 19, 35);
}
else
{
- c_put_str(TERM_WHITE, cur, 14 + os/2, 45 + 8 * (os%2));
+ c_put_str(TERM_WHITE, cur, 14 + os / 2, 45 + 8 * (os % 2));
}
-
- if(cs == MAXITEMS)
+
+ if (cs == MAXITEMS)
{
c_put_str(TERM_YELLOW, accept, 19, 35);
}
{
/* Prepare a prompt */
sprintf(cur, " %3d", cval[cs]);
- c_put_str(TERM_YELLOW, cur, 14 + cs/2, 45 + 8 * (cs%2));
+ c_put_str(TERM_YELLOW, cur, 14 + cs / 2, 45 + 8 * (cs % 2));
}
os = cs;
}
-
+
/* Prompt for the minimum stats */
c = inkey();
- switch (c){
+ switch (c) {
case 'Q':
birth_quit();
case 'S':
case ' ':
case '\r':
case '\n':
- if(cs == MAXITEMS) break;
+ if (cs == MAXITEMS) break;
cs++;
c = '6';
break;
case '8':
case 'k':
- if (cs-2 >= 0) cs -= 2;
+ if (cs - 2 >= 0) cs -= 2;
break;
case '2':
case 'j':
case '<':
if (cs != MAXITEMS)
{
- if(cs%2)
+ if (cs % 2)
{
- if(cval[cs] > cval[cs-1])
+ if (cval[cs] > cval[cs - 1])
{
cval[cs]--;
os = 127;
}
else
{
- if(cval[cs] > mval[cs])
+ if (cval[cs] > mval[cs])
{
cval[cs]--;
os = 127;
case '>':
if (cs != MAXITEMS)
{
- if(cs%2)
+ if (cs % 2)
{
- if(cval[cs] < mval[cs])
+ if (cval[cs] < mval[cs])
{
cval[cs]++;
os = 127;
}
else
{
- if(cval[cs] < cval[cs+1])
+ if (cval[cs] < cval[cs + 1])
{
cval[cs]++;
os = 127;
}
break;
case 'm':
- if(cs != MAXITEMS)
+ if (cs != MAXITEMS)
{
- if(cs%2)
+ if (cs % 2)
{
- if(cval[cs] < mval[cs])
+ if (cval[cs] < mval[cs])
{
cval[cs] = mval[cs];
os = 127;
}
else
{
- if(cval[cs] < cval[cs+1])
+ if (cval[cs] < cval[cs + 1])
{
- cval[cs] = cval[cs+1];
+ cval[cs] = cval[cs + 1];
os = 127;
}
}
}
break;
case 'n':
- if(cs != MAXITEMS)
+ if (cs != MAXITEMS)
{
- if(cs%2)
+ if (cs % 2)
{
- if(cval[cs] > cval[cs-1])
+ if (cval[cs] > cval[cs - 1])
{
- cval[cs] = cval[cs-1];
+ cval[cs] = cval[cs - 1];
os = 255;
}
}
else
{
- if(cval[cs] > mval[cs])
+ if (cval[cs] > mval[cs])
{
cval[cs] = mval[cs];
os = 255;
bell();
break;
}
- if(c == ESCAPE || ((c == ' ' || c == '\r' || c == '\n') && cs == MAXITEMS))break;
+ if (c == ESCAPE || ((c == ' ' || c == '\r' || c == '\n') && cs == MAXITEMS))break;
}
/* Input the minimum stats */
}
#ifdef JP
if (iskanji2(creature_ptr->history[y], x))
- c_put_str(TERM_L_BLUE, format("%c%c", creature_ptr->history[y][x],creature_ptr->history[y][x+1]), y + 12, x + 10);
+ c_put_str(TERM_L_BLUE, format("%c%c", creature_ptr->history[y][x], creature_ptr->history[y][x + 1]), y + 12, x + 10);
else
#endif
- c_put_str(TERM_L_BLUE, format("%c", creature_ptr->history[y][x]), y + 12, x + 10);
+ c_put_str(TERM_L_BLUE, format("%c", creature_ptr->history[y][x]), y + 12, x + 10);
/* Place cursor just after cost of current stat */
Term_gotoxy(x + 10, y + 12);
y--;
if (y < 0) y = 3;
#ifdef JP
- if ((x > 0) && (iskanji2(creature_ptr->history[y], x-1))) x--;
+ if ((x > 0) && (iskanji2(creature_ptr->history[y], x - 1))) x--;
#endif
}
else if (skey == SKEY_DOWN || c == KTRL('n'))
y++;
if (y > 3) y = 0;
#ifdef JP
- if ((x > 0) && (iskanji2(creature_ptr->history[y], x-1))) x--;
+ if ((x > 0) && (iskanji2(creature_ptr->history[y], x - 1))) x--;
#endif
}
else if (skey == SKEY_RIGHT || c == KTRL('f'))
}
#ifdef JP
- if ((x > 0) && (iskanji2(creature_ptr->history[y], x-1))) x--;
+ if ((x > 0) && (iskanji2(creature_ptr->history[y], x - 1))) x--;
#endif
}
else if (c == '\r' || c == '\n')
#ifdef JP
if (iskanji2(creature_ptr->history[y], x))
{
- creature_ptr->history[y][x+1] = ' ';
+ creature_ptr->history[y][x + 1] = ' ';
}
if (iskanji(c))
if (y > 3) y = 0;
}
- if (iskanji2(creature_ptr->history[y], x+1))
+ if (iskanji2(creature_ptr->history[y], x + 1))
{
- creature_ptr->history[y][x+2] = ' ';
+ creature_ptr->history[y][x + 2] = ' ';
}
creature_ptr->history[y][x++] = c;
Term_clear();
/* Title everything */
- put_str(_("名前 :", "Name :"), 1,26);
+ put_str(_("名前 :", "Name :"), 1, 26);
put_str(_("性別 :", "Sex :"), 3, 1);
put_str(_("種族 :", "Race :"), 4, 1);
put_str(_("職業 :", "Class :"), 5, 1);
#else
sprintf(buf, "%c%c %s", I2A(n), p2, sp_ptr->title);
#endif
- put_str(buf, 12 + (n/5), 2 + 15 * (n%5));
+ put_str(buf, 12 + (n / 5), 2 + 15 * (n % 5));
}
#ifdef JP
{
if (cs != os)
{
- put_str(cur, 12 + (os/5), 2 + 15 * (os%5));
- if(cs == MAX_SEXES)
+ put_str(cur, 12 + (os / 5), 2 + 15 * (os % 5));
+ if (cs == MAX_SEXES)
#ifdef JP
sprintf(cur, "%c%c%s", '*', p2, "ランダム");
#else
sprintf(cur, "%c%c %s", I2A(cs), p2, str);
#endif
}
- c_put_str(TERM_YELLOW, cur, 12 + (cs/5), 2 + 15 * (cs%5));
+ c_put_str(TERM_YELLOW, cur, 12 + (cs / 5), 2 + 15 * (cs % 5));
os = cs;
}
if (k >= 0) break;
#ifdef JP
- sprintf(buf, "性別を選んで下さい (%c-%c) ('='初期オプション設定): ", I2A(0), I2A(n-1));
+ sprintf(buf, "性別を選んで下さい (%c-%c) ('='初期オプション設定): ", I2A(0), I2A(n - 1));
#else
- sprintf(buf, "Choose a sex (%c-%c) ('=' for options): ", I2A(0), I2A(n-1));
+ sprintf(buf, "Choose a sex (%c-%c) ('=' for options): ", I2A(0), I2A(n - 1));
#endif
put_str(buf, 10, 10);
if (c == 'S') return FALSE;
if (c == ' ' || c == '\r' || c == '\n')
{
- if(cs == MAX_SEXES)
+ if (cs == MAX_SEXES)
k = randint0(MAX_SEXES);
else
k = cs;
screen_load();
}
- else if(c != '4' && c != '6')bell();
+ else if (c != '4' && c != '6')bell();
}
/* Set sex */
creature_ptr->prace = 0;
while (TRUE)
{
- char temp[80*10];
+ char temp[80 * 10];
concptr t;
if (!get_player_race(creature_ptr)) return FALSE;
roff_to_buf(race_jouhou[creature_ptr->prace], 74, temp, sizeof(temp));
t = temp;
- for (i = 0; i< 10; i++)
+ for (i = 0; i < 10; i++)
{
- if(t[0] == 0)
- break;
+ if (t[0] == 0)
+ break;
else
{
- prt(t, 12+i, 3);
+ prt(t, 12 + i, 3);
t += strlen(t) + 1;
}
}
creature_ptr->pclass = 0;
while (TRUE)
{
- char temp[80*9];
+ char temp[80 * 9];
concptr t;
if (!get_player_class(creature_ptr)) return FALSE;
roff_to_buf(class_jouhou[creature_ptr->pclass], 74, temp, sizeof(temp));
t = temp;
- for (i = 0; i< 9; i++)
+ for (i = 0; i < 9; i++)
{
- if(t[0] == 0)
- break;
+ if (t[0] == 0)
+ break;
else
{
- prt(t, 12+i, 3);
+ prt(t, 12 + i, 3);
t += strlen(t) + 1;
}
}
creature_ptr->pseikaku = 0;
while (TRUE)
{
- char temp[80*8];
+ char temp[80 * 8];
concptr t;
if (!get_player_seikaku(creature_ptr)) return FALSE;
roff_to_buf(seikaku_jouhou[creature_ptr->pseikaku], 74, temp, sizeof(temp));
t = temp;
- for (i = 0; i< A_MAX; i++)
+ for (i = 0; i < A_MAX; i++)
{
- if(t[0] == 0)
- break;
+ if (t[0] == 0)
+ break;
else
{
- prt(t, 12+i, 3);
+ prt(t, 12 + i, 3);
t += strlen(t) + 1;
}
}
if (get_check_strict("Are you sure? ", CHECK_DEFAULT_Y)) break;
#endif
c_put_str(TERM_L_BLUE, creature_ptr->name, 1, 34);
- prt("", 1, 34+strlen(creature_ptr->name));
+ prt("", 1, 34 + strlen(creature_ptr->name));
}
/* Clean up */
/* Label count */
#ifdef JP
- put_str("回数 :", 10, col+13);
+ put_str("回数 :", 10, col + 13);
#else
- put_str("Round:", 10, col+13);
+ put_str("Round:", 10, col + 13);
#endif
/* Indicate the state */
#ifdef JP
- put_str("(ESCで停止)", 12, col+13);
+ put_str("(ESCで停止)", 12, col + 13);
#else
- put_str("(Hit ESC to stop)", 12, col+13);
+ put_str("(Hit ESC to stop)", 12, col + 13);
#endif
}
{
/* Label */
#ifdef JP
- put_str("最小値", 2, col+5);
+ put_str("最小値", 2, col + 5);
#else
- put_str(" Limit", 2, col+5);
+ put_str(" Limit", 2, col + 5);
#endif
/* Label */
#ifdef JP
- put_str("成功率", 2, col+13);
+ put_str("成功率", 2, col + 13);
#else
- put_str(" Freq", 2, col+13);
+ put_str(" Freq", 2, col + 13);
#endif
/* Label */
#ifdef JP
- put_str("現在値", 2, col+24);
+ put_str("現在値", 2, col + 24);
#else
- put_str(" Roll", 2, col+24);
+ put_str(" Roll", 2, col + 24);
#endif
int j, m;
/* Label stats */
- put_str(stat_names[i], 3+i, col);
+ put_str(stat_names[i], 3 + i, col);
/* Race/Class bonus */
j = rp_ptr->r_adj[i] + cp_ptr->c_adj[i] + ap_ptr->a_adj[i];
/* Put the stat */
cnv_stat(m, buf);
- c_put_str(TERM_L_BLUE, buf, 3+i, col+5);
+ c_put_str(TERM_L_BLUE, buf, 3 + i, col + 5);
}
}
birth_put_stats(creature_ptr);
/* Dump round */
- put_str(format("%10ld", auto_round), 10, col+20);
+ put_str(format("%10ld", auto_round), 10, col + 20);
#ifdef AUTOROLLER_DELAY
/* Delay 1/10 second */
current_world_ptr->play_time = 0;
- /*
+ /*
* Wipe monsters in old dungeon
* This wipe destroys value of m_list[].cur_num .
*/
exe_write_diary(creature_ptr, NIKKI_GAMESTART, 1, _("-------- 新規ゲーム開始 --------", "-------- Start New Game --------"));
exe_write_diary(creature_ptr, NIKKI_HIGAWARI, 0, NULL);
- sprintf(buf,_(" 性別に%sを選択した。", " choose %s personality."), sex_info[creature_ptr->psex].title);
+ sprintf(buf, _(" 性別に%sを選択した。", " choose %s personality."), sex_info[creature_ptr->psex].title);
exe_write_diary(creature_ptr, NIKKI_BUNSHOU, 1, buf);
- sprintf(buf,_(" 種族に%sを選択した。", " choose %s race."), race_info[creature_ptr->prace].title);
+ sprintf(buf, _(" 種族に%sを選択した。", " choose %s race."), race_info[creature_ptr->prace].title);
exe_write_diary(creature_ptr, NIKKI_BUNSHOU, 1, buf);
- sprintf(buf,_(" 職業に%sを選択した。", " choose %s class."), class_info[creature_ptr->pclass].title);
+ sprintf(buf, _(" 職業に%sを選択した。", " choose %s class."), class_info[creature_ptr->pclass].title);
exe_write_diary(creature_ptr, NIKKI_BUNSHOU, 1, buf);
if (creature_ptr->realm1)
{
- sprintf(buf,_(" 魔法の領域に%s%sを選択した。", " choose %s%s realm."),realm_names[creature_ptr->realm1], creature_ptr->realm2 ? format("と%s",realm_names[creature_ptr->realm2]) : "");
+ sprintf(buf, _(" 魔法の領域に%s%sを選択した。", " choose %s%s realm."), realm_names[creature_ptr->realm1], creature_ptr->realm2 ? format("と%s", realm_names[creature_ptr->realm2]) : "");
exe_write_diary(creature_ptr, NIKKI_BUNSHOU, 1, buf);
}
- sprintf(buf,_(" 性格に%sを選択した。", " choose %s."), seikaku_info[creature_ptr->pseikaku].title);
+ sprintf(buf, _(" 性格に%sを選択した。", " choose %s."), seikaku_info[creature_ptr->pseikaku].title);
exe_write_diary(creature_ptr, NIKKI_BUNSHOU, 1, buf);
/* Init the shops */
*/
void dump_yourself(player_type *creature_ptr, FILE *fff)
{
- char temp[80*10];
+ char temp[80 * 10];
int i;
concptr t;
t = temp;
for (i = 0; i < 10; i++)
{
- if(t[0] == 0)
- break;
- fprintf(fff, "%s\n",t);
+ if (t[0] == 0)
+ break;
+ fprintf(fff, "%s\n", t);
t += strlen(t) + 1;
}
roff_to_buf(class_jouhou[creature_ptr->pclass], 78, temp, sizeof(temp));
t = temp;
for (i = 0; i < 10; i++)
{
- if(t[0] == 0)
- break;
- fprintf(fff, "%s\n",t);
+ if (t[0] == 0)
+ break;
+ fprintf(fff, "%s\n", t);
t += strlen(t) + 1;
}
roff_to_buf(seikaku_jouhou[creature_ptr->pseikaku], 78, temp, sizeof(temp));
t = temp;
for (i = 0; i < A_MAX; i++)
{
- if(t[0] == 0)
- break;
- fprintf(fff, "%s\n",t);
+ if (t[0] == 0)
+ break;
+ fprintf(fff, "%s\n", t);
t += strlen(t) + 1;
}
fprintf(fff, "\n");
if (creature_ptr->realm1)
{
- roff_to_buf(realm_jouhou[technic2magic(creature_ptr->realm1)-1], 78, temp, sizeof(temp));
+ roff_to_buf(realm_jouhou[technic2magic(creature_ptr->realm1) - 1], 78, temp, sizeof(temp));
fprintf(fff, _("魔法: %s\n", "Realm: %s\n"), realm_names[creature_ptr->realm1]);
t = temp;
for (i = 0; i < A_MAX; i++)
{
- if(t[0] == 0)
- break;
- fprintf(fff, "%s\n",t);
+ if (t[0] == 0)
+ break;
+ fprintf(fff, "%s\n", t);
t += strlen(t) + 1;
}
}
fprintf(fff, "\n");
if (creature_ptr->realm2)
{
- roff_to_buf(realm_jouhou[technic2magic(creature_ptr->realm2)-1], 78, temp, sizeof(temp));
+ roff_to_buf(realm_jouhou[technic2magic(creature_ptr->realm2) - 1], 78, temp, sizeof(temp));
fprintf(fff, _("魔法: %s\n", "Realm: %s\n"), realm_names[creature_ptr->realm2]);
t = temp;
for (i = 0; i < A_MAX; i++)
{
- if(t[0] == 0)
- break;
- fprintf(fff, "%s\n",t);
+ if (t[0] == 0)
+ break;
+ fprintf(fff, "%s\n", t);
t += strlen(t) + 1;
}
}
c_put_str(action_color, tmp_str, 19 + (i / 2), 35 * (i % 2));
continue;
}
-
+
if (bldg->action_restr[i] == 1)
{
if (!is_member(player_ptr, bldg))
c_put_str(action_color, tmp_str, 19 + (i / 2), 35 * (i % 2));
continue;
}
-
+
if (!is_owner(player_ptr, bldg))
{
action_color = TERM_L_DARK;
player_ptr->arena_number++;
break;
}
-
+
if (player_ptr->arena_number > MAX_ARENA_MONS)
{
if (player_ptr->arena_number < MAX_ARENA_MONS + 2)
break;
}
-
+
if (player_ptr->riding && (player_ptr->pclass != CLASS_BEASTMASTER) && (player_ptr->pclass != CLASS_CAVALRY))
{
msg_print(_("ペットに乗ったままではアリーナへ入れさせてもらえなかった。",
msg_print(NULL);
break;
}
-
+
player_ptr->exit_bldg = FALSE;
reset_tim_flags(player_ptr);
msg_print(_("あなたはすべての敵に勝利した。", "You have won against all foes."));
break;
}
-
+
r_ptr = &r_info[arena_info[player_ptr->arena_number].r_idx];
name = (r_name + r_ptr->name);
msg_format(_("%s に挑戦するものはいないか?", "Do I hear any challenges against: %s"), name);
{
if (draw)
{
- display_kaeruka(k + decision * 5, is_put);
+ display_kaeruka(k + decision * 5, is_put);
}
draw = FALSE;
k = 4;
decision = FALSE;
}
-
+
draw = TRUE;
break;
case '2': case 'j': case 'J': case KTRL('N'):
{
is_put[k] = !is_put[k]; draw = TRUE;
}
-
+
break;
default:
break;
screen_load();
return FALSE;
}
-
+
int i;
clear_bldg(4, 10);
screen_load();
return FALSE;
}
-
+
/* Strip spaces */
for (p = out_val; *p == ' '; p++);
exe_write_diary(customer_ptr, NIKKI_BUNSHOU, 0, _("悪夢にうなされてよく眠れなかった。", "be troubled by a nightmare."));
break;
}
-
+
set_blind(customer_ptr, 0);
set_confused(customer_ptr, 0);
customer_ptr->stun = 0;
exe_write_diary(customer_ptr, NIKKI_BUNSHOU, 0, _("夕方を迎えた。", "awake refreshed."));
break;
}
-
+
msg_print(_("あなたはリフレッシュして目覚め、新たな日を迎えた。", "You awake refreshed for the new day."));
exe_write_diary(customer_ptr, NIKKI_BUNSHOU, 0, _("すがすがしい朝を迎えた。", "awake refreshed."));
break;
put_str(_("クエストを終わらせたら戻って来て下さい。", "Return when you have completed your quest."), 12, 0);
return;
}
-
+
if (q_ptr->status != QUEST_STATUS_UNTAKEN) return;
q_ptr->status = QUEST_STATUS_TAKEN;
tmp /= 60;
return tmp;
}
-
+
tmp = dam * 60;
tmp *= mult;
tmp /= div;
msg_print(_("改良に失敗した。", "The improvement failed."));
return FALSE;
}
-
+
object_desc(tmp_str, o_ptr, OD_NAME_AND_ENCHANT);
#ifdef JP
msg_format("$%dで%sに改良しました。", cost * o_ptr->number, tmp_str);
/* Update the gold display */
building_prt_gold(player_ptr);
}
-
+
return;
}
* existing files; these files will become bigger and bigger unless
* an user deletes some or all of these files by hand at some
* point.
- * These three functions automatically delete old dumped lines
- * before adding new ones. Since there are various kinds of automatic
- * dumps in a single file, we add a header and a footer with a type
- * name for every automatic dump, and kill old lines only when the
+ * These three functions automatically delete old dumped lines
+ * before adding new ones. Since there are various kinds of automatic
+ * dumps in a single file, we add a header and a footer with a type
+ * name for every automatic dump, and kill old lines only when the
* lines have the correct type of header and footer.
- * We need to be quite paranoid about correctness; the user might
+ * We need to be quite paranoid about correctness; the user might
* (mistakenly) edit the file by hand, and see all their work come
- * to nothing on the next auto dump otherwise. The current code only
- * detects changes by noting inconsistencies between the actual number
- * of lines and the number written in the footer. Note that this will
+ * to nothing on the next auto dump otherwise. The current code only
+ * detects changes by noting inconsistencies between the actual number
+ * of lines and the number written in the footer. Note that this will
* not catch single-line edits.
* </pre>
*/
#include "english.h"
-// Mark strings for auto dump
+ // Mark strings for auto dump
static char auto_dump_header[] = "# vvvvvvv== %s ==vvvvvvv";
static char auto_dump_footer[] = "# ^^^^^^^== %s ==^^^^^^^";
if (!tmp_fff)
{
- msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), tmp_file);
- msg_print(NULL);
- return;
+ msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), tmp_file);
+ msg_print(NULL);
+ return;
}
/* Loop for every line */
auto_dump_line_num = 0;
auto_dump_printf(_("# *警告!!* 以降の行は自動生成されたものです。\n",
- "# *Warning!* The lines below are an automatic dump.\n"));
- auto_dump_printf(_("# *警告!!* 後で自動的に削除されるので編集しないでください。\n",
- "# Don't edit them; changes will be deleted and replaced automatically.\n"));
+ "# *Warning!* The lines below are an automatic dump.\n"));
+ auto_dump_printf(_("# *警告!!* 後で自動的に削除されるので編集しないでください。\n",
+ "# Don't edit them; changes will be deleted and replaced automatically.\n"));
return TRUE;
}
sprintf(footer_mark_str, auto_dump_footer, auto_dump_mark);
auto_dump_printf(_("# *警告!!* 以降の行は自動生成されたものです。\n",
- "# *Warning!* The lines below are an automatic dump.\n"));
- auto_dump_printf(_("# *警告!!* 後で自動的に削除されるので編集しないでください。\n",
- "# Don't edit them; changes will be deleted and replaced automatically.\n"));
+ "# *Warning!* The lines below are an automatic dump.\n"));
+ auto_dump_printf(_("# *警告!!* 後で自動的に削除されるので編集しないでください。\n",
+ "# Don't edit them; changes will be deleted and replaced automatically.\n"));
/* End of dump */
fprintf(auto_dump_stream, "%s (%d)\n", footer_mark_str, auto_dump_line_num);
if (disable_diary) return(-1);
if (type == NIKKI_FIX_QUEST_C ||
- type == NIKKI_FIX_QUEST_F ||
- type == NIKKI_RAND_QUEST_C ||
- type == NIKKI_RAND_QUEST_F ||
- type == NIKKI_TO_QUEST)
+ type == NIKKI_FIX_QUEST_F ||
+ type == NIKKI_RAND_QUEST_C ||
+ type == NIKKI_RAND_QUEST_F ||
+ type == NIKKI_TO_QUEST)
{
QUEST_IDX old_quest;
}
/* different filne name to avoid mixing */
- sprintf(file_name,_("playrecord-%s.txt", "playrec-%s.txt"),savefile_base);
+ sprintf(file_name, _("playrecord-%s.txt", "playrec-%s.txt"), savefile_base);
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name);
/* File type is "TEXT" */
{
msg_format(_("%s を開くことができませんでした。プレイ記録を一時停止します。", "Failed to open %s. Play-Record is disabled temporarily."), buf);
msg_format(NULL);
- disable_diary=TRUE;
+ disable_diary = TRUE;
return -1;
}
else
{
#ifdef JP
- sprintf(note_level_buf, "%d階(%s):", (int)creature_ptr->current_floor_ptr->dun_level, d_name+d_info[creature_ptr->dungeon_idx].name);
+ sprintf(note_level_buf, "%d階(%s):", (int)creature_ptr->current_floor_ptr->dun_level, d_name + d_info[creature_ptr->dungeon_idx].name);
#else
- sprintf(note_level_buf, "%s L%d:", d_name+d_info[creature_ptr->dungeon_idx].name, (int)creature_ptr->current_floor_ptr->dun_level);
+ sprintf(note_level_buf, "%s L%d:", d_name + d_info[creature_ptr->dungeon_idx].name, (int)creature_ptr->current_floor_ptr->dun_level);
#endif
note_level = note_level_buf;
}
}
- switch(type)
+ switch (type)
+ {
+ case NIKKI_HIGAWARI:
+ {
+ if (day < MAX_DAYS) fprintf(fff, _("%d日目\n", "Day %d\n"), day);
+ else fputs(_("*****日目\n", "Day *****\n"), fff);
+ do_level = FALSE;
+ break;
+ }
+ case NIKKI_BUNSHOU:
{
- case NIKKI_HIGAWARI:
+ if (num)
{
- if (day < MAX_DAYS) fprintf(fff, _("%d日目\n", "Day %d\n"), day);
- else fputs(_("*****日目\n", "Day *****\n"), fff);
+ fprintf(fff, "%s\n", note);
do_level = FALSE;
- break;
}
- case NIKKI_BUNSHOU:
- {
- if (num)
- {
- fprintf(fff, "%s\n",note);
- do_level = FALSE;
- }
- else
- fprintf(fff, " %2d:%02d %20s %s\n",hour, min, note_level, note);
- break;
- }
- case NIKKI_ART:
- {
- fprintf(fff, _(" %2d:%02d %20s %sを発見した。\n", " %2d:%02d %20s discovered %s.\n"), hour, min, note_level, note);
- break;
- }
- case NIKKI_ART_SCROLL:
+ else
+ fprintf(fff, " %2d:%02d %20s %s\n", hour, min, note_level, note);
+ break;
+ }
+ case NIKKI_ART:
+ {
+ fprintf(fff, _(" %2d:%02d %20s %sを発見した。\n", " %2d:%02d %20s discovered %s.\n"), hour, min, note_level, note);
+ break;
+ }
+ case NIKKI_ART_SCROLL:
+ {
+ fprintf(fff, _(" %2d:%02d %20s 巻物によって%sを生成した。\n", " %2d:%02d %20s created %s by scroll.\n"), hour, min, note_level, note);
+ break;
+ }
+ case NIKKI_UNIQUE:
+ {
+ fprintf(fff, _(" %2d:%02d %20s %sを倒した。\n", " %2d:%02d %20s defeated %s.\n"), hour, min, note_level, note);
+ break;
+ }
+ case NIKKI_FIX_QUEST_C:
+ {
+ if (quest[num].flags & QUEST_FLAG_SILENT) break;
+ fprintf(fff, _(" %2d:%02d %20s クエスト「%s」を達成した。\n",
+ " %2d:%02d %20s completed quest '%s'.\n"), hour, min, note_level, quest[num].name);
+ break;
+ }
+ case NIKKI_FIX_QUEST_F:
+ {
+ if (quest[num].flags & QUEST_FLAG_SILENT) break;
+ fprintf(fff, _(" %2d:%02d %20s クエスト「%s」から命からがら逃げ帰った。\n",
+ " %2d:%02d %20s run away from quest '%s'.\n"), hour, min, note_level, quest[num].name);
+ break;
+ }
+ case NIKKI_RAND_QUEST_C:
+ {
+ GAME_TEXT name[MAX_NLEN];
+ strcpy(name, r_name + r_info[quest[num].r_idx].name);
+ fprintf(fff, _(" %2d:%02d %20s ランダムクエスト(%s)を達成した。\n",
+ " %2d:%02d %20s completed random quest '%s'\n"), hour, min, note_level, name);
+ break;
+ }
+ case NIKKI_RAND_QUEST_F:
+ {
+ GAME_TEXT name[MAX_NLEN];
+ strcpy(name, r_name + r_info[quest[num].r_idx].name);
+ fprintf(fff, _(" %2d:%02d %20s ランダムクエスト(%s)から逃げ出した。\n",
+ " %2d:%02d %20s ran away from quest '%s'.\n"), hour, min, note_level, name);
+ break;
+ }
+ case NIKKI_MAXDEAPTH:
+ {
+ fprintf(fff, _(" %2d:%02d %20s %sの最深階%d階に到達した。\n",
+ " %2d:%02d %20s reached level %d of %s for the first time.\n"), hour, min, note_level,
+ _(d_name + d_info[creature_ptr->dungeon_idx].name, num),
+ _(num, d_name + d_info[creature_ptr->dungeon_idx].name));
+ break;
+ }
+ case NIKKI_TRUMP:
+ {
+ fprintf(fff, _(" %2d:%02d %20s %s%sの最深階を%d階にセットした。\n",
+ " %2d:%02d %20s reset recall level of %s to %d %s.\n"), hour, min, note_level, note,
+ _(d_name + d_info[num].name, (int)max_dlv[num]),
+ _((int)max_dlv[num], d_name + d_info[num].name));
+ break;
+ }
+ case NIKKI_STAIR:
+ {
+ concptr to;
+ if (q_idx && (is_fixed_quest_idx(q_idx)
+ && !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT))))
{
- fprintf(fff, _(" %2d:%02d %20s 巻物によって%sを生成した。\n", " %2d:%02d %20s created %s by scroll.\n"), hour, min, note_level, note);
- break;
+ to = _("地上", "the surface");
}
- case NIKKI_UNIQUE:
+ else
{
- fprintf(fff, _(" %2d:%02d %20s %sを倒した。\n", " %2d:%02d %20s defeated %s.\n"), hour, min, note_level, note);
- break;
+ if (!(creature_ptr->current_floor_ptr->dun_level + num)) to = _("地上", "the surface");
+ else to = format(_("%d階", "level %d"), creature_ptr->current_floor_ptr->dun_level + num);
}
- case NIKKI_FIX_QUEST_C:
+ fprintf(fff, _(" %2d:%02d %20s %sへ%s。\n", " %2d:%02d %20s %s %s.\n"), hour, min, note_level, _(to, note), _(note, to));
+ break;
+ }
+ case NIKKI_RECALL:
+ {
+ if (!num)
+ fprintf(fff, _(" %2d:%02d %20s 帰還を使って%sの%d階へ下りた。\n", " %2d:%02d %20s recalled to dungeon level %d of %s.\n"),
+ hour, min, note_level, _(d_name + d_info[creature_ptr->dungeon_idx].name, (int)max_dlv[creature_ptr->dungeon_idx]),
+ _((int)max_dlv[creature_ptr->dungeon_idx], d_name + d_info[creature_ptr->dungeon_idx].name));
+ else
+ fprintf(fff, _(" %2d:%02d %20s 帰還を使って地上へと戻った。\n", " %2d:%02d %20s recalled from dungeon to surface.\n"), hour, min, note_level);
+ break;
+ }
+ case NIKKI_TO_QUEST:
+ {
+ if (quest[num].flags & QUEST_FLAG_SILENT) break;
+ fprintf(fff, _(" %2d:%02d %20s クエスト「%s」へと突入した。\n", " %2d:%02d %20s entered the quest '%s'.\n"),
+ hour, min, note_level, quest[num].name);
+ break;
+ }
+ case NIKKI_TELE_LEV:
+ {
+ fprintf(fff, _(" %2d:%02d %20s レベル・テレポートで脱出した。\n", " %2d:%02d %20s Got out using teleport level.\n"),
+ hour, min, note_level);
+ break;
+ }
+ case NIKKI_BUY:
+ {
+ fprintf(fff, _(" %2d:%02d %20s %sを購入した。\n", " %2d:%02d %20s bought %s.\n"), hour, min, note_level, note);
+ break;
+ }
+ case NIKKI_SELL:
+ {
+ fprintf(fff, _(" %2d:%02d %20s %sを売却した。\n", " %2d:%02d %20s sold %s.\n"), hour, min, note_level, note);
+ break;
+ }
+ case NIKKI_ARENA:
+ {
+ if (num < 0)
{
- if (quest[num].flags & QUEST_FLAG_SILENT) break;
- fprintf(fff, _(" %2d:%02d %20s クエスト「%s」を達成した。\n",
- " %2d:%02d %20s completed quest '%s'.\n"), hour, min, note_level, quest[num].name);
+ int n = -num;
+ fprintf(fff, _(" %2d:%02d %20s 闘技場の%d%s回戦で、%sの前に敗れ去った。\n", " %2d:%02d %20s beaten by %s in the %d%s fight.\n"),
+ hour, min, note_level, _(n, note), _("", n), _(note, get_ordinal_number_suffix(n)));
break;
}
- case NIKKI_FIX_QUEST_F:
+ fprintf(fff, _(" %2d:%02d %20s 闘技場の%d%s回戦(%s)に勝利した。\n", " %2d:%02d %20s won the %d%s fight (%s).\n"),
+ hour, min, note_level, num, _("", get_ordinal_number_suffix(num)), note);
+
+ if (num == MAX_ARENA_MONS)
{
- if (quest[num].flags & QUEST_FLAG_SILENT) break;
- fprintf(fff, _(" %2d:%02d %20s クエスト「%s」から命からがら逃げ帰った。\n",
- " %2d:%02d %20s run away from quest '%s'.\n"), hour, min, note_level, quest[num].name);
- break;
+ fprintf(fff, _(" 闘技場のすべての敵に勝利し、チャンピオンとなった。\n",
+ " won all fight to become a Chanpion.\n"));
+ do_level = FALSE;
}
- case NIKKI_RAND_QUEST_C:
+ break;
+ }
+ case NIKKI_HANMEI:
+ {
+ fprintf(fff, _(" %2d:%02d %20s %sを識別した。\n", " %2d:%02d %20s identified %s.\n"), hour, min, note_level, note);
+ break;
+ }
+ case NIKKI_WIZ_TELE:
+ {
+ concptr to;
+ if (!creature_ptr->current_floor_ptr->dun_level)
+ to = _("地上", "the surface");
+ else
+ to = format(_("%d階(%s)", "level %d of %s"), creature_ptr->current_floor_ptr->dun_level, d_name + d_info[creature_ptr->dungeon_idx].name);
+
+ fprintf(fff, _(" %2d:%02d %20s %sへとウィザード・テレポートで移動した。\n",
+ " %2d:%02d %20s wizard-teleport to %s.\n"), hour, min, note_level, to);
+ break;
+ }
+ case NIKKI_PAT_TELE:
+ {
+ concptr to;
+ if (!creature_ptr->current_floor_ptr->dun_level)
+ to = _("地上", "the surface");
+ else
+ to = format(_("%d階(%s)", "level %d of %s"), creature_ptr->current_floor_ptr->dun_level, d_name + d_info[creature_ptr->dungeon_idx].name);
+
+ fprintf(fff, _(" %2d:%02d %20s %sへとパターンの力で移動した。\n",
+ " %2d:%02d %20s used Pattern to teleport to %s.\n"), hour, min, note_level, to);
+ break;
+ }
+ case NIKKI_LEVELUP:
+ {
+ fprintf(fff, _(" %2d:%02d %20s レベルが%dに上がった。\n", " %2d:%02d %20s reached player level %d.\n"), hour, min, note_level, num);
+ break;
+ }
+ case NIKKI_GAMESTART:
+ {
+ time_t ct = time((time_t*)0);
+ do_level = FALSE;
+ if (num)
{
- GAME_TEXT name[MAX_NLEN];
- strcpy(name, r_name+r_info[quest[num].r_idx].name);
- fprintf(fff, _(" %2d:%02d %20s ランダムクエスト(%s)を達成した。\n",
- " %2d:%02d %20s completed random quest '%s'\n"), hour, min, note_level, name);
- break;
+ fprintf(fff, "%s %s", note, ctime(&ct));
}
- case NIKKI_RAND_QUEST_F:
+ else
+ fprintf(fff, " %2d:%02d %20s %s %s", hour, min, note_level, note, ctime(&ct));
+ break;
+ }
+ case NIKKI_NAMED_PET:
+ {
+ fprintf(fff, " %2d:%02d %20s ", hour, min, note_level);
+ switch (num)
{
- GAME_TEXT name[MAX_NLEN];
- strcpy(name, r_name+r_info[quest[num].r_idx].name);
- fprintf(fff, _(" %2d:%02d %20s ランダムクエスト(%s)から逃げ出した。\n",
- " %2d:%02d %20s ran away from quest '%s'.\n"), hour, min, note_level, name);
+ case RECORD_NAMED_PET_NAME:
+ fprintf(fff, _("%sを旅の友にすることに決めた。\n", "decided to travel together with %s.\n"), note);
break;
- }
- case NIKKI_MAXDEAPTH:
- {
- fprintf(fff, _(" %2d:%02d %20s %sの最深階%d階に到達した。\n",
- " %2d:%02d %20s reached level %d of %s for the first time.\n"), hour, min, note_level,
- _(d_name+d_info[creature_ptr->dungeon_idx].name, num),
- _(num, d_name+d_info[creature_ptr->dungeon_idx].name));
+ case RECORD_NAMED_PET_UNNAME:
+ fprintf(fff, _("%sの名前を消した。\n", "unnamed %s.\n"), note);
break;
- }
- case NIKKI_TRUMP:
- {
- fprintf(fff, _(" %2d:%02d %20s %s%sの最深階を%d階にセットした。\n",
- " %2d:%02d %20s reset recall level of %s to %d %s.\n"), hour, min, note_level, note,
- _(d_name + d_info[num].name, (int)max_dlv[num]),
- _((int)max_dlv[num], d_name + d_info[num].name));
+ case RECORD_NAMED_PET_DISMISS:
+ fprintf(fff, _("%sを解放した。\n", "dismissed %s.\n"), note);
break;
- }
- case NIKKI_STAIR:
- {
- concptr to;
- if (q_idx && (is_fixed_quest_idx(q_idx)
- && !((q_idx == QUEST_OBERON) || (q_idx == QUEST_SERPENT))))
- {
- to = _("地上", "the surface");
- }
- else
- {
- if (!(creature_ptr->current_floor_ptr->dun_level+num)) to = _("地上", "the surface");
- else to = format(_("%d階", "level %d"), creature_ptr->current_floor_ptr->dun_level+num);
- }
- fprintf(fff, _(" %2d:%02d %20s %sへ%s。\n", " %2d:%02d %20s %s %s.\n"), hour, min, note_level, _(to, note), _(note, to));
+ case RECORD_NAMED_PET_DEATH:
+ fprintf(fff, _("%sが死んでしまった。\n", "%s died.\n"), note);
break;
- }
- case NIKKI_RECALL:
- {
- if (!num)
- fprintf(fff, _(" %2d:%02d %20s 帰還を使って%sの%d階へ下りた。\n", " %2d:%02d %20s recalled to dungeon level %d of %s.\n"),
- hour, min, note_level, _(d_name+d_info[creature_ptr->dungeon_idx].name, (int)max_dlv[creature_ptr->dungeon_idx]),
- _((int)max_dlv[creature_ptr->dungeon_idx], d_name+d_info[creature_ptr->dungeon_idx].name));
- else
- fprintf(fff, _(" %2d:%02d %20s 帰還を使って地上へと戻った。\n", " %2d:%02d %20s recalled from dungeon to surface.\n"), hour, min, note_level);
+ case RECORD_NAMED_PET_MOVED:
+ fprintf(fff, _("%sをおいて別のマップへ移動した。\n", "moved to another map leaving %s behind.\n"), note);
break;
- }
- case NIKKI_TO_QUEST:
- {
- if (quest[num].flags & QUEST_FLAG_SILENT) break;
- fprintf(fff, _(" %2d:%02d %20s クエスト「%s」へと突入した。\n", " %2d:%02d %20s entered the quest '%s'.\n"),
- hour, min, note_level, quest[num].name);
+ case RECORD_NAMED_PET_LOST_SIGHT:
+ fprintf(fff, _("%sとはぐれてしまった。\n", "lost sight of %s.\n"), note);
break;
- }
- case NIKKI_TELE_LEV:
- {
- fprintf(fff, _(" %2d:%02d %20s レベル・テレポートで脱出した。\n", " %2d:%02d %20s Got out using teleport level.\n"),
- hour, min, note_level);
+ case RECORD_NAMED_PET_DESTROY:
+ fprintf(fff, _("%sが*破壊*によって消え去った。\n", "%s was made disappeared by *destruction*.\n"), note);
break;
- }
- case NIKKI_BUY:
- {
- fprintf(fff, _(" %2d:%02d %20s %sを購入した。\n", " %2d:%02d %20s bought %s.\n"), hour, min, note_level, note);
+ case RECORD_NAMED_PET_EARTHQUAKE:
+ fprintf(fff, _("%sが岩石に押し潰された。\n", "%s was crushed by falling rocks.\n"), note);
break;
- }
- case NIKKI_SELL:
- {
- fprintf(fff, _(" %2d:%02d %20s %sを売却した。\n", " %2d:%02d %20s sold %s.\n"), hour, min, note_level, note);
+ case RECORD_NAMED_PET_GENOCIDE:
+ fprintf(fff, _("%sが抹殺によって消え去った。\n", "%s was made disappeared by genocide.\n"), note);
break;
- }
- case NIKKI_ARENA:
- {
- if (num < 0)
- {
- int n = -num;
- fprintf(fff, _(" %2d:%02d %20s 闘技場の%d%s回戦で、%sの前に敗れ去った。\n", " %2d:%02d %20s beaten by %s in the %d%s fight.\n"),
- hour, min, note_level, _(n, note), _("", n), _(note, get_ordinal_number_suffix(n)));
- break;
- }
- fprintf(fff, _(" %2d:%02d %20s 闘技場の%d%s回戦(%s)に勝利した。\n", " %2d:%02d %20s won the %d%s fight (%s).\n"),
- hour, min, note_level, num, _("", get_ordinal_number_suffix(num)), note);
-
- if (num == MAX_ARENA_MONS)
- {
- fprintf(fff, _(" 闘技場のすべての敵に勝利し、チャンピオンとなった。\n",
- " won all fight to become a Chanpion.\n"));
- do_level = FALSE;
- }
+ case RECORD_NAMED_PET_WIZ_ZAP:
+ fprintf(fff, _("%sがデバッグコマンドによって消え去った。\n", "%s was removed by debug command.\n"), note);
break;
- }
- case NIKKI_HANMEI:
- {
- fprintf(fff, _(" %2d:%02d %20s %sを識別した。\n", " %2d:%02d %20s identified %s.\n"), hour, min, note_level, note);
+ case RECORD_NAMED_PET_TELE_LEVEL:
+ fprintf(fff, _("%sがテレポート・レベルによって消え去った。\n", "%s was made disappeared by teleport level.\n"), note);
break;
- }
- case NIKKI_WIZ_TELE:
- {
- concptr to;
- if (!creature_ptr->current_floor_ptr->dun_level)
- to = _("地上", "the surface");
- else
- to = format(_("%d階(%s)", "level %d of %s"), creature_ptr->current_floor_ptr->dun_level, d_name+d_info[creature_ptr->dungeon_idx].name);
-
- fprintf(fff, _(" %2d:%02d %20s %sへとウィザード・テレポートで移動した。\n",
- " %2d:%02d %20s wizard-teleport to %s.\n"), hour, min, note_level, to);
+ case RECORD_NAMED_PET_BLAST:
+ fprintf(fff, _("%sを爆破した。\n", "blasted %s.\n"), note);
break;
- }
- case NIKKI_PAT_TELE:
- {
- concptr to;
- if (!creature_ptr->current_floor_ptr->dun_level)
- to = _("地上", "the surface");
- else
- to = format(_("%d階(%s)", "level %d of %s"), creature_ptr->current_floor_ptr->dun_level, d_name+d_info[creature_ptr->dungeon_idx].name);
-
- fprintf(fff, _(" %2d:%02d %20s %sへとパターンの力で移動した。\n",
- " %2d:%02d %20s used Pattern to teleport to %s.\n"), hour, min, note_level, to);
+ case RECORD_NAMED_PET_HEAL_LEPER:
+ fprintf(fff, _("%sの病気が治り旅から外れた。\n", "%s was healed and left.\n"), note);
break;
- }
- case NIKKI_LEVELUP:
- {
- fprintf(fff, _(" %2d:%02d %20s レベルが%dに上がった。\n", " %2d:%02d %20s reached player level %d.\n"), hour, min, note_level, num);
+ case RECORD_NAMED_PET_COMPACT:
+ fprintf(fff, _("%sがモンスター情報圧縮によって消え去った。\n", "%s was made disappeared by compacting monsters.\n"), note);
break;
- }
- case NIKKI_GAMESTART:
- {
- time_t ct = time((time_t*)0);
- do_level = FALSE;
- if (num)
- {
- fprintf(fff, "%s %s",note, ctime(&ct));
- }
- else
- fprintf(fff, " %2d:%02d %20s %s %s",hour, min, note_level, note, ctime(&ct));
+ case RECORD_NAMED_PET_LOSE_PARENT:
+ fprintf(fff, _("%sの召喚者が既にいないため消え去った。\n", "%s disappeared because there does not exist summoner.\n"), note);
break;
- }
- case NIKKI_NAMED_PET:
- {
- fprintf(fff, " %2d:%02d %20s ", hour, min, note_level);
- switch (num)
- {
- case RECORD_NAMED_PET_NAME:
- fprintf(fff, _("%sを旅の友にすることに決めた。\n", "decided to travel together with %s.\n"), note);
- break;
- case RECORD_NAMED_PET_UNNAME:
- fprintf(fff, _("%sの名前を消した。\n", "unnamed %s.\n"), note);
- break;
- case RECORD_NAMED_PET_DISMISS:
- fprintf(fff, _("%sを解放した。\n", "dismissed %s.\n"), note);
- break;
- case RECORD_NAMED_PET_DEATH:
- fprintf(fff, _("%sが死んでしまった。\n", "%s died.\n"), note);
- break;
- case RECORD_NAMED_PET_MOVED:
- fprintf(fff, _("%sをおいて別のマップへ移動した。\n", "moved to another map leaving %s behind.\n"), note);
- break;
- case RECORD_NAMED_PET_LOST_SIGHT:
- fprintf(fff, _("%sとはぐれてしまった。\n", "lost sight of %s.\n"), note);
- break;
- case RECORD_NAMED_PET_DESTROY:
- fprintf(fff, _("%sが*破壊*によって消え去った。\n", "%s was made disappeared by *destruction*.\n"), note);
- break;
- case RECORD_NAMED_PET_EARTHQUAKE:
- fprintf(fff, _("%sが岩石に押し潰された。\n", "%s was crushed by falling rocks.\n"), note);
- break;
- case RECORD_NAMED_PET_GENOCIDE:
- fprintf(fff, _("%sが抹殺によって消え去った。\n", "%s was made disappeared by genocide.\n"), note);
- break;
- case RECORD_NAMED_PET_WIZ_ZAP:
- fprintf(fff, _("%sがデバッグコマンドによって消え去った。\n", "%s was removed by debug command.\n"), note);
- break;
- case RECORD_NAMED_PET_TELE_LEVEL:
- fprintf(fff, _("%sがテレポート・レベルによって消え去った。\n", "%s was made disappeared by teleport level.\n"), note);
- break;
- case RECORD_NAMED_PET_BLAST:
- fprintf(fff, _("%sを爆破した。\n", "blasted %s.\n"), note);
- break;
- case RECORD_NAMED_PET_HEAL_LEPER:
- fprintf(fff, _("%sの病気が治り旅から外れた。\n", "%s was healed and left.\n"), note);
- break;
- case RECORD_NAMED_PET_COMPACT:
- fprintf(fff, _("%sがモンスター情報圧縮によって消え去った。\n", "%s was made disappeared by compacting monsters.\n"), note);
- break;
- case RECORD_NAMED_PET_LOSE_PARENT:
- fprintf(fff, _("%sの召喚者が既にいないため消え去った。\n", "%s disappeared because there does not exist summoner.\n"), note);
- break;
- default:
- fprintf(fff, "\n");
- break;
- }
+ default:
+ fprintf(fff, "\n");
break;
}
+ break;
+ }
- case NIKKI_WIZARD_LOG:
- fprintf(fff, "%s\n", note);
- break;
+ case NIKKI_WIZARD_LOG:
+ fprintf(fff, "%s\n", note);
+ break;
- default:
- break;
+ default:
+ break;
}
my_fclose(fff);
"最高の頭脳を求めて"
};
#else
- static const char subtitle[][51] ={
+ static const char subtitle[][51] = {
"Quest of The World's Toughest Body",
"Attack is the best form of defence.",
"Might is right.",
"Quest of The World's Greatest Brain"
};
#endif
- sprintf(file_name,_("playrecord-%s.txt", "playrec-%s.txt"),savefile_base);
+ sprintf(file_name, _("playrecord-%s.txt", "playrec-%s.txt"), savefile_base);
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name);
if (creature_ptr->pclass == CLASS_WARRIOR || creature_ptr->pclass == CLASS_MONK || creature_ptr->pclass == CLASS_SAMURAI || creature_ptr->pclass == CLASS_BERSERKER)
- strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-1)]);
+ strcpy(tmp, subtitle[randint0(MAX_SUBTITLE - 1)]);
else if (IS_WIZARD_CLASS(creature_ptr))
- strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-1)+1]);
- else strcpy(tmp,subtitle[randint0(MAX_SUBTITLE-2)+1]);
+ strcpy(tmp, subtitle[randint0(MAX_SUBTITLE - 1) + 1]);
+ else strcpy(tmp, subtitle[randint0(MAX_SUBTITLE - 2) + 1]);
#ifdef JP
sprintf(diary_title, "「%s%s%sの伝説 -%s-」", ap_ptr->title, ap_ptr->no ? "の" : "", creature_ptr->name, tmp);
if (record_o_name[0] == '\0') return;
char buf[256];
- sprintf(buf,_("%sの入手を記録します。", "Do you really want to record getting %s? "),record_o_name);
+ sprintf(buf, _("%sの入手を記録します。", "Do you really want to record getting %s? "), record_o_name);
if (!get_check(buf)) return;
GAME_TURN turn_tmp = current_world_ptr->game_turn;
current_world_ptr->game_turn = record_turn;
- sprintf(buf,_("%sを手に入れた。", "descover %s."), record_o_name);
+ sprintf(buf, _("%sを手に入れた。", "descover %s."), record_o_name);
exe_write_diary(creaute_ptr, NIKKI_BUNSHOU, 0, buf);
current_world_ptr->game_turn = turn_tmp;
}
FILE *fff = NULL;
if (!get_check(_("本当に記録を消去しますか?", "Do you really want to delete all your record? "))) return;
- sprintf(file_name,_("playrecord-%s.txt", "playrec-%s.txt"),savefile_base);
+ sprintf(file_name, _("playrecord-%s.txt", "playrec-%s.txt"), savefile_base);
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name);
fd_kill(buf);
fff = my_fopen(buf, "w");
- if(fff)
+ if (fff)
{
my_fclose(fff);
msg_format(_("記録を消去しました。", "deleted record."));
- }else
+ }
+ else
{
msg_format(_("%s の消去に失敗しました。", "failed to delete %s."), buf);
}
/* Prompt */
Term_putstr(2, 23, -1, TERM_WHITE,
- _("['c'で名前変更, 'f'でファイルへ書出, 'h'でモード変更, ESCで終了]", "['c' to change name, 'f' to file, 'h' to change mode, or ESC]"));
+ _("['c'で名前変更, 'f'でファイルへ書出, 'h'でモード変更, ESCで終了]", "['c' to change name, 'f' to file, 'h' to change mode, or ESC]"));
/* Query */
c = inkey();
/* Dump up to 20 lines of messages */
for (j = 0; (j < num_lines) && (i + j < n); j++)
{
- concptr msg = message_str(i+j);
+ concptr msg = message_str(i + j);
/* Dump the messages, bottom to top */
c_prt((i + j < num_now ? TERM_WHITE : TERM_SLATE), msg, num_lines + 1 - j, 0);
/* Display header */
/* translation */
prt(format(_("以前のメッセージ %d-%d 全部で(%d)", "Message Recall (%d-%d of %d)"),
- i, i + j - 1, n), 0, 0);
+ i, i + j - 1, n), 0, 0);
/* Display prompt (not very informative) */
prt(_("[ 'p' で更に古いもの, 'n' で更に新しいもの, '/' で検索, ESC で中断 ]",
- "[Press 'p' for older, 'n' for newer, ..., or ESCAPE]"), hgt - 1, 0);
+ "[Press 'p' for older, 'n' for newer, ..., or ESCAPE]"), hgt - 1, 0);
skey = inkey_special(TRUE);
switch (skey)
{
- /* Hack -- handle show */
+ /* Hack -- handle show */
case '=':
/* Prompt */
prt(_("強調: ", "Show: "), hgt - 1, 0);
continue;
- /* Hack -- handle find */
+ /* Hack -- handle find */
case '/':
case KTRL('s'):
- {
- int z;
+ {
+ int z;
- /* Prompt */
- prt(_("検索: ", "Find: "), hgt - 1, 0);
+ /* Prompt */
+ prt(_("検索: ", "Find: "), hgt - 1, 0);
- /* Get a "finder" string, or continue */
- strcpy(back_str, finder_str);
- if (!askfor(finder_str, 80))
- {
- strcpy(finder_str, back_str);
- continue;
- }
- else if (!finder_str[0])
- {
- shower = NULL; /* Stop showing */
- continue;
- }
+ /* Get a "finder" string, or continue */
+ strcpy(back_str, finder_str);
+ if (!askfor(finder_str, 80))
+ {
+ strcpy(finder_str, back_str);
+ continue;
+ }
+ else if (!finder_str[0])
+ {
+ shower = NULL; /* Stop showing */
+ continue;
+ }
- /* Show it */
- shower = finder_str;
+ /* Show it */
+ shower = finder_str;
- /* Scan messages */
- for (z = i + 1; z < n; z++)
- {
- concptr msg = message_str(z);
+ /* Scan messages */
+ for (z = i + 1; z < n; z++)
+ {
+ concptr msg = message_str(z);
- /* Search for it */
- if (my_strstr(msg, finder_str))
- {
- /* New location */
- i = z;
+ /* Search for it */
+ if (my_strstr(msg, finder_str))
+ {
+ /* New location */
+ i = z;
- break;
- }
+ break;
}
}
- break;
+ }
+ break;
/* Recall 1 older message */
case SKEY_TOP:
i = n - num_lines;
break;
- /* Recall 1 newer message */
+ /* Recall 1 newer message */
case SKEY_BOTTOM:
/* Go to the newest line */
i = 0;
break;
- /* Recall 1 older message */
+ /* Recall 1 older message */
case '8':
case SKEY_UP:
case '\n':
i = MIN(i + 1, n - num_lines);
break;
- /* Recall 10 older messages */
+ /* Recall 10 older messages */
case '+':
/* Go older if legal */
i = MIN(i + 10, n - num_lines);
break;
- /* Recall 20 older messages */
+ /* Recall 20 older messages */
case 'p':
case KTRL('P'):
case ' ':
i = MIN(i + num_lines, n - num_lines);
break;
- /* Recall 20 newer messages */
+ /* Recall 20 newer messages */
case 'n':
case KTRL('N'):
case SKEY_PGDOWN:
i = MAX(0, i - num_lines);
break;
- /* Recall 10 newer messages */
+ /* Recall 10 newer messages */
case '-':
/* Go newer (if able) */
i = MAX(0, i - 10);
break;
- /* Recall 1 newer messages */
+ /* Recall 1 newer messages */
case '2':
case SKEY_DOWN:
/* Go newer (if able) */
/* Start dumping */
auto_dump_printf(_("\n# 自動マクロセーブ\n\n", "\n# Automatic macro dump\n\n"));
-
+
/* Dump them */
for (int i = 0; i < macro__num; i++)
{
* @details
* <pre>
* Note that both "flush()" calls are extremely important. This may
- * no longer be true, since "util.c" is much simpler now.
+ * no longer be true, since "util.c" is much simpler now.
* </pre>
*/
static void do_cmd_macro_aux_keymap(char *buf)
/* Start dumping */
auto_dump_printf(_("\n# 自動キー配置セーブ\n\n", "\n# Automatic keymap dump\n\n"));
-
+
/* Dump them */
for (int i = 0; i < 256; i++)
{
* <pre>
* Note that the macro "action" must be defined before the trigger.
*
- * Could use some helpful instructions on this page.
+ * Could use some helpful instructions on this page.
* </pre>
*/
void do_cmd_macros(player_type *creature_ptr)
/* Help message */
c_prt(TERM_L_RED, _("カーソルキーの左右でカーソル位置を移動。BackspaceかDeleteで一文字削除。",
- "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char."), 22, 0);
+ "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char."), 22, 0);
/* Prompt */
prt(_("マクロ行動: ", "Action: "), 20, 0);
/* Help message */
c_prt(TERM_L_RED, _("カーソルキーの左右でカーソル位置を移動。BackspaceかDeleteで一文字削除。",
- "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char."), 22, 0);
+ "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char."), 22, 0);
/* Prompt */
prt(_("行動: ", "Action: "), 20, 0);
/* Help message */
c_prt(TERM_L_RED, _("カーソルキーの左右でカーソル位置を移動。BackspaceかDeleteで一文字削除。",
- "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char."), 22, 0);
+ "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char."), 22, 0);
/* Prompt */
prt(_("マクロ行動: ", "Action: "), 20, 0);
sprintf(str, "%d", *num);
- if (!get_string(format("Input new number(0-%d): ", max-1), str, 4))
+ if (!get_string(format("Input new number(0-%d): ", max - 1), str, 4))
return FALSE;
tmp = (IDX)strtol(str, NULL, 0);
static void print_visuals_menu(concptr choice_msg)
{
prt(_("[ 画面表示の設定 ]", "Interact with Visuals"), 1, 0);
-
+
/* Give some choices */
prt(_("(0) ユーザー設定ファイルのロード", "(0) Load a user pref file"), 3, 5);
-
+
#ifdef ALLOW_VISUALS
prt(_("(1) モンスターの 色/文字 をファイルに書き出す", "(1) Dump monster attr/chars"), 4, 5);
prt(_("(2) アイテムの 色/文字 をファイルに書き出す", "(2) Dump object attr/chars"), 5, 5);
switch (i)
{
- /* Load a 'pref' file */
+ /* Load a 'pref' file */
case '0':
/* Prompt */
prt(_("コマンド: ユーザー設定ファイルのロード", "Command: Load a user pref file"), 15, 0);
#ifdef ALLOW_VISUALS
- /* Dump monster attr/chars */
+ /* Dump monster attr/chars */
case '1':
{
static concptr mark = "Monster attr/chars";
/* Label the object */
Term_putstr(5, 17, -1, TERM_WHITE,
- format(_("モンスター = %d, 名前 = %-40.40s", "Monster = %d, Name = %-40.40s"), r, (r_name + r_ptr->name)));
+ format(_("モンスター = %d, 名前 = %-40.40s", "Monster = %d, Name = %-40.40s"), r, (r_name + r_ptr->name)));
/* Label the Default values */
Term_putstr(10, 19, -1, TERM_WHITE,
Term_queue_bigchar(43, 20, ca, cc, 0, 0);
/* Prompt */
- Term_putstr(0, 22, -1, TERM_WHITE,
+ Term_putstr(0, 22, -1, TERM_WHITE,
_("コマンド (n/N/^N/a/A/^A/c/C/^C/v/V/^V): ", "Command (n/N/^N/a/A/^A/c/C/^C/v/V/^V): "));
i = inkey();
switch (c)
{
case 'n':
+ {
+ IDX prev_r = r;
+ do
{
- IDX prev_r = r;
- do
+ if (!cmd_visuals_aux(i, &r, max_r_idx))
{
- if (!cmd_visuals_aux(i, &r, max_r_idx))
- {
- r = prev_r;
- break;
- }
+ r = prev_r;
+ break;
}
- while (!r_info[r].name);
- }
- break;
+ } while (!r_info[r].name);
+ }
+ break;
case 'a':
t = (int)r_ptr->x_attr;
(void)cmd_visuals_aux(i, &t, 256);
/* Label the object */
Term_putstr(5, 17, -1, TERM_WHITE,
- format(_("アイテム = %d, 名前 = %-40.40s", "Object = %d, Name = %-40.40s"),
- k, k_name + (!k_ptr->flavor ? k_ptr->name : k_ptr->flavor_name)));
+ format(_("アイテム = %d, 名前 = %-40.40s", "Object = %d, Name = %-40.40s"),
+ k, k_name + (!k_ptr->flavor ? k_ptr->name : k_ptr->flavor_name)));
/* Label the Default values */
Term_putstr(10, 19, -1, TERM_WHITE,
- format(_("初期値 色 / 文字 = %3d / %3d", "Default attr/char = %3d / %3d"), da, dc));
+ format(_("初期値 色 / 文字 = %3d / %3d", "Default attr/char = %3d / %3d"), da, dc));
Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol);
Term_queue_bigchar(43, 19, da, dc, 0, 0);
/* Label the Current values */
Term_putstr(10, 20, -1, TERM_WHITE,
- format(_("現在値 色 / 文字 = %3d / %3d", "Current attr/char = %3d / %3d"), ca, cc));
+ format(_("現在値 色 / 文字 = %3d / %3d", "Current attr/char = %3d / %3d"), ca, cc));
Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol);
Term_queue_bigchar(43, 20, ca, cc, 0, 0);
/* Prompt */
Term_putstr(0, 22, -1, TERM_WHITE,
- _("コマンド (n/N/^N/a/A/^A/c/C/^C/v/V/^V): ", "Command (n/N/^N/a/A/^A/c/C/^C/v/V/^V): "));
+ _("コマンド (n/N/^N/a/A/^A/c/C/^C/v/V/^V): ", "Command (n/N/^N/a/A/^A/c/C/^C/v/V/^V): "));
i = inkey();
switch (c)
{
case 'n':
+ {
+ IDX prev_k = k;
+ do
{
- IDX prev_k = k;
- do
+ if (!cmd_visuals_aux(i, &k, max_k_idx))
{
- if (!cmd_visuals_aux(i, &k, max_k_idx))
- {
- k = prev_k;
- break;
- }
+ k = prev_k;
+ break;
}
- while (!k_info[k].name);
- }
- break;
+ } while (!k_info[k].name);
+ }
+ break;
case 'a':
t = (int)k_ptr->x_attr;
(void)cmd_visuals_aux(i, &t, 256);
/* Label the object */
prt("", 17, 5);
Term_putstr(5, 17, -1, TERM_WHITE,
- format(_("地形 = %d, 名前 = %s, 明度 = %s", "Terrain = %d, Name = %s, Lighting = %s"),
- f, (f_name + f_ptr->name), lighting_level_str[lighting_level]));
+ format(_("地形 = %d, 名前 = %s, 明度 = %s", "Terrain = %d, Name = %s, Lighting = %s"),
+ f, (f_name + f_ptr->name), lighting_level_str[lighting_level]));
/* Label the Default values */
Term_putstr(10, 19, -1, TERM_WHITE,
- format(_("初期値 色 / 文字 = %3d / %3d", "Default attr/char = %3d / %3d"), da, dc));
+ format(_("初期値 色 / 文字 = %3d / %3d", "Default attr/char = %3d / %3d"), da, dc));
Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol);
Term_queue_bigchar(43, 19, da, dc, 0, 0);
/* Label the Current values */
#ifdef JP
Term_putstr(10, 20, -1, TERM_WHITE,
- format("現在値 色 / 文字 = %3d / %3d", ca, cc));
+ format("現在値 色 / 文字 = %3d / %3d", ca, cc));
#else
Term_putstr(10, 20, -1, TERM_WHITE,
- format("Current attr/char = %3d / %3d", ca, cc));
+ format("Current attr/char = %3d / %3d", ca, cc));
#endif
Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol);
/* Prompt */
#ifdef JP
Term_putstr(0, 22, -1, TERM_WHITE,
- "コマンド (n/N/^N/a/A/^A/c/C/^C/l/L/^L/d/D/^D/v/V/^V): ");
+ "コマンド (n/N/^N/a/A/^A/c/C/^C/l/L/^L/d/D/^D/v/V/^V): ");
#else
Term_putstr(0, 22, -1, TERM_WHITE,
- "Command (n/N/^N/a/A/^A/c/C/^C/l/L/^L/d/D/^D/v/V/^V): ");
+ "Command (n/N/^N/a/A/^A/c/C/^C/l/L/^L/d/D/^D/v/V/^V): ");
#endif
i = inkey();
switch (c)
{
case 'n':
+ {
+ IDX prev_f = f;
+ do
{
- IDX prev_f = f;
- do
+ if (!cmd_visuals_aux(i, &f, max_f_idx))
{
- if (!cmd_visuals_aux(i, &f, max_f_idx))
- {
- f = prev_f;
- break;
- }
+ f = prev_f;
+ break;
}
- while (!f_info[f].name || (f_info[f].mimic != f));
- }
- break;
+ } while (!f_info[f].name || (f_info[f].mimic != f));
+ }
+ break;
case 'a':
t = (int)f_ptr->x_attr[lighting_level];
(void)cmd_visuals_aux(i, &t, 256);
do_cmd_knowledge_monsters(creature_ptr, &need_redraw, TRUE, -1);
break;
- /* Modify object attr/chars (visual mode) */
+ /* Modify object attr/chars (visual mode) */
case '8':
do_cmd_knowledge_objects(creature_ptr, &need_redraw, TRUE, -1);
break;
- /* Modify feature attr/chars (visual mode) */
+ /* Modify feature attr/chars (visual mode) */
case '9':
{
IDX lighting_level = F_LIT_STANDARD;
need_redraw = TRUE;
break;
- /* Unknown option */
+ /* Unknown option */
default:
bell();
break;
/* Start dumping */
auto_dump_printf(_("\n# カラーの設定\n\n", "\n# Color redefinitions\n\n"));
-
+
/* Dump colors */
for (i = 0; i < 256; i++)
{
/* Dump a comment */
auto_dump_printf(_("# カラー '%s'\n", "# Color '%s'\n"), name);
-
+
/* Dump the monster attr/char info */
auto_dump_printf("V:%d:0x%02X:0x%02X:0x%02X:0x%02X\n\n",
i, kv, rv, gv, bv);
for (j = 0; j < 16; j++)
{
/* Exhibit this color */
- Term_putstr(j*4, 20, -1, a, "###");
+ Term_putstr(j * 4, 20, -1, a, "###");
/* Exhibit all colors */
- Term_putstr(j*4, 22, -1, j, format("%3d", j));
+ Term_putstr(j * 4, 22, -1, j, format("%3d", j));
}
/* Describe the color */
/* Describe the color */
Term_putstr(5, 10, -1, TERM_WHITE,
- format(_("カラー = %d, 名前 = %s", "Color = %d, Name = %s"), a, name));
+ format(_("カラー = %d, 名前 = %s", "Color = %d, Name = %s"), a, name));
/* Label the Current values */
Term_putstr(5, 12, -1, TERM_WHITE,
- format("K = 0x%02x / R,G,B = 0x%02x,0x%02x,0x%02x",
- angband_color_table[a][0],
- angband_color_table[a][1],
- angband_color_table[a][2],
- angband_color_table[a][3]));
+ format("K = 0x%02x / R,G,B = 0x%02x,0x%02x,0x%02x",
+ angband_color_table[a][0],
+ angband_color_table[a][1],
+ angband_color_table[a][2],
+ angband_color_table[a][3]));
/* Prompt */
Term_putstr(0, 14, -1, TERM_WHITE,
{
#if FAKE_VER_EXTRA > 0
msg_format(_("変愚蛮怒(Hengband) %d.%d.%d.%d", "You are playing Hengband %d.%d.%d.%d."),
- FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH, FAKE_VER_EXTRA);
+ FAKE_VER_MAJOR - 10, FAKE_VER_MINOR, FAKE_VER_PATCH, FAKE_VER_EXTRA);
#else
msg_format(_("変愚蛮怒(Hengband) %d.%d.%d", "You are playing Hengband %d.%d.%d."),
FAKE_VER_MAJOR - 10, FAKE_VER_MINOR, FAKE_VER_PATCH);
msg_print(_("何かありそうな荒野のようだ。", "Looks like a strange wilderness."));
return;
}
-
+
msg_print(_("典型的な町のようだ。", "Looks like a typical town."));
return;
}
if (creature_ptr->muta3 & MUT3_GOOD_LUCK)
msg_print(do_cmd_feeling_text_lucky[creature_ptr->feeling]);
else if (creature_ptr->pseikaku == SEIKAKU_COMBAT ||
- creature_ptr->inventory_list[INVEN_BOW].name1 == ART_CRIMSON)
+ creature_ptr->inventory_list[INVEN_BOW].name1 == ART_CRIMSON)
msg_print(do_cmd_feeling_text_combat[creature_ptr->feeling]);
else
msg_print(do_cmd_feeling_text[creature_ptr->feeling]);
/*
* Description of each monster group.
*/
-static concptr monster_group_text[] =
+static concptr monster_group_text[] =
{
#ifdef JP
"ユニーク", /* "Uniques" */
*/
static concptr monster_group_char[] =
{
- (char *) -1L,
- (char *) -2L,
- (char *) -3L,
- (char *) -4L,
+ (char *)-1L,
+ (char *)-2L,
+ (char *)-3L,
+ (char *)-4L,
"a",
"b",
"c",
/* Get a list of x_char in this group */
concptr group_char = monster_group_char[grp_cur];
- bool grp_unique = (monster_group_char[grp_cur] == (char *) -1L);
- bool grp_riding = (monster_group_char[grp_cur] == (char *) -2L);
- bool grp_wanted = (monster_group_char[grp_cur] == (char *) -3L);
- bool grp_amberite = (monster_group_char[grp_cur] == (char *) -4L);
+ bool grp_unique = (monster_group_char[grp_cur] == (char *)-1L);
+ bool grp_riding = (monster_group_char[grp_cur] == (char *)-2L);
+ bool grp_wanted = (monster_group_char[grp_cur] == (char *)-3L);
+ bool grp_amberite = (monster_group_char[grp_cur] == (char *)-4L);
/* Check every race */
IDX mon_cnt = 0;
monster_race *r_ptr = &r_info[i];
/* Skip empty race */
- if (!r_ptr->name) continue ;
+ if (!r_ptr->name) continue;
/* Require known monsters */
if (!(mode & 0x02) && !cheat_know && !r_ptr->r_sights) continue;
/*
* Description of each monster group.
*/
-static concptr object_group_text[] =
+static concptr object_group_text[] =
{
#ifdef JP
"キノコ", /* "Mushrooms" */
"ロッド", /* "Rods" */
"カード", /* "Cards" */
"キャプチャー・ボール",
- "羊皮紙",
+ "羊皮紙",
"くさび",
"箱",
"人形",
/*
* TVALs of items in each group
*/
-static byte object_group_tval[] =
+static byte object_group_tval[] =
{
TV_FOOD,
TV_POTION,
/*
* Description of each feature group.
*/
-static concptr feature_group_text[] =
+static concptr feature_group_text[] =
{
"terrains",
NULL
// todo なぜこんな中途半端なところに? defineも…
concptr inven_res_label = _(" 酸電火冷毒光闇破轟獄因沌劣 盲怖乱痺透命感消復浮",
- " AcElFiCoPoLiDkShSoNtNxCaDi BlFeCfFaSeHlEpSdRgLv");
+ " AcElFiCoPoLiDkShSoNtNxCaDi BlFeCfFaSeHlEpSdRgLv");
#define IM_FLAG_STR _("*", "* ")
#define HAS_FLAG_STR _("+", "+ ")
fff = my_fopen_temp(file_name, 1024);
if (!fff)
{
- msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
- msg_print(NULL);
- return;
+ msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
+ msg_print(NULL);
+ return;
}
fprintf(fff, "%s\n", inven_res_label);
{
if (message)
{
- msg_format(_("ファイル %s を開けませんでした。", "Failed to open file %s."), filename);
- msg_print(NULL);
+ msg_format(_("ファイル %s を開けませんでした。", "Failed to open file %s."), filename);
+ msg_print(NULL);
}
-
+
return;
}
int rv = angband_color_table[a][1];
int gv = angband_color_table[a][2];
int bv = angband_color_table[a][3];
- fprintf(fff, "%s<font color=\"#%02x%02x%02x\">",
+ fprintf(fff, "%s<font color=\"#%02x%02x%02x\">",
((y == 0 && x == 0) ? "" : "</font>"), rv, gv, bv);
old_a = a;
}
/*
* Redefinable "save_screen" action
*/
-void (*screendump_aux)(void) = NULL;
+void(*screendump_aux)(void) = NULL;
/*
{
prt(_("記念撮影しますか? [(y)es/(h)tml/(n)o] ", "Save screen dump? [(y)es/(h)tml/(n)o] "), 0, 0);
bool html_dump = FALSE;
- while(TRUE)
+ while (TRUE)
{
char c = inkey();
if (c == 'Y' || c == 'y')
(void)(Term_what(x, y, &a, &c));
/* Dump it */
- buf[x] = hack[a&0x0F];
+ buf[x] = hack[a & 0x0F];
}
/* Terminate */
fff = my_fopen_temp(file_name, 1024);
if (!fff)
{
- msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
- msg_print(NULL);
- return;
+ msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
+ msg_print(NULL);
+ return;
}
/* Allocate the "who" array */
fff = my_fopen_temp(file_name, 1024);
if (!fff)
{
- msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
- msg_print(NULL);
- return;
+ msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
+ msg_print(NULL);
+ return;
}
for (int i = 0; i < 5; i++)
fff = my_fopen_temp(file_name, 1024);
if (!fff)
{
- msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
- msg_print(NULL);
- return;
+ msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
+ msg_print(NULL);
+ return;
}
if (creature_ptr->realm1 != REALM_NONE)
char skill_name[GINOU_TEMPMAX][20] =
{
_("マーシャルアーツ", "Martial Arts "),
- _("二刀流 ", "Dual Wielding "),
+ _("二刀流 ", "Dual Wielding "),
_("乗馬 ", "Riding "),
_("盾 ", "Shield ")
};
fff = my_fopen_temp(file_name, 1024);
if (!fff)
{
- msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
- msg_print(NULL);
- return;
+ msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
+ msg_print(NULL);
+ return;
}
for (int i = 0; i < GINOU_TEMPMAX; i++)
fff = my_fopen_temp(file_name, 1024);
if (!fff)
{
- msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
- msg_print(NULL);
- return;
+ msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
+ msg_print(NULL);
+ return;
}
/* Process the monsters (backwards) */
* @param creature_ptr プレーヤーへの参照ポインタ
* Total kill count
* @return なし
- * @note the player ghosts are ignored.
+ * @note the player ghosts are ignored.
*/
static void do_cmd_knowledge_kill_count(player_type *creature_ptr)
{
FILE *fff;
GAME_TEXT file_name[1024];
fff = my_fopen_temp(file_name, 1024);
-if (!fff)
+ if (!fff)
{
msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
msg_print(NULL);
}
if (total < 1)
- fprintf(fff,_("あなたはまだ敵を倒していない。\n\n", "You have defeated no enemies yet.\n\n"));
+ fprintf(fff, _("あなたはまだ敵を倒していない。\n\n", "You have defeated no enemies yet.\n\n"));
else
#ifdef JP
- fprintf(fff,"あなたは%ld体の敵を倒している。\n\n", (long int)total);
+ fprintf(fff, "あなたは%ld体の敵を倒している。\n\n", (long int)total);
#else
- fprintf(fff,"You have defeated %ld %s.\n\n", (long int)total, (total == 1) ? "enemy" : "enemies");
+ fprintf(fff, "You have defeated %ld %s.\n\n", (long int)total, (total == 1) ? "enemy" : "enemies");
#endif
}
total += this_monster;
}
- fprintf(fff,"----------------------------------------------\n");
+ fprintf(fff, "----------------------------------------------\n");
#ifdef JP
- fprintf(fff," 合計: %lu 体を倒した。\n", (unsigned long int)total);
+ fprintf(fff, " 合計: %lu 体を倒した。\n", (unsigned long int)total);
#else
- fprintf(fff," Total: %lu creature%s killed.\n", (unsigned long int)total, (total == 1 ? "" : "s"));
+ fprintf(fff, " Total: %lu creature%s killed.\n", (unsigned long int)total, (total == 1 ? "" : "s"));
#endif
/* Free the "who" array */
}
-/*
- * Move the cursor in a browser window
+/*
+ * Move the cursor in a browser window
*/
-static void browser_cursor(char ch, int *column, IDX *grp_cur, int grp_cnt,
- IDX *list_cur, int list_cnt)
+static void browser_cursor(char ch, int *column, IDX *grp_cur, int grp_cnt,
+ IDX *list_cur, int list_cnt)
{
int d;
int col = *column;
/* Ignore illegal characters */
if (ia > 0x7f || ic > 0xff || ic < ' ' ||
- (!use_graphics && ic > 0x7f))
+ (!use_graphics && ic > 0x7f))
continue;
TERM_COLOR a = ia;
* Do visual mode command -- Change symbols
*/
static bool visual_mode_command(char ch, bool *visual_list_ptr,
- int height, int width,
- TERM_COLOR *attr_top_ptr, byte *char_left_ptr,
- TERM_COLOR *cur_attr_ptr, SYMBOL_CODE *cur_char_ptr, bool *need_redraw)
+ int height, int width,
+ TERM_COLOR *attr_top_ptr, byte *char_left_ptr,
+ TERM_COLOR *cur_attr_ptr, SYMBOL_CODE *cur_char_ptr, bool *need_redraw)
{
static TERM_COLOR attr_old = 0;
static SYMBOL_CODE char_old = 0;
case 'C':
case 'c':
- {
- int i;
+ {
+ int i;
- /* Set the visual */
- attr_idx = *cur_attr_ptr;
- char_idx = *cur_char_ptr;
+ /* Set the visual */
+ attr_idx = *cur_attr_ptr;
+ char_idx = *cur_char_ptr;
- /* Hack -- for feature lighting */
- for (i = 0; i < F_LIT_MAX; i++)
- {
- attr_idx_feat[i] = 0;
- char_idx_feat[i] = 0;
- }
+ /* Hack -- for feature lighting */
+ for (i = 0; i < F_LIT_MAX; i++)
+ {
+ attr_idx_feat[i] = 0;
+ char_idx_feat[i] = 0;
}
- return TRUE;
+ }
+ return TRUE;
case 'P':
case 'p':
TERM_COLOR attr;
/* Get the race index */
- MONRACE_IDX r_idx = mon_idx[mon_top + i] ;
+ MONRACE_IDX r_idx = mon_idx[mon_top + i];
/* Access the race */
monster_race *r_ptr = &r_info[r_idx];
if (!visual_only)
{
/* Display kills */
- if (!(r_ptr->flags1 & RF1_UNIQUE))
+ if (!(r_ptr->flags1 & RF1_UNIQUE))
put_str(format("%5d", r_ptr->r_pkills), row + i, 73);
- else
- c_put_str((r_ptr->max_num == 0 ? TERM_L_DARK : TERM_WHITE),
- (r_ptr->max_num == 0 ? _("死亡", " dead") : _("生存", "alive")), row + i, 74);
+ else
+ c_put_str((r_ptr->max_num == 0 ? TERM_L_DARK : TERM_WHITE),
+ (r_ptr->max_num == 0 ? _("死亡", " dead") : _("生存", "alive")), row + i, 74);
}
}
if (len > max) max = len;
/* See if any monsters are known */
- if ((monster_group_char[i] == ((char *) -1L)) || collect_monsters(creature_ptr, i, mon_idx, mode))
+ if ((monster_group_char[i] == ((char *)-1L)) || collect_monsters(creature_ptr, i, mon_idx, mode))
{
/* Build a list of groups with known monsters */
grp_idx[grp_cnt++] = i;
/* Scroll monster list */
while (mon_cur < mon_top)
- mon_top = MAX(0, mon_top - browser_rows/2);
+ mon_top = MAX(0, mon_top - browser_rows / 2);
while (mon_cur >= mon_top + browser_rows)
- mon_top = MIN(mon_cnt - browser_rows, mon_top + browser_rows/2);
+ mon_top = MIN(mon_cnt - browser_rows, mon_top + browser_rows / 2);
}
if (!visual_list)
display_monster_list(max + 3, 6, 1, mon_idx, mon_cur, mon_top, visual_only);
/* Display visual list below first monster */
- display_visual_list(max + 3, 7, browser_rows-1, wid - (max + 3), attr_top, char_left);
+ display_visual_list(max + 3, 7, browser_rows - 1, wid - (max + 3), attr_top, char_left);
}
/* Prompt */
char ch = inkey();
/* Do visual mode command if needed */
- if (visual_mode_command(ch, &visual_list, browser_rows-1, wid - (max + 3), &attr_top, &char_left, &r_ptr->x_attr, &r_ptr->x_char, need_redraw))
+ if (visual_mode_command(ch, &visual_list, browser_rows - 1, wid - (max + 3), &attr_top, &char_left, &r_ptr->x_attr, &r_ptr->x_char, need_redraw))
{
if (direct_r_idx >= 0)
{
switch (ch)
{
- case ESCAPE:
- {
- flag = TRUE;
- break;
- }
+ case ESCAPE:
+ {
+ flag = TRUE;
+ break;
+ }
- case 'R':
- case 'r':
+ case 'R':
+ case 'r':
+ {
+ /* Recall on screen */
+ if (!visual_list && !visual_only && (mon_idx[mon_cur] > 0))
{
- /* Recall on screen */
- if (!visual_list && !visual_only && (mon_idx[mon_cur] > 0))
- {
- screen_roff(mon_idx[mon_cur], 0);
-
- (void)inkey();
+ screen_roff(mon_idx[mon_cur], 0);
- redraw = TRUE;
- }
+ (void)inkey();
- break;
+ redraw = TRUE;
}
- default:
- {
- /* Move the cursor */
- browser_cursor(ch, &column, &grp_cur, grp_cnt, &mon_cur, mon_cnt);
+ break;
+ }
- break;
- }
+ default:
+ {
+ /* Move the cursor */
+ browser_cursor(ch, &column, &grp_cur, grp_cnt, &mon_cur, mon_cnt);
+
+ break;
+ }
}
}
/* Scroll object list */
while (object_cur < object_top)
- object_top = MAX(0, object_top - browser_rows/2);
+ object_top = MAX(0, object_top - browser_rows / 2);
while (object_cur >= object_top + browser_rows)
- object_top = MIN(object_cnt - browser_rows, object_top + browser_rows/2);
+ object_top = MIN(object_cnt - browser_rows, object_top + browser_rows / 2);
}
if (!visual_list)
display_object_list(max + 3, 6, 1, object_idx, object_cur, object_top, visual_only);
/* Display visual list below first object */
- display_visual_list(max + 3, 7, browser_rows-1, wid - (max + 3), attr_top, char_left);
+ display_visual_list(max + 3, 7, browser_rows - 1, wid - (max + 3), attr_top, char_left);
}
/* Get the current object */
char ch = inkey();
/* Do visual mode command if needed */
- if (visual_mode_command(ch, &visual_list, browser_rows-1, wid - (max + 3), &attr_top, &char_left, &flavor_k_ptr->x_attr, &flavor_k_ptr->x_char, need_redraw))
+ if (visual_mode_command(ch, &visual_list, browser_rows - 1, wid - (max + 3), &attr_top, &char_left, &flavor_k_ptr->x_attr, &flavor_k_ptr->x_char, need_redraw))
{
if (direct_k_idx >= 0)
{
switch (ch)
{
- case ESCAPE:
- {
- flag = TRUE;
- break;
- }
+ case ESCAPE:
+ {
+ flag = TRUE;
+ break;
+ }
- case 'R':
- case 'r':
+ case 'R':
+ case 'r':
+ {
+ /* Recall on screen */
+ if (!visual_list && !visual_only && (grp_cnt > 0))
{
- /* Recall on screen */
- if (!visual_list && !visual_only && (grp_cnt > 0))
- {
- desc_obj_fake(creature_ptr, object_idx[object_cur]);
- redraw = TRUE;
- }
- break;
+ desc_obj_fake(creature_ptr, object_idx[object_cur]);
+ redraw = TRUE;
}
+ break;
+ }
- default:
- {
- /* Move the cursor */
- browser_cursor(ch, &column, &grp_cur, grp_cnt, &object_cur, object_cnt);
- break;
- }
+ default:
+ {
+ /* Move the cursor */
+ browser_cursor(ch, &column, &grp_cur, grp_cnt, &object_cur, object_cnt);
+ break;
+ }
}
}
/* Scroll feature list */
while (feat_cur < feat_top)
- feat_top = MAX(0, feat_top - browser_rows/2);
+ feat_top = MAX(0, feat_top - browser_rows / 2);
while (feat_cur >= feat_top + browser_rows)
- feat_top = MIN(feat_cnt - browser_rows, feat_top + browser_rows/2);
+ feat_top = MIN(feat_cnt - browser_rows, feat_top + browser_rows / 2);
}
if (!visual_list)
display_feature_list(max + 3, 6, 1, feat_idx, feat_cur, feat_top, visual_only, *lighting_level);
/* Display visual list below first object */
- display_visual_list(max + 3, 7, browser_rows-1, wid - (max + 3), attr_top, char_left);
+ display_visual_list(max + 3, 7, browser_rows - 1, wid - (max + 3), attr_top, char_left);
}
/* Prompt */
if (visual_list)
{
if (prev_x_attr != f_ptr->x_attr[*lighting_level])
- attr_top = MAX(0, (f_ptr->x_attr[*lighting_level] & 0x7f) - 5);
+ attr_top = MAX(0, (f_ptr->x_attr[*lighting_level] & 0x7f) - 5);
if (prev_x_char != f_ptr->x_char[*lighting_level])
char_left = MAX(0, f_ptr->x_char[*lighting_level] - 10);
}
/* Do visual mode command if needed */
- else if (visual_mode_command(ch, &visual_list, browser_rows-1, wid - (max + 3), &attr_top, &char_left, cur_attr_ptr, cur_char_ptr, need_redraw))
+ else if (visual_mode_command(ch, &visual_list, browser_rows - 1, wid - (max + 3), &attr_top, &char_left, cur_attr_ptr, cur_char_ptr, need_redraw))
{
switch (ch)
{
- /* Restore previous visual settings */
+ /* Restore previous visual settings */
case ESCAPE:
for (FEAT_IDX i = 0; i < F_LIT_MAX; i++)
{
else *lighting_level = F_LIT_STANDARD;
break;
- /* Preserve current visual settings */
+ /* Preserve current visual settings */
case 'V':
case 'v':
for (FEAT_IDX i = 0; i < F_LIT_MAX; i++)
switch (ch)
{
- case ESCAPE:
- {
- flag = TRUE;
- break;
- }
+ case ESCAPE:
+ {
+ flag = TRUE;
+ break;
+ }
- default:
- {
- /* Move the cursor */
- browser_cursor(ch, &column, &grp_cur, grp_cnt, &feat_cur, feat_cnt);
- break;
- }
+ default:
+ {
+ /* Move the cursor */
+ browser_cursor(ch, &column, &grp_cur, grp_cnt, &feat_cur, feat_cnt);
+ break;
+ }
}
}
fff = my_fopen_temp(file_name, 1024);
if (!fff)
{
- msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
- msg_print(NULL);
- return;
+ msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
+ msg_print(NULL);
+ return;
}
-
+
fprintf(fff, _("今日のターゲット : %s\n", "Today target : %s\n"),
(creature_ptr->today_mon ? r_name + r_info[creature_ptr->today_mon].name : _("不明", "unknown")));
fprintf(fff, "\n");
{
fprintf(fff, "\n%s\n", _("賞金首はもう残っていません。", "There is no more wanted monster."));
}
-
+
my_fclose(fff);
-
+
/* Display the file contents */
show_file(creature_ptr, TRUE, file_name, _("賞金首の一覧", "Wanted monsters"), 0, 0);
fd_kill(file_name);
fff = my_fopen_temp(file_name, 1024);
if (!fff)
{
- msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
- msg_print(NULL);
- return;
+ msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
+ msg_print(NULL);
+ return;
}
-
+
fprintf(fff, _("現在の属性 : %s\n\n", "Your alighnment : %s\n\n"), your_alignment(creature_ptr));
dump_virtues(creature_ptr, fff);
my_fclose(fff);
-
+
/* Display the file contents */
show_file(creature_ptr, TRUE, file_name, _("八つの徳", "Virtues"), 0, 0);
fd_kill(file_name);
fff = my_fopen_temp(file_name, 1024);
if (!fff)
{
- msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
- msg_print(NULL);
- return;
+ msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
+ msg_print(NULL);
+ return;
}
-
+
for (int i = 1; i < current_world_ptr->max_d_idx; i++)
{
bool seiha = FALSE;
}
my_fclose(fff);
-
+
/* Display the file contents */
show_file(creature_ptr, TRUE, file_name, _("今までに入ったダンジョン", "Dungeon"), 0, 0);
fd_kill(file_name);
fff = my_fopen_temp(file_name, 1024);
if (!fff)
{
- msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
- msg_print(NULL);
- return;
+ msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
+ msg_print(NULL);
+ return;
}
-
+
int percent = (int)(((long)creature_ptr->player_hp[PY_MAX_LEVEL - 1] * 200L) /
(2 * creature_ptr->hitdie +
((PY_MAX_LEVEL - 1 + 3) * (creature_ptr->hitdie + 1))));
dump_yourself(creature_ptr, fff);
my_fclose(fff);
-
+
/* Display the file contents */
show_file(creature_ptr, TRUE, file_name, _("自分に関する情報", "HP-rate & Max stat"), 0, 0);
fd_kill(file_name);
continue;
}
-
+
/* QUEST_TYPE_RANDOM */
if (quest[i].level >= rand_level)
continue;
}
strnfmt(playtime_str, sizeof(playtime_str), "%02d:%02d:%02d",
- q_ptr->comptime/(60*60), (q_ptr->comptime/60)%60, q_ptr->comptime%60);
+ q_ptr->comptime / (60 * 60), (q_ptr->comptime / 60) % 60, q_ptr->comptime % 60);
if (is_fixed_quest_idx(q_idx) && q_ptr->r_idx)
{
fputs(tmp_str, fff);
return TRUE;
}
-
+
sprintf(tmp_str,
_(" %-35s (%3d階) - レベル%2d - %s\n",
" %-35s (Dungeon level: %3d) - level %2d - %s\n"),
quest_type* const q_ptr = &quest[q_idx];
if (((q_ptr->status == QUEST_STATUS_FAILED_DONE) || (q_ptr->status == QUEST_STATUS_FAILED)) &&
- do_cmd_knowledge_quests_aux(creature_ptr, fff, q_idx))
+ do_cmd_knowledge_quests_aux(creature_ptr, fff, q_idx))
{
++total;
}
/* Print the quest info */
sprintf(tmp_str, _(" %s (%d階, %s)\n", " %s (%d, %s)\n"),
- quest[i].name, (int)quest[i].level, r_name+r_info[quest[i].r_idx].name);
+ quest[i].name, (int)quest[i].level, r_name + r_info[quest[i].r_idx].name);
fputs(tmp_str, fff);
}
}
fff = my_fopen_temp(file_name, 1024);
if (!fff)
{
- msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
- msg_print(NULL);
- return;
+ msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
+ msg_print(NULL);
+ return;
}
/* Allocate Memory */
fff = my_fopen_temp(file_name, 1024);
if (!fff)
{
- msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
- msg_print(NULL);
- return;
+ msg_format(_("一時ファイル %s を作成できませんでした。", "Failed to create temporary file %s."), file_name);
+ msg_print(NULL);
+ return;
}
if (!max_autopick)
{
- fprintf(fff, _("自動破壊/拾いには何も登録されていません。", "No preference for auto picker/destroyer."));
+ fprintf(fff, _("自動破壊/拾いには何も登録されていません。", "No preference for auto picker/destroyer."));
}
else
{
fprintf(fff, _(" 自動拾い/破壊には現在 %d行登録されています。\n\n",
- " There are %d registered lines for auto picker/destroyer.\n\n"), max_autopick);
+ " There are %d registered lines for auto picker/destroyer.\n\n"), max_autopick);
}
for (int k = 0; k < max_autopick; k++)
Term_clear();
/* Ask for a choice */
- prt(format(_("%d/2 ページ", "page %d/2"), (p+1)), 2, 65);
+ prt(format(_("%d/2 ページ", "page %d/2"), (p + 1)), 2, 65);
prt(_("現在の知識を確認する", "Display current knowledge"), 3, 0);
/* Give some choices */
do_cmd_knowledge_inven(creature_ptr);
break;
case '0': /* Feature list */
- {
- IDX lighting_level = F_LIT_STANDARD;
- do_cmd_knowledge_features(&need_redraw, FALSE, -1, &lighting_level);
- }
- break;
+ {
+ IDX lighting_level = F_LIT_STANDARD;
+ do_cmd_knowledge_features(&need_redraw, FALSE, -1, &lighting_level);
+ }
+ break;
/* Next page */
case 'a': /* Max stat */
do_cmd_knowledge_stat(creature_ptr);
else strcpy(day_buf, "*****");
msg_format(_("%s日目, 時刻は%d:%02d %sです。", "This is day %s. The time is %d:%02d %s."),
- day_buf, (hour % 12 == 0) ? 12 : (hour % 12), min, (hour < 12) ? "AM" : "PM");
+ day_buf, (hour % 12 == 0) ? 12 : (hour % 12), min, (hour < 12) ? "AM" : "PM");
/* Find the path */
char buf[1024];
#include "realm-song.h"
#include "view-mainwindow.h"
-/*!
- * @brief 食料を食べるコマンドのサブルーチン
- * @param item 食べるオブジェクトの所持品ID
- * @return なし
- */
+ /*!
+ * @brief 食料を食べるコマンドのサブルーチン
+ * @param item 食べるオブジェクトの所持品ID
+ * @return なし
+ */
void exe_eat_food(player_type *creature_ptr, INVENTORY_IDX item)
{
int ident, lev;
}
else if (PRACE_IS_(creature_ptr, RACE_SKELETON))
{
- if (!((o_ptr->sval == SV_FOOD_WAYBREAD) ||
- (o_ptr->sval < SV_FOOD_BISCUIT)))
- {
- object_type forge;
- object_type *q_ptr = &forge;
+ if (!((o_ptr->sval == SV_FOOD_WAYBREAD) ||
+ (o_ptr->sval < SV_FOOD_BISCUIT)))
+ {
+ object_type forge;
+ object_type *q_ptr = &forge;
- msg_print(_("食べ物がアゴを素通りして落ちた!", "The food falls through your jaws!"));
- object_prep(q_ptr, lookup_kind(o_ptr->tval, o_ptr->sval));
+ msg_print(_("食べ物がアゴを素通りして落ちた!", "The food falls through your jaws!"));
+ object_prep(q_ptr, lookup_kind(o_ptr->tval, o_ptr->sval));
- /* Drop the object from heaven */
- (void)drop_near(creature_ptr, q_ptr, -1, creature_ptr->y, creature_ptr->x);
- }
- else
- {
- msg_print(_("食べ物がアゴを素通りして落ち、消えた!", "The food falls through your jaws and vanishes!"));
- }
+ /* Drop the object from heaven */
+ (void)drop_near(creature_ptr, q_ptr, -1, creature_ptr->y, creature_ptr->x);
+ }
+ else
+ {
+ msg_print(_("食べ物がアゴを素通りして落ち、消えた!", "The food falls through your jaws and vanishes!"));
+ }
}
else if (PRACE_IS_(creature_ptr, RACE_GOLEM) ||
PRACE_IS_(creature_ptr, RACE_ZOMBIE) ||
/*!
- @file dungeon.c
- @brief Angbandゲームエンジン / Angband game engine
- @date 2013/12/31
- @author
- Copyright (c) 1989 James E. Wilson, Robert A. Koeneke\n
- This software may be copied and distributed for educational, research, and\n
- not for profit purposes provided that this copyright and statement are\n
- included in all such copies.\n
- 2013 Deskull rearranged comment for Doxygen.
+ @file dungeon.c
+ @brief Angbandゲームエンジン / Angband game engine
+ @date 2013/12/31
+ @author
+ Copyright (c) 1989 James E. Wilson, Robert A. Koeneke\n
+ This software may be copied and distributed for educational, research, and\n
+ not for profit purposes provided that this copyright and statement are\n
+ included in all such copies.\n
+ 2013 Deskull rearranged comment for Doxygen.
*/
#include "angband.h"
{
switch (feel)
{
- case FEEL_TERRIBLE:
- {
- feel = FEEL_SPECIAL;
- break;
- }
- case FEEL_WORTHLESS:
- {
- feel = FEEL_EXCELLENT;
- break;
- }
- case FEEL_CURSED:
- {
- if (heavy)
- feel = randint0(3) ? FEEL_GOOD : FEEL_AVERAGE;
- else
- feel = FEEL_UNCURSED;
- break;
- }
- case FEEL_AVERAGE:
- {
- feel = randint0(2) ? FEEL_CURSED : FEEL_GOOD;
- break;
- }
- case FEEL_GOOD:
- {
- if (heavy)
- feel = randint0(3) ? FEEL_CURSED : FEEL_AVERAGE;
- else
- feel = FEEL_CURSED;
- break;
- }
- case FEEL_EXCELLENT:
- {
- feel = FEEL_WORTHLESS;
- break;
- }
- case FEEL_SPECIAL:
- {
- feel = FEEL_TERRIBLE;
- break;
- }
+ case FEEL_TERRIBLE:
+ {
+ feel = FEEL_SPECIAL;
+ break;
+ }
+ case FEEL_WORTHLESS:
+ {
+ feel = FEEL_EXCELLENT;
+ break;
+ }
+ case FEEL_CURSED:
+ {
+ if (heavy)
+ feel = randint0(3) ? FEEL_GOOD : FEEL_AVERAGE;
+ else
+ feel = FEEL_UNCURSED;
+ break;
+ }
+ case FEEL_AVERAGE:
+ {
+ feel = randint0(2) ? FEEL_CURSED : FEEL_GOOD;
+ break;
+ }
+ case FEEL_GOOD:
+ {
+ if (heavy)
+ feel = randint0(3) ? FEEL_CURSED : FEEL_AVERAGE;
+ else
+ feel = FEEL_CURSED;
+ break;
+ }
+ case FEEL_EXCELLENT:
+ {
+ feel = FEEL_WORTHLESS;
+ break;
+ }
+ case FEEL_SPECIAL:
+ {
+ feel = FEEL_TERRIBLE;
+ break;
+ }
}
}
{
#ifdef JP
msg_format("%s%s(%c)は%sという感じがする...",
- describe_use(creature_ptr, slot),o_name, index_to_label(slot),game_inscriptions[feel]);
+ describe_use(creature_ptr, slot), o_name, index_to_label(slot), game_inscriptions[feel]);
#else
msg_format("You feel the %s (%c) you are %s %s %s...",
- o_name, index_to_label(slot), describe_use(slot),
- ((o_ptr->number == 1) ? "is" : "are"),
- game_inscriptions[feel]);
+ o_name, index_to_label(slot), describe_use(slot),
+ ((o_ptr->number == 1) ? "is" : "are"),
+ game_inscriptions[feel]);
#endif
}
{
#ifdef JP
msg_format("ザックの中の%s(%c)は%sという感じがする...",
- o_name, index_to_label(slot),game_inscriptions[feel]);
+ o_name, index_to_label(slot), game_inscriptions[feel]);
#else
msg_format("You feel the %s (%c) in your pack %s %s...",
- o_name, index_to_label(slot),
- ((o_ptr->number == 1) ? "is" : "are"),
- game_inscriptions[feel]);
+ o_name, index_to_label(slot),
+ ((o_ptr->number == 1) ? "is" : "are"),
+ game_inscriptions[feel]);
#endif
}
/* Analyze the class */
switch (creature_ptr->pclass)
{
- case CLASS_WARRIOR:
- case CLASS_ARCHER:
- case CLASS_SAMURAI:
- case CLASS_CAVALRY:
- {
- /* Good sensing */
- if (0 != randint0(9000L / (plev * plev + 40))) return;
+ case CLASS_WARRIOR:
+ case CLASS_ARCHER:
+ case CLASS_SAMURAI:
+ case CLASS_CAVALRY:
+ {
+ /* Good sensing */
+ if (0 != randint0(9000L / (plev * plev + 40))) return;
- /* Heavy sensing */
- heavy = TRUE;
+ /* Heavy sensing */
+ heavy = TRUE;
- break;
- }
+ break;
+ }
- case CLASS_SMITH:
- {
- /* Good sensing */
- if (0 != randint0(6000L / (plev * plev + 50))) return;
+ case CLASS_SMITH:
+ {
+ /* Good sensing */
+ if (0 != randint0(6000L / (plev * plev + 50))) return;
- /* Heavy sensing */
- heavy = TRUE;
+ /* Heavy sensing */
+ heavy = TRUE;
- break;
- }
+ break;
+ }
- case CLASS_MAGE:
- case CLASS_HIGH_MAGE:
- case CLASS_SORCERER:
- case CLASS_MAGIC_EATER:
- {
- /* Very bad (light) sensing */
- if (0 != randint0(240000L / (plev + 5))) return;
+ case CLASS_MAGE:
+ case CLASS_HIGH_MAGE:
+ case CLASS_SORCERER:
+ case CLASS_MAGIC_EATER:
+ {
+ /* Very bad (light) sensing */
+ if (0 != randint0(240000L / (plev + 5))) return;
- break;
- }
+ break;
+ }
- case CLASS_PRIEST:
- case CLASS_BARD:
- {
- /* Good (light) sensing */
- if (0 != randint0(10000L / (plev * plev + 40))) return;
+ case CLASS_PRIEST:
+ case CLASS_BARD:
+ {
+ /* Good (light) sensing */
+ if (0 != randint0(10000L / (plev * plev + 40))) return;
- break;
- }
+ break;
+ }
- case CLASS_ROGUE:
- case CLASS_NINJA:
- {
- /* Okay sensing */
- if (0 != randint0(20000L / (plev * plev + 40))) return;
+ case CLASS_ROGUE:
+ case CLASS_NINJA:
+ {
+ /* Okay sensing */
+ if (0 != randint0(20000L / (plev * plev + 40))) return;
- /* Heavy sensing */
- heavy = TRUE;
+ /* Heavy sensing */
+ heavy = TRUE;
- break;
- }
+ break;
+ }
- case CLASS_RANGER:
- {
- /* Bad sensing */
- if (0 != randint0(95000L / (plev * plev + 40))) return;
+ case CLASS_RANGER:
+ {
+ /* Bad sensing */
+ if (0 != randint0(95000L / (plev * plev + 40))) return;
- /* Changed! */
- heavy = TRUE;
+ /* Changed! */
+ heavy = TRUE;
- break;
- }
+ break;
+ }
- case CLASS_PALADIN:
- case CLASS_SNIPER:
- {
- /* Bad sensing */
- if (0 != randint0(77777L / (plev * plev + 40))) return;
+ case CLASS_PALADIN:
+ case CLASS_SNIPER:
+ {
+ /* Bad sensing */
+ if (0 != randint0(77777L / (plev * plev + 40))) return;
- /* Heavy sensing */
- heavy = TRUE;
+ /* Heavy sensing */
+ heavy = TRUE;
- break;
- }
+ break;
+ }
- case CLASS_WARRIOR_MAGE:
- case CLASS_RED_MAGE:
- {
- /* Bad sensing */
- if (0 != randint0(75000L / (plev * plev + 40))) return;
+ case CLASS_WARRIOR_MAGE:
+ case CLASS_RED_MAGE:
+ {
+ /* Bad sensing */
+ if (0 != randint0(75000L / (plev * plev + 40))) return;
- break;
- }
+ break;
+ }
- case CLASS_MINDCRAFTER:
- case CLASS_IMITATOR:
- case CLASS_BLUE_MAGE:
- case CLASS_MIRROR_MASTER:
- {
- /* Bad sensing */
- if (0 != randint0(55000L / (plev * plev + 40))) return;
+ case CLASS_MINDCRAFTER:
+ case CLASS_IMITATOR:
+ case CLASS_BLUE_MAGE:
+ case CLASS_MIRROR_MASTER:
+ {
+ /* Bad sensing */
+ if (0 != randint0(55000L / (plev * plev + 40))) return;
- break;
- }
+ break;
+ }
- case CLASS_CHAOS_WARRIOR:
- {
- /* Bad sensing */
- if (0 != randint0(80000L / (plev * plev + 40))) return;
+ case CLASS_CHAOS_WARRIOR:
+ {
+ /* Bad sensing */
+ if (0 != randint0(80000L / (plev * plev + 40))) return;
- /* Changed! */
- heavy = TRUE;
+ /* Changed! */
+ heavy = TRUE;
- break;
- }
+ break;
+ }
- case CLASS_MONK:
- case CLASS_FORCETRAINER:
- {
- /* Okay sensing */
- if (0 != randint0(20000L / (plev * plev + 40))) return;
+ case CLASS_MONK:
+ case CLASS_FORCETRAINER:
+ {
+ /* Okay sensing */
+ if (0 != randint0(20000L / (plev * plev + 40))) return;
- break;
- }
+ break;
+ }
- case CLASS_TOURIST:
- {
- /* Good sensing */
- if (0 != randint0(20000L / ((plev+50)*(plev+50)))) return;
+ case CLASS_TOURIST:
+ {
+ /* Good sensing */
+ if (0 != randint0(20000L / ((plev + 50)*(plev + 50)))) return;
- /* Heavy sensing */
- heavy = TRUE;
+ /* Heavy sensing */
+ heavy = TRUE;
- break;
- }
+ break;
+ }
- case CLASS_BEASTMASTER:
- {
- /* Bad sensing */
- if (0 != randint0(65000L / (plev * plev + 40))) return;
+ case CLASS_BEASTMASTER:
+ {
+ /* Bad sensing */
+ if (0 != randint0(65000L / (plev * plev + 40))) return;
- break;
- }
- case CLASS_BERSERKER:
- {
- /* Heavy sensing */
- heavy = TRUE;
+ break;
+ }
+ case CLASS_BERSERKER:
+ {
+ /* Heavy sensing */
+ heavy = TRUE;
- break;
- }
+ break;
+ }
}
if (compare_virtue(creature_ptr, V_KNOWLEDGE, 100, VIRTUE_LARGE)) heavy = TRUE;
/* Valid "tval" codes */
switch (o_ptr->tval)
{
- case TV_SHOT:
- case TV_ARROW:
- case TV_BOLT:
- case TV_BOW:
- case TV_DIGGING:
- case TV_HAFTED:
- case TV_POLEARM:
- case TV_SWORD:
- case TV_BOOTS:
- case TV_GLOVES:
- case TV_HELM:
- case TV_CROWN:
- case TV_SHIELD:
- case TV_CLOAK:
- case TV_SOFT_ARMOR:
- case TV_HARD_ARMOR:
- case TV_DRAG_ARMOR:
- case TV_CARD:
- {
- okay = TRUE;
- break;
- }
+ case TV_SHOT:
+ case TV_ARROW:
+ case TV_BOLT:
+ case TV_BOW:
+ case TV_DIGGING:
+ case TV_HAFTED:
+ case TV_POLEARM:
+ case TV_SWORD:
+ case TV_BOOTS:
+ case TV_GLOVES:
+ case TV_HELM:
+ case TV_CROWN:
+ case TV_SHIELD:
+ case TV_CLOAK:
+ case TV_SOFT_ARMOR:
+ case TV_HARD_ARMOR:
+ case TV_DRAG_ARMOR:
+ case TV_CARD:
+ {
+ okay = TRUE;
+ break;
+ }
}
/* Skip non-sense machines */
/* Analyze the class */
switch (creature_ptr->pclass)
{
- case CLASS_WARRIOR:
- case CLASS_ARCHER:
- case CLASS_SAMURAI:
- case CLASS_CAVALRY:
- case CLASS_BERSERKER:
- case CLASS_SNIPER:
- {
- return;
- }
+ case CLASS_WARRIOR:
+ case CLASS_ARCHER:
+ case CLASS_SAMURAI:
+ case CLASS_CAVALRY:
+ case CLASS_BERSERKER:
+ case CLASS_SNIPER:
+ {
+ return;
+ }
- case CLASS_SMITH:
- case CLASS_PALADIN:
- case CLASS_CHAOS_WARRIOR:
- case CLASS_IMITATOR:
- case CLASS_BEASTMASTER:
- case CLASS_NINJA:
- {
- /* Very bad (light) sensing */
- if (0 != randint0(240000L / (plev + 5))) return;
+ case CLASS_SMITH:
+ case CLASS_PALADIN:
+ case CLASS_CHAOS_WARRIOR:
+ case CLASS_IMITATOR:
+ case CLASS_BEASTMASTER:
+ case CLASS_NINJA:
+ {
+ /* Very bad (light) sensing */
+ if (0 != randint0(240000L / (plev + 5))) return;
- break;
- }
+ break;
+ }
- case CLASS_RANGER:
- case CLASS_WARRIOR_MAGE:
- case CLASS_RED_MAGE:
- case CLASS_MONK:
- {
- /* Bad sensing */
- if (0 != randint0(95000L / (plev * plev + 40))) return;
+ case CLASS_RANGER:
+ case CLASS_WARRIOR_MAGE:
+ case CLASS_RED_MAGE:
+ case CLASS_MONK:
+ {
+ /* Bad sensing */
+ if (0 != randint0(95000L / (plev * plev + 40))) return;
- break;
- }
+ break;
+ }
- case CLASS_PRIEST:
- case CLASS_BARD:
- case CLASS_ROGUE:
- case CLASS_FORCETRAINER:
- case CLASS_MINDCRAFTER:
- {
- /* Good sensing */
- if (0 != randint0(20000L / (plev * plev + 40))) return;
+ case CLASS_PRIEST:
+ case CLASS_BARD:
+ case CLASS_ROGUE:
+ case CLASS_FORCETRAINER:
+ case CLASS_MINDCRAFTER:
+ {
+ /* Good sensing */
+ if (0 != randint0(20000L / (plev * plev + 40))) return;
- break;
- }
+ break;
+ }
- case CLASS_MAGE:
- case CLASS_HIGH_MAGE:
- case CLASS_SORCERER:
- case CLASS_MAGIC_EATER:
- case CLASS_MIRROR_MASTER:
- case CLASS_BLUE_MAGE:
- {
- /* Good sensing */
- if (0 != randint0(9000L / (plev * plev + 40))) return;
+ case CLASS_MAGE:
+ case CLASS_HIGH_MAGE:
+ case CLASS_SORCERER:
+ case CLASS_MAGIC_EATER:
+ case CLASS_MIRROR_MASTER:
+ case CLASS_BLUE_MAGE:
+ {
+ /* Good sensing */
+ if (0 != randint0(9000L / (plev * plev + 40))) return;
- break;
- }
+ break;
+ }
- case CLASS_TOURIST:
- {
- /* Good sensing */
- if (0 != randint0(20000L / ((plev+50)*(plev+50)))) return;
+ case CLASS_TOURIST:
+ {
+ /* Good sensing */
+ if (0 != randint0(20000L / ((plev + 50)*(plev + 50)))) return;
- break;
- }
+ break;
+ }
}
/*** Sense everything ***/
/* Valid "tval" codes */
switch (o_ptr->tval)
{
- case TV_RING:
- case TV_AMULET:
- case TV_LITE:
- case TV_FIGURINE:
- {
- okay = TRUE;
- break;
- }
+ case TV_RING:
+ case TV_AMULET:
+ case TV_LITE:
+ case TV_FIGURINE:
+ {
+ okay = TRUE;
+ break;
+ }
}
/* Skip non-sense machines */
if (!pattern_tile(creature_ptr->y, creature_ptr->x)) return FALSE;
if ((PRACE_IS_(creature_ptr, RACE_AMBERITE)) &&
- (creature_ptr->cut > 0) && one_in_(10))
+ (creature_ptr->cut > 0) && one_in_(10))
{
wreck_the_pattern(creature_ptr);
}
int dev = 30;
int mult = (dev + adj_mag_mana[creature_ptr->stat_ind[A_INT]]); /* x1 to x2 speed bonus for recharging */
- for (i = 0; i < EATER_EXT*2; i++)
+ for (i = 0; i < EATER_EXT * 2; i++)
{
if (!creature_ptr->magic_num2[i]) continue;
if (creature_ptr->magic_num1[i] == ((long)creature_ptr->magic_num2[i] << 16)) continue;
}
wild_regen = 20;
}
- for (i = EATER_EXT*2; i < EATER_EXT*3; i++)
+ for (i = EATER_EXT * 2; i < EATER_EXT * 3; i++)
{
if (!creature_ptr->magic_num1[i]) continue;
if (!creature_ptr->magic_num2[i]) continue;
/* Decrease remaining period for charging */
- new_mana = (regen_amount * mult * ((long)creature_ptr->magic_num2[i] + 10) * EATER_ROD_CHARGE)
- / (dev * 16 * PY_REGEN_NORMAL);
+ new_mana = (regen_amount * mult * ((long)creature_ptr->magic_num2[i] + 10) * EATER_ROD_CHARGE)
+ / (dev * 16 * PY_REGEN_NORMAL);
creature_ptr->magic_num1[i] -= new_mana;
/* Check minimum remaining period for charging */
else if (o_ptr->name2 == EGO_LITE_LONG)
{
if ((o_ptr->xtra4 < 50) && (!(o_ptr->xtra4 % 5))
- && (current_world_ptr->game_turn % (TURNS_PER_TICK*2)))
+ && (current_world_ptr->game_turn % (TURNS_PER_TICK * 2)))
{
if (disturb_minor) disturb(creature_ptr, FALSE, TRUE);
msg_print(_("明かりが微かになってきている。", "Your light is growing faint."));
else if ((o_ptr->xtra4 < 100) && (!(o_ptr->xtra4 % 10)))
{
if (disturb_minor) disturb(creature_ptr, FALSE, TRUE);
- msg_print(_("明かりが微かになってきている。", "Your light is growing faint."));
+ msg_print(_("明かりが微かになってきている。", "Your light is growing faint."));
}
}
}
if (caster_ptr->spell_exp[spell] < SPELL_EXP_BEGINNER)
caster_ptr->spell_exp[spell] += 5;
- else if(caster_ptr->spell_exp[spell] < SPELL_EXP_SKILLED)
- { if (one_in_(2) && (caster_ptr->current_floor_ptr->dun_level > 4) && ((caster_ptr->current_floor_ptr->dun_level + 10) > caster_ptr->lev)) caster_ptr->spell_exp[spell] += 1; }
- else if(caster_ptr->spell_exp[spell] < SPELL_EXP_EXPERT)
- { if (one_in_(5) && ((caster_ptr->current_floor_ptr->dun_level + 5) > caster_ptr->lev) && ((caster_ptr->current_floor_ptr->dun_level + 5) > s_ptr->slevel)) caster_ptr->spell_exp[spell] += 1; }
- else if(caster_ptr->spell_exp[spell] < SPELL_EXP_MASTER)
- { if (one_in_(5) && ((caster_ptr->current_floor_ptr->dun_level + 5) > caster_ptr->lev) && (caster_ptr->current_floor_ptr->dun_level > s_ptr->slevel)) caster_ptr->spell_exp[spell] += 1; }
+ else if (caster_ptr->spell_exp[spell] < SPELL_EXP_SKILLED)
+ {
+ if (one_in_(2) && (caster_ptr->current_floor_ptr->dun_level > 4) && ((caster_ptr->current_floor_ptr->dun_level + 10) > caster_ptr->lev)) caster_ptr->spell_exp[spell] += 1;
+ }
+ else if (caster_ptr->spell_exp[spell] < SPELL_EXP_EXPERT)
+ {
+ if (one_in_(5) && ((caster_ptr->current_floor_ptr->dun_level + 5) > caster_ptr->lev) && ((caster_ptr->current_floor_ptr->dun_level + 5) > s_ptr->slevel)) caster_ptr->spell_exp[spell] += 1;
+ }
+ else if (caster_ptr->spell_exp[spell] < SPELL_EXP_MASTER)
+ {
+ if (one_in_(5) && ((caster_ptr->current_floor_ptr->dun_level + 5) > caster_ptr->lev) && (caster_ptr->current_floor_ptr->dun_level > s_ptr->slevel)) caster_ptr->spell_exp[spell] += 1;
+ }
/* Do any effects of continual song */
exe_spell(caster_ptr, REALM_MUSIC, spell, SPELL_CONT);
static object_type *choose_cursed_obj_name(BIT_FLAGS flag)
{
int i;
- int choices[INVEN_TOTAL-INVEN_RARM];
+ int choices[INVEN_TOTAL - INVEN_RARM];
int number = 0;
/* Paranoia -- Player has no warning-item */
choices[number] = i;
number++;
}
- else if ((flag == TRC_ADD_L_CURSE) ||
- (flag == TRC_ADD_H_CURSE) ||
- (flag == TRC_DRAIN_HP) ||
- (flag == TRC_DRAIN_MANA) ||
- (flag == TRC_CALL_ANIMAL) ||
- (flag == TRC_CALL_DEMON) ||
- (flag == TRC_CALL_DRAGON) ||
- (flag == TRC_CALL_UNDEAD) ||
- (flag == TRC_COWARDICE) ||
- (flag == TRC_LOW_MELEE) ||
- (flag == TRC_LOW_AC) ||
- (flag == TRC_LOW_MAGIC) ||
- (flag == TRC_FAST_DIGEST) ||
- (flag == TRC_SLOW_REGEN) )
+ else if ((flag == TRC_ADD_L_CURSE) ||
+ (flag == TRC_ADD_H_CURSE) ||
+ (flag == TRC_DRAIN_HP) ||
+ (flag == TRC_DRAIN_MANA) ||
+ (flag == TRC_CALL_ANIMAL) ||
+ (flag == TRC_CALL_DEMON) ||
+ (flag == TRC_CALL_DRAGON) ||
+ (flag == TRC_CALL_UNDEAD) ||
+ (flag == TRC_COWARDICE) ||
+ (flag == TRC_LOW_MELEE) ||
+ (flag == TRC_LOW_AC) ||
+ (flag == TRC_LOW_MAGIC) ||
+ (flag == TRC_FAST_DIGEST) ||
+ (flag == TRC_SLOW_REGEN))
{
u32b cf = 0L;
BIT_FLAGS flgs[TR_FLAG_SIZE];
object_flags(o_ptr, flgs);
switch (flag)
{
- case TRC_ADD_L_CURSE : cf = TR_ADD_L_CURSE; break;
- case TRC_ADD_H_CURSE : cf = TR_ADD_H_CURSE; break;
- case TRC_DRAIN_HP : cf = TR_DRAIN_HP; break;
- case TRC_DRAIN_MANA : cf = TR_DRAIN_MANA; break;
- case TRC_CALL_ANIMAL : cf = TR_CALL_ANIMAL; break;
- case TRC_CALL_DEMON : cf = TR_CALL_DEMON; break;
- case TRC_CALL_DRAGON : cf = TR_CALL_DRAGON; break;
- case TRC_CALL_UNDEAD : cf = TR_CALL_UNDEAD; break;
- case TRC_COWARDICE : cf = TR_COWARDICE; break;
- case TRC_LOW_MELEE : cf = TR_LOW_MELEE; break;
- case TRC_LOW_AC : cf = TR_LOW_AC; break;
- case TRC_LOW_MAGIC : cf = TR_LOW_MAGIC; break;
- case TRC_FAST_DIGEST : cf = TR_FAST_DIGEST; break;
- case TRC_SLOW_REGEN : cf = TR_SLOW_REGEN; break;
- default : break;
+ case TRC_ADD_L_CURSE: cf = TR_ADD_L_CURSE; break;
+ case TRC_ADD_H_CURSE: cf = TR_ADD_H_CURSE; break;
+ case TRC_DRAIN_HP: cf = TR_DRAIN_HP; break;
+ case TRC_DRAIN_MANA: cf = TR_DRAIN_MANA; break;
+ case TRC_CALL_ANIMAL: cf = TR_CALL_ANIMAL; break;
+ case TRC_CALL_DEMON: cf = TR_CALL_DEMON; break;
+ case TRC_CALL_DRAGON: cf = TR_CALL_DRAGON; break;
+ case TRC_CALL_UNDEAD: cf = TR_CALL_UNDEAD; break;
+ case TRC_COWARDICE: cf = TR_COWARDICE; break;
+ case TRC_LOW_MELEE: cf = TR_LOW_MELEE; break;
+ case TRC_LOW_AC: cf = TR_LOW_AC; break;
+ case TRC_LOW_MAGIC: cf = TR_LOW_MAGIC; break;
+ case TRC_FAST_DIGEST: cf = TR_FAST_DIGEST; break;
+ case TRC_SLOW_REGEN: cf = TR_SLOW_REGEN; break;
+ default: break;
}
if (have_flag(flgs, cf))
{
}
if (creature_ptr->inventory_list[INVEN_LITE].tval && (creature_ptr->inventory_list[INVEN_LITE].name2 != EGO_LITE_DARKNESS) &&
- !creature_ptr->resist_lite)
+ !creature_ptr->resist_lite)
{
object_type *o_ptr = &creature_ptr->inventory_list[INVEN_LITE];
- GAME_TEXT o_name [MAX_NLEN];
- char ouch [MAX_NLEN+40];
+ GAME_TEXT o_name[MAX_NLEN];
+ char ouch[MAX_NLEN + 40];
/* Get an object description */
object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
if (damage)
{
- if(PRACE_IS_(creature_ptr, RACE_ENT)) damage += damage / 3;
- if(creature_ptr->resist_fire) damage = damage / 3;
- if(is_oppose_fire(creature_ptr)) damage = damage / 3;
- if(creature_ptr->levitation) damage = damage / 5;
+ if (PRACE_IS_(creature_ptr, RACE_ENT)) damage += damage / 3;
+ if (creature_ptr->resist_fire) damage = damage / 3;
+ if (is_oppose_fire(creature_ptr)) damage = damage / 3;
+ if (creature_ptr->levitation) damage = damage / 5;
damage = damage / 100 + (randint0(100) < (damage % 100));
if (creature_ptr->levitation)
{
msg_print(_("熱で火傷した!", "The heat burns you!"));
- take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
- f_name + f_info[get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1);
+ take_hit(creature_ptr, DAMAGE_NOESCAPE, damage, format(_("%sの上に浮遊したダメージ", "flying over %s"),
+ f_name + f_info[get_feat_mimic(&creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x])].name), -1);
}
else
{
}
if (have_flag(f_ptr->flags, FF_WATER) && have_flag(f_ptr->flags, FF_DEEP) &&
- !creature_ptr->levitation && !creature_ptr->can_swim && !creature_ptr->resist_water)
+ !creature_ptr->levitation && !creature_ptr->can_swim && !creature_ptr->resist_water)
{
if (creature_ptr->total_weight > weight_limit(creature_ptr))
{
/* No regeneration while special action */
if ((creature_ptr->action == ACTION_LEARN) ||
- (creature_ptr->action == ACTION_HAYAGAKE) ||
- (creature_ptr->special_defense & KATA_KOUKIJIN))
+ (creature_ptr->action == ACTION_HAYAGAKE) ||
+ (creature_ptr->special_defense & KATA_KOUKIJIN))
{
upkeep_factor += 100;
}
if (creature_ptr->cut > 1000) adjust = 0;
/* Apply some healing */
- (void)set_cut(creature_ptr,creature_ptr->cut - adjust);
+ (void)set_cut(creature_ptr, creature_ptr->cut - adjust);
}
}
/* Decrease life-span */
if (o_ptr->name2 == EGO_LITE_LONG)
{
- if (current_world_ptr->game_turn % (TURNS_PER_TICK*2)) o_ptr->xtra4--;
+ if (current_world_ptr->game_turn % (TURNS_PER_TICK * 2)) o_ptr->xtra4--;
}
else o_ptr->xtra4--;
msg_print(NULL);
if (one_in_(3)) lose_all_info(creature_ptr);
else wiz_dark(creature_ptr);
- (void)teleport_player_aux(creature_ptr,100, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
+ (void)teleport_player_aux(creature_ptr, 100, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
wiz_dark(creature_ptr);
msg_print(_("あなたは見知らぬ場所で目が醒めた...頭が痛い。", "You wake up somewhere with a sore head..."));
msg_print(_("何も覚えていない。どうやってここに来たかも分からない!", "You can't remember a thing, or how you got here!"));
}
if ((creature_ptr->muta2 & MUT2_PROD_MANA) &&
- !creature_ptr->anti_magic && one_in_(9000))
+ !creature_ptr->anti_magic && one_in_(9000))
{
int dire = 0;
disturb(creature_ptr, FALSE, TRUE);
- msg_print(_("魔法のエネルギーが突然あなたの中に流れ込んできた!エネルギーを解放しなければならない!",
- "Magical energy flows through you! You must release it!"));
+ msg_print(_("魔法のエネルギーが突然あなたの中に流れ込んできた!エネルギーを解放しなければならない!",
+ "Magical energy flows through you! You must release it!"));
flush();
msg_print(NULL);
do
{
n = randint0(MAX_STORES);
- }
- while ((n == STORE_HOME) || (n == STORE_MUSEUM));
+ } while ((n == STORE_HOME) || (n == STORE_MUSEUM));
msg_print(_("店の主人が丘に向かって走っている!", "You see one of the shopkeepers running for the hills!"));
store_shuffle(creature_ptr, n);
}
else
{
- msg_format(_("%sに{.}(ピリオド)と銘を刻むと発動を抑制できます。",
- "You can inscribe {.} on your %s to disable random teleportation. "), o_name);
+ msg_format(_("%sに{.}(ピリオド)と銘を刻むと発動を抑制できます。",
+ "You can inscribe {.} on your %s to disable random teleportation. "), o_name);
disturb(creature_ptr, TRUE, TRUE);
}
}
if ((creature_ptr->cursed & TRC_CALL_DRAGON) && one_in_(800))
{
if (summon_specific(0, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, SUMMON_DRAGON,
- (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
+ (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
{
GAME_TEXT o_name[MAX_NLEN];
if ((creature_ptr->cursed & TRC_CALL_UNDEAD) && one_in_(1111))
{
if (summon_specific(0, creature_ptr->y, creature_ptr->x, creature_ptr->current_floor_ptr->dun_level, SUMMON_UNDEAD,
- (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
+ (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
{
GAME_TEXT o_name[MAX_NLEN];
object_desc(o_name, choose_cursed_obj_name(TRC_DRAIN_HP), (OD_OMIT_PREFIX | OD_NAME_ONLY));
msg_format(_("%sはあなたの体力を吸収した!", "Your %s drains HP from you!"), o_name);
- take_hit(creature_ptr, DAMAGE_LOSELIFE, MIN(creature_ptr->lev*2, 100), o_name, -1);
+ take_hit(creature_ptr, DAMAGE_LOSELIFE, MIN(creature_ptr->lev * 2, 100), o_name, -1);
}
/* Handle mana draining */
if ((creature_ptr->cursed & TRC_DRAIN_MANA) && creature_ptr->csp && one_in_(666))
{
quest_type* const q_ptr = &quest[i];
-
+
if ((q_ptr->type == QUEST_TYPE_RANDOM) &&
- (q_ptr->status == QUEST_STATUS_TAKEN) &&
- (q_ptr->level < floor_ptr->dun_level))
+ (q_ptr->status == QUEST_STATUS_TAKEN) &&
+ (q_ptr->level < floor_ptr->dun_level))
{
q_ptr->status = QUEST_STATUS_FAILED;
q_ptr->complev = (byte)creature_ptr->lev;
const s32b A_DAY = TURNS_PER_TICK * TOWN_DAWN;
s32b prev_turn_in_today = ((current_world_ptr->game_turn - TURNS_PER_TICK) % A_DAY + A_DAY / 4) % A_DAY;
int prev_min = (1440 * prev_turn_in_today / A_DAY) % 60;
-
+
extract_day_hour_min(player_ptr, &day, &hour, &min);
/* Update dungeon feeling, and announce it if changed */
player_ptr->energy_need = 0;
update_gambling_monsters(player_ptr);
}
- else if ((number_mon-1) == 0)
+ else if ((number_mon - 1) == 0)
{
GAME_TEXT m_name[MAX_NLEN];
monster_type *wm_ptr;
msg_format(_("%sが勝利した!", "%s is winner!"), m_name);
msg_print(NULL);
- if (win_m_idx == (sel_monster+1))
+ if (win_m_idx == (sel_monster + 1))
{
msg_print(_("おめでとうございます。", "Congratulations."));
msg_format(_("%d$を受け取った。", "You received %d gold."), battle_odds);
do
{
n = randint0(MAX_STORES);
- }
- while ((n == STORE_HOME) || (n == STORE_MUSEUM));
+ } while ((n == STORE_HOME) || (n == STORE_MUSEUM));
/* Check every feature */
for (i = 1; i < max_f_idx; i++)
/* Check for creature generation. */
if (one_in_(d_info[player_ptr->dungeon_idx].max_m_alloc_chance) &&
- !floor_ptr->inside_arena && !floor_ptr->inside_quest && !player_ptr->phase_out)
+ !floor_ptr->inside_arena && !floor_ptr->inside_quest && !player_ptr->phase_out)
{
/* Make a new monster */
(void)alloc_monster(MAX_SIGHT + 5, 0);
switch (command_cmd)
{
/* Ignore */
- case ESCAPE:
- case ' ':
- {
- break;
- }
+ case ESCAPE:
+ case ' ':
+ {
+ break;
+ }
+
+ /* Ignore return */
+ case '\r':
+ case '\n':
+ {
+ break;
+ }
- /* Ignore return */
- case '\r':
- case '\n':
+ /*** Wizard Commands ***/
+ case KTRL('W'):
+ {
+ if (current_world_ptr->wizard)
{
- break;
+ current_world_ptr->wizard = FALSE;
+ msg_print(_("ウィザードモード解除。", "Wizard mode off."));
}
-
- /*** Wizard Commands ***/
- case KTRL('W'):
+ else if (enter_wizard_mode())
{
- if (current_world_ptr->wizard)
- {
- current_world_ptr->wizard = FALSE;
- msg_print(_("ウィザードモード解除。", "Wizard mode off."));
- }
- else if (enter_wizard_mode())
- {
- current_world_ptr->wizard = TRUE;
- msg_print(_("ウィザードモード突入。", "Wizard mode on."));
- }
- creature_ptr->update |= (PU_MONSTERS);
- creature_ptr->redraw |= (PR_TITLE);
-
- break;
+ current_world_ptr->wizard = TRUE;
+ msg_print(_("ウィザードモード突入。", "Wizard mode on."));
}
+ creature_ptr->update |= (PU_MONSTERS);
+ creature_ptr->redraw |= (PR_TITLE);
+
+ break;
+ }
#ifdef ALLOW_WIZARD
- /* Special "debug" commands */
- case KTRL('A'):
+ /* Special "debug" commands */
+ case KTRL('A'):
+ {
+ if (enter_debug_mode())
{
- if (enter_debug_mode())
- {
- do_cmd_debug(creature_ptr);
- }
- break;
+ do_cmd_debug(creature_ptr);
}
+ break;
+ }
#endif /* ALLOW_WIZARD */
#ifdef ALLOW_BORG
- /* Special "borg" commands */
- case KTRL('Z'):
+ /* Special "borg" commands */
+ case KTRL('Z'):
+ {
+ if (enter_borg_mode())
{
- if (enter_borg_mode())
- {
- if (!creature_ptr->wild_mode) do_cmd_borg();
- }
- break;
+ if (!creature_ptr->wild_mode) do_cmd_borg();
}
+ break;
+ }
#endif /* ALLOW_BORG */
- /*** Inventory Commands ***/
+ /*** Inventory Commands ***/
- /* Wear/wield equipment */
- case 'w':
- {
- if (!creature_ptr->wild_mode) do_cmd_wield(creature_ptr);
- break;
- }
+ /* Wear/wield equipment */
+ case 'w':
+ {
+ if (!creature_ptr->wild_mode) do_cmd_wield(creature_ptr);
+ break;
+ }
- /* Take off equipment */
- case 't':
- {
- if (!creature_ptr->wild_mode) do_cmd_takeoff(creature_ptr);
- break;
- }
+ /* Take off equipment */
+ case 't':
+ {
+ if (!creature_ptr->wild_mode) do_cmd_takeoff(creature_ptr);
+ break;
+ }
- /* Drop an item */
- case 'd':
- {
- if (!creature_ptr->wild_mode) do_cmd_drop(creature_ptr);
- break;
- }
+ /* Drop an item */
+ case 'd':
+ {
+ if (!creature_ptr->wild_mode) do_cmd_drop(creature_ptr);
+ break;
+ }
- /* Destroy an item */
- case 'k':
- {
- do_cmd_destroy(creature_ptr);
- break;
- }
+ /* Destroy an item */
+ case 'k':
+ {
+ do_cmd_destroy(creature_ptr);
+ break;
+ }
- /* Equipment list */
- case 'e':
- {
- do_cmd_equip(creature_ptr);
- break;
- }
+ /* Equipment list */
+ case 'e':
+ {
+ do_cmd_equip(creature_ptr);
+ break;
+ }
- /* Inventory list */
- case 'i':
- {
- do_cmd_inven(creature_ptr);
- break;
- }
+ /* Inventory list */
+ case 'i':
+ {
+ do_cmd_inven(creature_ptr);
+ break;
+ }
- /*** Various commands ***/
+ /*** Various commands ***/
- /* Identify an object */
- case 'I':
- {
- do_cmd_observe(creature_ptr);
- break;
- }
+ /* Identify an object */
+ case 'I':
+ {
+ do_cmd_observe(creature_ptr);
+ break;
+ }
- case KTRL('I'):
- {
- toggle_inven_equip(creature_ptr);
- break;
- }
+ case KTRL('I'):
+ {
+ toggle_inven_equip(creature_ptr);
+ break;
+ }
- /*** Standard "Movement" Commands ***/
+ /*** Standard "Movement" Commands ***/
- /* Alter a grid */
- case '+':
- {
- if (!creature_ptr->wild_mode) do_cmd_alter(creature_ptr);
- break;
- }
+ /* Alter a grid */
+ case '+':
+ {
+ if (!creature_ptr->wild_mode) do_cmd_alter(creature_ptr);
+ break;
+ }
- /* Dig a tunnel */
- case 'T':
- {
- if (!creature_ptr->wild_mode) do_cmd_tunnel(creature_ptr);
- break;
- }
+ /* Dig a tunnel */
+ case 'T':
+ {
+ if (!creature_ptr->wild_mode) do_cmd_tunnel(creature_ptr);
+ break;
+ }
- /* Move (usually pick up things) */
- case ';':
- {
- do_cmd_walk(creature_ptr, FALSE);
- break;
- }
+ /* Move (usually pick up things) */
+ case ';':
+ {
+ do_cmd_walk(creature_ptr, FALSE);
+ break;
+ }
- /* Move (usually do not pick up) */
- case '-':
- {
- do_cmd_walk(creature_ptr, TRUE);
- break;
- }
+ /* Move (usually do not pick up) */
+ case '-':
+ {
+ do_cmd_walk(creature_ptr, TRUE);
+ break;
+ }
- /*** Running, Resting, Searching, Staying */
+ /*** Running, Resting, Searching, Staying */
- /* Begin Running -- Arg is Max Distance */
- case '.':
- {
- if (!creature_ptr->wild_mode) do_cmd_run(creature_ptr);
- break;
- }
+ /* Begin Running -- Arg is Max Distance */
+ case '.':
+ {
+ if (!creature_ptr->wild_mode) do_cmd_run(creature_ptr);
+ break;
+ }
- /* Stay still (usually pick things up) */
- case ',':
- {
- do_cmd_stay(creature_ptr, always_pickup);
- break;
- }
+ /* Stay still (usually pick things up) */
+ case ',':
+ {
+ do_cmd_stay(creature_ptr, always_pickup);
+ break;
+ }
- /* Stay still (usually do not pick up) */
- case 'g':
- {
- do_cmd_stay(creature_ptr, !always_pickup);
- break;
- }
+ /* Stay still (usually do not pick up) */
+ case 'g':
+ {
+ do_cmd_stay(creature_ptr, !always_pickup);
+ break;
+ }
- /* Rest -- Arg is time */
- case 'R':
- {
- do_cmd_rest(creature_ptr);
- break;
- }
+ /* Rest -- Arg is time */
+ case 'R':
+ {
+ do_cmd_rest(creature_ptr);
+ break;
+ }
- /* Search for traps/doors */
- case 's':
- {
- do_cmd_search(creature_ptr);
- break;
- }
+ /* Search for traps/doors */
+ case 's':
+ {
+ do_cmd_search(creature_ptr);
+ break;
+ }
- case 'S':
- {
- if (creature_ptr->action == ACTION_SEARCH) set_action(creature_ptr, ACTION_NONE);
- else set_action(creature_ptr, ACTION_SEARCH);
- break;
- }
+ case 'S':
+ {
+ if (creature_ptr->action == ACTION_SEARCH) set_action(creature_ptr, ACTION_NONE);
+ else set_action(creature_ptr, ACTION_SEARCH);
+ break;
+ }
- /*** Stairs and Doors and Chests and Traps ***/
+ /*** Stairs and Doors and Chests and Traps ***/
- /* Enter store */
- case SPECIAL_KEY_STORE:
- {
- do_cmd_store(creature_ptr);
- break;
- }
+ /* Enter store */
+ case SPECIAL_KEY_STORE:
+ {
+ do_cmd_store(creature_ptr);
+ break;
+ }
- /* Enter building -KMW- */
- case SPECIAL_KEY_BUILDING:
- {
- do_cmd_bldg(creature_ptr);
- break;
- }
+ /* Enter building -KMW- */
+ case SPECIAL_KEY_BUILDING:
+ {
+ do_cmd_bldg(creature_ptr);
+ break;
+ }
- /* Enter quest level -KMW- */
- case SPECIAL_KEY_QUEST:
- {
- do_cmd_quest(creature_ptr);
- break;
- }
+ /* Enter quest level -KMW- */
+ case SPECIAL_KEY_QUEST:
+ {
+ do_cmd_quest(creature_ptr);
+ break;
+ }
- /* Go up staircase */
- case '<':
+ /* Go up staircase */
+ case '<':
+ {
+ if (!creature_ptr->wild_mode && !floor_ptr->dun_level && !floor_ptr->inside_arena && !floor_ptr->inside_quest)
{
- if (!creature_ptr->wild_mode && !floor_ptr->dun_level && !floor_ptr->inside_arena && !floor_ptr->inside_quest)
- {
- if (vanilla_town) break;
+ if (vanilla_town) break;
- if (creature_ptr->ambush_flag)
- {
- msg_print(_("襲撃から逃げるにはマップの端まで移動しなければならない。", "To flee the ambush you have to reach the edge of the map."));
- break;
- }
-
- if (creature_ptr->food < PY_FOOD_WEAK)
- {
- msg_print(_("その前に食事をとらないと。", "You must eat something here."));
- break;
- }
+ if (creature_ptr->ambush_flag)
+ {
+ msg_print(_("襲撃から逃げるにはマップの端まで移動しなければならない。", "To flee the ambush you have to reach the edge of the map."));
+ break;
+ }
- change_wild_mode(creature_ptr, FALSE);
+ if (creature_ptr->food < PY_FOOD_WEAK)
+ {
+ msg_print(_("その前に食事をとらないと。", "You must eat something here."));
+ break;
}
- else
- do_cmd_go_up(creature_ptr);
- break;
- }
- /* Go down staircase */
- case '>':
- {
- if (creature_ptr->wild_mode)
- change_wild_mode(creature_ptr, FALSE);
- else
- do_cmd_go_down(creature_ptr);
- break;
+ change_wild_mode(creature_ptr, FALSE);
}
+ else
+ do_cmd_go_up(creature_ptr);
+ break;
+ }
- /* Open a door or chest */
- case 'o':
- {
- do_cmd_open(creature_ptr);
- break;
- }
+ /* Go down staircase */
+ case '>':
+ {
+ if (creature_ptr->wild_mode)
+ change_wild_mode(creature_ptr, FALSE);
+ else
+ do_cmd_go_down(creature_ptr);
+ break;
+ }
- /* Close a door */
- case 'c':
- {
- do_cmd_close(creature_ptr);
- break;
- }
+ /* Open a door or chest */
+ case 'o':
+ {
+ do_cmd_open(creature_ptr);
+ break;
+ }
- /* Jam a door with spikes */
- case 'j':
- {
- do_cmd_spike(creature_ptr);
- break;
- }
+ /* Close a door */
+ case 'c':
+ {
+ do_cmd_close(creature_ptr);
+ break;
+ }
- /* Bash a door */
- case 'B':
- {
- do_cmd_bash(creature_ptr);
- break;
- }
+ /* Jam a door with spikes */
+ case 'j':
+ {
+ do_cmd_spike(creature_ptr);
+ break;
+ }
- /* Disarm a trap or chest */
- case 'D':
- {
- do_cmd_disarm(creature_ptr);
- break;
- }
+ /* Bash a door */
+ case 'B':
+ {
+ do_cmd_bash(creature_ptr);
+ break;
+ }
+ /* Disarm a trap or chest */
+ case 'D':
+ {
+ do_cmd_disarm(creature_ptr);
+ break;
+ }
- /*** Magic and Prayers ***/
- /* Gain new spells/prayers */
- case 'G':
- {
- if ((creature_ptr->pclass == CLASS_SORCERER) || (creature_ptr->pclass == CLASS_RED_MAGE))
- msg_print(_("呪文を学習する必要はない!", "You don't have to learn spells!"));
- else if (creature_ptr->pclass == CLASS_SAMURAI)
- do_cmd_gain_hissatsu(creature_ptr);
- else if (creature_ptr->pclass == CLASS_MAGIC_EATER)
- import_magic_device(creature_ptr);
- else
- do_cmd_study(creature_ptr);
- break;
- }
+ /*** Magic and Prayers ***/
- /* Browse a book */
- case 'b':
- {
- if ( (creature_ptr->pclass == CLASS_MINDCRAFTER) ||
- (creature_ptr->pclass == CLASS_BERSERKER) ||
- (creature_ptr->pclass == CLASS_NINJA) ||
- (creature_ptr->pclass == CLASS_MIRROR_MASTER)
- ) do_cmd_mind_browse(creature_ptr);
- else if (creature_ptr->pclass == CLASS_SMITH)
- do_cmd_kaji(creature_ptr, TRUE);
- else if (creature_ptr->pclass == CLASS_MAGIC_EATER)
- do_cmd_magic_eater(creature_ptr, TRUE, FALSE);
- else if (creature_ptr->pclass == CLASS_SNIPER)
- do_cmd_snipe_browse(creature_ptr);
- else do_cmd_browse(creature_ptr);
- break;
- }
+ /* Gain new spells/prayers */
+ case 'G':
+ {
+ if ((creature_ptr->pclass == CLASS_SORCERER) || (creature_ptr->pclass == CLASS_RED_MAGE))
+ msg_print(_("呪文を学習する必要はない!", "You don't have to learn spells!"));
+ else if (creature_ptr->pclass == CLASS_SAMURAI)
+ do_cmd_gain_hissatsu(creature_ptr);
+ else if (creature_ptr->pclass == CLASS_MAGIC_EATER)
+ import_magic_device(creature_ptr);
+ else
+ do_cmd_study(creature_ptr);
+ break;
+ }
- /* Cast a spell */
- case 'm':
+ /* Browse a book */
+ case 'b':
+ {
+ if ((creature_ptr->pclass == CLASS_MINDCRAFTER) ||
+ (creature_ptr->pclass == CLASS_BERSERKER) ||
+ (creature_ptr->pclass == CLASS_NINJA) ||
+ (creature_ptr->pclass == CLASS_MIRROR_MASTER)
+ ) do_cmd_mind_browse(creature_ptr);
+ else if (creature_ptr->pclass == CLASS_SMITH)
+ do_cmd_kaji(creature_ptr, TRUE);
+ else if (creature_ptr->pclass == CLASS_MAGIC_EATER)
+ do_cmd_magic_eater(creature_ptr, TRUE, FALSE);
+ else if (creature_ptr->pclass == CLASS_SNIPER)
+ do_cmd_snipe_browse(creature_ptr);
+ else do_cmd_browse(creature_ptr);
+ break;
+ }
+
+ /* Cast a spell */
+ case 'm':
+ {
+ /* -KMW- */
+ if (!creature_ptr->wild_mode)
{
- /* -KMW- */
- if (!creature_ptr->wild_mode)
+ if ((creature_ptr->pclass == CLASS_WARRIOR) || (creature_ptr->pclass == CLASS_ARCHER) || (creature_ptr->pclass == CLASS_CAVALRY))
{
- if ((creature_ptr->pclass == CLASS_WARRIOR) || (creature_ptr->pclass == CLASS_ARCHER) || (creature_ptr->pclass == CLASS_CAVALRY))
- {
- msg_print(_("呪文を唱えられない!", "You cannot cast spells!"));
- }
- else if (floor_ptr->dun_level && (d_info[creature_ptr->dungeon_idx].flags1 & DF1_NO_MAGIC) && (creature_ptr->pclass != CLASS_BERSERKER) && (creature_ptr->pclass != CLASS_SMITH))
- {
- msg_print(_("ダンジョンが魔法を吸収した!", "The dungeon absorbs all attempted magic!"));
- msg_print(NULL);
- }
- else if (creature_ptr->anti_magic && (creature_ptr->pclass != CLASS_BERSERKER) && (creature_ptr->pclass != CLASS_SMITH))
- {
- concptr which_power = _("魔法", "magic");
- if (creature_ptr->pclass == CLASS_MINDCRAFTER)
- which_power = _("超能力", "psionic powers");
- else if (creature_ptr->pclass == CLASS_IMITATOR)
- which_power = _("ものまね", "imitation");
- else if (creature_ptr->pclass == CLASS_SAMURAI)
- which_power = _("必殺剣", "hissatsu");
- else if (creature_ptr->pclass == CLASS_MIRROR_MASTER)
- which_power = _("鏡魔法", "mirror magic");
- else if (creature_ptr->pclass == CLASS_NINJA)
- which_power = _("忍術", "ninjutsu");
- else if (mp_ptr->spell_book == TV_LIFE_BOOK)
- which_power = _("祈り", "prayer");
-
- msg_format(_("反魔法バリアが%sを邪魔した!", "An anti-magic shell disrupts your %s!"), which_power);
- free_turn(creature_ptr);
- }
- else if (creature_ptr->shero && (creature_ptr->pclass != CLASS_BERSERKER))
- {
- msg_format(_("狂戦士化していて頭が回らない!", "You cannot think directly!"));
- free_turn(creature_ptr);
- }
+ msg_print(_("呪文を唱えられない!", "You cannot cast spells!"));
+ }
+ else if (floor_ptr->dun_level && (d_info[creature_ptr->dungeon_idx].flags1 & DF1_NO_MAGIC) && (creature_ptr->pclass != CLASS_BERSERKER) && (creature_ptr->pclass != CLASS_SMITH))
+ {
+ msg_print(_("ダンジョンが魔法を吸収した!", "The dungeon absorbs all attempted magic!"));
+ msg_print(NULL);
+ }
+ else if (creature_ptr->anti_magic && (creature_ptr->pclass != CLASS_BERSERKER) && (creature_ptr->pclass != CLASS_SMITH))
+ {
+ concptr which_power = _("魔法", "magic");
+ if (creature_ptr->pclass == CLASS_MINDCRAFTER)
+ which_power = _("超能力", "psionic powers");
+ else if (creature_ptr->pclass == CLASS_IMITATOR)
+ which_power = _("ものまね", "imitation");
+ else if (creature_ptr->pclass == CLASS_SAMURAI)
+ which_power = _("必殺剣", "hissatsu");
+ else if (creature_ptr->pclass == CLASS_MIRROR_MASTER)
+ which_power = _("鏡魔法", "mirror magic");
+ else if (creature_ptr->pclass == CLASS_NINJA)
+ which_power = _("忍術", "ninjutsu");
+ else if (mp_ptr->spell_book == TV_LIFE_BOOK)
+ which_power = _("祈り", "prayer");
+
+ msg_format(_("反魔法バリアが%sを邪魔した!", "An anti-magic shell disrupts your %s!"), which_power);
+ free_turn(creature_ptr);
+ }
+ else if (creature_ptr->shero && (creature_ptr->pclass != CLASS_BERSERKER))
+ {
+ msg_format(_("狂戦士化していて頭が回らない!", "You cannot think directly!"));
+ free_turn(creature_ptr);
+ }
+ else
+ {
+ if ((creature_ptr->pclass == CLASS_MINDCRAFTER) ||
+ (creature_ptr->pclass == CLASS_BERSERKER) ||
+ (creature_ptr->pclass == CLASS_NINJA) ||
+ (creature_ptr->pclass == CLASS_MIRROR_MASTER)
+ )
+ do_cmd_mind(creature_ptr);
+ else if (creature_ptr->pclass == CLASS_IMITATOR)
+ do_cmd_mane(creature_ptr, FALSE);
+ else if (creature_ptr->pclass == CLASS_MAGIC_EATER)
+ do_cmd_magic_eater(creature_ptr, FALSE, FALSE);
+ else if (creature_ptr->pclass == CLASS_SAMURAI)
+ do_cmd_hissatsu(creature_ptr);
+ else if (creature_ptr->pclass == CLASS_BLUE_MAGE)
+ do_cmd_cast_learned(creature_ptr);
+ else if (creature_ptr->pclass == CLASS_SMITH)
+ do_cmd_kaji(creature_ptr, FALSE);
+ else if (creature_ptr->pclass == CLASS_SNIPER)
+ do_cmd_snipe(creature_ptr);
else
- {
- if ((creature_ptr->pclass == CLASS_MINDCRAFTER) ||
- (creature_ptr->pclass == CLASS_BERSERKER) ||
- (creature_ptr->pclass == CLASS_NINJA) ||
- (creature_ptr->pclass == CLASS_MIRROR_MASTER)
- )
- do_cmd_mind(creature_ptr);
- else if (creature_ptr->pclass == CLASS_IMITATOR)
- do_cmd_mane(creature_ptr, FALSE);
- else if (creature_ptr->pclass == CLASS_MAGIC_EATER)
- do_cmd_magic_eater(creature_ptr, FALSE, FALSE);
- else if (creature_ptr->pclass == CLASS_SAMURAI)
- do_cmd_hissatsu(creature_ptr);
- else if (creature_ptr->pclass == CLASS_BLUE_MAGE)
- do_cmd_cast_learned(creature_ptr);
- else if (creature_ptr->pclass == CLASS_SMITH)
- do_cmd_kaji(creature_ptr, FALSE);
- else if (creature_ptr->pclass == CLASS_SNIPER)
- do_cmd_snipe(creature_ptr);
- else
- do_cmd_cast(creature_ptr);
- }
+ do_cmd_cast(creature_ptr);
}
- break;
- }
-
- /* Issue a pet command */
- case 'p':
- {
- do_cmd_pet(creature_ptr);
- break;
- }
-
- /*** Use various objects ***/
-
- /* Inscribe an object */
- case '{':
- {
- do_cmd_inscribe(creature_ptr);
- break;
}
+ break;
+ }
- /* Uninscribe an object */
- case '}':
- {
- do_cmd_uninscribe(creature_ptr);
- break;
- }
+ /* Issue a pet command */
+ case 'p':
+ {
+ do_cmd_pet(creature_ptr);
+ break;
+ }
- /* Activate an artifact */
- case 'A':
- {
- do_cmd_activate(creature_ptr);
- break;
- }
+ /*** Use various objects ***/
- /* Eat some food */
- case 'E':
- {
- do_cmd_eat_food(creature_ptr);
- break;
- }
+ /* Inscribe an object */
+ case '{':
+ {
+ do_cmd_inscribe(creature_ptr);
+ break;
+ }
- /* Fuel your lantern/torch */
- case 'F':
- {
- do_cmd_refill(creature_ptr);
- break;
- }
+ /* Uninscribe an object */
+ case '}':
+ {
+ do_cmd_uninscribe(creature_ptr);
+ break;
+ }
- /* Fire an item */
- case 'f':
- {
- do_cmd_fire(creature_ptr, SP_NONE);
- break;
- }
+ /* Activate an artifact */
+ case 'A':
+ {
+ do_cmd_activate(creature_ptr);
+ break;
+ }
- /* Throw an item */
- case 'v':
- {
- do_cmd_throw(creature_ptr, 1, FALSE, -1);
- break;
- }
+ /* Eat some food */
+ case 'E':
+ {
+ do_cmd_eat_food(creature_ptr);
+ break;
+ }
- /* Aim a wand */
- case 'a':
- {
- do_cmd_aim_wand(creature_ptr);
- break;
- }
+ /* Fuel your lantern/torch */
+ case 'F':
+ {
+ do_cmd_refill(creature_ptr);
+ break;
+ }
- /* Zap a rod */
- case 'z':
- {
- if (use_command && rogue_like_commands)
- {
- do_cmd_use(creature_ptr);
- }
- else
- {
- do_cmd_zap_rod(creature_ptr);
- }
- break;
- }
+ /* Fire an item */
+ case 'f':
+ {
+ do_cmd_fire(creature_ptr, SP_NONE);
+ break;
+ }
- /* Quaff a potion */
- case 'q':
- {
- do_cmd_quaff_potion(creature_ptr);
- break;
- }
+ /* Throw an item */
+ case 'v':
+ {
+ do_cmd_throw(creature_ptr, 1, FALSE, -1);
+ break;
+ }
- /* Read a scroll */
- case 'r':
- {
- do_cmd_read_scroll(creature_ptr);
- break;
- }
+ /* Aim a wand */
+ case 'a':
+ {
+ do_cmd_aim_wand(creature_ptr);
+ break;
+ }
- /* Use a staff */
- case 'u':
+ /* Zap a rod */
+ case 'z':
+ {
+ if (use_command && rogue_like_commands)
{
- if (use_command && !rogue_like_commands)
- do_cmd_use(creature_ptr);
- else
- do_cmd_use_staff(creature_ptr);
- break;
+ do_cmd_use(creature_ptr);
}
-
- /* Use racial power */
- case 'U':
+ else
{
- do_cmd_racial_power(creature_ptr);
- break;
+ do_cmd_zap_rod(creature_ptr);
}
+ break;
+ }
+ /* Quaff a potion */
+ case 'q':
+ {
+ do_cmd_quaff_potion(creature_ptr);
+ break;
+ }
- /*** Looking at Things (nearby or on map) ***/
+ /* Read a scroll */
+ case 'r':
+ {
+ do_cmd_read_scroll(creature_ptr);
+ break;
+ }
- /* Full dungeon map */
- case 'M':
- {
- do_cmd_view_map(creature_ptr);
- break;
- }
+ /* Use a staff */
+ case 'u':
+ {
+ if (use_command && !rogue_like_commands)
+ do_cmd_use(creature_ptr);
+ else
+ do_cmd_use_staff(creature_ptr);
+ break;
+ }
- /* Locate player on map */
- case 'L':
- {
- do_cmd_locate(creature_ptr);
- break;
- }
+ /* Use racial power */
+ case 'U':
+ {
+ do_cmd_racial_power(creature_ptr);
+ break;
+ }
- /* Look around */
- case 'l':
- {
- do_cmd_look(creature_ptr);
- break;
- }
- /* Target monster or location */
- case '*':
- {
- do_cmd_target(creature_ptr);
- break;
- }
+ /*** Looking at Things (nearby or on map) ***/
+ /* Full dungeon map */
+ case 'M':
+ {
+ do_cmd_view_map(creature_ptr);
+ break;
+ }
+ /* Locate player on map */
+ case 'L':
+ {
+ do_cmd_locate(creature_ptr);
+ break;
+ }
- /*** Help and Such ***/
+ /* Look around */
+ case 'l':
+ {
+ do_cmd_look(creature_ptr);
+ break;
+ }
- /* Help */
- case '?':
- {
- do_cmd_help(creature_ptr);
- break;
- }
+ /* Target monster or location */
+ case '*':
+ {
+ do_cmd_target(creature_ptr);
+ break;
+ }
- /* Identify symbol */
- case '/':
- {
- do_cmd_query_symbol(creature_ptr);
- break;
- }
- /* Character description */
- case 'C':
- {
- do_cmd_player_status(creature_ptr);
- break;
- }
+ /*** Help and Such ***/
- /*** System Commands ***/
+ /* Help */
+ case '?':
+ {
+ do_cmd_help(creature_ptr);
+ break;
+ }
- /* Hack -- User interface */
- case '!':
- {
- (void)Term_user(0);
- break;
- }
+ /* Identify symbol */
+ case '/':
+ {
+ do_cmd_query_symbol(creature_ptr);
+ break;
+ }
- /* Single line from a pref file */
- case '"':
- {
- do_cmd_pref(creature_ptr);
- break;
- }
+ /* Character description */
+ case 'C':
+ {
+ do_cmd_player_status(creature_ptr);
+ break;
+ }
- case '$':
- {
- do_cmd_reload_autopick(creature_ptr);
- break;
- }
- case '_':
- {
- do_cmd_edit_autopick(creature_ptr);
- break;
- }
+ /*** System Commands ***/
- /* Interact with macros */
- case '@':
- {
- do_cmd_macros(creature_ptr);
- break;
- }
+ /* Hack -- User interface */
+ case '!':
+ {
+ (void)Term_user(0);
+ break;
+ }
- /* Interact with visuals */
- case '%':
- {
- do_cmd_visuals(creature_ptr);
- do_cmd_redraw(creature_ptr);
- break;
- }
+ /* Single line from a pref file */
+ case '"':
+ {
+ do_cmd_pref(creature_ptr);
+ break;
+ }
- /* Interact with colors */
- case '&':
- {
- do_cmd_colors(creature_ptr);
- do_cmd_redraw(creature_ptr);
- break;
- }
+ case '$':
+ {
+ do_cmd_reload_autopick(creature_ptr);
+ break;
+ }
- /* Interact with options */
- case '=':
- {
- do_cmd_options();
- (void)combine_and_reorder_home(STORE_HOME);
- do_cmd_redraw(creature_ptr);
- break;
- }
+ case '_':
+ {
+ do_cmd_edit_autopick(creature_ptr);
+ break;
+ }
- /*** Misc Commands ***/
+ /* Interact with macros */
+ case '@':
+ {
+ do_cmd_macros(creature_ptr);
+ break;
+ }
- /* Take notes */
- case ':':
- {
- do_cmd_note();
- break;
- }
+ /* Interact with visuals */
+ case '%':
+ {
+ do_cmd_visuals(creature_ptr);
+ do_cmd_redraw(creature_ptr);
+ break;
+ }
- /* Version info */
- case 'V':
- {
- do_cmd_version();
- break;
- }
+ /* Interact with colors */
+ case '&':
+ {
+ do_cmd_colors(creature_ptr);
+ do_cmd_redraw(creature_ptr);
+ break;
+ }
- /* Repeat level feeling */
- case KTRL('F'):
- {
- do_cmd_feeling(creature_ptr);
- break;
- }
+ /* Interact with options */
+ case '=':
+ {
+ do_cmd_options();
+ (void)combine_and_reorder_home(STORE_HOME);
+ do_cmd_redraw(creature_ptr);
+ break;
+ }
- /* Show previous message */
- case KTRL('O'):
- {
- do_cmd_message_one();
- break;
- }
+ /*** Misc Commands ***/
- /* Show previous messages */
- case KTRL('P'):
- {
- do_cmd_messages(old_now_message);
- break;
- }
+ /* Take notes */
+ case ':':
+ {
+ do_cmd_note();
+ break;
+ }
- /* Show quest status -KMW- */
- case KTRL('Q'):
- {
- do_cmd_checkquest(creature_ptr);
- break;
- }
+ /* Version info */
+ case 'V':
+ {
+ do_cmd_version();
+ break;
+ }
- /* Redraw the screen */
- case KTRL('R'):
- {
- now_message = old_now_message;
- do_cmd_redraw(creature_ptr);
- break;
- }
+ /* Repeat level feeling */
+ case KTRL('F'):
+ {
+ do_cmd_feeling(creature_ptr);
+ break;
+ }
+
+ /* Show previous message */
+ case KTRL('O'):
+ {
+ do_cmd_message_one();
+ break;
+ }
+
+ /* Show previous messages */
+ case KTRL('P'):
+ {
+ do_cmd_messages(old_now_message);
+ break;
+ }
+
+ /* Show quest status -KMW- */
+ case KTRL('Q'):
+ {
+ do_cmd_checkquest(creature_ptr);
+ break;
+ }
+
+ /* Redraw the screen */
+ case KTRL('R'):
+ {
+ now_message = old_now_message;
+ do_cmd_redraw(creature_ptr);
+ break;
+ }
#ifndef VERIFY_SAVEFILE
- /* Hack -- Save and don't quit */
- case KTRL('S'):
- {
- do_cmd_save_game(creature_ptr, FALSE);
- break;
- }
+ /* Hack -- Save and don't quit */
+ case KTRL('S'):
+ {
+ do_cmd_save_game(creature_ptr, FALSE);
+ break;
+ }
#endif /* VERIFY_SAVEFILE */
- case KTRL('T'):
- {
- do_cmd_time(creature_ptr);
- break;
- }
+ case KTRL('T'):
+ {
+ do_cmd_time(creature_ptr);
+ break;
+ }
- /* Save and quit */
- case KTRL('X'):
- case SPECIAL_KEY_QUIT:
- {
- do_cmd_save_and_exit(creature_ptr);
- break;
- }
+ /* Save and quit */
+ case KTRL('X'):
+ case SPECIAL_KEY_QUIT:
+ {
+ do_cmd_save_and_exit(creature_ptr);
+ break;
+ }
- /* Quit (commit suicide) */
- case 'Q':
- {
- do_cmd_suicide(creature_ptr);
- break;
- }
+ /* Quit (commit suicide) */
+ case 'Q':
+ {
+ do_cmd_suicide(creature_ptr);
+ break;
+ }
- case '|':
- {
- do_cmd_diary(creature_ptr);
- break;
- }
+ case '|':
+ {
+ do_cmd_diary(creature_ptr);
+ break;
+ }
- /* Check artifacts, uniques, objects */
- case '~':
- {
- do_cmd_knowledge(creature_ptr);
- break;
- }
+ /* Check artifacts, uniques, objects */
+ case '~':
+ {
+ do_cmd_knowledge(creature_ptr);
+ break;
+ }
- /* Load "screen dump" */
- case '(':
- {
- do_cmd_load_screen();
- break;
- }
+ /* Load "screen dump" */
+ case '(':
+ {
+ do_cmd_load_screen();
+ break;
+ }
- /* Save "screen dump" */
- case ')':
- {
- do_cmd_save_screen(creature_ptr);
- break;
- }
+ /* Save "screen dump" */
+ case ')':
+ {
+ do_cmd_save_screen(creature_ptr);
+ break;
+ }
- /* Record/stop "Movie" */
- case ']':
- {
- prepare_movie_hooks();
- break;
- }
+ /* Record/stop "Movie" */
+ case ']':
+ {
+ prepare_movie_hooks();
+ break;
+ }
- /* Make random artifact list */
- case KTRL('V'):
- {
- spoil_random_artifact(creature_ptr, "randifact.txt");
- break;
- }
+ /* Make random artifact list */
+ case KTRL('V'):
+ {
+ spoil_random_artifact(creature_ptr, "randifact.txt");
+ break;
+ }
#ifdef TRAVEL
- case '`':
+ case '`':
+ {
+ if (!creature_ptr->wild_mode) do_cmd_travel(creature_ptr);
+ if (creature_ptr->special_defense & KATA_MUSOU)
{
- if (!creature_ptr->wild_mode) do_cmd_travel(creature_ptr);
- if (creature_ptr->special_defense & KATA_MUSOU)
- {
- set_action(creature_ptr, ACTION_NONE);
- }
- break;
+ set_action(creature_ptr, ACTION_NONE);
}
+ break;
+ }
#endif
- /* Hack -- Unknown command */
- default:
+ /* Hack -- Unknown command */
+ default:
+ {
+ if (flush_failure) flush();
+ if (one_in_(2))
{
- if (flush_failure) flush();
- if (one_in_(2))
- {
- char error_m[1024];
- sound(SOUND_ILLEGAL);
- if (!get_rnd_line(_("error_j.txt", "error.txt"), 0, error_m))
- msg_print(error_m);
- }
- else
- {
- prt(_(" '?' でヘルプが表示されます。", "Type '?' for help."), 0, 0);
- }
-
- break;
+ char error_m[1024];
+ sound(SOUND_ILLEGAL);
+ if (!get_rnd_line(_("error_j.txt", "error.txt"), 0, error_m))
+ msg_print(error_m);
+ }
+ else
+ {
+ prt(_(" '?' でヘルプが表示されます。", "Type '?' for help."), 0, 0);
}
+
+ break;
+ }
}
if (!creature_ptr->energy_use && !now_message)
now_message = old_now_message;
{
creature_ptr->enchant_energy_need -= SPEED_TO_ENERGY(creature_ptr->pspeed);
}
-
+
/* No turn yet */
if (creature_ptr->enchant_energy_need > 0) return;
-
+
while (creature_ptr->enchant_energy_need <= 0)
{
/* Handle the player song */
/* Hex - Handle the hex spells */
if (!load) check_hex(creature_ptr);
if (!load) revenge_spell(creature_ptr);
-
+
/* There is some randomness of needed energy */
creature_ptr->enchant_energy_need += ENERGY_NEED();
}
if (creature_ptr->phase_out)
{
- for(m_idx = 1; m_idx < creature_ptr->current_floor_ptr->m_max; m_idx++)
+ for (m_idx = 1; m_idx < creature_ptr->current_floor_ptr->m_max; m_idx++)
{
monster_type *m_ptr = &creature_ptr->current_floor_ptr->m_list[m_idx];
{
/* Stop resting */
if ((creature_ptr->chp == creature_ptr->mhp) &&
- (creature_ptr->csp >= creature_ptr->msp))
+ (creature_ptr->csp >= creature_ptr->msp))
{
set_action(creature_ptr, ACTION_NONE);
}
{
/* Stop resting */
if ((creature_ptr->chp == creature_ptr->mhp) &&
- (creature_ptr->csp >= creature_ptr->msp) &&
- !creature_ptr->blind && !creature_ptr->confused &&
- !creature_ptr->poisoned && !creature_ptr->afraid &&
- !creature_ptr->stun && !creature_ptr->cut &&
- !creature_ptr->slow && !creature_ptr->paralyzed &&
- !creature_ptr->image && !creature_ptr->word_recall &&
- !creature_ptr->alter_reality)
+ (creature_ptr->csp >= creature_ptr->msp) &&
+ !creature_ptr->blind && !creature_ptr->confused &&
+ !creature_ptr->poisoned && !creature_ptr->afraid &&
+ !creature_ptr->stun && !creature_ptr->cut &&
+ !creature_ptr->slow && !creature_ptr->paralyzed &&
+ !creature_ptr->image && !creature_ptr->word_recall &&
+ !creature_ptr->alter_reality)
{
set_action(creature_ptr, ACTION_NONE);
}
if (MON_MONFEAR(m_ptr))
{
/* Hack -- Recover from fear */
- if(set_monster_monfear(creature_ptr, creature_ptr->riding,
+ if (set_monster_monfear(creature_ptr, creature_ptr->riding,
(randint0(r_ptr->level) < creature_ptr->skill_exp[GINOU_RIDING]) ? 0 : (MON_MONFEAR(m_ptr) - 1)))
{
GAME_TEXT m_name[MAX_NLEN];
handle_stuff(creature_ptr);
}
-
+
load = FALSE;
/* Fast */
}
if ((creature_ptr->pclass == CLASS_FORCETRAINER) && P_PTR_KI)
{
- if(P_PTR_KI < 40) P_PTR_KI = 0;
+ if (P_PTR_KI < 40) P_PTR_KI = 0;
else P_PTR_KI -= 40;
creature_ptr->update |= (PU_BONUS);
}
/* Convert the unit (1/2^16) to (1/2^32) */
s64b_LSHIFT(cost, cost_frac, 16);
-
+
if (s64b_cmp(creature_ptr->csp, creature_ptr->csp_frac, cost, cost_frac) < 0)
{
/* Mana run out */
creature_ptr->redraw |= (PR_STATE);
}
- if (creature_ptr->timewalk && (creature_ptr->energy_need > - 1000))
+ if (creature_ptr->timewalk && (creature_ptr->energy_need > -1000))
{
creature_ptr->redraw |= (PR_MAP);
Term_fresh();
if (quest_num && (is_fixed_quest_idx(quest_num) &&
- !((quest_num == QUEST_OBERON) || (quest_num == QUEST_SERPENT) ||
- !(quest[quest_num].flags & QUEST_FLAG_PRESET)))) do_cmd_feeling(player_ptr);
+ !((quest_num == QUEST_OBERON) || (quest_num == QUEST_SERPENT) ||
+ !(quest[quest_num].flags & QUEST_FLAG_PRESET)))) do_cmd_feeling(player_ptr);
if (player_ptr->phase_out)
{
if (r_info[d_info[player_ptr->dungeon_idx].final_guardian].max_num)
#ifdef JP
msg_format("この階には%sの主である%sが棲んでいる。",
- d_name+d_info[player_ptr->dungeon_idx].name,
- r_name+r_info[d_info[player_ptr->dungeon_idx].final_guardian].name);
+ d_name + d_info[player_ptr->dungeon_idx].name,
+ r_name + r_info[d_info[player_ptr->dungeon_idx].final_guardian].name);
#else
msg_format("%^s lives in this level as the keeper of %s.",
- r_name+r_info[d_info[player_ptr->dungeon_idx].final_guardian].name,
- d_name+d_info[player_ptr->dungeon_idx].name);
+ r_name + r_info[d_info[player_ptr->dungeon_idx].final_guardian].name,
+ d_name + d_info[player_ptr->dungeon_idx].name);
#endif
}
current_world_ptr->is_loading_now = TRUE;
if (player_ptr->energy_need > 0 && !player_ptr->phase_out &&
- (floor_ptr->dun_level || player_ptr->leaving_dungeon || floor_ptr->inside_arena))
+ (floor_ptr->dun_level || player_ptr->leaving_dungeon || floor_ptr->inside_arena))
player_ptr->energy_need = 0;
/* Not leaving dungeon */
/* No suspending now */
signals_ignore_tstp();
-
+
/* Hack -- Character is now "icky" */
current_world_ptr->character_icky = TRUE;
path_build(buf, sizeof(buf), ANGBAND_DIR_APEX, "scores.raw");
/* Forget the high score fd */
highscore_fd = -1;
-
+
/* Allow suspending now */
signals_handle_tstp();
/* Roll up a new character */
player_birth(player_ptr);
- counts_write(player_ptr, 2,0);
+ counts_write(player_ptr, 2, 0);
player_ptr->count = 0;
load = FALSE;
{
write_level = FALSE;
- exe_write_diary(player_ptr, NIKKI_GAMESTART, 1,
- _(" ----ゲーム再開----",
- " ---- Restart Game ----"));
+ exe_write_diary(player_ptr, NIKKI_GAMESTART, 1,
+ _(" ----ゲーム再開----",
+ " ---- Restart Game ----"));
-/*
- * 1.0.9 以前はセーブ前に player_ptr->riding = -1 としていたので、再設定が必要だった。
- * もう不要だが、以前のセーブファイルとの互換のために残しておく。
- */
+ /*
+ * 1.0.9 以前はセーブ前に player_ptr->riding = -1 としていたので、再設定が必要だった。
+ * もう不要だが、以前のセーブファイルとの互換のために残しておく。
+ */
if (player_ptr->riding == -1)
{
player_ptr->riding = 0;
/* Sexy gal gets bonus to maximum weapon skill of whip */
if (player_ptr->pseikaku == SEIKAKU_SEXY)
- s_info[player_ptr->pclass].w_max[TV_HAFTED-TV_WEAPON_BEGIN][SV_WHIP] = WEAPON_EXP_MASTER;
+ s_info[player_ptr->pclass].w_max[TV_HAFTED - TV_WEAPON_BEGIN][SV_WHIP] = WEAPON_EXP_MASTER;
/* Fill the arrays of floors and walls in the good proportions */
set_floor_and_wall(player_ptr->dungeon_idx);
MONRACE_IDX pet_r_idx = ((player_ptr->pclass == CLASS_CAVALRY) ? MON_HORSE : MON_YASE_HORSE);
monster_race *r_ptr = &r_info[pet_r_idx];
place_monster_aux(0, player_ptr->y, player_ptr->x - 1, pet_r_idx,
- (PM_FORCE_PET | PM_NO_KAGE));
+ (PM_FORCE_PET | PM_NO_KAGE));
m_ptr = &floor_ptr->m_list[hack_m_idx_ii];
m_ptr->mspeed = r_ptr->speed;
- m_ptr->maxhp = r_ptr->hdice*(r_ptr->hside+1)/2;
+ m_ptr->maxhp = r_ptr->hdice*(r_ptr->hside + 1) / 2;
m_ptr->max_maxhp = m_ptr->maxhp;
- m_ptr->hp = r_ptr->hdice*(r_ptr->hside+1)/2;
+ m_ptr->hp = r_ptr->hdice*(r_ptr->hside + 1) / 2;
m_ptr->dealt_damage = 0;
m_ptr->energy_need = ENERGY_NEED() + ENERGY_NEED();
}
}
}
else return 6;
-
+
return 0;
}
/* Exit if has no light */
if (!rad) continue;
-
+
int f_flag;
if (rad > 0)
{
#ifdef MACINTOSH
static InetSvcRef inet_services = nil;
-static EndpointRef ep = kOTInvalidEndpointRef;
+static EndpointRef ep = kOTInvalidEndpointRef;
#endif
return;
}
- while (my_fgets(fp, buf, sizeof(buf))==0)
+ while (my_fgets(fp, buf, sizeof(buf)) == 0)
{
if (buf[0] != '#' && buf[0] != '\0') break;
}
s += 7;
}
#elif defined(MACINTOSH)
- strncpy( tmp , s , 7 );
- for ( i = 0 ; i < 7 ; i++ )
+ strncpy(tmp, s, 7);
+ for (i = 0; i < 7; i++)
{
- if ( isalpha(tmp[i]) )
- tmp[i]= tolower(tmp[i]);
+ if (isalpha(tmp[i]))
+ tmp[i] = tolower(tmp[i]);
}
if (!strncmp(s, "http://", 7))
{
#else /* !MACINTOSH */
OTResult bytesSent;
-
- OTSnd(ep, (void *) buf, sz, 0);
+
+ OTSnd(ep, (void *)buf, sz, 0);
#endif
return sz;
#if !defined(WINDOWS) && !defined(MACINTOSH)
static sigjmp_buf env;
-static void (*sig_int_saved)(int);
-static void (*sig_alm_saved)(int);
+static void(*sig_int_saved)(int);
+static void(*sig_alm_saved)(int);
#endif
static void restore_signal(void)
val.it_value.tv_usec = 0;
/* タイムアウト、もしくは中断した時の処理。 */
- if ((ret = sigsetjmp(env,1)) != 0)
+ if ((ret = sigsetjmp(env, 1)) != 0)
{
#ifdef JP
if (ret == SIGALRM)
to.sin_family = AF_INET;
- if(proxy && proxy[0] && proxy_port)
+ if (proxy && proxy[0] && proxy_port)
to.sin_port = htons((unsigned short int)proxy_port);
else
to.sin_port = htons((unsigned short int)port);
#ifndef WINDOWS
if ((sd = socket(PF_INET, SOCK_STREAM, 0)) < 0)
#else
- if ((sd = socket(PF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET)
+ if ((sd = socket(PF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET)
#endif
{
#ifdef JP
#else /* !MACINTOSH */
- /* サーバにコネクトする関数。 Mac */
+ /* サーバにコネクトする関数。 Mac */
{
OSStatus err;
InetHostInfo response;
InetHost host_addr;
InetAddress inAddr;
TCall sndCall;
- Boolean bind = false;
-
+ Boolean bind = false;
+
memset(&response, 0, sizeof(response));
-
+
#if TARGET_API_MAC_CARBON
inet_services = OTOpenInternetServicesInContext(kDefaultInternetServicesPath, 0, &err, NULL);
#else
inet_services = OTOpenInternetServices(kDefaultInternetServicesPath, 0, &err);
#endif
-
+
if (err == noErr) {
-
+
if (proxy && proxy[0])
{
err = OTInetStringToAddress(inet_services, proxy, &response);
{
err = OTInetStringToAddress(inet_services, (char *)host, &response);
}
-
+
if (err == noErr)
{
host_addr = response.addrs[0];
{
errstr = "error: bad score server!\n";
}
-
+
#if TARGET_API_MAC_CARBON
ep = (void *)OTOpenEndpointInContext(OTCreateConfiguration(kTCPName), 0, nil, &err, NULL);
#else
OTInitInetAddress(&inAddr, proxy_port, host_addr);
else
OTInitInetAddress(&inAddr, port, host_addr);
-
- sndCall.addr.len = sizeof(InetAddress);
- sndCall.addr.buf = (unsigned char*) &inAddr;
- sndCall.opt.buf = nil; /* no connection options */
- sndCall.opt.len = 0;
- sndCall.udata.buf = nil; /* no connection data */
- sndCall.udata.len = 0;
- sndCall.sequence = 0; /* ignored by OTConnect */
-
+
+ sndCall.addr.len = sizeof(InetAddress);
+ sndCall.addr.buf = (unsigned char*)&inAddr;
+ sndCall.opt.buf = nil; /* no connection options */
+ sndCall.opt.len = 0;
+ sndCall.udata.buf = nil; /* no connection data */
+ sndCall.udata.len = 0;
+ sndCall.sequence = 0; /* ignored by OTConnect */
+
err = OTConnect(ep, &sndCall, NULL);
-
+
if (err != noErr)
{
errstr = "error: cannot connect score server!\n";
}
}
}
-
- if ( err != noErr )
+
+ if (err != noErr)
{
- if ( bind )
+ if (bind)
{
OTUnbind(ep);
}
OTCloseProvider(inet_services);
inet_services = nil;
}
-
+
return -1;
}
-
+
return 1;
}
#endif
{
OTCloseProvider(ep);
}
-
+
if (inet_services != nil)
{
OTCloseProvider(inet_services);
typedef struct header header;
-typedef errr (*parse_info_txt_func)(char *buf, header *head);
+typedef errr(*parse_info_txt_func)(char *buf, header *head);
/*
* Size of memory reserved for initialization of some arrays
#define VER_INFO_ROW 3 //!< タイトル表記(行)
-/*!
- * @brief マクロ登録の最大数 / Maximum number of macros (see "io.c")
- * @note Default: assume at most 256 macros are used
- */
+ /*!
+ * @brief マクロ登録の最大数 / Maximum number of macros (see "io.c")
+ * @note Default: assume at most 256 macros are used
+ */
#define MACRO_MAX 256
-/*!
- * @struct header
- * @brief 各初期データ用ヘッダ構造体 / Template file header information (see "init.c"). 16 bytes.
- * @details
- * Note that the sizes of many of the "arrays" are between 32768 and
- * 65535, and so we must use "unsigned" values to hold the "sizes" of
- * these arrays below. Normally, I try to avoid using unsigned values,
- * since they can cause all sorts of bizarre problems, but I have no
- * choice here, at least, until the "race" array is split into "normal"
- * and "unique" monsters, which may or may not actually help.
- *
- * Note that, on some machines, for example, the Macintosh, the standard
- * "read()" and "write()" functions cannot handle more than 32767 bytes
- * at one time, so we need replacement functions, see "util.c" for details.
- *
- * Note that, on some machines, for example, the Macintosh, the standard
- * "malloc()" function cannot handle more than 32767 bytes at one time,
- * but we may assume that the "ralloc()" function can handle up to 65535
- * butes at one time. We should not, however, assume that the "ralloc()"
- * function can handle more than 65536 bytes at a time, since this might
- * result in segmentation problems on certain older machines, and in fact,
- * we should not assume that it can handle exactly 65536 bytes at a time,
- * since the internal functions may use an unsigned short to specify size.
- *
- * In general, these problems occur only on machines (such as most personal
- * computers) which use 2 byte "int" values, and which use "int" for the
- * arguments to the relevent functions.
- */
+ /*!
+ * @struct header
+ * @brief 各初期データ用ヘッダ構造体 / Template file header information (see "init.c"). 16 bytes.
+ * @details
+ * Note that the sizes of many of the "arrays" are between 32768 and
+ * 65535, and so we must use "unsigned" values to hold the "sizes" of
+ * these arrays below. Normally, I try to avoid using unsigned values,
+ * since they can cause all sorts of bizarre problems, but I have no
+ * choice here, at least, until the "race" array is split into "normal"
+ * and "unique" monsters, which may or may not actually help.
+ *
+ * Note that, on some machines, for example, the Macintosh, the standard
+ * "read()" and "write()" functions cannot handle more than 32767 bytes
+ * at one time, so we need replacement functions, see "util.c" for details.
+ *
+ * Note that, on some machines, for example, the Macintosh, the standard
+ * "malloc()" function cannot handle more than 32767 bytes at one time,
+ * but we may assume that the "ralloc()" function can handle up to 65535
+ * butes at one time. We should not, however, assume that the "ralloc()"
+ * function can handle more than 65536 bytes at a time, since this might
+ * result in segmentation problems on certain older machines, and in fact,
+ * we should not assume that it can handle exactly 65536 bytes at a time,
+ * since the internal functions may use an unsigned short to specify size.
+ *
+ * In general, these problems occur only on machines (such as most personal
+ * computers) which use 2 byte "int" values, and which use "int" for the
+ * arguments to the relevent functions.
+ */
struct header
{
byte v_major; /* Version -- major */
parse_info_txt_func parse_info_txt;
- void (*retouch)(header *head);
+ void(*retouch)(header *head);
};
extern errr init_info_txt(FILE *fp, char *buf, header *head,
- parse_info_txt_func parse_info_txt_line);
+ parse_info_txt_func parse_info_txt_line);
#ifdef ALLOW_TEMPLATES
extern errr parse_v_info(char *buf, header *head);
* the existing "number of turns to protect for", and where each hit
* by a monster will reduce the shield by that amount.
*
- *
+ *
*/
#include "angband.h"
#include "realm-song.h"
#include "cmd-smith.h"
-/*
- * Maximum number of tries for selection of a proper quest monster
- */
+ /*
+ * Maximum number of tries for selection of a proper quest monster
+ */
#define MAX_TRIES 100
#define OLD_MAX_MANE 22
- /* Old hidden trap flag */
+ /* Old hidden trap flag */
#define CAVE_TRAP 0x8000
/*** Terrain Feature Indexes (see "lib/edit/f_info.txt") ***/
}
/* Terminate */
- str[max-1] = '\0';
+ str[max - 1] = '\0';
#ifdef JP
/* Convert Kanji code */
rd_s16b(&o_ptr->timeout);
rd_s16b(&o_ptr->to_h);
-
+
rd_s16b(&tmp16s);
o_ptr->to_d = tmp16s;
rd_s16b(&o_ptr->to_a);
case 10: add_flag(o_ptr->art_flags, TR_RES_LITE); break;
}
o_ptr->xtra2 = 0;
- }
+ }
else if (o_ptr->xtra1 == EGO_XTRA_ABILITY)
{
switch (o_ptr->xtra2 % 8)
o_ptr->xtra5 = damroll(r_info[o_ptr->pval].hdice, r_info[o_ptr->pval].hside);
if (ironman_nightmare)
{
- o_ptr->xtra5 = (s16b)MIN(30000, o_ptr->xtra5*2L);
+ o_ptr->xtra5 = (s16b)MIN(30000, o_ptr->xtra5 * 2L);
}
o_ptr->xtra4 = o_ptr->xtra5;
}
rd_byte(&o_ptr->xtra3);
if (h_older_than(1, 3, 0, 1))
{
- if (object_is_smith(o_ptr) && o_ptr->xtra3 >= 1+96)
+ if (object_is_smith(o_ptr) && o_ptr->xtra3 >= 1 + 96)
o_ptr->xtra3 += -96 + MIN_SPECIAL_ESSENCE;
}
if (flags & SAVE_ITEM_NUMBER) {
rd_byte(&tmp8u);
o_ptr->number = tmp8u;
- }
+ }
else o_ptr->number = 1;
s16b tmp16s;
if (flags & SAVE_ITEM_DD)
{
- rd_byte(&tmp8u);
- o_ptr->dd = tmp8u;
+ rd_byte(&tmp8u);
+ o_ptr->dd = tmp8u;
}
else o_ptr->dd = 0;
{
o_ptr->art_name = 0;
}
-
+
if (!h_older_than(2, 1, 2, 4)) return;
BIT_FLAGS flgs[TR_FLAG_SIZE];
remove_flag(o_ptr->art_flags, TR_LITE_3);
return;
}
-
+
if (o_ptr->name2 == EGO_LITE_DARKNESS)
{
if (o_ptr->tval != TV_LITE)
rd_s16b(&tmp16s);
m_ptr->max_maxhp = (HIT_POINT)tmp16s;
}
- if(h_older_than(2, 1, 2, 1))
+ if (h_older_than(2, 1, 2, 1))
{
m_ptr->dealt_damage = 0;
}
else
{
- rd_s32b(&m_ptr->dealt_damage);
+ rd_s32b(&m_ptr->dealt_damage);
}
-
+
rd_s16b(&m_ptr->mtimed[MTIMED_CSLEEP]);
rd_byte(&tmp8u);
if (z_older_than(11, 0, 13))
m_ptr->energy_need = 100 - m_ptr->energy_need;
- if (z_older_than(10,0,7))
+ if (z_older_than(10, 0, 7))
{
m_ptr->mtimed[MTIMED_FAST] = 0;
m_ptr->mtimed[MTIMED_SLOW] = 0;
rd_byte(&tmp8u);
m_ptr->mtimed[MTIMED_MONFEAR] = (s16b)tmp8u;
- if (z_older_than(10,0,10))
+ if (z_older_than(10, 0, 10))
{
reset_target(m_ptr);
}
- else if (z_older_than(10,0,11))
+ else if (z_older_than(10, 0, 11))
{
rd_s16b(&tmp16s);
reset_target(m_ptr);
if (z_older_than(10, 4, 5))
{
m_ptr->exp = 0;
- } else
+ }
+ else
{
rd_u32b(&tmp32u);
m_ptr->exp = tmp32u;
{
if (m_ptr->r_idx < 0)
{
- m_ptr->r_idx = (0-m_ptr->r_idx);
+ m_ptr->r_idx = (0 - m_ptr->r_idx);
m_ptr->mflag2 |= MFLAG2_KAGE;
}
}
rd_s16b(&tmp16s);
m_ptr->max_maxhp = (HIT_POINT)tmp16s;
- if(h_older_than(2, 1, 2, 1))
+ if (h_older_than(2, 1, 2, 1))
{
m_ptr->dealt_damage = 0;
}
else
{
- rd_s32b(&m_ptr->dealt_damage);
+ rd_s32b(&m_ptr->dealt_damage);
}
/* Monster race index of its appearance */
if (flags & SAVE_MON_MFLAG2) rd_byte(&m_ptr->mflag2);
else m_ptr->mflag2 = 0;
- if (flags & SAVE_MON_NICKNAME)
+ if (flags & SAVE_MON_NICKNAME)
{
char buf[128];
rd_string(buf, sizeof(buf));
#define RF4_BR_SHAR 0x01000000 /* Breathe Shards */
#define RF4_BR_WALL 0x04000000 /* Breathe Force */
-/*!
- * @brief モンスターの思い出を読み込む / Read the monster lore
- * @param r_idx 読み込み先モンスターID
- * @return なし
- */
+ /*!
+ * @brief モンスターの思い出を読み込む / Read the monster lore
+ * @param r_idx 読み込み先モンスターID
+ * @return なし
+ */
static void rd_lore(MONRACE_IDX r_idx)
{
monster_race *r_ptr = &r_info[r_idx];
else
{
rd_s16b(&tmp16s);
- r_ptr->r_akills = (MONSTER_NUMBER)tmp16s;
+ r_ptr->r_akills = (MONSTER_NUMBER)tmp16s;
}
rd_s16b(&tmp16s);
r_ptr->r_flagsr = 0L;
/* Move RF3 resistance flags to RFR */
- MOVE_RF3_TO_RFR(r_ptr, RF3_IM_ACID, RFR_IM_ACID);
- MOVE_RF3_TO_RFR(r_ptr, RF3_IM_ELEC, RFR_IM_ELEC);
- MOVE_RF3_TO_RFR(r_ptr, RF3_IM_FIRE, RFR_IM_FIRE);
- MOVE_RF3_TO_RFR(r_ptr, RF3_IM_COLD, RFR_IM_COLD);
- MOVE_RF3_TO_RFR(r_ptr, RF3_IM_POIS, RFR_IM_POIS);
+ MOVE_RF3_TO_RFR(r_ptr, RF3_IM_ACID, RFR_IM_ACID);
+ MOVE_RF3_TO_RFR(r_ptr, RF3_IM_ELEC, RFR_IM_ELEC);
+ MOVE_RF3_TO_RFR(r_ptr, RF3_IM_FIRE, RFR_IM_FIRE);
+ MOVE_RF3_TO_RFR(r_ptr, RF3_IM_COLD, RFR_IM_COLD);
+ MOVE_RF3_TO_RFR(r_ptr, RF3_IM_POIS, RFR_IM_POIS);
MOVE_RF3_TO_RFR(r_ptr, RF3_RES_TELE, RFR_RES_TELE);
MOVE_RF3_TO_RFR(r_ptr, RF3_RES_NETH, RFR_RES_NETH);
MOVE_RF3_TO_RFR(r_ptr, RF3_RES_WATE, RFR_RES_WATE);
MOVE_RF3_TO_RFR(r_ptr, RF3_RES_PLAS, RFR_RES_PLAS);
MOVE_RF3_TO_RFR(r_ptr, RF3_RES_NEXU, RFR_RES_NEXU);
MOVE_RF3_TO_RFR(r_ptr, RF3_RES_DISE, RFR_RES_DISE);
- MOVE_RF3_TO_RFR(r_ptr, RF3_RES_ALL, RFR_RES_ALL);
+ MOVE_RF3_TO_RFR(r_ptr, RF3_RES_ALL, RFR_RES_ALL);
/* Separate breathers resistance from RF4 to RFR */
RF4_BR_TO_RFR(r_ptr, RF4_BR_LITE, RFR_RES_LITE);
/* Slide the others up */
for (int i = st_ptr->stock_num; i > slot; i--)
{
- st_ptr->stock[i] = st_ptr->stock[i-1];
+ st_ptr->stock[i] = st_ptr->stock[i - 1];
}
/* More stuff now */
hitpoint_warn = b;
/* Read "mana_warn" */
- if(h_older_than(1, 7, 0, 0))
+ if (h_older_than(1, 7, 0, 0))
{
- mana_warn=2;
+ mana_warn = 2;
}
- else
+ else
{
rd_byte(&b);
mana_warn = b;
rd_s16b(&tmp16s);
creature_ptr->oldpy = (POSITION)tmp16s;
- if (z_older_than(10, 3, 13) && !creature_ptr->current_floor_ptr->dun_level && !creature_ptr->current_floor_ptr->inside_arena) {creature_ptr->oldpy = 33;creature_ptr->oldpx = 131;}
+ if (z_older_than(10, 3, 13) && !creature_ptr->current_floor_ptr->dun_level && !creature_ptr->current_floor_ptr->inside_arena) { creature_ptr->oldpy = 33; creature_ptr->oldpx = 131; }
/* Was creature_ptr->rewards[MAX_BACT] */
rd_s16b(&tmp16s);
rd_byte(&max);
- for(int i = 0; i < max; i++)
+ for (int i = 0; i < max; i++)
{
rd_s16b(&tmp16s);
max_dlv[i] = tmp16s;
rd_s16b(&creature_ptr->image);
rd_s16b(&creature_ptr->protevil);
rd_s16b(&creature_ptr->invuln);
- if(z_older_than(10, 0, 0))
+ if (z_older_than(10, 0, 0))
creature_ptr->ult_res = 0;
else
rd_s16b(&creature_ptr->ult_res);
rd_s16b(&creature_ptr->oppose_acid);
rd_s16b(&creature_ptr->oppose_elec);
rd_s16b(&creature_ptr->oppose_pois);
- if (z_older_than(10,0,2)) creature_ptr->tsuyoshi = 0;
+ if (z_older_than(10, 0, 2)) creature_ptr->tsuyoshi = 0;
else rd_s16b(&creature_ptr->tsuyoshi);
/* Old savefiles do not have the following fields... */
}
/* by henkma */
- if ( z_older_than(11,0,3) ){
- creature_ptr->tim_reflect=0;
- creature_ptr->multishadow=0;
- creature_ptr->dustrobe=0;
+ if (z_older_than(11, 0, 3)) {
+ creature_ptr->tim_reflect = 0;
+ creature_ptr->multishadow = 0;
+ creature_ptr->dustrobe = 0;
}
else {
- rd_s16b(&creature_ptr->tim_reflect);
- rd_s16b(&creature_ptr->multishadow);
- rd_s16b(&creature_ptr->dustrobe);
+ rd_s16b(&creature_ptr->tim_reflect);
+ rd_s16b(&creature_ptr->multishadow);
+ rd_s16b(&creature_ptr->dustrobe);
}
rd_s16b(&creature_ptr->chaos_patron);
/* Calc the regeneration modifier for mutations */
creature_ptr->mutant_regenerate_mod = calc_mutant_regenerate_mod(creature_ptr);
- if (z_older_than(10,0,9))
+ if (z_older_than(10, 0, 9))
{
rd_byte(&tmp8u);
if (tmp8u) creature_ptr->special_attack = ATTACK_CONFUSE;
if (creature_ptr->special_attack & KAMAE_MASK) creature_ptr->action = ACTION_KAMAE;
else if (creature_ptr->special_attack & KATA_MASK) creature_ptr->action = ACTION_KATA;
- if (z_older_than(10,0,12))
+ if (z_older_than(10, 0, 12))
{
creature_ptr->ele_immune = 0;
creature_ptr->special_defense = 0;
}
else rd_s32b(¤t_world_ptr->arena_start_turn);
- if (z_older_than(10,0,3))
+ if (z_older_than(10, 0, 3))
{
determine_daily_bounty(creature_ptr, TRUE);
}
rd_s16b(&creature_ptr->today_mon);
}
- if (z_older_than(10,0,7))
+ if (z_older_than(10, 0, 7))
{
creature_ptr->riding = 0;
}
}
}
- if (z_older_than(10,1,2))
+ if (z_older_than(10, 1, 2))
{
current_world_ptr->play_time = 0;
}
rd_u32b(¤t_world_ptr->play_time);
}
- if (z_older_than(10,3,9))
+ if (z_older_than(10, 3, 9))
{
creature_ptr->visit = 1L;
}
message_add(buf);
}
}
-
+
u32b num;
rd_u32b(&num);
int message_max;
floor_ptr->dun_level = (DEPTH)tmp16s;
if (z_older_than(10, 3, 8)) creature_ptr->dungeon_idx = DUNGEON_ANGBAND;
else
- {
+ {
byte tmp8u;
rd_byte(&tmp8u);
creature_ptr->dungeon_idx = (IDX)tmp8u;
creature_ptr->y = (POSITION)tmp16s;
rd_s16b(&tmp16s);
creature_ptr->x = (POSITION)tmp16s;
- if (z_older_than(10, 3, 13) && !floor_ptr->dun_level && !floor_ptr->inside_arena) { creature_ptr->y = 33; creature_ptr->x = 131;}
+ if (z_older_than(10, 3, 13) && !floor_ptr->dun_level && !floor_ptr->inside_arena) { creature_ptr->y = 33; creature_ptr->x = 131; }
rd_s16b(&tmp16s);
floor_ptr->height = (POSITION)tmp16s;
rd_s16b(&tmp16s);
/* Grab RLE info */
byte count;
rd_byte(&count);
- if (z_older_than(10,3,6))
+ if (z_older_than(10, 3, 6))
{
byte tmp8u;
rd_byte(&tmp8u);
/* Maximal size */
POSITION ymax = floor_ptr->height;
- POSITION xmax= floor_ptr->width;
-
+ POSITION xmax = floor_ptr->width;
+
/* Load the dungeon data */
for (POSITION x = 0, y = 0; y < ymax; )
{
}
/*** Meta info ***/
- /* Number of floor_id used from birth */
+ /* Number of floor_id used from birth */
rd_s16b(&max_floor_id);
/* Current dungeon type */
rd_byte(&tmp8u);
- k_ptr->aware = (tmp8u & 0x01) ? TRUE: FALSE;
- k_ptr->tried = (tmp8u & 0x02) ? TRUE: FALSE;
+ k_ptr->aware = (tmp8u & 0x01) ? TRUE : FALSE;
+ k_ptr->tried = (tmp8u & 0x02) ? TRUE : FALSE;
}
if (arg_fiddle) note(_("アイテムの記録をロードしました", "Loaded Object Memory"));
cp_ptr = &class_info[creature_ptr->pclass];
ap_ptr = &seikaku_info[creature_ptr->pseikaku];
- if(z_older_than(10, 2, 2) && (creature_ptr->pclass == CLASS_BEASTMASTER) && !creature_ptr->is_dead)
+ if (z_older_than(10, 2, 2) && (creature_ptr->pclass == CLASS_BEASTMASTER) && !creature_ptr->is_dead)
{
creature_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
roll_hitdice(creature_ptr, 0L);
}
- if(z_older_than(10, 3, 2) && (creature_ptr->pclass == CLASS_ARCHER) && !creature_ptr->is_dead)
+ if (z_older_than(10, 3, 2) && (creature_ptr->pclass == CLASS_ARCHER) && !creature_ptr->is_dead)
{
creature_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
roll_hitdice(creature_ptr, 0L);
}
- if(z_older_than(10, 2, 6) && (creature_ptr->pclass == CLASS_SORCERER) && !creature_ptr->is_dead)
+ if (z_older_than(10, 2, 6) && (creature_ptr->pclass == CLASS_SORCERER) && !creature_ptr->is_dead)
{
- creature_ptr->hitdie = rp_ptr->r_mhp/2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
+ creature_ptr->hitdie = rp_ptr->r_mhp / 2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
roll_hitdice(creature_ptr, 0L);
}
- if(z_older_than(10, 4, 7) && (creature_ptr->pclass == CLASS_BLUE_MAGE) && !creature_ptr->is_dead)
+ if (z_older_than(10, 4, 7) && (creature_ptr->pclass == CLASS_BLUE_MAGE) && !creature_ptr->is_dead)
{
creature_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
roll_hitdice(creature_ptr, 0L);
rd_u32b(&creature_ptr->spell_forgotten1);
rd_u32b(&creature_ptr->spell_forgotten2);
- if (z_older_than(10,0,5))
+ if (z_older_than(10, 0, 5))
{
creature_ptr->learned_spells = 0;
for (int i = 0; i < 64; i++)
{
/* Count known spells */
if ((i < 32) ?
- (creature_ptr->spell_learned1 & (1L << i)) :
- (creature_ptr->spell_learned2 & (1L << (i - 32))))
+ (creature_ptr->spell_learned1 & (1L << i)) :
+ (creature_ptr->spell_learned2 & (1L << (i - 32))))
{
creature_ptr->learned_spells++;
}
}
else rd_s16b(&creature_ptr->learned_spells);
- if (z_older_than(10,0,6))
+ if (z_older_than(10, 0, 6))
{
creature_ptr->add_spells = 0;
}
rd_byte(&tmp8u);
if (tmp8u) creature_ptr->pet_extra_flags |= PF_PICKUP_ITEMS;
- if (z_older_than(10,0,4)) creature_ptr->pet_extra_flags |= PF_TELEPORT;
+ if (z_older_than(10, 0, 4)) creature_ptr->pet_extra_flags |= PF_TELEPORT;
else
{
rd_byte(&tmp8u);
if (tmp8u) creature_ptr->pet_extra_flags |= PF_TELEPORT;
}
- if (z_older_than(10,0,7)) creature_ptr->pet_extra_flags |= PF_ATTACK_SPELL;
+ if (z_older_than(10, 0, 7)) creature_ptr->pet_extra_flags |= PF_ATTACK_SPELL;
else
{
rd_byte(&tmp8u);
if (tmp8u) creature_ptr->pet_extra_flags |= PF_ATTACK_SPELL;
}
- if (z_older_than(10,0,8)) creature_ptr->pet_extra_flags |= PF_SUMMON_SPELL;
+ if (z_older_than(10, 0, 8)) creature_ptr->pet_extra_flags |= PF_SUMMON_SPELL;
else
{
rd_byte(&tmp8u);
if (tmp8u) creature_ptr->pet_extra_flags |= PF_SUMMON_SPELL;
}
- if (!z_older_than(10,0,8))
+ if (!z_older_than(10, 0, 8))
{
rd_byte(&tmp8u);
if (tmp8u) creature_ptr->pet_extra_flags |= PF_BALL_SPELL;
*/
#ifdef JP
# ifdef EUC
- /* EUC kanji code */
+ /* EUC kanji code */
kanji_code = 2;
# endif
# ifdef SJIS
kanji_code = 3;
# endif
#else
- /* ASCII */
+ /* ASCII */
kanji_code = 1;
#endif
* <p>
* The "Term_xtra_win_clear()" function should probably do a low-level
* clear of the current window, and redraw the borders and other things,
-* if only for efficiency.
+* if only for efficiency.
* </p>
*
* <p>
* window, I think, and only a few calls actually check for its existance,
* this may be okay since "NULL" means "on top of all windows". (?) The
* user must never be allowed to "hide" the main window, or the "menubar"
-* will disappear.
+* will disappear.
* </p>
*
* <p>
* Special "Windows Help Files" can be placed into "lib/xtra/help/" for
* use with the "winhelp.exe" program. These files *may* be available
-* at the ftp site somewhere, but I have not seen them.
+* at the ftp site somewhere, but I have not seen them.
* </p>
*
* <p>
# endif
#endif
-/*
- * Available graphic modes
- */
+ /*
+ * Available graphic modes
+ */
#define GRAPHICS_NONE 0
#define GRAPHICS_ORIGINAL 1
#define GRAPHICS_ADAM_BOLT 2
#define GRAPHICS_HENGBAND 3
-/*
- * Hack -- allow use of "screen saver" mode
- */
+ /*
+ * Hack -- allow use of "screen saver" mode
+ */
#define USE_SAVER
-/*
- * Menu constants -- see "ANGBAND.RC"
- */
+ /*
+ * Menu constants -- see "ANGBAND.RC"
+ */
#define IDM_FILE_NEW 100
#define IDM_FILE_OPEN 101
#define IDM_HELP_CONTENTS 901
-/*
- * Exclude parts of WINDOWS.H that are not needed
- */
+ /*
+ * Exclude parts of WINDOWS.H that are not needed
+ */
#define NOCOMM /* Comm driver APIs and definitions */
#define NOLOGERROR /* LogError() and related definitions */
#define NOPROFILER /* Profiler APIs */
#define NOMDI /* MDI support */
#define NOHELP /* Help support */
-/* Not defined since it breaks Borland C++ 5.5 */
-/* #define NOCTLMGR */ /* Control management and controls */
+ /* Not defined since it breaks Borland C++ 5.5 */
+ /* #define NOCTLMGR */ /* Control management and controls */
-/*
- * Exclude parts of WINDOWS.H that are not needed (Win32)
- */
+ /*
+ * Exclude parts of WINDOWS.H that are not needed (Win32)
+ */
#define WIN32_LEAN_AND_MEAN
#define NONLS /* All NLS defines and routines */
#define NOSERVICE /* All Service Controller routines, SERVICE_ equates, etc. */
#define NOKANJI /* Kanji support stuff. */
#define NOMCX /* Modem Configuration Extensions */
-/*
- * Include the "windows" support file
- */
+ /*
+ * Include the "windows" support file
+ */
#include <windows.h>
-/*
- * Exclude parts of MMSYSTEM.H that are not needed
- */
+ /*
+ * Exclude parts of MMSYSTEM.H that are not needed
+ */
#define MMNODRV /* Installable driver support */
#define MMNOWAVE /* Waveform support */
#define MMNOMIDI /* MIDI support */
#define MMNOMMSYSTEM /* General MMSYSTEM functions */
- /*
- * Standard sound names
- */
+ /*
+ * Standard sound names
+ */
const concptr angband_sound_name[SOUND_MAX] =
{
"dummy",
#include <mmsystem.h>
#include <commdlg.h>
-/*
- * HTML-Help requires htmlhelp.h and htmlhelp.lib from Microsoft's
- * HTML Workshop < http://msdn.microsoft.com/workshop/author/htmlhelp/ >.
- */
-/* #define HTML_HELP */
+ /*
+ * HTML-Help requires htmlhelp.h and htmlhelp.lib from Microsoft's
+ * HTML Workshop < http://msdn.microsoft.com/workshop/author/htmlhelp/ >.
+ */
+ /* #define HTML_HELP */
#ifdef HTML_HELP
#include <htmlhelp.h>
# include "readdib.h"
#endif
-/*
- * Hack -- Fake declarations from "dos.h"
- */
+ /*
+ * Hack -- Fake declarations from "dos.h"
+ */
#ifdef WIN32
#define INVALID_FILE_NAME (DWORD)0xFFFFFFFF
#else /* WIN32 */
#define FA_LABEL 0x08 /* Volume label */
#define FA_DIREC 0x10 /* Directory */
-unsigned _cdecl _dos_getfileattr(concptr , unsigned *);
+unsigned _cdecl _dos_getfileattr(concptr, unsigned *);
#endif /* WIN32 */
/*
# define MoveTo(H,X,Y) MoveToEx(H, X, Y, NULL)
#endif /* WIN32 */
-/*
- * Silliness for Windows 95
- */
+ /*
+ * Silliness for Windows 95
+ */
#ifndef WS_EX_TOOLWINDOW
# define WS_EX_TOOLWINDOW 0
#endif
-/*
- * Foreground color bits (hard-coded by DOS)
- */
+ /*
+ * Foreground color bits (hard-coded by DOS)
+ */
#define VID_BLACK 0x00
#define VID_BLUE 0x01
#define VID_GREEN 0x02
#define VID_YELLOW 0x06
#define VID_WHITE 0x07
-/*
- * Bright text (hard-coded by DOS)
- */
+ /*
+ * Bright text (hard-coded by DOS)
+ */
#define VID_BRIGHT 0x08
-/*
- * Background color bits (hard-coded by DOS)
- */
+ /*
+ * Background color bits (hard-coded by DOS)
+ */
#define VUD_BLACK 0x00
#define VUD_BLUE 0x10
#define VUD_GREEN 0x20
#define VUD_YELLOW 0x60
#define VUD_WHITE 0x70
-/*
- * Blinking text (hard-coded by DOS)
- */
+ /*
+ * Blinking text (hard-coded by DOS)
+ */
#define VUD_BRIGHT 0x80
-/*
- * Forward declare
- */
+ /*
+ * Forward declare
+ */
typedef struct _term_data term_data;
/*!
delete_bg();
if (use_bg == 0) return 0;
- hBG = LoadImage(NULL, bmfile, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
+ hBG = LoadImage(NULL, bmfile, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
if (!hBG) {
plog_fmt(_("壁紙用ビットマップ '%s' を読み込めません。", "Can't load the bitmap file '%s'."), bmfile);
use_bg = 0;
BITMAP bm;
int x = r->left, y = r->top;
int nx, ny, sx, sy, swid, shgt, cwid, chgt;
-
+
if (!use_bg || !hBG)
return;
do {
sy = ny % shgt;
chgt = MIN(shgt - sy, r->bottom - ny);
- BitBlt(hdc, nx, ny, cwid, chgt, hdcSrc, sx, sy, SRCCOPY);
+ BitBlt(hdc, nx, ny, cwid, chgt, hdcSrc, sx, sy, SRCCOPY);
ny += chgt;
} while (ny < r->bottom);
ny = y;
nx += cwid;
} while (nx < r->right);
-
+
SelectObject(hdcSrc, hOld);
DeleteDC(hdcSrc);
}
i = strlen(path);
/* Remove trailing backslash */
- if (i && (path[i-1] == '\\')) path[--i] = '\0';
+ if (i && (path[i - 1] == '\\')) path[--i] = '\0';
#ifdef WIN32
/* Font */
#ifdef JP
- strcpy(buf, td->lf.lfFaceName[0]!='\0' ? td->lf.lfFaceName : "MS ゴシック");
+ strcpy(buf, td->lf.lfFaceName[0] != '\0' ? td->lf.lfFaceName : "MS ゴシック");
#else
- strcpy(buf, td->lf.lfFaceName[0]!='\0' ? td->lf.lfFaceName : "Courier");
+ strcpy(buf, td->lf.lfFaceName[0] != '\0' ? td->lf.lfFaceName : "Courier");
#endif
WritePrivateProfileString(sec_name, "Font", buf, ini_file);
/* bg */
strcpy(buf, use_bg ? "1" : "0");
WritePrivateProfileString("Angband", "BackGround", buf, ini_file);
- WritePrivateProfileString("Angband", "BackGroundBitmap",
+ WritePrivateProfileString("Angband", "BackGroundBitmap",
bg_bitmap_file[0] != '\0' ? bg_bitmap_file : "bg.bmp", ini_file);
/* Save window prefs */
char tmp[1024];
int wid, hgt, posx, posy;
- int dispx = GetSystemMetrics( SM_CXVIRTUALSCREEN);
- int dispy = GetSystemMetrics( SM_CYVIRTUALSCREEN);
- posx=0;
- posy=0;
-
+ int dispx = GetSystemMetrics(SM_CXVIRTUALSCREEN);
+ int dispy = GetSystemMetrics(SM_CYVIRTUALSCREEN);
+ posx = 0;
+ posy = 0;
+
/* Make section name */
sprintf(sec_name, "Term-%d", i);
#if 1 /* #ifdef JP */
td->font_want = string_make(tmp);
hgt = 15; wid = 0;
- td->lf.lfWidth = GetPrivateProfileInt(sec_name, "FontWid", wid, ini_file);
+ td->lf.lfWidth = GetPrivateProfileInt(sec_name, "FontWid", wid, ini_file);
td->lf.lfHeight = GetPrivateProfileInt(sec_name, "FontHgt", hgt, ini_file);
td->lf.lfWeight = GetPrivateProfileInt(sec_name, "FontWgt", 0, ini_file);
#else
/* Window position */
posx = GetPrivateProfileInt(sec_name, "PositionX", posx, ini_file);
posy = GetPrivateProfileInt(sec_name, "PositionY", posy, ini_file);
- td->pos_x = MIN(MAX(0, posx), dispx-128);
- td->pos_y = MIN(MAX(0, posy), dispy-128);
+ td->pos_x = MIN(MAX(0, posx), dispx - 128);
+ td->pos_y = MIN(MAX(0, posy), dispy - 128);
/* Window Z position */
if (i > 0)
char *t;
/* Skip leading whitespace */
- for ( ; *s && iswspace(*s); ++s) /* loop */;
+ for (; *s && iswspace(*s); ++s) /* loop */;
/* All done */
if (!*s) break;
LPPALETTEENTRY p;
/* Access the entry */
- p = &(pLogPal->palPalEntry[i+nEntries]);
+ p = &(pLogPal->palPalEntry[i + nEntries]);
/* Save the colors */
p->peRed = GetRValue(win_clr[i]);
/* Resize the window */
SetWindowPos(td->w, 0, 0, 0,
- td->size_wid, td->size_hgt,
- SWP_NOMOVE | SWP_NOZORDER);
+ td->size_wid, td->size_hgt,
+ SWP_NOMOVE | SWP_NOZORDER);
/* Redraw later */
InvalidateRect(td->w, NULL, TRUE);
/* Check "screen" */
if ((td != &data[i]) &&
- (data[i].font_file) &&
- (streq(data[i].font_file, td->font_file)))
+ (data[i].font_file) &&
+ (streq(data[i].font_file, td->font_file)))
{
used = TRUE;
}
td->font_file = string_make(base);
/* Remove the "suffix" */
- base[strlen(base)-4] = '\0';
+ base[strlen(base) - 4] = '\0';
/* Create the font (using the 'base' of the font file name!) */
td->font_id = CreateFont(hgt, wid, 0, 0, FW_DONTCARE, 0, 0, 0,
- ANSI_CHARSET, OUT_DEFAULT_PRECIS,
- CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
- FIXED_PITCH | FF_DONTCARE, base);
+ ANSI_CHARSET, OUT_DEFAULT_PRECIS,
+ CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
+ FIXED_PITCH | FF_DONTCARE, base);
#endif
/* Hack -- Unknown size */
memset(&cf, 0, sizeof(cf));
cf.lStructSize = sizeof(cf);
- cf.Flags = CF_SCREENFONTS | CF_FIXEDPITCHONLY | CF_NOVERTFONTS | CF_INITTOLOGFONTSTRUCT;
- cf.lpLogFont = &(td->lf);
+ cf.Flags = CF_SCREENFONTS | CF_FIXEDPITCHONLY | CF_NOVERTFONTS | CF_INITTOLOGFONTSTRUCT;
+ cf.lpLogFont = &(td->lf);
if (ChooseFont(&cf))
{
static void term_window_pos(term_data *td, HWND hWnd)
{
SetWindowPos(td->w, hWnd, 0, 0, 0, 0,
- SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
+ SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
}
static void windows_map(void);
hdc = GetDC(hWnd);
myBrush = CreateSolidBrush(RGB(255, 255, 255));
oldBrush = SelectObject(hdc, myBrush);
- oldPen = SelectObject(hdc, GetStockObject(NULL_PEN) );
+ oldPen = SelectObject(hdc, GetStockObject(NULL_PEN));
PatBlt(hdc, tx, ty, tw, th, PATINVERT);
/* Change setting */
use_music = arg_music;
- if(!arg_music) stop_music();
+ if (!arg_music) stop_music();
else select_floor_music(p_ptr);
}
/*
* Hack -- clear the screen
*
- * Make this more efficient
+ * Make this more efficient
*/
static errr Term_xtra_win_clear(void)
{
mciSendCommand(mop.wDeviceID, MCI_CLOSE, 0, 0);
}
- if(!use_music) return 1;
+ if (!use_music) return 1;
/* Illegal sound */
- if(n == TERM_XTRA_MUSIC_BASIC && ((v < 0) || (v >= MUSIC_BASIC_MAX))) return 1;
- else if(v < 0 || v >= 1000) return(1); /*!< TODO */
+ if (n == TERM_XTRA_MUSIC_BASIC && ((v < 0) || (v >= MUSIC_BASIC_MAX))) return 1;
+ else if (v < 0 || v >= 1000) return(1); /*!< TODO */
#ifdef USE_MUSIC
- switch(n)
+ switch (n)
{
case TERM_XTRA_MUSIC_BASIC:
- for (i = 0; i < SAMPLE_MUSIC_MAX; i++) if(!music_file[v][i]) break;
+ for (i = 0; i < SAMPLE_MUSIC_MAX; i++) if (!music_file[v][i]) break;
break;
case TERM_XTRA_MUSIC_DUNGEON:
- for (i = 0; i < SAMPLE_MUSIC_MAX; i++) if(!dungeon_music_file[v][i]) break;
+ for (i = 0; i < SAMPLE_MUSIC_MAX; i++) if (!dungeon_music_file[v][i]) break;
break;
case TERM_XTRA_MUSIC_QUEST:
- for (i = 0; i < SAMPLE_MUSIC_MAX; i++) if(!quest_music_file[v][i]) break;
+ for (i = 0; i < SAMPLE_MUSIC_MAX; i++) if (!quest_music_file[v][i]) break;
break;
case TERM_XTRA_MUSIC_TOWN:
- for (i = 0; i < SAMPLE_MUSIC_MAX; i++) if(!town_music_file[v][i]) break;
+ for (i = 0; i < SAMPLE_MUSIC_MAX; i++) if (!town_music_file[v][i]) break;
break;
}
return 1;
}
- switch(n)
+ switch (n)
{
case TERM_XTRA_MUSIC_BASIC:
path_build(buf, 1024, ANGBAND_DIR_XTRA_MUSIC, music_file[v][Rand_external(i)]);
break;
}
- if(current_music_type == n && current_music_id == v)
+ if (current_music_type == n && current_music_id == v)
{
return 0;
}
#ifdef WIN32
- mop.lpstrDeviceType = mci_device_type;
+ mop.lpstrDeviceType = mci_device_type;
mop.lpstrElementName = buf;
mciSendCommand(mop.wDeviceID, MCI_STOP, 0, 0);
mciSendCommand(mop.wDeviceID, MCI_CLOSE, 0, 0);
switch (n)
{
/* Make a bell sound */
- case TERM_XTRA_NOISE:
- {
- return (Term_xtra_win_noise());
- }
+ case TERM_XTRA_NOISE:
+ {
+ return (Term_xtra_win_noise());
+ }
- /* Play a music */
- case TERM_XTRA_MUSIC_BASIC:
- case TERM_XTRA_MUSIC_DUNGEON:
- case TERM_XTRA_MUSIC_QUEST:
- case TERM_XTRA_MUSIC_TOWN:
- {
- return (Term_xtra_win_music(n, v));
- }
+ /* Play a music */
+ case TERM_XTRA_MUSIC_BASIC:
+ case TERM_XTRA_MUSIC_DUNGEON:
+ case TERM_XTRA_MUSIC_QUEST:
+ case TERM_XTRA_MUSIC_TOWN:
+ {
+ return (Term_xtra_win_music(n, v));
+ }
- /* Make a special sound */
- case TERM_XTRA_SOUND:
- {
- return (Term_xtra_win_sound(v));
- }
+ /* Make a special sound */
+ case TERM_XTRA_SOUND:
+ {
+ return (Term_xtra_win_sound(v));
+ }
- /* Process random events */
- case TERM_XTRA_BORED:
- {
- return (Term_xtra_win_event(0));
- }
+ /* Process random events */
+ case TERM_XTRA_BORED:
+ {
+ return (Term_xtra_win_event(0));
+ }
- /* Process an event */
- case TERM_XTRA_EVENT:
- {
- return (Term_xtra_win_event(v));
- }
+ /* Process an event */
+ case TERM_XTRA_EVENT:
+ {
+ return (Term_xtra_win_event(v));
+ }
- /* Flush all events */
- case TERM_XTRA_FLUSH:
- {
- return (Term_xtra_win_flush());
- }
+ /* Flush all events */
+ case TERM_XTRA_FLUSH:
+ {
+ return (Term_xtra_win_flush());
+ }
- /* Clear the screen */
- case TERM_XTRA_CLEAR:
- {
- return (Term_xtra_win_clear());
- }
+ /* Clear the screen */
+ case TERM_XTRA_CLEAR:
+ {
+ return (Term_xtra_win_clear());
+ }
- /* React to global changes */
- case TERM_XTRA_REACT:
- {
- return (Term_xtra_win_react());
- }
+ /* React to global changes */
+ case TERM_XTRA_REACT:
+ {
+ return (Term_xtra_win_react());
+ }
- /* Delay for some milliseconds */
- case TERM_XTRA_DELAY:
- {
- return (Term_xtra_win_delay(v));
- }
+ /* Delay for some milliseconds */
+ case TERM_XTRA_DELAY:
+ {
+ return (Term_xtra_win_delay(v));
+ }
}
return 1;
*
* One would think there is a more efficient method for telling a window
* what color it should be using to draw with, but perhaps simply changing
- * it every time is not too inefficient.
+ * it every time is not too inefficient.
*/
static errr Term_text_win(int x, int y, int n, TERM_COLOR a, concptr s)
{
static HPEN oldPen;
static bool init_done = FALSE;
- if (!init_done){
+ if (!init_done) {
WALL = LoadBitmap(hInstance, AppName);
myBrush = CreatePatternBrush(WALL);
init_done = TRUE;
}
else if (paletted)
{
- SetTextColor(hdc, win_clr[a&0x0F]);
+ SetTextColor(hdc, win_clr[a & 0x0F]);
}
else
{
/* Use the font */
SelectObject(hdc, td->font_id);
-
+
/* bg */
if (use_bg) SetBkMode(hdc, TRANSPARENT);
/* Bizarre size */
if (td->bizarre ||
- (td->tile_hgt != td->font_hgt) ||
- (td->tile_wid != td->font_wid))
+ (td->tile_hgt != td->font_hgt) ||
+ (td->tile_wid != td->font_wid))
{
int i;
/* Erase complete rectangle */
ExtTextOut(hdc, 0, 0, ETO_OPAQUE, &rc, NULL, 0, NULL);
-
+
/* bg */
if (use_bg) DrawBG(hdc, &rc);
for (i = 0; i < n; i++)
{
#ifdef JP
- if (use_bigtile && *(s+i)=="■"[0] && *(s+i+1)=="■"[1])
+ if (use_bigtile && *(s + i) == "■"[0] && *(s + i + 1) == "■"[1])
{
rc.right += td->font_wid;
oldBrush = SelectObject(hdc, myBrush);
- oldPen = SelectObject(hdc, GetStockObject(NULL_PEN) );
+ oldPen = SelectObject(hdc, GetStockObject(NULL_PEN));
/* Dump the wall */
- Rectangle(hdc, rc.left, rc.top, rc.right+1, rc.bottom+1);
+ Rectangle(hdc, rc.left, rc.top, rc.right + 1, rc.bottom + 1);
SelectObject(hdc, oldBrush);
SelectObject(hdc, oldPen);
rc.left += 2 * td->tile_wid;
rc.right += 2 * td->tile_wid;
}
- else if ( iskanji(*(s+i)) ) /* 2バイト文字 */
+ else if (iskanji(*(s + i))) /* 2バイト文字 */
{
rc.right += td->font_wid;
/* Dump the text */
ExtTextOut(hdc, rc.left, rc.top, ETO_CLIPPED, &rc,
- s+i, 2, NULL);
+ s + i, 2, NULL);
rc.right -= td->font_wid;
/* Advance */
i++;
rc.left += 2 * td->tile_wid;
rc.right += 2 * td->tile_wid;
- } else if (*(s+i)==127){
+ }
+ else if (*(s + i) == 127) {
oldBrush = SelectObject(hdc, myBrush);
- oldPen = SelectObject(hdc, GetStockObject(NULL_PEN) );
+ oldPen = SelectObject(hdc, GetStockObject(NULL_PEN));
/* Dump the wall */
- Rectangle(hdc, rc.left, rc.top, rc.right+1, rc.bottom+1);
+ Rectangle(hdc, rc.left, rc.top, rc.right + 1, rc.bottom + 1);
SelectObject(hdc, oldBrush);
SelectObject(hdc, oldPen);
/* Advance */
rc.left += td->tile_wid;
rc.right += td->tile_wid;
- } else {
+ }
+ else {
/* Dump the text */
- ExtTextOut(hdc, rc.left, rc.top, ETO_CLIPPED, &rc, s+i, 1, NULL);
+ ExtTextOut(hdc, rc.left, rc.top, ETO_CLIPPED, &rc, s + i, 1, NULL);
/* Advance */
rc.left += td->tile_wid;
}
#else
#if 1
- if (*(s+i)==127){
+ if (*(s + i) == 127) {
oldBrush = SelectObject(hdc, myBrush);
- oldPen = SelectObject(hdc, GetStockObject(NULL_PEN) );
+ oldPen = SelectObject(hdc, GetStockObject(NULL_PEN));
/* Dump the wall */
- Rectangle(hdc, rc.left, rc.top, rc.right+1, rc.bottom+1);
+ Rectangle(hdc, rc.left, rc.top, rc.right + 1, rc.bottom + 1);
SelectObject(hdc, oldBrush);
SelectObject(hdc, oldPen);
/* Advance */
rc.left += td->tile_wid;
rc.right += td->tile_wid;
- } else {
+ }
+ else {
/* Dump the text */
ExtTextOut(hdc, rc.left, rc.top, ETO_CLIPPED, &rc,
- s+i, 1, NULL);
+ s + i, 1, NULL);
/* Advance */
rc.left += td->tile_wid;
#else
/* Dump the text */
ExtTextOut(hdc, rc.left, rc.top, 0, &rc,
- s+i, 1, NULL);
+ s + i, 1, NULL);
/* Advance */
rc.left += td->tile_wid;
{
/* Dump the text */
ExtTextOut(hdc, rc.left, rc.top, ETO_OPAQUE | ETO_CLIPPED, &rc,
- s, n, NULL);
+ s, n, NULL);
}
/* Release DC */
* to over-ride selected values, then create the windows, and fonts.
*
* Must use SW_SHOW not SW_SHOWNA, since on 256 color display
- * must make active to realize the palette.
+ * must make active to realize the palette.
*/
static void init_windows(void)
{
td->pos_y = (7 - i) * 20;
td->posfix = FALSE;
#if 1 /* #ifdef JP */
- td->bizarre = TRUE;
+ td->bizarre = TRUE;
#endif
}
/* Main window (need these before term_getsize gets called) */
td = &data[0];
td->dwStyle = (WS_OVERLAPPED | WS_THICKFRAME | WS_SYSMENU |
- WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_CAPTION |
- WS_VISIBLE);
+ WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_CAPTION |
+ WS_VISIBLE);
td->dwExStyle = 0;
td->visible = TRUE;
td->lf.lfPitchAndFamily = FIXED_PITCH | FF_DONTCARE;
/* Activate the chosen font */
term_force_font(td, NULL);
- if(!td->tile_wid) td->tile_wid = td->font_wid;
- if(!td->tile_hgt) td->tile_hgt = td->font_hgt;
+ if (!td->tile_wid) td->tile_wid = td->font_wid;
+ if (!td->tile_hgt) td->tile_hgt = td->font_hgt;
#else
/* Access the standard font file */
path_build(buf, sizeof(buf), ANGBAND_DIR_XTRA_FONT, td->font_want);
my_td = td;
td->w = CreateWindowEx(td->dwExStyle, AngList,
- td->s, td->dwStyle,
- td->pos_x, td->pos_y,
- td->size_wid, td->size_hgt,
- HWND_DESKTOP, NULL, hInstance, NULL);
+ td->s, td->dwStyle,
+ td->pos_x, td->pos_y,
+ td->size_wid, td->size_hgt,
+ HWND_DESKTOP, NULL, hInstance, NULL);
my_td = NULL;
if (!td->w) quit(_("サブウィンドウに作成に失敗しました", "Failed to create sub-window"));
/* Main window */
my_td = td;
td->w = CreateWindowEx(td->dwExStyle, AppName,
- td->s, td->dwStyle,
- td->pos_x, td->pos_y,
- td->size_wid, td->size_hgt,
- HWND_DESKTOP, NULL, hInstance, NULL);
+ td->s, td->dwStyle,
+ td->pos_x, td->pos_y,
+ td->size_wid, td->size_hgt,
+ HWND_DESKTOP, NULL, hInstance, NULL);
my_td = NULL;
if (!td->w) quit(_("メインウィンドウの作成に失敗しました", "Failed to create Angband window"));
/* Menu "File", Disable all */
EnableMenuItem(hm, IDM_FILE_NEW,
- MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
+ MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
EnableMenuItem(hm, IDM_FILE_OPEN,
- MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
+ MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
EnableMenuItem(hm, IDM_FILE_SAVE,
- MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
+ MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
EnableMenuItem(hm, IDM_FILE_EXIT,
- MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
+ MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
EnableMenuItem(hm, IDM_FILE_SCORE,
- MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
+ MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
/* No character available */
{
/* Menu "File", Item "Save" */
EnableMenuItem(hm, IDM_FILE_SAVE,
- MF_BYCOMMAND | MF_ENABLED);
+ MF_BYCOMMAND | MF_ENABLED);
}
/* Menu "File", Item "Exit" */
EnableMenuItem(hm, IDM_FILE_EXIT,
- MF_BYCOMMAND | MF_ENABLED);
+ MF_BYCOMMAND | MF_ENABLED);
EnableMenuItem(hm, IDM_FILE_SCORE,
- MF_BYCOMMAND | MF_ENABLED);
+ MF_BYCOMMAND | MF_ENABLED);
/* Menu "Window::Visibility" */
for (i = 0; i < MAX_TERM_DATA; i++)
{
EnableMenuItem(hm, IDM_WINDOW_VIS_0 + i,
- MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
+ MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
CheckMenuItem(hm, IDM_WINDOW_VIS_0 + i,
- (data[i].visible ? MF_CHECKED : MF_UNCHECKED));
+ (data[i].visible ? MF_CHECKED : MF_UNCHECKED));
EnableMenuItem(hm, IDM_WINDOW_VIS_0 + i,
- MF_BYCOMMAND | MF_ENABLED);
+ MF_BYCOMMAND | MF_ENABLED);
}
/* Menu "Window::Font" */
for (i = 0; i < MAX_TERM_DATA; i++)
{
EnableMenuItem(hm, IDM_WINDOW_FONT_0 + i,
- MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
+ MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
if (data[i].visible)
{
EnableMenuItem(hm, IDM_WINDOW_FONT_0 + i,
- MF_BYCOMMAND | MF_ENABLED);
+ MF_BYCOMMAND | MF_ENABLED);
}
}
for (i = 0; i < MAX_TERM_DATA; i++)
{
EnableMenuItem(hm, IDM_WINDOW_POS_0 + i,
- MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
+ MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
CheckMenuItem(hm, IDM_WINDOW_POS_0 + i,
- (data[i].posfix ? MF_CHECKED : MF_UNCHECKED));
+ (data[i].posfix ? MF_CHECKED : MF_UNCHECKED));
if (data[i].visible)
{
EnableMenuItem(hm, IDM_WINDOW_POS_0 + i,
- MF_BYCOMMAND | MF_ENABLED);
+ MF_BYCOMMAND | MF_ENABLED);
}
}
for (i = 0; i < MAX_TERM_DATA; i++)
{
EnableMenuItem(hm, IDM_WINDOW_BIZ_0 + i,
- MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
+ MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
CheckMenuItem(hm, IDM_WINDOW_BIZ_0 + i,
- (data[i].bizarre ? MF_CHECKED : MF_UNCHECKED));
+ (data[i].bizarre ? MF_CHECKED : MF_UNCHECKED));
if (data[i].visible)
{
EnableMenuItem(hm, IDM_WINDOW_BIZ_0 + i,
- MF_BYCOMMAND | MF_ENABLED);
+ MF_BYCOMMAND | MF_ENABLED);
}
}
for (i = 0; i < MAX_TERM_DATA; i++)
{
EnableMenuItem(hm, IDM_WINDOW_I_WID_0 + i,
- MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
+ MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
if (data[i].visible)
{
EnableMenuItem(hm, IDM_WINDOW_I_WID_0 + i,
- MF_BYCOMMAND | MF_ENABLED);
+ MF_BYCOMMAND | MF_ENABLED);
}
}
for (i = 0; i < MAX_TERM_DATA; i++)
{
EnableMenuItem(hm, IDM_WINDOW_D_WID_0 + i,
- MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
+ MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
if (data[i].visible)
{
EnableMenuItem(hm, IDM_WINDOW_D_WID_0 + i,
- MF_BYCOMMAND | MF_ENABLED);
+ MF_BYCOMMAND | MF_ENABLED);
}
}
for (i = 0; i < MAX_TERM_DATA; i++)
{
EnableMenuItem(hm, IDM_WINDOW_I_HGT_0 + i,
- MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
+ MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
if (data[i].visible)
{
EnableMenuItem(hm, IDM_WINDOW_I_HGT_0 + i,
- MF_BYCOMMAND | MF_ENABLED);
+ MF_BYCOMMAND | MF_ENABLED);
}
}
for (i = 0; i < MAX_TERM_DATA; i++)
{
EnableMenuItem(hm, IDM_WINDOW_D_HGT_0 + i,
- MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
+ MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
if (data[i].visible)
{
EnableMenuItem(hm, IDM_WINDOW_D_HGT_0 + i,
- MF_BYCOMMAND | MF_ENABLED);
+ MF_BYCOMMAND | MF_ENABLED);
}
}
/* Menu "Options", disable all */
EnableMenuItem(hm, IDM_OPTIONS_NO_GRAPHICS,
- MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
+ MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
EnableMenuItem(hm, IDM_OPTIONS_OLD_GRAPHICS,
- MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
+ MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
EnableMenuItem(hm, IDM_OPTIONS_NEW_GRAPHICS,
- MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
+ MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
EnableMenuItem(hm, IDM_OPTIONS_BIGTILE,
- MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
+ MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
EnableMenuItem(hm, IDM_OPTIONS_SOUND,
- MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
+ MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
#ifndef JP
EnableMenuItem(hm, IDM_OPTIONS_SAVER,
- MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
+ MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
#endif
/* Menu "Options", Item "Map" */
EnableMenuItem(GetMenu(data[0].w), IDM_OPTIONS_MAP, MF_BYCOMMAND | MF_ENABLED);
else
EnableMenuItem(GetMenu(data[0].w), IDM_OPTIONS_MAP,
- MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
+ MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
/* Menu "Options", update all */
CheckMenuItem(hm, IDM_OPTIONS_NO_GRAPHICS,
- (arg_graphics == GRAPHICS_NONE ? MF_CHECKED : MF_UNCHECKED));
+ (arg_graphics == GRAPHICS_NONE ? MF_CHECKED : MF_UNCHECKED));
CheckMenuItem(hm, IDM_OPTIONS_OLD_GRAPHICS,
- (arg_graphics == GRAPHICS_ORIGINAL ? MF_CHECKED : MF_UNCHECKED));
+ (arg_graphics == GRAPHICS_ORIGINAL ? MF_CHECKED : MF_UNCHECKED));
CheckMenuItem(hm, IDM_OPTIONS_NEW_GRAPHICS,
- (arg_graphics == GRAPHICS_ADAM_BOLT ? MF_CHECKED : MF_UNCHECKED));
+ (arg_graphics == GRAPHICS_ADAM_BOLT ? MF_CHECKED : MF_UNCHECKED));
CheckMenuItem(hm, IDM_OPTIONS_NEW2_GRAPHICS,
- (arg_graphics == GRAPHICS_HENGBAND ? MF_CHECKED : MF_UNCHECKED));
+ (arg_graphics == GRAPHICS_HENGBAND ? MF_CHECKED : MF_UNCHECKED));
CheckMenuItem(hm, IDM_OPTIONS_BIGTILE,
- (arg_bigtile ? MF_CHECKED : MF_UNCHECKED));
+ (arg_bigtile ? MF_CHECKED : MF_UNCHECKED));
CheckMenuItem(hm, IDM_OPTIONS_MUSIC,
- (arg_music ? MF_CHECKED : MF_UNCHECKED));
+ (arg_music ? MF_CHECKED : MF_UNCHECKED));
CheckMenuItem(hm, IDM_OPTIONS_SOUND,
- (arg_sound ? MF_CHECKED : MF_UNCHECKED));
+ (arg_sound ? MF_CHECKED : MF_UNCHECKED));
CheckMenuItem(hm, IDM_OPTIONS_BG,
- (use_bg ? MF_CHECKED : MF_UNCHECKED));
+ (use_bg ? MF_CHECKED : MF_UNCHECKED));
#ifndef JP
CheckMenuItem(hm, IDM_OPTIONS_SAVER,
- (hwndSaver ? MF_CHECKED : MF_UNCHECKED));
+ (hwndSaver ? MF_CHECKED : MF_UNCHECKED));
#endif
#ifdef USE_GRAPHICS
#ifdef USE_SAVER
/* Menu "Options", Item "ScreenSaver" */
EnableMenuItem(hm, IDM_OPTIONS_SAVER,
- MF_BYCOMMAND | MF_ENABLED);
+ MF_BYCOMMAND | MF_ENABLED);
#endif /* USE_SAVER */
}
switch (wCmd)
{
/* New game */
- case IDM_FILE_NEW:
+ case IDM_FILE_NEW:
+ {
+ if (!initialized)
{
- if (!initialized)
- {
- plog(_("まだ初期化中です...", "You cannot do that yet..."));
- }
- else if (game_in_progress)
- {
- plog(_("プレイ中は新しいゲームを始めることができません!", "You can't start a new game while you're still playing!"));
- }
- else
+ plog(_("まだ初期化中です...", "You cannot do that yet..."));
+ }
+ else if (game_in_progress)
+ {
+ plog(_("プレイ中は新しいゲームを始めることができません!", "You can't start a new game while you're still playing!"));
+ }
+ else
+ {
+ game_in_progress = TRUE;
+ Term_flush();
+ play_game(p_ptr, TRUE);
+ quit(NULL);
+ }
+ break;
+ }
+
+ /* Open game */
+ case IDM_FILE_OPEN:
+ {
+ if (!initialized)
+ {
+ plog(_("まだ初期化中です...", "You cannot do that yet..."));
+ }
+ else if (game_in_progress)
+ {
+ plog(_("プレイ中はゲームをロードすることができません!", "You can't open a new game while you're still playing!"));
+ }
+ else
+ {
+ memset(&ofn, 0, sizeof(ofn));
+ ofn.lStructSize = sizeof(ofn);
+ ofn.hwndOwner = data[0].w;
+ ofn.lpstrFilter = "Save Files (*.)\0*\0";
+ ofn.nFilterIndex = 1;
+ ofn.lpstrFile = savefile;
+ ofn.nMaxFile = 1024;
+ ofn.lpstrInitialDir = ANGBAND_DIR_SAVE;
+ ofn.Flags = OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR | OFN_HIDEREADONLY;
+
+ if (GetOpenFileName(&ofn))
{
+ /* Load 'savefile' */
+ validate_file(savefile);
game_in_progress = TRUE;
Term_flush();
- play_game(p_ptr, TRUE);
+ play_game(p_ptr, FALSE);
quit(NULL);
}
- break;
}
+ break;
+ }
- /* Open game */
- case IDM_FILE_OPEN:
+ /* Save game */
+ case IDM_FILE_SAVE:
+ {
+ if (game_in_progress && current_world_ptr->character_generated)
{
- if (!initialized)
- {
- plog(_("まだ初期化中です...", "You cannot do that yet..."));
- }
- else if (game_in_progress)
- {
- plog(_("プレイ中はゲームをロードすることができません!", "You can't open a new game while you're still playing!"));
- }
- else
+ if (!can_save)
{
- memset(&ofn, 0, sizeof(ofn));
- ofn.lStructSize = sizeof(ofn);
- ofn.hwndOwner = data[0].w;
- ofn.lpstrFilter = "Save Files (*.)\0*\0";
- ofn.nFilterIndex = 1;
- ofn.lpstrFile = savefile;
- ofn.nMaxFile = 1024;
- ofn.lpstrInitialDir = ANGBAND_DIR_SAVE;
- ofn.Flags = OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR | OFN_HIDEREADONLY;
-
- if (GetOpenFileName(&ofn))
- {
- /* Load 'savefile' */
- validate_file(savefile);
- game_in_progress = TRUE;
- Term_flush();
- play_game(p_ptr, FALSE);
- quit(NULL);
- }
+ plog(_("今はセーブすることは出来ません。", "You may not do that right now."));
+ break;
}
- break;
- }
-
- /* Save game */
- case IDM_FILE_SAVE:
- {
- if (game_in_progress && current_world_ptr->character_generated)
- {
- if (!can_save)
- {
- plog(_("今はセーブすることは出来ません。", "You may not do that right now."));
- break;
- }
- /* Hack -- Forget messages */
- msg_flag = FALSE;
+ /* Hack -- Forget messages */
+ msg_flag = FALSE;
- /* Save the game */
+ /* Save the game */
#ifdef ZANGBAND
- do_cmd_save_game(p_ptr, FALSE);
+ do_cmd_save_game(p_ptr, FALSE);
#else /* ZANGBAND */
- do_cmd_save_game();
+ do_cmd_save_game();
#endif /* ZANGBAND */
- }
- else
- {
- plog(_("今、セーブすることは出来ません。", "You may not do that right now."));
- }
- break;
}
+ else
+ {
+ plog(_("今、セーブすることは出来ません。", "You may not do that right now."));
+ }
+ break;
+ }
- case IDM_FILE_EXIT:
+ case IDM_FILE_EXIT:
+ {
+ if (game_in_progress && current_world_ptr->character_generated)
{
- if (game_in_progress && current_world_ptr->character_generated)
+ if (!can_save)
{
- if (!can_save)
- {
- plog(_("今は終了できません。", "You may not do that right now."));
- break;
- }
+ plog(_("今は終了できません。", "You may not do that right now."));
+ break;
+ }
- /* Hack -- Forget messages */
- msg_flag = FALSE;
+ /* Hack -- Forget messages */
+ msg_flag = FALSE;
- forget_lite(p_ptr->current_floor_ptr);
- forget_view(p_ptr->current_floor_ptr);
- clear_mon_lite(p_ptr->current_floor_ptr);
+ forget_lite(p_ptr->current_floor_ptr);
+ forget_view(p_ptr->current_floor_ptr);
+ clear_mon_lite(p_ptr->current_floor_ptr);
- /* Save the game */
+ /* Save the game */
#ifdef ZANGBAND
/* do_cmd_save_game(FALSE); */
#else /* ZANGBAND */
/* do_cmd_save_game(); */
#endif /* ZANGBAND */
- Term_key_push(SPECIAL_KEY_QUIT);
- break;
- }
- quit(NULL);
+ Term_key_push(SPECIAL_KEY_QUIT);
break;
}
+ quit(NULL);
+ break;
+ }
- /* Show scores */
- case IDM_FILE_SCORE:
- {
- char buf[1024];
- path_build(buf, sizeof(buf), ANGBAND_DIR_APEX, "scores.raw");
-
- /* Open the binary high score file, for reading */
- highscore_fd = fd_open(buf, O_RDONLY);
+ /* Show scores */
+ case IDM_FILE_SCORE:
+ {
+ char buf[1024];
+ path_build(buf, sizeof(buf), ANGBAND_DIR_APEX, "scores.raw");
- /* Paranoia -- No score file */
- if (highscore_fd < 0)
- {
- msg_print("Score file unavailable.");
- }
- else
- {
- screen_save();
- Term_clear();
+ /* Open the binary high score file, for reading */
+ highscore_fd = fd_open(buf, O_RDONLY);
- /* Display the scores */
- display_scores_aux(0, MAX_HISCORES, -1, NULL);
+ /* Paranoia -- No score file */
+ if (highscore_fd < 0)
+ {
+ msg_print("Score file unavailable.");
+ }
+ else
+ {
+ screen_save();
+ Term_clear();
- /* Shut the high score file */
- (void)fd_close(highscore_fd);
+ /* Display the scores */
+ display_scores_aux(0, MAX_HISCORES, -1, NULL);
- /* Forget the high score fd */
- highscore_fd = -1;
- screen_load();
+ /* Shut the high score file */
+ (void)fd_close(highscore_fd);
- /* Hack - Flush it */
- Term_fresh();
- }
+ /* Forget the high score fd */
+ highscore_fd = -1;
+ screen_load();
- break;
+ /* Hack - Flush it */
+ Term_fresh();
}
- /* Open game */
- case IDM_FILE_MOVIE:
+ break;
+ }
+
+ /* Open game */
+ case IDM_FILE_MOVIE:
+ {
+ if (!initialized)
{
- if (!initialized)
- {
- plog(_("まだ初期化中です...", "You cannot do that yet..."));
- }
- else if (game_in_progress)
- {
- plog(_("プレイ中はムービーをロードすることができません!", "You can't open a movie while you're playing!"));
- }
- else
- {
- memset(&ofn, 0, sizeof(ofn));
- ofn.lStructSize = sizeof(ofn);
- ofn.hwndOwner = data[0].w;
- ofn.lpstrFilter = "Angband Movie Files (*.amv)\0*.amv\0";
- ofn.nFilterIndex = 1;
- ofn.lpstrFile = savefile;
- ofn.nMaxFile = 1024;
- ofn.lpstrInitialDir = ANGBAND_DIR_USER;
- ofn.Flags = OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR;
-
- if (GetOpenFileName(&ofn))
- {
- /* Load 'savefile' */
- prepare_browse_movie_aux(savefile);
- play_game(p_ptr, FALSE);
- quit(NULL);
- return;
- }
- }
- break;
+ plog(_("まだ初期化中です...", "You cannot do that yet..."));
}
-
-
- case IDM_WINDOW_VIS_0:
+ else if (game_in_progress)
{
- plog(_("メインウィンドウは非表示にできません!", "You are not allowed to do that!"));
- break;
+ plog(_("プレイ中はムービーをロードすることができません!", "You can't open a movie while you're playing!"));
}
-
- /* Window visibility */
- case IDM_WINDOW_VIS_1:
- case IDM_WINDOW_VIS_2:
- case IDM_WINDOW_VIS_3:
- case IDM_WINDOW_VIS_4:
- case IDM_WINDOW_VIS_5:
- case IDM_WINDOW_VIS_6:
- case IDM_WINDOW_VIS_7:
+ else
{
- i = wCmd - IDM_WINDOW_VIS_0;
-
- if ((i < 0) || (i >= MAX_TERM_DATA)) break;
-
- td = &data[i];
+ memset(&ofn, 0, sizeof(ofn));
+ ofn.lStructSize = sizeof(ofn);
+ ofn.hwndOwner = data[0].w;
+ ofn.lpstrFilter = "Angband Movie Files (*.amv)\0*.amv\0";
+ ofn.nFilterIndex = 1;
+ ofn.lpstrFile = savefile;
+ ofn.nMaxFile = 1024;
+ ofn.lpstrInitialDir = ANGBAND_DIR_USER;
+ ofn.Flags = OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR;
- if (!td->visible)
- {
- td->visible = TRUE;
- ShowWindow(td->w, SW_SHOW);
- term_data_redraw(td);
- }
- else
+ if (GetOpenFileName(&ofn))
{
- td->visible = FALSE;
- td->posfix = FALSE;
- ShowWindow(td->w, SW_HIDE);
+ /* Load 'savefile' */
+ prepare_browse_movie_aux(savefile);
+ play_game(p_ptr, FALSE);
+ quit(NULL);
+ return;
}
-
- break;
}
+ break;
+ }
- /* Window fonts */
- case IDM_WINDOW_FONT_0:
- case IDM_WINDOW_FONT_1:
- case IDM_WINDOW_FONT_2:
- case IDM_WINDOW_FONT_3:
- case IDM_WINDOW_FONT_4:
- case IDM_WINDOW_FONT_5:
- case IDM_WINDOW_FONT_6:
- case IDM_WINDOW_FONT_7:
- {
- i = wCmd - IDM_WINDOW_FONT_0;
- if ((i < 0) || (i >= MAX_TERM_DATA)) break;
+ case IDM_WINDOW_VIS_0:
+ {
+ plog(_("メインウィンドウは非表示にできません!", "You are not allowed to do that!"));
+ break;
+ }
- td = &data[i];
+ /* Window visibility */
+ case IDM_WINDOW_VIS_1:
+ case IDM_WINDOW_VIS_2:
+ case IDM_WINDOW_VIS_3:
+ case IDM_WINDOW_VIS_4:
+ case IDM_WINDOW_VIS_5:
+ case IDM_WINDOW_VIS_6:
+ case IDM_WINDOW_VIS_7:
+ {
+ i = wCmd - IDM_WINDOW_VIS_0;
- term_change_font(td);
+ if ((i < 0) || (i >= MAX_TERM_DATA)) break;
- break;
- }
+ td = &data[i];
- /* Window Z Position */
- case IDM_WINDOW_POS_1:
- case IDM_WINDOW_POS_2:
- case IDM_WINDOW_POS_3:
- case IDM_WINDOW_POS_4:
- case IDM_WINDOW_POS_5:
- case IDM_WINDOW_POS_6:
- case IDM_WINDOW_POS_7:
+ if (!td->visible)
{
- i = wCmd - IDM_WINDOW_POS_0;
-
- if ((i < 0) || (i >= MAX_TERM_DATA)) break;
+ td->visible = TRUE;
+ ShowWindow(td->w, SW_SHOW);
+ term_data_redraw(td);
+ }
+ else
+ {
+ td->visible = FALSE;
+ td->posfix = FALSE;
+ ShowWindow(td->w, SW_HIDE);
+ }
- td = &data[i];
+ break;
+ }
- if (!td->posfix && td->visible)
- {
- td->posfix = TRUE;
- term_window_pos(td, HWND_TOPMOST);
- }
- else
- {
- td->posfix = FALSE;
- term_window_pos(td, data[0].w);
- }
+ /* Window fonts */
+ case IDM_WINDOW_FONT_0:
+ case IDM_WINDOW_FONT_1:
+ case IDM_WINDOW_FONT_2:
+ case IDM_WINDOW_FONT_3:
+ case IDM_WINDOW_FONT_4:
+ case IDM_WINDOW_FONT_5:
+ case IDM_WINDOW_FONT_6:
+ case IDM_WINDOW_FONT_7:
+ {
+ i = wCmd - IDM_WINDOW_FONT_0;
- break;
- }
+ if ((i < 0) || (i >= MAX_TERM_DATA)) break;
- /* Bizarre Display */
- case IDM_WINDOW_BIZ_0:
- case IDM_WINDOW_BIZ_1:
- case IDM_WINDOW_BIZ_2:
- case IDM_WINDOW_BIZ_3:
- case IDM_WINDOW_BIZ_4:
- case IDM_WINDOW_BIZ_5:
- case IDM_WINDOW_BIZ_6:
- case IDM_WINDOW_BIZ_7:
- {
- i = wCmd - IDM_WINDOW_BIZ_0;
+ td = &data[i];
- if ((i < 0) || (i >= MAX_TERM_DATA)) break;
+ term_change_font(td);
- td = &data[i];
+ break;
+ }
- td->bizarre = !td->bizarre;
+ /* Window Z Position */
+ case IDM_WINDOW_POS_1:
+ case IDM_WINDOW_POS_2:
+ case IDM_WINDOW_POS_3:
+ case IDM_WINDOW_POS_4:
+ case IDM_WINDOW_POS_5:
+ case IDM_WINDOW_POS_6:
+ case IDM_WINDOW_POS_7:
+ {
+ i = wCmd - IDM_WINDOW_POS_0;
- term_getsize(td);
+ if ((i < 0) || (i >= MAX_TERM_DATA)) break;
- term_window_resize(td);
+ td = &data[i];
- break;
+ if (!td->posfix && td->visible)
+ {
+ td->posfix = TRUE;
+ term_window_pos(td, HWND_TOPMOST);
}
-
- /* Increase Tile Width */
- case IDM_WINDOW_I_WID_0:
- case IDM_WINDOW_I_WID_1:
- case IDM_WINDOW_I_WID_2:
- case IDM_WINDOW_I_WID_3:
- case IDM_WINDOW_I_WID_4:
- case IDM_WINDOW_I_WID_5:
- case IDM_WINDOW_I_WID_6:
- case IDM_WINDOW_I_WID_7:
+ else
{
- i = wCmd - IDM_WINDOW_I_WID_0;
+ td->posfix = FALSE;
+ term_window_pos(td, data[0].w);
+ }
- if ((i < 0) || (i >= MAX_TERM_DATA)) break;
+ break;
+ }
- td = &data[i];
+ /* Bizarre Display */
+ case IDM_WINDOW_BIZ_0:
+ case IDM_WINDOW_BIZ_1:
+ case IDM_WINDOW_BIZ_2:
+ case IDM_WINDOW_BIZ_3:
+ case IDM_WINDOW_BIZ_4:
+ case IDM_WINDOW_BIZ_5:
+ case IDM_WINDOW_BIZ_6:
+ case IDM_WINDOW_BIZ_7:
+ {
+ i = wCmd - IDM_WINDOW_BIZ_0;
- td->tile_wid += 1;
+ if ((i < 0) || (i >= MAX_TERM_DATA)) break;
- term_getsize(td);
+ td = &data[i];
- term_window_resize(td);
+ td->bizarre = !td->bizarre;
- break;
- }
+ term_getsize(td);
- /* Decrease Tile Height */
- case IDM_WINDOW_D_WID_0:
- case IDM_WINDOW_D_WID_1:
- case IDM_WINDOW_D_WID_2:
- case IDM_WINDOW_D_WID_3:
- case IDM_WINDOW_D_WID_4:
- case IDM_WINDOW_D_WID_5:
- case IDM_WINDOW_D_WID_6:
- case IDM_WINDOW_D_WID_7:
- {
- i = wCmd - IDM_WINDOW_D_WID_0;
+ term_window_resize(td);
- if ((i < 0) || (i >= MAX_TERM_DATA)) break;
+ break;
+ }
- td = &data[i];
+ /* Increase Tile Width */
+ case IDM_WINDOW_I_WID_0:
+ case IDM_WINDOW_I_WID_1:
+ case IDM_WINDOW_I_WID_2:
+ case IDM_WINDOW_I_WID_3:
+ case IDM_WINDOW_I_WID_4:
+ case IDM_WINDOW_I_WID_5:
+ case IDM_WINDOW_I_WID_6:
+ case IDM_WINDOW_I_WID_7:
+ {
+ i = wCmd - IDM_WINDOW_I_WID_0;
- td->tile_wid -= 1;
+ if ((i < 0) || (i >= MAX_TERM_DATA)) break;
- term_getsize(td);
+ td = &data[i];
- term_window_resize(td);
+ td->tile_wid += 1;
- break;
- }
+ term_getsize(td);
- /* Increase Tile Height */
- case IDM_WINDOW_I_HGT_0:
- case IDM_WINDOW_I_HGT_1:
- case IDM_WINDOW_I_HGT_2:
- case IDM_WINDOW_I_HGT_3:
- case IDM_WINDOW_I_HGT_4:
- case IDM_WINDOW_I_HGT_5:
- case IDM_WINDOW_I_HGT_6:
- case IDM_WINDOW_I_HGT_7:
- {
- i = wCmd - IDM_WINDOW_I_HGT_0;
+ term_window_resize(td);
- if ((i < 0) || (i >= MAX_TERM_DATA)) break;
+ break;
+ }
- td = &data[i];
+ /* Decrease Tile Height */
+ case IDM_WINDOW_D_WID_0:
+ case IDM_WINDOW_D_WID_1:
+ case IDM_WINDOW_D_WID_2:
+ case IDM_WINDOW_D_WID_3:
+ case IDM_WINDOW_D_WID_4:
+ case IDM_WINDOW_D_WID_5:
+ case IDM_WINDOW_D_WID_6:
+ case IDM_WINDOW_D_WID_7:
+ {
+ i = wCmd - IDM_WINDOW_D_WID_0;
- td->tile_hgt += 1;
+ if ((i < 0) || (i >= MAX_TERM_DATA)) break;
- term_getsize(td);
+ td = &data[i];
- term_window_resize(td);
+ td->tile_wid -= 1;
- break;
- }
+ term_getsize(td);
- /* Decrease Tile Height */
- case IDM_WINDOW_D_HGT_0:
- case IDM_WINDOW_D_HGT_1:
- case IDM_WINDOW_D_HGT_2:
- case IDM_WINDOW_D_HGT_3:
- case IDM_WINDOW_D_HGT_4:
- case IDM_WINDOW_D_HGT_5:
- case IDM_WINDOW_D_HGT_6:
- case IDM_WINDOW_D_HGT_7:
- {
- i = wCmd - IDM_WINDOW_D_HGT_0;
+ term_window_resize(td);
- if ((i < 0) || (i >= MAX_TERM_DATA)) break;
+ break;
+ }
- td = &data[i];
+ /* Increase Tile Height */
+ case IDM_WINDOW_I_HGT_0:
+ case IDM_WINDOW_I_HGT_1:
+ case IDM_WINDOW_I_HGT_2:
+ case IDM_WINDOW_I_HGT_3:
+ case IDM_WINDOW_I_HGT_4:
+ case IDM_WINDOW_I_HGT_5:
+ case IDM_WINDOW_I_HGT_6:
+ case IDM_WINDOW_I_HGT_7:
+ {
+ i = wCmd - IDM_WINDOW_I_HGT_0;
- td->tile_hgt -= 1;
+ if ((i < 0) || (i >= MAX_TERM_DATA)) break;
- term_getsize(td);
+ td = &data[i];
- term_window_resize(td);
+ td->tile_hgt += 1;
- break;
- }
+ term_getsize(td);
- case IDM_OPTIONS_NO_GRAPHICS:
- {
- if (!inkey_flag)
- {
- plog("You may not do that right now.");
- break;
- }
+ term_window_resize(td);
- if (arg_graphics != GRAPHICS_NONE)
- {
- arg_graphics = GRAPHICS_NONE;
- Term_xtra_win_react();
- Term_key_push(KTRL('R'));
- }
+ break;
+ }
- break;
- }
+ /* Decrease Tile Height */
+ case IDM_WINDOW_D_HGT_0:
+ case IDM_WINDOW_D_HGT_1:
+ case IDM_WINDOW_D_HGT_2:
+ case IDM_WINDOW_D_HGT_3:
+ case IDM_WINDOW_D_HGT_4:
+ case IDM_WINDOW_D_HGT_5:
+ case IDM_WINDOW_D_HGT_6:
+ case IDM_WINDOW_D_HGT_7:
+ {
+ i = wCmd - IDM_WINDOW_D_HGT_0;
- case IDM_OPTIONS_OLD_GRAPHICS:
- {
- if (!inkey_flag)
- {
- plog("You may not do that right now.");
- break;
- }
+ if ((i < 0) || (i >= MAX_TERM_DATA)) break;
- if (arg_graphics != GRAPHICS_ORIGINAL)
- {
- arg_graphics = GRAPHICS_ORIGINAL;
- Term_xtra_win_react();
- Term_key_push(KTRL('R'));
- }
+ td = &data[i];
- break;
- }
+ td->tile_hgt -= 1;
- case IDM_OPTIONS_NEW_GRAPHICS:
- {
- if (!inkey_flag)
- {
- plog("You may not do that right now.");
- break;
- }
+ term_getsize(td);
- if (arg_graphics != GRAPHICS_ADAM_BOLT)
- {
- arg_graphics = GRAPHICS_ADAM_BOLT;
- Term_xtra_win_react();
- Term_key_push(KTRL('R'));
- }
+ term_window_resize(td);
+ break;
+ }
+
+ case IDM_OPTIONS_NO_GRAPHICS:
+ {
+ if (!inkey_flag)
+ {
+ plog("You may not do that right now.");
break;
}
- case IDM_OPTIONS_NEW2_GRAPHICS:
+ if (arg_graphics != GRAPHICS_NONE)
{
- if (!inkey_flag)
- {
- plog("You may not do that right now.");
- break;
- }
+ arg_graphics = GRAPHICS_NONE;
+ Term_xtra_win_react();
+ Term_key_push(KTRL('R'));
+ }
- if (arg_graphics != GRAPHICS_HENGBAND)
- {
- arg_graphics = GRAPHICS_HENGBAND;
- Term_xtra_win_react();
- Term_key_push(KTRL('R'));
- }
+ break;
+ }
+ case IDM_OPTIONS_OLD_GRAPHICS:
+ {
+ if (!inkey_flag)
+ {
+ plog("You may not do that right now.");
break;
}
- case IDM_OPTIONS_BIGTILE:
+ if (arg_graphics != GRAPHICS_ORIGINAL)
{
- td = &data[0];
- if (!inkey_flag)
- {
- plog("You may not do that right now.");
- break;
- }
+ arg_graphics = GRAPHICS_ORIGINAL;
+ Term_xtra_win_react();
+ Term_key_push(KTRL('R'));
+ }
- arg_bigtile = !arg_bigtile;
- Term_activate(&td->t);
- Term_resize(td->cols, td->rows);
- InvalidateRect(td->w, NULL, TRUE);
+ break;
+ }
+
+ case IDM_OPTIONS_NEW_GRAPHICS:
+ {
+ if (!inkey_flag)
+ {
+ plog("You may not do that right now.");
break;
}
- case IDM_OPTIONS_MUSIC:
+ if (arg_graphics != GRAPHICS_ADAM_BOLT)
{
- if (!inkey_flag)
- {
- plog("You may not do that right now.");
- break;
- }
-
- arg_music = !arg_music;
+ arg_graphics = GRAPHICS_ADAM_BOLT;
Term_xtra_win_react();
Term_key_push(KTRL('R'));
- break;
}
- case IDM_OPTIONS_SOUND:
+ break;
+ }
+
+ case IDM_OPTIONS_NEW2_GRAPHICS:
+ {
+ if (!inkey_flag)
{
- if (!inkey_flag)
- {
- plog("You may not do that right now.");
- break;
- }
+ plog("You may not do that right now.");
+ break;
+ }
- arg_sound = !arg_sound;
+ if (arg_graphics != GRAPHICS_HENGBAND)
+ {
+ arg_graphics = GRAPHICS_HENGBAND;
Term_xtra_win_react();
Term_key_push(KTRL('R'));
- break;
}
- /* bg */
- case IDM_OPTIONS_BG:
+ break;
+ }
+
+ case IDM_OPTIONS_BIGTILE:
+ {
+ td = &data[0];
+ if (!inkey_flag)
{
- if (!inkey_flag)
- {
- plog("You may not do that right now.");
- break;
- }
+ plog("You may not do that right now.");
+ break;
+ }
- use_bg = !use_bg;
- init_bg();
- Term_xtra_win_react();
- Term_key_push(KTRL('R'));
+ arg_bigtile = !arg_bigtile;
+ Term_activate(&td->t);
+ Term_resize(td->cols, td->rows);
+ InvalidateRect(td->w, NULL, TRUE);
+ break;
+ }
+
+ case IDM_OPTIONS_MUSIC:
+ {
+ if (!inkey_flag)
+ {
+ plog("You may not do that right now.");
break;
}
- /* bg */
- case IDM_OPTIONS_OPEN_BG:
+ arg_music = !arg_music;
+ Term_xtra_win_react();
+ Term_key_push(KTRL('R'));
+ break;
+ }
+
+ case IDM_OPTIONS_SOUND:
+ {
+ if (!inkey_flag)
{
- if (!inkey_flag)
- {
- plog("You may not do that right now.");
- break;
- }
- else
- {
- memset(&ofn, 0, sizeof(ofn));
- ofn.lStructSize = sizeof(ofn);
- ofn.hwndOwner = data[0].w;
- ofn.lpstrFilter = "Bitmap Files (*.bmp)\0*.bmp\0";
- ofn.nFilterIndex = 1;
- ofn.lpstrFile = bg_bitmap_file;
- ofn.nMaxFile = 1023;
- ofn.lpstrInitialDir = NULL;
- ofn.lpstrTitle = _("壁紙を選んでね。", "Choose wall paper.");
- ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
-
- if (GetOpenFileName(&ofn))
- {
- /* Load 'savefile' */
- use_bg = 1;
- init_bg();
- }
+ plog("You may not do that right now.");
+ break;
+ }
- /* React to changes */
- Term_xtra_win_react();
+ arg_sound = !arg_sound;
+ Term_xtra_win_react();
+ Term_key_push(KTRL('R'));
+ break;
+ }
- /* Hack -- Force redraw */
- Term_key_push(KTRL('R'));
- }
+ /* bg */
+ case IDM_OPTIONS_BG:
+ {
+ if (!inkey_flag)
+ {
+ plog("You may not do that right now.");
break;
}
- case IDM_DUMP_SCREEN_HTML:
+ use_bg = !use_bg;
+ init_bg();
+ Term_xtra_win_react();
+ Term_key_push(KTRL('R'));
+ break;
+ }
+
+ /* bg */
+ case IDM_OPTIONS_OPEN_BG:
+ {
+ if (!inkey_flag)
+ {
+ plog("You may not do that right now.");
+ break;
+ }
+ else
{
- static char buf[1024] = "";
memset(&ofn, 0, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = data[0].w;
- ofn.lpstrFilter = "HTML Files (*.html)\0*.html\0";
+ ofn.lpstrFilter = "Bitmap Files (*.bmp)\0*.bmp\0";
ofn.nFilterIndex = 1;
- ofn.lpstrFile = buf;
+ ofn.lpstrFile = bg_bitmap_file;
ofn.nMaxFile = 1023;
- ofn.lpstrDefExt = "html";
ofn.lpstrInitialDir = NULL;
- ofn.lpstrTitle = _("HTMLでスクリーンダンプを保存", "Save screen dump as HTML.");
- ofn.Flags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT;
+ ofn.lpstrTitle = _("壁紙を選んでね。", "Choose wall paper.");
+ ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
- if (GetSaveFileName(&ofn))
+ if (GetOpenFileName(&ofn))
{
- do_cmd_save_screen_html_aux(buf, 0);
+ /* Load 'savefile' */
+ use_bg = 1;
+ init_bg();
}
- break;
+
+ /* React to changes */
+ Term_xtra_win_react();
+
+ /* Hack -- Force redraw */
+ Term_key_push(KTRL('R'));
+ }
+ break;
+ }
+
+ case IDM_DUMP_SCREEN_HTML:
+ {
+ static char buf[1024] = "";
+ memset(&ofn, 0, sizeof(ofn));
+ ofn.lStructSize = sizeof(ofn);
+ ofn.hwndOwner = data[0].w;
+ ofn.lpstrFilter = "HTML Files (*.html)\0*.html\0";
+ ofn.nFilterIndex = 1;
+ ofn.lpstrFile = buf;
+ ofn.nMaxFile = 1023;
+ ofn.lpstrDefExt = "html";
+ ofn.lpstrInitialDir = NULL;
+ ofn.lpstrTitle = _("HTMLでスクリーンダンプを保存", "Save screen dump as HTML.");
+ ofn.Flags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT;
+
+ if (GetSaveFileName(&ofn))
+ {
+ do_cmd_save_screen_html_aux(buf, 0);
}
+ break;
+ }
#ifdef USE_SAVER
- case IDM_OPTIONS_SAVER:
+ case IDM_OPTIONS_SAVER:
+ {
+ if (hwndSaver)
{
+ DestroyWindow(hwndSaver);
+ hwndSaver = NULL;
+ }
+ else
+ {
+ /* Create a screen scaver window */
+ hwndSaver = CreateWindowEx(WS_EX_TOPMOST, "WindowsScreenSaverClass",
+ "Angband Screensaver",
+ WS_POPUP | WS_MAXIMIZE | WS_VISIBLE,
+ 0, 0, GetSystemMetrics(SM_CXSCREEN),
+ GetSystemMetrics(SM_CYSCREEN),
+ NULL, NULL, hInstance, NULL);
+
if (hwndSaver)
{
- DestroyWindow(hwndSaver);
- hwndSaver = NULL;
+ /* Push the window to the bottom */
+ SetWindowPos(hwndSaver, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
}
else
{
- /* Create a screen scaver window */
- hwndSaver = CreateWindowEx(WS_EX_TOPMOST, "WindowsScreenSaverClass",
- "Angband Screensaver",
- WS_POPUP | WS_MAXIMIZE | WS_VISIBLE,
- 0, 0, GetSystemMetrics(SM_CXSCREEN),
- GetSystemMetrics(SM_CYSCREEN),
- NULL, NULL, hInstance, NULL);
-
- if (hwndSaver)
- {
- /* Push the window to the bottom */
- SetWindowPos(hwndSaver, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
- }
- else
- {
- plog(_("ウィンドウを作成出来ません", "Failed to create saver window"));
- }
+ plog(_("ウィンドウを作成出来ません", "Failed to create saver window"));
}
- break;
}
+ break;
+ }
#endif
- case IDM_OPTIONS_MAP:
+ case IDM_OPTIONS_MAP:
+ {
+ windows_map();
+ break;
+ }
+
+ case IDM_HELP_CONTENTS:
+ {
+#ifdef HTML_HELP
+ char tmp[1024];
+ path_build(tmp, sizeof(tmp), ANGBAND_DIR_XTRA_HELP, "zangband.chm");
+ if (check_file(tmp))
{
- windows_map();
- break;
+ HtmlHelp(data[0].w, tmp, HH_DISPLAY_TOPIC, 0);
}
-
- case IDM_HELP_CONTENTS:
+ else
{
-#ifdef HTML_HELP
- char tmp[1024];
- path_build(tmp, sizeof(tmp), ANGBAND_DIR_XTRA_HELP, "zangband.chm");
- if (check_file(tmp))
- {
- HtmlHelp(data[0].w, tmp, HH_DISPLAY_TOPIC, 0);
- }
- else
- {
- plog_fmt(_("ヘルプファイル[%s]が見付かりません。", "Cannot find help file: %s"), tmp);
- plog(_("代わりにオンラインヘルプを使用してください。", "Use the online help files instead."));
- }
- break;
+ plog_fmt(_("ヘルプファイル[%s]が見付かりません。", "Cannot find help file: %s"), tmp);
+ plog(_("代わりにオンラインヘルプを使用してください。", "Use the online help files instead."));
+ }
+ break;
#else /* HTML_HELP */
- char buf[1024];
- char tmp[1024];
- path_build(tmp, sizeof(tmp), ANGBAND_DIR_XTRA_HELP, "zangband.hlp");
- if (check_file(tmp))
- {
- sprintf(buf, "winhelp.exe %s", tmp);
- WinExec(buf, SW_NORMAL);
- }
- else
- {
- plog_fmt(_("ヘルプファイル[%s]が見付かりません。", "Cannot find help file: %s"), tmp);
- plog(_("代わりにオンラインヘルプを使用してください。", "Use the online help files instead."));
+ char buf[1024];
+ char tmp[1024];
+ path_build(tmp, sizeof(tmp), ANGBAND_DIR_XTRA_HELP, "zangband.hlp");
+ if (check_file(tmp))
+ {
+ sprintf(buf, "winhelp.exe %s", tmp);
+ WinExec(buf, SW_NORMAL);
+ }
+ else
+ {
+ plog_fmt(_("ヘルプファイル[%s]が見付かりません。", "Cannot find help file: %s"), tmp);
+ plog(_("代わりにオンラインヘルプを使用してください。", "Use the online help files instead."));
- }
- break;
-#endif /* HTML_HELP */
}
+ break;
+#endif /* HTML_HELP */
+ }
}
}
/* Extract the modifiers */
if (GetKeyState(VK_CONTROL) & 0x8000) mc = TRUE;
- if (GetKeyState(VK_SHIFT) & 0x8000) ms = TRUE;
- if (GetKeyState(VK_MENU) & 0x8000) ma = TRUE;
+ if (GetKeyState(VK_SHIFT) & 0x8000) ms = TRUE;
+ if (GetKeyState(VK_MENU) & 0x8000) ma = TRUE;
Term_no_press = (ma) ? TRUE : FALSE;
/* Handle "special" keys */
- if (special_key[(byte)(wParam)] || (ma && !ignore_key[(byte)(wParam)]) )
+ if (special_key[(byte)(wParam)] || (ma && !ignore_key[(byte)(wParam)]))
{
bool ext_key = (lParam & 0x1000000L) ? TRUE : FALSE;
bool numpad = FALSE;
if (numpad) Term_keypress('K');
/* Encode the hexidecimal scan code */
- Term_keypress(hexsym[i/16]);
- Term_keypress(hexsym[i%16]);
+ Term_keypress(hexsym[i / 16]);
+ Term_keypress(hexsym[i % 16]);
/* End the macro trigger */
Term_keypress(13);
#ifdef __MWERKS__
LRESULT FAR PASCAL AngbandWndProc(HWND hWnd, UINT uMsg,
- WPARAM wParam, LPARAM lParam);
+ WPARAM wParam, LPARAM lParam);
LRESULT FAR PASCAL AngbandWndProc(HWND hWnd, UINT uMsg,
- WPARAM wParam, LPARAM lParam)
+ WPARAM wParam, LPARAM lParam)
#else /* __MWERKS__ */
LRESULT FAR PASCAL AngbandWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
#endif /* __MWERKS__ */
/* Handle message */
switch (uMsg)
{
- case WM_NCCREATE:
- {
- SetWindowLong(hWnd, 0, (LONG)(my_td));
- break;
- }
+ case WM_NCCREATE:
+ {
+ SetWindowLong(hWnd, 0, (LONG)(my_td));
+ break;
+ }
- case WM_CREATE:
- {
+ case WM_CREATE:
+ {
#ifdef USE_MUSIC
- mop.dwCallback=(DWORD)hWnd;
+ mop.dwCallback = (DWORD)hWnd;
#endif
- return 0;
- }
+ return 0;
+ }
- case WM_GETMINMAXINFO:
- {
- MINMAXINFO FAR *lpmmi;
- RECT rc;
+ case WM_GETMINMAXINFO:
+ {
+ MINMAXINFO FAR *lpmmi;
+ RECT rc;
- lpmmi = (MINMAXINFO FAR *)lParam;
+ lpmmi = (MINMAXINFO FAR *)lParam;
- /* this message was sent before WM_NCCREATE */
- if (!td) return 1;
+ /* this message was sent before WM_NCCREATE */
+ if (!td) return 1;
- /* Minimum window size is 80x24 */
- rc.left = rc.top = 0;
- rc.right = rc.left + 80 * td->tile_wid + td->size_ow1 + td->size_ow2;
- rc.bottom = rc.top + 24 * td->tile_hgt + td->size_oh1 + td->size_oh2 + 1;
+ /* Minimum window size is 80x24 */
+ rc.left = rc.top = 0;
+ rc.right = rc.left + 80 * td->tile_wid + td->size_ow1 + td->size_ow2;
+ rc.bottom = rc.top + 24 * td->tile_hgt + td->size_oh1 + td->size_oh2 + 1;
- /* Adjust */
- AdjustWindowRectEx(&rc, td->dwStyle, TRUE, td->dwExStyle);
+ /* Adjust */
+ AdjustWindowRectEx(&rc, td->dwStyle, TRUE, td->dwExStyle);
- /* Save minimum size */
- lpmmi->ptMinTrackSize.x = rc.right - rc.left;
- lpmmi->ptMinTrackSize.y = rc.bottom - rc.top;
+ /* Save minimum size */
+ lpmmi->ptMinTrackSize.x = rc.right - rc.left;
+ lpmmi->ptMinTrackSize.y = rc.bottom - rc.top;
- return 0;
- }
+ return 0;
+ }
- case WM_PAINT:
- {
- BeginPaint(hWnd, &ps);
- if (td) term_data_redraw(td);
- EndPaint(hWnd, &ps);
- ValidateRect(hWnd, NULL);
- return 0;
- }
+ case WM_PAINT:
+ {
+ BeginPaint(hWnd, &ps);
+ if (td) term_data_redraw(td);
+ EndPaint(hWnd, &ps);
+ ValidateRect(hWnd, NULL);
+ return 0;
+ }
#ifdef USE_MUSIC
- case MM_MCINOTIFY:
+ case MM_MCINOTIFY:
+ {
+ if (wParam == MCI_NOTIFY_SUCCESSFUL)
{
- if(wParam == MCI_NOTIFY_SUCCESSFUL)
- {
- mciSendCommand(mop.wDeviceID, MCI_SEEK, MCI_SEEK_TO_START, 0);
- mciSendCommand(mop.wDeviceID, MCI_PLAY, MCI_NOTIFY, (DWORD)&mop);
- }
- return 0;
+ mciSendCommand(mop.wDeviceID, MCI_SEEK, MCI_SEEK_TO_START, 0);
+ mciSendCommand(mop.wDeviceID, MCI_PLAY, MCI_NOTIFY, (DWORD)&mop);
}
+ return 0;
+ }
#endif
- case WM_SYSKEYDOWN:
- case WM_KEYDOWN:
- {
- if (process_keydown(wParam, lParam))
- return 0;
- break;
- }
-
- case WM_CHAR:
- {
- if (Term_no_press) Term_no_press = FALSE;
- else Term_keypress(wParam);
+ case WM_SYSKEYDOWN:
+ case WM_KEYDOWN:
+ {
+ if (process_keydown(wParam, lParam))
return 0;
- }
+ break;
+ }
- case WM_LBUTTONDOWN:
- {
- mousex = MIN(LOWORD(lParam) / td->tile_wid, td->cols - 1);
- mousey = MIN(HIWORD(lParam) / td->tile_hgt, td->rows - 1);
- mouse_down = TRUE;
- oldx = mousex;
- oldy = mousey;
- return 0;
- }
+ case WM_CHAR:
+ {
+ if (Term_no_press) Term_no_press = FALSE;
+ else Term_keypress(wParam);
+ return 0;
+ }
- case WM_LBUTTONUP:
- {
- HGLOBAL hGlobal;
- LPSTR lpStr;
- int j, sz;
- TERM_LEN dx = abs(oldx - mousex) + 1;
- TERM_LEN dy = abs(oldy - mousey) + 1;
- TERM_LEN ox = (oldx > mousex) ? mousex : oldx;
- TERM_LEN oy = (oldy > mousey) ? mousey : oldy;
+ case WM_LBUTTONDOWN:
+ {
+ mousex = MIN(LOWORD(lParam) / td->tile_wid, td->cols - 1);
+ mousey = MIN(HIWORD(lParam) / td->tile_hgt, td->rows - 1);
+ mouse_down = TRUE;
+ oldx = mousex;
+ oldy = mousey;
+ return 0;
+ }
- mouse_down = FALSE;
- paint_rect = FALSE;
+ case WM_LBUTTONUP:
+ {
+ HGLOBAL hGlobal;
+ LPSTR lpStr;
+ int j, sz;
+ TERM_LEN dx = abs(oldx - mousex) + 1;
+ TERM_LEN dy = abs(oldy - mousey) + 1;
+ TERM_LEN ox = (oldx > mousex) ? mousex : oldx;
+ TERM_LEN oy = (oldy > mousey) ? mousey : oldy;
+
+ mouse_down = FALSE;
+ paint_rect = FALSE;
#ifdef JP
- sz = (dx + 3) * dy;
+ sz = (dx + 3) * dy;
#else
- sz = (dx + 2) * dy;
+ sz = (dx + 2) * dy;
#endif
- hGlobal = GlobalAlloc(GHND, sz + 1);
- if (hGlobal == NULL) return 0;
- lpStr = (LPSTR)GlobalLock(hGlobal);
+ hGlobal = GlobalAlloc(GHND, sz + 1);
+ if (hGlobal == NULL) return 0;
+ lpStr = (LPSTR)GlobalLock(hGlobal);
- for (i = 0; i < dy; i++)
- {
+ for (i = 0; i < dy; i++)
+ {
#ifdef JP
- char *s;
- char **scr = data[0].t.scr->c;
+ char *s;
+ char **scr = data[0].t.scr->c;
- C_MAKE(s, (dx + 1), char);
- strncpy(s, &scr[oy + i][ox], dx);
+ C_MAKE(s, (dx + 1), char);
+ strncpy(s, &scr[oy + i][ox], dx);
- if (ox > 0)
- {
- if (iskanji(scr[oy + i][ox - 1])) s[0] = ' ';
- }
+ if (ox > 0)
+ {
+ if (iskanji(scr[oy + i][ox - 1])) s[0] = ' ';
+ }
- if (ox + dx < data[0].cols)
- {
- if (iskanji(scr[oy + i][ox + dx - 1])) s[dx - 1] = ' ';
- }
+ if (ox + dx < data[0].cols)
+ {
+ if (iskanji(scr[oy + i][ox + dx - 1])) s[dx - 1] = ' ';
+ }
- for (j = 0; j < dx; j++)
- {
- if (s[j] == 127) s[j] = '#';
- *lpStr++ = s[j];
- }
+ for (j = 0; j < dx; j++)
+ {
+ if (s[j] == 127) s[j] = '#';
+ *lpStr++ = s[j];
+ }
#else
- for (j = 0; j < dx; j++)
- {
- *lpStr++ = data[0].t.scr->c[oy + i][ox + j];
- }
-#endif
- if (dy > 1)
- {
- *lpStr++ = '\r';
- *lpStr++ = '\n';
- }
+ for (j = 0; j < dx; j++)
+ {
+ *lpStr++ = data[0].t.scr->c[oy + i][ox + j];
}
-
- GlobalUnlock(hGlobal);
- if (OpenClipboard(hWnd) == 0)
+#endif
+ if (dy > 1)
{
- GlobalFree(hGlobal);
- return 0;
+ *lpStr++ = '\r';
+ *lpStr++ = '\n';
}
- EmptyClipboard();
- SetClipboardData(CF_TEXT, hGlobal);
- CloseClipboard();
-
- Term_redraw();
+ }
+ GlobalUnlock(hGlobal);
+ if (OpenClipboard(hWnd) == 0)
+ {
+ GlobalFree(hGlobal);
return 0;
}
+ EmptyClipboard();
+ SetClipboardData(CF_TEXT, hGlobal);
+ CloseClipboard();
- case WM_MOUSEMOVE:
+ Term_redraw();
+
+ return 0;
+ }
+
+ case WM_MOUSEMOVE:
+ {
+ if (mouse_down)
{
- if (mouse_down)
- {
- int dx, dy;
- int cx = MIN(LOWORD(lParam) / td->tile_wid, td->cols - 1);
- int cy = MIN(HIWORD(lParam) / td->tile_hgt, td->rows - 1);
- int ox, oy;
+ int dx, dy;
+ int cx = MIN(LOWORD(lParam) / td->tile_wid, td->cols - 1);
+ int cy = MIN(HIWORD(lParam) / td->tile_hgt, td->rows - 1);
+ int ox, oy;
- if (paint_rect)
- {
- dx = abs(oldx - mousex) + 1;
- dy = abs(oldy - mousey) + 1;
- ox = (oldx > mousex) ? mousex : oldx;
- oy = (oldy > mousey) ? mousey : oldy;
- Term_inversed_area(hWnd, ox, oy, dx, dy);
- }
- else
- {
- paint_rect = TRUE;
- }
+ if (paint_rect)
+ {
+ dx = abs(oldx - mousex) + 1;
+ dy = abs(oldy - mousey) + 1;
+ ox = (oldx > mousex) ? mousex : oldx;
+ oy = (oldy > mousey) ? mousey : oldy;
+ Term_inversed_area(hWnd, ox, oy, dx, dy);
+ }
+ else
+ {
+ paint_rect = TRUE;
+ }
- dx = abs(cx - mousex) + 1;
- dy = abs(cy - mousey) + 1;
- ox = (cx > mousex) ? mousex : cx;
- oy = (cy > mousey) ? mousey : cy;
- Term_inversed_area(hWnd, ox, oy, dx, dy);
+ dx = abs(cx - mousex) + 1;
+ dy = abs(cy - mousey) + 1;
+ ox = (cx > mousex) ? mousex : cx;
+ oy = (cy > mousey) ? mousey : cy;
+ Term_inversed_area(hWnd, ox, oy, dx, dy);
- oldx = cx;
- oldy = cy;
- }
- return 0;
+ oldx = cx;
+ oldy = cy;
}
+ return 0;
+ }
- case WM_INITMENU:
- {
- setup_menus();
- return 0;
- }
+ case WM_INITMENU:
+ {
+ setup_menus();
+ return 0;
+ }
- case WM_CLOSE:
+ case WM_CLOSE:
+ {
+ if (game_in_progress && current_world_ptr->character_generated)
{
- if (game_in_progress && current_world_ptr->character_generated)
+ if (!can_save)
{
- if (!can_save)
- {
- plog(_("今は終了できません。", "You may not do that right now."));
- return 0;
- }
+ plog(_("今は終了できません。", "You may not do that right now."));
+ return 0;
+ }
- /* Hack -- Forget messages */
- msg_flag = FALSE;
+ /* Hack -- Forget messages */
+ msg_flag = FALSE;
- forget_lite(p_ptr->current_floor_ptr);
- forget_view(p_ptr->current_floor_ptr);
- clear_mon_lite(p_ptr->current_floor_ptr);
+ forget_lite(p_ptr->current_floor_ptr);
+ forget_view(p_ptr->current_floor_ptr);
+ clear_mon_lite(p_ptr->current_floor_ptr);
- /* Save the game */
+ /* Save the game */
#ifdef ZANGBAND
/* do_cmd_save_game(FALSE); */
#else /* ZANGBAND */
/* do_cmd_save_game(); */
#endif /* ZANGBAND */
- Term_key_push(SPECIAL_KEY_QUIT);
- return 0;
- }
- quit(NULL);
+ Term_key_push(SPECIAL_KEY_QUIT);
return 0;
}
+ quit(NULL);
+ return 0;
+ }
- case WM_QUERYENDSESSION:
+ case WM_QUERYENDSESSION:
+ {
+ if (game_in_progress && current_world_ptr->character_generated)
{
- if (game_in_progress && current_world_ptr->character_generated)
- {
- /* Hack -- Forget messages */
- msg_flag = FALSE;
+ /* Hack -- Forget messages */
+ msg_flag = FALSE;
- /* Mega-Hack -- Delay death */
- if (p_ptr->chp < 0) p_ptr->is_dead = FALSE;
- exe_write_diary(p_ptr, NIKKI_GAMESTART, 0, _("----ゲーム中断----", "---- Save and Exit Game ----"));
+ /* Mega-Hack -- Delay death */
+ if (p_ptr->chp < 0) p_ptr->is_dead = FALSE;
+ exe_write_diary(p_ptr, NIKKI_GAMESTART, 0, _("----ゲーム中断----", "---- Save and Exit Game ----"));
- /* Hardcode panic save */
- p_ptr->panic_save = 1;
+ /* Hardcode panic save */
+ p_ptr->panic_save = 1;
- /* Forbid suspend */
- signals_ignore_tstp();
+ /* Forbid suspend */
+ signals_ignore_tstp();
- /* Indicate panic save */
- (void)strcpy(p_ptr->died_from, _("(緊急セーブ)", "(panic save)"));
+ /* Indicate panic save */
+ (void)strcpy(p_ptr->died_from, _("(緊急セーブ)", "(panic save)"));
- /* Panic save */
- (void)save_player(p_ptr);
- }
- quit(NULL);
- return 0;
+ /* Panic save */
+ (void)save_player(p_ptr);
}
+ quit(NULL);
+ return 0;
+ }
+
+ case WM_QUIT:
+ {
+ quit(NULL);
+ return 0;
+ }
- case WM_QUIT:
+ case WM_COMMAND:
+ {
+ process_menus(LOWORD(wParam));
+ return 0;
+ }
+
+ case WM_SIZE:
+ {
+ /* this message was sent before WM_NCCREATE */
+ if (!td) return 1;
+
+ /* it was sent from inside CreateWindowEx */
+ if (!td->w) return 1;
+
+ /* was sent from WM_SIZE */
+ if (td->size_hack) return 1;
+
+ switch (wParam)
{
- quit(NULL);
+ case SIZE_MINIMIZED:
+ {
+ /* Hide sub-windows */
+ for (i = 1; i < MAX_TERM_DATA; i++)
+ {
+ if (data[i].visible) ShowWindow(data[i].w, SW_HIDE);
+ }
return 0;
}
- case WM_COMMAND:
+ case SIZE_MAXIMIZED:
{
- process_menus(LOWORD(wParam));
- return 0;
+ /* fall through */
}
- case WM_SIZE:
+ case SIZE_RESTORED:
{
- /* this message was sent before WM_NCCREATE */
- if (!td) return 1;
-
- /* it was sent from inside CreateWindowEx */
- if (!td->w) return 1;
+ TERM_LEN cols = (LOWORD(lParam) - td->size_ow1) / td->tile_wid;
+ TERM_LEN rows = (HIWORD(lParam) - td->size_oh1) / td->tile_hgt;
- /* was sent from WM_SIZE */
- if (td->size_hack) return 1;
-
- switch (wParam)
+ /* New size */
+ if ((td->cols != cols) || (td->rows != rows))
{
- case SIZE_MINIMIZED:
- {
- /* Hide sub-windows */
- for (i = 1; i < MAX_TERM_DATA; i++)
- {
- if (data[i].visible) ShowWindow(data[i].w, SW_HIDE);
- }
- return 0;
- }
+ /* Save the new size */
+ td->cols = cols;
+ td->rows = rows;
- case SIZE_MAXIMIZED:
+ if (!IsZoomed(td->w) && !IsIconic(td->w))
{
- /* fall through */
+ normsize.x = td->cols;
+ normsize.y = td->rows;
}
- case SIZE_RESTORED:
- {
- TERM_LEN cols = (LOWORD(lParam) - td->size_ow1) / td->tile_wid;
- TERM_LEN rows = (HIWORD(lParam) - td->size_oh1) / td->tile_hgt;
-
- /* New size */
- if ((td->cols != cols) || (td->rows != rows))
- {
- /* Save the new size */
- td->cols = cols;
- td->rows = rows;
-
- if (!IsZoomed(td->w) && !IsIconic(td->w))
- {
- normsize.x = td->cols;
- normsize.y = td->rows;
- }
-
- /* Activate */
- Term_activate(&td->t);
+ /* Activate */
+ Term_activate(&td->t);
- /* Resize the term */
- Term_resize(td->cols, td->rows);
+ /* Resize the term */
+ Term_resize(td->cols, td->rows);
- /* Redraw later */
- InvalidateRect(td->w, NULL, TRUE);
- }
+ /* Redraw later */
+ InvalidateRect(td->w, NULL, TRUE);
+ }
- td->size_hack = TRUE;
+ td->size_hack = TRUE;
- /* Show sub-windows */
- for (i = 1; i < MAX_TERM_DATA; i++)
- {
- if (data[i].visible) ShowWindow(data[i].w, SW_SHOW);
- }
+ /* Show sub-windows */
+ for (i = 1; i < MAX_TERM_DATA; i++)
+ {
+ if (data[i].visible) ShowWindow(data[i].w, SW_SHOW);
+ }
- td->size_hack = FALSE;
+ td->size_hack = FALSE;
- return 0;
- }
- }
- break;
+ return 0;
}
+ }
+ break;
+ }
- case WM_PALETTECHANGED:
- {
- /* Ignore if palette change caused by itself */
- if ((HWND)wParam == hWnd) return 0;
+ case WM_PALETTECHANGED:
+ {
+ /* Ignore if palette change caused by itself */
+ if ((HWND)wParam == hWnd) return 0;
- /* Fall through... */
- }
+ /* Fall through... */
+ }
- case WM_QUERYNEWPALETTE:
- {
- if (!paletted) return 0;
+ case WM_QUERYNEWPALETTE:
+ {
+ if (!paletted) return 0;
- hdc = GetDC(hWnd);
+ hdc = GetDC(hWnd);
- SelectPalette(hdc, hPal, FALSE);
+ SelectPalette(hdc, hPal, FALSE);
- i = RealizePalette(hdc);
+ i = RealizePalette(hdc);
- /* if any palette entries changed, repaint the window. */
- if (i) InvalidateRect(hWnd, NULL, TRUE);
+ /* if any palette entries changed, repaint the window. */
+ if (i) InvalidateRect(hWnd, NULL, TRUE);
- ReleaseDC(hWnd, hdc);
+ ReleaseDC(hWnd, hdc);
- return 0;
- }
+ return 0;
+ }
- case WM_ACTIVATE:
+ case WM_ACTIVATE:
+ {
+ if (wParam && !HIWORD(lParam))
{
- if (wParam && !HIWORD(lParam))
+ /* Do something to sub-windows */
+ for (i = 1; i < MAX_TERM_DATA; i++)
{
- /* Do something to sub-windows */
- for (i = 1; i < MAX_TERM_DATA; i++)
- {
- if (!data[i].posfix) term_window_pos(&data[i], hWnd);
- }
-
- /* Focus on main window */
- SetFocus(hWnd);
-
- return 0;
+ if (!data[i].posfix) term_window_pos(&data[i], hWnd);
}
- break;
+ /* Focus on main window */
+ SetFocus(hWnd);
+
+ return 0;
}
- case WM_ACTIVATEAPP:
- {
- if (IsIconic(td->w)) break;
+ break;
+ }
- for (i = 1; i < MAX_TERM_DATA; i++)
+ case WM_ACTIVATEAPP:
+ {
+ if (IsIconic(td->w)) break;
+
+ for (i = 1; i < MAX_TERM_DATA; i++)
+ {
+ if (data[i].visible)
{
- if(data[i].visible)
+ if (wParam == TRUE)
+ {
+ ShowWindow(data[i].w, SW_SHOW);
+ }
+ else
{
- if (wParam == TRUE)
- {
- ShowWindow(data[i].w, SW_SHOW);
- }
- else
- {
- ShowWindow(data[i].w, SW_HIDE);
- }
+ ShowWindow(data[i].w, SW_HIDE);
}
}
}
}
+ }
return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
#ifdef __MWERKS__
LRESULT FAR PASCAL AngbandListProc(HWND hWnd, UINT uMsg,
- WPARAM wParam, LPARAM lParam);
+ WPARAM wParam, LPARAM lParam);
LRESULT FAR PASCAL AngbandListProc(HWND hWnd, UINT uMsg,
- WPARAM wParam, LPARAM lParam)
+ WPARAM wParam, LPARAM lParam)
#else /* __MWERKS__ */
LRESULT FAR PASCAL AngbandListProc(HWND hWnd, UINT uMsg,
- WPARAM wParam, LPARAM lParam)
+ WPARAM wParam, LPARAM lParam)
#endif /* __MWERKS__ */
{
term_data *td;
/* Process message */
switch (uMsg)
{
- case WM_NCCREATE:
- {
- SetWindowLong(hWnd, 0, (LONG)(my_td));
- break;
- }
-
- case WM_CREATE:
- {
- return 0;
- }
+ case WM_NCCREATE:
+ {
+ SetWindowLong(hWnd, 0, (LONG)(my_td));
+ break;
+ }
- case WM_GETMINMAXINFO:
- {
- MINMAXINFO FAR *lpmmi;
- RECT rc;
+ case WM_CREATE:
+ {
+ return 0;
+ }
- lpmmi = (MINMAXINFO FAR *)lParam;
+ case WM_GETMINMAXINFO:
+ {
+ MINMAXINFO FAR *lpmmi;
+ RECT rc;
- /* this message was sent before WM_NCCREATE */
- if (!td) return 1;
+ lpmmi = (MINMAXINFO FAR *)lParam;
- /* Minimum window size is 80x24 */
- rc.left = rc.top = 0;
- rc.right = rc.left + 20 * td->tile_wid + td->size_ow1 + td->size_ow2;
- rc.bottom = rc.top + 3 * td->tile_hgt + td->size_oh1 + td->size_oh2 + 1;
+ /* this message was sent before WM_NCCREATE */
+ if (!td) return 1;
- /* Adjust */
- AdjustWindowRectEx(&rc, td->dwStyle, TRUE, td->dwExStyle);
+ /* Minimum window size is 80x24 */
+ rc.left = rc.top = 0;
+ rc.right = rc.left + 20 * td->tile_wid + td->size_ow1 + td->size_ow2;
+ rc.bottom = rc.top + 3 * td->tile_hgt + td->size_oh1 + td->size_oh2 + 1;
- /* Save minimum size */
- lpmmi->ptMinTrackSize.x = rc.right - rc.left;
- lpmmi->ptMinTrackSize.y = rc.bottom - rc.top;
+ /* Adjust */
+ AdjustWindowRectEx(&rc, td->dwStyle, TRUE, td->dwExStyle);
- return 0;
- }
+ /* Save minimum size */
+ lpmmi->ptMinTrackSize.x = rc.right - rc.left;
+ lpmmi->ptMinTrackSize.y = rc.bottom - rc.top;
- case WM_SIZE:
- {
- TERM_LEN cols;
- TERM_LEN rows;
-
- /* this message was sent before WM_NCCREATE */
- if (!td) return 1;
+ return 0;
+ }
- /* it was sent from inside CreateWindowEx */
- if (!td->w) return 1;
+ case WM_SIZE:
+ {
+ TERM_LEN cols;
+ TERM_LEN rows;
- /* was sent from inside WM_SIZE */
- if (td->size_hack) return 1;
+ /* this message was sent before WM_NCCREATE */
+ if (!td) return 1;
- td->size_hack = TRUE;
+ /* it was sent from inside CreateWindowEx */
+ if (!td->w) return 1;
- cols = (LOWORD(lParam) - td->size_ow1) / td->tile_wid;
- rows = (HIWORD(lParam) - td->size_oh1) / td->tile_hgt;
+ /* was sent from inside WM_SIZE */
+ if (td->size_hack) return 1;
- /* New size */
- if ((td->cols != cols) || (td->rows != rows))
- {
- /* Save old term */
- term *old_term = Term;
+ td->size_hack = TRUE;
- /* Save the new size */
- td->cols = cols;
- td->rows = rows;
+ cols = (LOWORD(lParam) - td->size_ow1) / td->tile_wid;
+ rows = (HIWORD(lParam) - td->size_oh1) / td->tile_hgt;
- /* Activate */
- Term_activate(&td->t);
+ /* New size */
+ if ((td->cols != cols) || (td->rows != rows))
+ {
+ /* Save old term */
+ term *old_term = Term;
- /* Resize the term */
- Term_resize(td->cols, td->rows);
+ /* Save the new size */
+ td->cols = cols;
+ td->rows = rows;
- /* Activate */
- Term_activate(old_term);
+ /* Activate */
+ Term_activate(&td->t);
- /* Redraw later */
- InvalidateRect(td->w, NULL, TRUE);
+ /* Resize the term */
+ Term_resize(td->cols, td->rows);
- /* HACK - Redraw all windows */
- p_ptr->window = 0xFFFFFFFF;
- handle_stuff(p_ptr);
- }
+ /* Activate */
+ Term_activate(old_term);
- td->size_hack = FALSE;
+ /* Redraw later */
+ InvalidateRect(td->w, NULL, TRUE);
- return 0;
+ /* HACK - Redraw all windows */
+ p_ptr->window = 0xFFFFFFFF;
+ handle_stuff(p_ptr);
}
- case WM_PAINT:
- {
- BeginPaint(hWnd, &ps);
- if (td) term_data_redraw(td);
- EndPaint(hWnd, &ps);
- return 0;
- }
+ td->size_hack = FALSE;
- case WM_SYSKEYDOWN:
- case WM_KEYDOWN:
- {
- if (process_keydown(wParam, lParam))
- return 0;
- break;
- }
+ return 0;
+ }
- case WM_CHAR:
- {
- if (Term_no_press) Term_no_press = FALSE;
- else Term_keypress(wParam);
+ case WM_PAINT:
+ {
+ BeginPaint(hWnd, &ps);
+ if (td) term_data_redraw(td);
+ EndPaint(hWnd, &ps);
+ return 0;
+ }
+
+ case WM_SYSKEYDOWN:
+ case WM_KEYDOWN:
+ {
+ if (process_keydown(wParam, lParam))
return 0;
- }
+ break;
+ }
- case WM_PALETTECHANGED:
- {
- /* ignore if palette change caused by itself */
- if ((HWND)wParam == hWnd) return FALSE;
- /* otherwise, fall through!!! */
- }
+ case WM_CHAR:
+ {
+ if (Term_no_press) Term_no_press = FALSE;
+ else Term_keypress(wParam);
+ return 0;
+ }
- case WM_QUERYNEWPALETTE:
- {
- if (!paletted) return 0;
- hdc = GetDC(hWnd);
- SelectPalette(hdc, hPal, FALSE);
- i = RealizePalette(hdc);
- /* if any palette entries changed, repaint the window. */
- if (i) InvalidateRect(hWnd, NULL, TRUE);
- ReleaseDC(hWnd, hdc);
- return 0;
- }
+ case WM_PALETTECHANGED:
+ {
+ /* ignore if palette change caused by itself */
+ if ((HWND)wParam == hWnd) return FALSE;
+ /* otherwise, fall through!!! */
+ }
- case WM_NCLBUTTONDOWN:
- {
+ case WM_QUERYNEWPALETTE:
+ {
+ if (!paletted) return 0;
+ hdc = GetDC(hWnd);
+ SelectPalette(hdc, hPal, FALSE);
+ i = RealizePalette(hdc);
+ /* if any palette entries changed, repaint the window. */
+ if (i) InvalidateRect(hWnd, NULL, TRUE);
+ ReleaseDC(hWnd, hdc);
+ return 0;
+ }
+
+ case WM_NCLBUTTONDOWN:
+ {
#ifdef HTCLOSE
- if (wParam == HTCLOSE) wParam = HTSYSMENU;
+ if (wParam == HTCLOSE) wParam = HTSYSMENU;
#endif /* HTCLOSE */
- if (wParam == HTSYSMENU)
+ if (wParam == HTSYSMENU)
+ {
+ if (td->visible)
{
- if (td->visible)
- {
- td->visible = FALSE;
- ShowWindow(td->w, SW_HIDE);
- }
-
- return 0;
+ td->visible = FALSE;
+ ShowWindow(td->w, SW_HIDE);
}
- break;
+ return 0;
}
+
+ break;
+ }
}
return DefWindowProc(hWnd, uMsg, wParam, lParam);
#ifdef __MWERKS__
LRESULT FAR PASCAL AngbandSaverProc(HWND hWnd, UINT uMsg,
- WPARAM wParam, LPARAM lParam);
+ WPARAM wParam, LPARAM lParam);
LRESULT FAR PASCAL AngbandSaverProc(HWND hWnd, UINT uMsg,
- WPARAM wParam, LPARAM lParam)
+ WPARAM wParam, LPARAM lParam)
#else /* __MWERKS__ */
LRESULT FAR PASCAL AngbandSaverProc(HWND hWnd, UINT uMsg,
- WPARAM wParam, LPARAM lParam)
+ WPARAM wParam, LPARAM lParam)
#endif /* __MWERKS__ */
{
static int iMouse = 0;
/* Process */
switch (uMsg)
{
- case WM_NCCREATE:
- {
- break;
- }
+ case WM_NCCREATE:
+ {
+ break;
+ }
- case WM_SETCURSOR:
- {
- SetCursor(NULL);
- return 0;
- }
+ case WM_SETCURSOR:
+ {
+ SetCursor(NULL);
+ return 0;
+ }
- case WM_LBUTTONDOWN:
- case WM_MBUTTONDOWN:
- case WM_RBUTTONDOWN:
- case WM_KEYDOWN:
- {
- SendMessage(hWnd, WM_CLOSE, 0, 0);
- return 0;
- }
+ case WM_LBUTTONDOWN:
+ case WM_MBUTTONDOWN:
+ case WM_RBUTTONDOWN:
+ case WM_KEYDOWN:
+ {
+ SendMessage(hWnd, WM_CLOSE, 0, 0);
+ return 0;
+ }
- case WM_MOUSEMOVE:
+ case WM_MOUSEMOVE:
+ {
+ if (iMouse)
{
- if (iMouse)
- {
- dx = LOWORD(lParam) - xMouse;
- dy = HIWORD(lParam) - yMouse;
+ dx = LOWORD(lParam) - xMouse;
+ dy = HIWORD(lParam) - yMouse;
- if (dx < 0) dx = -dx;
- if (dy < 0) dy = -dy;
+ if (dx < 0) dx = -dx;
+ if (dy < 0) dy = -dy;
- if ((dx > MOUSE_SENS) || (dy > MOUSE_SENS))
- {
- SendMessage(hWnd, WM_CLOSE, 0, 0);
- }
+ if ((dx > MOUSE_SENS) || (dy > MOUSE_SENS))
+ {
+ SendMessage(hWnd, WM_CLOSE, 0, 0);
}
+ }
- /* Save last location */
- iMouse = 1;
- xMouse = LOWORD(lParam);
- yMouse = HIWORD(lParam);
+ /* Save last location */
+ iMouse = 1;
+ xMouse = LOWORD(lParam);
+ yMouse = HIWORD(lParam);
- return 0;
- }
+ return 0;
+ }
- case WM_CLOSE:
- {
- DestroyWindow(hwndSaver);
- hwndSaver = NULL;
- return 0;
- }
+ case WM_CLOSE:
+ {
+ DestroyWindow(hwndSaver);
+ hwndSaver = NULL;
+ return 0;
+ }
}
return DefWindowProc(hWnd, uMsg, wParam, lParam);
{
#ifdef JP
MessageBox(NULL, str, "警告!",
- MB_ICONEXCLAMATION | MB_OK);
+ MB_ICONEXCLAMATION | MB_OK);
#else
MessageBox(NULL, str, "Warning",
- MB_ICONEXCLAMATION | MB_OK);
+ MB_ICONEXCLAMATION | MB_OK);
#endif
}
{
#ifdef JP
MessageBox(NULL, str, "エラー!",
- MB_ICONEXCLAMATION | MB_OK | MB_ICONSTOP);
+ MB_ICONEXCLAMATION | MB_OK | MB_ICONSTOP);
#else
MessageBox(NULL, str, "Error",
- MB_ICONEXCLAMATION | MB_OK | MB_ICONSTOP);
+ MB_ICONEXCLAMATION | MB_OK | MB_ICONSTOP);
#endif
}
{
#ifdef JP
MessageBox(data[0].w, str, "警告!",
- MB_ICONEXCLAMATION | MB_OK);
+ MB_ICONEXCLAMATION | MB_OK);
#else
MessageBox(data[0].w, str, "Warning",
- MB_ICONEXCLAMATION | MB_OK);
+ MB_ICONEXCLAMATION | MB_OK);
#endif
}
{
#ifdef JP
MessageBox(data[0].w, str, "エラー!",
- MB_ICONEXCLAMATION | MB_OK | MB_ICONSTOP);
+ MB_ICONEXCLAMATION | MB_OK | MB_ICONSTOP);
#else
MessageBox(data[0].w, str, "Error",
- MB_ICONEXCLAMATION | MB_OK | MB_ICONSTOP);
+ MB_ICONEXCLAMATION | MB_OK | MB_ICONSTOP);
#endif
}
* @brief (Windows固有)Windowsアプリケーションとしてのエントリポイント
*/
int FAR PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrevInst,
- LPSTR lpCmdLine, int nCmdShow)
+ LPSTR lpCmdLine, int nCmdShow)
{
int i;
/* Save globally */
hInstance = hInst;
-
-
+
+
/* Prevent multiple run */
if (is_already_running())
{
MessageBox(NULL,
- _("変愚蛮怒はすでに起動しています。", "Hengband is already running."),
- _("エラー!", "Error") ,
- MB_ICONEXCLAMATION | MB_OK | MB_ICONSTOP);
+ _("変愚蛮怒はすでに起動しています。", "Hengband is already running."),
+ _("エラー!", "Error"),
+ MB_ICONEXCLAMATION | MB_OK | MB_ICONSTOP);
return FALSE;
}
if (hPrevInst == NULL)
{
- wc.style = CS_CLASSDC;
- wc.lpfnWndProc = AngbandWndProc;
- wc.cbClsExtra = 0;
- wc.cbWndExtra = 4; /* one long pointer to term_data */
- wc.hInstance = hInst;
- wc.hIcon = hIcon = LoadIcon(hInst, AppName);
- wc.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wc.style = CS_CLASSDC;
+ wc.lpfnWndProc = AngbandWndProc;
+ wc.cbClsExtra = 0;
+ wc.cbWndExtra = 4; /* one long pointer to term_data */
+ wc.hInstance = hInst;
+ wc.hIcon = hIcon = LoadIcon(hInst, AppName);
+ wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = GetStockObject(BLACK_BRUSH);
- wc.lpszMenuName = AppName;
+ wc.lpszMenuName = AppName;
wc.lpszClassName = AppName;
if (!RegisterClass(&wc)) exit(1);
- wc.lpfnWndProc = AngbandListProc;
- wc.lpszMenuName = NULL;
+ wc.lpfnWndProc = AngbandListProc;
+ wc.lpszMenuName = NULL;
wc.lpszClassName = AngList;
if (!RegisterClass(&wc)) exit(2);
#ifdef USE_SAVER
- wc.style = CS_VREDRAW | CS_HREDRAW | CS_SAVEBITS | CS_DBLCLKS;
- wc.lpfnWndProc = AngbandSaverProc;
- wc.hCursor = NULL;
- wc.lpszMenuName = NULL;
- wc.lpszClassName = "WindowsScreenSaverClass";
+ wc.style = CS_VREDRAW | CS_HREDRAW | CS_SAVEBITS | CS_DBLCLKS;
+ wc.lpfnWndProc = AngbandSaverProc;
+ wc.hCursor = NULL;
+ wc.lpszMenuName = NULL;
+ wc.lpszClassName = "WindowsScreenSaverClass";
if (!RegisterClass(&wc)) exit(3);
/* We are now initialized */
initialized = TRUE;
#ifdef CHUUKEI
- if(lpCmdLine[0] == '-'){
- switch(lpCmdLine[1])
- {
- case 'p':
- case 'P':
- {
- if (!lpCmdLine[2]) break;
- chuukei_server = TRUE;
- if(connect_chuukei_server(&lpCmdLine[2])<0){
- msg_print("connect fail");
- return 0;
- }
- msg_print("connect");
- msg_print(NULL);
- break;
- }
-
- case 'c':
- case 'C':
- {
- if (!lpCmdLine[2]) break;
- chuukei_client = TRUE;
- connect_chuukei_server(&lpCmdLine[2]);
- play_game(p_ptr, FALSE);
- quit(NULL);
- return 0;
- }
- case 'X':
- case 'x':
- {
- if (!lpCmdLine[2]) break;
- prepare_browse_movie(&lpCmdLine[2]);
- play_game(p_ptr, FALSE);
- quit(NULL);
- return 0;
- }
- }
+ if (lpCmdLine[0] == '-') {
+ switch (lpCmdLine[1])
+ {
+ case 'p':
+ case 'P':
+ {
+ if (!lpCmdLine[2]) break;
+ chuukei_server = TRUE;
+ if (connect_chuukei_server(&lpCmdLine[2]) < 0) {
+ msg_print("connect fail");
+ return 0;
+ }
+ msg_print("connect");
+ msg_print(NULL);
+ break;
+ }
+
+ case 'c':
+ case 'C':
+ {
+ if (!lpCmdLine[2]) break;
+ chuukei_client = TRUE;
+ connect_chuukei_server(&lpCmdLine[2]);
+ play_game(p_ptr, FALSE);
+ quit(NULL);
+ return 0;
+ }
+ case 'X':
+ case 'x':
+ {
+ if (!lpCmdLine[2]) break;
+ prepare_browse_movie(&lpCmdLine[2]);
+ play_game(p_ptr, FALSE);
+ quit(NULL);
+ return 0;
+ }
+ }
}
#endif
#ifdef CHUUKEI
/* Did the user double click on a save file? */
- if(!chuukei_server) check_for_save_file(lpCmdLine);
+ if (!chuukei_server) check_for_save_file(lpCmdLine);
#else
/* Did the user double click on a save file? */
check_for_save_file(lpCmdLine);
#endif /* WINDOWS */
-
#include "view-mainwindow.h"
-/*!
- * @brief モンスターが敵に接近するための方向を決める /
- * Calculate the direction to the next enemy
- * @param target_ptr プレーヤーへの参照ポインタ
- * @param m_idx モンスターの参照ID
- * @param mm 移動するべき方角IDを返す参照ポインタ
- * @return 方向が確定した場合TRUE、接近する敵がそもそもいない場合FALSEを返す
- */
+ /*!
+ * @brief モンスターが敵に接近するための方向を決める /
+ * Calculate the direction to the next enemy
+ * @param target_ptr プレーヤーへの参照ポインタ
+ * @param m_idx モンスターの参照ID
+ * @param mm 移動するべき方角IDを返す参照ポインタ
+ * @return 方向が確定した場合TRUE、接近する敵がそもそもいない場合FALSEを返す
+ */
static bool get_enemy_dir(player_type *target_ptr, MONSTER_IDX m_idx, int *mm)
{
floor_type *floor_ptr = target_ptr->current_floor_ptr;
int plus = 1;
if (target_ptr->phase_out)
{
- start = randint1(floor_ptr->m_max-1)+floor_ptr->m_max;
- if(randint0(2)) plus = -1;
+ start = randint1(floor_ptr->m_max - 1) + floor_ptr->m_max;
+ if (randint0(2)) plus = -1;
}
else start = floor_ptr->m_max + 1;
/* Scan thru all monsters */
- for (int i = start; ((i < start + floor_ptr->m_max) && (i > start - floor_ptr->m_max)); i+=plus)
+ for (int i = start; ((i < start + floor_ptr->m_max) && (i > start - floor_ptr->m_max)); i += plus)
{
MONSTER_IDX dummy = (i % floor_ptr->m_max);
/* Monster must be projectable if we can't pass through walls */
if (((r_ptr->flags2 & RF2_PASS_WALL) && ((m_idx != target_ptr->riding) || target_ptr->pass_wall)) ||
- ((r_ptr->flags2 & RF2_KILL_WALL) && (m_idx != target_ptr->riding)))
+ ((r_ptr->flags2 & RF2_KILL_WALL) && (m_idx != target_ptr->riding)))
{
if (!in_disintegration_range(floor_ptr, m_ptr->fy, m_ptr->fx, t_ptr->fy, t_ptr->fx)) continue;
}
{
/* Are we trying to avoid the player? */
return ((target_ptr->pet_follow_distance < 0) &&
- (m_ptr->cdis <= (0 - target_ptr->pet_follow_distance)));
+ (m_ptr->cdis <= (0 - target_ptr->pet_follow_distance)));
}
/* Keep monsters from running too far away */
/* Can monster cast attack spell? */
if (r_ptr->flags4 & (RF4_ATTACK_MASK) ||
- r_ptr->a_ability_flags1 & (RF5_ATTACK_MASK) ||
- r_ptr->a_ability_flags2 & (RF6_ATTACK_MASK))
+ r_ptr->a_ability_flags1 & (RF5_ATTACK_MASK) ||
+ r_ptr->a_ability_flags2 & (RF6_ATTACK_MASK))
{
/* Can move spell castable grid? */
if (get_moves_aux2(target_ptr, m_idx, yp, xp)) return TRUE;
* It is probably better to replace these arrays with code to compute
* the relevant arrays, even if the storage is pre-allocated in hard
* coded sizes. At the very least, code should be included which is
- * able to generate and dump these arrays (ala "los()").
+ * able to generate and dump these arrays (ala "los()").
*
- * Also, the storage needs could be halved by using bytes.
+ * Also, the storage needs could be halved by using bytes.
*
* These arrays could be combined into two big arrays, using sub-arrays
* to hold the offsets and lengths of each portion of the sub-arrays, and
- * this could perhaps also be used somehow in the "look" code.
+ * this could perhaps also be used somehow in the "look" code.
*/
/* Check the locations */
for (POSITION i = 0, dx = x_offsets[0], dy = y_offsets[0];
- dx != 0 || dy != 0;
- i++, dx = x_offsets[i], dy = y_offsets[i])
+ dx != 0 || dy != 0;
+ i++, dx = x_offsets[i], dy = y_offsets[i])
{
POSITION y = fy + dy;
POSITION x = fx + dx;
/* Check the locations */
for (POSITION i = 0, dx = x_offsets[0], dy = y_offsets[0];
- dx != 0 || dy != 0;
- i++, dx = x_offsets[i], dy = y_offsets[i])
+ dx != 0 || dy != 0;
+ i++, dx = x_offsets[i], dy = y_offsets[i])
{
POSITION y = fy + dy;
POSITION x = fx + dx;
/* The monster must be an enemy, and in LOS */
if (t_m_idx &&
- are_enemies(m_ptr, &floor_ptr->m_list[t_m_idx]) &&
- los(target_ptr, m_ptr->fy, m_ptr->fx, m_ptr->target_y, m_ptr->target_x) &&
- projectable(target_ptr, m_ptr->fy, m_ptr->fx, m_ptr->target_y, m_ptr->target_x))
+ are_enemies(m_ptr, &floor_ptr->m_list[t_m_idx]) &&
+ los(target_ptr, m_ptr->fy, m_ptr->fx, m_ptr->target_y, m_ptr->target_x) &&
+ projectable(target_ptr, m_ptr->fy, m_ptr->fx, m_ptr->target_y, m_ptr->target_x))
{
/* Extract the "pseudo-direction" */
y = m_ptr->fy - m_ptr->target_y;
}
if (!done && !will_run && is_hostile(m_ptr) &&
- (r_ptr->flags1 & RF1_FRIENDS) &&
- ((los(target_ptr, m_ptr->fy, m_ptr->fx, target_ptr->y, target_ptr->x) && projectable(target_ptr, m_ptr->fy, m_ptr->fx, target_ptr->y, target_ptr->x)) ||
- (floor_ptr->grid_array[m_ptr->fy][m_ptr->fx].dist < MAX_SIGHT / 2)))
+ (r_ptr->flags1 & RF1_FRIENDS) &&
+ ((los(target_ptr, m_ptr->fy, m_ptr->fx, target_ptr->y, target_ptr->x) && projectable(target_ptr, m_ptr->fy, m_ptr->fx, target_ptr->y, target_ptr->x)) ||
+ (floor_ptr->grid_array[m_ptr->fy][m_ptr->fx].dist < MAX_SIGHT / 2)))
{
- /*
- * Animal packs try to get the player out of corridors
- * (...unless they can move through walls -- TY)
- */
+ /*
+ * Animal packs try to get the player out of corridors
+ * (...unless they can move through walls -- TY)
+ */
if ((r_ptr->flags3 & RF3_ANIMAL) && !can_pass_wall &&
- !(r_ptr->flags2 & RF2_KILL_WALL))
+ !(r_ptr->flags2 & RF2_KILL_WALL))
{
int i, room = 0;
/* Not in a room and strong player */
if (room < (8 * (target_ptr->chp + target_ptr->csp)) /
- (target_ptr->mhp + target_ptr->msp))
+ (target_ptr->mhp + target_ptr->msp))
{
/* Find hiding place */
if (find_hiding(target_ptr, m_idx, &y, &x)) done = TRUE;
/* Players hidden in shadow are almost imperceptable. -LM- */
if (target_ptr->special_defense & NINJA_S_STEALTH)
{
- int tmp = target_ptr->lev*6+(target_ptr->skill_stl+10)*4;
+ int tmp = target_ptr->lev * 6 + (target_ptr->skill_stl + 10) * 4;
if (target_ptr->monlite) tmp /= 3;
if (target_ptr->cursed & TRC_AGGRAVATE) tmp /= 2;
if (r_ptr->level > (target_ptr->lev * target_ptr->lev / 20 + 10)) tmp /= 3;
/* Low-level monsters will find it difficult to locate the player. */
- if (randint0(tmp) > (r_ptr->level+20)) aware = FALSE;
+ if (randint0(tmp) > (r_ptr->level + 20)) aware = FALSE;
}
/* Are there its parent? */
if (m_ptr->r_idx == MON_SHURYUUDAN)
{
mon_take_hit_mon(target_ptr, m_idx, 1, &dead, &fear, _("は爆発して粉々になった。", " explodes into tiny shreds."), m_idx);
- if(dead) return;
+ if (dead) return;
}
if ((is_pet(m_ptr) || is_friendly(m_ptr)) && ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL)) && !target_ptr->phase_out)
{
static int riding_pinch = 0;
- if (m_ptr->hp < m_ptr->maxhp/3)
+ if (m_ptr->hp < m_ptr->maxhp / 3)
{
GAME_TEXT m_name[MAX_NLEN];
monster_desc(m_name, m_ptr, 0);
if (is_riding_mon && riding_pinch < 2)
{
msg_format(_("%sは傷の痛さの余りあなたの束縛から逃れようとしている。",
- "%^s seems to be in so much pain and trying to escape from your restriction."), m_name);
+ "%^s seems to be in so much pain and trying to escape from your restriction."), m_name);
riding_pinch++;
disturb(target_ptr, TRUE, TRUE);
}
if (see_m)
{
if ((r_ptr->flags2 & RF2_CAN_SPEAK) && (m_ptr->r_idx != MON_GRIP) && (m_ptr->r_idx != MON_WOLF) && (m_ptr->r_idx != MON_FANG) &&
- player_has_los_bold(target_ptr, m_ptr->fy, m_ptr->fx) && projectable(target_ptr, m_ptr->fy, m_ptr->fx, target_ptr->y, target_ptr->x))
+ player_has_los_bold(target_ptr, m_ptr->fy, m_ptr->fx) && projectable(target_ptr, m_ptr->fy, m_ptr->fx, target_ptr->y, target_ptr->x))
{
msg_format(_("%^s「ピンチだ!退却させてもらう!」", "%^s says 'It is the pinch! I will retreat'."), m_name);
}
/* Paranoia... no pet uniques outside wizard mode -- TY */
if (is_pet(m_ptr) && ((((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL)) &&
- monster_has_hostile_align(NULL, 10, -10, r_ptr)) || (r_ptr->flagsr & RFR_RES_ALL)))
+ monster_has_hostile_align(NULL, 10, -10, r_ptr)) || (r_ptr->flagsr & RFR_RES_ALL)))
{
gets_angry = TRUE;
}
{
/* Hack! "Cyber" monster makes noise... */
if (m_ptr->ap_r_idx == MON_CYBER &&
- one_in_(CYBERNOISE) &&
- !m_ptr->ml && (m_ptr->cdis <= MAX_SIGHT))
+ one_in_(CYBERNOISE) &&
+ !m_ptr->ml && (m_ptr->cdis <= MAX_SIGHT))
{
if (disturb_minor) disturb(target_ptr, FALSE, FALSE);
msg_print(_("重厚な足音が聞こえた。", "You hear heavy steps."));
/* Some monsters can speak */
if ((ap_r_ptr->flags2 & RF2_CAN_SPEAK) && aware &&
- one_in_(SPEAK_CHANCE) &&
- player_has_los_bold(target_ptr, oy, ox) &&
- projectable(target_ptr, oy, ox, target_ptr->y, target_ptr->x))
+ one_in_(SPEAK_CHANCE) &&
+ player_has_los_bold(target_ptr, oy, ox) &&
+ projectable(target_ptr, oy, ox, target_ptr->y, target_ptr->x))
{
GAME_TEXT m_name[MAX_NLEN];
char monmessage[1024];
/* The monster must be an enemy, and projectable */
if (t_m_idx && are_enemies(m_ptr, &target_ptr->current_floor_ptr->m_list[t_m_idx]) &&
- projectable(target_ptr, m_ptr->fy, m_ptr->fx, m_ptr->target_y, m_ptr->target_x))
+ projectable(target_ptr, m_ptr->fy, m_ptr->fx, m_ptr->target_y, m_ptr->target_x))
{
counterattack = TRUE;
}
/* 75% random movement */
else if (((r_ptr->flags1 & (RF1_RAND_50 | RF1_RAND_25)) == (RF1_RAND_50 | RF1_RAND_25)) &&
- (randint0(100) < 75))
+ (randint0(100) < 75))
{
/* Memorize flags */
if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags1 |= (RF1_RAND_50 | RF1_RAND_25);
/* 50% random movement */
else if ((r_ptr->flags1 & RF1_RAND_50) &&
- (randint0(100) < 50))
+ (randint0(100) < 50))
{
/* Memorize flags */
if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags1 |= (RF1_RAND_50);
/* 25% random movement */
else if ((r_ptr->flags1 & RF1_RAND_25) &&
- (randint0(100) < 25))
+ (randint0(100) < 25))
{
/* Memorize flags */
if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags1 |= RF1_RAND_25;
/* Monster destroys walls (and doors) */
else if ((r_ptr->flags2 & RF2_KILL_WALL) &&
- (can_cross ? !have_flag(f_ptr->flags, FF_LOS) : !is_riding_mon) &&
- have_flag(f_ptr->flags, FF_HURT_DISI) && !have_flag(f_ptr->flags, FF_PERMANENT) &&
- check_hp_for_feat_destruction(f_ptr, m_ptr))
+ (can_cross ? !have_flag(f_ptr->flags, FF_LOS) : !is_riding_mon) &&
+ have_flag(f_ptr->flags, FF_HURT_DISI) && !have_flag(f_ptr->flags, FF_PERMANENT) &&
+ check_hp_for_feat_destruction(f_ptr, m_ptr))
{
/* Eat through walls/doors/rubble */
do_move = TRUE;
/* Monster moves through walls (and doors) */
if ((r_ptr->flags2 & RF2_PASS_WALL) && (!is_riding_mon || target_ptr->pass_wall) &&
- have_flag(f_ptr->flags, FF_CAN_PASS))
+ have_flag(f_ptr->flags, FF_CAN_PASS))
{
/* Monster went through a wall */
did_pass_wall = TRUE;
/* Creature can open doors. */
if ((r_ptr->flags2 & RF2_OPEN_DOOR) && have_flag(f_ptr->flags, FF_OPEN) &&
- (!is_pet(m_ptr) || (target_ptr->pet_extra_flags & PF_OPEN_DOORS)))
+ (!is_pet(m_ptr) || (target_ptr->pet_extra_flags & PF_OPEN_DOORS)))
{
/* Closed doors */
if (!f_ptr->power)
/* Hack -- check for Glyph of Warding */
if (do_move && is_glyph_grid(g_ptr) &&
- !((r_ptr->flags1 & RF1_NEVER_BLOW) && player_bold(target_ptr, ny, nx)))
+ !((r_ptr->flags1 & RF1_NEVER_BLOW) && player_bold(target_ptr, ny, nx)))
{
/* Assume no move allowed */
do_move = FALSE;
}
}
else if (do_move && is_explosive_rune_grid(g_ptr) &&
- !((r_ptr->flags1 & RF1_NEVER_BLOW) && player_bold(target_ptr, ny, nx)))
+ !((r_ptr->flags1 & RF1_NEVER_BLOW) && player_bold(target_ptr, ny, nx)))
{
/* Assume no move allowed */
do_move = FALSE;
/* Attack 'enemies' */
if (((r_ptr->flags2 & RF2_KILL_BODY) && !(r_ptr->flags1 & RF1_NEVER_BLOW) &&
- (r_ptr->mexp * r_ptr->level > z_ptr->mexp * z_ptr->level) &&
- can_cross && (g_ptr->m_idx != target_ptr->riding)) ||
+ (r_ptr->mexp * r_ptr->level > z_ptr->mexp * z_ptr->level) &&
+ can_cross && (g_ptr->m_idx != target_ptr->riding)) ||
are_enemies(m_ptr, y_ptr) || MON_CONFUSED(m_ptr))
{
if (!(r_ptr->flags1 & RF1_NEVER_BLOW))
if (do_turn) break;
continue;
}
-
+
OBJECT_IDX this_o_idx, next_o_idx;
bool do_take = (r_ptr->flags2 & RF2_TAKE_ITEM) ? TRUE : FALSE;
* Forward movements failed, but now received LOS attack!
* Try to flow by smell.
*/
- if (target_ptr->no_flowed && i > 2 && m_ptr->target_y)
+ if (target_ptr->no_flowed && i > 2 && m_ptr->target_y)
m_ptr->mflag2 &= ~MFLAG2_NOFLOW;
/* If we haven't done anything, try casting a spell again */
}
/* Handle "sight" and "aggravation" */
- else if ((m_ptr->cdis <= MAX_SIGHT || target_ptr->phase_out) &&
+ else if ((m_ptr->cdis <= MAX_SIGHT || target_ptr->phase_out) &&
(player_has_los_bold(target_ptr, fy, fx) || (target_ptr->cursed & TRC_AGGRAVATE)))
{
/* We can "see" or "feel" the player */
target_ptr->window |= (PW_MONSTER);
}
}
-
/* Hack -- remove tracked monster */
if (i == p_ptr->health_who) health_track(p_ptr, 0);
- if (p_ptr->pet_t_m_idx == i ) p_ptr->pet_t_m_idx = 0;
+ if (p_ptr->pet_t_m_idx == i) p_ptr->pet_t_m_idx = 0;
if (p_ptr->riding_t_m_idx == i) p_ptr->riding_t_m_idx = 0;
if (p_ptr->riding == i) p_ptr->riding = 0;
* generation of unique monster who is the minion of player.
*/
- /* Hack -- Wipe the racial counter of all monster races */
+ /* Hack -- Wipe the racial counter of all monster races */
for (i = 1; i < max_r_idx; i++) r_info[i].cur_num = 0;
/* Reset "floor_ptr->m_max" */
/* Check our requirements */
switch (summon_specific_type)
{
- case SUMMON_ANT:
- {
- okay = (r_ptr->d_char == 'a');
- break;
- }
+ case SUMMON_ANT:
+ {
+ okay = (r_ptr->d_char == 'a');
+ break;
+ }
- case SUMMON_SPIDER:
- {
- okay = (r_ptr->d_char == 'S');
- break;
- }
+ case SUMMON_SPIDER:
+ {
+ okay = (r_ptr->d_char == 'S');
+ break;
+ }
- case SUMMON_HOUND:
- {
- okay = ((r_ptr->d_char == 'C') || (r_ptr->d_char == 'Z'));
- break;
- }
+ case SUMMON_HOUND:
+ {
+ okay = ((r_ptr->d_char == 'C') || (r_ptr->d_char == 'Z'));
+ break;
+ }
- case SUMMON_HYDRA:
- {
- okay = (r_ptr->d_char == 'M');
- break;
- }
+ case SUMMON_HYDRA:
+ {
+ okay = (r_ptr->d_char == 'M');
+ break;
+ }
- case SUMMON_ANGEL:
- {
- okay = (r_ptr->d_char == 'A' && ((r_ptr->flags3 & RF3_EVIL) || (r_ptr->flags3 & RF3_GOOD)));
- break;
- }
+ case SUMMON_ANGEL:
+ {
+ okay = (r_ptr->d_char == 'A' && ((r_ptr->flags3 & RF3_EVIL) || (r_ptr->flags3 & RF3_GOOD)));
+ break;
+ }
- case SUMMON_DEMON:
- {
- okay = (r_ptr->flags3 & RF3_DEMON);
- break;
- }
+ case SUMMON_DEMON:
+ {
+ okay = (r_ptr->flags3 & RF3_DEMON);
+ break;
+ }
- case SUMMON_UNDEAD:
- {
- okay = (r_ptr->flags3 & RF3_UNDEAD);
- break;
- }
+ case SUMMON_UNDEAD:
+ {
+ okay = (r_ptr->flags3 & RF3_UNDEAD);
+ break;
+ }
- case SUMMON_DRAGON:
- {
- okay = (r_ptr->flags3 & RF3_DRAGON);
- break;
- }
+ case SUMMON_DRAGON:
+ {
+ okay = (r_ptr->flags3 & RF3_DRAGON);
+ break;
+ }
- case SUMMON_HI_UNDEAD:
- {
- okay = ((r_ptr->d_char == 'L') ||
- (r_ptr->d_char == 'V') ||
- (r_ptr->d_char == 'W'));
- break;
- }
+ case SUMMON_HI_UNDEAD:
+ {
+ okay = ((r_ptr->d_char == 'L') ||
+ (r_ptr->d_char == 'V') ||
+ (r_ptr->d_char == 'W'));
+ break;
+ }
- case SUMMON_HI_DRAGON:
- {
- okay = (r_ptr->d_char == 'D');
- break;
- }
+ case SUMMON_HI_DRAGON:
+ {
+ okay = (r_ptr->d_char == 'D');
+ break;
+ }
- case SUMMON_HI_DEMON:
- {
- okay = (((r_ptr->d_char == 'U') ||
- (r_ptr->d_char == 'H') ||
- (r_ptr->d_char == 'B')) &&
- (r_ptr->flags3 & RF3_DEMON)) ? TRUE : FALSE;
- break;
- }
+ case SUMMON_HI_DEMON:
+ {
+ okay = (((r_ptr->d_char == 'U') ||
+ (r_ptr->d_char == 'H') ||
+ (r_ptr->d_char == 'B')) &&
+ (r_ptr->flags3 & RF3_DEMON)) ? TRUE : FALSE;
+ break;
+ }
- case SUMMON_AMBERITES:
- {
- okay = (r_ptr->flags3 & (RF3_AMBERITE)) ? TRUE : FALSE;
- break;
- }
+ case SUMMON_AMBERITES:
+ {
+ okay = (r_ptr->flags3 & (RF3_AMBERITE)) ? TRUE : FALSE;
+ break;
+ }
- case SUMMON_UNIQUE:
- {
- okay = (r_ptr->flags1 & (RF1_UNIQUE)) ? TRUE : FALSE;
- break;
- }
+ case SUMMON_UNIQUE:
+ {
+ okay = (r_ptr->flags1 & (RF1_UNIQUE)) ? TRUE : FALSE;
+ break;
+ }
- case SUMMON_MOLD:
- {
- okay = (r_ptr->d_char == 'm');
- break;
- }
- case SUMMON_BAT:
- {
- okay = (r_ptr->d_char == 'b');
- break;
- }
- case SUMMON_QUYLTHULG:
- {
- okay = (r_ptr->d_char == 'Q');
- break;
- }
+ case SUMMON_MOLD:
+ {
+ okay = (r_ptr->d_char == 'm');
+ break;
+ }
+ case SUMMON_BAT:
+ {
+ okay = (r_ptr->d_char == 'b');
+ break;
+ }
+ case SUMMON_QUYLTHULG:
+ {
+ okay = (r_ptr->d_char == 'Q');
+ break;
+ }
- case SUMMON_COIN_MIMIC:
- {
- okay = (r_ptr->d_char == '$');
- break;
- }
+ case SUMMON_COIN_MIMIC:
+ {
+ okay = (r_ptr->d_char == '$');
+ break;
+ }
- case SUMMON_MIMIC:
- {
- okay = ((r_ptr->d_char == '!') ||
- (r_ptr->d_char == '?') ||
- (r_ptr->d_char == '=') ||
- (r_ptr->d_char == '$') ||
- (r_ptr->d_char == '|'));
- break;
- }
+ case SUMMON_MIMIC:
+ {
+ okay = ((r_ptr->d_char == '!') ||
+ (r_ptr->d_char == '?') ||
+ (r_ptr->d_char == '=') ||
+ (r_ptr->d_char == '$') ||
+ (r_ptr->d_char == '|'));
+ break;
+ }
- case SUMMON_GOLEM:
- {
- okay = (r_ptr->d_char == 'g');
- break;
- }
+ case SUMMON_GOLEM:
+ {
+ okay = (r_ptr->d_char == 'g');
+ break;
+ }
- case SUMMON_CYBER:
- {
- okay = ((r_ptr->d_char == 'U') &&
- (r_ptr->flags4 & RF4_ROCKET));
- break;
- }
+ case SUMMON_CYBER:
+ {
+ okay = ((r_ptr->d_char == 'U') &&
+ (r_ptr->flags4 & RF4_ROCKET));
+ break;
+ }
- case SUMMON_KIN:
+ case SUMMON_KIN:
+ {
+ SYMBOL_CODE summon_kin_type;
+ if (summoner_idx)
{
- SYMBOL_CODE summon_kin_type;
- if (summoner_idx)
- {
- summon_kin_type = r_info[summoner_idx].d_char;
- }
- else
- {
- summon_kin_type = get_summon_symbol_from_player(p_ptr);
- }
-
- okay = ((r_ptr->d_char == summon_kin_type) && (r_idx != MON_HAGURE));
- break;
+ summon_kin_type = r_info[summoner_idx].d_char;
}
-
- case SUMMON_DAWN:
+ else
{
- okay = (r_idx == MON_DAWN);
- break;
+ summon_kin_type = get_summon_symbol_from_player(p_ptr);
}
- case SUMMON_ANIMAL:
- {
- okay = (r_ptr->flags3 & (RF3_ANIMAL));
- break;
- }
+ okay = ((r_ptr->d_char == summon_kin_type) && (r_idx != MON_HAGURE));
+ break;
+ }
- case SUMMON_ANIMAL_RANGER:
- {
- okay = ((r_ptr->flags3 & (RF3_ANIMAL)) &&
- (my_strchr("abcflqrwBCHIJKMRS", r_ptr->d_char)) &&
- !(r_ptr->flags3 & (RF3_DRAGON)) &&
- !(r_ptr->flags3 & (RF3_EVIL)) &&
- !(r_ptr->flags3 & (RF3_UNDEAD)) &&
- !(r_ptr->flags3 & (RF3_DEMON)) &&
- !(r_ptr->flags2 & (RF2_MULTIPLY)) &&
- !(r_ptr->flags4 || r_ptr->a_ability_flags1 || r_ptr->a_ability_flags2));
- break;
- }
+ case SUMMON_DAWN:
+ {
+ okay = (r_idx == MON_DAWN);
+ break;
+ }
- case SUMMON_HI_DRAGON_LIVING:
- {
- okay = ((r_ptr->d_char == 'D') && monster_living(r_idx));
- break;
- }
+ case SUMMON_ANIMAL:
+ {
+ okay = (r_ptr->flags3 & (RF3_ANIMAL));
+ break;
+ }
- case SUMMON_LIVING:
- {
- okay = monster_living(r_idx);
- break;
- }
+ case SUMMON_ANIMAL_RANGER:
+ {
+ okay = ((r_ptr->flags3 & (RF3_ANIMAL)) &&
+ (my_strchr("abcflqrwBCHIJKMRS", r_ptr->d_char)) &&
+ !(r_ptr->flags3 & (RF3_DRAGON)) &&
+ !(r_ptr->flags3 & (RF3_EVIL)) &&
+ !(r_ptr->flags3 & (RF3_UNDEAD)) &&
+ !(r_ptr->flags3 & (RF3_DEMON)) &&
+ !(r_ptr->flags2 & (RF2_MULTIPLY)) &&
+ !(r_ptr->flags4 || r_ptr->a_ability_flags1 || r_ptr->a_ability_flags2));
+ break;
+ }
- case SUMMON_PHANTOM:
- {
- okay = (r_idx == MON_PHANTOM_B || r_idx == MON_PHANTOM_W);
- break;
- }
+ case SUMMON_HI_DRAGON_LIVING:
+ {
+ okay = ((r_ptr->d_char == 'D') && monster_living(r_idx));
+ break;
+ }
- case SUMMON_BLUE_HORROR:
- {
- okay = (r_idx == MON_BLUE_HORROR);
- break;
- }
+ case SUMMON_LIVING:
+ {
+ okay = monster_living(r_idx);
+ break;
+ }
- case SUMMON_ELEMENTAL:
- {
- okay = (r_ptr->d_char == 'E');
- break;
- }
+ case SUMMON_PHANTOM:
+ {
+ okay = (r_idx == MON_PHANTOM_B || r_idx == MON_PHANTOM_W);
+ break;
+ }
- case SUMMON_VORTEX:
- {
- okay = (r_ptr->d_char == 'v');
- break;
- }
+ case SUMMON_BLUE_HORROR:
+ {
+ okay = (r_idx == MON_BLUE_HORROR);
+ break;
+ }
- case SUMMON_HYBRID:
- {
- okay = (r_ptr->d_char == 'H');
- break;
- }
+ case SUMMON_ELEMENTAL:
+ {
+ okay = (r_ptr->d_char == 'E');
+ break;
+ }
- case SUMMON_BIRD:
- {
- okay = (r_ptr->d_char == 'B');
- break;
- }
+ case SUMMON_VORTEX:
+ {
+ okay = (r_ptr->d_char == 'v');
+ break;
+ }
- case SUMMON_KAMIKAZE:
- {
- int i;
- for (i = 0; i < 4; i++)
- if (r_ptr->blow[i].method == RBM_EXPLODE) okay = TRUE;
- break;
- }
+ case SUMMON_HYBRID:
+ {
+ okay = (r_ptr->d_char == 'H');
+ break;
+ }
- case SUMMON_KAMIKAZE_LIVING:
- {
- int i;
+ case SUMMON_BIRD:
+ {
+ okay = (r_ptr->d_char == 'B');
+ break;
+ }
- for (i = 0; i < 4; i++)
- if (r_ptr->blow[i].method == RBM_EXPLODE) okay = TRUE;
- okay = (okay && monster_living(r_idx));
- break;
- }
+ case SUMMON_KAMIKAZE:
+ {
+ int i;
+ for (i = 0; i < 4; i++)
+ if (r_ptr->blow[i].method == RBM_EXPLODE) okay = TRUE;
+ break;
+ }
- case SUMMON_MANES:
- {
- okay = (r_idx == MON_MANES);
- break;
- }
+ case SUMMON_KAMIKAZE_LIVING:
+ {
+ int i;
- case SUMMON_LOUSE:
- {
- okay = (r_idx == MON_LOUSE);
- break;
- }
+ for (i = 0; i < 4; i++)
+ if (r_ptr->blow[i].method == RBM_EXPLODE) okay = TRUE;
+ okay = (okay && monster_living(r_idx));
+ break;
+ }
- case SUMMON_GUARDIANS:
- {
- okay = (r_ptr->flags7 & RF7_GUARDIAN);
- break;
- }
+ case SUMMON_MANES:
+ {
+ okay = (r_idx == MON_MANES);
+ break;
+ }
- case SUMMON_KNIGHTS:
- {
- okay = ((r_idx == MON_NOV_PALADIN) ||
- (r_idx == MON_NOV_PALADIN_G) ||
- (r_idx == MON_PALADIN) ||
- (r_idx == MON_W_KNIGHT) ||
- (r_idx == MON_ULTRA_PALADIN) ||
- (r_idx == MON_KNI_TEMPLAR));
- break;
- }
+ case SUMMON_LOUSE:
+ {
+ okay = (r_idx == MON_LOUSE);
+ break;
+ }
- case SUMMON_EAGLES:
- {
- okay = (r_ptr->d_char == 'B' &&
- (r_ptr->flags8 & RF8_WILD_MOUNTAIN) &&
- (r_ptr->flags8 & RF8_WILD_ONLY));
- break;
- }
+ case SUMMON_GUARDIANS:
+ {
+ okay = (r_ptr->flags7 & RF7_GUARDIAN);
+ break;
+ }
- case SUMMON_PIRANHAS:
- {
- okay = (r_idx == MON_PIRANHA);
- break;
- }
+ case SUMMON_KNIGHTS:
+ {
+ okay = ((r_idx == MON_NOV_PALADIN) ||
+ (r_idx == MON_NOV_PALADIN_G) ||
+ (r_idx == MON_PALADIN) ||
+ (r_idx == MON_W_KNIGHT) ||
+ (r_idx == MON_ULTRA_PALADIN) ||
+ (r_idx == MON_KNI_TEMPLAR));
+ break;
+ }
- case SUMMON_ARMAGE_GOOD:
- {
- okay = (r_ptr->d_char == 'A' && (r_ptr->flags3 & RF3_GOOD));
- break;
- }
+ case SUMMON_EAGLES:
+ {
+ okay = (r_ptr->d_char == 'B' &&
+ (r_ptr->flags8 & RF8_WILD_MOUNTAIN) &&
+ (r_ptr->flags8 & RF8_WILD_ONLY));
+ break;
+ }
- case SUMMON_ARMAGE_EVIL:
- {
- okay = ((r_ptr->flags3 & RF3_DEMON) ||
- (r_ptr->d_char == 'A' && (r_ptr->flags3 & RF3_EVIL)));
- break;
- }
+ case SUMMON_PIRANHAS:
+ {
+ okay = (r_idx == MON_PIRANHA);
+ break;
+ }
+
+ case SUMMON_ARMAGE_GOOD:
+ {
+ okay = (r_ptr->d_char == 'A' && (r_ptr->flags3 & RF3_GOOD));
+ break;
+ }
+
+ case SUMMON_ARMAGE_EVIL:
+ {
+ okay = ((r_ptr->flags3 & RF3_DEMON) ||
+ (r_ptr->d_char == 'A' && (r_ptr->flags3 & RF3_EVIL)));
+ break;
+ }
}
/* Since okay is int, "return (okay);" is not correct. */
return (bool)(okay ? TRUE : FALSE);
if (d_ptr->flags1 & DF1_NO_MAGIC)
{
if (r_idx != MON_CHAMELEON &&
- r_ptr->freq_spell &&
- !(r_ptr->flags4 & RF4_NOMAGIC_MASK) &&
- !(r_ptr->a_ability_flags1 & RF5_NOMAGIC_MASK) &&
- !(r_ptr->a_ability_flags2 & RF6_NOMAGIC_MASK))
+ r_ptr->freq_spell &&
+ !(r_ptr->flags4 & RF4_NOMAGIC_MASK) &&
+ !(r_ptr->a_ability_flags1 & RF5_NOMAGIC_MASK) &&
+ !(r_ptr->a_ability_flags2 & RF6_NOMAGIC_MASK))
return FALSE;
}
{
if (r_idx == MON_CHAMELEON) return TRUE;
if (!(r_ptr->flags4 & (RF4_BOLT_MASK | RF4_BEAM_MASK | RF4_BALL_MASK)) &&
- !(r_ptr->a_ability_flags1 & (RF5_BOLT_MASK | RF5_BEAM_MASK | RF5_BALL_MASK | RF5_CAUSE_1 | RF5_CAUSE_2 | RF5_CAUSE_3 | RF5_CAUSE_4 | RF5_MIND_BLAST | RF5_BRAIN_SMASH)) &&
- !(r_ptr->a_ability_flags2 & (RF6_BOLT_MASK | RF6_BEAM_MASK | RF6_BALL_MASK)))
+ !(r_ptr->a_ability_flags1 & (RF5_BOLT_MASK | RF5_BEAM_MASK | RF5_BALL_MASK | RF5_CAUSE_1 | RF5_CAUSE_2 | RF5_CAUSE_3 | RF5_CAUSE_4 | RF5_MIND_BLAST | RF5_BRAIN_SMASH)) &&
+ !(r_ptr->a_ability_flags2 & (RF6_BOLT_MASK | RF6_BEAM_MASK | RF6_BALL_MASK)))
return FALSE;
}
* @return エラーコード
*/
errr get_mon_num_prep(monsterrace_hook_type monster_hook,
- monsterrace_hook_type monster_hook2)
+ monsterrace_hook_type monster_hook2)
{
int i;
for (i = 0; i < alloc_race_size; i++)
{
monster_race *r_ptr;
-
+
/* Get the entry */
alloc_entry *entry = &alloc_race_table[i];
/* Skip monsters which don't pass the restriction */
if ((get_mon_num_hook && !((*get_mon_num_hook)(entry->index))) ||
- (get_mon_num2_hook && !((*get_mon_num2_hook)(entry->index))))
+ (get_mon_num2_hook && !((*get_mon_num2_hook)(entry->index))))
continue;
if (!p_ptr->phase_out && !chameleon_change_m_idx &&
- summon_specific_type != SUMMON_GUARDIANS)
+ summon_specific_type != SUMMON_GUARDIANS)
{
/* Hack -- don't create questors */
if (r_ptr->flags1 & RF1_QUESTOR)
/* Depth Monsters never appear out of depth */
if ((r_ptr->flags1 & (RF1_FORCE_DEPTH)) &&
- (r_ptr->level > floor_ptr->dun_level))
+ (r_ptr->level > floor_ptr->dun_level))
continue;
}
int delay = mysqrt(level * 10000L) + 400L;
pls_kakuritu = MAX(NASTY_MON_MAX, NASTY_MON_BASE - ((current_world_ptr->dungeon_turn / (TURNS_PER_TICK * 5000L) - delay / 10)));
- pls_level = MIN(NASTY_MON_PLUS_MAX, 3 + current_world_ptr->dungeon_turn / (TURNS_PER_TICK * 40000L) - delay / 40 + MIN(5, level / 10)) ;
+ pls_level = MIN(NASTY_MON_PLUS_MAX, 3 + current_world_ptr->dungeon_turn / (TURNS_PER_TICK * 40000L) - delay / 40 + MIN(5, level / 10));
if (d_info[p_ptr->dungeon_idx].flags1 & DF1_MAZE)
{
{
/* Hack -- "unique" monsters must be "unique" */
if (((r_ptr->flags1 & (RF1_UNIQUE)) ||
- (r_ptr->flags7 & (RF7_NAZGUL))) &&
- (r_ptr->cur_num >= r_ptr->max_num))
+ (r_ptr->flags7 & (RF7_NAZGUL))) &&
+ (r_ptr->cur_num >= r_ptr->max_num))
{
continue;
}
if ((r_ptr->flags7 & (RF7_UNIQUE2)) &&
- (r_ptr->cur_num >= 1))
+ (r_ptr->cur_num >= 1))
{
continue;
}
do
{
hallu_race = &r_info[randint1(max_r_idx - 1)];
- }
- while (!hallu_race->name || (hallu_race->flags1 & RF1_UNIQUE));
+ } while (!hallu_race->name || (hallu_race->flags1 & RF1_UNIQUE));
strcpy(silly_name, (r_name + hallu_race->name));
}
{
/* Neuter, or unknown */
#ifdef JP
- case 0x00: res = "何か"; break;
- case 0x00 + (MD_OBJECTIVE): res = "何か"; break;
- case 0x00 + (MD_POSSESSIVE): res = "何かの"; break;
- case 0x00 + (MD_POSSESSIVE | MD_OBJECTIVE): res = "何か自身"; break;
- case 0x00 + (MD_INDEF_HIDDEN): res = "何か"; break;
- case 0x00 + (MD_INDEF_HIDDEN | MD_OBJECTIVE): res = "何か"; break;
- case 0x00 + (MD_INDEF_HIDDEN | MD_POSSESSIVE): res = "何か"; break;
- case 0x00 + (MD_INDEF_HIDDEN | MD_POSSESSIVE | MD_OBJECTIVE): res = "それ自身"; break;
+ case 0x00: res = "何か"; break;
+ case 0x00 + (MD_OBJECTIVE) : res = "何か"; break;
+ case 0x00 + (MD_POSSESSIVE) : res = "何かの"; break;
+ case 0x00 + (MD_POSSESSIVE | MD_OBJECTIVE) : res = "何か自身"; break;
+ case 0x00 + (MD_INDEF_HIDDEN) : res = "何か"; break;
+ case 0x00 + (MD_INDEF_HIDDEN | MD_OBJECTIVE) : res = "何か"; break;
+ case 0x00 + (MD_INDEF_HIDDEN | MD_POSSESSIVE) : res = "何か"; break;
+ case 0x00 + (MD_INDEF_HIDDEN | MD_POSSESSIVE | MD_OBJECTIVE) : res = "それ自身"; break;
#else
- case 0x00: res = "it"; break;
- case 0x00 + (MD_OBJECTIVE): res = "it"; break;
- case 0x00 + (MD_POSSESSIVE): res = "its"; break;
- case 0x00 + (MD_POSSESSIVE | MD_OBJECTIVE): res = "itself"; break;
- case 0x00 + (MD_INDEF_HIDDEN): res = "something"; break;
- case 0x00 + (MD_INDEF_HIDDEN | MD_OBJECTIVE): res = "something"; break;
- case 0x00 + (MD_INDEF_HIDDEN | MD_POSSESSIVE): res = "something's"; break;
- case 0x00 + (MD_INDEF_HIDDEN | MD_POSSESSIVE | MD_OBJECTIVE): res = "itself"; break;
+ case 0x00: res = "it"; break;
+ case 0x00 + (MD_OBJECTIVE) : res = "it"; break;
+ case 0x00 + (MD_POSSESSIVE) : res = "its"; break;
+ case 0x00 + (MD_POSSESSIVE | MD_OBJECTIVE) : res = "itself"; break;
+ case 0x00 + (MD_INDEF_HIDDEN) : res = "something"; break;
+ case 0x00 + (MD_INDEF_HIDDEN | MD_OBJECTIVE) : res = "something"; break;
+ case 0x00 + (MD_INDEF_HIDDEN | MD_POSSESSIVE) : res = "something's"; break;
+ case 0x00 + (MD_INDEF_HIDDEN | MD_POSSESSIVE | MD_OBJECTIVE) : res = "itself"; break;
#endif
- /* Male (assume human if vague) */
+ /* Male (assume human if vague) */
#ifdef JP
- case 0x10: res = "彼"; break;
- case 0x10 + (MD_OBJECTIVE): res = "彼"; break;
- case 0x10 + (MD_POSSESSIVE): res = "彼の"; break;
- case 0x10 + (MD_POSSESSIVE | MD_OBJECTIVE): res = "彼自身"; break;
- case 0x10 + (MD_INDEF_HIDDEN): res = "誰か"; break;
- case 0x10 + (MD_INDEF_HIDDEN | MD_OBJECTIVE): res = "誰か"; break;
- case 0x10 + (MD_INDEF_HIDDEN | MD_POSSESSIVE): res = "誰かの"; break;
- case 0x10 + (MD_INDEF_HIDDEN | MD_POSSESSIVE | MD_OBJECTIVE): res = "彼自身"; break;
+ case 0x10: res = "彼"; break;
+ case 0x10 + (MD_OBJECTIVE) : res = "彼"; break;
+ case 0x10 + (MD_POSSESSIVE) : res = "彼の"; break;
+ case 0x10 + (MD_POSSESSIVE | MD_OBJECTIVE) : res = "彼自身"; break;
+ case 0x10 + (MD_INDEF_HIDDEN) : res = "誰か"; break;
+ case 0x10 + (MD_INDEF_HIDDEN | MD_OBJECTIVE) : res = "誰か"; break;
+ case 0x10 + (MD_INDEF_HIDDEN | MD_POSSESSIVE) : res = "誰かの"; break;
+ case 0x10 + (MD_INDEF_HIDDEN | MD_POSSESSIVE | MD_OBJECTIVE) : res = "彼自身"; break;
#else
- case 0x10: res = "he"; break;
- case 0x10 + (MD_OBJECTIVE): res = "him"; break;
- case 0x10 + (MD_POSSESSIVE): res = "his"; break;
- case 0x10 + (MD_POSSESSIVE | MD_OBJECTIVE): res = "himself"; break;
- case 0x10 + (MD_INDEF_HIDDEN): res = "someone"; break;
- case 0x10 + (MD_INDEF_HIDDEN | MD_OBJECTIVE): res = "someone"; break;
- case 0x10 + (MD_INDEF_HIDDEN | MD_POSSESSIVE): res = "someone's"; break;
- case 0x10 + (MD_INDEF_HIDDEN | MD_POSSESSIVE | MD_OBJECTIVE): res = "himself"; break;
+ case 0x10: res = "he"; break;
+ case 0x10 + (MD_OBJECTIVE) : res = "him"; break;
+ case 0x10 + (MD_POSSESSIVE) : res = "his"; break;
+ case 0x10 + (MD_POSSESSIVE | MD_OBJECTIVE) : res = "himself"; break;
+ case 0x10 + (MD_INDEF_HIDDEN) : res = "someone"; break;
+ case 0x10 + (MD_INDEF_HIDDEN | MD_OBJECTIVE) : res = "someone"; break;
+ case 0x10 + (MD_INDEF_HIDDEN | MD_POSSESSIVE) : res = "someone's"; break;
+ case 0x10 + (MD_INDEF_HIDDEN | MD_POSSESSIVE | MD_OBJECTIVE) : res = "himself"; break;
#endif
- /* Female (assume human if vague) */
+ /* Female (assume human if vague) */
#ifdef JP
- case 0x20: res = "彼女"; break;
- case 0x20 + (MD_OBJECTIVE): res = "彼女"; break;
- case 0x20 + (MD_POSSESSIVE): res = "彼女の"; break;
- case 0x20 + (MD_POSSESSIVE | MD_OBJECTIVE): res = "彼女自身"; break;
- case 0x20 + (MD_INDEF_HIDDEN): res = "誰か"; break;
- case 0x20 + (MD_INDEF_HIDDEN | MD_OBJECTIVE): res = "誰か"; break;
- case 0x20 + (MD_INDEF_HIDDEN | MD_POSSESSIVE): res = "誰かの"; break;
- case 0x20 + (MD_INDEF_HIDDEN | MD_POSSESSIVE | MD_OBJECTIVE): res = "彼女自身"; break;
+ case 0x20: res = "彼女"; break;
+ case 0x20 + (MD_OBJECTIVE) : res = "彼女"; break;
+ case 0x20 + (MD_POSSESSIVE) : res = "彼女の"; break;
+ case 0x20 + (MD_POSSESSIVE | MD_OBJECTIVE) : res = "彼女自身"; break;
+ case 0x20 + (MD_INDEF_HIDDEN) : res = "誰か"; break;
+ case 0x20 + (MD_INDEF_HIDDEN | MD_OBJECTIVE) : res = "誰か"; break;
+ case 0x20 + (MD_INDEF_HIDDEN | MD_POSSESSIVE) : res = "誰かの"; break;
+ case 0x20 + (MD_INDEF_HIDDEN | MD_POSSESSIVE | MD_OBJECTIVE) : res = "彼女自身"; break;
#else
- case 0x20: res = "she"; break;
- case 0x20 + (MD_OBJECTIVE): res = "her"; break;
- case 0x20 + (MD_POSSESSIVE): res = "her"; break;
- case 0x20 + (MD_POSSESSIVE | MD_OBJECTIVE): res = "herself"; break;
- case 0x20 + (MD_INDEF_HIDDEN): res = "someone"; break;
- case 0x20 + (MD_INDEF_HIDDEN | MD_OBJECTIVE): res = "someone"; break;
- case 0x20 + (MD_INDEF_HIDDEN | MD_POSSESSIVE): res = "someone's"; break;
- case 0x20 + (MD_INDEF_HIDDEN | MD_POSSESSIVE | MD_OBJECTIVE): res = "herself"; break;
+ case 0x20: res = "she"; break;
+ case 0x20 + (MD_OBJECTIVE) : res = "her"; break;
+ case 0x20 + (MD_POSSESSIVE) : res = "her"; break;
+ case 0x20 + (MD_POSSESSIVE | MD_OBJECTIVE) : res = "herself"; break;
+ case 0x20 + (MD_INDEF_HIDDEN) : res = "someone"; break;
+ case 0x20 + (MD_INDEF_HIDDEN | MD_OBJECTIVE) : res = "someone"; break;
+ case 0x20 + (MD_INDEF_HIDDEN | MD_POSSESSIVE) : res = "someone's"; break;
+ case 0x20 + (MD_INDEF_HIDDEN | MD_POSSESSIVE | MD_OBJECTIVE) : res = "herself"; break;
#endif
}
char *t;
strcpy(buf, name);
t = buf;
- while(strncmp(t, "』", 2) && *t) t++;
+ while (strncmp(t, "』", 2) && *t) t++;
if (*t)
{
*t = '\0';
}
else
- /* It could be a Unique */
- if ((r_ptr->flags1 & RF1_UNIQUE) && !(p_ptr->image && !(mode & MD_IGNORE_HALLU)))
- {
- /* Start with the name (thus nominative and objective) */
- if ((m_ptr->mflag2 & MFLAG2_CHAMELEON) && !(mode & MD_TRUE_NAME))
+ /* It could be a Unique */
+ if ((r_ptr->flags1 & RF1_UNIQUE) && !(p_ptr->image && !(mode & MD_IGNORE_HALLU)))
{
-#ifdef JP
- char *t;
- strcpy(buf, name);
- t = buf;
- while (strncmp(t, "』", 2) && *t) t++;
- if (*t)
+ /* Start with the name (thus nominative and objective) */
+ if ((m_ptr->mflag2 & MFLAG2_CHAMELEON) && !(mode & MD_TRUE_NAME))
{
- *t = '\0';
- (void)sprintf(desc, "%s?』", buf);
- }
- else
- (void)sprintf(desc, "%s?", name);
+#ifdef JP
+ char *t;
+ strcpy(buf, name);
+ t = buf;
+ while (strncmp(t, "』", 2) && *t) t++;
+ if (*t)
+ {
+ *t = '\0';
+ (void)sprintf(desc, "%s?』", buf);
+ }
+ else
+ (void)sprintf(desc, "%s?", name);
#else
- (void)sprintf(desc, "%s?", name);
+ (void)sprintf(desc, "%s?", name);
#endif
- }
+ }
- /* Inside monster arena, and it is not your mount */
- else if (p_ptr->phase_out &&
- !(p_ptr->riding && (&floor_ptr->m_list[p_ptr->riding] == m_ptr)))
- {
- /* It is a fake unique monster */
- (void)sprintf(desc, _("%sもどき", "fake %s"), name);
- }
+ /* Inside monster arena, and it is not your mount */
+ else if (p_ptr->phase_out &&
+ !(p_ptr->riding && (&floor_ptr->m_list[p_ptr->riding] == m_ptr)))
+ {
+ /* It is a fake unique monster */
+ (void)sprintf(desc, _("%sもどき", "fake %s"), name);
+ }
- else
- {
- (void)strcpy(desc, name);
+ else
+ {
+ (void)strcpy(desc, name);
+ }
}
- }
/* It could be an indefinite monster */
- else if (mode & MD_INDEF_VISIBLE)
- {
- /* XXX Check plurality for "some" */
+ else if (mode & MD_INDEF_VISIBLE)
+ {
+ /* XXX Check plurality for "some" */
- /* Indefinite monsters need an indefinite article */
+ /* Indefinite monsters need an indefinite article */
#ifdef JP
- (void)strcpy(desc, "");
+ (void)strcpy(desc, "");
#else
- (void)strcpy(desc, is_a_vowel(name[0]) ? "an " : "a ");
+ (void)strcpy(desc, is_a_vowel(name[0]) ? "an " : "a ");
#endif
- (void)strcat(desc, name);
- }
+ (void)strcat(desc, name);
+ }
/* It could be a normal, definite, monster */
- else
- {
- /* Definite monsters need a definite article */
- if (is_pet(m_ptr))
- (void)strcpy(desc, _("あなたの", "your "));
else
- (void)strcpy(desc, _("", "the "));
+ {
+ /* Definite monsters need a definite article */
+ if (is_pet(m_ptr))
+ (void)strcpy(desc, _("あなたの", "your "));
+ else
+ (void)strcpy(desc, _("", "the "));
- (void)strcat(desc, name);
- }
+ (void)strcat(desc, name);
+ }
if (m_ptr->nickname)
{
- sprintf(buf,_("「%s」", " called %s"),quark_str(m_ptr->nickname));
- strcat(desc,buf);
+ sprintf(buf, _("「%s」", " called %s"), quark_str(m_ptr->nickname));
+ strcat(desc, buf);
}
if (p_ptr->riding && (&floor_ptr->m_list[p_ptr->riding] == m_ptr))
{
- strcat(desc,_("(乗馬中)", "(riding)"));
+ strcat(desc, _("(乗馬中)", "(riding)"));
}
if ((mode & MD_IGNORE_HALLU) && (m_ptr->mflag2 & MFLAG2_CHAMELEON))
{
if (r_ptr->flags1 & RF1_UNIQUE)
{
- strcat(desc,_("(カメレオンの王)", "(Chameleon Lord)"));
+ strcat(desc, _("(カメレオンの王)", "(Chameleon Lord)"));
}
else
{
- strcat(desc,_("(カメレオン)", "(Chameleon)"));
+ strcat(desc, _("(カメレオン)", "(Chameleon)"));
}
}
if (mode & MD_POSSESSIVE)
{
/* XXX Check for trailing "s" */
-
+
/* Simply append "apostrophe" and "s" */
(void)strcat(desc, _("の", "'s"));
}
/* Maximal drops */
tmp_byte =
(((r_ptr->flags1 & RF1_DROP_4D2) ? 8 : 0) +
- ((r_ptr->flags1 & RF1_DROP_3D2) ? 6 : 0) +
- ((r_ptr->flags1 & RF1_DROP_2D2) ? 4 : 0) +
- ((r_ptr->flags1 & RF1_DROP_1D2) ? 2 : 0) +
- ((r_ptr->flags1 & RF1_DROP_90) ? 1 : 0) +
- ((r_ptr->flags1 & RF1_DROP_60) ? 1 : 0));
+ ((r_ptr->flags1 & RF1_DROP_3D2) ? 6 : 0) +
+ ((r_ptr->flags1 & RF1_DROP_2D2) ? 4 : 0) +
+ ((r_ptr->flags1 & RF1_DROP_1D2) ? 2 : 0) +
+ ((r_ptr->flags1 & RF1_DROP_90) ? 1 : 0) +
+ ((r_ptr->flags1 & RF1_DROP_60) ? 1 : 0));
/* Only "valid" drops */
if (!(r_ptr->flags1 & RF1_ONLY_GOLD))
for (i = 0; i < 32; i++)
{
if (!(r_ptr->r_flags1 & (1L << i)) &&
- (r_ptr->flags1 & (1L << i))) n++;
+ (r_ptr->flags1 & (1L << i))) n++;
if (!(r_ptr->r_flags2 & (1L << i)) &&
- (r_ptr->flags2 & (1L << i))) n++;
+ (r_ptr->flags2 & (1L << i))) n++;
if (!(r_ptr->r_flags3 & (1L << i)) &&
- (r_ptr->flags3 & (1L << i))) n++;
+ (r_ptr->flags3 & (1L << i))) n++;
if (!(r_ptr->r_flags4 & (1L << i)) &&
- (r_ptr->flags4 & (1L << i))) n++;
+ (r_ptr->flags4 & (1L << i))) n++;
if (!(r_ptr->r_flags5 & (1L << i)) &&
- (r_ptr->a_ability_flags1 & (1L << i))) n++;
+ (r_ptr->a_ability_flags1 & (1L << i))) n++;
if (!(r_ptr->r_flags6 & (1L << i)) &&
- (r_ptr->a_ability_flags2 & (1L << i))) n++;
+ (r_ptr->a_ability_flags2 & (1L << i))) n++;
if (!(r_ptr->r_flagsr & (1L << i)) &&
- (r_ptr->flagsr & (1L << i))) n++;
+ (r_ptr->flagsr & (1L << i))) n++;
/* r_flags7 is actually unused */
}
int dx = (subject_ptr->x > fx) ? (subject_ptr->x - fx) : (fx - subject_ptr->x);
/* Approximate distance */
- d = (dy > dx) ? (dy + (dx>>1)) : (dx + (dy>>1));
+ d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
/* Restrict distance */
if (d > 255) d = 255;
}
if ((subject_ptr->esp_nonliving) &&
- ((r_ptr->flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING)) == RF3_NONLIVING))
+ ((r_ptr->flags3 & (RF3_DEMON | RF3_UNDEAD | RF3_NONLIVING)) == RF3_NONLIVING))
{
flag = TRUE;
if (is_original_ap(m_ptr) && !subject_ptr->image) r_ptr->r_flags3 |= (RF3_NONLIVING);
if (r_ptr->flags1 & (RF1_UNIQUE)) return FALSE;
if (r_ptr->flags2 & RF2_MULTIPLY) return FALSE;
if (r_ptr->flags7 & (RF7_FRIENDLY | RF7_CHAMELEON)) return FALSE;
-
+
if ((r_ptr->blow[0].method == RBM_EXPLODE) || (r_ptr->blow[1].method == RBM_EXPLODE) || (r_ptr->blow[2].method == RBM_EXPLODE) || (r_ptr->blow[3].method == RBM_EXPLODE))
return FALSE;
else
level = floor_ptr->dun_level;
- if (d_info[p_ptr->dungeon_idx].flags1 & DF1_CHAMELEON) level+= 2+randint1(3);
+ if (d_info[p_ptr->dungeon_idx].flags1 & DF1_CHAMELEON) level += 2 + randint1(3);
r_idx = get_mon_num(level);
r_ptr = &r_info[r_idx];
lite_spot(m_ptr->fy, m_ptr->fx);
if ((r_info[old_r_idx].flags7 & (RF7_LITE_MASK | RF7_DARK_MASK)) ||
- (r_ptr->flags7 & (RF7_LITE_MASK | RF7_DARK_MASK)))
+ (r_ptr->flags7 & (RF7_LITE_MASK | RF7_DARK_MASK)))
p_ptr->update |= (PU_MON_LITE);
if (born)
m_ptr->maxhp = (long)(m_ptr->maxhp * m_ptr->max_maxhp) / oldmaxhp;
if (m_ptr->maxhp < 1) m_ptr->maxhp = 1;
m_ptr->hp = (long)(m_ptr->hp * m_ptr->max_maxhp) / oldmaxhp;
-
+
/* reset dealt_damage */
m_ptr->dealt_damage = 0;
}
if (r_ptr->flags2 & RF2_MULTIPLY) return FALSE;
if (r_ptr->flags7 & (RF7_FRIENDLY | RF7_CHAMELEON)) return FALSE;
if (r_ptr->flags7 & RF7_AQUATIC) return FALSE;
-
+
if ((r_ptr->blow[0].method == RBM_EXPLODE) || (r_ptr->blow[1].method == RBM_EXPLODE) || (r_ptr->blow[2].method == RBM_EXPLODE) || (r_ptr->blow[3].method == RBM_EXPLODE))
return FALSE;
* @param r_idx 生成モンスター種族
* @param mode 生成オプション
* @return 成功したらtrue
- * @details
+ * @details
* To give the player a sporting chance, any monster that appears in
* line-of-sight and is extremely dangerous can be marked as
* "FORCE_SLEEP", which will cause them to be placed with low energy,
{
/* Hack -- "unique" monsters must be "unique" */
if (((r_ptr->flags1 & (RF1_UNIQUE)) ||
- (r_ptr->flags7 & (RF7_NAZGUL))) &&
- (r_ptr->cur_num >= r_ptr->max_num))
+ (r_ptr->flags7 & (RF7_NAZGUL))) &&
+ (r_ptr->cur_num >= r_ptr->max_num))
{
/* Cannot create */
return FALSE;
}
if ((r_ptr->flags7 & (RF7_UNIQUE2)) &&
- (r_ptr->cur_num >= 1))
+ (r_ptr->cur_num >= 1))
{
return FALSE;
}
/* Depth monsters may NOT be created out of depth, unless in Nightmare mode */
if ((r_ptr->flags1 & (RF1_FORCE_DEPTH)) && (floor_ptr->dun_level < r_ptr->level) &&
- (!ironman_nightmare || (r_ptr->flags1 & (RF1_QUESTOR))))
+ (!ironman_nightmare || (r_ptr->flags1 & (RF1_QUESTOR))))
{
/* Cannot create */
return FALSE;
int hoge = quest_number(p_ptr, floor_ptr->dun_level);
if ((quest[hoge].type == QUEST_TYPE_KILL_LEVEL) || (quest[hoge].type == QUEST_TYPE_RANDOM))
{
- if(r_idx == quest[hoge].r_idx)
+ if (r_idx == quest[hoge].r_idx)
{
int number_mon, i2, j2;
number_mon = 0;
if (floor_ptr->grid_array[j2][i2].m_idx > 0)
if (floor_ptr->m_list[floor_ptr->grid_array[j2][i2].m_idx].r_idx == quest[hoge].r_idx)
number_mon++;
- if(number_mon + quest[hoge].cur_num >= quest[hoge].max_num)
+ if (number_mon + quest[hoge].cur_num >= quest[hoge].max_num)
return FALSE;
}
}
if (is_glyph_grid(g_ptr))
{
- if (randint1(BREAK_GLYPH) < (r_ptr->level+20))
+ if (randint1(BREAK_GLYPH) < (r_ptr->level + 20))
{
/* Describe observable breakage */
if (g_ptr->info & CAVE_MARK)
}
/* Friendly? */
else if ((r_ptr->flags7 & RF7_FRIENDLY) ||
- (mode & PM_FORCE_FRIENDLY) || is_friendly_idx(who))
+ (mode & PM_FORCE_FRIENDLY) || is_friendly_idx(who))
{
if (!monster_has_hostile_align(NULL, 0, -1, r_ptr)) set_friendly(m_ptr);
}
if (m_ptr->r_idx == MON_WOUNDED_BEAR)
m_ptr->hp = m_ptr->maxhp / 2;
else m_ptr->hp = m_ptr->maxhp;
-
-
+
+
/* dealt damage is 0 at initial*/
m_ptr->dealt_damage = 0;
m_ptr->mspeed = get_mspeed(r_ptr);
if (mode & PM_HASTE) (void)set_monster_fast(p_ptr, g_ptr->m_idx, 100);
-
+
/* Give a random starting energy */
if (!ironman_nightmare)
{
* A unique monster move from old saved floor.
*/
if (current_world_ptr->character_dungeon &&
- ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL)))
+ ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL)))
real_r_ptr(m_ptr)->floor_id = p_ptr->floor_id;
/* Hack -- Count the number of "reproducers" */
* @param x 中心生成位置x座標
* @param max_dist 生成位置の最大半径
* @return 成功したらtrue
- *
+ *
*/
static bool mon_scatter(MONRACE_IDX r_idx, POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION max_dist)
{
place_monster_m_idx = hack_m_idx_ii;
/* Reinforcement */
- for(i = 0; i < 6; i++)
+ for (i = 0; i < 6; i++)
{
- if(!r_ptr->reinforce_id[i]) break;
+ if (!r_ptr->reinforce_id[i]) break;
n = damroll(r_ptr->reinforce_dd[i], r_ptr->reinforce_ds[i]);
- for(j = 0; j < n; j++)
+ for (j = 0; j < n; j++)
{
POSITION nx, ny, d = 7;
scatter(p_ptr, &ny, &nx, y, x, d, 0);
for (i = 0; i < 32; i++)
{
POSITION nx, ny, d = 3;
- MONRACE_IDX z;
+ MONRACE_IDX z;
/* Pick a location */
scatter(p_ptr, &ny, &nx, y, x, d, 0);
/* Place a "group" of escorts if needed */
if ((r_info[z].flags1 & RF1_FRIENDS) ||
- (r_ptr->flags1 & RF1_ESCORTS))
+ (r_ptr->flags1 & RF1_ESCORTS))
{
/* Place a group of monsters */
(void)place_monster_group(place_monster_m_idx, ny, nx, z, mode);
if (!summon_specific_type) return TRUE;
if ((summon_specific_who < 0) &&
- ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL)) &&
- monster_has_hostile_align(NULL, 10, -10, r_ptr))
+ ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL)) &&
+ monster_has_hostile_align(NULL, 10, -10, r_ptr))
return FALSE;
if ((r_ptr->flags7 & RF7_CHAMELEON) && (d_info[p_ptr->dungeon_idx].flags1 & DF1_CHAMELEON)) return TRUE;
* @param x1 目標地点x座標
* @param lev 相当生成階
* @param type 召喚種別
- * @param mode 生成オプション
+ * @param mode 生成オプション
* @return 召喚できたらtrueを返す
* @details
*
* @param oy 目標地点y座標
* @param ox 目標地点x座標
* @param r_idx 生成するモンスター種族ID
- * @param mode 生成オプション
+ * @param mode 生成オプション
* @return 召喚できたらtrueを返す
*/
bool summon_named_creature(MONSTER_IDX who, POSITION oy, POSITION ox, MONRACE_IDX r_idx, BIT_FLAGS mode)
* @brief モンスターを増殖生成する / Let the given monster attempt to reproduce.
* @param m_idx 増殖するモンスター情報ID
* @param clone クローン・モンスター処理ならばtrue
- * @param mode 生成オプション
+ * @param mode 生成オプション
* @return 生成できたらtrueを返す
* @details
* Note that "reproduction" REQUIRES empty space.
monster_desc(m_name, m_ptr, 0);
- if(dam == 0) // Notice non-damage
+ if (dam == 0) // Notice non-damage
{
msg_format(_("%^sはダメージを受けていない。", "%^s is unharmed."), m_name);
return;
tmp = (newhp * 100L) / oldhp;
percentage = tmp;
- if(my_strchr(",ejmvwQ", r_ptr->d_char)) // Mushrooms, Eyes, Jellies, Molds, Vortices, Worms, Quylthulgs
+ if (my_strchr(",ejmvwQ", r_ptr->d_char)) // Mushrooms, Eyes, Jellies, Molds, Vortices, Worms, Quylthulgs
{
#ifdef JP
- if(percentage > 95) msg_format("%^sはほとんど気にとめていない。", m_name);
- else if(percentage > 75) msg_format("%^sはしり込みした。", m_name);
- else if(percentage > 50) msg_format("%^sは縮こまった。", m_name);
- else if(percentage > 35) msg_format("%^sは痛みに震えた。", m_name);
- else if(percentage > 20) msg_format("%^sは身もだえした。", m_name);
- else if(percentage > 10) msg_format("%^sは苦痛で身もだえした。", m_name);
+ if (percentage > 95) msg_format("%^sはほとんど気にとめていない。", m_name);
+ else if (percentage > 75) msg_format("%^sはしり込みした。", m_name);
+ else if (percentage > 50) msg_format("%^sは縮こまった。", m_name);
+ else if (percentage > 35) msg_format("%^sは痛みに震えた。", m_name);
+ else if (percentage > 20) msg_format("%^sは身もだえした。", m_name);
+ else if (percentage > 10) msg_format("%^sは苦痛で身もだえした。", m_name);
else msg_format("%^sはぐにゃぐにゃと痙攣した。", m_name);
#else
- if(percentage > 95) msg_format("%^s barely notices.", m_name);
- else if(percentage > 75) msg_format("%^s flinches.", m_name);
- else if(percentage > 50) msg_format("%^s squelches.", m_name);
- else if(percentage > 35) msg_format("%^s quivers in pain.", m_name);
- else if(percentage > 20) msg_format("%^s writhes about.", m_name);
- else if(percentage > 10) msg_format("%^s writhes in agony.", m_name);
+ if (percentage > 95) msg_format("%^s barely notices.", m_name);
+ else if (percentage > 75) msg_format("%^s flinches.", m_name);
+ else if (percentage > 50) msg_format("%^s squelches.", m_name);
+ else if (percentage > 35) msg_format("%^s quivers in pain.", m_name);
+ else if (percentage > 20) msg_format("%^s writhes about.", m_name);
+ else if (percentage > 10) msg_format("%^s writhes in agony.", m_name);
else msg_format("%^s jerks limply.", m_name);
#endif
}
- else if(my_strchr("l", r_ptr->d_char)) // Fish
+ else if (my_strchr("l", r_ptr->d_char)) // Fish
{
#ifdef JP
- if(percentage > 95) msg_format("%^sはほとんど気にとめていない。", m_name);
- else if(percentage > 75) msg_format("%^sはしり込みした。", m_name);
- else if(percentage > 50) msg_format("%^sは躊躇した。", m_name);
- else if(percentage > 35) msg_format("%^sは痛みに震えた。", m_name);
- else if(percentage > 20) msg_format("%^sは身もだえした。", m_name);
- else if(percentage > 10) msg_format("%^sは苦痛で身もだえした。", m_name);
+ if (percentage > 95) msg_format("%^sはほとんど気にとめていない。", m_name);
+ else if (percentage > 75) msg_format("%^sはしり込みした。", m_name);
+ else if (percentage > 50) msg_format("%^sは躊躇した。", m_name);
+ else if (percentage > 35) msg_format("%^sは痛みに震えた。", m_name);
+ else if (percentage > 20) msg_format("%^sは身もだえした。", m_name);
+ else if (percentage > 10) msg_format("%^sは苦痛で身もだえした。", m_name);
else msg_format("%^sはぐにゃぐにゃと痙攣した。", m_name);
#else
- if(percentage > 95) msg_format("%^s barely notices.", m_name);
- else if(percentage > 75) msg_format("%^s flinches.", m_name);
- else if(percentage > 50) msg_format("%^s hesitates.", m_name);
- else if(percentage > 35) msg_format("%^s quivers in pain.", m_name);
- else if(percentage > 20) msg_format("%^s writhes about.", m_name);
- else if(percentage > 10) msg_format("%^s writhes in agony.", m_name);
+ if (percentage > 95) msg_format("%^s barely notices.", m_name);
+ else if (percentage > 75) msg_format("%^s flinches.", m_name);
+ else if (percentage > 50) msg_format("%^s hesitates.", m_name);
+ else if (percentage > 35) msg_format("%^s quivers in pain.", m_name);
+ else if (percentage > 20) msg_format("%^s writhes about.", m_name);
+ else if (percentage > 10) msg_format("%^s writhes in agony.", m_name);
else msg_format("%^s jerks limply.", m_name);
#endif
}
- else if(my_strchr("g#+<>", r_ptr->d_char)) // Golems, Walls, Doors, Stairs
- {
+ else if (my_strchr("g#+<>", r_ptr->d_char)) // Golems, Walls, Doors, Stairs
+ {
#ifdef JP
- if(percentage > 95) msg_format("%sは攻撃を気にとめていない。", m_name);
- else if(percentage > 75) msg_format("%sは攻撃に肩をすくめた。", m_name);
- else if(percentage > 50) msg_format("%^sは雷鳴のように吠えた。", m_name);
- else if(percentage > 35) msg_format("%^sは苦しげに吠えた。", m_name);
- else if(percentage > 20) msg_format("%^sはうめいた。", m_name);
- else if(percentage > 10) msg_format("%^sは躊躇した。", m_name);
+ if (percentage > 95) msg_format("%sは攻撃を気にとめていない。", m_name);
+ else if (percentage > 75) msg_format("%sは攻撃に肩をすくめた。", m_name);
+ else if (percentage > 50) msg_format("%^sは雷鳴のように吠えた。", m_name);
+ else if (percentage > 35) msg_format("%^sは苦しげに吠えた。", m_name);
+ else if (percentage > 20) msg_format("%^sはうめいた。", m_name);
+ else if (percentage > 10) msg_format("%^sは躊躇した。", m_name);
else msg_format("%^sはくしゃくしゃになった。", m_name);
#else
- if(percentage > 95) msg_format("%^s ignores the attack.", m_name);
- else if(percentage > 75) msg_format("%^s shrugs off the attack.", m_name);
- else if(percentage > 50) msg_format("%^s roars thunderously.", m_name);
- else if(percentage > 35) msg_format("%^s rumbles.", m_name);
- else if(percentage > 20) msg_format("%^s grunts.", m_name);
- else if(percentage > 10) msg_format("%^s hesitates.", m_name);
+ if (percentage > 95) msg_format("%^s ignores the attack.", m_name);
+ else if (percentage > 75) msg_format("%^s shrugs off the attack.", m_name);
+ else if (percentage > 50) msg_format("%^s roars thunderously.", m_name);
+ else if (percentage > 35) msg_format("%^s rumbles.", m_name);
+ else if (percentage > 20) msg_format("%^s grunts.", m_name);
+ else if (percentage > 10) msg_format("%^s hesitates.", m_name);
else msg_format("%^s crumples.", m_name);
#endif
}
- else if(my_strchr("JMR", r_ptr->d_char) || !isalpha(r_ptr->d_char)) // Snakes, Hydrae, Reptiles, Mimics
+ else if (my_strchr("JMR", r_ptr->d_char) || !isalpha(r_ptr->d_char)) // Snakes, Hydrae, Reptiles, Mimics
{
#ifdef JP
- if(percentage > 95) msg_format("%^sはほとんど気にとめていない。", m_name);
- else if(percentage > 75) msg_format("%^sはシーッと鳴いた。", m_name);
- else if(percentage > 50) msg_format("%^sは怒って頭を上げた。", m_name);
- else if(percentage > 35) msg_format("%^sは猛然と威嚇した。", m_name);
- else if(percentage > 20) msg_format("%^sは身もだえした。", m_name);
- else if(percentage > 10) msg_format("%^sは苦痛で身もだえした。", m_name);
+ if (percentage > 95) msg_format("%^sはほとんど気にとめていない。", m_name);
+ else if (percentage > 75) msg_format("%^sはシーッと鳴いた。", m_name);
+ else if (percentage > 50) msg_format("%^sは怒って頭を上げた。", m_name);
+ else if (percentage > 35) msg_format("%^sは猛然と威嚇した。", m_name);
+ else if (percentage > 20) msg_format("%^sは身もだえした。", m_name);
+ else if (percentage > 10) msg_format("%^sは苦痛で身もだえした。", m_name);
else msg_format("%^sはぐにゃぐにゃと痙攣した。", m_name);
#else
- if(percentage > 95) msg_format("%^s barely notices.", m_name);
- else if(percentage > 75) msg_format("%^s hisses.", m_name);
- else if(percentage > 50) msg_format("%^s rears up in anger.", m_name);
- else if(percentage > 35) msg_format("%^s hisses furiously.", m_name);
- else if(percentage > 20) msg_format("%^s writhes about.", m_name);
- else if(percentage > 10) msg_format("%^s writhes in agony.", m_name);
+ if (percentage > 95) msg_format("%^s barely notices.", m_name);
+ else if (percentage > 75) msg_format("%^s hisses.", m_name);
+ else if (percentage > 50) msg_format("%^s rears up in anger.", m_name);
+ else if (percentage > 35) msg_format("%^s hisses furiously.", m_name);
+ else if (percentage > 20) msg_format("%^s writhes about.", m_name);
+ else if (percentage > 10) msg_format("%^s writhes in agony.", m_name);
else msg_format("%^s jerks limply.", m_name);
#endif
}
- else if(my_strchr("f", r_ptr->d_char))
+ else if (my_strchr("f", r_ptr->d_char))
{
#ifdef JP
- if(percentage > 95) msg_format("%sは攻撃に肩をすくめた。", m_name);
- else if(percentage > 75) msg_format("%^sは吠えた。", m_name);
- else if(percentage > 50) msg_format("%^sは怒って吠えた。", m_name);
- else if(percentage > 35) msg_format("%^sは痛みでシーッと鳴いた。", m_name);
- else if(percentage > 20) msg_format("%^sは痛みで弱々しく鳴いた。", m_name);
- else if(percentage > 10) msg_format("%^sは苦痛にうめいた。", m_name);
+ if (percentage > 95) msg_format("%sは攻撃に肩をすくめた。", m_name);
+ else if (percentage > 75) msg_format("%^sは吠えた。", m_name);
+ else if (percentage > 50) msg_format("%^sは怒って吠えた。", m_name);
+ else if (percentage > 35) msg_format("%^sは痛みでシーッと鳴いた。", m_name);
+ else if (percentage > 20) msg_format("%^sは痛みで弱々しく鳴いた。", m_name);
+ else if (percentage > 10) msg_format("%^sは苦痛にうめいた。", m_name);
else msg_format("%sは哀れな鳴き声を出した。", m_name);
#else
- if(percentage > 95) msg_format("%^s shrugs off the attack.", m_name);
- else if(percentage > 75) msg_format("%^s roars.", m_name);
- else if(percentage > 50) msg_format("%^s growls angrily.", m_name);
- else if(percentage > 35) msg_format("%^s hisses with pain.", m_name);
- else if(percentage > 20) msg_format("%^s mewls in pain.", m_name);
- else if(percentage > 10) msg_format("%^s hisses in agony.", m_name);
+ if (percentage > 95) msg_format("%^s shrugs off the attack.", m_name);
+ else if (percentage > 75) msg_format("%^s roars.", m_name);
+ else if (percentage > 50) msg_format("%^s growls angrily.", m_name);
+ else if (percentage > 35) msg_format("%^s hisses with pain.", m_name);
+ else if (percentage > 20) msg_format("%^s mewls in pain.", m_name);
+ else if (percentage > 10) msg_format("%^s hisses in agony.", m_name);
else msg_format("%^s mewls pitifully.", m_name);
#endif
}
- else if(my_strchr("acFIKS", r_ptr->d_char)) // Ants, Centipedes, Flies, Insects, Beetles, Spiders
+ else if (my_strchr("acFIKS", r_ptr->d_char)) // Ants, Centipedes, Flies, Insects, Beetles, Spiders
{
#ifdef JP
- if(percentage > 95) msg_format("%sは攻撃を気にとめていない。", m_name);
- else if(percentage > 75) msg_format("%^sはキーキー鳴いた。", m_name);
- else if(percentage > 50) msg_format("%^sはヨロヨロ逃げ回った。", m_name);
- else if(percentage > 35) msg_format("%^sはうるさく鳴いた。", m_name);
- else if(percentage > 20) msg_format("%^sは痛みに痙攣した。", m_name);
- else if(percentage > 10) msg_format("%^sは苦痛で痙攣した。", m_name);
+ if (percentage > 95) msg_format("%sは攻撃を気にとめていない。", m_name);
+ else if (percentage > 75) msg_format("%^sはキーキー鳴いた。", m_name);
+ else if (percentage > 50) msg_format("%^sはヨロヨロ逃げ回った。", m_name);
+ else if (percentage > 35) msg_format("%^sはうるさく鳴いた。", m_name);
+ else if (percentage > 20) msg_format("%^sは痛みに痙攣した。", m_name);
+ else if (percentage > 10) msg_format("%^sは苦痛で痙攣した。", m_name);
else msg_format("%^sはピクピクひきつった。", m_name);
#else
- if(percentage > 95) msg_format("%^s ignores the attack.", m_name);
- else if(percentage > 75) msg_format("%^s chitters.", m_name);
- else if(percentage > 50) msg_format("%^s scuttles about.", m_name);
- else if(percentage > 35) msg_format("%^s twitters.", m_name);
- else if(percentage > 20) msg_format("%^s jerks in pain.", m_name);
- else if(percentage > 10) msg_format("%^s jerks in agony.", m_name);
+ if (percentage > 95) msg_format("%^s ignores the attack.", m_name);
+ else if (percentage > 75) msg_format("%^s chitters.", m_name);
+ else if (percentage > 50) msg_format("%^s scuttles about.", m_name);
+ else if (percentage > 35) msg_format("%^s twitters.", m_name);
+ else if (percentage > 20) msg_format("%^s jerks in pain.", m_name);
+ else if (percentage > 10) msg_format("%^s jerks in agony.", m_name);
else msg_format("%^s twitches.", m_name);
#endif
}
- else if(my_strchr("B", r_ptr->d_char)) // Birds
- {
+ else if (my_strchr("B", r_ptr->d_char)) // Birds
+ {
#ifdef JP
- if(percentage > 95) msg_format("%^sはさえずった。", m_name);
- else if(percentage > 75) msg_format("%^sはピーピー鳴いた。", m_name);
- else if(percentage > 50) msg_format("%^sはギャーギャー鳴いた。", m_name);
- else if(percentage > 35) msg_format("%^sはギャーギャー鳴きわめいた。", m_name);
- else if(percentage > 20) msg_format("%^sは苦しんだ。", m_name);
- else if(percentage > 10) msg_format("%^sはのたうち回った。", m_name);
+ if (percentage > 95) msg_format("%^sはさえずった。", m_name);
+ else if (percentage > 75) msg_format("%^sはピーピー鳴いた。", m_name);
+ else if (percentage > 50) msg_format("%^sはギャーギャー鳴いた。", m_name);
+ else if (percentage > 35) msg_format("%^sはギャーギャー鳴きわめいた。", m_name);
+ else if (percentage > 20) msg_format("%^sは苦しんだ。", m_name);
+ else if (percentage > 10) msg_format("%^sはのたうち回った。", m_name);
else msg_format("%^sはキーキーと鳴き叫んだ。", m_name);
#else
- if(percentage > 95) msg_format("%^s chirps.", m_name);
- else if(percentage > 75) msg_format("%^s twitters.", m_name);
- else if(percentage > 50) msg_format("%^s squawks.", m_name);
- else if(percentage > 35) msg_format("%^s chatters.", m_name);
- else if(percentage > 20) msg_format("%^s jeers.", m_name);
- else if(percentage > 10) msg_format("%^s flutters about.", m_name);
+ if (percentage > 95) msg_format("%^s chirps.", m_name);
+ else if (percentage > 75) msg_format("%^s twitters.", m_name);
+ else if (percentage > 50) msg_format("%^s squawks.", m_name);
+ else if (percentage > 35) msg_format("%^s chatters.", m_name);
+ else if (percentage > 20) msg_format("%^s jeers.", m_name);
+ else if (percentage > 10) msg_format("%^s flutters about.", m_name);
else msg_format("%^s squeaks.", m_name);
#endif
}
- else if(my_strchr("duDLUW", r_ptr->d_char)) // Dragons, Demons, High Undead
- {
+ else if (my_strchr("duDLUW", r_ptr->d_char)) // Dragons, Demons, High Undead
+ {
#ifdef JP
- if(percentage > 95) msg_format("%sは攻撃を気にとめていない。", m_name);
- else if(percentage > 75) msg_format("%^sはしり込みした。", m_name);
- else if(percentage > 50) msg_format("%^sは痛みでシーッと鳴いた。", m_name);
- else if(percentage > 35) msg_format("%^sは痛みでうなった。", m_name);
- else if(percentage > 20) msg_format("%^sは痛みに吠えた。", m_name);
- else if(percentage > 10) msg_format("%^sは苦しげに叫んだ。", m_name);
+ if (percentage > 95) msg_format("%sは攻撃を気にとめていない。", m_name);
+ else if (percentage > 75) msg_format("%^sはしり込みした。", m_name);
+ else if (percentage > 50) msg_format("%^sは痛みでシーッと鳴いた。", m_name);
+ else if (percentage > 35) msg_format("%^sは痛みでうなった。", m_name);
+ else if (percentage > 20) msg_format("%^sは痛みに吠えた。", m_name);
+ else if (percentage > 10) msg_format("%^sは苦しげに叫んだ。", m_name);
else msg_format("%^sは弱々しくうなった。", m_name);
#else
- if(percentage > 95) msg_format("%^s ignores the attack.", m_name);
- else if(percentage > 75) msg_format("%^s flinches.", m_name);
- else if(percentage > 50) msg_format("%^s hisses in pain.", m_name);
- else if(percentage > 35) msg_format("%^s snarls with pain.", m_name);
- else if(percentage > 20) msg_format("%^s roars with pain.", m_name);
- else if(percentage > 10) msg_format("%^s gasps.", m_name);
+ if (percentage > 95) msg_format("%^s ignores the attack.", m_name);
+ else if (percentage > 75) msg_format("%^s flinches.", m_name);
+ else if (percentage > 50) msg_format("%^s hisses in pain.", m_name);
+ else if (percentage > 35) msg_format("%^s snarls with pain.", m_name);
+ else if (percentage > 20) msg_format("%^s roars with pain.", m_name);
+ else if (percentage > 10) msg_format("%^s gasps.", m_name);
else msg_format("%^s snarls feebly.", m_name);
#endif
}
- else if(my_strchr("s", r_ptr->d_char)) // Skeletons
+ else if (my_strchr("s", r_ptr->d_char)) // Skeletons
{
#ifdef JP
- if(percentage > 95) msg_format("%sは攻撃を気にとめていない。", m_name);
- else if(percentage > 75) msg_format("%sは攻撃に肩をすくめた。", m_name);
- else if(percentage > 50) msg_format("%^sはカタカタと笑った。", m_name);
- else if(percentage > 35) msg_format("%^sはよろめいた。", m_name);
- else if(percentage > 20) msg_format("%^sはカタカタ言った。", m_name);
- else if(percentage > 10) msg_format("%^sはよろめいた。", m_name);
+ if (percentage > 95) msg_format("%sは攻撃を気にとめていない。", m_name);
+ else if (percentage > 75) msg_format("%sは攻撃に肩をすくめた。", m_name);
+ else if (percentage > 50) msg_format("%^sはカタカタと笑った。", m_name);
+ else if (percentage > 35) msg_format("%^sはよろめいた。", m_name);
+ else if (percentage > 20) msg_format("%^sはカタカタ言った。", m_name);
+ else if (percentage > 10) msg_format("%^sはよろめいた。", m_name);
else msg_format("%^sはガタガタ言った。", m_name);
#else
- if(percentage > 95) msg_format("%^s ignores the attack.", m_name);
- else if(percentage > 75) msg_format("%^s shrugs off the attack.", m_name);
- else if(percentage > 50) msg_format("%^s rattles.", m_name);
- else if(percentage > 35) msg_format("%^s stumbles.", m_name);
- else if(percentage > 20) msg_format("%^s rattles.", m_name);
- else if(percentage > 10) msg_format("%^s staggers.", m_name);
+ if (percentage > 95) msg_format("%^s ignores the attack.", m_name);
+ else if (percentage > 75) msg_format("%^s shrugs off the attack.", m_name);
+ else if (percentage > 50) msg_format("%^s rattles.", m_name);
+ else if (percentage > 35) msg_format("%^s stumbles.", m_name);
+ else if (percentage > 20) msg_format("%^s rattles.", m_name);
+ else if (percentage > 10) msg_format("%^s staggers.", m_name);
else msg_format("%^s clatters.", m_name);
#endif
}
- else if(my_strchr("z", r_ptr->d_char)) // Zombies
- {
+ else if (my_strchr("z", r_ptr->d_char)) // Zombies
+ {
#ifdef JP
- if(percentage > 95) msg_format("%sは攻撃を気にとめていない。", m_name);
- else if(percentage > 75) msg_format("%sは攻撃に肩をすくめた。", m_name);
- else if(percentage > 50) msg_format("%^sはうめいた。", m_name);
- else if(percentage > 35) msg_format("%sは苦しげにうめいた。", m_name);
- else if(percentage > 20) msg_format("%^sは躊躇した。", m_name);
- else if(percentage > 10) msg_format("%^sはうなった。", m_name);
+ if (percentage > 95) msg_format("%sは攻撃を気にとめていない。", m_name);
+ else if (percentage > 75) msg_format("%sは攻撃に肩をすくめた。", m_name);
+ else if (percentage > 50) msg_format("%^sはうめいた。", m_name);
+ else if (percentage > 35) msg_format("%sは苦しげにうめいた。", m_name);
+ else if (percentage > 20) msg_format("%^sは躊躇した。", m_name);
+ else if (percentage > 10) msg_format("%^sはうなった。", m_name);
else msg_format("%^sはよろめいた。", m_name);
#else
- if(percentage > 95) msg_format("%^s ignores the attack.", m_name);
- else if(percentage > 75) msg_format("%^s shrugs off the attack.", m_name);
- else if(percentage > 50) msg_format("%^s groans.", m_name);
- else if(percentage > 35) msg_format("%^s moans.", m_name);
- else if(percentage > 20) msg_format("%^s hesitates.", m_name);
- else if(percentage > 10) msg_format("%^s grunts.", m_name);
+ if (percentage > 95) msg_format("%^s ignores the attack.", m_name);
+ else if (percentage > 75) msg_format("%^s shrugs off the attack.", m_name);
+ else if (percentage > 50) msg_format("%^s groans.", m_name);
+ else if (percentage > 35) msg_format("%^s moans.", m_name);
+ else if (percentage > 20) msg_format("%^s hesitates.", m_name);
+ else if (percentage > 10) msg_format("%^s grunts.", m_name);
else msg_format("%^s staggers.", m_name);
#endif
}
- else if(my_strchr("G", r_ptr->d_char)) // Ghosts
+ else if (my_strchr("G", r_ptr->d_char)) // Ghosts
{
#ifdef JP
- if(percentage > 95) msg_format("%sは攻撃を気にとめていない。", m_name);
- else if(percentage > 75) msg_format("%sは攻撃に肩をすくめた。", m_name);
- else if(percentage > 50) msg_format("%sはうめいた。", m_name);
- else if(percentage > 35) msg_format("%^sは泣きわめいた。", m_name);
- else if(percentage > 20) msg_format("%^sは吠えた。", m_name);
- else if(percentage > 10) msg_format("%sは弱々しくうめいた。", m_name);
+ if (percentage > 95) msg_format("%sは攻撃を気にとめていない。", m_name);
+ else if (percentage > 75) msg_format("%sは攻撃に肩をすくめた。", m_name);
+ else if (percentage > 50) msg_format("%sはうめいた。", m_name);
+ else if (percentage > 35) msg_format("%^sは泣きわめいた。", m_name);
+ else if (percentage > 20) msg_format("%^sは吠えた。", m_name);
+ else if (percentage > 10) msg_format("%sは弱々しくうめいた。", m_name);
else msg_format("%^sはかすかにうめいた。", m_name);
#else
- if(percentage > 95) msg_format("%^s ignores the attack.", m_name);
- else if(percentage > 75) msg_format("%^s shrugs off the attack.", m_name);
- else if(percentage > 50) msg_format("%^s moans.", m_name);
- else if(percentage > 35) msg_format("%^s wails.", m_name);
- else if(percentage > 20) msg_format("%^s howls.", m_name);
- else if(percentage > 10) msg_format("%^s moans softly.", m_name);
+ if (percentage > 95) msg_format("%^s ignores the attack.", m_name);
+ else if (percentage > 75) msg_format("%^s shrugs off the attack.", m_name);
+ else if (percentage > 50) msg_format("%^s moans.", m_name);
+ else if (percentage > 35) msg_format("%^s wails.", m_name);
+ else if (percentage > 20) msg_format("%^s howls.", m_name);
+ else if (percentage > 10) msg_format("%^s moans softly.", m_name);
else msg_format("%^s sighs.", m_name);
#endif
}
- else if(my_strchr("CZ", r_ptr->d_char)) // Dogs and Hounds
+ else if (my_strchr("CZ", r_ptr->d_char)) // Dogs and Hounds
{
#ifdef JP
- if(percentage > 95) msg_format("%^sは攻撃に肩をすくめた。", m_name);
- else if(percentage > 75) msg_format("%^sは痛みでうなった。", m_name);
- else if(percentage > 50) msg_format("%^sは痛みでキャンキャン吠えた。", m_name);
- else if(percentage > 35) msg_format("%^sは痛みで鳴きわめいた。", m_name);
- else if(percentage > 20) msg_format("%^sは苦痛のあまり鳴きわめいた。", m_name);
- else if(percentage > 10) msg_format("%^sは苦痛でもだえ苦しんだ。", m_name);
+ if (percentage > 95) msg_format("%^sは攻撃に肩をすくめた。", m_name);
+ else if (percentage > 75) msg_format("%^sは痛みでうなった。", m_name);
+ else if (percentage > 50) msg_format("%^sは痛みでキャンキャン吠えた。", m_name);
+ else if (percentage > 35) msg_format("%^sは痛みで鳴きわめいた。", m_name);
+ else if (percentage > 20) msg_format("%^sは苦痛のあまり鳴きわめいた。", m_name);
+ else if (percentage > 10) msg_format("%^sは苦痛でもだえ苦しんだ。", m_name);
else msg_format("%^sは弱々しく吠えた。", m_name);
#else
- if(percentage > 95) msg_format("%^s shrugs off the attack.", m_name);
- else if(percentage > 75) msg_format("%^s snarls with pain.", m_name);
- else if(percentage > 50) msg_format("%^s yelps in pain.", m_name);
- else if(percentage > 35) msg_format("%^s howls in pain.", m_name);
- else if(percentage > 20) msg_format("%^s howls in agony.", m_name);
- else if(percentage > 10) msg_format("%^s writhes in agony.", m_name);
+ if (percentage > 95) msg_format("%^s shrugs off the attack.", m_name);
+ else if (percentage > 75) msg_format("%^s snarls with pain.", m_name);
+ else if (percentage > 50) msg_format("%^s yelps in pain.", m_name);
+ else if (percentage > 35) msg_format("%^s howls in pain.", m_name);
+ else if (percentage > 20) msg_format("%^s howls in agony.", m_name);
+ else if (percentage > 10) msg_format("%^s writhes in agony.", m_name);
else msg_format("%^s yelps feebly.", m_name);
#endif
}
- else if(my_strchr("Xbilqrt", r_ptr->d_char)) // One type of creatures (ignore,squeal,shriek)
+ else if (my_strchr("Xbilqrt", r_ptr->d_char)) // One type of creatures (ignore,squeal,shriek)
{
#ifdef JP
- if(percentage > 95) msg_format("%^sは攻撃を気にとめていない。", m_name);
- else if(percentage > 75) msg_format("%^sは痛みでうなった。", m_name);
- else if(percentage > 50) msg_format("%^sは痛みで叫んだ。", m_name);
- else if(percentage > 35) msg_format("%^sは痛みで絶叫した。", m_name);
- else if(percentage > 20) msg_format("%^sは苦痛のあまり絶叫した。", m_name);
- else if(percentage > 10) msg_format("%^sは苦痛でもだえ苦しんだ。", m_name);
+ if (percentage > 95) msg_format("%^sは攻撃を気にとめていない。", m_name);
+ else if (percentage > 75) msg_format("%^sは痛みでうなった。", m_name);
+ else if (percentage > 50) msg_format("%^sは痛みで叫んだ。", m_name);
+ else if (percentage > 35) msg_format("%^sは痛みで絶叫した。", m_name);
+ else if (percentage > 20) msg_format("%^sは苦痛のあまり絶叫した。", m_name);
+ else if (percentage > 10) msg_format("%^sは苦痛でもだえ苦しんだ。", m_name);
else msg_format("%^sは弱々しく叫んだ。", m_name);
#else
- if(percentage > 95) msg_format("%^s ignores the attack.", m_name);
- else if(percentage > 75) msg_format("%^s grunts with pain.", m_name);
- else if(percentage > 50) msg_format("%^s squeals in pain.", m_name);
- else if(percentage > 35) msg_format("%^s shrieks in pain.", m_name);
- else if(percentage > 20) msg_format("%^s shrieks in agony.", m_name);
- else if(percentage > 10) msg_format("%^s writhes in agony.", m_name);
+ if (percentage > 95) msg_format("%^s ignores the attack.", m_name);
+ else if (percentage > 75) msg_format("%^s grunts with pain.", m_name);
+ else if (percentage > 50) msg_format("%^s squeals in pain.", m_name);
+ else if (percentage > 35) msg_format("%^s shrieks in pain.", m_name);
+ else if (percentage > 20) msg_format("%^s shrieks in agony.", m_name);
+ else if (percentage > 10) msg_format("%^s writhes in agony.", m_name);
else msg_format("%^s cries out feebly.", m_name);
#endif
}
else // Another type of creatures (shrug,cry,scream)
{
#ifdef JP
- if(percentage > 95) msg_format("%^sは攻撃に肩をすくめた。", m_name);
- else if(percentage > 75) msg_format("%^sは痛みでうなった。", m_name);
- else if(percentage > 50) msg_format("%^sは痛みで叫んだ。", m_name);
- else if(percentage > 35) msg_format("%^sは痛みで絶叫した。", m_name);
- else if(percentage > 20) msg_format("%^sは苦痛のあまり絶叫した。", m_name);
- else if(percentage > 10) msg_format("%^sは苦痛でもだえ苦しんだ。", m_name);
+ if (percentage > 95) msg_format("%^sは攻撃に肩をすくめた。", m_name);
+ else if (percentage > 75) msg_format("%^sは痛みでうなった。", m_name);
+ else if (percentage > 50) msg_format("%^sは痛みで叫んだ。", m_name);
+ else if (percentage > 35) msg_format("%^sは痛みで絶叫した。", m_name);
+ else if (percentage > 20) msg_format("%^sは苦痛のあまり絶叫した。", m_name);
+ else if (percentage > 10) msg_format("%^sは苦痛でもだえ苦しんだ。", m_name);
else msg_format("%^sは弱々しく叫んだ。", m_name);
#else
- if(percentage > 95) msg_format("%^s shrugs off the attack.", m_name);
- else if(percentage > 75) msg_format("%^s grunts with pain.", m_name);
- else if(percentage > 50) msg_format("%^s cries out in pain.", m_name);
- else if(percentage > 35) msg_format("%^s screams in pain.", m_name);
- else if(percentage > 20) msg_format("%^s screams in agony.", m_name);
- else if(percentage > 10) msg_format("%^s writhes in agony.", m_name);
+ if (percentage > 95) msg_format("%^s shrugs off the attack.", m_name);
+ else if (percentage > 75) msg_format("%^s grunts with pain.", m_name);
+ else if (percentage > 50) msg_format("%^s cries out in pain.", m_name);
+ else if (percentage > 35) msg_format("%^s screams in pain.", m_name);
+ else if (percentage > 20) msg_format("%^s screams in agony.", m_name);
+ else if (percentage > 10) msg_format("%^s writhes in agony.", m_name);
else msg_format("%^s cries out feebly.", m_name);
#endif
}
break;
case DRS_REFLECT:
- if (p_ptr->reflect) m_ptr-> smart |= (SM_IMM_REFLECT);
+ if (p_ptr->reflect) m_ptr->smart |= (SM_IMM_REFLECT);
break;
}
}
#define OBJ_GOLD_LIST 480 /* First "gold" entry */
#define MAX_GOLD 18 /* Number of "gold" entries */
-/* Lite flag macro */
+ /* Lite flag macro */
#define HAVE_LITE_FLAG(ARRAY) \
(have_flag(ARRAY, TR_LITE_1) || have_flag(ARRAY, TR_LITE_2) || have_flag(ARRAY, TR_LITE_3))
* only armor and weapons and a few other items use any of these flags.
*/
- #define TV_SKELETON 1 /* Skeletons ('s'), not specified */
- #define TV_BOTTLE 2 /* Empty bottles ('!') */
- #define TV_JUNK 3 /* Sticks, Pottery, etc ('~') */
- #define TV_WHISTLE 4 /* Whistle ('~') */
- #define TV_SPIKE 5 /* Spikes ('~') */
- #define TV_CHEST 7 /* Chests ('&') */
- #define TV_FIGURINE 8 /* Magical figurines */
- #define TV_STATUE 9 /* Statue, what a silly object... */
- #define TV_CORPSE 10 /* Corpses and Skeletons, specific */
- #define TV_CAPTURE 11 /* Monster ball */
- #define TV_NO_AMMO 15 /* Ammo for crimson */
- #define TV_SHOT 16 /* Ammo for slings */
- #define TV_ARROW 17 /* Ammo for bows */
- #define TV_BOLT 18 /* Ammo for x-bows */
- #define TV_BOW 19 /* Slings/Bows/Xbows */
- #define TV_DIGGING 20 /* Shovels/Picks */
- #define TV_HAFTED 21 /* Priest Weapons */
- #define TV_POLEARM 22 /* Axes and Pikes */
- #define TV_SWORD 23 /* Edged Weapons */
- #define TV_BOOTS 30 /* Boots */
- #define TV_GLOVES 31 /* Gloves */
- #define TV_HELM 32 /* Helms */
- #define TV_CROWN 33 /* Crowns */
- #define TV_SHIELD 34 /* Shields */
- #define TV_CLOAK 35 /* Cloaks */
- #define TV_SOFT_ARMOR 36 /* Soft Armor */
- #define TV_HARD_ARMOR 37 /* Hard Armor */
- #define TV_DRAG_ARMOR 38 /* Dragon Scale Mail */
- #define TV_LITE 39 /* Lites (including Specials) */
- #define TV_AMULET 40 /* Amulets (including Specials) */
- #define TV_RING 45 /* Rings (including Specials) */
- #define TV_CARD 50
- #define TV_STAFF 55
- #define TV_WAND 65
- #define TV_ROD 66
- #define TV_PARCHMENT 69
- #define TV_SCROLL 70
- #define TV_POTION 75
- #define TV_FLASK 77
- #define TV_FOOD 80
- #define TV_LIFE_BOOK 90
- #define TV_SORCERY_BOOK 91
- #define TV_NATURE_BOOK 92
- #define TV_CHAOS_BOOK 93
- #define TV_DEATH_BOOK 94
- #define TV_TRUMP_BOOK 95
- #define TV_ARCANE_BOOK 96
- #define TV_CRAFT_BOOK 97
- #define TV_DAEMON_BOOK 98
- #define TV_CRUSADE_BOOK 99
- #define TV_MUSIC_BOOK 105
- #define TV_HISSATSU_BOOK 106
- #define TV_HEX_BOOK 107
- #define TV_GOLD 127 /* Gold can only be picked up by players */
-
- #define TV_EQUIP_BEGIN TV_SHOT
- #define TV_EQUIP_END TV_CARD
- #define TV_MISSILE_BEGIN TV_SHOT
- #define TV_MISSILE_END TV_BOLT
- #define TV_WEARABLE_BEGIN TV_BOW
- #define TV_WEARABLE_END TV_CARD
- #define TV_WEAPON_BEGIN TV_BOW
- #define TV_WEAPON_END TV_SWORD
- #define TV_ARMOR_BEGIN TV_BOOTS
- #define TV_ARMOR_END TV_DRAG_ARMOR
+#define TV_SKELETON 1 /* Skeletons ('s'), not specified */
+#define TV_BOTTLE 2 /* Empty bottles ('!') */
+#define TV_JUNK 3 /* Sticks, Pottery, etc ('~') */
+#define TV_WHISTLE 4 /* Whistle ('~') */
+#define TV_SPIKE 5 /* Spikes ('~') */
+#define TV_CHEST 7 /* Chests ('&') */
+#define TV_FIGURINE 8 /* Magical figurines */
+#define TV_STATUE 9 /* Statue, what a silly object... */
+#define TV_CORPSE 10 /* Corpses and Skeletons, specific */
+#define TV_CAPTURE 11 /* Monster ball */
+#define TV_NO_AMMO 15 /* Ammo for crimson */
+#define TV_SHOT 16 /* Ammo for slings */
+#define TV_ARROW 17 /* Ammo for bows */
+#define TV_BOLT 18 /* Ammo for x-bows */
+#define TV_BOW 19 /* Slings/Bows/Xbows */
+#define TV_DIGGING 20 /* Shovels/Picks */
+#define TV_HAFTED 21 /* Priest Weapons */
+#define TV_POLEARM 22 /* Axes and Pikes */
+#define TV_SWORD 23 /* Edged Weapons */
+#define TV_BOOTS 30 /* Boots */
+#define TV_GLOVES 31 /* Gloves */
+#define TV_HELM 32 /* Helms */
+#define TV_CROWN 33 /* Crowns */
+#define TV_SHIELD 34 /* Shields */
+#define TV_CLOAK 35 /* Cloaks */
+#define TV_SOFT_ARMOR 36 /* Soft Armor */
+#define TV_HARD_ARMOR 37 /* Hard Armor */
+#define TV_DRAG_ARMOR 38 /* Dragon Scale Mail */
+#define TV_LITE 39 /* Lites (including Specials) */
+#define TV_AMULET 40 /* Amulets (including Specials) */
+#define TV_RING 45 /* Rings (including Specials) */
+#define TV_CARD 50
+#define TV_STAFF 55
+#define TV_WAND 65
+#define TV_ROD 66
+#define TV_PARCHMENT 69
+#define TV_SCROLL 70
+#define TV_POTION 75
+#define TV_FLASK 77
+#define TV_FOOD 80
+#define TV_LIFE_BOOK 90
+#define TV_SORCERY_BOOK 91
+#define TV_NATURE_BOOK 92
+#define TV_CHAOS_BOOK 93
+#define TV_DEATH_BOOK 94
+#define TV_TRUMP_BOOK 95
+#define TV_ARCANE_BOOK 96
+#define TV_CRAFT_BOOK 97
+#define TV_DAEMON_BOOK 98
+#define TV_CRUSADE_BOOK 99
+#define TV_MUSIC_BOOK 105
+#define TV_HISSATSU_BOOK 106
+#define TV_HEX_BOOK 107
+#define TV_GOLD 127 /* Gold can only be picked up by players */
+
+#define TV_EQUIP_BEGIN TV_SHOT
+#define TV_EQUIP_END TV_CARD
+#define TV_MISSILE_BEGIN TV_SHOT
+#define TV_MISSILE_END TV_BOLT
+#define TV_WEARABLE_BEGIN TV_BOW
+#define TV_WEARABLE_END TV_CARD
+#define TV_WEAPON_BEGIN TV_BOW
+#define TV_WEAPON_END TV_SWORD
+#define TV_ARMOR_BEGIN TV_BOOTS
+#define TV_ARMOR_END TV_DRAG_ARMOR
OBJECT_TYPE_VALUE tval; /* Item type (from kind) */
OBJECT_SUBTYPE_VALUE sval; /* Item sub-type (from kind) */
/*
* 変愚ver1.5.0以前に使われていたアイテムの追加特性フラグ / Hack -- special "xtra" object powers
*/
- #define EGO_XTRA_SUSTAIN 1 /*!< 旧版アイテムフラグ(非推奨): 追加維持能力 / Sustain one stat */
- #define EGO_XTRA_POWER 2 /*!< 旧版アイテムフラグ(非推奨): 追加上級耐性 / High resist */
- #define EGO_XTRA_ABILITY 3 /*!< 旧版アイテムフラグ(非推奨): 追加能力 / Special ability */
+#define EGO_XTRA_SUSTAIN 1 /*!< 旧版アイテムフラグ(非推奨): 追加維持能力 / Sustain one stat */
+#define EGO_XTRA_POWER 2 /*!< 旧版アイテムフラグ(非推奨): 追加上級耐性 / High resist */
+#define EGO_XTRA_ABILITY 3 /*!< 旧版アイテムフラグ(非推奨): 追加能力 / Special ability */
XTRA8 xtra1; /* Extra info type (now unused) */
XTRA8 xtra2; /* Extra info activation index */
/*
* Special Object Flags
*/
- #define IDENT_SENSE 0x01 /* Item has been "sensed" */
- #define IDENT_FIXED 0x02 /* Item has been "haggled" */
- #define IDENT_EMPTY 0x04 /* Item charges are known */
- #define IDENT_KNOWN 0x08 /* Item abilities are known */
- #define IDENT_STORE 0x10 /* Item is storebought !!!! */
- #define IDENT_MENTAL 0x20 /* Item information is known */
- #define IDENT_BROKEN 0x80 /* Item is permanently worthless */
+#define IDENT_SENSE 0x01 /* Item has been "sensed" */
+#define IDENT_FIXED 0x02 /* Item has been "haggled" */
+#define IDENT_EMPTY 0x04 /* Item charges are known */
+#define IDENT_KNOWN 0x08 /* Item abilities are known */
+#define IDENT_STORE 0x10 /* Item is storebought !!!! */
+#define IDENT_MENTAL 0x20 /* Item information is known */
+#define IDENT_BROKEN 0x80 /* Item is permanently worthless */
byte ident; /* Special flags */
/*
* OM_NOMSG --- temporary flag to suppress messages which were
* already printed in autopick_pickup_items().
*/
- #define OM_FOUND 0x01 /*!< アイテムを一度でも視界に収めたことがあるか */
- #define OM_NOMSG 0x02 /* temporary flag to suppress messages */
- #define OM_NO_QUERY 0x04 /* Query for auto-pick was already answered as 'No' */
- #define OM_AUTODESTROY 0x08 /* Destroy later to avoid illegal inventry shift */
- #define OM_TOUCHED 0x10 /* Object was touched by player */
+#define OM_FOUND 0x01 /*!< アイテムを一度でも視界に収めたことがあるか */
+#define OM_NOMSG 0x02 /* temporary flag to suppress messages */
+#define OM_NO_QUERY 0x04 /* Query for auto-pick was already answered as 'No' */
+#define OM_AUTODESTROY 0x08 /* Destroy later to avoid illegal inventry shift */
+#define OM_TOUCHED 0x10 /* Object was touched by player */
byte marked; /* Object is marked */
u16b inscription; /* Inscription index */
BIT_FLAGS art_flags[TR_FLAG_SIZE]; /* Extra Flags for ego and artifacts */
- #define TRC_CURSED 0x00000001L
- #define TRC_HEAVY_CURSE 0x00000002L
- #define TRC_PERMA_CURSE 0x00000004L
- #define TRC_XXX1 0x00000008L
- #define TRC_TY_CURSE 0x00000010L
- #define TRC_AGGRAVATE 0x00000020L
- #define TRC_DRAIN_EXP 0x00000040L
- #define TRC_SLOW_REGEN 0x00000080L
- #define TRC_ADD_L_CURSE 0x00000100L
- #define TRC_ADD_H_CURSE 0x00000200L
- #define TRC_CALL_ANIMAL 0x00000400L
- #define TRC_CALL_DEMON 0x00000800L
- #define TRC_CALL_DRAGON 0x00001000L
- #define TRC_COWARDICE 0x00002000L
- #define TRC_TELEPORT 0x00004000L
- #define TRC_LOW_MELEE 0x00008000L
- #define TRC_LOW_AC 0x00010000L
- #define TRC_LOW_MAGIC 0x00020000L
- #define TRC_FAST_DIGEST 0x00040000L
- #define TRC_DRAIN_HP 0x00080000L
- #define TRC_DRAIN_MANA 0x00100000L
- #define TRC_CALL_UNDEAD 0x00200000L
- #define MAX_CURSE 18
- #define TRC_TELEPORT_SELF 0x00000001L
- #define TRC_CHAINSWORD 0x00000002L
- #define TRC_SPECIAL_MASK \
+#define TRC_CURSED 0x00000001L
+#define TRC_HEAVY_CURSE 0x00000002L
+#define TRC_PERMA_CURSE 0x00000004L
+#define TRC_XXX1 0x00000008L
+#define TRC_TY_CURSE 0x00000010L
+#define TRC_AGGRAVATE 0x00000020L
+#define TRC_DRAIN_EXP 0x00000040L
+#define TRC_SLOW_REGEN 0x00000080L
+#define TRC_ADD_L_CURSE 0x00000100L
+#define TRC_ADD_H_CURSE 0x00000200L
+#define TRC_CALL_ANIMAL 0x00000400L
+#define TRC_CALL_DEMON 0x00000800L
+#define TRC_CALL_DRAGON 0x00001000L
+#define TRC_COWARDICE 0x00002000L
+#define TRC_TELEPORT 0x00004000L
+#define TRC_LOW_MELEE 0x00008000L
+#define TRC_LOW_AC 0x00010000L
+#define TRC_LOW_MAGIC 0x00020000L
+#define TRC_FAST_DIGEST 0x00040000L
+#define TRC_DRAIN_HP 0x00080000L
+#define TRC_DRAIN_MANA 0x00100000L
+#define TRC_CALL_UNDEAD 0x00200000L
+#define MAX_CURSE 18
+#define TRC_TELEPORT_SELF 0x00000001L
+#define TRC_CHAINSWORD 0x00000002L
+#define TRC_SPECIAL_MASK \
(TRC_TY_CURSE | TRC_AGGRAVATE)
- #define TRC_HEAVY_MASK \
+#define TRC_HEAVY_MASK \
(TRC_TY_CURSE | TRC_AGGRAVATE | TRC_DRAIN_EXP | TRC_ADD_H_CURSE | \
TRC_CALL_DEMON | TRC_CALL_DRAGON | TRC_CALL_UNDEAD | TRC_TELEPORT)
- #define TRC_P_FLAG_MASK \
+#define TRC_P_FLAG_MASK \
(TRC_TELEPORT_SELF | TRC_CHAINSWORD | \
TRC_TY_CURSE | TRC_DRAIN_EXP | TRC_ADD_L_CURSE | TRC_ADD_H_CURSE | \
TRC_CALL_ANIMAL | TRC_CALL_DEMON | TRC_CALL_DRAGON | TRC_COWARDICE | \
prev_o_idx = this_o_idx;
continue;
}
-
+
/* No previous */
if (prev_o_idx == 0)
{
/* Try for a "better" object twice (10%) */
if (p >= 10) return (table[i].index);
-
+
/* Save old */
j = i;
item = TRUE;
done = TRUE;
break;
- }
+ }
}
}
/* Save the old armor class */
ARMOUR_CLASS old_dis_ac = creature_ptr->dis_ac;
ARMOUR_CLASS old_dis_to_a = creature_ptr->dis_to_a;
-
+
/* Clear extra blows/shots */
extra_blows[0] = extra_blows[1] = 0;
{
creature_ptr->resist_fear = TRUE;
}
-
+
/* Hack -- Telepathy Change */
if (creature_ptr->telepathy != old_telepathy)
{
if (creature_ptr->immune_elec) creature_ptr->resist_elec = TRUE;
if (creature_ptr->immune_fire) creature_ptr->resist_fire = TRUE;
if (creature_ptr->immune_cold) creature_ptr->resist_cold = TRUE;
-
+
/* Hack -- handle "xtra" mode */
if (current_world_ptr->character_xtra) return;
(creature_ptr->new_spells != 1) ? "s" : "");
#endif
- }
+ }
/* Save the new_spells value */
creature_ptr->old_spells = creature_ptr->new_spells;
/* Redraw object recall */
creature_ptr->window |= (PW_OBJECT);
+ }
}
-}
/*!
msp = (3 * msp) / 4;
}
}
-
+
/* Assume player not encumbered by armor */
creature_ptr->cumber_armor = FALSE;
#define SCORE_PATH "http://moon.kmc.gr.jp/hengband/hengscore-en/score.cgi" /*!< スコア開示URL */
#endif
-/*
- * simple buffer library
- */
+ /*
+ * simple buffer library
+ */
typedef struct {
size_t max_size;
size_t size;
output = buf_new();
buf_sprintf(output, "POST %s HTTP/1.0\r\n", url);
buf_sprintf(output, "User-Agent: Hengband %d.%d.%d\r\n",
- FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
+ FAKE_VER_MAJOR - 10, FAKE_VER_MINOR, FAKE_VER_PATCH);
buf_sprintf(output, "Content-Length: %d\r\n", buf->size);
buf_sprintf(output, "Content-Encoding: binary\r\n");
rv = angband_color_table[a][1];
gv = angband_color_table[a][2];
bv = angband_color_table[a][3];
- buf_sprintf(screen_buf, "%s<font color=\"#%02x%02x%02x\">",
- ((y == 0 && x == 0) ? "" : "</font>"), rv, gv, bv);
+ buf_sprintf(screen_buf, "%s<font color=\"#%02x%02x%02x\">",
+ ((y == 0 && x == 0) ? "" : "</font>"), rv, gv, bv);
old_a = a;
}
/* Screen dump size is too big ? */
concptr ret;
- if (screen_buf->size + 1> SCREEN_BUF_MAX_SIZE)
+ if (screen_buf->size + 1 > SCREEN_BUF_MAX_SIZE)
{
ret = NULL;
}
#ifdef WINDOWS
WSADATA wsaData;
- WORD wVersionRequested =(WORD) (( 1) | ( 1 << 8));
+ WORD wVersionRequested = (WORD)((1) | (1 << 8));
#endif
BUF *score;
buf_sprintf(score, "name: %s\n", creature_ptr->name);
#ifdef JP
buf_sprintf(score, "version: 変愚蛮怒 %d.%d.%d\n",
- FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
+ FAKE_VER_MAJOR - 10, FAKE_VER_MINOR, FAKE_VER_PATCH);
#else
buf_sprintf(score, "version: Hengband %d.%d.%d\n",
- FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
+ FAKE_VER_MAJOR - 10, FAKE_VER_MINOR, FAKE_VER_PATCH);
#endif
buf_sprintf(score, "score: %d\n", calc_score(creature_ptr));
buf_sprintf(score, "level: %d\n", creature_ptr->lev);
buf_sprintf(score, "-----screen shot-----\n");
buf_append(score, screen_dump, strlen(screen_dump));
}
-
+
#ifdef WINDOWS
if (WSAStartup(wVersionRequested, &wsaData))
{
prt("connecting...", 0, 0);
#endif
Term_fresh();
-
+
/* プロキシを設定する */
set_proxy(HTTP_PROXY, HTTP_PROXY_PORT);
break;
}
- report_end:
+report_end:
#ifdef WINDOWS
WSACleanup();
#endif
#include "monster.h"
-/*!
- * 各部屋タイプの生成比定義
- *[from SAngband (originally from OAngband)]\n
- *\n
- * Table of values that control how many times each type of room will\n
- * appear. Each type of room has its own row, and each column\n
- * corresponds to dungeon levels 0, 10, 20, and so on. The final\n
- * value is the minimum depth the room can appear at. -LM-\n
- *\n
- * Level 101 and below use the values for level 100.\n
- *\n
- * Rooms with lots of monsters or loot may not be generated if the\n
- * object or monster lists are already nearly full. Rooms will not\n
- * appear above their minimum depth. Tiny levels will not have space\n
- * for all the rooms you ask for.\n
- */
+ /*!
+ * 各部屋タイプの生成比定義
+ *[from SAngband (originally from OAngband)]\n
+ *\n
+ * Table of values that control how many times each type of room will\n
+ * appear. Each type of room has its own row, and each column\n
+ * corresponds to dungeon levels 0, 10, 20, and so on. The final\n
+ * value is the minimum depth the room can appear at. -LM-\n
+ *\n
+ * Level 101 and below use the values for level 100.\n
+ *\n
+ * Rooms with lots of monsters or loot may not be generated if the\n
+ * object or monster lists are already nearly full. Rooms will not\n
+ * appear above their minimum depth. Tiny levels will not have space\n
+ * for all the rooms you ask for.\n
+ */
#if 1
/* Place a secret door on one side */
switch (randint0(4))
{
- case 0: place_secret_door(player_ptr, y0, x0 - 1, DOOR_DEFAULT); break;
- case 1: place_secret_door(player_ptr, y0, x0 + 1, DOOR_DEFAULT); break;
- case 2: place_secret_door(player_ptr, y0 - 1, x0, DOOR_DEFAULT); break;
- case 3: place_secret_door(player_ptr, y0 + 1, x0, DOOR_DEFAULT); break;
+ case 0: place_secret_door(player_ptr, y0, x0 - 1, DOOR_DEFAULT); break;
+ case 1: place_secret_door(player_ptr, y0, x0 + 1, DOOR_DEFAULT); break;
+ case 2: place_secret_door(player_ptr, y0 - 1, x0, DOOR_DEFAULT); break;
+ case 3: place_secret_door(player_ptr, y0 + 1, x0, DOOR_DEFAULT); break;
}
/* Clear mimic type */
* to bypass these if needed.
*/
- /* Above the top boundary */
+ /* Above the top boundary */
for (x = x1; x <= x2; x++)
{
new_is_floor = get_is_floor(floor_ptr, x, y1 - 1);
/* Never run off the screen */
if ((by1 < 0) || (by2 > dun->row_rooms)) return FALSE;
if ((bx1 < 0) || (bx2 > dun->col_rooms)) return FALSE;
-
+
/* Verify available space */
for (by = by1; by < by2; by++)
{
else
{
/* Always choose the center one */
- pick = candidates/2 + 1;
+ pick = candidates / 2 + 1;
}
/* Pick up the choosen location */
* be *exactly* correct to prevent memory errors
*/
- /* Acquire the location of the room */
+ /* Acquire the location of the room */
(*y) = ((by1 + by2) * BLOCK_HGT) / 2;
(*x) = ((bx1 + bx2) * BLOCK_WID) / 2;
*/
-/*
- * Note that this uses the floor array in a very hackish way
- * the values are first set to zero, and then each array location
- * is used as a "heightmap"
- * The heightmap then needs to be converted back into the "feat" format.
- *
- * grd=level at which fractal turns on. smaller gives more mazelike caves
- * roug=roughness level. 16=normal. higher values make things more convoluted
- * small values are good for smooth walls.
- * size=length of the side of the square grid system.
- */
+ /*
+ * Note that this uses the floor array in a very hackish way
+ * the values are first set to zero, and then each array location
+ * is used as a "heightmap"
+ * The heightmap then needs to be converted back into the "feat" format.
+ *
+ * grd=level at which fractal turns on. smaller gives more mazelike caves
+ * roug=roughness level. 16=normal. higher values make things more convoluted
+ * small values are good for smooth walls.
+ * size=length of the side of the square grid system.
+ */
void generate_hmap(floor_type *floor_ptr, POSITION y0, POSITION x0, POSITION xsiz, POSITION ysiz, int grd, int roug, int cutoff)
{
POSITION xhsize, yhsize, xsize, ysize, maxsize;
POSITION xstep, xhstep, ystep, yhstep;
POSITION xstep2, xhstep2, ystep2, yhstep2;
POSITION i, j, ii, jj, diagsize, xxsize, yysize;
-
+
/* Cache for speed */
POSITION xm, xp, ym, yp;
/* Average of left and right points +random bit */
store_height(floor_ptr, ii, jj,
(floor_ptr->grid_array[jj][fill_data.xmin + (i - xhstep) / 256].feat
- + floor_ptr->grid_array[jj][fill_data.xmin + (i + xhstep) / 256].feat) / 2
- + (randint1(xstep2) - xhstep2) * roug / 16);
+ + floor_ptr->grid_array[jj][fill_data.xmin + (i + xhstep) / 256].feat) / 2
+ + (randint1(xstep2) - xhstep2) * roug / 16);
}
}
}
/* Average of up and down points +random bit */
store_height(floor_ptr, ii, jj,
(floor_ptr->grid_array[fill_data.ymin + (j - yhstep) / 256][ii].feat
- + floor_ptr->grid_array[fill_data.ymin + (j + yhstep) / 256][ii].feat) / 2
+ + floor_ptr->grid_array[fill_data.ymin + (j + yhstep) / 256][ii].feat) / 2
+ (randint1(ystep2) - yhstep2) * roug / 16);
}
}
ym = fill_data.ymin + (j - yhstep) / 256;
yp = fill_data.ymin + (j + yhstep) / 256;
- /*
+ /*
* Average over all four corners + scale by diagsize to
* reduce the effect of the square grid on the shape of the fractal
*/
store_height(floor_ptr, ii, jj,
(floor_ptr->grid_array[ym][xm].feat + floor_ptr->grid_array[yp][xm].feat
- + floor_ptr->grid_array[ym][xp].feat + floor_ptr->grid_array[yp][xp].feat) / 4
+ + floor_ptr->grid_array[ym][xp].feat + floor_ptr->grid_array[yp][xp].feat) / 4
+ (randint1(xstep2) - xhstep2) * (diagsize / 16) / 256 * roug);
}
}
else
{
/* Show that have looked at this square */
- floor_ptr->grid_array[y][x].info|= (CAVE_ICKY);
+ floor_ptr->grid_array[y][x].info |= (CAVE_ICKY);
/* Use cutoffs c1-c3 to allocate regions of floor /water/ lava etc. */
if (floor_ptr->grid_array[y][x].feat <= c1)
{
/* affect boundary */
floor_ptr->grid_array[j][i].info |= CAVE_ICKY;
-/* return; */
+ /* return; */
}
/* If within bounds */
* can make teleport traps instadeaths...
*/
- /* cutoffs */
+ /* cutoffs */
fill_data.c1 = cutoff;
fill_data.c2 = 0;
fill_data.c3 = 0;
{
/* Next to a 'filled' region? - set to be room walls */
place_outer_bold(floor_ptr, y0 + ysize - yhsize, x0 + i - xhsize);
- if (light) floor_ptr->grid_array[y0 + ysize - yhsize][x0 + i - xhsize].info|=(CAVE_GLOW);
- floor_ptr->grid_array[y0 + ysize - yhsize][x0 + i - xhsize].info|=(CAVE_ROOM);
+ if (light) floor_ptr->grid_array[y0 + ysize - yhsize][x0 + i - xhsize].info |= (CAVE_GLOW);
+ floor_ptr->grid_array[y0 + ysize - yhsize][x0 + i - xhsize].info |= (CAVE_ROOM);
place_outer_bold(floor_ptr, y0 + ysize - yhsize, x0 + i - xhsize);
}
else
for (y = 1; y < ysize; ++y)
{
if (is_floor_bold(floor_ptr, y0 + y - yhsize, x0 + x - xhsize) &&
- (floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info & CAVE_ICKY))
+ (floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info & CAVE_ICKY))
{
/* Clear the icky flag in the filled region */
floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~CAVE_ICKY;
if (room) floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info |= (CAVE_ROOM);
}
else if (is_outer_bold(floor_ptr, y0 + y - yhsize, x0 + x - xhsize) &&
- (floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info & CAVE_ICKY))
+ (floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info & CAVE_ICKY))
{
/* Walls */
floor_ptr->grid_array[y0 + y - yhsize][x0 + x - xhsize].info &= ~(CAVE_ICKY);
/* about size/2 */
cutoff = xsize / 2;
- /* make it */
+ /* make it */
generate_hmap(floor_ptr, y0 + 1, x0 + 1, xsize, ysize, grd, roug, cutoff);
/* Convert to normal format+ clean up */
* can make teleport traps instadeaths...
*/
- /* cutoffs */
+ /* cutoffs */
fill_data.c1 = c1;
fill_data.c2 = c2;
fill_data.c3 = c3;
/* hack- empty square part of the time */
if ((randint1(100) - difficulty * 3) > 50) value = 20;
- /* if floor, shallow water and lava */
+ /* if floor, shallow water and lava */
if (is_floor_bold(floor_ptr, y, x) ||
- (cave_have_flag_bold(floor_ptr, y, x, FF_PLACE) && cave_have_flag_bold(floor_ptr, y, x, FF_DROP)))
+ (cave_have_flag_bold(floor_ptr, y, x, FF_PLACE) && cave_have_flag_bold(floor_ptr, y, x, FF_DROP)))
{
/* The smaller 'value' is, the better the stuff */
if (value < 0)
for (i = 1; i < ysize; i++)
{
place_outer_noperm_bold(floor_ptr, y1 + i, x1);
- floor_ptr->grid_array[y1 + i][x1].info|=(CAVE_ROOM | CAVE_ICKY);
+ floor_ptr->grid_array[y1 + i][x1].info |= (CAVE_ROOM | CAVE_ICKY);
place_outer_noperm_bold(floor_ptr, y1 + i, x2);
- floor_ptr->grid_array[y1 + i][x2].info|=(CAVE_ROOM | CAVE_ICKY);
+ floor_ptr->grid_array[y1 + i][x2].info |= (CAVE_ROOM | CAVE_ICKY);
}
/* Middle */
{
for (y = 1; y < ysize; y++)
{
- if (is_extra_bold(floor_ptr, y1+y, x1+x))
+ if (is_extra_bold(floor_ptr, y1 + y, x1 + x))
{
/* clear the untouched region */
place_floor_bold(floor_ptr, y1 + y, x1 + x);
{
switch (adj[i])
{
- case 0:
- /* (0,+) - check for bottom boundary */
- if ((node / m < n - 1) && (visited[node + m] == 0))
- {
- place_floor_bold(floor_ptr, y + 1, x);
- r_visit(floor_ptr, y1, x1, y2, x2, node + m, dir, visited);
- }
- break;
- case 1:
- /* (0,-) - check for top boundary */
- if ((node / m > 0) && (visited[node - m] == 0))
- {
- place_floor_bold(floor_ptr, y - 1, x);
- r_visit(floor_ptr, y1, x1, y2, x2, node - m, dir, visited);
- }
- break;
- case 2:
- /* (+,0) - check for right boundary */
- if ((node % m < m - 1) && (visited[node + 1] == 0))
- {
- place_floor_bold(floor_ptr, y, x + 1);
- r_visit(floor_ptr, y1, x1, y2, x2, node + 1, dir, visited);
- }
- break;
- case 3:
- /* (-,0) - check for left boundary */
- if ((node % m > 0) && (visited[node - 1] == 0))
- {
- place_floor_bold(floor_ptr, y, x - 1);
- r_visit(floor_ptr, y1, x1, y2, x2, node - 1, dir, visited);
- }
+ case 0:
+ /* (0,+) - check for bottom boundary */
+ if ((node / m < n - 1) && (visited[node + m] == 0))
+ {
+ place_floor_bold(floor_ptr, y + 1, x);
+ r_visit(floor_ptr, y1, x1, y2, x2, node + m, dir, visited);
+ }
+ break;
+ case 1:
+ /* (0,-) - check for top boundary */
+ if ((node / m > 0) && (visited[node - m] == 0))
+ {
+ place_floor_bold(floor_ptr, y - 1, x);
+ r_visit(floor_ptr, y1, x1, y2, x2, node - m, dir, visited);
+ }
+ break;
+ case 2:
+ /* (+,0) - check for right boundary */
+ if ((node % m < m - 1) && (visited[node + 1] == 0))
+ {
+ place_floor_bold(floor_ptr, y, x + 1);
+ r_visit(floor_ptr, y1, x1, y2, x2, node + 1, dir, visited);
+ }
+ break;
+ case 3:
+ /* (-,0) - check for left boundary */
+ if ((node % m > 0) && (visited[node - 1] == 0))
+ {
+ place_floor_bold(floor_ptr, y, x - 1);
+ r_visit(floor_ptr, y1, x1, y2, x2, node - 1, dir, visited);
+ }
} /* end switch */
}
}
switch (choice)
{
- case 1:
+ case 1:
+ {
+ /* Outer walls */
+
+ /* top and bottom */
+ for (x = x1; x <= x2; x++)
{
- /* Outer walls */
+ place_outer_bold(floor_ptr, y1, x);
+ place_outer_bold(floor_ptr, y2, x);
+ }
- /* top and bottom */
- for (x = x1; x <= x2; x++)
- {
- place_outer_bold(floor_ptr, y1, x);
- place_outer_bold(floor_ptr, y2, x);
- }
+ /* left and right */
+ for (y = y1 + 1; y < y2; y++)
+ {
+ place_outer_bold(floor_ptr, y, x1);
+ place_outer_bold(floor_ptr, y, x2);
+ }
+ /* Make a couple of entrances */
+ if (one_in_(2))
+ {
/* left and right */
- for (y = y1 + 1; y < y2; y++)
- {
- place_outer_bold(floor_ptr, y, x1);
- place_outer_bold(floor_ptr, y, x2);
- }
-
- /* Make a couple of entrances */
- if (one_in_(2))
- {
- /* left and right */
- y = randint1(ysize) + y1;
- place_floor_bold(floor_ptr, y, x1);
- place_floor_bold(floor_ptr, y, x2);
- }
- else
- {
- /* top and bottom */
- x = randint1(xsize) + x1;
- place_floor_bold(floor_ptr, y1, x);
- place_floor_bold(floor_ptr, y2, x);
- }
+ y = randint1(ysize) + y1;
+ place_floor_bold(floor_ptr, y, x1);
+ place_floor_bold(floor_ptr, y, x2);
+ }
+ else
+ {
+ /* top and bottom */
+ x = randint1(xsize) + x1;
+ place_floor_bold(floor_ptr, y1, x);
+ place_floor_bold(floor_ptr, y2, x);
+ }
- /* Select size of keep */
- t1 = randint1(ysize / 3) + y1;
- t2 = y2 - randint1(ysize / 3);
- t3 = randint1(xsize / 3) + x1;
- t4 = x2 - randint1(xsize / 3);
+ /* Select size of keep */
+ t1 = randint1(ysize / 3) + y1;
+ t2 = y2 - randint1(ysize / 3);
+ t3 = randint1(xsize / 3) + x1;
+ t4 = x2 - randint1(xsize / 3);
- /* Do outside areas */
+ /* Do outside areas */
- /* Above and below keep */
- build_recursive_room(floor_ptr, x1 + 1, y1 + 1, x2 - 1, t1, power + 1);
- build_recursive_room(floor_ptr, x1 + 1, t2, x2 - 1, y2, power + 1);
+ /* Above and below keep */
+ build_recursive_room(floor_ptr, x1 + 1, y1 + 1, x2 - 1, t1, power + 1);
+ build_recursive_room(floor_ptr, x1 + 1, t2, x2 - 1, y2, power + 1);
- /* Left and right of keep */
- build_recursive_room(floor_ptr, x1 + 1, t1 + 1, t3, t2 - 1, power + 3);
- build_recursive_room(floor_ptr, t4, t1 + 1, x2 - 1, t2 - 1, power + 3);
+ /* Left and right of keep */
+ build_recursive_room(floor_ptr, x1 + 1, t1 + 1, t3, t2 - 1, power + 3);
+ build_recursive_room(floor_ptr, t4, t1 + 1, x2 - 1, t2 - 1, power + 3);
- /* Make the keep itself: */
- x1 = t3;
- x2 = t4;
- y1 = t1;
- y2 = t2;
- xsize = x2 - x1;
- ysize = y2 - y1;
- power += 2;
+ /* Make the keep itself: */
+ x1 = t3;
+ x2 = t4;
+ y1 = t1;
+ y2 = t2;
+ xsize = x2 - x1;
+ ysize = y2 - y1;
+ power += 2;
- /* Fall through */
- }
- case 4:
+ /* Fall through */
+ }
+ case 4:
+ {
+ /* Try to build a room */
+ if ((xsize < 3) || (ysize < 3))
{
- /* Try to build a room */
- if ((xsize < 3) || (ysize < 3))
+ for (y = y1; y < y2; y++)
{
- for (y = y1; y < y2; y++)
+ for (x = x1; x < x2; x++)
{
- for (x = x1; x < x2; x++)
- {
- place_inner_bold(floor_ptr, y, x);
- }
+ place_inner_bold(floor_ptr, y, x);
}
-
- /* Too small */
- return;
}
- /* Make outside walls */
- /* top and bottom */
- for (x = x1 + 1; x <= x2 - 1; x++)
- {
- place_inner_bold(floor_ptr, y1 + 1, x);
- place_inner_bold(floor_ptr, y2 - 1, x);
- }
+ /* Too small */
+ return;
+ }
- /* left and right */
- for (y = y1 + 1; y <= y2 - 1; y++)
- {
- place_inner_bold(floor_ptr, y, x1 + 1);
- place_inner_bold(floor_ptr, y, x2 - 1);
- }
+ /* Make outside walls */
+ /* top and bottom */
+ for (x = x1 + 1; x <= x2 - 1; x++)
+ {
+ place_inner_bold(floor_ptr, y1 + 1, x);
+ place_inner_bold(floor_ptr, y2 - 1, x);
+ }
- /* Make a door */
- y = randint1(ysize - 3) + y1 + 1;
+ /* left and right */
+ for (y = y1 + 1; y <= y2 - 1; y++)
+ {
+ place_inner_bold(floor_ptr, y, x1 + 1);
+ place_inner_bold(floor_ptr, y, x2 - 1);
+ }
- if (one_in_(2))
- {
- /* left */
- place_floor_bold(floor_ptr, y, x1 + 1);
- }
- else
- {
- /* right */
- place_floor_bold(floor_ptr, y, x2 - 1);
- }
+ /* Make a door */
+ y = randint1(ysize - 3) + y1 + 1;
- /* Build the room */
- build_recursive_room(floor_ptr, x1 + 2, y1 + 2, x2 - 2, y2 - 2, power + 3);
- break;
+ if (one_in_(2))
+ {
+ /* left */
+ place_floor_bold(floor_ptr, y, x1 + 1);
}
- case 2:
+ else
+ {
+ /* right */
+ place_floor_bold(floor_ptr, y, x2 - 1);
+ }
+
+ /* Build the room */
+ build_recursive_room(floor_ptr, x1 + 2, y1 + 2, x2 - 2, y2 - 2, power + 3);
+ break;
+ }
+ case 2:
+ {
+ /* Try and divide vertically */
+ if (xsize < 3)
{
- /* Try and divide vertically */
- if (xsize < 3)
+ /* Too small */
+ for (y = y1; y < y2; y++)
{
- /* Too small */
- for (y = y1; y < y2; y++)
+ for (x = x1; x < x2; x++)
{
- for (x = x1; x < x2; x++)
- {
- place_inner_bold(floor_ptr, y, x);
- }
+ place_inner_bold(floor_ptr, y, x);
}
- return;
}
-
- t1 = randint1(xsize - 2) + x1 + 1;
- build_recursive_room(floor_ptr, x1, y1, t1, y2, power - 2);
- build_recursive_room(floor_ptr, t1 + 1, y1, x2, y2, power - 2);
- break;
+ return;
}
- case 3:
+
+ t1 = randint1(xsize - 2) + x1 + 1;
+ build_recursive_room(floor_ptr, x1, y1, t1, y2, power - 2);
+ build_recursive_room(floor_ptr, t1 + 1, y1, x2, y2, power - 2);
+ break;
+ }
+ case 3:
+ {
+ /* Try and divide horizontally */
+ if (ysize < 3)
{
- /* Try and divide horizontally */
- if (ysize < 3)
+ /* Too small */
+ for (y = y1; y < y2; y++)
{
- /* Too small */
- for (y = y1; y < y2; y++)
+ for (x = x1; x < x2; x++)
{
- for (x = x1; x < x2; x++)
- {
- place_inner_bold(floor_ptr, y, x);
- }
+ place_inner_bold(floor_ptr, y, x);
}
- return;
}
-
- t1 = randint1(ysize - 2) + y1 + 1;
- build_recursive_room(floor_ptr, x1, y1, x2, t1, power - 2);
- build_recursive_room(floor_ptr, x1, t1 + 1, x2, y2, power - 2);
- break;
+ return;
}
+
+ t1 = randint1(ysize - 2) + y1 + 1;
+ build_recursive_room(floor_ptr, x1, y1, x2, t1, power - 2);
+ build_recursive_room(floor_ptr, x1, t1 + 1, x2, y2, power - 2);
+ break;
+ }
}
}
* trying to fix the circular rooms.)
*/
- /* h1-h4 are constants that describe the metric */
+ /* h1-h4 are constants that describe the metric */
if (dx >= 2 * dy) return (dx + (dy * h1) / h2);
if (dy >= 2 * dx) return (dy + (dx * h1) / h2);
return (((dx + dy) * 128) / 181 +
void generate_room_floor(floor_type *floor_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2, int light)
{
POSITION y, x;
-
+
grid_type *g_ptr;
for (y = y1; y <= y2; y++)
for (x = x1; x <= x2; x++)
{
/* Point to grid */
- place_inner_perm_bold(floor_ptr ,y, x);
+ place_inner_perm_bold(floor_ptr, y, x);
}
}
}
floor_type *floor_ptr = player_ptr->current_floor_ptr;
switch (typ)
{
- /* Build an appropriate room */
+ /* Build an appropriate room */
case ROOM_T_NORMAL: return build_type1(floor_ptr);
case ROOM_T_OVERLAP: return build_type2(floor_ptr);
case ROOM_T_CROSS: return build_type3(player_ptr);
*/
#define MOVE_PLIST(dst, src) (prob_list[dst] += prob_list[src], prob_list[src] = 0)
-/*!
- * @brief 部屋生成処理のメインルーチン(Sangbandを経由してOangbandからの実装を引用) / Generate rooms in dungeon. Build bigger rooms at first. [from SAngband (originally from OAngband)]
- * @param player_ptr プレーヤーへの参照ポインタ
- * @return 部屋生成に成功した場合 TRUE を返す。
- */
+ /*!
+ * @brief 部屋生成処理のメインルーチン(Sangbandを経由してOangbandからの実装を引用) / Generate rooms in dungeon. Build bigger rooms at first. [from SAngband (originally from OAngband)]
+ * @param player_ptr プレーヤーへの参照ポインタ
+ * @return 部屋生成に成功した場合 TRUE を返す。
+ */
bool generate_rooms(player_type *player_ptr)
{
floor_type *floor_ptr = player_ptr->current_floor_ptr;
* XXX -- Various dungeon types and options.
*/
- /*! @details ダンジョンにBEGINNER、CHAMELEON、SMALLESTいずれのフラグもなく、
- * かつ「常に通常でない部屋を生成する」フラグがONならば、
- * GRATER_VAULTのみを生成対象とする。 / Ironman sees only Greater Vaults */
+ /*! @details ダンジョンにBEGINNER、CHAMELEON、SMALLESTいずれのフラグもなく、
+ * かつ「常に通常でない部屋を生成する」フラグがONならば、
+ * GRATER_VAULTのみを生成対象とする。 / Ironman sees only Greater Vaults */
if (ironman_rooms && !((d_info[floor_ptr->dungeon_idx].flags1 & (DF1_BEGINNER | DF1_CHAMELEON | DF1_SMALLEST))))
{
for (i = 0; i < ROOM_T_MAX; i++)
* are included in all such copies. Other copyrights may also apply.
*/
-/* Purpose: Angband utilities -BEN- */
+ /* Purpose: Angband utilities -BEN- */
#include "angband.h"
#include "core.h"
#ifdef ACORN
-/*
- * Most of the "file" routines for "ACORN" should be in "main-acn.c"
- */
+ /*
+ * Most of the "file" routines for "ACORN" should be in "main-acn.c"
+ */
#else /* ACORN */
#ifdef SET_UID
-/*
- * Extract a "parsed" path from an initial filename
- * Normally, we simply copy the filename into the buffer
- * But leading tilde symbols must be handled in a special way
- * Replace "~user/" by the home directory of the user named "user"
- * Replace "~/" by the home directory of the current user
- */
+ /*
+ * Extract a "parsed" path from an initial filename
+ * Normally, we simply copy the filename into the buffer
+ * But leading tilde symbols must be handled in a special way
+ * Replace "~user/" by the home directory of the user named "user"
+ * Replace "~/" by the home directory of the current user
+ */
errr path_parse(char *buf, int max, concptr file)
{
concptr u, s;
}
/* Point at the user */
- u = file+1;
+ u = file + 1;
/* Look for non-user portion of the file */
s = my_strstr(u, PATH_SEP);
#else /* SET_UID */
-/*
- * Extract a "parsed" path from an initial filename
- *
- * This requires no special processing on simple machines,
- * except for verifying the size of the filename.
- */
+ /*
+ * Extract a "parsed" path from an initial filename
+ *
+ * This requires no special processing on simple machines,
+ * except for verifying the size of the filename.
+ */
errr path_parse(char *buf, int max, concptr file)
{
/* Accept the filename */
(void)strnfmt(buf, max, "%s", file);
#if defined(MAC_MPW) && defined(CARBON)
- /* Fix it according to the current operating system */
- convert_pathname(buf);
+ /* Fix it according to the current operating system */
+ convert_pathname(buf);
#endif /* MAC_MPW && CARBON */
/* Success */
#endif /* MACINTOSH */
-/*
- * Several systems have no "O_BINARY" flag
- */
+ /*
+ * Several systems have no "O_BINARY" flag
+ */
#ifndef O_BINARY
# define O_BINARY 0
#endif /* O_BINARY */
-/*
- * Hack -- attempt to delete a file
- */
+ /*
+ * Hack -- attempt to delete a file
+ */
errr fd_kill(concptr file)
{
char buf[1024];
if (src_fd < 0) return -1;
/* Open destination file */
- dst_fd = fd_open(aux, O_WRONLY|O_TRUNC|O_CREAT);
+ dst_fd = fd_open(aux, O_WRONLY | O_TRUNC | O_CREAT);
if (dst_fd < 0) return -1;
/* Copy */
/*
- * Important note about "colors"
+ * Important note about "colors"
*
* The "TERM_*" color definitions list the "composition" of each
* "Angband color" in terms of "quarters" of each of the three color
*/
-/*
- * Move the cursor
- */
+ /*
+ * Move the cursor
+ */
void move_cursor(int row, int col)
{
Term_gotoxy(col, row);
*/
static char octify(uint i)
{
- return (hexsym[i%8]);
+ return (hexsym[i % 8]);
}
/*
*/
static char hexify(uint i)
{
- return (hexsym[i%16]);
+ return (hexsym[i % 16]);
}
if (macro_template == NULL)
return;
-
+
for (i = 0; macro_modifier_chr[i]; i++)
mod_status[i] = FALSE;
str++;
/* Examine modifier keys */
while (TRUE)
{
- for (i=0; macro_modifier_chr[i]; i++)
+ for (i = 0; macro_modifier_chr[i]; i++)
{
len = strlen(macro_modifier_name[i]);
-
- if(!my_strnicmp(str, macro_modifier_name[i], len))
+
+ if (!my_strnicmp(str, macro_modifier_name[i], len))
break;
}
if (!macro_modifier_chr[i]) break;
char ch = macro_template[i];
int j;
- switch(ch)
+ switch (ch)
{
case '&':
for (j = 0; macro_modifier_chr[j]; j++) {
}
else
- /* Hex-mode XXX */
- if (*str == 'x')
- {
- *s = 16 * (char)dehex(*++str);
- *s++ += (char)dehex(*++str);
- }
+ /* Hex-mode XXX */
+ if (*str == 'x')
+ {
+ *s = 16 * (char)dehex(*++str);
+ *s++ += (char)dehex(*++str);
+ }
/* Hack -- simple way to specify "backslash" */
- else if (*str == '\\')
- {
- *s++ = '\\';
- }
+ else if (*str == '\\')
+ {
+ *s++ = '\\';
+ }
/* Hack -- simple way to specify "caret" */
- else if (*str == '^')
- {
- *s++ = '^';
- }
+ else if (*str == '^')
+ {
+ *s++ = '^';
+ }
/* Hack -- simple way to specify "space" */
- else if (*str == 's')
- {
- *s++ = ' ';
- }
+ else if (*str == 's')
+ {
+ *s++ = ' ';
+ }
/* Hack -- simple way to specify Escape */
- else if (*str == 'e')
- {
- *s++ = ESCAPE;
- }
+ else if (*str == 'e')
+ {
+ *s++ = ESCAPE;
+ }
/* Backspace */
- else if (*str == 'b')
- {
- *s++ = '\b';
- }
+ else if (*str == 'b')
+ {
+ *s++ = '\b';
+ }
/* Newline */
- else if (*str == 'n')
- {
- *s++ = '\n';
- }
+ else if (*str == 'n')
+ {
+ *s++ = '\n';
+ }
/* Return */
- else if (*str == 'r')
- {
- *s++ = '\r';
- }
+ else if (*str == 'r')
+ {
+ *s++ = '\r';
+ }
/* Tab */
- else if (*str == 't')
- {
- *s++ = '\t';
- }
+ else if (*str == 't')
+ {
+ *s++ = '\t';
+ }
/* Octal-mode */
- else if (*str == '0')
- {
- *s = 8 * (char)deoct(*++str);
- *s++ += (char)deoct(*++str);
- }
+ else if (*str == '0')
+ {
+ *s = 8 * (char)deoct(*++str);
+ *s++ += (char)deoct(*++str);
+ }
/* Octal-mode */
- else if (*str == '1')
- {
- *s = 64 + 8 * (char)deoct(*++str);
- *s++ += (char)deoct(*++str);
- }
+ else if (*str == '1')
+ {
+ *s = 64 + 8 * (char)deoct(*++str);
+ *s++ += (char)deoct(*++str);
+ }
/* Octal-mode */
- else if (*str == '2')
- {
- *s = 64 * 2 + 8 * (char)deoct(*++str);
- *s++ += (char)deoct(*++str);
- }
+ else if (*str == '2')
+ {
+ *s = 64 * 2 + 8 * (char)deoct(*++str);
+ *s++ += (char)deoct(*++str);
+ }
/* Octal-mode */
- else if (*str == '3')
- {
- *s = 64 * 3 + 8 * (char)deoct(*++str);
- *s++ += (char)deoct(*++str);
- }
+ else if (*str == '3')
+ {
+ *s = 64 * 3 + 8 * (char)deoct(*++str);
+ *s++ += (char)deoct(*++str);
+ }
/* Skip the final char */
str++;
int j;
char ch = macro_template[i];
- switch(ch)
+ switch (ch)
{
case '&':
while ((tmp = my_strchr(macro_modifier_chr, *str)) != 0)
{
j = (int)(tmp - macro_modifier_chr);
tmp = macro_modifier_name[j];
- while(*tmp) *s++ = *tmp++;
+ while (*tmp) *s++ = *tmp++;
str++;
}
break;
for (i = 0; i < max_macrotrigger; i++)
{
if (!my_stricmp(key_code, macro_trigger_keycode[0][i])
- || !my_stricmp(key_code, macro_trigger_keycode[1][i]))
+ || !my_stricmp(key_code, macro_trigger_keycode[1][i]))
break;
}
if (i == max_macrotrigger)
while (*tmp) *s++ = *tmp++;
*s++ = ']';
-
+
*bufptr = s;
*strptr = str;
return TRUE;
/* Macro Trigger */
if (i == 31)
{
- if(!trigger_ascii_to_text(&s, &str))
+ if (!trigger_ascii_to_text(&s, &str))
{
*s++ = '^';
*s++ = '_';
}
else
- if (i == ESCAPE)
- {
- *s++ = '\\';
- *s++ = 'e';
- }
- else if (i == ' ')
- {
- *s++ = '\\';
- *s++ = 's';
- }
- else if (i == '\b')
- {
- *s++ = '\\';
- *s++ = 'b';
- }
- else if (i == '\t')
- {
- *s++ = '\\';
- *s++ = 't';
- }
- else if (i == '\n')
- {
- *s++ = '\\';
- *s++ = 'n';
- }
- else if (i == '\r')
- {
- *s++ = '\\';
- *s++ = 'r';
- }
- else if (i == '^')
- {
- *s++ = '\\';
- *s++ = '^';
- }
- else if (i == '\\')
- {
- *s++ = '\\';
- *s++ = '\\';
- }
- else if (i < 32)
- {
- *s++ = '^';
- *s++ = i + 64;
- }
- else if (i < 127)
- {
- *s++ = i;
- }
- else if (i < 64)
- {
- *s++ = '\\';
- *s++ = '0';
- *s++ = octify(i / 8);
- *s++ = octify(i % 8);
- }
- else
- {
- *s++ = '\\';
- *s++ = 'x';
- *s++ = hexify(i / 16);
- *s++ = hexify(i % 16);
- }
+ if (i == ESCAPE)
+ {
+ *s++ = '\\';
+ *s++ = 'e';
+ }
+ else if (i == ' ')
+ {
+ *s++ = '\\';
+ *s++ = 's';
+ }
+ else if (i == '\b')
+ {
+ *s++ = '\\';
+ *s++ = 'b';
+ }
+ else if (i == '\t')
+ {
+ *s++ = '\\';
+ *s++ = 't';
+ }
+ else if (i == '\n')
+ {
+ *s++ = '\\';
+ *s++ = 'n';
+ }
+ else if (i == '\r')
+ {
+ *s++ = '\\';
+ *s++ = 'r';
+ }
+ else if (i == '^')
+ {
+ *s++ = '\\';
+ *s++ = '^';
+ }
+ else if (i == '\\')
+ {
+ *s++ = '\\';
+ *s++ = '\\';
+ }
+ else if (i < 32)
+ {
+ *s++ = '^';
+ *s++ = i + 64;
+ }
+ else if (i < 127)
+ {
+ *s++ = i;
+ }
+ else if (i < 64)
+ {
+ *s++ = '\\';
+ *s++ = '0';
+ *s++ = octify(i / 8);
+ *s++ = octify(i % 8);
+ }
+ else
+ {
+ *s++ = '\\';
+ *s++ = 'x';
+ *s++ = hexify(i / 16);
+ *s++ = hexify(i % 16);
+ }
}
/* Terminate */
-/*
- * Determine if any macros have ever started with a given character.
- */
+ /*
+ * Determine if any macros have ever started with a given character.
+ */
static bool macro__use[256];
* Add a macro definition (or redefinition).
*
* We should use "act == NULL" to "remove" a macro, but this might make it
- * impossible to save the "removal" of a macro definition.
+ * impossible to save the "removal" of a macro definition.
*
* We should consider refusing to allow macros which contain existing macros,
* or which are contained in existing macros, because this would simplify the
- * macro analysis code.
+ * macro analysis code.
*
* We should consider removing the "command macro" crap, and replacing it
* with some kind of "powerful keymap" ability, but this might make it hard
- * to change the "roguelike" option from inside the game.
+ * to change the "roguelike" option from inside the game.
*/
errr macro_add(concptr pat, concptr act)
{
if (player_ptr->ambush_flag)
{
if (!play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_AMBUSH)) return;
- }
+ }
- if(player_ptr->wild_mode)
+ if (player_ptr->wild_mode)
{
if (!play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_WILD)) return;
}
- if(player_ptr->current_floor_ptr->inside_arena)
+ if (player_ptr->current_floor_ptr->inside_arena)
{
if (!play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_ARENA)) return;
}
- if(player_ptr->phase_out)
+ if (player_ptr->phase_out)
{
if (!play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_BATTLE)) return;
}
- if(player_ptr->current_floor_ptr->inside_quest)
+ if (player_ptr->current_floor_ptr->inside_quest)
{
if (!play_music(TERM_XTRA_MUSIC_QUEST, player_ptr->current_floor_ptr->inside_quest)) return;
if (!play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_QUEST)) return;
}
- if(player_ptr->dungeon_idx)
+ if (player_ptr->dungeon_idx)
{
if (player_ptr->feeling == 2)
{
}
}
- if(player_ptr->town_num)
+ if (player_ptr->town_num)
{
if (!play_music(TERM_XTRA_MUSIC_TOWN, player_ptr->town_num)) return;
if (!play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_TOWN)) return;
return;
}
- if(!player_ptr->current_floor_ptr->dun_level)
+ if (!player_ptr->current_floor_ptr->dun_level)
{
if (player_ptr->lev >= 45)
{
if (!play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_FIELD1)) return;
}
}
-
+
play_music(TERM_XTRA_MUSIC_MUTE, 0);
}
* Only 500 (0+1+2+...+29+30) milliseconds may elapse between each key in
* the macro trigger sequence. If a key sequence forms the "prefix" of a
* macro trigger, 500 milliseconds must pass before the key sequence is
- * known not to be that macro trigger.
+ * known not to be that macro trigger.
*/
static char inkey_aux(void)
{
else
{
/* Wait for a keypress */
- (void) (Term_inkey(&ch, TRUE, TRUE));
+ (void)(Term_inkey(&ch, TRUE, TRUE));
}
/*
- * Mega-Hack -- special "inkey_next" pointer.
+ * Mega-Hack -- special "inkey_next" pointer.
*
* This special pointer allows a sequence of keys to be "inserted" into
* the stream of keys returned by "inkey()". This key sequence will not
#ifdef ALLOW_BORG
/*
- * Mega-Hack -- special "inkey_hack" hook.
+ * Mega-Hack -- special "inkey_hack" hook.
*
* This special function hook allows the "Borg" (see elsewhere) to take
* control of the "inkey()" function, and substitute in fake keypresses.
*/
-char (*inkey_hack)(int flush_first) = NULL;
+char(*inkey_hack)(int flush_first) = NULL;
#endif /* ALLOW_BORG */
* Note that "quark zero" is NULL and should not be "dereferenced".
*/
-/*
- * Initialize the quark array
- */
+ /*
+ * Initialize the quark array
+ */
void quark_init(void)
{
/* Quark variables */
-/*!
- * @brief 保存中の過去ゲームメッセージの数を返す。 / How many messages are "available"?
- * @return 残っているメッセージの数
- */
+ /*!
+ * @brief 保存中の過去ゲームメッセージの数を返す。 / How many messages are "available"?
+ * @return 残っているメッセージの数
+ */
s32b message_num(void)
{
int last, next, n;
for (n = 0; n < 80; n++, t++)
{
- if(iskanji(*t)) {
+ if (iskanji(*t)) {
t++;
n++;
}
if (n == 60) n = 80;
#endif
splitted2 = str + n;
- strncpy(splitted1, str ,n);
+ strncpy(splitted1, str, n);
splitted1[n] = '\0';
str = splitted1;
- } else {
+ }
+ else {
splitted2 = NULL;
}
/* Find multiple */
#ifdef JP
- for (t = buf; *t && (*t != '<' || (*(t+1) != 'x' )); t++)
- if(iskanji(*t))t++;
+ for (t = buf; *t && (*t != '<' || (*(t + 1) != 'x')); t++)
+ if (iskanji(*t))t++;
#else
for (t = buf; *t && (*t != '<'); t++);
#endif
*(t - 1) = '\0';
/* Get multiplier */
- j = atoi(t+2);
+ j = atoi(t + 2);
}
/* Limit the multiplier to 1000 */
message__tail = message__head + n + 1;
/* Advance tail while possible past first "nul" */
- while (message__buf[message__tail-1]) message__tail++;
+ while (message__buf[message__tail - 1]) message__tail++;
/* Kill all "dead" messages */
for (i = message__last; TRUE; i++)
/* recursively add splitted message (added by Mogami) */
end_of_message_add:
if (splitted2 != NULL)
- message_add(splitted2);
+ message_add(splitted2);
}
byte a = TERM_L_BLUE;
bool nagasu = FALSE;
- if ((auto_more && !player_ptr->now_damaged) || num_more < 0){
+ if ((auto_more && !player_ptr->now_damaged) || num_more < 0) {
int i;
for (i = 0; i < 8; i++)
{
{
int cmd = inkey();
if (cmd == ESCAPE) {
- num_more = -9999; /*auto_moreのとき、全て流す。 */
- break;
- } else if (cmd == ' ') {
- num_more = 0; /*1画面だけ流す。 */
- break;
- } else if ((cmd == '\n') || (cmd == '\r')) {
- num_more--; /*1行だけ流す。 */
- break;
+ num_more = -9999; /*auto_moreのとき、全て流す。 */
+ break;
+ }
+ else if (cmd == ' ') {
+ num_more = 0; /*1画面だけ流す。 */
+ break;
+ }
+ else if ((cmd == '\n') || (cmd == '\r')) {
+ num_more--; /*1行だけ流す。 */
+ break;
}
if (quick_messages) break;
bell();
if (!cheat_hear && cheat_type == CHEAT_MONSTER) return;
if (!cheat_xtra && cheat_type == CHEAT_MISC) return;
- concptr cheat_mes[] = {"ITEM", "MONS", "DUNG", "MISC"};
+ concptr cheat_mes[] = { "ITEM", "MONS", "DUNG", "MISC" };
char buf[1024];
sprintf(buf, "WIZ-%s:%s", cheat_mes[cheat_type], msg);
msg_print(buf);
*/
void msg_format_wizard(int cheat_type, concptr fmt, ...)
{
- if(!cheat_room && cheat_type == CHEAT_DUNGEON) return;
- if(!cheat_peek && cheat_type == CHEAT_OBJECT) return;
- if(!cheat_hear && cheat_type == CHEAT_MONSTER) return;
- if(!cheat_xtra && cheat_type == CHEAT_MISC) return;
+ if (!cheat_room && cheat_type == CHEAT_DUNGEON) return;
+ if (!cheat_peek && cheat_type == CHEAT_OBJECT) return;
+ if (!cheat_hear && cheat_type == CHEAT_MONSTER) return;
+ if (!cheat_xtra && cheat_type == CHEAT_MISC) return;
va_list vp;
char buf[1024];
(void)Term_locate(&x, &y);
/* Hack -- No more space */
- if( y == h - 1 && x > w - 3) return;
+ if (y == h - 1 && x > w - 3) return;
/* Process the string */
for (s = str; *s; s++)
y++;
/* No more space */
- if( y == h ) break;
+ if (y == h) break;
/* Clear line, move cursor */
Term_erase(x, y, 255);
/* Wrap words as needed */
#ifdef JP
- if (( x >= ( (k_flag) ? w - 2 : w - 1 ) ) && (ch != ' '))
+ if ((x >= ((k_flag) ? w - 2 : w - 1)) && (ch != ' '))
#else
if ((x >= w - 1) && (ch != ' '))
#endif
if (x < w)
#ifdef JP
{
- /* 現在が半角文字の場合 */
- if( !k_flag )
+ /* 現在が半角文字の場合 */
+ if (!k_flag)
#endif
- {
- /* Scan existing text */
- for (i = w - 2; i >= 0; i--)
{
- /* Grab existing attr/char */
- Term_what(i, y, &av[i], &cv[i]);
+ /* Scan existing text */
+ for (i = w - 2; i >= 0; i--)
+ {
+ /* Grab existing attr/char */
+ Term_what(i, y, &av[i], &cv[i]);
- /* Break on space */
- if (cv[i] == ' ') break;
+ /* Break on space */
+ if (cv[i] == ' ') break;
- /* Track current word */
- n = i;
+ /* Track current word */
+ n = i;
#ifdef JP
- if (cv[i] == '(') break;
+ if (cv[i] == '(') break;
#endif
+ }
}
- }
#ifdef JP
- else
- {
- /* 現在が全角文字のとき */
- /* 文頭が「。」「、」等になるときは、その1つ前の語で改行 */
- if (strncmp(s, "。", 2) == 0 || strncmp(s, "、", 2) == 0)
+ else
{
- Term_what(x , y, &av[x ], &cv[x ]);
- Term_what(x-1, y, &av[x-1], &cv[x-1]);
- Term_what(x-2, y, &av[x-2], &cv[x-2]);
- n = x - 2;
- cv[ x ] = '\0';
+ /* 現在が全角文字のとき */
+ /* 文頭が「。」「、」等になるときは、その1つ前の語で改行 */
+ if (strncmp(s, "。", 2) == 0 || strncmp(s, "、", 2) == 0)
+ {
+ Term_what(x, y, &av[x], &cv[x]);
+ Term_what(x - 1, y, &av[x - 1], &cv[x - 1]);
+ Term_what(x - 2, y, &av[x - 2], &cv[x - 2]);
+ n = x - 2;
+ cv[x] = '\0';
+ }
}
}
- }
#endif
/* Special case */
if (n == 0) n = w;
y++;
/* No more space */
- if( y == h ) break;
+ if (y == h) break;
/* Clear line, move cursor */
Term_erase(x, y, 255);
for (i = n; i < w - 1; i++)
{
#ifdef JP
- if( cv[i] == '\0' ) break;
+ if (cv[i] == '\0') break;
#endif
/* Dump */
Term_addch(av[i], cv[i]);
/* Dump */
#ifdef JP
- Term_addch((byte)(a|0x10), ch);
+ Term_addch((byte)(a | 0x10), ch);
#else
Term_addch(a, ch);
#endif
s++;
x++;
ch = *s;
- Term_addch((byte)(a|0x20), ch);
+ Term_addch((byte)(a | 0x20), ch);
}
#endif
/* Advance */
if (iskanji(buf[i])) next_pos++;
#endif
- /* Is there the cursor at next position? */
+ /* Is there the cursor at next position? */
if (next_pos >= pos) break;
/* Move to next */
if (iskanji(buf[i])) next_pos++;
#endif
- /* Is there the cursor at next position? */
+ /* Is there the cursor at next position? */
if (next_pos >= pos) break;
/* Move to next */
/* Hack -- Build a "useful" prompt */
if (mode & CHECK_OKAY_CANCEL)
{
- my_strcpy(buf, prompt, sizeof(buf)-15);
+ my_strcpy(buf, prompt, sizeof(buf) - 15);
strcat(buf, "[(O)k/(C)ancel]");
}
else if (mode & CHECK_DEFAULT_Y)
{
- my_strcpy(buf, prompt, sizeof(buf)-5);
+ my_strcpy(buf, prompt, sizeof(buf) - 5);
strcat(buf, "[Y/n]");
}
else
{
- my_strcpy(buf, prompt, sizeof(buf)-5);
+ my_strcpy(buf, prompt, sizeof(buf) - 5);
strcat(buf, "[y/n]");
}
/*
- * Pause for user response
+ * Pause for user response
*/
void pause_line(int row)
{
concptr menu_name;
if (!menu) old_num = num;
put_str("+----------------------------------------------------+", basey, basex);
- put_str("| |", basey+1, basex);
- put_str("| |", basey+2, basex);
- put_str("| |", basey+3, basex);
- put_str("| |", basey+4, basex);
- put_str("| |", basey+5, basex);
- put_str("+----------------------------------------------------+", basey+6, basex);
-
- for(i = 0; i < 10; i++)
+ put_str("| |", basey + 1, basex);
+ put_str("| |", basey + 2, basex);
+ put_str("| |", basey + 3, basex);
+ put_str("| |", basey + 4, basex);
+ put_str("| |", basey + 5, basex);
+ put_str("+----------------------------------------------------+", basey + 6, basex);
+
+ for (i = 0; i < 10; i++)
{
int hoge;
if (!menu_info[menu][i].cmd) break;
menu_name = menu_info[menu][i].name;
- for(hoge = 0; ; hoge++)
+ for (hoge = 0; ; hoge++)
{
if (!special_menu_info[hoge].name[0]) break;
if ((menu != special_menu_info[hoge].window) || (i != special_menu_info[hoge].number)) continue;
- switch(special_menu_info[hoge].jouken)
+ switch (special_menu_info[hoge].jouken)
{
case MENU_CLASS:
if (p_ptr->pclass == special_menu_info[hoge].jouken_naiyou) menu_name = special_menu_info[hoge].name;
}
max_num = i;
kisuu = max_num % 2;
- put_str(_("》", "> "),basey + 1 + num / 2, basex + 2 + (num % 2) * 24);
+ put_str(_("》", "> "), basey + 1 + num / 2, basex + 2 + (num % 2) * 24);
/* Place the cursor on the player */
move_cursor_relative(p_ptr->y, p_ptr->x);
* Note that this command is used both in the dungeon and in
* stores, and must be careful to work in both situations.
*
- * Note that "p_ptr->command_new" may not work any more.
+ * Note that "p_ptr->command_new" may not work any more.
*/
void request_command(int shopping)
{
cmd = inkey();
if (!shopping && command_menu && ((cmd == '\r') || (cmd == '\n') || (cmd == 'x') || (cmd == 'X'))
- && !keymap_act[mode][(byte)(cmd)])
+ && !keymap_act[mode][(byte)(cmd)])
cmd = inkey_from_menu();
}
concptr s;
if ((s = keymap_act[mode][i]) != NULL)
{
- if (*s == command_cmd && *(s+1) == 0)
+ if (*s == command_cmd && *(s + 1) == 0)
{
caretcmd = i;
break;
#define CUTOFF 4
-/*
- * Exchange two sort-entries
- * (should probably be coded inline
- * for speed increase)
- */
+ /*
+ * Exchange two sort-entries
+ * (should probably be coded inline
+ * for speed increase)
+ */
static void swap(tag_type *a, tag_type *b)
{
tag_type temp;
{
pivot = median3(elements, left, right);
- i = left; j = right -1;
+ i = left; j = right - 1;
while (TRUE)
{
};
-/*
+/*
* Build the gamma table so that floating point isn't needed.
- *
+ *
* Note gamma goes from 0->256. The old value of 100 is now 128.
*/
void build_gamma_table(int gamma)
{
int i, n;
-
+
/*
* value is the current sum.
* diff is the new term to add to the series.
*/
long value, diff;
-
+
/* Hack - convergence is bad in these cases. */
gamma_table[0] = 0;
gamma_table[255] = 255;
-
+
for (i = 1; i < 255; i++)
{
- /*
+ /*
* Initialise the Taylor series
*
* value and diff have been scaled by 256
*/
-
+
n = 1;
value = 256 * 256;
diff = ((long)gamma_helper[i]) * (gamma - 256);
-
+
while (diff)
{
value += diff;
n++;
-
-
+
+
/*
* Use the following identiy to calculate the gamma table.
* exp(x) = 1 + x + x^2/2 + x^3/(2*3) + x^4/(2*3*4) +...
*
* n is the current term number.
- *
+ *
* The gamma_helper array contains a table of
* ln(x/256) * 256
* This is used because a^b = exp(b*ln(a))
*/
diff = (((diff / 256) * gamma_helper[i]) * (gamma - 256)) / (256 * n);
}
-
- /*
+
+ /*
* Store the value in the table so that the
* floating point pow function isn't needed .
*/
/* Activate the main window, as all pastes go there. */
Term_activate(term_screen);
- for (s = str; s < str+len; s++)
+ for (s = str; s < str + len; s++)
{
/* Catch end of string */
if (*s == '\0') break;
ch[0] = str[read_pt];
ch[1] = '\0';
#ifdef JP
- kanji = iskanji(ch[0]);
+ kanji = iskanji(ch[0]);
if (kanji)
{
- ch[1] = str[read_pt+1];
+ ch[1] = str[read_pt + 1];
ch_len = 2;
if (strcmp(ch, "。") == 0 ||
- strcmp(ch, "、") == 0 ||
- strcmp(ch, "ィ") == 0 ||
- strcmp(ch, "ー") == 0)
+ strcmp(ch, "、") == 0 ||
+ strcmp(ch, "ィ") == 0 ||
+ strcmp(ch, "ー") == 0)
kinsoku = TRUE;
}
else if (!isprint(ch[0]))
word_len = read_pt - word_punct;
#ifdef JP
if (kanji && !kinsoku)
- /* nothing */ ;
+ /* nothing */;
else
#endif
- if (ch[0] == ' ' || word_len >= line_len/2)
- read_pt++;
- else
- {
- read_pt = word_punct;
- if (str[word_punct] == ' ')
+ if (ch[0] == ' ' || word_len >= line_len / 2)
read_pt++;
- write_pt -= word_len;
- }
+ else
+ {
+ read_pt = word_punct;
+ if (str[word_punct] == ' ')
+ read_pt++;
+ write_pt -= word_len;
+ }
tbuf[write_pt++] = '\0';
line_len = 0;
#endif
}
tbuf[write_pt] = '\0';
- tbuf[write_pt+1] = '\0';
+ tbuf[write_pt + 1] = '\0';
return;
}
{
if (iskanji(*s))
{
- if (len + 1 >= bufsize || !*(s+1)) break;
+ if (len + 1 >= bufsize || !*(s + 1)) break;
*d++ = *s++;
*d++ = *s++;
len += 2;
*d = '\0';
}
- while(*s++) len++;
+ while (*s++) len++;
return len;
if (l1 >= l2)
{
- for(i = 0; i <= l1 - l2; i++)
+ for (i = 0; i <= l1 - l2; i++)
{
- if(!strncmp(haystack + i, needle, l2))
+ if (!strncmp(haystack + i, needle, l2))
return (char *)haystack + i;
#ifdef JP
*/
char *my_strchr(concptr ptr, char ch)
{
- for ( ; *ptr != '\0'; ptr++)
+ for (; *ptr != '\0'; ptr++)
{
if (*ptr == ch) return (char *)ptr;
for (i = 0; special_key_list[i].keyname; i++)
{
if ((!special_key_list[i].numpad || numpad_cursor) &&
- streq(str, special_key_list[i].keyname))
+ streq(str, special_key_list[i].keyname))
{
skey = special_key_list[i].keycode;
break;
#define KTRL(X) ((X) & 0x1F)
#define ESCAPE '\033'
-/*
- * Hack -- Prepare to use the "Secure" routines
- */
+ /*
+ * Hack -- Prepare to use the "Secure" routines
+ */
#if defined(SET_UID) && defined(SECURE)
extern int PlayerUID;
# define getuid() PlayerUID
#define MAX_MACRO_MOD 12
#define MAX_MACRO_TRIG 200 /*!< 登録を許すマクロ(トリガー)の最大数 */
-/*
- * Object flags
- *
- * Old variables for object flags such as flags1, flags2, and flags3
- * are obsolated. Now single array flgs[TR_FLAG_SIZE] contains all
- * object flags. And each flag is refered by single index number
- * instead of a bit mask.
- *
- * Therefore it's very easy to add a lot of new flags; no one need to
- * worry about in which variable a new flag should be put, nor to
- * modify a huge number of files all over the source directory at once
- * to add new flag variables such as flags4, a_ability_flags1, etc...
- *
- * All management of flags is now treated using a set of macros
- * instead of bit operations.
- * Note: These macros are using division, modulo, and bit shift
- * operations, and it seems that these operations are rather slower
- * than original bit operation. But since index numbers are almost
- * always given as constant, such slow operations are performed in the
- * compile time. So there is no problem on the speed.
- *
- * Exceptions of new flag management is a set of flags to control
- * object generation and the curse flags. These are not yet rewritten
- * in new index form; maybe these have no merit of rewriting.
- */
+ /*
+ * Object flags
+ *
+ * Old variables for object flags such as flags1, flags2, and flags3
+ * are obsolated. Now single array flgs[TR_FLAG_SIZE] contains all
+ * object flags. And each flag is refered by single index number
+ * instead of a bit mask.
+ *
+ * Therefore it's very easy to add a lot of new flags; no one need to
+ * worry about in which variable a new flag should be put, nor to
+ * modify a huge number of files all over the source directory at once
+ * to add new flag variables such as flags4, a_ability_flags1, etc...
+ *
+ * All management of flags is now treated using a set of macros
+ * instead of bit operations.
+ * Note: These macros are using division, modulo, and bit shift
+ * operations, and it seems that these operations are rather slower
+ * than original bit operation. But since index numbers are almost
+ * always given as constant, such slow operations are performed in the
+ * compile time. So there is no problem on the speed.
+ *
+ * Exceptions of new flag management is a set of flags to control
+ * object generation and the curse flags. These are not yet rewritten
+ * in new index form; maybe these have no merit of rewriting.
+ */
#define have_flag(ARRAY, INDEX) !!((ARRAY)[(INDEX)/32] & (1L << ((INDEX)%32)))
#define add_flag(ARRAY, INDEX) ((ARRAY)[(INDEX)/32] |= (1L << ((INDEX)%32)))
#define is_pval_flag(INDEX) ((TR_STR <= (INDEX) && (INDEX) <= TR_MAGIC_MASTERY) || (TR_STEALTH <= (INDEX) && (INDEX) <= TR_BLOWS))
#define have_pval_flags(ARRAY) !!((ARRAY)[0] & (0x00003f7f))
- /*
- Language selection macro
- */
+ /*
+ Language selection macro
+ */
#ifdef JP
#define _(JAPANESE,ENGLISH) (JAPANESE)
#else
#endif
- /*
- * Sort-array element
- */
+ /*
+ * Sort-array element
+ */
typedef struct tag_type tag_type;
struct tag_type
#define SOUND_GLASS 65 /*!< A glass feature was crashed */
#define SOUND_REFLECT 66 /*!< A bolt was reflected */
-/*
- * Mega-Hack -- maximum known sounds
- */
+ /*
+ * Mega-Hack -- maximum known sounds
+ */
#define SOUND_MAX 67 /*!< 効果音定義の最大数 */
-/*!
- * @brief 銘情報の最大数 / Maximum number of "quarks" (see "io.c")
- * @note
- * Default: assume at most 512 different inscriptions are used<br>
- * Was 512... 256 quarks added for random artifacts<br>
- */
+ /*!
+ * @brief 銘情報の最大数 / Maximum number of "quarks" (see "io.c")
+ * @note
+ * Default: assume at most 512 different inscriptions are used<br>
+ * Was 512... 256 quarks added for random artifacts<br>
+ */
#define QUARK_MAX 768
-/*
- * OPTION: Maximum number of messages to remember (see "io.c")
- * Default: assume maximal memorization of 2048 total messages
- */
+ /*
+ * OPTION: Maximum number of messages to remember (see "io.c")
+ * Default: assume maximal memorization of 2048 total messages
+ */
#define MESSAGE_MAX 81920
-/*
- * OPTION: Maximum space for the message text buffer (see "io.c")
- * Default: assume that each of the 2048 messages is repeated an
- * average of three times, and has an average length of 48
- */
+ /*
+ * OPTION: Maximum space for the message text buffer (see "io.c")
+ * Default: assume that each of the 2048 messages is repeated an
+ * average of three times, and has an average length of 48
+ */
#define MESSAGE_BUF 655360
-/*
- * Hack -- The main "screen"
- */
+ /*
+ * Hack -- The main "screen"
+ */
#define term_screen (angband_term[0])
-/*
- * Hack -- conditional (or "bizarre") externs
- */
+ /*
+ * Hack -- conditional (or "bizarre") externs
+ */
#ifdef SET_UID
extern void user_name(char *buf, int id);
* are included in all such copies.
*/
-/* Purpose: a generic, efficient, terminal window package -BEN- */
+ /* Purpose: a generic, efficient, terminal window package -BEN- */
#include "angband.h"
#include "term.h"
* By FIRST
*/
#endif
-/*
- * This file provides a generic, efficient, terminal window package,
- * which can be used not only on standard terminal environments such
- * as dumb terminals connected to a Unix box, but also in more modern
- * "graphic" environments, such as the Macintosh or Unix/X11.
- *
- * Each "window" works like a standard "dumb terminal", that is, it
- * can display a two dimensional array of grids containing colored
- * textual symbols, plus an optional cursor, and it can be used to
- * get keypress events from the user.
- *
- * In fact, this package can simply be used, if desired, to support
- * programs which will look the same on a dumb terminal as they do
- * on a graphic platform such as the Macintosh.
- *
- * This package was designed to help port the game "Angband" to a wide
- * variety of different platforms. Angband, like many other games in
- * the "rogue-like" heirarchy, requires, at the minimum, the ability
- * to display "colored textual symbols" in a standard 80x24 "window",
- * such as that provided by most dumb terminals, and many old personal
- * computers, and to check for "keypresses" from the user. The major
- * concerns were thus portability and efficiency, so Angband could be
- * easily ported to many different systems, with minimal effort, and
- * yet would run quickly on each of these sys
- tems, no matter what kind
- * of underlying hardware/software support was being used.
- *
- * It is important to understand the differences between the older
- * "dumb terminals" and the newer "graphic interface" machines, since
- * this package was designed to work with both types of systems.
- *
- * New machines:
- * waiting for a keypress is complex
- * checking for a keypress is often cheap
- * changing "colors" may be expensive
- * the "color" of a "blank" is rarely important
- * moving the "cursor" is relatively cheap
- * use a "software" cursor (only moves when requested)
- * drawing characters normally will not erase old ones
- * drawing a character on the cursor often erases it
- * may have fast routines for "clear a region"
- * the bottom right corner is usually not special
- *
- * Old machines:
- * waiting for a keypress is simple
- * checking for a keypress is often expensive
- * changing "colors" is usually cheap
- * the "color" of a "blank" may be important
- * moving the "cursor" may be expensive
- * use a "hardware" cursor (moves during screen updates)
- * drawing new symbols automatically erases old ones
- * characters may only be drawn at the cursor location
- * drawing a character on the cursor will move the cursor
- * may have fast routines for "clear entire window"
- * may have fast routines for "clear to end of line"
- * the bottom right corner is often dangerous
- *
- *
- * This package provides support for multiple windows, each of an
- * arbitrary size (up to 255x255), each with its own set of flags,
- * and its own hooks to handle several low-level procedures which
- * differ from platform to platform. Then the main program simply
- * creates one or more "term" structures, setting the various flags
- * and hooks in a manner appropriate for the current platform, and
- * then it can use the various "term" structures without worrying
- * about the underlying platform.
- *
- *
- * This package allows each "grid" in each window to hold an attr/char
- * pair, with each ranging from 0 to 255, and makes very few assumptions
- * about the meaning of any attr/char values. Normally, we assume that
- * "attr 0" is "black", with the semantics that "black" text should be
- * sent to "Term_wipe()" instead of "Term_text()", but this sematics is
- * modified if either the "always_pict" or the "always_text" flags are
- * set. We assume that "char 0" is "dangerous", since placing such a
- * "char" in the middle of a string "terminates" the string, and usually
- * we prevent its use.
- *
- * Finally, we use a special attr/char pair, defaulting to "attr 0" and
- * "char 32", also known as "black space", when we "erase" or "clear"
- * any window, but this pair can be redefined to any pair, including
- * the standard "white space", or the bizarre "emptiness" ("attr 0"
- * and "char 0"), as long as various obscure restrictions are met.
- *
- *
- * This package provides several functions which allow a program to
- * interact with the "term" structures. Most of the functions allow
- * the program to "request" certain changes to the current "term",
- * such as moving the cursor, drawing an attr/char pair, erasing a
- * region of grids, hiding the cursor, etc. Then there is a special
- * function which causes all of the "pending" requests to be performed
- * in an efficient manner. There is another set of functions which
- * allow the program to query the "requested state" of the current
- * "term", such as asking for the cursor location, or what attr/char
- * is at a given location, etc. There is another set of functions
- * dealing with "keypress" events, which allows the program to ask if
- * the user has pressed any keys, or to forget any keys the user pressed.
- * There is a pair of functions to allow this package to memorize the
- * contents of the current "term", and to restore these contents at
- * a later time. There is a special function which allows the program
- * to specify which "term" structure should be the "current" one. At
- * the lowest level, there is a set of functions which allow a new
- * "term" to be initialized or destroyed, and which allow this package,
- * or a program, to access the special "hooks" defined for the current
- * "term", and a set of functions which those "hooks" can use to inform
- * this package of the results of certain occurances, for example, one
- * such function allows this package to learn about user keypresses,
- * detected by one of the special "hooks".
- *
- * We provide, among other things, the functions "Term_keypress()"
- * to "react" to keypress events, and "Term_redraw()" to redraw the
- * entire window, plus "Term_resize()" to note a new size.
- *
- *
- * Note that the current "term" contains two "window images". One of
- * these images represents the "requested" contents of the "term", and
- * the other represents the "actual" contents of the "term", at the time
- * of the last performance of pending requests. This package uses these
- * two images to determine the "minimal" amount of work needed to make
- * the "actual" contents of the "term" match the "requested" contents of
- * the "term". This method is not perfect, but it often reduces the
- * amount of work needed to perform the pending requests, which thus
- * increases the speed of the program itself. This package promises
- * that the requested changes will appear to occur either "all at once"
- * or in a "top to bottom" order. In addition, a "cursor" is maintained,
- * and this cursor is updated along with the actual window contents.
- *
- * Currently, the "Term_fresh()" routine attempts to perform the "minimum"
- * number of physical updates, in terms of total "work" done by the hooks
- * Term_wipe(), Term_text(), and Term_pict(), making use of the fact that
- * adjacent characters of the same color can both be drawn together using
- * the "Term_text()" hook, and that "black" text can often be sent to the
- * "Term_wipe()" hook instead of the "Term_text()" hook, and if something
- * is already displayed in a window, then it is not necessary to display
- * it again. Unfortunately, this may induce slightly non-optimal results
- * in some cases, in particular, those in which, say, a string of ten
- * characters needs to be written, but the fifth character has already
- * been displayed. Currently, this will cause the "Term_text()" routine
- * to be called once for each half of the string, instead of once for the
- * whole string, which, on some machines, may be non-optimal behavior.
- *
- * The new formalism includes a "displayed" screen image (old) which
- * is actually seen by the user, a "requested" screen image (scr)
- * which is being prepared for display, a "memorized" screen image
- * (mem) which is used to save and restore screen images, and a
- * "temporary" screen image (tmp) which is currently unused.
- *
- *
- * Several "flags" are available in each "term" to allow the underlying
- * visual system (which initializes the "term" structure) to "optimize"
- * the performance of this package for the given system, or to request
- * certain behavior which is helpful/required for the given system.
- *
- * The "soft_cursor" flag indicates the use of a "soft" cursor, which
- * only moves when explicitly requested,and which is "erased" when
- * any characters are drawn on top of it. This flag is used for all
- * "graphic" systems which handle the cursor by "drawing" it.
- *
- * The "icky_corner" flag indicates that the bottom right "corner"
- * of the windows are "icky", and "printing" anything there may
- * induce "messy" behavior, such as "scrolling". This flag is used
- * for most old "dumb terminal" systems.
- *
- *
- * The "term" structure contains the following function "hooks":
- *
- * Term->init_hook = Init the term
- * Term->nuke_hook = Nuke the term
- * Term->user_hook = Perform user actions
- * Term->xtra_hook = Perform extra actions
- * Term->curs_hook = Draw (or Move) the cursor
- * Term->bigcurs_hook = Draw (or Move) the big cursor (bigtile mode)
- * Term->wipe_hook = Draw some blank spaces
- * Term->text_hook = Draw some text in the window
- * Term->pict_hook = Draw some attr/chars in the window
- *
- * The "Term->user_hook" hook provides a simple hook to an implementation
- * defined function, with application defined semantics. It is available
- * to the program via the "Term_user()" function.
- *
- * The "Term->xtra_hook" hook provides a variety of different functions,
- * based on the first parameter (which should be taken from the various
- * TERM_XTRA_* defines) and the second parameter (which may make sense
- * only for some first parameters). It is available to the program via
- * the "Term_xtra()" function, though some first parameters are only
- * "legal" when called from inside this package.
- *
- * The "Term->curs_hook" hook provides this package with a simple way
- * to "move" or "draw" the cursor to the grid "x,y", depending on the
- * setting of the "soft_cursor" flag. Note that the cursor is never
- * redrawn if "nothing" has happened to the screen (even temporarily).
- * This hook is required.
- *
- * The "Term->wipe_hook" hook provides this package with a simple way
- * to "erase", starting at "x,y", the next "n" grids. This hook assumes
- * that the input is valid. This hook is required, unless the setting
- * of the "always_pict" or "always_text" flags makes it optional.
- *
- * The "Term->text_hook" hook provides this package with a simple way
- * to "draw", starting at "x,y", the "n" chars contained in "cp", using
- * the attr "a". This hook assumes that the input is valid, and that
- * "n" is between 1 and 256 inclusive, but it should NOT assume that
- * the contents of "cp" are null-terminated. This hook is required,
- * unless the setting of the "always_pict" flag makes it optional.
- *
- * The "Term->pict_hook" hook provides this package with a simple way
- * to "draw", starting at "x,y", the "n" attr/char pairs contained in
- * the arrays "ap" and "cp". This hook assumes that the input is valid,
- * and that "n" is between 1 and 256 inclusive, but it should NOT assume
- * that the contents of "cp" are null-terminated. This hook is optional,
- * unless the setting of the "always_pict" or "higher_pict" flags make
- * it required. Note that recently, this hook was changed from taking
- * a byte "a" and a char "c" to taking a length "n", an array of bytes
- * "ap" and an array of chars "cp". Old implementations of this hook
- * should now iterate over all "n" attr/char pairs.
- *
- *
- * The game "Angband" uses a set of files called "main-xxx.c", for
- * various "xxx" suffixes. Most of these contain a function called
- * "init_xxx()", that will prepare the underlying visual system for
- * use with Angband, and then create one or more "term" structures,
- * using flags and hooks appropriate to the given platform, so that
- * the "main()" function can call one (or more) of the "init_xxx()"
- * functions, as appropriate, to prepare the required "term" structs
- * (one for each desired sub-window), and these "init_xxx()" functions
- * are called from a centralized "main()" function in "main.c". Other
- * "main-xxx.c" systems contain their own "main()" function which, in
- * addition to doing everything needed to initialize the actual program,
- * also does everything that the normal "init_xxx()" functions would do.
- *
- * The game "Angband" defines, in addition to "attr 0", all of the
- * attr codes from 1 to 15, using definitions in "defines.h", and
- * thus the "main-xxx.c" files used by Angband must handle these
- * attr values correctly. Also, they must handle all other attr
- * values, though they may do so in any way they wish, for example,
- * by always taking every attr code mod 16. Many of the "main-xxx.c"
- * files use "white space" ("attr 1" / "char 32") to "erase" or "clear"
- * any window, for efficiency.
- *
- * The game "Angband" uses the "Term_user" hook to allow any of the
- * "main-xxx.c" files to interact with the user, by calling this hook
- * whenever the user presses the "!" key when the game is waiting for
- * a new command. This could be used, for example, to provide "unix
- * shell commands" to the Unix versions of the game.
- *
- * See "main-xxx.c" for a simple skeleton file which can be used to
- * create a "visual system" for a new platform when porting Angband.
- */
-
-
-
-
-
-
-/*
- * The current "term"
- */
+ /*
+ * This file provides a generic, efficient, terminal window package,
+ * which can be used not only on standard terminal environments such
+ * as dumb terminals connected to a Unix box, but also in more modern
+ * "graphic" environments, such as the Macintosh or Unix/X11.
+ *
+ * Each "window" works like a standard "dumb terminal", that is, it
+ * can display a two dimensional array of grids containing colored
+ * textual symbols, plus an optional cursor, and it can be used to
+ * get keypress events from the user.
+ *
+ * In fact, this package can simply be used, if desired, to support
+ * programs which will look the same on a dumb terminal as they do
+ * on a graphic platform such as the Macintosh.
+ *
+ * This package was designed to help port the game "Angband" to a wide
+ * variety of different platforms. Angband, like many other games in
+ * the "rogue-like" heirarchy, requires, at the minimum, the ability
+ * to display "colored textual symbols" in a standard 80x24 "window",
+ * such as that provided by most dumb terminals, and many old personal
+ * computers, and to check for "keypresses" from the user. The major
+ * concerns were thus portability and efficiency, so Angband could be
+ * easily ported to many different systems, with minimal effort, and
+ * yet would run quickly on each of these sys
+ tems, no matter what kind
+ * of underlying hardware/software support was being used.
+ *
+ * It is important to understand the differences between the older
+ * "dumb terminals" and the newer "graphic interface" machines, since
+ * this package was designed to work with both types of systems.
+ *
+ * New machines:
+ * waiting for a keypress is complex
+ * checking for a keypress is often cheap
+ * changing "colors" may be expensive
+ * the "color" of a "blank" is rarely important
+ * moving the "cursor" is relatively cheap
+ * use a "software" cursor (only moves when requested)
+ * drawing characters normally will not erase old ones
+ * drawing a character on the cursor often erases it
+ * may have fast routines for "clear a region"
+ * the bottom right corner is usually not special
+ *
+ * Old machines:
+ * waiting for a keypress is simple
+ * checking for a keypress is often expensive
+ * changing "colors" is usually cheap
+ * the "color" of a "blank" may be important
+ * moving the "cursor" may be expensive
+ * use a "hardware" cursor (moves during screen updates)
+ * drawing new symbols automatically erases old ones
+ * characters may only be drawn at the cursor location
+ * drawing a character on the cursor will move the cursor
+ * may have fast routines for "clear entire window"
+ * may have fast routines for "clear to end of line"
+ * the bottom right corner is often dangerous
+ *
+ *
+ * This package provides support for multiple windows, each of an
+ * arbitrary size (up to 255x255), each with its own set of flags,
+ * and its own hooks to handle several low-level procedures which
+ * differ from platform to platform. Then the main program simply
+ * creates one or more "term" structures, setting the various flags
+ * and hooks in a manner appropriate for the current platform, and
+ * then it can use the various "term" structures without worrying
+ * about the underlying platform.
+ *
+ *
+ * This package allows each "grid" in each window to hold an attr/char
+ * pair, with each ranging from 0 to 255, and makes very few assumptions
+ * about the meaning of any attr/char values. Normally, we assume that
+ * "attr 0" is "black", with the semantics that "black" text should be
+ * sent to "Term_wipe()" instead of "Term_text()", but this sematics is
+ * modified if either the "always_pict" or the "always_text" flags are
+ * set. We assume that "char 0" is "dangerous", since placing such a
+ * "char" in the middle of a string "terminates" the string, and usually
+ * we prevent its use.
+ *
+ * Finally, we use a special attr/char pair, defaulting to "attr 0" and
+ * "char 32", also known as "black space", when we "erase" or "clear"
+ * any window, but this pair can be redefined to any pair, including
+ * the standard "white space", or the bizarre "emptiness" ("attr 0"
+ * and "char 0"), as long as various obscure restrictions are met.
+ *
+ *
+ * This package provides several functions which allow a program to
+ * interact with the "term" structures. Most of the functions allow
+ * the program to "request" certain changes to the current "term",
+ * such as moving the cursor, drawing an attr/char pair, erasing a
+ * region of grids, hiding the cursor, etc. Then there is a special
+ * function which causes all of the "pending" requests to be performed
+ * in an efficient manner. There is another set of functions which
+ * allow the program to query the "requested state" of the current
+ * "term", such as asking for the cursor location, or what attr/char
+ * is at a given location, etc. There is another set of functions
+ * dealing with "keypress" events, which allows the program to ask if
+ * the user has pressed any keys, or to forget any keys the user pressed.
+ * There is a pair of functions to allow this package to memorize the
+ * contents of the current "term", and to restore these contents at
+ * a later time. There is a special function which allows the program
+ * to specify which "term" structure should be the "current" one. At
+ * the lowest level, there is a set of functions which allow a new
+ * "term" to be initialized or destroyed, and which allow this package,
+ * or a program, to access the special "hooks" defined for the current
+ * "term", and a set of functions which those "hooks" can use to inform
+ * this package of the results of certain occurances, for example, one
+ * such function allows this package to learn about user keypresses,
+ * detected by one of the special "hooks".
+ *
+ * We provide, among other things, the functions "Term_keypress()"
+ * to "react" to keypress events, and "Term_redraw()" to redraw the
+ * entire window, plus "Term_resize()" to note a new size.
+ *
+ *
+ * Note that the current "term" contains two "window images". One of
+ * these images represents the "requested" contents of the "term", and
+ * the other represents the "actual" contents of the "term", at the time
+ * of the last performance of pending requests. This package uses these
+ * two images to determine the "minimal" amount of work needed to make
+ * the "actual" contents of the "term" match the "requested" contents of
+ * the "term". This method is not perfect, but it often reduces the
+ * amount of work needed to perform the pending requests, which thus
+ * increases the speed of the program itself. This package promises
+ * that the requested changes will appear to occur either "all at once"
+ * or in a "top to bottom" order. In addition, a "cursor" is maintained,
+ * and this cursor is updated along with the actual window contents.
+ *
+ * Currently, the "Term_fresh()" routine attempts to perform the "minimum"
+ * number of physical updates, in terms of total "work" done by the hooks
+ * Term_wipe(), Term_text(), and Term_pict(), making use of the fact that
+ * adjacent characters of the same color can both be drawn together using
+ * the "Term_text()" hook, and that "black" text can often be sent to the
+ * "Term_wipe()" hook instead of the "Term_text()" hook, and if something
+ * is already displayed in a window, then it is not necessary to display
+ * it again. Unfortunately, this may induce slightly non-optimal results
+ * in some cases, in particular, those in which, say, a string of ten
+ * characters needs to be written, but the fifth character has already
+ * been displayed. Currently, this will cause the "Term_text()" routine
+ * to be called once for each half of the string, instead of once for the
+ * whole string, which, on some machines, may be non-optimal behavior.
+ *
+ * The new formalism includes a "displayed" screen image (old) which
+ * is actually seen by the user, a "requested" screen image (scr)
+ * which is being prepared for display, a "memorized" screen image
+ * (mem) which is used to save and restore screen images, and a
+ * "temporary" screen image (tmp) which is currently unused.
+ *
+ *
+ * Several "flags" are available in each "term" to allow the underlying
+ * visual system (which initializes the "term" structure) to "optimize"
+ * the performance of this package for the given system, or to request
+ * certain behavior which is helpful/required for the given system.
+ *
+ * The "soft_cursor" flag indicates the use of a "soft" cursor, which
+ * only moves when explicitly requested,and which is "erased" when
+ * any characters are drawn on top of it. This flag is used for all
+ * "graphic" systems which handle the cursor by "drawing" it.
+ *
+ * The "icky_corner" flag indicates that the bottom right "corner"
+ * of the windows are "icky", and "printing" anything there may
+ * induce "messy" behavior, such as "scrolling". This flag is used
+ * for most old "dumb terminal" systems.
+ *
+ *
+ * The "term" structure contains the following function "hooks":
+ *
+ * Term->init_hook = Init the term
+ * Term->nuke_hook = Nuke the term
+ * Term->user_hook = Perform user actions
+ * Term->xtra_hook = Perform extra actions
+ * Term->curs_hook = Draw (or Move) the cursor
+ * Term->bigcurs_hook = Draw (or Move) the big cursor (bigtile mode)
+ * Term->wipe_hook = Draw some blank spaces
+ * Term->text_hook = Draw some text in the window
+ * Term->pict_hook = Draw some attr/chars in the window
+ *
+ * The "Term->user_hook" hook provides a simple hook to an implementation
+ * defined function, with application defined semantics. It is available
+ * to the program via the "Term_user()" function.
+ *
+ * The "Term->xtra_hook" hook provides a variety of different functions,
+ * based on the first parameter (which should be taken from the various
+ * TERM_XTRA_* defines) and the second parameter (which may make sense
+ * only for some first parameters). It is available to the program via
+ * the "Term_xtra()" function, though some first parameters are only
+ * "legal" when called from inside this package.
+ *
+ * The "Term->curs_hook" hook provides this package with a simple way
+ * to "move" or "draw" the cursor to the grid "x,y", depending on the
+ * setting of the "soft_cursor" flag. Note that the cursor is never
+ * redrawn if "nothing" has happened to the screen (even temporarily).
+ * This hook is required.
+ *
+ * The "Term->wipe_hook" hook provides this package with a simple way
+ * to "erase", starting at "x,y", the next "n" grids. This hook assumes
+ * that the input is valid. This hook is required, unless the setting
+ * of the "always_pict" or "always_text" flags makes it optional.
+ *
+ * The "Term->text_hook" hook provides this package with a simple way
+ * to "draw", starting at "x,y", the "n" chars contained in "cp", using
+ * the attr "a". This hook assumes that the input is valid, and that
+ * "n" is between 1 and 256 inclusive, but it should NOT assume that
+ * the contents of "cp" are null-terminated. This hook is required,
+ * unless the setting of the "always_pict" flag makes it optional.
+ *
+ * The "Term->pict_hook" hook provides this package with a simple way
+ * to "draw", starting at "x,y", the "n" attr/char pairs contained in
+ * the arrays "ap" and "cp". This hook assumes that the input is valid,
+ * and that "n" is between 1 and 256 inclusive, but it should NOT assume
+ * that the contents of "cp" are null-terminated. This hook is optional,
+ * unless the setting of the "always_pict" or "higher_pict" flags make
+ * it required. Note that recently, this hook was changed from taking
+ * a byte "a" and a char "c" to taking a length "n", an array of bytes
+ * "ap" and an array of chars "cp". Old implementations of this hook
+ * should now iterate over all "n" attr/char pairs.
+ *
+ *
+ * The game "Angband" uses a set of files called "main-xxx.c", for
+ * various "xxx" suffixes. Most of these contain a function called
+ * "init_xxx()", that will prepare the underlying visual system for
+ * use with Angband, and then create one or more "term" structures,
+ * using flags and hooks appropriate to the given platform, so that
+ * the "main()" function can call one (or more) of the "init_xxx()"
+ * functions, as appropriate, to prepare the required "term" structs
+ * (one for each desired sub-window), and these "init_xxx()" functions
+ * are called from a centralized "main()" function in "main.c". Other
+ * "main-xxx.c" systems contain their own "main()" function which, in
+ * addition to doing everything needed to initialize the actual program,
+ * also does everything that the normal "init_xxx()" functions would do.
+ *
+ * The game "Angband" defines, in addition to "attr 0", all of the
+ * attr codes from 1 to 15, using definitions in "defines.h", and
+ * thus the "main-xxx.c" files used by Angband must handle these
+ * attr values correctly. Also, they must handle all other attr
+ * values, though they may do so in any way they wish, for example,
+ * by always taking every attr code mod 16. Many of the "main-xxx.c"
+ * files use "white space" ("attr 1" / "char 32") to "erase" or "clear"
+ * any window, for efficiency.
+ *
+ * The game "Angband" uses the "Term_user" hook to allow any of the
+ * "main-xxx.c" files to interact with the user, by calling this hook
+ * whenever the user presses the "!" key when the game is waiting for
+ * a new command. This could be used, for example, to provide "unix
+ * shell commands" to the Unix versions of the game.
+ *
+ * See "main-xxx.c" for a simple skeleton file which can be used to
+ * create a "visual system" for a new platform when porting Angband.
+ */
+
+
+
+
+
+
+ /*
+ * The current "term"
+ */
term *Term = NULL;
*/
void Term_queue_char(TERM_LEN x, TERM_LEN y, TERM_COLOR a, char c, TERM_COLOR ta, char tc)
{
- term_win *scrn = Term->scr;
-
+ term_win *scrn = Term->scr;
+
TERM_COLOR *scr_aa = &scrn->a[y][x];
char *scr_cc = &scrn->c[y][x];
/* Hack -- Ignore non-changes */
if ((*scr_aa == a) && (*scr_cc == c) &&
- (*scr_taa == ta) && (*scr_tcc == tc)) return;
+ (*scr_taa == ta) && (*scr_tcc == tc)) return;
/* Save the "literal" information */
*scr_aa = a;
#ifdef JP
if (((scrn->a[y][x] & AF_BIGTILE2) == AF_BIGTILE2) ||
- (scrn->a[y][x] & AF_KANJI2))
+ (scrn->a[y][x] & AF_KANJI2))
#else
if ((scrn->a[y][x] & AF_BIGTILE2) == AF_BIGTILE2)
#endif
}
#endif
/* Queue the attr/chars */
- for ( ; n; x++, s++, n--)
+ for (; n; x++, s++, n--)
{
#ifdef JP
/* 特殊文字としてMSBが立っている可能性がある */
byte na1 = (a | AF_KANJI1);
byte na2 = (a | AF_KANJI2);
- if((--n == 0) || !nc2) break;
+ if ((--n == 0) || !nc2) break;
- if(scr_aa[x++] == na1 && scr_aa[x] == na2 &&
- scr_cc[x - 1] == nc1 && scr_cc[x] == nc2 &&
- (scr_taa[x - 1] == 0) && (scr_taa[x]==0) &&
- (scr_tcc[x - 1] == 0) && (scr_tcc[x]==0) )
+ if (scr_aa[x++] == na1 && scr_aa[x] == na2 &&
+ scr_cc[x - 1] == nc1 && scr_cc[x] == nc2 &&
+ (scr_taa[x - 1] == 0) && (scr_taa[x] == 0) &&
+ (scr_tcc[x - 1] == 0) && (scr_tcc[x] == 0))
continue;
scr_aa[x - 1] = na1;
scr_cc[x - 1] = nc1;
scr_cc[x] = nc2;
- if(x1 < 0) x1 = x - 1;
+ if (x1 < 0) x1 = x - 1;
x2 = x;
}
else
{
#endif
- TERM_COLOR oa = scr_aa[x];
- char oc = scr_cc[x];
+ TERM_COLOR oa = scr_aa[x];
+ char oc = scr_cc[x];
- TERM_COLOR ota = scr_taa[x];
- char otc = scr_tcc[x];
+ TERM_COLOR ota = scr_taa[x];
+ char otc = scr_tcc[x];
- /* Hack -- Ignore non-changes */
- if ((oa == a) && (oc == *s) && (ota == 0) && (otc == 0)) continue;
+ /* Hack -- Ignore non-changes */
+ if ((oa == a) && (oc == *s) && (ota == 0) && (otc == 0)) continue;
- /* Save the "literal" information */
- scr_aa[x] = a;
- scr_cc[x] = *s;
+ /* Save the "literal" information */
+ scr_aa[x] = a;
+ scr_cc[x] = *s;
- scr_taa[x] = 0;
- scr_tcc[x] = 0;
+ scr_taa[x] = 0;
+ scr_tcc[x] = 0;
- /* Note the "range" of window updates */
- if (x1 < 0) x1 = x;
- x2 = x;
+ /* Note the "range" of window updates */
+ if (x1 < 0) x1 = x;
+ x2 = x;
#ifdef JP
- }
+ }
#endif
}
/* Handle unchanged grids */
#ifdef JP
if ((na == oa) && (nc == oc) && (nta == ota) && (ntc == otc)
- &&(!kanji || (scr_aa[x + 1] == old_aa[x + 1] &&
- scr_cc[x + 1] == old_cc[x + 1] &&
- scr_taa[x + 1] == old_taa[x + 1] &&
- scr_tcc[x + 1] == old_tcc[x + 1])))
+ && (!kanji || (scr_aa[x + 1] == old_aa[x + 1] &&
+ scr_cc[x + 1] == old_cc[x + 1] &&
+ scr_taa[x + 1] == old_taa[x + 1] &&
+ scr_tcc[x + 1] == old_tcc[x + 1])))
#else
if ((na == oa) && (nc == oc) && (nta == ota) && (ntc == otc))
#endif
{
/* Draw pending attr/char pairs */
(void)((*Term->pict_hook)(fx, y, fn,
- &scr_aa[fx], &scr_cc[fx], &scr_taa[fx], &scr_tcc[fx]));
+ &scr_aa[fx], &scr_cc[fx], &scr_taa[fx], &scr_tcc[fx]));
/* Forget */
fn = 0;
#ifdef JP
/* 全角文字の時は再開位置は+1 */
- if(kanji)
+ if (kanji)
{
x++;
fx++;
/* Handle unchanged grids */
#ifdef JP
- if ((na == oa) && (nc == oc) && (nta == ota) && (ntc == otc)&&
- (!kanji || (scr_aa[x + 1] == old_aa[x + 1] &&
+ if ((na == oa) && (nc == oc) && (nta == ota) && (ntc == otc) &&
+ (!kanji || (scr_aa[x + 1] == old_aa[x + 1] &&
scr_cc[x + 1] == old_cc[x + 1] &&
scr_taa[x + 1] == old_taa[x + 1] &&
scr_tcc[x + 1] == old_tcc[x + 1])))
#ifdef JP
/* 全角文字の時は再開位置は+1 */
- if(kanji)
+ if (kanji)
{
x++;
fx++;
/* Handle unchanged grids */
#ifdef JP
if ((na == oa) && (nc == oc) &&
- (!kanji || (scr_aa[x + 1] == old_aa[x + 1] &&
+ (!kanji || (scr_aa[x + 1] == old_aa[x + 1] &&
scr_cc[x + 1] == old_cc[x + 1])))
#else
if ((na == oa) && (nc == oc))
#ifdef JP
/* 全角文字の時は再開位置は+1 */
- if(kanji)
+ if (kanji)
{
x++;
fx++;
* On systems with a "soft" cursor, we must explicitly erase the cursor
* before flushing the output, if needed, to prevent a "jumpy" refresh.
* The actual method for this is horrible, but there is very little that
- * we can do to simplify it efficiently.
+ * we can do to simplify it efficiently.
*
* On systems with a "hard" cursor, we will "hide" the cursor before
* flushing the output, if needed, to avoid a "flickery" refresh. It
term_win *old = Term->old;
term_win *scr = Term->scr;
-
+
/* Before initialize (Advice from Mr.shimitei)*/
if (!old || !scr) return 1;
/* Trivial Refresh */
if ((y1 > y2) &&
- (scr->cu == old->cu) &&
- (scr->cv == old->cv) &&
- (scr->cx == old->cx) &&
- (scr->cy == old->cy) &&
- !(Term->total_erase))
+ (scr->cu == old->cu) &&
+ (scr->cv == old->cv) &&
+ (scr->cx == old->cx) &&
+ (scr->cy == old->cy) &&
+ !(Term->total_erase))
{
/* Nothing */
return 1;
#ifdef JP
if (tx + 1 < Term->wid && !(old_aa[tx] & AF_TILE1)
- && iskanji(old_cc[tx]))
+ && iskanji(old_cc[tx]))
csize = 2;
#endif
/* Hack -- use "Term_pict()" always */
{
(void)((*Term->pict_hook)(tx, ty, 1, &old_aa[tx], &old_cc[tx], &ota, &otc));
}
-
+
/*
* Hack -- restore the actual character
* 元の文字の描画範囲がカーソルより小さいと、
* 上書きされなかった部分がゴミとして残る。
* wipe_hook でカーソルを消去して text_hook で書き直す。
*/
- else if (old_aa[tx] || Term->always_text)
- {
+ else if (old_aa[tx] || Term->always_text)
+ {
(void)((*Term->wipe_hook)(tx, ty, 1));
- (void)((*Term->text_hook)(tx, ty, csize, (unsigned char) (old_aa[tx] & 0xf), &old_cc[tx]));
+ (void)((*Term->text_hook)(tx, ty, csize, (unsigned char)(old_aa[tx] & 0xf), &old_cc[tx]));
}
/* Hack -- erase the grid */
{
#ifdef JP
if ((scr->cx + 1 < w) &&
- ((old->a[scr->cy][scr->cx + 1] & AF_BIGTILE2) == AF_BIGTILE2 ||
- (!(old->a[scr->cy][scr->cx] & AF_TILE1) &&
- iskanji(old->c[scr->cy][scr->cx]))))
+ ((old->a[scr->cy][scr->cx + 1] & AF_BIGTILE2) == AF_BIGTILE2 ||
+ (!(old->a[scr->cy][scr->cx] & AF_TILE1) &&
+ iskanji(old->c[scr->cy][scr->cx]))))
#else
if ((scr->cx + 1 < w) && (old->a[scr->cy][scr->cx + 1] & AF_BIGTILE2) == AF_BIGTILE2)
#endif
for (i = 0; i < n && s[i] != 0; i++)
{
- /* Move first */
- if ((res = Term_gotoxy(x, y0)) != 0) return (res);
-
- if (iskanji(s[i]))
- {
- if ((res = Term_addstr(2, a, &s[i])) != 0) return (res);
- i++;
- y0++;
- if (s[i] == 0) break;
- } else {
- if ((res = Term_addstr(1, a, &s[i])) != 0) return (res);
- y0++;
- }
+ /* Move first */
+ if ((res = Term_gotoxy(x, y0)) != 0) return (res);
+
+ if (iskanji(s[i]))
+ {
+ if ((res = Term_addstr(2, a, &s[i])) != 0) return (res);
+ i++;
+ y0++;
+ if (s[i] == 0) break;
+ }
+ else {
+ if ((res = Term_addstr(1, a, &s[i])) != 0) return (res);
+ y0++;
+ }
}
/* Success */
* 重なった文字の左部分を消去。
*/
if (n > 0 && (((scr_aa[x] & AF_KANJI2) && !(scr_aa[x] & AF_TILE1))
- || (scr_aa[x] & AF_BIGTILE2) == AF_BIGTILE2))
+ || (scr_aa[x] & AF_BIGTILE2) == AF_BIGTILE2))
#else
if (n > 0 && (scr_aa[x] & AF_BIGTILE2) == AF_BIGTILE2)
#endif
#ifdef JP
int x1j = x1;
int x2j = x2;
-
+
if (x1j > 0)
{
if (Term->scr->a[i][x1j] & AF_KANJI2) x1j--;
}
-
+
if (x2j < Term->wid - 1)
{
if (Term->scr->a[i][x2j] & AF_KANJI1) x2j++;
}
-
+
Term->x1[i] = (byte_hack)x1j;
Term->x2[i] = (byte_hack)x2j;
-
+
g_ptr = Term->old->c[i];
-
+
/* Clear the section so it is redrawn */
for (j = x1j; j <= x2j; j++)
{
/* Success */
return 0;
}
-
-