In the code below, I’ve got a box that is both a surface (so it can have a keyhole, although that is not shown) and a container that will reveal what is inside when it is unlocked. I want to make it easy on the player so that if he types >Unlock box, it will both unlock and open the box. But my code to do that isn’t getting reached. Instead it is getting executed as an implict action, so that if he types >Unlock box with frob, it gets a “not suitable” response, and if he types >Unlock box with key, it simply says, “Unlocked” and unlocks (but does not open) the box.
How can I block the implicit “unlock” action so I can use my own code?
(Also, LT3 talks about a KeyedLockable Class might be useful for this, but it doesn’t seem to be in the libary any more. Is it still around somewhere?)
Thanks,
–Bob
th_greybox: ComplexContainer, Fixture
{
name = 'grey box'
vocabWords = 'grey gray box'
location = rm_glick
// keyList = [th_greybox_key]
subSurface: ComplexComponent, Surface {}
subContainer: ComplexComponent, KeyedContainer { keyList = [th_greybox_key]} //I'm surprised this worked!
dobjFor(OpenWith) asDobjFor(UnlockWith)
dobjFor(UnlockWith) { // TODO. 9/4/15. When I use KeyedContainer, this code is not getting called. Implicit unlock is grabbing it first.
verify () {}
action () {
if (gIobj != th_greybox_key) {
"You can't unlock the spell blocker with that. ";
}
else {
th_grebox.makeLocked(nil);
th_greybox.makeOpen(true);
"You unlock and open the box. Inside, you see a battery. ";
}
}
}
}