Scroll Thief — 24 of 138

Daniel M. Stelzer

Release 2

Book N - Naming the Player

The player's full name is a text that varies. The player's forename is a text that varies. The player's surname is a text that varies.

The information-gathering flag is a truth state that varies. The information-gathering flag is true.

First when play begins (this is the ask player's name and gender rule):

if the information-gathering flag is false, make no decision; [Allow the rules the second time through.]

follow the primary introduction rule;

now the command prompt is "What do you want to write? ";

now the information-gathering stage is 1;

rule succeeds. [This should block the rest of the When Play Begins rules.]

The information-gathering stage is initially 0.

The ask player's name and gender rule is listed after the show title page rule in the when play begins rulebook.

Rule for printing the banner text when the information-gathering flag is true: do nothing.

Rule for constructing the status line when the information-gathering flag is true: do nothing.

Instead of looking when the information-gathering flag is true: take no time.

After reading a command when the information-gathering flag is true:

if the information-gathering stage is 1:

if the number of words in the player's command is greater than five:

say "[paragraph break]You try to fit '[the player's command]' on the page, but it doesn't quite fit. You rub it out.";

reject the player's command;

now the player's full name is the substituted form of "[the player's command]";

let T be word number 1 in the player's full name;

if T is "sir" or T is "mister" or T is "mr" or T is "mr." or T is "lord" or T is "dame" or T is "miss" or T is "mrs" or T is "mrs." or T is "ms" or T is "ms." or T is "lady": [Strip titles.]

replace word number 1 in the player's full name with "";

now the player's forename is word number 1 in the player's full name;

now the player's surname is the player's full name;

replace word number 1 in the player's surname with ""; [Remove first name.]

while punctuated word number 1 in the player's surname is "-": [Deal with hyphenated first names.]

now the player's forename is the substituted form of "[player's forename][unpunctuated word number 1 in the player's surname]";

replace unpunctuated word number 1 in the player's surname with "";

while unpunctuated word number 1 in the player's surname matches the text ".": [Remove initials.]

replace unpunctuated word number 1 in the player's surname with "";

while character number 1 in the player's surname matches the regular expression "\s": [Remove leading whitespace.]

replace character number 1 in the player's surname with "";

if the player's surname is empty, now the player's surname is the player's forename;

say line break;

follow the secondary introduction rule;

now the command prompt is "Of course, you will eventually be addressed as... [i](Mr, Ms, Mx?)[/i] ";

now the information-gathering stage is 2;

reject the player's command;

otherwise if the information-gathering stage is 2:

let the temporary gender be unknown-gender;

if the player's command includes "ms/mrs/miss/madam/ma'am":

now the temporary gender is feminine;

otherwise if the player's command includes "mr/mister/master/sir":

now the temporary gender is masculine;

otherwise if the player's command includes "mx":

now the temporary gender is gender-neutral;

otherwise:

say "[note][bracket]Try [tt]Mr[/tt], [tt]Ms[/tt], or [tt]Mx[/tt].[close bracket][/note][p]";

reject the player's command;

say "[i]This means that [temporary gender] pronouns will be used for you. Is this correct? [/i]";

if the player consents:

set the gender of the player to the temporary gender;

say paragraph break;

follow the tertiary introduction rule;

get ready to start;

reject the player's command;

otherwise:

say "[b]*** ERROR ***[/b] The information-gathering stage is [information-gathering stage] - INVALID.".

To get ready to start:

wait for any key;

clear the screen;

[ now the command prompt is "[if accessibility is active]Your command [else]>";]

now the information-gathering flag is false;

follow the when play begins rules;

say "[banner text]";

move the player to the location.

This is the mirror description rule: [This is used whenever we have to describe the player in a mirror or such.]

say "You see reflected in the mirror one of the most stunningly [if the player is masculine]handsome men[otherwise if the player is feminine]beautiful women[otherwise]attractive people[end if] you have ever laid eyes on. You take a moment to [one of]adjust your hair[or]straighten your student cloak[or]position your robes more elegantly[purely at random]. There, that's better."