!============================================================================= ! A conversion from the original MiniAdventure source. Constant Story "Graveyard Escape by Jon Ripley (C) 1995"; Constant Headline "^^Evil forces have trapped you in a sinister graveyard, there are many traps you will need to overcome in order to escape. Good Luck!^^A conversion from the original MiniAdventure source.^^"; Serial "050130"; Release 1; ! Constant NO_HEALTH; Constant MAX_SCORE = 20; Include "Parser"; Include "VerbLib"; Global Strength = 100; !============================================================================= ! 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 bushes_01 "Bushes" with description "You are in the bushes. An exit leads south.", s_to dirt_path_01; !============================================================================= Room bushes_02 "Bushes" with description "You are in the bushes. An exit leads east.", e_to dirt_path_01; !============================================================================= Room dirt_path_01 "Dirt Path" with description "You are on a dirt path. There are exits north, south, east and west.", n_to bushes_01, s_to dirt_path_02, e_to bushes_03, w_to bushes_02; !============================================================================= Room bushes_03 "Bushes" with description "You are in the bushes. An exit leads west.", w_to dirt_path_01; !============================================================================= Room bushes_04 "Bushes" with description "You are in the bushes. An exit leads east.", e_to dirt_path_02; !============================================================================= Room dirt_path_02 "Dirt Path" with description "You are on a dirt path. There are exits north, south, east and west.", n_to dirt_path_01, s_to winding_path, e_to bushes_05, w_to bushes_04; !============================================================================= Room bushes_05 "Bushes" with description "You are in the bushes. An exit leads west.", w_to dirt_path_02; Treasure -> skeleton_key "skeleton key" with description "skeleton key", name 'skeleton' 'key', treasurepoints 10; !============================================================================= Room bushes_06 "Bushes" with description "You are in the bushes. An exit leads south.", s_to dirt_path_03; !============================================================================= Room bushes_07 "Bushes" with description "You are in the bushes. An exit leads east.", e_to winding_path; !============================================================================= Room winding_path "Winding Path" with description "You are on a winding path. There are exits north, south, east and west.", n_to dirt_path_02, s_to bushes_09, e_to dirt_path_03, w_to bushes_07; !============================================================================= Room dirt_path_03 "Dirt Path" with description "You are on a dirt path. There are exits north, south, east and west.", n_to bushes_06, s_to winding_track, e_to bushes_08, w_to winding_path; !============================================================================= Room bushes_08 "Bushes" with description "You are in the bushes. An exit leads west.", w_to dirt_path_03; !============================================================================= Room bushes_09 "Bushes" with description "You are in the bushes. An exit leads north.", n_to winding_path; !============================================================================= Room bushes_10 "Bushes" with description "You are in the bushes. An exit leads east.", e_to winding_track; !============================================================================= Room winding_track "Winding Track" with description "You are on a winding track. There are exits north, south, east and west.", n_to dirt_path_03, s_to graveyard, e_to bushes_11, w_to bushes_10; !============================================================================= Room bushes_11 "Bushes" with description "You are in the bushes. An exit leads west.", w_to winding_track; !============================================================================= Room graveyard "Graveyard" with description "You are in a graveyard. There are exits north, south, east, west and down.", n_to graveyard, s_to church, e_to graveyard, w_to graveyard, d_to open_grave; !============================================================================= Room church "Church" with description "You are inside a church. There are exits north, south, east and west.", n_to graveyard, s_to church_altar, e_to church, w_to church; Treasure -> candlabra "candlabra" with description "candlabra", name 'candlabra', treasurepoints 10; !============================================================================= Room open_grave "Open Grave" with description "You are in an open grave. Exits lead up and down (through a door).", u_to graveyard, d_to door_1; Prop -> coffin "coffin" with description "coffin", name 'coffin', has static; Connector door_1 "door" with name 'door', door_to [; if (location == open_grave) return coffin_loc; return open_grave;], door_dir [; if (location == coffin_loc) return u_to; return d_to;], found_in open_grave coffin_loc, with_key skeleton_key; !============================================================================= Room coffin_loc "Coffin" with description "You are inside a coffin, the lid has closed... An exit leads up (through a door).", u_to door_1; Hazard -> poison "poison" with description "poison", name 'poison', hazardpoints 200; !============================================================================= Room church_altar "Church Altar" with description "You are by a church altar. Exits lead north and down (through a door).", n_to church, d_to door_2; Prop -> altar "altar" with description "altar", name 'altar', has static; Connector door_2 "door" with name 'door', door_to [; if (location == church_altar) return secret_passage; return church_altar;], door_dir [; if (location == secret_passage) return u_to; return d_to;], found_in church_altar secret_passage, with_key candlabra; !============================================================================= Room secret_passage "Secret Passage" with description "You are walking down a secret passage. Exits lead up (through a door) and down.", u_to door_2, d_to catacombs_04; !============================================================================= Room catacombs_01 "Catacombs" with description "You are in a network of passages. Exits lead north and south.", n_to catacombs_03, s_to catacombs_04; !============================================================================= Room outside_church "Outside Church" with description "You are outside the churchyard. An exit leads south.", s_to catacombs_02; !============================================================================= Room catacombs_02 "Catacombs" with description "You are in a network of passages. There are exits north, south, east and west.", n_to outside_church, s_to catacombs_03, e_to catacombs_06, w_to catacombs_03; !============================================================================= Room catacombs_03 "Catacombs" with description "You are in a network of passages. There are exits north, south, east and west.", n_to catacombs_01, s_to catacombs_02, e_to catacombs_02, w_to catacombs_04; !============================================================================= Room catacombs_04 "Catacombs" with description "You are in a network of passages. There are exits north, south, east and west.", n_to catacombs_01, s_to catacombs_08, e_to catacombs_03, w_to catacombs_05; !============================================================================= Room catacombs_05 "Catacombs" with description "You are in a network of passages. There are exits north, south, east and west.", n_to catacombs_05, s_to catacombs_07, e_to catacombs_04, w_to catacombs_06; !============================================================================= Room catacombs_06 "Catacombs" with description "You are in a network of passages. There are exits north, south, east and west.", n_to catacombs_05, s_to catacombs_07, e_to catacombs_07, w_to catacombs_02; !============================================================================= Room catacombs_07 "Catacombs" with description "You are in a network of passages. There are exits north, south, east and west.", n_to catacombs_05, s_to catacombs_06, e_to catacombs_08, w_to catacombs_06; !============================================================================= Room catacombs_08 "Catacombs" with description "You are in a network of passages. Exits lead north and west.", n_to catacombs_04, w_to catacombs_07; !============================================================================= ! 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 ~= outside_church) 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 "^Looking back, you see the passages and the distant church fade away into nothingness, you are left to wait for the next adventure to begin..."; 3,4: print "^You have been caught, trapped forever in the graveyard..."; } ]; !============================================================================= ! Initialisation routine [ Initialise; location=dirt_path_03; 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; !=============================================================================