2 * @brief 自己分析処理/ Self knowledge
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.
13 #include "player-info/self-info.h"
14 #include "io/input-key-acceptor.h"
15 #include "object-enchant/trc-types.h"
16 #include "player-info/avatar.h"
17 #include "player-info/base-status-info.h"
18 #include "player-info/body-improvement-info.h"
19 #include "player-info/class-ability-info.h"
20 #include "player-info/mutation-info.h"
21 #include "player-info/race-ability-info.h"
22 #include "player-info/resistance-info.h"
23 #include "player-info/self-info-util.h"
24 #include "player-info/weapon-effect-info.h"
25 #include "player/attack-defense-types.h"
26 #include "player/player-status-flags.h"
27 #include "term/screen-processor.h"
28 #include "view/display-self-info.h"
30 static void set_bad_status_info(player_type *creature_ptr, self_info_type *self_ptr)
32 if (creature_ptr->blind)
33 self_ptr->info[self_ptr->line++] = _("あなたは目が見えない。", "You cannot see.");
35 if (creature_ptr->confused)
36 self_ptr->info[self_ptr->line++] = _("あなたは混乱している。", "You are confused.");
38 if (creature_ptr->afraid)
39 self_ptr->info[self_ptr->line++] = _("あなたは恐怖に侵されている。", "You are terrified.");
41 if (creature_ptr->cut)
42 self_ptr->info[self_ptr->line++] = _("あなたは出血している。", "You are bleeding.");
44 if (creature_ptr->stun)
45 self_ptr->info[self_ptr->line++] = _("あなたはもうろうとしている。", "You are stunned.");
47 if (creature_ptr->poisoned)
48 self_ptr->info[self_ptr->line++] = _("あなたは毒に侵されている。", "You are poisoned.");
50 if (creature_ptr->image)
51 self_ptr->info[self_ptr->line++] = _("あなたは幻覚を見ている。", "You are hallucinating.");
54 static void set_curse_info(player_type *creature_ptr, self_info_type *self_ptr)
56 if (creature_ptr->cursed & TRC_TY_CURSE)
57 self_ptr->info[self_ptr->line++] = _("あなたは邪悪な怨念に包まれている。", "You carry an ancient foul curse.");
59 if (has_aggravate(creature_ptr))
60 self_ptr->info[self_ptr->line++] = _("あなたはモンスターを怒らせている。", "You aggravate monsters.");
62 if (creature_ptr->cursed & TRC_DRAIN_EXP)
63 self_ptr->info[self_ptr->line++] = _("あなたは経験値を吸われている。", "You occasionally lose experience for no reason.");
65 if (creature_ptr->cursed & TRC_SLOW_REGEN)
66 self_ptr->info[self_ptr->line++] = _("あなたの回復力は非常に遅い。", "You regenerate slowly.");
68 if (creature_ptr->cursed & TRC_ADD_L_CURSE)
69 self_ptr->info[self_ptr->line++] = _("あなたの弱い呪いは増える。", "Your weak curses multiply."); /* 暫定的 -- henkma */
71 if (creature_ptr->cursed & TRC_ADD_H_CURSE)
72 self_ptr->info[self_ptr->line++] = _("あなたの強い呪いは増える。", "Your heavy curses multiply."); /* 暫定的 -- henkma */
74 if (creature_ptr->cursed & TRC_CALL_ANIMAL)
75 self_ptr->info[self_ptr->line++] = _("あなたは動物に狙われている。", "You attract animals.");
77 if (creature_ptr->cursed & TRC_CALL_DEMON)
78 self_ptr->info[self_ptr->line++] = _("あなたは悪魔に狙われている。", "You attract demons.");
80 if (creature_ptr->cursed & TRC_CALL_DRAGON)
81 self_ptr->info[self_ptr->line++] = _("あなたはドラゴンに狙われている。", "You attract dragons.");
83 if (creature_ptr->cursed & TRC_COWARDICE)
84 self_ptr->info[self_ptr->line++] = _("あなたは時々臆病になる。", "You are subject to cowardice.");
86 if (creature_ptr->cursed & TRC_TELEPORT)
87 self_ptr->info[self_ptr->line++] = _("あなたの位置はひじょうに不安定だ。", "Your position is very uncertain.");
89 if (creature_ptr->cursed & TRC_LOW_MELEE)
90 self_ptr->info[self_ptr->line++] = _("あなたの武器は攻撃を外しやすい。", "Your weapon causes you to miss blows.");
92 if (creature_ptr->cursed & TRC_LOW_AC)
93 self_ptr->info[self_ptr->line++] = _("あなたは攻撃を受けやすい。", "You are subject to be hit.");
95 if (creature_ptr->cursed & TRC_LOW_MAGIC)
96 self_ptr->info[self_ptr->line++] = _("あなたは魔法を失敗しやすい。", "Your spells fail more frequently.");
98 if (creature_ptr->cursed & TRC_FAST_DIGEST)
99 self_ptr->info[self_ptr->line++] = _("あなたはすぐお腹がへる。", "You have a good appetite.");
101 if (creature_ptr->cursed & TRC_DRAIN_HP)
102 self_ptr->info[self_ptr->line++] = _("あなたは体力を吸われている。", "You occasionally lose hit points for no reason.");
104 if (creature_ptr->cursed & TRC_DRAIN_MANA)
105 self_ptr->info[self_ptr->line++] = _("あなたは魔力を吸われている。", "You occasionally lose spell points for no reason.");
108 static void set_special_attack_info(player_type *creature_ptr, self_info_type *self_ptr)
110 if (creature_ptr->special_attack & ATTACK_CONFUSE)
111 self_ptr->info[self_ptr->line++] = _("あなたの手は赤く輝いている。", "Your hands are glowing dull red.");
113 if (creature_ptr->special_attack & ATTACK_FIRE)
114 self_ptr->info[self_ptr->line++] = _("あなたの手は火炎に覆われている。", "You can strike the enemy with flame.");
116 if (creature_ptr->special_attack & ATTACK_COLD)
117 self_ptr->info[self_ptr->line++] = _("あなたの手は冷気に覆われている。", "You can strike the enemy with cold.");
119 if (creature_ptr->special_attack & ATTACK_ACID)
120 self_ptr->info[self_ptr->line++] = _("あなたの手は酸に覆われている。", "You can strike the enemy with acid.");
122 if (creature_ptr->special_attack & ATTACK_ELEC)
123 self_ptr->info[self_ptr->line++] = _("あなたの手は電撃に覆われている。", "You can strike the enemy with electoric shock.");
125 if (creature_ptr->special_attack & ATTACK_POIS)
126 self_ptr->info[self_ptr->line++] = _("あなたの手は毒に覆われている。", "You can strike the enemy with poison.");
129 static void set_esp_info(player_type *creature_ptr, self_info_type *self_ptr)
131 if (creature_ptr->telepathy)
132 self_ptr->info[self_ptr->line++] = _("あなたはテレパシー能力を持っている。", "You have ESP.");
134 if (creature_ptr->esp_animal)
135 self_ptr->info[self_ptr->line++] = _("あなたは自然界の生物の存在を感じる能力を持っている。", "You sense natural creatures.");
137 if (creature_ptr->esp_undead)
138 self_ptr->info[self_ptr->line++] = _("あなたはアンデッドの存在を感じる能力を持っている。", "You sense undead.");
140 if (creature_ptr->esp_demon)
141 self_ptr->info[self_ptr->line++] = _("あなたは悪魔の存在を感じる能力を持っている。", "You sense demons.");
143 if (creature_ptr->esp_orc)
144 self_ptr->info[self_ptr->line++] = _("あなたはオークの存在を感じる能力を持っている。", "You sense orcs.");
146 if (creature_ptr->esp_troll)
147 self_ptr->info[self_ptr->line++] = _("あなたはトロルの存在を感じる能力を持っている。", "You sense trolls.");
149 if (creature_ptr->esp_giant)
150 self_ptr->info[self_ptr->line++] = _("あなたは巨人の存在を感じる能力を持っている。", "You sense giants.");
152 if (creature_ptr->esp_dragon)
153 self_ptr->info[self_ptr->line++] = _("あなたはドラゴンの存在を感じる能力を持っている。", "You sense dragons.");
155 if (creature_ptr->esp_human)
156 self_ptr->info[self_ptr->line++] = _("あなたは人間の存在を感じる能力を持っている。", "You sense humans.");
158 if (creature_ptr->esp_evil)
159 self_ptr->info[self_ptr->line++] = _("あなたは邪悪な生き物の存在を感じる能力を持っている。", "You sense evil creatures.");
161 if (creature_ptr->esp_good)
162 self_ptr->info[self_ptr->line++] = _("あなたは善良な生き物の存在を感じる能力を持っている。", "You sense good creatures.");
164 if (creature_ptr->esp_nonliving)
165 self_ptr->info[self_ptr->line++] = _("あなたは活動する無生物体の存在を感じる能力を持っている。", "You sense non-living creatures.");
167 if (creature_ptr->esp_unique)
168 self_ptr->info[self_ptr->line++] = _("あなたは特別な強敵の存在を感じる能力を持っている。", "You sense unique monsters.");
172 * @brief 自己分析処理(Nethackからのアイデア) / self-knowledge... idea from nethack.
176 * Useful for determining powers and
177 * resistences of items. It saves the screen, clears it, then starts listing
178 * attributes, a screenful at a time. (There are a LOT of attributes to
179 * list. It will probably take 2 or 3 screens for a powerful character whose
180 * using several artifacts...) -CFT
182 * It is now a lot more efficient. -BEN-
184 * See also "identify_fully()".
186 * Use the "show_file()" method, perhaps.
189 void self_knowledge(player_type *creature_ptr)
191 self_info_type tmp_si;
192 self_info_type *self_ptr = initialize_self_info_type(&tmp_si);
193 display_life_rating(creature_ptr, self_ptr);
194 chg_virtue(creature_ptr, V_KNOWLEDGE, 1);
195 chg_virtue(creature_ptr, V_ENLIGHTEN, 1);
196 display_max_base_status(creature_ptr, self_ptr);
197 display_virtue(creature_ptr, self_ptr);
198 self_ptr->info[self_ptr->line++] = "";
199 if (creature_ptr->mimic_form)
200 display_mimic_race_ability(creature_ptr, self_ptr);
202 set_race_ability_info(creature_ptr, self_ptr);
204 set_class_ability_info(creature_ptr, self_ptr);
205 set_mutation_info(creature_ptr, self_ptr);
206 set_bad_status_info(creature_ptr, self_ptr);
207 set_curse_info(creature_ptr, self_ptr);
208 set_body_improvement_info_1(creature_ptr, self_ptr);
209 set_special_attack_info(creature_ptr, self_ptr);
210 switch (creature_ptr->action) {
212 self_ptr->info[self_ptr->line++] = _("あなたはひじょうに注意深く周囲を見渡している。", "You are looking around very carefully.");
216 set_body_improvement_info_2(creature_ptr, self_ptr);
217 set_esp_info(creature_ptr, self_ptr);
218 set_body_improvement_info_3(creature_ptr, self_ptr);
219 set_element_resistance_info(creature_ptr, self_ptr);
220 set_high_resistance_info(creature_ptr, self_ptr);
221 set_body_improvement_info_4(creature_ptr, self_ptr);
222 set_status_sustain_info(creature_ptr, self_ptr);
223 set_equipment_influence(creature_ptr, self_ptr);
224 set_weapon_effect_info(creature_ptr, self_ptr);
225 display_self_info(self_ptr);
229 * @brief 魔法効果時間のターン数に基づいて表現IDを返す。
233 static int report_magics_aux(int dur)
237 } else if (dur <= 10) {
239 } else if (dur <= 20) {
241 } else if (dur <= 50) {
243 } else if (dur <= 100) {
245 } else if (dur <= 200) {
252 static concptr report_magic_durations[] = { _("ごく短い間", "for a short time"), _("少しの間", "for a little while"), _("しばらくの間", "for a while"),
253 _("多少長い間", "for a long while"), _("長い間", "for a long time"), _("非常に長い間", "for a very long time"),
254 _("信じ難いほど長い間", "for an incredibly long time"), _("モンスターを攻撃するまで", "until you hit a monster") };
257 * @brief 現在の一時的効果一覧を返す / Report all currently active magical effects.
260 void report_magics(player_type *creature_ptr)
265 if (creature_ptr->blind) {
266 info2[i] = report_magics_aux(creature_ptr->blind);
267 info[i++] = _("あなたは目が見えない", "You cannot see");
270 if (creature_ptr->confused) {
271 info2[i] = report_magics_aux(creature_ptr->confused);
272 info[i++] = _("あなたは混乱している", "You are confused");
275 if (creature_ptr->afraid) {
276 info2[i] = report_magics_aux(creature_ptr->afraid);
277 info[i++] = _("あなたは恐怖に侵されている", "You are terrified");
280 if (creature_ptr->poisoned) {
281 info2[i] = report_magics_aux(creature_ptr->poisoned);
282 info[i++] = _("あなたは毒に侵されている", "You are poisoned");
285 if (creature_ptr->image) {
286 info2[i] = report_magics_aux(creature_ptr->image);
287 info[i++] = _("あなたは幻覚を見ている", "You are hallucinating");
290 if (creature_ptr->blessed) {
291 info2[i] = report_magics_aux(creature_ptr->blessed);
292 info[i++] = _("あなたは高潔さを感じている", "You feel rightous");
295 if (creature_ptr->hero) {
296 info2[i] = report_magics_aux(creature_ptr->hero);
297 info[i++] = _("あなたはヒーロー気分だ", "You feel heroic");
300 if (is_shero(creature_ptr)) {
301 info2[i] = report_magics_aux(creature_ptr->shero);
302 info[i++] = _("あなたは戦闘狂だ", "You are in a battle rage");
305 if (creature_ptr->protevil) {
306 info2[i] = report_magics_aux(creature_ptr->protevil);
307 info[i++] = _("あなたは邪悪なる存在から守られている", "You are protected from evil");
310 if (creature_ptr->shield) {
311 info2[i] = report_magics_aux(creature_ptr->shield);
312 info[i++] = _("あなたは神秘のシールドで守られている", "You are protected by a mystic shield");
315 if (creature_ptr->invuln) {
316 info2[i] = report_magics_aux(creature_ptr->invuln);
317 info[i++] = _("あなたは無敵だ", "You are invulnerable");
320 if (creature_ptr->wraith_form) {
321 info2[i] = report_magics_aux(creature_ptr->wraith_form);
322 info[i++] = _("あなたは幽体化している", "You are incorporeal");
325 if (creature_ptr->special_attack & ATTACK_CONFUSE) {
327 info[i++] = _("あなたの手は赤く輝いている", "Your hands are glowing dull red.");
330 if (creature_ptr->word_recall) {
331 info2[i] = report_magics_aux(creature_ptr->word_recall);
332 info[i++] = _("この後帰還の詔が発動する", "You are waiting to be recalled");
335 if (creature_ptr->alter_reality) {
336 info2[i] = report_magics_aux(creature_ptr->alter_reality);
337 info[i++] = _("この後現実変容が発動する", "You waiting to be altered");
340 if (creature_ptr->oppose_acid) {
341 info2[i] = report_magics_aux(creature_ptr->oppose_acid);
342 info[i++] = _("あなたは酸への耐性を持っている", "You are resistant to acid");
345 if (creature_ptr->oppose_elec) {
346 info2[i] = report_magics_aux(creature_ptr->oppose_elec);
347 info[i++] = _("あなたは電撃への耐性を持っている", "You are resistant to lightning");
350 if (creature_ptr->oppose_fire) {
351 info2[i] = report_magics_aux(creature_ptr->oppose_fire);
352 info[i++] = _("あなたは火への耐性を持っている", "You are resistant to fire");
355 if (creature_ptr->oppose_cold) {
356 info2[i] = report_magics_aux(creature_ptr->oppose_cold);
357 info[i++] = _("あなたは冷気への耐性を持っている", "You are resistant to cold");
360 if (creature_ptr->oppose_pois) {
361 info2[i] = report_magics_aux(creature_ptr->oppose_pois);
362 info[i++] = _("あなたは毒への耐性を持っている", "You are resistant to poison");
367 /* Erase the screen */
368 for (int k = 1; k < 24; k++)
371 prt(_(" 現在かかっている魔法 :", " Your Current Magic:"), 1, 15);
374 for (int j = 0; j < i; j++) {
375 sprintf(buf, _("%-28s : 期間 - %s ", "%s %s."), info[j], report_magic_durations[info2[j]]);
378 /* Every 20 entries (lines 2 to 21), start over */
379 if ((k == 22) && (j + 1 < i)) {
380 prt(_("-- 続く --", "-- more --"), k, 15);
387 prt(_("[何かキーを押すとゲームに戻ります]", "[Press any key to continue]"), k, 13);