1 #include "realm/realm-life.h"
2 #include "cmd-action/cmd-spell.h"
3 #include "effect/attribute-types.h"
4 #include "player/digestion-processor.h"
5 #include "spell-kind/spells-curse-removal.h"
6 #include "spell-kind/spells-detection.h"
7 #include "spell-kind/spells-floor.h"
8 #include "spell-kind/spells-genocide.h"
9 #include "spell-kind/spells-grid.h"
10 #include "spell-kind/spells-launcher.h"
11 #include "spell-kind/spells-lite.h"
12 #include "spell-kind/spells-neighbor.h"
13 #include "spell-kind/spells-perception.h"
14 #include "spell-kind/spells-sight.h"
15 #include "spell-kind/spells-world.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 "system/player-type-definition.h"
24 #include "target/target-getter.h"
27 * @brief 生命領域魔法の各処理を行う
28 * @param player_ptr プレイヤーへの参照ポインタ
30 * @param mode 処理内容 (SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO / SpellProcessType::CAST)
31 * @return SpellProcessType::NAME / SPELL_DESC / SpellProcessType::INFO 時には文字列ポインタを返す。SpellProcessType::CAST時はnullptr文字列を返す。
33 concptr do_life_spell(PlayerType *player_ptr, SPELL_IDX spell, SpellProcessType mode)
35 bool name = mode == SpellProcessType::NAME;
36 bool desc = mode == SpellProcessType::DESCRIPTION;
37 bool info = mode == SpellProcessType::INFO;
38 bool cast = mode == SpellProcessType::CAST;
41 PLAYER_LEVEL plev = player_ptr->lev;
46 return _("軽傷の治癒", "Cure Light Wounds");
49 return _("怪我と体力を少し回復させる。", "Heals cuts and HP a little.");
55 return info_heal(dice, sides, 0);
58 (void)cure_light_wounds(player_ptr, dice, sides);
65 return _("祝福", "Bless");
68 return _("一定時間、命中率とACにボーナスを得る。", "Gives a bonus to hit and AC for a few turns.");
74 return info_duration(base, base);
78 set_blessed(player_ptr, randint1(base) + base, false);
85 return _("軽傷", "Cause Light Wounds");
88 return _("1体のモンスターに小ダメージを与える。抵抗されると無効。", "Wounds a monster a little unless resisted.");
91 DICE_NUMBER dice = 3 + (plev - 1) / 5;
95 return info_damage(dice, sides, 0);
99 if (!get_aim_dir(player_ptr, &dir)) {
102 fire_ball_hide(player_ptr, AttributeType::WOUNDS, dir, damroll(dice, sides), 0);
109 return _("光の召喚", "Call Light");
112 return _("光源が照らしている範囲か部屋全体を永久に明るくする。", "Lights up nearby area and the inside of a room permanently.");
115 DICE_NUMBER dice = 2;
116 DICE_SID sides = plev / 2;
117 POSITION rad = plev / 10 + 1;
120 return info_damage(dice, sides, 0);
124 lite_area(player_ptr, damroll(dice, sides), rad);
131 return _("罠 & 隠し扉感知", "Detect Doors & Traps");
134 return _("近くの全ての罠と扉と階段を感知する。", "Detects traps, doors, and stairs in your vicinity.");
137 POSITION rad = DETECT_RAD_DEFAULT;
140 return info_radius(rad);
144 detect_traps(player_ptr, rad, true);
145 detect_doors(player_ptr, rad);
146 detect_stairs(player_ptr, rad);
153 return _("重傷の治癒", "Cure Medium Wounds");
156 return _("怪我と体力を中程度回復させる。", "Heals cuts and HP more.");
159 DICE_NUMBER dice = 4;
163 return info_heal(dice, sides, 0);
166 (void)cure_serious_wounds(player_ptr, dice, sides);
173 return _("解毒", "Cure Poison");
177 return _("体内の毒を取り除く。", "Cures yourself of any poisons.");
181 (void)BadStatusSetter(player_ptr).poison(0);
188 return _("空腹充足", "Satisfy Hunger");
191 return _("満腹にする。", "Satisfies hunger.");
195 set_food(player_ptr, PY_FOOD_MAX - 1);
202 return _("解呪", "Remove Curse");
205 return _("アイテムにかかった弱い呪いを解除する。", "Removes normal curses from equipped items.");
209 (void)remove_curse(player_ptr);
216 return _("重傷", "Cause Medium Wounds");
219 return _("1体のモンスターに中ダメージを与える。抵抗されると無効。", "Wounds a monster unless resisted.");
222 DICE_SID sides = 8 + (plev - 5) / 4;
223 DICE_NUMBER dice = 8;
226 return info_damage(dice, sides, 0);
230 if (!get_aim_dir(player_ptr, &dir)) {
233 fire_ball_hide(player_ptr, AttributeType::WOUNDS, dir, damroll(dice, sides), 0);
240 return _("致命傷の治癒", "Cure Critical Wounds");
243 return _("体力を大幅に回復させ、負傷と朦朧状態も全快する。", "Heals HP greatly. Also cures cuts and being stunned.");
246 DICE_NUMBER dice = 8;
250 return info_heal(dice, sides, 0);
253 (void)cure_critical_wounds(player_ptr, damroll(dice, sides));
260 return _("耐熱耐寒", "Resist Heat and Cold");
263 return _("一定時間、火炎と冷気に対する耐性を得る。装備による耐性に累積する。",
264 "Gives resistance to fire and cold. These resistances can be added to those from equipment for more powerful resistances.");
271 return info_duration(base, base);
275 set_oppose_cold(player_ptr, randint1(base) + base, false);
276 set_oppose_fire(player_ptr, randint1(base) + base, false);
283 return _("周辺感知", "Sense Surroundings");
286 return _("周辺の地形を感知する。", "Maps nearby area.");
290 POSITION rad = DETECT_RAD_MAP;
293 return info_radius(rad);
297 map_area(player_ptr, rad);
304 return _("パニック・アンデッド", "Turn Undead");
307 return _("視界内のアンデッドを恐怖させる。抵抗されると無効。", "Attempts to scare undead monsters in sight.");
312 turn_undead(player_ptr);
319 return _("体力回復", "Healing");
322 return _("極めて強力な回復呪文で、負傷と朦朧状態も全快する。", "Is very powerful healing magic. Also completely cures cuts and being stunned.");
328 return info_heal(0, 0, heal);
331 (void)cure_critical_wounds(player_ptr, heal);
338 return _("結界の紋章", "Rune of Protection");
341 return _("自分のいる床の上に、モンスターが通り抜けたり召喚されたりすることができなくなるルーンを描く。",
342 "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.");
347 create_rune_protection_one(player_ptr);
354 return _("*解呪*", "Dispel Curse");
357 return _("アイテムにかかった強力な呪いを解除する。", "Removes normal and heavy curses from equipped items.");
361 (void)remove_all_curse(player_ptr);
368 return _("鑑識", "Perception");
371 return _("アイテムを識別する。", "Identifies an item.");
376 if (!ident_spell(player_ptr, false)) {
385 return _("アンデッド退散", "Dispel Undead");
388 return _("視界内の全てのアンデッドにダメージを与える。", "Damages all undead monsters in sight.");
392 DICE_NUMBER dice = 1;
393 DICE_SID sides = plev * 5;
396 return info_damage(dice, sides, 0);
400 dispel_undead(player_ptr, damroll(dice, sides));
407 return _("凪の刻", "Day of the Dove");
410 return _("視界内の全てのモンスターを魅了する。抵抗されると無効。", "Attempts to charm all monsters in sight.");
414 int power = plev * 2;
417 return info_power(power);
421 charm_monsters(player_ptr, power);
428 return _("致命傷", "Cause Critical Wounds");
431 return _("1体のモンスターに大ダメージを与える。抵抗されると無効。", "Wounds a monster critically unless resisted.");
435 DICE_NUMBER dice = 5 + (plev - 5) / 3;
439 return info_damage(dice, sides, 0);
443 if (!get_aim_dir(player_ptr, &dir)) {
446 fire_ball_hide(player_ptr, AttributeType::WOUNDS, dir, damroll(dice, sides), 0);
453 return _("帰還の詔", "Word of Recall");
456 return _("地上にいるときはダンジョンの最深階へ、ダンジョンにいるときは地上へと移動する。",
457 "Recalls player from dungeon to town or from town to the deepest level of dungeon.");
465 return info_delay(base, sides);
469 if (!recall_player(player_ptr, randint0(21) + 15)) {
478 return _("真実の祭壇", "Alter Reality");
481 return _("現在の階を再構成する。", "Recreates current dungeon level.");
489 return info_delay(base, sides);
493 reserve_alter_reality(player_ptr, randint0(sides) + base);
500 return _("真・結界", "Warding True");
503 return _("自分のいる床と周囲8マスの床の上に、モンスターが通り抜けたり召喚されたりすることができなくなるルーンを描く。",
504 "Creates runes in all adjacent squares and under you.");
511 return info_radius(rad);
515 create_rune_protection_one(player_ptr);
516 create_rune_protection_area(player_ptr, player_ptr->y, player_ptr->x);
523 return _("不毛化", "Sterilization");
526 return _("この階の増殖するモンスターが増殖できなくなる。", "Prevents any breeders on current level from breeding.");
531 player_ptr->current_floor_ptr->num_repro += MAX_REPRO;
538 return _("全感知", "Detection");
541 return _("近くの全てのモンスター、罠、扉、階段、財宝、そしてアイテムを感知する。",
542 "Detects all monsters, traps, doors, stairs, treasures and items in your vicinity.");
546 POSITION rad = DETECT_RAD_DEFAULT;
549 return info_radius(rad);
553 detect_all(player_ptr, rad);
560 return _("アンデッド消滅", "Annihilate Undead");
563 return _("自分の周囲にいるアンデッドを現在の階から消し去る。抵抗されると無効。",
564 "Eliminates all nearby undead monsters, exhausting you. Powerful or unique monsters may be able to resist.");
568 int power = plev + 50;
571 return info_power(power);
575 mass_genocide_undead(player_ptr, power, true);
582 return _("千里眼", "Clairvoyance");
585 return _("その階全体を永久に照らし、ダンジョン内すべてのアイテムを感知する。",
586 "Maps and lights whole dungeon level. Knows all objects location. And gives telepathy for a while.");
591 wiz_lite(player_ptr, false);
598 return _("全復活", "Restoration");
601 return _("すべてのステータスと経験値を回復する。", "Restores all stats and experience.");
606 (void)restore_all_status(player_ptr);
607 restore_level(player_ptr);
614 return _("*体力回復*", "Healing True");
617 return _("最強の治癒の魔法で、負傷と朦朧状態も全快する。", "Is the greatest healing magic. Heals all HP, cuts and being stunned.");
623 return info_heal(0, 0, heal);
626 (void)cure_critical_wounds(player_ptr, heal);
633 return _("聖なるビジョン", "Holy Vision");
636 return _("アイテムの持つ能力を完全に知る。", "*Identifies* an item.");
641 if (!identify_fully(player_ptr, false)) {
650 return _("究極の耐性", "Ultimate Resistance");
653 return _("一定時間、あらゆる耐性を付け、ACと魔法防御能力を上昇させる。", "Gives ultimate resistance, bonus to AC and speed.");
657 TIME_EFFECT base = (TIME_EFFECT)plev / 2;
660 return info_duration(base, base);
664 TIME_EFFECT v = randint1(base) + base;
665 set_acceleration(player_ptr, v, false);
666 set_oppose_acid(player_ptr, v, false);
667 set_oppose_elec(player_ptr, v, false);
668 set_oppose_fire(player_ptr, v, false);
669 set_oppose_cold(player_ptr, v, false);
670 set_oppose_pois(player_ptr, v, false);
671 set_ultimate_res(player_ptr, v, false);