OSDN Git Service

76d2f059e66419135fb5c27587344e1c6bd571ab
[hengbandforosx/hengbandosx.git] / src / player-info / weapon-effect-info.cpp
1 #include "player-info/weapon-effect-info.h"
2 #include "inventory/inventory-slot-types.h"
3 #include "object-enchant/tr-types.h"
4 #include "player-info/self-info-util.h"
5 #include "system/player-type-definition.h"
6 #include "util/bit-flags-calculator.h"
7
8 static void set_weapon_bless_info(self_info_type *self_ptr)
9 {
10     if (self_ptr->flags.has(TR_BLESSED))
11         self_ptr->info[self_ptr->line++] = _("あなたの武器は神の祝福を受けている。", "Your weapon has been blessed by the gods.");
12
13     if (self_ptr->flags.has(TR_CHAOTIC))
14         self_ptr->info[self_ptr->line++] = _("あなたの武器はログルスの徴の属性をもつ。", "Your weapon is branded with the Sign of Logrus.");
15
16     if (self_ptr->flags.has(TR_BRAND_MAGIC))
17         self_ptr->info[self_ptr->line++] = _("あなたの武器は魔術的効果を発動することがある。", "Your weapon is branded with magical power.");
18
19     if (self_ptr->flags.has(TR_EARTHQUAKE))
20         self_ptr->info[self_ptr->line++] = _("あなたの武器は打撃で地震を発生することができる。", "The impact of your weapon can cause earthquakes.");
21
22     if (self_ptr->flags.has(TR_VORPAL))
23         self_ptr->info[self_ptr->line++] = _("あなたの武器は非常に鋭い。", "Your weapon is very sharp.");
24
25     if (self_ptr->flags.has(TR_IMPACT))
26         self_ptr->info[self_ptr->line++] = _("あなたの武器は強力な一撃を放てる。", "Your weapon hits your foes strongly.");
27
28     if (self_ptr->flags.has(TR_VAMPIRIC))
29         self_ptr->info[self_ptr->line++] = _("あなたの武器は敵から生命力を吸収する。", "Your weapon drains life from your foes.");
30 }
31
32 static void set_brand_attack_info(self_info_type *self_ptr)
33 {
34     if (self_ptr->flags.has(TR_BRAND_ACID))
35         self_ptr->info[self_ptr->line++] = _("あなたの武器は敵を溶かす。", "Your weapon melts your foes.");
36
37     if (self_ptr->flags.has(TR_BRAND_ELEC))
38         self_ptr->info[self_ptr->line++] = _("あなたの武器は敵を感電させる。", "Your weapon shocks your foes.");
39
40     if (self_ptr->flags.has(TR_BRAND_FIRE))
41         self_ptr->info[self_ptr->line++] = _("あなたの武器は敵を燃やす。", "Your weapon burns your foes.");
42
43     if (self_ptr->flags.has(TR_BRAND_COLD))
44         self_ptr->info[self_ptr->line++] = _("あなたの武器は敵を凍らせる。", "Your weapon freezes your foes.");
45
46     if (self_ptr->flags.has(TR_BRAND_POIS))
47         self_ptr->info[self_ptr->line++] = _("あなたの武器は敵を毒で侵す。", "Your weapon poisons your foes.");
48 }
49
50 static void set_slay_info(self_info_type *self_ptr)
51 {
52     if (self_ptr->flags.has(TR_KILL_ANIMAL))
53         self_ptr->info[self_ptr->line++] = _("あなたの武器は動物の天敵である。", "Your weapon is a great bane of animals.");
54     else if (self_ptr->flags.has(TR_SLAY_ANIMAL))
55         self_ptr->info[self_ptr->line++] = _("あなたの武器は動物に対して強い力を発揮する。", "Your weapon strikes at animals with extra force.");
56
57     if (self_ptr->flags.has(TR_KILL_EVIL))
58         self_ptr->info[self_ptr->line++] = _("あなたの武器は邪悪なる存在の天敵である。", "Your weapon is a great bane of evil.");
59     else if (self_ptr->flags.has(TR_SLAY_EVIL))
60         self_ptr->info[self_ptr->line++] = _("あなたの武器は邪悪なる存在に対して強い力を発揮する。", "Your weapon strikes at evil with extra force.");
61
62     if (self_ptr->flags.has(TR_KILL_GOOD))
63         self_ptr->info[self_ptr->line++] = _("あなたの武器は善良なる存在の天敵である。", "Your weapon is a great bane of good.");
64     else if (self_ptr->flags.has(TR_SLAY_GOOD))
65         self_ptr->info[self_ptr->line++] = _("あなたの武器は善良なる存在に対して強い力を発揮する。", "Your weapon strikes at good with extra force.");
66
67     if (self_ptr->flags.has(TR_KILL_HUMAN))
68         self_ptr->info[self_ptr->line++] = _("あなたの武器は人間の天敵である。", "Your weapon is a great bane of humans.");
69     else if (self_ptr->flags.has(TR_SLAY_HUMAN))
70         self_ptr->info[self_ptr->line++] = _("あなたの武器は人間に対して特に強い力を発揮する。", "Your weapon is especially deadly against humans.");
71
72     if (self_ptr->flags.has(TR_KILL_UNDEAD))
73         self_ptr->info[self_ptr->line++] = _("あなたの武器はアンデッドの天敵である。", "Your weapon is a great bane of undead.");
74     else if (self_ptr->flags.has(TR_SLAY_UNDEAD))
75         self_ptr->info[self_ptr->line++] = _("あなたの武器はアンデッドに対して神聖なる力を発揮する。", "Your weapon strikes at undead with holy wrath.");
76
77     if (self_ptr->flags.has(TR_KILL_DEMON))
78         self_ptr->info[self_ptr->line++] = _("あなたの武器はデーモンの天敵である。", "Your weapon is a great bane of demons.");
79     else if (self_ptr->flags.has(TR_SLAY_DEMON))
80         self_ptr->info[self_ptr->line++] = _("あなたの武器はデーモンに対して神聖なる力を発揮する。", "Your weapon strikes at demons with holy wrath.");
81
82     if (self_ptr->flags.has(TR_KILL_ORC))
83         self_ptr->info[self_ptr->line++] = _("あなたの武器はオークの天敵である。", "Your weapon is a great bane of orcs.");
84     else if (self_ptr->flags.has(TR_SLAY_ORC))
85         self_ptr->info[self_ptr->line++] = _("あなたの武器はオークに対して特に強い力を発揮する。", "Your weapon is especially deadly against orcs.");
86
87     if (self_ptr->flags.has(TR_KILL_TROLL))
88         self_ptr->info[self_ptr->line++] = _("あなたの武器はトロルの天敵である。", "Your weapon is a great bane of trolls.");
89     else if (self_ptr->flags.has(TR_SLAY_TROLL))
90         self_ptr->info[self_ptr->line++] = _("あなたの武器はトロルに対して特に強い力を発揮する。", "Your weapon is especially deadly against trolls.");
91
92     if (self_ptr->flags.has(TR_KILL_GIANT))
93         self_ptr->info[self_ptr->line++] = _("あなたの武器は巨人の天敵である。", "Your weapon is a great bane of giants.");
94     else if (self_ptr->flags.has(TR_SLAY_GIANT))
95         self_ptr->info[self_ptr->line++] = _("あなたの武器は巨人に対して特に強い力を発揮する。", "Your weapon is especially deadly against giants.");
96
97     if (self_ptr->flags.has(TR_KILL_DRAGON))
98         self_ptr->info[self_ptr->line++] = _("あなたの武器はドラゴンの天敵である。", "Your weapon is a great bane of dragons.");
99     else if (self_ptr->flags.has(TR_SLAY_DRAGON))
100         self_ptr->info[self_ptr->line++] = _("あなたの武器はドラゴンに対して特に強い力を発揮する。", "Your weapon is especially deadly against dragons.");
101 }
102
103 void set_weapon_effect_info(player_type *player_ptr, self_info_type *self_ptr)
104 {
105     object_type *o_ptr = &player_ptr->inventory_list[INVEN_MAIN_HAND];
106     if (o_ptr->k_idx == 0)
107         return;
108
109     set_weapon_bless_info(self_ptr);
110     set_brand_attack_info(self_ptr);
111     set_slay_info(self_ptr);
112     if (self_ptr->flags.has(TR_FORCE_WEAPON))
113         self_ptr->info[self_ptr->line++] = _("あなたの武器はMPを使って攻撃する。", "Your weapon causes great damage using your MP.");
114
115     if (self_ptr->flags.has(TR_THROW))
116         self_ptr->info[self_ptr->line++] = _("あなたの武器は投げやすい。", "Your weapon can be thrown well.");
117 }