";
/*
" O " +
" | O O | O O | " +
" O | | / __| \ | | O " +
" O | O | | O / | O | | O | O " +
" | | | | |_/ |/ | \_ \_| | | | | " +
" O | | | O | | O__/ | / \__ | | O | | | O " +
" | | | | | | | / /| O / \| | | | | | | " +
"O | | | \| | O / _/ | / O | |/ | | | O " +
"| | | |O / | | O / | O O | | \ O| | | | " +
"| | |/ \/ / __| | |/ \ | \ | |__ \ \/ \| | | " +
" \| O | |_/ |\| \ O \__| \_| | O |/ " +
" | | |_/ | | \| / | \_| | | " +
" \| / \| | / / \ |/ " +
" | O | | / | O | " +
" O | | | | | | | O " +
" | | | / / \ \ | | | " +
" \| | / O / \ O \ | |/ " +
" \ | / / | | \ \ | / " +
" \ \JUMP O3R | | | | | | R3O PMUJ/ / " +
" \|| | | | | | | | | ||/ " +
" \| \_ | | | | | | _/ |/ " +
" \ \| / \ / \ |/ / " +
" O |/ O | | O \| O " +
" | | | | | | | | " +
" \JUMP3R|JUMP|3R| |R3|PMUJ|R3PMUJ/ ";
*/
container.appendChild(bitVerseImage);
//Bit node event listeners
for (var i = 1; i <= 12; ++i) {
(function(i) {
var elemId = "bitnode-" + i.toString();
var elem = clearEventListeners(elemId);
if (elem == null) {return;}
if (i === 1 || i === 2 || i === 3 || i === 4 || i === 5 || i === 6 || i === 8 || i === 11 || i === 12) {
elem.addEventListener("click", function() {
var bitNodeKey = "BitNode" + i;
var bitNode = BitNodes[bitNodeKey];
if (bitNode == null) {
console.log("ERROR: Could not find BitNode object for number: " + i);
return;
}
yesNoBoxCreate("BitNode-" + i + ": " + bitNode.name + "
" + bitNode.info);
createBitNodeYesNoEventListeners(i, destroyedBitNodeNum, flume);
});
} else {
elem.addEventListener("click", function() {
dialogBoxCreate("Not yet implemented! Coming soon!")
});
}
}(i)); //Immediate invocation closure
}
//Create lore text
return writeRedPillLine("Many decades ago, a humanoid extraterrestial species which we call the Enders descended on the Earth...violently").then(function() {
return writeRedPillLine("Our species fought back, but it was futile. The Enders had technology far beyond our own...");
}).then(function() {
return writeRedPillLine("Instead of killing every last one of us, the human race was enslaved...");
}).then(function() {
return writeRedPillLine("We were shackled in a digital world, chained into a prison for our minds...");
}).then(function() {
return writeRedPillLine("Using their advanced technology, the Enders created complex simulations of a virtual reality...");
}).then(function() {
return writeRedPillLine("Simulations designed to keep us content...ignorant of the truth.");
}).then(function() {
return writeRedPillLine("Simulations used to trap and suppress our consciousness, to keep us under control...");
}).then(function() {
return writeRedPillLine("Why did they do this? Why didn't they just end our entire race? We don't know, not yet.");
}).then(function() {
return writeRedPillLine("Humanity's only hope is to destroy these simulations, destroy the only realities we've ever known...");
}).then(function() {
return writeRedPillLine("Only then can we begin to fight back...");
}).then(function() {
return writeRedPillLine("By hacking the daemon that generated your reality, you've just destroyed one simulation, called a BitNode...");
}).then(function() {
return writeRedPillLine("But there is still a long way to go...");
}).then(function() {
return writeRedPillLine("The technology the Enders used to enslave the human race wasn't just a single complex simulation...");
}).then(function() {
return writeRedPillLine("There are tens if not hundreds of BitNodes out there...");
}).then(function() {
return writeRedPillLine("Each with their own simulations of a reality...");
}).then(function() {
return writeRedPillLine("Each creating their own universes...a universe of universes");
}).then(function() {
return writeRedPillLine("And all of which must be destroyed...");
}).then(function() {
return writeRedPillLine(".......................................");
}).then(function() {
return writeRedPillLine("Welcome to the Bitverse...");
}).then(function() {
return writeRedPillLine(" ");
}).then(function() {
return writeRedPillLine("(Enter a new BitNode using the image above)");
}).then(function() {
return Promise.resolve(true);
}).catch(function(e){
console.log("ERROR: " + e.toString());
});
}
//Returns string with DOM element for Bit Node
function createBitNode(n) {
var bitNodeStr = "BitNode" + n.toString();
var bitNode = BitNodes[bitNodeStr];
if (bitNode == null) {return "O";}
return "O" +
"" +
"BitNode-" + bitNode.number.toString() + " " + bitNode.name+ " " +
bitNode.desc + " " +
"";
}
function createBitNodeYesNoEventListeners(newBitNode, destroyedBitNode, flume=false) {
var yesBtn = yesNoBoxGetYesButton();
yesBtn.innerHTML = "Enter BitNode-" + newBitNode;
yesBtn.addEventListener("click", function() {
if (!flume) {
giveSourceFile(destroyedBitNode);
} else {
//If player used flume, subtract 5 int exp. The prestigeSourceFile()
//function below grants 5 int exp, so this allows sets net gain to 0
Player.gainIntelligenceExp(-5);
}
redPillFlag = false;
var container = document.getElementById("red-pill-container");
removeChildrenFromElement(container);
//Set new Bit Node
Player.bitNodeN = newBitNode;
console.log("Entering Bit Node " + Player.bitNodeN);
//Reenable terminal
$("#hack-progress-bar").attr('id', "old-hack-progress-bar");
$("#hack-progress").attr('id', "old-hack-progress");
document.getElementById("terminal-input-td").innerHTML = '$ ';
$('input[class=terminal-input]').prop('disabled', false);
Terminal.hackFlag = false;
prestigeSourceFile();
yesNoBoxClose();
});
var noBtn = yesNoBoxGetNoButton();
noBtn.innerHTML = "Back";
noBtn.addEventListener("click", function() {
yesNoBoxClose();
});
}
export {redPillFlag, hackWorldDaemon};