! ============================================================================ ! ! Cloak of Darkness - a simple demonstration of Interactive Fiction ! Platypus version by Owen Muniz based on Roger Firth's Inform version. ! ============================================================================ ! Constant Story "Cloak of Darkness"; Constant Headline "^A basic IF demonstration.^"; Constant MAX_SCORE 2; Include "First"; Include "Middle"; ! ============================================================================ ! Rooms Foyer "Foyer of the Opera House" with 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.", dirs sdir Bar wdir Cloakroom ndir "You've only just arrived, and besides, the weather outside seems to be getting worse.", has light; Rooms Cloakroom "Cloakroom" with 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.", dirs edir Foyer, has light; Object hook "small brass hook" Cloakroom with name 'hook' 'peg', adjective 'small' 'brass', description [; print "It's just a small brass hook, "; if (self == parent(cloak)) "with a cloak hanging on it."; "screwed to the wall."; ], has static concealed supporter; Rooms Bar "Foyer bar" with 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.", dirs ndir Foyer, meddle_early [; Go: if (InDark(player) && noun ~= ndir) { message.number = message.number + 2; "Blundering around in the dark isn't a good idea!"; } default: if (InDark(player) && ~~(ActionIgnoresDarkness(action) || (action == ##Look))) { message.number = message.number + 1; "In the dark? You could easily disturb something!"; } ], has ~light; Object cloak "velvet cloak" with name 'cloak', adjective 'handsome' 'dark' 'black' 'velvet' 'satin', description "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.", startup [; move self to player; give self worn; ], respond [; Drop, PutOn: if (player.location == cloakroom) { give Bar light; if (action == ##PutOn && self has general) { give self ~general; score++; } } else "This isn't the best place to leave a smart cloak lying around."; ], respond_late [; Take: give Bar ~light; ], has clothing general; Object message "scrawled message" Bar with name 'message' 'sawdust' 'floor', description [; if (self.number < 2) { score++; deadflag = 2; print "The message, neatly marked in the sawdust, reads..."; } else { deadflag = 3; print "The message has been carelessly trampled, making it difficult to read. You can just distinguish the words..."; } ], number 0, has static concealed; [ Initialise; player.location = Foyer; "^^Hurrying 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...?^^"; ]; [ DeathMessage; print "You have lost"; ]; ! ============================================================================ ! Include "Last"; Verb 'hang' * held 'on' noun -> PutOn; ! ============================================================================ !