xref: /csrg-svn/games/monop/spec.c (revision 33215)
1*33215Sbostic /*
2*33215Sbostic  * Copyright (c) 1987 Regents of the University of California.
3*33215Sbostic  * All rights reserved.
4*33215Sbostic  *
5*33215Sbostic  * Redistribution and use in source and binary forms are permitted
6*33215Sbostic  * provided that this notice is preserved and that due credit is given
7*33215Sbostic  * to the University of California at Berkeley. The name of the University
8*33215Sbostic  * may not be used to endorse or promote products derived from this
9*33215Sbostic  * software without specific prior written permission. This software
10*33215Sbostic  * is provided ``as is'' without express or implied warranty.
11*33215Sbostic  */
12*33215Sbostic 
13*33215Sbostic #ifndef lint
14*33215Sbostic static char sccsid[] = "@(#)spec.c	5.1 (Berkeley) 01/02/88";
15*33215Sbostic #endif /* not lint */
16*33215Sbostic 
17*33215Sbostic # include	"monop.ext"
18*33215Sbostic 
19*33215Sbostic static char	*perc[]	= {
20*33215Sbostic 	"10%", "ten percent", "%", "$200", "200", 0
21*33215Sbostic 	};
22*33215Sbostic 
23*33215Sbostic inc_tax() {			/* collect income tax			*/
24*33215Sbostic 
25*33215Sbostic 	reg int	worth, com_num;
26*33215Sbostic 
27*33215Sbostic 	com_num = getinp("Do you wish to lose 10%% of your total worth or $200? ", perc);
28*33215Sbostic 	worth = cur_p->money + prop_worth(cur_p);
29*33215Sbostic 	printf("You were worth $%d", worth);
30*33215Sbostic 	worth /= 10;
31*33215Sbostic 	if (com_num > 2) {
32*33215Sbostic 		if (worth < 200)
33*33215Sbostic 			printf(".  Good try, but not quite.\n");
34*33215Sbostic 		else if (worth > 200)
35*33215Sbostic 			lucky(".\nGood guess.  ");
36*33215Sbostic 		cur_p->money -= 200;
37*33215Sbostic 	}
38*33215Sbostic 	else {
39*33215Sbostic 		printf(", so you pay $%d", worth);
40*33215Sbostic 		if (worth > 200)
41*33215Sbostic 			printf("  OUCH!!!!.\n");
42*33215Sbostic 		else if (worth < 200)
43*33215Sbostic 			lucky("\nGood guess.  ");
44*33215Sbostic 		cur_p->money -= worth;
45*33215Sbostic 	}
46*33215Sbostic 	if (worth == 200)
47*33215Sbostic 		lucky("\nIt makes no difference!  ");
48*33215Sbostic }
49*33215Sbostic goto_jail() {			/* move player to jail			*/
50*33215Sbostic 
51*33215Sbostic 	cur_p->loc = JAIL;
52*33215Sbostic }
53*33215Sbostic lux_tax() {			/* landing on luxury tax		*/
54*33215Sbostic 
55*33215Sbostic 	printf("You lose $75\n");
56*33215Sbostic 	cur_p->money -= 75;
57*33215Sbostic }
58*33215Sbostic cc() {				/* draw community chest card		*/
59*33215Sbostic 
60*33215Sbostic 	get_card(&CC_D);
61*33215Sbostic }
62*33215Sbostic chance() {			/* draw chance card			*/
63*33215Sbostic 
64*33215Sbostic 	get_card(&CH_D);
65*33215Sbostic }
66