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_brake : 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[DOOR_DOOR].closed);
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_tree);
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_granite);
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_shallow_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_shallow_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!");
1116 remove_mirror(y, x);
1117 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
1120 if (have_flag(f_ptr->flags, FF_GLASS) && !have_flag(f_ptr->flags, FF_PERMANENT) && (dam >= 50))
1123 if (known && (c_ptr->info & CAVE_MARK))
1126 msg_format("%s¤¬³ä¤ì¤¿¡ª", f_name + f_info[get_feat_mimic(c_ptr)].name);
1128 msg_format("The %s was crashed!", f_name + f_info[get_feat_mimic(c_ptr)].name);
1133 /* Destroy the wall */
1134 cave_alter_feat(y, x, FF_HURT_ROCK);
1136 /* Update some things */
1137 p_ptr->update |= (PU_FLOW);
1144 if (is_mirror_grid(c_ptr) && p_ptr->lev < 40)
1147 msg_print("¶À¤¬³ä¤ì¤¿¡ª");
1149 msg_print("The mirror was crashed!");
1152 remove_mirror(y, x);
1153 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
1156 if (have_flag(f_ptr->flags, FF_GLASS) && !have_flag(f_ptr->flags, FF_PERMANENT) && (dam >= 200))
1159 if (known && (c_ptr->info & CAVE_MARK))
1162 msg_format("%s¤¬³ä¤ì¤¿¡ª", f_name + f_info[get_feat_mimic(c_ptr)].name);
1164 msg_format("The %s was crashed!", f_name + f_info[get_feat_mimic(c_ptr)].name);
1169 /* Destroy the wall */
1170 cave_alter_feat(y, x, FF_HURT_ROCK);
1172 /* Update some things */
1173 p_ptr->update |= (PU_FLOW);
1178 case GF_DISINTEGRATE:
1180 /* Destroy mirror */
1181 if (is_mirror_grid(c_ptr)) remove_mirror(y, x);
1183 /* Permanent features don't get effect */
1184 /* But not protect monsters and other objects */
1185 if (have_flag(f_ptr->flags, FF_HURT_DISI) && !have_flag(f_ptr->flags, FF_PERMANENT))
1187 cave_alter_feat(y, x, FF_HURT_DISI);
1189 /* Update some things -- similar to GF_KILL_WALL */
1190 p_ptr->update |= (PU_FLOW);
1197 /* Return "Anything seen?" */
1204 * We are called from "project()" to "damage" objects
1206 * We are called both for "beam" effects and "ball" effects.
1208 * Perhaps we should only SOMETIMES damage things on the ground.
1210 * The "r" parameter is the "distance from ground zero".
1212 * Note that we determine if the player can "see" anything that happens
1213 * by taking into account: blindness, line-of-sight, and illumination.
1215 * XXX XXX XXX We also "see" grids which are "memorized", probably a hack
1217 * We return "TRUE" if the effect of the projection is "obvious".
1219 static bool project_o(int who, int r, int y, int x, int dam, int typ)
1221 cave_type *c_ptr = &cave[y][x];
1223 s16b this_o_idx, next_o_idx = 0;
1225 bool obvious = FALSE;
1226 bool known = player_has_los_bold(y, x);
1228 u32b flgs[TR_FLAG_SIZE];
1230 char o_name[MAX_NLEN];
1233 bool is_potion = FALSE;
1237 who = who ? who : 0;
1239 /* Reduce damage by distance */
1240 dam = (dam + r) / (r + 1);
1243 /* Scan all objects in the grid */
1244 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
1246 /* Acquire object */
1247 object_type *o_ptr = &o_list[this_o_idx];
1249 bool is_art = FALSE;
1250 bool ignore = FALSE;
1251 bool do_kill = FALSE;
1253 cptr note_kill = NULL;
1256 /* Get the "plural"-ness */
1257 bool plural = (o_ptr->number > 1);
1260 /* Acquire next object */
1261 next_o_idx = o_ptr->next_o_idx;
1263 /* Extract the flags */
1264 object_flags(o_ptr, flgs);
1266 /* Check for artifact */
1267 if (object_is_artifact(o_ptr)) is_art = TRUE;
1269 /* Analyze the type */
1272 /* Acid -- Lots of things */
1275 if (hates_acid(o_ptr))
1279 note_kill = "Í»¤±¤Æ¤·¤Þ¤Ã¤¿¡ª";
1281 note_kill = (plural ? " melt!" : " melts!");
1284 if (have_flag(flgs, TR_IGNORE_ACID)) ignore = TRUE;
1289 /* Elec -- Rings and Wands */
1292 if (hates_elec(o_ptr))
1296 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1298 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1301 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1306 /* Fire -- Flammable objects */
1309 if (hates_fire(o_ptr))
1313 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1315 note_kill = (plural ? " burn up!" : " burns up!");
1318 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1323 /* Cold -- potions and flasks */
1326 if (hates_cold(o_ptr))
1329 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1331 note_kill = (plural ? " shatter!" : " shatters!");
1335 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1343 if (hates_fire(o_ptr))
1347 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1349 note_kill = (plural ? " burn up!" : " burns up!");
1352 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1354 if (hates_elec(o_ptr))
1359 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1361 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1364 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1372 if (hates_fire(o_ptr))
1376 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1378 note_kill = (plural ? " burn up!" : " burns up!");
1381 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1383 if (hates_cold(o_ptr))
1388 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1390 note_kill = (plural ? " shatter!" : " shatters!");
1393 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1398 /* Hack -- break potions and such */
1404 if (hates_cold(o_ptr))
1407 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1409 note_kill = (plural ? " shatter!" : " shatters!");
1417 /* Mana and Chaos -- destroy everything */
1424 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1426 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1432 case GF_DISINTEGRATE:
1436 note_kill = "¾øȯ¤·¤Æ¤·¤Þ¤Ã¤¿¡ª";
1438 note_kill = (plural ? " evaporate!" : " evaporates!");
1448 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1450 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1453 if (have_flag(flgs, TR_RES_CHAOS)) ignore = TRUE;
1454 else if ((o_ptr->tval == TV_SCROLL) && (o_ptr->sval == SV_SCROLL_CHAOS)) ignore = TRUE;
1458 /* Holy Fire and Hell Fire -- destroys cursed non-artifacts */
1462 if (object_is_cursed(o_ptr))
1466 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1468 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1477 identify_item(o_ptr);
1479 /* Auto-inscription */
1480 autopick_alter_item((-this_o_idx), FALSE);
1488 /* Chests are noticed only if trapped or locked */
1489 if (o_ptr->tval == TV_CHEST)
1491 /* Disarm/Unlock traps */
1492 if (o_ptr->pval > 0)
1494 /* Disarm or Unlock */
1495 o_ptr->pval = (0 - o_ptr->pval);
1498 object_known(o_ptr);
1501 if (known && (o_ptr->marked & OM_FOUND))
1504 msg_print("¥«¥Á¥Ã¤È²»¤¬¤·¤¿¡ª");
1506 msg_print("Click!");
1518 if (o_ptr->tval == TV_CORPSE)
1523 if (!who || is_pet(&m_list[who]))
1524 mode |= PM_FORCE_PET;
1526 for (i = 0; i < o_ptr->number ; i++)
1528 if (((o_ptr->sval == SV_CORPSE) && (randint1(100) > 80)) ||
1529 ((o_ptr->sval == SV_SKELETON) && (randint1(100) > 60)))
1534 note_kill = "³¥¤Ë¤Ê¤Ã¤¿¡£";
1536 note_kill = (plural ? " become dust." : " becomes dust.");
1541 else if (summon_named_creature(who, y, x, o_ptr->pval, mode))
1544 note_kill = "À¸¤Ê֤ä¿¡£";
1546 note_kill = " revived.";
1549 else if (!note_kill)
1552 note_kill = "³¥¤Ë¤Ê¤Ã¤¿¡£";
1554 note_kill = (plural ? " become dust." : " becomes dust.");
1566 /* Attempt to destroy the object */
1569 /* Effect "observed" */
1570 if (known && (o_ptr->marked & OM_FOUND))
1573 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
1576 /* Artifacts, and other objects, get to resist */
1577 if (is_art || ignore)
1579 /* Observe the resist */
1580 if (known && (o_ptr->marked & OM_FOUND))
1583 msg_format("%s¤Ï±Æ¶Á¤ò¼õ¤±¤Ê¤¤¡ª",
1586 msg_format("The %s %s unaffected!",
1587 o_name, (plural ? "are" : "is"));
1596 /* Describe if needed */
1597 if (known && (o_ptr->marked & OM_FOUND) && note_kill)
1600 msg_format("%s¤Ï%s", o_name, note_kill);
1602 msg_format("The %s%s", o_name, note_kill);
1607 k_idx = o_ptr->k_idx;
1608 is_potion = object_is_potion(o_ptr);
1611 /* Delete the object */
1612 delete_object_idx(this_o_idx);
1614 /* Potions produce effects when 'shattered' */
1617 (void)potion_smash_effect(who, y, x, k_idx);
1626 /* Return "Anything seen?" */
1632 * Helper function for "project()" below.
1634 * Handle a beam/bolt/ball causing damage to a monster.
1636 * This routine takes a "source monster" (by index) which is mostly used to
1637 * determine if the player is causing the damage, and a "radius" (see below),
1638 * which is used to decrease the power of explosions with distance, and a
1639 * location, via integers which are modified by certain types of attacks
1640 * (polymorph and teleport being the obvious ones), a default damage, which
1641 * is modified as needed based on various properties, and finally a "damage
1642 * type" (see below).
1644 * Note that this routine can handle "no damage" attacks (like teleport) by
1645 * taking a "zero" damage, and can even take "parameters" to attacks (like
1646 * confuse) by accepting a "damage", using it to calculate the effect, and
1647 * then setting the damage to zero. Note that the "damage" parameter is
1648 * divided by the radius, so monsters not at the "epicenter" will not take
1649 * as much damage (or whatever)...
1651 * Note that "polymorph" is dangerous, since a failure in "place_monster()"'
1652 * may result in a dereference of an invalid pointer. XXX XXX XXX
1654 * Various messages are produced, and damage is applied.
1656 * Just "casting" a substance (i.e. plasma) does not make you immune, you must
1657 * actually be "made" of that substance, or "breathe" big balls of it.
1659 * We assume that "Plasma" monsters, and "Plasma" breathers, are immune
1662 * We assume "Nether" is an evil, necromantic force, so it doesn't hurt undead,
1663 * and hurts evil less. If can breath nether, then it resists it as well.
1665 * Damage reductions use the following formulas:
1666 * Note that "dam = dam * 6 / (randint1(6) + 6);"
1667 * gives avg damage of .655, ranging from .858 to .500
1668 * Note that "dam = dam * 5 / (randint1(6) + 6);"
1669 * gives avg damage of .544, ranging from .714 to .417
1670 * Note that "dam = dam * 4 / (randint1(6) + 6);"
1671 * gives avg damage of .444, ranging from .556 to .333
1672 * Note that "dam = dam * 3 / (randint1(6) + 6);"
1673 * gives avg damage of .327, ranging from .427 to .250
1674 * Note that "dam = dam * 2 / (randint1(6) + 6);"
1675 * gives something simple.
1677 * In this function, "result" messages are postponed until the end, where
1678 * the "note" string is appended to the monster name, if not NULL. So,
1679 * to make a spell have "no effect" just set "note" to NULL. You should
1680 * also set "notice" to FALSE, or the player will learn what the spell does.
1682 * We attempt to return "TRUE" if the player saw anything "useful" happen.
1684 /* "flg" was added. */
1685 static bool project_m(int who, int r, int y, int x, int dam, int typ, int flg, bool see_s_msg)
1689 cave_type *c_ptr = &cave[y][x];
1691 monster_type *m_ptr = &m_list[c_ptr->m_idx];
1692 monster_type *caster_ptr = (who > 0) ? &m_list[who] : NULL;
1694 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1698 /* Is the monster "seen"? */
1699 bool seen = m_ptr->ml;
1700 bool seen_msg = is_seen(m_ptr);
1702 bool slept = (bool)MON_CSLEEP(m_ptr);
1704 /* Were the effects "obvious" (if seen)? */
1705 bool obvious = FALSE;
1707 /* Can the player know about this effect? */
1708 bool known = ((m_ptr->cdis <= MAX_SIGHT) || p_ptr->inside_battle);
1710 /* Were the effects "irrelevant"? */
1711 bool skipped = FALSE;
1713 /* Gets the monster angry at the source of the effect? */
1714 bool get_angry = FALSE;
1716 /* Polymorph setting (true or false) */
1717 bool do_poly = FALSE;
1719 /* Teleport setting (max distance) */
1722 /* Confusion setting (amount to confuse) */
1725 /* Stunning setting (amount to stun) */
1728 /* Sleep amount (amount to sleep) */
1731 /* Fear amount (amount to fear) */
1734 /* Time amount (amount to time) */
1737 bool heal_leper = FALSE;
1739 /* Hold the monster name */
1748 /* Assume no note */
1751 /* Assume a default death */
1752 cptr note_dies = extract_note_dies(real_r_ptr(m_ptr));
1757 int caster_lev = (who > 0) ? r_info[caster_ptr->r_idx].level : (p_ptr->lev * 2);
1760 if (!c_ptr->m_idx) return (FALSE);
1762 /* Never affect projector */
1763 if (who && (c_ptr->m_idx == who)) return (FALSE);
1764 if ((c_ptr->m_idx == p_ptr->riding) && !who && !(typ == GF_OLD_HEAL) && !(typ == GF_OLD_SPEED) && !(typ == GF_STAR_HEAL)) return (FALSE);
1765 if (sukekaku && ((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) return FALSE;
1767 /* Don't affect already death monsters */
1768 /* Prevents problems with chain reactions of exploding monsters */
1769 if (m_ptr->hp < 0) return (FALSE);
1771 /* Reduce damage by distance */
1772 dam = (dam + r) / (r + 1);
1775 /* Get the monster name (BEFORE polymorphing) */
1776 monster_desc(m_name, m_ptr, 0);
1779 /* Get the monster possessive ("his"/"her"/"its") */
1780 monster_desc(m_poss, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE);
1784 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) disturb(1, 0);
1786 /* Analyze the damage type */
1789 /* Magic Missile -- pure damage */
1792 if (seen) obvious = TRUE;
1794 if (r_ptr->flagsr & RFR_RES_ALL)
1797 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1799 note = " is immune.";
1802 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1811 if (seen) obvious = TRUE;
1813 if (r_ptr->flagsr & RFR_RES_ALL)
1816 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1818 note = " is immune.";
1821 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1824 if (r_ptr->flagsr & RFR_IM_ACID)
1827 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1829 note = " resists a lot.";
1833 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ACID);
1841 if (seen) obvious = TRUE;
1843 if (r_ptr->flagsr & RFR_RES_ALL)
1846 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1848 note = " is immune.";
1851 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1854 if (r_ptr->flagsr & RFR_IM_ELEC)
1857 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1859 note = " resists a lot.";
1863 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ELEC);
1871 if (seen) obvious = TRUE;
1873 if (r_ptr->flagsr & RFR_RES_ALL)
1876 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1878 note = " is immune.";
1881 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1884 if (r_ptr->flagsr & RFR_IM_FIRE)
1887 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1889 note = " resists a lot.";
1893 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_FIRE);
1895 else if (r_ptr->flags3 & (RF3_HURT_FIRE))
1898 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
1900 note = " is hit hard.";
1904 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_FIRE);
1912 if (seen) obvious = TRUE;
1914 if (r_ptr->flagsr & RFR_RES_ALL)
1917 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1919 note = " is immune.";
1922 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1925 if (r_ptr->flagsr & RFR_IM_COLD)
1928 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1930 note = " resists a lot.";
1934 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
1936 else if (r_ptr->flags3 & (RF3_HURT_COLD))
1939 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
1941 note = " is hit hard.";
1945 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
1953 if (seen) obvious = TRUE;
1955 if (r_ptr->flagsr & RFR_RES_ALL)
1958 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1960 note = " is immune.";
1963 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1966 if (r_ptr->flagsr & RFR_IM_POIS)
1969 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1971 note = " resists a lot.";
1975 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1983 if (seen) obvious = TRUE;
1985 if (r_ptr->flagsr & RFR_RES_ALL)
1988 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1990 note = " is immune.";
1993 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1996 if (r_ptr->flagsr & RFR_IM_POIS)
1999 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2004 dam *= 3; dam /= randint1(6) + 6;
2005 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
2007 else if (one_in_(3)) do_poly = TRUE;
2011 /* Hellfire -- hurts Evil */
2014 if (seen) obvious = TRUE;
2016 if (r_ptr->flagsr & RFR_RES_ALL)
2019 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2021 note = " is immune.";
2024 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2027 if (r_ptr->flags3 & RF3_GOOD)
2031 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¼õ¤±¤¿¡£";
2033 note = " is hit hard.";
2036 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
2041 /* Holy Fire -- hurts Evil, Good are immune, others _resist_ */
2044 if (seen) obvious = TRUE;
2046 if (r_ptr->flagsr & RFR_RES_ALL)
2049 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2051 note = " is immune.";
2054 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2057 if (r_ptr->flags3 & RF3_GOOD)
2061 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2063 note = " is immune.";
2066 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_GOOD;
2068 else if (r_ptr->flags3 & RF3_EVIL)
2072 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¼õ¤±¤¿¡£";
2074 note = " is hit hard.";
2077 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_EVIL;
2082 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2087 dam *= 3; dam /= randint1(6) + 6;
2092 /* Arrow -- XXX no defense */
2095 if (seen) obvious = TRUE;
2097 if (r_ptr->flagsr & RFR_RES_ALL)
2100 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2102 note = " is immune.";
2105 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2111 /* Plasma -- XXX perhaps check ELEC or FIRE */
2114 if (seen) obvious = TRUE;
2116 if (r_ptr->flagsr & RFR_RES_ALL)
2119 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2121 note = " is immune.";
2124 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2127 if (r_ptr->flagsr & RFR_RES_PLAS)
2130 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2135 dam *= 3; dam /= randint1(6) + 6;
2136 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_PLAS);
2141 /* Nether -- see above */
2144 if (seen) obvious = TRUE;
2146 if (r_ptr->flagsr & RFR_RES_ALL)
2149 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2151 note = " is immune.";
2154 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2157 if (r_ptr->flagsr & RFR_RES_NETH)
2159 if (r_ptr->flags3 & RF3_UNDEAD)
2162 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2164 note = " is immune.";
2168 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
2173 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2178 dam *= 3; dam /= randint1(6) + 6;
2180 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NETH);
2182 else if (r_ptr->flags3 & RF3_EVIL)
2186 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2188 note = " resists somewhat.";
2191 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
2196 /* Water (acid) damage -- Water spirits/elementals are immune */
2199 if (seen) obvious = TRUE;
2201 if (r_ptr->flagsr & RFR_RES_ALL)
2204 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2206 note = " is immune.";
2209 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2212 if (r_ptr->flagsr & RFR_RES_WATE)
2214 if ((m_ptr->r_idx == MON_WATER_ELEM) || (m_ptr->r_idx == MON_UNMAKER))
2217 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2219 note = " is immune.";
2227 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2232 dam *= 3; dam /= randint1(6) + 6;
2234 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WATE);
2239 /* Chaos -- Chaos breathers resist */
2242 if (seen) obvious = TRUE;
2244 if (r_ptr->flagsr & RFR_RES_ALL)
2247 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2249 note = " is immune.";
2252 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2255 if (r_ptr->flagsr & RFR_RES_CHAO)
2258 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2263 dam *= 3; dam /= randint1(6) + 6;
2264 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_CHAO);
2266 else if ((r_ptr->flags3 & RF3_DEMON) && one_in_(3))
2269 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2271 note = " resists somewhat.";
2274 dam *= 3; dam /= randint1(6) + 6;
2275 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
2280 do_conf = (5 + randint1(11) + r) / (r + 1);
2285 /* Shards -- Shard breathers resist */
2288 if (seen) obvious = TRUE;
2290 if (r_ptr->flagsr & RFR_RES_ALL)
2293 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2295 note = " is immune.";
2298 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2301 if (r_ptr->flagsr & RFR_RES_SHAR)
2304 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2309 dam *= 3; dam /= randint1(6) + 6;
2310 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
2315 /* Rocket: Shard resistance helps */
2318 if (seen) obvious = TRUE;
2320 if (r_ptr->flagsr & RFR_RES_ALL)
2323 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2325 note = " is immune.";
2328 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2331 if (r_ptr->flagsr & RFR_RES_SHAR)
2334 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2336 note = " resists somewhat.";
2340 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
2346 /* Sound -- Sound breathers resist */
2349 if (seen) obvious = TRUE;
2351 if (r_ptr->flagsr & RFR_RES_ALL)
2354 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2356 note = " is immune.";
2359 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2362 if (r_ptr->flagsr & RFR_RES_SOUN)
2365 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2370 dam *= 2; dam /= randint1(6) + 6;
2371 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SOUN);
2373 else do_stun = (10 + randint1(15) + r) / (r + 1);
2380 if (seen) obvious = TRUE;
2382 if (r_ptr->flagsr & RFR_RES_ALL)
2385 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2387 note = " is immune.";
2390 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2393 if (r_ptr->flags3 & RF3_NO_CONF)
2396 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2401 dam *= 3; dam /= randint1(6) + 6;
2402 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
2404 else do_conf = (10 + randint1(15) + r) / (r + 1);
2408 /* Disenchantment -- Breathers and Disenchanters resist */
2411 if (seen) obvious = TRUE;
2413 if (r_ptr->flagsr & RFR_RES_ALL)
2416 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2418 note = " is immune.";
2421 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2424 if (r_ptr->flagsr & RFR_RES_DISE)
2427 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2432 dam *= 3; dam /= randint1(6) + 6;
2433 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DISE);
2438 /* Nexus -- Breathers and Existers resist */
2441 if (seen) obvious = TRUE;
2443 if (r_ptr->flagsr & RFR_RES_ALL)
2446 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2448 note = " is immune.";
2451 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2454 if (r_ptr->flagsr & RFR_RES_NEXU)
2457 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2462 dam *= 3; dam /= randint1(6) + 6;
2463 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NEXU);
2471 if (seen) obvious = TRUE;
2473 if (r_ptr->flagsr & RFR_RES_ALL)
2476 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2478 note = " is immune.";
2481 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2484 if (r_ptr->flagsr & RFR_RES_WALL)
2487 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2492 dam *= 3; dam /= randint1(6) + 6;
2493 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WALL);
2495 else do_stun = (randint1(15) + r) / (r + 1);
2499 /* Inertia -- breathers resist */
2502 if (seen) obvious = TRUE;
2504 if (r_ptr->flagsr & RFR_RES_ALL)
2507 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2509 note = " is immune.";
2512 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2515 if (r_ptr->flagsr & RFR_RES_INER)
2518 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2523 dam *= 3; dam /= randint1(6) + 6;
2524 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_INER);
2528 /* Powerful monsters can resist */
2529 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2530 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2534 /* Normal monsters slow down */
2537 if (set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 50))
2540 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
2542 note = " starts moving slower.";
2550 /* Time -- breathers resist */
2553 if (seen) obvious = TRUE;
2555 if (r_ptr->flagsr & RFR_RES_ALL)
2558 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2560 note = " is immune.";
2563 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2566 if (r_ptr->flagsr & RFR_RES_TIME)
2569 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2574 dam *= 3; dam /= randint1(6) + 6;
2575 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_TIME);
2577 else do_time = (dam + 1) / 2;
2581 /* Gravity -- breathers resist */
2584 bool resist_tele = FALSE;
2586 if (seen) obvious = TRUE;
2588 if (r_ptr->flagsr & RFR_RES_ALL)
2591 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2593 note = " is immune.";
2596 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2599 if (r_ptr->flagsr & RFR_RES_TELE)
2601 if (r_ptr->flags1 & (RF1_UNIQUE))
2603 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2605 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2607 note = " is unaffected!";
2612 else if (r_ptr->level > randint1(100))
2614 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2616 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
2625 if (!resist_tele) do_dist = 10;
2627 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
2629 if (r_ptr->flagsr & RFR_RES_GRAV)
2632 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2637 dam *= 3; dam /= randint1(6) + 6;
2639 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_GRAV);
2644 /* Powerful monsters can resist */
2645 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2646 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2650 /* Normal monsters slow down */
2653 if (set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 50))
2656 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
2658 note = " starts moving slower.";
2664 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
2666 /* Attempt a saving throw */
2667 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2668 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2672 /* No obvious effect */
2674 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2676 note = " is unaffected!";
2690 if (seen) obvious = TRUE;
2692 if (r_ptr->flagsr & RFR_RES_ALL)
2695 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2697 note = " is immune.";
2700 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2708 case GF_DISINTEGRATE:
2710 if (seen) obvious = TRUE;
2712 if (r_ptr->flagsr & RFR_RES_ALL)
2715 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2717 note = " is immune.";
2720 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2723 if (r_ptr->flags3 & RF3_HURT_ROCK)
2725 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
2727 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
2728 note_dies = "¤Ï¾øȯ¤·¤¿¡ª";
2730 note = " loses some skin!";
2731 note_dies = " evaporates!";
2741 if (seen) obvious = TRUE;
2743 /* PSI only works if the monster can see you! -- RG */
2744 if (!(los(m_ptr->fy, m_ptr->fx, py, px)))
2747 if (seen_msg) msg_format("%s¤Ï¤¢¤Ê¤¿¤¬¸«¤¨¤Ê¤¤¤Î¤Ç±Æ¶Á¤µ¤ì¤Ê¤¤¡ª", m_name);
2749 if (seen_msg) msg_format("%^s can't see you, and isn't affected!", m_name);
2755 if (r_ptr->flagsr & RFR_RES_ALL)
2758 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2760 note = " is immune.";
2763 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2766 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2770 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2772 note = " is immune!";
2774 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
2777 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2778 (r_ptr->flags3 & RF3_ANIMAL) ||
2779 (r_ptr->level > randint1(3 * dam)))
2783 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2790 * Powerful demons & undead can turn a mindcrafter's
2791 * attacks back on them
2793 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2794 (r_ptr->level > p_ptr->lev / 2) &&
2799 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
2801 msg_format("%^s%s corrupted mind backlashes your attack!",
2802 m_name, (seen ? "'s" : "s"));
2806 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2809 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2811 msg_print("You resist the effects!");
2817 /* Injure +/- confusion */
2818 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
2819 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2822 switch (randint1(4))
2825 set_confused(p_ptr->confused + 3 + randint1(dam));
2828 set_stun(p_ptr->stun + randint1(dam));
2832 if (r_ptr->flags3 & RF3_NO_FEAR)
2834 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2836 note = " is unaffected.";
2840 set_afraid(p_ptr->afraid + 3 + randint1(dam));
2844 if (!p_ptr->free_act)
2845 (void)set_paralyzed(p_ptr->paralyzed + randint1(dam));
2854 if ((dam > 0) && one_in_(4))
2856 switch (randint1(4))
2859 do_conf = 3 + randint1(dam);
2862 do_stun = 3 + randint1(dam);
2865 do_fear = 3 + randint1(dam);
2869 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
2871 note = " falls asleep!";
2874 do_sleep = 3 + randint1(dam);
2880 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
2882 note_dies = " collapses, a mindless husk.";
2890 if (seen) obvious = TRUE;
2892 if (r_ptr->flagsr & RFR_RES_ALL)
2895 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2897 note = " is immune.";
2900 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2903 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2907 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2909 note = " is immune!";
2913 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2914 (r_ptr->flags3 & RF3_ANIMAL) ||
2915 (r_ptr->level > randint1(3 * dam)))
2919 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2926 * Powerful demons & undead can turn a mindcrafter's
2927 * attacks back on them
2929 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2930 (r_ptr->level > p_ptr->lev / 2) &&
2935 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
2937 msg_format("%^s%s corrupted mind backlashes your attack!",
2938 m_name, (seen ? "'s" : "s"));
2942 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2945 msg_print("¤¢¤Ê¤¿¤Ï¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2947 msg_print("You resist the effects!");
2953 /* Injure + mana drain */
2954 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
2956 msg_print("ĶǽÎϥѥ¤òµÛ¤¤¤È¤é¤ì¤¿¡ª");
2958 msg_print("Your psychic energy is drained!");
2961 p_ptr->csp -= damroll(5, dam) / 2;
2962 if (p_ptr->csp < 0) p_ptr->csp = 0;
2963 p_ptr->redraw |= PR_MANA;
2964 p_ptr->window |= (PW_SPELL);
2965 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2972 int b = damroll(5, dam) / 4;
2974 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¶ìÄˤòĶǽÎϥѥ¤ËÊÑ´¹¤·¤¿¡ª", m_name);
2976 msg_format("You convert %s%s pain into psychic energy!",
2977 m_name, (seen ? "'s" : "s"));
2980 b = MIN(p_ptr->msp, p_ptr->csp + b);
2982 p_ptr->redraw |= PR_MANA;
2983 p_ptr->window |= (PW_SPELL);
2987 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
2989 note_dies = " collapses, a mindless husk.";
2995 case GF_TELEKINESIS:
2997 if (seen) obvious = TRUE;
2999 if (r_ptr->flagsr & RFR_RES_ALL)
3002 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3004 note = " is immune.";
3007 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3012 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
3017 do_stun = damroll((caster_lev / 20) + 3 , dam) + 1;
3019 /* Attempt a saving throw */
3020 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3021 (r_ptr->level > 5 + randint1(dam)))
3025 /* No obvious effect */
3031 /* Psycho-spear -- powerful magic missile */
3034 if (seen) obvious = TRUE;
3036 if (r_ptr->flagsr & RFR_RES_ALL)
3039 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3041 note = " is immune.";
3044 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3050 /* Meteor -- powerful magic missile */
3053 if (seen) obvious = TRUE;
3055 if (r_ptr->flagsr & RFR_RES_ALL)
3058 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3060 note = " is immune.";
3063 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3071 if (!is_hostile(m_ptr)) break;
3073 if (seen) obvious = TRUE;
3075 if (r_ptr->flagsr & RFR_RES_ALL)
3078 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3080 note = " is immune.";
3083 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3086 /* Attempt a saving throw */
3087 if ((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) ||
3088 (r_ptr->flags3 & RF3_NO_CONF) ||
3089 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3091 /* Memorize a flag */
3092 if (r_ptr->flags3 & RF3_NO_CONF)
3094 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3101 * Powerful demons & undead can turn a mindcrafter's
3102 * attacks back on them
3104 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
3105 (r_ptr->level > p_ptr->lev / 2) &&
3110 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
3112 msg_format("%^s%s corrupted mind backlashes your attack!",
3113 m_name, (seen ? "'s" : "s"));
3117 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
3120 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3122 msg_print("You resist the effects!");
3128 /* Confuse, stun, terrify */
3129 switch (randint1(4))
3132 set_stun(p_ptr->stun + dam / 2);
3135 set_confused(p_ptr->confused + dam / 2);
3139 if (r_ptr->flags3 & RF3_NO_FEAR)
3141 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3143 note = " is unaffected.";
3147 set_afraid(p_ptr->afraid + dam);
3154 /* No obvious effect */
3156 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3158 note = " is unaffected!";
3166 if ((dam > 29) && (randint1(100) < dam))
3169 note = "¤¬¤¢¤Ê¤¿¤ËÎì°¤·¤¿¡£";
3171 note = " is in your thrall!";
3178 switch (randint1(4))
3192 /* No "real" damage */
3199 /* Ice -- Cold + Cuts + Stun */
3202 if (seen) obvious = TRUE;
3204 if (r_ptr->flagsr & RFR_RES_ALL)
3207 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3209 note = " is immune.";
3212 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3215 do_stun = (randint1(15) + 1) / (r + 1);
3216 if (r_ptr->flagsr & RFR_IM_COLD)
3219 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡£";
3221 note = " resists a lot.";
3225 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
3227 else if (r_ptr->flags3 & (RF3_HURT_COLD))
3230 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
3232 note = " is hit hard.";
3236 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
3245 if (seen) obvious = TRUE;
3247 if (r_ptr->flagsr & RFR_RES_ALL)
3250 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3252 note = " is immune.";
3255 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3258 if (!monster_living(r_ptr))
3260 if (is_original_ap_and_seen(m_ptr))
3262 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
3263 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
3264 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
3268 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3270 note = " is unaffected!";
3276 else do_time = (dam+7)/8;
3284 if (seen) obvious = TRUE;
3286 if (r_ptr->flagsr & RFR_RES_ALL)
3289 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3291 note = " is immune.";
3294 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3297 if (!monster_living(r_ptr))
3299 if (is_original_ap_and_seen(m_ptr))
3301 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
3302 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
3303 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
3307 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
3309 note = " is immune.";
3315 else if (((r_ptr->flags1 & RF1_UNIQUE) &&
3316 (randint1(888) != 666)) ||
3317 (((r_ptr->level + randint1(20)) > randint1((caster_lev / 2) + randint1(10))) &&
3318 randint1(100) != 66))
3321 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
3333 /* Polymorph monster (Use "dam" as "power") */
3336 if (seen) obvious = TRUE;
3338 if (r_ptr->flagsr & RFR_RES_ALL)
3341 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3343 note = " is immune.";
3346 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3349 /* Attempt to polymorph (see below) */
3352 /* Powerful monsters can resist */
3353 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3354 (r_ptr->flags1 & RF1_QUESTOR) ||
3355 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3358 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3360 note = " is unaffected!";
3367 /* No "real" damage */
3374 /* Clone monsters (Ignore "dam") */
3377 if (seen) obvious = TRUE;
3379 if (is_pet(m_ptr) || (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_NAZGUL | RF7_UNIQUE2)))
3382 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3384 note = " is unaffected!";
3390 m_ptr->hp = m_ptr->maxhp;
3392 /* Attempt to clone. */
3393 if (multiply_monster(c_ptr->m_idx, TRUE, 0L))
3396 note = "¤¬Ê¬Îö¤·¤¿¡ª";
3404 /* No "real" damage */
3411 /* Heal Monster (use "dam" as amount of healing) */
3414 if (seen) obvious = TRUE;
3417 (void)set_monster_csleep(c_ptr->m_idx, 0);
3419 if (m_ptr->maxhp < m_ptr->max_maxhp)
3422 if (seen_msg) msg_format("%^s¤Î¶¯¤µ¤¬Ìá¤Ã¤¿¡£", m_name);
3424 if (seen_msg) msg_format("%^s recovers %s vitality.", m_name, m_poss);
3426 m_ptr->maxhp = m_ptr->max_maxhp;
3431 /* Redraw (later) if needed */
3432 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
3433 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
3441 if (seen) obvious = TRUE;
3444 (void)set_monster_csleep(c_ptr->m_idx, 0);
3445 if (MON_STUNNED(m_ptr))
3448 if (seen_msg) msg_format("%^s¤ÏÛ¯Û°¾õÂÖ¤«¤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3450 if (seen_msg) msg_format("%^s is no longer stunned.", m_name);
3452 (void)set_monster_stunned(c_ptr->m_idx, 0);
3454 if (MON_CONFUSED(m_ptr))
3457 if (seen_msg) msg_format("%^s¤Ïº®Í𤫤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3459 if (seen_msg) msg_format("%^s is no longer confused.", m_name);
3461 (void)set_monster_confused(c_ptr->m_idx, 0);
3463 if (MON_MONFEAR(m_ptr))
3466 if (seen_msg) msg_format("%^s¤Ïͦµ¤¤ò¼è¤êÌᤷ¤¿¡£", m_name);
3468 if (seen_msg) msg_format("%^s recovers %s courage.", m_name, m_poss);
3470 (void)set_monster_monfear(c_ptr->m_idx, 0);
3474 if (m_ptr->hp < 30000) m_ptr->hp += dam;
3477 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
3481 chg_virtue(V_VITALITY, 1);
3483 if (r_ptr->flags1 & RF1_UNIQUE)
3484 chg_virtue(V_INDIVIDUALISM, 1);
3486 if (is_friendly(m_ptr))
3487 chg_virtue(V_HONOUR, 1);
3488 else if (!(r_ptr->flags3 & RF3_EVIL))
3490 if (r_ptr->flags3 & RF3_GOOD)
3491 chg_virtue(V_COMPASSION, 2);
3493 chg_virtue(V_COMPASSION, 1);
3496 if (r_ptr->flags3 & RF3_ANIMAL)
3497 chg_virtue(V_NATURE, 1);
3500 if (m_ptr->r_idx == MON_LEPER)
3503 if (!who) chg_virtue(V_COMPASSION, 5);
3506 /* Redraw (later) if needed */
3507 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
3508 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
3512 note = "¤ÏÂÎÎϤò²óÉü¤·¤¿¤è¤¦¤À¡£";
3514 note = " looks healthier.";
3517 /* No "real" damage */
3523 /* Speed Monster (Ignore "dam") */
3526 if (seen) obvious = TRUE;
3529 if (set_monster_fast(c_ptr->m_idx, MON_FAST(m_ptr) + 100))
3532 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
3534 note = " starts moving faster.";
3540 if (r_ptr->flags1 & RF1_UNIQUE)
3541 chg_virtue(V_INDIVIDUALISM, 1);
3542 if (is_friendly(m_ptr))
3543 chg_virtue(V_HONOUR, 1);
3546 /* No "real" damage */
3552 /* Slow Monster (Use "dam" as "power") */
3555 if (seen) obvious = TRUE;
3557 if (r_ptr->flagsr & RFR_RES_ALL)
3560 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3562 note = " is immune.";
3565 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3568 /* Powerful monsters can resist */
3569 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3570 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3573 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3575 note = " is unaffected!";
3581 /* Normal monsters slow down */
3584 if (set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 50))
3587 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
3589 note = " starts moving slower.";
3594 /* No "real" damage */
3600 /* Sleep (Use "dam" as "power") */
3603 if (seen) obvious = TRUE;
3605 if (r_ptr->flagsr & RFR_RES_ALL)
3608 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3610 note = " is immune.";
3613 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3616 /* Attempt a saving throw */
3617 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3618 (r_ptr->flags3 & RF3_NO_SLEEP) ||
3619 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3621 /* Memorize a flag */
3622 if (r_ptr->flags3 & RF3_NO_SLEEP)
3624 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
3627 /* No obvious effect */
3629 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3631 note = " is unaffected!";
3638 /* Go to sleep (much) later */
3640 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
3642 note = " falls asleep!";
3648 /* No "real" damage */
3654 /* Sleep (Use "dam" as "power") */
3655 case GF_STASIS_EVIL:
3657 if (seen) obvious = TRUE;
3659 if (r_ptr->flagsr & RFR_RES_ALL)
3662 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3664 note = " is immune.";
3667 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3670 /* Attempt a saving throw */
3671 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3672 !(r_ptr->flags3 & RF3_EVIL) ||
3673 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3676 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3678 note = " is unaffected!";
3685 /* Go to sleep (much) later */
3687 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3689 note = " is suspended!";
3695 /* No "real" damage */
3700 /* Sleep (Use "dam" as "power") */
3703 if (seen) obvious = TRUE;
3705 if (r_ptr->flagsr & RFR_RES_ALL)
3708 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3710 note = " is immune.";
3713 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3716 /* Attempt a saving throw */
3717 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3718 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3721 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3723 note = " is unaffected!";
3730 /* Go to sleep (much) later */
3732 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3734 note = " is suspended!";
3740 /* No "real" damage */
3749 dam += (adj_con_fix[p_ptr->stat_ind[A_CHR]] - 1);
3750 vir = virtue_number(V_HARMONY);
3753 dam += p_ptr->virtues[vir-1]/10;
3756 vir = virtue_number(V_INDIVIDUALISM);
3759 dam -= p_ptr->virtues[vir-1]/20;
3762 if (seen) obvious = TRUE;
3764 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3767 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3769 note = " is immune.";
3772 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3776 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3779 /* Attempt a saving throw */
3780 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3781 (r_ptr->flags3 & RF3_NO_CONF) ||
3782 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3783 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 5))
3785 /* Memorize a flag */
3786 if (r_ptr->flags3 & RF3_NO_CONF)
3788 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3792 /* No obvious effect */
3794 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3796 note = " is unaffected!";
3801 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3803 else if (p_ptr->cursed & TRC_AGGRAVATE)
3806 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3808 note = " hates you too much!";
3811 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3816 note = "¤ÏÆÍÁ³Í§¹¥Åª¤Ë¤Ê¤Ã¤¿¤è¤¦¤À¡ª";
3818 note = " suddenly seems friendly!";
3823 chg_virtue(V_INDIVIDUALISM, -1);
3824 if (r_ptr->flags3 & RF3_ANIMAL)
3825 chg_virtue(V_NATURE, 1);
3828 /* No "real" damage */
3833 /* Control undead */
3834 case GF_CONTROL_UNDEAD:
3837 if (seen) obvious = TRUE;
3839 vir = virtue_number(V_UNLIFE);
3842 dam += p_ptr->virtues[vir-1]/10;
3845 vir = virtue_number(V_INDIVIDUALISM);
3848 dam -= p_ptr->virtues[vir-1]/20;
3851 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3854 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3856 note = " is immune.";
3859 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3863 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3866 /* Attempt a saving throw */
3867 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3868 (!(r_ptr->flags3 & RF3_UNDEAD)) ||
3869 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3870 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3872 /* No obvious effect */
3874 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3876 note = " is unaffected!";
3880 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3882 else if (p_ptr->cursed & TRC_AGGRAVATE)
3885 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3887 note = " hates you too much!";
3890 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3895 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
3897 note = " is in your thrall!";
3903 /* No "real" damage */
3909 case GF_CONTROL_DEMON:
3912 if (seen) obvious = TRUE;
3914 vir = virtue_number(V_UNLIFE);
3917 dam += p_ptr->virtues[vir-1]/10;
3920 vir = virtue_number(V_INDIVIDUALISM);
3923 dam -= p_ptr->virtues[vir-1]/20;
3926 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3929 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3931 note = " is immune.";
3934 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3938 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3941 /* Attempt a saving throw */
3942 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3943 (!(r_ptr->flags3 & RF3_DEMON)) ||
3944 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3945 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3947 /* No obvious effect */
3949 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3951 note = " is unaffected!";
3955 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3957 else if (p_ptr->cursed & TRC_AGGRAVATE)
3960 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3962 note = " hates you too much!";
3965 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3970 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
3972 note = " is in your thrall!";
3978 /* No "real" damage */
3984 case GF_CONTROL_ANIMAL:
3988 if (seen) obvious = TRUE;
3990 vir = virtue_number(V_NATURE);
3993 dam += p_ptr->virtues[vir-1]/10;
3996 vir = virtue_number(V_INDIVIDUALISM);
3999 dam -= p_ptr->virtues[vir-1]/20;
4002 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
4005 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4007 note = " is immune.";
4010 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4014 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
4017 /* Attempt a saving throw */
4018 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4019 (!(r_ptr->flags3 & (RF3_ANIMAL))) ||
4020 (m_ptr->mflag2 & MFLAG2_NOPET) ||
4021 (r_ptr->flags3 & (RF3_NO_CONF)) ||
4022 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4024 /* Memorize a flag */
4025 if (r_ptr->flags3 & (RF3_NO_CONF))
4027 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
4031 /* No obvious effect */
4033 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4035 note = " is unaffected!";
4039 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4041 else if (p_ptr->cursed & TRC_AGGRAVATE)
4044 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4046 note = " hates you too much!";
4049 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4054 note = "¤Ï¤Ê¤Ä¤¤¤¿¡£";
4056 note = " is tamed!";
4061 if (r_ptr->flags3 & RF3_ANIMAL)
4062 chg_virtue(V_NATURE, 1);
4065 /* No "real" damage */
4071 case GF_CONTROL_LIVING:
4075 vir = virtue_number(V_UNLIFE);
4076 if (seen) obvious = TRUE;
4078 dam += (adj_chr_chm[p_ptr->stat_ind[A_CHR]]);
4079 vir = virtue_number(V_UNLIFE);
4082 dam -= p_ptr->virtues[vir-1]/10;
4085 vir = virtue_number(V_INDIVIDUALISM);
4088 dam -= p_ptr->virtues[vir-1]/20;
4091 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 30;
4092 if (dam < 1) dam = 1;
4094 msg_format("%s¤ò¸«¤Ä¤á¤¿¡£",m_name);
4096 msg_format("You stare into %s.", m_name);
4098 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
4101 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4103 note = " is immune.";
4106 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4110 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
4113 /* Attempt a saving throw */
4114 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4115 (m_ptr->mflag2 & MFLAG2_NOPET) ||
4116 !monster_living(r_ptr) ||
4117 ((r_ptr->level+10) > randint1(dam)))
4120 /* No obvious effect */
4122 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4124 note = " is unaffected!";
4128 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4130 else if (p_ptr->cursed & TRC_AGGRAVATE)
4133 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4135 note = " hates you too much!";
4138 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4143 note = "¤ò»ÙÇÛ¤·¤¿¡£";
4145 note = " is tamed!";
4150 if (r_ptr->flags3 & RF3_ANIMAL)
4151 chg_virtue(V_NATURE, 1);
4154 /* No "real" damage */
4159 /* Confusion (Use "dam" as "power") */
4162 if (seen) obvious = TRUE;
4164 if (r_ptr->flagsr & RFR_RES_ALL)
4167 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4169 note = " is immune.";
4172 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4175 /* Get confused later */
4176 do_conf = damroll(3, (dam / 2)) + 1;
4178 /* Attempt a saving throw */
4179 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4180 (r_ptr->flags3 & (RF3_NO_CONF)) ||
4181 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4183 /* Memorize a flag */
4184 if (r_ptr->flags3 & (RF3_NO_CONF))
4186 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
4192 /* No obvious effect */
4194 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4196 note = " is unaffected!";
4202 /* No "real" damage */
4209 if (seen) obvious = TRUE;
4211 if (r_ptr->flagsr & RFR_RES_ALL)
4214 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4216 note = " is immune.";
4219 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4222 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
4224 /* Attempt a saving throw */
4225 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4226 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4231 /* No obvious effect */
4233 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4235 note = " is unaffected!";
4241 /* No "real" damage */
4249 /* Lite, but only hurts susceptible creatures */
4257 if (r_ptr->flagsr & RFR_RES_ALL)
4263 if (r_ptr->flags3 & (RF3_HURT_LITE))
4265 /* Obvious effect */
4266 if (seen) obvious = TRUE;
4268 /* Memorize the effects */
4269 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4271 /* Special effect */
4273 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4274 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4276 note = " cringes from the light!";
4277 note_dies = " shrivels away in the light!";
4282 /* Normally no damage */
4294 /* Lite -- opposite of Dark */
4297 if (seen) obvious = TRUE;
4299 if (r_ptr->flagsr & RFR_RES_ALL)
4302 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4304 note = " is immune.";
4307 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4310 if (r_ptr->flagsr & RFR_RES_LITE)
4313 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4318 dam *= 2; dam /= (randint1(6)+6);
4319 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_LITE);
4321 else if (r_ptr->flags3 & (RF3_HURT_LITE))
4323 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4325 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4326 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4328 note = " cringes from the light!";
4329 note_dies = " shrivels away in the light!";
4338 /* Dark -- opposite of Lite */
4341 if (seen) obvious = TRUE;
4343 if (r_ptr->flagsr & RFR_RES_ALL)
4346 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4348 note = " is immune.";
4351 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4354 if (r_ptr->flagsr & RFR_RES_DARK)
4357 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4362 dam *= 2; dam /= (randint1(6)+6);
4363 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DARK);
4372 if (r_ptr->flagsr & RFR_RES_ALL)
4377 /* Hurt by rock remover */
4378 if (r_ptr->flags3 & (RF3_HURT_ROCK))
4381 if (seen) obvious = TRUE;
4383 /* Memorize the effects */
4384 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
4386 /* Cute little message */
4388 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
4389 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4391 note = " loses some skin!";
4392 note_dies = " dissolves!";
4397 /* Usually, ignore the effects */
4408 /* Teleport undead (Use "dam" as "power") */
4409 case GF_AWAY_UNDEAD:
4411 /* Only affect undead */
4412 if (r_ptr->flags3 & (RF3_UNDEAD))
4414 bool resists_tele = FALSE;
4416 if (r_ptr->flagsr & RFR_RES_TELE)
4418 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4420 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4422 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4424 note = " is unaffected!";
4427 resists_tele = TRUE;
4429 else if (r_ptr->level > randint1(100))
4431 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4433 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4438 resists_tele = TRUE;
4444 if (seen) obvious = TRUE;
4445 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4457 /* No "real" damage */
4463 /* Teleport evil (Use "dam" as "power") */
4466 /* Only affect evil */
4467 if (r_ptr->flags3 & (RF3_EVIL))
4469 bool resists_tele = FALSE;
4471 if (r_ptr->flagsr & RFR_RES_TELE)
4473 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4475 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4477 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4479 note = " is unaffected!";
4482 resists_tele = TRUE;
4484 else if (r_ptr->level > randint1(100))
4486 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4488 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4493 resists_tele = TRUE;
4499 if (seen) obvious = TRUE;
4500 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4512 /* No "real" damage */
4518 /* Teleport monster (Use "dam" as "power") */
4521 bool resists_tele = FALSE;
4522 if (r_ptr->flagsr & RFR_RES_TELE)
4524 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4526 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4528 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4530 note = " is unaffected!";
4533 resists_tele = TRUE;
4535 else if (r_ptr->level > randint1(100))
4537 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4539 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4544 resists_tele = TRUE;
4551 if (seen) obvious = TRUE;
4553 /* Prepare to teleport */
4557 /* No "real" damage */
4563 /* Turn undead (Use "dam" as "power") */
4564 case GF_TURN_UNDEAD:
4566 if (r_ptr->flagsr & RFR_RES_ALL)
4571 /* Only affect undead */
4572 if (r_ptr->flags3 & (RF3_UNDEAD))
4575 if (seen) obvious = TRUE;
4577 /* Learn about type */
4578 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4580 /* Apply some fear */
4581 do_fear = damroll(3, (dam / 2)) + 1;
4583 /* Attempt a saving throw */
4584 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4586 /* No obvious effect */
4588 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4590 note = " is unaffected!";
4605 /* No "real" damage */
4611 /* Turn evil (Use "dam" as "power") */
4614 if (r_ptr->flagsr & RFR_RES_ALL)
4619 /* Only affect evil */
4620 if (r_ptr->flags3 & (RF3_EVIL))
4623 if (seen) obvious = TRUE;
4625 /* Learn about type */
4626 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4628 /* Apply some fear */
4629 do_fear = damroll(3, (dam / 2)) + 1;
4631 /* Attempt a saving throw */
4632 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4634 /* No obvious effect */
4636 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4638 note = " is unaffected!";
4653 /* No "real" damage */
4659 /* Turn monster (Use "dam" as "power") */
4662 if (r_ptr->flagsr & RFR_RES_ALL)
4668 if (seen) obvious = TRUE;
4670 /* Apply some fear */
4671 do_fear = damroll(3, (dam / 2)) + 1;
4673 /* Attempt a saving throw */
4674 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4675 (r_ptr->flags3 & (RF3_NO_FEAR)) ||
4676 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4678 /* No obvious effect */
4680 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4682 note = " is unaffected!";
4689 /* No "real" damage */
4696 case GF_DISP_UNDEAD:
4698 if (r_ptr->flagsr & RFR_RES_ALL)
4704 /* Only affect undead */
4705 if (r_ptr->flags3 & (RF3_UNDEAD))
4708 if (seen) obvious = TRUE;
4710 /* Learn about type */
4711 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4715 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4716 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4718 note = " shudders.";
4719 note_dies = " dissolves!";
4740 if (r_ptr->flagsr & RFR_RES_ALL)
4746 /* Only affect evil */
4747 if (r_ptr->flags3 & (RF3_EVIL))
4750 if (seen) obvious = TRUE;
4752 /* Learn about type */
4753 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4757 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4758 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4760 note = " shudders.";
4761 note_dies = " dissolves!";
4781 if (r_ptr->flagsr & RFR_RES_ALL)
4787 /* Only affect good */
4788 if (r_ptr->flags3 & (RF3_GOOD))
4791 if (seen) obvious = TRUE;
4793 /* Learn about type */
4794 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
4798 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4799 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4801 note = " shudders.";
4802 note_dies = " dissolves!";
4820 case GF_DISP_LIVING:
4822 if (r_ptr->flagsr & RFR_RES_ALL)
4828 /* Only affect non-undead */
4829 if (monster_living(r_ptr))
4832 if (seen) obvious = TRUE;
4836 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4837 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4839 note = " shudders.";
4840 note_dies = " dissolves!";
4861 if (r_ptr->flagsr & RFR_RES_ALL)
4867 /* Only affect demons */
4868 if (r_ptr->flags3 & (RF3_DEMON))
4871 if (seen) obvious = TRUE;
4873 /* Learn about type */
4874 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
4878 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4879 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4881 note = " shudders.";
4882 note_dies = " dissolves!";
4899 /* Dispel monster */
4902 if (r_ptr->flagsr & RFR_RES_ALL)
4909 if (seen) obvious = TRUE;
4913 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4914 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4916 note = " shudders.";
4917 note_dies = " dissolves!";
4927 if (seen) obvious = TRUE;
4929 if (r_ptr->flagsr & RFR_RES_ALL)
4932 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4934 note = " is immune.";
4937 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4941 if ((r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) || (r_ptr->flags5 & ~(RF5_NOMAGIC_MASK)) || (r_ptr->flags6 & ~(RF6_NOMAGIC_MASK)))
4945 /* Heal the monster */
4946 if (caster_ptr->hp < caster_ptr->maxhp)
4949 caster_ptr->hp += 6 * dam;
4950 if (caster_ptr->hp > caster_ptr->maxhp) caster_ptr->hp = caster_ptr->maxhp;
4952 /* Redraw (later) if needed */
4953 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
4954 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
4956 /* Special message */
4959 /* Get the monster name */
4960 monster_desc(killer, caster_ptr, 0);
4962 msg_format("%^s¤Ïµ¤Ê¬¤¬Îɤµ¤½¤¦¤À¡£", killer);
4964 msg_format("%^s appears healthier.", killer);
4973 msg_format("%s¤«¤éÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¤È¤Ã¤¿¡£", m_name);
4975 msg_format("You draw psychic energy from %s.", m_name);
4978 (void)hp_player(dam);
4984 if (see_s_msg) msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", m_name);
4986 if (see_s_msg) msg_format("%s is unaffected.", m_name);
4996 if (seen) obvious = TRUE;
4999 if (!who) msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£", m_name);
5001 if (!who) msg_format("You gaze intently at %s.", m_name);
5004 if (r_ptr->flagsr & RFR_RES_ALL)
5007 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5009 note = " is immune.";
5012 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5016 /* Attempt a saving throw */
5017 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5018 (r_ptr->flags3 & RF3_NO_CONF) ||
5019 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
5021 /* Memorize a flag */
5022 if (r_ptr->flags3 & (RF3_NO_CONF))
5024 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
5027 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5029 note = "is unaffected!";
5033 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
5035 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5037 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5039 note = " is immune!";
5043 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
5045 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
5047 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
5056 note = "¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£";
5057 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
5059 note = " is blasted by psionic energy.";
5060 note_dies = " collapses, a mindless husk.";
5063 if (who > 0) do_conf = randint0(4) + 4;
5064 else do_conf = randint0(8) + 8;
5070 case GF_BRAIN_SMASH:
5072 if (seen) obvious = TRUE;
5075 if (!who) msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£", m_name);
5077 if (!who) msg_format("You gaze intently at %s.", m_name);
5080 if (r_ptr->flagsr & RFR_RES_ALL)
5083 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5085 note = " is immune.";
5088 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5092 /* Attempt a saving throw */
5093 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5094 (r_ptr->flags3 & RF3_NO_CONF) ||
5095 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
5097 /* Memorize a flag */
5098 if (r_ptr->flags3 & (RF3_NO_CONF))
5100 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
5103 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5105 note = "is unaffected!";
5109 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
5111 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5113 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5115 note = " is immune!";
5119 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
5121 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
5123 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
5132 note = "¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£";
5133 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
5135 note = " is blasted by psionic energy.";
5136 note_dies = " collapses, a mindless husk.";
5141 do_conf = randint0(4) + 4;
5142 do_stun = randint0(4) + 4;
5146 do_conf = randint0(8) + 8;
5147 do_stun = randint0(8) + 8;
5149 (void)set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 10);
5157 if (seen) obvious = TRUE;
5160 if (!who) msg_format("%s¤ò»Øº¹¤·¤Æ¼ö¤¤¤ò¤«¤±¤¿¡£", m_name);
5162 if (!who) msg_format("You point at %s and curse.", m_name);
5165 if (r_ptr->flagsr & RFR_RES_ALL)
5168 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5170 note = " is immune.";
5173 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5177 /* Attempt a saving throw */
5178 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
5181 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5183 note = "is unaffected!";
5193 if (seen) obvious = TRUE;
5196 if (!who) msg_format("%s¤ò»Øº¹¤·¤Æ¶²¤í¤·¤²¤Ë¼ö¤¤¤ò¤«¤±¤¿¡£", m_name);
5198 if (!who) msg_format("You point at %s and curse horribly.", m_name);
5201 if (r_ptr->flagsr & RFR_RES_ALL)
5204 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5206 note = " is immune.";
5209 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5213 /* Attempt a saving throw */
5214 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
5217 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5219 note = "is unaffected!";
5229 if (seen) obvious = TRUE;
5232 if (!who) msg_format("%s¤ò»Øº¹¤·¡¢¶²¤í¤·¤²¤Ë¼öʸ¤ò¾§¤¨¤¿¡ª", m_name);
5234 if (!who) msg_format("You point at %s, incanting terribly!", m_name);
5237 if (r_ptr->flagsr & RFR_RES_ALL)
5240 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5242 note = " is immune.";
5245 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5249 /* Attempt a saving throw */
5250 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
5253 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5255 note = "is unaffected!";
5265 if (seen) obvious = TRUE;
5268 if (!who) msg_format("%s¤ÎÈ빦¤òÆͤ¤¤Æ¡¢¡Ö¤ªÁ°¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡×¤È¶«¤ó¤À¡£", m_name);
5270 if (!who) msg_format("You point at %s, screaming the word, 'DIE!'.", m_name);
5273 if (r_ptr->flagsr & RFR_RES_ALL)
5276 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5278 note = " is immune.";
5281 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5285 /* Attempt a saving throw */
5286 if ((randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35)) && ((who <= 0) || (caster_ptr->r_idx != MON_KENSHIROU)))
5289 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5291 note = "is unaffected!";
5301 if (seen) obvious = TRUE;
5303 if (r_ptr->flagsr & RFR_RES_ALL)
5306 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5308 note = " is immune.";
5311 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5315 if (r_ptr->flags1 & RF1_UNIQUE)
5318 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5320 note = "is unaffected!";
5326 if ((who > 0) ? ((caster_lev + randint1(dam)) > (r_ptr->level + 10 + randint1(20))) :
5327 (((caster_lev / 2) + randint1(dam)) > (r_ptr->level + randint1(200))))
5329 dam = ((40 + randint1(20)) * m_ptr->hp) / 100;
5331 if (m_ptr->hp < dam) dam = m_ptr->hp - 1;
5336 note = "¤ÏÂÑÀ¤ò»ý¤Ã¤Æ¤¤¤ë¡ª";
5346 /* Capture monster */
5350 if ((p_ptr->inside_quest && (quest[p_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(m_ptr)) ||
5351 (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)
5354 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£",m_name);
5356 msg_format("%^s is unaffected.", m_name);
5362 if (is_pet(m_ptr)) nokori_hp = m_ptr->maxhp * 4L;
5363 else if ((p_ptr->pclass == CLASS_BEASTMASTER) && monster_living(r_ptr))
5364 nokori_hp = m_ptr->maxhp * 3 / 10;
5366 nokori_hp = m_ptr->maxhp * 3 / 20;
5368 if (m_ptr->hp >= nokori_hp)
5371 msg_format("¤â¤Ã¤È¼å¤é¤»¤Ê¤¤¤È¡£");
5373 msg_format("You need to weaken %s more.", m_name);
5377 else if (m_ptr->hp < randint0(nokori_hp))
5379 if (m_ptr->mflag2 & MFLAG2_CHAMELEON) choose_new_monster(c_ptr->m_idx, FALSE, MON_CHAMELEON);
5381 msg_format("%s¤òÊᤨ¤¿¡ª",m_name);
5383 msg_format("You capture %^s!", m_name);
5385 cap_mon = m_ptr->r_idx;
5386 cap_mspeed = m_ptr->mspeed;
5388 cap_maxhp = m_ptr->max_maxhp;
5389 cap_nickname = m_ptr->nickname; /* Quark transfer */
5390 if (c_ptr->m_idx == p_ptr->riding)
5392 if (rakuba(-1, FALSE))
5395 msg_print("ÃÏÌ̤ËÍî¤È¤µ¤ì¤¿¡£");
5397 msg_format("You have fallen from %s.", m_name);
5402 delete_monster_idx(c_ptr->m_idx);
5409 msg_format("¤¦¤Þ¤¯Êá¤Þ¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡£");
5411 msg_format("You failed to capture %s.", m_name);
5418 /* Attack (Use "dam" as attack type) */
5421 /* Return this monster's death */
5422 return py_attack(y, x, dam);
5425 /* Sleep (Use "dam" as "power") */
5431 if (seen) obvious = TRUE;
5433 if (r_ptr->flagsr & RFR_RES_ALL)
5436 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5438 note = " is immune.";
5441 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5444 if (r_ptr->flags2 & RF2_EMPTY_MIND)
5447 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5449 note = " is immune!";
5453 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5456 if (MON_CSLEEP(m_ptr))
5459 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5461 note = " is immune!";
5468 if (one_in_(5)) effect = 1;
5469 else if (one_in_(4)) effect = 2;
5470 else if (one_in_(3)) effect = 3;
5475 /* Powerful monsters can resist */
5476 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5477 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5480 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5482 note = " is unaffected!";
5488 /* Normal monsters slow down */
5491 if (set_monster_slow(c_ptr->m_idx, MON_SLOW(m_ptr) + 50))
5494 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
5496 note = " starts moving slower.";
5502 else if (effect == 2)
5504 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
5506 /* Attempt a saving throw */
5507 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
5508 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5513 /* No obvious effect */
5515 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5517 note = " is unaffected!";
5524 else if (effect == 3)
5526 /* Attempt a saving throw */
5527 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5528 (r_ptr->flags3 & RF3_NO_SLEEP) ||
5529 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5531 /* Memorize a flag */
5532 if (r_ptr->flags3 & RF3_NO_SLEEP)
5534 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
5537 /* No obvious effect */
5539 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5541 note = " is unaffected!";
5548 /* Go to sleep (much) later */
5550 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5552 note = " falls asleep!";
5562 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5564 note = " is immune!";
5568 /* No "real" damage */
5576 if (seen) obvious = TRUE;
5578 if (r_ptr->flagsr & RFR_RES_ALL)
5581 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5583 note = " is immune.";
5586 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5591 if (genocide_aux(c_ptr->m_idx, dam, !who, (r_ptr->level + 1) / 2, "¥â¥ó¥¹¥¿¡¼¾ÃÌÇ"))
5593 if (genocide_aux(c_ptr->m_idx, dam, !who, (r_ptr->level + 1) / 2, "Genocide One"))
5597 if (seen_msg) msg_format("%s¤Ï¾ÃÌǤ·¤¿¡ª", m_name);
5599 if (seen_msg) msg_format("%^s disappered!", m_name);
5601 chg_virtue(V_VITALITY, -1);
5612 if (!who) msg_format("%s¤ò¼Ì¿¿¤Ë»£¤Ã¤¿¡£", m_name);
5614 if (!who) msg_format("You take a photograph of %s.", m_name);
5617 if (r_ptr->flags3 & (RF3_HURT_LITE))
5619 /* Obvious effect */
5620 if (seen) obvious = TRUE;
5622 /* Memorize the effects */
5623 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
5625 /* Special effect */
5627 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
5628 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5630 note = " cringes from the light!";
5631 note_dies = " shrivels away in the light!";
5635 /* Normally no damage */
5642 photo = m_ptr->r_idx;
5649 case GF_BLOOD_CURSE:
5651 if (seen) obvious = TRUE;
5653 if (r_ptr->flagsr & RFR_RES_ALL)
5656 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5658 note = " is immune.";
5661 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5669 bool success = FALSE;
5670 if (seen) obvious = TRUE;
5672 if ((r_ptr->flags3 & (RF3_GOOD)) && !p_ptr->inside_arena)
5674 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 50;
5675 if (dam < 1) dam = 1;
5677 /* No need to tame your pet */
5681 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
5683 note = " starts moving faster.";
5686 (void)set_monster_fast(c_ptr->m_idx, MON_FAST(m_ptr) + 100);
5690 /* Attempt a saving throw */
5691 else if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
5692 (r_ptr->flags1 & (RF1_UNIQUE)) ||
5693 (m_ptr->mflag2 & MFLAG2_NOPET) ||
5694 (p_ptr->cursed & TRC_AGGRAVATE) ||
5695 ((r_ptr->level+10) > randint1(dam)))
5698 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
5703 note = "¤ò»ÙÇÛ¤·¤¿¡£";
5705 note = " is tamed!";
5709 (void)set_monster_fast(c_ptr->m_idx, MON_FAST(m_ptr) + 100);
5711 /* Learn about type */
5712 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
5719 if (!(r_ptr->flags3 & RF3_NO_FEAR))
5721 do_fear = randint1(90)+10;
5723 else if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_FEAR);
5726 /* No "real" damage */
5733 if (seen) obvious = TRUE;
5735 if (r_ptr->flagsr & RFR_RES_ALL)
5738 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5740 note = " is immune.";
5743 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5747 /* Attempt a saving throw */
5748 if (randint0(100 + dam) < (r_ptr->level + 50))
5752 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5754 note = "is unaffected!";
5775 /* Absolutely no effect */
5776 if (skipped) return (FALSE);
5778 /* "Unique" monsters cannot be polymorphed */
5779 if (r_ptr->flags1 & (RF1_UNIQUE)) do_poly = FALSE;
5781 /* Quest monsters cannot be polymorphed */
5782 if (r_ptr->flags1 & RF1_QUESTOR) do_poly = FALSE;
5784 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_poly = FALSE;
5786 /* "Unique" and "quest" monsters can only be "killed" by the player. */
5787 if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & RF7_NAZGUL)) && !p_ptr->inside_battle)
5789 if (who && (dam > m_ptr->hp)) dam = m_ptr->hp;
5794 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_COMPASSION, -1);
5795 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_HONOUR, -1);
5798 /* Modify the damage */
5800 dam = mon_damage_mod(m_ptr, dam, (bool)(typ == GF_PSY_SPEAR));
5802 if ((tmp > 0) && (dam == 0)) note = "¤Ï¥À¥á¡¼¥¸¤ò¼õ¤±¤Æ¤¤¤Ê¤¤¡£";
5804 if ((tmp > 0) && (dam == 0)) note = " is unharmed.";
5807 /* Check for death */
5808 if (dam > m_ptr->hp)
5810 /* Extract method of death */
5815 /* Sound and Impact resisters never stun */
5817 !(r_ptr->flagsr & (RFR_RES_SOUN | RFR_RES_WALL)) &&
5818 !(r_ptr->flags3 & RF3_NO_STUN))
5821 if (seen) obvious = TRUE;
5824 if (MON_STUNNED(m_ptr))
5827 note = "¤Ï¤Ò¤É¤¯¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5829 note = " is more dazed.";
5832 tmp = MON_STUNNED(m_ptr) + (do_stun / 2);
5837 note = "¤Ï¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5839 note = " is dazed.";
5846 (void)set_monster_stunned(c_ptr->m_idx, tmp);
5852 /* Confusion and Chaos resisters (and sleepers) never confuse */
5854 !(r_ptr->flags3 & RF3_NO_CONF) &&
5855 !(r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK))
5858 if (seen) obvious = TRUE;
5860 /* Already partially confused */
5861 if (MON_CONFUSED(m_ptr))
5864 note = "¤Ï¤µ¤é¤Ëº®Í𤷤¿¤è¤¦¤À¡£";
5866 note = " looks more confused.";
5869 tmp = MON_CONFUSED(m_ptr) + (do_conf / 2);
5872 /* Was not confused */
5876 note = "¤Ïº®Í𤷤¿¤è¤¦¤À¡£";
5878 note = " looks confused.";
5884 /* Apply confusion */
5885 (void)set_monster_confused(c_ptr->m_idx, tmp);
5894 if (seen) obvious = TRUE;
5896 if (do_time >= m_ptr->maxhp) do_time = m_ptr->maxhp - 1;
5901 note = "¤Ï¼å¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£";
5903 note = " seems weakened.";
5905 m_ptr->maxhp -= do_time;
5906 if ((m_ptr->hp - dam) > m_ptr->maxhp) dam = m_ptr->hp - m_ptr->maxhp;
5911 /* Mega-Hack -- Handle "polymorph" -- monsters get a saving throw */
5912 if (do_poly && (randint1(90) > r_ptr->level))
5914 if (polymorph_monster(y, x))
5917 if (seen) obvious = TRUE;
5919 /* Monster polymorphs */
5921 note = "¤¬ÊѿȤ·¤¿¡ª";
5926 /* Turn off the damage */
5933 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5935 note = " is unaffected!";
5939 /* Hack -- Get new monster */
5940 m_ptr = &m_list[c_ptr->m_idx];
5942 /* Hack -- Get new race */
5943 r_ptr = &r_info[m_ptr->r_idx];
5946 /* Handle "teleport" */
5950 if (seen) obvious = TRUE;
5954 note = "¤¬¾Ã¤¨µî¤Ã¤¿¡ª";
5956 note = " disappears!";
5959 if (!who) chg_virtue(V_VALOUR, -1);
5962 teleport_away(c_ptr->m_idx, do_dist,
5963 (!who ? TELEPORT_DEC_VALOUR : 0L) | TELEPORT_PASSIVE);
5965 /* Hack -- get new location */
5969 /* Hack -- get new grid */
5970 c_ptr = &cave[y][x];
5977 (void)set_monster_monfear(c_ptr->m_idx, MON_MONFEAR(m_ptr) + do_fear);
5984 if (typ == GF_DRAIN_MANA)
5986 /* Drain mana does nothing */
5989 /* If another monster did the damage, hurt the monster by hand */
5992 /* Redraw (later) if needed */
5993 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
5994 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
5996 /* Wake the monster up */
5997 (void)set_monster_csleep(c_ptr->m_idx, 0);
5999 /* Hurt the monster */
6007 if (is_pet(m_ptr) && !(m_ptr->ml))
6010 /* Give detailed messages if destroyed */
6013 monster_desc(m_name, m_ptr, MD_TRUE_NAME);
6016 msg_format("%^s%s", m_name, note);
6024 monster_gain_exp(who, m_ptr->r_idx);
6026 /* Generate treasure, etc */
6027 monster_death(c_ptr->m_idx, FALSE);
6029 /* Delete the monster */
6030 delete_monster_idx(c_ptr->m_idx);
6035 msg_print("¾¯¤·Èᤷ¤¤µ¤Ê¬¤¬¤·¤¿¡£");
6037 msg_print("You feel sad for a moment.");
6042 /* Damaged monster */
6045 /* Give detailed messages if visible or destroyed */
6046 if (note && seen_msg) msg_format("%^s%s", m_name, note);
6048 /* Hack -- Pain message */
6051 message_pain(c_ptr->m_idx, dam);
6058 /* Hack -- handle sleep */
6059 if (do_sleep) (void)set_monster_csleep(c_ptr->m_idx, do_sleep);
6063 else if (heal_leper)
6066 if (seen_msg) msg_print("ÉÔ·é¤ÊÉ¿ͤÏɵ¤¤¬¼£¤Ã¤¿¡ª");
6068 if (seen_msg) msg_print("The Mangy looking leper is healed!");
6071 delete_monster_idx(c_ptr->m_idx);
6074 /* If the player did it, give him experience, check fear */
6079 /* Hurt the monster, check for fear and death */
6080 if (mon_take_hit(c_ptr->m_idx, dam, &fear, note_dies))
6085 /* Damaged monster */
6088 /* HACK - anger the monster before showing the sleep message */
6089 if (do_sleep) anger_monster(m_ptr);
6091 /* Give detailed messages if visible or destroyed */
6092 if (note && seen_msg)
6094 msg_format("%s%s", m_name, note);
6096 msg_format("%^s%s", m_name, note);
6100 /* Hack -- Pain message */
6101 else if (known && (dam || !do_fear))
6103 message_pain(c_ptr->m_idx, dam);
6106 /* Anger monsters */
6107 if (((dam > 0) || get_angry) && !do_sleep)
6108 anger_monster(m_ptr);
6111 if ((fear || do_fear) && seen)
6118 msg_format("%^s¤Ï¶²Éݤ·¤Æƨ¤²½Ð¤·¤¿¡ª", m_name);
6120 msg_format("%^s flees in terror!", m_name);
6124 /* Hack -- handle sleep */
6125 if (do_sleep) (void)set_monster_csleep(c_ptr->m_idx, do_sleep);
6129 if ((typ == GF_BLOOD_CURSE) && one_in_(4))
6131 int curse_flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
6135 switch (randint1(28))
6141 msg_print("ÃÏÌ̤¬Íɤ줿...");
6143 msg_print("The ground trembles...");
6146 earthquake(ty, tx, 4 + randint0(4));
6147 if (!one_in_(6)) break;
6149 case 3: case 4: case 5: case 6:
6152 int dam = damroll(10, 10);
6154 msg_print("½ã¿è¤ÊËâÎϤμ¡¸µ¤Ø¤ÎÈ⤬³«¤¤¤¿¡ª");
6156 msg_print("A portal opens to a plane of raw mana!");
6159 project(0, 8, ty,tx, dam, GF_MANA, curse_flg, -1);
6160 if (!one_in_(6)) break;
6166 msg_print("¶õ´Ö¤¬ÏĤó¤À¡ª");
6168 msg_print("Space warps about you!");
6171 if (m_ptr->r_idx) teleport_away(c_ptr->m_idx, damroll(10, 10), TELEPORT_PASSIVE);
6172 if (one_in_(13)) count += activate_hi_summon(ty, tx, TRUE);
6173 if (!one_in_(6)) break;
6175 case 9: case 10: case 11:
6177 msg_print("¥¨¥Í¥ë¥®¡¼¤Î¤¦¤Í¤ê¤ò´¶¤¸¤¿¡ª");
6179 msg_print("You feel a surge of energy!");
6182 project(0, 7, ty, tx, 50, GF_DISINTEGRATE, curse_flg, -1);
6183 if (!one_in_(6)) break;
6184 case 12: case 13: case 14: case 15: case 16:
6185 aggravate_monsters(0);
6186 if (!one_in_(6)) break;
6188 count += activate_hi_summon(ty, tx, TRUE);
6189 if (!one_in_(6)) break;
6190 case 19: case 20: case 21: case 22:
6192 bool pet = !one_in_(3);
6193 u32b mode = PM_ALLOW_GROUP;
6195 if (pet) mode |= PM_FORCE_PET;
6196 else mode |= (PM_NO_PET | PM_FORCE_FRIENDLY);
6198 count += summon_specific((pet ? -1 : 0), py, px, (pet ? p_ptr->lev*2/3+randint1(p_ptr->lev/2) : dun_level), 0, mode);
6199 if (!one_in_(6)) break;
6201 case 23: case 24: case 25:
6202 if (p_ptr->hold_life && (randint0(100) < 75)) break;
6204 msg_print("À¸Ì¿ÎϤ¬ÂΤ«¤éµÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
6206 msg_print("You feel your life draining away...");
6209 if (p_ptr->hold_life) lose_exp(p_ptr->exp / 160);
6210 else lose_exp(p_ptr->exp / 16);
6211 if (!one_in_(6)) break;
6212 case 26: case 27: case 28:
6221 (void)do_dec_stat(i);
6230 (void)do_dec_stat(randint0(6));
6239 if (p_ptr->inside_battle)
6241 p_ptr->health_who = c_ptr->m_idx;
6242 p_ptr->redraw |= (PR_HEALTH);
6246 /* XXX XXX XXX Verify this code */
6248 /* Update the monster */
6249 if (m_ptr->r_idx) update_mon(c_ptr->m_idx, FALSE);
6251 /* Redraw the monster grid */
6255 /* Update monster recall window */
6256 if ((p_ptr->monster_race_idx == m_ptr->r_idx) && (seen || !m_ptr->r_idx))
6259 p_ptr->window |= (PW_MONSTER);
6262 if ((dam > 0) && !is_pet(m_ptr) && !is_friendly(m_ptr))
6266 if (!projectable(m_ptr->fy, m_ptr->fx, py, px) && !(flg & PROJECT_NO_HANGEKI))
6268 set_target(m_ptr, monster_target_y, monster_target_x);
6271 else if ((who > 0) && is_pet(caster_ptr) && !player_bold(m_ptr->target_y, m_ptr->target_x))
6273 set_target(m_ptr, caster_ptr->fy, caster_ptr->fx);
6277 if (p_ptr->riding && (p_ptr->riding == c_ptr->m_idx) && (dam > 0))
6279 if (m_ptr->hp > m_ptr->maxhp/3) dam = (dam + 1) / 2;
6280 rakubadam_m = (dam > 200) ? 200 : dam;
6289 /* Get local object */
6292 /* Prepare to make a Blade of Chaos */
6293 object_prep(q_ptr, lookup_kind(TV_STATUE, SV_PHOTO));
6295 q_ptr->pval = photo;
6297 /* Mark the item as fully known */
6298 q_ptr->ident |= (IDENT_MENTAL);
6300 /* Drop it in the dungeon */
6301 (void)drop_near(q_ptr, -1, py, px);
6309 /* Return "Anything seen?" */
6315 * Helper function for "project()" below.
6317 * Handle a beam/bolt/ball causing damage to the player.
6319 * This routine takes a "source monster" (by index), a "distance", a default
6320 * "damage", and a "damage type". See "project_m()" above.
6322 * If "rad" is non-zero, then the blast was centered elsewhere, and the damage
6323 * is reduced (see "project_m()" above). This can happen if a monster breathes
6324 * at the player and hits a wall instead.
6326 * NOTE (Zangband): 'Bolt' attacks can be reflected back, so we need
6327 * to know if this is actually a ball or a bolt spell
6330 * We return "TRUE" if any "obvious" effects were observed. XXX XXX Actually,
6331 * we just assume that the effects were obvious, for historical reasons.
6333 static bool project_p(int who, cptr who_name, int r, int y, int x, int dam, int typ, int flg, int monspell)
6338 /* Hack -- assume obvious */
6339 bool obvious = TRUE;
6341 /* Player blind-ness */
6342 bool blind = (p_ptr->blind ? TRUE : FALSE);
6344 /* Player needs a "description" (he is blind) */
6347 /* Source monster */
6348 monster_type *m_ptr = NULL;
6350 /* Monster name (for attacks) */
6353 /* Monster name (for damage) */
6356 /* Hack -- messages */
6362 /* Player is not here */
6363 if (!player_bold(y, x)) return (FALSE);
6365 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && (randint0(55) < (p_ptr->lev*3/5+20)) && who && (who != p_ptr->riding))
6371 /* Player cannot hurt himself */
6372 if (!who) return (FALSE);
6373 if (who == p_ptr->riding) return (FALSE);
6375 if ((p_ptr->reflect || ((p_ptr->special_defense & KATA_FUUJIN) && !p_ptr->blind)) && (flg & PROJECT_REFLECTABLE) && !one_in_(10))
6378 int max_attempts = 10;
6381 if (blind) msg_print("²¿¤«¤¬Ä·¤ÍÊ֤ä¿¡ª");
6382 else if (p_ptr->special_defense & KATA_FUUJIN) msg_print("É÷¤ÎÇ¡¤¯Éð´ï¤ò¿¶¤ë¤Ã¤ÆÃƤÊÖ¤·¤¿¡ª");
6383 else msg_print("¹¶·â¤¬Ä·¤ÍÊ֤ä¿¡ª");
6385 if (blind) msg_print("Something bounces!");
6386 else msg_print("The attack bounces!");
6390 /* Choose 'new' target */
6395 t_y = m_list[who].fy - 1 + randint1(3);
6396 t_x = m_list[who].fx - 1 + randint1(3);
6399 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(py, px, t_y, t_x));
6401 if (max_attempts < 1)
6403 t_y = m_list[who].fy;
6404 t_x = m_list[who].fx;
6409 t_y = py - 1 + randint1(3);
6410 t_x = px - 1 + randint1(3);
6413 project(0, 0, t_y, t_x, dam, typ, (PROJECT_STOP|PROJECT_KILL|PROJECT_REFLECTABLE), monspell);
6420 /* Limit maximum damage */
6421 if (dam > 1600) dam = 1600;
6423 /* Reduce damage by distance */
6424 dam = (dam + r) / (r + 1);
6427 /* If the player is blind, be more descriptive */
6428 if (blind) fuzzy = TRUE;
6433 /* Get the source monster */
6434 m_ptr = &m_list[who];
6435 /* Extract the monster level */
6436 rlev = (((&r_info[m_ptr->r_idx])->level >= 1) ? (&r_info[m_ptr->r_idx])->level : 1);
6438 /* Get the monster name */
6439 monster_desc(m_name, m_ptr, 0);
6441 /* Get the monster's real name (gotten before polymorph!) */
6442 strcpy(killer, who_name);
6448 case PROJECT_WHO_UNCTRL_POWER:
6450 strcpy(killer, "À©¸æ¤Ç¤¤Ê¤¤ÎϤÎÈÅή");
6452 strcpy(killer, "uncontrollable power storm");
6456 case PROJECT_WHO_GLASS_SHARDS:
6458 strcpy(killer, "¥¬¥é¥¹¤ÎÇËÊÒ");
6460 strcpy(killer, "shards of glass");
6466 strcpy(killer, "æ«");
6468 strcpy(killer, "a trap");
6474 strcpy(m_name, killer);
6477 /* Analyze the damage */
6480 /* Standard damage -- hurts inventory too */
6484 if (fuzzy) msg_print("»À¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6486 if (fuzzy) msg_print("You are hit by acid!");
6489 get_damage = acid_dam(dam, killer, monspell);
6493 /* Standard damage -- hurts inventory too */
6497 if (fuzzy) msg_print("²Ð±ê¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6499 if (fuzzy) msg_print("You are hit by fire!");
6502 get_damage = fire_dam(dam, killer, monspell);
6506 /* Standard damage -- hurts inventory too */
6510 if (fuzzy) msg_print("Î䵤¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6512 if (fuzzy) msg_print("You are hit by cold!");
6515 get_damage = cold_dam(dam, killer, monspell);
6519 /* Standard damage -- hurts inventory too */
6523 if (fuzzy) msg_print("ÅÅ·â¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6525 if (fuzzy) msg_print("You are hit by lightning!");
6528 get_damage = elec_dam(dam, killer, monspell);
6532 /* Standard damage -- also poisons player */
6535 bool double_resist = IS_OPPOSE_POIS();
6537 if (fuzzy) msg_print("ÆǤǹ¶·â¤µ¤ì¤¿¡ª");
6539 if (fuzzy) msg_print("You are hit by poison!");
6542 if (p_ptr->resist_pois) dam = (dam + 2) / 3;
6543 if (double_resist) dam = (dam + 2) / 3;
6545 if ((!(double_resist || p_ptr->resist_pois)) &&
6546 one_in_(HURT_CHANCE))
6551 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6553 if (!(double_resist || p_ptr->resist_pois))
6555 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6560 /* Standard damage -- also poisons / mutates player */
6563 bool double_resist = IS_OPPOSE_POIS();
6565 if (fuzzy) msg_print("Êü¼Íǽ¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6567 if (fuzzy) msg_print("You are hit by radiation!");
6570 if (p_ptr->resist_pois) dam = (2 * dam + 2) / 5;
6571 if (double_resist) dam = (2 * dam + 2) / 5;
6572 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6573 if (!(double_resist || p_ptr->resist_pois))
6575 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6577 if (one_in_(5)) /* 6 */
6580 msg_print("´ñ·ÁŪ¤ÊÊѿȤò¿ë¤²¤¿¡ª");
6582 msg_print("You undergo a freakish metamorphosis!");
6585 if (one_in_(4)) /* 4 */
6593 inven_damage(set_acid_destroy, 2);
6599 /* Standard damage */
6603 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6605 if (fuzzy) msg_print("You are hit by something!");
6608 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6612 /* Holy Orb -- Player only takes partial damage */
6616 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6618 if (fuzzy) msg_print("You are hit by something!");
6621 if (p_ptr->align > 10)
6623 else if (p_ptr->align < -10)
6625 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6632 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6634 if (fuzzy) msg_print("You are hit by something!");
6637 if (p_ptr->align > 10)
6639 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6643 /* Arrow -- XXX no dodging */
6647 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6649 if (fuzzy) msg_print("You are hit by something sharp!");
6652 else if ((inventory[INVEN_RARM].name1 == ART_ZANTETSU) || (inventory[INVEN_LARM].name1 == ART_ZANTETSU))
6655 msg_print("Ìð¤ò»Â¤ê¼Î¤Æ¤¿¡ª");
6657 msg_print("You cut down the arrow!");
6661 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6665 /* Plasma -- XXX No resist */
6669 if (fuzzy) msg_print("²¿¤«¤È¤Æ¤âÇ®¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6671 if (fuzzy) msg_print("You are hit by something *HOT*!");
6674 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6676 if (!p_ptr->resist_sound)
6678 int k = (randint1((dam > 40) ? 35 : (dam * 3 / 4 + 5)));
6679 (void)set_stun(p_ptr->stun + k);
6682 if (!(p_ptr->resist_fire ||
6684 p_ptr->immune_fire))
6686 inven_damage(set_acid_destroy, 3);
6692 /* Nether -- drain experience */
6696 if (fuzzy) msg_print("ÃϹö¤ÎÎϤǹ¶·â¤µ¤ì¤¿¡ª");
6698 if (fuzzy) msg_print("You are hit by nether forces!");
6702 if (p_ptr->resist_neth)
6704 if (!prace_is_(RACE_SPECTRE))
6705 dam *= 6; dam /= (randint1(4) + 7);
6707 else drain_exp(200 + (p_ptr->exp / 100), 200 + (p_ptr->exp / 1000), 75);
6709 if (prace_is_(RACE_SPECTRE))
6712 msg_print("µ¤Ê¬¤¬¤è¤¯¤Ê¤Ã¤¿¡£");
6714 msg_print("You feel invigorated!");
6718 learn_spell(monspell);
6722 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6728 /* Water -- stun/confuse */
6732 if (fuzzy) msg_print("²¿¤«¼¾¤Ã¤¿¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6734 if (fuzzy) msg_print("You are hit by something wet!");
6737 if (!p_ptr->resist_sound)
6739 set_stun(p_ptr->stun + randint1(40));
6741 if (!p_ptr->resist_conf)
6743 set_confused(p_ptr->confused + randint1(5) + 5);
6748 inven_damage(set_cold_destroy, 3);
6751 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6755 /* Chaos -- many effects */
6759 if (fuzzy) msg_print("̵Ãá½ø¤ÎÇÈÆ°¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6761 if (fuzzy) msg_print("You are hit by a wave of anarchy!");
6764 if (p_ptr->resist_chaos)
6766 dam *= 6; dam /= (randint1(4) + 7);
6768 if (!p_ptr->resist_conf)
6770 (void)set_confused(p_ptr->confused + randint0(20) + 10);
6772 if (!p_ptr->resist_chaos)
6774 (void)set_image(p_ptr->image + randint1(10));
6778 msg_print("¤¢¤Ê¤¿¤Î¿ÈÂΤϥ«¥ª¥¹¤ÎÎϤÇDZ¤¸¶Ê¤²¤é¤ì¤¿¡ª");
6780 msg_print("Your body is twisted by chaos!");
6783 (void)gain_random_mutation(0);
6786 if (!p_ptr->resist_neth && !p_ptr->resist_chaos)
6788 drain_exp(5000 + (p_ptr->exp / 100), 500 + (p_ptr->exp / 1000), 75);
6790 if (!p_ptr->resist_chaos || one_in_(9))
6792 inven_damage(set_elec_destroy, 2);
6793 inven_damage(set_fire_destroy, 2);
6795 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6799 /* Shards -- mostly cutting */
6803 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6805 if (fuzzy) msg_print("You are hit by something sharp!");
6808 if (p_ptr->resist_shard)
6810 dam *= 6; dam /= (randint1(4) + 7);
6814 (void)set_cut(p_ptr->cut + dam);
6817 if (!p_ptr->resist_shard || one_in_(13))
6819 inven_damage(set_cold_destroy, 2);
6822 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6826 /* Sound -- mostly stunning */
6830 if (fuzzy) msg_print("¹ì²»¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6832 if (fuzzy) msg_print("You are hit by a loud noise!");
6835 if (p_ptr->resist_sound)
6837 dam *= 5; dam /= (randint1(4) + 7);
6841 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
6842 (void)set_stun(p_ptr->stun + k);
6845 if (!p_ptr->resist_sound || one_in_(13))
6847 inven_damage(set_cold_destroy, 2);
6850 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6854 /* Pure confusion */
6858 if (fuzzy) msg_print("²¿¤«º®Í𤹤ë¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6860 if (fuzzy) msg_print("You are hit by something puzzling!");
6863 if (p_ptr->resist_conf)
6865 dam *= 5; dam /= (randint1(4) + 7);
6867 if (!p_ptr->resist_conf)
6869 (void)set_confused(p_ptr->confused + randint1(20) + 10);
6871 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6875 /* Disenchantment -- see above */
6879 if (fuzzy) msg_print("²¿¤«¤µ¤¨¤Ê¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6881 if (fuzzy) msg_print("You are hit by something static!");
6884 if (p_ptr->resist_disen)
6886 dam *= 6; dam /= (randint1(4) + 7);
6890 (void)apply_disenchant(0);
6892 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6896 /* Nexus -- see above */
6900 if (fuzzy) msg_print("²¿¤«´ñ̯¤Ê¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6902 if (fuzzy) msg_print("You are hit by something strange!");
6905 if (p_ptr->resist_nexus)
6907 dam *= 6; dam /= (randint1(4) + 7);
6913 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6917 /* Force -- mostly stun */
6921 if (fuzzy) msg_print("±¿Æ°¥¨¥Í¥ë¥®¡¼¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6923 if (fuzzy) msg_print("You are hit by kinetic force!");
6926 if (!p_ptr->resist_sound)
6928 (void)set_stun(p_ptr->stun + randint1(20));
6930 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6935 /* Rocket -- stun, cut */
6939 if (fuzzy) msg_print("Çúȯ¤¬¤¢¤Ã¤¿¡ª");
6941 if (fuzzy) msg_print("There is an explosion!");
6944 if (!p_ptr->resist_sound)
6946 (void)set_stun(p_ptr->stun + randint1(20));
6948 if (p_ptr->resist_shard)
6954 (void)set_cut(p_ptr-> cut + ( dam / 2));
6957 if ((!p_ptr->resist_shard) || one_in_(12))
6959 inven_damage(set_cold_destroy, 3);
6962 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6966 /* Inertia -- slowness */
6970 if (fuzzy) msg_print("²¿¤«ÃÙ¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6972 if (fuzzy) msg_print("You are hit by something slow!");
6975 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
6976 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6980 /* Lite -- blinding */
6984 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6986 if (fuzzy) msg_print("You are hit by something!");
6989 if (p_ptr->resist_lite)
6991 dam *= 4; dam /= (randint1(4) + 7);
6993 else if (!blind && !p_ptr->resist_blind)
6995 (void)set_blind(p_ptr->blind + randint1(5) + 2);
6997 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
7000 msg_print("¸÷¤ÇÆùÂΤ¬¾Ç¤¬¤µ¤ì¤¿¡ª");
7002 msg_print("The light scorches your flesh!");
7007 else if (prace_is_(RACE_S_FAIRY))
7011 if (p_ptr->wraith_form) dam *= 2;
7012 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7014 if (p_ptr->wraith_form)
7016 p_ptr->wraith_form = 0;
7018 msg_print("Á®¸÷¤Î¤¿¤áÈóʪ¼ÁŪ¤Ê±Æ¤Î¸ºß¤Ç¤¤¤é¤ì¤Ê¤¯¤Ê¤Ã¤¿¡£");
7020 msg_print("The light forces you out of your incorporeal shadow form.");
7023 p_ptr->redraw |= PR_MAP;
7024 /* Update monsters */
7025 p_ptr->update |= (PU_MONSTERS);
7027 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
7029 /* Redraw status bar */
7030 p_ptr->redraw |= (PR_STATUS);
7037 /* Dark -- blinding */
7041 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7043 if (fuzzy) msg_print("You are hit by something!");
7046 if (p_ptr->resist_dark)
7048 dam *= 4; dam /= (randint1(4) + 7);
7050 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form) dam = 0;
7052 else if (!blind && !p_ptr->resist_blind)
7054 (void)set_blind(p_ptr->blind + randint1(5) + 2);
7056 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7060 /* Time -- bolt fewer effects XXX */
7064 if (fuzzy) msg_print("²áµî¤«¤é¤Î¾×·â¤Ë¹¶·â¤µ¤ì¤¿¡ª");
7066 if (fuzzy) msg_print("You are hit by a blast from the past!");
7069 if (p_ptr->resist_time)
7072 dam /= (randint1(4) + 7);
7074 msg_print("»þ´Ö¤¬Ä̤ê²á¤®¤Æ¤¤¤¯µ¤¤¬¤¹¤ë¡£");
7076 msg_print("You feel as if time is passing you by.");
7082 switch (randint1(10))
7084 case 1: case 2: case 3: case 4: case 5:
7086 if (p_ptr->prace == RACE_ANDROID) break;
7088 msg_print("¿ÍÀ¸¤¬µÕÌá¤ê¤·¤¿µ¤¤¬¤¹¤ë¡£");
7090 msg_print("You feel life has clocked back.");
7093 lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
7097 case 6: case 7: case 8: case 9:
7099 switch (randint1(6))
7102 case 1: k = A_STR; act = "¶¯¤¯"; break;
7103 case 2: k = A_INT; act = "ÁïÌÀ¤Ç"; break;
7104 case 3: k = A_WIS; act = "¸ÌÀ¤Ç"; break;
7105 case 4: k = A_DEX; act = "´ïÍѤÇ"; break;
7106 case 5: k = A_CON; act = "·ò¹¯¤Ç"; break;
7107 case 6: k = A_CHR; act = "Èþ¤·¤¯"; break;
7109 case 1: k = A_STR; act = "strong"; break;
7110 case 2: k = A_INT; act = "bright"; break;
7111 case 3: k = A_WIS; act = "wise"; break;
7112 case 4: k = A_DEX; act = "agile"; break;
7113 case 5: k = A_CON; act = "hale"; break;
7114 case 6: k = A_CHR; act = "beautiful"; break;
7120 msg_format("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤É%s¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£", act);
7122 msg_format("You're not as %s as you used to be...", act);
7126 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 3) / 4;
7127 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
7128 p_ptr->update |= (PU_BONUS);
7135 msg_print("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤ÉÎ϶¯¤¯¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£");
7137 msg_print("You're not as powerful as you used to be...");
7141 for (k = 0; k < 6; k++)
7143 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 7) / 8;
7144 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
7146 p_ptr->update |= (PU_BONUS);
7152 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7156 /* Gravity -- stun plus slowness plus teleport */
7160 if (fuzzy) msg_print("²¿¤«½Å¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7161 msg_print("¼þÊդνÅÎϤ¬¤æ¤¬¤ó¤À¡£");
7163 if (fuzzy) msg_print("You are hit by something heavy!");
7164 msg_print("Gravity warps around you.");
7167 teleport_player(5, TELEPORT_PASSIVE);
7168 if (!p_ptr->levitation)
7169 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7170 if (!(p_ptr->resist_sound || p_ptr->levitation))
7172 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
7173 (void)set_stun(p_ptr->stun + k);
7175 if (p_ptr->levitation)
7177 dam = (dam * 2) / 3;
7180 if (!p_ptr->levitation || one_in_(13))
7182 inven_damage(set_cold_destroy, 2);
7185 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7189 /* Standard damage */
7190 case GF_DISINTEGRATE:
7193 if (fuzzy) msg_print("½ã¿è¤Ê¥¨¥Í¥ë¥®¡¼¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7195 if (fuzzy) msg_print("You are hit by pure energy!");
7198 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7205 if (fuzzy) msg_print("²¿¤é¤«¤Î¹¶·â¤Ë¤è¤Ã¤Æµ¤Ê¬¤¬¤è¤¯¤Ê¤Ã¤¿¡£");
7207 if (fuzzy) msg_print("You are hit by something invigorating!");
7210 (void)hp_player(dam);
7218 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7220 if (fuzzy) msg_print("You are hit by something!");
7223 (void)set_fast(p_ptr->fast + randint1(5), FALSE);
7231 if (fuzzy) msg_print("²¿¤«ÃÙ¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7233 if (fuzzy) msg_print("You are hit by something slow!");
7236 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7242 if (p_ptr->free_act) break;
7244 if (fuzzy) msg_print("̲¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
7246 if (fuzzy) msg_print("You fall asleep!");
7250 if (ironman_nightmare)
7253 msg_print("¶²¤í¤·¤¤¸÷·Ê¤¬Æ¬¤ËÉ⤫¤ó¤Ç¤¤¿¡£");
7255 msg_print("A horrible vision enters your mind.");
7259 /* Pick a nightmare */
7260 get_mon_num_prep(get_nightmare, NULL);
7262 /* Have some nightmares */
7263 have_nightmare(get_mon_num(MAX_DEPTH));
7265 /* Remove the monster restriction */
7266 get_mon_num_prep(NULL, NULL);
7269 set_paralyzed(p_ptr->paralyzed + dam);
7280 if (fuzzy) msg_print("ËâË¡¤Î¥ª¡¼¥é¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7282 if (fuzzy) msg_print("You are hit by an aura of magic!");
7285 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7293 if (fuzzy) msg_print("¥¨¥Í¥ë¥®¡¼¤Î²ô¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7295 if (fuzzy) msg_print("You are hit by an energy!");
7298 get_damage = take_hit(DAMAGE_FORCE, dam, killer, monspell);
7306 if (fuzzy) msg_print("²¿¤«¤¬¶õ¤«¤é¤¢¤Ê¤¿¤ÎƬ¾å¤ËÍî¤Á¤Æ¤¤¿¡ª");
7308 if (fuzzy) msg_print("Something falls from the sky on you!");
7311 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7312 if (!p_ptr->resist_shard || one_in_(13))
7314 if (!p_ptr->immune_fire) inven_damage(set_fire_destroy, 2);
7315 inven_damage(set_cold_destroy, 2);
7321 /* Ice -- cold plus stun plus cuts */
7325 if (fuzzy) msg_print("²¿¤«±Ô¤¯Î䤿¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7327 if (fuzzy) msg_print("You are hit by something sharp and cold!");
7330 cold_dam(dam, killer, monspell);
7331 if (!p_ptr->resist_shard)
7333 (void)set_cut(p_ptr->cut + damroll(5, 8));
7335 if (!p_ptr->resist_sound)
7337 (void)set_stun(p_ptr->stun + randint1(15));
7340 if ((!(p_ptr->resist_cold || IS_OPPOSE_COLD())) || one_in_(12))
7342 if (!p_ptr->immune_cold) inven_damage(set_cold_destroy, 3);
7352 if (fuzzy) msg_print("²¿¤«Èó¾ï¤ËÎ䤿¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7354 if (fuzzy) msg_print("You are hit by something extremely cold!");
7358 if (p_ptr->mimic_form)
7360 if (!(mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
7361 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7366 switch (p_ptr->prace)
7368 /* Some races are immune */
7382 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7398 if (who > 0) msg_format("%^s¤ËÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¼è¤é¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
7399 else msg_print("Àº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¼è¤é¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª");
7401 if (who > 0) msg_format("%^s draws psychic energy from you!", m_name);
7402 else msg_print("Your psychic energy is drawn!");
7406 if (dam >= p_ptr->csp)
7410 p_ptr->csp_frac = 0;
7419 learn_spell(monspell);
7422 p_ptr->redraw |= (PR_MANA);
7425 p_ptr->window |= (PW_PLAYER);
7426 p_ptr->window |= (PW_SPELL);
7430 /* Heal the monster */
7431 if (m_ptr->hp < m_ptr->maxhp)
7434 m_ptr->hp += (6 * dam);
7435 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
7437 /* Redraw (later) if needed */
7438 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
7439 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
7441 /* Special message */
7445 msg_format("%^s¤Ïµ¤Ê¬¤¬Îɤµ¤½¤¦¤À¡£", m_name);
7447 msg_format("%^s appears healthier.", m_name);
7461 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
7464 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7466 msg_print("You resist the effects!");
7468 learn_spell(monspell);
7473 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
7475 msg_print("Your mind is blasted by psyonic energy.");
7478 if (!p_ptr->resist_conf)
7480 (void)set_confused(p_ptr->confused + randint0(4) + 4);
7483 if (!p_ptr->resist_chaos && one_in_(3))
7485 (void)set_image(p_ptr->image + randint0(250) + 150);
7492 p_ptr->csp_frac = 0;
7494 p_ptr->redraw |= PR_MANA;
7496 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7502 case GF_BRAIN_SMASH:
7504 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
7507 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7509 msg_print("You resist the effects!");
7511 learn_spell(monspell);
7516 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
7518 msg_print("Your mind is blasted by psionic energy.");
7525 p_ptr->csp_frac = 0;
7527 p_ptr->redraw |= PR_MANA;
7529 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7530 if (!p_ptr->resist_blind)
7532 (void)set_blind(p_ptr->blind + 8 + randint0(8));
7534 if (!p_ptr->resist_conf)
7536 (void)set_confused(p_ptr->confused + randint0(4) + 4);
7538 if (!p_ptr->free_act)
7540 (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
7542 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7544 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
7545 (void)do_dec_stat(A_INT);
7546 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
7547 (void)do_dec_stat(A_WIS);
7549 if (!p_ptr->resist_chaos)
7551 (void)set_image(p_ptr->image + randint0(250) + 150);
7560 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7563 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7565 msg_print("You resist the effects!");
7567 learn_spell(monspell);
7571 curse_equipment(15, 0);
7572 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7580 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7583 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7585 msg_print("You resist the effects!");
7587 learn_spell(monspell);
7591 curse_equipment(25, MIN(rlev/2-15, 5));
7592 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7600 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7603 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7605 msg_print("You resist the effects!");
7607 learn_spell(monspell);
7611 curse_equipment(33, MIN(rlev/2-15, 15));
7612 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7620 if ((randint0(100 + rlev/2) < p_ptr->skill_sav) && !(m_ptr->r_idx == MON_KENSHIROU))
7623 msg_print("¤·¤«¤·È빦¤òÄ·¤ÍÊÖ¤·¤¿¡ª");
7625 msg_print("You resist the effects!");
7627 learn_spell(monspell);
7631 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7632 (void)set_cut(p_ptr->cut + damroll(10, 10));
7640 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7643 msg_format("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7645 msg_format("You resist the effects!");
7647 learn_spell(monspell);
7652 msg_print("¤¢¤Ê¤¿¤ÏÌ¿¤¬Çö¤Þ¤Ã¤Æ¤¤¤¯¤è¤¦¤Ë´¶¤¸¤¿¡ª");
7654 msg_print("You feel your life fade away!");
7657 get_damage = take_hit(DAMAGE_ATTACK, dam, m_name, monspell);
7658 curse_equipment(40, 20);
7660 if (p_ptr->chp < 1) p_ptr->chp = 1;
7675 if (p_ptr->tim_eyeeye && (get_damage > 0) && !p_ptr->is_dead && (who > 0))
7678 msg_format("¹¶·â¤¬%s¼«¿È¤ò½ý¤Ä¤±¤¿¡ª", m_name);
7680 char m_name_self[80];
7683 monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
7685 msg_format("The attack of %s has wounded %s!", m_name, m_name_self);
7687 project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
7688 set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
7691 if (p_ptr->riding && dam > 0)
7693 rakubadam_p = (dam > 200) ? 200 : dam;
7701 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && who && (who != p_ptr->riding))
7707 /* Return "Anything seen?" */
7713 * Find the distance from (x, y) to a line.
7715 int dist_to_line(int y, int x, int y1, int x1, int y2, int x2)
7717 /* Vector from (x, y) to (x1, y1) */
7726 int pd = distance(y1, x1, y, x);
7727 int nd = distance(y1, x1, y2, x2);
7729 if (pd > nd) return distance(y, x, y2, x2);
7731 /* Component of P on N */
7732 nd = ((nd) ? ((py * ny + px * nx) / nd) : 0);
7734 /* Absolute value */
7735 return((nd >= 0) ? nd : 0 - nd);
7742 * Modified version of los() for calculation of disintegration balls.
7743 * Disintegration effects are stopped by permanent walls.
7745 bool in_disintegration_range(int y1, int x1, int y2, int x2)
7765 /* Slope, or 1/Slope, of LOS */
7769 /* Extract the offset */
7773 /* Extract the absolute offset */
7778 /* Handle adjacent (or identical) grids */
7779 if ((ax < 2) && (ay < 2)) return (TRUE);
7782 /* Paranoia -- require "safe" origin */
7783 /* if (!in_bounds(y1, x1)) return (FALSE); */
7786 /* Directly South/North */
7789 /* South -- check for walls */
7792 for (ty = y1 + 1; ty < y2; ty++)
7794 if (cave_stop_disintegration(ty, x1)) return (FALSE);
7798 /* North -- check for walls */
7801 for (ty = y1 - 1; ty > y2; ty--)
7803 if (cave_stop_disintegration(ty, x1)) return (FALSE);
7811 /* Directly East/West */
7814 /* East -- check for walls */
7817 for (tx = x1 + 1; tx < x2; tx++)
7819 if (cave_stop_disintegration(y1, tx)) return (FALSE);
7823 /* West -- check for walls */
7826 for (tx = x1 - 1; tx > x2; tx--)
7828 if (cave_stop_disintegration(y1, tx)) return (FALSE);
7837 /* Extract some signs */
7838 sx = (dx < 0) ? -1 : 1;
7839 sy = (dy < 0) ? -1 : 1;
7842 /* Vertical "knights" */
7847 if (!cave_stop_disintegration(y1 + sy, x1)) return (TRUE);
7851 /* Horizontal "knights" */
7856 if (!cave_stop_disintegration(y1, x1 + sx)) return (TRUE);
7861 /* Calculate scale factor div 2 */
7864 /* Calculate scale factor */
7868 /* Travel horizontally */
7871 /* Let m = dy / dx * 2 * (dy * dx) = 2 * dy * dy */
7877 /* Consider the special case where slope == 1. */
7888 /* Note (below) the case (qy == f2), where */
7889 /* the LOS exactly meets the corner of a tile. */
7892 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7903 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7916 /* Travel vertically */
7919 /* Let m = dx / dy * 2 * (dx * dy) = 2 * dx * dx */
7935 /* Note (below) the case (qx == f2), where */
7936 /* the LOS exactly meets the corner of a tile. */
7939 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7950 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7971 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)
7976 int brev = rad * rad / dist;
7980 int mdis = distance(y1, x1, y2, x2) + rad;
7982 while (bdis <= mdis)
7986 if ((0 < dist) && (path_n < dist))
7988 int ny = GRID_Y(path_g[path_n]);
7989 int nx = GRID_X(path_g[path_n]);
7990 int nd = distance(ny, nx, y1, x1);
7992 /* Get next base point */
8001 /* Travel from center outward */
8002 for (cdis = 0; cdis <= brad; cdis++)
8004 /* Scan the maximal blast area of radius "cdis" */
8005 for (y = by - cdis; y <= by + cdis; y++)
8007 for (x = bx - cdis; x <= bx + cdis; x++)
8009 /* Ignore "illegal" locations */
8010 if (!in_bounds(y, x)) continue;
8012 /* Enforce a circular "ripple" */
8013 if (distance(y1, x1, y, x) != bdis) continue;
8015 /* Enforce an arc */
8016 if (distance(by, bx, y, x) != cdis) continue;
8022 /* Lights are stopped by opaque terrains */
8023 if (!los(by, bx, y, x)) continue;
8025 case GF_DISINTEGRATE:
8026 /* Disintegration are stopped only by perma-walls */
8027 if (!in_disintegration_range(by, bx, y, x)) continue;
8030 /* Ball explosions are stopped by walls */
8031 if (!projectable(by, bx, y, x)) continue;
8035 /* Save this grid */
8043 /* Encode some more "radius" info */
8044 gm[bdis + 1] = *pgrids;
8046 /* Increase the size */
8047 brad = rad * (path_n + brev) / (dist + brev);
8049 /* Find the next ripple */
8053 /* Store the effect size */
8059 * Generic "beam"/"bolt"/"ball" projection routine.
8062 * who: Index of "source" monster (zero for "player")
8063 * rad: Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
8064 * y,x: Target location (or location to travel "towards")
8065 * dam: Base damage roll to apply to affected monsters (or player)
8066 * typ: Type of damage to apply to monsters (and objects)
8067 * flg: Extra bit flags (see PROJECT_xxxx in "defines.h")
8070 * TRUE if any "effects" of the projection were observed, else FALSE
8072 * Allows a monster (or player) to project a beam/bolt/ball of a given kind
8073 * towards a given location (optionally passing over the heads of interposing
8074 * monsters), and have it do a given amount of damage to the monsters (and
8075 * optionally objects) within the given radius of the final location.
8077 * A "bolt" travels from source to target and affects only the target grid.
8078 * A "beam" travels from source to target, affecting all grids passed through.
8079 * A "ball" travels from source to the target, exploding at the target, and
8080 * affecting everything within the given radius of the target location.
8082 * Traditionally, a "bolt" does not affect anything on the ground, and does
8083 * not pass over the heads of interposing monsters, much like a traditional
8084 * missile, and will "stop" abruptly at the "target" even if no monster is
8085 * positioned there, while a "ball", on the other hand, passes over the heads
8086 * of monsters between the source and target, and affects everything except
8087 * the source monster which lies within the final radius, while a "beam"
8088 * affects every monster between the source and target, except for the casting
8089 * monster (or player), and rarely affects things on the ground.
8091 * Two special flags allow us to use this function in special ways, the
8092 * "PROJECT_HIDE" flag allows us to perform "invisible" projections, while
8093 * the "PROJECT_JUMP" flag allows us to affect a specific grid, without
8094 * actually projecting from the source monster (or player).
8096 * The player will only get "experience" for monsters killed by himself
8097 * Unique monsters can only be destroyed by attacks from the player
8099 * Only 256 grids can be affected per projection, limiting the effective
8100 * "radius" of standard ball attacks to nine units (diameter nineteen).
8102 * One can project in a given "direction" by combining PROJECT_THRU with small
8103 * offsets to the initial location (see "line_spell()"), or by calculating
8104 * "virtual targets" far away from the player.
8106 * One can also use PROJECT_THRU to send a beam/bolt along an angled path,
8107 * continuing until it actually hits somethings (useful for "stone to mud").
8109 * Bolts and Beams explode INSIDE walls, so that they can destroy doors.
8111 * Balls must explode BEFORE hitting walls, or they would affect monsters
8112 * on both sides of a wall. Some bug reports indicate that this is still
8113 * happening in 2.7.8 for Windows, though it appears to be impossible.
8115 * We "pre-calculate" the blast area only in part for efficiency.
8116 * More importantly, this lets us do "explosions" from the "inside" out.
8117 * This results in a more logical distribution of "blast" treasure.
8118 * It also produces a better (in my opinion) animation of the explosion.
8119 * It could be (but is not) used to have the treasure dropped by monsters
8120 * in the middle of the explosion fall "outwards", and then be damaged by
8121 * the blast as it spreads outwards towards the treasure drop location.
8123 * Walls and doors are included in the blast area, so that they can be
8124 * "burned" or "melted" in later versions.
8126 * This algorithm is intended to maximize simplicity, not necessarily
8127 * efficiency, since this function is not a bottleneck in the code.
8129 * We apply the blast effect from ground zero outwards, in several passes,
8130 * first affecting features, then objects, then monsters, then the player.
8131 * This allows walls to be removed before checking the object or monster
8132 * in the wall, and protects objects which are dropped by monsters killed
8133 * in the blast, and allows the player to see all affects before he is
8134 * killed or teleported away. The semantics of this method are open to
8135 * various interpretations, but they seem to work well in practice.
8137 * We process the blast area from ground-zero outwards to allow for better
8138 * distribution of treasure dropped by monsters, and because it provides a
8139 * pleasing visual effect at low cost.
8141 * Note that the damage done by "ball" explosions decreases with distance.
8142 * This decrease is rapid, grids at radius "dist" take "1/dist" damage.
8144 * Notice the "napalm" effect of "beam" weapons. First they "project" to
8145 * the target, and then the damage "flows" along this beam of destruction.
8146 * The damage at every grid is the same as at the "center" of a "ball"
8147 * explosion, since the "beam" grids are treated as if they ARE at the
8148 * center of a "ball" explosion.
8150 * Currently, specifying "beam" plus "ball" means that locations which are
8151 * covered by the initial "beam", and also covered by the final "ball", except
8152 * for the final grid (the epicenter of the ball), will be "hit twice", once
8153 * by the initial beam, and once by the exploding ball. For the grid right
8154 * next to the epicenter, this results in 150% damage being done. The center
8155 * does not have this problem, for the same reason the final grid in a "beam"
8156 * plus "bolt" does not -- it is explicitly removed. Simply removing "beam"
8157 * grids which are covered by the "ball" will NOT work, as then they will
8158 * receive LESS damage than they should. Do not combine "beam" with "ball".
8160 * The array "gy[],gx[]" with current size "grids" is used to hold the
8161 * collected locations of all grids in the "blast area" plus "beam path".
8163 * Note the rather complex usage of the "gm[]" array. First, gm[0] is always
8164 * zero. Second, for N>1, gm[N] is always the index (in gy[],gx[]) of the
8165 * first blast grid (see above) with radius "N" from the blast center. Note
8166 * that only the first gm[1] grids in the blast area thus take full damage.
8167 * Also, note that gm[rad+1] is always equal to "grids", which is the total
8168 * number of blast grids.
8170 * Note that once the projection is complete, (y2,x2) holds the final location
8171 * of bolts/beams, and the "epicenter" of balls.
8173 * Note also that "rad" specifies the "inclusive" radius of projection blast,
8174 * so that a "rad" of "one" actually covers 5 or 9 grids, depending on the
8175 * implementation of the "distance" function. Also, a bolt can be properly
8176 * viewed as a "ball" with a "rad" of "zero".
8178 * Note that if no "target" is reached before the beam/bolt/ball travels the
8179 * maximum distance allowed (MAX_RANGE), no "blast" will be induced. This
8180 * may be relevant even for bolts, since they have a "1x1" mini-blast.
8182 * Note that for consistency, we "pretend" that the bolt actually takes "time"
8183 * to move from point A to point B, even if the player cannot see part of the
8184 * projection path. Note that in general, the player will *always* see part
8185 * of the path, since it either starts at the player or ends on the player.
8187 * Hack -- we assume that every "projection" is "self-illuminating".
8189 * Hack -- when only a single monster is affected, we automatically track
8190 * (and recall) that monster, unless "PROJECT_JUMP" is used.
8192 * Note that all projections now "explode" at their final destination, even
8193 * if they were being projected at a more distant destination. This means
8194 * that "ball" spells will *always* explode.
8196 * Note that we must call "handle_stuff()" after affecting terrain features
8197 * in the blast radius, in case the "illumination" of the grid was changed,
8198 * and "update_view()" and "update_monsters()" need to be called.
8200 bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int monspell)
8210 int y_saver, x_saver; /* For reflecting monsters */
8212 int msec = delay_factor * delay_factor * delay_factor;
8214 /* Assume the player sees nothing */
8215 bool notice = FALSE;
8217 /* Assume the player has seen nothing */
8218 bool visual = FALSE;
8220 /* Assume the player has seen no blast grids */
8223 /* Assume to be a normal ball spell */
8224 bool breath = FALSE;
8226 /* Is the player blind? */
8227 bool blind = (p_ptr->blind ? TRUE : FALSE);
8229 bool old_hide = FALSE;
8231 /* Number of grids in the "path" */
8234 /* Actual grids in the "path" */
8237 /* Number of grids in the "blast area" (including the "beam" path) */
8240 /* Coordinates of the affected grids */
8241 byte gx[1024], gy[1024];
8243 /* Encoded "radius" info (see above) */
8246 /* Actual radius encoded in gm[] */
8251 /* Attacker's name (prepared before polymorph)*/
8254 /* Can the player see the source of this effect? */
8255 bool see_s_msg = TRUE;
8257 /* Initialize by null string */
8263 /* Default target of monsterspell is player */
8264 monster_target_y=py;
8265 monster_target_x=px;
8267 /* Hack -- Jump to target */
8268 if (flg & (PROJECT_JUMP))
8273 /* Clear the flag */
8274 flg &= ~(PROJECT_JUMP);
8279 /* Start at player */
8286 /* Start at monster */
8289 x1 = m_list[who].fx;
8290 y1 = m_list[who].fy;
8291 monster_desc(who_name, &m_list[who], MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
8304 /* Default "destination" */
8309 /* Hack -- verify stuff */
8310 if (flg & (PROJECT_THRU))
8312 if ((x1 == x2) && (y1 == y2))
8314 flg &= ~(PROJECT_THRU);
8318 /* Handle a breath attack */
8323 if (flg & PROJECT_HIDE) old_hide = TRUE;
8324 flg |= PROJECT_HIDE;
8328 /* Hack -- Assume there will be no blast (max radius 32) */
8329 for (dist = 0; dist < 32; dist++) gm[dist] = 0;
8337 /* Collect beam grids */
8338 if (flg & (PROJECT_BEAM))
8349 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_LOS);
8351 case GF_DISINTEGRATE:
8352 flg |= (PROJECT_GRID);
8353 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_DISI);
8357 /* Calculate the projection path */
8359 path_n = project_path(path_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, flg);
8361 /* Hack -- Handle stuff */
8364 /* Giga-Hack SEEKER & SUPER_RAY */
8366 if( typ == GF_SEEKER )
8376 for (i = 0; i < path_n; ++i)
8381 int ny = GRID_Y(path_g[i]);
8382 int nx = GRID_X(path_g[i]);
8393 /* Only do visuals if requested */
8394 if (!blind && !(flg & (PROJECT_HIDE)))
8396 /* Only do visuals if the player can "see" the bolt */
8397 if (panel_contains(y, x) && player_has_los_bold(y, x))
8404 /* Obtain the bolt pict */
8405 p = bolt_pict(oy, ox, y, x, typ);
8407 /* Extract attr/char */
8411 /* Visual effects */
8412 print_rel(c, a, y, x);
8413 move_cursor_relative(y, x);
8414 /*if (fresh_before)*/ Term_fresh();
8415 Term_xtra(TERM_XTRA_DELAY, msec);
8417 /*if (fresh_before)*/ Term_fresh();
8419 /* Display "beam" grids */
8420 if (flg & (PROJECT_BEAM))
8422 /* Obtain the explosion pict */
8423 p = bolt_pict(y, x, y, x, typ);
8425 /* Extract attr/char */
8429 /* Visual effects */
8430 print_rel(c, a, y, x);
8433 /* Hack -- Activate delay */
8437 /* Hack -- delay anyway for consistency */
8440 /* Delay for consistency */
8441 Term_xtra(TERM_XTRA_DELAY, msec);
8444 if(project_o(0,0,y,x,dam,GF_SEEKER))notice=TRUE;
8445 if( is_mirror_grid(&cave[y][x]))
8447 /* The target of monsterspell becomes tha mirror(broken) */
8448 monster_target_y=(s16b)y;
8449 monster_target_x=(s16b)x;
8452 next_mirror( &oy,&ox,y,x );
8454 path_n = i+project_path(&(path_g[i+1]), (project_length ? project_length : MAX_RANGE), y, x, oy, ox, flg);
8455 for( j = last_i; j <=i ; j++ )
8457 y = GRID_Y(path_g[j]);
8458 x = GRID_X(path_g[j]);
8459 if(project_m(0,0,y,x,dam,GF_SEEKER,flg,TRUE))notice=TRUE;
8460 if(!who && (project_m_n==1) && !jump ){
8461 if(cave[project_m_y][project_m_x].m_idx >0 ){
8462 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8464 /* Hack -- auto-recall */
8465 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8467 /* Hack - auto-track */
8468 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8471 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8476 for( i = last_i ; i < path_n ; i++ )
8479 y = GRID_Y(path_g[i]);
8480 x = GRID_X(path_g[i]);
8481 if(project_m(0,0,y,x,dam,GF_SEEKER,flg,TRUE))
8483 if(!who && (project_m_n==1) && !jump ){
8484 if(cave[project_m_y][project_m_x].m_idx >0 ){
8485 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8487 /* Hack -- auto-recall */
8488 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8490 /* Hack - auto-track */
8491 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8494 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8498 else if(typ == GF_SUPER_RAY){
8500 int second_step = 0;
8507 for (i = 0; i < path_n; ++i)
8512 int ny = GRID_Y(path_g[i]);
8513 int nx = GRID_X(path_g[i]);
8524 /* Only do visuals if requested */
8525 if (!blind && !(flg & (PROJECT_HIDE)))
8527 /* Only do visuals if the player can "see" the bolt */
8528 if (panel_contains(y, x) && player_has_los_bold(y, x))
8535 /* Obtain the bolt pict */
8536 p = bolt_pict(oy, ox, y, x, typ);
8538 /* Extract attr/char */
8542 /* Visual effects */
8543 print_rel(c, a, y, x);
8544 move_cursor_relative(y, x);
8545 /*if (fresh_before)*/ Term_fresh();
8546 Term_xtra(TERM_XTRA_DELAY, msec);
8548 /*if (fresh_before)*/ Term_fresh();
8550 /* Display "beam" grids */
8551 if (flg & (PROJECT_BEAM))
8553 /* Obtain the explosion pict */
8554 p = bolt_pict(y, x, y, x, typ);
8556 /* Extract attr/char */
8560 /* Visual effects */
8561 print_rel(c, a, y, x);
8564 /* Hack -- Activate delay */
8568 /* Hack -- delay anyway for consistency */
8571 /* Delay for consistency */
8572 Term_xtra(TERM_XTRA_DELAY, msec);
8575 if(project_o(0,0,y,x,dam,GF_SUPER_RAY) )notice=TRUE;
8576 if (!cave_have_flag_bold(y, x, FF_PROJECT))
8578 if( second_step )continue;
8581 if( is_mirror_grid(&cave[y][x]) && !second_step )
8583 /* The target of monsterspell becomes tha mirror(broken) */
8584 monster_target_y=(s16b)y;
8585 monster_target_x=(s16b)x;
8588 for( j = 0; j <=i ; j++ )
8590 y = GRID_Y(path_g[j]);
8591 x = GRID_X(path_g[j]);
8592 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8596 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x-1, flg);
8597 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x , flg);
8598 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x+1, flg);
8599 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x-1, flg);
8600 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x+1, flg);
8601 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x-1, flg);
8602 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x , flg);
8603 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x+1, flg);
8606 for( i = 0; i < path_n ; i++ )
8609 y = GRID_Y(path_g[i]);
8610 x = GRID_X(path_g[i]);
8611 (void)project_m(0,0,y,x,dam,GF_SUPER_RAY,flg,TRUE);
8612 if(!who && (project_m_n==1) && !jump ){
8613 if(cave[project_m_y][project_m_x].m_idx >0 ){
8614 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8616 /* Hack -- auto-recall */
8617 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8619 /* Hack - auto-track */
8620 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8623 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8628 /* Project along the path */
8629 for (i = 0; i < path_n; ++i)
8634 int ny = GRID_Y(path_g[i]);
8635 int nx = GRID_X(path_g[i]);
8637 if (flg & PROJECT_DISI)
8639 /* Hack -- Balls explode before reaching walls */
8640 if (cave_stop_disintegration(ny, nx) && (rad > 0)) break;
8642 else if (flg & PROJECT_LOS)
8644 /* Hack -- Balls explode before reaching walls */
8645 if (!cave_los_bold(ny, nx) && (rad > 0)) break;
8649 /* Hack -- Balls explode before reaching walls */
8650 if (!cave_have_flag_bold(ny, nx, FF_PROJECT) && (rad > 0)) break;
8657 /* Collect beam grids */
8658 if (flg & (PROJECT_BEAM))
8665 /* Only do visuals if requested */
8666 if (!blind && !(flg & (PROJECT_HIDE | PROJECT_FAST)))
8668 /* Only do visuals if the player can "see" the bolt */
8669 if (panel_contains(y, x) && player_has_los_bold(y, x))
8676 /* Obtain the bolt pict */
8677 p = bolt_pict(oy, ox, y, x, typ);
8679 /* Extract attr/char */
8683 /* Visual effects */
8684 print_rel(c, a, y, x);
8685 move_cursor_relative(y, x);
8686 /*if (fresh_before)*/ Term_fresh();
8687 Term_xtra(TERM_XTRA_DELAY, msec);
8689 /*if (fresh_before)*/ Term_fresh();
8691 /* Display "beam" grids */
8692 if (flg & (PROJECT_BEAM))
8694 /* Obtain the explosion pict */
8695 p = bolt_pict(y, x, y, x, typ);
8697 /* Extract attr/char */
8701 /* Visual effects */
8702 print_rel(c, a, y, x);
8705 /* Hack -- Activate delay */
8709 /* Hack -- delay anyway for consistency */
8712 /* Delay for consistency */
8713 Term_xtra(TERM_XTRA_DELAY, msec);
8720 /* Save the "blast epicenter" */
8724 if (breath && !path_n)
8730 flg &= ~(PROJECT_HIDE);
8734 /* Start the "explosion" */
8737 /* Hack -- make sure beams get to "explode" */
8745 /* If we found a "target", explode there */
8746 if (dist <= MAX_RANGE)
8748 /* Mega-Hack -- remove the final "beam" grid */
8749 if ((flg & (PROJECT_BEAM)) && (grids > 0)) grids--;
8752 * Create a conical breath attack
8763 flg &= ~(PROJECT_HIDE);
8765 breath_shape(path_g, dist, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, by, bx, typ);
8769 /* Determine the blast area, work from the inside out */
8770 for (dist = 0; dist <= rad; dist++)
8772 /* Scan the maximal blast area of radius "dist" */
8773 for (y = by - dist; y <= by + dist; y++)
8775 for (x = bx - dist; x <= bx + dist; x++)
8777 /* Ignore "illegal" locations */
8778 if (!in_bounds2(y, x)) continue;
8780 /* Enforce a "circular" explosion */
8781 if (distance(by, bx, y, x) != dist) continue;
8787 /* Lights are stopped by opaque terrains */
8788 if (!los(by, bx, y, x)) continue;
8790 case GF_DISINTEGRATE:
8791 /* Disintegration are stopped only by perma-walls */
8792 if (!in_disintegration_range(by, bx, y, x)) continue;
8795 /* Ball explosions are stopped by walls */
8796 if (!projectable(by, bx, y, x)) continue;
8800 /* Save this grid */
8807 /* Encode some more "radius" info */
8813 /* Speed -- ignore "non-explosions" */
8814 if (!grids) return (FALSE);
8817 /* Display the "blast area" if requested */
8818 if (!blind && !(flg & (PROJECT_HIDE)))
8820 /* Then do the "blast", from inside out */
8821 for (t = 0; t <= gm_rad; t++)
8823 /* Dump everything with this radius */
8824 for (i = gm[t]; i < gm[t+1]; i++)
8826 /* Extract the location */
8830 /* Only do visuals if the player can "see" the blast */
8831 if (panel_contains(y, x) && player_has_los_bold(y, x))
8840 /* Obtain the explosion pict */
8841 p = bolt_pict(y, x, y, x, typ);
8843 /* Extract attr/char */
8847 /* Visual effects -- Display */
8848 print_rel(c, a, y, x);
8852 /* Hack -- center the cursor */
8853 move_cursor_relative(by, bx);
8855 /* Flush each "radius" seperately */
8856 /*if (fresh_before)*/ Term_fresh();
8858 /* Delay (efficiently) */
8859 if (visual || drawn)
8861 Term_xtra(TERM_XTRA_DELAY, msec);
8865 /* Flush the erasing */
8868 /* Erase the explosion drawn above */
8869 for (i = 0; i < grids; i++)
8871 /* Extract the location */
8875 /* Hack -- Erase if needed */
8876 if (panel_contains(y, x) && player_has_los_bold(y, x))
8882 /* Hack -- center the cursor */
8883 move_cursor_relative(by, bx);
8885 /* Flush the explosion */
8886 /*if (fresh_before)*/ Term_fresh();
8891 /* Update stuff if needed */
8892 if (p_ptr->update) update_stuff();
8895 if (flg & PROJECT_KILL)
8897 see_s_msg = (who > 0) ? is_seen(&m_list[who]) :
8898 (!who ? TRUE : (player_can_see_bold(y1, x1) && projectable(py, px, y1, x1)));
8902 /* Check features */
8903 if (flg & (PROJECT_GRID))
8905 /* Start with "dist" of zero */
8908 /* Scan for features */
8909 for (i = 0; i < grids; i++)
8911 /* Hack -- Notice new "dist" values */
8912 if (gm[dist+1] == i) dist++;
8914 /* Get the grid location */
8918 /* Find the closest point in the blast */
8921 int d = dist_to_line(y, x, y1, x1, by, bx);
8923 /* Affect the grid */
8924 if (project_f(who, d, y, x, dam, typ)) notice = TRUE;
8928 /* Affect the grid */
8929 if (project_f(who, dist, y, x, dam, typ)) notice = TRUE;
8934 /* Update stuff if needed */
8935 if (p_ptr->update) update_stuff();
8938 if (flg & (PROJECT_ITEM))
8940 /* Start with "dist" of zero */
8943 /* Scan for objects */
8944 for (i = 0; i < grids; i++)
8946 /* Hack -- Notice new "dist" values */
8947 if (gm[dist+1] == i) dist++;
8949 /* Get the grid location */
8953 /* Find the closest point in the blast */
8956 int d = dist_to_line(y, x, y1, x1, by, bx);
8958 /* Affect the object in the grid */
8959 if (project_o(who, d, y, x, dam, typ)) notice = TRUE;
8963 /* Affect the object in the grid */
8964 if (project_o(who, dist, y, x, dam, typ)) notice = TRUE;
8970 /* Check monsters */
8971 if (flg & (PROJECT_KILL))
8978 /* Start with "dist" of zero */
8981 /* Scan for monsters */
8982 for (i = 0; i < grids; i++)
8986 /* Hack -- Notice new "dist" values */
8987 if (gm[dist + 1] == i) dist++;
8989 /* Get the grid location */
8993 /* A single bolt may be reflected */
8996 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
8997 monster_race *ref_ptr = &r_info[m_ptr->r_idx];
8999 if ((ref_ptr->flags2 & RF2_REFLECTING) && (flg & PROJECT_REFLECTABLE) && (!who || dist_hack > 1) && !one_in_(10))
9002 int max_attempts = 10;
9004 /* Choose 'new' target */
9007 t_y = y_saver - 1 + randint1(3);
9008 t_x = x_saver - 1 + randint1(3);
9011 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(y, x, t_y, t_x));
9013 if (max_attempts < 1)
9022 if ((m_ptr->r_idx == MON_KENSHIROU) || (m_ptr->r_idx == MON_RAOU))
9023 msg_print("¡ÖËÌÅÍ¿À·ý±üµÁ¡¦Æó»Ø¿¿¶õÇÄ¡ª¡×");
9024 else if (m_ptr->r_idx == MON_DIO) msg_print("¥Ç¥£¥ª¡¦¥Ö¥é¥ó¥É¡¼¤Ï»Ø°ìËܤǹ¶·â¤òÃƤÊÖ¤·¤¿¡ª");
9025 else msg_print("¹¶·â¤ÏÄ·¤ÍÊ֤ä¿¡ª");
9027 msg_print("The attack bounces!");
9030 if (is_original_ap_and_seen(m_ptr)) ref_ptr->r_flags2 |= RF2_REFLECTING;
9032 /* Reflected bolts randomly target either one */
9033 if (one_in_(2)) flg |= PROJECT_PLAYER;
9034 else flg &= ~(PROJECT_PLAYER);
9036 /* The bolt is reflected */
9037 project(cave[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
9039 /* Don't affect the monster any longer */
9045 /* Find the closest point in the blast */
9048 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
9052 effective_dist = dist;
9056 /* There is the riding player on this monster */
9057 if (p_ptr->riding && player_bold(y, x))
9059 /* Aimed on the player */
9060 if (flg & PROJECT_PLAYER)
9062 if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
9065 * A beam or bolt is well aimed
9067 * So don't affects the mount.
9074 * The spell is not well aimed,
9075 * So partly affect the mount too.
9082 * This grid is the original target.
9083 * Or aimed on your horse.
9085 else if (((y == y2) && (x == x2)) || (flg & PROJECT_AIMED))
9087 /* Hit the mount with full damage */
9091 * Otherwise this grid is not the
9092 * original target, it means that line
9093 * of fire is obstructed by this
9097 * A beam or bolt will hit either
9098 * player or mount. Choose randomly.
9100 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE))
9104 /* Hit the mount with full damage */
9108 /* Hit the player later */
9109 flg |= PROJECT_PLAYER;
9111 /* Don't affect the mount */
9117 * The spell is not well aimed, so
9118 * partly affect both player and
9127 /* Affect the monster in the grid */
9128 if (project_m(who, effective_dist, y, x, dam, typ, flg, see_s_msg)) notice = TRUE;
9132 /* Player affected one monster (without "jumping") */
9133 if (!who && (project_m_n == 1) && !jump)
9139 /* Track if possible */
9140 if (cave[y][x].m_idx > 0)
9142 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
9144 /* Hack -- auto-recall */
9145 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
9147 /* Hack - auto-track */
9148 if (m_ptr->ml) health_track(cave[y][x].m_idx);
9155 if (flg & (PROJECT_KILL))
9157 /* Start with "dist" of zero */
9160 /* Scan for player */
9161 for (i = 0; i < grids; i++)
9165 /* Hack -- Notice new "dist" values */
9166 if (gm[dist+1] == i) dist++;
9168 /* Get the grid location */
9172 /* Affect the player? */
9173 if (!player_bold(y, x)) continue;
9175 /* Find the closest point in the blast */
9178 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
9182 effective_dist = dist;
9185 /* Target may be your horse */
9188 /* Aimed on the player */
9189 if (flg & PROJECT_PLAYER)
9191 /* Hit the player with full damage */
9195 * Hack -- When this grid was not the
9196 * original target, a beam or bolt
9197 * would hit either player or mount,
9198 * and should be choosen randomly.
9200 * But already choosen to hit the
9201 * mount at this point.
9203 * Or aimed on your horse.
9205 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
9208 * A beam or bolt is well aimed
9210 * So don't affects the player.
9217 * The spell is not well aimed,
9218 * So partly affect the player too.
9224 /* Affect the player */
9225 if (project_p(who, who_name, effective_dist, y, x, dam, typ, flg, monspell)) notice = TRUE;
9233 monster_desc(m_name, &m_list[p_ptr->riding], 0);
9235 if (rakubadam_m > 0)
9237 if (rakuba(rakubadam_m, FALSE))
9240 msg_format("%^s¤Ë¿¶¤êÍî¤È¤µ¤ì¤¿¡ª", m_name);
9242 msg_format("%^s has thrown you off!", m_name);
9246 if (p_ptr->riding && rakubadam_p > 0)
9248 if(rakuba(rakubadam_p, FALSE))
9251 msg_format("%^s¤«¤éÍî¤Á¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
9253 msg_format("You have fallen from %s.", m_name);
9259 /* Return "something was noticed" */
9263 bool binding_field( int dam )
9265 int mirror_x[10],mirror_y[10]; /* ¶À¤Ï¤â¤Ã¤È¾¯¤Ê¤¤ */
9266 int mirror_num=0; /* ¶À¤Î¿ô */
9271 int msec= delay_factor*delay_factor*delay_factor;
9277 /* Default target of monsterspell is player */
9278 monster_target_y=py;
9279 monster_target_x=px;
9281 for( x=0 ; x < cur_wid ; x++ )
9283 for( y=0 ; y < cur_hgt ; y++ )
9285 if( is_mirror_grid(&cave[y][x]) &&
9286 distance(py,px,y,x) <= MAX_RANGE &&
9287 distance(py,px,y,x) != 0 &&
9288 player_has_los_bold(y,x) &&
9289 projectable(py, px, y, x)
9291 mirror_y[mirror_num]=y;
9292 mirror_x[mirror_num]=x;
9298 if( mirror_num < 2 )return FALSE;
9300 point_x[0] = randint0( mirror_num );
9302 point_x[1] = randint0( mirror_num );
9304 while( point_x[0] == point_x[1] );
9306 point_y[0]=mirror_y[point_x[0]];
9307 point_x[0]=mirror_x[point_x[0]];
9308 point_y[1]=mirror_y[point_x[1]];
9309 point_x[1]=mirror_x[point_x[1]];
9313 x=point_x[0]+point_x[1]+point_x[2];
9314 y=point_y[0]+point_y[1]+point_y[2];
9316 centersign = (point_x[0]*3-x)*(point_y[1]*3-y)
9317 - (point_y[0]*3-y)*(point_x[1]*3-x);
9318 if( centersign == 0 )return FALSE;
9320 x1 = point_x[0] < point_x[1] ? point_x[0] : point_x[1];
9321 x1 = x1 < point_x[2] ? x1 : point_x[2];
9322 y1 = point_y[0] < point_y[1] ? point_y[0] : point_y[1];
9323 y1 = y1 < point_y[2] ? y1 : point_y[2];
9325 x2 = point_x[0] > point_x[1] ? point_x[0] : point_x[1];
9326 x2 = x2 > point_x[2] ? x2 : point_x[2];
9327 y2 = point_y[0] > point_y[1] ? point_y[0] : point_y[1];
9328 y2 = y2 > point_y[2] ? y2 : point_y[2];
9330 for( y=y1 ; y <=y2 ; y++ ){
9331 for( x=x1 ; x <=x2 ; x++ ){
9332 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9333 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9334 centersign*( (point_x[1]-x)*(point_y[2]-y)
9335 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9336 centersign*( (point_x[2]-x)*(point_y[0]-y)
9337 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9339 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9340 /* Visual effects */
9342 && panel_contains(y,x)){
9343 p = bolt_pict(y,x,y,x, GF_MANA );
9344 print_rel(PICT_C(p), PICT_A(p),y,x);
9345 move_cursor_relative(y, x);
9346 /*if (fresh_before)*/ Term_fresh();
9347 Term_xtra(TERM_XTRA_DELAY, msec);
9353 for( y=y1 ; y <=y2 ; y++ ){
9354 for( x=x1 ; x <=x2 ; x++ ){
9355 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9356 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9357 centersign*( (point_x[1]-x)*(point_y[2]-y)
9358 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9359 centersign*( (point_x[2]-x)*(point_y[0]-y)
9360 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9362 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9363 (void)project_f(0,0,y,x,dam,GF_MANA);
9368 for( y=y1 ; y <=y2 ; y++ ){
9369 for( x=x1 ; x <=x2 ; x++ ){
9370 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9371 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9372 centersign*( (point_x[1]-x)*(point_y[2]-y)
9373 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9374 centersign*( (point_x[2]-x)*(point_y[0]-y)
9375 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9377 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9378 (void)project_o(0,0,y,x,dam,GF_MANA);
9383 for( y=y1 ; y <=y2 ; y++ ){
9384 for( x=x1 ; x <=x2 ; x++ ){
9385 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9386 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9387 centersign*( (point_x[1]-x)*(point_y[2]-y)
9388 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9389 centersign*( (point_x[2]-x)*(point_y[0]-y)
9390 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9392 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9393 (void)project_m(0,0,y,x,dam,GF_MANA,
9394 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP),TRUE);
9401 msg_print("¶À¤¬·ë³¦¤ËÂѤ¨¤¤ì¤º¡¢²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡£");
9403 msg_print("The field broke a mirror");
9405 remove_mirror(point_y[0],point_x[0]);
9411 void seal_of_mirror( int dam )
9415 for( x = 0 ; x < cur_wid ; x++ )
9417 for( y = 0 ; y < cur_hgt ; y++ )
9419 if( is_mirror_grid(&cave[y][x]))
9421 if(project_m(0,0,y,x,dam,GF_GENOCIDE,
9422 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP),TRUE))
9424 if( !cave[y][x].m_idx )