(display: "InventoryDisplay")
(unless: (history:) contains "PrisonCell")[You wake up and find yourself in a dark prison cell. The walls are covered in mold. In the distance somewhat above you can hear a muffled voice singing a lament.
At one side of the wall there is a small opening allowing the last light of the day to enter. The orange rays are falling onto the cell door, which is tighly shut.
Suddenly, you hear a creaking noise and you notice a small key being shoved below the door.
[
Will you
(link: "Pick it up")[(set: $inventory's "Cell Key" to 1)(display: "RefreshInventory")(replace:?choice)[
You picked up the key.
[[Leave the cell->Corridor]]]]
[[Shove it back -> TheStarvingEnd]]
(link-repeat: "Leave the cell")[<br>(either:"It is locked.","It won't open","It needs a key")]
]<choice|
]
(else:)[
You are back in your cell. The sun has left and the moon has taken over.
[[Leave the cell->Corridor]]
]Several days pass without anything happening. You are getting weaker by the hour and in the end, you close your eyes and breathe your last breath.
**T H E E N D**(display: "InventoryDisplay")
You are standing in a narrow corridor which stretches endlessly in both directions. Debris has fallen from the ceiling and is blocking most of the other cell doors. In front of you stairs are spiraling upwards.
[[Explore to the left->GuardsRoom]]
[[Explore to the right->TheExit]]
[[Eplore the stairs->FirstFloor]]
[[Go back into the cell->PrisonCell]](display: "InventoryDisplay")
You stumble through old debris, the moist air has covered most of the old corridor with moss. After a few minutes you feels like you have been going on for hours. The air smells of death and decay.
You finally arrive at a small room at the end of the corridor. To your surprise you can see the flickering light of a warm fire.
(if: not ($inventory contains "Guard Key"))[As you peek around the corner, you can see an old man wearing a uniform, humming with a broken voice. He has a big and a small key tied to his belt. A huge club is lying on the table.
|choices>[
(link: "Talk to him")[(show:?manAttacks)(replace:?choices)[]]
(link: "Offer him gold")[(show:?manTakesGold)(replace:?choices)[]]
(link: "Knock him unconscious")[(show:?knockdown)(replace:?choices)[]]
[[Return to the corridor->Corridor]]
]
](else:)[
You can see the old man lying in his own blood.
[[Leave room->Corridor]]]
{
|manAttacks)[The old man looks up and a second later he wields his club towards you. You feel a great pain on your head.(set: $enemy to "old man")
[[Continue->DeathByEnemyEnd]]]
|manTakesGold)[The old man looks up in surprise. Then he takes your gold and without any hesitation he wields his club towards you. You feel a great pain on your head.(set: $inventory's "Gold" to 0)(display: "RefreshInventory")(set: $enemy to "old man")
[[Continue->DeathByEnemyEnd]]]
|knockdown)[You sneak up to the man and hit him with a big rock on the head. He looks at you with a great sense of wonder and fear, just before he crumbles on the floor. Hastily, you pick up his club.
When you reach for his keys, he grabs your arm and mumbles in a strange language:"ohn im et no protoca al lo destruk hi princess". Then he dies. Somewhere high above you, a faint rumble send its echos through the corridor.(set: $inventory to it +(dm: "Guard Key" , 1)+ (dm: "Guard Club" , 1)+ (dm: "Tower Key" , 1))(display: "RefreshInventory")(if: $princessTaken is 0)[(set: $princessDoomed to 1)]
|choices2>[Do you want to (link: "snoop around ")[
(show:?findGold)(replace:?choices2)[]] or [[leave the room->Corridor]]?]
]
|findGold)[<br><br>You do a quick search of the crammed room and find ten unusual heavy pieces of gold in a small chest above the chimney. A shiver is running down your spine.(set: $inventory's Gold to it + 10 )(display: "RefreshInventory")<br>
[[Leave the room->Corridor]]]
}
(display: "InventoryDisplay")
You start to move and after almost giving up you see a hole in the wall. Beyond your prison of stone you can see a green wood and you hear chirping birds. A big gate stands between you and your freedom.
(if: ($inventory contains "Guard Key"))[[[Use guards key->Escaped]]]
[[Return to the corridor->Corridor]](display: "InventoryDisplay")
With a big effort you manage to open the old, rusty door and leave your prison behind. While you are still amazed by you new freedom, you hear a noise.
(set: $enemy to (either: "giant","hairy","creepy")+" "+(either: "spider","goblin","snake"))(set: $enemyHealth to (random: 18,35))(set: $enemyMaxDmg to (random: 3,8))(set: $fightTurn to 0)
(display: "AttackEnemy")
|winHook)[You slay the $enemy. [[Go forth...->ThePlains]]]
|failHook)[You are defeatet. [[Continue->DeathByEnemyEnd]]]<div class="inventory">[]<inventoryHook|(display: "RefreshInventory")
</div>(set: $inventory to (dm:"Gold",20,"Bread",3))
(set: $health to 40)
(go-to: "PrisonCell")<div class="attackBox">
{
A $enemy attacks you!<br>
|attackHook>[
(if: $inventory contains "Guard Club")[(link-repeat: "Attack with guard club")[(set: $maxDmg to 5)(display: "AttackRound")]<br>]
(if: $inventory contains "Silver Dagger")[(link-repeat: "Attack with silver dagger")[(set: $maxDmg to 10)(display: "AttackRound")]<br>]
(link-repeat: "Attack with hands")[(set: $maxDmg to 2)(display: "AttackRound")]
]
<hr>
|fightingTextHook>[]
}
</div>Beaten by the $enemy, you sink down and soon the worms and bugs begin eating your flesh. After a while, only your bones might give credit of your existence to another adventurer who might be brave enough to come to this horrid place.
**T H E E N D**{(replace:?fightingTextHook)[(set: $_hitDmg to (random:1,$maxDmg))(set: $_takenDmg to (random:1,$enemyMaxDmg))(set: $health to it-$_takenDmg)(set: $enemyHealth to it-$_hitDmg)
Fight turn $fightTurn: (set: $fightTurn to it + 1)<br>
You attack the $enemy and make $_hitDmg damage ($enemyHealth HP left)<br>
The $enemy attacks you and makes $_takenDmg damage ($health HP left)<br>
(if: $health<=0)[(replace:?attackHook)[](show:?failHook)]
(else-if: $enemyHealth<=0)[(replace:?attackHook)[](show:?winHook)]
]
}(display: "InventoryDisplay")
{
(if: (history:)'s last is "SecondFloor")[As you carefully descend the steep stairs, you](else:)[You] arrive at (if: (history:) contains "FirstFloor")[the](else:)[a] small platform. You can peek through a small window and see a green forest.
(if: (history:)'s last is "Corridor")[<br>The stairs are going up, steeper and steeper.]
}
[[Ascend->SecondFloor]]
[[Descend->Corridor]](display: "InventoryDisplay")
Again, you reach a platform and from here you can see what lies beyond the forest: the ocean. You somehow feel a warm familiarity with that blue plane.
(if: $towerDoorOpen is 1)[The wooden door is open.
[[Enter room->TowerCell]]]
(else:)[In front of you is a wooden door, sealed with a rusty lock. It seems that you can bang it open with a piece of rock.
|openingOptions>[
{
(if: $inventory contains "Tower Key")[(link: "Use Tower Key")[(set: $towerDoorOpen to 1)(replace:?openingOptions)[You turn the key and the door opens.<br>
[[Enter room->TowerCell]]]]]<br>
(link: "Bang it open")[(set: $towerDoorOpen to 1)(set: $poisoned to 1)(display: "RefreshInfoAndStatusBar")(replace:?openingOptions)[The door flies open but a tricky mechanism works its magic and shoots a poisonous dart in your hand. You pull it out quickly but you already feel the effect.<br>
[[Enter room->TowerCell]]]]
}
]]
[[Descend->FirstFloor]] (display: "InventoryDisplay")
(if: $princessTaken is 0)[In the room behind the door lies a beautiful woman in a white dress on a bed made of bones. As she notices you, she lifts herself up with great effort and glances at you cautiously.
(set: $questions to
(a: "Who are you?", "Why are you here?", "Have you tried to escape?"))
(set: $answers to
(a: "I' am the forest queen. I used to live where the golden sun caresses the blossoms of cherry trees", "I am a prisoner. The former owner of that castle, Garangoot, wanted to make me his bride and when I refused he locked me up in here until I change my mind. Many moons have passed and so has Garangoot. The castle fell into decay and I was forgotten.", "No, Garangoot lay a spell on this chamber so I lost all my magic. The evil has crept into me and...changed me. Made me weak. And there is a big gate below that is always shut. I know that the key is protected by the last living guard somewhere in the castle"))
(display: "Dialogue")
(link-repeat: "Take her with you")[(set: $princessTaken to 1)(replace:?princessAnswer)["Thank you for your kindness. (if: $princessDoomed is 1)[Though I think it will be too late for me. The evil in this chamber has weakend me too much. If only you would have come a little bit SOONER... a few minutes ago, some green smoke was released and it drains my life away](else:)[You came right on time, I wouldn't have had a chance if you had come any later.] (unless: $inventory contains "Silver Dagger")[As a token of appreciation, let me give you my Silver Dagger.]"(set: $inventory to it + (dm: "Silver Dagger" , 1))(display: "RefreshInventory")]]
(link-repeat: "Leave without her")[(set: $princessTaken to 0)(replace:?princessAnswer)["I understand, I would only be a burden...(if: $inventory contains "Silver Dagger")[You can keep the dagger...](else:)[but I might have something in return for you...]"]]
|princessAnswer>[]
](else:)[Excpet for the bone bed, the room is empty now. "Please let us leave this place" the princess whispers and turns away quickly.]
[[Descend->SecondFloor]] |infoAndStatusBarHook>[](display: "RefreshInfoAndStatusBar")<div class="dialogueBox">(link-reveal: (text:"<span class='dialogueQuestion'>"+1st of $questions+"</span>"))[ (text:1st of $answers)]
(link-reveal: (text:"<span class='dialogueQuestion'>"+2nd of $questions+"</span>"))[ (text:2nd of $answers)]
(link-reveal: (text:"<span class='dialogueQuestion'>"+3rd of $questions+"</span>"))[ (text:3rd of $answers)]
</div>At last the poison demands you last breath. (if: $takenPrincess is 1 and $princessAtHome is 0)[The princess looks at you in great despair. "It is all my fault..." are the last words you will ever hear.](else:)[All alone, you lie on your back as your vision fades away and your heart stops.]
**T H E E N D**(display: "InventoryDisplay")
You are crossing some wide fields leaving the castle behind you.
[[Go on->TheForest]](display: "InventoryDisplay")
Finally you reach the forest. You are amazed by the huge trees that have to be hundreds of years old.
(if: $princessTaken is 1)[The princess, though very weak, is happy to be in her realm again.(if: $princessDoomed is 1)[ Sadly, as she predicted earlier, she spent too much time in the evil chamber. She faints with a smile on her face and the last thing you ever hear from her is a whisper "Thank you, I am home now!"](else:)[She says: "Thank you, I am home now!" You both enjoy the sounds of the forest, then she explains to you how to reach the ocean.](set: $princessAtHome to 1)]
(else:)[You stand a while listening, but you can hear nothing but your own breath]
[[Go on -> WoodPassage]]You cross the woods safely and arrive at the ocean. An old trawler picks you up and you get home safely.
**T H E E N D**You begin crossing the forest. After a while you encounter a child of maybe ten years.
(if: $takenPrincess is 1)["I thank you for rescuing the queen of the forest who is also my mother. (if: $princessDoomed is 1)[Even though she died you were brave enough to bring her home.] Have a safe passage, the ocean is not far away."
And very quickly the child retreats between the trees without you seeing it again.
[[Go forth...->TheEnd]]]
(else:)["You have no business being here. This forest belongs to our people. Are you one of those men who took our queen away and locked her in the castle?"
Without any further warning the child rushes toward you and draws a silver dagger.
(set: $enemy to "forest child")(set: $enemyHealth to 20)(set: $enemyMaxDmg to 9)(set: $fightTurn to 0)
(display: "AttackEnemy")
|winHook)[You slay the $enemy. [[Go forth...->TheEnd]]]
|failHook)[You are defeatet... [[Continue->DeathByEnemyEnd]]]](replace:?infoAndStatusBarHook)[(unless: (passage:)'s tags contains "ignoreHeader")[Turns: (print: (history:)'s length), Health: $health, Status: (if: $poisoned is 1)[(set: $health to it - (random:1,3))(print: "<span class='statusPoisoned'>poisoned</span>")(if:$health<1)[(go-to: "DeathByPoison")]]
<hr>]](set: $i to 0)(set: $table to "Items:<br><table><tr>")(for: each _entry,...(dataentries: $inventory))[(set: $table to it+"<td>")(set: $table to it + _entry's name+" ("+(text: _entry's value)+")")(set: $i to it+1)(if: $i/3 is (round: $i/3))[(set: $table to it+"</td></tr><tr>")](else:)[(set: $table to it+"</td>")]](set: $table to it+"</tr></table>")(replace:?inventoryHook)[$table]