OSDN Git Service

[Refactor] #40514 player_type の resist_lite 変数を廃止. / Abolished the resist_lite variab...
[hengband/hengband.git] / src / player-info / resistance-info.c
1 #include "player-info/resistance-info.h"
2 #include "player-info/self-info-util.h"
3 #include "player/player-race.h"
4 #include "status/element-resistance.h"
5 #include "player/player-status-flags.h"
6
7 void set_element_resistance_info(player_type* creature_ptr, self_info_type* self_ptr)
8 {
9     if (has_immune_acid(creature_ptr)) {
10         self_ptr->info[self_ptr->line++] = _("あなたは酸に対する完全なる免疫を持っている。", "You are completely immune to acid.");
11     } else if (has_resist_acid(creature_ptr) && is_oppose_acid(creature_ptr)) {
12         self_ptr->info[self_ptr->line++] = _("あなたは酸への強力な耐性を持っている。", "You resist acid exceptionally well.");
13     } else if (has_resist_acid(creature_ptr) || is_oppose_acid(creature_ptr)) {
14         self_ptr->info[self_ptr->line++] = _("あなたは酸への耐性を持っている。", "You are resistant to acid.");
15     }
16
17     if (has_immune_elec(creature_ptr)) {
18         self_ptr->info[self_ptr->line++] = _("あなたは電撃に対する完全なる免疫を持っている。", "You are completely immune to lightning.");
19     } else if (has_resist_elec(creature_ptr) && is_oppose_elec(creature_ptr)) {
20         self_ptr->info[self_ptr->line++] = _("あなたは電撃への強力な耐性を持っている。", "You resist lightning exceptionally well.");
21     } else if (has_resist_elec(creature_ptr) || is_oppose_elec(creature_ptr)) {
22         self_ptr->info[self_ptr->line++] = _("あなたは電撃への耐性を持っている。", "You are resistant to lightning.");
23     }
24     if (is_specific_player_race(creature_ptr, RACE_ANDROID) && !has_immune_elec(creature_ptr)) {
25         self_ptr->info[self_ptr->line++] = _("あなたは電撃に弱い。", "You are susceptible to damage from lightning.");
26     }
27
28     if (has_immune_fire(creature_ptr)) {
29         self_ptr->info[self_ptr->line++] = _("あなたは火に対する完全なる免疫を持っている。", "You are completely immune to fire.");
30     } else if (has_resist_fire(creature_ptr) &&is_oppose_fire(creature_ptr)) {
31         self_ptr->info[self_ptr->line++] = _("あなたは火への強力な耐性を持っている。", "You resist fire exceptionally well.");
32     } else if (has_resist_fire(creature_ptr) || is_oppose_fire(creature_ptr)) {
33         self_ptr->info[self_ptr->line++] = _("あなたは火への耐性を持っている。", "You are resistant to fire.");
34     }
35
36     if (is_specific_player_race(creature_ptr, RACE_ENT) && !has_immune_fire(creature_ptr)) {
37         self_ptr->info[self_ptr->line++] = _("あなたは火に弱い。", "You are susceptible to damage from fire.");
38     }
39
40     if (has_immune_cold(creature_ptr)) {
41         self_ptr->info[self_ptr->line++] = _("あなたは冷気に対する完全なる免疫を持っている。", "You are completely immune to cold.");
42     } else if (has_resist_cold(creature_ptr) && is_oppose_cold(creature_ptr)) {
43         self_ptr->info[self_ptr->line++] = _("あなたは冷気への強力な耐性を持っている。", "You resist cold exceptionally well.");
44     } else if (has_resist_cold(creature_ptr) || is_oppose_cold(creature_ptr)) {
45         self_ptr->info[self_ptr->line++] = _("あなたは冷気への耐性を持っている。", "You are resistant to cold.");
46     }
47
48     if (has_resist_pois(creature_ptr) && is_oppose_pois(creature_ptr)) {
49         self_ptr->info[self_ptr->line++] = _("あなたは毒への強力な耐性を持っている。", "You resist poison exceptionally well.");
50     } else if (has_resist_pois(creature_ptr) || is_oppose_pois(creature_ptr)) {
51         self_ptr->info[self_ptr->line++] = _("あなたは毒への耐性を持っている。", "You are resistant to poison.");
52     }
53 }
54
55 void set_high_resistance_info(player_type *creature_ptr, self_info_type *self_ptr)
56 {
57     if (has_resist_lite(creature_ptr))
58         self_ptr->info[self_ptr->line++] = _("あなたは閃光への耐性を持っている。", "You are resistant to bright light.");
59
60     if (is_specific_player_race(creature_ptr, RACE_VAMPIRE) || is_specific_player_race(creature_ptr, RACE_S_FAIRY)
61         || (creature_ptr->mimic_form == MIMIC_VAMPIRE))
62         self_ptr->info[self_ptr->line++] = _("あなたは閃光に弱い。", "You are susceptible to damage from bright light.");
63
64     if (is_specific_player_race(creature_ptr, RACE_VAMPIRE) || (creature_ptr->mimic_form == MIMIC_VAMPIRE) || creature_ptr->wraith_form)
65         self_ptr->info[self_ptr->line++] = _("あなたは暗黒に対する完全なる免疫を持っている。", "You are completely immune to darkness.");
66     else if (creature_ptr->resist_dark)
67         self_ptr->info[self_ptr->line++] = _("あなたは暗黒への耐性を持っている。", "You are resistant to darkness.");
68     
69     if (has_resist_conf(creature_ptr))
70         self_ptr->info[self_ptr->line++] = _("あなたは混乱への耐性を持っている。", "You are resistant to confusion.");
71     
72     if (has_resist_sound(creature_ptr))
73         self_ptr->info[self_ptr->line++] = _("あなたは音波の衝撃への耐性を持っている。", "You are resistant to sonic attacks.");
74     
75     if (creature_ptr->resist_disen)
76         self_ptr->info[self_ptr->line++] = _("あなたは劣化への耐性を持っている。", "You are resistant to disenchantment.");
77     
78     if (creature_ptr->resist_chaos)
79         self_ptr->info[self_ptr->line++] = _("あなたはカオスの力への耐性を持っている。", "You are resistant to chaos.");
80     
81     if (creature_ptr->resist_shard)
82         self_ptr->info[self_ptr->line++] = _("あなたは破片の攻撃への耐性を持っている。", "You are resistant to blasts of shards.");
83     
84     if (creature_ptr->resist_nexus)
85         self_ptr->info[self_ptr->line++] = _("あなたは因果混乱の攻撃への耐性を持っている。", "You are resistant to nexus attacks.");
86
87     if (is_specific_player_race(creature_ptr, RACE_SPECTRE))
88         self_ptr->info[self_ptr->line++] = _("あなたは地獄の力を吸収できる。", "You can drain nether forces.");
89     else if (creature_ptr->resist_neth)
90         self_ptr->info[self_ptr->line++] = _("あなたは地獄の力への耐性を持っている。", "You are resistant to nether forces.");
91 }