BSD 4_2 release
[unix-history] / usr / src / games / monop / spec.c
CommitLineData
5244a77d
C
1# include "monop.ext"
2
3static char *perc[] = {
4 "10%", "ten percent", "%", "$200", "200", 0
5 };
6
7inc_tax() { /* collect income tax */
8
9 reg int worth, com_num;
10
11 com_num = getinp("Do you wish to lose 10%% of your total worth or $200? ", perc);
12 worth = cur_p->money + prop_worth(cur_p);
13 printf("You were worth $%d", worth);
14 worth /= 10;
15 if (com_num > 2) {
16 if (worth < 200)
17 printf(". Good try, but not quite.\n");
18 else if (worth > 200)
19 lucky(".\nGood guess. ");
20 cur_p->money -= 200;
21 }
22 else {
23 printf(", so you pay $%d", worth);
24 if (worth > 200)
25 printf(" OUCH!!!!.\n");
26 else if (worth < 200)
27 lucky("\nGood guess. ");
28 cur_p->money -= worth;
29 }
30 if (worth == 200)
31 lucky("\nIt makes no difference! ");
32}
33goto_jail() { /* move player to jail */
34
35 cur_p->loc = JAIL;
36}
37lux_tax() { /* landing on luxury tax */
38
39 printf("You lose $75\n");
40 cur_p->money -= 75;
41}
42cc() { /* draw community chest card */
43
44 get_card(&CC_D);
45}
46chance() { /* draw chance card */
47
48 get_card(&CH_D);
49}