Hengband  2.2.1
マクロ定義 | 関数 | 変数
object2.c ファイル

オブジェクトの実装 / Object code, part 2 [詳解]

#include "angband.h"
#include "util.h"
#include "world.h"
#include "term.h"
#include "object.h"
#include "cmd-dump.h"
#include "cmd-spell.h"
#include "spells.h"
#include "dungeon.h"
#include "floor.h"
#include "grid.h"
#include "objectkind.h"
#include "object-boost.h"
#include "object-ego.h"
#include "object-flavor.h"
#include "object-hook.h"
#include "object-curse.h"
#include "objectkind-hook.h"
#include "artifact.h"
#include "feature.h"
#include "player-status.h"
#include "player-move.h"
#include "player-effects.h"
#include "player-class.h"
#include "player-personality.h"
#include "monster.h"
#include "monsterrace-hook.h"
#include "view-mainwindow.h"
object2.c の依存先関係図:

マクロ定義

#define MAX_STACK_SIZE   99
 

関数

void excise_object_idx (OBJECT_IDX o_idx)
 床上、モンスター所持でスタックされたアイテムを削除しスタックを補完する / Excise a dungeon object from any stacks [詳解]
 
void delete_object_idx (OBJECT_IDX o_idx)
 オブジェクトを削除する / Delete a dungeon object [詳解]
 
void delete_object (POSITION y, POSITION x)
 フロアにマスに落ちているオブジェクトを全て削除する / Deletes all objects at given location Delete a dungeon object [詳解]
 
static void compact_objects_aux (OBJECT_IDX i1, OBJECT_IDX i2)
 グローバルオブジェクト配列に対し指定範囲のオブジェクトを整理してIDの若い順に寄せる / Move an object from index i1 to index i2 in the object list [詳解]
 
void compact_objects (int size)
 グローバルオブジェクト配列から優先度の低いものを削除し、データを圧縮する。 / Compact and Reorder the object list. [詳解]
 
void wipe_o_list (void)
 グローバルオブジェクト配列を初期化する / Delete all the items when player leaves the level [詳解]
 
OBJECT_IDX o_pop (void)
 グローバルオブジェクト配列から空きを取得する / Acquires and returns the index of a "free" object. [詳解]
 
static errr get_obj_num_prep (void)
 オブジェクト生成テーブルに生成制約を加える / Apply a "object restriction function" to the "object allocation table" [詳解]
 
OBJECT_IDX get_obj_num (DEPTH level, BIT_FLAGS mode)
 オブジェクト生成テーブルからアイテムを取得する / Choose an object kind that seems "appropriate" to the given level [詳解]
 
void object_known (object_type *o_ptr)
 オブジェクトを鑑定済にする / Known is true when the "attributes" of an object are "known". [詳解]
 
void object_aware (object_type *o_ptr)
 オブジェクトを*鑑定*済にする / The player is now aware of the effects of the given object. [詳解]
 
void object_tried (object_type *o_ptr)
 オブジェクトを試行済にする / Something has been "sampled" [詳解]
 
byte value_check_aux1 (object_type *o_ptr)
 重度擬似鑑定の判断処理 / Return a "feeling" (or NULL) about an item. [詳解]
 
byte value_check_aux2 (object_type *o_ptr)
 軽度擬似鑑定の判断処理 / Return a "feeling" (or NULL) about an item. [詳解]
 
static PRICE object_value_base (object_type *o_ptr)
 未鑑定なベースアイテムの基本価格を返す / Return the "value" of an "unknown" item Make a guess at the value of non-aware items [詳解]
 
PRICE flag_cost (object_type *o_ptr, int plusses)
 オブジェクトのフラグ類から価格を算出する / Return the value of the flags the object has... [詳解]
 
PRICE object_value_real (object_type *o_ptr)
 オブジェクトの真の価格を算出する / Return the value of the flags the object has... [詳解]
 
PRICE object_value (object_type *o_ptr)
 オブジェクト価格算出のメインルーチン / Return the price of an item including plusses (and charges) [詳解]
 
void distribute_charges (object_type *o_ptr, object_type *q_ptr, int amt)
 魔法棒やロッドのスロット分割時に使用回数を分配する / Distribute charges of rods or wands. [詳解]
 
void reduce_charges (object_type *o_ptr, int amt)
 魔法棒やロッドの使用回数を減らす / [詳解]
 
int object_similar_part (object_type *o_ptr, object_type *j_ptr)
 両オブジェクトをスロットに重ね合わせ可能な最大数を返す。 Determine if an item can partly absorb a second item. [詳解]
 
bool object_similar (object_type *o_ptr, object_type *j_ptr)
 両オブジェクトをスロットに重ねることができるかどうかを返す。 Determine if an item can absorb a second item. [詳解]
 
void object_absorb (object_type *o_ptr, object_type *j_ptr)
 両オブジェクトをスロットに重ね合わせる。 Allow one item to "absorb" another, assuming they are similar [詳解]
 
