7 /* Initialize default verb messages */
8 static _CONST
int actmsg
[56] = {
9 0, 24, 29, 0, 33, 0, 33, 38, 38, 42,
10 14, 43, 110, 29, 110, 73, 75, 29, 13, 59,
11 59, 174, 313, 67, 13, 147, 155, 369, 146, 110,
12 13, 13, 24, 25, 110, 262, 14, 29, 271, 14,
13 14, 24, 29, 38, 24, 331, 24, 109, 332, 0,
14 0, 348, 358, 0, 364, 0};
16 _PROTOTYPE(static int ck_obj
, (void));
17 _PROTOTYPE(void von
, (void));
18 _PROTOTYPE(void voff
, (void));
19 _PROTOTYPE(void vwave
, (void));
20 _PROTOTYPE(void veat
, (void));
21 _PROTOTYPE(void vthrow
, (void));
22 _PROTOTYPE(void vfind
, (void));
23 _PROTOTYPE(void vfill
, (void));
24 _PROTOTYPE(void vfeed
, (void));
25 _PROTOTYPE(void vbreak
, (void));
26 _PROTOTYPE(void vwake
, (void));
27 _PROTOTYPE(void vdrop
, (void));
28 _PROTOTYPE(void vpour
, (void));
29 _PROTOTYPE(void vput
, (void));
30 _PROTOTYPE(void vread
, (void));
31 _PROTOTYPE(void vinsert
, (void));
32 _PROTOTYPE(void vextract
, (void));
33 _PROTOTYPE(static boolean do_battle
, (int *));
34 _PROTOTYPE(void vhit
, (void));
35 _PROTOTYPE(void vanswer
, (void));
36 _PROTOTYPE(void vblow
, (void));
37 _PROTOTYPE(void vdial
, (void));
38 _PROTOTYPE(void vplay
, (void));
39 _PROTOTYPE(void vpick
, (void));
40 _PROTOTYPE(void vput
, (void));
41 _PROTOTYPE(void vturn
, (void));
42 _PROTOTYPE(void vget
, (void));
43 _PROTOTYPE(void vlook
, (void));
47 Routine to process a transitive verb
60 case TAKE
: vtake(); break;
61 case DROP
: vdrop(); break;
62 case SAY
: bug(34); break;
63 case OPEN
: vopen(); break;
64 case CLOSE
: vclose(); break;
65 case LOCK
: vlock(); break;
66 case UNLOCK
: vunlock(); break;
67 case ON
: von(); break;
68 case OFF
: voff(); break;
69 case WAVE
: vwave(); break;
70 case KILL
: vkill(); break;
71 case POUR
: vpour(); break;
72 case EAT
: veat(); break;
73 case DRINK
: vdrink(); break;
86 case FEED
: vfeed(); break;
88 case INVENTORY
: vfind(); break;
89 case FILL
: vfill(); break;
90 case BLAST
: ivblast(); break;
91 case READ
: vread(); break;
92 case BREAK
: vbreak(); break;
93 case WAKE
: vwake(); break;
94 case REMOVE
: vextract(); break;
95 case YANK
: vyank(); break;
96 case WEAR
: vwear(); break;
97 case HIT
: vhit(); break;
98 case ANSWER
: vanswer(); break;
99 case BLOW
: vblow(); break;
100 case DIAL
: vdial(); break;
101 case PLAY
: vplay(); break;
102 case PICK
: vpick(); break;
103 case PUT
: vput(); break;
104 case TURN
: vturn(); break;
105 case GET
: vget(); break;
106 case INSRT
: vinsert(); break;
107 case LOOK
: vlook(); break;
109 printf("This verb is not implemented yet.\n");
115 Routine to speak default verb message
122 if (verb
< 1 || verb
> 55)
138 if (object
== BIRD
&& !g
.closed
&& athand(BIRD
)
139 && g
.place
[BIRD
] != g
.loc
) {
143 if (prep
== PREPOF
) {
144 if (object
&& iobj
) {
147 } else if (!object
) {
159 if (holding(object
)) {
163 /* Special case objects and fixed objects */
165 if (g
.fixed
[object
]) {
169 if (prep
== PREPIN
) {
173 /* Special case for liquids */
174 if (object
== WATER
|| object
== OIL
|| object
== WINE
) {
175 if (here(BOTTLE
) && here(CASK
)) {
187 } else if (here(CASK
)) {
199 if (object
!= BEAR
&& ((burden(0) + burden(object
)) > 15)) {
200 if (wearng(object
)) {
202 bitoff(object
, WEARBT
);
207 if (prep
== PREPFR
|| enclosed(object
)) {
212 /* Poster: hides wall safe */
213 if (object
== POSTER
&& g
.place
[SAFE
] == 0) {
216 /* Move safe and wall containing safe into view */
220 /* Boat: need the pole to push it */
221 if (object
== BOAT
) {
222 if (!toting(POLE
) && g
.place
[POLE
] != -BOAT
) {
230 /* Special case for bird. */
231 if (object
== BIRD
&& g
.prop
[BIRD
] <= 0) {
236 if (!holding(CAGE
)) {
245 bitoff(CAGE
, OPENBT
);
250 /* SWORD If in anvil, need crown & must yank */
251 if (object
== SWORD
&& g
.prop
[SWORD
] != 0) {
252 if (iobj
&& iobj
!= ANVIL
) {
257 if (!yes(215, 0, 54))
260 if (!wearng(CROWN
)) {
267 carry(object
, g
.loc
);
268 if (object
== POLE
|| object
== SKEY
|| object
== SWORD
269 || ((object
== CLOAK
|| object
== RING
) && !wearng(object
)) )
272 if (verb
== YANK
|| object
== SWORD
)
283 if (object
== PLANT
&& g
.prop
[PLANT
] <= 0)
285 if (object
== BEAR
&& g
.prop
[BEAR
] == 1)
287 if (object
== CHAIN
&& g
.prop
[BEAR
] != 0)
289 if (object
== SWORD
&& g
.prop
[SWORD
] == 5)
291 if (object
== CLOAK
&& g
.prop
[CLOAK
] == 2)
293 if (object
== AXE
&& g
.prop
[AXE
] == 2)
297 if (object
== BEES
|| object
== HIVE
)
299 if (object
== STICKS
)
311 /* Check for dynamite */
312 if (holding(ROD2
) && object
== ROD
&& !holding(ROD
))
319 if (object
== liq(BOTTLE
))
321 else if (object
== liq(CASK
))
324 if (!toting(object
)) {
328 if (prep
== PREPIN
) {
333 if (object
== BIRD
&& here(SNAKE
)) {
341 /* Set snake prop for use by travel options */
353 if (object
== POLE
&& holding(BOAT
)) {
357 /* Coins and vending machine */
358 if (object
== COINS
&& here(VEND
)) {
360 drop(BATTERIES
, g
.loc
);
361 pspeak(BATTERIES
, 0);
364 /* Bird and dragon (ouch!!) */
365 if (object
== BIRD
&& at(DRAGON
) && g
.prop
[DRAGON
] == 0) {
369 if (g
.place
[SNAKE
] == plac
[SNAKE
])
374 if (object
== BEAR
&& at(TROLL
)) {
377 destroy(TROLL
+ MAXOBJ
);
378 move(TROLL2
, plac
[TROLL
]);
379 move((TROLL2
+ MAXOBJ
), fixd
[TROLL
]);
384 else if (object
== VASE
) {
385 if (g
.loc
== plac
[PILLOW
])
388 g
.prop
[VASE
] = at(PILLOW
) ? 0 : 2;
389 pspeak(VASE
, g
.prop
[VASE
] + 1);
390 if (g
.prop
[VASE
] != 0)
394 if (worn(object
) || object
== POLE
|| object
== BOAT
)
397 bitoff(object
, WEARBT
);
402 if (enclosed(object
))
410 OPEN. special stuff for opening clam/oyster.
411 The following can be opened without a key:
412 clam/oyster, door, pdoor, bottle, cask, cage
420 else if (object
== PDOOR
&& g
.prop
[PDOOR
] == 1)
422 else if (ajar(object
))
424 else if (locks(object
) || iobj
== KEYS
|| iobj
== SKEY
) {
427 } else if (locked(object
))
432 else if (object
== CLAM
|| object
== OYSTER
) {
433 oyclam
= (object
== OYSTER
? 1 : 0);
434 msg
= oyclam
+ holding(object
) ? 120 : 124;
435 if (!athand(TRIDENT
))
437 if (iobj
!= 0 && iobj
!= TRIDENT
)
447 biton(object
, OPENBT
);
455 the following can be closed without keys:
456 door, pdoor, bottle, cask, cage
462 else if (!ajar(object
))
464 else if (locks(object
))
468 bitoff(object
, OPENBT
);
479 else if (g
.limit
< 0)
481 else if (g
.prop
[LAMP
] == 1)
505 else if (g
.prop
[LAMP
] == 0)
517 WAVE. no effect unless waving rod at fissure.
521 if (!holding(object
) &&
522 (object
!= ROD
|| !holding(ROD2
)))
524 else if (object
!= ROD
|| !at(FISSURE
) ||
525 !holding(object
) || g
.closing
)
527 else if (iobj
!= 0 && iobj
!= FISSURE
)
530 g
.prop
[FISSURE
] = 1 - g
.prop
[FISSURE
];
531 pspeak(FISSURE
, 2 - g
.prop
[FISSURE
]);
532 if (g
.chase
== 0 || g
.prop
[FISSURE
] != 0)
534 if ((g
.loc
== 17 && g
.oldloc
!= 27)
535 || (g
.loc
== 27 && g
.oldloc
!= 17))
537 /* Demise of the Wumpus. Champ must have just crossed bridge */
543 biton(WUMPUS
, DEADBT
);
544 if (g
.place
[AXE
] != plac
[WUMPUS
])
569 if (g
.place
[SNAKE
] == plac
[SNAKE
])
579 survival
= do_battle(&msg
);
589 if (g
.prop
[DOG
] == 1)
591 else if (iobj
== AXE
) {
609 msg
= 165 + (g
.prop
[BEAR
] + 1) / 2;
612 if (g
.prop
[WUMPUS
] == 6)
614 else if (iobj
== AXE
) {
626 if (g
.prop
[DRAGON
] != 0) {
633 biton(DRAGON
, DEADBT
);
636 k
= (plac
[DRAGON
] + fixd
[DRAGON
]) / 2;
637 move((DRAGON
+ MAXOBJ
), -1);
638 move((RUG
+ MAXOBJ
), 0);
641 for (i
= 1; i
< MAXOBJ
; i
++)
642 if (g
.place
[i
] == plac
[DRAGON
]
643 || g
.place
[i
] == fixd
[DRAGON
]
661 static boolean
do_battle(msg_ptr
)
670 else if (iobj
!= AXE
&& iobj
!= SWORD
) {
673 } else if (pct(25)) {
679 } else if (pct(25)) {
703 if (object
== BOTTLE
|| object
== CASK
) {
711 if (object
< WATER
|| object
> (WINE
+ 1)) {
716 if (!holding(BOTTLE
) && !holding(CASK
)) {
720 if (holding(BOTTLE
) && liq(BOTTLE
) == object
)
722 if (holding(CASK
) && liq(CASK
) == object
)
742 if (at(PLANT
) || at(DOOR
) || (at(SWORD
) && g
.prop
[SWORD
] != 0)) {
747 bitoff(DOOR
, LOCKBT
);
750 msg
= 113 + g
.prop
[DOOR
];
751 } else if (at(SWORD
)) {
752 /* If sword is alread oily, don't let him clean it. No
754 if (g
.prop
[SWORD
] != 5) {
760 msg
= 206 + g
.prop
[SWORD
] - 4;
764 if (object
== WATER
) {
765 if (g
.prop
[PLANT
] < 0)
766 g
.prop
[PLANT
] = -g
.prop
[PLANT
] - 1;
767 pspeak(PLANT
, g
.prop
[PLANT
] + 1);
768 g
.prop
[PLANT
] = (g
.prop
[PLANT
] + 2) % 6;
769 g
.prop
[PLANT2
] = g
.prop
[PLANT
] / 2;
781 If he ate the right thing and is in the right place, move him to
782 the other place with all his junk. Otherwise, narky message.
786 int msg
, i
, k
, ll
, kk
;
817 if (object
== MUSHRM
) {
824 if (!(here(kk
) || g
.fixed
[kk
] == g
.loc
))
827 /* If he hasn't taken tiny key off shelf, don't let him get it
829 for (i
= 1; i
< MAXOBJ
; i
++) {
830 if (i
== SKEY
&& g
.prop
[SKEY
] == 1)
832 if (g
.place
[i
] == plac
[kk
] && g
.fixed
[i
] == 0)
835 if (g
.loc
== plac
[SKEY
] && g
.place
[SKEY
] == plac
[SKEY
])
856 if (object
== 0 && (iobj
== BOTTLE
|| iobj
== CASK
))
861 if (object
!= WATER
&& object
!= WINE
) {
866 if (object
== liqloc(g
.loc
))
868 if (athand(CASK
) && object
== liq(CASK
))
870 if (athand(BOTTLE
) && object
== liq(BOTTLE
))
880 msg
= (iobj
== CASK
) ? 299 : 74;
882 if (object
== WATER
|| object
== (WATER
+ 1)) {
886 /* UH-OH. He's a wino. Let him reap the rewards of incontinence.
887 He'll wander around for awhile, then wake up somewhere or other,
888 having dropped most of his stuff. */
890 if (g
.prop
[LAMP
] == 1)
891 g
.limit
-= ranz(g
.limit
) / 2;
897 if (k
== 0 && pct(15))
899 if (k
== 0 && pct(25))
913 for (j
= 1; j
< MAXOBJ
; j
++) {
928 int msg
, i
, k
, dwarfn
;
930 if (holding(ROD2
) && object
== ROD
&& !holding(ROD
))
932 if (!holding(object
)) {
936 if (object
== BOAT
|| object
== BEAR
) {
942 /* No indirect object was specified. If a dwarf is present,
943 assume it is the object. If not, look for other living
944 thing. If no living things present, treat 'THROW' as 'DROP'. */
949 /* No dwarves present; figure out pausible object. */
951 for (i
= 1; i
< MAXOBJ
; i
++) {
952 if (at(i
) && living(i
)) {
961 /* It is a beastie of some sort. Is there more than one?
962 Don't kill the bird by default. */
971 if (treasr(object
) && at(TROLL
))
976 if (object
== SWORD
|| object
== BOTTLE
) {
980 if (object
== FLOWER
&& iobj
== HIVE
)
982 if (edible(object
) && living(iobj
)) {
986 /* If not axe, same as drop... */
987 if (object
!= AXE
&& iobj
!= TROLL
) {
995 if (g
.prop
[DRAGON
] == 0)
1001 g
.dseen
[dwarfn
] = g
.dloc
[dwarfn
] = 0;
1009 /* This'll teach him to throw axe at the bear */
1010 if (g
.prop
[BEAR
] == 0) {
1020 /* Or the WUMPUS! */
1021 if (g
.prop
[WUMPUS
] == 6) {
1027 if (g
.prop
[WUMPUS
] == 0) {
1039 /* Or the nice doggie! */
1040 if (g
.prop
[DOG
] != 1) {
1050 /* Snarf a treasure for the troll */
1051 if (object
== AXE
) {
1053 } else if (!treasr(object
) ||
1054 (object
== CASK
&& (liq(CASK
) != WINE
))) {
1061 g
.place
[WINE
+ 1] = 0;
1063 move((TROLL
+ MAXOBJ
), 0);
1064 drop(TROLL2
, plac
[TROLL
]);
1065 drop((TROLL2
+ MAXOBJ
), fixd
[TROLL
]);
1073 /* Otherwise it is an attack */
1088 FIND might be carrying it, or it might be here. else give caveat.
1095 (liq(BOTTLE
) == object
&& at(BOTTLE
)) ||
1096 object
== liqloc(g
.loc
))
1098 else if (dcheck() && g
.dflag
>= 2 && object
== DWARF
)
1102 else if (at(object
))
1119 if (iobj
== 0 || !living(iobj
)) {
1122 if (object
== BIRD
) {
1126 if (!living(object
)) {
1130 /* See if there is anything edible around here. */
1134 for (i
= 1; i
< MAXOBJ
; i
++)
1135 if (here(i
) && edible(i
)) {
1141 if (k
!= 1 && !dead(iobj
)) {
1142 printf("What do you want to feed the %s\n", otxt
[objx
]);
1148 /* Feed object ot indirect object */
1152 if (g
.prop
[DRAGON
] != 0)
1159 if (object
== BIRD
&& !g
.closed
) {
1171 if (g
.prop
[BEAR
] == 3)
1173 if (g
.prop
[BEAR
] == 1 || g
.prop
[BEAR
] == 2)
1177 if (object
== HONEY
) {
1186 if (object
== FOOD
&& g
.prop
[DOG
] != 1) {
1192 if (g
.prop
[WUMPUS
] == 6)
1194 if (g
.prop
[WUMPUS
] == 0)
1200 if (object
== FLOWER
) {
1201 if (enclosed(FLOWER
))
1203 drop(FLOWER
, g
.loc
);
1204 g
.fixed
[FLOWER
] = -1;
1217 FILL. object with iobj
1223 if (!vessel(object
))
1227 iobj
= liqloc(g
.loc
);
1228 if (object
== BOTTLE
|| object
== CASK
) {
1229 k
= (object
== CASK
) ? 1 : 0;
1233 if (liq(object
) != 0)
1244 g
.prop
[object
] = (int) g
.loc_attrib
[g
.loc
] & 14;
1245 g
.place
[iobj
+ k
] = -1;
1246 insert(iobj
+ k
, object
);
1247 } else if (object
== VASE
) {
1248 if (iobj
== 0 || !holding(VASE
)) {
1255 if (enclosed(object
))
1257 drop(object
, g
.loc
);
1258 } else if (object
== GRAIL
)
1267 READ. Magazine in dwarvish, message we've seen, and ... oyster?
1277 if (object
&& iobj
) {
1308 if (g
.hinted
[2] && holding(OYSTER
))
1310 if (!g
.hinted
[2] && holding(OYSTER
) && g
.closed
) {
1311 g
.hinted
[2] = yes(192, 193, 54);
1321 BREAK. works for mirror in repository and, of course the
1322 vase and bottle. Also the sword is more brittle than it appears.
1341 if (g
.prop
[VASE
] == 0) {
1348 if (g
.prop
[BOTTLE
] != 3) {
1361 if (holding(SWORD
)) {
1369 if (enclosed(object
))
1371 if (holding(object
))
1372 drop(object
, g
.loc
);
1373 g
.fixed
[object
] = -1;
1380 WAKE. only use is to disturb the dwarves or the Wumpus.
1381 Other wumpus-wakers link here.
1393 if (at(DOG
) && g
.prop
[DOG
] == 1)
1395 if (object
== DWARF
&& g
.closed
) {
1405 YANK. A variant of 'CARRY'. In general, not a good idea.
1406 At most, it gets the cloak or a couple of snide comments.
1412 else if (object
== BEAR
&& g
.prop
[CHAIN
])
1414 else if (object
== CLOAK
&& g
.prop
[CLOAK
] == 2) {
1415 /* Cloak. big trouble ahead. */
1419 carry(CLOAK
, g
.loc
);
1421 if (at(WUMPUS
) && g
.prop
[WUMPUS
] == 0) {
1432 WEAR. Only good for jewels, ruby slippers, cloak & crown.
1433 But he might try the sword. Anything else is ridiculous.
1434 Another variant of 'CARRY'.
1440 if (object
== SWORD
&& g
.prop
[SWORD
] != 3)
1442 else if (worn(object
)) {
1443 if (object
== CLOAK
&& g
.prop
[CLOAK
] == 2)
1445 else if (wearng(object
))
1446 msg
= (object
== SHOES
) ? 227 : 210;
1449 biton(object
, WEARBT
);
1450 if (enclosed(object
))
1452 if (holding(object
))
1460 printf("Just exactly how does one wear a %s\n", otxt
[objx
]);
1468 HIT. If not punching out telephone, assume attack.
1472 if (at(WUMPUS
) && g
.prop
[WUMPUS
] == 0) {
1476 if (object
!= PHONE
) {
1485 if (g
.prop
[PHONE
] == 2)
1498 ANSWER (telephone). Smartass for anything else.
1519 if (g
.prop
[PHONE
] != 0)
1521 else if (g
.closed
) {
1540 BLOW. Joshua fit de battle of Jericho, and de walls ...
1547 if (object
!= 0 && iobj
!= 0) {
1556 if (object
== HORN
) {
1557 msg
= outside(g
.loc
) ? 277 : 266;
1560 if (g
.prop
[WUMPUS
] == 0)
1563 } else if (g
.prop
[WALL
] != 1 && (g
.loc
== 102 || g
.loc
== 194)) {
1564 k
= g
.loc
== 194 ? 195 : 196;
1567 for (i
= 1; i
< MAXOBJ
; i
++)
1568 if (g
.place
[i
] == g
.loc
|| g
.fixed
[i
] == g
.loc
)
1578 DIAL. No effect unless at phone.
1582 if (object
!= PHONE
)
1584 else if (g
.closed
) {
1593 PLAY. Only for horn or lyre.
1600 if (object
!= 0 && iobj
!= 0) {
1606 if (object
== HORN
) {
1610 if (object
== LYRE
) {
1612 if (here(DOG
) && !dead(DOG
)) {
1625 PICK/ PICK UP. Can pick flower & mushrooms,
1626 But must 'PICK UP' everything else.
1633 if (object
== FLOWER
|| object
== MUSHRM
|| prep
!= 0)
1641 PUT DOWN: equivalent to drop
1642 PUT IN: if liquid, means fill
1643 PUT ON: wear of drop
1648 printf("Where do you want to put the %s\n", otxt
[objx
]);
1654 /* PUT ON: wear or put object on iobj */
1655 if (prep
== PREPON
) {
1658 otxt
[objx
] = iotxt
[iobx
];
1661 if (worn(object
) || object
== 0)
1666 /* PUT DOWN: "drop" */
1667 if (object
== 0 && iobj
== 0) {
1685 if (!object
&& iobj
== LAMP
)
1689 else if (prep
== PREPON
)
1698 GET (no prep): "take"
1704 if (prep
== 0 || prep
== PREPFR
)
1706 else if (object
== 0) {
1723 printf("Where do you want to %s it?\n", vtxt
[vrbx
]);
1727 if (object
== SWORD
&& iobj
== ANVIL
&& g
.prop
[SWORD
] == 0)
1729 if (!vessel(iobj
)) {
1734 if (g
.fixed
[object
]) {
1738 if (object
== iobj
) {
1742 if (iobj
== BOTTLE
|| iobj
== CASK
|| iobj
== VASE
1743 || iobj
== GRAIL
|| (object
>= WATER
&& object
<= WINE
+ 1)) {
1753 if (iobj
== CHEST
) {
1758 bitoff(object
, WEARBT
);
1761 if (enclosed(object
))
1763 insert(object
, iobj
);
1769 /* Bird goes into cage and only cage */
1770 if (object
== BIRD
&& iobj
!= CAGE
) {
1774 if (object
!= BIRD
&& iobj
== CAGE
) {
1778 if (object
== BIRD
) {
1783 /* Bar vase & pillow from safe, to force putting down on florr */
1784 if ((object
== VASE
|| object
== PILLOW
) && iobj
== SAFE
) {
1788 if (object
!= RADIUM
&& iobj
== SHIELD
) {
1792 if (iobj
== PHONE
) {
1793 if (object
== COINS
|| object
== SLUGS
) {
1802 if (object
== COINS
|| object
== SLUGS
) {
1804 move(BATTERIES
, g
.loc
);
1805 if (g
.prop
[BATTERIES
] == 1) {
1809 g
.prop
[BATTERIES
] = 0;
1810 pspeak(BATTERIES
, 0);
1815 /* Put batteries in lamp. There is a glitch here, in that if he
1816 tries to get a third set of batteries before the second set has
1817 been inserted, the second set disappears!
1818 ***fix this some time ***
1821 if (object
!= BATTERIES
|| g
.prop
[BATTERIES
] != 0)
1824 g
.prop
[BATTERIES
] = 1;
1825 if (enclosed(BATTERIES
))
1827 if (holding(BATTERIES
))
1828 drop(BATTERIES
, g
.loc
);
1841 bitoff(object
, WEARBT
);
1844 if (enclosed(object
))
1846 insert(object
, iobj
);
1854 /* Remove or take from */
1859 if (object
== RING
&& g
.prop
[RING
] == 2) {
1867 if (!enclosed(object
))
1869 iobj
= -g
.place
[object
];
1871 if (g
.place
[object
] != -iobj
)
1875 if (object
== WATER
|| object
== OIL
|| object
== WINE
)
1877 if (!toting(object
) && ((burden(0) + burden(object
)) > 15))
1880 if (object
== BIRD
) {
1891 lock. chain, grate, chest, elfin door
1892 Here are the current lock/unlock messages & numbers:
1893 31 you have no keys.
1895 34 it's already locked.
1896 35 the grate is now locked.
1897 36 the grate is now unlocked.
1898 37 it was allready unlocked.
1899 55 you can't unlock the keys.
1900 171 The chain is now unlocked.
1901 172 The chain is now locked.
1902 173 There is nothing here to which the chain can be locked.
1903 224 Your keys are all too large.
1904 234 The wrought-iron door is now locked.
1905 235 The tiny door is now locked.
1906 236 The wrought-iron door is now unlocked.
1907 237 The tiny door is now unlocked.
1908 375 You don't have the right key.
1909 333 the chest is now locked.
1910 334 the chest is now unlocked.
1911 367 The safe's door swings shut.
1917 if (!hinged(object
))
1919 printf("I don't know how to lock or unlock the %s\n",
1923 else if (!locks(object
))
1925 else if (locked(object
))
1927 else if (!athand(KEYS
) && !athand(SKEY
) && object
!= SAFE
)
1936 if (g
.loc
!= plac
[CHAIN
])
1940 if (enclosed(CHAIN
))
1944 g
.fixed
[CHAIN
] = -1;
1945 biton(CHAIN
, LOCKBT
);
1946 bitoff(CHAIN
, OPENBT
);
1953 biton(CHEST
, LOCKBT
);
1954 bitoff(CHEST
, OPENBT
);
1964 msg
= 234 + (TDOOR2
- object
);
1965 k
= TDOOR
+ TDOOR2
- object
;
1968 biton(object
, LOCKBT
);
1969 bitoff(object
, OPENBT
);
1977 biton(GRATE
, LOCKBT
);
1978 bitoff(GRATE
, OPENBT
);
1984 biton(SAFE
, LOCKBT
);
1985 bitoff(SAFE
, OPENBT
);
1994 UNLOCK. chain, grate, chest, elfin door.
2000 if (object
== KEYS
|| object
== SKEY
)
2002 else if (!hinged(object
))
2004 printf("I don't know how to lock or unlock the %s\n",
2008 else if (!locked(object
))
2010 else if (!locks(object
))
2012 else if (object
== SAFE
) {
2013 if (iobj
== KEYS
|| iobj
== SKEY
)
2017 } else if (!athand(KEYS
) && !athand(SKEY
))
2025 if (g
.prop
[BEAR
] == 0)
2031 if (g
.prop
[BEAR
] != 3)
2033 g
.fixed
[BEAR
] = 2 - g
.prop
[BEAR
];
2034 bitoff(CHAIN
, LOCKBT
);
2035 biton(CHAIN
, OPENBT
);
2041 bitoff(CHEST
, LOCKBT
);
2042 biton(CHEST
, OPENBT
);
2047 /* Elvin door stuff to lock/unlock tiny door w/special key.
2048 the damn thing is really at four places, and we want the
2049 right messages if he only has 'BIG'keys (or no keys).
2050 Also, he can unlock it either while he is big or small. */
2062 msg
= 234 + 2 + (TDOOR2
- object
);
2063 k
= TDOOR
+ (TDOOR2
- object
);
2066 bitoff(object
, LOCKBT
);
2067 biton(object
, OPENBT
);
2081 bitoff(GRATE
, LOCKBT
);
2082 biton(GRATE
, OPENBT
);
2103 /* Look into something (a container). */
2105 if (!ajar(iobj
) && opaque(iobj
))
2106 rspeak(actmsg
[verb
]);
2107 else if (g
.holder
[iobj
] == 0)
2114 /* Look at something. If written, read it. */
2115 } else if (printed(iobj
)) {
2119 } else if (iobj
== SPHERE
) {
2120 if (!inside(g
.loc
) || athand(SAPPHIRE
))
2125 sloc
= g
.place
[SAPPHIRE
];
2126 if ((g
.loc_attrib
[sloc
] % 2 == 0 || enclosed(SAPPHIRE
))
2128 && !g
.place
[LAMP
] == sloc
&& g
.prop
[LAMP
] != 0)
2132 if (sloc
== 239 && !g
.flg239
) {
2140 printf("I see nothing special about the %s?\n", iotxt
[iobx
]);