ゲームデータ初期化1 / Initialization (part 1) -BEN- [詳細]
データ構造 | |
struct | dungeon_grid |
マクロ定義 | |
#define | RANDOM_NONE 0x00000000 |
#define | RANDOM_FEATURE 0x00000001 |
#define | RANDOM_MONSTER 0x00000002 |
#define | RANDOM_OBJECT 0x00000004 |
#define | RANDOM_EGO 0x00000008 |
#define | RANDOM_ARTIFACT 0x00000010 |
#define | RANDOM_TRAP 0x00000020 |
型定義 | |
typedef struct dungeon_grid | dungeon_grid |
関数 | |
static bool | add_text (u32b *offset, header *head, cptr buf, bool normal_text) |
データの可変文字列情報をテキストとして保管する / Add a text to the text-storage and store offset to it. [詳細] | |
static bool | add_name (u32b *offset, header *head, cptr buf) |
データの可変文字列情報を名前として保管する / Add a name to the name-storage and return an offset to it. [詳細] | |
static bool | add_tag (s16b *offset, header *head, cptr buf) |
データの可変文字列情報をタグとして保管する / Add a tag to the tag-storage and return an offset to it. [詳細] | |
byte | color_char_to_attr (char c) |
シンボル1文字をカラーIDに変更する / Convert a "color letter" into an "actual" color The colors are: dwsorgbuDWvyRGBU, as shown below [詳細] | |
errr | init_info_txt (FILE *fp, char *buf, header *head, parse_info_txt_func parse_info_txt_line) |
パース関数に基づいてデータファイルからデータを読み取る / Initialize an "*_info" array, by parsing an ascii "template" file [詳細] | |
errr | parse_v_info (char *buf, header *head) |
Vault情報(v_info)のパース関数 / Initialize the "v_info" array, by parsing an ascii "template" file. [詳細] | |
errr | parse_s_info (char *buf, header *head) |
職業技能情報(s_info)のパース関数 / Initialize the "s_info" array, by parsing an ascii "template" file [詳細] | |
errr | parse_m_info (char *buf, header *head) |
職業魔法情報(m_info)のパース関数 / Initialize the "m_info" array, by parsing an ascii "template" file [詳細] | |
static errr | grab_one_flag (u32b *flags, cptr names[], cptr what) |
テキストトークンを走査してフラグを一つ得る(汎用) / Grab one flag from a textual string [詳細] | |
static errr | grab_one_feat_flag (feature_type *f_ptr, cptr what) |
テキストトークンを走査してフラグを一つ得る(地形情報向け) / Grab one flag in an feature_type from a textual string [詳細] | |
static errr | grab_one_feat_action (feature_type *f_ptr, cptr what, int count) |
テキストトークンを走査してフラグ(ステート)を一つ得る(地形情報向け2) / Grab an action in an feature_type from a textual string [詳細] | |
errr | parse_f_info (char *buf, header *head) |
地形情報(f_info)のパース関数 / Initialize the "f_info" array, by parsing an ascii "template" file [詳細] | |
s16b | f_tag_to_index (cptr str) |
地形タグからIDを得る / Convert a fake tag to a real feat index [詳細] | |
static void | search_real_feat (s16b *feat) |
地形タグからIDを得る / Search for real index corresponding to this fake tag [詳細] | |
void | retouch_f_info (header *head) |
地形情報の各種タグからIDへ変換して結果を収める / Retouch fake tags of f_info [詳細] | |
static errr | grab_one_kind_flag (object_kind *k_ptr, cptr what) |
テキストトークンを走査してフラグを一つ得る(ベースアイテム用) / Grab one flag in an object_kind from a textual string [詳細] | |
static byte | grab_one_activation_flag (cptr what) |
テキストトークンを走査してフラグを一つ得る(発動能力用) / Grab one activation index flag [詳細] | |
errr | parse_k_info (char *buf, header *head) |
ベースアイテム(k_info)のパース関数 / Initialize the "k_info" array, by parsing an ascii "template" file [詳細] | |
static errr | grab_one_artifact_flag (artifact_type *a_ptr, cptr what) |
テキストトークンを走査してフラグを一つ得る(アーティファクト用) / Grab one activation index flag [詳細] | |
errr | parse_a_info (char *buf, header *head) |
固定アーティファクト情報(a_info)のパース関数 / Initialize the "a_info" array, by parsing an ascii "template" file [詳細] | |
static bool | grab_one_ego_item_flag (ego_item_type *e_ptr, cptr what) |
テキストトークンを走査してフラグを一つ得る(アーティファクト用) / Grab one flag in a ego-item_type from a textual string [詳細] | |
errr | parse_e_info (char *buf, header *head) |
アイテムエゴ情報(e_info)のパース関数 / Initialize the "e_info" array, by parsing an ascii "template" file [詳細] | |
static errr | grab_one_basic_flag (monster_race *r_ptr, cptr what) |
テキストトークンを走査してフラグを一つ得る(モンスター用1) / Grab one (basic) flag in a monster_race from a textual string [詳細] | |
static errr | grab_one_spell_flag (monster_race *r_ptr, cptr what) |
テキストトークンを走査してフラグを一つ得る(モンスター用2) / Grab one (spell) flag in a monster_race from a textual string [詳細] | |
errr | parse_r_info (char *buf, header *head) |
モンスター種族情報(r_info)のパース関数 / Initialize the "r_info" array, by parsing an ascii "template" file [詳細] | |
static errr | grab_one_dungeon_flag (dungeon_info_type *d_ptr, cptr what) |
テキストトークンを走査してフラグを一つ得る(ダンジョン用) / Grab one flag for a dungeon type from a textual string [詳細] | |
static errr | grab_one_basic_monster_flag (dungeon_info_type *d_ptr, cptr what) |
テキストトークンを走査してフラグを一つ得る(モンスターのダンジョン出現条件用1) / Grab one (basic) flag in a monster_race from a textual string [詳細] | |
static errr | grab_one_spell_monster_flag (dungeon_info_type *d_ptr, cptr what) |
テキストトークンを走査してフラグを一つ得る(モンスターのダンジョン出現条件用2) / Grab one (spell) flag in a monster_race from a textual string [詳細] | |
errr | parse_d_info (char *buf, header *head) |
ダンジョン情報(d_info)のパース関数 / Initialize the "d_info" array, by parsing an ascii "template" file [詳細] | |
static errr | parse_line_feature (char *buf) |
地形情報の「F:」情報をパースする Process "F:<letter>:<terrain>:<cave_info>:<monster>:<object>:<ego>:<artifact>:<trap>:<special>" – info for dungeon grid [詳細] | |
static errr | parse_line_building (char *buf) |
地形情報の「B:」情報をパースする Process "B:<Index>:<Command>:..." – Building definition [詳細] | |
static void | drop_here (object_type *j_ptr, int y, int x) |
フロアの所定のマスにオブジェクトを配置する Place the object j_ptr to a grid [詳細] | |
static errr | process_dungeon_file_aux (char *buf, int ymin, int xmin, int ymax, int xmax, int *y, int *x) |
クエスト用固定ダンジョンをフロアに生成する Parse a sub-file of the "extra info" [詳細] | |
static cptr | process_dungeon_file_expr (char **sp, char *fp) |
クエスト用固定ダンジョン生成時の分岐処理 Helper function for "process_dungeon_file()" [詳細] | |
errr | process_dungeon_file (cptr name, int ymin, int xmin, int ymax, int xmax) |
クエスト用固定ダンジョン生成時のメインルーチン Helper function for "process_dungeon_file()" [詳細] | |
変数 | |
static cptr | r_info_blow_method [] |
モンスターの打撃手段トークンの定義 / Monster Blow Methods [詳細] | |
static cptr | r_info_blow_effect [] |
モンスターの打撃属性トークンの定義 / Monster Blow Effects [詳細] | |
static cptr | f_info_flags [] |
地形属性トークンの定義 / Feature info flags [詳細] | |
static cptr | r_info_flags1 [] |
モンスター特性トークンの定義1 / Monster race flags [詳細] | |
static cptr | r_info_flags2 [] |
モンスター特性トークンの定義2 / Monster race flags [詳細] | |
static cptr | r_info_flags3 [] |
モンスター特性トークンの定義3 / Monster race flags [詳細] | |
static cptr | r_info_flags4 [] |
モンスター特性トークンの定義4 / Monster race flags [詳細] | |
static cptr | r_info_flags5 [] |
モンスター特性トークンの定義5 / Monster race flags [詳細] | |
static cptr | r_info_flags6 [] |
モンスター特性トークンの定義6 / Monster race flags [詳細] | |
static cptr | r_info_flags7 [] |
モンスター特性トークンの定義7 / Monster race flags [詳細] | |
static cptr | r_info_flags8 [] |
モンスター特性トークンの定義8 / Monster race flags [詳細] | |
static cptr | r_info_flags9 [] |
モンスター特性トークンの定義9 / Monster race flags [詳細] | |
static cptr | r_info_flagsr [] |
モンスター特性トークンの定義R(耐性) / Monster race flags [詳細] | |
static cptr | k_info_flags [] |
オブジェクト基本特性トークンの定義 / Object flags [詳細] | |
static cptr | k_info_gen_flags [] |
オブジェクト生成特性トークンの定義 / Object flags [詳細] | |
static cptr | d_info_flags1 [] |
ダンジョン特性トークンの定義 / Dungeon flags [詳細] | |
static dungeon_grid | letter [255] |
static char | tmp [8] |
static cptr | variant = "ZANGBAND" |
ゲームデータ初期化1 / Initialization (part 1) -BEN-
This file is used to initialize various variables and arrays for the Angband game. Note the use of "fd_read()" and "fd_write()" to bypass the common limitation of "read()" and "write()" to only 32767 bytes at a time. Several of the arrays for Angband are built from "template" files in the "lib/file" directory, from which quick-load binary "image" files are constructed whenever they are not present in the "lib/data" directory, or if those files become obsolete, if we are allowed. Warning – the "ascii" file parsers use a minor hack to collect the name and text information in a single pass. Thus, the game will not be able to load any template file with more than 20K of names or 60K of text, even though technically, up to 64K should be legal. Note that if "ALLOW_TEMPLATES" is not defined, then a lot of the code in this file is compiled out, and the game will not run unless valid "binary template files" already exist in "lib/data". Thus, one can compile Angband with ALLOW_TEMPLATES defined, run once to create the "*.raw" files in "lib/data", and then quit, and recompile without defining ALLOW_TEMPLATES, which will both save 20K and prevent people from changing the ascii template files in potentially dangerous ways. The code could actually be removed and placed into a "stand-alone" program, but that feels a little silly, especially considering some of the platforms that we currently support.
#define RANDOM_ARTIFACT 0x00000010 |
#define RANDOM_EGO 0x00000008 |
#define RANDOM_FEATURE 0x00000001 |
#define RANDOM_MONSTER 0x00000002 |
#define RANDOM_NONE 0x00000000 |
#define RANDOM_OBJECT 0x00000004 |
#define RANDOM_TRAP 0x00000020 |
typedef struct dungeon_grid dungeon_grid |
データの可変文字列情報を名前として保管する / Add a name to the name-storage and return an offset to it.
offset | 文字列保管ポインタからのオフセット |
head | テキスト保管ヘッダ情報の構造体参照ポインタ |
buf | 保管文字列 |
データの可変文字列情報をタグとして保管する / Add a tag to the tag-storage and return an offset to it.
offset | 文字列保管ポインタからのオフセット |
head | テキスト保管ヘッダ情報の構造体参照ポインタ |
buf | 保管文字列 |
データの可変文字列情報をテキストとして保管する / Add a text to the text-storage and store offset to it.
offset | 文字列保管ポインタからのオフセット |
head | テキスト保管ヘッダ情報の構造体参照ポインタ |
buf | 保管文字列 |
normal_text | テキストの正規化を行う |
byte color_char_to_attr | ( | char | c | ) |
シンボル1文字をカラーIDに変更する / Convert a "color letter" into an "actual" color The colors are: dwsorgbuDWvyRGBU, as shown below
c | シンボル文字 |
|
static |
フロアの所定のマスにオブジェクトを配置する Place the object j_ptr to a grid
j_ptr | オブジェクト構造体の参照ポインタ |
y | 配置先Y座標 |
x | 配置先X座標 |
地形タグからIDを得る / Convert a fake tag to a real feat index
str | タグ文字列 |
テキストトークンを走査してフラグを一つ得る(発動能力用) / Grab one activation index flag
what | 参照元の文字列ポインタ |
|
static |
テキストトークンを走査してフラグを一つ得る(アーティファクト用) / Grab one activation index flag
a_ptr | 保管先のアーティファクト構造体参照ポインタ |
what | 参照元の文字列ポインタ |
|
static |
テキストトークンを走査してフラグを一つ得る(モンスター用1) / Grab one (basic) flag in a monster_race from a textual string
r_ptr | 保管先のモンスター種族構造体参照ポインタ |
what | 参照元の文字列ポインタ |
|
static |
テキストトークンを走査してフラグを一つ得る(モンスターのダンジョン出現条件用1) / Grab one (basic) flag in a monster_race from a textual string
d_ptr | 保管先のダンジョン構造体参照ポインタ |
what | 参照元の文字列ポインタ |
|
static |
テキストトークンを走査してフラグを一つ得る(ダンジョン用) / Grab one flag for a dungeon type from a textual string
d_ptr | 保管先のダンジョン構造体参照ポインタ |
what | 参照元の文字列ポインタ |
|
static |
テキストトークンを走査してフラグを一つ得る(アーティファクト用) / Grab one flag in a ego-item_type from a textual string
e_ptr | 保管先のエゴ構造体参照ポインタ |
what | 参照元の文字列ポインタ |
|
static |
テキストトークンを走査してフラグ(ステート)を一つ得る(地形情報向け2) / Grab an action in an feature_type from a textual string
f_ptr | 地形情報を保管する先の構造体参照ポインタ |
what | 参照元の文字列ポインタ |
count | ステートの保存先ID |
|
static |
テキストトークンを走査してフラグを一つ得る(地形情報向け) / Grab one flag in an feature_type from a textual string
f_ptr | 地形情報を保管する先の構造体参照ポインタ |
what | 参照元の文字列ポインタ |
テキストトークンを走査してフラグを一つ得る(汎用) / Grab one flag from a textual string
flags | ビットフラグを追加する先の参照ポインタ |
names | トークン定義配列 |
what | 参照元の文字列ポインタ |
|
static |
テキストトークンを走査してフラグを一つ得る(ベースアイテム用) / Grab one flag in an object_kind from a textual string
k_ptr | 保管先のベースアイテム構造体参照ポインタ |
what | 参照元の文字列ポインタ |
|
static |
テキストトークンを走査してフラグを一つ得る(モンスター用2) / Grab one (spell) flag in a monster_race from a textual string
r_ptr | 保管先のモンスター種族構造体参照ポインタ |
what | 参照元の文字列ポインタ |
|
static |
テキストトークンを走査してフラグを一つ得る(モンスターのダンジョン出現条件用2) / Grab one (spell) flag in a monster_race from a textual string
d_ptr | 保管先のダンジョン構造体参照ポインタ |
what | 参照元の文字列ポインタ |
errr init_info_txt | ( | FILE * | fp, |
char * | buf, | ||
header * | head, | ||
parse_info_txt_func | parse_info_txt_line | ||
) |
パース関数に基づいてデータファイルからデータを読み取る / Initialize an "*_info" array, by parsing an ascii "template" file
fp | 読み取りに使うファイルポインタ |
buf | 読み取りに使うバッファ領域 |
head | ヘッダ構造体 |
parse_info_txt_line | パース関数 |
固定アーティファクト情報(a_info)のパース関数 / Initialize the "a_info" array, by parsing an ascii "template" file
buf | テキスト列 |
head | ヘッダ構造体 |
ダンジョン情報(d_info)のパース関数 / Initialize the "d_info" array, by parsing an ascii "template" file
buf | テキスト列 |
head | ヘッダ構造体 |
アイテムエゴ情報(e_info)のパース関数 / Initialize the "e_info" array, by parsing an ascii "template" file
buf | テキスト列 |
head | ヘッダ構造体 |
地形情報(f_info)のパース関数 / Initialize the "f_info" array, by parsing an ascii "template" file
buf | テキスト列 |
head | ヘッダ構造体 |
ベースアイテム(k_info)のパース関数 / Initialize the "k_info" array, by parsing an ascii "template" file
buf | テキスト列 |
head | ヘッダ構造体 |
|
static |
地形情報の「B:」情報をパースする Process "B:<Index>:<Command>:..." – Building definition
buf | 解析文字列 |
|
static |
地形情報の「F:」情報をパースする Process "F:<letter>:<terrain>:<cave_info>:<monster>:<object>:<ego>:<artifact>:<trap>:<special>" – info for dungeon grid
buf | 解析文字列 |
職業魔法情報(m_info)のパース関数 / Initialize the "m_info" array, by parsing an ascii "template" file
buf | テキスト列 |
head | ヘッダ構造体 |
モンスター種族情報(r_info)のパース関数 / Initialize the "r_info" array, by parsing an ascii "template" file
buf | テキスト列 |
head | ヘッダ構造体 |
職業技能情報(s_info)のパース関数 / Initialize the "s_info" array, by parsing an ascii "template" file
buf | テキスト列 |
head | ヘッダ構造体 |
Vault情報(v_info)のパース関数 / Initialize the "v_info" array, by parsing an ascii "template" file.
buf | テキスト列 |
head | ヘッダ構造体 |
クエスト用固定ダンジョン生成時のメインルーチン Helper function for "process_dungeon_file()"
name | ファイル名 |
ymin | 詳細不明 |
xmin | 詳細不明 |
ymax | 詳細不明 |
xmax | 詳細不明 |
|
static |
クエスト用固定ダンジョンをフロアに生成する Parse a sub-file of the "extra info"
buf | 文字列 |
ymin | 詳細不明 |
xmin | 詳細不明 |
ymax | 詳細不明 |
xmax | 詳細不明 |
y | 詳細不明 |
x | 詳細不明 |
|
static |
クエスト用固定ダンジョン生成時の分岐処理 Helper function for "process_dungeon_file()"
sp | |
fp |
void retouch_f_info | ( | header * | head | ) |
地形情報の各種タグからIDへ変換して結果を収める / Retouch fake tags of f_info
head | ヘッダ構造体 |
|
static |
地形タグからIDを得る / Search for real index corresponding to this fake tag
feat | タグ文字列 |
|
static |
ダンジョン特性トークンの定義 / Dungeon flags
|
static |
地形属性トークンの定義 / Feature info flags
|
static |
オブジェクト基本特性トークンの定義 / Object flags
|
static |
オブジェクト生成特性トークンの定義 / Object flags
|
static |
|
static |
モンスターの打撃属性トークンの定義 / Monster Blow Effects
|
static |
モンスターの打撃手段トークンの定義 / Monster Blow Methods
|
static |
モンスター特性トークンの定義1 / Monster race flags
|
static |
モンスター特性トークンの定義2 / Monster race flags
|
static |
モンスター特性トークンの定義3 / Monster race flags
|
static |
モンスター特性トークンの定義4 / Monster race flags
|
static |
モンスター特性トークンの定義5 / Monster race flags
|
static |
モンスター特性トークンの定義6 / Monster race flags
|
static |
モンスター特性トークンの定義7 / Monster race flags
|
static |
モンスター特性トークンの定義8 / Monster race flags
|
static |
モンスター特性トークンの定義9 / Monster race flags
|
static |
モンスター特性トークンの定義R(耐性) / Monster race flags
|
static |
|
static |