|
|
|
@ -311,7 +311,7 @@ stepmove_player (int pl_nr)
|
|
|
|
|
|
|
|
|
|
/* check if we can go though a tunnel */
|
|
|
|
|
if (_pos.x == 0.0f && _pos.y == 0.0f && map.field[(int)p->pos.x][(int)p->pos.y].type == FT_tunnel
|
|
|
|
|
&& p->tunnelto == -1) {
|
|
|
|
|
&& p->tunnelto <= 0.0f) {
|
|
|
|
|
d_printf ("Tunnel [%d] Player %s is going to (%d,%d)\n",
|
|
|
|
|
map.field[(int)p->pos.x][(int)p->pos.y].special, p->name,
|
|
|
|
|
map.tunnel[map.field[(int)p->pos.x][(int)p->pos.y].special].x,
|
|
|
|
@ -322,8 +322,8 @@ stepmove_player (int pl_nr)
|
|
|
|
|
[map.tunnel[map.field[(int)p->pos.x][(int)p->pos.y].special].y])
|
|
|
|
|
d_printf (" *** End of tunnel is with an bomb.\n");
|
|
|
|
|
else {
|
|
|
|
|
p->pos.x = map.tunnel[map.field[(int)p->pos.x][(int)p->pos.y].special].x << 8;
|
|
|
|
|
p->pos.y = map.tunnel[map.field[(int)p->pos.x][(int)p->pos.y].special].y << 8;
|
|
|
|
|
p->pos.x = map.tunnel[map.field[(int)p->pos.x][(int)p->pos.y].special].x;
|
|
|
|
|
p->pos.y = map.tunnel[map.field[(int)p->pos.x][(int)p->pos.y].special].y;
|
|
|
|
|
p->tunnelto = GAME_TUNNEL_TO;
|
|
|
|
|
speed = p->speed * timefactor;
|
|
|
|
|
}
|
|
|
|
@ -370,9 +370,9 @@ move_player (int pl_nr)
|
|
|
|
|
oldd = p->d;
|
|
|
|
|
|
|
|
|
|
if (p->tunnelto > 0) {
|
|
|
|
|
p->tunnelto--;
|
|
|
|
|
p->tunnelto -= timediff;
|
|
|
|
|
p->m = 0;
|
|
|
|
|
if (p->tunnelto <= 0 && GT_MP)
|
|
|
|
|
if (p->tunnelto <= 0.0f && GT_MP)
|
|
|
|
|
net_game_send_playermove (bman.p_nr, 1);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
@ -608,8 +608,8 @@ player_ilness_loop (int pl_nr)
|
|
|
|
|
int type,
|
|
|
|
|
pnr,
|
|
|
|
|
i,
|
|
|
|
|
tmp,
|
|
|
|
|
send;
|
|
|
|
|
float tmpf;
|
|
|
|
|
int pl[MAX_PLAYERS + 1];
|
|
|
|
|
|
|
|
|
|
/* do the illness for the network players */
|
|
|
|
@ -618,7 +618,7 @@ player_ilness_loop (int pl_nr)
|
|
|
|
|
if (pnr != pl_nr && PS_IS_alife (players[pnr].state)) {
|
|
|
|
|
p = &players[pnr];
|
|
|
|
|
for (type = 0; type < PI_max; type++)
|
|
|
|
|
if (p->ill[type].to > 0) {
|
|
|
|
|
if (p->ill[type].to > 0.0f) {
|
|
|
|
|
p->ill[type].to -= timediff;
|
|
|
|
|
p->illframe += timefactor;
|
|
|
|
|
if (p->illframe < 0 || p->illframe >= gfx.ill.frames)
|
|
|
|
@ -635,10 +635,10 @@ player_ilness_loop (int pl_nr)
|
|
|
|
|
send = 0;
|
|
|
|
|
for (type = 0; type < PI_max; type++) {
|
|
|
|
|
if (players[pl[i]].ill[type].to > p->ill[type].to) {
|
|
|
|
|
tmp = p->ill[type].to;
|
|
|
|
|
tmpf = p->ill[type].to;
|
|
|
|
|
player_set_ilness (p, type);
|
|
|
|
|
p->ill[type].to = players[pl[i]].ill[type].to;
|
|
|
|
|
if (tmp <= 0)
|
|
|
|
|
if (tmpf <= 0.0f)
|
|
|
|
|
send = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -648,14 +648,14 @@ player_ilness_loop (int pl_nr)
|
|
|
|
|
|
|
|
|
|
/* do the illness for the givin player */
|
|
|
|
|
for (type = 0; type < PI_max; type++)
|
|
|
|
|
if (p->ill[type].to > 0) {
|
|
|
|
|
p->ill[type].to--;
|
|
|
|
|
if (p->ill[type].to == 0)
|
|
|
|
|
if (p->ill[type].to > 0.0f) {
|
|
|
|
|
p->ill[type].to -= timediff;
|
|
|
|
|
if (p->ill[type].to <= 0.0f)
|
|
|
|
|
player_clear_ilness (p, type);
|
|
|
|
|
else {
|
|
|
|
|
p->illframe += timediff;
|
|
|
|
|
if (p->illframe < 0 || p->illframe >= gfx.ill.frames)
|
|
|
|
|
p->illframe = 0;
|
|
|
|
|
p->illframe = 0.0f;
|
|
|
|
|
|
|
|
|
|
if (type == PI_keys) {
|
|
|
|
|
/* switch direction for player key illness */
|
|
|
|
@ -697,36 +697,36 @@ player_set_ilness (_player * p, int t)
|
|
|
|
|
d_printf ("Ilness : %d\n", type);
|
|
|
|
|
switch (type) {
|
|
|
|
|
case PI_slow:
|
|
|
|
|
if (p->ill[type].to == 0) {
|
|
|
|
|
if (p->ill[PI_fast].to > 0) {
|
|
|
|
|
p->ill[type].data = p->ill[PI_fast].data;
|
|
|
|
|
p->ill[PI_fast].to = 0;
|
|
|
|
|
if (p->ill[type].to <= 0.0f) {
|
|
|
|
|
if (p->ill[PI_fast].to > 0.0f) {
|
|
|
|
|
p->ill[type].dataf = p->ill[PI_fast].dataf;
|
|
|
|
|
p->ill[PI_fast].to = 0.0f;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
p->ill[type].data = p->speed;
|
|
|
|
|
p->ill[type].dataf = p->speed;
|
|
|
|
|
}
|
|
|
|
|
p->speed = ILL_SLOWSPEED;
|
|
|
|
|
break;
|
|
|
|
|
case PI_fast:
|
|
|
|
|
if (p->ill[type].to == 0) {
|
|
|
|
|
if (p->ill[PI_slow].to > 0) {
|
|
|
|
|
p->ill[type].data = p->ill[PI_slow].data;
|
|
|
|
|
p->ill[PI_slow].to = 0;
|
|
|
|
|
if (p->ill[type].to <= 0.0f) {
|
|
|
|
|
if (p->ill[PI_slow].to > 0.0f) {
|
|
|
|
|
p->ill[type].dataf = p->ill[PI_slow].dataf;
|
|
|
|
|
p->ill[PI_slow].to = 0.0f;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
p->ill[type].data = p->speed;
|
|
|
|
|
p->ill[type].dataf = p->speed;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
p->speed = ILL_FASTSPEED;
|
|
|
|
|
break;
|
|
|
|
|
case PI_range:
|
|
|
|
|
if (p->ill[type].to == 0)
|
|
|
|
|
p->ill[type].data = p->range;
|
|
|
|
|
p->ill[type].datai = p->range;
|
|
|
|
|
p->range = 1;
|
|
|
|
|
break;
|
|
|
|
|
case PI_nobomb:
|
|
|
|
|
if (p->ill[type].to == 0)
|
|
|
|
|
p->ill[type].data = p->bombs_n;
|
|
|
|
|
p->ill[type].datai = p->bombs_n;
|
|
|
|
|
p->bombs_n = s_random (2);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
@ -744,13 +744,13 @@ player_clear_ilness (_player * p, int type)
|
|
|
|
|
switch (type) {
|
|
|
|
|
case PI_slow:
|
|
|
|
|
case PI_fast:
|
|
|
|
|
p->speed = p->ill[type].data;
|
|
|
|
|
p->speed = p->ill[type].dataf;
|
|
|
|
|
break;
|
|
|
|
|
case PI_range:
|
|
|
|
|
p->range = p->ill[type].data;
|
|
|
|
|
p->range = p->ill[type].datai;
|
|
|
|
|
break;
|
|
|
|
|
case PI_nobomb:
|
|
|
|
|
p->bombs_n = p->ill[type].data;
|
|
|
|
|
p->bombs_n = p->ill[type].datai;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
p->ill[type].to = 0;
|
|
|
|
|