Hengband  2.1.4
 全て データ構造 ファイル 関数 変数 型定義 マクロ定義 ページ
データ構造 | マクロ定義 | 型定義 | 関数 | 変数
flavor.c

オブジェクトの記述処理 / Mbject flavor code [詳細]

#include "angband.h"
flavor.cのインクルード依存関係図

データ構造

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

日付
2014/01/03
作者
Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke

This software may be copied and distributed for educational, research,
and not for profit purposes provided that this copyright and statement
are included in all such copies. Other copyrights may also apply.

マクロ定義

#define ADD_INSC (   STR)    (void)(ptr = object_desc_str(ptr, (STR)))
#define MAX_SYLLABLES   164 /* Used with scrolls (see below) */

型定義

オブジェクトの特性表示記号テーブルの構造体 / 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 char* get_ability_abbreviation ( char *  ptr,
object_type o_ptr,
bool  kanji,
bool  all 
)
static

オブジェクト名の特性短縮表記をまとめて提示する。

引数
ptr特性短縮表記を格納する文字列ポインタ
o_ptr特性短縮表記を得たいオブジェクト構造体の参照ポインタ
kanjiTRUEならば漢字表記 / FALSEなら英語表記
allTRUEならばベースアイテム上で明らかなフラグは省略する
戻り値
ptrと同じアドレス

関数の呼び出しグラフ:

呼出しグラフ:

static void get_inscription ( char *  buff,
object_type o_ptr 
)
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 bool have_flag_of ( flag_insc_table fi_ptr,
u32b  flgs[TR_FLAG_SIZE] 
)
static

オブジェクトの特性表示記号テーブル1つに従いオブジェクトの特性フラグ配列に1つでも該当の特性があるかを返す / Special variation of have_flag for auto-inscription

引数
fi_ptr参照する特性表示記号テーブル
flgs対応するオブジェクトのフラグ文字列
戻り値
1つでも該当の特性があったらTRUEを返す。

呼出しグラフ:

static char* inscribe_flags_aux ( flag_insc_table fi_ptr,
u32b  flgs[TR_FLAG_SIZE],
bool  kanji,
char *  ptr 
)
static

get_inscriptionのサブセットとしてオブジェクトの特性フラグを返す / Helper function for get_inscription()

