end sequence of the game will now work fine.. without problems... maybe timeouts have to be raised up alittle.

origin
stpohle 22 years ago
parent abc50df9c2
commit 31b48aedc7

@ -1,8 +1,14 @@
$Id: ChangeLog,v 1.32 2003/07/25 12:28:50 stpohle Exp $ $Id: ChangeLog,v 1.33 2003/07/27 14:34:37 stpohle Exp $
Version 0.9.10 Version 0.9.10
============== ==============
- added: two ways the game can end now. the old Bomberman
style with getting the size of the gamefield down and
another one with putting in the game alot of powerups.
the game even have a timeout of 10 minutes + the
2 minutes of the end game sequenze.
- Makefile.am fixed in the data direktory. Added - Makefile.am fixed in the data direktory. Added
${prefix}/ and changed @PREFIX_PACKAGE_DATA_DIR@ to ${prefix}/ and changed @PREFIX_PACKAGE_DATA_DIR@ to
@NO_PREFIX_PACKAGE_DATA_DIR@ . So debian packages @NO_PREFIX_PACKAGE_DATA_DIR@ . So debian packages
@ -378,4 +384,3 @@ Version 0.1
the bombs are exploding. the bombs are exploding.
- Basic Graphics, just some experiments within the game - Basic Graphics, just some experiments within the game

10
TODO

@ -1,6 +1,4 @@
$Id: TODO,v 1.18 2003/07/25 21:44:47 stpohle Exp $ $Id: TODO,v 1.19 2003/07/27 14:34:38 stpohle Exp $
- player selection screen for the single player
- more specials (Kicking Bomb, Pushing Bomb Ver.2) - more specials (Kicking Bomb, Pushing Bomb Ver.2)
@ -16,8 +14,10 @@ $Id: TODO,v 1.18 2003/07/25 21:44:47 stpohle Exp $
- add musicfiles with type of mp3, mod, xm, s3m and - add musicfiles with type of mp3, mod, xm, s3m and
mid (but i don't know how i can do this) mid (but i don't know how i can do this)
- animated fire - better animated fire
- more gfx players to select?
- more players - team mode
- we need some more sound for picking up items. - we need some more sound for picking up items.

