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 "term/screen-processor.h"
27 #include "view/display-self-info.h"
29 static void set_bad_status_info(player_type *creature_ptr, self_info_type *si_ptr)
31 if (creature_ptr->blind)
32 si_ptr->info[si_ptr->line++] = _("あなたは目が見えない。", "You cannot see.");
34 if (creature_ptr->confused)
35 si_ptr->info[si_ptr->line++] = _("あなたは混乱している。", "You are confused.");
37 if (creature_ptr->afraid)
38 si_ptr->info[si_ptr->line++] = _("あなたは恐怖に侵されている。", "You are terrified.");
40 if (creature_ptr->cut)
41 si_ptr->info[si_ptr->line++] = _("あなたは出血している。", "You are bleeding.");
43 if (creature_ptr->stun)
44 si_ptr->info[si_ptr->line++] = _("あなたはもうろうとしている。", "You are stunned.");
46 if (creature_ptr->poisoned)
47 si_ptr->info[si_ptr->line++] = _("あなたは毒に侵されている。", "You are poisoned.");
49 if (creature_ptr->image)
50 si_ptr->info[si_ptr->line++] = _("あなたは幻覚を見ている。", "You are hallucinating.");
53 static void set_curse_info(player_type *creature_ptr, self_info_type *si_ptr)
55 if (creature_ptr->cursed & TRC_TY_CURSE)
56 si_ptr->info[si_ptr->line++] = _("あなたは邪悪な怨念に包まれている。", "You carry an ancient foul curse.");
58 if (creature_ptr->cursed & TRC_AGGRAVATE)
59 si_ptr->info[si_ptr->line++] = _("あなたはモンスターを怒らせている。", "You aggravate monsters.");
61 if (creature_ptr->cursed & TRC_DRAIN_EXP)
62 si_ptr->info[si_ptr->line++] = _("あなたは経験値を吸われている。", "You occasionally lose experience for no reason.");
64 if (creature_ptr->cursed & TRC_SLOW_REGEN)
65 si_ptr->info[si_ptr->line++] = _("あなたの回復力は非常に遅い。", "You regenerate slowly.");
67 if (creature_ptr->cursed & TRC_ADD_L_CURSE)
68 si_ptr->info[si_ptr->line++] = _("あなたの弱い呪いは増える。", "Your weak curses multiply."); /* 暫定的 -- henkma */
70 if (creature_ptr->cursed & TRC_ADD_H_CURSE)
71 si_ptr->info[si_ptr->line++] = _("あなたの強い呪いは増える。", "Your heavy curses multiply."); /* 暫定的 -- henkma */
73 if (creature_ptr->cursed & TRC_CALL_ANIMAL)
74 si_ptr->info[si_ptr->line++] = _("あなたは動物に狙われている。", "You attract animals.");
76 if (creature_ptr->cursed & TRC_CALL_DEMON)
77 si_ptr->info[si_ptr->line++] = _("あなたは悪魔に狙われている。", "You attract demons.");
79 if (creature_ptr->cursed & TRC_CALL_DRAGON)
80 si_ptr->info[si_ptr->line++] = _("あなたはドラゴンに狙われている。", "You attract dragons.");
82 if (creature_ptr->cursed & TRC_COWARDICE)
83 si_ptr->info[si_ptr->line++] = _("あなたは時々臆病になる。", "You are subject to cowardice.");
85 if (creature_ptr->cursed & TRC_TELEPORT)
86 si_ptr->info[si_ptr->line++] = _("あなたの位置はひじょうに不安定だ。", "Your position is very uncertain.");
88 if (creature_ptr->cursed & TRC_LOW_MELEE)
89 si_ptr->info[si_ptr->line++] = _("あなたの武器は攻撃を外しやすい。", "Your weapon causes you to miss blows.");
91 if (creature_ptr->cursed & TRC_LOW_AC)
92 si_ptr->info[si_ptr->line++] = _("あなたは攻撃を受けやすい。", "You are subject to be hit.");
94 if (creature_ptr->cursed & TRC_LOW_MAGIC)
95 si_ptr->info[si_ptr->line++] = _("あなたは魔法を失敗しやすい。", "Your spells fail more frequently.");
97 if (creature_ptr->cursed & TRC_FAST_DIGEST)
98 si_ptr->info[si_ptr->line++] = _("あなたはすぐお腹がへる。", "You have a good appetite.");
100 if (creature_ptr->cursed & TRC_DRAIN_HP)
101 si_ptr->info[si_ptr->line++] = _("あなたは体力を吸われている。", "You occasionally lose hit points for no reason.");
103 if (creature_ptr->cursed & TRC_DRAIN_MANA)
104 si_ptr->info[si_ptr->line++] = _("あなたは魔力を吸われている。", "You occasionally lose spell points for no reason.");
107 static void set_special_attack_info(player_type *creature_ptr, self_info_type *si_ptr)
109 if (creature_ptr->special_attack & ATTACK_CONFUSE)
110 si_ptr->info[si_ptr->line++] = _("あなたの手は赤く輝いている。", "Your hands are glowing dull red.");
112 if (creature_ptr->special_attack & ATTACK_FIRE)
113 si_ptr->info[si_ptr->line++] = _("あなたの手は火炎に覆われている。", "You can strike the enemy with flame.");
115 if (creature_ptr->special_attack & ATTACK_COLD)
116 si_ptr->info[si_ptr->line++] = _("あなたの手は冷気に覆われている。", "You can strike the enemy with cold.");
118 if (creature_ptr->special_attack & ATTACK_ACID)
119 si_ptr->info[si_ptr->line++] = _("あなたの手は酸に覆われている。", "You can strike the enemy with acid.");
121 if (creature_ptr->special_attack & ATTACK_ELEC)
122 si_ptr->info[si_ptr->line++] = _("あなたの手は電撃に覆われている。", "You can strike the enemy with electoric shock.");
124 if (creature_ptr->special_attack & ATTACK_POIS)
125 si_ptr->info[si_ptr->line++] = _("あなたの手は毒に覆われている。", "You can strike the enemy with poison.");
128 static void set_esp_info(player_type *creature_ptr, self_info_type *si_ptr)
130 if (creature_ptr->telepathy)
131 si_ptr->info[si_ptr->line++] = _("あなたはテレパシー能力を持っている。", "You have ESP.");
133 if (creature_ptr->esp_animal)
134 si_ptr->info[si_ptr->line++] = _("あなたは自然界の生物の存在を感じる能力を持っている。", "You sense natural creatures.");
136 if (creature_ptr->esp_undead)
137 si_ptr->info[si_ptr->line++] = _("あなたはアンデッドの存在を感じる能力を持っている。", "You sense undead.");
139 if (creature_ptr->esp_demon)
140 si_ptr->info[si_ptr->line++] = _("あなたは悪魔の存在を感じる能力を持っている。", "You sense demons.");
142 if (creature_ptr->esp_orc)
143 si_ptr->info[si_ptr->line++] = _("あなたはオークの存在を感じる能力を持っている。", "You sense orcs.");
145 if (creature_ptr->esp_troll)
146 si_ptr->info[si_ptr->line++] = _("あなたはトロルの存在を感じる能力を持っている。", "You sense trolls.");
148 if (creature_ptr->esp_giant)
149 si_ptr->info[si_ptr->line++] = _("あなたは巨人の存在を感じる能力を持っている。", "You sense giants.");
151 if (creature_ptr->esp_dragon)
152 si_ptr->info[si_ptr->line++] = _("あなたはドラゴンの存在を感じる能力を持っている。", "You sense dragons.");
154 if (creature_ptr->esp_human)
155 si_ptr->info[si_ptr->line++] = _("あなたは人間の存在を感じる能力を持っている。", "You sense humans.");
157 if (creature_ptr->esp_evil)
158 si_ptr->info[si_ptr->line++] = _("あなたは邪悪な生き物の存在を感じる能力を持っている。", "You sense evil creatures.");
160 if (creature_ptr->esp_good)
161 si_ptr->info[si_ptr->line++] = _("あなたは善良な生き物の存在を感じる能力を持っている。", "You sense good creatures.");
163 if (creature_ptr->esp_nonliving)
164 si_ptr->info[si_ptr->line++] = _("あなたは活動する無生物体の存在を感じる能力を持っている。", "You sense non-living creatures.");
166 if (creature_ptr->esp_unique)
167 si_ptr->info[si_ptr->line++] = _("あなたは特別な強敵の存在を感じる能力を持っている。", "You sense unique monsters.");
171 * @brief 自己分析処理(Nethackからのアイデア) / self-knowledge... idea from nethack.
175 * Useful for determining powers and
176 * resistences of items. It saves the screen, clears it, then starts listing
177 * attributes, a screenful at a time. (There are a LOT of attributes to
178 * list. It will probably take 2 or 3 screens for a powerful character whose
179 * using several artifacts...) -CFT
181 * It is now a lot more efficient. -BEN-
183 * See also "identify_fully()".
185 * Use the "show_file()" method, perhaps.
188 void self_knowledge(player_type *creature_ptr)
190 self_info_type tmp_si;
191 self_info_type *si_ptr = initialize_self_info_type(&tmp_si);
192 display_life_rating(creature_ptr, si_ptr);
193 chg_virtue(creature_ptr, V_KNOWLEDGE, 1);
194 chg_virtue(creature_ptr, V_ENLIGHTEN, 1);
195 display_max_base_status(creature_ptr, si_ptr);
196 display_virtue(creature_ptr, si_ptr);
197 si_ptr->info[si_ptr->line++] = "";
198 if (creature_ptr->mimic_form)
199 display_mimic_race_ability(creature_ptr, si_ptr);
201 set_race_ability_info(creature_ptr, si_ptr);
203 set_class_ability_info(creature_ptr, si_ptr);
204 set_mutation_info_1(creature_ptr, si_ptr);
205 set_mutation_info_2(creature_ptr, si_ptr);
206 set_mutation_info_3(creature_ptr, si_ptr);
207 set_bad_status_info(creature_ptr, si_ptr);
208 set_curse_info(creature_ptr, si_ptr);
209 set_body_improvement_info_1(creature_ptr, si_ptr);
210 set_special_attack_info(creature_ptr, si_ptr);
211 switch (creature_ptr->action) {
213 si_ptr->info[si_ptr->line++] = _("あなたはひじょうに注意深く周囲を見渡している。", "You are looking around very carefully.");
217 set_body_improvement_info_2(creature_ptr, si_ptr);
218 set_esp_info(creature_ptr, si_ptr);
219 set_body_improvement_info_3(creature_ptr, si_ptr);
220 set_element_resistance_info(creature_ptr, si_ptr);
221 set_high_resistance_info(creature_ptr, si_ptr);
222 set_body_improvement_info_4(creature_ptr, si_ptr);
223 set_status_sustain_info(creature_ptr, si_ptr);
224 set_equipment_influence(creature_ptr, si_ptr);
225 set_weapon_effect_info(creature_ptr, si_ptr);
226 display_self_info(si_ptr);
230 * @brief 魔法効果時間のターン数に基づいて表現IDを返す。
234 static int report_magics_aux(int dur)
238 } else if (dur <= 10) {
240 } else if (dur <= 20) {
242 } else if (dur <= 50) {
244 } else if (dur <= 100) {
246 } else if (dur <= 200) {
253 static concptr report_magic_durations[] = { _("ごく短い間", "for a short time"), _("少しの間", "for a little while"), _("しばらくの間", "for a while"),
254 _("多少長い間", "for a long while"), _("長い間", "for a long time"), _("非常に長い間", "for a very long time"),
255 _("信じ難いほど長い間", "for an incredibly long time"), _("モンスターを攻撃するまで", "until you hit a monster") };
258 * @brief 現在の一時的効果一覧を返す / Report all currently active magical effects.
261 void report_magics(player_type *creature_ptr)
266 if (creature_ptr->blind) {
267 info2[i] = report_magics_aux(creature_ptr->blind);
268 info[i++] = _("あなたは目が見えない", "You cannot see");
271 if (creature_ptr->confused) {
272 info2[i] = report_magics_aux(creature_ptr->confused);
273 info[i++] = _("あなたは混乱している", "You are confused");
276 if (creature_ptr->afraid) {
277 info2[i] = report_magics_aux(creature_ptr->afraid);
278 info[i++] = _("あなたは恐怖に侵されている", "You are terrified");
281 if (creature_ptr->poisoned) {
282 info2[i] = report_magics_aux(creature_ptr->poisoned);
283 info[i++] = _("あなたは毒に侵されている", "You are poisoned");
286 if (creature_ptr->image) {
287 info2[i] = report_magics_aux(creature_ptr->image);
288 info[i++] = _("あなたは幻覚を見ている", "You are hallucinating");
291 if (creature_ptr->blessed) {
292 info2[i] = report_magics_aux(creature_ptr->blessed);
293 info[i++] = _("あなたは高潔さを感じている", "You feel rightous");
296 if (creature_ptr->hero) {
297 info2[i] = report_magics_aux(creature_ptr->hero);
298 info[i++] = _("あなたはヒーロー気分だ", "You feel heroic");
301 if (creature_ptr->shero) {
302 info2[i] = report_magics_aux(creature_ptr->shero);
303 info[i++] = _("あなたは戦闘狂だ", "You are in a battle rage");
306 if (creature_ptr->protevil) {
307 info2[i] = report_magics_aux(creature_ptr->protevil);
308 info[i++] = _("あなたは邪悪なる存在から守られている", "You are protected from evil");
311 if (creature_ptr->shield) {
312 info2[i] = report_magics_aux(creature_ptr->shield);
313 info[i++] = _("あなたは神秘のシールドで守られている", "You are protected by a mystic shield");
316 if (creature_ptr->invuln) {
317 info2[i] = report_magics_aux(creature_ptr->invuln);
318 info[i++] = _("あなたは無敵だ", "You are invulnerable");
321 if (creature_ptr->wraith_form) {
322 info2[i] = report_magics_aux(creature_ptr->wraith_form);
323 info[i++] = _("あなたは幽体化している", "You are incorporeal");
326 if (creature_ptr->special_attack & ATTACK_CONFUSE) {
328 info[i++] = _("あなたの手は赤く輝いている", "Your hands are glowing dull red.");
331 if (creature_ptr->word_recall) {
332 info2[i] = report_magics_aux(creature_ptr->word_recall);
333 info[i++] = _("この後帰還の詔が発動する", "You are waiting to be recalled");
336 if (creature_ptr->alter_reality) {
337 info2[i] = report_magics_aux(creature_ptr->alter_reality);
338 info[i++] = _("この後現実変容が発動する", "You waiting to be altered");
341 if (creature_ptr->oppose_acid) {
342 info2[i] = report_magics_aux(creature_ptr->oppose_acid);
343 info[i++] = _("あなたは酸への耐性を持っている", "You are resistant to acid");
346 if (creature_ptr->oppose_elec) {
347 info2[i] = report_magics_aux(creature_ptr->oppose_elec);
348 info[i++] = _("あなたは電撃への耐性を持っている", "You are resistant to lightning");
351 if (creature_ptr->oppose_fire) {
352 info2[i] = report_magics_aux(creature_ptr->oppose_fire);
353 info[i++] = _("あなたは火への耐性を持っている", "You are resistant to fire");
356 if (creature_ptr->oppose_cold) {
357 info2[i] = report_magics_aux(creature_ptr->oppose_cold);
358 info[i++] = _("あなたは冷気への耐性を持っている", "You are resistant to cold");
361 if (creature_ptr->oppose_pois) {
362 info2[i] = report_magics_aux(creature_ptr->oppose_pois);
363 info[i++] = _("あなたは毒への耐性を持っている", "You are resistant to poison");
368 /* Erase the screen */
369 for (int k = 1; k < 24; k++)
372 prt(_(" 現在かかっている魔法 :", " Your Current Magic:"), 1, 15);
375 for (int j = 0; j < i; j++) {
376 sprintf(buf, _("%-28s : 期間 - %s ", "%s %s."), info[j], report_magic_durations[info2[j]]);
379 /* Every 20 entries (lines 2 to 21), start over */
380 if ((k == 22) && (j + 1 < i)) {
381 prt(_("-- 続く --", "-- more --"), k, 15);
388 prt(_("[何かキーを押すとゲームに戻ります]", "[Press any key to continue]"), k, 13);