-/* $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
* 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.
*
* SUCH DAMAGE.
*/
+#include <sys/cdefs.h>
#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 <curses.h>
+#include <unistd.h>
+#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);
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) {
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;
}
}
*/
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) {
printw("Wait bonus: %d", Wait_bonus);
refresh();
add_score(Wait_bonus);
- Was_bonus = TRUE;
+ Was_bonus = true;
}
}
}