Been playing around with multiple item actions. It bugs me when taking a bunch of the same thing and I get:
I tried to group the taking by borrowing shamelessly from the “Western Art History 305” example as follows:
[code]The plural of shiny is shinies. A shiny is a kind of a thing.
A multiple action processing rule when the action name part of the current action is the taking action (this is the getting shinies rule):
let L be the multiple object list;
let F be L;
let the shiny count be 0;
repeat with item running through L:
if the item is a shiny:
silently try taking the item;
if the player encloses the item:
increment the shiny count;
remove the item from F;
if the shiny count is greater than zero:
say “[Shiny count in words] shin[if shiny count is one]y[otherwise]ies[end if]: Taken.”;
if the number of entries in F is less than the number of entries in L:
alter the multiple object list to F.
Cave of Wonders is a Room.
Twelve shinies are in the Cave.
A transparent container called a crystal pumpkin is in the cave. The pumpkin contains three shinies. The pumpkin is closed. The pumpkin is fixed in place.[/code]
It works fine until there are shinies that can’t be taken for some reason. Here’s what I get with the above code:
There must be a better way. I mean, it would be really cool if it said “The crystal pumpkin isn’t open” just once. Or maybe is there a way to check to see if an item is retrievable without actually trying to take it?
What’s the preferred way to do this?