Cloak is here: plover.net/~dave/cloakjs/
The extensions and terp are here: github.com/ChicagoDave/fyrevm-web
Cloak source looks like this:
[code]âCloak of Darknessâ by The IF Community
Include FyreVM Core by David Cornelson.
Include FyreVM Banner Output by David Cornelson.
Include FyreVM Prologue by David Cornelson.
Include FyreVM Text Styles by David Cornelson.
Include FyreVM Status Line by David Cornelson.
The story headline is âA basic IF demonstration using FyreVMâ.
The story creation year is 2016.
p-style is a ui-style.
When play begins when outputting channels (this is the prologue channel rule):
say â[on prologue-channel][ui p-style]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âŚ?[/ui][paragraph break][end]â.
When play begins when not outputting channels (this is the normal prologue rule):
say â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âŚ?[paragraph break]â.
The prologue channel rule is listed last in the when play begins rules.
Use scoring.
The maximum score is 2.
[Whatever room we define first becomes the starting room of the game,
in the absence of other instructions:]
Foyer of the Opera House is a room. âYou are standing in a spacious hall, splendidly decorated in [em]red and gold[/em], with glittering chandeliers overhead. The entrance from the street is to the north, and there are doorways [cmdlink go-south]south[/cmdlink] and [cmdlink go-west]west[/cmdlink].â
Instead of going north in the Foyer, say âYouâve only just arrived, and besides, the weather outside seems to be getting worse.â
[We can add more rooms by specifying their relation to the first room.
Unless we say otherwise, the connection will automatically be bidirectional,
so âThe Cloakroom is west of the Foyerâ will also mean âThe Foyer is east of the Cloakroomâ:]
The Cloakroom is west of the Foyer.
âThe walls of this small room were clearly once lined with hooks, though now only one remains. The exit is a door to the [cmdlink go-east]east[/cmdlink].â
In the Cloakroom is a supporter called the small brass hook.
The hook is scenery. Understand âpegâ as the hook.
[Inform will automatically understand any words in the object definition
(âsmallâ, âbrassâ, and âhookâ, in this case), but we can add extra synonyms
with this sort of Understand command.]
The description of the hook is âItâs just a small brass hook, [if something is on the hook]with [a list of things on the hook]
hanging on it[otherwise]screwed to the wall[end if].â
[This description is general enough that, if we were to add other hangable items
to the game, they would automatically be described correctly as well.]
The Bar is south of the Foyer. The printed name of the bar is âFoyer Barâ.
The Bar is dark. â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.â
The scrawled message is scenery in the Bar. Understand âfloorâ or âsawdustâ as the message.
Neatness is a kind of value. The neatnesses are neat, scuffed, and trampled.
The message has a neatness. The message is neat.
[We could if we wished use a number to indicate how many times
the player has stepped on the message, but Inform also makes it easy
to add descriptive properties of this sort, so that the code remains readable
even when the reader does not know what âthe number of the messageâ might mean.]
Instead of examining the message:
increase score by 1;
say âThe message, neatly marked in the sawdust, readsâŚâ;
end the story finally.
[This second rule takes precedence over the first one whenever the message is trampled.
Inform automatically applies whichever rule is most specific:]
Instead of examining the trampled message:
say âThe message has been carelessly trampled, making it difficult to read.
You can just distinguish the wordsâŚâ;
end the story saying âYou have lostâ.
[This command advances the state of the message from neat to scuffed
and from scuffed to trampled. We can define any kinds of value we like
and advance or decrease them in this way:]
Instead of doing something other than going in the bar when in darkness:
if the neatness of the message is not trampled:
if the neatness of the message is neat:
now the neatness of the message is scuffed;
if the neatness of the message is scuffed:
now the neatness of the message is trampled;
say âIn the dark? You could easily disturb something.â
Instead of going nowhere from the bar when in darkness:
now the message is trampled;
say âBlundering around in the dark isnât a good idea!â
[This defines an object which is worn at the start of play.
Because we have said the player is wearing the item, Inform infers that it is clothing
and can be taken off and put on again at will.]
The player wears a velvet cloak. The cloak can be hung or unhung.
Understand âdarkâ or âblackâ or âsatinâ as the cloak.
The description of the cloak is âA handsome cloak, of velvet trimmed with satin, and slightly splattered with raindrops.
Its blackness is so deep that it almost seems to suck light from the room.â
Carry out taking the cloak:
now the bar is dark.
Carry out putting the unhung cloak on something in the cloakroom:
now the cloak is hung;
increase score by 1.
Carry out putting the cloak on something in the cloakroom:
now the bar is lit.
Carry out dropping the cloak in the cloakroom:
now the bar is lit.
Instead of dropping or putting the cloak on when the player is not in the cloakroom:
say âThis isnât the best place to leave a smart cloak lying around.â
Understand âhang [something preferably held] on [something]â as putting it on.
Test me with âs / n / w / inventory / hang cloak on hook / e / s / read messageâ.
[/code]