3 * @brief 青魔法の処理実装 / Blue magic
6 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke\n
7 * This software may be copied and distributed for educational, research,\n
8 * and not for profit purposes provided that this copyright and statement\n
9 * are included in all such copies. Other copyrights may also apply.\n
10 * 2014 Deskull rearranged comment for Doxygen.\n
14 #include "core/stuff-handler.h"
16 #include "main/sound-definitions-table.h"
20 #include "spells-summon.h"
22 #include "spells-status.h"
23 #include "cmd-spell.h"
24 #include "player-status.h"
25 #include "monster-spell.h"
26 #include "monster-status.h"
27 #include "spell/spells-type.h"
28 #include "cmd-basic.h"
29 #include "player-effects.h"
30 #include "targeting.h"
31 #include "view/display-main-window.h"
32 #include "spell/spells2.h"
35 * @brief モンスター魔法をプレイヤーが使用する場合の換算レベル
36 * @param caster_ptr プレーヤーへの参照ポインタ
39 PLAYER_LEVEL get_pseudo_monstetr_level(player_type *caster_ptr)
41 PLAYER_LEVEL monster_level = caster_ptr->lev + 40;
42 return (monster_level * monster_level - 1550) / 130;
49 * level, smana, %fail, manedam, %manefail, use_stat, name
51 const monster_power monster_powers[MAX_MONSPELLS] =
54 { 1, 1, 10, 0, 15, A_CON, "叫ぶ"},
55 { 10, 4, 35, 89, 40, A_INT, "何か"},
56 { 40, 35, 85, 0, 40, A_INT, "魔力消去"},
57 { 35, 30, 80, 800, 70, A_STR, "ロケット"},
58 { 5, 1, 20, 18, 15, A_DEX, "射撃"},
59 { 10, 4, 35, 89, 40, A_INT, "何か"},
60 { 10, 4, 35, 89, 40, A_INT, "何か"},
61 { 10, 4, 35, 89, 40, A_INT, "何か"},
62 { 20, 15, 55, 1600, 95, A_CON, "酸のブレス"},
63 { 20, 15, 55, 1600, 95, A_CON, "電撃のブレス"},
64 { 20, 15, 55, 1600, 95, A_CON, "炎のブレス"},
65 { 20, 15, 55, 1600, 95, A_CON, "冷気のブレス"},
66 { 20, 15, 55, 800, 95, A_CON, "毒のブレス"},
67 { 20, 15, 70, 550, 95, A_CON, "地獄のブレス"},
68 { 20, 16, 70, 400, 95, A_CON, "閃光のブレス"},
69 { 20, 16, 70, 400, 95, A_CON, "暗黒のブレス"},
70 { 20, 20, 70, 450, 95, A_CON, "混乱のブレス"},
71 { 20, 20, 70, 450, 95, A_CON, "轟音のブレス"},
72 { 20, 20, 70, 600, 95, A_CON, "カオスのブレス"},
73 { 20, 16, 70, 500, 95, A_CON, "劣化のブレス"},
74 { 30, 25, 80, 250, 95, A_CON, "因果混乱のブレス"},
75 { 35, 18, 80, 150, 95, A_CON, "時間逆転のブレス"},
76 { 30, 25, 80, 200, 95, A_CON, "遅鈍のブレス"},
77 { 30, 28, 90, 200, 95, A_CON, "重力のブレス"},
78 { 20, 15, 70, 500, 95, A_CON, "破片のブレス"},
79 { 35, 15, 80, 150, 95, A_CON, "プラズマのブレス"},
80 { 30, 18, 70, 200, 95, A_CON, "フォースのブレス"},
81 { 30, 28, 80, 250, 95, A_CON, "魔力のブレス"},
82 { 25, 20, 95, 320, 80, A_INT, "放射能球"},
83 { 25, 15, 70, 800, 95, A_CON, "放射性廃棄物のブレス"},
84 { 30, 32, 85, 400, 80, A_INT, "純ログルス"},
85 { 35, 40, 95, 150, 95, A_CON, "分解のブレス"},
86 { 18, 13, 55, 630, 80, A_INT, "アシッド・ボール"},
87 { 14, 10, 45, 316, 60, A_INT, "サンダー・ボール"},
88 { 20, 14, 60, 720, 80, A_INT, "ファイア・ボール"},
89 { 15, 11, 50, 320, 60, A_INT, "アイス・ボール"},
90 { 5, 3, 40, 48, 20, A_INT, "悪臭雲"},
91 { 25, 18, 70, 350, 80, A_INT, "地獄球"},
92 { 30, 22, 75, 350, 80, A_INT, "ウォーター・ボール"},
93 { 44, 45, 85, 550, 95, A_INT, "魔力の嵐"},
94 { 40, 42, 90, 550, 95, A_INT, "暗黒の嵐"},
95 { 10, 5, 50, 0, 25, A_INT, "魔力吸収"},
96 { 25, 10, 60, 0, 30, A_INT, "精神攻撃"},
97 { 30, 14, 65, 0, 30, A_INT, "脳攻撃"},
98 { 3, 1, 25, 24, 20, A_INT, "軽傷"},
99 { 12, 2, 35, 64, 25, A_INT, "重傷"},
100 { 22, 6, 50, 150, 30, A_INT, "致命傷"},
101 { 32, 10, 70, 225, 35, A_INT, "秘孔を突く"},
102 { 13, 7, 40, 178, 40, A_INT, "アシッド・ボルト"},
103 { 10, 5, 35, 130, 35, A_INT, "サンダー・ボルト"},
104 { 15, 9, 50, 210, 45, A_INT, "ファイア・ボルト"},
105 { 12, 6, 35, 162, 40, A_INT, "アイス・ボルト"},
106 { 40, 42, 90, 550, 95, A_INT, "スター・バースト"},
107 { 25, 17, 60, 255, 60, A_INT, "地獄の矢"},
108 { 25, 20, 65, 250, 60, A_INT, "ウォーター・ボルト"},
109 { 25, 24, 90, 400, 80, A_INT, "魔力の矢"},
110 { 25, 20, 80, 216, 60, A_INT, "プラズマ・ボルト"},
111 { 25, 16, 60, 186, 60, A_INT, "極寒の矢"},
112 { 3, 1, 25, 12, 20, A_INT, "マジック・ミサイル"},
113 { 5, 3, 35, 0, 20, A_INT, "恐慌"},
114 { 10, 5, 40, 0, 20, A_INT, "盲目"},
115 { 10, 5, 40, 0, 20, A_INT, "パニック・モンスター"},
116 { 10, 5, 40, 0, 20, A_INT, "スロウ・モンスター"},
117 { 10, 5, 40, 0, 20, A_INT, "スリープ・モンスター"},
118 { 20, 10, 70, 0, 40, A_INT, "スピード"},
119 { 45, 120, 95, 0, 60, A_INT, "破滅の手"},
120 { 20, 15, 70, 0, 20, A_WIS, "体力回復"},
121 { 45, 65, 80, 0, 60, A_INT, "無傷の球"},
122 { 5, 1, 30, 0, 20, A_INT, "ショート・テレポート"},
123 { 15, 8, 40, 0, 30, A_INT, "テレポート"},
124 { 40, 999, 99, 0, 80, A_INT, "ザ・ワールド"},
125 { 1, 0, 0, 0, 15, A_INT, "何か"},
126 { 15, 8, 50, 0, 30, A_INT, "引きよせる"},
127 { 20, 13, 80, 0, 30, A_INT, "テレポート・アウェイ"},
128 { 30, 40, 95, 0, 40, A_INT, "テレポート・レベル"},
129 { 35, 30, 80, 350, 70, A_INT, "光の剣"},
130 { 5, 1, 20, 0, 15, A_INT, "暗闇"},
131 { 5, 1, 20, 0, 15, A_DEX, "トラップ創造"},
132 { 15, 3, 40, 0, 30, A_INT, "記憶喪失"},
133 { 30, 30, 70, 0, 40, A_INT, "死者復活"},
134 { 40, 70, 85, 0, 45, A_INT, "援軍を呼ぶ"},
135 { 45, 90, 90, 0, 50, A_INT, "サイバーデーモンの召喚"},
136 { 25, 20, 65, 0, 30, A_INT, "モンスターの召喚"},
137 { 35, 30, 75, 0, 40, A_INT, "複数のモンスターの召喚"},
138 { 25, 25, 65, 0, 25, A_INT, "アリの召喚"},
139 { 25, 20, 60, 0, 25, A_INT, "蜘蛛の召喚"},
140 { 35, 26, 75, 0, 40, A_INT, "ハウンドの召喚"},
141 { 30, 23, 70, 0, 35, A_INT, "ヒドラの召喚"},
142 { 40, 50, 85, 0, 40, A_INT, "天使の召喚"},
143 { 35, 50, 80, 0, 35, A_INT, "デーモンの召喚"},
144 { 30, 30, 75, 0, 35, A_INT, "アンデッドの召喚"},
145 { 39, 70, 80, 0, 40, A_INT, "ドラゴンの召喚"},
146 { 43, 85, 85, 0, 45, A_INT, "上級アンデッドの召喚"},
147 { 46, 90, 85, 0, 45, A_INT, "古代ドラゴンの召喚"},
148 { 48, 120, 90, 0, 50, A_INT, "アンバーの王族の召喚"},
149 { 50, 150, 95, 0, 50, A_INT, "ユニークモンスターの召喚"},
151 { 1, 1, 10, 0, 15, A_CON, "shriek"},
152 { 10, 4, 35, 89, 40, A_INT, "something"},
153 { 40, 35, 85, 0, 40, A_INT, "dispel-magic"},
154 { 35, 30, 80, 800, 70, A_STR, "rocket"},
155 { 2, 1, 15, 10, 15, A_DEX, "arrow"},
156 { 5, 2, 20, 18, 20, A_DEX, "arrows"},
157 { 12, 3, 25, 30, 25, A_DEX, "missile"},
158 { 16, 4, 30, 42, 30, A_DEX, "missiles"},
159 { 20, 15, 55, 1600, 95, A_CON, "breath acid"},
160 { 20, 15, 55, 1600, 95, A_CON, "breath lightning"},
161 { 20, 15, 55, 1600, 95, A_CON, "breath fire"},
162 { 20, 15, 55, 1600, 95, A_CON, "breath cold"},
163 { 20, 15, 55, 800, 95, A_CON, "breath poison"},
164 { 20, 15, 70, 550, 95, A_CON, "breath nether"},
165 { 20, 16, 70, 400, 95, A_CON, "breath light"},
166 { 20, 16, 70, 400, 95, A_CON, "breath dark"},
167 { 20, 20, 70, 450, 95, A_CON, "breath confusion"},
168 { 20, 20, 70, 450, 95, A_CON, "breath sound"},
169 { 20, 20, 70, 600, 95, A_CON, "breath chaos"},
170 { 20, 16, 70, 500, 95, A_CON, "breath disenchantment"},
171 { 30, 25, 80, 250, 95, A_CON, "breath nexus"},
172 { 35, 18, 80, 150, 95, A_CON, "breath time"},
173 { 30, 25, 80, 200, 95, A_CON, "breath inertia"},
174 { 30, 28, 90, 200, 95, A_CON, "breath gravity"},
175 { 20, 15, 70, 500, 95, A_CON, "breath shards"},
176 { 35, 15, 80, 150, 95, A_CON, "breath plasma"},
177 { 30, 18, 70, 200, 95, A_CON, "breath force"},
178 { 30, 28, 80, 250, 95, A_CON, "breath mana"},
179 { 25, 20, 95, 320, 80, A_INT, "nuke ball"},
180 { 25, 15, 70, 800, 95, A_CON, "breath nuke"},
181 { 30, 32, 85, 400, 80, A_INT, "raw Logrus"},
182 { 35, 40, 95, 150, 95, A_CON, "breath disintegrate"},
183 { 18, 13, 55, 630, 80, A_INT, "acid ball"},
184 { 14, 10, 45, 316, 60, A_INT, "lightning ball"},
185 { 20, 14, 60, 720, 80, A_INT, "fire ball"},
186 { 15, 11, 50, 320, 60, A_INT, "frost ball"},
187 { 5, 3, 40, 48, 20, A_INT, "stinking cloud"},
188 { 25, 18, 70, 350, 80, A_INT, "nether ball"},
189 { 30, 22, 75, 350, 80, A_INT, "water ball"},
190 { 44, 45, 85, 550, 95, A_INT, "mana storm"},
191 { 40, 42, 90, 550, 95, A_INT, "darkness storm"},
192 { 10, 5, 50, 0, 25, A_INT, "drain mana"},
193 { 25, 10, 60, 0, 30, A_INT, "mind blast"},
194 { 30, 14, 65, 0, 30, A_INT, "brain smash"},
195 { 3, 1, 25, 24, 20, A_INT, "cause light wounds"},
196 { 12, 2, 35, 64, 25, A_INT, "cause serious wounds"},
197 { 22, 6, 50, 150, 30, A_INT, "cause critical wounds"},
198 { 32, 10, 70, 225, 35, A_INT, "cause mortal wounds"},
199 { 13, 7, 40, 178, 40, A_INT, "acid bolt"},
200 { 10, 5, 35, 130, 35, A_INT, "lightning bolt"},
201 { 15, 9, 50, 210, 45, A_INT, "fire bolt"},
202 { 12, 6, 35, 162, 40, A_INT, "frost bolt"},
203 { 40, 42, 90, 550, 95, A_INT, "starburst"},
204 { 25, 17, 60, 255, 60, A_INT, "nether bolt"},
205 { 25, 20, 65, 250, 60, A_INT, "water bolt"},
206 { 25, 24, 90, 400, 80, A_INT, "mana bolt"},
207 { 25, 20, 80, 216, 60, A_INT, "plasma bolt"},
208 { 25, 16, 60, 186, 60, A_INT, "ice bolt"},
209 { 3, 1, 25, 12, 20, A_INT, "magic missile"},
210 { 5, 3, 35, 0, 20, A_INT, "scare"},
211 { 10, 5, 40, 0, 20, A_INT, "blind"},
212 { 10, 5, 40, 0, 20, A_INT, "confuse"},
213 { 10, 5, 40, 0, 20, A_INT, "slow"},
214 { 10, 5, 40, 0, 20, A_INT, "sleep"},
215 { 20, 10, 70, 0, 40, A_INT, "speed"},
216 { 45, 120, 95, 0, 60, A_INT, "the Hand of Doom"},
217 { 20, 15, 70, 0, 20, A_WIS, "heal-self"},
218 { 45, 65, 80, 0, 60, A_INT, "make invulnerable"},
219 { 5, 1, 30, 0, 20, A_INT, "blink-self"},
220 { 15, 8, 40, 0, 30, A_INT, "teleport-self"},
221 { 40, 999, 99, 0, 80, A_INT, "The world"},
222 { 1, 0, 0, 0, 15, A_INT, "something"},
223 { 15, 8, 50, 0, 30, A_INT, "teleport to"},
224 { 20, 13, 80, 0, 30, A_INT, "teleport away"},
225 { 30, 40, 95, 0, 40, A_INT, "teleport level"},
226 { 35, 30, 80, 350, 70, A_INT, "psycho-spear"},
227 { 5, 1, 20, 0, 15, A_INT, "create darkness"},
228 { 5, 1, 20, 0, 15, A_DEX, "create traps"},
229 { 15, 3, 40, 0, 30, A_INT, "cause amnesia"},
230 { 30, 30, 70, 0, 40, A_INT, "raise dead"},
231 { 40, 70, 85, 0, 45, A_INT, "summon aid"},
232 { 45, 90, 90, 0, 50, A_INT, "summon Cyberdemons"},
233 { 25, 20, 65, 0, 30, A_INT, "summon a monster"},
234 { 35, 30, 75, 0, 40, A_INT, "summon monsters"},
235 { 25, 25, 65, 0, 25, A_INT, "summon ants"},
236 { 25, 20, 60, 0, 25, A_INT, "summon spiders"},
237 { 35, 26, 75, 0, 40, A_INT, "summon hounds"},
238 { 30, 23, 70, 0, 35, A_INT, "summon hydras"},
239 { 40, 50, 85, 0, 40, A_INT, "summon an angel"},
240 { 35, 50, 80, 0, 35, A_INT, "summon a daemon"},
241 { 30, 30, 75, 0, 35, A_INT, "summon an undead"},
242 { 39, 70, 80, 0, 40, A_INT, "summon a dragon"},
243 { 43, 85, 85, 0, 45, A_INT, "summon Greater Undead"},
244 { 46, 90, 85, 0, 45, A_INT, "summon Ancient Dragon"},
245 { 48, 120, 90, 0, 50, A_INT, "summon Lords of Amber"},
246 { 50, 150, 95, 0, 50, A_INT, "summon Unique Monsters"},
253 * @brief モンスター魔法名テーブル
255 const concptr monster_powers_short[MAX_MONSPELLS] = {
258 "叫ぶ", "何か", "魔力消去", "ロケット", "射撃", "何か", "何か", "何か",
259 "酸", "電撃", "火炎", "冷気", "毒", "地獄", "閃光", "暗黒",
260 "混乱", "轟音", "カオス", "劣化", "因果混乱", "時間逆転", "遅鈍", "重力",
261 "破片", "プラズマ", "フォース", "魔力", "放射能球", "放射性廃棄物", "純ログルス", "分解",
263 "酸", "電撃", "火炎", "冷気", "悪臭雲", "地獄球", "ウォーター", "魔力の嵐",
264 "暗黒の嵐", "魔力吸収", "精神攻撃", "脳攻撃", "軽傷", "重傷", "致命傷", "秘孔を突く",
265 "酸", "電撃", "火炎", "冷気", "スターバースト", "地獄の矢", "ウォーター", "魔力の矢",
266 "プラズマ", "極寒", "マジックミサイル", "恐慌", "盲目", "混乱", "減速", "睡眠",
268 "加速", "破滅の手", "体力回復", "無傷の球", "ショートテレポート", "テレポート", "時を止める", "何か",
269 "引きよせる", "テレポートアウェイ", "テレポートレベル", "光の剣", "暗闇", "トラップ創造", "記憶喪失", "死者復活",
270 "援軍", "サイバーデーモン", "モンスター", "複数のモンスター", "蟻", "蜘蛛", "ハウンド", "ヒドラ",
271 "天使", "悪魔", "アンデッド", "ドラゴン", "上級アンデッド", "古代ドラゴン", "アンバーの王族", "ユニーク"
275 "Shriek", "Something", "Dispel-magic", "Rocket", "Arrow", "Arrows", "Missile", "Missiles",
276 "Acid", "Lightning", "Fire", "Cold", "Poison", "Nether", "Light", "Dark",
277 "Confusion", "Sound", "Chaos", "Disenchantment", "Nexus", "Time", "Inertia", "Gravity",
278 "Shards", "Plasma", "Force", "Mana", "Nuke", "Nuke", "Logrus", "Disintergrate",
280 "Acid", "Lightning", "Fire", "Frost", "Stinking Cloud", "Nether", "Water", "Mana storm",
281 "Darkness storm", "Drain mana", "Mind blast", "Brain smash", "Cause Light Wound", "Cause Serious Wound", "Cause Critical Wound", "Cause Mortal Wound",
282 "Acid", "Lightning", "Fire", "Frost", "Starburst", "Nether", "Water", "Mana",
283 "Plasm", "Ice", "Magic missile", "Scare", "Blind", "Confuse", "Slow", "Sleep",
285 "Speed", "Hand of doom", "Heal-self", "Invulnerable", "Blink", "Teleport", "The world", "Something",
286 "Teleport to", "Teleport away", "Teleport level", "Psycho-spear", "Create darkness", "Create traps", "Amnesia", "Raise dead",
287 "Aid", "Cyberdeamons", "A monster", "Monsters", "Ants", "Spiders", "Hounds", "Hydras",
288 "Angel", "Daemon", "Undead", "Dragon", "Greater Undead", "Ancient Dragon", "Lords of Amber", "Unique monsters"
295 * @brief 文字列に青魔導師の呪文の攻撃力を加える
296 * @param SPELL_NUM 呪文番号
297 * @param plev プレイヤーレベル
299 * @param tmp 返すメッセージを格納する配列
302 void set_bluemage_damage(player_type *learner_type, int SPELL_NUM, PLAYER_LEVEL plev, concptr msg, char* tmp)
304 int base_damage = monspell_bluemage_damage(learner_type, SPELL_NUM, plev, BASE_DAM);
305 int dice_num = monspell_bluemage_damage(learner_type, SPELL_NUM, plev, DICE_NUM);
306 int dice_side = monspell_bluemage_damage(learner_type, SPELL_NUM, plev, DICE_SIDE);
307 int dice_mult = monspell_bluemage_damage(learner_type, SPELL_NUM, plev, DICE_MULT);
308 int dice_div = monspell_bluemage_damage(learner_type, SPELL_NUM, plev, DICE_DIV);
310 dice_to_string(base_damage, dice_num, dice_side, dice_mult, dice_div, dmg_str);
311 sprintf(tmp, " %s %s", msg, dmg_str);
316 * @brief 受け取ったモンスター魔法のIDに応じて青魔法の効果情報をまとめたフォーマットを返す
317 * @param learner_ptr プレーヤーへの参照ポインタ
318 * @param p 情報を返す文字列参照ポインタ
319 * @param power モンスター魔法のID
322 static void learned_info(player_type *learner_ptr, char *p, int power)
324 PLAYER_LEVEL plev = get_pseudo_monstetr_level(learner_ptr);
369 set_bluemage_damage(learner_ptr, power, plev, KWD_DAM, p); break;
405 set_bluemage_damage(learner_ptr, power, plev, KWD_DAM, p); break;
407 set_bluemage_damage(learner_ptr, power, plev, KWD_HEAL, p); break;
423 case MS_MAGIC_MISSILE:
424 set_bluemage_damage(learner_ptr, power, plev, KWD_DAM, p); break;
426 sprintf(p, " %sd%d+%d", KWD_DURATION, 20+plev, plev);
429 set_bluemage_damage(learner_ptr, power, plev, KWD_HEAL, p); break;
431 sprintf(p, " %sd7+7", KWD_DURATION);
434 sprintf(p, " %s10", KWD_SPHERE);
437 sprintf(p, " %s%d", KWD_SPHERE, plev * 5);
440 set_bluemage_damage(learner_ptr, power, plev, KWD_DAM, p); break;
443 sprintf(p, " %s5", KWD_SPHERE);
452 * @brief 使用可能な青魔法を選択する /
453 * Allow user to choose a imitation.
454 * @param caster_ptr プレーヤーへの参照ポインタ
455 * @param sn 選択したモンスター攻撃ID、キャンセルの場合-1、不正な選択の場合-2を返す
456 * @return 発動可能な魔法を選択した場合TRUE、キャンセル処理か不正な選択が行われた場合FALSEを返す。
458 * If a valid spell is chosen, saves it in '*sn' and returns TRUE\n
459 * If the user hits escape, returns FALSE, and set '*sn' to -1\n
460 * If there are no legal choices, returns FALSE, and sets '*sn' to -2\n
462 * The "prompt" should be "cast", "recite", or "study"\n
463 * The "known" should be TRUE for cast/pray, FALSE for study\n
465 * nb: This function has a (trivial) display bug which will be obvious\n
466 * when you run it. It's probably easy to fix but I haven't tried,\n
469 static bool get_learned_power(player_type *caster_ptr, SPELL_IDX *sn)
475 PERCENTAGE minfail = 0;
476 PLAYER_LEVEL plev = caster_ptr->lev;
477 PERCENTAGE chance = 0;
478 int ask = TRUE, mode = 0;
479 int spellnum[MAX_MONSPELLS];
484 BIT_FLAGS f4 = 0L, f5 = 0L, f6 = 0L;
485 concptr p = _("魔法", "magic");
489 int menu_line = (use_menu ? 1 : 0);
491 /* Assume cancelled */
497 /* Get the spell, if available */
499 if (repeat_pull(&code))
501 *sn = (SPELL_IDX)code;
511 prt(format(_(" %s ボルト", " %s bolt"), (menu_line == 1) ? _("》", "> ") : " "), 2, 14);
512 prt(format(_(" %s ボール", " %s ball"), (menu_line == 2) ? _("》", "> ") : " "), 3, 14);
513 prt(format(_(" %s ブレス", " %s breath"), (menu_line == 3) ? _("》", "> ") : " "), 4, 14);
514 prt(format(_(" %s 召喚", " %s sommoning"), (menu_line == 4) ? _("》", "> ") : " "), 5, 14);
515 prt(format(_(" %s その他", " %s others"), (menu_line == 5) ? _("》", "> ") : " "), 6, 14);
516 prt(_("どの種類の魔法を使いますか?", "use which type of magic? "), 0, 0);
542 if (menu_line > 5) menu_line -= 5;
548 sprintf(comment, _("[A]ボルト, [B]ボール, [C]ブレス, [D]召喚, [E]その他:", "[A] bolt, [B] ball, [C] breath, [D] summoning, [E] others:"));
551 if (!get_com(comment, &ch, TRUE))
555 if (ch == 'A' || ch == 'a')
560 if (ch == 'B' || ch == 'b')
565 if (ch == 'C' || ch == 'c')
570 if (ch == 'D' || ch == 'd')
575 if (ch == 'E' || ch == 'e')
583 set_rf_masks(&f4, &f5, &f6, mode);
585 for (i = 0, num = 0; i < 32; i++)
587 if ((0x00000001 << i) & f4) spellnum[num++] = i;
591 if ((0x00000001 << (i - 32)) & f5) spellnum[num++] = i;
595 if ((0x00000001 << (i - 64)) & f6) spellnum[num++] = i;
597 for (i = 0; i < num; i++)
599 if (caster_ptr->magic_num2[spellnum[i]])
601 if (use_menu) menu_line = i+1;
607 msg_print(_("その種類の魔法は覚えていない!", "You don't know any spell of this type."));
611 /* Build a prompt (accept all spells) */
612 (void)strnfmt(out_val, 78, _("(%c-%c, '*'で一覧, ESC) どの%sを唱えますか?", "(%c-%c, *=List, ESC=exit) Use which %s? "),
613 I2A(0), I2A(num - 1), p);
615 if (use_menu) screen_save();
617 choice= (always_show_list || use_menu) ? ESCAPE:1 ;
620 if(choice==ESCAPE) choice = ' ';
621 else if( !get_com(out_val, &choice, TRUE) )break;
623 if (use_menu && choice != ' ')
639 menu_line += (num-1);
640 if (menu_line > num) menu_line -= num;
641 } while(!caster_ptr->magic_num2[spellnum[menu_line-1]]);
652 if (menu_line > num) menu_line -= num;
653 } while(!caster_ptr->magic_num2[spellnum[menu_line-1]]);
662 while(!caster_ptr->magic_num2[spellnum[menu_line-1]]) menu_line--;
671 while(!caster_ptr->magic_num2[spellnum[menu_line-1]]) menu_line++;
686 if ((choice == ' ') || (choice == '*') || (choice == '?') || (use_menu && ask))
689 if (!redraw || use_menu)
693 if (!use_menu) screen_save();
695 /* Display a list of spells */
697 put_str(_("名前", "Name"), y, x + 5);
698 put_str(_("MP 失率 効果", "SP Fail Info"), y, x + 33);
701 /* Dump the spells */
702 for (i = 0; i < num; i++)
706 prt("", y + i + 1, x);
707 if (!caster_ptr->magic_num2[spellnum[i]]) continue;
709 /* Access the spell */
710 spell = monster_powers[spellnum[i]];
714 /* Reduce failure rate by "effective" level adjustment */
715 if (plev > spell.level) chance -= 3 * (plev - spell.level);
716 else chance += (spell.level - plev);
718 /* Reduce failure rate by INT/WIS adjustment */
719 chance -= 3 * (adj_mag_stat[caster_ptr->stat_ind[A_INT]] - 1);
721 chance = mod_spell_chance_1(caster_ptr, chance);
723 need_mana = mod_need_mana(caster_ptr, monster_powers[spellnum[i]].smana, 0, REALM_NONE);
725 /* Not enough mana to cast */
726 if (need_mana > caster_ptr->csp)
728 chance += 5 * (need_mana - caster_ptr->csp);
731 /* Extract the minimum failure rate */
732 minfail = adj_mag_fail[caster_ptr->stat_ind[A_INT]];
734 /* Minimum failure rate */
735 if (chance < minfail) chance = minfail;
737 /* Stunning makes spells harder */
738 if (caster_ptr->stun > 50) chance += 25;
739 else if (caster_ptr->stun) chance += 15;
741 /* Always a 5 percent chance of working */
742 if (chance > 95) chance = 95;
744 chance = mod_spell_chance_2(caster_ptr, chance);
747 learned_info(caster_ptr, comment, spellnum[i]);
751 if (i == (menu_line-1)) strcpy(psi_desc, _(" 》", " > "));
752 else strcpy(psi_desc, " ");
754 else sprintf(psi_desc, " %c)", I2A(i));
756 /* Dump the spell --(-- */
757 strcat(psi_desc, format(" %-26s %3d %3d%%%s",
758 spell.name, need_mana,
760 prt(psi_desc, y + i + 1, x);
763 /* Clear the bottom line */
764 if (y < 22) prt("", y + i + 1, x);
782 ask = isupper(choice);
785 if (ask) choice = (char)tolower(choice);
787 /* Extract request */
788 i = (islower(choice) ? A2I(choice) : -1);
791 /* Totally Illegal */
792 if ((i < 0) || (i >= num) || !caster_ptr->magic_num2[spellnum[i]])
798 /* Save the spell index */
799 spell = monster_powers[spellnum[i]];
807 (void) strnfmt(tmp_val, 78, _("%sの魔法を唱えますか?", "Use %s? "), monster_powers[spellnum[i]].name);
809 /* Belay that order */
810 if (!get_check(tmp_val)) continue;
817 if (redraw) screen_load();
819 caster_ptr->window |= (PW_SPELL);
820 handle_stuff(caster_ptr);
822 /* Abort if needed */
823 if (!flag) return FALSE;
825 /* Save the choice */
828 repeat_push((COMMAND_CODE)spellnum[i]);
837 * do_cmd_cast calls this function if the player's class is 'blue-mage'.
838 * @param spell 発動するモンスター攻撃のID
839 * @param success TRUEは成功時、FALSEは失敗時の処理を行う
840 * @return 処理を実行したらTRUE、キャンセルした場合FALSEを返す。
842 static bool cast_learned_spell(player_type *caster_ptr, int spell, bool success)
845 PLAYER_LEVEL plev = get_pseudo_monstetr_level(caster_ptr);
846 PLAYER_LEVEL summon_lev = caster_ptr->lev * 2 / 3 + randint1(caster_ptr->lev/2);
847 HIT_POINT damage = 0;
849 bool no_trump = FALSE;
850 BIT_FLAGS p_mode, u_mode = 0L, g_mode;
854 p_mode = PM_FORCE_PET;
860 g_mode = PM_ALLOW_GROUP;
863 if (!success || (randint1(50+plev) < plev/10)) u_mode = PM_ALLOW_UNIQUE;
866 floor_type *floor_ptr = caster_ptr->current_floor_ptr;
870 msg_print(_("かん高い金切り声をあげた。", "You make a high pitched shriek."));
871 aggravate_monsters(caster_ptr, 0);
879 if (!target_set(caster_ptr, TARGET_KILL)) return FALSE;
880 m_idx = floor_ptr->grid_array[target_row][target_col].m_idx;
882 if (!player_has_los_bold(caster_ptr, target_row, target_col)) break;
883 if (!projectable(caster_ptr, caster_ptr->y, caster_ptr->x, target_row, target_col)) break;
884 dispel_monster_status(caster_ptr, m_idx);
888 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
890 msg_print(_("ロケットを発射した。", "You fire a rocket."));
891 damage = monspell_bluemage_damage(caster_ptr, (MS_ROCKET), plev, DAM_ROLL);
892 fire_rocket(caster_ptr, GF_ROCKET, dir, damage, 2);
896 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
898 msg_print(_("矢を放った。", "You fire an arrow."));
899 damage = monspell_bluemage_damage(caster_ptr, (MS_SHOOT), plev, DAM_ROLL);
900 fire_bolt(caster_ptr, GF_ARROW, dir, damage);
910 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
912 msg_print(_("酸のブレスを吐いた。", "You breathe acid."));
913 damage = monspell_bluemage_damage(caster_ptr, (MS_BR_ACID), plev, DAM_ROLL);
914 fire_breath(caster_ptr, GF_ACID, dir, damage, (plev > 40 ? 3 : 2));
917 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
919 msg_print(_("稲妻のブレスを吐いた。", "You breathe lightning."));
920 damage = monspell_bluemage_damage(caster_ptr, (MS_BR_ELEC), plev, DAM_ROLL);
921 fire_breath(caster_ptr, GF_ELEC, dir, damage, (plev > 40 ? 3 : 2));
924 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
926 msg_print(_("火炎のブレスを吐いた。", "You breathe fire."));
927 damage = monspell_bluemage_damage(caster_ptr, (MS_BR_FIRE), plev, DAM_ROLL);
928 fire_breath(caster_ptr, GF_FIRE, dir, damage, (plev > 40 ? 3 : 2));
931 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
933 msg_print(_("冷気のブレスを吐いた。", "You breathe frost."));
934 damage = monspell_bluemage_damage(caster_ptr, (MS_BR_COLD), plev, DAM_ROLL);
935 fire_breath(caster_ptr, GF_COLD, dir, damage, (plev > 40 ? 3 : 2));
938 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
940 msg_print(_("ガスのブレスを吐いた。", "You breathe gas."));
941 damage = monspell_bluemage_damage(caster_ptr, (MS_BR_POIS), plev, DAM_ROLL);
942 fire_breath(caster_ptr, GF_POIS, dir, damage, (plev > 40 ? 3 : 2));
945 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
947 msg_print(_("地獄のブレスを吐いた。", "You breathe nether."));
948 damage = monspell_bluemage_damage(caster_ptr, (MS_BR_NETHER), plev, DAM_ROLL);
949 fire_breath(caster_ptr, GF_NETHER, dir, damage, (plev > 40 ? 3 : 2));
952 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
954 msg_print(_("閃光のブレスを吐いた。", "You breathe light."));
955 damage = monspell_bluemage_damage(caster_ptr, (MS_BR_LITE), plev, DAM_ROLL);
956 fire_breath(caster_ptr, GF_LITE, dir, damage, (plev > 40 ? 3 : 2));
959 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
961 msg_print(_("暗黒のブレスを吐いた。", "You breathe darkness."));
962 damage = monspell_bluemage_damage(caster_ptr, (MS_BR_DARK), plev, DAM_ROLL);
963 fire_breath(caster_ptr, GF_DARK, dir, damage, (plev > 40 ? 3 : 2));
966 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
968 msg_print(_("混乱のブレスを吐いた。", "You breathe confusion."));
969 damage = monspell_bluemage_damage(caster_ptr, (MS_BR_CONF), plev, DAM_ROLL);
970 fire_breath(caster_ptr, GF_CONFUSION, dir, damage, (plev > 40 ? 3 : 2));
973 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
975 msg_print(_("轟音のブレスを吐いた。", "You breathe sound."));
976 damage = monspell_bluemage_damage(caster_ptr, (MS_BR_SOUND), plev, DAM_ROLL);
977 fire_breath(caster_ptr, GF_SOUND, dir, damage, (plev > 40 ? 3 : 2));
980 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
982 msg_print(_("カオスのブレスを吐いた。", "You breathe chaos."));
983 damage = monspell_bluemage_damage(caster_ptr, (MS_BR_CHAOS), plev, DAM_ROLL);
984 fire_breath(caster_ptr, GF_CHAOS, dir, damage, (plev > 40 ? 3 : 2));
987 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
989 msg_print(_("劣化のブレスを吐いた。", "You breathe disenchantment."));
990 damage = monspell_bluemage_damage(caster_ptr, (MS_BR_DISEN), plev, DAM_ROLL);
991 fire_breath(caster_ptr, GF_DISENCHANT, dir, damage, (plev > 40 ? 3 : 2));
994 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
996 msg_print(_("因果混乱のブレスを吐いた。", "You breathe nexus."));
997 damage = monspell_bluemage_damage(caster_ptr, (MS_BR_NEXUS), plev, DAM_ROLL);
998 fire_breath(caster_ptr, GF_NEXUS, dir, damage, (plev > 40 ? 3 : 2));
1001 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1003 msg_print(_("時間逆転のブレスを吐いた。", "You breathe time."));
1004 damage = monspell_bluemage_damage(caster_ptr, (MS_BR_TIME), plev, DAM_ROLL);
1005 fire_breath(caster_ptr, GF_TIME, dir, damage, (plev > 40 ? 3 : 2));
1008 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1010 msg_print(_("遅鈍のブレスを吐いた。", "You breathe inertia."));
1011 damage = monspell_bluemage_damage(caster_ptr, (MS_BR_INERTIA), plev, DAM_ROLL);
1012 fire_breath(caster_ptr, GF_INERTIAL, dir, damage, (plev > 40 ? 3 : 2));
1015 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1017 msg_print(_("重力のブレスを吐いた。", "You breathe gravity."));
1018 damage = monspell_bluemage_damage(caster_ptr, (MS_BR_GRAVITY), plev, DAM_ROLL);
1019 fire_breath(caster_ptr, GF_GRAVITY, dir, damage, (plev > 40 ? 3 : 2));
1022 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1024 msg_print(_("破片のブレスを吐いた。", "You breathe shards."));
1025 damage = monspell_bluemage_damage(caster_ptr, (MS_BR_SHARDS), plev, DAM_ROLL);
1026 fire_breath(caster_ptr, GF_SHARDS, dir, damage, (plev > 40 ? 3 : 2));
1029 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1031 msg_print(_("プラズマのブレスを吐いた。", "You breathe plasma."));
1032 damage = monspell_bluemage_damage(caster_ptr, (MS_BR_PLASMA), plev, DAM_ROLL);
1033 fire_breath(caster_ptr, GF_PLASMA, dir, damage, (plev > 40 ? 3 : 2));
1036 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1038 msg_print(_("フォースのブレスを吐いた。", "You breathe force."));
1039 damage = monspell_bluemage_damage(caster_ptr, (MS_BR_FORCE), plev, DAM_ROLL);
1040 fire_breath(caster_ptr, GF_FORCE, dir, damage, (plev > 40 ? 3 : 2));
1043 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1045 msg_print(_("魔力のブレスを吐いた。", "You breathe mana."));
1046 damage = monspell_bluemage_damage(caster_ptr, (MS_BR_MANA), plev, DAM_ROLL);
1047 fire_breath(caster_ptr, GF_MANA, dir, damage, (plev > 40 ? 3 : 2));
1050 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1052 msg_print(_("放射能球を放った。", "You cast a ball of radiation."));
1053 damage = monspell_bluemage_damage(caster_ptr, (MS_BALL_NUKE), plev, DAM_ROLL);
1054 fire_ball(caster_ptr, GF_NUKE, dir, damage, 2);
1057 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1059 msg_print(_("放射性廃棄物のブレスを吐いた。", "You breathe toxic waste."));
1060 damage = monspell_bluemage_damage(caster_ptr, (MS_BR_NUKE), plev, DAM_ROLL);
1061 fire_breath(caster_ptr, GF_NUKE, dir, damage, (plev > 40 ? 3 : 2));
1064 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1066 msg_print(_("純ログルスを放った。", "You invoke a raw Logrus."));
1067 damage = monspell_bluemage_damage(caster_ptr, (MS_BALL_CHAOS), plev, DAM_ROLL);
1068 fire_ball(caster_ptr, GF_CHAOS, dir, damage, 4);
1071 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1073 msg_print(_("分解のブレスを吐いた。", "You breathe disintegration."));
1074 damage = monspell_bluemage_damage(caster_ptr, (MS_BR_DISI), plev, DAM_ROLL);
1075 fire_breath(caster_ptr, GF_DISINTEGRATE, dir, damage, (plev > 40 ? 3 : 2));
1078 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1080 msg_print(_("アシッド・ボールの呪文を唱えた。", "You cast an acid ball."));
1081 damage = monspell_bluemage_damage(caster_ptr, (MS_BALL_ACID), plev, DAM_ROLL);
1082 fire_ball(caster_ptr, GF_ACID, dir, damage, 2);
1085 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1087 msg_print(_("サンダー・ボールの呪文を唱えた。", "You cast a lightning ball."));
1088 damage = monspell_bluemage_damage(caster_ptr, (MS_BALL_ELEC), plev, DAM_ROLL);
1089 fire_ball(caster_ptr, GF_ELEC, dir, damage, 2);
1092 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1094 msg_print(_("ファイア・ボールの呪文を唱えた。", "You cast a fire ball."));
1095 damage = monspell_bluemage_damage(caster_ptr, (MS_BALL_FIRE), plev, DAM_ROLL);
1096 fire_ball(caster_ptr, GF_FIRE, dir, damage, 2);
1099 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1101 msg_print(_("アイス・ボールの呪文を唱えた。", "You cast a frost ball."));
1102 damage = monspell_bluemage_damage(caster_ptr, (MS_BALL_COLD), plev, DAM_ROLL);
1103 fire_ball(caster_ptr, GF_COLD, dir, damage, 2);
1106 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1108 msg_print(_("悪臭雲の呪文を唱えた。", "You cast a stinking cloud."));
1109 damage = monspell_bluemage_damage(caster_ptr, (MS_BALL_POIS), plev, DAM_ROLL);
1110 fire_ball(caster_ptr, GF_POIS, dir, damage, 2);
1112 case MS_BALL_NETHER:
1113 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1115 msg_print(_("地獄球の呪文を唱えた。", "You cast a nether ball."));
1116 damage = monspell_bluemage_damage(caster_ptr, (MS_BALL_NETHER), plev, DAM_ROLL);
1117 fire_ball(caster_ptr, GF_NETHER, dir, damage, 2);
1120 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1122 msg_print(_("流れるような身振りをした。", "You gesture fluidly."));
1123 damage = monspell_bluemage_damage(caster_ptr, (MS_BALL_WATER), plev, DAM_ROLL);
1124 fire_ball(caster_ptr, GF_WATER, dir, damage, 4);
1127 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1129 msg_print(_("魔力の嵐の呪文を念じた。", "You invoke a mana storm."));
1130 damage = monspell_bluemage_damage(caster_ptr, (MS_BALL_MANA), plev, DAM_ROLL);
1131 fire_ball(caster_ptr, GF_MANA, dir, damage, 4);
1134 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1136 msg_print(_("暗黒の嵐の呪文を念じた。", "You invoke a darkness storm."));
1137 damage = monspell_bluemage_damage(caster_ptr, (MS_BALL_DARK), plev, DAM_ROLL);
1138 fire_ball(caster_ptr, GF_DARK, dir, damage, 4);
1141 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1143 damage = monspell_bluemage_damage(caster_ptr, (MS_DRAIN_MANA), plev, DAM_ROLL);
1144 fire_ball_hide(caster_ptr, GF_DRAIN_MANA, dir, damage, 0);
1147 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1149 damage = monspell_bluemage_damage(caster_ptr, (MS_MIND_BLAST), plev, DAM_ROLL);
1150 fire_ball_hide(caster_ptr, GF_MIND_BLAST, dir, damage, 0);
1152 case MS_BRAIN_SMASH:
1153 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1155 damage = monspell_bluemage_damage(caster_ptr, (MS_BRAIN_SMASH), plev, DAM_ROLL);
1156 fire_ball_hide(caster_ptr, GF_BRAIN_SMASH, dir, damage, 0);
1159 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1161 damage = monspell_bluemage_damage(caster_ptr, (MS_CAUSE_1), plev, DAM_ROLL);
1162 fire_ball_hide(caster_ptr, GF_CAUSE_1, dir, damage, 0);
1165 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1167 damage = monspell_bluemage_damage(caster_ptr, (MS_CAUSE_2), plev, DAM_ROLL);
1168 fire_ball_hide(caster_ptr, GF_CAUSE_2, dir, damage, 0);
1171 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1173 damage = monspell_bluemage_damage(caster_ptr, (MS_CAUSE_3), plev, DAM_ROLL);
1174 fire_ball_hide(caster_ptr, GF_CAUSE_3, dir, damage, 0);
1177 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1179 damage = monspell_bluemage_damage(caster_ptr, (MS_CAUSE_4), plev, DAM_ROLL);
1180 fire_ball_hide(caster_ptr, GF_CAUSE_4, dir, damage, 0);
1183 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1185 msg_print(_("アシッド・ボルトの呪文を唱えた。", "You cast an acid bolt."));
1186 damage = monspell_bluemage_damage(caster_ptr, (MS_BOLT_ACID), plev, DAM_ROLL);
1187 fire_bolt(caster_ptr, GF_ACID, dir, damage);
1190 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1192 msg_print(_("サンダー・ボルトの呪文を唱えた。", "You cast a lightning bolt."));
1193 damage = monspell_bluemage_damage(caster_ptr, (MS_BOLT_ELEC), plev, DAM_ROLL);
1194 fire_bolt(caster_ptr, GF_ELEC, dir, damage);
1197 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1199 msg_print(_("ファイア・ボルトの呪文を唱えた。", "You cast a fire bolt."));
1200 damage = monspell_bluemage_damage(caster_ptr, (MS_BOLT_FIRE), plev, DAM_ROLL);
1201 fire_bolt(caster_ptr, GF_FIRE, dir, damage);
1204 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1206 msg_print(_("アイス・ボルトの呪文を唱えた。", "You cast a frost bolt."));
1207 damage = monspell_bluemage_damage(caster_ptr, (MS_BOLT_COLD), plev, DAM_ROLL);
1208 fire_bolt(caster_ptr, GF_COLD, dir, damage);
1211 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1213 msg_print(_("スターバーストの呪文を念じた。", "You invoke a starburst."));
1214 damage = monspell_bluemage_damage(caster_ptr, (MS_STARBURST), plev, DAM_ROLL);
1215 fire_ball(caster_ptr, GF_LITE, dir, damage, 4);
1217 case MS_BOLT_NETHER:
1218 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1220 msg_print(_("地獄の矢の呪文を唱えた。", "You cast a nether bolt."));
1221 damage = monspell_bluemage_damage(caster_ptr, (MS_BOLT_NETHER), plev, DAM_ROLL);
1222 fire_bolt(caster_ptr, GF_NETHER, dir, damage);
1225 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1227 msg_print(_("ウォーター・ボルトの呪文を唱えた。", "You cast a water bolt."));
1228 damage = monspell_bluemage_damage(caster_ptr, (MS_BOLT_WATER), plev, DAM_ROLL);
1229 fire_bolt(caster_ptr, GF_WATER, dir, damage);
1232 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1234 msg_print(_("魔力の矢の呪文を唱えた。", "You cast a mana bolt."));
1235 damage = monspell_bluemage_damage(caster_ptr, (MS_BOLT_MANA), plev, DAM_ROLL);
1236 fire_bolt(caster_ptr, GF_MANA, dir, damage);
1238 case MS_BOLT_PLASMA:
1239 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1241 msg_print(_("プラズマ・ボルトの呪文を唱えた。", "You cast a plasma bolt."));
1242 damage = monspell_bluemage_damage(caster_ptr, (MS_BOLT_PLASMA), plev, DAM_ROLL);
1243 fire_bolt(caster_ptr, GF_PLASMA, dir, damage);
1246 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1248 msg_print(_("極寒の矢の呪文を唱えた。", "You cast a ice bolt."));
1249 damage = monspell_bluemage_damage(caster_ptr, (MS_BOLT_ICE), plev, DAM_ROLL);
1250 fire_bolt(caster_ptr, GF_ICE, dir, damage);
1252 case MS_MAGIC_MISSILE:
1253 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1255 msg_print(_("マジック・ミサイルの呪文を唱えた。", "You cast a magic missile."));
1256 damage = monspell_bluemage_damage(caster_ptr, (MS_MAGIC_MISSILE), plev, DAM_ROLL);
1257 fire_bolt(caster_ptr, GF_MISSILE, dir, damage);
1260 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1262 msg_print(_("恐ろしげな幻覚を作り出した。", "You cast a fearful illusion."));
1263 fear_monster(caster_ptr, dir, plev+10);
1266 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1267 confuse_monster(caster_ptr, dir, plev * 2);
1270 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1272 msg_print(_("誘惑的な幻覚をつくり出した。", "You cast a mesmerizing illusion."));
1273 confuse_monster(caster_ptr, dir, plev * 2);
1276 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1277 slow_monster(caster_ptr, dir, plev);
1280 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1281 sleep_monster(caster_ptr, dir, plev);
1284 (void)set_fast(caster_ptr, randint1(20 + plev) + plev, FALSE);
1288 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1290 msg_print(_("<破滅の手>を放った!", "You invoke the Hand of Doom!"));
1291 fire_ball_hide(caster_ptr, GF_HAND_DOOM, dir, plev * 3, 0);
1295 msg_print(_("自分の傷に念を集中した。", "You concentrate on your wounds!"));
1296 (void)hp_player(caster_ptr, plev*4);
1297 (void)set_stun(caster_ptr, 0);
1298 (void)set_cut(caster_ptr,0);
1301 msg_print(_("無傷の球の呪文を唱えた。", "You cast a Globe of Invulnerability."));
1302 (void)set_invuln(caster_ptr, randint1(4) + 4, FALSE);
1305 teleport_player(caster_ptr, 10, TELEPORT_SPONTANEOUS);
1308 teleport_player(caster_ptr, plev * 5, TELEPORT_SPONTANEOUS);
1311 (void)time_walk(caster_ptr);
1317 monster_type *m_ptr;
1318 monster_race *r_ptr;
1319 GAME_TEXT m_name[MAX_NLEN];
1321 if (!target_set(caster_ptr, TARGET_KILL)) return FALSE;
1322 if (!floor_ptr->grid_array[target_row][target_col].m_idx) break;
1323 if (!player_has_los_bold(caster_ptr, target_row, target_col)) break;
1324 if (!projectable(caster_ptr, caster_ptr->y, caster_ptr->x, target_row, target_col)) break;
1325 m_ptr = &floor_ptr->m_list[floor_ptr->grid_array[target_row][target_col].m_idx];
1326 r_ptr = &r_info[m_ptr->r_idx];
1327 monster_desc(caster_ptr, m_name, m_ptr, 0);
1328 if (r_ptr->flagsr & RFR_RES_TELE)
1330 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
1332 if (is_original_ap_and_seen(caster_ptr, m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
1333 msg_format(_("%sには効果がなかった!", "%s is unaffected!"), m_name);
1336 else if (r_ptr->level > randint1(100))
1338 if (is_original_ap_and_seen(caster_ptr, m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
1339 msg_format(_("%sには耐性がある!", "%s resists!"), m_name);
1344 msg_format(_("%sを引き戻した。", "You command %s to return."), m_name);
1345 teleport_monster_to(caster_ptr, floor_ptr->grid_array[target_row][target_col].m_idx, caster_ptr->y, caster_ptr->x, 100, TELEPORT_PASSIVE);
1349 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1351 (void)fire_beam(caster_ptr, GF_AWAY_ALL, dir, 100);
1355 return teleport_level_other(caster_ptr);
1359 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1361 msg_print(_("光の剣を放った。", "You throw a psycho-spear."));
1362 damage = monspell_bluemage_damage(caster_ptr, (MS_PSY_SPEAR), plev, DAM_ROLL);
1363 (void)fire_beam(caster_ptr, GF_PSY_SPEAR, dir, damage);
1367 msg_print(_("暗闇の中で手を振った。", "You gesture in shadow."));
1368 (void)unlite_area(caster_ptr, 10, 3);
1371 if (!target_set(caster_ptr, TARGET_KILL)) return FALSE;
1373 msg_print(_("呪文を唱えて邪悪に微笑んだ。", "You cast a spell and cackle evilly."));
1374 trap_creation(caster_ptr, target_row, target_col);
1377 msg_print(_("しかし何も起きなかった。", "Nothing happen."));
1380 msg_print(_("死者復活の呪文を唱えた。", "You animate the dead."));
1381 (void)animate_dead(caster_ptr, 0, caster_ptr->y, caster_ptr->x);
1385 msg_print(_("援軍を召喚した。", "You summon one of your kin."));
1386 for (int k = 0;k < 1; k++)
1388 if (summon_kin_player(caster_ptr, summon_lev, caster_ptr->y, caster_ptr->x, (pet ? PM_FORCE_PET : 0L)))
1390 if (!pet) msg_print(_("召喚された仲間は怒っている!", "The summoned companion is angry!"));
1402 msg_print(_("サイバーデーモンを召喚した!", "You summon a Cyberdemon!"));
1403 for (int k = 0; k < 1; k++)
1405 if (summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_CYBER, p_mode))
1408 msg_print(_("召喚されたサイバーデーモンは怒っている!", "The summoned Cyberdemon are angry!"));
1419 msg_print(_("仲間を召喚した。", "You summon help."));
1420 for (int k = 0; k < 1; k++)
1422 if (summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, 0, p_mode))
1425 msg_print(_("召喚されたモンスターは怒っている!", "The summoned monster is angry!"));
1437 msg_print(_("モンスターを召喚した!", "You summon monsters!"));
1438 for (int k = 0; k < plev / 15 + 2; k++)
1440 if (summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, 0, (p_mode | u_mode)))
1443 msg_print(_("召喚されたモンスターは怒っている!", "The summoned monsters are angry!"));
1455 msg_print(_("アリを召喚した。", "You summon ants."));
1456 if (summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_ANT, (PM_ALLOW_GROUP | p_mode)))
1459 msg_print(_("召喚されたアリは怒っている!", "The summoned ants are angry!"));
1469 msg_print(_("蜘蛛を召喚した。", "You summon spiders."));
1470 if (summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_SPIDER, (PM_ALLOW_GROUP | p_mode)))
1473 msg_print(_("召喚された蜘蛛は怒っている!", "Summoned spiders are angry!"));
1484 msg_print(_("ハウンドを召喚した。", "You summon hounds."));
1485 if (summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_HOUND, (PM_ALLOW_GROUP | p_mode)))
1488 msg_print(_("召喚されたハウンドは怒っている!", "Summoned hounds are angry!"));
1499 msg_print(_("ヒドラを召喚した。", "You summon a hydras."));
1500 if (summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_HYDRA, (g_mode | p_mode)))
1503 msg_print(_("召喚されたヒドラは怒っている!", "Summoned hydras are angry!"));
1514 msg_print(_("天使を召喚した!", "You summon an angel!"));
1515 if (summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_ANGEL, (g_mode | p_mode)))
1518 msg_print(_("召喚された天使は怒っている!", "The summoned angel is angry!"));
1528 msg_print(_("混沌の宮廷から悪魔を召喚した!", "You summon a demon from the Courts of Chaos!"));
1529 if (summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_DEMON, (g_mode | p_mode)))
1532 msg_print(_("召喚されたデーモンは怒っている!", "The summoned demon is angry!"));
1542 msg_print(_("アンデッドの強敵を召喚した!", "You summon an undead adversary!"));
1543 if (summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_UNDEAD, (g_mode | p_mode)))
1546 msg_print(_("召喚されたアンデッドは怒っている!", "The summoned undead is angry!"));
1556 msg_print(_("ドラゴンを召喚した!", "You summon a dragon!"));
1557 if (summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_DRAGON, (g_mode | p_mode)))
1560 msg_print(_("召喚されたドラゴンは怒っている!", "The summoned dragon is angry!"));
1568 case MS_S_HI_UNDEAD:
1570 msg_print(_("強力なアンデッドを召喚した!", "You summon a greater undead!"));
1571 if (summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_HI_UNDEAD, (g_mode | p_mode | u_mode)))
1574 msg_print(_("召喚された上級アンデッドは怒っている!", "The summoned greater undead is angry!"));
1582 case MS_S_HI_DRAGON:
1584 msg_print(_("古代ドラゴンを召喚した!", "You summon an ancient dragon!"));
1585 if (summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_HI_DRAGON, (g_mode | p_mode | u_mode)))
1588 msg_print(_("召喚された古代ドラゴンは怒っている!", "The summoned ancient dragon is angry!"));
1598 msg_print(_("アンバーの王族を召喚した!", "You summon a Lord of Amber!"));
1599 if (summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_AMBERITES, (g_mode | p_mode | u_mode)))
1602 msg_print(_("召喚されたアンバーの王族は怒っている!", "The summoned Lord of Amber is angry!"));
1613 msg_print(_("特別な強敵を召喚した!", "You summon a special opponent!"));
1614 for (k = 0; k < 1; k++)
1616 if (summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_UNIQUE, (g_mode | p_mode | PM_ALLOW_UNIQUE)))
1620 msg_print(_("召喚されたユニーク・モンスターは怒っている!", "The summoned special opponent is angry!"));
1624 for (k = count; k < 1; k++)
1626 if (summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_HI_UNDEAD, (g_mode | p_mode | PM_ALLOW_UNIQUE)))
1630 msg_print(_("召喚された上級アンデッドは怒っている!", "The summoned greater undead is angry!"));
1647 msg_print(_("何も現れなかった。", "No one appeared."));
1655 * @brief 青魔法コマンドのメインルーチン /
1656 * do_cmd_cast calls this function if the player's class is 'Blue-Mage'.
1657 * @return 処理を実行したらTRUE、キャンセルした場合FALSEを返す。
1659 bool do_cmd_cast_learned(player_type *caster_ptr)
1663 PERCENTAGE minfail = 0;
1664 PLAYER_LEVEL plev = caster_ptr->lev;
1665 monster_power spell;
1667 MANA_POINT need_mana;
1669 if (cmd_limit_confused(caster_ptr)) return FALSE;
1671 if (!get_learned_power(caster_ptr, &n)) return FALSE;
1673 spell = monster_powers[n];
1675 need_mana = mod_need_mana(caster_ptr, spell.smana, 0, REALM_NONE);
1677 /* Verify "dangerous" spells */
1678 if (need_mana > caster_ptr->csp)
1681 msg_print(_("MPが足りません。", "You do not have enough mana to use this power."));
1683 if (!over_exert) return FALSE;
1686 if (!get_check(_("それでも挑戦しますか? ", "Attempt it anyway? "))) return FALSE;
1689 /* Spell failure chance */
1690 chance = spell.fail;
1692 /* Reduce failure rate by "effective" level adjustment */
1693 if (plev > spell.level) chance -= 3 * (plev - spell.level);
1694 else chance += (spell.level - plev);
1696 /* Reduce failure rate by INT/WIS adjustment */
1697 chance -= 3 * (adj_mag_stat[caster_ptr->stat_ind[A_INT]] - 1);
1699 chance = mod_spell_chance_1(caster_ptr, chance);
1701 /* Not enough mana to cast */
1702 if (need_mana > caster_ptr->csp)
1704 chance += 5 * (need_mana - caster_ptr->csp);
1707 /* Extract the minimum failure rate */
1708 minfail = adj_mag_fail[caster_ptr->stat_ind[A_INT]];
1710 /* Minimum failure rate */
1711 if (chance < minfail) chance = minfail;
1713 /* Stunning makes spells harder */
1714 if (caster_ptr->stun > 50) chance += 25;
1715 else if (caster_ptr->stun) chance += 15;
1717 /* Always a 5 percent chance of working */
1718 if (chance > 95) chance = 95;
1720 chance = mod_spell_chance_2(caster_ptr, chance);
1723 if (randint0(100) < chance)
1725 if (flush_failure) flush();
1726 msg_print(_("魔法をうまく唱えられなかった。", "You failed to concentrate hard enough!"));
1731 cast = cast_learned_spell(caster_ptr, n, FALSE);
1736 cast = cast_learned_spell(caster_ptr, n, TRUE);
1737 if (!cast) return FALSE;
1740 /* Sufficient mana */
1741 if (need_mana <= caster_ptr->csp)
1744 caster_ptr->csp -= need_mana;
1748 int oops = need_mana;
1751 caster_ptr->csp = 0;
1752 caster_ptr->csp_frac = 0;
1754 msg_print(_("精神を集中しすぎて気を失ってしまった!", "You faint from the effort!"));
1756 /* Hack -- Bypass free action */
1757 (void)set_paralyzed(caster_ptr, caster_ptr->paralyzed + randint1(5 * oops + 1));
1759 chg_virtue(caster_ptr, V_KNOWLEDGE, -10);
1761 /* Damage CON (possibly permanently) */
1762 if (randint0(100) < 50)
1764 bool perm = (randint0(100) < 25);
1766 msg_print(_("体を悪くしてしまった!", "You have damaged your health!"));
1768 /* Reduce constitution */
1769 (void)dec_stat(caster_ptr, A_CON, 15 + randint1(10), perm);
1773 take_turn(caster_ptr, 100);
1775 caster_ptr->redraw |= (PR_MANA);
1776 caster_ptr->window |= (PW_PLAYER | PW_SPELL);
1783 * @brief 青魔法のラーニング判定と成功した場合のラーニング処理
1784 * @param monspell ラーニングを試みるモンスター攻撃のID
1787 void learn_spell(player_type *learner_ptr, int monspell)
1789 if (learner_ptr->action != ACTION_LEARN) return;
1790 if (monspell < 0) return;
1791 if (learner_ptr->magic_num2[monspell]) return;
1792 if (learner_ptr->confused || learner_ptr->blind || learner_ptr->image || learner_ptr->stun || learner_ptr->paralyzed) return;
1793 if (randint1(learner_ptr->lev + 70) > monster_powers[monspell].level + 40)
1795 learner_ptr->magic_num2[monspell] = 1;
1796 msg_format(_("%sを学習した!", "You have learned %s!"), monster_powers[monspell].name);
1797 gain_exp(learner_ptr, monster_powers[monspell].level * monster_powers[monspell].smana);
1801 learner_ptr->new_mane = TRUE;
1802 learner_ptr->redraw |= (PR_STATE);
1808 * todo f4, f5, f6を構造体にまとめ直す
1809 * @brief モンスター特殊能力のフラグ配列から特定条件の魔法だけを抜き出す処理
1810 * Extract monster spells mask for the given mode
1811 * @param f4 モンスター特殊能力の4番目のフラグ配列
1812 * @param f5 モンスター特殊能力の5番目のフラグ配列
1813 * @param f6 モンスター特殊能力の6番目のフラグ配列
1814 * @param mode 抜き出したい条件
1819 void set_rf_masks(BIT_FLAGS *f4, BIT_FLAGS *f5, BIT_FLAGS *f6, BIT_FLAGS mode)
1823 case MONSPELL_TYPE_BOLT:
1824 *f4 = ((RF4_BOLT_MASK | RF4_BEAM_MASK) & ~(RF4_ROCKET));
1825 *f5 = RF5_BOLT_MASK | RF5_BEAM_MASK;
1826 *f6 = RF6_BOLT_MASK | RF6_BEAM_MASK;
1829 case MONSPELL_TYPE_BALL:
1830 *f4 = (RF4_BALL_MASK & ~(RF4_BREATH_MASK));
1831 *f5 = (RF5_BALL_MASK & ~(RF5_BREATH_MASK));
1832 *f6 = (RF6_BALL_MASK & ~(RF6_BREATH_MASK));
1835 case MONSPELL_TYPE_BREATH:
1836 *f4 = RF4_BREATH_MASK;
1837 *f5 = RF5_BREATH_MASK;
1838 *f6 = RF6_BREATH_MASK;
1841 case MONSPELL_TYPE_SUMMON:
1842 *f4 = RF4_SUMMON_MASK;
1843 *f5 = RF5_SUMMON_MASK;
1844 *f6 = RF6_SUMMON_MASK;
1847 case MONSPELL_TYPE_OTHER:
1848 *f4 = RF4_ATTACK_MASK & ~(RF4_BOLT_MASK | RF4_BEAM_MASK | RF4_BALL_MASK | RF4_INDIRECT_MASK);
1849 *f5 = RF5_ATTACK_MASK & ~(RF5_BOLT_MASK | RF5_BEAM_MASK | RF5_BALL_MASK | RF5_INDIRECT_MASK);
1850 *f6 = RF6_ATTACK_MASK & ~(RF6_BOLT_MASK | RF6_BEAM_MASK | RF6_BALL_MASK | RF6_INDIRECT_MASK);