4 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
6 * This software may be copied and distributed for educational, research,
7 * and not for profit purposes provided that this copyright and statement
8 * are included in all such copies. Other copyrights may also apply.
11 /* Purpose: Spell projection */
15 /* ToDo: Make this global */
16 /* 1/x chance of reducing stats (for elemental attacks) */
17 #define HURT_CHANCE 16
20 static int rakubadam_m;
21 static int rakubadam_p;
23 int project_length = 0;
26 * Get another mirror. for SEEKER
28 static void next_mirror( int* next_y , int* next_x , int cury, int curx)
30 int mirror_x[10],mirror_y[10]; /* ¶À¤Ï¤â¤Ã¤È¾¯¤Ê¤¤ */
31 int mirror_num=0; /* ¶À¤Î¿ô */
35 for( x=0 ; x < cur_wid ; x++ )
37 for( y=0 ; y < cur_hgt ; y++ )
39 if( is_mirror_grid(&cave[y][x])){
40 mirror_y[mirror_num]=y;
41 mirror_x[mirror_num]=x;
48 num=randint0(mirror_num);
49 *next_y=mirror_y[num];
50 *next_x=mirror_x[num];
53 *next_y=cury+randint0(5)-2;
54 *next_x=curx+randint0(5)-2;
59 * Get a legal "multi-hued" color for drawing "spells"
61 static byte mh_attr(int max)
63 switch (randint1(max))
65 case 1: return (TERM_RED);
66 case 2: return (TERM_GREEN);
67 case 3: return (TERM_BLUE);
68 case 4: return (TERM_YELLOW);
69 case 5: return (TERM_ORANGE);
70 case 6: return (TERM_VIOLET);
71 case 7: return (TERM_L_RED);
72 case 8: return (TERM_L_GREEN);
73 case 9: return (TERM_L_BLUE);
74 case 10: return (TERM_UMBER);
75 case 11: return (TERM_L_UMBER);
76 case 12: return (TERM_SLATE);
77 case 13: return (TERM_WHITE);
78 case 14: return (TERM_L_WHITE);
79 case 15: return (TERM_L_DARK);
87 * Return a color to use for the bolt/ball spells
89 static byte spell_color(int type)
91 /* Check if A.B.'s new graphics should be used (rr9) */
92 if (streq(ANGBAND_GRAF, "new"))
97 case GF_PSY_SPEAR: return (0x06);
98 case GF_MISSILE: return (0x0F);
99 case GF_ACID: return (0x04);
100 case GF_ELEC: return (0x02);
101 case GF_FIRE: return (0x00);
102 case GF_COLD: return (0x01);
103 case GF_POIS: return (0x03);
104 case GF_HOLY_FIRE: return (0x00);
105 case GF_HELL_FIRE: return (0x00);
106 case GF_MANA: return (0x0E);
108 case GF_SEEKER: return (0x0E);
109 case GF_SUPER_RAY: return (0x0E);
111 case GF_ARROW: return (0x0F);
112 case GF_WATER: return (0x04);
113 case GF_NETHER: return (0x07);
114 case GF_CHAOS: return (mh_attr(15));
115 case GF_DISENCHANT: return (0x05);
116 case GF_NEXUS: return (0x0C);
117 case GF_CONFUSION: return (mh_attr(4));
118 case GF_SOUND: return (0x09);
119 case GF_SHARDS: return (0x08);
120 case GF_FORCE: return (0x09);
121 case GF_INERTIA: return (0x09);
122 case GF_GRAVITY: return (0x09);
123 case GF_TIME: return (0x09);
124 case GF_LITE_WEAK: return (0x06);
125 case GF_LITE: return (0x06);
126 case GF_DARK_WEAK: return (0x07);
127 case GF_DARK: return (0x07);
128 case GF_PLASMA: return (0x0B);
129 case GF_METEOR: return (0x00);
130 case GF_ICE: return (0x01);
131 case GF_ROCKET: return (0x0F);
132 case GF_DEATH_RAY: return (0x07);
133 case GF_NUKE: return (mh_attr(2));
134 case GF_DISINTEGRATE: return (0x05);
146 case GF_CAUSE_4: return (0x0E);
147 case GF_HAND_DOOM: return (0x07);
148 case GF_CAPTURE : return (0x0E);
149 case GF_IDENTIFY: return (0x01);
150 case GF_ATTACK: return (0x0F);
151 case GF_PHOTO : return (0x06);
154 /* Normal tiles or ASCII */
160 /* Lookup the default colors for this type */
161 cptr s = quark_str(gf_color[type]);
164 if (!s) return (TERM_WHITE);
166 /* Pick a random color */
167 c = s[randint0(strlen(s))];
169 /* Lookup this color */
170 a = my_strchr(color_char, c) - color_char;
172 /* Invalid color (note check for < 0 removed, gave a silly
173 * warning because bytes are always >= 0 -- RG) */
174 if (a > 15) return (TERM_WHITE);
180 /* Standard "color" */
186 * Find the attr/char pair to use for a spell effect
188 * It is moving (or has moved) from (x,y) to (nx,ny).
190 * If the distance is not "one", we (may) return "*".
192 u16b bolt_pict(int y, int x, int ny, int nx, int typ)
202 if ((ny == y) && (nx == x)) base = 0x30;
205 else if (nx == x) base = 0x40;
208 else if (ny == y) base = 0x50;
211 else if ((ny - y) == (x - nx)) base = 0x60;
214 else if ((ny - y) == (nx - x)) base = 0x70;
219 /* Basic spell color */
220 k = spell_color(typ);
222 /* Obtain attr/char */
223 a = misc_to_attr[base + k];
224 c = misc_to_char[base + k];
232 * Determine the path taken by a projection.
234 * The projection will always start from the grid (y1,x1), and will travel
235 * towards the grid (y2,x2), touching one grid per unit of distance along
236 * the major axis, and stopping when it enters the destination grid or a
237 * wall grid, or has travelled the maximum legal distance of "range".
239 * Note that "distance" in this function (as in the "update_view()" code)
240 * is defined as "MAX(dy,dx) + MIN(dy,dx)/2", which means that the player
241 * actually has an "octagon of projection" not a "circle of projection".
243 * The path grids are saved into the grid array pointed to by "gp", and
244 * there should be room for at least "range" grids in "gp". Note that
245 * due to the way in which distance is calculated, this function normally
246 * uses fewer than "range" grids for the projection path, so the result
247 * of this function should never be compared directly to "range". Note
248 * that the initial grid (y1,x1) is never saved into the grid array, not
249 * even if the initial grid is also the final grid. XXX XXX XXX
251 * The "flg" flags can be used to modify the behavior of this function.
253 * In particular, the "PROJECT_STOP" and "PROJECT_THRU" flags have the same
254 * semantics as they do for the "project" function, namely, that the path
255 * will stop as soon as it hits a monster, or that the path will continue
256 * through the destination grid, respectively.
258 * The "PROJECT_JUMP" flag, which for the "project()" function means to
259 * start at a special grid (which makes no sense in this function), means
260 * that the path should be "angled" slightly if needed to avoid any wall
261 * grids, allowing the player to "target" any grid which is in "view".
262 * This flag is non-trivial and has not yet been implemented, but could
263 * perhaps make use of the "vinfo" array (above). XXX XXX XXX
265 * This function returns the number of grids (if any) in the path. This
266 * function will return zero if and only if (y1,x1) and (y2,x2) are equal.
268 * This algorithm is similar to, but slightly different from, the one used
269 * by "update_view_los()", and very different from the one used by "los()".
271 sint project_path(u16b *gp, int range, int y1, int x1, int y2, int x2, int flg)
293 /* No path necessary (or allowed) */
294 if ((x1 == x2) && (y1 == y2)) return (0);
322 /* Number of "units" in one "half" grid */
325 /* Number of "units" in one "full" grid */
331 /* Let m = ((dx/dy) * full) = (dx * dx * 2) */
342 /* Advance (X) part 2 */
345 /* Advance (X) part 3 */
352 /* Create the projection path */
356 gp[n++] = GRID(y, x);
358 /* Hack -- Check maximum range */
359 if ((n + (k >> 1)) >= range) break;
361 /* Sometimes stop at destination grid */
362 if (!(flg & (PROJECT_THRU)))
364 if ((x == x2) && (y == y2)) break;
367 if (flg & (PROJECT_DISI))
369 if ((n > 0) && cave_stop_disintegration(y, x)) break;
371 else if (flg & (PROJECT_LOS))
373 if ((n > 0) && !cave_los_bold(y, x)) break;
375 else if (!(flg & (PROJECT_PATH)))
377 /* Always stop at non-initial wall grids */
378 if ((n > 0) && !cave_have_flag_bold(y, x, FF_PROJECT)) break;
381 /* Sometimes stop at non-initial monsters/players */
382 if (flg & (PROJECT_STOP))
385 (player_bold(y, x) || cave[y][x].m_idx != 0))
389 if (!in_bounds(y, x)) break;
394 /* Advance (X) part 1 */
397 /* Horizontal change */
400 /* Advance (X) part 2 */
403 /* Advance (X) part 3 */
419 /* Let m = ((dy/dx) * full) = (dy * dy * 2) */
428 /* Vertical change */
431 /* Advance (Y) part 2 */
434 /* Advance (Y) part 3 */
441 /* Create the projection path */
445 gp[n++] = GRID(y, x);
447 /* Hack -- Check maximum range */
448 if ((n + (k >> 1)) >= range) break;
450 /* Sometimes stop at destination grid */
451 if (!(flg & (PROJECT_THRU)))
453 if ((x == x2) && (y == y2)) break;
456 if (flg & (PROJECT_DISI))
458 if ((n > 0) && cave_stop_disintegration(y, x)) break;
460 else if (flg & (PROJECT_LOS))
462 if ((n > 0) && !cave_los_bold(y, x)) break;
464 else if (!(flg & (PROJECT_PATH)))
466 /* Always stop at non-initial wall grids */
467 if ((n > 0) && !cave_have_flag_bold(y, x, FF_PROJECT)) break;
470 /* Sometimes stop at non-initial monsters/players */
471 if (flg & (PROJECT_STOP))
474 (player_bold(y, x) || cave[y][x].m_idx != 0))
478 if (!in_bounds(y, x)) break;
483 /* Advance (Y) part 1 */
486 /* Vertical change */
489 /* Advance (Y) part 2 */
492 /* Advance (Y) part 3 */
512 /* Create the projection path */
516 gp[n++] = GRID(y, x);
518 /* Hack -- Check maximum range */
519 if ((n + (n >> 1)) >= range) break;
521 /* Sometimes stop at destination grid */
522 if (!(flg & (PROJECT_THRU)))
524 if ((x == x2) && (y == y2)) break;
527 if (flg & (PROJECT_DISI))
529 if ((n > 0) && cave_stop_disintegration(y, x)) break;
531 else if (flg & (PROJECT_LOS))
533 if ((n > 0) && !cave_los_bold(y, x)) break;
535 else if (!(flg & (PROJECT_PATH)))
537 /* Always stop at non-initial wall grids */
538 if ((n > 0) && !cave_have_flag_bold(y, x, FF_PROJECT)) break;
541 /* Sometimes stop at non-initial monsters/players */
542 if (flg & (PROJECT_STOP))
545 (player_bold(y, x) || cave[y][x].m_idx != 0))
549 if (!in_bounds(y, x)) break;
566 * Mega-Hack -- track "affected" monsters (see "project()" comments)
568 static int project_m_n;
569 static int project_m_x;
570 static int project_m_y;
571 /* Mega-Hack -- monsters target */
572 static s16b monster_target_x;
573 static s16b monster_target_y;
577 * We are called from "project()" to "damage" terrain features
579 * We are called both for "beam" effects and "ball" effects.
581 * The "r" parameter is the "distance from ground zero".
583 * Note that we determine if the player can "see" anything that happens
584 * by taking into account: blindness, line-of-sight, and illumination.
586 * We return "TRUE" if the effect of the projection is "obvious".
588 * XXX XXX XXX We also "see" grids which are "memorized", probably a hack
590 * XXX XXX XXX Perhaps we should affect doors?
592 static bool project_f(int who, int r, int y, int x, int dam, int typ)
594 cave_type *c_ptr = &cave[y][x];
595 feature_type *f_ptr = &f_info[c_ptr->feat];
597 bool obvious = FALSE;
598 bool known = player_has_los_bold(y, x);
604 /* Reduce damage by distance */
605 dam = (dam + r) / (r + 1);
608 if (have_flag(f_ptr->flags, FF_TREE))
617 message = "¸Ï¤ì¤¿";break;
619 message = "was blasted.";break;
623 message = "½Ì¤ó¤À";break;
625 message = "shrank.";break;
629 message = "ÍϤ±¤¿";break;
631 message = "melted.";break;
636 message = "Åà¤ê¡¢ºÕ¤±»¶¤Ã¤¿";break;
638 message = "was frozen and smashed.";break;
644 message = "dz¤¨¤¿";break;
646 message = "burns up!";break;
660 message = "Ê´ºÕ¤µ¤ì¤¿";break;
662 message = "was crushed.";break;
665 message = NULL;break;
670 msg_format("ÌÚ¤Ï%s¡£", message);
672 msg_format("A tree %s", message);
674 cave_set_feat(y, x, (one_in_(3) ? FEAT_DEEP_GRASS : FEAT_GRASS));
677 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
681 /* Analyze the type */
684 /* Ignore most effects */
719 /* Destroy Traps (and Locks) */
722 /* Reveal secret doors */
723 if (is_hidden_door(c_ptr))
728 /* Check line of sight */
736 if (is_trap(c_ptr->feat))
738 /* Check line of sight */
742 msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
744 msg_print("There is a bright flash of light!");
750 /* Destroy the trap */
751 cave_alter_feat(y, x, FF_DISARM);
754 /* Locked doors are unlocked */
755 if (is_closed_door(c_ptr->feat) && f_ptr->power && have_flag(f_ptr->flags, FF_OPEN))
757 s16b old_feat = c_ptr->feat;
759 /* Unlock the door */
760 cave_alter_feat(y, x, FF_DISARM);
762 /* Check line of sound */
763 if (known && (old_feat != c_ptr->feat))
766 msg_print("¥«¥Á¥Ã¤È²»¤¬¤·¤¿¡ª");
775 /* Remove "unsafe" flag if player is not blind */
776 if (!p_ptr->blind && player_has_los_bold(y, x))
778 c_ptr->info &= ~(CAVE_UNSAFE);
789 /* Destroy Doors (and traps) */
792 /* Destroy all doors and traps */
793 if (is_trap(c_ptr->feat) || have_flag(f_ptr->flags, FF_DOOR))
795 /* Check line of sight */
800 msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
802 msg_print("There is a bright flash of light!");
808 /* Destroy the feature */
809 cave_alter_feat(y, x, FF_TUNNEL);
812 /* Remove "unsafe" flag if player is not blind */
813 if (!p_ptr->blind && player_has_los_bold(y, x))
815 c_ptr->info &= ~(CAVE_UNSAFE);
826 case GF_JAM_DOOR: /* Jams a door (as if with a spike) */
828 if (have_flag(f_ptr->flags, FF_SPIKE))
830 s16b old_mimic = c_ptr->mimic;
831 feature_type *mimic_f_ptr = &f_info[get_feat_mimic(c_ptr)];
833 cave_alter_feat(y, x, FF_SPIKE);
835 c_ptr->mimic = old_mimic;
843 /* Check line of sight */
844 if (known && have_flag(mimic_f_ptr->flags, FF_OPEN))
848 msg_format("%s¤Ë²¿¤«¤¬¤Ä¤Ã¤«¤¨¤Æ³«¤«¤Ê¤¯¤Ê¤Ã¤¿¡£", f_name + mimic_f_ptr->name);
850 msg_format("The %s seems stuck.", f_name + mimic_f_ptr->name);
859 /* Destroy walls (and doors) */
862 if (have_flag(f_ptr->flags, FF_HURT_ROCK))
865 if (known && (c_ptr->info & (CAVE_MARK)))
868 msg_format("%s¤¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª", f_name + f_info[get_feat_mimic(c_ptr)].name);
870 msg_format("The %s turns into mud!", f_name + f_info[get_feat_mimic(c_ptr)].name);
876 /* Destroy the wall */
877 cave_alter_feat(y, x, FF_HURT_ROCK);
879 /* Update some things */
880 p_ptr->update |= (PU_FLOW);
889 /* Require a "naked" floor grid */
890 if (!cave_naked_bold(y, x)) break;
892 /* Not on the player */
893 if (player_bold(y, x)) break;
895 /* Create a closed door */
896 cave_set_feat(y, x, FEAT_DOOR_HEAD + 0x00);
899 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
916 /* Require a "naked" floor grid */
917 if (!cave_naked_bold(y, x)) break;
919 /* Not on the player */
920 if (player_bold(y, x)) break;
922 /* Create a closed door */
923 cave_set_feat(y, x, FEAT_TREES);
926 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
934 /* Require a "naked" floor grid */
935 if (!cave_naked_bold(y, x)) break;
938 c_ptr->info |= CAVE_OBJECT;
939 c_ptr->mimic = FEAT_GLYPH;
952 /* Require a "naked" floor grid */
953 if (!cave_naked_bold(y, x)) break;
955 /* Not on the player */
956 if (player_bold(y, x)) break;
959 cave_set_feat(y, x, FEAT_WALL);
967 /* Ignore permanent grid */
968 if (have_flag(f_ptr->flags, FF_PERMANENT)) break;
973 /* Ignore grid without enough space */
974 if (!have_flag(f_ptr->flags, FF_FLOOR)) break;
976 /* Place a shallow lava */
977 cave_set_feat(y, x, FEAT_SHAL_LAVA);
982 /* Place a deep lava */
983 cave_set_feat(y, x, FEAT_DEEP_LAVA);
990 /* Ignore permanent grid */
991 if (have_flag(f_ptr->flags, FF_PERMANENT)) break;
996 /* Ignore grid without enough space */
997 if (!have_flag(f_ptr->flags, FF_FLOOR)) break;
999 /* Place a shallow water */
1000 cave_set_feat(y, x, FEAT_SHAL_WATER);
1005 /* Place a deep water */
1006 cave_set_feat(y, x, FEAT_DEEP_WATER);
1011 /* Lite up the grid */
1015 /* Turn on the light */
1016 if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS))
1018 c_ptr->info |= (CAVE_GLOW);
1026 update_local_illumination(y, x);
1029 if (player_can_see_bold(y, x)) obvious = TRUE;
1031 /* Mega-Hack -- Update the monster in the affected grid */
1032 /* This allows "spear of light" (etc) to work "correctly" */
1033 if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
1035 if (p_ptr->special_defense & NINJA_S_STEALTH)
1037 if (player_bold(y, x)) set_superstealth(FALSE);
1044 /* Darken the grid */
1048 bool do_dark = !p_ptr->inside_battle && !is_mirror_grid(c_ptr);
1051 /* Turn off the light. */
1054 if (dun_level || !is_daytime())
1056 for (j = 0; j < 9; j++)
1058 int by = y + ddy_ddd[j];
1059 int bx = x + ddx_ddd[j];
1061 if (in_bounds2(by, bx))
1063 cave_type *cc_ptr = &cave[by][bx];
1065 if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
1073 if (!do_dark) break;
1076 c_ptr->info &= ~(CAVE_GLOW);
1078 /* Hack -- Forget "boring" grids */
1079 if (!have_flag(f_ptr->flags, FF_REMEMBER))
1082 c_ptr->info &= ~(CAVE_MARK);
1091 update_local_illumination(y, x);
1094 if (player_can_see_bold(y, x)) obvious = TRUE;
1096 /* Mega-Hack -- Update the monster in the affected grid */
1097 /* This allows "spear of light" (etc) to work "correctly" */
1098 if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
1108 if (is_mirror_grid(c_ptr))
1111 msg_print("¶À¤¬³ä¤ì¤¿¡ª");
1113 msg_print("The mirror was crashed!");
1115 remove_mirror(y, x);
1116 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
1122 if (is_mirror_grid(c_ptr) && p_ptr->lev < 40)
1125 msg_print("¶À¤¬³ä¤ì¤¿¡ª");
1127 msg_print("The mirror was crashed!");
1129 remove_mirror(y, x);
1130 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
1135 case GF_DISINTEGRATE:
1137 /* Destroy mirror */
1138 if (is_mirror_grid(c_ptr)) remove_mirror(y, x);
1140 /* Permanent features don't get effect */
1141 /* But not protect monsters and other objects */
1142 if (have_flag(f_ptr->flags, FF_HURT_DISI) && !have_flag(f_ptr->flags, FF_PERMANENT))
1144 cave_alter_feat(y, x, FF_HURT_DISI);
1146 /* Update some things -- similar to GF_KILL_WALL */
1147 p_ptr->update |= (PU_FLOW);
1154 /* Return "Anything seen?" */
1161 * We are called from "project()" to "damage" objects
1163 * We are called both for "beam" effects and "ball" effects.
1165 * Perhaps we should only SOMETIMES damage things on the ground.
1167 * The "r" parameter is the "distance from ground zero".
1169 * Note that we determine if the player can "see" anything that happens
1170 * by taking into account: blindness, line-of-sight, and illumination.
1172 * XXX XXX XXX We also "see" grids which are "memorized", probably a hack
1174 * We return "TRUE" if the effect of the projection is "obvious".
1176 static bool project_o(int who, int r, int y, int x, int dam, int typ)
1178 cave_type *c_ptr = &cave[y][x];
1180 s16b this_o_idx, next_o_idx = 0;
1182 bool obvious = FALSE;
1183 bool known = player_has_los_bold(y, x);
1185 u32b flgs[TR_FLAG_SIZE];
1187 char o_name[MAX_NLEN];
1190 bool is_potion = FALSE;
1194 who = who ? who : 0;
1196 /* Reduce damage by distance */
1197 dam = (dam + r) / (r + 1);
1200 /* Scan all objects in the grid */
1201 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
1203 /* Acquire object */
1204 object_type *o_ptr = &o_list[this_o_idx];
1206 bool is_art = FALSE;
1207 bool ignore = FALSE;
1208 bool do_kill = FALSE;
1210 cptr note_kill = NULL;
1213 /* Get the "plural"-ness */
1214 bool plural = (o_ptr->number > 1);
1217 /* Acquire next object */
1218 next_o_idx = o_ptr->next_o_idx;
1220 /* Extract the flags */
1221 object_flags(o_ptr, flgs);
1223 /* Check for artifact */
1224 if (object_is_artifact(o_ptr)) is_art = TRUE;
1226 /* Analyze the type */
1229 /* Acid -- Lots of things */
1232 if (hates_acid(o_ptr))
1236 note_kill = "Í»¤±¤Æ¤·¤Þ¤Ã¤¿¡ª";
1238 note_kill = (plural ? " melt!" : " melts!");
1241 if (have_flag(flgs, TR_IGNORE_ACID)) ignore = TRUE;
1246 /* Elec -- Rings and Wands */
1249 if (hates_elec(o_ptr))
1253 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1255 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1258 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1263 /* Fire -- Flammable objects */
1266 if (hates_fire(o_ptr))
1270 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1272 note_kill = (plural ? " burn up!" : " burns up!");
1275 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1280 /* Cold -- potions and flasks */
1283 if (hates_cold(o_ptr))
1286 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1288 note_kill = (plural ? " shatter!" : " shatters!");
1292 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1300 if (hates_fire(o_ptr))
1304 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1306 note_kill = (plural ? " burn up!" : " burns up!");
1309 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1311 if (hates_elec(o_ptr))
1316 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1318 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1321 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1329 if (hates_fire(o_ptr))
1333 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1335 note_kill = (plural ? " burn up!" : " burns up!");
1338 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1340 if (hates_cold(o_ptr))
1345 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1347 note_kill = (plural ? " shatter!" : " shatters!");
1350 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1355 /* Hack -- break potions and such */
1361 if (hates_cold(o_ptr))
1364 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1366 note_kill = (plural ? " shatter!" : " shatters!");
1374 /* Mana and Chaos -- destroy everything */
1381 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1383 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1389 case GF_DISINTEGRATE:
1393 note_kill = "¾øȯ¤·¤Æ¤·¤Þ¤Ã¤¿¡ª";
1395 note_kill = (plural ? " evaporate!" : " evaporates!");
1405 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1407 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1410 if (have_flag(flgs, TR_RES_CHAOS)) ignore = TRUE;
1411 else if ((o_ptr->tval == TV_SCROLL) && (o_ptr->sval == SV_SCROLL_CHAOS)) ignore = TRUE;
1415 /* Holy Fire and Hell Fire -- destroys cursed non-artifacts */
1419 if (object_is_cursed(o_ptr))
1423 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1425 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1434 identify_item(o_ptr);
1436 /* Auto-inscription */
1437 autopick_alter_item((-this_o_idx), FALSE);
1445 /* Chests are noticed only if trapped or locked */
1446 if (o_ptr->tval == TV_CHEST)
1448 /* Disarm/Unlock traps */
1449 if (o_ptr->pval > 0)
1451 /* Disarm or Unlock */
1452 o_ptr->pval = (0 - o_ptr->pval);
1455 object_known(o_ptr);
1458 if (known && (o_ptr->marked & OM_FOUND))
1461 msg_print("¥«¥Á¥Ã¤È²»¤¬¤·¤¿¡ª");
1463 msg_print("Click!");
1475 if (o_ptr->tval == TV_CORPSE)
1480 if (!who || is_pet(&m_list[who]))
1481 mode |= PM_FORCE_PET;
1483 for (i = 0; i < o_ptr->number ; i++)
1485 if (((o_ptr->sval == SV_CORPSE) && (randint1(100) > 80)) ||
1486 ((o_ptr->sval == SV_SKELETON) && (randint1(100) > 60)))
1491 note_kill = "³¥¤Ë¤Ê¤Ã¤¿¡£";
1493 note_kill = (plural ? " become dust." : " becomes dust.");
1498 else if (summon_named_creature(who, y, x, o_ptr->pval, mode))
1501 note_kill = "À¸¤Ê֤ä¿¡£";
1503 note_kill = "rivived.";
1506 else if (!note_kill)
1509 note_kill = "³¥¤Ë¤Ê¤Ã¤¿¡£";
1511 note_kill = (plural ? " become dust." : " becomes dust.");
1523 /* Attempt to destroy the object */
1526 /* Effect "observed" */
1527 if (known && (o_ptr->marked & OM_FOUND))
1530 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
1533 /* Artifacts, and other objects, get to resist */
1534 if (is_art || ignore)
1536 /* Observe the resist */
1537 if (known && (o_ptr->marked & OM_FOUND))
1540 msg_format("%s¤Ï±Æ¶Á¤ò¼õ¤±¤Ê¤¤¡ª",
1543 msg_format("The %s %s unaffected!",
1544 o_name, (plural ? "are" : "is"));
1553 /* Describe if needed */
1554 if (known && (o_ptr->marked & OM_FOUND) && note_kill)
1557 msg_format("%s¤Ï%s", o_name, note_kill);
1559 msg_format("The %s%s", o_name, note_kill);
1564 k_idx = o_ptr->k_idx;
1565 is_potion = object_is_potion(o_ptr);
1568 /* Delete the object */
1569 delete_object_idx(this_o_idx);
1571 /* Potions produce effects when 'shattered' */
1574 (void)potion_smash_effect(who, y, x, k_idx);
1583 /* Return "Anything seen?" */
1589 * Helper function for "project()" below.
1591 * Handle a beam/bolt/ball causing damage to a monster.
1593 * This routine takes a "source monster" (by index) which is mostly used to
1594 * determine if the player is causing the damage, and a "radius" (see below),
1595 * which is used to decrease the power of explosions with distance, and a
1596 * location, via integers which are modified by certain types of attacks
1597 * (polymorph and teleport being the obvious ones), a default damage, which
1598 * is modified as needed based on various properties, and finally a "damage
1599 * type" (see below).
1601 * Note that this routine can handle "no damage" attacks (like teleport) by
1602 * taking a "zero" damage, and can even take "parameters" to attacks (like
1603 * confuse) by accepting a "damage", using it to calculate the effect, and
1604 * then setting the damage to zero. Note that the "damage" parameter is
1605 * divided by the radius, so monsters not at the "epicenter" will not take
1606 * as much damage (or whatever)...
1608 * Note that "polymorph" is dangerous, since a failure in "place_monster()"'
1609 * may result in a dereference of an invalid pointer. XXX XXX XXX
1611 * Various messages are produced, and damage is applied.
1613 * Just "casting" a substance (i.e. plasma) does not make you immune, you must
1614 * actually be "made" of that substance, or "breathe" big balls of it.
1616 * We assume that "Plasma" monsters, and "Plasma" breathers, are immune
1619 * We assume "Nether" is an evil, necromantic force, so it doesn't hurt undead,
1620 * and hurts evil less. If can breath nether, then it resists it as well.
1622 * Damage reductions use the following formulas:
1623 * Note that "dam = dam * 6 / (randint1(6) + 6);"
1624 * gives avg damage of .655, ranging from .858 to .500
1625 * Note that "dam = dam * 5 / (randint1(6) + 6);"
1626 * gives avg damage of .544, ranging from .714 to .417
1627 * Note that "dam = dam * 4 / (randint1(6) + 6);"
1628 * gives avg damage of .444, ranging from .556 to .333
1629 * Note that "dam = dam * 3 / (randint1(6) + 6);"
1630 * gives avg damage of .327, ranging from .427 to .250
1631 * Note that "dam = dam * 2 / (randint1(6) + 6);"
1632 * gives something simple.
1634 * In this function, "result" messages are postponed until the end, where
1635 * the "note" string is appended to the monster name, if not NULL. So,
1636 * to make a spell have "no effect" just set "note" to NULL. You should
1637 * also set "notice" to FALSE, or the player will learn what the spell does.
1639 * We attempt to return "TRUE" if the player saw anything "useful" happen.
1641 /* "flg" was added. */
1642 static bool project_m(int who, int r, int y, int x, int dam, int typ , int flg)
1646 cave_type *c_ptr = &cave[y][x];
1648 monster_type *m_ptr = &m_list[c_ptr->m_idx];
1649 monster_type *caster_ptr = (who > 0) ? &m_list[who] : NULL;
1651 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1655 /* Is the monster "seen"? */
1656 bool seen = m_ptr->ml;
1657 bool seen_msg = is_seen(m_ptr);
1659 bool slept = (bool)(m_ptr->csleep > 0);
1661 /* Were the effects "obvious" (if seen)? */
1662 bool obvious = FALSE;
1664 /* Can the player know about this effect? */
1665 bool known = ((m_ptr->cdis <= MAX_SIGHT) || p_ptr->inside_battle);
1667 /* Can the player see the source of this effect? */
1668 bool see_s_msg = ((who <= 0) || is_seen(caster_ptr));
1670 /* Were the effects "irrelevant"? */
1671 bool skipped = FALSE;
1673 /* Gets the monster angry at the source of the effect? */
1674 bool get_angry = FALSE;
1676 /* Polymorph setting (true or false) */
1677 bool do_poly = FALSE;
1679 /* Teleport setting (max distance) */
1682 /* Confusion setting (amount to confuse) */
1685 /* Stunning setting (amount to stun) */
1688 /* Sleep amount (amount to sleep) */
1691 /* Fear amount (amount to fear) */
1694 /* Time amount (amount to time) */
1697 bool heal_leper = FALSE;
1699 /* Hold the monster name */
1708 /* Assume no note */
1711 /* Assume a default death */
1712 cptr note_dies = extract_note_dies(real_r_ptr(m_ptr));
1717 int caster_lev = (who > 0) ? r_info[caster_ptr->r_idx].level : (p_ptr->lev * 2);
1720 if (!c_ptr->m_idx) return (FALSE);
1722 /* Never affect projector */
1723 if (who && (c_ptr->m_idx == who)) return (FALSE);
1724 if ((c_ptr->m_idx == p_ptr->riding) && !who && !(typ == GF_OLD_HEAL) && !(typ == GF_OLD_SPEED) && !(typ == GF_STAR_HEAL)) return (FALSE);
1725 if (sukekaku && ((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) return FALSE;
1727 /* Don't affect already death monsters */
1728 /* Prevents problems with chain reactions of exploding monsters */
1729 if (m_ptr->hp < 0) return (FALSE);
1731 /* Reduce damage by distance */
1732 dam = (dam + r) / (r + 1);
1735 /* Get the monster name (BEFORE polymorphing) */
1736 monster_desc(m_name, m_ptr, 0);
1739 /* Get the monster possessive ("his"/"her"/"its") */
1740 monster_desc(m_poss, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE);
1744 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) disturb(1, 0);
1746 /* Analyze the damage type */
1749 /* Magic Missile -- pure damage */
1752 if (seen) obvious = TRUE;
1754 if (r_ptr->flagsr & RFR_RES_ALL)
1757 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1759 note = " is immune.";
1762 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1771 if (seen) obvious = TRUE;
1773 if (r_ptr->flagsr & RFR_RES_ALL)
1776 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1778 note = " is immune.";
1781 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1784 if (r_ptr->flagsr & RFR_IM_ACID)
1787 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1789 note = " resists a lot.";
1793 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ACID);
1801 if (seen) obvious = TRUE;
1803 if (r_ptr->flagsr & RFR_RES_ALL)
1806 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1808 note = " is immune.";
1811 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1814 if (r_ptr->flagsr & RFR_IM_ELEC)
1817 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1819 note = " resists a lot.";
1823 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ELEC);
1831 if (seen) obvious = TRUE;
1833 if (r_ptr->flagsr & RFR_RES_ALL)
1836 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1838 note = " is immune.";
1841 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1844 if (r_ptr->flagsr & RFR_IM_FIRE)
1847 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1849 note = " resists a lot.";
1853 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_FIRE);
1855 else if (r_ptr->flags3 & (RF3_HURT_FIRE))
1858 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
1860 note = " is hit hard.";
1864 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_FIRE);
1872 if (seen) obvious = TRUE;
1874 if (r_ptr->flagsr & RFR_RES_ALL)
1877 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1879 note = " is immune.";
1882 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1885 if (r_ptr->flagsr & RFR_IM_COLD)
1888 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1890 note = " resists a lot.";
1894 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
1896 else if (r_ptr->flags3 & (RF3_HURT_COLD))
1899 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
1901 note = " is hit hard.";
1905 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
1913 if (seen) obvious = TRUE;
1915 if (r_ptr->flagsr & RFR_RES_ALL)
1918 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1920 note = " is immune.";
1923 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1926 if (r_ptr->flagsr & RFR_IM_POIS)
1929 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1931 note = " resists a lot.";
1935 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1943 if (seen) obvious = TRUE;
1945 if (r_ptr->flagsr & RFR_RES_ALL)
1948 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1950 note = " is immune.";
1953 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1956 if (r_ptr->flagsr & RFR_IM_POIS)
1959 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
1964 dam *= 3; dam /= randint1(6) + 6;
1965 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1967 else if (one_in_(3)) do_poly = TRUE;
1971 /* Hellfire -- hurts Evil */
1974 if (seen) obvious = TRUE;
1976 if (r_ptr->flagsr & RFR_RES_ALL)
1979 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1981 note = " is immune.";
1984 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1987 if (r_ptr->flags3 & RF3_GOOD)
1991 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¼õ¤±¤¿¡£";
1993 note = " is hit hard.";
1996 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
2001 /* Holy Fire -- hurts Evil, Good are immune, others _resist_ */
2004 if (seen) obvious = TRUE;
2006 if (r_ptr->flagsr & RFR_RES_ALL)
2009 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2011 note = " is immune.";
2014 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2017 if (r_ptr->flags3 & RF3_GOOD)
2021 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2023 note = " is immune.";
2026 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_GOOD;
2028 else if (r_ptr->flags3 & RF3_EVIL)
2032 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¼õ¤±¤¿¡£";
2034 note = " is hit hard.";
2037 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_EVIL;
2042 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2047 dam *= 3; dam /= randint1(6) + 6;
2052 /* Arrow -- XXX no defense */
2055 if (seen) obvious = TRUE;
2057 if (r_ptr->flagsr & RFR_RES_ALL)
2060 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2062 note = " is immune.";
2065 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2071 /* Plasma -- XXX perhaps check ELEC or FIRE */
2074 if (seen) obvious = TRUE;
2076 if (r_ptr->flagsr & RFR_RES_ALL)
2079 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2081 note = " is immune.";
2084 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2087 if (r_ptr->flagsr & RFR_RES_PLAS)
2090 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2095 dam *= 3; dam /= randint1(6) + 6;
2096 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_PLAS);
2101 /* Nether -- see above */
2104 if (seen) obvious = TRUE;
2106 if (r_ptr->flagsr & RFR_RES_ALL)
2109 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2111 note = " is immune.";
2114 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2117 if (r_ptr->flagsr & RFR_RES_NETH)
2119 if (r_ptr->flags3 & RF3_UNDEAD)
2122 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2124 note = " is immune.";
2128 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
2133 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2138 dam *= 3; dam /= randint1(6) + 6;
2140 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NETH);
2142 else if (r_ptr->flags3 & RF3_EVIL)
2146 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2148 note = " resists somewhat.";
2151 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
2156 /* Water (acid) damage -- Water spirits/elementals are immune */
2159 if (seen) obvious = TRUE;
2161 if (r_ptr->flagsr & RFR_RES_ALL)
2164 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2166 note = " is immune.";
2169 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2172 if (r_ptr->flagsr & RFR_RES_WATE)
2174 if ((m_ptr->r_idx == MON_WATER_ELEM) || (m_ptr->r_idx == MON_UNMAKER))
2177 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2179 note = " is immune.";
2187 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2192 dam *= 3; dam /= randint1(6) + 6;
2194 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WATE);
2199 /* Chaos -- Chaos breathers resist */
2202 if (seen) obvious = TRUE;
2204 if (r_ptr->flagsr & RFR_RES_ALL)
2207 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2209 note = " is immune.";
2212 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2215 if (r_ptr->flagsr & RFR_RES_CHAO)
2218 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2223 dam *= 3; dam /= randint1(6) + 6;
2224 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_CHAO);
2226 else if ((r_ptr->flags3 & RF3_DEMON) && one_in_(3))
2229 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2231 note = " resists somewhat.";
2234 dam *= 3; dam /= randint1(6) + 6;
2235 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
2240 do_conf = (5 + randint1(11) + r) / (r + 1);
2245 /* Shards -- Shard breathers resist */
2248 if (seen) obvious = TRUE;
2250 if (r_ptr->flagsr & RFR_RES_ALL)
2253 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2255 note = " is immune.";
2258 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2261 if (r_ptr->flagsr & RFR_RES_SHAR)
2264 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2269 dam *= 3; dam /= randint1(6) + 6;
2270 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
2275 /* Rocket: Shard resistance helps */
2278 if (seen) obvious = TRUE;
2280 if (r_ptr->flagsr & RFR_RES_ALL)
2283 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2285 note = " is immune.";
2288 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2291 if (r_ptr->flagsr & RFR_RES_SHAR)
2294 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2296 note = " resists somewhat.";
2300 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
2306 /* Sound -- Sound breathers resist */
2309 if (seen) obvious = TRUE;
2311 if (r_ptr->flagsr & RFR_RES_ALL)
2314 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2316 note = " is immune.";
2319 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2322 if (r_ptr->flagsr & RFR_RES_SOUN)
2325 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2330 dam *= 2; dam /= randint1(6) + 6;
2331 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SOUN);
2333 else do_stun = (10 + randint1(15) + r) / (r + 1);
2340 if (seen) obvious = TRUE;
2342 if (r_ptr->flagsr & RFR_RES_ALL)
2345 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2347 note = " is immune.";
2350 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2353 if (r_ptr->flags3 & RF3_NO_CONF)
2356 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2361 dam *= 3; dam /= randint1(6) + 6;
2362 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
2364 else do_conf = (10 + randint1(15) + r) / (r + 1);
2368 /* Disenchantment -- Breathers and Disenchanters resist */
2371 if (seen) obvious = TRUE;
2373 if (r_ptr->flagsr & RFR_RES_ALL)
2376 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2378 note = " is immune.";
2381 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2384 if (r_ptr->flagsr & RFR_RES_DISE)
2387 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2392 dam *= 3; dam /= randint1(6) + 6;
2393 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DISE);
2398 /* Nexus -- Breathers and Existers resist */
2401 if (seen) obvious = TRUE;
2403 if (r_ptr->flagsr & RFR_RES_ALL)
2406 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2408 note = " is immune.";
2411 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2414 if (r_ptr->flagsr & RFR_RES_NEXU)
2417 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2422 dam *= 3; dam /= randint1(6) + 6;
2423 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NEXU);
2431 if (seen) obvious = TRUE;
2433 if (r_ptr->flagsr & RFR_RES_ALL)
2436 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2438 note = " is immune.";
2441 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2444 if (r_ptr->flagsr & RFR_RES_WALL)
2447 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2452 dam *= 3; dam /= randint1(6) + 6;
2453 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WALL);
2455 else do_stun = (randint1(15) + r) / (r + 1);
2459 /* Inertia -- breathers resist */
2462 if (seen) obvious = TRUE;
2464 if (r_ptr->flagsr & RFR_RES_ALL)
2467 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2469 note = " is immune.";
2472 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2475 if (r_ptr->flagsr & RFR_RES_INER)
2478 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2483 dam *= 3; dam /= randint1(6) + 6;
2484 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_INER);
2488 /* Powerful monsters can resist */
2489 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2490 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2494 /* Normal monsters slow down */
2500 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
2502 note = " starts moving slower.";
2504 mproc_add(c_ptr->m_idx, MPROC_SLOW);
2506 m_ptr->slow = MIN(200, m_ptr->slow + 50);
2507 if (c_ptr->m_idx == p_ptr->riding)
2508 p_ptr->update |= (PU_BONUS);
2514 /* Time -- breathers resist */
2517 if (seen) obvious = TRUE;
2519 if (r_ptr->flagsr & RFR_RES_ALL)
2522 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2524 note = " is immune.";
2527 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2530 if (r_ptr->flagsr & RFR_RES_TIME)
2533 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2538 dam *= 3; dam /= randint1(6) + 6;
2539 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_TIME);
2541 else do_time = (dam + 1) / 2;
2545 /* Gravity -- breathers resist */
2548 bool resist_tele = FALSE;
2550 if (seen) obvious = TRUE;
2552 if (r_ptr->flagsr & RFR_RES_ALL)
2555 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2557 note = " is immune.";
2560 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2563 if (r_ptr->flagsr & RFR_RES_TELE)
2565 if (r_ptr->flags1 & (RF1_UNIQUE))
2567 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2569 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2571 note = " is unaffected!";
2576 else if (r_ptr->level > randint1(100))
2578 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2580 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
2589 if (!resist_tele) do_dist = 10;
2591 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
2593 if (r_ptr->flagsr & RFR_RES_GRAV)
2596 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2601 dam *= 3; dam /= randint1(6) + 6;
2603 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_GRAV);
2608 /* Powerful monsters can resist */
2609 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2610 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2614 /* Normal monsters slow down */
2620 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
2622 note = " starts moving slower.";
2624 mproc_add(c_ptr->m_idx, MPROC_SLOW);
2626 m_ptr->slow = MIN(200, m_ptr->slow + 50);
2627 if (c_ptr->m_idx == p_ptr->riding)
2628 p_ptr->update |= (PU_BONUS);
2632 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
2634 /* Attempt a saving throw */
2635 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2636 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2640 /* No obvious effect */
2642 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2644 note = " is unaffected!";
2658 if (seen) obvious = TRUE;
2660 if (r_ptr->flagsr & RFR_RES_ALL)
2663 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2665 note = " is immune.";
2668 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2676 case GF_DISINTEGRATE:
2678 if (seen) obvious = TRUE;
2680 if (r_ptr->flagsr & RFR_RES_ALL)
2683 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2685 note = " is immune.";
2688 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2691 if (r_ptr->flags3 & RF3_HURT_ROCK)
2693 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
2695 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
2696 note_dies = "¤Ï¾øȯ¤·¤¿¡ª";
2698 note = " loses some skin!";
2699 note_dies = " evaporates!";
2709 if (seen) obvious = TRUE;
2711 /* PSI only works if the monster can see you! -- RG */
2712 if (!(los(m_ptr->fy, m_ptr->fx, py, px)))
2715 if (seen_msg) msg_format("%s¤Ï¤¢¤Ê¤¿¤¬¸«¤¨¤Ê¤¤¤Î¤Ç±Æ¶Á¤µ¤ì¤Ê¤¤¡ª", m_name);
2717 if (seen_msg) msg_format("%^s can't see you, and isn't affected!", m_name);
2723 if (r_ptr->flagsr & RFR_RES_ALL)
2726 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2728 note = " is immune.";
2731 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2734 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2738 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2740 note = " is immune!";
2742 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
2745 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2746 (r_ptr->flags3 & RF3_ANIMAL) ||
2747 (r_ptr->level > randint1(3 * dam)))
2751 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2758 * Powerful demons & undead can turn a mindcrafter's
2759 * attacks back on them
2761 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2762 (r_ptr->level > p_ptr->lev / 2) &&
2767 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
2769 msg_format("%^s%s corrupted mind backlashes your attack!",
2770 m_name, (seen ? "'s" : "s"));
2774 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2777 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2779 msg_print("You resist the effects!");
2785 /* Injure +/- confusion */
2786 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
2787 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2790 switch (randint1(4))
2793 set_confused(p_ptr->confused + 3 + randint1(dam));
2796 set_stun(p_ptr->stun + randint1(dam));
2800 if (r_ptr->flags3 & RF3_NO_FEAR)
2802 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2804 note = " is unaffected.";
2808 set_afraid(p_ptr->afraid + 3 + randint1(dam));
2812 if (!p_ptr->free_act)
2813 (void)set_paralyzed(p_ptr->paralyzed + randint1(dam));
2822 if ((dam > 0) && one_in_(4))
2824 switch (randint1(4))
2827 do_conf = 3 + randint1(dam);
2830 do_stun = 3 + randint1(dam);
2833 do_fear = 3 + randint1(dam);
2837 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
2839 note = " falls asleep!";
2842 do_sleep = 3 + randint1(dam);
2848 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
2850 note_dies = " collapses, a mindless husk.";
2858 if (seen) obvious = TRUE;
2860 if (r_ptr->flagsr & RFR_RES_ALL)
2863 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2865 note = " is immune.";
2868 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2871 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2875 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2877 note = " is immune!";
2881 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2882 (r_ptr->flags3 & RF3_ANIMAL) ||
2883 (r_ptr->level > randint1(3 * dam)))
2887 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2894 * Powerful demons & undead can turn a mindcrafter's
2895 * attacks back on them
2897 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2898 (r_ptr->level > p_ptr->lev / 2) &&
2903 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
2905 msg_format("%^s%s corrupted mind backlashes your attack!",
2906 m_name, (seen ? "'s" : "s"));
2910 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2913 msg_print("¤¢¤Ê¤¿¤Ï¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2915 msg_print("You resist the effects!");
2921 /* Injure + mana drain */
2922 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
2924 msg_print("ĶǽÎϥѥ¤òµÛ¤¤¤È¤é¤ì¤¿¡ª");
2926 msg_print("Your psychic energy is drained!");
2929 p_ptr->csp -= damroll(5, dam) / 2;
2930 if (p_ptr->csp < 0) p_ptr->csp = 0;
2931 p_ptr->redraw |= PR_MANA;
2932 p_ptr->window |= (PW_SPELL);
2933 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2940 int b = damroll(5, dam) / 4;
2942 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¶ìÄˤòĶǽÎϥѥ¤ËÊÑ´¹¤·¤¿¡ª", m_name);
2944 msg_format("You convert %s%s pain into psychic energy!",
2945 m_name, (seen ? "'s" : "s"));
2948 b = MIN(p_ptr->msp, p_ptr->csp + b);
2950 p_ptr->redraw |= PR_MANA;
2951 p_ptr->window |= (PW_SPELL);
2955 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
2957 note_dies = " collapses, a mindless husk.";
2963 case GF_TELEKINESIS:
2965 if (seen) obvious = TRUE;
2967 if (r_ptr->flagsr & RFR_RES_ALL)
2970 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2972 note = " is immune.";
2975 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2980 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
2985 do_stun = damroll((caster_lev / 20) + 3 , dam) + 1;
2987 /* Attempt a saving throw */
2988 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2989 (r_ptr->level > 5 + randint1(dam)))
2993 /* No obvious effect */
2999 /* Psycho-spear -- powerful magic missile */
3002 if (seen) obvious = TRUE;
3004 if (r_ptr->flagsr & RFR_RES_ALL)
3007 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3009 note = " is immune.";
3012 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3018 /* Meteor -- powerful magic missile */
3021 if (seen) obvious = TRUE;
3023 if (r_ptr->flagsr & RFR_RES_ALL)
3026 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3028 note = " is immune.";
3031 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3039 if (!is_hostile(m_ptr)) break;
3041 if (seen) obvious = TRUE;
3043 if (r_ptr->flagsr & RFR_RES_ALL)
3046 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3048 note = " is immune.";
3051 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3054 /* Attempt a saving throw */
3055 if ((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) ||
3056 (r_ptr->flags3 & RF3_NO_CONF) ||
3057 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3059 /* Memorize a flag */
3060 if (r_ptr->flags3 & RF3_NO_CONF)
3062 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3069 * Powerful demons & undead can turn a mindcrafter's
3070 * attacks back on them
3072 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
3073 (r_ptr->level > p_ptr->lev / 2) &&
3078 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
3080 msg_format("%^s%s corrupted mind backlashes your attack!",
3081 m_name, (seen ? "'s" : "s"));
3085 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
3088 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3090 msg_print("You resist the effects!");
3096 /* Confuse, stun, terrify */
3097 switch (randint1(4))
3100 set_stun(p_ptr->stun + dam / 2);
3103 set_confused(p_ptr->confused + dam / 2);
3107 if (r_ptr->flags3 & RF3_NO_FEAR)
3109 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3111 note = " is unaffected.";
3115 set_afraid(p_ptr->afraid + dam);
3122 /* No obvious effect */
3124 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3126 note = " is unaffected!";
3134 if ((dam > 29) && (randint1(100) < dam))
3137 note = "¤¬¤¢¤Ê¤¿¤ËÎì°¤·¤¿¡£";
3139 note = " is in your thrall!";
3146 switch (randint1(4))
3160 /* No "real" damage */
3167 /* Ice -- Cold + Cuts + Stun */
3170 if (seen) obvious = TRUE;
3172 if (r_ptr->flagsr & RFR_RES_ALL)
3175 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3177 note = " is immune.";
3180 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3183 do_stun = (randint1(15) + 1) / (r + 1);
3184 if (r_ptr->flagsr & RFR_IM_COLD)
3187 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡£";
3189 note = " resists a lot.";
3193 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
3195 else if (r_ptr->flags3 & (RF3_HURT_COLD))
3198 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
3200 note = " is hit hard.";
3204 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
3213 if (seen) obvious = TRUE;
3215 if (r_ptr->flagsr & RFR_RES_ALL)
3218 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3220 note = " is immune.";
3223 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3226 if (!monster_living(r_ptr))
3228 if (is_original_ap_and_seen(m_ptr))
3230 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
3231 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
3232 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
3236 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3238 note = " is unaffected!";
3244 else do_time = (dam+7)/8;
3252 if (seen) obvious = TRUE;
3254 if (r_ptr->flagsr & RFR_RES_ALL)
3257 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3259 note = " is immune.";
3262 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3265 if (!monster_living(r_ptr))
3267 if (is_original_ap_and_seen(m_ptr))
3269 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
3270 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
3271 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
3275 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
3277 note = " is immune.";
3283 else if (((r_ptr->flags1 & RF1_UNIQUE) &&
3284 (randint1(888) != 666)) ||
3285 (((r_ptr->level + randint1(20)) > randint1((caster_lev / 2) + randint1(10))) &&
3286 randint1(100) != 66))
3289 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
3301 /* Polymorph monster (Use "dam" as "power") */
3304 if (seen) obvious = TRUE;
3306 if (r_ptr->flagsr & RFR_RES_ALL)
3309 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3311 note = " is immune.";
3314 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3317 /* Attempt to polymorph (see below) */
3320 /* Powerful monsters can resist */
3321 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3322 (r_ptr->flags1 & RF1_QUESTOR) ||
3323 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3326 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3328 note = " is unaffected!";
3335 /* No "real" damage */
3342 /* Clone monsters (Ignore "dam") */
3345 if (seen) obvious = TRUE;
3347 if (is_pet(m_ptr) || (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_NAZGUL | RF7_UNIQUE2)))
3350 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3352 note = " is unaffected!";
3358 m_ptr->hp = m_ptr->maxhp;
3360 /* Attempt to clone. */
3361 if (multiply_monster(c_ptr->m_idx, TRUE, 0L))
3364 note = "¤¬Ê¬Îö¤·¤¿¡ª";
3372 /* No "real" damage */
3379 /* Heal Monster (use "dam" as amount of healing) */
3382 if (seen) obvious = TRUE;
3388 mproc_remove(c_ptr->m_idx, m_ptr->mproc_idx[MPROC_CSLEEP], MPROC_CSLEEP);
3389 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
3392 if (m_ptr->maxhp < m_ptr->max_maxhp)
3395 if (seen_msg) msg_format("%^s¤Î¶¯¤µ¤¬Ìá¤Ã¤¿¡£", m_name);
3397 if (seen_msg) msg_format("%^s recovers %s vitality.", m_name, m_poss);
3399 m_ptr->maxhp = m_ptr->max_maxhp;
3404 /* Redraw (later) if needed */
3405 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
3406 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
3414 if (seen) obvious = TRUE;
3420 mproc_remove(c_ptr->m_idx, m_ptr->mproc_idx[MPROC_CSLEEP], MPROC_CSLEEP);
3421 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
3426 if (seen_msg) msg_format("%^s¤ÏÛ¯Û°¾õÂÖ¤«¤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3428 if (seen_msg) msg_format("%^s is no longer stunned.", m_name);
3431 mproc_remove(c_ptr->m_idx, m_ptr->mproc_idx[MPROC_STUNNED], MPROC_STUNNED);
3433 if (m_ptr->confused)
3436 if (seen_msg) msg_format("%^s¤Ïº®Í𤫤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3438 if (seen_msg) msg_format("%^s is no longer confused.", m_name);
3440 m_ptr->confused = 0;
3441 mproc_remove(c_ptr->m_idx, m_ptr->mproc_idx[MPROC_CONFUSED], MPROC_CONFUSED);
3446 if (seen_msg) msg_format("%^s¤Ïͦµ¤¤ò¼è¤êÌᤷ¤¿¡£", m_name);
3448 if (seen_msg) msg_format("%^s recovers %s courage.", m_name, m_poss);
3451 mproc_remove(c_ptr->m_idx, m_ptr->mproc_idx[MPROC_MONFEAR], MPROC_MONFEAR);
3455 if (m_ptr->hp < 30000) m_ptr->hp += dam;
3458 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
3462 chg_virtue(V_VITALITY, 1);
3464 if (r_ptr->flags1 & RF1_UNIQUE)
3465 chg_virtue(V_INDIVIDUALISM, 1);
3467 if (is_friendly(m_ptr))
3468 chg_virtue(V_HONOUR, 1);
3469 else if (!(r_ptr->flags3 & RF3_EVIL))
3471 if (r_ptr->flags3 & RF3_GOOD)
3472 chg_virtue(V_COMPASSION, 2);
3474 chg_virtue(V_COMPASSION, 1);
3477 if (r_ptr->flags3 & RF3_ANIMAL)
3478 chg_virtue(V_NATURE, 1);
3481 if (m_ptr->r_idx == MON_LEPER)
3484 if (!who) chg_virtue(V_COMPASSION, 5);
3487 /* Redraw (later) if needed */
3488 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
3489 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
3493 note = "¤ÏÂÎÎϤò²óÉü¤·¤¿¤è¤¦¤À¡£";
3495 note = " looks healthier.";
3498 /* No "real" damage */
3504 /* Speed Monster (Ignore "dam") */
3507 if (seen) obvious = TRUE;
3513 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
3515 note = " starts moving faster.";
3517 mproc_add(c_ptr->m_idx, MPROC_FAST);
3519 m_ptr->fast = MIN(200, m_ptr->fast + 100);
3521 if (c_ptr->m_idx == p_ptr->riding)
3522 p_ptr->update |= (PU_BONUS);
3526 if (r_ptr->flags1 & RF1_UNIQUE)
3527 chg_virtue(V_INDIVIDUALISM, 1);
3528 if (is_friendly(m_ptr))
3529 chg_virtue(V_HONOUR, 1);
3532 /* No "real" damage */
3538 /* Slow Monster (Use "dam" as "power") */
3541 if (seen) obvious = TRUE;
3543 if (r_ptr->flagsr & RFR_RES_ALL)
3546 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3548 note = " is immune.";
3551 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3554 /* Powerful monsters can resist */
3555 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3556 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3559 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3561 note = " is unaffected!";
3567 /* Normal monsters slow down */
3573 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
3575 note = " starts moving slower.";
3577 mproc_add(c_ptr->m_idx, MPROC_SLOW);
3579 m_ptr->slow = MIN(200, m_ptr->slow + 50);
3581 if (c_ptr->m_idx == p_ptr->riding)
3582 p_ptr->update |= (PU_BONUS);
3585 /* No "real" damage */
3591 /* Sleep (Use "dam" as "power") */
3594 if (seen) obvious = TRUE;
3596 if (r_ptr->flagsr & RFR_RES_ALL)
3599 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3601 note = " is immune.";
3604 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3607 /* Attempt a saving throw */
3608 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3609 (r_ptr->flags3 & RF3_NO_SLEEP) ||
3610 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3612 /* Memorize a flag */
3613 if (r_ptr->flags3 & RF3_NO_SLEEP)
3615 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
3618 /* No obvious effect */
3620 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3622 note = " is unaffected!";
3629 /* Go to sleep (much) later */
3631 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
3633 note = " falls asleep!";
3639 /* No "real" damage */
3645 /* Sleep (Use "dam" as "power") */
3646 case GF_STASIS_EVIL:
3648 if (seen) obvious = TRUE;
3650 if (r_ptr->flagsr & RFR_RES_ALL)
3653 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3655 note = " is immune.";
3658 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3661 /* Attempt a saving throw */
3662 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3663 !(r_ptr->flags3 & RF3_EVIL) ||
3664 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3667 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3669 note = " is unaffected!";
3676 /* Go to sleep (much) later */
3678 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3680 note = " is suspended!";
3686 /* No "real" damage */
3691 /* Sleep (Use "dam" as "power") */
3694 if (seen) obvious = TRUE;
3696 if (r_ptr->flagsr & RFR_RES_ALL)
3699 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3701 note = " is immune.";
3704 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3707 /* Attempt a saving throw */
3708 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3709 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3712 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3714 note = " is unaffected!";
3721 /* Go to sleep (much) later */
3723 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3725 note = " is suspended!";
3731 /* No "real" damage */
3740 dam += (adj_con_fix[p_ptr->stat_ind[A_CHR]] - 1);
3741 vir = virtue_number(V_HARMONY);
3744 dam += p_ptr->virtues[vir-1]/10;
3747 vir = virtue_number(V_INDIVIDUALISM);
3750 dam -= p_ptr->virtues[vir-1]/20;
3753 if (seen) obvious = TRUE;
3755 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3758 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3760 note = " is immune.";
3763 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3767 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3770 /* Attempt a saving throw */
3771 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3772 (r_ptr->flags3 & RF3_NO_CONF) ||
3773 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3774 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 5))
3776 /* Memorize a flag */
3777 if (r_ptr->flags3 & RF3_NO_CONF)
3779 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3783 /* No obvious effect */
3785 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3787 note = " is unaffected!";
3792 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3794 else if (p_ptr->cursed & TRC_AGGRAVATE)
3797 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3799 note = " hates you too much!";
3802 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3807 note = "¤ÏÆÍÁ³Í§¹¥Åª¤Ë¤Ê¤Ã¤¿¤è¤¦¤À¡ª";
3809 note = " suddenly seems friendly!";
3814 chg_virtue(V_INDIVIDUALISM, -1);
3815 if (r_ptr->flags3 & RF3_ANIMAL)
3816 chg_virtue(V_NATURE, 1);
3819 /* No "real" damage */
3824 /* Control undead */
3825 case GF_CONTROL_UNDEAD:
3828 if (seen) obvious = TRUE;
3830 vir = virtue_number(V_UNLIFE);
3833 dam += p_ptr->virtues[vir-1]/10;
3836 vir = virtue_number(V_INDIVIDUALISM);
3839 dam -= p_ptr->virtues[vir-1]/20;
3842 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3845 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3847 note = " is immune.";
3850 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3854 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3857 /* Attempt a saving throw */
3858 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3859 (!(r_ptr->flags3 & RF3_UNDEAD)) ||
3860 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3861 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3863 /* No obvious effect */
3865 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3867 note = " is unaffected!";
3871 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3873 else if (p_ptr->cursed & TRC_AGGRAVATE)
3876 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3878 note = " hates you too much!";
3881 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3886 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
3888 note = " is in your thrall!";
3894 /* No "real" damage */
3900 case GF_CONTROL_DEMON:
3903 if (seen) obvious = TRUE;
3905 vir = virtue_number(V_UNLIFE);
3908 dam += p_ptr->virtues[vir-1]/10;
3911 vir = virtue_number(V_INDIVIDUALISM);
3914 dam -= p_ptr->virtues[vir-1]/20;
3917 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3920 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3922 note = " is immune.";
3925 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3929 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3932 /* Attempt a saving throw */
3933 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3934 (!(r_ptr->flags3 & RF3_DEMON)) ||
3935 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3936 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3938 /* No obvious effect */
3940 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3942 note = " is unaffected!";
3946 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3948 else if (p_ptr->cursed & TRC_AGGRAVATE)
3951 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3953 note = " hates you too much!";
3956 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3961 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
3963 note = " is in your thrall!";
3969 /* No "real" damage */
3975 case GF_CONTROL_ANIMAL:
3979 if (seen) obvious = TRUE;
3981 vir = virtue_number(V_NATURE);
3984 dam += p_ptr->virtues[vir-1]/10;
3987 vir = virtue_number(V_INDIVIDUALISM);
3990 dam -= p_ptr->virtues[vir-1]/20;
3993 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3996 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3998 note = " is immune.";
4001 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4005 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
4008 /* Attempt a saving throw */
4009 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4010 (!(r_ptr->flags3 & (RF3_ANIMAL))) ||
4011 (m_ptr->mflag2 & MFLAG2_NOPET) ||
4012 (r_ptr->flags3 & (RF3_NO_CONF)) ||
4013 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4015 /* Memorize a flag */
4016 if (r_ptr->flags3 & (RF3_NO_CONF))
4018 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
4022 /* No obvious effect */
4024 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4026 note = " is unaffected!";
4030 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4032 else if (p_ptr->cursed & TRC_AGGRAVATE)
4035 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4037 note = " hates you too much!";
4040 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4045 note = "¤Ï¤Ê¤Ä¤¤¤¿¡£";
4047 note = " is tamed!";
4052 if (r_ptr->flags3 & RF3_ANIMAL)
4053 chg_virtue(V_NATURE, 1);
4056 /* No "real" damage */
4062 case GF_CONTROL_LIVING:
4066 vir = virtue_number(V_UNLIFE);
4067 if (seen) obvious = TRUE;
4069 dam += (adj_chr_chm[p_ptr->stat_ind[A_CHR]]);
4070 vir = virtue_number(V_UNLIFE);
4073 dam -= p_ptr->virtues[vir-1]/10;
4076 vir = virtue_number(V_INDIVIDUALISM);
4079 dam -= p_ptr->virtues[vir-1]/20;
4082 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 30;
4083 if (dam < 1) dam = 1;
4085 msg_format("%s¤ò¸«¤Ä¤á¤¿¡£",m_name);
4087 msg_format("You stare into %s.", m_name);
4089 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
4092 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4094 note = " is immune.";
4097 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4101 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
4104 /* Attempt a saving throw */
4105 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4106 (m_ptr->mflag2 & MFLAG2_NOPET) ||
4107 !monster_living(r_ptr) ||
4108 ((r_ptr->level+10) > randint1(dam)))
4111 /* No obvious effect */
4113 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4115 note = " is unaffected!";
4119 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4121 else if (p_ptr->cursed & TRC_AGGRAVATE)
4124 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4126 note = " hates you too much!";
4129 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4134 note = "¤ò»ÙÇÛ¤·¤¿¡£";
4136 note = " is tamed!";
4141 if (r_ptr->flags3 & RF3_ANIMAL)
4142 chg_virtue(V_NATURE, 1);
4145 /* No "real" damage */
4150 /* Confusion (Use "dam" as "power") */
4153 if (seen) obvious = TRUE;
4155 if (r_ptr->flagsr & RFR_RES_ALL)
4158 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4160 note = " is immune.";
4163 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4166 /* Get confused later */
4167 do_conf = damroll(3, (dam / 2)) + 1;
4169 /* Attempt a saving throw */
4170 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4171 (r_ptr->flags3 & (RF3_NO_CONF)) ||
4172 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4174 /* Memorize a flag */
4175 if (r_ptr->flags3 & (RF3_NO_CONF))
4177 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
4183 /* No obvious effect */
4185 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4187 note = " is unaffected!";
4193 /* No "real" damage */
4200 if (seen) obvious = TRUE;
4202 if (r_ptr->flagsr & RFR_RES_ALL)
4205 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4207 note = " is immune.";
4210 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4213 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
4215 /* Attempt a saving throw */
4216 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4217 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4222 /* No obvious effect */
4224 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4226 note = " is unaffected!";
4232 /* No "real" damage */
4240 /* Lite, but only hurts susceptible creatures */
4248 if (r_ptr->flagsr & RFR_RES_ALL)
4254 if (r_ptr->flags3 & (RF3_HURT_LITE))
4256 /* Obvious effect */
4257 if (seen) obvious = TRUE;
4259 /* Memorize the effects */
4260 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4262 /* Special effect */
4264 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4265 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4267 note = " cringes from the light!";
4268 note_dies = " shrivels away in the light!";
4273 /* Normally no damage */
4285 /* Lite -- opposite of Dark */
4288 if (seen) obvious = TRUE;
4290 if (r_ptr->flagsr & RFR_RES_ALL)
4293 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4295 note = " is immune.";
4298 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4301 if (r_ptr->flagsr & RFR_RES_LITE)
4304 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4309 dam *= 2; dam /= (randint1(6)+6);
4310 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_LITE);
4312 else if (r_ptr->flags3 & (RF3_HURT_LITE))
4314 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4316 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4317 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4319 note = " cringes from the light!";
4320 note_dies = " shrivels away in the light!";
4329 /* Dark -- opposite of Lite */
4332 if (seen) obvious = TRUE;
4334 if (r_ptr->flagsr & RFR_RES_ALL)
4337 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4339 note = " is immune.";
4342 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4345 if (r_ptr->flagsr & RFR_RES_DARK)
4348 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4353 dam *= 2; dam /= (randint1(6)+6);
4354 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DARK);
4363 if (r_ptr->flagsr & RFR_RES_ALL)
4368 /* Hurt by rock remover */
4369 if (r_ptr->flags3 & (RF3_HURT_ROCK))
4372 if (seen) obvious = TRUE;
4374 /* Memorize the effects */
4375 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
4377 /* Cute little message */
4379 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
4380 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4382 note = " loses some skin!";
4383 note_dies = " dissolves!";
4388 /* Usually, ignore the effects */
4399 /* Teleport undead (Use "dam" as "power") */
4400 case GF_AWAY_UNDEAD:
4402 /* Only affect undead */
4403 if (r_ptr->flags3 & (RF3_UNDEAD))
4405 bool resists_tele = FALSE;
4407 if (r_ptr->flagsr & RFR_RES_TELE)
4409 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4411 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4413 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4415 note = " is unaffected!";
4418 resists_tele = TRUE;
4420 else if (r_ptr->level > randint1(100))
4422 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4424 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4429 resists_tele = TRUE;
4435 if (seen) obvious = TRUE;
4436 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4448 /* No "real" damage */
4454 /* Teleport evil (Use "dam" as "power") */
4457 /* Only affect evil */
4458 if (r_ptr->flags3 & (RF3_EVIL))
4460 bool resists_tele = FALSE;
4462 if (r_ptr->flagsr & RFR_RES_TELE)
4464 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4466 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4468 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4470 note = " is unaffected!";
4473 resists_tele = TRUE;
4475 else if (r_ptr->level > randint1(100))
4477 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4479 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4484 resists_tele = TRUE;
4490 if (seen) obvious = TRUE;
4491 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4503 /* No "real" damage */
4509 /* Teleport monster (Use "dam" as "power") */
4512 bool resists_tele = FALSE;
4513 if (r_ptr->flagsr & RFR_RES_TELE)
4515 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4517 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4519 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4521 note = " is unaffected!";
4524 resists_tele = TRUE;
4526 else if (r_ptr->level > randint1(100))
4528 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4530 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4535 resists_tele = TRUE;
4542 if (seen) obvious = TRUE;
4544 /* Prepare to teleport */
4548 /* No "real" damage */
4554 /* Turn undead (Use "dam" as "power") */
4555 case GF_TURN_UNDEAD:
4557 if (r_ptr->flagsr & RFR_RES_ALL)
4562 /* Only affect undead */
4563 if (r_ptr->flags3 & (RF3_UNDEAD))
4566 if (seen) obvious = TRUE;
4568 /* Learn about type */
4569 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4571 /* Apply some fear */
4572 do_fear = damroll(3, (dam / 2)) + 1;
4574 /* Attempt a saving throw */
4575 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4577 /* No obvious effect */
4579 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4581 note = " is unaffected!";
4596 /* No "real" damage */
4602 /* Turn evil (Use "dam" as "power") */
4605 if (r_ptr->flagsr & RFR_RES_ALL)
4610 /* Only affect evil */
4611 if (r_ptr->flags3 & (RF3_EVIL))
4614 if (seen) obvious = TRUE;
4616 /* Learn about type */
4617 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4619 /* Apply some fear */
4620 do_fear = damroll(3, (dam / 2)) + 1;
4622 /* Attempt a saving throw */
4623 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4625 /* No obvious effect */
4627 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4629 note = " is unaffected!";
4644 /* No "real" damage */
4650 /* Turn monster (Use "dam" as "power") */
4653 if (r_ptr->flagsr & RFR_RES_ALL)
4659 if (seen) obvious = TRUE;
4661 /* Apply some fear */
4662 do_fear = damroll(3, (dam / 2)) + 1;
4664 /* Attempt a saving throw */
4665 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4666 (r_ptr->flags3 & (RF3_NO_FEAR)) ||
4667 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4669 /* No obvious effect */
4671 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4673 note = " is unaffected!";
4680 /* No "real" damage */
4687 case GF_DISP_UNDEAD:
4689 if (r_ptr->flagsr & RFR_RES_ALL)
4695 /* Only affect undead */
4696 if (r_ptr->flags3 & (RF3_UNDEAD))
4699 if (seen) obvious = TRUE;
4701 /* Learn about type */
4702 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4706 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4707 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4709 note = " shudders.";
4710 note_dies = " dissolves!";
4731 if (r_ptr->flagsr & RFR_RES_ALL)
4737 /* Only affect evil */
4738 if (r_ptr->flags3 & (RF3_EVIL))
4741 if (seen) obvious = TRUE;
4743 /* Learn about type */
4744 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4748 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4749 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4751 note = " shudders.";
4752 note_dies = " dissolves!";
4772 if (r_ptr->flagsr & RFR_RES_ALL)
4778 /* Only affect good */
4779 if (r_ptr->flags3 & (RF3_GOOD))
4782 if (seen) obvious = TRUE;
4784 /* Learn about type */
4785 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
4789 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4790 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4792 note = " shudders.";
4793 note_dies = " dissolves!";
4811 case GF_DISP_LIVING:
4813 if (r_ptr->flagsr & RFR_RES_ALL)
4819 /* Only affect non-undead */
4820 if (monster_living(r_ptr))
4823 if (seen) obvious = TRUE;
4827 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4828 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4830 note = " shudders.";
4831 note_dies = " dissolves!";
4852 if (r_ptr->flagsr & RFR_RES_ALL)
4858 /* Only affect demons */
4859 if (r_ptr->flags3 & (RF3_DEMON))
4862 if (seen) obvious = TRUE;
4864 /* Learn about type */
4865 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
4869 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4870 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4872 note = " shudders.";
4873 note_dies = " dissolves!";
4890 /* Dispel monster */
4893 if (r_ptr->flagsr & RFR_RES_ALL)
4900 if (seen) obvious = TRUE;
4904 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4905 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4907 note = " shudders.";
4908 note_dies = " dissolves!";
4918 if (seen) obvious = TRUE;
4920 if (r_ptr->flagsr & RFR_RES_ALL)
4923 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4925 note = " is immune.";
4928 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4932 if ((r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) || (r_ptr->flags5 & ~(RF5_NOMAGIC_MASK)) || (r_ptr->flags6 & ~(RF6_NOMAGIC_MASK)))
4936 /* Heal the monster */
4937 if (caster_ptr->hp < caster_ptr->maxhp)
4940 caster_ptr->hp += 6 * dam;
4941 if (caster_ptr->hp > caster_ptr->maxhp) caster_ptr->hp = caster_ptr->maxhp;
4943 /* Redraw (later) if needed */
4944 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
4945 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
4947 /* Special message */
4950 /* Get the monster name */
4951 monster_desc(killer, caster_ptr, 0);
4953 msg_format("%^s¤Ïµ¤Ê¬¤¬Îɤµ¤½¤¦¤À¡£", killer);
4955 msg_format("%^s appears healthier.", killer);
4964 msg_format("%s¤«¤éÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¤È¤Ã¤¿¡£", m_name);
4966 msg_format("You draw psychic energy from %s.", m_name);
4969 (void)hp_player(dam);
4975 if (see_s_msg) msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", m_name);
4977 if (see_s_msg) msg_format("%s is unaffected.", m_name);
4987 if (seen) obvious = TRUE;
4990 if (!who) msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£", m_name);
4992 if (!who) msg_format("You gaze intently at %s.", m_name);
4995 if (r_ptr->flagsr & RFR_RES_ALL)
4998 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5000 note = " is immune.";
5003 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5007 /* Attempt a saving throw */
5008 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5009 (r_ptr->flags3 & RF3_NO_CONF) ||
5010 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
5012 /* Memorize a flag */
5013 if (r_ptr->flags3 & (RF3_NO_CONF))
5015 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
5018 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5020 note = "is unaffected!";
5024 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
5026 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5028 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5030 note = " is immune!";
5034 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
5036 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
5038 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
5047 note = "¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£";
5048 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
5050 note = " is blasted by psionic energy.";
5051 note_dies = " collapses, a mindless husk.";
5054 if (who > 0) do_conf = randint0(4) + 4;
5055 else do_conf = randint0(8) + 8;
5061 case GF_BRAIN_SMASH:
5063 if (seen) obvious = TRUE;
5066 if (!who) msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£", m_name);
5068 if (!who) msg_format("You gaze intently at %s.", m_name);
5071 if (r_ptr->flagsr & RFR_RES_ALL)
5074 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5076 note = " is immune.";
5079 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5083 /* Attempt a saving throw */
5084 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5085 (r_ptr->flags3 & RF3_NO_CONF) ||
5086 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
5088 /* Memorize a flag */
5089 if (r_ptr->flags3 & (RF3_NO_CONF))
5091 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
5094 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5096 note = "is unaffected!";
5100 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
5102 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5104 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5106 note = " is immune!";
5110 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
5112 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
5114 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
5123 note = "¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£";
5124 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
5126 note = " is blasted by psionic energy.";
5127 note_dies = " collapses, a mindless husk.";
5132 do_conf = randint0(4) + 4;
5133 do_stun = randint0(4) + 4;
5137 do_conf = randint0(8) + 8;
5138 do_stun = randint0(8) + 8;
5140 m_ptr->slow = MIN(200, m_ptr->slow + 10);
5141 if (!m_ptr->mproc_idx[MPROC_SLOW]) mproc_add(c_ptr->m_idx, MPROC_SLOW);
5142 if (c_ptr->m_idx == p_ptr->riding)
5143 p_ptr->update |= (PU_BONUS);
5151 if (seen) obvious = TRUE;
5154 if (!who) msg_format("%s¤ò»Øº¹¤·¤Æ¼ö¤¤¤ò¤«¤±¤¿¡£", m_name);
5156 if (!who) msg_format("You point at %s and curses.", m_name);
5159 if (r_ptr->flagsr & RFR_RES_ALL)
5162 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5164 note = " is immune.";
5167 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5171 /* Attempt a saving throw */
5172 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
5175 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5177 note = "is unaffected!";
5187 if (seen) obvious = TRUE;
5190 if (!who) msg_format("%s¤ò»Øº¹¤·¤Æ¶²¤í¤·¤²¤Ë¼ö¤¤¤ò¤«¤±¤¿¡£", m_name);
5192 if (!who) msg_format("You point at %s and curses horribly.", m_name);
5195 if (r_ptr->flagsr & RFR_RES_ALL)
5198 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5200 note = " is immune.";
5203 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5207 /* Attempt a saving throw */
5208 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
5211 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5213 note = "is unaffected!";
5223 if (seen) obvious = TRUE;
5226 if (!who) msg_format("%s¤ò»Øº¹¤·¡¢¶²¤í¤·¤²¤Ë¼öʸ¤ò¾§¤¨¤¿¡ª", m_name);
5228 if (!who) msg_format("You point at %s, incanting terribly!", m_name);
5231 if (r_ptr->flagsr & RFR_RES_ALL)
5234 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5236 note = " is immune.";
5239 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5243 /* Attempt a saving throw */
5244 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
5247 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5249 note = "is unaffected!";
5259 if (seen) obvious = TRUE;
5262 if (!who) msg_format("%s¤ÎÈ빦¤òÆͤ¤¤Æ¡¢¡Ö¤ªÁ°¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡×¤È¶«¤ó¤À¡£", m_name);
5264 if (!who) msg_format("You point at %s, screaming the word, 'DIE!'.", m_name);
5267 if (r_ptr->flagsr & RFR_RES_ALL)
5270 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5272 note = " is immune.";
5275 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5279 /* Attempt a saving throw */
5280 if ((randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35)) && ((who <= 0) || (caster_ptr->r_idx != MON_KENSHIROU)))
5283 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5285 note = "is unaffected!";
5295 if (seen) obvious = TRUE;
5297 if (r_ptr->flagsr & RFR_RES_ALL)
5300 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5302 note = " is immune.";
5305 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5309 if (r_ptr->flags1 & RF1_UNIQUE)
5312 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5314 note = "is unaffected!";
5320 if ((who > 0) ? ((caster_lev + randint1(dam)) > (r_ptr->level + 10 + randint1(20))) :
5321 (((caster_lev / 2) + randint1(dam)) > (r_ptr->level + randint1(200))))
5323 dam = ((40 + randint1(20)) * m_ptr->hp) / 100;
5325 if (m_ptr->hp < dam) dam = m_ptr->hp - 1;
5330 note = "¤ÏÂÑÀ¤ò»ý¤Ã¤Æ¤¤¤ë¡ª";
5340 /* Capture monster */
5344 if ((p_ptr->inside_quest && (quest[p_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(m_ptr)) ||
5345 (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)
5348 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£",m_name);
5350 msg_format("%^s is unaffected.", m_name);
5356 if (is_pet(m_ptr)) nokori_hp = m_ptr->maxhp * 4L;
5357 else if ((p_ptr->pclass == CLASS_BEASTMASTER) && monster_living(r_ptr))
5358 nokori_hp = m_ptr->maxhp * 3 / 10;
5360 nokori_hp = m_ptr->maxhp * 3 / 20;
5362 if (m_ptr->hp >= nokori_hp)
5365 msg_format("¤â¤Ã¤È¼å¤é¤»¤Ê¤¤¤È¡£");
5367 msg_format("You need to weaken %s more.", m_name);
5371 else if (m_ptr->hp < randint0(nokori_hp))
5373 if (m_ptr->mflag2 & MFLAG2_CHAMELEON) choose_new_monster(c_ptr->m_idx, FALSE, MON_CHAMELEON);
5375 msg_format("%s¤òÊᤨ¤¿¡ª",m_name);
5377 msg_format("You capture %^s!", m_name);
5379 cap_mon = m_ptr->r_idx;
5380 cap_mspeed = m_ptr->mspeed;
5382 cap_maxhp = m_ptr->max_maxhp;
5383 cap_nickname = m_ptr->nickname; /* Quark transfer */
5384 if (c_ptr->m_idx == p_ptr->riding)
5386 if (rakuba(-1, FALSE))
5389 msg_print("ÃÏÌ̤ËÍî¤È¤µ¤ì¤¿¡£");
5391 msg_format("You have fallen from %s.", m_name);
5396 delete_monster_idx(c_ptr->m_idx);
5403 msg_format("¤¦¤Þ¤¯Êá¤Þ¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡£");
5405 msg_format("You failed to capture %s.", m_name);
5412 /* Attack (Use "dam" as attack type) */
5415 /* Return this monster's death */
5416 return py_attack(y, x, dam);
5419 /* Sleep (Use "dam" as "power") */
5425 if (seen) obvious = TRUE;
5427 if (r_ptr->flagsr & RFR_RES_ALL)
5430 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5432 note = " is immune.";
5435 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5438 if (r_ptr->flags2 & RF2_EMPTY_MIND)
5441 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5443 note = " is immune!";
5447 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5453 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5455 note = " is immune!";
5462 if (one_in_(5)) effect = 1;
5463 else if (one_in_(4)) effect = 2;
5464 else if (one_in_(3)) effect = 3;
5469 /* Powerful monsters can resist */
5470 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5471 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5474 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5476 note = " is unaffected!";
5482 /* Normal monsters slow down */
5488 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
5490 note = " starts moving slower.";
5492 mproc_add(c_ptr->m_idx, MPROC_SLOW);
5494 m_ptr->slow = MIN(200, m_ptr->slow + 50);
5496 if (c_ptr->m_idx == p_ptr->riding)
5497 p_ptr->update |= (PU_BONUS);
5501 else if (effect == 2)
5503 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
5505 /* Attempt a saving throw */
5506 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
5507 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5512 /* No obvious effect */
5514 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5516 note = " is unaffected!";
5523 else if (effect == 3)
5525 /* Attempt a saving throw */
5526 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5527 (r_ptr->flags3 & RF3_NO_SLEEP) ||
5528 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5530 /* Memorize a flag */
5531 if (r_ptr->flags3 & RF3_NO_SLEEP)
5533 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
5536 /* No obvious effect */
5538 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5540 note = " is unaffected!";
5547 /* Go to sleep (much) later */
5549 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5551 note = " falls asleep!";
5561 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5563 note = " is immune!";
5567 /* No "real" damage */
5575 if (seen) obvious = TRUE;
5577 if (r_ptr->flagsr & RFR_RES_ALL)
5580 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5582 note = " is immune.";
5585 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5590 if (genocide_aux(c_ptr->m_idx, dam, !who, (r_ptr->level + 1) / 2, "¥â¥ó¥¹¥¿¡¼¾ÃÌÇ"))
5592 if (genocide_aux(c_ptr->m_idx, dam, !who, (r_ptr->level + 1) / 2, "Genocide One"))
5596 if (seen_msg) msg_format("%s¤Ï¾ÃÌǤ·¤¿¡ª", m_name);
5598 if (seen_msg) msg_format("%^s disappered!", m_name);
5600 chg_virtue(V_VITALITY, -1);
5611 if (!who) msg_format("%s¤ò¼Ì¿¿¤Ë»£¤Ã¤¿¡£", m_name);
5613 if (!who) msg_format("You take a photograph of %s.", m_name);
5616 if (r_ptr->flags3 & (RF3_HURT_LITE))
5618 /* Obvious effect */
5619 if (seen) obvious = TRUE;
5621 /* Memorize the effects */
5622 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
5624 /* Special effect */
5626 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
5627 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5629 note = " cringes from the light!";
5630 note_dies = " shrivels away in the light!";
5634 /* Normally no damage */
5641 photo = m_ptr->r_idx;
5648 case GF_BLOOD_CURSE:
5650 if (seen) obvious = TRUE;
5652 if (r_ptr->flagsr & RFR_RES_ALL)
5655 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5657 note = " is immune.";
5660 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5668 bool success = FALSE;
5669 if (seen) obvious = TRUE;
5671 if ((r_ptr->flags3 & (RF3_GOOD)) && !p_ptr->inside_arena)
5673 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 50;
5674 if (dam < 1) dam = 1;
5676 /* No need to tame your pet */
5680 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
5682 note = " starts moving faster.";
5685 m_ptr->fast = MIN(200, m_ptr->fast + 100);
5686 if (!m_ptr->mproc_idx[MPROC_FAST]) mproc_add(c_ptr->m_idx, MPROC_FAST);
5688 if (c_ptr->m_idx == p_ptr->riding) p_ptr->update |= (PU_BONUS);
5692 /* Attempt a saving throw */
5693 else if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
5694 (r_ptr->flags1 & (RF1_UNIQUE)) ||
5695 (m_ptr->mflag2 & MFLAG2_NOPET) ||
5696 (p_ptr->cursed & TRC_AGGRAVATE) ||
5697 ((r_ptr->level+10) > randint1(dam)))
5700 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
5705 note = "¤ò»ÙÇÛ¤·¤¿¡£";
5707 note = " is tamed!";
5711 m_ptr->fast = MIN(200, m_ptr->fast + 100);
5712 if (!m_ptr->mproc_idx[MPROC_FAST]) mproc_add(c_ptr->m_idx, MPROC_FAST);
5714 /* Learn about type */
5715 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
5722 if (!(r_ptr->flags3 & RF3_NO_FEAR))
5724 do_fear = randint1(90)+10;
5726 else if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_FEAR);
5729 /* No "real" damage */
5736 if (seen) obvious = TRUE;
5738 if (r_ptr->flagsr & RFR_RES_ALL)
5741 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5743 note = " is immune.";
5746 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5750 /* Attempt a saving throw */
5751 if (randint0(100 + dam) < (r_ptr->level + 50))
5755 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5757 note = "is unaffected!";
5778 /* Absolutely no effect */
5779 if (skipped) return (FALSE);
5781 /* "Unique" monsters cannot be polymorphed */
5782 if (r_ptr->flags1 & (RF1_UNIQUE)) do_poly = FALSE;
5784 /* Quest monsters cannot be polymorphed */
5785 if (r_ptr->flags1 & RF1_QUESTOR) do_poly = FALSE;
5787 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_poly = FALSE;
5789 /* "Unique" and "quest" monsters can only be "killed" by the player. */
5790 if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & RF7_NAZGUL)) && !p_ptr->inside_battle)
5792 if (who && (dam > m_ptr->hp)) dam = m_ptr->hp;
5797 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_COMPASSION, -1);
5798 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_HONOUR, -1);
5801 /* Modify the damage */
5803 dam = mon_damage_mod(m_ptr, dam, (bool)(typ == GF_PSY_SPEAR));
5805 if ((tmp > 0) && (dam == 0)) note = "¤Ï¥À¥á¡¼¥¸¤ò¼õ¤±¤Æ¤¤¤Ê¤¤¡£";
5807 if ((tmp > 0) && (dam == 0)) note = " is unharmed.";
5810 /* Check for death */
5811 if (dam > m_ptr->hp)
5813 /* Extract method of death */
5818 /* Sound and Impact resisters never stun */
5820 !(r_ptr->flagsr & (RFR_RES_SOUN | RFR_RES_WALL)) &&
5821 !(r_ptr->flags3 & RF3_NO_STUN))
5824 if (seen) obvious = TRUE;
5830 note = "¤Ï¤Ò¤É¤¯¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5832 note = " is more dazed.";
5835 tmp = m_ptr->stunned + (do_stun / 2);
5840 note = "¤Ï¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5842 note = " is dazed.";
5846 mproc_add(c_ptr->m_idx, MPROC_STUNNED);
5850 m_ptr->stunned = (tmp < 200) ? tmp : 200;
5856 /* Confusion and Chaos resisters (and sleepers) never confuse */
5858 !(r_ptr->flags3 & RF3_NO_CONF) &&
5859 !(r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK))
5862 if (seen) obvious = TRUE;
5864 /* Already partially confused */
5865 if (m_ptr->confused)
5868 note = "¤Ï¤µ¤é¤Ëº®Í𤷤¿¤è¤¦¤À¡£";
5870 note = " looks more confused.";
5873 tmp = m_ptr->confused + (do_conf / 2);
5876 /* Was not confused */
5880 note = "¤Ïº®Í𤷤¿¤è¤¦¤À¡£";
5882 note = " looks confused.";
5886 mproc_add(c_ptr->m_idx, MPROC_CONFUSED);
5889 /* Apply confusion */
5890 m_ptr->confused = (tmp < 200) ? tmp : 200;
5899 if (seen) obvious = TRUE;
5901 if (do_time >= m_ptr->maxhp) do_time = m_ptr->maxhp - 1;
5906 note = "¤Ï¼å¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£";
5908 note = " seems weakened.";
5910 m_ptr->maxhp -= do_time;
5911 if ((m_ptr->hp - dam) > m_ptr->maxhp) dam = m_ptr->hp - m_ptr->maxhp;
5916 /* Mega-Hack -- Handle "polymorph" -- monsters get a saving throw */
5917 if (do_poly && (randint1(90) > r_ptr->level))
5919 if (polymorph_monster(y, x))
5922 if (seen) obvious = TRUE;
5924 /* Monster polymorphs */
5926 note = "¤¬ÊѿȤ·¤¿¡ª";
5931 /* Turn off the damage */
5938 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5940 note = " is unaffected!";
5944 /* Hack -- Get new monster */
5945 m_ptr = &m_list[c_ptr->m_idx];
5947 /* Hack -- Get new race */
5948 r_ptr = &r_info[m_ptr->r_idx];
5951 /* Handle "teleport" */
5955 if (seen) obvious = TRUE;
5959 note = "¤¬¾Ã¤¨µî¤Ã¤¿¡ª";
5961 note = " disappears!";
5964 if (!who) chg_virtue(V_VALOUR, -1);
5967 teleport_away(c_ptr->m_idx, do_dist, (bool)(!who), TRUE);
5969 /* Hack -- get new location */
5973 /* Hack -- get new grid */
5974 c_ptr = &cave[y][x];
5981 tmp = m_ptr->monfear + do_fear;
5984 m_ptr->monfear = (tmp < 200) ? tmp : 200;
5985 if (!m_ptr->mproc_idx[MPROC_MONFEAR]) mproc_add(c_ptr->m_idx, MPROC_MONFEAR);
5992 if (typ == GF_DRAIN_MANA)
5994 /* Drain mana does nothing */
5997 /* If another monster did the damage, hurt the monster by hand */
6000 /* Redraw (later) if needed */
6001 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
6002 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
6006 /* Wake the monster up */
6008 mproc_remove(c_ptr->m_idx, m_ptr->mproc_idx[MPROC_CSLEEP], MPROC_CSLEEP);
6009 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
6012 /* Hurt the monster */
6020 if (is_pet(m_ptr) && !(m_ptr->ml))
6023 /* Give detailed messages if destroyed */
6026 monster_desc(m_name, m_ptr, MD_TRUE_NAME);
6029 msg_format("%^s%s", m_name, note);
6037 monster_gain_exp(who, m_ptr->r_idx);
6039 /* Generate treasure, etc */
6040 monster_death(c_ptr->m_idx, FALSE);
6042 /* Delete the monster */
6043 delete_monster_idx(c_ptr->m_idx);
6048 msg_print("¾¯¤·Èᤷ¤¤µ¤Ê¬¤¬¤·¤¿¡£");
6050 msg_print("You feel sad for a moment.");
6056 /* Damaged monster */
6059 /* Give detailed messages if visible or destroyed */
6060 if (note && seen_msg) msg_format("%^s%s", m_name, note);
6062 /* Hack -- Pain message */
6065 message_pain(c_ptr->m_idx, dam);
6072 /* Hack -- handle sleep */
6075 m_ptr->csleep = do_sleep;
6076 if (!m_ptr->mproc_idx[MPROC_CSLEEP]) mproc_add(c_ptr->m_idx, MPROC_CSLEEP);
6081 else if (heal_leper)
6084 if (seen_msg) msg_print("ÉÔ·é¤ÊÉ¿ͤÏɵ¤¤¬¼£¤Ã¤¿¡ª");
6086 if (seen_msg) msg_print("The Mangy looking leper is healed!");
6089 delete_monster_idx(c_ptr->m_idx);
6092 /* If the player did it, give him experience, check fear */
6097 /* Hurt the monster, check for fear and death */
6098 if (mon_take_hit(c_ptr->m_idx, dam, &fear, note_dies))
6103 /* Damaged monster */
6106 /* HACK - anger the monster before showing the sleep message */
6107 if (do_sleep) anger_monster(m_ptr);
6109 /* Give detailed messages if visible or destroyed */
6110 if (note && seen_msg)
6112 msg_format("%s%s", m_name, note);
6114 msg_format("%^s%s", m_name, note);
6118 /* Hack -- Pain message */
6119 else if (known && (dam || !do_fear))
6121 message_pain(c_ptr->m_idx, dam);
6124 /* Anger monsters */
6125 if (((dam > 0) || get_angry) && !do_sleep)
6126 anger_monster(m_ptr);
6129 if ((fear || do_fear) && seen)
6136 msg_format("%^s¤Ï¶²Éݤ·¤Æƨ¤²½Ð¤·¤¿¡ª", m_name);
6138 msg_format("%^s flees in terror!", m_name);
6142 /* Hack -- handle sleep */
6145 m_ptr->csleep = do_sleep;
6146 if (!m_ptr->mproc_idx[MPROC_CSLEEP]) mproc_add(c_ptr->m_idx, MPROC_CSLEEP);
6151 if ((typ == GF_BLOOD_CURSE) && one_in_(4))
6153 int curse_flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
6157 switch (randint1(28))
6163 msg_print("ÃÏÌ̤¬Íɤ줿...");
6165 msg_print("The ground trembles...");
6168 earthquake(ty, tx, 4 + randint0(4));
6169 if (!one_in_(6)) break;
6171 case 3: case 4: case 5: case 6:
6174 int dam = damroll(10, 10);
6176 msg_print("½ã¿è¤ÊËâÎϤμ¡¸µ¤Ø¤ÎÈ⤬³«¤¤¤¿¡ª");
6178 msg_print("A portal opens to a plane of raw mana!");
6181 project(0, 8, ty,tx, dam, GF_MANA, curse_flg, -1);
6182 if (!one_in_(6)) break;
6188 msg_print("¶õ´Ö¤¬ÏĤó¤À¡ª");
6190 msg_print("Space warps about you!");
6193 if (m_ptr->r_idx) teleport_away(c_ptr->m_idx, damroll(10, 10), FALSE, TRUE);
6194 if (one_in_(13)) count += activate_hi_summon(ty, tx, TRUE);
6195 if (!one_in_(6)) break;
6197 case 9: case 10: case 11:
6199 msg_print("¥¨¥Í¥ë¥®¡¼¤Î¤¦¤Í¤ê¤ò´¶¤¸¤¿¡ª");
6201 msg_print("You feel a surge of energy!");
6204 project(0, 7, ty, tx, 50, GF_DISINTEGRATE, curse_flg, -1);
6205 if (!one_in_(6)) break;
6206 case 12: case 13: case 14: case 15: case 16:
6207 aggravate_monsters(0);
6208 if (!one_in_(6)) break;
6210 count += activate_hi_summon(ty, tx, TRUE);
6211 if (!one_in_(6)) break;
6212 case 19: case 20: case 21: case 22:
6214 bool pet = !one_in_(3);
6215 u32b mode = PM_ALLOW_GROUP;
6217 if (pet) mode |= PM_FORCE_PET;
6218 else mode |= (PM_NO_PET | PM_FORCE_FRIENDLY);
6220 count += summon_specific((pet ? -1 : 0), py, px, (pet ? p_ptr->lev*2/3+randint1(p_ptr->lev/2) : dun_level), 0, mode);
6221 if (!one_in_(6)) break;
6223 case 23: case 24: case 25:
6224 if (p_ptr->hold_life && (randint0(100) < 75)) break;
6226 msg_print("À¸Ì¿ÎϤ¬ÂΤ«¤éµÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
6228 msg_print("You feel your life draining away...");
6231 if (p_ptr->hold_life) lose_exp(p_ptr->exp / 160);
6232 else lose_exp(p_ptr->exp / 16);
6233 if (!one_in_(6)) break;
6234 case 26: case 27: case 28:
6243 (void)do_dec_stat(i);
6252 (void)do_dec_stat(randint0(6));
6261 if (p_ptr->inside_battle)
6263 p_ptr->health_who = c_ptr->m_idx;
6264 p_ptr->redraw |= (PR_HEALTH);
6268 /* XXX XXX XXX Verify this code */
6270 /* Update the monster */
6271 update_mon(c_ptr->m_idx, FALSE);
6273 /* Redraw the monster grid */
6277 /* Update monster recall window */
6278 if (p_ptr->monster_race_idx == m_ptr->r_idx)
6281 p_ptr->window |= (PW_MONSTER);
6284 if ((dam > 0) && !is_pet(m_ptr) && !is_friendly(m_ptr))
6288 if (!projectable(m_ptr->fy, m_ptr->fx, py, px) && !(flg & PROJECT_NO_HANGEKI))
6290 set_target(m_ptr, monster_target_y, monster_target_x);
6293 else if ((who > 0) && is_pet(caster_ptr) && !player_bold(m_ptr->target_y, m_ptr->target_x))
6295 set_target(m_ptr, caster_ptr->fy, caster_ptr->fx);
6299 if (p_ptr->riding && (p_ptr->riding == c_ptr->m_idx) && (dam > 0))
6301 if (m_ptr->hp > m_ptr->maxhp/3) dam = (dam + 1) / 2;
6302 rakubadam_m = (dam > 200) ? 200 : dam;
6311 /* Get local object */
6314 /* Prepare to make a Blade of Chaos */
6315 object_prep(q_ptr, lookup_kind(TV_STATUE, SV_PHOTO));
6317 q_ptr->pval = photo;
6319 /* Mark the item as fully known */
6320 q_ptr->ident |= (IDENT_MENTAL);
6322 /* Drop it in the dungeon */
6323 (void)drop_near(q_ptr, -1, py, px);
6331 /* Return "Anything seen?" */
6337 * Helper function for "project()" below.
6339 * Handle a beam/bolt/ball causing damage to the player.
6341 * This routine takes a "source monster" (by index), a "distance", a default
6342 * "damage", and a "damage type". See "project_m()" above.
6344 * If "rad" is non-zero, then the blast was centered elsewhere, and the damage
6345 * is reduced (see "project_m()" above). This can happen if a monster breathes
6346 * at the player and hits a wall instead.
6348 * NOTE (Zangband): 'Bolt' attacks can be reflected back, so we need
6349 * to know if this is actually a ball or a bolt spell
6352 * We return "TRUE" if any "obvious" effects were observed. XXX XXX Actually,
6353 * we just assume that the effects were obvious, for historical reasons.
6355 static bool project_p(int who, cptr who_name, int r, int y, int x, int dam, int typ, int flg, int monspell)
6360 /* Hack -- assume obvious */
6361 bool obvious = TRUE;
6363 /* Player blind-ness */
6364 bool blind = (p_ptr->blind ? TRUE : FALSE);
6366 /* Player needs a "description" (he is blind) */
6369 /* Source monster */
6370 monster_type *m_ptr = NULL;
6372 /* Monster name (for attacks) */
6375 /* Monster name (for damage) */
6378 /* Hack -- messages */
6384 /* Player is not here */
6385 if (!player_bold(y, x)) return (FALSE);
6387 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && (randint0(55) < (p_ptr->lev*3/5+20)) && who && (who != p_ptr->riding))
6393 /* Player cannot hurt himself */
6394 if (!who) return (FALSE);
6395 if (who == p_ptr->riding) return (FALSE);
6397 if ((p_ptr->reflect || ((p_ptr->special_defense & KATA_FUUJIN) && !p_ptr->blind)) && (flg & PROJECT_REFLECTABLE) && !one_in_(10))
6400 int max_attempts = 10;
6403 if (blind) msg_print("²¿¤«¤¬Ä·¤ÍÊ֤ä¿¡ª");
6404 else if (p_ptr->special_defense & KATA_FUUJIN) msg_print("É÷¤ÎÇ¡¤¯Éð´ï¤ò¿¶¤ë¤Ã¤ÆÃƤÊÖ¤·¤¿¡ª");
6405 else msg_print("¹¶·â¤¬Ä·¤ÍÊ֤ä¿¡ª");
6407 if (blind) msg_print("Something bounces!");
6408 else msg_print("The attack bounces!");
6412 /* Choose 'new' target */
6415 t_y = m_list[who].fy - 1 + randint1(3);
6416 t_x = m_list[who].fx - 1 + randint1(3);
6419 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(py, px, t_y, t_x));
6421 if (max_attempts < 1)
6423 t_y = m_list[who].fy;
6424 t_x = m_list[who].fx;
6427 project(0, 0, t_y, t_x, dam, typ, (PROJECT_STOP|PROJECT_KILL|PROJECT_REFLECTABLE), monspell);
6434 /* Limit maximum damage */
6435 if (dam > 1600) dam = 1600;
6437 /* Reduce damage by distance */
6438 dam = (dam + r) / (r + 1);
6441 /* If the player is blind, be more descriptive */
6442 if (blind) fuzzy = TRUE;
6447 /* Get the source monster */
6448 m_ptr = &m_list[who];
6449 /* Extract the monster level */
6450 rlev = (((&r_info[m_ptr->r_idx])->level >= 1) ? (&r_info[m_ptr->r_idx])->level : 1);
6452 /* Get the monster name */
6453 monster_desc(m_name, m_ptr, 0);
6455 /* Get the monster's real name (gotten before polymorph!) */
6456 strcpy(killer, who_name);
6461 strcpy(killer, "æ«");
6463 strcpy(killer, "a trap");
6467 /* Analyze the damage */
6470 /* Standard damage -- hurts inventory too */
6474 if (fuzzy) msg_print("»À¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6476 if (fuzzy) msg_print("You are hit by acid!");
6479 get_damage = acid_dam(dam, killer, monspell);
6483 /* Standard damage -- hurts inventory too */
6487 if (fuzzy) msg_print("²Ð±ê¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6489 if (fuzzy) msg_print("You are hit by fire!");
6492 get_damage = fire_dam(dam, killer, monspell);
6496 /* Standard damage -- hurts inventory too */
6500 if (fuzzy) msg_print("Î䵤¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6502 if (fuzzy) msg_print("You are hit by cold!");
6505 get_damage = cold_dam(dam, killer, monspell);
6509 /* Standard damage -- hurts inventory too */
6513 if (fuzzy) msg_print("ÅÅ·â¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6515 if (fuzzy) msg_print("You are hit by lightning!");
6518 get_damage = elec_dam(dam, killer, monspell);
6522 /* Standard damage -- also poisons player */
6525 bool double_resist = IS_OPPOSE_POIS();
6527 if (fuzzy) msg_print("ÆǤǹ¶·â¤µ¤ì¤¿¡ª");
6529 if (fuzzy) msg_print("You are hit by poison!");
6532 if (p_ptr->resist_pois) dam = (dam + 2) / 3;
6533 if (double_resist) dam = (dam + 2) / 3;
6535 if ((!(double_resist || p_ptr->resist_pois)) &&
6536 one_in_(HURT_CHANCE))
6541 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6543 if (!(double_resist || p_ptr->resist_pois))
6545 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6550 /* Standard damage -- also poisons / mutates player */
6553 bool double_resist = IS_OPPOSE_POIS();
6555 if (fuzzy) msg_print("Êü¼Íǽ¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6557 if (fuzzy) msg_print("You are hit by radiation!");
6560 if (p_ptr->resist_pois) dam = (2 * dam + 2) / 5;
6561 if (double_resist) dam = (2 * dam + 2) / 5;
6562 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6563 if (!(double_resist || p_ptr->resist_pois))
6565 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6567 if (one_in_(5)) /* 6 */
6570 msg_print("´ñ·ÁŪ¤ÊÊѿȤò¿ë¤²¤¿¡ª");
6572 msg_print("You undergo a freakish metamorphosis!");
6575 if (one_in_(4)) /* 4 */
6583 inven_damage(set_acid_destroy, 2);
6589 /* Standard damage */
6593 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6595 if (fuzzy) msg_print("You are hit by something!");
6598 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6602 /* Holy Orb -- Player only takes partial damage */
6606 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6608 if (fuzzy) msg_print("You are hit by something!");
6611 if (p_ptr->align > 10)
6613 else if (p_ptr->align < -10)
6615 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6622 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6624 if (fuzzy) msg_print("You are hit by something!");
6627 if (p_ptr->align > 10)
6629 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6633 /* Arrow -- XXX no dodging */
6637 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6639 if (fuzzy) msg_print("You are hit by something sharp!");
6642 else if ((inventory[INVEN_RARM].name1 == ART_ZANTETSU) || (inventory[INVEN_LARM].name1 == ART_ZANTETSU))
6645 msg_print("Ìð¤ò»Â¤ê¼Î¤Æ¤¿¡ª");
6647 msg_print("You cut down the arrow!");
6651 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6655 /* Plasma -- XXX No resist */
6659 if (fuzzy) msg_print("²¿¤«¤È¤Æ¤âÇ®¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6661 if (fuzzy) msg_print("You are hit by something *HOT*!");
6664 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6666 if (!p_ptr->resist_sound)
6668 int k = (randint1((dam > 40) ? 35 : (dam * 3 / 4 + 5)));
6669 (void)set_stun(p_ptr->stun + k);
6672 if (!(p_ptr->resist_fire ||
6674 p_ptr->immune_fire))
6676 inven_damage(set_acid_destroy, 3);
6682 /* Nether -- drain experience */
6686 if (fuzzy) msg_print("ÃϹö¤ÎÎϤǹ¶·â¤µ¤ì¤¿¡ª");
6688 if (fuzzy) msg_print("You are hit by nether forces!");
6692 if (p_ptr->resist_neth)
6694 if (!prace_is_(RACE_SPECTRE))
6695 dam *= 6; dam /= (randint1(4) + 7);
6697 else drain_exp(200 + (p_ptr->exp / 100), 200 + (p_ptr->exp / 1000), 75);
6699 if (prace_is_(RACE_SPECTRE))
6702 msg_print("µ¤Ê¬¤¬¤è¤¯¤Ê¤Ã¤¿¡£");
6704 msg_print("You feel invigorated!");
6708 learn_spell(monspell);
6712 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6718 /* Water -- stun/confuse */
6722 if (fuzzy) msg_print("²¿¤«¼¾¤Ã¤¿¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6724 if (fuzzy) msg_print("You are hit by something wet!");
6727 if (!p_ptr->resist_sound)
6729 set_stun(p_ptr->stun + randint1(40));
6731 if (!p_ptr->resist_conf)
6733 set_confused(p_ptr->confused + randint1(5) + 5);
6738 inven_damage(set_cold_destroy, 3);
6741 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6745 /* Chaos -- many effects */
6749 if (fuzzy) msg_print("̵Ãá½ø¤ÎÇÈÆ°¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6751 if (fuzzy) msg_print("You are hit by a wave of anarchy!");
6754 if (p_ptr->resist_chaos)
6756 dam *= 6; dam /= (randint1(4) + 7);
6758 if (!p_ptr->resist_conf)
6760 (void)set_confused(p_ptr->confused + randint0(20) + 10);
6762 if (!p_ptr->resist_chaos)
6764 (void)set_image(p_ptr->image + randint1(10));
6768 msg_print("¤¢¤Ê¤¿¤Î¿ÈÂΤϥ«¥ª¥¹¤ÎÎϤÇDZ¤¸¶Ê¤²¤é¤ì¤¿¡ª");
6770 msg_print("Your body is twisted by chaos!");
6773 (void)gain_random_mutation(0);
6776 if (!p_ptr->resist_neth && !p_ptr->resist_chaos)
6778 drain_exp(5000 + (p_ptr->exp / 100), 500 + (p_ptr->exp / 1000), 75);
6780 if (!p_ptr->resist_chaos || one_in_(9))
6782 inven_damage(set_elec_destroy, 2);
6783 inven_damage(set_fire_destroy, 2);
6785 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6789 /* Shards -- mostly cutting */
6793 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6795 if (fuzzy) msg_print("You are hit by something sharp!");
6798 if (p_ptr->resist_shard)
6800 dam *= 6; dam /= (randint1(4) + 7);
6804 (void)set_cut(p_ptr->cut + dam);
6807 if (!p_ptr->resist_shard || one_in_(13))
6809 inven_damage(set_cold_destroy, 2);
6812 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6816 /* Sound -- mostly stunning */
6820 if (fuzzy) msg_print("¹ì²»¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6822 if (fuzzy) msg_print("You are hit by a loud noise!");
6825 if (p_ptr->resist_sound)
6827 dam *= 5; dam /= (randint1(4) + 7);
6831 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
6832 (void)set_stun(p_ptr->stun + k);
6835 if (!p_ptr->resist_sound || one_in_(13))
6837 inven_damage(set_cold_destroy, 2);
6840 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6844 /* Pure confusion */
6848 if (fuzzy) msg_print("²¿¤«º®Í𤹤ë¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6850 if (fuzzy) msg_print("You are hit by something puzzling!");
6853 if (p_ptr->resist_conf)
6855 dam *= 5; dam /= (randint1(4) + 7);
6857 if (!p_ptr->resist_conf)
6859 (void)set_confused(p_ptr->confused + randint1(20) + 10);
6861 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6865 /* Disenchantment -- see above */
6869 if (fuzzy) msg_print("²¿¤«¤µ¤¨¤Ê¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6871 if (fuzzy) msg_print("You are hit by something static!");
6874 if (p_ptr->resist_disen)
6876 dam *= 6; dam /= (randint1(4) + 7);
6880 (void)apply_disenchant(0);
6882 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6886 /* Nexus -- see above */
6890 if (fuzzy) msg_print("²¿¤«´ñ̯¤Ê¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6892 if (fuzzy) msg_print("You are hit by something strange!");
6895 if (p_ptr->resist_nexus)
6897 dam *= 6; dam /= (randint1(4) + 7);
6903 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6907 /* Force -- mostly stun */
6911 if (fuzzy) msg_print("±¿Æ°¥¨¥Í¥ë¥®¡¼¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6913 if (fuzzy) msg_print("You are hit by kinetic force!");
6916 if (!p_ptr->resist_sound)
6918 (void)set_stun(p_ptr->stun + randint1(20));
6920 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6925 /* Rocket -- stun, cut */
6929 if (fuzzy) msg_print("Çúȯ¤¬¤¢¤Ã¤¿¡ª");
6931 if (fuzzy) msg_print("There is an explosion!");
6934 if (!p_ptr->resist_sound)
6936 (void)set_stun(p_ptr->stun + randint1(20));
6938 if (p_ptr->resist_shard)
6944 (void)set_cut(p_ptr-> cut + ( dam / 2));
6947 if ((!p_ptr->resist_shard) || one_in_(12))
6949 inven_damage(set_cold_destroy, 3);
6952 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6956 /* Inertia -- slowness */
6960 if (fuzzy) msg_print("²¿¤«ÃÙ¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6962 if (fuzzy) msg_print("You are hit by something slow!");
6965 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
6966 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6970 /* Lite -- blinding */
6974 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6976 if (fuzzy) msg_print("You are hit by something!");
6979 if (p_ptr->resist_lite)
6981 dam *= 4; dam /= (randint1(4) + 7);
6983 else if (!blind && !p_ptr->resist_blind)
6985 (void)set_blind(p_ptr->blind + randint1(5) + 2);
6987 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
6990 msg_print("¸÷¤ÇÆùÂΤ¬¾Ç¤¬¤µ¤ì¤¿¡ª");
6992 msg_print("The light scorches your flesh!");
6997 else if (prace_is_(RACE_S_FAIRY))
7001 if (p_ptr->wraith_form) dam *= 2;
7002 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7004 if (p_ptr->wraith_form)
7006 p_ptr->wraith_form = 0;
7008 msg_print("Á®¸÷¤Î¤¿¤áÈóʪ¼ÁŪ¤Ê±Æ¤Î¸ºß¤Ç¤¤¤é¤ì¤Ê¤¯¤Ê¤Ã¤¿¡£");
7010 msg_print("The light forces you out of your incorporeal shadow form.");
7013 p_ptr->redraw |= PR_MAP;
7014 /* Update monsters */
7015 p_ptr->update |= (PU_MONSTERS);
7017 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
7019 /* Redraw status bar */
7020 p_ptr->redraw |= (PR_STATUS);
7027 /* Dark -- blinding */
7031 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7033 if (fuzzy) msg_print("You are hit by something!");
7036 if (p_ptr->resist_dark)
7038 dam *= 4; dam /= (randint1(4) + 7);
7040 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form) dam = 0;
7042 else if (!blind && !p_ptr->resist_blind)
7044 (void)set_blind(p_ptr->blind + randint1(5) + 2);
7046 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7050 /* Time -- bolt fewer effects XXX */
7054 if (fuzzy) msg_print("²áµî¤«¤é¤Î¾×·â¤Ë¹¶·â¤µ¤ì¤¿¡ª");
7056 if (fuzzy) msg_print("You are hit by a blast from the past!");
7059 if (p_ptr->resist_time)
7062 dam /= (randint1(4) + 7);
7064 msg_print("»þ´Ö¤¬Ä̤ê²á¤®¤Æ¤¤¤¯µ¤¤¬¤¹¤ë¡£");
7066 msg_print("You feel as if time is passing you by.");
7072 switch (randint1(10))
7074 case 1: case 2: case 3: case 4: case 5:
7076 if (p_ptr->prace == RACE_ANDROID) break;
7078 msg_print("¿ÍÀ¸¤¬µÕÌá¤ê¤·¤¿µ¤¤¬¤¹¤ë¡£");
7080 msg_print("You feel life has clocked back.");
7083 lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
7087 case 6: case 7: case 8: case 9:
7089 switch (randint1(6))
7092 case 1: k = A_STR; act = "¶¯¤¯"; break;
7093 case 2: k = A_INT; act = "ÁïÌÀ¤Ç"; break;
7094 case 3: k = A_WIS; act = "¸ÌÀ¤Ç"; break;
7095 case 4: k = A_DEX; act = "´ïÍѤÇ"; break;
7096 case 5: k = A_CON; act = "·ò¹¯¤Ç"; break;
7097 case 6: k = A_CHR; act = "Èþ¤·¤¯"; break;
7099 case 1: k = A_STR; act = "strong"; break;
7100 case 2: k = A_INT; act = "bright"; break;
7101 case 3: k = A_WIS; act = "wise"; break;
7102 case 4: k = A_DEX; act = "agile"; break;
7103 case 5: k = A_CON; act = "hale"; break;
7104 case 6: k = A_CHR; act = "beautiful"; break;
7110 msg_format("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤É%s¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£", act);
7112 msg_format("You're not as %s as you used to be...", act);
7116 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 3) / 4;
7117 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
7118 p_ptr->update |= (PU_BONUS);
7125 msg_print("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤ÉÎ϶¯¤¯¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£");
7127 msg_print("You're not as powerful as you used to be...");
7131 for (k = 0; k < 6; k++)
7133 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 7) / 8;
7134 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
7136 p_ptr->update |= (PU_BONUS);
7142 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7146 /* Gravity -- stun plus slowness plus teleport */
7150 if (fuzzy) msg_print("²¿¤«½Å¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7151 msg_print("¼þÊդνÅÎϤ¬¤æ¤¬¤ó¤À¡£");
7153 if (fuzzy) msg_print("You are hit by something heavy!");
7154 msg_print("Gravity warps around you.");
7157 teleport_player(5, TRUE);
7158 if (!p_ptr->levitation)
7159 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7160 if (!(p_ptr->resist_sound || p_ptr->levitation))
7162 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
7163 (void)set_stun(p_ptr->stun + k);
7165 if (p_ptr->levitation)
7167 dam = (dam * 2) / 3;
7170 if (!p_ptr->levitation || one_in_(13))
7172 inven_damage(set_cold_destroy, 2);
7175 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7179 /* Standard damage */
7180 case GF_DISINTEGRATE:
7183 if (fuzzy) msg_print("½ã¿è¤Ê¥¨¥Í¥ë¥®¡¼¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7185 if (fuzzy) msg_print("You are hit by pure energy!");
7188 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7195 if (fuzzy) msg_print("²¿¤é¤«¤Î¹¶·â¤Ë¤è¤Ã¤Æµ¤Ê¬¤¬¤è¤¯¤Ê¤Ã¤¿¡£");
7197 if (fuzzy) msg_print("You are hit by something invigorating!");
7200 (void)hp_player(dam);
7208 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7210 if (fuzzy) msg_print("You are hit by something!");
7213 (void)set_fast(p_ptr->fast + randint1(5), FALSE);
7221 if (fuzzy) msg_print("²¿¤«ÃÙ¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7223 if (fuzzy) msg_print("You are hit by something slow!");
7226 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7232 if (p_ptr->free_act) break;
7234 if (fuzzy) msg_print("̲¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
7236 if (fuzzy) msg_print("You fall asleep!");
7240 if (ironman_nightmare)
7243 msg_print("¶²¤í¤·¤¤¸÷·Ê¤¬Æ¬¤ËÉ⤫¤ó¤Ç¤¤¿¡£");
7245 msg_print("A horrible vision enters your mind.");
7249 /* Pick a nightmare */
7250 get_mon_num_prep(get_nightmare, NULL);
7252 /* Have some nightmares */
7253 have_nightmare(get_mon_num(MAX_DEPTH));
7255 /* Remove the monster restriction */
7256 get_mon_num_prep(NULL, NULL);
7259 set_paralyzed(p_ptr->paralyzed + dam);
7270 if (fuzzy) msg_print("ËâË¡¤Î¥ª¡¼¥é¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7272 if (fuzzy) msg_print("You are hit by an aura of magic!");
7275 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7283 if (fuzzy) msg_print("¥¨¥Í¥ë¥®¡¼¤Î²ô¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7285 if (fuzzy) msg_print("You are hit by an energy!");
7288 get_damage = take_hit(DAMAGE_FORCE, dam, killer, monspell);
7296 if (fuzzy) msg_print("²¿¤«¤¬¶õ¤«¤é¤¢¤Ê¤¿¤ÎƬ¾å¤ËÍî¤Á¤Æ¤¤¿¡ª");
7298 if (fuzzy) msg_print("Something falls from the sky on you!");
7301 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7302 if (!p_ptr->resist_shard || one_in_(13))
7304 if (!p_ptr->immune_fire) inven_damage(set_fire_destroy, 2);
7305 inven_damage(set_cold_destroy, 2);
7311 /* Ice -- cold plus stun plus cuts */
7315 if (fuzzy) msg_print("²¿¤«±Ô¤¯Î䤿¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7317 if (fuzzy) msg_print("You are hit by something sharp and cold!");
7320 cold_dam(dam, killer, monspell);
7321 if (!p_ptr->resist_shard)
7323 (void)set_cut(p_ptr->cut + damroll(5, 8));
7325 if (!p_ptr->resist_sound)
7327 (void)set_stun(p_ptr->stun + randint1(15));
7330 if ((!(p_ptr->resist_cold || IS_OPPOSE_COLD())) || one_in_(12))
7332 if (!p_ptr->immune_cold) inven_damage(set_cold_destroy, 3);
7342 if (fuzzy) msg_print("²¿¤«Èó¾ï¤ËÎ䤿¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7344 if (fuzzy) msg_print("You are hit by something extremely cold!");
7348 if (p_ptr->mimic_form)
7350 if (!(mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
7351 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7356 switch (p_ptr->prace)
7358 /* Some races are immune */
7372 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7388 if (who > 0) msg_format("%^s¤ËÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¼è¤é¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
7389 else msg_print("Àº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¼è¤é¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª");
7391 if (who > 0) msg_format("%^s draws psychic energy from you!", m_name);
7392 else msg_print("Your psychic energy is drawn!");
7396 if (dam >= p_ptr->csp)
7400 p_ptr->csp_frac = 0;
7409 learn_spell(monspell);
7412 p_ptr->redraw |= (PR_MANA);
7415 p_ptr->window |= (PW_PLAYER);
7416 p_ptr->window |= (PW_SPELL);
7420 /* Heal the monster */
7421 if (m_ptr->hp < m_ptr->maxhp)
7424 m_ptr->hp += (6 * dam);
7425 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
7427 /* Redraw (later) if needed */
7428 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
7429 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
7431 /* Special message */
7435 msg_format("%^s¤Ïµ¤Ê¬¤¬Îɤµ¤½¤¦¤À¡£", m_name);
7437 msg_format("%^s appears healthier.", m_name);
7451 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
7454 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7456 msg_print("You resist the effects!");
7458 learn_spell(monspell);
7463 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
7465 msg_print("Your mind is blasted by psyonic energy.");
7468 if (!p_ptr->resist_conf)
7470 (void)set_confused(p_ptr->confused + randint0(4) + 4);
7473 if (!p_ptr->resist_chaos && one_in_(3))
7475 (void)set_image(p_ptr->image + randint0(250) + 150);
7482 p_ptr->csp_frac = 0;
7484 p_ptr->redraw |= PR_MANA;
7486 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7492 case GF_BRAIN_SMASH:
7494 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
7497 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7499 msg_print("You resist the effects!");
7501 learn_spell(monspell);
7506 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
7508 msg_print("Your mind is blasted by psionic energy.");
7515 p_ptr->csp_frac = 0;
7517 p_ptr->redraw |= PR_MANA;
7519 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7520 if (!p_ptr->resist_blind)
7522 (void)set_blind(p_ptr->blind + 8 + randint0(8));
7524 if (!p_ptr->resist_conf)
7526 (void)set_confused(p_ptr->confused + randint0(4) + 4);
7528 if (!p_ptr->free_act)
7530 (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
7532 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7534 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
7535 (void)do_dec_stat(A_INT);
7536 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
7537 (void)do_dec_stat(A_WIS);
7539 if (!p_ptr->resist_chaos)
7541 (void)set_image(p_ptr->image + randint0(250) + 150);
7550 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7553 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7555 msg_print("You resist the effects!");
7557 learn_spell(monspell);
7561 curse_equipment(15, 0);
7562 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7570 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7573 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7575 msg_print("You resist the effects!");
7577 learn_spell(monspell);
7581 curse_equipment(25, MIN(rlev/2-15, 5));
7582 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7590 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7593 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7595 msg_print("You resist the effects!");
7597 learn_spell(monspell);
7601 curse_equipment(33, MIN(rlev/2-15, 15));
7602 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7610 if ((randint0(100 + rlev/2) < p_ptr->skill_sav) && !(m_ptr->r_idx == MON_KENSHIROU))
7613 msg_print("¤·¤«¤·È빦¤òÄ·¤ÍÊÖ¤·¤¿¡ª");
7615 msg_print("You resist the effects!");
7617 learn_spell(monspell);
7621 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7622 (void)set_cut(p_ptr->cut + damroll(10, 10));
7630 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7633 msg_format("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7635 msg_format("You resist the effects!");
7637 learn_spell(monspell);
7642 msg_print("¤¢¤Ê¤¿¤ÏÌ¿¤¬Çö¤Þ¤Ã¤Æ¤¤¤¯¤è¤¦¤Ë´¶¤¸¤¿¡ª");
7644 msg_print("You feel your life fade away!");
7647 get_damage = take_hit(DAMAGE_ATTACK, dam, m_name, monspell);
7648 curse_equipment(40, 20);
7650 if (p_ptr->chp < 1) p_ptr->chp = 1;
7665 if (p_ptr->tim_eyeeye && get_damage > 0 && !p_ptr->is_dead)
7668 msg_format("¹¶·â¤¬%s¼«¿È¤ò½ý¤Ä¤±¤¿¡ª", m_name);
7670 char m_name_self[80];
7673 monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
7675 msg_format("The attack of %s has wounded %s!", m_name, m_name_self);
7677 project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
7678 set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
7681 if (p_ptr->riding && dam > 0)
7683 rakubadam_p = (dam > 200) ? 200 : dam;
7691 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && who && (who != p_ptr->riding))
7697 /* Return "Anything seen?" */
7703 * Find the distance from (x, y) to a line.
7705 int dist_to_line(int y, int x, int y1, int x1, int y2, int x2)
7707 /* Vector from (x, y) to (x1, y1) */
7716 int pd = distance(y1, x1, y, x);
7717 int nd = distance(y1, x1, y2, x2);
7719 if (pd > nd) return distance(y, x, y2, x2);
7721 /* Component of P on N */
7722 nd = ((nd) ? ((py * ny + px * nx) / nd) : 0);
7724 /* Absolute value */
7725 return((nd >= 0) ? nd : 0 - nd);
7732 * Modified version of los() for calculation of disintegration balls.
7733 * Disintegration effects are stopped by permanent walls.
7735 bool in_disintegration_range(int y1, int x1, int y2, int x2)
7755 /* Slope, or 1/Slope, of LOS */
7759 /* Extract the offset */
7763 /* Extract the absolute offset */
7768 /* Handle adjacent (or identical) grids */
7769 if ((ax < 2) && (ay < 2)) return (TRUE);
7772 /* Paranoia -- require "safe" origin */
7773 /* if (!in_bounds(y1, x1)) return (FALSE); */
7776 /* Directly South/North */
7779 /* South -- check for walls */
7782 for (ty = y1 + 1; ty < y2; ty++)
7784 if (cave_stop_disintegration(ty, x1)) return (FALSE);
7788 /* North -- check for walls */
7791 for (ty = y1 - 1; ty > y2; ty--)
7793 if (cave_stop_disintegration(ty, x1)) return (FALSE);
7801 /* Directly East/West */
7804 /* East -- check for walls */
7807 for (tx = x1 + 1; tx < x2; tx++)
7809 if (cave_stop_disintegration(y1, tx)) return (FALSE);
7813 /* West -- check for walls */
7816 for (tx = x1 - 1; tx > x2; tx--)
7818 if (cave_stop_disintegration(y1, tx)) return (FALSE);
7827 /* Extract some signs */
7828 sx = (dx < 0) ? -1 : 1;
7829 sy = (dy < 0) ? -1 : 1;
7832 /* Vertical "knights" */
7837 if (!cave_stop_disintegration(y1 + sy, x1)) return (TRUE);
7841 /* Horizontal "knights" */
7846 if (!cave_stop_disintegration(y1, x1 + sx)) return (TRUE);
7851 /* Calculate scale factor div 2 */
7854 /* Calculate scale factor */
7858 /* Travel horizontally */
7861 /* Let m = dy / dx * 2 * (dy * dx) = 2 * dy * dy */
7867 /* Consider the special case where slope == 1. */
7878 /* Note (below) the case (qy == f2), where */
7879 /* the LOS exactly meets the corner of a tile. */
7882 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7893 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7906 /* Travel vertically */
7909 /* Let m = dx / dy * 2 * (dx * dy) = 2 * dx * dx */
7925 /* Note (below) the case (qx == f2), where */
7926 /* the LOS exactly meets the corner of a tile. */
7929 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7940 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7961 void breath_shape(u16b *path_g, int dist, int *pgrids, byte *gx, byte *gy, byte *gm, int *pgm_rad, int rad, int y1, int x1, int y2, int x2, int typ)
7966 int brev = rad * rad / dist;
7970 int mdis = distance(y1, x1, y2, x2) + rad;
7972 while (bdis <= mdis)
7976 if ((0 < dist) && (path_n < dist))
7978 int ny = GRID_Y(path_g[path_n]);
7979 int nx = GRID_X(path_g[path_n]);
7980 int nd = distance(ny, nx, y1, x1);
7982 /* Get next base point */
7991 /* Travel from center outward */
7992 for (cdis = 0; cdis <= brad; cdis++)
7994 /* Scan the maximal blast area of radius "cdis" */
7995 for (y = by - cdis; y <= by + cdis; y++)
7997 for (x = bx - cdis; x <= bx + cdis; x++)
7999 /* Ignore "illegal" locations */
8000 if (!in_bounds(y, x)) continue;
8002 /* Enforce a circular "ripple" */
8003 if (distance(y1, x1, y, x) != bdis) continue;
8005 /* Enforce an arc */
8006 if (distance(by, bx, y, x) != cdis) continue;
8012 /* Lights are stopped by opaque terrains */
8013 if (!los(by, bx, y, x)) continue;
8015 case GF_DISINTEGRATE:
8016 /* Disintegration are stopped only by perma-walls */
8017 if (!in_disintegration_range(by, bx, y, x)) continue;
8020 /* Ball explosions are stopped by walls */
8021 if (!projectable(by, bx, y, x)) continue;
8025 /* Save this grid */
8033 /* Encode some more "radius" info */
8034 gm[bdis + 1] = *pgrids;
8036 /* Increase the size */
8037 brad = rad * (path_n + brev) / (dist + brev);
8039 /* Find the next ripple */
8043 /* Store the effect size */
8049 * Generic "beam"/"bolt"/"ball" projection routine.
8052 * who: Index of "source" monster (zero for "player")
8053 * rad: Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
8054 * y,x: Target location (or location to travel "towards")
8055 * dam: Base damage roll to apply to affected monsters (or player)
8056 * typ: Type of damage to apply to monsters (and objects)
8057 * flg: Extra bit flags (see PROJECT_xxxx in "defines.h")
8060 * TRUE if any "effects" of the projection were observed, else FALSE
8062 * Allows a monster (or player) to project a beam/bolt/ball of a given kind
8063 * towards a given location (optionally passing over the heads of interposing
8064 * monsters), and have it do a given amount of damage to the monsters (and
8065 * optionally objects) within the given radius of the final location.
8067 * A "bolt" travels from source to target and affects only the target grid.
8068 * A "beam" travels from source to target, affecting all grids passed through.
8069 * A "ball" travels from source to the target, exploding at the target, and
8070 * affecting everything within the given radius of the target location.
8072 * Traditionally, a "bolt" does not affect anything on the ground, and does
8073 * not pass over the heads of interposing monsters, much like a traditional
8074 * missile, and will "stop" abruptly at the "target" even if no monster is
8075 * positioned there, while a "ball", on the other hand, passes over the heads
8076 * of monsters between the source and target, and affects everything except
8077 * the source monster which lies within the final radius, while a "beam"
8078 * affects every monster between the source and target, except for the casting
8079 * monster (or player), and rarely affects things on the ground.
8081 * Two special flags allow us to use this function in special ways, the
8082 * "PROJECT_HIDE" flag allows us to perform "invisible" projections, while
8083 * the "PROJECT_JUMP" flag allows us to affect a specific grid, without
8084 * actually projecting from the source monster (or player).
8086 * The player will only get "experience" for monsters killed by himself
8087 * Unique monsters can only be destroyed by attacks from the player
8089 * Only 256 grids can be affected per projection, limiting the effective
8090 * "radius" of standard ball attacks to nine units (diameter nineteen).
8092 * One can project in a given "direction" by combining PROJECT_THRU with small
8093 * offsets to the initial location (see "line_spell()"), or by calculating
8094 * "virtual targets" far away from the player.
8096 * One can also use PROJECT_THRU to send a beam/bolt along an angled path,
8097 * continuing until it actually hits somethings (useful for "stone to mud").
8099 * Bolts and Beams explode INSIDE walls, so that they can destroy doors.
8101 * Balls must explode BEFORE hitting walls, or they would affect monsters
8102 * on both sides of a wall. Some bug reports indicate that this is still
8103 * happening in 2.7.8 for Windows, though it appears to be impossible.
8105 * We "pre-calculate" the blast area only in part for efficiency.
8106 * More importantly, this lets us do "explosions" from the "inside" out.
8107 * This results in a more logical distribution of "blast" treasure.
8108 * It also produces a better (in my opinion) animation of the explosion.
8109 * It could be (but is not) used to have the treasure dropped by monsters
8110 * in the middle of the explosion fall "outwards", and then be damaged by
8111 * the blast as it spreads outwards towards the treasure drop location.
8113 * Walls and doors are included in the blast area, so that they can be
8114 * "burned" or "melted" in later versions.
8116 * This algorithm is intended to maximize simplicity, not necessarily
8117 * efficiency, since this function is not a bottleneck in the code.
8119 * We apply the blast effect from ground zero outwards, in several passes,
8120 * first affecting features, then objects, then monsters, then the player.
8121 * This allows walls to be removed before checking the object or monster
8122 * in the wall, and protects objects which are dropped by monsters killed
8123 * in the blast, and allows the player to see all affects before he is
8124 * killed or teleported away. The semantics of this method are open to
8125 * various interpretations, but they seem to work well in practice.
8127 * We process the blast area from ground-zero outwards to allow for better
8128 * distribution of treasure dropped by monsters, and because it provides a
8129 * pleasing visual effect at low cost.
8131 * Note that the damage done by "ball" explosions decreases with distance.
8132 * This decrease is rapid, grids at radius "dist" take "1/dist" damage.
8134 * Notice the "napalm" effect of "beam" weapons. First they "project" to
8135 * the target, and then the damage "flows" along this beam of destruction.
8136 * The damage at every grid is the same as at the "center" of a "ball"
8137 * explosion, since the "beam" grids are treated as if they ARE at the
8138 * center of a "ball" explosion.
8140 * Currently, specifying "beam" plus "ball" means that locations which are
8141 * covered by the initial "beam", and also covered by the final "ball", except
8142 * for the final grid (the epicenter of the ball), will be "hit twice", once
8143 * by the initial beam, and once by the exploding ball. For the grid right
8144 * next to the epicenter, this results in 150% damage being done. The center
8145 * does not have this problem, for the same reason the final grid in a "beam"
8146 * plus "bolt" does not -- it is explicitly removed. Simply removing "beam"
8147 * grids which are covered by the "ball" will NOT work, as then they will
8148 * receive LESS damage than they should. Do not combine "beam" with "ball".
8150 * The array "gy[],gx[]" with current size "grids" is used to hold the
8151 * collected locations of all grids in the "blast area" plus "beam path".
8153 * Note the rather complex usage of the "gm[]" array. First, gm[0] is always
8154 * zero. Second, for N>1, gm[N] is always the index (in gy[],gx[]) of the
8155 * first blast grid (see above) with radius "N" from the blast center. Note
8156 * that only the first gm[1] grids in the blast area thus take full damage.
8157 * Also, note that gm[rad+1] is always equal to "grids", which is the total
8158 * number of blast grids.
8160 * Note that once the projection is complete, (y2,x2) holds the final location
8161 * of bolts/beams, and the "epicenter" of balls.
8163 * Note also that "rad" specifies the "inclusive" radius of projection blast,
8164 * so that a "rad" of "one" actually covers 5 or 9 grids, depending on the
8165 * implementation of the "distance" function. Also, a bolt can be properly
8166 * viewed as a "ball" with a "rad" of "zero".
8168 * Note that if no "target" is reached before the beam/bolt/ball travels the
8169 * maximum distance allowed (MAX_RANGE), no "blast" will be induced. This
8170 * may be relevant even for bolts, since they have a "1x1" mini-blast.
8172 * Note that for consistency, we "pretend" that the bolt actually takes "time"
8173 * to move from point A to point B, even if the player cannot see part of the
8174 * projection path. Note that in general, the player will *always* see part
8175 * of the path, since it either starts at the player or ends on the player.
8177 * Hack -- we assume that every "projection" is "self-illuminating".
8179 * Hack -- when only a single monster is affected, we automatically track
8180 * (and recall) that monster, unless "PROJECT_JUMP" is used.
8182 * Note that all projections now "explode" at their final destination, even
8183 * if they were being projected at a more distant destination. This means
8184 * that "ball" spells will *always* explode.
8186 * Note that we must call "handle_stuff()" after affecting terrain features
8187 * in the blast radius, in case the "illumination" of the grid was changed,
8188 * and "update_view()" and "update_monsters()" need to be called.
8190 bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int monspell)
8200 int y_saver, x_saver; /* For reflecting monsters */
8202 int msec = delay_factor * delay_factor * delay_factor;
8204 /* Assume the player sees nothing */
8205 bool notice = FALSE;
8207 /* Assume the player has seen nothing */
8208 bool visual = FALSE;
8210 /* Assume the player has seen no blast grids */
8213 /* Assume to be a normal ball spell */
8214 bool breath = FALSE;
8216 /* Is the player blind? */
8217 bool blind = (p_ptr->blind ? TRUE : FALSE);
8219 bool old_hide = FALSE;
8221 /* Number of grids in the "path" */
8224 /* Actual grids in the "path" */
8227 /* Number of grids in the "blast area" (including the "beam" path) */
8230 /* Coordinates of the affected grids */
8231 byte gx[1024], gy[1024];
8233 /* Encoded "radius" info (see above) */
8236 /* Actual radius encoded in gm[] */
8241 /* Attacker's name (prepared before polymorph)*/
8244 /* Initialize by null string */
8250 /* Default target of monsterspell is player */
8251 monster_target_y=py;
8252 monster_target_x=px;
8254 /* Hack -- Jump to target */
8255 if (flg & (PROJECT_JUMP))
8260 /* Clear the flag */
8261 flg &= ~(PROJECT_JUMP);
8266 /* Start at player */
8273 /* Start at monster */
8276 x1 = m_list[who].fx;
8277 y1 = m_list[who].fy;
8278 monster_desc(who_name, &m_list[who], MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
8291 /* Default "destination" */
8296 /* Hack -- verify stuff */
8297 if (flg & (PROJECT_THRU))
8299 if ((x1 == x2) && (y1 == y2))
8301 flg &= ~(PROJECT_THRU);
8305 /* Handle a breath attack */
8310 if (flg & PROJECT_HIDE) old_hide = TRUE;
8311 flg |= PROJECT_HIDE;
8315 /* Hack -- Assume there will be no blast (max radius 32) */
8316 for (dist = 0; dist < 32; dist++) gm[dist] = 0;
8324 /* Collect beam grids */
8325 if (flg & (PROJECT_BEAM))
8336 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_LOS);
8338 case GF_DISINTEGRATE:
8339 flg |= (PROJECT_GRID);
8340 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_DISI);
8344 /* Calculate the projection path */
8346 path_n = project_path(path_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, flg);
8348 /* Hack -- Handle stuff */
8351 /* Giga-Hack SEEKER & SUPER_RAY */
8353 if( typ == GF_SEEKER )
8363 for (i = 0; i < path_n; ++i)
8368 int ny = GRID_Y(path_g[i]);
8369 int nx = GRID_X(path_g[i]);
8380 /* Only do visuals if requested */
8381 if (!blind && !(flg & (PROJECT_HIDE)))
8383 /* Only do visuals if the player can "see" the bolt */
8384 if (panel_contains(y, x) && player_has_los_bold(y, x))
8391 /* Obtain the bolt pict */
8392 p = bolt_pict(oy, ox, y, x, typ);
8394 /* Extract attr/char */
8398 /* Visual effects */
8399 print_rel(c, a, y, x);
8400 move_cursor_relative(y, x);
8401 /*if (fresh_before)*/ Term_fresh();
8402 Term_xtra(TERM_XTRA_DELAY, msec);
8404 /*if (fresh_before)*/ Term_fresh();
8406 /* Display "beam" grids */
8407 if (flg & (PROJECT_BEAM))
8409 /* Obtain the explosion pict */
8410 p = bolt_pict(y, x, y, x, typ);
8412 /* Extract attr/char */
8416 /* Visual effects */
8417 print_rel(c, a, y, x);
8420 /* Hack -- Activate delay */
8424 /* Hack -- delay anyway for consistency */
8427 /* Delay for consistency */
8428 Term_xtra(TERM_XTRA_DELAY, msec);
8431 if(project_o(0,0,y,x,dam,GF_SEEKER))notice=TRUE;
8432 if( is_mirror_grid(&cave[y][x]))
8434 /* The target of monsterspell becomes tha mirror(broken) */
8435 monster_target_y=(s16b)y;
8436 monster_target_x=(s16b)x;
8439 next_mirror( &oy,&ox,y,x );
8441 path_n = i+project_path(&(path_g[i+1]), (project_length ? project_length : MAX_RANGE), y, x, oy, ox, flg);
8442 for( j = last_i; j <=i ; j++ )
8444 y = GRID_Y(path_g[j]);
8445 x = GRID_X(path_g[j]);
8446 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))notice=TRUE;
8447 if(!who && (project_m_n==1) && !jump ){
8448 if(cave[project_m_y][project_m_x].m_idx >0 ){
8449 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8451 /* Hack -- auto-recall */
8452 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8454 /* Hack - auto-track */
8455 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8458 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8463 for( i = last_i ; i < path_n ; i++ )
8466 y = GRID_Y(path_g[i]);
8467 x = GRID_X(path_g[i]);
8468 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))
8470 if(!who && (project_m_n==1) && !jump ){
8471 if(cave[project_m_y][project_m_x].m_idx >0 ){
8472 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8474 /* Hack -- auto-recall */
8475 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8477 /* Hack - auto-track */
8478 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8481 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8485 else if(typ == GF_SUPER_RAY){
8487 int second_step = 0;
8494 for (i = 0; i < path_n; ++i)
8499 int ny = GRID_Y(path_g[i]);
8500 int nx = GRID_X(path_g[i]);
8511 /* Only do visuals if requested */
8512 if (!blind && !(flg & (PROJECT_HIDE)))
8514 /* Only do visuals if the player can "see" the bolt */
8515 if (panel_contains(y, x) && player_has_los_bold(y, x))
8522 /* Obtain the bolt pict */
8523 p = bolt_pict(oy, ox, y, x, typ);
8525 /* Extract attr/char */
8529 /* Visual effects */
8530 print_rel(c, a, y, x);
8531 move_cursor_relative(y, x);
8532 /*if (fresh_before)*/ Term_fresh();
8533 Term_xtra(TERM_XTRA_DELAY, msec);
8535 /*if (fresh_before)*/ Term_fresh();
8537 /* Display "beam" grids */
8538 if (flg & (PROJECT_BEAM))
8540 /* Obtain the explosion pict */
8541 p = bolt_pict(y, x, y, x, typ);
8543 /* Extract attr/char */
8547 /* Visual effects */
8548 print_rel(c, a, y, x);
8551 /* Hack -- Activate delay */
8555 /* Hack -- delay anyway for consistency */
8558 /* Delay for consistency */
8559 Term_xtra(TERM_XTRA_DELAY, msec);
8562 if(project_o(0,0,y,x,dam,GF_SUPER_RAY) )notice=TRUE;
8563 if (!cave_have_flag_bold(y, x, FF_PROJECT))
8565 if( second_step )continue;
8568 if( is_mirror_grid(&cave[y][x]) && !second_step )
8570 /* The target of monsterspell becomes tha mirror(broken) */
8571 monster_target_y=(s16b)y;
8572 monster_target_x=(s16b)x;
8575 for( j = 0; j <=i ; j++ )
8577 y = GRID_Y(path_g[j]);
8578 x = GRID_X(path_g[j]);
8579 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8583 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x-1, flg);
8584 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x , flg);
8585 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x+1, flg);
8586 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x-1, flg);
8587 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x+1, flg);
8588 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x-1, flg);
8589 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x , flg);
8590 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x+1, flg);
8593 for( i = 0; i < path_n ; i++ )
8596 y = GRID_Y(path_g[i]);
8597 x = GRID_X(path_g[i]);
8598 (void)project_m(0,0,y,x,dam,GF_SUPER_RAY,flg);
8599 if(!who && (project_m_n==1) && !jump ){
8600 if(cave[project_m_y][project_m_x].m_idx >0 ){
8601 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8603 /* Hack -- auto-recall */
8604 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8606 /* Hack - auto-track */
8607 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8610 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8615 /* Project along the path */
8616 for (i = 0; i < path_n; ++i)
8621 int ny = GRID_Y(path_g[i]);
8622 int nx = GRID_X(path_g[i]);
8624 if (flg & PROJECT_DISI)
8626 /* Hack -- Balls explode before reaching walls */
8627 if (cave_stop_disintegration(ny, nx) && (rad > 0)) break;
8629 else if (flg & PROJECT_LOS)
8631 /* Hack -- Balls explode before reaching walls */
8632 if (!cave_los_bold(ny, nx) && (rad > 0)) break;
8636 /* Hack -- Balls explode before reaching walls */
8637 if (!cave_have_flag_bold(ny, nx, FF_PROJECT) && (rad > 0)) break;
8644 /* Collect beam grids */
8645 if (flg & (PROJECT_BEAM))
8652 /* Only do visuals if requested */
8653 if (!blind && !(flg & (PROJECT_HIDE | PROJECT_FAST)))
8655 /* Only do visuals if the player can "see" the bolt */
8656 if (panel_contains(y, x) && player_has_los_bold(y, x))
8663 /* Obtain the bolt pict */
8664 p = bolt_pict(oy, ox, y, x, typ);
8666 /* Extract attr/char */
8670 /* Visual effects */
8671 print_rel(c, a, y, x);
8672 move_cursor_relative(y, x);
8673 /*if (fresh_before)*/ Term_fresh();
8674 Term_xtra(TERM_XTRA_DELAY, msec);
8676 /*if (fresh_before)*/ Term_fresh();
8678 /* Display "beam" grids */
8679 if (flg & (PROJECT_BEAM))
8681 /* Obtain the explosion pict */
8682 p = bolt_pict(y, x, y, x, typ);
8684 /* Extract attr/char */
8688 /* Visual effects */
8689 print_rel(c, a, y, x);
8692 /* Hack -- Activate delay */
8696 /* Hack -- delay anyway for consistency */
8699 /* Delay for consistency */
8700 Term_xtra(TERM_XTRA_DELAY, msec);
8707 /* Save the "blast epicenter" */
8711 if (breath && !path_n)
8717 flg &= ~(PROJECT_HIDE);
8721 /* Start the "explosion" */
8724 /* Hack -- make sure beams get to "explode" */
8732 /* If we found a "target", explode there */
8733 if (dist <= MAX_RANGE)
8735 /* Mega-Hack -- remove the final "beam" grid */
8736 if ((flg & (PROJECT_BEAM)) && (grids > 0)) grids--;
8739 * Create a conical breath attack
8750 flg &= ~(PROJECT_HIDE);
8752 breath_shape(path_g, dist, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, by, bx, typ);
8756 /* Determine the blast area, work from the inside out */
8757 for (dist = 0; dist <= rad; dist++)
8759 /* Scan the maximal blast area of radius "dist" */
8760 for (y = by - dist; y <= by + dist; y++)
8762 for (x = bx - dist; x <= bx + dist; x++)
8764 /* Ignore "illegal" locations */
8765 if (!in_bounds2(y, x)) continue;
8767 /* Enforce a "circular" explosion */
8768 if (distance(by, bx, y, x) != dist) continue;
8774 /* Lights are stopped by opaque terrains */
8775 if (!los(by, bx, y, x)) continue;
8777 case GF_DISINTEGRATE:
8778 /* Disintegration are stopped only by perma-walls */
8779 if (!in_disintegration_range(by, bx, y, x)) continue;
8782 /* Ball explosions are stopped by walls */
8783 if (!projectable(by, bx, y, x)) continue;
8787 /* Save this grid */
8794 /* Encode some more "radius" info */
8800 /* Speed -- ignore "non-explosions" */
8801 if (!grids) return (FALSE);
8804 /* Display the "blast area" if requested */
8805 if (!blind && !(flg & (PROJECT_HIDE)))
8807 /* Then do the "blast", from inside out */
8808 for (t = 0; t <= gm_rad; t++)
8810 /* Dump everything with this radius */
8811 for (i = gm[t]; i < gm[t+1]; i++)
8813 /* Extract the location */
8817 /* Only do visuals if the player can "see" the blast */
8818 if (panel_contains(y, x) && player_has_los_bold(y, x))
8827 /* Obtain the explosion pict */
8828 p = bolt_pict(y, x, y, x, typ);
8830 /* Extract attr/char */
8834 /* Visual effects -- Display */
8835 print_rel(c, a, y, x);
8839 /* Hack -- center the cursor */
8840 move_cursor_relative(by, bx);
8842 /* Flush each "radius" seperately */
8843 /*if (fresh_before)*/ Term_fresh();
8845 /* Delay (efficiently) */
8846 if (visual || drawn)
8848 Term_xtra(TERM_XTRA_DELAY, msec);
8852 /* Flush the erasing */
8855 /* Erase the explosion drawn above */
8856 for (i = 0; i < grids; i++)
8858 /* Extract the location */
8862 /* Hack -- Erase if needed */
8863 if (panel_contains(y, x) && player_has_los_bold(y, x))
8869 /* Hack -- center the cursor */
8870 move_cursor_relative(by, bx);
8872 /* Flush the explosion */
8873 /*if (fresh_before)*/ Term_fresh();
8878 /* Update stuff if needed */
8879 if (p_ptr->update) update_stuff();
8882 /* Check features */
8883 if (flg & (PROJECT_GRID))
8885 /* Start with "dist" of zero */
8888 /* Scan for features */
8889 for (i = 0; i < grids; i++)
8891 /* Hack -- Notice new "dist" values */
8892 if (gm[dist+1] == i) dist++;
8894 /* Get the grid location */
8898 /* Find the closest point in the blast */
8901 int d = dist_to_line(y, x, y1, x1, by, bx);
8903 /* Affect the grid */
8904 if (project_f(who, d, y, x, dam, typ)) notice = TRUE;
8908 /* Affect the grid */
8909 if (project_f(who, dist, y, x, dam, typ)) notice = TRUE;
8914 /* Update stuff if needed */
8915 if (p_ptr->update) update_stuff();
8918 if (flg & (PROJECT_ITEM))
8920 /* Start with "dist" of zero */
8923 /* Scan for objects */
8924 for (i = 0; i < grids; i++)
8926 /* Hack -- Notice new "dist" values */
8927 if (gm[dist+1] == i) dist++;
8929 /* Get the grid location */
8933 /* Find the closest point in the blast */
8936 int d = dist_to_line(y, x, y1, x1, by, bx);
8938 /* Affect the object in the grid */
8939 if (project_o(who, d, y, x, dam, typ)) notice = TRUE;
8943 /* Affect the object in the grid */
8944 if (project_o(who, dist, y, x, dam, typ)) notice = TRUE;
8950 /* Check monsters */
8951 if (flg & (PROJECT_KILL))
8958 /* Start with "dist" of zero */
8961 /* Scan for monsters */
8962 for (i = 0; i < grids; i++)
8966 /* Hack -- Notice new "dist" values */
8967 if (gm[dist + 1] == i) dist++;
8969 /* Get the grid location */
8973 /* A single bolt may be reflected */
8976 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
8977 monster_race *ref_ptr = &r_info[m_ptr->r_idx];
8979 if ((ref_ptr->flags2 & RF2_REFLECTING) && (flg & PROJECT_REFLECTABLE) && (!who || dist_hack > 1) && !one_in_(10))
8982 int max_attempts = 10;
8984 /* Choose 'new' target */
8987 t_y = y_saver - 1 + randint1(3);
8988 t_x = x_saver - 1 + randint1(3);
8991 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(y, x, t_y, t_x));
8993 if (max_attempts < 1)
9002 if ((m_ptr->r_idx == MON_KENSHIROU) || (m_ptr->r_idx == MON_RAOU))
9003 msg_print("¡ÖËÌÅÍ¿À·ý±üµÁ¡¦Æó»Ø¿¿¶õÇÄ¡ª¡×");
9004 else if (m_ptr->r_idx == MON_DIO) msg_print("¥Ç¥£¥ª¡¦¥Ö¥é¥ó¥É¡¼¤Ï»Ø°ìËܤǹ¶·â¤òÃƤÊÖ¤·¤¿¡ª");
9005 else msg_print("¹¶·â¤ÏÄ·¤ÍÊ֤ä¿¡ª");
9007 msg_print("The attack bounces!");
9010 if (is_original_ap_and_seen(m_ptr)) ref_ptr->r_flags2 |= RF2_REFLECTING;
9012 /* Reflected bolts randomly target either one */
9013 if (one_in_(2)) flg |= PROJECT_PLAYER;
9014 else flg &= ~(PROJECT_PLAYER);
9016 /* The bolt is reflected */
9017 project(cave[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
9019 /* Don't affect the monster any longer */
9025 /* Find the closest point in the blast */
9028 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
9032 effective_dist = dist;
9036 /* There is the riding player on this monster */
9037 if (p_ptr->riding && player_bold(y, x))
9039 /* Aimed on the player */
9040 if (flg & PROJECT_PLAYER)
9042 if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
9045 * A beam or bolt is well aimed
9047 * So don't affects the mount.
9054 * The spell is not well aimed,
9055 * So partly affect the mount too.
9062 * This grid is the original target.
9063 * Or aimed on your horse.
9065 else if (((y == y2) && (x == x2)) || (flg & PROJECT_AIMED))
9067 /* Hit the mount with full damage */
9071 * Otherwise this grid is not the
9072 * original target, it means that line
9073 * of fire is obstructed by this
9077 * A beam or bolt will hit either
9078 * player or mount. Choose randomly.
9080 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE))
9084 /* Hit the mount with full damage */
9088 /* Hit the player later */
9089 flg |= PROJECT_PLAYER;
9091 /* Don't affect the mount */
9097 * The spell is not well aimed, so
9098 * partly affect both player and
9107 /* Affect the monster in the grid */
9108 if (project_m(who, effective_dist, y, x, dam, typ,flg)) notice = TRUE;
9112 /* Player affected one monster (without "jumping") */
9113 if (!who && (project_m_n == 1) && !jump)
9119 /* Track if possible */
9120 if (cave[y][x].m_idx > 0)
9122 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
9124 /* Hack -- auto-recall */
9125 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
9127 /* Hack - auto-track */
9128 if (m_ptr->ml) health_track(cave[y][x].m_idx);
9135 if (flg & (PROJECT_KILL))
9137 /* Start with "dist" of zero */
9140 /* Scan for player */
9141 for (i = 0; i < grids; i++)
9145 /* Hack -- Notice new "dist" values */
9146 if (gm[dist+1] == i) dist++;
9148 /* Get the grid location */
9152 /* Affect the player? */
9153 if (!player_bold(y, x)) continue;
9155 /* Find the closest point in the blast */
9158 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
9162 effective_dist = dist;
9165 /* Target may be your horse */
9168 /* Aimed on the player */
9169 if (flg & PROJECT_PLAYER)
9171 /* Hit the player with full damage */
9175 * Hack -- When this grid was not the
9176 * original target, a beam or bolt
9177 * would hit either player or mount,
9178 * and should be choosen randomly.
9180 * But already choosen to hit the
9181 * mount at this point.
9183 * Or aimed on your horse.
9185 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
9188 * A beam or bolt is well aimed
9190 * So don't affects the player.
9197 * The spell is not well aimed,
9198 * So partly affect the player too.
9204 /* Affect the player */
9205 if (project_p(who, who_name, effective_dist, y, x, dam, typ, flg, monspell)) notice = TRUE;
9213 monster_desc(m_name, &m_list[p_ptr->riding], 0);
9215 if (rakubadam_m > 0)
9217 if (rakuba(rakubadam_m, FALSE))
9220 msg_format("%^s¤Ë¿¶¤êÍî¤È¤µ¤ì¤¿¡ª", m_name);
9222 msg_format("%^s has thrown you off!", m_name);
9226 if (p_ptr->riding && rakubadam_p > 0)
9228 if(rakuba(rakubadam_p, FALSE))
9231 msg_format("%^s¤«¤éÍî¤Á¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
9233 msg_format("You have fallen from %s.", m_name);
9239 /* Return "something was noticed" */
9243 bool binding_field( int dam )
9245 int mirror_x[10],mirror_y[10]; /* ¶À¤Ï¤â¤Ã¤È¾¯¤Ê¤¤ */
9246 int mirror_num=0; /* ¶À¤Î¿ô */
9251 int msec= delay_factor*delay_factor*delay_factor;
9257 /* Default target of monsterspell is player */
9258 monster_target_y=py;
9259 monster_target_x=px;
9261 for( x=0 ; x < cur_wid ; x++ )
9263 for( y=0 ; y < cur_hgt ; y++ )
9265 if( is_mirror_grid(&cave[y][x]) &&
9266 distance(py,px,y,x) <= MAX_RANGE &&
9267 distance(py,px,y,x) != 0 &&
9268 player_has_los_bold(y,x) &&
9269 projectable(py, px, y, x)
9271 mirror_y[mirror_num]=y;
9272 mirror_x[mirror_num]=x;
9278 if( mirror_num < 2 )return FALSE;
9280 point_x[0] = randint0( mirror_num );
9282 point_x[1] = randint0( mirror_num );
9284 while( point_x[0] == point_x[1] );
9286 point_y[0]=mirror_y[point_x[0]];
9287 point_x[0]=mirror_x[point_x[0]];
9288 point_y[1]=mirror_y[point_x[1]];
9289 point_x[1]=mirror_x[point_x[1]];
9293 x=point_x[0]+point_x[1]+point_x[2];
9294 y=point_y[0]+point_y[1]+point_y[2];
9296 centersign = (point_x[0]*3-x)*(point_y[1]*3-y)
9297 - (point_y[0]*3-y)*(point_x[1]*3-x);
9298 if( centersign == 0 )return FALSE;
9300 x1 = point_x[0] < point_x[1] ? point_x[0] : point_x[1];
9301 x1 = x1 < point_x[2] ? x1 : point_x[2];
9302 y1 = point_y[0] < point_y[1] ? point_y[0] : point_y[1];
9303 y1 = y1 < point_y[2] ? y1 : point_y[2];
9305 x2 = point_x[0] > point_x[1] ? point_x[0] : point_x[1];
9306 x2 = x2 > point_x[2] ? x2 : point_x[2];
9307 y2 = point_y[0] > point_y[1] ? point_y[0] : point_y[1];
9308 y2 = y2 > point_y[2] ? y2 : point_y[2];
9310 for( y=y1 ; y <=y2 ; y++ ){
9311 for( x=x1 ; x <=x2 ; x++ ){
9312 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9313 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9314 centersign*( (point_x[1]-x)*(point_y[2]-y)
9315 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9316 centersign*( (point_x[2]-x)*(point_y[0]-y)
9317 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9319 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9320 /* Visual effects */
9322 && panel_contains(y,x)){
9323 p = bolt_pict(y,x,y,x, GF_MANA );
9324 print_rel(PICT_C(p), PICT_A(p),y,x);
9325 move_cursor_relative(y, x);
9326 /*if (fresh_before)*/ Term_fresh();
9327 Term_xtra(TERM_XTRA_DELAY, msec);
9333 for( y=y1 ; y <=y2 ; y++ ){
9334 for( x=x1 ; x <=x2 ; x++ ){
9335 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9336 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9337 centersign*( (point_x[1]-x)*(point_y[2]-y)
9338 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9339 centersign*( (point_x[2]-x)*(point_y[0]-y)
9340 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9342 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9343 (void)project_f(0,0,y,x,dam,GF_MANA);
9348 for( y=y1 ; y <=y2 ; y++ ){
9349 for( x=x1 ; x <=x2 ; x++ ){
9350 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9351 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9352 centersign*( (point_x[1]-x)*(point_y[2]-y)
9353 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9354 centersign*( (point_x[2]-x)*(point_y[0]-y)
9355 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9357 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9358 (void)project_o(0,0,y,x,dam,GF_MANA);
9363 for( y=y1 ; y <=y2 ; y++ ){
9364 for( x=x1 ; x <=x2 ; x++ ){
9365 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9366 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9367 centersign*( (point_x[1]-x)*(point_y[2]-y)
9368 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9369 centersign*( (point_x[2]-x)*(point_y[0]-y)
9370 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9372 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9373 (void)project_m(0,0,y,x,dam,GF_MANA,
9374 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP));
9381 msg_print("¶À¤¬·ë³¦¤ËÂѤ¨¤¤ì¤º¡¢²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡£");
9383 msg_print("The field broke a mirror");
9385 remove_mirror(point_y[0],point_x[0]);
9391 void seal_of_mirror( int dam )
9395 for( x = 0 ; x < cur_wid ; x++ )
9397 for( y = 0 ; y < cur_hgt ; y++ )
9399 if( is_mirror_grid(&cave[y][x]))
9401 if(project_m(0,0,y,x,dam,GF_GENOCIDE,
9402 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP)))
9404 if( !cave[y][x].m_idx )