OSDN Git Service

[Refactor] #40571 Separated target-getter.c/h from targeting.c/h
[hengband/hengband.git] / src / racial / racial-draconian.c
1 #include "racial/racial-draconian.h"
2 #include "spell-kind/spells-launcher.h"
3 #include "spell/spell-types.h"
4 #include "target/target-getter.h"
5 #include "view/display-messages.h"
6
7 static void decide_breath_kind(player_type *creature_ptr, int *breath_type, concptr *breath_type_description)
8 {
9     if (randint1(100) >= creature_ptr->lev)
10         return;
11
12     switch (creature_ptr->pclass) {
13     case CLASS_WARRIOR:
14     case CLASS_BERSERKER:
15     case CLASS_RANGER:
16     case CLASS_TOURIST:
17     case CLASS_IMITATOR:
18     case CLASS_ARCHER:
19     case CLASS_SMITH:
20         if (one_in_(3)) {
21             *breath_type = GF_MISSILE;
22             *breath_type_description = _("エレメント", "the elements");
23         } else {
24             *breath_type = GF_SHARDS;
25             *breath_type_description = _("破片", "shards");
26         }
27
28         break;
29     case CLASS_MAGE:
30     case CLASS_WARRIOR_MAGE:
31     case CLASS_HIGH_MAGE:
32     case CLASS_SORCERER:
33     case CLASS_MAGIC_EATER:
34     case CLASS_RED_MAGE:
35     case CLASS_BLUE_MAGE:
36     case CLASS_MIRROR_MASTER:
37         if (one_in_(3)) {
38             *breath_type = GF_MANA;
39             *breath_type_description = _("魔力", "mana");
40         } else {
41             *breath_type = GF_DISENCHANT;
42             *breath_type_description = _("劣化", "disenchantment");
43         }
44
45         break;
46     case CLASS_CHAOS_WARRIOR:
47         if (!one_in_(3)) {
48             *breath_type = GF_CONFUSION;
49             *breath_type_description = _("混乱", "confusion");
50         } else {
51             *breath_type = GF_CHAOS;
52             *breath_type_description = _("カオス", "chaos");
53         }
54
55         break;
56     case CLASS_MONK:
57     case CLASS_SAMURAI:
58     case CLASS_FORCETRAINER:
59         if (!one_in_(3)) {
60             *breath_type = GF_CONFUSION;
61             *breath_type_description = _("混乱", "confusion");
62         } else {
63             *breath_type = GF_SOUND;
64             *breath_type_description = _("轟音", "sound");
65         }
66
67         break;
68     case CLASS_MINDCRAFTER:
69         if (!one_in_(3)) {
70             *breath_type = GF_CONFUSION;
71             *breath_type_description = _("混乱", "confusion");
72         } else {
73             *breath_type = GF_PSI;
74             *breath_type_description = _("精神エネルギー", "mental energy");
75         }
76
77         break;
78     case CLASS_PRIEST:
79     case CLASS_PALADIN:
80         if (one_in_(3)) {
81             *breath_type = GF_HELL_FIRE;
82             *breath_type_description = _("地獄の劫火", "hellfire");
83         } else {
84             *breath_type = GF_HOLY_FIRE;
85             *breath_type_description = _("聖なる炎", "holy fire");
86         }
87
88         break;
89     case CLASS_ROGUE:
90     case CLASS_NINJA:
91         if (one_in_(3)) {
92             *breath_type = GF_DARK;
93             *breath_type_description = _("暗黒", "darkness");
94         } else {
95             *breath_type = GF_POIS;
96             *breath_type_description = _("毒", "poison");
97         }
98
99         break;
100     case CLASS_BARD:
101         if (!one_in_(3)) {
102             *breath_type = GF_SOUND;
103             *breath_type_description = _("轟音", "sound");
104         } else {
105             *breath_type = GF_CONFUSION;
106             *breath_type_description = _("混乱", "confusion");
107         }
108
109         break;
110     }
111 }
112
113 bool draconian_breath(player_type *creature_ptr)
114 {
115     int breath_type = (one_in_(3) ? GF_COLD : GF_FIRE);
116     concptr breath_type_description = ((breath_type == GF_COLD) ? _("冷気", "cold") : _("炎", "fire"));
117     DIRECTION dir;
118     if (!get_aim_dir(creature_ptr, &dir))
119         return FALSE;
120
121     decide_breath_kind(creature_ptr, &breath_type, &breath_type_description);
122     stop_mouth(creature_ptr);
123     msg_format(_("あなたは%sのブレスを吐いた。", "You breathe %s."), breath_type_description);
124
125     fire_breath(creature_ptr, breath_type, dir, creature_ptr->lev * 2, (creature_ptr->lev / 15) + 1);
126     return TRUE;
127 }