Import Pick Up the Phone Booth and Dye by Eric Schmidt
[boothdye.git] / boothdye.inf
1 ! This source is public domain
2
3 Constant Story "Pick Up the Phone Booth and Dye";
4 Constant Headline "^This game is public domain^
5                    Eric Schmidt <eschimdt@@64safeaccess.com>^";
6
7 Release 2;
8 Serial "345678";
9
10 Constant MAX_SCORE = 20;
11
12 Include "Parser";
13 Include "VerbLib";
14
15 [ Initialise;
16   location = field;
17 ];
18
19 [ Boothdeath; 
20   deadflag = 1;
21   "Unfortunately, you do not have enough hands to hold
22    both the bucket and the phone booth. You drop the booth
23    on top of yourself.";
24 ];
25
26 CompassDirection ground "ground" compass 
27   with name 'ground', door_dir d_to;
28
29 Object field "Field" has light
30   with description "This is just an ordinary field in the middle
31                     of nowhere. You have no idea why you're here.";
32
33 Object -> booth "phone booth" has supporter enterable
34   with name 'large' 'phone' 'booth',
35        description [; if (dye notin self)
36                     "The phone booth is large and has the word ~TELEPHONE~
37                     in red in the front.";
38                     "The phone booth is large and has dye splattered all
39                      over it!";
40                    ],
41        before [; Open: "Try as you might, you cannot force the booth open!"; ],
42        after [;
43          Take:
44            if (bucket in player) { Boothdeath(); rtrue; }
45            print "You grasp the phone booth and slowly lift it up.";
46              if (bucket in self) {
47                move bucket to field;
48                print " The bucket falls off the phone booth and hits
49                       the ground.";
50                if (dye in bucket) {
51                  remove dye;
52                  " The dye pours out of the bucket.";
53                }
54              }
55              if (dye in self) {
56                score = 20;
57                deadflag = 2;
58                "^^You have managed to pick up the phone booth
59                  and the dye at the same time. Congratulations!";
60              }
61              new_line;
62              rtrue;
63        ];
64
65 Object -> bucket "bucket" has container open
66   with name 'white' 'bucket' 'pail',
67        description "The bucket is all white.",
68        before [;
69          Take: if (player in booth && bucket notin booth)
70                  "You can't reach the bucket.";
71          Pour: if (dye notin self)
72                  "The dye is no longer available.";
73                <<Pour dye second>>;
74          Receive: if (noun == player) "I don't think you'd fit.";
75                   if (noun == booth) "That's impossible.";
76        ],
77        after [;
78          Take: if (booth in player) { BoothDeath(); rtrue; }
79          "You take the bucket.";
80        ];
81
82 Object -> -> dye "dye"
83   with name 'thin' 'blue' 'dye',
84        article "some",
85        description "The dye is thin and blue.",
86        before [; Take: if (self notin bucket)
87                    "You cannot hold the dye with your bare hands.";
88                  if (bucket in player) "You already have that.";
89                    <<Take bucket>>;
90                  Remove:
91                    "You cannot hold the dye with your bare hands.";
92                  Drop:
93                    if (self in bucket) <<Drop bucket>>;
94                  Pour:
95                    if (bucket notin player || self notin bucket)
96                      "You don't have the dye.";
97                    switch (second) {
98                      booth:
99                        move self to booth;
100                        "You pour the dye all over the booth. It
101                         soon dries up.";
102                      sign:
103                        move self to sign;
104                        "You pour the dye over the sign. It soon
105                         dries up.";
106                      bucket, dye:
107                        "How would you manage that?";
108                      selfobj: "You comtemplate this, but decide
109                                against it.";
110                      d_obj, ground: remove self;
111                             "You pour the dye into the ground.";
112                      default: "Huh?";
113                    }
114                   PutOn: <<Pour self second>>;
115                   Drink: remove self; "Well, that didn't taste half-bad.";
116               ];
117
118 Object -> sign "sign" has static supporter
119   with name 'sign',
120        description [; if (dye notin self)
121                         "The sign reads, ~To win the game, you must
122                          be holding both the booth and the dye at the
123                          same time.~";
124                       "Some moron put dye all over the sign, and you can't
125                        read it.";
126                    ],
127        before [;
128          Receive:
129            if (noun == bucket) {
130              if (player in booth) "From way up here?";
131              move bucket to field;
132              print "You attempt to balance the bucket on the sign, but it
133                     falls off.";
134              if (dye in bucket) {
135                remove dye;
136                " The dye spills out of the bucket and soaks into the ground.";
137              }
138              new_line;
139              rtrue;
140            }
141            if (noun == booth) "That doesn't seem very realistic, does it?";
142        ];
143
144 Include "Grammar";
145
146 [PourSub;
147   "You can't pour ", (the) noun, ".";
148 ];
149
150 [XyzzySub;
151   if (dye in sign or nothing) {
152     move dye to bucket;
153     "A chilly gale picks up, but recedes after a few seconds.";
154   }
155   "Nothing seems to happen.";
156 ];
157
158 Verb 'pour' 'slosh' 'splatter'
159   * noun 'over'/'on'/'onto' noun -> Pour;
160
161 Verb 'xyzzy' * -> Xyzzy;