---------------------------------------------------------------------- -- Cloak of Darkness - a simple demonstration of Interactive Fiction -- This version for ALAN written by Stephen Griffiths in Sept 1999 ---------------------------------------------------------------------- $INCLUDE 'std.i' ---------------------------------------------------------------------- LOCATION foyer NAME 'Foyer of the Opera House' DESCRIPTION "You are standing in a spacious hall, splendidly decorated in red and gold, with glittering chandeliers overhead. The entrance from the street is to the north, and there are doorways south and west." EXIT south TO bar DOES IF cloak IN inventory THEN LOCATE hero AT dark_bar. ELSE LOCATE hero AT bar. END IF. END EXIT. EXIT west TO cloakroom. EXIT north TO foyer CHECK "You've only just arrived, and besides, the weather outside seems to be getting worse." END EXIT. END LOCATION. ---------------------------------------------------------------------- LOCATION cloakroom DESCRIPTION "The walls of this small room were clearly once lined with hooks, though now only one remains. The exit is a door to the east." EXIT east TO foyer. END LOCATION. OBJECT hook NAME small brass hook AT cloakroom IS NOT takeable. DESCRIPTION VERB examine, look_at DOES ONLY "It's just a small brass hook" IF cloak IS on_hook THEN "with a cloak hanging on it." ELSE "screwed to the wall." END IF. END VERB. END OBJECT. SYNONYMS peg = hook. ---------------------------------------------------------------------- LOCATION bar NAME foyer bar DESCRIPTION "The bar, much rougher than you'd have guessed after the opulence of the foyer to the north, is completely empty. There seems to be some sort of message scrawled in the sawdust on the floor." EXIT north TO foyer. END LOCATION. OBJECT message NAME scrawled message AT bar IS NOT takeable. IS readable. HAS damage_number 0. DESCRIPTION VERB examine, look_at DOES ONLY DESCRIBE read_message. END VERB. VERB read DOES ONLY DESCRIBE read_message. END VERB. END OBJECT. SYNONYMS floor, sawdust = message. OBJECT read_message DESCRIPTION IF damage_number OF message < 2 THEN SCORE 1. "The message, neatly marked in the sawdust, reads... $p$t*** You have won ***$p" ELSE "The message has been carelessly trampled, making it difficult to read. You can just distinguish the words... $p$t*** You have lost ***$p" END IF. SCORE. QUIT. END OBJECT. ---------------------------------------------------------------------- LOCATION dark_bar NAME darkness DESCRIPTION "It's pitch black here. You can't see a thing." EXIT north TO foyer. EXIT northeast, east, southeast, south, southwest, west, northwest TO dark_bar CHECK "Blundering around in the dark isn't a good idea!" INCREASE damage_number OF message BY 2. END EXIT. VERB invent, 'look', wait DOES ONLY DESCRIBE dark_warning. END VERB. VERB read, switch_on1, switch_on2, turn_on1, turn_on2 DOES ONLY DESCRIBE dark_warning. END VERB. VERB drop, examine, look_at, pick_up1, pick_up2, put_down1, put_down2, search, take, throw DOES ONLY DESCRIBE dark_warning. END VERB. END LOCATION. OBJECT dark_warning DESCRIPTION "In the dark? You could easily disturb something!" INCREASE damage_number OF message BY 1. END OBJECT. ---------------------------------------------------------------------- OBJECT cloak NAME black velvet cloak IN inventory IS NOT on_hook. DESCRIPTION IF cloak IS on_hook THEN "$pOn the small brass hook is a velvet cloak." ELSE "$pThere is a black velvet cloak here." END IF. VERB examine, look_at CHECK LOCATION <> dark_bar ELSE DESCRIBE dark_warning. DOES ONLY "A handsome cloak, of velvet trimmed with satin, and slightly spattered with raindrops. Its blackness is so deep that it almost seems to suck light from the room." END VERB. VERB drop, put_down1, put_down2 CHECK LOCATION <> dark_bar ELSE DESCRIBE dark_warning. AND location = cloakroom ELSE "This isn't the best place to leave a smart cloak lying around." END VERB. VERB put_on CHECK obj2 = hook ELSE "This isn't the best place to leave a smart cloak lying around." DOES ONLY IF hero IS NOT hung_cloak THEN MAKE hero hung_cloak. SCORE 1. END IF. "You $v the $1 on the $2." MAKE cloak on_hook. LOCATE cloak here. END VERB. END OBJECT. SYNONYMS hang = put. ---------------------------------------------------------------------- ACTOR hero IS NOT hung_cloak. VERB examine, look_at CHECK LOCATION <> dark_bar ELSE DESCRIBE dark_warning. DOES ONLY "As handsome as ever." END VERB. END ACTOR. SYNONYMS me, myself = hero. ---------------------------------------------------------------------- START at foyer. "$p$pHurrying through the rainswept November night, you're glad to see the bright lights of the Opera House. It's surprising that there aren't more people about but, hey, what do you expect in a cheap demo game...?" "$p$nCloak of Darkness" "$nA basic IF demonstration." "$nVersion 1, Sept 1999. (Implemented using ALAN 2.8, lib 0.2)" ----------------------------------------------------------------------