引数
fi_ptr参照する特性表示記号テーブル
flgs対応するオブジェクトのフラグ文字列
kanjiTRUEならば漢字記述/FALSEならば英語記述
ptrフラグ群を保管する文字列参照ポインタ
戻り値
フラグ群を保管する文字列参照ポインタ(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表記に関するオプション指定
戻り値
現在クエスト達成目的のアイテムならばTRUEを返す。

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 char* object_desc_chr ( char *  t,
char  c 
)
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 char* object_desc_int ( char *  t,
sint  v 
)
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 char* object_desc_num ( char *  t,
uint  n 
)
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 char* object_desc_str ( char *  t,
cptr  s 
)
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 bool object_easy_know ( int  i)
static

最初から簡易な名称が明らかになるベースアイテムの判定。 / Certain items, if aware, are known instantly

引数
iベースアイテムID
戻り値
簡易名称を明らかにするならTRUEを返す。

This function is used only by "flavor_init()"

呼出しグラフ:

bool object_is_quest_target ( object_type o_ptr)

オブジェクトがクエストの達成目的か否かを返す。

引数
o_ptr特性短縮表記を得たいオブジェクト構造体の参照ポインタ
戻り値
現在クエスト達成目的のアイテムならばTRUEを返す。

呼出しグラフ:

static void shuffle_flavors ( byte  tval)
static

ベースアイテムの未確定名を共通tval間でシャッフルする / Shuffle flavor indices of a group of objects with given tval

引数
tvalシャッフルしたいtval
戻り値
なし

巻物、各種魔道具などに利用される。

呼出しグラフ:

変数

flag_insc_table flag_insc_aura[]
static
初期値:
=
{
{ "F", TR_SH_FIRE, -1 },
{ "E", TR_SH_ELEC, -1 },
{ "C", TR_SH_COLD, -1 },
{ "M", TR_NO_MAGIC, -1 },
{ "T", TR_NO_TELE, -1 },
{ NULL, 0, -1 }
}
#define NULL
コンパイル環境に定義がない場合のNULL定義
Definition: h-define.h:19
flag_insc_table flag_insc_brand[]
static
初期値:
=
{
{ "A", TR_BRAND_ACID, -1 },
{ "E", TR_BRAND_ELEC, -1 },
{ "F", TR_BRAND_FIRE, -1 },
{ "Co", TR_BRAND_COLD, -1 },
{ "P", TR_BRAND_POIS, -1 },
{ "Ca", TR_CHAOTIC, -1 },
{ "V", TR_VAMPIRIC, -1 },
{ "Q", TR_IMPACT, -1 },
{ "S", TR_VORPAL, -1 },
{ "M", TR_FORCE_WEAPON, -1 },
{ NULL, 0, -1 }
}
#define NULL
コンパイル環境に定義がない場合のNULL定義
Definition: h-define.h:19
flag_insc_table flag_insc_esp1[]
static
初期値:
=
{
{ "Tele", TR_TELEPATHY, -1 },
{ "Evil", TR_ESP_EVIL, -1 },
{ "Good", TR_ESP_GOOD, -1 },
{ "Nolv", TR_ESP_NONLIVING, -1 },
{ "Uniq", TR_ESP_UNIQUE, -1 },
{ NULL, 0, -1 }
}
#define NULL
コンパイル環境に定義がない場合のNULL定義
Definition: h-define.h:19
flag_insc_table flag_insc_esp2[]
static
初期値:
=
{
{ "p", TR_ESP_HUMAN, -1 },
{ "D", TR_ESP_DRAGON, -1 },
{ "o", TR_ESP_ORC, -1 },
{ "T", TR_ESP_TROLL, -1 },
{ "P", TR_ESP_GIANT, -1 },
{ "U", TR_ESP_DEMON, -1 },
{ "L", TR_ESP_UNDEAD, -1 },
{ "Z", TR_ESP_ANIMAL, -1 },
{ NULL, 0, -1 }
}
#define NULL
コンパイル環境に定義がない場合のNULL定義
Definition: h-define.h:19
flag_insc_table flag_insc_immune[]
static
初期値:
=
{
{ "Ac", TR_IM_ACID, -1 },
{ "El", TR_IM_ELEC, -1 },
{ "Fi", TR_IM_FIRE, -1 },
{ "Co", TR_IM_COLD, -1 },
{ NULL, 0, -1 }
}
#define NULL
コンパイル環境に定義がない場合のNULL定義
Definition: h-define.h:19
flag_insc_table flag_insc_kill[]
static
初期値:
=
{
{ "*", TR_KILL_EVIL, -1 },
{ "p", TR_KILL_HUMAN, -1 },
{ "D", TR_KILL_DRAGON, -1 },
{ "o", TR_KILL_ORC, -1 },
{ "T", TR_KILL_TROLL, -1 },
{ "P", TR_KILL_GIANT, -1 },
{ "U", TR_KILL_DEMON, -1 },
{ "L", TR_KILL_UNDEAD, -1 },
{ "Z", TR_KILL_ANIMAL, -1 },
{ NULL, 0, -1 }
}
#define NULL
コンパイル環境に定義がない場合のNULL定義
Definition: h-define.h:19
flag_insc_table flag_insc_misc[]
static
初期値:
=
{
{ "Es", TR_EASY_SPELL, -1 },
{ "Dm", TR_DEC_MANA, -1 },
{ "Th", TR_THROW, -1 },
{ "Rf", TR_REFLECT, -1 },
{ "Fa", TR_FREE_ACT, -1 },
{ "Si", TR_SEE_INVIS, -1 },
{ "Hl", TR_HOLD_EXP, -1 },
{ "Sd", TR_SLOW_DIGEST, -1 },
{ "Rg", TR_REGEN, -1 },
{ "Lv", TR_LEVITATION, -1 },
{ "Lu", TR_LITE_1, -1 },
{ "Lu", TR_LITE_2, -1 },
{ "Lu", TR_LITE_3, -1 },
{ "Dl", TR_LITE_M1, -1 },
{ "Dl", TR_LITE_M2, -1 },
{ "Dl", TR_LITE_M3, -1 },
{ "Wr", TR_WARNING, -1 },
{ "Xm", TR_XTRA_MIGHT, -1 },
{ "Xs", TR_XTRA_SHOTS, -1 },
{ "Te", TR_TELEPORT, -1 },
{ "Ag", TR_AGGRAVATE, -1 },
{ "Bs", TR_BLESSED, -1 },
{ "Ty", TR_TY_CURSE, -1 },
{ "C-", TR_ADD_L_CURSE, -1 },
{ "C+", TR_ADD_H_CURSE, -1 },
{ NULL, 0, -1 }
}
#define NULL
コンパイル環境に定義がない場合のNULL定義
Definition: h-define.h:19
flag_insc_table flag_insc_plus[]
static
初期値:
=
{
{ "At", TR_BLOWS, -1 },
{ "Sp", TR_SPEED, -1 },
{ "St", TR_STR, -1 },
{ "In", TR_INT, -1 },
{ "Wi", TR_WIS, -1 },
{ "Dx", TR_DEX, -1 },
{ "Cn", TR_CON, -1 },
{ "Ch", TR_CHR, -1 },
{ "Md", TR_MAGIC_MASTERY, -1 },
{ "Sl", TR_STEALTH, -1 },
{ "Sr", TR_SEARCH, -1 },
{ "If", TR_INFRA, -1 },
{ "Dg", TR_TUNNEL, -1 },
{ NULL, 0, -1 }
}
#define NULL
コンパイル環境に定義がない場合のNULL定義
Definition: h-define.h:19
flag_insc_table flag_insc_resistance[]
static
初期値:
=
{
{ "Ac", TR_RES_ACID, TR_IM_ACID },
{ "El", TR_RES_ELEC, TR_IM_ELEC },
{ "Fi", TR_RES_FIRE, TR_IM_FIRE },
{ "Co", TR_RES_COLD, TR_IM_COLD },
{ "Po", TR_RES_POIS, -1 },
{ "Li", TR_RES_LITE, -1 },
{ "Dk", TR_RES_DARK, -1 },
{ "Sh", TR_RES_SHARDS, -1 },
{ "Bl", TR_RES_BLIND, -1 },
{ "Cf", TR_RES_CONF, -1 },
{ "So", TR_RES_SOUND, -1 },
{ "Nt", TR_RES_NETHER, -1 },
{ "Nx", TR_RES_NEXUS, -1 },
{ "Ca", TR_RES_CHAOS, -1 },
{ "Di", TR_RES_DISEN, -1 },
{ "Fe", TR_RES_FEAR, -1 },
{ NULL, 0, -1 }
}
#define NULL
コンパイル環境に定義がない場合のNULL定義
Definition: h-define.h:19
flag_insc_table flag_insc_slay[]
static
初期値:
=
{
{ "*", TR_SLAY_EVIL, TR_KILL_EVIL },
{ "p", TR_SLAY_HUMAN, TR_KILL_HUMAN },
{ "D", TR_SLAY_DRAGON, TR_KILL_DRAGON },
{ "o", TR_SLAY_ORC, TR_KILL_ORC },
{ "T", TR_SLAY_TROLL, TR_KILL_TROLL },
{ "P", TR_SLAY_GIANT, TR_KILL_GIANT },
{ "U", TR_SLAY_DEMON, TR_KILL_DEMON },
{ "L", TR_SLAY_UNDEAD, TR_KILL_UNDEAD },
{ "Z", TR_SLAY_ANIMAL, TR_KILL_ANIMAL },
{ NULL, 0, -1 }
}
#define NULL
コンパイル環境に定義がない場合のNULL定義
Definition: h-define.h:19
flag_insc_table flag_insc_sust[]
static
初期値:
=
{
{ "St", TR_SUST_STR, -1 },
{ "In", TR_SUST_INT, -1 },
{ "Wi", TR_SUST_WIS, -1 },
{ "Dx", TR_SUST_DEX, -1 },
{ "Cn", TR_SUST_CON, -1 },
{ "Ch", TR_SUST_CHR, -1 },
{ NULL, 0, -1 }
}
#define NULL
コンパイル環境に定義がない場合のNULL定義
Definition: h-define.h:19