/*===================================* * Room definitions *===================================*/ CustomRooms(connectionList) { /** Starting location for the game */ firstRoom = "Front porch"; /** List of connections */ connections = connectionList; connections.add(Connection( "Front porch", EXIT_SOUTH, "Walkway", EXIT_NORTH)); connections.add(Connection( "Front porch", EXIT_NORTH, "Foyer", EXIT_SOUTH, Door(true,false,"Foyer","houseKey"))); connections.add(Connection( "Walkway", EXIT_SOUTH, "Front yard", EXIT_NORTH)); connections.add(Connection( "Walkway", EXIT_WEST, "Front yard", EXIT_EAST)); connections.add(Connection( "Walkway", EXIT_SOUTHEAST, "Driveway", EXIT_NORTHWEST)); connections.add(Connection( "Foyer", EXIT_WEST, "Master bedroom", EXIT_EAST)); connections.add(Connection( "Foyer", EXIT_NORTH, "Family room", EXIT_SOUTH)); connections.add(Connection( "Foyer", EXIT_EAST, "Study nook", EXIT_WEST)); connections.add(Connection( "Master bedroom", EXIT_SOUTH, "Master bathroom", EXIT_NORTH)); connections.add(Connection( "Master bedroom", EXIT_SOUTHWEST, "Master closet", EXIT_NORTHEAST)); connections.add(Connection( "Family room", EXIT_EAST, "Dining room", EXIT_WEST)); connections.add(Connection( "Dining room", EXIT_EAST, "Hallway", EXIT_WEST)); connections.add(Connection( "Study nook", EXIT_EAST, "Kitchen", EXIT_WEST)); connections.add(Connection( "Study nook", EXIT_NORTHEAST, "Dining room", EXIT_SOUTHWEST)); connections.add(Connection( "Kitchen", EXIT_NORTH, "Dining room", EXIT_SOUTH)); connections.add(Connection( "Kitchen", EXIT_SOUTH, "Utility room", EXIT_NORTH)); connections.add(Connection( "Utility room", EXIT_SOUTH, "Garage", EXIT_NORTH)); connections.add(Connection( "Garage", EXIT_SOUTH, "Driveway", EXIT_NORTH)); connections.add(Connection( "MaxRoom", EXIT_SOUTH, "Hallway", EXIT_NORTH)); connections.add(Connection( "Office", EXIT_NORTH, "Hallway", EXIT_SOUTH)); connections.add(Connection( "Guest bathroom", EXIT_WEST, "Hallway", EXIT_EAST)); /* Room definitions */ FrontWalk() { /* Required Properties */ roomTitle="Walkway"; roomDescription="The walkway leading to the house is your basic concrete walkway, curving from the north to the southeast to join the front porch to the driveway. To the east of the walk is a landscaped area with wild jasmine growing on a trellis against the garage wall."; return this; } FrontPorch() { /* Required Properties */ roomTitle="Front porch"; roomDescription=""; // going to set this dynamically to reflect the status of the front door. roomId="Front porch"; contents = "knocker,door,ball"; getDescription() { for (an_exit : connections) { if (an_exit.pointA.equals(roomTitle)) { if (an_exit.pointADir == EXIT_NORTH ) { frontDoorExit = an_exit; break; } } else if (an_exit.pointB.equals(roomTitle)) { if (an_exit.pointBDir == EXIT_NORTH ) { frontDoorExit = an_exit; break; } } } d="You're standing on a small porch. The "; if (frontDoorExit.door.isClosed) { d+="closed"; } else { d+="open"; } d += " front door is to the north. There is a knocker is on the door. To the south is a walkway through the front yard grass. A ball is sitting on the porch."; return d; } getTitle() { return roomTitle; } /* Event handlers */ onEntrance() { } onExit() { return true; } return this; } Foyer() { roomTitle="Foyer"; unvisitedTitle="Front door"; roomDescription="Not really a foyer in the traditional sense, more like an area of the open floorplan to act as an entryway. The floor of the large room is tiled and the walls are painted in a nice buttery-vanilla color, with the wall to the west done in a sage green. A very nice effect.\n\nTo the north is the family room, while to the west is a doorway. There is another area of the room to the east."; contents="door"; return this; } MasterBedroom() { roomTitle="Master bedroom"; unvisitedTitle="Closed door"; roomDescription="The most striking feature of this room are the deep eggplant purple walls. A picture rail cicumnavigates the room about 2/3rds of the way up the wall, with the top portion painted a complementary shade of pink, with purple sponging, highlighting the expansive vaulted ceiling.\nTo the south is an open doorway and in the southwest corner of the room is a closet."; return this; } MasterBath() { roomTitle="Master bathroom"; roomDescription="A sink and counter along with a toilet are against the eastern wall. Across from these are the jacuzzi tub and shower. Photographs depicting scenes from Greece are scattered throughout the room. A pile of clothes and towels lie in the center of the room."; return this; } MasterCloset() { roomTitle="Walk-in closet"; roomDescription="You step into a good sized closet. Apparently a man and woman share the closet, from the look of the clothes hanging on the racks."; return this; } FamilyRoom() { roomTitle="Family room"; roomDescription="A fireplace is set in the northwest corner of the room. An large wooden armoir along with a cabinet with stereo are against the eastern wall. Directly across from this is the sofa with a coffee table in front of it. The coffee table has three wicker baskets underneath. To the side of the sofa is a comfortable-looking glider rocker with matching ottoman.\nAround the sofa to the east is the dining room. To the south is the foyer and front door."; return this; } Study() { roomTitle="Study nook"; roomDescription="There is a desk against the eastern wall. Sitting on the desk is an open laptop. The sun streams in through wooden blinds set in the window to the south.\n\nWest is the foyer, while east lies the kitchen. To the northeast is a walkway to the dining room"; return this; } DiningRoom() { roomTitle="Dining room"; roomDescription="A large china cabinet takes up most of the eastern wall. Closer examination reveals not only china inside, but also an extensive collection of Pocket Dragons. Half of room is taken over by children's toys. There is a window in the norther wall that appears to overlook the back porch.\n\nEast is a hallway while south is the kitchen. There is a walkway to the southwest leading to the study and to the west around the sofa is the family room."; return this; } Kitchen() { roomTitle="Kitchen"; roomDescription="It's a kitchen"; return this; } UtilityRoom() { roomTitle="Utility room"; roomDescription="Small room with a washer on one side and a dryer on the other and a door to the garage"; return this; } Garage() { roomTitle="Garage"; unvisitedTitle="Closed door"; roomDescription="Scary!"; return this; } Driveway() { roomTitle="Driveway"; roomDescription = "Two parked cars and a basketball hoop alongside"; return this; } FrontYard() { roomTitle="Front yard"; roomDescription="Front yard, with magnolia tree"; return this; } SideYard() { roomTitle="Front yard"; roomDescription="Very large sycamore tree here with a toddler swing hanging from the branches."; roomId="sideYard"; // This is used if the room title would clash with an existing one. This will be used to // index the rooms before the title. Use for defining exits. return this; } Hallway() { roomTitle="Hallway"; roomDescription="Door to the north and a small coat closet in the east wall. Also to the east is the door to the bathroom. The hall continues to the south and ends with another doorway."; contents = "nameplate,door"; return this; } MaxRoom() { roomTitle="Max's Room"; unvisitedTitle="Closed door"; roomId = "MaxRoom"; roomDescription="There is a nameplate on the door. Filled with toys and stuffed animals"; contents="nameplate,door"; boolean nameplateExamined = false; boolean visited = false; onEntrance() { if (!visited && !nameplateExamined) { global.game.output.insertLineBreak(); global.game.output.insertStyledString("Glancing at the nameplate on your way in, you notice that it reads 'Max's Room'.", STYLE_ITALIC); global.game.output.insertLineBreak(); nameplateExamined = true; visited = true; } } getTitle() { if(nameplateExamined) { return "Max's room"; } else { return "Closed door"; } } getDescription() { d=""; if (nameplateExamined) { d="The nameplate on the door says 'Max's Room'. "; }else { d="There is a nameplate on the door. "; } return d + "Filled with toys and stuffed animals, it's obvious that a young child resides here."; } return this; } GuestBath() { roomTitle = "Guest bathroom"; roomDescription="Sink, toilet, combo shower-bathtub"; return this; } Office() { roomTitle = "Office"; roomDescription = "Do you really want to know?"; return this; } return this; }