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"
8 static void set_weapon_bless_info(self_info_type *self_ptr)
10 if (self_ptr->flags.has(TR_BLESSED))
11 self_ptr->info[self_ptr->line++] = _("あなたの武器は神の祝福を受けている。", "Your weapon has been blessed by the gods.");
13 if (self_ptr->flags.has(TR_CHAOTIC))
14 self_ptr->info[self_ptr->line++] = _("あなたの武器はログルスの徴の属性をもつ。", "Your weapon is branded with the Sign of Logrus.");
16 if (self_ptr->flags.has(TR_BRAND_MAGIC))
17 self_ptr->info[self_ptr->line++] = _("あなたの武器は魔術的効果を発動することがある。", "Your weapon is branded with magical power.");
19 if (self_ptr->flags.has(TR_EARTHQUAKE))
20 self_ptr->info[self_ptr->line++] = _("あなたの武器は打撃で地震を発生することができる。", "The impact of your weapon can cause earthquakes.");
22 if (self_ptr->flags.has(TR_VORPAL))
23 self_ptr->info[self_ptr->line++] = _("あなたの武器は非常に鋭い。", "Your weapon is very sharp.");
25 if (self_ptr->flags.has(TR_IMPACT))
26 self_ptr->info[self_ptr->line++] = _("あなたの武器は強力な一撃を放てる。", "Your weapon hits your foes strongly.");
28 if (self_ptr->flags.has(TR_VAMPIRIC))
29 self_ptr->info[self_ptr->line++] = _("あなたの武器は敵から生命力を吸収する。", "Your weapon drains life from your foes.");
32 static void set_brand_attack_info(self_info_type *self_ptr)
34 if (self_ptr->flags.has(TR_BRAND_ACID))
35 self_ptr->info[self_ptr->line++] = _("あなたの武器は敵を溶かす。", "Your weapon melts your foes.");
37 if (self_ptr->flags.has(TR_BRAND_ELEC))
38 self_ptr->info[self_ptr->line++] = _("あなたの武器は敵を感電させる。", "Your weapon shocks your foes.");
40 if (self_ptr->flags.has(TR_BRAND_FIRE))
41 self_ptr->info[self_ptr->line++] = _("あなたの武器は敵を燃やす。", "Your weapon burns your foes.");
43 if (self_ptr->flags.has(TR_BRAND_COLD))
44 self_ptr->info[self_ptr->line++] = _("あなたの武器は敵を凍らせる。", "Your weapon freezes your foes.");
46 if (self_ptr->flags.has(TR_BRAND_POIS))
47 self_ptr->info[self_ptr->line++] = _("あなたの武器は敵を毒で侵す。", "Your weapon poisons your foes.");
50 static void set_slay_info(self_info_type *self_ptr)
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.");
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.");
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.");
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.");
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.");
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.");
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.");
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.");
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.");
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.");
103 void set_weapon_effect_info(player_type *player_ptr, self_info_type *self_ptr)
105 object_type *o_ptr = &player_ptr->inventory_list[INVEN_MAIN_HAND];
106 if (o_ptr->k_idx == 0)
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.");
115 if (self_ptr->flags.has(TR_THROW))
116 self_ptr->info[self_ptr->line++] = _("あなたの武器は投げやすい。", "Your weapon can be thrown well.");