I am working on using an instead command to do a few things at once, but I’m not sure where I’ve gone wrong, exactly (everything I’ve tried on my own since my last post has worked…but I am getting too comfortable with Inform 7, I guess). Here’s what I want to do: I have the player in a room (technically a pirate ship), and I don’t want them to be able to leave the pirate ship unless they give the captain two items (a broken compass and a mysterious tome). If they give the captain a combination of other items (either a jade koi fish & the broken compass, or the jade koi fish & the mysterious tome) I want play to end…so really, they can only continue if they give the right combination.
here’s what I came up with:
Instead of going from the wicked wench:
if the player gives captain avery the broken compass and the player gives captain avery the jade koi fish:
say "'We thank ye for yer contribution boy, but I can see that yer carrying a cursed item, boy,' Captain Avery says grimly. 'Cursed items on my ship will not be tolerated.' [paragraph break]'What do you mean, Captain?' you say in what can only be discerned as a frightened squeak.[paragraph break] 'Where did ye get that book, lad?' the captain narrows his eyes.[paragraph break] 'From my grandmother's library! When I picked it up, I ended up here on your ship, Captain, I swear my life on it,' you squeal. [paragraph break] 'Now, now, there's no need to be swearing what I can simply take,' the captain says as he shoots you with his pistol. 'Just as I thought. This book,' Captain Avery says to the sailors, 'be our ticket back to the real world boys. It's a portal between the world of the living and the world of the dead. We're going home, lads!'[paragraph break]As you lay on the deck, you realize that you must already be dead as there is no blood emerging from your wound; however, you still feel as though you are dying. As the world around you gets darker and darker, you realize that this must have been some kind of purgatory, and now you are slipping in to the true death.[paragraph break]You are dead.";
end the game in failure;
if the player gives captain avery the broken compass and the player gives captain avery the mysterious tome:
say "'Now, my boy,' Captain Avery says, that be a fair trade, indeed.' The sailors nod in agreement as Captain Avery holds up the treasure he has just acquired. 'Ye could not be knowing this, lad, but we have been looking for this compass for quite some time. I'll not be asking where you got it from, but we are happy as mermaids to have it back. If ye travel north, ye will be on the shores of Astoria, and I know someone who will be paying a pretty penny for that trinket of a fish ye be carrying.'[paragraph break]'Like I said,' the captain continues, 'I'll not be asking where ye captured this loot. But good luck to you, lad. We'll be wishing you the best of luck on your adventure. If you're ever on the silver seas of Astoria again, be sure to look up old Avery and his crew, won't you?'";
continue action;
if the player gives captain avery the jade koi fish and the player gives captain avery the mysterious tome:
say "'That compass, boy,' The captain narrows his eyes. 'Where did ye be getting such a thing as that?'[paragraph break]'This? This compass belonged to my grandfather, and I found it in the curio cabinet in the parlor. Grandmother said I could take it. Besides, it's broken,' you say very matter-of-factly.[paragraph break]'May I see that?' the captain asks. As you hand it over, he examines it carefully. 'Just as I thought, this compass is no more broken than ye are, and it is my rightful property.'[paragraph break]'I told you that belonged to my grandfather,' you say with a bit of force. 'How can it be yours?'[paragraph break]'Did yer grandfather ever tell you where this came from, boy?' you shake your head and the captain smiles. 'I thought not,' he says. 'Ye see, lad, this compass was mine when i was alive,' the captain begins, 'and Astoria is a kind of place ye go when ye die. A kind of purgatory for heroes, if ye will. I don't claim to be a hero, and yet here i be. This may be hard for ye to here, but ye must be dead, too. It were no coincedence, son, that your father be named Henry and yer mother be named Amelia…I am yer father. Ye see the true nature of things, and I know I'm not the paragon of fathers, what with the piracy and the consumption of rum, but if ye will have me, then we can sail the seas of Astoria together.'[paragraph break]'Then I am dead, too?' you frown as a tear comes to your eye.[paragraph break]'Yes, my boy,' your father says grimly, 'But if it makes ye feel better, I have been waiting for ye for seven years, and I would rather have no one for my first mate than you, lad.'[paragraph break] Though being dead was not your first choice, you can think of worse things than having adventures on the high seas, especially with real pirates: you've always dreamed of this moment. As for your father, you were only three when he first set sail with the king's navy, and he had been at sea for five more until the day he died. You don't remember exactly what he looked like but something inside of you confirms that Captain Avery is, indeed, your father. [paragraph break]After a few moments, you pull yourself together and brace yourself for a lifetime of adventures.";
end the game in victory;
otherwise:
say "Before you leave the Wicked Wench, you feel as though you should give Captain Avery something for his hospitality. [italic type]I can give him two of the things that I carry,[roman type] you think. [italic type]If I do that, I will still have one item to barter with later, and that should be sufficient.'[roman type]":
this instead code has worked for nearly everything else, but I don’t know if this many things complicates it too much or if I’m way off base with how I’m trying this. Any advice or suggestions are greatly appreciated. After I figure this out, I am 99% done with authoring my IF.