added grow, weaken, and time compression

This commit is contained in:
Olivier Gagnon
2021-10-04 19:58:34 -04:00
parent 33ea31be87
commit c47a5bc8cc
22 changed files with 254 additions and 71 deletions

View File

@@ -11,10 +11,11 @@ Source-File minus 1 is extremely weak because it can be fully level up quickly.
*/
export enum Exploit {
UndocumentedFunctionCall = "UndocumentedFunctionCall",
Unclickable = "Unclickable",
PrototypeTampering = "PrototypeTampering",
Bypass = "Bypass",
PrototypeTampering = "PrototypeTampering",
Unclickable = "Unclickable",
UndocumentedFunctionCall = "UndocumentedFunctionCall",
TimeCompression = "TimeCompression",
// To the players reading this. Yes you're supposed to add EditSaveFile by
// editing your save file, yes you could add them all, no we don't care
// that's not the point.
@@ -24,11 +25,12 @@ export enum Exploit {
const names: {
[key: string]: string;
} = {
UndocumentedFunctionCall: "by looking beyond the documentation.",
Bypass: "by circumventing the ram cost of document.",
EditSaveFile: "by editing your save file.",
PrototypeTampering: "by tampering with Numbers prototype.",
TimeCompression: "by compressing time",
Unclickable: "by clicking the unclickable.",
Bypass: "by circumventing the ram cost of document.",
UndocumentedFunctionCall: "by looking beyond the documentation.",
};
export function ExploitName(exploit: string): string {

35
src/Exploits/loops.ts Normal file
View File

@@ -0,0 +1,35 @@
import { Player } from "../Player";
import { Exploit } from "./Exploit";
function tampering(): void {
if (Player.exploits.includes(Exploit.PrototypeTampering)) return;
// Tampering
const a = 55;
setInterval(function () {
if (a.toExponential() !== "5.5e+1") {
Player.giveExploit(Exploit.PrototypeTampering);
}
}, 15 * 60 * 1000); // 15 minutes
}
function timeCompression(): void {
if (Player.exploits.includes(Exploit.TimeCompression)) return;
// Time compression
let last = new Date().getTime();
function minute(): void {
const now = new Date().getTime();
if (now - last < 500) {
// time has been compressed.
Player.giveExploit(Exploit.TimeCompression);
return;
}
last = now;
setTimeout(minute, 1000);
}
setTimeout(minute, 1000);
}
export function startExploits(): void {
tampering();
timeCompression();
}

View File

@@ -1,11 +0,0 @@
import { Player } from "../Player";
import { Exploit } from "./Exploit";
export function startTampering(): void {
const a = 55;
setInterval(function () {
if (a.toExponential() !== "5.5e+1") {
Player.giveExploit(Exploit.PrototypeTampering);
}
}, 15 * 60 * 1000); // 15 minutes
}