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 "player-info/self-info.h"
6 #include "player/digestion-processor.h"
7 #include "spell-kind/spells-curse-removal.h"
8 #include "spell-kind/spells-enchant.h"
9 #include "spell-kind/spells-perception.h"
10 #include "spell-realm/spells-craft.h"
11 #include "spell-realm/spells-trump.h"
12 #include "spell/range-calc.h"
13 #include "spell/spells-object.h"
14 #include "spell/spells-status.h"
15 #include "spell/summon-types.h"
16 #include "status/body-improvement.h"
17 #include "status/buff-setter.h"
18 #include "status/element-resistance.h"
19 #include "status/sight-setter.h"
20 #include "system/player-type-definition.h"
21 #include "view/display-messages.h"
26 * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
27 * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
29 concptr do_craft_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type mode)
31 bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
32 bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
33 bool info = (mode == SPELL_INFO) ? TRUE : FALSE;
34 bool cast = (mode == SPELL_CAST) ? TRUE : FALSE;
36 PLAYER_LEVEL plev = caster_ptr->lev;
41 return _("赤外線視力", "Infravision");
43 return _("一定時間、赤外線視力が増強される。", "Gives infravision for a while.");
49 return info_duration(base, base);
52 set_tim_infra(caster_ptr, base + randint1(base), FALSE);
59 return _("回復力強化", "Regeneration");
61 return _("一定時間、回復力が増強される。", "Gives regeneration ability for a while.");
67 return info_duration(base, base);
70 set_tim_regen(caster_ptr, base + randint1(base), FALSE);
77 return _("空腹充足", "Satisfy Hunger");
79 return _("満腹になる。", "Satisfies hunger.");
83 set_food(caster_ptr, PY_FOOD_MAX - 1);
90 return _("耐冷気", "Resist Cold");
92 return _("一定時間、冷気への耐性を得る。装備による耐性に累積する。",
93 "Gives resistance to cold. This resistance can be added to that from equipment for more powerful resistance.");
99 return info_duration(base, base);
102 set_oppose_cold(caster_ptr, randint1(base) + base, FALSE);
109 return _("耐火炎", "Resist Fire");
111 return _("一定時間、炎への耐性を得る。装備による耐性に累積する。",
112 "Gives resistance to fire. This resistance can be added to that from equipment for more powerful resistance.");
118 return info_duration(base, base);
121 set_oppose_fire(caster_ptr, randint1(base) + base, FALSE);
128 return _("士気高揚", "Heroism");
130 return _("一定時間、ヒーロー気分になる。", "Removes fear. Gives a bonus to hit for a while. Heals you for 10 HP.");
136 return info_duration(base, base);
139 (void)heroism(caster_ptr, base);
146 return _("耐電撃", "Resist Lightning");
148 return _("一定時間、電撃への耐性を得る。装備による耐性に累積する。",
149 "Gives resistance to electricity. This resistance can be added to that from equipment for more powerful resistance.");
155 return info_duration(base, base);
158 set_oppose_elec(caster_ptr, randint1(base) + base, FALSE);
165 return _("耐酸", "Resist Acid");
167 return _("一定時間、酸への耐性を得る。装備による耐性に累積する。",
168 "Gives resistance to acid. This resistance can be added to that from equipment for more powerful resistance.");
174 return info_duration(base, base);
177 set_oppose_acid(caster_ptr, randint1(base) + base, FALSE);
184 return _("透明視認", "See Invisibility");
186 return _("一定時間、透明なものが見えるようになる。", "Gives see invisible for a while.");
192 return info_duration(base, base);
195 set_tim_invis(caster_ptr, randint1(base) + base, FALSE);
202 return _("解呪", "Remove Curse");
204 return _("アイテムにかかった弱い呪いを解除する。", "Removes normal curses from equipped items.");
208 (void)remove_curse(caster_ptr);
214 return _("耐毒", "Resist Poison");
216 return _("一定時間、毒への耐性を得る。装備による耐性に累積する。",
217 "Gives resistance to poison. This resistance can be added to that from equipment for more powerful resistance.");
223 return info_duration(base, base);
226 set_oppose_pois(caster_ptr, randint1(base) + base, FALSE);
233 return _("狂戦士化", "Berserk");
235 return _("狂戦士化し、恐怖を除去する。", "Gives a bonus to hit and HP, immunity to fear for a while. But decreases AC.");
241 return info_duration(base, base);
244 (void)berserk(caster_ptr, base + randint1(base));
251 return _("自己分析", "Self Knowledge");
253 return _("現在の自分の状態を完全に知る。",
254 "Gives you useful info regarding your current resistances, the powers of your weapon and maximum limits of your stats.");
258 self_knowledge(caster_ptr);
265 return _("対邪悪結界", "Protection from Evil");
267 return _("邪悪なモンスターの攻撃を防ぐバリアを張る。", "Gives aura which protect you from evil monster's physical attack.");
274 return info_duration(base, sides);
277 set_protevil(caster_ptr, randint1(sides) + base, FALSE);
284 return _("癒し", "Cure");
286 return _("毒、朦朧状態、負傷を全快させ、幻覚を直す。", "Completely heals poisons, cuts, hallucination and being stunned.");
290 (void)true_healing(caster_ptr, 0);
297 return _("魔法剣", "Mana Branding");
299 return _("一定時間、武器に冷気、炎、電撃、酸、毒のいずれかの属性をつける。武器を持たないと使えない。",
300 "Causes current weapon to temporarily do additional damage from cold, fire, lightning, acid or poison. You must be wielding one or more "
307 return info_duration(base, base);
310 if (!choose_ele_attack(caster_ptr))
318 return _("テレパシー", "Telepathy");
320 return _("一定時間、テレパシー能力を得る。", "Gives telepathy for a while.");
327 return info_duration(base, sides);
330 set_tim_esp(caster_ptr, randint1(sides) + base, FALSE);
337 return _("肌石化", "Stone Skin");
339 return _("一定時間、ACを上昇させる。", "Gives a bonus to AC for a while.");
346 return info_duration(base, sides);
349 set_shield(caster_ptr, randint1(sides) + base, FALSE);
356 return _("全耐性", "Resistance");
358 return _("一定時間、酸、電撃、炎、冷気、毒に対する耐性を得る。装備による耐性に累積する。",
359 "Gives resistance to fire, cold, electricity, acid and poison for a while. These resistances can be added to those from equipment for more "
360 "powerful resistances.");
366 return info_duration(base, base);
369 set_oppose_acid(caster_ptr, randint1(base) + base, FALSE);
370 set_oppose_elec(caster_ptr, randint1(base) + base, FALSE);
371 set_oppose_fire(caster_ptr, randint1(base) + base, FALSE);
372 set_oppose_cold(caster_ptr, randint1(base) + base, FALSE);
373 set_oppose_pois(caster_ptr, randint1(base) + base, FALSE);
380 return _("スピード", "Haste Self");
382 return _("一定時間、加速する。", "Hastes you for a while.");
386 DICE_SID sides = 20 + plev;
389 return info_duration(base, sides);
392 set_fast(caster_ptr, randint1(sides) + base, FALSE);
399 return _("壁抜け", "Walk through Wall");
401 return _("一定時間、半物質化し壁を通り抜けられるようになる。", "Gives ability to pass walls for a while.");
407 return info_duration(base, base);
410 set_pass_wall(caster_ptr, randint1(base) + base, FALSE);
417 return _("盾磨き", "Polish Shield");
419 return _("盾に反射の属性をつける。", "Makes a shield a shield of reflection.");
423 pulish_shield(caster_ptr);
430 return _("ゴーレム製造", "Create Golem");
432 return _("1体のゴーレムを製造する。", "Creates a golem.");
436 if (summon_specific(caster_ptr, -1, caster_ptr->y, caster_ptr->x, plev, SUMMON_GOLEM, PM_FORCE_PET)) {
437 msg_print(_("ゴーレムを作った。", "You make a golem."));
439 msg_print(_("うまくゴーレムを作れなかった。", "You couldn't make a golem."));
447 return _("魔法の鎧", "Magical armor");
449 return _("一定時間、魔法防御力とACが上がり、混乱と盲目の耐性、反射能力、麻痺知らず、浮遊を得る。",
450 "Gives resistance to magic, bonus to AC, resistance to confusion, blindness, reflection, free action and levitation for a while.");
456 return info_duration(base, base);
459 set_magicdef(caster_ptr, randint1(base) + base, FALSE);
466 return _("装備無力化", "Remove Enchantment");
468 return _("武器・防具にかけられたあらゆる魔力を完全に解除する。", "Completely removes all magics from any weapon or armor.");
472 if (!mundane_spell(caster_ptr, TRUE))
480 return _("呪い粉砕", "Remove All Curse");
482 return _("アイテムにかかった強力な呪いを解除する。", "Removes normal and heavy curses from equipped items.");
486 (void)remove_all_curse(caster_ptr);
492 return _("完全なる知識", "Knowledge True");
494 return _("アイテムの持つ能力を完全に知る。", "*Identifies* an item.");
498 if (!identify_fully(caster_ptr, FALSE, TV_NONE))
506 return _("武器強化", "Enchant Weapon");
508 return _("武器の命中率修正とダメージ修正を強化する。", "Attempts to increase +to-hit, +to-dam of a weapon.");
512 if (!enchant_spell(caster_ptr, randint0(4) + 1, randint0(4) + 1, 0))
520 return _("防具強化", "Enchant Armor");
522 return _("鎧の防御修正を強化する。", "Attempts to increase +AC of an armor.");
526 if (!enchant_spell(caster_ptr, 0, 0, randint0(3) + 2))
534 return _("武器属性付与", "Brand Weapon");
536 return _("武器にランダムに属性をつける。", "Makes current weapon a random ego weapon.");
540 brand_weapon(caster_ptr, randint0(18));
547 return _("人間トランプ", "Living Trump");
549 return _("ランダムにテレポートする突然変異か、自分の意思でテレポートする突然変異が身につく。",
550 "Gives mutation which makes you teleport randomly or makes you able to teleport at will.");
552 become_living_trump(caster_ptr);
557 return _("属性への免疫", "Immunity");
559 return _("一定時間、冷気、炎、電撃、酸のいずれかに対する免疫を得る。", "Gives an immunity to fire, cold, electricity or acid for a while.");
565 return info_duration(base, base);
568 if (!choose_ele_immune(caster_ptr, base + randint1(base)))