KIND_OBJECT_IDX lookup_kind (OBJECT_TYPE_VALUE tval, OBJECT_SUBTYPE_VALUE sval)
 tvalとsvalに対応するベースアイテムのIDを返す。 Find the index of the object_kind with the given tval and sval [詳解]
 
void object_wipe (object_type *o_ptr)
 オブジェクトを初期化する Wipe an object clean. [詳解]
 
void object_copy (object_type *o_ptr, object_type *j_ptr)
 オブジェクトを複製する Wipe an object clean. [詳解]
 
void object_prep (object_type *o_ptr, KIND_OBJECT_IDX k_idx)
 オブジェクト構造体にベースアイテムを作成する Prepare an object based on an object kind. [詳解]
 
static void object_mention (object_type *o_ptr)
 デバッグ時にアイテム生成情報をメッセージに出力する / Cheat – describe a created object for the user [詳解]
 
static byte get_random_ego (byte slot, bool good)
 アイテムのエゴをレア度の重みに合わせてランダムに選択する Choose random ego type [詳解]
 
void apply_magic_weapon (object_type *o_ptr, DEPTH level, int power)
 武器系オブジェクトに生成ランクごとの強化を与えるサブルーチン Apply magic to an item known to be a "weapon" [詳解]
 
static void a_m_aux_2 (object_type *o_ptr, DEPTH level, int power)
 防具系オブジェクトに生成ランクごとの強化を与えるサブルーチン Apply magic to an item known to be "armor" [詳解]
 
static void a_m_aux_3 (object_type *o_ptr, DEPTH level, int power)
 装飾品系オブジェクトに生成ランクごとの強化を与えるサブルーチン Apply magic to an item known to be a "ring" or "amulet" [詳解]
 
static void a_m_aux_4 (object_type *o_ptr, DEPTH level, int power)
 その他雑多のオブジェクトに生成ランクごとの強化を与えるサブルーチン Apply magic to an item known to be "boring" [詳解]
 
void apply_magic (object_type *o_ptr, DEPTH lev, BIT_FLAGS mode)
 生成されたベースアイテムに魔法的な強化を与えるメインルーチン Complete the "creation" of an object by applying "magic" to the item [詳解]
 
bool make_object (object_type *j_ptr, BIT_FLAGS mode)
 生成階に応じたベースアイテムの生成を行う。 Attempt to make an object (normal or good/great) [詳解]
 
void place_object (POSITION y, POSITION x, BIT_FLAGS mode)
 フロアの指定位置に生成階に応じたベースアイテムの生成を行う。 Attempt to place an object (normal or good/great) at the given location. [詳解]
 
bool make_gold (object_type *j_ptr)
 生成階に応じた財宝オブジェクトの生成を行う。 Make a treasure object [詳解]
 
void place_gold (POSITION y, POSITION x)
 フロアの指定位置に生成階に応じた財宝オブジェクトの生成を行う。 Places a treasure (Gold or Gems) at given location [詳解]
 
OBJECT_IDX drop_near (object_type *j_ptr, PERCENTAGE chance, POSITION y, POSITION x)
 生成済のオブジェクトをフロアの所定の位置に落とす。 Let an object fall to the ground at or near a location. [詳解]
 
void inven_item_charges (INVENTORY_IDX item)
 魔道具の使用回数の残量を示すメッセージを表示する / Describe the charges on an item in the p_ptr->inventory_list. [詳解]
 
void inven_item_describe (INVENTORY_IDX item)
 アイテムの残り所持数メッセージを表示する / Describe an item in the p_ptr->inventory_list. [詳解]
 
void inven_item_increase (INVENTORY_IDX item, ITEM_NUMBER num)
 アイテムを増減させ残り所持数メッセージを表示する / Increase the "number" of an item in the p_ptr->inventory_list [詳解]
 
void inven_item_optimize (INVENTORY_IDX item)
 所持アイテムスロットから所持数のなくなったアイテムを消去する / Erase an p_ptr->inventory_list slot if it has no more items [詳解]
 
void floor_item_charges (INVENTORY_IDX item)
 床上の魔道具の残り残量メッセージを表示する / Describe the charges on an item on the floor. [詳解]
 
void floor_item_describe (INVENTORY_IDX item)
 床上のアイテムの残り数メッセージを表示する / Describe the charges on an item on the floor. [詳解]
 
void floor_item_increase (INVENTORY_IDX item, ITEM_NUMBER num)
 床上のアイテムの数を増やす / Increase the "number" of an item on the floor [詳解]
 
void floor_item_optimize (INVENTORY_IDX item)
 床上の数の無くなったアイテムスロットを消去する / Optimize an item on the floor (destroy "empty" items) [詳解]
 
bool inven_carry_okay (object_type *o_ptr)
 アイテムを拾う際にザックから溢れずに済むかを判定する / Check if we have space for an item in the pack without overflow [詳解]
 
