;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Places ;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; Use a "loc:" prefix for all symbols so they are easily identified. (define loc:stairsb (make :nick '(stairs) :name "Stairs" :description "The stairwell smells like old shoes and asbestos.")) (define loc:vending (make :nick '(vending) :name "Basement Vending Machines" :description (echos "Posters line the walls, creating a tapestry of" "info-sessions, summer sublet offers, outdated SA flyers," "and nonsense. Vending machines glow and hum, offering" "tasty and nutritious snacks to help you pass the time." "mmm....food....."))) (define loc:upsonb17 (make :nick '(lecture) :name "Unfinished Lecture Hall" :description (echos "As you go under the duct tape, you notice that the room" "seems unfinished. Tools are lying everywhere, exposed" "wiring is running out of the seats, and you smell sawdust" "in the air. You see a few metal pipes on the ground."))) (define loc:upsonlab (make :nick '(lab) :name "Upson Lab" :description (echos "It's another computer lab, although this one does not seem" "to be well-maintained. Several moniters seem to be blinking" "on and off, and a quick look at the computers reveals that" "they are running Windows 98. As you refrain from vomiting," "you notice that a few of the cabinets are ajar."))) (define loc:elevator (make :nick '(elevator) :name "Elevator" :description (echos "You glance around inside the elevator, and are inexplicably" "overcome with a sense of depression. Grey carpeting pads" "the grey metal floor, which meets grey metal walls. Someone" "has etched the binary representation of each floor number" "above the corresponding light. You chuckle to yourself," "overcome with pity at this poor attempt at cleverness."))) (define loc:stairs1 (make :nick '(stairs) :name "Stairs" :description "The stairwell smells like old shoes and asbestos.")) (define loc:lobby (make :nick '(lobby) :name "First Floor Lobby" :description (echos "Wandering into the lobby, looking outside yields you a view" "of the typical Cornell weather: windy and snowing. The" "doors are half-buried in snow which prevents them from" "being opened. On the bulletin boards are various posters" "promoting events and selling items from the past week."))) (define loc:lounge (make :nick '(lounge) :name "First Floor Lounge" :description (echos "Entering the lounge, you can still smell the pizza from" "last night's infosession. Strangely enough, several pizza" "boxes are still in the room sitting on a table, along with" "several other items."))) (define loc:stairs2 (make :nick '(stairs) :name "Stairs" :description "The stairwell smells like old shoes and asbestos.")) (define loc:stairs3 (make :nick '(stairs) :name "Stairs" :description "The stairwell smells like old shoes and asbestos.")) (define loc:hallway3 (make :nick '(hallway) :name "The Third Floor Hallway" :description (echos "The hallway is well-lit, with hundreds of posters lining" "the walls. The sound of students working on their projects" "is everywhere (cursing, maniacal laughter, etc)."))) (define loc:upson320 (make :nick '(office) :name "Consulting Office" :description (echos "As you step inside, you notice that the lighting in here is" "provided by candles and is much dimmer. After taking" "another step, the door suddenly swings shut behind you," "locking itself in the process. As your eyes slowly adjust" "to the candlelight, you notice that the windows are made out" "of stained glass. Gargoyle busts adorn the walls with" "weapons of various sizes hanging from the ceiling. There" "are two computers in the room, one PC and one old Mac."))) (define loc:csuglab (make :nick '(csug) :name "CS Undergraduate Lab" :description (echos "Walking in the door, you smell the mix of coffee, Mountain" "Dew and alcohol that signifies that this lab is the home of" "many a CS major. Banks of computers line each row, with a" "closed cabinet to your right and a table with various" "bottles on it further down. As the lights turn on, you" "notice people slumped over some of the keyboards."))) (define loc:extensions (make :nick '(extlab) :name "Extension Lab-Upson 328" :description (echos "You see several rows of computers over by the windows." "A blonde-haired student is huddled under a trenchcoat," "trying to some sleep in a dark corner. The flaws are" "covered with chalkdust, and the trashcans are overflowing" "with empty bags of Tostitos and soda bottles."))) (define loc:syslab (make :nick '(syslab) :name "Systems Lab" :description (echos "The first thought that runs through your mind is how much" "better this lab is than CSUG. All around you are SPARC" "workstations, along with a large refrigerator and a large" "lounge. In the lounge are many lounge chairs, along with" "the biggest white board you've ever seen."))) (define loc:stairs4 (make :nick '(stairs) :name "Stairs" :description "The stairwell smells like old shoes and asbestos.")) (define loc:atrium (make :nick '(atrium) :name "4th Floor Atrium" :description (echos "The windows in front of you afford and excellent view" "of the Theory Center. A watercooler bubbles quietly" "in the corner. You feel at peace."))) (define loc:eli (make :nick '(office) :name "Eli's office" :description (echos "It's as if you've walked into Heaven itself. Walking in" "here has lifted your spirits to new highs, and faint" "angelic chourses can be heard in the background. Looking" "around, you see a simple computer, but just looking at it" "makes you feel as if you are looking at the right hand of" "God himself."))) (define loc:hallway5 (make :nick '(hallway) :name "The Fifth Floor Hallway" :description (echos "This hallway is very quiet. Most students aren't allowed" "up here, and this floor is filled with the offices of" "mean professors and graduate students who don't like" "children. Looking around sends a chill through your" "very soul."))) (define loc:dexter (make :nick '(office) :name "Professor Kozen's Office" :description (echos "The disorienting glow of a lava-lamp is cast over" "the walls, illuminating a truly impressive quanitity" "of cheap liquor and cigars. A disco balls twirls overhead," "sending a shower of light over various pictures of" "nude models, posters of John Travolta, and a copy of" "David Graff's 'The Rules for Getting Laid'."))) (define loc:graduate (make :nick '(lounge) :name "Graduate Lounge" :description (echos "Clouds of funny-smelling smoke drift past you, and you" "feel strangely sheltered from the outside world. The urge" "to work, or to care about anything in particular fades from" "your body. You have obviously wandered into the Graduate" "Lounge."))) (define loc:eatory (make :nick '(eatory) :name "The Eatory" :description (echos "The smell of red wine and fondue drifts past you. You" "see graduate students and professors, sprawled on mats" "of silk and cotton. One professor is having grapes fed" "to him by a nubile young undergrad. Clearly, this is" "where the gods of academia meet to sup on sweet ambrosia." "You start to wonder if getting a Real Job after graduation" "is such a good idea after all...."))) (define loc:computer (make :nick '(ibm) :name "Supercomputer Room" :description (echos "Walking in, you can't but think that this looks like a NASA" "control room. Moniters and readouts line every wall, with" "a big IBM sticker the far wall. Cold air runs in from the" "ceiling vents, creating loud air-conditioning sound. At one" "of the terminals lies a large book, with three big flashing" "red switches next to it."))) (define loc:closet1 (make :nick '(closet) :name "Closet" :description (echos "You see a large metal closet painted in a high-tech slate" "black, matching the new high-tech look of the upper floors" "of Upson and Rhodes. You wonder what might be inside this" "dark container."))) (define loc:closet2 (make :nick '(closet) :name "Closet" :description (echos "The smell of leftover stale pizza from infosessions past" "flow forth from the closet. The paint is chipping off" "the sides and crumbling in the hallway. You wonder what" "might be inside here."))) (define loc:closet3 (make :nick '(closet) :name "Closet" :description (echos "The smell of paint and construction materials flow forth" "from the closet. There is much visible rust on the surface" "and it is encrusted with the grafitti and stickers of" "ages past. You wonder what might be inside this forsaken" "place."))) ;;; Now that we have our places, set this global (set! *initial-places* (list loc:lobby loc:vending)) ;;; Connect places (connect loc:stairsb loc:vending) (connect loc:vending loc:upsonb17) (connect loc:vending loc:upsonlab) (connect loc:stairs1 loc:lobby) (connect loc:lobby loc:lounge) (connect loc:stairs3 loc:hallway3) (connect loc:hallway3 loc:csuglab) (connect loc:hallway3 loc:upson320) (connect loc:hallway3 loc:syslab) (connect loc:hallway3 loc:extensions) (connect loc:atrium loc:eli) (connect loc:atrium loc:hallway5) (connect loc:hallway5 loc:dexter) (connect loc:hallway5 loc:graduate) (connect loc:hallway5 loc:eatory) (connect loc:eatory loc:computer) (connect loc:closet1 loc:hallway5) (connect loc:closet2 loc:hallway3) (connect loc:closet3 loc:vending) ;;; This is used by (define-murder) in the specializations (define *closet-doors* (list (get-exit loc:hallway5 loc:closet1) (get-exit loc:hallway3 loc:closet2) (get-exit loc:vending loc:closet3))) (directed-connect loc:stairsb loc:stairs1 '(up)) (directed-connect loc:stairs1 loc:stairsb '(down)) (directed-connect loc:stairs1 loc:stairs2 '(up)) (directed-connect loc:stairs2 loc:stairs1 '(down)) (directed-connect loc:stairs2 loc:stairs3 '(up)) (directed-connect loc:stairs3 loc:stairs2 '(down)) (directed-connect loc:stairs3 loc:stairs4 '(up)) (directed-connect loc:stairs4 loc:stairs3 '(down)) (directed-connect loc:atrium loc:stairs4 '(stairs)) (directed-connect loc:stairs4 (make :name "The fourth floor" :nick '(door) :description "Home to CS..." :destination loc:atrium :locks (list (lambda (anim) (or (not (player? anim)) (memq obj:keycard (contents anim))))) :reason "The door is locked. You need a keycard.") #f) ;;; Elevator only opens when on a certain floor... ;;; Player can choose the floor the elevator goes to (let* ((elevator-mutex (make-semaphore 1)) (loc:null-elevator (make )) (floors (list (cons 'b loc:vending) (cons 1 loc:lobby) (cons 2 #f) (cons 3 loc:hallway3) (cons 4 #f) (cons 5 #f))) (currfloor loc:lobby) (in-transit #f) (move-elevator (lambda (floor) (unless (eq? floor currfloor) ;; serialize the order of the floor calls (semaphore-wait elevator-mutex) ;; close door (set! in-transit #t) (place-message loc:elevator #f #f "The elevator begins to move.") ;; set the current floor so that it doesn't connect to the ;; elevator then set the destination floor, so it does ;; this is done to prevent the possibility of finding a path ;; between two places that goes through the elevator. (set! (destination (get-exit (destination (first (exits loc:elevator))) loc:elevator)) loc:null-elevator) (set! (destination (get-exit floor loc:null-elevator)) loc:elevator) ;; set the elevator destination (set! (destination (first (exits loc:elevator))) floor) (insert-event 6 (thunk (set! currfloor floor))) (insert-event 6.5 (thunk (place-message loc:elevator #f #f "The elevator has arrived.") (place-message currfloor #f #f "You hear a ping as the elevator arrives.") (set! in-transit #f))) (insert-event 10 (thunk (semaphore-post elevator-mutex)))))) (call-floor (make :specs (list :or (list 'call number?) (list 'call symbol?)) :desc "call Calls the floor" :namespace 'context :func (lambda (plyr inp) (let* ((selection (assq (second inp) floors)) (goto (and selection (tail selection)))) (cond (in-transit (echos "It's such a bad elevator, that" "it can only single-task.")) ((not selection) (echos "Your floor selection didn't make" "sense... try b,1,2,3,4,5...")) ((not goto) "That floor seems to be locked") ((eq? currfloor floor) "You're already at that floor") (else (tell plyr "You make the floor selection.") (move-elevator goto))))))) (connect-to-elevator (lambda (loc) (directed-connect loc (make :name "World's slowest elevator" :nick '(elevator) :description "Looks like an elevator." :destination loc:null-elevator :locks (list (lambda (plyr) (cond ((or in-transit (not (eq? currfloor loc))) (place-message (location plyr) plyr #f (echos (name plyr) "calls the elevator.")) (insert-immediate-event (thunk (move-elevator loc))) #f) (else #t)))) :reason "You press the elevator call button.") #f)))) (directed-connect loc:elevator (make :name "The elevator door" :nick '(door) :description "It's an elevator door." :destination loc:lobby :locks (list (lambda (anim) (not in-transit))) :reason "The elevator is in motion." :commands (list call-floor)) #f) (connect-to-elevator loc:vending) (connect-to-elevator loc:lobby) (connect-to-elevator loc:hallway3) (set! (destination (get-exit loc:lobby loc:null-elevator)) loc:elevator))