1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-06-30 22:14:58 +03:00

Rewrite of the Pink or Blue test case

This commit is contained in:
Graham Nelson 2023-06-02 10:13:22 +01:00
parent 407631d031
commit e5f4a75bc0
7 changed files with 54 additions and 46 deletions

View file

@ -22,6 +22,13 @@ only hold bug fixes and other minor tweaks: anything larger is covered by
references and links provided. (A feature request for this was filed as
Jira bug [I7-2232](https://inform7.atlassian.net/browse/I7-2232).)
## Documentation
"Writing with Inform" and "The Recipe Book" benefit from a revision throughout to
remove unnecessary gender-binary language, mostly to do with pronouns attached
to "the player", or similar. The example `Blue or Pink` has become `Good or Evil`,
and now poses a moral rather than gender-based question.
## Bug fixes
- Fix for Jira bug [I7-2344](https://inform7.atlassian.net/browse/I7-2344)

View file

@ -202,7 +202,7 @@ Appraisal == OMIT
*TRAITS DETERMINED BY THE PLAYER
Name of player character selected at start of play
Asking the player to choose a gender
Asking the player to choose to be good or evil
Allowing the player to describe the main character before starting play
*CHARACTERIZATION

View file

@ -1,41 +0,0 @@
*** Defining phrases in Inform 6
(Asking the player to choose a gender; Pink or Blue)
Asking the player to select a gender to begin play.
Suppose we would like to allow the player to choose a gender for the main character. We'd also like this to happen at the beginning of the game and outside the main parsing sequence. "When play begins" seems like a good place to put this.
{*}"Pink or Blue"
When play begins:
say "Should your character be male or female? >";
if men win, now the player is male;
otherwise now the player is female;
say paragraph break.
Now a piece of Inform 6 code handles the unusual input. It's not necessary to understand this to use it, and the code should work for any question you'd like to ask the player. The first three words in quotation marks ('male', 'M', 'man'...) correspond to positive feedback; the later three words correspond to negative feedback. So "to decide whether men win" will be true if the player types one of the first three, and false if they type one of the last three.
{**}To decide whether men win:
(- Question('male','M//','man','female','F//','woman') -)
Include (-
[ Question pos1 pos2 pos3 neg1 neg2 neg3 first_word_typed;
while (true) {
VM_ReadKeyboard(buffer, parse);
wn = 1; first_word_typed = NextWordStopped();
if (first_word_typed == pos1 or pos2 or pos3) rtrue;
if (first_word_typed == neg1 or neg2 or neg3) rfalse;
print "Please choose ", (address) pos1, " or ", (address) neg1, ". > ";
}
];
-)
Instead of examining the player when the player is female:
say "Congratulations, you are a girl!"
Instead of examining the player when the player is male:
say "Congratulations, you are a boy!"
The Room of Self-Knowledge is a room. "Mirrors cover every available wall-surface of this hexagonal chamber, allowing you to examine yourself from all angles."

View file

@ -0,0 +1,42 @@
*** Defining phrases in Inform 6
(Asking the player to choose to be good or evil; Good or Evil)
Asking the player to select whether to be a good or evil character to begin play.
Suppose we would like to allow the player to make a fundamental choice at the beginning of the game, and outside the main parsing sequence. "When play begins" seems like a good place to put this.
{*}"Good or Evil"
A person can be good or evil.
When play begins:
say "Should your character be good or evil? >";
if good wins, now the player is good;
otherwise now the player is evil;
say paragraph break.
Now a piece of Inform 6 code handles the unusual input. It's not necessary to understand this to use it, and the code should work for any question you'd like to ask the player. The first three words in quotation marks ('good', 'G', 'goody'...) correspond to positive feedback; the later three words correspond to negative feedback. So "to decide whether good wins" will be true if the player types one of the first three, and false if they type one of the last three.
{**}To decide whether good wins:
(- Question('good','G//','goody','evil','E//','bad') -)
Include (-
[ Question pos1 pos2 pos3 neg1 neg2 neg3 first_word_typed;
while (true) {
VM_ReadKeyboard(buffer, parse);
wn = 1; first_word_typed = NextWordStopped();
if (first_word_typed == pos1 or pos2 or pos3) rtrue;
if (first_word_typed == neg1 or neg2 or neg3) rfalse;
print "Please choose ", (address) pos1, " or ", (address) neg1, ". > ";
}
];
-)
Instead of examining the player when the player is evil:
say "It's clear from the look in your eye that you are evil!"
Instead of examining the player when the player is good:
say "It's clear from the look in your eye that you are good."
The Room of Self-Knowledge is a room. "Mirrors cover every available wall-surface of this hexagonal chamber, allowing you to examine yourself from all angles."

View file

@ -1,3 +0,0 @@
> Should your character be male or female? >
> Please choose male or female. >

View file

@ -0,0 +1,3 @@
> Should your character be good or evil? >
> Please choose good or evil. >

View file

@ -630,7 +630,7 @@ Some IF tries to make the viewpoint character more congenial to the player by al
<b>Identity Theft</b> demonstrates asking the player to supply the viewpoint character's name.
<b>Pink or Blue</b> demonstrates a way to let the player choose a gender at the start of play: this will mostly be interesting if the rest of the story makes some use of the player's choice. Since that example is written expressly to demonstrate included Inform 6 code, however, we may find it more congenial to generalize from the more flexible <b>Baritone, Bass</b>.
<b>Good or Evil</b> demonstrates a way to let the player choose a moral position at the start of play: this will mostly be interesting if the rest of the story makes some use of the player's choice. Since that example is written expressly to demonstrate included Inform 6 code, however, we may find it more congenial to generalize from the more flexible <b>Baritone, Bass</b>.
This is not the only way to go - as we'll see in the next section, there's also something to be said for making the viewpoint character a strongly distinct creature with well-defined preferences and attitudes.