Be more verbose about teleports, and fix a minor problem in autobot mode.

This commit is contained in:
christos 2002-01-31 17:35:52 +00:00
parent 4495f84bf9
commit fc92c2f743
4 changed files with 26 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: auto.c,v 1.4 1999/09/08 21:17:56 jsm Exp $ */
/* $NetBSD: auto.c,v 1.5 2002/01/31 17:35:52 christos Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@ -236,7 +236,7 @@ move_towards(dx, dy)
(void)strcpy(ok_moves, find_moves());
best_move = ok_moves[0];
if (best_move != 'F') {
if (best_move != 't') {
mvx = xinc(best_move);
mvy = yinc(best_move);
move_judge = ABS(mvx - dx) + ABS(mvy - dy);

View File

@ -1,4 +1,4 @@
/* $NetBSD: init_field.c,v 1.6 1999/09/08 21:17:57 jsm Exp $ */
/* $NetBSD: init_field.c,v 1.7 2002/01/31 17:35:52 christos Exp $ */
/*
* Copyright (c) 1980, 1993
@ -38,12 +38,15 @@
#if 0
static char sccsid[] = "@(#)init_field.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: init_field.c,v 1.6 1999/09/08 21:17:57 jsm Exp $");
__RCSID("$NetBSD: init_field.c,v 1.7 2002/01/31 17:35:52 christos Exp $");
#endif
#endif /* not lint */
# include "robots.h"
static int telx = 0;
static int tely = 0;
/*
* init_field:
* Lay down the initial pattern whih is constant across all levels,
@ -112,6 +115,8 @@ init_field()
move(i, X_FIELDSIZE + 2);
addstr(desc[i]);
}
telx = X_FIELDSIZE + 2;
tely = i;
if (first)
refresh();
first = FALSE;
@ -120,3 +125,11 @@ init_field()
Next_move = &Move_list[-1];
#endif
}
void
telmsg(on)
int on;
{
move(tely, telx);
addstr(on ? "Teleport!" : " ");
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: move.c,v 1.9 1999/09/08 21:17:57 jsm Exp $ */
/* $NetBSD: move.c,v 1.10 2002/01/31 17:35:52 christos Exp $ */
/*
* Copyright (c) 1980, 1993
@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)move.c 8.1 (Berkeley) 5/31/93";
#else
__RCSID("$NetBSD: move.c,v 1.9 1999/09/08 21:17:57 jsm Exp $");
__RCSID("$NetBSD: move.c,v 1.10 2002/01/31 17:35:52 christos Exp $");
#endif
#endif /* not lint */
@ -175,6 +175,10 @@ teleport:
Running = FALSE;
mvaddch(My_pos.y, My_pos.x, ' ');
My_pos = *rnd_pos();
telmsg(1);
refresh();
sleep(1);
telmsg(0);
mvaddch(My_pos.y, My_pos.x, PLAYER);
leaveok(stdscr, FALSE);
refresh();

View File

@ -1,4 +1,4 @@
/* $NetBSD: robots.h,v 1.14 1999/09/30 18:01:33 jsm Exp $ */
/* $NetBSD: robots.h,v 1.15 2002/01/31 17:35:52 christos Exp $ */
/*
* Copyright (c) 1980, 1993
@ -125,6 +125,7 @@ extern jmp_buf End_move;
void add_score __P((int));
bool another __P((void));
char automove __P((void));
int cmp_sc __P((const void *, const void *));
bool do_move __P((int, int));
bool eaten __P((const COORD *));
@ -145,4 +146,4 @@ void score __P((int));
void set_name __P((SCORE *));
void show_score __P((void));
int sign __P((int));
char automove __P((void));
void telmsg __P((int));