オブジェクトの実装 / Object code, part 2 [詳細]
データ構造 | |
struct | amuse_type |
struct | essence_type |
エッセンス情報の構造体 / A structure for smithing [詳細] | |
マクロ定義 | |
#define | MAX_STACK_SIZE 99 |
#define | AMS_NOTHING 0x00 /* No restriction */ |
#define | AMS_NO_UNIQUE 0x01 /* Don't make the amusing object of uniques */ |
#define | AMS_FIXED_ART 0x02 /* Make a fixed artifact based on the amusing object */ |
#define | AMS_MULTIPLE 0x04 /* Drop 1-3 objects for one type */ |
#define | AMS_PILE 0x08 /* Drop 1-99 pile objects for one type */ |
#define | MAX_NORMAL_TRAPS 18 |
#define | WARNING_AWARE_RANGE 12 |
関数 | |
void | excise_object_idx (int o_idx) |
床上、モンスター所持でスタックされたアイテムを削除しスタックを補完する / Excise a dungeon object from any stacks [詳細] | |
void | delete_object_idx (int o_idx) |
オブジェクトを削除する / Delete a dungeon object [詳細] | |
void | delete_object (int y, int x) |
フロアにマスに落ちているオブジェクトを全て削除する / Deletes all objects at given location Delete a dungeon object [詳細] | |
static void | compact_objects_aux (int i1, int 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 [詳細] | |
s16b | 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" [詳細] | |
s16b | get_obj_num (int level) |
オブジェクト生成テーブルからアイテムを取得する / 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" [詳細] | |
static s32b | object_value_base (object_type *o_ptr) |
未鑑定なベースアイテムの基本価格を返す / Return the "value" of an "unknown" item Make a guess at the value of non-aware items [詳細] | |
s32b | flag_cost (object_type *o_ptr, int plusses) |
オブジェクトのフラグ類から価格を算出する / Return the value of the flags the object has... [詳細] | |
s32b | object_value_real (object_type *o_ptr) |
オブジェクトの真の価格を算出する / Return the value of the flags the object has... [詳細] | |
s32b | object_value (object_type *o_ptr) |
オブジェクト価格算出のメインルーチン / Return the price of an item including plusses (and charges) [詳細] | |
bool | can_player_destroy_object (object_type *o_ptr) |
破壊可能なアイテムかを返す / Determines whether an object can be destroyed, and makes fake inscription. [詳細] | |
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 [詳細] | |
s16b | lookup_kind (int tval, int 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, int k_idx) |
オブジェクト構造体にベースアイテムを作成する Prepare an object based on an object kind. [詳細] | |
s16b | m_bonus (int max, int level) |
上質以上のオブジェクトに与えるための各種ボーナスを正規乱数も加えて算出する。 Help determine an "enchantment bonus" for an object. [詳細] | |
static void | object_mention (object_type *o_ptr) |
デバッグ時にアイテム生成情報をメッセージに出力する / Cheat – describe a created object for the user [詳細] | |
static bool | make_artifact_special (object_type *o_ptr) |
INSTA_ART型の固定アーティファクトの生成を確率に応じて試行する。 Mega-Hack – Attempt to create one of the "Special Objects". [詳細] | |
static bool | make_artifact (object_type *o_ptr) |
非INSTA_ART型の固定アーティファクトの生成を確率に応じて試行する。 Mega-Hack – Attempt to create one of the "Special Objects" [詳細] | |
static byte | get_random_ego (byte slot, bool good) |
アイテムのエゴをレア度の重みに合わせてランダムに選択する Choose random ego type [詳細] | |
static void | a_m_aux_1 (object_type *o_ptr, int level, int power) |
武器系オブジェクトに生成ランクごとの強化を与えるサブルーチン Apply magic to an item known to be a "weapon" [詳細] | |
static void | dragon_resist (object_type *o_ptr) |
ドラゴン装備にランダムな耐性を与える [詳細] | |
static bool | add_esp_strong (object_type *o_ptr) |
オブジェクトにランダムな強いESPを与える [詳細] | |
static void | add_esp_weak (object_type *o_ptr, bool extra) |
オブジェクトにランダムな弱いESPを与える [詳細] | |
static void | a_m_aux_2 (object_type *o_ptr, int level, int power) |
防具系オブジェクトに生成ランクごとの強化を与えるサブルーチン Apply magic to an item known to be "armor" [詳細] | |
static void | a_m_aux_3 (object_type *o_ptr, int level, int power) |
装飾品系オブジェクトに生成ランクごとの強化を与えるサブルーチン Apply magic to an item known to be a "ring" or "amulet" [詳細] | |
static bool | item_monster_okay (int r_idx) |
モンスターが人形のベースにできるかを返す [詳細] | |
static void | a_m_aux_4 (object_type *o_ptr, int level, int power) |
その他雑多のオブジェクトに生成ランクごとの強化を与えるサブルーチン Apply magic to an item known to be "boring" [詳細] | |
void | apply_magic (object_type *o_ptr, int lev, u32b mode) |
生成されたベースアイテムに魔法的な強化を与えるメインルーチン Complete the "creation" of an object by applying "magic" to the item [詳細] | |
static bool | kind_is_good (int k_idx) |
ベースアイテムが上質として扱われるかどうかを返す。 Hack – determine if a template is "good" [詳細] | |
bool | make_object (object_type *j_ptr, u32b mode) |
生成階に応じたベースアイテムの生成を行う。 Attempt to make an object (normal or good/great) [詳細] | |
void | place_object (int y, int x, u32b 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 (int y, int x) |
フロアの指定位置に生成階に応じた財宝オブジェクトの生成を行う。 Places a treasure (Gold or Gems) at given location [詳細] | |
s16b | drop_near (object_type *j_ptr, int chance, int y, int x) |
生成済のオブジェクトをフロアの所定の位置に落とす。 Let an object fall to the ground at or near a location. [詳細] | |
void | acquirement (int y1, int x1, int num, bool great, bool special, bool known) |
獲得ドロップを行う。 Scatter some "great" objects near the player [詳細] | |
void | amusement (int y1, int x1, int num, bool known) |
誰得ドロップを行う。 [詳細] | |
void | init_normal_traps (void) |
タグに従って、基本トラップテーブルを初期化する / Initialize arrays for normal traps [詳細] | |
s16b | choose_random_trap (void) |
基本トラップをランダムに選択する / Get random trap [詳細] | |
void | disclose_grid (int y, int x) |
マスに存在するトラップを秘匿する / Disclose an invisible trap [詳細] | |
void | place_trap (int y, int x) |
マスをトラップを配置する / The location must be a legal, naked, floor grid. [詳細] | |
void | inven_item_charges (int item) |
魔道具の使用回数の残量を示すメッセージを表示する / Describe the charges on an item in the inventory. [詳細] | |
void | inven_item_describe (int item) |
アイテムの残り所持数メッセージを表示する / Describe an item in the inventory. [詳細] | |
void | inven_item_increase (int item, int num) |
アイテムの残り所持数メッセージを表示する / Increase the "number" of an item in the inventory [詳細] | |
void | inven_item_optimize (int item) |
所持アイテムスロットから所持数のなくなったアイテムを消去する / Erase an inventory slot if it has no more items [詳細] | |
void | floor_item_charges (int item) |
床上の魔道具の残り残量メッセージを表示する / Describe the charges on an item on the floor. [詳細] | |
void | floor_item_describe (int item) |
床上のアイテムの残り数メッセージを表示する / Describe the charges on an item on the floor. [詳細] | |
void | floor_item_increase (int item, int num) |
床上のアイテムの数を増やす / Increase the "number" of an item on the floor [詳細] | |
void | floor_item_optimize (int 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 inventory, and return the slot used. [詳細] | |
s16b | inven_takeoff (int item, int amt) |
装備スロットからオブジェクトを外すメインルーチン / Take off (some of) a non-cursed equipment item [詳細] | |
void | inven_drop (int item, int amt) |
所持スロットから床下にオブジェクトを落とすメインルーチン / Drop (some of) a non-cursed inventory/equipment item [詳細] | |
void | combine_pack (void) |
プレイヤーの所持スロットに存在するオブジェクトをまとめなおす / Combine items in the pack [詳細] | |
void | reorder_pack (void) |
プレイヤーの所持スロットに存在するオブジェクトを並び替える / Reorder items in the pack [詳細] | |
void | display_koff (int k_idx) |
現在アクティブになっているウィンドウにオブジェクトの詳細を表示する / Hack – display an object kind in the current window [詳細] | |
object_type * | choose_warning_item (void) |
警告を放つアイテムを選択する / Choose one of items that have warning flag Calculate spell damages [詳細] | |
static void | spell_damcalc (monster_type *m_ptr, int typ, int dam, int *max) |
警告基準を定めるために魔法の効果属性に基づいて最大魔法ダメージを計算する / Calculate spell damages [詳細] | |
void | spell_damcalc_by_spellnum (int spell_num, int typ, int m_idx, int *max) |
警告基準を定めるために魔法の効果属性に基づいて最大魔法ダメージを計算する。 / Calculate spell damages [詳細] | |
static int | blow_damcalc (monster_type *m_ptr, monster_blow *blow_ptr) |
警告基準を定めるためにモンスターの打撃最大ダメージを算出する / Calculate blow damages [詳細] | |
bool | process_warning (int xx, int yy) |
プレイヤーが特定地点へ移動した場合に警告を発する処理 / Examine the grid (xx,yy) and warn the player if there are any danger [詳細] | |
static bool | item_tester_hook_melee_ammo (object_type *o_ptr) |
エッセンスの付加可能な武器や矢弾かを返す [詳細] | |
static void | display_essence (void) |
所持しているエッセンス一覧を表示する [詳細] | |
static void | drain_essence (void) |
エッセンスの抽出処理 [詳細] | |
static int | choose_essence (void) |
付加するエッセンスの大別を選択する [詳細] | |
static void | add_essence (int mode) |
エッセンスを実際に付加する [詳細] | |
static void | erase_essence (void) |
エッセンスを消去する [詳細] | |
void | do_cmd_kaji (bool only_browse) |
鍛冶コマンドのメインルーチン [詳細] | |
void | torch_flags (object_type *o_ptr, u32b *flgs) |
投擲時たいまつに投げやすい/焼棄/アンデッドスレイの特別効果を返す。 Torches have special abilities when they are flaming. [詳細] | |
void | torch_dice (object_type *o_ptr, int *dd, int *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. [詳細] | |
変数 | |
amuse_type | amuse_info [] |
static s16b | normal_traps [MAX_NORMAL_TRAPS] |
static essence_type | essence_info [] |
エッセンス情報テーブル Smithing type data for Weapon smith [詳細] | |
cptr | essence_name [] |
エッセンス名テーブル / Essense names for Weapon smith [詳細] | |
オブジェクトの実装 / Object code, part 2
#define AMS_FIXED_ART 0x02 /* Make a fixed artifact based on the amusing object */ |
#define AMS_MULTIPLE 0x04 /* Drop 1-3 objects for one type */ |
#define AMS_NO_UNIQUE 0x01 /* Don't make the amusing object of uniques */ |
#define AMS_NOTHING 0x00 /* No restriction */ |
#define AMS_PILE 0x08 /* Drop 1-99 pile objects for one type */ |
#define MAX_NORMAL_TRAPS 18 |
#define MAX_STACK_SIZE 99 |
#define WARNING_AWARE_RANGE 12 |
|
static |
武器系オブジェクトに生成ランクごとの強化を与えるサブルーチン 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
|
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
獲得ドロップを行う。 Scatter some "great" objects near the player
y1 | 配置したいフロアのY座標 |
x1 | 配置したいフロアのX座標 |
num | 獲得の処理回数 |
great | TRUEならば必ず高級品以上を落とす |
special | TRUEならば必ず特別品を落とす |
known | TRUEならばオブジェクトが必ず*鑑定*済になる |
|
static |
オブジェクトにランダムな強いESPを与える
o_ptr | 強化を与えたいオブジェクトの構造体参照ポインタ |
|
static |
オブジェクトにランダムな弱いESPを与える
o_ptr | 強化を与えたいオブジェクトの構造体参照ポインタ |
extra | TRUEならばESPの最大付与数が増える(TRUE -> 3+1d6 / FALSE -> 1d3) |
|
static |
エッセンスを実際に付加する
mode | エッセンスの大別ID |
void amusement | ( | int | y1, |
int | x1, | ||
int | num, | ||
bool | known | ||
) |
誰得ドロップを行う。
y1 | 配置したいフロアのY座標 |
x1 | 配置したいフロアのX座標 |
num | 誰得の処理回数 |
known | TRUEならばオブジェクトが必ず*鑑定*済になる |
void apply_magic | ( | object_type * | o_ptr, |
int | lev, | ||
u32b | 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.
|
static |
警告基準を定めるためにモンスターの打撃最大ダメージを算出する / Calculate blow damages
m_ptr | 打撃を行使するモンスターの構造体参照ポインタ |
blow_ptr | モンスターの打撃能力の構造体参照ポインタ |
bool can_player_destroy_object | ( | object_type * | o_ptr | ) |
破壊可能なアイテムかを返す / Determines whether an object can be destroyed, and makes fake inscription.
o_ptr | 破壊可能かを確認したいオブジェクトの構造体参照ポインタ |
|
static |
付加するエッセンスの大別を選択する
s16b choose_random_trap | ( | void | ) |
基本トラップをランダムに選択する / Get random trap
XXX XXX XXX This routine should be redone to reflect trap "level".
That is, it does not make sense to have spiked pits at 50 feet.
Actually, it is not this routine, but the "trap instantiation"
code, which should also check for "trap doors" on quest levels.
object_type* choose_warning_item | ( | void | ) |
警告を放つアイテムを選択する / Choose one of items that have warning flag Calculate spell damages
void combine_pack | ( | void | ) |
プレイヤーの所持スロットに存在するオブジェクトをまとめなおす / 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 | 整理したい配列の終点 |
void delete_object | ( | int | y, |
int | x | ||
) |
フロアにマスに落ちているオブジェクトを全て削除する / Deletes all objects at given location Delete a dungeon object
y | 削除したフロアマスのY座標 |
x | 削除したフロアマスのX座標 |
void delete_object_idx | ( | int | o_idx | ) |
オブジェクトを削除する / Delete a dungeon object
o_idx | 削除対象のオブジェクト構造体ポインタ |
Handle "stacks" of objects correctly.
void disclose_grid | ( | int | y, |
int | x | ||
) |
マスに存在するトラップを秘匿する / Disclose an invisible trap
y | 秘匿したいマスのY座標 |
x | 秘匿したいマスのX座標 |
|
static |
所持しているエッセンス一覧を表示する
void display_koff | ( | int | 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-
void do_cmd_kaji | ( | bool | only_browse | ) |
鍛冶コマンドのメインルーチン
only_browse | TRUEならばエッセンス一覧の表示のみを行う |
|
static |
ドラゴン装備にランダムな耐性を与える
o_ptr | 強化を与えたいオブジェクトの構造体参照ポインタ |
|
static |
エッセンスの抽出処理
s16b drop_near | ( | object_type * | j_ptr, |
int | chance, | ||
int | y, | ||
int | 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()".
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.
|
static |
エッセンスを消去する
void excise_object_idx | ( | int | o_idx | ) |
床上、モンスター所持でスタックされたアイテムを削除しスタックを補完する / Excise a dungeon object from any stacks
o_idx | 削除対象のオブジェクト構造体ポインタ |
s32b flag_cost | ( | object_type * | o_ptr, |
int | plusses | ||
) |
オブジェクトのフラグ類から価格を算出する / Return the value of the flags the object has...
o_ptr | フラグ価格を確認したいオブジェクトの構造体参照ポインタ |
plusses | フラグに与える価格の基本重み |
void floor_item_charges | ( | int | item | ) |
床上の魔道具の残り残量メッセージを表示する / Describe the charges on an item on the floor.
item | メッセージの対象にしたいアイテム所持スロット |
void floor_item_describe | ( | int | item | ) |
床上のアイテムの残り数メッセージを表示する / Describe the charges on an item on the floor.
item | メッセージの対象にしたいアイテム所持スロット |
void floor_item_increase | ( | int | item, |
int | num | ||
) |
床上のアイテムの数を増やす / Increase the "number" of an item on the floor
item | 増やしたいアイテムの所持スロット |
num | 増やしたいアイテムの数 |
void floor_item_optimize | ( | int | item | ) |
床上の数の無くなったアイテムスロットを消去する / Optimize an item on the floor (destroy "empty" items)
item | 消去したいアイテムの所持スロット |
s16b get_obj_num | ( | int | level | ) |
オブジェクト生成テーブルからアイテムを取得する / 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ならば呪いのエゴが選択対象となる。 |
void init_normal_traps | ( | void | ) |
タグに従って、基本トラップテーブルを初期化する / Initialize arrays for normal traps
s16b inven_carry | ( | object_type * | o_ptr | ) |
オブジェクトをプレイヤーが拾って所持スロットに納めるメインルーチン / Add an item to the players inventory, and return the slot used.
o_ptr | 拾うオブジェクトの構造体参照ポインタ |
If the new item can combine with an existing item in the inventory,
it will do so, using "object_similar()" and "object_absorb()", else,
the item will be placed into the "proper" location in the inventory.
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 inventory.
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 | ( | int | item, |
int | amt | ||
) |
所持スロットから床下にオブジェクトを落とすメインルーチン / Drop (some of) a non-cursed inventory/equipment item
item | 所持テーブルのID |
amt | 落としたい個数 |
The object will be dropped "near" the current location
void inven_item_charges | ( | int | item | ) |
魔道具の使用回数の残量を示すメッセージを表示する / Describe the charges on an item in the inventory.
item | 残量を表示したいプレイヤーのアイテム所持スロット |
void inven_item_describe | ( | int | item | ) |
アイテムの残り所持数メッセージを表示する / Describe an item in the inventory.
item | 残量を表示したいプレイヤーのアイテム所持スロット |
void inven_item_increase | ( | int | item, |
int | num | ||
) |
アイテムの残り所持数メッセージを表示する / Increase the "number" of an item in the inventory
item | 所持数を増やしたいプレイヤーのアイテム所持スロット |
num | 増やしたい量 |
void inven_item_optimize | ( | int | item | ) |
所持アイテムスロットから所持数のなくなったアイテムを消去する / Erase an inventory slot if it has no more items
item | 消去したいプレイヤーのアイテム所持スロット |
s16b inven_takeoff | ( | int | item, |
int | 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 inventory slot into which the item is placed.
|
static |
モンスターが人形のベースにできるかを返す
r_idx | チェックしたいモンスター種族のID |
|
static |
エッセンスの付加可能な武器や矢弾かを返す
o_ptr | チェックしたいオブジェクトの構造体参照ポインタ |
|
static |
ベースアイテムが上質として扱われるかどうかを返す。 Hack – determine if a template is "good"
k_idx | 判定したいベースアイテムのID |
s16b lookup_kind | ( | int | tval, |
int | sval | ||
) |
tvalとsvalに対応するベースアイテムのIDを返す。 Find the index of the object_kind with the given tval and sval
tval | 検索したいベースアイテムのtval |
sval | 検索したいベースアイテムのsval |
s16b m_bonus | ( | int | max, |
int | level | ||
) |
上質以上のオブジェクトに与えるための各種ボーナスを正規乱数も加えて算出する。 Help determine an "enchantment bonus" for an object.
max | ボーナス値の限度 |
level | ボーナス値に加味する基準生成階 |
To avoid floating point but still provide a smooth distribution of bonuses,
we simply round the results of division in such a way as to "average" the
correct floating point value.
This function has been changed. It uses "randnor()" to choose values from
a normal distribution, whose mean moves from zero towards the max as the
level increases, and whose standard deviation is equal to 1/4 of the max,
and whose values are forced to lie between zero and the max, inclusive.
Since the "level" rarely passes 100 before Morgoth is dead, it is very
rare to get the "full" enchantment on an object, even a deep levels.
It is always possible (albeit unlikely) to get the "full" enchantment.
A sample distribution of values from "m_bonus(10, N)" is shown below:
N 0 1 2 3 4 5 6 7 8 9 10
— -— -— -— -— -— -— -— -— -— -— -—
0 66.37 13.01 9.73 5.47 2.89 1.31 0.72 0.26 0.12 0.09 0.03
8 46.85 24.66 12.13 8.13 4.20 2.30 1.05 0.36 0.19 0.08 0.05
16 30.12 27.62 18.52 10.52 6.34 3.52 1.95 0.90 0.31 0.15 0.05
24 22.44 15.62 30.14 12.92 8.55 5.30 2.39 1.63 0.62 0.28 0.11
32 16.23 11.43 23.01 22.31 11.19 7.18 4.46 2.13 1.20 0.45 0.41
40 10.76 8.91 12.80 29.51 16.00 9.69 5.90 3.43 1.47 0.88 0.65
48 7.28 6.81 10.51 18.27 27.57 11.76 7.85 4.99 2.80 1.22 0.94
56 4.41 4.73 8.52 11.96 24.94 19.78 11.06 7.18 3.68 1.96 1.78
64 2.81 3.07 5.65 9.17 13.01 31.57 13.70 9.30 6.04 3.04 2.64
72 1.87 1.99 3.68 7.15 10.56 20.24 25.78 12.17 7.52 4.42 4.62
80 1.02 1.23 2.78 4.75 8.37 12.04 27.61 18.07 10.28 6.52 7.33
88 0.70 0.57 1.56 3.12 6.34 10.06 15.76 30.46 12.58 8.47 10.38
96 0.27 0.60 1.25 2.28 4.30 7.60 10.77 22.52 22.51 11.37 16.53
104 0.22 0.42 0.77 1.36 2.62 5.33 8.93 13.05 29.54 15.23 22.53
112 0.15 0.20 0.56 0.87 2.00 3.83 6.86 10.06 17.89 27.31 30.27
120 0.03 0.11 0.31 0.46 1.31 2.48 4.60 7.78 11.67 25.53 45.72
128 0.02 0.01 0.13 0.33 0.83 1.41 3.24 6.17 9.57 14.22 64.07
|
static |
非INSTA_ART型の固定アーティファクトの生成を確率に応じて試行する。 Mega-Hack – Attempt to create one of the "Special Objects"
o_ptr | 生成に割り当てたいオブジェクトの構造体参照ポインタ |
Attempt to change an object into an artifact
This routine should only be called by "apply_magic()"
Note – see "make_artifact_special()" and "apply_magic()"
|
static |
INSTA_ART型の固定アーティファクトの生成を確率に応じて試行する。 Mega-Hack – Attempt to create one of the "Special Objects".
o_ptr | 生成に割り当てたいオブジェクトの構造体参照ポインタ |
We are only called from "make_object()", and we assume that
"apply_magic()" is called immediately after we return.
Note – see "make_artifact()" and "apply_magic()"
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, |
u32b | 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 "object_level" for the "generation level".
We assume that the given object has been "wiped".
s16b 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, |
int | 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 | 試行済にするオブジェクトの構造体参照ポインタ |
s32b 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 | 未鑑定価格を確認したいオブジェクトの構造体参照ポインタ |
s32b 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 | 初期化したいオブジェクトの構造体参照ポインタ |
void place_gold | ( | int | y, |
int | x | ||
) |
フロアの指定位置に生成階に応じた財宝オブジェクトの生成を行う。 Places a treasure (Gold or Gems) at given location
y | 配置したいフロアのY座標 |
x | 配置したいフロアのX座標 |
The location must be a legal, clean, floor grid.
void place_object | ( | int | y, |
int | x, | ||
u32b | mode | ||
) |
フロアの指定位置に生成階に応じたベースアイテムの生成を行う。 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 "object_level" for the "generation level".
This routine requires a clean floor grid destination.
void place_trap | ( | int | y, |
int | x | ||
) |
マスをトラップを配置する / The location must be a legal, naked, floor grid.
y | 配置したいマスのY座標 |
x | 配置したいマスのX座標 |
bool process_warning | ( | int | xx, |
int | yy | ||
) |
プレイヤーが特定地点へ移動した場合に警告を発する処理 / Examine the grid (xx,yy) and warn the player if there are any danger
xx | 危険性を調査するマスのX座標 |
yy | 危険性を調査するマスのY座標 |
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
|
static |
警告基準を定めるために魔法の効果属性に基づいて最大魔法ダメージを計算する / Calculate spell damages
m_ptr | 魔法を行使するモンスターの構造体参照ポインタ |
typ | 効果属性のID |
dam | 基本ダメージ |
max | 算出した最大ダメージを返すポインタ |
void spell_damcalc_by_spellnum | ( | int | spell_num, |
int | typ, | ||
int | m_idx, | ||
int * | max | ||
) |
警告基準を定めるために魔法の効果属性に基づいて最大魔法ダメージを計算する。 / Calculate spell damages
spell_num | RF4ならRF4_SPELL_STARTのように32区切りのベースとなる数値 |
typ | 効果属性のID |
m_idx | 魔法を行使するモンスターのID |
max | 算出した最大ダメージを返すポインタ |
void torch_dice | ( | object_type * | o_ptr, |
int * | dd, | ||
int * | ds | ||
) |
投擲時たいまつにダイスを与える。 Torches have special abilities when they are flaming.
o_ptr | 投擲するオブジェクトの構造体参照ポインタ |
dd | 特別なダイス数を返す参照ポインタ |
ds | 特別なダイス面数を返す参照ポインタ |
void torch_flags | ( | object_type * | o_ptr, |
u32b * | 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 | 投擲するオブジェクトの構造体参照ポインタ |
void wipe_o_list | ( | void | ) |
グローバルオブジェクト配列を初期化する / Delete all the items when player leaves the level
Hack – we clear the "c_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.
amuse_type amuse_info[] |
|
static |
エッセンス情報テーブル Smithing type data for Weapon smith
cptr essence_name[] |
エッセンス名テーブル / Essense names for Weapon smith
|
static |