bool object_sort_comp (object_type *o_ptr, s32b o_value, object_type *j_ptr)
 オブジェクトを定義された基準に従いソートするための関数 / Check if we have space for an item in the pack without overflow [詳解]
 
s16b inven_carry (object_type *o_ptr)
 オブジェクトをプレイヤーが拾って所持スロットに納めるメインルーチン / Add an item to the players p_ptr->inventory_list, and return the slot used. [詳解]
 
INVENTORY_IDX inven_takeoff (INVENTORY_IDX item, ITEM_NUMBER amt)
 装備スロットからオブジェクトを外すメインルーチン / Take off (some of) a non-cursed equipment item [詳解]
 
void inven_drop (INVENTORY_IDX item, ITEM_NUMBER amt)
 所持スロットから床下にオブジェクトを落とすメインルーチン / Drop (some of) a non-cursed p_ptr->inventory_list/equipment item [詳解]
 
void combine_pack (player_type *owner_ptr)
 プレイヤーの所持スロットに存在するオブジェクトをまとめなおす / Combine items in the pack [詳解]
 
void reorder_pack (void)
 プレイヤーの所持スロットに存在するオブジェクトを並び替える / Reorder items in the pack [詳解]
 
void display_koff (KIND_OBJECT_IDX k_idx)
 現在アクティブになっているウィンドウにオブジェクトの詳細を表示する / Hack – display an object kind in the current window [詳解]
 
void torch_flags (object_type *o_ptr, BIT_FLAGS *flgs)
 投擲時たいまつに投げやすい/焼棄/アンデッドスレイの特別効果を返す。 Torches have special abilities when they are flaming. [詳解]
 
void torch_dice (object_type *o_ptr, DICE_NUMBER *dd, DICE_SID *ds)
 投擲時たいまつにダイスを与える。 Torches have special abilities when they are flaming. [詳解]
 
void torch_lost_fuel (object_type *o_ptr)
 投擲時命中したたいまつの寿命を縮める。 Torches have special abilities when they are flaming. [詳解]
 
int bow_tval_ammo (object_type *o_ptr)
 射撃武器に対応する矢/弾薬のベースアイテムIDを返す / [詳解]
 

変数

bool(* get_obj_num_hook )(KIND_OBJECT_IDX k_idx)
 
OBJECT_SUBTYPE_VALUE coin_type
 

詳解

オブジェクトの実装 / Object code, part 2

日付
2014/01/11
著者
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.
2014 Deskull rearranged comment for Doxygen.

マクロ定義詳解

◆ MAX_STACK_SIZE

#define MAX_STACK_SIZE   99

関数詳解

◆ a_m_aux_2()

static void a_m_aux_2 ( object_type o_ptr,
DEPTH  level,
int  power 
)
static

防具系オブジェクトに生成ランクごとの強化を与えるサブルーチン Apply magic to an item known to be "armor"

引数
o_ptr強化を与えたいオブジェクトの構造体参照ポインタ
level生成基準階
power生成ランク
戻り値
なし

Hack – note special processing for crown/helm
Hack – note special processing for robe of permanence

呼び出し関係図:
被呼び出し関係図:

◆ a_m_aux_3()

static void a_m_aux_3 ( object_type o_ptr,
DEPTH  level,
int  power 
)
static

装飾品系オブジェクトに生成ランクごとの強化を与えるサブルーチン Apply magic to an item known to be a "ring" or "amulet"

引数
o_ptr強化を与えたいオブジェクトの構造体参照ポインタ
level生成基準階
power生成ランク
戻り値
なし

Hack – note special "pval boost" code for ring of speed
Hack – note that some items must be cursed (or blessed)

呼び出し関係図:
被呼び出し関係図:

◆ a_m_aux_4()

static void a_m_aux_4 ( object_type o_ptr,
DEPTH  level,
int  power 
)
static

その他雑多のオブジェクトに生成ランクごとの強化を与えるサブルーチン Apply magic to an item known to be "boring"

引数
o_ptr強化を与えたいオブジェクトの構造体参照ポインタ
level生成基準階
power生成ランク
戻り値
なし

Hack – note the special code for various items

呼び出し関係図:
被呼び出し関係図:

◆ apply_magic()

void apply_magic ( object_type o_ptr,
DEPTH  lev,
BIT_FLAGS  mode 
)

生成されたベースアイテムに魔法的な強化を与えるメインルーチン Complete the "creation" of an object by applying "magic" to the item

引数
o_ptr強化を与えたいオブジェクトの構造体参照ポインタ
lev生成基準階
mode生成オプション
戻り値
なし

This includes not only rolling for random bonuses, but also putting the
finishing touches on ego-items and artifacts, giving charges to wands and
staffs, giving fuel to lites, and placing traps on chests.

In particular, note that "Instant Artifacts", if "created" by an external
routine, must pass through this function to complete the actual creation.

