From 9bb8c5828d13f9de50133bff40f3cfd3300b3c5e Mon Sep 17 00:00:00 2001 From: nothere Date: Mon, 1 Dec 2003 13:00:43 +0000 Subject: [PATCH] =?utf8?q?=E5=88=86=E8=A7=A3=E5=B1=9E=E6=80=A7=E3=81=AE?= =?utf8?q?=E5=9C=B0=E5=BD=A2=E7=A0=B4=E5=A3=8A=E3=82=92project=5Ff()?= =?utf8?q?=E3=81=A7=E8=A6=8B=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E5=A4=89?= =?utf8?q?=E6=9B=B4.=20=E3=81=BE=E3=81=9F,=20=E5=88=86=E8=A7=A3=E5=B1=9E?= =?utf8?q?=E6=80=A7=E3=81=AE=E3=83=93=E3=83=BC=20=E3=83=A0=E3=81=A7?= =?utf8?q?=E3=81=82=E3=82=8B=E5=A0=B4=E5=90=88=E3=81=AFPROJECT=5FDISI?= =?utf8?q?=E3=82=92=E6=9C=89=E5=8A=B9=E3=81=AB=E3=81=99=E3=82=8B=E3=82=88?= =?utf8?q?=E3=81=86=E3=81=AB=E5=A4=89=E6=9B=B4.=20=E3=81=93=E3=82=8C?= =?utf8?q?=E3=81=AB=E3=82=88=E3=82=8A,=20=E3=82=AB=E3=82=AA=E3=82=B9=20?= =?utf8?q?=E9=AD=94=E6=B3=95=20"=E6=B7=B7=E6=B2=8C=E5=8F=AC=E6=9D=A5"=20?= =?utf8?q?=E3=81=A7=E5=88=86=E8=A7=A3=E3=83=93=E3=83=BC=E3=83=A0=E3=81=8C?= =?utf8?q?=E5=87=BA=E3=81=9F=E5=A0=B4=E5=90=88=E3=81=AB=E4=B8=80=E5=88=97?= =?utf8?q?=E3=82=92=E7=A0=B4=E5=A3=8A=E3=81=99=E3=82=8B=E3=82=88=E3=81=86?= =?utf8?q?=E3=81=AB=E3=81=97=E3=81=9F.=20=E3=81=AA=20=E3=81=8A,=20?= =?utf8?q?=E4=BB=A5=E4=B8=8B=E3=81=AE=E5=A4=89=E6=9B=B4=E3=82=92=E5=90=AB?= =?utf8?q?=E3=82=80.=20*=20cave=5Fstop=5Fdisintegration()=E3=81=AE?= =?utf8?q?=E5=88=A4=E5=AE=9A=E3=81=AB!HURT=5FDISI=E3=81=8C=E3=81=AA?= =?utf8?q?=E3=81=8B=E3=81=A3=E3=81=9F=E3=81=AE=E3=81=A7=E4=BF=AE=E6=AD=A3.?= =?utf8?q?=20*=20breath=5Fshape=E3=81=8B=E3=82=89=E5=A4=89=E6=95=B0real=5F?= =?utf8?q?breath=E5=89=8A=E9=99=A4.=20*=20=E5=88=86=E8=A7=A3=E5=B1=9E?= =?utf8?q?=E6=80=A7=E3=81=AF=E5=9C=B0=E5=BD=A2=E3=81=8C=E7=A0=B4=E5=A3=8A?= =?utf8?q?=E3=81=95=E3=82=8C=E3=81=A6=E5=BD=93=E7=84=B6=E3=81=AE=E5=B1=9E?= =?utf8?q?=E6=80=A7=E3=81=A7=E3=81=82=E3=82=8A,=20PROJECT=5FGRID=E3=82=92?= =?utf8?q?=E5=86=85=E9=83=A8=E3=81=A7=E5=BF=85=20=20=20=E3=81=9A=E7=AB=8B?= =?utf8?q?=E3=81=A6=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=81=9F.?= =?utf8?q?=20*=20do=5Fdisintegration()=E5=89=8A=E9=99=A4.=20*=20=E5=88=86?= =?utf8?q?=E8=A7=A3=E3=81=AB=E9=99=90=E3=82=89=E3=81=9A=E5=9C=B0=E5=BD=A2?= =?utf8?q?=E3=81=8C=E7=A0=B4=E5=A3=8A=E3=81=95=E3=82=8C=E3=81=9F=E5=BE=8C?= =?utf8?q?=E3=81=AB=E3=81=AF=E8=A6=96=E7=95=8C=E3=81=8C=E5=A4=89=E3=82=8F?= =?utf8?q?=E3=82=8B=E5=8F=AF=E8=83=BD=E6=80=A7=E3=81=8C=E3=81=82=E3=82=8B?= =?utf8?q?=E3=81=9F=E3=82=81,=20=E5=BF=85=20=20=20=E8=A6=81=E3=81=A7?= =?utf8?q?=E3=81=82=E3=82=8C=E3=81=B0=E3=82=A2=E3=82=A4=E3=83=86=E3=83=A0?= =?utf8?q?=E5=87=A6=E7=90=86=E3=81=AE=E7=9B=B4=E5=89=8D=E3=81=ABupdate=5Fs?= =?utf8?q?tuff()=E3=82=92=E5=91=BC=E3=81=B6=E3=82=88=E3=81=86=E3=81=AB?= =?utf8?q?=E3=81=97=E3=81=9F.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/defines.h | 3 ++- src/externs.h | 2 +- src/mspells2.c | 2 +- src/spells1.c | 72 +++++++++++++++++++++------------------------------------- 4 files changed, 30 insertions(+), 49 deletions(-) diff --git a/src/defines.h b/src/defines.h index 113d15a17..05697efe3 100644 --- a/src/defines.h +++ b/src/defines.h @@ -4425,7 +4425,8 @@ */ #define cave_stop_disintegration(Y,X) \ (!have_flag(f_flags_bold((Y), (X)), FF_PROJECT) && \ - have_flag(f_flags_bold((Y), (X)), FF_PERMANENT)) + (!have_flag(f_flags_bold((Y), (X)), FF_HURT_DISI) || \ + have_flag(f_flags_bold((Y), (X)), FF_PERMANENT))) /* diff --git a/src/externs.h b/src/externs.h index 7f05edc21..270f763ca 100644 --- a/src/externs.h +++ b/src/externs.h @@ -1004,7 +1004,7 @@ extern bool save_floor(saved_floor_type *sf_ptr, u32b mode); /* spells1.c */ extern bool in_disintegration_range(int y1, int x1, int y2, int x2); -extern 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); +extern 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); extern int take_hit(int damage_type, int damage, cptr kb_str, int monspell); extern u16b bolt_pict(int y, int x, int ny, int nx, int typ); extern sint project_path(u16b *gp, int range, int y1, int x1, int y2, int x2, int flg); diff --git a/src/mspells2.c b/src/mspells2.c index 6d674e734..c5dbe72ac 100644 --- a/src/mspells2.c +++ b/src/mspells2.c @@ -131,7 +131,7 @@ static bool breath_direct(int y1, int x1, int y2, int x2, int rad, bool disint_b /* Check the projection path */ grid_n = project_path(grid_g, MAX_RANGE, y1, x1, y2, x2, disint_ball ? PROJECT_DISI : 0); - breath_shape(grid_g, grid_n, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, y2, x2, disint_ball, FALSE); + breath_shape(grid_g, grid_n, &grids, gx, gy, gm, &gm_rad, rad, y1, x1, y2, x2, disint_ball); for (i = 0; i < grids; i++) { diff --git a/src/spells1.c b/src/spells1.c index d1a034ca4..1771e41dd 100644 --- a/src/spells1.c +++ b/src/spells1.c @@ -686,7 +686,6 @@ static bool project_f(int who, int r, int y, int x, int dam, int 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: @@ -1109,6 +1108,23 @@ static bool project_f(int who, int r, int y, int x, int dam, int typ) } 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; + } } lite_spot(y, x); @@ -7959,39 +7975,9 @@ bool in_disintegration_range(int y1, int x1, int y2, int x2) /* - * 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) -{ - feature_type *f_ptr; - - /* Disintegration balls explosions are stopped by perma-walls */ - if (!in_disintegration_range(by, bx, y, x)) return FALSE; - - /* Destroy mirror */ - if (is_mirror_grid(&cave[y][x])) remove_mirror(y, x); - - f_ptr = &f_info[cave[y][x].feat]; - - /* 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); - } - - 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, bool disint_ball) { int by = y1; int bx = x1; @@ -8043,16 +8029,7 @@ void breath_shape(u16b *path_g, int dist, int *pgrids, byte *gx, byte *gy, byte if (disint_ball) { /* 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; - } + if (!in_disintegration_range(by, bx, y, x)) continue; } else { @@ -8367,9 +8344,10 @@ bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int mons grids++; } - if (breath && typ == GF_DISINTEGRATE) + if (typ == GF_DISINTEGRATE) { - flg |= (PROJECT_DISI); + flg |= (PROJECT_GRID); + if (breath || (flg & PROJECT_BEAM)) flg |= (PROJECT_DISI); } /* Calculate the projection path */ @@ -8773,7 +8751,7 @@ bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int mons { 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, (bool)(typ == GF_DISINTEGRATE)); } else { @@ -8794,7 +8772,7 @@ bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int mons if (typ == GF_DISINTEGRATE) { /* Disintegration are stopped only by perma-walls */ - if (!do_disintegration(by, bx, y, x)) continue; + if (!in_disintegration_range(by, bx, y, x)) continue; } else { @@ -8929,6 +8907,8 @@ bool project(int who, int rad, int y, int x, int dam, int typ, int flg, int mons } } + /* Update stuff if needed */ + if (p_ptr->update) update_stuff(); /* Check objects */ if (flg & (PROJECT_ITEM)) -- 2.11.0