I want to respond to different cases: (1) the location is empty (except for the player); (2) Someone in the location is not Ganon; (3) Ganon is in the location.
I’m having trouble phrasing this correctly. It doesn’t even recognize the gender of the person; I thought that was built in. Here is some of my incorrect code.
Instead of banking when location is not Loan Office:
if only the player is in the location:
say "To whom are you talking? There is no one here that does banking." instead;
if a person who is not Ganon and who is not the player is in location:
say " 'You'll want to talk to Ganon in the Emporium about that.' " instead;
if Ganon is in location:
say "Ganon says, 'All banking business is done in my Office. Do you have any banking business?' ";
The player being a person complicates things a lot. If I check for a person, the player is always there. Is there a general way to exclude the player from a person check?
For “only the player”, I think this is the best approach:
Definition: a person is alone if the number of people in the location of the person is 1.
Then you can write if the player is alone:
For the second case, I think this might work:
Definition: a person is other if it is not the player.
And then you might be able to write if an other person except Ganon is in the location:. But I’m not sure if except is actually recognized in that context. I know it is recognized in some contexts, but not sure that’s one of them.
Another possibility for case 2 might be to include the Alternatives extension (I forget who it was by). Then you might be able to write if a person who is neither Ganon nor the player is in the location: or if anyone in the location is neither Ganon nor the player:. Again though, I’m not certain it works in those specific contexts, as “neither…nor” is a boolean phrase, and we’re working with descriptions here.
A third possibility is to just invent an adjective for it.
Definition: a person is bystander if it is not Ganon and it is not the player.
Then just write if a bystander is in the location:. Might need to be if a bystander person is in the location:.
Yeah, I generally have both “other” and “another” mean “not the player”. It tends to read very nicely. But “non-player” is also a perfectly fine adjective for it.
Okay. I got this code to work. It is a meld of many of the ideas all of you presented.
Definition: A person is alone if the number of people in the location is 1.
Definition: A person is NPC if it is not the player.
[A synonym for any of the Loan Office services]
Instead of banking when location is not Loan Office:
if player is alone in the location:
say "To whom are you talking? There is no one here that does banking." instead;
otherwise:
let P be a random NPC in location;
if P is not Ganon:
say " [Printed name of P] says, 'You'll want to talk to Ganon in the Emporium about that.' " instead;
if Ganon is in location:
say "Ganon says, 'All banking business is done in my Office. Do you have any banking business?' ";