xref: /openbsd/games/monop/monop.def (revision e5dd7070)
1/*	$OpenBSD: monop.def,v 1.7 2016/01/08 18:19:47 mestre Exp $	*/
2/*	$NetBSD: monop.def,v 1.3 1995/03/23 08:34:54 cgd Exp $	*/
3
4/*-
5 * Copyright (c) 1980, 1993
6 *	The Regents of the University of California.  All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
10 * are met:
11 * 1. Redistributions of source code must retain the above copyright
12 *    notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 *    notice, this list of conditions and the following disclaimer in the
15 *    documentation and/or other materials provided with the distribution.
16 * 3. Neither the name of the University nor the names of its contributors
17 *    may be used to endorse or promote products derived from this software
18 *    without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 *	@(#)monop.def	5.5 (Berkeley) 5/31/93
33 */
34
35#include "deck.h"
36#include "monop.h"
37
38bool	fixing = FALSE,		/* set if fixing up debt		*/
39	trading = FALSE,	/* set if in process of trading		*/
40	told_em,		/* set if told user he's out of debt	*/
41	spec;			/* set if moving by card to RR or UTIL	*/
42
43char	*name_list[MAX_PL+2],	/* list of players' names		*/
44	*comlist[]	= {	/* list of normal commands		*/
45	"quit",		/*  0 */	"print",	/*  1 */
46	"where",	/*  2 */	"own holdings",	/*  3 */
47	"holdings",	/*  4 */	"mortgage",	/*  5 */
48	"unmortgage",	/*  6 */	"buy houses",	/*  7 */
49	"sell houses",	/*  8 */	"card",		/*  9 */
50	"pay",		/* 10 */	"trade",	/* 11 */
51	"resign",	/* 12 */	"save",		/* 13 */
52	"restore",	/* 14 */	"roll",		/* 15 */
53	"",		/* 16 */
54	0
55	},
56	*ynlist[]	= {	/* list of commands for yes/no answers	*/
57	"yes",		/*  0 */	"no",		/*  1 */
58	"quit",		/*  2 */	"print",	/*  3 */
59	"where",	/*  4 */	"own holdings",	/*  5 */
60	"holdings",	/*  6 */
61	0
62	},
63	*lucky_mes[]	= {	/* "got lucky" messages			*/
64	"You lucky stiff",		"You got lucky",
65	"What a lucky person!",		"You must have a 4-leaf clover",
66	"My, my!  Aren't we lucky!",	"Luck smiles upon you",
67	"You got lucky this time",	"Lucky person!",
68	"Your karma must certainly be together",
69	"How beautifully Cosmic",	"Wow, you must be really with it"
70	/* "I want your autograph",	-- Save for later */
71	};
72
73int	player,			/* current player number		*/
74	num_play,		/* current number of players		*/
75	num_doub,		/* # of doubles current player rolled	*/
76				/* # of "got lucky" messages		*/
77	num_luck	= sizeof lucky_mes / sizeof (char *);
78
79/* list of command functions		*/
80void (*func[])(void) = {	/* array of function calls for commands	*/
81	quit,			/* quit game		|*  0 *|	*/
82	printboard,		/* print board		|*  1 *|	*/
83	where,			/* where players are	|*  2 *|	*/
84	list,			/* own holdings		|*  3 *|	*/
85	list_all,		/* holdings list	|*  4 *|	*/
86	mortgage,		/* mortgage property	|*  5 *|	*/
87	unmortgage,		/* unmortgage property	|*  6 *|	*/
88	buy_houses,		/* buy houses		|*  7 *|	*/
89	sell_houses,		/* sell houses		|*  8 *|	*/
90	card,			/* card for jail	|*  9 *|	*/
91	pay,			/* pay for jail		|* 10 *|	*/
92	trade,			/* trade		|* 11 *|	*/
93	resign,			/* resign		|* 12 *|	*/
94	save,			/* save game		|* 13 *|	*/
95	game_restore,		/* restore game		|* 14 *|	*/
96	do_move,		/* roll			|* 15 *|	*/
97	do_move			/* ""			|* 16 *|	*/
98	};
99
100DECK	deck[2];		/* Chance and Community Chest		*/
101
102PLAY	*play,			/* player structure array ("calloc"ed)	*/
103	*cur_p;			/* pointer to current player's struct	*/
104
105RR_S	rr[N_RR];		/* railroad descriptions		*/
106
107UTIL_S	util[2];		/* utility descriptions			*/
108
109MON	mon[N_MON]	= {	/* monopoly descriptions		*/
110#include	"mon.dat"
111};
112
113PROP	prop[N_PROP]	= {	/* typical properties			*/
114#include	"prop.dat"
115};
116
117SQUARE	board[N_SQRS+1]	= {	/* board itself (+1 for Jail)		*/
118#include	"brd.dat"
119};
120