-/* File: files.c */
-
-/*
+/*!
+ * @file files.c
+ * @brief ファイル入出力管理 / Purpose: code dealing with files (and death)
+ * @date 2014/01/28
+ * @author
+ * <pre>
* Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
- *
* This software may be copied and distributed for educational, research,
* and not for profit purposes provided that this copyright and statement
* are included in all such copies. Other copyrights may also apply.
+ * 2014 Deskull rearranged comment for Doxygen.\n
+ * </pre>
*/
-/* Purpose: code dealing with files (and death) */
#include "angband.h"
+#include "world.h"
+#include "player-status.h"
+#include "sort.h"
+#include "mutation.h"
+#include "quest.h"
+#include "store.h"
+#include "artifact.h"
+#include "avatar.h"
/*
/* #undef _POSIX_SAVED_IDS */
-/*
- * Hack -- drop permissions
+/*!
+ * @brief ファイルのドロップパーミッションチェック / Hack -- drop permissions
*/
void safe_setuid_drop(void)
{
if (setuid(getuid()) != 0)
{
-#ifdef JP
-quit("setuid(): Àµ¤·¤¯µö²Ä¤¬¼è¤ì¤Þ¤»¤ó¡ª");
-#else
- quit("setuid(): cannot set permissions correctly!");
-#endif
-
+ quit(_("setuid(): 正しく許可が取れません!", "setuid(): cannot set permissions correctly!"));
}
if (setgid(getgid()) != 0)
{
-#ifdef JP
-quit("setgid(): Àµ¤·¤¯µö²Ä¤¬¼è¤ì¤Þ¤»¤ó¡ª");
-#else
- quit("setgid(): cannot set permissions correctly!");
-#endif
-
+ quit(_("setgid(): 正しく許可が取れません!", "setgid(): cannot set permissions correctly!"));
}
# else
if (setreuid(geteuid(), getuid()) != 0)
{
-#ifdef JP
-quit("setreuid(): Àµ¤·¤¯µö²Ä¤¬¼è¤ì¤Þ¤»¤ó¡ª");
-#else
- quit("setreuid(): cannot set permissions correctly!");
-#endif
-
+ quit(_("setreuid(): 正しく許可が取れません!", "setreuid(): cannot set permissions correctly!"));
}
if (setregid(getegid(), getgid()) != 0)
{
-#ifdef JP
-quit("setregid(): Àµ¤·¤¯µö²Ä¤¬¼è¤ì¤Þ¤»¤ó¡ª");
-#else
- quit("setregid(): cannot set permissions correctly!");
-#endif
-
+ quit(_("setregid(): 正しく許可が取れません!", "setregid(): cannot set permissions correctly!"));
}
# endif
}
-/*
- * Hack -- grab permissions
+/*!
+ * @brief ファイルのグラブパーミッションチェック / Hack -- grab permissions
*/
void safe_setuid_grab(void)
{
if (setuid(player_euid) != 0)
{
-#ifdef JP
-quit("setuid(): Àµ¤·¤¯µö²Ä¤¬¼è¤ì¤Þ¤»¤ó¡ª");
-#else
- quit("setuid(): cannot set permissions correctly!");
-#endif
-
+ quit(_("setuid(): 正しく許可が取れません!", "setuid(): cannot set permissions correctly!"));
}
if (setgid(player_egid) != 0)
{
-#ifdef JP
-quit("setgid(): Àµ¤·¤¯µö²Ä¤¬¼è¤ì¤Þ¤»¤ó¡ª");
-#else
- quit("setgid(): cannot set permissions correctly!");
-#endif
-
+ quit(_("setgid(): 正しく許可が取れません!", "setgid(): cannot set permissions correctly!"));
}
# else
if (setreuid(geteuid(), getuid()) != 0)
{
-#ifdef JP
-quit("setreuid(): Àµ¤·¤¯µö²Ä¤¬¼è¤ì¤Þ¤»¤ó¡ª");
-#else
- quit("setreuid(): cannot set permissions correctly!");
-#endif
-
+ quit(_("setreuid(): 正しく許可が取れません!", "setreuid(): cannot set permissions correctly!"));
}
if (setregid(getegid(), getgid()) != 0)
{
-#ifdef JP
-quit("setregid(): Àµ¤·¤¯µö²Ä¤¬¼è¤ì¤Þ¤»¤ó¡ª");
-#else
- quit("setregid(): cannot set permissions correctly!");
-#endif
-
+ quit(_("setregid(): 正しく許可が取れません!", "setregid(): cannot set permissions correctly!"));
}
# endif /* SAFE_SETUID_POSIX */
}
-/*
- * Extract the first few "tokens" from a buffer
- *
+/*!
+ * @brief 各種データテキストをトークン単位に分解する / Extract the first few "tokens" from a buffer
+ * @param buf データテキストの参照ポインタ
+ * @param num トークンの数
+ * @param tokens トークンを保管する文字列参照ポインタ配列
+ * @param mode オプション
+ * @return 解釈した文字列数
+ * @details
+ * <pre>
* This function uses "colon" and "slash" as the delimeter characters.
- *
* We never extract more than "num" tokens. The "last" token may include
* "delimeter" characters, allowing the buffer to include a "string" token.
- *
* We save pointers to the tokens in "tokens", and return the number found.
- *
* Hack -- Attempt to handle the 'c' character formalism
- *
* Hack -- An empty buffer, or a final delimeter, yields an "empty" token.
- *
* Hack -- We will always extract at least one token
+ * </pre>
*/
-s16b tokenize(char *buf, s16b num, char **tokens, int mode)
+s16b tokenize(char *buf, s16b num, char **tokens, BIT_FLAGS mode)
{
- int i = 0;
+ s16b i = 0;
char *s = buf;
struct named_num
{
- cptr name; /* The name of this thing */
+ concptr name; /* The name of this thing */
int num; /* A number associated with it */
};
{"GF_ACID", GF_ACID },
{"GF_COLD", GF_COLD },
{"GF_FIRE", GF_FIRE },
- {"GF_PSY_SPEAR", GF_PSY_SPEAR },
+ {"GF_PSY_SPEAR", GF_PSY_SPEAR },
{"GF_MISSILE", GF_MISSILE },
- {"GF_ARROW", GF_ARROW },
+ {"GF_ARROW", GF_ARROW },
{"GF_PLASMA", GF_PLASMA },
- {"GF_WATER", GF_WATER },
+ {"GF_WATER", GF_WATER },
{"GF_LITE", GF_LITE },
{"GF_DARK", GF_DARK },
{"GF_LITE_WEAK", GF_LITE_WEAK },
{"GF_DARK_WEAK", GF_DARK_WEAK },
{"GF_SHARDS", GF_SHARDS },
- {"GF_SOUND", GF_SOUND },
+ {"GF_SOUND", GF_SOUND },
{"GF_CONFUSION", GF_CONFUSION },
- {"GF_FORCE", GF_FORCE },
- {"GF_INERTIA", GF_INERTIA },
+ {"GF_FORCE", GF_FORCE },
+ {"GF_INERTIA", GF_INERTIAL },
{"GF_MANA", GF_MANA },
{"GF_METEOR", GF_METEOR },
{"GF_ICE", GF_ICE },
- {"GF_CHAOS", GF_CHAOS },
+ {"GF_CHAOS", GF_CHAOS },
{"GF_NETHER", GF_NETHER },
{"GF_DISENCHANT", GF_DISENCHANT },
- {"GF_NEXUS", GF_NEXUS },
+ {"GF_NEXUS", GF_NEXUS },
{"GF_TIME", GF_TIME },
{"GF_GRAVITY", GF_GRAVITY },
{"GF_KILL_WALL", GF_KILL_WALL },
{"GF_MAKE_TRAP", GF_MAKE_TRAP },
{"GF_MAKE_TREE", GF_MAKE_TREE },
{"GF_OLD_CLONE", GF_OLD_CLONE },
- {"GF_OLD_POLY", GF_OLD_POLY },
- {"GF_OLD_HEAL", GF_OLD_HEAL },
+ {"GF_OLD_POLY", GF_OLD_POLY },
+ {"GF_OLD_HEAL", GF_OLD_HEAL },
{"GF_OLD_SPEED", GF_OLD_SPEED },
- {"GF_OLD_SLOW", GF_OLD_SLOW },
- {"GF_OLD_CONF", GF_OLD_CONF },
+ {"GF_OLD_SLOW", GF_OLD_SLOW },
+ {"GF_OLD_CONF", GF_OLD_CONF },
{"GF_OLD_SLEEP", GF_OLD_SLEEP },
- {"GF_OLD_DRAIN", GF_OLD_DRAIN },
- {"GF_AWAY_UNDEAD", GF_AWAY_UNDEAD },
+ {"GF_HYPODYNAMIA", GF_HYPODYNAMIA },
+ {"GF_AWAY_UNDEAD", GF_AWAY_UNDEAD },
{"GF_AWAY_EVIL", GF_AWAY_EVIL },
- {"GF_AWAY_ALL", GF_AWAY_ALL },
- {"GF_TURN_UNDEAD", GF_TURN_UNDEAD },
+ {"GF_AWAY_ALL", GF_AWAY_ALL },
+ {"GF_TURN_UNDEAD", GF_TURN_UNDEAD },
{"GF_TURN_EVIL", GF_TURN_EVIL },
- {"GF_TURN_ALL", GF_TURN_ALL },
- {"GF_DISP_UNDEAD", GF_DISP_UNDEAD },
+ {"GF_TURN_ALL", GF_TURN_ALL },
+ {"GF_DISP_UNDEAD", GF_DISP_UNDEAD },
{"GF_DISP_EVIL", GF_DISP_EVIL },
- {"GF_DISP_ALL", GF_DISP_ALL },
+ {"GF_DISP_ALL", GF_DISP_ALL },
{"GF_DISP_DEMON", GF_DISP_DEMON },
- {"GF_DISP_LIVING", GF_DISP_LIVING },
+ {"GF_DISP_LIVING", GF_DISP_LIVING },
{"GF_ROCKET", GF_ROCKET },
{"GF_NUKE", GF_NUKE },
{"GF_MAKE_GLYPH", GF_MAKE_GLYPH },
{"GF_STUN", GF_STUN },
{"GF_HOLY_FIRE", GF_HOLY_FIRE },
{"GF_HELL_FIRE", GF_HELL_FIRE },
- {"GF_DISINTEGRATE", GF_DISINTEGRATE },
- {"GF_CHARM", GF_CHARM },
- {"GF_CONTROL_UNDEAD", GF_CONTROL_UNDEAD },
- {"GF_CONTROL_ANIMAL", GF_CONTROL_ANIMAL },
+ {"GF_DISINTEGRATE", GF_DISINTEGRATE },
+ {"GF_CHARM", GF_CHARM },
+ {"GF_CONTROL_UNDEAD", GF_CONTROL_UNDEAD },
+ {"GF_CONTROL_ANIMAL", GF_CONTROL_ANIMAL },
{"GF_PSI", GF_PSI },
{"GF_PSI_DRAIN", GF_PSI_DRAIN },
- {"GF_TELEKINESIS", GF_TELEKINESIS },
- {"GF_JAM_DOOR", GF_JAM_DOOR },
+ {"GF_TELEKINESIS", GF_TELEKINESIS },
+ {"GF_JAM_DOOR", GF_JAM_DOOR },
{"GF_DOMINATION", GF_DOMINATION },
{"GF_DISP_GOOD", GF_DISP_GOOD },
{"GF_DRAIN_MANA", GF_DRAIN_MANA },
{"GF_MIND_BLAST", GF_MIND_BLAST },
{"GF_BRAIN_SMASH", GF_BRAIN_SMASH },
- {"GF_CAUSE_1", GF_CAUSE_1 },
- {"GF_CAUSE_2", GF_CAUSE_2 },
- {"GF_CAUSE_3", GF_CAUSE_3 },
- {"GF_CAUSE_4", GF_CAUSE_4 },
+ {"GF_CAUSE_1", GF_CAUSE_1 },
+ {"GF_CAUSE_2", GF_CAUSE_2 },
+ {"GF_CAUSE_3", GF_CAUSE_3 },
+ {"GF_CAUSE_4", GF_CAUSE_4 },
{"GF_HAND_DOOM", GF_HAND_DOOM },
- {"GF_CAPTURE", GF_CAPTURE },
+ {"GF_CAPTURE", GF_CAPTURE },
{"GF_ANIM_DEAD", GF_ANIM_DEAD },
- {"GF_CONTROL_LIVING", GF_CONTROL_LIVING },
- {"GF_IDENTIFY", GF_IDENTIFY },
- {"GF_ATTACK", GF_ATTACK },
- {"GF_ENGETSU", GF_ENGETSU },
- {"GF_GENOCIDE", GF_GENOCIDE },
- {"GF_PHOTO", GF_PHOTO },
- {"GF_CONTROL_DEMON", GF_CONTROL_DEMON },
- {"GF_LAVA_FLOW", GF_LAVA_FLOW },
- {"GF_BLOOD_CURSE", GF_BLOOD_CURSE },
- {"GF_SEEKER", GF_SEEKER },
- {"GF_SUPER_RAY", GF_SUPER_RAY },
- {"GF_STAR_HEAL", GF_STAR_HEAL },
- {"GF_WATER_FLOW", GF_WATER_FLOW },
- {"GF_CRUSADE", GF_CRUSADE },
+ {"GF_CHARM_LIVING", GF_CHARM_LIVING },
+ {"GF_IDENTIFY", GF_IDENTIFY },
+ {"GF_ATTACK", GF_ATTACK },
+ {"GF_ENGETSU", GF_ENGETSU },
+ {"GF_GENOCIDE", GF_GENOCIDE },
+ {"GF_PHOTO", GF_PHOTO },
+ {"GF_CONTROL_DEMON", GF_CONTROL_DEMON },
+ {"GF_LAVA_FLOW", GF_LAVA_FLOW },
+ {"GF_BLOOD_CURSE", GF_BLOOD_CURSE },
+ {"GF_SEEKER", GF_SEEKER },
+ {"GF_SUPER_RAY", GF_SUPER_RAY },
+ {"GF_STAR_HEAL", GF_STAR_HEAL },
+ {"GF_WATER_FLOW", GF_WATER_FLOW },
+ {"GF_CRUSADE", GF_CRUSADE },
{"GF_STASIS_EVIL", GF_STASIS_EVIL },
- {"GF_WOUNDS", GF_WOUNDS },
- {NULL, 0 }
+ {"GF_WOUNDS", GF_WOUNDS },
+ {NULL, 0 }
};
-/*
+/*!
+ * @brief 設定ファイルの各行から各種テキスト情報を取得する /
* Parse a sub-file of the "extra info" (format shown below)
- *
+ * @param buf データテキストの参照ポインタ
+ * @return エラーコード
+ * @details
+ * <pre>
* Each "action" line has an "action symbol" in the first column,
* followed by a colon, followed by some command specific info,
* usually in the form of "tokens" separated by colons or slashes.
- *
* Blank lines, lines starting with white space, and lines starting
* with pound signs ("#") are ignored (as comments).
- *
* Note the use of "tokenize()" to allow the use of both colons and
* slashes as delimeters, while still allowing final tokens which
* may contain any characters including "delimiters".
- *
* Note the use of "strtol()" to allow all "integers" to be encoded
* in decimal, hexidecimal, or octal form.
- *
* Note that "monster zero" is used for the "player" attr/char, "object
* zero" will be used for the "stack" attr/char, and "feature zero" is
* used for the "nothing" attr/char.
- *
* Parse another file recursively, see below for details
- * %:<filename>
- *
+ * %:\<filename\>
* Specify the attr/char values for "monsters" by race index
- * R:<num>:<a>:<c>
- *
+ * R:\<num\>:\<a\>:\<c\>
* Specify the attr/char values for "objects" by kind index
- * K:<num>:<a>:<c>
- *
+ * K:\<num\>:\<a\>:\<c\>
* Specify the attr/char values for "features" by feature index
- * F:<num>:<a>:<c>
- *
+ * F:\<num\>:\<a\>:\<c\>
* Specify the attr/char values for unaware "objects" by kind tval
- * U:<tv>:<a>:<c>
- *
+ * U:\<tv\>:\<a\>:\<c\>
* Specify the attr/char values for inventory "objects" by kind tval
- * E:<tv>:<a>:<c>
- *
+ * E:\<tv\>:\<a\>:\<c\>
* Define a macro action, given an encoded macro action
- * A:<str>
- *
+ * A:\<str\>
* Create a normal macro, given an encoded macro trigger
- * P:<str>
- *
+ * P:\<str\>
* Create a command macro, given an encoded macro trigger
- * C:<str>
- *
+ * C:\<str\>
* Create a keyset mapping
- * S:<key>:<key>:<dir>
- *
+ * S:\<key\>:\<key\>:\<dir\>
* Turn an option off, given its name
- * X:<str>
- *
+ * X:\<str\>
* Turn an option on, given its name
- * Y:<str>
- *
+ * Y:\<str\>
* Specify visual information, given an index, and some data
- * V:<num>:<kv>:<rv>:<gv>:<bv>
- *
+ * V:\<num\>:\<kv\>:\<rv\>:\<gv\>:\<bv\>
* Specify the set of colors to use when drawing a zapped spell
- * Z:<type>:<str>
- *
+ * Z:\<type\>:\<str\>
* Specify a macro trigger template and macro trigger names.
- * T:<template>:<modifier chr>:<modifier name1>:<modifier name2>:...
- * T:<trigger>:<keycode>:<shift-keycode>
- *
+ * T:\<template\>:\<modifier chr\>:\<modifier name1\>:\<modifier name2\>:...
+ * T:\<trigger\>:\<keycode\>:\<shift-keycode\>
+ * </pre>
*/
-
errr process_pref_file_command(char *buf)
{
- int i, j, n1, n2;
+ int i, j;
+ TERM_COLOR n1;
+ SYMBOL_CODE n2;
+
char *zz[16];
switch (buf[0])
{
- /* Process "%:<fname>" */
- case '%':
- /* Attempt to Process the given file */
- return process_pref_file(buf + 2);
+ /* Mega-Hack -- read external player's history file */
+ /* Process "H:<history>" */
+ case 'H':
+ add_history_from_pref_line(buf + 2);
+ return 0;
- /* Mega-Hack -- read external player's history file */
- /* Process "H:<history>" */
- case 'H':
- add_history_from_pref_line(buf + 2);
- return 0;
+ /* Process "R:<num>:<a>/<c>" -- attr/char for monster races */
+ case 'R':
+ if (tokenize(buf+2, 3, zz, TOKENIZE_CHECKQUOTE) == 3)
+ {
+ monster_race *r_ptr;
+ i = (huge)strtol(zz[0], NULL, 0);
+ n1 = (TERM_COLOR)strtol(zz[1], NULL, 0);
+ n2 = (SYMBOL_CODE)strtol(zz[2], NULL, 0);
+ if (i >= max_r_idx) return 1;
+ r_ptr = &r_info[i];
+ if (n1 || (!(n2 & 0x80) && n2)) r_ptr->x_attr = n1; /* Allow TERM_DARK text */
+ if (n2) r_ptr->x_char = n2;
+ return 0;
+ }
+ break;
- /* Process "R:<num>:<a>/<c>" -- attr/char for monster races */
- case 'R':
- if (tokenize(buf+2, 3, zz, TOKENIZE_CHECKQUOTE) == 3)
- {
- monster_race *r_ptr;
- i = (huge)strtol(zz[0], NULL, 0);
- n1 = strtol(zz[1], NULL, 0);
- n2 = strtol(zz[2], NULL, 0);
- if (i >= max_r_idx) return 1;
- r_ptr = &r_info[i];
- if (n1) r_ptr->x_attr = n1;
- if (n2) r_ptr->x_char = n2;
- return 0;
- }
- break;
+ /* Process "K:<num>:<a>/<c>" -- attr/char for object kinds */
+ case 'K':
+ if (tokenize(buf+2, 3, zz, TOKENIZE_CHECKQUOTE) == 3)
+ {
+ object_kind *k_ptr;
+ i = (huge)strtol(zz[0], NULL, 0);
+ n1 = (TERM_COLOR)strtol(zz[1], NULL, 0);
+ n2 = (SYMBOL_CODE)strtol(zz[2], NULL, 0);
+ if (i >= max_k_idx) return 1;
+ k_ptr = &k_info[i];
+ if (n1 || (!(n2 & 0x80) && n2)) k_ptr->x_attr = n1; /* Allow TERM_DARK text */
+ if (n2) k_ptr->x_char = n2;
+ return 0;
+ }
+ break;
- /* Process "K:<num>:<a>/<c>" -- attr/char for object kinds */
- case 'K':
- if (tokenize(buf+2, 3, zz, TOKENIZE_CHECKQUOTE) == 3)
- {
- object_kind *k_ptr;
- i = (huge)strtol(zz[0], NULL, 0);
- n1 = strtol(zz[1], NULL, 0);
- n2 = strtol(zz[2], NULL, 0);
- if (i >= max_k_idx) return 1;
- k_ptr = &k_info[i];
- if (n1) k_ptr->x_attr = n1;
- if (n2) k_ptr->x_char = n2;
- return 0;
- }
- break;
+ /* Process "F:<num>:<a>/<c>" -- attr/char for terrain features */
+ /* "F:<num>:<a>/<c>" */
+ /* "F:<num>:<a>/<c>:LIT" */
+ /* "F:<num>:<a>/<c>:<la>/<lc>:<da>/<dc>" */
+ case 'F':
+ {
+ feature_type *f_ptr;
+ int num = tokenize(buf + 2, F_LIT_MAX * 2 + 1, zz, TOKENIZE_CHECKQUOTE);
- /* Process "F:<num>:<a>/<c>" -- attr/char for terrain features */
- case 'F':
- if (tokenize(buf+2, 3, zz, TOKENIZE_CHECKQUOTE) == 3)
- {
- feature_type *f_ptr;
- i = (huge)strtol(zz[0], NULL, 0);
- n1 = strtol(zz[1], NULL, 0);
- n2 = strtol(zz[2], NULL, 0);
- if (i >= max_f_idx) return 1;
- f_ptr = &f_info[i];
- if (n1) f_ptr->x_attr = n1;
- if (n2) f_ptr->x_char = n2;
- return 0;
- }
- break;
+ if ((num != 3) && (num != 4) && (num != F_LIT_MAX * 2 + 1)) return 1;
+ else if ((num == 4) && !streq(zz[3], "LIT")) return 1;
- /* Process "S:<num>:<a>/<c>" -- attr/char for special things */
- case 'S':
- if (tokenize(buf+2, 3, zz, TOKENIZE_CHECKQUOTE) == 3)
- {
- j = (byte)strtol(zz[0], NULL, 0);
- n1 = strtol(zz[1], NULL, 0);
- n2 = strtol(zz[2], NULL, 0);
- misc_to_attr[j] = n1;
- misc_to_char[j] = n2;
+ i = (huge)strtol(zz[0], NULL, 0);
+ if (i >= max_f_idx) return 1;
+ f_ptr = &f_info[i];
+
+ n1 = (TERM_COLOR)strtol(zz[1], NULL, 0);
+ n2 = (SYMBOL_CODE)strtol(zz[2], NULL, 0);
+ if (n1 || (!(n2 & 0x80) && n2)) f_ptr->x_attr[F_LIT_STANDARD] = n1; /* Allow TERM_DARK text */
+ if (n2) f_ptr->x_char[F_LIT_STANDARD] = n2;
+
+ /* Mega-hack -- feat supports lighting */
+ switch (num)
+ {
+ /* No lighting support */
+ case 3:
+ n1 = f_ptr->x_attr[F_LIT_STANDARD];
+ n2 = f_ptr->x_char[F_LIT_STANDARD];
+ for (j = F_LIT_NS_BEGIN; j < F_LIT_MAX; j++)
+ {
+ f_ptr->x_attr[j] = n1;
+ f_ptr->x_char[j] = n2;
+ }
+ break;
+
+ /* Use default lighting */
+ case 4:
+ apply_default_feat_lighting(f_ptr->x_attr, f_ptr->x_char);
+ break;
+
+ /* Use desired lighting */
+ case F_LIT_MAX * 2 + 1:
+ for (j = F_LIT_NS_BEGIN; j < F_LIT_MAX; j++)
+ {
+ n1 = (TERM_COLOR)strtol(zz[j * 2 + 1], NULL, 0);
+ n2 = (SYMBOL_CODE)strtol(zz[j * 2 + 2], NULL, 0);
+ if (n1 || (!(n2 & 0x80) && n2)) f_ptr->x_attr[j] = n1; /* Allow TERM_DARK text */
+ if (n2) f_ptr->x_char[j] = n2;
+ }
+ break;
+ }
+ }
return 0;
- }
- break;
- /* Process "U:<tv>:<a>/<c>" -- attr/char for unaware items */
- case 'U':
- if (tokenize(buf+2, 3, zz, TOKENIZE_CHECKQUOTE) == 3)
- {
- j = (huge)strtol(zz[0], NULL, 0);
- n1 = strtol(zz[1], NULL, 0);
- n2 = strtol(zz[2], NULL, 0);
- for (i = 1; i < max_k_idx; i++)
+ /* Process "S:<num>:<a>/<c>" -- attr/char for special things */
+ case 'S':
+ if (tokenize(buf+2, 3, zz, TOKENIZE_CHECKQUOTE) == 3)
+ {
+ j = (byte)strtol(zz[0], NULL, 0);
+ n1 = (TERM_COLOR)strtol(zz[1], NULL, 0);
+ n2 = (SYMBOL_CODE)strtol(zz[2], NULL, 0);
+ misc_to_attr[j] = n1;
+ misc_to_char[j] = n2;
+ return 0;
+ }
+ break;
+
+ /* Process "U:<tv>:<a>/<c>" -- attr/char for unaware items */
+ case 'U':
+ if (tokenize(buf+2, 3, zz, TOKENIZE_CHECKQUOTE) == 3)
{
- object_kind *k_ptr = &k_info[i];
- if (k_ptr->tval == j)
+ j = (huge)strtol(zz[0], NULL, 0);
+ n1 = (TERM_COLOR)strtol(zz[1], NULL, 0);
+ n2 = (SYMBOL_CODE)strtol(zz[2], NULL, 0);
+ for (i = 1; i < max_k_idx; i++)
{
- if (n1) k_ptr->d_attr = n1;
- if (n2) k_ptr->d_char = n2;
+ object_kind *k_ptr = &k_info[i];
+ if (k_ptr->tval == j)
+ {
+ if (n1) k_ptr->d_attr = n1;
+ if (n2) k_ptr->d_char = n2;
+ }
}
+ return 0;
+ }
+ break;
+
+ /* Process "E:<tv>:<a>" -- attribute for inventory objects */
+ case 'E':
+ if (tokenize(buf+2, 2, zz, TOKENIZE_CHECKQUOTE) == 2)
+ {
+ j = (byte)strtol(zz[0], NULL, 0) % 128;
+ n1 = (TERM_COLOR)strtol(zz[1], NULL, 0);
+ if (n1) tval_to_attr[j] = n1;
+ return 0;
}
+ break;
+
+ /* Process "A:<str>" -- save an "action" for later */
+ case 'A':
+ text_to_ascii(macro__buf, buf+2);
return 0;
- }
- break;
- /* Process "E:<tv>:<a>" -- attribute for inventory objects */
- case 'E':
- if (tokenize(buf+2, 2, zz, TOKENIZE_CHECKQUOTE) == 2)
+ /* Process "P:<str>" -- normal macro */
+ case 'P':
{
- j = (byte)strtol(zz[0], NULL, 0) % 128;
- n1 = strtol(zz[1], NULL, 0);
- if (n1) tval_to_attr[j] = n1;
+ char tmp[1024];
+
+ text_to_ascii(tmp, buf+2);
+ macro_add(tmp, macro__buf);
return 0;
}
- break;
-
- /* Process "A:<str>" -- save an "action" for later */
- case 'A':
- text_to_ascii(macro__buf, buf+2);
- return 0;
-
- /* Process "P:<str>" -- normal macro */
- case 'P':
- {
- char tmp[1024];
-
- text_to_ascii(tmp, buf+2);
- macro_add(tmp, macro__buf);
- return 0;
- }
-
- /* Process "C:<str>" -- create keymap */
- case 'C':
- {
- int mode;
- char tmp[1024];
- if (tokenize(buf+2, 2, zz, TOKENIZE_CHECKQUOTE) != 2) return 1;
+ /* Process "C:<str>" -- create keymap */
+ case 'C':
+ {
+ int mode;
+ char tmp[1024];
- mode = strtol(zz[0], NULL, 0);
- if ((mode < 0) || (mode >= KEYMAP_MODES)) return 1;
+ if (tokenize(buf+2, 2, zz, TOKENIZE_CHECKQUOTE) != 2) return 1;
- text_to_ascii(tmp, zz[1]);
- if (!tmp[0] || tmp[1]) return 1;
- i = (byte)(tmp[0]);
+ mode = strtol(zz[0], NULL, 0);
+ if ((mode < 0) || (mode >= KEYMAP_MODES)) return 1;
- string_free(keymap_act[mode][i]);
+ text_to_ascii(tmp, zz[1]);
+ if (!tmp[0] || tmp[1]) return 1;
+ i = (byte)(tmp[0]);
- keymap_act[mode][i] = string_make(macro__buf);
+ string_free(keymap_act[mode][i]);
- return 0;
- }
+ keymap_act[mode][i] = string_make(macro__buf);
- /* Process "V:<num>:<kv>:<rv>:<gv>:<bv>" -- visual info */
- case 'V':
- if (tokenize(buf+2, 5, zz, TOKENIZE_CHECKQUOTE) == 5)
- {
- i = (byte)strtol(zz[0], NULL, 0);
- angband_color_table[i][0] = (byte)strtol(zz[1], NULL, 0);
- angband_color_table[i][1] = (byte)strtol(zz[2], NULL, 0);
- angband_color_table[i][2] = (byte)strtol(zz[3], NULL, 0);
- angband_color_table[i][3] = (byte)strtol(zz[4], NULL, 0);
return 0;
}
- break;
- /* Process "X:<str>" -- turn option off */
- /* Process "Y:<str>" -- turn option on */
- case 'X':
- case 'Y':
- for (i = 0; option_info[i].o_desc; i++)
- {
- if (option_info[i].o_var &&
- option_info[i].o_text &&
- streq(option_info[i].o_text, buf + 2))
+ /* Process "V:<num>:<kv>:<rv>:<gv>:<bv>" -- visual info */
+ case 'V':
+ if (tokenize(buf+2, 5, zz, TOKENIZE_CHECKQUOTE) == 5)
{
- int os = option_info[i].o_set;
- int ob = option_info[i].o_bit;
+ i = (byte)strtol(zz[0], NULL, 0);
+ angband_color_table[i][0] = (byte)strtol(zz[1], NULL, 0);
+ angband_color_table[i][1] = (byte)strtol(zz[2], NULL, 0);
+ angband_color_table[i][2] = (byte)strtol(zz[3], NULL, 0);
+ angband_color_table[i][3] = (byte)strtol(zz[4], NULL, 0);
+ return 0;
+ }
+ break;
- if ((p_ptr->playing || character_xtra) &&
- (OPT_PAGE_BIRTH == option_info[i].o_page) && !p_ptr->wizard)
+ /* Process "X:<str>" -- turn option off */
+ /* Process "Y:<str>" -- turn option on */
+ case 'X':
+ case 'Y':
+ for (i = 0; option_info[i].o_desc; i++)
+ {
+ if (option_info[i].o_var &&
+ option_info[i].o_text &&
+ streq(option_info[i].o_text, buf + 2))
{
-#ifdef JP
- msg_format("½é´ü¥ª¥×¥·¥ç¥ó¤ÏÊѹ¹¤Ç¤¤Þ¤»¤ó! '%s'", buf);
-#else
- msg_format("Birth options can not changed! '%s'", buf);
-#endif
- msg_print(NULL);
- return 0;
- }
+ int os = option_info[i].o_set;
+ int ob = option_info[i].o_bit;
- if (buf[0] == 'X')
- {
- /* Clear */
- option_flag[os] &= ~(1L << ob);
- (*option_info[i].o_var) = FALSE;
- }
- else
- {
- /* Set */
- option_flag[os] |= (1L << ob);
- (*option_info[i].o_var) = TRUE;
+ if ((p_ptr->playing || character_xtra) &&
+ (OPT_PAGE_BIRTH == option_info[i].o_page) && !p_ptr->wizard)
+ {
+ msg_format(_("初期オプションは変更できません! '%s'", "Birth options can not changed! '%s'"), buf);
+ msg_print(NULL);
+ return 0;
+ }
+
+ if (buf[0] == 'X')
+ {
+ /* Clear */
+ option_flag[os] &= ~(1L << ob);
+ (*option_info[i].o_var) = FALSE;
+ }
+ else
+ {
+ /* Set */
+ option_flag[os] |= (1L << ob);
+ (*option_info[i].o_var) = TRUE;
+ }
+ return 0;
}
- return 0;
}
- }
- /* don't know that option. ignore it.*/
-#ifdef JP
- msg_format("¥ª¥×¥·¥ç¥ó¤Î̾Á°¤¬Àµ¤·¤¯¤¢¤ê¤Þ¤»¤ó¡§ %s", buf);
-#else
- msg_format("Ignored invalid option: %s", buf);
-#endif
- msg_print(NULL);
- return 0;
+ /* don't know that option. ignore it.*/
+ msg_format(_("オプションの名前が正しくありません: %s", "Ignored invalid option: %s"), buf);
+ msg_print(NULL);
+ return 0;
- /* Process "Z:<type>:<str>" -- set spell color */
- case 'Z':
- {
- /* Find the colon */
- char *t = strchr(buf + 2, ':');
+ /* Process "Z:<type>:<str>" -- set spell color */
+ case 'Z':
+ {
+ /* Find the colon */
+ char *t = my_strchr(buf + 2, ':');
- /* Oops */
- if (!t) return 1;
+ if (!t) return 1;
- /* Nuke the colon */
- *(t++) = '\0';
+ /* Nuke the colon */
+ *(t++) = '\0';
- for (i = 0; gf_desc[i].name; i++)
- {
- /* Match this type */
- if (streq(gf_desc[i].name, buf + 2))
+ for (i = 0; gf_desc[i].name; i++)
{
- /* Remember this color set */
- gf_color[gf_desc[i].num] = quark_add(t);
+ /* Match this type */
+ if (streq(gf_desc[i].name, buf + 2))
+ {
+ /* Remember this color set */
+ gf_color[gf_desc[i].num] = quark_add(t);
- /* Success */
- return 0;
+ /* Success */
+ return 0;
+ }
}
- }
-
- break;
- }
- /* Initialize macro trigger names and a template */
- /* Process "T:<trigger>:<keycode>:<shift-keycode>" */
- /* Process "T:<template>:<modifier chr>:<modifier name>:..." */
- case 'T':
- {
- int tok = tokenize(buf+2, 2+MAX_MACRO_MOD, zz, 0);
+ break;
+ }
+ /* Initialize macro trigger names and a template */
+ /* Process "T:<trigger>:<keycode>:<shift-keycode>" */
/* Process "T:<template>:<modifier chr>:<modifier name>:..." */
- if (tok >= 4)
+ case 'T':
{
- int i;
- int num;
+ int tok = tokenize(buf+2, 2+MAX_MACRO_MOD, zz, 0);
- if (macro_template != NULL)
+ /* Process "T:<template>:<modifier chr>:<modifier name>:..." */
+ if (tok >= 4)
{
- num = strlen(macro_modifier_chr);
+ int num;
- /* Kill the template string */
- string_free(macro_template);
- macro_template = NULL;
+ if (macro_template != NULL)
+ {
+ num = strlen(macro_modifier_chr);
- /* Kill flag characters of modifier keys */
- string_free(macro_modifier_chr);
+ /* Kill the template string */
+ string_free(macro_template);
+ macro_template = NULL;
- /* Kill corresponding modifier names */
- for (i = 0; i < num; i++)
- {
- string_free(macro_modifier_name[i]);
- }
+ /* Kill flag characters of modifier keys */
+ string_free(macro_modifier_chr);
- /* Kill trigger name strings */
- for (i = 0; i < max_macrotrigger; i++)
- {
- string_free(macro_trigger_name[i]);
- string_free(macro_trigger_keycode[0][i]);
- string_free(macro_trigger_keycode[1][i]);
- }
+ /* Kill corresponding modifier names */
+ for (i = 0; i < num; i++)
+ {
+ string_free(macro_modifier_name[i]);
+ }
- max_macrotrigger = 0;
- }
+ /* Kill trigger name strings */
+ for (i = 0; i < max_macrotrigger; i++)
+ {
+ string_free(macro_trigger_name[i]);
+ string_free(macro_trigger_keycode[0][i]);
+ string_free(macro_trigger_keycode[1][i]);
+ }
- if (*zz[0] == '\0') return 0; /* clear template */
+ max_macrotrigger = 0;
+ }
- /* Number of modifier flags */
- num = strlen(zz[1]);
+ if (*zz[0] == '\0') return 0; /* clear template */
- /* Limit the number */
- num = MIN(MAX_MACRO_MOD, num);
+ /* Number of modifier flags */
+ num = strlen(zz[1]);
- /* Stop if number of modifier is not correct */
- if (2 + num != tok) return 1;
+ /* Limit the number */
+ num = MIN(MAX_MACRO_MOD, num);
- /* Get a template string */
- macro_template = string_make(zz[0]);
+ /* Stop if number of modifier is not correct */
+ if (2 + num != tok) return 1;
- /* Get flag characters of modifier keys */
- macro_modifier_chr = string_make(zz[1]);
+ /* Get a template string */
+ macro_template = string_make(zz[0]);
- /* Get corresponding modifier names */
- for (i = 0; i < num; i++)
- {
- macro_modifier_name[i] = string_make(zz[2+i]);
- }
- }
+ /* Get flag characters of modifier keys */
+ macro_modifier_chr = string_make(zz[1]);
- /* Process "T:<trigger>:<keycode>:<shift-keycode>" */
- else if (tok >= 2)
- {
- char buf[1024];
- int m;
- char *t, *s;
- if (max_macrotrigger >= MAX_MACRO_TRIG)
- {
-#ifdef JP
- msg_print("¥Þ¥¯¥í¥È¥ê¥¬¡¼¤ÎÀßÄ꤬¿¤¹¤®¤Þ¤¹!");
-#else
- msg_print("Too many macro triggers!");
-#endif
- return 1;
+ /* Get corresponding modifier names */
+ for (i = 0; i < num; i++)
+ {
+ macro_modifier_name[i] = string_make(zz[2+i]);
+ }
}
- m = max_macrotrigger;
- max_macrotrigger++;
- /* Take into account the escape character */
- t = buf;
- s = zz[0];
- while (*s)
+ /* Process "T:<trigger>:<keycode>:<shift-keycode>" */
+ else if (tok >= 2)
{
- if ('\\' == *s) s++;
- *t++ = *s++;
- }
- *t = '\0';
+ char buf_aux[1024];
+ int m;
+ char *t, *s;
+ if (max_macrotrigger >= MAX_MACRO_TRIG)
+ {
+ msg_print(_("マクロトリガーの設定が多すぎます!", "Too many macro triggers!"));
+ return 1;
+ }
+ m = max_macrotrigger;
+ max_macrotrigger++;
- /* Get a trigger name */
- macro_trigger_name[m] = string_make(buf);
+ /* Take into account the escape character */
+ t = buf_aux;
+ s = zz[0];
+ while (*s)
+ {
+ if ('\\' == *s) s++;
+ *t++ = *s++;
+ }
+ *t = '\0';
- /* Get the corresponding key code */
- macro_trigger_keycode[0][m] = string_make(zz[1]);
+ /* Get a trigger name */
+ macro_trigger_name[m] = string_make(buf_aux);
- if (tok == 3)
- {
- /* Key code of a combination of it with the shift key */
- macro_trigger_keycode[1][m] = string_make(zz[2]);
- }
- else
- {
- macro_trigger_keycode[1][m] = string_make(zz[1]);
+ /* Get the corresponding key code */
+ macro_trigger_keycode[0][m] = string_make(zz[1]);
+
+ if (tok == 3)
+ {
+ /* Key code of a combination of it with the shift key */
+ macro_trigger_keycode[1][m] = string_make(zz[2]);
+ }
+ else
+ {
+ macro_trigger_keycode[1][m] = string_make(zz[1]);
+ }
}
- }
- /* No error */
- return 0;
- }
+ /* No error */
+ return 0;
+ }
}
/* Failure */
}
-/*
+/*!
+ * @brief process_pref_fileのサブルーチンとして条件分岐処理の解釈と結果を返す /
* Helper function for "process_pref_file()"
- *
+ * @param sp テキスト文字列の参照ポインタ
+ * @param fp 再帰中のポインタ参照
+ * @return
+ * @details
+ * <pre>
* Input:
* v: output buffer array
* f: final character
- *
* Output:
* result
+ * </pre>
*/
-cptr process_pref_file_expr(cptr *sp, char *fp)
+concptr process_pref_file_expr(char **sp, char *fp)
{
- cptr v;
+ concptr v;
- cptr s;
+ char *b;
+ char *s;
char b1 = '[';
char b2 = ']';
char f = ' ';
- static char tmp[8];
+ static char tmp[16];
/* Initial */
s = (*sp);
/* Skip spaces */
- while (isspace(*s)) s++;
+ while (iswspace(*s)) s++;
+
+ /* Save start */
+ b = s;
/* Default */
v = "?o?o?";
/* Analyze */
if (*s == b1)
{
- const char *p;
- const char *t;
+ concptr p;
+ concptr t;
/* Skip b1 */
s++;
/* First */
t = process_pref_file_expr(&s, &f);
- /* Oops */
if (!*t)
{
/* Nothing */
/* Function: EQU */
else if (streq(t, "EQU"))
{
- v = "1";
+ v = "0";
if (*s && (f != b2))
{
t = process_pref_file_expr(&s, &f);
}
while (*s && (f != b2))
{
- p = t;
- t = process_pref_file_expr(&s, &f);
- if (*t && !streq(p, t)) v = "0";
+ p = process_pref_file_expr(&s, &f);
+ if (streq(t, p)) v = "1";
}
}
{
p = t;
t = process_pref_file_expr(&s, &f);
- if (*t && (strcmp(p, t) > 0)) v = "0";
+ if (*t && atoi(p) > atoi(t)) v = "0";
}
}
{
p = t;
t = process_pref_file_expr(&s, &f);
- if (*t && (strcmp(p, t) < 0)) v = "0";
+
+ /* Compare two numbers instead of string */
+ if (*t && atoi(p) < atoi(t)) v = "0";
}
}
- /* Oops */
else
{
while (*s && (f != b2))
if (f != b2) v = "?x?x?";
/* Extract final and Terminate */
- if ((f = *s) != '\0') s++;
+ if ((f = *s) != '\0') *s++ = '\0';
}
/* Other */
else
{
- char b[1024];
- int i;
-
/* Accept all printables except spaces and brackets */
- for (i = 0; isprint(*s) && !strchr(" []", *s); i++)
- b[i] = *s++;
-
- /* Terminate */
- b[i] = '\0';
+#ifdef JP
+ while (iskanji(*s) || (isprint(*s) && !my_strchr(" []", *s)))
+ {
+ if (iskanji(*s)) s++;
+ s++;
+ }
+#else
+ while (isprint(*s) && !my_strchr(" []", *s)) ++s;
+#endif
/* Extract final and Terminate */
- if ((f = *s) != '\0') s++;
+ if ((f = *s) != '\0') *s++ = '\0';
/* Variable */
if (*b == '$')
/* Player */
else if (streq(b+1, "PLAYER"))
{
- v = player_base;
+ static char tmp_player_name[32];
+ char *pn, *tpn;
+ for (pn = p_ptr->name, tpn = tmp_player_name; *pn; pn++, tpn++)
+ {
+#ifdef JP
+ if (iskanji(*pn))
+ {
+ *(tpn++) = *(pn++);
+ *tpn = *pn;
+ continue;
+ }
+#endif
+ *tpn = my_strchr(" []", *pn) ? '_' : *pn;
+ }
+ *tpn = '\0';
+ v = tmp_player_name;
}
/* First realm */
else
v = "0";
}
+
+ /* Money */
+ else if (streq(b+1, "MONEY"))
+ {
+ sprintf(tmp, "%09ld", (long int)p_ptr->au);
+ v = tmp;
+ }
}
/* Constant */
/* Save */
(*fp) = f;
-
- /* Save */
(*sp) = s;
-
- /* Result */
return (v);
}
#define PREF_TYPE_NORMAL 0
-#define PREF_TYPE_PICKPREF 1
+#define PREF_TYPE_AUTOPICK 1
#define PREF_TYPE_HISTPREF 2
-/*
+/*!
+ * @brief process_pref_fileのサブルーチン /
* Open the "user pref file" and parse it.
+ * @param name 読み込むファイル名
+ * @param preftype prefファイルのタイプ
+ * @return エラーコード
+ * @details
+ * <pre>
+ * Input:
+ * v: output buffer array
+ * f: final character
+ * Output:
+ * result
+ * </pre>
*/
-static errr process_pref_file_aux(cptr name, int preftype)
+static errr process_pref_file_aux(concptr name, int preftype)
{
FILE *fp;
#ifdef JP
if (!iskanji(buf[0]))
#endif
- if (isspace(buf[0])) continue;
+ if (iswspace(buf[0])) continue;
/* Skip comments */
if (buf[0] == '#') continue;
if ((buf[0] == '?') && (buf[1] == ':'))
{
char f;
- cptr v;
- cptr s;
+ concptr v;
+ char *s;
/* Start */
s = buf + 2;
/* Set flag */
bypass = (streq(v, "0") ? TRUE : FALSE);
-
- /* Continue */
continue;
}
/* Process "%:<file>" */
if (buf[0] == '%')
{
+ static int depth_count = 0;
+
+ /* Ignore if deeper than 20 level */
+ if (depth_count > 20) continue;
+
+ /* Count depth level */
+ depth_count++;
+
/* Process that file if allowed */
switch (preftype)
{
- case PREF_TYPE_PICKPREF:
- (void)process_pickpref_file(buf + 2);
+ case PREF_TYPE_AUTOPICK:
+ (void)process_autopick_file(buf + 2);
break;
case PREF_TYPE_HISTPREF:
(void)process_histpref_file(buf + 2);
break;
}
- /* Continue */
+ /* Set back depth level */
+ depth_count--;
continue;
}
/* This is not original pref line... */
if (err)
{
- if (preftype != PREF_TYPE_PICKPREF)
+ if (preftype != PREF_TYPE_AUTOPICK)
break;
- err = process_pickpref_file_line(buf);
+ err = process_autopick_file_command(buf);
}
}
{
/* Print error message */
/* ToDo: Add better error messages */
-#ifdef JP
- msg_format("¥Õ¥¡¥¤¥ë'%s'¤Î%d¹Ô¤Ç¥¨¥é¡¼ÈÖ¹æ%d¤Î¥¨¥é¡¼¡£", name, line, err);
- msg_format("('%s'¤ò²òÀÏÃæ)", old);
-#else
- msg_format("Error %d in line %d of file '%s'.", err, line, name);
- msg_format("Parsing '%s'", old);
-#endif
+ msg_format(_("ファイル'%s'の%d行でエラー番号%dのエラー。", "Error %d in line %d of file '%s'."),
+ _(name, err), line, _(err, name));
+ msg_format(_("('%s'を解析中)", "Parsing '%s'"), old);
msg_print(NULL);
}
-
- /* Close the file */
my_fclose(fp);
-
- /* Result */
return (err);
}
-
-/*
+/*!
+ * @brief pref設定ファイルを読み込み設定を反映させる /
* Process the "user pref file" with the given name
- *
+ * @param name 読み込むファイル名
+ * @return エラーコード
+ * @details
+ * <pre>
* See the functions above for a list of legal "commands".
- *
* We also accept the special "?" and "%" directives, which
* allow conditional evaluation and filename inclusion.
+ * </pre>
*/
-errr process_pref_file(cptr name)
+errr process_pref_file(concptr name)
{
char buf[1024];
#endif
-/*
+/*!
+ * @brief Angbandプレイ禁止時刻をチェック /
* Handle CHECK_TIME
+ * @return エラーコード
*/
errr check_time(void)
{
}
-
-/*
+/*!
+ * @brief Angbandプレイ禁止時刻の初期化 /
* Initialize CHECK_TIME
+ * @return エラーコード
*/
errr check_time_init(void)
{
#endif
-/*
+/*!
+ * @brief Angbandプレイ禁止ホストのチェック /
* Handle CHECK_LOAD
+ * @return エラーコード
*/
errr check_load(void)
{
}
-/*
+/*!
+ * @brief Angbandプレイ禁止ホストの設定初期化 /
* Initialize CHECK_LOAD
+ * @return エラーコード
*/
errr check_load_init(void)
{
/* Use that value */
check_load_value = value;
- /* Done */
break;
}
-
- /* Close the file */
my_fclose(fp);
#endif
#define ENTRY_SKILL_SEARCH 25
#define ENTRY_SKILL_DISARM 26
#define ENTRY_SKILL_DEVICE 27
+#define ENTRY_SKILL_DIG 45
+
+
#define ENTRY_BLOWS 28
#define ENTRY_SHOTS 29
#define ENTRY_AVG_DMG 30
} disp_player_line[]
#ifdef JP
= {
- { 1, 10, 25, "ÂǷ⽤Àµ(³ÊÆ®)"},
- { 1, 10, 25, "ÂǷ⽤Àµ(ξ¼ê)"},
- { 1, 10, 25, "ÂǷ⽤Àµ(±¦¼ê)"},
- { 1, 10, 25, "ÂǷ⽤Àµ(º¸¼ê)"},
- { 1, 11, 25, "ÂǷ⽤Àµ(º¸¼ê)"},
- { 1, 11, 25, "ÂǷ⽤Àµ(±¦¼ê)"},
+ { 1, 10, 25, "打撃修正(格闘)"},
+ { 1, 10, 25, "打撃修正(両手)"},
+ { 1, 10, 25, "打撃修正(右手)"},
+ { 1, 10, 25, "打撃修正(左手)"},
+ { 1, 11, 25, "打撃修正(左手)"},
+ { 1, 11, 25, "打撃修正(右手)"},
{ 1, 11, 25, ""},
- { 1, 15, 25, "¼Í·â¹¶·â½¤Àµ"},
- { 1, 16, 25, "¼Í·âÉð´ïÇÜΨ"},
- { 1, 20, 25, "²Ã®"},
- { 1, 19, 25, "£Á£Ã"},
- {29, 13, 21, "¥ì¥Ù¥ë"},
- {29, 14, 21, "·Ð¸³ÃÍ"},
- {29, 15, 21, "ºÇÂç·Ð¸³"},
- {29, 16, 21, "¼¡¥ì¥Ù¥ë"},
- {29, 17, 21, "½ê»ý¶â"},
- {29, 19, 21, "ÆüÉÕ"},
- {29, 10, 21, "£È£Ð"},
- {29, 11, 21, "£Í£Ð"},
- {29, 20, 21, "¥×¥ì¥¤»þ´Ö"},
- {53, 10, -1, "ÂǷ⹶·â :"},
- {53, 11, -1, "¼Í·â¹¶·â :"},
- {53, 12, -1, "ËâË¡Ëɸæ :"},
- {53, 13, -1, "±£Ì©¹ÔÆ° :"},
- {53, 15, -1, "ÃγР:"},
- {53, 16, -1, "õº÷ :"},
- {53, 17, -1, "²ò½ü :"},
- {53, 18, -1, "ËâË¡Æ»¶ñ :"},
- { 1, 12, 25, "ÂÇ·â²ó¿ô"},
- { 1, 17, 25, "¼Í·â²ó¿ô"},
- { 1, 13, 25, "Ê¿¶Ñ¥À¥á¡¼¥¸"},
- {53, 20, -1, "ÀÖ³°Àþ»ëÎÏ:"},
- {26, 1, -1, "̾Á° : "},
- { 1, 3, -1, "ÀÊÌ : "},
- { 1, 4, -1, "¼ï² : "},
- { 1, 5, -1, "¿¦¶È : "},
- { 1, 6, -1, "ËâË¡ : "},
- { 1, 7, -1, "¼é¸îËâ¿À : "},
- {29, 3, 21, "ǯÎð"},
- {29, 4, 21, "¿ÈĹ"},
- {29, 5, 21, "ÂνÅ"},
- {29, 6, 21, "¼Ò²ñŪÃÏ°Ì"},
- {29, 7, 21, "°À"},
- {29, 14, 21, "¶¯²½ÅÙ"},
- {29, 16, 21, "¼¡¥ì¥Ù¥ë"},
+ { 1, 15, 25, "射撃攻撃修正"},
+ { 1, 16, 25, "射撃武器倍率"},
+ { 1, 20, 25, "加速"},
+ { 1, 19, 25, "AC"},
+ {29, 13, 21, "レベル"},
+ {29, 14, 21, "経験値"},
+ {29, 15, 21, "最大経験"},
+ {29, 16, 21, "次レベル"},
+ {29, 17, 21, "所持金"},
+ {29, 19, 21, "日付"},
+ {29, 10, 21, "HP"},
+ {29, 11, 21, "MP"},
+ {29, 20, 21, "プレイ時間"},
+ {53, 10, -1, "打撃命中 :"},
+ {53, 11, -1, "射撃命中 :"},
+ {53, 12, -1, "魔法防御 :"},
+ {53, 13, -1, "隠密行動 :"},
+ {53, 15, -1, "知覚 :"},
+ {53, 16, -1, "探索 :"},
+ {53, 17, -1, "解除 :"},
+ {53, 18, -1, "魔法道具 :"},
+ { 1, 12, 25, "打撃回数"},
+ { 1, 17, 25, "射撃回数"},
+ { 1, 13, 25, "平均ダメージ"},
+ {53, 20, -1, "赤外線視力:"},
+ {26, 1, -1, "名前 : "},
+ { 1, 3, -1, "性別 : "},
+ { 1, 4, -1, "種族 : "},
+ { 1, 5, -1, "職業 : "},
+ { 1, 6, -1, "魔法 : "},
+ { 1, 7, -1, "守護魔神 : "},
+ {29, 3, 21, "年齢"},
+ {29, 4, 21, "身長"},
+ {29, 5, 21, "体重"},
+ {29, 6, 21, "社会的地位"},
+ {29, 7, 21, "属性"},
+ {29, 14, 21, "強化度"},
+ {29, 16, 21, "次レベル"},
+ {53, 19, -1, "掘削 :" },
};
#else
= {
{29, 7, 21, "Align"},
{29, 14, 21, "Construction"},
{29, 16, 21, "Const to Adv"},
+ {53, 19, -1, "Digging :" },
};
#endif
-static void display_player_one_line(int entry, cptr val, byte attr)
+/*!
+ * @brief プレイヤーのステータス1種を出力する
+ * @param entry 項目ID
+ * @param val 値を保管した文字列ポインタ
+ * @param attr 項目表示の色
+ * @return なし
+ */
+static void display_player_one_line(int entry, concptr val, TERM_COLOR attr)
{
char buf[40];
int row = disp_player_line[entry].row;
int col = disp_player_line[entry].col;
int len = disp_player_line[entry].len;
- cptr head = disp_player_line[entry].header;
+ concptr head = disp_player_line[entry].header;
int head_len = strlen(head);
return;
}
+/*!
+ * @brief プレイヤーの打撃能力修正を表示する
+ * @param hand 武器の装備部位ID
+ * @param hand_entry 項目ID
+ * @return なし
+ */
+static void display_player_melee_bonus(int hand, int hand_entry)
+{
+ char buf[160];
+ HIT_PROB show_tohit = p_ptr->dis_to_h[hand];
+ HIT_POINT show_todam = p_ptr->dis_to_d[hand];
+ object_type *o_ptr = &inventory[INVEN_RARM + hand];
-/*
+ /* Hack -- add in weapon info if known */
+ if (object_is_known(o_ptr)) show_tohit += o_ptr->to_h;
+ if (object_is_known(o_ptr)) show_todam += o_ptr->to_d;
+
+ show_tohit += p_ptr->skill_thn / BTH_PLUS_ADJ;
+
+ /* Melee attacks */
+ sprintf(buf, "(%+d,%+d)", (int)show_tohit, (int)show_todam);
+
+ /* Dump the bonuses to hit/dam */
+ if (!has_melee_weapon(INVEN_RARM) && !has_melee_weapon(INVEN_LARM))
+ display_player_one_line(ENTRY_BARE_HAND, buf, TERM_L_BLUE);
+ else if (p_ptr->ryoute)
+ display_player_one_line(ENTRY_TWO_HANDS, buf, TERM_L_BLUE);
+ else
+ display_player_one_line(hand_entry, buf, TERM_L_BLUE);
+}
+
+
+/*!
+ * @brief プレイヤーステータス表示の中央部分を表示するサブルーチン
* Prints the following information on the screen.
+ * @return なし
*/
static void display_player_middle(void)
{
char buf[160];
- int show_tohit, show_todam;
- object_type *o_ptr;
- int tmul = 0;
- int e;
-
- if(p_ptr->migite)
- {
- show_tohit = p_ptr->dis_to_h[0];
- show_todam = p_ptr->dis_to_d[0];
- o_ptr = &inventory[INVEN_RARM];
+ /* Base skill */
+ HIT_PROB show_tohit = p_ptr->dis_to_h_b;
+ HIT_POINT show_todam = 0;
- /* Hack -- add in weapon info if known */
- if (object_known_p(o_ptr)) show_tohit += o_ptr->to_h;
- if (object_known_p(o_ptr)) show_todam += o_ptr->to_d;
+ /* Range weapon */
+ object_type *o_ptr = &inventory[INVEN_BOW];
- /* Melee attacks */
- sprintf(buf, "(%+d,%+d)", show_tohit, show_todam);
+ int tmul = 0;
+ int e;
- /* Dump the bonuses to hit/dam */
- if(!buki_motteruka(INVEN_RARM) && !buki_motteruka(INVEN_LARM))
- display_player_one_line(ENTRY_BARE_HAND, buf, TERM_L_BLUE);
- else if(p_ptr->ryoute)
- display_player_one_line(ENTRY_TWO_HANDS, buf, TERM_L_BLUE);
- else if (left_hander)
- display_player_one_line(ENTRY_LEFT_HAND1, buf, TERM_L_BLUE);
- else
- display_player_one_line(ENTRY_RIGHT_HAND1, buf, TERM_L_BLUE);
+ if (p_ptr->migite)
+ {
+ display_player_melee_bonus(0, left_hander ? ENTRY_LEFT_HAND1 : ENTRY_RIGHT_HAND1);
}
- if(p_ptr->hidarite)
+ if (p_ptr->hidarite)
{
- show_tohit = p_ptr->dis_to_h[1];
- show_todam = p_ptr->dis_to_d[1];
-
- o_ptr = &inventory[INVEN_LARM];
-
- /* Hack -- add in weapon info if known */
- if (object_known_p(o_ptr)) show_tohit += o_ptr->to_h;
- if (object_known_p(o_ptr)) show_todam += o_ptr->to_d;
-
- /* Melee attacks */
- sprintf(buf, "(%+d,%+d)", show_tohit, show_todam);
-
- /* Dump the bonuses to hit/dam */
- if (left_hander)
- display_player_one_line(ENTRY_RIGHT_HAND2, buf, TERM_L_BLUE);
- else
- display_player_one_line(ENTRY_LEFT_HAND2, buf, TERM_L_BLUE);
+ display_player_melee_bonus(1, left_hander ? ENTRY_RIGHT_HAND2: ENTRY_LEFT_HAND2);
}
else if ((p_ptr->pclass == CLASS_MONK) && (empty_hands(TRUE) & EMPTY_HAND_RARM))
{
if ((p_ptr->special_defense >> i) & KAMAE_GENBU) break;
}
if (i < MAX_KAMAE)
-#ifdef JP
- display_player_one_line(ENTRY_POSTURE, format("%s¤Î¹½¤¨", kamae_shurui[i].desc), TERM_YELLOW);
-#else
- display_player_one_line(ENTRY_POSTURE, format("%s form", kamae_shurui[i].desc), TERM_YELLOW);
-#endif
+ display_player_one_line(ENTRY_POSTURE, format(_("%sの構え", "%s form"), kamae_shurui[i].desc), TERM_YELLOW);
}
else
-#ifdef JP
- display_player_one_line(ENTRY_POSTURE, "¹½¤¨¤Ê¤·", TERM_YELLOW);
-#else
- display_player_one_line(ENTRY_POSTURE, "none", TERM_YELLOW);
-#endif
+ display_player_one_line(ENTRY_POSTURE, _("構えなし", "none"), TERM_YELLOW);
}
- /* Range weapon */
- o_ptr = &inventory[INVEN_BOW];
-
- /* Base skill */
- show_tohit = p_ptr->dis_to_h_b;
- show_todam = 0;
-
/* Apply weapon bonuses */
- if (object_known_p(o_ptr)) show_tohit += o_ptr->to_h;
- if (object_known_p(o_ptr)) show_todam += o_ptr->to_d;
+ if (object_is_known(o_ptr)) show_tohit += o_ptr->to_h;
+ if (object_is_known(o_ptr)) show_todam += o_ptr->to_d;
if ((o_ptr->sval == SV_LIGHT_XBOW) || (o_ptr->sval == SV_HEAVY_XBOW))
show_tohit += p_ptr->weapon_exp[0][o_ptr->sval] / 400;
else
show_tohit += (p_ptr->weapon_exp[0][o_ptr->sval] - (WEAPON_EXP_MASTER / 2)) / 200;
-
+
+ show_tohit += p_ptr->skill_thb / BTH_PLUS_ADJ;
+
/* Range attacks */
display_player_one_line(ENTRY_SHOOT_HIT_DAM, format("(%+d,%+d)", show_tohit, show_todam), TERM_L_BLUE);
/* Dump speed */
{
int tmp_speed = 0;
- byte attr;
+ TERM_COLOR attr;
int i;
i = p_ptr->pspeed-110;
}
else
{
- if (m_list[p_ptr->riding].fast) tmp_speed += 10;
- if (m_list[p_ptr->riding].slow) tmp_speed -= 10;
+ if (MON_FAST(&m_list[p_ptr->riding])) tmp_speed += 10;
+ if (MON_SLOW(&m_list[p_ptr->riding])) tmp_speed -= 10;
}
if (tmp_speed)
if (!p_ptr->riding)
sprintf(buf, "(%+d%+d)", i-tmp_speed, tmp_speed);
else
-#ifdef JP
- sprintf(buf, "¾èÇÏÃæ (%+d%+d)", i-tmp_speed, tmp_speed);
-#else
- sprintf(buf, "Riding (%+d%+d)", i-tmp_speed, tmp_speed);
-#endif
+ sprintf(buf, _("乗馬中 (%+d%+d)", "Riding (%+d%+d)"), i-tmp_speed, tmp_speed);
if (tmp_speed > 0)
attr = TERM_YELLOW;
if (!p_ptr->riding)
sprintf(buf, "(%+d)", i);
else
-#ifdef JP
- sprintf(buf, "¾èÇÏÃæ (%+d)", i);
-#else
- sprintf(buf, "Riding (%+d)", i);
-#endif
+ sprintf(buf, _("乗馬中 (%+d)", "Riding (%+d)"), i);
}
display_player_one_line(ENTRY_SPEED, buf, attr);
int day, hour, min;
extract_day_hour_min(&day, &hour, &min);
- sprintf(buf,
-#ifdef JP
- "%dÆüÌÜ %2d:%02d",
-#else
- "Day %d %2d:%02d",
-#endif
- day, hour, min);
+ if (day < MAX_DAYS) sprintf(buf, _("%d日目 %2d:%02d", "Day %d %2d:%02d"), day, hour, min);
+ else sprintf(buf, _("*****日目 %2d:%02d", "Day ***** %2d:%02d"), hour, min);
}
display_player_one_line(ENTRY_DAY, buf, TERM_L_GREEN);
/*
* Hack -- pass color info around this file
*/
-static byte likert_color = TERM_WHITE;
+static TERM_COLOR likert_color = TERM_WHITE;
-/*
+/*!
+ * @brief 技能ランクの表示基準を定める
* Returns a "rating" of x depending on y
+ * @param x 技能値
+ * @param y 技能値に対するランク基準比
+ * @return なし
*/
-static cptr likert(int x, int y)
+static concptr likert(int x, int y)
{
- static char dummy[20] = "";
+ static char dummy[20] = "", dummy2[20] = "";
+ memset(dummy, 0, strlen(dummy));
+ memset(dummy2, 0, strlen(dummy2));
/* Paranoia */
if (y <= 0) y = 1;
+ if(show_actual_value)
+ {
+ sprintf(dummy, "%3d-", x);
+ }
+
/* Negative value */
if (x < 0)
{
likert_color = TERM_L_DARK;
-#ifdef JP
- return "ºÇÄã";
-#else
- return "Very Bad";
-#endif
+ strcat(dummy, _("最低", "Very Bad"));
}
-
- /* Analyze the value */
- switch ((x / y))
+ else
{
- case 0:
- case 1:
- likert_color = TERM_RED;
-#ifdef JP
- return "°¤¤";
-#else
- return "Bad";
-#endif
- case 2:
- likert_color = TERM_L_RED;
-#ifdef JP
- return "Îô¤ë";
-#else
- return "Poor";
-#endif
+ /* Analyze the value */
+ switch ((x / y))
+ {
+ case 0:
+ case 1:
+ likert_color = TERM_RED;
+ strcat(dummy, _("悪い", "Bad"));
+ break;
+ case 2:
+ likert_color = TERM_L_RED;
+ strcat(dummy, _("劣る", "Poor"));
+ break;
- case 3:
- case 4:
- likert_color = TERM_ORANGE;
-#ifdef JP
- return "ÉáÄÌ";
-#else
- return "Fair";
-#endif
+ case 3:
+ case 4:
+ likert_color = TERM_ORANGE;
+ strcat(dummy, _("普通", "Fair"));
+ break;
- case 5:
- likert_color = TERM_YELLOW;
-#ifdef JP
- return "Îɤ¤";
-#else
- return "Good";
-#endif
+ case 5:
+ likert_color = TERM_YELLOW;
+ strcat(dummy, _("良い", "Good"));
+ break;
- case 6:
- likert_color = TERM_YELLOW;
-#ifdef JP
- return "ÂçÊÑÎɤ¤";
-#else
- return "Very Good";
-#endif
+ case 6:
+ likert_color = TERM_YELLOW;
+ strcat(dummy, _("大変良い", "Very Good"));
+ break;
- case 7:
- case 8:
- likert_color = TERM_L_GREEN;
-#ifdef JP
- return "Âî±Û";
-#else
- return "Excellent";
-#endif
+ case 7:
+ case 8:
+ likert_color = TERM_L_GREEN;
+ strcat(dummy, _("卓越", "Excellent"));
+ break;
- case 9:
- case 10:
- case 11:
- case 12:
- case 13:
- likert_color = TERM_GREEN;
-#ifdef JP
- return "Ķ±Û";
-#else
- return "Superb";
-#endif
+ case 9:
+ case 10:
+ case 11:
+ case 12:
+ case 13:
+ likert_color = TERM_GREEN;
+ strcat(dummy, _("超越", "Superb"));
+ break;
- case 14:
- case 15:
- case 16:
- case 17:
- likert_color = TERM_BLUE;
-#ifdef JP
- return "±ÑͺŪ";
-#else
- return "Heroic";
-#endif
+ case 14:
+ case 15:
+ case 16:
+ case 17:
+ likert_color = TERM_BLUE;
+ strcat(dummy, _("英雄的", "Heroic"));
+ break;
- default:
- likert_color = TERM_VIOLET;
-#ifdef JP
- sprintf(dummy, "ÅÁÀâŪ[%d]", (int)((((x / y) - 17) * 5) / 2));
-#else
- sprintf(dummy, "Legendary[%d]", (int)((((x / y) - 17) * 5) / 2));
-#endif
- return dummy;
+ default:
+ likert_color = TERM_VIOLET;
+ sprintf(dummy2, _("伝説的[%d]", "Legendary[%d]"),
+ (int)((((x / y) - 17) * 5) / 2));
+ strcat(dummy, dummy2);
+
+ break;
+ }
}
+ return dummy;
+
}
-/*
+/*!
+ * @brief プレイヤーステータスの1ページ目各種詳細をまとめて表示するサブルーチン
* Prints ratings on certain abilities
- *
+ * @return なし
+ * @details
* This code is "imitated" elsewhere to "dump" a character sheet.
*/
static void display_player_various(void)
{
- int tmp, damage[2], blows1, blows2, i, basedam;
+ int tmp, damage[2], to_h[2], blows1, blows2, i, basedam;
int xthn, xthb, xfos, xsrh;
int xdis, xdev, xsav, xstl;
- cptr desc;
+ int xdig;
+ concptr desc;
int muta_att = 0;
- u32b flgs[TR_FLAG_SIZE];
+ BIT_FLAGS flgs[TR_FLAG_SIZE];
int shots, shot_frac;
+ bool dokubari;
object_type *o_ptr;
/* If the player is wielding one? */
if (o_ptr->k_idx)
{
- s16b energy_fire = bow_energy(o_ptr->sval);
+ ENERGY energy_fire = bow_energy(o_ptr->sval);
/* Calculate shots per round */
shots = p_ptr->num_fire * 100;
damage[i] = p_ptr->dis_to_d[i] * 100;
if (((p_ptr->pclass == CLASS_MONK) || (p_ptr->pclass == CLASS_FORCETRAINER)) && (empty_hands(TRUE) & EMPTY_HAND_RARM))
{
- int level = p_ptr->lev;
+ PLAYER_LEVEL level = p_ptr->lev;
if (i)
{
damage[i] = 0;
/* Average damage per round */
if (o_ptr->k_idx)
{
- if (object_known_p(o_ptr)) damage[i] += o_ptr->to_d * 100;
+ to_h[i] = 0;
+ dokubari = FALSE;
+
+ if((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_DOKUBARI)) dokubari = TRUE;
+ if (object_is_known(o_ptr))
+ {
+ damage[i] += o_ptr->to_d * 100;
+ to_h[i] += o_ptr->to_h;
+ }
basedam = ((o_ptr->dd + p_ptr->to_dd[i]) * (o_ptr->ds + p_ptr->to_ds[i] + 1)) * 50;
object_flags_known(o_ptr, flgs);
+
+ basedam = calc_expect_crit(o_ptr->weight, to_h[i], basedam, p_ptr->dis_to_h[i], dokubari);
if ((o_ptr->ident & IDENT_MENTAL) && ((o_ptr->name1 == ART_VORPAL_BLADE) || (o_ptr->name1 == ART_CHAINSWORD)))
{
/* vorpal blade */
xstl = p_ptr->skill_stl;
xsrh = p_ptr->skill_srh;
xfos = p_ptr->skill_fos;
+ xdig = p_ptr->skill_dig;
desc = likert(xthn, 12);
desc = likert(xdev, 6);
display_player_one_line(ENTRY_SKILL_DEVICE, desc, likert_color);
+ desc = likert(xdev, 6);
+ display_player_one_line(ENTRY_SKILL_DEVICE, desc, likert_color);
+
+ desc = likert(xdig, 4);
+ display_player_one_line(ENTRY_SKILL_DIG, desc, likert_color);
+
if (!muta_att)
display_player_one_line(ENTRY_BLOWS, format("%d+%d", blows1, blows2), TERM_L_BLUE);
else
-/*
+/*!
+ * @brief プレイヤーの職業、種族に応じた耐性フラグを返す
+ * Prints ratings on certain abilities
+ * @param flgs フラグを保管する配列
+ * @return なし
+ * @details
* Obtain the "flags" for the player as if he was an item
+ * @todo
+ * xtra1.c周りと多重実装になっているのを何とかする
*/
-static void player_flags(u32b flgs[TR_FLAG_SIZE])
+static void player_flags(BIT_FLAGS flgs[TR_FLAG_SIZE])
{
int i;
add_flag(flgs, TR_SPEED);
else
{
- if (!inventory[INVEN_LARM].tval || p_ptr->hidarite)
+ if ((!inventory[INVEN_RARM].k_idx || p_ptr->migite) &&
+ (!inventory[INVEN_LARM].k_idx || p_ptr->hidarite))
add_flag(flgs, TR_SPEED);
if (p_ptr->lev>24)
add_flag(flgs, TR_FREE_ACT);
switch(p_ptr->mimic_form)
{
case MIMIC_DEMON:
- add_flag(flgs, TR_HOLD_LIFE);
+ add_flag(flgs, TR_HOLD_EXP);
add_flag(flgs, TR_RES_CHAOS);
add_flag(flgs, TR_RES_NETHER);
add_flag(flgs, TR_RES_FIRE);
add_flag(flgs, TR_SPEED);
break;
case MIMIC_DEMON_LORD:
- add_flag(flgs, TR_HOLD_LIFE);
+ add_flag(flgs, TR_HOLD_EXP);
add_flag(flgs, TR_RES_CHAOS);
add_flag(flgs, TR_RES_NETHER);
add_flag(flgs, TR_RES_FIRE);
add_flag(flgs, TR_SH_FIRE);
add_flag(flgs, TR_SEE_INVIS);
add_flag(flgs, TR_TELEPATHY);
- add_flag(flgs, TR_FEATHER);
+ add_flag(flgs, TR_LEVITATION);
add_flag(flgs, TR_SPEED);
break;
case MIMIC_VAMPIRE:
- add_flag(flgs, TR_HOLD_LIFE);
+ add_flag(flgs, TR_HOLD_EXP);
add_flag(flgs, TR_RES_DARK);
add_flag(flgs, TR_RES_NETHER);
- if (p_ptr->pclass != CLASS_NINJA) add_flag(flgs, TR_LITE);
+ if (p_ptr->pclass != CLASS_NINJA) add_flag(flgs, TR_LITE_1);
add_flag(flgs, TR_RES_POIS);
add_flag(flgs, TR_RES_COLD);
add_flag(flgs, TR_SEE_INVIS);
add_flag(flgs, TR_RES_LITE);
break;
case RACE_HOBBIT:
- add_flag(flgs, TR_SUST_DEX);
+ add_flag(flgs, TR_HOLD_EXP);
break;
case RACE_GNOME:
add_flag(flgs, TR_FREE_ACT);
if (p_ptr->lev > 14)
{
add_flag(flgs, TR_REGEN);
- if (p_ptr->pclass == CLASS_WARRIOR)
+ if ((p_ptr->pclass == CLASS_WARRIOR) || (p_ptr->pclass == CLASS_BERSERKER))
{
add_flag(flgs, TR_SLOW_DIGEST);
/*
add_flag(flgs, TR_SEE_INVIS);
break;
case RACE_DRACONIAN:
- add_flag(flgs, TR_FEATHER);
+ add_flag(flgs, TR_LEVITATION);
if (p_ptr->lev > 4)
add_flag(flgs, TR_RES_FIRE);
if (p_ptr->lev > 9)
add_flag(flgs, TR_RES_POIS);
add_flag(flgs, TR_SLOW_DIGEST);
if (p_ptr->lev > 34)
- add_flag(flgs, TR_HOLD_LIFE);
+ add_flag(flgs, TR_HOLD_EXP);
break;
case RACE_SKELETON:
add_flag(flgs, TR_SEE_INVIS);
add_flag(flgs, TR_RES_SHARDS);
- add_flag(flgs, TR_HOLD_LIFE);
+ add_flag(flgs, TR_HOLD_EXP);
add_flag(flgs, TR_RES_POIS);
if (p_ptr->lev > 9)
add_flag(flgs, TR_RES_COLD);
break;
case RACE_ZOMBIE:
add_flag(flgs, TR_SEE_INVIS);
- add_flag(flgs, TR_HOLD_LIFE);
+ add_flag(flgs, TR_HOLD_EXP);
add_flag(flgs, TR_RES_NETHER);
add_flag(flgs, TR_RES_POIS);
add_flag(flgs, TR_SLOW_DIGEST);
add_flag(flgs, TR_RES_COLD);
break;
case RACE_VAMPIRE:
- add_flag(flgs, TR_HOLD_LIFE);
+ add_flag(flgs, TR_HOLD_EXP);
add_flag(flgs, TR_RES_DARK);
add_flag(flgs, TR_RES_NETHER);
- if (p_ptr->pclass != CLASS_NINJA) add_flag(flgs, TR_LITE);
+ if (p_ptr->pclass != CLASS_NINJA) add_flag(flgs, TR_LITE_1);
add_flag(flgs, TR_RES_POIS);
add_flag(flgs, TR_RES_COLD);
break;
case RACE_SPECTRE:
- add_flag(flgs, TR_FEATHER);
+ add_flag(flgs, TR_LEVITATION);
add_flag(flgs, TR_FREE_ACT);
add_flag(flgs, TR_RES_COLD);
add_flag(flgs, TR_SEE_INVIS);
- add_flag(flgs, TR_HOLD_LIFE);
+ add_flag(flgs, TR_HOLD_EXP);
add_flag(flgs, TR_RES_NETHER);
add_flag(flgs, TR_RES_POIS);
add_flag(flgs, TR_SLOW_DIGEST);
break;
case RACE_SPRITE:
add_flag(flgs, TR_RES_LITE);
- add_flag(flgs, TR_FEATHER);
+ add_flag(flgs, TR_LEVITATION);
if (p_ptr->lev > 9)
add_flag(flgs, TR_SPEED);
break;
add_flag(flgs, TR_RES_CONF);
break;
case RACE_ANGEL:
- add_flag(flgs, TR_FEATHER);
+ add_flag(flgs, TR_LEVITATION);
add_flag(flgs, TR_SEE_INVIS);
break;
case RACE_DEMON:
add_flag(flgs, TR_RES_FIRE);
add_flag(flgs, TR_RES_NETHER);
- add_flag(flgs, TR_HOLD_LIFE);
+ add_flag(flgs, TR_HOLD_EXP);
if (p_ptr->lev > 9)
add_flag(flgs, TR_SEE_INVIS);
break;
add_flag(flgs, TR_SUST_CON);
break;
case RACE_S_FAIRY:
- add_flag(flgs, TR_FEATHER);
+ add_flag(flgs, TR_LEVITATION);
break;
- case RACE_KUTA:
+ case RACE_KUTAR:
add_flag(flgs, TR_RES_CONF);
break;
case RACE_ANDROID:
add_flag(flgs, TR_FREE_ACT);
add_flag(flgs, TR_RES_POIS);
add_flag(flgs, TR_SLOW_DIGEST);
- add_flag(flgs, TR_HOLD_LIFE);
+ add_flag(flgs, TR_HOLD_EXP);
break;
default:
; /* Do nothing */
if (p_ptr->muta3 & MUT3_FIRE_BODY)
{
add_flag(flgs, TR_SH_FIRE);
- add_flag(flgs, TR_LITE);
+ add_flag(flgs, TR_LITE_1);
}
if (p_ptr->muta3 & MUT3_WINGS)
{
- add_flag(flgs, TR_FEATHER);
+ add_flag(flgs, TR_LEVITATION);
}
if (p_ptr->muta3 & MUT3_FEARLESS)
if (p_ptr->pseikaku == SEIKAKU_SEXY)
add_flag(flgs, TR_AGGRAVATE);
+ if (p_ptr->pseikaku == SEIKAKU_CHARGEMAN)
+ add_flag(flgs, TR_RES_CONF);
if (p_ptr->pseikaku == SEIKAKU_MUNCHKIN)
{
add_flag(flgs, TR_RES_BLIND);
add_flag(flgs, TR_RES_CONF);
- add_flag(flgs, TR_HOLD_LIFE);
- if (p_ptr->pclass != CLASS_NINJA) add_flag(flgs, TR_LITE);
+ add_flag(flgs, TR_HOLD_EXP);
+ if (p_ptr->pclass != CLASS_NINJA) add_flag(flgs, TR_LITE_1);
if (p_ptr->lev > 9)
add_flag(flgs, TR_SPEED);
}
if (p_ptr->special_defense & KAMAE_GENBU)
add_flag(flgs, TR_REFLECT);
if (p_ptr->special_defense & KAMAE_SUZAKU)
- add_flag(flgs, TR_FEATHER);
+ add_flag(flgs, TR_LEVITATION);
if (p_ptr->special_defense & KAMAE_SEIRYU)
{
add_flag(flgs, TR_RES_FIRE);
add_flag(flgs, TR_RES_ACID);
add_flag(flgs, TR_RES_ELEC);
add_flag(flgs, TR_RES_POIS);
- add_flag(flgs, TR_FEATHER);
+ add_flag(flgs, TR_LEVITATION);
add_flag(flgs, TR_SH_FIRE);
add_flag(flgs, TR_SH_ELEC);
add_flag(flgs, TR_SH_COLD);
add_flag(flgs, TR_RES_CHAOS);
add_flag(flgs, TR_RES_DISEN);
add_flag(flgs, TR_REFLECT);
- add_flag(flgs, TR_HOLD_LIFE);
+ add_flag(flgs, TR_HOLD_EXP);
add_flag(flgs, TR_FREE_ACT);
add_flag(flgs, TR_SH_FIRE);
add_flag(flgs, TR_SH_ELEC);
add_flag(flgs, TR_SH_COLD);
- add_flag(flgs, TR_FEATHER);
- add_flag(flgs, TR_LITE);
+ add_flag(flgs, TR_LEVITATION);
+ add_flag(flgs, TR_LITE_1);
add_flag(flgs, TR_SEE_INVIS);
add_flag(flgs, TR_TELEPATHY);
add_flag(flgs, TR_SLOW_DIGEST);
}
}
-
-static void tim_player_flags(u32b flgs[TR_FLAG_SIZE])
+/*!
+ * @brief プレイヤーの一時的魔法効果による耐性を返す
+ * Prints ratings on certain abilities
+ * @param flgs フラグを保管する配列
+ * @return なし
+ * @todo
+ * xtra1.c周りと多重実装になっているのを何とかする
+ */
+static void tim_player_flags(BIT_FLAGS flgs[TR_FLAG_SIZE])
{
int i;
add_flag(flgs, TR_RES_CONF);
add_flag(flgs, TR_REFLECT);
add_flag(flgs, TR_FREE_ACT);
- add_flag(flgs, TR_FEATHER);
+ add_flag(flgs, TR_LEVITATION);
}
if (p_ptr->tim_res_nether)
{
add_flag(flgs, TR_RES_CHAOS);
add_flag(flgs, TR_RES_DISEN);
add_flag(flgs, TR_REFLECT);
- add_flag(flgs, TR_HOLD_LIFE);
+ add_flag(flgs, TR_HOLD_EXP);
add_flag(flgs, TR_FREE_ACT);
add_flag(flgs, TR_SH_FIRE);
add_flag(flgs, TR_SH_ELEC);
add_flag(flgs, TR_SH_COLD);
- add_flag(flgs, TR_FEATHER);
- add_flag(flgs, TR_LITE);
+ add_flag(flgs, TR_LEVITATION);
+ add_flag(flgs, TR_LITE_1);
add_flag(flgs, TR_SEE_INVIS);
add_flag(flgs, TR_TELEPATHY);
add_flag(flgs, TR_SLOW_DIGEST);
add_flag(flgs, TR_SUST_CON);
add_flag(flgs, TR_SUST_CHR);
}
+
+ /* Hex bonuses */
+ if (p_ptr->realm1 == REALM_HEX)
+ {
+ if (hex_spelling(HEX_DEMON_AURA))
+ {
+ add_flag(flgs, TR_SH_FIRE);
+ add_flag(flgs, TR_REGEN);
+ }
+ if (hex_spelling(HEX_ICE_ARMOR)) add_flag(flgs, TR_SH_COLD);
+ if (hex_spelling(HEX_SHOCK_CLOAK)) add_flag(flgs, TR_SH_ELEC);
+ }
}
#define DP_WP 0x08
-/*
+/*!
+ * @brief プレイヤーの装備一覧をシンボルで並べる
* Equippy chars
+ * @param y 表示するコンソールの行
+ * @param x 表示するコンソールの列
+ * @param mode オプション
+ * @return なし
*/
-static void display_player_equippy(int y, int x, u16b mode)
+static void display_player_equippy(TERM_LEN y, TERM_LEN x, BIT_FLAGS16 mode)
{
int i, max_i;
- byte a;
+ TERM_COLOR a;
char c;
object_type *o_ptr;
}
+/*!
+ * @brief プレイヤーの装備一覧シンボルを固定位置に表示する
+ * @return なし
+ */
void print_equippy(void)
{
display_player_equippy(ROW_EQUIPPY, COL_EQUIPPY, 0);
}
-/*
- *
+/*!
+ * @brief プレイヤーの装備による免疫フラグを返す
+ * @param flgs フラグを保管する配列
+ * @return なし
+ * @todo
+ * xtra1.c周りと多重実装になっているのを何とかする
*/
-
-static void known_obj_immunity(u32b flgs[TR_FLAG_SIZE])
+static void known_obj_immunity(BIT_FLAGS flgs[TR_FLAG_SIZE])
{
int i;
}
}
-static void player_immunity(u32b flgs[TR_FLAG_SIZE])
+/*!
+ * @brief プレイヤーの種族による免疫フラグを返す
+ * @param flgs フラグを保管する配列
+ * @return なし
+ * @todo
+ * xtra1.c周りと多重実装になっているのを何とかする
+ */
+static void player_immunity(BIT_FLAGS flgs[TR_FLAG_SIZE])
{
int i;
add_flag(flgs, TR_RES_ACID);
}
-static void tim_player_immunity(u32b flgs[TR_FLAG_SIZE])
+/*!
+ * @brief プレイヤーの一時的魔法効果による免疫フラグを返す
+ * @param flgs フラグを保管する配列
+ * @return なし
+ * @todo
+ * xtra1.c周りと多重実装になっているのを何とかする
+ */
+static void tim_player_immunity(BIT_FLAGS flgs[TR_FLAG_SIZE])
{
int i;
add_flag(flgs, TR_RES_DARK);
}
-static void player_vuln_flags(u32b flgs[TR_FLAG_SIZE])
+/*!
+ * @brief プレイヤーの種族による弱点フラグを返す
+ * @param flgs フラグを保管する配列
+ * @return なし
+ * @todo
+ * xtra1.c周りと多重実装になっているのを何とかする
+ */
+static void player_vuln_flags(BIT_FLAGS flgs[TR_FLAG_SIZE])
{
int i;
* A struct for storing misc. flags
*/
typedef struct {
- u32b player_flags[TR_FLAG_SIZE];
- u32b tim_player_flags[TR_FLAG_SIZE];
- u32b player_imm[TR_FLAG_SIZE];
- u32b tim_player_imm[TR_FLAG_SIZE];
- u32b player_vuln[TR_FLAG_SIZE];
- u32b known_obj_imm[TR_FLAG_SIZE];
+ BIT_FLAGS player_flags[TR_FLAG_SIZE];
+ BIT_FLAGS tim_player_flags[TR_FLAG_SIZE];
+ BIT_FLAGS player_imm[TR_FLAG_SIZE];
+ BIT_FLAGS tim_player_imm[TR_FLAG_SIZE];
+ BIT_FLAGS player_vuln[TR_FLAG_SIZE];
+ BIT_FLAGS known_obj_imm[TR_FLAG_SIZE];
} all_player_flags;
-/*
+/*!
+ * @brief プレイヤーの特性フラグ一種を表示するサブルーチン /
* Helper function, see below
+ * @param row コンソール表示位置の左上行
+ * @param col コンソール表示位置の左上列
+ * @param header コンソール上で表示する特性名
+ * @param flag1 参照する特性ID
+ * @param f プレイヤーの特性情報構造体
+ * @param mode 表示オプション
+ * @return なし
*/
-static void display_flag_aux(int row, int col, cptr header,
+static void display_flag_aux(TERM_LEN row, TERM_LEN col, concptr header,
int flag1, all_player_flags *f, u16b mode)
{
int i;
bool vuln = FALSE;
int max_i;
+ byte header_color = TERM_L_DARK;
+ int header_col = col;
if (have_flag(f->player_vuln, flag1) &&
!(have_flag(f->known_obj_imm, flag1) ||
have_flag(f->tim_player_imm, flag1)))
vuln = TRUE;
- /* Header */
- if (!(mode & DP_IMM)) c_put_str(TERM_WHITE, header, row, col);
-
/* Advance */
col += strlen(header) + 1;
/* Check equipment */
for (i = INVEN_RARM; i < max_i; i++)
{
- u32b flgs[TR_FLAG_SIZE];
+ BIT_FLAGS flgs[TR_FLAG_SIZE];
object_type *o_ptr;
/* Object */
/* Check flags */
if (mode & DP_CURSE)
{
- if ((mode & DP_CURSE) && (o_ptr->curse_flags & (TRC_CURSED | TRC_HEAVY_CURSE)))
+ if (have_flag(flgs, TR_ADD_L_CURSE) || have_flag(flgs, TR_ADD_H_CURSE))
+ {
+ c_put_str(TERM_L_DARK, "+", row, col);
+ header_color = TERM_WHITE;
+ }
+ if (o_ptr->curse_flags & (TRC_CURSED | TRC_HEAVY_CURSE))
+ {
c_put_str(TERM_WHITE, "+", row, col);
- if ((mode & DP_CURSE) && (o_ptr->curse_flags & TRC_PERMA_CURSE))
+ header_color = TERM_WHITE;
+ }
+ if (o_ptr->curse_flags & TRC_PERMA_CURSE)
+ {
c_put_str(TERM_WHITE, "*", row, col);
+ header_color = TERM_WHITE;
+ }
+ }
+ else if (flag1 == TR_LITE_1)
+ {
+ if (have_dark_flag(flgs))
+ {
+ c_put_str(TERM_L_DARK, "+", row, col);
+ header_color = TERM_WHITE;
+ }
+ else if (have_lite_flag(flgs))
+ {
+ c_put_str(TERM_WHITE, "+", row, col);
+ header_color = TERM_WHITE;
+ }
}
else
{
if (have_flag(flgs, flag1))
+ {
c_put_str((byte)(vuln ? TERM_L_RED : TERM_WHITE),
(mode & DP_IMM) ? "*" : "+", row, col);
+ header_color = TERM_WHITE;
+ }
}
/* Advance */
}
/* Assume that player flag is already written */
- if (mode & DP_IMM) return;
+ if (mode & DP_IMM)
+ {
+ if (header_color != TERM_L_DARK)
+ {
+ /* Overwrite Header Color */
+ c_put_str(header_color, header, row, header_col);
+ }
+ return;
+ }
/* Default */
c_put_str((byte)(vuln ? TERM_RED : TERM_SLATE), ".", row, col);
/* Player flags */
- if (have_flag(f->player_flags, flag1)) c_put_str((byte)(vuln ? TERM_L_RED : TERM_WHITE), "+", row, col);
+ if (have_flag(f->player_flags, flag1))
+ {
+ c_put_str((byte)(vuln ? TERM_L_RED : TERM_WHITE), "+", row, col);
+ header_color = TERM_WHITE;
+ }
/* Timed player flags */
- if (have_flag(f->tim_player_flags, flag1)) c_put_str((byte)(vuln ? TERM_ORANGE : TERM_YELLOW), "#", row, col);
+ if (have_flag(f->tim_player_flags, flag1))
+ {
+ c_put_str((byte)(vuln ? TERM_ORANGE : TERM_YELLOW), "#", row, col);
+ header_color = TERM_WHITE;
+ }
/* Immunity */
- if (have_flag(f->tim_player_imm, flag1)) c_put_str(TERM_YELLOW, "*", row, col);
- if (have_flag(f->player_imm, flag1)) c_put_str(TERM_WHITE, "*", row, col);
+ if (have_flag(f->tim_player_imm, flag1))
+ {
+ c_put_str(TERM_YELLOW, "*", row, col);
+ header_color = TERM_WHITE;
+ }
+ if (have_flag(f->player_imm, flag1))
+ {
+ c_put_str(TERM_WHITE, "*", row, col);
+ header_color = TERM_WHITE;
+ }
/* Vulnerability */
if (vuln) c_put_str(TERM_RED, "v", row, col + 1);
+
+ /* Header */
+ c_put_str(header_color, header, row, header_col);
}
-/*
+/*!
+ * @brief プレイヤーの特性フラグ一覧表示1 /
* Special display, part 1
+ * @return なし
*/
static void display_player_flag_info(void)
{
- int row;
- int col;
+ TERM_LEN row;
+ TERM_LEN col;
all_player_flags f;
c_put_str(TERM_WHITE, "abcdefghijkl@", row-1, col+8);
#ifdef JP
-display_flag_aux(row+0, col, "ÂÑ»À :", TR_RES_ACID, &f, 0);
-display_flag_aux(row+0, col, "ÂÑ»À :", TR_IM_ACID, &f, DP_IMM);
-display_flag_aux(row+1, col, "ÂÑÅÅ·â:", TR_RES_ELEC, &f, 0);
-display_flag_aux(row+1, col, "ÂÑÅÅ·â:", TR_IM_ELEC, &f, DP_IMM);
-display_flag_aux(row+2, col, "ÂѲбê:", TR_RES_FIRE, &f, 0);
-display_flag_aux(row+2, col, "ÂѲбê:", TR_IM_FIRE, &f, DP_IMM);
-display_flag_aux(row+3, col, "ÂÑÎ䵤:", TR_RES_COLD, &f, 0);
-display_flag_aux(row+3, col, "ÂÑÎ䵤:", TR_IM_COLD, &f, DP_IMM);
-display_flag_aux(row+4, col, "ÂÑÆÇ :", TR_RES_POIS, &f, 0);
-display_flag_aux(row+5, col, "ÂÑÁ®¸÷:", TR_RES_LITE, &f, 0);
-display_flag_aux(row+6, col, "ÂѰŹõ:", TR_RES_DARK, &f, 0);
-display_flag_aux(row+7, col, "ÂÑÇËÊÒ:", TR_RES_SHARDS, &f, 0);
-display_flag_aux(row+8, col, "ÂÑÌÕÌÜ:", TR_RES_BLIND, &f, 0);
-display_flag_aux(row+9, col, "ÂѺ®Íð:", TR_RES_CONF, &f, 0);
+ display_flag_aux(row+0, col, "耐酸 :", TR_RES_ACID, &f, 0);
+ display_flag_aux(row+0, col, "耐酸 :", TR_IM_ACID, &f, DP_IMM);
+ display_flag_aux(row+1, col, "耐電撃:", TR_RES_ELEC, &f, 0);
+ display_flag_aux(row+1, col, "耐電撃:", TR_IM_ELEC, &f, DP_IMM);
+ display_flag_aux(row+2, col, "耐火炎:", TR_RES_FIRE, &f, 0);
+ display_flag_aux(row+2, col, "耐火炎:", TR_IM_FIRE, &f, DP_IMM);
+ display_flag_aux(row+3, col, "耐冷気:", TR_RES_COLD, &f, 0);
+ display_flag_aux(row+3, col, "耐冷気:", TR_IM_COLD, &f, DP_IMM);
+ display_flag_aux(row+4, col, "耐毒 :", TR_RES_POIS, &f, 0);
+ display_flag_aux(row+5, col, "耐閃光:", TR_RES_LITE, &f, 0);
+ display_flag_aux(row+6, col, "耐暗黒:", TR_RES_DARK, &f, 0);
+ display_flag_aux(row+7, col, "耐破片:", TR_RES_SHARDS, &f, 0);
+ display_flag_aux(row+8, col, "耐盲目:", TR_RES_BLIND, &f, 0);
+ display_flag_aux(row+9, col, "耐混乱:", TR_RES_CONF, &f, 0);
#else
display_flag_aux(row+0, col, "Acid :", TR_RES_ACID, &f, 0);
display_flag_aux(row+0, col, "Acid :", TR_IM_ACID, &f, DP_IMM);
c_put_str(TERM_WHITE, "abcdefghijkl@", row-1, col+8);
#ifdef JP
-display_flag_aux(row+0, col, "Âѹ첻:", TR_RES_SOUND, &f, 0);
-display_flag_aux(row+1, col, "ÂÑÃϹö:", TR_RES_NETHER, &f, 0);
-display_flag_aux(row+2, col, "ÂÑ°øº®:", TR_RES_NEXUS, &f, 0);
-display_flag_aux(row+3, col, "ÂÑ¥«¥ª:", TR_RES_CHAOS, &f, 0);
-display_flag_aux(row+4, col, "ÂÑÎô²½:", TR_RES_DISEN, &f, 0);
-display_flag_aux(row+5, col, "ÂѶ²ÉÝ:", TR_RES_FEAR, &f, 0);
-display_flag_aux(row+6, col, "È¿¼Í :", TR_REFLECT, &f, 0);
-display_flag_aux(row+7, col, "²Ð±ê¥ª:", TR_SH_FIRE, &f, 0);
-display_flag_aux(row+8, col, "Åŵ¤¥ª:", TR_SH_ELEC, &f, 0);
-display_flag_aux(row+9, col, "Î䵤¥ª:", TR_SH_COLD, &f, 0);
+ display_flag_aux(row+0, col, "耐轟音:", TR_RES_SOUND, &f, 0);
+ display_flag_aux(row+1, col, "耐地獄:", TR_RES_NETHER, &f, 0);
+ display_flag_aux(row+2, col, "耐因混:", TR_RES_NEXUS, &f, 0);
+ display_flag_aux(row+3, col, "è\80\90ã\82«ã\82ª:", TR_RES_CHAOS, &f, 0);
+ display_flag_aux(row+4, col, "耐劣化:", TR_RES_DISEN, &f, 0);
+ display_flag_aux(row+5, col, "耐恐怖:", TR_RES_FEAR, &f, 0);
+ display_flag_aux(row+6, col, "反射 :", TR_REFLECT, &f, 0);
+ display_flag_aux(row+7, col, "ç\81«ç\82\8eã\82ª:", TR_SH_FIRE, &f, 0);
+ display_flag_aux(row+8, col, "é\9b»æ°\97ã\82ª:", TR_SH_ELEC, &f, 0);
+ display_flag_aux(row+9, col, "å\86·æ°\97ã\82ª:", TR_SH_COLD, &f, 0);
#else
display_flag_aux(row+0, col, "Sound :", TR_RES_SOUND, &f, 0);
display_flag_aux(row+1, col, "Nether:", TR_RES_NETHER, &f, 0);
c_put_str(TERM_WHITE, "abcdefghijkl@", row-1, col+12);
#ifdef JP
-display_flag_aux(row+0, col, "²Ã® :", TR_SPEED, &f, 0);
-display_flag_aux(row+1, col, "ÂÑËãáã :", TR_FREE_ACT, &f, 0);
-display_flag_aux(row+2, col, "Æ©ÌÀÂλëǧ:", TR_SEE_INVIS, &f, 0);
-display_flag_aux(row+3, col, "·Ð¸³ÃÍÊÝ»ý:", TR_HOLD_LIFE, &f, 0);
-display_flag_aux(row+4, col, "·Ù¹ð :", TR_WARNING, &f, 0);
-display_flag_aux(row+5, col, "Ãپò½ :", TR_SLOW_DIGEST, &f, 0);
-display_flag_aux(row+6, col, "µÞ²óÉü :", TR_REGEN, &f, 0);
-display_flag_aux(row+7, col, "ÉâÍ· :", TR_FEATHER, &f, 0);
-display_flag_aux(row+8, col, "±Ê±ó¸÷¸» :", TR_LITE, &f, 0);
-display_flag_aux(row+9, col, "¼ö¤¤ :", 0, &f, DP_CURSE);
+ display_flag_aux(row+0, col, "加速 :", TR_SPEED, &f, 0);
+ display_flag_aux(row+1, col, "耐麻痺 :", TR_FREE_ACT, &f, 0);
+ display_flag_aux(row+2, col, "透明体視認:", TR_SEE_INVIS, &f, 0);
+ display_flag_aux(row+3, col, "経験値保持:", TR_HOLD_EXP, &f, 0);
+ display_flag_aux(row+4, col, "警告 :", TR_WARNING, &f, 0);
+ display_flag_aux(row+5, col, "遅消化 :", TR_SLOW_DIGEST, &f, 0);
+ display_flag_aux(row+6, col, "急回復 :", TR_REGEN, &f, 0);
+ display_flag_aux(row+7, col, "浮遊 :", TR_LEVITATION, &f, 0);
+ display_flag_aux(row+8, col, "永遠光源 :", TR_LITE_1, &f, 0);
+ display_flag_aux(row+9, col, "呪い :", 0, &f, DP_CURSE);
#else
display_flag_aux(row+0, col, "Speed :", TR_SPEED, &f, 0);
display_flag_aux(row+1, col, "FreeAction:", TR_FREE_ACT, &f, 0);
display_flag_aux(row+2, col, "SeeInvisi.:", TR_SEE_INVIS, &f, 0);
- display_flag_aux(row+3, col, "Hold Life :", TR_HOLD_LIFE, &f, 0);
+ display_flag_aux(row+3, col, "Hold Exp :", TR_HOLD_EXP, &f, 0);
display_flag_aux(row+4, col, "Warning :", TR_WARNING, &f, 0);
display_flag_aux(row+5, col, "SlowDigest:", TR_SLOW_DIGEST, &f, 0);
display_flag_aux(row+6, col, "Regene. :", TR_REGEN, &f, 0);
- display_flag_aux(row+7, col, "Levitation:", TR_FEATHER, &f, 0);
- display_flag_aux(row+8, col, "Perm Lite :", TR_LITE, &f, 0);
+ display_flag_aux(row+7, col, "Levitation:", TR_LEVITATION, &f, 0);
+ display_flag_aux(row+8, col, "Perm Lite :", TR_LITE_1, &f, 0);
display_flag_aux(row+9, col, "Cursed :", 0, &f, DP_CURSE);
#endif
}
-/*
+/*!
+ * @brief プレイヤーの特性フラグ一覧表示2 /
* Special display, part 2
+ * @return なし
*/
static void display_player_other_flag_info(void)
{
- int row;
- int col;
+ TERM_LEN row;
+ TERM_LEN col;
all_player_flags f;
c_put_str(TERM_WHITE, "ab@", row-1, col+12);
#ifdef JP
- display_flag_aux(row+ 0, col, "¼Ù° ÇÜÂÇ :", TR_SLAY_EVIL, &f, DP_WP);
- display_flag_aux(row+ 0, col, "¼Ù° ÇÜÂÇ :", TR_KILL_EVIL, &f, (DP_WP|DP_IMM));
- display_flag_aux(row+ 1, col, "ÉÔ»à ÇÜÂÇ :", TR_SLAY_UNDEAD, &f, DP_WP);
- display_flag_aux(row+ 1, col, "ÉÔ»à ÇÜÂÇ :", TR_KILL_UNDEAD, &f, (DP_WP|DP_IMM));
- display_flag_aux(row+ 2, col, "°Ëâ ÇÜÂÇ :", TR_SLAY_DEMON, &f, DP_WP);
- display_flag_aux(row+ 2, col, "°Ëâ ÇÜÂÇ :", TR_KILL_DEMON, &f, (DP_WP|DP_IMM));
- display_flag_aux(row+ 3, col, "ζ ÇÜÂÇ :", TR_SLAY_DRAGON, &f, DP_WP);
- display_flag_aux(row+ 3, col, "ζ ÇÜÂÇ :", TR_KILL_DRAGON, &f, (DP_WP|DP_IMM));
- display_flag_aux(row+ 4, col, "¿Í´Ö ÇÜÂÇ :", TR_SLAY_HUMAN, &f, DP_WP);
- display_flag_aux(row+ 4, col, "¿Í´Ö ÇÜÂÇ :", TR_KILL_HUMAN, &f, (DP_WP|DP_IMM));
- display_flag_aux(row+ 5, col, "ưʪ ÇÜÂÇ :", TR_SLAY_ANIMAL, &f, DP_WP);
- display_flag_aux(row+ 5, col, "ưʪ ÇÜÂÇ :", TR_KILL_ANIMAL, &f, (DP_WP|DP_IMM));
- display_flag_aux(row+ 6, col, "¥ª¡¼¥¯ÇÜÂÇ:", TR_SLAY_ORC, &f, DP_WP);
- display_flag_aux(row+ 6, col, "¥ª¡¼¥¯ÇÜÂÇ:", TR_KILL_ORC, &f, (DP_WP|DP_IMM));
- display_flag_aux(row+ 7, col, "¥È¥í¥ëÇÜÂÇ:", TR_SLAY_TROLL, &f, DP_WP);
- display_flag_aux(row+ 7, col, "¥È¥í¥ëÇÜÂÇ:", TR_KILL_TROLL, &f, (DP_WP|DP_IMM));
- display_flag_aux(row+ 8, col, "µð¿Í ÇÜÂÇ :", TR_SLAY_GIANT, &f, DP_WP);
- display_flag_aux(row+ 8, col, "µð¿Í ÇÜÂÇ :", TR_KILL_GIANT, &f, (DP_WP|DP_IMM));
- display_flag_aux(row+ 9, col, "Íϲò :", TR_BRAND_ACID, &f, DP_WP);
- display_flag_aux(row+10, col, "ÅÅ·â :", TR_BRAND_ELEC, &f, DP_WP);
- display_flag_aux(row+11, col, "¾Æ´þ :", TR_BRAND_FIRE, &f, DP_WP);
- display_flag_aux(row+12, col, "Åà·ë :", TR_BRAND_COLD, &f, DP_WP);
- display_flag_aux(row+13, col, "ÆÇ»¦ :", TR_BRAND_POIS, &f, DP_WP);
- display_flag_aux(row+14, col, "ÀÚ¤ìÌ£ :", TR_VORPAL, &f, DP_WP);
- display_flag_aux(row+15, col, "ÃÏ¿Ì :", TR_IMPACT, &f, DP_WP);
- display_flag_aux(row+16, col, "µÛ·ì :", TR_VAMPIRIC, &f, DP_WP);
- display_flag_aux(row+17, col, "¥«¥ª¥¹¸ú²Ì:", TR_CHAOTIC, &f, DP_WP);
- display_flag_aux(row+18, col, "ÍýÎÏ :", TR_FORCE_WEAPON, &f, DP_WP);
+ display_flag_aux(row+ 0, col, "邪悪 倍打 :", TR_SLAY_EVIL, &f, DP_WP);
+ display_flag_aux(row+ 0, col, "邪悪 倍打 :", TR_KILL_EVIL, &f, (DP_WP|DP_IMM));
+ display_flag_aux(row+ 1, col, "不死 倍打 :", TR_SLAY_UNDEAD, &f, DP_WP);
+ display_flag_aux(row+ 1, col, "不死 倍打 :", TR_KILL_UNDEAD, &f, (DP_WP|DP_IMM));
+ display_flag_aux(row+ 2, col, "悪魔 倍打 :", TR_SLAY_DEMON, &f, DP_WP);
+ display_flag_aux(row+ 2, col, "悪魔 倍打 :", TR_KILL_DEMON, &f, (DP_WP|DP_IMM));
+ display_flag_aux(row+ 3, col, "龍 倍打 :", TR_SLAY_DRAGON, &f, DP_WP);
+ display_flag_aux(row+ 3, col, "龍 倍打 :", TR_KILL_DRAGON, &f, (DP_WP|DP_IMM));
+ display_flag_aux(row+ 4, col, "人間 倍打 :", TR_SLAY_HUMAN, &f, DP_WP);
+ display_flag_aux(row+ 4, col, "人間 倍打 :", TR_KILL_HUMAN, &f, (DP_WP|DP_IMM));
+ display_flag_aux(row+ 5, col, "動物 倍打 :", TR_SLAY_ANIMAL, &f, DP_WP);
+ display_flag_aux(row+ 5, col, "動物 倍打 :", TR_KILL_ANIMAL, &f, (DP_WP|DP_IMM));
+ display_flag_aux(row+ 6, col, "オーク倍打:", TR_SLAY_ORC, &f, DP_WP);
+ display_flag_aux(row+ 6, col, "オーク倍打:", TR_KILL_ORC, &f, (DP_WP|DP_IMM));
+ display_flag_aux(row+ 7, col, "トロル倍打:", TR_SLAY_TROLL, &f, DP_WP);
+ display_flag_aux(row+ 7, col, "トロル倍打:", TR_KILL_TROLL, &f, (DP_WP|DP_IMM));
+ display_flag_aux(row+ 8, col, "巨人 倍打 :", TR_SLAY_GIANT, &f, DP_WP);
+ display_flag_aux(row+ 8, col, "巨人 倍打 :", TR_KILL_GIANT, &f, (DP_WP|DP_IMM));
+ display_flag_aux(row+ 9, col, "溶解 :", TR_BRAND_ACID, &f, DP_WP);
+ display_flag_aux(row+10, col, "電撃 :", TR_BRAND_ELEC, &f, DP_WP);
+ display_flag_aux(row+11, col, "焼棄 :", TR_BRAND_FIRE, &f, DP_WP);
+ display_flag_aux(row+12, col, "凍結 :", TR_BRAND_COLD, &f, DP_WP);
+ display_flag_aux(row+13, col, "毒殺 :", TR_BRAND_POIS, &f, DP_WP);
+ display_flag_aux(row+14, col, "切れ味 :", TR_VORPAL, &f, DP_WP);
+ display_flag_aux(row+15, col, "地震 :", TR_IMPACT, &f, DP_WP);
+ display_flag_aux(row+16, col, "吸血 :", TR_VAMPIRIC, &f, DP_WP);
+ display_flag_aux(row+17, col, "カオス効果:", TR_CHAOTIC, &f, DP_WP);
+ display_flag_aux(row+18, col, "理力 :", TR_FORCE_WEAPON, &f, DP_WP);
#else
display_flag_aux(row+ 0, col, "Slay Evil :", TR_SLAY_EVIL, &f, DP_WP);
display_flag_aux(row+ 0, col, "Slay Evil :", TR_KILL_EVIL, &f, (DP_WP|DP_IMM));
row = 3;
col = col + 12 + 7;
- display_player_equippy(row-2, col+12, 0);
- c_put_str(TERM_WHITE, "abcdefghijkl@", row-1, col+12);
-
-#ifdef JP
- display_flag_aux(row+ 0, col, "¥Æ¥ì¥Ñ¥·¡¼:", TR_TELEPATHY, &f, 0);
- display_flag_aux(row+ 1, col, "¼Ù°ESP :", TR_ESP_EVIL, &f, 0);
- display_flag_aux(row+ 2, col, "̵À¸ÊªESP :", TR_ESP_NONLIVING, &f, 0);
- display_flag_aux(row+ 3, col, "Á±ÎÉESP :", TR_ESP_GOOD, &f, 0);
- display_flag_aux(row+ 4, col, "ÉÔ»àESP :", TR_ESP_UNDEAD, &f, 0);
- display_flag_aux(row+ 5, col, "°ËâESP :", TR_ESP_DEMON, &f, 0);
- display_flag_aux(row+ 6, col, "ζESP :", TR_ESP_DRAGON, &f, 0);
- display_flag_aux(row+ 7, col, "¿Í´ÖESP :", TR_ESP_HUMAN, &f, 0);
- display_flag_aux(row+ 8, col, "ưʪESP :", TR_ESP_ANIMAL, &f, 0);
- display_flag_aux(row+ 9, col, "¥ª¡¼¥¯ESP :", TR_ESP_ORC, &f, 0);
- display_flag_aux(row+10, col, "¥È¥í¥ëESP :", TR_ESP_TROLL, &f, 0);
- display_flag_aux(row+11, col, "µð¿ÍESP :", TR_ESP_GIANT, &f, 0);
-
- display_flag_aux(row+13, col, "ÏÓÎÏ°Ý»ý :", TR_SUST_STR, &f, 0);
- display_flag_aux(row+14, col, "ÃÎÎÏ°Ý»ý :", TR_SUST_INT, &f, 0);
- display_flag_aux(row+15, col, "¸¤µ°Ý»ý :", TR_SUST_WIS, &f, 0);
- display_flag_aux(row+16, col, "´ïÍÑ°Ý»ý :", TR_SUST_DEX, &f, 0);
- display_flag_aux(row+17, col, "Âѵװݻý :", TR_SUST_CON, &f, 0);
- display_flag_aux(row+18, col, "Ì¥ÎÏ°Ý»ý :", TR_SUST_CHR, &f, 0);
-#else
- display_flag_aux(row+ 0, col, "Telepathy :", TR_TELEPATHY, &f, 0);
- display_flag_aux(row+ 1, col, "ESP Evil :", TR_ESP_EVIL, &f, 0);
- display_flag_aux(row+ 2, col, "ESP Noliv.:", TR_ESP_NONLIVING, &f, 0);
- display_flag_aux(row+ 3, col, "ESP Good :", TR_ESP_GOOD, &f, 0);
- display_flag_aux(row+ 4, col, "ESP Undead:", TR_ESP_UNDEAD, &f, 0);
- display_flag_aux(row+ 5, col, "ESP Demon :", TR_ESP_DEMON, &f, 0);
- display_flag_aux(row+ 6, col, "ESP Dragon:", TR_ESP_DRAGON, &f, 0);
- display_flag_aux(row+ 7, col, "ESP Human :", TR_ESP_HUMAN, &f, 0);
- display_flag_aux(row+ 8, col, "ESP Animal:", TR_ESP_ANIMAL, &f, 0);
- display_flag_aux(row+ 9, col, "ESP Orc :", TR_ESP_ORC, &f, 0);
- display_flag_aux(row+10, col, "ESP Troll :", TR_ESP_TROLL, &f, 0);
- display_flag_aux(row+11, col, "ESP Giant :", TR_ESP_GIANT, &f, 0);
-
- display_flag_aux(row+13, col, "Sust Str :", TR_SUST_STR, &f, 0);
- display_flag_aux(row+14, col, "Sust Int :", TR_SUST_INT, &f, 0);
- display_flag_aux(row+15, col, "Sust Wis :", TR_SUST_WIS, &f, 0);
- display_flag_aux(row+16, col, "Sust Dex :", TR_SUST_DEX, &f, 0);
- display_flag_aux(row+17, col, "Sust Con :", TR_SUST_CON, &f, 0);
- display_flag_aux(row+18, col, "Sust Chr :", TR_SUST_CHR, &f, 0);
+ display_player_equippy(row-2, col+13, 0);
+ c_put_str(TERM_WHITE, "abcdefghijkl@", row-1, col+13);
+
+#ifdef JP
+ display_flag_aux(row+ 0, col, "テレパシー :", TR_TELEPATHY, &f, 0);
+ display_flag_aux(row+ 1, col, "邪悪ESP :", TR_ESP_EVIL, &f, 0);
+ display_flag_aux(row+ 2, col, "無生物ESP :", TR_ESP_NONLIVING, &f, 0);
+ display_flag_aux(row+ 3, col, "善良ESP :", TR_ESP_GOOD, &f, 0);
+ display_flag_aux(row+ 4, col, "不死ESP :", TR_ESP_UNDEAD, &f, 0);
+ display_flag_aux(row+ 5, col, "悪魔ESP :", TR_ESP_DEMON, &f, 0);
+ display_flag_aux(row+ 6, col, "龍ESP :", TR_ESP_DRAGON, &f, 0);
+ display_flag_aux(row+ 7, col, "人間ESP :", TR_ESP_HUMAN, &f, 0);
+ display_flag_aux(row+ 8, col, "動物ESP :", TR_ESP_ANIMAL, &f, 0);
+ display_flag_aux(row+ 9, col, "オークESP :", TR_ESP_ORC, &f, 0);
+ display_flag_aux(row+10, col, "トロルESP :", TR_ESP_TROLL, &f, 0);
+ display_flag_aux(row+11, col, "巨人ESP :", TR_ESP_GIANT, &f, 0);
+ display_flag_aux(row+12, col, "ユニークESP:", TR_ESP_UNIQUE, &f, 0);
+ display_flag_aux(row+13, col, "腕力維持 :", TR_SUST_STR, &f, 0);
+ display_flag_aux(row+14, col, "知力維持 :", TR_SUST_INT, &f, 0);
+ display_flag_aux(row+15, col, "賢さ維持 :", TR_SUST_WIS, &f, 0);
+ display_flag_aux(row+16, col, "器用維持 :", TR_SUST_DEX, &f, 0);
+ display_flag_aux(row+17, col, "耐久維持 :", TR_SUST_CON, &f, 0);
+ display_flag_aux(row+18, col, "魅力維持 :", TR_SUST_CHR, &f, 0);
+#else
+ display_flag_aux(row+ 0, col, "Telepathy :", TR_TELEPATHY, &f, 0);
+ display_flag_aux(row+ 1, col, "ESP Evil :", TR_ESP_EVIL, &f, 0);
+ display_flag_aux(row+ 2, col, "ESP Noliv. :", TR_ESP_NONLIVING, &f, 0);
+ display_flag_aux(row+ 3, col, "ESP Good :", TR_ESP_GOOD, &f, 0);
+ display_flag_aux(row+ 4, col, "ESP Undead :", TR_ESP_UNDEAD, &f, 0);
+ display_flag_aux(row+ 5, col, "ESP Demon :", TR_ESP_DEMON, &f, 0);
+ display_flag_aux(row+ 6, col, "ESP Dragon :", TR_ESP_DRAGON, &f, 0);
+ display_flag_aux(row+ 7, col, "ESP Human :", TR_ESP_HUMAN, &f, 0);
+ display_flag_aux(row+ 8, col, "ESP Animal :", TR_ESP_ANIMAL, &f, 0);
+ display_flag_aux(row+ 9, col, "ESP Orc :", TR_ESP_ORC, &f, 0);
+ display_flag_aux(row+10, col, "ESP Troll :", TR_ESP_TROLL, &f, 0);
+ display_flag_aux(row+11, col, "ESP Giant :", TR_ESP_GIANT, &f, 0);
+ display_flag_aux(row+12, col, "ESP Unique :", TR_ESP_UNIQUE, &f, 0);
+ display_flag_aux(row+13, col, "Sust Str :", TR_SUST_STR, &f, 0);
+ display_flag_aux(row+14, col, "Sust Int :", TR_SUST_INT, &f, 0);
+ display_flag_aux(row+15, col, "Sust Wis :", TR_SUST_WIS, &f, 0);
+ display_flag_aux(row+16, col, "Sust Dex :", TR_SUST_DEX, &f, 0);
+ display_flag_aux(row+17, col, "Sust Con :", TR_SUST_CON, &f, 0);
+ display_flag_aux(row+18, col, "Sust Chr :", TR_SUST_CHR, &f, 0);
#endif
c_put_str(TERM_WHITE, "abcdefghijkl@", row-1, col+14);
#ifdef JP
- display_flag_aux(row+ 0, col, "Äɲù¶·â :", TR_BLOWS, &f, 0);
- display_flag_aux(row+ 1, col, "ºÎ·¡ :", TR_TUNNEL, &f, 0);
- display_flag_aux(row+ 2, col, "ÀÖ³°Àþ»ëÎÏ :", TR_INFRA, &f, 0);
- display_flag_aux(row+ 3, col, "ËâË¡Æ»¶ñ»ÙÇÛ:", TR_MAGIC_MASTERY, &f, 0);
- display_flag_aux(row+ 4, col, "±£Ì© :", TR_STEALTH, &f, 0);
- display_flag_aux(row+ 5, col, "õº÷ :", TR_SEARCH, &f, 0);
-
- display_flag_aux(row+ 7, col, "¾èÇÏ :", TR_RIDING, &f, 0);
- display_flag_aux(row+ 8, col, "ÅêÚ³ :", TR_THROW, &f, 0);
- display_flag_aux(row+ 9, col, "½ËÊ¡ :", TR_BLESSED, &f, 0);
- display_flag_aux(row+10, col, "È¿¥Æ¥ì¥Ý¡¼¥È:", TR_NO_TELE, &f, 0);
- display_flag_aux(row+11, col, "È¿ËâË¡ :", TR_NO_MAGIC, &f, 0);
- display_flag_aux(row+12, col, "¾ÃÈñËâÎϸº¾¯:", TR_DEC_MANA, &f, 0);
-
- display_flag_aux(row+14, col, "·Ð¸³Ã͸º¾¯ :", TR_DRAIN_EXP, &f, 0);
- display_flag_aux(row+15, col, "Íð¥Æ¥ì¥Ý¡¼¥È:", TR_TELEPORT, &f, 0);
- display_flag_aux(row+16, col, "È¿´¶ :", TR_AGGRAVATE, &f, 0);
- display_flag_aux(row+17, col, "ÂÀ¸Å¤Î±åÇ° :", TR_TY_CURSE, &f, 0);
+ display_flag_aux(row+ 0, col, "追加攻撃 :", TR_BLOWS, &f, 0);
+ display_flag_aux(row+ 1, col, "採掘 :", TR_TUNNEL, &f, 0);
+ display_flag_aux(row+ 2, col, "赤外線視力 :", TR_INFRA, &f, 0);
+ display_flag_aux(row+ 3, col, "魔法道具支配:", TR_MAGIC_MASTERY, &f, 0);
+ display_flag_aux(row+ 4, col, "隠密 :", TR_STEALTH, &f, 0);
+ display_flag_aux(row+ 5, col, "探索 :", TR_SEARCH, &f, 0);
+
+ display_flag_aux(row+ 7, col, "乗馬 :", TR_RIDING, &f, 0);
+ display_flag_aux(row+ 8, col, "投擲 :", TR_THROW, &f, 0);
+ display_flag_aux(row+ 9, col, "祝福 :", TR_BLESSED, &f, 0);
+ display_flag_aux(row+10, col, "反テレポート:", TR_NO_TELE, &f, 0);
+ display_flag_aux(row+11, col, "反魔法 :", TR_NO_MAGIC, &f, 0);
+ display_flag_aux(row+12, col, "消費魔力減少:", TR_DEC_MANA, &f, 0);
+
+ display_flag_aux(row+14, col, "経験値減少 :", TR_DRAIN_EXP, &f, 0);
+ display_flag_aux(row+15, col, "乱テレポート:", TR_TELEPORT, &f, 0);
+ display_flag_aux(row+16, col, "反感 :", TR_AGGRAVATE, &f, 0);
+ display_flag_aux(row+17, col, "太古の怨念 :", TR_TY_CURSE, &f, 0);
#else
display_flag_aux(row+ 0, col, "Add Blows :", TR_BLOWS, &f, 0);
display_flag_aux(row+ 1, col, "Add Tunnel :", TR_TUNNEL, &f, 0);
}
-/*
+/*!
+ * @brief プレイヤーの特性フラグ一覧表示2a /
* Special display, part 2a
+ * @return なし
*/
static void display_player_misc_info(void)
{
/* Display basics */
#ifdef JP
-put_str("̾Á° :", 1, 26);
-put_str("ÀÊÌ :", 3, 1);
-put_str("¼ï² :", 4, 1);
-put_str("¿¦¶È :", 5, 1);
+put_str("名前 :", 1, 26);
+put_str("性別 :", 3, 1);
+put_str("種族 :", 4, 1);
+put_str("職業 :", 5, 1);
#else
put_str("Name :", 1, 26);
put_str("Sex :", 3, 1);
strcpy(tmp,ap_ptr->title);
#ifdef JP
if(ap_ptr->no == 1)
- strcat(tmp,"¤Î");
+ strcat(tmp,"の");
#else
strcat(tmp," ");
#endif
- strcat(tmp,player_name);
+ strcat(tmp,p_ptr->name);
c_put_str(TERM_L_BLUE, tmp, 1, 34);
c_put_str(TERM_L_BLUE, sp_ptr->title, 3, 9);
/* Display extras */
#ifdef JP
-put_str("¥ì¥Ù¥ë:", 6, 1);
-put_str("£È£Ð :", 7, 1);
-put_str("£Í£Ð :", 8, 1);
+put_str("レベル:", 6, 1);
+put_str("HP :", 7, 1);
+put_str("MP :", 8, 1);
#else
put_str("Level :", 6, 1);
put_str("Hits :", 7, 1);
}
-/*
+/*!
+ * @brief プレイヤーの特性フラグ一覧表示2b /
* Special display, part 2b
- *
+ * @return なし
+ * @details
+ * <pre>
* How to print out the modifications and sustains.
* Positive mods with no sustain will be light green.
* Positive mods with a sustain will be dark green.
* Negative mods (from a curse) will be red.
* Huge mods (>9), like from MICoMorgoth, will be a '*'
* No mod, no sustain, will be a slate '.'
+ * </pre>
*/
static void display_player_stat_info(void)
{
int row, col;
object_type *o_ptr;
- u32b flgs[TR_FLAG_SIZE];
+ BIT_FLAGS flgs[TR_FLAG_SIZE];
byte a;
char c;
row = 3;
/* Print out the labels for the columns */
-#ifdef JP
-c_put_str(TERM_WHITE, "ǽÎÏ", row, stat_col+1);
-c_put_str(TERM_BLUE, " ´ðËÜ", row, stat_col+7);
-c_put_str(TERM_L_BLUE, " ¼ï ¿¦ À Áõ ", row, stat_col+13);
-c_put_str(TERM_L_GREEN, "¹ç·×", row, stat_col+28);
-c_put_str(TERM_YELLOW, "¸½ºß", row, stat_col+35);
-#else
- c_put_str(TERM_WHITE, "Stat", row, stat_col+1);
- c_put_str(TERM_BLUE, " Base", row, stat_col+7);
- c_put_str(TERM_L_BLUE, "RacClaPerMod", row, stat_col+13);
- c_put_str(TERM_L_GREEN, "Actual", row, stat_col+26);
- c_put_str(TERM_YELLOW, "Current", row, stat_col+32);
-#endif
-
+ c_put_str(TERM_WHITE, _("能力", "Stat"), row, stat_col+1);
+ c_put_str(TERM_BLUE, _(" 基本", " Base"), row, stat_col+7);
+ c_put_str(TERM_L_BLUE, _(" 種 職 性 装 ", "RacClaPerMod"), row, stat_col+13);
+ c_put_str(TERM_L_GREEN, _("合計", "Actual"), row, stat_col+28);
+ c_put_str(TERM_YELLOW, _("現在", "Current"), row, stat_col+35);
/* Display the stats */
- for (i = 0; i < 6; i++)
+ for (i = 0; i < A_MAX; i++)
{
int r_adj;
cnv_stat(p_ptr->stat_max[i], buf);
if (p_ptr->stat_max[i] == p_ptr->stat_max_max[i])
{
-#ifdef JP
- c_put_str(TERM_WHITE, "!", row + i+1, stat_col + 6);
-#else
- c_put_str(TERM_WHITE, "!", row + i+1, stat_col + 4);
-#endif
+ c_put_str(TERM_WHITE, "!", row + i+1, _(stat_col + 6, stat_col + 4));
}
c_put_str(TERM_BLUE, buf, row + i+1, stat_col + 13 - strlen(buf));
/* Header and Footer */
c_put_str(TERM_WHITE, "abcdefghijkl@", row, col);
-#ifdef JP
-c_put_str(TERM_L_GREEN, "ǽÎϽ¤Àµ", row - 1, col);
-#else
- c_put_str(TERM_L_GREEN, "Modification", row - 1, col);
-#endif
-
+ c_put_str(TERM_L_GREEN, _("能力修正", "Modification"), row - 1, col);
/* Process equipment */
for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
{
- /* Access object */
o_ptr = &inventory[i];
/* Acquire "known" flags */
object_flags_known(o_ptr, flgs);
/* Initialize color based of sign of pval. */
- for (stat = 0; stat < 6; stat++)
+ for (stat = 0; stat < A_MAX; stat++)
{
/* Default */
a = TERM_SLATE;
player_flags(flgs);
/* Check stats */
- for (stat = 0; stat < 6; stat++)
+ for (stat = 0; stat < A_MAX; stat++)
{
/* Default */
a = TERM_SLATE;
}
-/*
+/*!
+ * @brief プレイヤーのステータス表示メイン処理
* Display the character on the screen (various modes)
- *
+ * @param mode 表示モードID
+ * @return なし
+ * @details
+ * <pre>
* The top one and bottom two lines are left blank.
- *
* Mode 0 = standard display with skills
* Mode 1 = standard display with history
* Mode 2 = summary of various things
* Mode 3 = summary of various things (part 2)
* Mode 4 = mutations
+ * </pre>
*/
void display_player(int mode)
{
int i;
+ char buf[80];
+ char tmp[64];
- char buf[80];
- char tmp[64];
-
-
- /* XXX XXX XXX */
if ((p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3) && display_mutations)
mode = (mode % 5);
else
{
/* Name, Sex, Race, Class */
#ifdef JP
- sprintf(tmp, "%s%s%s", ap_ptr->title, ap_ptr->no == 1 ? "¤Î":"", player_name);
+ sprintf(tmp, "%s%s%s", ap_ptr->title, ap_ptr->no == 1 ? "の":"", p_ptr->name);
#else
- sprintf(tmp, "%s %s", ap_ptr->title, player_name);
+ sprintf(tmp, "%s %s", ap_ptr->title, p_ptr->name);
#endif
display_player_one_line(ENTRY_NAME, tmp, TERM_L_BLUE);
display_player_one_line(ENTRY_PATRON, chaos_patrons[p_ptr->chaos_patron], TERM_L_BLUE);
/* Age, Height, Weight, Social */
- /* ¿ÈĹ¤Ï¥»¥ó¥Á¥á¡¼¥È¥ë¤Ë¡¢ÂνŤϥ¥í¥°¥é¥à¤ËÊѹ¹¤·¤Æ¤¢¤ê¤Þ¤¹ */
+ /* 身長はセンチメートルに、体重はキログラムに変更してあります */
#ifdef JP
- display_player_one_line(ENTRY_AGE, format("%dºÍ" ,(int)p_ptr->age), TERM_L_BLUE);
+ display_player_one_line(ENTRY_AGE, format("%d才" ,(int)p_ptr->age), TERM_L_BLUE);
display_player_one_line(ENTRY_HEIGHT, format("%dcm" ,(int)((p_ptr->ht*254)/100)), TERM_L_BLUE);
display_player_one_line(ENTRY_WEIGHT, format("%dkg" ,(int)((p_ptr->wt*4536)/10000)), TERM_L_BLUE);
display_player_one_line(ENTRY_SOCIAL, format("%d " ,(int)p_ptr->sc), TERM_L_BLUE);
/* Display the stats */
- for (i = 0; i < 6; i++)
+ for (i = 0; i < A_MAX; i++)
{
/* Special treatment of "injured" stats */
if (p_ptr->stat_cur[i] < p_ptr->stat_max[i])
if (p_ptr->stat_max[i] == p_ptr->stat_max_max[i])
{
-#ifdef JP
- c_put_str(TERM_WHITE, "!", 3 + i, 58);
-#else
- c_put_str(TERM_WHITE, "!", 3 + i, 58-2);
-#endif
+ c_put_str(TERM_WHITE, "!", 3 + i, _(58, 58-2));
}
}
if (mode == 1)
{
char statmsg[1000];
-
-#ifdef JP
- put_str("(¥¥ã¥é¥¯¥¿¡¼¤ÎÀ¸¤¤Î©¤Á)", 11, 25);
-#else
- put_str("(Character Background)", 11, 25);
-#endif
+ put_str(_("(キャラクターの生い立ち)", "(Character Background)"), 11, 25);
for (i = 0; i < 4; i++)
{
*statmsg = '\0';
- if (p_ptr->is_dead && p_ptr->total_winner)
+ if (p_ptr->is_dead)
{
+ if (p_ptr->total_winner)
+ {
#ifdef JP
- strcpy(statmsg, "¡Ä¤¢¤Ê¤¿¤Ï¾¡Íø¤Î¸å°úÂष¤¿¡£");
+ sprintf(statmsg, "…あなたは勝利の後%sした。", streq(p_ptr->died_from, "Seppuku") ? "切腹" : "引退");
#else
- strcpy(statmsg, "...You retired from the adventure after the winning.");
+ sprintf(statmsg, "...You %s after the winning.", streq(p_ptr->died_from, "Seppuku") ? "did Seppuku" : "retired from the adventure");
#endif
- }
- else if (p_ptr->is_dead)
- {
- if (!dun_level)
+ }
+ else if (!dun_level)
{
#ifdef JP
- sprintf(statmsg, "¡Ä¤¢¤Ê¤¿¤Ï%s¤Ç%s¤Ë»¦¤µ¤ì¤¿¡£", map_name(), p_ptr->died_from);
+ sprintf(statmsg, "…あなたは%sで%sに殺された。", map_name(), p_ptr->died_from);
#else
sprintf(statmsg, "...You were killed by %s in %s.", p_ptr->died_from, map_name());
#endif
{
/* Get the quest text */
/* Bewere that INIT_ASSIGN resets the cur_num. */
- init_flags = INIT_ASSIGN;
+ init_flags = INIT_NAME_ONLY;
process_dungeon_file("q_info.txt", 0, 0, 0, 0);
#ifdef JP
- sprintf(statmsg, "¡Ä¤¢¤Ê¤¿¤Ï¡¢¥¯¥¨¥¹¥È¡Ö%s¡×¤Ç%s¤Ë»¦¤µ¤ì¤¿¡£", quest[p_ptr->inside_quest].name, p_ptr->died_from);
+ sprintf(statmsg, "…あなたは、クエスト「%s」で%sに殺された。", quest[p_ptr->inside_quest].name, p_ptr->died_from);
#else
sprintf(statmsg, "...You were killed by %s in the quest '%s'.", p_ptr->died_from, quest[p_ptr->inside_quest].name);
#endif
else
{
#ifdef JP
- sprintf(statmsg, "¡Ä¤¢¤Ê¤¿¤Ï¡¢%s¤Î%d³¬¤Ç%s¤Ë»¦¤µ¤ì¤¿¡£", map_name(), dun_level, p_ptr->died_from);
+ sprintf(statmsg, "…あなたは、%sの%d階で%sに殺された。", map_name(), (int)dun_level, p_ptr->died_from);
#else
sprintf(statmsg, "...You were killed by %s on level %d of %s.", p_ptr->died_from, dun_level, map_name());
#endif
{
if (!dun_level)
{
-#ifdef JP
- sprintf(statmsg, "¡Ä¤¢¤Ê¤¿¤Ï¸½ºß¡¢ %s ¤Ë¤¤¤ë¡£", map_name());
-#else
- sprintf(statmsg, "...Now, you are in %s.", map_name());
-#endif
+ sprintf(statmsg, _("…あなたは現在、 %s にいる。", "...Now, you are in %s."), map_name());
}
else if (p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest))
{
quest_text_line = 0;
/* Get the quest text */
- init_flags = INIT_SHOW_TEXT;
+ init_flags = INIT_NAME_ONLY;
process_dungeon_file("q_info.txt", 0, 0, 0, 0);
-#ifdef JP
- sprintf(statmsg, "¡Ä¤¢¤Ê¤¿¤Ï¸½ºß¡¢ ¥¯¥¨¥¹¥È¡Ö%s¡×¤ò¿ë¹ÔÃæ¤À¡£", quest[p_ptr->inside_quest].name);
-#else
- sprintf(statmsg, "...Now, you are in the quest '%s'.", quest[p_ptr->inside_quest].name);
-#endif
+ sprintf(statmsg, _("…あなたは現在、 クエスト「%s」を遂行中だ。", "...Now, you are in the quest '%s'."), quest[p_ptr->inside_quest].name);
}
else
{
#ifdef JP
- sprintf(statmsg, "¡Ä¤¢¤Ê¤¿¤Ï¸½ºß¡¢ %s ¤Î %d ³¬¤Çõº÷¤·¤Æ¤¤¤ë¡£", map_name(), dun_level);
+ sprintf(statmsg, "…あなたは現在、 %s の %d 階で探索している。", map_name(), (int)dun_level);
#else
sprintf(statmsg, "...Now, you are exploring level %d of %s.", dun_level, map_name());
#endif
}
}
-
-errr make_character_dump(FILE *fff)
+/*!
+ * @brief プレイヤーのステータス表示をファイルにダンプする
+ * @param fff ファイルポインタ
+ * @return なし
+ */
+static void dump_aux_display_player(FILE *fff)
{
- int i, x, y;
- byte a;
- char c;
- cptr paren = ")";
- store_type *st_ptr;
- char o_name[MAX_NLEN];
- char buf[1024];
- int *quest_num;
- int dummy;
-
-#ifdef JP
- fprintf(fff, " [ÊѶòÈÚÅÜ %d.%d.%d ¥¥ã¥é¥¯¥¿¾ðÊó]\n\n",
- FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
-#else
- fprintf(fff, " [Hengband %d.%d.%d Character Dump]\n\n",
- FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
-#endif
-
- update_playtime();
+ TERM_LEN x, y;
+ TERM_COLOR a;
+ char c;
+ char buf[1024];
- /* Display player */
display_player(0);
/* Dump part of the screen */
while ((x > 0) && (buf[x-1] == ' ')) buf[--x] = '\0';
/* End the row */
-#ifdef JP
- fprintf(fff, "%s\n", buf);
-#else
- fprintf(fff, "%s\n", buf);
-#endif
-
+ fprintf(fff, _("%s\n", "%s\n"), buf);
}
/* Display history */
fprintf(fff, "%s\n", buf);
}
- for (i = 0; (unsigned int) i < (p_ptr->count / 80); i++)
- fprintf(fff, " ");
fprintf(fff, "\n");
- for (i = 0; (unsigned int) i < (p_ptr->count % 80); i++)
- fprintf(fff, " ");
+}
+
+
+/*!
+ * @brief プレイヤーのペット情報をファイルにダンプする
+ * @param fff ファイルポインタ
+ * @return なし
+ */
+static void dump_aux_pet(FILE *fff)
+{
+ int i;
+ bool pet = FALSE;
+ bool pet_settings = FALSE;
+ GAME_TEXT pet_name[MAX_NLEN];
+ for (i = m_max - 1; i >= 1; i--)
{
- bool pet = FALSE;
- char pet_name[80];
+ monster_type *m_ptr = &m_list[i];
- for (i = m_max - 1; i >= 1; i--)
+ if (!m_ptr->r_idx) continue;
+ if (!is_pet(m_ptr)) continue;
+ pet_settings = TRUE;
+ if (!m_ptr->nickname && (p_ptr->riding != i)) continue;
+ if (!pet)
{
- monster_type *m_ptr = &m_list[i];
-
- if (!m_ptr->r_idx) continue;
- if (!is_pet(m_ptr)) continue;
- if (!m_ptr->nickname && (p_ptr->riding != i)) continue;
- if (!pet)
- {
-#ifdef JP
- fprintf(fff, "\n [¼ç¤Ê¥Ú¥Ã¥È]\n\n");
-#else
- fprintf(fff, "\n [leading pets]\n\n");
-#endif
- pet = TRUE;
- }
- monster_desc(pet_name, m_ptr, MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
- fprintf(fff, "%s\n", pet_name);
+ fprintf(fff, _("\n\n [主なペット]\n\n", "\n\n [Leading Pets]\n\n"));
+ pet = TRUE;
}
-
- if (pet) fprintf(fff, "\n");
+ monster_desc(pet_name, m_ptr, MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
+ fprintf(fff, "%s\n", pet_name);
}
+ if (pet_settings)
+ {
+ fprintf(fff, _("\n\n [ペットへの命令]\n", "\n\n [Command for Pets]\n"));
- if (p_ptr->pclass == CLASS_BLUE_MAGE) {
+ fprintf(fff, _("\n ドアを開ける: %s", "\n Pets open doors: %s"),
+ (p_ptr->pet_extra_flags & PF_OPEN_DOORS) ? "ON" : "OFF");
- int i = 0;
- int j = 0;
- int l1 = 0;
- int l2 = 0;
- int num = 0;
- int spellnum[MAX_MONSPELLS];
- s32b f4 = 0, f5 = 0, f6 = 0;
- char p[60][80];
- int col = 0;
- bool pcol = FALSE;
+ fprintf(fff, _("\n アイテムを拾う: %s", "\n Pets pick up items: %s"),
+ (p_ptr->pet_extra_flags & PF_PICKUP_ITEMS) ? "ON" : "OFF");
- for (i=0;i<60;i++) { p[i][0] = '\0'; }
+ fprintf(fff, _("\n テレポート系魔法を使う: %s", "\n Allow teleport: %s"),
+ (p_ptr->pet_extra_flags & PF_TELEPORT) ? "ON" : "OFF");
-#ifdef JP
- strcat(p[col], "\n [³Ø½¬ºÑ¤ß¤ÎÀÄËâË¡]\n");
-#else
- strcat(p[col], "\n [Learned blue magic]\n");
-#endif
+ fprintf(fff, _("\n 攻撃魔法を使う: %s", "\n Allow cast attack spell: %s"),
+ (p_ptr->pet_extra_flags & PF_ATTACK_SPELL) ? "ON" : "OFF");
+ fprintf(fff, _("\n 召喚魔法を使う: %s", "\n Allow cast summon spell: %s"),
+ (p_ptr->pet_extra_flags & PF_SUMMON_SPELL) ? "ON" : "OFF");
- for (j=1;j<6;j++)
- {
- col++;
- set_rf_masks(&f4, &f5, &f6, j);
- switch(j)
- {
+ fprintf(fff, _("\n プレイヤーを巻き込む範囲魔法を使う: %s", "\n Allow involve player in area spell: %s"),
+ (p_ptr->pet_extra_flags & PF_BALL_SPELL) ? "ON" : "OFF");
+
+ fputc('\n', fff);
+ }
+}
+
+
+/*!
+ * @brief プレイヤーの職業能力情報をファイルにダンプする
+ * @param fff ファイルポインタ
+ * @return なし
+ */
+static void dump_aux_class_special(FILE *fff)
+{
+ if (p_ptr->pclass == CLASS_BLUE_MAGE)
+ {
+ int i = 0;
+ int j = 0;
+ int l1 = 0;
+ int l2 = 0;
+ int num = 0;
+ int spellnum[MAX_MONSPELLS];
+ BIT_FLAGS f4 = 0, f5 = 0, f6 = 0;
+ char p[60][80];
+ int col = 0;
+ bool pcol = FALSE;
+
+ for (i=0;i<60;i++) { p[i][0] = '\0'; }
+
+ strcat(p[col], _("\n\n [学習済みの青魔法]\n", "\n\n [Learned Blue Magic]\n"));
+
+ for (j=1;j<6;j++)
+ {
+ col++;
+ set_rf_masks(&f4, &f5, &f6, j);
+ switch(j)
+ {
case MONSPELL_TYPE_BOLT:
-#ifdef JP
- strcat(p[col], "\n [¥Ü¥ë¥È·¿]\n");
-#else
- strcat(p[col], "\n [Bolt type]\n");
-#endif
+ strcat(p[col], _("\n [ボルト型]\n", "\n [Bolt Type]\n"));
break;
case MONSPELL_TYPE_BALL:
-#ifdef JP
- strcat(p[col], "\n [¥Ü¡¼¥ë·¿]\n");
-#else
- strcat(p[col], "\n [Ball type]\n");
-#endif
+ strcat(p[col], _("\n [ボール型]\n", "\n [Ball Type]\n"));
break;
case MONSPELL_TYPE_BREATH:
-#ifdef JP
- strcat(p[col], "\n [¥Ö¥ì¥¹·¿]\n");
-#else
- strcat(p[col], "\n [ Breath ]\n");
-#endif
+ strcat(p[col], _("\n [ブレス型]\n", "\n [ Breath ]\n"));
break;
case MONSPELL_TYPE_SUMMON:
-#ifdef JP
- strcat(p[col], "\n [¾¤´ËâË¡]\n");
-#else
- strcat(p[col], "\n [Summonning]\n");
-#endif
+ strcat(p[col], _("\n [召喚魔法]\n", "\n [Summonning]\n"));
break;
case MONSPELL_TYPE_OTHER:
-#ifdef JP
- strcat(p[col], "\n [ ¤½¤Î¾ ]\n");
-#else
- strcat(p[col], "\n [Other type]\n");
-#endif
+ strcat(p[col], _("\n [ その他 ]\n", "\n [Other Type]\n"));
break;
}
if (!pcol)
{
-#ifdef JP
- strcat(p[col], "¤Ê¤·");
-#else
- strcat(p[col], "None");
-#endif
+ strcat(p[col], _("なし", "None"));
}
else
{
for (i=0;i<=col;i++)
{
- fprintf(fff, p[i]);
+ fputs(p[i], fff);
}
}
+ else if (p_ptr->pclass == CLASS_MAGIC_EATER)
+ {
+ char s[EATER_EXT][MAX_NLEN];
+ OBJECT_TYPE_VALUE tval = 0;
+ int ext;
+ KIND_OBJECT_IDX k_idx;
+ OBJECT_SUBTYPE_VALUE i;
+ int magic_num;
- fprintf(fff, "\n");
+ fprintf(fff, _("\n\n [取り込んだ魔法道具]\n", "\n\n [Magic devices eaten]\n"));
+ for (ext = 0; ext < 3; ext++)
+ {
+ int eat_num = 0;
-#ifdef JP
- fprintf(fff, "\n [¥¯¥¨¥¹¥È¾ðÊó]\n");
-#else
- fprintf(fff, "\n [Quest information]\n");
-#endif
+ /* Dump an extent name */
+ switch (ext)
+ {
+ case 0:
+ tval = TV_STAFF;
+ fprintf(fff, _("\n[杖]\n", "\n[Staffs]\n"));
+ break;
+ case 1:
+ tval = TV_WAND;
+ fprintf(fff, _("\n[魔法棒]\n", "\n[Wands]\n"));
+ break;
+ case 2:
+ tval = TV_ROD;
+ fprintf(fff, _("\n[ロッド]\n", "\n[Rods]\n"));
+ break;
+ }
+
+ /* Get magic device names that were eaten */
+ for (i = 0; i < EATER_EXT; i++)
+ {
+ int idx = EATER_EXT * ext + i;
+
+ magic_num = p_ptr->magic_num2[idx];
+ if (!magic_num) continue;
+
+ k_idx = lookup_kind(tval, i);
+ if (!k_idx) continue;
+ sprintf(s[eat_num], "%23s (%2d)", (k_name + k_info[k_idx].name), magic_num);
+ eat_num++;
+ }
+
+ /* Dump magic devices in this extent */
+ if (eat_num > 0)
+ {
+ for (i = 0; i < eat_num; i++)
+ {
+ fputs(s[i], fff);
+ if (i % 3 < 2) fputs(" ", fff);
+ else fputs("\n", fff);
+ }
+
+ if (i % 3 > 0) fputs("\n", fff);
+ }
+ else /* Not found */
+ {
+ fputs(_(" (なし)\n", " (none)\n"), fff);
+ }
+ }
+ }
+ else if (p_ptr->pclass == CLASS_SMITH)
+ {
+ int i, id[250], n = 0, row;
+
+ fprintf(fff, _("\n\n [手に入れたエッセンス]\n\n", "\n\n [Get Essence]\n\n"));
+ fprintf(fff, _("エッセンス 個数 エッセンス 個数 エッセンス 個数",
+ "Essence Num Essence Num Essence Num "));
+ for (i = 0; essence_name[i]; i++)
+ {
+ if (!essence_name[i][0]) continue;
+ id[n] = i;
+ n++;
+ }
+
+ row = n / 3 + 1;
+
+ for (i = 0; i < row; i++)
+ {
+ fprintf(fff, "\n");
+ fprintf(fff, "%-11s %5d ", essence_name[id[i]], (int)p_ptr->magic_num1[id[i]]);
+ if(i + row < n) fprintf(fff, "%-11s %5d ", essence_name[id[i + row]], (int)p_ptr->magic_num1[id[i + row]]);
+ if(i + row * 2 < n) fprintf(fff, "%-11s %5d", essence_name[id[i + row * 2]], (int)p_ptr->magic_num1[id[i + row * 2]]);
+ }
+
+ fputs("\n", fff);
+
+ }
+}
+
+
+/*!
+ * @brief クエスト情報をファイルにダンプする
+ * @param fff ファイルポインタ
+ * @return なし
+ */
+static void dump_aux_quest(FILE *fff)
+{
+ QUEST_IDX i;
+ QUEST_IDX *quest_num;
+ int dummy;
+
+ fprintf(fff, _("\n\n [クエスト情報]\n", "\n\n [Quest Information]\n"));
/* Allocate Memory */
- C_MAKE(quest_num, max_quests, int);
+ C_MAKE(quest_num, max_q_idx, QUEST_IDX);
/* Sort by compete level */
- for (i = 1; i < max_quests; i++) quest_num[i] = i;
+ for (i = 1; i < max_q_idx; i++) quest_num[i] = i;
ang_sort_comp = ang_sort_comp_quest_num;
ang_sort_swap = ang_sort_swap_quest_num;
- ang_sort(quest_num, &dummy, max_quests);
+ ang_sort(quest_num, &dummy, max_q_idx);
/* Dump Quest Information */
fputc('\n', fff);
do_cmd_knowledge_quests_completed(fff, quest_num);
fputc('\n', fff);
do_cmd_knowledge_quests_failed(fff, quest_num);
+ fputc('\n', fff);
/* Free Memory */
- C_KILL(quest_num, max_quests, int);
+ C_KILL(quest_num, max_q_idx, QUEST_IDX);
+}
+
+/*!
+ * @brief 死の直前メッセージ並びに遺言をファイルにダンプする
+ * @param fff ファイルポインタ
+ * @return なし
+ */
+static void dump_aux_last_message(FILE *fff)
+{
if (p_ptr->is_dead)
{
if (!p_ptr->total_winner)
{
-#ifdef JP
- fprintf(fff, "\n [»à¤ÌľÁ°¤Î¥á¥Ã¥»¡¼¥¸]\n\n");
-#else
- fprintf(fff, "\n [Last messages]\n\n");
-#endif
+ int i;
+
+ fprintf(fff, _("\n [死ぬ直前のメッセージ]\n\n", "\n [Last Messages]\n\n"));
for (i = MIN(message_num(), 30); i >= 0; i--)
{
fprintf(fff,"> %s\n",message_str((s16b)i));
}
- fprintf(fff, "\n");
+ fputc('\n', fff);
}
/* Hack -- *Winning* message */
else if (p_ptr->last_message)
{
-#ifdef JP
- fprintf(fff, "\n [*¾¡Íø*¥á¥Ã¥»¡¼¥¸]\n\n");
-#else
- fprintf(fff, "\n [*Winning* message]\n\n");
-#endif
+ fprintf(fff, _("\n [*勝利*メッセージ]\n\n", "\n [*Winning* Message]\n\n"));
fprintf(fff," %s\n", p_ptr->last_message);
+ fputc('\n', fff);
}
}
+}
-#ifdef JP
- fprintf(fff, "\n [¤½¤Î¾¤Î¾ðÊó]\n");
-#else
- fprintf(fff, "\n [Miscellaneous information]\n");
-#endif
+/*!
+ * @brief 帰還場所情報をファイルにダンプする
+ * @param fff ファイルポインタ
+ * @return なし
+ */
+static void dump_aux_recall(FILE *fff)
+{
+ int y;
+ fprintf(fff, _("\n [帰還場所]\n\n", "\n [Recall Depth]\n\n"));
-#ifdef JP
- fprintf(fff, "\n µ¢´Ô¾ì½ê:\n");
-#else
- fprintf(fff, "\n Recall Depth:\n");
-#endif
for (y = 1; y < max_d_idx; y++)
{
bool seiha = FALSE;
}
else if (max_dlv[y] == d_info[y].maxdepth) seiha = TRUE;
-#ifdef JP
- fprintf(fff, " %c%-12s: %3d ³¬\n", seiha ? '!' : ' ', d_name+d_info[y].name, max_dlv[y]);
-#else
- fprintf(fff, " %c%-16s: level %3d\n", seiha ? '!' : ' ', d_name+d_info[y].name, max_dlv[y]);
-#endif
+ fprintf(fff, _(" %c%-12s: %3d 階\n", " %c%-16s: level %3d\n"),
+ seiha ? '!' : ' ', d_name+d_info[y].name, (int)max_dlv[y]);
}
-
- if (preserve_mode)
-#ifdef JP
- fprintf(fff, "\n Êݸ¥â¡¼¥É: ON");
-#else
- fprintf(fff, "\n Preserve Mode: ON");
-#endif
-
- else
-#ifdef JP
- fprintf(fff, "\n Êݸ¥â¡¼¥É: OFF");
-#else
- fprintf(fff, "\n Preserve Mode: OFF");
-#endif
+}
- if (ironman_autoscum)
-#ifdef JP
- fprintf(fff, "\n ¼«Æ°Áª¤ê¹¥¤ß: ALWAYS");
-#else
- fprintf(fff, "\n Autoscum: ALWAYS");
-#endif
+/*!
+ * @brief オプション情報をファイルにダンプする
+ * @param fff ファイルポインタ
+ * @return なし
+ */
+static void dump_aux_options(FILE *fff)
+{
+ fprintf(fff, _("\n [オプション設定]\n", "\n [Option Settings]\n"));
- else if (auto_scum)
-#ifdef JP
- fprintf(fff, "\n ¼«Æ°Áª¤ê¹¥¤ß: ON");
-#else
- fprintf(fff, "\n Autoscum: ON");
-#endif
+ if (preserve_mode)
+ fprintf(fff, _("\n 保存モード: ON", "\n Preserve Mode: ON"));
else
-#ifdef JP
- fprintf(fff, "\n ¼«Æ°Áª¤ê¹¥¤ß: OFF");
-#else
- fprintf(fff, "\n Autoscum: OFF");
-#endif
-
+ fprintf(fff, _("\n 保存モード: OFF", "\n Preserve Mode: OFF"));
if (ironman_small_levels)
-#ifdef JP
- fprintf(fff, "\n ¾®¤µ¤¤¥À¥ó¥¸¥ç¥ó: ALWAYS");
-#else
- fprintf(fff, "\n Small Levels: ALWAYS");
-#endif
-
+ fprintf(fff, _("\n 小さいダンジョン: ALWAYS", "\n Small Levels: ALWAYS"));
else if (always_small_levels)
-#ifdef JP
- fprintf(fff, "\n ¾®¤µ¤¤¥À¥ó¥¸¥ç¥ó: ON");
-#else
- fprintf(fff, "\n Small Levels: ON");
-#endif
-
+ fprintf(fff, _("\n 小さいダンジョン: ON", "\n Small Levels: ON"));
else if (small_levels)
-#ifdef JP
- fprintf(fff, "\n ¾®¤µ¤¤¥À¥ó¥¸¥ç¥ó: ENABLED");
-#else
- fprintf(fff, "\n Small Levels: ENABLED");
-#endif
-
+ fprintf(fff, _("\n 小さいダンジョン: ENABLED", "\n Small Levels: ENABLED"));
else
-#ifdef JP
- fprintf(fff, "\n ¾®¤µ¤¤¥À¥ó¥¸¥ç¥ó: OFF");
-#else
- fprintf(fff, "\n Small Levels: OFF");
-#endif
+ fprintf(fff, _("\n 小さいダンジョン: OFF", "\n Small Levels: OFF"));
if (vanilla_town)
-#ifdef JP
- fprintf(fff, "\n ¸µÁĤÎÄ®¤Î¤ß: ON");
-#else
- fprintf(fff, "\n Vanilla Town: ON");
-#endif
-
+ fprintf(fff, _("\n 元祖の町のみ: ON", "\n Vanilla Town: ON"));
else if (lite_town)
-#ifdef JP
- fprintf(fff, "\n ¾®µ¬ÌϤÊÄ®: ON");
-#else
- fprintf(fff, "\n Lite Town: ON");
-#endif
+ fprintf(fff, _("\n 小規模な町: ON", "\n Lite Town: ON"));
if (ironman_shops)
-#ifdef JP
- fprintf(fff, "\n Ź¤Ê¤·: ON");
-#else
- fprintf(fff, "\n No Shops: ON");
-#endif
-
+ fprintf(fff, _("\n 店なし: ON", "\n No Shops: ON"));
if (ironman_downward)
-#ifdef JP
- fprintf(fff, "\n ³¬Ãʤò¾å¤¬¤ì¤Ê¤¤: ON");
-#else
- fprintf(fff, "\n Diving Only: ON");
-#endif
-
+ fprintf(fff, _("\n 階段を上がれない: ON", "\n Diving Only: ON"));
if (ironman_rooms)
-#ifdef JP
- fprintf(fff, "\n ÉáÄ̤Ǥʤ¤Éô²°: ON");
-#else
- fprintf(fff, "\n Unusual Rooms: ON");
-#endif
-
+ fprintf(fff, _("\n 普通でない部屋: ON", "\n Unusual Rooms: ON"));
if (ironman_nightmare)
-#ifdef JP
- fprintf(fff, "\n °Ì´¥â¡¼¥É: ON");
-#else
- fprintf(fff, "\n Nightmare Mode: ON");
-#endif
+ fprintf(fff, _("\n 悪夢モード: ON", "\n Nightmare Mode: ON"));
if (ironman_empty_levels)
-#ifdef JP
- fprintf(fff, "\n ¥¢¥ê¡¼¥Ê: ALWAYS");
-#else
- fprintf(fff, "\n Arena Levels: ALWAYS");
-#endif
-
+ fprintf(fff, _("\n アリーナ: ALWAYS", "\n Arena Levels: ALWAYS"));
else if (empty_levels)
-#ifdef JP
- fprintf(fff, "\n ¥¢¥ê¡¼¥Ê: ENABLED");
-#else
- fprintf(fff, "\n Arena Levels: ENABLED");
-#endif
-
+ fprintf(fff, _("\n アリーナ: ENABLED", "\n Arena Levels: ENABLED"));
else
-#ifdef JP
- fprintf(fff, "\n ¥¢¥ê¡¼¥Ê: OFF");
-#else
- fprintf(fff, "\n Arena Levels: OFF");
-#endif
+ fprintf(fff, _("\n アリーナ: OFF", "\n Arena Levels: OFF"));
+ fputc('\n', fff);
-#ifdef JP
- fprintf(fff, "\n ¥é¥ó¥À¥à¥¯¥¨¥¹¥È¿ô: %d", number_of_quests());
-#else
- fprintf(fff, "\n Num. Random Quests: %d", number_of_quests());
-#endif
+ if (p_ptr->noscore)
+ fprintf(fff, _("\n 何か不正なことをしてしまっています。\n", "\n You have done something illegal.\n"));
- fprintf(fff, "\n");
+ fputc('\n', fff);
+}
- if (!lite_town && !vanilla_town)
+
+/*!
+ * @brief 闘技場の情報をファイルにダンプする
+ * @param fff ファイルポインタ
+ * @return なし
+ */
+static void dump_aux_arena(FILE *fff)
+{
+ if (lite_town || vanilla_town) return;
+
+ if (p_ptr->arena_number < 0)
{
- if (p_ptr->arena_number < 0)
- {
- if (p_ptr->arena_number <= ARENA_DEFEATED_OLD_VER)
- {
-#ifdef JP
- fprintf(fff, "\n Æ®µ»¾ì: ÇÔËÌ\n");
-#else
- fprintf(fff, "\n Arena: Defeated\n");
-#endif
- }
- else
- {
-#ifdef JP
- fprintf(fff, "\n Æ®µ»¾ì: %d²óÀï¤Ç%s¤ÎÁ°¤ËÇÔËÌ\n", -p_ptr->arena_number,
- r_name + r_info[arena_info[-1 - p_ptr->arena_number].r_idx].name);
-#else
- fprintf(fff, "\n Arena: Defeated by %s in the %d%s fight\n",
- r_name + r_info[arena_info[-1 - p_ptr->arena_number].r_idx].name,
- -p_ptr->arena_number, get_ordinal_number_suffix(-p_ptr->arena_number));
-#endif
- }
- }
- else if (p_ptr->arena_number > MAX_ARENA_MONS + 2)
+ if (p_ptr->arena_number <= ARENA_DEFEATED_OLD_VER)
{
-#ifdef JP
- fprintf(fff, "\n Æ®µ»¾ì: ¿¿¤Î¥Á¥ã¥ó¥Ô¥ª¥ó\n");
-#else
- fprintf(fff, "\n Arena: True Champion\n");
-#endif
- }
- else if (p_ptr->arena_number > MAX_ARENA_MONS - 1)
- {
-#ifdef JP
- fprintf(fff, "\n Æ®µ»¾ì: ¥Á¥ã¥ó¥Ô¥ª¥ó\n");
-#else
- fprintf(fff, "\n Arena: Champion\n");
-#endif
+ fprintf(fff, _("\n 闘技場: 敗北\n", "\n Arena: Defeated\n"));
}
else
{
#ifdef JP
- fprintf(fff, "\n Æ®µ»¾ì: %2d¾¡\n", (p_ptr->arena_number > MAX_ARENA_MONS ? MAX_ARENA_MONS : p_ptr->arena_number));
+ fprintf(fff, "\n 闘技場: %d回戦で%sの前に敗北\n", -p_ptr->arena_number,
+ r_name + r_info[arena_info[-1 - p_ptr->arena_number].r_idx].name);
#else
- fprintf(fff, "\n Arena: %2d Victor%s\n", (p_ptr->arena_number > MAX_ARENA_MONS ? MAX_ARENA_MONS : p_ptr->arena_number), (p_ptr->arena_number > 1) ? "ies" : "y");
+ fprintf(fff, "\n Arena: Defeated by %s in the %d%s fight\n",
+ r_name + r_info[arena_info[-1 - p_ptr->arena_number].r_idx].name,
+ -p_ptr->arena_number, get_ordinal_number_suffix(-p_ptr->arena_number));
#endif
}
}
-
- if (p_ptr->noscore)
+ else if (p_ptr->arena_number > MAX_ARENA_MONS + 2)
+ {
+ fprintf(fff, _("\n 闘技場: 真のチャンピオン\n", "\n Arena: True Champion\n"));
+ }
+ else if (p_ptr->arena_number > MAX_ARENA_MONS - 1)
+ {
+ fprintf(fff, _("\n 闘技場: チャンピオン\n", "\n Arena: Champion\n"));
+ }
+ else
+ {
#ifdef JP
- fprintf(fff, "\n ²¿¤«ÉÔÀµ¤Ê¤³¤È¤ò¤·¤Æ¤·¤Þ¤Ã¤Æ¤Þ¤¹¡£");
+ fprintf(fff, "\n 闘技場: %2d勝\n", (p_ptr->arena_number > MAX_ARENA_MONS ? MAX_ARENA_MONS : p_ptr->arena_number));
#else
- fprintf(fff, "\n You have done something illegal.");
+ fprintf(fff, "\n Arena: %2d Victor%s\n", (p_ptr->arena_number > MAX_ARENA_MONS ? MAX_ARENA_MONS : p_ptr->arena_number), (p_ptr->arena_number > 1) ? "ies" : "y");
#endif
+ }
+ fprintf(fff, "\n");
+}
- fprintf(fff,"\n");
+/*!
+ * @brief 撃破モンスターの情報をファイルにダンプする
+ * @param fff ファイルポインタ
+ * @return なし
+ */
+static void dump_aux_monsters(FILE *fff)
+{
/* Monsters slain */
+
+ IDX k;
+ long uniq_total = 0;
+ long norm_total = 0;
+ MONRACE_IDX *who;
+
+ /* Sort by monster level */
+ u16b why = 2;
+
+ fprintf(fff, _("\n [倒したモンスター]\n\n", "\n [Defeated Monsters]\n\n"));
+
+ /* Allocate the "who" array */
+ C_MAKE(who, max_r_idx, MONRACE_IDX);
+
+ /* Count monster kills */
+ for (k = 1; k < max_r_idx; k++)
{
- int k;
- s32b Total = 0;
+ monster_race *r_ptr = &r_info[k];
- for (k = 1; k < max_r_idx; k++)
- {
- monster_race *r_ptr = &r_info[k];
+ /* Ignore unused index */
+ if (!r_ptr->name) continue;
- if (r_ptr->flags1 & RF1_UNIQUE)
+ /* Unique monsters */
+ if (r_ptr->flags1 & RF1_UNIQUE)
+ {
+ bool dead = (r_ptr->max_num == 0);
+ if (dead)
{
- bool dead = (r_ptr->max_num == 0);
- if (dead)
- {
- Total++;
- }
+ norm_total++;
+
+ /* Add a unique monster to the list */
+ who[uniq_total++] = k;
}
- else
+ }
+
+ /* Normal monsters */
+ else
+ {
+ if (r_ptr->r_pkills > 0)
{
- s16b This = r_ptr->r_pkills;
- if (This > 0)
- {
- Total += This;
- }
+ norm_total += r_ptr->r_pkills;
}
}
+ }
- if (Total < 1)
-#ifdef JP
- fprintf(fff,"\n ¤Þ¤ÀŨ¤òÅݤ·¤Æ¤¤¤Þ¤»¤ó¡£\n");
-#else
- fprintf(fff,"\n You have defeated no enemies yet.\n");
-#endif
- else if (Total == 1)
+ /* No monsters is defeated */
+ if (norm_total < 1)
+ {
+ fprintf(fff,_("まだ敵を倒していません。\n", "You have defeated no enemies yet.\n"));
+ }
+
+ /* Defeated more than one normal monsters */
+ else if (uniq_total == 0)
+ {
#ifdef JP
- fprintf(fff,"\n °ìÂΤÎŨ¤òÅݤ·¤Æ¤¤¤Þ¤¹¡£\n");
+ fprintf(fff,"%ld体の敵を倒しています。\n", norm_total);
#else
- fprintf(fff,"\n You have defeated one enemy.\n");
+ fprintf(fff,"You have defeated %ld %s.\n", norm_total, norm_total == 1 ? "enemy" : "enemies");
#endif
+ }
- else
+ /* Defeated more than one unique monsters */
+ else /* if (uniq_total > 0) */
+ {
#ifdef JP
- fprintf(fff,"\n %lu ÂΤÎŨ¤òÅݤ·¤Æ¤¤¤Þ¤¹¡£\n", Total);
+ fprintf(fff, "%ld体のユニーク・モンスターを含む、合計%ld体の敵を倒しています。\n", uniq_total, norm_total);
#else
- fprintf(fff,"\n You have defeated %lu enemies.\n", Total);
+ fprintf(fff, "You have defeated %ld %s including %ld unique monster%s in total.\n", norm_total, norm_total == 1 ? "enemy" : "enemies", uniq_total, (uniq_total == 1 ? "" : "s"));
#endif
+
+ /* Select the sort method */
+ ang_sort_comp = ang_sort_comp_hook;
+ ang_sort_swap = ang_sort_swap_hook;
+
+ /* Sort the array by dungeon depth of monsters */
+ ang_sort(who, &why, uniq_total);
+ fprintf(fff, _("\n《上位%ld体のユニーク・モンスター》\n", "\n< Unique monsters top %ld >\n"), MIN(uniq_total, 10));
+
+ /* Print top 10 */
+ for (k = uniq_total - 1; k >= 0 && k >= uniq_total - 10; k--)
+ {
+ monster_race *r_ptr = &r_info[who[k]];
+ fprintf(fff, _(" %-40s (レベル%3d)\n", " %-40s (level %3d)\n"), (r_name + r_ptr->name), (int)r_ptr->level);
+ }
+
}
+ /* Free the "who" array */
+ C_KILL(who, max_r_idx, s16b);
+}
+
+/*!
+ * @brief 元種族情報をファイルにダンプする
+ * @param fff ファイルポインタ
+ * @return なし
+ */
+static void dump_aux_race_history(FILE *fff)
+{
if (p_ptr->old_race1 || p_ptr->old_race2)
{
-#ifdef JP
- fprintf(fff, "\n\n ¤¢¤Ê¤¿¤Ï%s¤È¤·¤ÆÀ¸¤Þ¤ì¤¿¡£", race_info[p_ptr->start_race].title);
-#else
- fprintf(fff, "\n\n You were born as %s.", race_info[p_ptr->start_race].title);
-#endif
+ int i;
+
+ fprintf(fff, _("\n\n あなたは%sとして生まれた。", "\n\n You were born as %s."), race_info[p_ptr->start_race].title);
for (i = 0; i < MAX_RACES; i++)
{
if (p_ptr->start_race == i) continue;
{
if (!(p_ptr->old_race2 & 1L << (i-32))) continue;
}
-#ifdef JP
- fprintf(fff, "\n ¤¢¤Ê¤¿¤Ï¤«¤Ä¤Æ%s¤À¤Ã¤¿¡£", race_info[i].title);
-#else
- fprintf(fff, "\n You were a %s before.", race_info[i].title);
-#endif
+ fprintf(fff, _("\n あなたはかつて%sだった。", "\n You were a %s before."), race_info[i].title);
}
+
+ fputc('\n', fff);
}
+}
+
+/*!
+ * @brief 元魔法領域情報をファイルにダンプする
+ * @param fff ファイルポインタ
+ * @return なし
+ */
+static void dump_aux_realm_history(FILE *fff)
+{
if (p_ptr->old_realm)
{
+ int i;
+
+ fputc('\n', fff);
for (i = 0; i < MAX_MAGIC; i++)
{
if (!(p_ptr->old_realm & 1L << i)) continue;
-#ifdef JP
- fprintf(fff, "\n ¤¢¤Ê¤¿¤Ï¤«¤Ä¤Æ%sËâË¡¤ò»È¤¨¤¿¡£", realm_names[i+1]);
-#else
- fprintf(fff, "\n You were able to use %s magic before.", realm_names[i+1]);
-#endif
+ fprintf(fff, _("\n あなたはかつて%s魔法を使えた。", "\n You were able to use %s magic before."), realm_names[i+1]);
}
+ fputc('\n', fff);
}
+}
-#ifdef JP
- fprintf(fff, "\n\n [¥×¥ì¥¤¥ä¡¼¤ÎÆÁ]\n\n");
-#else
- fprintf(fff, "\n\n [Virtues]\n\n");
-#endif
+
+/*!
+ * @brief 徳の情報をファイルにダンプする
+ * @param fff ファイルポインタ
+ * @return なし
+ */
+static void dump_aux_virtues(FILE *fff)
+{
+ int v_nr, percent;
+
+ fprintf(fff, _("\n\n [自分に関する情報]\n\n", "\n\n [HP-rate & Max stat & Virtues]\n\n"));
+
+ percent = (int)(((long)p_ptr->player_hp[PY_MAX_LEVEL - 1] * 200L) /
+ (2 * p_ptr->hitdie +
+ ((PY_MAX_LEVEL - 1+3) * (p_ptr->hitdie + 1))));
#ifdef JP
- fprintf(fff, "°À : %s\n", your_alignment());
+ if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "現在の体力ランク : %d/100\n\n", percent);
+ else fprintf(fff, "現在の体力ランク : ???\n\n");
+ fprintf(fff, "能力の最大値\n");
#else
- fprintf(fff, "Your alighnment : %s\n", your_alignment());
+ if (p_ptr->knowledge & KNOW_HPRATE) fprintf(fff, "Your current Life Rating is %d/100.\n\n", percent);
+ else fprintf(fff, "Your current Life Rating is ???.\n\n");
+ fprintf(fff, "Limits of maximum stats\n");
#endif
+ for (v_nr = 0; v_nr < A_MAX; v_nr++)
+ {
+ if ((p_ptr->knowledge & KNOW_STAT) || p_ptr->stat_max[v_nr] == p_ptr->stat_max_max[v_nr]) fprintf(fff, "%s 18/%d\n", stat_names[v_nr], p_ptr->stat_max_max[v_nr]-18);
+ else fprintf(fff, "%s ???\n", stat_names[v_nr]);
+ }
+
+ fprintf(fff, _("\n属性 : %s\n", "\nYour alighnment : %s\n"), your_alignment());
fprintf(fff, "\n");
dump_virtues(fff);
+}
+
+/*!
+ * @brief 突然変異の情報をファイルにダンプする
+ * @param fff ファイルポインタ
+ * @return なし
+ */
+static void dump_aux_mutations(FILE *fff)
+{
if (p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3)
{
-#ifdef JP
- fprintf(fff, "\n\n [ÆÍÁ³ÊÑ°Û]\n\n");
-#else
- fprintf(fff, "\n\n [Mutations]\n\n");
-#endif
-
+ fprintf(fff, _("\n\n [突然変異]\n\n", "\n\n [Mutations]\n\n"));
dump_mutations(fff);
}
+}
- /* Skip some lines */
- fprintf(fff, "\n\n");
-
+/*!
+ * @brief 所持品の情報をファイルにダンプする
+ * @param fff ファイルポインタ
+ * @return なし
+ */
+static void dump_aux_equipment_inventory(FILE *fff)
+{
+ int i;
+ GAME_TEXT o_name[MAX_NLEN];
/* Dump the equipment */
if (equip_cnt)
{
-#ifdef JP
- fprintf(fff, " [¥¥ã¥é¥¯¥¿¤ÎÁõÈ÷]\n\n");
-#else
- fprintf(fff, " [Character Equipment]\n\n");
-#endif
-
+ fprintf(fff, _(" [キャラクタの装備]\n\n", " [Character Equipment]\n\n"));
for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
{
- object_desc(o_name, &inventory[i], TRUE, 3);
- if ((i == INVEN_LARM) && p_ptr->ryoute)
-#ifdef JP
- strcpy(o_name, "(Éð´ï¤òξ¼ê»ý¤Á)");
-#else
- strcpy(o_name, "(wielding with two-hands)");
-#endif
- fprintf(fff, "%c%s %s\n",
- index_to_label(i), paren, o_name);
+ object_desc(o_name, &inventory[i], 0);
+ if ((((i == INVEN_RARM) && p_ptr->hidarite) || ((i == INVEN_LARM) && p_ptr->migite)) && p_ptr->ryoute)
+ strcpy(o_name, _("(武器を両手持ち)", "(wielding with two-hands)"));
+
+ fprintf(fff, "%c) %s\n",
+ index_to_label(i), o_name);
}
fprintf(fff, "\n\n");
}
/* Dump the inventory */
-#ifdef JP
- fprintf(fff, " [¥¥ã¥é¥¯¥¿¤Î»ý¤Áʪ]\n\n");
-#else
- fprintf(fff, " [Character Inventory]\n\n");
-#endif
+ fprintf(fff, _(" [キャラクタの持ち物]\n\n", " [Character Inventory]\n\n"));
for (i = 0; i < INVEN_PACK; i++)
{
if (!inventory[i].k_idx) break;
/* Dump the inventory slots */
- object_desc(o_name, &inventory[i], TRUE, 3);
- fprintf(fff, "%c%s %s\n", index_to_label(i), paren, o_name);
+ object_desc(o_name, &inventory[i], 0);
+ fprintf(fff, "%c) %s\n", index_to_label(i), o_name);
}
/* Add an empty line */
fprintf(fff, "\n\n");
+}
- process_dungeon_file("w_info.txt", 0, 0, max_wild_y, max_wild_x);
- /* Print all homes in the different towns */
+/*!
+ * @brief 我が家と博物館のオブジェクト情報をファイルにダンプする
+ * @param fff ファイルポインタ
+ * @return なし
+ */
+static void dump_aux_home_museum(FILE *fff)
+{
+ GAME_TEXT o_name[MAX_NLEN];
+ store_type *st_ptr;
+
+ /* Do we need it?? */
+ /* process_dungeon_file("w_info.txt", 0, 0, max_wild_y, max_wild_x); */
+
+ /* Print the home */
st_ptr = &town[1].store[STORE_HOME];
/* Home -- if anything there */
if (st_ptr->stock_num)
{
- /* Header with name of the town */
-#ifdef JP
- fprintf(fff, " [²æ¤¬²È¤Î¥¢¥¤¥Æ¥à]\n");
-#else
- fprintf(fff, " [Home Inventory]\n");
-#endif
- x = 1;
+ int i;
+ TERM_LEN x = 1;
+
+ fprintf(fff, _(" [我が家のアイテム]\n", " [Home Inventory]\n"));
/* Dump all available items */
for (i = 0; i < st_ptr->stock_num; i++)
{
if ((i % 12) == 0)
-#ifdef JP
- fprintf(fff, "\n ( %d ¥Ú¡¼¥¸ )\n", x++);
-#else
- fprintf(fff, "\n ( page %d )\n", x++);
-#endif
- object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
- fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
+ fprintf(fff, _("\n ( %d ページ )\n", "\n ( page %d )\n"), x++);
+ object_desc(o_name, &st_ptr->stock[i], 0);
+ fprintf(fff, "%c) %s\n", I2A(i%12), o_name);
}
/* Add an empty line */
}
- /* Print all homes in the different towns */
+ /* Print the home */
st_ptr = &town[1].store[STORE_MUSEUM];
/* Home -- if anything there */
if (st_ptr->stock_num)
{
- /* Header with name of the town */
-#ifdef JP
- fprintf(fff, " [Çîʪ´Û¤Î¥¢¥¤¥Æ¥à]\n");
-#else
- fprintf(fff, " [Museum]\n");
-#endif
- x = 1;
+ int i;
+ TERM_LEN x = 1;
+
+ fprintf(fff, _(" [博物館のアイテム]\n", " [Museum]\n"));
/* Dump all available items */
for (i = 0; i < st_ptr->stock_num; i++)
{
#ifdef JP
- if ((i % 12) == 0) fprintf(fff, "\n ( %d ¥Ú¡¼¥¸ )\n", x++);
- object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
- fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
+ if ((i % 12) == 0) fprintf(fff, "\n ( %d ã\83\9aã\83¼ã\82¸ )\n", x++);
+ object_desc(o_name, &st_ptr->stock[i], 0);
+ fprintf(fff, "%c) %s\n", I2A(i%12), o_name);
#else
if ((i % 12) == 0) fprintf(fff, "\n ( page %d )\n", x++);
- object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
- fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
+ object_desc(o_name, &st_ptr->stock[i], 0);
+ fprintf(fff, "%c) %s\n", I2A(i%12), o_name);
#endif
}
/* Add an empty line */
fprintf(fff, "\n\n");
}
+}
+
+/*!
+ * @brief ダンプ出力のメインルーチン
+ * Output the character dump to a file
+ * @param fff ファイルポインタ
+ * @return エラーコード
+ */
+errr make_character_dump(FILE *fff)
+{
#ifdef JP
- fprintf(fff, " [¥Á¥§¥Ã¥¯¥µ¥à: \"%s\"]\n\n", get_check_sum());
+ fprintf(fff, " [変愚蛮怒 %d.%d.%d キャラクタ情報]\n\n",
+ FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
#else
- fprintf(fff, " [Check Sum: \"%s\"]\n\n", get_check_sum());
+ fprintf(fff, " [Hengband %d.%d.%d Character Dump]\n\n",
+ FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
#endif
+ update_playtime();
+
+ dump_aux_display_player(fff);
+ dump_aux_last_message(fff);
+ dump_aux_options(fff);
+ dump_aux_recall(fff);
+ dump_aux_quest(fff);
+ dump_aux_arena(fff);
+ dump_aux_monsters(fff);
+ dump_aux_virtues(fff);
+ dump_aux_race_history(fff);
+ dump_aux_realm_history(fff);
+ dump_aux_class_special(fff);
+ dump_aux_mutations(fff);
+ dump_aux_pet(fff);
+ fputs("\n\n", fff);
+ dump_aux_equipment_inventory(fff);
+ dump_aux_home_museum(fff);
+
+ fprintf(fff, _(" [チェックサム: \"%s\"]\n\n", " [Check Sum: \"%s\"]\n\n"), get_check_sum());
return 0;
}
-/*
+/*!
+ * @brief プレイヤーステータスをファイルダンプ出力する
* Hack -- Dump a character description file
- *
- * XXX XXX XXX Allow the "full" flag to dump additional info,
+ * @param name 出力ファイル名
+ * @return エラーコード
+ * @details
+ * Allow the "full" flag to dump additional info,
* and trigger its usage from various places in the code.
*/
-errr file_character(cptr name)
+errr file_character(concptr name)
{
int fd = -1;
FILE *fff = NULL;
if (fd >= 0)
{
char out_val[160];
-
- /* Close the file */
(void)fd_close(fd);
/* Build query */
-#ifdef JP
- (void)sprintf(out_val, "¸½Â¸¤¹¤ë¥Õ¥¡¥¤¥ë %s ¤Ë¾å½ñ¤¤·¤Þ¤¹¤«? ", buf);
-#else
- (void)sprintf(out_val, "Replace existing file %s? ", buf);
-#endif
-
+ (void)sprintf(out_val, _("現存するファイル %s に上書きしますか? ", "Replace existing file %s? "), buf);
/* Ask */
if (get_check_strict(out_val, CHECK_NO_HISTORY)) fd = -1;
/* Invalid file */
if (!fff)
{
- /* Message */
-#ifdef JP
- prt("¥¥ã¥é¥¯¥¿¾ðÊó¤Î¥Õ¥¡¥¤¥ë¤Ø¤Î½ñ¤½Ð¤·¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡ª", 0, 0);
-#else
- prt("Character dump failed!", 0, 0);
-#endif
+ prt(_("キャラクタ情報のファイルへの書き出しに失敗しました!", "Character dump failed!"), 0, 0);
(void)inkey();
my_fclose(fff);
- /* Message */
-#ifdef JP
-msg_print("¥¥ã¥é¥¯¥¿¾ðÊó¤Î¥Õ¥¡¥¤¥ë¤Ø¤Î½ñ¤½Ð¤·¤ËÀ®¸ù¤·¤Þ¤·¤¿¡£");
-#else
- msg_print("Character dump successful.");
-#endif
-
+ msg_print(_("キャラクタ情報のファイルへの書き出しに成功しました。", "Character dump successful."));
msg_print(NULL);
/* Success */
}
-/*
+/*!
+ * @brief ファイル内容の一行をコンソールに出力する
+ * Display single line of on-line help file
+ * @param str 出力する文字列
+ * @param cy コンソールの行
+ * @param shower 確認中
+ * @return なし
+ * @details
+ * <pre>
+ * You can insert some special color tag to change text color.
+ * Such as...
+ * WHITETEXT [[[[y|SOME TEXT WHICH IS DISPLAYED IN YELLOW| WHITETEXT
+ * A colored segment is between "[[[[y|" and the last "|".
+ * You can use any single character in place of the "|".
+ * </pre>
+ */
+static void show_file_aux_line(concptr str, int cy, concptr shower)
+{
+ static const char tag_str[] = "[[[[";
+ byte color = TERM_WHITE;
+ char in_tag = '\0';
+ int cx = 0;
+ int i;
+ char lcstr[1024];
+
+ if (shower)
+ {
+ /* Make a lower case version of str for searching */
+ strcpy(lcstr, str);
+ str_tolower(lcstr);
+ }
+
+ /* Initial cursor position */
+ Term_gotoxy(cx, cy);
+
+ for (i = 0; str[i];)
+ {
+ int len = strlen(&str[i]);
+ int showercol = len + 1;
+ int bracketcol = len + 1;
+ int endcol = len;
+ concptr ptr;
+
+ /* Search for a shower string in the line */
+ if (shower)
+ {
+ ptr = my_strstr(&lcstr[i], shower);
+ if (ptr) showercol = ptr - &lcstr[i];
+ }
+
+ /* Search for a color segment tag */
+ ptr = in_tag ? my_strchr(&str[i], in_tag) : my_strstr(&str[i], tag_str);
+ if (ptr) bracketcol = ptr - &str[i];
+
+ /* A color tag is found */
+ if (bracketcol < endcol) endcol = bracketcol;
+
+ /* The shower string is found before the color tag */
+ if (showercol < endcol) endcol = showercol;
+
+ /* Print a segment of the line */
+ Term_addstr(endcol, color, &str[i]);
+ cx += endcol;
+ i += endcol;
+
+ /* Shower string? */
+ if (endcol == showercol)
+ {
+ int showerlen = strlen(shower);
+
+ /* Print the shower string in yellow */
+ Term_addstr(showerlen, TERM_YELLOW, &str[i]);
+ cx += showerlen;
+ i += showerlen;
+ }
+
+ /* Colored segment? */
+ else if (endcol == bracketcol)
+ {
+ if (in_tag)
+ {
+ /* Found the end of colored segment */
+ i++;
+
+ /* Now looking for an another tag_str */
+ in_tag = '\0';
+
+ /* Set back to the default color */
+ color = TERM_WHITE;
+ }
+ else
+ {
+ /* Found a tag_str, and get a tag color */
+ i += sizeof(tag_str)-1;
+
+ /* Get tag color */
+ color = color_char_to_attr(str[i]);
+
+ /* Illegal color tag */
+ if (color == 255 || str[i+1] == '\0')
+ {
+ /* Illegal color tag */
+ color = TERM_WHITE;
+
+ /* Print the broken tag as a string */
+ Term_addstr(-1, TERM_WHITE, tag_str);
+ cx += sizeof(tag_str)-1;
+ }
+ else
+ {
+ /* Skip the color tag */
+ i++;
+
+ /* Now looking for a close tag */
+ in_tag = str[i];
+
+ /* Skip the close-tag-indicator */
+ i++;
+ }
+ }
+ }
+
+ } /* for (i = 0; str[i];) */
+
+ /* Clear rest of line */
+ Term_erase(cx, cy, 255);
+}
+
+
+/*!
+ * @brief ファイル内容をコンソールに出力する
* Recursive file perusal.
- *
- * Return FALSE on 'Q', otherwise TRUE.
- *
+ * @param show_version TRUEならばコンソール上にゲームのバージョンを表示する
+ * @param name ファイル名の文字列
+ * @param what 内容キャプションの文字列
+ * @param line 表示の現在行
+ * @param mode オプション
+ * @return なし
+ * @details
+ * <pre>
* Process various special text in the input file, including
* the "menu" structures used by the "help file" system.
- *
- * XXX XXX XXX Consider using a temporary file.
- *
- * XXX XXX XXX Allow the user to "save" the current file.
+ * Return FALSE on 'q' to exit from a deep, otherwise TRUE.
+ * </pre>
*/
-bool show_file(bool show_version, cptr name, cptr what, int line, int mode)
+bool show_file(bool show_version, concptr name, concptr what, int line, BIT_FLAGS mode)
{
- int i, n, k;
+ int i, n, skey;
/* Number of "real" lines passed by */
int next = 0;
/* Backup value for "line" */
int back = 0;
- /* Color of the next line */
- byte color = TERM_WHITE;
-
- /* Loop counter */
- int cnt;
-
/* This screen has sub-screens */
bool menu = FALSE;
FILE *fff = NULL;
/* Find this string (if any) */
- cptr find = NULL;
+ concptr find = NULL;
/* Jump to this tag */
- cptr tag = NULL;
+ concptr tag = NULL;
- /* Hold a string to find */
- char finder[81];
+ /* Hold strings to find/show */
+ char finder_str[81];
+ char shower_str[81];
+ char back_str[81];
- /* Hold a string to show */
- char shower[81];
+ /* String to show */
+ concptr shower = NULL;
/* Filename */
char filename[1024];
/* General buffer */
char buf[1024];
- /* Lower case version of the buffer, for searching */
- char lc_buf[1024];
-
- /* Aux pointer for making lc_buf (and find!) lowercase */
- cptr lc_buf_ptr;
-
/* Sub-menu information */
char hook[68][32];
rows = hgt - 4;
/* Wipe finder */
- strcpy(finder, "");
+ strcpy(finder_str, "");
/* Wipe shower */
- strcpy(shower, "");
+ strcpy(shower_str, "");
/* Wipe caption */
strcpy(caption, "");
/* Redirect the name */
name = filename;
- /* Hack XXX XXX XXX */
+ /* Hack */
if (what)
{
/* Caption */
if (!fff)
{
/* Caption */
-#ifdef JP
-sprintf(caption, "¥Ø¥ë¥×¡¦¥Õ¥¡¥¤¥ë'%s'", name);
-#else
- sprintf(caption, "Help file '%s'", name);
-#endif
-
+ sprintf(caption, _("ヘルプ・ファイル'%s'", "Help file '%s'"), name);
/* Build the filename */
path_build(path, sizeof(path), ANGBAND_DIR_HELP, name);
if (!fff)
{
/* Caption */
-#ifdef JP
-sprintf(caption, "¥¹¥Ý¥¤¥é¡¼¡¦¥Õ¥¡¥¤¥ë'%s'", name);
-#else
- sprintf(caption, "Info file '%s'", name);
-#endif
-
+ sprintf(caption, _("スポイラー・ファイル'%s'", "Info file '%s'"), name);
/* Build the filename */
path_build(path, sizeof(path), ANGBAND_DIR_INFO, name);
path[i] = PATH_SEP[0];
/* Caption */
-#ifdef JP
-sprintf(caption, "¥¹¥Ý¥¤¥é¡¼¡¦¥Õ¥¡¥¤¥ë'%s'", name);
-#else
- sprintf(caption, "Info file '%s'", name);
-#endif
+ sprintf(caption, _("スポイラー・ファイル'%s'", "Info file '%s'"), name);
/* Open the file */
fff = my_fopen(path, "r");
}
- /* Oops */
if (!fff)
{
- /* Message */
-#ifdef JP
-msg_format("'%s'¤ò¥ª¡¼¥×¥ó¤Ç¤¤Þ¤»¤ó¡£", name);
-#else
- msg_format("Cannot open '%s'.", name);
-#endif
-
+ msg_format(_("'%s'をオープンできません。", "Cannot open '%s'."), name);
msg_print(NULL);
- /* Oops */
return (TRUE);
}
/* Pre-Parse the file */
while (TRUE)
{
- char *str;
+ char *str = buf;
/* Read a line or stop */
if (my_fgets(fff, buf, sizeof(buf))) break;
- /* Get a color */
- if (prefix(buf, "#####")) str = &buf[6];
- else str = buf;
-
/* XXX Parse "menu" items */
if (prefix(str, "***** "))
{
/* Notice "menu" requests */
if ((str[6] == '[') && isalpha(str[7]))
{
+ /* Extract the menu item */
+ int k = str[7] - 'A';
+
/* This is a menu file */
menu = TRUE;
- /* Extract the menu item */
- k = str[7] - 'A';
-
if ((str[8] == ']') && (str[9] == ' '))
{
/* Extract the menu item */
/* Notice "tag" requests */
else if (str[6] == '<')
{
- str[strlen(str) - 1] = '\0';
- if (tag && streq(str + 7, tag)) line = next;
+ size_t len = strlen(str);
+
+ if (str[len - 1] == '>')
+ {
+ str[len - 1] = '\0';
+ if (tag && streq(str + 7, tag)) line = next;
+ }
}
/* Skip this */
/* start from bottom when reverse mode */
if (line == -1) line = ((size-1)/rows)*rows;
+ Term_clear();
/* Display the file */
while (TRUE)
{
- /* Clear screen */
- Term_clear();
-
/* Restart when necessary */
if (line >= size - rows) line = size - rows;
if (line < 0) line = 0;
/* Hack -- Re-Open the file */
fff = my_fopen(path, "r");
- /* Oops */
if (!fff) return (FALSE);
/* File has been restarted */
/* Dump the next 20, or rows, lines of the file */
for (i = 0; i < rows; )
{
- int print_x, x;
- cptr str;
+ concptr str = buf;
/* Hack -- track the "first" line */
if (!i) line = next;
/* Hack -- skip "special" lines */
if (prefix(buf, "***** ")) continue;
- /* Get a color */
- if (prefix(buf, "#####"))
- {
- color = color_char_to_attr(buf[5]);
- str = &buf[6];
- }
- else
- {
- color = TERM_WHITE;
- str = buf;
- }
-
/* Count the "real" lines */
next++;
- /* Make a lower case version of str for searching */
- strcpy(lc_buf, str);
-
- for (lc_buf_ptr = lc_buf; *lc_buf_ptr != 0; lc_buf_ptr++)
- {
-#ifdef JP
- if (iskanji(*lc_buf_ptr))
- lc_buf_ptr++;
- else
-#endif
- lc_buf[lc_buf_ptr-lc_buf] = tolower(*lc_buf_ptr);
- }
-
/* Hack -- keep searching */
- if (find && !i && !strstr(lc_buf, find)) continue;
-
- /* Hack -- stop searching */
- find = NULL;
-
- /* Dump the line */
- x = 0;
- print_x = 0;
- while (str[x])
+ if (find && !i)
{
- /* Color ? */
- if (prefix(str + x, "[[[[["))
- {
- byte c = color_char_to_attr(str[x + 5]);
- x += 6;
+ char lc_buf[1024];
- /* Ok print the link name */
- while (str[x] != ']')
- {
- Term_putch(print_x, i + 2, c, str[x]);
- x++;
- print_x++;
- }
- }
- else
- {
- Term_putch(print_x, i + 2, color, str[x]);
- print_x++;
- }
+ /* Make a lower case version of str for searching */
+ strcpy(lc_buf, str);
+ str_tolower(lc_buf);
- x++;
+ if (!my_strstr(lc_buf, find)) continue;
}
- /* Hilite "shower" */
- if (shower[0])
- {
- cptr s2 = lc_buf;
+ /* Hack -- stop searching */
+ find = NULL;
- /* Display matches */
- while ((s2 = strstr(s2, shower)) != NULL)
- {
- int len = strlen(shower);
+ /* Dump the line */
+ show_file_aux_line(str, i + 2, shower);
- /* Display the match */
- Term_putstr(s2-lc_buf, i+2, len, TERM_YELLOW, &str[s2-lc_buf]);
+ /* Count the printed lines */
+ i++;
+ }
- /* Advance */
- s2 += len;
- }
- }
+ while (i < rows)
+ {
+ /* Clear rest of line */
+ Term_erase(0, i + 2, 255);
- /* Count the printed lines */
i++;
}
/* Show a general "title" */
if (show_version)
{
- prt(format(
-#ifdef JP
- "[ÊѶòÈÚÅÜ %d.%d.%d, %s, %d/%d]",
-#else
- "[Hengband %d.%d.%d, %s, Line %d/%d]",
-#endif
-
+ prt(format(_("[変愚蛮怒 %d.%d.%d, %s, %d/%d]", "[Hengband %d.%d.%d, %s, Line %d/%d]"),
FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH,
caption, line, size), 0, 0);
}
else
{
- prt(format(
-#ifdef JP
- "[%s, %d/%d]",
-#else
- "[%s, Line %d/%d]",
-#endif
+ prt(format(_("[%s, %d/%d]", "[%s, Line %d/%d]"),
caption, line, size), 0, 0);
}
if (size <= rows)
{
/* Wait for it */
-#ifdef JP
-prt("[¥¡¼:(?)¥Ø¥ë¥× (ESC)½ªÎ»]", hgt - 1, 0);
-#else
- prt("[Press ESC to exit.]", hgt - 1, 0);
-#endif
-
+ prt(_("[キー:(?)ヘルプ (ESC)終了]", "[Press ESC to exit.]"), hgt - 1, 0);
}
/* Prompt -- large files */
{
#ifdef JP
if(reverse)
- prt("[¥¡¼:(RET/¥¹¥Ú¡¼¥¹)¢¬ (-)¢ (?)¥Ø¥ë¥× (ESC)½ªÎ»]", hgt - 1, 0);
+ prt("[キー:(RET/スペース)↑ (-)↓ (?)ヘルプ (ESC)終了]", hgt - 1, 0);
else
- prt("[¥¡¼:(RET/¥¹¥Ú¡¼¥¹)¢ (-)¢¬ (?)¥Ø¥ë¥× (ESC)½ªÎ»]", hgt - 1, 0);
+ prt("[キー:(RET/スペース)↓ (-)↑ (?)ヘルプ (ESC)終了]", hgt - 1, 0);
#else
prt("[Press Return, Space, -, =, /, |, or ESC to exit.]", hgt - 1, 0);
#endif
}
- /* Get a keypress */
- k = inkey();
+ /* Get a special key code */
+ skey = inkey_special(TRUE);
- /* Hack -- return to last screen */
- if (k == '<') break;
-
- /* Show the help for the help */
- if (k == '?')
+ switch (skey)
{
+ /* Show the help for the help */
+ case '?':
/* Hack - prevent silly recursion */
-#ifdef JP
- if (strcmp(name, "jhelpinfo.txt") != 0)
- show_file(TRUE, "jhelpinfo.txt", NULL, 0, mode);
-#else
- if (strcmp(name, "helpinfo.txt") != 0)
- show_file(TRUE, "helpinfo.txt", NULL, 0, mode);
-#endif
- }
+ if (strcmp(name, _("jhelpinfo.txt", "helpinfo.txt")) != 0)
+ show_file(TRUE, _("jhelpinfo.txt", "helpinfo.txt"), NULL, 0, mode);
+ break;
/* Hack -- try showing */
- if (k == '=')
- {
+ case '=':
/* Get "shower" */
-#ifdef JP
-prt("¶¯Ä´: ", hgt - 1, 0);
-#else
- prt("Show: ", hgt - 1, 0);
-#endif
+ prt(_("強調: ", "Show: "), hgt - 1, 0);
- (void)askfor_aux(shower, 80);
- }
+ strcpy(back_str, shower_str);
+ if (askfor(shower_str, 80))
+ {
+ if (shower_str[0])
+ {
+ /* Make it lowercase */
+ str_tolower(shower_str);
+
+ /* Show it */
+ shower = shower_str;
+ }
+ else shower = NULL; /* Stop showing */
+ }
+ else strcpy(shower_str, back_str);
+ break;
/* Hack -- try finding */
- if (k == '/')
- {
+ case '/':
+ case KTRL('s'):
/* Get "finder" */
-#ifdef JP
-prt("¸¡º÷: ", hgt - 1, 0);
-#else
- prt("Find: ", hgt - 1, 0);
-#endif
-
+ prt(_("検索: ", "Find: "), hgt - 1, 0);
- if (askfor_aux(finder, 80))
+ strcpy(back_str, finder_str);
+ if (askfor(finder_str, 80))
{
- /* Find it */
- find = finder;
- back = line;
- line = line + 1;
-
- /* Make finder lowercase */
- for (cnt = 0; finder[cnt] != 0; cnt++)
+ if (finder_str[0])
{
-#ifdef JP
- if (iskanji(finder[cnt]))
- cnt++;
- else
-#endif
- finder[cnt] = tolower(finder[cnt]);
- }
+ /* Find it */
+ find = finder_str;
+ back = line;
+ line = line + 1;
+
+ /* Make finder lowercase */
+ str_tolower(finder_str);
- /* Show it */
- strcpy(shower, finder);
+ /* Show it */
+ shower = finder_str;
+ }
+ else shower = NULL; /* Stop showing */
}
- }
+ else strcpy(finder_str, back_str);
+ break;
/* Hack -- go to a specific line */
- if (k == '#')
- {
- char tmp[81];
-#ifdef JP
-prt("¹Ô: ", hgt - 1, 0);
-#else
- prt("Goto Line: ", hgt - 1, 0);
-#endif
-
- strcpy(tmp, "0");
-
- if (askfor_aux(tmp, 80))
+ case '#':
{
- line = atoi(tmp);
+ char tmp[81];
+ prt(_("行: ", "Goto Line: "), hgt - 1, 0);
+ strcpy(tmp, "0");
+
+ if (askfor(tmp, 80)) line = atoi(tmp);
}
- }
+ break;
- /* Hack -- go to a specific file */
- if (k == '%')
- {
- char tmp[81];
-#ifdef JP
-prt("¥Õ¥¡¥¤¥ë¡¦¥Í¡¼¥à: ", hgt - 1, 0);
-strcpy(tmp, "jhelp.hlp");
-#else
- prt("Goto File: ", hgt - 1, 0);
- strcpy(tmp, "help.hlp");
-#endif
+ /* Hack -- go to the top line */
+ case SKEY_TOP:
+ line = 0;
+ break;
+ /* Hack -- go to the bottom line */
+ case SKEY_BOTTOM:
+ line = ((size - 1) / rows) * rows;
+ break;
- if (askfor_aux(tmp, 80))
+ /* Hack -- go to a specific file */
+ case '%':
{
- if (!show_file(TRUE, tmp, NULL, 0, mode)) k = 'q';
+ char tmp[81];
+ prt(_("ファイル・ネーム: ", "Goto File: "), hgt - 1, 0);
+ strcpy(tmp, _("jhelp.hlp", "help.hlp"));
+
+ if (askfor(tmp, 80))
+ {
+ if (!show_file(TRUE, tmp, NULL, 0, mode)) skey = 'q';
+ }
}
- }
+ break;
/* Allow backing up */
- if (k == '-')
- {
+ case '-':
line = line + (reverse ? rows : -rows);
if (line < 0) line = 0;
- }
+ break;
+
+ /* One page up */
+ case SKEY_PGUP:
+ line = line - rows;
+ if (line < 0) line = 0;
+ break;
/* Advance a single line */
- if ((k == '\n') || (k == '\r'))
- {
+ case '\n':
+ case '\r':
line = line + (reverse ? -1 : 1);
if (line < 0) line = 0;
- }
-
+ break;
/* Move up / down */
- if (k == '8')
- {
+ case '8':
+ case SKEY_UP:
line--;
if (line < 0) line = 0;
- }
+ break;
- if (k == '2') line++;
+ case '2':
+ case SKEY_DOWN:
+ line++;
+ break;
/* Advance one page */
- if (k == ' ')
- {
+ case ' ':
line = line + (reverse ? -rows : rows);
- if (line < 0) line = ((size-1)/rows)*rows;
+ if (line < 0) line = 0;
+ break;
+
+ /* One page down */
+ case SKEY_PGDOWN:
+ line = line + rows;
+ break;
}
/* Recurse on numbers */
{
int key = -1;
- if (isalpha(k))
- key = k - 'A';
+ if (!(skey & SKEY_MASK) && isalpha(skey))
+ key = skey - 'A';
if ((key > -1) && hook[key][0])
{
/* Recurse on that file */
if (!show_file(TRUE, hook[key], NULL, 0, mode))
- k = 'q';
+ skey = 'q';
}
}
/* Hack, dump to file */
- if (k == '|')
+ if (skey == '|')
{
FILE *ffp;
char buff[1024];
strcpy (xtmp, "");
-#ifdef JP
- if (!get_string("¥Õ¥¡¥¤¥ë̾: ", xtmp, 80))
-#else
- if (!get_string("File name: ", xtmp, 80))
-#endif
- {
- continue;
- }
-
+ if (!get_string(_("ファイル名: ", "File name: "), xtmp, 80)) continue;
+
/* Close it */
my_fclose(fff);
ffp = my_fopen(buff, "w");
- /* Oops */
if (!(fff && ffp))
{
-#ifdef JP
-msg_print("¥Õ¥¡¥¤¥ë¤¬³«¤±¤Þ¤»¤ó¡£");
-#else
- msg_print("Failed to open file.");
-#endif
-
- k = ESCAPE;
+ msg_print(_("ファイルを開けません。", "Failed to open file."));
+ skey = ESCAPE;
break;
}
- sprintf(xtmp, "%s: %s", player_name, what);
+ sprintf(xtmp, "%s: %s", p_ptr->name, what ? what : caption);
my_fputs(ffp, xtmp, 80);
my_fputs(ffp, "\n", 80);
fff = my_fopen(path, "r");
}
- /* Exit on escape */
- if (k == ESCAPE) break;
- if (k == 'q') break;
- }
+ /* Return to last screen */
+ if ((skey == ESCAPE) || (skey == '<')) break;
+
+ /* Exit on the ^q */
+ if (skey == KTRL('q')) skey = 'q';
- /* Close the file */
+ /* Exit on the q key */
+ if (skey == 'q') break;
+ }
my_fclose(fff);
/* Escape */
- if (k == 'q') return (FALSE);
+ if (skey == 'q') return (FALSE);
/* Normal return */
return (TRUE);
}
-/*
+/*!
+ * @brief ヘルプを表示するコマンドのメインルーチン
* Peruse the On-Line-Help
+ * @return なし
+ * @details
*/
void do_cmd_help(void)
{
- /* Save screen */
screen_save();
/* Peruse the main help file */
-#ifdef JP
-(void)show_file(TRUE, "jhelp.hlp", NULL, 0, 0);
-#else
- (void)show_file(TRUE, "help.hlp", NULL, 0, 0);
-#endif
-
-
- /* Load screen */
+ (void)show_file(TRUE, _("jhelp.hlp", "help.hlp"), NULL, 0, 0);
screen_load();
}
-/*
+/*!
+ * @brief プレイヤーの名前をチェックして修正する
* Process the player name.
+ * @param sf セーブファイル名に合わせた修正を行うならばTRUE
+ * @return なし
+ * @details
* Extract a clean "base name".
* Build the savefile name if needed.
*/
void process_player_name(bool sf)
{
int i, k = 0;
+ char old_player_base[32] = "";
+ if (character_generated) strcpy(old_player_base, player_base);
/* Cannot be too long */
-#if defined(MACINTOSH) || defined(MSDOS) || defined(USE_EMX) || defined(AMIGA) || defined(ACORN) || defined(VM)
-#ifdef MSDOS
- if (strlen(player_name) > 8)
-#else
- if (strlen(player_name) > 15)
-#endif
+#if defined(MACINTOSH) || defined(ACORN)
+ if (strlen(p_ptr->name) > 15)
{
/* Name too long */
-#ifdef JP
-quit_fmt("'%s'¤È¤¤¤¦Ì¾Á°¤ÏŤ¹¤®¤Þ¤¹¡ª", player_name);
-#else
- quit_fmt("The name '%s' is too long!", player_name);
-#endif
-
+ quit_fmt(_("'%s'という名前は長すぎます!", "The name '%s' is too long!"), p_ptr->name);
}
#endif
/* Cannot contain "icky" characters */
- for (i = 0; player_name[i]; i++)
+ for (i = 0; p_ptr->name[i]; i++)
{
/* No control characters */
#ifdef JP
- if (iskanji(player_name[i])){i++;continue;}
- if (iscntrl( (unsigned char)player_name[i]))
+ if (iskanji(p_ptr->name[i])){i++;continue;}
+ if (iscntrl( (unsigned char)p_ptr->name[i]))
#else
- if (iscntrl(player_name[i]))
+ if (iscntrl(p_ptr->name[i]))
#endif
{
/* Illegal characters */
-#ifdef JP
-quit_fmt("'%s' ¤È¤¤¤¦Ì¾Á°¤ÏÉÔÀµ¤Ê¥³¥ó¥È¥í¡¼¥ë¥³¡¼¥É¤ò´Þ¤ó¤Ç¤¤¤Þ¤¹¡£", player_name);
-#else
- quit_fmt("The name '%s' contains control chars!", player_name);
-#endif
-
+ quit_fmt(_("'%s' という名前は不正なコントロールコードを含んでいます。", "The name '%s' contains control chars!"), p_ptr->name);
}
}
#ifdef MACINTOSH
/* Extract "useful" letters */
- for (i = 0; player_name[i]; i++)
+ for (i = 0; p_ptr->name[i]; i++)
{
#ifdef JP
- unsigned char c = player_name[i];
+ unsigned char c = p_ptr->name[i];
#else
- char c = player_name[i];
+ char c = p_ptr->name[i];
#endif
#else
/* Extract "useful" letters */
- for (i = 0; player_name[i]; i++)
+ for (i = 0; p_ptr->name[i]; i++)
{
#ifdef JP
- unsigned char c = player_name[i];
+ unsigned char c = p_ptr->name[i];
#else
- char c = player_name[i];
+ char c = p_ptr->name[i];
#endif
/* Accept some letters */
#ifdef JP
if(iskanji(c)){
- if(k + 2 >= sizeof(player_base) || !player_name[i+1]) break;
+ if(k + 2 >= sizeof(player_base) || !p_ptr->name[i+1]) break;
player_base[k++] = c;
i++;
- player_base[k++] = player_name[i];
+ player_base[k++] = p_ptr->name[i];
}
#ifdef SJIS
else if (iskana(c)) player_base[k++] = c;
else
#endif
/* Convert path separator to underscore */
- if (!strncmp(PATH_SEP, player_name+i, strlen(PATH_SEP))){
+ if (!strncmp(PATH_SEP, p_ptr->name+i, strlen(PATH_SEP))){
player_base[k++] = '_';
i += strlen(PATH_SEP);
}
-#ifdef MSDOS
- /* Convert space, dot, and underscore to underscore */
- else if (strchr(". _", c)) player_base[k++] = '_';
+ /* Convert some characters to underscore */
+#if defined(WINDOWS)
+ else if (my_strchr("\"*,/:;<>?\\|", c)) player_base[k++] = '_';
#endif
else if (isprint(c)) player_base[k++] = c;
}
#endif
-
-#if defined(MSDOS)
-
- /* Hack -- max length */
- if (k > 8) k = 8;
-
-#endif
-
/* Terminate */
player_base[k] = '\0';
#endif
if (!savefile_base[0] && savefile[0])
{
- cptr s;
+ concptr s;
s = savefile;
while (1)
{
- cptr t;
- t = strstr(s, PATH_SEP);
+ concptr t;
+ t = my_strstr(s, PATH_SEP);
if (!t)
break;
s = t+1;
(void)sprintf(temp, "%s", player_base);
#endif
-#ifdef VM
- /* Hack -- support "flat directory" usage on VM/ESA */
- (void)sprintf(temp, "%s.sv", player_base);
-#endif /* VM */
-
/* Build the filename */
path_build(savefile, sizeof(savefile), ANGBAND_DIR_SAVE, temp);
}
+
+ /* Load an autopick preference file */
+ if (character_generated)
+ {
+ if (!streq(old_player_base, player_base)) autopick_load_pref(FALSE);
+ }
}
-/*
+/*!
+ * @brief プレイヤーの名前を変更するコマンドのメインルーチン
* Gets a name for the character, reacting to name changes.
- *
+ * @return なし
+ * @details
+ * <pre>
* Assumes that "display_player(0)" has just been called
- *
* Perhaps we should NOT ask for a name (at "birth()") on
* Unix machines? XXX XXX
- *
- * What a horrible name for a global function. XXX XXX XXX
+ * What a horrible name for a global function.
+ * </pre>
*/
void get_name(void)
{
char tmp[64];
/* Save the player name */
- strcpy(tmp, player_name);
+ strcpy(tmp, p_ptr->name);
/* Prompt for a new name */
-#ifdef JP
- if (get_string("¥¥ã¥é¥¯¥¿¡¼¤Î̾Á°¤òÆþÎϤ·¤Æ²¼¤µ¤¤: ", tmp, 15))
-#else
- if (get_string("Enter a name for your character: ", tmp, 15))
-#endif
+ if (get_string(_("キャラクターの名前を入力して下さい: ", "Enter a name for your character: "), tmp, 15))
{
/* Use the name */
- strcpy(player_name, tmp);
+ strcpy(p_ptr->name, tmp);
}
- else if (0 == strlen(player_name))
+
+ if (0 == strlen(p_ptr->name))
{
/* Use default name */
- strcpy(player_name, "PLAYER");
+ strcpy(p_ptr->name, "PLAYER");
}
strcpy(tmp,ap_ptr->title);
#ifdef JP
if(ap_ptr->no == 1)
- strcat(tmp,"¤Î");
+ strcat(tmp,"の");
#else
strcat(tmp, " ");
#endif
- strcat(tmp,player_name);
+ strcat(tmp,p_ptr->name);
/* Re-Draw the name (in light blue) */
Term_erase(34, 1, 255);
-/*
+/*!
+ * @brief 自殺するコマンドのメインルーチン
* Hack -- commit suicide
+ * @return なし
+ * @details
*/
void do_cmd_suicide(void)
{
if (p_ptr->total_winner)
{
/* Verify */
-#ifdef JP
-if (!get_check_strict("°úÂष¤Þ¤¹¤«? ", CHECK_NO_HISTORY)) return;
-#else
- if (!get_check_strict("Do you want to retire? ", CHECK_NO_HISTORY)) return;
-#endif
-
+ if (!get_check_strict(_("引退しますか? ", "Do you want to retire? "), CHECK_NO_HISTORY)) return;
}
/* Verify Suicide */
else
{
/* Verify */
-#ifdef JP
-if (!get_check("ËÜÅö¤Ë¼«»¦¤·¤Þ¤¹¤«¡©")) return;
-#else
- if (!get_check("Do you really want to commit suicide? ")) return;
-#endif
+ if (!get_check(_("本当に自殺しますか?", "Do you really want to commit suicide? "))) return;
}
if (!p_ptr->noscore)
{
/* Special Verification for suicide */
-#ifdef JP
-prt("³Îǧ¤Î¤¿¤á '@' ¤ò²¡¤·¤Æ²¼¤µ¤¤¡£", 0, 0);
-#else
- prt("Please verify SUICIDE by typing the '@' sign: ", 0, 0);
-#endif
+ prt(_("確認のため '@' を押して下さい。", "Please verify SUICIDE by typing the '@' sign: "), 0, 0);
flush();
i = inkey();
prt("", 0, 0);
if (i != '@') return;
+
+ play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_GAMEOVER);
}
/* Initialize "last message" buffer */
if (p_ptr->total_winner && last_words)
{
char buf[1024] = "";
-
-#ifdef JP
- while (!get_string("*¾¡Íø*¥á¥Ã¥»¡¼¥¸: ", buf, sizeof buf)) ;
-#else
- while (!get_string("*Winning* message: ", buf, sizeof buf)) ;
-#endif
+ play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_WINNER);
+ do
+ {
+ while (!get_string(_("*勝利*メッセージ: ", "*Winning* message: "), buf, sizeof buf)) ;
+ }
+ while (!get_check_strict(_("よろしいですか?", "Are you sure? "), CHECK_NO_HISTORY));
if (buf[0])
{
if (!p_ptr->total_winner)
{
-#ifdef JP
- do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "¥À¥ó¥¸¥ç¥ó¤Îõº÷¤ËÀä˾¤·¤Æ¼«»¦¤·¤¿¡£");
- do_cmd_write_nikki(NIKKI_GAMESTART, 1, "-------- ¥²¡¼¥à¥ª¡¼¥Ð¡¼ --------");
-#else
- do_cmd_write_nikki(NIKKI_BUNSHOU, 0, "give up all hope to commit suicide.");
- do_cmd_write_nikki(NIKKI_GAMESTART, 1, "-------- Game Over --------");
-#endif
+ do_cmd_write_nikki(NIKKI_BUNSHOU, 0, _("ダンジョンの探索に絶望して自殺した。", "give up all hope to commit suicide."));
+ do_cmd_write_nikki(NIKKI_GAMESTART, 1, _("-------- ゲームオーバー --------", "-------- Game Over --------"));
do_cmd_write_nikki(NIKKI_BUNSHOU, 1, "\n\n\n\n");
}
/* Cause of death */
-#ifdef JP
-(void)strcpy(p_ptr->died_from, "ÅÓÃ潪λ");
-#else
- (void)strcpy(p_ptr->died_from, "Quitting");
-#endif
-
+ (void)strcpy(p_ptr->died_from, _("途中終了", "Quitting"));
}
-
-/*
+/*!
+ * @brief セーブするコマンドのメインルーチン
* Save the game
+ * @param is_autosave オートセーブ中の処理ならばTRUE
+ * @return なし
+ * @details
*/
void do_cmd_save_game(int is_autosave)
{
/* Autosaves do not disturb */
if (is_autosave)
{
-#ifdef JP
-msg_print("¼«Æ°¥»¡¼¥ÖÃæ");
-#else
- msg_print("Autosaving the game...");
-#endif
-
+ msg_print(_("自動セーブ中", "Autosaving the game..."));
}
else
{
- /* Disturb the player */
- disturb(1, 0);
+ disturb(TRUE, TRUE);
}
/* Clear messages */
msg_print(NULL);
-
- /* Handle stuff */
handle_stuff();
- /* Message */
-#ifdef JP
-prt("¥²¡¼¥à¤ò¥»¡¼¥Ö¤·¤Æ¤¤¤Þ¤¹...", 0, 0);
-#else
- prt("Saving game...", 0, 0);
-#endif
-
+ prt(_("ゲームをセーブしています...", "Saving game..."), 0, 0);
- /* Refresh */
Term_fresh();
/* The player is not dead */
-#ifdef JP
-(void)strcpy(p_ptr->died_from, "(¥»¡¼¥Ö)");
-#else
- (void)strcpy(p_ptr->died_from, "(saved)");
-#endif
-
+ (void)strcpy(p_ptr->died_from, _("(セーブ)", "(saved)"));
/* Forbid suspend */
signals_ignore_tstp();
/* Save the player */
if (save_player())
{
-#ifdef JP
-prt("¥²¡¼¥à¤ò¥»¡¼¥Ö¤·¤Æ¤¤¤Þ¤¹... ½ªÎ»", 0, 0);
-#else
- prt("Saving game... done.", 0, 0);
-#endif
-
+ prt(_("ゲームをセーブしています... 終了", "Saving game... done."), 0, 0);
}
/* Save failed (oops) */
else
{
-#ifdef JP
-prt("¥²¡¼¥à¤ò¥»¡¼¥Ö¤·¤Æ¤¤¤Þ¤¹... ¼ºÇÔ¡ª", 0, 0);
-#else
- prt("Saving game... failed!", 0, 0);
-#endif
-
+ prt(_("ゲームをセーブしています... 失敗!", "Saving game... failed!"), 0, 0);
}
/* Allow suspend again */
signals_handle_tstp();
- /* Refresh */
Term_fresh();
/* Note that the player is not dead */
-#ifdef JP
-(void)strcpy(p_ptr->died_from, "(¸µµ¤¤ËÀ¸¤¤Æ¤¤¤ë)");
-#else
- (void)strcpy(p_ptr->died_from, "(alive and well)");
-#endif
+ (void)strcpy(p_ptr->died_from, _("(元気に生きている)", "(alive and well)"));
+
+ /* HACK -- don't get sanity blast on updating view */
+ is_loading_now = FALSE;
- /* Update some things */
- p_ptr->update |= (PU_VIEW | PU_LITE | PU_MON_LITE | PU_DISTANCE);
+ update_creature(p_ptr);
- /* Update stuff */
- update_stuff();
+ /* Initialize monster process */
+ mproc_init();
+
+ /* HACK -- reset the hackish flag */
+ is_loading_now = TRUE;
}
-/*
+/*!
+ * @brief セーブ後にゲーム中断フラグを立てる/
* Save the game and exit
+ * @return なし
+ * @details
*/
void do_cmd_save_and_exit(void)
{
/* Leaving */
p_ptr->leaving = TRUE;
-#ifdef JP
- do_cmd_write_nikki(NIKKI_GAMESTART, 0, "----¥²¡¼¥àÃæÃÇ----");
-#else
- do_cmd_write_nikki(NIKKI_GAMESTART, 0, "---- Save and Exit Game ----");
-#endif
+ do_cmd_write_nikki(NIKKI_GAMESTART, 0, _("----ゲーム中断----", "---- Save and Exit Game ----"));
}
-/*
+/*!
+ * @brief スコアを計算する /
* Hack -- Calculates the total number of points earned -JWT-
+ * @return なし
+ * @details
*/
long total_points(void)
{
int i, mult = 100;
- s16b max_dl = 0;
+ DEPTH max_dl = 0;
u32b point, point_h, point_l;
int arena_win = MIN(p_ptr->arena_number, MAX_ARENA_MONS);
}
+#define GRAVE_LINE_WIDTH 31
-/*
- * Centers a string within a 31 character string -JWT-
+/*!
+ * @brief 墓石の真ん中に文字列を書き込む /
+ * Centers a string within a GRAVE_LINE_WIDTH character string -JWT-
+ * @return なし
+ * @details
*/
-static void center_string(char *buf, cptr str)
+static void center_string(char *buf, concptr str)
{
int i, j;
i = strlen(str);
/* Necessary border */
- j = 15 - i / 2;
+ j = GRAVE_LINE_WIDTH / 2 - i / 2;
/* Mega-Hack */
- (void)sprintf(buf, "%*s%s%*s", j, "", str, 31 - i - j, "");
+ (void)sprintf(buf, "%*s%s%*s", j, "", str, GRAVE_LINE_WIDTH - i - j, "");
}
#if 0
-/*
+/*!
+ * @brief 骨ファイル出力 /
* Save a "bones" file for a dead character
- *
+ * @details
+ * <pre>
* Note that we will not use these files until Angband 2.8.0, and
* then we will only use the name and level on which death occured.
- *
* Should probably attempt some form of locking...
+ * </pre>
*/
static void make_bones(void)
{
{
char tmp[128];
- /* XXX XXX XXX "Bones" name */
+ /* "Bones" name */
sprintf(tmp, "bone.%03d", dun_level);
/* Build the filename */
if (!fp) return;
/* Save the info */
- fprintf(fp, "%s\n", player_name);
+ fprintf(fp, "%s\n", p_ptr->name);
fprintf(fp, "%d\n", p_ptr->mhp);
fprintf(fp, "%d\n", p_ptr->prace);
fprintf(fp, "%d\n", p_ptr->pclass);
bool (*tombstone_aux)(void) = NULL;
-/*
+/*!
+ * @brief 墓石のアスキーアート表示 /
* Display a "tomb-stone"
+ * @return なし
*/
static void print_tomb(void)
{
/* Print the text-tombstone */
if (!done)
{
- cptr p;
-
- char tmp[160];
-
- char buf[1024];
-#ifndef JP
- char dummy[80];
-#endif
-
- FILE *fp;
-
- time_t ct = time((time_t)0);
-
-
- /* Clear screen */
- Term_clear();
-
- /* Build the filename */
+ concptr p;
+ char tmp[160];
+ char buf[1024];
+ char dummy[80];
+ char *t;
+ FILE *fp;
+ time_t ct = time((time_t)0);
#ifdef JP
- path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "dead_j.txt");
-#else
- path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "dead.txt");
+ int extra_line = 0;
#endif
+ Term_clear();
+ /* Build the filename */
+ path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, _("dead_j.txt", "dead.txt"));
/* Open the News file */
fp = my_fopen(buf, "r");
my_fclose(fp);
}
-
/* King or Queen */
if (p_ptr->total_winner || (p_ptr->lev > PY_MAX_LEVEL))
{
#ifdef JP
- /* ±ÑÆüÀÚ¤êÂؤ¨ */
- p= "°ÎÂç¤Ê¤ë¼Ô";
+ /* 英日切り替え */
+ p= "偉大なる者";
#else
p = "Magnificent";
#endif
-
}
/* Normal */
p = player_title[p_ptr->pclass][(p_ptr->lev - 1) / 5];
}
- center_string(buf, player_name);
+ center_string(buf, p_ptr->name);
put_str(buf, 6, 11);
#ifndef JP
center_string(buf, p);
put_str(buf, 8, 11);
-
center_string(buf, cp_ptr->title);
-
put_str(buf, 10, 11);
-#ifdef JP
-(void)sprintf(tmp, "¥ì¥Ù¥ë: %d", (int)p_ptr->lev);
-#else
- (void)sprintf(tmp, "Level: %d", (int)p_ptr->lev);
-#endif
-
+ (void)sprintf(tmp, _("レベル: %d", "Level: %d"), (int)p_ptr->lev);
center_string(buf, tmp);
put_str(buf, 11, 11);
-#ifdef JP
-(void)sprintf(tmp, "·Ð¸³ÃÍ: %ld", (long)p_ptr->exp);
-#else
- (void)sprintf(tmp, "Exp: %ld", (long)p_ptr->exp);
-#endif
-
+ (void)sprintf(tmp, _("経験値: %ld", "Exp: %ld"), (long)p_ptr->exp);
center_string(buf, tmp);
put_str(buf, 12, 11);
-#ifdef JP
-(void)sprintf(tmp, "½ê»ý¶â: %ld", (long)p_ptr->au);
-#else
- (void)sprintf(tmp, "AU: %ld", (long)p_ptr->au);
-#endif
-
+ (void)sprintf(tmp, _("所持金: %ld", "AU: %ld"), (long)p_ptr->au);
center_string(buf, tmp);
put_str(buf, 13, 11);
#ifdef JP
- /* Êè¤Ë¹ï¤à¸ÀÍÕ¤ò¥ª¥ê¥¸¥Ê¥ë¤è¤êºÙ¤«¤¯É½¼¨ */
- if (streq(p_ptr->died_from, "ÅÓÃ潪λ"))
- {
- strcpy(tmp, "<¼«»¦>");
- }
- else
- {
- if (streq(p_ptr->died_from, "ripe"))
+ /* 墓に刻む言葉をオリジナルより細かく表示 */
+ if (streq(p_ptr->died_from, "途中終了"))
{
- strcpy(tmp, "°úÂà¸å¤ËÅ·¼÷¤òÁ´¤¦");
+ strcpy(tmp, "<自殺>");
}
- else if (streq(p_ptr->died_from, "Seppuku"))
+ else if (streq(p_ptr->died_from, "ripe"))
{
- strcpy(tmp, "¾¡Íø¤Î¸å¡¢ÀÚÊ¢");
+ strcpy(tmp, "引退後に天寿を全う");
}
- else
+ else if (streq(p_ptr->died_from, "Seppuku"))
{
- strcpy(tmp, p_ptr->died_from);
+ strcpy(tmp, "勝利の後、切腹");
}
- }
- center_string(buf, tmp);
- put_str(buf, 14, 11);
-
- if(!streq(p_ptr->died_from, "ripe") && !streq(p_ptr->died_from, "Seppuku"))
- {
- if( dun_level == 0 )
+ else
{
- cptr town = (p_ptr->town_num ? "³¹" : "¹ÓÌî");
- if(streq(p_ptr->died_from, "ÅÓÃ潪λ"))
+ roff_to_buf(p_ptr->died_from, GRAVE_LINE_WIDTH + 1, tmp, sizeof tmp);
+ t = tmp + strlen(tmp) + 1;
+ if (*t)
{
- sprintf(tmp, "%s¤Ç»à¤ó¤À", town);
- }
- else
- {
- sprintf(tmp, "¤Ë%s¤Ç»¦¤µ¤ì¤¿", town);
+ strcpy(dummy, t); /* 2nd line */
+ if (*(t + strlen(t) + 1)) /* Does 3rd line exist? */
+ {
+ for (t = dummy + strlen(dummy) - 2; iskanji(*(t - 1)); t--) /* Loop */;
+ strcpy(t, "…");
+ }
+ else if (my_strstr(tmp, "『") && suffix(dummy, "』"))
+ {
+ char dummy2[80];
+ char *name_head = my_strstr(tmp, "『");
+ sprintf(dummy2, "%s%s", name_head, dummy);
+ if (strlen(dummy2) <= GRAVE_LINE_WIDTH)
+ {
+ strcpy(dummy, dummy2);
+ *name_head = '\0';
+ }
+ }
+ else if (my_strstr(tmp, "「") && suffix(dummy, "」"))
+ {
+ char dummy2[80];
+ char *name_head = my_strstr(tmp, "「");
+ sprintf(dummy2, "%s%s", name_head, dummy);
+ if (strlen(dummy2) <= GRAVE_LINE_WIDTH)
+ {
+ strcpy(dummy, dummy2);
+ *name_head = '\0';
+ }
+ }
+ center_string(buf, dummy);
+ put_str(buf, 15, 11);
+ extra_line = 1;
}
}
- else
+ center_string(buf, tmp);
+ put_str(buf, 14, 11);
+
+ if (!streq(p_ptr->died_from, "ripe") && !streq(p_ptr->died_from, "Seppuku"))
{
- if(streq(p_ptr->died_from, "ÅÓÃ潪λ"))
+ if (dun_level == 0)
{
- sprintf(tmp, "Ãϲ¼ %d ³¬¤Ç»à¤ó¤À", dun_level);
+ concptr field_name = p_ptr->town_num ? "街" : "荒野";
+ if (streq(p_ptr->died_from, "途中終了"))
+ {
+ sprintf(tmp, "%sで死んだ", field_name);
+ }
+ else
+ {
+ sprintf(tmp, "に%sで殺された", field_name);
+ }
}
else
{
- sprintf(tmp, "¤ËÃϲ¼ %d ³¬¤Ç»¦¤µ¤ì¤¿", dun_level);
+ if (streq(p_ptr->died_from, "途中終了"))
+ {
+ sprintf(tmp, "地下 %d 階で死んだ", (int)dun_level);
+ }
+ else
+ {
+ sprintf(tmp, "に地下 %d 階で殺された", (int)dun_level);
+ }
}
+ center_string(buf, tmp);
+ put_str(buf, 15 + extra_line, 11);
}
- center_string(buf, tmp);
- put_str(buf, 15, 11);
- }
#else
(void)sprintf(tmp, "Killed on Level %d", dun_level);
center_string(buf, tmp);
put_str(buf, 14, 11);
-
- if (strlen(p_ptr->died_from) > 24)
- {
- strncpy(dummy, p_ptr->died_from, 24);
- dummy[24] = '\0';
- (void)sprintf(tmp, "by %s.", dummy);
- }
- else
- (void)sprintf(tmp, "by %s.", p_ptr->died_from);
-
+ roff_to_buf(format("by %s.", p_ptr->died_from), GRAVE_LINE_WIDTH + 1, tmp, sizeof tmp);
center_string(buf, tmp);
put_str(buf, 15, 11);
+ t = tmp + strlen(tmp) + 1;
+ if (*t)
+ {
+ strcpy(dummy, t); /* 2nd line */
+ if (*(t + strlen(t) + 1)) /* Does 3rd line exist? */
+ {
+ int dummy_len = strlen(dummy);
+ strcpy(dummy + MIN(dummy_len, GRAVE_LINE_WIDTH - 3), "...");
+ }
+ center_string(buf, dummy);
+ put_str(buf, 16, 11);
+ }
#endif
-
-
(void)sprintf(tmp, "%-.24s", ctime(&ct));
center_string(buf, tmp);
put_str(buf, 17, 11);
-
-#ifdef JP
-msg_format("¤µ¤è¤¦¤Ê¤é¡¢%s!", player_name);
-#else
- msg_format("Goodbye, %s!", player_name);
-#endif
-
+ msg_format(_("さようなら、%s!", "Goodbye, %s!"), p_ptr->name);
}
}
-/*
+/*!
+ * @brief 死亡、引退時の簡易ステータス表示 /
* Display some character info
+ * @return なし
*/
static void show_info(void)
{
/* Hack -- Recalculate bonuses */
p_ptr->update |= (PU_BONUS);
-
- /* Handle stuff */
handle_stuff();
/* Flush all input keys */
flush();
- /* Flush messages */
- msg_print(NULL);
+ msg_erase();
/* Describe options */
-#ifdef JP
-prt("¥¥ã¥é¥¯¥¿¡¼¤ÎµÏ¿¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹¤³¤È¤¬¤Ç¤¤Þ¤¹¡£", 21, 0);
-prt("¥ê¥¿¡¼¥ó¥¡¼¤Ç¥¥ã¥é¥¯¥¿¡¼¤ò¸«¤Þ¤¹¡£ESC¤ÇÃæÃǤ·¤Þ¤¹¡£", 22, 0);
-#else
- prt("You may now dump a character record to one or more files.", 21, 0);
- prt("Then, hit RETURN to see the character, or ESC to abort.", 22, 0);
-#endif
-
+ prt(_("キャラクターの記録をファイルに書き出すことができます。", "You may now dump a character record to one or more files."), 21, 0);
+ prt(_("リターンキーでキャラクターを見ます。ESCで中断します。", "Then, hit RETURN to see the character, or ESC to abort."), 22, 0);
/* Dump character records as requested */
while (TRUE)
char out_val[160];
/* Prompt */
-#ifdef JP
-put_str("¥Õ¥¡¥¤¥ë¥Í¡¼¥à: ", 23, 0);
-#else
- put_str("Filename: ", 23, 0);
-#endif
-
+ put_str(_("ファイルネーム: ", "Filename: "), 23, 0);
/* Default */
strcpy(out_val, "");
/* Ask for filename (or abort) */
- if (!askfor_aux(out_val, 60)) return;
+ if (!askfor(out_val, 60)) return;
/* Return means "show on screen" */
if (!out_val[0]) break;
-
- /* Save screen */
screen_save();
/* Dump a character file */
(void)file_character(out_val);
-
- /* Load screen */
screen_load();
}
update_playtime();
-
- /* Display player */
display_player(0);
/* Prompt for inventory */
-#ifdef JP
-prt("²¿¤«¥¡¼¤ò²¡¤¹¤È¤µ¤é¤Ë¾ðÊó¤¬Â³¤¤Þ¤¹ (ESC¤ÇÃæÃÇ): ", 23, 0);
-#else
- prt("Hit any key to see more information (ESC to abort): ", 23, 0);
-#endif
-
+ prt(_("何かキーを押すとさらに情報が続きます (ESCで中断): ", "Hit any key to see more information (ESC to abort): "), 23, 0);
/* Allow abort at this point */
if (inkey() == ESCAPE) return;
if (equip_cnt)
{
Term_clear();
- item_tester_full = TRUE;
- (void)show_equip(0);
-#ifdef JP
-prt("ÁõÈ÷¤·¤Æ¤¤¤¿¥¢¥¤¥Æ¥à: -³¤¯-", 0, 0);
-#else
- prt("You are using: -more-", 0, 0);
-#endif
+ (void)show_equip(0, USE_FULL);
+ prt(_("装備していたアイテム: -続く-", "You are using: -more-"), 0, 0);
if (inkey() == ESCAPE) return;
}
if (inven_cnt)
{
Term_clear();
- item_tester_full = TRUE;
- (void)show_inven(0);
-#ifdef JP
-prt("»ý¤Ã¤Æ¤¤¤¿¥¢¥¤¥Æ¥à: -³¤¯-", 0, 0);
-#else
- prt("You are carrying: -more-", 0, 0);
-#endif
+ (void)show_inven(0, USE_FULL);
+ prt(_("持っていたアイテム: -続く-", "You are carrying: -more-"), 0, 0);
if (inkey() == ESCAPE) return;
}
/* Display contents of the home */
for (k = 0, i = 0; i < st_ptr->stock_num; k++)
{
- /* Clear screen */
Term_clear();
/* Show 12 items */
for (j = 0; (j < 12) && (i < st_ptr->stock_num); j++, i++)
{
- char o_name[MAX_NLEN];
+ GAME_TEXT o_name[MAX_NLEN];
char tmp_val[80];
/* Acquire item */
prt(tmp_val, j+2, 4);
/* Display object description */
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, 0);
c_put_str(tval_to_attr[o_ptr->tval], o_name, j+2, 7);
}
/* Caption */
-#ifdef JP
-prt(format("²æ¤¬²È¤ËÃÖ¤¤¤Æ¤¢¤Ã¤¿¥¢¥¤¥Æ¥à ( %d ¥Ú¡¼¥¸): -³¤¯-", k+1), 0, 0);
-#else
- prt(format("Your home contains (page %d): -more-", k+1), 0, 0);
-#endif
-
+ prt(format(_("我が家に置いてあったアイテム ( %d ページ): -続く-", "Your home contains (page %d): -more-"), k+1), 0, 0);
/* Wait for it */
if (inkey() == ESCAPE) return;
}
}
-
+/*!
+ * @brief スコアファイル出力
+ * Display some character info
+ * @return なし
+ */
static bool check_score(void)
{
- /* Clear screen */
Term_clear();
/* No score file */
if (highscore_fd < 0)
{
-#ifdef JP
-msg_print("¥¹¥³¥¢¡¦¥Õ¥¡¥¤¥ë¤¬»ÈÍѤǤ¤Þ¤»¤ó¡£");
-#else
- msg_print("Score file unavailable.");
-#endif
-
+ msg_print(_("スコア・ファイルが使用できません。", "Score file unavailable."));
msg_print(NULL);
return FALSE;
}
/* Wizard-mode pre-empts scoring */
if (p_ptr->noscore & 0x000F)
{
-#ifdef JP
-msg_print("¥¦¥£¥¶¡¼¥É¡¦¥â¡¼¥É¤Ç¤Ï¥¹¥³¥¢¤¬µÏ¿¤µ¤ì¤Þ¤»¤ó¡£");
-#else
- msg_print("Score not registered for wizards.");
-#endif
-
+ msg_print(_("ウィザード・モードではスコアが記録されません。", "Score not registered for wizards."));
msg_print(NULL);
return FALSE;
}
/* Borg-mode pre-empts scoring */
if (p_ptr->noscore & 0x00F0)
{
-#ifdef JP
-msg_print("¥Ü¡¼¥°¡¦¥â¡¼¥É¤Ç¤Ï¥¹¥³¥¢¤¬µÏ¿¤µ¤ì¤Þ¤»¤ó¡£");
-#else
- msg_print("Score not registered for borgs.");
-#endif
-
+ msg_print(_("ボーグ・モードではスコアが記録されません。", "Score not registered for borgs."));
msg_print(NULL);
return FALSE;
}
/* Cheaters are not scored */
if (p_ptr->noscore & 0xFF00)
{
-#ifdef JP
-msg_print("º¾µ½¤ò¤ä¤Ã¤¿¿Í¤Ï¥¹¥³¥¢¤¬µÏ¿¤µ¤ì¤Þ¤»¤ó¡£");
-#else
- msg_print("Score not registered for cheaters.");
-#endif
-
+ msg_print(_("詐欺をやった人はスコアが記録されません。", "Score not registered for cheaters."));
msg_print(NULL);
return FALSE;
}
#endif
/* Interupted */
-#ifdef JP
-if (!p_ptr->total_winner && streq(p_ptr->died_from, "¶¯À©½ªÎ»"))
-#else
- if (!p_ptr->total_winner && streq(p_ptr->died_from, "Interrupting"))
-#endif
-
+ if (!p_ptr->total_winner && streq(p_ptr->died_from, _("強制終了", "Interrupting")))
{
-#ifdef JP
-msg_print("¶¯À©½ªÎ»¤Î¤¿¤á¥¹¥³¥¢¤¬µÏ¿¤µ¤ì¤Þ¤»¤ó¡£");
-#else
- msg_print("Score not registered due to interruption.");
-#endif
-
+ msg_print(_("強制終了のためスコアが記録されません。", "Score not registered due to interruption."));
msg_print(NULL);
return FALSE;
}
/* Quitter */
-#ifdef JP
-if (!p_ptr->total_winner && streq(p_ptr->died_from, "ÅÓÃ潪λ"))
-#else
- if (!p_ptr->total_winner && streq(p_ptr->died_from, "Quitting"))
-#endif
-
+ if (!p_ptr->total_winner && streq(p_ptr->died_from, _("途中終了", "Quitting")))
{
-#ifdef JP
-msg_print("ÅÓÃ潪λ¤Î¤¿¤á¥¹¥³¥¢¤¬µÏ¿¤µ¤ì¤Þ¤»¤ó¡£");
-#else
- msg_print("Score not registered due to quitting.");
-#endif
-
+ msg_print(_("途中終了のためスコアが記録されません。", "Score not registered due to quitting."));
msg_print(NULL);
return FALSE;
}
return TRUE;
}
-/*
+/*!
+ * @brief ゲーム終了処理 /
* Close up the current game (player may or may not be dead)
- *
+ * @return なし
+ * @details
+ * <pre>
* This function is called only from "main.c" and "signals.c".
+ * </pre>
*/
void close_game(void)
{
char buf[1024];
bool do_send = TRUE;
-/* cptr p = "[i:¥¥ã¥é¥¯¥¿¤Î¾ðÊó, f:¥Õ¥¡¥¤¥ë½ñ¤½Ð¤·, t:¥¹¥³¥¢, x:*´ÕÄê*, ESC:¥²¡¼¥à½ªÎ»]"; */
-
- /* Handle stuff */
+/* concptr p = "[i:キャラクタの情報, f:ファイル書き出し, t:スコア, x:*鑑定*, ESC:ゲーム終了]"; */
handle_stuff();
/* Flush the messages */
if (p_ptr->total_winner) kingly();
/* Save memories */
-#ifdef JP
- if (!cheat_save || get_check("»à¤ó¤À¥Ç¡¼¥¿¤ò¥»¡¼¥Ö¤·¤Þ¤¹¤«¡© "))
-#else
- if (!cheat_save || get_check("Save death? "))
-#endif
+ if (!cheat_save || get_check(_("死んだデータをセーブしますか? ", "Save death? ")))
{
-
-#ifdef JP
-if (!save_player()) msg_print("¥»¡¼¥Ö¼ºÇÔ¡ª");
-#else
- if (!save_player()) msg_print("death save failed!");
-#endif
+ if (!save_player()) msg_print(_("セーブ失敗!", "death save failed!"));
}
else do_send = FALSE;
/* Show more info */
show_info();
-
- /* Clear screen */
Term_clear();
if (check_score())
{
if ((!send_world_score(do_send)))
{
-#ifdef JP
- if (get_check_strict("¸å¤Ç¥¹¥³¥¢¤òÅÐÏ¿¤¹¤ë¤¿¤á¤ËÂÔµ¡¤·¤Þ¤¹¤«¡©", (CHECK_NO_ESCAPE | CHECK_NO_HISTORY)))
-#else
- if (get_check_strict("Stand by for later score registration? ", (CHECK_NO_ESCAPE | CHECK_NO_HISTORY)))
-#endif
+ if (get_check_strict(_("後でスコアを登録するために待機しますか?", "Stand by for later score registration? "),
+ (CHECK_NO_ESCAPE | CHECK_NO_HISTORY)))
{
p_ptr->wait_report_score = TRUE;
p_ptr->is_dead = FALSE;
-#ifdef JP
- if (!save_player()) msg_print("¥»¡¼¥Ö¼ºÇÔ¡ª");
-#else
- if (!save_player()) msg_print("death save failed!");
-#endif
+ if (!save_player()) msg_print(_("セーブ失敗!", "death save failed!"));
}
}
if (!p_ptr->wait_report_score)
/* Save the game */
do_cmd_save_game(FALSE);
- /* Prompt for scores XXX XXX XXX */
-#ifdef JP
-prt("¥ê¥¿¡¼¥ó¥¡¼¤« ESC ¥¡¼¤ò²¡¤·¤Æ²¼¤µ¤¤¡£", 0, 40);
-#else
- prt("Press Return (or Escape).", 0, 40);
-#endif
-
+ /* Prompt for scores */
+ prt(_("リターンキーか ESC キーを押して下さい。", "Press Return (or Escape)."), 0, 40);
+ play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_EXIT);
/* Predict score (or ESCAPE) */
if (inkey() != ESCAPE) predict_score();
}
-/*
+/*!
+ * @brief 異常発生時のゲーム緊急終了処理 /
* Handle abrupt death of the visual system
- *
+ * @return なし
+ * @details
+ * <pre>
* This routine is called only in very rare situations, and only
* by certain visual systems, when they experience fatal errors.
- *
* XXX XXX Hack -- clear the death flag when creating a HANGUP
* save file so that player can see tombstone when restart.
+ * </pre>
*/
void exit_game_panic(void)
{
/* If nothing important has happened, just quit */
-#ifdef JP
-if (!character_generated || character_saved) quit("¶ÛµÞ»öÂÖ");
-#else
- if (!character_generated || character_saved) quit("panic");
-#endif
-
+ if (!character_generated || character_saved) quit(_("緊急事態", "panic"));
/* Mega-Hack -- see "msg_print()" */
msg_flag = FALSE;
prt("", 0, 0);
/* Hack -- turn off some things */
- disturb(1, 0);
+ disturb(TRUE, TRUE);
/* Mega-Hack -- Delay death */
if (p_ptr->chp < 0) p_ptr->is_dead = FALSE;
signals_ignore_tstp();
/* Indicate panic save */
-#ifdef JP
-(void)strcpy(p_ptr->died_from, "(¶ÛµÞ¥»¡¼¥Ö)");
-#else
- (void)strcpy(p_ptr->died_from, "(panic save)");
-#endif
-
+ (void)strcpy(p_ptr->died_from, _("(緊急セーブ)", "(panic save)"));
/* Panic save, or get worried */
-#ifdef JP
-if (!save_player()) quit("¶ÛµÞ¥»¡¼¥Ö¼ºÇÔ¡ª");
-#else
- if (!save_player()) quit("panic save failed!");
-#endif
-
+ if (!save_player()) quit(_("緊急セーブ失敗!", "panic save failed!"));
/* Successful panic save */
-#ifdef JP
-quit("¶ÛµÞ¥»¡¼¥ÖÀ®¸ù¡ª");
-#else
- quit("panic save succeeded!");
-#endif
-
+ quit(_("緊急セーブ成功!", "panic save succeeded!"));
}
-/*
+/*!
+ * @brief ファイルからランダムに行を一つ取得する /
* Get a random line from a file
+ * @param file_name ファイル名
+ * @param entry 特定条件時のN:タグヘッダID
+ * @param output 出力先の文字列参照ポインタ
+ * @return エラーコード
+ * @details
+ * <pre>
* Based on the monster speech patch by Matt Graham,
+ * </pre>
*/
-errr get_rnd_line(cptr file_name, int entry, char *output)
+errr get_rnd_line(concptr file_name, int entry, char *output)
{
FILE *fp;
char buf[1024];
/* Copy the line */
if (one_in_(counter + 1)) strcpy(output, buf);
}
-
- /* Close the file */
my_fclose(fp);
/* Success */
#ifdef JP
-errr get_rnd_line_jonly(cptr file_name, int entry, char *output, int count)
+/*!
+ * @brief ファイルからランダムに行を一つ取得する(日本語文字列のみ) /
+ * @param file_name ファイル名
+ * @param entry 特定条件時のN:タグヘッダID
+ * @param output 出力先の文字列参照ポインタ
+ * @param count 試行回数
+ * @return エラーコード
+ * @details
+ */
+errr get_rnd_line_jonly(concptr file_name, int entry, char *output, int count)
{
int i, j, kanji;
errr result = 1;
}
#endif
-/*
- * Process file for auto picker/destroyer.
+/*!
+ * @brief 自動拾いファイルを読み込む /
+ * @param name ファイル名
+ * @details
*/
-errr process_pickpref_file(cptr name)
+errr process_autopick_file(concptr name)
{
char buf[1024];
/* Build the filename */
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, name);
- err = process_pref_file_aux(buf, PREF_TYPE_PICKPREF);
-
- /* Result */
+ err = process_pref_file_aux(buf, PREF_TYPE_AUTOPICK);
return (err);
}
-/*
+/*!
+ * @brief プレイヤーの生い立ちファイルを読み込む /
* Process file for player's history editor.
+ * @param name ファイル名
+ * @return エラーコード
+ * @details
*/
-errr process_histpref_file(cptr name)
+errr process_histpref_file(concptr name)
{
char buf[1024];
errr err = 0;
err = process_pref_file_aux(buf, PREF_TYPE_HISTPREF);
character_xtra = old_character_xtra;
-
- /* Result */
return (err);
}
-
+/*!
+ * @brief ファイル位置をシーク /
+ * @param fd ファイルディスクリプタ
+ * @param where ファイルバイト位置
+ * @param flag FALSEならば現ファイルを超えた位置へシーク時エラー、TRUEなら足りない間を0で埋め尽くす
+ * @return エラーコード
+ * @details
+ */
static errr counts_seek(int fd, u32b where, bool flag)
{
huge seekpoint;
return fd_seek(fd, seekpoint + where * sizeof(u32b));
}
+/*!
+ * @brief ファイル位置を読み込む
+ * @param where ファイルバイト位置
+ * @return エラーコード
+ * @details
+ */
u32b counts_read(int where)
{
int fd;
u32b count = 0;
char buf[1024];
-#ifdef JP
- path_build(buf, sizeof(buf), ANGBAND_DIR_DATA, "z_info_j.raw");
-#else
- path_build(buf, sizeof(buf), ANGBAND_DIR_DATA, "z_info.raw");
-#endif
+ path_build(buf, sizeof(buf), ANGBAND_DIR_DATA, _("z_info_j.raw", "z_info.raw"));
fd = fd_open(buf, O_RDONLY);
if (counts_seek(fd, where, FALSE) ||
return count;
}
+/*!
+ * @brief ファイル位置に書き込む /
+ * @param where ファイルバイト位置
+ * @param count 書き込む値
+ * @return エラーコード
+ * @details
+ */
errr counts_write(int where, u32b count)
{
int fd;
char buf[1024];
errr err;
-#ifdef JP
- path_build(buf, sizeof(buf), ANGBAND_DIR_DATA, "z_info_j.raw");
-#else
- path_build(buf, sizeof(buf), ANGBAND_DIR_DATA, "z_info.raw");
-#endif
+ path_build(buf, sizeof(buf), ANGBAND_DIR_DATA, _("z_info_j.raw", "z_info.raw"));
/* Grab permissions */
safe_setuid_grab();
/* File type is "DATA" */
FILE_TYPE(FILE_TYPE_DATA);
+ /* Grab permissions */
+ safe_setuid_grab();
+
/* Create a new high score file */
fd = fd_make(buf, 0644);
+
+ /* Drop permissions */
+ safe_setuid_drop();
}
/* Grab permissions */
#include <signal.h>
-/*
+/*!
+ * @brief OSからのシグナルを受けてサスペンド状態に入る /
* Handle signals -- suspend
- *
+ * @param sig 受け取ったシグナル
+ * @details
* Actually suspend the game, and then resume cleanly
*/
static void handle_signal_suspend(int sig)
}
-/*
+/*!
+ * @brief OSからのシグナルを受けて中断、終了する /
* Handle signals -- simple (interrupt and quit)
- *
+ * @param sig 受け取ったシグナル
+ * @details
+ * <pre>
* This function was causing a *huge* number of problems, so it has
* been simplified greatly. We keep a global variable which counts
* the number of times the user attempts to kill the process, and
* we commit suicide if the user does this a certain number of times.
- *
* We attempt to give "feedback" to the user as he approaches the
* suicide thresh-hold, but without penalizing accidental keypresses.
- *
* To prevent messy accidents, we should reset this global variable
* whenever the user enters a keypress, or something like that.
+ * </pre>
*/
static void handle_signal_simple(int sig)
{
if (p_ptr->is_dead)
{
/* Mark the savefile */
-#ifdef JP
-(void)strcpy(p_ptr->died_from, "¶¯À©½ªÎ»");
-#else
- (void)strcpy(p_ptr->died_from, "Abortion");
-#endif
+ (void)strcpy(p_ptr->died_from, _("強制終了", "Abortion"));
forget_lite();
forget_view();
close_game();
/* Quit */
-#ifdef JP
-quit("¶¯À©½ªÎ»");
-#else
- quit("interrupt");
-#endif
-
+ quit(_("強制終了", "interrupt"));
}
/* Allow suicide (after 5) */
else if (signal_count >= 5)
{
/* Cause of "death" */
-#ifdef JP
-(void)strcpy(p_ptr->died_from, "¶¯À©½ªÎ»Ãæ");
-#else
- (void)strcpy(p_ptr->died_from, "Interrupting");
-#endif
-
+ (void)strcpy(p_ptr->died_from, _("強制終了中", "Interrupting"));
forget_lite();
forget_view();
close_game();
/* Quit */
-#ifdef JP
-quit("¶¯À©½ªÎ»");
-#else
- quit("interrupt");
-#endif
-
+ quit(_("強制終了", "interrupt"));
}
/* Give warning (after 4) */
Term_erase(0, 0, 255);
/* Display the cause */
-#ifdef JP
-Term_putstr(0, 0, -1, TERM_WHITE, "½Ïθ¤Î¾å¤Î¼«»¦¡ª");
-#else
- Term_putstr(0, 0, -1, TERM_WHITE, "Contemplating suicide!");
-#endif
-
+ Term_putstr(0, 0, -1, TERM_WHITE, _("熟慮の上の自殺!", "Contemplating suicide!"));
- /* Flush */
Term_fresh();
}
}
-/*
+/*!
+ * @brief OSからのシグナルを受けて強制終了する /
* Handle signal -- abort, kill, etc
+ * @param sig 受け取ったシグナル
+ * @return なし
+ * @details
+ * <pre>
+ * This function was causing a *huge* number of problems, so it has
+ * been simplified greatly. We keep a global variable which counts
+ * the number of times the user attempts to kill the process, and
+ * we commit suicide if the user does this a certain number of times.
+ * We attempt to give "feedback" to the user as he approaches the
+ * suicide thresh-hold, but without penalizing accidental keypresses.
+ * To prevent messy accidents, we should reset this global variable
+ * whenever the user enters a keypress, or something like that.
+ * </pre>
*/
static void handle_signal_abort(int sig)
{
- int wid, hgt, rows;
+ int wid, hgt;
Term_get_size(&wid, &hgt);
- rows = hgt - 4;
/* Disable handler */
(void)signal(sig, SIG_IGN);
/* Give a warning */
Term_putstr(0, hgt - 1, -1, TERM_RED,
-#ifdef JP
-"¶²¤í¤·¤¤¥½¥Õ¥È¤Î¥Ð¥°¤¬Èô¤Ó¤«¤«¤Ã¤Æ¤¤¿¡ª");
-#else
- "A gruesome software bug LEAPS out at you!");
-#endif
+ _("恐ろしいソフトのバグが飛びかかってきた!", "A gruesome software bug LEAPS out at you!"));
- /* Message */
-#ifdef JP
-Term_putstr(45, hgt - 1, -1, TERM_RED, "¶ÛµÞ¥»¡¼¥Ö...");
-#else
- Term_putstr(45, hgt - 1, -1, TERM_RED, "Panic save...");
-#endif
+ Term_putstr(45, hgt - 1, -1, TERM_RED, _("緊急セーブ...", "Panic save..."));
+ do_cmd_write_nikki(NIKKI_GAMESTART, 0, _("----ゲーム異常終了----", "---- Panic Save and Abort Game ----"));
/* Flush output */
Term_fresh();
p_ptr->panic_save = 1;
/* Panic save */
-#ifdef JP
-(void)strcpy(p_ptr->died_from, "(¶ÛµÞ¥»¡¼¥Ö)");
-#else
- (void)strcpy(p_ptr->died_from, "(panic save)");
-#endif
-
+ (void)strcpy(p_ptr->died_from, _("(緊急セーブ)", "(panic save)"));
/* Forbid suspend */
signals_ignore_tstp();
/* Attempt to save */
if (save_player())
{
-#ifdef JP
-Term_putstr(45, hgt - 1, -1, TERM_RED, "¶ÛµÞ¥»¡¼¥ÖÀ®¸ù¡ª");
-#else
- Term_putstr(45, hgt - 1, -1, TERM_RED, "Panic save succeeded!");
-#endif
-
+ Term_putstr(45, hgt - 1, -1, TERM_RED, _("緊急セーブ成功!", "Panic save succeeded!"));
}
/* Save failed */
else
{
-#ifdef JP
-Term_putstr(45, hgt - 1, -1, TERM_RED, "¶ÛµÞ¥»¡¼¥Ö¼ºÇÔ¡ª");
-#else
- Term_putstr(45, hgt - 1, -1, TERM_RED, "Panic save failed!");
-#endif
-
+ Term_putstr(45, hgt - 1, -1, TERM_RED, _("緊急セーブ失敗!", "Panic save failed!"));
}
/* Flush output */
Term_fresh();
/* Quit */
-#ifdef JP
-quit("¥½¥Õ¥È¤Î¥Ð¥°");
-#else
- quit("software bug");
-#endif
-
+ quit(_("ソフトのバグ", "software bug"));
}
-
-
-
-/*
+/*!
+ * @brief OSからのSIGTSTPシグナルを無視する関数 /
* Ignore SIGTSTP signals (keyboard suspend)
+ * @return なし
+ * @details
*/
void signals_ignore_tstp(void)
{
}
-/*
+/*!
+ * @brief OSからのSIGTSTPシグナルハンドラ /
* Handle SIGTSTP signals (keyboard suspend)
+ * @return なし
+ * @details
*/
void signals_handle_tstp(void)
{
}
-/*
+/*!
+ * @brief OSからのシグナルハンドルを初期化する /
* Prepare to handle the relevant signals
+ * @return なし
+ * @details
*/
void signals_init(void)
{
#else /* HANDLE_SIGNALS */
-/*
+/*!
+ * @brief ダミー /
* Do nothing
*/
void signals_ignore_tstp(void)
{
}
-/*
+/*!
+ * @brief ダミー /
* Do nothing
*/
void signals_handle_tstp(void)
{
}
-/*
+/*!
+ * @brief ダミー /
* Do nothing
*/
void signals_init(void)