Added sf minus 1, exploits

This commit is contained in:
Olivier Gagnon
2021-03-08 20:31:34 -05:00
parent d9aef91ea3
commit 250841df66
11 changed files with 145 additions and 0 deletions

25
src/Exploits/Exploit.ts Normal file
View File

@@ -0,0 +1,25 @@
/*
*/
export enum Exploit {
UndocumentedFunctionCall = 'UndocumentedFunctionCall',
EditSaveFile = 'EditSaveFile',
PrototypeTampering = 'PrototypeTampering'
}
const names: {
[key: string]: string;
} = {
'UndocumentedFunctionCall': 'by looking beyond the documentation.',
'EditSaveFile': 'by editing your save file.',
'PrototypeTampering': 'by tampering with Numbers prototype.',
}
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));
}

View File

@@ -0,0 +1,42 @@
import { Player } from "../Player";
export function applyExploit() {
if (Player.exploits && Player.exploits.length === 0) {
return;
}
const inc = Math.pow(1.0001, Player.exploits.length);
const dec = Math.pow(0.9999, 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.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.company_rep_mult *= inc;
Player.faction_rep_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.work_money_mult *= inc;
}

11
src/Exploits/tampering.ts Normal file
View File

@@ -0,0 +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
})()