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/object-smith.h"
20 #include "object-enchant/smith-types.h"
21 #include "object-enchant/special-object-flags.h"
22 #include "object-enchant/tr-types.h"
23 #include "object-enchant/trg-types.h"
24 #include "object-hook/hook-quest.h"
25 #include "object/object-flags.h"
26 #include "object/object-kind.h"
27 #include "perception/object-perception.h"
28 #include "player/player-status-table.h"
29 #include "player/player-status.h"
30 #include "specific-object/bow.h"
31 #include "sv-definition/sv-lite-types.h"
32 #include "sv-definition/sv-weapon-types.h"
33 #include "system/floor-type-definition.h"
34 #include "system/object-type-definition.h"
35 #include "system/player-type-definition.h"
36 #include "util/bit-flags-calculator.h"
37 #include "util/string-processor.h"
38 #include "window/display-sub-window-items.h"
40 static void describe_chest_trap(flavor_type *flavor_ptr)
42 auto trap_kinds = chest_traps[flavor_ptr->o_ptr->pval];
43 if (trap_kinds.count() >= 2) {
44 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("(マルチ・トラップ)", " (Multiple Traps)"));
48 auto trap_kind = trap_kinds.first();
49 if (!trap_kind.has_value()) {
50 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("(施錠)", " (Locked)"));
54 switch (trap_kind.value()) {
55 case ChestTrapType::LOSE_STR:
56 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("(毒針)", " (Poison Needle)"));
58 case ChestTrapType::LOSE_CON:
59 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("(毒針)", " (Poison Needle)"));
61 case ChestTrapType::POISON:
62 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("(ガス・トラップ)", " (Gas Trap)"));
64 case ChestTrapType::PARALYZE:
65 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("(ガス・トラップ)", " (Gas Trap)"));
67 case ChestTrapType::EXPLODE:
68 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("(爆発装置)", " (Explosive Device)"));
70 case ChestTrapType::SUMMON:
71 case ChestTrapType::BIRD_STORM:
72 case ChestTrapType::E_SUMMON:
73 case ChestTrapType::H_SUMMON:
74 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("(召喚のルーン)", " (Summoning Runes)"));
76 case ChestTrapType::RUNES_OF_EVIL:
77 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("(邪悪なルーン)", " (Gleaming Black Runes)"));
79 case ChestTrapType::ALARM:
80 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("(警報装置)", " (Alarm)"));
82 case ChestTrapType::SCATTER:
83 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("(アイテム散乱)", " (Scatter)"));
85 case ChestTrapType::MAX:
86 throw("Invalid chest trap type is specified!");
90 static void describe_chest(flavor_type *flavor_ptr)
92 if (flavor_ptr->o_ptr->tval != ItemKindType::CHEST)
95 if (!flavor_ptr->known)
98 if (!flavor_ptr->o_ptr->pval) {
99 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("(空)", " (empty)"));
103 if (flavor_ptr->o_ptr->pval < 0) {
104 if (chest_traps[0 - flavor_ptr->o_ptr->pval].any())
105 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("(解除済)", " (disarmed)"));
107 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("(非施錠)", " (unlocked)"));
112 describe_chest_trap(flavor_ptr);
115 static void decide_tval_show(flavor_type *flavor_ptr)
117 if (flavor_ptr->tr_flags.has(TR_SHOW_MODS))
118 flavor_ptr->show_weapon = true;
120 if (flavor_ptr->o_ptr->is_smith() && (Smith::object_effect(flavor_ptr->o_ptr) == SmithEffectType::SLAY_GLOVE))
121 flavor_ptr->show_weapon = true;
123 if (flavor_ptr->o_ptr->to_h && flavor_ptr->o_ptr->to_d)
124 flavor_ptr->show_weapon = true;
126 if (flavor_ptr->o_ptr->ac)
127 flavor_ptr->show_armour = true;
130 static void describe_weapon_dice(PlayerType *player_ptr, flavor_type *flavor_ptr)
132 if (!flavor_ptr->known && object_is_quest_target(player_ptr->current_floor_ptr->inside_quest, flavor_ptr->o_ptr))
135 flavor_ptr->t = object_desc_chr(flavor_ptr->t, ' ');
136 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p1);
137 auto is_bonus = (player_ptr->riding > 0) && flavor_ptr->o_ptr->is_lance();
138 auto bonus = is_bonus ? 2 : 0;
139 flavor_ptr->t = object_desc_num(flavor_ptr->t, flavor_ptr->o_ptr->dd + bonus);
140 flavor_ptr->t = object_desc_chr(flavor_ptr->t, 'd');
141 flavor_ptr->t = object_desc_num(flavor_ptr->t, flavor_ptr->o_ptr->ds);
142 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p2);
145 static void describe_bow(PlayerType *player_ptr, flavor_type *flavor_ptr)
147 flavor_ptr->power = bow_tmul(flavor_ptr->o_ptr->sval);
148 if (flavor_ptr->tr_flags.has(TR_XTRA_MIGHT))
151 flavor_ptr->t = object_desc_chr(flavor_ptr->t, ' ');
152 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p1);
153 flavor_ptr->t = object_desc_chr(flavor_ptr->t, 'x');
154 flavor_ptr->t = object_desc_num(flavor_ptr->t, flavor_ptr->power);
155 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p2);
158 if (!(flavor_ptr->mode & OD_DEBUG)) {
159 num_fire = calc_num_fire(player_ptr, flavor_ptr->o_ptr);
161 auto flgs = object_flags(flavor_ptr->o_ptr);
162 if (flgs.has(TR_XTRA_SHOTS))
165 if ((num_fire == 0) || (flavor_ptr->power <= 0) || !flavor_ptr->known)
168 flavor_ptr->fire_rate = bow_energy(flavor_ptr->o_ptr->sval) / num_fire;
169 flavor_ptr->t = object_desc_chr(flavor_ptr->t, ' ');
170 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p1);
171 flavor_ptr->t = object_desc_num(flavor_ptr->t, flavor_ptr->fire_rate / 100);
172 flavor_ptr->t = object_desc_chr(flavor_ptr->t, '.');
173 flavor_ptr->t = object_desc_num(flavor_ptr->t, flavor_ptr->fire_rate % 100);
174 flavor_ptr->t = object_desc_str(flavor_ptr->t, "turn");
175 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p2);
178 static void describe_tval(PlayerType *player_ptr, flavor_type *flavor_ptr)
180 switch (flavor_ptr->o_ptr->tval) {
181 case ItemKindType::SHOT:
182 case ItemKindType::BOLT:
183 case ItemKindType::ARROW:
184 case ItemKindType::HAFTED:
185 case ItemKindType::POLEARM:
186 case ItemKindType::SWORD:
187 case ItemKindType::DIGGING:
188 describe_weapon_dice(player_ptr, flavor_ptr);
190 case ItemKindType::BOW:
191 describe_bow(player_ptr, flavor_ptr);
199 static void describe_named_item_tval(flavor_type *flavor_ptr)
201 if (!flavor_ptr->known)
204 if (flavor_ptr->show_weapon) {
205 flavor_ptr->t = object_desc_chr(flavor_ptr->t, ' ');
206 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p1);
207 flavor_ptr->t = object_desc_int(flavor_ptr->t, flavor_ptr->o_ptr->to_h);
208 flavor_ptr->t = object_desc_chr(flavor_ptr->t, ',');
209 flavor_ptr->t = object_desc_int(flavor_ptr->t, flavor_ptr->o_ptr->to_d);
210 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p2);
214 if (flavor_ptr->o_ptr->to_h != 0) {
215 flavor_ptr->t = object_desc_chr(flavor_ptr->t, ' ');
216 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p1);
217 flavor_ptr->t = object_desc_int(flavor_ptr->t, flavor_ptr->o_ptr->to_h);
218 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p2);
222 if (flavor_ptr->o_ptr->to_d != 0) {
223 flavor_ptr->t = object_desc_chr(flavor_ptr->t, ' ');
224 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p1);
225 flavor_ptr->t = object_desc_int(flavor_ptr->t, flavor_ptr->o_ptr->to_d);
226 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p2);
230 static void describe_fire_energy(PlayerType *player_ptr, flavor_type *flavor_ptr)
232 ENERGY energy_fire = bow_energy(flavor_ptr->bow_ptr->sval);
233 if (player_ptr->num_fire == 0) {
234 flavor_ptr->t = object_desc_chr(flavor_ptr->t, '0');
238 flavor_ptr->avgdam *= (player_ptr->num_fire * 100);
239 flavor_ptr->avgdam /= energy_fire;
240 flavor_ptr->t = object_desc_num(flavor_ptr->t, flavor_ptr->avgdam);
241 flavor_ptr->t = object_desc_str(flavor_ptr->t, show_ammo_detail ? "/turn" : "");
242 if (!show_ammo_crit_ratio)
245 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);
246 flavor_ptr->t = object_desc_chr(flavor_ptr->t, '/');
247 flavor_ptr->t = object_desc_num(flavor_ptr->t, percent / 100);
248 flavor_ptr->t = object_desc_chr(flavor_ptr->t, '.');
249 if (percent % 100 < 10)
250 flavor_ptr->t = object_desc_chr(flavor_ptr->t, '0');
252 flavor_ptr->t = object_desc_num(flavor_ptr->t, percent % 100);
253 flavor_ptr->t = object_desc_str(flavor_ptr->t, show_ammo_detail ? "% crit" : "%");
256 static void describe_bow_power(PlayerType *player_ptr, flavor_type *flavor_ptr)
258 flavor_ptr->avgdam = flavor_ptr->o_ptr->dd * (flavor_ptr->o_ptr->ds + 1) * 10 / 2;
259 int tmul = bow_tmul(flavor_ptr->bow_ptr->sval);
260 if (flavor_ptr->bow_ptr->is_known())
261 flavor_ptr->avgdam += (flavor_ptr->bow_ptr->to_d * 10);
263 if (flavor_ptr->known)
264 flavor_ptr->avgdam += (flavor_ptr->o_ptr->to_d * 10);
266 if (player_ptr->xtra_might)
269 tmul = tmul * (100 + (int)(adj_str_td[player_ptr->stat_index[A_STR]]) - 128);
270 flavor_ptr->avgdam *= tmul;
271 flavor_ptr->avgdam /= (100 * 10);
272 flavor_ptr->avgdam = boost_concentration_damage(player_ptr, flavor_ptr->avgdam);
274 if (flavor_ptr->avgdam < 0)
275 flavor_ptr->avgdam = 0;
277 flavor_ptr->t = object_desc_chr(flavor_ptr->t, ' ');
278 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p1);
279 if (show_ammo_no_crit) {
280 flavor_ptr->t = object_desc_num(flavor_ptr->t, flavor_ptr->avgdam);
281 flavor_ptr->t = object_desc_str(flavor_ptr->t, show_ammo_detail ? "/shot " : "/");
284 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);
285 flavor_ptr->t = object_desc_num(flavor_ptr->t, flavor_ptr->avgdam);
286 flavor_ptr->t = show_ammo_no_crit ? object_desc_str(flavor_ptr->t, show_ammo_detail ? "/crit " : "/")
287 : object_desc_str(flavor_ptr->t, show_ammo_detail ? "/shot " : "/");
288 describe_fire_energy(player_ptr, flavor_ptr);
289 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p2);
292 static void describe_spike_power(PlayerType *player_ptr, flavor_type *flavor_ptr)
294 int avgdam = player_ptr->mighty_throw ? (1 + 3) : 1;
295 int16_t energy_fire = 100 - player_ptr->lev;
296 avgdam += ((player_ptr->lev + 30) * (player_ptr->lev + 30) - 900) / 55;
297 flavor_ptr->t = object_desc_chr(flavor_ptr->t, ' ');
298 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p1);
299 flavor_ptr->t = object_desc_num(flavor_ptr->t, avgdam);
300 flavor_ptr->t = object_desc_chr(flavor_ptr->t, '/');
301 avgdam = 100 * avgdam / energy_fire;
302 flavor_ptr->t = object_desc_num(flavor_ptr->t, avgdam);
303 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p2);
306 static void describe_known_item_ac(flavor_type *flavor_ptr)
308 if (flavor_ptr->show_armour) {
309 flavor_ptr->t = object_desc_chr(flavor_ptr->t, ' ');
310 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->b1);
311 flavor_ptr->t = object_desc_num(flavor_ptr->t, flavor_ptr->o_ptr->ac);
312 flavor_ptr->t = object_desc_chr(flavor_ptr->t, ',');
313 flavor_ptr->t = object_desc_int(flavor_ptr->t, flavor_ptr->o_ptr->to_a);
314 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->b2);
318 if (flavor_ptr->o_ptr->to_a == 0)
321 flavor_ptr->t = object_desc_chr(flavor_ptr->t, ' ');
322 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->b1);
323 flavor_ptr->t = object_desc_int(flavor_ptr->t, flavor_ptr->o_ptr->to_a);
324 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->b2);
327 static void describe_ac(flavor_type *flavor_ptr)
329 if (flavor_ptr->known) {
330 describe_known_item_ac(flavor_ptr);
334 if (!flavor_ptr->show_armour)
337 flavor_ptr->t = object_desc_chr(flavor_ptr->t, ' ');
338 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->b1);
339 flavor_ptr->t = object_desc_num(flavor_ptr->t, flavor_ptr->o_ptr->ac);
340 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->b2);
343 static void describe_charges_staff_wand(flavor_type *flavor_ptr)
345 flavor_ptr->t = object_desc_chr(flavor_ptr->t, ' ');
346 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p1);
347 if ((flavor_ptr->o_ptr->tval == ItemKindType::STAFF) && (flavor_ptr->o_ptr->number > 1)) {
348 flavor_ptr->t = object_desc_num(flavor_ptr->t, flavor_ptr->o_ptr->number);
349 flavor_ptr->t = object_desc_str(flavor_ptr->t, "x ");
352 flavor_ptr->t = object_desc_num(flavor_ptr->t, flavor_ptr->o_ptr->pval);
353 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("回分", " charge"));
356 if (flavor_ptr->o_ptr->pval != 1)
357 flavor_ptr->t = object_desc_chr(flavor_ptr->t, 's');
360 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p2);
363 static void describe_charges_rod(flavor_type *flavor_ptr)
365 if (flavor_ptr->o_ptr->timeout == 0)
368 if (flavor_ptr->o_ptr->number <= 1) {
369 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("(充填中)", " (charging)"));
373 if (flavor_ptr->k_ptr->pval == 0)
374 flavor_ptr->k_ptr->pval = 1;
376 flavor_ptr->power = (flavor_ptr->o_ptr->timeout + (flavor_ptr->k_ptr->pval - 1)) / flavor_ptr->k_ptr->pval;
377 if (flavor_ptr->power > flavor_ptr->o_ptr->number)
378 flavor_ptr->power = flavor_ptr->o_ptr->number;
380 flavor_ptr->t = object_desc_str(flavor_ptr->t, " (");
381 flavor_ptr->t = object_desc_num(flavor_ptr->t, flavor_ptr->power);
382 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("本 充填中)", " charging)"));
385 static void describe_specific_pval(flavor_type *flavor_ptr)
387 if (flavor_ptr->tr_flags.has(TR_SPEED)) {
388 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("加速", " to speed"));
392 if (flavor_ptr->tr_flags.has(TR_BLOWS)) {
393 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("攻撃", " attack"));
396 if (std::abs(flavor_ptr->o_ptr->pval) != 1)
397 flavor_ptr->t = object_desc_chr(flavor_ptr->t, 's');
403 if (flavor_ptr->tr_flags.has(TR_STEALTH)) {
404 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("隠密", " to stealth"));
408 if (flavor_ptr->tr_flags.has(TR_SEARCH)) {
409 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("探索", " to searching"));
413 if (flavor_ptr->tr_flags.has(TR_INFRA))
414 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("赤外線視力", " to infravision"));
417 static void describe_pval(flavor_type *flavor_ptr)
419 if (flavor_ptr->tr_flags.has_none_of(TR_PVAL_FLAG_MASK))
422 flavor_ptr->t = object_desc_chr(flavor_ptr->t, ' ');
423 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p1);
424 flavor_ptr->t = object_desc_int(flavor_ptr->t, flavor_ptr->o_ptr->pval);
425 if (flavor_ptr->tr_flags.has(TR_HIDE_TYPE)) {
426 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p2);
430 describe_specific_pval(flavor_ptr);
431 flavor_ptr->t = object_desc_chr(flavor_ptr->t, flavor_ptr->p2);
434 static void describe_lamp_life(flavor_type *flavor_ptr)
436 if ((flavor_ptr->o_ptr->tval != ItemKindType::LITE) || (flavor_ptr->o_ptr->is_fixed_artifact() || (flavor_ptr->o_ptr->sval == SV_LITE_FEANOR)))
439 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("(", " (with "));
440 if (flavor_ptr->o_ptr->name2 == EGO_LITE_LONG)
441 flavor_ptr->t = object_desc_num(flavor_ptr->t, flavor_ptr->o_ptr->xtra4 * 2);
443 flavor_ptr->t = object_desc_num(flavor_ptr->t, flavor_ptr->o_ptr->xtra4);
445 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("ターンの寿命)", " turns of light)"));
449 * @brief 杖や光源等、寿命のあるアイテムの残り回数やターン表記
450 * @param アイテム表記への参照ポインタ
452 static void describe_remaining(flavor_type *flavor_ptr)
454 if (!flavor_ptr->known)
457 if (((flavor_ptr->o_ptr->tval == ItemKindType::STAFF) || (flavor_ptr->o_ptr->tval == ItemKindType::WAND)))
458 describe_charges_staff_wand(flavor_ptr);
459 else if (flavor_ptr->o_ptr->tval == ItemKindType::ROD)
460 describe_charges_rod(flavor_ptr);
462 describe_pval(flavor_ptr);
463 describe_lamp_life(flavor_ptr);
464 if (flavor_ptr->o_ptr->timeout && (flavor_ptr->o_ptr->tval != ItemKindType::ROD))
465 flavor_ptr->t = object_desc_str(flavor_ptr->t, _("(充填中)", " (charging)"));
468 static void decide_item_feeling(flavor_type *flavor_ptr)
470 flavor_ptr->fake_insc_buf[0] = '\0';
471 if (flavor_ptr->o_ptr->feeling) {
472 strcpy(flavor_ptr->fake_insc_buf, game_inscriptions[flavor_ptr->o_ptr->feeling]);
476 if (flavor_ptr->o_ptr->is_cursed() && (flavor_ptr->known || (flavor_ptr->o_ptr->ident & IDENT_SENSE))) {
477 strcpy(flavor_ptr->fake_insc_buf, _("呪われている", "cursed"));
481 if (((flavor_ptr->o_ptr->tval == ItemKindType::RING) || (flavor_ptr->o_ptr->tval == ItemKindType::AMULET) || (flavor_ptr->o_ptr->tval == ItemKindType::LITE)
482 || (flavor_ptr->o_ptr->tval == ItemKindType::FIGURINE))
483 && flavor_ptr->aware && !flavor_ptr->known && !(flavor_ptr->o_ptr->ident & IDENT_SENSE)) {
484 strcpy(flavor_ptr->fake_insc_buf, _("未鑑定", "unidentified"));
488 if (!flavor_ptr->known && (flavor_ptr->o_ptr->ident & IDENT_EMPTY)) {
489 strcpy(flavor_ptr->fake_insc_buf, _("空", "empty"));
493 if (!flavor_ptr->aware && flavor_ptr->o_ptr->is_tried())
494 strcpy(flavor_ptr->fake_insc_buf, _("未判明", "tried"));
498 * @brief オブジェクトの各表記を返すメイン関数 / Creates a description of the item "o_ptr", and stores it in "out_val".
499 * @param player_ptr プレイヤーへの参照ポインタ
500 * @param buf 表記を返すための文字列参照ポインタ
501 * @param o_ptr 特性短縮表記を得たいオブジェクト構造体の参照ポインタ
502 * @param mode 表記に関するオプション指定
503 * @return 現在クエスト達成目的のアイテムならばTRUEを返す
505 void describe_flavor(PlayerType *player_ptr, char *buf, object_type *o_ptr, BIT_FLAGS mode)
507 flavor_type tmp_flavor;
508 flavor_type *flavor_ptr = initialize_flavor_type(&tmp_flavor, buf, o_ptr, mode);
509 describe_named_item(player_ptr, flavor_ptr);
510 if (flavor_ptr->mode & OD_NAME_ONLY || o_ptr->k_idx == 0) {
511 angband_strcpy(flavor_ptr->buf, flavor_ptr->tmp_val, MAX_NLEN);
515 describe_chest(flavor_ptr);
516 decide_tval_show(flavor_ptr);
517 describe_tval(player_ptr, flavor_ptr);
518 describe_named_item_tval(flavor_ptr);
519 if (!(mode & OD_DEBUG)) {
520 flavor_ptr->bow_ptr = &player_ptr->inventory_list[INVEN_BOW];
521 if ((flavor_ptr->bow_ptr->k_idx != 0) && (flavor_ptr->o_ptr->tval == bow_tval_ammo(flavor_ptr->bow_ptr)))
522 describe_bow_power(player_ptr, flavor_ptr);
523 else if ((player_ptr->pclass == PlayerClassType::NINJA) && (flavor_ptr->o_ptr->tval == ItemKindType::SPIKE))
524 describe_spike_power(player_ptr, flavor_ptr);
527 describe_ac(flavor_ptr);
528 if (flavor_ptr->mode & OD_NAME_AND_ENCHANT) {
529 angband_strcpy(flavor_ptr->buf, flavor_ptr->tmp_val, MAX_NLEN);
533 describe_remaining(flavor_ptr);
534 if (flavor_ptr->mode & OD_OMIT_INSCRIPTION) {
535 angband_strcpy(flavor_ptr->buf, flavor_ptr->tmp_val, MAX_NLEN);
539 display_short_flavors(flavor_ptr);
540 decide_item_feeling(flavor_ptr);
541 display_item_discount(flavor_ptr);
542 display_item_fake_inscription(flavor_ptr);
543 angband_strcpy(flavor_ptr->buf, flavor_ptr->tmp_val, MAX_NLEN);