8 _PROTOTYPE(void needobj
, (void));
9 _PROTOTYPE(void ivtake
, (void));
10 _PROTOTYPE(void ivopen
, (void));
11 _PROTOTYPE(void ivkill
, (void));
12 _PROTOTYPE(void ivdrink
, (void));
13 _PROTOTYPE(void ivquit
, (void));
14 _PROTOTYPE(void ivfoo
, (void));
15 _PROTOTYPE(void inventory
, (void));
16 _PROTOTYPE(void addobj
, (int obj
));
17 _PROTOTYPE(void ivpour
, (void));
18 _PROTOTYPE(void ivfill
, (void));
19 _PROTOTYPE(void ivbrief
, (void));
20 _PROTOTYPE(void ivread
, (void));
21 _PROTOTYPE(void ivcombo
, (void));
22 _PROTOTYPE(void iveat
, (void));
24 Routines to process intransitive verbs
48 case TURN
: needobj(); break;
54 case BURN
: ivtake(); break;
58 case UNLOCK
: ivopen(); break;
59 case NOTHING
: rspeak(54); break;
61 case OFF
: trverb(); break;
62 case WALK
: actspk(verb
); break;
63 case KILL
: ivkill(); break;
64 case POUR
: ivpour(); break;
65 case EAT
: iveat(); break;
66 case DRINK
: ivdrink(); break;
67 case QUIT
: ivquit(); break;
68 case INVENTORY
: inventory(); break;
69 case FILL
: ivfill(); break;
70 case BLAST
: ivblast(); break;
71 case SCORE
: score(TRUE
); break;
72 case FOO
: ivfoo(); break;
73 case BRIEF
: ivbrief(); break;
74 case READ
: ivread(); break;
79 saveadv("advent.sav");
81 case RESTORE
: restore("advent.sav"); break;
83 if ((g
.loc
!= 189) || (g
.prop
[PHONE
] != 0))
90 case BLOW
: rspeak(268); break;
91 /* Action verb 'LEAVE' has no object */
92 case LEAVE
: bug(29); break;
93 /* Call if no phone is handy, yell. */
104 /* Health. give him a diagnosis. */
107 fprintf(stdout
, "You have been killed %d times otherwise\n",
109 if (g
.health
>= 95) {
116 "Your health rating is %2d out of a possible 100.\n",
118 rspeak(381 + (100 - g
.health
) / 20);
121 case LOOK
: ivlook(); break;
128 if (!at(CARVNG
) || !athand(BRUSH
) || (g
.prop
[CARVNG
] == 1))
137 /* Terse/unterse. supress all long_form descriptions. */
149 static char buf
[INPUTBUFLEN
];
150 sscanf(ask("Location ? ", buf
, sizeof(buf
)), "%d", &g
.loc
);
156 fprintf(stdout
, "The dwarfs are at locations:\n");
157 for (i
= 1; i
< DWARFMAX
; i
++)
158 fprintf(stdout
, " %4d", g
.dloc
[i
]);
159 fprintf(stdout
, "\nThe pirate is at location %4d\n",
165 printf("This intransitive not implemented yet\n");
171 Routine to indicate no reasonable
172 object for verb found. Used mostly by
177 printf("%s what?\n", vtxt
[vrbx
]);
189 for (item
= 1; item
< MAXOBJ
; ++item
)
190 if (g
.place
[item
] == g
.loc
)
198 if (anobj
== 0 || (dcheck() && g
.dflag
>= 2) || blind())
204 else if (verb
== WEAR
)
219 for (item
= 1, obj_cnt
= 0; item
< MAXOBJ
; item
++) {
220 if ((g
.place
[item
] == g
.loc
) && (hinged(item
))) {
227 else if (verb
== LOCK
)
229 else if (verb
== UNLOCK
)
231 else if (verb
== SHUT
)
240 boolean previous_obj
;
244 previous_obj
= FALSE
;
245 if (dcheck() && g
.dflag
>= 2)
249 if (at(DRAGON
) && g
.prop
[DRAGON
] == 0)
255 if (here(BEAR
) && g
.prop
[BEAR
] == 0)
257 if (here(WUMPUS
) && g
.prop
[WUMPUS
] == 0)
259 /* Can't attack bird by throwing axe */
260 if (here(BIRD
) && verb
!= THROW
)
262 /* Clam and oyster both treated as clam for intransitive case; no
264 if (here(CLAM
) || here(OYSTER
))
267 if ((previous_obj
) || (object
== 0))
275 POUR if no object, assume liq in container, if holding one.
279 if ((holding(BOTTLE
)) && (liq(BOTTLE
) != 0) && !holding(CASK
))
281 if ((holding(CASK
)) && (liq(CASK
) != 0) && !holding(BOTTLE
))
291 EAT. intransitive: assume edible if present, else ask what.
292 If he as more than one edible, or none, 'EAT' is ambiguous
293 without an explicit object.
299 previous_obj
= FALSE
;
300 for (i
= 1; i
< MAXOBJ
; i
++) {
301 if ((here(i
)) && (edible(i
)))
304 if ((previous_obj
) || (object
== 0))
311 DRINK. If no object, assume water or wine and look for them here.
312 If potable is in bottle or cask, drink that. If not, see if there
313 is something drinkable nearby (stream, lake, wine fountain, etc.),
314 and drink that. If he has stuff in both containers, ask which.
320 previous_obj
= FALSE
;
322 if ((ll
== WATER
) || (ll
== WINE
)) {
327 if ((athand(BOTTLE
)) && ((ll
== WATER
) || (ll
== WINE
))) {
332 if ((athand(CASK
)) && ((ll
== WATER
) || (ll
== WINE
))
346 QUIT intransitive only. Verify intent and exit if that's what he wants
350 gaveup
= yes(22, 54, 54);
366 for (i
= 1; i
< MAXOBJ
; i
++) {
367 if (!holding(i
) || wearng(i
) || i
== BEAR
|| i
== BOAT
)
377 /* Tell him what he is wearing */
379 for (i
= 1; i
< MAXOBJ
; i
++) {
382 fprintf(stdout
, "\nYou are wearing:\n");
383 fprintf(stdout
, " ");
403 FILL bottle or cask must be empty, and some liquid avaible
407 if ((g
.prop
[CASK
] == 1) && !here(CASK
))
409 if ((g
.prop
[BOTTLE
] == 1) && !here(BOTTLE
))
412 if ((here(BOTTLE
) && here(CASK
)) || (object
== 0))
427 if (g
.place
[ROD2
] == 212 && g
.loc
== 116)
429 if (g
.place
[ROD2
] == 116 && g
.loc
!= 116)
438 Handle fee fie foe foo...
445 k
= VAL(vocab(vtxt
[vrbx
], MISC
));
446 if (g
.foobar
!= 1 - k
) {
458 if (g
.place
[EGGS
] == plac
[EGGS
] ||
459 (toting(EGGS
) && g
.loc
== plac
[EGGS
])) {
463 /* Bring back troll if we steal the eggs back from him before
465 if (g
.place
[EGGS
] == 0 && g
.place
[TROLL
] == 0 && g
.prop
[TROLL
] == 0)
470 else if (g
.loc
== plac
[EGGS
])
474 move(EGGS
, plac
[EGGS
]);
480 brief/unbrief. intransitive only.
481 suppress long descriptions after first time.
489 if (g
.abbnum
!= 10000) {
504 previous_obj
= FALSE
;
524 if (previous_obj
|| object
== 0 || dark())
532 LOOK. can't give more detail. Pretend it wasn't dark (though it may "now"
533 be dark) so he won't fall into a pit staring into the gloom.
540 g
.visited
[g
.loc
] = 0;
547 COMBO: trying to open safe. (see comments for fee fie foe foo)
553 k
= VAL(vocab(vtxt
[vrbx
], MISC
)) - 10;
555 if (g
.combo
!= 1 - k
) {
566 bitoff(SAFE
, LOCKBT
);
569 if (g
.prop
[BOOK
] < 0) {
572 /* If remaining treasures too elusive, zap his lamp. this
573 duplicates some code, must be done here since book is
574 contained ins safe & tally stuff only works for thing
575 deposited at a location. */
576 if ((g
.tally
== g
.tally2
) && (g
.tally
!= 0))
577 g
.limit
= (g
.limit
< 35) ? g
.limit
: 35;
584 ensure uniqueness as objects are searched
585 out for an intransitive verb