2 * @brief 魔法効果の実装/ Spell code
6 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
7 * This software may be copied and distributed for educational, research,
8 * and not for profit purposes provided that this copyright and statement
9 * are included in all such copies. Other copyrights may also apply.
13 #include "spell/spells2.h"
14 #include "cmd-action/cmd-attack.h"
15 #include "cmd-action/cmd-pet.h"
16 #include "cmd-io/cmd-dump.h"
17 #include "combat/combat-options-type.h"
18 #include "core/stuff-handler.h"
19 #include "dungeon/dungeon.h"
20 #include "dungeon/quest.h"
21 #include "effect/effect-characteristics.h"
22 #include "effect/spells-effect-util.h"
23 #include "floor/floor-events.h"
24 #include "floor/floor-object.h"
25 #include "grid/feature.h"
26 #include "grid/grid.h"
27 #include "inventory/player-inventory.h"
28 #include "io/targeting.h"
29 #include "io/write-diary.h"
30 #include "locale/english.h"
31 #include "main/sound-definitions-table.h"
32 #include "monster/creature.h"
33 #include "monster/monster-race.h"
34 #include "monster/monster-status.h"
35 #include "mutation/mutation.h"
36 #include "object-enchant/item-feeling.h"
37 #include "object/item-use-flags.h"
38 #include "perception/object-perception.h"
39 #include "object/object-flavor.h"
40 #include "object/object-generator.h"
41 #include "object/object-kind-hook.h"
42 #include "object/object-mark-types.h"
43 #include "object-enchant/special-object-flags.h"
44 #include "pet/pet-fall-off.h"
45 #include "pet/pet-util.h"
46 #include "perception/simple-perception.h"
47 #include "player/avatar.h"
48 #include "player/player-class.h"
49 #include "player/player-damage.h"
50 #include "player/player-effects.h"
51 #include "player/player-skill.h"
52 #include "player/player-status.h"
53 #include "spell/process-effect.h"
54 #include "spell/spells-diceroll.h"
55 #include "spell/spells-floor.h"
56 #include "spell/spells-genocide.h"
57 #include "spell/spells-launcher.h"
58 #include "spell/spells-lite.h"
59 #include "spell/spells-sight.h"
60 #include "spell/spells-status.h"
61 #include "spell/spells-summon.h"
62 #include "spell/spells-teleport.h"
63 #include "spell/spells-type.h"
64 #include "spell/range-calc.h"
65 #include "spell/spells3.h"
66 #include "sv-definition/sv-food-types.h"
67 #include "system/system-variables.h"
68 #include "util/util.h"
69 #include "view/display-main-window.h"
70 #include "world/world.h"
74 * @param caster_ptr プレーヤーへの参照ポインタ
75 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
77 * @return 作用が実際にあった場合TRUEを返す
79 bool hypodynamic_bolt(player_type *caster_ptr, DIRECTION dir, HIT_POINT dam)
81 BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
82 return (project_hook(caster_ptr, GF_HYPODYNAMIA, dir, dam, flg));
88 * @param caster_ptr プレーヤーへの参照ポインタ
89 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
91 * @return 作用が実際にあった場合TRUEを返す
93 bool wall_to_mud(player_type *caster_ptr, DIRECTION dir, HIT_POINT dam)
95 BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
96 return (project_hook(caster_ptr, GF_KILL_WALL, dir, dam, flg));
102 * @param caster_ptr プレーヤーへの参照ポインタ
103 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
104 * @return 作用が実際にあった場合TRUEを返す
106 bool wizard_lock(player_type *caster_ptr, DIRECTION dir)
108 BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
109 return (project_hook(caster_ptr, GF_JAM_DOOR, dir, 20 + randint1(30), flg));
115 * @param caster_ptr プレーヤーへの参照ポインタ
116 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
117 * @return 作用が実際にあった場合TRUEを返す
119 bool destroy_door(player_type *caster_ptr, DIRECTION dir)
121 BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM;
122 return (project_hook(caster_ptr, GF_KILL_DOOR, dir, 0, flg));
128 * @param caster_ptr プレーヤーへの参照ポインタ
129 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
130 * @return 作用が実際にあった場合TRUEを返す
132 bool disarm_trap(player_type *caster_ptr, DIRECTION dir)
134 BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM;
135 return (project_hook(caster_ptr, GF_KILL_TRAP, dir, 0, flg));
141 * @param caster_ptr プレーヤーへの参照ポインタ
142 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
143 * @param plev プレイヤーレベル(効力はplev*200)
144 * @return 作用が実際にあった場合TRUEを返す
146 bool death_ray(player_type *caster_ptr, DIRECTION dir, PLAYER_LEVEL plev)
148 BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
149 return (project_hook(caster_ptr, GF_DEATH_RAY, dir, plev * 200, flg));
154 * @brief ドア生成処理(プレイヤー中心に周囲1マス) / Hooks -- affect adjacent grids (radius 1 ball attack)
155 * @param caster_ptr プレーヤーへの参照ポインタ
156 * @return 作用が実際にあった場合TRUEを返す
158 bool door_creation(player_type *caster_ptr, POSITION y, POSITION x)
160 BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
161 return (project(caster_ptr, 0, 1, y, x, 0, GF_MAKE_DOOR, flg, -1));
166 * @brief トラップ生成処理(起点から周囲1マス)
167 * @param caster_ptr プレーヤーへの参照ポインタ
170 * @return 作用が実際にあった場合TRUEを返す
172 bool trap_creation(player_type *caster_ptr, POSITION y, POSITION x)
174 BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
175 return (project(caster_ptr, 0, 1, y, x, 0, GF_MAKE_TRAP, flg, -1));
180 * @brief 森林生成処理(プレイヤー中心に周囲1マス)
181 * @param caster_ptr プレーヤーへの参照ポインタ
182 * @return 作用が実際にあった場合TRUEを返す
184 bool tree_creation(player_type *caster_ptr, POSITION y, POSITION x)
186 BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
187 return (project(caster_ptr, 0, 1, y, x, 0, GF_MAKE_TREE, flg, -1));
192 * @brief 魔法のルーン生成処理(プレイヤー中心に周囲1マス)
193 * @param caster_ptr プレーヤーへの参照ポインタ
194 * @return 作用が実際にあった場合TRUEを返す
196 bool glyph_creation(player_type *caster_ptr, POSITION y, POSITION x)
198 BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM;
199 return (project(caster_ptr, 0, 1, y, x, 0, GF_MAKE_GLYPH, flg, -1));
204 * @brief 壁生成処理(プレイヤー中心に周囲1マス)
205 * @param caster_ptr プレーヤーへの参照ポインタ
206 * @return 作用が実際にあった場合TRUEを返す
208 bool wall_stone(player_type *caster_ptr)
210 BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
211 bool dummy = (project(caster_ptr, 0, 1, caster_ptr->y, caster_ptr->x, 0, GF_STONE_WALL, flg, -1));
212 caster_ptr->update |= (PU_FLOW);
213 caster_ptr->redraw |= (PR_MAP);
219 * @brief ドア破壊処理(プレイヤー中心に周囲1マス)
220 * @param caster_ptr プレーヤーへの参照ポインタ
221 * @return 作用が実際にあった場合TRUEを返す
223 bool destroy_doors_touch(player_type *caster_ptr)
225 BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
226 return (project(caster_ptr, 0, 1, caster_ptr->y, caster_ptr->x, 0, GF_KILL_DOOR, flg, -1));
231 * @brief トラップ解除処理(プレイヤー中心に周囲1マス)
232 * @param caster_ptr プレーヤーへの参照ポインタ
233 * @return 作用が実際にあった場合TRUEを返す
235 bool disarm_traps_touch(player_type *caster_ptr)
237 BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
238 return (project(caster_ptr, 0, 1, caster_ptr->y, caster_ptr->x, 0, GF_KILL_TRAP, flg, -1));
243 * @brief スリープモンスター処理(プレイヤー中心に周囲1マス)
244 * @param caster_ptr プレーヤーへの参照ポインタ
245 * @return 作用が実際にあった場合TRUEを返す
247 bool sleep_monsters_touch(player_type *caster_ptr)
249 BIT_FLAGS flg = PROJECT_KILL | PROJECT_HIDE;
250 return (project(caster_ptr, 0, 1, caster_ptr->y, caster_ptr->x, caster_ptr->lev, GF_OLD_SLEEP, flg, -1));
255 * @brief 死者復活処理(起点より周囲5マス)
256 * @param caster_ptr プレーヤーへの参照ポインタ
257 * @param who 術者モンスターID(0ならばプレイヤー)
260 * @return 作用が実際にあった場合TRUEを返す
262 bool animate_dead(player_type *caster_ptr, MONSTER_IDX who, POSITION y, POSITION x)
264 BIT_FLAGS flg = PROJECT_ITEM | PROJECT_HIDE;
265 return (project(caster_ptr, who, 5, y, x, 0, GF_ANIM_DEAD, flg, -1));
271 * @return 作用が実際にあった場合TRUEを返す
273 void call_chaos(player_type *caster_ptr)
277 GF_ELEC, GF_POIS, GF_ACID, GF_COLD,
278 GF_FIRE, GF_MISSILE, GF_ARROW, GF_PLASMA,
279 GF_HOLY_FIRE, GF_WATER, GF_LITE, GF_DARK,
280 GF_FORCE, GF_INERTIAL, GF_MANA, GF_METEOR,
281 GF_ICE, GF_CHAOS, GF_NETHER, GF_DISENCHANT,
282 GF_SHARDS, GF_SOUND, GF_NEXUS, GF_CONFUSION,
283 GF_TIME, GF_GRAVITY, GF_ROCKET, GF_NUKE,
284 GF_HELL_FIRE, GF_DISINTEGRATE, GF_PSY_SPEAR
287 int chaos_type = hurt_types[randint0(31)];
288 bool line_chaos = FALSE;
289 if (one_in_(4)) line_chaos = TRUE;
294 for (int dummy = 1; dummy < 10; dummy++)
299 fire_beam(caster_ptr, chaos_type, dummy, 150);
301 fire_ball(caster_ptr, chaos_type, dummy, 150, 2);
310 fire_ball(caster_ptr, chaos_type, 0, 500, 8);
314 if (!get_aim_dir(caster_ptr, &dir)) return;
316 fire_beam(caster_ptr, chaos_type, dir, 250);
318 fire_ball(caster_ptr, chaos_type, dir, 250, 3 + (caster_ptr->lev / 35));
323 * @brief TY_CURSE処理発動 / Activate the evil Topi Ylinen curse
324 * @param target_ptr プレーヤーへの参照ポインタ
325 * @param stop_ty 再帰処理停止フラグ
327 * @return 作用が実際にあった場合TRUEを返す
330 * rr9: Stop the nasty things when a Cyberdemon is summoned
331 * or the player gets paralyzed.
334 bool activate_ty_curse(player_type *target_ptr, bool stop_ty, int *count)
336 BIT_FLAGS flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
337 bool is_first_curse = TRUE;
338 floor_type *floor_ptr = target_ptr->current_floor_ptr;
339 while (is_first_curse || (one_in_(3) && !stop_ty))
341 is_first_curse = FALSE;
342 switch (randint1(34))
347 msg_print(_("地面が揺れた...", "The ground trembles..."));
348 earthquake(target_ptr, target_ptr->y, target_ptr->x, 5 + randint0(10), 0);
349 if (!one_in_(6)) break;
355 HIT_POINT dam = damroll(10, 10);
356 msg_print(_("純粋な魔力の次元への扉が開いた!", "A portal opens to a plane of raw mana!"));
357 project(target_ptr, 0, 8, target_ptr->y, target_ptr->x, dam, GF_MANA, flg, -1);
358 take_hit(target_ptr, DAMAGE_NOESCAPE, dam, _("純粋な魔力の解放", "released pure mana"), -1);
359 if (!one_in_(6)) break;
365 msg_print(_("周囲の空間が歪んだ!", "Space warps about you!"));
366 teleport_player(target_ptr, damroll(10, 10), TELEPORT_PASSIVE);
367 if (randint0(13)) (*count) += activate_hi_summon(target_ptr, target_ptr->y, target_ptr->x, FALSE);
368 if (!one_in_(6)) break;
372 msg_print(_("エネルギーのうねりを感じた!", "You feel a surge of energy!"));
373 wall_breaker(target_ptr);
376 project(target_ptr, 0, 7, target_ptr->y, target_ptr->x, 50, GF_KILL_WALL, flg, -1);
377 take_hit(target_ptr, DAMAGE_NOESCAPE, 50, _("エネルギーのうねり", "surge of energy"), -1);
380 if (!one_in_(6)) break;
382 case 1: case 2: case 3: case 16: case 17:
383 aggravate_monsters(target_ptr, 0);
384 if (!one_in_(6)) break;
386 case 4: case 5: case 6:
387 (*count) += activate_hi_summon(target_ptr, target_ptr->y, target_ptr->x, FALSE);
388 if (!one_in_(6)) break;
390 case 7: case 8: case 9: case 18:
391 (*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));
392 if (!one_in_(6)) break;
394 case 10: case 11: case 12:
395 msg_print(_("経験値が体から吸い取られた気がする!", "You feel your experience draining away..."));
396 lose_exp(target_ptr, target_ptr->exp / 16);
397 if (!one_in_(6)) break;
399 case 13: case 14: case 15: case 19: case 20:
401 bool is_statue = stop_ty;
402 is_statue |= target_ptr->free_act && (randint1(125) < target_ptr->skill_sav);
403 is_statue |= target_ptr->pclass == CLASS_BERSERKER;
406 msg_print(_("彫像になった気分だ!", "You feel like a statue!"));
407 if (target_ptr->free_act)
408 set_paralyzed(target_ptr, target_ptr->paralyzed + randint1(3));
410 set_paralyzed(target_ptr, target_ptr->paralyzed + randint1(13));
414 if (!one_in_(6)) break;
417 case 21: case 22: case 23:
418 (void)do_dec_stat(target_ptr, randint0(6));
419 if (!one_in_(6)) break;
422 msg_print(_("ほえ?私は誰?ここで何してる?", "Huh? Who am I? What am I doing here?"));
423 lose_all_info(target_ptr);
424 if (!one_in_(6)) break;
427 if ((floor_ptr->dun_level > 65) && !stop_ty)
429 (*count) += summon_cyber(target_ptr, -1, target_ptr->y, target_ptr->x);
434 if (!one_in_(6)) break;
437 for (int i = 0; i < A_MAX; i++)
439 bool is_first_dec_stat = TRUE;
440 while (is_first_dec_stat || one_in_(2))
442 is_first_dec_stat = FALSE;
443 (void)do_dec_stat(target_ptr, i);
454 * todo 引数にPOSITION x/yは必要か? 要調査
455 * @brief HI_SUMMON(上級召喚)処理発動
456 * @param caster_ptr プレーヤーへの参照ポインタ
459 * @param can_pet プレイヤーのペットとなる可能性があるならばTRUEにする
460 * @return 作用が実際にあった場合TRUEを返す
462 int activate_hi_summon(player_type *caster_ptr, POSITION y, POSITION x, bool can_pet)
464 BIT_FLAGS mode = PM_ALLOW_GROUP;
470 mode |= PM_FORCE_FRIENDLY;
474 mode |= PM_FORCE_PET;
479 if (!pet) mode |= PM_NO_PET;
481 DEPTH dungeon_level = caster_ptr->current_floor_ptr->dun_level;
482 DEPTH summon_lev = (pet ? caster_ptr->lev * 2 / 3 + randint1(caster_ptr->lev / 2) : dungeon_level);
484 for (int i = 0; i < (randint1(7) + (dungeon_level / 40)); i++)
486 switch (randint1(25) + (dungeon_level / 20))
489 count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, summon_lev, SUMMON_ANT, mode);
492 count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, summon_lev, SUMMON_SPIDER, mode);
495 count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, summon_lev, SUMMON_HOUND, mode);
498 count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, summon_lev, SUMMON_HYDRA, mode);
501 count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, summon_lev, SUMMON_ANGEL, mode);
504 count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, summon_lev, SUMMON_UNDEAD, mode);
507 count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, summon_lev, SUMMON_DRAGON, mode);
510 count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, summon_lev, SUMMON_DEMON, mode);
514 count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, summon_lev, SUMMON_AMBERITES, (mode | PM_ALLOW_UNIQUE));
518 count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, summon_lev, SUMMON_UNIQUE, (mode | PM_ALLOW_UNIQUE));
521 if (!can_pet) mode |= PM_ALLOW_UNIQUE;
522 count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, summon_lev, SUMMON_HI_UNDEAD, mode);
525 if (!can_pet) mode |= PM_ALLOW_UNIQUE;
526 count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, summon_lev, SUMMON_HI_DRAGON, mode);
529 count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, 100, SUMMON_CYBER, mode);
532 if (!can_pet) mode |= PM_ALLOW_UNIQUE;
533 count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, pet ? summon_lev : (((summon_lev * 3) / 2) + 5), 0, mode);
542 * @brief 周辺破壊効果(プレイヤー中心)
543 * @param caster_ptr プレーヤーへの参照ポインタ
544 * @return 作用が実際にあった場合TRUEを返す
546 void wall_breaker(player_type *caster_ptr)
548 POSITION y = 0, x = 0;
550 if (randint1(80 + caster_ptr->lev) < 70)
554 scatter(caster_ptr, &y, &x, caster_ptr->y, caster_ptr->x, 4, 0);
556 if (!cave_have_flag_bold(caster_ptr->current_floor_ptr, y, x, FF_PROJECT)) continue;
558 if (!player_bold(caster_ptr, y, x)) break;
561 project(caster_ptr, 0, 0, y, x, 20 + randint1(30), GF_KILL_WALL,
562 (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1);
566 if (randint1(100) > 30)
568 earthquake(caster_ptr, caster_ptr->y, caster_ptr->x, 1, 0);
572 int num = damroll(5, 3);
573 for (int i = 0; i < num; i++)
577 scatter(caster_ptr, &y, &x, caster_ptr->y, caster_ptr->x, 10, 0);
579 if (!player_bold(caster_ptr, y, x)) break;
582 project(caster_ptr, 0, 0, y, x, 20 + randint1(30), GF_KILL_WALL,
583 (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1);
589 * @brief チャーム・モンスター(1体)
590 * @param caster_ptr プレーヤーへの参照ポインタ
591 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
593 * @return 作用が実際にあった場合TRUEを返す
595 bool charm_monster(player_type *caster_ptr, DIRECTION dir, PLAYER_LEVEL plev)
597 BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
598 return (project_hook(caster_ptr, GF_CHARM, dir, plev, flg));
604 * @param caster_ptr プレーヤーへの参照ポインタ
605 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
607 * @return 作用が実際にあった場合TRUEを返す
609 bool control_one_undead(player_type *caster_ptr, DIRECTION dir, PLAYER_LEVEL plev)
611 BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
612 return (project_hook(caster_ptr, GF_CONTROL_UNDEAD, dir, plev, flg));
618 * @param caster_ptr プレーヤーへの参照ポインタ
619 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
621 * @return 作用が実際にあった場合TRUEを返す
623 bool control_one_demon(player_type *caster_ptr, DIRECTION dir, PLAYER_LEVEL plev)
625 BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
626 return (project_hook(caster_ptr, GF_CONTROL_DEMON, dir, plev, flg));
632 * @param caster_ptr プレーヤーへの参照ポインタ
633 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
635 * @return 作用が実際にあった場合TRUEを返す
637 bool charm_animal(player_type *caster_ptr, DIRECTION dir, PLAYER_LEVEL plev)
639 BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
640 return (project_hook(caster_ptr, GF_CONTROL_ANIMAL, dir, plev, flg));
645 * @brief 『一つの指輪』の効果処理 /
646 * Hack -- activate the ring of power
647 * @param caster_ptr プレーヤーへの参照ポインタ
651 void ring_of_power(player_type *caster_ptr, DIRECTION dir)
653 switch (randint1(10))
658 msg_print(_("あなたは悪性のオーラに包み込まれた。", "You are surrounded by a malignant aura."));
661 /* Decrease all stats (permanently) */
662 (void)dec_stat(caster_ptr, A_STR, 50, TRUE);
663 (void)dec_stat(caster_ptr, A_INT, 50, TRUE);
664 (void)dec_stat(caster_ptr, A_WIS, 50, TRUE);
665 (void)dec_stat(caster_ptr, A_DEX, 50, TRUE);
666 (void)dec_stat(caster_ptr, A_CON, 50, TRUE);
667 (void)dec_stat(caster_ptr, A_CHR, 50, TRUE);
669 /* Lose some experience (permanently) */
670 caster_ptr->exp -= (caster_ptr->exp / 4);
671 caster_ptr->max_exp -= (caster_ptr->exp / 4);
672 check_experience(caster_ptr);
679 msg_print(_("あなたは強力なオーラに包み込まれた。", "You are surrounded by a powerful aura."));
680 dispel_monsters(caster_ptr, 1000);
688 fire_ball(caster_ptr, GF_MANA, dir, 600, 3);
697 fire_bolt(caster_ptr, GF_MANA, dir, 500);
705 * @brief 運命の輪、並びにカオス的な効果の発動
706 * @param caster_ptr プレーヤーへの参照ポインタ
707 * @param spell ランダムな効果を選択するための基準ID
710 void wild_magic(player_type *caster_ptr, int spell)
712 int type = SUMMON_MOLD + randint0(6);
713 if (type < SUMMON_MOLD) type = SUMMON_MOLD;
714 else if (type > SUMMON_MIMIC) type = SUMMON_MIMIC;
716 floor_type *floor_ptr = caster_ptr->current_floor_ptr;
717 switch (randint1(spell) + randint1(8) + 1)
722 teleport_player(caster_ptr, 10, TELEPORT_PASSIVE);
727 teleport_player(caster_ptr, 100, TELEPORT_PASSIVE);
731 teleport_player(caster_ptr, 200, TELEPORT_PASSIVE);
736 unlite_area(caster_ptr, 10, 3);
741 lite_area(caster_ptr, damroll(2, 3), 2);
744 destroy_doors_touch(caster_ptr);
747 wall_breaker(caster_ptr);
750 sleep_monsters_touch(caster_ptr);
754 trap_creation(caster_ptr, caster_ptr->y, caster_ptr->x);
758 door_creation(caster_ptr, caster_ptr->y, caster_ptr->x);
763 aggravate_monsters(caster_ptr, 0);
766 earthquake(caster_ptr, caster_ptr->y, caster_ptr->x, 5, 0);
770 (void)gain_mutation(caster_ptr, 0);
774 apply_disenchant(caster_ptr, 1);
777 lose_all_info(caster_ptr);
780 fire_ball(caster_ptr, GF_CHAOS, 0, spell + 5, 1 + (spell / 10));
783 wall_stone(caster_ptr);
787 for (int counter = 0; counter < 8; counter++)
789 (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));
795 activate_hi_summon(caster_ptr, caster_ptr->y, caster_ptr->x, FALSE);
798 (void)summon_cyber(caster_ptr, -1, caster_ptr->y, caster_ptr->x);
803 (void)activate_ty_curse(caster_ptr, FALSE, &count);
811 * @brief カオス魔法「流星群」の処理としてプレイヤーを中心に隕石落下処理を10+1d10回繰り返す。
812 * / Drop 10+1d10 meteor ball at random places near the player
813 * @param caster_ptr プレーヤーへの参照ポインタ
818 void cast_meteor(player_type *caster_ptr, HIT_POINT dam, POSITION rad)
820 int b = 10 + randint1(10);
821 for (int i = 0; i < b; i++)
823 POSITION y = 0, x = 0;
826 for (count = 0; count <= 20; count++)
830 x = caster_ptr->x - 8 + randint0(17);
831 y = caster_ptr->y - 8 + randint0(17);
832 dx = (caster_ptr->x > x) ? (caster_ptr->x - x) : (x - caster_ptr->x);
833 dy = (caster_ptr->y > y) ? (caster_ptr->y - y) : (y - caster_ptr->y);
834 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
836 if (d >= 9) continue;
838 floor_type *floor_ptr = caster_ptr->current_floor_ptr;
839 if (!in_bounds(floor_ptr, y, x) || !projectable(caster_ptr, caster_ptr->y, caster_ptr->x, y, x)
840 || !cave_have_flag_bold(floor_ptr, y, x, FF_PROJECT)) continue;
845 if (count > 20) continue;
847 project(caster_ptr, 0, rad, y, x, dam, GF_METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM, -1);
853 * @brief 破邪魔法「神の怒り」の処理としてターゲットを指定した後分解のボールを最大20回発生させる。
854 * @param caster_ptr プレーヤーへの参照ポインタ
857 * @return ターゲットを指定し、実行したならばTRUEを返す。
859 bool cast_wrath_of_the_god(player_type *caster_ptr, HIT_POINT dam, POSITION rad)
862 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
864 POSITION tx = caster_ptr->x + 99 * ddx[dir];
865 POSITION ty = caster_ptr->y + 99 * ddy[dir];
866 if ((dir == 5) && target_okay(caster_ptr))
872 POSITION x = caster_ptr->x;
873 POSITION y = caster_ptr->y;
877 if ((y == ty) && (x == tx)) break;
881 mmove2(&ny, &nx, caster_ptr->y, caster_ptr->x, ty, tx);
882 if (MAX_RANGE <= distance(caster_ptr->y, caster_ptr->x, ny, nx)) break;
883 if (!cave_have_flag_bold(caster_ptr->current_floor_ptr, ny, nx, FF_PROJECT)) break;
884 if ((dir != 5) && caster_ptr->current_floor_ptr->grid_array[ny][nx].m_idx != 0) break;
893 int b = 10 + randint1(10);
894 for (int i = 0; i < b; i++)
896 int count = 20, d = 0;
902 x = tx - 5 + randint0(11);
903 y = ty - 5 + randint0(11);
905 dx = (tx > x) ? (tx - x) : (x - tx);
906 dy = (ty > y) ? (ty - y) : (y - ty);
908 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
912 if (count < 0) continue;
914 if (!in_bounds(caster_ptr->current_floor_ptr, y, x) ||
915 cave_stop_disintegration(caster_ptr->current_floor_ptr, y, x) ||
916 !in_disintegration_range(caster_ptr->current_floor_ptr, ty, tx, y, x))
919 project(caster_ptr, 0, rad, y, x, dam, GF_DISINTEGRATE, PROJECT_JUMP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL, -1);
927 * @brief 「ワンダー」のランダムな効果を決定して処理する。
928 * @param caster_ptr プレーヤーへの参照ポインタ
932 * This spell should become more useful (more controlled) as the\n
933 * player gains experience levels. Thus, add 1/5 of the player's\n
934 * level to the die roll. This eliminates the worst effects later on,\n
935 * while keeping the results quite random. It also allows some potent\n
936 * effects only at high level.
938 void cast_wonder(player_type *caster_ptr, DIRECTION dir)
940 PLAYER_LEVEL plev = caster_ptr->lev;
941 int die = randint1(100) + plev / 5;
942 int vir = virtue_number(caster_ptr, V_CHANCE);
945 if (caster_ptr->virtues[vir - 1] > 0)
947 while (randint1(400) < caster_ptr->virtues[vir - 1]) die++;
951 while (randint1(400) < (0 - caster_ptr->virtues[vir - 1])) die--;
957 chg_virtue(caster_ptr, V_CHANCE, 1);
962 msg_print(_("あなたは力がみなぎるのを感じた!", "You feel a surge of power!"));
967 clone_monster(caster_ptr, dir);
973 speed_monster(caster_ptr, dir, plev);
979 heal_monster(caster_ptr, dir, damroll(4, 6));
985 poly_monster(caster_ptr, dir, plev);
991 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr) - 10, GF_MISSILE, dir,
992 damroll(3 + ((plev - 1) / 5), 4));
998 confuse_monster(caster_ptr, dir, plev);
1004 fire_ball(caster_ptr, GF_POIS, dir, 20 + (plev / 2), 3);
1010 (void)lite_line(caster_ptr, dir, damroll(6, 8));
1016 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr) - 10, GF_ELEC, dir,
1017 damroll(3 + ((plev - 5) / 4), 8));
1023 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr) - 10, GF_COLD, dir,
1024 damroll(5 + ((plev - 5) / 4), 8));
1030 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr), GF_ACID, dir,
1031 damroll(6 + ((plev - 5) / 4), 8));
1037 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr), GF_FIRE, dir,
1038 damroll(8 + ((plev - 5) / 4), 8));
1044 hypodynamic_bolt(caster_ptr, dir, 75);
1050 fire_ball(caster_ptr, GF_ELEC, dir, 30 + plev / 2, 2);
1056 fire_ball(caster_ptr, GF_ACID, dir, 40 + plev, 2);
1062 fire_ball(caster_ptr, GF_ICE, dir, 70 + plev, 3);
1068 fire_ball(caster_ptr, GF_FIRE, dir, 80 + plev, 3);
1074 hypodynamic_bolt(caster_ptr, dir, 100 + plev);
1080 earthquake(caster_ptr, caster_ptr->y, caster_ptr->x, 12, 0);
1086 (void)destroy_area(caster_ptr, caster_ptr->y, caster_ptr->x, 13 + randint0(5), FALSE);
1092 symbol_genocide(caster_ptr, plev + 50, TRUE);
1098 dispel_monsters(caster_ptr, 120);
1102 dispel_monsters(caster_ptr, 150);
1103 slow_monsters(caster_ptr, plev);
1104 sleep_monsters(caster_ptr, plev);
1105 hp_player(caster_ptr, 300);
1110 * @brief 「悪霊召喚」のランダムな効果を決定して処理する。
1111 * @param caster_ptr プレーヤーへの参照ポインタ
1115 void cast_invoke_spirits(player_type *caster_ptr, DIRECTION dir)
1117 PLAYER_LEVEL plev = caster_ptr->lev;
1118 int die = randint1(100) + plev / 5;
1119 int vir = virtue_number(caster_ptr, V_CHANCE);
1123 if (caster_ptr->virtues[vir - 1] > 0)
1125 while (randint1(400) < caster_ptr->virtues[vir - 1]) die++;
1129 while (randint1(400) < (0 - caster_ptr->virtues[vir - 1])) die--;
1133 msg_print(_("あなたは死者たちの力を招集した...", "You call on the power of the dead..."));
1135 chg_virtue(caster_ptr, V_CHANCE, 1);
1139 msg_print(_("あなたはおどろおどろしい力のうねりを感じた!", "You feel a surge of eldritch force!"));
1144 msg_print(_("なんてこった!あなたの周りの地面から朽ちた人影が立ち上がってきた!",
1145 "Oh no! Mouldering forms rise from the earth around you!"));
1147 (void)summon_specific(caster_ptr, 0, caster_ptr->y, caster_ptr->x, caster_ptr->current_floor_ptr->dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
1148 chg_virtue(caster_ptr, V_UNLIFE, 1);
1152 msg_print(_("名状し難い邪悪な存在があなたの心を通り過ぎて行った...", "An unnamable evil brushes against your mind..."));
1154 set_afraid(caster_ptr, caster_ptr->afraid + randint1(4) + 4);
1158 msg_print(_("あなたの頭に大量の幽霊たちの騒々しい声が押し寄せてきた...",
1159 "Your head is invaded by a horde of gibbering spectral voices..."));
1161 set_confused(caster_ptr, caster_ptr->confused + randint1(4) + 4);
1165 poly_monster(caster_ptr, dir, plev);
1169 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr) - 10, GF_MISSILE, dir,
1170 damroll(3 + ((plev - 1) / 5), 4));
1174 confuse_monster(caster_ptr, dir, plev);
1178 fire_ball(caster_ptr, GF_POIS, dir, 20 + (plev / 2), 3);
1182 (void)lite_line(caster_ptr, dir, damroll(6, 8));
1186 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr) - 10, GF_ELEC, dir,
1187 damroll(3 + ((plev - 5) / 4), 8));
1191 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr) - 10, GF_COLD, dir,
1192 damroll(5 + ((plev - 5) / 4), 8));
1196 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr), GF_ACID, dir,
1197 damroll(6 + ((plev - 5) / 4), 8));
1201 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr), GF_FIRE, dir,
1202 damroll(8 + ((plev - 5) / 4), 8));
1206 hypodynamic_bolt(caster_ptr, dir, 75);
1210 fire_ball(caster_ptr, GF_ELEC, dir, 30 + plev / 2, 2);
1214 fire_ball(caster_ptr, GF_ACID, dir, 40 + plev, 2);
1218 fire_ball(caster_ptr, GF_ICE, dir, 70 + plev, 3);
1222 fire_ball(caster_ptr, GF_FIRE, dir, 80 + plev, 3);
1226 hypodynamic_bolt(caster_ptr, dir, 100 + plev);
1230 earthquake(caster_ptr, caster_ptr->y, caster_ptr->x, 12, 0);
1234 (void)destroy_area(caster_ptr, caster_ptr->y, caster_ptr->x, 13 + randint0(5), FALSE);
1238 symbol_genocide(caster_ptr, plev + 50, TRUE);
1242 dispel_monsters(caster_ptr, 120);
1246 dispel_monsters(caster_ptr, 150);
1247 slow_monsters(caster_ptr, plev);
1248 sleep_monsters(caster_ptr, plev);
1249 hp_player(caster_ptr, 300);
1254 msg_print(_("陰欝な声がクスクス笑う。「もうすぐおまえは我々の仲間になるだろう。弱き者よ。」",
1255 "Sepulchral voices chuckle. 'Soon you will join us, mortal.'"));
1261 * @brief トランプ領域の「シャッフル」の効果をランダムに決めて処理する。
1262 * @param caster_ptr プレーヤーへの参照ポインタ
1265 void cast_shuffle(player_type *caster_ptr)
1267 PLAYER_LEVEL plev = caster_ptr->lev;
1270 int vir = virtue_number(caster_ptr, V_CHANCE);
1273 if ((caster_ptr->pclass == CLASS_ROGUE) ||
1274 (caster_ptr->pclass == CLASS_HIGH_MAGE) ||
1275 (caster_ptr->pclass == CLASS_SORCERER))
1276 die = (randint1(110)) + plev / 5;
1278 die = randint1(120);
1282 if (caster_ptr->virtues[vir - 1] > 0)
1284 while (randint1(400) < caster_ptr->virtues[vir - 1]) die++;
1288 while (randint1(400) < (0 - caster_ptr->virtues[vir - 1])) die--;
1292 msg_print(_("あなたはカードを切って一枚引いた...", "You shuffle the deck and draw a card..."));
1296 chg_virtue(caster_ptr, V_CHANCE, 1);
1299 floor_type *floor_ptr = caster_ptr->current_floor_ptr;
1302 msg_print(_("なんてこった!《死》だ!", "Oh no! It's Death!"));
1304 for (i = 0; i < randint1(3); i++)
1306 activate_hi_summon(caster_ptr, caster_ptr->y, caster_ptr->x, FALSE);
1314 msg_print(_("なんてこった!《悪魔》だ!", "Oh no! It's the Devil!"));
1315 summon_specific(caster_ptr, 0, caster_ptr->y, caster_ptr->x, floor_ptr->dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
1322 msg_print(_("なんてこった!《吊られた男》だ!", "Oh no! It's the Hanged Man."));
1323 activate_ty_curse(caster_ptr, FALSE, &count);
1329 msg_print(_("《不調和の剣》だ。", "It's the swords of discord."));
1330 aggravate_monsters(caster_ptr, 0);
1336 msg_print(_("《愚者》だ。", "It's the Fool."));
1337 do_dec_stat(caster_ptr, A_INT);
1338 do_dec_stat(caster_ptr, A_WIS);
1344 msg_print(_("奇妙なモンスターの絵だ。", "It's the picture of a strange monster."));
1345 trump_summoning(caster_ptr, 1, FALSE, caster_ptr->y, caster_ptr->x, (floor_ptr->dun_level * 3 / 2), (32 + randint1(6)), PM_ALLOW_GROUP | PM_ALLOW_UNIQUE);
1351 msg_print(_("《月》だ。", "It's the Moon."));
1352 unlite_area(caster_ptr, 10, 3);
1358 msg_print(_("《運命の輪》だ。", "It's the Wheel of Fortune."));
1359 wild_magic(caster_ptr, randint0(32));
1365 msg_print(_("テレポート・カードだ。", "It's a teleport trump card."));
1366 teleport_player(caster_ptr, 10, TELEPORT_PASSIVE);
1372 msg_print(_("《正義》だ。", "It's Justice."));
1373 set_blessed(caster_ptr, caster_ptr->lev, FALSE);
1379 msg_print(_("テレポート・カードだ。", "It's a teleport trump card."));
1380 teleport_player(caster_ptr, 100, TELEPORT_PASSIVE);
1386 msg_print(_("テレポート・カードだ。", "It's a teleport trump card."));
1387 teleport_player(caster_ptr, 200, TELEPORT_PASSIVE);
1393 msg_print(_("《塔》だ。", "It's the Tower."));
1394 wall_breaker(caster_ptr);
1400 msg_print(_("《節制》だ。", "It's Temperance."));
1401 sleep_monsters_touch(caster_ptr);
1407 msg_print(_("《塔》だ。", "It's the Tower."));
1408 earthquake(caster_ptr, caster_ptr->y, caster_ptr->x, 5, 0);
1414 msg_print(_("友好的なモンスターの絵だ。", "It's the picture of a friendly monster."));
1415 trump_summoning(caster_ptr, 1, TRUE, caster_ptr->y, caster_ptr->x, (floor_ptr->dun_level * 3 / 2), SUMMON_MOLD, 0L);
1421 msg_print(_("友好的なモンスターの絵だ。", "It's the picture of a friendly monster."));
1422 trump_summoning(caster_ptr, 1, TRUE, caster_ptr->y, caster_ptr->x, (floor_ptr->dun_level * 3 / 2), SUMMON_BAT, 0L);
1428 msg_print(_("友好的なモンスターの絵だ。", "It's the picture of a friendly monster."));
1429 trump_summoning(caster_ptr, 1, TRUE, caster_ptr->y, caster_ptr->x, (floor_ptr->dun_level * 3 / 2), SUMMON_VORTEX, 0L);
1435 msg_print(_("友好的なモンスターの絵だ。", "It's the picture of a friendly monster."));
1436 trump_summoning(caster_ptr, 1, TRUE, caster_ptr->y, caster_ptr->x, (floor_ptr->dun_level * 3 / 2), SUMMON_COIN_MIMIC, 0L);
1442 msg_print(_("《恋人》だ。", "It's the Lovers."));
1444 if (get_aim_dir(caster_ptr, &dir))
1446 charm_monster(caster_ptr, dir, MIN(caster_ptr->lev, 20));
1454 msg_print(_("《隠者》だ。", "It's the Hermit."));
1455 wall_stone(caster_ptr);
1461 msg_print(_("《審判》だ。", "It's the Judgement."));
1462 roll_hitdice(caster_ptr, 0L);
1463 lose_all_mutations(caster_ptr);
1469 msg_print(_("《太陽》だ。", "It's the Sun."));
1470 chg_virtue(caster_ptr, V_KNOWLEDGE, 1);
1471 chg_virtue(caster_ptr, V_ENLIGHTEN, 1);
1472 wiz_lite(caster_ptr, FALSE);
1476 msg_print(_("《世界》だ。", "It's the World."));
1477 if (caster_ptr->exp >= PY_MAX_EXP)
1482 s32b ee = (caster_ptr->exp / 25) + 1;
1483 if (ee > 5000) ee = 5000;
1484 msg_print(_("更に経験を積んだような気がする。", "You feel more experienced."));
1485 gain_exp(caster_ptr, ee);
1489 bool vampirism(player_type *caster_ptr)
1491 if (d_info[caster_ptr->dungeon_idx].flags1 & DF1_NO_MELEE)
1493 msg_print(_("なぜか攻撃することができない。", "Something prevents you from attacking."));
1498 if (!get_direction(caster_ptr, &dir, FALSE, FALSE)) return FALSE;
1500 POSITION y = caster_ptr->y + ddy[dir];
1501 POSITION x = caster_ptr->x + ddx[dir];
1503 g_ptr = &caster_ptr->current_floor_ptr->grid_array[y][x];
1504 stop_mouth(caster_ptr);
1505 if (!(g_ptr->m_idx))
1507 msg_print(_("何もない場所に噛みついた!", "You bite into thin air!"));
1511 msg_print(_("あなたはニヤリとして牙をむいた...", "You grin and bare your fangs..."));
1513 int dummy = caster_ptr->lev * 2;
1514 if (!hypodynamic_bolt(caster_ptr, dir, dummy))
1516 msg_print(_("げぇ!ひどい味だ。", "Yechh. That tastes foul."));
1520 if (caster_ptr->food < PY_FOOD_FULL)
1521 (void)hp_player(caster_ptr, dummy);
1523 msg_print(_("あなたは空腹ではありません。", "You were not hungry."));
1525 /* Gain nutritional sustenance: 150/hp drained */
1526 /* A Food ration gives 5000 food points (by contrast) */
1527 /* Don't ever get more than "Full" this way */
1528 /* But if we ARE Gorged, it won't cure us */
1529 dummy = caster_ptr->food + MIN(5000, 100 * dummy);
1530 if (caster_ptr->food < PY_FOOD_MAX) /* Not gorged already */
1531 (void)set_food(caster_ptr, dummy >= PY_FOOD_MAX ? PY_FOOD_MAX - 1 : dummy);
1537 * ヒット&アウェイのレイシャルパワー/突然変異
1538 * @param caster_ptr プレーヤーへの参照ポインタ
1539 * @return コマンドの入力先にモンスターがいたらTRUE
1541 bool hit_and_away(player_type *caster_ptr)
1544 if (!get_direction(caster_ptr, &dir, FALSE, FALSE)) return FALSE;
1545 POSITION y = caster_ptr->y + ddy[dir];
1546 POSITION x = caster_ptr->x + ddx[dir];
1547 if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
1549 do_cmd_attack(caster_ptr, y, x, 0);
1550 if (randint0(caster_ptr->skill_dis) < 7)
1551 msg_print(_("うまく逃げられなかった。", "You failed to run away."));
1553 teleport_player(caster_ptr, 30, TELEPORT_SPONTANEOUS);
1557 msg_print(_("その方向にはモンスターはいません。", "You don't see any monster in this direction"));
1563 bool android_inside_weapon(player_type *creature_ptr)
1566 if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
1568 if (creature_ptr->lev < 10)
1570 msg_print(_("レイガンを発射した。", "You fire your ray gun."));
1571 fire_bolt(creature_ptr, GF_MISSILE, dir, (creature_ptr->lev + 1) / 2);
1575 if (creature_ptr->lev < 25)
1577 msg_print(_("ブラスターを発射した。", "You fire your blaster."));
1578 fire_bolt(creature_ptr, GF_MISSILE, dir, creature_ptr->lev);
1582 if (creature_ptr->lev < 35)
1584 msg_print(_("バズーカを発射した。", "You fire your bazooka."));
1585 fire_ball(creature_ptr, GF_MISSILE, dir, creature_ptr->lev * 2, 2);
1589 if (creature_ptr->lev < 45)
1591 msg_print(_("ビームキャノンを発射した。", "You fire a beam cannon."));
1592 fire_beam(creature_ptr, GF_MISSILE, dir, creature_ptr->lev * 2);
1596 msg_print(_("ロケットを発射した。", "You fire a rocket."));
1597 fire_rocket(creature_ptr, GF_ROCKET, dir, creature_ptr->lev * 5, 2);
1602 bool create_ration(player_type *creature_ptr)
1608 /* Create the food ration */
1609 object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_RATION));
1611 /* Drop the object from heaven */
1612 (void)drop_near(creature_ptr, q_ptr, -1, creature_ptr->y, creature_ptr->x);
1613 msg_print(_("食事を料理して作った。", "You cook some food."));
1618 void hayagake(player_type *creature_ptr)
1620 if (creature_ptr->action == ACTION_HAYAGAKE)
1622 set_action(creature_ptr, ACTION_NONE);
1623 creature_ptr->energy_use = 0;
1627 grid_type *g_ptr = &creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x];
1628 feature_type *f_ptr = &f_info[g_ptr->feat];
1630 if (!have_flag(f_ptr->flags, FF_PROJECT) ||
1631 (!creature_ptr->levitation && have_flag(f_ptr->flags, FF_DEEP)))
1633 msg_print(_("ここでは素早く動けない。", "You cannot run in here."));
1637 set_action(creature_ptr, ACTION_HAYAGAKE);
1640 creature_ptr->energy_use = 0;
1644 bool double_attack(player_type *creature_ptr)
1647 if (!get_rep_dir(creature_ptr, &dir, FALSE)) return FALSE;
1648 POSITION y = creature_ptr->y + ddy[dir];
1649 POSITION x = creature_ptr->x + ddx[dir];
1650 if (!creature_ptr->current_floor_ptr->grid_array[y][x].m_idx)
1652 msg_print(_("その方向にはモンスターはいません。", "You don't see any monster in this direction"));
1658 msg_print(_("あーたたたたたたたたたたたたたたたたたたたたたた!!!",
1659 "Ahhhtatatatatatatatatatatatatatataatatatatattaaaaa!!!!"));
1660 else if (one_in_(2))
1661 msg_print(_("無駄無駄無駄無駄無駄無駄無駄無駄無駄無駄無駄無駄!!!",
1662 "Mudamudamudamudamudamudamudamudamudamudamudamudamuda!!!!"));
1664 msg_print(_("オラオラオラオラオラオラオラオラオラオラオラオラ!!!",
1665 "Oraoraoraoraoraoraoraoraoraoraoraoraoraoraoraoraora!!!!"));
1667 do_cmd_attack(creature_ptr, y, x, 0);
1668 if (creature_ptr->current_floor_ptr->grid_array[y][x].m_idx)
1670 handle_stuff(creature_ptr);
1671 do_cmd_attack(creature_ptr, y, x, 0);
1674 creature_ptr->energy_need += ENERGY_NEED();
1679 bool comvert_hp_to_mp(player_type *creature_ptr)
1681 int gain_sp = take_hit(creature_ptr, DAMAGE_USELIFE, creature_ptr->lev, _("HPからMPへの無謀な変換", "thoughtless conversion from HP to SP"), -1) / 5;
1684 msg_print(_("変換に失敗した。", "You failed to convert."));
1685 creature_ptr->redraw |= (PR_HP | PR_MANA);
1689 creature_ptr->csp += gain_sp;
1690 if (creature_ptr->csp > creature_ptr->msp)
1692 creature_ptr->csp = creature_ptr->msp;
1693 creature_ptr->csp_frac = 0;
1696 creature_ptr->redraw |= (PR_HP | PR_MANA);
1701 bool comvert_mp_to_hp(player_type *creature_ptr)
1703 if (creature_ptr->csp >= creature_ptr->lev / 5)
1705 creature_ptr->csp -= creature_ptr->lev / 5;
1706 hp_player(creature_ptr, creature_ptr->lev);
1710 msg_print(_("変換に失敗した。", "You failed to convert."));
1713 creature_ptr->redraw |= (PR_HP | PR_MANA);
1720 * @param creature_ptr プレーヤーへの参照ポインタ
1723 bool sword_dancing(player_type *creature_ptr)
1726 POSITION y = 0, x = 0;
1728 for (int i = 0; i < 6; i++)
1731 y = creature_ptr->y + ddy_ddd[dir];
1732 x = creature_ptr->x + ddx_ddd[dir];
1733 g_ptr = &creature_ptr->current_floor_ptr->grid_array[y][x];
1735 /* Hack -- attack monsters */
1737 do_cmd_attack(creature_ptr, y, x, 0);
1740 msg_print(_("攻撃が空をきった。", "You attack the empty air."));
1748 bool clear_mind(player_type *creature_ptr)
1752 msg_print(_("今はペットを操ることに集中していないと。", "Your pets demand all of your attention."));
1756 msg_print(_("少し頭がハッキリした。", "You feel your head clear a little."));
1758 creature_ptr->csp += (3 + creature_ptr->lev / 20);
1759 if (creature_ptr->csp >= creature_ptr->msp)
1761 creature_ptr->csp = creature_ptr->msp;
1762 creature_ptr->csp_frac = 0;
1765 creature_ptr->redraw |= (PR_MANA);