2 * @brief 武器/防具/アクセサリアイテムにおける、耐性やスレイ等の表記
7 #include "flavor/flavor-describer.h"
8 #include "combat/shoot.h"
9 #include "flavor/flag-inscriptions-table.h"
10 #include "flavor/flavor-util.h"
11 #include "flavor/named-item-describer.h"
12 #include "flavor/object-flavor-types.h"
13 #include "game-option/text-display-options.h"
14 #include "grid/trap.h"
15 #include "inventory/inventory-slot-types.h"
16 #include "mind/mind-sniper.h"
17 #include "mind/mind-weaponsmith.h"
18 #include "object-enchant/object-ego.h"
19 #include "object-enchant/special-object-flags.h"
20 #include "object-enchant/tr-types.h"
21 #include "object-enchant/trg-types.h"
22 #include "object-hook/hook-quest.h"
23 #include "object/object-flags.h"
24 #include "object/object-kind.h"
25 #include "perception/object-perception.h"
26 #include "player-base/player-class.h"
27 #include "player/player-status-table.h"
28 #include "player/player-status.h"
29 #include "smith/object-smith.h"
30 #include "smith/smith-types.h"
31 #include "specific-object/bow.h"
32 #include "sv-definition/sv-lite-types.h"
33 #include "sv-definition/sv-weapon-types.h"
34 #include "system/floor-type-definition.h"
35 #include "system/object-type-definition.h"
36 #include "system/player-type-definition.h"
37 #include "util/bit-flags-calculator.h"
38 #include "util/string-processor.h"
39 #include "window/display-sub-window-items.h"
41 static void describe_chest_trap(flavor_type *flavor_ptr)
43 auto trap_kinds = chest_traps[flavor_ptr->o_ptr->pval];
44 if (trap_kinds.count() >= 2) {
45 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("(マルチ・トラップ)", " (Multiple Traps)"));
49 auto trap_kind = trap_kinds.first();
50 if (!trap_kind.has_value()) {
51 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("(施錠)", " (Locked)"));
55 switch (trap_kind.value()) {
56 case ChestTrapType::LOSE_STR:
57 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("(毒針)", " (Poison Needle)"));
59 case ChestTrapType::LOSE_CON:
60 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("(毒針)", " (Poison Needle)"));
62 case ChestTrapType::POISON:
63 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("(ガス・トラップ)", " (Gas Trap)"));
65 case ChestTrapType::PARALYZE:
66 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("(ガス・トラップ)", " (Gas Trap)"));
68 case ChestTrapType::EXPLODE:
69 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("(爆発装置)", " (Explosive Device)"));
71 case ChestTrapType::SUMMON:
72 case ChestTrapType::BIRD_STORM:
73 case ChestTrapType::E_SUMMON:
74 case ChestTrapType::H_SUMMON:
75 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("(召喚のルーン)", " (Summoning Runes)"));
77 case ChestTrapType::RUNES_OF_EVIL:
78 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("(邪悪なルーン)", " (Gleaming Black Runes)"));
80 case ChestTrapType::ALARM:
81 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("(警報装置)", " (Alarm)"));
83 case ChestTrapType::SCATTER:
84 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("(アイテム散乱)", " (Scatter)"));
86 case ChestTrapType::MAX:
87 throw("Invalid chest trap type is specified!");
91 static void describe_chest(flavor_type *flavor_ptr)
93 if (flavor_ptr->o_ptr->tval != ItemKindType::CHEST) {
97 if (!flavor_ptr->known) {
101 if (!flavor_ptr->o_ptr->pval) {
102 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("(空)", " (empty)"));
106 if (flavor_ptr->o_ptr->pval < 0) {
107 if (chest_traps[0 - flavor_ptr->o_ptr->pval].any()) {
108 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("(解除済)", " (disarmed)"));
110 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("(非施錠)", " (unlocked)"));
116 describe_chest_trap(flavor_ptr);
119 static void decide_tval_show(flavor_type *flavor_ptr)
121 if (flavor_ptr->tr_flags.has(TR_SHOW_MODS)) {
122 flavor_ptr->show_weapon = true;
125 if (flavor_ptr->o_ptr->is_smith() && (Smith::object_effect(flavor_ptr->o_ptr) == SmithEffectType::SLAY_GLOVE)) {
126 flavor_ptr->show_weapon = true;
129 if (flavor_ptr->o_ptr->to_h && flavor_ptr->o_ptr->to_d) {
130 flavor_ptr->show_weapon = true;
133 if (flavor_ptr->o_ptr->ac) {
134 flavor_ptr->show_armour = true;
138 static void describe_weapon_dice(PlayerType *player_ptr, flavor_type *flavor_ptr)
140 if (!flavor_ptr->known && object_is_quest_target(player_ptr->current_floor_ptr->quest_number, flavor_ptr->o_ptr)) {
144 flavor_ptr->t = object_desc_chr(flavor_ptr->t, ' ');
145 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p1);
146 auto is_bonus = (player_ptr->riding > 0) && flavor_ptr->o_ptr->is_lance();
147 auto bonus = is_bonus ? 2 : 0;
148 flavor_ptr->t = object_desc_num(flavor_ptr->t, flavor_ptr->o_ptr->dd + bonus);
149 flavor_ptr->t = object_desc_chr(flavor_ptr->t, 'd');
150 flavor_ptr->t = object_desc_num(flavor_ptr->t, flavor_ptr->o_ptr->ds);
151 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p2);
154 static void describe_bow(PlayerType *player_ptr, flavor_type *flavor_ptr)
156 flavor_ptr->power = bow_tmul(flavor_ptr->o_ptr->sval);
157 if (flavor_ptr->tr_flags.has(TR_XTRA_MIGHT)) {
161 flavor_ptr->t = object_desc_chr(flavor_ptr->t, ' ');
162 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p1);
163 flavor_ptr->t = object_desc_chr(flavor_ptr->t, 'x');
164 flavor_ptr->t = object_desc_num(flavor_ptr->t, flavor_ptr->power);
165 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p2);
168 if (!(flavor_ptr->mode & OD_DEBUG)) {
169 num_fire = calc_num_fire(player_ptr, flavor_ptr->o_ptr);
171 auto flgs = object_flags(flavor_ptr->o_ptr);
172 if (flgs.has(TR_XTRA_SHOTS)) {
176 if ((num_fire == 0) || (flavor_ptr->power <= 0) || !flavor_ptr->known) {
180 flavor_ptr->fire_rate = bow_energy(flavor_ptr->o_ptr->sval) / num_fire;
181 flavor_ptr->t = object_desc_chr(flavor_ptr->t, ' ');
182 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p1);
183 flavor_ptr->t = object_desc_num(flavor_ptr->t, flavor_ptr->fire_rate / 100);
184 flavor_ptr->t = object_desc_chr(flavor_ptr->t, '.');
185 flavor_ptr->t = object_desc_num(flavor_ptr->t, flavor_ptr->fire_rate % 100);
186 flavor_ptr->t = object_desc_str(flavor_ptr->t, "turn");
187 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p2);
190 static void describe_tval(PlayerType *player_ptr, flavor_type *flavor_ptr)
192 switch (flavor_ptr->o_ptr->tval) {
193 case ItemKindType::SHOT:
194 case ItemKindType::BOLT:
195 case ItemKindType::ARROW:
196 case ItemKindType::HAFTED:
197 case ItemKindType::POLEARM:
198 case ItemKindType::SWORD:
199 case ItemKindType::DIGGING:
200 describe_weapon_dice(player_ptr, flavor_ptr);
202 case ItemKindType::BOW:
203 describe_bow(player_ptr, flavor_ptr);
211 static void describe_named_item_tval(flavor_type *flavor_ptr)
213 if (!flavor_ptr->known) {
217 if (flavor_ptr->show_weapon) {
218 flavor_ptr->t = object_desc_chr(flavor_ptr->t, ' ');
219 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p1);
220 flavor_ptr->t = object_desc_int(flavor_ptr->t, flavor_ptr->o_ptr->to_h);
221 flavor_ptr->t = object_desc_chr(flavor_ptr->t, ',');
222 flavor_ptr->t = object_desc_int(flavor_ptr->t, flavor_ptr->o_ptr->to_d);
223 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p2);
227 if (flavor_ptr->o_ptr->to_h != 0) {
228 flavor_ptr->t = object_desc_chr(flavor_ptr->t, ' ');
229 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p1);
230 flavor_ptr->t = object_desc_int(flavor_ptr->t, flavor_ptr->o_ptr->to_h);
231 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p2);
235 if (flavor_ptr->o_ptr->to_d != 0) {
236 flavor_ptr->t = object_desc_chr(flavor_ptr->t, ' ');
237 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p1);
238 flavor_ptr->t = object_desc_int(flavor_ptr->t, flavor_ptr->o_ptr->to_d);
239 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p2);
243 static void describe_fire_energy(PlayerType *player_ptr, flavor_type *flavor_ptr)
245 ENERGY energy_fire = bow_energy(flavor_ptr->bow_ptr->sval);
246 if (player_ptr->num_fire == 0) {
247 flavor_ptr->t = object_desc_chr(flavor_ptr->t, '0');
251 flavor_ptr->avgdam *= (player_ptr->num_fire * 100);
252 flavor_ptr->avgdam /= energy_fire;
253 flavor_ptr->t = object_desc_num(flavor_ptr->t, flavor_ptr->avgdam);
254 flavor_ptr->t = object_desc_str(flavor_ptr->t, show_ammo_detail ? "/turn" : "");
255 if (!show_ammo_crit_ratio) {
259 int percent = calc_crit_ratio_shot(player_ptr, flavor_ptr->known ? flavor_ptr->o_ptr->to_h : 0, flavor_ptr->known ? flavor_ptr->bow_ptr->to_h : 0);
260 flavor_ptr->t = object_desc_chr(flavor_ptr->t, '/');
261 flavor_ptr->t = object_desc_num(flavor_ptr->t, percent / 100);
262 flavor_ptr->t = object_desc_chr(flavor_ptr->t, '.');
263 if (percent % 100 < 10) {
264 flavor_ptr->t = object_desc_chr(flavor_ptr->t, '0');
267 flavor_ptr->t = object_desc_num(flavor_ptr->t, percent % 100);
268 flavor_ptr->t = object_desc_str(flavor_ptr->t, show_ammo_detail ? "% crit" : "%");
271 static void describe_bow_power(PlayerType *player_ptr, flavor_type *flavor_ptr)
273 flavor_ptr->avgdam = flavor_ptr->o_ptr->dd * (flavor_ptr->o_ptr->ds + 1) * 10 / 2;
274 int tmul = bow_tmul(flavor_ptr->bow_ptr->sval);
275 if (flavor_ptr->bow_ptr->is_known()) {
276 flavor_ptr->avgdam += (flavor_ptr->bow_ptr->to_d * 10);
279 if (flavor_ptr->known) {
280 flavor_ptr->avgdam += (flavor_ptr->o_ptr->to_d * 10);
283 if (player_ptr->xtra_might) {
287 tmul = tmul * (100 + (int)(adj_str_td[player_ptr->stat_index[A_STR]]) - 128);
288 flavor_ptr->avgdam *= tmul;
289 flavor_ptr->avgdam /= (100 * 10);
290 flavor_ptr->avgdam = boost_concentration_damage(player_ptr, flavor_ptr->avgdam);
292 if (flavor_ptr->avgdam < 0) {
293 flavor_ptr->avgdam = 0;
296 flavor_ptr->t = object_desc_chr(flavor_ptr->t, ' ');
297 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p1);
298 if (show_ammo_no_crit) {
299 flavor_ptr->t = object_desc_num(flavor_ptr->t, flavor_ptr->avgdam);
300 flavor_ptr->t = object_desc_str(flavor_ptr->t, show_ammo_detail ? "/shot " : "/");
303 flavor_ptr->avgdam = calc_expect_crit_shot(player_ptr, flavor_ptr->o_ptr->weight, flavor_ptr->o_ptr->to_h, flavor_ptr->bow_ptr->to_h, flavor_ptr->avgdam);
304 flavor_ptr->t = object_desc_num(flavor_ptr->t, flavor_ptr->avgdam);
305 flavor_ptr->t = show_ammo_no_crit ? object_desc_str(flavor_ptr->t, show_ammo_detail ? "/crit " : "/")
306 : object_desc_str(flavor_ptr->t, show_ammo_detail ? "/shot " : "/");
307 describe_fire_energy(player_ptr, flavor_ptr);
308 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p2);
311 static void describe_spike_power(PlayerType *player_ptr, flavor_type *flavor_ptr)
313 int avgdam = player_ptr->mighty_throw ? (1 + 3) : 1;
314 int16_t energy_fire = 100 - player_ptr->lev;
315 avgdam += ((player_ptr->lev + 30) * (player_ptr->lev + 30) - 900) / 55;
316 flavor_ptr->t = object_desc_chr(flavor_ptr->t, ' ');
317 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p1);
318 flavor_ptr->t = object_desc_num(flavor_ptr->t, avgdam);
319 flavor_ptr->t = object_desc_chr(flavor_ptr->t, '/');
320 avgdam = 100 * avgdam / energy_fire;
321 flavor_ptr->t = object_desc_num(flavor_ptr->t, avgdam);
322 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p2);
325 static void describe_known_item_ac(flavor_type *flavor_ptr)
327 if (flavor_ptr->show_armour) {
328 flavor_ptr->t = object_desc_chr(flavor_ptr->t, ' ');
329 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->b1);
330 flavor_ptr->t = object_desc_num(flavor_ptr->t, flavor_ptr->o_ptr->ac);
331 flavor_ptr->t = object_desc_chr(flavor_ptr->t, ',');
332 flavor_ptr->t = object_desc_int(flavor_ptr->t, flavor_ptr->o_ptr->to_a);
333 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->b2);
337 if (flavor_ptr->o_ptr->to_a == 0) {
341 flavor_ptr->t = object_desc_chr(flavor_ptr->t, ' ');
342 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->b1);
343 flavor_ptr->t = object_desc_int(flavor_ptr->t, flavor_ptr->o_ptr->to_a);
344 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->b2);
347 static void describe_ac(flavor_type *flavor_ptr)
349 if (flavor_ptr->known) {
350 describe_known_item_ac(flavor_ptr);
354 if (!flavor_ptr->show_armour) {
358 flavor_ptr->t = object_desc_chr(flavor_ptr->t, ' ');
359 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->b1);
360 flavor_ptr->t = object_desc_num(flavor_ptr->t, flavor_ptr->o_ptr->ac);
361 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->b2);
364 static void describe_charges_staff_wand(flavor_type *flavor_ptr)
366 flavor_ptr->t = object_desc_chr(flavor_ptr->t, ' ');
367 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p1);
368 if ((flavor_ptr->o_ptr->tval == ItemKindType::STAFF) && (flavor_ptr->o_ptr->number > 1)) {
369 flavor_ptr->t = object_desc_num(flavor_ptr->t, flavor_ptr->o_ptr->number);
370 flavor_ptr->t = object_desc_str(flavor_ptr->t, "x ");
373 flavor_ptr->t = object_desc_num(flavor_ptr->t, flavor_ptr->o_ptr->pval);
374 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("回分", " charge"));
377 if (flavor_ptr->o_ptr->pval != 1) {
378 flavor_ptr->t = object_desc_chr(flavor_ptr->t, 's');
382 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p2);
385 static void describe_charges_rod(flavor_type *flavor_ptr)
387 if (flavor_ptr->o_ptr->timeout == 0) {
391 if (flavor_ptr->o_ptr->number <= 1) {
392 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("(充填中)", " (charging)"));
396 if (flavor_ptr->k_ptr->pval == 0) {
397 flavor_ptr->k_ptr->pval = 1;
400 flavor_ptr->power = (flavor_ptr->o_ptr->timeout + (flavor_ptr->k_ptr->pval - 1)) / flavor_ptr->k_ptr->pval;
401 if (flavor_ptr->power > flavor_ptr->o_ptr->number) {
402 flavor_ptr->power = flavor_ptr->o_ptr->number;
405 flavor_ptr->t = object_desc_str(flavor_ptr->t, " (");
406 flavor_ptr->t = object_desc_num(flavor_ptr->t, flavor_ptr->power);
407 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("本 充填中)", " charging)"));
410 static void describe_specific_pval(flavor_type *flavor_ptr)
412 if (flavor_ptr->tr_flags.has(TR_SPEED)) {
413 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("加速", " to speed"));
417 if (flavor_ptr->tr_flags.has(TR_BLOWS)) {
418 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("攻撃", " attack"));
421 if (std::abs(flavor_ptr->o_ptr->pval) != 1) {
422 flavor_ptr->t = object_desc_chr(flavor_ptr->t, 's');
429 if (flavor_ptr->tr_flags.has(TR_STEALTH)) {
430 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("隠密", " to stealth"));
434 if (flavor_ptr->tr_flags.has(TR_SEARCH)) {
435 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("探索", " to searching"));
439 if (flavor_ptr->tr_flags.has(TR_INFRA)) {
440 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("赤外線視力", " to infravision"));
444 static void describe_pval(flavor_type *flavor_ptr)
446 if (flavor_ptr->tr_flags.has_none_of(TR_PVAL_FLAG_MASK)) {
450 flavor_ptr->t = object_desc_chr(flavor_ptr->t, ' ');
451 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p1);
452 flavor_ptr->t = object_desc_int(flavor_ptr->t, flavor_ptr->o_ptr->pval);
453 if (flavor_ptr->tr_flags.has(TR_HIDE_TYPE)) {
454 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p2);
458 describe_specific_pval(flavor_ptr);
459 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p2);
462 static void describe_lamp_life(flavor_type *flavor_ptr)
464 if ((flavor_ptr->o_ptr->tval != ItemKindType::LITE) || (flavor_ptr->o_ptr->is_fixed_artifact() || (flavor_ptr->o_ptr->sval == SV_LITE_FEANOR))) {
468 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("(", " (with "));
469 auto fuel_magnification = flavor_ptr->o_ptr->ego_idx == EgoType::LITE_LONG ? 2 : 1;
470 flavor_ptr->t = object_desc_num(flavor_ptr->t, fuel_magnification * flavor_ptr->o_ptr->fuel);
471 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("ターンの寿命)", " turns of light)"));
475 * @brief 杖や光源等、寿命のあるアイテムの残り回数やターン表記
476 * @param アイテム表記への参照ポインタ
478 static void describe_remaining(flavor_type *flavor_ptr)
480 if (!flavor_ptr->known) {
484 if (((flavor_ptr->o_ptr->tval == ItemKindType::STAFF) || (flavor_ptr->o_ptr->tval == ItemKindType::WAND))) {
485 describe_charges_staff_wand(flavor_ptr);
486 } else if (flavor_ptr->o_ptr->tval == ItemKindType::ROD) {
487 describe_charges_rod(flavor_ptr);
490 describe_pval(flavor_ptr);
491 describe_lamp_life(flavor_ptr);
492 if (flavor_ptr->o_ptr->timeout && (flavor_ptr->o_ptr->tval != ItemKindType::ROD)) {
493 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("(充填中)", " (charging)"));
497 static void decide_item_feeling(flavor_type *flavor_ptr)
499 flavor_ptr->fake_insc_buf[0] = '\0';
500 if (flavor_ptr->o_ptr->feeling) {
501 strcpy(flavor_ptr->fake_insc_buf, game_inscriptions[flavor_ptr->o_ptr->feeling]);
505 if (flavor_ptr->o_ptr->is_cursed() && (flavor_ptr->known || (flavor_ptr->o_ptr->ident & IDENT_SENSE))) {
506 strcpy(flavor_ptr->fake_insc_buf, _("呪われている", "cursed"));
510 if (((flavor_ptr->o_ptr->tval == ItemKindType::RING) || (flavor_ptr->o_ptr->tval == ItemKindType::AMULET) || (flavor_ptr->o_ptr->tval == ItemKindType::LITE) || (flavor_ptr->o_ptr->tval == ItemKindType::FIGURINE)) && flavor_ptr->aware && !flavor_ptr->known && !(flavor_ptr->o_ptr->ident & IDENT_SENSE)) {
511 strcpy(flavor_ptr->fake_insc_buf, _("未鑑定", "unidentified"));
515 if (!flavor_ptr->known && (flavor_ptr->o_ptr->ident & IDENT_EMPTY)) {
516 strcpy(flavor_ptr->fake_insc_buf, _("空", "empty"));
520 if (!flavor_ptr->aware && flavor_ptr->o_ptr->is_tried()) {
521 strcpy(flavor_ptr->fake_insc_buf, _("未判明", "tried"));
526 * @brief オブジェクトの各表記を返すメイン関数 / Creates a description of the item "o_ptr", and stores it in "out_val".
527 * @param player_ptr プレイヤーへの参照ポインタ
528 * @param buf 表記を返すための文字列参照ポインタ
529 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
530 * @param mode 表記に関するオプション指定
531 * @return 現在クエスト達成目的のアイテムならばTRUEを返す
533 void describe_flavor(PlayerType *player_ptr, char *buf, ObjectType *o_ptr, BIT_FLAGS mode)
535 flavor_type tmp_flavor;
536 flavor_type *flavor_ptr = initialize_flavor_type(&tmp_flavor, buf, o_ptr, mode);
537 describe_named_item(player_ptr, flavor_ptr);
538 if (flavor_ptr->mode & OD_NAME_ONLY || o_ptr->k_idx == 0) {
539 angband_strcpy(flavor_ptr->buf, flavor_ptr->tmp_val, MAX_NLEN);
543 describe_chest(flavor_ptr);
544 decide_tval_show(flavor_ptr);
545 describe_tval(player_ptr, flavor_ptr);
546 describe_named_item_tval(flavor_ptr);
547 if (!(mode & OD_DEBUG)) {
548 flavor_ptr->bow_ptr = &player_ptr->inventory_list[INVEN_BOW];
549 if ((flavor_ptr->bow_ptr->k_idx != 0) && (flavor_ptr->o_ptr->tval == bow_tval_ammo(flavor_ptr->bow_ptr))) {
550 describe_bow_power(player_ptr, flavor_ptr);
551 } else if (PlayerClass(player_ptr).equals(PlayerClassType::NINJA) && (flavor_ptr->o_ptr->tval == ItemKindType::SPIKE)) {
552 describe_spike_power(player_ptr, flavor_ptr);
556 describe_ac(flavor_ptr);
557 if (flavor_ptr->mode & OD_NAME_AND_ENCHANT) {
558 angband_strcpy(flavor_ptr->buf, flavor_ptr->tmp_val, MAX_NLEN);
562 describe_remaining(flavor_ptr);
563 if (flavor_ptr->mode & OD_OMIT_INSCRIPTION) {
564 angband_strcpy(flavor_ptr->buf, flavor_ptr->tmp_val, MAX_NLEN);
568 display_short_flavors(flavor_ptr);
569 decide_item_feeling(flavor_ptr);
570 display_item_discount(flavor_ptr);
571 display_item_fake_inscription(flavor_ptr);
572 angband_strcpy(flavor_ptr->buf, flavor_ptr->tmp_val, MAX_NLEN);