* Hack -- take notes on line 23
* @return なし
*/
-static void note(concptr str)
+static void init_note(concptr str)
{
Term_erase(0, 23, 255);
Term_putstr(20, 23, -1, TERM_WHITE, str);
/*** Initialize some arrays ***/
/* Initialize misc. values */
- note(_("[変数を初期化しています...(その他)", "[Initializing values... (misc)]"));
+ init_note(_("[変数を初期化しています...(その他)", "[Initializing values... (misc)]"));
if (init_misc(player_ptr)) quit(_("その他の変数を初期化できません", "Cannot initialize misc. values"));
/* Initialize feature info */
#ifdef JP
- note("[データの初期化中... (地形)]");
+ init_note("[データの初期化中... (地形)]");
if (init_f_info(player_ptr)) quit("地形初期化不能");
if (init_feat_variables()) quit("地形初期化不能");
#else
#endif
/* Initialize object info */
- note(_("[データの初期化中... (アイテム)]", "[Initializing arrays... (objects)]"));
+ init_note(_("[データの初期化中... (アイテム)]", "[Initializing arrays... (objects)]"));
if (init_k_info(player_ptr)) quit(_("アイテム初期化不能", "Cannot initialize objects"));
/* Initialize artifact info */
- note(_("[データの初期化中... (伝説のアイテム)]", "[Initializing arrays... (artifacts)]"));
+ init_note(_("[データの初期化中... (伝説のアイテム)]", "[Initializing arrays... (artifacts)]"));
if (init_a_info(player_ptr)) quit(_("伝説のアイテム初期化不能", "Cannot initialize artifacts"));
/* Initialize ego-item info */
- note(_("[データの初期化中... (名のあるアイテム)]", "[Initializing arrays... (ego-items)]"));
+ init_note(_("[データの初期化中... (名のあるアイテム)]", "[Initializing arrays... (ego-items)]"));
if (init_e_info(player_ptr)) quit(_("名のあるアイテム初期化不能", "Cannot initialize ego-items"));
/* Initialize monster info */
- note(_("[データの初期化中... (モンスター)]", "[Initializing arrays... (monsters)]"));
+ init_note(_("[データの初期化中... (モンスター)]", "[Initializing arrays... (monsters)]"));
if (init_r_info(player_ptr)) quit(_("モンスター初期化不能", "Cannot initialize monsters"));
/* Initialize dungeon info */
- note(_("[データの初期化中... (ダンジョン)]", "[Initializing arrays... (dungeon)]"));
+ init_note(_("[データの初期化中... (ダンジョン)]", "[Initializing arrays... (dungeon)]"));
if (init_d_info(player_ptr)) quit(_("ダンジョン初期化不能", "Cannot initialize dungeon"));
{
for (int i = 1; i < current_world_ptr->max_d_idx; i++)
}
/* Initialize magic info */
- note(_("[データの初期化中... (魔法)]", "[Initializing arrays... (magic)]"));
+ init_note(_("[データの初期化中... (魔法)]", "[Initializing arrays... (magic)]"));
if (init_m_info(player_ptr)) quit(_("魔法初期化不能", "Cannot initialize magic"));
/* Initialize weapon_exp info */
- note(_("[データの初期化中... (熟練度)]", "[Initializing arrays... (skill)]"));
+ init_note(_("[データの初期化中... (熟練度)]", "[Initializing arrays... (skill)]"));
if (init_s_info(player_ptr)) quit(_("熟練度初期化不能", "Cannot initialize skill"));
/* Initialize wilderness array */
- note(_("[配列を初期化しています... (荒野)]", "[Initializing arrays... (wilderness)]"));
+ init_note(_("[配列を初期化しています... (荒野)]", "[Initializing arrays... (wilderness)]"));
if (init_wilderness()) quit(_("荒野を初期化できません", "Cannot initialize wilderness"));
/* Initialize town array */
- note(_("[配列を初期化しています... (街)]", "[Initializing arrays... (towns)]"));
+ init_note(_("[配列を初期化しています... (街)]", "[Initializing arrays... (towns)]"));
if (init_towns()) quit(_("街を初期化できません", "Cannot initialize towns"));
/* Initialize building array */
- note(_("[配列を初期化しています... (建物)]", "[Initializing arrays... (buildings)]"));
+ init_note(_("[配列を初期化しています... (建物)]", "[Initializing arrays... (buildings)]"));
if (init_buildings()) quit(_("建物を初期化できません", "Cannot initialize buildings"));
/* Initialize quest array */
- note(_("[配列を初期化しています... (クエスト)]", "[Initializing arrays... (quests)]"));
+ init_note(_("[配列を初期化しています... (クエスト)]", "[Initializing arrays... (quests)]"));
if (init_quests()) quit(_("クエストを初期化できません", "Cannot initialize quests"));
/* Initialize vault info */
if (init_v_info(player_ptr)) quit(_("vault 初期化不能", "Cannot initialize vaults"));
/* Initialize some other arrays */
- note(_("[データの初期化中... (その他)]", "[Initializing arrays... (other)]"));
+ init_note(_("[データの初期化中... (その他)]", "[Initializing arrays... (other)]"));
if (init_other(player_ptr)) quit(_("その他のデータ初期化不能", "Cannot initialize other stuff"));
/* Initialize some other arrays */
- note(_("[データの初期化中... (アロケーション)]", "[Initializing arrays... (alloc)]"));
+ init_note(_("[データの初期化中... (アロケーション)]", "[Initializing arrays... (alloc)]"));
if (init_alloc()) quit(_("アロケーション・スタッフ初期化不能", "Cannot initialize alloc stuff"));
/*** Load default user pref files ***/
/* Initialize feature info */
- note(_("[ユーザー設定ファイルを初期化しています...]", "[Initializing user pref files...]"));
+ init_note(_("[ユーザー設定ファイルを初期化しています...]", "[Initializing user pref files...]"));
/* Access the "basic" pref file */
strcpy(buf, "pref.prf");
/* Process that file */
process_pref_file(player_ptr, buf, process_autopick_file_command);
- note(_("[初期化終了]", "[Initialization complete]"));
+ init_note(_("[初期化終了]", "[Initialization complete]"));
}
/* Old hidden trap flag */
static const BIT_FLAGS CAVE_TRAP = 0x8000;
-/* Old quests */
-#define OLD_QUEST_WATER_CAVE 18
+static const int OLD_QUEST_WATER_CAVE = 18; // 湖の洞窟.
+static const int QUEST_OLD_CASTLE = 27; // 古い城.
+static const int QUEST_ROYAL_CRYPT = 28; // 王家の墓.
-/* Quest constants */
-#define QUEST_OLD_CASTLE 27
-#define QUEST_ROYAL_CRYPT 28
+static FILE *loading_savefile;
-/*
- * Local "savefile" pointer
- */
-static FILE *fff;
-
-/*
- * Hack -- old "encryption" byte
- */
-static byte xor_byte;
+/* Old "encryption" byte */
+static byte load_xor_byte;
-/*
- * Hack -- simple "checksum" on the actual values
- */
+/* Simple "checksum" on the actual values */
static u32b v_check = 0L;
-/*
- * Hack -- simple "checksum" on the encoded bytes
- */
+/* Simple "checksum" on the encoded bytes */
static u32b x_check = 0L;
/*
- * Hack -- Japanese Kanji code
+ * Japanese Kanji code
* 0: Unknown
* 1: ASCII
* 2: EUC
* @details
* Avoid the top two lines, to avoid interference with "msg_print()".
*/
-static void note(concptr msg)
+static void load_note(concptr msg)
{
static TERM_LEN y = 2;
prt(msg, y, 0);
*/
static byte sf_get(void)
{
- byte c = getc(fff) & 0xFF;
- byte v = c ^ xor_byte;
- xor_byte = c;
+ byte c = getc(loading_savefile) & 0xFF;
+ byte v = c ^ load_xor_byte;
+ load_xor_byte = c;
v_check += v;
- x_check += xor_byte;
+ x_check += load_xor_byte;
return v;
}
}
/*!
- * @brief アイテムオブジェクト1件を読み込む(変愚ver1.5.0以前) / Read an object (Old method)
+ * @brief アイテムオブジェクト1件を読み込む(変愚ver1.5.0以前) / Read an object (Old method)
* @param o_ptr アイテムオブジェクト読み取り先ポインタ
* @return なし
* @details
}
if (player_ptr->inven_cnt == INVEN_PACK) {
- note(_("持ち物の中のアイテムが多すぎる!", "Too many items in the inventory"));
+ load_note(_("持ち物の中のアイテムが多すぎる!", "Too many items in the inventory"));
return (54);
}
u16b limit;
rd_u16b(&limit);
if (limit > current_world_ptr->max_o_idx) {
- note(format(_("アイテムの配列が大きすぎる(%d)!", "Too many (%d) object entries!"), limit));
+ load_note(format(_("アイテムの配列が大きすぎる(%d)!", "Too many (%d) object entries!"), limit));
return (151);
}
for (int i = 1; i < limit; i++) {
OBJECT_IDX o_idx = o_pop(floor_ptr);
if (i != o_idx) {
- note(format(_("アイテム配置エラー (%d <> %d)", "Object allocation error (%d <> %d)"), i, o_idx));
+ load_note(format(_("アイテム配置エラー (%d <> %d)", "Object allocation error (%d <> %d)"), i, o_idx));
return (152);
}
rd_u16b(&limit);
if (limit > current_world_ptr->max_m_idx) {
- note(format(_("モンスターの配列が大きすぎる(%d)!", "Too many (%d) monster entries!"), limit));
+ load_note(format(_("モンスターの配列が大きすぎる(%d)!", "Too many (%d) monster entries!"), limit));
return (161);
}
monster_type *m_ptr;
m_idx = m_pop(floor_ptr);
if (i != m_idx) {
- note(format(_("モンスター配置エラー (%d <> %d)", "Monster allocation error (%d <> %d)"), i, m_idx));
+ load_note(format(_("モンスター配置エラー (%d <> %d)", "Monster allocation error (%d <> %d)"), i, m_idx));
return (162);
}
switch (err) {
case 151:
- note(_("アイテムの配列が大きすぎる!", "Too many object entries!"));
+ load_note(_("アイテムの配列が大きすぎる!", "Too many object entries!"));
break;
case 152:
- note(_("アイテム配置エラー", "Object allocation error"));
+ load_note(_("アイテム配置エラー", "Object allocation error"));
break;
case 161:
- note(_("モンスターの配列が大きすぎる!", "Too many monster entries!"));
+ load_note(_("モンスターの配列が大きすぎる!", "Too many monster entries!"));
break;
case 162:
- note(_("モンスター配置エラー", "Monster allocation error"));
+ load_note(_("モンスター配置エラー", "Monster allocation error"));
break;
case 171:
- note(_("保存されたフロアのダンジョンデータが壊れています!", "Dungeon data of saved floors are broken!"));
+ load_note(_("保存されたフロアのダンジョンデータが壊れています!", "Dungeon data of saved floors are broken!"));
break;
case 182:
- note(_("テンポラリ・ファイルを作成できません!", "Failed to make temporary files!"));
+ load_note(_("テンポラリ・ファイルを作成できません!", "Failed to make temporary files!"));
break;
case 183:
- note(_("Error 183", "Error 183"));
+ load_note(_("Error 183", "Error 183"));
break;
}
u32b o_x_check, o_v_check;
strip_bytes(4);
- xor_byte = current_world_ptr->sf_extra;
+ load_xor_byte = current_world_ptr->sf_extra;
v_check = 0L;
x_check = 0L;
rd_byte(¤t_world_ptr->h_ver_minor);
rd_byte(¤t_world_ptr->h_ver_major);
- note(format(_("バージョン %d.%d.%d.%d のセーブ・ファイルをロード中...", "Loading a %d.%d.%d.%d savefile..."),
+ load_note(format(_("バージョン %d.%d.%d.%d のセーブ・ファイルをロード中...", "Loading a %d.%d.%d.%d savefile..."),
(current_world_ptr->h_ver_major > 9) ? current_world_ptr->h_ver_major - 10 : current_world_ptr->h_ver_major, current_world_ptr->h_ver_minor,
current_world_ptr->h_ver_patch, current_world_ptr->h_ver_extra));
rd_randomizer();
if (arg_fiddle)
- note(_("乱数情報をロードしました", "Loaded Randomizer Info"));
+ load_note(_("乱数情報をロードしました", "Loaded Randomizer Info"));
rd_options();
if (arg_fiddle)
- note(_("オプションをロードしました", "Loaded Option Flags"));
+ load_note(_("オプションをロードしました", "Loaded Option Flags"));
rd_messages();
if (arg_fiddle)
- note(_("メッセージをロードしました", "Loaded Messages"));
+ load_note(_("メッセージをロードしました", "Loaded Messages"));
/* ランダムクエストのモンスターを確定するために試行する回数 / Maximum number of tries for selection of a proper quest monster */
const int MAX_TRIES = 100;
rd_u16b(&tmp16u);
if (tmp16u > max_r_idx) {
- note(format(_("モンスターの種族が多すぎる(%u)!", "Too many (%u) monster races!"), tmp16u));
+ load_note(format(_("モンスターの種族が多すぎる(%u)!", "Too many (%u) monster races!"), tmp16u));
return (21);
}
}
if (arg_fiddle)
- note(_("モンスターの思い出をロードしました", "Loaded Monster Memory"));
+ load_note(_("モンスターの思い出をロードしました", "Loaded Monster Memory"));
rd_u16b(&tmp16u);
if (tmp16u > max_k_idx) {
- note(format(_("アイテムの種類が多すぎる(%u)!", "Too many (%u) object kinds!"), tmp16u));
+ load_note(format(_("アイテムの種類が多すぎる(%u)!", "Too many (%u) object kinds!"), tmp16u));
return (22);
}
k_ptr->tried = (tmp8u & 0x02) ? TRUE : FALSE;
}
if (arg_fiddle)
- note(_("アイテムの記録をロードしました", "Loaded Object Memory"));
+ load_note(_("アイテムの記録をロードしました", "Loaded Object Memory"));
/* 2.1.3 or newer version */
{
rd_u16b(&max_towns_load);
if (max_towns_load > max_towns) {
- note(format(_("町が多すぎる(%u)!", "Too many (%u) towns!"), max_towns_load));
+ load_note(format(_("町が多すぎる(%u)!", "Too many (%u) towns!"), max_towns_load));
return (23);
}
}
if (max_quests_load > max_q_idx) {
- note(format(_("クエストが多すぎる(%u)!", "Too many (%u) quests!"), max_quests_load));
+ load_note(format(_("クエストが多すぎる(%u)!", "Too many (%u) quests!"), max_quests_load));
return (23);
}
rd_s32b(&wild_y_size);
if ((wild_x_size > current_world_ptr->max_wild_x) || (wild_y_size > current_world_ptr->max_wild_y)) {
- note(format(_("荒野が大きすぎる(%u/%u)!", "Wilderness is too big (%u/%u)!"), wild_x_size, wild_y_size));
+ load_note(format(_("荒野が大きすぎる(%u/%u)!", "Wilderness is too big (%u/%u)!"), wild_x_size, wild_y_size));
return (23);
}
}
if (arg_fiddle)
- note(_("クエスト情報をロードしました", "Loaded Quests"));
+ load_note(_("クエスト情報をロードしました", "Loaded Quests"));
rd_u16b(&tmp16u);
if (tmp16u > max_a_idx) {
- note(format(_("伝説のアイテムが多すぎる(%u)!", "Too many (%u) artifacts!"), tmp16u));
+ load_note(format(_("伝説のアイテムが多すぎる(%u)!", "Too many (%u) artifacts!"), tmp16u));
return (24);
}
}
if (arg_fiddle)
- note(_("伝説のアイテムをロードしました", "Loaded Artifacts"));
+ load_note(_("伝説のアイテムをロードしました", "Loaded Artifacts"));
rd_extra(creature_ptr);
if (creature_ptr->energy_need < -999)
creature_ptr->timewalk = TRUE;
if (arg_fiddle)
- note(_("特別情報をロードしました", "Loaded extra information"));
+ load_note(_("特別情報をロードしました", "Loaded extra information"));
rd_u16b(&tmp16u);
if (tmp16u > PY_MAX_LEVEL) {
- note(format(_("ヒットポイント配列が大きすぎる(%u)!", "Too many (%u) hitpoint entries!"), tmp16u));
+ load_note(format(_("ヒットポイント配列が大きすぎる(%u)!", "Too many (%u) hitpoint entries!"), tmp16u));
return (25);
}
}
if (rd_inventory(creature_ptr)) {
- note(_("持ち物情報を読み込むことができません", "Unable to read inventory"));
+ load_note(_("持ち物情報を読み込むことができません", "Unable to read inventory"));
return (21);
}
}
if (!creature_ptr->is_dead) {
- note(_("ダンジョン復元中...", "Restoring Dungeon..."));
+ load_note(_("ダンジョン復元中...", "Restoring Dungeon..."));
if (rd_dungeon(creature_ptr)) {
- note(_("ダンジョンデータ読み込み失敗", "Error reading dungeon data"));
+ load_note(_("ダンジョンデータ読み込み失敗", "Error reading dungeon data"));
return (34);
}
n_v_check = v_check;
rd_u32b(&o_v_check);
if (o_v_check != n_v_check) {
- note(_("チェックサムがおかしい", "Invalid checksum"));
+ load_note(_("チェックサムがおかしい", "Invalid checksum"));
return 11;
}
n_x_check = x_check;
rd_u32b(&o_x_check);
if (o_x_check != n_x_check) {
- note(_("エンコードされたチェックサムがおかしい", "Invalid encoded checksum"));
+ load_note(_("エンコードされたチェックサムがおかしい", "Invalid encoded checksum"));
return 11;
}
errr rd_savefile_new(player_type *player_ptr)
{
safe_setuid_grab(player_ptr);
- fff = angband_fopen(savefile, "rb");
+ loading_savefile = angband_fopen(savefile, "rb");
safe_setuid_drop();
- if (!fff)
+ if (!loading_savefile)
return -1;
errr err = rd_savefile_new_aux(player_ptr);
- if (ferror(fff))
+ if (ferror(loading_savefile))
err = -1;
- angband_fclose(fff);
+ angband_fclose(loading_savefile);
return err;
}
u32b n_x_check, n_v_check;
u32b o_x_check, o_v_check;
- xor_byte = 0;
+ load_xor_byte = 0;
byte tmp8u;
rd_byte(&tmp8u);
byte old_h_ver_patch = 0;
byte old_h_ver_extra = 0;
if (mode & SLF_SECOND) {
- old_fff = fff;
- old_xor_byte = xor_byte;
+ old_fff = loading_savefile;
+ old_xor_byte = load_xor_byte;
old_v_check = v_check;
old_x_check = x_check;
old_h_ver_major = current_world_ptr->h_ver_major;
sprintf(floor_savefile, "%s.F%02d", savefile, (int)sf_ptr->savefile_id);
safe_setuid_grab(player_ptr);
- fff = angband_fopen(floor_savefile, "rb");
+ loading_savefile = angband_fopen(floor_savefile, "rb");
safe_setuid_drop();
bool is_save_successful = TRUE;
- if (!fff)
+ if (!loading_savefile)
is_save_successful = FALSE;
if (is_save_successful) {
is_save_successful = load_floor_aux(player_ptr, sf_ptr);
- if (ferror(fff))
+ if (ferror(loading_savefile))
is_save_successful = FALSE;
- angband_fclose(fff);
+ angband_fclose(loading_savefile);
safe_setuid_grab(player_ptr);
if (!(mode & SLF_NO_KILL))
}
if (mode & SLF_SECOND) {
- fff = old_fff;
- xor_byte = old_xor_byte;
+ loading_savefile = old_fff;
+ load_xor_byte = old_xor_byte;
v_check = old_v_check;
x_check = old_x_check;
current_world_ptr->h_ver_major = old_h_ver_major;
* Some "local" parameters, used to help write savefiles
*/
-static FILE *fff; /* Current save "file" */
-static byte xor_byte; /* Simple encryption */
+static FILE *saving_savefile; /* Current save "file" */
+static byte save_xor_byte; /* Simple encryption */
static u32b v_stamp = 0L; /* A simple "checksum" on the actual values */
static u32b x_stamp = 0L; /* A simple "checksum" on the encoded bytes */
static void sf_put(byte v)
{
/* Encode the value, write a character */
- xor_byte ^= v;
- (void)putc((int)xor_byte, fff);
+ save_xor_byte ^= v;
+ (void)putc((int)save_xor_byte, saving_savefile);
/* Maintain the checksum info */
v_stamp += v;
- x_stamp += xor_byte;
+ x_stamp += save_xor_byte;
}
/*!
/*** Actually write the file ***/
/* Dump the file header */
- xor_byte = 0;
+ save_xor_byte = 0;
wr_byte(FAKE_VER_MAJOR);
- xor_byte = 0;
+ save_xor_byte = 0;
wr_byte(FAKE_VER_MINOR);
- xor_byte = 0;
+ save_xor_byte = 0;
wr_byte(FAKE_VER_PATCH);
- xor_byte = 0;
+ save_xor_byte = 0;
/* Initial value of xor_byte */
byte tmp8u = (byte)Rand_external(256);
/* Write the "encoded checksum" */
wr_u32b(x_stamp);
- if (ferror(fff) || (fflush(fff) == EOF))
+ if (ferror(saving_savefile) || (fflush(saving_savefile) == EOF))
return FALSE;
return TRUE;
}
safe_setuid_drop();
bool is_save_successful = FALSE;
- fff = NULL;
+ saving_savefile = NULL;
if (fd >= 0) {
/* Close the "fd" */
(void)fd_close(fd);
safe_setuid_grab(player_ptr);
/* Open the savefile */
- fff = angband_fopen(name, "wb");
+ saving_savefile = angband_fopen(name, "wb");
/* Drop permissions */
safe_setuid_drop();
/* Successful open */
- if (fff) {
+ if (saving_savefile) {
/* Write the savefile */
if (wr_savefile_new(player_ptr))
is_save_successful = TRUE;
/* Attempt to close it */
- if (angband_fclose(fff))
+ if (angband_fclose(saving_savefile))
is_save_successful = FALSE;
}
/*** Actually write the file ***/
/* Initial value of xor_byte */
byte tmp8u = (byte)randint0(256);
- xor_byte = 0;
+ save_xor_byte = 0;
wr_byte(tmp8u);
/* Reset the checksum */
/* Write the "encoded checksum" */
wr_u32b(x_stamp);
- if (ferror(fff) || (fflush(fff) == EOF))
+ if (ferror(saving_savefile) || (fflush(saving_savefile) == EOF))
return FALSE;
return TRUE;
}
/* We have one file already opened */
else {
/* Backup original values */
- old_fff = fff;
- old_xor_byte = xor_byte;
+ old_fff = saving_savefile;
+ old_xor_byte = save_xor_byte;
old_v_stamp = v_stamp;
old_x_stamp = x_stamp;
}
/* Attempt to save the player */
/* No file yet */
- fff = NULL;
+ saving_savefile = NULL;
/* Grab permissions */
safe_setuid_grab(player_ptr);
safe_setuid_grab(player_ptr);
/* Open the savefile */
- fff = angband_fopen(floor_savefile, "wb");
+ saving_savefile = angband_fopen(floor_savefile, "wb");
/* Drop permissions */
safe_setuid_drop();
/* Successful open */
- if (fff) {
+ if (saving_savefile) {
/* Write the savefile */
if (save_floor_aux(player_ptr, sf_ptr))
is_save_successful = TRUE;
/* Attempt to close it */
- if (angband_fclose(fff))
+ if (angband_fclose(saving_savefile))
is_save_successful = FALSE;
}
/* We have one file already opened */
else {
/* Restore original values */
- fff = old_fff;
- xor_byte = old_xor_byte;
+ saving_savefile = old_fff;
+ save_xor_byte = old_xor_byte;
v_stamp = old_v_stamp;
x_stamp = old_x_stamp;
}
/*
* The spoiler file being created
*/
-static FILE *fff = NULL;
+static FILE *spoiler_file = NULL;
/*!
* @brief シンボル職の記述名を返す /
char dam[80];
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
- fff = angband_fopen(buf, "w");
+ spoiler_file = angband_fopen(buf, "w");
- if (!fff) {
+ if (!spoiler_file) {
msg_print("Cannot create spoiler file.");
return;
}
- fprintf(fff, "Spoiler File -- Basic Items (Hengband %d.%d.%d.%d)\n\n\n", FAKE_VER_MAJOR - 10, FAKE_VER_MINOR, FAKE_VER_PATCH, FAKE_VER_EXTRA);
- fprintf(fff, "%-37s%8s%7s%5s %40s%9s\n", "Description", "Dam/AC", "Wgt", "Lev", "Chance", "Cost");
- fprintf(fff, "%-37s%8s%7s%5s %40s%9s\n", "-------------------------------------", "------", "---", "---", "----------------", "----");
+ fprintf(spoiler_file, "Spoiler File -- Basic Items (Hengband %d.%d.%d.%d)\n\n\n", FAKE_VER_MAJOR - 10, FAKE_VER_MINOR, FAKE_VER_PATCH, FAKE_VER_EXTRA);
+ fprintf(spoiler_file, "%-37s%8s%7s%5s %40s%9s\n", "Description", "Dam/AC", "Wgt", "Lev", "Chance", "Cost");
+ fprintf(spoiler_file, "%-37s%8s%7s%5s %40s%9s\n", "-------------------------------------", "------", "---", "---", "----------------", "----");
for (i = 0; TRUE; i++) {
if (group_item[i].name) {
if (n) {
}
}
- fprintf(fff, "\n\n%s\n\n", group_item[group_start].name);
+ fprintf(spoiler_file, "\n\n%s\n\n", group_item[group_start].name);
for (s = 0; s < n; s++) {
DEPTH e;
PRICE v;
kind_info(player_ptr, buf, dam, wgt, chance, &e, &v, who[s]);
- fprintf(fff, " %-35s%8s%7s%5d %-40s%9ld\n", buf, dam, wgt, (int)e, chance, (long)(v));
+ fprintf(spoiler_file, " %-35s%8s%7s%5d %-40s%9ld\n", buf, dam, wgt, (int)e, chance, (long)(v));
}
n = 0;
}
}
- if (ferror(fff) || angband_fclose(fff)) {
+ if (ferror(spoiler_file) || angband_fclose(spoiler_file)) {
msg_print("Cannot close spoiler file.");
return;
}
static void spoiler_out_n_chars(int n, char c)
{
while (--n >= 0)
- fputc(c, fff);
+ fputc(c, spoiler_file);
}
/*!
*/
static void spoiler_underline(concptr str)
{
- fprintf(fff, "%s\n", str);
+ fprintf(spoiler_file, "%s\n", str);
spoiler_out_n_chars(strlen(str), '-');
- fprintf(fff, "\n");
+ fprintf(spoiler_file, "\n");
}
/*!
} else {
if (line_len > 1 && line[line_len - 1] == ' ' && line[line_len - 2] == LIST_SEP) {
line[line_len - 2] = '\0';
- fprintf(fff, "%s\n", line);
+ fprintf(spoiler_file, "%s\n", line);
sprintf(line, "%s%s", INDENT1, buf);
} else {
- fprintf(fff, "%s\n", line);
+ fprintf(spoiler_file, "%s\n", line);
sprintf(line, "%s%s", INDENT2, buf);
}
break;
}
- fprintf(fff, "%s\n", line);
+ fprintf(spoiler_file, "%s\n", line);
}
/*!
{
pval_info_type *pval_ptr = &art_ptr->pval_info;
char buf[80];
- fprintf(fff, "%s\n", art_ptr->description);
+ fprintf(spoiler_file, "%s\n", art_ptr->description);
if (pval_ptr->pval_desc[0]) {
sprintf(buf, _("%sの修正:", "%s to"), pval_ptr->pval_desc);
spoiler_outlist(buf, pval_ptr->pval_affects, ITEM_SEP);
spoiler_outlist("", art_ptr->misc_magic, LIST_SEP);
if (art_ptr->addition[0])
- fprintf(fff, _("%s追加: %s\n", "%sAdditional %s\n"), INDENT1, art_ptr->addition);
+ fprintf(spoiler_file, _("%s追加: %s\n", "%sAdditional %s\n"), INDENT1, art_ptr->addition);
if (art_ptr->activation)
- fprintf(fff, _("%s発動: %s\n", "%sActivates for %s\n"), INDENT1, art_ptr->activation);
+ fprintf(spoiler_file, _("%s発動: %s\n", "%sActivates for %s\n"), INDENT1, art_ptr->activation);
- fprintf(fff, "%s%s\n\n", INDENT1, art_ptr->misc_desc);
+ fprintf(spoiler_file, "%s%s\n\n", INDENT1, art_ptr->misc_desc);
}
/*!
char buf[1024];
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
- fff = angband_fopen(buf, "w");
+ spoiler_file = angband_fopen(buf, "w");
- if (!fff) {
+ if (!spoiler_file) {
msg_print("Cannot create spoiler file.");
return;
}
}
}
- if (ferror(fff) || angband_fclose(fff)) {
+ if (ferror(spoiler_file) || angband_fclose(spoiler_file)) {
msg_print("Cannot close spoiler file.");
return;
}
char hp[80];
char exp[80];
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
- fff = angband_fopen(buf, "w");
- if (!fff) {
+ spoiler_file = angband_fopen(buf, "w");
+ if (!spoiler_file) {
msg_print("Cannot create spoiler file.");
return;
}
C_MAKE(who, max_r_idx, MONRACE_IDX);
- fprintf(fff, "Monster Spoilers for Hengband Version %d.%d.%d\n", FAKE_VER_MAJOR - 10, FAKE_VER_MINOR, FAKE_VER_PATCH);
- fprintf(fff, "------------------------------------------\n\n");
- fprintf(fff, " %-38.38s%4s%4s%4s%7s%5s %11.11s\n", "Name", "Lev", "Rar", "Spd", "Hp", "Ac", "Visual Info");
- fprintf(fff, "%-42.42s%4s%4s%4s%7s%5s %11.11s\n", "--------", "---", "---", "---", "--", "--", "-----------");
+ fprintf(spoiler_file, "Monster Spoilers for Hengband Version %d.%d.%d\n", FAKE_VER_MAJOR - 10, FAKE_VER_MINOR, FAKE_VER_PATCH);
+ fprintf(spoiler_file, "------------------------------------------\n\n");
+ fprintf(spoiler_file, " %-38.38s%4s%4s%4s%7s%5s %11.11s\n", "Name", "Lev", "Rar", "Spd", "Hp", "Ac", "Visual Info");
+ fprintf(spoiler_file, "%-42.42s%4s%4s%4s%7s%5s %11.11s\n", "--------", "---", "---", "---", "--", "--", "-----------");
for (i = 1; i < max_r_idx; i++) {
monster_race *r_ptr = &r_info[i];
if (r_ptr->name)
sprintf(exp, "%ld", (long)(r_ptr->mexp));
sprintf(exp, "%s '%c'", attr_to_text(r_ptr), r_ptr->d_char);
- fprintf(fff, "%-42.42s%4s%4s%4s%7s%5s %11.11s\n", nam, lev, rar, spd, hp, ac, exp);
+ fprintf(spoiler_file, "%-42.42s%4s%4s%4s%7s%5s %11.11s\n", nam, lev, rar, spd, hp, ac, exp);
}
- fprintf(fff, "\n");
+ fprintf(spoiler_file, "\n");
C_KILL(who, max_r_idx, s16b);
- if (ferror(fff) || angband_fclose(fff)) {
+ if (ferror(spoiler_file) || angband_fclose(spoiler_file)) {
msg_print("Cannot close spoiler file.");
return;
}
static bool waiting_output = FALSE;
if (!str) {
if (waiting_output) {
- fputs(roff_waiting_buf, fff);
+ fputs(roff_waiting_buf, spoiler_file);
waiting_output = FALSE;
}
roff_p--;
if (roff_p == roff_buf)
- fprintf(fff, "\n");
+ fprintf(spoiler_file, "\n");
else {
*(roff_p + 1) = '\0';
- fprintf(fff, "%s\n\n", roff_buf);
+ fprintf(spoiler_file, "%s\n\n", roff_buf);
}
roff_p = roff_buf;
#endif
if (waiting_output) {
- fputs(roff_waiting_buf, fff);
+ fputs(roff_waiting_buf, spoiler_file);
if (!wrap)
- fputc('\n', fff);
+ fputc('\n', spoiler_file);
waiting_output = FALSE;
}
}
if (!waiting_output)
- fprintf(fff, "%s\n", roff_buf);
+ fprintf(spoiler_file, "%s\n", roff_buf);
else
strcpy(roff_waiting_buf, roff_buf);
u16b why = 2;
MONRACE_IDX *who;
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
- fff = angband_fopen(buf, "w");
- if (!fff) {
+ spoiler_file = angband_fopen(buf, "w");
+ if (!spoiler_file) {
msg_print("Cannot create spoiler file.");
return;
}
}
C_KILL(who, max_r_idx, s16b);
- if (ferror(fff) || angband_fclose(fff)) {
+ if (ferror(spoiler_file) || angband_fclose(spoiler_file)) {
msg_print("Cannot close spoiler file.");
return;
}
int **evol_tree, i, j, n, r_idx;
int *evol_tree_zero; /* For C_KILL() */
path_build(buf, sizeof buf, ANGBAND_DIR_USER, fname);
- fff = angband_fopen(buf, "w");
- if (!fff) {
+ spoiler_file = angband_fopen(buf, "w");
+ if (!spoiler_file) {
msg_print("Cannot create spoiler file.");
return;
}
continue;
r_ptr = &r_info[r_idx];
- fprintf(fff, _("[%d]: %s (レベル%d, '%c')\n", "[%d]: %s (Level %d, '%c')\n"), r_idx, r_name + r_ptr->name, (int)r_ptr->level, r_ptr->d_char);
+ fprintf(spoiler_file, _("[%d]: %s (レベル%d, '%c')\n", "[%d]: %s (Level %d, '%c')\n"), r_idx, r_name + r_ptr->name, (int)r_ptr->level, r_ptr->d_char);
for (n = 1; r_ptr->next_exp; n++) {
- fprintf(fff, "%*s-(%ld)-> ", n * 2, "", (long int)r_ptr->next_exp);
- fprintf(fff, "[%d]: ", r_ptr->next_r_idx);
+ fprintf(spoiler_file, "%*s-(%ld)-> ", n * 2, "", (long int)r_ptr->next_exp);
+ fprintf(spoiler_file, "[%d]: ", r_ptr->next_r_idx);
r_ptr = &r_info[r_ptr->next_r_idx];
- fprintf(fff, _("%s (レベル%d, '%c')\n", "%s (Level %d, '%c')\n"), r_name + r_ptr->name, (int)r_ptr->level, r_ptr->d_char);
+ fprintf(spoiler_file, _("%s (レベル%d, '%c')\n", "%s (Level %d, '%c')\n"), r_name + r_ptr->name, (int)r_ptr->level, r_ptr->d_char);
}
- fputc('\n', fff);
+ fputc('\n', spoiler_file);
}
C_KILL(evol_tree_zero, max_r_idx * (MAX_EVOL_DEPTH + 1), int);
C_KILL(evol_tree, max_r_idx, int *);
- if (ferror(fff) || angband_fclose(fff)) {
+ if (ferror(spoiler_file) || angband_fclose(spoiler_file)) {
msg_print("Cannot close spoiler file.");
return;
}
{
pval_info_type *pval_ptr = &art_ptr->pval_info;
char buf[80];
- fprintf(fff, "%s\n", art_ptr->description);
+ fprintf(spoiler_file, "%s\n", art_ptr->description);
if (!object_is_fully_known(o_ptr)) {
- fprintf(fff, _("%s不明\n", "%sUnknown\n"), INDENT1);
+ fprintf(spoiler_file, _("%s不明\n", "%sUnknown\n"), INDENT1);
} else {
if (pval_ptr->pval_desc[0]) {
sprintf(buf, _("%sの修正:", "%s to"), pval_ptr->pval_desc);
spoiler_outlist(_("維持:", "Sustain"), art_ptr->sustains, ITEM_SEP);
spoiler_outlist("", art_ptr->misc_magic, LIST_SEP);
if (art_ptr->activation) {
- fprintf(fff, _("%s発動: %s\n", "%sActivates for %s\n"), INDENT1, art_ptr->activation);
+ fprintf(spoiler_file, _("%s発動: %s\n", "%sActivates for %s\n"), INDENT1, art_ptr->activation);
}
}
- fprintf(fff, "%s%s\n\n", INDENT1, art_ptr->misc_desc);
+ fprintf(spoiler_file, "%s%s\n\n", INDENT1, art_ptr->misc_desc);
}
/*!
object_type *q_ptr;
char buf[1024];
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
- fff = angband_fopen(buf, "w");
- if (!fff) {
+ spoiler_file = angband_fopen(buf, "w");
+ if (!spoiler_file) {
msg_print("Cannot create list file.");
return;
}
}
}
- if (ferror(fff) || angband_fclose(fff)) {
+ if (ferror(spoiler_file) || angband_fclose(spoiler_file)) {
msg_print("Cannot close list file.");
return;
}