2 * @brief ダイス目により様々な効果を及ぼす魔法の処理
7 #include "spell-kind/spells-random.h"
8 #include "core/hp-mp-processor.h"
9 #include "effect/effect-characteristics.h"
10 #include "floor/floor.h"
11 #include "io/targeting.h"
12 #include "main/sound-definitions-table.h"
13 #include "main/sound-of-music.h"
14 #include "monster-floor/monster-summon.h"
15 #include "monster-floor/place-monster-types.h"
16 #include "mutation/mutation.h"
17 #include "player/avatar.h"
18 #include "status/bad-status-setter.h"
19 #include "player/player-damage.h"
20 #include "spell-kind/earthquake.h"
21 #include "spell-kind/spells-equipment.h"
22 #include "spell-kind/spells-floor.h"
23 #include "spell-kind/spells-genocide.h"
24 #include "spell-kind/spells-launcher.h"
25 #include "spell-kind/spells-lite.h"
26 #include "spell-kind/spells-neighbor.h"
27 #include "spell-kind/spells-sight.h"
28 #include "spell-kind/spells-specific-bolt.h"
29 #include "spell-kind/spells-teleport.h"
30 #include "spell/process-effect.h"
31 #include "spell/spells-diceroll.h"
32 #include "spell/spells-status.h"
33 #include "spell/spells-summon.h"
34 #include "spell/spell-types.h"
35 #include "status/base-status.h"
36 #include "status/experience.h"
37 #include "view/display-messages.h"
41 * @return 作用が実際にあった場合TRUEを返す
43 void call_chaos(player_type *caster_ptr)
45 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,
46 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,
47 GF_ROCKET, GF_NUKE, GF_HELL_FIRE, GF_DISINTEGRATE, GF_PSY_SPEAR };
49 int chaos_type = hurt_types[randint0(31)];
50 bool line_chaos = FALSE;
56 for (int dummy = 1; dummy < 10; dummy++) {
59 fire_beam(caster_ptr, chaos_type, dummy, 150);
61 fire_ball(caster_ptr, chaos_type, dummy, 150, 2);
69 fire_ball(caster_ptr, chaos_type, 0, 500, 8);
73 if (!get_aim_dir(caster_ptr, &dir))
76 fire_beam(caster_ptr, chaos_type, dir, 250);
78 fire_ball(caster_ptr, chaos_type, dir, 250, 3 + (caster_ptr->lev / 35));
82 * @brief TY_CURSE処理発動 / Activate the evil Topi Ylinen curse
83 * @param target_ptr プレーヤーへの参照ポインタ
84 * @param stop_ty 再帰処理停止フラグ
86 * @return 作用が実際にあった場合TRUEを返す
89 * rr9: Stop the nasty things when a Cyberdemon is summoned
90 * or the player gets paralyzed.
93 bool activate_ty_curse(player_type *target_ptr, bool stop_ty, int *count)
95 BIT_FLAGS flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
96 bool is_first_curse = TRUE;
97 floor_type *floor_ptr = target_ptr->current_floor_ptr;
98 while (is_first_curse || (one_in_(3) && !stop_ty)) {
99 is_first_curse = FALSE;
100 switch (randint1(34)) {
104 msg_print(_("地面が揺れた...", "The ground trembles..."));
105 earthquake(target_ptr, target_ptr->y, target_ptr->x, 5 + randint0(10), 0);
113 HIT_POINT dam = damroll(10, 10);
114 msg_print(_("純粋な魔力の次元への扉が開いた!", "A portal opens to a plane of raw mana!"));
115 project(target_ptr, 0, 8, target_ptr->y, target_ptr->x, dam, GF_MANA, flg, -1);
116 take_hit(target_ptr, DAMAGE_NOESCAPE, dam, _("純粋な魔力の解放", "released pure mana"), -1);
124 msg_print(_("周囲の空間が歪んだ!", "Space warps about you!"));
125 teleport_player(target_ptr, damroll(10, 10), TELEPORT_PASSIVE);
127 (*count) += activate_hi_summon(target_ptr, target_ptr->y, target_ptr->x, FALSE);
133 msg_print(_("エネルギーのうねりを感じた!", "You feel a surge of energy!"));
134 wall_breaker(target_ptr);
136 project(target_ptr, 0, 7, target_ptr->y, target_ptr->x, 50, GF_KILL_WALL, flg, -1);
137 take_hit(target_ptr, DAMAGE_NOESCAPE, 50, _("エネルギーのうねり", "surge of energy"), -1);
148 aggravate_monsters(target_ptr, 0);
155 (*count) += activate_hi_summon(target_ptr, target_ptr->y, target_ptr->x, FALSE);
163 (*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));
170 msg_print(_("経験値が体から吸い取られた気がする!", "You feel your experience draining away..."));
171 lose_exp(target_ptr, target_ptr->exp / 16);
180 bool is_statue = stop_ty;
181 is_statue |= target_ptr->free_act && (randint1(125) < target_ptr->skill_sav);
182 is_statue |= target_ptr->pclass == CLASS_BERSERKER;
184 msg_print(_("彫像になった気分だ!", "You feel like a statue!"));
185 if (target_ptr->free_act)
186 set_paralyzed(target_ptr, target_ptr->paralyzed + randint1(3));
188 set_paralyzed(target_ptr, target_ptr->paralyzed + randint1(13));
199 (void)do_dec_stat(target_ptr, randint0(6));
204 msg_print(_("ほえ?私は誰?ここで何してる?", "Huh? Who am I? What am I doing here?"));
205 lose_all_info(target_ptr);
210 if ((floor_ptr->dun_level > 65) && !stop_ty) {
211 (*count) += summon_cyber(target_ptr, -1, target_ptr->y, target_ptr->x);
220 for (int i = 0; i < A_MAX; i++) {
221 bool is_first_dec_stat = TRUE;
222 while (is_first_dec_stat || one_in_(2)) {
223 is_first_dec_stat = FALSE;
224 (void)do_dec_stat(target_ptr, i);
234 * @brief 『一つの指輪』の効果処理 /
235 * Hack -- activate the ring of power
236 * @param caster_ptr プレーヤーへの参照ポインタ
240 void ring_of_power(player_type *caster_ptr, DIRECTION dir)
242 switch (randint1(10)) {
245 msg_print(_("あなたは悪性のオーラに包み込まれた。", "You are surrounded by a malignant aura."));
248 /* Decrease all stats (permanently) */
249 (void)dec_stat(caster_ptr, A_STR, 50, TRUE);
250 (void)dec_stat(caster_ptr, A_INT, 50, TRUE);
251 (void)dec_stat(caster_ptr, A_WIS, 50, TRUE);
252 (void)dec_stat(caster_ptr, A_DEX, 50, TRUE);
253 (void)dec_stat(caster_ptr, A_CON, 50, TRUE);
254 (void)dec_stat(caster_ptr, A_CHR, 50, TRUE);
256 /* Lose some experience (permanently) */
257 caster_ptr->exp -= (caster_ptr->exp / 4);
258 caster_ptr->max_exp -= (caster_ptr->exp / 4);
259 check_experience(caster_ptr);
265 msg_print(_("あなたは強力なオーラに包み込まれた。", "You are surrounded by a powerful aura."));
266 dispel_monsters(caster_ptr, 1000);
273 fire_ball(caster_ptr, GF_MANA, dir, 600, 3);
281 fire_bolt(caster_ptr, GF_MANA, dir, 500);
288 * @brief 運命の輪、並びにカオス的な効果の発動
289 * @param caster_ptr プレーヤーへの参照ポインタ
290 * @param spell ランダムな効果を選択するための基準ID
293 void wild_magic(player_type *caster_ptr, int spell)
295 int type = SUMMON_MOLD + randint0(6);
296 if (type < SUMMON_MOLD)
298 else if (type > SUMMON_MIMIC)
301 floor_type *floor_ptr = caster_ptr->current_floor_ptr;
302 switch (randint1(spell) + randint1(8) + 1) {
306 teleport_player(caster_ptr, 10, TELEPORT_PASSIVE);
311 teleport_player(caster_ptr, 100, TELEPORT_PASSIVE);
315 teleport_player(caster_ptr, 200, TELEPORT_PASSIVE);
320 unlite_area(caster_ptr, 10, 3);
325 lite_area(caster_ptr, damroll(2, 3), 2);
328 destroy_doors_touch(caster_ptr);
332 wall_breaker(caster_ptr);
335 sleep_monsters_touch(caster_ptr);
339 trap_creation(caster_ptr, caster_ptr->y, caster_ptr->x);
343 door_creation(caster_ptr, caster_ptr->y, caster_ptr->x);
348 aggravate_monsters(caster_ptr, 0);
351 earthquake(caster_ptr, caster_ptr->y, caster_ptr->x, 5, 0);
355 (void)gain_mutation(caster_ptr, 0);
359 apply_disenchant(caster_ptr, 1);
362 lose_all_info(caster_ptr);
365 fire_ball(caster_ptr, GF_CHAOS, 0, spell + 5, 1 + (spell / 10));
368 wall_stone(caster_ptr);
372 for (int counter = 0; counter < 8; counter++) {
373 (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));
379 activate_hi_summon(caster_ptr, caster_ptr->y, caster_ptr->x, FALSE);
382 (void)summon_cyber(caster_ptr, -1, caster_ptr->y, caster_ptr->x);
386 (void)activate_ty_curse(caster_ptr, FALSE, &count);
393 * @brief 「ワンダー」のランダムな効果を決定して処理する。
394 * @param caster_ptr プレーヤーへの参照ポインタ
398 * This spell should become more useful (more controlled) as the\n
399 * player gains experience levels. Thus, add 1/5 of the player's\n
400 * level to the die roll. This eliminates the worst effects later on,\n
401 * while keeping the results quite random. It also allows some potent\n
402 * effects only at high level.
404 void cast_wonder(player_type *caster_ptr, DIRECTION dir)
406 PLAYER_LEVEL plev = caster_ptr->lev;
407 int die = randint1(100) + plev / 5;
408 int vir = virtue_number(caster_ptr, V_CHANCE);
410 if (caster_ptr->virtues[vir - 1] > 0) {
411 while (randint1(400) < caster_ptr->virtues[vir - 1])
414 while (randint1(400) < (0 - caster_ptr->virtues[vir - 1]))
420 chg_virtue(caster_ptr, V_CHANCE, 1);
424 msg_print(_("あなたは力がみなぎるのを感じた!", "You feel a surge of power!"));
428 clone_monster(caster_ptr, dir);
433 speed_monster(caster_ptr, dir, plev);
438 heal_monster(caster_ptr, dir, damroll(4, 6));
443 poly_monster(caster_ptr, dir, plev);
448 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr) - 10, GF_MISSILE, dir, damroll(3 + ((plev - 1) / 5), 4));
453 confuse_monster(caster_ptr, dir, plev);
458 fire_ball(caster_ptr, GF_POIS, dir, 20 + (plev / 2), 3);
463 (void)lite_line(caster_ptr, dir, damroll(6, 8));
468 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr) - 10, GF_ELEC, dir, damroll(3 + ((plev - 5) / 4), 8));
473 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr) - 10, GF_COLD, dir, damroll(5 + ((plev - 5) / 4), 8));
478 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr), GF_ACID, dir, damroll(6 + ((plev - 5) / 4), 8));
483 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr), GF_FIRE, dir, damroll(8 + ((plev - 5) / 4), 8));
488 hypodynamic_bolt(caster_ptr, dir, 75);
493 fire_ball(caster_ptr, GF_ELEC, dir, 30 + plev / 2, 2);
498 fire_ball(caster_ptr, GF_ACID, dir, 40 + plev, 2);
503 fire_ball(caster_ptr, GF_ICE, dir, 70 + plev, 3);
508 fire_ball(caster_ptr, GF_FIRE, dir, 80 + plev, 3);
513 hypodynamic_bolt(caster_ptr, dir, 100 + plev);
518 earthquake(caster_ptr, caster_ptr->y, caster_ptr->x, 12, 0);
523 (void)destroy_area(caster_ptr, caster_ptr->y, caster_ptr->x, 13 + randint0(5), FALSE);
528 symbol_genocide(caster_ptr, plev + 50, TRUE);
533 dispel_monsters(caster_ptr, 120);
537 dispel_monsters(caster_ptr, 150);
538 slow_monsters(caster_ptr, plev);
539 sleep_monsters(caster_ptr, plev);
540 hp_player(caster_ptr, 300);