|
|
1.1 ! root 1: /* ! 2: * Copyright (c) 1980 Regents of the University of California. ! 3: * All rights reserved. ! 4: * ! 5: * Redistribution and use in source and binary forms are permitted ! 6: * provided that: (1) source distributions retain this entire copyright ! 7: * notice and comment, and (2) distributions including binaries display ! 8: * the following acknowledgement: ``This product includes software ! 9: * developed by the University of California, Berkeley and its contributors'' ! 10: * in the documentation or other materials provided with the distribution ! 11: * and in all advertising materials mentioning features or use of this ! 12: * software. Neither the name of the University nor the names of its ! 13: * contributors may be used to endorse or promote products derived ! 14: * from this software without specific prior written permission. ! 15: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ! 16: * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED ! 17: * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 18: */ ! 19: ! 20: #ifndef lint ! 21: static char sccsid[] = "@(#)spec.c 5.3 (Berkeley) 6/1/90"; ! 22: #endif /* not lint */ ! 23: ! 24: # include "monop.ext" ! 25: ! 26: static char *perc[] = { ! 27: "10%", "ten percent", "%", "$200", "200", 0 ! 28: }; ! 29: ! 30: inc_tax() { /* collect income tax */ ! 31: ! 32: reg int worth, com_num; ! 33: ! 34: com_num = getinp("Do you wish to lose 10%% of your total worth or $200? ", perc); ! 35: worth = cur_p->money + prop_worth(cur_p); ! 36: printf("You were worth $%d", worth); ! 37: worth /= 10; ! 38: if (com_num > 2) { ! 39: if (worth < 200) ! 40: printf(". Good try, but not quite.\n"); ! 41: else if (worth > 200) ! 42: lucky(".\nGood guess. "); ! 43: cur_p->money -= 200; ! 44: } ! 45: else { ! 46: printf(", so you pay $%d", worth); ! 47: if (worth > 200) ! 48: printf(" OUCH!!!!.\n"); ! 49: else if (worth < 200) ! 50: lucky("\nGood guess. "); ! 51: cur_p->money -= worth; ! 52: } ! 53: if (worth == 200) ! 54: lucky("\nIt makes no difference! "); ! 55: } ! 56: goto_jail() { /* move player to jail */ ! 57: ! 58: cur_p->loc = JAIL; ! 59: } ! 60: lux_tax() { /* landing on luxury tax */ ! 61: ! 62: printf("You lose $75\n"); ! 63: cur_p->money -= 75; ! 64: } ! 65: cc() { /* draw community chest card */ ! 66: ! 67: get_card(&CC_D); ! 68: } ! 69: chance() { /* draw chance card */ ! 70: ! 71: get_card(&CH_D); ! 72: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.