C_KILL(who, max_r_idx, MONRACE_IDX);
prt(buf, 0, 0);
-}
\ No newline at end of file
+}
#pragma once
-#include "system/angband.h"
#include "lore/lore-util.h"
+#include "system/angband.h"
void roff_top(MONRACE_IDX r_idx);
void screen_roff(player_type *player_ptr, MONRACE_IDX r_idx, monster_lore_mode mode);
/*!
* @brief アーティファクト情報のスポイラー出力を行うメインルーチン /
* Create a spoiler file for artifacts
- * @param player_ptr プレーヤーへの参照ポインタ
* @param fname 生成ファイル名
- * @return なし
*/
-void spoil_fixed_artifact(concptr fname)
+spoiler_output_status spoil_fixed_artifact(concptr fname)
{
player_type dummy;
object_type forge;
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
spoiler_file = angband_fopen(buf, "w");
if (!spoiler_file) {
- msg_print("Cannot create spoiler file.");
- return;
+ return SPOILER_OUTPUT_FAIL_FOPEN;
}
print_header();
}
if (ferror(spoiler_file) || angband_fclose(spoiler_file)) {
- msg_print("Cannot close spoiler file.");
- return;
+ return SPOILER_OUTPUT_FAIL_FCLOSE;
}
-
- msg_print("Successfully created a spoiler file.");
-}
\ No newline at end of file
+ return SPOILER_OUTPUT_SUCCESS;
+}
#pragma once
#include "system/angband.h"
+#include "wizard/spoiler-util.h"
void spoiler_outlist(concptr header, concptr *list, char separator);
-void spoil_fixed_artifact(concptr fname);
+spoiler_output_status spoil_fixed_artifact(concptr fname);
/*!
* @brief 各ベースアイテムの情報を一行毎に記述する /
- * @param player_ptr プレーヤーへの参照ポインタ
* Create a spoiler file for items
* @param fname ファイル名
- * @return なし
*/
-void spoil_obj_desc(concptr fname)
+spoiler_output_status spoil_obj_desc(concptr fname)
{
player_type dummy;
char buf[1024];
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
spoiler_file = angband_fopen(buf, "w");
if (!spoiler_file) {
- msg_print("Cannot create spoiler file.");
- return;
+ return SPOILER_OUTPUT_FAIL_FOPEN;
}
char title[200];
}
if (ferror(spoiler_file) || angband_fclose(spoiler_file)) {
- msg_print("Cannot close spoiler file.");
- return;
+ return SPOILER_OUTPUT_FAIL_FCLOSE;
}
-
- msg_print("Successfully created a spoiler file.");
-}
\ No newline at end of file
+ return SPOILER_OUTPUT_SUCCESS;
+}
#pragma once
#include "system/angband.h"
+#include "wizard/spoiler-util.h"
-void spoil_obj_desc(concptr fname);
+spoiler_output_status spoil_obj_desc(concptr fname);
#include "util/sort.h"
#include "view/display-lore.h"
#include "view/display-messages.h"
-#include "wizard/spoiler-util.h"
/*!
* @brief シンボル職の記述名を返す /
* @brief モンスター簡易情報のスポイラー出力を行うメインルーチン /
* Create a spoiler file for monsters -BEN-
* @param fname 生成ファイル名
- * @return なし
*/
-void spoil_mon_desc(concptr fname)
+spoiler_output_status spoil_mon_desc(concptr fname)
{
player_type dummy;
u16b why = 2;
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
spoiler_file = angband_fopen(buf, "w");
if (!spoiler_file) {
- msg_print("Cannot create spoiler file.");
- return;
+ return SPOILER_OUTPUT_FAIL_FOPEN;
}
char title[200];
fprintf(spoiler_file, "\n");
C_KILL(who, max_r_idx, s16b);
if (ferror(spoiler_file) || angband_fclose(spoiler_file)) {
- msg_print("Cannot close spoiler file.");
- return;
+ return SPOILER_OUTPUT_FAIL_FCLOSE;
}
-
- msg_print("Successfully created a spoiler file.");
+ return SPOILER_OUTPUT_SUCCESS;
}
/*!
* @param fname ファイル名
* @return なし
*/
-void spoil_mon_info(concptr fname)
+spoiler_output_status spoil_mon_info(concptr fname)
{
player_type dummy;
char buf[1024];
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
spoiler_file = angband_fopen(buf, "w");
if (!spoiler_file) {
- msg_print("Cannot create spoiler file.");
- return;
+ return SPOILER_OUTPUT_FAIL_FOPEN;
}
char title[200];
C_KILL(who, max_r_idx, s16b);
if (ferror(spoiler_file) || angband_fclose(spoiler_file)) {
- msg_print("Cannot close spoiler file.");
- return;
+ return SPOILER_OUTPUT_FAIL_FCLOSE;
}
-
- msg_print("Successfully created a spoiler file.");
-}
\ No newline at end of file
+ return SPOILER_OUTPUT_SUCCESS;
+}
#pragma once
#include "system/angband.h"
+#include "wizard/spoiler-util.h"
-void spoil_mon_desc(concptr fname);
-void spoil_mon_info(concptr fname);
+spoiler_output_status spoil_mon_desc(concptr fname);
+spoiler_output_status spoil_mon_info(concptr fname);
void spoiler_blanklines(int n);
void spoiler_underline(concptr str);
void spoil_out(concptr str);
+
+typedef enum spoiler_output_status {
+ SPOILER_OUTPUT_CANCEL,
+ SPOILER_OUTPUT_SUCCESS,
+ SPOILER_OUTPUT_FAIL_FOPEN,
+ SPOILER_OUTPUT_FAIL_FCLOSE
+} spoiler_output_status;
* @param fname 出力ファイル名
* @return なし
*/
-static void spoil_mon_evol(concptr fname)
+static spoiler_output_status spoil_mon_evol(concptr fname)
{
char buf[1024];
monster_race *r_ptr;
path_build(buf, sizeof buf, ANGBAND_DIR_USER, fname);
spoiler_file = angband_fopen(buf, "w");
if (!spoiler_file) {
- msg_print("Cannot create spoiler file.");
- return;
+ return SPOILER_OUTPUT_FAIL_FOPEN;
}
char title[200];
C_KILL(evol_tree_zero, max_r_idx * (max_evolution_depth + 1), int);
C_KILL(evol_tree, max_r_idx, int *);
if (ferror(spoiler_file) || angband_fclose(spoiler_file)) {
- msg_print("Cannot close spoiler file.");
- return;
+ return SPOILER_OUTPUT_FAIL_FCLOSE;
}
-
- msg_print("Successfully created a spoiler file.");
+ return SPOILER_OUTPUT_SUCCESS;
}
/*!
{
screen_save();
while (TRUE) {
+ spoiler_output_status status = SPOILER_OUTPUT_CANCEL;
term_clear();
prt("Create a spoiler file.", 2, 0);
prt("(1) Brief Object Info (obj-desc.txt)", 5, 5);
screen_load();
return;
case '1':
- spoil_obj_desc("obj-desc.txt");
+ status = spoil_obj_desc("obj-desc.txt");
break;
case '2':
- spoil_fixed_artifact("artifact.txt");
+ status = spoil_fixed_artifact("artifact.txt");
break;
case '3':
- spoil_mon_desc("mon-desc.txt");
+ status = spoil_mon_desc("mon-desc.txt");
break;
case '4':
- spoil_mon_info("mon-info.txt");
+ status = spoil_mon_info("mon-info.txt");
break;
case '5':
- spoil_mon_evol("mon-evol.txt");
+ status = spoil_mon_evol("mon-evol.txt");
break;
default:
bell();
break;
}
+ switch (status) {
+ case SPOILER_OUTPUT_FAIL_FOPEN:
+ msg_print("Cannot create spoiler file.");
+ break;
+ case SPOILER_OUTPUT_FAIL_FCLOSE:
+ msg_print("Cannot close spoiler file.");
+ break;
+ case SPOILER_OUTPUT_SUCCESS:
+ msg_print("Successfully created a spoiler file.");
+ break;
+ }
msg_erase();
}
-}
\ No newline at end of file
+}