Hi,
Im working on a phone system, most of which comes from the “four cheeses” example.
Currently the player can call someone while he is already on the phone with that person, and I want to remain on the phone with that person but just have a comment about it.
My work is below, and the section is called repeat is the where the difficulties lie.
I just can’t work out how to get “entry two matches entry three if someone has been called two times in a row.”
Carry out calling it by name on:
say " hi[if the number of entries in the phonequeue is greater than 2][entry 2 of the phonequeue]
[entry 3 of the phonequeue]";
if “[entry 2 of the phonequeue]” matches “[entry 3 of the phonequeue]”;
if the noun matches second noun, say “hurray.”
I initially tried “if the players command” matches “entry two” but that would never work because the players command might be “call Kevin” while the entry 2 of the phonequeue is just “Kevin”.
Thanks
Michelle
“test phone” by Michelle Hellemons
Hallway is a room.
Chapter : Telephone
Section : Initial Stuff
A telephone is a kind of device. Understand “phone” or “telephone” , “smartphone” , “mobilephone”, “mobile phone”, “smart phone”, “mobile” as a telephone.
Connection relates one thing to another (called the phonelist).
The verb to reach means the connection relation.
Calling it on is an action applying to one visible thing and one thing.
Carry out calling it on:
if a person (called the listener) can see the noun, now the player reaches the listener.
Report calling it on:
say “The dial tones beep and pulse and float through space and your own head.”
Rule for supplying a missing second noun while calling something on:
assign a phone.
To assign a phone:
if the player can touch a telephone (called the current phone):
say “(on [the current phone])[line break]”;
now the second noun is the current phone;
otherwise:
say “You don’t have a phone handy.”
A person can be known or unknown.
Chatvalue is a kind of value. The chatvalues are on and off. Every person has a chatvalue. The chatvalue of every person are off.
Section : Calling on Phone
Understand “call [any known person]” as calling it by name on.
Understand “ring [any known person]” as calling it by name on.
Understand “dial [any known person]” as calling it by name on.
Understand “call [any known person] on [something]” as calling it by name on.
Rule for supplying a missing second noun while calling something by name on:
assign a phone.
Calling it by name on is an action applying to one visible thing and one thing.
Check calling it by name on:
if the noun is in the location, say “[The noun] is right here.” instead.
Carry out calling it by name on:
if the noun can touch a telephone (called the link), try calling the link on the second noun;
otherwise say “You can’t reach [the noun].” instead.
Check calling it by name on:
if the smartphone is switched off, say “turn phone on first .” instead.
Section : Repeat
The phonequeue is a list of objects that varies.
Check calling it by name on:
truncate the phonequeue to the last 2 entries;
Add the phonelist of the player to the phonequeue;
let the next phonelist of the player be entry 1 of the phonequeue.
Carry out calling it by name on:
say " hi[if the number of entries in the phonequeue is greater than 2][entry 2 of the phonequeue]
[entry 3 of the phonequeue]";
if “[entry 2 of the phonequeue]” matches “[entry 3 of the phonequeue]”;
if the noun matches second noun, say “hurray.”
[Carry out calling it by name on:
let N be “[the player’s command]”;
let Y be “[entry 3 of the phonelist]”;
if N matches the text Y , say “hurray!”;
otherwise say "not matching. "]
[Report calling it by name on:
if the text of “[entry 1 of the phonelist ] exactly matches [ entry 3 of the phonelist]”, say "Finally! "]
[Check calling it by name on:
If the player’s command includes a known person
let Y be “[entry 3 of the phonelist]”;
if nameone matches the text Y , say “hurray!”;
otherwise say "not matching. "]
Check calling it by name on:
Say “whole list [phonequeue]”.
Check calling it by name on when the number of entries in the phonequeue is greater than 2:
say " one and two [entry 1 of the phonequeue][entry 2 of the phonequeue]."
[and player’s command matches an entry of the phonequeue;]
[ If the player’s command matches entry 2 of the phonequeue , say “already talking to them.”]
Section : Hanging up
Understand “hang up [something]” as hanging up.
Hanging up is an action applying to one thing.
Check hanging up:
if the noun is not a telephone, say “You can’t hang up [the noun].” instead;
if the player does not reach someone, say “You’re not on the line with anyone.” instead.
Carry out hanging up:
now the player does not reach anyone.
Report hanging up:
say "You end the call. "
Section : Players phone
The player carries a telephone called a Smartphone. The smartphone is switched off.
After switching on the smartphone :
say “The phone starts up with its android icecream sandwich dude and startup jingles.”
After switching off the smartphone:
say "Its off because there is not much battery left. "
To end current conversation:
let the current phone be a random telephone which can be touched by the player;
silently try hanging up the current phone.
After deciding the scope of the player while the player reaches someone:
place the phonelist of the player in scope, but not its contents.
Before calling something on something when the player reaches someone:
say “(first ending your conversation with [the phonelist of the player])[command clarification break]”;
end current conversation.
To decide whether acting through the line:
if the noun is something and the location of the noun is not the location of the player:
yes;
if the second noun is something and the location of the second noun is not the location of the player:
yes;
no.
Section : talking on phone
Understand “talk to [someone]” as talking to. Understand “talk to [something]” as talking to. Talking to is an action applying to one visible thing.
Section : Misdialing and scope
Understand “call [text]” as misdialling. Misdialling is an action applying to one topic. Carry out misdialling: say “The phone rings and rings but no one answers.”
Understand “call police” or “call ambulance” or “call fire department” as a mistake ("The guy in your class who did that was sent to prison, so perhaps not ").
Before misdialling when the player reaches someone:
say “(first ending your conversation with [the phonelist of the player])[command clarification break]”;
end current conversation.
Visibility rule when acting through the line:
there is insufficient light.
Rule for printing a refusal to act in the dark when acting through the line:
say “You’re not on a video phone, so you can only hear.” instead.
Section : peeople on phone list
Annabeyond is a room. Anna is a known woman in Annabeyond.
A telephone called the Annaphone phone is in Annabeyond.
Peterbeyond is a room. Peter is a known man in Peterbeyond.
A telephone called the Peterphone is in Peterbeyond.
Rubybeyond is a room. Ruby is a known woman in Rubybeyond.
A telephone called the Rubyphone phone is in Rubybeyond.
Mumbeyond is a room. Mum is a known woman in Mumbeyond.
A telephone called the Mumphone phone is in Mumbeyond.
Svenbeyond is a room. Sven is a known man in Svenbeyond.
A telephone called the Svenphone is in Svenbeyond.
Abbybeyond is a room. Abby is a known woman in Abbybeyond.
A telephone called the Abbyphone is in Abbybeyond.
Kevinbeyond is a room. Kevin is a known man in Kevinbeyond.
A telephone called the Kevinphone is in Kevinbeyond.
Stefbeyond is a room. Stef is a known man in Stefbeyond.
A telephone called the Stefphone is in Stefbeyond.
Instead of listening to a telephone when the player reaches someone:
say “You can hear [the phonelist of the player] breathing.”
Section : Peter
After calling the Peterphone on something for the first time:
say “Peter here.”
After calling Peterphone on something for more than the first time:
say " Peter still here, what do you want?"
Instead of talking to Peter :
say "Yaba dabba doo, Its me " instead.
Rule for printing a parser error when the player’s command includes “Peter”:
say “You haven’t called him” instead.
Section : Ruby
After calling the Rubyphone on something for the first time:
say “Rubys phone.”
After calling the Rubyphone on something for more than one time:
say “[one of]Still no answer[or]Her phone must be off[or]No point trying any more[stopping].”
Instead of talking to Ruby:
say “She doesn’t answer”.
Rule for printing a parser error when the player’s command includes “Ruby”:
say “She doesnt answer even when she is on the line!” instead.
Section : Mum
After calling the mumphone on something for the second time:
say " Yes what it is now?"
Instead of talking to Mum:
say “She doesn’t answer”.
Rule for printing a parser error when the player’s command includes “mum”:
say “You haven’t called her” instead.
Section : Abby
After calling the Abbyphone on something for the first time:
say “Abby here.”
After calling Abbyphone on something for more than the first time:
say " Abby still here, what do you want?"
Instead of talking to Abby :
say "Hi " instead.
Rule for printing a parser error when the player’s command includes “Abby”:
say “You haven’t called her” instead.
Section : Stef
After calling the Stefphone on something for the first time:
say “Stef here.”
After calling Stefphone on something for more than the first time:
say " Stef still here, what do you want?"
Instead of talking to Stef :
say "Yaba dabba doo, Its me " instead.
Rule for printing a parser error when the player’s command includes “Stef”:
say “You haven’t called him” instead.
Section : Kevin
After calling the Kevinphone on something for the first time:
say “Kevin here.”
After calling Kevinphone on something for more than the first time:
say " Kevin still here, what do you want?"
Instead of talking to Kevin :
say "Yaba dabba doo, Its me " instead.
Rule for printing a parser error when the player’s command includes “Kevin”:
say “You haven’t called him” instead.