mirror of
https://github.com/ganelson/inform.git
synced 2024-07-16 22:14:23 +03:00
53 lines
1.6 KiB
Plaintext
53 lines
1.6 KiB
Plaintext
** To say one of
|
|
(Creating our own text variations rules, part two--Different player characters that see different things; Uncommon Ground)
|
|
Making a "by viewpoint" token, allowing us to design our own text variations such as "[show to yourself]quaint[to Lolita]thrilling[to everyone else]squalid[end show]" depending on the identity of the player at the moment.
|
|
|
|
A slightly more challenging case than the "by atmosphere" example is one in which we want to create text variations depending on the identity of our player character.
|
|
|
|
What we want to do is build a switch statement in I6, one that looks something like
|
|
|
|
switch(player)
|
|
{
|
|
yourself: print "quaint";
|
|
Lolita: print "thrilling";
|
|
default: print "squalid";
|
|
}
|
|
|
|
out of I7 that looks like this:
|
|
|
|
say "[show to yourself]quaint[to Lolita]thrilling[to everyone else]squalid[end show]".
|
|
|
|
{*}"Uncommon Ground"
|
|
|
|
The Mud Village is a room. "You stand at the center of a [show to yourself]quaint[to Lolita]thrilling[to everyone else]squalid[end show] mud village."
|
|
|
|
Leforge is a man in the Mud Village. Lolita is a woman in the Mud Village.
|
|
|
|
Instead of waiting:
|
|
if the player is Lolita, now the player is Leforge;
|
|
if the player is yourself, now the player is Lolita;
|
|
say "You jump bodies. Whoops!"
|
|
|
|
To say show to (N - a person) -- beginning say_seen_by:
|
|
(-
|
|
switch(player)
|
|
{-open-brace}
|
|
{N}:
|
|
-).
|
|
|
|
To say to (N - a person) -- continuing say_seen_by:
|
|
(-
|
|
{N}:
|
|
-).
|
|
|
|
To say to everyone else -- continuing say_seen_by:
|
|
(-
|
|
default:
|
|
-)
|
|
|
|
To say end show -- ending say_seen_by:
|
|
(-
|
|
{-close-brace}
|
|
-)
|
|
|
|
Test me with "look / z / look / z / look". |