!============================================================================= ! A conversion from the original MiniAdventure source. Constant Story "Quest for the Holy Grail by Jon Ripley (C) 1995"; Constant Headline "^^Prepare for your final judgement...You must find the cup of Christ, for it is the key...^^A conversion from the original MiniAdventure source.^^"; Serial "050130"; Release 1; ! Constant NO_HEALTH; Constant MAX_SCORE = 100; Include "Parser"; Include "VerbLib"; Global Strength = 17; !============================================================================= ! Object classes Class Room has light; Class Connector with before [; Examine: print "The door is currently "; if (self has open) print "open"; else print "closed"; if (self has locked) print " and locked"; "."; ], has lockable locked openable door static scenery; Class Treasure with treasurepoints 0, after [; Take: score=score+self.treasurepoints; Drop: score=score-self.treasurepoints; ]; Class Hazard with hazardpoints 10, before [; Take,Pull,Push,PushDir: Strength=Strength-self.hazardpoints; print "Ouch! That hurt.^"; #Ifndef NO_HEALTH; if ( Strength <= 0) GameOver(3); #Endif; ! NO_HEALTH rtrue; default: "Careful - ", (the) self, " looks dangerous."; ], has static; Class Prop with before [; Take,Pull,Push,PushDir: print_ret (The) self, " is fixed in place."; default: "You don't need to worry about ", (the) self, "."; ], has static; !============================================================================= ! Game locations Room sandstone_chamber "Sandstone Chamber" with description "You are in a huge sandstone chamber, before you on a huge platform are some beautiful jewelled chalices, one fo which is fabled to be the cup of Christ, the Holy Grail. An exit leads north (through a door).", n_to door_1; Hazard -> coffee_mug "coffee mug" with description "coffee mug", name 'coffee' 'mug', hazardpoints 10; Hazard -> jewelled_chalice "jewelled chalice" with description "jewelled chalice", name 'jewelled' 'chalice', hazardpoints 10; Hazard -> gold_goblet "gold goblet" with description "gold goblet", name 'gold' 'goblet', hazardpoints 10; Hazard -> wine_glass "wine glass" with description "wine glass", name 'wine' 'glass', hazardpoints 10; Treasure -> wooden_cup "wooden cup" with description "wooden cup", name 'wooden' 'cup', treasurepoints 100; Hazard -> tea_cup "tea cup" with description "tea cup", name 'tea' 'cup', hazardpoints 10; Hazard -> silver_cup "silver cup" with description "silver cup", name 'silver' 'cup', hazardpoints 10; Prop -> platform "platform" with description "platform", name 'platform', has static; Connector door_1 "door" with name 'door', door_to [; if (location == sandstone_chamber) return test_of_faith; return sandstone_chamber;], door_dir [; if (location == test_of_faith) return s_to; return n_to;], found_in sandstone_chamber test_of_faith, with_key wooden_cup; !============================================================================= Room test_of_faith "Test Of Faith" with description "You are before the face of God. You have found the cup of Christ and your eternal reward waits for you... Exits lead north and south (through a door).", n_to paradise, s_to door_1; !============================================================================= Room paradise "Paradise" with description "You are in heaven. There are no obvious exits.", ; !============================================================================= ! Setup Daemons Object strength_drain with daemon [; Strength=Strength-1; if (Strength > 0 ) return; StopDaemon(self); GameOver(4); ]; Object endgame_test with daemon [; if (score < MAX_SCORE) return; if (real_location ~= paradise) return; StopDaemon(self); GameOver(2); ]; !============================================================================= ! Display end-game messages [ DeathMessage; switch(deadflag) { 3: print "You killed yourself"; 4: print "You ran out of time"; } ]; [ GameOver x; deadflag=x; switch(deadflag) { 2 : print "^You have reached your final resting place."; 3,4: print "^Oh Hell!"; } ]; !============================================================================= ! Initialisation routine [ Initialise; location=sandstone_chamber; lookmode=2; #Ifndef NO_HEALTH; StartDaemon(strength_drain); #Endif; ! NO_HEALTH StartDaemon(endgame_test); ]; !============================================================================= ! Include grammar here Include "Grammar"; !============================================================================= ! Custom Verbs [ HealthSub; #Ifdef NO_HEALTH; if (deadflag == 0) "As strong and healthy as usual."; #Ifnot; "You have ",Strength," health points remaining."; #Endif; ! NO_HEALTH ]; Verb meta 'health' 'strength' * -> Health; !=============================================================================