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