-/* $NetBSD: init_field.c,v 1.4 1997/05/23 23:40:16 jtc Exp $ */
+/* $NetBSD: init_field.c,v 1.12 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[] = "@(#)init_field.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$NetBSD: init_field.c,v 1.4 1997/05/23 23:40:16 jtc Exp $";
+__RCSID("$NetBSD: init_field.c,v 1.12 2009/07/20 06:39:06 dholland Exp $");
#endif
#endif /* not lint */
-# include "robots.h"
+#include <curses.h>
+#include "robots.h"
+
+static int telx = 0;
+static int tely = 0;
/*
* init_field:
* Lay down the initial pattern whih is constant across all levels,
* and initialize all the global variables.
*/
-init_field()
+void
+init_field(void)
{
- register int i;
- register WINDOW *wp;
- register int j;
- static bool first = TRUE;
- static char *desc[] = {
+ int i;
+ static bool first = true;
+ static const char *const desc[] = {
"Directions:",
"",
"y k u",
NULL
};
- Dead = FALSE;
- Waiting = FALSE;
+ Dead = false;
+ Waiting = false;
Score = 0;
erase();
move(i, X_FIELDSIZE + 2);
addstr(desc[i]);
}
+ telx = X_FIELDSIZE + 2;
+ tely = i;
if (first)
refresh();
- first = FALSE;
-#ifdef FANCY
+ first = false;
+#ifdef FANCY
if (Pattern_roll)
Next_move = &Move_list[-1];
#endif
}
+
+void
+telmsg(int on)
+{
+ move(tely, telx);
+ addstr(on ? "Teleport!" : " ");
+}