#define HURT_CHANCE 16
-/*
- * Does the grid stop disintegration?
- */
-#define cave_stop_disintegration(Y,X) \
- (((cave[Y][X].feat >= FEAT_PERM_EXTRA) && \
- (cave[Y][X].feat <= FEAT_PERM_SOLID)) || \
- (cave[Y][X].feat == FEAT_MOUNTAIN) || \
- ((cave[Y][X].feat >= FEAT_SHOP_HEAD) && \
- (cave[Y][X].feat <= FEAT_SHOP_TAIL)) || \
- ((cave[Y][X].feat >= FEAT_BLDG_HEAD) && \
- (cave[Y][X].feat <= FEAT_BLDG_TAIL)) || \
- (cave[Y][X].feat == FEAT_MUSEUM))
-
static int rakubadam_m;
static int rakubadam_p;
c = s[randint0(strlen(s))];
/* Lookup this color */
- a = strchr(color_char, c) - color_char;
+ a = my_strchr(color_char, c) - color_char;
/* Invalid color (note check for < 0 removed, gave a silly
* warning because bytes are always >= 0 -- RG) */
{
if ((n > 0) && cave_stop_disintegration(y, x)) break;
}
+ else if (flg & (PROJECT_LOS))
+ {
+ if ((n > 0) && !cave_los_bold(y, x)) break;
+ }
else if (!(flg & (PROJECT_PATH)))
{
/* Always stop at non-initial wall grids */
- if ((n > 0) && !cave_floor_bold(y, x)) break;
+ if ((n > 0) && !have_flag(f_flags_bold(y, x), FF_PROJECT)) break;
}
/* Sometimes stop at non-initial monsters/players */
{
if ((n > 0) && cave_stop_disintegration(y, x)) break;
}
+ else if (flg & (PROJECT_LOS))
+ {
+ if ((n > 0) && !cave_los_bold(y, x)) break;
+ }
else if (!(flg & (PROJECT_PATH)))
{
/* Always stop at non-initial wall grids */
- if ((n > 0) && !cave_floor_bold(y, x)) break;
+ if ((n > 0) && !have_flag(f_flags_bold(y, x), FF_PROJECT)) break;
}
/* Sometimes stop at non-initial monsters/players */
{
if ((n > 0) && cave_stop_disintegration(y, x)) break;
}
+ else if (flg & (PROJECT_LOS))
+ {
+ if ((n > 0) && !cave_los_bold(y, x)) break;
+ }
else if (!(flg & (PROJECT_PATH)))
{
/* Always stop at non-initial wall grids */
- if ((n > 0) && !cave_floor_bold(y, x)) break;
+ if ((n > 0) && !have_flag(f_flags_bold(y, x), FF_PROJECT)) break;
}
/* Sometimes stop at non-initial monsters/players */
static bool project_f(int who, int r, int y, int x, int dam, int typ)
{
cave_type *c_ptr = &cave[y][x];
+ feature_type *f_ptr = &f_info[c_ptr->feat];
bool obvious = FALSE;
bool known = player_has_los_bold(y, x);
dam = (dam + r) / (r + 1);
- if (c_ptr->feat == FEAT_TREES)
+ if (have_flag(f_ptr->flags, FF_TREE))
{
cptr message;
switch (typ)
case GF_FORCE:
case GF_HOLY_FIRE:
case GF_HELL_FIRE:
- case GF_DISINTEGRATE:
case GF_PSI:
case GF_PSI_DRAIN:
case GF_TELEKINESIS:
if (known)
{
#ifdef JP
-msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
+ msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
#else
msg_print("There is a bright flash of light!");
#endif
obvious = TRUE;
}
- /* Forget the trap */
- c_ptr->info &= ~(CAVE_MARK);
-
/* Destroy the trap */
- cave_set_feat(y, x, floor_type[randint0(100)]);
+ cave_alter_feat(y, x, FF_DISARM);
}
/* Locked doors are unlocked */
- else if ((c_ptr->feat >= FEAT_DOOR_HEAD + 0x01) &&
- (c_ptr->feat <= FEAT_DOOR_HEAD + 0x07))
+ if (is_closed_door(c_ptr->feat) && f_ptr->power && have_flag(f_ptr->flags, FF_OPEN))
{
+ s16b old_feat = c_ptr->feat;
+
/* Unlock the door */
- cave_set_feat(y, x, FEAT_DOOR_HEAD + 0x00);
+ cave_alter_feat(y, x, FF_DISARM);
/* Check line of sound */
- if (known)
+ if (known && (old_feat != c_ptr->feat))
{
#ifdef JP
-msg_print("¥«¥Á¥Ã¤È²»¤¬¤·¤¿¡ª");
+ msg_print("¥«¥Á¥Ã¤È²»¤¬¤·¤¿¡ª");
#else
msg_print("Click!");
#endif
}
}
+ /* Remove "unsafe" flag if player is not blind */
+ if (!p_ptr->blind && player_has_los_bold(y, x))
+ {
+ c_ptr->info &= ~(CAVE_UNSAFE);
+
+ /* Redraw */
+ lite_spot(y, x);
+
+ obvious = TRUE;
+ }
+
break;
}
case GF_KILL_DOOR:
{
/* Destroy all doors and traps */
- if ((c_ptr->feat == FEAT_OPEN) ||
- (c_ptr->feat == FEAT_BROKEN) ||
- is_trap(c_ptr->feat) ||
- ((c_ptr->feat >= FEAT_DOOR_HEAD) &&
- (c_ptr->feat <= FEAT_DOOR_TAIL)))
+ if (is_trap(c_ptr->feat) || have_flag(f_ptr->flags, FF_DOOR))
{
/* Check line of sight */
if (known)
{
/* Message */
#ifdef JP
-msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
+ msg_print("¤Þ¤Ð¤æ¤¤Á®¸÷¤¬Áö¤Ã¤¿¡ª");
#else
msg_print("There is a bright flash of light!");
#endif
obvious = TRUE;
-
- /* Visibility change */
- if ((c_ptr->feat >= FEAT_DOOR_HEAD) &&
- (c_ptr->feat <= FEAT_DOOR_TAIL))
- {
- /* Update some things */
- p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
- }
}
- /* Forget the door */
- c_ptr->info &= ~(CAVE_MARK);
+ /* Visibility change */
+ if (have_flag(f_ptr->flags, FF_DOOR))
+ {
+ /* Update some things */
+ p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
+ }
/* Destroy the feature */
- cave_set_feat(y, x, floor_type[randint0(100)]);
+ cave_alter_feat(y, x, FF_TUNNEL);
}
- /* Notice */
- note_spot(y, x);
+ /* Remove "unsafe" flag if player is not blind */
+ if (!p_ptr->blind && player_has_los_bold(y, x))
+ {
+ c_ptr->info &= ~(CAVE_UNSAFE);
+
+ /* Redraw */
+ lite_spot(y, x);
+
+ obvious = TRUE;
+ }
break;
}
case GF_JAM_DOOR: /* Jams a door (as if with a spike) */
{
- if ((c_ptr->feat >= FEAT_DOOR_HEAD) &&
- (c_ptr->feat <= FEAT_DOOR_TAIL))
+ if (have_flag(f_ptr->flags, FF_SPIKE))
{
- /* Convert "locked" to "stuck" XXX XXX XXX */
- if (c_ptr->feat < FEAT_DOOR_HEAD + 0x08) c_ptr->feat += 0x08;
+ s16b old_mimic = c_ptr->mimic;
+ feature_type *mimic_f_ptr = &f_info[get_feat_mimic(c_ptr)];
- /* Add one spike to the door */
- if (c_ptr->feat < FEAT_DOOR_TAIL) c_ptr->feat++;
+ cave_alter_feat(y, x, FF_SPIKE);
+
+ c_ptr->mimic = old_mimic;
+
+ /* Notice */
+ note_spot(y, x);
+
+ /* Redraw */
+ lite_spot(y, x);
/* Check line of sight */
- if (known)
+ if (known && have_flag(mimic_f_ptr->flags, FF_OPEN))
{
/* Message */
#ifdef JP
-msg_print("²¿¤«¤¬¤Ä¤Ã¤«¤¨¤Æ¥É¥¢¤¬³«¤«¤Ê¤¤¡£");
+ msg_format("%s¤Ë²¿¤«¤¬¤Ä¤Ã¤«¤¨¤Æ³«¤«¤Ê¤¯¤Ê¤Ã¤¿¡£", f_name + mimic_f_ptr->name);
#else
- msg_print("The door seems stuck.");
+ msg_format("The %s seems stuck.", f_name + mimic_f_ptr->name);
#endif
obvious = TRUE;
/* Destroy walls (and doors) */
case GF_KILL_WALL:
{
- /* Non-walls (etc) */
- if (cave_floor_bold(y, x)) break;
-
- /* Permanent walls */
- if (c_ptr->feat >= FEAT_PERM_EXTRA) break;
-
- /* Granite */
- if (c_ptr->feat >= FEAT_WALL_EXTRA)
+ if (have_flag(f_ptr->flags, FF_HURT_ROCK))
{
/* Message */
if (known && (c_ptr->info & (CAVE_MARK)))
{
#ifdef JP
-msg_print("Êɤ¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª");
+ msg_format("%s¤¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª", f_name + f_info[get_feat_mimic(c_ptr)].name);
#else
- msg_print("The wall turns into mud!");
+ msg_format("The %s turns into mud!", f_name + f_info[get_feat_mimic(c_ptr)].name);
#endif
obvious = TRUE;
}
- /* Forget the wall */
- c_ptr->info &= ~(CAVE_MARK);
-
/* Destroy the wall */
- cave_set_feat(y, x, floor_type[randint0(100)]);
- }
-
- /* Quartz / Magma with treasure */
- else if (c_ptr->feat >= FEAT_MAGMA_H)
- {
- /* Message */
- if (known && (c_ptr->info & (CAVE_MARK)))
- {
-#ifdef JP
-msg_print("¹ÛÌ®¤¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª");
-msg_print("²¿¤«¤òȯ¸«¤·¤¿¡ª");
-#else
- msg_print("The vein turns into mud!");
- msg_print("You have found something!");
-#endif
-
- obvious = TRUE;
- }
-
- /* Forget the wall */
- c_ptr->info &= ~(CAVE_MARK);
-
- /* Destroy the wall */
- cave_set_feat(y, x, floor_type[randint0(100)]);
-
- /* Place some gold */
- place_gold(y, x);
- }
-
- /* Quartz / Magma */
- else if (c_ptr->feat >= FEAT_MAGMA)
- {
- /* Message */
- if (known && (c_ptr->info & (CAVE_MARK)))
- {
-#ifdef JP
-msg_print("¹ÛÌ®¤¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª");
-#else
- msg_print("The vein turns into mud!");
-#endif
-
- obvious = TRUE;
- }
-
- /* Forget the wall */
- c_ptr->info &= ~(CAVE_MARK);
-
- /* Destroy the wall */
- cave_set_feat(y, x, floor_type[randint0(100)]);
- }
-
- /* Rubble */
- else if (c_ptr->feat == FEAT_RUBBLE)
- {
- /* Message */
- if (known && (c_ptr->info & (CAVE_MARK)))
- {
-#ifdef JP
-msg_print("´äÀФ¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª");
-#else
- msg_print("The rubble turns into mud!");
-#endif
-
- obvious = TRUE;
- }
-
- /* Forget the wall */
- c_ptr->info &= ~(CAVE_MARK);
-
- /* Destroy the rubble */
- cave_set_feat(y, x, floor_type[randint0(100)]);
-
- /* Hack -- place an object */
- if (randint0(100) < 10)
- {
- /* Found something */
- if (player_can_see_bold(y, x))
- {
-#ifdef JP
-msg_print("´äÀФβ¼¤Ë²¿¤«±£¤µ¤ì¤Æ¤¤¤¿¡ª");
-#else
- msg_print("There was something buried in the rubble!");
-#endif
-
- obvious = TRUE;
- }
-
- /* Place object */
- place_object(y, x, 0L);
- }
- }
-
- /* Destroy doors (and secret doors) */
- else /* if (c_ptr->feat >= FEAT_DOOR_HEAD) */
- {
- /* Hack -- special message */
- if (known && (c_ptr->info & (CAVE_MARK)))
- {
-#ifdef JP
-msg_print("¥É¥¢¤¬ÍϤ±¤ÆÅ¥¤Ë¤Ê¤Ã¤¿¡ª");
-#else
- msg_print("The door turns into mud!");
-#endif
-
- obvious = TRUE;
- }
+ cave_alter_feat(y, x, FF_HURT_ROCK);
- /* Forget the wall */
- c_ptr->info &= ~(CAVE_MARK);
-
- /* Destroy the feature */
- cave_set_feat(y, x, floor_type[randint0(100)]);
+ /* Update some things */
+ p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
}
- /* Notice */
- note_spot(y, x);
-
- /* Update some things */
- p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
-
break;
}
/* Make traps */
case GF_MAKE_TRAP:
{
- /* Require a "naked" floor grid */
- if (((cave[y][x].feat != FEAT_FLOOR) &&
- (cave[y][x].feat != FEAT_GRASS) &&
- (cave[y][x].feat != FEAT_DIRT) &&
- (cave[y][x].o_idx == 0) &&
- (cave[y][x].m_idx == 0))
- || is_mirror_grid(&cave[y][x]) )
- break;
/* Place a trap */
place_trap(y, x);
if (!cave_naked_bold(y, x)) break;
/* Create a glyph */
- cave[y][x].info |= CAVE_OBJECT;
- cave[y][x].mimic = f_info[FEAT_GLYPH].mimic;
+ c_ptr->info |= CAVE_OBJECT;
+ c_ptr->mimic = FEAT_GLYPH;
/* Notice */
note_spot(y, x);
/* Not on the player */
if (player_bold(y, x)) break;
- /* Place a trap */
- cave_set_feat(y, x, FEAT_WALL_EXTRA);
+ /* Place a wall */
+ cave_set_feat(y, x, FEAT_WALL);
/* Update some things */
p_ptr->update |= (PU_VIEW | PU_LITE | PU_MONSTERS | PU_MON_LITE);
case GF_LAVA_FLOW:
{
/* Shallow Lava */
- if(dam == 1)
+ if (dam == 1)
{
- /* Require a "naked" floor grid */
- if (!cave_naked_bold(y, x)) break;
+ /* Ignore permanent grid */
+ if (cave_perma_bold(y, x)) break;
+
+ /* Ignore grid without enough space */
+ if (!have_flag(f_flags_bold(y, x), FF_FLOOR)) break;
/* Place a shallow lava */
cave_set_feat(y, x, FEAT_SHAL_LAVA);
}
/* Deep Lava */
- else
+ else if (dam)
{
- /* Require a "naked" floor grid */
- if (cave_perma_bold(y, x) || !dam) break;
+ /* Ignore permanent grid */
+ if (cave_perma_bold(y, x)) break;
/* Place a deep lava */
cave_set_feat(y, x, FEAT_DEEP_LAVA);
-
- /* Dam is used as a counter for the number of grid to convert */
- dam--;
}
break;
}
case GF_WATER_FLOW:
{
/* Shallow Water */
- if(dam == 1)
+ if (dam == 1)
{
- /* Require a "naked" floor grid */
- if (!cave_naked_bold(y, x)) break;
+ /* Ignore permanent grid */
+ if (cave_perma_bold(y, x)) break;
+
+ /* Ignore grid without enough space */
+ if (!have_flag(f_flags_bold(y, x), FF_FLOOR)) break;
/* Place a shallow lava */
cave_set_feat(y, x, FEAT_SHAL_WATER);
}
/* Deep Water */
- else
+ else if (dam)
{
- /* Require a "naked" floor grid */
- if (cave_perma_bold(y, x) || !dam) break;
+ /* Ignore permanent grid */
+ if (cave_perma_bold(y, x)) break;
/* Place a deep lava */
cave_set_feat(y, x, FEAT_DEEP_WATER);
-
- /* Dam is used as a counter for the number of grid to convert */
- dam--;
}
break;
}
case GF_LITE:
{
/* Turn on the light */
- if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS)) c_ptr->info |= (CAVE_GLOW);
+ if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS))
+ {
+ c_ptr->info |= (CAVE_GLOW);
- /* Notice */
- note_spot(y, x);
+ /* Notice */
+ note_spot(y, x);
- /* Redraw */
- lite_spot(y, x);
+ /* Redraw */
+ lite_spot(y, x);
- /* Observe */
- if (player_can_see_bold(y, x)) obvious = TRUE;
+ update_local_illumination(y, x);
- /* Mega-Hack -- Update the monster in the affected grid */
- /* This allows "spear of light" (etc) to work "correctly" */
- if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
+ /* Observe */
+ if (player_can_see_bold(y, x)) obvious = TRUE;
+
+ /* Mega-Hack -- Update the monster in the affected grid */
+ /* This allows "spear of light" (etc) to work "correctly" */
+ if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
+ }
break;
}
{
if (!p_ptr->inside_battle)
{
- /* Notice */
- if (player_can_see_bold(y, x)) obvious = TRUE;
-
/* Turn off the light. */
- if (!is_mirror_grid(c_ptr)) c_ptr->info &= ~(CAVE_GLOW);
-
- /* Hack -- Forget "boring" grids */
- if ((c_ptr->feat <= FEAT_INVIS) || (c_ptr->feat == FEAT_DIRT) || (c_ptr->feat == FEAT_GRASS))
+ if (!is_mirror_grid(c_ptr))
{
- /* Forget */
- c_ptr->info &= ~(CAVE_MARK);
+ c_ptr->info &= ~(CAVE_GLOW);
- /* Notice */
- note_spot(y, x);
- }
+ /* Hack -- Forget "boring" grids */
+ if (!have_flag(f_ptr->flags, FF_REMEMBER))
+ {
+ /* Forget */
+ c_ptr->info &= ~(CAVE_MARK);
- /* Redraw */
- lite_spot(y, x);
+ /* Notice */
+ note_spot(y, x);
+ }
- /* Mega-Hack -- Update the monster in the affected grid */
- /* This allows "spear of light" (etc) to work "correctly" */
- if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
+ /* Redraw */
+ lite_spot(y, x);
+
+ update_local_illumination(y, x);
+
+ /* Notice */
+ if (player_can_see_bold(y, x)) obvious = TRUE;
+
+ /* Mega-Hack -- Update the monster in the affected grid */
+ /* This allows "spear of light" (etc) to work "correctly" */
+ if (c_ptr->m_idx) update_mon(c_ptr->m_idx, FALSE);
+ }
}
/* All done */
case GF_SHARDS:
case GF_ROCKET:
{
- if (is_mirror_grid(&cave[y][x]))
+ if (is_mirror_grid(c_ptr))
{
#ifdef JP
msg_print("¶À¤¬³ä¤ì¤¿¡ª");
#else
- msg_print("The mirror was chashed!");
-#endif
- remove_mirror(y,x);
- project(0,2,y,x, p_ptr->lev /2 +5 ,GF_SHARDS,(PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP|PROJECT_NO_HANGEKI),-1);
+ msg_print("The mirror was crashed!");
+#endif
+ remove_mirror(y, x);
+ project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
}
break;
}
case GF_SOUND:
{
- if (is_mirror_grid(&cave[y][x]) && p_ptr->lev < 40 )
+ if (is_mirror_grid(c_ptr) && p_ptr->lev < 40)
{
#ifdef JP
msg_print("¶À¤¬³ä¤ì¤¿¡ª");
#else
- msg_print("The mirror was chashed!");
-#endif
- cave_set_feat(y,x, FEAT_FLOOR);
+ msg_print("The mirror was crashed!");
+#endif
+ remove_mirror(y, x);
+ project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS, (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
+ }
+ break;
+ }
+
+ case GF_DISINTEGRATE:
+ {
+ /* Destroy mirror */
+ if (is_mirror_grid(c_ptr)) remove_mirror(y, x);
+
+ /* Permanent features don't get effect */
+ /* But not protect monsters and other objects */
+ if (have_flag(f_ptr->flags, FF_HURT_DISI) && !have_flag(f_ptr->flags, FF_PERMANENT))
+ {
+ cave_alter_feat(y, x, FF_HURT_DISI);
+
+ /* Update some things -- similar to GF_KILL_WALL */
+ p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
}
break;
}
case GF_IDENTIFY:
{
identify_item(o_ptr);
+
+ /* Auto-inscription */
+ autopick_alter_item((-this_o_idx), FALSE);
break;
}
if (known && o_ptr->marked)
{
obvious = TRUE;
- object_desc(o_name, o_ptr, FALSE, 0);
+ object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
}
/* Artifacts, and other objects, get to resist */
monster_race *r_ptr = &r_info[m_ptr->r_idx];
- char killer [80];
+ char killer[80];
/* Is the monster "seen"? */
bool seen = m_ptr->ml;
int ty = m_ptr->fy;
int tx = m_ptr->fx;
- int caster_lev = (who > 0) ? (r_info[m_list[who].r_idx].level / 2) : p_ptr->lev;
+ int caster_lev = (who > 0) ? r_info[m_list[who].r_idx].level : p_ptr->lev * 2;
/* Nobody here */
if (!c_ptr->m_idx) return (FALSE);
}
/* 2. stun */
- do_stun = damroll((caster_lev / 10) + 3 , (dam)) + 1;
+ do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
/* Attempt a saving throw */
if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
}
/* 1. stun */
- do_stun = damroll((caster_lev / 10) + 3 , dam) + 1;
+ do_stun = damroll((caster_lev / 20) + 3 , dam) + 1;
/* Attempt a saving throw */
if ((r_ptr->flags1 & RF1_UNIQUE) ||
}
else if (((r_ptr->flags1 & RF1_UNIQUE) &&
(randint1(888) != 666)) ||
- (((r_ptr->level + randint1(20)) > randint1(caster_lev + randint1(10))) &&
+ (((r_ptr->level + randint1(20)) > randint1((caster_lev / 2) + randint1(10))) &&
randint1(100) != 66))
{
#ifdef JP
{
if (seen) obvious = TRUE;
- if (is_pet(m_ptr) || (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_UNIQUE_7 | RF7_UNIQUE2)))
+ if (is_pet(m_ptr) || (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & (RF7_NAZGUL | RF7_UNIQUE2)))
{
#ifdef JP
note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
break;
}
- if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
+ if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
dam = dam * 2 / 3;
/* Attempt a saving throw */
break;
}
- if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
+ if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
dam = dam * 2 / 3;
/* Attempt a saving throw */
break;
}
- if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
+ if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
dam = dam * 2 / 3;
/* Attempt a saving throw */
break;
}
- if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
+ if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
dam = dam * 2 / 3;
/* Attempt a saving throw */
break;
}
- if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7))
+ if ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_NAZGUL))
dam = dam * 2 / 3;
/* Attempt a saving throw */
if (seen && is_original_ap(m_ptr)) r_ptr->r_flagsr |= (RFR_RES_ALL);
break;
}
- do_stun = damroll((caster_lev / 10) + 3 , (dam)) + 1;
+ do_stun = damroll((caster_lev / 20) + 3 , (dam)) + 1;
/* Attempt a saving throw */
if ((r_ptr->flags1 & (RF1_UNIQUE)) ||
if ((r_ptr->flags4 & ~(RF4_NOMAGIC_MASK)) || (r_ptr->flags5 & ~(RF5_NOMAGIC_MASK)) || (r_ptr->flags6 & ~(RF6_NOMAGIC_MASK)))
{
- /* Message */
+ if (who > 0)
+ {
+ monster_type *caster_ptr = &m_list[who];
+
+ /* Heal the monster */
+ if (caster_ptr->hp < caster_ptr->maxhp)
+ {
+ /* Heal */
+ caster_ptr->hp += 6 * dam;
+ if (caster_ptr->hp > caster_ptr->maxhp) caster_ptr->hp = caster_ptr->maxhp;
+
+ /* Redraw (later) if needed */
+ if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
+ if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
+
+ /* Special message */
+ if (caster_ptr->ml)
+ {
+ /* Get the monster name */
+ monster_desc(killer, caster_ptr, 0);
#ifdef JP
-msg_format("%s¤«¤éÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¤È¤Ã¤¿¡£",m_name);
+ msg_format("%^s¤Ïµ¤Ê¬¤¬Îɤµ¤½¤¦¤À¡£", killer);
#else
- msg_format("You draw psychic energy from %s.", m_name);
+ msg_format("%^s appears healthier.", killer);
+#endif
+ }
+ }
+ }
+ else
+ {
+ /* Message */
+#ifdef JP
+ msg_format("%s¤«¤éÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¤È¤Ã¤¿¡£", m_name);
+#else
+ msg_format("You draw psychic energy from %s.", m_name);
#endif
- (void)hp_player(dam);
+ (void)hp_player(dam);
+ }
}
else
{
#ifdef JP
-msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£",m_name);
+ msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£", m_name);
#else
msg_format("%s is unaffected.", m_name);
#endif
if (seen) obvious = TRUE;
/* Message */
#ifdef JP
-msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£",m_name);
+ if (!who) msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£", m_name);
#else
- msg_format("You gaze intently at %s.", m_name);
+ if (!who) msg_format("You gaze intently at %s.", m_name);
#endif
if (r_ptr->flagsr & RFR_RES_ALL)
/* Attempt a saving throw */
if ((r_ptr->flags1 & RF1_UNIQUE) ||
(r_ptr->flags3 & RF3_NO_CONF) ||
- (r_ptr->level > randint1((caster_lev*2 - 10) < 1 ? 1 : (caster_lev*2 - 10)) + 10))
+ (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
{
/* Memorize a flag */
if (r_ptr->flags3 & (RF3_NO_CONF))
if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
}
#ifdef JP
-note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
+ note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
#else
note = "is unaffected!";
#endif
dam = 0;
}
+ else if (r_ptr->flags2 & RF2_EMPTY_MIND)
+ {
+ if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
+#ifdef JP
+ note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
+#else
+ note = " is immune!";
+#endif
+ dam = 0;
+ }
+ else if (r_ptr->flags2 & RF2_WEIRD_MIND)
+ {
+ if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
+#ifdef JP
+ note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
+#else
+ note = " resists.";
+#endif
+ dam /= 3;
+ }
else
{
#ifdef JP
-msg_format("%s¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£",m_name);
-note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
+ note = "¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£";
+ note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
#else
- msg_format("%^s is blasted by psionic energy.", m_name);
+ note = " is blasted by psionic energy.";
note_dies = " collapses, a mindless husk.";
#endif
- do_conf = randint0(8) + 8;
+ if (who > 0) do_conf = randint0(4) + 4;
+ else do_conf = randint0(8) + 8;
}
break;
}
if (seen) obvious = TRUE;
/* Message */
#ifdef JP
-msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£",m_name);
+ if (!who) msg_format("%s¤ò¤¸¤Ã¤Èâˤó¤À¡£", m_name);
#else
- msg_format("You gaze intently at %s.", m_name);
+ if (!who) msg_format("You gaze intently at %s.", m_name);
#endif
if (r_ptr->flagsr & RFR_RES_ALL)
/* Attempt a saving throw */
if ((r_ptr->flags1 & RF1_UNIQUE) ||
(r_ptr->flags3 & RF3_NO_CONF) ||
- (r_ptr->level > randint1((caster_lev*2 - 10) < 1 ? 1 : (caster_lev*2 - 10)) + 10))
+ (r_ptr->level > randint1((caster_lev - 10) < 1 ? 1 : (caster_lev - 10)) + 10))
{
/* Memorize a flag */
if (r_ptr->flags3 & (RF3_NO_CONF))
if (seen && is_original_ap(m_ptr)) r_ptr->r_flags3 |= (RF3_NO_CONF);
}
#ifdef JP
-note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
+ note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
#else
note = "is unaffected!";
#endif
dam = 0;
}
+ else if (r_ptr->flags2 & RF2_EMPTY_MIND)
+ {
+ if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_EMPTY_MIND);
+#ifdef JP
+ note = "¤Ë¤Ï´°Á´¤ÊÂÑÀ¤¬¤¢¤ë¡ª";
+#else
+ note = " is immune!";
+#endif
+ dam = 0;
+ }
+ else if (r_ptr->flags2 & RF2_WEIRD_MIND)
+ {
+ if (seen && is_original_ap(m_ptr)) r_ptr->r_flags2 |= (RF2_WEIRD_MIND);
+#ifdef JP
+ note = "¤Ë¤ÏÂÑÀ¤¬¤¢¤ë¡£";
+#else
+ note = " resists.";
+#endif
+ dam /= 3;
+ }
else
{
#ifdef JP
-msg_format("%s¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£",m_name);
-note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
+ note = "¤ÏÀº¿À¹¶·â¤ò¿©¤é¤Ã¤¿¡£";
+ note_dies = "¤ÎÀº¿À¤ÏÊø²õ¤·¡¢ÆùÂΤÏÈ´¤±³Ì¤È¤Ê¤Ã¤¿¡£";
#else
- msg_format("%^s is blasted by psionic energy.", m_name);
+ note = " is blasted by psionic energy.";
note_dies = " collapses, a mindless husk.";
#endif
- do_conf = randint0(8) + 8;
- do_stun = randint0(8) + 8;
+ if (who > 0)
+ {
+ do_conf = randint0(4) + 4;
+ do_stun = randint0(4) + 4;
+ }
+ else
+ {
+ do_conf = randint0(8) + 8;
+ do_stun = randint0(8) + 8;
+ }
m_ptr->slow = MIN(200, m_ptr->slow + 10);
if (c_ptr->m_idx == p_ptr->riding)
p_ptr->update |= (PU_BONUS);
if (seen) obvious = TRUE;
/* Message */
#ifdef JP
-msg_format("%s¤ò»Øº¹¤·¤Æ¼ö¤¤¤ò¤«¤±¤¿¡£",m_name);
+ if (!who) msg_format("%s¤ò»Øº¹¤·¤Æ¼ö¤¤¤ò¤«¤±¤¿¡£", m_name);
#else
- msg_format("You point at %s and curses.", m_name);
+ if (!who) msg_format("You point at %s and curses.", m_name);
#endif
if (r_ptr->flagsr & RFR_RES_ALL)
}
/* Attempt a saving throw */
- if (randint0(100 + caster_lev) < (r_ptr->level + 35))
+ if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
{
-
#ifdef JP
-note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
+ note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
#else
note = "is unaffected!";
#endif
if (seen) obvious = TRUE;
/* Message */
#ifdef JP
-msg_format("%s¤ò»Øº¹¤·¤Æ¶²¤í¤·¤²¤Ë¼ö¤¤¤ò¤«¤±¤¿¡£",m_name);
+ if (!who) msg_format("%s¤ò»Øº¹¤·¤Æ¶²¤í¤·¤²¤Ë¼ö¤¤¤ò¤«¤±¤¿¡£", m_name);
#else
- msg_format("You point at %s and curses horribly.", m_name);
+ if (!who) msg_format("You point at %s and curses horribly.", m_name);
#endif
if (r_ptr->flagsr & RFR_RES_ALL)
}
/* Attempt a saving throw */
- if (randint0(100 + caster_lev) < (r_ptr->level + 35))
+ if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
{
-
#ifdef JP
-note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
+ note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
#else
note = "is unaffected!";
#endif
if (seen) obvious = TRUE;
/* Message */
#ifdef JP
-msg_format("%s¤ò»Øº¹¤·¡¢¶²¤·¤²¤Ë¼öʸ¤ò¾§¤¨¤¿¡ª",m_name);
+ if (!who) msg_format("%s¤ò»Øº¹¤·¡¢¶²¤í¤·¤²¤Ë¼öʸ¤ò¾§¤¨¤¿¡ª", m_name);
#else
- msg_format("You point at %s, incanting terribly!", m_name);
+ if (!who) msg_format("You point at %s, incanting terribly!", m_name);
#endif
if (r_ptr->flagsr & RFR_RES_ALL)
}
/* Attempt a saving throw */
- if (randint0(100 + caster_lev) < (r_ptr->level + 35))
+ if (randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35))
{
-
#ifdef JP
-note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
+ note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
#else
note = "is unaffected!";
#endif
if (seen) obvious = TRUE;
/* Message */
#ifdef JP
-msg_format("%s¤ÎÈ빦¤òÆͤ¤¤Æ¡¢¡Ö¤ªÁ°¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡×¤È¶«¤ó¤À¡£",m_name);
+ if (!who) msg_format("%s¤ÎÈ빦¤òÆͤ¤¤Æ¡¢¡Ö¤ªÁ°¤Ï´û¤Ë»à¤ó¤Ç¤¤¤ë¡×¤È¶«¤ó¤À¡£", m_name);
#else
- msg_format("You point at %s, screaming th word, 'DIE!'.", m_name);
+ if (!who) msg_format("You point at %s, screaming the word, 'DIE!'.", m_name);
#endif
if (r_ptr->flagsr & RFR_RES_ALL)
}
/* Attempt a saving throw */
- if (randint0(100 + caster_lev) < (r_ptr->level + 35))
+ if ((randint0(100 + (caster_lev / 2)) < (r_ptr->level + 35)) && ((who <= 0) || (m_list[who].r_idx != MON_KENSHIROU)))
{
-
#ifdef JP
-note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
+ note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£";
#else
note = "is unaffected!";
#endif
if (r_ptr->flags1 & RF1_UNIQUE)
{
#ifdef JP
-note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
+ note = "¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡ª";
#else
note = "is unaffected!";
#endif
}
else
{
- if ((caster_lev + randint1(dam)) >
- (r_ptr->level + randint1(200)))
- {
- dam = ((40 + randint1(20)) * m_ptr->hp) / 100;
+ if ((who > 0) ? ((caster_lev + randint1(dam)) > (r_ptr->level + 10 + randint1(20))) :
+ (((caster_lev / 2) + randint1(dam)) > (r_ptr->level + randint1(200))))
+ {
+ dam = ((40 + randint1(20)) * m_ptr->hp) / 100;
- if (m_ptr->hp < dam) dam = m_ptr->hp - 1;
- }
- else
- {
+ if (m_ptr->hp < dam) dam = m_ptr->hp - 1;
+ }
+ else
+ {
#ifdef JP
-note = "¤ÏÂÑÀ¤ò»ý¤Ã¤Æ¤¤¤ë¡ª";
+ note = "¤ÏÂÑÀ¤ò»ý¤Ã¤Æ¤¤¤ë¡ª";
#else
- note = "resists!";
+ note = "resists!";
#endif
- dam = 0;
- }
+ dam = 0;
}
+ }
break;
}
{
int nokori_hp;
if ((p_ptr->inside_quest && (quest[p_ptr->inside_quest].type == QUEST_TYPE_KILL_ALL) && !is_pet(m_ptr)) ||
- (r_ptr->flags1 & (RF1_UNIQUE)) || (r_ptr->flags7 & (RF7_UNIQUE_7)) || (r_ptr->flags7 & (RF7_UNIQUE2)) || (r_ptr->flags1 & RF1_QUESTOR))
+ (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)
{
#ifdef JP
msg_format("%s¤Ë¤Ï¸ú²Ì¤¬¤Ê¤«¤Ã¤¿¡£",m_name);
case GF_PHOTO:
{
#ifdef JP
- msg_format("%s¤ò¼Ì¿¿¤Ë»£¤Ã¤¿¡£",m_name);
+ if (!who) msg_format("%s¤ò¼Ì¿¿¤Ë»£¤Ã¤¿¡£", m_name);
#else
- msg_format("You take a photograph of %s.",m_name);
+ if (!who) msg_format("You take a photograph of %s.", m_name);
#endif
/* Hurt by light */
if (r_ptr->flags3 & (RF3_HURT_LITE))
/* Special effect */
#ifdef JP
-note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
-note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
+ note = "¤Ï¸÷¤Ë¿È¤ò¤¹¤¯¤á¤¿¡ª";
+ note_dies = "¤Ï¸÷¤ò¼õ¤±¤Æ¤·¤Ü¤ó¤Ç¤·¤Þ¤Ã¤¿¡ª";
#else
note = " cringes from the light!";
note_dies = " shrivels away in the light!";
if (p_ptr->riding && (c_ptr->m_idx == p_ptr->riding)) do_poly = FALSE;
/* "Unique" and "quest" monsters can only be "killed" by the player. */
- if (((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->flags7 & RF7_UNIQUE_7) || (r_ptr->flags1 & RF1_QUESTOR)) && !p_ptr->inside_battle)
+ if (((r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) || (r_ptr->flags7 & RF7_NAZGUL)) && !p_ptr->inside_battle)
{
if (who && (dam > m_ptr->hp)) dam = m_ptr->hp;
}
}
+ if (typ == GF_DRAIN_MANA)
+ {
+ /* Drain mana does nothing */
+ }
+
/* If another monster did the damage, hurt the monster by hand */
- if (who)
+ else if (who)
{
/* Redraw (later) if needed */
if (p_ptr->health_who == c_ptr->m_idx) p_ptr->redraw |= (PR_HEALTH);
delete_monster_idx(c_ptr->m_idx);
}
+
/* If the player did it, give him experience, check fear */
- else if (typ != GF_DRAIN_MANA)
+ else
{
bool fear = FALSE;
t_x = m_list[who].fx - 1 + randint1(3);
max_attempts--;
}
- while (max_attempts && in_bounds2u(t_y, t_x) &&
- !(player_has_los_bold(t_y, t_x)));
+ while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(py, px, t_y, t_x));
if (max_attempts < 1)
{
msg_print("Gravity warps around you.");
#endif
- teleport_player(5);
+ teleport_player(5, TRUE);
if (!p_ptr->ffall)
(void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
if (!(p_ptr->resist_sound || p_ptr->ffall))
break;
}
+ /* Drain mana */
+ case GF_DRAIN_MANA:
+ {
+ if (p_ptr->csp)
+ {
+ /* Basic message */
+#ifdef JP
+ if (who > 0) msg_format("%^s¤ËÀº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¼è¤é¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª", m_name);
+ else msg_print("Àº¿À¥¨¥Í¥ë¥®¡¼¤òµÛ¤¤¼è¤é¤ì¤Æ¤·¤Þ¤Ã¤¿¡ª");
+#else
+ if (who > 0) msg_format("%^s draws psychic energy from you!", m_name);
+ else msg_print("Your psychic energy is drawn!");
+#endif
+
+ /* Full drain */
+ if (dam >= p_ptr->csp)
+ {
+ dam = p_ptr->csp;
+ p_ptr->csp = 0;
+ p_ptr->csp_frac = 0;
+ }
+
+ /* Partial drain */
+ else
+ {
+ p_ptr->csp -= dam;
+ }
+
+ learn_spell(monspell);
+
+ /* Redraw mana */
+ p_ptr->redraw |= (PR_MANA);
+
+ /* Window stuff */
+ p_ptr->window |= (PW_PLAYER);
+ p_ptr->window |= (PW_SPELL);
+
+ if (who > 0)
+ {
+ /* Heal the monster */
+ if (m_ptr->hp < m_ptr->maxhp)
+ {
+ /* Heal */
+ m_ptr->hp += (6 * dam);
+ if (m_ptr->hp > m_ptr->maxhp) m_ptr->hp = m_ptr->maxhp;
+
+ /* Redraw (later) if needed */
+ if (p_ptr->health_who == who) p_ptr->redraw |= (PR_HEALTH);
+ if (p_ptr->riding == who) p_ptr->redraw |= (PR_UHEALTH);
+
+ /* Special message */
+ if (m_ptr->ml)
+ {
+#ifdef JP
+ msg_format("%^s¤Ïµ¤Ê¬¤¬Îɤµ¤½¤¦¤À¡£", m_name);
+#else
+ msg_format("%^s appears healthier.", m_name);
+#endif
+ }
+ }
+ }
+ }
+
+ dam = 0;
+ break;
+ }
+
/* Mind blast */
case GF_MIND_BLAST:
{
if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
{
#ifdef JP
-msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
+ msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
#else
msg_print("You resist the effects!");
#endif
- learn_spell(MS_MIND_BLAST);
+ learn_spell(monspell);
}
else
{
#ifdef JP
-msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
+ msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
#else
msg_print("Your mind is blasted by psyonic energy.");
#endif
}
p_ptr->redraw |= PR_MANA;
- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_MIND_BLAST);
+ get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
}
break;
}
+
/* Brain smash */
case GF_BRAIN_SMASH:
{
if (randint0(100 + rlev/2) < (MAX(5, p_ptr->skill_sav)))
{
#ifdef JP
-msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
+ msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
#else
msg_print("You resist the effects!");
#endif
- learn_spell(MS_BRAIN_SMASH);
+ learn_spell(monspell);
}
else
{
#ifdef JP
-msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
+ msg_print("ÎîŪ¥¨¥Í¥ë¥®¡¼¤ÇÀº¿À¤¬¹¶·â¤µ¤ì¤¿¡£");
#else
msg_print("Your mind is blasted by psionic energy.");
#endif
}
p_ptr->redraw |= PR_MANA;
- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_BRAIN_SMASH);
+ get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
if (!p_ptr->resist_blind)
{
(void)set_blind(p_ptr->blind + 8 + randint0(8));
}
break;
}
+
/* cause 1 */
case GF_CAUSE_1:
{
if (randint0(100 + rlev/2) < p_ptr->skill_sav)
{
#ifdef JP
-msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
+ msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
#else
msg_print("You resist the effects!");
#endif
- learn_spell(MS_CAUSE_1);
+ learn_spell(monspell);
}
else
{
curse_equipment(15, 0);
- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_CAUSE_1);
+ get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
}
break;
}
+
/* cause 2 */
case GF_CAUSE_2:
{
if (randint0(100 + rlev/2) < p_ptr->skill_sav)
{
#ifdef JP
-msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
+ msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
#else
msg_print("You resist the effects!");
#endif
- learn_spell(MS_CAUSE_2);
+ learn_spell(monspell);
}
else
{
curse_equipment(25, MIN(rlev/2-15, 5));
- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_CAUSE_2);
+ get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
}
break;
}
+
/* cause 3 */
case GF_CAUSE_3:
{
if (randint0(100 + rlev/2) < p_ptr->skill_sav)
{
#ifdef JP
-msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
+ msg_print("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
#else
msg_print("You resist the effects!");
#endif
- learn_spell(MS_CAUSE_3);
+ learn_spell(monspell);
}
else
{
curse_equipment(33, MIN(rlev/2-15, 15));
- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_CAUSE_3);
+ get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
}
break;
}
+
/* cause 4 */
case GF_CAUSE_4:
{
if ((randint0(100 + rlev/2) < p_ptr->skill_sav) && !(m_ptr->r_idx == MON_KENSHIROU))
{
#ifdef JP
-msg_print("¤·¤«¤·È빦¤òÄ·¤ÍÊÖ¤·¤¿¡ª");
+ msg_print("¤·¤«¤·È빦¤òÄ·¤ÍÊÖ¤·¤¿¡ª");
#else
msg_print("You resist the effects!");
#endif
- learn_spell(MS_CAUSE_4);
+ learn_spell(monspell);
}
else
{
- get_damage = take_hit(DAMAGE_ATTACK, dam, killer, MS_CAUSE_4);
+ get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
(void)set_cut(p_ptr->cut + damroll(10, 10));
}
break;
}
+
/* Hand of Doom */
case GF_HAND_DOOM:
{
if (randint0(100 + rlev/2) < p_ptr->skill_sav)
{
#ifdef JP
-msg_format("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
+ msg_format("¤·¤«¤·¸úÎϤòÄ·¤ÍÊÖ¤·¤¿¡ª");
#else
msg_format("You resist the effects!");
#endif
- learn_spell(MS_HAND_DOOM);
-
+ learn_spell(monspell);
}
else
{
#ifdef JP
-msg_print("¤¢¤Ê¤¿¤ÏÌ¿¤¬Çö¤Þ¤Ã¤Æ¤¤¤¯¤è¤¦¤Ë´¶¤¸¤¿¡ª");
+ msg_print("¤¢¤Ê¤¿¤ÏÌ¿¤¬Çö¤Þ¤Ã¤Æ¤¤¤¯¤è¤¦¤Ë´¶¤¸¤¿¡ª");
#else
- msg_print("Your feel your life fade away!");
+ msg_print("You feel your life fade away!");
#endif
- get_damage = take_hit(DAMAGE_ATTACK, dam, m_name, MS_HAND_DOOM);
+ get_damage = take_hit(DAMAGE_ATTACK, dam, m_name, monspell);
curse_equipment(40, 20);
if (p_ptr->chp < 1) p_ptr->chp = 1;
/*
- * Do disintegration effect on the terrain
- * before we decide the region of the effect.
- */
-static bool do_disintegration(int by, int bx, int y, int x)
-{
- byte feat;
-
- /* Disintegration balls explosions are stopped by perma-walls */
- if (!in_disintegration_range(by, bx, y, x)) return FALSE;
-
- /* Permanent walls and artifacts don't get effect */
- /* But not protect monsters and other objects */
- if (!cave_valid_bold(y, x)) return TRUE;
-
- /* Destroy mirror/glyph */
- remove_mirror(y,x);
-
- feat = cave[y][x].feat;
-
- if ((feat < FEAT_PATTERN_START || feat > FEAT_PATTERN_XTRA2) &&
- (feat < FEAT_DEEP_WATER || feat > FEAT_GRASS))
- {
- if (feat == FEAT_TREES || feat == FEAT_FLOWER || feat == FEAT_DEEP_GRASS)
- cave_set_feat(y, x, FEAT_GRASS);
- else
- cave_set_feat(y, x, floor_type[randint0(100)]);
- }
-
- /* Update some things -- similar to GF_KILL_WALL */
- p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
-
- return TRUE;
-}
-
-
-/*
* breath shape
*/
-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, bool disint_ball, bool real_breath)
+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)
{
int by = y1;
int bx = x1;
int bdis = 0;
int cdis;
int path_n = 0;
- int tdis = distance(y1, x1, y2, x2);
- int mdis = tdis + rad;
+ int mdis = distance(y1, x1, y2, x2) + rad;
while (bdis <= mdis)
{
/* Enforce an arc */
if (distance(by, bx, y, x) != cdis) continue;
-
- if (disint_ball)
+ switch (typ)
{
- /* Disintegration are stopped only by perma-walls */
- if (real_breath)
- {
- /* Destroy terrains */
- if (!do_disintegration(by, bx, y, x)) continue;
- }
- else
- {
- /* No actual disintegration */
- if (!in_disintegration_range(by, bx, y, x)) continue;
- }
- }
- else
- {
- /* The blast is stopped by walls */
+ case GF_LITE:
+ case GF_LITE_WEAK:
+ /* Lights are stopped by opaque terrains */
if (!los(by, bx, y, x)) continue;
+ break;
+ case GF_DISINTEGRATE:
+ /* Disintegration are stopped only by perma-walls */
+ if (!in_disintegration_range(by, bx, y, x)) continue;
+ break;
+ default:
+ /* Ball explosions are stopped by walls */
+ if (!projectable(by, bx, y, x)) continue;
+ break;
}
/* Save this grid */
monster_target_y=py;
monster_target_x=px;
- /* Initialize with nul string */
- who_name[0] = '\0';
-
/* Hack -- Jump to target */
if (flg & (PROJECT_JUMP))
{
grids++;
}
- if (breath && typ == GF_DISINTEGRATE)
+ switch (typ)
{
- flg |= (PROJECT_DISI);
+ case GF_LITE:
+ case GF_LITE_WEAK:
+ if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_LOS);
+ break;
+ case GF_DISINTEGRATE:
+ flg |= (PROJECT_GRID);
+ if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_DISI);
+ break;
}
/* Calculate the projection path */
}
}
if(project_o(0,0,y,x,dam,GF_SUPER_RAY) )notice=TRUE;
- if( cave[y][x].feat == FEAT_RUBBLE ||
- cave[y][x].feat == FEAT_DOOR_HEAD ||
- cave[y][x].feat == FEAT_DOOR_TAIL ||
- (cave[y][x].feat >= FEAT_WALL_EXTRA &&
- cave[y][x].feat <= FEAT_PERM_SOLID ))
+ if (!have_flag(f_flags_bold(y, x), FF_PROJECT))
{
if( second_step )continue;
break;
/* Hack -- Balls explode before reaching walls */
if (cave_stop_disintegration(ny, nx) && (rad > 0)) break;
}
+ else if (flg & PROJECT_LOS)
+ {
+ /* Hack -- Balls explode before reaching walls */
+ if (!cave_los_bold(ny, nx) && (rad > 0)) break;
+ }
else
{
/* Hack -- Balls explode before reaching walls */
- if (!cave_floor_bold(ny, nx) && (rad > 0)) break;
+ if (!have_flag(f_flags_bold(ny, nx), FF_PROJECT) && (rad > 0)) break;
}
/* Advance */
}
/* Only do visuals if requested */
- if (!blind && !(flg & (PROJECT_HIDE)) && !(flg & PROJECT_FAST))
+ if (!blind && !(flg & (PROJECT_HIDE | PROJECT_FAST)))
{
/* Only do visuals if the player can "see" the bolt */
if (panel_contains(y, x) && player_has_los_bold(y, x))
}
}
+ path_n = i;
+
/* Save the "blast epicenter" */
by = y;
bx = x;
- if (breath && (y1 == by) && (x1 == bx))
+ if (breath && !path_n)
{
breath = FALSE;
- gm_rad = 1;
+ gm_rad = rad;
if (!old_hide)
{
flg &= ~(PROJECT_HIDE);
{
flg &= ~(PROJECT_HIDE);
- breath_shape(path_g, dist, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, by, bx, (bool)(typ == GF_DISINTEGRATE), TRUE);
+ breath_shape(path_g, dist, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, by, bx, typ);
}
else
{
/* Enforce a "circular" explosion */
if (distance(by, bx, y, x) != dist) continue;
- if (typ == GF_DISINTEGRATE)
+ switch (typ)
{
+ case GF_LITE:
+ case GF_LITE_WEAK:
+ /* Lights are stopped by opaque terrains */
+ if (!los(by, bx, y, x)) continue;
+ break;
+ case GF_DISINTEGRATE:
/* Disintegration are stopped only by perma-walls */
- if (!do_disintegration(by, bx, y, x)) continue;
- }
- else
- {
+ if (!in_disintegration_range(by, bx, y, x)) continue;
+ break;
+ default:
/* Ball explosions are stopped by walls */
- if (!los(by, bx, y, x)) continue;
+ if (!projectable(by, bx, y, x)) continue;
+ break;
}
/* Save this grid */
}
}
+ /* Update stuff if needed */
+ if (p_ptr->update) update_stuff();
/* Check objects */
if (flg & (PROJECT_ITEM))
t_x = x_saver - 1 + randint1(3);
max_attempts--;
}
- while (max_attempts && in_bounds2u(t_y, t_x) &&
- !(los(y, x, t_y, t_x)));
+ while (max_attempts && in_bounds2u(t_y, t_x) && !projectable(y, x, t_y, t_x));
if (max_attempts < 1)
{
}
/* Reflected bolts randomly target either one */
- flg &= ~(PROJECT_MONSTER | PROJECT_PLAYER);
- if (one_in_(2)) flg |= PROJECT_MONSTER;
- else flg |= PROJECT_PLAYER;
+ if (one_in_(2)) flg |= PROJECT_PLAYER;
+ else flg &= ~(PROJECT_PLAYER);
/* The bolt is reflected */
project(cave[y][x].m_idx, 0, t_y, t_x, dam, typ, flg, monspell);
/* Aimed on the player */
if (flg & PROJECT_PLAYER)
{
- if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE))
+ if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
{
/*
* A beam or bolt is well aimed
/*
* This grid is the original target.
+ * Or aimed on your horse.
*/
- else if ((y == y2) || (x == x2))
+ else if (((y == y2) && (x == x2)) || (flg & PROJECT_AIMED))
{
/* Hit the mount with full damage */
}
else
{
/* Hit the player later */
- flg &= ~(PROJECT_MONSTER);
flg |= PROJECT_PLAYER;
-
+
/* Don't affect the mount */
continue;
}
*
* But already choosen to hit the
* mount at this point.
+ *
+ * Or aimed on your horse.
*/
- else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE))
+ else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE | PROJECT_AIMED))
{
/*
* A beam or bolt is well aimed
if( is_mirror_grid(&cave[y][x]) &&
distance(py,px,y,x) <= MAX_RANGE &&
distance(py,px,y,x) != 0 &&
- player_has_los_bold(y,x)
+ player_has_los_bold(y,x) &&
+ projectable(py, px, y, x)
){
mirror_y[mirror_num]=y;
mirror_x[mirror_num]=x;
centersign*( (point_x[2]-x)*(point_y[0]-y)
-(point_y[2]-y)*(point_x[0]-x)) >=0 )
{
- if( player_has_los_bold(y,x)){
+ if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
/* Visual effects */
if(!(p_ptr->blind)
&& panel_contains(y,x)){
centersign*( (point_x[2]-x)*(point_y[0]-y)
-(point_y[2]-y)*(point_x[0]-x)) >=0 )
{
- if( player_has_los_bold(y,x)){
+ if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
(void)project_f(0,0,y,x,dam,GF_MANA);
}
}
centersign*( (point_x[2]-x)*(point_y[0]-y)
-(point_y[2]-y)*(point_x[0]-x)) >=0 )
{
- if( player_has_los_bold(y,x)){
+ if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
(void)project_o(0,0,y,x,dam,GF_MANA);
}
}
centersign*( (point_x[2]-x)*(point_y[0]-y)
-(point_y[2]-y)*(point_x[0]-x)) >=0 )
{
- if( player_has_los_bold(y,x) ){
+ if (player_has_los_bold(y, x) && projectable(py, px, y, x)) {
(void)project_m(0,0,y,x,dam,GF_MANA,
(PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP));
}