The base "chance" of the item being "good" increases with the "level"
parameter, which is usually derived from the dungeon level, being equal
to the level plus 10, up to a maximum of 75. If "good" is true, then
the object is guaranteed to be "good". If an object is "good", then
the chance that the object will be "great" (ego-item or artifact), also
increases with the "level", being equal to half the level, plus 5, up to
a maximum of 20. If "great" is true, then the object is guaranteed to be
"great". At dungeon level 65 and below, 15/100 objects are "great".

If the object is not "good", there is a chance it will be "cursed", and
if it is "cursed", there is a chance it will be "broken". These chances
are related to the "good" / "great" chances above.

Otherwise "normal" rings and amulets will be "good" half the time and
"cursed" half the time, unless the ring/amulet is always good or cursed.

If "okay" is true, and the object is going to be "great", then there is
a chance that an artifact will be created. This is true even if both the
"good" and "great" arguments are false. As a total hack, if "great" is
true, then the item gets 3 extra "attempts" to become an artifact.

呼び出し関係図:

◆ apply_magic_weapon()

void apply_magic_weapon ( object_type o_ptr,
DEPTH  level,
int  power 
)

武器系オブジェクトに生成ランクごとの強化を与えるサブルーチン Apply magic to an item known to be a "weapon"

引数
o_ptr強化を与えたいオブジェクトの構造体参照ポインタ
level生成基準階
power生成ランク
戻り値
なし

Hack – note special base damage dice boosting
Hack – note special processing for weapon/digger

呼び出し関係図:

◆ bow_tval_ammo()

int bow_tval_ammo ( object_type o_ptr)

射撃武器に対応する矢/弾薬のベースアイテムIDを返す /

引数
o_ptr判定する射撃武器のアイテム情報参照ポインタ
戻り値
対応する矢/弾薬のベースアイテムID

◆ combine_pack()

void combine_pack ( player_type owner_ptr)

プレイヤーの所持スロットに存在するオブジェクトをまとめなおす / Combine items in the pack

戻り値
なし

Note special handling of the "overflow" slot

呼び出し関係図:

◆ compact_objects()

void compact_objects ( int  size)

グローバルオブジェクト配列から優先度の低いものを削除し、データを圧縮する。 / Compact and Reorder the object list.

引数
size最低でも減らしたいオブジェクト数の水準
戻り値
なし

(危険なので使用には注意すること) This function can be very dangerous, use with caution!

When actually "compacting" objects, we base the saving throw on a
combination of object level, distance from player, and current
"desperation".

After "compacting" (if needed), we "reorder" the objects into a more
compact order, and we reset the allocation info, and the "live" array.

呼び出し関係図:

◆ compact_objects_aux()

static void compact_objects_aux ( OBJECT_IDX  i1,
OBJECT_IDX  i2 
)
static

グローバルオブジェクト配列に対し指定範囲のオブジェクトを整理してIDの若い順に寄せる / Move an object from index i1 to index i2 in the object list

引数
i1整理したい配列の始点
i2整理したい配列の終点
戻り値
なし
呼び出し関係図:
被呼び出し関係図:

◆ delete_object()

void delete_object ( POSITION  y,
POSITION  x 
)

フロアにマスに落ちているオブジェクトを全て削除する / Deletes all objects at given location Delete a dungeon object

引数
y削除したフロアマスのY座標
x削除したフロアマスのX座標
戻り値
なし
呼び出し関係図:

◆ delete_object_idx()

void delete_object_idx ( OBJECT_IDX  o_idx)

オブジェクトを削除する / Delete a dungeon object

引数
o_idx削除対象のオブジェクト構造体ポインタ
戻り値
なし

Handle "stacks" of objects correctly.

呼び出し関係図:

◆ display_koff()

void display_koff ( KIND_OBJECT_IDX  k_idx)

現在アクティブになっているウィンドウにオブジェクトの詳細を表示する / Hack – display an object kind in the current window

引数
k_idxベースアイテムの参照ID
戻り値
なし

Include list of usable spells for readible books

呼び出し関係図:

◆ distribute_charges()

void distribute_charges ( object_type o_ptr,
object_type q_ptr,
int  amt 
)

魔法棒やロッドのスロット分割時に使用回数を分配する / Distribute charges of rods or wands.

引数
o_ptr分割元オブジェクトの構造体参照ポインタ source item
q_ptr分割先オブジェクトの構造体参照ポインタ target item, must be of the same type as o_ptr
amt分割したい回数量 number of items that are transfered
戻り値
なし

Hack – If rods or wands are dropped, the total maximum timeout or
charges need to be allocated between the two stacks. If all the items
are being dropped, it makes for a neater message to leave the original
stack's pval alone. -LM-

◆ drop_near()

OBJECT_IDX drop_near ( object_type j_ptr,
PERCENTAGE  chance,
POSITION  y,
POSITION  x 
)

生成済のオブジェクトをフロアの所定の位置に落とす。 Let an object fall to the ground at or near a location.

引数
j_ptr落としたいオブジェクト構造体の参照ポインタ
chanceドロップの消滅率(%)
y配置したいフロアのY座標
x配置したいフロアのX座標
戻り値
生成に成功したらオブジェクトのIDを返す。

