home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / bsd_srcs / games / monop / monop.def < prev    next >
Encoding:
Text File  |  1993-03-24  |  4.7 KB  |  124 lines

  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.4 (Berkeley) 3/25/93
  34.  */
  35.  
  36. # include    "monop.h"
  37. # include    "deck.h"
  38.  
  39. bool    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.  
  44. char    *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 */    "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 */
  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 */
  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.  
  74. int    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(), 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.     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 *|    */
  102.     };
  103.  
  104. DECK    deck[2];        /* Chance and Community Chest        */
  105.  
  106. PLAY    *play,            /* player structure array ("calloc"ed)    */
  107.     *cur_p;            /* pointer to current player's struct    */
  108.  
  109. RR_S    rr[N_RR];        /* raildroad descriptions        */
  110.  
  111. UTIL_S    util[2];        /* utility descriptions            */
  112.  
  113. MON    mon[N_MON]    = {    /* monopoly descriptions        */
  114. #        include    "mon.dat"
  115. };
  116.  
  117. PROP    prop[N_PROP]    = {    /* typical properties            */
  118. #        include    "prop.dat"
  119. };
  120.  
  121. SQUARE    board[N_SQRS+1]    = {    /* board itself (+1 for Jail)        */
  122. #        include    "brd.dat"
  123. };
  124.