334 lines
26 KiB
HTML
334 lines
26 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
<html xmlns='http://www.w3.org/1999/xhtml'>
|
|
<head>
|
|
<title>WAH</title>
|
|
<meta http-equiv='content-type' content='text/html; charset=utf-8' />
|
|
<style type='text/css'>
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
|
|
body {
|
|
font-family: 'dejavu sans', arial, verdana;
|
|
font-size: 14px;
|
|
color: #000;
|
|
background-color: #fff;
|
|
}
|
|
|
|
#wrapper {
|
|
width: 80%;
|
|
margin: 10% auto 0 auto;
|
|
padding: 10px;
|
|
background-color: #99ffff;
|
|
}
|
|
|
|
h1 {
|
|
font-weight: normal;
|
|
font-size: 23px;
|
|
}
|
|
|
|
button {
|
|
margin: 5px 10px 5px 0;
|
|
}
|
|
|
|
span {
|
|
color: #3344ff;
|
|
background-color: #eee;
|
|
cursor: pointer;
|
|
}
|
|
|
|
span:hover {
|
|
color: #5566ff;
|
|
background-color: #fff;
|
|
}
|
|
|
|
hr {
|
|
margin: 0 0 5px 0;
|
|
border: 1px solid #333;
|
|
}
|
|
|
|
/* Feel free to modify this file without attributing anyone. */
|
|
|
|
</style>
|
|
<script type='text/javascript'>
|
|
/*
|
|
Template script for movact-convert: a JavaScript movact frontend
|
|
Copyright (C) 2009, 2010 Niels Serup
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
// Maintained by Niels Serup <ns@metanohi.org>
|
|
/**********************************************************************/
|
|
|
|
function loadMovact() {
|
|
meta = {"load": "Choose file: ", "save command": "\/save", "prompt": "Go to: ", "open command": "\/open", "load-gui": "Choose file", "current command": "\/current", "loaded": "Savefile loaded.", "reset button": "Reset", "saved": "Savedata saved to file.", "again": "Try again.", "confirmed": ["y", "yes"], "reset command": "\/reset", "end": "This wonderful story has now come to an end. But do not worry! There are other ends as well.", "opened": "movact file opened.", "title": "WAH", "quit button": "Quit", "open": "Choose file: ", "save-gui": "Choose file", "version": "ZERO", "save": "Choose file: ", "start": "Welcome to WAH...\nAn interactive story featuring non-stop action.", "end-gui": "This wonderful story has now come to an end. But do not worry! There are other ends as well.", "start-gui": "Welcome to WAH...\nAn interactive story featuring non-stop action.", "back button": "Back", "load command": "\/load", "save button": "Save", "load button": "Load", "quit command": "\/quit", "open-gui": "Choose file", "back command": "\/back", "confirm": "Are you sure? (y\/N) ", "confirm-gui": "Are you sure?", "points": [["1. ", "1"], ["2. ", "2"], ["3. ", "3"], ["4. ", "4"], ["5. ", "5"], ["6. ", "6"], ["7. ", "7"], ["8. ", "8"], ["9. ", "9"]], "separator": "**********", "error": "Error.", "load error": "Contents are not savedata.", "open button": "Open"} // JSON meta data from movact-convert goes here
|
|
main = {"hell-start": [false, [true, "So, you're in hell. Or..? It seems that hell never existed. You realize that it doesn't even matter. You do not know what to do now."], [true, ""], [true, "If you are not aware of this, you have now ended up at an **open ending**."]], "43": [true, [true, "It seems that your mind has become unstable while you were mentally gone. Now you are only able to 5p34k 1n 1337 -- and 0nly in a v3ry n00b f0rm of 1337."], [true, ""], [true, "u haz n0 idea watz d0. r34l1ty ftw u fink. U 3vntully di54p3ar."], [true, ""], [true, "3 1337 cr4x0rz 4p34r. Tehm tellz u 2go2 1 of tehse pl4ces:"], [false, "heaven-start", "H34\\/3|\|"], [false, "hell-start", "H311"], [false, "limbo-start", "1_1|\\/||}0"]], "41b": [true, [true, "The cats seem to be dancing. They appear to be happy, though you can't even comprehend how they are able to breathe. You realize that it must be because of a source of oxygen."], [true, ""], [true, "You take off your helmet. Then you die."], [true, ""], [true, "Three beings appear. They tell you to go to one of these places:"], [false, "heaven-start", "Heaven"], [false, "hell-start", "Hell"], [false, "limbo-start", "Limbo"]], "24": [true, [true, "You are killed by an alien. Three beings approach you. They tell you to go to one of these places:"], [false, "heaven-start", "Heaven"], [false, "hell-start", "Hell"], [false, "limbo-start", "Limbo (somewhere in the middle)"]], "25": [true, [true, "Your mind wanders. This is, after all, the moon, somewhere only a few humans has been. You are taken back by the thought."], [false, "23", "Explore the moon."], [false, "24", "Think."]], "20": [true, [true, "You fall asleep."], [false, "36", "Sleep for a week."], [false, "37", "Sleep for a month."]], "21": [true, [true, "You look out a window. Noting the sky, you realize that this airport is strange. It's as if the airport is.. closed. The sky is blue and pretty, but there are no planes. There is nothing. When you think about it, currently you're actually doing something. You promised yourself to relax. Do you want to reconsider your choice?"], [false, "38", "Yes"], [false, "36", "No"]], "22": [true, [true, "You don't know what to do. However, to do something, you do not need to know what to do. You can just do something at random. And that is excactly what you do. A completely randomized act chosen by a random algorithm that randomly selects a number."], [true, ""], [true, "You jump."], [true, ""], [true, "Reflecting upon your action, nothing happens. The airport is completely empty. Suddenly it's just a big white space. You wonder why that is, considering the fact that just a while ago, everything was normal."], [true, "So, what to do?"], [false, "39", "Jump again."], [false, "40", "Run\/walk."]], "23": [true, [true, "You start exploring the moon. A lot of craters appear before you. One of the craters seems different."], [false, "41", "Examine it."], [false, "42", "Keep walking."]], "46": [true, [true, "It's like a western. You're the bad guy who robs banks as a hobby. With a gun in your right hand, you enter what you believe to be a bank. It is, however, a prison. You are arrested."], [false, "47", "Plead for forgiveness"], [false, "start", "Travel back in time"]], "47": [true, [true, "They don't care. You are put into a magical cell that automatically makes its prisoners vanish within a day or so. When you're gone, three beings approach you. They tell you to go to one of these places:"], [false, "heaven-start", "Heaven"], [false, "hell-start", "Hell"], [false, "limbo-start", "Limbo"]], "44": [true, [true, "The old man greets you. He telkjdndxdjuddchjudjcJJhzfjudfxjJJ"], [true, "JJJHYUjdjjfimrrj8iie4jjdu5mikdr5ieo4krk-asg:"], [false, "heaven-start", "Heaven"], [false, "hell-start", "Hell"], [false, "limbo-start", "Limbo"]], "45": [true, [true, "You're still not really sure what to do.."], [false, "44", "Go back."], [true, ""], [true, "But still, it would embarass you to go back.."], [false, "45", "Keep on walking."]], "42": [true, [true, "You walk on. It's funny how the surface of the moon doesn't have a lot of variation. At one point you see a crater."], [false, "42", "Keep walking."], [false, "41", "Check it out."]], "29": [true, [true, "You hit the ground head first. You die."], [true, ""], [true, "It seems that you are then being teleported to somewhere.. distant. Three beings approach you and ask you to choose between the following places:"], [false, "hell-start", "Hell"], [false, "heaven-start", "Heaven"], [false, "limbo-start", "Limbo"], [true, "Note that it is unlikely that you can be revived."]], "40": [true, [true, "You run for hours. You do not know this, as your perception of time seems to be temporarily non-existent. At least it's not very functional."], [true, ""], [true, "You lose your mind."], [true, ""], [true, "Three beings appear. They tell you to go to one of these places:"], [false, "heaven-start", "Heaven"], [false, "hell-start", "Hell"], [false, "limbo-start", "Limbo"]], "41": [true, [true, "It's full of water! And.. Cats? Cats on the moon?"], [true, ""], [true, "You don't get it."], [true, ""], [false, "41b", "Examine the scene more closely."], [false, "42", "Escape!"]], "1": [true, [true, "You stumble upon a person, whom you ask for help. Sadly, the person turns out to be a werewolf."], [true, "What do you do now?"], [false, "4", "Take it easy. You know it won't attack you 'cos you got lots 'o courage."], [false, "5", "Run away."]], "start": [true, [true, "You are standing in an airport. You do not know what airport."], [true, "What do you do?"], [false, "1", "Look for help."], [false, "2", "Walk outside."], [false, "3", "Do nothing."]], "3": [true, [true, "..Hmm.. Well, you're still in the unknown airport. While nothing is going on, you get the idea that you might as well..?"], [false, "8", "Think."], [false, "9", "Not think."], [false, "10", "Travel to the moon."]], "2": [true, [true, "It's a jungle outside. Buses, gorillas, guerillas, elephants, they're all here. You notice a small shop."], [false, "6", "Enter the shop."], [false, "7", "Don't enter the shop."]], "5": [true, [true, "WAAAH! WAAAH! You flee in terror. The werewolf does not notice your escape. You are relieved. Looking back, you understand that the werewolf was never trying to kill you. It just wanted to befriend you."], [false, "12", "Go back and cheer him up."], [false, "13", "Bullshit. Just hurry up 'n escape."]], "4": [true, [true, "You might be brave, but the werewolf *is* quite scary. As its claws approach your flesh you wonder if staying was such a good idea."], [false, "11", "But no matter what, you know that the werewolf will be beaten!"], [false, "5", "Hence you flee."]], "7": [true, [true, "You keep on walking until you unknowingly accidentally step on a dead bat. You don't notice it, but everybody else do. Without further ado, they begin to hunt you down. Apparently a dead bat is sacred or something in this foreign country."], [true, "What do you do?"], [false, "16", "RUNRRUNRUN!"], [false, "17", "Stay back and talk."]], "6": [true, [true, "You approach the shop owner. He seems nice. Wearing a mixture of non-colored cloths, you assume that he is relatively poor. What do you do?"], [false, "14", "Buy something."], [false, "15", "Steal his money."]], "9": [true, [true, "You do nothing."], [false, "20", "Keep doing nothing."], [false, "21", "Keep doing nothing, but in another way."], [false, "22", "Do something."]], "8": [true, [true, "Your mind wanders. You try to remember why you are in the airport, but nothing pops up. The airport looks very ordinary, and you are unable to seriously figure anything out."], [true, ""], [true, "A grue suddenly captures you. You are in deep trouble. What do you do?"], [false, "18", "Stay still."], [false, "19", "Attempt to escape."]], "limbo-start": [false, [true, "Well done! Choosing LIMBO was a good idea after all. Now, you rejoice."]], "39": [true, [true, "This time, you jump a bit higher. You land on the moon. What do you say?"], [false, "23", "\"One step for man, one step for humanity.\""], [false, "24", "\"One step for man, two steps for humanity.\""], [false, "25", "\"Yeah!\""]], "heaven-start": [false, [true, "It's suprisingly dark. You wonder why that is. Did you choose the wrong path, or were you simply unlucky? Or lucky? Or just somewhere in the middle?"], [true, ""], [true, "Having been an atheist since before you were born, you are still not sure if this is really happening. Then you wake up."], [true, ""], [true, "You realize that waking up from a dream was a seriously simple solution to an odd story. You are sorry."]], "38": [true, [true, "So, you're not going to relax. As a matter of fact, you begin to wonder.. Wonder whether it would be a good idea to maybe"], [true, ""], [true, " TRAVEL BACK IN TIME!"], [true, ""], [false, "start", "TRAVEL BACK!"]], "35b": [true, [true, "Even though you have never met a fairy before, you choose to completely ignore her. You find that it is a wise choice, though you do not know why. You just know. By knowing something while not knowing why you know it, a paradox appears. The paradox terminates you."], [true, ""], [true, "After you disappear, three beings appear. They tell you to go to one of these places:"], [false, "heaven-start", "Heaven"], [false, "hell-start", "Hell"], [false, "limbo-start", "Limbo"]], "11": [true, [true, "You attempt to attack the vicious werewolf. You fail. It kills you."], [true, ""], [true, "You are now dead. Three beings approach you. They tell you to choose between the following:"], [false, "heaven-start", "Heaven"], [false, "hell-start", "Hell"], [false, "limbo-start", "Limbo (somewhere in the middle)"]], "10": [true, [true, "Even though it at first seems difficult, if not impossible, you succeed in the end. A nice lady rents you a rocket, and within hours you stand on the surface of the moon. What do you say?"], [false, "23", "\"One step for man, one step for humanity.\""], [false, "24", "\"One step for man, two steps for humanity.\""], [false, "25", "\"Yeah!\""]], "13": [true, [true, "Your decision seems to be quite wise. The werewolf now receives help from a newly teleported werewolf trio. They yell at you, but you just keep on running. And running. As a matter of fact, you don't stop until you're outside the airport. Then you collapse."], [false, "29", "Collapse hard."], [false, "30", "Search for a pillow, then collapse."]], "12": [true, [true, "Well, he does seem to be quite sad. You ask him what's wrong, but he doesn't answer. Instead he eats you."], [true, ""], [true, "You are now dead. Three beings approach you. They tell you to choose one of the following:"], [false, "hell-start", "Hell"], [false, "heaven-start", "Heaven"], [false, "limbo-start", "Limbo (somewhere in the middle)"]], "15": [true, [true, "\"How am I supposed to steal his money?\" you wonder. While you smile at him, your thoughts are in the process of being evilized. In the end you do this:"], [true, ""], [true, " 1. YOU: \"Oh, incredible! A three-headed monkey!\" (points somewhere)"], [true, " 2. SHOP OWNER: \"What? Where?\" (looks in the pointed area)"], [true, " 3. YOU: \"There! There!\" (hits shop owner and steals stuff)"], [true, ""], [true, "It works. You now have an odd feeling. What is it?"], [false, "33", "Guilt"], [false, "33", "Guilt"], [false, "33", "Guilt"], [false, "34", "Excitement"], [false, "33", "Guilt"]], "14": [true, [true, "You buy an orange."], [false, "31", "Eat it."], [false, "32", "Do not eat it."]], "17": [true, [true, "\"But I didn't know!\" you keep telling the foreigners (who are not foreigners, considering the fact that YOU are in THEIR country). They don't seem to care much, and within minutes you are completely surrounded."], [true, ""], [true, "Out of nowhere a fairy appears."], [true, ""], [false, "35", "Speak to the fairy."], [false, "35b", "Ignore the fairy."], [false, "2a", "Travel back in time (as if that was possible..)."]], "16": [true, [true, "You don't stop running until after two hours. Then you collapse."], [false, "30", "Collapse on something soft."], [false, "29", "Collapse on something hard."]], "19": [true, [true, "When the grue looks away for a short moment, you shred the cage into pieces and escape, your running speed matching the velocity of 10000 bullets. The grue is angry, but it does nothing. IT just looks at you. Intensely. With burning red eyes."], [true, ""], [true, "In the end, you're killed. Three beings then approach you and ask you to choose between the following:"], [false, "heaven-start", "Heaven"], [false, "hell-start", "Hell"], [false, "limbo-start", "Limbo (somewhere in the middle)"]], "18": [true, [true, "You realize that it's not very funny to be captured. The grue never stops offending you, and you don't get to eat a lot. What do you do?"], [false, "19", "Attempt to escape."], [false, "18", "Stay still."]], "31": [true, [true, "It has a nice taste. It takes you a minute or so to eat it."], [true, ""], [true, "A couple of minutes later you feel sick. You realize that the orange was heavily poisoned."], [true, ""], [true, "You eventually die. Three beings then approach you and ask you to choose between.."], [false, "heaven-start", "Heaven"], [true, "You are told that \"it will be a holy experience\"."], [false, "hell-start", "Hell"], [true, "You are told that \"hell has it all\"."], [false, "limbo-start", "Limbo"], [true, "You are told that \"this is for those in limbo\"."]], "30": [true, [true, "You manage to collapse on a bundle of hay. It's relatively soft and you only faint. When you are done fainting.."], [false, "43", "Continue!"]], "37": [true, [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, ""], [true, "You have slept for too long a time. You have died of hunger."], [true, ""], [true, "After you die, three beings appear. They tell you to go to one of these places:"], [false, "heaven-start", "Heaven"], [false, "hell-start", "Hell"], [false, "limbo-start", "Limbo"]], "36": [true, [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, "zzZZzZZzZzZZZzZzZZZZzZZZzzZ"], [true, ""], [true, "You have slept for too long a time. You have died of hunger."], [true, ""], [true, ""], [true, "After you die, three beings appear. They tell you to go to one of these places:"], [false, "heaven-start", "Heaven"], [false, "hell-start", "Hell"], [false, "limbo-start", "Limbo"]], "35": [true, [true, "You speak to the fairy. You tell her what has happened so far. She seems to ignore you, but soon enough she tells you that you appeared here for a reason."], [true, ""], [true, " \"You are The Chosen One\""], [true, ""], [true, "The fairy continues to talk about your newly aquired profession as a saviour, until the people kill you with their mind power."], [true, ""], [true, "After you disappear, three beings appear. They tell you to go to one of these places:"], [false, "heaven-start", "Heaven"], [false, "hell-start", "Hell"], [false, "limbo-start", "Limbo"]], "34": [true, [true, "You get an adrenaline kick and decide to steal other stuff as well. You have soon robbed most of the shops in your area. All that's left to do is to.."], [false, "45", "Keep on walkin'"], [false, "46", "Rob the bank"]], "33": [true, [true, "Yes, that's true. Stealing from such an old man was not a nice thing to do, you think. You decide to not care, however, as the world is already corrupt."], [true, ""], [true, ""], [true, " Or..?"], [true, ""], [true, "You're not really sure what to do.."], [false, "44", "Go back."], [true, ""], [true, "But still, it would embarass you to go back.."], [false, "45", "Keep on walking."]], "2a": [true, [true, "It's a jungle outside. Buses, gorillas, guerillas, elephants, they're all here. You notice a small shop."], [false, "7", "Enter the shop (as if)."], [false, "6", "Don't enter the shop (as if)."]], "32": [true, [true, "Well, it doesn't seem to be that tasty. You drop it. The shop owner notices this and attacks you. You die."], [true, ""], [true, "Three beings approach you and force you to pick one of these places to go to:"], [false, "heaven-start", "Heaven"], [false, "hell-start", "Hell"], [false, "limbo-start", "Limbo"]]} // JSON main data from movact-convert goes here
|
|
|
|
// Create core elements
|
|
wrapper = document.getElementById('wrapper')
|
|
dyn = document.createElement('div')
|
|
wrapper.appendChild(dyn)
|
|
|
|
visitedParts = []
|
|
partName = 'start'
|
|
storyDone = false
|
|
cookieJustSat = false
|
|
|
|
if (autoload())
|
|
start()
|
|
else
|
|
appendLinkingText(meta.title, 'start', start)
|
|
// At this point the game will start when the user clicks on the element
|
|
}
|
|
|
|
function start() {
|
|
header = document.createElement('h1')
|
|
button_back = document.createElement('button')
|
|
button_back.appendChild(createText(meta['back button']))
|
|
button_back.onclick = function() {
|
|
back()
|
|
}
|
|
button_reset = document.createElement('button')
|
|
button_reset.appendChild(createText(meta['reset button']))
|
|
button_reset.onclick = function() {
|
|
reset()
|
|
}
|
|
|
|
// Remove stupid elements
|
|
while (wrapper.childNodes.length > 1) {
|
|
if (wrapper.firstChild != dyn)
|
|
wrapper.removeChild(wrapper.firstChild)
|
|
}
|
|
|
|
// Insert smart elements
|
|
wrapper.insertBefore(header, dyn)
|
|
wrapper.insertBefore(button_back, dyn)
|
|
wrapper.insertBefore(button_reset, dyn)
|
|
wrapper.insertBefore(separator(), dyn)
|
|
|
|
///////////\ /
|
|
run() //// \/
|
|
}
|
|
|
|
function separator() {
|
|
return document.createElement('hr')
|
|
}
|
|
|
|
function popParts() {
|
|
// Remove last element
|
|
var vpn = []
|
|
for (var i = 0; i < visitedParts.length-1; i++) {
|
|
vpn[i] = visitedParts[i]
|
|
}
|
|
visitedParts = vpn
|
|
}
|
|
|
|
function back() {
|
|
if (visitedParts.length > 1) {
|
|
popParts()
|
|
partName = visitedParts[visitedParts.length-1]
|
|
popParts()
|
|
run()
|
|
}
|
|
}
|
|
|
|
function reset() {
|
|
if (storyDone || confirm(meta['confirm-gui'])) {
|
|
partName = visitedParts[0]
|
|
visitedParts = []
|
|
clearCookie()
|
|
cookieJustSat = true
|
|
run()
|
|
}
|
|
}
|
|
|
|
function removeChilds(elem) {
|
|
while (dyn.childNodes.length > 0) {
|
|
dyn.removeChild(dyn.firstChild)
|
|
}
|
|
}
|
|
|
|
function createParagraph() {
|
|
return document.createElement('p')
|
|
}
|
|
|
|
function createText(text) {
|
|
return document.createTextNode(text)
|
|
}
|
|
|
|
function appendStaticText(text) {
|
|
var elem = createParagraph()
|
|
elem.innerHTML = text
|
|
dyn.appendChild(elem)
|
|
}
|
|
|
|
function appendLinkingText(text, reference, func) {
|
|
var elem = createParagraph()
|
|
var span = document.createElement('span')
|
|
span.reference = reference
|
|
if (func == undefined)
|
|
var func = goTo
|
|
span.onclick = function() {
|
|
func(this.reference)
|
|
}
|
|
elem.appendChild(span)
|
|
span.innerHTML = text
|
|
dyn.appendChild(elem)
|
|
}
|
|
|
|
function goTo(part_name) {
|
|
partName = part_name
|
|
run()
|
|
}
|
|
|
|
function run() {
|
|
var part, refsNum, text, i, p
|
|
removeChilds()
|
|
part = main[partName]
|
|
|
|
text = meta.title + ' ["' + partName + '"] (' + visitedParts.length + ')'
|
|
header.innerHTML = text
|
|
document.title = text
|
|
|
|
refsNum = 0
|
|
text = ''
|
|
for (var i = 1; i < part.length; i++) {
|
|
x = part[i]
|
|
if (x[0]) {
|
|
var txt = x[1]
|
|
if (txt == '')
|
|
txt = ' '
|
|
appendStaticText(txt)
|
|
}
|
|
else {
|
|
p = self.meta.points[refsNum]
|
|
appendLinkingText(p[0] + x[2], x[1])
|
|
refsNum += 1
|
|
}
|
|
}
|
|
|
|
storyDone = false
|
|
if (!part[0]) {
|
|
dyn.appendChild(separator())
|
|
appendStaticText(meta.end)
|
|
storyDone = true
|
|
}
|
|
|
|
if (visitedParts.length == 0) {
|
|
button_back.disabled = 'disabled'
|
|
button_reset.disabled = 'disabled'
|
|
}
|
|
else {
|
|
button_back.disabled = ''
|
|
button_reset.disabled = ''
|
|
}
|
|
|
|
visitedParts[visitedParts.length] = partName
|
|
if (!cookieJustSat)
|
|
autosave()
|
|
else
|
|
cookieJustSat = false
|
|
}
|
|
|
|
function setCookie(value, ms) {
|
|
try {
|
|
if (ms == undefined)
|
|
var ms = 63936000000 // In 740 days (a little over 2 years)
|
|
var date = new Date()
|
|
date.setTime(date.getTime()+ms)
|
|
date = date.toGMTString()
|
|
document.cookie = "movact_auto_save="+value+"; expires="+date+"; path=/"
|
|
} catch (e) {}
|
|
}
|
|
|
|
function clearCookie() {
|
|
setCookie('', -1468800000) // Deleted 17 days ago
|
|
}
|
|
|
|
function getCookie() {
|
|
try {
|
|
var name = "movact_auto_save="
|
|
var spl = document.cookie.split(';')
|
|
for (var i = 0; i < spl.length; i++) {
|
|
var current = spl[i]
|
|
while (current.charAt(0) == ' ')
|
|
current = current.substring(1)
|
|
if (current.indexOf(name) == 0)
|
|
return current.substring(name.length)
|
|
}
|
|
// Else:
|
|
return false
|
|
} catch (e) {
|
|
return false
|
|
}
|
|
}
|
|
|
|
function autoload() {
|
|
var savedata = unescape(getCookie())
|
|
if (savedata) {
|
|
try {
|
|
eval("var vp = " + savedata)
|
|
var pn = vp[vp.length-1]
|
|
if (main[pn] == undefined)
|
|
return
|
|
|
|
visitedParts = vp
|
|
partName = pn
|
|
popParts()
|
|
return true
|
|
}
|
|
catch(e) {
|
|
|
|
}
|
|
}
|
|
// Else:
|
|
return false
|
|
}
|
|
|
|
function autosave() {
|
|
// Transform visitedParts into a string that can be eval'd when loading it
|
|
var arrStr, tStr
|
|
arrStr = ''
|
|
for (x in visitedParts) {
|
|
tStr = visitedParts[x]
|
|
tStr = tStr.replace(/\'/g, "\\'")
|
|
arrStr += ",'" + tStr + "'"
|
|
}
|
|
arrStr = '[' + arrStr.substring(1) + ']'
|
|
setCookie(escape(arrStr))
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
// Initialize data and start function chain
|
|
window.onload = function() {
|
|
loadMovact()
|
|
}
|
|
|
|
</script>
|
|
</head>
|
|
|
|
<body>
|
|
<div id='wrapper'>
|
|
<h1>WAH</h1>
|
|
<p>Welcome to WAH...
|
|
An interactive story featuring non-stop action.</p>
|
|
</div>
|
|
</body>
|
|
</html>
|
|
<!--This was created using movact, a free hypertext fiction runner/converter.-->
|
|
<!--See http://metanohi.org/projects/movact/ for downloads and documentation.-->
|
|
<!-- Feel free to modify this HTML markup without attributing anyone. -->
|