4 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
6 * This software may be copied and distributed for educational, research,
7 * and not for profit purposes provided that this copyright and statement
8 * are included in all such copies. Other copyrights may also apply.
11 /* Purpose: Spell projection */
15 /* ToDo: Make this global */
16 /* 1/x chance of reducing stats (for elemental attacks) */
17 #define HURT_CHANCE 16
20 static int rakubadam_m;
21 static int rakubadam_p;
23 int project_length = 0;
26 * Get another mirror. for SEEKER
28 static void next_mirror( int* next_y , int* next_x , int cury, int curx)
30 int mirror_x[10],mirror_y[10]; /* ¶À¤Ï¤â¤Ã¤È¾¯¤Ê¤¤ */
31 int mirror_num=0; /* ¶À¤Î¿ô */
35 for( x=0 ; x < cur_wid ; x++ )
37 for( y=0 ; y < cur_hgt ; y++ )
39 if( is_mirror_grid(&cave[y][x])){
40 mirror_y[mirror_num]=y;
41 mirror_x[mirror_num]=x;
48 num=randint0(mirror_num);
49 *next_y=mirror_y[num];
50 *next_x=mirror_x[num];
53 *next_y=cury+randint0(5)-2;
54 *next_x=curx+randint0(5)-2;
59 * Get a legal "multi-hued" color for drawing "spells"
61 static byte mh_attr(int max)
63 switch (randint1(max))
65 case 1: return (TERM_RED);
66 case 2: return (TERM_GREEN);
67 case 3: return (TERM_BLUE);
68 case 4: return (TERM_YELLOW);
69 case 5: return (TERM_ORANGE);
70 case 6: return (TERM_VIOLET);
71 case 7: return (TERM_L_RED);
72 case 8: return (TERM_L_GREEN);
73 case 9: return (TERM_L_BLUE);
74 case 10: return (TERM_UMBER);
75 case 11: return (TERM_L_UMBER);
76 case 12: return (TERM_SLATE);
77 case 13: return (TERM_WHITE);
78 case 14: return (TERM_L_WHITE);
79 case 15: return (TERM_L_DARK);
87 * Return a color to use for the bolt/ball spells
89 static byte spell_color(int type)
91 /* Check if A.B.'s new graphics should be used (rr9) */
92 if (streq(ANGBAND_GRAF, "new"))
97 case GF_PSY_SPEAR: return (0x06);
98 case GF_MISSILE: return (0x0F);
99 case GF_ACID: return (0x04);
100 case GF_ELEC: return (0x02);
101 case GF_FIRE: return (0x00);
102 case GF_COLD: return (0x01);
103 case GF_POIS: return (0x03);
104 case GF_HOLY_FIRE: return (0x00);
105 case GF_HELL_FIRE: return (0x00);
106 case GF_MANA: return (0x0E);
108 case GF_SEEKER: return (0x0E);
109 case GF_SUPER_RAY: return (0x0E);
111 case GF_ARROW: return (0x0F);
112 case GF_WATER: return (0x04);
113 case GF_NETHER: return (0x07);
114 case GF_CHAOS: return (mh_attr(15));
115 case GF_DISENCHANT: return (0x05);
116 case GF_NEXUS: return (0x0C);
117 case GF_CONFUSION: return (mh_attr(4));
118 case GF_SOUND: return (0x09);
119 case GF_SHARDS: return (0x08);
120 case GF_FORCE: return (0x09);
121 case GF_INERTIA: return (0x09);
122 case GF_GRAVITY: return (0x09);
123 case GF_TIME: return (0x09);
124 case GF_LITE_WEAK: return (0x06);
125 case GF_LITE: return (0x06);
126 case GF_DARK_WEAK: return (0x07);
127 case GF_DARK: return (0x07);
128 case GF_PLASMA: return (0x0B);
129 case GF_METEOR: return (0x00);
130 case GF_ICE: return (0x01);
131 case GF_ROCKET: return (0x0F);
132 case GF_DEATH_RAY: return (0x07);
133 case GF_NUKE: return (mh_attr(2));
134 case GF_DISINTEGRATE: return (0x05);
146 case GF_CAUSE_4: return (0x0E);
147 case GF_HAND_DOOM: return (0x07);
148 case GF_CAPTURE : return (0x0E);
149 case GF_IDENTIFY: return (0x01);
150 case GF_ATTACK: return (0x0F);
151 case GF_PHOTO : return (0x06);
154 /* Normal tiles or ASCII */
160 /* Lookup the default colors for this type */
161 cptr s = quark_str(gf_color[type]);
164 if (!s) return (TERM_WHITE);
166 /* Pick a random color */
167 c = s[randint0(strlen(s))];
169 /* Lookup this color */
170 a = my_strchr(color_char, c) - color_char;
172 /* Invalid color (note check for < 0 removed, gave a silly
173 * warning because bytes are always >= 0 -- RG) */
174 if (a > 15) return (TERM_WHITE);
180 /* Standard "color" */
186 * Find the attr/char pair to use for a spell effect
188 * It is moving (or has moved) from (x,y) to (nx,ny).
190 * If the distance is not "one", we (may) return "*".
192 u16b bolt_pict(int y, int x, int ny, int nx, int typ)
202 if ((ny == y) && (nx == x)) base = 0x30;
205 else if (nx == x) base = 0x40;
208 else if (ny == y) base = 0x50;
211 else if ((ny - y) == (x - nx)) base = 0x60;
214 else if ((ny - y) == (nx - x)) base = 0x70;
219 /* Basic spell color */
220 k = spell_color(typ);
222 /* Obtain attr/char */
223 a = misc_to_attr[base + k];
224 c = misc_to_char[base + k];
232 * Determine the path taken by a projection.
234 * The projection will always start from the grid (y1,x1), and will travel
235 * towards the grid (y2,x2), touching one grid per unit of distance along
236 * the major axis, and stopping when it enters the destination grid or a
237 * wall grid, or has travelled the maximum legal distance of "range".
239 * Note that "distance" in this function (as in the "update_view()" code)
240 * is defined as "MAX(dy,dx) + MIN(dy,dx)/2", which means that the player
241 * actually has an "octagon of projection" not a "circle of projection".
243 * The path grids are saved into the grid array pointed to by "gp", and
244 * there should be room for at least "range" grids in "gp". Note that
245 * due to the way in which distance is calculated, this function normally
246 * uses fewer than "range" grids for the projection path, so the result
247 * of this function should never be compared directly to "range". Note
248 * that the initial grid (y1,x1) is never saved into the grid array, not
249 * even if the initial grid is also the final grid. XXX XXX XXX
251 * The "flg" flags can be used to modify the behavior of this function.
253 * In particular, the "PROJECT_STOP" and "PROJECT_THRU" flags have the same
254 * semantics as they do for the "project" function, namely, that the path
255 * will stop as soon as it hits a monster, or that the path will continue
256 * through the destination grid, respectively.
258 * The "PROJECT_JUMP" flag, which for the "project()" function means to
259 * start at a special grid (which makes no sense in this function), means
260 * that the path should be "angled" slightly if needed to avoid any wall
261 * grids, allowing the player to "target" any grid which is in "view".
262 * This flag is non-trivial and has not yet been implemented, but could
263 * perhaps make use of the "vinfo" array (above). XXX XXX XXX
265 * This function returns the number of grids (if any) in the path. This
266 * function will return zero if and only if (y1,x1) and (y2,x2) are equal.
268 * This algorithm is similar to, but slightly different from, the one used
269 * by "update_view_los()", and very different from the one used by "los()".
271 sint project_path(u16b *gp, int range, int y1, int x1, int y2, int x2, int flg)
293 /* No path necessary (or allowed) */
294 if ((x1 == x2) && (y1 == y2)) return (0);
322 /* Number of "units" in one "half" grid */
325 /* Number of "units" in one "full" grid */
331 /* Let m = ((dx/dy) * full) = (dx * dx * 2) */
342 /* Advance (X) part 2 */
345 /* Advance (X) part 3 */
352 /* Create the projection path */
356 gp[n++] = GRID(y, x);
358 /* Hack -- Check maximum range */
359 if ((n + (k >> 1)) >= range) break;
361 /* Sometimes stop at destination grid */
362 if (!(flg & (PROJECT_THRU)))
364 if ((x == x2) && (y == y2)) break;
367 if (flg & (PROJECT_DISI))
369 if ((n > 0) && cave_stop_disintegration(y, x)) break;
371 else if (flg & (PROJECT_LOS))
373 if ((n > 0) && !cave_los_bold(y, x)) break;
375 else if (!(flg & (PROJECT_PATH)))
377 /* Always stop at non-initial wall grids */
378 if ((n > 0) && !cave_have_flag_bold(y, x, FF_PROJECT)) break;
381 /* Sometimes stop at non-initial monsters/players */
382 if (flg & (PROJECT_STOP))
385 (player_bold(y, x) || cave[y][x].m_idx != 0))
389 if (!in_bounds(y, x)) break;
394 /* Advance (X) part 1 */
397 /* Horizontal change */
400 /* Advance (X) part 2 */
403 /* Advance (X) part 3 */
419 /* Let m = ((dy/dx) * full) = (dy * dy * 2) */
428 /* Vertical change */
431 /* Advance (Y) part 2 */
434 /* Advance (Y) part 3 */
441 /* Create the projection path */
445 gp[n++] = GRID(y, x);
447 /* Hack -- Check maximum range */
448 if ((n + (k >> 1)) >= range) break;
450 /* Sometimes stop at destination grid */
451 if (!(flg & (PROJECT_THRU)))
453 if ((x == x2) && (y == y2)) break;
456 if (flg & (PROJECT_DISI))
458 if ((n > 0) && cave_stop_disintegration(y, x)) break;
460 else if (flg & (PROJECT_LOS))
462 if ((n > 0) && !cave_los_bold(y, x)) break;
464 else if (!(flg & (PROJECT_PATH)))
466 /* Always stop at non-initial wall grids */
467 if ((n > 0) && !cave_have_flag_bold(y, x, FF_PROJECT)) break;
470 /* Sometimes stop at non-initial monsters/players */
471 if (flg & (PROJECT_STOP))
474 (player_bold(y, x) || cave[y][x].m_idx != 0))
478 if (!in_bounds(y, x)) break;
483 /* Advance (Y) part 1 */
486 /* Vertical change */
489 /* Advance (Y) part 2 */
492 /* Advance (Y) part 3 */
512 /* Create the projection path */
516 gp[n++] = GRID(y, x);
518 /* Hack -- Check maximum range */
519 if ((n + (n >> 1)) >= range) break;
521 /* Sometimes stop at destination grid */
522 if (!(flg & (PROJECT_THRU)))
524 if ((x == x2) && (y == y2)) break;
527 if (flg & (PROJECT_DISI))
529 if ((n > 0) && cave_stop_disintegration(y, x)) break;
531 else if (flg & (PROJECT_LOS))
533 if ((n > 0) && !cave_los_bold(y, x)) break;
535 else if (!(flg & (PROJECT_PATH)))
537 /* Always stop at non-initial wall grids */
538 if ((n > 0) && !cave_have_flag_bold(y, x, FF_PROJECT)) break;
541 /* Sometimes stop at non-initial monsters/players */
542 if (flg & (PROJECT_STOP))
545 (player_bold(y, x) || cave[y][x].m_idx != 0))
549 if (!in_bounds(y, x)) break;
566 * Mega-Hack -- track "affected" monsters (see "project()" comments)
568 static int project_m_n;
569 static int project_m_x;
570 static int project_m_y;
571 /* Mega-Hack -- monsters target */
572 static s16b monster_target_x;
573 static s16b monster_target_y;
577 * We are called from "project()" to "damage" terrain features
579 * We are called both for "beam" effects and "ball" effects.
581 * The "r" parameter is the "distance from ground zero".
583 * Note that we determine if the player can "see" anything that happens
584 * by taking into account: blindness, line-of-sight, and illumination.
586 * We return "TRUE" if the effect of the projection is "obvious".
588 * XXX XXX XXX We also "see" grids which are "memorized", probably a hack
590 * XXX XXX XXX Perhaps we should affect doors?
592 static bool project_f(int who, int r, int y, int x, int dam, int typ)
594 cave_type *c_ptr = &cave[y][x];
595 feature_type *f_ptr = &f_info[c_ptr->feat];
597 bool obvious = FALSE;
598 bool known = player_has_los_bold(y, x);
604 /* Reduce damage by distance */
605 dam = (dam + r) / (r + 1);
608 if (have_flag(f_ptr->flags, FF_TREE))
617 message = "¸Ï¤ì¤¿";break;
619 message = "was blasted.";break;
623 message = "½Ì¤ó¤À";break;
625 message = "shrank.";break;
629 message = "ÍϤ±¤¿";break;
631 message = "melted.";break;
636 message = "Åà¤ê¡¢ºÕ¤±»¶¤Ã¤¿";break;
638 message = "was frozen and smashed.";break;
644 message = "dz¤¨¤¿";break;
646 message = "burns up!";break;
660 message = "Ê´ºÕ¤µ¤ì¤¿";break;
662 message = "was crushed.";break;
665 message = NULL;break;
670 msg_format("ÌÚ¤Ï%s¡£", message);
672 msg_format("A tree %s", message);
674 cave_set_feat(y, x, (one_in_(3) ? FEAT_DEEP_GRASS : FEAT_GRASS));
677 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
681 /* Analyze the type */
684 /* Ignore most effects */
719 /* Destroy Traps (and Locks) */
722 /* Reveal secret doors */
723 if (is_hidden_door(c_ptr))
728 /* Check line of sight */
736 if (is_trap(c_ptr->feat))
738 /* Check line of sight */
742 msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
744 msg_print("There is a bright flash of light!");
750 /* Destroy the trap */
751 cave_alter_feat(y, x, FF_DISARM);
754 /* Locked doors are unlocked */
755 if (is_closed_door(c_ptr->feat) && f_ptr->power && have_flag(f_ptr->flags, FF_OPEN))
757 s16b old_feat = c_ptr->feat;
759 /* Unlock the door */
760 cave_alter_feat(y, x, FF_DISARM);
762 /* Check line of sound */
763 if (known && (old_feat != c_ptr->feat))
766 msg_print("¥«¥Á¥Ã¤È²»¤¬¤·¤¿¡ª");
775 /* Remove "unsafe" flag if player is not blind */
776 if (!p_ptr->blind && player_has_los_bold(y, x))
778 c_ptr->info &= ~(CAVE_UNSAFE);
789 /* Destroy Doors (and traps) */
792 /* Destroy all doors and traps */
793 if (is_trap(c_ptr->feat) || have_flag(f_ptr->flags, FF_DOOR))
795 /* Check line of sight */
800 msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
802 msg_print("There is a bright flash of light!");
808 /* Destroy the feature */
809 cave_alter_feat(y, x, FF_TUNNEL);
812 /* Remove "unsafe" flag if player is not blind */
813 if (!p_ptr->blind && player_has_los_bold(y, x))
815 c_ptr->info &= ~(CAVE_UNSAFE);
826 case GF_JAM_DOOR: /* Jams a door (as if with a spike) */
828 if (have_flag(f_ptr->flags, FF_SPIKE))
830 s16b old_mimic = c_ptr->mimic;
831 feature_type *mimic_f_ptr = &f_info[get_feat_mimic(c_ptr)];
833 cave_alter_feat(y, x, FF_SPIKE);
835 c_ptr->mimic = old_mimic;
843 /* Check line of sight */
844 if (known && have_flag(mimic_f_ptr->flags, FF_OPEN))
848 msg_format("%s¤Ë²¿¤«¤¬¤Ä¤Ã¤«¤¨¤Æ³«¤«¤Ê¤¯¤Ê¤Ã¤¿¡£", f_name + mimic_f_ptr->name);
850 msg_format("The %s seems stuck.", f_name + mimic_f_ptr->name);
859 /* Destroy walls (and doors) */
862 if (have_flag(f_ptr->flags, FF_HURT_ROCK))
865 if (known && (c_ptr->info & (CAVE_MARK)))
868 msg_format("%s¤¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª", f_name + f_info[get_feat_mimic(c_ptr)].name);
870 msg_format("The %s turns into mud!", f_name + f_info[get_feat_mimic(c_ptr)].name);
876 /* Destroy the wall */
877 cave_alter_feat(y, x, FF_HURT_ROCK);
879 /* Update some things */
880 p_ptr->update |= (PU_FLOW);
889 /* Require a "naked" floor grid */
890 if (!cave_naked_bold(y, x)) break;
892 /* Not on the player */
893 if (player_bold(y, x)) break;
895 /* Create a closed door */
896 cave_set_feat(y, x, FEAT_DOOR_HEAD + 0x00);
899 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
916 /* Require a "naked" floor grid */
917 if (!cave_naked_bold(y, x)) break;
919 /* Not on the player */
920 if (player_bold(y, x)) break;
922 /* Create a closed door */
923 cave_set_feat(y, x, FEAT_TREES);
926 if (c_ptr->info & (CAVE_MARK)) obvious = TRUE;
934 /* Require a "naked" floor grid */
935 if (!cave_naked_bold(y, x)) break;
938 c_ptr->info |= CAVE_OBJECT;
939 c_ptr->mimic = FEAT_GLYPH;
952 /* Require a "naked" floor grid */
953 if (!cave_naked_bold(y, x)) break;
955 /* Not on the player */
956 if (player_bold(y, x)) break;
959 cave_set_feat(y, x, FEAT_WALL);
967 /* Ignore permanent grid */
968 if (have_flag(f_ptr->flags, FF_PERMANENT)) break;
973 /* Ignore grid without enough space */
974 if (!have_flag(f_ptr->flags, FF_FLOOR)) break;
976 /* Place a shallow lava */
977 cave_set_feat(y, x, FEAT_SHAL_LAVA);
982 /* Place a deep lava */
983 cave_set_feat(y, x, FEAT_DEEP_LAVA);
990 /* Ignore permanent grid */
991 if (have_flag(f_ptr->flags, FF_PERMANENT)) break;
996 /* Ignore grid without enough space */
997 if (!have_flag(f_ptr->flags, FF_FLOOR)) break;
999 /* Place a shallow water */
1000 cave_set_feat(y, x, FEAT_SHAL_WATER);
1005 /* Place a deep water */
1006 cave_set_feat(y, x, FEAT_DEEP_WATER);
1011 /* Lite up the grid */
1015 /* Turn on the light */
1016 if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS))
1018 c_ptr->info |= (CAVE_GLOW);
1026 update_local_illumination(y, x);
1029 if (player_can_see_bold(y, x)) obvious = TRUE;
1031 /* Mega-Hack -- Update the monster in the affected grid */
1032 /* This allows "spear of light" (etc) to work "correctly" */
1033 if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
1035 if (p_ptr->special_defense & NINJA_S_STEALTH)
1037 if (player_bold(y, x)) set_superstealth(FALSE);
1044 /* Darken the grid */
1048 bool do_dark = !p_ptr->inside_battle && !is_mirror_grid(c_ptr);
1051 /* Turn off the light. */
1054 for (j = 0; j < 9; j++)
1056 int by = y + ddy_ddd[j];
1057 int bx = x + ddx_ddd[j];
1059 if (in_bounds2(by, bx))
1061 cave_type *cc_ptr = &cave[by][bx];
1063 if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
1071 if (!do_dark) break;
1073 c_ptr->info &= ~(CAVE_GLOW);
1075 /* Hack -- Forget "boring" grids */
1076 if (!have_flag(f_ptr->flags, FF_REMEMBER))
1079 c_ptr->info &= ~(CAVE_MARK);
1088 update_local_illumination(y, x);
1091 if (player_can_see_bold(y, x)) obvious = TRUE;
1093 /* Mega-Hack -- Update the monster in the affected grid */
1094 /* This allows "spear of light" (etc) to work "correctly" */
1095 if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
1105 if (is_mirror_grid(c_ptr))
1108 msg_print("¶À¤¬³ä¤ì¤¿¡ª");
1110 msg_print("The mirror was crashed!");
1112 remove_mirror(y, x);
1113 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
1119 if (is_mirror_grid(c_ptr) && p_ptr->lev < 40)
1122 msg_print("¶À¤¬³ä¤ì¤¿¡ª");
1124 msg_print("The mirror was crashed!");
1126 remove_mirror(y, x);
1127 project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
1132 case GF_DISINTEGRATE:
1134 /* Destroy mirror */
1135 if (is_mirror_grid(c_ptr)) remove_mirror(y, x);
1137 /* Permanent features don't get effect */
1138 /* But not protect monsters and other objects */
1139 if (have_flag(f_ptr->flags, FF_HURT_DISI) && !have_flag(f_ptr->flags, FF_PERMANENT))
1141 cave_alter_feat(y, x, FF_HURT_DISI);
1143 /* Update some things -- similar to GF_KILL_WALL */
1144 p_ptr->update |= (PU_FLOW);
1151 /* Return "Anything seen?" */
1158 * We are called from "project()" to "damage" objects
1160 * We are called both for "beam" effects and "ball" effects.
1162 * Perhaps we should only SOMETIMES damage things on the ground.
1164 * The "r" parameter is the "distance from ground zero".
1166 * Note that we determine if the player can "see" anything that happens
1167 * by taking into account: blindness, line-of-sight, and illumination.
1169 * XXX XXX XXX We also "see" grids which are "memorized", probably a hack
1171 * We return "TRUE" if the effect of the projection is "obvious".
1173 static bool project_o(int who, int r, int y, int x, int dam, int typ)
1175 cave_type *c_ptr = &cave[y][x];
1177 s16b this_o_idx, next_o_idx = 0;
1179 bool obvious = FALSE;
1180 bool known = player_has_los_bold(y, x);
1182 u32b flgs[TR_FLAG_SIZE];
1184 char o_name[MAX_NLEN];
1187 bool is_potion = FALSE;
1191 who = who ? who : 0;
1193 /* Reduce damage by distance */
1194 dam = (dam + r) / (r + 1);
1197 /* Scan all objects in the grid */
1198 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
1200 /* Acquire object */
1201 object_type *o_ptr = &o_list[this_o_idx];
1203 bool is_art = FALSE;
1204 bool ignore = FALSE;
1205 bool do_kill = FALSE;
1207 cptr note_kill = NULL;
1210 /* Get the "plural"-ness */
1211 bool plural = (o_ptr->number > 1);
1214 /* Acquire next object */
1215 next_o_idx = o_ptr->next_o_idx;
1217 /* Extract the flags */
1218 object_flags(o_ptr, flgs);
1220 /* Check for artifact */
1221 if (object_is_artifact(o_ptr)) is_art = TRUE;
1223 /* Analyze the type */
1226 /* Acid -- Lots of things */
1229 if (hates_acid(o_ptr))
1233 note_kill = "Í»¤±¤Æ¤·¤Þ¤Ã¤¿¡ª";
1235 note_kill = (plural ? " melt!" : " melts!");
1238 if (have_flag(flgs, TR_IGNORE_ACID)) ignore = TRUE;
1243 /* Elec -- Rings and Wands */
1246 if (hates_elec(o_ptr))
1250 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1252 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1255 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1260 /* Fire -- Flammable objects */
1263 if (hates_fire(o_ptr))
1267 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1269 note_kill = (plural ? " burn up!" : " burns up!");
1272 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1277 /* Cold -- potions and flasks */
1280 if (hates_cold(o_ptr))
1283 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1285 note_kill = (plural ? " shatter!" : " shatters!");
1289 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1297 if (hates_fire(o_ptr))
1301 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1303 note_kill = (plural ? " burn up!" : " burns up!");
1306 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1308 if (hates_elec(o_ptr))
1313 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1315 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1318 if (have_flag(flgs, TR_IGNORE_ELEC)) ignore = TRUE;
1326 if (hates_fire(o_ptr))
1330 note_kill = "dz¤¨¤Æ¤·¤Þ¤Ã¤¿¡ª";
1332 note_kill = (plural ? " burn up!" : " burns up!");
1335 if (have_flag(flgs, TR_IGNORE_FIRE)) ignore = TRUE;
1337 if (hates_cold(o_ptr))
1342 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1344 note_kill = (plural ? " shatter!" : " shatters!");
1347 if (have_flag(flgs, TR_IGNORE_COLD)) ignore = TRUE;
1352 /* Hack -- break potions and such */
1358 if (hates_cold(o_ptr))
1361 note_kill = "ºÕ¤±»¶¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª";
1363 note_kill = (plural ? " shatter!" : " shatters!");
1371 /* Mana and Chaos -- destroy everything */
1378 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1380 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1386 case GF_DISINTEGRATE:
1390 note_kill = "¾øȯ¤·¤Æ¤·¤Þ¤Ã¤¿¡ª";
1392 note_kill = (plural ? " evaporate!" : " evaporates!");
1402 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1404 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1407 if (have_flag(flgs, TR_RES_CHAOS)) ignore = TRUE;
1408 else if ((o_ptr->tval == TV_SCROLL) && (o_ptr->sval == SV_SCROLL_CHAOS)) ignore = TRUE;
1412 /* Holy Fire and Hell Fire -- destroys cursed non-artifacts */
1416 if (object_is_cursed(o_ptr))
1420 note_kill = "²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª";
1422 note_kill = (plural ? " are destroyed!" : " is destroyed!");
1431 identify_item(o_ptr);
1433 /* Auto-inscription */
1434 autopick_alter_item((-this_o_idx), FALSE);
1442 /* Chests are noticed only if trapped or locked */
1443 if (o_ptr->tval == TV_CHEST)
1445 /* Disarm/Unlock traps */
1446 if (o_ptr->pval > 0)
1448 /* Disarm or Unlock */
1449 o_ptr->pval = (0 - o_ptr->pval);
1452 object_known(o_ptr);
1455 if (known && o_ptr->marked)
1458 msg_print("¥«¥Á¥Ã¤È²»¤¬¤·¤¿¡ª");
1460 msg_print("Click!");
1472 if (o_ptr->tval == TV_CORPSE)
1477 if (!who || is_pet(&m_list[who]))
1478 mode |= PM_FORCE_PET;
1480 for (i = 0; i < o_ptr->number ; i++)
1482 if (((o_ptr->sval == SV_CORPSE) && (randint1(100) > 80)) ||
1483 ((o_ptr->sval == SV_SKELETON) && (randint1(100) > 60)))
1488 note_kill = "³¥¤Ë¤Ê¤Ã¤¿¡£";
1490 note_kill = (plural ? " become dust." : " becomes dust.");
1495 else if (summon_named_creature(who, y, x, o_ptr->pval, mode))
1498 note_kill = "À¸¤Ê֤ä¿¡£";
1500 note_kill = "rivived.";
1503 else if (!note_kill)
1506 note_kill = "³¥¤Ë¤Ê¤Ã¤¿¡£";
1508 note_kill = (plural ? " become dust." : " becomes dust.");
1520 /* Attempt to destroy the object */
1523 /* Effect "observed" */
1524 if (known && o_ptr->marked)
1527 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
1530 /* Artifacts, and other objects, get to resist */
1531 if (is_art || ignore)
1533 /* Observe the resist */
1534 if (known && o_ptr->marked)
1537 msg_format("%s¤Ï±Æ¶Á¤ò¼õ¤±¤Ê¤¤¡ª",
1540 msg_format("The %s %s unaffected!",
1541 o_name, (plural ? "are" : "is"));
1550 /* Describe if needed */
1551 if (known && o_ptr->marked && note_kill)
1554 msg_format("%s¤Ï%s", o_name, note_kill);
1556 msg_format("The %s%s", o_name, note_kill);
1561 k_idx = o_ptr->k_idx;
1562 is_potion = object_is_potion(o_ptr);
1565 /* Delete the object */
1566 delete_object_idx(this_o_idx);
1568 /* Potions produce effects when 'shattered' */
1571 (void)potion_smash_effect(who, y, x, k_idx);
1580 /* Return "Anything seen?" */
1586 * Helper function for "project()" below.
1588 * Handle a beam/bolt/ball causing damage to a monster.
1590 * This routine takes a "source monster" (by index) which is mostly used to
1591 * determine if the player is causing the damage, and a "radius" (see below),
1592 * which is used to decrease the power of explosions with distance, and a
1593 * location, via integers which are modified by certain types of attacks
1594 * (polymorph and teleport being the obvious ones), a default damage, which
1595 * is modified as needed based on various properties, and finally a "damage
1596 * type" (see below).
1598 * Note that this routine can handle "no damage" attacks (like teleport) by
1599 * taking a "zero" damage, and can even take "parameters" to attacks (like
1600 * confuse) by accepting a "damage", using it to calculate the effect, and
1601 * then setting the damage to zero. Note that the "damage" parameter is
1602 * divided by the radius, so monsters not at the "epicenter" will not take
1603 * as much damage (or whatever)...
1605 * Note that "polymorph" is dangerous, since a failure in "place_monster()"'
1606 * may result in a dereference of an invalid pointer. XXX XXX XXX
1608 * Various messages are produced, and damage is applied.
1610 * Just "casting" a substance (i.e. plasma) does not make you immune, you must
1611 * actually be "made" of that substance, or "breathe" big balls of it.
1613 * We assume that "Plasma" monsters, and "Plasma" breathers, are immune
1616 * We assume "Nether" is an evil, necromantic force, so it doesn't hurt undead,
1617 * and hurts evil less. If can breath nether, then it resists it as well.
1619 * Damage reductions use the following formulas:
1620 * Note that "dam = dam * 6 / (randint1(6) + 6);"
1621 * gives avg damage of .655, ranging from .858 to .500
1622 * Note that "dam = dam * 5 / (randint1(6) + 6);"
1623 * gives avg damage of .544, ranging from .714 to .417
1624 * Note that "dam = dam * 4 / (randint1(6) + 6);"
1625 * gives avg damage of .444, ranging from .556 to .333
1626 * Note that "dam = dam * 3 / (randint1(6) + 6);"
1627 * gives avg damage of .327, ranging from .427 to .250
1628 * Note that "dam = dam * 2 / (randint1(6) + 6);"
1629 * gives something simple.
1631 * In this function, "result" messages are postponed until the end, where
1632 * the "note" string is appended to the monster name, if not NULL. So,
1633 * to make a spell have "no effect" just set "note" to NULL. You should
1634 * also set "notice" to FALSE, or the player will learn what the spell does.
1636 * We attempt to return "TRUE" if the player saw anything "useful" happen.
1638 /* "flg" was added. */
1639 static bool project_m(int who, int r, int y, int x, int dam, int typ , int flg)
1643 cave_type *c_ptr = &cave[y][x];
1645 monster_type *m_ptr = &m_list[c_ptr->m_idx];
1646 monster_type *caster_ptr = (who > 0) ? &m_list[who] : NULL;
1648 monster_race *r_ptr = &r_info[m_ptr->r_idx];
1652 /* Is the monster "seen"? */
1653 bool seen = m_ptr->ml;
1654 bool seen_msg = is_seen(m_ptr);
1656 bool slept = (bool)(m_ptr->csleep > 0);
1658 /* Were the effects "obvious" (if seen)? */
1659 bool obvious = FALSE;
1661 /* Can the player know about this effect? */
1662 bool known = ((m_ptr->cdis <= MAX_SIGHT) || p_ptr->inside_battle);
1664 /* Can the player see the source of this effect? */
1665 bool see_s_msg = ((who <= 0) || is_seen(caster_ptr));
1667 /* Were the effects "irrelevant"? */
1668 bool skipped = FALSE;
1670 /* Gets the monster angry at the source of the effect? */
1671 bool get_angry = FALSE;
1673 /* Polymorph setting (true or false) */
1674 bool do_poly = FALSE;
1676 /* Teleport setting (max distance) */
1679 /* Confusion setting (amount to confuse) */
1682 /* Stunning setting (amount to stun) */
1685 /* Sleep amount (amount to sleep) */
1688 /* Fear amount (amount to fear) */
1691 /* Time amount (amount to time) */
1694 bool heal_leper = FALSE;
1696 /* Hold the monster name */
1705 /* Assume no note */
1708 /* Assume a default death */
1709 cptr note_dies = extract_note_dies(real_r_ptr(m_ptr));
1714 int caster_lev = (who > 0) ? r_info[caster_ptr->r_idx].level : (p_ptr->lev * 2);
1717 if (!c_ptr->m_idx) return (FALSE);
1719 /* Never affect projector */
1720 if (who && (c_ptr->m_idx == who)) return (FALSE);
1721 if ((c_ptr->m_idx == p_ptr->riding) && !who && !(typ == GF_OLD_HEAL) && !(typ == GF_OLD_SPEED) && !(typ == GF_STAR_HEAL)) return (FALSE);
1722 if (sukekaku && ((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) return FALSE;
1724 /* Don't affect already death monsters */
1725 /* Prevents problems with chain reactions of exploding monsters */
1726 if (m_ptr->hp < 0) return (FALSE);
1728 /* Reduce damage by distance */
1729 dam = (dam + r) / (r + 1);
1732 /* Get the monster name (BEFORE polymorphing) */
1733 monster_desc(m_name, m_ptr, 0);
1736 /* Get the monster possessive ("his"/"her"/"its") */
1737 monster_desc(m_poss, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE);
1741 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) disturb(1, 0);
1743 /* Analyze the damage type */
1746 /* Magic Missile -- pure damage */
1749 if (seen) obvious = TRUE;
1751 if (r_ptr->flagsr & RFR_RES_ALL)
1754 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1756 note = " is immune.";
1759 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1768 if (seen) obvious = TRUE;
1770 if (r_ptr->flagsr & RFR_RES_ALL)
1773 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1775 note = " is immune.";
1778 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1781 if (r_ptr->flagsr & RFR_IM_ACID)
1784 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1786 note = " resists a lot.";
1790 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ACID);
1798 if (seen) obvious = TRUE;
1800 if (r_ptr->flagsr & RFR_RES_ALL)
1803 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1805 note = " is immune.";
1808 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1811 if (r_ptr->flagsr & RFR_IM_ELEC)
1814 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1816 note = " resists a lot.";
1820 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_ELEC);
1828 if (seen) obvious = TRUE;
1830 if (r_ptr->flagsr & RFR_RES_ALL)
1833 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1835 note = " is immune.";
1838 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1841 if (r_ptr->flagsr & RFR_IM_FIRE)
1844 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1846 note = " resists a lot.";
1850 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_FIRE);
1852 else if (r_ptr->flags3 & (RF3_HURT_FIRE))
1855 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
1857 note = " is hit hard.";
1861 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_FIRE);
1869 if (seen) obvious = TRUE;
1871 if (r_ptr->flagsr & RFR_RES_ALL)
1874 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1876 note = " is immune.";
1879 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1882 if (r_ptr->flagsr & RFR_IM_COLD)
1885 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1887 note = " resists a lot.";
1891 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
1893 else if (r_ptr->flags3 & (RF3_HURT_COLD))
1896 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
1898 note = " is hit hard.";
1902 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
1910 if (seen) obvious = TRUE;
1912 if (r_ptr->flagsr & RFR_RES_ALL)
1915 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1917 note = " is immune.";
1920 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1923 if (r_ptr->flagsr & RFR_IM_POIS)
1926 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡ª";
1928 note = " resists a lot.";
1932 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1940 if (seen) obvious = TRUE;
1942 if (r_ptr->flagsr & RFR_RES_ALL)
1945 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1947 note = " is immune.";
1950 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1953 if (r_ptr->flagsr & RFR_IM_POIS)
1956 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
1961 dam *= 3; dam /= randint1(6) + 6;
1962 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_POIS);
1964 else if (one_in_(3)) do_poly = TRUE;
1968 /* Hellfire -- hurts Evil */
1971 if (seen) obvious = TRUE;
1973 if (r_ptr->flagsr & RFR_RES_ALL)
1976 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
1978 note = " is immune.";
1981 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
1984 if (r_ptr->flags3 & RF3_GOOD)
1988 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¼õ¤±¤¿¡£";
1990 note = " is hit hard.";
1993 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
1998 /* Holy Fire -- hurts Evil, Good are immune, others _resist_ */
2001 if (seen) obvious = TRUE;
2003 if (r_ptr->flagsr & RFR_RES_ALL)
2006 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2008 note = " is immune.";
2011 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2014 if (r_ptr->flags3 & RF3_GOOD)
2018 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2020 note = " is immune.";
2023 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_GOOD;
2025 else if (r_ptr->flags3 & RF3_EVIL)
2029 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¼õ¤±¤¿¡£";
2031 note = " is hit hard.";
2034 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= RF3_EVIL;
2039 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2044 dam *= 3; dam /= randint1(6) + 6;
2049 /* Arrow -- XXX no defense */
2052 if (seen) obvious = TRUE;
2054 if (r_ptr->flagsr & RFR_RES_ALL)
2057 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2059 note = " is immune.";
2062 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2068 /* Plasma -- XXX perhaps check ELEC or FIRE */
2071 if (seen) obvious = TRUE;
2073 if (r_ptr->flagsr & RFR_RES_ALL)
2076 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2078 note = " is immune.";
2081 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2084 if (r_ptr->flagsr & RFR_RES_PLAS)
2087 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2092 dam *= 3; dam /= randint1(6) + 6;
2093 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_PLAS);
2098 /* Nether -- see above */
2101 if (seen) obvious = TRUE;
2103 if (r_ptr->flagsr & RFR_RES_ALL)
2106 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2108 note = " is immune.";
2111 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2114 if (r_ptr->flagsr & RFR_RES_NETH)
2116 if (r_ptr->flags3 & RF3_UNDEAD)
2119 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2121 note = " is immune.";
2125 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
2130 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2135 dam *= 3; dam /= randint1(6) + 6;
2137 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NETH);
2139 else if (r_ptr->flags3 & RF3_EVIL)
2143 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2145 note = " resists somewhat.";
2148 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
2153 /* Water (acid) damage -- Water spirits/elementals are immune */
2156 if (seen) obvious = TRUE;
2158 if (r_ptr->flagsr & RFR_RES_ALL)
2161 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2163 note = " is immune.";
2166 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2169 if (r_ptr->flagsr & RFR_RES_WATE)
2171 if ((m_ptr->r_idx == MON_WATER_ELEM) || (m_ptr->r_idx == MON_UNMAKER))
2174 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
2176 note = " is immune.";
2184 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2189 dam *= 3; dam /= randint1(6) + 6;
2191 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WATE);
2196 /* Chaos -- Chaos breathers resist */
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_CHAO)
2215 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2220 dam *= 3; dam /= randint1(6) + 6;
2221 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_CHAO);
2223 else if ((r_ptr->flags3 & RF3_DEMON) && one_in_(3))
2226 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2228 note = " resists somewhat.";
2231 dam *= 3; dam /= randint1(6) + 6;
2232 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
2237 do_conf = (5 + randint1(11) + r) / (r + 1);
2242 /* Shards -- Shard breathers resist */
2245 if (seen) obvious = TRUE;
2247 if (r_ptr->flagsr & RFR_RES_ALL)
2250 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2252 note = " is immune.";
2255 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2258 if (r_ptr->flagsr & RFR_RES_SHAR)
2261 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2266 dam *= 3; dam /= randint1(6) + 6;
2267 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
2272 /* Rocket: Shard resistance helps */
2275 if (seen) obvious = TRUE;
2277 if (r_ptr->flagsr & RFR_RES_ALL)
2280 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2282 note = " is immune.";
2285 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2288 if (r_ptr->flagsr & RFR_RES_SHAR)
2291 note = "¤Ï¤¤¤¯¤é¤«ÂÑÀ¤ò¼¨¤·¤¿¡£";
2293 note = " resists somewhat.";
2297 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SHAR);
2303 /* Sound -- Sound breathers resist */
2306 if (seen) obvious = TRUE;
2308 if (r_ptr->flagsr & RFR_RES_ALL)
2311 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2313 note = " is immune.";
2316 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2319 if (r_ptr->flagsr & RFR_RES_SOUN)
2322 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2327 dam *= 2; dam /= randint1(6) + 6;
2328 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_SOUN);
2330 else do_stun = (10 + randint1(15) + r) / (r + 1);
2337 if (seen) obvious = TRUE;
2339 if (r_ptr->flagsr & RFR_RES_ALL)
2342 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2344 note = " is immune.";
2347 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2350 if (r_ptr->flags3 & RF3_NO_CONF)
2353 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2358 dam *= 3; dam /= randint1(6) + 6;
2359 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
2361 else do_conf = (10 + randint1(15) + r) / (r + 1);
2365 /* Disenchantment -- Breathers and Disenchanters resist */
2368 if (seen) obvious = TRUE;
2370 if (r_ptr->flagsr & RFR_RES_ALL)
2373 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2375 note = " is immune.";
2378 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2381 if (r_ptr->flagsr & RFR_RES_DISE)
2384 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2389 dam *= 3; dam /= randint1(6) + 6;
2390 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DISE);
2395 /* Nexus -- Breathers and Existers resist */
2398 if (seen) obvious = TRUE;
2400 if (r_ptr->flagsr & RFR_RES_ALL)
2403 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2405 note = " is immune.";
2408 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2411 if (r_ptr->flagsr & RFR_RES_NEXU)
2414 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2419 dam *= 3; dam /= randint1(6) + 6;
2420 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_NEXU);
2428 if (seen) obvious = TRUE;
2430 if (r_ptr->flagsr & RFR_RES_ALL)
2433 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2435 note = " is immune.";
2438 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2441 if (r_ptr->flagsr & RFR_RES_WALL)
2444 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2449 dam *= 3; dam /= randint1(6) + 6;
2450 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_WALL);
2452 else do_stun = (randint1(15) + r) / (r + 1);
2456 /* Inertia -- breathers resist */
2459 if (seen) obvious = TRUE;
2461 if (r_ptr->flagsr & RFR_RES_ALL)
2464 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2466 note = " is immune.";
2469 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2472 if (r_ptr->flagsr & RFR_RES_INER)
2475 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2480 dam *= 3; dam /= randint1(6) + 6;
2481 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_INER);
2485 /* Powerful monsters can resist */
2486 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2487 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2491 /* Normal monsters slow down */
2497 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
2499 note = " starts moving slower.";
2502 m_ptr->slow = MIN(200, m_ptr->slow + 50);
2503 if (c_ptr->m_idx == p_ptr->riding)
2504 p_ptr->update |= (PU_BONUS);
2510 /* Time -- breathers resist */
2513 if (seen) obvious = TRUE;
2515 if (r_ptr->flagsr & RFR_RES_ALL)
2518 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2520 note = " is immune.";
2523 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2526 if (r_ptr->flagsr & RFR_RES_TIME)
2529 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2534 dam *= 3; dam /= randint1(6) + 6;
2535 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_TIME);
2537 else do_time = (dam + 1) / 2;
2541 /* Gravity -- breathers resist */
2544 bool resist_tele = FALSE;
2546 if (seen) obvious = TRUE;
2548 if (r_ptr->flagsr & RFR_RES_ALL)
2551 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2553 note = " is immune.";
2556 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2559 if (r_ptr->flagsr & RFR_RES_TELE)
2561 if (r_ptr->flags1 & (RF1_UNIQUE))
2563 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2565 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2567 note = " is unaffected!";
2572 else if (r_ptr->level > randint1(100))
2574 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
2576 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
2585 if (!resist_tele) do_dist = 10;
2587 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
2589 if (r_ptr->flagsr & RFR_RES_GRAV)
2592 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2597 dam *= 3; dam /= randint1(6) + 6;
2599 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_GRAV);
2604 /* Powerful monsters can resist */
2605 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2606 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2610 /* Normal monsters slow down */
2616 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
2618 note = " starts moving slower.";
2621 m_ptr->slow = MIN(200, m_ptr->slow + 50);
2622 if (c_ptr->m_idx == p_ptr->riding)
2623 p_ptr->update |= (PU_BONUS);
2627 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
2629 /* Attempt a saving throw */
2630 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
2631 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
2635 /* No obvious effect */
2637 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2639 note = " is unaffected!";
2653 if (seen) obvious = TRUE;
2655 if (r_ptr->flagsr & RFR_RES_ALL)
2658 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2660 note = " is immune.";
2663 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2671 case GF_DISINTEGRATE:
2673 if (seen) obvious = TRUE;
2675 if (r_ptr->flagsr & RFR_RES_ALL)
2678 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2680 note = " is immune.";
2683 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2686 if (r_ptr->flags3 & RF3_HURT_ROCK)
2688 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
2690 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
2691 note_dies = "¤Ï¾øȯ¤·¤¿¡ª";
2693 note = " loses some skin!";
2694 note_dies = " evaporates!";
2704 if (seen) obvious = TRUE;
2706 /* PSI only works if the monster can see you! -- RG */
2707 if (!(los(m_ptr->fy, m_ptr->fx, py, px)))
2710 if (seen_msg) msg_format("%s¤Ï¤¢¤Ê¤¿¤¬¸«¤¨¤Ê¤¤¤Î¤Ç±Æ¶Á¤µ¤ì¤Ê¤¤¡ª", m_name);
2712 if (seen_msg) msg_format("%^s can't see you, and isn't affected!", m_name);
2718 if (r_ptr->flagsr & RFR_RES_ALL)
2721 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2723 note = " is immune.";
2726 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2729 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2733 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2735 note = " is immune!";
2737 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
2740 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2741 (r_ptr->flags3 & RF3_ANIMAL) ||
2742 (r_ptr->level > randint1(3 * dam)))
2746 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2753 * Powerful demons & undead can turn a mindcrafter's
2754 * attacks back on them
2756 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2757 (r_ptr->level > p_ptr->lev / 2) &&
2762 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
2764 msg_format("%^s%s corrupted mind backlashes your attack!",
2765 m_name, (seen ? "'s" : "s"));
2769 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2772 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2774 msg_print("You resist the effects!");
2780 /* Injure +/- confusion */
2781 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
2782 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2785 switch (randint1(4))
2788 set_confused(p_ptr->confused + 3 + randint1(dam));
2791 set_stun(p_ptr->stun + randint1(dam));
2795 if (r_ptr->flags3 & RF3_NO_FEAR)
2797 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
2799 note = " is unaffected.";
2803 set_afraid(p_ptr->afraid + 3 + randint1(dam));
2807 if (!p_ptr->free_act)
2808 (void)set_paralyzed(p_ptr->paralyzed + randint1(dam));
2817 if ((dam > 0) && one_in_(4))
2819 switch (randint1(4))
2822 do_conf = 3 + randint1(dam);
2825 do_stun = 3 + randint1(dam);
2828 do_fear = 3 + randint1(dam);
2832 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
2834 note = " falls asleep!";
2837 do_sleep = 3 + randint1(dam);
2843 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
2845 note_dies = " collapses, a mindless husk.";
2853 if (seen) obvious = TRUE;
2855 if (r_ptr->flagsr & RFR_RES_ALL)
2858 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2860 note = " is immune.";
2863 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2866 if (r_ptr->flags2 & RF2_EMPTY_MIND)
2870 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2872 note = " is immune!";
2876 else if ((r_ptr->flags2 & (RF2_STUPID | RF2_WEIRD_MIND)) ||
2877 (r_ptr->flags3 & RF3_ANIMAL) ||
2878 (r_ptr->level > randint1(3 * dam)))
2882 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
2889 * Powerful demons & undead can turn a mindcrafter's
2890 * attacks back on them
2892 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
2893 (r_ptr->level > p_ptr->lev / 2) &&
2898 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
2900 msg_format("%^s%s corrupted mind backlashes your attack!",
2901 m_name, (seen ? "'s" : "s"));
2905 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
2908 msg_print("¤¢¤Ê¤¿¤Ï¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
2910 msg_print("You resist the effects!");
2916 /* Injure + mana drain */
2917 monster_desc(killer, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
2919 msg_print("ĶǽÎϥѥ¤òµÛ¤¤¤È¤é¤ì¤¿¡ª");
2921 msg_print("Your psychic energy is drained!");
2924 p_ptr->csp -= damroll(5, dam) / 2;
2925 if (p_ptr->csp < 0) p_ptr->csp = 0;
2926 p_ptr->redraw |= PR_MANA;
2927 p_ptr->window |= (PW_SPELL);
2928 take_hit(DAMAGE_ATTACK, dam, killer, -1); /* has already been /3 */
2935 int b = damroll(5, dam) / 4;
2937 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¶ìÄˤòĶǽÎϥѥ¤ËÊÑ´¹¤·¤¿¡ª", m_name);
2939 msg_format("You convert %s%s pain into psychic energy!",
2940 m_name, (seen ? "'s" : "s"));
2943 b = MIN(p_ptr->msp, p_ptr->csp + b);
2945 p_ptr->redraw |= PR_MANA;
2946 p_ptr->window |= (PW_SPELL);
2950 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
2952 note_dies = " collapses, a mindless husk.";
2958 case GF_TELEKINESIS:
2960 if (seen) obvious = TRUE;
2962 if (r_ptr->flagsr & RFR_RES_ALL)
2965 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
2967 note = " is immune.";
2970 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
2975 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_dist = 0;
2980 do_stun = damroll((caster_lev / 20) + 3 , dam) + 1;
2982 /* Attempt a saving throw */
2983 if ((r_ptr->flags1 & RF1_UNIQUE) ||
2984 (r_ptr->level > 5 + randint1(dam)))
2988 /* No obvious effect */
2994 /* Psycho-spear -- powerful magic missile */
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);
3013 /* Meteor -- powerful magic missile */
3016 if (seen) obvious = TRUE;
3018 if (r_ptr->flagsr & RFR_RES_ALL)
3021 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3023 note = " is immune.";
3026 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3034 if (!is_hostile(m_ptr)) break;
3036 if (seen) obvious = TRUE;
3038 if (r_ptr->flagsr & RFR_RES_ALL)
3041 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3043 note = " is immune.";
3046 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3049 /* Attempt a saving throw */
3050 if ((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) ||
3051 (r_ptr->flags3 & RF3_NO_CONF) ||
3052 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3054 /* Memorize a flag */
3055 if (r_ptr->flags3 & RF3_NO_CONF)
3057 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3064 * Powerful demons & undead can turn a mindcrafter's
3065 * attacks back on them
3067 if ((r_ptr->flags3 & (RF3_UNDEAD | RF3_DEMON)) &&
3068 (r_ptr->level > p_ptr->lev / 2) &&
3073 msg_format("%^s¤ÎÂÄÍ¤¿Àº¿À¤Ï¹¶·â¤òÄ·¤ÍÊÖ¤·¤¿¡ª", m_name);
3075 msg_format("%^s%s corrupted mind backlashes your attack!",
3076 m_name, (seen ? "'s" : "s"));
3080 if (randint0(100 + r_ptr->level/2) < p_ptr->skill_sav)
3083 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
3085 msg_print("You resist the effects!");
3091 /* Confuse, stun, terrify */
3092 switch (randint1(4))
3095 set_stun(p_ptr->stun + dam / 2);
3098 set_confused(p_ptr->confused + dam / 2);
3102 if (r_ptr->flags3 & RF3_NO_FEAR)
3104 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3106 note = " is unaffected.";
3110 set_afraid(p_ptr->afraid + dam);
3117 /* No obvious effect */
3119 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3121 note = " is unaffected!";
3129 if ((dam > 29) && (randint1(100) < dam))
3132 note = "¤¬¤¢¤Ê¤¿¤ËÎì°¤·¤¿¡£";
3134 note = " is in your thrall!";
3141 switch (randint1(4))
3155 /* No "real" damage */
3162 /* Ice -- Cold + Cuts + Stun */
3165 if (seen) obvious = TRUE;
3167 if (r_ptr->flagsr & RFR_RES_ALL)
3170 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3172 note = " is immune.";
3175 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3178 do_stun = (randint1(15) + 1) / (r + 1);
3179 if (r_ptr->flagsr & RFR_IM_COLD)
3182 note = "¤Ë¤Ï¤«¤Ê¤êÂÑÀ¤¬¤¢¤ë¡£";
3184 note = " resists a lot.";
3188 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_IM_COLD);
3190 else if (r_ptr->flags3 & (RF3_HURT_COLD))
3193 note = "¤Ï¤Ò¤É¤¤Ä˼ê¤ò¤¦¤±¤¿¡£";
3195 note = " is hit hard.";
3199 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_COLD);
3208 if (seen) obvious = TRUE;
3210 if (r_ptr->flagsr & RFR_RES_ALL)
3213 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3215 note = " is immune.";
3218 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3221 if (!monster_living(r_ptr))
3223 if (is_original_ap_and_seen(m_ptr))
3225 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
3226 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
3227 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
3231 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3233 note = " is unaffected!";
3239 else do_time = (dam+7)/8;
3247 if (seen) obvious = TRUE;
3249 if (r_ptr->flagsr & RFR_RES_ALL)
3252 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
3254 note = " is immune.";
3257 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3260 if (!monster_living(r_ptr))
3262 if (is_original_ap_and_seen(m_ptr))
3264 if (r_ptr->flags3 & RF3_DEMON) r_ptr->r_flags3 |= (RF3_DEMON);
3265 if (r_ptr->flags3 & RF3_UNDEAD) r_ptr->r_flags3 |= (RF3_UNDEAD);
3266 if (r_ptr->flags3 & RF3_NONLIVING) r_ptr->r_flags3 |= (RF3_NONLIVING);
3270 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡£";
3272 note = " is immune.";
3278 else if (((r_ptr->flags1 & RF1_UNIQUE) &&
3279 (randint1(888) != 666)) ||
3280 (((r_ptr->level + randint1(20)) > randint1((caster_lev / 2) + randint1(10))) &&
3281 randint1(100) != 66))
3284 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
3296 /* Polymorph monster (Use "dam" as "power") */
3299 if (seen) obvious = TRUE;
3301 if (r_ptr->flagsr & RFR_RES_ALL)
3304 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3306 note = " is immune.";
3309 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3312 /* Attempt to polymorph (see below) */
3315 /* Powerful monsters can resist */
3316 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3317 (r_ptr->flags1 & RF1_QUESTOR) ||
3318 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3321 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3323 note = " is unaffected!";
3330 /* No "real" damage */
3337 /* Clone monsters (Ignore "dam") */
3340 if (seen) obvious = TRUE;
3342 if (is_pet(m_ptr) || (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_NAZGUL | RF7_UNIQUE2)))
3345 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
3347 note = " is unaffected!";
3353 m_ptr->hp = m_ptr->maxhp;
3355 /* Attempt to clone. */
3356 if (multiply_monster(c_ptr->m_idx, TRUE, 0L))
3359 note = "¤¬Ê¬Îö¤·¤¿¡ª";
3367 /* No "real" damage */
3374 /* Heal Monster (use "dam" as amount of healing) */
3377 if (seen) obvious = TRUE;
3382 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
3384 if (m_ptr->maxhp < m_ptr->max_maxhp)
3387 if (seen_msg) msg_format("%^s¤Î¶¯¤µ¤¬Ìá¤Ã¤¿¡£", m_name);
3389 if (seen_msg) msg_format("%^s recovers %s vitality.", m_name, m_poss);
3391 m_ptr->maxhp = m_ptr->max_maxhp;
3397 if (seen) obvious = TRUE;
3402 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
3407 if (seen_msg) msg_format("%^s¤ÏÛ¯Û°¾õÂÖ¤«¤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3409 if (seen_msg) msg_format("%^s is no longer stunned.", m_name);
3413 if (m_ptr->confused)
3416 if (seen_msg) msg_format("%^s¤Ïº®Í𤫤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3418 if (seen_msg) msg_format("%^s is no longer confused.", m_name);
3420 m_ptr->confused = 0;
3425 if (seen_msg) msg_format("%^s¤Ïͦµ¤¤ò¼è¤êÌᤷ¤¿¡£", m_name);
3427 if (seen_msg) msg_format("%^s recovers %s courage.", m_name, m_poss);
3433 if (m_ptr->hp < 30000) m_ptr->hp += dam;
3436 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
3440 chg_virtue(V_VITALITY, 1);
3442 if (r_ptr->flags1 & RF1_UNIQUE)
3443 chg_virtue(V_INDIVIDUALISM, 1);
3445 if (is_friendly(m_ptr))
3446 chg_virtue(V_HONOUR, 1);
3447 else if (!(r_ptr->flags3 & RF3_EVIL))
3449 if (r_ptr->flags3 & RF3_GOOD)
3450 chg_virtue(V_COMPASSION, 2);
3452 chg_virtue(V_COMPASSION, 1);
3455 if (r_ptr->flags3 & RF3_ANIMAL)
3456 chg_virtue(V_NATURE, 1);
3459 if (m_ptr->r_idx == MON_LEPER)
3462 if (!who) chg_virtue(V_COMPASSION, 5);
3465 /* Redraw (later) if needed */
3466 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
3467 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
3471 note = "¤ÏÂÎÎϤò²óÉü¤·¤¿¤è¤¦¤À¡£";
3473 note = " looks healthier.";
3477 /* No "real" damage */
3483 /* Speed Monster (Ignore "dam") */
3486 if (seen) obvious = TRUE;
3492 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
3494 note = " starts moving faster.";
3497 m_ptr->fast = MIN(200, m_ptr->fast + 100);
3499 if (c_ptr->m_idx == p_ptr->riding)
3500 p_ptr->update |= (PU_BONUS);
3504 if (r_ptr->flags1 & RF1_UNIQUE)
3505 chg_virtue(V_INDIVIDUALISM, 1);
3506 if (is_friendly(m_ptr))
3507 chg_virtue(V_HONOUR, 1);
3510 /* No "real" damage */
3516 /* Slow Monster (Use "dam" as "power") */
3519 if (seen) obvious = TRUE;
3521 if (r_ptr->flagsr & RFR_RES_ALL)
3524 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3526 note = " is immune.";
3529 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3532 /* Powerful monsters can resist */
3533 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3534 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3537 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3539 note = " is unaffected!";
3545 /* Normal monsters slow down */
3551 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
3553 note = " starts moving slower.";
3556 m_ptr->slow = MIN(200, m_ptr->slow + 50);
3558 if (c_ptr->m_idx == p_ptr->riding)
3559 p_ptr->update |= (PU_BONUS);
3562 /* No "real" damage */
3568 /* Sleep (Use "dam" as "power") */
3571 if (seen) obvious = TRUE;
3573 if (r_ptr->flagsr & RFR_RES_ALL)
3576 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3578 note = " is immune.";
3581 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3584 /* Attempt a saving throw */
3585 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3586 (r_ptr->flags3 & RF3_NO_SLEEP) ||
3587 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3589 /* Memorize a flag */
3590 if (r_ptr->flags3 & RF3_NO_SLEEP)
3592 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
3595 /* No obvious effect */
3597 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3599 note = " is unaffected!";
3606 /* Go to sleep (much) later */
3608 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
3610 note = " falls asleep!";
3616 /* No "real" damage */
3622 /* Sleep (Use "dam" as "power") */
3623 case GF_STASIS_EVIL:
3625 if (seen) obvious = TRUE;
3627 if (r_ptr->flagsr & RFR_RES_ALL)
3630 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3632 note = " is immune.";
3635 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3638 /* Attempt a saving throw */
3639 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3640 !(r_ptr->flags3 & RF3_EVIL) ||
3641 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3644 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3646 note = " is unaffected!";
3653 /* Go to sleep (much) later */
3655 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3657 note = " is suspended!";
3663 /* No "real" damage */
3668 /* Sleep (Use "dam" as "power") */
3671 if (seen) obvious = TRUE;
3673 if (r_ptr->flagsr & RFR_RES_ALL)
3676 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3678 note = " is immune.";
3681 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3684 /* Attempt a saving throw */
3685 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3686 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3689 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3691 note = " is unaffected!";
3698 /* Go to sleep (much) later */
3700 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3702 note = " is suspended!";
3708 /* No "real" damage */
3717 dam += (adj_con_fix[p_ptr->stat_ind[A_CHR]] - 1);
3718 vir = virtue_number(V_HARMONY);
3721 dam += p_ptr->virtues[vir-1]/10;
3724 vir = virtue_number(V_INDIVIDUALISM);
3727 dam -= p_ptr->virtues[vir-1]/20;
3730 if (seen) obvious = TRUE;
3732 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3735 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3737 note = " is immune.";
3740 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3744 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3747 /* Attempt a saving throw */
3748 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3749 (r_ptr->flags3 & RF3_NO_CONF) ||
3750 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3751 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 5))
3753 /* Memorize a flag */
3754 if (r_ptr->flags3 & RF3_NO_CONF)
3756 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3760 /* No obvious effect */
3762 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3764 note = " is unaffected!";
3769 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3771 else if (p_ptr->cursed & TRC_AGGRAVATE)
3774 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3776 note = " hates you too much!";
3779 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3784 note = "¤ÏÆÍÁ³Í§¹¥Åª¤Ë¤Ê¤Ã¤¿¤è¤¦¤À¡ª";
3786 note = " suddenly seems friendly!";
3791 chg_virtue(V_INDIVIDUALISM, -1);
3792 if (r_ptr->flags3 & RF3_ANIMAL)
3793 chg_virtue(V_NATURE, 1);
3796 /* No "real" damage */
3801 /* Control undead */
3802 case GF_CONTROL_UNDEAD:
3805 if (seen) obvious = TRUE;
3807 vir = virtue_number(V_UNLIFE);
3810 dam += p_ptr->virtues[vir-1]/10;
3813 vir = virtue_number(V_INDIVIDUALISM);
3816 dam -= p_ptr->virtues[vir-1]/20;
3819 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3822 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3824 note = " is immune.";
3827 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3831 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3834 /* Attempt a saving throw */
3835 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3836 (!(r_ptr->flags3 & RF3_UNDEAD)) ||
3837 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3838 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3840 /* No obvious effect */
3842 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3844 note = " is unaffected!";
3848 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3850 else if (p_ptr->cursed & TRC_AGGRAVATE)
3853 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3855 note = " hates you too much!";
3858 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3863 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
3865 note = " is in your thrall!";
3871 /* No "real" damage */
3877 case GF_CONTROL_DEMON:
3880 if (seen) obvious = TRUE;
3882 vir = virtue_number(V_UNLIFE);
3885 dam += p_ptr->virtues[vir-1]/10;
3888 vir = virtue_number(V_INDIVIDUALISM);
3891 dam -= p_ptr->virtues[vir-1]/20;
3894 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3897 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3899 note = " is immune.";
3902 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3906 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3909 /* Attempt a saving throw */
3910 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3911 (!(r_ptr->flags3 & RF3_DEMON)) ||
3912 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3913 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3915 /* No obvious effect */
3917 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3919 note = " is unaffected!";
3923 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3925 else if (p_ptr->cursed & TRC_AGGRAVATE)
3928 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3930 note = " hates you too much!";
3933 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3938 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
3940 note = " is in your thrall!";
3946 /* No "real" damage */
3952 case GF_CONTROL_ANIMAL:
3956 if (seen) obvious = TRUE;
3958 vir = virtue_number(V_NATURE);
3961 dam += p_ptr->virtues[vir-1]/10;
3964 vir = virtue_number(V_INDIVIDUALISM);
3967 dam -= p_ptr->virtues[vir-1]/20;
3970 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3973 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3975 note = " is immune.";
3978 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3982 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3985 /* Attempt a saving throw */
3986 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
3987 (!(r_ptr->flags3 & (RF3_ANIMAL))) ||
3988 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3989 (r_ptr->flags3 & (RF3_NO_CONF)) ||
3990 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3992 /* Memorize a flag */
3993 if (r_ptr->flags3 & (RF3_NO_CONF))
3995 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3999 /* No obvious effect */
4001 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4003 note = " is unaffected!";
4007 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4009 else if (p_ptr->cursed & TRC_AGGRAVATE)
4012 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4014 note = " hates you too much!";
4017 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4022 note = "¤Ï¤Ê¤Ä¤¤¤¿¡£";
4024 note = " is tamed!";
4029 if (r_ptr->flags3 & RF3_ANIMAL)
4030 chg_virtue(V_NATURE, 1);
4033 /* No "real" damage */
4039 case GF_CONTROL_LIVING:
4043 vir = virtue_number(V_UNLIFE);
4044 if (seen) obvious = TRUE;
4046 dam += (adj_chr_chm[p_ptr->stat_ind[A_CHR]]);
4047 vir = virtue_number(V_UNLIFE);
4050 dam -= p_ptr->virtues[vir-1]/10;
4053 vir = virtue_number(V_INDIVIDUALISM);
4056 dam -= p_ptr->virtues[vir-1]/20;
4059 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 30;
4060 if (dam < 1) dam = 1;
4062 msg_format("%s¤ò¸«¤Ä¤á¤¿¡£",m_name);
4064 msg_format("You stare into %s.", m_name);
4066 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
4069 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4071 note = " is immune.";
4074 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4078 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
4081 /* Attempt a saving throw */
4082 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4083 (m_ptr->mflag2 & MFLAG2_NOPET) ||
4084 !monster_living(r_ptr) ||
4085 ((r_ptr->level+10) > randint1(dam)))
4088 /* No obvious effect */
4090 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4092 note = " is unaffected!";
4096 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4098 else if (p_ptr->cursed & TRC_AGGRAVATE)
4101 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4103 note = " hates you too much!";
4106 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4111 note = "¤ò»ÙÇÛ¤·¤¿¡£";
4113 note = " is tamed!";
4118 if (r_ptr->flags3 & RF3_ANIMAL)
4119 chg_virtue(V_NATURE, 1);
4122 /* No "real" damage */
4127 /* Confusion (Use "dam" as "power") */
4130 if (seen) obvious = TRUE;
4132 if (r_ptr->flagsr & RFR_RES_ALL)
4135 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4137 note = " is immune.";
4140 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4143 /* Get confused later */
4144 do_conf = damroll(3, (dam / 2)) + 1;
4146 /* Attempt a saving throw */
4147 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4148 (r_ptr->flags3 & (RF3_NO_CONF)) ||
4149 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4151 /* Memorize a flag */
4152 if (r_ptr->flags3 & (RF3_NO_CONF))
4154 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
4160 /* No obvious effect */
4162 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4164 note = " is unaffected!";
4170 /* No "real" damage */
4177 if (seen) obvious = TRUE;
4179 if (r_ptr->flagsr & RFR_RES_ALL)
4182 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4184 note = " is immune.";
4187 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4190 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
4192 /* Attempt a saving throw */
4193 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4194 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4199 /* No obvious effect */
4201 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4203 note = " is unaffected!";
4209 /* No "real" damage */
4217 /* Lite, but only hurts susceptible creatures */
4225 if (r_ptr->flagsr & RFR_RES_ALL)
4231 if (r_ptr->flags3 & (RF3_HURT_LITE))
4233 /* Obvious effect */
4234 if (seen) obvious = TRUE;
4236 /* Memorize the effects */
4237 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4239 /* Special effect */
4241 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4242 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4244 note = " cringes from the light!";
4245 note_dies = " shrivels away in the light!";
4250 /* Normally no damage */
4262 /* Lite -- opposite of Dark */
4265 if (seen) obvious = TRUE;
4267 if (r_ptr->flagsr & RFR_RES_ALL)
4270 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4272 note = " is immune.";
4275 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4278 if (r_ptr->flagsr & RFR_RES_LITE)
4281 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4286 dam *= 2; dam /= (randint1(6)+6);
4287 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_LITE);
4289 else if (r_ptr->flags3 & (RF3_HURT_LITE))
4291 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4293 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4294 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4296 note = " cringes from the light!";
4297 note_dies = " shrivels away in the light!";
4306 /* Dark -- opposite of Lite */
4309 if (seen) obvious = TRUE;
4311 if (r_ptr->flagsr & RFR_RES_ALL)
4314 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4316 note = " is immune.";
4319 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4322 if (r_ptr->flagsr & RFR_RES_DARK)
4325 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4330 dam *= 2; dam /= (randint1(6)+6);
4331 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DARK);
4340 if (r_ptr->flagsr & RFR_RES_ALL)
4345 /* Hurt by rock remover */
4346 if (r_ptr->flags3 & (RF3_HURT_ROCK))
4349 if (seen) obvious = TRUE;
4351 /* Memorize the effects */
4352 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
4354 /* Cute little message */
4356 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
4357 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4359 note = " loses some skin!";
4360 note_dies = " dissolves!";
4365 /* Usually, ignore the effects */
4376 /* Teleport undead (Use "dam" as "power") */
4377 case GF_AWAY_UNDEAD:
4379 /* Only affect undead */
4380 if (r_ptr->flags3 & (RF3_UNDEAD))
4382 bool resists_tele = FALSE;
4384 if (r_ptr->flagsr & RFR_RES_TELE)
4386 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4388 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4390 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4392 note = " is unaffected!";
4395 resists_tele = TRUE;
4397 else if (r_ptr->level > randint1(100))
4399 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4401 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4406 resists_tele = TRUE;
4412 if (seen) obvious = TRUE;
4413 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4425 /* No "real" damage */
4431 /* Teleport evil (Use "dam" as "power") */
4434 /* Only affect evil */
4435 if (r_ptr->flags3 & (RF3_EVIL))
4437 bool resists_tele = FALSE;
4439 if (r_ptr->flagsr & RFR_RES_TELE)
4441 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4443 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4445 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4447 note = " is unaffected!";
4450 resists_tele = TRUE;
4452 else if (r_ptr->level > randint1(100))
4454 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4456 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4461 resists_tele = TRUE;
4467 if (seen) obvious = TRUE;
4468 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4480 /* No "real" damage */
4486 /* Teleport monster (Use "dam" as "power") */
4489 bool resists_tele = FALSE;
4490 if (r_ptr->flagsr & RFR_RES_TELE)
4492 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4494 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4496 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4498 note = " is unaffected!";
4501 resists_tele = TRUE;
4503 else if (r_ptr->level > randint1(100))
4505 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4507 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4512 resists_tele = TRUE;
4519 if (seen) obvious = TRUE;
4521 /* Prepare to teleport */
4525 /* No "real" damage */
4531 /* Turn undead (Use "dam" as "power") */
4532 case GF_TURN_UNDEAD:
4534 if (r_ptr->flagsr & RFR_RES_ALL)
4539 /* Only affect undead */
4540 if (r_ptr->flags3 & (RF3_UNDEAD))
4543 if (seen) obvious = TRUE;
4545 /* Learn about type */
4546 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4548 /* Apply some fear */
4549 do_fear = damroll(3, (dam / 2)) + 1;
4551 /* Attempt a saving throw */
4552 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4554 /* No obvious effect */
4556 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4558 note = " is unaffected!";
4573 /* No "real" damage */
4579 /* Turn evil (Use "dam" as "power") */
4582 if (r_ptr->flagsr & RFR_RES_ALL)
4587 /* Only affect evil */
4588 if (r_ptr->flags3 & (RF3_EVIL))
4591 if (seen) obvious = TRUE;
4593 /* Learn about type */
4594 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4596 /* Apply some fear */
4597 do_fear = damroll(3, (dam / 2)) + 1;
4599 /* Attempt a saving throw */
4600 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4602 /* No obvious effect */
4604 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4606 note = " is unaffected!";
4621 /* No "real" damage */
4627 /* Turn monster (Use "dam" as "power") */
4630 if (r_ptr->flagsr & RFR_RES_ALL)
4636 if (seen) obvious = TRUE;
4638 /* Apply some fear */
4639 do_fear = damroll(3, (dam / 2)) + 1;
4641 /* Attempt a saving throw */
4642 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4643 (r_ptr->flags3 & (RF3_NO_FEAR)) ||
4644 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4646 /* No obvious effect */
4648 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4650 note = " is unaffected!";
4657 /* No "real" damage */
4664 case GF_DISP_UNDEAD:
4666 if (r_ptr->flagsr & RFR_RES_ALL)
4672 /* Only affect undead */
4673 if (r_ptr->flags3 & (RF3_UNDEAD))
4676 if (seen) obvious = TRUE;
4678 /* Learn about type */
4679 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4683 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4684 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4686 note = " shudders.";
4687 note_dies = " dissolves!";
4708 if (r_ptr->flagsr & RFR_RES_ALL)
4714 /* Only affect evil */
4715 if (r_ptr->flags3 & (RF3_EVIL))
4718 if (seen) obvious = TRUE;
4720 /* Learn about type */
4721 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4725 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4726 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4728 note = " shudders.";
4729 note_dies = " dissolves!";
4749 if (r_ptr->flagsr & RFR_RES_ALL)
4755 /* Only affect good */
4756 if (r_ptr->flags3 & (RF3_GOOD))
4759 if (seen) obvious = TRUE;
4761 /* Learn about type */
4762 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
4766 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4767 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4769 note = " shudders.";
4770 note_dies = " dissolves!";
4788 case GF_DISP_LIVING:
4790 if (r_ptr->flagsr & RFR_RES_ALL)
4796 /* Only affect non-undead */
4797 if (monster_living(r_ptr))
4800 if (seen) obvious = TRUE;
4804 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4805 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4807 note = " shudders.";
4808 note_dies = " dissolves!";
4829 if (r_ptr->flagsr & RFR_RES_ALL)
4835 /* Only affect demons */
4836 if (r_ptr->flags3 & (RF3_DEMON))
4839 if (seen) obvious = TRUE;
4841 /* Learn about type */
4842 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
4846 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4847 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4849 note = " shudders.";
4850 note_dies = " dissolves!";
4867 /* Dispel monster */
4870 if (r_ptr->flagsr & RFR_RES_ALL)
4877 if (seen) obvious = TRUE;
4881 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4882 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4884 note = " shudders.";
4885 note_dies = " dissolves!";
4895 if (seen) obvious = TRUE;
4897 if (r_ptr->flagsr & RFR_RES_ALL)
4900 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4902 note = " is immune.";
4905 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4909 if ((r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) || (r_ptr->flags5 & ~(RF5_NOMAGIC_MASK)) || (r_ptr->flags6 & ~(RF6_NOMAGIC_MASK)))
4913 /* Heal the monster */
4914 if (caster_ptr->hp < caster_ptr->maxhp)
4917 caster_ptr->hp += 6 * dam;
4918 if (caster_ptr->hp > caster_ptr->maxhp) caster_ptr->hp = caster_ptr->maxhp;
4920 /* Redraw (later) if needed */
4921 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
4922 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
4924 /* Special message */
4927 /* Get the monster name */
4928 monster_desc(killer, caster_ptr, 0);
4930 msg_format("%^s¤Ïµ¤Ê¬¤¬Îɤµ¤½¤¦¤À¡£", killer);
4932 msg_format("%^s appears healthier.", killer);
4941 msg_format("%s¤«¤éÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¤È¤Ã¤¿¡£", m_name);
4943 msg_format("You draw psychic energy from %s.", m_name);
4946 (void)hp_player(dam);
4952 if (see_s_msg) msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", m_name);
4954 if (see_s_msg) msg_format("%s is unaffected.", m_name);
4964 if (seen) obvious = TRUE;
4967 if (!who) msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£", m_name);
4969 if (!who) msg_format("You gaze intently at %s.", m_name);
4972 if (r_ptr->flagsr & RFR_RES_ALL)
4975 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4977 note = " is immune.";
4980 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4984 /* Attempt a saving throw */
4985 if ((r_ptr->flags1 & RF1_UNIQUE) ||
4986 (r_ptr->flags3 & RF3_NO_CONF) ||
4987 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
4989 /* Memorize a flag */
4990 if (r_ptr->flags3 & (RF3_NO_CONF))
4992 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
4995 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
4997 note = "is unaffected!";
5001 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
5003 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5005 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5007 note = " is immune!";
5011 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
5013 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
5015 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
5024 note = "¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£";
5025 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
5027 note = " is blasted by psionic energy.";
5028 note_dies = " collapses, a mindless husk.";
5031 if (who > 0) do_conf = randint0(4) + 4;
5032 else do_conf = randint0(8) + 8;
5038 case GF_BRAIN_SMASH:
5040 if (seen) obvious = TRUE;
5043 if (!who) msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£", m_name);
5045 if (!who) msg_format("You gaze intently at %s.", m_name);
5048 if (r_ptr->flagsr & RFR_RES_ALL)
5051 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5053 note = " is immune.";
5056 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5060 /* Attempt a saving throw */
5061 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5062 (r_ptr->flags3 & RF3_NO_CONF) ||
5063 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
5065 /* Memorize a flag */
5066 if (r_ptr->flags3 & (RF3_NO_CONF))
5068 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
5071 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5073 note = "is unaffected!";
5077 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
5079 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5081 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5083 note = " is immune!";
5087 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
5089 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
5091 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
5100 note = "¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£";
5101 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
5103 note = " is blasted by psionic energy.";
5104 note_dies = " collapses, a mindless husk.";
5109 do_conf = randint0(4) + 4;
5110 do_stun = randint0(4) + 4;
5114 do_conf = randint0(8) + 8;
5115 do_stun = randint0(8) + 8;
5117 m_ptr->slow = MIN(200, m_ptr->slow + 10);
5118 if (c_ptr->m_idx == p_ptr->riding)
5119 p_ptr->update |= (PU_BONUS);
5127 if (seen) obvious = TRUE;
5130 if (!who) msg_format("%s¤ò»Øº¹¤·¤Æ¼ö¤¤¤ò¤«¤±¤¿¡£", m_name);
5132 if (!who) msg_format("You point at %s and curses.", m_name);
5135 if (r_ptr->flagsr & RFR_RES_ALL)
5138 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5140 note = " is immune.";
5143 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5147 /* Attempt a saving throw */
5148 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
5151 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5153 note = "is unaffected!";
5163 if (seen) obvious = TRUE;
5166 if (!who) msg_format("%s¤ò»Øº¹¤·¤Æ¶²¤í¤·¤²¤Ë¼ö¤¤¤ò¤«¤±¤¿¡£", m_name);
5168 if (!who) msg_format("You point at %s and curses horribly.", m_name);
5171 if (r_ptr->flagsr & RFR_RES_ALL)
5174 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5176 note = " is immune.";
5179 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5183 /* Attempt a saving throw */
5184 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
5187 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5189 note = "is unaffected!";
5199 if (seen) obvious = TRUE;
5202 if (!who) msg_format("%s¤ò»Øº¹¤·¡¢¶²¤í¤·¤²¤Ë¼öʸ¤ò¾§¤¨¤¿¡ª", m_name);
5204 if (!who) msg_format("You point at %s, incanting terribly!", m_name);
5207 if (r_ptr->flagsr & RFR_RES_ALL)
5210 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5212 note = " is immune.";
5215 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5219 /* Attempt a saving throw */
5220 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
5223 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5225 note = "is unaffected!";
5235 if (seen) obvious = TRUE;
5238 if (!who) msg_format("%s¤ÎÈ빦¤òÆͤ¤¤Æ¡¢¡Ö¤ªÁ°¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡×¤È¶«¤ó¤À¡£", m_name);
5240 if (!who) msg_format("You point at %s, screaming the word, 'DIE!'.", m_name);
5243 if (r_ptr->flagsr & RFR_RES_ALL)
5246 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5248 note = " is immune.";
5251 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5255 /* Attempt a saving throw */
5256 if ((randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35)) && ((who <= 0) || (caster_ptr->r_idx != MON_KENSHIROU)))
5259 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5261 note = "is unaffected!";
5271 if (seen) obvious = TRUE;
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 if (r_ptr->flags1 & RF1_UNIQUE)
5288 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5290 note = "is unaffected!";
5296 if ((who > 0) ? ((caster_lev + randint1(dam)) > (r_ptr->level + 10 + randint1(20))) :
5297 (((caster_lev / 2) + randint1(dam)) > (r_ptr->level + randint1(200))))
5299 dam = ((40 + randint1(20)) * m_ptr->hp) / 100;
5301 if (m_ptr->hp < dam) dam = m_ptr->hp - 1;
5306 note = "¤ÏÂÑÀ¤ò»ý¤Ã¤Æ¤¤¤ë¡ª";
5316 /* Capture monster */
5320 if ((p_ptr->inside_quest && (quest[p_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(m_ptr)) ||
5321 (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)
5324 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£",m_name);
5326 msg_format("%^s is unaffected.", m_name);
5332 if (is_pet(m_ptr)) nokori_hp = m_ptr->maxhp*4L;
5333 else if ((p_ptr->pclass == CLASS_BEASTMASTER) && monster_living(r_ptr))
5334 nokori_hp = m_ptr->maxhp * 3 / 10;
5336 nokori_hp = m_ptr->maxhp * 3 / 20;
5338 if (m_ptr->hp >= nokori_hp)
5341 msg_format("¤â¤Ã¤È¼å¤é¤»¤Ê¤¤¤È¡£");
5343 msg_format("You need to weaken %s more.", m_name);
5347 else if (m_ptr->hp < randint0(nokori_hp))
5349 if (m_ptr->mflag2 & MFLAG2_CHAMELEON) choose_new_monster(c_ptr->m_idx, FALSE, MON_CHAMELEON);
5351 msg_format("%s¤òÊᤨ¤¿¡ª",m_name);
5353 msg_format("You capture %^s!", m_name);
5355 cap_mon = m_list[c_ptr->m_idx].r_idx;
5356 cap_mspeed = m_list[c_ptr->m_idx].mspeed;
5357 cap_hp = m_list[c_ptr->m_idx].hp;
5358 cap_maxhp = m_list[c_ptr->m_idx].max_maxhp;
5359 if (m_list[c_ptr->m_idx].nickname)
5360 cap_nickname = quark_add(quark_str(m_list[c_ptr->m_idx].nickname));
5363 if (c_ptr->m_idx == p_ptr->riding)
5365 if (rakuba(-1, FALSE))
5368 msg_print("ÃÏÌ̤ËÍî¤È¤µ¤ì¤¿¡£");
5370 msg_format("You have fallen from %s.", m_name);
5375 delete_monster_idx(c_ptr->m_idx);
5382 msg_format("¤¦¤Þ¤¯Êá¤Þ¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡£");
5384 msg_format("You failed to capture %s.", m_name);
5391 /* Attack (Use "dam" as attack type) */
5394 /* Return this monster's death */
5395 return py_attack(y, x, dam);
5398 /* Sleep (Use "dam" as "power") */
5404 if (seen) obvious = TRUE;
5406 if (r_ptr->flagsr & RFR_RES_ALL)
5409 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5411 note = " is immune.";
5414 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5417 if (r_ptr->flags2 & RF2_EMPTY_MIND)
5420 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5422 note = " is immune!";
5426 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5432 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5434 note = " is immune!";
5441 if (one_in_(5)) effect = 1;
5442 else if (one_in_(4)) effect = 2;
5443 else if (one_in_(3)) effect = 3;
5448 /* Powerful monsters can resist */
5449 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5450 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5453 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5455 note = " is unaffected!";
5461 /* Normal monsters slow down */
5467 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
5469 note = " starts moving slower.";
5472 m_ptr->slow = MIN(200, m_ptr->slow + 50);
5474 if (c_ptr->m_idx == p_ptr->riding)
5475 p_ptr->update |= (PU_BONUS);
5479 else if (effect == 2)
5481 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
5483 /* Attempt a saving throw */
5484 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
5485 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5490 /* No obvious effect */
5492 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5494 note = " is unaffected!";
5501 else if (effect == 3)
5503 /* Attempt a saving throw */
5504 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5505 (r_ptr->flags3 & RF3_NO_SLEEP) ||
5506 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5508 /* Memorize a flag */
5509 if (r_ptr->flags3 & RF3_NO_SLEEP)
5511 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
5514 /* No obvious effect */
5516 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5518 note = " is unaffected!";
5525 /* Go to sleep (much) later */
5527 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5529 note = " falls asleep!";
5539 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5541 note = " is immune!";
5545 /* No "real" damage */
5554 if (seen) obvious = TRUE;
5556 if (r_ptr->flagsr & RFR_RES_ALL)
5559 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5561 note = " is immune.";
5564 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5568 if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_UNIQUE2)) || (c_ptr->m_idx == p_ptr->riding)) || p_ptr->inside_arena || p_ptr->inside_quest)
5575 if ((r_ptr->level > randint0(dam)) || (m_ptr->mflag2 & MFLAG2_NOGENO))
5582 delete_monster_idx(c_ptr->m_idx);
5584 msg_format("%s¤Ï¾ÃÌǤ·¤¿¡ª",m_name);
5586 msg_format("%^s disappered!",m_name);
5590 take_hit(DAMAGE_GENO, randint1((r_ptr->level+1)/2), "¥â¥ó¥¹¥¿¡¼¾ÃÌǤμöʸ¤ò¾§¤¨¤¿ÈèÏ«", -1);
5592 take_hit(DAMAGE_GENO, randint1((r_ptr->level+1)/2), "the strain of casting Genocide One", -1);
5596 chg_virtue(V_VITALITY, -1);
5601 p_ptr->redraw |= (PR_HP);
5604 p_ptr->window |= (PW_PLAYER);
5611 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5613 note = "is unaffected!";
5616 if (one_in_(13)) m_ptr->mflag2 |= MFLAG2_NOGENO;
5624 if (!who) msg_format("%s¤ò¼Ì¿¿¤Ë»£¤Ã¤¿¡£", m_name);
5626 if (!who) msg_format("You take a photograph of %s.", m_name);
5629 if (r_ptr->flags3 & (RF3_HURT_LITE))
5631 /* Obvious effect */
5632 if (seen) obvious = TRUE;
5634 /* Memorize the effects */
5635 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
5637 /* Special effect */
5639 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
5640 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5642 note = " cringes from the light!";
5643 note_dies = " shrivels away in the light!";
5647 /* Normally no damage */
5654 photo = m_ptr->r_idx;
5661 case GF_BLOOD_CURSE:
5663 if (seen) obvious = TRUE;
5665 if (r_ptr->flagsr & RFR_RES_ALL)
5668 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5670 note = " is immune.";
5673 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5681 bool success = FALSE;
5682 if (seen) obvious = TRUE;
5684 if ((r_ptr->flags3 & (RF3_GOOD)) && !p_ptr->inside_arena)
5686 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 50;
5687 if (dam < 1) dam = 1;
5689 /* No need to tame your pet */
5693 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
5695 note = " starts moving faster.";
5698 m_ptr->fast = MIN(200, m_ptr->fast + 100);
5702 /* Attempt a saving throw */
5703 else if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
5704 (r_ptr->flags1 & (RF1_UNIQUE)) ||
5705 (m_ptr->mflag2 & MFLAG2_NOPET) ||
5706 (p_ptr->cursed & TRC_AGGRAVATE) ||
5707 ((r_ptr->level+10) > randint1(dam)))
5710 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
5715 note = "¤ò»ÙÇÛ¤·¤¿¡£";
5717 note = " is tamed!";
5721 m_ptr->fast = MIN(200, m_ptr->fast + 100);
5723 /* Learn about type */
5724 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
5731 if (!(r_ptr->flags3 & RF3_NO_FEAR))
5733 do_fear = randint1(90)+10;
5735 else if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_FEAR);
5738 /* No "real" damage */
5745 if (seen) obvious = TRUE;
5747 if (r_ptr->flagsr & RFR_RES_ALL)
5750 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5752 note = " is immune.";
5755 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5759 /* Attempt a saving throw */
5760 if (randint0(100 + dam) < (r_ptr->level + 50))
5764 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5766 note = "is unaffected!";
5787 /* Absolutely no effect */
5788 if (skipped) return (FALSE);
5790 /* "Unique" monsters cannot be polymorphed */
5791 if (r_ptr->flags1 & (RF1_UNIQUE)) do_poly = FALSE;
5793 /* Quest monsters cannot be polymorphed */
5794 if (r_ptr->flags1 & RF1_QUESTOR) do_poly = FALSE;
5796 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_poly = FALSE;
5798 /* "Unique" and "quest" monsters can only be "killed" by the player. */
5799 if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & RF7_NAZGUL)) && !p_ptr->inside_battle)
5801 if (who && (dam > m_ptr->hp)) dam = m_ptr->hp;
5806 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_COMPASSION, -1);
5807 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_HONOUR, -1);
5810 /* Modify the damage */
5812 dam = mon_damage_mod(m_ptr, dam, (bool)(typ == GF_PSY_SPEAR));
5814 if ((tmp > 0) && (dam == 0)) note = "¤Ï¥À¥á¡¼¥¸¤ò¼õ¤±¤Æ¤¤¤Ê¤¤¡£";
5816 if ((tmp > 0) && (dam == 0)) note = " is unharmed.";
5819 /* Check for death */
5820 if (dam > m_ptr->hp)
5822 /* Extract method of death */
5827 /* Sound and Impact resisters never stun */
5829 !(r_ptr->flagsr & (RFR_RES_SOUN | RFR_RES_WALL)) &&
5830 !(r_ptr->flags3 & RF3_NO_STUN))
5833 if (seen) obvious = TRUE;
5839 note = "¤Ï¤Ò¤É¤¯¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5841 note = " is more dazed.";
5844 tmp = m_ptr->stunned + (do_stun / 2);
5849 note = "¤Ï¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5851 note = " is dazed.";
5858 m_ptr->stunned = (tmp < 200) ? tmp : 200;
5864 /* Confusion and Chaos resisters (and sleepers) never confuse */
5866 !(r_ptr->flags3 & RF3_NO_CONF) &&
5867 !(r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK))
5870 if (seen) obvious = TRUE;
5872 /* Already partially confused */
5873 if (m_ptr->confused)
5876 note = "¤Ï¤µ¤é¤Ëº®Í𤷤¿¤è¤¦¤À¡£";
5878 note = " looks more confused.";
5881 tmp = m_ptr->confused + (do_conf / 2);
5884 /* Was not confused */
5888 note = "¤Ïº®Í𤷤¿¤è¤¦¤À¡£";
5890 note = " looks confused.";
5896 /* Apply confusion */
5897 m_ptr->confused = (tmp < 200) ? tmp : 200;
5906 if (seen) obvious = TRUE;
5908 if (do_time >= m_ptr->maxhp) do_time = m_ptr->maxhp - 1;
5913 note = "¤Ï¼å¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£";
5915 note = " seems weakened.";
5917 m_ptr->maxhp -= do_time;
5918 if ((m_ptr->hp - dam) > m_ptr->maxhp) dam = m_ptr->hp - m_ptr->maxhp;
5923 /* Mega-Hack -- Handle "polymorph" -- monsters get a saving throw */
5924 if (do_poly && (randint1(90) > r_ptr->level))
5926 if (polymorph_monster(y, x))
5929 if (seen) obvious = TRUE;
5931 /* Monster polymorphs */
5933 note = "¤¬ÊѿȤ·¤¿¡ª";
5938 /* Turn off the damage */
5941 /* Hack -- Get new monster */
5942 m_ptr = &m_list[c_ptr->m_idx];
5944 /* Hack -- Get new race */
5945 r_ptr = &r_info[m_ptr->r_idx];
5951 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5953 note = " is unaffected!";
5958 /* Handle "teleport" */
5962 if (seen) obvious = TRUE;
5966 note = "¤¬¾Ã¤¨µî¤Ã¤¿¡ª";
5968 note = " disappears!";
5971 if (!who) chg_virtue(V_VALOUR, -1);
5974 teleport_away(c_ptr->m_idx, do_dist, (bool)(!who), TRUE);
5976 /* Hack -- get new location */
5980 /* Hack -- get new grid */
5981 c_ptr = &cave[y][x];
5988 tmp = m_ptr->monfear + do_fear;
5991 m_ptr->monfear = (tmp < 200) ? tmp : 200;
5998 if (typ == GF_DRAIN_MANA)
6000 /* Drain mana does nothing */
6003 /* If another monster did the damage, hurt the monster by hand */
6006 /* Redraw (later) if needed */
6007 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
6008 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
6010 /* Wake the monster up */
6013 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
6015 /* Hurt the monster */
6023 if (is_pet(m_ptr) && !(m_ptr->ml))
6026 /* Give detailed messages if destroyed */
6029 monster_desc(m_name, m_ptr, MD_TRUE_NAME);
6032 msg_format("%^s%s", m_name, note);
6040 monster_gain_exp(who, m_ptr->r_idx);
6042 /* Generate treasure, etc */
6043 monster_death(c_ptr->m_idx, FALSE);
6045 /* Delete the monster */
6046 delete_monster_idx(c_ptr->m_idx);
6051 msg_print("¾¯¤·Èᤷ¤¤µ¤Ê¬¤¬¤·¤¿¡£");
6053 msg_print("You feel sad for a moment.");
6059 /* Damaged monster */
6062 /* Give detailed messages if visible or destroyed */
6063 if (note && seen_msg) msg_format("%^s%s", m_name, note);
6065 /* Hack -- Pain message */
6068 message_pain(c_ptr->m_idx, dam);
6075 /* Hack -- handle sleep */
6076 if (do_sleep) m_ptr->csleep = do_sleep;
6080 else if (heal_leper)
6083 if (seen_msg) msg_print("ÉÔ·é¤ÊÉ¿ͤÏɵ¤¤¬¼£¤Ã¤¿¡ª");
6085 if (seen_msg) msg_print("The Mangy looking leper is healed!");
6088 delete_monster_idx(c_ptr->m_idx);
6091 /* If the player did it, give him experience, check fear */
6096 /* Hurt the monster, check for fear and death */
6097 if (mon_take_hit(c_ptr->m_idx, dam, &fear, note_dies))
6102 /* Damaged monster */
6105 /* HACK - anger the monster before showing the sleep message */
6106 if (do_sleep) anger_monster(m_ptr);
6108 /* Give detailed messages if visible or destroyed */
6109 if (note && seen_msg)
6111 msg_format("%s%s", m_name, note);
6113 msg_format("%^s%s", m_name, note);
6117 /* Hack -- Pain message */
6118 else if (known && (dam || !do_fear))
6120 message_pain(c_ptr->m_idx, dam);
6123 /* Anger monsters */
6124 if (((dam > 0) || get_angry) && !do_sleep)
6125 anger_monster(m_ptr);
6128 if ((fear || do_fear) && seen)
6135 msg_format("%^s¤Ï¶²Éݤ·¤Æƨ¤²½Ð¤·¤¿¡ª", m_name);
6137 msg_format("%^s flees in terror!", m_name);
6141 /* Hack -- handle sleep */
6142 if (do_sleep) m_ptr->csleep = do_sleep;
6146 if ((typ == GF_BLOOD_CURSE) && one_in_(4))
6148 int curse_flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
6152 switch (randint1(28))
6158 msg_print("ÃÏÌ̤¬Íɤ줿...");
6160 msg_print("The ground trembles...");
6163 earthquake(ty, tx, 4 + randint0(4));
6164 if (!one_in_(6)) break;
6166 case 3: case 4: case 5: case 6:
6169 int dam = damroll(10, 10);
6171 msg_print("½ã¿è¤ÊËâÎϤμ¡¸µ¤Ø¤ÎÈ⤬³«¤¤¤¿¡ª");
6173 msg_print("A portal opens to a plane of raw mana!");
6176 project(0, 8, ty,tx, dam, GF_MANA, curse_flg, -1);
6177 if (!one_in_(6)) break;
6183 msg_print("¶õ´Ö¤¬ÏĤó¤À¡ª");
6185 msg_print("Space warps about you!");
6188 if (m_ptr->r_idx) teleport_away(c_ptr->m_idx, damroll(10, 10), FALSE, TRUE);
6189 if (one_in_(13)) count += activate_hi_summon(ty, tx, TRUE);
6190 if (!one_in_(6)) break;
6192 case 9: case 10: case 11:
6194 msg_print("¥¨¥Í¥ë¥®¡¼¤Î¤¦¤Í¤ê¤ò´¶¤¸¤¿¡ª");
6196 msg_print("You feel a surge of energy!");
6199 project(0, 7, ty, tx, 50, GF_DISINTEGRATE, curse_flg, -1);
6200 if (!one_in_(6)) break;
6201 case 12: case 13: case 14: case 15: case 16:
6202 aggravate_monsters(0);
6203 if (!one_in_(6)) break;
6205 count += activate_hi_summon(ty, tx, TRUE);
6206 if (!one_in_(6)) break;
6207 case 19: case 20: case 21: case 22:
6209 bool pet = !one_in_(3);
6210 u32b mode = PM_ALLOW_GROUP;
6212 if (pet) mode |= PM_FORCE_PET;
6213 else mode |= (PM_NO_PET | PM_FORCE_FRIENDLY);
6215 count += summon_specific((pet ? -1 : 0), py, px, (pet ? p_ptr->lev*2/3+randint1(p_ptr->lev/2) : dun_level), 0, mode);
6216 if (!one_in_(6)) break;
6218 case 23: case 24: case 25:
6219 if (p_ptr->hold_life && (randint0(100) < 75)) break;
6221 msg_print("À¸Ì¿ÎϤ¬ÂΤ«¤éµÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
6223 msg_print("You feel your life draining away...");
6226 if (p_ptr->hold_life) lose_exp(p_ptr->exp / 160);
6227 else lose_exp(p_ptr->exp / 16);
6228 if (!one_in_(6)) break;
6229 case 26: case 27: case 28:
6238 (void)do_dec_stat(i);
6247 (void)do_dec_stat(randint0(6));
6256 if (p_ptr->inside_battle)
6258 p_ptr->health_who = c_ptr->m_idx;
6259 p_ptr->redraw |= (PR_HEALTH);
6263 /* XXX XXX XXX Verify this code */
6265 /* Update the monster */
6266 update_mon(c_ptr->m_idx, FALSE);
6268 /* Redraw the monster grid */
6272 /* Update monster recall window */
6273 if (p_ptr->monster_race_idx == m_ptr->r_idx)
6276 p_ptr->window |= (PW_MONSTER);
6279 if ((dam > 0) && !is_pet(m_ptr) && !is_friendly(m_ptr))
6283 if (!projectable(m_ptr->fy, m_ptr->fx, py, px) && !(flg & PROJECT_NO_HANGEKI))
6285 set_target(m_ptr, monster_target_y, monster_target_x);
6288 else if ((who > 0) && is_pet(caster_ptr) && !player_bold(m_ptr->target_y, m_ptr->target_x))
6290 set_target(m_ptr, caster_ptr->fy, caster_ptr->fx);
6294 if (p_ptr->riding && (p_ptr->riding == c_ptr->m_idx) && (dam > 0))
6296 if (m_ptr->hp > m_ptr->maxhp/3) dam = (dam + 1) / 2;
6297 rakubadam_m = (dam > 200) ? 200 : dam;
6306 /* Get local object */
6309 /* Prepare to make a Blade of Chaos */
6310 object_prep(q_ptr, lookup_kind(TV_STATUE, SV_PHOTO));
6312 q_ptr->pval = photo;
6314 /* Mark the item as fully known */
6315 q_ptr->ident |= (IDENT_MENTAL);
6317 /* Drop it in the dungeon */
6318 (void)drop_near(q_ptr, -1, py, px);
6326 /* Return "Anything seen?" */
6332 * Helper function for "project()" below.
6334 * Handle a beam/bolt/ball causing damage to the player.
6336 * This routine takes a "source monster" (by index), a "distance", a default
6337 * "damage", and a "damage type". See "project_m()" above.
6339 * If "rad" is non-zero, then the blast was centered elsewhere, and the damage
6340 * is reduced (see "project_m()" above). This can happen if a monster breathes
6341 * at the player and hits a wall instead.
6343 * NOTE (Zangband): 'Bolt' attacks can be reflected back, so we need
6344 * to know if this is actually a ball or a bolt spell
6347 * We return "TRUE" if any "obvious" effects were observed. XXX XXX Actually,
6348 * we just assume that the effects were obvious, for historical reasons.
6350 static bool project_p(int who, cptr who_name, int r, int y, int x, int dam, int typ, int flg, int monspell)
6355 /* Hack -- assume obvious */
6356 bool obvious = TRUE;
6358 /* Player blind-ness */
6359 bool blind = (p_ptr->blind ? TRUE : FALSE);
6361 /* Player needs a "description" (he is blind) */
6364 /* Source monster */
6365 monster_type *m_ptr = NULL;
6367 /* Monster name (for attacks) */
6370 /* Monster name (for damage) */
6373 /* Hack -- messages */
6379 /* Player is not here */
6380 if (!player_bold(y, x)) return (FALSE);
6382 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && (randint0(55) < (p_ptr->lev*3/5+20)) && who && (who != p_ptr->riding))
6388 /* Player cannot hurt himself */
6389 if (!who) return (FALSE);
6390 if (who == p_ptr->riding) return (FALSE);
6392 if ((p_ptr->reflect || ((p_ptr->special_defense & KATA_FUUJIN) && !p_ptr->blind)) && (flg & PROJECT_REFLECTABLE) && !one_in_(10))
6395 int max_attempts = 10;
6398 if (blind) msg_print("²¿¤«¤¬Ä·¤ÍÊ֤ä¿¡ª");
6399 else if (p_ptr->special_defense & KATA_FUUJIN) msg_print("É÷¤ÎÇ¡¤¯Éð´ï¤ò¿¶¤ë¤Ã¤ÆÃƤÊÖ¤·¤¿¡ª");
6400 else msg_print("¹¶·â¤¬Ä·¤ÍÊ֤ä¿¡ª");
6402 if (blind) msg_print("Something bounces!");
6403 else msg_print("The attack bounces!");
6407 /* Choose 'new' target */
6410 t_y = m_list[who].fy - 1 + randint1(3);
6411 t_x = m_list[who].fx - 1 + randint1(3);
6414 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(py, px, t_y, t_x));
6416 if (max_attempts < 1)
6418 t_y = m_list[who].fy;
6419 t_x = m_list[who].fx;
6422 project(0, 0, t_y, t_x, dam, typ, (PROJECT_STOP|PROJECT_KILL|PROJECT_REFLECTABLE), monspell);
6429 /* Limit maximum damage */
6430 if (dam > 1600) dam = 1600;
6432 /* Reduce damage by distance */
6433 dam = (dam + r) / (r + 1);
6436 /* If the player is blind, be more descriptive */
6437 if (blind) fuzzy = TRUE;
6442 /* Get the source monster */
6443 m_ptr = &m_list[who];
6444 /* Extract the monster level */
6445 rlev = (((&r_info[m_ptr->r_idx])->level >= 1) ? (&r_info[m_ptr->r_idx])->level : 1);
6447 /* Get the monster name */
6448 monster_desc(m_name, m_ptr, 0);
6450 /* Get the monster's real name (gotten before polymorph!) */
6451 strcpy(killer, who_name);
6456 strcpy(killer, "æ«");
6458 strcpy(killer, "a trap");
6462 /* Analyze the damage */
6465 /* Standard damage -- hurts inventory too */
6469 if (fuzzy) msg_print("»À¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6471 if (fuzzy) msg_print("You are hit by acid!");
6474 get_damage = acid_dam(dam, killer, monspell);
6478 /* Standard damage -- hurts inventory too */
6482 if (fuzzy) msg_print("²Ð±ê¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6484 if (fuzzy) msg_print("You are hit by fire!");
6487 get_damage = fire_dam(dam, killer, monspell);
6491 /* Standard damage -- hurts inventory too */
6495 if (fuzzy) msg_print("Î䵤¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6497 if (fuzzy) msg_print("You are hit by cold!");
6500 get_damage = cold_dam(dam, killer, monspell);
6504 /* Standard damage -- hurts inventory too */
6508 if (fuzzy) msg_print("ÅÅ·â¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6510 if (fuzzy) msg_print("You are hit by lightning!");
6513 get_damage = elec_dam(dam, killer, monspell);
6517 /* Standard damage -- also poisons player */
6520 bool double_resist = IS_OPPOSE_POIS();
6522 if (fuzzy) msg_print("ÆǤǹ¶·â¤µ¤ì¤¿¡ª");
6524 if (fuzzy) msg_print("You are hit by poison!");
6527 if (p_ptr->resist_pois) dam = (dam + 2) / 3;
6528 if (double_resist) dam = (dam + 2) / 3;
6530 if ((!(double_resist || p_ptr->resist_pois)) &&
6531 one_in_(HURT_CHANCE))
6536 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6538 if (!(double_resist || p_ptr->resist_pois))
6540 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6545 /* Standard damage -- also poisons / mutates player */
6548 bool double_resist = IS_OPPOSE_POIS();
6550 if (fuzzy) msg_print("Êü¼Íǽ¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6552 if (fuzzy) msg_print("You are hit by radiation!");
6555 if (p_ptr->resist_pois) dam = (2 * dam + 2) / 5;
6556 if (double_resist) dam = (2 * dam + 2) / 5;
6557 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6558 if (!(double_resist || p_ptr->resist_pois))
6560 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6562 if (one_in_(5)) /* 6 */
6565 msg_print("´ñ·ÁŪ¤ÊÊѿȤò¿ë¤²¤¿¡ª");
6567 msg_print("You undergo a freakish metamorphosis!");
6570 if (one_in_(4)) /* 4 */
6578 inven_damage(set_acid_destroy, 2);
6584 /* Standard damage */
6588 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6590 if (fuzzy) msg_print("You are hit by something!");
6593 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6597 /* Holy Orb -- Player only takes partial damage */
6601 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6603 if (fuzzy) msg_print("You are hit by something!");
6606 if (p_ptr->align > 10)
6608 else if (p_ptr->align < -10)
6610 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6617 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6619 if (fuzzy) msg_print("You are hit by something!");
6622 if (p_ptr->align > 10)
6624 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6628 /* Arrow -- XXX no dodging */
6632 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6634 if (fuzzy) msg_print("You are hit by something sharp!");
6637 else if ((inventory[INVEN_RARM].name1 == ART_ZANTETSU) || (inventory[INVEN_LARM].name1 == ART_ZANTETSU))
6640 msg_print("Ìð¤ò»Â¤ê¼Î¤Æ¤¿¡ª");
6642 msg_print("You cut down the arrow!");
6646 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6650 /* Plasma -- XXX No resist */
6654 if (fuzzy) msg_print("²¿¤«¤È¤Æ¤âÇ®¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6656 if (fuzzy) msg_print("You are hit by something *HOT*!");
6659 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6661 if (!p_ptr->resist_sound)
6663 int k = (randint1((dam > 40) ? 35 : (dam * 3 / 4 + 5)));
6664 (void)set_stun(p_ptr->stun + k);
6667 if (!(p_ptr->resist_fire ||
6669 p_ptr->immune_fire))
6671 inven_damage(set_acid_destroy, 3);
6677 /* Nether -- drain experience */
6681 if (fuzzy) msg_print("ÃϹö¤ÎÎϤǹ¶·â¤µ¤ì¤¿¡ª");
6683 if (fuzzy) msg_print("You are hit by nether forces!");
6687 if (p_ptr->resist_neth)
6689 if (!prace_is_(RACE_SPECTRE))
6690 dam *= 6; dam /= (randint1(4) + 7);
6692 else drain_exp(200 + (p_ptr->exp / 100), 200 + (p_ptr->exp / 1000), 75);
6694 if (prace_is_(RACE_SPECTRE))
6697 msg_print("µ¤Ê¬¤¬¤è¤¯¤Ê¤Ã¤¿¡£");
6699 msg_print("You feel invigorated!");
6703 learn_spell(monspell);
6707 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6713 /* Water -- stun/confuse */
6717 if (fuzzy) msg_print("²¿¤«¼¾¤Ã¤¿¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6719 if (fuzzy) msg_print("You are hit by something wet!");
6722 if (!p_ptr->resist_sound)
6724 set_stun(p_ptr->stun + randint1(40));
6726 if (!p_ptr->resist_conf)
6728 set_confused(p_ptr->confused + randint1(5) + 5);
6733 inven_damage(set_cold_destroy, 3);
6736 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6740 /* Chaos -- many effects */
6744 if (fuzzy) msg_print("̵Ãá½ø¤ÎÇÈÆ°¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6746 if (fuzzy) msg_print("You are hit by a wave of anarchy!");
6749 if (p_ptr->resist_chaos)
6751 dam *= 6; dam /= (randint1(4) + 7);
6753 if (!p_ptr->resist_conf)
6755 (void)set_confused(p_ptr->confused + randint0(20) + 10);
6757 if (!p_ptr->resist_chaos)
6759 (void)set_image(p_ptr->image + randint1(10));
6763 msg_print("¤¢¤Ê¤¿¤Î¿ÈÂΤϥ«¥ª¥¹¤ÎÎϤÇDZ¤¸¶Ê¤²¤é¤ì¤¿¡ª");
6765 msg_print("Your body is twisted by chaos!");
6768 (void)gain_random_mutation(0);
6771 if (!p_ptr->resist_neth && !p_ptr->resist_chaos)
6773 drain_exp(5000 + (p_ptr->exp / 100), 500 + (p_ptr->exp / 1000), 75);
6775 if (!p_ptr->resist_chaos || one_in_(9))
6777 inven_damage(set_elec_destroy, 2);
6778 inven_damage(set_fire_destroy, 2);
6780 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6784 /* Shards -- mostly cutting */
6788 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6790 if (fuzzy) msg_print("You are hit by something sharp!");
6793 if (p_ptr->resist_shard)
6795 dam *= 6; dam /= (randint1(4) + 7);
6799 (void)set_cut(p_ptr->cut + dam);
6802 if (!p_ptr->resist_shard || one_in_(13))
6804 inven_damage(set_cold_destroy, 2);
6807 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6811 /* Sound -- mostly stunning */
6815 if (fuzzy) msg_print("¹ì²»¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6817 if (fuzzy) msg_print("You are hit by a loud noise!");
6820 if (p_ptr->resist_sound)
6822 dam *= 5; dam /= (randint1(4) + 7);
6826 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
6827 (void)set_stun(p_ptr->stun + k);
6830 if (!p_ptr->resist_sound || one_in_(13))
6832 inven_damage(set_cold_destroy, 2);
6835 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6839 /* Pure confusion */
6843 if (fuzzy) msg_print("²¿¤«º®Í𤹤ë¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6845 if (fuzzy) msg_print("You are hit by something puzzling!");
6848 if (p_ptr->resist_conf)
6850 dam *= 5; dam /= (randint1(4) + 7);
6852 if (!p_ptr->resist_conf)
6854 (void)set_confused(p_ptr->confused + randint1(20) + 10);
6856 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6860 /* Disenchantment -- see above */
6864 if (fuzzy) msg_print("²¿¤«¤µ¤¨¤Ê¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6866 if (fuzzy) msg_print("You are hit by something static!");
6869 if (p_ptr->resist_disen)
6871 dam *= 6; dam /= (randint1(4) + 7);
6875 (void)apply_disenchant(0);
6877 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6881 /* Nexus -- see above */
6885 if (fuzzy) msg_print("²¿¤«´ñ̯¤Ê¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6887 if (fuzzy) msg_print("You are hit by something strange!");
6890 if (p_ptr->resist_nexus)
6892 dam *= 6; dam /= (randint1(4) + 7);
6898 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6902 /* Force -- mostly stun */
6906 if (fuzzy) msg_print("±¿Æ°¥¨¥Í¥ë¥®¡¼¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6908 if (fuzzy) msg_print("You are hit by kinetic force!");
6911 if (!p_ptr->resist_sound)
6913 (void)set_stun(p_ptr->stun + randint1(20));
6915 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6920 /* Rocket -- stun, cut */
6924 if (fuzzy) msg_print("Çúȯ¤¬¤¢¤Ã¤¿¡ª");
6926 if (fuzzy) msg_print("There is an explosion!");
6929 if (!p_ptr->resist_sound)
6931 (void)set_stun(p_ptr->stun + randint1(20));
6933 if (p_ptr->resist_shard)
6939 (void)set_cut(p_ptr-> cut + ( dam / 2));
6942 if ((!p_ptr->resist_shard) || one_in_(12))
6944 inven_damage(set_cold_destroy, 3);
6947 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6951 /* Inertia -- slowness */
6955 if (fuzzy) msg_print("²¿¤«ÃÙ¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6957 if (fuzzy) msg_print("You are hit by something slow!");
6960 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
6961 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6965 /* Lite -- blinding */
6969 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6971 if (fuzzy) msg_print("You are hit by something!");
6974 if (p_ptr->resist_lite)
6976 dam *= 4; dam /= (randint1(4) + 7);
6978 else if (!blind && !p_ptr->resist_blind)
6980 (void)set_blind(p_ptr->blind + randint1(5) + 2);
6982 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
6985 msg_print("¸÷¤ÇÆùÂΤ¬¾Ç¤¬¤µ¤ì¤¿¡ª");
6987 msg_print("The light scorches your flesh!");
6992 else if (prace_is_(RACE_S_FAIRY))
6996 if (p_ptr->wraith_form) dam *= 2;
6997 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6999 if (p_ptr->wraith_form)
7001 p_ptr->wraith_form = 0;
7003 msg_print("Á®¸÷¤Î¤¿¤áÈóʪ¼ÁŪ¤Ê±Æ¤Î¸ºß¤Ç¤¤¤é¤ì¤Ê¤¯¤Ê¤Ã¤¿¡£");
7005 msg_print("The light forces you out of your incorporeal shadow form.");
7008 p_ptr->redraw |= PR_MAP;
7009 /* Update monsters */
7010 p_ptr->update |= (PU_MONSTERS);
7012 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
7014 /* Redraw status bar */
7015 p_ptr->redraw |= (PR_STATUS);
7022 /* Dark -- blinding */
7026 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7028 if (fuzzy) msg_print("You are hit by something!");
7031 if (p_ptr->resist_dark)
7033 dam *= 4; dam /= (randint1(4) + 7);
7035 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form) dam = 0;
7037 else if (!blind && !p_ptr->resist_blind)
7039 (void)set_blind(p_ptr->blind + randint1(5) + 2);
7041 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7045 /* Time -- bolt fewer effects XXX */
7049 if (fuzzy) msg_print("²áµî¤«¤é¤Î¾×·â¤Ë¹¶·â¤µ¤ì¤¿¡ª");
7051 if (fuzzy) msg_print("You are hit by a blast from the past!");
7054 if (p_ptr->resist_time)
7057 dam /= (randint1(4) + 7);
7059 msg_print("»þ´Ö¤¬Ä̤ê²á¤®¤Æ¤¤¤¯µ¤¤¬¤¹¤ë¡£");
7061 msg_print("You feel as if time is passing you by.");
7067 switch (randint1(10))
7069 case 1: case 2: case 3: case 4: case 5:
7071 if (p_ptr->prace == RACE_ANDROID) break;
7073 msg_print("¿ÍÀ¸¤¬µÕÌá¤ê¤·¤¿µ¤¤¬¤¹¤ë¡£");
7075 msg_print("You feel life has clocked back.");
7078 lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
7082 case 6: case 7: case 8: case 9:
7084 switch (randint1(6))
7087 case 1: k = A_STR; act = "¶¯¤¯"; break;
7088 case 2: k = A_INT; act = "ÁïÌÀ¤Ç"; break;
7089 case 3: k = A_WIS; act = "¸ÌÀ¤Ç"; break;
7090 case 4: k = A_DEX; act = "´ïÍѤÇ"; break;
7091 case 5: k = A_CON; act = "·ò¹¯¤Ç"; break;
7092 case 6: k = A_CHR; act = "Èþ¤·¤¯"; break;
7094 case 1: k = A_STR; act = "strong"; break;
7095 case 2: k = A_INT; act = "bright"; break;
7096 case 3: k = A_WIS; act = "wise"; break;
7097 case 4: k = A_DEX; act = "agile"; break;
7098 case 5: k = A_CON; act = "hale"; break;
7099 case 6: k = A_CHR; act = "beautiful"; break;
7105 msg_format("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤É%s¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£", act);
7107 msg_format("You're not as %s as you used to be...", act);
7111 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 3) / 4;
7112 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
7113 p_ptr->update |= (PU_BONUS);
7120 msg_print("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤ÉÎ϶¯¤¯¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£");
7122 msg_print("You're not as powerful as you used to be...");
7126 for (k = 0; k < 6; k++)
7128 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 7) / 8;
7129 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
7131 p_ptr->update |= (PU_BONUS);
7137 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7141 /* Gravity -- stun plus slowness plus teleport */
7145 if (fuzzy) msg_print("²¿¤«½Å¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7146 msg_print("¼þÊդνÅÎϤ¬¤æ¤¬¤ó¤À¡£");
7148 if (fuzzy) msg_print("You are hit by something heavy!");
7149 msg_print("Gravity warps around you.");
7152 teleport_player(5, TRUE);
7153 if (!p_ptr->levitation)
7154 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7155 if (!(p_ptr->resist_sound || p_ptr->levitation))
7157 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
7158 (void)set_stun(p_ptr->stun + k);
7160 if (p_ptr->levitation)
7162 dam = (dam * 2) / 3;
7165 if (!p_ptr->levitation || one_in_(13))
7167 inven_damage(set_cold_destroy, 2);
7170 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7174 /* Standard damage */
7175 case GF_DISINTEGRATE:
7178 if (fuzzy) msg_print("½ã¿è¤Ê¥¨¥Í¥ë¥®¡¼¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7180 if (fuzzy) msg_print("You are hit by pure energy!");
7183 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7190 if (fuzzy) msg_print("²¿¤é¤«¤Î¹¶·â¤Ë¤è¤Ã¤Æµ¤Ê¬¤¬¤è¤¯¤Ê¤Ã¤¿¡£");
7192 if (fuzzy) msg_print("You are hit by something invigorating!");
7195 (void)hp_player(dam);
7203 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7205 if (fuzzy) msg_print("You are hit by something!");
7208 (void)set_fast(p_ptr->fast + randint1(5), FALSE);
7216 if (fuzzy) msg_print("²¿¤«ÃÙ¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7218 if (fuzzy) msg_print("You are hit by something slow!");
7221 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7227 if (p_ptr->free_act) break;
7229 if (fuzzy) msg_print("̲¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
7231 if (fuzzy) msg_print("You fall asleep!");
7235 if (ironman_nightmare)
7238 msg_print("¶²¤í¤·¤¤¸÷·Ê¤¬Æ¬¤ËÉ⤫¤ó¤Ç¤¤¿¡£");
7240 msg_print("A horrible vision enters your mind.");
7244 /* Pick a nightmare */
7245 get_mon_num_prep(get_nightmare, NULL);
7247 /* Have some nightmares */
7248 have_nightmare(get_mon_num(MAX_DEPTH));
7250 /* Remove the monster restriction */
7251 get_mon_num_prep(NULL, NULL);
7254 set_paralyzed(p_ptr->paralyzed + dam);
7265 if (fuzzy) msg_print("ËâË¡¤Î¥ª¡¼¥é¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7267 if (fuzzy) msg_print("You are hit by an aura of magic!");
7270 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7278 if (fuzzy) msg_print("¥¨¥Í¥ë¥®¡¼¤Î²ô¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7280 if (fuzzy) msg_print("You are hit by an energy!");
7283 get_damage = take_hit(DAMAGE_FORCE, dam, killer, monspell);
7291 if (fuzzy) msg_print("²¿¤«¤¬¶õ¤«¤é¤¢¤Ê¤¿¤ÎƬ¾å¤ËÍî¤Á¤Æ¤¤¿¡ª");
7293 if (fuzzy) msg_print("Something falls from the sky on you!");
7296 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7297 if (!p_ptr->resist_shard || one_in_(13))
7299 if (!p_ptr->immune_fire) inven_damage(set_fire_destroy, 2);
7300 inven_damage(set_cold_destroy, 2);
7306 /* Ice -- cold plus stun plus cuts */
7310 if (fuzzy) msg_print("²¿¤«±Ô¤¯Î䤿¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7312 if (fuzzy) msg_print("You are hit by something sharp and cold!");
7315 cold_dam(dam, killer, monspell);
7316 if (!p_ptr->resist_shard)
7318 (void)set_cut(p_ptr->cut + damroll(5, 8));
7320 if (!p_ptr->resist_sound)
7322 (void)set_stun(p_ptr->stun + randint1(15));
7325 if ((!(p_ptr->resist_cold || IS_OPPOSE_COLD())) || one_in_(12))
7327 if (!p_ptr->immune_cold) inven_damage(set_cold_destroy, 3);
7337 if (fuzzy) msg_print("²¿¤«Èó¾ï¤ËÎ䤿¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7339 if (fuzzy) msg_print("You are hit by something extremely cold!");
7343 if (p_ptr->mimic_form)
7345 if (!(mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
7346 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7351 switch (p_ptr->prace)
7353 /* Some races are immune */
7367 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7383 if (who > 0) msg_format("%^s¤ËÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¼è¤é¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
7384 else msg_print("Àº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¼è¤é¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª");
7386 if (who > 0) msg_format("%^s draws psychic energy from you!", m_name);
7387 else msg_print("Your psychic energy is drawn!");
7391 if (dam >= p_ptr->csp)
7395 p_ptr->csp_frac = 0;
7404 learn_spell(monspell);
7407 p_ptr->redraw |= (PR_MANA);
7410 p_ptr->window |= (PW_PLAYER);
7411 p_ptr->window |= (PW_SPELL);
7415 /* Heal the monster */
7416 if (m_ptr->hp < m_ptr->maxhp)
7419 m_ptr->hp += (6 * dam);
7420 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
7422 /* Redraw (later) if needed */
7423 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
7424 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
7426 /* Special message */
7430 msg_format("%^s¤Ïµ¤Ê¬¤¬Îɤµ¤½¤¦¤À¡£", m_name);
7432 msg_format("%^s appears healthier.", m_name);
7446 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
7449 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7451 msg_print("You resist the effects!");
7453 learn_spell(monspell);
7458 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
7460 msg_print("Your mind is blasted by psyonic energy.");
7463 if (!p_ptr->resist_conf)
7465 (void)set_confused(p_ptr->confused + randint0(4) + 4);
7468 if (!p_ptr->resist_chaos && one_in_(3))
7470 (void)set_image(p_ptr->image + randint0(250) + 150);
7477 p_ptr->csp_frac = 0;
7479 p_ptr->redraw |= PR_MANA;
7481 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7487 case GF_BRAIN_SMASH:
7489 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
7492 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7494 msg_print("You resist the effects!");
7496 learn_spell(monspell);
7501 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
7503 msg_print("Your mind is blasted by psionic energy.");
7510 p_ptr->csp_frac = 0;
7512 p_ptr->redraw |= PR_MANA;
7514 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7515 if (!p_ptr->resist_blind)
7517 (void)set_blind(p_ptr->blind + 8 + randint0(8));
7519 if (!p_ptr->resist_conf)
7521 (void)set_confused(p_ptr->confused + randint0(4) + 4);
7523 if (!p_ptr->free_act)
7525 (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
7527 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7529 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
7530 (void)do_dec_stat(A_INT);
7531 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
7532 (void)do_dec_stat(A_WIS);
7534 if (!p_ptr->resist_chaos)
7536 (void)set_image(p_ptr->image + randint0(250) + 150);
7545 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7548 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7550 msg_print("You resist the effects!");
7552 learn_spell(monspell);
7556 curse_equipment(15, 0);
7557 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7565 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7568 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7570 msg_print("You resist the effects!");
7572 learn_spell(monspell);
7576 curse_equipment(25, MIN(rlev/2-15, 5));
7577 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7585 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7588 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7590 msg_print("You resist the effects!");
7592 learn_spell(monspell);
7596 curse_equipment(33, MIN(rlev/2-15, 15));
7597 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7605 if ((randint0(100 + rlev/2) < p_ptr->skill_sav) && !(m_ptr->r_idx == MON_KENSHIROU))
7608 msg_print("¤·¤«¤·È빦¤òÄ·¤ÍÊÖ¤·¤¿¡ª");
7610 msg_print("You resist the effects!");
7612 learn_spell(monspell);
7616 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7617 (void)set_cut(p_ptr->cut + damroll(10, 10));
7625 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7628 msg_format("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7630 msg_format("You resist the effects!");
7632 learn_spell(monspell);
7637 msg_print("¤¢¤Ê¤¿¤ÏÌ¿¤¬Çö¤Þ¤Ã¤Æ¤¤¤¯¤è¤¦¤Ë´¶¤¸¤¿¡ª");
7639 msg_print("You feel your life fade away!");
7642 get_damage = take_hit(DAMAGE_ATTACK, dam, m_name, monspell);
7643 curse_equipment(40, 20);
7645 if (p_ptr->chp < 1) p_ptr->chp = 1;
7660 if (p_ptr->tim_eyeeye && get_damage > 0 && !p_ptr->is_dead)
7663 msg_format("¹¶·â¤¬%s¼«¿È¤ò½ý¤Ä¤±¤¿¡ª", m_name);
7665 char m_name_self[80];
7668 monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
7670 msg_format("The attack of %s has wounded %s!", m_name, m_name_self);
7672 project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
7673 set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
7676 if (p_ptr->riding && dam > 0)
7678 rakubadam_p = (dam > 200) ? 200 : dam;
7686 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && who && (who != p_ptr->riding))
7692 /* Return "Anything seen?" */
7698 * Find the distance from (x, y) to a line.
7700 int dist_to_line(int y, int x, int y1, int x1, int y2, int x2)
7702 /* Vector from (x, y) to (x1, y1) */
7711 int pd = distance(y1, x1, y, x);
7712 int nd = distance(y1, x1, y2, x2);
7714 if (pd > nd) return distance(y, x, y2, x2);
7716 /* Component of P on N */
7717 nd = ((nd) ? ((py * ny + px * nx) / nd) : 0);
7719 /* Absolute value */
7720 return((nd >= 0) ? nd : 0 - nd);
7727 * Modified version of los() for calculation of disintegration balls.
7728 * Disintegration effects are stopped by permanent walls.
7730 bool in_disintegration_range(int y1, int x1, int y2, int x2)
7750 /* Slope, or 1/Slope, of LOS */
7754 /* Extract the offset */
7758 /* Extract the absolute offset */
7763 /* Handle adjacent (or identical) grids */
7764 if ((ax < 2) && (ay < 2)) return (TRUE);
7767 /* Paranoia -- require "safe" origin */
7768 /* if (!in_bounds(y1, x1)) return (FALSE); */
7771 /* Directly South/North */
7774 /* South -- check for walls */
7777 for (ty = y1 + 1; ty < y2; ty++)
7779 if (cave_stop_disintegration(ty, x1)) return (FALSE);
7783 /* North -- check for walls */
7786 for (ty = y1 - 1; ty > y2; ty--)
7788 if (cave_stop_disintegration(ty, x1)) return (FALSE);
7796 /* Directly East/West */
7799 /* East -- check for walls */
7802 for (tx = x1 + 1; tx < x2; tx++)
7804 if (cave_stop_disintegration(y1, tx)) return (FALSE);
7808 /* West -- check for walls */
7811 for (tx = x1 - 1; tx > x2; tx--)
7813 if (cave_stop_disintegration(y1, tx)) return (FALSE);
7822 /* Extract some signs */
7823 sx = (dx < 0) ? -1 : 1;
7824 sy = (dy < 0) ? -1 : 1;
7827 /* Vertical "knights" */
7832 if (!cave_stop_disintegration(y1 + sy, x1)) return (TRUE);
7836 /* Horizontal "knights" */
7841 if (!cave_stop_disintegration(y1, x1 + sx)) return (TRUE);
7846 /* Calculate scale factor div 2 */
7849 /* Calculate scale factor */
7853 /* Travel horizontally */
7856 /* Let m = dy / dx * 2 * (dy * dx) = 2 * dy * dy */
7862 /* Consider the special case where slope == 1. */
7873 /* Note (below) the case (qy == f2), where */
7874 /* the LOS exactly meets the corner of a tile. */
7877 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7888 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7901 /* Travel vertically */
7904 /* Let m = dx / dy * 2 * (dx * dy) = 2 * dx * dx */
7920 /* Note (below) the case (qx == f2), where */
7921 /* the LOS exactly meets the corner of a tile. */
7924 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7935 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7956 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)
7961 int brev = rad * rad / dist;
7965 int mdis = distance(y1, x1, y2, x2) + rad;
7967 while (bdis <= mdis)
7971 if ((0 < dist) && (path_n < dist))
7973 int ny = GRID_Y(path_g[path_n]);
7974 int nx = GRID_X(path_g[path_n]);
7975 int nd = distance(ny, nx, y1, x1);
7977 /* Get next base point */
7986 /* Travel from center outward */
7987 for (cdis = 0; cdis <= brad; cdis++)
7989 /* Scan the maximal blast area of radius "cdis" */
7990 for (y = by - cdis; y <= by + cdis; y++)
7992 for (x = bx - cdis; x <= bx + cdis; x++)
7994 /* Ignore "illegal" locations */
7995 if (!in_bounds(y, x)) continue;
7997 /* Enforce a circular "ripple" */
7998 if (distance(y1, x1, y, x) != bdis) continue;
8000 /* Enforce an arc */
8001 if (distance(by, bx, y, x) != cdis) continue;
8007 /* Lights are stopped by opaque terrains */
8008 if (!los(by, bx, y, x)) continue;
8010 case GF_DISINTEGRATE:
8011 /* Disintegration are stopped only by perma-walls */
8012 if (!in_disintegration_range(by, bx, y, x)) continue;
8015 /* Ball explosions are stopped by walls */
8016 if (!projectable(by, bx, y, x)) continue;
8020 /* Save this grid */
8028 /* Encode some more "radius" info */
8029 gm[bdis + 1] = *pgrids;
8031 /* Increase the size */
8032 brad = rad * (path_n + brev) / (dist + brev);
8034 /* Find the next ripple */
8038 /* Store the effect size */
8044 * Generic "beam"/"bolt"/"ball" projection routine.
8047 * who: Index of "source" monster (zero for "player")
8048 * rad: Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
8049 * y,x: Target location (or location to travel "towards")
8050 * dam: Base damage roll to apply to affected monsters (or player)
8051 * typ: Type of damage to apply to monsters (and objects)
8052 * flg: Extra bit flags (see PROJECT_xxxx in "defines.h")
8055 * TRUE if any "effects" of the projection were observed, else FALSE
8057 * Allows a monster (or player) to project a beam/bolt/ball of a given kind
8058 * towards a given location (optionally passing over the heads of interposing
8059 * monsters), and have it do a given amount of damage to the monsters (and
8060 * optionally objects) within the given radius of the final location.
8062 * A "bolt" travels from source to target and affects only the target grid.
8063 * A "beam" travels from source to target, affecting all grids passed through.
8064 * A "ball" travels from source to the target, exploding at the target, and
8065 * affecting everything within the given radius of the target location.
8067 * Traditionally, a "bolt" does not affect anything on the ground, and does
8068 * not pass over the heads of interposing monsters, much like a traditional
8069 * missile, and will "stop" abruptly at the "target" even if no monster is
8070 * positioned there, while a "ball", on the other hand, passes over the heads
8071 * of monsters between the source and target, and affects everything except
8072 * the source monster which lies within the final radius, while a "beam"
8073 * affects every monster between the source and target, except for the casting
8074 * monster (or player), and rarely affects things on the ground.
8076 * Two special flags allow us to use this function in special ways, the
8077 * "PROJECT_HIDE" flag allows us to perform "invisible" projections, while
8078 * the "PROJECT_JUMP" flag allows us to affect a specific grid, without
8079 * actually projecting from the source monster (or player).
8081 * The player will only get "experience" for monsters killed by himself
8082 * Unique monsters can only be destroyed by attacks from the player
8084 * Only 256 grids can be affected per projection, limiting the effective
8085 * "radius" of standard ball attacks to nine units (diameter nineteen).
8087 * One can project in a given "direction" by combining PROJECT_THRU with small
8088 * offsets to the initial location (see "line_spell()"), or by calculating
8089 * "virtual targets" far away from the player.
8091 * One can also use PROJECT_THRU to send a beam/bolt along an angled path,
8092 * continuing until it actually hits somethings (useful for "stone to mud").
8094 * Bolts and Beams explode INSIDE walls, so that they can destroy doors.
8096 * Balls must explode BEFORE hitting walls, or they would affect monsters
8097 * on both sides of a wall. Some bug reports indicate that this is still
8098 * happening in 2.7.8 for Windows, though it appears to be impossible.
8100 * We "pre-calculate" the blast area only in part for efficiency.
8101 * More importantly, this lets us do "explosions" from the "inside" out.
8102 * This results in a more logical distribution of "blast" treasure.
8103 * It also produces a better (in my opinion) animation of the explosion.
8104 * It could be (but is not) used to have the treasure dropped by monsters
8105 * in the middle of the explosion fall "outwards", and then be damaged by
8106 * the blast as it spreads outwards towards the treasure drop location.
8108 * Walls and doors are included in the blast area, so that they can be
8109 * "burned" or "melted" in later versions.
8111 * This algorithm is intended to maximize simplicity, not necessarily
8112 * efficiency, since this function is not a bottleneck in the code.
8114 * We apply the blast effect from ground zero outwards, in several passes,
8115 * first affecting features, then objects, then monsters, then the player.
8116 * This allows walls to be removed before checking the object or monster
8117 * in the wall, and protects objects which are dropped by monsters killed
8118 * in the blast, and allows the player to see all affects before he is
8119 * killed or teleported away. The semantics of this method are open to
8120 * various interpretations, but they seem to work well in practice.
8122 * We process the blast area from ground-zero outwards to allow for better
8123 * distribution of treasure dropped by monsters, and because it provides a
8124 * pleasing visual effect at low cost.
8126 * Note that the damage done by "ball" explosions decreases with distance.
8127 * This decrease is rapid, grids at radius "dist" take "1/dist" damage.
8129 * Notice the "napalm" effect of "beam" weapons. First they "project" to
8130 * the target, and then the damage "flows" along this beam of destruction.
8131 * The damage at every grid is the same as at the "center" of a "ball"
8132 * explosion, since the "beam" grids are treated as if they ARE at the
8133 * center of a "ball" explosion.
8135 * Currently, specifying "beam" plus "ball" means that locations which are
8136 * covered by the initial "beam", and also covered by the final "ball", except
8137 * for the final grid (the epicenter of the ball), will be "hit twice", once
8138 * by the initial beam, and once by the exploding ball. For the grid right
8139 * next to the epicenter, this results in 150% damage being done. The center
8140 * does not have this problem, for the same reason the final grid in a "beam"
8141 * plus "bolt" does not -- it is explicitly removed. Simply removing "beam"
8142 * grids which are covered by the "ball" will NOT work, as then they will
8143 * receive LESS damage than they should. Do not combine "beam" with "ball".
8145 * The array "gy[],gx[]" with current size "grids" is used to hold the
8146 * collected locations of all grids in the "blast area" plus "beam path".
8148 * Note the rather complex usage of the "gm[]" array. First, gm[0] is always
8149 * zero. Second, for N>1, gm[N] is always the index (in gy[],gx[]) of the
8150 * first blast grid (see above) with radius "N" from the blast center. Note
8151 * that only the first gm[1] grids in the blast area thus take full damage.
8152 * Also, note that gm[rad+1] is always equal to "grids", which is the total
8153 * number of blast grids.
8155 * Note that once the projection is complete, (y2,x2) holds the final location
8156 * of bolts/beams, and the "epicenter" of balls.
8158 * Note also that "rad" specifies the "inclusive" radius of projection blast,
8159 * so that a "rad" of "one" actually covers 5 or 9 grids, depending on the
8160 * implementation of the "distance" function. Also, a bolt can be properly
8161 * viewed as a "ball" with a "rad" of "zero".
8163 * Note that if no "target" is reached before the beam/bolt/ball travels the
8164 * maximum distance allowed (MAX_RANGE), no "blast" will be induced. This
8165 * may be relevant even for bolts, since they have a "1x1" mini-blast.
8167 * Note that for consistency, we "pretend" that the bolt actually takes "time"
8168 * to move from point A to point B, even if the player cannot see part of the
8169 * projection path. Note that in general, the player will *always* see part
8170 * of the path, since it either starts at the player or ends on the player.
8172 * Hack -- we assume that every "projection" is "self-illuminating".
8174 * Hack -- when only a single monster is affected, we automatically track
8175 * (and recall) that monster, unless "PROJECT_JUMP" is used.
8177 * Note that all projections now "explode" at their final destination, even
8178 * if they were being projected at a more distant destination. This means
8179 * that "ball" spells will *always* explode.
8181 * Note that we must call "handle_stuff()" after affecting terrain features
8182 * in the blast radius, in case the "illumination" of the grid was changed,
8183 * and "update_view()" and "update_monsters()" need to be called.
8185 bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int monspell)
8195 int y_saver, x_saver; /* For reflecting monsters */
8197 int msec = delay_factor * delay_factor * delay_factor;
8199 /* Assume the player sees nothing */
8200 bool notice = FALSE;
8202 /* Assume the player has seen nothing */
8203 bool visual = FALSE;
8205 /* Assume the player has seen no blast grids */
8208 /* Assume to be a normal ball spell */
8209 bool breath = FALSE;
8211 /* Is the player blind? */
8212 bool blind = (p_ptr->blind ? TRUE : FALSE);
8214 bool old_hide = FALSE;
8216 /* Number of grids in the "path" */
8219 /* Actual grids in the "path" */
8222 /* Number of grids in the "blast area" (including the "beam" path) */
8225 /* Coordinates of the affected grids */
8226 byte gx[1024], gy[1024];
8228 /* Encoded "radius" info (see above) */
8231 /* Actual radius encoded in gm[] */
8236 /* Attacker's name (prepared before polymorph)*/
8239 /* Initialize by null string */
8245 /* Default target of monsterspell is player */
8246 monster_target_y=py;
8247 monster_target_x=px;
8249 /* Hack -- Jump to target */
8250 if (flg & (PROJECT_JUMP))
8255 /* Clear the flag */
8256 flg &= ~(PROJECT_JUMP);
8261 /* Start at player */
8268 /* Start at monster */
8271 x1 = m_list[who].fx;
8272 y1 = m_list[who].fy;
8273 monster_desc(who_name, &m_list[who], MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
8286 /* Default "destination" */
8291 /* Hack -- verify stuff */
8292 if (flg & (PROJECT_THRU))
8294 if ((x1 == x2) && (y1 == y2))
8296 flg &= ~(PROJECT_THRU);
8300 /* Handle a breath attack */
8305 if (flg & PROJECT_HIDE) old_hide = TRUE;
8306 flg |= PROJECT_HIDE;
8310 /* Hack -- Assume there will be no blast (max radius 32) */
8311 for (dist = 0; dist < 32; dist++) gm[dist] = 0;
8319 /* Collect beam grids */
8320 if (flg & (PROJECT_BEAM))
8331 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_LOS);
8333 case GF_DISINTEGRATE:
8334 flg |= (PROJECT_GRID);
8335 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_DISI);
8339 /* Calculate the projection path */
8341 path_n = project_path(path_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, flg);
8343 /* Hack -- Handle stuff */
8346 /* Giga-Hack SEEKER & SUPER_RAY */
8348 if( typ == GF_SEEKER )
8358 for (i = 0; i < path_n; ++i)
8363 int ny = GRID_Y(path_g[i]);
8364 int nx = GRID_X(path_g[i]);
8375 /* Only do visuals if requested */
8376 if (!blind && !(flg & (PROJECT_HIDE)))
8378 /* Only do visuals if the player can "see" the bolt */
8379 if (panel_contains(y, x) && player_has_los_bold(y, x))
8386 /* Obtain the bolt pict */
8387 p = bolt_pict(oy, ox, y, x, typ);
8389 /* Extract attr/char */
8393 /* Visual effects */
8394 print_rel(c, a, y, x);
8395 move_cursor_relative(y, x);
8396 /*if (fresh_before)*/ Term_fresh();
8397 Term_xtra(TERM_XTRA_DELAY, msec);
8399 /*if (fresh_before)*/ Term_fresh();
8401 /* Display "beam" grids */
8402 if (flg & (PROJECT_BEAM))
8404 /* Obtain the explosion pict */
8405 p = bolt_pict(y, x, y, x, typ);
8407 /* Extract attr/char */
8411 /* Visual effects */
8412 print_rel(c, a, y, x);
8415 /* Hack -- Activate delay */
8419 /* Hack -- delay anyway for consistency */
8422 /* Delay for consistency */
8423 Term_xtra(TERM_XTRA_DELAY, msec);
8426 if(project_o(0,0,y,x,dam,GF_SEEKER))notice=TRUE;
8427 if( is_mirror_grid(&cave[y][x]))
8429 /* The target of monsterspell becomes tha mirror(broken) */
8430 monster_target_y=(s16b)y;
8431 monster_target_x=(s16b)x;
8434 next_mirror( &oy,&ox,y,x );
8436 path_n = i+project_path(&(path_g[i+1]), (project_length ? project_length : MAX_RANGE), y, x, oy, ox, flg);
8437 for( j = last_i; j <=i ; j++ )
8439 y = GRID_Y(path_g[j]);
8440 x = GRID_X(path_g[j]);
8441 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))notice=TRUE;
8442 if(!who && (project_m_n==1) && !jump ){
8443 if(cave[project_m_y][project_m_x].m_idx >0 ){
8444 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8446 /* Hack -- auto-recall */
8447 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8449 /* Hack - auto-track */
8450 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8453 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8458 for( i = last_i ; i < path_n ; i++ )
8461 y = GRID_Y(path_g[i]);
8462 x = GRID_X(path_g[i]);
8463 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))
8465 if(!who && (project_m_n==1) && !jump ){
8466 if(cave[project_m_y][project_m_x].m_idx >0 ){
8467 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8469 /* Hack -- auto-recall */
8470 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8472 /* Hack - auto-track */
8473 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8476 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8480 else if(typ == GF_SUPER_RAY){
8482 int second_step = 0;
8489 for (i = 0; i < path_n; ++i)
8494 int ny = GRID_Y(path_g[i]);
8495 int nx = GRID_X(path_g[i]);
8506 /* Only do visuals if requested */
8507 if (!blind && !(flg & (PROJECT_HIDE)))
8509 /* Only do visuals if the player can "see" the bolt */
8510 if (panel_contains(y, x) && player_has_los_bold(y, x))
8517 /* Obtain the bolt pict */
8518 p = bolt_pict(oy, ox, y, x, typ);
8520 /* Extract attr/char */
8524 /* Visual effects */
8525 print_rel(c, a, y, x);
8526 move_cursor_relative(y, x);
8527 /*if (fresh_before)*/ Term_fresh();
8528 Term_xtra(TERM_XTRA_DELAY, msec);
8530 /*if (fresh_before)*/ Term_fresh();
8532 /* Display "beam" grids */
8533 if (flg & (PROJECT_BEAM))
8535 /* Obtain the explosion pict */
8536 p = bolt_pict(y, x, y, x, typ);
8538 /* Extract attr/char */
8542 /* Visual effects */
8543 print_rel(c, a, y, x);
8546 /* Hack -- Activate delay */
8550 /* Hack -- delay anyway for consistency */
8553 /* Delay for consistency */
8554 Term_xtra(TERM_XTRA_DELAY, msec);
8557 if(project_o(0,0,y,x,dam,GF_SUPER_RAY) )notice=TRUE;
8558 if (!cave_have_flag_bold(y, x, FF_PROJECT))
8560 if( second_step )continue;
8563 if( is_mirror_grid(&cave[y][x]) && !second_step )
8565 /* The target of monsterspell becomes tha mirror(broken) */
8566 monster_target_y=(s16b)y;
8567 monster_target_x=(s16b)x;
8570 for( j = 0; j <=i ; j++ )
8572 y = GRID_Y(path_g[j]);
8573 x = GRID_X(path_g[j]);
8574 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8578 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x-1, flg);
8579 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x , flg);
8580 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x+1, flg);
8581 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x-1, flg);
8582 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x+1, flg);
8583 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x-1, flg);
8584 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x , flg);
8585 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x+1, flg);
8588 for( i = 0; i < path_n ; i++ )
8591 y = GRID_Y(path_g[i]);
8592 x = GRID_X(path_g[i]);
8593 (void)project_m(0,0,y,x,dam,GF_SUPER_RAY,flg);
8594 if(!who && (project_m_n==1) && !jump ){
8595 if(cave[project_m_y][project_m_x].m_idx >0 ){
8596 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8598 /* Hack -- auto-recall */
8599 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8601 /* Hack - auto-track */
8602 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8605 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8610 /* Project along the path */
8611 for (i = 0; i < path_n; ++i)
8616 int ny = GRID_Y(path_g[i]);
8617 int nx = GRID_X(path_g[i]);
8619 if (flg & PROJECT_DISI)
8621 /* Hack -- Balls explode before reaching walls */
8622 if (cave_stop_disintegration(ny, nx) && (rad > 0)) break;
8624 else if (flg & PROJECT_LOS)
8626 /* Hack -- Balls explode before reaching walls */
8627 if (!cave_los_bold(ny, nx) && (rad > 0)) break;
8631 /* Hack -- Balls explode before reaching walls */
8632 if (!cave_have_flag_bold(ny, nx, FF_PROJECT) && (rad > 0)) break;
8639 /* Collect beam grids */
8640 if (flg & (PROJECT_BEAM))
8647 /* Only do visuals if requested */
8648 if (!blind && !(flg & (PROJECT_HIDE | PROJECT_FAST)))
8650 /* Only do visuals if the player can "see" the bolt */
8651 if (panel_contains(y, x) && player_has_los_bold(y, x))
8658 /* Obtain the bolt pict */
8659 p = bolt_pict(oy, ox, y, x, typ);
8661 /* Extract attr/char */
8665 /* Visual effects */
8666 print_rel(c, a, y, x);
8667 move_cursor_relative(y, x);
8668 /*if (fresh_before)*/ Term_fresh();
8669 Term_xtra(TERM_XTRA_DELAY, msec);
8671 /*if (fresh_before)*/ Term_fresh();
8673 /* Display "beam" grids */
8674 if (flg & (PROJECT_BEAM))
8676 /* Obtain the explosion pict */
8677 p = bolt_pict(y, x, y, x, typ);
8679 /* Extract attr/char */
8683 /* Visual effects */
8684 print_rel(c, a, y, x);
8687 /* Hack -- Activate delay */
8691 /* Hack -- delay anyway for consistency */
8694 /* Delay for consistency */
8695 Term_xtra(TERM_XTRA_DELAY, msec);
8702 /* Save the "blast epicenter" */
8706 if (breath && !path_n)
8712 flg &= ~(PROJECT_HIDE);
8716 /* Start the "explosion" */
8719 /* Hack -- make sure beams get to "explode" */
8727 /* If we found a "target", explode there */
8728 if (dist <= MAX_RANGE)
8730 /* Mega-Hack -- remove the final "beam" grid */
8731 if ((flg & (PROJECT_BEAM)) && (grids > 0)) grids--;
8734 * Create a conical breath attack
8745 flg &= ~(PROJECT_HIDE);
8747 breath_shape(path_g, dist, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, by, bx, typ);
8751 /* Determine the blast area, work from the inside out */
8752 for (dist = 0; dist <= rad; dist++)
8754 /* Scan the maximal blast area of radius "dist" */
8755 for (y = by - dist; y <= by + dist; y++)
8757 for (x = bx - dist; x <= bx + dist; x++)
8759 /* Ignore "illegal" locations */
8760 if (!in_bounds2(y, x)) continue;
8762 /* Enforce a "circular" explosion */
8763 if (distance(by, bx, y, x) != dist) continue;
8769 /* Lights are stopped by opaque terrains */
8770 if (!los(by, bx, y, x)) continue;
8772 case GF_DISINTEGRATE:
8773 /* Disintegration are stopped only by perma-walls */
8774 if (!in_disintegration_range(by, bx, y, x)) continue;
8777 /* Ball explosions are stopped by walls */
8778 if (!projectable(by, bx, y, x)) continue;
8782 /* Save this grid */
8789 /* Encode some more "radius" info */
8795 /* Speed -- ignore "non-explosions" */
8796 if (!grids) return (FALSE);
8799 /* Display the "blast area" if requested */
8800 if (!blind && !(flg & (PROJECT_HIDE)))
8802 /* Then do the "blast", from inside out */
8803 for (t = 0; t <= gm_rad; t++)
8805 /* Dump everything with this radius */
8806 for (i = gm[t]; i < gm[t+1]; i++)
8808 /* Extract the location */
8812 /* Only do visuals if the player can "see" the blast */
8813 if (panel_contains(y, x) && player_has_los_bold(y, x))
8822 /* Obtain the explosion pict */
8823 p = bolt_pict(y, x, y, x, typ);
8825 /* Extract attr/char */
8829 /* Visual effects -- Display */
8830 print_rel(c, a, y, x);
8834 /* Hack -- center the cursor */
8835 move_cursor_relative(by, bx);
8837 /* Flush each "radius" seperately */
8838 /*if (fresh_before)*/ Term_fresh();
8840 /* Delay (efficiently) */
8841 if (visual || drawn)
8843 Term_xtra(TERM_XTRA_DELAY, msec);
8847 /* Flush the erasing */
8850 /* Erase the explosion drawn above */
8851 for (i = 0; i < grids; i++)
8853 /* Extract the location */
8857 /* Hack -- Erase if needed */
8858 if (panel_contains(y, x) && player_has_los_bold(y, x))
8864 /* Hack -- center the cursor */
8865 move_cursor_relative(by, bx);
8867 /* Flush the explosion */
8868 /*if (fresh_before)*/ Term_fresh();
8873 /* Update stuff if needed */
8874 if (p_ptr->update) update_stuff();
8877 /* Check features */
8878 if (flg & (PROJECT_GRID))
8880 /* Start with "dist" of zero */
8883 /* Scan for features */
8884 for (i = 0; i < grids; i++)
8886 /* Hack -- Notice new "dist" values */
8887 if (gm[dist+1] == i) dist++;
8889 /* Get the grid location */
8893 /* Find the closest point in the blast */
8896 int d = dist_to_line(y, x, y1, x1, by, bx);
8898 /* Affect the grid */
8899 if (project_f(who, d, y, x, dam, typ)) notice = TRUE;
8903 /* Affect the grid */
8904 if (project_f(who, dist, y, x, dam, typ)) notice = TRUE;
8909 /* Update stuff if needed */
8910 if (p_ptr->update) update_stuff();
8913 if (flg & (PROJECT_ITEM))
8915 /* Start with "dist" of zero */
8918 /* Scan for objects */
8919 for (i = 0; i < grids; i++)
8921 /* Hack -- Notice new "dist" values */
8922 if (gm[dist+1] == i) dist++;
8924 /* Get the grid location */
8928 /* Find the closest point in the blast */
8931 int d = dist_to_line(y, x, y1, x1, by, bx);
8933 /* Affect the object in the grid */
8934 if (project_o(who, d, y, x, dam, typ)) notice = TRUE;
8938 /* Affect the object in the grid */
8939 if (project_o(who, dist, y, x, dam, typ)) notice = TRUE;
8945 /* Check monsters */
8946 if (flg & (PROJECT_KILL))
8953 /* Start with "dist" of zero */
8956 /* Scan for monsters */
8957 for (i = 0; i < grids; i++)
8961 /* Hack -- Notice new "dist" values */
8962 if (gm[dist + 1] == i) dist++;
8964 /* Get the grid location */
8968 /* A single bolt may be reflected */
8971 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
8972 monster_race *ref_ptr = &r_info[m_ptr->r_idx];
8974 if ((ref_ptr->flags2 & RF2_REFLECTING) && (flg & PROJECT_REFLECTABLE) && (!who || dist_hack > 1) && !one_in_(10))
8977 int max_attempts = 10;
8979 /* Choose 'new' target */
8982 t_y = y_saver - 1 + randint1(3);
8983 t_x = x_saver - 1 + randint1(3);
8986 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(y, x, t_y, t_x));
8988 if (max_attempts < 1)
8997 if ((m_ptr->r_idx == MON_KENSHIROU) || (m_ptr->r_idx == MON_RAOU))
8998 msg_print("¡ÖËÌÅÍ¿À·ý±üµÁ¡¦Æó»Ø¿¿¶õÇÄ¡ª¡×");
8999 else if (m_ptr->r_idx == MON_DIO) msg_print("¥Ç¥£¥ª¡¦¥Ö¥é¥ó¥É¡¼¤Ï»Ø°ìËܤǹ¶·â¤òÃƤÊÖ¤·¤¿¡ª");
9000 else msg_print("¹¶·â¤ÏÄ·¤ÍÊ֤ä¿¡ª");
9002 msg_print("The attack bounces!");
9005 if (is_original_ap_and_seen(m_ptr)) ref_ptr->r_flags2 |= RF2_REFLECTING;
9007 /* Reflected bolts randomly target either one */
9008 if (one_in_(2)) flg |= PROJECT_PLAYER;
9009 else flg &= ~(PROJECT_PLAYER);
9011 /* The bolt is reflected */
9012 project(cave[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
9014 /* Don't affect the monster any longer */
9020 /* Find the closest point in the blast */
9023 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
9027 effective_dist = dist;
9031 /* There is the riding player on this monster */
9032 if (p_ptr->riding && player_bold(y, x))
9034 /* Aimed on the player */
9035 if (flg & PROJECT_PLAYER)
9037 if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
9040 * A beam or bolt is well aimed
9042 * So don't affects the mount.
9049 * The spell is not well aimed,
9050 * So partly affect the mount too.
9057 * This grid is the original target.
9058 * Or aimed on your horse.
9060 else if (((y == y2) && (x == x2)) || (flg & PROJECT_AIMED))
9062 /* Hit the mount with full damage */
9066 * Otherwise this grid is not the
9067 * original target, it means that line
9068 * of fire is obstructed by this
9072 * A beam or bolt will hit either
9073 * player or mount. Choose randomly.
9075 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE))
9079 /* Hit the mount with full damage */
9083 /* Hit the player later */
9084 flg |= PROJECT_PLAYER;
9086 /* Don't affect the mount */
9092 * The spell is not well aimed, so
9093 * partly affect both player and
9102 /* Affect the monster in the grid */
9103 if (project_m(who, effective_dist, y, x, dam, typ,flg)) notice = TRUE;
9107 /* Player affected one monster (without "jumping") */
9108 if (!who && (project_m_n == 1) && !jump)
9114 /* Track if possible */
9115 if (cave[y][x].m_idx > 0)
9117 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
9119 /* Hack -- auto-recall */
9120 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
9122 /* Hack - auto-track */
9123 if (m_ptr->ml) health_track(cave[y][x].m_idx);
9130 if (flg & (PROJECT_KILL))
9132 /* Start with "dist" of zero */
9135 /* Scan for player */
9136 for (i = 0; i < grids; i++)
9140 /* Hack -- Notice new "dist" values */
9141 if (gm[dist+1] == i) dist++;
9143 /* Get the grid location */
9147 /* Affect the player? */
9148 if (!player_bold(y, x)) continue;
9150 /* Find the closest point in the blast */
9153 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
9157 effective_dist = dist;
9160 /* Target may be your horse */
9163 /* Aimed on the player */
9164 if (flg & PROJECT_PLAYER)
9166 /* Hit the player with full damage */
9170 * Hack -- When this grid was not the
9171 * original target, a beam or bolt
9172 * would hit either player or mount,
9173 * and should be choosen randomly.
9175 * But already choosen to hit the
9176 * mount at this point.
9178 * Or aimed on your horse.
9180 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
9183 * A beam or bolt is well aimed
9185 * So don't affects the player.
9192 * The spell is not well aimed,
9193 * So partly affect the player too.
9199 /* Affect the player */
9200 if (project_p(who, who_name, effective_dist, y, x, dam, typ, flg, monspell)) notice = TRUE;
9208 monster_desc(m_name, &m_list[p_ptr->riding], 0);
9210 if (rakubadam_m > 0)
9212 if (rakuba(rakubadam_m, FALSE))
9215 msg_format("%^s¤Ë¿¶¤êÍî¤È¤µ¤ì¤¿¡ª", m_name);
9217 msg_format("%^s has thrown you off!", m_name);
9221 if (p_ptr->riding && rakubadam_p > 0)
9223 if(rakuba(rakubadam_p, FALSE))
9226 msg_format("%^s¤«¤éÍî¤Á¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
9228 msg_format("You have fallen from %s.", m_name);
9234 /* Return "something was noticed" */
9238 bool binding_field( int dam )
9240 int mirror_x[10],mirror_y[10]; /* ¶À¤Ï¤â¤Ã¤È¾¯¤Ê¤¤ */
9241 int mirror_num=0; /* ¶À¤Î¿ô */
9246 int msec= delay_factor*delay_factor*delay_factor;
9252 /* Default target of monsterspell is player */
9253 monster_target_y=py;
9254 monster_target_x=px;
9256 for( x=0 ; x < cur_wid ; x++ )
9258 for( y=0 ; y < cur_hgt ; y++ )
9260 if( is_mirror_grid(&cave[y][x]) &&
9261 distance(py,px,y,x) <= MAX_RANGE &&
9262 distance(py,px,y,x) != 0 &&
9263 player_has_los_bold(y,x) &&
9264 projectable(py, px, y, x)
9266 mirror_y[mirror_num]=y;
9267 mirror_x[mirror_num]=x;
9273 if( mirror_num < 2 )return FALSE;
9275 point_x[0] = randint0( mirror_num );
9277 point_x[1] = randint0( mirror_num );
9279 while( point_x[0] == point_x[1] );
9281 point_y[0]=mirror_y[point_x[0]];
9282 point_x[0]=mirror_x[point_x[0]];
9283 point_y[1]=mirror_y[point_x[1]];
9284 point_x[1]=mirror_x[point_x[1]];
9288 x=point_x[0]+point_x[1]+point_x[2];
9289 y=point_y[0]+point_y[1]+point_y[2];
9291 centersign = (point_x[0]*3-x)*(point_y[1]*3-y)
9292 - (point_y[0]*3-y)*(point_x[1]*3-x);
9293 if( centersign == 0 )return FALSE;
9295 x1 = point_x[0] < point_x[1] ? point_x[0] : point_x[1];
9296 x1 = x1 < point_x[2] ? x1 : point_x[2];
9297 y1 = point_y[0] < point_y[1] ? point_y[0] : point_y[1];
9298 y1 = y1 < point_y[2] ? y1 : point_y[2];
9300 x2 = point_x[0] > point_x[1] ? point_x[0] : point_x[1];
9301 x2 = x2 > point_x[2] ? x2 : point_x[2];
9302 y2 = point_y[0] > point_y[1] ? point_y[0] : point_y[1];
9303 y2 = y2 > point_y[2] ? y2 : point_y[2];
9305 for( y=y1 ; y <=y2 ; y++ ){
9306 for( x=x1 ; x <=x2 ; x++ ){
9307 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9308 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9309 centersign*( (point_x[1]-x)*(point_y[2]-y)
9310 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9311 centersign*( (point_x[2]-x)*(point_y[0]-y)
9312 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9314 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9315 /* Visual effects */
9317 && panel_contains(y,x)){
9318 p = bolt_pict(y,x,y,x, GF_MANA );
9319 print_rel(PICT_C(p), PICT_A(p),y,x);
9320 move_cursor_relative(y, x);
9321 /*if (fresh_before)*/ Term_fresh();
9322 Term_xtra(TERM_XTRA_DELAY, msec);
9328 for( y=y1 ; y <=y2 ; y++ ){
9329 for( x=x1 ; x <=x2 ; x++ ){
9330 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9331 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9332 centersign*( (point_x[1]-x)*(point_y[2]-y)
9333 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9334 centersign*( (point_x[2]-x)*(point_y[0]-y)
9335 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9337 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9338 (void)project_f(0,0,y,x,dam,GF_MANA);
9343 for( y=y1 ; y <=y2 ; y++ ){
9344 for( x=x1 ; x <=x2 ; x++ ){
9345 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9346 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9347 centersign*( (point_x[1]-x)*(point_y[2]-y)
9348 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9349 centersign*( (point_x[2]-x)*(point_y[0]-y)
9350 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9352 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9353 (void)project_o(0,0,y,x,dam,GF_MANA);
9358 for( y=y1 ; y <=y2 ; y++ ){
9359 for( x=x1 ; x <=x2 ; x++ ){
9360 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9361 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9362 centersign*( (point_x[1]-x)*(point_y[2]-y)
9363 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9364 centersign*( (point_x[2]-x)*(point_y[0]-y)
9365 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9367 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9368 (void)project_m(0,0,y,x,dam,GF_MANA,
9369 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP));
9376 msg_print("¶À¤¬·ë³¦¤ËÂѤ¨¤¤ì¤º¡¢²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡£");
9378 msg_print("The field broke a mirror");
9380 remove_mirror(point_y[0],point_x[0]);
9386 void seal_of_mirror( int dam )
9390 for( x = 0 ; x < cur_wid ; x++ )
9392 for( y = 0 ; y < cur_hgt ; y++ )
9394 if( is_mirror_grid(&cave[y][x]))
9396 if(project_m(0,0,y,x,dam,GF_GENOCIDE,
9397 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP)))
9399 if( !cave[y][x].m_idx )