2 * todo 1つ300行近い関数なので後ほど要分割
8 #include "autopick/autopick-describer.h"
9 #include "autopick/autopick-flags-table.h"
10 #include "autopick/autopick-key-flag-process.h"
11 #include "autopick/autopick-methods-table.h"
12 #include "system/angband.h"
13 #include "util/string-processor.h"
26 static void describe_autpick_jp(char *buff, autopick_type *entry, autopick_describer *describer)
28 concptr before_str[100];
29 if (IS_FLG(FLG_COLLECTING))
30 before_str[describer->before_n++] = "収集中で既に持っているスロットにまとめられる";
32 if (IS_FLG(FLG_UNAWARE))
33 before_str[describer->before_n++] = "未鑑定でその効果も判明していない";
35 if (IS_FLG(FLG_UNIDENTIFIED))
36 before_str[describer->before_n++] = "未鑑定の";
38 if (IS_FLG(FLG_IDENTIFIED))
39 before_str[describer->before_n++] = "鑑定済みの";
41 if (IS_FLG(FLG_STAR_IDENTIFIED))
42 before_str[describer->before_n++] = "完全に鑑定済みの";
44 if (IS_FLG(FLG_BOOSTED))
46 before_str[describer->before_n++] = "ダメージダイスが通常より大きい";
47 describer->body_str = "武器";
50 if (IS_FLG(FLG_MORE_DICE))
52 static char more_than_desc_str[] = "___";
53 before_str[describer->before_n++] = "ダメージダイスの最大値が";
54 describer->body_str = "武器";
56 sprintf(more_than_desc_str, "%d", entry->dice);
57 before_str[describer->before_n++] = more_than_desc_str;
58 before_str[describer->before_n++] = "以上の";
61 if (IS_FLG(FLG_MORE_BONUS))
63 static char more_bonus_desc_str[] = "___";
64 before_str[describer->before_n++] = "修正値が(+";
66 sprintf(more_bonus_desc_str, "%d", entry->bonus);
67 before_str[describer->before_n++] = more_bonus_desc_str;
68 before_str[describer->before_n++] = ")以上の";
71 if (IS_FLG(FLG_WORTHLESS))
72 before_str[describer->before_n++] = "店で無価値と判定される";
74 if (IS_FLG(FLG_ARTIFACT))
76 before_str[describer->before_n++] = "アーティファクトの";
77 describer->body_str = "装備";
82 before_str[describer->before_n++] = "エゴアイテムの";
83 describer->body_str = "装備";
88 before_str[describer->before_n++] = "上質の";
89 describer->body_str = "装備";
92 if (IS_FLG(FLG_NAMELESS))
94 before_str[describer->before_n++] = "エゴでもアーティファクトでもない";
95 describer->body_str = "装備";
98 if (IS_FLG(FLG_AVERAGE))
100 before_str[describer->before_n++] = "並の";
101 describer->body_str = "装備";
104 if (IS_FLG(FLG_RARE))
106 before_str[describer->before_n++] = "ドラゴン装備やカオス・ブレード等を含む珍しい";
107 describer->body_str = "装備";
110 if (IS_FLG(FLG_COMMON))
112 before_str[describer->before_n++] = "ありふれた(ドラゴン装備やカオス・ブレード等の珍しい物ではない)";
113 describer->body_str = "装備";
116 if (IS_FLG(FLG_WANTED))
118 before_str[describer->before_n++] = "ハンター事務所で賞金首とされている";
119 describer->body_str = "死体や骨";
122 if (IS_FLG(FLG_HUMAN))
124 before_str[describer->before_n++] = "悪魔魔法で使うための人間やヒューマノイドの";
125 describer->body_str = "死体や骨";
128 if (IS_FLG(FLG_UNIQUE))
130 before_str[describer->before_n++] = "ユニークモンスターの";
131 describer->body_str = "死体や骨";
134 if (IS_FLG(FLG_UNREADABLE))
136 before_str[describer->before_n++] = "あなたが読めない領域の";
137 describer->body_str = "魔法書";
140 if (IS_FLG(FLG_REALM1))
142 before_str[describer->before_n++] = "第一領域の";
143 describer->body_str = "魔法書";
146 if (IS_FLG(FLG_REALM2))
148 before_str[describer->before_n++] = "第二領域の";
149 describer->body_str = "魔法書";
152 if (IS_FLG(FLG_FIRST))
154 before_str[describer->before_n++] = "全4冊の内の1冊目の";
155 describer->body_str = "魔法書";
158 if (IS_FLG(FLG_SECOND))
160 before_str[describer->before_n++] = "全4冊の内の2冊目の";
161 describer->body_str = "魔法書";
164 if (IS_FLG(FLG_THIRD))
166 before_str[describer->before_n++] = "全4冊の内の3冊目の";
167 describer->body_str = "魔法書";
170 if (IS_FLG(FLG_FOURTH))
172 before_str[describer->before_n++] = "全4冊の内の4冊目の";
173 describer->body_str = "魔法書";
176 if (IS_FLG(FLG_ITEMS))
177 ; /* Nothing to do */
178 else if (IS_FLG(FLG_WEAPONS))
179 describer->body_str = "武器";
180 else if (IS_FLG(FLG_FAVORITE_WEAPONS))
181 describer->body_str = "得意武器";
182 else if (IS_FLG(FLG_ARMORS))
183 describer->body_str = "防具";
184 else if (IS_FLG(FLG_MISSILES))
185 describer->body_str = "弾や矢やクロスボウの矢";
186 else if (IS_FLG(FLG_DEVICES))
187 describer->body_str = "巻物や魔法棒や杖やロッド";
188 else if (IS_FLG(FLG_LIGHTS))
189 describer->body_str = "光源用のアイテム";
190 else if (IS_FLG(FLG_JUNKS))
191 describer->body_str = "折れた棒等のガラクタ";
192 else if (IS_FLG(FLG_CORPSES))
193 describer->body_str = "死体や骨";
194 else if (IS_FLG(FLG_SPELLBOOKS))
195 describer->body_str = "魔法書";
196 else if (IS_FLG(FLG_HAFTED))
197 describer->body_str = "鈍器";
198 else if (IS_FLG(FLG_SHIELDS))
199 describer->body_str = "盾";
200 else if (IS_FLG(FLG_BOWS))
201 describer->body_str = "スリングや弓やクロスボウ";
202 else if (IS_FLG(FLG_RINGS))
203 describer->body_str = "指輪";
204 else if (IS_FLG(FLG_AMULETS))
205 describer->body_str = "アミュレット";
206 else if (IS_FLG(FLG_SUITS))
207 describer->body_str = "鎧";
208 else if (IS_FLG(FLG_CLOAKS))
209 describer->body_str = "クローク";
210 else if (IS_FLG(FLG_HELMS))
211 describer->body_str = "ヘルメットや冠";
212 else if (IS_FLG(FLG_GLOVES))
213 describer->body_str = "籠手";
214 else if (IS_FLG(FLG_BOOTS))
215 describer->body_str = "ブーツ";
218 if (!describer->before_n)
220 else for (int i = 0; i < describer->before_n && before_str[i]; i++)
221 strcat(buff, before_str[i]);
223 strcat(buff, describer->body_str);
227 if (*describer->str == '^')
230 describer->top = TRUE;
233 strcat(buff, "で、名前が「");
234 strncat(buff, describer->str, 80);
236 strcat(buff, "」で始まるもの");
238 strcat(buff, "」を含むもの");
243 strncat(buff, format("に「%s」", describer->insc), 80);
245 if (angband_strstr(describer->insc, "%%all"))
246 strcat(buff, "(%%allは全能力を表す英字の記号で置換)");
247 else if (angband_strstr(describer->insc, "%all"))
248 strcat(buff, "(%allは全能力を表す記号で置換)");
249 else if (angband_strstr(describer->insc, "%%"))
250 strcat(buff, "(%%は追加能力を表す英字の記号で置換)");
251 else if (angband_strstr(describer->insc, "%"))
252 strcat(buff, "(%は追加能力を表す記号で置換)");
254 strcat(buff, "と刻んで");
259 if (describer->act & DONT_AUTOPICK)
260 strcat(buff, "放置する。");
261 else if (describer->act & DO_AUTODESTROY)
262 strcat(buff, "破壊する。");
263 else if (describer->act & DO_QUERY_AUTOPICK)
264 strcat(buff, "確認の後に拾う。");
268 if (describer->act & DO_DISPLAY)
270 if (describer->act & DONT_AUTOPICK)
271 strcat(buff, "全体マップ('M')で'N'を押したときに表示する。");
272 else if (describer->act & DO_AUTODESTROY)
273 strcat(buff, "全体マップ('M')で'K'を押したときに表示する。");
275 strcat(buff, "全体マップ('M')で'M'を押したときに表示する。");
278 strcat(buff, "全体マップには表示しない。");
283 void describe_autopick_en(char *buff, autopick_type *entry, autopick_describer *describer)
285 concptr before_str[20], after_str[20], which_str[20], whose_str[20];
286 int after_n = 0, which_n = 0, whose_n = 0;
287 if (IS_FLG(FLG_COLLECTING))
288 which_str[which_n++] = "can be absorbed into an existing inventory list slot";
290 if (IS_FLG(FLG_UNAWARE))
292 before_str[describer->before_n++] = "unidentified";
293 whose_str[whose_n++] = "basic abilities are not known";
296 if (IS_FLG(FLG_UNIDENTIFIED))
297 before_str[describer->before_n++] = "unidentified";
299 if (IS_FLG(FLG_IDENTIFIED))
300 before_str[describer->before_n++] = "identified";
302 if (IS_FLG(FLG_STAR_IDENTIFIED))
303 before_str[describer->before_n++] = "fully identified";
305 if (IS_FLG(FLG_RARE))
307 before_str[describer->before_n++] = "very rare";
308 describer->body_str = "equipments";
309 after_str[after_n++] = "such as Dragon armor, Blades of Chaos, etc.";
312 if (IS_FLG(FLG_COMMON))
314 before_str[describer->before_n++] = "relatively common";
315 describer->body_str = "equipments";
316 after_str[after_n++] = "compared to very rare Dragon armor, Blades of Chaos, etc.";
319 if (IS_FLG(FLG_WORTHLESS))
321 before_str[describer->before_n++] = "worthless";
322 which_str[which_n++] = "can not be sold at stores";
325 if (IS_FLG(FLG_ARTIFACT))
326 before_str[describer->before_n++] = "artifact";
329 before_str[describer->before_n++] = "ego";
331 if (IS_FLG(FLG_GOOD))
333 describer->body_str = "equipment";
334 which_str[which_n++] = "have good quality";
337 if (IS_FLG(FLG_NAMELESS))
339 describer->body_str = "equipment";
340 which_str[which_n++] = "is neither ego-item nor artifact";
343 if (IS_FLG(FLG_AVERAGE))
345 describer->body_str = "equipment";
346 which_str[which_n++] = "have average quality";
349 if (IS_FLG(FLG_BOOSTED))
351 describer->body_str = "weapons";
352 whose_str[whose_n++] = "damage dice is bigger than normal";
355 if (IS_FLG(FLG_MORE_DICE))
357 static char more_than_desc_str[] =
358 "maximum damage from dice is bigger than __";
359 describer->body_str = "weapons";
361 sprintf(more_than_desc_str + sizeof(more_than_desc_str) - 3,
363 whose_str[whose_n++] = more_than_desc_str;
366 if (IS_FLG(FLG_MORE_BONUS))
368 static char more_bonus_desc_str[] =
369 "magical bonus is bigger than (+__)";
371 sprintf(more_bonus_desc_str + sizeof(more_bonus_desc_str) - 4,
372 "%d)", entry->bonus);
373 whose_str[whose_n++] = more_bonus_desc_str;
376 if (IS_FLG(FLG_WANTED))
378 describer->body_str = "corpse or skeletons";
379 which_str[which_n++] = "is wanted at the Hunter's Office";
382 if (IS_FLG(FLG_HUMAN))
384 before_str[describer->before_n++] = "humanoid";
385 describer->body_str = "corpse or skeletons";
386 which_str[which_n++] = "can be used for Daemon magic";
389 if (IS_FLG(FLG_UNIQUE))
391 before_str[describer->before_n++] = "unique monster's";
392 describer->body_str = "corpse or skeletons";
395 if (IS_FLG(FLG_UNREADABLE))
397 describer->body_str = "spellbooks";
398 after_str[after_n++] = "of different realms from yours";
401 if (IS_FLG(FLG_REALM1))
403 describer->body_str = "spellbooks";
404 after_str[after_n++] = "of your first realm";
407 if (IS_FLG(FLG_REALM2))
409 describer->body_str = "spellbooks";
410 after_str[after_n++] = "of your second realm";
413 if (IS_FLG(FLG_FIRST))
415 before_str[describer->before_n++] = "first one of four";
416 describer->body_str = "spellbooks";
419 if (IS_FLG(FLG_SECOND))
421 before_str[describer->before_n++] = "second one of four";
422 describer->body_str = "spellbooks";
425 if (IS_FLG(FLG_THIRD))
427 before_str[describer->before_n++] = "third one of four";
428 describer->body_str = "spellbooks";
431 if (IS_FLG(FLG_FOURTH))
433 before_str[describer->before_n++] = "fourth one of four";
434 describer->body_str = "spellbooks";
437 if (IS_FLG(FLG_ITEMS))
438 ; /* Nothing to do */
439 else if (IS_FLG(FLG_WEAPONS))
440 describer->body_str = "weapons";
441 else if (IS_FLG(FLG_FAVORITE_WEAPONS))
442 describer->body_str = "favorite weapons";
443 else if (IS_FLG(FLG_ARMORS))
444 describer->body_str = "armors";
445 else if (IS_FLG(FLG_MISSILES))
446 describer->body_str = "shots, arrows or crossbow bolts";
447 else if (IS_FLG(FLG_DEVICES))
448 describer->body_str = "scrolls, wands, staffs or rods";
449 else if (IS_FLG(FLG_LIGHTS))
450 describer->body_str = "light sources";
451 else if (IS_FLG(FLG_JUNKS))
452 describer->body_str = "junk such as broken sticks";
453 else if (IS_FLG(FLG_CORPSES))
454 describer->body_str = "corpses or skeletons";
455 else if (IS_FLG(FLG_SPELLBOOKS))
456 describer->body_str = "spellbooks";
457 else if (IS_FLG(FLG_HAFTED))
458 describer->body_str = "hafted weapons";
459 else if (IS_FLG(FLG_SHIELDS))
460 describer->body_str = "shields";
461 else if (IS_FLG(FLG_BOWS))
462 describer->body_str = "slings, bows or crossbows";
463 else if (IS_FLG(FLG_RINGS))
464 describer->body_str = "rings";
465 else if (IS_FLG(FLG_AMULETS))
466 describer->body_str = "amulets";
467 else if (IS_FLG(FLG_SUITS))
468 describer->body_str = "body armors";
469 else if (IS_FLG(FLG_CLOAKS))
470 describer->body_str = "cloaks";
471 else if (IS_FLG(FLG_HELMS))
472 describer->body_str = "helms or crowns";
473 else if (IS_FLG(FLG_GLOVES))
474 describer->body_str = "gloves";
475 else if (IS_FLG(FLG_BOOTS))
476 describer->body_str = "boots";
480 if (*describer->str == '^')
483 describer->top = TRUE;
484 whose_str[whose_n++] = "name begins with \"";
487 which_str[which_n++] = "have \"";
490 if (describer->act & DONT_AUTOPICK)
491 strcpy(buff, "Leave on floor ");
492 else if (describer->act & DO_AUTODESTROY)
493 strcpy(buff, "Destroy ");
494 else if (describer->act & DO_QUERY_AUTOPICK)
495 strcpy(buff, "Ask to pick up ");
497 strcpy(buff, "Pickup ");
501 strncat(buff, format("and inscribe \"%s\"", describer->insc), 80);
503 if (angband_strstr(describer->insc, "%all"))
504 strcat(buff, ", replacing %all with code string representing all abilities,");
505 else if (angband_strstr(describer->insc, "%"))
506 strcat(buff, ", replacing % with code string representing extra random abilities,");
508 strcat(buff, " on ");
511 if (!describer->before_n)
512 strcat(buff, "all ");
514 for (int i = 0; i < describer->before_n && before_str[i]; i++)
516 strcat(buff, before_str[i]);
520 strcat(buff, describer->body_str);
521 for (int i = 0; i < after_n && after_str[i]; i++)
524 strcat(buff, after_str[i]);
527 for (int i = 0; i < whose_n && whose_str[i]; i++)
530 strcat(buff, " whose ");
532 strcat(buff, ", and ");
534 strcat(buff, whose_str[i]);
537 if (*describer->str && describer->top)
539 strcat(buff, describer->str);
543 if (whose_n && which_n)
544 strcat(buff, ", and ");
546 for (int i = 0; i < which_n && which_str[i]; i++)
549 strcat(buff, " which ");
551 strcat(buff, ", and ");
553 strcat(buff, which_str[i]);
556 if (*describer->str && !describer->top)
558 strncat(buff, describer->str, 80);
559 strcat(buff, "\" as part of its name");
564 if (describer->act & DO_DISPLAY)
566 if (describer->act & DONT_AUTOPICK)
567 strcat(buff, " Display these items when you press the N key in the full 'M'ap.");
568 else if (describer->act & DO_AUTODESTROY)
569 strcat(buff, " Display these items when you press the K key in the full 'M'ap.");
571 strcat(buff, " Display these items when you press the M key in the full 'M'ap.");
574 strcat(buff, " Not displayed in the full map.");
580 * Describe which kind of object is Auto-picked/destroyed
582 void describe_autopick(char *buff, autopick_type *entry)
584 autopick_describer describer;
585 describer.str = entry->name;
586 describer.act = entry->action;
587 describer.insc = entry->insc;
588 describer.top = FALSE;
589 describer.before_n = 0;
590 describer.body_str = _("アイテム", "items");
592 describe_autpick_jp(buff, entry, &describer);
594 describe_autopick_en(buff, entry, &describer);