|
|
@ -11,6 +11,8 @@ draw_bomb (_bomb * bomb)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
SDL_Rect src,
|
|
|
|
SDL_Rect src,
|
|
|
|
dest;
|
|
|
|
dest;
|
|
|
|
|
|
|
|
int x=bomb->pos.x >> 8,
|
|
|
|
|
|
|
|
y= bomb->pos.y >> 8;
|
|
|
|
|
|
|
|
|
|
|
|
if (bomb->state != BS_trigger) {
|
|
|
|
if (bomb->state != BS_trigger) {
|
|
|
|
/* check the framenumber */
|
|
|
|
/* check the framenumber */
|
|
|
@ -26,12 +28,12 @@ draw_bomb (_bomb * bomb)
|
|
|
|
dest.w = src.w = gfx.bomb.image->w;
|
|
|
|
dest.w = src.w = gfx.bomb.image->w;
|
|
|
|
dest.h = src.h = gfx.block.y;
|
|
|
|
dest.h = src.h = gfx.block.y;
|
|
|
|
|
|
|
|
|
|
|
|
dest.x = gfx.offset.x + (bomb->pos.x * gfx.block.x);
|
|
|
|
dest.x = gfx.offset.x + (x* gfx.block.x);
|
|
|
|
dest.y = gfx.offset.y + (bomb->pos.y * gfx.block.y);
|
|
|
|
dest.y = gfx.offset.y + (y* gfx.block.y);
|
|
|
|
|
|
|
|
|
|
|
|
src.x = 0;
|
|
|
|
src.x = 0;
|
|
|
|
src.y = src.h * bomb->frame;
|
|
|
|
src.y = src.h * bomb->frame;
|
|
|
|
draw_stone (bomb->pos.x, bomb->pos.y);
|
|
|
|
draw_stone (x, y);
|
|
|
|
SDL_BlitSurface (gfx.bomb.image, &src, gfx.screen, &dest);
|
|
|
|
SDL_BlitSurface (gfx.bomb.image, &src, gfx.screen, &dest);
|
|
|
|
|
|
|
|
|
|
|
|
gfx_AddUpdateRect (dest.x, dest.y, dest.w, dest.h);
|
|
|
|
gfx_AddUpdateRect (dest.x, dest.y, dest.w, dest.h);
|
|
|
@ -55,6 +57,8 @@ bomb_explode (int p, int b, int net)
|
|
|
|
bomb->firer[d] = 0;
|
|
|
|
bomb->firer[d] = 0;
|
|
|
|
bomb->firerst[d] = -1;
|
|
|
|
bomb->firerst[d] = -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bomb->pos.x=bomb->pos.x>>8;
|
|
|
|
|
|
|
|
bomb->pos.y=bomb->pos.y>>8;
|
|
|
|
|
|
|
|
|
|
|
|
if (GT_MP_PTPM && net) /* from now on only the server let the bomb explode */
|
|
|
|
if (GT_MP_PTPM && net) /* from now on only the server let the bomb explode */
|
|
|
|
net_game_send_bomb (p, b);
|
|
|
|
net_game_send_bomb (p, b);
|
|
|
@ -131,7 +135,7 @@ get_bomb_on (int x, int y, _point bombs[])
|
|
|
|
for (b = 0; b < MAX_BOMBS; b++) {
|
|
|
|
for (b = 0; b < MAX_BOMBS; b++) {
|
|
|
|
bomb = &bman.players[p].bombs[b];
|
|
|
|
bomb = &bman.players[p].bombs[b];
|
|
|
|
if (bomb->state == BS_ticking || bomb->state==BS_trigger) {
|
|
|
|
if (bomb->state == BS_ticking || bomb->state==BS_trigger) {
|
|
|
|
if (bomb->pos.x == x && bomb->pos.y == y) {
|
|
|
|
if (bomb->pos.x >>8 == x && bomb->pos.y>>8 == y) {
|
|
|
|
bombs[i].x = p;
|
|
|
|
bombs[i].x = p;
|
|
|
|
bombs[i].y = b;
|
|
|
|
bombs[i].y = b;
|
|
|
|
i++;
|
|
|
|
i++;
|
|
|
@ -241,7 +245,7 @@ restore_explosion (_bomb * bomb)
|
|
|
|
gfx.block.x * (bomb->firer[up] + bomb->firer[down] + 1));
|
|
|
|
gfx.block.x * (bomb->firer[up] + bomb->firer[down] + 1));
|
|
|
|
|
|
|
|
|
|
|
|
/* delete field from the bfield map */
|
|
|
|
/* delete field from the bfield map */
|
|
|
|
bman.bfield[bomb->pos.x][bomb->pos.y] = 0;
|
|
|
|
bman.bfield[bomb->pos.x ][bomb->pos.y] = 0;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -390,7 +394,7 @@ do_explosion (int p, int b)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
else {
|
|
|
|
bomb->firerst[d] = bomb->firer[d];
|
|
|
|
bomb->firerst[d] = bomb->firer[d];
|
|
|
|
draw_stone (bomb->pos.x + dx, bomb->pos.y + dy);
|
|
|
|
draw_stone (bomb->pos.x + dx, bomb->pos.y + dy);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|