BSD 4_4 release
[unix-history] / usr / src / games / monop / monop.def
CommitLineData
dc7f5a19 1/*-
5cd7f9e7
KB
2 * Copyright (c) 1980, 1993
3 * The Regents of the University of California. All rights reserved.
9694fb26 4 *
ad787160
C
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.
9694fb26 20 *
ad787160
C
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.5 (Berkeley) 5/31/93
9694fb26
KB
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 */
fef8bf5e
KB
48 "holdings", /* 4 */ "mortgage", /* 5 */
49 "unmortgage", /* 6 */ "buy houses", /* 7 */
50 "sell houses", /* 8 */ "card", /* 9 */
51 "pay", /* 10 */ "trade", /* 11 */
52 "resign", /* 12 */ "save", /* 13 */
53 "restore", /* 14 */ "roll", /* 15 */
54 "", /* 16 */
9694fb26
KB
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 */
fef8bf5e 61 "holdings", /* 6 */
9694fb26
KB
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(),
fef8bf5e 82 rub(), save(), sell_houses(), trade(),
9694fb26
KB
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 *| */
fef8bf5e
KB
90 mortgage, /* mortgage property |* 5 *| */
91 unmortgage, /* unmortgage property |* 6 *| */
92 buy_houses, /* buy houses |* 7 *| */
93 sell_houses, /* sell houses |* 8 *| */
94 card, /* card for jail |* 9 *| */
95 pay, /* pay for jail |* 10 *| */
96 trade, /* trade |* 11 *| */
97 resign, /* resign |* 12 *| */
98 save, /* save game |* 13 *| */
99 restore, /* restore game |* 14 *| */
100 do_move, /* roll |* 15 *| */
101 do_move /* "" |* 16 *| */
9694fb26
KB
102 };
103
104DECK deck[2]; /* Chance and Community Chest */
105
106PLAY *play, /* player structure array ("calloc"ed) */
107 *cur_p; /* pointer to current player's struct */
108
109RR_S rr[N_RR]; /* raildroad descriptions */
110
111UTIL_S util[2]; /* utility descriptions */
112
113MON mon[N_MON] = { /* monopoly descriptions */
114# include "mon.dat"
115};
116
117PROP prop[N_PROP] = { /* typical properties */
118# include "prop.dat"
119};
120
121SQUARE board[N_SQRS+1] = { /* board itself (+1 for Jail) */
122# include "brd.dat"
123};