/* Feature code */
feat = c_ptr->mimic ? c_ptr->mimic : c_ptr->feat;
+ feat = (c_ptr->info & CAVE_IN_MIRROR) ? FEAT_MIRROR : c_ptr->feat;
/* Floors (etc) */
if ((feat <= FEAT_INVIS) || (feat == FEAT_DIRT) || (feat == FEAT_GRASS))
lite_spot(y, x);
}
+/* Remove a mirror */
+void remove_mirror(int y, int x)
+{
+ /* Remove the mirror */
+ cave[y][x].info &= ~(CAVE_IN_MIRROR);
+
+ /* Notice */
+ note_spot(y, x);
+ /* Redraw */
+ lite_spot(y, x);
+}
/*
* Calculate "incremental motion". Used by project() and shoot().
#define CAVE_MASK (CAVE_FLOOR | CAVE_EXTRA | CAVE_INNER | CAVE_OUTER | CAVE_SOLID | CAVE_VAULT)
/* Used only after cave generation */
+#define CAVE_XXXX1 0x0200
+#define CAVE_XXXX2 0x0400
+#define CAVE_XXXX3 0x0800
+#define CAVE_IN_MIRROR 0x1000 /* mirror */
#define CAVE_UNSAFE 0x2000 /* Might have trap */
#define CAVE_IN_DETECT 0x4000 /* trap detected area (inner circle only) */
(cave[Y][X].feat == FEAT_GRASS) || \
(cave[Y][X].feat == FEAT_DIRT)) && \
!(cave[Y][X].info & CAVE_TRAP) && \
+ !(cave[Y][X].info & CAVE_IN_MIRROR) && \
(cave[Y][X].o_idx == 0))
extern void wiz_lite(bool wizard, bool ninja);
extern void wiz_dark(void);
extern void cave_set_feat(int y, int x, int feat);
+extern void remove_mirror(int y, int x);
extern void mmove2(int *y, int *x, int y1, int x1, int y2, int x2);
extern bool projectable(int y1, int x1, int y2, int x2);
extern void scatter(int *yp, int *xp, int y, int x, int d, int mode);
alive = FALSE;
}
}
- if( cave[py][px].feat == FEAT_MIRROR ){
+ if( (cave[py][px].info & CAVE_IN_MIRROR)){
teleport_player(10);
}
}
int val=0;
for( x=0 ; x < cur_wid ; x++ ){
for( y=0 ; y < cur_hgt ; y++ ){
- if( cave[y][x].feat == FEAT_MIRROR )val++;
+ if( (cave[y][x].info & CAVE_IN_MIRROR) )val++;
}
}
return val;
{
/* mirror of seeing */
case 0:
- tmp = cave[py][px].feat == FEAT_MIRROR ? 4 : 0;
+ tmp = (cave[py][px].info & CAVE_IN_MIRROR) ? 4 : 0;
if( plev + tmp > 4)detect_monsters_normal(DETECT_RAD_DEFAULT);
if( plev + tmp > 18 )detect_monsters_invis(DETECT_RAD_DEFAULT);
if( plev + tmp > 28 )set_tim_esp(plev,FALSE);
break;
case 2:
if (!get_aim_dir(&dir)) return FALSE;
- if ( plev > 9 && cave[py][px].feat == FEAT_MIRROR ){
+ if ( plev > 9 && (cave[py][px].info & CAVE_IN_MIRROR) ){
fire_beam(GF_LITE, dir,damroll(3+((plev-1)/5),4));
}
else {
case 9:
for(x=0;x<cur_wid;x++){
for(y=0;y<cur_hgt;y++){
- if(cave[y][x].feat == FEAT_MIRROR){
+ if(cave[y][x].info & CAVE_IN_MIRROR){
project(0,2,y,x,plev,GF_OLD_SLEEP,(PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP|PROJECT_NO_REF|PROJECT_NO_HANGEKI),-1);
}
}
break;
/* illusion light */
case 14:
- tmp = cave[py][px].feat == FEAT_MIRROR ? 4 : 3;
+ tmp = (cave[py][px].feat & CAVE_IN_MIRROR) ? 4 : 3;
slow_monsters();
stun_monsters(plev*tmp);
confuse_monsters(plev*tmp);
break;
/* mirror shift */
case 15:
- if( cave[py][px].feat != FEAT_MIRROR ){
+ if( !(cave[py][px].info & CAVE_IN_MIRROR) ){
#ifdef JP
msg_print("¶À¤Î¹ñ¤Î¾ì½ê¤¬¤ï¤«¤é¤Ê¤¤¡ª");
#else
break;
case MIND_MIRROR_MASTER:
/* Cast the spell */
- if( cave[py][px].feat == FEAT_MIRROR )on_mirror = TRUE;
+ if( (cave[py][px].info & CAVE_IN_MIRROR) )on_mirror = TRUE;
cast = cast_mirror_spell(n);
break;
case MIND_NINJUTSU:
(c_ptr->feat != FEAT_DEEP_GRASS) &&
(c_ptr->feat != FEAT_SHAL_LAVA) &&
(c_ptr->feat != FEAT_TREES)) continue;
-
- if (c_ptr->info & CAVE_TRAP) continue;
+ if (c_ptr->info & (CAVE_TRAP | CAVE_IN_MIRROR)) continue;
/* No objects */
k = 0;
int x,y;
for( x=0 ; x < cur_wid ;x++){
for( y=0 ; y < cur_hgt ;y++){
- if( cave[y][x].feat == FEAT_MIRROR){
- cave_set_feat( y , x , FEAT_FLOOR );
+ if( (cave[y][x].info & CAVE_IN_MIRROR)){
+ 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_REF|PROJECT_NO_HANGEKI),-1);
}
}
return FALSE;
}
if (racial_aux(30, 0, A_INT, 20)){
- if( cave[py][px].feat == FEAT_MIRROR)
+ if( (cave[py][px].info & CAVE_IN_MIRROR))
{
#ifdef JP
msg_print("¾¯¤·Æ¬¤¬¥Ï¥Ã¥¥ê¤·¤¿¡£");
{
for( y=0 ; y < cur_hgt ; y++ )
{
- if( cave[y][x].feat == FEAT_MIRROR ){
+ if( (cave[y][x].info & CAVE_IN_MIRROR)){
mirror_y[mirror_num]=y;
mirror_x[mirror_num]=x;
mirror_num++;
case GF_SHARDS:
case GF_ROCKET:
{
- if( cave[y][x].feat == FEAT_MIRROR )
+ if( (cave[y][x].info & CAVE_IN_MIRROR))
{
#ifdef JP
msg_print("¶À¤¬³ä¤ì¤¿¡ª");
#else
msg_print("The mirror was chashed!");
#endif
- cave_set_feat(y,x, FEAT_FLOOR);
+ 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_REF|PROJECT_NO_HANGEKI),-1);
}
break;
}
case GF_SOUND:
{
- if( cave[y][x].feat == FEAT_MIRROR && p_ptr->lev < 40 )
+ if( (cave[y][x].info & CAVE_IN_MIRROR) && p_ptr->lev < 40 )
{
#ifdef JP
msg_print("¶À¤¬³ä¤ì¤¿¡ª");
}
}
if(project_o(0,0,y,x,dam,GF_SEEKER))notice=TRUE;
- if( cave[y][x].feat == FEAT_MIRROR )
+ if( (cave[y][x].info & CAVE_IN_MIRROR))
{
/* The target of monsterspell becomes tha mirror(broken) */
monster_target_y=(s16b)y;
monster_target_x=(s16b)x;
- cave_set_feat( y, x , FEAT_FLOOR );
+ remove_mirror(y,x);
next_mirror( &oy,&ox );
path_n = i+project_path(&(path_g[i+1]), (project_length ? project_length : MAX_RANGE), y, x, oy, ox, flg);
if( second_step )continue;
break;
}
- if( cave[y][x].feat == FEAT_MIRROR && !second_step )
+ if( (cave[y][x].info & CAVE_IN_MIRROR) && !second_step )
{
/* The target of monsterspell becomes tha mirror(broken) */
monster_target_y=(s16b)y;
monster_target_x=(s16b)x;
- cave_set_feat( y, x , FEAT_FLOOR );
+ remove_mirror(y,x);
for( j = 0; j <=i ; j++ )
{
y = GRID_Y(path_g[j]);
{
for( y=0 ; y < cur_hgt ; y++ )
{
- if( cave[y][x].feat == FEAT_MIRROR &&
+ if( (cave[y][x].info & CAVE_IN_MIRROR) &&
distance(py,px,y,x) <= MAX_RANGE &&
distance(py,px,y,x) != 0 &&
player_has_los_bold(y,x)
#else
msg_print("The field broke a mirror");
#endif
- cave_set_feat( point_y[0] , point_x[0] , FEAT_FLOOR );
+ remove_mirror(point_y[0],point_x[0]);
}
return TRUE;
{
for( y = 0 ; y < cur_hgt ; y++ )
{
- if( cave[y][x].feat == FEAT_MIRROR )
+ if( (cave[y][x].info & CAVE_IN_MIRROR))
{
if(project_m(0,0,y,x,dam,GF_GENOCIDE,
(PROJECT_GRID|PROJECT_ITEM|PROJECT_KILL|PROJECT_JUMP|PROJECT_NO_REF)))
{
if( !cave[y][x].m_idx )
{
- cave_set_feat( y,x, FEAT_FLOOR );
+ remove_mirror(y,x);
}
}
}
return FALSE;
}
- /* Create a glyph */
- cave_set_feat(py, px, FEAT_MIRROR);
+ /* Create a mirror */
+ cave[py][px].info |= CAVE_IN_MIRROR;
note_spot(py, px);
lite_spot(py, px);
/* Notice glyphs */
if (c_ptr->feat == FEAT_GLYPH) return (TRUE);
if (c_ptr->feat == FEAT_MINOR_GLYPH) return (TRUE);
- if (c_ptr->feat == FEAT_MIRROR) return (TRUE);
+ if ((c_ptr->info & CAVE_IN_MIRROR)) return (TRUE);
/* Notice the Pattern */
if ((c_ptr->feat <= FEAT_PATTERN_XTRA2) &&
name = "road";
#endif
}
+ else if ( (c_ptr->info & CAVE_IN_MIRROR) )
+ {
+#ifdef JP
+ name = "¶À";
+#else
+ name = "mirror";
+#endif
+ }
else
{
name = f_name + f_info[feat].name;