OSDN Git Service

[Refactor] Spoiler File作成時のメッセージを分離
[hengbandforosx/hengbandosx.git] / src / wizard / spoiler-util.h
1 #pragma once
2
3 #include "system/angband.h"
4 #include "wizard/spoiler-table.h"
5
6 /* MAX_LINE_LEN specifies when a line should wrap. */
7 #define MAX_LINE_LEN 75
8
9 /* Given an array, determine how many elements are in the array */
10 #define N_ELEMENTS(a) (sizeof(a) / sizeof((a)[0]))
11
12 /* A special type used just for deailing with pvals */
13 typedef struct pval_info_type {
14     char pval_desc[12]; /* This will contain a string such as "+2", "-10", etc. */
15
16     /* A list of various player traits affected by an object's pval such as stats, speed, stealth, etc. */
17     concptr pval_affects[N_ELEMENTS(stat_flags_desc) - 1 + N_ELEMENTS(pval_flags1_desc) + 1];
18 } pval_info_type;
19
20 typedef struct obj_desc_list {
21     char description[MAX_NLEN]; /* "The Longsword Dragonsmiter (6d4) (+20, +25)" */
22     pval_info_type pval_info; /* Description of what is affected by an object's pval */
23     concptr slays[N_ELEMENTS(slay_flags_desc) + 1]; /* A list of an object's slaying preferences */
24     concptr brands[N_ELEMENTS(brand_flags_desc) + 1]; /* A list if an object's elemental brands */
25     concptr immunities[N_ELEMENTS(immune_flags_desc) + 1]; /* A list of immunities granted by an object */
26     concptr resistances[N_ELEMENTS(resist_flags_desc) + 1]; /* A list of resistances granted by an object */
27     concptr sustains[N_ELEMENTS(sustain_flags_desc) - 1 + 1]; /* A list of stats sustained by an object */
28
29     /* A list of various magical qualities an object may have */
30     concptr misc_magic[N_ELEMENTS(misc_flags2_desc) + N_ELEMENTS(misc_flags3_desc) + 1 /* Permanent Light */
31         + 1 /* TY curse */
32         + 1 /* type of curse */
33         + 1]; /* sentinel NULL */
34
35     char addition[80]; /* Additional ability or resistance */
36     concptr activation; /* A string describing an artifact's activation */
37     char misc_desc[80]; /* "Level 20, Rarity 30, 3.0 lbs, 20000 Gold" */
38 } obj_desc_list;
39
40 extern const char item_separator;
41 extern const char list_separator;
42 extern const int max_evolution_depth;
43 extern concptr spoiler_indent;
44 extern FILE *spoiler_file;
45
46 void spoiler_blanklines(int n);
47 void spoiler_underline(concptr str);
48 void spoil_out(concptr str);
49
50 typedef enum spoiler_output_status {
51     SPOILER_OUTPUT_CANCEL,
52     SPOILER_OUTPUT_SUCCESS,
53     SPOILER_OUTPUT_FAIL_FOPEN,
54     SPOILER_OUTPUT_FAIL_FCLOSE
55 } spoiler_output_status;