Illness Problem again..

origin
stpohle 22 years ago
parent 23784f9d16
commit 2ba905cadd

@ -1,4 +1,4 @@
/* $Id: bomberclone.h,v 1.13 2004/01/06 01:24:55 stpohle Exp $ */ /* $Id: bomberclone.h,v 1.14 2004/01/06 02:19:56 stpohle Exp $ */
/* bomberclone.h */ /* bomberclone.h */
#ifndef _BOMBERCLONE_H_ #ifndef _BOMBERCLONE_H_
@ -205,7 +205,7 @@ extern int check_exfield (short int x, short int y);
extern void player_calcpos (); extern void player_calcpos ();
extern void player_set_ilness (_player * p, int t, float new_to); extern void player_set_ilness (_player * p, int t, float new_to);
extern void player_clear_ilness (_player *p, int type); extern void player_clear_ilness (_player *p, int type);
extern void player_ilness_loop (); extern void player_ilness_loop (int plnr);
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);

@ -68,7 +68,8 @@ void d_fatal (char *fmt,...) {
void debug_ingameinfo() { void debug_ingameinfo() {
int i; int i, j;
float fl;
char text[255]; char text[255];
for (i = 0; i < map.size.x; i++) for (i = 0; i < map.size.x; i++)
@ -81,8 +82,13 @@ void debug_ingameinfo() {
sprintf (text, "P:"); sprintf (text, "P:");
for (i = 0; i < MAX_PLAYERS; i++) for (i = 0; i < MAX_PLAYERS; i++)
if (PS_IS_playing (players[i].state)) if (PS_IS_playing (players[i].state)) {
sprintf (text, "%s %2.2f,%2.2f[%2.2f]", text, players[i].pos.x, players[i].pos.y, players[i].frame); for (j = 0, fl = 0.0f; j < PI_max; j++)
if (fl < players[i].ill[j].to)
fl = players[i].ill[j].to;
sprintf (text, "%s TO:%2.2f ", text, fl);
}
font_gfxdraw (0, gfx.res.y-font[0].size.y*2, text, 0, 0, (map.size.y*256)+10); font_gfxdraw (0, gfx.res.y-font[0].size.y*2, text, 0, 0, (map.size.y*256)+10);
if (bman.p_nr >= 0 && bman.p_nr < MAX_PLAYERS) { if (bman.p_nr >= 0 && bman.p_nr < MAX_PLAYERS) {

@ -1,4 +1,4 @@
/* $Id: game.c,v 1.67 2004/01/04 01:28:34 stpohle Exp $ /* $Id: game.c,v 1.68 2004/01/06 02:19:57 stpohle Exp $
game.c - procedures for the game. */ game.c - procedures for the game. */
#include <string.h> #include <string.h>
@ -208,6 +208,12 @@ game_loop ()
bman.updatestatusbar = 1; // force an update bman.updatestatusbar = 1; // force an update
} }
if (keys[SDLK_F9] && event.type == SDL_KEYDOWN) {
/* Switch Fullscreen */
debug = !debug;
bman.updatestatusbar = 1; // force an update
}
if (event.key.keysym.sym == SDLK_ESCAPE && event.type == SDL_KEYDOWN) { if (event.key.keysym.sym == SDLK_ESCAPE && event.type == SDL_KEYDOWN) {
bman.state = GS_startup; bman.state = GS_startup;
done = 1; done = 1;

@ -1,4 +1,4 @@
/* $Id: player.c,v 1.63 2004/01/06 01:24:56 stpohle Exp $ /* $Id: player.c,v 1.64 2004/01/06 02:19:57 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>
@ -40,13 +40,13 @@ draw_player (_player * player)
for (i = PI_max - 1; (i >= 0) && (player->ill[i].to <= 0.0f); i--); for (i = PI_max - 1; (i >= 0) && (player->ill[i].to <= 0.0f); i--);
if (i >= 0) { if (i >= 0) {
player->illframe += timefactor; player->illframe += timefactor;
if (player->illframe > gfx.ill.frames) while (player->illframe >= gfx.ill.frames)
player->illframe = 0.0f; player->illframe -= gfx.ill.frames;
dest.w = src.w = gfx.block.x * 2; dest.w = src.w = gfx.block.x * 2;
dest.h = src.h = gfx.block.y * 2; dest.h = src.h = gfx.block.y * 2;
src.x = 0; src.x = 0;
src.y = (2 * gfx.block.y) * (int)player->illframe; src.y = (int)player->illframe * (2 * gfx.block.y);
dest.x = dest.x =
gfx.offset.x + ((player->pos.x-0.5f) * gfx.block.x); gfx.offset.x + ((player->pos.x-0.5f) * gfx.block.x);
dest.y = dest.y =
@ -597,7 +597,7 @@ player_calcpos ()
void void
player_ilness_loop () player_ilness_loop (int plnr)
{ {
_player *p; _player *p;
int type, int type,
@ -607,10 +607,9 @@ player_ilness_loop ()
float tmpf; float tmpf;
int pl[MAX_PLAYERS + 1]; int pl[MAX_PLAYERS + 1];
/* do the illness for the network players */ /* do the illness for the network and ai players */
if (GT_MP) {
for (pnr = 0; pnr < MAX_PLAYERS; pnr++) for (pnr = 0; pnr < MAX_PLAYERS; pnr++)
if (pnr != bman.p_nr && PS_IS_alife (players[pnr].state) && PS_IS_netplayer (players[pnr].state)) { if (pnr != plnr && PS_IS_alife (players[pnr].state) && PS_IS_netplayer (players[pnr].state)) {
p = &players[pnr]; p = &players[pnr];
for (type = 0; type < PI_max; type++) for (type = 0; type < PI_max; type++)
if (p->ill[type].to > 0.0f) { if (p->ill[type].to > 0.0f) {
@ -620,13 +619,12 @@ player_ilness_loop ()
p->illframe = 0.0f; p->illframe = 0.0f;
} }
} }
}
/* check if we have contact with an other ill player */ /* check if we have contact with an other ill player */
p = &players[bman.p_nr]; p = &players[plnr];
get_player_on (p->pos.x, p->pos.y, pl); get_player_on (p->pos.x, p->pos.y, pl);
for (i = 0; (pl[i] != -1 && i < MAX_PLAYERS); i++) for (i = 0; (pl[i] != -1 && i < MAX_PLAYERS); i++)
if (pl[i] != bman.p_nr) { if (pl[i] != plnr) {
send = 0; send = 0;
for (type = 0; type < PI_max; type++) { for (type = 0; type < PI_max; type++) {
if (players[pl[i]].ill[type].to > p->ill[type].to) { if (players[pl[i]].ill[type].to > p->ill[type].to) {
@ -638,7 +636,7 @@ player_ilness_loop ()
} }
} }
if (send != 0 && GT_MP) if (send != 0 && GT_MP)
net_game_send_ill (bman.p_nr); net_game_send_ill (plnr);
} }
/* do the illness for the givin player */ /* do the illness for the givin player */
@ -672,7 +670,7 @@ player_ilness_loop ()
} }
else if (type == PI_bomb) else if (type == PI_bomb)
/* player is dropping bombs */ /* player is dropping bombs */
player_drop_bomb (bman.p_nr); player_drop_bomb (plnr);
} }
} }
} }

Loading…
Cancel
Save