xref: /netbsd/games/sail/player.h (revision da121b33)
1*da121b33Sdholland /*	$NetBSD: player.h,v 1.13 2009/08/12 09:05:08 dholland Exp $	*/
2982615d7Scgd 
361f28255Scgd /*
4982615d7Scgd  * Copyright (c) 1983, 1993
5982615d7Scgd  *	The Regents of the University of California.  All rights reserved.
661f28255Scgd  *
761f28255Scgd  * Redistribution and use in source and binary forms, with or without
861f28255Scgd  * modification, are permitted provided that the following conditions
961f28255Scgd  * are met:
1061f28255Scgd  * 1. Redistributions of source code must retain the above copyright
1161f28255Scgd  *    notice, this list of conditions and the following disclaimer.
1261f28255Scgd  * 2. Redistributions in binary form must reproduce the above copyright
1361f28255Scgd  *    notice, this list of conditions and the following disclaimer in the
1461f28255Scgd  *    documentation and/or other materials provided with the distribution.
15e5aeb4eaSagc  * 3. Neither the name of the University nor the names of its contributors
1661f28255Scgd  *    may be used to endorse or promote products derived from this software
1761f28255Scgd  *    without specific prior written permission.
1861f28255Scgd  *
1961f28255Scgd  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2061f28255Scgd  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2161f28255Scgd  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2261f28255Scgd  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2361f28255Scgd  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2461f28255Scgd  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2561f28255Scgd  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2661f28255Scgd  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2761f28255Scgd  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2861f28255Scgd  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2961f28255Scgd  * SUCH DAMAGE.
3061f28255Scgd  *
31156daa7aStls  *	@(#)player.h	8.2 (Berkeley) 5/3/95
3261f28255Scgd  */
3361f28255Scgd 
3461f28255Scgd /* sizes and coordinates for the screen */
3561f28255Scgd 
3661f28255Scgd #define LINE_T		0
3761f28255Scgd #define LINE_L		0
3861f28255Scgd #define LINE_X		COLS
3961f28255Scgd #define LINE_Y		1
4061f28255Scgd #define LINE_B		(LINE_T+LINE_Y-1)
4161f28255Scgd #define LINE_R		(LINE_L+LINE_X-1)
4261f28255Scgd 
4361f28255Scgd #define BOX_T		1
4461f28255Scgd #define BOX_L		0
4561f28255Scgd #define BOX_X		65
4661f28255Scgd #define BOX_Y		16
4761f28255Scgd #define BOX_B		(BOX_T+BOX_Y-1)
4861f28255Scgd #define BOX_R		(BOX_L+BOX_X-1)
4961f28255Scgd 
5061f28255Scgd #define TURN_T		BOX_B
5161f28255Scgd #define TURN_Y		1
5261f28255Scgd #define TURN_L		((BOX_L+BOX_R-TURN_X)/2)
5361f28255Scgd #define TURN_X		9
5461f28255Scgd #define TURN_B		(TURN_T+TURN_Y+1)
5561f28255Scgd #define TURN_R		(TURN_L+TURN_X+1)
5661f28255Scgd 
5761f28255Scgd #define STAT_T		0
5861f28255Scgd #define STAT_B		BOX_B
5961f28255Scgd #define STAT_L		(BOX_R+2)
6061f28255Scgd #define STAT_X		14
6161f28255Scgd #define STAT_Y		(STAT_B-STAT_T+1)
6261f28255Scgd #define STAT_R		(STAT_L+STAT_X-1)
6361f28255Scgd #define STAT_1		0
6461f28255Scgd #define STAT_2          (STAT_1+4)
6561f28255Scgd #define STAT_3          (STAT_2+7)
6661f28255Scgd 
6761f28255Scgd #define SCROLL_T	(BOX_B+1)
6861f28255Scgd #define SCROLL_L	0
6961f28255Scgd #define SCROLL_B	(LINES-1)
7061f28255Scgd #define SCROLL_R	(COLS-1)
7161f28255Scgd #define SCROLL_X	(SCROLL_R-SCROLL_L+1)
7261f28255Scgd #define SCROLL_Y	(SCROLL_B-SCROLL_T+1)
7361f28255Scgd 
7461f28255Scgd #define VIEW_T		(BOX_T+1)
7561f28255Scgd #define VIEW_L		(BOX_L+1)
7661f28255Scgd #define VIEW_X		(BOX_X-5)
7761f28255Scgd #define VIEW_Y		(BOX_Y-2)
7861f28255Scgd #define VIEW_B		(VIEW_T+VIEW_Y-1)
7961f28255Scgd #define VIEW_R		(VIEW_L+VIEW_X-1)
8061f28255Scgd 
8161f28255Scgd #define SLOT_T		VIEW_T
8261f28255Scgd #define SLOT_L		(VIEW_R+1)
8361f28255Scgd #define SLOT_X		3
8461f28255Scgd #define SLOT_Y		VIEW_Y
8561f28255Scgd #define SLOT_B		VIEW_B
8661f28255Scgd #define SLOT_R		(SLOT_L+SLOT_X-1)
8761f28255Scgd 
88d62e34ecSjwise extern int done_curses;
89d62e34ecSjwise extern int loaded, fired, changed, repaired;
90d62e34ecSjwise extern int dont_adjust;
9173479d22Sjsm extern char movebuf[sizeof SHIP(0)->file->movebuf];
922a767ad3Sdholland extern const char version[];
9373479d22Sjsm extern int player;
9473479d22Sjsm extern struct ship *ms;		/* memorial structure, &cc->ship[player] */
9573479d22Sjsm extern struct File *mf;		/* ms->file */
9673479d22Sjsm extern struct shipspecs *mc;	/* ms->specs */
9761f28255Scgd 
9861f28255Scgd /* condition codes for leave() */
9961f28255Scgd #define LEAVE_QUIT	0
10061f28255Scgd #define LEAVE_CAPTURED	1
10161f28255Scgd #define LEAVE_HURRICAN	2
10261f28255Scgd #define LEAVE_DRIVER	3
10361f28255Scgd #define LEAVE_FORK	4
10461f28255Scgd #define LEAVE_SYNC	5
105