static char *sccsid
= "@(#)pl_5.c 2.5 83/12/21";
#define turnfirst(x) (*x == 'r' || *x == 'l')
char buf
[60], last
= '\0';
if (!mc
->crew3
|| snagged(ms
) || !windspeed
) {
Signal("Unable to move", (struct ship
*)0);
ma
= maxmove(ms
, mf
->dir
, 0);
(void) sprintf(prompt
, "move (%d,%c%d): ", ma
, af
? '\'' : ' ', ta
);
sgetstr(prompt
, buf
, sizeof buf
);
Signal("Ship can't turn that fast.",
vma
= min(ma
, maxmove(ms
, dir
, 0));
if (ta
< 0 && moved
|| vma
< 0 && moved
)
if (ta
< 0 && moved
|| vma
< 0 && moved
)
case '1': case '2': case '3': case '4':
case '5': case '6': case '7':
Signal("Can't move that fast.",
if (ta
< 0 && moved
|| vma
< 0 && moved
)
Signal("Input error.", (struct ship
*)0);
if (ta
< 0 && moved
|| vma
< 0 && moved
|| af
&& turnfirst(buf
) && moved
) {
Signal("Movement error.", (struct ship
*)0);
Write(W_FS
, ms
, 0, 0, 0, 0, 0);
Signal("No hands to set full sails.",
Write(W_FS
, ms
, 0, 0, 0, 0, 0);
Signal("No hands to set full sails.",
(void) strcpy(movebuf
, buf
);
(void) strcpy(movebuf
, "d");
Write(W_MOVE
, ms
, 1, (int)movebuf
, 0, 0, 0);
Signal("Helm: %s.", (struct ship
*)0, movebuf
);
register struct ship
*sp
;
for (n
= 0; n
< NBP
; n
++) {
men
+= mf
->OBP
[n
].mensent
;
for (n
= 0; n
< NBP
; n
++) {
men
+= mf
->DBP
[n
].mensent
;
crew
[0] = men
/100 ? 0 : crew
[0] != 0;
crew
[1] = (men
%100)/10 ? 0 : crew
[1] != 0;
crew
[2] = men
%10 ? 0 : crew
[2] != 0;
if (sp
== ms
|| sp
->file
->dir
== 0 || range(ms
, sp
) > 1)
if (ms
->nationality
== capship(sp
)->nationality
)
if (meleeing(ms
, sp
) && crew
[2]) {
c
= sgetch("How many more to board the %s (%c%c)? ",
} else if ((fouled2(ms
, sp
) || grappled2(ms
, sp
)) && crew
[2]) {
c
= sgetch("Crew sections to board the %s (%c%c) (3 max) ?", sp
, 1);
c
= sgetch("How many sections to repel boarders? ",
parties(crew
, to
, isdefense
, buf
)
register struct ship
*to
;
ptr
= isdefense
? to
->file
->DBP
: to
->file
->OBP
;
for (j
= 0; j
< NBP
&& ptr
[j
].turnsent
; j
++)
if (!ptr
[j
].turnsent
&& buf
> '0') {
for (k
= 0; k
< 3 && buf
> '0'; k
++) {
* (k
== 0 ? 100 : (k
== 1 ? 10 : 1));
Signal("Sending all crew sections.",
Write(isdefense
? W_DBP
: W_OBP
, ms
, 0,
j
, turn
, to
->file
->index
, men
);
(void) wmove(slot_w
, 2, 0);
(void) waddch(slot_w
, k
+ '1');
(void) wmove(slot_w
, 2, 1 + k
);
(void) mvwaddstr(slot_w
, 3, 0, "DBP");
makesignal(ms
, "repelling boarders",
(void) wmove(slot_w
, 0, 0);
(void) waddch(slot_w
, k
+ '1');
(void) wmove(slot_w
, 0, 1 + k
);
(void) mvwaddstr(slot_w
, 1, 0, "OBP");
makesignal(ms
, "boarding the %s (%c%c)", to
);
Signal("Sending no crew sections.", (struct ship
*)0);