1 /* $NetBSD: pl_2.c,v 1.13 2009/03/15 03:33:56 dholland Exp $ */
4 * Copyright (c) 1983, 1993
5 * The Regents of the University of California. All rights reserved.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the University nor the names of its contributors
16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission.
19 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 #include <sys/cdefs.h>
35 static char sccsid[] = "@(#)pl_2.c 8.1 (Berkeley) 5/31/93";
37 __RCSID("$NetBSD: pl_2.c,v 1.13 2009/03/15 03:33:56 dholland Exp $");
49 newturn(int n __unused)
51 repaired = loaded = fired = changed = 0;
55 if (mf->readyL & R_LOADING) {
56 if (mf->readyL & R_DOUBLE)
57 mf->readyL = R_LOADING;
59 mf->readyL = R_LOADED;
61 if (mf->readyR & R_LOADING) {
62 if (mf->readyR & R_DOUBLE)
63 mf->readyR = R_LOADING;
65 mf->readyR = R_LOADED;
70 display_hide_prompt();
75 display_reshow_prompt();
79 if (mf->FS && (!mc->rig1 || windspeed == 6))
86 if (mf->captured != 0)
87 leave(LEAVE_CAPTURED);
89 leave(LEAVE_HURRICAN);
91 display_adjust_view();
94 signal(SIGALRM, newturn);
108 switch (sgetch("~ ", (struct ship *)0, 0)) {
110 display_scroll_pagedown();
113 display_scroll_pageup();
146 Msg("'Hands to stations!'");
147 unboard(ms, ms, 1); /* cancel DBP's */
148 unboard(ms, ms, 0); /* cancel offense */
152 display_force_full_redraw();
157 mf->readyL = R_EMPTY;
158 mf->readyR = R_EMPTY;
159 Msg("Broadsides unloaded");
162 Msg("Type 'Q' to quit");
173 if ((sp = closestenemy(ms, 0, 1)) == 0)
174 Msg("No more ships left.");
198 dont_adjust = !dont_adjust;