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"
48 #include "player-inventory.h"
51 #include "floor-events.h"
53 #include "view-mainwindow.h"
54 #include "objectkind.h"
55 #include "monsterrace.h"
56 #include "targeting.h"
57 #include "realm-song.h"
61 * @brief プレイヤー周辺の地形を感知する
64 * @param known 地形から危険フラグを外すならTRUE
65 * @return 効力があった場合TRUEを返す
67 static bool detect_feat_flag(POSITION range, int flag, bool known)
73 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
75 /* Scan the current panel */
76 for (y = 1; y < p_ptr->current_floor_ptr->height - 1; y++)
78 for (x = 1; x <= p_ptr->current_floor_ptr->width - 1; x++)
80 int dist = distance(p_ptr->y, p_ptr->x, y, x);
81 if (dist > range) continue;
82 g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
87 /* Mark as detected */
88 if (dist <= range && known)
90 if (dist <= range - 1) g_ptr->info |= (CAVE_IN_DETECT);
92 g_ptr->info &= ~(CAVE_UNSAFE);
98 if (cave_have_flag_grid(g_ptr, flag))
101 g_ptr->info |= (CAVE_MARK);
112 * @brief プレイヤー周辺のトラップを感知する / Detect all traps on current panel
114 * @param known 感知外範囲を超える警告フラグを立てる場合TRUEを返す
115 * @return 効力があった場合TRUEを返す
117 bool detect_traps(POSITION range, bool known)
119 bool detect = detect_feat_flag(range, FF_TRAP, known);
121 if (known) p_ptr->dtrap = TRUE;
123 if (music_singing(p_ptr, MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 0) detect = FALSE;
126 msg_print(_("トラップの存在を感じとった!", "You sense the presence of traps!"));
133 * @brief プレイヤー周辺のドアを感知する / Detect all doors on current panel
135 * @return 効力があった場合TRUEを返す
137 bool detect_doors(POSITION range)
139 bool detect = detect_feat_flag(range, FF_DOOR, TRUE);
141 if (music_singing(p_ptr, MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 0) detect = FALSE;
144 msg_print(_("ドアの存在を感じとった!", "You sense the presence of doors!"));
151 * @brief プレイヤー周辺の階段を感知する / Detect all stairs on current panel
153 * @return 効力があった場合TRUEを返す
155 bool detect_stairs(POSITION range)
157 bool detect = detect_feat_flag(range, FF_STAIRS, TRUE);
159 if (music_singing(p_ptr, MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 0) detect = FALSE;
162 msg_print(_("階段の存在を感じとった!", "You sense the presence of stairs!"));
169 * @brief プレイヤー周辺の地形財宝を感知する / Detect any treasure on the current panel
171 * @return 効力があった場合TRUEを返す
173 bool detect_treasure(POSITION range)
175 bool detect = detect_feat_flag(range, FF_HAS_GOLD, TRUE);
177 if (music_singing(p_ptr, MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 6) detect = FALSE;
180 msg_print(_("埋蔵された財宝の存在を感じとった!", "You sense the presence of buried treasure!"));
187 * @brief プレイヤー周辺のアイテム財宝を感知する / Detect all "gold" objects on the current panel
189 * @return 効力があった場合TRUEを返す
191 bool detect_objects_gold(POSITION range)
195 POSITION range2 = range;
199 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range2 /= 3;
202 for (i = 1; i < p_ptr->current_floor_ptr->o_max; i++)
204 object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[i];
206 if (!OBJECT_IS_VALID(o_ptr)) continue;
207 if (OBJECT_IS_HELD_MONSTER(o_ptr)) continue;
212 /* Only detect nearby objects */
213 if (distance(p_ptr->y, p_ptr->x, y, x) > range2) continue;
215 /* Detect "gold" objects */
216 if (o_ptr->tval == TV_GOLD)
218 o_ptr->marked |= OM_FOUND;
224 if (music_singing(p_ptr, MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 6) detect = FALSE;
227 msg_print(_("財宝の存在を感じとった!", "You sense the presence of treasure!"));
230 if (detect_monsters_string(range, "$"))
239 * @brief 通常のアイテムオブジェクトを感知する / Detect all "normal" objects on the current panel
241 * @return 効力があった場合TRUEを返す
243 bool detect_objects_normal(POSITION range)
247 POSITION range2 = range;
251 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range2 /= 3;
254 for (i = 1; i < p_ptr->current_floor_ptr->o_max; i++)
256 object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[i];
258 if (!OBJECT_IS_VALID(o_ptr)) continue;
259 if (OBJECT_IS_HELD_MONSTER(o_ptr)) continue;
264 /* Only detect nearby objects */
265 if (distance(p_ptr->y, p_ptr->x, y, x) > range2) continue;
267 /* Detect "real" objects */
268 if (o_ptr->tval != TV_GOLD)
270 o_ptr->marked |= OM_FOUND;
276 if (music_singing(p_ptr, MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 6) detect = FALSE;
279 msg_print(_("アイテムの存在を感じとった!", "You sense the presence of objects!"));
282 if (detect_monsters_string(range, "!=?|/`"))
291 * @brief 魔法効果のあるのアイテムオブジェクトを感知する / Detect all "magic" objects on the current panel.
293 * @return 効力があった場合TRUEを返す
296 * This will light up all spaces with "magic" items, including artifacts,
297 * ego-items, potions, scrolls, books, rods, wands, staves, amulets, rings,
298 * and "enchanted" items of the "good" variety.
300 * It can probably be argued that this function is now too powerful.
303 bool detect_objects_magic(POSITION range)
305 OBJECT_TYPE_VALUE tv;
311 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
313 /* Scan all objects */
314 for (i = 1; i < p_ptr->current_floor_ptr->o_max; i++)
316 object_type *o_ptr = &p_ptr->current_floor_ptr->o_list[i];
318 if (!OBJECT_IS_VALID(o_ptr)) continue;
319 if (OBJECT_IS_HELD_MONSTER(o_ptr)) continue;
324 /* Only detect nearby objects */
325 if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue;
327 /* Examine the tval */
330 /* Artifacts, misc magic items, or enchanted wearables */
331 if (object_is_artifact(o_ptr) ||
332 object_is_ego(o_ptr) ||
333 (tv == TV_WHISTLE) ||
341 (tv == TV_LIFE_BOOK) ||
342 (tv == TV_SORCERY_BOOK) ||
343 (tv == TV_NATURE_BOOK) ||
344 (tv == TV_CHAOS_BOOK) ||
345 (tv == TV_DEATH_BOOK) ||
346 (tv == TV_TRUMP_BOOK) ||
347 (tv == TV_ARCANE_BOOK) ||
348 (tv == TV_CRAFT_BOOK) ||
349 (tv == TV_DAEMON_BOOK) ||
350 (tv == TV_CRUSADE_BOOK) ||
351 (tv == TV_MUSIC_BOOK) ||
352 (tv == TV_HISSATSU_BOOK) ||
353 (tv == TV_HEX_BOOK) ||
354 ((o_ptr->to_a > 0) || (o_ptr->to_h + o_ptr->to_d > 0)))
356 /* Memorize the item */
357 o_ptr->marked |= OM_FOUND;
364 msg_print(_("魔法のアイテムの存在を感じとった!", "You sense the presence of magic objects!"));
373 * @brief 一般のモンスターを感知する / Detect all "normal" monsters on the current panel
375 * @return 効力があった場合TRUEを返す
377 bool detect_monsters_normal(POSITION range)
383 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
385 for (i = 1; i < p_ptr->current_floor_ptr->m_max; i++)
387 monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[i];
388 monster_race *r_ptr = &r_info[m_ptr->r_idx];
389 if (!monster_is_valid(m_ptr)) continue;
394 /* Only detect nearby monsters */
395 if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue;
397 /* Detect all non-invisible monsters */
398 if (!(r_ptr->flags2 & RF2_INVISIBLE) || p_ptr->see_inv)
400 /* Repair visibility later */
401 repair_monsters = TRUE;
403 m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
404 update_monster(p_ptr, i, FALSE);
409 if (music_singing(p_ptr, MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 3) flag = FALSE;
412 msg_print(_("モンスターの存在を感じとった!", "You sense the presence of monsters!"));
419 * @brief 不可視のモンスターを感知する / Detect all "invisible" monsters around the player
421 * @return 効力があった場合TRUEを返す
423 bool detect_monsters_invis(POSITION range)
429 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
431 for (i = 1; i < p_ptr->current_floor_ptr->m_max; i++)
433 monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[i];
434 monster_race *r_ptr = &r_info[m_ptr->r_idx];
436 if (!monster_is_valid(m_ptr)) continue;
441 /* Only detect nearby monsters */
442 if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue;
444 /* Detect invisible monsters */
445 if (r_ptr->flags2 & RF2_INVISIBLE)
447 /* Update monster recall window */
448 if (p_ptr->monster_race_idx == m_ptr->r_idx)
450 p_ptr->window |= (PW_MONSTER);
453 /* Repair visibility later */
454 repair_monsters = TRUE;
456 m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
457 update_monster(p_ptr, i, FALSE);
462 if (music_singing(p_ptr, MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 3) flag = FALSE;
465 msg_print(_("透明な生物の存在を感じとった!", "You sense the presence of invisible creatures!"));
471 * @brief 邪悪なモンスターを感知する / Detect all "evil" monsters on current panel
473 * @return 効力があった場合TRUEを返す
475 bool detect_monsters_evil(POSITION range)
481 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
483 for (i = 1; i < p_ptr->current_floor_ptr->m_max; i++)
485 monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[i];
486 monster_race *r_ptr = &r_info[m_ptr->r_idx];
487 if (!monster_is_valid(m_ptr)) continue;
492 /* Only detect nearby monsters */
493 if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue;
495 /* Detect evil monsters */
496 if (r_ptr->flags3 & RF3_EVIL)
498 if (is_original_ap(m_ptr))
500 /* Take note that they are evil */
501 r_ptr->r_flags3 |= (RF3_EVIL);
503 /* Update monster recall window */
504 if (p_ptr->monster_race_idx == m_ptr->r_idx)
506 p_ptr->window |= (PW_MONSTER);
510 /* Repair visibility later */
511 repair_monsters = TRUE;
513 m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
514 update_monster(p_ptr, i, FALSE);
520 msg_print(_("邪悪なる生物の存在を感じとった!", "You sense the presence of evil creatures!"));
526 * @brief 無生命のモンスターを感知する(アンデッド、悪魔系を含む) / Detect all "nonliving", "undead" or "demonic" monsters on current panel
528 * @return 効力があった場合TRUEを返す
530 bool detect_monsters_nonliving(POSITION range)
536 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
538 for (i = 1; i < p_ptr->current_floor_ptr->m_max; i++)
540 monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[i];
541 if (!monster_is_valid(m_ptr)) continue;
546 /* Only detect nearby monsters */
547 if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue;
549 /* Detect non-living monsters */
550 if (!monster_living(m_ptr->r_idx))
552 /* Update monster recall window */
553 if (p_ptr->monster_race_idx == m_ptr->r_idx)
555 p_ptr->window |= (PW_MONSTER);
558 /* Repair visibility later */
559 repair_monsters = TRUE;
561 m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
562 update_monster(p_ptr, i, FALSE);
568 msg_print(_("自然でないモンスターの存在を感じた!", "You sense the presence of unnatural beings!"));
574 * @brief 精神のあるモンスターを感知する / Detect all monsters it has mind on current panel
576 * @return 効力があった場合TRUEを返す
578 bool detect_monsters_mind(POSITION range)
584 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
586 for (i = 1; i < p_ptr->current_floor_ptr->m_max; i++)
588 monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[i];
589 monster_race *r_ptr = &r_info[m_ptr->r_idx];
590 if (!monster_is_valid(m_ptr)) continue;
595 /* Only detect nearby monsters */
596 if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue;
598 /* Detect non-living monsters */
599 if (!(r_ptr->flags2 & RF2_EMPTY_MIND))
601 /* Update monster recall window */
602 if (p_ptr->monster_race_idx == m_ptr->r_idx)
604 p_ptr->window |= (PW_MONSTER);
607 /* Repair visibility later */
608 repair_monsters = TRUE;
610 m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
611 update_monster(p_ptr, i, FALSE);
617 msg_print(_("殺気を感じとった!", "You sense the presence of someone's mind!"));
624 * @brief 該当シンボルのモンスターを感知する / Detect all (string) monsters on current panel
626 * @param Match 対応シンボルの混じったモンスター文字列(複数指定化)
627 * @return 効力があった場合TRUEを返す
629 bool detect_monsters_string(POSITION range, concptr Match)
635 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
637 for (i = 1; i < p_ptr->current_floor_ptr->m_max; i++)
639 monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[i];
640 monster_race *r_ptr = &r_info[m_ptr->r_idx];
641 if (!monster_is_valid(m_ptr)) continue;
646 /* Only detect nearby monsters */
647 if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue;
649 /* Detect monsters with the same symbol */
650 if (my_strchr(Match, r_ptr->d_char))
652 /* Update monster recall window */
653 if (p_ptr->monster_race_idx == m_ptr->r_idx)
655 p_ptr->window |= (PW_MONSTER);
658 /* Repair visibility later */
659 repair_monsters = TRUE;
661 m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
662 update_monster(p_ptr, i, FALSE);
667 if (music_singing(p_ptr, MUSIC_DETECT) && SINGING_COUNT(p_ptr) > 3) flag = FALSE;
670 msg_print(_("モンスターの存在を感じとった!", "You sense the presence of monsters!"));
676 * @brief flags3に対応するモンスターを感知する / A "generic" detect monsters routine, tagged to flags3
678 * @param match_flag 感知フラグ
679 * @return 効力があった場合TRUEを返す
681 bool detect_monsters_xxx(POSITION range, u32b match_flag)
686 concptr desc_monsters = _("変なモンスター", "weird monsters");
688 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS) range /= 3;
690 for (i = 1; i < p_ptr->current_floor_ptr->m_max; i++)
692 monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[i];
693 monster_race *r_ptr = &r_info[m_ptr->r_idx];
694 if (!monster_is_valid(m_ptr)) continue;
699 /* Only detect nearby monsters */
700 if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue;
702 /* Detect evil monsters */
703 if (r_ptr->flags3 & (match_flag))
705 if (is_original_ap(m_ptr))
707 /* Take note that they are something */
708 r_ptr->r_flags3 |= (match_flag);
710 /* Update monster recall window */
711 if (p_ptr->monster_race_idx == m_ptr->r_idx)
713 p_ptr->window |= (PW_MONSTER);
717 /* Repair visibility later */
718 repair_monsters = TRUE;
720 m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
721 update_monster(p_ptr, i, FALSE);
730 desc_monsters = _("デーモン", "demons");
733 desc_monsters = _("アンデッド", "the undead");
737 msg_format(_("%sの存在を感じとった!", "You sense the presence of %s!"), desc_monsters);
745 * @brief 全感知処理 / Detect everything
747 * @return 効力があった場合TRUEを返す
749 bool detect_all(POSITION range)
753 /* Detect everything */
754 if (detect_traps(range, TRUE)) detect = TRUE;
755 if (detect_doors(range)) detect = TRUE;
756 if (detect_stairs(range)) detect = TRUE;
758 /* There are too many hidden treasure. So... */
759 /* if (detect_treasure(range)) detect = TRUE; */
761 if (detect_objects_gold(range)) detect = TRUE;
762 if (detect_objects_normal(range)) detect = TRUE;
763 if (detect_monsters_invis(range)) detect = TRUE;
764 if (detect_monsters_normal(range)) detect = TRUE;
770 * @brief 視界内モンスターに魔法効果を与える / Apply a "project()" directly to all viewable monsters
773 * @return 効力があった場合TRUEを返す
776 * Note that affected monsters are NOT auto-tracked by this usage.
778 * To avoid misbehavior when monster deaths have side-effects,
779 * this is done in two passes. -- JDL
782 bool project_all_los(EFFECT_ID typ, HIT_POINT dam)
786 BIT_FLAGS flg = PROJECT_JUMP | PROJECT_KILL | PROJECT_HIDE;
787 bool obvious = FALSE;
789 /* Mark all (nearby) monsters */
790 for (i = 1; i < p_ptr->current_floor_ptr->m_max; i++)
792 monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[i];
793 if (!monster_is_valid(m_ptr)) continue;
798 /* Require line of sight */
799 if (!player_has_los_bold(p_ptr, y, x) || !projectable(p_ptr->current_floor_ptr, p_ptr->y, p_ptr->x, y, x)) continue;
801 /* Mark the monster */
802 m_ptr->mflag |= (MFLAG_LOS);
805 /* Affect all marked monsters */
806 for (i = 1; i < p_ptr->current_floor_ptr->m_max; i++)
808 monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[i];
810 /* Skip unmarked monsters */
811 if (!(m_ptr->mflag & (MFLAG_LOS))) continue;
814 m_ptr->mflag &= ~(MFLAG_LOS);
819 /* Jump directly to the target monster */
820 if (project(0, 0, y, x, dam, typ, flg, -1)) obvious = TRUE;
827 * @brief 視界内モンスターを加速する処理 / Speed monsters
828 * @return 効力があった場合TRUEを返す
830 bool speed_monsters(void)
832 return (project_all_los(GF_OLD_SPEED, p_ptr->lev));
836 * @brief 視界内モンスターを加速する処理 / Slow monsters
837 * @return 効力があった場合TRUEを返す
839 bool slow_monsters(int power)
841 return (project_all_los(GF_OLD_SLOW, power));
845 * @brief 視界内モンスターを眠らせる処理 / Sleep monsters
846 * @return 効力があった場合TRUEを返す
848 bool sleep_monsters(int power)
850 return (project_all_los(GF_OLD_SLEEP, power));
854 * @brief 視界内の邪悪なモンスターをテレポート・アウェイさせる処理 / Banish evil monsters
855 * @return 効力があった場合TRUEを返す
857 bool banish_evil(int dist)
859 return (project_all_los(GF_AWAY_EVIL, dist));
863 * @brief 視界内のアンデッド・モンスターを恐怖させる処理 / Turn undead
864 * @return 効力があった場合TRUEを返す
866 bool turn_undead(void)
868 bool tester = (project_all_los(GF_TURN_UNDEAD, p_ptr->lev));
870 chg_virtue(p_ptr, V_UNLIFE, -1);
875 * @brief 視界内のアンデッド・モンスターにダメージを与える処理 / Dispel undead monsters
876 * @return 効力があった場合TRUEを返す
878 bool dispel_undead(HIT_POINT dam)
880 bool tester = (project_all_los(GF_DISP_UNDEAD, dam));
882 chg_virtue(p_ptr, V_UNLIFE, -2);
887 * @brief 視界内の邪悪なモンスターにダメージを与える処理 / Dispel evil monsters
888 * @return 効力があった場合TRUEを返す
890 bool dispel_evil(HIT_POINT dam)
892 return (project_all_los(GF_DISP_EVIL, dam));
896 * @brief 視界内の善良なモンスターにダメージを与える処理 / Dispel good monsters
897 * @return 効力があった場合TRUEを返す
899 bool dispel_good(HIT_POINT dam)
901 return (project_all_los(GF_DISP_GOOD, dam));
905 * @brief 視界内のあらゆるモンスターにダメージを与える処理 / Dispel all monsters
906 * @return 効力があった場合TRUEを返す
908 bool dispel_monsters(HIT_POINT dam)
910 return (project_all_los(GF_DISP_ALL, dam));
913 bool cleansing_nova(player_type *creature_ptr, bool magic, bool powerful)
916 if (dispel_evil(powerful ? 225 : 150)) ident = TRUE;
917 int k = 3 * creature_ptr->lev;
918 if (set_protevil(p_ptr, (magic ? 0 : creature_ptr->protevil) + randint1(25) + k, FALSE)) ident = TRUE;
919 if (set_poisoned(p_ptr, 0)) ident = TRUE;
920 if (set_afraid(p_ptr, 0)) ident = TRUE;
921 if (hp_player(p_ptr, 50)) ident = TRUE;
922 if (set_stun(p_ptr, 0)) ident = TRUE;
923 if (set_cut(p_ptr,0)) ident = TRUE;
927 bool unleash_mana_storm(player_type *creature_ptr, bool powerful)
929 msg_print(_("強力な魔力が敵を引き裂いた!", "Mighty magics rend your enemies!"));
930 project(0, (powerful ? 7 : 5), creature_ptr->y, creature_ptr->x,
931 (randint1(200) + (powerful ? 500 : 300)) * 2, GF_MANA, PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID, -1);
932 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))
934 (void)take_hit(p_ptr, DAMAGE_NOESCAPE, 50, _("コントロールし難い強力な魔力の解放", "unleashing magics too mighty to control"), -1);
940 * @brief 視界内の生命のあるモンスターにダメージを与える処理 / Dispel 'living' monsters
941 * @return 効力があった場合TRUEを返す
943 bool dispel_living(HIT_POINT dam)
945 return (project_all_los(GF_DISP_LIVING, dam));
949 * @brief 視界内の悪魔系モンスターにダメージを与える処理 / Dispel 'living' monsters
950 * @return 効力があった場合TRUEを返す
952 bool dispel_demons(HIT_POINT dam)
954 return (project_all_los(GF_DISP_DEMON, dam));
958 * @brief 視界内のモンスターに「聖戦」効果を与える処理
959 * @return 効力があった場合TRUEを返す
963 return (project_all_los(GF_CRUSADE, p_ptr->lev*4));
967 * @brief 視界内モンスターを怒らせる処理 / Wake up all monsters, and speed up "los" monsters.
968 * @param who 怒らせる原因を起こしたモンスター(0ならばプレイヤー)
971 void aggravate_monsters(MONSTER_IDX who)
977 /* Aggravate everyone nearby */
978 for (i = 1; i < p_ptr->current_floor_ptr->m_max; i++)
980 monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[i];
981 if (!monster_is_valid(m_ptr)) continue;
983 /* Skip aggravating monster (or player) */
984 if (i == who) continue;
986 /* Wake up nearby sleeping monsters */
987 if (m_ptr->cdis < MAX_SIGHT * 2)
990 if (MON_CSLEEP(m_ptr))
992 (void)set_monster_csleep(i, 0);
995 if (!is_pet(m_ptr)) m_ptr->mflag2 |= MFLAG2_NOPET;
998 /* Speed up monsters in line of sight */
999 if (player_has_los_bold(p_ptr, m_ptr->fy, m_ptr->fx))
1003 (void)set_monster_fast(i, MON_FAST(m_ptr) + 100);
1009 if (speed) msg_print(_("付近で何かが突如興奮したような感じを受けた!", "You feel a sudden stirring nearby!"));
1010 else if (sleep) msg_print(_("何かが突如興奮したような騒々しい音が遠くに聞こえた!", "You hear a sudden stirring in the distance!"));
1011 if (p_ptr->riding) p_ptr->update |= PU_BONUS;
1016 * @brief モンスターへの単体抹殺処理サブルーチン / Delete a non-unique/non-quest monster
1017 * @param m_idx 抹殺するモンスターID
1018 * @param power 抹殺の威力
1019 * @param player_cast プレイヤーの魔法によるものならば TRUE
1020 * @param dam_side プレイヤーへの負担ダメージ量(1d(dam_side))
1021 * @param spell_name 抹殺効果を起こした魔法の名前
1022 * @return 効力があった場合TRUEを返す
1024 bool genocide_aux(MONSTER_IDX m_idx, int power, bool player_cast, int dam_side, concptr spell_name)
1026 int msec = delay_factor * delay_factor * delay_factor;
1027 monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx];
1028 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1029 bool resist = FALSE;
1031 if (is_pet(m_ptr) && !player_cast) return FALSE;
1033 /* Hack -- Skip Unique Monsters or Quest Monsters */
1034 if (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) resist = TRUE;
1035 else if (r_ptr->flags7 & RF7_UNIQUE2) resist = TRUE;
1036 else if (m_idx == p_ptr->riding) resist = TRUE;
1037 else if ((p_ptr->current_floor_ptr->inside_quest && !random_quest_number(p_ptr->current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->phase_out) resist = TRUE;
1038 else if (player_cast && (r_ptr->level > randint0(power))) resist = TRUE;
1039 else if (player_cast && (m_ptr->mflag2 & MFLAG2_NOGENO)) resist = TRUE;
1043 if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
1045 GAME_TEXT m_name[MAX_NLEN];
1047 monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
1048 exe_write_diary(p_ptr, NIKKI_NAMED_PET, RECORD_NAMED_PET_GENOCIDE, m_name);
1051 delete_monster_idx(m_idx);
1054 if (resist && player_cast)
1056 bool see_m = is_seen(m_ptr);
1057 GAME_TEXT m_name[MAX_NLEN];
1059 monster_desc(m_name, m_ptr, 0);
1062 msg_format(_("%^sには効果がなかった。", "%^s is unaffected."), m_name);
1064 if (MON_CSLEEP(m_ptr))
1066 (void)set_monster_csleep(m_idx, 0);
1069 msg_format(_("%^sが目を覚ました。", "%^s wakes up."), m_name);
1072 if (is_friendly(m_ptr) && !is_pet(m_ptr))
1076 msg_format(_("%sは怒った!", "%^s gets angry!"), m_name);
1080 if (one_in_(13)) m_ptr->mflag2 |= MFLAG2_NOGENO;
1085 take_hit(p_ptr, DAMAGE_GENO, randint1(dam_side), format(_("%^sの呪文を唱えた疲労", "the strain of casting %^s"), spell_name), -1);
1088 /* Visual feedback */
1089 move_cursor_relative(p_ptr->y, p_ptr->x);
1091 p_ptr->redraw |= (PR_HP);
1092 p_ptr->window |= (PW_PLAYER);
1097 Term_xtra(TERM_XTRA_DELAY, msec);
1104 * @brief モンスターへのシンボル抹殺処理ルーチン / Delete all non-unique/non-quest monsters of a given "type" from the level
1105 * @param power 抹殺の威力
1106 * @param player_cast プレイヤーの魔法によるものならば TRUE
1107 * @return 効力があった場合TRUEを返す
1109 bool symbol_genocide(int power, bool player_cast)
1113 bool result = FALSE;
1115 /* Prevent genocide in quest levels */
1116 if ((p_ptr->current_floor_ptr->inside_quest && !random_quest_number(p_ptr->current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->phase_out)
1118 msg_print(_("何も起きないようだ……", "It seems nothing happen here..."));
1122 /* Mega-Hack -- Get a monster symbol */
1123 while (!get_com(_("どの種類(文字)のモンスターを抹殺しますか: ", "Choose a monster race (by symbol) to genocide: "), &typ, FALSE)) ;
1125 /* Delete the monsters of that "type" */
1126 for (i = 1; i < p_ptr->current_floor_ptr->m_max; i++)
1128 monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[i];
1129 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1130 if (!monster_is_valid(m_ptr)) continue;
1132 /* Skip "wrong" monsters */
1133 if (r_ptr->d_char != typ) continue;
1135 result |= genocide_aux(i, power, player_cast, 4, _("抹殺", "Genocide"));
1140 chg_virtue(p_ptr, V_VITALITY, -2);
1141 chg_virtue(p_ptr, V_CHANCE, -1);
1149 * @brief モンスターへの周辺抹殺処理ルーチン / Delete all nearby (non-unique) monsters
1150 * @param power 抹殺の威力
1151 * @param player_cast プレイヤーの魔法によるものならば TRUE
1152 * @return 効力があった場合TRUEを返す
1154 bool mass_genocide(int power, bool player_cast)
1157 bool result = FALSE;
1159 /* Prevent mass genocide in quest levels */
1160 if ((p_ptr->current_floor_ptr->inside_quest && !random_quest_number(p_ptr->current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->phase_out)
1165 /* Delete the (nearby) monsters */
1166 for (i = 1; i < p_ptr->current_floor_ptr->m_max; i++)
1168 monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[i];
1169 if (!monster_is_valid(m_ptr)) continue;
1171 /* Skip distant monsters */
1172 if (m_ptr->cdis > MAX_SIGHT) continue;
1175 result |= genocide_aux(i, power, player_cast, 3, _("周辺抹殺", "Mass Genocide"));
1180 chg_virtue(p_ptr, V_VITALITY, -2);
1181 chg_virtue(p_ptr, V_CHANCE, -1);
1189 * @brief アンデッド・モンスターへの周辺抹殺処理ルーチン / Delete all nearby (non-unique) undead
1190 * @param power 抹殺の威力
1191 * @param player_cast プレイヤーの魔法によるものならば TRUE
1192 * @return 効力があった場合TRUEを返す
1194 bool mass_genocide_undead(int power, bool player_cast)
1197 bool result = FALSE;
1199 /* Prevent mass genocide in quest levels */
1200 if ((p_ptr->current_floor_ptr->inside_quest && !random_quest_number(p_ptr->current_floor_ptr->dun_level)) || p_ptr->inside_arena || p_ptr->phase_out)
1205 /* Delete the (nearby) monsters */
1206 for (i = 1; i < p_ptr->current_floor_ptr->m_max; i++)
1208 monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[i];
1209 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1210 if (!monster_is_valid(m_ptr)) continue;
1212 if (!(r_ptr->flags3 & RF3_UNDEAD)) continue;
1214 /* Skip distant monsters */
1215 if (m_ptr->cdis > MAX_SIGHT) continue;
1218 result |= genocide_aux(i, power, player_cast, 3, _("アンデッド消滅", "Annihilate Undead"));
1223 chg_virtue(p_ptr, V_UNLIFE, -2);
1224 chg_virtue(p_ptr, V_CHANCE, -1);
1232 * @brief 周辺モンスターを調査する / Probe nearby monsters
1233 * @return 効力があった場合TRUEを返す
1238 int speed; /* TODO */
1249 /* Probe all (nearby) monsters */
1250 for (i = 1; i < p_ptr->current_floor_ptr->m_max; i++)
1252 monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[i];
1253 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1254 if (!monster_is_valid(m_ptr)) continue;
1256 /* Require line of sight */
1257 if (!player_has_los_bold(p_ptr, m_ptr->fy, m_ptr->fx)) continue;
1259 /* Probe visible monsters */
1262 GAME_TEXT m_name[MAX_NLEN];
1264 /* Start the message */
1267 msg_print(_("調査中...", "Probing..."));
1272 if (!is_original_ap(m_ptr))
1274 if (m_ptr->mflag2 & MFLAG2_KAGE)
1275 m_ptr->mflag2 &= ~(MFLAG2_KAGE);
1277 m_ptr->ap_r_idx = m_ptr->r_idx;
1278 lite_spot(m_ptr->fy, m_ptr->fx);
1280 /* Get "the monster" or "something" */
1281 monster_desc(m_name, m_ptr, MD_IGNORE_HALLU | MD_INDEF_HIDDEN);
1283 speed = m_ptr->mspeed - 110;
1284 if (MON_FAST(m_ptr)) speed += 10;
1285 if (MON_SLOW(m_ptr)) speed -= 10;
1286 if (ironman_nightmare) speed += 5;
1288 /* Get the monster's alignment */
1289 if ((r_ptr->flags3 & (RF3_EVIL | RF3_GOOD)) == (RF3_EVIL | RF3_GOOD)) align = _("善悪", "good&evil");
1290 else if (r_ptr->flags3 & RF3_EVIL) align = _("邪悪", "evil");
1291 else if (r_ptr->flags3 & RF3_GOOD) align = _("善良", "good");
1292 else if ((m_ptr->sub_align & (SUB_ALIGN_EVIL | SUB_ALIGN_GOOD)) == (SUB_ALIGN_EVIL | SUB_ALIGN_GOOD)) align = _("中立(善悪)", "neutral(good&evil)");
1293 else if (m_ptr->sub_align & SUB_ALIGN_EVIL) align = _("中立(邪悪)", "neutral(evil)");
1294 else if (m_ptr->sub_align & SUB_ALIGN_GOOD) align = _("中立(善良)", "neutral(good)");
1295 else align = _("中立", "neutral");
1297 sprintf(buf,_("%s ... 属性:%s HP:%d/%d AC:%d 速度:%s%d 経験:", "%s ... align:%s HP:%d/%d AC:%d speed:%s%d exp:"),
1298 m_name, align, (int)m_ptr->hp, (int)m_ptr->maxhp, r_ptr->ac, (speed > 0) ? "+" : "", speed);
1300 if (r_ptr->next_r_idx)
1302 strcat(buf, format("%d/%d ", m_ptr->exp, r_ptr->next_exp));
1306 strcat(buf, "xxx ");
1309 if (MON_CSLEEP(m_ptr)) strcat(buf,_("睡眠 ", "sleeping "));
1310 if (MON_STUNNED(m_ptr)) strcat(buf, _("朦朧 ", "stunned "));
1311 if (MON_MONFEAR(m_ptr)) strcat(buf, _("恐怖 ", "scared "));
1312 if (MON_CONFUSED(m_ptr)) strcat(buf, _("混乱 ", "confused "));
1313 if (MON_INVULNER(m_ptr)) strcat(buf, _("無敵 ", "invulnerable "));
1314 buf[strlen(buf)-1] = '\0';
1317 /* HACK : Add the line to message buffer */
1320 p_ptr->window |= (PW_MESSAGE);
1323 if (m_ptr->ml) move_cursor_relative(m_ptr->fy, m_ptr->fx);
1326 Term_erase(0, 0, 255);
1328 /* Learn everything about this monster */
1329 if (lore_do_probe(m_ptr->r_idx))
1331 /* Get base name of monster */
1332 strcpy(buf, (r_name + r_ptr->name));
1335 /* Note that we learnt some new flags -Mogami- */
1336 msg_format("%sについてさらに詳しくなった気がする。", buf);
1341 /* Note that we learnt some new flags -Mogami- */
1342 msg_format("You now know more about %s.", buf);
1344 /* Clear -more- prompt */
1359 chg_virtue(p_ptr, V_KNOWLEDGE, 1);
1360 msg_print(_("これで全部です。", "That's all."));
1369 void discharge_minion(void)
1374 for (i = 1; i < p_ptr->current_floor_ptr->m_max; i++)
1376 monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[i];
1377 if (!m_ptr->r_idx || !is_pet(m_ptr)) continue;
1378 if (m_ptr->nickname) okay = FALSE;
1380 if (!okay || p_ptr->riding)
1382 if (!get_check(_("本当に全ペットを爆破しますか?", "You will blast all pets. Are you sure? ")))
1385 for (i = 1; i < p_ptr->current_floor_ptr->m_max; i++)
1388 monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[i];
1389 monster_race *r_ptr;
1391 if (!m_ptr->r_idx || !is_pet(m_ptr)) continue;
1392 r_ptr = &r_info[m_ptr->r_idx];
1394 /* Uniques resist discharging */
1395 if (r_ptr->flags1 & RF1_UNIQUE)
1397 GAME_TEXT m_name[MAX_NLEN];
1398 monster_desc(m_name, m_ptr, 0x00);
1399 msg_format(_("%sは爆破されるのを嫌がり、勝手に自分の世界へと帰った。", "%^s resists to be blasted, and run away."), m_name);
1400 delete_monster_idx(i);
1403 dam = m_ptr->maxhp / 2;
1404 if (dam > 100) dam = (dam - 100) / 2 + 100;
1405 if (dam > 400) dam = (dam - 400) / 2 + 400;
1406 if (dam > 800) dam = 800;
1407 project(i, 2 + (r_ptr->level / 20), m_ptr->fy, m_ptr->fx, dam, GF_PLASMA,
1408 PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL, -1);
1410 if (record_named_pet && m_ptr->nickname)
1412 GAME_TEXT m_name[MAX_NLEN];
1414 monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
1415 exe_write_diary(p_ptr, NIKKI_NAMED_PET, RECORD_NAMED_PET_BLAST, m_name);
1418 delete_monster_idx(i);
1424 * @brief 部屋全体を照らすサブルーチン
1428 * This routine clears the entire "temp" set.
1429 * This routine will Perma-Lite all "temp" grids.
1430 * This routine is used (only) by "lite_room()"
1431 * Dark grids are illuminated.
1432 * Also, process all affected monsters.
1434 * SMART monsters always wake up when illuminated
1435 * NORMAL monsters wake up 1/4 the time when illuminated
1436 * STUPID monsters wake up 1/10 the time when illuminated
1439 static void cave_temp_room_lite(void)
1443 /* Clear them all */
1444 for (i = 0; i < tmp_pos.n; i++)
1446 POSITION y = tmp_pos.y[i];
1447 POSITION x = tmp_pos.x[i];
1449 grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
1451 /* No longer in the array */
1452 g_ptr->info &= ~(CAVE_TEMP);
1454 /* Update only non-CAVE_GLOW grids */
1455 /* if (g_ptr->info & (CAVE_GLOW)) continue; */
1458 g_ptr->info |= (CAVE_GLOW);
1460 /* Process affected monsters */
1463 PERCENTAGE chance = 25;
1464 monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
1465 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1466 update_monster(p_ptr, g_ptr->m_idx, FALSE);
1468 /* Stupid monsters rarely wake up */
1469 if (r_ptr->flags2 & (RF2_STUPID)) chance = 10;
1471 /* Smart monsters always wake up */
1472 if (r_ptr->flags2 & (RF2_SMART)) chance = 100;
1474 /* Sometimes monsters wake up */
1475 if (MON_CSLEEP(m_ptr) && (randint0(100) < chance))
1478 (void)set_monster_csleep(g_ptr->m_idx, 0);
1480 /* Notice the "waking up" */
1483 GAME_TEXT m_name[MAX_NLEN];
1484 monster_desc(m_name, m_ptr, 0);
1485 msg_format(_("%^sが目を覚ました。", "%^s wakes up."), m_name);
1492 update_local_illumination(p_ptr, y, x);
1502 * @brief 部屋全体を暗くするサブルーチン
1506 * This routine clears the entire "temp" set.
1507 * This routine will "darken" all "temp" grids.
1508 * In addition, some of these grids will be "unmarked".
1509 * This routine is used (only) by "unlite_room()"
1510 * Also, process all affected monsters
1513 static void cave_temp_room_unlite(void)
1517 /* Clear them all */
1518 for (i = 0; i < tmp_pos.n; i++)
1520 POSITION y = tmp_pos.y[i];
1521 POSITION x = tmp_pos.x[i];
1524 grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
1525 bool do_dark = !is_mirror_grid(g_ptr);
1527 /* No longer in the array */
1528 g_ptr->info &= ~(CAVE_TEMP);
1530 /* Darken the grid */
1533 if (p_ptr->current_floor_ptr->dun_level || !is_daytime())
1535 for (j = 0; j < 9; j++)
1537 POSITION by = y + ddy_ddd[j];
1538 POSITION bx = x + ddx_ddd[j];
1540 if (in_bounds2(p_ptr->current_floor_ptr, by, bx))
1542 grid_type *cc_ptr = &p_ptr->current_floor_ptr->grid_array[by][bx];
1544 if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
1552 if (!do_dark) continue;
1555 g_ptr->info &= ~(CAVE_GLOW);
1557 /* Hack -- Forget "boring" grids */
1558 if (!have_flag(f_info[get_feat_mimic(g_ptr)].flags, FF_REMEMBER))
1560 /* Forget the grid */
1561 if (!view_torch_grids) g_ptr->info &= ~(CAVE_MARK);
1565 /* Process affected monsters */
1568 update_monster(p_ptr, g_ptr->m_idx, FALSE);
1572 update_local_illumination(p_ptr, y, x);
1582 * @brief 周辺に関数ポインタの条件に該当する地形がいくつあるかを計算する / Determine how much contiguous open space this grid is next to
1585 * @param pass_bold 地形条件を返す関数ポインタ
1588 static int next_to_open(POSITION cy, POSITION cx, bool (*pass_bold)(POSITION, POSITION))
1595 for (i = 0; i < 16; i++)
1597 y = cy + ddy_cdd[i % 8];
1598 x = cx + ddx_cdd[i % 8];
1600 /* Found a wall, break the length */
1601 if (!pass_bold(y, x))
1603 /* Track best length */
1617 return (MAX(len, blen));
1621 * @brief 周辺に関数ポインタの条件に該当する地形がいくつあるかを計算する / Determine how much contiguous open space this grid is next to
1624 * @param pass_bold 地形条件を返す関数ポインタ
1627 static int next_to_walls_adj(POSITION cy, POSITION cx, bool (*pass_bold)(POSITION, POSITION))
1633 for (i = 0; i < 8; i++)
1635 y = cy + ddy_ddd[i];
1636 x = cx + ddx_ddd[i];
1638 if (!pass_bold(y, x)) c++;
1646 * @brief 部屋内にある一点の周囲に該当する地形数かいくつあるかをグローバル変数tmp_pos.nに返す / Aux function -- see below
1647 * @param y 部屋内のy座標1点
1648 * @param x 部屋内のx座標1点
1649 * @param only_room 部屋内地形のみをチェック対象にするならば TRUE
1650 * @param pass_bold 地形条件を返す関数ポインタ
1653 static void cave_temp_room_aux(POSITION y, POSITION x, bool only_room, bool (*pass_bold)(POSITION, POSITION))
1656 g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
1658 /* Avoid infinite recursion */
1659 if (g_ptr->info & (CAVE_TEMP)) return;
1661 /* Do not "leave" the current room */
1662 if (!(g_ptr->info & (CAVE_ROOM)))
1664 if (only_room) return;
1667 if (!in_bounds2(p_ptr->current_floor_ptr, y, x)) return;
1669 /* Do not exceed the maximum spell range */
1670 if (distance(p_ptr->y, p_ptr->x, y, x) > MAX_RANGE) return;
1672 /* Verify this grid */
1674 * The reason why it is ==6 instead of >5 is that 8 is impossible
1675 * due to the check for cave_bold above.
1676 * 7 lights dead-end corridors (you need to do this for the
1677 * checkboard interesting rooms, so that the boundary is lit
1679 * This leaves only a check for 6 bounding walls!
1681 if (in_bounds(p_ptr->current_floor_ptr, y, x) && pass_bold(y, x) &&
1682 (next_to_walls_adj(y, x, pass_bold) == 6) && (next_to_open(y, x, pass_bold) <= 1)) return;
1685 /* Paranoia -- verify space */
1686 if (tmp_pos.n == TEMP_MAX) return;
1688 /* Mark the grid as "seen" */
1689 g_ptr->info |= (CAVE_TEMP);
1691 /* Add it to the "seen" set */
1692 tmp_pos.y[tmp_pos.n] = y;
1693 tmp_pos.x[tmp_pos.n] = x;
1698 * @brief 指定のマスが光を通すか(LOSフラグを持つか)を返す。 / Aux function -- see below
1701 * @return 光を通すならばtrueを返す。
1703 static bool cave_pass_lite_bold(POSITION y, POSITION x)
1705 return cave_los_bold(p_ptr->current_floor_ptr, y, x);
1709 * @brief 部屋内にある一点の周囲がいくつ光を通すかをグローバル変数tmp_pos.nに返す / Aux function -- see below
1714 static void cave_temp_lite_room_aux(POSITION y, POSITION x)
1716 cave_temp_room_aux(y, x, FALSE, cave_pass_lite_bold);
1720 * @brief 指定のマスが光を通さず射線のみを通すかを返す。 / Aux function -- see below
1723 * @return 射線を通すならばtrueを返す。
1725 static bool cave_pass_dark_bold(POSITION y, POSITION x)
1727 return cave_have_flag_bold(y, x, FF_PROJECT);
1732 * @brief 部屋内にある一点の周囲がいくつ射線を通すかをグローバル変数tmp_pos.nに返す / Aux function -- see below
1737 static void cave_temp_unlite_room_aux(POSITION y, POSITION x)
1739 cave_temp_room_aux(y, x, TRUE, cave_pass_dark_bold);
1744 * @brief 指定された部屋内を照らす / Illuminate any room containing the given location.
1749 void lite_room(POSITION y1, POSITION x1)
1754 /* Add the initial grid */
1755 cave_temp_lite_room_aux(y1, x1);
1757 /* While grids are in the queue, add their neighbors */
1758 for (i = 0; i < tmp_pos.n; i++)
1760 x = tmp_pos.x[i], y = tmp_pos.y[i];
1762 /* Walls get lit, but stop light */
1763 if (!cave_pass_lite_bold(y, x)) continue;
1765 /* Spread adjacent */
1766 cave_temp_lite_room_aux(y + 1, x);
1767 cave_temp_lite_room_aux(y - 1, x);
1768 cave_temp_lite_room_aux(y, x + 1);
1769 cave_temp_lite_room_aux(y, x - 1);
1771 /* Spread diagonal */
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);
1775 cave_temp_lite_room_aux(y + 1, x - 1);
1778 /* Now, lite them all up at once */
1779 cave_temp_room_lite();
1781 if (p_ptr->special_defense & NINJA_S_STEALTH)
1783 if (p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(p_ptr, FALSE);
1789 * @brief 指定された部屋内を暗くする / Darken all rooms containing the given location
1794 void unlite_room(POSITION y1, POSITION x1)
1799 /* Add the initial grid */
1800 cave_temp_unlite_room_aux(y1, x1);
1802 /* Spread, breadth first */
1803 for (i = 0; i < tmp_pos.n; i++)
1805 x = tmp_pos.x[i], y = tmp_pos.y[i];
1807 /* Walls get dark, but stop darkness */
1808 if (!cave_pass_dark_bold(y, x)) continue;
1810 /* Spread adjacent */
1811 cave_temp_unlite_room_aux(y + 1, x);
1812 cave_temp_unlite_room_aux(y - 1, x);
1813 cave_temp_unlite_room_aux(y, x + 1);
1814 cave_temp_unlite_room_aux(y, x - 1);
1816 /* Spread diagonal */
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);
1820 cave_temp_unlite_room_aux(y + 1, x - 1);
1823 /* Now, darken them all at once */
1824 cave_temp_room_unlite();
1827 bool starlight(bool magic)
1829 HIT_POINT num = damroll(5, 3);
1830 POSITION y = 0, x = 0;
1834 if (!p_ptr->blind && !magic)
1836 msg_print(_("杖の先が明るく輝いた...", "The end of the staff glows brightly..."));
1838 for (k = 0; k < num; k++)
1844 scatter(&y, &x, p_ptr->y, p_ptr->x, 4, PROJECT_LOS);
1845 if (!cave_have_flag_bold(y, x, FF_PROJECT)) continue;
1846 if (!player_bold(p_ptr, y, x)) break;
1849 project(0, 0, y, x, damroll(6 + p_ptr->lev / 8, 10), GF_LITE_WEAK,
1850 (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_KILL | PROJECT_LOS), -1);
1858 * @brief プレイヤー位置を中心にLITE_WEAK属性を通じた照明処理を行う / Hack -- call light around the player Affect all monsters in the projection radius
1861 * @return 作用が実際にあった場合TRUEを返す
1863 bool lite_area(HIT_POINT dam, POSITION rad)
1865 BIT_FLAGS flg = PROJECT_GRID | PROJECT_KILL;
1867 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_DARKNESS)
1869 msg_print(_("ダンジョンが光を吸収した。", "The darkness of this dungeon absorb your light."));
1875 msg_print(_("白い光が辺りを覆った。", "You are surrounded by a white light."));
1878 /* Hook into the "project()" function */
1879 (void)project(0, rad, p_ptr->y, p_ptr->x, dam, GF_LITE_WEAK, flg, -1);
1881 lite_room(p_ptr->y, p_ptr->x);
1889 * @brief プレイヤー位置を中心にLITE_DARK属性を通じた消灯処理を行う / Hack -- call light around the player Affect all monsters in the projection radius
1892 * @return 作用が実際にあった場合TRUEを返す
1894 bool unlite_area(HIT_POINT dam, POSITION rad)
1896 BIT_FLAGS flg = PROJECT_GRID | PROJECT_KILL;
1900 msg_print(_("暗闇が辺りを覆った。", "Darkness surrounds you."));
1903 /* Hook into the "project()" function */
1904 (void)project(0, rad, p_ptr->y, p_ptr->x, dam, GF_DARK_WEAK, flg, -1);
1906 unlite_room(p_ptr->y, p_ptr->x);
1915 * @brief ボール系スペルの発動 / Cast a ball spell
1917 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
1920 * @return 作用が実際にあった場合TRUEを返す
1923 * Stop if we hit a monster, act as a "ball"
1924 * Allow "target" mode to pass over monsters
1925 * Affect grids, objects, and monsters
1928 bool fire_ball(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad)
1932 BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
1934 if (typ == GF_CHARM_LIVING) flg|= PROJECT_HIDE;
1935 /* Use the given direction */
1936 tx = p_ptr->x + 99 * ddx[dir];
1937 ty = p_ptr->y + 99 * ddy[dir];
1939 /* Hack -- Use an actual "target" */
1940 if ((dir == 5) && target_okay())
1942 flg &= ~(PROJECT_STOP);
1947 /* Analyze the "dir" and the "target". Hurt items on floor. */
1948 return (project(0, rad, ty, tx, dam, typ, flg, -1));
1952 * @brief ブレス系スペルの発動 / Cast a breath spell
1954 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
1957 * @return 作用が実際にあった場合TRUEを返す
1960 * Stop if we hit a monster, act as a "ball"
1961 * Allow "target" mode to pass over monsters
1962 * Affect grids, objects, and monsters
1965 bool fire_breath(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad)
1967 return fire_ball(typ, dir, dam, -rad);
1972 * @brief ロケット系スペルの発動(詳細な差は確認中) / Cast a ball spell
1974 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
1977 * @return 作用が実際にあった場合TRUEを返す
1980 * Stop if we hit a monster, act as a "ball"
1981 * Allow "target" mode to pass over monsters
1982 * Affect grids, objects, and monsters
1985 bool fire_rocket(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad)
1988 BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
1990 /* Use the given direction */
1991 tx = p_ptr->x + 99 * ddx[dir];
1992 ty = p_ptr->y + 99 * ddy[dir];
1994 /* Hack -- Use an actual "target" */
1995 if ((dir == 5) && target_okay())
2001 /* Analyze the "dir" and the "target". Hurt items on floor. */
2002 return (project(0, rad, ty, tx, dam, typ, flg, -1));
2007 * @brief ボール(ハイド)系スペルの発動 / Cast a ball spell
2009 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2012 * @return 作用が実際にあった場合TRUEを返す
2015 * Stop if we hit a monster, act as a "ball"
2016 * Allow "target" mode to pass over monsters
2017 * Affect grids, objects, and monsters
2020 bool fire_ball_hide(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad)
2023 BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_HIDE;
2025 /* Use the given direction */
2026 tx = p_ptr->x + 99 * ddx[dir];
2027 ty = p_ptr->y + 99 * ddy[dir];
2029 /* Hack -- Use an actual "target" */
2030 if ((dir == 5) && target_okay())
2032 flg &= ~(PROJECT_STOP);
2037 /* Analyze the "dir" and the "target". Hurt items on floor. */
2038 return (project(0, rad, ty, tx, dam, typ, flg, -1));
2043 * @brief メテオ系スペルの発動 / Cast a meteor spell
2044 * @param who スぺル詠唱者のモンスターID(0=プレイヤー)
2050 * @return 作用が実際にあった場合TRUEを返す
2053 * Cast a meteor spell, defined as a ball spell cast by an arbitary monster,
2054 * player, or outside source, that starts out at an arbitrary location, and
2055 * leaving no trail from the "caster" to the target. This function is
2056 * especially useful for bombardments and similar. -LM-
2057 * Option to hurt the player.
2060 bool fire_meteor(MONSTER_IDX who, EFFECT_ID typ, POSITION y, POSITION x, HIT_POINT dam, POSITION rad)
2062 BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
2064 /* Analyze the "target" and the caster. */
2065 return (project(who, rad, y, x, dam, typ, flg, -1));
2070 * @brief ブラスト系スペルの発動 / Cast a blast spell
2072 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2077 * @return 作用が実際にあった場合TRUEを返す
2079 bool fire_blast(EFFECT_ID typ, DIRECTION dir, DICE_NUMBER dd, DICE_SID ds, int num, int dev)
2083 POSITION ty, tx, y, x;
2086 BIT_FLAGS flg = PROJECT_FAST | PROJECT_THRU | PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE | PROJECT_GRID;
2091 /* Use the given direction */
2094 ly = ty = p_ptr->y + 20 * ddy[dir];
2095 lx = tx = p_ptr->x + 20 * ddx[dir];
2098 /* Use an actual "target" */
2099 else /* if (dir == 5) */
2104 lx = 20 * (tx - p_ptr->x) + p_ptr->x;
2105 ly = 20 * (ty - p_ptr->y) + p_ptr->y;
2108 ld = distance(p_ptr->y, p_ptr->x, ly, lx);
2111 for (i = 0; i < num; i++)
2115 /* Get targets for some bolts */
2116 y = rand_spread(ly, ld * dev / 20);
2117 x = rand_spread(lx, ld * dev / 20);
2119 if (distance(ly, lx, y, x) <= ld * dev / 20) break;
2122 /* Analyze the "dir" and the "target". */
2123 if (!project(0, 0, y, x, damroll(dd, ds), typ, flg, -1))
2134 * @brief モンスターとの位置交換処理 / Switch position with a monster.
2135 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2136 * @return 作用が実際にあった場合TRUEを返す
2138 bool teleport_swap(DIRECTION dir)
2142 monster_type* m_ptr;
2143 monster_race* r_ptr;
2145 if ((dir == 5) && target_okay())
2152 tx = p_ptr->x + ddx[dir];
2153 ty = p_ptr->y + ddy[dir];
2155 g_ptr = &p_ptr->current_floor_ptr->grid_array[ty][tx];
2157 if (p_ptr->anti_tele)
2159 msg_print(_("不思議な力がテレポートを防いだ!", "A mysterious force prevents you from teleporting!"));
2163 if (!g_ptr->m_idx || (g_ptr->m_idx == p_ptr->riding))
2165 msg_print(_("それとは場所を交換できません。", "You can't trade places with that!"));
2169 if ((g_ptr->info & CAVE_ICKY) || (distance(ty, tx, p_ptr->y, p_ptr->x) > p_ptr->lev * 3 / 2 + 10))
2171 msg_print(_("失敗した。", "Failed to swap."));
2175 m_ptr = &p_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
2176 r_ptr = &r_info[m_ptr->r_idx];
2178 (void)set_monster_csleep(g_ptr->m_idx, 0);
2180 if (r_ptr->flagsr & RFR_RES_TELE)
2182 msg_print(_("テレポートを邪魔された!", "Your teleportation is blocked!"));
2183 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2187 sound(SOUND_TELEPORT);
2189 /* Swap the player and monster */
2190 (void)move_player_effect(p_ptr, ty, tx, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP);
2198 * @brief 指定方向に飛び道具を飛ばす(フラグ任意指定) / Hack -- apply a "project()" in a direction (or at the target)
2200 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2203 * @return 作用が実際にあった場合TRUEを返す
2205 bool project_hook(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, BIT_FLAGS flg)
2209 /* Pass through the target if needed */
2210 flg |= (PROJECT_THRU);
2212 /* Use the given direction */
2213 tx = p_ptr->x + ddx[dir];
2214 ty = p_ptr->y + ddy[dir];
2216 /* Hack -- Use an actual "target" */
2217 if ((dir == 5) && target_okay())
2223 /* Analyze the "dir" and the "target", do NOT explode */
2224 return (project(0, 0, ty, tx, dam, typ, flg, -1));
2229 * @brief ボルト系スペルの発動 / Cast a bolt spell.
2231 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2233 * @return 作用が実際にあった場合TRUEを返す
2236 * Stop if we hit a monster, as a "bolt".
2237 * Affect monsters and grids (not objects).
2240 bool fire_bolt(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam)
2242 BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_GRID;
2243 if (typ != GF_ARROW) flg |= PROJECT_REFLECTABLE;
2244 return (project_hook(typ, dir, dam, flg));
2249 * @brief ビーム系スペルの発動 / Cast a beam spell.
2251 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2253 * @return 作用が実際にあった場合TRUEを返す
2256 * Pass through monsters, as a "beam".
2257 * Affect monsters, grids and objects.
2260 bool fire_beam(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam)
2262 BIT_FLAGS flg = PROJECT_BEAM | PROJECT_KILL | PROJECT_GRID | PROJECT_ITEM;
2263 return (project_hook(typ, dir, dam, flg));
2268 * @brief 確率に応じたボルト系/ビーム系スペルの発動 / Cast a bolt spell, or rarely, a beam spell.
2269 * @param prob ビーム化する確率(%)
2271 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2273 * @return 作用が実際にあった場合TRUEを返す
2276 * Pass through monsters, as a "beam".
2277 * Affect monsters, grids and objects.
2280 bool fire_bolt_or_beam(PERCENTAGE prob, EFFECT_ID typ, DIRECTION dir, HIT_POINT dam)
2282 if (randint0(100) < prob)
2284 return (fire_beam(typ, dir, dam));
2288 return (fire_bolt(typ, dir, dam));
2293 * @brief LITE_WEAK属性による光源ビーム処理
2294 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2296 * @return 作用が実際にあった場合TRUEを返す
2298 bool lite_line(DIRECTION dir, HIT_POINT dam)
2300 BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_KILL;
2301 return (project_hook(GF_LITE_WEAK, dir, dam, flg));
2306 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2308 * @return 作用が実際にあった場合TRUEを返す
2310 bool hypodynamic_bolt(DIRECTION dir, HIT_POINT dam)
2312 BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
2313 return (project_hook(GF_HYPODYNAMIA, dir, dam, flg));
2318 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2320 * @return 作用が実際にあった場合TRUEを返す
2322 bool wall_to_mud(DIRECTION dir, HIT_POINT dam)
2324 BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
2325 return (project_hook(GF_KILL_WALL, dir, dam, flg));
2330 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2331 * @return 作用が実際にあった場合TRUEを返す
2333 bool wizard_lock(DIRECTION dir)
2335 BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
2336 return (project_hook(GF_JAM_DOOR, dir, 20 + randint1(30), flg));
2341 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2342 * @return 作用が実際にあった場合TRUEを返す
2344 bool destroy_door(DIRECTION dir)
2346 BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM;
2347 return (project_hook(GF_KILL_DOOR, dir, 0, flg));
2352 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2353 * @return 作用が実際にあった場合TRUEを返す
2355 bool disarm_trap(DIRECTION dir)
2357 BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM;
2358 return (project_hook(GF_KILL_TRAP, dir, 0, flg));
2364 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2365 * @param plev プレイヤーレベル(効力はplev*200)
2366 * @return 作用が実際にあった場合TRUEを返す
2368 bool death_ray(DIRECTION dir, PLAYER_LEVEL plev)
2370 BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
2371 return (project_hook(GF_DEATH_RAY, dir, plev * 200, flg));
2375 * @brief モンスター用テレポート処理
2376 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2377 * @param distance 移動距離
2378 * @return 作用が実際にあった場合TRUEを返す
2380 bool teleport_monster(DIRECTION dir, int distance)
2382 BIT_FLAGS flg = PROJECT_BEAM | PROJECT_KILL;
2383 return (project_hook(GF_AWAY_ALL, dir, distance, flg));
2387 * @brief ドア生成処理(プレイヤー中心に周囲1マス) / Hooks -- affect adjacent grids (radius 1 ball attack)
2388 * @return 作用が実際にあった場合TRUEを返す
2390 bool door_creation(void)
2392 BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
2393 return (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_MAKE_DOOR, flg, -1));
2397 * @brief トラップ生成処理(起点から周囲1マス)
2400 * @return 作用が実際にあった場合TRUEを返す
2402 bool trap_creation(POSITION y, POSITION x)
2404 BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
2405 return (project(0, 1, y, x, 0, GF_MAKE_TRAP, flg, -1));
2409 * @brief 森林生成処理(プレイヤー中心に周囲1マス)
2410 * @return 作用が実際にあった場合TRUEを返す
2412 bool tree_creation(void)
2414 BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
2415 return (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_MAKE_TREE, flg, -1));
2419 * @brief 魔法のルーン生成処理(プレイヤー中心に周囲1マス)
2420 * @return 作用が実際にあった場合TRUEを返す
2422 bool glyph_creation(void)
2424 BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM;
2425 return (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_MAKE_GLYPH, flg, -1));
2429 * @brief 壁生成処理(プレイヤー中心に周囲1マス)
2430 * @return 作用が実際にあった場合TRUEを返す
2432 bool wall_stone(void)
2434 BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
2435 bool dummy = (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_STONE_WALL, flg, -1));
2436 p_ptr->update |= (PU_FLOW);
2437 p_ptr->redraw |= (PR_MAP);
2442 * @brief ドア破壊処理(プレイヤー中心に周囲1マス)
2443 * @return 作用が実際にあった場合TRUEを返す
2445 bool destroy_doors_touch(void)
2447 BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
2448 return (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_KILL_DOOR, flg, -1));
2452 * @brief トラップ解除処理(プレイヤー中心に周囲1マス)
2453 * @return 作用が実際にあった場合TRUEを返す
2455 bool disarm_traps_touch(void)
2457 BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
2458 return (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_KILL_TRAP, flg, -1));
2462 * @brief スリープモンスター処理(プレイヤー中心に周囲1マス)
2463 * @return 作用が実際にあった場合TRUEを返す
2465 bool sleep_monsters_touch(void)
2467 BIT_FLAGS flg = PROJECT_KILL | PROJECT_HIDE;
2468 return (project(0, 1, p_ptr->y, p_ptr->x, p_ptr->lev, GF_OLD_SLEEP, flg, -1));
2473 * @brief 死者復活処理(起点より周囲5マス)
2474 * @param who 術者モンスターID(0ならばプレイヤー)
2477 * @return 作用が実際にあった場合TRUEを返す
2479 bool animate_dead(MONSTER_IDX who, POSITION y, POSITION x)
2481 BIT_FLAGS flg = PROJECT_ITEM | PROJECT_HIDE;
2482 return (project(who, 5, y, x, 0, GF_ANIM_DEAD, flg, -1));
2487 * @return 作用が実際にあった場合TRUEを返す
2489 void call_chaos(void)
2491 int Chaos_type, dummy, dir;
2492 PLAYER_LEVEL plev = p_ptr->lev;
2493 bool line_chaos = FALSE;
2495 int hurt_types[31] =
2497 GF_ELEC, GF_POIS, GF_ACID, GF_COLD,
2498 GF_FIRE, GF_MISSILE, GF_ARROW, GF_PLASMA,
2499 GF_HOLY_FIRE, GF_WATER, GF_LITE, GF_DARK,
2500 GF_FORCE, GF_INERTIAL, GF_MANA, GF_METEOR,
2501 GF_ICE, GF_CHAOS, GF_NETHER, GF_DISENCHANT,
2502 GF_SHARDS, GF_SOUND, GF_NEXUS, GF_CONFUSION,
2503 GF_TIME, GF_GRAVITY, GF_ROCKET, GF_NUKE,
2504 GF_HELL_FIRE, GF_DISINTEGRATE, GF_PSY_SPEAR
2507 Chaos_type = hurt_types[randint0(31)];
2508 if (one_in_(4)) line_chaos = TRUE;
2512 for (dummy = 1; dummy < 10; dummy++)
2517 fire_beam(Chaos_type, dummy, 150);
2519 fire_ball(Chaos_type, dummy, 150, 2);
2523 else if (one_in_(3))
2525 fire_ball(Chaos_type, 0, 500, 8);
2529 if (!get_aim_dir(&dir)) return;
2531 fire_beam(Chaos_type, dir, 250);
2533 fire_ball(Chaos_type, dir, 250, 3 + (plev / 35));
2538 * @brief TY_CURSE処理発動 / Activate the evil Topi Ylinen curse
2539 * @param stop_ty 再帰処理停止フラグ
2541 * @return 作用が実際にあった場合TRUEを返す
2544 * rr9: Stop the nasty things when a Cyberdemon is summoned
2545 * or the player gets paralyzed.
2548 bool activate_ty_curse(bool stop_ty, int *count)
2551 BIT_FLAGS flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
2555 switch (randint1(34))
2560 msg_print(_("地面が揺れた...", "The ground trembles..."));
2561 earthquake(p_ptr, p_ptr->y, p_ptr->x, 5 + randint0(10), 0);
2562 if (!one_in_(6)) break;
2567 HIT_POINT dam = damroll(10, 10);
2568 msg_print(_("純粋な魔力の次元への扉が開いた!", "A portal opens to a plane of raw mana!"));
2569 project(0, 8, p_ptr->y, p_ptr->x, dam, GF_MANA, flg, -1);
2570 take_hit(p_ptr, DAMAGE_NOESCAPE, dam, _("純粋な魔力の解放", "released pure mana"), -1);
2571 if (!one_in_(6)) break;
2576 msg_print(_("周囲の空間が歪んだ!", "Space warps about you!"));
2577 teleport_player(damroll(10, 10), TELEPORT_PASSIVE);
2578 if (randint0(13)) (*count) += activate_hi_summon(p_ptr->y, p_ptr->x, FALSE);
2579 if (!one_in_(6)) break;
2582 msg_print(_("エネルギーのうねりを感じた!", "You feel a surge of energy!"));
2586 project(0, 7, p_ptr->y, p_ptr->x, 50, GF_KILL_WALL, flg, -1);
2587 take_hit(p_ptr, DAMAGE_NOESCAPE, 50, _("エネルギーのうねり", "surge of energy"), -1);
2589 if (!one_in_(6)) break;
2590 case 1: case 2: case 3: case 16: case 17:
2591 aggravate_monsters(0);
2592 if (!one_in_(6)) break;
2593 case 4: case 5: case 6:
2594 (*count) += activate_hi_summon(p_ptr->y, p_ptr->x, FALSE);
2595 if (!one_in_(6)) break;
2596 case 7: case 8: case 9: case 18:
2597 (*count) += summon_specific(0, p_ptr->y, p_ptr->x, p_ptr->current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
2598 if (!one_in_(6)) break;
2599 case 10: case 11: case 12:
2600 msg_print(_("経験値が体から吸い取られた気がする!", "You feel your experience draining away..."));
2601 lose_exp(p_ptr, p_ptr->exp / 16);
2602 if (!one_in_(6)) break;
2603 case 13: case 14: case 15: case 19: case 20:
2604 if (stop_ty || (p_ptr->free_act && (randint1(125) < p_ptr->skill_sav)) || (p_ptr->pclass == CLASS_BERSERKER))
2610 msg_print(_("彫像になった気分だ!", "You feel like a statue!"));
2611 if (p_ptr->free_act)
2612 set_paralyzed(p_ptr, p_ptr->paralyzed + randint1(3));
2614 set_paralyzed(p_ptr, p_ptr->paralyzed + randint1(13));
2617 if (!one_in_(6)) break;
2618 case 21: case 22: case 23:
2619 (void)do_dec_stat(p_ptr, randint0(6));
2620 if (!one_in_(6)) break;
2622 msg_print(_("ほえ?私は誰?ここで何してる?", "Huh? Who am I? What am I doing here?"));
2623 lose_all_info(p_ptr);
2624 if (!one_in_(6)) break;
2627 * Only summon Cyberdemons deep in the dungeon.
2629 if ((p_ptr->current_floor_ptr->dun_level > 65) && !stop_ty)
2631 (*count) += summon_cyber(-1, p_ptr->y, p_ptr->x);
2635 if (!one_in_(6)) break;
2641 (void)do_dec_stat(p_ptr, i);
2649 while (one_in_(3) && !stop_ty);
2655 * @brief HI_SUMMON(上級召喚)処理発動
2658 * @param can_pet プレイヤーのペットとなる可能性があるならばTRUEにする
2659 * @return 作用が実際にあった場合TRUEを返す
2661 int activate_hi_summon(POSITION y, POSITION x, bool can_pet)
2666 BIT_FLAGS mode = PM_ALLOW_GROUP;
2673 mode |= PM_FORCE_FRIENDLY;
2677 mode |= PM_FORCE_PET;
2682 if (!pet) mode |= PM_NO_PET;
2684 summon_lev = (pet ? p_ptr->lev * 2 / 3 + randint1(p_ptr->lev / 2) : p_ptr->current_floor_ptr->dun_level);
2686 for (i = 0; i < (randint1(7) + (p_ptr->current_floor_ptr->dun_level / 40)); i++)
2688 switch (randint1(25) + (p_ptr->current_floor_ptr->dun_level / 20))
2691 count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_ANT, mode);
2694 count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_SPIDER, mode);
2697 count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HOUND, mode);
2700 count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HYDRA, mode);
2703 count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_ANGEL, mode);
2706 count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_UNDEAD, mode);
2709 count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_DRAGON, mode);
2712 count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_DEMON, mode);
2716 count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_AMBERITES, (mode | PM_ALLOW_UNIQUE));
2720 count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_UNIQUE, (mode | PM_ALLOW_UNIQUE));
2723 if (!can_pet) mode |= PM_ALLOW_UNIQUE;
2724 count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HI_UNDEAD, mode);
2727 if (!can_pet) mode |= PM_ALLOW_UNIQUE;
2728 count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HI_DRAGON, mode);
2731 count += summon_specific((pet ? -1 : 0), y, x, 100, SUMMON_CYBER, mode);
2734 if (!can_pet) mode |= PM_ALLOW_UNIQUE;
2735 count += summon_specific((pet ? -1 : 0), y, x,pet ? summon_lev : (((summon_lev * 3) / 2) + 5), 0, mode);
2743 * @brief 周辺破壊効果(プレイヤー中心)
2744 * @return 作用が実際にあった場合TRUEを返す
2746 void wall_breaker(void)
2749 POSITION y = 0, x = 0;
2750 int attempts = 1000;
2752 if (randint1(80 + p_ptr->lev) < 70)
2756 scatter(&y, &x, p_ptr->y, p_ptr->x, 4, 0);
2758 if (!cave_have_flag_bold(y, x, FF_PROJECT)) continue;
2760 if (!player_bold(p_ptr, y, x)) break;
2763 project(0, 0, y, x, 20 + randint1(30), GF_KILL_WALL,
2764 (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1);
2766 else if (randint1(100) > 30)
2768 earthquake(p_ptr, p_ptr->y, p_ptr->x, 1, 0);
2772 int num = damroll(5, 3);
2774 for (i = 0; i < num; i++)
2778 scatter(&y, &x, p_ptr->y, p_ptr->x, 10, 0);
2780 if (!player_bold(p_ptr, y, x)) break;
2783 project(0, 0, y, x, 20 + randint1(30), GF_KILL_WALL,
2784 (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1);
2791 * @brief パニック・モンスター効果(プレイヤー視界範囲内) / Confuse monsters
2793 * @return 作用が実際にあった場合TRUEを返す
2795 bool confuse_monsters(HIT_POINT dam)
2797 return (project_all_los(GF_OLD_CONF, dam));
2802 * @brief チャーム・モンスター効果(プレイヤー視界範囲内) / Charm monsters
2804 * @return 作用が実際にあった場合TRUEを返す
2806 bool charm_monsters(HIT_POINT dam)
2808 return (project_all_los(GF_CHARM, dam));
2813 * @brief 動物魅了効果(プレイヤー視界範囲内) / Charm Animals
2815 * @return 作用が実際にあった場合TRUEを返す
2817 bool charm_animals(HIT_POINT dam)
2819 return (project_all_los(GF_CONTROL_ANIMAL, dam));
2824 * @brief モンスター朦朧効果(プレイヤー視界範囲内) / Stun monsters
2826 * @return 作用が実際にあった場合TRUEを返す
2828 bool stun_monsters(HIT_POINT dam)
2830 return (project_all_los(GF_STUN, dam));
2835 * @brief モンスター停止効果(プレイヤー視界範囲内) / Stasis monsters
2837 * @return 作用が実際にあった場合TRUEを返す
2839 bool stasis_monsters(HIT_POINT dam)
2841 return (project_all_los(GF_STASIS, dam));
2846 * @brief モンスター精神攻撃効果(プレイヤー視界範囲内) / Mindblast monsters
2848 * @return 作用が実際にあった場合TRUEを返す
2850 bool mindblast_monsters(HIT_POINT dam)
2852 return (project_all_los(GF_PSI, dam));
2857 * @brief モンスター追放効果(プレイヤー視界範囲内) / Banish all monsters
2858 * @param dist 効力(距離)
2859 * @return 作用が実際にあった場合TRUEを返す
2861 bool banish_monsters(int dist)
2863 return (project_all_los(GF_AWAY_ALL, dist));
2868 * @brief 邪悪退散効果(プレイヤー視界範囲内) / Turn evil
2870 * @return 作用が実際にあった場合TRUEを返す
2872 bool turn_evil(HIT_POINT dam)
2874 return (project_all_los(GF_TURN_EVIL, dam));
2879 * @brief 全モンスター退散効果(プレイヤー視界範囲内) / Turn everyone
2881 * @return 作用が実際にあった場合TRUEを返す
2883 bool turn_monsters(HIT_POINT dam)
2885 return (project_all_los(GF_TURN_ALL, dam));
2890 * @brief 死の光線(プレイヤー視界範囲内) / Death-ray all monsters (note: OBSCENELY powerful)
2891 * @return 作用が実際にあった場合TRUEを返す
2893 bool deathray_monsters(void)
2895 return (project_all_los(GF_DEATH_RAY, p_ptr->lev * 200));
2899 * @brief チャーム・モンスター(1体)
2900 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2902 * @return 作用が実際にあった場合TRUEを返す
2904 bool charm_monster(DIRECTION dir, PLAYER_LEVEL plev)
2906 BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
2907 return (project_hook(GF_CHARM, dir, plev, flg));
2911 * @brief アンデッド支配(1体)
2912 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2914 * @return 作用が実際にあった場合TRUEを返す
2916 bool control_one_undead(DIRECTION dir, PLAYER_LEVEL plev)
2918 BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
2919 return (project_hook(GF_CONTROL_UNDEAD, dir, plev, flg));
2924 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2926 * @return 作用が実際にあった場合TRUEを返す
2928 bool control_one_demon(DIRECTION dir, PLAYER_LEVEL plev)
2930 BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
2931 return (project_hook(GF_CONTROL_DEMON, dir, plev, flg));
2936 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
2938 * @return 作用が実際にあった場合TRUEを返す
2940 bool charm_animal(DIRECTION dir, PLAYER_LEVEL plev)
2942 BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
2943 return (project_hook(GF_CONTROL_ANIMAL, dir, plev, flg));
2949 * @param success 判定成功上の処理ならばTRUE
2950 * @return 作用が実際にあった場合TRUEを返す
2952 bool kawarimi(bool success)
2955 object_type *q_ptr = &forge;
2958 if (p_ptr->is_dead) return FALSE;
2959 if (p_ptr->confused || p_ptr->blind || p_ptr->paralyzed || p_ptr->image) return FALSE;
2960 if (randint0(200) < p_ptr->stun) return FALSE;
2962 if (!success && one_in_(3))
2964 msg_print(_("失敗!逃げられなかった。", "Failed! You couldn't run away."));
2965 p_ptr->special_defense &= ~(NINJA_KAWARIMI);
2966 p_ptr->redraw |= (PR_STATUS);
2973 teleport_player(10 + randint1(90), 0L);
2975 object_prep(q_ptr, lookup_kind(TV_STATUE, SV_WOODEN_STATUE));
2977 q_ptr->pval = MON_NINJA;
2978 (void)drop_near(q_ptr, -1, y, x);
2980 if (success) msg_print(_("攻撃を受ける前に素早く身をひるがえした。", "You have turned around just before the attack hit you."));
2981 else msg_print(_("失敗!攻撃を受けてしまった。", "Failed! You are hit by the attack."));
2983 p_ptr->special_defense &= ~(NINJA_KAWARIMI);
2984 p_ptr->redraw |= (PR_STATUS);
2992 * @brief 入身処理 / "Rush Attack" routine for Samurai or Ninja
2993 * @param mdeath 目標モンスターが死亡したかを返す
2994 * @return 作用が実際にあった場合TRUEを返す / Return value is for checking "done"
2996 bool rush_attack(bool *mdeath)
3003 bool tmp_mdeath = FALSE;
3006 if (mdeath) *mdeath = FALSE;
3009 if (!get_aim_dir(&dir)) return FALSE;
3011 /* Use the given direction */
3012 tx = p_ptr->x + project_length * ddx[dir];
3013 ty = p_ptr->y + project_length * ddy[dir];
3015 /* Hack -- Use an actual "target" */
3016 if ((dir == 5) && target_okay())
3022 if (in_bounds(p_ptr->current_floor_ptr, ty, tx)) tm_idx = p_ptr->current_floor_ptr->grid_array[ty][tx].m_idx;
3024 path_n = project_path(path_g, project_length, p_ptr->y, p_ptr->x, ty, tx, PROJECT_STOP | PROJECT_KILL);
3027 /* No need to move */
3028 if (!path_n) return TRUE;
3030 /* Use ty and tx as to-move point */
3034 /* Project along the path */
3035 for (i = 0; i < path_n; i++)
3037 monster_type *m_ptr;
3039 int ny = GRID_Y(path_g[i]);
3040 int nx = GRID_X(path_g[i]);
3042 if (cave_empty_bold(p_ptr->current_floor_ptr, ny, nx) && player_can_enter(p_ptr->current_floor_ptr->grid_array[ny][nx].feat, 0))
3047 /* Go to next grid */
3051 if (!p_ptr->current_floor_ptr->grid_array[ny][nx].m_idx)
3055 msg_print(_("失敗!", "Failed!"));
3059 msg_print(_("ここには入身では入れない。", "You can't move to that place."));
3066 /* Move player before updating the monster */
3067 if (!player_bold(p_ptr, ty, tx)) teleport_player_to(p_ptr, ty, tx, TELEPORT_NONMAGICAL);
3068 update_monster(p_ptr, p_ptr->current_floor_ptr->grid_array[ny][nx].m_idx, TRUE);
3070 /* Found a monster */
3071 m_ptr = &p_ptr->current_floor_ptr->m_list[p_ptr->current_floor_ptr->grid_array[ny][nx].m_idx];
3073 if (tm_idx != p_ptr->current_floor_ptr->grid_array[ny][nx].m_idx)
3076 msg_format("%s%sが立ちふさがっている!", tm_idx ? "別の" : "", m_ptr->ml ? "モンスター" : "何か");
3078 msg_format("There is %s in the way!", m_ptr->ml ? (tm_idx ? "another monster" : "a monster") : "someone");
3081 else if (!player_bold(p_ptr, ty, tx))
3083 /* Hold the monster name */
3084 GAME_TEXT m_name[MAX_NLEN];
3086 /* Get the monster name (BEFORE polymorphing) */
3087 monster_desc(m_name, m_ptr, 0);
3088 msg_format(_("素早く%sの懐に入り込んだ!", "You quickly jump in and attack %s!"), m_name);
3091 if (!player_bold(p_ptr, ty, tx)) teleport_player_to(p_ptr, ty, tx, TELEPORT_NONMAGICAL);
3093 tmp_mdeath = py_attack(p_ptr, ny, nx, HISSATSU_NYUSIN);
3098 if (!moved && !player_bold(p_ptr, ty, tx)) teleport_player_to(p_ptr, ty, tx, TELEPORT_NONMAGICAL);
3100 if (mdeath) *mdeath = tmp_mdeath;
3106 * @brief 全鏡の消去 / Remove all mirrors in this floor
3107 * @param explode 爆発処理を伴うならばTRUE
3110 void remove_all_mirrors(bool explode)
3114 for (x = 0; x < p_ptr->current_floor_ptr->width; x++)
3116 for (y = 0; y < p_ptr->current_floor_ptr->height; y++)
3118 if (is_mirror_grid(&p_ptr->current_floor_ptr->grid_array[y][x]))
3120 remove_mirror(y, x);
3122 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS,
3123 (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
3130 * @brief 『一つの指輪』の効果処理 /
3131 * Hack -- activate the ring of power
3132 * @param dir 発動の方向ID
3135 void ring_of_power(DIRECTION dir)
3137 /* Pick a random effect */
3138 switch (randint1(10))
3143 msg_print(_("あなたは悪性のオーラに包み込まれた。", "You are surrounded by a malignant aura."));
3146 /* Decrease all stats (permanently) */
3147 (void)dec_stat(p_ptr, A_STR, 50, TRUE);
3148 (void)dec_stat(p_ptr, A_INT, 50, TRUE);
3149 (void)dec_stat(p_ptr, A_WIS, 50, TRUE);
3150 (void)dec_stat(p_ptr, A_DEX, 50, TRUE);
3151 (void)dec_stat(p_ptr, A_CON, 50, TRUE);
3152 (void)dec_stat(p_ptr, A_CHR, 50, TRUE);
3154 /* Lose some experience (permanently) */
3155 p_ptr->exp -= (p_ptr->exp / 4);
3156 p_ptr->max_exp -= (p_ptr->exp / 4);
3157 check_experience(p_ptr);
3164 msg_print(_("あなたは強力なオーラに包み込まれた。", "You are surrounded by a powerful aura."));
3165 dispel_monsters(1000);
3173 fire_ball(GF_MANA, dir, 600, 3);
3182 fire_bolt(GF_MANA, dir, 500);
3189 * @brief 運命の輪、並びにカオス的な効果の発動
3190 * @param spell ランダムな効果を選択するための基準ID
3193 void wild_magic(int spell)
3196 int type = SUMMON_MOLD + randint0(6);
3198 if (type < SUMMON_MOLD) type = SUMMON_MOLD;
3199 else if (type > SUMMON_MIMIC) type = SUMMON_MIMIC;
3201 switch (randint1(spell) + randint1(8) + 1)
3206 teleport_player(10, TELEPORT_PASSIVE);
3211 teleport_player(100, TELEPORT_PASSIVE);
3215 teleport_player(200, TELEPORT_PASSIVE);
3225 lite_area(damroll(2, 3), 2);
3228 destroy_doors_touch();
3233 sleep_monsters_touch();
3237 trap_creation(p_ptr->y, p_ptr->x);
3246 aggravate_monsters(0);
3249 earthquake(p_ptr, p_ptr->y, p_ptr->x, 5, 0);
3253 (void)gain_mutation(p_ptr, 0);
3257 apply_disenchant(p_ptr, 1);
3260 lose_all_info(p_ptr);
3263 fire_ball(GF_CHAOS, 0, spell + 5, 1 + (spell / 10));
3270 while (counter++ < 8)
3272 (void)summon_specific(0, p_ptr->y, p_ptr->x, (p_ptr->current_floor_ptr->dun_level * 3) / 2, type, (PM_ALLOW_GROUP | PM_NO_PET));
3277 activate_hi_summon(p_ptr->y, p_ptr->x, FALSE);
3280 (void)summon_cyber(-1, p_ptr->y, p_ptr->x);
3285 (void)activate_ty_curse(FALSE, &count);
3294 * @brief カオス魔法「流星群」の処理としてプレイヤーを中心に隕石落下処理を10+1d10回繰り返す。
3295 * / Drop 10+1d10 meteor ball at random places near the player
3300 void cast_meteor(HIT_POINT dam, POSITION rad)
3303 int b = 10 + randint1(10);
3305 for (i = 0; i < b; i++)
3307 POSITION y = 0, x = 0;
3310 for (count = 0; count <= 20; count++)
3314 x = p_ptr->x - 8 + randint0(17);
3315 y = p_ptr->y - 8 + randint0(17);
3317 dx = (p_ptr->x > x) ? (p_ptr->x - x) : (x - p_ptr->x);
3318 dy = (p_ptr->y > y) ? (p_ptr->y - y) : (y - p_ptr->y);
3320 /* Approximate distance */
3321 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
3323 if (d >= 9) continue;
3325 if (!in_bounds(p_ptr->current_floor_ptr, y, x) || !projectable(p_ptr->current_floor_ptr, p_ptr->y, p_ptr->x, y, x)
3326 || !cave_have_flag_bold(y, x, FF_PROJECT)) continue;
3328 /* Valid position */
3332 if (count > 20) continue;
3334 project(0, rad, y, x, dam, GF_METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM, -1);
3340 * @brief 破邪魔法「神の怒り」の処理としてターゲットを指定した後分解のボールを最大20回発生させる。
3343 * @return ターゲットを指定し、実行したならばTRUEを返す。
3345 bool cast_wrath_of_the_god(HIT_POINT dam, POSITION rad)
3347 POSITION x, y, tx, ty;
3351 int b = 10 + randint1(10);
3353 if (!get_aim_dir(&dir)) return FALSE;
3355 /* Use the given direction */
3356 tx = p_ptr->x + 99 * ddx[dir];
3357 ty = p_ptr->y + 99 * ddy[dir];
3359 /* Hack -- Use an actual "target" */
3360 if ((dir == 5) && target_okay())
3371 /* Hack -- Stop at the target */
3372 if ((y == ty) && (x == tx)) break;
3376 mmove2(&ny, &nx, p_ptr->y, p_ptr->x, ty, tx);
3378 /* Stop at maximum range */
3379 if (MAX_RANGE <= distance(p_ptr->y, p_ptr->x, ny, nx)) break;
3381 /* Stopped by walls/doors */
3382 if (!cave_have_flag_bold(ny, nx, FF_PROJECT)) break;
3384 /* Stopped by monsters */
3385 if ((dir != 5) && p_ptr->current_floor_ptr->grid_array[ny][nx].m_idx != 0) break;
3387 /* Save the new location */
3394 for (i = 0; i < b; i++)
3396 int count = 20, d = 0;
3402 x = tx - 5 + randint0(11);
3403 y = ty - 5 + randint0(11);
3405 dx = (tx > x) ? (tx - x) : (x - tx);
3406 dy = (ty > y) ? (ty - y) : (y - ty);
3408 /* Approximate distance */
3409 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
3410 /* Within the radius */
3414 if (count < 0) continue;
3416 /* Cannot penetrate perm walls */
3417 if (!in_bounds(p_ptr->current_floor_ptr, y, x) ||
3418 cave_stop_disintegration(y, x) ||
3419 !in_disintegration_range(ty, tx, y, x))
3422 project(0, rad, y, x, dam, GF_DISINTEGRATE, PROJECT_JUMP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL, -1);
3429 * @brief 「ワンダー」のランダムな効果を決定して処理する。
3433 * This spell should become more useful (more controlled) as the\n
3434 * player gains experience levels. Thus, add 1/5 of the player's\n
3435 * level to the die roll. This eliminates the worst effects later on,\n
3436 * while keeping the results quite random. It also allows some potent\n
3437 * effects only at high level.
3439 void cast_wonder(DIRECTION dir)
3441 PLAYER_LEVEL plev = p_ptr->lev;
3442 int die = randint1(100) + plev / 5;
3443 int vir = virtue_number(p_ptr, V_CHANCE);
3447 if (p_ptr->virtues[vir - 1] > 0)
3449 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
3453 while (randint1(400) < (0 - p_ptr->virtues[vir - 1])) die--;
3458 chg_virtue(p_ptr, V_CHANCE, 1);
3462 msg_print(_("あなたは力がみなぎるのを感じた!", "You feel a surge of power!"));
3465 if (die < 8) clone_monster(dir);
3466 else if (die < 14) speed_monster(dir, plev);
3467 else if (die < 26) heal_monster(dir, damroll(4, 6));
3468 else if (die < 31) poly_monster(dir, plev);
3470 fire_bolt_or_beam(beam_chance() - 10, GF_MISSILE, dir,
3471 damroll(3 + ((plev - 1) / 5), 4));
3472 else if (die < 41) confuse_monster(dir, plev);
3473 else if (die < 46) fire_ball(GF_POIS, dir, 20 + (plev / 2), 3);
3474 else if (die < 51) (void)lite_line(dir, damroll(6, 8));
3476 fire_bolt_or_beam(beam_chance() - 10, GF_ELEC, dir,
3477 damroll(3 + ((plev - 5) / 4), 8));
3479 fire_bolt_or_beam(beam_chance() - 10, GF_COLD, dir,
3480 damroll(5 + ((plev - 5) / 4), 8));
3482 fire_bolt_or_beam(beam_chance(), GF_ACID, dir,
3483 damroll(6 + ((plev - 5) / 4), 8));
3485 fire_bolt_or_beam(beam_chance(), GF_FIRE, dir,
3486 damroll(8 + ((plev - 5) / 4), 8));
3487 else if (die < 76) hypodynamic_bolt(dir, 75);
3488 else if (die < 81) fire_ball(GF_ELEC, dir, 30 + plev / 2, 2);
3489 else if (die < 86) fire_ball(GF_ACID, dir, 40 + plev, 2);
3490 else if (die < 91) fire_ball(GF_ICE, dir, 70 + plev, 3);
3491 else if (die < 96) fire_ball(GF_FIRE, dir, 80 + plev, 3);
3492 else if (die < 101) hypodynamic_bolt(dir, 100 + plev);
3495 earthquake(p_ptr, p_ptr->y, p_ptr->x, 12, 0);
3499 (void)destroy_area(p_ptr->current_floor_ptr, p_ptr->y, p_ptr->x, 13 + randint0(5), FALSE);
3503 symbol_genocide(plev + 50, TRUE);
3505 else if (die < 110) dispel_monsters(120);
3508 dispel_monsters(150);
3509 slow_monsters(plev);
3510 sleep_monsters(plev);
3511 hp_player(p_ptr, 300);
3517 * @brief 「悪霊召喚」のランダムな効果を決定して処理する。
3521 void cast_invoke_spirits(DIRECTION dir)
3523 PLAYER_LEVEL plev = p_ptr->lev;
3524 int die = randint1(100) + plev / 5;
3525 int vir = virtue_number(p_ptr, V_CHANCE);
3529 if (p_ptr->virtues[vir - 1] > 0)
3531 while (randint1(400) < p_ptr->virtues[vir - 1]) die++;
3535 while (randint1(400) < (0 - p_ptr->virtues[vir - 1])) die--;
3539 msg_print(_("あなたは死者たちの力を招集した...", "You call on the power of the dead..."));
3541 chg_virtue(p_ptr, V_CHANCE, 1);
3545 msg_print(_("あなたはおどろおどろしい力のうねりを感じた!", "You feel a surge of eldritch force!"));
3550 msg_print(_("なんてこった!あなたの周りの地面から朽ちた人影が立ち上がってきた!",
3551 "Oh no! Mouldering forms rise from the earth around you!"));
3553 (void)summon_specific(0, p_ptr->y, p_ptr->x, p_ptr->current_floor_ptr->dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
3554 chg_virtue(p_ptr, V_UNLIFE, 1);
3558 msg_print(_("名状し難い邪悪な存在があなたの心を通り過ぎて行った...", "An unnamable evil brushes against your mind..."));
3560 set_afraid(p_ptr, p_ptr->afraid + randint1(4) + 4);
3564 msg_print(_("あなたの頭に大量の幽霊たちの騒々しい声が押し寄せてきた...",
3565 "Your head is invaded by a horde of gibbering spectral voices..."));
3567 set_confused(p_ptr, p_ptr->confused + randint1(4) + 4);
3571 poly_monster(dir, plev);
3575 fire_bolt_or_beam(beam_chance() - 10, GF_MISSILE, dir,
3576 damroll(3 + ((plev - 1) / 5), 4));
3580 confuse_monster(dir, plev);
3584 fire_ball(GF_POIS, dir, 20 + (plev / 2), 3);
3588 (void)lite_line(dir, damroll(6, 8));
3592 fire_bolt_or_beam(beam_chance() - 10, GF_ELEC, dir,
3593 damroll(3 + ((plev - 5) / 4), 8));
3597 fire_bolt_or_beam(beam_chance() - 10, GF_COLD, dir,
3598 damroll(5 + ((plev - 5) / 4), 8));
3602 fire_bolt_or_beam(beam_chance(), GF_ACID, dir,
3603 damroll(6 + ((plev - 5) / 4), 8));
3607 fire_bolt_or_beam(beam_chance(), GF_FIRE, dir,
3608 damroll(8 + ((plev - 5) / 4), 8));
3612 hypodynamic_bolt(dir, 75);
3616 fire_ball(GF_ELEC, dir, 30 + plev / 2, 2);
3620 fire_ball(GF_ACID, dir, 40 + plev, 2);
3624 fire_ball(GF_ICE, dir, 70 + plev, 3);
3628 fire_ball(GF_FIRE, dir, 80 + plev, 3);
3632 hypodynamic_bolt(dir, 100 + plev);
3636 earthquake(p_ptr, p_ptr->y, p_ptr->x, 12, 0);
3640 (void)destroy_area(p_ptr->current_floor_ptr, p_ptr->y, p_ptr->x, 13 + randint0(5), FALSE);
3644 symbol_genocide(plev + 50, TRUE);
3648 dispel_monsters(120);
3652 dispel_monsters(150);
3653 slow_monsters(plev);
3654 sleep_monsters(plev);
3655 hp_player(p_ptr, 300);
3660 msg_print(_("陰欝な声がクスクス笑う。「もうすぐおまえは我々の仲間になるだろう。弱き者よ。」",
3661 "Sepulchral voices chuckle. 'Soon you will join us, mortal.'"));
3666 * @brief トランプ領域の「シャッフル」の効果をランダムに決めて処理する。
3669 void cast_shuffle(player_type *caster_ptr)
3671 PLAYER_LEVEL plev = caster_ptr->lev;
3674 int vir = virtue_number(caster_ptr, V_CHANCE);
3677 /* Card sharks and high mages get a level bonus */
3678 if ((caster_ptr->pclass == CLASS_ROGUE) ||
3679 (caster_ptr->pclass == CLASS_HIGH_MAGE) ||
3680 (caster_ptr->pclass == CLASS_SORCERER))
3681 die = (randint1(110)) + plev / 5;
3683 die = randint1(120);
3688 if (caster_ptr->virtues[vir - 1] > 0)
3690 while (randint1(400) < caster_ptr->virtues[vir - 1]) die++;
3694 while (randint1(400) < (0 - caster_ptr->virtues[vir - 1])) die--;
3698 msg_print(_("あなたはカードを切って一枚引いた...", "You shuffle the deck and draw a card..."));
3701 chg_virtue(caster_ptr, V_CHANCE, 1);
3705 msg_print(_("なんてこった!《死》だ!", "Oh no! It's Death!"));
3707 for (i = 0; i < randint1(3); i++)
3708 activate_hi_summon(caster_ptr->y, caster_ptr->x, FALSE);
3712 msg_print(_("なんてこった!《悪魔》だ!", "Oh no! It's the Devil!"));
3713 summon_specific(0, caster_ptr->y, caster_ptr->x, caster_ptr->current_floor_ptr->dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
3718 msg_print(_("なんてこった!《吊られた男》だ!", "Oh no! It's the Hanged Man."));
3719 activate_ty_curse(FALSE, &count);
3723 msg_print(_("《不調和の剣》だ。", "It's the swords of discord."));
3724 aggravate_monsters(0);
3728 msg_print(_("《愚者》だ。", "It's the Fool."));
3729 do_dec_stat(caster_ptr, A_INT);
3730 do_dec_stat(caster_ptr, A_WIS);
3734 msg_print(_("奇妙なモンスターの絵だ。", "It's the picture of a strange monster."));
3735 trump_summoning(1, FALSE, caster_ptr->y, caster_ptr->x, (caster_ptr->current_floor_ptr->dun_level * 3 / 2), (32 + randint1(6)), PM_ALLOW_GROUP | PM_ALLOW_UNIQUE);
3739 msg_print(_("《月》だ。", "It's the Moon."));
3744 msg_print(_("《運命の輪》だ。", "It's the Wheel of Fortune."));
3745 wild_magic(randint0(32));
3749 msg_print(_("テレポート・カードだ。", "It's a teleport trump card."));
3750 teleport_player(10, TELEPORT_PASSIVE);
3754 msg_print(_("《正義》だ。", "It's Justice."));
3755 set_blessed(caster_ptr, caster_ptr->lev, FALSE);
3759 msg_print(_("テレポート・カードだ。", "It's a teleport trump card."));
3760 teleport_player(100, TELEPORT_PASSIVE);
3764 msg_print(_("テレポート・カードだ。", "It's a teleport trump card."));
3765 teleport_player(200, TELEPORT_PASSIVE);
3769 msg_print(_("《塔》だ。", "It's the Tower."));
3774 msg_print(_("《節制》だ。", "It's Temperance."));
3775 sleep_monsters_touch();
3779 msg_print(_("《塔》だ。", "It's the Tower."));
3781 earthquake(caster_ptr, caster_ptr->y, caster_ptr->x, 5, 0);
3785 msg_print(_("友好的なモンスターの絵だ。", "It's the picture of a friendly monster."));
3786 trump_summoning(1, TRUE, caster_ptr->y, caster_ptr->x, (caster_ptr->current_floor_ptr->dun_level * 3 / 2), SUMMON_MOLD, 0L);
3790 msg_print(_("友好的なモンスターの絵だ。", "It's the picture of a friendly monster."));
3791 trump_summoning(1, TRUE, caster_ptr->y, caster_ptr->x, (caster_ptr->current_floor_ptr->dun_level * 3 / 2), SUMMON_BAT, 0L);
3795 msg_print(_("友好的なモンスターの絵だ。", "It's the picture of a friendly monster."));
3796 trump_summoning(1, TRUE, caster_ptr->y, caster_ptr->x, (caster_ptr->current_floor_ptr->dun_level * 3 / 2), SUMMON_VORTEX, 0L);
3800 msg_print(_("友好的なモンスターの絵だ。", "It's the picture of a friendly monster."));
3801 trump_summoning(1, TRUE, caster_ptr->y, caster_ptr->x, (caster_ptr->current_floor_ptr->dun_level * 3 / 2), SUMMON_COIN_MIMIC, 0L);
3805 msg_print(_("《恋人》だ。", "It's the Lovers."));
3807 if (get_aim_dir(&dir))
3808 charm_monster(dir, MIN(caster_ptr->lev, 20));
3812 msg_print(_("《隠者》だ。", "It's the Hermit."));
3817 msg_print(_("《審判》だ。", "It's the Judgement."));
3818 roll_hitdice(caster_ptr, 0L);
3819 lose_all_mutations(caster_ptr);
3823 msg_print(_("《太陽》だ。", "It's the Sun."));
3824 chg_virtue(caster_ptr, V_KNOWLEDGE, 1);
3825 chg_virtue(caster_ptr, V_ENLIGHTEN, 1);
3826 wiz_lite(caster_ptr, FALSE);
3830 msg_print(_("《世界》だ。", "It's the World."));
3831 if (caster_ptr->exp < PY_MAX_EXP)
3833 s32b ee = (caster_ptr->exp / 25) + 1;
3834 if (ee > 5000) ee = 5000;
3835 msg_print(_("更に経験を積んだような気がする。", "You feel more experienced."));
3836 gain_exp(caster_ptr, ee);
3842 * @brief 口を使う継続的な処理を中断する
3845 void stop_mouth(void)
3847 if (music_singing_any(p_ptr)) stop_singing(p_ptr);
3848 if (hex_spelling_any(p_ptr)) stop_hex_spell_all();
3852 bool_hack vampirism(void)
3859 if (d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_MELEE)
3861 msg_print(_("なぜか攻撃することができない。", "Something prevent you from attacking."));
3865 /* Only works on adjacent monsters */
3866 if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
3867 y = p_ptr->y + ddy[dir];
3868 x = p_ptr->x + ddx[dir];
3869 g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
3873 if (!(g_ptr->m_idx))
3875 msg_print(_("何もない場所に噛みついた!", "You bite into thin air!"));
3879 msg_print(_("あなたはニヤリとして牙をむいた...", "You grin and bare your fangs..."));
3881 dummy = p_ptr->lev * 2;
3883 if (hypodynamic_bolt(dir, dummy))
3885 if (p_ptr->food < PY_FOOD_FULL)
3886 /* No heal if we are "full" */
3887 (void)hp_player(p_ptr, dummy);
3889 msg_print(_("あなたは空腹ではありません。", "You were not hungry."));
3891 /* Gain nutritional sustenance: 150/hp drained */
3892 /* A Food ration gives 5000 food points (by contrast) */
3893 /* Don't ever get more than "Full" this way */
3894 /* But if we ARE Gorged, it won't cure us */
3895 dummy = p_ptr->food + MIN(5000, 100 * dummy);
3896 if (p_ptr->food < PY_FOOD_MAX) /* Not gorged already */
3897 (void)set_food(p_ptr, dummy >= PY_FOOD_MAX ? PY_FOOD_MAX - 1 : dummy);
3900 msg_print(_("げぇ!ひどい味だ。", "Yechh. That tastes foul."));
3904 bool panic_hit(void)
3909 if (!get_direction(&dir, FALSE, FALSE)) return FALSE;
3910 y = p_ptr->y + ddy[dir];
3911 x = p_ptr->x + ddx[dir];
3912 if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx)
3914 py_attack(p_ptr, y, x, 0);
3915 if (randint0(p_ptr->skill_dis) < 7)
3916 msg_print(_("うまく逃げられなかった。", "You failed to run away."));
3918 teleport_player(30, 0L);
3923 msg_print(_("その方向にはモンスターはいません。", "You don't see any monster in this direction"));
3931 * @brief 超能力者のサイコメトリー処理/ Forcibly pseudo-identify an object in the p_ptr->inventory_list (or on the floor)
3934 * currently this function allows pseudo-id of any object,
3935 * including silly ones like potions & scrolls, which always
3936 * get '{average}'. This should be changed, either to stop such
3937 * items from being pseudo-id'd, or to allow psychometry to
3938 * detect whether the unidentified potion/scroll/etc is
3939 * good (Cure Light Wounds, Restore Strength, etc) or
3940 * bad (Poison, Weakness etc) or 'useless' (Slime Mold Juice, etc).
3942 bool psychometry(void)
3946 GAME_TEXT o_name[MAX_NLEN];
3951 q = _("どのアイテムを調べますか?", "Meditate on which item? ");
3952 s = _("調べるアイテムがありません。", "You have nothing appropriate.");
3954 o_ptr = choose_object(p_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
3955 if (!o_ptr) return (FALSE);
3957 /* It is fully known, no information needed */
3958 if (object_is_known(o_ptr))
3960 msg_print(_("何も新しいことは判らなかった。", "You cannot find out anything more about that."));
3964 /* Check for a feeling */
3965 feel = value_check_aux1(o_ptr);
3967 /* Get an object description */
3968 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
3970 /* Skip non-feelings */
3973 msg_format(_("%sからは特に変わった事は感じとれなかった。", "You do not perceive anything unusual about the %s."), o_name);
3978 msg_format("%sは%sという感じがする...", o_name, game_inscriptions[feel]);
3980 msg_format("You feel that the %s %s %s...",
3981 o_name, ((o_ptr->number == 1) ? "is" : "are"), game_inscriptions[feel]);
3985 o_ptr->ident |= (IDENT_SENSE);
3986 o_ptr->feeling = feel;
3987 o_ptr->marked |= OM_TOUCHED;
3989 p_ptr->update |= (PU_COMBINE | PU_REORDER);
3990 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
3992 /* Valid "tval" codes */
3993 switch (o_ptr->tval)
4021 /* Auto-inscription/destroy */
4022 autopick_alter_item(item, (bool)(okay && destroy_feeling));
4024 /* Something happened */
4029 bool draconian_breath(player_type *creature_ptr)
4032 int Type = (one_in_(3) ? GF_COLD : GF_FIRE);
4033 concptr Type_desc = ((Type == GF_COLD) ? _("冷気", "cold") : _("炎", "fire"));
4035 if (!get_aim_dir(&dir)) return FALSE;
4037 if (randint1(100) < creature_ptr->lev)
4039 switch (creature_ptr->pclass)
4042 case CLASS_BERSERKER:
4045 case CLASS_IMITATOR:
4051 Type_desc = _("エレメント", "the elements");
4056 Type_desc = _("破片", "shards");
4060 case CLASS_WARRIOR_MAGE:
4061 case CLASS_HIGH_MAGE:
4062 case CLASS_SORCERER:
4063 case CLASS_MAGIC_EATER:
4064 case CLASS_RED_MAGE:
4065 case CLASS_BLUE_MAGE:
4066 case CLASS_MIRROR_MASTER:
4070 Type_desc = _("魔力", "mana");
4074 Type = GF_DISENCHANT;
4075 Type_desc = _("劣化", "disenchantment");
4078 case CLASS_CHAOS_WARRIOR:
4081 Type = GF_CONFUSION;
4082 Type_desc = _("混乱", "confusion");
4087 Type_desc = _("カオス", "chaos");
4092 case CLASS_FORCETRAINER:
4095 Type = GF_CONFUSION;
4096 Type_desc = _("混乱", "confusion");
4101 Type_desc = _("轟音", "sound");
4104 case CLASS_MINDCRAFTER:
4107 Type = GF_CONFUSION;
4108 Type_desc = _("混乱", "confusion");
4113 Type_desc = _("精神エネルギー", "mental energy");
4120 Type = GF_HELL_FIRE;
4121 Type_desc = _("地獄の劫火", "hellfire");
4125 Type = GF_HOLY_FIRE;
4126 Type_desc = _("聖なる炎", "holy fire");
4134 Type_desc = _("暗黒", "darkness");
4139 Type_desc = _("毒", "poison");
4146 Type_desc = _("轟音", "sound");
4150 Type = GF_CONFUSION;
4151 Type_desc = _("混乱", "confusion");
4158 msg_format(_("あなたは%sのブレスを吐いた。", "You breathe %s."), Type_desc);
4160 fire_breath(Type, dir, creature_ptr->lev * 2, (creature_ptr->lev / 15) + 1);
4164 bool android_inside_weapon(player_type *creature_ptr)
4167 if (!get_aim_dir(&dir)) return FALSE;
4168 if (creature_ptr->lev < 10)
4170 msg_print(_("レイガンを発射した。", "You fire your ray gun."));
4171 fire_bolt(GF_MISSILE, dir, (creature_ptr->lev + 1) / 2);
4173 else if (creature_ptr->lev < 25)
4175 msg_print(_("ブラスターを発射した。", "You fire your blaster."));
4176 fire_bolt(GF_MISSILE, dir, creature_ptr->lev);
4178 else if (creature_ptr->lev < 35)
4180 msg_print(_("バズーカを発射した。", "You fire your bazooka."));
4181 fire_ball(GF_MISSILE, dir, creature_ptr->lev * 2, 2);
4183 else if (creature_ptr->lev < 45)
4185 msg_print(_("ビームキャノンを発射した。", "You fire a beam cannon."));
4186 fire_beam(GF_MISSILE, dir, creature_ptr->lev * 2);
4190 msg_print(_("ロケットを発射した。", "You fire a rocket."));
4191 fire_rocket(GF_ROCKET, dir, creature_ptr->lev * 5, 2);
4196 bool create_ration(player_type *crature_ptr)
4202 /* Create the food ration */
4203 object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_RATION));
4205 /* Drop the object from heaven */
4206 (void)drop_near(q_ptr, -1, crature_ptr->y, crature_ptr->x);
4207 msg_print(_("食事を料理して作った。", "You cook some food."));
4211 void hayagake(player_type *creature_ptr)
4213 if (creature_ptr->action == ACTION_HAYAGAKE)
4215 set_action(creature_ptr, ACTION_NONE);
4219 grid_type *g_ptr = &creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x];
4220 feature_type *f_ptr = &f_info[g_ptr->feat];
4222 if (!have_flag(f_ptr->flags, FF_PROJECT) ||
4223 (!creature_ptr->levitation && have_flag(f_ptr->flags, FF_DEEP)))
4225 msg_print(_("ここでは素早く動けない。", "You cannot run in here."));
4229 set_action(creature_ptr, ACTION_HAYAGAKE);
4232 creature_ptr->energy_use = 0;
4235 bool double_attack(player_type *creature_ptr)
4240 if (!get_rep_dir(&dir, FALSE)) return FALSE;
4241 y = creature_ptr->y + ddy[dir];
4242 x = creature_ptr->x + ddx[dir];
4243 if (creature_ptr->current_floor_ptr->grid_array[y][x].m_idx)
4246 msg_print(_("あーたたたたたたたたたたたたたたたたたたたたたた!!!",
4247 "Ahhhtatatatatatatatatatatatatatataatatatatattaaaaa!!!!"));
4249 msg_print(_("無駄無駄無駄無駄無駄無駄無駄無駄無駄無駄無駄無駄!!!",
4250 "Mudamudamudamudamudamudamudamudamudamudamudamudamuda!!!!"));
4252 msg_print(_("オラオラオラオラオラオラオラオラオラオラオラオラ!!!",
4253 "Oraoraoraoraoraoraoraoraoraoraoraoraoraoraoraoraora!!!!"));
4255 py_attack(creature_ptr, y, x, 0);
4256 if (creature_ptr->current_floor_ptr->grid_array[y][x].m_idx)
4259 py_attack(creature_ptr, y, x, 0);
4261 creature_ptr->energy_need += ENERGY_NEED();
4265 msg_print(_("その方向にはモンスターはいません。", "You don't see any monster in this direction"));
4271 bool comvert_hp_to_mp(player_type *creature_ptr)
4273 int gain_sp = take_hit(p_ptr, DAMAGE_USELIFE, creature_ptr->lev, _("HPからMPへの無謀な変換", "thoughtless convertion from HP to SP"), -1) / 5;
4276 creature_ptr->csp += gain_sp;
4277 if (creature_ptr->csp > creature_ptr->msp)
4279 creature_ptr->csp = creature_ptr->msp;
4280 creature_ptr->csp_frac = 0;
4285 msg_print(_("変換に失敗した。", "You failed to convert."));
4287 creature_ptr->redraw |= (PR_HP | PR_MANA);
4291 bool comvert_mp_to_hp(player_type *creature_ptr)
4293 if (creature_ptr->csp >= creature_ptr->lev / 5)
4295 creature_ptr->csp -= creature_ptr->lev / 5;
4296 hp_player(p_ptr, creature_ptr->lev);
4300 msg_print(_("変換に失敗した。", "You failed to convert."));
4302 creature_ptr->redraw |= (PR_HP | PR_MANA);
4306 bool demonic_breath(player_type *creature_ptr)
4309 int type = (one_in_(2) ? GF_NETHER : GF_FIRE);
4310 if (!get_aim_dir(&dir)) return FALSE;
4312 msg_format(_("あなたは%sのブレスを吐いた。", "You breathe %s."), ((type == GF_NETHER) ? _("地獄", "nether") : _("火炎", "fire")));
4313 fire_breath(type, dir, creature_ptr->lev * 3, (creature_ptr->lev / 15) + 1);
4317 bool mirror_concentration(player_type *creature_ptr)
4321 msg_print(_("今はペットを操ることに集中していないと。", "You need concentration on the pets now."));
4324 if (is_mirror_grid(&p_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x]))
4326 msg_print(_("少し頭がハッキリした。", "You feel your head clear a little."));
4328 creature_ptr->csp += (5 + creature_ptr->lev * creature_ptr->lev / 100);
4329 if (creature_ptr->csp >= creature_ptr->msp)
4331 creature_ptr->csp = creature_ptr->msp;
4332 creature_ptr->csp_frac = 0;
4334 creature_ptr->redraw |= (PR_MANA);
4338 msg_print(_("鏡の上でないと集中できない!", "Here are not any mirrors!"));
4343 bool sword_dancing(player_type *creature_ptr)
4346 POSITION y = 0, x = 0;
4350 for (i = 0; i < 6; i++)
4353 y = creature_ptr->y + ddy_ddd[dir];
4354 x = creature_ptr->x + ddx_ddd[dir];
4355 g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
4357 /* Hack -- attack monsters */
4359 py_attack(p_ptr, y, x, 0);
4362 msg_print(_("攻撃が空をきった。", "You attack the empty air."));
4368 bool confusing_light(player_type *creature_ptr)
4370 msg_print(_("辺りを睨んだ...", "You glare nearby monsters..."));
4371 slow_monsters(creature_ptr->lev);
4372 stun_monsters(creature_ptr->lev * 4);
4373 confuse_monsters(creature_ptr->lev * 4);
4374 turn_monsters(creature_ptr->lev * 4);
4375 stasis_monsters(creature_ptr->lev * 4);
4379 bool rodeo(player_type *creature_ptr)
4381 GAME_TEXT m_name[MAX_NLEN];
4382 monster_type *m_ptr;
4383 monster_race *r_ptr;
4386 if (creature_ptr->riding)
4388 msg_print(_("今は乗馬中だ。", "You ARE riding."));
4391 if (!do_cmd_riding(creature_ptr, TRUE)) return TRUE;
4393 m_ptr = &p_ptr->current_floor_ptr->m_list[creature_ptr->riding];
4394 r_ptr = &r_info[m_ptr->r_idx];
4395 monster_desc(m_name, m_ptr, 0);
4396 msg_format(_("%sに乗った。", "You ride on %s."), m_name);
4398 if (is_pet(m_ptr)) return TRUE;
4400 rlev = r_ptr->level;
4402 if (r_ptr->flags1 & RF1_UNIQUE) rlev = rlev * 3 / 2;
4403 if (rlev > 60) rlev = 60 + (rlev - 60) / 2;
4404 if ((randint1(creature_ptr->skill_exp[GINOU_RIDING] / 120 + creature_ptr->lev * 2 / 3) > rlev)
4405 && one_in_(2) && !creature_ptr->inside_arena && !creature_ptr->phase_out
4406 && !(r_ptr->flags7 & (RF7_GUARDIAN)) && !(r_ptr->flags1 & (RF1_QUESTOR))
4407 && (rlev < creature_ptr->lev * 3 / 2 + randint0(creature_ptr->lev / 5)))
4409 msg_format(_("%sを手なずけた。", "You tame %s."), m_name);
4414 msg_format(_("%sに振り落とされた!", "You have thrown off by %s."), m_name);
4415 rakuba(p_ptr, 1, TRUE);
4416 /* 落馬処理に失敗してもとにかく乗馬解除 */
4417 creature_ptr->riding = 0;
4422 bool clear_mind(player_type *creature_ptr)
4426 msg_print(_("今はペットを操ることに集中していないと。", "You need concentration on the pets now."));
4429 msg_print(_("少し頭がハッキリした。", "You feel your head clear a little."));
4431 creature_ptr->csp += (3 + creature_ptr->lev / 20);
4432 if (creature_ptr->csp >= creature_ptr->msp)
4434 creature_ptr->csp = creature_ptr->msp;
4435 creature_ptr->csp_frac = 0;
4437 creature_ptr->redraw |= (PR_MANA);
4441 bool concentration(player_type *creature_ptr)
4443 int max_csp = MAX(creature_ptr->msp * 4, creature_ptr->lev * 5 + 5);
4447 msg_print(_("今はペットを操ることに集中していないと。", "You need concentration on the pets now."));
4450 if (creature_ptr->special_defense & KATA_MASK)
4452 msg_print(_("今は構えに集中している。", "You need concentration on your form."));
4455 msg_print(_("精神を集中して気合いを溜めた。", "You concentrate to charge your power."));
4457 creature_ptr->csp += creature_ptr->msp / 2;
4458 if (creature_ptr->csp >= max_csp)
4460 creature_ptr->csp = max_csp;
4461 creature_ptr->csp_frac = 0;
4463 creature_ptr->redraw |= (PR_MANA);