From 9caabcb9ba67995f3b131c1c711320c3a581d9ac Mon Sep 17 00:00:00 2001 From: stpohle Date: Sun, 11 May 2003 23:32:42 +0000 Subject: [PATCH] setting single mode back for release of 0.9.8 --- src/game.c | 3 +-- src/single.c | 39 ++++++++++++++++++++++++++++++++++++--- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/src/game.c b/src/game.c index 4b8d97f..b35d227 100644 --- a/src/game.c +++ b/src/game.c @@ -50,7 +50,6 @@ game_draw_info () SDL_BlitSurface (bman.players[i].gfx->smal_image, &src, gfx.screen, &dest); } - sprintf (scrtext, "%10s:%2d", bman.players[i].name, bman.players[i].points); if ((bman.players[i].state & PSFM_alife) != PSFM_alife) { // Player is dead draw_text (x, j, scrtext, 0); @@ -213,7 +212,7 @@ game_loop () /* check if there is only one player left and the game is in multiplayer mode and if there the last dieing animation is done */ - if (bman.players_nr < 2) + if ((GT_MP_PTP && bman.players_nr < 2) || (bman.players_nr == 0)) gameovertimeout--; if (gameovertimeout <= 0) { diff --git a/src/single.c b/src/single.c index da91b36..5b2c2b8 100644 --- a/src/single.c +++ b/src/single.c @@ -1,4 +1,4 @@ -/* $Id: single.c,v 1.11 2003/05/11 17:27:30 stpohle Exp $ */ +/* $Id: single.c,v 1.12 2003/05/11 23:32:42 stpohle Exp $ */ /* single player */ #include "basic.h" @@ -60,16 +60,49 @@ single_game_new () bman.state = GS_running; }; +/* check if is there is a bom in the near + returns the directions (bits 0(left)-3(down)) where a bomb is */ +int ai_findnearbombs (_player *pl) { + int d, + res = 0, // result if there is a bomb + dist[4][3]; // to check every direction (on three ways) + _point m[4]; // direction addition + + for (d = 0; d < 4; d++) { + switch (d) { + case (left): + m[d].x = -1; + m[d].y = 0; + break; + case (right): + m[d].x = 1; + m[d].y = 0; + break; + case (up): + m[d].x = 0; + m[d].y = -1; + break; + case (down): + m[d].x = 0; + m[d].y = 1; + break; + } + }; + + return res; +} + void single_loop () { int p; _player *pl; - + for (p = 0; p < MAX_PLAYERS; p++) if (p != bman.p_nr && PS_IS_playing (bman.players[p].state)) { pl = &bman.players[p]; + player_ilness_loop (p); } }; @@ -105,7 +138,7 @@ void single_playergame () { for (p = 0; p < MAX_PLAYERS; p++) bman.players[p].state = 0; - single_create_ai (4); +// single_create_ai (4); single_game_new (); gfx_game_init (); game_loop ();