|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.starhope.appius.user.GeneralUser
org.starhope.appius.user.AbstractNonPlayerCharacter
com.tootsville.npc.ShortOrderCook
public class ShortOrderCook
Short-order cook for TootsBurger as a cheap Diner Dash clone.
The player triggers this game by putting on their apron.
The way this game works, is that the player walks up to a
ChatterBot, who will find their way to a seat (cleverly
tagged, one hopes, by a “$seat” space in the room) and demand
attention. The player will (one hopes) heed their calls and walk
over. When they approach one of the impatient pachyderms, they'll get
a demand for some food item or other. The helpful player will then
walk over to the ShortOrderCook and repeat the order. If,
instead, they walk over to the DinerDishWasher, he will
helpfully fill them in on the rules (at a whisper, no less!).
Once the intrepid server has repeated the order, s/he can idle for a bit while the cook prepares the food. After a moment, the cook will call back the order, and the player has a window of opportunity to pick up the food from the cook.
Picking up the food on time costs the player a few peanuts (depending on the order). The cook will inform them of that cost, but gives them the food. They now have a limited time to run the food out to the patient patrons, who will cheerfully announce their pleasure and promptly pay their food, with a gratuity based upon the speed of delivery. Note that patrons count time from the time that they ordered, not when the food was ready, so a 15%-35% tip can result depending on the player's alacrity.
Failure to pick up the order in time will cost the player — they'll raise the ire of the cook, who will charge them for the spoiled food, as well as the customers, who will ask for a different server, or leave the diner altogether.
“Hi, there, (PLAYER). I'm (COOK). I'm the cook here at TootsBurger. Would you like to help us out by waiting tables? If you have a TootsBurger apron, you can help me out. Just find out what customers want, and tell me. I'll cook the order, and you pay me for it. When it's ready, you can bring it to your customers, and they'll pay you, and give you a tip. You can earn money by bringing me their orders and bringing them their food as fast as possible.”
“Would you like to wait tables? Just say ‘Apron’ and I'll sell you one.”
“Here's your apron. You can get started right away! Good luck!”
ChatterBot places an order, the ShortOrderCook
“knows” it. The player comes up and is supposed to repeat (at least
the significant keyword(s) of) the order.
| Field Summary | |
|---|---|
private int |
apronItem
The apron which has to be worn to be an employee. |
private static String[] |
cooks
The names of some of my (BRP) personal favourite short-order diner cooks. |
String[] |
foods
List of foods. |
private static AtomicInteger |
nextID
Provide an unique ID counter for multiple instances of the same cook character in different Zones at the same time. |
private static long |
serialVersionUID
WRITEME: Document this brpocock@star-hope.org |
| Fields inherited from class org.starhope.appius.user.AbstractNonPlayerCharacter |
|---|
buddyList, casualSpeechQueue, casualSpeechRate, instanceID, kalendor, lastActive, lastSpoken |
| Fields inherited from class org.starhope.appius.user.GeneralUser |
|---|
baseStats, collisionBounds, currentRoom, facing, lastUserMovement, pathFinder, userRecord |
| Constructor Summary | |
|---|---|
ShortOrderCook(Room diner)
Create a short-order cook. |
|
| Method Summary | |
|---|---|
void |
acceptObjectJoinRoom(Room room,
RoomListener object)
Notification that someone has entered the room. |
void |
acceptObjectPartRoom(Room room,
RoomListener thing)
Notification that someone has left a room |
void |
acceptOutOfBandMessage(AbstractUser sender,
Room room,
org.json.JSONObject body)
Accept an out-of-band communications packet that was broadcast to a room in which this Listener is listening. |
void |
acceptPublicMessage(AbstractUser sender,
Room room,
String message)
Accept a public chat message or /emote. |
void |
acceptPublicMessage(AbstractUser from,
String message)
Accept a public chat message. |
void |
acceptUserVariableUpdate(AbstractUser user,
String varName,
String varValue)
Receive notification of the change of an user variable |
void |
ban(AbstractUser u,
String banReason)
|
protected int |
getInstanceID()
|
private Set<AbstractUser> |
getWaiters()
|
void |
sendEarnings(Room room,
String string)
|
void |
sendMigrate(AbstractZone refugeeZone)
WRITEME: document this method (brpocock@star-hope.org, Jan 11, 2010) |
void |
sendWardrobe()
WRITEME |
void |
tick(long currentTime,
long deltaTime)
This method is called periodically from the metronome thread. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final long serialVersionUID
public final String[] foods
private final int apronItem
private static AtomicInteger nextID
Provide an unique ID counter for multiple instances of the same cook character in different Zones at the same time.
private static String[] cooks
The names of some of my (BRP) personal favourite short-order diner cooks.
| Constructor Detail |
|---|
public ShortOrderCook(Room diner)
throws NotFoundException,
GameLogicException
Create a short-order cook. The cook's name is pseudo-randomly taken from a pool of available names, on the principle that there should definitely be more than one chef at a fine 24-hour diner like TootsBurger. The names of the characters are homages to some of my personal favourite 24-hour diner short-order cooks. (BRP)
diner - the TootsBurger room
NotFoundException - WRITEME
GameLogicException - WRITEME| Method Detail |
|---|
public void acceptObjectJoinRoom(Room room,
RoomListener object)
RoomListener
acceptObjectJoinRoom in interface RoomListeneracceptObjectJoinRoom in class GeneralUserroom - The roomobject - The thing (probably user) enteringRoomListener.acceptObjectJoinRoom(org.starhope.appius.game.Room,
org.starhope.appius.game.RoomListener)
public void acceptObjectPartRoom(Room room,
RoomListener thing)
RoomListener
acceptObjectPartRoom in interface RoomListeneracceptObjectPartRoom in class GeneralUserroom - The roomthing - The thing (probably user) departingRoomListener.acceptObjectPartRoom(org.starhope.appius.game.Room,
org.starhope.appius.game.RoomListener)
public void acceptOutOfBandMessage(AbstractUser sender,
Room room,
org.json.JSONObject body)
RoomListener
acceptOutOfBandMessage in interface RoomListeneracceptOutOfBandMessage in class GeneralUsersender - The sender of the OOB messageroom - The room in which the OOB message is being broadcastbody - A JSON object containing the OOB message. The
contents of this message are not constrained.RoomListener.acceptOutOfBandMessage(org.starhope.appius.user.AbstractUser,
org.starhope.appius.game.Room, org.json.JSONObject)
public void acceptPublicMessage(AbstractUser sender,
Room room,
String message)
RoomListener
acceptPublicMessage in interface RoomListeneracceptPublicMessage in class AbstractNonPlayerCharactersender - The speakerroom - The room in which the words were spokenmessage - The spoken text or /emoteRoomListener.acceptPublicMessage(org.starhope.appius.user.AbstractUser,
org.starhope.appius.game.Room, java.lang.String)
public void acceptPublicMessage(AbstractUser from,
String message)
RoomListener
acceptPublicMessage in interface RoomListeneracceptPublicMessage in class AbstractNonPlayerCharacterfrom - The speakermessage - The spoken text or /emoteRoomListener.acceptPublicMessage(org.starhope.appius.user.AbstractUser,
java.lang.String)
public void acceptUserVariableUpdate(AbstractUser user,
String varName,
String varValue)
RoomListener
acceptUserVariableUpdate in interface RoomListeneracceptUserVariableUpdate in class GeneralUseruser - The user updating their variablevarName - The name of the variable (key)varValue - The new value (null if unset)RoomListener.acceptUserVariableUpdate(org.starhope.appius.user.AbstractUser,
java.lang.String, java.lang.String)
public void ban(AbstractUser u,
String banReason)
throws PrivilegeRequiredException
u - WRITEMEbanReason - WRITEME
PrivilegeRequiredException - WRITEMEAbstractUser.ban(org.starhope.appius.user.AbstractUser,
java.lang.String)protected int getInstanceID()
getInstanceID in class AbstractNonPlayerCharacterAbstractNonPlayerCharacter.getInstanceID()private Set<AbstractUser> getWaiters()
public void sendEarnings(Room room,
String string)
sendEarnings in interface AbstractUsersendEarnings in class GeneralUserroom - WRITEMEstring - WRITEMEAbstractUser.sendEarnings(org.starhope.appius.game.Room,
java.lang.String)
public void sendMigrate(AbstractZone refugeeZone)
throws UserDeadException
AbstractUser
sendMigrate in interface AbstractUsersendMigrate in class AbstractNonPlayerCharacterrefugeeZone - WRITEME
UserDeadException - WRITEMEAbstractUser.sendMigrate(org.starhope.appius.types.AbstractZone)public void sendWardrobe()
AbstractUser
sendWardrobe in interface AbstractUsersendWardrobe in class GeneralUserAbstractUser.sendWardrobe()
public void tick(long currentTime,
long deltaTime)
throws UserDeadException
AcceptsMetronomeTicks
tick in interface AcceptsMetronomeTickstick in class AbstractNonPlayerCharactercurrentTime - Time since epoch at the start of the global
metronome propagation, as per
System.currentTimeMillis()deltaTime - Delta-time in milliseconds since the prior
global metronome tick
UserDeadException - if a user has died during this tickAcceptsMetronomeTicks.tick(long,
long)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||