3 * @brief 魔法による遠隔処理の実装 / Spell projection
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.
17 #include "object-curse.h"
18 #include "player-damage.h"
21 #include "monster-status.h"
22 #include "spells-summon.h"
23 #include "monsterrace-hook.h"
27 #include "projection.h"
32 #include "player-status.h"
35 static int rakubadam_m; /*!< 振り落とされた際のダメージ量 */
36 static int rakubadam_p; /*!< 落馬した際のダメージ量 */
38 int project_length = 0; /*!< 投射の射程距離 */
42 * @brief モンスター魅了用セービングスロー共通部(汎用系)
44 * @param m_ptr 対象モンスター
45 * @return 魅了に抵抗したらTRUE
47 static bool_hack common_saving_throw_charm(player_type *player_ptr, HIT_POINT pow, monster_type *m_ptr)
49 monster_race *r_ptr = &r_info[m_ptr->r_idx];
51 if(p_ptr->inside_arena) return TRUE;
54 if (r_ptr->flagsr & RFR_RES_ALL)
56 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
60 if (r_ptr->flags3 & RF3_NO_CONF)
62 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
66 if (r_ptr->flags1 & RF1_QUESTOR || m_ptr->mflag2 & MFLAG2_NOPET) return TRUE;
68 pow += (adj_chr_chm[player_ptr->stat_ind[A_CHR]] - 1);
69 if((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL)) pow = pow * 2 / 3;
70 return (r_ptr->level > randint1((pow - 10) < 1 ? 1 : (pow - 10)) + 5);
74 * @brief モンスター服従用セービングスロー共通部(部族依存系)
76 * @param m_ptr 対象モンスター
77 * @return 服従に抵抗したらTRUE
79 static bool_hack common_saving_throw_control(player_type *player_ptr, HIT_POINT pow, monster_type *m_ptr)
81 monster_race *r_ptr = &r_info[m_ptr->r_idx];
83 if (p_ptr->inside_arena) return TRUE;
86 if (r_ptr->flagsr & RFR_RES_ALL)
88 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
92 if (r_ptr->flags1 & RF1_QUESTOR || m_ptr->mflag2 & MFLAG2_NOPET) return TRUE;
94 pow += adj_chr_chm[player_ptr->stat_ind[A_CHR]] - 1;
95 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL)) pow = pow * 2 / 3;
96 return (r_ptr->level > randint1((pow - 10) < 1 ? 1 : (pow - 10)) + 5);
100 * @brief 一部ボルト魔法のビーム化確率を算出する / Prepare standard probability to become beam for fire_bolt_or_beam()
103 * ハードコーティングによる実装が行われている。
104 * メイジは(レベル)%、ハイメイジ、スペルマスターは(レベル)%、それ以外の職業は(レベル/2)%
106 PERCENTAGE beam_chance(void)
108 if (p_ptr->pclass == CLASS_MAGE)
109 return (PERCENTAGE)(p_ptr->lev);
110 if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER)
111 return (PERCENTAGE)(p_ptr->lev + 10);
113 return (PERCENTAGE)(p_ptr->lev / 2);
118 * @brief 配置した鏡リストの次を取得する /
119 * Get another mirror. for SEEKER
120 * @param next_y 次の鏡のy座標を返す参照ポインタ
121 * @param next_x 次の鏡のx座標を返す参照ポインタ
122 * @param cury 現在の鏡のy座標
123 * @param curx 現在の鏡のx座標
125 static void next_mirror(POSITION* next_y, POSITION* next_x, POSITION cury, POSITION curx)
127 POSITION mirror_x[10], mirror_y[10]; /* 鏡はもっと少ない */
128 int mirror_num = 0; /* 鏡の数 */
132 for (x = 0; x < cur_wid; x++)
134 for (y = 0; y < cur_hgt; y++)
136 if (is_mirror_grid(&cave[y][x])) {
137 mirror_y[mirror_num] = y;
138 mirror_x[mirror_num] = x;
145 num = randint0(mirror_num);
146 *next_y = mirror_y[num];
147 *next_x = mirror_x[num];
150 *next_y = cury + randint0(5) - 2;
151 *next_x = curx + randint0(5) - 2;
156 * @brief 万色表現用にランダムな色を選択する関数 /
157 * Get a legal "multi-hued" color for drawing "spells"
161 static TERM_COLOR mh_attr(int max)
163 switch (randint1(max))
165 case 1: return (TERM_RED);
166 case 2: return (TERM_GREEN);
167 case 3: return (TERM_BLUE);
168 case 4: return (TERM_YELLOW);
169 case 5: return (TERM_ORANGE);
170 case 6: return (TERM_VIOLET);
171 case 7: return (TERM_L_RED);
172 case 8: return (TERM_L_GREEN);
173 case 9: return (TERM_L_BLUE);
174 case 10: return (TERM_UMBER);
175 case 11: return (TERM_L_UMBER);
176 case 12: return (TERM_SLATE);
177 case 13: return (TERM_WHITE);
178 case 14: return (TERM_L_WHITE);
179 case 15: return (TERM_L_DARK);
187 * @brief 魔法属性に応じたエフェクトの色を返す /
188 * Return a color to use for the bolt/ball spells
192 static TERM_COLOR spell_color(int type)
194 /* Check if A.B.'s new graphics should be used (rr9) */
195 if (streq(ANGBAND_GRAF, "new") || streq(ANGBAND_GRAF, "ne2"))
200 case GF_PSY_SPEAR: return (0x06);
201 case GF_MISSILE: return (0x0F);
202 case GF_ACID: return (0x04);
203 case GF_ELEC: return (0x02);
204 case GF_FIRE: return (0x00);
205 case GF_COLD: return (0x01);
206 case GF_POIS: return (0x03);
207 case GF_HOLY_FIRE: return (0x00);
208 case GF_HELL_FIRE: return (0x00);
209 case GF_MANA: return (0x0E);
211 case GF_SEEKER: return (0x0E);
212 case GF_SUPER_RAY: return (0x0E);
214 case GF_ARROW: return (0x0F);
215 case GF_WATER: return (0x04);
216 case GF_NETHER: return (0x07);
217 case GF_CHAOS: return (mh_attr(15));
218 case GF_DISENCHANT: return (0x05);
219 case GF_NEXUS: return (0x0C);
220 case GF_CONFUSION: return (mh_attr(4));
221 case GF_SOUND: return (0x09);
222 case GF_SHARDS: return (0x08);
223 case GF_FORCE: return (0x09);
224 case GF_INERTIAL: return (0x09);
225 case GF_GRAVITY: return (0x09);
226 case GF_TIME: return (0x09);
227 case GF_LITE_WEAK: return (0x06);
228 case GF_LITE: return (0x06);
229 case GF_DARK_WEAK: return (0x07);
230 case GF_DARK: return (0x07);
231 case GF_PLASMA: return (0x0B);
232 case GF_METEOR: return (0x00);
233 case GF_ICE: return (0x01);
234 case GF_ROCKET: return (0x0F);
235 case GF_DEATH_RAY: return (0x07);
236 case GF_NUKE: return (mh_attr(2));
237 case GF_DISINTEGRATE: return (0x05);
249 case GF_CAUSE_4: return (0x0E);
250 case GF_HAND_DOOM: return (0x07);
251 case GF_CAPTURE : return (0x0E);
252 case GF_IDENTIFY: return (0x01);
253 case GF_ATTACK: return (0x0F);
254 case GF_PHOTO : return (0x06);
257 /* Normal tiles or ASCII */
263 /* Lookup the default colors for this type */
264 concptr s = quark_str(gf_color[type]);
266 if (!s) return (TERM_WHITE);
268 /* Pick a random color */
269 c = s[randint0(strlen(s))];
271 /* Lookup this color */
272 a = my_strchr(color_char, c) - color_char;
274 /* Invalid color (note check for < 0 removed, gave a silly
275 * warning because bytes are always >= 0 -- RG) */
276 if (a > 15) return (TERM_WHITE);
282 /* Standard "color" */
288 * @brief 始点から終点にかけた方向毎にボルトのキャラクタを返す /
289 * Find the attr/char pair to use for a spell effect
298 * It is moving (or has moved) from (x,y) to (nx,ny).
299 * If the distance is not "one", we (may) return "*".
302 u16b bolt_pict(POSITION y, POSITION x, POSITION ny, POSITION nx, EFFECT_ID typ)
312 if ((ny == y) && (nx == x)) base = 0x30;
315 else if (nx == x) base = 0x40;
318 else if (ny == y) base = 0x50;
321 else if ((ny - y) == (x - nx)) base = 0x60;
324 else if ((ny - y) == (nx - x)) base = 0x70;
329 /* Basic spell color */
330 k = spell_color(typ);
332 /* Obtain attr/char */
333 a = misc_to_attr[base + k];
334 c = misc_to_char[base + k];
343 * Mega-Hack -- track "affected" monsters (see "project()" comments)
345 static int project_m_n; /*!< 魔法効果範囲内にいるモンスターの数 */
346 static POSITION project_m_x; /*!< 処理中のモンスターX座標 */
347 static POSITION project_m_y; /*!< 処理中のモンスターY座標 */
348 /* Mega-Hack -- monsters target */
349 static POSITION monster_target_x; /*!< モンスターの攻撃目標X座標 */
350 static POSITION monster_target_y; /*!< モンスターの攻撃目標Y座標 */
354 * @brief 汎用的なビーム/ボルト/ボール系による地形効果処理 / We are called from "project()" to "damage" terrain features
355 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
356 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
357 * @param y 目標Y座標 / Target y location (or location to travel "towards")
358 * @param x 目標X座標 / Target x location (or location to travel "towards")
359 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
360 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
361 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
364 * We are called both for "beam" effects and "ball" effects.
366 * The "r" parameter is the "distance from ground zero".
368 * Note that we determine if the player can "see" anything that happens
369 * by taking into account: blindness, line-of-sight, and illumination.
371 * We return "TRUE" if the effect of the projection is "obvious".
373 * We also "see" grids which are "memorized", probably a hack
375 * Perhaps we should affect doors?
378 static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ)
380 cave_type *c_ptr = &cave[y][x];
381 feature_type *f_ptr = &f_info[c_ptr->feat];
383 bool obvious = FALSE;
384 bool known = player_has_los_bold(y, x);
389 /* Reduce damage by distance */
390 dam = (dam + r) / (r + 1);
393 if (have_flag(f_ptr->flags, FF_TREE))
401 message = _("枯れた", "was blasted."); break;
403 message = _("縮んだ", "shrank."); break;
405 message = _("溶けた", "melted."); break;
408 message = _("凍り、砕け散った", "was frozen and smashed."); break;
412 message = _("燃えた", "burns up!"); break;
424 message = _("粉砕された", "was crushed."); break;
426 message = NULL; break;
430 msg_format(_("木は%s。", "A tree %s"), message);
431 cave_set_feat(y, x, one_in_(3) ? feat_brake : feat_grass);
434 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
438 /* Analyze the type */
441 /* Ignore most effects */
476 /* Destroy Traps (and Locks) */
479 /* Reveal secret doors */
480 if (is_hidden_door(c_ptr))
485 /* Check line of sight */
493 if (is_trap(c_ptr->feat))
495 /* Check line of sight */
498 msg_print(_("まばゆい閃光が走った!", "There is a bright flash of light!"));
502 /* Destroy the trap */
503 cave_alter_feat(y, x, FF_DISARM);
506 /* Locked doors are unlocked */
507 if (is_closed_door(c_ptr->feat) && f_ptr->power && have_flag(f_ptr->flags, FF_OPEN))
509 s16b old_feat = c_ptr->feat;
511 /* Unlock the door */
512 cave_alter_feat(y, x, FF_DISARM);
514 /* Check line of sound */
515 if (known && (old_feat != c_ptr->feat))
517 msg_print(_("カチッと音がした!", "Click!"));
522 /* Remove "unsafe" flag if player is not blind */
523 if (!p_ptr->blind && player_has_los_bold(y, x))
525 c_ptr->info &= ~(CAVE_UNSAFE);
533 /* Destroy Doors (and traps) */
536 /* Destroy all doors and traps */
537 if (is_trap(c_ptr->feat) || have_flag(f_ptr->flags, FF_DOOR))
539 /* Check line of sight */
542 msg_print(_("まばゆい閃光が走った!", "There is a bright flash of light!"));
546 /* Destroy the feature */
547 cave_alter_feat(y, x, FF_TUNNEL);
550 /* Remove "unsafe" flag if player is not blind */
551 if (!p_ptr->blind && player_has_los_bold(y, x))
553 c_ptr->info &= ~(CAVE_UNSAFE);
561 case GF_JAM_DOOR: /* Jams a door (as if with a spike) */
563 if (have_flag(f_ptr->flags, FF_SPIKE))
565 s16b old_mimic = c_ptr->mimic;
566 feature_type *mimic_f_ptr = &f_info[get_feat_mimic(c_ptr)];
568 cave_alter_feat(y, x, FF_SPIKE);
569 c_ptr->mimic = old_mimic;
574 /* Check line of sight */
575 if (known && have_flag(mimic_f_ptr->flags, FF_OPEN))
577 msg_format(_("%sに何かがつっかえて開かなくなった。", "The %s seems stuck."), f_name + mimic_f_ptr->name);
584 /* Destroy walls (and doors) */
587 if (have_flag(f_ptr->flags, FF_HURT_ROCK))
589 if (known && (c_ptr->info & (CAVE_MARK)))
591 msg_format(_("%sが溶けて泥になった!", "The %s turns into mud!"), f_name + f_info[get_feat_mimic(c_ptr)].name);
595 /* Destroy the wall */
596 cave_alter_feat(y, x, FF_HURT_ROCK);
598 /* Update some things */
599 p_ptr->update |= (PU_FLOW);
608 /* Require a "naked" floor grid */
609 if (!cave_naked_bold(y, x)) break;
611 /* Not on the player */
612 if (player_bold(y, x)) break;
614 /* Create a closed door */
615 cave_set_feat(y, x, feat_door[DOOR_DOOR].closed);
618 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
635 /* Require a "naked" floor grid */
636 if (!cave_naked_bold(y, x)) break;
638 /* Not on the player */
639 if (player_bold(y, x)) break;
641 /* Create a closed door */
642 cave_set_feat(y, x, feat_tree);
645 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
653 /* Require a "naked" floor grid */
654 if (!cave_naked_bold(y, x)) break;
657 c_ptr->info |= CAVE_OBJECT;
658 c_ptr->mimic = feat_glyph;
669 /* Require a "naked" floor grid */
670 if (!cave_naked_bold(y, x)) break;
672 /* Not on the player */
673 if (player_bold(y, x)) break;
676 cave_set_feat(y, x, feat_granite);
684 /* Ignore permanent grid */
685 if (have_flag(f_ptr->flags, FF_PERMANENT)) break;
690 /* Ignore grid without enough space */
691 if (!have_flag(f_ptr->flags, FF_FLOOR)) break;
693 /* Place a shallow lava */
694 cave_set_feat(y, x, feat_shallow_lava);
699 /* Place a deep lava */
700 cave_set_feat(y, x, feat_deep_lava);
707 /* Ignore permanent grid */
708 if (have_flag(f_ptr->flags, FF_PERMANENT)) break;
713 /* Ignore grid without enough space */
714 if (!have_flag(f_ptr->flags, FF_FLOOR)) break;
716 /* Place a shallow water */
717 cave_set_feat(y, x, feat_shallow_water);
722 /* Place a deep water */
723 cave_set_feat(y, x, feat_deep_water);
728 /* Lite up the grid */
732 /* Turn on the light */
733 if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS))
735 c_ptr->info |= (CAVE_GLOW);
738 update_local_illumination(y, x);
741 if (player_can_see_bold(y, x)) obvious = TRUE;
743 /* Mega-Hack -- Update the monster in the affected grid */
744 /* This allows "spear of light" (etc) to work "correctly" */
745 if (c_ptr->m_idx) update_monster(c_ptr->m_idx, FALSE);
747 if (p_ptr->special_defense & NINJA_S_STEALTH)
749 if (player_bold(y, x)) set_superstealth(FALSE);
756 /* Darken the grid */
760 bool do_dark = !p_ptr->inside_battle && !is_mirror_grid(c_ptr);
763 /* Turn off the light. */
766 if (dun_level || !is_daytime())
768 for (j = 0; j < 9; j++)
770 int by = y + ddy_ddd[j];
771 int bx = x + ddx_ddd[j];
773 if (in_bounds2(by, bx))
775 cave_type *cc_ptr = &cave[by][bx];
777 if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
788 c_ptr->info &= ~(CAVE_GLOW);
790 /* Hack -- Forget "boring" grids */
791 if (!have_flag(f_ptr->flags, FF_REMEMBER))
794 c_ptr->info &= ~(CAVE_MARK);
801 update_local_illumination(y, x);
803 if (player_can_see_bold(y, x)) obvious = TRUE;
805 /* Mega-Hack -- Update the monster in the affected grid */
806 /* This allows "spear of light" (etc) to work "correctly" */
807 if (c_ptr->m_idx) update_monster(c_ptr->m_idx, FALSE);
817 if (is_mirror_grid(c_ptr))
819 msg_print(_("鏡が割れた!", "The mirror was crashed!"));
822 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
825 if (have_flag(f_ptr->flags, FF_GLASS) && !have_flag(f_ptr->flags, FF_PERMANENT) && (dam >= 50))
827 if (known && (c_ptr->info & CAVE_MARK))
829 msg_format(_("%sが割れた!", "The %s was crashed!"), f_name + f_info[get_feat_mimic(c_ptr)].name);
833 /* Destroy the wall */
834 cave_alter_feat(y, x, FF_HURT_ROCK);
836 /* Update some things */
837 p_ptr->update |= (PU_FLOW);
844 if (is_mirror_grid(c_ptr) && p_ptr->lev < 40)
846 msg_print(_("鏡が割れた!", "The mirror was crashed!"));
849 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
852 if (have_flag(f_ptr->flags, FF_GLASS) && !have_flag(f_ptr->flags, FF_PERMANENT) && (dam >= 200))
854 if (known && (c_ptr->info & CAVE_MARK))
856 msg_format(_("%sが割れた!", "The %s was crashed!"), f_name + f_info[get_feat_mimic(c_ptr)].name);
860 /* Destroy the wall */
861 cave_alter_feat(y, x, FF_HURT_ROCK);
863 /* Update some things */
864 p_ptr->update |= (PU_FLOW);
869 case GF_DISINTEGRATE:
871 /* Destroy mirror/glyph */
872 if (is_mirror_grid(c_ptr) || is_glyph_grid(c_ptr) || is_explosive_rune_grid(c_ptr))
875 /* Permanent features don't get effect */
876 /* But not protect monsters and other objects */
877 if (have_flag(f_ptr->flags, FF_HURT_DISI) && !have_flag(f_ptr->flags, FF_PERMANENT))
879 cave_alter_feat(y, x, FF_HURT_DISI);
881 /* Update some things -- similar to GF_KILL_WALL */
882 p_ptr->update |= (PU_FLOW);
889 /* Return "Anything seen?" */
896 * @brief 汎用的なビーム/ボルト/ボール系によるアイテムオブジェクトへの効果処理 / Handle a beam/bolt/ball causing damage to a monster.
897 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
898 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
899 * @param y 目標Y座標 / Target y location (or location to travel "towards")
900 * @param x 目標X座標 / Target x location (or location to travel "towards")
901 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
902 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
903 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
906 * We are called from "project()" to "damage" objects
908 * We are called both for "beam" effects and "ball" effects.
910 * Perhaps we should only SOMETIMES damage things on the ground.
912 * The "r" parameter is the "distance from ground zero".
914 * Note that we determine if the player can "see" anything that happens
915 * by taking into account: blindness, line-of-sight, and illumination.
917 * We also "see" grids which are "memorized", probably a hack
919 * We return "TRUE" if the effect of the projection is "obvious".
922 static bool project_o(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ)
924 cave_type *c_ptr = &cave[y][x];
926 OBJECT_IDX this_o_idx, next_o_idx = 0;
928 bool obvious = FALSE;
929 bool known = player_has_los_bold(y, x);
931 BIT_FLAGS flgs[TR_FLAG_SIZE];
933 GAME_TEXT o_name[MAX_NLEN];
935 KIND_OBJECT_IDX k_idx = 0;
936 bool is_potion = FALSE;
941 /* Reduce damage by distance */
942 dam = (dam + r) / (r + 1);
945 /* Scan all objects in the grid */
946 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
948 object_type *o_ptr = &o_list[this_o_idx];
952 bool do_kill = FALSE;
954 concptr note_kill = NULL;
957 /* Get the "plural"-ness */
958 bool plural = (o_ptr->number > 1);
961 /* Acquire next object */
962 next_o_idx = o_ptr->next_o_idx;
963 object_flags(o_ptr, flgs);
965 /* Check for artifact */
966 if (object_is_artifact(o_ptr)) is_art = TRUE;
968 /* Analyze the type */
971 /* Acid -- Lots of things */
974 if (hates_acid(o_ptr))
977 note_kill = _("融けてしまった!", (plural ? " melt!" : " melts!"));
978 if (have_flag(flgs, TR_IGNORE_ACID)) ignore = TRUE;
983 /* Elec -- Rings and Wands */
986 if (hates_elec(o_ptr))
989 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
990 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
995 /* Fire -- Flammable objects */
998 if (hates_fire(o_ptr))
1001 note_kill = _("燃えてしまった!", (plural ? " burn up!" : " burns up!"));
1002 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1007 /* Cold -- potions and flasks */
1010 if (hates_cold(o_ptr))
1012 note_kill = _("砕け散ってしまった!", (plural ? " shatter!" : " shatters!"));
1014 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1022 if (hates_fire(o_ptr))
1025 note_kill = _("燃えてしまった!", (plural ? " burn up!" : " burns up!"));
1026 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1028 if (hates_elec(o_ptr))
1032 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
1033 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1041 if (hates_fire(o_ptr))
1044 note_kill = _("燃えてしまった!", (plural ? " burn up!" : " burns up!"));
1045 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1047 if (hates_cold(o_ptr))
1051 note_kill = _("砕け散ってしまった!", (plural ? " shatter!" : " shatters!"));
1052 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1057 /* Hack -- break potions and such */
1063 if (hates_cold(o_ptr))
1065 note_kill = _("砕け散ってしまった!", (plural ? " shatter!" : " shatters!"));
1071 /* Mana and Chaos -- destroy everything */
1077 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
1081 case GF_DISINTEGRATE:
1084 note_kill = _("蒸発してしまった!", (plural ? " evaporate!" : " evaporates!"));
1091 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
1092 if (have_flag(flgs, TR_RES_CHAOS)) ignore = TRUE;
1093 else if ((o_ptr->tval == TV_SCROLL) && (o_ptr->sval == SV_SCROLL_CHAOS)) ignore = TRUE;
1097 /* Holy Fire and Hell Fire -- destroys cursed non-artifacts */
1101 if (object_is_cursed(o_ptr))
1104 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
1111 identify_item(o_ptr);
1113 /* Auto-inscription */
1114 autopick_alter_item((-this_o_idx), FALSE);
1122 /* Chests are noticed only if trapped or locked */
1123 if (o_ptr->tval == TV_CHEST)
1125 /* Disarm/Unlock traps */
1126 if (o_ptr->pval > 0)
1128 /* Disarm or Unlock */
1129 o_ptr->pval = (0 - o_ptr->pval);
1132 object_known(o_ptr);
1134 if (known && (o_ptr->marked & OM_FOUND))
1136 msg_print(_("カチッと音がした!", "Click!"));
1146 if (o_ptr->tval == TV_CORPSE)
1149 BIT_FLAGS mode = 0L;
1151 if (!who || is_pet(&m_list[who]))
1152 mode |= PM_FORCE_PET;
1154 for (i = 0; i < o_ptr->number ; i++)
1156 if (((o_ptr->sval == SV_CORPSE) && (randint1(100) > 80)) ||
1157 ((o_ptr->sval == SV_SKELETON) && (randint1(100) > 60)))
1161 note_kill = _("灰になった。", (plural ? " become dust." : " becomes dust."));
1165 else if (summon_named_creature(who, y, x, o_ptr->pval, mode))
1167 note_kill = _("生き返った。", " revived.");
1169 else if (!note_kill)
1171 note_kill = _("灰になった。", (plural ? " become dust." : " becomes dust."));
1182 /* Attempt to destroy the object */
1185 /* Effect "observed" */
1186 if (known && (o_ptr->marked & OM_FOUND))
1189 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
1192 /* Artifacts, and other objects, get to resist */
1193 if (is_art || ignore)
1195 /* Observe the resist */
1196 if (known && (o_ptr->marked & OM_FOUND))
1198 msg_format(_("%sは影響を受けない!",
1199 (plural ? "The %s are unaffected!" : "The %s is unaffected!")), o_name);
1206 /* Describe if needed */
1207 if (known && (o_ptr->marked & OM_FOUND) && note_kill)
1209 msg_format(_("%sは%s", "The %s%s"), o_name, note_kill);
1212 k_idx = o_ptr->k_idx;
1213 is_potion = object_is_potion(o_ptr);
1214 delete_object_idx(this_o_idx);
1216 /* Potions produce effects when 'shattered' */
1219 (void)potion_smash_effect(who, y, x, k_idx);
1227 /* Return "Anything seen?" */
1233 * @brief 汎用的なビーム/ボルト/ボール系によるモンスターへの効果処理 / Handle a beam/bolt/ball causing damage to a monster.
1234 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
1235 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
1236 * @param y 目標Y座標 / Target y location (or location to travel "towards")
1237 * @param x 目標X座標 / Target x location (or location to travel "towards")
1238 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
1239 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
1241 * @param see_s_msg TRUEならばメッセージを表示する
1242 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
1245 * This routine takes a "source monster" (by index) which is mostly used to
1246 * determine if the player is causing the damage, and a "radius" (see below),
1247 * which is used to decrease the power of explosions with distance, and a
1248 * location, via integers which are modified by certain types of attacks
1249 * (polymorph and teleport being the obvious ones), a default damage, which
1250 * is modified as needed based on various properties, and finally a "damage
1251 * type" (see below).
1254 * Note that this routine can handle "no damage" attacks (like teleport) by
1255 * taking a "zero" damage, and can even take "parameters" to attacks (like
1256 * confuse) by accepting a "damage", using it to calculate the effect, and
1257 * then setting the damage to zero. Note that the "damage" parameter is
1258 * divided by the radius, so monsters not at the "epicenter" will not take
1259 * as much damage (or whatever)...
1262 * Note that "polymorph" is dangerous, since a failure in "place_monster()"'
1263 * may result in a dereference of an invalid pointer.
1266 * Various messages are produced, and damage is applied.
1269 * Just "casting" a substance (i.e. plasma) does not make you immune, you must
1270 * actually be "made" of that substance, or "breathe" big balls of it.
1271 * We assume that "Plasma" monsters, and "Plasma" breathers, are immune
1273 * We assume "Nether" is an evil, necromantic force, so it doesn't hurt undead,
1274 * and hurts evil less. If can breath nether, then it resists it as well.
1277 * Damage reductions use the following formulas:
1278 * Note that "dam = dam * 6 / (randint1(6) + 6);"
1279 * gives avg damage of .655, ranging from .858 to .500
1280 * Note that "dam = dam * 5 / (randint1(6) + 6);"
1281 * gives avg damage of .544, ranging from .714 to .417
1282 * Note that "dam = dam * 4 / (randint1(6) + 6);"
1283 * gives avg damage of .444, ranging from .556 to .333
1284 * Note that "dam = dam * 3 / (randint1(6) + 6);"
1285 * gives avg damage of .327, ranging from .427 to .250
1286 * Note that "dam = dam * 2 / (randint1(6) + 6);"
1287 * gives something simple.
1290 * In this function, "result" messages are postponed until the end, where
1291 * the "note" string is appended to the monster name, if not NULL. So,
1292 * to make a spell have "no effect" just set "note" to NULL. You should
1293 * also set "notice" to FALSE, or the player will learn what the spell does.
1296 * We attempt to return "TRUE" if the player saw anything "useful" happen.
1300 static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ, BIT_FLAGS flg, bool see_s_msg)
1304 cave_type *c_ptr = &cave[y][x];
1306 monster_type *m_ptr = &m_list[c_ptr->m_idx];
1307 monster_type *caster_ptr = (who > 0) ? &m_list[who] : NULL;
1309 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1313 /* Is the monster "seen"? */
1314 bool seen = m_ptr->ml;
1315 bool seen_msg = is_seen(m_ptr);
1317 bool slept = (bool)MON_CSLEEP(m_ptr);
1319 /* Were the effects "obvious" (if seen)? */
1320 bool obvious = FALSE;
1322 /* Can the player know about this effect? */
1323 bool known = ((m_ptr->cdis <= MAX_SIGHT) || p_ptr->inside_battle);
1325 /* Were the effects "irrelevant"? */
1326 bool skipped = FALSE;
1328 /* Gets the monster angry at the source of the effect? */
1329 bool get_angry = FALSE;
1331 /* Polymorph setting (true or false) */
1332 bool do_poly = FALSE;
1334 /* Teleport setting (max distance) */
1337 /* Confusion setting (amount to confuse) */
1340 /* Stunning setting (amount to stun) */
1343 /* Sleep amount (amount to sleep) */
1346 /* Fear amount (amount to fear) */
1349 /* Time amount (amount to time) */
1352 bool heal_leper = FALSE;
1354 /* Hold the monster name */
1355 GAME_TEXT m_name[MAX_NLEN];
1358 PARAMETER_VALUE photo = 0;
1360 /* Assume no note */
1361 concptr note = NULL;
1363 /* Assume a default death */
1364 concptr note_dies = extract_note_dies(real_r_idx(m_ptr));
1366 POSITION ty = m_ptr->fy;
1367 POSITION tx = m_ptr->fx;
1369 DEPTH caster_lev = (who > 0) ? r_info[caster_ptr->r_idx].level : (p_ptr->lev * 2);
1372 if (!c_ptr->m_idx) return (FALSE);
1374 /* Never affect projector */
1375 if (who && (c_ptr->m_idx == who)) return (FALSE);
1376 if ((c_ptr->m_idx == p_ptr->riding) && !who && !(typ == GF_OLD_HEAL) && !(typ == GF_OLD_SPEED) && !(typ == GF_STAR_HEAL)) return (FALSE);
1377 if (sukekaku && ((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) return FALSE;
1379 /* Don't affect already death monsters */
1380 /* Prevents problems with chain reactions of exploding monsters */
1381 if (m_ptr->hp < 0) return (FALSE);
1383 /* Reduce damage by distance */
1384 dam = (dam + r) / (r + 1);
1387 /* Get the monster name (BEFORE polymorphing) */
1388 monster_desc(m_name, m_ptr, 0);
1390 /* Get the monster possessive ("his"/"her"/"its") */
1391 monster_desc(m_poss, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE);
1393 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) disturb(TRUE, TRUE);
1395 /* Analyze the damage type */
1398 /* Magic Missile -- pure damage */
1401 if (seen) obvious = TRUE;
1403 if (r_ptr->flagsr & RFR_RES_ALL)
1405 note = _("には完全な耐性がある!", " is immune.");
1407 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1416 if (seen) obvious = TRUE;
1418 if (r_ptr->flagsr & RFR_RES_ALL)
1420 note = _("には完全な耐性がある!", " is immune.");
1422 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1425 if (r_ptr->flagsr & RFR_IM_ACID)
1427 note = _("にはかなり耐性がある!", " resists a lot.");
1429 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ACID);
1437 if (seen) obvious = TRUE;
1439 if (r_ptr->flagsr & RFR_RES_ALL)
1441 note = _("には完全な耐性がある!", " is immune.");
1443 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1446 if (r_ptr->flagsr & RFR_IM_ELEC)
1448 note = _("にはかなり耐性がある!", " resists a lot.");
1450 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ELEC);
1458 if (seen) obvious = TRUE;
1460 if (r_ptr->flagsr & RFR_RES_ALL)
1462 note = _("には完全な耐性がある!", " is immune.");
1464 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1467 if (r_ptr->flagsr & RFR_IM_FIRE)
1469 note = _("にはかなり耐性がある!", " resists a lot.");
1471 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_FIRE);
1473 else if (r_ptr->flags3 & (RF3_HURT_FIRE))
1475 note = _("はひどい痛手をうけた。", " is hit hard.");
1477 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_FIRE);
1485 if (seen) obvious = TRUE;
1487 if (r_ptr->flagsr & RFR_RES_ALL)
1489 note = _("には完全な耐性がある!", " is immune.");
1491 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1494 if (r_ptr->flagsr & RFR_IM_COLD)
1496 note = _("にはかなり耐性がある!", " resists a lot.");
1498 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
1500 else if (r_ptr->flags3 & (RF3_HURT_COLD))
1502 note = _("はひどい痛手をうけた。", " is hit hard.");
1504 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
1512 if (seen) obvious = TRUE;
1514 if (r_ptr->flagsr & RFR_RES_ALL)
1516 note = _("には完全な耐性がある!", " is immune.");
1518 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1521 if (r_ptr->flagsr & RFR_IM_POIS)
1523 note = _("にはかなり耐性がある!", " resists a lot.");
1525 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1533 if (seen) obvious = TRUE;
1535 if (r_ptr->flagsr & RFR_RES_ALL)
1537 note = _("には完全な耐性がある!", " is immune.");
1539 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1542 if (r_ptr->flagsr & RFR_IM_POIS)
1544 note = _("には耐性がある。", " resists.");
1545 dam *= 3; dam /= randint1(6) + 6;
1546 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1548 else if (one_in_(3)) do_poly = TRUE;
1552 /* Hellfire -- hurts Evil */
1555 if (seen) obvious = TRUE;
1557 if (r_ptr->flagsr & RFR_RES_ALL)
1559 note = _("には完全な耐性がある!", " is immune.");
1561 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1564 if (r_ptr->flags3 & RF3_GOOD)
1566 note = _("はひどい痛手をうけた。", " is hit hard.");
1568 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
1573 /* Holy Fire -- hurts Evil, Good are immune, others _resist_ */
1576 if (seen) obvious = TRUE;
1578 if (r_ptr->flagsr & RFR_RES_ALL)
1580 note = _("には完全な耐性がある!", " is immune.");
1582 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1585 if (r_ptr->flags3 & RF3_GOOD)
1587 note = _("には完全な耐性がある!", " is immune.");
1589 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_GOOD;
1591 else if (r_ptr->flags3 & RF3_EVIL)
1594 note = _("はひどい痛手をうけた。", " is hit hard.");
1595 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_EVIL;
1599 note = _("には耐性がある。", " resists.");
1600 dam *= 3; dam /= randint1(6) + 6;
1605 /* Arrow -- XXX no defense */
1608 if (seen) obvious = TRUE;
1610 if (r_ptr->flagsr & RFR_RES_ALL)
1612 note = _("には完全な耐性がある!", " is immune.");
1614 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1620 /* Plasma -- XXX perhaps check ELEC or FIRE */
1623 if (seen) obvious = TRUE;
1625 if (r_ptr->flagsr & RFR_RES_ALL)
1627 note = _("には完全な耐性がある!", " is immune.");
1629 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1632 if (r_ptr->flagsr & RFR_RES_PLAS)
1634 note = _("には耐性がある。", " resists.");
1635 dam *= 3; dam /= randint1(6) + 6;
1636 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_PLAS);
1641 /* Nether -- see above */
1644 if (seen) obvious = TRUE;
1646 if (r_ptr->flagsr & RFR_RES_ALL)
1648 note = _("には完全な耐性がある!", " is immune.");
1650 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1653 if (r_ptr->flagsr & RFR_RES_NETH)
1655 if (r_ptr->flags3 & RF3_UNDEAD)
1657 note = _("には完全な耐性がある!", " is immune.");
1659 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
1663 note = _("には耐性がある。", " resists.");
1664 dam *= 3; dam /= randint1(6) + 6;
1666 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NETH);
1668 else if (r_ptr->flags3 & RF3_EVIL)
1670 note = _("はいくらか耐性を示した。", " resists somewhat.");
1672 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
1677 /* Water (acid) damage -- Water spirits/elementals are immune */
1680 if (seen) obvious = TRUE;
1682 if (r_ptr->flagsr & RFR_RES_ALL)
1684 note = _("には完全な耐性がある!", " is immune.");
1686 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1689 if (r_ptr->flagsr & RFR_RES_WATE)
1691 if ((m_ptr->r_idx == MON_WATER_ELEM) || (m_ptr->r_idx == MON_UNMAKER))
1693 note = _("には完全な耐性がある!", " is immune.");
1698 note = _("には耐性がある。", " resists.");
1699 dam *= 3; dam /= randint1(6) + 6;
1701 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WATE);
1706 /* Chaos -- Chaos breathers resist */
1709 if (seen) obvious = TRUE;
1711 if (r_ptr->flagsr & RFR_RES_ALL)
1713 note = _("には完全な耐性がある!", " is immune.");
1715 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1718 if (r_ptr->flagsr & RFR_RES_CHAO)
1720 note = _("には耐性がある。", " resists.");
1721 dam *= 3; dam /= randint1(6) + 6;
1722 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_CHAO);
1724 else if ((r_ptr->flags3 & RF3_DEMON) && one_in_(3))
1726 note = _("はいくらか耐性を示した。", " resists somewhat.");
1727 dam *= 3; dam /= randint1(6) + 6;
1728 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
1733 do_conf = (5 + randint1(11) + r) / (r + 1);
1738 /* Shards -- Shard breathers resist */
1741 if (seen) obvious = TRUE;
1743 if (r_ptr->flagsr & RFR_RES_ALL)
1745 note = _("には完全な耐性がある!", " is immune.");
1747 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1750 if (r_ptr->flagsr & RFR_RES_SHAR)
1752 note = _("には耐性がある。", " resists.");
1753 dam *= 3; dam /= randint1(6) + 6;
1754 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
1759 /* Rocket: Shard resistance helps */
1762 if (seen) obvious = TRUE;
1764 if (r_ptr->flagsr & RFR_RES_ALL)
1766 note = _("には完全な耐性がある!", " is immune.");
1768 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1771 if (r_ptr->flagsr & RFR_RES_SHAR)
1773 note = _("はいくらか耐性を示した。", " resists somewhat.");
1775 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
1781 /* Sound -- Sound breathers resist */
1784 if (seen) obvious = TRUE;
1786 if (r_ptr->flagsr & RFR_RES_ALL)
1788 note = _("には完全な耐性がある!", " is immune.");
1790 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1793 if (r_ptr->flagsr & RFR_RES_SOUN)
1795 note = _("には耐性がある。", " resists.");
1796 dam *= 2; dam /= randint1(6) + 6;
1797 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SOUN);
1799 else do_stun = (10 + randint1(15) + r) / (r + 1);
1806 if (seen) obvious = TRUE;
1808 if (r_ptr->flagsr & RFR_RES_ALL)
1810 note = _("には完全な耐性がある!", " is immune.");
1812 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1815 if (r_ptr->flags3 & RF3_NO_CONF)
1817 note = _("には耐性がある。", " resists.");
1818 dam *= 3; dam /= randint1(6) + 6;
1819 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
1821 else do_conf = (10 + randint1(15) + r) / (r + 1);
1825 /* Disenchantment -- Breathers and Disenchanters resist */
1828 if (seen) obvious = TRUE;
1830 if (r_ptr->flagsr & RFR_RES_ALL)
1832 note = _("には完全な耐性がある!", " is immune.");
1834 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1837 if (r_ptr->flagsr & RFR_RES_DISE)
1839 note = _("には耐性がある。", " resists.");
1840 dam *= 3; dam /= randint1(6) + 6;
1841 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DISE);
1846 /* Nexus -- Breathers and Existers resist */
1849 if (seen) obvious = TRUE;
1851 if (r_ptr->flagsr & RFR_RES_ALL)
1853 note = _("には完全な耐性がある!", " is immune.");
1855 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1858 if (r_ptr->flagsr & RFR_RES_NEXU)
1860 note = _("には耐性がある。", " resists.");
1861 dam *= 3; dam /= randint1(6) + 6;
1862 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NEXU);
1870 if (seen) obvious = TRUE;
1872 if (r_ptr->flagsr & RFR_RES_ALL)
1874 note = _("には完全な耐性がある!", " is immune.");
1876 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1879 if (r_ptr->flagsr & RFR_RES_WALL)
1881 note = _("には耐性がある。", " resists.");
1882 dam *= 3; dam /= randint1(6) + 6;
1883 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WALL);
1885 else do_stun = (randint1(15) + r) / (r + 1);
1889 /* Inertia -- breathers resist */
1892 if (seen) obvious = TRUE;
1894 if (r_ptr->flagsr & RFR_RES_ALL)
1896 note = _("には完全な耐性がある!", " is immune.");
1898 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1901 if (r_ptr->flagsr & RFR_RES_INER)
1903 note = _("には耐性がある。", " resists.");
1904 dam *= 3; dam /= randint1(6) + 6;
1905 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_INER);
1909 /* Powerful monsters can resist */
1910 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
1911 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1915 /* Normal monsters slow down */
1918 if (set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 50))
1920 note = _("の動きが遅くなった。", " starts moving slower.");
1927 /* Time -- breathers resist */
1930 if (seen) obvious = TRUE;
1932 if (r_ptr->flagsr & RFR_RES_ALL)
1934 note = _("には完全な耐性がある!", " is immune.");
1936 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1939 if (r_ptr->flagsr & RFR_RES_TIME)
1941 note = _("には耐性がある。", " resists.");
1942 dam *= 3; dam /= randint1(6) + 6;
1943 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_TIME);
1945 else do_time = (dam + 1) / 2;
1949 /* Gravity -- breathers resist */
1952 bool resist_tele = FALSE;
1954 if (seen) obvious = TRUE;
1956 if (r_ptr->flagsr & RFR_RES_ALL)
1958 note = _("には完全な耐性がある!", " is immune.");
1960 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1963 if (r_ptr->flagsr & RFR_RES_TELE)
1965 if (r_ptr->flags1 & (RF1_UNIQUE))
1967 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
1968 note = _("には効果がなかった。", " is unaffected!");
1971 else if (r_ptr->level > randint1(100))
1973 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
1974 note = _("には耐性がある!", " resists!");
1979 if (!resist_tele) do_dist = 10;
1981 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
1983 if (r_ptr->flagsr & RFR_RES_GRAV)
1985 note = _("には耐性がある!", " resists!");
1986 dam *= 3; dam /= randint1(6) + 6;
1988 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_GRAV);
1993 /* Powerful monsters can resist */
1994 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
1995 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1999 /* Normal monsters slow down */
2002 if (set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 50))
2004 note = _("の動きが遅くなった。", " starts moving slower.");
2009 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
2011 /* Attempt a saving throw */
2012 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2013 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2017 /* No obvious effect */
2018 note = _("には効果がなかった。", " is unaffected!");
2030 if (seen) obvious = TRUE;
2032 if (r_ptr->flagsr & RFR_RES_ALL)
2034 note = _("には完全な耐性がある!", " is immune.");
2036 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2044 case GF_DISINTEGRATE:
2046 if (seen) obvious = TRUE;
2048 if (r_ptr->flagsr & RFR_RES_ALL)
2050 note = _("には完全な耐性がある!", " is immune.");
2052 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2055 if (r_ptr->flags3 & RF3_HURT_ROCK)
2057 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
2058 note = _("の皮膚がただれた!", " loses some skin!");
2059 note_dies = _("は蒸発した!", " evaporates!");
2067 if (seen) obvious = TRUE;
2069 /* PSI only works if the monster can see you! -- RG */
2070 if (!(los(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x)))
2073 msg_format(_("%sはあなたが見えないので影響されない!", "%^s can't see you, and isn't affected!"), m_name);
2078 if (r_ptr->flagsr & RFR_RES_ALL)
2080 note = _("には完全な耐性がある!", " is immune.");
2082 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2085 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2088 note = _("には完全な耐性がある!", " is immune.");
2089 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
2092 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2093 (r_ptr->flags3 & RF3_ANIMAL) ||
2094 (r_ptr->level > randint1(3 * dam)))
2096 note = _("には耐性がある!", " resists!");
2100 * Powerful demons & undead can turn a mindcrafter's
2101 * attacks back on them
2103 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2104 (r_ptr->level > p_ptr->lev / 2) &&
2108 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
2109 (seen ? "%^s's corrupted mind backlashes your attack!" :
2110 "%^ss corrupted mind backlashes your attack!")), m_name);
2113 if ((randint0(100 + r_ptr->level / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
2115 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
2119 /* Injure +/- confusion */
2120 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
2121 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2122 if (one_in_(4) && !CHECK_MULTISHADOW())
2124 switch (randint1(4))
2127 set_confused(p_ptr->confused + 3 + randint1(dam));
2130 set_stun(p_ptr->stun + randint1(dam));
2134 if (r_ptr->flags3 & RF3_NO_FEAR)
2135 note = _("には効果がなかった。", " is unaffected.");
2137 set_afraid(p_ptr->afraid + 3 + randint1(dam));
2141 if (!p_ptr->free_act)
2142 (void)set_paralyzed(p_ptr->paralyzed + randint1(dam));
2151 if ((dam > 0) && one_in_(4))
2153 switch (randint1(4))
2156 do_conf = 3 + randint1(dam);
2159 do_stun = 3 + randint1(dam);
2162 do_fear = 3 + randint1(dam);
2165 note = _("は眠り込んでしまった!", " falls asleep!");
2166 do_sleep = 3 + randint1(dam);
2171 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
2177 if (seen) obvious = TRUE;
2179 if (r_ptr->flagsr & RFR_RES_ALL)
2181 note = _("には完全な耐性がある!", " is immune.");
2183 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2186 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2189 note = _("には完全な耐性がある!", " is immune.");
2191 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2192 (r_ptr->flags3 & RF3_ANIMAL) ||
2193 (r_ptr->level > randint1(3 * dam)))
2195 note = _("には耐性がある!", " resists!");
2199 * Powerful demons & undead can turn a mindcrafter's
2200 * attacks back on them
2202 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2203 (r_ptr->level > p_ptr->lev / 2) &&
2207 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
2208 (seen ? "%^s's corrupted mind backlashes your attack!" :
2209 "%^ss corrupted mind backlashes your attack!")), m_name);
2211 if ((randint0(100 + r_ptr->level / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
2213 msg_print(_("あなたは効力を跳ね返した!", "You resist the effects!"));
2217 /* Injure + mana drain */
2218 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
2219 if (!CHECK_MULTISHADOW())
2221 msg_print(_("超能力パワーを吸いとられた!", "Your psychic energy is drained!"));
2222 p_ptr->csp -= damroll(5, dam) / 2;
2223 if (p_ptr->csp < 0) p_ptr->csp = 0;
2224 p_ptr->redraw |= PR_MANA;
2225 p_ptr->window |= (PW_SPELL);
2227 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2234 int b = damroll(5, dam) / 4;
2235 concptr str = (p_ptr->pclass == CLASS_MINDCRAFTER) ? _("超能力パワー", "psychic energy") : _("魔力", "mana");
2236 concptr msg = _("あなたは%sの苦痛を%sに変換した!",
2237 (seen ? "You convert %s's pain into %s!" :
2238 "You convert %ss pain into %s!"));
2239 msg_format(msg, m_name, str);
2241 b = MIN(p_ptr->msp, p_ptr->csp + b);
2243 p_ptr->redraw |= PR_MANA;
2244 p_ptr->window |= (PW_SPELL);
2246 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
2250 case GF_TELEKINESIS:
2252 if (seen) obvious = TRUE;
2254 if (r_ptr->flagsr & RFR_RES_ALL)
2256 note = _("には完全な耐性がある!", " is immune.");
2258 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2263 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
2268 do_stun = damroll((caster_lev / 20) + 3 , dam) + 1;
2270 /* Attempt a saving throw */
2271 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2272 (r_ptr->level > 5 + randint1(dam)))
2276 /* No obvious effect */
2282 /* Psycho-spear -- powerful magic missile */
2285 if (seen) obvious = TRUE;
2287 if (r_ptr->flagsr & RFR_RES_ALL)
2289 note = _("には完全な耐性がある!", " is immune.");
2291 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2297 /* Meteor -- powerful magic missile */
2300 if (seen) obvious = TRUE;
2302 if (r_ptr->flagsr & RFR_RES_ALL)
2304 note = _("には完全な耐性がある!", " is immune.");
2306 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2314 if (!is_hostile(m_ptr)) break;
2316 if (seen) obvious = TRUE;
2318 if (r_ptr->flagsr & RFR_RES_ALL)
2320 note = _("には効果がなかった!", " is immune.");
2322 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2325 /* Attempt a saving throw */
2326 if ((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) ||
2327 (r_ptr->flags3 & RF3_NO_CONF) ||
2328 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2330 /* Memorize a flag */
2331 if (r_ptr->flags3 & RF3_NO_CONF)
2333 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
2340 * Powerful demons & undead can turn a mindcrafter's
2341 * attacks back on them
2343 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2344 (r_ptr->level > p_ptr->lev / 2) &&
2348 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
2349 (seen ? "%^s's corrupted mind backlashes your attack!" :
2350 "%^ss corrupted mind backlashes your attack!")), m_name);
2353 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2355 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
2359 /* Confuse, stun, terrify */
2360 switch (randint1(4))
2363 set_stun(p_ptr->stun + dam / 2);
2366 set_confused(p_ptr->confused + dam / 2);
2370 if (r_ptr->flags3 & RF3_NO_FEAR)
2371 note = _("には効果がなかった。", " is unaffected.");
2373 set_afraid(p_ptr->afraid + dam);
2380 /* No obvious effect */
2381 note = _("には効果がなかった。", " is unaffected.");
2387 if (!common_saving_throw_charm(p_ptr, dam, m_ptr))
2389 note = _("があなたに隷属した。", " is in your thrall!");
2394 switch (randint1(4))
2408 /* No "real" damage */
2415 /* Ice -- Cold + Cuts + Stun */
2418 if (seen) obvious = TRUE;
2420 if (r_ptr->flagsr & RFR_RES_ALL)
2422 note = _("には完全な耐性がある!", " is immune.");
2424 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2427 do_stun = (randint1(15) + 1) / (r + 1);
2428 if (r_ptr->flagsr & RFR_IM_COLD)
2430 note = _("にはかなり耐性がある!", " resists a lot.");
2432 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
2434 else if (r_ptr->flags3 & (RF3_HURT_COLD))
2436 note = _("はひどい痛手をうけた。", " is hit hard.");
2438 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
2445 case GF_HYPODYNAMIA:
2447 if (seen) obvious = TRUE;
2449 if (r_ptr->flagsr & RFR_RES_ALL)
2451 note = _("には完全な耐性がある!", " is immune.");
2453 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2456 if (!monster_living(m_ptr->r_idx))
2458 if (is_original_ap_and_seen(m_ptr))
2460 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
2461 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
2462 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
2464 note = _("には効果がなかった。", " is unaffected.");
2468 else do_time = (dam+7)/8;
2476 if (seen) obvious = TRUE;
2478 if (r_ptr->flagsr & RFR_RES_ALL)
2480 note = _("には完全な耐性がある!", " is immune.");
2482 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2485 if (!monster_living(m_ptr->r_idx))
2487 if (is_original_ap_and_seen(m_ptr))
2489 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
2490 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
2491 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
2493 note = _("には完全な耐性がある!", " is immune.");
2497 else if (((r_ptr->flags1 & RF1_UNIQUE) &&
2498 (randint1(888) != 666)) ||
2499 (((r_ptr->level + randint1(20)) > randint1((caster_lev / 2) + randint1(10))) &&
2500 randint1(100) != 66))
2502 note = _("には耐性がある!", " resists!");
2510 /* Polymorph monster (Use "dam" as "power") */
2513 if (seen) obvious = TRUE;
2515 if (r_ptr->flagsr & RFR_RES_ALL)
2517 note = _("には効果がなかった。", " is unaffected.");
2519 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2522 /* Attempt to polymorph (see below) */
2525 /* Powerful monsters can resist */
2526 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2527 (r_ptr->flags1 & RF1_QUESTOR) ||
2528 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2530 note = _("には効果がなかった。", " is unaffected.");
2535 /* No "real" damage */
2542 /* Clone monsters (Ignore "dam") */
2545 if (seen) obvious = TRUE;
2547 if ((p_ptr->inside_arena) || is_pet(m_ptr) || (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_NAZGUL | RF7_UNIQUE2)))
2549 note = _("には効果がなかった。", " is unaffected.");
2554 m_ptr->hp = m_ptr->maxhp;
2556 /* Attempt to clone. */
2557 if (multiply_monster(c_ptr->m_idx, TRUE, 0L))
2559 note = _("が分裂した!", " spawns!");
2563 /* No "real" damage */
2570 /* Heal Monster (use "dam" as amount of healing) */
2573 if (seen) obvious = TRUE;
2576 (void)set_monster_csleep(c_ptr->m_idx, 0);
2578 if (m_ptr->maxhp < m_ptr->max_maxhp)
2580 if (seen_msg) msg_format(_("%^sの強さが戻った。", "%^s recovers %s vitality."), m_name, m_poss);
2581 m_ptr->maxhp = m_ptr->max_maxhp;
2586 /* Redraw (later) if needed */
2587 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
2588 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
2596 if (seen) obvious = TRUE;
2599 (void)set_monster_csleep(c_ptr->m_idx, 0);
2600 if (MON_STUNNED(m_ptr))
2602 if (seen_msg) msg_format(_("%^sは朦朧状態から立ち直った。", "%^s is no longer stunned."), m_name);
2603 (void)set_monster_stunned(c_ptr->m_idx, 0);
2605 if (MON_CONFUSED(m_ptr))
2607 if (seen_msg) msg_format(_("%^sは混乱から立ち直った。", "%^s is no longer confused."), m_name);
2608 (void)set_monster_confused(c_ptr->m_idx, 0);
2610 if (MON_MONFEAR(m_ptr))
2612 if (seen_msg) msg_format(_("%^sは勇気を取り戻した。", "%^s recovers %s courage."), m_name);
2613 (void)set_monster_monfear(c_ptr->m_idx, 0);
2617 if (m_ptr->hp < 30000) m_ptr->hp += dam;
2620 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
2624 chg_virtue(V_VITALITY, 1);
2626 if (r_ptr->flags1 & RF1_UNIQUE)
2627 chg_virtue(V_INDIVIDUALISM, 1);
2629 if (is_friendly(m_ptr))
2630 chg_virtue(V_HONOUR, 1);
2631 else if (!(r_ptr->flags3 & RF3_EVIL))
2633 if (r_ptr->flags3 & RF3_GOOD)
2634 chg_virtue(V_COMPASSION, 2);
2636 chg_virtue(V_COMPASSION, 1);
2639 if (r_ptr->flags3 & RF3_ANIMAL)
2640 chg_virtue(V_NATURE, 1);
2643 if (m_ptr->r_idx == MON_LEPER)
2646 if (!who) chg_virtue(V_COMPASSION, 5);
2649 /* Redraw (later) if needed */
2650 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
2651 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
2653 note = _("は体力を回復したようだ。", " looks healthier.");
2655 /* No "real" damage */
2661 /* Speed Monster (Ignore "dam") */
2664 if (seen) obvious = TRUE;
2667 if (set_monster_fast(c_ptr->m_idx, MON_FAST(m_ptr) + 100))
2669 note = _("の動きが速くなった。", " starts moving faster.");
2674 if (r_ptr->flags1 & RF1_UNIQUE)
2675 chg_virtue(V_INDIVIDUALISM, 1);
2676 if (is_friendly(m_ptr))
2677 chg_virtue(V_HONOUR, 1);
2680 /* No "real" damage */
2686 /* Slow Monster (Use "dam" as "power") */
2689 if (seen) obvious = TRUE;
2691 if (r_ptr->flagsr & RFR_RES_ALL)
2693 note = _("には効果がなかった。", " is unaffected.");
2695 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2698 /* Powerful monsters can resist */
2699 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2700 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2702 note = _("には効果がなかった。", " is unaffected.");
2706 /* Normal monsters slow down */
2709 if (set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 50))
2711 note = _("の動きが遅くなった。", " starts moving slower.");
2715 /* No "real" damage */
2721 /* Sleep (Use "dam" as "power") */
2724 if (seen) obvious = TRUE;
2726 if (r_ptr->flagsr & RFR_RES_ALL)
2728 note = _("には効果がなかった。", " is unaffected.");
2730 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2733 /* Attempt a saving throw */
2734 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2735 (r_ptr->flags3 & RF3_NO_SLEEP) ||
2736 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2738 /* Memorize a flag */
2739 if (r_ptr->flags3 & RF3_NO_SLEEP)
2741 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
2743 /* No obvious effect */
2744 note = _("には効果がなかった。", " is unaffected.");
2749 /* Go to sleep (much) later */
2750 note = _("は眠り込んでしまった!", " falls asleep!");
2754 /* No "real" damage */
2760 /* Sleep (Use "dam" as "power") */
2761 case GF_STASIS_EVIL:
2763 if (seen) obvious = TRUE;
2765 if (r_ptr->flagsr & RFR_RES_ALL)
2767 note = _("には効果がなかった!", " is immune.");
2769 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2772 /* Attempt a saving throw */
2773 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2774 !(r_ptr->flags3 & RF3_EVIL) ||
2775 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2777 note = _("には効果がなかった。", " is unaffected.");
2782 /* Go to sleep (much) later */
2783 note = _("は動けなくなった!", " is suspended!");
2787 /* No "real" damage */
2792 /* Sleep (Use "dam" as "power") */
2795 if (seen) obvious = TRUE;
2797 if (r_ptr->flagsr & RFR_RES_ALL)
2799 note = _("には効果がなかった。", " is unaffected.");
2801 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2804 /* Attempt a saving throw */
2805 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2806 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2808 note = _("には効果がなかった。", " is unaffected.");
2813 /* Go to sleep (much) later */
2814 note = _("は動けなくなった!", " is suspended!");
2818 /* No "real" damage */
2827 vir = virtue_number(V_HARMONY);
2830 dam += p_ptr->virtues[vir-1]/10;
2833 vir = virtue_number(V_INDIVIDUALISM);
2836 dam -= p_ptr->virtues[vir-1]/20;
2839 if (seen) obvious = TRUE;
2841 /* Attempt a saving throw */
2842 if (common_saving_throw_charm(p_ptr, dam, m_ptr))
2846 /* No obvious effect */
2847 note = _("には効果がなかった。", " is unaffected.");
2850 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2852 else if (p_ptr->cursed & TRC_AGGRAVATE)
2854 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2855 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2859 note = _("は突然友好的になったようだ!", " suddenly seems friendly!");
2862 chg_virtue(V_INDIVIDUALISM, -1);
2863 if (r_ptr->flags3 & RF3_ANIMAL)
2864 chg_virtue(V_NATURE, 1);
2867 /* No "real" damage */
2872 /* Control undead */
2873 case GF_CONTROL_UNDEAD:
2876 if (seen) obvious = TRUE;
2878 vir = virtue_number(V_UNLIFE);
2881 dam += p_ptr->virtues[vir-1]/10;
2884 vir = virtue_number(V_INDIVIDUALISM);
2887 dam -= p_ptr->virtues[vir-1]/20;
2890 /* Attempt a saving throw */
2891 if (common_saving_throw_control(p_ptr, dam, m_ptr) ||
2892 !(r_ptr->flags3 & RF3_UNDEAD))
2894 /* No obvious effect */
2895 note = _("には効果がなかった。", " is unaffected.");
2897 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2899 else if (p_ptr->cursed & TRC_AGGRAVATE)
2901 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2902 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2906 note = _("は既にあなたの奴隷だ!", " is in your thrall!");
2910 /* No "real" damage */
2916 case GF_CONTROL_DEMON:
2919 if (seen) obvious = TRUE;
2921 vir = virtue_number(V_UNLIFE);
2924 dam += p_ptr->virtues[vir-1]/10;
2927 vir = virtue_number(V_INDIVIDUALISM);
2930 dam -= p_ptr->virtues[vir-1]/20;
2933 /* Attempt a saving throw */
2934 if (common_saving_throw_control(p_ptr, dam, m_ptr) ||
2935 !(r_ptr->flags3 & RF3_DEMON))
2937 /* No obvious effect */
2938 note = _("には効果がなかった。", " is unaffected.");
2940 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2942 else if (p_ptr->cursed & TRC_AGGRAVATE)
2944 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2945 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2949 note = _("は既にあなたの奴隷だ!", " is in your thrall!");
2953 /* No "real" damage */
2959 case GF_CONTROL_ANIMAL:
2962 if (seen) obvious = TRUE;
2964 vir = virtue_number(V_NATURE);
2967 dam += p_ptr->virtues[vir-1]/10;
2970 vir = virtue_number(V_INDIVIDUALISM);
2973 dam -= p_ptr->virtues[vir-1]/20;
2976 /* Attempt a saving throw */
2977 if (common_saving_throw_control(p_ptr, dam, m_ptr) ||
2978 !(r_ptr->flags3 & RF3_ANIMAL))
2981 /* No obvious effect */
2982 note = _("には効果がなかった。", " is unaffected.");
2984 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2986 else if (p_ptr->cursed & TRC_AGGRAVATE)
2988 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2989 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2993 note = _("はなついた。", " is tamed!");
2995 if (r_ptr->flags3 & RF3_ANIMAL)
2996 chg_virtue(V_NATURE, 1);
2999 /* No "real" damage */
3005 case GF_CHARM_LIVING:
3009 vir = virtue_number(V_UNLIFE);
3010 if (seen) obvious = TRUE;
3012 vir = virtue_number(V_UNLIFE);
3015 dam -= p_ptr->virtues[vir-1]/10;
3018 vir = virtue_number(V_INDIVIDUALISM);
3021 dam -= p_ptr->virtues[vir-1]/20;
3024 msg_format(_("%sを見つめた。", "You stare into %s."), m_name);
3026 /* Attempt a saving throw */
3027 if (common_saving_throw_charm(p_ptr, dam, m_ptr) ||
3028 !monster_living(m_ptr->r_idx))
3031 /* No obvious effect */
3032 note = _("には効果がなかった。", " is unaffected.");
3034 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3036 else if (p_ptr->cursed & TRC_AGGRAVATE)
3038 note = _("はあなたに敵意を抱いている!", " hates you too much!");
3039 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3043 note = _("を支配した。", " is tamed!");
3045 if (r_ptr->flags3 & RF3_ANIMAL)
3046 chg_virtue(V_NATURE, 1);
3049 /* No "real" damage */
3054 /* Confusion (Use "dam" as "power") */
3057 if (seen) obvious = TRUE;
3059 if (r_ptr->flagsr & RFR_RES_ALL)
3061 note = _("には効果がなかった。", " is unaffected.");
3063 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3066 /* Get confused later */
3067 do_conf = damroll(3, (dam / 2)) + 1;
3069 /* Attempt a saving throw */
3070 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
3071 (r_ptr->flags3 & (RF3_NO_CONF)) ||
3072 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3074 /* Memorize a flag */
3075 if (r_ptr->flags3 & (RF3_NO_CONF))
3077 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3083 /* No obvious effect */
3084 note = _("には効果がなかった。", " is unaffected.");
3088 /* No "real" damage */
3095 if (seen) obvious = TRUE;
3097 if (r_ptr->flagsr & RFR_RES_ALL)
3099 note = _("には効果がなかった。", " is unaffected.");
3101 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3104 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
3106 /* Attempt a saving throw */
3107 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
3108 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3113 /* No obvious effect */
3114 note = _("には効果がなかった。", " is unaffected.");
3118 /* No "real" damage */
3126 /* Lite, but only hurts susceptible creatures */
3134 if (r_ptr->flagsr & RFR_RES_ALL)
3140 if (r_ptr->flags3 & (RF3_HURT_LITE))
3142 /* Obvious effect */
3143 if (seen) obvious = TRUE;
3145 /* Memorize the effects */
3146 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
3148 /* Special effect */
3149 note = _("は光に身をすくめた!", " cringes from the light!");
3150 note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
3153 /* Normally no damage */
3165 /* Lite -- opposite of Dark */
3168 if (seen) obvious = TRUE;
3170 if (r_ptr->flagsr & RFR_RES_ALL)
3172 note = _("には完全な耐性がある!", " is immune.");
3174 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3177 if (r_ptr->flagsr & RFR_RES_LITE)
3179 note = _("には耐性がある!", " resists!");
3180 dam *= 2; dam /= (randint1(6)+6);
3181 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_LITE);
3183 else if (r_ptr->flags3 & (RF3_HURT_LITE))
3185 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
3186 note = _("は光に身をすくめた!", " cringes from the light!");
3187 note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
3194 /* Dark -- opposite of Lite */
3197 if (seen) obvious = TRUE;
3199 if (r_ptr->flagsr & RFR_RES_ALL)
3201 note = _("には完全な耐性がある!", " is immune.");
3203 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3206 if (r_ptr->flagsr & RFR_RES_DARK)
3208 note = _("には耐性がある!", " resists!");
3209 dam *= 2; dam /= (randint1(6)+6);
3210 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DARK);
3219 if (r_ptr->flagsr & RFR_RES_ALL)
3224 /* Hurt by rock remover */
3225 if (r_ptr->flags3 & (RF3_HURT_ROCK))
3228 if (seen) obvious = TRUE;
3230 /* Memorize the effects */
3231 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
3233 /* Cute little message */
3234 note = _("の皮膚がただれた!", " loses some skin!");
3235 note_dies = _("はドロドロに溶けた!", " dissolves!");
3238 /* Usually, ignore the effects */
3249 /* Teleport undead (Use "dam" as "power") */
3250 case GF_AWAY_UNDEAD:
3252 /* Only affect undead */
3253 if (r_ptr->flags3 & (RF3_UNDEAD))
3255 bool resists_tele = FALSE;
3257 if (r_ptr->flagsr & RFR_RES_TELE)
3259 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
3261 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
3262 note = _("には効果がなかった。", " is unaffected.");
3263 resists_tele = TRUE;
3265 else if (r_ptr->level > randint1(100))
3267 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
3268 note = _("には耐性がある!", " resists!");
3269 resists_tele = TRUE;
3275 if (seen) obvious = TRUE;
3276 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
3288 /* No "real" damage */
3294 /* Teleport evil (Use "dam" as "power") */
3297 /* Only affect evil */
3298 if (r_ptr->flags3 & (RF3_EVIL))
3300 bool resists_tele = FALSE;
3302 if (r_ptr->flagsr & RFR_RES_TELE)
3304 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
3306 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
3307 note = _("には効果がなかった。", " is unaffected.");
3308 resists_tele = TRUE;
3310 else if (r_ptr->level > randint1(100))
3312 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
3313 note = _("には耐性がある!", " resists!");
3314 resists_tele = TRUE;
3320 if (seen) obvious = TRUE;
3321 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
3333 /* No "real" damage */
3339 /* Teleport monster (Use "dam" as "power") */
3342 bool resists_tele = FALSE;
3343 if (r_ptr->flagsr & RFR_RES_TELE)
3345 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
3347 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
3348 note = _("には効果がなかった。", " is unaffected.");
3349 resists_tele = TRUE;
3351 else if (r_ptr->level > randint1(100))
3353 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
3354 note = _("には耐性がある!", " resists!");
3355 resists_tele = TRUE;
3361 if (seen) obvious = TRUE;
3363 /* Prepare to teleport */
3367 /* No "real" damage */
3373 /* Turn undead (Use "dam" as "power") */
3374 case GF_TURN_UNDEAD:
3376 if (r_ptr->flagsr & RFR_RES_ALL)
3381 /* Only affect undead */
3382 if (r_ptr->flags3 & (RF3_UNDEAD))
3384 if (seen) obvious = TRUE;
3386 /* Learn about type */
3387 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
3389 /* Apply some fear */
3390 do_fear = damroll(3, (dam / 2)) + 1;
3392 /* Attempt a saving throw */
3393 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
3395 /* No obvious effect */
3396 note = _("には効果がなかった。", " is unaffected.");
3409 /* No "real" damage */
3415 /* Turn evil (Use "dam" as "power") */
3418 if (r_ptr->flagsr & RFR_RES_ALL)
3423 /* Only affect evil */
3424 if (r_ptr->flags3 & (RF3_EVIL))
3426 if (seen) obvious = TRUE;
3428 /* Learn about type */
3429 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
3431 /* Apply some fear */
3432 do_fear = damroll(3, (dam / 2)) + 1;
3434 /* Attempt a saving throw */
3435 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
3437 /* No obvious effect */
3438 note = _("には効果がなかった。", " is unaffected.");
3451 /* No "real" damage */
3457 /* Turn monster (Use "dam" as "power") */
3460 if (r_ptr->flagsr & RFR_RES_ALL)
3465 if (seen) obvious = TRUE;
3467 /* Apply some fear */
3468 do_fear = damroll(3, (dam / 2)) + 1;
3470 /* Attempt a saving throw */
3471 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
3472 (r_ptr->flags3 & (RF3_NO_FEAR)) ||
3473 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3475 /* No obvious effect */
3476 note = _("には効果がなかった。", " is unaffected.");
3481 /* No "real" damage */
3488 case GF_DISP_UNDEAD:
3490 if (r_ptr->flagsr & RFR_RES_ALL)
3496 /* Only affect undead */
3497 if (r_ptr->flags3 & (RF3_UNDEAD))
3499 if (seen) obvious = TRUE;
3501 /* Learn about type */
3502 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
3504 note = _("は身震いした。", " shudders.");
3505 note_dies = _("はドロドロに溶けた!", " dissolves!");
3525 if (r_ptr->flagsr & RFR_RES_ALL)
3531 /* Only affect evil */
3532 if (r_ptr->flags3 & (RF3_EVIL))
3534 if (seen) obvious = TRUE;
3536 /* Learn about type */
3537 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
3539 note = _("は身震いした。", " shudders.");
3540 note_dies = _("はドロドロに溶けた!", " dissolves!");
3559 if (r_ptr->flagsr & RFR_RES_ALL)
3565 /* Only affect good */
3566 if (r_ptr->flags3 & (RF3_GOOD))
3568 if (seen) obvious = TRUE;
3570 /* Learn about type */
3571 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
3573 note = _("は身震いした。", " shudders.");
3574 note_dies = _("はドロドロに溶けた!", " dissolves!");
3591 case GF_DISP_LIVING:
3593 if (r_ptr->flagsr & RFR_RES_ALL)
3599 /* Only affect non-undead */
3600 if (monster_living(m_ptr->r_idx))
3602 if (seen) obvious = TRUE;
3604 note = _("は身震いした。", " shudders.");
3605 note_dies = _("はドロドロに溶けた!", " dissolves!");
3624 if (r_ptr->flagsr & RFR_RES_ALL)
3630 /* Only affect demons */
3631 if (r_ptr->flags3 & (RF3_DEMON))
3633 if (seen) obvious = TRUE;
3635 /* Learn about type */
3636 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
3638 note = _("は身震いした。", " shudders.");
3639 note_dies = _("はドロドロに溶けた!", " dissolves!");
3655 /* Dispel monster */
3658 if (r_ptr->flagsr & RFR_RES_ALL)
3664 if (seen) obvious = TRUE;
3666 note = _("は身震いした。", " shudders.");
3667 note_dies = _("はドロドロに溶けた!", " dissolves!");
3674 if (seen) obvious = TRUE;
3676 if (r_ptr->flagsr & RFR_RES_ALL)
3678 note = _("には完全な耐性がある!", " is immune.");
3680 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3684 if ((r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) || (r_ptr->a_ability_flags1 & ~(RF5_NOMAGIC_MASK)) || (r_ptr->a_ability_flags2 & ~(RF6_NOMAGIC_MASK)))
3688 /* Heal the monster */
3689 if (caster_ptr->hp < caster_ptr->maxhp)
3692 caster_ptr->hp += dam;
3693 if (caster_ptr->hp > caster_ptr->maxhp) caster_ptr->hp = caster_ptr->maxhp;
3695 /* Redraw (later) if needed */
3696 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
3697 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
3699 /* Special message */
3702 monster_desc(killer, caster_ptr, 0);
3703 msg_format(_("%^sは気分が良さそうだ。", "%^s appears healthier."), killer);
3709 msg_format(_("%sから精神エネルギーを吸いとった。", "You draw psychic energy from %s."), m_name);
3710 (void)hp_player(dam);
3715 if (see_s_msg) msg_format(_("%sには効果がなかった。", "%s is unaffected."), m_name);
3724 if (seen) obvious = TRUE;
3725 if (!who) msg_format(_("%sをじっと睨んだ。", "You gaze intently at %s."), m_name);
3727 if (r_ptr->flagsr & RFR_RES_ALL)
3729 note = _("には完全な耐性がある!", " is immune.");
3731 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3735 /* Attempt a saving throw */
3736 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3737 (r_ptr->flags3 & RF3_NO_CONF) ||
3738 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
3740 /* Memorize a flag */
3741 if (r_ptr->flags3 & (RF3_NO_CONF))
3743 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3745 note = _("には効果がなかった。", " is unaffected.");
3748 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
3750 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
3751 note = _("には完全な耐性がある!", " is immune.");
3754 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
3756 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
3757 note = _("には耐性がある。", " resists.");
3762 note = _("は精神攻撃を食らった。", " is blasted by psionic energy.");
3763 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
3765 if (who > 0) do_conf = randint0(4) + 4;
3766 else do_conf = randint0(8) + 8;
3772 case GF_BRAIN_SMASH:
3774 if (seen) obvious = TRUE;
3775 if (!who) msg_format(_("%sをじっと睨んだ。", "You gaze intently at %s."), m_name);
3777 if (r_ptr->flagsr & RFR_RES_ALL)
3779 note = _("には完全な耐性がある!", " is immune.");
3781 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3785 /* Attempt a saving throw */
3786 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3787 (r_ptr->flags3 & RF3_NO_CONF) ||
3788 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
3790 /* Memorize a flag */
3791 if (r_ptr->flags3 & (RF3_NO_CONF))
3793 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3795 note = _("には効果がなかった。", " is unaffected.");
3798 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
3800 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
3801 note = _("には完全な耐性がある!", " is immune.");
3804 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
3806 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
3807 note = _("には耐性がある!", " resists!");
3812 note = _("は精神攻撃を食らった。", " is blasted by psionic energy.");
3813 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
3817 do_conf = randint0(4) + 4;
3818 do_stun = randint0(4) + 4;
3822 do_conf = randint0(8) + 8;
3823 do_stun = randint0(8) + 8;
3825 (void)set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 10);
3833 if (seen) obvious = TRUE;
3834 if (!who) msg_format(_("%sを指差して呪いをかけた。", "You point at %s and curse."), m_name);
3836 if (r_ptr->flagsr & RFR_RES_ALL)
3838 note = _("には完全な耐性がある!", " is immune.");
3840 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3844 /* Attempt a saving throw */
3845 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
3847 note = _("には効果がなかった。", " is unaffected.");
3856 if (seen) obvious = TRUE;
3857 if (!who) msg_format(_("%sを指差して恐ろしげに呪いをかけた。", "You point at %s and curse horribly."), m_name);
3859 if (r_ptr->flagsr & RFR_RES_ALL)
3861 note = _("には完全な耐性がある!", " is immune.");
3863 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3867 /* Attempt a saving throw */
3868 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
3870 note = _("には効果がなかった。", " is unaffected.");
3879 if (seen) obvious = TRUE;
3880 if (!who) msg_format(_("%sを指差し、恐ろしげに呪文を唱えた!", "You point at %s, incanting terribly!"), m_name);
3882 if (r_ptr->flagsr & RFR_RES_ALL)
3884 note = _("には完全な耐性がある!", " is immune.");
3886 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3890 /* Attempt a saving throw */
3891 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
3893 note = _("には効果がなかった。", " is unaffected.");
3902 if (seen) obvious = TRUE;
3904 msg_format(_("%sの秘孔を突いて、「お前は既に死んでいる」と叫んだ。",
3905 "You point at %s, screaming the word, 'DIE!'."), m_name);
3907 if (r_ptr->flagsr & RFR_RES_ALL)
3909 note = _("には完全な耐性がある!", " is immune.");
3911 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3915 /* Attempt a saving throw */
3916 if ((randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35)) && ((who <= 0) || (caster_ptr->r_idx != MON_KENSHIROU)))
3918 note = _("には効果がなかった。", " is unaffected.");
3927 if (seen) obvious = TRUE;
3929 if (r_ptr->flagsr & RFR_RES_ALL)
3931 note = _("には完全な耐性がある!", " is immune.");
3933 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3937 if (r_ptr->flags1 & RF1_UNIQUE)
3939 note = _("には効果がなかった。", " is unaffected.");
3944 if ((who > 0) ? ((caster_lev + randint1(dam)) > (r_ptr->level + 10 + randint1(20))) :
3945 (((caster_lev / 2) + randint1(dam)) > (r_ptr->level + randint1(200))))
3947 dam = ((40 + randint1(20)) * m_ptr->hp) / 100;
3949 if (m_ptr->hp < dam) dam = m_ptr->hp - 1;
3953 note = _("は耐性を持っている!", "resists!");
3960 /* Capture monster */
3964 if ((p_ptr->inside_quest && (quest[p_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(m_ptr)) ||
3965 (r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flags7 & (RF7_NAZGUL)) || (r_ptr->flags7 & (RF7_UNIQUE2)) || (r_ptr->flags1 & RF1_QUESTOR) || m_ptr->parent_m_idx)
3967 msg_format(_("%sには効果がなかった。", "%s is unaffected."), m_name);
3972 if (is_pet(m_ptr)) nokori_hp = m_ptr->maxhp * 4L;
3973 else if ((p_ptr->pclass == CLASS_BEASTMASTER) && monster_living(m_ptr->r_idx))
3974 nokori_hp = m_ptr->maxhp * 3 / 10;
3976 nokori_hp = m_ptr->maxhp * 3 / 20;
3978 if (m_ptr->hp >= nokori_hp)
3980 msg_format(_("もっと弱らせないと。", "You need to weaken %s more."), m_name);
3983 else if (m_ptr->hp < randint0(nokori_hp))
3985 if (m_ptr->mflag2 & MFLAG2_CHAMELEON) choose_new_monster(c_ptr->m_idx, FALSE, MON_CHAMELEON);
3986 msg_format(_("%sを捕えた!", "You capture %^s!"), m_name);
3987 cap_mon = m_ptr->r_idx;
3988 cap_mspeed = m_ptr->mspeed;
3990 cap_maxhp = m_ptr->max_maxhp;
3991 cap_nickname = m_ptr->nickname; /* Quark transfer */
3992 if (c_ptr->m_idx == p_ptr->riding)
3994 if (rakuba(-1, FALSE))
3996 msg_format(_("地面に落とされた。", "You have fallen from %s."), m_name);
4000 delete_monster_idx(c_ptr->m_idx);
4006 msg_format(_("うまく捕まえられなかった。", "You failed to capture %s."), m_name);
4012 /* Attack (Use "dam" as attack type) */
4015 /* Return this monster's death */
4016 return py_attack(y, x, dam);
4019 /* Sleep (Use "dam" as "power") */
4025 if (seen) obvious = TRUE;
4027 if (r_ptr->flagsr & RFR_RES_ALL)
4029 note = _("には効果がなかった。", " is unaffected.");
4031 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4034 if (r_ptr->flags2 & RF2_EMPTY_MIND)
4036 note = _("には効果がなかった。", " is unaffected.");
4039 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
4042 if (MON_CSLEEP(m_ptr))
4044 note = _("には効果がなかった。", " is unaffected.");
4050 if (one_in_(5)) effect = 1;
4051 else if (one_in_(4)) effect = 2;
4052 else if (one_in_(3)) effect = 3;
4057 /* Powerful monsters can resist */
4058 if ((r_ptr->flags1 & RF1_UNIQUE) ||
4059 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4061 note = _("には効果がなかった。", " is unaffected.");
4065 /* Normal monsters slow down */
4068 if (set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 50))
4070 note = _("の動きが遅くなった。", " starts moving slower.");
4075 else if (effect == 2)
4077 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
4079 /* Attempt a saving throw */
4080 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4081 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4086 /* No obvious effect */
4087 note = _("には効果がなかった。", " is unaffected.");
4092 else if (effect == 3)
4094 /* Attempt a saving throw */
4095 if ((r_ptr->flags1 & RF1_UNIQUE) ||
4096 (r_ptr->flags3 & RF3_NO_SLEEP) ||
4097 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4099 /* Memorize a flag */
4100 if (r_ptr->flags3 & RF3_NO_SLEEP)
4102 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
4105 /* No obvious effect */
4106 note = _("には効果がなかった。", " is unaffected.");
4111 /* Go to sleep (much) later */
4112 note = _("は眠り込んでしまった!", " falls asleep!");
4119 note = _("には効果がなかった。", " is unaffected.");
4122 /* No "real" damage */
4130 if (seen) obvious = TRUE;
4132 if (r_ptr->flagsr & RFR_RES_ALL)
4134 note = _("には効果がなかった。", " is unaffected.");
4136 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4140 if (genocide_aux(c_ptr->m_idx, dam, !who, (r_ptr->level + 1) / 2, _("モンスター消滅", "Genocide One")))
4142 if (seen_msg) msg_format(_("%sは消滅した!", "%^s disappered!"), m_name);
4143 chg_virtue(V_VITALITY, -1);
4153 if (!who) msg_format(_("%sを写真に撮った。", "You take a photograph of %s."), m_name);
4155 if (r_ptr->flags3 & (RF3_HURT_LITE))
4157 /* Obvious effect */
4158 if (seen) obvious = TRUE;
4160 /* Memorize the effects */
4161 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4163 /* Special effect */
4164 note = _("は光に身をすくめた!", " cringes from the light!");
4165 note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
4168 /* Normally no damage */
4175 photo = m_ptr->r_idx;
4182 case GF_BLOOD_CURSE:
4184 if (seen) obvious = TRUE;
4186 if (r_ptr->flagsr & RFR_RES_ALL)
4188 note = _("には完全な耐性がある!", " is immune.");
4190 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4198 bool success = FALSE;
4199 if (seen) obvious = TRUE;
4201 if ((r_ptr->flags3 & (RF3_GOOD)) && !p_ptr->inside_arena)
4203 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 50;
4204 if (dam < 1) dam = 1;
4206 /* No need to tame your pet */
4209 note = _("の動きが速くなった。", " starts moving faster.");
4210 (void)set_monster_fast(c_ptr->m_idx, MON_FAST(m_ptr) + 100);
4214 /* Attempt a saving throw */
4215 else if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4216 (r_ptr->flags1 & (RF1_UNIQUE)) ||
4217 (m_ptr->mflag2 & MFLAG2_NOPET) ||
4218 (p_ptr->cursed & TRC_AGGRAVATE) ||
4219 ((r_ptr->level+10) > randint1(dam)))
4222 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4226 note = _("を支配した。", " is tamed!");
4228 (void)set_monster_fast(c_ptr->m_idx, MON_FAST(m_ptr) + 100);
4230 /* Learn about type */
4231 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
4238 if (!(r_ptr->flags3 & RF3_NO_FEAR))
4240 do_fear = randint1(90)+10;
4242 else if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_FEAR);
4245 /* No "real" damage */
4252 if (seen) obvious = TRUE;
4254 if (r_ptr->flagsr & RFR_RES_ALL)
4256 note = _("には完全な耐性がある!", " is immune.");
4258 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4262 /* Attempt a saving throw */
4263 if (randint0(100 + dam) < (r_ptr->level + 50))
4265 note = _("には効果がなかった。", " is unaffected.");
4285 /* Absolutely no effect */
4286 if (skipped) return (FALSE);
4288 /* "Unique" monsters cannot be polymorphed */
4289 if (r_ptr->flags1 & (RF1_UNIQUE)) do_poly = FALSE;
4291 /* Quest monsters cannot be polymorphed */
4292 if (r_ptr->flags1 & RF1_QUESTOR) do_poly = FALSE;
4294 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_poly = FALSE;
4296 /* "Unique" and "quest" monsters can only be "killed" by the player. */
4297 if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & RF7_NAZGUL)) && !p_ptr->inside_battle)
4299 if (who && (dam > m_ptr->hp)) dam = m_ptr->hp;
4304 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_COMPASSION, -1);
4305 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_HONOUR, -1);
4308 /* Modify the damage */
4310 dam = mon_damage_mod(m_ptr, dam, (bool)(typ == GF_PSY_SPEAR));
4311 if ((tmp > 0) && (dam == 0)) note = _("はダメージを受けていない。", " is unharmed.");
4313 /* Check for death */
4314 if (dam > m_ptr->hp)
4316 /* Extract method of death */
4321 /* Sound and Impact resisters never stun */
4323 !(r_ptr->flagsr & (RFR_RES_SOUN | RFR_RES_WALL)) &&
4324 !(r_ptr->flags3 & RF3_NO_STUN))
4326 if (seen) obvious = TRUE;
4329 if (MON_STUNNED(m_ptr))
4331 note = _("はひどくもうろうとした。", " is more dazed.");
4332 tmp = MON_STUNNED(m_ptr) + (do_stun / 2);
4336 note = _("はもうろうとした。", " is dazed.");
4341 (void)set_monster_stunned(c_ptr->m_idx, tmp);
4347 /* Confusion and Chaos resisters (and sleepers) never confuse */
4349 !(r_ptr->flags3 & RF3_NO_CONF) &&
4350 !(r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK))
4352 if (seen) obvious = TRUE;
4354 /* Already partially confused */
4355 if (MON_CONFUSED(m_ptr))
4357 note = _("はさらに混乱したようだ。", " looks more confused.");
4358 tmp = MON_CONFUSED(m_ptr) + (do_conf / 2);
4361 /* Was not confused */
4364 note = _("は混乱したようだ。", " looks confused.");
4368 /* Apply confusion */
4369 (void)set_monster_confused(c_ptr->m_idx, tmp);
4377 if (seen) obvious = TRUE;
4379 if (do_time >= m_ptr->maxhp) do_time = m_ptr->maxhp - 1;
4383 note = _("は弱くなったようだ。", " seems weakened.");
4384 m_ptr->maxhp -= do_time;
4385 if ((m_ptr->hp - dam) > m_ptr->maxhp) dam = m_ptr->hp - m_ptr->maxhp;
4390 /* Mega-Hack -- Handle "polymorph" -- monsters get a saving throw */
4391 if (do_poly && (randint1(90) > r_ptr->level))
4393 if (polymorph_monster(y, x))
4395 if (seen) obvious = TRUE;
4397 /* Monster polymorphs */
4398 note = _("が変身した!", " changes!");
4400 /* Turn off the damage */
4406 note = _("には効果がなかった。", " is unaffected.");
4409 /* Hack -- Get new monster */
4410 m_ptr = &m_list[c_ptr->m_idx];
4412 /* Hack -- Get new race */
4413 r_ptr = &r_info[m_ptr->r_idx];
4416 /* Handle "teleport" */
4419 if (seen) obvious = TRUE;
4421 note = _("が消え去った!", " disappears!");
4423 if (!who) chg_virtue(V_VALOUR, -1);
4426 teleport_away(c_ptr->m_idx, do_dist,
4427 (!who ? TELEPORT_DEC_VALOUR : 0L) | TELEPORT_PASSIVE);
4429 /* Hack -- get new location */
4433 /* Hack -- get new grid */
4434 c_ptr = &cave[y][x];
4441 (void)set_monster_monfear(c_ptr->m_idx, MON_MONFEAR(m_ptr) + do_fear);
4448 if (typ == GF_DRAIN_MANA)
4450 /* Drain mana does nothing */
4453 /* If another monster did the damage, hurt the monster by hand */
4456 /* Redraw (later) if needed */
4457 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
4458 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
4460 /* Wake the monster up */
4461 (void)set_monster_csleep(c_ptr->m_idx, 0);
4463 /* Hurt the monster */
4471 if (is_pet(m_ptr) && !(m_ptr->ml))
4474 /* Give detailed messages if destroyed */
4477 monster_desc(m_name, m_ptr, MD_TRUE_NAME);
4480 msg_format("%^s%s", m_name, note);
4488 if (who > 0) monster_gain_exp(who, m_ptr->r_idx);
4490 /* Generate treasure, etc */
4491 monster_death(c_ptr->m_idx, FALSE);
4494 delete_monster_idx(c_ptr->m_idx);
4498 msg_print(_("少し悲しい気分がした。", "You feel sad for a moment."));
4502 /* Damaged monster */
4505 /* Give detailed messages if visible or destroyed */
4506 if (note && seen_msg) msg_format("%^s%s", m_name, note);
4508 /* Hack -- Pain message */
4511 message_pain(c_ptr->m_idx, dam);
4518 /* Hack -- handle sleep */
4519 if (do_sleep) (void)set_monster_csleep(c_ptr->m_idx, do_sleep);
4523 else if (heal_leper)
4525 if (seen_msg) msg_print(_("不潔な病人は病気が治った!", "The Mangy looking leper is healed!"));
4527 if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
4529 char m2_name[MAX_NLEN];
4531 monster_desc(m2_name, m_ptr, MD_INDEF_VISIBLE);
4532 do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_HEAL_LEPER, m2_name);
4535 delete_monster_idx(c_ptr->m_idx);
4538 /* If the player did it, give him experience, check fear */
4543 /* Hurt the monster, check for fear and death */
4544 if (mon_take_hit(c_ptr->m_idx, dam, &fear, note_dies))
4549 /* Damaged monster */
4552 /* HACK - anger the monster before showing the sleep message */
4553 if (do_sleep) anger_monster(m_ptr);
4555 /* Give detailed messages if visible or destroyed */
4556 if (note && seen_msg)
4557 msg_format(_("%s%s", "%^s%s"), m_name, note);
4559 /* Hack -- Pain message */
4560 else if (known && (dam || !do_fear))
4562 message_pain(c_ptr->m_idx, dam);
4565 /* Anger monsters */
4566 if (((dam > 0) || get_angry) && !do_sleep)
4567 anger_monster(m_ptr);
4569 if ((fear || do_fear) && seen)
4572 msg_format(_("%^sは恐怖して逃げ出した!", "%^s flees in terror!"), m_name);
4575 /* Hack -- handle sleep */
4576 if (do_sleep) (void)set_monster_csleep(c_ptr->m_idx, do_sleep);
4580 if ((typ == GF_BLOOD_CURSE) && one_in_(4))
4582 int curse_flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
4586 switch (randint1(28))
4591 msg_print(_("地面が揺れた...", "The ground trembles..."));
4592 earthquake(ty, tx, 4 + randint0(4));
4593 if (!one_in_(6)) break;
4595 case 3: case 4: case 5: case 6:
4598 int extra_dam = damroll(10, 10);
4599 msg_print(_("純粋な魔力の次元への扉が開いた!", "A portal opens to a plane of raw mana!"));
4601 project(0, 8, ty, tx, extra_dam, GF_MANA, curse_flg, -1);
4602 if (!one_in_(6)) break;
4607 msg_print(_("空間が歪んだ!", "Space warps about you!"));
4609 if (m_ptr->r_idx) teleport_away(c_ptr->m_idx, damroll(10, 10), TELEPORT_PASSIVE);
4610 if (one_in_(13)) count += activate_hi_summon(ty, tx, TRUE);
4611 if (!one_in_(6)) break;
4613 case 9: case 10: case 11:
4614 msg_print(_("エネルギーのうねりを感じた!", "You feel a surge of energy!"));
4615 project(0, 7, ty, tx, 50, GF_DISINTEGRATE, curse_flg, -1);
4616 if (!one_in_(6)) break;
4617 case 12: case 13: case 14: case 15: case 16:
4618 aggravate_monsters(0);
4619 if (!one_in_(6)) break;
4621 count += activate_hi_summon(ty, tx, TRUE);
4622 if (!one_in_(6)) break;
4623 case 19: case 20: case 21: case 22:
4625 bool pet = !one_in_(3);
4626 BIT_FLAGS mode = PM_ALLOW_GROUP;
4628 if (pet) mode |= PM_FORCE_PET;
4629 else mode |= (PM_NO_PET | PM_FORCE_FRIENDLY);
4631 count += summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, (pet ? p_ptr->lev*2/3+randint1(p_ptr->lev/2) : dun_level), 0, mode, '\0');
4632 if (!one_in_(6)) break;
4634 case 23: case 24: case 25:
4635 if (p_ptr->hold_exp && (randint0(100) < 75)) break;
4636 msg_print(_("経験値が体から吸い取られた気がする!", "You feel your experience draining away..."));
4638 if (p_ptr->hold_exp) lose_exp(p_ptr->exp / 160);
4639 else lose_exp(p_ptr->exp / 16);
4640 if (!one_in_(6)) break;
4641 case 26: case 27: case 28:
4650 (void)do_dec_stat(i);
4659 (void)do_dec_stat(randint0(6));
4668 if (p_ptr->inside_battle)
4670 p_ptr->health_who = c_ptr->m_idx;
4671 p_ptr->redraw |= (PR_HEALTH);
4675 /* Verify this code */
4676 if (m_ptr->r_idx) update_monster(c_ptr->m_idx, FALSE);
4678 /* Redraw the monster grid */
4682 /* Update monster recall window */
4683 if ((p_ptr->monster_race_idx == m_ptr->r_idx) && (seen || !m_ptr->r_idx))
4685 p_ptr->window |= (PW_MONSTER);
4688 if ((dam > 0) && !is_pet(m_ptr) && !is_friendly(m_ptr))
4692 if (!(flg & PROJECT_NO_HANGEKI))
4694 set_target(m_ptr, monster_target_y, monster_target_x);
4697 else if ((who > 0) && is_pet(caster_ptr) && !player_bold(m_ptr->target_y, m_ptr->target_x))
4699 set_target(m_ptr, caster_ptr->fy, caster_ptr->fx);
4703 if (p_ptr->riding && (p_ptr->riding == c_ptr->m_idx) && (dam > 0))
4705 if (m_ptr->hp > m_ptr->maxhp/3) dam = (dam + 1) / 2;
4706 rakubadam_m = (dam > 200) ? 200 : dam;
4716 /* Prepare to make a Blade of Chaos */
4717 object_prep(q_ptr, lookup_kind(TV_STATUE, SV_PHOTO));
4719 q_ptr->pval = photo;
4721 /* Mark the item as fully known */
4722 q_ptr->ident |= (IDENT_MENTAL);
4723 (void)drop_near(q_ptr, -1, p_ptr->y, p_ptr->x);
4731 /* Return "Anything seen?" */
4736 * @brief 汎用的なビーム/ボルト/ボール系によるプレイヤーへの効果処理 / Helper function for "project()" below.
4737 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
4738 * @param who_name 効果を起こしたモンスターの名前
4739 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
4740 * @param y 目標Y座標 / Target y location (or location to travel "towards")
4741 * @param x 目標X座標 / Target x location (or location to travel "towards")
4742 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
4743 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
4745 * @param monspell 効果元のモンスター魔法ID
4746 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
4748 * Handle a beam/bolt/ball causing damage to the player.
4749 * This routine takes a "source monster" (by index), a "distance", a default
4750 * "damage", and a "damage type". See "project_m()" above.
4751 * If "rad" is non-zero, then the blast was centered elsewhere, and the damage
4752 * is reduced (see "project_m()" above). This can happen if a monster breathes
4753 * at the player and hits a wall instead.
4754 * NOTE (Zangband): 'Bolt' attacks can be reflected back, so we need
4755 * to know if this is actually a ball or a bolt spell
4756 * We return "TRUE" if any "obvious" effects were observed. XXX XXX Actually,
4757 * we just assume that the effects were obvious, for historical reasons.
4759 static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ, BIT_FLAGS flg, int monspell)
4764 /* Hack -- assume obvious */
4765 bool obvious = TRUE;
4767 /* Player blind-ness */
4768 bool blind = (p_ptr->blind ? TRUE : FALSE);
4770 /* Player needs a "description" (he is blind) */
4773 /* Source monster */
4774 monster_type *m_ptr = NULL;
4776 /* Monster name (for attacks) */
4777 GAME_TEXT m_name[MAX_NLEN];
4779 /* Monster name (for damage) */
4782 /* Hack -- messages */
4788 /* Player is not here */
4789 if (!player_bold(y, x)) return (FALSE);
4791 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && (randint0(55) < (p_ptr->lev*3/5+20)) && who && (who != p_ptr->riding))
4793 if (kawarimi(TRUE)) return FALSE;
4796 /* Player cannot hurt himself */
4797 if (!who) return (FALSE);
4798 if (who == p_ptr->riding) return (FALSE);
4800 if ((p_ptr->reflect || ((p_ptr->special_defense & KATA_FUUJIN) && !p_ptr->blind)) && (flg & PROJECT_REFLECTABLE) && !one_in_(10))
4803 int max_attempts = 10;
4804 sound(SOUND_REFLECT);
4807 msg_print(_("何かが跳ね返った!", "Something bounces!"));
4808 else if (p_ptr->special_defense & KATA_FUUJIN)
4809 msg_print(_("風の如く武器を振るって弾き返した!", "The attack bounces!"));
4811 msg_print(_("攻撃が跳ね返った!", "The attack bounces!"));
4814 /* Choose 'new' target */
4819 t_y = m_list[who].fy - 1 + randint1(3);
4820 t_x = m_list[who].fx - 1 + randint1(3);
4823 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(p_ptr->y, p_ptr->x, t_y, t_x));
4825 if (max_attempts < 1)
4827 t_y = m_list[who].fy;
4828 t_x = m_list[who].fx;
4833 t_y = p_ptr->y - 1 + randint1(3);
4834 t_x = p_ptr->x - 1 + randint1(3);
4837 project(0, 0, t_y, t_x, dam, typ, (PROJECT_STOP|PROJECT_KILL|PROJECT_REFLECTABLE), monspell);
4839 disturb(TRUE, TRUE);
4843 /* Limit maximum damage */
4844 if (dam > 1600) dam = 1600;
4846 /* Reduce damage by distance */
4847 dam = (dam + r) / (r + 1);
4850 /* If the player is blind, be more descriptive */
4851 if (blind) fuzzy = TRUE;
4856 m_ptr = &m_list[who];
4857 rlev = (((&r_info[m_ptr->r_idx])->level >= 1) ? (&r_info[m_ptr->r_idx])->level : 1);
4858 monster_desc(m_name, m_ptr, 0);
4860 /* Get the monster's real name (gotten before polymorph!) */
4861 strcpy(killer, who_name);
4867 case PROJECT_WHO_UNCTRL_POWER:
4868 strcpy(killer, _("制御できない力の氾流", "uncontrollable power storm"));
4871 case PROJECT_WHO_GLASS_SHARDS:
4872 strcpy(killer, _("ガラスの破片", "shards of glass"));
4876 strcpy(killer, _("罠", "a trap"));
4881 strcpy(m_name, killer);
4884 /* Analyze the damage */
4887 /* Standard damage -- hurts inventory too */
4890 if (fuzzy) msg_print(_("酸で攻撃された!", "You are hit by acid!"));
4891 get_damage = acid_dam(dam, killer, monspell, FALSE);
4895 /* Standard damage -- hurts inventory too */
4898 if (fuzzy) msg_print(_("火炎で攻撃された!", "You are hit by fire!"));
4899 get_damage = fire_dam(dam, killer, monspell, FALSE);
4903 /* Standard damage -- hurts inventory too */
4906 if (fuzzy) msg_print(_("冷気で攻撃された!", "You are hit by cold!"));
4907 get_damage = cold_dam(dam, killer, monspell, FALSE);
4911 /* Standard damage -- hurts inventory too */
4914 if (fuzzy) msg_print(_("電撃で攻撃された!", "You are hit by lightning!"));
4915 get_damage = elec_dam(dam, killer, monspell, FALSE);
4919 /* Standard damage -- also poisons player */
4922 bool double_resist = IS_OPPOSE_POIS();
4923 if (fuzzy) msg_print(_("毒で攻撃された!", "You are hit by poison!"));
4925 if (p_ptr->resist_pois) dam = (dam + 2) / 3;
4926 if (double_resist) dam = (dam + 2) / 3;
4928 if ((!(double_resist || p_ptr->resist_pois)) && one_in_(HURT_CHANCE) && !CHECK_MULTISHADOW())
4933 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4935 if (!(double_resist || p_ptr->resist_pois) && !CHECK_MULTISHADOW())
4937 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
4942 /* Standard damage -- also poisons / mutates player */
4945 bool double_resist = IS_OPPOSE_POIS();
4946 if (fuzzy) msg_print(_("放射能で攻撃された!", "You are hit by radiation!"));
4948 if (p_ptr->resist_pois) dam = (2 * dam + 2) / 5;
4949 if (double_resist) dam = (2 * dam + 2) / 5;
4950 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4951 if (!(double_resist || p_ptr->resist_pois) && !CHECK_MULTISHADOW())
4953 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
4955 if (one_in_(5)) /* 6 */
4957 msg_print(_("奇形的な変身を遂げた!", "You undergo a freakish metamorphosis!"));
4958 if (one_in_(4)) /* 4 */
4966 inven_damage(set_acid_destroy, 2);
4972 /* Standard damage */
4975 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4976 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4980 /* Holy Orb -- Player only takes partial damage */
4983 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4984 if (p_ptr->align > 10)
4986 else if (p_ptr->align < -10)
4988 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4994 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4995 if (p_ptr->align > 10)
4997 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5001 /* Arrow -- XXX no dodging */
5006 msg_print(_("何か鋭いもので攻撃された!", "You are hit by something sharp!"));
5008 else if ((inventory[INVEN_RARM].name1 == ART_ZANTETSU) || (inventory[INVEN_LARM].name1 == ART_ZANTETSU))
5010 msg_print(_("矢を斬り捨てた!", "You cut down the arrow!"));
5013 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5017 /* Plasma -- XXX No resist */
5020 if (fuzzy) msg_print(_("何かとても熱いもので攻撃された!", "You are hit by something *HOT*!"));
5021 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5023 if (!p_ptr->resist_sound && !CHECK_MULTISHADOW())
5025 int plus_stun = (randint1((dam > 40) ? 35 : (dam * 3 / 4 + 5)));
5026 (void)set_stun(p_ptr->stun + plus_stun);
5029 if (!(p_ptr->resist_fire || IS_OPPOSE_FIRE() || p_ptr->immune_fire))
5031 inven_damage(set_acid_destroy, 3);
5037 /* Nether -- drain experience */
5040 if (fuzzy) msg_print(_("地獄の力で攻撃された!", "You are hit by nether forces!"));
5041 if (p_ptr->resist_neth)
5043 if (!prace_is_(RACE_SPECTRE))
5045 dam *= 6; dam /= (randint1(4) + 7);
5048 else if (!CHECK_MULTISHADOW()) drain_exp(200 + (p_ptr->exp / 100), 200 + (p_ptr->exp / 1000), 75);
5050 if (prace_is_(RACE_SPECTRE) && !CHECK_MULTISHADOW())
5052 msg_print(_("気分がよくなった。", "You feel invigorated!"));
5054 learn_spell(monspell);
5058 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5064 /* Water -- stun/confuse */
5067 if (fuzzy) msg_print(_("何か湿ったもので攻撃された!", "You are hit by something wet!"));
5068 if (!CHECK_MULTISHADOW())
5070 if (!p_ptr->resist_sound && !p_ptr->resist_water)
5072 set_stun(p_ptr->stun + randint1(40));
5074 if (!p_ptr->resist_conf && !p_ptr->resist_water)
5076 set_confused(p_ptr->confused + randint1(5) + 5);
5079 if (one_in_(5) && !p_ptr->resist_water)
5081 inven_damage(set_cold_destroy, 3);
5084 if (p_ptr->resist_water) get_damage /= 4;
5087 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5091 /* Chaos -- many effects */
5094 if (fuzzy) msg_print(_("無秩序の波動で攻撃された!", "You are hit by a wave of anarchy!"));
5095 if (p_ptr->resist_chaos)
5097 dam *= 6; dam /= (randint1(4) + 7);
5100 if (!CHECK_MULTISHADOW())
5102 if (!p_ptr->resist_conf)
5104 (void)set_confused(p_ptr->confused + randint0(20) + 10);
5106 if (!p_ptr->resist_chaos)
5108 (void)set_image(p_ptr->image + randint1(10));
5111 msg_print(_("あなたの身体はカオスの力で捻じ曲げられた!", "Your body is twisted by chaos!"));
5112 (void)gain_random_mutation(0);
5115 if (!p_ptr->resist_neth && !p_ptr->resist_chaos)
5117 drain_exp(5000 + (p_ptr->exp / 100), 500 + (p_ptr->exp / 1000), 75);
5120 if (!p_ptr->resist_chaos || one_in_(9))
5122 inven_damage(set_elec_destroy, 2);
5123 inven_damage(set_fire_destroy, 2);
5127 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5131 /* Shards -- mostly cutting */
5134 if (fuzzy) msg_print(_("何か鋭いもので攻撃された!", "You are hit by something sharp!"));
5135 if (p_ptr->resist_shard)
5137 dam *= 6; dam /= (randint1(4) + 7);
5139 else if (!CHECK_MULTISHADOW())
5141 (void)set_cut(p_ptr->cut + dam);
5144 if (!p_ptr->resist_shard || one_in_(13))
5146 inven_damage(set_cold_destroy, 2);
5149 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5153 /* Sound -- mostly stunning */
5156 if (fuzzy) msg_print(_("轟音で攻撃された!", "You are hit by a loud noise!"));
5157 if (p_ptr->resist_sound)
5159 dam *= 5; dam /= (randint1(4) + 7);
5161 else if (!CHECK_MULTISHADOW())
5163 int plus_stun = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
5164 (void)set_stun(p_ptr->stun + plus_stun);
5167 if (!p_ptr->resist_sound || one_in_(13))
5169 inven_damage(set_cold_destroy, 2);
5172 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5176 /* Pure confusion */
5179 if (fuzzy) msg_print(_("何か混乱するもので攻撃された!", "You are hit by something puzzling!"));
5180 if (p_ptr->resist_conf)
5182 dam *= 5; dam /= (randint1(4) + 7);
5184 else if (!CHECK_MULTISHADOW())
5186 (void)set_confused(p_ptr->confused + randint1(20) + 10);
5188 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5192 /* Disenchantment -- see above */
5195 if (fuzzy) msg_print(_("何かさえないもので攻撃された!", "You are hit by something static!"));
5196 if (p_ptr->resist_disen)
5198 dam *= 6; dam /= (randint1(4) + 7);
5200 else if (!CHECK_MULTISHADOW())
5202 (void)apply_disenchant(0);
5204 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5208 /* Nexus -- see above */
5211 if (fuzzy) msg_print(_("何か奇妙なもので攻撃された!", "You are hit by something strange!"));
5212 if (p_ptr->resist_nexus)
5214 dam *= 6; dam /= (randint1(4) + 7);
5216 else if (!CHECK_MULTISHADOW())
5220 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5224 /* Force -- mostly stun */
5227 if (fuzzy) msg_print(_("運動エネルギーで攻撃された!", "You are hit by kinetic force!"));
5228 if (!p_ptr->resist_sound && !CHECK_MULTISHADOW())
5230 (void)set_stun(p_ptr->stun + randint1(20));
5232 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5237 /* Rocket -- stun, cut */
5240 if (fuzzy) msg_print(_("爆発があった!", "There is an explosion!"));
5241 if (!p_ptr->resist_sound && !CHECK_MULTISHADOW())
5243 (void)set_stun(p_ptr->stun + randint1(20));
5246 if (p_ptr->resist_shard)
5250 else if (!CHECK_MULTISHADOW())
5252 (void)set_cut(p_ptr->cut + (dam / 2));
5255 if (!p_ptr->resist_shard || one_in_(12))
5257 inven_damage(set_cold_destroy, 3);
5260 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5264 /* Inertia -- slowness */
5267 if (fuzzy) msg_print(_("何か遅いもので攻撃された!", "You are hit by something slow!"));
5268 if (!CHECK_MULTISHADOW()) (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
5269 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5273 /* Lite -- blinding */
5276 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
5277 if (p_ptr->resist_lite)
5279 dam *= 4; dam /= (randint1(4) + 7);
5281 else if (!blind && !p_ptr->resist_blind && !CHECK_MULTISHADOW())
5283 (void)set_blind(p_ptr->blind + randint1(5) + 2);
5286 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
5288 if (!CHECK_MULTISHADOW()) msg_print(_("光で肉体が焦がされた!", "The light scorches your flesh!"));
5291 else if (prace_is_(RACE_S_FAIRY))
5296 if (p_ptr->wraith_form) dam *= 2;
5297 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5299 if (p_ptr->wraith_form && !CHECK_MULTISHADOW())
5301 p_ptr->wraith_form = 0;
5302 msg_print(_("閃光のため非物質的な影の存在でいられなくなった。",
5303 "The light forces you out of your incorporeal shadow form."));
5305 p_ptr->redraw |= (PR_MAP | PR_STATUS);
5306 p_ptr->update |= (PU_MONSTERS);
5307 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5313 /* Dark -- blinding */
5316 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
5317 if (p_ptr->resist_dark)
5319 dam *= 4; dam /= (randint1(4) + 7);
5321 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form) dam = 0;
5323 else if (!blind && !p_ptr->resist_blind && !CHECK_MULTISHADOW())
5325 (void)set_blind(p_ptr->blind + randint1(5) + 2);
5327 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5331 /* Time -- bolt fewer effects XXX */
5334 if (fuzzy) msg_print(_("過去からの衝撃に攻撃された!", "You are hit by a blast from the past!"));
5335 if (p_ptr->resist_time)
5338 dam /= (randint1(4) + 7);
5339 msg_print(_("時間が通り過ぎていく気がする。", "You feel as if time is passing you by."));
5341 else if (!CHECK_MULTISHADOW())
5343 switch (randint1(10))
5345 case 1: case 2: case 3: case 4: case 5:
5347 if (p_ptr->prace == RACE_ANDROID) break;
5348 msg_print(_("人生が逆戻りした気がする。", "You feel life has clocked back."));
5349 lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
5353 case 6: case 7: case 8: case 9:
5355 switch (randint1(6))
5357 case 1: k = A_STR; act = _("強く", "strong"); break;
5358 case 2: k = A_INT; act = _("聡明で", "bright"); break;
5359 case 3: k = A_WIS; act = _("賢明で", "wise"); break;
5360 case 4: k = A_DEX; act = _("器用で", "agile"); break;
5361 case 5: k = A_CON; act = _("健康で", "hale"); break;
5362 case 6: k = A_CHR; act = _("美しく", "beautiful"); break;
5365 msg_format(_("あなたは以前ほど%sなくなってしまった...。",
5366 "You're not as %s as you used to be..."), act);
5368 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 3) / 4;
5369 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
5370 p_ptr->update |= (PU_BONUS);
5376 msg_print(_("あなたは以前ほど力強くなくなってしまった...。",
5377 "You're not as powerful as you used to be..."));
5379 for (k = 0; k < A_MAX; k++)
5381 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 7) / 8;
5382 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
5384 p_ptr->update |= (PU_BONUS);
5390 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5394 /* Gravity -- stun plus slowness plus teleport */
5397 if (fuzzy) msg_print(_("何か重いもので攻撃された!", "You are hit by something heavy!"));
5398 msg_print(_("周辺の重力がゆがんだ。", "Gravity warps around you."));
5400 if (!CHECK_MULTISHADOW())
5402 teleport_player(5, TELEPORT_PASSIVE);
5403 if (!p_ptr->levitation)
5404 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
5405 if (!(p_ptr->resist_sound || p_ptr->levitation))
5407 int plus_stun = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
5408 (void)set_stun(p_ptr->stun + plus_stun);
5411 if (p_ptr->levitation)
5413 dam = (dam * 2) / 3;
5416 if (!p_ptr->levitation || one_in_(13))
5418 inven_damage(set_cold_destroy, 2);
5421 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5425 /* Standard damage */
5426 case GF_DISINTEGRATE:
5428 if (fuzzy) msg_print(_("純粋なエネルギーで攻撃された!", "You are hit by pure energy!"));
5430 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5436 if (fuzzy) msg_print(_("何らかの攻撃によって気分がよくなった。", "You are hit by something invigorating!"));
5438 (void)hp_player(dam);
5445 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
5446 (void)set_fast(p_ptr->fast + randint1(5), FALSE);
5453 if (fuzzy) msg_print(_("何か遅いもので攻撃された!", "You are hit by something slow!"));
5454 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
5460 if (p_ptr->free_act) break;
5461 if (fuzzy) msg_print(_("眠ってしまった!", "You fall asleep!"));
5463 if (ironman_nightmare)
5465 msg_print(_("恐ろしい光景が頭に浮かんできた。", "A horrible vision enters your mind."));
5466 /* Have some nightmares */
5467 sanity_blast(NULL, FALSE);
5470 set_paralyzed(p_ptr->paralyzed + dam);
5480 if (fuzzy) msg_print(_("魔法のオーラで攻撃された!", "You are hit by an aura of magic!"));
5481 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5488 if (fuzzy) msg_print(_("エネルギーの塊で攻撃された!", "You are hit by an energy!"));
5489 get_damage = take_hit(DAMAGE_FORCE, dam, killer, monspell);
5496 if (fuzzy) msg_print(_("何かが空からあなたの頭上に落ちてきた!", "Something falls from the sky on you!"));
5498 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5499 if (!p_ptr->resist_shard || one_in_(13))
5501 if (!p_ptr->immune_fire) inven_damage(set_fire_destroy, 2);
5502 inven_damage(set_cold_destroy, 2);
5508 /* Ice -- cold plus stun plus cuts */
5511 if (fuzzy) msg_print(_("何か鋭く冷たいもので攻撃された!", "You are hit by something sharp and cold!"));
5512 get_damage = cold_dam(dam, killer, monspell, FALSE);
5513 if (!CHECK_MULTISHADOW())
5515 if (!p_ptr->resist_shard)
5517 (void)set_cut(p_ptr->cut + damroll(5, 8));
5519 if (!p_ptr->resist_sound)
5521 (void)set_stun(p_ptr->stun + randint1(15));
5524 if ((!(p_ptr->resist_cold || IS_OPPOSE_COLD())) || one_in_(12))
5526 if (!p_ptr->immune_cold) inven_damage(set_cold_destroy, 3);
5536 if (fuzzy) msg_print(_("何か非常に冷たいもので攻撃された!", "You are hit by something extremely cold!"));
5538 if (p_ptr->mimic_form)
5540 if (!(mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
5541 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5546 switch (p_ptr->prace)
5548 /* Some races are immune */
5562 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5574 if (CHECK_MULTISHADOW())
5576 msg_print(_("攻撃は幻影に命中し、あなたには届かなかった。", "The attack hits Shadow, you are unharmed!"));
5578 else if (p_ptr->csp)
5582 msg_format(_("%^sに精神エネルギーを吸い取られてしまった!", "%^s draws psychic energy from you!"), m_name);
5584 msg_print(_("精神エネルギーを吸い取られてしまった!", "Your psychic energy is drawn!"));
5587 if (dam >= p_ptr->csp)
5591 p_ptr->csp_frac = 0;
5600 learn_spell(monspell);
5601 p_ptr->redraw |= (PR_MANA);
5602 p_ptr->window |= (PW_PLAYER | PW_SPELL);
5606 /* Heal the monster */
5607 if (m_ptr->hp < m_ptr->maxhp)
5611 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
5613 /* Redraw (later) if needed */
5614 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
5615 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
5617 /* Special message */
5620 msg_format(_("%^sは気分が良さそうだ。", "%^s appears healthier."), m_name);
5633 if ((randint0(100 + rlev / 2) < MAX(5, p_ptr->skill_sav)) && !CHECK_MULTISHADOW())
5635 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
5636 learn_spell(monspell);
5640 if (!CHECK_MULTISHADOW())
5642 msg_print(_("霊的エネルギーで精神が攻撃された。", "Your mind is blasted by psyonic energy."));
5644 if (!p_ptr->resist_conf)
5646 (void)set_confused(p_ptr->confused + randint0(4) + 4);
5649 if (!p_ptr->resist_chaos && one_in_(3))
5651 (void)set_image(p_ptr->image + randint0(250) + 150);
5658 p_ptr->csp_frac = 0;
5660 p_ptr->redraw |= PR_MANA;
5663 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5669 case GF_BRAIN_SMASH:
5671 if ((randint0(100 + rlev / 2) < MAX(5, p_ptr->skill_sav)) && !CHECK_MULTISHADOW())
5673 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
5674 learn_spell(monspell);
5678 if (!CHECK_MULTISHADOW())
5680 msg_print(_("霊的エネルギーで精神が攻撃された。", "Your mind is blasted by psyonic energy."));
5686 p_ptr->csp_frac = 0;
5688 p_ptr->redraw |= PR_MANA;
5691 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5692 if (!CHECK_MULTISHADOW())
5694 if (!p_ptr->resist_blind)
5696 (void)set_blind(p_ptr->blind + 8 + randint0(8));
5698 if (!p_ptr->resist_conf)
5700 (void)set_confused(p_ptr->confused + randint0(4) + 4);
5702 if (!p_ptr->free_act)
5704 (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
5706 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
5708 while (randint0(100 + rlev / 2) > (MAX(5, p_ptr->skill_sav)))
5709 (void)do_dec_stat(A_INT);
5710 while (randint0(100 + rlev / 2) > (MAX(5, p_ptr->skill_sav)))
5711 (void)do_dec_stat(A_WIS);
5713 if (!p_ptr->resist_chaos)
5715 (void)set_image(p_ptr->image + randint0(250) + 150);
5725 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
5727 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
5728 learn_spell(monspell);
5732 if (!CHECK_MULTISHADOW()) curse_equipment(15, 0);
5733 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5741 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
5743 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
5744 learn_spell(monspell);
5748 if (!CHECK_MULTISHADOW()) curse_equipment(25, MIN(rlev / 2 - 15, 5));
5749 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5757 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
5759 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
5760 learn_spell(monspell);
5764 if (!CHECK_MULTISHADOW()) curse_equipment(33, MIN(rlev / 2 - 15, 15));
5765 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5773 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !(m_ptr->r_idx == MON_KENSHIROU) && !CHECK_MULTISHADOW())
5775 msg_print(_("しかし秘孔を跳ね返した!", "You resist the effects!"));
5776 learn_spell(monspell);
5780 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5781 if (!CHECK_MULTISHADOW()) (void)set_cut(p_ptr->cut + damroll(10, 10));
5789 if ((randint0(100 + rlev/2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
5791 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
5792 learn_spell(monspell);
5796 if (!CHECK_MULTISHADOW())
5798 msg_print(_("あなたは命が薄まっていくように感じた!", "You feel your life fade away!"));
5799 curse_equipment(40, 20);
5802 get_damage = take_hit(DAMAGE_ATTACK, dam, m_name, monspell);
5804 if (p_ptr->chp < 1) p_ptr->chp = 1; /* Paranoia */
5819 /* Hex - revenge damage stored */
5820 revenge_store(get_damage);
5822 if ((p_ptr->tim_eyeeye || hex_spelling(HEX_EYE_FOR_EYE))
5823 && (get_damage > 0) && !p_ptr->is_dead && (who > 0))
5825 GAME_TEXT m_name_self[80];
5828 monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
5830 msg_format(_("攻撃が%s自身を傷つけた!", "The attack of %s has wounded %s!"), m_name, m_name_self);
5831 project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
5832 if (p_ptr->tim_eyeeye) set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
5835 if (p_ptr->riding && dam > 0)
5837 rakubadam_p = (dam > 200) ? 200 : dam;
5841 disturb(TRUE, TRUE);
5844 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && who && (who != p_ptr->riding))
5846 (void)kawarimi(FALSE);
5849 /* Return "Anything seen?" */
5855 * Find the distance from (x, y) to a line.
5857 POSITION dist_to_line(POSITION y, POSITION x, POSITION y1, POSITION x1, POSITION y2, POSITION x2)
5859 /* Vector from (x, y) to (x1, y1) */
5860 POSITION py = y1 - y;
5861 POSITION px = x1 - x;
5864 POSITION ny = x2 - x1;
5865 POSITION nx = y1 - y2;
5868 POSITION pd = distance(y1, x1, y, x);
5869 POSITION nd = distance(y1, x1, y2, x2);
5871 if (pd > nd) return distance(y, x, y2, x2);
5873 /* Component of P on N */
5874 nd = ((nd) ? ((py * ny + px * nx) / nd) : 0);
5876 /* Absolute value */
5877 return((nd >= 0) ? nd : 0 - nd);
5884 * Modified version of los() for calculation of disintegration balls.
5885 * Disintegration effects are stopped by permanent walls.
5887 bool in_disintegration_range(POSITION y1, POSITION x1, POSITION y2, POSITION x2)
5889 POSITION dx, dy; /* Delta */
5890 POSITION ax, ay; /* Absolute */
5891 POSITION sx, sy; /* Signs */
5892 POSITION qx, qy; /* Fractions */
5893 POSITION tx, ty; /* Scanners */
5894 POSITION f1, f2; /* Scale factors */
5895 POSITION m; /* Slope, or 1/Slope, of LOS */
5897 /* Extract the offset */
5901 /* Extract the absolute offset */
5905 /* Handle adjacent (or identical) grids */
5906 if ((ax < 2) && (ay < 2)) return (TRUE);
5908 /* Paranoia -- require "safe" origin */
5909 /* if (!in_bounds(y1, x1)) return (FALSE); */
5911 /* Directly South/North */
5914 /* South -- check for walls */
5917 for (ty = y1 + 1; ty < y2; ty++)
5919 if (cave_stop_disintegration(ty, x1)) return (FALSE);
5923 /* North -- check for walls */
5926 for (ty = y1 - 1; ty > y2; ty--)
5928 if (cave_stop_disintegration(ty, x1)) return (FALSE);
5936 /* Directly East/West */
5939 /* East -- check for walls */
5942 for (tx = x1 + 1; tx < x2; tx++)
5944 if (cave_stop_disintegration(y1, tx)) return (FALSE);
5948 /* West -- check for walls */
5951 for (tx = x1 - 1; tx > x2; tx--)
5953 if (cave_stop_disintegration(y1, tx)) return (FALSE);
5961 /* Extract some signs */
5962 sx = (dx < 0) ? -1 : 1;
5963 sy = (dy < 0) ? -1 : 1;
5965 /* Vertical "knights" */
5970 if (!cave_stop_disintegration(y1 + sy, x1)) return (TRUE);
5974 /* Horizontal "knights" */
5979 if (!cave_stop_disintegration(y1, x1 + sx)) return (TRUE);
5983 /* Calculate scale factor div 2 */
5986 /* Calculate scale factor */
5990 /* Travel horizontally */
5993 /* Let m = dy / dx * 2 * (dy * dx) = 2 * dy * dy */
5999 /* Consider the special case where slope == 1. */
6010 /* Note (below) the case (qy == f2), where */
6011 /* the LOS exactly meets the corner of a tile. */
6014 if (cave_stop_disintegration(ty, tx)) return (FALSE);
6025 if (cave_stop_disintegration(ty, tx)) return (FALSE);
6038 /* Travel vertically */
6041 /* Let m = dx / dy * 2 * (dx * dy) = 2 * dx * dx */
6057 /* Note (below) the case (qx == f2), where */
6058 /* the LOS exactly meets the corner of a tile. */
6061 if (cave_stop_disintegration(ty, tx)) return (FALSE);
6072 if (cave_stop_disintegration(ty, tx)) return (FALSE);
6093 void breath_shape(u16b *path_g, int dist, int *pgrids, POSITION *gx, POSITION *gy, POSITION *gm, POSITION *pgm_rad, POSITION rad, POSITION y1, POSITION x1, POSITION y2, POSITION x2, EFFECT_ID typ)
6098 int brev = rad * rad / dist;
6102 int mdis = distance(y1, x1, y2, x2) + rad;
6104 while (bdis <= mdis)
6108 if ((0 < dist) && (path_n < dist))
6110 POSITION ny = GRID_Y(path_g[path_n]);
6111 POSITION nx = GRID_X(path_g[path_n]);
6112 POSITION nd = distance(ny, nx, y1, x1);
6114 /* Get next base point */
6123 /* Travel from center outward */
6124 for (cdis = 0; cdis <= brad; cdis++)
6126 /* Scan the maximal blast area of radius "cdis" */
6127 for (y = by - cdis; y <= by + cdis; y++)
6129 for (x = bx - cdis; x <= bx + cdis; x++)
6131 /* Ignore "illegal" locations */
6132 if (!in_bounds(y, x)) continue;
6134 /* Enforce a circular "ripple" */
6135 if (distance(y1, x1, y, x) != bdis) continue;
6137 /* Enforce an arc */
6138 if (distance(by, bx, y, x) != cdis) continue;
6144 /* Lights are stopped by opaque terrains */
6145 if (!los(by, bx, y, x)) continue;
6147 case GF_DISINTEGRATE:
6148 /* Disintegration are stopped only by perma-walls */
6149 if (!in_disintegration_range(by, bx, y, x)) continue;
6152 /* Ball explosions are stopped by walls */
6153 if (!projectable(by, bx, y, x)) continue;
6157 /* Save this grid */
6165 /* Encode some more "radius" info */
6166 gm[bdis + 1] = *pgrids;
6168 /* Increase the size */
6169 brad = rad * (path_n + brev) / (dist + brev);
6171 /* Find the next ripple */
6175 /* Store the effect size */
6181 * @brief 汎用的なビーム/ボルト/ボール系処理のルーチン Generic "beam"/"bolt"/"ball" projection routine.
6182 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
6183 * @param rad 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
6184 * @param y 目標Y座標 / Target y location (or location to travel "towards")
6185 * @param x 目標X座標 / Target x location (or location to travel "towards")
6186 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
6187 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
6188 * @param flg 効果フラグ / Extra bit flags (see PROJECT_xxxx in "defines.h")
6189 * @param monspell 効果元のモンスター魔法ID
6190 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
6193 * Allows a monster (or player) to project a beam/bolt/ball of a given kind
6194 * towards a given location (optionally passing over the heads of interposing
6195 * monsters), and have it do a given amount of damage to the monsters (and
6196 * optionally objects) within the given radius of the final location.
6198 * A "bolt" travels from source to target and affects only the target grid.
6199 * A "beam" travels from source to target, affecting all grids passed through.
6200 * A "ball" travels from source to the target, exploding at the target, and
6201 * affecting everything within the given radius of the target location.
6203 * Traditionally, a "bolt" does not affect anything on the ground, and does
6204 * not pass over the heads of interposing monsters, much like a traditional
6205 * missile, and will "stop" abruptly at the "target" even if no monster is
6206 * positioned there, while a "ball", on the other hand, passes over the heads
6207 * of monsters between the source and target, and affects everything except
6208 * the source monster which lies within the final radius, while a "beam"
6209 * affects every monster between the source and target, except for the casting
6210 * monster (or player), and rarely affects things on the ground.
6212 * Two special flags allow us to use this function in special ways, the
6213 * "PROJECT_HIDE" flag allows us to perform "invisible" projections, while
6214 * the "PROJECT_JUMP" flag allows us to affect a specific grid, without
6215 * actually projecting from the source monster (or player).
6217 * The player will only get "experience" for monsters killed by himself
6218 * Unique monsters can only be destroyed by attacks from the player
6220 * Only 256 grids can be affected per projection, limiting the effective
6221 * "radius" of standard ball attacks to nine units (diameter nineteen).
6223 * One can project in a given "direction" by combining PROJECT_THRU with small
6224 * offsets to the initial location (see "line_spell()"), or by calculating
6225 * "virtual targets" far away from the player.
6227 * One can also use PROJECT_THRU to send a beam/bolt along an angled path,
6228 * continuing until it actually hits somethings (useful for "stone to mud").
6230 * Bolts and Beams explode INSIDE walls, so that they can destroy doors.
6232 * Balls must explode BEFORE hitting walls, or they would affect monsters
6233 * on both sides of a wall. Some bug reports indicate that this is still
6234 * happening in 2.7.8 for Windows, though it appears to be impossible.
6236 * We "pre-calculate" the blast area only in part for efficiency.
6237 * More importantly, this lets us do "explosions" from the "inside" out.
6238 * This results in a more logical distribution of "blast" treasure.
6239 * It also produces a better (in my opinion) animation of the explosion.
6240 * It could be (but is not) used to have the treasure dropped by monsters
6241 * in the middle of the explosion fall "outwards", and then be damaged by
6242 * the blast as it spreads outwards towards the treasure drop location.
6244 * Walls and doors are included in the blast area, so that they can be
6245 * "burned" or "melted" in later versions.
6247 * This algorithm is intended to maximize simplicity, not necessarily
6248 * efficiency, since this function is not a bottleneck in the code.
6250 * We apply the blast effect from ground zero outwards, in several passes,
6251 * first affecting features, then objects, then monsters, then the player.
6252 * This allows walls to be removed before checking the object or monster
6253 * in the wall, and protects objects which are dropped by monsters killed
6254 * in the blast, and allows the player to see all affects before he is
6255 * killed or teleported away. The semantics of this method are open to
6256 * various interpretations, but they seem to work well in practice.
6258 * We process the blast area from ground-zero outwards to allow for better
6259 * distribution of treasure dropped by monsters, and because it provides a
6260 * pleasing visual effect at low cost.
6262 * Note that the damage done by "ball" explosions decreases with distance.
6263 * This decrease is rapid, grids at radius "dist" take "1/dist" damage.
6265 * Notice the "napalm" effect of "beam" weapons. First they "project" to
6266 * the target, and then the damage "flows" along this beam of destruction.
6267 * The damage at every grid is the same as at the "center" of a "ball"
6268 * explosion, since the "beam" grids are treated as if they ARE at the
6269 * center of a "ball" explosion.
6271 * Currently, specifying "beam" plus "ball" means that locations which are
6272 * covered by the initial "beam", and also covered by the final "ball", except
6273 * for the final grid (the epicenter of the ball), will be "hit twice", once
6274 * by the initial beam, and once by the exploding ball. For the grid right
6275 * next to the epicenter, this results in 150% damage being done. The center
6276 * does not have this problem, for the same reason the final grid in a "beam"
6277 * plus "bolt" does not -- it is explicitly removed. Simply removing "beam"
6278 * grids which are covered by the "ball" will NOT work, as then they will
6279 * receive LESS damage than they should. Do not combine "beam" with "ball".
6281 * The array "gy[],gx[]" with current size "grids" is used to hold the
6282 * collected locations of all grids in the "blast area" plus "beam path".
6284 * Note the rather complex usage of the "gm[]" array. First, gm[0] is always
6285 * zero. Second, for N>1, gm[N] is always the index (in gy[],gx[]) of the
6286 * first blast grid (see above) with radius "N" from the blast center. Note
6287 * that only the first gm[1] grids in the blast area thus take full damage.
6288 * Also, note that gm[rad+1] is always equal to "grids", which is the total
6289 * number of blast grids.
6291 * Note that once the projection is complete, (y2,x2) holds the final location
6292 * of bolts/beams, and the "epicenter" of balls.
6294 * Note also that "rad" specifies the "inclusive" radius of projection blast,
6295 * so that a "rad" of "one" actually covers 5 or 9 grids, depending on the
6296 * implementation of the "distance" function. Also, a bolt can be properly
6297 * viewed as a "ball" with a "rad" of "zero".
6299 * Note that if no "target" is reached before the beam/bolt/ball travels the
6300 * maximum distance allowed (MAX_RANGE), no "blast" will be induced. This
6301 * may be relevant even for bolts, since they have a "1x1" mini-blast.
6303 * Note that for consistency, we "pretend" that the bolt actually takes "time"
6304 * to move from point A to point B, even if the player cannot see part of the
6305 * projection path. Note that in general, the player will *always* see part
6306 * of the path, since it either starts at the player or ends on the player.
6308 * Hack -- we assume that every "projection" is "self-illuminating".
6310 * Hack -- when only a single monster is affected, we automatically track
6311 * (and recall) that monster, unless "PROJECT_JUMP" is used.
6313 * Note that all projections now "explode" at their final destination, even
6314 * if they were being projected at a more distant destination. This means
6315 * that "ball" spells will *always* explode.
6317 * Note that we must call "handle_stuff()" after affecting terrain features
6318 * in the blast radius, in case the "illumination" of the grid was changed,
6319 * and "update_view()" and "update_monsters()" need to be called.
6322 bool project(MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ, BIT_FLAGS flg, int monspell)
6332 POSITION y_saver, x_saver; /* For reflecting monsters */
6334 int msec = delay_factor * delay_factor * delay_factor;
6336 /* Assume the player sees nothing */
6337 bool notice = FALSE;
6339 /* Assume the player has seen nothing */
6340 bool visual = FALSE;
6342 /* Assume the player has seen no blast grids */
6345 /* Assume to be a normal ball spell */
6346 bool breath = FALSE;
6348 /* Is the player blind? */
6349 bool blind = (p_ptr->blind ? TRUE : FALSE);
6351 bool old_hide = FALSE;
6353 /* Number of grids in the "path" */
6356 /* Actual grids in the "path" */
6359 /* Number of grids in the "blast area" (including the "beam" path) */
6362 /* Coordinates of the affected grids */
6363 POSITION gx[1024], gy[1024];
6365 /* Encoded "radius" info (see above) */
6368 /* Actual radius encoded in gm[] */
6369 POSITION gm_rad = rad;
6373 /* Attacker's name (prepared before polymorph)*/
6374 GAME_TEXT who_name[MAX_NLEN];
6376 /* Can the player see the source of this effect? */
6377 bool see_s_msg = TRUE;
6379 /* Initialize by null string */
6385 /* Default target of monsterspell is player */
6386 monster_target_y = p_ptr->y;
6387 monster_target_x = p_ptr->x;
6389 /* Hack -- Jump to target */
6390 if (flg & (PROJECT_JUMP))
6395 /* Clear the flag */
6396 flg &= ~(PROJECT_JUMP);
6401 /* Start at player */
6408 /* Start at monster */
6411 x1 = m_list[who].fx;
6412 y1 = m_list[who].fy;
6413 monster_desc(who_name, &m_list[who], MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
6425 /* Default "destination" */
6430 /* Hack -- verify stuff */
6431 if (flg & (PROJECT_THRU))
6433 if ((x1 == x2) && (y1 == y2))
6435 flg &= ~(PROJECT_THRU);
6439 /* Handle a breath attack */
6444 if (flg & PROJECT_HIDE) old_hide = TRUE;
6445 flg |= PROJECT_HIDE;
6449 /* Hack -- Assume there will be no blast (max radius 32) */
6450 for (dist = 0; dist < 32; dist++) gm[dist] = 0;
6458 /* Collect beam grids */
6459 if (flg & (PROJECT_BEAM))
6470 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_LOS);
6472 case GF_DISINTEGRATE:
6473 flg |= (PROJECT_GRID);
6474 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_DISI);
6478 /* Calculate the projection path */
6480 path_n = project_path(path_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, flg);
6483 /* Giga-Hack SEEKER & SUPER_RAY */
6485 if( typ == GF_SEEKER )
6495 for (i = 0; i < path_n; ++i)
6500 int ny = GRID_Y(path_g[i]);
6501 int nx = GRID_X(path_g[i]);
6512 /* Only do visuals if requested */
6513 if (!blind && !(flg & (PROJECT_HIDE)))
6515 /* Only do visuals if the player can "see" the bolt */
6516 if (panel_contains(y, x) && player_has_los_bold(y, x))
6523 /* Obtain the bolt pict */
6524 p = bolt_pict(oy, ox, y, x, typ);
6526 /* Extract attr/char */
6530 /* Visual effects */
6531 print_rel(c, a, y, x);
6532 move_cursor_relative(y, x);
6533 /*if (fresh_before)*/ Term_fresh();
6534 Term_xtra(TERM_XTRA_DELAY, msec);
6536 /*if (fresh_before)*/ Term_fresh();
6538 /* Display "beam" grids */
6539 if (flg & (PROJECT_BEAM))
6541 /* Obtain the explosion pict */
6542 p = bolt_pict(y, x, y, x, typ);
6544 /* Extract attr/char */
6548 /* Visual effects */
6549 print_rel(c, a, y, x);
6552 /* Hack -- Activate delay */
6556 /* Hack -- delay anyway for consistency */
6559 /* Delay for consistency */
6560 Term_xtra(TERM_XTRA_DELAY, msec);
6563 if (project_o(0, 0, y, x, dam, GF_SEEKER))notice = TRUE;
6564 if (is_mirror_grid(&cave[y][x]))
6566 /* The target of monsterspell becomes tha mirror(broken) */
6567 monster_target_y = y;
6568 monster_target_x = x;
6570 remove_mirror(y, x);
6571 next_mirror(&oy, &ox, y, x);
6573 path_n = i + project_path(&(path_g[i + 1]), (project_length ? project_length : MAX_RANGE), y, x, oy, ox, flg);
6574 for (j = last_i; j <= i; j++)
6576 y = GRID_Y(path_g[j]);
6577 x = GRID_X(path_g[j]);
6578 if (project_m(0, 0, y, x, dam, GF_SEEKER, flg, TRUE)) notice = TRUE;
6579 if (!who && (project_m_n == 1) && !jump) {
6580 if (cave[project_m_y][project_m_x].m_idx > 0) {
6581 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
6585 /* Hack -- auto-recall */
6586 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
6588 /* Hack - auto-track */
6589 health_track(cave[project_m_y][project_m_x].m_idx);
6593 (void)project_f(0, 0, y, x, dam, GF_SEEKER);
6598 for(i = last_i ; i < path_n ; i++)
6601 py = GRID_Y(path_g[i]);
6602 px = GRID_X(path_g[i]);
6603 if (project_m(0, 0, py, px, dam, GF_SEEKER, flg, TRUE))
6605 if (!who && (project_m_n == 1) && !jump) {
6606 if (cave[project_m_y][project_m_x].m_idx > 0)
6608 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
6612 /* Hack -- auto-recall */
6613 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
6615 /* Hack - auto-track */
6616 health_track(cave[project_m_y][project_m_x].m_idx);
6620 (void)project_f(0, 0, py, px, dam, GF_SEEKER);
6624 else if(typ == GF_SUPER_RAY){
6626 int second_step = 0;
6633 for (i = 0; i < path_n; ++i)
6638 POSITION ny = GRID_Y(path_g[i]);
6639 POSITION nx = GRID_X(path_g[i]);
6650 /* Only do visuals if requested */
6651 if (!blind && !(flg & (PROJECT_HIDE)))
6653 /* Only do visuals if the player can "see" the bolt */
6654 if (panel_contains(y, x) && player_has_los_bold(y, x))
6661 /* Obtain the bolt pict */
6662 p = bolt_pict(oy, ox, y, x, typ);
6664 /* Extract attr/char */
6668 /* Visual effects */
6669 print_rel(c, a, y, x);
6670 move_cursor_relative(y, x);
6671 /*if (fresh_before)*/ Term_fresh();
6672 Term_xtra(TERM_XTRA_DELAY, msec);
6674 /*if (fresh_before)*/ Term_fresh();
6676 /* Display "beam" grids */
6677 if (flg & (PROJECT_BEAM))
6679 /* Obtain the explosion pict */
6680 p = bolt_pict(y, x, y, x, typ);
6682 /* Extract attr/char */
6686 /* Visual effects */
6687 print_rel(c, a, y, x);
6690 /* Hack -- Activate delay */
6694 /* Hack -- delay anyway for consistency */
6697 /* Delay for consistency */
6698 Term_xtra(TERM_XTRA_DELAY, msec);
6701 if(project_o(0,0,y,x,dam,GF_SUPER_RAY) )notice=TRUE;
6702 if (!cave_have_flag_bold(y, x, FF_PROJECT))
6704 if( second_step )continue;
6707 if( is_mirror_grid(&cave[y][x]) && !second_step )
6709 /* The target of monsterspell becomes tha mirror(broken) */
6710 monster_target_y=(s16b)y;
6711 monster_target_x=(s16b)x;
6714 for( j = 0; j <=i ; j++ )
6716 y = GRID_Y(path_g[j]);
6717 x = GRID_X(path_g[j]);
6718 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
6722 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x-1, flg);
6723 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x , flg);
6724 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x+1, flg);
6725 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x-1, flg);
6726 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x+1, flg);
6727 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x-1, flg);
6728 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x , flg);
6729 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x+1, flg);
6732 for( i = 0; i < path_n ; i++ )
6735 py = GRID_Y(path_g[i]);
6736 px = GRID_X(path_g[i]);
6737 (void)project_m(0, 0, py, px, dam, GF_SUPER_RAY, flg, TRUE);
6738 if(!who && (project_m_n == 1) && !jump){
6739 if(cave[project_m_y][project_m_x].m_idx >0 ){
6740 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
6744 /* Hack -- auto-recall */
6745 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
6747 /* Hack - auto-track */
6748 health_track(cave[project_m_y][project_m_x].m_idx);
6752 (void)project_f(0, 0, py, px, dam, GF_SUPER_RAY);
6757 /* Project along the path */
6758 for (i = 0; i < path_n; ++i)
6763 POSITION ny = GRID_Y(path_g[i]);
6764 POSITION nx = GRID_X(path_g[i]);
6766 if (flg & PROJECT_DISI)
6768 /* Hack -- Balls explode before reaching walls */
6769 if (cave_stop_disintegration(ny, nx) && (rad > 0)) break;
6771 else if (flg & PROJECT_LOS)
6773 /* Hack -- Balls explode before reaching walls */
6774 if (!cave_los_bold(ny, nx) && (rad > 0)) break;
6778 /* Hack -- Balls explode before reaching walls */
6779 if (!cave_have_flag_bold(ny, nx, FF_PROJECT) && (rad > 0)) break;
6786 /* Collect beam grids */
6787 if (flg & (PROJECT_BEAM))
6794 /* Only do visuals if requested */
6795 if (!blind && !(flg & (PROJECT_HIDE | PROJECT_FAST)))
6797 /* Only do visuals if the player can "see" the bolt */
6798 if (panel_contains(y, x) && player_has_los_bold(y, x))
6805 /* Obtain the bolt pict */
6806 p = bolt_pict(oy, ox, y, x, typ);
6808 /* Extract attr/char */
6812 /* Visual effects */
6813 print_rel(c, a, y, x);
6814 move_cursor_relative(y, x);
6815 /*if (fresh_before)*/ Term_fresh();
6816 Term_xtra(TERM_XTRA_DELAY, msec);
6818 /*if (fresh_before)*/ Term_fresh();
6820 /* Display "beam" grids */
6821 if (flg & (PROJECT_BEAM))
6823 /* Obtain the explosion pict */
6824 p = bolt_pict(y, x, y, x, typ);
6826 /* Extract attr/char */
6830 /* Visual effects */
6831 print_rel(c, a, y, x);
6834 /* Hack -- Activate delay */
6838 /* Hack -- delay anyway for consistency */
6841 /* Delay for consistency */
6842 Term_xtra(TERM_XTRA_DELAY, msec);
6849 /* Save the "blast epicenter" */
6853 if (breath && !path_n)
6859 flg &= ~(PROJECT_HIDE);
6863 /* Start the "explosion" */
6866 /* Hack -- make sure beams get to "explode" */
6874 /* If we found a "target", explode there */
6875 if (dist <= MAX_RANGE)
6877 /* Mega-Hack -- remove the final "beam" grid */
6878 if ((flg & (PROJECT_BEAM)) && (grids > 0)) grids--;
6881 * Create a conical breath attack
6892 flg &= ~(PROJECT_HIDE);
6894 breath_shape(path_g, dist, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, by, bx, typ);
6898 /* Determine the blast area, work from the inside out */
6899 for (dist = 0; dist <= rad; dist++)
6901 /* Scan the maximal blast area of radius "dist" */
6902 for (y = by - dist; y <= by + dist; y++)
6904 for (x = bx - dist; x <= bx + dist; x++)
6906 /* Ignore "illegal" locations */
6907 if (!in_bounds2(y, x)) continue;
6909 /* Enforce a "circular" explosion */
6910 if (distance(by, bx, y, x) != dist) continue;
6916 /* Lights are stopped by opaque terrains */
6917 if (!los(by, bx, y, x)) continue;
6919 case GF_DISINTEGRATE:
6920 /* Disintegration are stopped only by perma-walls */
6921 if (!in_disintegration_range(by, bx, y, x)) continue;
6924 /* Ball explosions are stopped by walls */
6925 if (!projectable(by, bx, y, x)) continue;
6929 /* Save this grid */
6936 /* Encode some more "radius" info */
6942 /* Speed -- ignore "non-explosions" */
6943 if (!grids) return (FALSE);
6946 /* Display the "blast area" if requested */
6947 if (!blind && !(flg & (PROJECT_HIDE)))
6949 /* Then do the "blast", from inside out */
6950 for (t = 0; t <= gm_rad; t++)
6952 /* Dump everything with this radius */
6953 for (i = gm[t]; i < gm[t+1]; i++)
6955 /* Extract the location */
6959 /* Only do visuals if the player can "see" the blast */
6960 if (panel_contains(y, x) && player_has_los_bold(y, x))
6969 /* Obtain the explosion pict */
6970 p = bolt_pict(y, x, y, x, typ);
6972 /* Extract attr/char */
6976 /* Visual effects -- Display */
6977 print_rel(c, a, y, x);
6981 /* Hack -- center the cursor */
6982 move_cursor_relative(by, bx);
6984 /* Flush each "radius" seperately */
6985 /*if (fresh_before)*/ Term_fresh();
6987 /* Delay (efficiently) */
6988 if (visual || drawn)
6990 Term_xtra(TERM_XTRA_DELAY, msec);
6994 /* Flush the erasing */
6997 /* Erase the explosion drawn above */
6998 for (i = 0; i < grids; i++)
7000 /* Extract the location */
7004 /* Hack -- Erase if needed */
7005 if (panel_contains(y, x) && player_has_los_bold(y, x))
7011 /* Hack -- center the cursor */
7012 move_cursor_relative(by, bx);
7014 /* Flush the explosion */
7015 /*if (fresh_before)*/ Term_fresh();
7019 update_creature(p_ptr);
7021 if (flg & PROJECT_KILL)
7023 see_s_msg = (who > 0) ? is_seen(&m_list[who]) :
7024 (!who ? TRUE : (player_can_see_bold(y1, x1) && projectable(p_ptr->y, p_ptr->x, y1, x1)));
7028 /* Check features */
7029 if (flg & (PROJECT_GRID))
7031 /* Start with "dist" of zero */
7034 /* Scan for features */
7035 for (i = 0; i < grids; i++)
7037 /* Hack -- Notice new "dist" values */
7038 if (gm[dist+1] == i) dist++;
7040 /* Get the grid location */
7044 /* Find the closest point in the blast */
7047 int d = dist_to_line(y, x, y1, x1, by, bx);
7049 /* Affect the grid */
7050 if (project_f(who, d, y, x, dam, typ)) notice = TRUE;
7054 /* Affect the grid */
7055 if (project_f(who, dist, y, x, dam, typ)) notice = TRUE;
7060 update_creature(p_ptr);
7063 if (flg & (PROJECT_ITEM))
7065 /* Start with "dist" of zero */
7068 /* Scan for objects */
7069 for (i = 0; i < grids; i++)
7071 /* Hack -- Notice new "dist" values */
7072 if (gm[dist+1] == i) dist++;
7074 /* Get the grid location */
7078 /* Find the closest point in the blast */
7081 int d = dist_to_line(y, x, y1, x1, by, bx);
7083 /* Affect the object in the grid */
7084 if (project_o(who, d, y, x, dam, typ)) notice = TRUE;
7088 /* Affect the object in the grid */
7089 if (project_o(who, dist, y, x, dam, typ)) notice = TRUE;
7095 /* Check monsters */
7096 if (flg & (PROJECT_KILL))
7103 /* Start with "dist" of zero */
7106 /* Scan for monsters */
7107 for (i = 0; i < grids; i++)
7111 /* Hack -- Notice new "dist" values */
7112 if (gm[dist + 1] == i) dist++;
7114 /* Get the grid location */
7118 /* A single bolt may be reflected */
7121 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
7122 monster_race *ref_ptr = &r_info[m_ptr->r_idx];
7124 if ((flg & PROJECT_REFLECTABLE) && cave[y][x].m_idx && (ref_ptr->flags2 & RF2_REFLECTING) &&
7125 ((cave[y][x].m_idx != p_ptr->riding) || !(flg & PROJECT_PLAYER)) &&
7126 (!who || dist_hack > 1) && !one_in_(10))
7129 int max_attempts = 10;
7131 /* Choose 'new' target */
7134 t_y = y_saver - 1 + randint1(3);
7135 t_x = x_saver - 1 + randint1(3);
7138 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(y, x, t_y, t_x));
7140 if (max_attempts < 1)
7146 sound(SOUND_REFLECT);
7149 if ((m_ptr->r_idx == MON_KENSHIROU) || (m_ptr->r_idx == MON_RAOU))
7150 msg_print(_("「北斗神拳奥義・二指真空把!」", "The attack bounces!"));
7151 else if (m_ptr->r_idx == MON_DIO)
7152 msg_print(_("ディオ・ブランドーは指一本で攻撃を弾き返した!", "The attack bounces!"));
7154 msg_print(_("攻撃は跳ね返った!", "The attack bounces!"));
7156 if (is_original_ap_and_seen(m_ptr)) ref_ptr->r_flags2 |= RF2_REFLECTING;
7158 /* Reflected bolts randomly target either one */
7159 if (player_bold(y, x) || one_in_(2)) flg &= ~(PROJECT_PLAYER);
7160 else flg |= PROJECT_PLAYER;
7162 /* The bolt is reflected */
7163 project(cave[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
7165 /* Don't affect the monster any longer */
7171 /* Find the closest point in the blast */
7174 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
7178 effective_dist = dist;
7182 /* There is the riding player on this monster */
7183 if (p_ptr->riding && player_bold(y, x))
7185 /* Aimed on the player */
7186 if (flg & PROJECT_PLAYER)
7188 if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
7191 * A beam or bolt is well aimed
7193 * So don't affects the mount.
7200 * The spell is not well aimed,
7201 * So partly affect the mount too.
7208 * This grid is the original target.
7209 * Or aimed on your horse.
7211 else if (((y == y2) && (x == x2)) || (flg & PROJECT_AIMED))
7213 /* Hit the mount with full damage */
7217 * Otherwise this grid is not the
7218 * original target, it means that line
7219 * of fire is obstructed by this
7223 * A beam or bolt will hit either
7224 * player or mount. Choose randomly.
7226 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE))
7230 /* Hit the mount with full damage */
7234 /* Hit the player later */
7235 flg |= PROJECT_PLAYER;
7237 /* Don't affect the mount */
7243 * The spell is not well aimed, so
7244 * partly affect both player and
7253 /* Affect the monster in the grid */
7254 if (project_m(who, effective_dist, y, x, dam, typ, flg, see_s_msg)) notice = TRUE;
7258 /* Player affected one monster (without "jumping") */
7259 if (!who && (project_m_n == 1) && !jump)
7264 /* Track if possible */
7265 if (cave[y][x].m_idx > 0)
7267 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
7271 /* Hack -- auto-recall */
7272 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
7274 /* Hack - auto-track */
7275 if (m_ptr->ml) health_track(cave[y][x].m_idx);
7283 if (flg & (PROJECT_KILL))
7285 /* Start with "dist" of zero */
7288 /* Scan for player */
7289 for (i = 0; i < grids; i++)
7293 /* Hack -- Notice new "dist" values */
7294 if (gm[dist+1] == i) dist++;
7296 /* Get the grid location */
7300 /* Affect the player? */
7301 if (!player_bold(y, x)) continue;
7303 /* Find the closest point in the blast */
7306 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
7310 effective_dist = dist;
7313 /* Target may be your horse */
7316 /* Aimed on the player */
7317 if (flg & PROJECT_PLAYER)
7319 /* Hit the player with full damage */
7323 * Hack -- When this grid was not the
7324 * original target, a beam or bolt
7325 * would hit either player or mount,
7326 * and should be choosen randomly.
7328 * But already choosen to hit the
7329 * mount at this point.
7331 * Or aimed on your horse.
7333 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
7336 * A beam or bolt is well aimed
7338 * So don't affects the player.
7345 * The spell is not well aimed,
7346 * So partly affect the player too.
7352 /* Affect the player */
7353 if (project_p(who, who_name, effective_dist, y, x, dam, typ, flg, monspell)) notice = TRUE;
7359 GAME_TEXT m_name[MAX_NLEN];
7361 monster_desc(m_name, &m_list[p_ptr->riding], 0);
7363 if (rakubadam_m > 0)
7365 if (rakuba(rakubadam_m, FALSE))
7367 msg_format(_("%^sに振り落とされた!", "%^s has thrown you off!"), m_name);
7370 if (p_ptr->riding && rakubadam_p > 0)
7372 if(rakuba(rakubadam_p, FALSE))
7374 msg_format(_("%^sから落ちてしまった!", "You have fallen from %s."), m_name);
7379 /* Return "something was noticed" */
7384 * @brief 鏡魔法「封魔結界」の効果処理
7386 * @return 効果があったらTRUEを返す
7388 bool binding_field(HIT_POINT dam)
7390 POSITION mirror_x[10], mirror_y[10]; /* 鏡はもっと少ない */
7391 int mirror_num = 0; /* 鏡の数 */
7393 POSITION centersign;
7394 POSITION x1, x2, y1, y2;
7396 int msec = delay_factor*delay_factor*delay_factor;
7399 POSITION point_x[3];
7400 POSITION point_y[3];
7402 /* Default target of monsterspell is player */
7403 monster_target_y = p_ptr->y;
7404 monster_target_x = p_ptr->x;
7406 for (x = 0; x < cur_wid; x++)
7408 for (y = 0; y < cur_hgt; y++)
7410 if (is_mirror_grid(&cave[y][x]) &&
7411 distance(p_ptr->y, p_ptr->x, y, x) <= MAX_RANGE &&
7412 distance(p_ptr->y, p_ptr->x, y, x) != 0 &&
7413 player_has_los_bold(y, x) &&
7414 projectable(p_ptr->y, p_ptr->x, y, x)
7416 mirror_y[mirror_num] = y;
7417 mirror_x[mirror_num] = x;
7423 if (mirror_num < 2)return FALSE;
7425 point_x[0] = randint0(mirror_num);
7427 point_x[1] = randint0(mirror_num);
7428 } while (point_x[0] == point_x[1]);
7430 point_y[0] = mirror_y[point_x[0]];
7431 point_x[0] = mirror_x[point_x[0]];
7432 point_y[1] = mirror_y[point_x[1]];
7433 point_x[1] = mirror_x[point_x[1]];
7434 point_y[2] = p_ptr->y;
7435 point_x[2] = p_ptr->x;
7437 x = point_x[0] + point_x[1] + point_x[2];
7438 y = point_y[0] + point_y[1] + point_y[2];
7440 centersign = (point_x[0] * 3 - x)*(point_y[1] * 3 - y)
7441 - (point_y[0] * 3 - y)*(point_x[1] * 3 - x);
7442 if (centersign == 0)return FALSE;
7444 x1 = point_x[0] < point_x[1] ? point_x[0] : point_x[1];
7445 x1 = x1 < point_x[2] ? x1 : point_x[2];
7446 y1 = point_y[0] < point_y[1] ? point_y[0] : point_y[1];
7447 y1 = y1 < point_y[2] ? y1 : point_y[2];
7449 x2 = point_x[0] > point_x[1] ? point_x[0] : point_x[1];
7450 x2 = x2 > point_x[2] ? x2 : point_x[2];
7451 y2 = point_y[0] > point_y[1] ? point_y[0] : point_y[1];
7452 y2 = y2 > point_y[2] ? y2 : point_y[2];
7454 for (y = y1; y <= y2; y++) {
7455 for (x = x1; x <= x2; x++) {
7456 if (centersign*((point_x[0] - x)*(point_y[1] - y)
7457 - (point_y[0] - y)*(point_x[1] - x)) >= 0 &&
7458 centersign*((point_x[1] - x)*(point_y[2] - y)
7459 - (point_y[1] - y)*(point_x[2] - x)) >= 0 &&
7460 centersign*((point_x[2] - x)*(point_y[0] - y)
7461 - (point_y[2] - y)*(point_x[0] - x)) >= 0)
7463 if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
7464 /* Visual effects */
7466 && panel_contains(y, x)) {
7467 p = bolt_pict(y, x, y, x, GF_MANA);
7468 print_rel(PICT_C(p), PICT_A(p), y, x);
7469 move_cursor_relative(y, x);
7470 /*if (fresh_before)*/ Term_fresh();
7471 Term_xtra(TERM_XTRA_DELAY, msec);
7477 for (y = y1; y <= y2; y++) {
7478 for (x = x1; x <= x2; x++) {
7479 if (centersign*((point_x[0] - x)*(point_y[1] - y)
7480 - (point_y[0] - y)*(point_x[1] - x)) >= 0 &&
7481 centersign*((point_x[1] - x)*(point_y[2] - y)
7482 - (point_y[1] - y)*(point_x[2] - x)) >= 0 &&
7483 centersign*((point_x[2] - x)*(point_y[0] - y)
7484 - (point_y[2] - y)*(point_x[0] - x)) >= 0)
7486 if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
7487 (void)project_f(0, 0, y, x, dam, GF_MANA);
7492 for (y = y1; y <= y2; y++) {
7493 for (x = x1; x <= x2; x++) {
7494 if (centersign*((point_x[0] - x)*(point_y[1] - y)
7495 - (point_y[0] - y)*(point_x[1] - x)) >= 0 &&
7496 centersign*((point_x[1] - x)*(point_y[2] - y)
7497 - (point_y[1] - y)*(point_x[2] - x)) >= 0 &&
7498 centersign*((point_x[2] - x)*(point_y[0] - y)
7499 - (point_y[2] - y)*(point_x[0] - x)) >= 0)
7501 if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
7502 (void)project_o(0, 0, y, x, dam, GF_MANA);
7507 for (y = y1; y <= y2; y++) {
7508 for (x = x1; x <= x2; x++) {
7509 if (centersign*((point_x[0] - x)*(point_y[1] - y)
7510 - (point_y[0] - y)*(point_x[1] - x)) >= 0 &&
7511 centersign*((point_x[1] - x)*(point_y[2] - y)
7512 - (point_y[1] - y)*(point_x[2] - x)) >= 0 &&
7513 centersign*((point_x[2] - x)*(point_y[0] - y)
7514 - (point_y[2] - y)*(point_x[0] - x)) >= 0)
7516 if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
7517 (void)project_m(0, 0, y, x, dam, GF_MANA,
7518 (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP), TRUE);
7524 msg_print(_("鏡が結界に耐えきれず、壊れてしまった。", "The field broke a mirror"));
7525 remove_mirror(point_y[0], point_x[0]);
7532 * @brief 鏡魔法「鏡の封印」の効果処理
7534 * @return 効果があったらTRUEを返す
7536 void seal_of_mirror(HIT_POINT dam)
7540 for (x = 0; x < cur_wid; x++)
7542 for (y = 0; y < cur_hgt; y++)
7544 if (is_mirror_grid(&cave[y][x]))
7546 if (project_m(0, 0, y, x, dam, GF_GENOCIDE,
7547 (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP), TRUE))
7549 if (!cave[y][x].m_idx)
7551 remove_mirror(y, x);
7563 * @brief 領域魔法に応じて技能の名称を返す。
7564 * @param tval 魔法書のtval
7565 * @return 領域魔法の技能名称を保管した文字列ポインタ
7567 concptr spell_category_name(OBJECT_TYPE_VALUE tval)
7571 case TV_HISSATSU_BOOK:
7572 return _("必殺技", "art");
7574 return _("祈り", "prayer");
7576 return _("歌", "song");
7578 return _("呪文", "spell");