For anyone who may be interested in testing and adapting this scenario to their own project, I tacked on ‘Armed’ by David Ratliff, and made it so the player can hide from the NPC hunting you (for example if there’s something in the room like a tree to conceal you), and the NPC will alternate back and forth between ‘docile’ (if he can’t see you, meaning he’ll just roam around) or ‘hostile’ (meaning he will attack on sight if you’re visible to him). It’s probably not the most elegant way to do this, but seems to work okay so far, and maybe somebody will wish to come along and add something new or refine it.
[code]“Hide and Seek”
Include Armed by David Ratliff.
Trolls Path is a region. Denied is a region.
Section - ARMED
Use no scoring.
A crossbow is a bow. The maximum damage of the crossbow is 25.
A centaur is a kind of person. The max health of a centaur is usually 40. A centaur is usually docile.
Section - HIDING
A thing can be hideable. A thing is usually not hideable.
A person is either hidden or vulnerable. A person is usually vulnerable.
Hiding is an action applying to one visible thing.
Understand “hide behind [something]” as hiding.
The description of player is “You’re [if the player is hidden]hidden[else if the player is vulnerable]vulnerable[end if].”
Carry out hiding:
if the noun is a hideable thing:
say “You are now hiding behind the [noun].”;
now the player is hidden;
otherwise:
say “You can’t hide behind the [noun].” instead.
Carry out going:
say “(first creeping out of your hiding place…)”;
now the player is vulnerable.
Section - SAMPLE TEST GAME
Forest is a room in Trolls Path. A gnarled tree is in the Forest. The gnarled tree is hideable. A stump is in the Forest. Clearing is a room in Trolls Path. It is north of Forest. Meadow is a room in Trolls Path. It is east of Forest. A large boulder is in the Meadow. The large boulder is hideable. Cliff is a room in Denied. It is south of Forest. Hilltop is a room in Denied. It is west of Forest.
Troll is a centaur in the Forest. The max health of Troll is 70. Troll is docile. Troll carries the crossbow.
Every turn (this is the hungry troll rule):
If the location of Troll is the location of the player:
say “[one of]The Troll looks around, trying to find where the delicious scent of food is coming from.[or]The Troll turns over a nearby rock, hoping to find something - or someone - to eat.[or]The Troll lumbers clumsily about, sniffing the air.[then at random]”;
hunt the player;
Otherwise:
hunt the player.
Every turn:
if Troll is visible and the player is hidden:
now the Troll is docile.
To hunt the player:
let origin be the location of Troll;
let nextspace be a random room which is adjacent to origin;
while nextspace is not in Trolls Path:
let nextspace be a random room which is adjacent to origin;
let way be the best route from the origin to nextspace;
if Troll is visible:
say “With a grunt, the Troll moves [way], trying to find someone to eat.”;
try Troll going way;
if Troll is visible and the player is not hidden:
say “The Troll howls in rage as he spots you!”;
now the Troll is hostile.[/code]