|
|
|
@ -60,7 +60,6 @@ restore_players_screen ()
|
|
|
|
|
x,
|
|
|
|
|
xs,
|
|
|
|
|
xe,
|
|
|
|
|
|
|
|
|
|
y,
|
|
|
|
|
ys,
|
|
|
|
|
ye;
|
|
|
|
@ -91,7 +90,8 @@ restore_players_screen ()
|
|
|
|
|
for (y = ys; y <= ye; y++)
|
|
|
|
|
draw_stone (x, y);
|
|
|
|
|
|
|
|
|
|
gfx_AddUpdateRect(xs*gfx.block.x+gfx.offset.x,ys*gfx.block.y+gfx.offset.y,gfx.block.x*3,gfx.block.y*3);
|
|
|
|
|
gfx_AddUpdateRect (xs * gfx.block.x + gfx.offset.x, ys * gfx.block.y + gfx.offset.y,
|
|
|
|
|
gfx.block.x * 3, gfx.block.y * 3);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
@ -104,7 +104,8 @@ player_check_powerup (_player * p)
|
|
|
|
|
int fy = p->pos.y >> 8;
|
|
|
|
|
int _x = p->pos.x & 255;
|
|
|
|
|
int _y = p->pos.y & 255;
|
|
|
|
|
int ft,i;
|
|
|
|
|
int ft,
|
|
|
|
|
i;
|
|
|
|
|
|
|
|
|
|
/* Get the right field position */
|
|
|
|
|
if (_x > 128)
|
|
|
|
@ -118,20 +119,30 @@ player_check_powerup (_player * p)
|
|
|
|
|
if (ft == FT_mixed) {
|
|
|
|
|
i = s_random (6);
|
|
|
|
|
switch (i) {
|
|
|
|
|
case 0:ft=FT_bomb;break;
|
|
|
|
|
case 1:ft=FT_fire;break;
|
|
|
|
|
case 2:ft=FT_shoe;break;
|
|
|
|
|
case 0:
|
|
|
|
|
ft = FT_bomb;
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
ft = FT_fire;
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
ft = FT_shoe;
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
case 4:
|
|
|
|
|
case 5:ft=FT_death;break;
|
|
|
|
|
case 5:
|
|
|
|
|
ft = FT_death;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch (ft) {
|
|
|
|
|
/* we found a bomb powerup */
|
|
|
|
|
case FT_bomb:
|
|
|
|
|
if (p->bombs_n < MAX_BOMBS && p->ill[PI_nobomb].to <= 0)
|
|
|
|
|
{p->bombs_n++;bman.updatestatusbar=1;}
|
|
|
|
|
if (p->bombs_n < MAX_BOMBS && p->ill[PI_nobomb].to <= 0) {
|
|
|
|
|
p->bombs_n++;
|
|
|
|
|
bman.updatestatusbar = 1;
|
|
|
|
|
}
|
|
|
|
|
bman.field[fx][fy].type = FT_nothing;
|
|
|
|
|
if (bman.gametype != GT_single)
|
|
|
|
|
net_game_send_field (fx, fy);
|
|
|
|
@ -139,8 +150,10 @@ player_check_powerup (_player * p)
|
|
|
|
|
|
|
|
|
|
/* we found a fire powerup */
|
|
|
|
|
case FT_fire:
|
|
|
|
|
if (p->range < MAX_RANGE && p->ill[PI_range].to <= 0)
|
|
|
|
|
{p->range++;bman.updatestatusbar=1;}
|
|
|
|
|
if (p->range < MAX_RANGE && p->ill[PI_range].to <= 0) {
|
|
|
|
|
p->range++;
|
|
|
|
|
bman.updatestatusbar = 1;
|
|
|
|
|
}
|
|
|
|
|
bman.field[fx][fy].type = FT_nothing;
|
|
|
|
|
if (bman.gametype != GT_single)
|
|
|
|
|
net_game_send_field (fx, fy);
|
|
|
|
@ -148,8 +161,10 @@ player_check_powerup (_player * p)
|
|
|
|
|
|
|
|
|
|
/* we found a shoe powerup */
|
|
|
|
|
case FT_shoe:
|
|
|
|
|
if (p->speed < MAX_SPEED && p->ill[PI_slow].to <= 0)
|
|
|
|
|
{p->speed *= SPEEDMUL;bman.updatestatusbar=1;}
|
|
|
|
|
if (p->speed < MAX_SPEED && p->ill[PI_slow].to <= 0) {
|
|
|
|
|
p->speed *= SPEEDMUL;
|
|
|
|
|
bman.updatestatusbar = 1;
|
|
|
|
|
}
|
|
|
|
|
bman.field[fx][fy].type = FT_nothing;
|
|
|
|
|
if (bman.gametype != GT_single)
|
|
|
|
|
net_game_send_field (fx, fy);
|
|
|
|
@ -159,6 +174,7 @@ player_check_powerup (_player * p)
|
|
|
|
|
case FT_death:
|
|
|
|
|
player_set_ilness (p, -1);
|
|
|
|
|
bman.updatestatusbar = 1;
|
|
|
|
|
if (bman.gametype != GT_single)
|
|
|
|
|
net_game_send_ill (bman.p_nr);
|
|
|
|
|
|
|
|
|
|
bman.field[fx][fy].type = FT_nothing;
|
|
|
|
@ -389,6 +405,7 @@ player_died (_player * player, signed char dead_by)
|
|
|
|
|
player->state &= (0xFF - PSF_alife);
|
|
|
|
|
player->dead_by = dead_by;
|
|
|
|
|
|
|
|
|
|
if (GT_MP_PTP)
|
|
|
|
|
net_game_send_player (bman.p_nr);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -428,11 +445,14 @@ player_animation (_player * player)
|
|
|
|
|
int
|
|
|
|
|
dead_playerani ()
|
|
|
|
|
{
|
|
|
|
|
int i,b=0;
|
|
|
|
|
int i,
|
|
|
|
|
b = 0;
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < MAX_PLAYERS; i++)
|
|
|
|
|
if (PS_IS_dead (bman.players[i].state))
|
|
|
|
|
{player_animation (&bman.players[i]);b++;}
|
|
|
|
|
if (PS_IS_dead (bman.players[i].state)) {
|
|
|
|
|
player_animation (&bman.players[i]);
|
|
|
|
|
b++;
|
|
|
|
|
}
|
|
|
|
|
return b;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
@ -505,7 +525,7 @@ player_calcpos ()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
player_ilness_loop ()
|
|
|
|
|
player_ilness_loop (int pl_nr)
|
|
|
|
|
{
|
|
|
|
|
_player *p;
|
|
|
|
|
int type,
|
|
|
|
@ -516,8 +536,9 @@ player_ilness_loop ()
|
|
|
|
|
int pl[MAX_PLAYERS + 1];
|
|
|
|
|
|
|
|
|
|
/* do the illness for the network players */
|
|
|
|
|
if (GT_MP_PTP) {
|
|
|
|
|
for (pnr = 0; pnr < MAX_PLAYERS; pnr++)
|
|
|
|
|
if (pnr != bman.p_nr && PS_IS_alife (bman.players[pnr].state)) {
|
|
|
|
|
if (pnr != pl_nr && PS_IS_alife (bman.players[pnr].state)) {
|
|
|
|
|
p = &bman.players[pnr];
|
|
|
|
|
for (type = 0; type < PI_max; type++)
|
|
|
|
|
if (p->ill[type].to > 0) {
|
|
|
|
@ -531,13 +552,13 @@ player_ilness_loop ()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
/* check if we have contact with an other ill player */
|
|
|
|
|
p = &bman.players[bman.p_nr];
|
|
|
|
|
p = &bman.players[pl_nr];
|
|
|
|
|
|
|
|
|
|
get_player_on (p->pos.x, p->pos.y, pl);
|
|
|
|
|
for (i = 0; (pl[i] != -1 && i < MAX_PLAYERS); i++)
|
|
|
|
|
if (pl[i] != bman.p_nr) {
|
|
|
|
|
if (pl[i] != pl_nr) {
|
|
|
|
|
send = 0;
|
|
|
|
|
for (type = 0; type < PI_max; type++) {
|
|
|
|
|
if (bman.players[pl[i]].ill[type].to > p->ill[type].to) {
|
|
|
|
@ -548,11 +569,11 @@ player_ilness_loop ()
|
|
|
|
|
send = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (send != 0)
|
|
|
|
|
net_game_send_ill (bman.p_nr);
|
|
|
|
|
if (send != 0 && GT_MP_PTP)
|
|
|
|
|
net_game_send_ill (pl_nr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* do the illness for our own player */
|
|
|
|
|
/* do the illness for the givin player */
|
|
|
|
|
for (type = 0; type < PI_max; type++)
|
|
|
|
|
if (p->ill[type].to > 0) {
|
|
|
|
|
p->ill[type].to--;
|
|
|
|
@ -669,6 +690,7 @@ player_clear_ilness (_player * p, int type)
|
|
|
|
|
}
|
|
|
|
|
p->ill[type].to = 0;
|
|
|
|
|
|
|
|
|
|
if (bman.gametype != GT_single)
|
|
|
|
|
net_game_send_ill (bman.p_nr);
|
|
|
|
|
bman.updatestatusbar = 1;
|
|
|
|
|
};
|
|
|
|
|