OSDN Git Service

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