The initial location is assumed to be "in_bounds(p_ptr->current_floor_ptr, )".

This function takes a parameter "chance". This is the percentage
chance that the item will "disappear" instead of drop. If the object
has been thrown, then this is the chance of disappearance on contact.

Hack – this function uses "chance" to determine if it should produce
some form of "description" of the drop event (under the player).

We check several locations to see if we can find a location at which
the object can combine, stack, or be placed. Artifacts will try very
hard to be placed, including "teleporting" to a useful grid if needed.

呼び出し関係図:

◆ excise_object_idx()

void excise_object_idx ( OBJECT_IDX  o_idx)

床上、モンスター所持でスタックされたアイテムを削除しスタックを補完する / Excise a dungeon object from any stacks

引数
o_idx削除対象のオブジェクト構造体ポインタ
戻り値
なし

◆ flag_cost()

PRICE flag_cost ( object_type o_ptr,
int  plusses 
)

オブジェクトのフラグ類から価格を算出する / Return the value of the flags the object has...

引数
o_ptrフラグ価格を確認したいオブジェクトの構造体参照ポインタ
plussesフラグに与える価格の基本重み
戻り値
オブジェクトのフラグ価格
呼び出し関係図:

◆ floor_item_charges()

void floor_item_charges ( INVENTORY_IDX  item)

床上の魔道具の残り残量メッセージを表示する / Describe the charges on an item on the floor.

引数
itemメッセージの対象にしたいアイテム所持スロット
戻り値
なし
呼び出し関係図:

◆ floor_item_describe()

void floor_item_describe ( INVENTORY_IDX  item)

床上のアイテムの残り数メッセージを表示する / Describe the charges on an item on the floor.

引数
itemメッセージの対象にしたいアイテム所持スロット
戻り値
なし
呼び出し関係図:

◆ floor_item_increase()

void floor_item_increase ( INVENTORY_IDX  item,
ITEM_NUMBER  num 
)

床上のアイテムの数を増やす / Increase the "number" of an item on the floor

引数
item増やしたいアイテムの所持スロット
num増やしたいアイテムの数
戻り値
なし

◆ floor_item_optimize()

void floor_item_optimize ( INVENTORY_IDX  item)

床上の数の無くなったアイテムスロットを消去する / Optimize an item on the floor (destroy "empty" items)

引数
item消去したいアイテムの所持スロット
戻り値
なし
呼び出し関係図:

◆ get_obj_num()

OBJECT_IDX get_obj_num ( DEPTH  level,
BIT_FLAGS  mode 
)

オブジェクト生成テーブルからアイテムを取得する / Choose an object kind that seems "appropriate" to the given level

引数
level生成階
戻り値
選ばれたオブジェクトベースID

This function uses the "prob2" field of the "object allocation table",
and various local information, to calculate the "prob3" field of the
same table, which is then used to choose an "appropriate" object, in
a relatively efficient manner.

It is (slightly) more likely to acquire an object of the given level
than one of a lower level. This is done by choosing several objects
appropriate to the given level and keeping the "hardest" one.

Note that if no objects are "appropriate", then this function will
fail, and return zero, but this should almost never happen.

◆ get_obj_num_prep()

static errr get_obj_num_prep ( void  )
static

オブジェクト生成テーブルに生成制約を加える / Apply a "object restriction function" to the "object allocation table"

戻り値
常に0を返す。

生成の制約はグローバルのget_obj_num_hook関数ポインタで加える

被呼び出し関係図:

◆ get_random_ego()

static byte get_random_ego ( byte  slot,
bool  good 
)
static

アイテムのエゴをレア度の重みに合わせてランダムに選択する Choose random ego type

引数
slot取得したいエゴの装備部位
goodTRUEならば通常のエゴ、FALSEならば呪いのエゴが選択対象となる。
戻り値
選択されたエゴ情報のID、万一選択できなかった場合はmax_e_idxが返る。
被呼び出し関係図:

◆ inven_carry()

s16b inven_carry ( object_type o_ptr)

オブジェクトをプレイヤーが拾って所持スロットに納めるメインルーチン / Add an item to the players p_ptr->inventory_list, and return the slot used.

引数
o_ptr拾うオブジェクトの構造体参照ポインタ
戻り値
収められた所持スロットのID、拾うことができなかった場合-1を返す。

If the new item can combine with an existing item in the p_ptr->inventory_list,
it will do so, using "object_similar()" and "object_absorb()", else,
the item will be placed into the "proper" location in the p_ptr->inventory_list.

This function can be used to "over-fill" the player's pack, but only
once, and such an action must trigger the "overflow" code immediately.
Note that when the pack is being "over-filled", the new item must be
placed into the "overflow" slot, and the "overflow" must take place
before the pack is reordered, but (optionally) after the pack is
combined. This may be tricky. See "dungeon.c" for info.

Note that this code must remove any location/stack information
from the object once it is placed into the p_ptr->inventory_list.

