オブジェクトの記述処理 / Mbject flavor code [詳細]
#include "angband.h"
データ構造 | |
struct | flag_insc_table |
オブジェクトの特性表示記号テーブルの構造体 / Structs and tables for Auto Inscription for flags [詳細] | |
マクロ定義 | |
#define | MAX_SYLLABLES 164 /* Used with scrolls (see below) */ |
#define | ADD_INSC(STR) (void)(ptr = object_desc_str(ptr, (STR))) |
型定義 | |
typedef struct flag_insc_table | flag_insc_table |
オブジェクトの特性表示記号テーブルの構造体 / Structs and tables for Auto Inscription for flags [詳細] | |
関数 | |
static bool | object_easy_know (int i) |
最初から簡易な名称が明らかになるベースアイテムの判定。 / Certain items, if aware, are known instantly [詳細] | |
void | get_table_name_aux (char *out_string) |
各種語彙からランダムな名前を作成する / Create a name from random parts. [詳細] | |
void | get_table_name (char *out_string) |
ランダムな名前をアーティファクト銘として整形する。 / Create a name from random parts with quotes. [詳細] | |
void | get_table_sindarin_aux (char *out_string) |
ランダムなシンダリン銘を作成する / Make random Sindarin name [詳細] | |
void | get_table_sindarin (char *out_string) |
シンダリン銘をアーティファクト用に整形する。 / Make random Sindarin name with quotes [詳細] | |
static void | shuffle_flavors (byte tval) |
ベースアイテムの未確定名を共通tval間でシャッフルする / Shuffle flavor indices of a group of objects with given tval [詳細] | |
void | flavor_init (void) |
ゲーム開始時に行われるベースアイテムの初期化ルーチン / Prepare the "variable" part of the "k_info" array. [詳細] | |
static char * | object_desc_chr (char *t, char c) |
対象文字配列に一文字だけをコピーする。 [詳細] | |
static char * | object_desc_str (char *t, cptr s) |
対象文字配列に文字列をコピーする。 [詳細] | |
static char * | object_desc_num (char *t, uint n) |
対象文字配列に符号なし整数値をコピーする。 [詳細] | |
static char * | object_desc_int (char *t, sint v) |
対象文字配列に符号あり整数値をコピーする。 [詳細] | |
static char * | inscribe_flags_aux (flag_insc_table *fi_ptr, u32b flgs[TR_FLAG_SIZE], bool kanji, char *ptr) |
get_inscriptionのサブセットとしてオブジェクトの特性フラグを返す / Helper function for get_inscription() [詳細] | |
static bool | have_flag_of (flag_insc_table *fi_ptr, u32b flgs[TR_FLAG_SIZE]) |
オブジェクトの特性表示記号テーブル1つに従いオブジェクトの特性フラグ配列に1つでも該当の特性があるかを返す / Special variation of have_flag for auto-inscription [詳細] | |
static char * | get_ability_abbreviation (char *ptr, object_type *o_ptr, bool kanji, bool all) |
オブジェクト名の特性短縮表記をまとめて提示する。 [詳細] | |
static void | get_inscription (char *buff, object_type *o_ptr) |
オブジェクト名の特性短縮表記+刻み内容を提示する。 / Get object inscription with auto inscription of object flags. [詳細] | |
bool | object_is_quest_target (object_type *o_ptr) |
オブジェクトがクエストの達成目的か否かを返す。 [詳細] | |
void | object_desc (char *buf, object_type *o_ptr, u32b mode) |
オブジェクトの各表記を返すメイン関数 / Creates a description of the item "o_ptr", and stores it in "out_val". [詳細] | |
変数 | |
static flag_insc_table | flag_insc_plus [] |
static flag_insc_table | flag_insc_immune [] |
static flag_insc_table | flag_insc_resistance [] |
static flag_insc_table | flag_insc_misc [] |
static flag_insc_table | flag_insc_aura [] |
static flag_insc_table | flag_insc_brand [] |
static flag_insc_table | flag_insc_kill [] |
static flag_insc_table | flag_insc_slay [] |
static flag_insc_table | flag_insc_esp1 [] |
static flag_insc_table | flag_insc_esp2 [] |
static flag_insc_table | flag_insc_sust [] |
オブジェクトの記述処理 / Mbject flavor code
#define ADD_INSC | ( | STR | ) | (void)(ptr = object_desc_str(ptr, (STR))) |
#define MAX_SYLLABLES 164 /* Used with scrolls (see below) */ |
typedef struct flag_insc_table flag_insc_table |
オブジェクトの特性表示記号テーブルの構造体 / Structs and tables for Auto Inscription for flags
void flavor_init | ( | void | ) |
ゲーム開始時に行われるベースアイテムの初期化ルーチン / Prepare the "variable" part of the "k_info" array.
Prepare the "variable" part of the "k_info" array.
The "color"/"metal"/"type" of an item is its "flavor".
For the most part, flavors are assigned randomly each game.
Initialize descriptions for the "colored" objects, including:
Rings, Amulets, Staffs, Wands, Rods, Food, Potions, Scrolls.
The first 4 entries for potions are fixed (Water, Apple Juice,
Slime Mold Juice, Unused Potion).
Scroll titles are always between 6 and 14 letters long. This is
ensured because every title is composed of whole words, where every
word is from 1 to 8 letters long (one or two syllables of 1 to 4
letters each), and that no scroll is finished until it attempts to
grow beyond 15 letters. The first time this can happen is when the
current title has 6 letters and the new word has 8 letters, which
would result in a 6 letter scroll title.
Duplicate titles are avoided by requiring that no two scrolls share
the same first four letters (not the most efficient method, and not
the least efficient method, but it will always work).
Hack – make sure everything stays the same for each saved game
This is accomplished by the use of a saved "random seed", as in
"town_gen()". Since no other functions are called while the special
seed is in effect, so this function is pretty "safe".
Note that the "hacked seed" may provide an RNG with alternating parity!
|
static |
オブジェクト名の特性短縮表記をまとめて提示する。
ptr | 特性短縮表記を格納する文字列ポインタ |
o_ptr | 特性短縮表記を得たいオブジェクト構造体の参照ポインタ |
kanji | TRUEならば漢字表記 / FALSEなら英語表記 |
all | TRUEならばベースアイテム上で明らかなフラグは省略する |
|
static |
オブジェクト名の特性短縮表記+刻み内容を提示する。 / Get object inscription with auto inscription of object flags.
buff | 特性短縮表記を格納する文字列ポインタ |
o_ptr | 特性短縮表記を得たいオブジェクト構造体の参照ポインタ |
void get_table_name | ( | char * | out_string | ) |
ランダムな名前をアーティファクト銘として整形する。 / Create a name from random parts with quotes.
out_string | 作成した名を保管する参照ポインタ |
get_table_name_aux()ほぼ完全に実装を依存している。
void get_table_name_aux | ( | char * | out_string | ) |
各種語彙からランダムな名前を作成する / Create a name from random parts.
out_string | 作成した名を保管する参照ポインタ |
日本語の場合 aname_j.txt 英語の場合確率に応じて syllables 配列と elvish.txt を組み合わせる。
void get_table_sindarin | ( | char * | out_string | ) |
シンダリン銘をアーティファクト用に整形する。 / Make random Sindarin name with quotes
out_string | 作成した名を保管する参照ポインタ |
get_table_sindarin_aux()ほぼ完全に実装を依存している。
void get_table_sindarin_aux | ( | char * | out_string | ) |
ランダムなシンダリン銘を作成する / Make random Sindarin name
out_string | 作成した名を保管する参照ポインタ |
sname.txtが語幹の辞書となっている。
|
static |
オブジェクトの特性表示記号テーブル1つに従いオブジェクトの特性フラグ配列に1つでも該当の特性があるかを返す / Special variation of have_flag for auto-inscription
fi_ptr | 参照する特性表示記号テーブル |
flgs | 対応するオブジェクトのフラグ文字列 |
|
static |
get_inscriptionのサブセットとしてオブジェクトの特性フラグを返す / Helper function for get_inscription()
fi_ptr | 参照する特性表示記号テーブル |
flgs | 対応するオブジェクトのフラグ文字列 |
kanji | TRUEならば漢字記述/FALSEならば英語記述 |
ptr | フラグ群を保管する文字列参照ポインタ |
Print an signed number "v" into a string "t", as if by sprintf(t, "%+d", n), and return a pointer to the terminator. Note that we always print a sign, either "+" or "-".
void object_desc | ( | char * | buf, |
object_type * | o_ptr, | ||
u32b | mode | ||
) |
オブジェクトの各表記を返すメイン関数 / Creates a description of the item "o_ptr", and stores it in "out_val".
buf | 表記を返すための文字列参照ポインタ |
o_ptr | 特性短縮表記を得たいオブジェクト構造体の参照ポインタ |
mode | 表記に関するオプション指定 |
One can choose the "verbosity" of the description, including whether
or not the "number" of items should be described, and how much detail
should be used when describing the item.
The given "buf" must be MAX_NLEN chars long to hold the longest possible
description, which can get pretty long, including incriptions, such as:
"no more Maces of Disruption (Defender) (+10,+10) [+5] (+3 to stealth)".
Note that the inscription will be clipped to keep the total description
under MAX_NLEN-1 chars (plus a terminator).
Note the use of "object_desc_num()" and "object_desc_int()" as hyper-efficient,
portable, versions of some common "sprintf()" commands.
Note that all ego-items (when known) append an "Ego-Item Name", unless
the item is also an artifact, which should NEVER happen.
Note that all artifacts (when known) append an "Artifact Name", so we
have special processing for "Specials" (artifact Lites, Rings, Amulets).
The "Specials" never use "modifiers" if they are "known", since they
have special "descriptions", such as "The Necklace of the Dwarves".
Special Lite's use the "k_info" base-name (Phial, Star, or Arkenstone),
plus the artifact name, just like any other artifact, if known.
Special Ring's and Amulet's, if not "aware", use the same code as normal
rings and amulets, and if "aware", use the "k_info" base-name (Ring or
Amulet or Necklace). They will NEVER "append" the "k_info" name. But,
they will append the artifact name, just like any artifact, if known.
Hack – Display "The One Ring" as "a Plain Gold Ring" until aware.
Mode:
OD_NAME_ONLY : The Cloak of Death
OD_NAME_AND_ENCHANT : The Cloak of Death [1,+3]
OD_OMIT_INSCRIPTION : The Cloak of Death [1,+3] (+2 to Stealth)
0 : The Cloak of Death [1,+3] (+2 to Stealth) {nifty}
OD_OMIT_PREFIX : Forbidden numeric prefix
OD_NO_PLURAL : Forbidden use of plural
OD_STORE : Assume to be aware and known
OD_NO_FLAVOR : Allow to hidden flavor
OD_FORCE_FLAVOR : Get un-shuffled flavor name
|
static |
対象文字配列に一文字だけをコピーする。
t | 保管先文字列ポインタ |
c | 保管したい1文字 |
Print a char "c" into a string "t", as if by sprintf(t, "%c", c),
and return a pointer to the terminator (t + 1).
|
static |
対象文字配列に符号あり整数値をコピーする。
t | 保管先文字列ポインタ |
v | コピーしたい数値 |
Print an signed number "v" into a string "t", as if by sprintf(t, "%+d", n), and return a pointer to the terminator. Note that we always print a sign, either "+" or "-".
|
static |
対象文字配列に符号なし整数値をコピーする。
t | 保管先文字列ポインタ |
n | コピーしたい数値 |
Print an unsigned number "n" into a string "t", as if by sprintf(t, "%u", n), and return a pointer to the terminator.
|
static |
対象文字配列に文字列をコピーする。
t | 保管先文字列ポインタ |
s | コピーしたい文字列ポインタ |
Print a string "s" into a string "t", as if by strcpy(t, s), and return a pointer to the terminator.
|
static |
最初から簡易な名称が明らかになるベースアイテムの判定。 / Certain items, if aware, are known instantly
i | ベースアイテムID |
This function is used only by "flavor_init()"
bool object_is_quest_target | ( | object_type * | o_ptr | ) |
オブジェクトがクエストの達成目的か否かを返す。
o_ptr | 特性短縮表記を得たいオブジェクト構造体の参照ポインタ |
|
static |
ベースアイテムの未確定名を共通tval間でシャッフルする / Shuffle flavor indices of a group of objects with given tval
tval | シャッフルしたいtval |
巻物、各種魔道具などに利用される。
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |