|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
/* $Id: bomb.c,v 1.42 2003/08/29 22:04:19 stpohle Exp $ */
|
|
|
|
|
/* $Id: bomb.c,v 1.43 2003/08/30 11:45:55 stpohle Exp $ */
|
|
|
|
|
/* everything what have to do with the bombs */
|
|
|
|
|
|
|
|
|
|
#include "bomberclone.h"
|
|
|
|
@ -29,6 +29,7 @@ draw_bomb (_bomb * bomb)
|
|
|
|
|
bomb->frameto = ANI_BOMBTIMEOUT;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dest.w = src.w = gfx.bomb.image->w;
|
|
|
|
|
dest.h = src.h = gfx.block.y;
|
|
|
|
|
dest.x = gfx.offset.x + (x >> 8) * gfx.block.x + gfx.postab[bomb->pos.x & 0x0FF];
|
|
|
|
@ -129,11 +130,35 @@ bomb_move (_bomb * bomb)
|
|
|
|
|
|
|
|
|
|
if (map.bfield[d.x][d.y] == 0 && (map.field[d.x][d.y].type == FT_nothing || map.field[d.x][d.y].type == FT_tunnel)) {
|
|
|
|
|
/* this direction is still oky */
|
|
|
|
|
map.bfield[d.x][d.y]++;
|
|
|
|
|
map.bfield[b.x][b.y]--;
|
|
|
|
|
map.bfield[d.x][d.y] = 1;
|
|
|
|
|
map.bfield[b.x][b.y] = 0;
|
|
|
|
|
keepdir = 1;
|
|
|
|
|
}
|
|
|
|
|
else if (bomb->mode == BM_liquid) {
|
|
|
|
|
/* liquid bomb so move to the other side */
|
|
|
|
|
keepdir = 0;
|
|
|
|
|
bomb->dest.x = -bomb->dest.x;
|
|
|
|
|
bomb->dest.y = -bomb->dest.y;
|
|
|
|
|
map.bfield[b.x][b.y] = 0;
|
|
|
|
|
map.bfield[b.x+bomb->dest.x][b.y+bomb->dest.y] = 1;
|
|
|
|
|
|
|
|
|
|
/* if a network game is running send bomb data with the
|
|
|
|
|
current information */
|
|
|
|
|
if (GT_MP_PTP) {
|
|
|
|
|
int b = -1, i = 0;
|
|
|
|
|
|
|
|
|
|
do {
|
|
|
|
|
if (&bman.players[bman.p_nr].bombs[i] == bomb)
|
|
|
|
|
b = i;
|
|
|
|
|
i++;
|
|
|
|
|
} while (b == -1 && i < MAX_BOMBS);
|
|
|
|
|
|
|
|
|
|
if (b != -1)
|
|
|
|
|
net_game_send_bomb (bman.p_nr, b);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
/* stop moving this bomb */
|
|
|
|
|
keepdir = 0;
|
|
|
|
|
bomb->mode = BM_normal;
|
|
|
|
|
}
|
|
|
|
@ -332,8 +357,8 @@ restore_explosion (_bomb * bomb)
|
|
|
|
|
/* delete field from the bfield map */
|
|
|
|
|
if (bomb->mode == BM_moving || bomb->mode == BM_pushed || bomb->mode == BM_liquid)
|
|
|
|
|
map.bfield[bpos.x + bomb->dest.x][bpos.y + bomb->dest.y] = 0;
|
|
|
|
|
else
|
|
|
|
|
map.bfield[bpos.x][bpos.y] = 0;
|
|
|
|
|
|
|
|
|
|
map.bfield[bpos.x][bpos.y] = 0;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|