Version 2 of Mood Variations by Emily Short begins here. "Allows the author to define a mood value for characters and then use text substitutions such as '[when bored]The king fidgets on his throne[or sleepy]The king snores[at other times]The king grins[end when].' Moods will be interpreted in 'writing a paragraph' and similar contexts as the mood of the person described in the paragraph, but at other times according to the mood of the person to whom the player is currently speaking." Mood is a kind of value. A person has a mood. To say set (attitude - a mood): now the mood of the current interlocutor is attitude. Include (- [ CurMood; if ( (+ item described +) && (+ item described +) has animate ) return (+ mood of the item described +); if ( (+ current interlocutor +) ) return (+ mood of the current interlocutor +); return 0; ]; -) To say when (N - a mood) -- beginning say_by_mood: (- switch( curMood() ) {-open-brace} {N}: -); To say or (N - a mood) -- continuing say_by_mood: (- {N}: -); To say at other times -- continuing say_by_mood: (- default: -) To say end when -- ending say_by_mood: (- {-close-brace} -) Mood Variations ends here. ---- Documentation ---- This is quite a light-weight extension, designed to be used with a larger conversation library of your choice. It makes certain assumptions -- namely, that there is some character known as "current interlocutor" (defined as in "current interlocutor is an object that varies"). The current interlocutor might sometimes be nothing. We must also define our own spectrum of moods appropriate to the game we're currently writing. If we are using a simple model in which characters can only like, be neutral toward, or dislike the player, we might write: The moods are friendly, neutral, and hostile. A person is usually neutral. ...though in a more complicated game we could equally give a much richer range of options. The purpose of all this is to allow us to write text alternatives that are keyed to the mood of the person to whom we are speaking. So for instance: Instead of asking Pam about "love": say "'It's all right for some,' says Pam[when friendly], winking[or hostile], with a bit of a snarl in her voice. Clearly you've gotten on her bad side[at other times] blandly[end when]." will select our first option if Pam is friendly; the second if her mood is hostile; and the third if her mood is neutral. The order in which we defined our moods the first time determines the order in which they may be invoked by the textual substitution. We will probably also want the ability to set the mood of the current interlocutor in response to what is being said. We may do this with the "set..." token, as in say "Pam sighs heavily. [set irritated]". As long as "set..." is followed by the name of a mood, the current interlocutor will be given that mood.