mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-05-02 05:47:14 +02:00
prettify, sorry for the big ass commit
This commit is contained in:
+18
-19
@@ -11,31 +11,30 @@ 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',
|
||||
// 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'
|
||||
UndocumentedFunctionCall = "UndocumentedFunctionCall",
|
||||
Unclickable = "Unclickable",
|
||||
PrototypeTampering = "PrototypeTampering",
|
||||
Bypass = "Bypass",
|
||||
// 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;
|
||||
[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.',
|
||||
'Bypass': 'by circumventing the ram cost of document.',
|
||||
}
|
||||
|
||||
UndocumentedFunctionCall: "by looking beyond the documentation.",
|
||||
EditSaveFile: "by editing your save file.",
|
||||
PrototypeTampering: "by tampering with Numbers prototype.",
|
||||
Unclickable: "by clicking the unclickable.",
|
||||
Bypass: "by circumventing the ram cost of document.",
|
||||
};
|
||||
|
||||
export function ExploitName(exploit: string): string {
|
||||
return names[exploit];
|
||||
return names[exploit];
|
||||
}
|
||||
|
||||
export function sanitizeExploits(exploits: string[]): string[] {
|
||||
return exploits.filter((e: string) => Object.keys(Exploit).includes(e));
|
||||
}
|
||||
return exploits.filter((e: string) => Object.keys(Exploit).includes(e));
|
||||
}
|
||||
|
||||
@@ -1,42 +1,42 @@
|
||||
import { Player } from "../Player";
|
||||
|
||||
export function applyExploit(): void {
|
||||
if (Player.exploits && Player.exploits.length === 0) {
|
||||
return;
|
||||
}
|
||||
const inc = Math.pow(1.001, Player.exploits.length);
|
||||
const dec = Math.pow(0.999, Player.exploits.length);
|
||||
if (Player.exploits && Player.exploits.length === 0) {
|
||||
return;
|
||||
}
|
||||
const inc = Math.pow(1.001, Player.exploits.length);
|
||||
const dec = Math.pow(0.999, Player.exploits.length);
|
||||
|
||||
Player.hacking_chance_mult *= inc;
|
||||
Player.hacking_speed_mult *= inc;
|
||||
Player.hacking_money_mult *= inc;
|
||||
Player.hacking_grow_mult *= inc;
|
||||
Player.hacking_mult *= inc;
|
||||
Player.hacking_chance_mult *= inc;
|
||||
Player.hacking_speed_mult *= inc;
|
||||
Player.hacking_money_mult *= inc;
|
||||
Player.hacking_grow_mult *= inc;
|
||||
Player.hacking_mult *= inc;
|
||||
|
||||
Player.strength_mult *= inc;
|
||||
Player.defense_mult *= inc;
|
||||
Player.dexterity_mult *= inc;
|
||||
Player.agility_mult *= inc;
|
||||
Player.charisma_mult *= inc;
|
||||
Player.strength_mult *= inc;
|
||||
Player.defense_mult *= inc;
|
||||
Player.dexterity_mult *= inc;
|
||||
Player.agility_mult *= inc;
|
||||
Player.charisma_mult *= inc;
|
||||
|
||||
Player.hacking_exp_mult *= inc;
|
||||
Player.strength_exp_mult *= inc;
|
||||
Player.defense_exp_mult *= inc;
|
||||
Player.dexterity_exp_mult *= inc;
|
||||
Player.agility_exp_mult *= inc;
|
||||
Player.charisma_exp_mult *= inc;
|
||||
Player.hacking_exp_mult *= inc;
|
||||
Player.strength_exp_mult *= inc;
|
||||
Player.defense_exp_mult *= inc;
|
||||
Player.dexterity_exp_mult *= inc;
|
||||
Player.agility_exp_mult *= inc;
|
||||
Player.charisma_exp_mult *= inc;
|
||||
|
||||
Player.company_rep_mult *= inc;
|
||||
Player.faction_rep_mult *= inc;
|
||||
Player.company_rep_mult *= inc;
|
||||
Player.faction_rep_mult *= inc;
|
||||
|
||||
Player.crime_money_mult *= inc;
|
||||
Player.crime_success_mult *= inc;
|
||||
Player.crime_money_mult *= inc;
|
||||
Player.crime_success_mult *= inc;
|
||||
|
||||
Player.hacknet_node_money_mult *= inc;
|
||||
Player.hacknet_node_purchase_cost_mult *= dec;
|
||||
Player.hacknet_node_ram_cost_mult *= dec;
|
||||
Player.hacknet_node_core_cost_mult *= dec;
|
||||
Player.hacknet_node_level_cost_mult *= dec;
|
||||
Player.hacknet_node_money_mult *= inc;
|
||||
Player.hacknet_node_purchase_cost_mult *= dec;
|
||||
Player.hacknet_node_ram_cost_mult *= dec;
|
||||
Player.hacknet_node_core_cost_mult *= dec;
|
||||
Player.hacknet_node_level_cost_mult *= dec;
|
||||
|
||||
Player.work_money_mult *= inc;
|
||||
Player.work_money_mult *= inc;
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { Player } from "../Player";
|
||||
import { Exploit } from "./Exploit";
|
||||
|
||||
(function() {
|
||||
const a = 55;
|
||||
setInterval(function() {
|
||||
if (a.toExponential() !== "5.5e+1") {
|
||||
Player.giveExploit(Exploit.PrototypeTampering);
|
||||
}
|
||||
}, 15*60*1000); // 15 minutes
|
||||
})()
|
||||
(function () {
|
||||
const a = 55;
|
||||
setInterval(function () {
|
||||
if (a.toExponential() !== "5.5e+1") {
|
||||
Player.giveExploit(Exploit.PrototypeTampering);
|
||||
}
|
||||
}, 15 * 60 * 1000); // 15 minutes
|
||||
})();
|
||||
|
||||
+20
-19
@@ -1,24 +1,25 @@
|
||||
import { Player } from "../Player";
|
||||
import { Exploit } from "./Exploit";
|
||||
|
||||
(function() {
|
||||
function clickTheUnclickable(event: MouseEvent): void {
|
||||
if(!event.target || !(event.target instanceof Element)) return;
|
||||
const display = window.getComputedStyle(event.target as Element).display;
|
||||
if(display === 'none' && event.isTrusted)
|
||||
Player.giveExploit(Exploit.Unclickable);
|
||||
}
|
||||
(function () {
|
||||
function clickTheUnclickable(event: MouseEvent): void {
|
||||
if (!event.target || !(event.target instanceof Element)) return;
|
||||
const display = window.getComputedStyle(event.target as Element).display;
|
||||
if (display === "none" && event.isTrusted)
|
||||
Player.giveExploit(Exploit.Unclickable);
|
||||
}
|
||||
|
||||
function targetElement(): void {
|
||||
const elem = document.getElementById("unclickable");
|
||||
if (elem == null) {
|
||||
console.error(
|
||||
"Could not find the unclickable elem for the related exploit.",
|
||||
);
|
||||
return;
|
||||
}
|
||||
elem.addEventListener("click", clickTheUnclickable);
|
||||
document.removeEventListener("DOMContentLoaded", targetElement);
|
||||
}
|
||||
|
||||
function targetElement(): void {
|
||||
const elem = document.getElementById('unclickable');
|
||||
if(elem == null) {
|
||||
console.error('Could not find the unclickable elem for the related exploit.');
|
||||
return;
|
||||
}
|
||||
elem.addEventListener("click", clickTheUnclickable);
|
||||
document.removeEventListener('DOMContentLoaded', targetElement);
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', targetElement);
|
||||
})();
|
||||
document.addEventListener("DOMContentLoaded", targetElement);
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user