added game parameters start_range, start_bombs, start_speed, bomb_tickingtime

origin
stpohle 22 years ago
parent a51e57c047
commit aa6f0326de

@ -1,4 +1,4 @@
$Id: ChangeLog,v 1.55 2004/01/25 02:20:56 stpohle Exp $ $Id: ChangeLog,v 1.56 2004/01/25 14:10:22 stpohle Exp $
- Added: Kick Bombs special - Added: Kick Bombs special
@ -24,6 +24,9 @@ $Id: ChangeLog,v 1.55 2004/01/25 02:20:56 stpohle Exp $
- Changed all Images to PNG. From now on there is alpha blending - Changed all Images to PNG. From now on there is alpha blending
supported too. supported too.
- Added: Game Setting start_bombs, start_range, start_bombs and
bomb_tickingtime.
Version 0.11.0 Version 0.11.0
============== ==============

@ -1,4 +1,4 @@
/* $Id: bomberclone.h,v 1.16 2004/01/25 02:21:00 stpohle Exp $ */ /* $Id: bomberclone.h,v 1.17 2004/01/25 14:10:28 stpohle Exp $ */
/* bomberclone.h */ /* bomberclone.h */
#ifndef _BOMBERCLONE_H_ #ifndef _BOMBERCLONE_H_
@ -152,6 +152,12 @@ struct {
int notifygamemaster; int notifygamemaster;
int askplayername; // ask player for name at startup int askplayername; // ask player for name at startup
int start_bombs; // start values
int start_range;
float start_speed;
float bomb_tickingtime; // time before the bomb explodes
unsigned char ai_players; // number of ai players unsigned char ai_players; // number of ai players
} typedef _bomberclone; } typedef _bomberclone;

@ -1,4 +1,4 @@
/* $Id: map.h,v 1.9 2004/01/07 23:04:31 patty21 Exp $ */ /* $Id: map.h,v 1.10 2004/01/25 14:10:29 stpohle Exp $ */
/* map.h */ /* map.h */
#ifndef _MAP_H_ #ifndef _MAP_H_
@ -61,6 +61,7 @@ extern _map map;
// mapmenu.c // mapmenu.c
extern void mapmenu (); extern void mapmenu ();
extern void mapinfo (); extern void mapinfo ();
extern void mapgamesetting ();
// map.c // map.c
extern void map_random (); extern void map_random ();

@ -250,6 +250,10 @@ struct pkg_mapinfo {
unsigned char sp_row; unsigned char sp_row;
unsigned char size_x; unsigned char size_x;
unsigned char size_y; unsigned char size_y;
unsigned char start_bombs;
unsigned char start_range;
char start_speed[8]; // to make sure there will be no difference
char bomb_tickingtime[8]; // to make sure there will be no difference
}; };

