bitburner-src/src/Exploits/Exploit.ts
2021-03-22 14:48:48 -04:00

39 lines
1.5 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 impragmatic 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 developpers 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.
*/
export enum Exploit {
UndocumentedFunctionCall = 'UndocumentedFunctionCall',
Unclickable = 'Unclickable',
PrototypeTampering = 'PrototypeTampering',
// 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: {
[key: string]: string;
} = {
'UndocumentedFunctionCall': 'by looking beyond the documentation.',
'EditSaveFile': 'by editing your save file.',
'PrototypeTampering': 'by tampering with Numbers prototype.',
'Unclickable': 'by clicking the unclickable.',
}
export function ExploitName(exploit: string): string {
return names[exploit];
}
export function sanitizeExploits(exploits: string[]): string[] {
return exploits.filter((e: string) => Object.keys(Exploit).includes(e));
}