============================================================================ !
! Cloak of Darkness - a simple demonstration of Interactive Fiction
! Original Inform version written by Roger Firth on 17Sep99
! This version for HUGO written by John Menichelli on 19Sep99
! ============================================================================ !
2.5
! include verb stub routines
#set ! don't need advanced math routines
-ls ! print statistics to CLOAK.LST
#switches -d
#endif
"hang"
* held "on" xobject DoPutIn
"" ! normal verb grammar
!----------------------------------------------------------------------------
#ifset
""
#else
#include "" ! standard library routines
#endif
fake_number
{
= -1 ! 1 turn before turn 0
= 2
= 1 ! score/turns
=
= DEF_BACKGROUND
= DEF_SL_FOREGROUND
= DEF_SL_BACKGROUND
=
TEXTCOLOR, BGCOLOR
=
(DEFAULT_FONT)
\nHurrying 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...?\n\n
Font()
"Cloak of Darkness"
Font(BOLD_OFF)
"A Basic IF Demonstration"
=
= foyer
= location
player to location ! initialize player location
(location) ! whether the player can see
(location) ! the appropriate description
location
(player) ! total size of player contents
(player, cloak) ! give the player the cloak
cloak is ,
}
#ifset PRECOMPILED_LIBRARY
{
#else
routine main
{
#endif
location.
if not in location ! in case the character being spoken
speaking = 0 ! to leaves
}
you "you"
{}
foyer "Foyer of the Opera House"
{
{
"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."
}
bar
w_to cloakroom
n_to
{
"You've only just arrived, and besides, the weather outside
seems to be getting worse."
}
}
room cloakroom "Cloakroom"
{
long_desc
{
"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."
}
e_to foyer
is light
}
hook "small brass hook"
{
"hook" "peg"
"small" "brass"
"the"
cloakroom
long_desc
{
"It's just a small brass hook, ";
(hook, cloak)
{
"with a cloak hanging on it."
}
else
{
"screwed to the wall."
}
}
is
2
}
room bar "Foyer bar"
{
long_desc
{
"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."
}
n_to foyer
{
location
{
if light
{
scrawled_message.fake_number 2
"Blundering around in the dark isn't a good idea!"
}
else
(n_obj)
}
(location)
{
if = , &DoExit, &MovePlayer
if self is not light
{
scrawled_message.fake_number++
"In the dark? You could easily disturb something!"
return true
}
return false
}
}
is not light
}
cloak "velvet cloak"
{
noun "cloak"
adjectives "handsome" "dark" "black" "velvet" "satin"
article "a"
long_desc
{
"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."
}
before
{
object DoDrop, DoPutIn
{
if = hook or location = cloakroom
{
bar is light
if self is not
{
self is special
}
return false
}
else
{
"This isn't the best place to leave a smart cloak
lying around."
return true
}
}
}
{
object DoGet
{
bar is not light
return false
}
}
is
2
}
scenery scrawled_message "scrawled message"
{
noun "message" "sawdust" "floor"
in bar
long_desc
{
if self.fake_number < 2
{
score++
"The message, neatly marked in the sawdust, reads...\n\n
You have won!"
= 3
}
else
{
"The message has been carelessly trampled, making it
difficult to read. You can just distinguish the words...\n\n
You have lost."
endflag = 3
}
}
0
is
}