The Cloak of Shadows (Source Code)

The story genre is "Horror".
The release number is 1.
The story creation year is 2024.
The story description is "An implementation of The 'Cloak of Darkness' Specification, based on 'The Cloak of Ultimate Darkness' game (part of the Advanced Authoring System hoax)."

Volume 1 - Setup

Book 1 - Extensions

Include Basic Combat by A J Mako.

Book 2 - Settings

Use scoring.
The maximum score is 100. 

msgStoryEnd is "YOU LOSE".

Does the player mean doing anything to the location:
	it is unlikely.

A room has a number called points. The points of a room is usually 0.
A thing has a number called points. The points of a thing is usually 0.

Chapter 1 - When Play Begins

After printing the banner text:
	say paragraph break;
	say "Hurrying through the rain swept late October night, you're glad to see the bright lights of the Opera House. You're surprised that there aren't more people about but, hey, what do you expect on a Monday night in this weather...[line break]".

After deciding the scope of the player while examining (this is the place the room in scope while looking rule):
	place the location in scope, but not its contents.

Instead of examining a room:
	try looking instead.

After taking something:
	if the points of the noun is greater than 0:
		increase score by points of the noun;
		now points of the noun is 0;
	continue the action.

After going:
	if the points of the location is greater than 0:
		increase score by points of the location;
		now points of the location is 0;
	continue the action.

Every turn:
	if the Vampire is dead:
		if the points of the Vampire is greater than 0:
			increase score by points of the Vampire;
			now points of the Vampire is 0.

Volume 2 - Map

Chapter 1 - The Foyer

The Foyer is a room.
	The printed name is "Foyer of the Opera House".
	The description is "You stand in a spacious hall, splendidly decorated in red and gold, with glittering chandeliers overhead[if DarkCloak is visible]. The light from the chandeliers seems strangely dimmed[end if]. The entrance to the street is to the north, and there are doorways south and west."
	The points is 2.
	Understand "foyer" or "hall" or "room" as the Foyer.

Instead of going nowhere from Foyer:
	if the noun is north:
		say "Howling, hurricane-force winds resist your pitiful attempts to return to the street.";
	otherwise:
		continue the action.

Chapter 2 - The Cloakroom

Cloakroom is a room.
	The printed name is "Cloakroom".
	The description is "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."
	The points is 2.
	It is west of Foyer.
	Understand "cloakroom" or "coatroom" or "cloak/coat room" or "room" as the Cloakroom.
	
Chapter 3 - The Lounge

The Lounge is a room.
	The printed name is "Foyer Lounge".
	The description is "The lounge, much rougher than you'd have guessed after the opulence of the foyer to the north, is completely empty. It's dominated by a plush bar."
	The points is 2.
	It is south of Foyer.
	Understand "foyer/-- lounge" or "room" as the Lounge.

Before going to Lounge:
	if the player wears the DarkCloak:
		now Lounge is dark;
	otherwise:
		now Lounge is lighted.

Volume 3 - Actions

Section 1 - Hanging Things Up

Understand the command "hang" as "put".
Understand "hang [DarkCloak]" as putting it on.

Rule for supplying a missing second noun while an actor putting something on (this is the other unmentioned hooks rule):
	now the second noun is the BrassHook.

Section 2 - Scores

The announce the score rule response (A) is "[the score response]".

To say the score response:
	if the story has ended:
		say "In that game you scored";
	otherwise:
		say "You have so far scored";
	if the score is 0:
		say " nothing";
	otherwise:
		say " [score] out of a possible [maximum score]";
	say ", in [turn count] turn[s]".

Volume 4 - Things

Book 1 - Scenery

Chapter 1 - North Doorway

The NorthDoorway is scenery in Foyer.
	The printed name is "door to street".
	The description is "Highly polished glass and brass doors lead back to the street."
	Understand "north/street/-- door/doorway" or "door to street" or "entrance" as the NorthDoorway.

Chapter 2 - West Doorway

The WestDoorway is scenery in Foyer.
	The printed name is "west doorway".
	The description is "An open doorway on the west wall bears a sign reading 'Cloakroom' in fancy golden letters."
	Understand "west/cloakroom/-- door/doorway" as the WestDoorway.

Chapter 3 - South Doorway

The SouthDoorway is scenery in Foyer.
	The printed name is "south doorway".
	The description is "An open doorway on the south wall bears a sign reading 'Lounge' in fancy golden letters."
	Understand "south/lounge/-- door/doorway" as the SouthDoorway.

Chapter 4 - The Chandeliers

The Chandeliers is scenery in Foyer.
	The printed name is "chandeliers".
	The description is "Glittering brass lighting fixtures hang far above your head[if DarkCloak is visible]. The light from the chandeliers seems strangely dimmed[end if]."
	Understand "glittering/-- chandelier/chandeliers" as the Chandeliers.

Chapter 5 - Brass Hook

The BrassHook is a scenery supporter in Cloakroom.
	The printed name is "brass hook".
	The description is "It's just a small brass hook, screwed to the wall."
	Understand "brass/coat/cloak/-- hook" as the BrassHook.

