version 1/110101 by Edward Griffiths
Example: *** Winning and Dying - How to add traditional "win" and "die" messages to your games.
The Adventure Book extension provides The Last Page as a tidy little "end game" menu that you can use in your stories, but the burden of printing out a message to the player to indicate success or failure falls on the author.
Suppose you'd like ending pages that look more like traditional Inform games. This game shows you an example of how you can do just that. Failure and Success are pages that tell the player that he has died or won, respectively. Both choices divert to GameEnd, which displays the usual restart/restore/quit option that Inform provides automatically. We even define an AMUSING choice as a magic word that only works at GameEnd and only if the player has gone through Success.
"The Lady or the Tiger?" by Edward Griffiths
Include Adventure Book by Edward Griffiths
Amusing is a magic word.
The First Page is a page.
"You stand in the arena, a door to your left and a door to your right. Which one will you choose?"
A choice called tfpa is for The First Page. "Left". It triggers LeftDoor.
A choice called tfpb is for The First Page. "Right". It triggers RightDoor.
LeftDoor is a page.
"You open the left door just a crack, and suddenly a monstrous tiger leaps out at you! It gobbles you up in no time at all."
It is followed by Failure.
RightDoor is a page.
"You open the right door to discover a beautiful woman waiting inside! You are wed immediately."
It is followed by Success.
Failure is a page.
"*** You have died ***".
It is followed by GameEnd.
Success is a page.
"*** You have won ***".
It gives AmusingChoice. It is followed by GameEnd.
GameEnd is a page.
"Would you like to RESTART, RESTORE a saved game[if AmusingChoice is on], see some suggestions for AMUSING things to do[end if] or QUIT?"
A use called genda is for GameEnd. It triggers Amusement. It uses amusing. It requires AmusingChoice.
Amusement is a page.
"Read the original story by Frank Stockton."
It is a dead end.