/* * Describe fake object */ static void desc_obj_fake(int k_idx) { object_kind *k_ptr = &k_info[k_idx]; object_type object_type_body; object_type *o_ptr = &object_type_body; char header[120]; textblock *tb; region area = { 0, 0, 0, 0 }; /* Check for known artifacts, display them as artifacts */ if (kf_has(k_ptr->flags_kind, KF_INSTA_ART) && artifact_is_known(get_artifact_from_kind(k_ptr))) { desc_art_fake(get_artifact_from_kind(k_ptr)); return; } /* Update the object recall window */ track_object_kind(k_idx); handle_stuff(p_ptr); /* Wipe the object */ object_wipe(o_ptr); /* Create the artifact */ object_prep(o_ptr, k_idx, EXTREMIFY); /* Hack -- its in the store */ if (k_info[k_idx].aware) o_ptr->ident |= (IDENT_STORE); /* It's fully know */ if (!k_info[k_idx].flavor) object_known(o_ptr); /* Hack -- Handle stuff */ handle_stuff(p_ptr); /* Describe */ tb = object_info(o_ptr, OINFO_DUMMY); object_desc(header, sizeof(header), o_ptr, ODESC_PREFIX | ODESC_FULL | ODESC_CAPITAL); textui_textblock_show(tb, area, format("%s", header)); textblock_free(tb); }
// Display the object info void DisplayArtifactKnowledge::button_press(int a_idx) { desc_art_fake(a_idx); }