~ubuntu-branches/ubuntu/vivid/inform/vivid

« back to all changes in this revision

Viewing changes to include/pluralob.h

  • Committer: Bazaar Package Importer
  • Author(s): Jan Christoph Nordholz
  • Date: 2008-05-26 22:09:44 UTC
  • mfrom: (2.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080526220944-ba7phz0d1k4vo7wx
Tags: 6.31.1+dfsg-1
* Remove a considerable number of files from the package
  due to unacceptable licensing terms.
* Repair library symlinks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
! ----------------------------------------------------------------------------
2
 
! PluralObj - an Inform library to allow plural nouns. For example, a pair of
3
 
!             gloves, some adverts, or a pile of magazines. Give an object the
4
 
!             attribute 'pluralobj' and the correct messages will appear.
5
 
!
6
 
!             #include it just before VerbLib.
7
 
!             (c) Andrew Clover, 1995, but freely usable. Release 2.
8
 
!             Compatible with Inform 5.5, library 5/12
9
 
! ----------------------------------------------------------------------------
10
 
 
11
 
! NB. This library provides LibraryMessages in order to change the library
12
 
!     responses to plural-aware ones. If you want to provide your own library
13
 
!     messages, call the LibraryMessages object LibraryMessages2.
14
 
 
15
 
! This library gives you some commands to use instead of just printing 'it' or
16
 
! such like. They are itthey, itthem, doesntdont, isntarent, thatthose,
17
 
! thisthese (lower case initials); ittheyc, itstheyrec, thatthosec,
18
 
! thisthesec, thatstheyre, thattheyc (upper case). Also verbsuf, which just
19
 
! prints 's' for singular-form verbs. The commands also print the correct
20
 
! pronoun for animates. One parameter is necessary, an object number to check
21
 
! for pluralobj. With anything else, your printing commands will have to check
22
 
! for the pluralobj flag themselves.
23
 
 
24
 
attribute pluralobj;
25
 
 
26
 
object LibraryMessages "lm"
27
 
  with before [ i;
28
 
         #IFDEF LibraryMessages2;
29
 
           i=runroutines(LibraryMessages2,before);
30
 
           if (i~=0)
31
 
             return i;
32
 
         #ENDIF;
33
 
         i=action;            ! pointless statements to stop a compiler warning
34
 
         i=action;            ! 'unused variable' appearing if lm2 object absent
35
 
         Take:
36
 
           if (lm_n==5)
37
 
             {
38
 
             print "You already have ";
39
 
             thatthose(noun);
40
 
             ".";
41
 
             }
42
 
           if (lm_n==6)
43
 
             {
44
 
             thatthosec(noun);
45
 
             print " seem";
46
 
             verbsuf(noun);
47
 
             " to belong to ";
48
 
             defart(lm_o);
49
 
             ".";
50
 
             }
51
 
           if (lm_n==7)
52
 
             {
53
 
             thatthosec(noun);
54
 
             print " seem";
55
 
             verbsuf(noun);
56
 
             " to be a part of ";
57
 
             defart(lm_o);
58
 
             ".";
59
 
             }
60
 
           if (lm_n==8)
61
 
             {
62
 
             thatthosec(noun);
63
 
             print " ";
64
 
             isntarent(noun);
65
 
             " available.";
66
 
             }
67
 
           if (lm_n==10)
68
 
             {
69
 
             thatstheyrec(noun);
70
 
             " hardly portable.";
71
 
             }
72
 
           if (lm_n==11)
73
 
             {
74
 
             thatstheyrec(noun);
75
 
             " fixed in place.";
76
 
             }
77
 
         Drop:
78
 
           if (lm_n==2)
79
 
             {
80
 
             print "You haven't got ";
81
 
             thatthose(noun);
82
 
             ".";
83
 
             }
84
 
         Remove:
85
 
           if (lm_n==1)
86
 
             {
87
 
             ittheyc(second);
88
 
             print " ";
89
 
             if (second has pluralobj)
90
 
               print " are";
91
 
             else
92
 
               print " is";
93
 
             " unfortunately closed.";
94
 
             }
95
 
           if (lm_n==2)
96
 
             {
97
 
             print "But ";
98
 
             itthey(noun);
99
 
             print " ";
100
 
             isntarent(noun);
101
 
             " there now.";
102
 
             }
103
 
         PutOn:
104
 
           if (lm_n==5)
105
 
             {
106
 
             print "(first taking ";
107
 
             itthem(noun);
108
 
             " off)^";
109
 
             }
110
 
         Insert:
111
 
           if (lm_n==1)
112
 
             {
113
 
             print "You need to be holding ";
114
 
             itthem(noun);
115
 
             print " before you can put ";
116
 
             itthem(noun);
117
 
             " into something else.";
118
 
             }
119
 
           if (lm_n==2)
120
 
             {
121
 
             thattheyc(second);
122
 
             " can't contain things.";
123
 
             }
124
 
           if (lm_n==3)
125
 
             {
126
 
             print "Alas, ";
127
 
             itthey(second);
128
 
             if (second has pluralobj)
129
 
               print " are";
130
 
             else
131
 
               print " is";
132
 
             " closed.";
133
 
             }
134
 
           if (lm_n==4)
135
 
             {
136
 
             print "You'll need to take ";
137
 
             itthem(second);
138
 
             " off first.";
139
 
             }
140
 
           if (lm_n==6)
141
 
             {
142
 
             print "(first taking ";
143
 
             itthem(noun);
144
 
             " off)^";
145
 
             }
146
 
         Transfer:
147
 
           if (lm_n==1)
148
 
             {
149
 
             thatthose(noun);
150
 
             print " ";
151
 
             isntarent(noun);
152
 
             " in your possession.";
153
 
             }
154
 
           if (lm_n==2)
155
 
             {
156
 
             print "First pick ";
157
 
             itthem(noun);
158
 
             " up.";
159
 
             }
160
 
         Enter:
161
 
           if (lm_n==2)
162
 
             {
163
 
             thatstheyrec(noun);
164
 
             " not something you can enter.";
165
 
             }
166
 
         Search:
167
 
           if (lm_n==5)
168
 
             {
169
 
             print "You can't see inside, since ";
170
 
             itthey(noun);
171
 
             if (noun has pluralobj)
172
 
               print " are";
173
 
             else
174
 
               print " is";
175
 
             " closed.";
176
 
             }
177
 
           if (lm_n==6)
178
 
             {
179
 
             cdefart(lm_o);
180
 
             if (second has pluralobj)
181
 
               print " are";
182
 
             else
183
 
               print " is";
184
 
             " closed.";
185
 
             }
186
 
         Unlock:
187
 
           if (lm_n==1)
188
 
             {
189
 
             thattheyc(noun);
190
 
             print " ";
191
 
             doesntdont(noun);
192
 
             " seem to be something you can unlock.";
193
 
             }
194
 
           if (lm_n==2)
195
 
             {
196
 
             itstheyrec(noun);
197
 
             " unlocked at the moment.";
198
 
             }
199
 
           if (lm_n==3)
200
 
             {
201
 
             thatthosec(second);
202
 
             print " ";
203
 
             doesntdont(second);
204
 
             " seem to fit the lock.";
205
 
             }
206
 
         Lock:
207
 
           if (lm_n==1)
208
 
             {
209
 
             thattheyc(noun);
210
 
             print " ";
211
 
             doesntdont(noun);
212
 
             " seem to be something you can lock.";
213
 
             }
214
 
           if (lm_n==2)
215
 
             {
216
 
             itstheyrec(noun);
217
 
             " locked at the moment.";
218
 
             }
219
 
           if (lm_n==3)
220
 
             {
221
 
             print "First you'll have to close ";
222
 
             itthem(noun);
223
 
             ".";
224
 
             }
225
 
           if (lm_n==4)
226
 
             {
227
 
             thatthose(second);
228
 
             print " ";
229
 
             doesntdont(second);
230
 
             " seem to fit the lock.";
231
 
             }
232
 
         SwitchOn:
233
 
           if (lm_n==1)
234
 
             {
235
 
             thatstheyrec(noun);
236
 
             " not something you can switch.";
237
 
             }
238
 
           if (lm_n==2)
239
 
             {
240
 
             thatstheyrec(noun);
241
 
             " already on.";
242
 
             }
243
 
         SwitchOff:
244
 
           if (lm_n==1)
245
 
             {
246
 
             thatstheyrec(noun);
247
 
             " not something you can switch.";
248
 
             }
249
 
           if (lm_n==2)
250
 
             {
251
 
             thatstheyrec(noun);
252
 
             " already off.";
253
 
             }
254
 
         Open:
255
 
           if (lm_n==1)
256
 
             {
257
 
             thatstheyrec(noun);
258
 
             " not something you can open.";
259
 
             }
260
 
           if (lm_n==2)
261
 
             {
262
 
             ittheyc(noun);
263
 
             print " seem";
264
 
             verbsuf(noun);
265
 
             " to be locked.";
266
 
             }
267
 
           if (lm_n==3)
268
 
             {
269
 
             itstheyrec(noun);
270
 
             " already open.";
271
 
             }
272
 
         Close:
273
 
           if (lm_n==1)
274
 
             {
275
 
             thatstheyrec(noun);
276
 
             " not something you can close.";
277
 
             }
278
 
           if (lm_n==2)
279
 
             {
280
 
             itstheyrec(noun);
281
 
             " already closed.";
282
 
             }
283
 
         Disrobe:
284
 
           if (lm_n==1)
285
 
             {
286
 
             print "You're not wearing ";
287
 
             thatthose(noun);
288
 
             ".";
289
 
             }
290
 
         Wear:
291
 
           if (lm_n==1)
292
 
             {
293
 
             print "You can't wear ";
294
 
             thatthose(noun);
295
 
             "!";
296
 
             }
297
 
           if (lm_n==2)
298
 
             {
299
 
             print "You're not holding ";
300
 
             itthem(noun);
301
 
             ".";
302
 
             }
303
 
           if (lm_n==3)
304
 
             {
305
 
             print "You're already wearing ";
306
 
             thatthose(noun);
307
 
             "!";
308
 
             }
309
 
         Eat:
310
 
           if (lm_n==1);
311
 
             {
312
 
             thatstheyrec(noun);
313
 
             " plainly inedible.";
314
 
             }
315
 
         Cut:
316
 
           print "Cutting ";
317
 
           thatthose(noun);
318
 
           " would achieve little.";
319
 
         Blow:
320
 
           print "You can't usefully blow ";
321
 
           thatthose(noun);
322
 
           ".";
323
 
         Set:
324
 
           print "No, you can't set ";
325
 
           thatthose(noun);
326
 
           ".";
327
 
         SetTo:
328
 
           print "No, you can't set ";
329
 
           thatthose(noun);
330
 
           " to anything.";
331
 
         Wave:
332
 
           if (lm_n==1)
333
 
             {
334
 
             print "But you aren't holding ";
335
 
             thatthose(noun);
336
 
             ".";
337
 
             }
338
 
         Push, Pull, Turn:
339
 
           if (lm_n==1)
340
 
             {
341
 
             itstheyrec(noun);
342
 
             " fixed in place.";
343
 
             }
344
 
       ];
345
 
 
346
 
[ itthey i;
347
 
  if (i has pluralobj)
348
 
    print "they";
349
 
  else
350
 
    {
351
 
    if (i has animate)
352
 
      {
353
 
      if (i has female)
354
 
        print "she";
355
 
      else
356
 
        print "he";
357
 
      }
358
 
    else
359
 
      print "it";
360
 
    }
361
 
];
362
 
 
363
 
[ thattheyc i;
364
 
  if (i has pluralobj)
365
 
    print "They";
366
 
  else
367
 
    {
368
 
    if (i has animate)
369
 
      {
370
 
      if (i has female)
371
 
        print "She";
372
 
      else
373
 
        print "He";
374
 
      }
375
 
    else
376
 
      print "That";
377
 
    }
378
 
];
379
 
 
380
 
[ itthem i;
381
 
  if (i has pluralobj)
382
 
    print "them";
383
 
  else
384
 
    {
385
 
    if (i has animate)
386
 
      {
387
 
      if (i has female)
388
 
        print "her";
389
 
      else
390
 
        print "him";
391
 
      }
392
 
    else
393
 
      print "it";
394
 
    }
395
 
];
396
 
 
397
 
[ ittheyc i;
398
 
  if (i has pluralobj)
399
 
    print "They";
400
 
  else
401
 
    {
402
 
    if (i has animate)
403
 
      {
404
 
      if (i has female)
405
 
        print "She";
406
 
      else
407
 
        print "He";
408
 
      }
409
 
    else
410
 
      print "It";
411
 
    }
412
 
];
413
 
 
414
 
[ itstheyrec i;
415
 
  if (i has pluralobj)
416
 
    print "They're";
417
 
  else
418
 
    {
419
 
    if (i has animate)
420
 
      {
421
 
      if (i has female)
422
 
        print "She's";
423
 
      else
424
 
        print "He's";
425
 
      }
426
 
    else
427
 
      print "It's";
428
 
    }
429
 
];
430
 
 
431
 
[ thatstheyrec i;
432
 
  if (i has pluralobj)
433
 
    print "They're";
434
 
  else
435
 
    {
436
 
    if (i has animate)
437
 
      {
438
 
      if (i has female)
439
 
        print "She's";
440
 
      else
441
 
        print "He's";
442
 
      }
443
 
    else
444
 
      print "That's";
445
 
    }
446
 
];
447
 
 
448
 
[ doesntdont i;
449
 
  if (i hasnt pluralobj)
450
 
    print "doesn't";
451
 
  else
452
 
    print "don't";
453
 
];
454
 
 
455
 
[ isntarent i;
456
 
  if (i hasnt pluralobj)
457
 
    print "isn't";
458
 
  else
459
 
    print "aren't";
460
 
];
461
 
 
462
 
[ thatthose i;
463
 
  if (i hasnt pluralobj)
464
 
    print "that";
465
 
  else
466
 
    print "those";
467
 
];
468
 
 
469
 
[ thatthosec i;
470
 
  if (i hasnt pluralobj)
471
 
    print "That";
472
 
  else
473
 
    print "Those";
474
 
];
475
 
 
476
 
[ thisthese i;
477
 
  if (i hasnt pluralobj)
478
 
    print "this";
479
 
  else
480
 
    print "these";
481
 
];
482
 
 
483
 
[ thisthesec i;
484
 
  if (i hasnt pluralobj)
485
 
    print "This";
486
 
  else
487
 
    print "These";
488
 
];
489
 
 
490
 
[ verbsuf i;
491
 
  if (i hasnt pluralobj)
492
 
    print "s";
493
 
];