Hengband  2.2.1
マクロ定義 | 関数 | 変数
object-flavor.h ファイル
#include "h-type.h"
#include "object.h"
object-flavor.h の依存先関係図:
被依存関係図:

[ソースコード]

マクロ定義

#define OD_NAME_ONLY   0x00000001 /* Omit values, pval, inscription */
 
#define OD_NAME_AND_ENCHANT   0x00000002 /* Omit pval, inscription */
 
#define OD_OMIT_INSCRIPTION   0x00000004 /* Omit inscription */
 
#define OD_OMIT_PREFIX   0x00000008 /* Omit numeric prefix */
 
#define OD_NO_PLURAL   0x00000010 /* Don't use plural */
 
#define OD_STORE   0x00000020 /* Assume to be aware and known */
 
#define OD_NO_FLAVOR   0x00000040 /* Allow to hidden flavor */
 
#define OD_FORCE_FLAVOR   0x00000080 /* Get un-shuffled flavor name */
 

関数

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 [詳解]
 
void flavor_init (void)
 ゲーム開始時に行われるベースアイテムの初期化ルーチン / Prepare the "variable" part of the "k_info" array. [詳解]
 
char * object_desc_kosuu (char *t, object_type *o_ptr)
 
void object_desc (char *buf, object_type *o_ptr, BIT_FLAGS mode)
 オブジェクトの各表記を返すメイン関数 / Creates a description of the item "o_ptr", and stores it in "out_val". [詳解]
 
void strip_name (char *buf, KIND_OBJECT_IDX k_idx)
 nameバッファ内からベースアイテム名を返す / Strip an "object name" into a buffer [詳解]
 

変数

const concptr game_inscriptions []
 アイテムの価値記述テーブル [詳解]
 

マクロ定義詳解

◆ OD_FORCE_FLAVOR

#define OD_FORCE_FLAVOR   0x00000080 /* Get un-shuffled flavor name */

◆ OD_NAME_AND_ENCHANT

#define OD_NAME_AND_ENCHANT   0x00000002 /* Omit pval, inscription */

◆ OD_NAME_ONLY

#define OD_NAME_ONLY   0x00000001 /* Omit values, pval, inscription */

◆ OD_NO_FLAVOR

#define OD_NO_FLAVOR   0x00000040 /* Allow to hidden flavor */

◆ OD_NO_PLURAL

#define OD_NO_PLURAL   0x00000010 /* Don't use plural */

◆ OD_OMIT_INSCRIPTION

#define OD_OMIT_INSCRIPTION   0x00000004 /* Omit inscription */

◆ OD_OMIT_PREFIX

#define OD_OMIT_PREFIX   0x00000008 /* Omit numeric prefix */

◆ OD_STORE

#define OD_STORE   0x00000020 /* Assume to be aware and known */

関数詳解

◆ flavor_init()

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!

呼び出し関係図:

◆ get_table_name()

void get_table_name ( char *  out_string)

ランダムな名前をアーティファクト銘として整形する。 / Create a name from random parts with quotes.

引数
out_string作成した名を保管する参照ポインタ
戻り値
なし

get_table_name_aux()ほぼ完全に実装を依存している。

呼び出し関係図:

◆ 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 を組み合わせる。

呼び出し関係図:

◆ get_table_sindarin()

void get_table_sindarin ( char *  out_string)

シンダリン銘をアーティファクト用に整形する。 / Make random Sindarin name with quotes

引数
out_string作成した名を保管する参照ポインタ
戻り値
なし

get_table_sindarin_aux()ほぼ完全に実装を依存している。

呼び出し関係図:

◆ get_table_sindarin_aux()

void get_table_sindarin_aux ( char *  out_string)

ランダムなシンダリン銘を作成する / Make random Sindarin name

引数
out_string作成した名を保管する参照ポインタ
戻り値
なし

sname.txtが語幹の辞書となっている。

呼び出し関係図:

◆ object_desc()

void object_desc ( char *  buf,
object_type o_ptr,
BIT_FLAGS  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

呼び出し関係図:

◆ object_desc_kosuu()

char* object_desc_kosuu ( char *  t,
object_type o_ptr 
)
被呼び出し関係図:

◆ strip_name()

void strip_name ( char *  buf,
KIND_OBJECT_IDX  k_idx 
)

nameバッファ内からベースアイテム名を返す / Strip an "object name" into a buffer

引数
bufベースアイテム格納先の参照ポインタ
k_idxベースアイテムID
戻り値
なし

変数詳解

◆ game_inscriptions

const concptr game_inscriptions[]

アイテムの価値記述テーブル