X-Git-Url: https://git.cameronkatri.com/bsdgames-darwin.git/blobdiff_plain/55c4a511be47d16c259623bf0f76ddd0df0a42ac..HEAD:/robots/play_level.c diff --git a/robots/play_level.c b/robots/play_level.c index 8f5e1d40..f338e9df 100644 --- a/robots/play_level.c +++ b/robots/play_level.c @@ -1,4 +1,4 @@ -/* $NetBSD: play_level.c,v 1.3 1995/04/22 10:09:03 cgd Exp $ */ +/* $NetBSD: play_level.c,v 1.9 2009/07/20 06:39:06 dholland Exp $ */ /* * Copyright (c) 1980, 1993 @@ -12,11 +12,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -33,24 +29,27 @@ * SUCH DAMAGE. */ +#include #ifndef lint #if 0 static char sccsid[] = "@(#)play_level.c 8.1 (Berkeley) 5/31/93"; #else -static char rcsid[] = "$NetBSD: play_level.c,v 1.3 1995/04/22 10:09:03 cgd Exp $"; +__RCSID("$NetBSD: play_level.c,v 1.9 2009/07/20 06:39:06 dholland Exp $"); #endif #endif /* not lint */ -# include "robots.h" +#include +#include +#include "robots.h" /* * play_level: * Let the player play the current level */ -play_level() +void +play_level(void) { - register COORD *cp; - register int y, x, bonus; + COORD *cp; move(My_pos.y, My_pos.x); addch(PLAYER); @@ -62,14 +61,14 @@ play_level() addch(ROBOT); } refresh(); -# ifdef DEBUG +#ifdef DEBUG standout(); move(Min.y, Min.x); addch(inch()); move(Max.y, Max.x); addch(inch()); standend(); -# endif DEBUG +#endif /* DEBUG */ setjmp(End_move); flush_in(); while (!Dead && Num_robots > 0) { @@ -80,15 +79,15 @@ play_level() if (Real_time) alarm(0); if (Field[My_pos.y][My_pos.x] != 0) - Dead = TRUE; + Dead = true; if (!Dead) - move_robots(FALSE); + move_robots(false); if (Was_bonus) { move(Y_PROMPT, X_PROMPT); clrtoeol(); move(Y_PROMPT + 1, X_PROMPT); clrtoeol(); - Was_bonus = FALSE; + Was_bonus = false; } } @@ -97,14 +96,14 @@ play_level() */ if (!Dead) { - Was_bonus = FALSE; + Was_bonus = false; if (Level == Start_level && Start_level > 1) { move(Y_PROMPT, X_PROMPT); printw("Advance bonus: %d", S_BONUS); refresh(); add_score(S_BONUS); - Was_bonus = TRUE; + Was_bonus = true; } if (Wait_bonus != 0) { @@ -115,7 +114,7 @@ play_level() printw("Wait bonus: %d", Wait_bonus); refresh(); add_score(Wait_bonus); - Was_bonus = TRUE; + Was_bonus = true; } } }