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"
33 #include "realm-hex.h"
36 static int rakubadam_m; /*!< 振り落とされた際のダメージ量 */
37 static int rakubadam_p; /*!< 落馬した際のダメージ量 */
39 int project_length = 0; /*!< 投射の射程距離 */
43 * @brief モンスター魅了用セービングスロー共通部(汎用系)
45 * @param m_ptr 対象モンスター
46 * @return 魅了に抵抗したらTRUE
48 static bool_hack common_saving_throw_charm(player_type *player_ptr, HIT_POINT pow, monster_type *m_ptr)
50 monster_race *r_ptr = &r_info[m_ptr->r_idx];
52 if(p_ptr->inside_arena) return TRUE;
55 if (r_ptr->flagsr & RFR_RES_ALL)
57 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
61 if (r_ptr->flags3 & RF3_NO_CONF)
63 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
67 if (r_ptr->flags1 & RF1_QUESTOR || m_ptr->mflag2 & MFLAG2_NOPET) return TRUE;
69 pow += (adj_chr_chm[player_ptr->stat_ind[A_CHR]] - 1);
70 if((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL)) pow = pow * 2 / 3;
71 return (r_ptr->level > randint1((pow - 10) < 1 ? 1 : (pow - 10)) + 5);
75 * @brief モンスター服従用セービングスロー共通部(部族依存系)
77 * @param m_ptr 対象モンスター
78 * @return 服従に抵抗したらTRUE
80 static bool_hack common_saving_throw_control(player_type *player_ptr, HIT_POINT pow, monster_type *m_ptr)
82 monster_race *r_ptr = &r_info[m_ptr->r_idx];
84 if (p_ptr->inside_arena) return TRUE;
87 if (r_ptr->flagsr & RFR_RES_ALL)
89 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
93 if (r_ptr->flags1 & RF1_QUESTOR || m_ptr->mflag2 & MFLAG2_NOPET) return TRUE;
95 pow += adj_chr_chm[player_ptr->stat_ind[A_CHR]] - 1;
96 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL)) pow = pow * 2 / 3;
97 return (r_ptr->level > randint1((pow - 10) < 1 ? 1 : (pow - 10)) + 5);
101 * @brief 一部ボルト魔法のビーム化確率を算出する / Prepare standard probability to become beam for fire_bolt_or_beam()
104 * ハードコーティングによる実装が行われている。
105 * メイジは(レベル)%、ハイメイジ、スペルマスターは(レベル)%、それ以外の職業は(レベル/2)%
107 PERCENTAGE beam_chance(void)
109 if (p_ptr->pclass == CLASS_MAGE)
110 return (PERCENTAGE)(p_ptr->lev);
111 if (p_ptr->pclass == CLASS_HIGH_MAGE || p_ptr->pclass == CLASS_SORCERER)
112 return (PERCENTAGE)(p_ptr->lev + 10);
114 return (PERCENTAGE)(p_ptr->lev / 2);
119 * @brief 配置した鏡リストの次を取得する /
120 * Get another mirror. for SEEKER
121 * @param next_y 次の鏡のy座標を返す参照ポインタ
122 * @param next_x 次の鏡のx座標を返す参照ポインタ
123 * @param cury 現在の鏡のy座標
124 * @param curx 現在の鏡のx座標
126 static void next_mirror(POSITION* next_y, POSITION* next_x, POSITION cury, POSITION curx)
128 POSITION mirror_x[10], mirror_y[10]; /* 鏡はもっと少ない */
129 int mirror_num = 0; /* 鏡の数 */
133 for (x = 0; x < cur_wid; x++)
135 for (y = 0; y < cur_hgt; y++)
137 if (is_mirror_grid(&cave[y][x])) {
138 mirror_y[mirror_num] = y;
139 mirror_x[mirror_num] = x;
146 num = randint0(mirror_num);
147 *next_y = mirror_y[num];
148 *next_x = mirror_x[num];
151 *next_y = cury + randint0(5) - 2;
152 *next_x = curx + randint0(5) - 2;
157 * @brief 万色表現用にランダムな色を選択する関数 /
158 * Get a legal "multi-hued" color for drawing "spells"
162 static TERM_COLOR mh_attr(int max)
164 switch (randint1(max))
166 case 1: return (TERM_RED);
167 case 2: return (TERM_GREEN);
168 case 3: return (TERM_BLUE);
169 case 4: return (TERM_YELLOW);
170 case 5: return (TERM_ORANGE);
171 case 6: return (TERM_VIOLET);
172 case 7: return (TERM_L_RED);
173 case 8: return (TERM_L_GREEN);
174 case 9: return (TERM_L_BLUE);
175 case 10: return (TERM_UMBER);
176 case 11: return (TERM_L_UMBER);
177 case 12: return (TERM_SLATE);
178 case 13: return (TERM_WHITE);
179 case 14: return (TERM_L_WHITE);
180 case 15: return (TERM_L_DARK);
188 * @brief 魔法属性に応じたエフェクトの色を返す /
189 * Return a color to use for the bolt/ball spells
193 static TERM_COLOR spell_color(int type)
195 /* Check if A.B.'s new graphics should be used (rr9) */
196 if (streq(ANGBAND_GRAF, "new") || streq(ANGBAND_GRAF, "ne2"))
201 case GF_PSY_SPEAR: return (0x06);
202 case GF_MISSILE: return (0x0F);
203 case GF_ACID: return (0x04);
204 case GF_ELEC: return (0x02);
205 case GF_FIRE: return (0x00);
206 case GF_COLD: return (0x01);
207 case GF_POIS: return (0x03);
208 case GF_HOLY_FIRE: return (0x00);
209 case GF_HELL_FIRE: return (0x00);
210 case GF_MANA: return (0x0E);
212 case GF_SEEKER: return (0x0E);
213 case GF_SUPER_RAY: return (0x0E);
215 case GF_ARROW: return (0x0F);
216 case GF_WATER: return (0x04);
217 case GF_NETHER: return (0x07);
218 case GF_CHAOS: return (mh_attr(15));
219 case GF_DISENCHANT: return (0x05);
220 case GF_NEXUS: return (0x0C);
221 case GF_CONFUSION: return (mh_attr(4));
222 case GF_SOUND: return (0x09);
223 case GF_SHARDS: return (0x08);
224 case GF_FORCE: return (0x09);
225 case GF_INERTIAL: return (0x09);
226 case GF_GRAVITY: return (0x09);
227 case GF_TIME: return (0x09);
228 case GF_LITE_WEAK: return (0x06);
229 case GF_LITE: return (0x06);
230 case GF_DARK_WEAK: return (0x07);
231 case GF_DARK: return (0x07);
232 case GF_PLASMA: return (0x0B);
233 case GF_METEOR: return (0x00);
234 case GF_ICE: return (0x01);
235 case GF_ROCKET: return (0x0F);
236 case GF_DEATH_RAY: return (0x07);
237 case GF_NUKE: return (mh_attr(2));
238 case GF_DISINTEGRATE: return (0x05);
250 case GF_CAUSE_4: return (0x0E);
251 case GF_HAND_DOOM: return (0x07);
252 case GF_CAPTURE : return (0x0E);
253 case GF_IDENTIFY: return (0x01);
254 case GF_ATTACK: return (0x0F);
255 case GF_PHOTO : return (0x06);
258 /* Normal tiles or ASCII */
264 /* Lookup the default colors for this type */
265 concptr s = quark_str(gf_color[type]);
267 if (!s) return (TERM_WHITE);
269 /* Pick a random color */
270 c = s[randint0(strlen(s))];
272 /* Lookup this color */
273 a = my_strchr(color_char, c) - color_char;
275 /* Invalid color (note check for < 0 removed, gave a silly
276 * warning because bytes are always >= 0 -- RG) */
277 if (a > 15) return (TERM_WHITE);
283 /* Standard "color" */
289 * @brief 始点から終点にかけた方向毎にボルトのキャラクタを返す /
290 * Find the attr/char pair to use for a spell effect
299 * It is moving (or has moved) from (x,y) to (nx,ny).
300 * If the distance is not "one", we (may) return "*".
303 u16b bolt_pict(POSITION y, POSITION x, POSITION ny, POSITION nx, EFFECT_ID typ)
313 if ((ny == y) && (nx == x)) base = 0x30;
316 else if (nx == x) base = 0x40;
319 else if (ny == y) base = 0x50;
322 else if ((ny - y) == (x - nx)) base = 0x60;
325 else if ((ny - y) == (nx - x)) base = 0x70;
330 /* Basic spell color */
331 k = spell_color(typ);
333 /* Obtain attr/char */
334 a = misc_to_attr[base + k];
335 c = misc_to_char[base + k];
344 * Mega-Hack -- track "affected" monsters (see "project()" comments)
346 static int project_m_n; /*!< 魔法効果範囲内にいるモンスターの数 */
347 static POSITION project_m_x; /*!< 処理中のモンスターX座標 */
348 static POSITION project_m_y; /*!< 処理中のモンスターY座標 */
349 /* Mega-Hack -- monsters target */
350 static POSITION monster_target_x; /*!< モンスターの攻撃目標X座標 */
351 static POSITION monster_target_y; /*!< モンスターの攻撃目標Y座標 */
355 * @brief 汎用的なビーム/ボルト/ボール系による地形効果処理 / We are called from "project()" to "damage" terrain features
356 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
357 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
358 * @param y 目標Y座標 / Target y location (or location to travel "towards")
359 * @param x 目標X座標 / Target x location (or location to travel "towards")
360 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
361 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
362 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
365 * We are called both for "beam" effects and "ball" effects.
367 * The "r" parameter is the "distance from ground zero".
369 * Note that we determine if the player can "see" anything that happens
370 * by taking into account: blindness, line-of-sight, and illumination.
372 * We return "TRUE" if the effect of the projection is "obvious".
374 * We also "see" grids which are "memorized", probably a hack
376 * Perhaps we should affect doors?
379 static bool project_f(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ)
381 cave_type *c_ptr = &cave[y][x];
382 feature_type *f_ptr = &f_info[c_ptr->feat];
384 bool obvious = FALSE;
385 bool known = player_has_los_bold(y, x);
390 /* Reduce damage by distance */
391 dam = (dam + r) / (r + 1);
394 if (have_flag(f_ptr->flags, FF_TREE))
402 message = _("枯れた", "was blasted."); break;
404 message = _("縮んだ", "shrank."); break;
406 message = _("溶けた", "melted."); break;
409 message = _("凍り、砕け散った", "was frozen and smashed."); break;
413 message = _("燃えた", "burns up!"); break;
425 message = _("粉砕された", "was crushed."); break;
427 message = NULL; break;
431 msg_format(_("木は%s。", "A tree %s"), message);
432 cave_set_feat(y, x, one_in_(3) ? feat_brake : feat_grass);
435 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
439 /* Analyze the type */
442 /* Ignore most effects */
477 /* Destroy Traps (and Locks) */
480 /* Reveal secret doors */
481 if (is_hidden_door(c_ptr))
486 /* Check line of sight */
494 if (is_trap(c_ptr->feat))
496 /* Check line of sight */
499 msg_print(_("まばゆい閃光が走った!", "There is a bright flash of light!"));
503 /* Destroy the trap */
504 cave_alter_feat(y, x, FF_DISARM);
507 /* Locked doors are unlocked */
508 if (is_closed_door(c_ptr->feat) && f_ptr->power && have_flag(f_ptr->flags, FF_OPEN))
510 s16b old_feat = c_ptr->feat;
512 /* Unlock the door */
513 cave_alter_feat(y, x, FF_DISARM);
515 /* Check line of sound */
516 if (known && (old_feat != c_ptr->feat))
518 msg_print(_("カチッと音がした!", "Click!"));
523 /* Remove "unsafe" flag if player is not blind */
524 if (!p_ptr->blind && player_has_los_bold(y, x))
526 c_ptr->info &= ~(CAVE_UNSAFE);
534 /* Destroy Doors (and traps) */
537 /* Destroy all doors and traps */
538 if (is_trap(c_ptr->feat) || have_flag(f_ptr->flags, FF_DOOR))
540 /* Check line of sight */
543 msg_print(_("まばゆい閃光が走った!", "There is a bright flash of light!"));
547 /* Destroy the feature */
548 cave_alter_feat(y, x, FF_TUNNEL);
551 /* Remove "unsafe" flag if player is not blind */
552 if (!p_ptr->blind && player_has_los_bold(y, x))
554 c_ptr->info &= ~(CAVE_UNSAFE);
562 case GF_JAM_DOOR: /* Jams a door (as if with a spike) */
564 if (have_flag(f_ptr->flags, FF_SPIKE))
566 s16b old_mimic = c_ptr->mimic;
567 feature_type *mimic_f_ptr = &f_info[get_feat_mimic(c_ptr)];
569 cave_alter_feat(y, x, FF_SPIKE);
570 c_ptr->mimic = old_mimic;
575 /* Check line of sight */
576 if (known && have_flag(mimic_f_ptr->flags, FF_OPEN))
578 msg_format(_("%sに何かがつっかえて開かなくなった。", "The %s seems stuck."), f_name + mimic_f_ptr->name);
585 /* Destroy walls (and doors) */
588 if (have_flag(f_ptr->flags, FF_HURT_ROCK))
590 if (known && (c_ptr->info & (CAVE_MARK)))
592 msg_format(_("%sが溶けて泥になった!", "The %s turns into mud!"), f_name + f_info[get_feat_mimic(c_ptr)].name);
596 /* Destroy the wall */
597 cave_alter_feat(y, x, FF_HURT_ROCK);
599 /* Update some things */
600 p_ptr->update |= (PU_FLOW);
609 /* Require a "naked" floor grid */
610 if (!cave_naked_bold(y, x)) break;
612 /* Not on the player */
613 if (player_bold(y, x)) break;
615 /* Create a closed door */
616 cave_set_feat(y, x, feat_door[DOOR_DOOR].closed);
619 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
636 /* Require a "naked" floor grid */
637 if (!cave_naked_bold(y, x)) break;
639 /* Not on the player */
640 if (player_bold(y, x)) break;
642 /* Create a closed door */
643 cave_set_feat(y, x, feat_tree);
646 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
654 /* Require a "naked" floor grid */
655 if (!cave_naked_bold(y, x)) break;
658 c_ptr->info |= CAVE_OBJECT;
659 c_ptr->mimic = feat_glyph;
670 /* Require a "naked" floor grid */
671 if (!cave_naked_bold(y, x)) break;
673 /* Not on the player */
674 if (player_bold(y, x)) break;
677 cave_set_feat(y, x, feat_granite);
685 /* Ignore permanent grid */
686 if (have_flag(f_ptr->flags, FF_PERMANENT)) break;
691 /* Ignore grid without enough space */
692 if (!have_flag(f_ptr->flags, FF_FLOOR)) break;
694 /* Place a shallow lava */
695 cave_set_feat(y, x, feat_shallow_lava);
700 /* Place a deep lava */
701 cave_set_feat(y, x, feat_deep_lava);
708 /* Ignore permanent grid */
709 if (have_flag(f_ptr->flags, FF_PERMANENT)) break;
714 /* Ignore grid without enough space */
715 if (!have_flag(f_ptr->flags, FF_FLOOR)) break;
717 /* Place a shallow water */
718 cave_set_feat(y, x, feat_shallow_water);
723 /* Place a deep water */
724 cave_set_feat(y, x, feat_deep_water);
729 /* Lite up the grid */
733 /* Turn on the light */
734 if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS))
736 c_ptr->info |= (CAVE_GLOW);
739 update_local_illumination(y, x);
742 if (player_can_see_bold(y, x)) obvious = TRUE;
744 /* Mega-Hack -- Update the monster in the affected grid */
745 /* This allows "spear of light" (etc) to work "correctly" */
746 if (c_ptr->m_idx) update_monster(c_ptr->m_idx, FALSE);
748 if (p_ptr->special_defense & NINJA_S_STEALTH)
750 if (player_bold(y, x)) set_superstealth(FALSE);
757 /* Darken the grid */
761 bool do_dark = !p_ptr->inside_battle && !is_mirror_grid(c_ptr);
764 /* Turn off the light. */
767 if (dun_level || !is_daytime())
769 for (j = 0; j < 9; j++)
771 int by = y + ddy_ddd[j];
772 int bx = x + ddx_ddd[j];
774 if (in_bounds2(by, bx))
776 cave_type *cc_ptr = &cave[by][bx];
778 if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
789 c_ptr->info &= ~(CAVE_GLOW);
791 /* Hack -- Forget "boring" grids */
792 if (!have_flag(f_ptr->flags, FF_REMEMBER))
795 c_ptr->info &= ~(CAVE_MARK);
802 update_local_illumination(y, x);
804 if (player_can_see_bold(y, x)) obvious = TRUE;
806 /* Mega-Hack -- Update the monster in the affected grid */
807 /* This allows "spear of light" (etc) to work "correctly" */
808 if (c_ptr->m_idx) update_monster(c_ptr->m_idx, FALSE);
818 if (is_mirror_grid(c_ptr))
820 msg_print(_("鏡が割れた!", "The mirror was crashed!"));
823 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
826 if (have_flag(f_ptr->flags, FF_GLASS) && !have_flag(f_ptr->flags, FF_PERMANENT) && (dam >= 50))
828 if (known && (c_ptr->info & CAVE_MARK))
830 msg_format(_("%sが割れた!", "The %s was crashed!"), f_name + f_info[get_feat_mimic(c_ptr)].name);
834 /* Destroy the wall */
835 cave_alter_feat(y, x, FF_HURT_ROCK);
837 /* Update some things */
838 p_ptr->update |= (PU_FLOW);
845 if (is_mirror_grid(c_ptr) && p_ptr->lev < 40)
847 msg_print(_("鏡が割れた!", "The mirror was crashed!"));
850 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
853 if (have_flag(f_ptr->flags, FF_GLASS) && !have_flag(f_ptr->flags, FF_PERMANENT) && (dam >= 200))
855 if (known && (c_ptr->info & CAVE_MARK))
857 msg_format(_("%sが割れた!", "The %s was crashed!"), f_name + f_info[get_feat_mimic(c_ptr)].name);
861 /* Destroy the wall */
862 cave_alter_feat(y, x, FF_HURT_ROCK);
864 /* Update some things */
865 p_ptr->update |= (PU_FLOW);
870 case GF_DISINTEGRATE:
872 /* Destroy mirror/glyph */
873 if (is_mirror_grid(c_ptr) || is_glyph_grid(c_ptr) || is_explosive_rune_grid(c_ptr))
876 /* Permanent features don't get effect */
877 /* But not protect monsters and other objects */
878 if (have_flag(f_ptr->flags, FF_HURT_DISI) && !have_flag(f_ptr->flags, FF_PERMANENT))
880 cave_alter_feat(y, x, FF_HURT_DISI);
882 /* Update some things -- similar to GF_KILL_WALL */
883 p_ptr->update |= (PU_FLOW);
890 /* Return "Anything seen?" */
897 * @brief 汎用的なビーム/ボルト/ボール系によるアイテムオブジェクトへの効果処理 / Handle a beam/bolt/ball causing damage to a monster.
898 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
899 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
900 * @param y 目標Y座標 / Target y location (or location to travel "towards")
901 * @param x 目標X座標 / Target x location (or location to travel "towards")
902 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
903 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
904 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
907 * We are called from "project()" to "damage" objects
909 * We are called both for "beam" effects and "ball" effects.
911 * Perhaps we should only SOMETIMES damage things on the ground.
913 * The "r" parameter is the "distance from ground zero".
915 * Note that we determine if the player can "see" anything that happens
916 * by taking into account: blindness, line-of-sight, and illumination.
918 * We also "see" grids which are "memorized", probably a hack
920 * We return "TRUE" if the effect of the projection is "obvious".
923 static bool project_o(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ)
925 cave_type *c_ptr = &cave[y][x];
927 OBJECT_IDX this_o_idx, next_o_idx = 0;
929 bool obvious = FALSE;
930 bool known = player_has_los_bold(y, x);
932 BIT_FLAGS flgs[TR_FLAG_SIZE];
934 GAME_TEXT o_name[MAX_NLEN];
936 KIND_OBJECT_IDX k_idx = 0;
937 bool is_potion = FALSE;
942 /* Reduce damage by distance */
943 dam = (dam + r) / (r + 1);
946 /* Scan all objects in the grid */
947 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
949 object_type *o_ptr = &o_list[this_o_idx];
953 bool do_kill = FALSE;
955 concptr note_kill = NULL;
958 /* Get the "plural"-ness */
959 bool plural = (o_ptr->number > 1);
962 /* Acquire next object */
963 next_o_idx = o_ptr->next_o_idx;
964 object_flags(o_ptr, flgs);
966 /* Check for artifact */
967 if (object_is_artifact(o_ptr)) is_art = TRUE;
969 /* Analyze the type */
972 /* Acid -- Lots of things */
975 if (hates_acid(o_ptr))
978 note_kill = _("融けてしまった!", (plural ? " melt!" : " melts!"));
979 if (have_flag(flgs, TR_IGNORE_ACID)) ignore = TRUE;
984 /* Elec -- Rings and Wands */
987 if (hates_elec(o_ptr))
990 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
991 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
996 /* Fire -- Flammable objects */
999 if (hates_fire(o_ptr))
1002 note_kill = _("燃えてしまった!", (plural ? " burn up!" : " burns up!"));
1003 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1008 /* Cold -- potions and flasks */
1011 if (hates_cold(o_ptr))
1013 note_kill = _("砕け散ってしまった!", (plural ? " shatter!" : " shatters!"));
1015 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1023 if (hates_fire(o_ptr))
1026 note_kill = _("燃えてしまった!", (plural ? " burn up!" : " burns up!"));
1027 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1029 if (hates_elec(o_ptr))
1033 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
1034 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1042 if (hates_fire(o_ptr))
1045 note_kill = _("燃えてしまった!", (plural ? " burn up!" : " burns up!"));
1046 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1048 if (hates_cold(o_ptr))
1052 note_kill = _("砕け散ってしまった!", (plural ? " shatter!" : " shatters!"));
1053 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1058 /* Hack -- break potions and such */
1064 if (hates_cold(o_ptr))
1066 note_kill = _("砕け散ってしまった!", (plural ? " shatter!" : " shatters!"));
1072 /* Mana and Chaos -- destroy everything */
1078 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
1082 case GF_DISINTEGRATE:
1085 note_kill = _("蒸発してしまった!", (plural ? " evaporate!" : " evaporates!"));
1092 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
1093 if (have_flag(flgs, TR_RES_CHAOS)) ignore = TRUE;
1094 else if ((o_ptr->tval == TV_SCROLL) && (o_ptr->sval == SV_SCROLL_CHAOS)) ignore = TRUE;
1098 /* Holy Fire and Hell Fire -- destroys cursed non-artifacts */
1102 if (object_is_cursed(o_ptr))
1105 note_kill = _("壊れてしまった!", (plural ? " are destroyed!" : " is destroyed!"));
1112 identify_item(o_ptr);
1114 /* Auto-inscription */
1115 autopick_alter_item((-this_o_idx), FALSE);
1123 /* Chests are noticed only if trapped or locked */
1124 if (o_ptr->tval == TV_CHEST)
1126 /* Disarm/Unlock traps */
1127 if (o_ptr->pval > 0)
1129 /* Disarm or Unlock */
1130 o_ptr->pval = (0 - o_ptr->pval);
1133 object_known(o_ptr);
1135 if (known && (o_ptr->marked & OM_FOUND))
1137 msg_print(_("カチッと音がした!", "Click!"));
1147 if (o_ptr->tval == TV_CORPSE)
1150 BIT_FLAGS mode = 0L;
1152 if (!who || is_pet(&m_list[who]))
1153 mode |= PM_FORCE_PET;
1155 for (i = 0; i < o_ptr->number ; i++)
1157 if (((o_ptr->sval == SV_CORPSE) && (randint1(100) > 80)) ||
1158 ((o_ptr->sval == SV_SKELETON) && (randint1(100) > 60)))
1162 note_kill = _("灰になった。", (plural ? " become dust." : " becomes dust."));
1166 else if (summon_named_creature(who, y, x, o_ptr->pval, mode))
1168 note_kill = _("生き返った。", " revived.");
1170 else if (!note_kill)
1172 note_kill = _("灰になった。", (plural ? " become dust." : " becomes dust."));
1183 /* Attempt to destroy the object */
1186 /* Effect "observed" */
1187 if (known && (o_ptr->marked & OM_FOUND))
1190 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
1193 /* Artifacts, and other objects, get to resist */
1194 if (is_art || ignore)
1196 /* Observe the resist */
1197 if (known && (o_ptr->marked & OM_FOUND))
1199 msg_format(_("%sは影響を受けない!",
1200 (plural ? "The %s are unaffected!" : "The %s is unaffected!")), o_name);
1207 /* Describe if needed */
1208 if (known && (o_ptr->marked & OM_FOUND) && note_kill)
1210 msg_format(_("%sは%s", "The %s%s"), o_name, note_kill);
1213 k_idx = o_ptr->k_idx;
1214 is_potion = object_is_potion(o_ptr);
1215 delete_object_idx(this_o_idx);
1217 /* Potions produce effects when 'shattered' */
1220 (void)potion_smash_effect(who, y, x, k_idx);
1228 /* Return "Anything seen?" */
1234 * @brief 汎用的なビーム/ボルト/ボール系によるモンスターへの効果処理 / Handle a beam/bolt/ball causing damage to a monster.
1235 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
1236 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
1237 * @param y 目標Y座標 / Target y location (or location to travel "towards")
1238 * @param x 目標X座標 / Target x location (or location to travel "towards")
1239 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
1240 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
1242 * @param see_s_msg TRUEならばメッセージを表示する
1243 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
1246 * This routine takes a "source monster" (by index) which is mostly used to
1247 * determine if the player is causing the damage, and a "radius" (see below),
1248 * which is used to decrease the power of explosions with distance, and a
1249 * location, via integers which are modified by certain types of attacks
1250 * (polymorph and teleport being the obvious ones), a default damage, which
1251 * is modified as needed based on various properties, and finally a "damage
1252 * type" (see below).
1255 * Note that this routine can handle "no damage" attacks (like teleport) by
1256 * taking a "zero" damage, and can even take "parameters" to attacks (like
1257 * confuse) by accepting a "damage", using it to calculate the effect, and
1258 * then setting the damage to zero. Note that the "damage" parameter is
1259 * divided by the radius, so monsters not at the "epicenter" will not take
1260 * as much damage (or whatever)...
1263 * Note that "polymorph" is dangerous, since a failure in "place_monster()"'
1264 * may result in a dereference of an invalid pointer.
1267 * Various messages are produced, and damage is applied.
1270 * Just "casting" a substance (i.e. plasma) does not make you immune, you must
1271 * actually be "made" of that substance, or "breathe" big balls of it.
1272 * We assume that "Plasma" monsters, and "Plasma" breathers, are immune
1274 * We assume "Nether" is an evil, necromantic force, so it doesn't hurt undead,
1275 * and hurts evil less. If can breath nether, then it resists it as well.
1278 * Damage reductions use the following formulas:
1279 * Note that "dam = dam * 6 / (randint1(6) + 6);"
1280 * gives avg damage of .655, ranging from .858 to .500
1281 * Note that "dam = dam * 5 / (randint1(6) + 6);"
1282 * gives avg damage of .544, ranging from .714 to .417
1283 * Note that "dam = dam * 4 / (randint1(6) + 6);"
1284 * gives avg damage of .444, ranging from .556 to .333
1285 * Note that "dam = dam * 3 / (randint1(6) + 6);"
1286 * gives avg damage of .327, ranging from .427 to .250
1287 * Note that "dam = dam * 2 / (randint1(6) + 6);"
1288 * gives something simple.
1291 * In this function, "result" messages are postponed until the end, where
1292 * the "note" string is appended to the monster name, if not NULL. So,
1293 * to make a spell have "no effect" just set "note" to NULL. You should
1294 * also set "notice" to FALSE, or the player will learn what the spell does.
1297 * We attempt to return "TRUE" if the player saw anything "useful" happen.
1301 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)
1305 cave_type *c_ptr = &cave[y][x];
1307 monster_type *m_ptr = &m_list[c_ptr->m_idx];
1308 monster_type *caster_ptr = (who > 0) ? &m_list[who] : NULL;
1310 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1314 /* Is the monster "seen"? */
1315 bool seen = m_ptr->ml;
1316 bool seen_msg = is_seen(m_ptr);
1318 bool slept = (bool)MON_CSLEEP(m_ptr);
1320 /* Were the effects "obvious" (if seen)? */
1321 bool obvious = FALSE;
1323 /* Can the player know about this effect? */
1324 bool known = ((m_ptr->cdis <= MAX_SIGHT) || p_ptr->inside_battle);
1326 /* Were the effects "irrelevant"? */
1327 bool skipped = FALSE;
1329 /* Gets the monster angry at the source of the effect? */
1330 bool get_angry = FALSE;
1332 /* Polymorph setting (true or false) */
1333 bool do_poly = FALSE;
1335 /* Teleport setting (max distance) */
1338 /* Confusion setting (amount to confuse) */
1341 /* Stunning setting (amount to stun) */
1344 /* Sleep amount (amount to sleep) */
1347 /* Fear amount (amount to fear) */
1350 /* Time amount (amount to time) */
1353 bool heal_leper = FALSE;
1355 /* Hold the monster name */
1356 GAME_TEXT m_name[MAX_NLEN];
1359 PARAMETER_VALUE photo = 0;
1361 /* Assume no note */
1362 concptr note = NULL;
1364 /* Assume a default death */
1365 concptr note_dies = extract_note_dies(real_r_idx(m_ptr));
1367 POSITION ty = m_ptr->fy;
1368 POSITION tx = m_ptr->fx;
1370 DEPTH caster_lev = (who > 0) ? r_info[caster_ptr->r_idx].level : (p_ptr->lev * 2);
1373 if (!c_ptr->m_idx) return (FALSE);
1375 /* Never affect projector */
1376 if (who && (c_ptr->m_idx == who)) return (FALSE);
1377 if ((c_ptr->m_idx == p_ptr->riding) && !who && !(typ == GF_OLD_HEAL) && !(typ == GF_OLD_SPEED) && !(typ == GF_STAR_HEAL)) return (FALSE);
1378 if (sukekaku && ((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) return FALSE;
1380 /* Don't affect already death monsters */
1381 /* Prevents problems with chain reactions of exploding monsters */
1382 if (m_ptr->hp < 0) return (FALSE);
1384 /* Reduce damage by distance */
1385 dam = (dam + r) / (r + 1);
1388 /* Get the monster name (BEFORE polymorphing) */
1389 monster_desc(m_name, m_ptr, 0);
1391 /* Get the monster possessive ("his"/"her"/"its") */
1392 monster_desc(m_poss, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE);
1394 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) disturb(TRUE, TRUE);
1396 /* Analyze the damage type */
1399 /* Magic Missile -- pure damage */
1402 if (seen) obvious = TRUE;
1404 if (r_ptr->flagsr & RFR_RES_ALL)
1406 note = _("には完全な耐性がある!", " is immune.");
1408 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1417 if (seen) obvious = TRUE;
1419 if (r_ptr->flagsr & RFR_RES_ALL)
1421 note = _("には完全な耐性がある!", " is immune.");
1423 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1426 if (r_ptr->flagsr & RFR_IM_ACID)
1428 note = _("にはかなり耐性がある!", " resists a lot.");
1430 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ACID);
1438 if (seen) obvious = TRUE;
1440 if (r_ptr->flagsr & RFR_RES_ALL)
1442 note = _("には完全な耐性がある!", " is immune.");
1444 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1447 if (r_ptr->flagsr & RFR_IM_ELEC)
1449 note = _("にはかなり耐性がある!", " resists a lot.");
1451 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ELEC);
1459 if (seen) obvious = TRUE;
1461 if (r_ptr->flagsr & RFR_RES_ALL)
1463 note = _("には完全な耐性がある!", " is immune.");
1465 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1468 if (r_ptr->flagsr & RFR_IM_FIRE)
1470 note = _("にはかなり耐性がある!", " resists a lot.");
1472 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_FIRE);
1474 else if (r_ptr->flags3 & (RF3_HURT_FIRE))
1476 note = _("はひどい痛手をうけた。", " is hit hard.");
1478 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_FIRE);
1486 if (seen) obvious = TRUE;
1488 if (r_ptr->flagsr & RFR_RES_ALL)
1490 note = _("には完全な耐性がある!", " is immune.");
1492 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1495 if (r_ptr->flagsr & RFR_IM_COLD)
1497 note = _("にはかなり耐性がある!", " resists a lot.");
1499 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
1501 else if (r_ptr->flags3 & (RF3_HURT_COLD))
1503 note = _("はひどい痛手をうけた。", " is hit hard.");
1505 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
1513 if (seen) obvious = TRUE;
1515 if (r_ptr->flagsr & RFR_RES_ALL)
1517 note = _("には完全な耐性がある!", " is immune.");
1519 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1522 if (r_ptr->flagsr & RFR_IM_POIS)
1524 note = _("にはかなり耐性がある!", " resists a lot.");
1526 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1534 if (seen) obvious = TRUE;
1536 if (r_ptr->flagsr & RFR_RES_ALL)
1538 note = _("には完全な耐性がある!", " is immune.");
1540 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1543 if (r_ptr->flagsr & RFR_IM_POIS)
1545 note = _("には耐性がある。", " resists.");
1546 dam *= 3; dam /= randint1(6) + 6;
1547 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1549 else if (one_in_(3)) do_poly = TRUE;
1553 /* Hellfire -- hurts Evil */
1556 if (seen) obvious = TRUE;
1558 if (r_ptr->flagsr & RFR_RES_ALL)
1560 note = _("には完全な耐性がある!", " is immune.");
1562 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1565 if (r_ptr->flags3 & RF3_GOOD)
1567 note = _("はひどい痛手をうけた。", " is hit hard.");
1569 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
1574 /* Holy Fire -- hurts Evil, Good are immune, others _resist_ */
1577 if (seen) obvious = TRUE;
1579 if (r_ptr->flagsr & RFR_RES_ALL)
1581 note = _("には完全な耐性がある!", " is immune.");
1583 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1586 if (r_ptr->flags3 & RF3_GOOD)
1588 note = _("には完全な耐性がある!", " is immune.");
1590 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_GOOD;
1592 else if (r_ptr->flags3 & RF3_EVIL)
1595 note = _("はひどい痛手をうけた。", " is hit hard.");
1596 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_EVIL;
1600 note = _("には耐性がある。", " resists.");
1601 dam *= 3; dam /= randint1(6) + 6;
1606 /* Arrow -- XXX no defense */
1609 if (seen) obvious = TRUE;
1611 if (r_ptr->flagsr & RFR_RES_ALL)
1613 note = _("には完全な耐性がある!", " is immune.");
1615 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1621 /* Plasma -- XXX perhaps check ELEC or FIRE */
1624 if (seen) obvious = TRUE;
1626 if (r_ptr->flagsr & RFR_RES_ALL)
1628 note = _("には完全な耐性がある!", " is immune.");
1630 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1633 if (r_ptr->flagsr & RFR_RES_PLAS)
1635 note = _("には耐性がある。", " resists.");
1636 dam *= 3; dam /= randint1(6) + 6;
1637 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_PLAS);
1642 /* Nether -- see above */
1645 if (seen) obvious = TRUE;
1647 if (r_ptr->flagsr & RFR_RES_ALL)
1649 note = _("には完全な耐性がある!", " is immune.");
1651 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1654 if (r_ptr->flagsr & RFR_RES_NETH)
1656 if (r_ptr->flags3 & RF3_UNDEAD)
1658 note = _("には完全な耐性がある!", " is immune.");
1660 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
1664 note = _("には耐性がある。", " resists.");
1665 dam *= 3; dam /= randint1(6) + 6;
1667 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NETH);
1669 else if (r_ptr->flags3 & RF3_EVIL)
1671 note = _("はいくらか耐性を示した。", " resists somewhat.");
1673 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
1678 /* Water (acid) damage -- Water spirits/elementals are immune */
1681 if (seen) obvious = TRUE;
1683 if (r_ptr->flagsr & RFR_RES_ALL)
1685 note = _("には完全な耐性がある!", " is immune.");
1687 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1690 if (r_ptr->flagsr & RFR_RES_WATE)
1692 if ((m_ptr->r_idx == MON_WATER_ELEM) || (m_ptr->r_idx == MON_UNMAKER))
1694 note = _("には完全な耐性がある!", " is immune.");
1699 note = _("には耐性がある。", " resists.");
1700 dam *= 3; dam /= randint1(6) + 6;
1702 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WATE);
1707 /* Chaos -- Chaos breathers resist */
1710 if (seen) obvious = TRUE;
1712 if (r_ptr->flagsr & RFR_RES_ALL)
1714 note = _("には完全な耐性がある!", " is immune.");
1716 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1719 if (r_ptr->flagsr & RFR_RES_CHAO)
1721 note = _("には耐性がある。", " resists.");
1722 dam *= 3; dam /= randint1(6) + 6;
1723 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_CHAO);
1725 else if ((r_ptr->flags3 & RF3_DEMON) && one_in_(3))
1727 note = _("はいくらか耐性を示した。", " resists somewhat.");
1728 dam *= 3; dam /= randint1(6) + 6;
1729 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
1734 do_conf = (5 + randint1(11) + r) / (r + 1);
1739 /* Shards -- Shard breathers resist */
1742 if (seen) obvious = TRUE;
1744 if (r_ptr->flagsr & RFR_RES_ALL)
1746 note = _("には完全な耐性がある!", " is immune.");
1748 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1751 if (r_ptr->flagsr & RFR_RES_SHAR)
1753 note = _("には耐性がある。", " resists.");
1754 dam *= 3; dam /= randint1(6) + 6;
1755 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
1760 /* Rocket: Shard resistance helps */
1763 if (seen) obvious = TRUE;
1765 if (r_ptr->flagsr & RFR_RES_ALL)
1767 note = _("には完全な耐性がある!", " is immune.");
1769 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1772 if (r_ptr->flagsr & RFR_RES_SHAR)
1774 note = _("はいくらか耐性を示した。", " resists somewhat.");
1776 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
1782 /* Sound -- Sound breathers resist */
1785 if (seen) obvious = TRUE;
1787 if (r_ptr->flagsr & RFR_RES_ALL)
1789 note = _("には完全な耐性がある!", " is immune.");
1791 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1794 if (r_ptr->flagsr & RFR_RES_SOUN)
1796 note = _("には耐性がある。", " resists.");
1797 dam *= 2; dam /= randint1(6) + 6;
1798 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SOUN);
1800 else do_stun = (10 + randint1(15) + r) / (r + 1);
1807 if (seen) obvious = TRUE;
1809 if (r_ptr->flagsr & RFR_RES_ALL)
1811 note = _("には完全な耐性がある!", " is immune.");
1813 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1816 if (r_ptr->flags3 & RF3_NO_CONF)
1818 note = _("には耐性がある。", " resists.");
1819 dam *= 3; dam /= randint1(6) + 6;
1820 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
1822 else do_conf = (10 + randint1(15) + r) / (r + 1);
1826 /* Disenchantment -- Breathers and Disenchanters resist */
1829 if (seen) obvious = TRUE;
1831 if (r_ptr->flagsr & RFR_RES_ALL)
1833 note = _("には完全な耐性がある!", " is immune.");
1835 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1838 if (r_ptr->flagsr & RFR_RES_DISE)
1840 note = _("には耐性がある。", " resists.");
1841 dam *= 3; dam /= randint1(6) + 6;
1842 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DISE);
1847 /* Nexus -- Breathers and Existers resist */
1850 if (seen) obvious = TRUE;
1852 if (r_ptr->flagsr & RFR_RES_ALL)
1854 note = _("には完全な耐性がある!", " is immune.");
1856 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1859 if (r_ptr->flagsr & RFR_RES_NEXU)
1861 note = _("には耐性がある。", " resists.");
1862 dam *= 3; dam /= randint1(6) + 6;
1863 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NEXU);
1871 if (seen) obvious = TRUE;
1873 if (r_ptr->flagsr & RFR_RES_ALL)
1875 note = _("には完全な耐性がある!", " is immune.");
1877 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1880 if (r_ptr->flagsr & RFR_RES_WALL)
1882 note = _("には耐性がある。", " resists.");
1883 dam *= 3; dam /= randint1(6) + 6;
1884 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WALL);
1886 else do_stun = (randint1(15) + r) / (r + 1);
1890 /* Inertia -- breathers resist */
1893 if (seen) obvious = TRUE;
1895 if (r_ptr->flagsr & RFR_RES_ALL)
1897 note = _("には完全な耐性がある!", " is immune.");
1899 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1902 if (r_ptr->flagsr & RFR_RES_INER)
1904 note = _("には耐性がある。", " resists.");
1905 dam *= 3; dam /= randint1(6) + 6;
1906 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_INER);
1910 /* Powerful monsters can resist */
1911 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
1912 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
1916 /* Normal monsters slow down */
1919 if (set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 50))
1921 note = _("の動きが遅くなった。", " starts moving slower.");
1928 /* Time -- breathers resist */
1931 if (seen) obvious = TRUE;
1933 if (r_ptr->flagsr & RFR_RES_ALL)
1935 note = _("には完全な耐性がある!", " is immune.");
1937 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1940 if (r_ptr->flagsr & RFR_RES_TIME)
1942 note = _("には耐性がある。", " resists.");
1943 dam *= 3; dam /= randint1(6) + 6;
1944 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_TIME);
1946 else do_time = (dam + 1) / 2;
1950 /* Gravity -- breathers resist */
1953 bool resist_tele = FALSE;
1955 if (seen) obvious = TRUE;
1957 if (r_ptr->flagsr & RFR_RES_ALL)
1959 note = _("には完全な耐性がある!", " is immune.");
1961 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1964 if (r_ptr->flagsr & RFR_RES_TELE)
1966 if (r_ptr->flags1 & (RF1_UNIQUE))
1968 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
1969 note = _("には効果がなかった。", " is unaffected!");
1972 else if (r_ptr->level > randint1(100))
1974 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
1975 note = _("には耐性がある!", " resists!");
1980 if (!resist_tele) do_dist = 10;
1982 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
1984 if (r_ptr->flagsr & RFR_RES_GRAV)
1986 note = _("には耐性がある!", " resists!");
1987 dam *= 3; dam /= randint1(6) + 6;
1989 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_GRAV);
1994 /* Powerful monsters can resist */
1995 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
1996 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2000 /* Normal monsters slow down */
2003 if (set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 50))
2005 note = _("の動きが遅くなった。", " starts moving slower.");
2010 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
2012 /* Attempt a saving throw */
2013 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2014 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2018 /* No obvious effect */
2019 note = _("には効果がなかった。", " is unaffected!");
2031 if (seen) obvious = TRUE;
2033 if (r_ptr->flagsr & RFR_RES_ALL)
2035 note = _("には完全な耐性がある!", " is immune.");
2037 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2045 case GF_DISINTEGRATE:
2047 if (seen) obvious = TRUE;
2049 if (r_ptr->flagsr & RFR_RES_ALL)
2051 note = _("には完全な耐性がある!", " is immune.");
2053 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2056 if (r_ptr->flags3 & RF3_HURT_ROCK)
2058 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
2059 note = _("の皮膚がただれた!", " loses some skin!");
2060 note_dies = _("は蒸発した!", " evaporates!");
2068 if (seen) obvious = TRUE;
2070 /* PSI only works if the monster can see you! -- RG */
2071 if (!(los(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x)))
2074 msg_format(_("%sはあなたが見えないので影響されない!", "%^s can't see you, and isn't affected!"), m_name);
2079 if (r_ptr->flagsr & RFR_RES_ALL)
2081 note = _("には完全な耐性がある!", " is immune.");
2083 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2086 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2089 note = _("には完全な耐性がある!", " is immune.");
2090 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
2093 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2094 (r_ptr->flags3 & RF3_ANIMAL) ||
2095 (r_ptr->level > randint1(3 * dam)))
2097 note = _("には耐性がある!", " resists!");
2101 * Powerful demons & undead can turn a mindcrafter's
2102 * attacks back on them
2104 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2105 (r_ptr->level > p_ptr->lev / 2) &&
2109 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
2110 (seen ? "%^s's corrupted mind backlashes your attack!" :
2111 "%^ss corrupted mind backlashes your attack!")), m_name);
2114 if ((randint0(100 + r_ptr->level / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
2116 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
2120 /* Injure +/- confusion */
2121 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
2122 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2123 if (one_in_(4) && !CHECK_MULTISHADOW())
2125 switch (randint1(4))
2128 set_confused(p_ptr->confused + 3 + randint1(dam));
2131 set_stun(p_ptr->stun + randint1(dam));
2135 if (r_ptr->flags3 & RF3_NO_FEAR)
2136 note = _("には効果がなかった。", " is unaffected.");
2138 set_afraid(p_ptr->afraid + 3 + randint1(dam));
2142 if (!p_ptr->free_act)
2143 (void)set_paralyzed(p_ptr->paralyzed + randint1(dam));
2152 if ((dam > 0) && one_in_(4))
2154 switch (randint1(4))
2157 do_conf = 3 + randint1(dam);
2160 do_stun = 3 + randint1(dam);
2163 do_fear = 3 + randint1(dam);
2166 note = _("は眠り込んでしまった!", " falls asleep!");
2167 do_sleep = 3 + randint1(dam);
2172 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
2178 if (seen) obvious = TRUE;
2180 if (r_ptr->flagsr & RFR_RES_ALL)
2182 note = _("には完全な耐性がある!", " is immune.");
2184 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2187 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2190 note = _("には完全な耐性がある!", " is immune.");
2192 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2193 (r_ptr->flags3 & RF3_ANIMAL) ||
2194 (r_ptr->level > randint1(3 * dam)))
2196 note = _("には耐性がある!", " resists!");
2200 * Powerful demons & undead can turn a mindcrafter's
2201 * attacks back on them
2203 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2204 (r_ptr->level > p_ptr->lev / 2) &&
2208 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
2209 (seen ? "%^s's corrupted mind backlashes your attack!" :
2210 "%^ss corrupted mind backlashes your attack!")), m_name);
2212 if ((randint0(100 + r_ptr->level / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
2214 msg_print(_("あなたは効力を跳ね返した!", "You resist the effects!"));
2218 /* Injure + mana drain */
2219 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
2220 if (!CHECK_MULTISHADOW())
2222 msg_print(_("超能力パワーを吸いとられた!", "Your psychic energy is drained!"));
2223 p_ptr->csp -= damroll(5, dam) / 2;
2224 if (p_ptr->csp < 0) p_ptr->csp = 0;
2225 p_ptr->redraw |= PR_MANA;
2226 p_ptr->window |= (PW_SPELL);
2228 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2235 int b = damroll(5, dam) / 4;
2236 concptr str = (p_ptr->pclass == CLASS_MINDCRAFTER) ? _("超能力パワー", "psychic energy") : _("魔力", "mana");
2237 concptr msg = _("あなたは%sの苦痛を%sに変換した!",
2238 (seen ? "You convert %s's pain into %s!" :
2239 "You convert %ss pain into %s!"));
2240 msg_format(msg, m_name, str);
2242 b = MIN(p_ptr->msp, p_ptr->csp + b);
2244 p_ptr->redraw |= PR_MANA;
2245 p_ptr->window |= (PW_SPELL);
2247 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
2251 case GF_TELEKINESIS:
2253 if (seen) obvious = TRUE;
2255 if (r_ptr->flagsr & RFR_RES_ALL)
2257 note = _("には完全な耐性がある!", " is immune.");
2259 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2264 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
2269 do_stun = damroll((caster_lev / 20) + 3 , dam) + 1;
2271 /* Attempt a saving throw */
2272 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2273 (r_ptr->level > 5 + randint1(dam)))
2277 /* No obvious effect */
2283 /* Psycho-spear -- powerful magic missile */
2286 if (seen) obvious = TRUE;
2288 if (r_ptr->flagsr & RFR_RES_ALL)
2290 note = _("には完全な耐性がある!", " is immune.");
2292 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2298 /* Meteor -- powerful magic missile */
2301 if (seen) obvious = TRUE;
2303 if (r_ptr->flagsr & RFR_RES_ALL)
2305 note = _("には完全な耐性がある!", " is immune.");
2307 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2315 if (!is_hostile(m_ptr)) break;
2317 if (seen) obvious = TRUE;
2319 if (r_ptr->flagsr & RFR_RES_ALL)
2321 note = _("には効果がなかった!", " is immune.");
2323 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2326 /* Attempt a saving throw */
2327 if ((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) ||
2328 (r_ptr->flags3 & RF3_NO_CONF) ||
2329 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2331 /* Memorize a flag */
2332 if (r_ptr->flags3 & RF3_NO_CONF)
2334 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
2341 * Powerful demons & undead can turn a mindcrafter's
2342 * attacks back on them
2344 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2345 (r_ptr->level > p_ptr->lev / 2) &&
2349 msg_format(_("%^sの堕落した精神は攻撃を跳ね返した!",
2350 (seen ? "%^s's corrupted mind backlashes your attack!" :
2351 "%^ss corrupted mind backlashes your attack!")), m_name);
2354 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2356 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
2360 /* Confuse, stun, terrify */
2361 switch (randint1(4))
2364 set_stun(p_ptr->stun + dam / 2);
2367 set_confused(p_ptr->confused + dam / 2);
2371 if (r_ptr->flags3 & RF3_NO_FEAR)
2372 note = _("には効果がなかった。", " is unaffected.");
2374 set_afraid(p_ptr->afraid + dam);
2381 /* No obvious effect */
2382 note = _("には効果がなかった。", " is unaffected.");
2388 if (!common_saving_throw_charm(p_ptr, dam, m_ptr))
2390 note = _("があなたに隷属した。", " is in your thrall!");
2395 switch (randint1(4))
2409 /* No "real" damage */
2416 /* Ice -- Cold + Cuts + Stun */
2419 if (seen) obvious = TRUE;
2421 if (r_ptr->flagsr & RFR_RES_ALL)
2423 note = _("には完全な耐性がある!", " is immune.");
2425 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2428 do_stun = (randint1(15) + 1) / (r + 1);
2429 if (r_ptr->flagsr & RFR_IM_COLD)
2431 note = _("にはかなり耐性がある!", " resists a lot.");
2433 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
2435 else if (r_ptr->flags3 & (RF3_HURT_COLD))
2437 note = _("はひどい痛手をうけた。", " is hit hard.");
2439 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
2446 case GF_HYPODYNAMIA:
2448 if (seen) obvious = TRUE;
2450 if (r_ptr->flagsr & RFR_RES_ALL)
2452 note = _("には完全な耐性がある!", " is immune.");
2454 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2457 if (!monster_living(m_ptr->r_idx))
2459 if (is_original_ap_and_seen(m_ptr))
2461 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
2462 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
2463 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
2465 note = _("には効果がなかった。", " is unaffected.");
2469 else do_time = (dam+7)/8;
2477 if (seen) obvious = TRUE;
2479 if (r_ptr->flagsr & RFR_RES_ALL)
2481 note = _("には完全な耐性がある!", " is immune.");
2483 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2486 if (!monster_living(m_ptr->r_idx))
2488 if (is_original_ap_and_seen(m_ptr))
2490 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
2491 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
2492 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
2494 note = _("には完全な耐性がある!", " is immune.");
2498 else if (((r_ptr->flags1 & RF1_UNIQUE) &&
2499 (randint1(888) != 666)) ||
2500 (((r_ptr->level + randint1(20)) > randint1((caster_lev / 2) + randint1(10))) &&
2501 randint1(100) != 66))
2503 note = _("には耐性がある!", " resists!");
2511 /* Polymorph monster (Use "dam" as "power") */
2514 if (seen) obvious = TRUE;
2516 if (r_ptr->flagsr & RFR_RES_ALL)
2518 note = _("には効果がなかった。", " is unaffected.");
2520 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2523 /* Attempt to polymorph (see below) */
2526 /* Powerful monsters can resist */
2527 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2528 (r_ptr->flags1 & RF1_QUESTOR) ||
2529 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2531 note = _("には効果がなかった。", " is unaffected.");
2536 /* No "real" damage */
2543 /* Clone monsters (Ignore "dam") */
2546 if (seen) obvious = TRUE;
2548 if ((p_ptr->inside_arena) || is_pet(m_ptr) || (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_NAZGUL | RF7_UNIQUE2)))
2550 note = _("には効果がなかった。", " is unaffected.");
2555 m_ptr->hp = m_ptr->maxhp;
2557 /* Attempt to clone. */
2558 if (multiply_monster(c_ptr->m_idx, TRUE, 0L))
2560 note = _("が分裂した!", " spawns!");
2564 /* No "real" damage */
2571 /* Heal Monster (use "dam" as amount of healing) */
2574 if (seen) obvious = TRUE;
2577 (void)set_monster_csleep(c_ptr->m_idx, 0);
2579 if (m_ptr->maxhp < m_ptr->max_maxhp)
2581 if (seen_msg) msg_format(_("%^sの強さが戻った。", "%^s recovers %s vitality."), m_name, m_poss);
2582 m_ptr->maxhp = m_ptr->max_maxhp;
2587 /* Redraw (later) if needed */
2588 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
2589 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
2597 if (seen) obvious = TRUE;
2600 (void)set_monster_csleep(c_ptr->m_idx, 0);
2601 if (MON_STUNNED(m_ptr))
2603 if (seen_msg) msg_format(_("%^sは朦朧状態から立ち直った。", "%^s is no longer stunned."), m_name);
2604 (void)set_monster_stunned(c_ptr->m_idx, 0);
2606 if (MON_CONFUSED(m_ptr))
2608 if (seen_msg) msg_format(_("%^sは混乱から立ち直った。", "%^s is no longer confused."), m_name);
2609 (void)set_monster_confused(c_ptr->m_idx, 0);
2611 if (MON_MONFEAR(m_ptr))
2613 if (seen_msg) msg_format(_("%^sは勇気を取り戻した。", "%^s recovers %s courage."), m_name);
2614 (void)set_monster_monfear(c_ptr->m_idx, 0);
2618 if (m_ptr->hp < 30000) m_ptr->hp += dam;
2621 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
2625 chg_virtue(V_VITALITY, 1);
2627 if (r_ptr->flags1 & RF1_UNIQUE)
2628 chg_virtue(V_INDIVIDUALISM, 1);
2630 if (is_friendly(m_ptr))
2631 chg_virtue(V_HONOUR, 1);
2632 else if (!(r_ptr->flags3 & RF3_EVIL))
2634 if (r_ptr->flags3 & RF3_GOOD)
2635 chg_virtue(V_COMPASSION, 2);
2637 chg_virtue(V_COMPASSION, 1);
2640 if (r_ptr->flags3 & RF3_ANIMAL)
2641 chg_virtue(V_NATURE, 1);
2644 if (m_ptr->r_idx == MON_LEPER)
2647 if (!who) chg_virtue(V_COMPASSION, 5);
2650 /* Redraw (later) if needed */
2651 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
2652 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
2654 note = _("は体力を回復したようだ。", " looks healthier.");
2656 /* No "real" damage */
2662 /* Speed Monster (Ignore "dam") */
2665 if (seen) obvious = TRUE;
2668 if (set_monster_fast(c_ptr->m_idx, MON_FAST(m_ptr) + 100))
2670 note = _("の動きが速くなった。", " starts moving faster.");
2675 if (r_ptr->flags1 & RF1_UNIQUE)
2676 chg_virtue(V_INDIVIDUALISM, 1);
2677 if (is_friendly(m_ptr))
2678 chg_virtue(V_HONOUR, 1);
2681 /* No "real" damage */
2687 /* Slow Monster (Use "dam" as "power") */
2690 if (seen) obvious = TRUE;
2692 if (r_ptr->flagsr & RFR_RES_ALL)
2694 note = _("には効果がなかった。", " is unaffected.");
2696 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2699 /* Powerful monsters can resist */
2700 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2701 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2703 note = _("には効果がなかった。", " is unaffected.");
2707 /* Normal monsters slow down */
2710 if (set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 50))
2712 note = _("の動きが遅くなった。", " starts moving slower.");
2716 /* No "real" damage */
2722 /* Sleep (Use "dam" as "power") */
2725 if (seen) obvious = TRUE;
2727 if (r_ptr->flagsr & RFR_RES_ALL)
2729 note = _("には効果がなかった。", " is unaffected.");
2731 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2734 /* Attempt a saving throw */
2735 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2736 (r_ptr->flags3 & RF3_NO_SLEEP) ||
2737 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2739 /* Memorize a flag */
2740 if (r_ptr->flags3 & RF3_NO_SLEEP)
2742 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
2744 /* No obvious effect */
2745 note = _("には効果がなかった。", " is unaffected.");
2750 /* Go to sleep (much) later */
2751 note = _("は眠り込んでしまった!", " falls asleep!");
2755 /* No "real" damage */
2761 /* Sleep (Use "dam" as "power") */
2762 case GF_STASIS_EVIL:
2764 if (seen) obvious = TRUE;
2766 if (r_ptr->flagsr & RFR_RES_ALL)
2768 note = _("には効果がなかった!", " is immune.");
2770 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2773 /* Attempt a saving throw */
2774 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2775 !(r_ptr->flags3 & RF3_EVIL) ||
2776 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2778 note = _("には効果がなかった。", " is unaffected.");
2783 /* Go to sleep (much) later */
2784 note = _("は動けなくなった!", " is suspended!");
2788 /* No "real" damage */
2793 /* Sleep (Use "dam" as "power") */
2796 if (seen) obvious = TRUE;
2798 if (r_ptr->flagsr & RFR_RES_ALL)
2800 note = _("には効果がなかった。", " is unaffected.");
2802 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2805 /* Attempt a saving throw */
2806 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2807 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2809 note = _("には効果がなかった。", " is unaffected.");
2814 /* Go to sleep (much) later */
2815 note = _("は動けなくなった!", " is suspended!");
2819 /* No "real" damage */
2828 vir = virtue_number(V_HARMONY);
2831 dam += p_ptr->virtues[vir-1]/10;
2834 vir = virtue_number(V_INDIVIDUALISM);
2837 dam -= p_ptr->virtues[vir-1]/20;
2840 if (seen) obvious = TRUE;
2842 /* Attempt a saving throw */
2843 if (common_saving_throw_charm(p_ptr, dam, m_ptr))
2847 /* No obvious effect */
2848 note = _("には効果がなかった。", " is unaffected.");
2851 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2853 else if (p_ptr->cursed & TRC_AGGRAVATE)
2855 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2856 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2860 note = _("は突然友好的になったようだ!", " suddenly seems friendly!");
2863 chg_virtue(V_INDIVIDUALISM, -1);
2864 if (r_ptr->flags3 & RF3_ANIMAL)
2865 chg_virtue(V_NATURE, 1);
2868 /* No "real" damage */
2873 /* Control undead */
2874 case GF_CONTROL_UNDEAD:
2877 if (seen) obvious = TRUE;
2879 vir = virtue_number(V_UNLIFE);
2882 dam += p_ptr->virtues[vir-1]/10;
2885 vir = virtue_number(V_INDIVIDUALISM);
2888 dam -= p_ptr->virtues[vir-1]/20;
2891 /* Attempt a saving throw */
2892 if (common_saving_throw_control(p_ptr, dam, m_ptr) ||
2893 !(r_ptr->flags3 & RF3_UNDEAD))
2895 /* No obvious effect */
2896 note = _("には効果がなかった。", " is unaffected.");
2898 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2900 else if (p_ptr->cursed & TRC_AGGRAVATE)
2902 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2903 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2907 note = _("は既にあなたの奴隷だ!", " is in your thrall!");
2911 /* No "real" damage */
2917 case GF_CONTROL_DEMON:
2920 if (seen) obvious = TRUE;
2922 vir = virtue_number(V_UNLIFE);
2925 dam += p_ptr->virtues[vir-1]/10;
2928 vir = virtue_number(V_INDIVIDUALISM);
2931 dam -= p_ptr->virtues[vir-1]/20;
2934 /* Attempt a saving throw */
2935 if (common_saving_throw_control(p_ptr, dam, m_ptr) ||
2936 !(r_ptr->flags3 & RF3_DEMON))
2938 /* No obvious effect */
2939 note = _("には効果がなかった。", " is unaffected.");
2941 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2943 else if (p_ptr->cursed & TRC_AGGRAVATE)
2945 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2946 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2950 note = _("は既にあなたの奴隷だ!", " is in your thrall!");
2954 /* No "real" damage */
2960 case GF_CONTROL_ANIMAL:
2963 if (seen) obvious = TRUE;
2965 vir = virtue_number(V_NATURE);
2968 dam += p_ptr->virtues[vir-1]/10;
2971 vir = virtue_number(V_INDIVIDUALISM);
2974 dam -= p_ptr->virtues[vir-1]/20;
2977 /* Attempt a saving throw */
2978 if (common_saving_throw_control(p_ptr, dam, m_ptr) ||
2979 !(r_ptr->flags3 & RF3_ANIMAL))
2982 /* No obvious effect */
2983 note = _("には効果がなかった。", " is unaffected.");
2985 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2987 else if (p_ptr->cursed & TRC_AGGRAVATE)
2989 note = _("はあなたに敵意を抱いている!", " hates you too much!");
2990 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
2994 note = _("はなついた。", " is tamed!");
2996 if (r_ptr->flags3 & RF3_ANIMAL)
2997 chg_virtue(V_NATURE, 1);
3000 /* No "real" damage */
3006 case GF_CHARM_LIVING:
3010 vir = virtue_number(V_UNLIFE);
3011 if (seen) obvious = TRUE;
3013 vir = virtue_number(V_UNLIFE);
3016 dam -= p_ptr->virtues[vir-1]/10;
3019 vir = virtue_number(V_INDIVIDUALISM);
3022 dam -= p_ptr->virtues[vir-1]/20;
3025 msg_format(_("%sを見つめた。", "You stare into %s."), m_name);
3027 /* Attempt a saving throw */
3028 if (common_saving_throw_charm(p_ptr, dam, m_ptr) ||
3029 !monster_living(m_ptr->r_idx))
3032 /* No obvious effect */
3033 note = _("には効果がなかった。", " is unaffected.");
3035 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3037 else if (p_ptr->cursed & TRC_AGGRAVATE)
3039 note = _("はあなたに敵意を抱いている!", " hates you too much!");
3040 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3044 note = _("を支配した。", " is tamed!");
3046 if (r_ptr->flags3 & RF3_ANIMAL)
3047 chg_virtue(V_NATURE, 1);
3050 /* No "real" damage */
3055 /* Confusion (Use "dam" as "power") */
3058 if (seen) obvious = TRUE;
3060 if (r_ptr->flagsr & RFR_RES_ALL)
3062 note = _("には効果がなかった。", " is unaffected.");
3064 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3067 /* Get confused later */
3068 do_conf = damroll(3, (dam / 2)) + 1;
3070 /* Attempt a saving throw */
3071 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
3072 (r_ptr->flags3 & (RF3_NO_CONF)) ||
3073 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3075 /* Memorize a flag */
3076 if (r_ptr->flags3 & (RF3_NO_CONF))
3078 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3084 /* No obvious effect */
3085 note = _("には効果がなかった。", " is unaffected.");
3089 /* No "real" damage */
3096 if (seen) obvious = TRUE;
3098 if (r_ptr->flagsr & RFR_RES_ALL)
3100 note = _("には効果がなかった。", " is unaffected.");
3102 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3105 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
3107 /* Attempt a saving throw */
3108 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
3109 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3114 /* No obvious effect */
3115 note = _("には効果がなかった。", " is unaffected.");
3119 /* No "real" damage */
3127 /* Lite, but only hurts susceptible creatures */
3135 if (r_ptr->flagsr & RFR_RES_ALL)
3141 if (r_ptr->flags3 & (RF3_HURT_LITE))
3143 /* Obvious effect */
3144 if (seen) obvious = TRUE;
3146 /* Memorize the effects */
3147 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
3149 /* Special effect */
3150 note = _("は光に身をすくめた!", " cringes from the light!");
3151 note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
3154 /* Normally no damage */
3166 /* Lite -- opposite of Dark */
3169 if (seen) obvious = TRUE;
3171 if (r_ptr->flagsr & RFR_RES_ALL)
3173 note = _("には完全な耐性がある!", " is immune.");
3175 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3178 if (r_ptr->flagsr & RFR_RES_LITE)
3180 note = _("には耐性がある!", " resists!");
3181 dam *= 2; dam /= (randint1(6)+6);
3182 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_LITE);
3184 else if (r_ptr->flags3 & (RF3_HURT_LITE))
3186 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
3187 note = _("は光に身をすくめた!", " cringes from the light!");
3188 note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
3195 /* Dark -- opposite of Lite */
3198 if (seen) obvious = TRUE;
3200 if (r_ptr->flagsr & RFR_RES_ALL)
3202 note = _("には完全な耐性がある!", " is immune.");
3204 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3207 if (r_ptr->flagsr & RFR_RES_DARK)
3209 note = _("には耐性がある!", " resists!");
3210 dam *= 2; dam /= (randint1(6)+6);
3211 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DARK);
3220 if (r_ptr->flagsr & RFR_RES_ALL)
3225 /* Hurt by rock remover */
3226 if (r_ptr->flags3 & (RF3_HURT_ROCK))
3229 if (seen) obvious = TRUE;
3231 /* Memorize the effects */
3232 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
3234 /* Cute little message */
3235 note = _("の皮膚がただれた!", " loses some skin!");
3236 note_dies = _("はドロドロに溶けた!", " dissolves!");
3239 /* Usually, ignore the effects */
3250 /* Teleport undead (Use "dam" as "power") */
3251 case GF_AWAY_UNDEAD:
3253 /* Only affect undead */
3254 if (r_ptr->flags3 & (RF3_UNDEAD))
3256 bool resists_tele = FALSE;
3258 if (r_ptr->flagsr & RFR_RES_TELE)
3260 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
3262 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
3263 note = _("には効果がなかった。", " is unaffected.");
3264 resists_tele = TRUE;
3266 else if (r_ptr->level > randint1(100))
3268 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
3269 note = _("には耐性がある!", " resists!");
3270 resists_tele = TRUE;
3276 if (seen) obvious = TRUE;
3277 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
3289 /* No "real" damage */
3295 /* Teleport evil (Use "dam" as "power") */
3298 /* Only affect evil */
3299 if (r_ptr->flags3 & (RF3_EVIL))
3301 bool resists_tele = FALSE;
3303 if (r_ptr->flagsr & RFR_RES_TELE)
3305 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
3307 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
3308 note = _("には効果がなかった。", " is unaffected.");
3309 resists_tele = TRUE;
3311 else if (r_ptr->level > randint1(100))
3313 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
3314 note = _("には耐性がある!", " resists!");
3315 resists_tele = TRUE;
3321 if (seen) obvious = TRUE;
3322 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
3334 /* No "real" damage */
3340 /* Teleport monster (Use "dam" as "power") */
3343 bool resists_tele = FALSE;
3344 if (r_ptr->flagsr & RFR_RES_TELE)
3346 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
3348 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
3349 note = _("には効果がなかった。", " is unaffected.");
3350 resists_tele = TRUE;
3352 else if (r_ptr->level > randint1(100))
3354 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
3355 note = _("には耐性がある!", " resists!");
3356 resists_tele = TRUE;
3362 if (seen) obvious = TRUE;
3364 /* Prepare to teleport */
3368 /* No "real" damage */
3374 /* Turn undead (Use "dam" as "power") */
3375 case GF_TURN_UNDEAD:
3377 if (r_ptr->flagsr & RFR_RES_ALL)
3382 /* Only affect undead */
3383 if (r_ptr->flags3 & (RF3_UNDEAD))
3385 if (seen) obvious = TRUE;
3387 /* Learn about type */
3388 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
3390 /* Apply some fear */
3391 do_fear = damroll(3, (dam / 2)) + 1;
3393 /* Attempt a saving throw */
3394 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
3396 /* No obvious effect */
3397 note = _("には効果がなかった。", " is unaffected.");
3410 /* No "real" damage */
3416 /* Turn evil (Use "dam" as "power") */
3419 if (r_ptr->flagsr & RFR_RES_ALL)
3424 /* Only affect evil */
3425 if (r_ptr->flags3 & (RF3_EVIL))
3427 if (seen) obvious = TRUE;
3429 /* Learn about type */
3430 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
3432 /* Apply some fear */
3433 do_fear = damroll(3, (dam / 2)) + 1;
3435 /* Attempt a saving throw */
3436 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
3438 /* No obvious effect */
3439 note = _("には効果がなかった。", " is unaffected.");
3452 /* No "real" damage */
3458 /* Turn monster (Use "dam" as "power") */
3461 if (r_ptr->flagsr & RFR_RES_ALL)
3466 if (seen) obvious = TRUE;
3468 /* Apply some fear */
3469 do_fear = damroll(3, (dam / 2)) + 1;
3471 /* Attempt a saving throw */
3472 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
3473 (r_ptr->flags3 & (RF3_NO_FEAR)) ||
3474 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3476 /* No obvious effect */
3477 note = _("には効果がなかった。", " is unaffected.");
3482 /* No "real" damage */
3489 case GF_DISP_UNDEAD:
3491 if (r_ptr->flagsr & RFR_RES_ALL)
3497 /* Only affect undead */
3498 if (r_ptr->flags3 & (RF3_UNDEAD))
3500 if (seen) obvious = TRUE;
3502 /* Learn about type */
3503 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
3505 note = _("は身震いした。", " shudders.");
3506 note_dies = _("はドロドロに溶けた!", " dissolves!");
3526 if (r_ptr->flagsr & RFR_RES_ALL)
3532 /* Only affect evil */
3533 if (r_ptr->flags3 & (RF3_EVIL))
3535 if (seen) obvious = TRUE;
3537 /* Learn about type */
3538 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
3540 note = _("は身震いした。", " shudders.");
3541 note_dies = _("はドロドロに溶けた!", " dissolves!");
3560 if (r_ptr->flagsr & RFR_RES_ALL)
3566 /* Only affect good */
3567 if (r_ptr->flags3 & (RF3_GOOD))
3569 if (seen) obvious = TRUE;
3571 /* Learn about type */
3572 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
3574 note = _("は身震いした。", " shudders.");
3575 note_dies = _("はドロドロに溶けた!", " dissolves!");
3592 case GF_DISP_LIVING:
3594 if (r_ptr->flagsr & RFR_RES_ALL)
3600 /* Only affect non-undead */
3601 if (monster_living(m_ptr->r_idx))
3603 if (seen) obvious = TRUE;
3605 note = _("は身震いした。", " shudders.");
3606 note_dies = _("はドロドロに溶けた!", " dissolves!");
3625 if (r_ptr->flagsr & RFR_RES_ALL)
3631 /* Only affect demons */
3632 if (r_ptr->flags3 & (RF3_DEMON))
3634 if (seen) obvious = TRUE;
3636 /* Learn about type */
3637 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
3639 note = _("は身震いした。", " shudders.");
3640 note_dies = _("はドロドロに溶けた!", " dissolves!");
3656 /* Dispel monster */
3659 if (r_ptr->flagsr & RFR_RES_ALL)
3665 if (seen) obvious = TRUE;
3667 note = _("は身震いした。", " shudders.");
3668 note_dies = _("はドロドロに溶けた!", " dissolves!");
3675 if (seen) obvious = TRUE;
3677 if (r_ptr->flagsr & RFR_RES_ALL)
3679 note = _("には完全な耐性がある!", " is immune.");
3681 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3685 if ((r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) || (r_ptr->a_ability_flags1 & ~(RF5_NOMAGIC_MASK)) || (r_ptr->a_ability_flags2 & ~(RF6_NOMAGIC_MASK)))
3689 /* Heal the monster */
3690 if (caster_ptr->hp < caster_ptr->maxhp)
3693 caster_ptr->hp += dam;
3694 if (caster_ptr->hp > caster_ptr->maxhp) caster_ptr->hp = caster_ptr->maxhp;
3696 /* Redraw (later) if needed */
3697 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
3698 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
3700 /* Special message */
3703 monster_desc(killer, caster_ptr, 0);
3704 msg_format(_("%^sは気分が良さそうだ。", "%^s appears healthier."), killer);
3710 msg_format(_("%sから精神エネルギーを吸いとった。", "You draw psychic energy from %s."), m_name);
3711 (void)hp_player(dam);
3716 if (see_s_msg) msg_format(_("%sには効果がなかった。", "%s is unaffected."), m_name);
3725 if (seen) obvious = TRUE;
3726 if (!who) msg_format(_("%sをじっと睨んだ。", "You gaze intently at %s."), m_name);
3728 if (r_ptr->flagsr & RFR_RES_ALL)
3730 note = _("には完全な耐性がある!", " is immune.");
3732 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3736 /* Attempt a saving throw */
3737 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3738 (r_ptr->flags3 & RF3_NO_CONF) ||
3739 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
3741 /* Memorize a flag */
3742 if (r_ptr->flags3 & (RF3_NO_CONF))
3744 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3746 note = _("には効果がなかった。", " is unaffected.");
3749 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
3751 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
3752 note = _("には完全な耐性がある!", " is immune.");
3755 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
3757 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
3758 note = _("には耐性がある。", " resists.");
3763 note = _("は精神攻撃を食らった。", " is blasted by psionic energy.");
3764 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
3766 if (who > 0) do_conf = randint0(4) + 4;
3767 else do_conf = randint0(8) + 8;
3773 case GF_BRAIN_SMASH:
3775 if (seen) obvious = TRUE;
3776 if (!who) msg_format(_("%sをじっと睨んだ。", "You gaze intently at %s."), m_name);
3778 if (r_ptr->flagsr & RFR_RES_ALL)
3780 note = _("には完全な耐性がある!", " is immune.");
3782 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3786 /* Attempt a saving throw */
3787 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3788 (r_ptr->flags3 & RF3_NO_CONF) ||
3789 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
3791 /* Memorize a flag */
3792 if (r_ptr->flags3 & (RF3_NO_CONF))
3794 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3796 note = _("には効果がなかった。", " is unaffected.");
3799 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
3801 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
3802 note = _("には完全な耐性がある!", " is immune.");
3805 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
3807 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
3808 note = _("には耐性がある!", " resists!");
3813 note = _("は精神攻撃を食らった。", " is blasted by psionic energy.");
3814 note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
3818 do_conf = randint0(4) + 4;
3819 do_stun = randint0(4) + 4;
3823 do_conf = randint0(8) + 8;
3824 do_stun = randint0(8) + 8;
3826 (void)set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 10);
3834 if (seen) obvious = TRUE;
3835 if (!who) msg_format(_("%sを指差して呪いをかけた。", "You point at %s and curse."), m_name);
3837 if (r_ptr->flagsr & RFR_RES_ALL)
3839 note = _("には完全な耐性がある!", " is immune.");
3841 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3845 /* Attempt a saving throw */
3846 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
3848 note = _("には効果がなかった。", " is unaffected.");
3857 if (seen) obvious = TRUE;
3858 if (!who) msg_format(_("%sを指差して恐ろしげに呪いをかけた。", "You point at %s and curse horribly."), m_name);
3860 if (r_ptr->flagsr & RFR_RES_ALL)
3862 note = _("には完全な耐性がある!", " is immune.");
3864 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3868 /* Attempt a saving throw */
3869 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
3871 note = _("には効果がなかった。", " is unaffected.");
3880 if (seen) obvious = TRUE;
3881 if (!who) msg_format(_("%sを指差し、恐ろしげに呪文を唱えた!", "You point at %s, incanting terribly!"), m_name);
3883 if (r_ptr->flagsr & RFR_RES_ALL)
3885 note = _("には完全な耐性がある!", " is immune.");
3887 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3891 /* Attempt a saving throw */
3892 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
3894 note = _("には効果がなかった。", " is unaffected.");
3903 if (seen) obvious = TRUE;
3905 msg_format(_("%sの秘孔を突いて、「お前は既に死んでいる」と叫んだ。",
3906 "You point at %s, screaming the word, 'DIE!'."), m_name);
3908 if (r_ptr->flagsr & RFR_RES_ALL)
3910 note = _("には完全な耐性がある!", " is immune.");
3912 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3916 /* Attempt a saving throw */
3917 if ((randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35)) && ((who <= 0) || (caster_ptr->r_idx != MON_KENSHIROU)))
3919 note = _("には効果がなかった。", " is unaffected.");
3928 if (seen) obvious = TRUE;
3930 if (r_ptr->flagsr & RFR_RES_ALL)
3932 note = _("には完全な耐性がある!", " is immune.");
3934 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3938 if (r_ptr->flags1 & RF1_UNIQUE)
3940 note = _("には効果がなかった。", " is unaffected.");
3945 if ((who > 0) ? ((caster_lev + randint1(dam)) > (r_ptr->level + 10 + randint1(20))) :
3946 (((caster_lev / 2) + randint1(dam)) > (r_ptr->level + randint1(200))))
3948 dam = ((40 + randint1(20)) * m_ptr->hp) / 100;
3950 if (m_ptr->hp < dam) dam = m_ptr->hp - 1;
3954 note = _("は耐性を持っている!", "resists!");
3961 /* Capture monster */
3965 if ((p_ptr->inside_quest && (quest[p_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(m_ptr)) ||
3966 (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)
3968 msg_format(_("%sには効果がなかった。", "%s is unaffected."), m_name);
3973 if (is_pet(m_ptr)) nokori_hp = m_ptr->maxhp * 4L;
3974 else if ((p_ptr->pclass == CLASS_BEASTMASTER) && monster_living(m_ptr->r_idx))
3975 nokori_hp = m_ptr->maxhp * 3 / 10;
3977 nokori_hp = m_ptr->maxhp * 3 / 20;
3979 if (m_ptr->hp >= nokori_hp)
3981 msg_format(_("もっと弱らせないと。", "You need to weaken %s more."), m_name);
3984 else if (m_ptr->hp < randint0(nokori_hp))
3986 if (m_ptr->mflag2 & MFLAG2_CHAMELEON) choose_new_monster(c_ptr->m_idx, FALSE, MON_CHAMELEON);
3987 msg_format(_("%sを捕えた!", "You capture %^s!"), m_name);
3988 cap_mon = m_ptr->r_idx;
3989 cap_mspeed = m_ptr->mspeed;
3991 cap_maxhp = m_ptr->max_maxhp;
3992 cap_nickname = m_ptr->nickname; /* Quark transfer */
3993 if (c_ptr->m_idx == p_ptr->riding)
3995 if (rakuba(-1, FALSE))
3997 msg_format(_("地面に落とされた。", "You have fallen from %s."), m_name);
4001 delete_monster_idx(c_ptr->m_idx);
4007 msg_format(_("うまく捕まえられなかった。", "You failed to capture %s."), m_name);
4013 /* Attack (Use "dam" as attack type) */
4016 /* Return this monster's death */
4017 return py_attack(y, x, dam);
4020 /* Sleep (Use "dam" as "power") */
4026 if (seen) obvious = TRUE;
4028 if (r_ptr->flagsr & RFR_RES_ALL)
4030 note = _("には効果がなかった。", " is unaffected.");
4032 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4035 if (r_ptr->flags2 & RF2_EMPTY_MIND)
4037 note = _("には効果がなかった。", " is unaffected.");
4040 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
4043 if (MON_CSLEEP(m_ptr))
4045 note = _("には効果がなかった。", " is unaffected.");
4051 if (one_in_(5)) effect = 1;
4052 else if (one_in_(4)) effect = 2;
4053 else if (one_in_(3)) effect = 3;
4058 /* Powerful monsters can resist */
4059 if ((r_ptr->flags1 & RF1_UNIQUE) ||
4060 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4062 note = _("には効果がなかった。", " is unaffected.");
4066 /* Normal monsters slow down */
4069 if (set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 50))
4071 note = _("の動きが遅くなった。", " starts moving slower.");
4076 else if (effect == 2)
4078 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
4080 /* Attempt a saving throw */
4081 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4082 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4087 /* No obvious effect */
4088 note = _("には効果がなかった。", " is unaffected.");
4093 else if (effect == 3)
4095 /* Attempt a saving throw */
4096 if ((r_ptr->flags1 & RF1_UNIQUE) ||
4097 (r_ptr->flags3 & RF3_NO_SLEEP) ||
4098 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4100 /* Memorize a flag */
4101 if (r_ptr->flags3 & RF3_NO_SLEEP)
4103 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
4106 /* No obvious effect */
4107 note = _("には効果がなかった。", " is unaffected.");
4112 /* Go to sleep (much) later */
4113 note = _("は眠り込んでしまった!", " falls asleep!");
4120 note = _("には効果がなかった。", " is unaffected.");
4123 /* No "real" damage */
4131 if (seen) obvious = TRUE;
4133 if (r_ptr->flagsr & RFR_RES_ALL)
4135 note = _("には効果がなかった。", " is unaffected.");
4137 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4141 if (genocide_aux(c_ptr->m_idx, dam, !who, (r_ptr->level + 1) / 2, _("モンスター消滅", "Genocide One")))
4143 if (seen_msg) msg_format(_("%sは消滅した!", "%^s disappered!"), m_name);
4144 chg_virtue(V_VITALITY, -1);
4154 if (!who) msg_format(_("%sを写真に撮った。", "You take a photograph of %s."), m_name);
4156 if (r_ptr->flags3 & (RF3_HURT_LITE))
4158 /* Obvious effect */
4159 if (seen) obvious = TRUE;
4161 /* Memorize the effects */
4162 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4164 /* Special effect */
4165 note = _("は光に身をすくめた!", " cringes from the light!");
4166 note_dies = _("は光を受けてしぼんでしまった!", " shrivels away in the light!");
4169 /* Normally no damage */
4176 photo = m_ptr->r_idx;
4183 case GF_BLOOD_CURSE:
4185 if (seen) obvious = TRUE;
4187 if (r_ptr->flagsr & RFR_RES_ALL)
4189 note = _("には完全な耐性がある!", " is immune.");
4191 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4199 bool success = FALSE;
4200 if (seen) obvious = TRUE;
4202 if ((r_ptr->flags3 & (RF3_GOOD)) && !p_ptr->inside_arena)
4204 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 50;
4205 if (dam < 1) dam = 1;
4207 /* No need to tame your pet */
4210 note = _("の動きが速くなった。", " starts moving faster.");
4211 (void)set_monster_fast(c_ptr->m_idx, MON_FAST(m_ptr) + 100);
4215 /* Attempt a saving throw */
4216 else if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4217 (r_ptr->flags1 & (RF1_UNIQUE)) ||
4218 (m_ptr->mflag2 & MFLAG2_NOPET) ||
4219 (p_ptr->cursed & TRC_AGGRAVATE) ||
4220 ((r_ptr->level+10) > randint1(dam)))
4223 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4227 note = _("を支配した。", " is tamed!");
4229 (void)set_monster_fast(c_ptr->m_idx, MON_FAST(m_ptr) + 100);
4231 /* Learn about type */
4232 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
4239 if (!(r_ptr->flags3 & RF3_NO_FEAR))
4241 do_fear = randint1(90)+10;
4243 else if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_FEAR);
4246 /* No "real" damage */
4253 if (seen) obvious = TRUE;
4255 if (r_ptr->flagsr & RFR_RES_ALL)
4257 note = _("には完全な耐性がある!", " is immune.");
4259 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4263 /* Attempt a saving throw */
4264 if (randint0(100 + dam) < (r_ptr->level + 50))
4266 note = _("には効果がなかった。", " is unaffected.");
4286 /* Absolutely no effect */
4287 if (skipped) return (FALSE);
4289 /* "Unique" monsters cannot be polymorphed */
4290 if (r_ptr->flags1 & (RF1_UNIQUE)) do_poly = FALSE;
4292 /* Quest monsters cannot be polymorphed */
4293 if (r_ptr->flags1 & RF1_QUESTOR) do_poly = FALSE;
4295 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_poly = FALSE;
4297 /* "Unique" and "quest" monsters can only be "killed" by the player. */
4298 if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & RF7_NAZGUL)) && !p_ptr->inside_battle)
4300 if (who && (dam > m_ptr->hp)) dam = m_ptr->hp;
4305 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_COMPASSION, -1);
4306 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_HONOUR, -1);
4309 /* Modify the damage */
4311 dam = mon_damage_mod(m_ptr, dam, (bool)(typ == GF_PSY_SPEAR));
4312 if ((tmp > 0) && (dam == 0)) note = _("はダメージを受けていない。", " is unharmed.");
4314 /* Check for death */
4315 if (dam > m_ptr->hp)
4317 /* Extract method of death */
4322 /* Sound and Impact resisters never stun */
4324 !(r_ptr->flagsr & (RFR_RES_SOUN | RFR_RES_WALL)) &&
4325 !(r_ptr->flags3 & RF3_NO_STUN))
4327 if (seen) obvious = TRUE;
4330 if (MON_STUNNED(m_ptr))
4332 note = _("はひどくもうろうとした。", " is more dazed.");
4333 tmp = MON_STUNNED(m_ptr) + (do_stun / 2);
4337 note = _("はもうろうとした。", " is dazed.");
4342 (void)set_monster_stunned(c_ptr->m_idx, tmp);
4348 /* Confusion and Chaos resisters (and sleepers) never confuse */
4350 !(r_ptr->flags3 & RF3_NO_CONF) &&
4351 !(r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK))
4353 if (seen) obvious = TRUE;
4355 /* Already partially confused */
4356 if (MON_CONFUSED(m_ptr))
4358 note = _("はさらに混乱したようだ。", " looks more confused.");
4359 tmp = MON_CONFUSED(m_ptr) + (do_conf / 2);
4362 /* Was not confused */
4365 note = _("は混乱したようだ。", " looks confused.");
4369 /* Apply confusion */
4370 (void)set_monster_confused(c_ptr->m_idx, tmp);
4378 if (seen) obvious = TRUE;
4380 if (do_time >= m_ptr->maxhp) do_time = m_ptr->maxhp - 1;
4384 note = _("は弱くなったようだ。", " seems weakened.");
4385 m_ptr->maxhp -= do_time;
4386 if ((m_ptr->hp - dam) > m_ptr->maxhp) dam = m_ptr->hp - m_ptr->maxhp;
4391 /* Mega-Hack -- Handle "polymorph" -- monsters get a saving throw */
4392 if (do_poly && (randint1(90) > r_ptr->level))
4394 if (polymorph_monster(y, x))
4396 if (seen) obvious = TRUE;
4398 /* Monster polymorphs */
4399 note = _("が変身した!", " changes!");
4401 /* Turn off the damage */
4407 note = _("には効果がなかった。", " is unaffected.");
4410 /* Hack -- Get new monster */
4411 m_ptr = &m_list[c_ptr->m_idx];
4413 /* Hack -- Get new race */
4414 r_ptr = &r_info[m_ptr->r_idx];
4417 /* Handle "teleport" */
4420 if (seen) obvious = TRUE;
4422 note = _("が消え去った!", " disappears!");
4424 if (!who) chg_virtue(V_VALOUR, -1);
4427 teleport_away(c_ptr->m_idx, do_dist,
4428 (!who ? TELEPORT_DEC_VALOUR : 0L) | TELEPORT_PASSIVE);
4430 /* Hack -- get new location */
4434 /* Hack -- get new grid */
4435 c_ptr = &cave[y][x];
4442 (void)set_monster_monfear(c_ptr->m_idx, MON_MONFEAR(m_ptr) + do_fear);
4449 if (typ == GF_DRAIN_MANA)
4451 /* Drain mana does nothing */
4454 /* If another monster did the damage, hurt the monster by hand */
4457 /* Redraw (later) if needed */
4458 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
4459 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
4461 /* Wake the monster up */
4462 (void)set_monster_csleep(c_ptr->m_idx, 0);
4464 /* Hurt the monster */
4472 if (is_pet(m_ptr) && !(m_ptr->ml))
4475 /* Give detailed messages if destroyed */
4478 monster_desc(m_name, m_ptr, MD_TRUE_NAME);
4481 msg_format("%^s%s", m_name, note);
4489 if (who > 0) monster_gain_exp(who, m_ptr->r_idx);
4491 /* Generate treasure, etc */
4492 monster_death(c_ptr->m_idx, FALSE);
4495 delete_monster_idx(c_ptr->m_idx);
4499 msg_print(_("少し悲しい気分がした。", "You feel sad for a moment."));
4503 /* Damaged monster */
4506 /* Give detailed messages if visible or destroyed */
4507 if (note && seen_msg) msg_format("%^s%s", m_name, note);
4509 /* Hack -- Pain message */
4512 message_pain(c_ptr->m_idx, dam);
4519 /* Hack -- handle sleep */
4520 if (do_sleep) (void)set_monster_csleep(c_ptr->m_idx, do_sleep);
4524 else if (heal_leper)
4526 if (seen_msg) msg_print(_("不潔な病人は病気が治った!", "The Mangy looking leper is healed!"));
4528 if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
4530 char m2_name[MAX_NLEN];
4532 monster_desc(m2_name, m_ptr, MD_INDEF_VISIBLE);
4533 do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_HEAL_LEPER, m2_name);
4536 delete_monster_idx(c_ptr->m_idx);
4539 /* If the player did it, give him experience, check fear */
4544 /* Hurt the monster, check for fear and death */
4545 if (mon_take_hit(c_ptr->m_idx, dam, &fear, note_dies))
4550 /* Damaged monster */
4553 /* HACK - anger the monster before showing the sleep message */
4554 if (do_sleep) anger_monster(m_ptr);
4556 /* Give detailed messages if visible or destroyed */
4557 if (note && seen_msg)
4558 msg_format(_("%s%s", "%^s%s"), m_name, note);
4560 /* Hack -- Pain message */
4561 else if (known && (dam || !do_fear))
4563 message_pain(c_ptr->m_idx, dam);
4566 /* Anger monsters */
4567 if (((dam > 0) || get_angry) && !do_sleep)
4568 anger_monster(m_ptr);
4570 if ((fear || do_fear) && seen)
4573 msg_format(_("%^sは恐怖して逃げ出した!", "%^s flees in terror!"), m_name);
4576 /* Hack -- handle sleep */
4577 if (do_sleep) (void)set_monster_csleep(c_ptr->m_idx, do_sleep);
4581 if ((typ == GF_BLOOD_CURSE) && one_in_(4))
4583 int curse_flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
4587 switch (randint1(28))
4592 msg_print(_("地面が揺れた...", "The ground trembles..."));
4593 earthquake(ty, tx, 4 + randint0(4));
4594 if (!one_in_(6)) break;
4596 case 3: case 4: case 5: case 6:
4599 int extra_dam = damroll(10, 10);
4600 msg_print(_("純粋な魔力の次元への扉が開いた!", "A portal opens to a plane of raw mana!"));
4602 project(0, 8, ty, tx, extra_dam, GF_MANA, curse_flg, -1);
4603 if (!one_in_(6)) break;
4608 msg_print(_("空間が歪んだ!", "Space warps about you!"));
4610 if (m_ptr->r_idx) teleport_away(c_ptr->m_idx, damroll(10, 10), TELEPORT_PASSIVE);
4611 if (one_in_(13)) count += activate_hi_summon(ty, tx, TRUE);
4612 if (!one_in_(6)) break;
4614 case 9: case 10: case 11:
4615 msg_print(_("エネルギーのうねりを感じた!", "You feel a surge of energy!"));
4616 project(0, 7, ty, tx, 50, GF_DISINTEGRATE, curse_flg, -1);
4617 if (!one_in_(6)) break;
4618 case 12: case 13: case 14: case 15: case 16:
4619 aggravate_monsters(0);
4620 if (!one_in_(6)) break;
4622 count += activate_hi_summon(ty, tx, TRUE);
4623 if (!one_in_(6)) break;
4624 case 19: case 20: case 21: case 22:
4626 bool pet = !one_in_(3);
4627 BIT_FLAGS mode = PM_ALLOW_GROUP;
4629 if (pet) mode |= PM_FORCE_PET;
4630 else mode |= (PM_NO_PET | PM_FORCE_FRIENDLY);
4632 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');
4633 if (!one_in_(6)) break;
4635 case 23: case 24: case 25:
4636 if (p_ptr->hold_exp && (randint0(100) < 75)) break;
4637 msg_print(_("経験値が体から吸い取られた気がする!", "You feel your experience draining away..."));
4639 if (p_ptr->hold_exp) lose_exp(p_ptr->exp / 160);
4640 else lose_exp(p_ptr->exp / 16);
4641 if (!one_in_(6)) break;
4642 case 26: case 27: case 28:
4651 (void)do_dec_stat(i);
4660 (void)do_dec_stat(randint0(6));
4669 if (p_ptr->inside_battle)
4671 p_ptr->health_who = c_ptr->m_idx;
4672 p_ptr->redraw |= (PR_HEALTH);
4676 /* Verify this code */
4677 if (m_ptr->r_idx) update_monster(c_ptr->m_idx, FALSE);
4679 /* Redraw the monster grid */
4683 /* Update monster recall window */
4684 if ((p_ptr->monster_race_idx == m_ptr->r_idx) && (seen || !m_ptr->r_idx))
4686 p_ptr->window |= (PW_MONSTER);
4689 if ((dam > 0) && !is_pet(m_ptr) && !is_friendly(m_ptr))
4693 if (!(flg & PROJECT_NO_HANGEKI))
4695 set_target(m_ptr, monster_target_y, monster_target_x);
4698 else if ((who > 0) && is_pet(caster_ptr) && !player_bold(m_ptr->target_y, m_ptr->target_x))
4700 set_target(m_ptr, caster_ptr->fy, caster_ptr->fx);
4704 if (p_ptr->riding && (p_ptr->riding == c_ptr->m_idx) && (dam > 0))
4706 if (m_ptr->hp > m_ptr->maxhp/3) dam = (dam + 1) / 2;
4707 rakubadam_m = (dam > 200) ? 200 : dam;
4717 /* Prepare to make a Blade of Chaos */
4718 object_prep(q_ptr, lookup_kind(TV_STATUE, SV_PHOTO));
4720 q_ptr->pval = photo;
4722 /* Mark the item as fully known */
4723 q_ptr->ident |= (IDENT_MENTAL);
4724 (void)drop_near(q_ptr, -1, p_ptr->y, p_ptr->x);
4732 /* Return "Anything seen?" */
4737 * @brief 汎用的なビーム/ボルト/ボール系によるプレイヤーへの効果処理 / Helper function for "project()" below.
4738 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
4739 * @param who_name 効果を起こしたモンスターの名前
4740 * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
4741 * @param y 目標Y座標 / Target y location (or location to travel "towards")
4742 * @param x 目標X座標 / Target x location (or location to travel "towards")
4743 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
4744 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
4746 * @param monspell 効果元のモンスター魔法ID
4747 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
4749 * Handle a beam/bolt/ball causing damage to the player.
4750 * This routine takes a "source monster" (by index), a "distance", a default
4751 * "damage", and a "damage type". See "project_m()" above.
4752 * If "rad" is non-zero, then the blast was centered elsewhere, and the damage
4753 * is reduced (see "project_m()" above). This can happen if a monster breathes
4754 * at the player and hits a wall instead.
4755 * NOTE (Zangband): 'Bolt' attacks can be reflected back, so we need
4756 * to know if this is actually a ball or a bolt spell
4757 * We return "TRUE" if any "obvious" effects were observed. XXX XXX Actually,
4758 * we just assume that the effects were obvious, for historical reasons.
4760 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)
4765 /* Hack -- assume obvious */
4766 bool obvious = TRUE;
4768 /* Player blind-ness */
4769 bool blind = (p_ptr->blind ? TRUE : FALSE);
4771 /* Player needs a "description" (he is blind) */
4774 /* Source monster */
4775 monster_type *m_ptr = NULL;
4777 /* Monster name (for attacks) */
4778 GAME_TEXT m_name[MAX_NLEN];
4780 /* Monster name (for damage) */
4783 /* Hack -- messages */
4789 /* Player is not here */
4790 if (!player_bold(y, x)) return (FALSE);
4792 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && (randint0(55) < (p_ptr->lev*3/5+20)) && who && (who != p_ptr->riding))
4794 if (kawarimi(TRUE)) return FALSE;
4797 /* Player cannot hurt himself */
4798 if (!who) return (FALSE);
4799 if (who == p_ptr->riding) return (FALSE);
4801 if ((p_ptr->reflect || ((p_ptr->special_defense & KATA_FUUJIN) && !p_ptr->blind)) && (flg & PROJECT_REFLECTABLE) && !one_in_(10))
4804 int max_attempts = 10;
4805 sound(SOUND_REFLECT);
4808 msg_print(_("何かが跳ね返った!", "Something bounces!"));
4809 else if (p_ptr->special_defense & KATA_FUUJIN)
4810 msg_print(_("風の如く武器を振るって弾き返した!", "The attack bounces!"));
4812 msg_print(_("攻撃が跳ね返った!", "The attack bounces!"));
4815 /* Choose 'new' target */
4820 t_y = m_list[who].fy - 1 + randint1(3);
4821 t_x = m_list[who].fx - 1 + randint1(3);
4824 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(p_ptr->y, p_ptr->x, t_y, t_x));
4826 if (max_attempts < 1)
4828 t_y = m_list[who].fy;
4829 t_x = m_list[who].fx;
4834 t_y = p_ptr->y - 1 + randint1(3);
4835 t_x = p_ptr->x - 1 + randint1(3);
4838 project(0, 0, t_y, t_x, dam, typ, (PROJECT_STOP|PROJECT_KILL|PROJECT_REFLECTABLE), monspell);
4840 disturb(TRUE, TRUE);
4844 /* Limit maximum damage */
4845 if (dam > 1600) dam = 1600;
4847 /* Reduce damage by distance */
4848 dam = (dam + r) / (r + 1);
4851 /* If the player is blind, be more descriptive */
4852 if (blind) fuzzy = TRUE;
4857 m_ptr = &m_list[who];
4858 rlev = (((&r_info[m_ptr->r_idx])->level >= 1) ? (&r_info[m_ptr->r_idx])->level : 1);
4859 monster_desc(m_name, m_ptr, 0);
4861 /* Get the monster's real name (gotten before polymorph!) */
4862 strcpy(killer, who_name);
4868 case PROJECT_WHO_UNCTRL_POWER:
4869 strcpy(killer, _("制御できない力の氾流", "uncontrollable power storm"));
4872 case PROJECT_WHO_GLASS_SHARDS:
4873 strcpy(killer, _("ガラスの破片", "shards of glass"));
4877 strcpy(killer, _("罠", "a trap"));
4882 strcpy(m_name, killer);
4885 /* Analyze the damage */
4888 /* Standard damage -- hurts inventory too */
4891 if (fuzzy) msg_print(_("酸で攻撃された!", "You are hit by acid!"));
4892 get_damage = acid_dam(dam, killer, monspell, FALSE);
4896 /* Standard damage -- hurts inventory too */
4899 if (fuzzy) msg_print(_("火炎で攻撃された!", "You are hit by fire!"));
4900 get_damage = fire_dam(dam, killer, monspell, FALSE);
4904 /* Standard damage -- hurts inventory too */
4907 if (fuzzy) msg_print(_("冷気で攻撃された!", "You are hit by cold!"));
4908 get_damage = cold_dam(dam, killer, monspell, FALSE);
4912 /* Standard damage -- hurts inventory too */
4915 if (fuzzy) msg_print(_("電撃で攻撃された!", "You are hit by lightning!"));
4916 get_damage = elec_dam(dam, killer, monspell, FALSE);
4920 /* Standard damage -- also poisons player */
4923 bool double_resist = IS_OPPOSE_POIS();
4924 if (fuzzy) msg_print(_("毒で攻撃された!", "You are hit by poison!"));
4926 if (p_ptr->resist_pois) dam = (dam + 2) / 3;
4927 if (double_resist) dam = (dam + 2) / 3;
4929 if ((!(double_resist || p_ptr->resist_pois)) && one_in_(HURT_CHANCE) && !CHECK_MULTISHADOW())
4934 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4936 if (!(double_resist || p_ptr->resist_pois) && !CHECK_MULTISHADOW())
4938 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
4943 /* Standard damage -- also poisons / mutates player */
4946 bool double_resist = IS_OPPOSE_POIS();
4947 if (fuzzy) msg_print(_("放射能で攻撃された!", "You are hit by radiation!"));
4949 if (p_ptr->resist_pois) dam = (2 * dam + 2) / 5;
4950 if (double_resist) dam = (2 * dam + 2) / 5;
4951 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4952 if (!(double_resist || p_ptr->resist_pois) && !CHECK_MULTISHADOW())
4954 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
4956 if (one_in_(5)) /* 6 */
4958 msg_print(_("奇形的な変身を遂げた!", "You undergo a freakish metamorphosis!"));
4959 if (one_in_(4)) /* 4 */
4967 inven_damage(set_acid_destroy, 2);
4973 /* Standard damage */
4976 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4977 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4981 /* Holy Orb -- Player only takes partial damage */
4984 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4985 if (p_ptr->align > 10)
4987 else if (p_ptr->align < -10)
4989 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
4995 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
4996 if (p_ptr->align > 10)
4998 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5002 /* Arrow -- XXX no dodging */
5007 msg_print(_("何か鋭いもので攻撃された!", "You are hit by something sharp!"));
5009 else if ((inventory[INVEN_RARM].name1 == ART_ZANTETSU) || (inventory[INVEN_LARM].name1 == ART_ZANTETSU))
5011 msg_print(_("矢を斬り捨てた!", "You cut down the arrow!"));
5014 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5018 /* Plasma -- XXX No resist */
5021 if (fuzzy) msg_print(_("何かとても熱いもので攻撃された!", "You are hit by something *HOT*!"));
5022 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5024 if (!p_ptr->resist_sound && !CHECK_MULTISHADOW())
5026 int plus_stun = (randint1((dam > 40) ? 35 : (dam * 3 / 4 + 5)));
5027 (void)set_stun(p_ptr->stun + plus_stun);
5030 if (!(p_ptr->resist_fire || IS_OPPOSE_FIRE() || p_ptr->immune_fire))
5032 inven_damage(set_acid_destroy, 3);
5038 /* Nether -- drain experience */
5041 if (fuzzy) msg_print(_("地獄の力で攻撃された!", "You are hit by nether forces!"));
5042 if (p_ptr->resist_neth)
5044 if (!prace_is_(RACE_SPECTRE))
5046 dam *= 6; dam /= (randint1(4) + 7);
5049 else if (!CHECK_MULTISHADOW()) drain_exp(200 + (p_ptr->exp / 100), 200 + (p_ptr->exp / 1000), 75);
5051 if (prace_is_(RACE_SPECTRE) && !CHECK_MULTISHADOW())
5053 msg_print(_("気分がよくなった。", "You feel invigorated!"));
5055 learn_spell(monspell);
5059 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5065 /* Water -- stun/confuse */
5068 if (fuzzy) msg_print(_("何か湿ったもので攻撃された!", "You are hit by something wet!"));
5069 if (!CHECK_MULTISHADOW())
5071 if (!p_ptr->resist_sound && !p_ptr->resist_water)
5073 set_stun(p_ptr->stun + randint1(40));
5075 if (!p_ptr->resist_conf && !p_ptr->resist_water)
5077 set_confused(p_ptr->confused + randint1(5) + 5);
5080 if (one_in_(5) && !p_ptr->resist_water)
5082 inven_damage(set_cold_destroy, 3);
5085 if (p_ptr->resist_water) get_damage /= 4;
5088 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5092 /* Chaos -- many effects */
5095 if (fuzzy) msg_print(_("無秩序の波動で攻撃された!", "You are hit by a wave of anarchy!"));
5096 if (p_ptr->resist_chaos)
5098 dam *= 6; dam /= (randint1(4) + 7);
5101 if (!CHECK_MULTISHADOW())
5103 if (!p_ptr->resist_conf)
5105 (void)set_confused(p_ptr->confused + randint0(20) + 10);
5107 if (!p_ptr->resist_chaos)
5109 (void)set_image(p_ptr->image + randint1(10));
5112 msg_print(_("あなたの身体はカオスの力で捻じ曲げられた!", "Your body is twisted by chaos!"));
5113 (void)gain_random_mutation(0);
5116 if (!p_ptr->resist_neth && !p_ptr->resist_chaos)
5118 drain_exp(5000 + (p_ptr->exp / 100), 500 + (p_ptr->exp / 1000), 75);
5121 if (!p_ptr->resist_chaos || one_in_(9))
5123 inven_damage(set_elec_destroy, 2);
5124 inven_damage(set_fire_destroy, 2);
5128 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5132 /* Shards -- mostly cutting */
5135 if (fuzzy) msg_print(_("何か鋭いもので攻撃された!", "You are hit by something sharp!"));
5136 if (p_ptr->resist_shard)
5138 dam *= 6; dam /= (randint1(4) + 7);
5140 else if (!CHECK_MULTISHADOW())
5142 (void)set_cut(p_ptr->cut + dam);
5145 if (!p_ptr->resist_shard || one_in_(13))
5147 inven_damage(set_cold_destroy, 2);
5150 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5154 /* Sound -- mostly stunning */
5157 if (fuzzy) msg_print(_("轟音で攻撃された!", "You are hit by a loud noise!"));
5158 if (p_ptr->resist_sound)
5160 dam *= 5; dam /= (randint1(4) + 7);
5162 else if (!CHECK_MULTISHADOW())
5164 int plus_stun = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
5165 (void)set_stun(p_ptr->stun + plus_stun);
5168 if (!p_ptr->resist_sound || one_in_(13))
5170 inven_damage(set_cold_destroy, 2);
5173 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5177 /* Pure confusion */
5180 if (fuzzy) msg_print(_("何か混乱するもので攻撃された!", "You are hit by something puzzling!"));
5181 if (p_ptr->resist_conf)
5183 dam *= 5; dam /= (randint1(4) + 7);
5185 else if (!CHECK_MULTISHADOW())
5187 (void)set_confused(p_ptr->confused + randint1(20) + 10);
5189 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5193 /* Disenchantment -- see above */
5196 if (fuzzy) msg_print(_("何かさえないもので攻撃された!", "You are hit by something static!"));
5197 if (p_ptr->resist_disen)
5199 dam *= 6; dam /= (randint1(4) + 7);
5201 else if (!CHECK_MULTISHADOW())
5203 (void)apply_disenchant(0);
5205 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5209 /* Nexus -- see above */
5212 if (fuzzy) msg_print(_("何か奇妙なもので攻撃された!", "You are hit by something strange!"));
5213 if (p_ptr->resist_nexus)
5215 dam *= 6; dam /= (randint1(4) + 7);
5217 else if (!CHECK_MULTISHADOW())
5221 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5225 /* Force -- mostly stun */
5228 if (fuzzy) msg_print(_("運動エネルギーで攻撃された!", "You are hit by kinetic force!"));
5229 if (!p_ptr->resist_sound && !CHECK_MULTISHADOW())
5231 (void)set_stun(p_ptr->stun + randint1(20));
5233 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5238 /* Rocket -- stun, cut */
5241 if (fuzzy) msg_print(_("爆発があった!", "There is an explosion!"));
5242 if (!p_ptr->resist_sound && !CHECK_MULTISHADOW())
5244 (void)set_stun(p_ptr->stun + randint1(20));
5247 if (p_ptr->resist_shard)
5251 else if (!CHECK_MULTISHADOW())
5253 (void)set_cut(p_ptr->cut + (dam / 2));
5256 if (!p_ptr->resist_shard || one_in_(12))
5258 inven_damage(set_cold_destroy, 3);
5261 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5265 /* Inertia -- slowness */
5268 if (fuzzy) msg_print(_("何か遅いもので攻撃された!", "You are hit by something slow!"));
5269 if (!CHECK_MULTISHADOW()) (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
5270 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5274 /* Lite -- blinding */
5277 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
5278 if (p_ptr->resist_lite)
5280 dam *= 4; dam /= (randint1(4) + 7);
5282 else if (!blind && !p_ptr->resist_blind && !CHECK_MULTISHADOW())
5284 (void)set_blind(p_ptr->blind + randint1(5) + 2);
5287 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
5289 if (!CHECK_MULTISHADOW()) msg_print(_("光で肉体が焦がされた!", "The light scorches your flesh!"));
5292 else if (prace_is_(RACE_S_FAIRY))
5297 if (p_ptr->wraith_form) dam *= 2;
5298 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5300 if (p_ptr->wraith_form && !CHECK_MULTISHADOW())
5302 p_ptr->wraith_form = 0;
5303 msg_print(_("閃光のため非物質的な影の存在でいられなくなった。",
5304 "The light forces you out of your incorporeal shadow form."));
5306 p_ptr->redraw |= (PR_MAP | PR_STATUS);
5307 p_ptr->update |= (PU_MONSTERS);
5308 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
5314 /* Dark -- blinding */
5317 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
5318 if (p_ptr->resist_dark)
5320 dam *= 4; dam /= (randint1(4) + 7);
5322 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form) dam = 0;
5324 else if (!blind && !p_ptr->resist_blind && !CHECK_MULTISHADOW())
5326 (void)set_blind(p_ptr->blind + randint1(5) + 2);
5328 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5332 /* Time -- bolt fewer effects XXX */
5335 if (fuzzy) msg_print(_("過去からの衝撃に攻撃された!", "You are hit by a blast from the past!"));
5336 if (p_ptr->resist_time)
5339 dam /= (randint1(4) + 7);
5340 msg_print(_("時間が通り過ぎていく気がする。", "You feel as if time is passing you by."));
5342 else if (!CHECK_MULTISHADOW())
5344 switch (randint1(10))
5346 case 1: case 2: case 3: case 4: case 5:
5348 if (p_ptr->prace == RACE_ANDROID) break;
5349 msg_print(_("人生が逆戻りした気がする。", "You feel life has clocked back."));
5350 lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
5354 case 6: case 7: case 8: case 9:
5356 switch (randint1(6))
5358 case 1: k = A_STR; act = _("強く", "strong"); break;
5359 case 2: k = A_INT; act = _("聡明で", "bright"); break;
5360 case 3: k = A_WIS; act = _("賢明で", "wise"); break;
5361 case 4: k = A_DEX; act = _("器用で", "agile"); break;
5362 case 5: k = A_CON; act = _("健康で", "hale"); break;
5363 case 6: k = A_CHR; act = _("美しく", "beautiful"); break;
5366 msg_format(_("あなたは以前ほど%sなくなってしまった...。",
5367 "You're not as %s as you used to be..."), act);
5369 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 3) / 4;
5370 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
5371 p_ptr->update |= (PU_BONUS);
5377 msg_print(_("あなたは以前ほど力強くなくなってしまった...。",
5378 "You're not as powerful as you used to be..."));
5380 for (k = 0; k < A_MAX; k++)
5382 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 7) / 8;
5383 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
5385 p_ptr->update |= (PU_BONUS);
5391 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5395 /* Gravity -- stun plus slowness plus teleport */
5398 if (fuzzy) msg_print(_("何か重いもので攻撃された!", "You are hit by something heavy!"));
5399 msg_print(_("周辺の重力がゆがんだ。", "Gravity warps around you."));
5401 if (!CHECK_MULTISHADOW())
5403 teleport_player(5, TELEPORT_PASSIVE);
5404 if (!p_ptr->levitation)
5405 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
5406 if (!(p_ptr->resist_sound || p_ptr->levitation))
5408 int plus_stun = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
5409 (void)set_stun(p_ptr->stun + plus_stun);
5412 if (p_ptr->levitation)
5414 dam = (dam * 2) / 3;
5417 if (!p_ptr->levitation || one_in_(13))
5419 inven_damage(set_cold_destroy, 2);
5422 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5426 /* Standard damage */
5427 case GF_DISINTEGRATE:
5429 if (fuzzy) msg_print(_("純粋なエネルギーで攻撃された!", "You are hit by pure energy!"));
5431 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5437 if (fuzzy) msg_print(_("何らかの攻撃によって気分がよくなった。", "You are hit by something invigorating!"));
5439 (void)hp_player(dam);
5446 if (fuzzy) msg_print(_("何かで攻撃された!", "You are hit by something!"));
5447 (void)set_fast(p_ptr->fast + randint1(5), FALSE);
5454 if (fuzzy) msg_print(_("何か遅いもので攻撃された!", "You are hit by something slow!"));
5455 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
5461 if (p_ptr->free_act) break;
5462 if (fuzzy) msg_print(_("眠ってしまった!", "You fall asleep!"));
5464 if (ironman_nightmare)
5466 msg_print(_("恐ろしい光景が頭に浮かんできた。", "A horrible vision enters your mind."));
5467 /* Have some nightmares */
5468 sanity_blast(NULL, FALSE);
5471 set_paralyzed(p_ptr->paralyzed + dam);
5481 if (fuzzy) msg_print(_("魔法のオーラで攻撃された!", "You are hit by an aura of magic!"));
5482 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5489 if (fuzzy) msg_print(_("エネルギーの塊で攻撃された!", "You are hit by an energy!"));
5490 get_damage = take_hit(DAMAGE_FORCE, dam, killer, monspell);
5497 if (fuzzy) msg_print(_("何かが空からあなたの頭上に落ちてきた!", "Something falls from the sky on you!"));
5499 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5500 if (!p_ptr->resist_shard || one_in_(13))
5502 if (!p_ptr->immune_fire) inven_damage(set_fire_destroy, 2);
5503 inven_damage(set_cold_destroy, 2);
5509 /* Ice -- cold plus stun plus cuts */
5512 if (fuzzy) msg_print(_("何か鋭く冷たいもので攻撃された!", "You are hit by something sharp and cold!"));
5513 get_damage = cold_dam(dam, killer, monspell, FALSE);
5514 if (!CHECK_MULTISHADOW())
5516 if (!p_ptr->resist_shard)
5518 (void)set_cut(p_ptr->cut + damroll(5, 8));
5520 if (!p_ptr->resist_sound)
5522 (void)set_stun(p_ptr->stun + randint1(15));
5525 if ((!(p_ptr->resist_cold || IS_OPPOSE_COLD())) || one_in_(12))
5527 if (!p_ptr->immune_cold) inven_damage(set_cold_destroy, 3);
5537 if (fuzzy) msg_print(_("何か非常に冷たいもので攻撃された!", "You are hit by something extremely cold!"));
5539 if (p_ptr->mimic_form)
5541 if (!(mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
5542 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5547 switch (p_ptr->prace)
5549 /* Some races are immune */
5563 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5575 if (CHECK_MULTISHADOW())
5577 msg_print(_("攻撃は幻影に命中し、あなたには届かなかった。", "The attack hits Shadow, you are unharmed!"));
5579 else if (p_ptr->csp)
5583 msg_format(_("%^sに精神エネルギーを吸い取られてしまった!", "%^s draws psychic energy from you!"), m_name);
5585 msg_print(_("精神エネルギーを吸い取られてしまった!", "Your psychic energy is drawn!"));
5588 if (dam >= p_ptr->csp)
5592 p_ptr->csp_frac = 0;
5601 learn_spell(monspell);
5602 p_ptr->redraw |= (PR_MANA);
5603 p_ptr->window |= (PW_PLAYER | PW_SPELL);
5607 /* Heal the monster */
5608 if (m_ptr->hp < m_ptr->maxhp)
5612 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
5614 /* Redraw (later) if needed */
5615 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
5616 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
5618 /* Special message */
5621 msg_format(_("%^sは気分が良さそうだ。", "%^s appears healthier."), m_name);
5634 if ((randint0(100 + rlev / 2) < MAX(5, p_ptr->skill_sav)) && !CHECK_MULTISHADOW())
5636 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
5637 learn_spell(monspell);
5641 if (!CHECK_MULTISHADOW())
5643 msg_print(_("霊的エネルギーで精神が攻撃された。", "Your mind is blasted by psyonic energy."));
5645 if (!p_ptr->resist_conf)
5647 (void)set_confused(p_ptr->confused + randint0(4) + 4);
5650 if (!p_ptr->resist_chaos && one_in_(3))
5652 (void)set_image(p_ptr->image + randint0(250) + 150);
5659 p_ptr->csp_frac = 0;
5661 p_ptr->redraw |= PR_MANA;
5664 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5670 case GF_BRAIN_SMASH:
5672 if ((randint0(100 + rlev / 2) < MAX(5, p_ptr->skill_sav)) && !CHECK_MULTISHADOW())
5674 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
5675 learn_spell(monspell);
5679 if (!CHECK_MULTISHADOW())
5681 msg_print(_("霊的エネルギーで精神が攻撃された。", "Your mind is blasted by psyonic energy."));
5687 p_ptr->csp_frac = 0;
5689 p_ptr->redraw |= PR_MANA;
5692 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5693 if (!CHECK_MULTISHADOW())
5695 if (!p_ptr->resist_blind)
5697 (void)set_blind(p_ptr->blind + 8 + randint0(8));
5699 if (!p_ptr->resist_conf)
5701 (void)set_confused(p_ptr->confused + randint0(4) + 4);
5703 if (!p_ptr->free_act)
5705 (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
5707 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
5709 while (randint0(100 + rlev / 2) > (MAX(5, p_ptr->skill_sav)))
5710 (void)do_dec_stat(A_INT);
5711 while (randint0(100 + rlev / 2) > (MAX(5, p_ptr->skill_sav)))
5712 (void)do_dec_stat(A_WIS);
5714 if (!p_ptr->resist_chaos)
5716 (void)set_image(p_ptr->image + randint0(250) + 150);
5726 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
5728 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
5729 learn_spell(monspell);
5733 if (!CHECK_MULTISHADOW()) curse_equipment(15, 0);
5734 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5742 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
5744 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
5745 learn_spell(monspell);
5749 if (!CHECK_MULTISHADOW()) curse_equipment(25, MIN(rlev / 2 - 15, 5));
5750 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5758 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
5760 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
5761 learn_spell(monspell);
5765 if (!CHECK_MULTISHADOW()) curse_equipment(33, MIN(rlev / 2 - 15, 15));
5766 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5774 if ((randint0(100 + rlev / 2) < p_ptr->skill_sav) && !(m_ptr->r_idx == MON_KENSHIROU) && !CHECK_MULTISHADOW())
5776 msg_print(_("しかし秘孔を跳ね返した!", "You resist the effects!"));
5777 learn_spell(monspell);
5781 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
5782 if (!CHECK_MULTISHADOW()) (void)set_cut(p_ptr->cut + damroll(10, 10));
5790 if ((randint0(100 + rlev/2) < p_ptr->skill_sav) && !CHECK_MULTISHADOW())
5792 msg_print(_("しかし効力を跳ね返した!", "You resist the effects!"));
5793 learn_spell(monspell);
5797 if (!CHECK_MULTISHADOW())
5799 msg_print(_("あなたは命が薄まっていくように感じた!", "You feel your life fade away!"));
5800 curse_equipment(40, 20);
5803 get_damage = take_hit(DAMAGE_ATTACK, dam, m_name, monspell);
5805 if (p_ptr->chp < 1) p_ptr->chp = 1; /* Paranoia */
5820 /* Hex - revenge damage stored */
5821 revenge_store(get_damage);
5823 if ((p_ptr->tim_eyeeye || hex_spelling(HEX_EYE_FOR_EYE))
5824 && (get_damage > 0) && !p_ptr->is_dead && (who > 0))
5826 GAME_TEXT m_name_self[80];
5829 monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
5831 msg_format(_("攻撃が%s自身を傷つけた!", "The attack of %s has wounded %s!"), m_name, m_name_self);
5832 project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
5833 if (p_ptr->tim_eyeeye) set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
5836 if (p_ptr->riding && dam > 0)
5838 rakubadam_p = (dam > 200) ? 200 : dam;
5842 disturb(TRUE, TRUE);
5845 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && who && (who != p_ptr->riding))
5847 (void)kawarimi(FALSE);
5850 /* Return "Anything seen?" */
5856 * Find the distance from (x, y) to a line.
5858 POSITION dist_to_line(POSITION y, POSITION x, POSITION y1, POSITION x1, POSITION y2, POSITION x2)
5860 /* Vector from (x, y) to (x1, y1) */
5861 POSITION py = y1 - y;
5862 POSITION px = x1 - x;
5865 POSITION ny = x2 - x1;
5866 POSITION nx = y1 - y2;
5869 POSITION pd = distance(y1, x1, y, x);
5870 POSITION nd = distance(y1, x1, y2, x2);
5872 if (pd > nd) return distance(y, x, y2, x2);
5874 /* Component of P on N */
5875 nd = ((nd) ? ((py * ny + px * nx) / nd) : 0);
5877 /* Absolute value */
5878 return((nd >= 0) ? nd : 0 - nd);
5885 * Modified version of los() for calculation of disintegration balls.
5886 * Disintegration effects are stopped by permanent walls.
5888 bool in_disintegration_range(POSITION y1, POSITION x1, POSITION y2, POSITION x2)
5890 POSITION dx, dy; /* Delta */
5891 POSITION ax, ay; /* Absolute */
5892 POSITION sx, sy; /* Signs */
5893 POSITION qx, qy; /* Fractions */
5894 POSITION tx, ty; /* Scanners */
5895 POSITION f1, f2; /* Scale factors */
5896 POSITION m; /* Slope, or 1/Slope, of LOS */
5898 /* Extract the offset */
5902 /* Extract the absolute offset */
5906 /* Handle adjacent (or identical) grids */
5907 if ((ax < 2) && (ay < 2)) return (TRUE);
5909 /* Paranoia -- require "safe" origin */
5910 /* if (!in_bounds(y1, x1)) return (FALSE); */
5912 /* Directly South/North */
5915 /* South -- check for walls */
5918 for (ty = y1 + 1; ty < y2; ty++)
5920 if (cave_stop_disintegration(ty, x1)) return (FALSE);
5924 /* North -- check for walls */
5927 for (ty = y1 - 1; ty > y2; ty--)
5929 if (cave_stop_disintegration(ty, x1)) return (FALSE);
5937 /* Directly East/West */
5940 /* East -- check for walls */
5943 for (tx = x1 + 1; tx < x2; tx++)
5945 if (cave_stop_disintegration(y1, tx)) return (FALSE);
5949 /* West -- check for walls */
5952 for (tx = x1 - 1; tx > x2; tx--)
5954 if (cave_stop_disintegration(y1, tx)) return (FALSE);
5962 /* Extract some signs */
5963 sx = (dx < 0) ? -1 : 1;
5964 sy = (dy < 0) ? -1 : 1;
5966 /* Vertical "knights" */
5971 if (!cave_stop_disintegration(y1 + sy, x1)) return (TRUE);
5975 /* Horizontal "knights" */
5980 if (!cave_stop_disintegration(y1, x1 + sx)) return (TRUE);
5984 /* Calculate scale factor div 2 */
5987 /* Calculate scale factor */
5991 /* Travel horizontally */
5994 /* Let m = dy / dx * 2 * (dy * dx) = 2 * dy * dy */
6000 /* Consider the special case where slope == 1. */
6011 /* Note (below) the case (qy == f2), where */
6012 /* the LOS exactly meets the corner of a tile. */
6015 if (cave_stop_disintegration(ty, tx)) return (FALSE);
6026 if (cave_stop_disintegration(ty, tx)) return (FALSE);
6039 /* Travel vertically */
6042 /* Let m = dx / dy * 2 * (dx * dy) = 2 * dx * dx */
6058 /* Note (below) the case (qx == f2), where */
6059 /* the LOS exactly meets the corner of a tile. */
6062 if (cave_stop_disintegration(ty, tx)) return (FALSE);
6073 if (cave_stop_disintegration(ty, tx)) return (FALSE);
6094 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)
6099 int brev = rad * rad / dist;
6103 int mdis = distance(y1, x1, y2, x2) + rad;
6105 while (bdis <= mdis)
6109 if ((0 < dist) && (path_n < dist))
6111 POSITION ny = GRID_Y(path_g[path_n]);
6112 POSITION nx = GRID_X(path_g[path_n]);
6113 POSITION nd = distance(ny, nx, y1, x1);
6115 /* Get next base point */
6124 /* Travel from center outward */
6125 for (cdis = 0; cdis <= brad; cdis++)
6127 /* Scan the maximal blast area of radius "cdis" */
6128 for (y = by - cdis; y <= by + cdis; y++)
6130 for (x = bx - cdis; x <= bx + cdis; x++)
6132 /* Ignore "illegal" locations */
6133 if (!in_bounds(y, x)) continue;
6135 /* Enforce a circular "ripple" */
6136 if (distance(y1, x1, y, x) != bdis) continue;
6138 /* Enforce an arc */
6139 if (distance(by, bx, y, x) != cdis) continue;
6145 /* Lights are stopped by opaque terrains */
6146 if (!los(by, bx, y, x)) continue;
6148 case GF_DISINTEGRATE:
6149 /* Disintegration are stopped only by perma-walls */
6150 if (!in_disintegration_range(by, bx, y, x)) continue;
6153 /* Ball explosions are stopped by walls */
6154 if (!projectable(by, bx, y, x)) continue;
6158 /* Save this grid */
6166 /* Encode some more "radius" info */
6167 gm[bdis + 1] = *pgrids;
6169 /* Increase the size */
6170 brad = rad * (path_n + brev) / (dist + brev);
6172 /* Find the next ripple */
6176 /* Store the effect size */
6182 * @brief 汎用的なビーム/ボルト/ボール系処理のルーチン Generic "beam"/"bolt"/"ball" projection routine.
6183 * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
6184 * @param rad 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
6185 * @param y 目標Y座標 / Target y location (or location to travel "towards")
6186 * @param x 目標X座標 / Target x location (or location to travel "towards")
6187 * @param dam 基本威力 / Base damage roll to apply to affected monsters (or player)
6188 * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
6189 * @param flg 効果フラグ / Extra bit flags (see PROJECT_xxxx in "defines.h")
6190 * @param monspell 効果元のモンスター魔法ID
6191 * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
6194 * Allows a monster (or player) to project a beam/bolt/ball of a given kind
6195 * towards a given location (optionally passing over the heads of interposing
6196 * monsters), and have it do a given amount of damage to the monsters (and
6197 * optionally objects) within the given radius of the final location.
6199 * A "bolt" travels from source to target and affects only the target grid.
6200 * A "beam" travels from source to target, affecting all grids passed through.
6201 * A "ball" travels from source to the target, exploding at the target, and
6202 * affecting everything within the given radius of the target location.
6204 * Traditionally, a "bolt" does not affect anything on the ground, and does
6205 * not pass over the heads of interposing monsters, much like a traditional
6206 * missile, and will "stop" abruptly at the "target" even if no monster is
6207 * positioned there, while a "ball", on the other hand, passes over the heads
6208 * of monsters between the source and target, and affects everything except
6209 * the source monster which lies within the final radius, while a "beam"
6210 * affects every monster between the source and target, except for the casting
6211 * monster (or player), and rarely affects things on the ground.
6213 * Two special flags allow us to use this function in special ways, the
6214 * "PROJECT_HIDE" flag allows us to perform "invisible" projections, while
6215 * the "PROJECT_JUMP" flag allows us to affect a specific grid, without
6216 * actually projecting from the source monster (or player).
6218 * The player will only get "experience" for monsters killed by himself
6219 * Unique monsters can only be destroyed by attacks from the player
6221 * Only 256 grids can be affected per projection, limiting the effective
6222 * "radius" of standard ball attacks to nine units (diameter nineteen).
6224 * One can project in a given "direction" by combining PROJECT_THRU with small
6225 * offsets to the initial location (see "line_spell()"), or by calculating
6226 * "virtual targets" far away from the player.
6228 * One can also use PROJECT_THRU to send a beam/bolt along an angled path,
6229 * continuing until it actually hits somethings (useful for "stone to mud").
6231 * Bolts and Beams explode INSIDE walls, so that they can destroy doors.
6233 * Balls must explode BEFORE hitting walls, or they would affect monsters
6234 * on both sides of a wall. Some bug reports indicate that this is still
6235 * happening in 2.7.8 for Windows, though it appears to be impossible.
6237 * We "pre-calculate" the blast area only in part for efficiency.
6238 * More importantly, this lets us do "explosions" from the "inside" out.
6239 * This results in a more logical distribution of "blast" treasure.
6240 * It also produces a better (in my opinion) animation of the explosion.
6241 * It could be (but is not) used to have the treasure dropped by monsters
6242 * in the middle of the explosion fall "outwards", and then be damaged by
6243 * the blast as it spreads outwards towards the treasure drop location.
6245 * Walls and doors are included in the blast area, so that they can be
6246 * "burned" or "melted" in later versions.
6248 * This algorithm is intended to maximize simplicity, not necessarily
6249 * efficiency, since this function is not a bottleneck in the code.
6251 * We apply the blast effect from ground zero outwards, in several passes,
6252 * first affecting features, then objects, then monsters, then the player.
6253 * This allows walls to be removed before checking the object or monster
6254 * in the wall, and protects objects which are dropped by monsters killed
6255 * in the blast, and allows the player to see all affects before he is
6256 * killed or teleported away. The semantics of this method are open to
6257 * various interpretations, but they seem to work well in practice.
6259 * We process the blast area from ground-zero outwards to allow for better
6260 * distribution of treasure dropped by monsters, and because it provides a
6261 * pleasing visual effect at low cost.
6263 * Note that the damage done by "ball" explosions decreases with distance.
6264 * This decrease is rapid, grids at radius "dist" take "1/dist" damage.
6266 * Notice the "napalm" effect of "beam" weapons. First they "project" to
6267 * the target, and then the damage "flows" along this beam of destruction.
6268 * The damage at every grid is the same as at the "center" of a "ball"
6269 * explosion, since the "beam" grids are treated as if they ARE at the
6270 * center of a "ball" explosion.
6272 * Currently, specifying "beam" plus "ball" means that locations which are
6273 * covered by the initial "beam", and also covered by the final "ball", except
6274 * for the final grid (the epicenter of the ball), will be "hit twice", once
6275 * by the initial beam, and once by the exploding ball. For the grid right
6276 * next to the epicenter, this results in 150% damage being done. The center
6277 * does not have this problem, for the same reason the final grid in a "beam"
6278 * plus "bolt" does not -- it is explicitly removed. Simply removing "beam"
6279 * grids which are covered by the "ball" will NOT work, as then they will
6280 * receive LESS damage than they should. Do not combine "beam" with "ball".
6282 * The array "gy[],gx[]" with current size "grids" is used to hold the
6283 * collected locations of all grids in the "blast area" plus "beam path".
6285 * Note the rather complex usage of the "gm[]" array. First, gm[0] is always
6286 * zero. Second, for N>1, gm[N] is always the index (in gy[],gx[]) of the
6287 * first blast grid (see above) with radius "N" from the blast center. Note
6288 * that only the first gm[1] grids in the blast area thus take full damage.
6289 * Also, note that gm[rad+1] is always equal to "grids", which is the total
6290 * number of blast grids.
6292 * Note that once the projection is complete, (y2,x2) holds the final location
6293 * of bolts/beams, and the "epicenter" of balls.
6295 * Note also that "rad" specifies the "inclusive" radius of projection blast,
6296 * so that a "rad" of "one" actually covers 5 or 9 grids, depending on the
6297 * implementation of the "distance" function. Also, a bolt can be properly
6298 * viewed as a "ball" with a "rad" of "zero".
6300 * Note that if no "target" is reached before the beam/bolt/ball travels the
6301 * maximum distance allowed (MAX_RANGE), no "blast" will be induced. This
6302 * may be relevant even for bolts, since they have a "1x1" mini-blast.
6304 * Note that for consistency, we "pretend" that the bolt actually takes "time"
6305 * to move from point A to point B, even if the player cannot see part of the
6306 * projection path. Note that in general, the player will *always* see part
6307 * of the path, since it either starts at the player or ends on the player.
6309 * Hack -- we assume that every "projection" is "self-illuminating".
6311 * Hack -- when only a single monster is affected, we automatically track
6312 * (and recall) that monster, unless "PROJECT_JUMP" is used.
6314 * Note that all projections now "explode" at their final destination, even
6315 * if they were being projected at a more distant destination. This means
6316 * that "ball" spells will *always* explode.
6318 * Note that we must call "handle_stuff()" after affecting terrain features
6319 * in the blast radius, in case the "illumination" of the grid was changed,
6320 * and "update_view()" and "update_monsters()" need to be called.
6323 bool project(MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, HIT_POINT dam, EFFECT_ID typ, BIT_FLAGS flg, int monspell)
6333 POSITION y_saver, x_saver; /* For reflecting monsters */
6335 int msec = delay_factor * delay_factor * delay_factor;
6337 /* Assume the player sees nothing */
6338 bool notice = FALSE;
6340 /* Assume the player has seen nothing */
6341 bool visual = FALSE;
6343 /* Assume the player has seen no blast grids */
6346 /* Assume to be a normal ball spell */
6347 bool breath = FALSE;
6349 /* Is the player blind? */
6350 bool blind = (p_ptr->blind ? TRUE : FALSE);
6352 bool old_hide = FALSE;
6354 /* Number of grids in the "path" */
6357 /* Actual grids in the "path" */
6360 /* Number of grids in the "blast area" (including the "beam" path) */
6363 /* Coordinates of the affected grids */
6364 POSITION gx[1024], gy[1024];
6366 /* Encoded "radius" info (see above) */
6369 /* Actual radius encoded in gm[] */
6370 POSITION gm_rad = rad;
6374 /* Attacker's name (prepared before polymorph)*/
6375 GAME_TEXT who_name[MAX_NLEN];
6377 /* Can the player see the source of this effect? */
6378 bool see_s_msg = TRUE;
6380 /* Initialize by null string */
6386 /* Default target of monsterspell is player */
6387 monster_target_y = p_ptr->y;
6388 monster_target_x = p_ptr->x;
6390 /* Hack -- Jump to target */
6391 if (flg & (PROJECT_JUMP))
6396 /* Clear the flag */
6397 flg &= ~(PROJECT_JUMP);
6402 /* Start at player */
6409 /* Start at monster */
6412 x1 = m_list[who].fx;
6413 y1 = m_list[who].fy;
6414 monster_desc(who_name, &m_list[who], MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
6426 /* Default "destination" */
6431 /* Hack -- verify stuff */
6432 if (flg & (PROJECT_THRU))
6434 if ((x1 == x2) && (y1 == y2))
6436 flg &= ~(PROJECT_THRU);
6440 /* Handle a breath attack */
6445 if (flg & PROJECT_HIDE) old_hide = TRUE;
6446 flg |= PROJECT_HIDE;
6450 /* Hack -- Assume there will be no blast (max radius 32) */
6451 for (dist = 0; dist < 32; dist++) gm[dist] = 0;
6459 /* Collect beam grids */
6460 if (flg & (PROJECT_BEAM))
6471 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_LOS);
6473 case GF_DISINTEGRATE:
6474 flg |= (PROJECT_GRID);
6475 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_DISI);
6479 /* Calculate the projection path */
6481 path_n = project_path(path_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, flg);
6484 /* Giga-Hack SEEKER & SUPER_RAY */
6486 if( typ == GF_SEEKER )
6496 for (i = 0; i < path_n; ++i)
6501 int ny = GRID_Y(path_g[i]);
6502 int nx = GRID_X(path_g[i]);
6513 /* Only do visuals if requested */
6514 if (!blind && !(flg & (PROJECT_HIDE)))
6516 /* Only do visuals if the player can "see" the bolt */
6517 if (panel_contains(y, x) && player_has_los_bold(y, x))
6524 /* Obtain the bolt pict */
6525 p = bolt_pict(oy, ox, y, x, typ);
6527 /* Extract attr/char */
6531 /* Visual effects */
6532 print_rel(c, a, y, x);
6533 move_cursor_relative(y, x);
6534 /*if (fresh_before)*/ Term_fresh();
6535 Term_xtra(TERM_XTRA_DELAY, msec);
6537 /*if (fresh_before)*/ Term_fresh();
6539 /* Display "beam" grids */
6540 if (flg & (PROJECT_BEAM))
6542 /* Obtain the explosion pict */
6543 p = bolt_pict(y, x, y, x, typ);
6545 /* Extract attr/char */
6549 /* Visual effects */
6550 print_rel(c, a, y, x);
6553 /* Hack -- Activate delay */
6557 /* Hack -- delay anyway for consistency */
6560 /* Delay for consistency */
6561 Term_xtra(TERM_XTRA_DELAY, msec);
6564 if (project_o(0, 0, y, x, dam, GF_SEEKER))notice = TRUE;
6565 if (is_mirror_grid(&cave[y][x]))
6567 /* The target of monsterspell becomes tha mirror(broken) */
6568 monster_target_y = y;
6569 monster_target_x = x;
6571 remove_mirror(y, x);
6572 next_mirror(&oy, &ox, y, x);
6574 path_n = i + project_path(&(path_g[i + 1]), (project_length ? project_length : MAX_RANGE), y, x, oy, ox, flg);
6575 for (j = last_i; j <= i; j++)
6577 y = GRID_Y(path_g[j]);
6578 x = GRID_X(path_g[j]);
6579 if (project_m(0, 0, y, x, dam, GF_SEEKER, flg, TRUE)) notice = TRUE;
6580 if (!who && (project_m_n == 1) && !jump) {
6581 if (cave[project_m_y][project_m_x].m_idx > 0) {
6582 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
6586 /* Hack -- auto-recall */
6587 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
6589 /* Hack - auto-track */
6590 health_track(cave[project_m_y][project_m_x].m_idx);
6594 (void)project_f(0, 0, y, x, dam, GF_SEEKER);
6599 for(i = last_i ; i < path_n ; i++)
6602 py = GRID_Y(path_g[i]);
6603 px = GRID_X(path_g[i]);
6604 if (project_m(0, 0, py, px, dam, GF_SEEKER, flg, TRUE))
6606 if (!who && (project_m_n == 1) && !jump) {
6607 if (cave[project_m_y][project_m_x].m_idx > 0)
6609 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
6613 /* Hack -- auto-recall */
6614 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
6616 /* Hack - auto-track */
6617 health_track(cave[project_m_y][project_m_x].m_idx);
6621 (void)project_f(0, 0, py, px, dam, GF_SEEKER);
6625 else if(typ == GF_SUPER_RAY){
6627 int second_step = 0;
6634 for (i = 0; i < path_n; ++i)
6639 POSITION ny = GRID_Y(path_g[i]);
6640 POSITION nx = GRID_X(path_g[i]);
6651 /* Only do visuals if requested */
6652 if (!blind && !(flg & (PROJECT_HIDE)))
6654 /* Only do visuals if the player can "see" the bolt */
6655 if (panel_contains(y, x) && player_has_los_bold(y, x))
6662 /* Obtain the bolt pict */
6663 p = bolt_pict(oy, ox, y, x, typ);
6665 /* Extract attr/char */
6669 /* Visual effects */
6670 print_rel(c, a, y, x);
6671 move_cursor_relative(y, x);
6672 /*if (fresh_before)*/ Term_fresh();
6673 Term_xtra(TERM_XTRA_DELAY, msec);
6675 /*if (fresh_before)*/ Term_fresh();
6677 /* Display "beam" grids */
6678 if (flg & (PROJECT_BEAM))
6680 /* Obtain the explosion pict */
6681 p = bolt_pict(y, x, y, x, typ);
6683 /* Extract attr/char */
6687 /* Visual effects */
6688 print_rel(c, a, y, x);
6691 /* Hack -- Activate delay */
6695 /* Hack -- delay anyway for consistency */
6698 /* Delay for consistency */
6699 Term_xtra(TERM_XTRA_DELAY, msec);
6702 if(project_o(0,0,y,x,dam,GF_SUPER_RAY) )notice=TRUE;
6703 if (!cave_have_flag_bold(y, x, FF_PROJECT))
6705 if( second_step )continue;
6708 if( is_mirror_grid(&cave[y][x]) && !second_step )
6710 /* The target of monsterspell becomes tha mirror(broken) */
6711 monster_target_y=(s16b)y;
6712 monster_target_x=(s16b)x;
6715 for( j = 0; j <=i ; j++ )
6717 y = GRID_Y(path_g[j]);
6718 x = GRID_X(path_g[j]);
6719 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
6723 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x-1, flg);
6724 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x , flg);
6725 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, 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 , x+1, flg);
6728 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x-1, flg);
6729 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x , flg);
6730 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x+1, flg);
6733 for( i = 0; i < path_n ; i++ )
6736 py = GRID_Y(path_g[i]);
6737 px = GRID_X(path_g[i]);
6738 (void)project_m(0, 0, py, px, dam, GF_SUPER_RAY, flg, TRUE);
6739 if(!who && (project_m_n == 1) && !jump){
6740 if(cave[project_m_y][project_m_x].m_idx >0 ){
6741 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
6745 /* Hack -- auto-recall */
6746 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
6748 /* Hack - auto-track */
6749 health_track(cave[project_m_y][project_m_x].m_idx);
6753 (void)project_f(0, 0, py, px, dam, GF_SUPER_RAY);
6758 /* Project along the path */
6759 for (i = 0; i < path_n; ++i)
6764 POSITION ny = GRID_Y(path_g[i]);
6765 POSITION nx = GRID_X(path_g[i]);
6767 if (flg & PROJECT_DISI)
6769 /* Hack -- Balls explode before reaching walls */
6770 if (cave_stop_disintegration(ny, nx) && (rad > 0)) break;
6772 else if (flg & PROJECT_LOS)
6774 /* Hack -- Balls explode before reaching walls */
6775 if (!cave_los_bold(ny, nx) && (rad > 0)) break;
6779 /* Hack -- Balls explode before reaching walls */
6780 if (!cave_have_flag_bold(ny, nx, FF_PROJECT) && (rad > 0)) break;
6787 /* Collect beam grids */
6788 if (flg & (PROJECT_BEAM))
6795 /* Only do visuals if requested */
6796 if (!blind && !(flg & (PROJECT_HIDE | PROJECT_FAST)))
6798 /* Only do visuals if the player can "see" the bolt */
6799 if (panel_contains(y, x) && player_has_los_bold(y, x))
6806 /* Obtain the bolt pict */
6807 p = bolt_pict(oy, ox, y, x, typ);
6809 /* Extract attr/char */
6813 /* Visual effects */
6814 print_rel(c, a, y, x);
6815 move_cursor_relative(y, x);
6816 /*if (fresh_before)*/ Term_fresh();
6817 Term_xtra(TERM_XTRA_DELAY, msec);
6819 /*if (fresh_before)*/ Term_fresh();
6821 /* Display "beam" grids */
6822 if (flg & (PROJECT_BEAM))
6824 /* Obtain the explosion pict */
6825 p = bolt_pict(y, x, y, x, typ);
6827 /* Extract attr/char */
6831 /* Visual effects */
6832 print_rel(c, a, y, x);
6835 /* Hack -- Activate delay */
6839 /* Hack -- delay anyway for consistency */
6842 /* Delay for consistency */
6843 Term_xtra(TERM_XTRA_DELAY, msec);
6850 /* Save the "blast epicenter" */
6854 if (breath && !path_n)
6860 flg &= ~(PROJECT_HIDE);
6864 /* Start the "explosion" */
6867 /* Hack -- make sure beams get to "explode" */
6875 /* If we found a "target", explode there */
6876 if (dist <= MAX_RANGE)
6878 /* Mega-Hack -- remove the final "beam" grid */
6879 if ((flg & (PROJECT_BEAM)) && (grids > 0)) grids--;
6882 * Create a conical breath attack
6893 flg &= ~(PROJECT_HIDE);
6895 breath_shape(path_g, dist, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, by, bx, typ);
6899 /* Determine the blast area, work from the inside out */
6900 for (dist = 0; dist <= rad; dist++)
6902 /* Scan the maximal blast area of radius "dist" */
6903 for (y = by - dist; y <= by + dist; y++)
6905 for (x = bx - dist; x <= bx + dist; x++)
6907 /* Ignore "illegal" locations */
6908 if (!in_bounds2(y, x)) continue;
6910 /* Enforce a "circular" explosion */
6911 if (distance(by, bx, y, x) != dist) continue;
6917 /* Lights are stopped by opaque terrains */
6918 if (!los(by, bx, y, x)) continue;
6920 case GF_DISINTEGRATE:
6921 /* Disintegration are stopped only by perma-walls */
6922 if (!in_disintegration_range(by, bx, y, x)) continue;
6925 /* Ball explosions are stopped by walls */
6926 if (!projectable(by, bx, y, x)) continue;
6930 /* Save this grid */
6937 /* Encode some more "radius" info */
6943 /* Speed -- ignore "non-explosions" */
6944 if (!grids) return (FALSE);
6947 /* Display the "blast area" if requested */
6948 if (!blind && !(flg & (PROJECT_HIDE)))
6950 /* Then do the "blast", from inside out */
6951 for (t = 0; t <= gm_rad; t++)
6953 /* Dump everything with this radius */
6954 for (i = gm[t]; i < gm[t+1]; i++)
6956 /* Extract the location */
6960 /* Only do visuals if the player can "see" the blast */
6961 if (panel_contains(y, x) && player_has_los_bold(y, x))
6970 /* Obtain the explosion pict */
6971 p = bolt_pict(y, x, y, x, typ);
6973 /* Extract attr/char */
6977 /* Visual effects -- Display */
6978 print_rel(c, a, y, x);
6982 /* Hack -- center the cursor */
6983 move_cursor_relative(by, bx);
6985 /* Flush each "radius" seperately */
6986 /*if (fresh_before)*/ Term_fresh();
6988 /* Delay (efficiently) */
6989 if (visual || drawn)
6991 Term_xtra(TERM_XTRA_DELAY, msec);
6995 /* Flush the erasing */
6998 /* Erase the explosion drawn above */
6999 for (i = 0; i < grids; i++)
7001 /* Extract the location */
7005 /* Hack -- Erase if needed */
7006 if (panel_contains(y, x) && player_has_los_bold(y, x))
7012 /* Hack -- center the cursor */
7013 move_cursor_relative(by, bx);
7015 /* Flush the explosion */
7016 /*if (fresh_before)*/ Term_fresh();
7020 update_creature(p_ptr);
7022 if (flg & PROJECT_KILL)
7024 see_s_msg = (who > 0) ? is_seen(&m_list[who]) :
7025 (!who ? TRUE : (player_can_see_bold(y1, x1) && projectable(p_ptr->y, p_ptr->x, y1, x1)));
7029 /* Check features */
7030 if (flg & (PROJECT_GRID))
7032 /* Start with "dist" of zero */
7035 /* Scan for features */
7036 for (i = 0; i < grids; i++)
7038 /* Hack -- Notice new "dist" values */
7039 if (gm[dist+1] == i) dist++;
7041 /* Get the grid location */
7045 /* Find the closest point in the blast */
7048 int d = dist_to_line(y, x, y1, x1, by, bx);
7050 /* Affect the grid */
7051 if (project_f(who, d, y, x, dam, typ)) notice = TRUE;
7055 /* Affect the grid */
7056 if (project_f(who, dist, y, x, dam, typ)) notice = TRUE;
7061 update_creature(p_ptr);
7064 if (flg & (PROJECT_ITEM))
7066 /* Start with "dist" of zero */
7069 /* Scan for objects */
7070 for (i = 0; i < grids; i++)
7072 /* Hack -- Notice new "dist" values */
7073 if (gm[dist+1] == i) dist++;
7075 /* Get the grid location */
7079 /* Find the closest point in the blast */
7082 int d = dist_to_line(y, x, y1, x1, by, bx);
7084 /* Affect the object in the grid */
7085 if (project_o(who, d, y, x, dam, typ)) notice = TRUE;
7089 /* Affect the object in the grid */
7090 if (project_o(who, dist, y, x, dam, typ)) notice = TRUE;
7096 /* Check monsters */
7097 if (flg & (PROJECT_KILL))
7104 /* Start with "dist" of zero */
7107 /* Scan for monsters */
7108 for (i = 0; i < grids; i++)
7112 /* Hack -- Notice new "dist" values */
7113 if (gm[dist + 1] == i) dist++;
7115 /* Get the grid location */
7119 /* A single bolt may be reflected */
7122 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
7123 monster_race *ref_ptr = &r_info[m_ptr->r_idx];
7125 if ((flg & PROJECT_REFLECTABLE) && cave[y][x].m_idx && (ref_ptr->flags2 & RF2_REFLECTING) &&
7126 ((cave[y][x].m_idx != p_ptr->riding) || !(flg & PROJECT_PLAYER)) &&
7127 (!who || dist_hack > 1) && !one_in_(10))
7130 int max_attempts = 10;
7132 /* Choose 'new' target */
7135 t_y = y_saver - 1 + randint1(3);
7136 t_x = x_saver - 1 + randint1(3);
7139 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(y, x, t_y, t_x));
7141 if (max_attempts < 1)
7147 sound(SOUND_REFLECT);
7150 if ((m_ptr->r_idx == MON_KENSHIROU) || (m_ptr->r_idx == MON_RAOU))
7151 msg_print(_("「北斗神拳奥義・二指真空把!」", "The attack bounces!"));
7152 else if (m_ptr->r_idx == MON_DIO)
7153 msg_print(_("ディオ・ブランドーは指一本で攻撃を弾き返した!", "The attack bounces!"));
7155 msg_print(_("攻撃は跳ね返った!", "The attack bounces!"));
7157 if (is_original_ap_and_seen(m_ptr)) ref_ptr->r_flags2 |= RF2_REFLECTING;
7159 /* Reflected bolts randomly target either one */
7160 if (player_bold(y, x) || one_in_(2)) flg &= ~(PROJECT_PLAYER);
7161 else flg |= PROJECT_PLAYER;
7163 /* The bolt is reflected */
7164 project(cave[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
7166 /* Don't affect the monster any longer */
7172 /* Find the closest point in the blast */
7175 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
7179 effective_dist = dist;
7183 /* There is the riding player on this monster */
7184 if (p_ptr->riding && player_bold(y, x))
7186 /* Aimed on the player */
7187 if (flg & PROJECT_PLAYER)
7189 if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
7192 * A beam or bolt is well aimed
7194 * So don't affects the mount.
7201 * The spell is not well aimed,
7202 * So partly affect the mount too.
7209 * This grid is the original target.
7210 * Or aimed on your horse.
7212 else if (((y == y2) && (x == x2)) || (flg & PROJECT_AIMED))
7214 /* Hit the mount with full damage */
7218 * Otherwise this grid is not the
7219 * original target, it means that line
7220 * of fire is obstructed by this
7224 * A beam or bolt will hit either
7225 * player or mount. Choose randomly.
7227 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE))
7231 /* Hit the mount with full damage */
7235 /* Hit the player later */
7236 flg |= PROJECT_PLAYER;
7238 /* Don't affect the mount */
7244 * The spell is not well aimed, so
7245 * partly affect both player and
7254 /* Affect the monster in the grid */
7255 if (project_m(who, effective_dist, y, x, dam, typ, flg, see_s_msg)) notice = TRUE;
7259 /* Player affected one monster (without "jumping") */
7260 if (!who && (project_m_n == 1) && !jump)
7265 /* Track if possible */
7266 if (cave[y][x].m_idx > 0)
7268 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
7272 /* Hack -- auto-recall */
7273 if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
7275 /* Hack - auto-track */
7276 if (m_ptr->ml) health_track(cave[y][x].m_idx);
7284 if (flg & (PROJECT_KILL))
7286 /* Start with "dist" of zero */
7289 /* Scan for player */
7290 for (i = 0; i < grids; i++)
7294 /* Hack -- Notice new "dist" values */
7295 if (gm[dist+1] == i) dist++;
7297 /* Get the grid location */
7301 /* Affect the player? */
7302 if (!player_bold(y, x)) continue;
7304 /* Find the closest point in the blast */
7307 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
7311 effective_dist = dist;
7314 /* Target may be your horse */
7317 /* Aimed on the player */
7318 if (flg & PROJECT_PLAYER)
7320 /* Hit the player with full damage */
7324 * Hack -- When this grid was not the
7325 * original target, a beam or bolt
7326 * would hit either player or mount,
7327 * and should be choosen randomly.
7329 * But already choosen to hit the
7330 * mount at this point.
7332 * Or aimed on your horse.
7334 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
7337 * A beam or bolt is well aimed
7339 * So don't affects the player.
7346 * The spell is not well aimed,
7347 * So partly affect the player too.
7353 /* Affect the player */
7354 if (project_p(who, who_name, effective_dist, y, x, dam, typ, flg, monspell)) notice = TRUE;
7360 GAME_TEXT m_name[MAX_NLEN];
7362 monster_desc(m_name, &m_list[p_ptr->riding], 0);
7364 if (rakubadam_m > 0)
7366 if (rakuba(rakubadam_m, FALSE))
7368 msg_format(_("%^sに振り落とされた!", "%^s has thrown you off!"), m_name);
7371 if (p_ptr->riding && rakubadam_p > 0)
7373 if(rakuba(rakubadam_p, FALSE))
7375 msg_format(_("%^sから落ちてしまった!", "You have fallen from %s."), m_name);
7380 /* Return "something was noticed" */
7385 * @brief 鏡魔法「封魔結界」の効果処理
7387 * @return 効果があったらTRUEを返す
7389 bool binding_field(HIT_POINT dam)
7391 POSITION mirror_x[10], mirror_y[10]; /* 鏡はもっと少ない */
7392 int mirror_num = 0; /* 鏡の数 */
7394 POSITION centersign;
7395 POSITION x1, x2, y1, y2;
7397 int msec = delay_factor*delay_factor*delay_factor;
7400 POSITION point_x[3];
7401 POSITION point_y[3];
7403 /* Default target of monsterspell is player */
7404 monster_target_y = p_ptr->y;
7405 monster_target_x = p_ptr->x;
7407 for (x = 0; x < cur_wid; x++)
7409 for (y = 0; y < cur_hgt; y++)
7411 if (is_mirror_grid(&cave[y][x]) &&
7412 distance(p_ptr->y, p_ptr->x, y, x) <= MAX_RANGE &&
7413 distance(p_ptr->y, p_ptr->x, y, x) != 0 &&
7414 player_has_los_bold(y, x) &&
7415 projectable(p_ptr->y, p_ptr->x, y, x)
7417 mirror_y[mirror_num] = y;
7418 mirror_x[mirror_num] = x;
7424 if (mirror_num < 2)return FALSE;
7426 point_x[0] = randint0(mirror_num);
7428 point_x[1] = randint0(mirror_num);
7429 } while (point_x[0] == point_x[1]);
7431 point_y[0] = mirror_y[point_x[0]];
7432 point_x[0] = mirror_x[point_x[0]];
7433 point_y[1] = mirror_y[point_x[1]];
7434 point_x[1] = mirror_x[point_x[1]];
7435 point_y[2] = p_ptr->y;
7436 point_x[2] = p_ptr->x;
7438 x = point_x[0] + point_x[1] + point_x[2];
7439 y = point_y[0] + point_y[1] + point_y[2];
7441 centersign = (point_x[0] * 3 - x)*(point_y[1] * 3 - y)
7442 - (point_y[0] * 3 - y)*(point_x[1] * 3 - x);
7443 if (centersign == 0)return FALSE;
7445 x1 = point_x[0] < point_x[1] ? point_x[0] : point_x[1];
7446 x1 = x1 < point_x[2] ? x1 : point_x[2];
7447 y1 = point_y[0] < point_y[1] ? point_y[0] : point_y[1];
7448 y1 = y1 < point_y[2] ? y1 : point_y[2];
7450 x2 = point_x[0] > point_x[1] ? point_x[0] : point_x[1];
7451 x2 = x2 > point_x[2] ? x2 : point_x[2];
7452 y2 = point_y[0] > point_y[1] ? point_y[0] : point_y[1];
7453 y2 = y2 > point_y[2] ? y2 : point_y[2];
7455 for (y = y1; y <= y2; y++) {
7456 for (x = x1; x <= x2; x++) {
7457 if (centersign*((point_x[0] - x)*(point_y[1] - y)
7458 - (point_y[0] - y)*(point_x[1] - x)) >= 0 &&
7459 centersign*((point_x[1] - x)*(point_y[2] - y)
7460 - (point_y[1] - y)*(point_x[2] - x)) >= 0 &&
7461 centersign*((point_x[2] - x)*(point_y[0] - y)
7462 - (point_y[2] - y)*(point_x[0] - x)) >= 0)
7464 if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
7465 /* Visual effects */
7467 && panel_contains(y, x)) {
7468 p = bolt_pict(y, x, y, x, GF_MANA);
7469 print_rel(PICT_C(p), PICT_A(p), y, x);
7470 move_cursor_relative(y, x);
7471 /*if (fresh_before)*/ Term_fresh();
7472 Term_xtra(TERM_XTRA_DELAY, msec);
7478 for (y = y1; y <= y2; y++) {
7479 for (x = x1; x <= x2; x++) {
7480 if (centersign*((point_x[0] - x)*(point_y[1] - y)
7481 - (point_y[0] - y)*(point_x[1] - x)) >= 0 &&
7482 centersign*((point_x[1] - x)*(point_y[2] - y)
7483 - (point_y[1] - y)*(point_x[2] - x)) >= 0 &&
7484 centersign*((point_x[2] - x)*(point_y[0] - y)
7485 - (point_y[2] - y)*(point_x[0] - x)) >= 0)
7487 if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
7488 (void)project_f(0, 0, y, x, dam, GF_MANA);
7493 for (y = y1; y <= y2; y++) {
7494 for (x = x1; x <= x2; x++) {
7495 if (centersign*((point_x[0] - x)*(point_y[1] - y)
7496 - (point_y[0] - y)*(point_x[1] - x)) >= 0 &&
7497 centersign*((point_x[1] - x)*(point_y[2] - y)
7498 - (point_y[1] - y)*(point_x[2] - x)) >= 0 &&
7499 centersign*((point_x[2] - x)*(point_y[0] - y)
7500 - (point_y[2] - y)*(point_x[0] - x)) >= 0)
7502 if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
7503 (void)project_o(0, 0, y, x, dam, GF_MANA);
7508 for (y = y1; y <= y2; y++) {
7509 for (x = x1; x <= x2; x++) {
7510 if (centersign*((point_x[0] - x)*(point_y[1] - y)
7511 - (point_y[0] - y)*(point_x[1] - x)) >= 0 &&
7512 centersign*((point_x[1] - x)*(point_y[2] - y)
7513 - (point_y[1] - y)*(point_x[2] - x)) >= 0 &&
7514 centersign*((point_x[2] - x)*(point_y[0] - y)
7515 - (point_y[2] - y)*(point_x[0] - x)) >= 0)
7517 if (player_has_los_bold(y, x) && projectable(p_ptr->y, p_ptr->x, y, x)) {
7518 (void)project_m(0, 0, y, x, dam, GF_MANA,
7519 (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP), TRUE);
7525 msg_print(_("鏡が結界に耐えきれず、壊れてしまった。", "The field broke a mirror"));
7526 remove_mirror(point_y[0], point_x[0]);
7533 * @brief 鏡魔法「鏡の封印」の効果処理
7535 * @return 効果があったらTRUEを返す
7537 void seal_of_mirror(HIT_POINT dam)
7541 for (x = 0; x < cur_wid; x++)
7543 for (y = 0; y < cur_hgt; y++)
7545 if (is_mirror_grid(&cave[y][x]))
7547 if (project_m(0, 0, y, x, dam, GF_GENOCIDE,
7548 (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP), TRUE))
7550 if (!cave[y][x].m_idx)
7552 remove_mirror(y, x);
7564 * @brief 領域魔法に応じて技能の名称を返す。
7565 * @param tval 魔法書のtval
7566 * @return 領域魔法の技能名称を保管した文字列ポインタ
7568 concptr spell_category_name(OBJECT_TYPE_VALUE tval)
7572 case TV_HISSATSU_BOOK:
7573 return _("必殺技", "art");
7575 return _("祈り", "prayer");
7577 return _("歌", "song");
7579 return _("呪文", "spell");