2 * @brief ダイス目により様々な効果を及ぼす魔法の処理
7 #include "spell-kind/spells-random.h"
8 #include "core/hp-mp-processor.h"
9 #include "effect/effect-characteristics.h"
10 #include "effect/effect-processor.h"
11 #include "monster-floor/monster-summon.h"
12 #include "monster-floor/place-monster-types.h"
13 #include "mutation/mutation-investor-remover.h"
14 #include "player-info/avatar.h"
15 #include "player/player-damage.h"
16 #include "spell-kind/earthquake.h"
17 #include "spell-kind/spells-equipment.h"
18 #include "spell-kind/spells-floor.h"
19 #include "spell-kind/spells-genocide.h"
20 #include "spell-kind/spells-launcher.h"
21 #include "spell-kind/spells-lite.h"
22 #include "spell-kind/spells-neighbor.h"
23 #include "spell-kind/spells-sight.h"
24 #include "spell-kind/spells-specific-bolt.h"
25 #include "spell-kind/spells-teleport.h"
26 #include "spell/spell-types.h"
27 #include "spell/spells-diceroll.h"
28 #include "spell/spells-status.h"
29 #include "spell/spells-summon.h"
30 #include "spell/summon-types.h"
31 #include "status/bad-status-setter.h"
32 #include "status/base-status.h"
33 #include "status/experience.h"
34 #include "system/floor-type-definition.h"
35 #include "target/target-getter.h"
36 #include "view/display-messages.h"
40 * @return 作用が実際にあった場合TRUEを返す
42 void call_chaos(player_type *caster_ptr)
44 int hurt_types[31] = { GF_ELEC, GF_POIS, GF_ACID, GF_COLD, GF_FIRE, GF_MISSILE, GF_ARROW, GF_PLASMA, GF_HOLY_FIRE, GF_WATER, GF_LITE, GF_DARK, GF_FORCE,
45 GF_INERTIAL, GF_MANA, GF_METEOR, GF_ICE, GF_CHAOS, GF_NETHER, GF_DISENCHANT, GF_SHARDS, GF_SOUND, GF_NEXUS, GF_CONFUSION, GF_TIME, GF_GRAVITY,
46 GF_ROCKET, GF_NUKE, GF_HELL_FIRE, GF_DISINTEGRATE, GF_PSY_SPEAR };
48 int chaos_type = hurt_types[randint0(31)];
49 bool line_chaos = FALSE;
55 for (int dummy = 1; dummy < 10; dummy++) {
58 fire_beam(caster_ptr, chaos_type, dummy, 150);
60 fire_ball(caster_ptr, chaos_type, dummy, 150, 2);
68 fire_ball(caster_ptr, chaos_type, 0, 500, 8);
72 if (!get_aim_dir(caster_ptr, &dir))
75 fire_beam(caster_ptr, chaos_type, dir, 250);
77 fire_ball(caster_ptr, chaos_type, dir, 250, 3 + (caster_ptr->lev / 35));
81 * @brief TY_CURSE処理発動 / Activate the evil Topi Ylinen curse
82 * @param target_ptr プレーヤーへの参照ポインタ
83 * @param stop_ty 再帰処理停止フラグ
85 * @return 作用が実際にあった場合TRUEを返す
88 * rr9: Stop the nasty things when a Cyberdemon is summoned
89 * or the player gets paralyzed.
92 bool activate_ty_curse(player_type *target_ptr, bool stop_ty, int *count)
94 BIT_FLAGS flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
95 bool is_first_curse = TRUE;
96 floor_type *floor_ptr = target_ptr->current_floor_ptr;
97 while (is_first_curse || (one_in_(3) && !stop_ty)) {
98 is_first_curse = FALSE;
99 switch (randint1(34)) {
103 msg_print(_("地面が揺れた...", "The ground trembles..."));
104 earthquake(target_ptr, target_ptr->y, target_ptr->x, 5 + randint0(10), 0);
112 HIT_POINT dam = damroll(10, 10);
113 msg_print(_("純粋な魔力の次元への扉が開いた!", "A portal opens to a plane of raw mana!"));
114 project(target_ptr, 0, 8, target_ptr->y, target_ptr->x, dam, GF_MANA, flg, -1);
115 take_hit(target_ptr, DAMAGE_NOESCAPE, dam, _("純粋な魔力の解放", "released pure mana"), -1);
123 msg_print(_("周囲の空間が歪んだ!", "Space warps about you!"));
124 teleport_player(target_ptr, damroll(10, 10), TELEPORT_PASSIVE);
126 (*count) += activate_hi_summon(target_ptr, target_ptr->y, target_ptr->x, FALSE);
132 msg_print(_("エネルギーのうねりを感じた!", "You feel a surge of energy!"));
133 wall_breaker(target_ptr);
135 project(target_ptr, 0, 7, target_ptr->y, target_ptr->x, 50, GF_KILL_WALL, flg, -1);
136 take_hit(target_ptr, DAMAGE_NOESCAPE, 50, _("エネルギーのうねり", "surge of energy"), -1);
147 aggravate_monsters(target_ptr, 0);
154 (*count) += activate_hi_summon(target_ptr, target_ptr->y, target_ptr->x, FALSE);
162 (*count) += summon_specific(target_ptr, 0, target_ptr->y, target_ptr->x, floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
169 msg_print(_("経験値が体から吸い取られた気がする!", "You feel your experience draining away..."));
170 lose_exp(target_ptr, target_ptr->exp / 16);
179 bool is_statue = stop_ty;
180 is_statue |= target_ptr->free_act && (randint1(125) < target_ptr->skill_sav);
181 is_statue |= target_ptr->pclass == CLASS_BERSERKER;
183 msg_print(_("彫像になった気分だ!", "You feel like a statue!"));
184 if (target_ptr->free_act)
185 set_paralyzed(target_ptr, target_ptr->paralyzed + randint1(3));
187 set_paralyzed(target_ptr, target_ptr->paralyzed + randint1(13));
198 (void)do_dec_stat(target_ptr, randint0(6));
203 msg_print(_("ほえ?私は誰?ここで何してる?", "Huh? Who am I? What am I doing here?"));
204 lose_all_info(target_ptr);
209 if ((floor_ptr->dun_level > 65) && !stop_ty) {
210 (*count) += summon_cyber(target_ptr, -1, target_ptr->y, target_ptr->x);
219 for (int i = 0; i < A_MAX; i++) {
220 bool is_first_dec_stat = TRUE;
221 while (is_first_dec_stat || one_in_(2)) {
222 is_first_dec_stat = FALSE;
223 (void)do_dec_stat(target_ptr, i);
233 * @brief 運命の輪、並びにカオス的な効果の発動
234 * @param caster_ptr プレーヤーへの参照ポインタ
235 * @param spell ランダムな効果を選択するための基準ID
238 void wild_magic(player_type *caster_ptr, int spell)
240 int type = SUMMON_MOLD + randint0(6);
241 if (type < SUMMON_MOLD)
243 else if (type > SUMMON_MIMIC)
246 floor_type *floor_ptr = caster_ptr->current_floor_ptr;
247 switch (randint1(spell) + randint1(8) + 1) {
251 teleport_player(caster_ptr, 10, TELEPORT_PASSIVE);
256 teleport_player(caster_ptr, 100, TELEPORT_PASSIVE);
260 teleport_player(caster_ptr, 200, TELEPORT_PASSIVE);
265 unlite_area(caster_ptr, 10, 3);
270 lite_area(caster_ptr, damroll(2, 3), 2);
273 destroy_doors_touch(caster_ptr);
277 wall_breaker(caster_ptr);
280 sleep_monsters_touch(caster_ptr);
284 trap_creation(caster_ptr, caster_ptr->y, caster_ptr->x);
288 door_creation(caster_ptr, caster_ptr->y, caster_ptr->x);
293 aggravate_monsters(caster_ptr, 0);
296 earthquake(caster_ptr, caster_ptr->y, caster_ptr->x, 5, 0);
300 (void)gain_mutation(caster_ptr, 0);
304 apply_disenchant(caster_ptr, 1);
307 lose_all_info(caster_ptr);
310 fire_ball(caster_ptr, GF_CHAOS, 0, spell + 5, 1 + (spell / 10));
313 wall_stone(caster_ptr);
317 for (int counter = 0; counter < 8; counter++) {
318 (void)summon_specific(caster_ptr, 0, caster_ptr->y, caster_ptr->x, (floor_ptr->dun_level * 3) / 2, type, (PM_ALLOW_GROUP | PM_NO_PET));
324 activate_hi_summon(caster_ptr, caster_ptr->y, caster_ptr->x, FALSE);
327 (void)summon_cyber(caster_ptr, -1, caster_ptr->y, caster_ptr->x);
331 (void)activate_ty_curse(caster_ptr, FALSE, &count);
338 * @brief 「ワンダー」のランダムな効果を決定して処理する。
339 * @param caster_ptr プレーヤーへの参照ポインタ
343 * This spell should become more useful (more controlled) as the\n
344 * player gains experience levels. Thus, add 1/5 of the player's\n
345 * level to the die roll. This eliminates the worst effects later on,\n
346 * while keeping the results quite random. It also allows some potent\n
347 * effects only at high level.
349 void cast_wonder(player_type *caster_ptr, DIRECTION dir)
351 PLAYER_LEVEL plev = caster_ptr->lev;
352 int die = randint1(100) + plev / 5;
353 int vir = virtue_number(caster_ptr, V_CHANCE);
355 if (caster_ptr->virtues[vir - 1] > 0) {
356 while (randint1(400) < caster_ptr->virtues[vir - 1])
359 while (randint1(400) < (0 - caster_ptr->virtues[vir - 1]))
365 chg_virtue(caster_ptr, V_CHANCE, 1);
369 msg_print(_("あなたは力がみなぎるのを感じた!", "You feel a surge of power!"));
373 clone_monster(caster_ptr, dir);
378 speed_monster(caster_ptr, dir, plev);
383 heal_monster(caster_ptr, dir, damroll(4, 6));
388 poly_monster(caster_ptr, dir, plev);
393 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr) - 10, GF_MISSILE, dir, damroll(3 + ((plev - 1) / 5), 4));
398 confuse_monster(caster_ptr, dir, plev);
403 fire_ball(caster_ptr, GF_POIS, dir, 20 + (plev / 2), 3);
408 (void)lite_line(caster_ptr, dir, damroll(6, 8));
413 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr) - 10, GF_ELEC, dir, damroll(3 + ((plev - 5) / 4), 8));
418 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr) - 10, GF_COLD, dir, damroll(5 + ((plev - 5) / 4), 8));
423 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr), GF_ACID, dir, damroll(6 + ((plev - 5) / 4), 8));
428 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr), GF_FIRE, dir, damroll(8 + ((plev - 5) / 4), 8));
433 hypodynamic_bolt(caster_ptr, dir, 75);
438 fire_ball(caster_ptr, GF_ELEC, dir, 30 + plev / 2, 2);
443 fire_ball(caster_ptr, GF_ACID, dir, 40 + plev, 2);
448 fire_ball(caster_ptr, GF_ICE, dir, 70 + plev, 3);
453 fire_ball(caster_ptr, GF_FIRE, dir, 80 + plev, 3);
458 hypodynamic_bolt(caster_ptr, dir, 100 + plev);
463 earthquake(caster_ptr, caster_ptr->y, caster_ptr->x, 12, 0);
468 (void)destroy_area(caster_ptr, caster_ptr->y, caster_ptr->x, 13 + randint0(5), FALSE);
473 symbol_genocide(caster_ptr, plev + 50, TRUE);
478 dispel_monsters(caster_ptr, 120);
482 dispel_monsters(caster_ptr, 150);
483 slow_monsters(caster_ptr, plev);
484 sleep_monsters(caster_ptr, plev);
485 hp_player(caster_ptr, 300);