@ -1,4 +1,4 @@
/* $Id: bomb.c,v 1.37 2003/07/23 02:10:47 stpohle Exp $ */ /* $Id: bomb.c,v 1.38 2003/07/27 14:34:39 stpohle Exp $ */
/* everything what have to do with the bombs */ /* everything what have to do with the bombs */
#include "bomberclone.h" #include "bomberclone.h"
@ -198,6 +198,9 @@ bomb_loop ()
return b; return b;
}; };
/* check if on the givin place is a bomb
bombs[].x = player, bombs[].y = bombnumber */
void void
get_bomb_on (short int x, short int y, _point bombs[]) get_bomb_on (short int x, short int y, _point bombs[])
{ {

@ -1,4 +1,4 @@
/* $Id: bomberclone.h,v 1.48 2003/07/27 13:29:25 stpohle Exp $ */ /* $Id: bomberclone.h,v 1.49 2003/07/27 14:34:40 stpohle Exp $ */
/* bomberclone.h */ /* bomberclone.h */
#ifndef _BOMBERCLONE_H_ #ifndef _BOMBERCLONE_H_
@ -213,6 +213,7 @@ extern void player_ilness_loop (int pl_nr);
extern void player_check_powerup (int p_nr); extern void player_check_powerup (int p_nr);
extern void player_set_gfx (_player *p, signed char gfx_nr); extern void player_set_gfx (_player *p, signed char gfx_nr);
extern int player_findfreebomb (_player *player); extern int player_findfreebomb (_player *player);
extern int player_checkpos (int x, int y);
// for the bomb.. // for the bomb..
extern int bomb_loop (); extern int bomb_loop ();

@ -1,4 +1,4 @@
/* $Id: field.c,v 1.39 2003/07/27 13:29:25 stpohle Exp $ */ /* $Id: field.c,v 1.40 2003/07/27 14:34:40 stpohle Exp $ */
/* field.c - procedures which are needed to control the field */ /* field.c - procedures which are needed to control the field */
#include "bomberclone.h" #include "bomberclone.h"
@ -386,6 +386,7 @@ void
field_hurrysize () field_hurrysize ()
{ {
int i; int i;
_point old;
if (fieldhurry_to-- <= 0 || fieldhurry_to > FIELDHURRYSIZE) { if (fieldhurry_to-- <= 0 || fieldhurry_to > FIELDHURRYSIZE) {
fieldhurry_to = FIELDHURRYSIZE; fieldhurry_to = FIELDHURRYSIZE;
@ -396,7 +397,8 @@ field_hurrysize ()
} }
else if (fieldhurrypos.x > 0) { else if (fieldhurrypos.x > 0) {
bman.timeout = GAME_TIMEOUTHURRY-1; bman.timeout = GAME_TIMEOUTHURRY-1;
old = fieldhurrypos; /* save old value in case that there
is an explosion or a bomb */
switch (fieldhurryd) { switch (fieldhurryd) {
case (right): case (right):
if (fieldhurrypos.x + 1 >= map.size.x - fieldhurrypos.y) { if (fieldhurrypos.x + 1 >= map.size.x - fieldhurrypos.y) {
@ -443,12 +445,31 @@ field_hurrysize ()
/* check if we have finished sizing down everything */ /* check if we have finished sizing down everything */
if (fieldhurrypos.x > 0) { if (fieldhurrypos.x > 0) {
/* set the block on the position */ _point bombs[MAX_PLAYERS*MAX_BOMBS];
map.field[fieldhurrypos.x][fieldhurrypos.y].type = FT_block; int i, d;
stonelist_add (fieldhurrypos.x, fieldhurrypos.y);
/* check if a bomb is at this position, if so let the bomb explode
if (GT_MP_PTPM) and wait untill the explosion is over */
net_game_send_field (fieldhurrypos.x, fieldhurrypos.y); for (i = 0, d = 0; d < 4; d++)
if (map.field[fieldhurrypos.x][fieldhurrypos.y].ex[d].count > 0)
i++;
get_bomb_on (fieldhurrypos.x << 8, fieldhurrypos.y << 8, bombs);
if (i)
fieldhurrypos = old;
else if (bombs[0].y != -1 && bombs[0].x != -1) {
fieldhurrypos = old;
bomb_explode (bombs[0].x, bombs[0].y, 1);
}
else {
/* set the block on the position */
map.field[fieldhurrypos.x][fieldhurrypos.y].type = FT_block;
map.field[fieldhurrypos.x][fieldhurrypos.y].special = FT_nothing;
map.field[fieldhurrypos.x][fieldhurrypos.y].frame = 0;
stonelist_add (fieldhurrypos.x, fieldhurrypos.y);
if (GT_MP_PTPM)
net_game_send_field (fieldhurrypos.x, fieldhurrypos.y);
}
} }
} }
}; };

@ -1,4 +1,4 @@
/* $Id: map.c,v 1.3 2003/07/22 18:29:08 stpohle Exp $ */ /* $Id: map.c,v 1.4 2003/07/27 14:34:40 stpohle Exp $ */
/* map handling, like generate and load maps. */ /* map handling, like generate and load maps. */
#include "bomberclone.h" #include "bomberclone.h"
@ -53,7 +53,7 @@ map_new (char *filename)
// Clean and create the field // // Clean and create the field //
if (fmap == NULL) if (fmap == NULL)
map_genrandom (); map_genrandom ();
/* delete the bfield data */ /* delete the bfield data */
for (x = 0; x < MAX_FIELDSIZE_X; x++) for (x = 0; x < MAX_FIELDSIZE_X; x++)
@ -83,38 +83,42 @@ map_new (char *filename)
// map_fillitems (FT_sp_kick, GAME_SPECIAL_ITEMSKICK); // map_fillitems (FT_sp_kick, GAME_SPECIAL_ITEMSKICK);
} }
void map_genrandom () { void
int x, y, d; map_genrandom ()
{
/* if we can't load the map check first the fieldsize settings */ int x,
if (map.size.x < MIN_FIELDSIZE_X) y,
map.size.x = MIN_FIELDSIZE_X; d;
if (map.size.x > MAX_FIELDSIZE_X)
map.size.x = MAX_FIELDSIZE_X; /* if we can't load the map check first the fieldsize settings */
if (map.size.x < MIN_FIELDSIZE_X)
for (x = 0; x < map.size.x; x++) map.size.x = MIN_FIELDSIZE_X;
for (y = 0; y < map.size.y; y++) { if (map.size.x > MAX_FIELDSIZE_X)
if ((y == 0) || (y == map.size.y - 1)) map.size.x = MAX_FIELDSIZE_X;
map.field[x][y].type = FT_block;
else if ((x == 0) || (x == map.size.x - 1)) for (x = 0; x < map.size.x; x++)
map.field[x][y].type = FT_block; for (y = 0; y < map.size.y; y++) {
else if (((x & 1) == 0) && ((y & 1) == 0)) if ((y == 0) || (y == map.size.y - 1))
map.field[x][y].type = FT_block; map.field[x][y].type = FT_block;
else { else if ((x == 0) || (x == map.size.x - 1))
// create random field map.field[x][y].type = FT_block;
if ((s_random (256) & 3) == 0) else if (((x & 1) == 0) && ((y & 1) == 0))
map.field[x][y].type = FT_nothing; map.field[x][y].type = FT_block;
else else {
map.field[x][y].type = FT_stone; // create random field
} if ((s_random (256) & 3) == 0)
map.field[x][y].type = FT_nothing;
else
map.field[x][y].type = FT_stone;
}
for (d = 0; d < 4; d++) for (d = 0; d < 4; d++)
map.field[x][y].ex[d].frame = map.field[x][y].ex[d].count = 0; map.field[x][y].ex[d].frame = map.field[x][y].ex[d].count = 0;
map.field[x][y].ex_nr = -1; map.field[x][y].ex_nr = -1;
map.field[x][y].frame = 0; map.field[x][y].frame = 0;
map.field[x][y].frameto = 0; map.field[x][y].frameto = 0;
map.field[x][y].special = FT_nothing; map.field[x][y].special = FT_nothing;
} }
} }
@ -249,54 +253,61 @@ map_set_playerposition (int usermap)
PLY = PLY << 8; PLY = PLY << 8;
} }
}; };
#undef PLX #undef PLX
#undef PLY #undef PLY
/* load a random map */ /* load a random map */
void map_random () { void
_direntry *destart, *de, *desel; map_random ()
char path[LEN_PATHFILENAME]; {
int max, sel; _direntry *destart,
*de,
sprintf (path, "%s/maps", bman.datapath); *desel;
desel = destart = s_getdir (path); char path[LEN_PATHFILENAME];
int max,
for (max = 0, de = destart; de != NULL; de = de->next) sel;
if ((de->flags & DF_file) == DF_file)
max++; sprintf (path, "%s/maps", bman.datapath);
desel = destart = s_getdir (path);
sel = s_random (max);
for (max = 0, de = destart; max <= sel && de != NULL; de = de->next) for (max = 0, de = destart; de != NULL; de = de->next)
if ((de->flags & DF_file) == DF_file) { if ((de->flags & DF_file) == DF_file)
desel = de; max++;
max++;
} sel = s_random (max);
for (max = 0, de = destart; max <= sel && de != NULL; de = de->next)
if ((de->flags & DF_file) == DF_file) {
desel = de;
max++;
}
d_printf ("Random Map %s (%d on %d)\n", desel->name, sel, max); d_printf ("Random Map %s (%d on %d)\n", desel->name, sel, max);
if (desel != NULL) if (desel != NULL)
sprintf (map.map, "%s/maps/%s", bman.datapath, desel->name); sprintf (map.map, "%s/maps/%s", bman.datapath, desel->name);
} }
// Init the game according to options // Init the game according to options
void init_map_tileset() void
init_map_tileset ()
{ {
switch (map.map_selection) { switch (map.map_selection) {
case (0): case (0):
map_new (map.map); map_new (map.map);
break; break;
case (1): case (1):
map_random (); map_random ();
map_new (map.map); map_new (map.map);
break; break;
case (2): case (2):
map_new (NULL); map_new (NULL);
break; break;
} }
if (map.random_tileset) if (map.random_tileset)
tileset_random (); tileset_random ();
} }
@ -322,22 +333,22 @@ map_load (FILE * fmap)
continue; continue;
/* now each line correspond to the field */ /* now each line correspond to the field */
else if (strstr (currentline, "bombs") == currentline) // bombs else if (strstr (currentline, "bombs") == currentline) // bombs
map.bombs = atoi (strchr (currentline, '=') + 1); map.bombs = atoi (strchr (currentline, '=') + 1);
else if (strstr (currentline, "fire") == currentline) // fire else if (strstr (currentline, "fire") == currentline) // fire
map.fire = atoi (strchr (currentline, '=') + 1); map.fire = atoi (strchr (currentline, '=') + 1);
else if (strstr (currentline, "shoes") == currentline) // shoes else if (strstr (currentline, "shoes") == currentline) // shoes
map.shoes = atoi (strchr (currentline, '=') + 1); map.shoes = atoi (strchr (currentline, '=') + 1);
else if (strstr (currentline, "mixed") == currentline) // mixed else if (strstr (currentline, "mixed") == currentline) // mixed
map.mixed = atoi (strchr (currentline, '=') + 1); map.mixed = atoi (strchr (currentline, '=') + 1);
else if (strstr (currentline, "death") == currentline) // death else if (strstr (currentline, "death") == currentline) // death
map.death = atoi (strchr (currentline, '=') + 1); map.death = atoi (strchr (currentline, '=') + 1);
else if (strstr (currentline, "sp_trigger") == currentline) // trigger special else if (strstr (currentline, "sp_trigger") == currentline) // trigger special
map.sp_trigger = atoi (strchr (currentline, '=') + 1); map.sp_trigger = atoi (strchr (currentline, '=') + 1);
else if (strstr (currentline, "sp_push") == currentline) // push special else if (strstr (currentline, "sp_push") == currentline) // push special
map.sp_push = atoi (strchr (currentline, '=') + 1); map.sp_push = atoi (strchr (currentline, '=') + 1);
else if (strstr (currentline, "sp_row") == currentline) // row special else if (strstr (currentline, "sp_row") == currentline) // row special
map.sp_row = atoi (strchr (currentline, '=') + 1); map.sp_row = atoi (strchr (currentline, '=') + 1);
else if (currentline[0] == '#') { /* the map itself */ else if (currentline[0] == '#') { /* the map itself */
for (i = 0; i < length; i++) { for (i = 0; i < length; i++) {
switch (currentline[i]) { switch (currentline[i]) {
case '#': case '#':
@ -373,5 +384,5 @@ map_load (FILE * fmap)
for (i = 0; i < map.size.y; i++) for (i = 0; i < map.size.y; i++)
map.field[0][i].type = map.field[map.size.x - 1][i].type = FT_block; map.field[0][i].type = map.field[map.size.x - 1][i].type = FT_block;
fclose (fmap); fclose (fmap);
} }

@ -15,7 +15,7 @@ draw_player (_player * player)
if ((player->pos.x >> 8) < 0 || (player->pos.x >> 8) >= map.size.x || if ((player->pos.x >> 8) < 0 || (player->pos.x >> 8) >= map.size.x ||
(player->pos.y >> 8) < 0 || (player->pos.y >> 8) >= map.size.y) { (player->pos.y >> 8) < 0 || (player->pos.y >> 8) >= map.size.y) {
d_printf ("FATAL: Draw Player out of range : [%d,%d]\n", (player->pos.x >> 8), d_printf ("FATAL: Draw Player out of range : [%d,%d]\n", (player->pos.x >> 8),
(player->pos.y >> 8)); (player->pos.y >> 8));
return; return;
} }
@ -89,10 +89,9 @@ restore_players_screen ()
if ((PS_IS_used (bman.players[i].state)) && bman.players[i].old.x != -1) { if ((PS_IS_used (bman.players[i].state)) && bman.players[i].old.x != -1) {
if ((bman.players[i].old.x >> 8) < 0 || (bman.players[i].old.x >> 8) >= map.size.x if ((bman.players[i].old.x >> 8) < 0 || (bman.players[i].old.x >> 8) >= map.size.x
|| (bman.players[i].old.y >> 8) < 0 || (bman.players[i].old.y >> 8) < 0 || (bman.players[i].old.y >> 8) >= map.size.y)
|| (bman.players[i].old.y >> 8) >= map.size.y)
d_printf ("FATAL: Restore Player out of range : playernr %d [%d,%d]\n", i, d_printf ("FATAL: Restore Player out of range : playernr %d [%d,%d]\n", i,
(bman.players[i].old.x >> 8), (bman.players[i].old.y >> 8)); (bman.players[i].old.x >> 8), (bman.players[i].old.y >> 8));
else { else {
if ((bman.players[i].old.x & 0xFF) > 128) { if ((bman.players[i].old.x & 0xFF) > 128) {
x = (bman.players[i].old.x >> 8); x = (bman.players[i].old.x >> 8);
@ -229,12 +228,18 @@ check_field (short int x, short int y)
int int
stepmove_player (int pl_nr) stepmove_player (int pl_nr)
{ {
_point bomb1[MAX_PLAYERS * MAX_BOMBS], bomb2[MAX_PLAYERS * MAX_BOMBS]; _point bomb1[MAX_PLAYERS * MAX_BOMBS],
bomb2[MAX_PLAYERS * MAX_BOMBS];
_player *p = &bman.players[pl_nr]; _player *p = &bman.players[pl_nr];
int speed = 0, i, j, f; int speed = 0,
_point fpos, // field position i,
_pos, // position inside the field j,
d; f;
_point fpos, // field position
_pos, // position inside the field
d;
if (p->m == 1) { if (p->m == 1) {
@ -268,51 +273,76 @@ stepmove_player (int pl_nr)
speed = p->speed; speed = p->speed;
// check the new field position // check the new field position
d.x = d.y = 0; d.x = d.y = 0;
if (p->d == left && _pos.y == 0 && ((_pos.x == 0 && check_field (fpos.x - 1, fpos.y)) || (_pos.x > 0))) if (p->d == left && _pos.y == 0
d.x = -speed; && ((_pos.x == 0 && check_field (fpos.x - 1, fpos.y)) || (_pos.x > 0)))
if (p->d == right && _pos.y == 0 && ((_pos.x == 0 && check_field (fpos.x + 1, fpos.y)) || (_pos.x > 0))) d.x = -speed;
d.x = speed; if (p->d == right && _pos.y == 0
if (p->d == up && _pos.x == 0 && ((_pos.y == 0 && check_field (fpos.x, fpos.y - 1)) || (_pos.y > 0))) && ((_pos.x == 0 && check_field (fpos.x + 1, fpos.y)) || (_pos.x > 0)))
d.y = -speed; d.x = speed;
if (p->d == down && _pos.x == 0 && ((_pos.y == 0 && check_field (fpos.x, fpos.y + 1)) || (_pos.y > 0))) if (p->d == up && _pos.x == 0
d.y = speed; && ((_pos.y == 0 && check_field (fpos.x, fpos.y - 1)) || (_pos.y > 0)))
d.y = -speed;
// check if we can move and if there is any bomb if (p->d == down && _pos.x == 0
if (d.y != 0 || d.x != 0) { && ((_pos.y == 0 && check_field (fpos.x, fpos.y + 1)) || (_pos.y > 0)))
get_bomb_on (p->pos.x, p->pos.y, bomb1); d.y = speed;
get_bomb_on (p->pos.x + d.x, p->pos.y + d.y, bomb2);
// check if we can move and if there is any bomb
if (bomb1[0].x == -1 && bomb2[0].x != -1) if (d.y != 0 || d.x != 0) {
/* old pos no bomb, new pos no bomb */ get_bomb_on (p->pos.x, p->pos.y, bomb1);
d.x = d.y = 0; get_bomb_on (p->pos.x + d.x, p->pos.y + d.y, bomb2);
else if (bomb2[0].x != -1) {
/* new pos bomb, old pos bomb... check if it's the same if (bomb1[0].x == -1 && bomb2[0].x != -1)
use f to save if we found the bomb or not /* old pos no bomb, new pos no bomb */
f == 0 no bomb found, f == 1 bomb found */ d.x = d.y = 0;
for (i = 0, f = 1; (bomb2[i].x != -1 && f == 1); i++) else if (bomb2[0].x != -1) {
for (f = 0, j = 0; (bomb1[j].x != -1 && f == 0); j++) /* new pos bomb, old pos bomb... check if it's the same
if (bomb1[j].x == bomb2[i].x && bomb1[j].y == bomb2[i].y) use f to save if we found the bomb or not
/* identical bomb found ... f = 1 */ f == 0 no bomb found, f == 1 bomb found */
f = 1; for (i = 0, f = 1; (bomb2[i].x != -1 && f == 1); i++)
if (f == 0) for (f = 0, j = 0; (bomb1[j].x != -1 && f == 0); j++)
d.x = d.y = 0; if (bomb1[j].x == bomb2[i].x && bomb1[j].y == bomb2[i].y)
} /* identical bomb found ... f = 1 */
} f = 1;
if (f == 0)
p->pos.x += d.x; d.x = d.y = 0;
p->pos.y += d.y; }
}
player_check_powerup (pl_nr);
} p->pos.x += d.x;
p->pos.y += d.y;
if (d.x == 0 && d.y == 0)
return 0; player_check_powerup (pl_nr);
}
if (d.x == 0 && d.y == 0)
return 0;
return (p->speed - speed); return (p->speed - speed);
}; };
/* check if the givin position is oky
1 = ok, 0 = bad */
int
player_checkpos (int x, int y)
{
int i,
d;
for (i = 0, d = 0; d < 4; d++)
if (map.field[x][y].ex[d].count > 0)
i++;
if (map.field[x][y].type == FT_block || i > 0)
return 0;
else
return 1;
};
/* move the player if he have to move AND check if we are on a block
or over fire */
void void
move_player (int pl_nr) move_player (int pl_nr)
{ {
@ -344,6 +374,21 @@ move_player (int pl_nr)
net_game_send_playermove (pl_nr, 1); net_game_send_playermove (pl_nr, 1);
p->old_m = p->m; // save the old state p->old_m = p->m; // save the old state
p->m = 0; p->m = 0;
/* check the players position */
if ((p->pos.x & 0xFF) > EXPLOSION_SAVE_DISTANCE && (p->d == left || p->d == right))
if (!check_field ((p->pos.x >> 8) + 1, (p->pos.y >> 8)))
player_died (p, -1);
if ((p->pos.y & 0xFF) > EXPLOSION_SAVE_DISTANCE && (p->d == up || p->d == down))
if (!check_field ((p->pos.x >> 8), (p->pos.y >> 8) + 1))
player_died (p, -1);
if (((p->pos.x & 0xFF) < (0x100 - EXPLOSION_SAVE_DISTANCE)
&& (p->d == left || p->d == right))
|| ((p->pos.y & 0xFF) < (0x100 - EXPLOSION_SAVE_DISTANCE)
&& (p->d == up || p->d == down)))
if (!check_field (p->pos.x >> 8, p->pos.y >> 8))
player_died (p, -1);
}; };
@ -358,7 +403,7 @@ player_drop_bomb (int pl_nr)
_y; _y;
_point bombs[MAX_PLAYERS * MAX_BOMBS]; _point bombs[MAX_PLAYERS * MAX_BOMBS];
i = player_findfreebomb (player); i = player_findfreebomb (player);
if (i >= 0 && i < MAX_BOMBS && PS_IS_alife (player->state)) { // free bomb found if (i >= 0 && i < MAX_BOMBS && PS_IS_alife (player->state)) { // free bomb found
// get the best position for the bomb. // get the best position for the bomb.
@ -757,32 +802,37 @@ player_set_gfx (_player * p, signed char gfx_nr)
/* find a free bomb */ /* find a free bomb */
int player_findfreebomb (_player *player) { int
int i, bombused = 0, res = -1, nr; player_findfreebomb (_player * player)
{
/* check every free bomb from next entry of the last int i,
exploded bomb to the last exploded bomb */ bombused = 0,
if (player->bomb_lastex < 0 || player->bomb_lastex >= MAX_BOMBS) res = -1,
player->bomb_lastex = 0; nr;
for (i = 0; i < MAX_BOMBS; i++) { /* check every free bomb from next entry of the last
nr = player->bomb_lastex + 1 + i; exploded bomb to the last exploded bomb */
if (nr < 0 || nr >= MAX_BOMBS) // i out of range .. restart at bomb 0 if (player->bomb_lastex < 0 || player->bomb_lastex >= MAX_BOMBS)
nr -= MAX_BOMBS; player->bomb_lastex = 0;
if (player->bombs[i].state == BS_off) { /* check if this bomb is free */ for (i = 0; i < MAX_BOMBS; i++) {
if (res == -1) nr = player->bomb_lastex + 1 + i;
res = i; if (nr < 0 || nr >= MAX_BOMBS) // i out of range .. restart at bomb 0
} nr -= MAX_BOMBS;
else
bombused++; // count number of used bombs if (player->bombs[i].state == BS_off) { /* check if this bomb is free */
} if (res == -1)
res = i;
if (res == -1 && i == player->bomb_lastex && player->bombs[i].state == BS_off) }
res = i; else
bombused++; // count number of used bombs
if (bombused >= player->bombs_n) }
res = -1; /* all max number of bombs lay */
if (res == -1 && i == player->bomb_lastex && player->bombs[i].state == BS_off)
return res; res = i;
if (bombused >= player->bombs_n)
res = -1; /* all max number of bombs lay */
return res;
}; };

Loading…
Cancel
Save