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