@ -1,4 +1,4 @@
/* $Id: bomb.c,v 1.52 2004/01/07 23:04:31 patty21 Exp $ */ /* $Id: bomb.c,v 1.53 2004/01/25 14:10:29 stpohle Exp $ */
/* everything what have to do with the bombs */ /* everything what have to do with the bombs */
#include "bomberclone.h" #include "bomberclone.h"
@ -22,7 +22,7 @@ draw_bomb (_bomb * bomb)
return; return;
} }
if (bomb->state != BS_trigger || ((bomb->state == BS_trigger) && (bomb->to < BOMB_TIMEOUT))) { if (bomb->state != BS_trigger || ((bomb->state == BS_trigger) && (bomb->to < bman.bomb_tickingtime))) {
/* check the framenumber */ /* check the framenumber */
bomb->frame += (timefactor / 3.0); bomb->frame += (timefactor / 3.0);
if (bomb->frame < 0 || bomb->frame >= gfx.bomb.frames) if (bomb->frame < 0 || bomb->frame >= gfx.bomb.frames)
@ -249,7 +249,7 @@ bomb_loop ()
bomb->to -= timediff; bomb->to -= timediff;
if (bomb->to <= 0.0f) { // bomb did not explode -> resend bombdata if (bomb->to <= 0.0f) { // bomb did not explode -> resend bombdata
if (bomb->state == BS_ticking) if (bomb->state == BS_ticking)
bomb->to = BOMB_TIMEOUT; bomb->to = bman.bomb_tickingtime;
else else
bomb->to = SPECIAL_TRIGGER_TIMEOUT; bomb->to = SPECIAL_TRIGGER_TIMEOUT;
net_game_send_bomb (bman.p_nr, i); net_game_send_bomb (bman.p_nr, i);

@ -74,7 +74,12 @@ config_init (int argc, char **argv)
map.sp_row = GAME_SPECIAL_ITEMSROW; map.sp_row = GAME_SPECIAL_ITEMSROW;
map.sp_push = GAME_SPECIAL_ITEMSPUSH; map.sp_push = GAME_SPECIAL_ITEMSPUSH;
map.sp_kick = GAME_SPECIAL_ITEMSKICK; map.sp_kick = GAME_SPECIAL_ITEMSKICK;
d_printf ("\n\n ***** Bomberclone Version %s \n\n", VERSION);
bman.start_bombs = START_BOMBS;
bman.start_speed = START_SPEED;
bman.start_range = START_RANGE;
bman.bomb_tickingtime = BOMB_TIMEOUT;
d_printf ("\n\n ***** Bomberclone Version %s \n\n", VERSION);
if (config_read ()) { /* error on reading the config file */ if (config_read ()) { /* error on reading the config file */
ReadPrgArgs (argc, argv); ReadPrgArgs (argc, argv);
gfx_init (); gfx_init ();
@ -259,6 +264,18 @@ config_read ()
if (!strcmp (keyword, "sndplaysound")) { if (!strcmp (keyword, "sndplaysound")) {
snd.playsound = atoi (value); snd.playsound = atoi (value);
} }
if (!strcmp (keyword, "start_bombs")) {
bman.start_bombs = atoi (value);
}
if (!strcmp (keyword, "start_range")) {
bman.start_range = atoi (value);
}
if (!strcmp (keyword, "start_speed")) {
sscanf (value, "%f", &bman.start_speed);
}
if (!strcmp (keyword, "bomb_ticking")) {
sscanf (value, "%f", &bman.bomb_tickingtime);
}
} }
fclose (config); fclose (config);
return 0; return 0;

@ -1,4 +1,4 @@
/* $Id: game.c,v 1.68 2004/01/06 02:19:57 stpohle Exp $ /* $Id: game.c,v 1.69 2004/01/25 14:10:30 stpohle Exp $
game.c - procedures for the game. */ game.c - procedures for the game. */
#include <string.h> #include <string.h>
@ -328,9 +328,9 @@ game_start ()
else else
players[p].state = 0; players[p].state = 0;
players[p].bombs_n = START_BOMBS; players[p].bombs_n = bman.start_bombs;
players[p].range = START_RANGE; players[p].range = bman.start_range;
players[p].speed = START_SPEED; players[p].speed = bman.start_speed;
players[p].special.type = SP_nothing; players[p].special.type = SP_nothing;
players[p].m = 0; players[p].m = 0;
players[p].old.x = 0; players[p].old.x = 0;

@ -1,4 +1,4 @@
/* $Id: mapmenu.c,v 1.18 2004/01/07 23:04:32 patty21 Exp $ */ /* $Id: mapmenu.c,v 1.19 2004/01/25 14:10:44 stpohle Exp $ */
/* map/tileset selection menu */ /* map/tileset selection menu */
#include "bomberclone.h" #include "bomberclone.h"
@ -33,7 +33,6 @@ mapmenu ()
while (menuselect != -1 && bman.state != GS_quit) { while (menuselect != -1 && bman.state != GS_quit) {
menu_new ("Map Options", 420, 400); menu_new ("Map Options", 420, 400);
// map.map_selection=MAPS_select;
switch (map.map_selection) { switch (map.map_selection) {
case (MAPS_select): // Selected Map case (MAPS_select): // Selected Map
selmt = charlist_findtext (maptypes, "selected file"); selmt = charlist_findtext (maptypes, "selected file");
@ -97,9 +96,9 @@ mapmenu ()
menu_create_entry ("Row: ", 280, 280, 120, &map.sp_row, 30, MENU_entryint32, 14); menu_create_entry ("Row: ", 280, 280, 120, &map.sp_row, 30, MENU_entryint32, 14);
menu_create_entry ("Kick: ", 280, 300, 120, &map.sp_kick, 30, MENU_entryint32, 15); menu_create_entry ("Kick: ", 280, 300, 120, &map.sp_kick, 30, MENU_entryint32, 15);
menu_create_entry ("Game Timeout:", -1, 350, 180, &bman.init_timeout, 1200, MENU_entryint32, 16); menu_create_button ("Game Options", -1, 350, 150, 16);
menu_create_button ("Ok", -1, 380, 150, 0); menu_create_button ("Ok", -1, 380, 150, 0);
menuselect = menu_loop (); menuselect = menu_loop ();
menu_delete (); menu_delete ();
@ -128,6 +127,9 @@ mapmenu ()
else else
strcpy (map.tileset, mapname); strcpy (map.tileset, mapname);
break; break;
case (16): /* Game Settings */
mapgamesetting ();
} }
/* map type */ /* map type */
@ -151,7 +153,7 @@ mapmenu ()
if (map.size.y > MAX_FIELDSIZE_Y) if (map.size.y > MAX_FIELDSIZE_Y)
map.size.y = MAX_FIELDSIZE_Y; map.size.y = MAX_FIELDSIZE_Y;
config_write ();
} }
@ -315,3 +317,31 @@ mapinfo ()
#undef WIN_X #undef WIN_X
#undef WIN_Y #undef WIN_Y
/* change start settings for the game */
void mapgamesetting () {
int menuselect = 0;
while (menuselect != -1 && bman.state != GS_quit) {
menu_new ("Game Options", 420, 400);
menu_create_label ("Start Values", 25, 50, 0);
menu_create_entry ("Bombs:", 25, 80, 150, &bman.start_bombs, MAX_BOMBS, MENU_entryint32, 1);
menu_create_entry ("Speed:", 25,110, 150, &bman.start_speed, MAX_SPEED, MENU_entryfloat, 2);
menu_create_entry ("Range:", 25,140, 150, &bman.start_range, MAX_RANGE, MENU_entryint32, 3);
menu_create_label ("Other Values", 200, 50, 0);
menu_create_entry ("Gametime:", 200, 80, 150, &bman.init_timeout, 1200, MENU_entryint32, 4);
menu_create_label ("Game Parameter", 25, 180, 1);
menu_create_entry ("Bomb Time:", 25, 220, 200, &bman.bomb_tickingtime, 1200, MENU_entryfloat, 5);
menu_create_button ("Ok", -1, 380, 150, 0);
menuselect = menu_loop ();
menu_delete ();
if (menuselect == 0)
menuselect = -1;
}
};

@ -1213,6 +1213,11 @@ send_mapinfo (_net_addr * addr)
map_pkg.sp_trigger = map.sp_trigger; map_pkg.sp_trigger = map.sp_trigger;
map_pkg.sp_row = map.sp_row; map_pkg.sp_row = map.sp_row;
map_pkg.sp_push = map.sp_push; map_pkg.sp_push = map.sp_push;
map_pkg.start_bombs = bman.start_bombs;
map_pkg.start_range = bman.start_range;
sprintf (map_pkg.start_speed, "%6f", bman.start_speed);
sprintf (map_pkg.bomb_tickingtime, "%6f", bman.bomb_tickingtime);
if (map.random_tileset) if (map.random_tileset)
map_pkg.tileset[0] = 0; map_pkg.tileset[0] = 0;
else else
@ -1253,6 +1258,11 @@ do_mapinfo (struct pkg_mapinfo *map_pkg, _net_addr * addr)
map.sp_trigger = map_pkg->sp_trigger; map.sp_trigger = map_pkg->sp_trigger;
map.sp_push = map_pkg->sp_push; map.sp_push = map_pkg->sp_push;
map.sp_row = map_pkg->sp_row; map.sp_row = map_pkg->sp_row;
bman.start_bombs = map_pkg->start_bombs;
bman.start_range = map_pkg->start_range;
sscanf (map_pkg->start_speed, "%f", &bman.start_speed);
sscanf (map_pkg->bomb_tickingtime, "%f", &bman.bomb_tickingtime);
}; };

@ -1,4 +1,4 @@
/* $Id: player.c,v 1.65 2004/01/07 23:04:32 patty21 Exp $ /* $Id: player.c,v 1.66 2004/01/25 14:10:45 stpohle Exp $
* player.c - everything what have to do with the player */ * player.c - everything what have to do with the player */
#include <SDL.h> #include <SDL.h>
@ -462,7 +462,7 @@ player_drop_bomb (int pl_nr)
} }
else { else {
bomb->state = BS_ticking; bomb->state = BS_ticking;
bomb->to = BOMB_TIMEOUT; bomb->to = bman.bomb_tickingtime;
} }
bomb->mode = BM_normal; bomb->mode = BM_normal;
bomb->ex_nr = -1; bomb->ex_nr = -1;

