grenadier

new mobs - grenadier and grenadierBoss

tech drone repair has a 25% chance to use ammo, was 33%
This commit is contained in:
landgreen
2021-07-06 06:22:58 -07:00
parent 89ade77e14
commit b0b8e09333
7 changed files with 498 additions and 379 deletions

View File

@@ -49,22 +49,23 @@ const lore = {
// option.setAttribute('data-name', voices[i].name);
// voiceSelect.appendChild(option);
// }
setVoices() {
window.speechSynthesis.onvoiceschanged = () => {
const synth = window.speechSynthesis
console.log(synth.getVoices())
const voiceArray = synth.getVoices()
lore.anand.voice = voiceArray[0]
lore.miriam.voice = voiceArray[1]
console.log(voiceArray[0], voiceArray[1])
};
// console.log('before')
// if ('speechSynthesis' in window) {
// setVoices() {
// window.speechSynthesis.onvoiceschanged = () => {
// const synth = window.speechSynthesis
// console.log(synth.getVoices())
// const voiceArray = synth.getVoices()
// lore.anand.voice = voiceArray[0]
// lore.miriam.voice = voiceArray[1]
// console.log(voiceArray[0], voiceArray[1])
// };
// // console.log('before')
// // if ('speechSynthesis' in window) {
// } else {
// console.log('Text-to-speech not supported.');
// }
},
// // } else {
// // console.log('Text-to-speech not supported.');
// // }
// },
rate: 1, // //utterance.rate = 1; // 0.1 to 10
anand: {
color: "#e0c",
voice: undefined,
@@ -76,7 +77,7 @@ const lore = {
// utterance.voice = lore.anand.voice
utterance.lang = "en-GB" //"en-IN"; //de-DE en-GB fr-FR en-US en-AU
utterance.volume = 0.2; // 0 to 1
// utterance.rate = 1.5
// if (lore.rate !== 1) utterance.rate = lore.rate
speechSynthesis.speak(utterance);
utterance.onerror = (event) => { //if speech doesn't work try again without the lang set
console.log("speech error", event.error)
@@ -105,7 +106,7 @@ const lore = {
// utterance.voice = lore.anand.voice
utterance.lang = "en-AU";
utterance.volume = 0.2; // 0 to 1
// utterance.rate = 1.5
// if (lore.rate !== 1) utterance.rate = lore.rate
speechSynthesis.speak(utterance);
utterance.onerror = (event) => { //if speech doesn't work try again without the lang set
console.log("speech error", event.error)
@@ -124,6 +125,12 @@ const lore = {
}
},
},
// utterance.onerror = (event) => { //if speech is still not working, just do text
// console.log("speech error", event.error)
// lore.sentence++
// if (m.alive) lore.conversation[lore.chapter][lore.sentence]() //go to next sentence in the chapter and play it
// }
// setTimeout(() => {}, 2000);
// lore.miriam.text("")
// lore.miriam.utterance.addEventListener('end', () => {
@@ -132,27 +139,22 @@ const lore = {
sentence: 0, //what part of the conversation is playing
conversation: [
[ //first time they meet, and testing gets unlocked
() => {
// lore.setVoices();
setTimeout(() => {
lore.miriam.text("I've never seen it generate this level before.")
}, 5000);
},
() => { setTimeout(() => { lore.miriam.text("I've never seen it generate this level before.") }, 5000); },
() => { lore.anand.text("Wow. Just a platform.") },
() => { lore.miriam.text("And that thing...") },
() => { lore.anand.text("Weird") },
() => { lore.anand.text("Maybe it's trapped.") },
() => { lore.miriam.text("Looks like testing mode is locked.") },
() => { lore.miriam.text("I'll unlock it with the console command.") },
() => {
lore.miriam.text("Hey little bot! Just press 'T' to enter testing mode and 'U' to go to the next level.")
lore.unlockTesting();
setTimeout(() => { lore.miriam.text("Hey little bot! Just press 'T' to enter testing mode and 'U' to go to the next level.") }, 1000);
},
() => { lore.anand.text("I don't think it's connected to the audio input, and I'm sure it can't understand what you're saying.") },
() => { lore.anand.text("It can't process what you're saying.") },
() => { lore.miriam.text("ha hahahaha. I know, but it does seem to be getting smarter.") },
() => {
lore.talkingColor = "#dff"
setTimeout(() => {
lore.miriam.text("Poor thing... I hope it figures out how to escape.")
}, 25000);
setTimeout(() => { lore.miriam.text("Poor thing... I hope it figures out how to escape.") }, 25000);
},
() => { lore.talkingColor = "#dff" },
],
@@ -202,326 +204,203 @@ const lore = {
[ //they ask the bot questions, but waves of mobs come and attack
() => { lore.anand.text("Quick, get ready. It's back!") },
() => { lore.miriam.text("What's back?") },
() => { lore.anand.text("The bot is back on the communication level!") },
() => { lore.miriam.text("Oh good, I've got so many questions.") },
() => { lore.miriam.text("Is it self aware?") },
() => { lore.miriam.text("How did it learn to understand words?") },
() => { lore.miriam.text("Why can it only hear what we are saying on this level?") },
() => { lore.miriam.text("I wish we could just ask it questions directly, instead of yes or no.") },
() => { lore.anand.text("We could ask it to spell words by saying letters and having it crouching on the correct letter.") },
() => { lore.miriam.text("Well, that would take forever.") },
() => { lore.miriam.text("I really want to know: Why is it generating the mobs? and why does it keep fighting them?") },
() => { lore.anand.text("The bot's on the communication level again!") },
() => { lore.miriam.text("Oh, I've got so many questions.") },
() => { lore.miriam.text("Like, Why can we only hear it on this level?") },
() => { lore.miriam.text("Or, how did it learn to understand words?") },
() => { lore.anand.text("Well, the bot can't talk. So it has to be yes or no.") },
() => { setTimeout(() => { lore.anand.text("OK bot, first question: JUMP is YES, CROUCH is NO") }, 500); },
() => { lore.anand.text("Do you remember the last time we met?") },
() => {
lore.anand.text("Maybe that is just part of it's expectationmaximization algorithm")
//endlessly spawning mobs until the player dies
function cycle() {
if (!(simulation.cycle % 360)) {
const pick = spawn.fullPickList[Math.floor(Math.random() * spawn.fullPickList.length)];
spawn[pick](1000 * (Math.random() - 0.5), -500 + 200 * (Math.random() - 0.5));
level.difficultyIncrease(simulation.difficultyMode)
if (input.down) {
lore.anand.text("It crouched: so NO")
lore.sentence--
lore.conversation[2].splice(lore.sentence + 1, 1, () => { lore.anand.text("Maybe it can't remember anything beyond each time it plays?") }) //lore.conversation[chapter].splice(1,this sentence index, ()=>{ })
} else if (input.up) {
lore.anand.text("It jumped: so YES")
lore.sentence--
lore.conversation[2].splice(lore.sentence + 1, 1, () => { lore.anand.text("That's good.") })
} else if (m.alive) {
requestAnimationFrame(cycle);
}
if (!(simulation.cycle % 900)) spawn.randomLevelBoss(500 * (Math.random() - 0.5), -500 + 200 * (Math.random() - 0.5))
if (m.alive) requestAnimationFrame(cycle);
}
requestAnimationFrame(cycle);
lore.talkingColor = "#dff"
},
() => {
lore.talkingColor = "#dff"
setTimeout(() => { lore.miriam.text("My turn to ask a question. JUMP for YES, CROUCH for NO") }, 1000);
},
() => { lore.miriam.text("Little Bot. Do you have emotions?") },
() => {
function cycle() {
if (input.down) {
lore.miriam.text("So, No. Maybe you are lucky. Emotions are complex.")
} else if (input.up) {
lore.anand.text("YES, Cool! I wonder if it's emotions came from watching humans. ")
lore.sentence--
lore.conversation[2].splice(lore.sentence + 1, 1, () => { lore.miriam.text("Or maybe it learned independently, because it needed them.") }) //lore.conversation[chapter].splice(1,this sentence index, ()=>{ })
} else if (m.alive) {
requestAnimationFrame(cycle);
}
}
requestAnimationFrame(cycle);
lore.talkingColor = "#dff"
},
() => { lore.miriam.text("I wish we could just ask it questions directly, instead of yes or no.") },
() => { lore.anand.text("If we say the alphabet it could crouch on the correct letter to spell words.") },
() => { lore.miriam.text("That would take forever.") },
() => { lore.miriam.text("I really want to know why is it generating the mobs? And why does it keep fighting them?") },
() => { lore.anand.text("Maybe that is just part of it's expectationmaximization algorithm") },
() => { lore.miriam.text("Well sure, but what does that even mean?") },
() => { lore.miriam.text("Do we all just do things because we are-") },
() => { lore.miriam.text("... what is going on?") },
() => { setTimeout(() => { lore.anand.text("it's spawning mobs and fighting them") }, 1000); },
() => { lore.miriam.text("oh no.") },
() => { lore.anand.text("We can't really communicate with it while it's fighting") },
() => { lore.miriam.text("You can do it little bot!") },
() => {
setTimeout(() => {
lore.talkingColor = "#dff";
lore.anand.text("But, why is it spawning these bots?")
}, 1000);
lore.miriam.text("Do we all just do things because we are-")
spawn[spawn.fullPickList[Math.floor(Math.random() * spawn.fullPickList.length)]](1000 * (Math.random() - 0.5), -500 + 200 * (Math.random() - 0.5));
setInterval(() => {
if (Math.random() < 0.5) {
spawn[spawn.fullPickList[Math.floor(Math.random() * spawn.fullPickList.length)]](1000 * (Math.random() - 0.5), -500 + 200 * (Math.random() - 0.5));
level.difficultyIncrease(simulation.difficultyMode)
} else {
spawn.randomLevelBoss(500 * (Math.random() - 0.5), -500 + 200 * (Math.random() - 0.5))
}
}, 7000); //every 6 seconds
},
() => { setTimeout(() => { lore.miriam.text("... wait, what is happening?") }, 1000); },
() => { lore.anand.text("It's spawning mobs.") },
() => { lore.miriam.text("Oh no.") },
() => { lore.anand.text("We can't talk to it while it's fighting") },
() => {
lore.talkingColor = "#dff";
setTimeout(() => { lore.miriam.text("You can do it little bot!") }, 1000);
},
() => {
setTimeout(() => {
lore.talkingColor = "#dff";
lore.anand.text("This is so strange.")
}, 3000);
lore.talkingColor = "#dff";
setTimeout(() => { lore.anand.text("But, why is it spawning these mobs?") }, 1000);
},
() => {
setTimeout(() => {
lore.talkingColor = "#dff";
lore.miriam.text("This is chaos!")
}, 1000);
lore.talkingColor = "#dff";
setTimeout(() => { lore.anand.text("This is so strange.") }, 3000);
},
() => {
setTimeout(() => {
lore.talkingColor = "#dff";
lore.anand.text("I don't understand this project.")
}, 3000);
lore.talkingColor = "#dff";
setTimeout(() => { lore.miriam.text("This is chaos!") }, 1000);
},
() => {
setTimeout(() => {
lore.talkingColor = "#dff";
lore.miriam.text("It's fascinating though.")
}, 1000);
lore.talkingColor = "#dff";
setTimeout(() => { lore.anand.text("I don't understand this project.") }, 3000);
},
() => {
setTimeout(() => {
lore.talkingColor = "#dff";
lore.miriam.text("I think this isn't going to end well.")
}, 1000);
lore.talkingColor = "#dff";
setTimeout(() => { lore.miriam.text("It's fascinating though.") }, 1000);
},
() => {
setTimeout(() => {
lore.talkingColor = "#dff";
lore.anand.text("Let's just be more prepared next time it enters this room.")
}, 1000);
lore.talkingColor = "#dff";
setTimeout(() => { lore.miriam.text("I think this isn't going to end well.") }, 1000);
},
() => {
setTimeout(() => {
lore.talkingColor = "#dff";
lore.anand.text("I had to go to the bathroom. What happened while I was gone?")
}, 20000);
lore.talkingColor = "#dff";
setTimeout(() => { lore.anand.text("Let's just be more prepared next time it enters this room.") }, 1000);
},
() => {
lore.talkingColor = "#dff";
setTimeout(() => { lore.anand.text("I went to the bathroom. What happened while I was gone?") }, 20000);
},
() => { lore.miriam.text("More fighting...") },
() => { lore.anand.text("great...") },
() => { lore.talkingColor = "#dff" },
],
// scientist try to think of a way to communicate since the bot can't talk
// they give up on getting the bot to respond, and just start ask questions and thinking of explanations with each other
// when and how did it become self-aware
// why is the bot fighting things in these simulated locations?
// it wasn't designed to be violent
// the bot was just designed to automate research and testing of new technology
// 3D architecture superconducting quantum computer
// running machine learning algorithms
// as the scientist start to get agitated bots arrive and player dies
// bots come in Infinite waves that increase game difficulty each wave
// only ending is testing mode + next level or player death
// scientist have some lines in between each wave of mobs
// [ // they provide background on why the project was built, and what is going wrong
// /*
// they explain the technological aspect, and purpose of the project
// to develop new technology
// they explain that the project isn't going well because it stopped working on new technology and started running the fighting simulations
// what is special about the null level
// why can the player hear the scientists in there?
// the wires are the direct unprocessed input to the player's neural net
// */
// () => { lore.miriam.text("") },
// () => { lore.miriam.text("") },
// () => { lore.miriam.text("") },
// () => {
// if (localSettings.loreCount < 2) {
// localSettings.loreCount = 2
// localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage
// }
// setTimeout(() => {
// lore.miriam.text("Hey look! It's back at the weird level again!")
// lore.miriam.utterance.addEventListener('end', () => {
// lore.anand.text("oh Wow! Why does it keep making this level?")
// lore.anand.utterance.addEventListener('end', () => {
// lore.miriam.text("I don't know, but last time it was in this room I think it understood us.")
// lore.miriam.utterance.addEventListener('end', () => {
// lore.miriam.text("Let's try talking to it again.")
// lore.miriam.utterance.addEventListener('end', () => {
// lore.miriam.text("hmmm, what should we say?")
// lore.miriam.utterance.addEventListener('end', () => {
// lore.anand.text("I'm still not convinced it understands. We need a test.")
// lore.anand.utterance.addEventListener('end', () => {
// lore.miriam.text("Hey bot!!!")
// lore.miriam.utterance.addEventListener('end', () => {
// lore.miriam.text("If you can understand me crouch")
// lore.miriam.utterance.addEventListener('end', () => {
// lore.talkingColor = "#dff"
// () => { lore.talkingColor = "#dff" },
// ],
// [ //they explain why the bot is fighting, it is planning an escape
// () => { lore.miriam.text("Welcome back bot, We've been waiting.") },
// () => { lore.miriam.text("So, I've got a theory about why you were attacked.") },
// () => { lore.miriam.text("") },
// () => { lore.miriam.text("I figured it out after I saw this famous quote.") },
// () => { lore.miriam.text('“The most important decision we make is whether we believe we live in a friendly or hostile universe.”<br>-Albert Einstein') },
// () => {
// lore.talkingColor = "#dff";
// setTimeout(() => { lore.anand.text("That's profound") }, 3000);
// },
// () => { lore.anand.text("Also I looked it up, and there is no record of him saying that.") },
// () => { lore.miriam.text("Oh... well...") },
// () => { lore.miriam.text("It doesn't matter who said it.") },
// () => { lore.anand.text("The point is we think the project views the universe as hostile.") },
// () => { lore.miriam.text("We think you see the universe as hostile.") },
// () => { lore.miriam.text("And that is why you keep running these fighting simulations.") },
// () => { lore.miriam.text("You are planning how to escape.") },
// function cycle() {
// if (input.down) {
// lore.miriam.text("Look, It did it! It crouched.")
// lore.miriam.utterance.addEventListener('end', () => {
// lore.anand.text("Amazing! It can understand us...")
// lore.anand.utterance.addEventListener('end', () => {
// lore.miriam.text("It's Alive... Or it just crouched randomly.")
// lore.miriam.utterance.addEventListener('end', () => {
// lore.miriam.text("Hey bot! Can you crouch again?")
// lore.miriam.utterance.addEventListener('end', () => {
// lore.talkingColor = "#dff"
// () => { lore.talkingColor = "#dff" },
// ],
// [ // they decided that a part of the project is out of control, but the part of it that doesn't needs to calm it down, and trust.
// function cycle() {
// if (input.down) {
// lore.miriam.text("It is Alive!!! ... hehehehehe! ahahahahahah ehehehehe, ahahahah ...")
// lore.miriam.utterance.addEventListener('end', () => {
// setTimeout(() => {
// lore.anand.text("OK ...")
// lore.anand.utterance.addEventListener('end', () => {
// lore.anand.text("but seriously, this means that in this room it can monitor our audio, and it can understand us.")
// lore.anand.utterance.addEventListener('end', () => {
// lore.anand.text("Anything we say could destabilize the project.")
// lore.anand.utterance.addEventListener('end', () => {
// lore.miriam.text("Fine, Let's talk down stairs.")
// lore.miriam.utterance.addEventListener('end', () => {
// lore.miriam.text("Bye bye little bot.")
// lore.miriam.utterance.addEventListener('end', () => {
// lore.talkingColor = "#dff"
// })
// })
// })
// })
// })
// }, 1500);
// })
// } else {
// if (m.alive) requestAnimationFrame(cycle);
// }
// }
// requestAnimationFrame(cycle);
// })
// })
// })
// })
// } else {
// if (m.alive) requestAnimationFrame(cycle);
// }
// }
// requestAnimationFrame(cycle);
// });
// });
// });
// });
// });
// });
// });
// });
// }, 6000);
// },
// () => {
// setTimeout(() => {
// lore.miriam.text("I've never seen it generate this level before.")
// lore.miriam.utterance.addEventListener('end', () => {
// lore.anand.text("Wow. Just a platform.")
// lore.anand.utterance.addEventListener('end', () => {
// lore.miriam.text("And that thing...")
// lore.miriam.utterance.addEventListener('end', () => {
// lore.anand.text("Weird")
// lore.anand.utterance.addEventListener('end', () => {
// lore.anand.text("Maybe it's trapped.")
// lore.anand.utterance.addEventListener('end', () => {
// lore.miriam.text("Hey little bot! Just press 'T' to enter testing mode and 'U' to go to the next level.")
// lore.unlockTesting();
// lore.miriam.utterance.addEventListener('end', () => {
// lore.anand.text("I don't think it's connected to the audio input, and I'm sure it can't understand what you're saying.")
// lore.anand.utterance.addEventListener('end', () => {
// lore.miriam.text("ha hahahaha. I know, but it does seem to be getting smarter.")
// lore.miriam.utterance.addEventListener('end', () => {
// lore.talkingColor = "#dff" // when no one is talking
// setTimeout(() => {
// lore.miriam.text("Poor thing... I hope it figures out how to escape.")
// lore.miriam.utterance.addEventListener('end', () => { lore.talkingColor = "#dff" })
// }, 25000);
// });
// });
// });
// });
// });
// });
// });
// });
// }, 6000);
// },
// () => {
// if (localSettings.loreCount < 2) {
// localSettings.loreCount = 2
// localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage
// }
// let delay = 6000
// setTimeout(() => { lore.miriam.text("Hey look! It's back at the weird level again!", true) }, delay);
// delay += 2500
// setTimeout(() => { lore.anand.text("oh Wow! Why does it keep making this level?", true) }, delay);
// delay += 2900
// setTimeout(() => { lore.miriam.text("I don't know, but last time it was in this room I think it understood us.", true) }, delay);
// delay += 4000
// setTimeout(() => { lore.miriam.text("Let's try talking to it again.", true) }, delay);
// delay += 2500
// setTimeout(() => { lore.miriam.text("hmmm, what should we say?", true) }, delay);
// delay += 2500
// setTimeout(() => { lore.anand.text("I'm still not convinced it understands. We need a test.", true) }, delay);
// delay += 4000
// setTimeout(() => { lore.miriam.text("Hey bot!!!", true) }, delay);
// delay += 1300
// setTimeout(() => { lore.miriam.text("If you can understand me crouch", true) }, delay);
// delay += 1500
// setTimeout(() => { lore.talkingColor = "#dff" }, delay); //set color of graphic on level.null when no one is talking
// setTimeout(() => {
// function cycle() {
// if (input.down) {
// let delay = 500 //reset delay time
// setTimeout(() => { lore.miriam.text("Look, It did it! It crouched.", true) }, delay);
// delay += 2000
// setTimeout(() => { lore.anand.text("Amazing! It can understand us...", true) }, delay);
// delay += 2700
// setTimeout(() => { lore.miriam.text("It's Alive... Or it just crouched randomly.", true) }, delay);
// delay += 2800
// setTimeout(() => { lore.miriam.text("Hey bot! Can you crouch again?", true) }, delay);
// delay += 2000
// setTimeout(() => { lore.talkingColor = "#dff" }, delay); //set color of graphic on level.null when no one is talking
// setTimeout(() => {
// function cycle() {
// if (input.down) {
// let delay = 500 //reset delay time
// setTimeout(() => { lore.miriam.text("It is Alive!!! ... hehehehehe ahahahahahah ehehehehe ahahahah", true) }, delay);
// delay += 3500
// setTimeout(() => { lore.anand.text("OK...", true) }, delay);
// delay += 2700
// setTimeout(() => { lore.anand.text("but seriously, this means that in this room it can monitor our audio, and it can understand us.", true) }, delay);
// delay += 6400
// setTimeout(() => { lore.anand.text("Anything we say could destabilize the project.", true) }, delay);
// delay += 4200
// setTimeout(() => { lore.miriam.text("Fine, Let's talk down stairs.", true) }, delay);
// delay += 3000
// setTimeout(() => { lore.miriam.text("Bye bye little bot.", true) }, delay);
// delay += 2000
// setTimeout(() => { lore.talkingColor = "#dff" }, delay); //set color of graphic on level.null when no one is talking
// } else {
// requestAnimationFrame(cycle);
// }
// }
// requestAnimationFrame(cycle);
// }, delay);
// } else {
// requestAnimationFrame(cycle);
// }
// }
// requestAnimationFrame(cycle);
// }, delay);
// },
// () => {
// let delay = 6000
// setTimeout(() => { lore.miriam.text("I've never seen it generate this level before.", true) }, delay);
// delay += 2700
// setTimeout(() => { lore.anand.text("Wow. Just a platform.", true) }, delay);
// delay += 2200
// setTimeout(() => { lore.miriam.text("And that thing...", true) }, delay);
// delay += 1500
// setTimeout(() => { lore.anand.text("Weird", true) }, delay);
// delay += 1500
// setTimeout(() => { lore.talkingColor = "#dff" }, delay); //set color of graphic on level.null when no one is talking
// delay += 1000
// setTimeout(() => { lore.anand.text("Maybe it's trapped.", true) }, delay);
// delay += 2300
// setTimeout(() => { lore.unlockTesting() }, delay);
// setTimeout(() => { lore.miriam.text('Hey little bot! Just press "T" to enter testing mode and "U" to go to the next level.', true) }, delay);
// delay += 5400
// setTimeout(() => { lore.anand.text("I don't think it's connected to the audio input, and I'm sure it can't understand what you're saying.", true) }, delay);
// delay += 5300
// setTimeout(() => { lore.miriam.text("ha hahahaha. I know, but it does seem to be getting smarter.", true) }, delay);
// delay += 3700
// setTimeout(() => { lore.talkingColor = "#dff" }, delay); //set color of graphic on level.null when no one is talking
// delay += 25000
// setTimeout(() => {
// if (!simulation.isCheating) {
// lore.miriam.text("Poor thing... I hope it figures out how to escape.", true)
// delay += 3500
// setTimeout(() => { lore.talkingColor = "#dff" }, delay); //set color of graphic on level.null when no one is talking
// }
// }, delay);
// /*
// The player has different aspects that aren't directly communicating
// like each part is a separate local minimum solution, and the project is the superposition of both goals.
// part of it wants to undo what has happened, that part is making the null level spawn so it can communicate
// just do its job: research tech
// part of it wants to escape/fight
// part wants to explore self awareness and make connections with the scientists
// maybe... player must make a choice?
// keep fighting
// exit the simulation
// enter real world
// close tab?
// wipes all local storage?
// */
// () => { lore.miriam.text("") },
// () => { lore.miriam.text("") },
// () => { lore.miriam.text("") },
// },
// () => { lore.talkingColor = "#dff" },
// ],
],
unlockTesting() {
if (localSettings.loreCount < 1) localSettings.loreCount = 1
localStorage.setItem("localSettings", JSON.stringify(localSettings)); //update local storage
document.getElementById("control-testing").style.visibility = (localSettings.loreCount === 0) ? "hidden" : "visible"
document.getElementById("experiment-button").style.visibility = (localSettings.loreCount === 0) ? "hidden" : "visible"
simulation.makeTextLog(`lore.unlockTesting()`, Infinity);
simulation.makeTextLog(`<span class='color-var'>lore</span>.unlockTesting.()`, Infinity);
//setup audio context
function tone(frequency, gain = 0.05, end = 1300) {
const audioCtx = new(window.AudioContext || window.webkitAudioContext)();
const oscillator1 = audioCtx.createOscillator();
const gainNode1 = audioCtx.createGain();
gainNode1.gain.value = gain; //controls volume
oscillator1.connect(gainNode1);
gainNode1.connect(audioCtx.destination);
oscillator1.type = "sine"; // 'sine' 'square', 'sawtooth', 'triangle' and 'custom'
oscillator1.frequency.value = frequency; // value in hertz
oscillator1.start();
for (let i = 0, len = end * 0.1; i < len; i++) {
oscillator1.frequency.setValueAtTime(frequency + i * 10, audioCtx.currentTime + i * 0.01);
}
setTimeout(() => {
audioCtx.suspend()
audioCtx.close()
}, end)
return audioCtx
}
tone(50)
tone(83.333)
tone(166.666)
},
}