<%
// Hide the character panel (on the left)
// It will be brought back in the following passage
story.config.displayCharacterPanel = false;
%>
Welcome to this small adventure that shows some functionalites of **Adventures**.
Please enter the name of your hero
<p><input onchange="character.name = this.value"></p>
[[Confirm|Second]]<%
// Now that the name of the player is set, we can
// display the character panel.
story.config.displayCharacterPanel = true;
%>
Welcome <% character.name %>!
Let's discover a bit more about you. When you were young, you were...
[[An orphan, forced to steal in order to survive|Orphan]]
[[The son of a noble, born with a silver spoon in its mouth|Noble]]
[[Son of a soldier, trained by your father to defend the realm|Soldier]]You're just an orphan.
[[Continue|Intermediate]]<%
character.addGold(100);
%>
You're a noble, and as such, you left your house with some gold, to make sure you can buy anythng you need to your journey.
[[Continue|Intermediate]]<% character.inventory.addItem("sword"); %>
You're a soldier.
Since your father trained you when you were a child, you carry a sword with you at all times.
[[Continue|Intermediate]]You arrive at the main gate of the city. Two guards of the city refuses to let you enter. You...
<%
// This condition will check wether the player
// has a sword in its inventory. If yes,
// it will display an additional choice.
if (character.inventory.hasItem("sword")) {
%>
[[[Sword] Attack the guards|Attack]]
<% } %>
<%
// This condition will check if the player
// has at least 50 coins in its inventory.
if (character.gold >= 50) {
%>
[[[50 gold] Bribe the guards|Bribe]]
<% } %>
[[Turn back, you didn't even want to go in anyway|Exit]]You slew the guards pretty easily. You proceed into the city.
As you walk into the city, you feel like you are watched...
[[Continue|End]]<%
// We remove the gold
character.removeGold(50);
%>
You give the gold to the guard and proceed into the city.
You can't help but feel like you're watched...
[[Continue|End]]
You turn back.
You have a bad feeling, as if something terrible was about to happen.
[[Continue|End]]<%
// We make sure we kill the player
character.damage(character.health);
%>
You feel a small pinch on you're neck. You realize it was a poisoned dart.<%
// This passage will be displayed whenever the health
// of the player reaches zero. To tell the game to
// show this passage, we specify the name of it ("Death")
// in the setting
%>
Thanks for playing this small tutorial. This passage has a different theme thanks to the tag added ("theme-red").
This passage doesn't have any link to other passages, but it is still a passage like others, so you can put whatever you want.