After putting the DarkCloak on the BrassHook:
	if the points of the DarkCloak is greater than 0:
		increase score by points of the DarkCloak;
		now the points of the DarkCloak is 0;
		now the points of the Lounge is 20;
	continue the action.

Chapter 6 - The Bar

The LoungeBar is an open scenery container in Lounge.
	The printed name is "lounge bar".
	The description is "This plush bar is stained from long years of gin slings, rum punches, and other high-class drinks."
	Understand "lounge/-- bar" as the LoungeBar.

Book 2 - Portables

Chapter 1 - The Dark Cloak

The DarkCloak is worn by the player.
	The printed name is "dark cloak".
	The description is "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. There's a small label on the inside[if DarkCloak is on BrassHook]. It hangs from a small brass hook[end if]."
	The points is 10.
	Understand "dark/-- cloak" as the DarkCloak.

Instead of dropping the DarkCloak:
	if the location is Cloakroom:
		say "On second thought, [we] decide to hang the cloak on the hook. That's what it's designed for, after all.";
		move DarkCloak to BrassHook;
		if points of the DarkCloak is greater than 0:
			increase score by points of the DarkCloak;
			now points of the DarkCloak is 0;
			now the points of the Lounge is 20;
	otherwise:
		say "On second thought, this isn't the best place to leave a smart cloak lying around, so [we] pick it up again.";
		now the player carries the DarkCloak.

The LightLabel is part of the DarkCloak.
	The printed name is "label".
	The description is "The label includes some faded text, which reads: '[bold type]Cloak of Shadows:[roman type] Dims bright light. Enhances darkness. Obscures the living. Works only when worn or carried. Do not drop.'"
	The points is 5.
	Understand "label" as the LightLabel.

After examining the LightLabel:
	if the points of the noun is greater than 0:
		increase score by the points of the noun;
		now the points of the noun is 0;
	continue the action.

Chapter 2 - Wooden Stake

The WoodenStake is a piercer in the LoungeBar.
	The printed name is "wooden stake".
	The description is "It's a short spike of wood."
	The Charges is 20.
	The Recharge is 0.
	the hitBonus is 2.
	The hurtBonus is 4.
	The points is 5.
	The msgEmpty is "The stake falls to splinters after the attack."
	Understand "wooden/-- stake" as the WoodenStake.

Chapter 3 - The Pile of Dust

The PileOfDust is a thing.
	The printed name is "pile of dust".
	The description is "That's strange... the dust seems to be reforming into letters! The message reads..."
	The indefinite article is "the".
	The PileOfDust is improper-named.
	Understand "vampire" or "dust" or "dustpile" or "pile" as the PileOfDust.

Instead of examining the PileOfDust:
	increase score by 4;
	say "That's strange... the dust seems to be reforming into letters! The message reads...";
	end the story finally saying "YOU WON".
	
Book 3 - Actors

Chapter 1 - The Player

The description of the player is "You're just an everyday opera-lover."
The Health of the player is 50.
The Vitality of the player is 50.
The Fight of the player is 16.
The minDamage of the player is 2.
The maxDamage of the player is 8.
The msgChallenge of the player is "You leap to the attack!".
The msgPunch of the player is "You swing wildly!" 
The msgKick of the player is "You kick violently!" 
The msgDodge of the player is "You leap aside desperately."
The msgPain of the player is "You scream in pain and fear."

Chapter 2 - The Vampire

The Vampire is a man.
	The printed name is "vampire".
	The description is "He's tall, elegant and very very pale. He's wearing a long dark cloak, not unlike your own."
	The Vitality is 40.
	The Health is 40.
	The Fight is 13.
	The Evade is 2.
	The minDamage is 2.
	The maxDamage is 8.
	The Corpse is PileOfDust.
	The msgChallenge is "'I need... blood!' the vampire says, grinning evilly."
	The msgBite is "The vampire goes for your jugular vein!"
	The msgDodge is "The vampire deftly sidesteps your attack."
	The msgPain is "The vampire hisses as you strike home. 'You'll pay for that, mortal!'"
	The msgDeath is "With a blood-curdling scream, the vampire shrivels up into a small heap of dust!"
	The msgKill is "You howl as [the Combatant] drinks your blood, but your body goes limp and you can no longer resist..."
	The points is 50.
	The Vampire is proper-named.
	Understand "vampire" or "opera lover" as the Vampire.

The fang is a tooth. It is part of the Vampire.
	The msgStrike is "The vampire lunges for your neck."
	The msgMiss is "The vampire misses you completely."
	The msgHit is "The vampire sinks its fangs into your jugular vein!"

Every turn when the location is the Lounge:
	if the player has been in the lighted Lounge for exactly 2 turns:
		now the Vampire is in the Lounge;
		say "Suddenly, misty vapors seem to coalesce from nowhere into the shape of a considerably better dressed opera lover.";
	if the player has been in the lighted Lounge for 3 turns:
		if the Vampire is not battling and the Vampire is not dead:
			now the Vampire is battling;
			say "[msgChallenge of the Vampire][paragraph break]";
			try the Vampire attacking the player instead.