#include "object-enchant/special-object-flags.h"
#include "object-enchant/trg-types.h"
#include "object/item-tester-hooker.h" // 暫定、このファイルへ引っ越す.
-#include "object/object-kind.h"
-#include "system/object-type-definition.h"
+#include "system/baseitem-info.h"
+#include "system/item-entity.h"
#include "system/player-type-definition.h"
/*!
*\n
* This routine also removes any inscriptions generated by "feelings".\n
*/
-void object_known(ObjectType *o_ptr)
+void object_known(ItemEntity *o_ptr)
{
o_ptr->feeling = FEEL_NONE;
o_ptr->ident &= ~(IDENT_SENSE);
* @param player_ptr プレイヤーへの参照ポインタ
* @param o_ptr *鑑定*済にするオブジェクトの構造体参照ポインタ
*/
-void object_aware(PlayerType *player_ptr, const ObjectType *o_ptr)
+void object_aware(PlayerType *player_ptr, const ItemEntity *o_ptr)
{
const bool is_already_awared = o_ptr->is_aware();
- k_info[o_ptr->k_idx].aware = true;
+ baseitems_info[o_ptr->bi_id].aware = true;
// 以下、playrecordに記録しない場合はreturnする
if (!record_ident) {
}
// アーティファクト専用ベースアイテムは記録しない
- if (k_info[o_ptr->k_idx].gen_flags.has(ItemGenerationTraitType::INSTA_ART)) {
+ if (baseitems_info[o_ptr->bi_id].gen_flags.has(ItemGenerationTraitType::INSTA_ART)) {
return;
}
- // 未鑑定名の無いアイテムは記録しない
- if (!((o_ptr->tval >= ItemKindType::AMULET && o_ptr->tval <= ItemKindType::POTION) || o_ptr->tval == ItemKindType::FOOD)) {
+ if (!o_ptr->has_unidentified_name()) {
return;
}
// playrecordに識別したアイテムを記録
- ObjectType forge;
- ObjectType *q_ptr;
- GAME_TEXT o_name[MAX_NLEN];
-
+ ItemEntity forge;
+ ItemEntity *q_ptr;
q_ptr = &forge;
q_ptr->copy_from(o_ptr);
-
q_ptr->number = 1;
- describe_flavor(player_ptr, o_name, q_ptr, OD_NAME_ONLY);
-
- exe_write_diary(player_ptr, DIARY_FOUND, 0, o_name);
+ const auto item_name = describe_flavor(player_ptr, q_ptr, OD_NAME_ONLY);
+ exe_write_diary(player_ptr, DIARY_FOUND, 0, item_name.data());
}
/*!
* Something has been "sampled"
* @param o_ptr 試行済にするオブジェクトの構造体参照ポインタ
*/
-void object_tried(const ObjectType *o_ptr)
+void object_tried(const ItemEntity *o_ptr)
{
- k_info[o_ptr->k_idx].tried = true;
+ baseitems_info[o_ptr->bi_id].tried = true;
}