Hengband
2.2.1
|
オブジェクトの実装 / 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"
マクロ定義 | |
#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
#define MAX_STACK_SIZE 99 |
|
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
|
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)
|
static |
その他雑多のオブジェクトに生成ランクごとの強化を与えるサブルーチン Apply magic to an item known to be "boring"
o_ptr | 強化を与えたいオブジェクトの構造体参照ポインタ |
level | 生成基準階 |
power | 生成ランク |
Hack – note the special code for various items
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.
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
int bow_tval_ammo | ( | object_type * | o_ptr | ) |
射撃武器に対応する矢/弾薬のベースアイテムIDを返す /
o_ptr | 判定する射撃武器のアイテム情報参照ポインタ |
void combine_pack | ( | player_type * | owner_ptr | ) |
プレイヤーの所持スロットに存在するオブジェクトをまとめなおす / Combine items in the pack
Note special handling of the "overflow" slot
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.
|
static |
グローバルオブジェクト配列に対し指定範囲のオブジェクトを整理してIDの若い順に寄せる / Move an object from index i1 to index i2 in the object list
i1 | 整理したい配列の始点 |
i2 | 整理したい配列の終点 |
フロアにマスに落ちているオブジェクトを全て削除する / Deletes all objects at given location Delete a dungeon object
y | 削除したフロアマスのY座標 |
x | 削除したフロアマスのX座標 |
void delete_object_idx | ( | OBJECT_IDX | o_idx | ) |
オブジェクトを削除する / Delete a dungeon object
o_idx | 削除対象のオブジェクト構造体ポインタ |
Handle "stacks" of objects correctly.
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
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-
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座標 |
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.
void excise_object_idx | ( | OBJECT_IDX | o_idx | ) |
床上、モンスター所持でスタックされたアイテムを削除しスタックを補完する / Excise a dungeon object from any stacks
o_idx | 削除対象のオブジェクト構造体ポインタ |
PRICE flag_cost | ( | object_type * | o_ptr, |
int | plusses | ||
) |
オブジェクトのフラグ類から価格を算出する / Return the value of the flags the object has...
o_ptr | フラグ価格を確認したいオブジェクトの構造体参照ポインタ |
plusses | フラグに与える価格の基本重み |
void floor_item_charges | ( | INVENTORY_IDX | item | ) |
床上の魔道具の残り残量メッセージを表示する / Describe the charges on an item on the floor.
item | メッセージの対象にしたいアイテム所持スロット |
void floor_item_describe | ( | INVENTORY_IDX | item | ) |
床上のアイテムの残り数メッセージを表示する / Describe the charges on an item on the floor.
item | メッセージの対象にしたいアイテム所持スロット |
void floor_item_increase | ( | INVENTORY_IDX | item, |
ITEM_NUMBER | num | ||
) |
床上のアイテムの数を増やす / Increase the "number" of an item on the floor
item | 増やしたいアイテムの所持スロット |
num | 増やしたいアイテムの数 |
void floor_item_optimize | ( | INVENTORY_IDX | item | ) |
床上の数の無くなったアイテムスロットを消去する / Optimize an item on the floor (destroy "empty" items)
item | 消去したいアイテムの所持スロット |
OBJECT_IDX get_obj_num | ( | DEPTH | level, |
BIT_FLAGS | mode | ||
) |
オブジェクト生成テーブルからアイテムを取得する / Choose an object kind that seems "appropriate" to the given level
level | 生成階 |
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.
|
static |
オブジェクト生成テーブルに生成制約を加える / Apply a "object restriction function" to the "object allocation table"
生成の制約はグローバルのget_obj_num_hook関数ポインタで加える
アイテムのエゴをレア度の重みに合わせてランダムに選択する Choose random ego type
slot | 取得したいエゴの装備部位 |
good | TRUEならば通常のエゴ、FALSEならば呪いのエゴが選択対象となる。 |
s16b inven_carry | ( | object_type * | o_ptr | ) |
オブジェクトをプレイヤーが拾って所持スロットに納めるメインルーチン / Add an item to the players p_ptr->inventory_list, and return the slot used.
o_ptr | 拾うオブジェクトの構造体参照ポインタ |
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.
bool inven_carry_okay | ( | object_type * | o_ptr | ) |
アイテムを拾う際にザックから溢れずに済むかを判定する / Check if we have space for an item in the pack without overflow
o_ptr | 拾いたいオブジェクトの構造体参照ポインタ |
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
void inven_item_charges | ( | INVENTORY_IDX | item | ) |
魔道具の使用回数の残量を示すメッセージを表示する / Describe the charges on an item in the p_ptr->inventory_list.
item | 残量を表示したいプレイヤーのアイテム所持スロット |
void inven_item_describe | ( | INVENTORY_IDX | item | ) |
アイテムの残り所持数メッセージを表示する / Describe an item in the p_ptr->inventory_list.
item | 残量を表示したいプレイヤーのアイテム所持スロット |
void inven_item_increase | ( | INVENTORY_IDX | item, |
ITEM_NUMBER | num | ||
) |
アイテムを増減させ残り所持数メッセージを表示する / Increase the "number" of an item in the p_ptr->inventory_list
item | 所持数を増やしたいプレイヤーのアイテム所持スロット |
num | 増やしたい量 |
void inven_item_optimize | ( | INVENTORY_IDX | item | ) |
所持アイテムスロットから所持数のなくなったアイテムを消去する / Erase an p_ptr->inventory_list slot if it has no more items
item | 消去したいプレイヤーのアイテム所持スロット |
INVENTORY_IDX inven_takeoff | ( | INVENTORY_IDX | item, |
ITEM_NUMBER | amt | ||
) |
装備スロットからオブジェクトを外すメインルーチン / Take off (some of) a non-cursed equipment item
item | オブジェクトを外したい所持テーブルのID |
amt | 外したい個数 |
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.
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 |
bool make_gold | ( | object_type * | j_ptr | ) |
生成階に応じた財宝オブジェクトの生成を行う。 Make a treasure object
j_ptr | 生成結果を収めたいオブジェクト構造体の参照ポインタ |
The location must be a legal, clean, floor grid.
bool make_object | ( | object_type * | j_ptr, |
BIT_FLAGS | mode | ||
) |
生成階に応じたベースアイテムの生成を行う。 Attempt to make an object (normal or good/great)
j_ptr | 生成結果を収めたいオブジェクト構造体の参照ポインタ |
mode | オプションフラグ |
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".
OBJECT_IDX o_pop | ( | void | ) |
グローバルオブジェクト配列から空きを取得する / Acquires and returns the index of a "free" object.
This routine should almost never fail, but in case it does, we must be sure to handle "failure" of this routine.
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 | 重ね合わせ元のオブジェクトの構造体参照ポインタ |
void object_aware | ( | object_type * | o_ptr | ) |
オブジェクトを*鑑定*済にする / The player is now aware of the effects of the given object.
o_ptr | *鑑定*済にするオブジェクトの構造体参照ポインタ |
void object_copy | ( | object_type * | o_ptr, |
object_type * | j_ptr | ||
) |
オブジェクトを複製する Wipe an object clean.
o_ptr | 複製元のオブジェクトの構造体参照ポインタ |
j_ptr | 複製先のオブジェクトの構造体参照ポインタ |
void object_known | ( | object_type * | o_ptr | ) |
オブジェクトを鑑定済にする / Known is true when the "attributes" of an object are "known".
o_ptr | 鑑定済にするオブジェクトの構造体参照ポインタ |
|
static |
デバッグ時にアイテム生成情報をメッセージに出力する / Cheat – describe a created object for the user
o_ptr | デバッグ出力するオブジェクトの構造体参照ポインタ |
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 |
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 |
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 |
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_value | o_ptrのアイテム価値(手動であらかじめ代入する必要がある?) |
j_ptr | 比較対象オブジェクトの構造体参照ポインタ2 |
void object_tried | ( | object_type * | o_ptr | ) |
オブジェクトを試行済にする / Something has been "sampled"
o_ptr | 試行済にするオブジェクトの構造体参照ポインタ |
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.
|
static |
未鑑定なベースアイテムの基本価格を返す / Return the "value" of an "unknown" item Make a guess at the value of non-aware items
o_ptr | 未鑑定価格を確認したいオブジェクトの構造体参照ポインタ |
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).
void object_wipe | ( | object_type * | o_ptr | ) |
オブジェクトを初期化する Wipe an object clean.
o_ptr | 初期化したいオブジェクトの構造体参照ポインタ |
フロアの指定位置に生成階に応じた財宝オブジェクトの生成を行う。 Places a treasure (Gold or Gems) at given location
y | 配置したいフロアのY座標 |
x | 配置したいフロアのX座標 |
The location must be a legal, clean, floor grid.
フロアの指定位置に生成階に応じたベースアイテムの生成を行う。 Attempt to place an object (normal or good/great) at the given location.
y | 配置したいフロアのY座標 |
x | 配置したいフロアのX座標 |
mode | オプションフラグ |
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.
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-
void reorder_pack | ( | void | ) |
プレイヤーの所持スロットに存在するオブジェクトを並び替える / Reorder items in the pack
Note special handling of the "overflow" slot
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 | 特別なダイス面数を返す参照ポインタ |
void torch_flags | ( | object_type * | o_ptr, |
BIT_FLAGS * | flgs | ||
) |
投擲時たいまつに投げやすい/焼棄/アンデッドスレイの特別効果を返す。 Torches have special abilities when they are flaming.
o_ptr | 投擲するオブジェクトの構造体参照ポインタ |
flgs | 特別に追加するフラグを返す参照ポインタ |
void torch_lost_fuel | ( | object_type * | o_ptr | ) |
投擲時命中したたいまつの寿命を縮める。 Torches have special abilities when they are flaming.
o_ptr | 投擲するオブジェクトの構造体参照ポインタ |
byte value_check_aux1 | ( | object_type * | o_ptr | ) |
重度擬似鑑定の判断処理 / Return a "feeling" (or NULL) about an item.
Method 1 (Heavy).
o_ptr | 擬似鑑定を行うオブジェクトの参照ポインタ。 |
byte value_check_aux2 | ( | object_type * | o_ptr | ) |
軽度擬似鑑定の判断処理 / Return a "feeling" (or NULL) about an item.
Method 2 (Light).
o_ptr | 擬似鑑定を行うオブジェクトの参照ポインタ。 |
void wipe_o_list | ( | void | ) |
グローバルオブジェクト配列を初期化する / Delete all the items when player leaves the level
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.
OBJECT_SUBTYPE_VALUE coin_type |
bool(* get_obj_num_hook) (KIND_OBJECT_IDX k_idx) |