1 #include "realm/realm-craft.h"
2 #include "cmd-action/cmd-spell.h"
3 #include "monster-floor/monster-summon.h"
4 #include "monster-floor/place-monster-types.h"
5 #include "mutation/mutation.h"
6 #include "status/buff-setter.h"
7 #include "player/player-effects.h"
8 #include "player/player-status.h"
9 #include "player/selfinfo.h"
10 #include "spell-kind/spells-curse-removal.h"
11 #include "spell-kind/spells-perception.h"
12 #include "spell-realm/spells-craft.h"
13 #include "spell/range-calc.h"
14 #include "spell/spells-object.h"
15 #include "spell/spells-status.h"
16 #include "spell/spells-summon.h"
17 #include "spell/spells3.h"
18 #include "status/sight-setter.h"
19 #include "view/display-messages.h"
24 * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
25 * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
27 concptr do_craft_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type mode)
29 bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
30 bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
31 bool info = (mode == SPELL_INFO) ? TRUE : FALSE;
32 bool cast = (mode == SPELL_CAST) ? TRUE : FALSE;
34 PLAYER_LEVEL plev = caster_ptr->lev;
39 if (name) return _("赤外線視力", "Infravision");
40 if (desc) return _("一定時間、赤外線視力が増強される。", "Gives infravision for a while.");
45 if (info) return info_duration(base, base);
49 set_tim_infra(caster_ptr, base + randint1(base), FALSE);
55 if (name) return _("回復力強化", "Regeneration");
56 if (desc) return _("一定時間、回復力が増強される。", "Gives regeneration ability for a while.");
61 if (info) return info_duration(base, base);
65 set_tim_regen(caster_ptr, base + randint1(base), FALSE);
71 if (name) return _("空腹充足", "Satisfy Hunger");
72 if (desc) return _("満腹になる。", "Satisfies hunger.");
77 set_food(caster_ptr, PY_FOOD_MAX - 1);
83 if (name) return _("耐冷気", "Resist Cold");
84 if (desc) return _("一定時間、冷気への耐性を得る。装備による耐性に累積する。",
85 "Gives resistance to cold. This resistance can be added to that from equipment for more powerful resistance.");
90 if (info) return info_duration(base, base);
94 set_oppose_cold(caster_ptr, randint1(base) + base, FALSE);
100 if (name) return _("耐火炎", "Resist Fire");
101 if (desc) return _("一定時間、炎への耐性を得る。装備による耐性に累積する。",
102 "Gives resistance to fire. This resistance can be added to that from equipment for more powerful resistance.");
107 if (info) return info_duration(base, base);
111 set_oppose_fire(caster_ptr, randint1(base) + base, FALSE);
117 if (name) return _("士気高揚", "Heroism");
118 if (desc) return _("一定時間、ヒーロー気分になる。", "Removes fear. Gives a bonus to hit for a while. Heals you for 10 HP.");
123 if (info) return info_duration(base, base);
127 (void)heroism(caster_ptr, base);
133 if (name) return _("耐電撃", "Resist Lightning");
134 if (desc) return _("一定時間、電撃への耐性を得る。装備による耐性に累積する。",
135 "Gives resistance to electricity. This resistance can be added to that from equipment for more powerful resistance.");
140 if (info) return info_duration(base, base);
144 set_oppose_elec(caster_ptr, randint1(base) + base, FALSE);
150 if (name) return _("耐酸", "Resist Acid");
151 if (desc) return _("一定時間、酸への耐性を得る。装備による耐性に累積する。",
152 "Gives resistance to acid. This resistance can be added to that from equipment for more powerful resistance.");
157 if (info) return info_duration(base, base);
161 set_oppose_acid(caster_ptr, randint1(base) + base, FALSE);
167 if (name) return _("透明視認", "See Invisibility");
168 if (desc) return _("一定時間、透明なものが見えるようになる。", "Gives see invisible for a while.");
173 if (info) return info_duration(base, base);
177 set_tim_invis(caster_ptr, randint1(base) + base, FALSE);
183 if (name) return _("解呪", "Remove Curse");
184 if (desc) return _("アイテムにかかった弱い呪いを解除する。", "Removes normal curses from equipped items.");
187 if (cast) (void)remove_curse(caster_ptr);
192 if (name) return _("耐毒", "Resist Poison");
193 if (desc) return _("一定時間、毒への耐性を得る。装備による耐性に累積する。",
194 "Gives resistance to poison. This resistance can be added to that from equipment for more powerful resistance.");
199 if (info) return info_duration(base, base);
203 set_oppose_pois(caster_ptr, randint1(base) + base, FALSE);
209 if (name) return _("狂戦士化", "Berserk");
210 if (desc) return _("狂戦士化し、恐怖を除去する。", "Gives a bonus to hit and HP, immunity to fear for a while. But decreases AC.");
215 if (info) return info_duration(base, base);
219 (void)berserk(caster_ptr, base + randint1(base));
225 if (name) return _("自己分析", "Self Knowledge");
226 if (desc) return _("現在の自分の状態を完全に知る。",
227 "Gives you useful info regarding your current resistances, the powers of your weapon and maximum limits of your stats.");
232 self_knowledge(caster_ptr);
238 if (name) return _("対邪悪結界", "Protection from Evil");
239 if (desc) return _("邪悪なモンスターの攻撃を防ぐバリアを張る。", "Gives aura which protect you from evil monster's physical attack.");
245 if (info) return info_duration(base, sides);
249 set_protevil(caster_ptr, randint1(sides) + base, FALSE);
255 if (name) return _("癒し", "Cure");
256 if (desc) return _("毒、朦朧状態、負傷を全快させ、幻覚を直す。", "Completely heals poisons, cuts, hallucination and being stunned.");
261 (void)true_healing(caster_ptr, 0);
267 if (name) return _("魔法剣", "Mana Branding");
268 if (desc) return _("一定時間、武器に冷気、炎、電撃、酸、毒のいずれかの属性をつける。武器を持たないと使えない。",
269 "Causes current weapon to temporarily do additional damage from cold, fire, lightning, acid or poison. You must be wielding one or more weapons.");
274 if (info) return info_duration(base, base);
278 if (!choose_ele_attack(caster_ptr)) return NULL;
284 if (name) return _("テレパシー", "Telepathy");
285 if (desc) return _("一定時間、テレパシー能力を得る。", "Gives telepathy for a while.");
291 if (info) return info_duration(base, sides);
295 set_tim_esp(caster_ptr, randint1(sides) + base, FALSE);
301 if (name) return _("肌石化", "Stone Skin");
302 if (desc) return _("一定時間、ACを上昇させる。", "Gives a bonus to AC for a while.");
308 if (info) return info_duration(base, sides);
312 set_shield(caster_ptr, randint1(sides) + base, FALSE);
318 if (name) return _("全耐性", "Resistance");
319 if (desc) return _("一定時間、酸、電撃、炎、冷気、毒に対する耐性を得る。装備による耐性に累積する。",
320 "Gives resistance to fire, cold, electricity, acid and poison for a while. These resistances can be added to those from equipment for more powerful resistances.");
325 if (info) return info_duration(base, base);
329 set_oppose_acid(caster_ptr, randint1(base) + base, FALSE);
330 set_oppose_elec(caster_ptr, randint1(base) + base, FALSE);
331 set_oppose_fire(caster_ptr, randint1(base) + base, FALSE);
332 set_oppose_cold(caster_ptr, randint1(base) + base, FALSE);
333 set_oppose_pois(caster_ptr, randint1(base) + base, FALSE);
339 if (name) return _("スピード", "Haste Self");
340 if (desc) return _("一定時間、加速する。", "Hastes you for a while.");
344 DICE_SID sides = 20 + plev;
346 if (info) return info_duration(base, sides);
350 set_fast(caster_ptr, randint1(sides) + base, FALSE);
356 if (name) return _("壁抜け", "Walk through Wall");
357 if (desc) return _("一定時間、半物質化し壁を通り抜けられるようになる。", "Gives ability to pass walls for a while.");
362 if (info) return info_duration(base, base);
366 set_kabenuke(caster_ptr, randint1(base) + base, FALSE);
372 if (name) return _("盾磨き", "Polish Shield");
373 if (desc) return _("盾に反射の属性をつける。", "Makes a shield a shield of reflection.");
378 pulish_shield(caster_ptr);
384 if (name) return _("ゴーレム製造", "Create Golem");
385 if (desc) return _("1体のゴーレムを製造する。", "Creates a golem.");
390 if (summon_specific(caster_ptr, -1, caster_ptr->y, caster_ptr->x, plev, SUMMON_GOLEM, PM_FORCE_PET))
392 msg_print(_("ゴーレムを作った。", "You make a golem."));
396 msg_print(_("うまくゴーレムを作れなかった。", "No Golems arrive."));
403 if (name) return _("魔法の鎧", "Magical armor");
404 if (desc) return _("一定時間、魔法防御力とACが上がり、混乱と盲目の耐性、反射能力、麻痺知らず、浮遊を得る。",
405 "Gives resistance to magic, bonus to AC, resistance to confusion, blindness, reflection, free action and levitation for a while.");
410 if (info) return info_duration(base, base);
414 set_magicdef(caster_ptr, randint1(base) + base, FALSE);
420 if (name) return _("装備無力化", "Remove Enchantment");
421 if (desc) return _("武器・防具にかけられたあらゆる魔力を完全に解除する。", "Removes all magics completely from any weapon or armor.");
426 if (!mundane_spell(caster_ptr, TRUE)) return NULL;
432 if (name) return _("呪い粉砕", "Remove All Curse");
433 if (desc) return _("アイテムにかかった強力な呪いを解除する。", "Removes normal and heavy curse from equipped items.");
436 if (cast) (void)remove_all_curse(caster_ptr);
441 if (name) return _("完全なる知識", "Knowledge True");
442 if (desc) return _("アイテムの持つ能力を完全に知る。", "*Identifies* an item.");
447 if (!identify_fully(caster_ptr, FALSE, 0)) return NULL;
453 if (name) return _("武器強化", "Enchant Weapon");
454 if (desc) return _("武器の命中率修正とダメージ修正を強化する。", "Attempts to increase +to-hit, +to-dam of a weapon.");
459 if (!enchant_spell(caster_ptr, randint0(4) + 1, randint0(4) + 1, 0)) return NULL;
465 if (name) return _("防具強化", "Enchant Armor");
466 if (desc) return _("鎧の防御修正を強化する。", "Attempts to increase +AC of an armor.");
471 if (!enchant_spell(caster_ptr, 0, 0, randint0(3) + 2)) return NULL;
477 if (name) return _("武器属性付与", "Brand Weapon");
478 if (desc) return _("武器にランダムに属性をつける。", "Makes current weapon a random ego weapon.");
483 brand_weapon(caster_ptr, randint0(18));
489 if (name) return _("人間トランプ", "Living Trump");
490 if (desc) return _("ランダムにテレポートする突然変異か、自分の意思でテレポートする突然変異が身につく。",
491 "Gives mutation which makes you teleport randomly or makes you able to teleport at will.");
492 if (cast) become_living_trump(caster_ptr);
496 if (name) return _("属性への免疫", "Immunity");
497 if (desc) return _("一定時間、冷気、炎、電撃、酸のいずれかに対する免疫を得る。",
498 "Gives an immunity to fire, cold, electricity or acid for a while.");
503 if (info) return info_duration(base, base);
507 if (!choose_ele_immune(caster_ptr, base + randint1(base))) return NULL;