MediaWiki:CYOA.js

/*global $, mw*/

window.states = { 1: "You awake in a dimly lit room; moss clings to the walls like a disease, and the entire scene feels drenched in the indistinguishable sense of purple prose.

You see that there are two doors in front of you, and a knife to your left.

Do you... Go through the left door? Go through the right door? Pick up the knife?",	2: "You go through the door, and suddenly find yourself in Ponyville, in Equestria. A purple pony sits in front of you, reading a book.

Do you... Talk to it? Try to fight with it?",	3: "You go through the door, and suddenly find yourself facing CTHULU.

Do you... Attempt to fight with it? Accept your fate and die?",	4: "You accidentally stab yourself and die.

Try again?",	5: "Twilight Sparkle is best pony. Thus, you win! Congratulations!

Try again?</a>",	6: "You are clearly a horrible person. Celestia Herself descends from the heavens and eats you. You lose.

Try again?</a>",	7: "You go insane and die while fighting CTHULU. You lose.

Try again?</a>",	8: "As you lay on the ground, CTHULU's deranged cries getting closer by the second, you consider how at peace you are with yourself, and a small smile forms on your face. You consider how worthwhile your life has been up to this point, and even emit a small chuckle in happiness. Then CTHULU bites your face off. You lose.

Try again?</a>" };

window.change_state = function(state) { "use strict"; $('#CYOAcontainer').fadeOut(300, function {		$(this).remove;        $(' ' + states[state] + ' ').hide.appendTo('#mw-content-text').fadeIn(300);	}); };

$(function {	"use strict";    window.change_state(1); });