2021-10-05 01:58:34 +02:00
|
|
|
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 {
|
2022-01-05 07:13:11 +01:00
|
|
|
const timer = 1000 * 15;
|
2021-10-05 01:58:34 +02:00
|
|
|
if (Player.exploits.includes(Exploit.TimeCompression)) return;
|
|
|
|
// Time compression
|
2022-01-05 07:13:11 +01:00
|
|
|
let last = performance.now();
|
2021-10-05 01:58:34 +02:00
|
|
|
function minute(): void {
|
2022-01-05 07:13:11 +01:00
|
|
|
const now = performance.now();
|
2021-10-05 01:58:34 +02:00
|
|
|
if (now - last < 500) {
|
|
|
|
// time has been compressed.
|
|
|
|
Player.giveExploit(Exploit.TimeCompression);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
last = now;
|
2022-01-05 07:13:11 +01:00
|
|
|
window.setTimeout(minute, timer);
|
2021-10-05 01:58:34 +02:00
|
|
|
}
|
2022-01-05 07:13:11 +01:00
|
|
|
window.setTimeout(minute, timer);
|
2021-10-05 01:58:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export function startExploits(): void {
|
|
|
|
tampering();
|
|
|
|
timeCompression();
|
|
|
|
}
|