1
0
Fork 0
mirror of https://github.com/Oreolek/gamebookformat.git synced 2024-06-26 03:41:04 +03:00
gamebookformat/expected/trade.html
Pelle Nilsson be2bc017bc Added trade tag.
Also documented a couple of bugs related to cost
and trade. Seems like that system needs some rethinking.
2014-03-07 21:22:10 +01:00

147 lines
5 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta name="viewport"
content="width=device-width, initial-scale=1, maximum-scale=1">
<title>Gamebook</title>
<script type="text/javascript" src="gamebookformatplay.js"></script>
<link rel="stylesheet" href="gamebookformat.css"
type="text/css" />
<script>
if (typeof gamebook !== 'undefined') {
gamebook.id = 'trade';
}
</script>
</head>
<body>
<div class="hideintrolink nodisplay"
onclick="gamebook.hideIntroSections()">(hide instructions)</div>
<div class="gamebook">
<div class="introsection">
<div class="introsectionheading">Introduction</div>
<div class="introsectionbody">
Testing trade of things. You can buy things using <span class="count counterChange" data-type="gold"
data-name="Gold">Gold</span> of which you start with <span class="set counterChange" data-type="gold"
data-amount="100">100</span>. You also have an <span class="collect" data-type="item"
data-name="Inventory">Inventory</span>. At start you carry a <span class="add" data-type="item"
data-what="sword">sword</span>.
</div>
</div>
<div class="resumelink nodisplay"
onclick="gamebook.loadGame()">Resume saved game.</div>
<div class="startlink"
onclick="gamebook.turnTo(1)">Turn to 1 to begin.</div>
<script>
if (typeof gamebook !== 'undefined' && gamebook.hasSavedGame()) {
var resumeLinks = document.getElementsByClassName('resumelink');
Array.prototype.forEach.call(resumeLinks, function(e) {
e.classList.remove('nodisplay');
});
}
</script>
<div class="section" id="section1">
<div class="sectionnumber" id="para1">1</div>
<div class="sectiontext">
You can buy a <span class="found enabledlink" data-type="item"
data-what="shield"
>shield</span>
here for <span class="cost" data-type="gold"
data-amount="50"
>50</span>
Gold or a beautiful <span class="found enabledlink" data-type="item"
data-what="gold ring"
>gold ring</span>
for only <span class="cost" data-type="gold"
data-amount="75"
>75</span>
. There is also a <span class="found enabledlink" data-type="item"
data-what="chain mail"
>chain mail</span>
costing <span class="cost" data-type="gold"
data-amount="150"
>150</span>
. You can pick up some <span class="found enabledlink" data-type="item"
data-what="spiderweb"
>spiderweb</span>
for free. You can go to <a class="sectionref enabledlink" data-ref="4"
href="#section4">4</a> at a cost of <span class="cost" data-type="gold"
data-amount="50"
>50</span>
. You can go on to the end at <a class="sectionref enabledlink" data-ref="2"
href="#section2">2</a>.
</div>
</div>
<script>
if (typeof gamebook !== 'undefined') {
gamebook.addSection(1, document.getElementById('section1'));
}
</script><div class="section" id="section2">
<div class="sectionnumber" id="para2">2</div>
<div class="sectiontext">
It ends here. There is a <span class="found enabledlink" data-type="item"
data-what="crown"
>crown</span>
here that you can trade for some <span class="trade" data-type="item"
data-what="spiderweb"
>spiderweb</span>
.
</div>
</div>
<script>
if (typeof gamebook !== 'undefined') {
gamebook.addSection(2, document.getElementById('section2'));
}
</script><div class="section" id="section3">
<div class="sectionnumber" id="para3">3</div>
<div class="sectiontext">
This is somewhere else. Congratulations you have found <span class="inc counterChange" data-type="gold"
data-amount="100">100</span> gold! Go back to <a class="sectionref enabledlink" data-ref="1"
href="#section1">1</a>.
</div>
</div>
<script>
if (typeof gamebook !== 'undefined') {
gamebook.addSection(3, document.getElementById('section3'));
}
</script><div class="section" id="section4">
<div class="sectionnumber" id="para4">4</div>
<div class="sectiontext">
Hopefully you now have 50 less gold than you just had. You can go back to <a class="sectionref enabledlink" data-ref="1"
href="#section1">1</a>. You can also go to <a class="sectionref enabledlink" data-ref="3"
href="#section3">3</a> but an angry troll is blocking your path and will only allow you to go there if you give it a <span class="trade" data-type="item"
data-what="gold ring"
>gold ring</span>
.
</div>
</div>
<script>
if (typeof gamebook !== 'undefined') {
gamebook.addSection(4, document.getElementById('section4'));
}
</script> <div id="counters" class="counters">
</div>
<div id="counterTemplate" class="counterTemplate">
<span class="counterheading"></span>
<span class="countercontents"></span>
</div>
</div>
<div id="collections" class="collections">
</div>
<div id="collectionTemplate" class="collectionTemplate">
<span class="collectionheading"></span>
<span class="collectioncontents"></span>
</div>
</div>
<script>
if (typeof gamebook !== 'undefined') {
gamebook.prepare();
}
</script>
<div class="displayintrolink nodisplay"
onclick="gamebook.showIntroSections()">(show instructions)</div>
</div>
</body>
</html>