呼び出し関係図:

◆ inven_carry_okay()

bool inven_carry_okay ( object_type o_ptr)

アイテムを拾う際にザックから溢れずに済むかを判定する / Check if we have space for an item in the pack without overflow

引数
o_ptr拾いたいオブジェクトの構造体参照ポインタ
戻り値
溢れずに済むならTRUEを返す
呼び出し関係図:

◆ inven_drop()

void inven_drop ( INVENTORY_IDX  item,
ITEM_NUMBER  amt 
)

所持スロットから床下にオブジェクトを落とすメインルーチン / Drop (some of) a non-cursed p_ptr->inventory_list/equipment item

引数
item所持テーブルのID
amt落としたい個数
戻り値
なし

The object will be dropped "near" the current location

呼び出し関係図:

◆ inven_item_charges()

void inven_item_charges ( INVENTORY_IDX  item)

魔道具の使用回数の残量を示すメッセージを表示する / Describe the charges on an item in the p_ptr->inventory_list.

引数
item残量を表示したいプレイヤーのアイテム所持スロット
戻り値
なし
呼び出し関係図:

◆ inven_item_describe()

void inven_item_describe ( INVENTORY_IDX  item)

アイテムの残り所持数メッセージを表示する / Describe an item in the p_ptr->inventory_list.

引数
item残量を表示したいプレイヤーのアイテム所持スロット
戻り値
なし
呼び出し関係図:

◆ inven_item_increase()

void inven_item_increase ( INVENTORY_IDX  item,
ITEM_NUMBER  num 
)

アイテムを増減させ残り所持数メッセージを表示する / Increase the "number" of an item in the p_ptr->inventory_list

引数
item所持数を増やしたいプレイヤーのアイテム所持スロット
num増やしたい量
戻り値
なし
呼び出し関係図:

◆ inven_item_optimize()

void inven_item_optimize ( INVENTORY_IDX  item)

所持アイテムスロットから所持数のなくなったアイテムを消去する / Erase an p_ptr->inventory_list slot if it has no more items

引数
item消去したいプレイヤーのアイテム所持スロット
戻り値
なし
呼び出し関係図:

◆ inven_takeoff()

INVENTORY_IDX inven_takeoff ( INVENTORY_IDX  item,
ITEM_NUMBER  amt 
)

装備スロットからオブジェクトを外すメインルーチン / Take off (some of) a non-cursed equipment item

引数
itemオブジェクトを外したい所持テーブルのID
amt外したい個数
戻り値
収められた所持スロットのID、拾うことができなかった場合-1を返す。

Note that only one item at a time can be wielded per slot.
Note that taking off an item when "full" may cause that item
to fall to the ground.
Return the p_ptr->inventory_list slot into which the item is placed.

呼び出し関係図:

◆ lookup_kind()

KIND_OBJECT_IDX lookup_kind ( OBJECT_TYPE_VALUE  tval,
OBJECT_SUBTYPE_VALUE  sval 
)

tvalとsvalに対応するベースアイテムのIDを返す。 Find the index of the object_kind with the given tval and sval

引数
tval検索したいベースアイテムのtval
sval検索したいベースアイテムのsval
戻り値
なし
呼び出し関係図:

◆ make_gold()

bool make_gold ( object_type j_ptr)

生成階に応じた財宝オブジェクトの生成を行う。 Make a treasure object

引数
j_ptr生成結果を収めたいオブジェクト構造体の参照ポインタ
戻り値
生成に成功したらTRUEを返す。

The location must be a legal, clean, floor grid.

呼び出し関係図:

◆ make_object()

bool make_object ( object_type j_ptr,
BIT_FLAGS  mode 
)

生成階に応じたベースアイテムの生成を行う。 Attempt to make an object (normal or good/great)

引数
j_ptr生成結果を収めたいオブジェクト構造体の参照ポインタ
modeオプションフラグ
戻り値
生成に成功したらTRUEを返す。

This routine plays nasty games to generate the "special artifacts".
This routine uses "p_ptr->current_floor_ptr->object_level" for the "generation level".
We assume that the given object has been "wiped".

呼び出し関係図:

◆ o_pop()

OBJECT_IDX o_pop ( void  )

グローバルオブジェクト配列から空きを取得する / Acquires and returns the index of a "free" object.

戻り値
開いているオブジェクト要素のID

This routine should almost never fail, but in case it does, we must be sure to handle "failure" of this routine.

呼び出し関係図:

◆ object_absorb()

void object_absorb ( object_type o_ptr,
object_type j_ptr 
)

両オブジェクトをスロットに重ね合わせる。 Allow one item to "absorb" another, assuming they are similar

引数
o_ptr重ね合わせ先のオブジェクトの構造体参照ポインタ
j_ptr重ね合わせ元のオブジェクトの構造体参照ポインタ
戻り値
なし
呼び出し関係図:

◆ object_aware()

void object_aware ( object_type o_ptr)

オブジェクトを*鑑定*済にする / The player is now aware of the effects of the given object.

