|
|
|
@ -26,10 +26,11 @@ special_trigger (int p_nr)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (z) {
|
|
|
|
|
bman.last_ex_nr = ex_nr + 6;
|
|
|
|
|
p->special.numuse--;
|
|
|
|
|
if (!p->special.numuse) special_clear(p_nr);
|
|
|
|
|
}
|
|
|
|
|
bman.last_ex_nr = ex_nr + 6;
|
|
|
|
|
p->special.numuse--;
|
|
|
|
|
if (!p->special.numuse)
|
|
|
|
|
special_clear (p_nr);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -74,8 +75,8 @@ special_row (int p_nr)
|
|
|
|
|
b->state = BS_ticking;
|
|
|
|
|
b->r = p->range;
|
|
|
|
|
b->ex_nr = -1;
|
|
|
|
|
b->pos.x = x<<8;
|
|
|
|
|
b->pos.y = y<<8;
|
|
|
|
|
b->pos.x = x << 8;
|
|
|
|
|
b->pos.y = y << 8;
|
|
|
|
|
b->to = BOMB_TIMEOUT * TIME_FACTOR + t; // 5 Secs * 200
|
|
|
|
|
bman.bfield[x][y] = 1;
|
|
|
|
|
if (bman.gametype != GT_single) {
|
|
|
|
@ -102,7 +103,9 @@ special_push (int p_nr)
|
|
|
|
|
y1,
|
|
|
|
|
i;
|
|
|
|
|
|
|
|
|
|
if ((p->pos.x & 0xff) || (p->pos.y & 0xff)) {return;}
|
|
|
|
|
if ((p->pos.x & 0xff) || (p->pos.y & 0xff)) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
switch (p->d) {
|
|
|
|
|
case left:
|
|
|
|
|
dx = -1;
|
|
|
|
@ -120,87 +123,102 @@ special_push (int p_nr)
|
|
|
|
|
x += dx;
|
|
|
|
|
y += dy;
|
|
|
|
|
|
|
|
|
|
// check that player is beside a bomb
|
|
|
|
|
// check that player is beside a bomb
|
|
|
|
|
if (!bman.bfield[x][y])
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
x1 = x + dx;
|
|
|
|
|
y1 = y + dy;
|
|
|
|
|
|
|
|
|
|
// check the field behind the bomb
|
|
|
|
|
// check the field behind the bomb
|
|
|
|
|
if (bman.bfield[x1][y1] || bman.field[x1][y1].type != FT_nothing)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
get_bomb_on (x << 8, y << 8, bombs);
|
|
|
|
|
// move all bombs on that field (there should be only 1)
|
|
|
|
|
// move all bombs on that field (there should be only 1)
|
|
|
|
|
for (i = 0; bombs[i].x != -1; i++) {
|
|
|
|
|
b = &bman.players[bombs[i].x].bombs[bombs[i].y];
|
|
|
|
|
if (b->state != BS_exploding) {
|
|
|
|
|
b->moveto.x = x1<<8;
|
|
|
|
|
b->moveto.y = y1<<8;
|
|
|
|
|
b->moves=p->speed;
|
|
|
|
|
bman.bfield[x][y]=0;
|
|
|
|
|
bman.bfield[x1][y1]=1;
|
|
|
|
|
draw_stone(x,y);
|
|
|
|
|
field_update(x,y);
|
|
|
|
|
b->moveto.x = x1 << 8;
|
|
|
|
|
b->moveto.y = y1 << 8;
|
|
|
|
|
b->moves = p->speed;
|
|
|
|
|
bman.bfield[x][y] = 0;
|
|
|
|
|
bman.bfield[x1][y1] = 1;
|
|
|
|
|
draw_stone (x, y);
|
|
|
|
|
field_update (x, y);
|
|
|
|
|
if (bman.gametype != GT_single) {
|
|
|
|
|
net_game_send_bomb (bombs[i].x, bombs[i].y);}
|
|
|
|
|
}
|
|
|
|
|
net_game_send_bomb (bombs[i].x, bombs[i].y);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
special_pickup (int p_nr, int s_nr) {
|
|
|
|
|
special_pickup (int p_nr, int s_nr)
|
|
|
|
|
{
|
|
|
|
|
_special *s = &bman.players[p_nr].special;
|
|
|
|
|
s->to=0;
|
|
|
|
|
s->numuse=0;
|
|
|
|
|
s->type=s_nr;
|
|
|
|
|
switch(s_nr) {
|
|
|
|
|
case SP_trigger:
|
|
|
|
|
s->numuse=SPECIAL_TRIGGER_NUMUSE;
|
|
|
|
|
s->to=SPECIAL_TRIGGER_TIME*TIME_FACTOR;
|
|
|
|
|
break;
|
|
|
|
|
case SP_row :
|
|
|
|
|
s->to=SPECIAL_ROW_TIME*TIME_FACTOR;
|
|
|
|
|
break;
|
|
|
|
|
case SP_push :
|
|
|
|
|
s->to=SPECIAL_PUSH_TIME*TIME_FACTOR;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
s->to = 0;
|
|
|
|
|
s->numuse = 0;
|
|
|
|
|
s->type = s_nr;
|
|
|
|
|
switch (s_nr) {
|
|
|
|
|
case SP_trigger:
|
|
|
|
|
s->numuse = SPECIAL_TRIGGER_NUMUSE;
|
|
|
|
|
s->to = SPECIAL_TRIGGER_TIME * TIME_FACTOR;
|
|
|
|
|
break;
|
|
|
|
|
case SP_row:
|
|
|
|
|
s->to = SPECIAL_ROW_TIME * TIME_FACTOR;
|
|
|
|
|
break;
|
|
|
|
|
case SP_push:
|
|
|
|
|
s->to = SPECIAL_PUSH_TIME * TIME_FACTOR;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bman.updatestatusbar = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
special_clear (int p_nr) {
|
|
|
|
|
bman.players[p_nr].special.type=0;
|
|
|
|
|
bman.updatestatusbar=1;
|
|
|
|
|
special_clear (int p_nr)
|
|
|
|
|
{
|
|
|
|
|
bman.players[p_nr].special.type = 0;
|
|
|
|
|
bman.updatestatusbar = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
special_loop (int p_nr) {
|
|
|
|
|
special_loop (int p_nr)
|
|
|
|
|
{
|
|
|
|
|
_special *s = &bman.players[p_nr].special;
|
|
|
|
|
if (!s->type) return;
|
|
|
|
|
bman.updatestatusbar=1;
|
|
|
|
|
if (s->to) {
|
|
|
|
|
|
|
|
|
|
if (!s->type)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (s->to) {
|
|
|
|
|
s->to--;
|
|
|
|
|
if (!s->to) special_clear (p_nr);
|
|
|
|
|
}
|
|
|
|
|
if (!s->to)
|
|
|
|
|
special_clear (p_nr);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
special_use (int p_nr) {
|
|
|
|
|
special_use (int p_nr)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
switch (bman.players[p_nr].special.type) {
|
|
|
|
|
|
|
|
|
|
case SP_trigger:
|
|
|
|
|
special_trigger (p_nr);
|
|
|
|
|
break;
|
|
|
|
|
case SP_row:if (bman.players[p_nr].m)
|
|
|
|
|
case SP_row:
|
|
|
|
|
if (bman.players[p_nr].m)
|
|
|
|
|
special_row (p_nr);
|
|
|
|
|
break;
|
|
|
|
|
case SP_push:if (bman.players[p_nr].m)
|
|
|
|
|
case SP_push:
|
|
|
|
|
if (bman.players[p_nr].m)
|
|
|
|
|
special_push (p_nr);
|
|
|
|
|
break;
|
|
|
|
|
case SP_kick:break;
|
|
|
|
|
}}
|
|
|
|
|
case SP_kick:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|