-/* $NetBSD: pl_5.c,v 1.21 2009/03/14 19:35:13 dholland Exp $ */
+/* $NetBSD: pl_5.c,v 1.26 2019/02/03 03:19:25 mrg Exp $ */
/*
* Copyright (c) 1983, 1993
#if 0
static char sccsid[] = "@(#)pl_5.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: pl_5.c,v 1.21 2009/03/14 19:35:13 dholland Exp $");
+__RCSID("$NetBSD: pl_5.c,v 1.26 2019/02/03 03:19:25 mrg Exp $");
#endif
#endif /* not lint */
#include <ctype.h>
-#include <curses.h>
#include <signal.h>
#include <stdio.h>
#include <string.h>
{
int ta;
int ma;
- char af;
- int moved = 0;
+ bool af;
+ bool moved = false;
int vma, dir;
char promptstr[60];
char buf[60], last = '\0';
switch (*p) {
case 'l':
dir -= 2;
+ /* FALLTHROUGH */
case 'r':
if (++dir == 0)
dir = 8;
*p-- = '\0';
}
last = '0';
- moved = 1;
+ moved = true;
ma -= *p - '0';
vma -= *p - '0';
if ((ta < 0 && moved) || (vma < 0 && moved))
Msg("Movement error.");
if (ta < 0 && moved) {
if (mf->FS == 1) {
- Write(W_FS, ms, 0, 0, 0, 0);
+ send_fs(ms, 0);
Msg("No hands to set full sails.");
}
} else if (ma >= 0)
}
if (af && !moved) {
if (mf->FS == 1) {
- Write(W_FS, ms, 0, 0, 0, 0);
+ send_fs(ms, 0);
Msg("No hands to set full sails.");
}
}
strlcpy(movebuf, buf, sizeof(movebuf));
else
strlcpy(movebuf, "d", sizeof(movebuf));
- Writestr(W_MOVE, ms, movebuf);
+ send_move(ms, movebuf);
Msg("Helm: %s.", movebuf);
}
(struct ship *)0, 1);
parties(ms, crew, 1, c);
}
- blockalarm();
- draw_slot();
- unblockalarm();
}
static void
}
if (buf > '0')
Msg("Sending all crew sections.");
- Write(isdefense ? W_DBP : W_OBP, ms,
- j, turn, to->file->index, men);
if (isdefense) {
- wmove(slot_w, 2, 0);
+ send_dbp(ms, j, turn, to->file->index, men);
+ } else {
+ send_obp(ms, j, turn, to->file->index, men);
+ }
+ if (isdefense) {
for (k=0; k < NBP; k++)
- if (temp[k] && !crew[k])
- waddch(slot_w, k + '1');
- else
- wmove(slot_w, 2, 1 + k);
- mvwaddstr(slot_w, 3, 0, "DBP");
+ display_set_dbp(k,
+ temp[k] && !crew[k]);
makemsg(ms, "repelling boarders");
} else {
- wmove(slot_w, 0, 0);
for (k=0; k < NBP; k++)
- if (temp[k] && !crew[k])
- waddch(slot_w, k + '1');
- else
- wmove(slot_w, 0, 1 + k);
- mvwaddstr(slot_w, 1, 0, "OBP");
+ display_set_obp(k,
+ temp[k] && !crew[k]);
makesignal(ms, "boarding the $$", to);
}
- blockalarm();
- wrefresh(slot_w);
- unblockalarm();
} else
Msg("Sending no crew sections.");
}