引数
o_ptr*鑑定*済にするオブジェクトの構造体参照ポインタ
戻り値
なし
呼び出し関係図:

◆ object_copy()

void object_copy ( object_type o_ptr,
object_type j_ptr 
)

オブジェクトを複製する Wipe an object clean.

引数
o_ptr複製元のオブジェクトの構造体参照ポインタ
j_ptr複製先のオブジェクトの構造体参照ポインタ
戻り値
なし

◆ object_known()

void object_known ( object_type o_ptr)

オブジェクトを鑑定済にする / Known is true when the "attributes" of an object are "known".

引数
o_ptr鑑定済にするオブジェクトの構造体参照ポインタ
戻り値
なし These include tohit, todam, toac, cost, and pval (charges).

Note that "knowing" an object gives you everything that an "awareness"
gives you, and much more. In fact, the player is always "aware" of any
item of which he has full "knowledge".

But having full knowledge of, say, one "wand of wonder", does not, by
itself, give you knowledge, or even awareness, of other "wands of wonder".
It happens that most "identify" routines (including "buying from a shop")
will make the player "aware" of the object as well as fully "know" it.

This routine also removes any inscriptions generated by "feelings".

◆ object_mention()

static void object_mention ( object_type o_ptr)
static

デバッグ時にアイテム生成情報をメッセージに出力する / Cheat – describe a created object for the user

引数
o_ptrデバッグ出力するオブジェクトの構造体参照ポインタ
戻り値
なし
呼び出し関係図:
被呼び出し関係図:

◆ object_prep()

void object_prep ( object_type o_ptr,
KIND_OBJECT_IDX  k_idx 
)

オブジェクト構造体にベースアイテムを作成する Prepare an object based on an object kind.

引数
o_ptr代入したいオブジェクトの構造体参照ポインタ
k_idx新たに作成したいベースアイテム情報のID
戻り値
なし
呼び出し関係図:

◆ object_similar()

bool object_similar ( object_type o_ptr,
object_type j_ptr 
)

両オブジェクトをスロットに重ねることができるかどうかを返す。 Determine if an item can absorb a second item.

引数
o_ptr検証したいオブジェクトの構造体参照ポインタ1
j_ptr検証したいオブジェクトの構造体参照ポインタ2
戻り値
重ね合わせ可能ならばTRUEを返す。
呼び出し関係図:

◆ object_similar_part()

int object_similar_part ( object_type o_ptr,
object_type j_ptr 
)

両オブジェクトをスロットに重ね合わせ可能な最大数を返す。 Determine if an item can partly absorb a second item.

Return maximum number of stack.

引数
o_ptr検証したいオブジェクトの構造体参照ポインタ1
j_ptr検証したいオブジェクトの構造体参照ポインタ2
戻り値
重ね合わせ可能なアイテム数
呼び出し関係図:

◆ object_sort_comp()

bool object_sort_comp ( object_type o_ptr,
s32b  o_value,
object_type j_ptr 
)

オブジェクトを定義された基準に従いソートするための関数 / Check if we have space for an item in the pack without overflow

引数
o_ptr比較対象オブジェクトの構造体参照ポインタ1
o_valueo_ptrのアイテム価値(手動であらかじめ代入する必要がある?)
j_ptr比較対象オブジェクトの構造体参照ポインタ2
戻り値
o_ptrの方が上位ならばTRUEを返す。
呼び出し関係図:

◆ object_tried()

void object_tried ( object_type o_ptr)

オブジェクトを試行済にする / Something has been "sampled"

引数
o_ptr試行済にするオブジェクトの構造体参照ポインタ
戻り値
なし

◆ object_value()

PRICE object_value ( object_type o_ptr)

オブジェクト価格算出のメインルーチン / Return the price of an item including plusses (and charges)

引数
o_ptr判明している現価格を確認したいオブジェクトの構造体参照ポインタ
戻り値
オブジェクトの判明している現価格

This function returns the "value" of the given item (qty one)

Never notice "unknown" bonuses or properties, including "curses",
since that would give the player information he did not have.

Note that discounted items stay discounted forever, even if
the discount is "forgotten" by the player via memory loss.

呼び出し関係図:

◆ object_value_base()

static PRICE object_value_base ( object_type o_ptr)
static

未鑑定なベースアイテムの基本価格を返す / Return the "value" of an "unknown" item Make a guess at the value of non-aware items

引数
o_ptr未鑑定価格を確認したいオブジェクトの構造体参照ポインタ
戻り値
オブジェクトの未鑑定価格
被呼び出し関係図:

◆ object_value_real()

PRICE object_value_real ( object_type o_ptr)

オブジェクトの真の価格を算出する / Return the value of the flags the object has...

引数
o_ptr本価格を確認したいオブジェクトの構造体参照ポインタ
戻り値
オブジェクトの本価格

Return the "real" price of a "known" item, not including discounts

Wand and staffs get cost for each charge

