/*!
* @brief 魔道具の使用回数の残量を示すメッセージを表示する /
- * Describe the charges on an item in the p_ptr->inventory_list.
+ * Describe the charges on an item in the inventory.
* @param item 残量を表示したいプレイヤーのアイテム所持スロット
* @return なし
*/
/*!
* @brief アイテムの残り所持数メッセージを表示する /
- * Describe an item in the p_ptr->inventory_list.
+ * Describe an item in the inventory.
* @param item 残量を表示したいプレイヤーのアイテム所持スロット
* @return なし
*/
}
+void vary_item(INVENTORY_IDX item, ITEM_NUMBER num)
+{
+ if (item >= 0)
+ {
+ inven_item_increase(item, num);
+ inven_item_describe(item);
+ inven_item_optimize(item);
+ }
+ else
+ {
+ floor_item_increase(0 - item, num);
+ floor_item_describe(0 - item);
+ floor_item_optimize(0 - item);
+ }
+}
+
/*!
* @brief アイテムを増減させ残り所持数メッセージを表示する /
- * Increase the "number" of an item in the p_ptr->inventory_list
+ * Increase the "number" of an item in the inventory
* @param item 所持数を増やしたいプレイヤーのアイテム所持スロット
* @param num 増やしたい量
* @return なし
/*!
* @brief 所持アイテムスロットから所持数のなくなったアイテムを消去する /
- * Erase an p_ptr->inventory_list slot if it has no more items
+ * Erase an inventory slot if it has no more items
* @param item 消去したいプレイヤーのアイテム所持スロット
* @return なし
*/
/*!
* @brief オブジェクトをプレイヤーが拾って所持スロットに納めるメインルーチン /
- * Add an item to the players p_ptr->inventory_list, and return the slot used.
+ * Add an item to the players inventory, and return the slot used.
* @param o_ptr 拾うオブジェクトの構造体参照ポインタ
* @return 収められた所持スロットのID、拾うことができなかった場合-1を返す。
* @details
- * If the new item can combine with an existing item in the p_ptr->inventory_list,\n
+ * If the new item can combine with an existing item in the inventory,\n
* it will do so, using "object_similar()" and "object_absorb()", else,\n
- * the item will be placed into the "proper" location in the p_ptr->inventory_list.\n
+ * the item will be placed into the "proper" location in the inventory.\n
*\n
* This function can be used to "over-fill" the player's pack, but only\n
* once, and such an action must trigger the "overflow" code immediately.\n
* combined. This may be tricky. See "dungeon.c" for info.\n
*\n
* Note that this code must remove any location/stack information\n
- * from the object once it is placed into the p_ptr->inventory_list.\n
+ * from the object once it is placed into the inventory.\n
*/
s16b inven_carry(object_type *o_ptr)
{
* Note that only one item at a time can be wielded per slot.\n
* Note that taking off an item when "full" may cause that item\n
* to fall to the ground.\n
- * Return the p_ptr->inventory_list slot into which the item is placed.\n
+ * Return the inventory slot into which the item is placed.\n
*/
INVENTORY_IDX inven_takeoff(INVENTORY_IDX item, ITEM_NUMBER amt)
{
/*!
* @brief 所持スロットから床下にオブジェクトを落とすメインルーチン /
- * Drop (some of) a non-cursed p_ptr->inventory_list/equipment item
+ * Drop (some of) a non-cursed inventory/equipment item
* @param item 所持テーブルのID
* @param amt 落としたい個数
* @return なし
/* Drop it near the player */
(void)drop_near(q_ptr, 0, p_ptr->y, p_ptr->x);
- /* Modify, Describe, Optimize */
- inven_item_increase(item, -amt);
- inven_item_describe(item);
- inven_item_optimize(item);
+ vary_item(item, -amt);
}