Constant Story "This is the game that I wrote"; Constant Headline "^By David Welbourn for SpeedIF Gruff^"; Release 1; Constant MAX_SCORE = 0; Constant DIALECT_US = 1; Constant DEATH_MENTION_UNDO; Include "Parser"; Object LibraryMessages ! see section 21 of the manual with before ! and english.h [; Miscellany: if (lm_n == 19) { print "You are the guy who happens to be^The player character (or P.C.) ^Who is in the game that I wrote.^"; rtrue; } Quit: if (lm_n == 2) { print "Are you sure you want to leave the game that I wrote? "; rtrue; } ]; Include "VerbLib"; !------------------CLASSES---------------------- ! Use classes to reduce duplicate code and make a cleaner design. Class Room with cant_go "Alas, I fear I have to say,^You simply cannot go that way,^'Cause this is the game that I wrote.", has light; [ emph str; style underline; print (string) str; style roman; ]; !-------------ROOMS AND OBJECTS---------------- Room West_of_House "West of House" with description "You are west of a white house.", e_to frontdoor; Object house "house" West_of_House with name 'white' 'house', description "This is the house you've seen before,^Which is in the game that I wrote.^^It has a door.", has scenery; Object frontdoor "door" West_of_House with name 'door', door_dir e_to, door_to Inside_House, with_key frontkey, description [; print "This "; if (self has open) print "open"; else print "closed"; " thing is called a door,^That guards the house you've seen before,^Which is in the game that I wrote."; ], before [; Open: if (self hasnt general) { move matt to West_of_House; give self general; "It seems to be locked.^^Oh, look. Here comes Matt."; } ], has scenery door openable lockable locked; Object Matt "Matt" with name 'matt', looked_under 0, description [; "This is Matt, in front of the door,^That guards the house you've seen before,^Which is in the game that I wrote."; ], life [; Attack: "Matt's not that dirty."; default: "Matt says, ~Welcome.~"; ], initial "Matt lies in front of the door,^That guards the house you've seen before,^Which is in the game that I wrote.", before [; Search, LookUnder: if (self.looked_under) { "Matt has nothing more to hide;^I think it's time you went inside.^ So use the key with the jagged edge,^To open that thing that's called a door,^ That guards the house you've seen before,^Which is in the game that I wrote."; } else { move frontkey to player; self.looked_under = 1; "You find the key with the jagged edge,^Under Matt who's in front of the door,^ That guards the house you've seen before,^Which is in the game that I wrote."; } ], has animate male proper; Object frontkey "key" with name 'key', description "This is the key you found under Matt,^Which need I say unlocks the door,^ That guards the house you've seen before,^Which is in the game that I wrote.", ; Room Inside_House "Inside House" with description "You are inside the house.", w_to West_of_House; Object Belle "Belle" Inside_House with name 'belle' 'nose' 'button', description "Belle, she has a button nose,^And yes, you could even say it glows.^ She sits forlorn apon the floor,^Inside the house you've seen before,^ Which is in the game that I wrote.", initial "Belle sits forlorn apon the floor,^Inside the house you've seen before,^ Which is in the game that I wrote.", life [; Attack: "No. You like her."; default: "Belle seems to be mute."; ], was_pushed 0, before [; Push: if (self.was_pushed) { print "You already pushed Belle and made her ring,^ Yes, that's ", (emph) "her", " ring and that's the thing.^ To do with Belle and her button nose,^ And yes, you could even say it glows.^"; "She sits forlorn apon the floor,^Inside the house you've seen before,^ Which is in the game that I wrote."; } else { self.was_pushed = 1; move ring to Inside_House; give ring ~moved; "You push cute Belle's li'l button nose.^She says ~RING!~ and there it goes!^ A ring now rolls along the floor,^Inside the house you've seen before,^ Which is in the game that I wrote."; } Ring: if (ring notin player) { "You have no ring to give to Belle,^ Who sits forlorn apon the floor,^Inside the house you've seen before,^ Which is in the game that I wrote."; } else { deadflag = 2; print "You get down on your knees, and you propose,^ To Belle and her cute li'l button nose.^ You made her ring, and you ring your Belle,^ And everything will now be well.^"; print "The diamond ring, all shiny and bright,^ Will comfort you on your wedding night.^^ No more forlorn apon the floor.^No longer blocked by some fool door.^ You two will wed - imagine that!^Your witness shall be the welcome Matt.^^"; "Well, that's the story; there is no more,^Inside the house you've seen before,^ Which is in the game that I wrote."; } ], has animate female proper; Object ring "ring" with name 'wedding' 'diamond' 'ring', description "This diamond ring is shiny and bright.^'Tis made for someone's wedding night.", before [; Wear: "Your finger is not where this ring goes,^That was made by Belle with the button nose.^ She sits forlorn apon the floor,^Inside the house you've seen before,^ Which is in the game that I wrote."; Give: "[Hm. Can you rephrase that?]"; ] ; !-------------INITIALIZE AND VERBS---------------- [ Initialise; location = West_of_House; lookmode = 2; ! verbose mode score = 0; ]; [ RingSub; "That is not something you can ring,^At least not in the game that I wrote."; ]; Include "Grammar"; Verb 'ring' * noun -> Ring;