OSDN Git Service

[Refactor] #40647 Separated body-imptovement-info.c/h from self-info.c
[hengband/hengband.git] / src / player-info / self-info.c
1 /*!
2  * @brief 自己分析処理/ Self knowledge
3  * @date 2018/09/07
4  * @author deskull
5  * <pre>
6  * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
7  * This software may be copied and distributed for educational, research,
8  * and not for profit purposes provided that this copyright and statement
9  * are included in all such copies.  Other copyrights may also apply.
10  * </pre>
11  */
12
13 #include "player-info/self-info.h"
14 #include "inventory/inventory-slot-types.h"
15 #include "io/input-key-acceptor.h"
16 #include "mutation/mutation-flag-types.h"
17 #include "object-enchant/tr-types.h"
18 #include "object-enchant/trc-types.h"
19 #include "object/object-flags.h"
20 #include "player-info/avatar.h"
21 #include "player-info/body-improvement-info.h"
22 #include "player-info/class-ability-info.h"
23 #include "player-info/mutation-info.h"
24 #include "player-info/race-ability-info.h"
25 #include "player-info/self-info-util.h"
26 #include "player/attack-defense-types.h"
27 #include "player/player-class.h"
28 #include "player/player-race-types.h"
29 #include "player/player-race.h"
30 #include "player/player-status-flags.h"
31 #include "realm/realm-names-table.h"
32 #include "realm/realm-song-numbers.h"
33 #include "status/element-resistance.h"
34 #include "term/screen-processor.h"
35 #include "util/bit-flags-calculator.h"
36
37 void display_life_rating(player_type *creature_ptr, self_info_type *si_ptr)
38 {
39     creature_ptr->knowledge |= KNOW_STAT | KNOW_HPRATE;
40     strcpy(si_ptr->plev_buf, "");
41     int percent
42         = (int)(((long)creature_ptr->player_hp[PY_MAX_LEVEL - 1] * 200L) / (2 * creature_ptr->hitdie + ((PY_MAX_LEVEL - 1 + 3) * (creature_ptr->hitdie + 1))));
43     sprintf(si_ptr->plev_buf, _("現在の体力ランク : %d/100", "Your current Life Rating is %d/100."), percent);
44     strcpy(si_ptr->buf[0], si_ptr->plev_buf);
45     si_ptr->info[si_ptr->line++] = si_ptr->buf[0];
46     si_ptr->info[si_ptr->line++] = "";
47 }
48
49 void display_max_base_status(player_type *creature_ptr, self_info_type *si_ptr)
50 {
51     si_ptr->info[si_ptr->line++] = _("能力の最大値", "Limits of maximum stats");
52     for (base_status_type v_nr = 0; v_nr < A_MAX; v_nr++) {
53         char stat_desc[80];
54         sprintf(stat_desc, "%s 18/%d", stat_names[v_nr], creature_ptr->stat_max_max[v_nr] - 18);
55         strcpy(si_ptr->s_string[v_nr], stat_desc);
56         si_ptr->info[si_ptr->line++] = si_ptr->s_string[v_nr];
57     }
58 }
59
60 void display_virtue(player_type *creature_ptr, self_info_type *si_ptr)
61 {
62     si_ptr->info[si_ptr->line++] = "";
63     sprintf(si_ptr->plev_buf, _("現在の属性 : %s(%ld)", "Your alignment : %s(%ld)"), your_alignment(creature_ptr), (long int)creature_ptr->align);
64     strcpy(si_ptr->buf[1], si_ptr->plev_buf);
65     si_ptr->info[si_ptr->line++] = si_ptr->buf[1];
66     for (int v_nr = 0; v_nr < 8; v_nr++) {
67         GAME_TEXT vir_name[20];
68         char vir_desc[80];
69         int tester = creature_ptr->virtues[v_nr];
70         strcpy(vir_name, virtue[(creature_ptr->vir_types[v_nr]) - 1]);
71         sprintf(vir_desc, _("おっと。%sの情報なし。", "Oops. No info about %s."), vir_name);
72         if (tester < -100)
73             sprintf(vir_desc, _("[%s]の対極 (%d)", "You are the polar opposite of %s (%d)."), vir_name, tester);
74         else if (tester < -80)
75             sprintf(vir_desc, _("[%s]の大敵 (%d)", "You are an arch-enemy of %s (%d)."), vir_name, tester);
76         else if (tester < -60)
77             sprintf(vir_desc, _("[%s]の強敵 (%d)", "You are a bitter enemy of %s (%d)."), vir_name, tester);
78         else if (tester < -40)
79             sprintf(vir_desc, _("[%s]の敵 (%d)", "You are an enemy of %s (%d)."), vir_name, tester);
80         else if (tester < -20)
81             sprintf(vir_desc, _("[%s]の罪者 (%d)", "You have sinned against %s (%d)."), vir_name, tester);
82         else if (tester < 0)
83             sprintf(vir_desc, _("[%s]の迷道者 (%d)", "You have strayed from the path of %s (%d)."), vir_name, tester);
84         else if (tester == 0)
85             sprintf(vir_desc, _("[%s]の中立者 (%d)", "You are neutral to %s (%d)."), vir_name, tester);
86         else if (tester < 20)
87             sprintf(vir_desc, _("[%s]の小徳者 (%d)", "You are somewhat virtuous in %s (%d)."), vir_name, tester);
88         else if (tester < 40)
89             sprintf(vir_desc, _("[%s]の中徳者 (%d)", "You are virtuous in %s (%d)."), vir_name, tester);
90         else if (tester < 60)
91             sprintf(vir_desc, _("[%s]の高徳者 (%d)", "You are very virtuous in %s (%d)."), vir_name, tester);
92         else if (tester < 80)
93             sprintf(vir_desc, _("[%s]の覇者 (%d)", "You are a champion of %s (%d)."), vir_name, tester);
94         else if (tester < 100)
95             sprintf(vir_desc, _("[%s]の偉大な覇者 (%d)", "You are a great champion of %s (%d)."), vir_name, tester);
96         else
97             sprintf(vir_desc, _("[%s]の具現者 (%d)", "You are the living embodiment of %s (%d)."), vir_name, tester);
98
99         strcpy(si_ptr->v_string[v_nr], vir_desc);
100         si_ptr->info[si_ptr->line++] = si_ptr->v_string[v_nr];
101     }
102 }
103
104 void display_mimic_race_ability(player_type *creature_ptr, self_info_type *si_ptr)
105 {
106     switch (creature_ptr->mimic_form) {
107     case MIMIC_DEMON:
108     case MIMIC_DEMON_LORD:
109         sprintf(si_ptr->plev_buf, _("あなたは %d ダメージの地獄か火炎のブレスを吐くことができる。(%d MP)", "You can nether breathe, dam. %d (cost %d)."),
110             3 * creature_ptr->lev, 10 + creature_ptr->lev / 3);
111
112         si_ptr->info[si_ptr->line++] = si_ptr->plev_buf;
113         break;
114     case MIMIC_VAMPIRE:
115         if (creature_ptr->lev <= 1)
116             break;
117
118         sprintf(si_ptr->plev_buf, _("あなたは敵から %d-%d HP の生命力を吸収できる。(%d MP)", "You can steal life from a foe, dam. %d-%d (cost %d)."),
119             creature_ptr->lev + MAX(1, creature_ptr->lev / 10), creature_ptr->lev + creature_ptr->lev * MAX(1, creature_ptr->lev / 10),
120             1 + (creature_ptr->lev / 3));
121         si_ptr->info[si_ptr->line++] = si_ptr->plev_buf;
122         break;
123     }
124 }
125
126 void display_equipment_influence(player_type *creature_ptr, self_info_type *si_ptr)
127 {
128     for (int k = INVEN_RARM; k < INVEN_TOTAL; k++) {
129         u32b tflgs[TR_FLAG_SIZE];
130         si_ptr->o_ptr = &creature_ptr->inventory_list[k];
131         if (si_ptr->o_ptr->k_idx == 0)
132             continue;
133
134         object_flags(creature_ptr, si_ptr->o_ptr, tflgs);
135         for (int j = 0; j < TR_FLAG_SIZE; j++)
136             si_ptr->flags[j] |= tflgs[j];
137     }
138
139     if (have_flag(si_ptr->flags, TR_STR))
140         si_ptr->info[si_ptr->line++] = _("あなたの腕力は装備によって影響を受けている。", "Your strength is affected by your equipment.");
141
142     if (have_flag(si_ptr->flags, TR_INT))
143         si_ptr->info[si_ptr->line++] = _("あなたの知能は装備によって影響を受けている。", "Your intelligence is affected by your equipment.");
144
145     if (have_flag(si_ptr->flags, TR_WIS))
146         si_ptr->info[si_ptr->line++] = _("あなたの賢さは装備によって影響を受けている。", "Your wisdom is affected by your equipment.");
147
148     if (have_flag(si_ptr->flags, TR_DEX))
149         si_ptr->info[si_ptr->line++] = _("あなたの器用さは装備によって影響を受けている。", "Your dexterity is affected by your equipment.");
150
151     if (have_flag(si_ptr->flags, TR_CON))
152         si_ptr->info[si_ptr->line++] = _("あなたの耐久力は装備によって影響を受けている。", "Your constitution is affected by your equipment.");
153
154     if (have_flag(si_ptr->flags, TR_CHR))
155         si_ptr->info[si_ptr->line++] = _("あなたの魅力は装備によって影響を受けている。", "Your charisma is affected by your equipment.");
156
157     if (have_flag(si_ptr->flags, TR_STEALTH))
158         si_ptr->info[si_ptr->line++] = _("あなたの隠密行動能力は装備によって影響を受けている。", "Your stealth is affected by your equipment.");
159
160     if (have_flag(si_ptr->flags, TR_SEARCH))
161         si_ptr->info[si_ptr->line++] = _("あなたの探索能力は装備によって影響を受けている。", "Your searching ability is affected by your equipment.");
162
163     if (have_flag(si_ptr->flags, TR_INFRA))
164         si_ptr->info[si_ptr->line++] = _("あなたの赤外線視力は装備によって影響を受けている。", "Your infravision is affected by your equipment.");
165
166     if (have_flag(si_ptr->flags, TR_TUNNEL))
167         si_ptr->info[si_ptr->line++] = _("あなたの採掘能力は装備によって影響を受けている。", "Your digging ability is affected by your equipment.");
168
169     if (have_flag(si_ptr->flags, TR_SPEED))
170         si_ptr->info[si_ptr->line++] = _("あなたのスピードは装備によって影響を受けている。", "Your speed is affected by your equipment.");
171
172     if (have_flag(si_ptr->flags, TR_BLOWS))
173         si_ptr->info[si_ptr->line++] = _("あなたの攻撃速度は装備によって影響を受けている。", "Your attack speed is affected by your equipment.");
174 }
175
176 void set_bad_status_info(player_type *creature_ptr, self_info_type *si_ptr)
177 {
178     if (creature_ptr->blind)
179         si_ptr->info[si_ptr->line++] = _("あなたは目が見えない。", "You cannot see.");
180
181     if (creature_ptr->confused)
182         si_ptr->info[si_ptr->line++] = _("あなたは混乱している。", "You are confused.");
183
184     if (creature_ptr->afraid)
185         si_ptr->info[si_ptr->line++] = _("あなたは恐怖に侵されている。", "You are terrified.");
186
187     if (creature_ptr->cut)
188         si_ptr->info[si_ptr->line++] = _("あなたは出血している。", "You are bleeding.");
189
190     if (creature_ptr->stun)
191         si_ptr->info[si_ptr->line++] = _("あなたはもうろうとしている。", "You are stunned.");
192
193     if (creature_ptr->poisoned)
194         si_ptr->info[si_ptr->line++] = _("あなたは毒に侵されている。", "You are poisoned.");
195
196     if (creature_ptr->image)
197         si_ptr->info[si_ptr->line++] = _("あなたは幻覚を見ている。", "You are hallucinating.");
198 }
199
200 void set_curse_info(player_type *creature_ptr, self_info_type *si_ptr)
201 {
202     if (creature_ptr->cursed & TRC_TY_CURSE)
203         si_ptr->info[si_ptr->line++] = _("あなたは邪悪な怨念に包まれている。", "You carry an ancient foul curse.");
204
205     if (creature_ptr->cursed & TRC_AGGRAVATE)
206         si_ptr->info[si_ptr->line++] = _("あなたはモンスターを怒らせている。", "You aggravate monsters.");
207
208     if (creature_ptr->cursed & TRC_DRAIN_EXP)
209         si_ptr->info[si_ptr->line++] = _("あなたは経験値を吸われている。", "You occasionally lose experience for no reason.");
210
211     if (creature_ptr->cursed & TRC_SLOW_REGEN)
212         si_ptr->info[si_ptr->line++] = _("あなたの回復力は非常に遅い。", "You regenerate slowly.");
213
214     if (creature_ptr->cursed & TRC_ADD_L_CURSE)
215         si_ptr->info[si_ptr->line++] = _("あなたの弱い呪いは増える。", "Your weak curses multiply."); /* 暫定的 -- henkma */
216
217     if (creature_ptr->cursed & TRC_ADD_H_CURSE)
218         si_ptr->info[si_ptr->line++] = _("あなたの強い呪いは増える。", "Your heavy curses multiply."); /* 暫定的 -- henkma */
219
220     if (creature_ptr->cursed & TRC_CALL_ANIMAL)
221         si_ptr->info[si_ptr->line++] = _("あなたは動物に狙われている。", "You attract animals.");
222
223     if (creature_ptr->cursed & TRC_CALL_DEMON)
224         si_ptr->info[si_ptr->line++] = _("あなたは悪魔に狙われている。", "You attract demons.");
225
226     if (creature_ptr->cursed & TRC_CALL_DRAGON)
227         si_ptr->info[si_ptr->line++] = _("あなたはドラゴンに狙われている。", "You attract dragons.");
228
229     if (creature_ptr->cursed & TRC_COWARDICE)
230         si_ptr->info[si_ptr->line++] = _("あなたは時々臆病になる。", "You are subject to cowardice.");
231
232     if (creature_ptr->cursed & TRC_TELEPORT)
233         si_ptr->info[si_ptr->line++] = _("あなたの位置はひじょうに不安定だ。", "Your position is very uncertain.");
234
235     if (creature_ptr->cursed & TRC_LOW_MELEE)
236         si_ptr->info[si_ptr->line++] = _("あなたの武器は攻撃を外しやすい。", "Your weapon causes you to miss blows.");
237
238     if (creature_ptr->cursed & TRC_LOW_AC)
239         si_ptr->info[si_ptr->line++] = _("あなたは攻撃を受けやすい。", "You are subject to be hit.");
240
241     if (creature_ptr->cursed & TRC_LOW_MAGIC)
242         si_ptr->info[si_ptr->line++] = _("あなたは魔法を失敗しやすい。", "Your spells fail more frequently.");
243
244     if (creature_ptr->cursed & TRC_FAST_DIGEST)
245         si_ptr->info[si_ptr->line++] = _("あなたはすぐお腹がへる。", "You have a good appetite.");
246
247     if (creature_ptr->cursed & TRC_DRAIN_HP)
248         si_ptr->info[si_ptr->line++] = _("あなたは体力を吸われている。", "You occasionally lose hit points for no reason.");
249
250     if (creature_ptr->cursed & TRC_DRAIN_MANA)
251         si_ptr->info[si_ptr->line++] = _("あなたは魔力を吸われている。", "You occasionally lose spell points for no reason.");
252 }
253
254 void set_special_attack_info(player_type *creature_ptr, self_info_type *si_ptr)
255 {
256     if (creature_ptr->special_attack & ATTACK_CONFUSE)
257         si_ptr->info[si_ptr->line++] = _("あなたの手は赤く輝いている。", "Your hands are glowing dull red.");
258
259     if (creature_ptr->special_attack & ATTACK_FIRE)
260         si_ptr->info[si_ptr->line++] = _("あなたの手は火炎に覆われている。", "You can strike the enemy with flame.");
261
262     if (creature_ptr->special_attack & ATTACK_COLD)
263         si_ptr->info[si_ptr->line++] = _("あなたの手は冷気に覆われている。", "You can strike the enemy with cold.");
264
265     if (creature_ptr->special_attack & ATTACK_ACID)
266         si_ptr->info[si_ptr->line++] = _("あなたの手は酸に覆われている。", "You can strike the enemy with acid.");
267
268     if (creature_ptr->special_attack & ATTACK_ELEC)
269         si_ptr->info[si_ptr->line++] = _("あなたの手は電撃に覆われている。", "You can strike the enemy with electoric shock.");
270
271     if (creature_ptr->special_attack & ATTACK_POIS)
272         si_ptr->info[si_ptr->line++] = _("あなたの手は毒に覆われている。", "You can strike the enemy with poison.");
273 }
274
275 void set_esp_info(player_type *creature_ptr, self_info_type *si_ptr)
276 {
277     if (creature_ptr->telepathy)
278         si_ptr->info[si_ptr->line++] = _("あなたはテレパシー能力を持っている。", "You have ESP.");
279
280     if (creature_ptr->esp_animal)
281         si_ptr->info[si_ptr->line++] = _("あなたは自然界の生物の存在を感じる能力を持っている。", "You sense natural creatures.");
282
283     if (creature_ptr->esp_undead)
284         si_ptr->info[si_ptr->line++] = _("あなたはアンデッドの存在を感じる能力を持っている。", "You sense undead.");
285
286     if (creature_ptr->esp_demon)
287         si_ptr->info[si_ptr->line++] = _("あなたは悪魔の存在を感じる能力を持っている。", "You sense demons.");
288
289     if (creature_ptr->esp_orc)
290         si_ptr->info[si_ptr->line++] = _("あなたはオークの存在を感じる能力を持っている。", "You sense orcs.");
291
292     if (creature_ptr->esp_troll)
293         si_ptr->info[si_ptr->line++] = _("あなたはトロルの存在を感じる能力を持っている。", "You sense trolls.");
294
295     if (creature_ptr->esp_giant)
296         si_ptr->info[si_ptr->line++] = _("あなたは巨人の存在を感じる能力を持っている。", "You sense giants.");
297
298     if (creature_ptr->esp_dragon)
299         si_ptr->info[si_ptr->line++] = _("あなたはドラゴンの存在を感じる能力を持っている。", "You sense dragons.");
300
301     if (creature_ptr->esp_human)
302         si_ptr->info[si_ptr->line++] = _("あなたは人間の存在を感じる能力を持っている。", "You sense humans.");
303
304     if (creature_ptr->esp_evil)
305         si_ptr->info[si_ptr->line++] = _("あなたは邪悪な生き物の存在を感じる能力を持っている。", "You sense evil creatures.");
306
307     if (creature_ptr->esp_good)
308         si_ptr->info[si_ptr->line++] = _("あなたは善良な生き物の存在を感じる能力を持っている。", "You sense good creatures.");
309
310     if (creature_ptr->esp_nonliving)
311         si_ptr->info[si_ptr->line++] = _("あなたは活動する無生物体の存在を感じる能力を持っている。", "You sense non-living creatures.");
312
313     if (creature_ptr->esp_unique)
314         si_ptr->info[si_ptr->line++] = _("あなたは特別な強敵の存在を感じる能力を持っている。", "You sense unique monsters.");
315 }
316
317 /*!
318  * @brief 自己分析処理(Nethackからのアイデア) / self-knowledge... idea from nethack.
319  * @return なし
320  * @details
321  * <pre>
322  * Useful for determining powers and
323  * resistences of items.  It saves the screen, clears it, then starts listing
324  * attributes, a screenful at a time.  (There are a LOT of attributes to
325  * list.  It will probably take 2 or 3 screens for a powerful character whose
326  * using several artifacts...) -CFT
327  *
328  * It is now a lot more efficient. -BEN-
329  *
330  * See also "identify_fully()".
331  *
332  * Use the "show_file()" method, perhaps.
333  * </pre>
334  */
335 void self_knowledge(player_type *creature_ptr)
336 {
337     self_info_type tmp_si;
338     self_info_type *si_ptr = initialize_self_info_type(&tmp_si);
339     display_life_rating(creature_ptr, si_ptr);
340     chg_virtue(creature_ptr, V_KNOWLEDGE, 1);
341     chg_virtue(creature_ptr, V_ENLIGHTEN, 1);
342     display_max_base_status(creature_ptr, si_ptr);
343     display_virtue(creature_ptr, si_ptr);
344     si_ptr->info[si_ptr->line++] = "";
345     if (creature_ptr->mimic_form)
346         display_mimic_race_ability(creature_ptr, si_ptr);
347     else
348         set_race_ability_info(creature_ptr, si_ptr);
349
350     set_class_ability_info(creature_ptr, si_ptr);
351     set_mutation_info_1(creature_ptr, si_ptr);
352     set_mutation_info_2(creature_ptr, si_ptr);
353     set_mutation_info_3(creature_ptr, si_ptr);
354     set_bad_status_info(creature_ptr, si_ptr);
355     set_curse_info(creature_ptr, si_ptr);
356     set_body_improvement_info_1(creature_ptr, si_ptr);
357     set_special_attack_info(creature_ptr, si_ptr);
358     switch (creature_ptr->action) {
359     case ACTION_SEARCH:
360         si_ptr->info[si_ptr->line++] = _("あなたはひじょうに注意深く周囲を見渡している。", "You are looking around very carefully.");
361         break;
362     }
363
364     set_body_improvement_info_2(creature_ptr, si_ptr);
365     set_esp_info(creature_ptr, si_ptr);
366     set_body_improvement_info_3(creature_ptr, si_ptr);
367     if (creature_ptr->immune_acid) {
368         si_ptr->info[si_ptr->line++] = _("あなたは酸に対する完全なる免疫を持っている。", "You are completely immune to acid.");
369     } else if (creature_ptr->resist_acid && is_oppose_acid(creature_ptr)) {
370         si_ptr->info[si_ptr->line++] = _("あなたは酸への強力な耐性を持っている。", "You resist acid exceptionally well.");
371     } else if (creature_ptr->resist_acid || is_oppose_acid(creature_ptr)) {
372         si_ptr->info[si_ptr->line++] = _("あなたは酸への耐性を持っている。", "You are resistant to acid.");
373     }
374
375     if (creature_ptr->immune_elec) {
376         si_ptr->info[si_ptr->line++] = _("あなたは電撃に対する完全なる免疫を持っている。", "You are completely immune to lightning.");
377     } else if (creature_ptr->resist_elec && is_oppose_elec(creature_ptr)) {
378         si_ptr->info[si_ptr->line++] = _("あなたは電撃への強力な耐性を持っている。", "You resist lightning exceptionally well.");
379     } else if (creature_ptr->resist_elec || is_oppose_elec(creature_ptr)) {
380         si_ptr->info[si_ptr->line++] = _("あなたは電撃への耐性を持っている。", "You are resistant to lightning.");
381     }
382
383     if (is_specific_player_race(creature_ptr, RACE_ANDROID) && !creature_ptr->immune_elec) {
384         si_ptr->info[si_ptr->line++] = _("あなたは電撃に弱い。", "You are susceptible to damage from lightning.");
385     }
386
387     if (creature_ptr->immune_fire) {
388         si_ptr->info[si_ptr->line++] = _("あなたは火に対する完全なる免疫を持っている。", "You are completely immune to fire.");
389     } else if (creature_ptr->resist_fire && is_oppose_fire(creature_ptr)) {
390         si_ptr->info[si_ptr->line++] = _("あなたは火への強力な耐性を持っている。", "You resist fire exceptionally well.");
391     } else if (creature_ptr->resist_fire || is_oppose_fire(creature_ptr)) {
392         si_ptr->info[si_ptr->line++] = _("あなたは火への耐性を持っている。", "You are resistant to fire.");
393     }
394
395     if (is_specific_player_race(creature_ptr, RACE_ENT) && !creature_ptr->immune_fire) {
396         si_ptr->info[si_ptr->line++] = _("あなたは火に弱い。", "You are susceptible to damage from fire.");
397     }
398
399     if (creature_ptr->immune_cold) {
400         si_ptr->info[si_ptr->line++] = _("あなたは冷気に対する完全なる免疫を持っている。", "You are completely immune to cold.");
401     } else if (creature_ptr->resist_cold && is_oppose_cold(creature_ptr)) {
402         si_ptr->info[si_ptr->line++] = _("あなたは冷気への強力な耐性を持っている。", "You resist cold exceptionally well.");
403     } else if (creature_ptr->resist_cold || is_oppose_cold(creature_ptr)) {
404         si_ptr->info[si_ptr->line++] = _("あなたは冷気への耐性を持っている。", "You are resistant to cold.");
405     }
406
407     if (creature_ptr->resist_pois && is_oppose_pois(creature_ptr)) {
408         si_ptr->info[si_ptr->line++] = _("あなたは毒への強力な耐性を持っている。", "You resist poison exceptionally well.");
409     } else if (creature_ptr->resist_pois || is_oppose_pois(creature_ptr)) {
410         si_ptr->info[si_ptr->line++] = _("あなたは毒への耐性を持っている。", "You are resistant to poison.");
411     }
412
413     if (creature_ptr->resist_lite) {
414         si_ptr->info[si_ptr->line++] = _("あなたは閃光への耐性を持っている。", "You are resistant to bright light.");
415     }
416
417     if (is_specific_player_race(creature_ptr, RACE_VAMPIRE) || is_specific_player_race(creature_ptr, RACE_S_FAIRY)
418         || (creature_ptr->mimic_form == MIMIC_VAMPIRE)) {
419         si_ptr->info[si_ptr->line++] = _("あなたは閃光に弱い。", "You are susceptible to damage from bright light.");
420     }
421
422     if (is_specific_player_race(creature_ptr, RACE_VAMPIRE) || (creature_ptr->mimic_form == MIMIC_VAMPIRE) || creature_ptr->wraith_form) {
423         si_ptr->info[si_ptr->line++] = _("あなたは暗黒に対する完全なる免疫を持っている。", "You are completely immune to darkness.");
424     } else if (creature_ptr->resist_dark) {
425         si_ptr->info[si_ptr->line++] = _("あなたは暗黒への耐性を持っている。", "You are resistant to darkness.");
426     }
427     if (creature_ptr->resist_conf) {
428         si_ptr->info[si_ptr->line++] = _("あなたは混乱への耐性を持っている。", "You are resistant to confusion.");
429     }
430     if (creature_ptr->resist_sound) {
431         si_ptr->info[si_ptr->line++] = _("あなたは音波の衝撃への耐性を持っている。", "You are resistant to sonic attacks.");
432     }
433     if (creature_ptr->resist_disen) {
434         si_ptr->info[si_ptr->line++] = _("あなたは劣化への耐性を持っている。", "You are resistant to disenchantment.");
435     }
436     if (creature_ptr->resist_chaos) {
437         si_ptr->info[si_ptr->line++] = _("あなたはカオスの力への耐性を持っている。", "You are resistant to chaos.");
438     }
439     if (creature_ptr->resist_shard) {
440         si_ptr->info[si_ptr->line++] = _("あなたは破片の攻撃への耐性を持っている。", "You are resistant to blasts of shards.");
441     }
442     if (creature_ptr->resist_nexus) {
443         si_ptr->info[si_ptr->line++] = _("あなたは因果混乱の攻撃への耐性を持っている。", "You are resistant to nexus attacks.");
444     }
445
446     if (is_specific_player_race(creature_ptr, RACE_SPECTRE)) {
447         si_ptr->info[si_ptr->line++] = _("あなたは地獄の力を吸収できる。", "You can drain nether forces.");
448     } else if (creature_ptr->resist_neth) {
449         si_ptr->info[si_ptr->line++] = _("あなたは地獄の力への耐性を持っている。", "You are resistant to nether forces.");
450     }
451     if (creature_ptr->resist_fear) {
452         si_ptr->info[si_ptr->line++] = _("あなたは全く恐怖を感じない。", "You are completely fearless.");
453     }
454     if (creature_ptr->resist_blind) {
455         si_ptr->info[si_ptr->line++] = _("あなたの目は盲目への耐性を持っている。", "Your eyes are resistant to blindness.");
456     }
457     if (creature_ptr->resist_time) {
458         si_ptr->info[si_ptr->line++] = _("あなたは時間逆転への耐性を持っている。", "You are resistant to time.");
459     }
460
461     if (creature_ptr->sustain_str) {
462         si_ptr->info[si_ptr->line++] = _("あなたの腕力は維持されている。", "Your strength is sustained.");
463     }
464     if (creature_ptr->sustain_int) {
465         si_ptr->info[si_ptr->line++] = _("あなたの知能は維持されている。", "Your intelligence is sustained.");
466     }
467     if (creature_ptr->sustain_wis) {
468         si_ptr->info[si_ptr->line++] = _("あなたの賢さは維持されている。", "Your wisdom is sustained.");
469     }
470     if (creature_ptr->sustain_con) {
471         si_ptr->info[si_ptr->line++] = _("あなたの耐久力は維持されている。", "Your constitution is sustained.");
472     }
473     if (creature_ptr->sustain_dex) {
474         si_ptr->info[si_ptr->line++] = _("あなたの器用さは維持されている。", "Your dexterity is sustained.");
475     }
476     if (creature_ptr->sustain_chr) {
477         si_ptr->info[si_ptr->line++] = _("あなたの魅力は維持されている。", "Your charisma is sustained.");
478     }
479
480     display_equipment_influence(creature_ptr, si_ptr);
481
482     /* Access the current weapon */
483     si_ptr->o_ptr = &creature_ptr->inventory_list[INVEN_RARM];
484
485     /* Analyze the weapon */
486     if (si_ptr->o_ptr->k_idx) {
487         /* Indicate Blessing */
488         if (have_flag(si_ptr->flags, TR_BLESSED)) {
489             si_ptr->info[si_ptr->line++] = _("あなたの武器は神の祝福を受けている。", "Your weapon has been blessed by the gods.");
490         }
491
492         if (have_flag(si_ptr->flags, TR_CHAOTIC)) {
493             si_ptr->info[si_ptr->line++] = _("あなたの武器はログルスの徴の属性をもつ。", "Your weapon is branded with the Sign of Logrus.");
494         }
495
496         if (have_flag(si_ptr->flags, TR_IMPACT)) {
497             si_ptr->info[si_ptr->line++] = _("あなたの武器は打撃で地震を発生することができる。", "The impact of your weapon can cause earthquakes.");
498         }
499
500         if (have_flag(si_ptr->flags, TR_VORPAL)) {
501             si_ptr->info[si_ptr->line++] = _("あなたの武器は非常に鋭い。", "Your weapon is very sharp.");
502         }
503
504         if (have_flag(si_ptr->flags, TR_VAMPIRIC)) {
505             si_ptr->info[si_ptr->line++] = _("あなたの武器は敵から生命力を吸収する。", "Your weapon drains life from your foes.");
506         }
507
508         /* Special "Attack Bonuses" */
509         if (have_flag(si_ptr->flags, TR_BRAND_ACID)) {
510             si_ptr->info[si_ptr->line++] = _("あなたの武器は敵を溶かす。", "Your weapon melts your foes.");
511         }
512         if (have_flag(si_ptr->flags, TR_BRAND_ELEC)) {
513             si_ptr->info[si_ptr->line++] = _("あなたの武器は敵を感電させる。", "Your weapon shocks your foes.");
514         }
515         if (have_flag(si_ptr->flags, TR_BRAND_FIRE)) {
516             si_ptr->info[si_ptr->line++] = _("あなたの武器は敵を燃やす。", "Your weapon burns your foes.");
517         }
518         if (have_flag(si_ptr->flags, TR_BRAND_COLD)) {
519             si_ptr->info[si_ptr->line++] = _("あなたの武器は敵を凍らせる。", "Your weapon freezes your foes.");
520         }
521         if (have_flag(si_ptr->flags, TR_BRAND_POIS)) {
522             si_ptr->info[si_ptr->line++] = _("あなたの武器は敵を毒で侵す。", "Your weapon poisons your foes.");
523         }
524
525         /* Special "slay" si_ptr->flags */
526         if (have_flag(si_ptr->flags, TR_KILL_ANIMAL)) {
527             si_ptr->info[si_ptr->line++] = _("あなたの武器は動物の天敵である。", "Your weapon is a great bane of animals.");
528         } else if (have_flag(si_ptr->flags, TR_SLAY_ANIMAL)) {
529             si_ptr->info[si_ptr->line++] = _("あなたの武器は動物に対して強い力を発揮する。", "Your weapon strikes at animals with extra force.");
530         }
531         if (have_flag(si_ptr->flags, TR_KILL_EVIL)) {
532             si_ptr->info[si_ptr->line++] = _("あなたの武器は邪悪なる存在の天敵である。", "Your weapon is a great bane of evil.");
533         } else if (have_flag(si_ptr->flags, TR_SLAY_EVIL)) {
534             si_ptr->info[si_ptr->line++] = _("あなたの武器は邪悪なる存在に対して強い力を発揮する。", "Your weapon strikes at evil with extra force.");
535         }
536         if (have_flag(si_ptr->flags, TR_KILL_HUMAN)) {
537             si_ptr->info[si_ptr->line++] = _("あなたの武器は人間の天敵である。", "Your weapon is a great bane of humans.");
538         } else if (have_flag(si_ptr->flags, TR_SLAY_HUMAN)) {
539             si_ptr->info[si_ptr->line++] = _("あなたの武器は人間に対して特に強い力を発揮する。", "Your weapon is especially deadly against humans.");
540         }
541         if (have_flag(si_ptr->flags, TR_KILL_UNDEAD)) {
542             si_ptr->info[si_ptr->line++] = _("あなたの武器はアンデッドの天敵である。", "Your weapon is a great bane of undead.");
543         } else if (have_flag(si_ptr->flags, TR_SLAY_UNDEAD)) {
544             si_ptr->info[si_ptr->line++] = _("あなたの武器はアンデッドに対して神聖なる力を発揮する。", "Your weapon strikes at undead with holy wrath.");
545         }
546         if (have_flag(si_ptr->flags, TR_KILL_DEMON)) {
547             si_ptr->info[si_ptr->line++] = _("あなたの武器はデーモンの天敵である。", "Your weapon is a great bane of demons.");
548         } else if (have_flag(si_ptr->flags, TR_SLAY_DEMON)) {
549             si_ptr->info[si_ptr->line++] = _("あなたの武器はデーモンに対して神聖なる力を発揮する。", "Your weapon strikes at demons with holy wrath.");
550         }
551         if (have_flag(si_ptr->flags, TR_KILL_ORC)) {
552             si_ptr->info[si_ptr->line++] = _("あなたの武器はオークの天敵である。", "Your weapon is a great bane of orcs.");
553         } else if (have_flag(si_ptr->flags, TR_SLAY_ORC)) {
554             si_ptr->info[si_ptr->line++] = _("あなたの武器はオークに対して特に強い力を発揮する。", "Your weapon is especially deadly against orcs.");
555         }
556         if (have_flag(si_ptr->flags, TR_KILL_TROLL)) {
557             si_ptr->info[si_ptr->line++] = _("あなたの武器はトロルの天敵である。", "Your weapon is a great bane of trolls.");
558         } else if (have_flag(si_ptr->flags, TR_SLAY_TROLL)) {
559             si_ptr->info[si_ptr->line++] = _("あなたの武器はトロルに対して特に強い力を発揮する。", "Your weapon is especially deadly against trolls.");
560         }
561         if (have_flag(si_ptr->flags, TR_KILL_GIANT)) {
562             si_ptr->info[si_ptr->line++] = _("あなたの武器は巨人の天敵である。", "Your weapon is a great bane of giants.");
563         } else if (have_flag(si_ptr->flags, TR_SLAY_GIANT)) {
564             si_ptr->info[si_ptr->line++] = _("あなたの武器は巨人に対して特に強い力を発揮する。", "Your weapon is especially deadly against giants.");
565         }
566         /* Special "kill" si_ptr->flags */
567         if (have_flag(si_ptr->flags, TR_KILL_DRAGON)) {
568             si_ptr->info[si_ptr->line++] = _("あなたの武器はドラゴンの天敵である。", "Your weapon is a great bane of dragons.");
569         } else if (have_flag(si_ptr->flags, TR_SLAY_DRAGON)) {
570             si_ptr->info[si_ptr->line++] = _("あなたの武器はドラゴンに対して特に強い力を発揮する。", "Your weapon is especially deadly against dragons.");
571         }
572
573         if (have_flag(si_ptr->flags, TR_FORCE_WEAPON))
574             si_ptr->info[si_ptr->line++] = _("あなたの武器はMPを使って攻撃する。", "Your weapon causes greate damages using your MP.");
575
576         if (have_flag(si_ptr->flags, TR_THROW))
577             si_ptr->info[si_ptr->line++] = _("あなたの武器は投げやすい。", "Your weapon can be thrown well.");
578     }
579
580     screen_save();
581     for (int k = 1; k < 24; k++)
582         prt("", k, 13);
583
584     prt(_("        あなたの状態:", "     Your Attributes:"), 1, 15);
585     int k = 2;
586     for (int j = 0; j < si_ptr->line; j++) {
587         prt(si_ptr->info[j], k++, 15);
588
589         /* Every 20 entries (lines 2 to 21), start over */
590         if ((k != 22) || (j + 1 >= si_ptr->line))
591             continue;
592
593         prt(_("-- 続く --", "-- more --"), k, 15);
594         inkey();
595         for (; k > 2; k--)
596             prt("", k, 15);
597     }
598
599     prt(_("[何かキーを押すとゲームに戻ります]", "[Press any key to continue]"), k, 13);
600     inkey();
601     screen_load();
602 }
603
604 /*!
605  * @brief 魔法効果時間のターン数に基づいて表現IDを返す。
606  * @param dur 効果ターン数
607  * @return 効果時間の表現ID
608  */
609 static int report_magics_aux(int dur)
610 {
611     if (dur <= 5) {
612         return 0;
613     } else if (dur <= 10) {
614         return 1;
615     } else if (dur <= 20) {
616         return 2;
617     } else if (dur <= 50) {
618         return 3;
619     } else if (dur <= 100) {
620         return 4;
621     } else if (dur <= 200) {
622         return 5;
623     } else {
624         return 6;
625     }
626 }
627
628 static concptr report_magic_durations[] = {
629 #ifdef JP
630     "ごく短い間", "少しの間", "しばらくの間", "多少長い間", "長い間", "非常に長い間", "信じ難いほど長い間", "モンスターを攻撃するまで"
631 #else
632     "for a short time", "for a little while", "for a while", "for a long while", "for a long time", "for a very long time", "for an incredibly long time",
633     "until you hit a monster"
634 #endif
635
636 };
637
638 /*!
639  * @brief 現在の一時的効果一覧を返す / Report all currently active magical effects.
640  * @return なし
641  */
642 void report_magics(player_type *creature_ptr)
643 {
644     int i = 0, j, k;
645     char Dummy[80];
646     concptr info[128];
647     int info2[128];
648
649     if (creature_ptr->blind) {
650         info2[i] = report_magics_aux(creature_ptr->blind);
651         info[i++] = _("あなたは目が見えない", "You cannot see");
652     }
653     if (creature_ptr->confused) {
654         info2[i] = report_magics_aux(creature_ptr->confused);
655         info[i++] = _("あなたは混乱している", "You are confused");
656     }
657     if (creature_ptr->afraid) {
658         info2[i] = report_magics_aux(creature_ptr->afraid);
659         info[i++] = _("あなたは恐怖に侵されている", "You are terrified");
660     }
661     if (creature_ptr->poisoned) {
662         info2[i] = report_magics_aux(creature_ptr->poisoned);
663         info[i++] = _("あなたは毒に侵されている", "You are poisoned");
664     }
665     if (creature_ptr->image) {
666         info2[i] = report_magics_aux(creature_ptr->image);
667         info[i++] = _("あなたは幻覚を見ている", "You are hallucinating");
668     }
669     if (creature_ptr->blessed) {
670         info2[i] = report_magics_aux(creature_ptr->blessed);
671         info[i++] = _("あなたは高潔さを感じている", "You feel rightous");
672     }
673     if (creature_ptr->hero) {
674         info2[i] = report_magics_aux(creature_ptr->hero);
675         info[i++] = _("あなたはヒーロー気分だ", "You feel heroic");
676     }
677     if (creature_ptr->shero) {
678         info2[i] = report_magics_aux(creature_ptr->shero);
679         info[i++] = _("あなたは戦闘狂だ", "You are in a battle rage");
680     }
681     if (creature_ptr->protevil) {
682         info2[i] = report_magics_aux(creature_ptr->protevil);
683         info[i++] = _("あなたは邪悪なる存在から守られている", "You are protected from evil");
684     }
685     if (creature_ptr->shield) {
686         info2[i] = report_magics_aux(creature_ptr->shield);
687         info[i++] = _("あなたは神秘のシールドで守られている", "You are protected by a mystic shield");
688     }
689     if (creature_ptr->invuln) {
690         info2[i] = report_magics_aux(creature_ptr->invuln);
691         info[i++] = _("あなたは無敵だ", "You are invulnerable");
692     }
693     if (creature_ptr->wraith_form) {
694         info2[i] = report_magics_aux(creature_ptr->wraith_form);
695         info[i++] = _("あなたは幽体化している", "You are incorporeal");
696     }
697     if (creature_ptr->special_attack & ATTACK_CONFUSE) {
698         info2[i] = 7;
699         info[i++] = _("あなたの手は赤く輝いている", "Your hands are glowing dull red.");
700     }
701     if (creature_ptr->word_recall) {
702         info2[i] = report_magics_aux(creature_ptr->word_recall);
703         info[i++] = _("この後帰還の詔が発動する", "You are waiting to be recalled");
704     }
705     if (creature_ptr->alter_reality) {
706         info2[i] = report_magics_aux(creature_ptr->alter_reality);
707         info[i++] = _("この後現実変容が発動する", "You waiting to be altered");
708     }
709     if (creature_ptr->oppose_acid) {
710         info2[i] = report_magics_aux(creature_ptr->oppose_acid);
711         info[i++] = _("あなたは酸への耐性を持っている", "You are resistant to acid");
712     }
713     if (creature_ptr->oppose_elec) {
714         info2[i] = report_magics_aux(creature_ptr->oppose_elec);
715         info[i++] = _("あなたは電撃への耐性を持っている", "You are resistant to lightning");
716     }
717     if (creature_ptr->oppose_fire) {
718         info2[i] = report_magics_aux(creature_ptr->oppose_fire);
719         info[i++] = _("あなたは火への耐性を持っている", "You are resistant to fire");
720     }
721     if (creature_ptr->oppose_cold) {
722         info2[i] = report_magics_aux(creature_ptr->oppose_cold);
723         info[i++] = _("あなたは冷気への耐性を持っている", "You are resistant to cold");
724     }
725     if (creature_ptr->oppose_pois) {
726         info2[i] = report_magics_aux(creature_ptr->oppose_pois);
727         info[i++] = _("あなたは毒への耐性を持っている", "You are resistant to poison");
728     }
729     screen_save();
730
731     /* Erase the screen */
732     for (k = 1; k < 24; k++)
733         prt("", k, 13);
734
735     /* Label the information */
736     prt(_("    現在かかっている魔法     :", "     Your Current Magic:"), 1, 15);
737
738     /* We will print on top of the map (column 13) */
739     for (k = 2, j = 0; j < i; j++) {
740         /* Show the info */
741         sprintf(Dummy, _("%-28s : 期間 - %s ", "%s %s."), info[j], report_magic_durations[info2[j]]);
742         prt(Dummy, k++, 15);
743
744         /* Every 20 entries (lines 2 to 21), start over */
745         if ((k == 22) && (j + 1 < i)) {
746             prt(_("-- 続く --", "-- more --"), k, 15);
747             inkey();
748             for (; k > 2; k--)
749                 prt("", k, 15);
750         }
751     }
752
753     /* Pause */
754     prt(_("[何かキーを押すとゲームに戻ります]", "[Press any key to continue]"), k, 13);
755     inkey();
756     screen_load();
757 }