mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-29 20:37:05 +02:00
54 lines
2.2 KiB
TypeScript
54 lines
2.2 KiB
TypeScript
/*
|
|
The game cannot block every possible exploits. Specially since one of them is
|
|
that you can just edit your save file and that's impractical to prevent.
|
|
|
|
So instead we have source file minus 1. It is not obtained by destroying a
|
|
BitNode but instead it is awarded when the player finds innovative ways to break
|
|
the game, this serves 2 purpose, [one] the developers don't have to spend time
|
|
trying to implement anti-cheat measures and [two] finding ways to break a
|
|
hacking game is very much in the spirit of the game.
|
|
Source-File minus 1 is extremely weak because it can be fully level up quickly.
|
|
*/
|
|
|
|
// Exploits don't need an enum helper so they are not in an enums file
|
|
export enum Exploit {
|
|
Bypass = "Bypass",
|
|
PrototypeTampering = "PrototypeTampering",
|
|
Unclickable = "Unclickable",
|
|
UndocumentedFunctionCall = "UndocumentedFunctionCall",
|
|
TimeCompression = "TimeCompression",
|
|
RealityAlteration = "RealityAlteration",
|
|
N00dles = "N00dles",
|
|
YoureNotMeantToAccessThis = "YoureNotMeantToAccessThis",
|
|
TrueRecursion = "TrueRecursion",
|
|
INeedARainbow = "INeedARainbow",
|
|
// 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.
|
|
EditSaveFile = "EditSaveFile",
|
|
}
|
|
|
|
const names: Record<Exploit, string> = {
|
|
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.",
|
|
UndocumentedFunctionCall: "by looking beyond the documentation.",
|
|
RealityAlteration: "by altering reality to suit your whims.",
|
|
N00dles: "by harnessing the power of the n00dles.",
|
|
YoureNotMeantToAccessThis: "by accessing the dev menu.",
|
|
TrueRecursion: "by truly recursing.",
|
|
INeedARainbow: "by using the power of the rainbow.",
|
|
};
|
|
|
|
export function ExploitName(exploit: Exploit): string {
|
|
return names[exploit];
|
|
}
|
|
|
|
// Needed in case player edits save file poorly
|
|
export function sanitizeExploits(exploits: Exploit[]): Exploit[] {
|
|
exploits = exploits.filter((e: Exploit) => Object.values(Exploit).includes(e));
|
|
return [...new Set(exploits)];
|
|
}
|