1 #include "realm/realm-life.h"
2 #include "cmd-action/cmd-spell.h"
3 #include "player/digestion-processor.h"
4 #include "spell-kind/spells-curse-removal.h"
5 #include "spell-kind/spells-detection.h"
6 #include "spell-kind/spells-floor.h"
7 #include "spell-kind/spells-genocide.h"
8 #include "spell-kind/spells-grid.h"
9 #include "spell-kind/spells-launcher.h"
10 #include "spell-kind/spells-lite.h"
11 #include "spell-kind/spells-neighbor.h"
12 #include "spell-kind/spells-perception.h"
13 #include "spell-kind/spells-sight.h"
14 #include "spell-kind/spells-world.h"
15 #include "spell/spell-types.h"
16 #include "spell/spells-status.h"
17 #include "status/bad-status-setter.h"
18 #include "status/buff-setter.h"
19 #include "status/element-resistance.h"
20 #include "status/experience.h"
21 #include "status/temporary-resistance.h"
22 #include "system/floor-type-definition.h"
23 #include "target/target-getter.h"
26 * @brief 生命領域魔法の各処理を行う
27 * @param caster_ptr プレーヤーへの参照ポインタ
29 * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST)
30 * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST時はNULL文字列を返す。
32 concptr do_life_spell(player_type *caster_ptr, SPELL_IDX spell, spell_type mode)
34 bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
35 bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
36 bool info = (mode == SPELL_INFO) ? TRUE : FALSE;
37 bool cast = (mode == SPELL_CAST) ? TRUE : FALSE;
40 PLAYER_LEVEL plev = caster_ptr->lev;
45 return _("軽傷の治癒", "Cure Light Wounds");
47 return _("怪我と体力を少し回復させる。", "Heals cuts and HP a little.");
52 return info_heal(dice, sides, 0);
54 (void)cure_light_wounds(caster_ptr, dice, sides);
60 return _("祝福", "Bless");
62 return _("一定時間、命中率とACにボーナスを得る。", "Gives a bonus to hit and AC for a few turns.");
67 return info_duration(base, base);
70 set_blessed(caster_ptr, randint1(base) + base, FALSE);
77 return _("軽傷", "Cause Light Wounds");
79 return _("1体のモンスターに小ダメージを与える。抵抗されると無効。", "Wounds a monster a little unless resisted.");
81 DICE_NUMBER dice = 3 + (plev - 1) / 5;
85 return info_damage(dice, sides, 0);
88 if (!get_aim_dir(caster_ptr, &dir))
90 fire_ball_hide(caster_ptr, GF_WOUNDS, dir, damroll(dice, sides), 0);
97 return _("光の召喚", "Call Light");
99 return _("光源が照らしている範囲か部屋全体を永久に明るくする。", "Lights up nearby area and the inside of a room permanently.");
101 DICE_NUMBER dice = 2;
102 DICE_SID sides = plev / 2;
103 POSITION rad = plev / 10 + 1;
106 return info_damage(dice, sides, 0);
109 lite_area(caster_ptr, damroll(dice, sides), rad);
116 return _("罠 & 隠し扉感知", "Detect Doors & Traps");
118 return _("近くの全ての罠と扉と階段を感知する。", "Detects traps, doors, and stairs in your vicinity.");
120 POSITION rad = DETECT_RAD_DEFAULT;
123 return info_radius(rad);
126 detect_traps(caster_ptr, rad, TRUE);
127 detect_doors(caster_ptr, rad);
128 detect_stairs(caster_ptr, rad);
135 return _("重傷の治癒", "Cure Medium Wounds");
137 return _("怪我と体力を中程度回復させる。", "Heals cuts and HP more.");
139 DICE_NUMBER dice = 4;
143 return info_heal(dice, sides, 0);
145 (void)cure_serious_wounds(caster_ptr, dice, sides);
151 return _("解毒", "Cure Poison");
153 return _("体内の毒を取り除く。", "Cures yourself of any poisons.");
156 set_poisoned(caster_ptr, 0);
163 return _("空腹充足", "Satisfy Hunger");
165 return _("満腹にする。", "Satisfies hunger.");
168 set_food(caster_ptr, PY_FOOD_MAX - 1);
175 return _("解呪", "Remove Curse");
177 return _("アイテムにかかった弱い呪いを解除する。", "Removes normal curses from equipped items.");
180 (void)remove_curse(caster_ptr);
186 return _("重傷", "Cause Medium Wounds");
188 return _("1体のモンスターに中ダメージを与える。抵抗されると無効。", "Wounds a monster unless resisted.");
190 DICE_SID sides = 8 + (plev - 5) / 4;
191 DICE_NUMBER dice = 8;
194 return info_damage(dice, sides, 0);
197 if (!get_aim_dir(caster_ptr, &dir))
199 fire_ball_hide(caster_ptr, GF_WOUNDS, dir, damroll(dice, sides), 0);
206 return _("致命傷の治癒", "Cure Critical Wounds");
208 return _("体力を大幅に回復させ、負傷と朦朧状態も全快する。", "Heals HP greatly. Also cures cuts and being stunned.");
210 DICE_NUMBER dice = 8;
214 return info_heal(dice, sides, 0);
216 (void)cure_critical_wounds(caster_ptr, damroll(dice, sides));
222 return _("耐熱耐寒", "Resist Heat and Cold");
224 return _("一定時間、火炎と冷気に対する耐性を得る。装備による耐性に累積する。",
225 "Gives resistance to fire and cold. These resistances can be added to those from equipment for more powerful resistances.");
231 return info_duration(base, base);
234 set_oppose_cold(caster_ptr, randint1(base) + base, FALSE);
235 set_oppose_fire(caster_ptr, randint1(base) + base, FALSE);
242 return _("周辺感知", "Sense Surroundings");
244 return _("周辺の地形を感知する。", "Maps nearby area.");
247 POSITION rad = DETECT_RAD_MAP;
250 return info_radius(rad);
253 map_area(caster_ptr, rad);
260 return _("パニック・アンデッド", "Turn Undead");
262 return _("視界内のアンデッドを恐怖させる。抵抗されると無効。", "Attempts to scare undead monsters in sight.");
266 turn_undead(caster_ptr);
273 return _("体力回復", "Healing");
275 return _("極めて強力な回復呪文で、負傷と朦朧状態も全快する。", "Is very powerful healing magic. Also completely cures cuts and being stunned.");
280 return info_heal(0, 0, heal);
282 (void)cure_critical_wounds(caster_ptr, heal);
288 return _("結界の紋章", "Rune of Protection");
290 return _("自分のいる床の上に、モンスターが通り抜けたり召喚されたりすることができなくなるルーンを描く。",
291 "Sets a rune on the floor beneath you. If you are on a rune, monsters cannot attack you but can try to break the rune.");
295 create_rune_protection_one(caster_ptr);
302 return _("*解呪*", "Dispel Curse");
304 return _("アイテムにかかった強力な呪いを解除する。", "Removes normal and heavy curses from equipped items.");
307 (void)remove_all_curse(caster_ptr);
313 return _("鑑識", "Perception");
315 return _("アイテムを識別する。", "Identifies an item.");
319 if (!ident_spell(caster_ptr, FALSE, TV_NONE))
327 return _("アンデッド退散", "Dispel Undead");
329 return _("視界内の全てのアンデッドにダメージを与える。", "Damages all undead monsters in sight.");
332 DICE_NUMBER dice = 1;
333 DICE_SID sides = plev * 5;
336 return info_damage(dice, sides, 0);
339 dispel_undead(caster_ptr, damroll(dice, sides));
346 return _("凪の刻", "Day of the Dove");
348 return _("視界内の全てのモンスターを魅了する。抵抗されると無効。", "Attempts to charm all monsters in sight.");
351 int power = plev * 2;
354 return info_power(power);
357 charm_monsters(caster_ptr, power);
364 return _("致命傷", "Cause Critical Wounds");
366 return _("1体のモンスターに大ダメージを与える。抵抗されると無効。", "Wounds a monster critically unless resisted.");
369 DICE_NUMBER dice = 5 + (plev - 5) / 3;
373 return info_damage(dice, sides, 0);
376 if (!get_aim_dir(caster_ptr, &dir))
378 fire_ball_hide(caster_ptr, GF_WOUNDS, dir, damroll(dice, sides), 0);
385 return _("帰還の詔", "Word of Recall");
387 return _("地上にいるときはダンジョンの最深階へ、ダンジョンにいるときは地上へと移動する。",
388 "Recalls player from dungeon to town or from town to the deepest level of dungeon.");
395 return info_delay(base, sides);
398 if (!recall_player(caster_ptr, randint0(21) + 15))
406 return _("真実の祭壇", "Alter Reality");
408 return _("現在の階を再構成する。", "Recreates current dungeon level.");
415 return info_delay(base, sides);
418 reserve_alter_reality(caster_ptr, randint0(sides) + base);
425 return _("真・結界", "Warding True");
427 return _("自分のいる床と周囲8マスの床の上に、モンスターが通り抜けたり召喚されたりすることができなくなるルーンを描く。",
428 "Creates runes in all adjacent squares and under you.");
434 return info_radius(rad);
437 create_rune_protection_one(caster_ptr);
438 create_rune_protection_area(caster_ptr, caster_ptr->y, caster_ptr->x);
445 return _("不毛化", "Sterilization");
447 return _("この階の増殖するモンスターが増殖できなくなる。", "Prevents any breeders on current level from breeding.");
451 caster_ptr->current_floor_ptr->num_repro += MAX_REPRO;
458 return _("全感知", "Detection");
460 return _("近くの全てのモンスター、罠、扉、階段、財宝、そしてアイテムを感知する。",
461 "Detects all monsters, traps, doors, stairs, treasures and items in your vicinity.");
464 POSITION rad = DETECT_RAD_DEFAULT;
467 return info_radius(rad);
470 detect_all(caster_ptr, rad);
477 return _("アンデッド消滅", "Annihilate Undead");
479 return _("自分の周囲にいるアンデッドを現在の階から消し去る。抵抗されると無効。",
480 "Eliminates all nearby undead monsters, exhausting you. Powerful or unique monsters may be able to resist.");
483 int power = plev + 50;
486 return info_power(power);
489 mass_genocide_undead(caster_ptr, power, TRUE);
496 return _("千里眼", "Clairvoyance");
498 return _("その階全体を永久に照らし、ダンジョン内すべてのアイテムを感知する。",
499 "Maps and lights whole dungeon level. Knows all objects location. And gives telepathy for a while.");
503 wiz_lite(caster_ptr, FALSE);
510 return _("全復活", "Restoration");
512 return _("すべてのステータスと経験値を回復する。", "Restores all stats and experience.");
516 (void)restore_all_status(caster_ptr);
517 restore_level(caster_ptr);
524 return _("*体力回復*", "Healing True");
526 return _("最強の治癒の魔法で、負傷と朦朧状態も全快する。", "Is the greatest healing magic. Heals all HP, cuts and being stunned.");
531 return info_heal(0, 0, heal);
533 (void)cure_critical_wounds(caster_ptr, heal);
539 return _("聖なるビジョン", "Holy Vision");
541 return _("アイテムの持つ能力を完全に知る。", "*Identifies* an item.");
545 if (!identify_fully(caster_ptr, FALSE, TV_NONE))
553 return _("究極の耐性", "Ultimate Resistance");
555 return _("一定時間、あらゆる耐性を付け、ACと魔法防御能力を上昇させる。", "Gives ultimate resistance, bonus to AC and speed.");
558 TIME_EFFECT base = (TIME_EFFECT)plev / 2;
561 return info_duration(base, base);
564 TIME_EFFECT v = randint1(base) + base;
565 set_fast(caster_ptr, v, FALSE);
566 set_oppose_acid(caster_ptr, v, FALSE);
567 set_oppose_elec(caster_ptr, v, FALSE);
568 set_oppose_fire(caster_ptr, v, FALSE);
569 set_oppose_cold(caster_ptr, v, FALSE);
570 set_oppose_pois(caster_ptr, v, FALSE);
571 set_ultimate_res(caster_ptr, v, FALSE);