2004-01-27 23:30:28 +03:00
|
|
|
/* $NetBSD: monop.def,v 1.9 2004/01/27 20:30:30 jsm Exp $ */
|
1995-03-23 11:28:00 +03:00
|
|
|
|
1993-03-21 12:45:37 +03:00
|
|
|
/*-
|
1995-03-23 11:28:00 +03:00
|
|
|
* Copyright (c) 1980, 1993
|
|
|
|
* The Regents of the University of California. All rights reserved.
|
1993-03-21 12:45:37 +03:00
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
2003-08-07 13:36:50 +04:00
|
|
|
* 3. Neither the name of the University nor the names of its contributors
|
1993-03-21 12:45:37 +03:00
|
|
|
* may be used to endorse or promote products derived from this software
|
|
|
|
* without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*
|
1995-03-23 11:28:00 +03:00
|
|
|
* @(#)monop.def 5.5 (Berkeley) 5/31/93
|
1993-03-21 12:45:37 +03:00
|
|
|
*/
|
|
|
|
|
1999-08-21 14:40:03 +04:00
|
|
|
#include "deck.h"
|
|
|
|
#include "monop.h"
|
1993-03-21 12:45:37 +03:00
|
|
|
|
|
|
|
bool fixing, /* set if fixing up debt */
|
|
|
|
trading, /* set if in process of trading */
|
|
|
|
told_em, /* set if told user he's out of debt */
|
|
|
|
spec; /* set if moving by card to RR or UTIL */
|
|
|
|
|
Add use of `const' where appropriate to the games.
This merges in all such remaining changes from the Linux port of the
NetBSD games, except in hunt (where substantial changes from OpenBSD
need to be looked at).
Some such changes were previously covered in PRs bin/6041, bin/6146,
bin/6148, bin/6150, bin/6151, bin/6580, bin/6660, bin/7993, bin/7994,
bin/8039, bin/8057 and bin/8093.
1999-09-09 01:17:44 +04:00
|
|
|
const char *name_list[MAX_PL+2], /* list of players' names */
|
|
|
|
*const comlist[] = { /* list of normal commands */
|
1993-03-21 12:45:37 +03:00
|
|
|
"quit", /* 0 */ "print", /* 1 */
|
|
|
|
"where", /* 2 */ "own holdings", /* 3 */
|
1993-08-07 12:27:53 +04:00
|
|
|
"holdings", /* 4 */ "mortgage", /* 5 */
|
|
|
|
"unmortgage", /* 6 */ "buy houses", /* 7 */
|
|
|
|
"sell houses", /* 8 */ "card", /* 9 */
|
|
|
|
"pay", /* 10 */ "trade", /* 11 */
|
|
|
|
"resign", /* 12 */ "save", /* 13 */
|
|
|
|
"restore", /* 14 */ "roll", /* 15 */
|
|
|
|
"", /* 16 */
|
1993-03-21 12:45:37 +03:00
|
|
|
0
|
|
|
|
},
|
2004-01-26 12:59:36 +03:00
|
|
|
*const yncoms[] = { /* list of commands for yes/no answers */
|
1993-03-21 12:45:37 +03:00
|
|
|
"yes", /* 0 */ "no", /* 1 */
|
|
|
|
"quit", /* 2 */ "print", /* 3 */
|
|
|
|
"where", /* 4 */ "own holdings", /* 5 */
|
1993-08-07 12:27:53 +04:00
|
|
|
"holdings", /* 6 */
|
1993-03-21 12:45:37 +03:00
|
|
|
0
|
|
|
|
},
|
Add use of `const' where appropriate to the games.
This merges in all such remaining changes from the Linux port of the
NetBSD games, except in hunt (where substantial changes from OpenBSD
need to be looked at).
Some such changes were previously covered in PRs bin/6041, bin/6146,
bin/6148, bin/6150, bin/6151, bin/6580, bin/6660, bin/7993, bin/7994,
bin/8039, bin/8057 and bin/8093.
1999-09-09 01:17:44 +04:00
|
|
|
*const lucky_mes[] = { /* "got lucky" messages */
|
1993-03-21 12:45:37 +03:00
|
|
|
"You lucky stiff", "You got lucky",
|
|
|
|
"What a lucky person!", "You must have a 4-leaf clover",
|
|
|
|
"My, my! Aren't we lucky!", "Luck smiles upon you",
|
|
|
|
"You got lucky this time", "Lucky person!",
|
|
|
|
"Your karma must certainly be together",
|
|
|
|
"How beautifully Cosmic", "Wow, you must be really with it"
|
|
|
|
/* "I want your autograph", -- Save for later */
|
|
|
|
};
|
|
|
|
|
|
|
|
int player, /* current player number */
|
|
|
|
num_play, /* current number of players */
|
|
|
|
num_doub, /* # of doubles current player rolled */
|
|
|
|
/* # of "got lucky" messages */
|
1997-10-12 21:45:06 +04:00
|
|
|
num_luck = sizeof lucky_mes / sizeof (char *);
|
|
|
|
|
|
|
|
/* list of command functions */
|
2004-01-27 23:30:28 +03:00
|
|
|
void (*const func[])(void) = { /* array of function calls for commands */
|
1993-03-21 12:45:37 +03:00
|
|
|
quit, /* quit game |* 0 *| */
|
|
|
|
printboard, /* print board |* 1 *| */
|
|
|
|
where, /* where players are |* 2 *| */
|
|
|
|
list, /* own holdings |* 3 *| */
|
|
|
|
list_all, /* holdings list |* 4 *| */
|
1993-08-07 12:27:53 +04:00
|
|
|
mortgage, /* mortgage property |* 5 *| */
|
|
|
|
unmortgage, /* unmortgage property |* 6 *| */
|
|
|
|
buy_houses, /* buy houses |* 7 *| */
|
|
|
|
sell_houses, /* sell houses |* 8 *| */
|
|
|
|
card, /* card for jail |* 9 *| */
|
|
|
|
pay, /* pay for jail |* 10 *| */
|
|
|
|
trade, /* trade |* 11 *| */
|
|
|
|
resign, /* resign |* 12 *| */
|
|
|
|
save, /* save game |* 13 *| */
|
|
|
|
restore, /* restore game |* 14 *| */
|
|
|
|
do_move, /* roll |* 15 *| */
|
|
|
|
do_move /* "" |* 16 *| */
|
1993-03-21 12:45:37 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
DECK deck[2]; /* Chance and Community Chest */
|
|
|
|
|
|
|
|
PLAY *play, /* player structure array ("calloc"ed) */
|
|
|
|
*cur_p; /* pointer to current player's struct */
|
|
|
|
|
|
|
|
RR_S rr[N_RR]; /* raildroad descriptions */
|
|
|
|
|
|
|
|
UTIL_S util[2]; /* utility descriptions */
|
|
|
|
|
|
|
|
MON mon[N_MON] = { /* monopoly descriptions */
|
|
|
|
# include "mon.dat"
|
|
|
|
};
|
|
|
|
|
|
|
|
PROP prop[N_PROP] = { /* typical properties */
|
|
|
|
# include "prop.dat"
|
|
|
|
};
|
|
|
|
|
|
|
|
SQUARE board[N_SQRS+1] = { /* board itself (+1 for Jail) */
|
|
|
|
# include "brd.dat"
|
|
|
|
};
|