3 * @brief 魔法効果の実装/ Spell code (part 2)
7 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
8 * This software may be copied and distributed for educational, research,
9 * and not for profit purposes provided that this copyright and statement
10 * are included in all such copies. Other copyrights may also apply.
26 #include "monsterrace-hook.h"
30 #include "spells-summon.h"
35 #include "spells-status.h"
36 #include "spells-floor.h"
37 #include "realm-hex.h"
39 #include "object-flavor.h"
40 #include "object-hook.h"
41 #include "monster-status.h"
42 #include "player-move.h"
43 #include "player-status.h"
44 #include "player-effects.h"
45 #include "player-skill.h"
46 #include "player-class.h"
47 #include "player-damage.h"
50 #include "floor-events.h"
52 #include "view-mainwindow.h"
53 #include "objectkind.h"
54 #include "monsterrace.h"
55 #include "targeting.h"
56 #include "realm-song.h"
60 * @brief プレイヤー周辺の地形を感知する
63 * @param known 地形から危険フラグを外すならTRUE
64 * @return 効力があった場合TRUEを返す
66 static bool detect_feat_flag(POSITION range, int flag, bool known)
72 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
74 /* Scan the current panel */
75 for (y = 1; y < current_floor_ptr->height - 1; y++)
77 for (x = 1; x <= current_floor_ptr->width - 1; x++)
79 int dist = distance(p_ptr->y, p_ptr->x, y, x);
80 if (dist > range) continue;
81 g_ptr = ¤t_floor_ptr->grid_array[y][x];
86 /* Mark as detected */
87 if (dist <= range && known)
89 if (dist <= range - 1) g_ptr->info |= (CAVE_IN_DETECT);
91 g_ptr->info &= ~(CAVE_UNSAFE);
97 if (cave_have_flag_grid(g_ptr, flag))
100 g_ptr->info |= (CAVE_MARK);
111 * @brief プレイヤー周辺のトラップを感知する / Detect all traps on current panel
113 * @param known 感知外範囲を超える警告フラグを立てる場合TRUEを返す
114 * @return 効力があった場合TRUEを返す
116 bool detect_traps(POSITION range, bool known)
118 bool detect = detect_feat_flag(range, FF_TRAP, known);
120 if (known) p_ptr->dtrap = TRUE;
122 if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 0) detect = FALSE;
125 msg_print(_("トラップの存在を感じとった!", "You sense the presence of traps!"));
132 * @brief プレイヤー周辺のドアを感知する / Detect all doors on current panel
134 * @return 効力があった場合TRUEを返す
136 bool detect_doors(POSITION range)
138 bool detect = detect_feat_flag(range, FF_DOOR, TRUE);
140 if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 0) detect = FALSE;
143 msg_print(_("ドアの存在を感じとった!", "You sense the presence of doors!"));
150 * @brief プレイヤー周辺の階段を感知する / Detect all stairs on current panel
152 * @return 効力があった場合TRUEを返す
154 bool detect_stairs(POSITION range)
156 bool detect = detect_feat_flag(range, FF_STAIRS, TRUE);
158 if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 0) detect = FALSE;
161 msg_print(_("階段の存在を感じとった!", "You sense the presence of stairs!"));
168 * @brief プレイヤー周辺の地形財宝を感知する / Detect any treasure on the current panel
170 * @return 効力があった場合TRUEを返す
172 bool detect_treasure(POSITION range)
174 bool detect = detect_feat_flag(range, FF_HAS_GOLD, TRUE);
176 if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 6) detect = FALSE;
179 msg_print(_("埋蔵された財宝の存在を感じとった!", "You sense the presence of buried treasure!"));
186 * @brief プレイヤー周辺のアイテム財宝を感知する / Detect all "gold" objects on the current panel
188 * @return 効力があった場合TRUEを返す
190 bool detect_objects_gold(POSITION range)
194 POSITION range2 = range;
198 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range2 /= 3;
201 for (i = 1; i < current_floor_ptr->o_max; i++)
203 object_type *o_ptr = ¤t_floor_ptr->o_list[i];
205 if (!OBJECT_IS_VALID(o_ptr)) continue;
206 if (OBJECT_IS_HELD_MONSTER(o_ptr)) continue;
211 /* Only detect nearby objects */
212 if (distance(p_ptr->y, p_ptr->x, y, x) > range2) continue;
214 /* Detect "gold" objects */
215 if (o_ptr->tval == TV_GOLD)
217 o_ptr->marked |= OM_FOUND;
223 if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 6) detect = FALSE;
226 msg_print(_("財宝の存在を感じとった!", "You sense the presence of treasure!"));
229 if (detect_monsters_string(range, "$"))
238 * @brief 通常のアイテムオブジェクトを感知する / Detect all "normal" objects on the current panel
240 * @return 効力があった場合TRUEを返す
242 bool detect_objects_normal(POSITION range)
246 POSITION range2 = range;
250 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range2 /= 3;
253 for (i = 1; i < current_floor_ptr->o_max; i++)
255 object_type *o_ptr = ¤t_floor_ptr->o_list[i];
257 if (!OBJECT_IS_VALID(o_ptr)) continue;
258 if (OBJECT_IS_HELD_MONSTER(o_ptr)) continue;
263 /* Only detect nearby objects */
264 if (distance(p_ptr->y, p_ptr->x, y, x) > range2) continue;
266 /* Detect "real" objects */
267 if (o_ptr->tval != TV_GOLD)
269 o_ptr->marked |= OM_FOUND;
275 if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 6) detect = FALSE;
278 msg_print(_("アイテムの存在を感じとった!", "You sense the presence of objects!"));
281 if (detect_monsters_string(range, "!=?|/`"))
290 * @brief 魔法効果のあるのアイテムオブジェクトを感知する / Detect all "magic" objects on the current panel.
292 * @return 効力があった場合TRUEを返す
295 * This will light up all spaces with "magic" items, including artifacts,
296 * ego-items, potions, scrolls, books, rods, wands, staves, amulets, rings,
297 * and "enchanted" items of the "good" variety.
299 * It can probably be argued that this function is now too powerful.
302 bool detect_objects_magic(POSITION range)
304 OBJECT_TYPE_VALUE tv;
310 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
312 /* Scan all objects */
313 for (i = 1; i < current_floor_ptr->o_max; i++)
315 object_type *o_ptr = ¤t_floor_ptr->o_list[i];
317 if (!OBJECT_IS_VALID(o_ptr)) continue;
318 if (OBJECT_IS_HELD_MONSTER(o_ptr)) continue;
323 /* Only detect nearby objects */
324 if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue;
326 /* Examine the tval */
329 /* Artifacts, misc magic items, or enchanted wearables */
330 if (object_is_artifact(o_ptr) ||
331 object_is_ego(o_ptr) ||
332 (tv == TV_WHISTLE) ||
340 (tv == TV_LIFE_BOOK) ||
341 (tv == TV_SORCERY_BOOK) ||
342 (tv == TV_NATURE_BOOK) ||
343 (tv == TV_CHAOS_BOOK) ||
344 (tv == TV_DEATH_BOOK) ||
345 (tv == TV_TRUMP_BOOK) ||
346 (tv == TV_ARCANE_BOOK) ||
347 (tv == TV_CRAFT_BOOK) ||
348 (tv == TV_DAEMON_BOOK) ||
349 (tv == TV_CRUSADE_BOOK) ||
350 (tv == TV_MUSIC_BOOK) ||
351 (tv == TV_HISSATSU_BOOK) ||
352 (tv == TV_HEX_BOOK) ||
353 ((o_ptr->to_a > 0) || (o_ptr->to_h + o_ptr->to_d > 0)))
355 /* Memorize the item */
356 o_ptr->marked |= OM_FOUND;
363 msg_print(_("魔法のアイテムの存在を感じとった!", "You sense the presence of magic objects!"));
372 * @brief 一般のモンスターを感知する / Detect all "normal" monsters on the current panel
374 * @return 効力があった場合TRUEを返す
376 bool detect_monsters_normal(POSITION range)
382 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
384 for (i = 1; i < current_floor_ptr->m_max; i++)
386 monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
387 monster_race *r_ptr = &r_info[m_ptr->r_idx];
388 if (!monster_is_valid(m_ptr)) continue;
393 /* Only detect nearby monsters */
394 if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue;
396 /* Detect all non-invisible monsters */
397 if (!(r_ptr->flags2 & RF2_INVISIBLE) || p_ptr->see_inv)
399 /* Repair visibility later */
400 repair_monsters = TRUE;
402 m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
403 update_monster(i, FALSE);
408 if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 3) flag = FALSE;
411 msg_print(_("モンスターの存在を感じとった!", "You sense the presence of monsters!"));
418 * @brief 不可視のモンスターを感知する / Detect all "invisible" monsters around the player
420 * @return 効力があった場合TRUEを返す
422 bool detect_monsters_invis(POSITION range)
428 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
430 for (i = 1; i < current_floor_ptr->m_max; i++)
432 monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
433 monster_race *r_ptr = &r_info[m_ptr->r_idx];
435 if (!monster_is_valid(m_ptr)) continue;
440 /* Only detect nearby monsters */
441 if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue;
443 /* Detect invisible monsters */
444 if (r_ptr->flags2 & RF2_INVISIBLE)
446 /* Update monster recall window */
447 if (p_ptr->monster_race_idx == m_ptr->r_idx)
449 p_ptr->window |= (PW_MONSTER);
452 /* Repair visibility later */
453 repair_monsters = TRUE;
455 m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
456 update_monster(i, FALSE);
461 if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 3) flag = FALSE;
464 msg_print(_("透明な生物の存在を感じとった!", "You sense the presence of invisible creatures!"));
470 * @brief 邪悪なモンスターを感知する / Detect all "evil" monsters on current panel
472 * @return 効力があった場合TRUEを返す
474 bool detect_monsters_evil(POSITION range)
480 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
482 for (i = 1; i < current_floor_ptr->m_max; i++)
484 monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
485 monster_race *r_ptr = &r_info[m_ptr->r_idx];
486 if (!monster_is_valid(m_ptr)) continue;
491 /* Only detect nearby monsters */
492 if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue;
494 /* Detect evil monsters */
495 if (r_ptr->flags3 & RF3_EVIL)
497 if (is_original_ap(m_ptr))
499 /* Take note that they are evil */
500 r_ptr->r_flags3 |= (RF3_EVIL);
502 /* Update monster recall window */
503 if (p_ptr->monster_race_idx == m_ptr->r_idx)
505 p_ptr->window |= (PW_MONSTER);
509 /* Repair visibility later */
510 repair_monsters = TRUE;
512 m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
513 update_monster(i, FALSE);
519 msg_print(_("邪悪なる生物の存在を感じとった!", "You sense the presence of evil creatures!"));
525 * @brief 無生命のモンスターを感知する(アンデッド、悪魔系を含む) / Detect all "nonliving", "undead" or "demonic" monsters on current panel
527 * @return 効力があった場合TRUEを返す
529 bool detect_monsters_nonliving(POSITION range)
535 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
537 for (i = 1; i < current_floor_ptr->m_max; i++)
539 monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
540 if (!monster_is_valid(m_ptr)) continue;
545 /* Only detect nearby monsters */
546 if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue;
548 /* Detect non-living monsters */
549 if (!monster_living(m_ptr->r_idx))
551 /* Update monster recall window */
552 if (p_ptr->monster_race_idx == m_ptr->r_idx)
554 p_ptr->window |= (PW_MONSTER);
557 /* Repair visibility later */
558 repair_monsters = TRUE;
560 m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
561 update_monster(i, FALSE);
567 msg_print(_("自然でないモンスターの存在を感じた!", "You sense the presence of unnatural beings!"));
573 * @brief 精神のあるモンスターを感知する / Detect all monsters it has mind on current panel
575 * @return 効力があった場合TRUEを返す
577 bool detect_monsters_mind(POSITION range)
583 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
585 for (i = 1; i < current_floor_ptr->m_max; i++)
587 monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
588 monster_race *r_ptr = &r_info[m_ptr->r_idx];
589 if (!monster_is_valid(m_ptr)) continue;
594 /* Only detect nearby monsters */
595 if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue;
597 /* Detect non-living monsters */
598 if (!(r_ptr->flags2 & RF2_EMPTY_MIND))
600 /* Update monster recall window */
601 if (p_ptr->monster_race_idx == m_ptr->r_idx)
603 p_ptr->window |= (PW_MONSTER);
606 /* Repair visibility later */
607 repair_monsters = TRUE;
609 m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
610 update_monster(i, FALSE);
616 msg_print(_("殺気を感じとった!", "You sense the presence of someone's mind!"));
623 * @brief 該当シンボルのモンスターを感知する / Detect all (string) monsters on current panel
625 * @param Match 対応シンボルの混じったモンスター文字列(複数指定化)
626 * @return 効力があった場合TRUEを返す
628 bool detect_monsters_string(POSITION range, concptr Match)
634 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
636 for (i = 1; i < current_floor_ptr->m_max; i++)
638 monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
639 monster_race *r_ptr = &r_info[m_ptr->r_idx];
640 if (!monster_is_valid(m_ptr)) continue;
645 /* Only detect nearby monsters */
646 if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue;
648 /* Detect monsters with the same symbol */
649 if (my_strchr(Match, r_ptr->d_char))
651 /* Update monster recall window */
652 if (p_ptr->monster_race_idx == m_ptr->r_idx)
654 p_ptr->window |= (PW_MONSTER);
657 /* Repair visibility later */
658 repair_monsters = TRUE;
660 m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
661 update_monster(i, FALSE);
666 if (music_singing(MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 3) flag = FALSE;
669 msg_print(_("モンスターの存在を感じとった!", "You sense the presence of monsters!"));
675 * @brief flags3に対応するモンスターを感知する / A "generic" detect monsters routine, tagged to flags3
677 * @param match_flag 感知フラグ
678 * @return 効力があった場合TRUEを返す
680 bool detect_monsters_xxx(POSITION range, u32b match_flag)
685 concptr desc_monsters = _("変なモンスター", "weird monsters");
687 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
689 for (i = 1; i < current_floor_ptr->m_max; i++)
691 monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
692 monster_race *r_ptr = &r_info[m_ptr->r_idx];
693 if (!monster_is_valid(m_ptr)) continue;
698 /* Only detect nearby monsters */
699 if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue;
701 /* Detect evil monsters */
702 if (r_ptr->flags3 & (match_flag))
704 if (is_original_ap(m_ptr))
706 /* Take note that they are something */
707 r_ptr->r_flags3 |= (match_flag);
709 /* Update monster recall window */
710 if (p_ptr->monster_race_idx == m_ptr->r_idx)
712 p_ptr->window |= (PW_MONSTER);
716 /* Repair visibility later */
717 repair_monsters = TRUE;
719 m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
720 update_monster(i, FALSE);
729 desc_monsters = _("デーモン", "demons");
732 desc_monsters = _("アンデッド", "the undead");
736 msg_format(_("%sの存在を感じとった!", "You sense the presence of %s!"), desc_monsters);
744 * @brief 全感知処理 / Detect everything
746 * @return 効力があった場合TRUEを返す
748 bool detect_all(POSITION range)
752 /* Detect everything */
753 if (detect_traps(range, TRUE)) detect = TRUE;
754 if (detect_doors(range)) detect = TRUE;
755 if (detect_stairs(range)) detect = TRUE;
757 /* There are too many hidden treasure. So... */
758 /* if (detect_treasure(range)) detect = TRUE; */
760 if (detect_objects_gold(range)) detect = TRUE;
761 if (detect_objects_normal(range)) detect = TRUE;
762 if (detect_monsters_invis(range)) detect = TRUE;
763 if (detect_monsters_normal(range)) detect = TRUE;
769 * @brief 視界内モンスターに魔法効果を与える / Apply a "project()" directly to all viewable monsters
772 * @return 効力があった場合TRUEを返す
775 * Note that affected monsters are NOT auto-tracked by this usage.
777 * To avoid misbehavior when monster deaths have side-effects,
778 * this is done in two passes. -- JDL
781 bool project_all_los(EFFECT_ID typ, HIT_POINT dam)
785 BIT_FLAGS flg = PROJECT_JUMP | PROJECT_KILL | PROJECT_HIDE;
786 bool obvious = FALSE;
788 /* Mark all (nearby) monsters */
789 for (i = 1; i < current_floor_ptr->m_max; i++)
791 monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
792 if (!monster_is_valid(m_ptr)) continue;
797 /* Require line of sight */
798 if (!player_has_los_bold(y, x) || !projectable(p_ptr->y, p_ptr->x, y, x)) continue;
800 /* Mark the monster */
801 m_ptr->mflag |= (MFLAG_LOS);
804 /* Affect all marked monsters */
805 for (i = 1; i < current_floor_ptr->m_max; i++)
807 monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
809 /* Skip unmarked monsters */
810 if (!(m_ptr->mflag & (MFLAG_LOS))) continue;
813 m_ptr->mflag &= ~(MFLAG_LOS);
818 /* Jump directly to the target monster */
819 if (project(0, 0, y, x, dam, typ, flg, -1)) obvious = TRUE;
826 * @brief 視界内モンスターを加速する処理 / Speed monsters
827 * @return 効力があった場合TRUEを返す
829 bool speed_monsters(void)
831 return (project_all_los(GF_OLD_SPEED, p_ptr->lev));
835 * @brief 視界内モンスターを加速する処理 / Slow monsters
836 * @return 効力があった場合TRUEを返す
838 bool slow_monsters(int power)
840 return (project_all_los(GF_OLD_SLOW, power));
844 * @brief 視界内モンスターを眠らせる処理 / Sleep monsters
845 * @return 効力があった場合TRUEを返す
847 bool sleep_monsters(int power)
849 return (project_all_los(GF_OLD_SLEEP, power));
853 * @brief 視界内の邪悪なモンスターをテレポート・アウェイさせる処理 / Banish evil monsters
854 * @return 効力があった場合TRUEを返す
856 bool banish_evil(int dist)
858 return (project_all_los(GF_AWAY_EVIL, dist));
862 * @brief 視界内のアンデッド・モンスターを恐怖させる処理 / Turn undead
863 * @return 効力があった場合TRUEを返す
865 bool turn_undead(void)
867 bool tester = (project_all_los(GF_TURN_UNDEAD, p_ptr->lev));
869 chg_virtue(V_UNLIFE, -1);
874 * @brief 視界内のアンデッド・モンスターにダメージを与える処理 / Dispel undead monsters
875 * @return 効力があった場合TRUEを返す
877 bool dispel_undead(HIT_POINT dam)
879 bool tester = (project_all_los(GF_DISP_UNDEAD, dam));
881 chg_virtue(V_UNLIFE, -2);
886 * @brief 視界内の邪悪なモンスターにダメージを与える処理 / Dispel evil monsters
887 * @return 効力があった場合TRUEを返す
889 bool dispel_evil(HIT_POINT dam)
891 return (project_all_los(GF_DISP_EVIL, dam));
895 * @brief 視界内の善良なモンスターにダメージを与える処理 / Dispel good monsters
896 * @return 効力があった場合TRUEを返す
898 bool dispel_good(HIT_POINT dam)
900 return (project_all_los(GF_DISP_GOOD, dam));
904 * @brief 視界内のあらゆるモンスターにダメージを与える処理 / Dispel all monsters
905 * @return 効力があった場合TRUEを返す
907 bool dispel_monsters(HIT_POINT dam)
909 return (project_all_los(GF_DISP_ALL, dam));
912 bool cleansing_nova(player_type *creature_ptr, bool magic, bool powerful)
915 if (dispel_evil(powerful ? 225 : 150)) ident = TRUE;
916 int k = 3 * creature_ptr->lev;
917 if (set_protevil((magic ? 0 : creature_ptr->protevil) + randint1(25) + k, FALSE)) ident = TRUE;
918 if (set_poisoned(p_ptr, 0)) ident = TRUE;
919 if (set_afraid(p_ptr, 0)) ident = TRUE;
920 if (hp_player(p_ptr, 50)) ident = TRUE;
921 if (set_stun(0)) ident = TRUE;
922 if (set_cut(0)) ident = TRUE;
926 bool unleash_mana_storm(player_type *creature_ptr, bool powerful)
928 msg_print(_("強力な魔力が敵を引き裂いた!", "Mighty magics rend your enemies!"));
929 project(0, (powerful ? 7 : 5), creature_ptr->y, creature_ptr->x,
930 (randint1(200) + (powerful ? 500 : 300)) * 2, GF_MANA, PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID, -1);
931 if ((creature_ptr->pclass != CLASS_MAGE) && (creature_ptr->pclass != CLASS_HIGH_MAGE) && (creature_ptr->pclass != CLASS_SORCERER) && (creature_ptr->pclass != CLASS_MAGIC_EATER) && (creature_ptr->pclass != CLASS_BLUE_MAGE))
933 (void)take_hit(DAMAGE_NOESCAPE, 50, _("コントロールし難い強力な魔力の解放", "unleashing magics too mighty to control"), -1);
939 * @brief 視界内の生命のあるモンスターにダメージを与える処理 / Dispel 'living' monsters
940 * @return 効力があった場合TRUEを返す
942 bool dispel_living(HIT_POINT dam)
944 return (project_all_los(GF_DISP_LIVING, dam));
948 * @brief 視界内の悪魔系モンスターにダメージを与える処理 / Dispel 'living' monsters
949 * @return 効力があった場合TRUEを返す
951 bool dispel_demons(HIT_POINT dam)
953 return (project_all_los(GF_DISP_DEMON, dam));
957 * @brief 視界内のモンスターに「聖戦」効果を与える処理
958 * @return 効力があった場合TRUEを返す
962 return (project_all_los(GF_CRUSADE, p_ptr->lev*4));
966 * @brief 視界内モンスターを怒らせる処理 / Wake up all monsters, and speed up "los" monsters.
967 * @param who 怒らせる原因を起こしたモンスター(0ならばプレイヤー)
970 void aggravate_monsters(MONSTER_IDX who)
976 /* Aggravate everyone nearby */
977 for (i = 1; i < current_floor_ptr->m_max; i++)
979 monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
980 if (!monster_is_valid(m_ptr)) continue;
982 /* Skip aggravating monster (or player) */
983 if (i == who) continue;
985 /* Wake up nearby sleeping monsters */
986 if (m_ptr->cdis < MAX_SIGHT * 2)
989 if (MON_CSLEEP(m_ptr))
991 (void)set_monster_csleep(i, 0);
994 if (!is_pet(m_ptr)) m_ptr->mflag2 |= MFLAG2_NOPET;
997 /* Speed up monsters in line of sight */
998 if (player_has_los_bold(m_ptr->fy, m_ptr->fx))
1002 (void)set_monster_fast(i, MON_FAST(m_ptr) + 100);
1008 if (speed) msg_print(_("付近で何かが突如興奮したような感じを受けた!", "You feel a sudden stirring nearby!"));
1009 else if (sleep) msg_print(_("何かが突如興奮したような騒々しい音が遠くに聞こえた!", "You hear a sudden stirring in the distance!"));
1010 if (p_ptr->riding) p_ptr->update |= PU_BONUS;
1015 * @brief モンスターへの単体抹殺処理サブルーチン / Delete a non-unique/non-quest monster
1016 * @param m_idx 抹殺するモンスターID
1017 * @param power 抹殺の威力
1018 * @param player_cast プレイヤーの魔法によるものならば TRUE
1019 * @param dam_side プレイヤーへの負担ダメージ量(1d(dam_side))
1020 * @param spell_name 抹殺効果を起こした魔法の名前
1021 * @return 効力があった場合TRUEを返す
1023 bool genocide_aux(MONSTER_IDX m_idx, int power, bool player_cast, int dam_side, concptr spell_name)
1025 int msec = delay_factor * delay_factor * delay_factor;
1026 monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx];
1027 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1028 bool resist = FALSE;
1030 if (is_pet(m_ptr) && !player_cast) return FALSE;
1032 /* Hack -- Skip Unique Monsters or Quest Monsters */
1033 if (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) resist = TRUE;
1034 else if (r_ptr->flags7 & RF7_UNIQUE2) resist = TRUE;
1035 else if (m_idx == p_ptr->riding) resist = TRUE;
1036 else if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->phase_out) resist = TRUE;
1037 else if (player_cast && (r_ptr->level > randint0(power))) resist = TRUE;
1038 else if (player_cast && (m_ptr->mflag2 & MFLAG2_NOGENO)) resist = TRUE;
1042 if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
1044 GAME_TEXT m_name[MAX_NLEN];
1046 monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
1047 do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_GENOCIDE, m_name);
1050 delete_monster_idx(m_idx);
1053 if (resist && player_cast)
1055 bool see_m = is_seen(m_ptr);
1056 GAME_TEXT m_name[MAX_NLEN];
1058 monster_desc(m_name, m_ptr, 0);
1061 msg_format(_("%^sには効果がなかった。", "%^s is unaffected."), m_name);
1063 if (MON_CSLEEP(m_ptr))
1065 (void)set_monster_csleep(m_idx, 0);
1068 msg_format(_("%^sが目を覚ました。", "%^s wakes up."), m_name);
1071 if (is_friendly(m_ptr) && !is_pet(m_ptr))
1075 msg_format(_("%sは怒った!", "%^s gets angry!"), m_name);
1079 if (one_in_(13)) m_ptr->mflag2 |= MFLAG2_NOGENO;
1084 take_hit(DAMAGE_GENO, randint1(dam_side), format(_("%^sの呪文を唱えた疲労", "the strain of casting %^s"), spell_name), -1);
1087 /* Visual feedback */
1088 move_cursor_relative(p_ptr->y, p_ptr->x);
1090 p_ptr->redraw |= (PR_HP);
1091 p_ptr->window |= (PW_PLAYER);
1096 Term_xtra(TERM_XTRA_DELAY, msec);
1103 * @brief モンスターへのシンボル抹殺処理ルーチン / Delete all non-unique/non-quest monsters of a given "type" from the level
1104 * @param power 抹殺の威力
1105 * @param player_cast プレイヤーの魔法によるものならば TRUE
1106 * @return 効力があった場合TRUEを返す
1108 bool symbol_genocide(int power, bool player_cast)
1112 bool result = FALSE;
1114 /* Prevent genocide in quest levels */
1115 if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->phase_out)
1117 msg_print(_("何も起きないようだ……", "It seems nothing happen here..."));
1121 /* Mega-Hack -- Get a monster symbol */
1122 while (!get_com(_("どの種類(文字)のモンスターを抹殺しますか: ", "Choose a monster race (by symbol) to genocide: "), &typ, FALSE)) ;
1124 /* Delete the monsters of that "type" */
1125 for (i = 1; i < current_floor_ptr->m_max; i++)
1127 monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
1128 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1129 if (!monster_is_valid(m_ptr)) continue;
1131 /* Skip "wrong" monsters */
1132 if (r_ptr->d_char != typ) continue;
1134 result |= genocide_aux(i, power, player_cast, 4, _("抹殺", "Genocide"));
1139 chg_virtue(V_VITALITY, -2);
1140 chg_virtue(V_CHANCE, -1);
1148 * @brief モンスターへの周辺抹殺処理ルーチン / Delete all nearby (non-unique) monsters
1149 * @param power 抹殺の威力
1150 * @param player_cast プレイヤーの魔法によるものならば TRUE
1151 * @return 効力があった場合TRUEを返す
1153 bool mass_genocide(int power, bool player_cast)
1156 bool result = FALSE;
1158 /* Prevent mass genocide in quest levels */
1159 if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->phase_out)
1164 /* Delete the (nearby) monsters */
1165 for (i = 1; i < current_floor_ptr->m_max; i++)
1167 monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
1168 if (!monster_is_valid(m_ptr)) continue;
1170 /* Skip distant monsters */
1171 if (m_ptr->cdis > MAX_SIGHT) continue;
1174 result |= genocide_aux(i, power, player_cast, 3, _("周辺抹殺", "Mass Genocide"));
1179 chg_virtue(V_VITALITY, -2);
1180 chg_virtue(V_CHANCE, -1);
1188 * @brief アンデッド・モンスターへの周辺抹殺処理ルーチン / Delete all nearby (non-unique) undead
1189 * @param power 抹殺の威力
1190 * @param player_cast プレイヤーの魔法によるものならば TRUE
1191 * @return 効力があった場合TRUEを返す
1193 bool mass_genocide_undead(int power, bool player_cast)
1196 bool result = FALSE;
1198 /* Prevent mass genocide in quest levels */
1199 if ((p_ptr->inside_quest && !random_quest_number(current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->phase_out)
1204 /* Delete the (nearby) monsters */
1205 for (i = 1; i < current_floor_ptr->m_max; i++)
1207 monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
1208 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1209 if (!monster_is_valid(m_ptr)) continue;
1211 if (!(r_ptr->flags3 & RF3_UNDEAD)) continue;
1213 /* Skip distant monsters */
1214 if (m_ptr->cdis > MAX_SIGHT) continue;
1217 result |= genocide_aux(i, power, player_cast, 3, _("アンデッド消滅", "Annihilate Undead"));
1222 chg_virtue(V_UNLIFE, -2);
1223 chg_virtue(V_CHANCE, -1);
1231 * @brief 周辺モンスターを調査する / Probe nearby monsters
1232 * @return 効力があった場合TRUEを返す
1237 int speed; /* TODO */
1248 /* Probe all (nearby) monsters */
1249 for (i = 1; i < current_floor_ptr->m_max; i++)
1251 monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
1252 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1253 if (!monster_is_valid(m_ptr)) continue;
1255 /* Require line of sight */
1256 if (!player_has_los_bold(m_ptr->fy, m_ptr->fx)) continue;
1258 /* Probe visible monsters */
1261 GAME_TEXT m_name[MAX_NLEN];
1263 /* Start the message */
1266 msg_print(_("調査中...", "Probing..."));
1271 if (!is_original_ap(m_ptr))
1273 if (m_ptr->mflag2 & MFLAG2_KAGE)
1274 m_ptr->mflag2 &= ~(MFLAG2_KAGE);
1276 m_ptr->ap_r_idx = m_ptr->r_idx;
1277 lite_spot(m_ptr->fy, m_ptr->fx);
1279 /* Get "the monster" or "something" */
1280 monster_desc(m_name, m_ptr, MD_IGNORE_HALLU | MD_INDEF_HIDDEN);
1282 speed = m_ptr->mspeed - 110;
1283 if (MON_FAST(m_ptr)) speed += 10;
1284 if (MON_SLOW(m_ptr)) speed -= 10;
1285 if (ironman_nightmare) speed += 5;
1287 /* Get the monster's alignment */
1288 if ((r_ptr->flags3 & (RF3_EVIL | RF3_GOOD)) == (RF3_EVIL | RF3_GOOD)) align = _("善悪", "good&evil");
1289 else if (r_ptr->flags3 & RF3_EVIL) align = _("邪悪", "evil");
1290 else if (r_ptr->flags3 & RF3_GOOD) align = _("善良", "good");
1291 else if ((m_ptr->sub_align & (SUB_ALIGN_EVIL | SUB_ALIGN_GOOD)) == (SUB_ALIGN_EVIL | SUB_ALIGN_GOOD)) _(align = "中立(善悪)", "neutral(good&evil)");
1292 else if (m_ptr->sub_align & SUB_ALIGN_EVIL) align = _("中立(邪悪)", "neutral(evil)");
1293 else if (m_ptr->sub_align & SUB_ALIGN_GOOD) align = _("中立(善良)", "neutral(good)");
1294 else align = _("中立", "neutral");
1296 sprintf(buf,_("%s ... 属性:%s HP:%d/%d AC:%d 速度:%s%d 経験:", "%s ... align:%s HP:%d/%d AC:%d speed:%s%d exp:"),
1297 m_name, align, (int)m_ptr->hp, (int)m_ptr->maxhp, r_ptr->ac, (speed > 0) ? "+" : "", speed);
1299 if (r_ptr->next_r_idx)
1301 strcat(buf, format("%d/%d ", m_ptr->exp, r_ptr->next_exp));
1305 strcat(buf, "xxx ");
1308 if (MON_CSLEEP(m_ptr)) strcat(buf,_("睡眠 ", "sleeping "));
1309 if (MON_STUNNED(m_ptr)) strcat(buf, _("朦朧 ", "stunned "));
1310 if (MON_MONFEAR(m_ptr)) strcat(buf, _("恐怖 ", "scared "));
1311 if (MON_CONFUSED(m_ptr)) strcat(buf, _("混乱 ", "confused "));
1312 if (MON_INVULNER(m_ptr)) strcat(buf, _("無敵 ", "invulnerable "));
1313 buf[strlen(buf)-1] = '\0';
1316 /* HACK : Add the line to message buffer */
1319 p_ptr->window |= (PW_MESSAGE);
1322 if (m_ptr->ml) move_cursor_relative(m_ptr->fy, m_ptr->fx);
1325 Term_erase(0, 0, 255);
1327 /* Learn everything about this monster */
1328 if (lore_do_probe(m_ptr->r_idx))
1330 /* Get base name of monster */
1331 strcpy(buf, (r_name + r_ptr->name));
1334 /* Note that we learnt some new flags -Mogami- */
1335 msg_format("%sについてさらに詳しくなった気がする。", buf);
1340 /* Note that we learnt some new flags -Mogami- */
1341 msg_format("You now know more about %s.", buf);
1343 /* Clear -more- prompt */
1358 chg_virtue(V_KNOWLEDGE, 1);
1359 msg_print(_("これで全部です。", "That's all."));
1368 void discharge_minion(void)
1373 for (i = 1; i < current_floor_ptr->m_max; i++)
1375 monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
1376 if (!m_ptr->r_idx || !is_pet(m_ptr)) continue;
1377 if (m_ptr->nickname) okay = FALSE;
1379 if (!okay || p_ptr->riding)
1381 if (!get_check(_("本当に全ペットを爆破しますか?", "You will blast all pets. Are you sure? ")))
1384 for (i = 1; i < current_floor_ptr->m_max; i++)
1387 monster_type *m_ptr = ¤t_floor_ptr->m_list[i];
1388 monster_race *r_ptr;
1390 if (!m_ptr->r_idx || !is_pet(m_ptr)) continue;
1391 r_ptr = &r_info[m_ptr->r_idx];
1393 /* Uniques resist discharging */
1394 if (r_ptr->flags1 & RF1_UNIQUE)
1396 GAME_TEXT m_name[MAX_NLEN];
1397 monster_desc(m_name, m_ptr, 0x00);
1398 msg_format(_("%sは爆破されるのを嫌がり、勝手に自分の世界へと帰った。", "%^s resists to be blasted, and run away."), m_name);
1399 delete_monster_idx(i);
1402 dam = m_ptr->maxhp / 2;
1403 if (dam > 100) dam = (dam - 100) / 2 + 100;
1404 if (dam > 400) dam = (dam - 400) / 2 + 400;
1405 if (dam > 800) dam = 800;
1406 project(i, 2 + (r_ptr->level / 20), m_ptr->fy, m_ptr->fx, dam, GF_PLASMA,
1407 PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL, -1);
1409 if (record_named_pet && m_ptr->nickname)
1411 GAME_TEXT m_name[MAX_NLEN];
1413 monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
1414 do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_BLAST, m_name);
1417 delete_monster_idx(i);
1423 * @brief 部屋全体を照らすサブルーチン
1427 * This routine clears the entire "temp" set.
1428 * This routine will Perma-Lite all "temp" grids.
1429 * This routine is used (only) by "lite_room()"
1430 * Dark grids are illuminated.
1431 * Also, process all affected monsters.
1433 * SMART monsters always wake up when illuminated
1434 * NORMAL monsters wake up 1/4 the time when illuminated
1435 * STUPID monsters wake up 1/10 the time when illuminated
1438 static void cave_temp_room_lite(void)
1442 /* Clear them all */
1443 for (i = 0; i < tmp_pos.n; i++)
1445 POSITION y = tmp_pos.y[i];
1446 POSITION x = tmp_pos.x[i];
1448 grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
1450 /* No longer in the array */
1451 g_ptr->info &= ~(CAVE_TEMP);
1453 /* Update only non-CAVE_GLOW grids */
1454 /* if (g_ptr->info & (CAVE_GLOW)) continue; */
1457 g_ptr->info |= (CAVE_GLOW);
1459 /* Process affected monsters */
1462 PERCENTAGE chance = 25;
1463 monster_type *m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
1464 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1465 update_monster(g_ptr->m_idx, FALSE);
1467 /* Stupid monsters rarely wake up */
1468 if (r_ptr->flags2 & (RF2_STUPID)) chance = 10;
1470 /* Smart monsters always wake up */
1471 if (r_ptr->flags2 & (RF2_SMART)) chance = 100;
1473 /* Sometimes monsters wake up */
1474 if (MON_CSLEEP(m_ptr) && (randint0(100) < chance))
1477 (void)set_monster_csleep(g_ptr->m_idx, 0);
1479 /* Notice the "waking up" */
1482 GAME_TEXT m_name[MAX_NLEN];
1483 monster_desc(m_name, m_ptr, 0);
1484 msg_format(_("%^sが目を覚ました。", "%^s wakes up."), m_name);
1491 update_local_illumination(y, x);
1501 * @brief 部屋全体を暗くするサブルーチン
1505 * This routine clears the entire "temp" set.
1506 * This routine will "darken" all "temp" grids.
1507 * In addition, some of these grids will be "unmarked".
1508 * This routine is used (only) by "unlite_room()"
1509 * Also, process all affected monsters
1512 static void cave_temp_room_unlite(void)
1516 /* Clear them all */
1517 for (i = 0; i < tmp_pos.n; i++)
1519 POSITION y = tmp_pos.y[i];
1520 POSITION x = tmp_pos.x[i];
1523 grid_type *g_ptr = ¤t_floor_ptr->grid_array[y][x];
1524 bool do_dark = !is_mirror_grid(g_ptr);
1526 /* No longer in the array */
1527 g_ptr->info &= ~(CAVE_TEMP);
1529 /* Darken the grid */
1532 if (current_floor_ptr->dun_level || !is_daytime())
1534 for (j = 0; j < 9; j++)
1536 POSITION by = y + ddy_ddd[j];
1537 POSITION bx = x + ddx_ddd[j];
1539 if (in_bounds2(by, bx))
1541 grid_type *cc_ptr = ¤t_floor_ptr->grid_array[by][bx];
1543 if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
1551 if (!do_dark) continue;
1554 g_ptr->info &= ~(CAVE_GLOW);
1556 /* Hack -- Forget "boring" grids */
1557 if (!have_flag(f_info[get_feat_mimic(g_ptr)].flags, FF_REMEMBER))
1559 /* Forget the grid */
1560 if (!view_torch_grids) g_ptr->info &= ~(CAVE_MARK);
1564 /* Process affected monsters */
1567 update_monster(g_ptr->m_idx, FALSE);
1571 update_local_illumination(y, x);
1581 * @brief 周辺に関数ポインタの条件に該当する地形がいくつあるかを計算する / Determine how much contiguous open space this grid is next to
1584 * @param pass_bold 地形条件を返す関数ポインタ
1587 static int next_to_open(POSITION cy, POSITION cx, bool (*pass_bold)(POSITION, POSITION))
1594 for (i = 0; i < 16; i++)
1596 y = cy + ddy_cdd[i % 8];
1597 x = cx + ddx_cdd[i % 8];
1599 /* Found a wall, break the length */
1600 if (!pass_bold(y, x))
1602 /* Track best length */
1616 return (MAX(len, blen));
1620 * @brief 周辺に関数ポインタの条件に該当する地形がいくつあるかを計算する / Determine how much contiguous open space this grid is next to
1623 * @param pass_bold 地形条件を返す関数ポインタ
1626 static int next_to_walls_adj(POSITION cy, POSITION cx, bool (*pass_bold)(POSITION, POSITION))
1632 for (i = 0; i < 8; i++)
1634 y = cy + ddy_ddd[i];
1635 x = cx + ddx_ddd[i];
1637 if (!pass_bold(y, x)) c++;
1645 * @brief 部屋内にある一点の周囲に該当する地形数かいくつあるかをグローバル変数tmp_pos.nに返す / Aux function -- see below
1646 * @param y 部屋内のy座標1点
1647 * @param x 部屋内のx座標1点
1648 * @param only_room 部屋内地形のみをチェック対象にするならば TRUE
1649 * @param pass_bold 地形条件を返す関数ポインタ
1652 static void cave_temp_room_aux(POSITION y, POSITION x, bool only_room, bool (*pass_bold)(POSITION, POSITION))
1655 g_ptr = ¤t_floor_ptr->grid_array[y][x];
1657 /* Avoid infinite recursion */
1658 if (g_ptr->info & (CAVE_TEMP)) return;
1660 /* Do not "leave" the current room */
1661 if (!(g_ptr->info & (CAVE_ROOM)))
1663 if (only_room) return;
1666 if (!in_bounds2(y, x)) return;
1668 /* Do not exceed the maximum spell range */
1669 if (distance(p_ptr->y, p_ptr->x, y, x) > MAX_RANGE) return;
1671 /* Verify this grid */
1673 * The reason why it is ==6 instead of >5 is that 8 is impossible
1674 * due to the check for cave_bold above.
1675 * 7 lights dead-end corridors (you need to do this for the
1676 * checkboard interesting rooms, so that the boundary is lit
1678 * This leaves only a check for 6 bounding walls!
1680 if (in_bounds(y, x) && pass_bold(y, x) &&
1681 (next_to_walls_adj(y, x, pass_bold) == 6) && (next_to_open(y, x, pass_bold) <= 1)) return;
1684 /* Paranoia -- verify space */
1685 if (tmp_pos.n == TEMP_MAX) return;
1687 /* Mark the grid as "seen" */
1688 g_ptr->info |= (CAVE_TEMP);
1690 /* Add it to the "seen" set */
1691 tmp_pos.y[tmp_pos.n] = y;
1692 tmp_pos.x[tmp_pos.n] = x;
1697 * @brief 指定のマスが光を通すか(LOSフラグを持つか)を返す。 / Aux function -- see below
1700 * @return 光を通すならばtrueを返す。
1702 static bool cave_pass_lite_bold(POSITION y, POSITION x)
1704 return cave_los_bold(y, x);
1708 * @brief 部屋内にある一点の周囲がいくつ光を通すかをグローバル変数tmp_pos.nに返す / Aux function -- see below
1713 static void cave_temp_lite_room_aux(POSITION y, POSITION x)
1715 cave_temp_room_aux(y, x, FALSE, cave_pass_lite_bold);
1719 * @brief 指定のマスが光を通さず射線のみを通すかを返す。 / Aux function -- see below
1722 * @return 射線を通すならばtrueを返す。
1724 static bool cave_pass_dark_bold(POSITION y, POSITION x)
1726 return cave_have_flag_bold(y, x, FF_PROJECT);
1731 * @brief 部屋内にある一点の周囲がいくつ射線を通すかをグローバル変数tmp_pos.nに返す / Aux function -- see below
1736 static void cave_temp_unlite_room_aux(POSITION y, POSITION x)
1738 cave_temp_room_aux(y, x, TRUE, cave_pass_dark_bold);
1743 * @brief 指定された部屋内を照らす / Illuminate any room containing the given location.
1748 void lite_room(POSITION y1, POSITION x1)
1753 /* Add the initial grid */
1754 cave_temp_lite_room_aux(y1, x1);
1756 /* While grids are in the queue, add their neighbors */
1757 for (i = 0; i < tmp_pos.n; i++)
1759 x = tmp_pos.x[i], y = tmp_pos.y[i];
1761 /* Walls get lit, but stop light */
1762 if (!cave_pass_lite_bold(y, x)) continue;
1764 /* Spread adjacent */
1765 cave_temp_lite_room_aux(y + 1, x);
1766 cave_temp_lite_room_aux(y - 1, x);
1767 cave_temp_lite_room_aux(y, x + 1);
1768 cave_temp_lite_room_aux(y, x - 1);
1770 /* Spread diagonal */
1771 cave_temp_lite_room_aux(y + 1, x + 1);
1772 cave_temp_lite_room_aux(y - 1, x - 1);
1773 cave_temp_lite_room_aux(y - 1, x + 1);
1774 cave_temp_lite_room_aux(y + 1, x - 1);
1777 /* Now, lite them all up at once */
1778 cave_temp_room_lite();
1780 if (p_ptr->special_defense & NINJA_S_STEALTH)
1782 if (current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
1788 * @brief 指定された部屋内を暗くする / Darken all rooms containing the given location
1793 void unlite_room(POSITION y1, POSITION x1)
1798 /* Add the initial grid */
1799 cave_temp_unlite_room_aux(y1, x1);
1801 /* Spread, breadth first */
1802 for (i = 0; i < tmp_pos.n; i++)
1804 x = tmp_pos.x[i], y = tmp_pos.y[i];
1806 /* Walls get dark, but stop darkness */
1807 if (!cave_pass_dark_bold(y, x)) continue;
1809 /* Spread adjacent */
1810 cave_temp_unlite_room_aux(y + 1, x);
1811 cave_temp_unlite_room_aux(y - 1, x);
1812 cave_temp_unlite_room_aux(y, x + 1);
1813 cave_temp_unlite_room_aux(y, x - 1);
1815 /* Spread diagonal */
1816 cave_temp_unlite_room_aux(y + 1, x + 1);
1817 cave_temp_unlite_room_aux(y - 1, x - 1);
1818 cave_temp_unlite_room_aux(y - 1, x + 1);
1819 cave_temp_unlite_room_aux(y + 1, x - 1);
1822 /* Now, darken them all at once */
1823 cave_temp_room_unlite();
1826 bool starlight(bool magic)
1828 HIT_POINT num = damroll(5, 3);
1829 POSITION y = 0, x = 0;
1833 if (!p_ptr->blind && !magic)
1835 msg_print(_("杖の先が明るく輝いた...", "The end of the staff glows brightly..."));
1837 for (k = 0; k < num; k++)
1843 scatter(&y, &x, p_ptr->y, p_ptr->x, 4, PROJECT_LOS);
1844 if (!cave_have_flag_bold(y, x, FF_PROJECT)) continue;
1845 if (!player_bold(y, x)) break;
1848 project(0, 0, y, x, damroll(6 + p_ptr->lev / 8, 10), GF_LITE_WEAK,
1849 (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_KILL | PROJECT_LOS), -1);
1857 * @brief プレイヤー位置を中心にLITE_WEAK属性を通じた照明処理を行う / Hack -- call light around the player Affect all monsters in the projection radius
1860 * @return 作用が実際にあった場合TRUEを返す
1862 bool lite_area(HIT_POINT dam, POSITION rad)
1864 BIT_FLAGS flg = PROJECT_GRID | PROJECT_KILL;
1866 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)
1868 msg_print(_("ダンジョンが光を吸収した。", "The darkness of this dungeon absorb your light."));
1874 msg_print(_("白い光が辺りを覆った。", "You are surrounded by a white light."));
1877 /* Hook into the "project()" function */
1878 (void)project(0, rad, p_ptr->y, p_ptr->x, dam, GF_LITE_WEAK, flg, -1);
1880 lite_room(p_ptr->y, p_ptr->x);
1888 * @brief プレイヤー位置を中心にLITE_DARK属性を通じた消灯処理を行う / Hack -- call light around the player Affect all monsters in the projection radius
1891 * @return 作用が実際にあった場合TRUEを返す
1893 bool unlite_area(HIT_POINT dam, POSITION rad)
1895 BIT_FLAGS flg = PROJECT_GRID | PROJECT_KILL;
1899 msg_print(_("暗闇が辺りを覆った。", "Darkness surrounds you."));
1902 /* Hook into the "project()" function */
1903 (void)project(0, rad, p_ptr->y, p_ptr->x, dam, GF_DARK_WEAK, flg, -1);
1905 unlite_room(p_ptr->y, p_ptr->x);
1914 * @brief ボール系スペルの発動 / Cast a ball spell
1916 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
1919 * @return 作用が実際にあった場合TRUEを返す
1922 * Stop if we hit a monster, act as a "ball"
1923 * Allow "target" mode to pass over monsters
1924 * Affect grids, objects, and monsters
1927 bool fire_ball(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad)
1931 BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
1933 if (typ == GF_CHARM_LIVING) flg|= PROJECT_HIDE;
1934 /* Use the given direction */
1935 tx = p_ptr->x + 99 * ddx[dir];
1936 ty = p_ptr->y + 99 * ddy[dir];
1938 /* Hack -- Use an actual "target" */
1939 if ((dir == 5) && target_okay())
1941 flg &= ~(PROJECT_STOP);
1946 /* Analyze the "dir" and the "target". Hurt items on floor. */
1947 return (project(0, rad, ty, tx, dam, typ, flg, -1));
1951 * @brief ブレス系スペルの発動 / Cast a breath spell
1953 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
1956 * @return 作用が実際にあった場合TRUEを返す
1959 * Stop if we hit a monster, act as a "ball"
1960 * Allow "target" mode to pass over monsters
1961 * Affect grids, objects, and monsters
1964 bool fire_breath(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad)
1966 return fire_ball(typ, dir, dam, -rad);
1971 * @brief ロケット系スペルの発動(詳細な差は確認中) / Cast a ball spell
1973 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
1976 * @return 作用が実際にあった場合TRUEを返す
1979 * Stop if we hit a monster, act as a "ball"
1980 * Allow "target" mode to pass over monsters
1981 * Affect grids, objects, and monsters
1984 bool fire_rocket(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad)
1987 BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
1989 /* Use the given direction */
1990 tx = p_ptr->x + 99 * ddx[dir];
1991 ty = p_ptr->y + 99 * ddy[dir];
1993 /* Hack -- Use an actual "target" */
1994 if ((dir == 5) && target_okay())
2000 /* Analyze the "dir" and the "target". Hurt items on floor. */
2001 return (project(0, rad, ty, tx, dam, typ, flg, -1));
2006 * @brief ボール(ハイド)系スペルの発動 / Cast a ball spell
2008 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2011 * @return 作用が実際にあった場合TRUEを返す
2014 * Stop if we hit a monster, act as a "ball"
2015 * Allow "target" mode to pass over monsters
2016 * Affect grids, objects, and monsters
2019 bool fire_ball_hide(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad)
2022 BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_HIDE;
2024 /* Use the given direction */
2025 tx = p_ptr->x + 99 * ddx[dir];
2026 ty = p_ptr->y + 99 * ddy[dir];
2028 /* Hack -- Use an actual "target" */
2029 if ((dir == 5) && target_okay())
2031 flg &= ~(PROJECT_STOP);
2036 /* Analyze the "dir" and the "target". Hurt items on floor. */
2037 return (project(0, rad, ty, tx, dam, typ, flg, -1));
2042 * @brief メテオ系スペルの発動 / Cast a meteor spell
2043 * @param who スぺル詠唱者のモンスターID(0=プレイヤー)
2049 * @return 作用が実際にあった場合TRUEを返す
2052 * Cast a meteor spell, defined as a ball spell cast by an arbitary monster,
2053 * player, or outside source, that starts out at an arbitrary location, and
2054 * leaving no trail from the "caster" to the target. This function is
2055 * especially useful for bombardments and similar. -LM-
2056 * Option to hurt the player.
2059 bool fire_meteor(MONSTER_IDX who, EFFECT_ID typ, POSITION y, POSITION x, HIT_POINT dam, POSITION rad)
2061 BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
2063 /* Analyze the "target" and the caster. */
2064 return (project(who, rad, y, x, dam, typ, flg, -1));
2069 * @brief ブラスト系スペルの発動 / Cast a blast spell
2071 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2076 * @return 作用が実際にあった場合TRUEを返す
2078 bool fire_blast(EFFECT_ID typ, DIRECTION dir, DICE_NUMBER dd, DICE_SID ds, int num, int dev)
2082 POSITION ty, tx, y, x;
2085 BIT_FLAGS flg = PROJECT_FAST | PROJECT_THRU | PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE | PROJECT_GRID;
2090 /* Use the given direction */
2093 ly = ty = p_ptr->y + 20 * ddy[dir];
2094 lx = tx = p_ptr->x + 20 * ddx[dir];
2097 /* Use an actual "target" */
2098 else /* if (dir == 5) */
2103 lx = 20 * (tx - p_ptr->x) + p_ptr->x;
2104 ly = 20 * (ty - p_ptr->y) + p_ptr->y;
2107 ld = distance(p_ptr->y, p_ptr->x, ly, lx);
2110 for (i = 0; i < num; i++)
2114 /* Get targets for some bolts */
2115 y = rand_spread(ly, ld * dev / 20);
2116 x = rand_spread(lx, ld * dev / 20);
2118 if (distance(ly, lx, y, x) <= ld * dev / 20) break;
2121 /* Analyze the "dir" and the "target". */
2122 if (!project(0, 0, y, x, damroll(dd, ds), typ, flg, -1))
2133 * @brief モンスターとの位置交換処理 / Switch position with a monster.
2134 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2135 * @return 作用が実際にあった場合TRUEを返す
2137 bool teleport_swap(DIRECTION dir)
2141 monster_type* m_ptr;
2142 monster_race* r_ptr;
2144 if ((dir == 5) && target_okay())
2151 tx = p_ptr->x + ddx[dir];
2152 ty = p_ptr->y + ddy[dir];
2154 g_ptr = ¤t_floor_ptr->grid_array[ty][tx];
2156 if (p_ptr->anti_tele)
2158 msg_print(_("不思議な力がテレポートを防いだ!", "A mysterious force prevents you from teleporting!"));
2162 if (!g_ptr->m_idx || (g_ptr->m_idx == p_ptr->riding))
2164 msg_print(_("それとは場所を交換できません。", "You can't trade places with that!"));
2168 if ((g_ptr->info & CAVE_ICKY) || (distance(ty, tx, p_ptr->y, p_ptr->x) > p_ptr->lev * 3 / 2 + 10))
2170 msg_print(_("失敗した。", "Failed to swap."));
2174 m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx];
2175 r_ptr = &r_info[m_ptr->r_idx];
2177 (void)set_monster_csleep(g_ptr->m_idx, 0);
2179 if (r_ptr->flagsr & RFR_RES_TELE)
2181 msg_print(_("テレポートを邪魔された!", "Your teleportation is blocked!"));
2182 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2186 sound(SOUND_TELEPORT);
2188 /* Swap the player and monster */
2189 (void)move_player_effect(ty, tx, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP);
2197 * @brief 指定方向に飛び道具を飛ばす(フラグ任意指定) / Hack -- apply a "project()" in a direction (or at the target)
2199 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2202 * @return 作用が実際にあった場合TRUEを返す
2204 bool project_hook(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, BIT_FLAGS flg)
2208 /* Pass through the target if needed */
2209 flg |= (PROJECT_THRU);
2211 /* Use the given direction */
2212 tx = p_ptr->x + ddx[dir];
2213 ty = p_ptr->y + ddy[dir];
2215 /* Hack -- Use an actual "target" */
2216 if ((dir == 5) && target_okay())
2222 /* Analyze the "dir" and the "target", do NOT explode */
2223 return (project(0, 0, ty, tx, dam, typ, flg, -1));
2228 * @brief ボルト系スペルの発動 / Cast a bolt spell.
2230 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2232 * @return 作用が実際にあった場合TRUEを返す
2235 * Stop if we hit a monster, as a "bolt".
2236 * Affect monsters and grids (not objects).
2239 bool fire_bolt(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam)
2241 BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_GRID;
2242 if (typ != GF_ARROW) flg |= PROJECT_REFLECTABLE;
2243 return (project_hook(typ, dir, dam, flg));
2248 * @brief ビーム系スペルの発動 / Cast a beam spell.
2250 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2252 * @return 作用が実際にあった場合TRUEを返す
2255 * Pass through monsters, as a "beam".
2256 * Affect monsters, grids and objects.
2259 bool fire_beam(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam)
2261 BIT_FLAGS flg = PROJECT_BEAM | PROJECT_KILL | PROJECT_GRID | PROJECT_ITEM;
2262 return (project_hook(typ, dir, dam, flg));
2267 * @brief 確率に応じたボルト系/ビーム系スペルの発動 / Cast a bolt spell, or rarely, a beam spell.
2268 * @param prob ビーム化する確率(%)
2270 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2272 * @return 作用が実際にあった場合TRUEを返す
2275 * Pass through monsters, as a "beam".
2276 * Affect monsters, grids and objects.
2279 bool fire_bolt_or_beam(PERCENTAGE prob, EFFECT_ID typ, DIRECTION dir, HIT_POINT dam)
2281 if (randint0(100) < prob)
2283 return (fire_beam(typ, dir, dam));
2287 return (fire_bolt(typ, dir, dam));
2292 * @brief LITE_WEAK属性による光源ビーム処理
2293 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2295 * @return 作用が実際にあった場合TRUEを返す
2297 bool lite_line(DIRECTION dir, HIT_POINT dam)
2299 BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_KILL;
2300 return (project_hook(GF_LITE_WEAK, dir, dam, flg));
2305 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2307 * @return 作用が実際にあった場合TRUEを返す
2309 bool hypodynamic_bolt(DIRECTION dir, HIT_POINT dam)
2311 BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
2312 return (project_hook(GF_HYPODYNAMIA, dir, dam, flg));
2317 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2319 * @return 作用が実際にあった場合TRUEを返す
2321 bool wall_to_mud(DIRECTION dir, HIT_POINT dam)
2323 BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
2324 return (project_hook(GF_KILL_WALL, dir, dam, flg));
2329 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2330 * @return 作用が実際にあった場合TRUEを返す
2332 bool wizard_lock(DIRECTION dir)
2334 BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
2335 return (project_hook(GF_JAM_DOOR, dir, 20 + randint1(30), flg));
2340 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2341 * @return 作用が実際にあった場合TRUEを返す
2343 bool destroy_door(DIRECTION dir)
2345 BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM;
2346 return (project_hook(GF_KILL_DOOR, dir, 0, flg));
2351 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2352 * @return 作用が実際にあった場合TRUEを返す
2354 bool disarm_trap(DIRECTION dir)
2356 BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM;
2357 return (project_hook(GF_KILL_TRAP, dir, 0, flg));
2363 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2364 * @param plev プレイヤーレベル(効力はplev*200)
2365 * @return 作用が実際にあった場合TRUEを返す
2367 bool death_ray(DIRECTION dir, PLAYER_LEVEL plev)
2369 BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
2370 return (project_hook(GF_DEATH_RAY, dir, plev * 200, flg));
2374 * @brief モンスター用テレポート処理
2375 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2376 * @param distance 移動距離
2377 * @return 作用が実際にあった場合TRUEを返す
2379 bool teleport_monster(DIRECTION dir, int distance)
2381 BIT_FLAGS flg = PROJECT_BEAM | PROJECT_KILL;
2382 return (project_hook(GF_AWAY_ALL, dir, distance, flg));
2386 * @brief ドア生成処理(プレイヤー中心に周囲1マス) / Hooks -- affect adjacent grids (radius 1 ball attack)
2387 * @return 作用が実際にあった場合TRUEを返す
2389 bool door_creation(void)
2391 BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
2392 return (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_MAKE_DOOR, flg, -1));
2396 * @brief トラップ生成処理(起点から周囲1マス)
2399 * @return 作用が実際にあった場合TRUEを返す
2401 bool trap_creation(POSITION y, POSITION x)
2403 BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
2404 return (project(0, 1, y, x, 0, GF_MAKE_TRAP, flg, -1));
2408 * @brief 森林生成処理(プレイヤー中心に周囲1マス)
2409 * @return 作用が実際にあった場合TRUEを返す
2411 bool tree_creation(void)
2413 BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
2414 return (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_MAKE_TREE, flg, -1));
2418 * @brief 魔法のルーン生成処理(プレイヤー中心に周囲1マス)
2419 * @return 作用が実際にあった場合TRUEを返す
2421 bool glyph_creation(void)
2423 BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM;
2424 return (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_MAKE_GLYPH, flg, -1));
2428 * @brief 壁生成処理(プレイヤー中心に周囲1マス)
2429 * @return 作用が実際にあった場合TRUEを返す
2431 bool wall_stone(void)
2433 BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
2434 bool dummy = (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_STONE_WALL, flg, -1));
2435 p_ptr->update |= (PU_FLOW);
2436 p_ptr->redraw |= (PR_MAP);
2441 * @brief ドア破壊処理(プレイヤー中心に周囲1マス)
2442 * @return 作用が実際にあった場合TRUEを返す
2444 bool destroy_doors_touch(void)
2446 BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
2447 return (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_KILL_DOOR, flg, -1));
2451 * @brief トラップ解除処理(プレイヤー中心に周囲1マス)
2452 * @return 作用が実際にあった場合TRUEを返す
2454 bool disarm_traps_touch(void)
2456 BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
2457 return (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_KILL_TRAP, flg, -1));
2461 * @brief スリープモンスター処理(プレイヤー中心に周囲1マス)
2462 * @return 作用が実際にあった場合TRUEを返す
2464 bool sleep_monsters_touch(void)
2466 BIT_FLAGS flg = PROJECT_KILL | PROJECT_HIDE;
2467 return (project(0, 1, p_ptr->y, p_ptr->x, p_ptr->lev, GF_OLD_SLEEP, flg, -1));
2472 * @brief 死者復活処理(起点より周囲5マス)
2473 * @param who 術者モンスターID(0ならばプレイヤー)
2476 * @return 作用が実際にあった場合TRUEを返す
2478 bool animate_dead(MONSTER_IDX who, POSITION y, POSITION x)
2480 BIT_FLAGS flg = PROJECT_ITEM | PROJECT_HIDE;
2481 return (project(who, 5, y, x, 0, GF_ANIM_DEAD, flg, -1));
2486 * @return 作用が実際にあった場合TRUEを返す
2488 void call_chaos(void)
2490 int Chaos_type, dummy, dir;
2491 PLAYER_LEVEL plev = p_ptr->lev;
2492 bool line_chaos = FALSE;
2494 int hurt_types[31] =
2496 GF_ELEC, GF_POIS, GF_ACID, GF_COLD,
2497 GF_FIRE, GF_MISSILE, GF_ARROW, GF_PLASMA,
2498 GF_HOLY_FIRE, GF_WATER, GF_LITE, GF_DARK,
2499 GF_FORCE, GF_INERTIAL, GF_MANA, GF_METEOR,
2500 GF_ICE, GF_CHAOS, GF_NETHER, GF_DISENCHANT,
2501 GF_SHARDS, GF_SOUND, GF_NEXUS, GF_CONFUSION,
2502 GF_TIME, GF_GRAVITY, GF_ROCKET, GF_NUKE,
2503 GF_HELL_FIRE, GF_DISINTEGRATE, GF_PSY_SPEAR
2506 Chaos_type = hurt_types[randint0(31)];
2507 if (one_in_(4)) line_chaos = TRUE;
2511 for (dummy = 1; dummy < 10; dummy++)
2516 fire_beam(Chaos_type, dummy, 150);
2518 fire_ball(Chaos_type, dummy, 150, 2);
2522 else if (one_in_(3))
2524 fire_ball(Chaos_type, 0, 500, 8);
2528 if (!get_aim_dir(&dir)) return;
2530 fire_beam(Chaos_type, dir, 250);
2532 fire_ball(Chaos_type, dir, 250, 3 + (plev / 35));
2537 * @brief TY_CURSE処理発動 / Activate the evil Topi Ylinen curse
2538 * @param stop_ty 再帰処理停止フラグ
2540 * @return 作用が実際にあった場合TRUEを返す
2543 * rr9: Stop the nasty things when a Cyberdemon is summoned
2544 * or the player gets paralyzed.
2547 bool activate_ty_curse(bool stop_ty, int *count)
2550 BIT_FLAGS flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
2554 switch (randint1(34))
2559 msg_print(_("地面が揺れた...", "The ground trembles..."));
2560 earthquake(p_ptr->y, p_ptr->x, 5 + randint0(10), 0);
2561 if (!one_in_(6)) break;
2566 HIT_POINT dam = damroll(10, 10);
2567 msg_print(_("純粋な魔力の次元への扉が開いた!", "A portal opens to a plane of raw mana!"));
2568 project(0, 8, p_ptr->y, p_ptr->x, dam, GF_MANA, flg, -1);
2569 take_hit(DAMAGE_NOESCAPE, dam, _("純粋な魔力の解放", "released pure mana"), -1);
2570 if (!one_in_(6)) break;
2575 msg_print(_("周囲の空間が歪んだ!", "Space warps about you!"));
2576 teleport_player(damroll(10, 10), TELEPORT_PASSIVE);
2577 if (randint0(13)) (*count) += activate_hi_summon(p_ptr->y, p_ptr->x, FALSE);
2578 if (!one_in_(6)) break;
2581 msg_print(_("エネルギーのうねりを感じた!", "You feel a surge of energy!"));
2585 project(0, 7, p_ptr->y, p_ptr->x, 50, GF_KILL_WALL, flg, -1);
2586 take_hit(DAMAGE_NOESCAPE, 50, _("エネルギーのうねり", "surge of energy"), -1);
2588 if (!one_in_(6)) break;
2589 case 1: case 2: case 3: case 16: case 17:
2590 aggravate_monsters(0);
2591 if (!one_in_(6)) break;
2592 case 4: case 5: case 6:
2593 (*count) += activate_hi_summon(p_ptr->y, p_ptr->x, FALSE);
2594 if (!one_in_(6)) break;
2595 case 7: case 8: case 9: case 18:
2596 (*count) += summon_specific(0, p_ptr->y, p_ptr->x, current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
2597 if (!one_in_(6)) break;
2598 case 10: case 11: case 12:
2599 msg_print(_("経験値が体から吸い取られた気がする!", "You feel your experience draining away..."));
2600 lose_exp(p_ptr->exp / 16);
2601 if (!one_in_(6)) break;
2602 case 13: case 14: case 15: case 19: case 20:
2603 if (stop_ty || (p_ptr->free_act && (randint1(125) < p_ptr->skill_sav)) || (p_ptr->pclass == CLASS_BERSERKER))
2609 msg_print(_("彫像になった気分だ!", "You feel like a statue!"));
2610 if (p_ptr->free_act)
2611 set_paralyzed(p_ptr, p_ptr->paralyzed + randint1(3));
2613 set_paralyzed(p_ptr, p_ptr->paralyzed + randint1(13));
2616 if (!one_in_(6)) break;
2617 case 21: case 22: case 23:
2618 (void)do_dec_stat(p_ptr, randint0(6));
2619 if (!one_in_(6)) break;
2621 msg_print(_("ほえ?私は誰?ここで何してる?", "Huh? Who am I? What am I doing here?"));
2623 if (!one_in_(6)) break;
2626 * Only summon Cyberdemons deep in the dungeon.
2628 if ((current_floor_ptr->dun_level > 65) && !stop_ty)
2630 (*count) += summon_cyber(-1, p_ptr->y, p_ptr->x);
2634 if (!one_in_(6)) break;
2640 (void)do_dec_stat(p_ptr, i);
2648 while (one_in_(3) && !stop_ty);
2654 * @brief HI_SUMMON(上級召喚)処理発動
2657 * @param can_pet プレイヤーのペットとなる可能性があるならばTRUEにする
2658 * @return 作用が実際にあった場合TRUEを返す
2660 int activate_hi_summon(POSITION y, POSITION x, bool can_pet)
2665 BIT_FLAGS mode = PM_ALLOW_GROUP;
2672 mode |= PM_FORCE_FRIENDLY;
2676 mode |= PM_FORCE_PET;
2681 if (!pet) mode |= PM_NO_PET;
2683 summon_lev = (pet ? p_ptr->lev * 2 / 3 + randint1(p_ptr->lev / 2) : current_floor_ptr->dun_level);
2685 for (i = 0; i < (randint1(7) + (current_floor_ptr->dun_level / 40)); i++)
2687 switch (randint1(25) + (current_floor_ptr->dun_level / 20))
2690 count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_ANT, mode);
2693 count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_SPIDER, mode);
2696 count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HOUND, mode);
2699 count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HYDRA, mode);
2702 count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_ANGEL, mode);
2705 count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_UNDEAD, mode);
2708 count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_DRAGON, mode);
2711 count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_DEMON, mode);
2715 count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_AMBERITES, (mode | PM_ALLOW_UNIQUE));
2719 count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_UNIQUE, (mode | PM_ALLOW_UNIQUE));
2722 if (!can_pet) mode |= PM_ALLOW_UNIQUE;
2723 count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HI_UNDEAD, mode);
2726 if (!can_pet) mode |= PM_ALLOW_UNIQUE;
2727 count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HI_DRAGON, mode);
2730 count += summon_specific((pet ? -1 : 0), y, x, 100, SUMMON_CYBER, mode);
2733 if (!can_pet) mode |= PM_ALLOW_UNIQUE;
2734 count += summon_specific((pet ? -1 : 0), y, x,pet ? summon_lev : (((summon_lev * 3) / 2) + 5), 0, mode);
2742 * @brief 周辺破壊効果(プレイヤー中心)
2743 * @return 作用が実際にあった場合TRUEを返す
2745 void wall_breaker(void)
2748 POSITION y = 0, x = 0;
2749 int attempts = 1000;
2751 if (randint1(80 + p_ptr->lev) < 70)
2755 scatter(&y, &x, p_ptr->y, p_ptr->x, 4, 0);
2757 if (!cave_have_flag_bold(y, x, FF_PROJECT)) continue;
2759 if (!player_bold(y, x)) break;
2762 project(0, 0, y, x, 20 + randint1(30), GF_KILL_WALL,
2763 (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1);
2765 else if (randint1(100) > 30)
2767 earthquake(p_ptr->y, p_ptr->x, 1, 0);
2771 int num = damroll(5, 3);
2773 for (i = 0; i < num; i++)
2777 scatter(&y, &x, p_ptr->y, p_ptr->x, 10, 0);
2779 if (!player_bold(y, x)) break;
2782 project(0, 0, y, x, 20 + randint1(30), GF_KILL_WALL,
2783 (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1);
2790 * @brief パニック・モンスター効果(プレイヤー視界範囲内) / Confuse monsters
2792 * @return 作用が実際にあった場合TRUEを返す
2794 bool confuse_monsters(HIT_POINT dam)
2796 return (project_all_los(GF_OLD_CONF, dam));
2801 * @brief チャーム・モンスター効果(プレイヤー視界範囲内) / Charm monsters
2803 * @return 作用が実際にあった場合TRUEを返す
2805 bool charm_monsters(HIT_POINT dam)
2807 return (project_all_los(GF_CHARM, dam));
2812 * @brief 動物魅了効果(プレイヤー視界範囲内) / Charm Animals
2814 * @return 作用が実際にあった場合TRUEを返す
2816 bool charm_animals(HIT_POINT dam)
2818 return (project_all_los(GF_CONTROL_ANIMAL, dam));
2823 * @brief モンスター朦朧効果(プレイヤー視界範囲内) / Stun monsters
2825 * @return 作用が実際にあった場合TRUEを返す
2827 bool stun_monsters(HIT_POINT dam)
2829 return (project_all_los(GF_STUN, dam));
2834 * @brief モンスター停止効果(プレイヤー視界範囲内) / Stasis monsters
2836 * @return 作用が実際にあった場合TRUEを返す
2838 bool stasis_monsters(HIT_POINT dam)
2840 return (project_all_los(GF_STASIS, dam));
2845 * @brief モンスター精神攻撃効果(プレイヤー視界範囲内) / Mindblast monsters
2847 * @return 作用が実際にあった場合TRUEを返す
2849 bool mindblast_monsters(HIT_POINT dam)
2851 return (project_all_los(GF_PSI, dam));
2856 * @brief モンスター追放効果(プレイヤー視界範囲内) / Banish all monsters
2857 * @param dist 効力(距離)
2858 * @return 作用が実際にあった場合TRUEを返す
2860 bool banish_monsters(int dist)
2862 return (project_all_los(GF_AWAY_ALL, dist));
2867 * @brief 邪悪退散効果(プレイヤー視界範囲内) / Turn evil
2869 * @return 作用が実際にあった場合TRUEを返す
2871 bool turn_evil(HIT_POINT dam)
2873 return (project_all_los(GF_TURN_EVIL, dam));
2878 * @brief 全モンスター退散効果(プレイヤー視界範囲内) / Turn everyone
2880 * @return 作用が実際にあった場合TRUEを返す
2882 bool turn_monsters(HIT_POINT dam)
2884 return (project_all_los(GF_TURN_ALL, dam));
2889 * @brief 死の光線(プレイヤー視界範囲内) / Death-ray all monsters (note: OBSCENELY powerful)
2890 * @return 作用が実際にあった場合TRUEを返す
2892 bool deathray_monsters(void)
2894 return (project_all_los(GF_DEATH_RAY, p_ptr->lev * 200));
2898 * @brief チャーム・モンスター(1体)
2899 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2901 * @return 作用が実際にあった場合TRUEを返す
2903 bool charm_monster(DIRECTION dir, PLAYER_LEVEL plev)
2905 BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
2906 return (project_hook(GF_CHARM, dir, plev, flg));
2910 * @brief アンデッド支配(1体)
2911 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2913 * @return 作用が実際にあった場合TRUEを返す
2915 bool control_one_undead(DIRECTION dir, PLAYER_LEVEL plev)
2917 BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
2918 return (project_hook(GF_CONTROL_UNDEAD, dir, plev, flg));
2923 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2925 * @return 作用が実際にあった場合TRUEを返す
2927 bool control_one_demon(DIRECTION dir, PLAYER_LEVEL plev)
2929 BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
2930 return (project_hook(GF_CONTROL_DEMON, dir, plev, flg));
2935 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2937 * @return 作用が実際にあった場合TRUEを返す
2939 bool charm_animal(DIRECTION dir, PLAYER_LEVEL plev)
2941 BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
2942 return (project_hook(GF_CONTROL_ANIMAL, dir, plev, flg));
2948 * @param success 判定成功上の処理ならばTRUE
2949 * @return 作用が実際にあった場合TRUEを返す
2951 bool kawarimi(bool success)
2954 object_type *q_ptr = &forge;
2957 if (p_ptr->is_dead) return FALSE;
2958 if (p_ptr->confused || p_ptr->blind || p_ptr->paralyzed || p_ptr->image) return FALSE;
2959 if (randint0(200) < p_ptr->stun) return FALSE;
2961 if (!success && one_in_(3))
2963 msg_print(_("失敗!逃げられなかった。", "Failed! You couldn't run away."));
2964 p_ptr->special_defense &= ~(NINJA_KAWARIMI);
2965 p_ptr->redraw |= (PR_STATUS);
2972 teleport_player(10 + randint1(90), 0L);
2974 object_prep(q_ptr, lookup_kind(TV_STATUE, SV_WOODEN_STATUE));
2976 q_ptr->pval = MON_NINJA;
2977 (void)drop_near(q_ptr, -1, y, x);
2979 if (success) msg_print(_("攻撃を受ける前に素早く身をひるがえした。", "You have turned around just before the attack hit you."));
2980 else msg_print(_("失敗!攻撃を受けてしまった。", "Failed! You are hit by the attack."));
2982 p_ptr->special_defense &= ~(NINJA_KAWARIMI);
2983 p_ptr->redraw |= (PR_STATUS);
2991 * @brief 入身処理 / "Rush Attack" routine for Samurai or Ninja
2992 * @param mdeath 目標モンスターが死亡したかを返す
2993 * @return 作用が実際にあった場合TRUEを返す / Return value is for checking "done"
2995 bool rush_attack(bool *mdeath)
3002 bool tmp_mdeath = FALSE;
3005 if (mdeath) *mdeath = FALSE;
3008 if (!get_aim_dir(&dir)) return FALSE;
3010 /* Use the given direction */
3011 tx = p_ptr->x + project_length * ddx[dir];
3012 ty = p_ptr->y + project_length * ddy[dir];
3014 /* Hack -- Use an actual "target" */
3015 if ((dir == 5) && target_okay())
3021 if (in_bounds(ty, tx)) tm_idx = current_floor_ptr->grid_array[ty][tx].m_idx;
3023 path_n = project_path(path_g, project_length, p_ptr->y, p_ptr->x, ty, tx, PROJECT_STOP | PROJECT_KILL);
3026 /* No need to move */
3027 if (!path_n) return TRUE;
3029 /* Use ty and tx as to-move point */
3033 /* Project along the path */
3034 for (i = 0; i < path_n; i++)
3036 monster_type *m_ptr;
3038 int ny = GRID_Y(path_g[i]);
3039 int nx = GRID_X(path_g[i]);
3041 if (cave_empty_bold(ny, nx) && player_can_enter(current_floor_ptr->grid_array[ny][nx].feat, 0))
3046 /* Go to next grid */
3050 if (!current_floor_ptr->grid_array[ny][nx].m_idx)
3054 msg_print(_("失敗!", "Failed!"));
3058 msg_print(_("ここには入身では入れない。", "You can't move to that place."));
3065 /* Move player before updating the monster */
3066 if (!player_bold(ty, tx)) teleport_player_to(ty, tx, TELEPORT_NONMAGICAL);
3067 update_monster(current_floor_ptr->grid_array[ny][nx].m_idx, TRUE);
3069 /* Found a monster */
3070 m_ptr = ¤t_floor_ptr->m_list[current_floor_ptr->grid_array[ny][nx].m_idx];
3072 if (tm_idx != current_floor_ptr->grid_array[ny][nx].m_idx)
3075 msg_format("%s%sが立ちふさがっている!", tm_idx ? "別の" : "", m_ptr->ml ? "モンスター" : "何か");
3077 msg_format("There is %s in the way!", m_ptr->ml ? (tm_idx ? "another monster" : "a monster") : "someone");
3080 else if (!player_bold(ty, tx))
3082 /* Hold the monster name */
3083 GAME_TEXT m_name[MAX_NLEN];
3085 /* Get the monster name (BEFORE polymorphing) */
3086 monster_desc(m_name, m_ptr, 0);
3087 msg_format(_("素早く%sの懐に入り込んだ!", "You quickly jump in and attack %s!"), m_name);
3090 if (!player_bold(ty, tx)) teleport_player_to(ty, tx, TELEPORT_NONMAGICAL);
3092 tmp_mdeath = py_attack(ny, nx, HISSATSU_NYUSIN);
3097 if (!moved && !player_bold(ty, tx)) teleport_player_to(ty, tx, TELEPORT_NONMAGICAL);
3099 if (mdeath) *mdeath = tmp_mdeath;
3105 * @brief 全鏡の消去 / Remove all mirrors in this floor
3106 * @param explode 爆発処理を伴うならばTRUE
3109 void remove_all_mirrors(bool explode)
3113 for (x = 0; x < current_floor_ptr->width; x++)
3115 for (y = 0; y < current_floor_ptr->height; y++)
3117 if (is_mirror_grid(¤t_floor_ptr->grid_array[y][x]))
3119 remove_mirror(y, x);
3121 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS,
3122 (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
3129 * @brief 『一つの指輪』の効果処理 /
3130 * Hack -- activate the ring of power
3131 * @param dir 発動の方向ID
3134 void ring_of_power(DIRECTION dir)
3136 /* Pick a random effect */
3137 switch (randint1(10))
3142 msg_print(_("あなたは悪性のオーラに包み込まれた。", "You are surrounded by a malignant aura."));
3145 /* Decrease all stats (permanently) */
3146 (void)dec_stat(p_ptr, A_STR, 50, TRUE);
3147 (void)dec_stat(p_ptr, A_INT, 50, TRUE);
3148 (void)dec_stat(p_ptr, A_WIS, 50, TRUE);
3149 (void)dec_stat(p_ptr, A_DEX, 50, TRUE);
3150 (void)dec_stat(p_ptr, A_CON, 50, TRUE);
3151 (void)dec_stat(p_ptr, A_CHR, 50, TRUE);
3153 /* Lose some experience (permanently) */
3154 p_ptr->exp -= (p_ptr->exp / 4);
3155 p_ptr->max_exp -= (p_ptr->exp / 4);
3163 msg_print(_("あなたは強力なオーラに包み込まれた。", "You are surrounded by a powerful aura."));
3164 dispel_monsters(1000);
3172 fire_ball(GF_MANA, dir, 600, 3);
3181 fire_bolt(GF_MANA, dir, 500);
3188 * @brief 運命の輪、並びにカオス的な効果の発動
3189 * @param spell ランダムな効果を選択するための基準ID
3192 void wild_magic(int spell)
3195 int type = SUMMON_MOLD + randint0(6);
3197 if (type < SUMMON_MOLD) type = SUMMON_MOLD;
3198 else if (type > SUMMON_MIMIC) type = SUMMON_MIMIC;
3200 switch (randint1(spell) + randint1(8) + 1)
3205 teleport_player(10, TELEPORT_PASSIVE);
3210 teleport_player(100, TELEPORT_PASSIVE);
3214 teleport_player(200, TELEPORT_PASSIVE);
3224 lite_area(damroll(2, 3), 2);
3227 destroy_doors_touch();
3232 sleep_monsters_touch();
3236 trap_creation(p_ptr->y, p_ptr->x);
3245 aggravate_monsters(0);
3248 earthquake(p_ptr->y, p_ptr->x, 5, 0);
3252 (void)gain_mutation(p_ptr, 0);
3256 apply_disenchant(1);
3262 fire_ball(GF_CHAOS, 0, spell + 5, 1 + (spell / 10));
3269 while (counter++ < 8)
3271 (void)summon_specific(0, p_ptr->y, p_ptr->x, (current_floor_ptr->dun_level * 3) / 2, type, (PM_ALLOW_GROUP | PM_NO_PET));
3276 activate_hi_summon(p_ptr->y, p_ptr->x, FALSE);
3279 (void)summon_cyber(-1, p_ptr->y, p_ptr->x);
3284 (void)activate_ty_curse(FALSE, &count);
3293 * @brief カオス魔法「流星群」の処理としてプレイヤーを中心に隕石落下処理を10+1d10回繰り返す。
3294 * / Drop 10+1d10 meteor ball at random places near the player
3299 void cast_meteor(HIT_POINT dam, POSITION rad)
3302 int b = 10 + randint1(10);
3304 for (i = 0; i < b; i++)
3306 POSITION y = 0, x = 0;
3309 for (count = 0; count <= 20; count++)
3313 x = p_ptr->x - 8 + randint0(17);
3314 y = p_ptr->y - 8 + randint0(17);
3316 dx = (p_ptr->x > x) ? (p_ptr->x - x) : (x - p_ptr->x);
3317 dy = (p_ptr->y > y) ? (p_ptr->y - y) : (y - p_ptr->y);
3319 /* Approximate distance */
3320 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
3322 if (d >= 9) continue;
3324 if (!in_bounds(y, x) || !projectable(p_ptr->y, p_ptr->x, y, x)
3325 || !cave_have_flag_bold(y, x, FF_PROJECT)) continue;
3327 /* Valid position */
3331 if (count > 20) continue;
3333 project(0, rad, y, x, dam, GF_METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM, -1);
3339 * @brief 破邪魔法「神の怒り」の処理としてターゲットを指定した後分解のボールを最大20回発生させる。
3342 * @return ターゲットを指定し、実行したならばTRUEを返す。
3344 bool cast_wrath_of_the_god(HIT_POINT dam, POSITION rad)
3346 POSITION x, y, tx, ty;
3350 int b = 10 + randint1(10);
3352 if (!get_aim_dir(&dir)) return FALSE;
3354 /* Use the given direction */
3355 tx = p_ptr->x + 99 * ddx[dir];
3356 ty = p_ptr->y + 99 * ddy[dir];
3358 /* Hack -- Use an actual "target" */
3359 if ((dir == 5) && target_okay())
3370 /* Hack -- Stop at the target */
3371 if ((y == ty) && (x == tx)) break;
3375 mmove2(&ny, &nx, p_ptr->y, p_ptr->x, ty, tx);
3377 /* Stop at maximum range */
3378 if (MAX_RANGE <= distance(p_ptr->y, p_ptr->x, ny, nx)) break;
3380 /* Stopped by walls/doors */
3381 if (!cave_have_flag_bold(ny, nx, FF_PROJECT)) break;
3383 /* Stopped by monsters */
3384 if ((dir != 5) && current_floor_ptr->grid_array[ny][nx].m_idx != 0) break;
3386 /* Save the new location */
3393 for (i = 0; i < b; i++)
3395 int count = 20, d = 0;
3401 x = tx - 5 + randint0(11);
3402 y = ty - 5 + randint0(11);
3404 dx = (tx > x) ? (tx - x) : (x - tx);
3405 dy = (ty > y) ? (ty - y) : (y - ty);
3407 /* Approximate distance */
3408 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
3409 /* Within the radius */
3413 if (count < 0) continue;
3415 /* Cannot penetrate perm walls */
3416 if (!in_bounds(y, x) ||
3417 cave_stop_disintegration(y, x) ||
3418 !in_disintegration_range(ty, tx, y, x))
3421 project(0, rad, y, x, dam, GF_DISINTEGRATE, PROJECT_JUMP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL, -1);
3428 * @brief 「ワンダー」のランダムな効果を決定して処理する。
3432 * This spell should become more useful (more controlled) as the\n
3433 * player gains experience levels. Thus, add 1/5 of the player's\n
3434 * level to the die roll. This eliminates the worst effects later on,\n
3435 * while keeping the results quite random. It also allows some potent\n
3436 * effects only at high level.
3438 void cast_wonder(DIRECTION dir)
3440 PLAYER_LEVEL plev = p_ptr->lev;
3441 int die = randint1(100) + plev / 5;
3442 int vir = virtue_number(V_CHANCE);
3446 if (p_ptr->virtues[vir - 1] > 0)
3448 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
3452 while (randint1(400) < (0 - p_ptr->virtues[vir - 1])) die--;
3457 chg_virtue(V_CHANCE, 1);
3461 msg_print(_("あなたは力がみなぎるのを感じた!", "You feel a surge of power!"));
3464 if (die < 8) clone_monster(dir);
3465 else if (die < 14) speed_monster(dir, plev);
3466 else if (die < 26) heal_monster(dir, damroll(4, 6));
3467 else if (die < 31) poly_monster(dir, plev);
3469 fire_bolt_or_beam(beam_chance() - 10, GF_MISSILE, dir,
3470 damroll(3 + ((plev - 1) / 5), 4));
3471 else if (die < 41) confuse_monster(dir, plev);
3472 else if (die < 46) fire_ball(GF_POIS, dir, 20 + (plev / 2), 3);
3473 else if (die < 51) (void)lite_line(dir, damroll(6, 8));
3475 fire_bolt_or_beam(beam_chance() - 10, GF_ELEC, dir,
3476 damroll(3 + ((plev - 5) / 4), 8));
3478 fire_bolt_or_beam(beam_chance() - 10, GF_COLD, dir,
3479 damroll(5 + ((plev - 5) / 4), 8));
3481 fire_bolt_or_beam(beam_chance(), GF_ACID, dir,
3482 damroll(6 + ((plev - 5) / 4), 8));
3484 fire_bolt_or_beam(beam_chance(), GF_FIRE, dir,
3485 damroll(8 + ((plev - 5) / 4), 8));
3486 else if (die < 76) hypodynamic_bolt(dir, 75);
3487 else if (die < 81) fire_ball(GF_ELEC, dir, 30 + plev / 2, 2);
3488 else if (die < 86) fire_ball(GF_ACID, dir, 40 + plev, 2);
3489 else if (die < 91) fire_ball(GF_ICE, dir, 70 + plev, 3);
3490 else if (die < 96) fire_ball(GF_FIRE, dir, 80 + plev, 3);
3491 else if (die < 101) hypodynamic_bolt(dir, 100 + plev);
3494 earthquake(p_ptr->y, p_ptr->x, 12, 0);
3498 (void)destroy_area(p_ptr->y, p_ptr->x, 13 + randint0(5), FALSE);
3502 symbol_genocide(plev + 50, TRUE);
3504 else if (die < 110) dispel_monsters(120);
3507 dispel_monsters(150);
3508 slow_monsters(plev);
3509 sleep_monsters(plev);
3510 hp_player(p_ptr, 300);
3516 * @brief 「悪霊召喚」のランダムな効果を決定して処理する。
3520 void cast_invoke_spirits(DIRECTION dir)
3522 PLAYER_LEVEL plev = p_ptr->lev;
3523 int die = randint1(100) + plev / 5;
3524 int vir = virtue_number(V_CHANCE);
3528 if (p_ptr->virtues[vir - 1] > 0)
3530 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
3534 while (randint1(400) < (0 - p_ptr->virtues[vir - 1])) die--;
3538 msg_print(_("あなたは死者たちの力を招集した...", "You call on the power of the dead..."));
3540 chg_virtue(V_CHANCE, 1);
3544 msg_print(_("あなたはおどろおどろしい力のうねりを感じた!", "You feel a surge of eldritch force!"));
3549 msg_print(_("なんてこった!あなたの周りの地面から朽ちた人影が立ち上がってきた!",
3550 "Oh no! Mouldering forms rise from the earth around you!"));
3552 (void)summon_specific(0, p_ptr->y, p_ptr->x, current_floor_ptr->dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
3553 chg_virtue(V_UNLIFE, 1);
3557 msg_print(_("名状し難い邪悪な存在があなたの心を通り過ぎて行った...", "An unnamable evil brushes against your mind..."));
3559 set_afraid(p_ptr, p_ptr->afraid + randint1(4) + 4);
3563 msg_print(_("あなたの頭に大量の幽霊たちの騒々しい声が押し寄せてきた...",
3564 "Your head is invaded by a horde of gibbering spectral voices..."));
3566 set_confused(p_ptr, p_ptr->confused + randint1(4) + 4);
3570 poly_monster(dir, plev);
3574 fire_bolt_or_beam(beam_chance() - 10, GF_MISSILE, dir,
3575 damroll(3 + ((plev - 1) / 5), 4));
3579 confuse_monster(dir, plev);
3583 fire_ball(GF_POIS, dir, 20 + (plev / 2), 3);
3587 (void)lite_line(dir, damroll(6, 8));
3591 fire_bolt_or_beam(beam_chance() - 10, GF_ELEC, dir,
3592 damroll(3 + ((plev - 5) / 4), 8));
3596 fire_bolt_or_beam(beam_chance() - 10, GF_COLD, dir,
3597 damroll(5 + ((plev - 5) / 4), 8));
3601 fire_bolt_or_beam(beam_chance(), GF_ACID, dir,
3602 damroll(6 + ((plev - 5) / 4), 8));
3606 fire_bolt_or_beam(beam_chance(), GF_FIRE, dir,
3607 damroll(8 + ((plev - 5) / 4), 8));
3611 hypodynamic_bolt(dir, 75);
3615 fire_ball(GF_ELEC, dir, 30 + plev / 2, 2);
3619 fire_ball(GF_ACID, dir, 40 + plev, 2);
3623 fire_ball(GF_ICE, dir, 70 + plev, 3);
3627 fire_ball(GF_FIRE, dir, 80 + plev, 3);
3631 hypodynamic_bolt(dir, 100 + plev);
3635 earthquake(p_ptr->y, p_ptr->x, 12, 0);
3639 (void)destroy_area(p_ptr->y, p_ptr->x, 13 + randint0(5), FALSE);
3643 symbol_genocide(plev + 50, TRUE);
3647 dispel_monsters(120);
3651 dispel_monsters(150);
3652 slow_monsters(plev);
3653 sleep_monsters(plev);
3654 hp_player(p_ptr, 300);
3659 msg_print(_("陰欝な声がクスクス笑う。「もうすぐおまえは我々の仲間になるだろう。弱き者よ。」",
3660 "Sepulchral voices chuckle. 'Soon you will join us, mortal.'"));
3665 * @brief トランプ領域の「シャッフル」の効果をランダムに決めて処理する。
3668 void cast_shuffle(void)
3670 PLAYER_LEVEL plev = p_ptr->lev;
3673 int vir = virtue_number(V_CHANCE);
3676 /* Card sharks and high mages get a level bonus */
3677 if ((p_ptr->pclass == CLASS_ROGUE) ||
3678 (p_ptr->pclass == CLASS_HIGH_MAGE) ||
3679 (p_ptr->pclass == CLASS_SORCERER))
3680 die = (randint1(110)) + plev / 5;
3682 die = randint1(120);
3687 if (p_ptr->virtues[vir - 1] > 0)
3689 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
3693 while (randint1(400) < (0 - p_ptr->virtues[vir - 1])) die--;
3697 msg_print(_("あなたはカードを切って一枚引いた...", "You shuffle the deck and draw a card..."));
3700 chg_virtue(V_CHANCE, 1);
3704 msg_print(_("なんてこった!《死》だ!", "Oh no! It's Death!"));
3706 for (i = 0; i < randint1(3); i++)
3707 activate_hi_summon(p_ptr->y, p_ptr->x, FALSE);
3711 msg_print(_("なんてこった!《悪魔》だ!", "Oh no! It's the Devil!"));
3712 summon_specific(0, p_ptr->y, p_ptr->x, current_floor_ptr->dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
3717 msg_print(_("なんてこった!《吊られた男》だ!", "Oh no! It's the Hanged Man."));
3718 activate_ty_curse(FALSE, &count);
3722 msg_print(_("《不調和の剣》だ。", "It's the swords of discord."));
3723 aggravate_monsters(0);
3727 msg_print(_("《愚者》だ。", "It's the Fool."));
3728 do_dec_stat(p_ptr, A_INT);
3729 do_dec_stat(p_ptr, A_WIS);
3733 msg_print(_("奇妙なモンスターの絵だ。", "It's the picture of a strange monster."));
3734 trump_summoning(1, FALSE, p_ptr->y, p_ptr->x, (current_floor_ptr->dun_level * 3 / 2), (32 + randint1(6)), PM_ALLOW_GROUP | PM_ALLOW_UNIQUE);
3738 msg_print(_("《月》だ。", "It's the Moon."));
3743 msg_print(_("《運命の輪》だ。", "It's the Wheel of Fortune."));
3744 wild_magic(randint0(32));
3748 msg_print(_("テレポート・カードだ。", "It's a teleport trump card."));
3749 teleport_player(10, TELEPORT_PASSIVE);
3753 msg_print(_("《正義》だ。", "It's Justice."));
3754 set_blessed(p_ptr->lev, FALSE);
3758 msg_print(_("テレポート・カードだ。", "It's a teleport trump card."));
3759 teleport_player(100, TELEPORT_PASSIVE);
3763 msg_print(_("テレポート・カードだ。", "It's a teleport trump card."));
3764 teleport_player(200, TELEPORT_PASSIVE);
3768 msg_print(_("《塔》だ。", "It's the Tower."));
3773 msg_print(_("《節制》だ。", "It's Temperance."));
3774 sleep_monsters_touch();
3778 msg_print(_("《塔》だ。", "It's the Tower."));
3780 earthquake(p_ptr->y, p_ptr->x, 5, 0);
3784 msg_print(_("友好的なモンスターの絵だ。", "It's the picture of a friendly monster."));
3785 trump_summoning(1, TRUE, p_ptr->y, p_ptr->x, (current_floor_ptr->dun_level * 3 / 2), SUMMON_MOLD, 0L);
3789 msg_print(_("友好的なモンスターの絵だ。", "It's the picture of a friendly monster."));
3790 trump_summoning(1, TRUE, p_ptr->y, p_ptr->x, (current_floor_ptr->dun_level * 3 / 2), SUMMON_BAT, 0L);
3794 msg_print(_("友好的なモンスターの絵だ。", "It's the picture of a friendly monster."));
3795 trump_summoning(1, TRUE, p_ptr->y, p_ptr->x, (current_floor_ptr->dun_level * 3 / 2), SUMMON_VORTEX, 0L);
3799 msg_print(_("友好的なモンスターの絵だ。", "It's the picture of a friendly monster."));
3800 trump_summoning(1, TRUE, p_ptr->y, p_ptr->x, (current_floor_ptr->dun_level * 3 / 2), SUMMON_COIN_MIMIC, 0L);
3804 msg_print(_("《恋人》だ。", "It's the Lovers."));
3806 if (get_aim_dir(&dir))
3807 charm_monster(dir, MIN(p_ptr->lev, 20));
3811 msg_print(_("《隠者》だ。", "It's the Hermit."));
3816 msg_print(_("《審判》だ。", "It's the Judgement."));
3817 roll_hitdice(p_ptr, 0L);
3818 lose_all_mutations();
3822 msg_print(_("《太陽》だ。", "It's the Sun."));
3823 chg_virtue(V_KNOWLEDGE, 1);
3824 chg_virtue(V_ENLIGHTEN, 1);
3829 msg_print(_("《世界》だ。", "It's the World."));
3830 if (p_ptr->exp < PY_MAX_EXP)
3832 s32b ee = (p_ptr->exp / 25) + 1;
3833 if (ee > 5000) ee = 5000;
3834 msg_print(_("更に経験を積んだような気がする。", "You feel more experienced."));
3841 * @brief 口を使う継続的な処理を中断する
3844 void stop_mouth(void)
3846 if (music_singing_any()) stop_singing(p_ptr);
3847 if (hex_spelling_any()) stop_hex_spell_all();
3851 bool_hack vampirism(void)
3858 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_MELEE)
3860 msg_print(_("なぜか攻撃することができない。", "Something prevent you from attacking."));
3864 /* Only works on adjacent monsters */
3865 if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
3866 y = p_ptr->y + ddy[dir];
3867 x = p_ptr->x + ddx[dir];
3868 g_ptr = ¤t_floor_ptr->grid_array[y][x];
3872 if (!(g_ptr->m_idx))
3874 msg_print(_("何もない場所に噛みついた!", "You bite into thin air!"));
3878 msg_print(_("あなたはニヤリとして牙をむいた...", "You grin and bare your fangs..."));
3880 dummy = p_ptr->lev * 2;
3882 if (hypodynamic_bolt(dir, dummy))
3884 if (p_ptr->food < PY_FOOD_FULL)
3885 /* No heal if we are "full" */
3886 (void)hp_player(p_ptr, dummy);
3888 msg_print(_("あなたは空腹ではありません。", "You were not hungry."));
3890 /* Gain nutritional sustenance: 150/hp drained */
3891 /* A Food ration gives 5000 food points (by contrast) */
3892 /* Don't ever get more than "Full" this way */
3893 /* But if we ARE Gorged, it won't cure us */
3894 dummy = p_ptr->food + MIN(5000, 100 * dummy);
3895 if (p_ptr->food < PY_FOOD_MAX) /* Not gorged already */
3896 (void)set_food(dummy >= PY_FOOD_MAX ? PY_FOOD_MAX - 1 : dummy);
3899 msg_print(_("げぇ!ひどい味だ。", "Yechh. That tastes foul."));
3903 bool panic_hit(void)
3908 if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
3909 y = p_ptr->y + ddy[dir];
3910 x = p_ptr->x + ddx[dir];
3911 if (current_floor_ptr->grid_array[y][x].m_idx)
3914 if (randint0(p_ptr->skill_dis) < 7)
3915 msg_print(_("うまく逃げられなかった。", "You failed to run away."));
3917 teleport_player(30, 0L);
3922 msg_print(_("その方向にはモンスターはいません。", "You don't see any monster in this direction"));
3930 * @brief 超能力者のサイコメトリー処理/ Forcibly pseudo-identify an object in the p_ptr->inventory_list (or on the floor)
3933 * currently this function allows pseudo-id of any object,
3934 * including silly ones like potions & scrolls, which always
3935 * get '{average}'. This should be changed, either to stop such
3936 * items from being pseudo-id'd, or to allow psychometry to
3937 * detect whether the unidentified potion/scroll/etc is
3938 * good (Cure Light Wounds, Restore Strength, etc) or
3939 * bad (Poison, Weakness etc) or 'useless' (Slime Mold Juice, etc).
3941 bool psychometry(void)
3945 GAME_TEXT o_name[MAX_NLEN];
3950 q = _("どのアイテムを調べますか?", "Meditate on which item? ");
3951 s = _("調べるアイテムがありません。", "You have nothing appropriate.");
3953 o_ptr = choose_object(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
3954 if (!o_ptr) return (FALSE);
3956 /* It is fully known, no information needed */
3957 if (object_is_known(o_ptr))
3959 msg_print(_("何も新しいことは判らなかった。", "You cannot find out anything more about that."));
3963 /* Check for a feeling */
3964 feel = value_check_aux1(o_ptr);
3966 /* Get an object description */
3967 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
3969 /* Skip non-feelings */
3972 msg_format(_("%sからは特に変わった事は感じとれなかった。", "You do not perceive anything unusual about the %s."), o_name);
3977 msg_format("%sは%sという感じがする...", o_name, game_inscriptions[feel]);
3979 msg_format("You feel that the %s %s %s...",
3980 o_name, ((o_ptr->number == 1) ? "is" : "are"), game_inscriptions[feel]);
3984 o_ptr->ident |= (IDENT_SENSE);
3985 o_ptr->feeling = feel;
3986 o_ptr->marked |= OM_TOUCHED;
3988 p_ptr->update |= (PU_COMBINE | PU_REORDER);
3989 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
3991 /* Valid "tval" codes */
3992 switch (o_ptr->tval)
4020 /* Auto-inscription/destroy */
4021 autopick_alter_item(item, (bool)(okay && destroy_feeling));
4023 /* Something happened */
4028 bool draconian_breath(player_type *creature_ptr)
4031 int Type = (one_in_(3) ? GF_COLD : GF_FIRE);
4032 concptr Type_desc = ((Type == GF_COLD) ? _("冷気", "cold") : _("炎", "fire"));
4034 if (!get_aim_dir(&dir)) return FALSE;
4036 if (randint1(100) < creature_ptr->lev)
4038 switch (creature_ptr->pclass)
4041 case CLASS_BERSERKER:
4044 case CLASS_IMITATOR:
4050 Type_desc = _("エレメント", "the elements");
4055 Type_desc = _("破片", "shards");
4059 case CLASS_WARRIOR_MAGE:
4060 case CLASS_HIGH_MAGE:
4061 case CLASS_SORCERER:
4062 case CLASS_MAGIC_EATER:
4063 case CLASS_RED_MAGE:
4064 case CLASS_BLUE_MAGE:
4065 case CLASS_MIRROR_MASTER:
4069 Type_desc = _("魔力", "mana");
4073 Type = GF_DISENCHANT;
4074 Type_desc = _("劣化", "disenchantment");
4077 case CLASS_CHAOS_WARRIOR:
4080 Type = GF_CONFUSION;
4081 Type_desc = _("混乱", "confusion");
4086 Type_desc = _("カオス", "chaos");
4091 case CLASS_FORCETRAINER:
4094 Type = GF_CONFUSION;
4095 Type_desc = _("混乱", "confusion");
4100 Type_desc = _("轟音", "sound");
4103 case CLASS_MINDCRAFTER:
4106 Type = GF_CONFUSION;
4107 Type_desc = _("混乱", "confusion");
4112 Type_desc = _("精神エネルギー", "mental energy");
4119 Type = GF_HELL_FIRE;
4120 Type_desc = _("地獄の劫火", "hellfire");
4124 Type = GF_HOLY_FIRE;
4125 Type_desc = _("聖なる炎", "holy fire");
4133 Type_desc = _("暗黒", "darkness");
4138 Type_desc = _("毒", "poison");
4145 Type_desc = _("轟音", "sound");
4149 Type = GF_CONFUSION;
4150 Type_desc = _("混乱", "confusion");
4157 msg_format(_("あなたは%sのブレスを吐いた。", "You breathe %s."), Type_desc);
4159 fire_breath(Type, dir, creature_ptr->lev * 2, (creature_ptr->lev / 15) + 1);
4163 bool android_inside_weapon(player_type *creature_ptr)
4166 if (!get_aim_dir(&dir)) return FALSE;
4167 if (creature_ptr->lev < 10)
4169 msg_print(_("レイガンを発射した。", "You fire your ray gun."));
4170 fire_bolt(GF_MISSILE, dir, (creature_ptr->lev + 1) / 2);
4172 else if (creature_ptr->lev < 25)
4174 msg_print(_("ブラスターを発射した。", "You fire your blaster."));
4175 fire_bolt(GF_MISSILE, dir, creature_ptr->lev);
4177 else if (creature_ptr->lev < 35)
4179 msg_print(_("バズーカを発射した。", "You fire your bazooka."));
4180 fire_ball(GF_MISSILE, dir, creature_ptr->lev * 2, 2);
4182 else if (creature_ptr->lev < 45)
4184 msg_print(_("ビームキャノンを発射した。", "You fire a beam cannon."));
4185 fire_beam(GF_MISSILE, dir, creature_ptr->lev * 2);
4189 msg_print(_("ロケットを発射した。", "You fire a rocket."));
4190 fire_rocket(GF_ROCKET, dir, creature_ptr->lev * 5, 2);
4195 bool create_ration(player_type *crature_ptr)
4201 /* Create the food ration */
4202 object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_RATION));
4204 /* Drop the object from heaven */
4205 (void)drop_near(q_ptr, -1, crature_ptr->y, crature_ptr->x);
4206 msg_print(_("食事を料理して作った。", "You cook some food."));
4210 void hayagake(player_type *creature_ptr)
4212 if (creature_ptr->action == ACTION_HAYAGAKE)
4214 set_action(ACTION_NONE);
4218 grid_type *g_ptr = ¤t_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x];
4219 feature_type *f_ptr = &f_info[g_ptr->feat];
4221 if (!have_flag(f_ptr->flags, FF_PROJECT) ||
4222 (!creature_ptr->levitation && have_flag(f_ptr->flags, FF_DEEP)))
4224 msg_print(_("ここでは素早く動けない。", "You cannot run in here."));
4228 set_action(ACTION_HAYAGAKE);
4231 creature_ptr->energy_use = 0;
4234 bool double_attack(player_type *creature_ptr)
4239 if (!get_rep_dir(&dir, FALSE)) return FALSE;
4240 y = creature_ptr->y + ddy[dir];
4241 x = creature_ptr->x + ddx[dir];
4242 if (current_floor_ptr->grid_array[y][x].m_idx)
4245 msg_print(_("あーたたたたたたたたたたたたたたたたたたたたたた!!!",
4246 "Ahhhtatatatatatatatatatatatatatataatatatatattaaaaa!!!!"));
4248 msg_print(_("無駄無駄無駄無駄無駄無駄無駄無駄無駄無駄無駄無駄!!!",
4249 "Mudamudamudamudamudamudamudamudamudamudamudamudamuda!!!!"));
4251 msg_print(_("オラオラオラオラオラオラオラオラオラオラオラオラ!!!",
4252 "Oraoraoraoraoraoraoraoraoraoraoraoraoraoraoraoraora!!!!"));
4255 if (current_floor_ptr->grid_array[y][x].m_idx)
4260 creature_ptr->energy_need += ENERGY_NEED();
4264 msg_print(_("その方向にはモンスターはいません。", "You don't see any monster in this direction"));
4270 bool comvert_hp_to_mp(player_type *creature_ptr)
4272 int gain_sp = take_hit(DAMAGE_USELIFE, creature_ptr->lev, _("HPからMPへの無謀な変換", "thoughtless convertion from HP to SP"), -1) / 5;
4275 creature_ptr->csp += gain_sp;
4276 if (creature_ptr->csp > creature_ptr->msp)
4278 creature_ptr->csp = creature_ptr->msp;
4279 creature_ptr->csp_frac = 0;
4284 msg_print(_("変換に失敗した。", "You failed to convert."));
4286 creature_ptr->redraw |= (PR_HP | PR_MANA);
4290 bool comvert_mp_to_hp(player_type *creature_ptr)
4292 if (creature_ptr->csp >= creature_ptr->lev / 5)
4294 creature_ptr->csp -= creature_ptr->lev / 5;
4295 hp_player(p_ptr, creature_ptr->lev);
4299 msg_print(_("変換に失敗した。", "You failed to convert."));
4301 creature_ptr->redraw |= (PR_HP | PR_MANA);
4305 bool demonic_breath(player_type *creature_ptr)
4308 int type = (one_in_(2) ? GF_NETHER : GF_FIRE);
4309 if (!get_aim_dir(&dir)) return FALSE;
4311 msg_format(_("あなたは%sのブレスを吐いた。", "You breathe %s."), ((type == GF_NETHER) ? _("地獄", "nether") : _("火炎", "fire")));
4312 fire_breath(type, dir, creature_ptr->lev * 3, (creature_ptr->lev / 15) + 1);
4316 bool mirror_concentration(player_type *creature_ptr)
4320 msg_print(_("今はペットを操ることに集中していないと。", "You need concentration on the pets now."));
4323 if (is_mirror_grid(¤t_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x]))
4325 msg_print(_("少し頭がハッキリした。", "You feel your head clear a little."));
4327 creature_ptr->csp += (5 + creature_ptr->lev * creature_ptr->lev / 100);
4328 if (creature_ptr->csp >= creature_ptr->msp)
4330 creature_ptr->csp = creature_ptr->msp;
4331 creature_ptr->csp_frac = 0;
4333 creature_ptr->redraw |= (PR_MANA);
4337 msg_print(_("鏡の上でないと集中できない!", "Here are not any mirrors!"));
4342 bool sword_dancing(player_type *creature_ptr)
4345 POSITION y = 0, x = 0;
4349 for (i = 0; i < 6; i++)
4352 y = creature_ptr->y + ddy_ddd[dir];
4353 x = creature_ptr->x + ddx_ddd[dir];
4354 g_ptr = ¤t_floor_ptr->grid_array[y][x];
4356 /* Hack -- attack monsters */
4361 msg_print(_("攻撃が空をきった。", "You attack the empty air."));
4367 bool confusing_light(player_type *creature_ptr)
4369 msg_print(_("辺りを睨んだ...", "You glare nearby monsters..."));
4370 slow_monsters(creature_ptr->lev);
4371 stun_monsters(creature_ptr->lev * 4);
4372 confuse_monsters(creature_ptr->lev * 4);
4373 turn_monsters(creature_ptr->lev * 4);
4374 stasis_monsters(creature_ptr->lev * 4);
4378 bool rodeo(player_type *creature_ptr)
4380 GAME_TEXT m_name[MAX_NLEN];
4381 monster_type *m_ptr;
4382 monster_race *r_ptr;
4385 if (creature_ptr->riding)
4387 msg_print(_("今は乗馬中だ。", "You ARE riding."));
4390 if (!do_riding(TRUE)) return TRUE;
4392 m_ptr = ¤t_floor_ptr->m_list[creature_ptr->riding];
4393 r_ptr = &r_info[m_ptr->r_idx];
4394 monster_desc(m_name, m_ptr, 0);
4395 msg_format(_("%sに乗った。", "You ride on %s."), m_name);
4397 if (is_pet(m_ptr)) return TRUE;
4399 rlev = r_ptr->level;
4401 if (r_ptr->flags1 & RF1_UNIQUE) rlev = rlev * 3 / 2;
4402 if (rlev > 60) rlev = 60 + (rlev - 60) / 2;
4403 if ((randint1(creature_ptr->skill_exp[GINOU_RIDING] / 120 + creature_ptr->lev * 2 / 3) > rlev)
4404 && one_in_(2) && !creature_ptr->inside_arena && !creature_ptr->phase_out
4405 && !(r_ptr->flags7 & (RF7_GUARDIAN)) && !(r_ptr->flags1 & (RF1_QUESTOR))
4406 && (rlev < creature_ptr->lev * 3 / 2 + randint0(creature_ptr->lev / 5)))
4408 msg_format(_("%sを手なずけた。", "You tame %s."), m_name);
4413 msg_format(_("%sに振り落とされた!", "You have thrown off by %s."), m_name);
4415 /* 落馬処理に失敗してもとにかく乗馬解除 */
4416 creature_ptr->riding = 0;
4421 bool clear_mind(player_type *creature_ptr)
4425 msg_print(_("今はペットを操ることに集中していないと。", "You need concentration on the pets now."));
4428 msg_print(_("少し頭がハッキリした。", "You feel your head clear a little."));
4430 creature_ptr->csp += (3 + creature_ptr->lev / 20);
4431 if (creature_ptr->csp >= creature_ptr->msp)
4433 creature_ptr->csp = creature_ptr->msp;
4434 creature_ptr->csp_frac = 0;
4436 creature_ptr->redraw |= (PR_MANA);
4440 bool concentration(player_type *creature_ptr)
4442 int max_csp = MAX(creature_ptr->msp * 4, creature_ptr->lev * 5 + 5);
4446 msg_print(_("今はペットを操ることに集中していないと。", "You need concentration on the pets now."));
4449 if (creature_ptr->special_defense & KATA_MASK)
4451 msg_print(_("今は構えに集中している。", "You need concentration on your form."));
4454 msg_print(_("精神を集中して気合いを溜めた。", "You concentrate to charge your power."));
4456 creature_ptr->csp += creature_ptr->msp / 2;
4457 if (creature_ptr->csp >= max_csp)
4459 creature_ptr->csp = max_csp;
4460 creature_ptr->csp_frac = 0;
4462 creature_ptr->redraw |= (PR_MANA);