Armor is worth an extra 100 gold per bonus point to armor class.

Weapons are worth an extra 100 gold per bonus point (AC,TH,TD).

Missiles are only worth 5 gold per bonus point, since they
usually appear in groups of 20, and we want the player to get
the same amount of cash for any "equivalent" item. Note that
missiles never have any of the "pval" flags, and in fact, they
only have a few of the available flags, primarily of the "slay"
and "brand" and "ignore" variety.

Armor with a negative armor bonus is worthless.
Weapons with negative hit+damage bonuses are worthless.

Every wearable item with a "pval" bonus is worth extra (see below).

呼び出し関係図:

◆ object_wipe()

void object_wipe ( object_type o_ptr)

オブジェクトを初期化する Wipe an object clean.

引数
o_ptr初期化したいオブジェクトの構造体参照ポインタ
戻り値
なし

◆ place_gold()

void place_gold ( POSITION  y,
POSITION  x 
)

フロアの指定位置に生成階に応じた財宝オブジェクトの生成を行う。 Places a treasure (Gold or Gems) at given location

引数
y配置したいフロアのY座標
x配置したいフロアのX座標
戻り値
生成に成功したらTRUEを返す。

The location must be a legal, clean, floor grid.

呼び出し関係図:

◆ place_object()

void place_object ( POSITION  y,
POSITION  x,
BIT_FLAGS  mode 
)

フロアの指定位置に生成階に応じたベースアイテムの生成を行う。 Attempt to place an object (normal or good/great) at the given location.

引数
y配置したいフロアのY座標
x配置したいフロアのX座標
modeオプションフラグ
戻り値
生成に成功したらTRUEを返す。

This routine plays nasty games to generate the "special artifacts".
This routine uses "p_ptr->current_floor_ptr->object_level" for the "generation level".
This routine requires a clean floor grid destination.

呼び出し関係図:

◆ reduce_charges()

void reduce_charges ( object_type o_ptr,
int  amt 
)

魔法棒やロッドの使用回数を減らす /

引数
o_ptrオブジェクトの構造体参照ポインタ source item
amt減らしたい回数量 number of items that are transfered
戻り値
なし

Hack – If rods or wand are destroyed, the total maximum timeout or
charges of the stack needs to be reduced, unless all the items are
being destroyed. -LM-

◆ reorder_pack()

void reorder_pack ( void  )

プレイヤーの所持スロットに存在するオブジェクトを並び替える / Reorder items in the pack

戻り値
なし

Note special handling of the "overflow" slot

呼び出し関係図:

◆ torch_dice()

void torch_dice ( object_type o_ptr,
DICE_NUMBER dd,
DICE_SID ds 
)

投擲時たいまつにダイスを与える。 Torches have special abilities when they are flaming.

引数
o_ptr投擲するオブジェクトの構造体参照ポインタ
dd特別なダイス数を返す参照ポインタ
ds特別なダイス面数を返す参照ポインタ
戻り値
なし

◆ torch_flags()

void torch_flags ( object_type o_ptr,
BIT_FLAGS flgs 
)

投擲時たいまつに投げやすい/焼棄/アンデッドスレイの特別効果を返す。 Torches have special abilities when they are flaming.

引数
o_ptr投擲するオブジェクトの構造体参照ポインタ
flgs特別に追加するフラグを返す参照ポインタ
戻り値
なし

◆ torch_lost_fuel()

void torch_lost_fuel ( object_type o_ptr)

投擲時命中したたいまつの寿命を縮める。 Torches have special abilities when they are flaming.

引数
o_ptr投擲するオブジェクトの構造体参照ポインタ
戻り値
なし

◆ value_check_aux1()

byte value_check_aux1 ( object_type o_ptr)

重度擬似鑑定の判断処理 / Return a "feeling" (or NULL) about an item.

Method 1 (Heavy).

引数
o_ptr擬似鑑定を行うオブジェクトの参照ポインタ。
戻り値
擬似鑑定結果のIDを返す。
呼び出し関係図:

◆ value_check_aux2()

byte value_check_aux2 ( object_type o_ptr)

軽度擬似鑑定の判断処理 / Return a "feeling" (or NULL) about an item.

Method 2 (Light).

引数
o_ptr擬似鑑定を行うオブジェクトの参照ポインタ。
戻り値
擬似鑑定結果のIDを返す。
呼び出し関係図:

◆ wipe_o_list()

void wipe_o_list ( void  )

グローバルオブジェクト配列を初期化する / Delete all the items when player leaves the level

覚え書き
we do NOT visually reflect these (irrelevant) changes

Hack – we clear the "g_ptr->o_idx" field for every grid, and the "m_ptr->next_o_idx" field for every monster, since we know we are clearing every object. Technically, we only clear those fields for grids/monsters containing objects, and we clear it once for every such object.

戻り値
なし
呼び出し関係図:

変数詳解

◆ coin_type

◆ get_obj_num_hook

bool(* get_obj_num_hook) (KIND_OBJECT_IDX k_idx)