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