1 /* 2 * Copyright (c) 1980, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * %sccs.include.redist.c% 6 */ 7 8 #ifndef lint 9 static char sccsid[] = "@(#)spec.c 8.1 (Berkeley) 05/31/93"; 10 #endif /* not lint */ 11 12 # include "monop.ext" 13 14 static char *perc[] = { 15 "10%", "ten percent", "%", "$200", "200", 0 16 }; 17 18 inc_tax() { /* collect income tax */ 19 20 reg int worth, com_num; 21 22 com_num = getinp("Do you wish to lose 10%% of your total worth or $200? ", perc); 23 worth = cur_p->money + prop_worth(cur_p); 24 printf("You were worth $%d", worth); 25 worth /= 10; 26 if (com_num > 2) { 27 if (worth < 200) 28 printf(". Good try, but not quite.\n"); 29 else if (worth > 200) 30 lucky(".\nGood guess. "); 31 cur_p->money -= 200; 32 } 33 else { 34 printf(", so you pay $%d", worth); 35 if (worth > 200) 36 printf(" OUCH!!!!.\n"); 37 else if (worth < 200) 38 lucky("\nGood guess. "); 39 cur_p->money -= worth; 40 } 41 if (worth == 200) 42 lucky("\nIt makes no difference! "); 43 } 44 goto_jail() { /* move player to jail */ 45 46 cur_p->loc = JAIL; 47 } 48 lux_tax() { /* landing on luxury tax */ 49 50 printf("You lose $75\n"); 51 cur_p->money -= 75; 52 } 53 cc() { /* draw community chest card */ 54 55 get_card(&CC_D); 56 } 57 chance() { /* draw chance card */ 58 59 get_card(&CH_D); 60 } 61