133215Sbostic /* 234788Sbostic * Copyright (c) 1980 Regents of the University of California. 333215Sbostic * All rights reserved. 433215Sbostic * 5*42583Sbostic * %sccs.include.redist.c% 633215Sbostic */ 733215Sbostic 833215Sbostic #ifndef lint 9*42583Sbostic static char sccsid[] = "@(#)spec.c 5.3 (Berkeley) 06/01/90"; 1033215Sbostic #endif /* not lint */ 1133215Sbostic 1233215Sbostic # include "monop.ext" 1333215Sbostic 1433215Sbostic static char *perc[] = { 1533215Sbostic "10%", "ten percent", "%", "$200", "200", 0 1633215Sbostic }; 1733215Sbostic 1833215Sbostic inc_tax() { /* collect income tax */ 1933215Sbostic 2033215Sbostic reg int worth, com_num; 2133215Sbostic 2233215Sbostic com_num = getinp("Do you wish to lose 10%% of your total worth or $200? ", perc); 2333215Sbostic worth = cur_p->money + prop_worth(cur_p); 2433215Sbostic printf("You were worth $%d", worth); 2533215Sbostic worth /= 10; 2633215Sbostic if (com_num > 2) { 2733215Sbostic if (worth < 200) 2833215Sbostic printf(". Good try, but not quite.\n"); 2933215Sbostic else if (worth > 200) 3033215Sbostic lucky(".\nGood guess. "); 3133215Sbostic cur_p->money -= 200; 3233215Sbostic } 3333215Sbostic else { 3433215Sbostic printf(", so you pay $%d", worth); 3533215Sbostic if (worth > 200) 3633215Sbostic printf(" OUCH!!!!.\n"); 3733215Sbostic else if (worth < 200) 3833215Sbostic lucky("\nGood guess. "); 3933215Sbostic cur_p->money -= worth; 4033215Sbostic } 4133215Sbostic if (worth == 200) 4233215Sbostic lucky("\nIt makes no difference! "); 4333215Sbostic } 4433215Sbostic goto_jail() { /* move player to jail */ 4533215Sbostic 4633215Sbostic cur_p->loc = JAIL; 4733215Sbostic } 4833215Sbostic lux_tax() { /* landing on luxury tax */ 4933215Sbostic 5033215Sbostic printf("You lose $75\n"); 5133215Sbostic cur_p->money -= 75; 5233215Sbostic } 5333215Sbostic cc() { /* draw community chest card */ 5433215Sbostic 5533215Sbostic get_card(&CC_D); 5633215Sbostic } 5733215Sbostic chance() { /* draw chance card */ 5833215Sbostic 5933215Sbostic get_card(&CH_D); 6033215Sbostic } 61