@ -1,4 +1,4 @@
/* $Id: special.c,v 1.30 2004/01/07 23:04:32 patty21 Exp $ */ /* $Id: special.c,v 1.31 2004/01/25 14:10:47 stpohle Exp $ */
/* special.c - procedues to control the specials */ /* special.c - procedues to control the specials */
#include "bomberclone.h" #include "bomberclone.h"
@ -76,7 +76,7 @@ special_row (int p_nr)
b->ex_nr = -1; b->ex_nr = -1;
b->pos.x = x; b->pos.x = x;
b->pos.y = y; b->pos.y = y;
b->to = BOMB_TIMEOUT + t; // 5 Secs * 200 b->to = bman.bomb_tickingtime + t; // 5 Secs * 200
map.bfield[x][y] = 1; map.bfield[x][y] = 1;
if (GT_MP) { if (GT_MP) {
net_game_send_bomb (p_nr, i); net_game_send_bomb (p_nr, i);
@ -353,8 +353,8 @@ special_clear (int p_nr)
bomb = &players[p_nr].bombs[i]; bomb = &players[p_nr].bombs[i];
if (bomb->state == BS_trigger) { if (bomb->state == BS_trigger) {
bomb->state = BS_ticking; bomb->state = BS_ticking;
if (bomb->to > BOMB_TIMEOUT) if (bomb->to > bman.bomb_tickingtime)
bomb->to = BOMB_TIMEOUT; bomb->to = bman.bomb_tickingtime;
} }
} }
} }

Loading…
Cancel
Save