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;
3396 /* Redraw (later) if needed */
3397 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
3398 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
3406 if (seen) obvious = TRUE;
3411 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
3416 if (seen_msg) msg_format("%^s¤ÏÛ¯Û°¾õÂÖ¤«¤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3418 if (seen_msg) msg_format("%^s is no longer stunned.", m_name);
3422 if (m_ptr->confused)
3425 if (seen_msg) msg_format("%^s¤Ïº®Í𤫤éΩ¤Áľ¤Ã¤¿¡£", m_name);
3427 if (seen_msg) msg_format("%^s is no longer confused.", m_name);
3429 m_ptr->confused = 0;
3434 if (seen_msg) msg_format("%^s¤Ïͦµ¤¤ò¼è¤êÌᤷ¤¿¡£", m_name);
3436 if (seen_msg) msg_format("%^s recovers %s courage.", m_name, m_poss);
3442 if (m_ptr->hp < 30000) m_ptr->hp += dam;
3445 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
3449 chg_virtue(V_VITALITY, 1);
3451 if (r_ptr->flags1 & RF1_UNIQUE)
3452 chg_virtue(V_INDIVIDUALISM, 1);
3454 if (is_friendly(m_ptr))
3455 chg_virtue(V_HONOUR, 1);
3456 else if (!(r_ptr->flags3 & RF3_EVIL))
3458 if (r_ptr->flags3 & RF3_GOOD)
3459 chg_virtue(V_COMPASSION, 2);
3461 chg_virtue(V_COMPASSION, 1);
3464 if (r_ptr->flags3 & RF3_ANIMAL)
3465 chg_virtue(V_NATURE, 1);
3468 if (m_ptr->r_idx == MON_LEPER)
3471 if (!who) chg_virtue(V_COMPASSION, 5);
3474 /* Redraw (later) if needed */
3475 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
3476 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
3480 note = "¤ÏÂÎÎϤò²óÉü¤·¤¿¤è¤¦¤À¡£";
3482 note = " looks healthier.";
3485 /* No "real" damage */
3491 /* Speed Monster (Ignore "dam") */
3494 if (seen) obvious = TRUE;
3500 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
3502 note = " starts moving faster.";
3505 m_ptr->fast = MIN(200, m_ptr->fast + 100);
3507 if (c_ptr->m_idx == p_ptr->riding)
3508 p_ptr->update |= (PU_BONUS);
3512 if (r_ptr->flags1 & RF1_UNIQUE)
3513 chg_virtue(V_INDIVIDUALISM, 1);
3514 if (is_friendly(m_ptr))
3515 chg_virtue(V_HONOUR, 1);
3518 /* No "real" damage */
3524 /* Slow Monster (Use "dam" as "power") */
3527 if (seen) obvious = TRUE;
3529 if (r_ptr->flagsr & RFR_RES_ALL)
3532 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3534 note = " is immune.";
3537 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3540 /* Powerful monsters can resist */
3541 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3542 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3545 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3547 note = " is unaffected!";
3553 /* Normal monsters slow down */
3559 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
3561 note = " starts moving slower.";
3564 m_ptr->slow = MIN(200, m_ptr->slow + 50);
3566 if (c_ptr->m_idx == p_ptr->riding)
3567 p_ptr->update |= (PU_BONUS);
3570 /* No "real" damage */
3576 /* Sleep (Use "dam" as "power") */
3579 if (seen) obvious = TRUE;
3581 if (r_ptr->flagsr & RFR_RES_ALL)
3584 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3586 note = " is immune.";
3589 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3592 /* Attempt a saving throw */
3593 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3594 (r_ptr->flags3 & RF3_NO_SLEEP) ||
3595 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3597 /* Memorize a flag */
3598 if (r_ptr->flags3 & RF3_NO_SLEEP)
3600 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
3603 /* No obvious effect */
3605 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3607 note = " is unaffected!";
3614 /* Go to sleep (much) later */
3616 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
3618 note = " falls asleep!";
3624 /* No "real" damage */
3630 /* Sleep (Use "dam" as "power") */
3631 case GF_STASIS_EVIL:
3633 if (seen) obvious = TRUE;
3635 if (r_ptr->flagsr & RFR_RES_ALL)
3638 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3640 note = " is immune.";
3643 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3646 /* Attempt a saving throw */
3647 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3648 !(r_ptr->flags3 & RF3_EVIL) ||
3649 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3652 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3654 note = " is unaffected!";
3661 /* Go to sleep (much) later */
3663 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3665 note = " is suspended!";
3671 /* No "real" damage */
3676 /* Sleep (Use "dam" as "power") */
3679 if (seen) obvious = TRUE;
3681 if (r_ptr->flagsr & RFR_RES_ALL)
3684 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3686 note = " is immune.";
3689 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3692 /* Attempt a saving throw */
3693 if ((r_ptr->flags1 & RF1_UNIQUE) ||
3694 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3697 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3699 note = " is unaffected!";
3706 /* Go to sleep (much) later */
3708 note = "¤ÏÆ°¤±¤Ê¤¯¤Ê¤Ã¤¿¡ª";
3710 note = " is suspended!";
3716 /* No "real" damage */
3725 dam += (adj_con_fix[p_ptr->stat_ind[A_CHR]] - 1);
3726 vir = virtue_number(V_HARMONY);
3729 dam += p_ptr->virtues[vir-1]/10;
3732 vir = virtue_number(V_INDIVIDUALISM);
3735 dam -= p_ptr->virtues[vir-1]/20;
3738 if (seen) obvious = TRUE;
3740 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3743 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3745 note = " is immune.";
3748 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3752 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3755 /* Attempt a saving throw */
3756 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3757 (r_ptr->flags3 & RF3_NO_CONF) ||
3758 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3759 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 5))
3761 /* Memorize a flag */
3762 if (r_ptr->flags3 & RF3_NO_CONF)
3764 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
3768 /* No obvious effect */
3770 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3772 note = " is unaffected!";
3777 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3779 else if (p_ptr->cursed & TRC_AGGRAVATE)
3782 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3784 note = " hates you too much!";
3787 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3792 note = "¤ÏÆÍÁ³Í§¹¥Åª¤Ë¤Ê¤Ã¤¿¤è¤¦¤À¡ª";
3794 note = " suddenly seems friendly!";
3799 chg_virtue(V_INDIVIDUALISM, -1);
3800 if (r_ptr->flags3 & RF3_ANIMAL)
3801 chg_virtue(V_NATURE, 1);
3804 /* No "real" damage */
3809 /* Control undead */
3810 case GF_CONTROL_UNDEAD:
3813 if (seen) obvious = TRUE;
3815 vir = virtue_number(V_UNLIFE);
3818 dam += p_ptr->virtues[vir-1]/10;
3821 vir = virtue_number(V_INDIVIDUALISM);
3824 dam -= p_ptr->virtues[vir-1]/20;
3827 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3830 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3832 note = " is immune.";
3835 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3839 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3842 /* Attempt a saving throw */
3843 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3844 (!(r_ptr->flags3 & RF3_UNDEAD)) ||
3845 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3846 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3848 /* No obvious effect */
3850 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3852 note = " is unaffected!";
3856 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3858 else if (p_ptr->cursed & TRC_AGGRAVATE)
3861 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3863 note = " hates you too much!";
3866 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3871 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
3873 note = " is in your thrall!";
3879 /* No "real" damage */
3885 case GF_CONTROL_DEMON:
3888 if (seen) obvious = TRUE;
3890 vir = virtue_number(V_UNLIFE);
3893 dam += p_ptr->virtues[vir-1]/10;
3896 vir = virtue_number(V_INDIVIDUALISM);
3899 dam -= p_ptr->virtues[vir-1]/20;
3902 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3905 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3907 note = " is immune.";
3910 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3914 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3917 /* Attempt a saving throw */
3918 if ((r_ptr->flags1 & RF1_QUESTOR) ||
3919 (!(r_ptr->flags3 & RF3_DEMON)) ||
3920 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3921 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
3923 /* No obvious effect */
3925 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3927 note = " is unaffected!";
3931 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3933 else if (p_ptr->cursed & TRC_AGGRAVATE)
3936 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
3938 note = " hates you too much!";
3941 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
3946 note = "¤Ï´û¤Ë¤¢¤Ê¤¿¤ÎÅÛÎì¤À¡ª";
3948 note = " is in your thrall!";
3954 /* No "real" damage */
3960 case GF_CONTROL_ANIMAL:
3964 if (seen) obvious = TRUE;
3966 vir = virtue_number(V_NATURE);
3969 dam += p_ptr->virtues[vir-1]/10;
3972 vir = virtue_number(V_INDIVIDUALISM);
3975 dam -= p_ptr->virtues[vir-1]/20;
3978 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
3981 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
3983 note = " is immune.";
3986 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
3990 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
3993 /* Attempt a saving throw */
3994 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
3995 (!(r_ptr->flags3 & (RF3_ANIMAL))) ||
3996 (m_ptr->mflag2 & MFLAG2_NOPET) ||
3997 (r_ptr->flags3 & (RF3_NO_CONF)) ||
3998 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4000 /* Memorize a flag */
4001 if (r_ptr->flags3 & (RF3_NO_CONF))
4003 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
4007 /* No obvious effect */
4009 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4011 note = " is unaffected!";
4015 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4017 else if (p_ptr->cursed & TRC_AGGRAVATE)
4020 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4022 note = " hates you too much!";
4025 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4030 note = "¤Ï¤Ê¤Ä¤¤¤¿¡£";
4032 note = " is tamed!";
4037 if (r_ptr->flags3 & RF3_ANIMAL)
4038 chg_virtue(V_NATURE, 1);
4041 /* No "real" damage */
4047 case GF_CONTROL_LIVING:
4051 vir = virtue_number(V_UNLIFE);
4052 if (seen) obvious = TRUE;
4054 dam += (adj_chr_chm[p_ptr->stat_ind[A_CHR]]);
4055 vir = virtue_number(V_UNLIFE);
4058 dam -= p_ptr->virtues[vir-1]/10;
4061 vir = virtue_number(V_INDIVIDUALISM);
4064 dam -= p_ptr->virtues[vir-1]/20;
4067 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 30;
4068 if (dam < 1) dam = 1;
4070 msg_format("%s¤ò¸«¤Ä¤á¤¿¡£",m_name);
4072 msg_format("You stare into %s.", m_name);
4074 if ((r_ptr->flagsr & RFR_RES_ALL) || p_ptr->inside_arena)
4077 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4079 note = " is immune.";
4082 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4086 if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
4089 /* Attempt a saving throw */
4090 if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
4091 (m_ptr->mflag2 & MFLAG2_NOPET) ||
4092 !monster_living(r_ptr) ||
4093 ((r_ptr->level+10) > randint1(dam)))
4096 /* No obvious effect */
4098 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4100 note = " is unaffected!";
4104 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4106 else if (p_ptr->cursed & TRC_AGGRAVATE)
4109 note = "¤Ï¤¢¤Ê¤¿¤ËŨ°Õ¤òÊú¤¤¤Æ¤¤¤ë¡ª";
4111 note = " hates you too much!";
4114 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
4119 note = "¤ò»ÙÇÛ¤·¤¿¡£";
4121 note = " is tamed!";
4126 if (r_ptr->flags3 & RF3_ANIMAL)
4127 chg_virtue(V_NATURE, 1);
4130 /* No "real" damage */
4135 /* Confusion (Use "dam" as "power") */
4138 if (seen) obvious = TRUE;
4140 if (r_ptr->flagsr & RFR_RES_ALL)
4143 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4145 note = " is immune.";
4148 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4151 /* Get confused later */
4152 do_conf = damroll(3, (dam / 2)) + 1;
4154 /* Attempt a saving throw */
4155 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4156 (r_ptr->flags3 & (RF3_NO_CONF)) ||
4157 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4159 /* Memorize a flag */
4160 if (r_ptr->flags3 & (RF3_NO_CONF))
4162 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
4168 /* No obvious effect */
4170 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4172 note = " is unaffected!";
4178 /* No "real" damage */
4185 if (seen) obvious = TRUE;
4187 if (r_ptr->flagsr & RFR_RES_ALL)
4190 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4192 note = " is immune.";
4195 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4198 do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
4200 /* Attempt a saving throw */
4201 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4202 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4207 /* No obvious effect */
4209 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4211 note = " is unaffected!";
4217 /* No "real" damage */
4225 /* Lite, but only hurts susceptible creatures */
4233 if (r_ptr->flagsr & RFR_RES_ALL)
4239 if (r_ptr->flags3 & (RF3_HURT_LITE))
4241 /* Obvious effect */
4242 if (seen) obvious = TRUE;
4244 /* Memorize the effects */
4245 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4247 /* Special effect */
4249 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4250 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4252 note = " cringes from the light!";
4253 note_dies = " shrivels away in the light!";
4258 /* Normally no damage */
4270 /* Lite -- opposite of Dark */
4273 if (seen) obvious = TRUE;
4275 if (r_ptr->flagsr & RFR_RES_ALL)
4278 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4280 note = " is immune.";
4283 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4286 if (r_ptr->flagsr & RFR_RES_LITE)
4289 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4294 dam *= 2; dam /= (randint1(6)+6);
4295 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_LITE);
4297 else if (r_ptr->flags3 & (RF3_HURT_LITE))
4299 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
4301 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
4302 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
4304 note = " cringes from the light!";
4305 note_dies = " shrivels away in the light!";
4314 /* Dark -- opposite of Lite */
4317 if (seen) obvious = TRUE;
4319 if (r_ptr->flagsr & RFR_RES_ALL)
4322 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4324 note = " is immune.";
4327 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4330 if (r_ptr->flagsr & RFR_RES_DARK)
4333 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4338 dam *= 2; dam /= (randint1(6)+6);
4339 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_DARK);
4348 if (r_ptr->flagsr & RFR_RES_ALL)
4353 /* Hurt by rock remover */
4354 if (r_ptr->flags3 & (RF3_HURT_ROCK))
4357 if (seen) obvious = TRUE;
4359 /* Memorize the effects */
4360 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_ROCK);
4362 /* Cute little message */
4364 note = "¤ÎÈéÉ椬¤¿¤À¤ì¤¿¡ª";
4365 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4367 note = " loses some skin!";
4368 note_dies = " dissolves!";
4373 /* Usually, ignore the effects */
4384 /* Teleport undead (Use "dam" as "power") */
4385 case GF_AWAY_UNDEAD:
4387 /* Only affect undead */
4388 if (r_ptr->flags3 & (RF3_UNDEAD))
4390 bool resists_tele = FALSE;
4392 if (r_ptr->flagsr & RFR_RES_TELE)
4394 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4396 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4398 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4400 note = " is unaffected!";
4403 resists_tele = TRUE;
4405 else if (r_ptr->level > randint1(100))
4407 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4409 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4414 resists_tele = TRUE;
4420 if (seen) obvious = TRUE;
4421 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4433 /* No "real" damage */
4439 /* Teleport evil (Use "dam" as "power") */
4442 /* Only affect evil */
4443 if (r_ptr->flags3 & (RF3_EVIL))
4445 bool resists_tele = FALSE;
4447 if (r_ptr->flagsr & RFR_RES_TELE)
4449 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4451 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4453 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4455 note = " is unaffected!";
4458 resists_tele = TRUE;
4460 else if (r_ptr->level > randint1(100))
4462 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4464 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4469 resists_tele = TRUE;
4475 if (seen) obvious = TRUE;
4476 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4488 /* No "real" damage */
4494 /* Teleport monster (Use "dam" as "power") */
4497 bool resists_tele = FALSE;
4498 if (r_ptr->flagsr & RFR_RES_TELE)
4500 if ((r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flagsr & RFR_RES_ALL))
4502 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4504 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4506 note = " is unaffected!";
4509 resists_tele = TRUE;
4511 else if (r_ptr->level > randint1(100))
4513 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4515 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡ª";
4520 resists_tele = TRUE;
4527 if (seen) obvious = TRUE;
4529 /* Prepare to teleport */
4533 /* No "real" damage */
4539 /* Turn undead (Use "dam" as "power") */
4540 case GF_TURN_UNDEAD:
4542 if (r_ptr->flagsr & RFR_RES_ALL)
4547 /* Only affect undead */
4548 if (r_ptr->flags3 & (RF3_UNDEAD))
4551 if (seen) obvious = TRUE;
4553 /* Learn about type */
4554 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4556 /* Apply some fear */
4557 do_fear = damroll(3, (dam / 2)) + 1;
4559 /* Attempt a saving throw */
4560 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4562 /* No obvious effect */
4564 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4566 note = " is unaffected!";
4581 /* No "real" damage */
4587 /* Turn evil (Use "dam" as "power") */
4590 if (r_ptr->flagsr & RFR_RES_ALL)
4595 /* Only affect evil */
4596 if (r_ptr->flags3 & (RF3_EVIL))
4599 if (seen) obvious = TRUE;
4601 /* Learn about type */
4602 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4604 /* Apply some fear */
4605 do_fear = damroll(3, (dam / 2)) + 1;
4607 /* Attempt a saving throw */
4608 if (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10)
4610 /* No obvious effect */
4612 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4614 note = " is unaffected!";
4629 /* No "real" damage */
4635 /* Turn monster (Use "dam" as "power") */
4638 if (r_ptr->flagsr & RFR_RES_ALL)
4644 if (seen) obvious = TRUE;
4646 /* Apply some fear */
4647 do_fear = damroll(3, (dam / 2)) + 1;
4649 /* Attempt a saving throw */
4650 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
4651 (r_ptr->flags3 & (RF3_NO_FEAR)) ||
4652 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
4654 /* No obvious effect */
4656 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
4658 note = " is unaffected!";
4665 /* No "real" damage */
4672 case GF_DISP_UNDEAD:
4674 if (r_ptr->flagsr & RFR_RES_ALL)
4680 /* Only affect undead */
4681 if (r_ptr->flags3 & (RF3_UNDEAD))
4684 if (seen) obvious = TRUE;
4686 /* Learn about type */
4687 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_UNDEAD);
4691 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4692 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4694 note = " shudders.";
4695 note_dies = " dissolves!";
4716 if (r_ptr->flagsr & RFR_RES_ALL)
4722 /* Only affect evil */
4723 if (r_ptr->flags3 & (RF3_EVIL))
4726 if (seen) obvious = TRUE;
4728 /* Learn about type */
4729 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_EVIL);
4733 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4734 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4736 note = " shudders.";
4737 note_dies = " dissolves!";
4757 if (r_ptr->flagsr & RFR_RES_ALL)
4763 /* Only affect good */
4764 if (r_ptr->flags3 & (RF3_GOOD))
4767 if (seen) obvious = TRUE;
4769 /* Learn about type */
4770 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
4774 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4775 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4777 note = " shudders.";
4778 note_dies = " dissolves!";
4796 case GF_DISP_LIVING:
4798 if (r_ptr->flagsr & RFR_RES_ALL)
4804 /* Only affect non-undead */
4805 if (monster_living(r_ptr))
4808 if (seen) obvious = TRUE;
4812 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4813 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4815 note = " shudders.";
4816 note_dies = " dissolves!";
4837 if (r_ptr->flagsr & RFR_RES_ALL)
4843 /* Only affect demons */
4844 if (r_ptr->flags3 & (RF3_DEMON))
4847 if (seen) obvious = TRUE;
4849 /* Learn about type */
4850 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_DEMON);
4854 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4855 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4857 note = " shudders.";
4858 note_dies = " dissolves!";
4875 /* Dispel monster */
4878 if (r_ptr->flagsr & RFR_RES_ALL)
4885 if (seen) obvious = TRUE;
4889 note = "¤Ï¿È¿Ì¤¤¤·¤¿¡£";
4890 note_dies = "¤Ï¥É¥í¥É¥í¤ËÍϤ±¤¿¡ª";
4892 note = " shudders.";
4893 note_dies = " dissolves!";
4903 if (seen) obvious = TRUE;
4905 if (r_ptr->flagsr & RFR_RES_ALL)
4908 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4910 note = " is immune.";
4913 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4917 if ((r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) || (r_ptr->flags5 & ~(RF5_NOMAGIC_MASK)) || (r_ptr->flags6 & ~(RF6_NOMAGIC_MASK)))
4921 /* Heal the monster */
4922 if (caster_ptr->hp < caster_ptr->maxhp)
4925 caster_ptr->hp += 6 * dam;
4926 if (caster_ptr->hp > caster_ptr->maxhp) caster_ptr->hp = caster_ptr->maxhp;
4928 /* Redraw (later) if needed */
4929 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
4930 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
4932 /* Special message */
4935 /* Get the monster name */
4936 monster_desc(killer, caster_ptr, 0);
4938 msg_format("%^s¤Ïµ¤Ê¬¤¬Îɤµ¤½¤¦¤À¡£", killer);
4940 msg_format("%^s appears healthier.", killer);
4949 msg_format("%s¤«¤éÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¤È¤Ã¤¿¡£", m_name);
4951 msg_format("You draw psychic energy from %s.", m_name);
4954 (void)hp_player(dam);
4960 if (see_s_msg) msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", m_name);
4962 if (see_s_msg) msg_format("%s is unaffected.", m_name);
4972 if (seen) obvious = TRUE;
4975 if (!who) msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£", m_name);
4977 if (!who) msg_format("You gaze intently at %s.", m_name);
4980 if (r_ptr->flagsr & RFR_RES_ALL)
4983 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
4985 note = " is immune.";
4988 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
4992 /* Attempt a saving throw */
4993 if ((r_ptr->flags1 & RF1_UNIQUE) ||
4994 (r_ptr->flags3 & RF3_NO_CONF) ||
4995 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
4997 /* Memorize a flag */
4998 if (r_ptr->flags3 & (RF3_NO_CONF))
5000 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
5003 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5005 note = "is unaffected!";
5009 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
5011 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5013 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5015 note = " is immune!";
5019 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
5021 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
5023 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
5032 note = "¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£";
5033 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
5035 note = " is blasted by psionic energy.";
5036 note_dies = " collapses, a mindless husk.";
5039 if (who > 0) do_conf = randint0(4) + 4;
5040 else do_conf = randint0(8) + 8;
5046 case GF_BRAIN_SMASH:
5048 if (seen) obvious = TRUE;
5051 if (!who) msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£", m_name);
5053 if (!who) msg_format("You gaze intently at %s.", m_name);
5056 if (r_ptr->flagsr & RFR_RES_ALL)
5059 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5061 note = " is immune.";
5064 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5068 /* Attempt a saving throw */
5069 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5070 (r_ptr->flags3 & RF3_NO_CONF) ||
5071 (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
5073 /* Memorize a flag */
5074 if (r_ptr->flags3 & (RF3_NO_CONF))
5076 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
5079 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5081 note = "is unaffected!";
5085 else if (r_ptr->flags2 & RF2_EMPTY_MIND)
5087 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5089 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5091 note = " is immune!";
5095 else if (r_ptr->flags2 & RF2_WEIRD_MIND)
5097 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
5099 note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
5108 note = "¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£";
5109 note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
5111 note = " is blasted by psionic energy.";
5112 note_dies = " collapses, a mindless husk.";
5117 do_conf = randint0(4) + 4;
5118 do_stun = randint0(4) + 4;
5122 do_conf = randint0(8) + 8;
5123 do_stun = randint0(8) + 8;
5125 m_ptr->slow = MIN(200, m_ptr->slow + 10);
5126 if (c_ptr->m_idx == p_ptr->riding)
5127 p_ptr->update |= (PU_BONUS);
5135 if (seen) obvious = TRUE;
5138 if (!who) msg_format("%s¤ò»Øº¹¤·¤Æ¼ö¤¤¤ò¤«¤±¤¿¡£", m_name);
5140 if (!who) msg_format("You point at %s and curses.", m_name);
5143 if (r_ptr->flagsr & RFR_RES_ALL)
5146 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5148 note = " is immune.";
5151 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5155 /* Attempt a saving throw */
5156 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
5159 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5161 note = "is unaffected!";
5171 if (seen) obvious = TRUE;
5174 if (!who) msg_format("%s¤ò»Øº¹¤·¤Æ¶²¤í¤·¤²¤Ë¼ö¤¤¤ò¤«¤±¤¿¡£", m_name);
5176 if (!who) msg_format("You point at %s and curses horribly.", m_name);
5179 if (r_ptr->flagsr & RFR_RES_ALL)
5182 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5184 note = " is immune.";
5187 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5191 /* Attempt a saving throw */
5192 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
5195 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5197 note = "is unaffected!";
5207 if (seen) obvious = TRUE;
5210 if (!who) msg_format("%s¤ò»Øº¹¤·¡¢¶²¤í¤·¤²¤Ë¼öʸ¤ò¾§¤¨¤¿¡ª", m_name);
5212 if (!who) msg_format("You point at %s, incanting terribly!", m_name);
5215 if (r_ptr->flagsr & RFR_RES_ALL)
5218 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5220 note = " is immune.";
5223 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5227 /* Attempt a saving throw */
5228 if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
5231 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5233 note = "is unaffected!";
5243 if (seen) obvious = TRUE;
5246 if (!who) msg_format("%s¤ÎÈ빦¤òÆͤ¤¤Æ¡¢¡Ö¤ªÁ°¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡×¤È¶«¤ó¤À¡£", m_name);
5248 if (!who) msg_format("You point at %s, screaming the word, 'DIE!'.", m_name);
5251 if (r_ptr->flagsr & RFR_RES_ALL)
5254 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5256 note = " is immune.";
5259 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5263 /* Attempt a saving throw */
5264 if ((randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35)) && ((who <= 0) || (caster_ptr->r_idx != MON_KENSHIROU)))
5267 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5269 note = "is unaffected!";
5279 if (seen) obvious = TRUE;
5281 if (r_ptr->flagsr & RFR_RES_ALL)
5284 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5286 note = " is immune.";
5289 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5293 if (r_ptr->flags1 & RF1_UNIQUE)
5296 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5298 note = "is unaffected!";
5304 if ((who > 0) ? ((caster_lev + randint1(dam)) > (r_ptr->level + 10 + randint1(20))) :
5305 (((caster_lev / 2) + randint1(dam)) > (r_ptr->level + randint1(200))))
5307 dam = ((40 + randint1(20)) * m_ptr->hp) / 100;
5309 if (m_ptr->hp < dam) dam = m_ptr->hp - 1;
5314 note = "¤ÏÂÑÀ¤ò»ý¤Ã¤Æ¤¤¤ë¡ª";
5324 /* Capture monster */
5328 if ((p_ptr->inside_quest && (quest[p_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(m_ptr)) ||
5329 (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)
5332 msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£",m_name);
5334 msg_format("%^s is unaffected.", m_name);
5340 if (is_pet(m_ptr)) nokori_hp = m_ptr->maxhp*4L;
5341 else if ((p_ptr->pclass == CLASS_BEASTMASTER) && monster_living(r_ptr))
5342 nokori_hp = m_ptr->maxhp * 3 / 10;
5344 nokori_hp = m_ptr->maxhp * 3 / 20;
5346 if (m_ptr->hp >= nokori_hp)
5349 msg_format("¤â¤Ã¤È¼å¤é¤»¤Ê¤¤¤È¡£");
5351 msg_format("You need to weaken %s more.", m_name);
5355 else if (m_ptr->hp < randint0(nokori_hp))
5357 if (m_ptr->mflag2 & MFLAG2_CHAMELEON) choose_new_monster(c_ptr->m_idx, FALSE, MON_CHAMELEON);
5359 msg_format("%s¤òÊᤨ¤¿¡ª",m_name);
5361 msg_format("You capture %^s!", m_name);
5363 cap_mon = m_list[c_ptr->m_idx].r_idx;
5364 cap_mspeed = m_list[c_ptr->m_idx].mspeed;
5365 cap_hp = m_list[c_ptr->m_idx].hp;
5366 cap_maxhp = m_list[c_ptr->m_idx].max_maxhp;
5367 if (m_list[c_ptr->m_idx].nickname)
5368 cap_nickname = quark_add(quark_str(m_list[c_ptr->m_idx].nickname));
5371 if (c_ptr->m_idx == p_ptr->riding)
5373 if (rakuba(-1, FALSE))
5376 msg_print("ÃÏÌ̤ËÍî¤È¤µ¤ì¤¿¡£");
5378 msg_format("You have fallen from %s.", m_name);
5383 delete_monster_idx(c_ptr->m_idx);
5390 msg_format("¤¦¤Þ¤¯Êá¤Þ¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡£");
5392 msg_format("You failed to capture %s.", m_name);
5399 /* Attack (Use "dam" as attack type) */
5402 /* Return this monster's death */
5403 return py_attack(y, x, dam);
5406 /* Sleep (Use "dam" as "power") */
5412 if (seen) obvious = TRUE;
5414 if (r_ptr->flagsr & RFR_RES_ALL)
5417 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5419 note = " is immune.";
5422 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5425 if (r_ptr->flags2 & RF2_EMPTY_MIND)
5428 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5430 note = " is immune!";
5434 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
5440 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5442 note = " is immune!";
5449 if (one_in_(5)) effect = 1;
5450 else if (one_in_(4)) effect = 2;
5451 else if (one_in_(3)) effect = 3;
5456 /* Powerful monsters can resist */
5457 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5458 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5461 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5463 note = " is unaffected!";
5469 /* Normal monsters slow down */
5475 note = "¤ÎÆ°¤¤¬ÃÙ¤¯¤Ê¤Ã¤¿¡£";
5477 note = " starts moving slower.";
5480 m_ptr->slow = MIN(200, m_ptr->slow + 50);
5482 if (c_ptr->m_idx == p_ptr->riding)
5483 p_ptr->update |= (PU_BONUS);
5487 else if (effect == 2)
5489 do_stun = damroll((p_ptr->lev / 10) + 3 , (dam)) + 1;
5491 /* Attempt a saving throw */
5492 if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
5493 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5498 /* No obvious effect */
5500 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5502 note = " is unaffected!";
5509 else if (effect == 3)
5511 /* Attempt a saving throw */
5512 if ((r_ptr->flags1 & RF1_UNIQUE) ||
5513 (r_ptr->flags3 & RF3_NO_SLEEP) ||
5514 (r_ptr->level > randint1((dam - 10) < 1 ? 1 : (dam - 10)) + 10))
5516 /* Memorize a flag */
5517 if (r_ptr->flags3 & RF3_NO_SLEEP)
5519 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_SLEEP);
5522 /* No obvious effect */
5524 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5526 note = " is unaffected!";
5533 /* Go to sleep (much) later */
5535 note = "¤Ï̲¤ê¹þ¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5537 note = " falls asleep!";
5547 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5549 note = " is immune!";
5553 /* No "real" damage */
5562 if (seen) obvious = TRUE;
5564 if (r_ptr->flagsr & RFR_RES_ALL)
5567 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5569 note = " is immune.";
5572 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5576 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)
5583 if ((r_ptr->level > randint0(dam)) || (m_ptr->mflag2 & MFLAG2_NOGENO))
5590 delete_monster_idx(c_ptr->m_idx);
5592 msg_format("%s¤Ï¾ÃÌǤ·¤¿¡ª",m_name);
5594 msg_format("%^s disappered!",m_name);
5598 take_hit(DAMAGE_GENO, randint1((r_ptr->level+1)/2), "¥â¥ó¥¹¥¿¡¼¾ÃÌǤμöʸ¤ò¾§¤¨¤¿ÈèÏ«", -1);
5600 take_hit(DAMAGE_GENO, randint1((r_ptr->level+1)/2), "the strain of casting Genocide One", -1);
5604 chg_virtue(V_VITALITY, -1);
5609 p_ptr->redraw |= (PR_HP);
5612 p_ptr->window |= (PW_PLAYER);
5619 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5621 note = "is unaffected!";
5624 if (one_in_(13)) m_ptr->mflag2 |= MFLAG2_NOGENO;
5632 if (!who) msg_format("%s¤ò¼Ì¿¿¤Ë»£¤Ã¤¿¡£", m_name);
5634 if (!who) msg_format("You take a photograph of %s.", m_name);
5637 if (r_ptr->flags3 & (RF3_HURT_LITE))
5639 /* Obvious effect */
5640 if (seen) obvious = TRUE;
5642 /* Memorize the effects */
5643 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_HURT_LITE);
5645 /* Special effect */
5647 note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
5648 note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
5650 note = " cringes from the light!";
5651 note_dies = " shrivels away in the light!";
5655 /* Normally no damage */
5662 photo = m_ptr->r_idx;
5669 case GF_BLOOD_CURSE:
5671 if (seen) obvious = TRUE;
5673 if (r_ptr->flagsr & RFR_RES_ALL)
5676 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5678 note = " is immune.";
5681 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5689 bool success = FALSE;
5690 if (seen) obvious = TRUE;
5692 if ((r_ptr->flags3 & (RF3_GOOD)) && !p_ptr->inside_arena)
5694 if (r_ptr->flags3 & (RF3_NO_CONF)) dam -= 50;
5695 if (dam < 1) dam = 1;
5697 /* No need to tame your pet */
5701 note = "¤ÎÆ°¤¤¬Â®¤¯¤Ê¤Ã¤¿¡£";
5703 note = " starts moving faster.";
5706 m_ptr->fast = MIN(200, m_ptr->fast + 100);
5710 /* Attempt a saving throw */
5711 else if ((r_ptr->flags1 & (RF1_QUESTOR)) ||
5712 (r_ptr->flags1 & (RF1_UNIQUE)) ||
5713 (m_ptr->mflag2 & MFLAG2_NOPET) ||
5714 (p_ptr->cursed & TRC_AGGRAVATE) ||
5715 ((r_ptr->level+10) > randint1(dam)))
5718 if (one_in_(4)) m_ptr->mflag2 |= MFLAG2_NOPET;
5723 note = "¤ò»ÙÇÛ¤·¤¿¡£";
5725 note = " is tamed!";
5729 m_ptr->fast = MIN(200, m_ptr->fast + 100);
5731 /* Learn about type */
5732 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_GOOD);
5739 if (!(r_ptr->flags3 & RF3_NO_FEAR))
5741 do_fear = randint1(90)+10;
5743 else if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_FEAR);
5746 /* No "real" damage */
5753 if (seen) obvious = TRUE;
5755 if (r_ptr->flagsr & RFR_RES_ALL)
5758 note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
5760 note = " is immune.";
5763 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
5767 /* Attempt a saving throw */
5768 if (randint0(100 + dam) < (r_ptr->level + 50))
5772 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
5774 note = "is unaffected!";
5795 /* Absolutely no effect */
5796 if (skipped) return (FALSE);
5798 /* "Unique" monsters cannot be polymorphed */
5799 if (r_ptr->flags1 & (RF1_UNIQUE)) do_poly = FALSE;
5801 /* Quest monsters cannot be polymorphed */
5802 if (r_ptr->flags1 & RF1_QUESTOR) do_poly = FALSE;
5804 if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_poly = FALSE;
5806 /* "Unique" and "quest" monsters can only be "killed" by the player. */
5807 if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & RF7_NAZGUL)) && !p_ptr->inside_battle)
5809 if (who && (dam > m_ptr->hp)) dam = m_ptr->hp;
5814 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_COMPASSION, -1);
5815 if (!(r_ptr->flags3 & RF3_EVIL) || one_in_(5)) chg_virtue(V_HONOUR, -1);
5818 /* Modify the damage */
5820 dam = mon_damage_mod(m_ptr, dam, (bool)(typ == GF_PSY_SPEAR));
5822 if ((tmp > 0) && (dam == 0)) note = "¤Ï¥À¥á¡¼¥¸¤ò¼õ¤±¤Æ¤¤¤Ê¤¤¡£";
5824 if ((tmp > 0) && (dam == 0)) note = " is unharmed.";
5827 /* Check for death */
5828 if (dam > m_ptr->hp)
5830 /* Extract method of death */
5835 /* Sound and Impact resisters never stun */
5837 !(r_ptr->flagsr & (RFR_RES_SOUN | RFR_RES_WALL)) &&
5838 !(r_ptr->flags3 & RF3_NO_STUN))
5841 if (seen) obvious = TRUE;
5847 note = "¤Ï¤Ò¤É¤¯¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5849 note = " is more dazed.";
5852 tmp = m_ptr->stunned + (do_stun / 2);
5857 note = "¤Ï¤â¤¦¤í¤¦¤È¤·¤¿¡£";
5859 note = " is dazed.";
5866 m_ptr->stunned = (tmp < 200) ? tmp : 200;
5872 /* Confusion and Chaos resisters (and sleepers) never confuse */
5874 !(r_ptr->flags3 & RF3_NO_CONF) &&
5875 !(r_ptr->flagsr & RFR_EFF_RES_CHAO_MASK))
5878 if (seen) obvious = TRUE;
5880 /* Already partially confused */
5881 if (m_ptr->confused)
5884 note = "¤Ï¤µ¤é¤Ëº®Í𤷤¿¤è¤¦¤À¡£";
5886 note = " looks more confused.";
5889 tmp = m_ptr->confused + (do_conf / 2);
5892 /* Was not confused */
5896 note = "¤Ïº®Í𤷤¿¤è¤¦¤À¡£";
5898 note = " looks confused.";
5904 /* Apply confusion */
5905 m_ptr->confused = (tmp < 200) ? tmp : 200;
5914 if (seen) obvious = TRUE;
5916 if (do_time >= m_ptr->maxhp) do_time = m_ptr->maxhp - 1;
5921 note = "¤Ï¼å¤¯¤Ê¤Ã¤¿¤è¤¦¤À¡£";
5923 note = " seems weakened.";
5925 m_ptr->maxhp -= do_time;
5926 if ((m_ptr->hp - dam) > m_ptr->maxhp) dam = m_ptr->hp - m_ptr->maxhp;
5931 /* Mega-Hack -- Handle "polymorph" -- monsters get a saving throw */
5932 if (do_poly && (randint1(90) > r_ptr->level))
5934 if (polymorph_monster(y, x))
5937 if (seen) obvious = TRUE;
5939 /* Monster polymorphs */
5941 note = "¤¬ÊѿȤ·¤¿¡ª";
5946 /* Turn off the damage */
5949 /* Hack -- Get new monster */
5950 m_ptr = &m_list[c_ptr->m_idx];
5952 /* Hack -- Get new race */
5953 r_ptr = &r_info[m_ptr->r_idx];
5959 note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
5961 note = " is unaffected!";
5966 /* Handle "teleport" */
5970 if (seen) obvious = TRUE;
5974 note = "¤¬¾Ã¤¨µî¤Ã¤¿¡ª";
5976 note = " disappears!";
5979 if (!who) chg_virtue(V_VALOUR, -1);
5982 teleport_away(c_ptr->m_idx, do_dist, (bool)(!who), TRUE);
5984 /* Hack -- get new location */
5988 /* Hack -- get new grid */
5989 c_ptr = &cave[y][x];
5996 tmp = m_ptr->monfear + do_fear;
5999 m_ptr->monfear = (tmp < 200) ? tmp : 200;
6006 if (typ == GF_DRAIN_MANA)
6008 /* Drain mana does nothing */
6011 /* If another monster did the damage, hurt the monster by hand */
6014 /* Redraw (later) if needed */
6015 if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
6016 if (p_ptr->riding == c_ptr->m_idx) p_ptr->redraw |= (PR_UHEALTH);
6018 /* Wake the monster up */
6021 if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
6023 /* Hurt the monster */
6031 if (is_pet(m_ptr) && !(m_ptr->ml))
6034 /* Give detailed messages if destroyed */
6037 monster_desc(m_name, m_ptr, MD_TRUE_NAME);
6040 msg_format("%^s%s", m_name, note);
6048 monster_gain_exp(who, m_ptr->r_idx);
6050 /* Generate treasure, etc */
6051 monster_death(c_ptr->m_idx, FALSE);
6053 /* Delete the monster */
6054 delete_monster_idx(c_ptr->m_idx);
6059 msg_print("¾¯¤·Èᤷ¤¤µ¤Ê¬¤¬¤·¤¿¡£");
6061 msg_print("You feel sad for a moment.");
6067 /* Damaged monster */
6070 /* Give detailed messages if visible or destroyed */
6071 if (note && seen_msg) msg_format("%^s%s", m_name, note);
6073 /* Hack -- Pain message */
6076 message_pain(c_ptr->m_idx, dam);
6083 /* Hack -- handle sleep */
6084 if (do_sleep) m_ptr->csleep = do_sleep;
6088 else if (heal_leper)
6091 if (seen_msg) msg_print("ÉÔ·é¤ÊÉ¿ͤÏɵ¤¤¬¼£¤Ã¤¿¡ª");
6093 if (seen_msg) msg_print("The Mangy looking leper is healed!");
6096 delete_monster_idx(c_ptr->m_idx);
6099 /* If the player did it, give him experience, check fear */
6104 /* Hurt the monster, check for fear and death */
6105 if (mon_take_hit(c_ptr->m_idx, dam, &fear, note_dies))
6110 /* Damaged monster */
6113 /* HACK - anger the monster before showing the sleep message */
6114 if (do_sleep) anger_monster(m_ptr);
6116 /* Give detailed messages if visible or destroyed */
6117 if (note && seen_msg)
6119 msg_format("%s%s", m_name, note);
6121 msg_format("%^s%s", m_name, note);
6125 /* Hack -- Pain message */
6126 else if (known && (dam || !do_fear))
6128 message_pain(c_ptr->m_idx, dam);
6131 /* Anger monsters */
6132 if (((dam > 0) || get_angry) && !do_sleep)
6133 anger_monster(m_ptr);
6136 if ((fear || do_fear) && seen)
6143 msg_format("%^s¤Ï¶²Éݤ·¤Æƨ¤²½Ð¤·¤¿¡ª", m_name);
6145 msg_format("%^s flees in terror!", m_name);
6149 /* Hack -- handle sleep */
6150 if (do_sleep) m_ptr->csleep = do_sleep;
6154 if ((typ == GF_BLOOD_CURSE) && one_in_(4))
6156 int curse_flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
6160 switch (randint1(28))
6166 msg_print("ÃÏÌ̤¬Íɤ줿...");
6168 msg_print("The ground trembles...");
6171 earthquake(ty, tx, 4 + randint0(4));
6172 if (!one_in_(6)) break;
6174 case 3: case 4: case 5: case 6:
6177 int dam = damroll(10, 10);
6179 msg_print("½ã¿è¤ÊËâÎϤμ¡¸µ¤Ø¤ÎÈ⤬³«¤¤¤¿¡ª");
6181 msg_print("A portal opens to a plane of raw mana!");
6184 project(0, 8, ty,tx, dam, GF_MANA, curse_flg, -1);
6185 if (!one_in_(6)) break;
6191 msg_print("¶õ´Ö¤¬ÏĤó¤À¡ª");
6193 msg_print("Space warps about you!");
6196 if (m_ptr->r_idx) teleport_away(c_ptr->m_idx, damroll(10, 10), FALSE, TRUE);
6197 if (one_in_(13)) count += activate_hi_summon(ty, tx, TRUE);
6198 if (!one_in_(6)) break;
6200 case 9: case 10: case 11:
6202 msg_print("¥¨¥Í¥ë¥®¡¼¤Î¤¦¤Í¤ê¤ò´¶¤¸¤¿¡ª");
6204 msg_print("You feel a surge of energy!");
6207 project(0, 7, ty, tx, 50, GF_DISINTEGRATE, curse_flg, -1);
6208 if (!one_in_(6)) break;
6209 case 12: case 13: case 14: case 15: case 16:
6210 aggravate_monsters(0);
6211 if (!one_in_(6)) break;
6213 count += activate_hi_summon(ty, tx, TRUE);
6214 if (!one_in_(6)) break;
6215 case 19: case 20: case 21: case 22:
6217 bool pet = !one_in_(3);
6218 u32b mode = PM_ALLOW_GROUP;
6220 if (pet) mode |= PM_FORCE_PET;
6221 else mode |= (PM_NO_PET | PM_FORCE_FRIENDLY);
6223 count += summon_specific((pet ? -1 : 0), py, px, (pet ? p_ptr->lev*2/3+randint1(p_ptr->lev/2) : dun_level), 0, mode);
6224 if (!one_in_(6)) break;
6226 case 23: case 24: case 25:
6227 if (p_ptr->hold_life && (randint0(100) < 75)) break;
6229 msg_print("À¸Ì¿ÎϤ¬ÂΤ«¤éµÛ¤¤¼è¤é¤ì¤¿µ¤¤¬¤¹¤ë¡ª");
6231 msg_print("You feel your life draining away...");
6234 if (p_ptr->hold_life) lose_exp(p_ptr->exp / 160);
6235 else lose_exp(p_ptr->exp / 16);
6236 if (!one_in_(6)) break;
6237 case 26: case 27: case 28:
6246 (void)do_dec_stat(i);
6255 (void)do_dec_stat(randint0(6));
6264 if (p_ptr->inside_battle)
6266 p_ptr->health_who = c_ptr->m_idx;
6267 p_ptr->redraw |= (PR_HEALTH);
6271 /* XXX XXX XXX Verify this code */
6273 /* Update the monster */
6274 update_mon(c_ptr->m_idx, FALSE);
6276 /* Redraw the monster grid */
6280 /* Update monster recall window */
6281 if (p_ptr->monster_race_idx == m_ptr->r_idx)
6284 p_ptr->window |= (PW_MONSTER);
6287 if ((dam > 0) && !is_pet(m_ptr) && !is_friendly(m_ptr))
6291 if (!projectable(m_ptr->fy, m_ptr->fx, py, px) && !(flg & PROJECT_NO_HANGEKI))
6293 set_target(m_ptr, monster_target_y, monster_target_x);
6296 else if ((who > 0) && is_pet(caster_ptr) && !player_bold(m_ptr->target_y, m_ptr->target_x))
6298 set_target(m_ptr, caster_ptr->fy, caster_ptr->fx);
6302 if (p_ptr->riding && (p_ptr->riding == c_ptr->m_idx) && (dam > 0))
6304 if (m_ptr->hp > m_ptr->maxhp/3) dam = (dam + 1) / 2;
6305 rakubadam_m = (dam > 200) ? 200 : dam;
6314 /* Get local object */
6317 /* Prepare to make a Blade of Chaos */
6318 object_prep(q_ptr, lookup_kind(TV_STATUE, SV_PHOTO));
6320 q_ptr->pval = photo;
6322 /* Mark the item as fully known */
6323 q_ptr->ident |= (IDENT_MENTAL);
6325 /* Drop it in the dungeon */
6326 (void)drop_near(q_ptr, -1, py, px);
6334 /* Return "Anything seen?" */
6340 * Helper function for "project()" below.
6342 * Handle a beam/bolt/ball causing damage to the player.
6344 * This routine takes a "source monster" (by index), a "distance", a default
6345 * "damage", and a "damage type". See "project_m()" above.
6347 * If "rad" is non-zero, then the blast was centered elsewhere, and the damage
6348 * is reduced (see "project_m()" above). This can happen if a monster breathes
6349 * at the player and hits a wall instead.
6351 * NOTE (Zangband): 'Bolt' attacks can be reflected back, so we need
6352 * to know if this is actually a ball or a bolt spell
6355 * We return "TRUE" if any "obvious" effects were observed. XXX XXX Actually,
6356 * we just assume that the effects were obvious, for historical reasons.
6358 static bool project_p(int who, cptr who_name, int r, int y, int x, int dam, int typ, int flg, int monspell)
6363 /* Hack -- assume obvious */
6364 bool obvious = TRUE;
6366 /* Player blind-ness */
6367 bool blind = (p_ptr->blind ? TRUE : FALSE);
6369 /* Player needs a "description" (he is blind) */
6372 /* Source monster */
6373 monster_type *m_ptr = NULL;
6375 /* Monster name (for attacks) */
6378 /* Monster name (for damage) */
6381 /* Hack -- messages */
6387 /* Player is not here */
6388 if (!player_bold(y, x)) return (FALSE);
6390 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && (randint0(55) < (p_ptr->lev*3/5+20)) && who && (who != p_ptr->riding))
6396 /* Player cannot hurt himself */
6397 if (!who) return (FALSE);
6398 if (who == p_ptr->riding) return (FALSE);
6400 if ((p_ptr->reflect || ((p_ptr->special_defense & KATA_FUUJIN) && !p_ptr->blind)) && (flg & PROJECT_REFLECTABLE) && !one_in_(10))
6403 int max_attempts = 10;
6406 if (blind) msg_print("²¿¤«¤¬Ä·¤ÍÊ֤ä¿¡ª");
6407 else if (p_ptr->special_defense & KATA_FUUJIN) msg_print("É÷¤ÎÇ¡¤¯Éð´ï¤ò¿¶¤ë¤Ã¤ÆÃƤÊÖ¤·¤¿¡ª");
6408 else msg_print("¹¶·â¤¬Ä·¤ÍÊ֤ä¿¡ª");
6410 if (blind) msg_print("Something bounces!");
6411 else msg_print("The attack bounces!");
6415 /* Choose 'new' target */
6418 t_y = m_list[who].fy - 1 + randint1(3);
6419 t_x = m_list[who].fx - 1 + randint1(3);
6422 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(py, px, t_y, t_x));
6424 if (max_attempts < 1)
6426 t_y = m_list[who].fy;
6427 t_x = m_list[who].fx;
6430 project(0, 0, t_y, t_x, dam, typ, (PROJECT_STOP|PROJECT_KILL|PROJECT_REFLECTABLE), monspell);
6437 /* Limit maximum damage */
6438 if (dam > 1600) dam = 1600;
6440 /* Reduce damage by distance */
6441 dam = (dam + r) / (r + 1);
6444 /* If the player is blind, be more descriptive */
6445 if (blind) fuzzy = TRUE;
6450 /* Get the source monster */
6451 m_ptr = &m_list[who];
6452 /* Extract the monster level */
6453 rlev = (((&r_info[m_ptr->r_idx])->level >= 1) ? (&r_info[m_ptr->r_idx])->level : 1);
6455 /* Get the monster name */
6456 monster_desc(m_name, m_ptr, 0);
6458 /* Get the monster's real name (gotten before polymorph!) */
6459 strcpy(killer, who_name);
6464 strcpy(killer, "æ«");
6466 strcpy(killer, "a trap");
6470 /* Analyze the damage */
6473 /* Standard damage -- hurts inventory too */
6477 if (fuzzy) msg_print("»À¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6479 if (fuzzy) msg_print("You are hit by acid!");
6482 get_damage = acid_dam(dam, killer, monspell);
6486 /* Standard damage -- hurts inventory too */
6490 if (fuzzy) msg_print("²Ð±ê¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6492 if (fuzzy) msg_print("You are hit by fire!");
6495 get_damage = fire_dam(dam, killer, monspell);
6499 /* Standard damage -- hurts inventory too */
6503 if (fuzzy) msg_print("Î䵤¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6505 if (fuzzy) msg_print("You are hit by cold!");
6508 get_damage = cold_dam(dam, killer, monspell);
6512 /* Standard damage -- hurts inventory too */
6516 if (fuzzy) msg_print("ÅÅ·â¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6518 if (fuzzy) msg_print("You are hit by lightning!");
6521 get_damage = elec_dam(dam, killer, monspell);
6525 /* Standard damage -- also poisons player */
6528 bool double_resist = IS_OPPOSE_POIS();
6530 if (fuzzy) msg_print("ÆǤǹ¶·â¤µ¤ì¤¿¡ª");
6532 if (fuzzy) msg_print("You are hit by poison!");
6535 if (p_ptr->resist_pois) dam = (dam + 2) / 3;
6536 if (double_resist) dam = (dam + 2) / 3;
6538 if ((!(double_resist || p_ptr->resist_pois)) &&
6539 one_in_(HURT_CHANCE))
6544 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6546 if (!(double_resist || p_ptr->resist_pois))
6548 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6553 /* Standard damage -- also poisons / mutates player */
6556 bool double_resist = IS_OPPOSE_POIS();
6558 if (fuzzy) msg_print("Êü¼Íǽ¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6560 if (fuzzy) msg_print("You are hit by radiation!");
6563 if (p_ptr->resist_pois) dam = (2 * dam + 2) / 5;
6564 if (double_resist) dam = (2 * dam + 2) / 5;
6565 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6566 if (!(double_resist || p_ptr->resist_pois))
6568 set_poisoned(p_ptr->poisoned + randint0(dam) + 10);
6570 if (one_in_(5)) /* 6 */
6573 msg_print("´ñ·ÁŪ¤ÊÊѿȤò¿ë¤²¤¿¡ª");
6575 msg_print("You undergo a freakish metamorphosis!");
6578 if (one_in_(4)) /* 4 */
6586 inven_damage(set_acid_destroy, 2);
6592 /* Standard damage */
6596 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6598 if (fuzzy) msg_print("You are hit by something!");
6601 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6605 /* Holy Orb -- Player only takes partial damage */
6609 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6611 if (fuzzy) msg_print("You are hit by something!");
6614 if (p_ptr->align > 10)
6616 else if (p_ptr->align < -10)
6618 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6625 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6627 if (fuzzy) msg_print("You are hit by something!");
6630 if (p_ptr->align > 10)
6632 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6636 /* Arrow -- XXX no dodging */
6640 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6642 if (fuzzy) msg_print("You are hit by something sharp!");
6645 else if ((inventory[INVEN_RARM].name1 == ART_ZANTETSU) || (inventory[INVEN_LARM].name1 == ART_ZANTETSU))
6648 msg_print("Ìð¤ò»Â¤ê¼Î¤Æ¤¿¡ª");
6650 msg_print("You cut down the arrow!");
6654 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6658 /* Plasma -- XXX No resist */
6662 if (fuzzy) msg_print("²¿¤«¤È¤Æ¤âÇ®¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6664 if (fuzzy) msg_print("You are hit by something *HOT*!");
6667 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6669 if (!p_ptr->resist_sound)
6671 int k = (randint1((dam > 40) ? 35 : (dam * 3 / 4 + 5)));
6672 (void)set_stun(p_ptr->stun + k);
6675 if (!(p_ptr->resist_fire ||
6677 p_ptr->immune_fire))
6679 inven_damage(set_acid_destroy, 3);
6685 /* Nether -- drain experience */
6689 if (fuzzy) msg_print("ÃϹö¤ÎÎϤǹ¶·â¤µ¤ì¤¿¡ª");
6691 if (fuzzy) msg_print("You are hit by nether forces!");
6695 if (p_ptr->resist_neth)
6697 if (!prace_is_(RACE_SPECTRE))
6698 dam *= 6; dam /= (randint1(4) + 7);
6700 else drain_exp(200 + (p_ptr->exp / 100), 200 + (p_ptr->exp / 1000), 75);
6702 if (prace_is_(RACE_SPECTRE))
6705 msg_print("µ¤Ê¬¤¬¤è¤¯¤Ê¤Ã¤¿¡£");
6707 msg_print("You feel invigorated!");
6711 learn_spell(monspell);
6715 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6721 /* Water -- stun/confuse */
6725 if (fuzzy) msg_print("²¿¤«¼¾¤Ã¤¿¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6727 if (fuzzy) msg_print("You are hit by something wet!");
6730 if (!p_ptr->resist_sound)
6732 set_stun(p_ptr->stun + randint1(40));
6734 if (!p_ptr->resist_conf)
6736 set_confused(p_ptr->confused + randint1(5) + 5);
6741 inven_damage(set_cold_destroy, 3);
6744 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6748 /* Chaos -- many effects */
6752 if (fuzzy) msg_print("̵Ãá½ø¤ÎÇÈÆ°¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6754 if (fuzzy) msg_print("You are hit by a wave of anarchy!");
6757 if (p_ptr->resist_chaos)
6759 dam *= 6; dam /= (randint1(4) + 7);
6761 if (!p_ptr->resist_conf)
6763 (void)set_confused(p_ptr->confused + randint0(20) + 10);
6765 if (!p_ptr->resist_chaos)
6767 (void)set_image(p_ptr->image + randint1(10));
6771 msg_print("¤¢¤Ê¤¿¤Î¿ÈÂΤϥ«¥ª¥¹¤ÎÎϤÇDZ¤¸¶Ê¤²¤é¤ì¤¿¡ª");
6773 msg_print("Your body is twisted by chaos!");
6776 (void)gain_random_mutation(0);
6779 if (!p_ptr->resist_neth && !p_ptr->resist_chaos)
6781 drain_exp(5000 + (p_ptr->exp / 100), 500 + (p_ptr->exp / 1000), 75);
6783 if (!p_ptr->resist_chaos || one_in_(9))
6785 inven_damage(set_elec_destroy, 2);
6786 inven_damage(set_fire_destroy, 2);
6788 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6792 /* Shards -- mostly cutting */
6796 if (fuzzy) msg_print("²¿¤«±Ô¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6798 if (fuzzy) msg_print("You are hit by something sharp!");
6801 if (p_ptr->resist_shard)
6803 dam *= 6; dam /= (randint1(4) + 7);
6807 (void)set_cut(p_ptr->cut + dam);
6810 if (!p_ptr->resist_shard || one_in_(13))
6812 inven_damage(set_cold_destroy, 2);
6815 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6819 /* Sound -- mostly stunning */
6823 if (fuzzy) msg_print("¹ì²»¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6825 if (fuzzy) msg_print("You are hit by a loud noise!");
6828 if (p_ptr->resist_sound)
6830 dam *= 5; dam /= (randint1(4) + 7);
6834 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
6835 (void)set_stun(p_ptr->stun + k);
6838 if (!p_ptr->resist_sound || one_in_(13))
6840 inven_damage(set_cold_destroy, 2);
6843 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6847 /* Pure confusion */
6851 if (fuzzy) msg_print("²¿¤«º®Í𤹤ë¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6853 if (fuzzy) msg_print("You are hit by something puzzling!");
6856 if (p_ptr->resist_conf)
6858 dam *= 5; dam /= (randint1(4) + 7);
6860 if (!p_ptr->resist_conf)
6862 (void)set_confused(p_ptr->confused + randint1(20) + 10);
6864 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6868 /* Disenchantment -- see above */
6872 if (fuzzy) msg_print("²¿¤«¤µ¤¨¤Ê¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6874 if (fuzzy) msg_print("You are hit by something static!");
6877 if (p_ptr->resist_disen)
6879 dam *= 6; dam /= (randint1(4) + 7);
6883 (void)apply_disenchant(0);
6885 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6889 /* Nexus -- see above */
6893 if (fuzzy) msg_print("²¿¤«´ñ̯¤Ê¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6895 if (fuzzy) msg_print("You are hit by something strange!");
6898 if (p_ptr->resist_nexus)
6900 dam *= 6; dam /= (randint1(4) + 7);
6906 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6910 /* Force -- mostly stun */
6914 if (fuzzy) msg_print("±¿Æ°¥¨¥Í¥ë¥®¡¼¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6916 if (fuzzy) msg_print("You are hit by kinetic force!");
6919 if (!p_ptr->resist_sound)
6921 (void)set_stun(p_ptr->stun + randint1(20));
6923 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6928 /* Rocket -- stun, cut */
6932 if (fuzzy) msg_print("Çúȯ¤¬¤¢¤Ã¤¿¡ª");
6934 if (fuzzy) msg_print("There is an explosion!");
6937 if (!p_ptr->resist_sound)
6939 (void)set_stun(p_ptr->stun + randint1(20));
6941 if (p_ptr->resist_shard)
6947 (void)set_cut(p_ptr-> cut + ( dam / 2));
6950 if ((!p_ptr->resist_shard) || one_in_(12))
6952 inven_damage(set_cold_destroy, 3);
6955 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6959 /* Inertia -- slowness */
6963 if (fuzzy) msg_print("²¿¤«ÃÙ¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6965 if (fuzzy) msg_print("You are hit by something slow!");
6968 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
6969 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
6973 /* Lite -- blinding */
6977 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
6979 if (fuzzy) msg_print("You are hit by something!");
6982 if (p_ptr->resist_lite)
6984 dam *= 4; dam /= (randint1(4) + 7);
6986 else if (!blind && !p_ptr->resist_blind)
6988 (void)set_blind(p_ptr->blind + randint1(5) + 2);
6990 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
6993 msg_print("¸÷¤ÇÆùÂΤ¬¾Ç¤¬¤µ¤ì¤¿¡ª");
6995 msg_print("The light scorches your flesh!");
7000 else if (prace_is_(RACE_S_FAIRY))
7004 if (p_ptr->wraith_form) dam *= 2;
7005 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7007 if (p_ptr->wraith_form)
7009 p_ptr->wraith_form = 0;
7011 msg_print("Á®¸÷¤Î¤¿¤áÈóʪ¼ÁŪ¤Ê±Æ¤Î¸ºß¤Ç¤¤¤é¤ì¤Ê¤¯¤Ê¤Ã¤¿¡£");
7013 msg_print("The light forces you out of your incorporeal shadow form.");
7016 p_ptr->redraw |= PR_MAP;
7017 /* Update monsters */
7018 p_ptr->update |= (PU_MONSTERS);
7020 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
7022 /* Redraw status bar */
7023 p_ptr->redraw |= (PR_STATUS);
7030 /* Dark -- blinding */
7034 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7036 if (fuzzy) msg_print("You are hit by something!");
7039 if (p_ptr->resist_dark)
7041 dam *= 4; dam /= (randint1(4) + 7);
7043 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form) dam = 0;
7045 else if (!blind && !p_ptr->resist_blind)
7047 (void)set_blind(p_ptr->blind + randint1(5) + 2);
7049 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7053 /* Time -- bolt fewer effects XXX */
7057 if (fuzzy) msg_print("²áµî¤«¤é¤Î¾×·â¤Ë¹¶·â¤µ¤ì¤¿¡ª");
7059 if (fuzzy) msg_print("You are hit by a blast from the past!");
7062 if (p_ptr->resist_time)
7065 dam /= (randint1(4) + 7);
7067 msg_print("»þ´Ö¤¬Ä̤ê²á¤®¤Æ¤¤¤¯µ¤¤¬¤¹¤ë¡£");
7069 msg_print("You feel as if time is passing you by.");
7075 switch (randint1(10))
7077 case 1: case 2: case 3: case 4: case 5:
7079 if (p_ptr->prace == RACE_ANDROID) break;
7081 msg_print("¿ÍÀ¸¤¬µÕÌá¤ê¤·¤¿µ¤¤¬¤¹¤ë¡£");
7083 msg_print("You feel life has clocked back.");
7086 lose_exp(100 + (p_ptr->exp / 100) * MON_DRAIN_LIFE);
7090 case 6: case 7: case 8: case 9:
7092 switch (randint1(6))
7095 case 1: k = A_STR; act = "¶¯¤¯"; break;
7096 case 2: k = A_INT; act = "ÁïÌÀ¤Ç"; break;
7097 case 3: k = A_WIS; act = "¸ÌÀ¤Ç"; break;
7098 case 4: k = A_DEX; act = "´ïÍѤÇ"; break;
7099 case 5: k = A_CON; act = "·ò¹¯¤Ç"; break;
7100 case 6: k = A_CHR; act = "Èþ¤·¤¯"; break;
7102 case 1: k = A_STR; act = "strong"; break;
7103 case 2: k = A_INT; act = "bright"; break;
7104 case 3: k = A_WIS; act = "wise"; break;
7105 case 4: k = A_DEX; act = "agile"; break;
7106 case 5: k = A_CON; act = "hale"; break;
7107 case 6: k = A_CHR; act = "beautiful"; break;
7113 msg_format("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤É%s¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£", act);
7115 msg_format("You're not as %s as you used to be...", act);
7119 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 3) / 4;
7120 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
7121 p_ptr->update |= (PU_BONUS);
7128 msg_print("¤¢¤Ê¤¿¤Ï°ÊÁ°¤Û¤ÉÎ϶¯¤¯¤Ê¤¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤¿...¡£");
7130 msg_print("You're not as powerful as you used to be...");
7134 for (k = 0; k < 6; k++)
7136 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 7) / 8;
7137 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
7139 p_ptr->update |= (PU_BONUS);
7145 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7149 /* Gravity -- stun plus slowness plus teleport */
7153 if (fuzzy) msg_print("²¿¤«½Å¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7154 msg_print("¼þÊդνÅÎϤ¬¤æ¤¬¤ó¤À¡£");
7156 if (fuzzy) msg_print("You are hit by something heavy!");
7157 msg_print("Gravity warps around you.");
7160 teleport_player(5, TRUE);
7161 if (!p_ptr->levitation)
7162 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7163 if (!(p_ptr->resist_sound || p_ptr->levitation))
7165 int k = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
7166 (void)set_stun(p_ptr->stun + k);
7168 if (p_ptr->levitation)
7170 dam = (dam * 2) / 3;
7173 if (!p_ptr->levitation || one_in_(13))
7175 inven_damage(set_cold_destroy, 2);
7178 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7182 /* Standard damage */
7183 case GF_DISINTEGRATE:
7186 if (fuzzy) msg_print("½ã¿è¤Ê¥¨¥Í¥ë¥®¡¼¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7188 if (fuzzy) msg_print("You are hit by pure energy!");
7191 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7198 if (fuzzy) msg_print("²¿¤é¤«¤Î¹¶·â¤Ë¤è¤Ã¤Æµ¤Ê¬¤¬¤è¤¯¤Ê¤Ã¤¿¡£");
7200 if (fuzzy) msg_print("You are hit by something invigorating!");
7203 (void)hp_player(dam);
7211 if (fuzzy) msg_print("²¿¤«¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7213 if (fuzzy) msg_print("You are hit by something!");
7216 (void)set_fast(p_ptr->fast + randint1(5), FALSE);
7224 if (fuzzy) msg_print("²¿¤«ÃÙ¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7226 if (fuzzy) msg_print("You are hit by something slow!");
7229 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7235 if (p_ptr->free_act) break;
7237 if (fuzzy) msg_print("̲¤Ã¤Æ¤·¤Þ¤Ã¤¿¡ª");
7239 if (fuzzy) msg_print("You fall asleep!");
7243 if (ironman_nightmare)
7246 msg_print("¶²¤í¤·¤¤¸÷·Ê¤¬Æ¬¤ËÉ⤫¤ó¤Ç¤¤¿¡£");
7248 msg_print("A horrible vision enters your mind.");
7252 /* Pick a nightmare */
7253 get_mon_num_prep(get_nightmare, NULL);
7255 /* Have some nightmares */
7256 have_nightmare(get_mon_num(MAX_DEPTH));
7258 /* Remove the monster restriction */
7259 get_mon_num_prep(NULL, NULL);
7262 set_paralyzed(p_ptr->paralyzed + dam);
7273 if (fuzzy) msg_print("ËâË¡¤Î¥ª¡¼¥é¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7275 if (fuzzy) msg_print("You are hit by an aura of magic!");
7278 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7286 if (fuzzy) msg_print("¥¨¥Í¥ë¥®¡¼¤Î²ô¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7288 if (fuzzy) msg_print("You are hit by an energy!");
7291 get_damage = take_hit(DAMAGE_FORCE, dam, killer, monspell);
7299 if (fuzzy) msg_print("²¿¤«¤¬¶õ¤«¤é¤¢¤Ê¤¿¤ÎƬ¾å¤ËÍî¤Á¤Æ¤¤¿¡ª");
7301 if (fuzzy) msg_print("Something falls from the sky on you!");
7304 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7305 if (!p_ptr->resist_shard || one_in_(13))
7307 if (!p_ptr->immune_fire) inven_damage(set_fire_destroy, 2);
7308 inven_damage(set_cold_destroy, 2);
7314 /* Ice -- cold plus stun plus cuts */
7318 if (fuzzy) msg_print("²¿¤«±Ô¤¯Î䤿¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7320 if (fuzzy) msg_print("You are hit by something sharp and cold!");
7323 cold_dam(dam, killer, monspell);
7324 if (!p_ptr->resist_shard)
7326 (void)set_cut(p_ptr->cut + damroll(5, 8));
7328 if (!p_ptr->resist_sound)
7330 (void)set_stun(p_ptr->stun + randint1(15));
7333 if ((!(p_ptr->resist_cold || IS_OPPOSE_COLD())) || one_in_(12))
7335 if (!p_ptr->immune_cold) inven_damage(set_cold_destroy, 3);
7345 if (fuzzy) msg_print("²¿¤«Èó¾ï¤ËÎ䤿¤¤¤â¤Î¤Ç¹¶·â¤µ¤ì¤¿¡ª");
7347 if (fuzzy) msg_print("You are hit by something extremely cold!");
7351 if (p_ptr->mimic_form)
7353 if (!(mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
7354 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7359 switch (p_ptr->prace)
7361 /* Some races are immune */
7375 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7391 if (who > 0) msg_format("%^s¤ËÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¼è¤é¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
7392 else msg_print("Àº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¼è¤é¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª");
7394 if (who > 0) msg_format("%^s draws psychic energy from you!", m_name);
7395 else msg_print("Your psychic energy is drawn!");
7399 if (dam >= p_ptr->csp)
7403 p_ptr->csp_frac = 0;
7412 learn_spell(monspell);
7415 p_ptr->redraw |= (PR_MANA);
7418 p_ptr->window |= (PW_PLAYER);
7419 p_ptr->window |= (PW_SPELL);
7423 /* Heal the monster */
7424 if (m_ptr->hp < m_ptr->maxhp)
7427 m_ptr->hp += (6 * dam);
7428 if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
7430 /* Redraw (later) if needed */
7431 if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
7432 if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
7434 /* Special message */
7438 msg_format("%^s¤Ïµ¤Ê¬¤¬Îɤµ¤½¤¦¤À¡£", m_name);
7440 msg_format("%^s appears healthier.", m_name);
7454 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
7457 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7459 msg_print("You resist the effects!");
7461 learn_spell(monspell);
7466 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
7468 msg_print("Your mind is blasted by psyonic energy.");
7471 if (!p_ptr->resist_conf)
7473 (void)set_confused(p_ptr->confused + randint0(4) + 4);
7476 if (!p_ptr->resist_chaos && one_in_(3))
7478 (void)set_image(p_ptr->image + randint0(250) + 150);
7485 p_ptr->csp_frac = 0;
7487 p_ptr->redraw |= PR_MANA;
7489 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7495 case GF_BRAIN_SMASH:
7497 if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
7500 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7502 msg_print("You resist the effects!");
7504 learn_spell(monspell);
7509 msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
7511 msg_print("Your mind is blasted by psionic energy.");
7518 p_ptr->csp_frac = 0;
7520 p_ptr->redraw |= PR_MANA;
7522 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7523 if (!p_ptr->resist_blind)
7525 (void)set_blind(p_ptr->blind + 8 + randint0(8));
7527 if (!p_ptr->resist_conf)
7529 (void)set_confused(p_ptr->confused + randint0(4) + 4);
7531 if (!p_ptr->free_act)
7533 (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
7535 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
7537 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
7538 (void)do_dec_stat(A_INT);
7539 while (randint0(100 + rlev/2) > (MAX(5, p_ptr->skill_sav)))
7540 (void)do_dec_stat(A_WIS);
7542 if (!p_ptr->resist_chaos)
7544 (void)set_image(p_ptr->image + randint0(250) + 150);
7553 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7556 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7558 msg_print("You resist the effects!");
7560 learn_spell(monspell);
7564 curse_equipment(15, 0);
7565 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7573 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7576 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7578 msg_print("You resist the effects!");
7580 learn_spell(monspell);
7584 curse_equipment(25, MIN(rlev/2-15, 5));
7585 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7593 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7596 msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7598 msg_print("You resist the effects!");
7600 learn_spell(monspell);
7604 curse_equipment(33, MIN(rlev/2-15, 15));
7605 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7613 if ((randint0(100 + rlev/2) < p_ptr->skill_sav) && !(m_ptr->r_idx == MON_KENSHIROU))
7616 msg_print("¤·¤«¤·È빦¤òÄ·¤ÍÊÖ¤·¤¿¡ª");
7618 msg_print("You resist the effects!");
7620 learn_spell(monspell);
7624 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
7625 (void)set_cut(p_ptr->cut + damroll(10, 10));
7633 if (randint0(100 + rlev/2) < p_ptr->skill_sav)
7636 msg_format("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
7638 msg_format("You resist the effects!");
7640 learn_spell(monspell);
7645 msg_print("¤¢¤Ê¤¿¤ÏÌ¿¤¬Çö¤Þ¤Ã¤Æ¤¤¤¯¤è¤¦¤Ë´¶¤¸¤¿¡ª");
7647 msg_print("You feel your life fade away!");
7650 get_damage = take_hit(DAMAGE_ATTACK, dam, m_name, monspell);
7651 curse_equipment(40, 20);
7653 if (p_ptr->chp < 1) p_ptr->chp = 1;
7668 if (p_ptr->tim_eyeeye && get_damage > 0 && !p_ptr->is_dead)
7671 msg_format("¹¶·â¤¬%s¼«¿È¤ò½ý¤Ä¤±¤¿¡ª", m_name);
7673 char m_name_self[80];
7676 monster_desc(m_name_self, m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
7678 msg_format("The attack of %s has wounded %s!", m_name, m_name_self);
7680 project(0, 0, m_ptr->fy, m_ptr->fx, get_damage, GF_MISSILE, PROJECT_KILL, -1);
7681 set_tim_eyeeye(p_ptr->tim_eyeeye-5, TRUE);
7684 if (p_ptr->riding && dam > 0)
7686 rakubadam_p = (dam > 200) ? 200 : dam;
7694 if ((p_ptr->special_defense & NINJA_KAWARIMI) && dam && who && (who != p_ptr->riding))
7700 /* Return "Anything seen?" */
7706 * Find the distance from (x, y) to a line.
7708 int dist_to_line(int y, int x, int y1, int x1, int y2, int x2)
7710 /* Vector from (x, y) to (x1, y1) */
7719 int pd = distance(y1, x1, y, x);
7720 int nd = distance(y1, x1, y2, x2);
7722 if (pd > nd) return distance(y, x, y2, x2);
7724 /* Component of P on N */
7725 nd = ((nd) ? ((py * ny + px * nx) / nd) : 0);
7727 /* Absolute value */
7728 return((nd >= 0) ? nd : 0 - nd);
7735 * Modified version of los() for calculation of disintegration balls.
7736 * Disintegration effects are stopped by permanent walls.
7738 bool in_disintegration_range(int y1, int x1, int y2, int x2)
7758 /* Slope, or 1/Slope, of LOS */
7762 /* Extract the offset */
7766 /* Extract the absolute offset */
7771 /* Handle adjacent (or identical) grids */
7772 if ((ax < 2) && (ay < 2)) return (TRUE);
7775 /* Paranoia -- require "safe" origin */
7776 /* if (!in_bounds(y1, x1)) return (FALSE); */
7779 /* Directly South/North */
7782 /* South -- check for walls */
7785 for (ty = y1 + 1; ty < y2; ty++)
7787 if (cave_stop_disintegration(ty, x1)) return (FALSE);
7791 /* North -- check for walls */
7794 for (ty = y1 - 1; ty > y2; ty--)
7796 if (cave_stop_disintegration(ty, x1)) return (FALSE);
7804 /* Directly East/West */
7807 /* East -- check for walls */
7810 for (tx = x1 + 1; tx < x2; tx++)
7812 if (cave_stop_disintegration(y1, tx)) return (FALSE);
7816 /* West -- check for walls */
7819 for (tx = x1 - 1; tx > x2; tx--)
7821 if (cave_stop_disintegration(y1, tx)) return (FALSE);
7830 /* Extract some signs */
7831 sx = (dx < 0) ? -1 : 1;
7832 sy = (dy < 0) ? -1 : 1;
7835 /* Vertical "knights" */
7840 if (!cave_stop_disintegration(y1 + sy, x1)) return (TRUE);
7844 /* Horizontal "knights" */
7849 if (!cave_stop_disintegration(y1, x1 + sx)) return (TRUE);
7854 /* Calculate scale factor div 2 */
7857 /* Calculate scale factor */
7861 /* Travel horizontally */
7864 /* Let m = dy / dx * 2 * (dy * dx) = 2 * dy * dy */
7870 /* Consider the special case where slope == 1. */
7881 /* Note (below) the case (qy == f2), where */
7882 /* the LOS exactly meets the corner of a tile. */
7885 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7896 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7909 /* Travel vertically */
7912 /* Let m = dx / dy * 2 * (dx * dy) = 2 * dx * dx */
7928 /* Note (below) the case (qx == f2), where */
7929 /* the LOS exactly meets the corner of a tile. */
7932 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7943 if (cave_stop_disintegration(ty, tx)) return (FALSE);
7964 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)
7969 int brev = rad * rad / dist;
7973 int mdis = distance(y1, x1, y2, x2) + rad;
7975 while (bdis <= mdis)
7979 if ((0 < dist) && (path_n < dist))
7981 int ny = GRID_Y(path_g[path_n]);
7982 int nx = GRID_X(path_g[path_n]);
7983 int nd = distance(ny, nx, y1, x1);
7985 /* Get next base point */
7994 /* Travel from center outward */
7995 for (cdis = 0; cdis <= brad; cdis++)
7997 /* Scan the maximal blast area of radius "cdis" */
7998 for (y = by - cdis; y <= by + cdis; y++)
8000 for (x = bx - cdis; x <= bx + cdis; x++)
8002 /* Ignore "illegal" locations */
8003 if (!in_bounds(y, x)) continue;
8005 /* Enforce a circular "ripple" */
8006 if (distance(y1, x1, y, x) != bdis) continue;
8008 /* Enforce an arc */
8009 if (distance(by, bx, y, x) != cdis) continue;
8015 /* Lights are stopped by opaque terrains */
8016 if (!los(by, bx, y, x)) continue;
8018 case GF_DISINTEGRATE:
8019 /* Disintegration are stopped only by perma-walls */
8020 if (!in_disintegration_range(by, bx, y, x)) continue;
8023 /* Ball explosions are stopped by walls */
8024 if (!projectable(by, bx, y, x)) continue;
8028 /* Save this grid */
8036 /* Encode some more "radius" info */
8037 gm[bdis + 1] = *pgrids;
8039 /* Increase the size */
8040 brad = rad * (path_n + brev) / (dist + brev);
8042 /* Find the next ripple */
8046 /* Store the effect size */
8052 * Generic "beam"/"bolt"/"ball" projection routine.
8055 * who: Index of "source" monster (zero for "player")
8056 * rad: Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
8057 * y,x: Target location (or location to travel "towards")
8058 * dam: Base damage roll to apply to affected monsters (or player)
8059 * typ: Type of damage to apply to monsters (and objects)
8060 * flg: Extra bit flags (see PROJECT_xxxx in "defines.h")
8063 * TRUE if any "effects" of the projection were observed, else FALSE
8065 * Allows a monster (or player) to project a beam/bolt/ball of a given kind
8066 * towards a given location (optionally passing over the heads of interposing
8067 * monsters), and have it do a given amount of damage to the monsters (and
8068 * optionally objects) within the given radius of the final location.
8070 * A "bolt" travels from source to target and affects only the target grid.
8071 * A "beam" travels from source to target, affecting all grids passed through.
8072 * A "ball" travels from source to the target, exploding at the target, and
8073 * affecting everything within the given radius of the target location.
8075 * Traditionally, a "bolt" does not affect anything on the ground, and does
8076 * not pass over the heads of interposing monsters, much like a traditional
8077 * missile, and will "stop" abruptly at the "target" even if no monster is
8078 * positioned there, while a "ball", on the other hand, passes over the heads
8079 * of monsters between the source and target, and affects everything except
8080 * the source monster which lies within the final radius, while a "beam"
8081 * affects every monster between the source and target, except for the casting
8082 * monster (or player), and rarely affects things on the ground.
8084 * Two special flags allow us to use this function in special ways, the
8085 * "PROJECT_HIDE" flag allows us to perform "invisible" projections, while
8086 * the "PROJECT_JUMP" flag allows us to affect a specific grid, without
8087 * actually projecting from the source monster (or player).
8089 * The player will only get "experience" for monsters killed by himself
8090 * Unique monsters can only be destroyed by attacks from the player
8092 * Only 256 grids can be affected per projection, limiting the effective
8093 * "radius" of standard ball attacks to nine units (diameter nineteen).
8095 * One can project in a given "direction" by combining PROJECT_THRU with small
8096 * offsets to the initial location (see "line_spell()"), or by calculating
8097 * "virtual targets" far away from the player.
8099 * One can also use PROJECT_THRU to send a beam/bolt along an angled path,
8100 * continuing until it actually hits somethings (useful for "stone to mud").
8102 * Bolts and Beams explode INSIDE walls, so that they can destroy doors.
8104 * Balls must explode BEFORE hitting walls, or they would affect monsters
8105 * on both sides of a wall. Some bug reports indicate that this is still
8106 * happening in 2.7.8 for Windows, though it appears to be impossible.
8108 * We "pre-calculate" the blast area only in part for efficiency.
8109 * More importantly, this lets us do "explosions" from the "inside" out.
8110 * This results in a more logical distribution of "blast" treasure.
8111 * It also produces a better (in my opinion) animation of the explosion.
8112 * It could be (but is not) used to have the treasure dropped by monsters
8113 * in the middle of the explosion fall "outwards", and then be damaged by
8114 * the blast as it spreads outwards towards the treasure drop location.
8116 * Walls and doors are included in the blast area, so that they can be
8117 * "burned" or "melted" in later versions.
8119 * This algorithm is intended to maximize simplicity, not necessarily
8120 * efficiency, since this function is not a bottleneck in the code.
8122 * We apply the blast effect from ground zero outwards, in several passes,
8123 * first affecting features, then objects, then monsters, then the player.
8124 * This allows walls to be removed before checking the object or monster
8125 * in the wall, and protects objects which are dropped by monsters killed
8126 * in the blast, and allows the player to see all affects before he is
8127 * killed or teleported away. The semantics of this method are open to
8128 * various interpretations, but they seem to work well in practice.
8130 * We process the blast area from ground-zero outwards to allow for better
8131 * distribution of treasure dropped by monsters, and because it provides a
8132 * pleasing visual effect at low cost.
8134 * Note that the damage done by "ball" explosions decreases with distance.
8135 * This decrease is rapid, grids at radius "dist" take "1/dist" damage.
8137 * Notice the "napalm" effect of "beam" weapons. First they "project" to
8138 * the target, and then the damage "flows" along this beam of destruction.
8139 * The damage at every grid is the same as at the "center" of a "ball"
8140 * explosion, since the "beam" grids are treated as if they ARE at the
8141 * center of a "ball" explosion.
8143 * Currently, specifying "beam" plus "ball" means that locations which are
8144 * covered by the initial "beam", and also covered by the final "ball", except
8145 * for the final grid (the epicenter of the ball), will be "hit twice", once
8146 * by the initial beam, and once by the exploding ball. For the grid right
8147 * next to the epicenter, this results in 150% damage being done. The center
8148 * does not have this problem, for the same reason the final grid in a "beam"
8149 * plus "bolt" does not -- it is explicitly removed. Simply removing "beam"
8150 * grids which are covered by the "ball" will NOT work, as then they will
8151 * receive LESS damage than they should. Do not combine "beam" with "ball".
8153 * The array "gy[],gx[]" with current size "grids" is used to hold the
8154 * collected locations of all grids in the "blast area" plus "beam path".
8156 * Note the rather complex usage of the "gm[]" array. First, gm[0] is always
8157 * zero. Second, for N>1, gm[N] is always the index (in gy[],gx[]) of the
8158 * first blast grid (see above) with radius "N" from the blast center. Note
8159 * that only the first gm[1] grids in the blast area thus take full damage.
8160 * Also, note that gm[rad+1] is always equal to "grids", which is the total
8161 * number of blast grids.
8163 * Note that once the projection is complete, (y2,x2) holds the final location
8164 * of bolts/beams, and the "epicenter" of balls.
8166 * Note also that "rad" specifies the "inclusive" radius of projection blast,
8167 * so that a "rad" of "one" actually covers 5 or 9 grids, depending on the
8168 * implementation of the "distance" function. Also, a bolt can be properly
8169 * viewed as a "ball" with a "rad" of "zero".
8171 * Note that if no "target" is reached before the beam/bolt/ball travels the
8172 * maximum distance allowed (MAX_RANGE), no "blast" will be induced. This
8173 * may be relevant even for bolts, since they have a "1x1" mini-blast.
8175 * Note that for consistency, we "pretend" that the bolt actually takes "time"
8176 * to move from point A to point B, even if the player cannot see part of the
8177 * projection path. Note that in general, the player will *always* see part
8178 * of the path, since it either starts at the player or ends on the player.
8180 * Hack -- we assume that every "projection" is "self-illuminating".
8182 * Hack -- when only a single monster is affected, we automatically track
8183 * (and recall) that monster, unless "PROJECT_JUMP" is used.
8185 * Note that all projections now "explode" at their final destination, even
8186 * if they were being projected at a more distant destination. This means
8187 * that "ball" spells will *always* explode.
8189 * Note that we must call "handle_stuff()" after affecting terrain features
8190 * in the blast radius, in case the "illumination" of the grid was changed,
8191 * and "update_view()" and "update_monsters()" need to be called.
8193 bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int monspell)
8203 int y_saver, x_saver; /* For reflecting monsters */
8205 int msec = delay_factor * delay_factor * delay_factor;
8207 /* Assume the player sees nothing */
8208 bool notice = FALSE;
8210 /* Assume the player has seen nothing */
8211 bool visual = FALSE;
8213 /* Assume the player has seen no blast grids */
8216 /* Assume to be a normal ball spell */
8217 bool breath = FALSE;
8219 /* Is the player blind? */
8220 bool blind = (p_ptr->blind ? TRUE : FALSE);
8222 bool old_hide = FALSE;
8224 /* Number of grids in the "path" */
8227 /* Actual grids in the "path" */
8230 /* Number of grids in the "blast area" (including the "beam" path) */
8233 /* Coordinates of the affected grids */
8234 byte gx[1024], gy[1024];
8236 /* Encoded "radius" info (see above) */
8239 /* Actual radius encoded in gm[] */
8244 /* Attacker's name (prepared before polymorph)*/
8247 /* Initialize by null string */
8253 /* Default target of monsterspell is player */
8254 monster_target_y=py;
8255 monster_target_x=px;
8257 /* Hack -- Jump to target */
8258 if (flg & (PROJECT_JUMP))
8263 /* Clear the flag */
8264 flg &= ~(PROJECT_JUMP);
8269 /* Start at player */
8276 /* Start at monster */
8279 x1 = m_list[who].fx;
8280 y1 = m_list[who].fy;
8281 monster_desc(who_name, &m_list[who], MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
8294 /* Default "destination" */
8299 /* Hack -- verify stuff */
8300 if (flg & (PROJECT_THRU))
8302 if ((x1 == x2) && (y1 == y2))
8304 flg &= ~(PROJECT_THRU);
8308 /* Handle a breath attack */
8313 if (flg & PROJECT_HIDE) old_hide = TRUE;
8314 flg |= PROJECT_HIDE;
8318 /* Hack -- Assume there will be no blast (max radius 32) */
8319 for (dist = 0; dist < 32; dist++) gm[dist] = 0;
8327 /* Collect beam grids */
8328 if (flg & (PROJECT_BEAM))
8339 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_LOS);
8341 case GF_DISINTEGRATE:
8342 flg |= (PROJECT_GRID);
8343 if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_DISI);
8347 /* Calculate the projection path */
8349 path_n = project_path(path_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, flg);
8351 /* Hack -- Handle stuff */
8354 /* Giga-Hack SEEKER & SUPER_RAY */
8356 if( typ == GF_SEEKER )
8366 for (i = 0; i < path_n; ++i)
8371 int ny = GRID_Y(path_g[i]);
8372 int nx = GRID_X(path_g[i]);
8383 /* Only do visuals if requested */
8384 if (!blind && !(flg & (PROJECT_HIDE)))
8386 /* Only do visuals if the player can "see" the bolt */
8387 if (panel_contains(y, x) && player_has_los_bold(y, x))
8394 /* Obtain the bolt pict */
8395 p = bolt_pict(oy, ox, y, x, typ);
8397 /* Extract attr/char */
8401 /* Visual effects */
8402 print_rel(c, a, y, x);
8403 move_cursor_relative(y, x);
8404 /*if (fresh_before)*/ Term_fresh();
8405 Term_xtra(TERM_XTRA_DELAY, msec);
8407 /*if (fresh_before)*/ Term_fresh();
8409 /* Display "beam" grids */
8410 if (flg & (PROJECT_BEAM))
8412 /* Obtain the explosion pict */
8413 p = bolt_pict(y, x, y, x, typ);
8415 /* Extract attr/char */
8419 /* Visual effects */
8420 print_rel(c, a, y, x);
8423 /* Hack -- Activate delay */
8427 /* Hack -- delay anyway for consistency */
8430 /* Delay for consistency */
8431 Term_xtra(TERM_XTRA_DELAY, msec);
8434 if(project_o(0,0,y,x,dam,GF_SEEKER))notice=TRUE;
8435 if( is_mirror_grid(&cave[y][x]))
8437 /* The target of monsterspell becomes tha mirror(broken) */
8438 monster_target_y=(s16b)y;
8439 monster_target_x=(s16b)x;
8442 next_mirror( &oy,&ox,y,x );
8444 path_n = i+project_path(&(path_g[i+1]), (project_length ? project_length : MAX_RANGE), y, x, oy, ox, flg);
8445 for( j = last_i; j <=i ; j++ )
8447 y = GRID_Y(path_g[j]);
8448 x = GRID_X(path_g[j]);
8449 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))notice=TRUE;
8450 if(!who && (project_m_n==1) && !jump ){
8451 if(cave[project_m_y][project_m_x].m_idx >0 ){
8452 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8454 /* Hack -- auto-recall */
8455 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8457 /* Hack - auto-track */
8458 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8461 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8466 for( i = last_i ; i < path_n ; i++ )
8469 y = GRID_Y(path_g[i]);
8470 x = GRID_X(path_g[i]);
8471 if(project_m(0,0,y,x,dam,GF_SEEKER,flg))
8473 if(!who && (project_m_n==1) && !jump ){
8474 if(cave[project_m_y][project_m_x].m_idx >0 ){
8475 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8477 /* Hack -- auto-recall */
8478 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8480 /* Hack - auto-track */
8481 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8484 (void)project_f(0,0,y,x,dam,GF_SEEKER);
8488 else if(typ == GF_SUPER_RAY){
8490 int second_step = 0;
8497 for (i = 0; i < path_n; ++i)
8502 int ny = GRID_Y(path_g[i]);
8503 int nx = GRID_X(path_g[i]);
8514 /* Only do visuals if requested */
8515 if (!blind && !(flg & (PROJECT_HIDE)))
8517 /* Only do visuals if the player can "see" the bolt */
8518 if (panel_contains(y, x) && player_has_los_bold(y, x))
8525 /* Obtain the bolt pict */
8526 p = bolt_pict(oy, ox, y, x, typ);
8528 /* Extract attr/char */
8532 /* Visual effects */
8533 print_rel(c, a, y, x);
8534 move_cursor_relative(y, x);
8535 /*if (fresh_before)*/ Term_fresh();
8536 Term_xtra(TERM_XTRA_DELAY, msec);
8538 /*if (fresh_before)*/ Term_fresh();
8540 /* Display "beam" grids */
8541 if (flg & (PROJECT_BEAM))
8543 /* Obtain the explosion pict */
8544 p = bolt_pict(y, x, y, x, typ);
8546 /* Extract attr/char */
8550 /* Visual effects */
8551 print_rel(c, a, y, x);
8554 /* Hack -- Activate delay */
8558 /* Hack -- delay anyway for consistency */
8561 /* Delay for consistency */
8562 Term_xtra(TERM_XTRA_DELAY, msec);
8565 if(project_o(0,0,y,x,dam,GF_SUPER_RAY) )notice=TRUE;
8566 if (!cave_have_flag_bold(y, x, FF_PROJECT))
8568 if( second_step )continue;
8571 if( is_mirror_grid(&cave[y][x]) && !second_step )
8573 /* The target of monsterspell becomes tha mirror(broken) */
8574 monster_target_y=(s16b)y;
8575 monster_target_x=(s16b)x;
8578 for( j = 0; j <=i ; j++ )
8580 y = GRID_Y(path_g[j]);
8581 x = GRID_X(path_g[j]);
8582 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8586 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x-1, flg);
8587 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x , flg);
8588 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y-1, x+1, flg);
8589 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x-1, flg);
8590 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y , x+1, flg);
8591 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x-1, flg);
8592 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x , flg);
8593 path_n += project_path(&(path_g[path_n+1]), (project_length ? project_length : MAX_RANGE), y, x, y+1, x+1, flg);
8596 for( i = 0; i < path_n ; i++ )
8599 y = GRID_Y(path_g[i]);
8600 x = GRID_X(path_g[i]);
8601 (void)project_m(0,0,y,x,dam,GF_SUPER_RAY,flg);
8602 if(!who && (project_m_n==1) && !jump ){
8603 if(cave[project_m_y][project_m_x].m_idx >0 ){
8604 monster_type *m_ptr = &m_list[cave[project_m_y][project_m_x].m_idx];
8606 /* Hack -- auto-recall */
8607 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
8609 /* Hack - auto-track */
8610 if (m_ptr->ml) health_track(cave[project_m_y][project_m_x].m_idx);
8613 (void)project_f(0,0,y,x,dam,GF_SUPER_RAY);
8618 /* Project along the path */
8619 for (i = 0; i < path_n; ++i)
8624 int ny = GRID_Y(path_g[i]);
8625 int nx = GRID_X(path_g[i]);
8627 if (flg & PROJECT_DISI)
8629 /* Hack -- Balls explode before reaching walls */
8630 if (cave_stop_disintegration(ny, nx) && (rad > 0)) break;
8632 else if (flg & PROJECT_LOS)
8634 /* Hack -- Balls explode before reaching walls */
8635 if (!cave_los_bold(ny, nx) && (rad > 0)) break;
8639 /* Hack -- Balls explode before reaching walls */
8640 if (!cave_have_flag_bold(ny, nx, FF_PROJECT) && (rad > 0)) break;
8647 /* Collect beam grids */
8648 if (flg & (PROJECT_BEAM))
8655 /* Only do visuals if requested */
8656 if (!blind && !(flg & (PROJECT_HIDE | PROJECT_FAST)))
8658 /* Only do visuals if the player can "see" the bolt */
8659 if (panel_contains(y, x) && player_has_los_bold(y, x))
8666 /* Obtain the bolt pict */
8667 p = bolt_pict(oy, ox, y, x, typ);
8669 /* Extract attr/char */
8673 /* Visual effects */
8674 print_rel(c, a, y, x);
8675 move_cursor_relative(y, x);
8676 /*if (fresh_before)*/ Term_fresh();
8677 Term_xtra(TERM_XTRA_DELAY, msec);
8679 /*if (fresh_before)*/ Term_fresh();
8681 /* Display "beam" grids */
8682 if (flg & (PROJECT_BEAM))
8684 /* Obtain the explosion pict */
8685 p = bolt_pict(y, x, y, x, typ);
8687 /* Extract attr/char */
8691 /* Visual effects */
8692 print_rel(c, a, y, x);
8695 /* Hack -- Activate delay */
8699 /* Hack -- delay anyway for consistency */
8702 /* Delay for consistency */
8703 Term_xtra(TERM_XTRA_DELAY, msec);
8710 /* Save the "blast epicenter" */
8714 if (breath && !path_n)
8720 flg &= ~(PROJECT_HIDE);
8724 /* Start the "explosion" */
8727 /* Hack -- make sure beams get to "explode" */
8735 /* If we found a "target", explode there */
8736 if (dist <= MAX_RANGE)
8738 /* Mega-Hack -- remove the final "beam" grid */
8739 if ((flg & (PROJECT_BEAM)) && (grids > 0)) grids--;
8742 * Create a conical breath attack
8753 flg &= ~(PROJECT_HIDE);
8755 breath_shape(path_g, dist, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, by, bx, typ);
8759 /* Determine the blast area, work from the inside out */
8760 for (dist = 0; dist <= rad; dist++)
8762 /* Scan the maximal blast area of radius "dist" */
8763 for (y = by - dist; y <= by + dist; y++)
8765 for (x = bx - dist; x <= bx + dist; x++)
8767 /* Ignore "illegal" locations */
8768 if (!in_bounds2(y, x)) continue;
8770 /* Enforce a "circular" explosion */
8771 if (distance(by, bx, y, x) != dist) continue;
8777 /* Lights are stopped by opaque terrains */
8778 if (!los(by, bx, y, x)) continue;
8780 case GF_DISINTEGRATE:
8781 /* Disintegration are stopped only by perma-walls */
8782 if (!in_disintegration_range(by, bx, y, x)) continue;
8785 /* Ball explosions are stopped by walls */
8786 if (!projectable(by, bx, y, x)) continue;
8790 /* Save this grid */
8797 /* Encode some more "radius" info */
8803 /* Speed -- ignore "non-explosions" */
8804 if (!grids) return (FALSE);
8807 /* Display the "blast area" if requested */
8808 if (!blind && !(flg & (PROJECT_HIDE)))
8810 /* Then do the "blast", from inside out */
8811 for (t = 0; t <= gm_rad; t++)
8813 /* Dump everything with this radius */
8814 for (i = gm[t]; i < gm[t+1]; i++)
8816 /* Extract the location */
8820 /* Only do visuals if the player can "see" the blast */
8821 if (panel_contains(y, x) && player_has_los_bold(y, x))
8830 /* Obtain the explosion pict */
8831 p = bolt_pict(y, x, y, x, typ);
8833 /* Extract attr/char */
8837 /* Visual effects -- Display */
8838 print_rel(c, a, y, x);
8842 /* Hack -- center the cursor */
8843 move_cursor_relative(by, bx);
8845 /* Flush each "radius" seperately */
8846 /*if (fresh_before)*/ Term_fresh();
8848 /* Delay (efficiently) */
8849 if (visual || drawn)
8851 Term_xtra(TERM_XTRA_DELAY, msec);
8855 /* Flush the erasing */
8858 /* Erase the explosion drawn above */
8859 for (i = 0; i < grids; i++)
8861 /* Extract the location */
8865 /* Hack -- Erase if needed */
8866 if (panel_contains(y, x) && player_has_los_bold(y, x))
8872 /* Hack -- center the cursor */
8873 move_cursor_relative(by, bx);
8875 /* Flush the explosion */
8876 /*if (fresh_before)*/ Term_fresh();
8881 /* Update stuff if needed */
8882 if (p_ptr->update) update_stuff();
8885 /* Check features */
8886 if (flg & (PROJECT_GRID))
8888 /* Start with "dist" of zero */
8891 /* Scan for features */
8892 for (i = 0; i < grids; i++)
8894 /* Hack -- Notice new "dist" values */
8895 if (gm[dist+1] == i) dist++;
8897 /* Get the grid location */
8901 /* Find the closest point in the blast */
8904 int d = dist_to_line(y, x, y1, x1, by, bx);
8906 /* Affect the grid */
8907 if (project_f(who, d, y, x, dam, typ)) notice = TRUE;
8911 /* Affect the grid */
8912 if (project_f(who, dist, y, x, dam, typ)) notice = TRUE;
8917 /* Update stuff if needed */
8918 if (p_ptr->update) update_stuff();
8921 if (flg & (PROJECT_ITEM))
8923 /* Start with "dist" of zero */
8926 /* Scan for objects */
8927 for (i = 0; i < grids; i++)
8929 /* Hack -- Notice new "dist" values */
8930 if (gm[dist+1] == i) dist++;
8932 /* Get the grid location */
8936 /* Find the closest point in the blast */
8939 int d = dist_to_line(y, x, y1, x1, by, bx);
8941 /* Affect the object in the grid */
8942 if (project_o(who, d, y, x, dam, typ)) notice = TRUE;
8946 /* Affect the object in the grid */
8947 if (project_o(who, dist, y, x, dam, typ)) notice = TRUE;
8953 /* Check monsters */
8954 if (flg & (PROJECT_KILL))
8961 /* Start with "dist" of zero */
8964 /* Scan for monsters */
8965 for (i = 0; i < grids; i++)
8969 /* Hack -- Notice new "dist" values */
8970 if (gm[dist + 1] == i) dist++;
8972 /* Get the grid location */
8976 /* A single bolt may be reflected */
8979 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
8980 monster_race *ref_ptr = &r_info[m_ptr->r_idx];
8982 if ((ref_ptr->flags2 & RF2_REFLECTING) && (flg & PROJECT_REFLECTABLE) && (!who || dist_hack > 1) && !one_in_(10))
8985 int max_attempts = 10;
8987 /* Choose 'new' target */
8990 t_y = y_saver - 1 + randint1(3);
8991 t_x = x_saver - 1 + randint1(3);
8994 while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(y, x, t_y, t_x));
8996 if (max_attempts < 1)
9005 if ((m_ptr->r_idx == MON_KENSHIROU) || (m_ptr->r_idx == MON_RAOU))
9006 msg_print("¡ÖËÌÅÍ¿À·ý±üµÁ¡¦Æó»Ø¿¿¶õÇÄ¡ª¡×");
9007 else if (m_ptr->r_idx == MON_DIO) msg_print("¥Ç¥£¥ª¡¦¥Ö¥é¥ó¥É¡¼¤Ï»Ø°ìËܤǹ¶·â¤òÃƤÊÖ¤·¤¿¡ª");
9008 else msg_print("¹¶·â¤ÏÄ·¤ÍÊ֤ä¿¡ª");
9010 msg_print("The attack bounces!");
9013 if (is_original_ap_and_seen(m_ptr)) ref_ptr->r_flags2 |= RF2_REFLECTING;
9015 /* Reflected bolts randomly target either one */
9016 if (one_in_(2)) flg |= PROJECT_PLAYER;
9017 else flg &= ~(PROJECT_PLAYER);
9019 /* The bolt is reflected */
9020 project(cave[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
9022 /* Don't affect the monster any longer */
9028 /* Find the closest point in the blast */
9031 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
9035 effective_dist = dist;
9039 /* There is the riding player on this monster */
9040 if (p_ptr->riding && player_bold(y, x))
9042 /* Aimed on the player */
9043 if (flg & PROJECT_PLAYER)
9045 if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
9048 * A beam or bolt is well aimed
9050 * So don't affects the mount.
9057 * The spell is not well aimed,
9058 * So partly affect the mount too.
9065 * This grid is the original target.
9066 * Or aimed on your horse.
9068 else if (((y == y2) && (x == x2)) || (flg & PROJECT_AIMED))
9070 /* Hit the mount with full damage */
9074 * Otherwise this grid is not the
9075 * original target, it means that line
9076 * of fire is obstructed by this
9080 * A beam or bolt will hit either
9081 * player or mount. Choose randomly.
9083 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE))
9087 /* Hit the mount with full damage */
9091 /* Hit the player later */
9092 flg |= PROJECT_PLAYER;
9094 /* Don't affect the mount */
9100 * The spell is not well aimed, so
9101 * partly affect both player and
9110 /* Affect the monster in the grid */
9111 if (project_m(who, effective_dist, y, x, dam, typ,flg)) notice = TRUE;
9115 /* Player affected one monster (without "jumping") */
9116 if (!who && (project_m_n == 1) && !jump)
9122 /* Track if possible */
9123 if (cave[y][x].m_idx > 0)
9125 monster_type *m_ptr = &m_list[cave[y][x].m_idx];
9127 /* Hack -- auto-recall */
9128 if (m_ptr->ml) monster_race_track(m_ptr->ap_r_idx);
9130 /* Hack - auto-track */
9131 if (m_ptr->ml) health_track(cave[y][x].m_idx);
9138 if (flg & (PROJECT_KILL))
9140 /* Start with "dist" of zero */
9143 /* Scan for player */
9144 for (i = 0; i < grids; i++)
9148 /* Hack -- Notice new "dist" values */
9149 if (gm[dist+1] == i) dist++;
9151 /* Get the grid location */
9155 /* Affect the player? */
9156 if (!player_bold(y, x)) continue;
9158 /* Find the closest point in the blast */
9161 effective_dist = dist_to_line(y, x, y1, x1, by, bx);
9165 effective_dist = dist;
9168 /* Target may be your horse */
9171 /* Aimed on the player */
9172 if (flg & PROJECT_PLAYER)
9174 /* Hit the player with full damage */
9178 * Hack -- When this grid was not the
9179 * original target, a beam or bolt
9180 * would hit either player or mount,
9181 * and should be choosen randomly.
9183 * But already choosen to hit the
9184 * mount at this point.
9186 * Or aimed on your horse.
9188 else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
9191 * A beam or bolt is well aimed
9193 * So don't affects the player.
9200 * The spell is not well aimed,
9201 * So partly affect the player too.
9207 /* Affect the player */
9208 if (project_p(who, who_name, effective_dist, y, x, dam, typ, flg, monspell)) notice = TRUE;
9216 monster_desc(m_name, &m_list[p_ptr->riding], 0);
9218 if (rakubadam_m > 0)
9220 if (rakuba(rakubadam_m, FALSE))
9223 msg_format("%^s¤Ë¿¶¤êÍî¤È¤µ¤ì¤¿¡ª", m_name);
9225 msg_format("%^s has thrown you off!", m_name);
9229 if (p_ptr->riding && rakubadam_p > 0)
9231 if(rakuba(rakubadam_p, FALSE))
9234 msg_format("%^s¤«¤éÍî¤Á¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
9236 msg_format("You have fallen from %s.", m_name);
9242 /* Return "something was noticed" */
9246 bool binding_field( int dam )
9248 int mirror_x[10],mirror_y[10]; /* ¶À¤Ï¤â¤Ã¤È¾¯¤Ê¤¤ */
9249 int mirror_num=0; /* ¶À¤Î¿ô */
9254 int msec= delay_factor*delay_factor*delay_factor;
9260 /* Default target of monsterspell is player */
9261 monster_target_y=py;
9262 monster_target_x=px;
9264 for( x=0 ; x < cur_wid ; x++ )
9266 for( y=0 ; y < cur_hgt ; y++ )
9268 if( is_mirror_grid(&cave[y][x]) &&
9269 distance(py,px,y,x) <= MAX_RANGE &&
9270 distance(py,px,y,x) != 0 &&
9271 player_has_los_bold(y,x) &&
9272 projectable(py, px, y, x)
9274 mirror_y[mirror_num]=y;
9275 mirror_x[mirror_num]=x;
9281 if( mirror_num < 2 )return FALSE;
9283 point_x[0] = randint0( mirror_num );
9285 point_x[1] = randint0( mirror_num );
9287 while( point_x[0] == point_x[1] );
9289 point_y[0]=mirror_y[point_x[0]];
9290 point_x[0]=mirror_x[point_x[0]];
9291 point_y[1]=mirror_y[point_x[1]];
9292 point_x[1]=mirror_x[point_x[1]];
9296 x=point_x[0]+point_x[1]+point_x[2];
9297 y=point_y[0]+point_y[1]+point_y[2];
9299 centersign = (point_x[0]*3-x)*(point_y[1]*3-y)
9300 - (point_y[0]*3-y)*(point_x[1]*3-x);
9301 if( centersign == 0 )return FALSE;
9303 x1 = point_x[0] < point_x[1] ? point_x[0] : point_x[1];
9304 x1 = x1 < point_x[2] ? x1 : point_x[2];
9305 y1 = point_y[0] < point_y[1] ? point_y[0] : point_y[1];
9306 y1 = y1 < point_y[2] ? y1 : point_y[2];
9308 x2 = point_x[0] > point_x[1] ? point_x[0] : point_x[1];
9309 x2 = x2 > point_x[2] ? x2 : point_x[2];
9310 y2 = point_y[0] > point_y[1] ? point_y[0] : point_y[1];
9311 y2 = y2 > point_y[2] ? y2 : point_y[2];
9313 for( y=y1 ; y <=y2 ; y++ ){
9314 for( x=x1 ; x <=x2 ; x++ ){
9315 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9316 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9317 centersign*( (point_x[1]-x)*(point_y[2]-y)
9318 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9319 centersign*( (point_x[2]-x)*(point_y[0]-y)
9320 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9322 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9323 /* Visual effects */
9325 && panel_contains(y,x)){
9326 p = bolt_pict(y,x,y,x, GF_MANA );
9327 print_rel(PICT_C(p), PICT_A(p),y,x);
9328 move_cursor_relative(y, x);
9329 /*if (fresh_before)*/ Term_fresh();
9330 Term_xtra(TERM_XTRA_DELAY, msec);
9336 for( y=y1 ; y <=y2 ; y++ ){
9337 for( x=x1 ; x <=x2 ; x++ ){
9338 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9339 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9340 centersign*( (point_x[1]-x)*(point_y[2]-y)
9341 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9342 centersign*( (point_x[2]-x)*(point_y[0]-y)
9343 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9345 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9346 (void)project_f(0,0,y,x,dam,GF_MANA);
9351 for( y=y1 ; y <=y2 ; y++ ){
9352 for( x=x1 ; x <=x2 ; x++ ){
9353 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9354 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9355 centersign*( (point_x[1]-x)*(point_y[2]-y)
9356 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9357 centersign*( (point_x[2]-x)*(point_y[0]-y)
9358 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9360 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9361 (void)project_o(0,0,y,x,dam,GF_MANA);
9366 for( y=y1 ; y <=y2 ; y++ ){
9367 for( x=x1 ; x <=x2 ; x++ ){
9368 if( centersign*( (point_x[0]-x)*(point_y[1]-y)
9369 -(point_y[0]-y)*(point_x[1]-x)) >=0 &&
9370 centersign*( (point_x[1]-x)*(point_y[2]-y)
9371 -(point_y[1]-y)*(point_x[2]-x)) >=0 &&
9372 centersign*( (point_x[2]-x)*(point_y[0]-y)
9373 -(point_y[2]-y)*(point_x[0]-x)) >=0 )
9375 if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
9376 (void)project_m(0,0,y,x,dam,GF_MANA,
9377 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP));
9384 msg_print("¶À¤¬·ë³¦¤ËÂѤ¨¤¤ì¤º¡¢²õ¤ì¤Æ¤·¤Þ¤Ã¤¿¡£");
9386 msg_print("The field broke a mirror");
9388 remove_mirror(point_y[0],point_x[0]);
9394 void seal_of_mirror( int dam )
9398 for( x = 0 ; x < cur_wid ; x++ )
9400 for( y = 0 ; y < cur_hgt ; y++ )
9402 if( is_mirror_grid(&cave[y][x]))
9404 if(project_m(0,0,y,x,dam,GF_GENOCIDE,
9405 (PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP)))
9407 if( !cave[y][x].m_idx )