mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-25 18:50:56 +02:00
added grow, weaken, and time compression
This commit is contained in:
@@ -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();
|
||||
}
|
||||
Reference in New Issue
Block a user