mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-20 05:05:47 +01:00
fix exp not loading, kinda
This commit is contained in:
parent
c977a9def7
commit
b409e58447
@ -104,7 +104,7 @@ export const CONSTANTS: {
|
||||
MilliPerCycle: 200,
|
||||
|
||||
// How much reputation is needed to join a megacorporation's faction
|
||||
CorpFactionRepRequirement: 200e3,
|
||||
CorpFactionRepRequirement: 400e3,
|
||||
|
||||
// Base RAM costs
|
||||
BaseCostFor1GBOfRamHome: 32000,
|
||||
|
@ -1,52 +1,47 @@
|
||||
import { IMap } from "../../types";
|
||||
import { CONSTANTS } from "../../Constants";
|
||||
|
||||
import { IPlayer } from "../IPlayer";
|
||||
import { Multipliers } from "../Multipliers";
|
||||
|
||||
export const calculateEntropy = (player: IPlayer, stacks = 1): IMap<number> => {
|
||||
const multipliers: Record<string, number> = {
|
||||
hacking_chance: player.mults.hacking_chance,
|
||||
hacking_speed: player.mults.hacking_speed,
|
||||
hacking_money: player.mults.hacking_money,
|
||||
hacking_grow: player.mults.hacking_grow,
|
||||
export const calculateEntropy = (player: IPlayer, stacks = 1): Multipliers => {
|
||||
const nerf = CONSTANTS.EntropyEffect ** stacks;
|
||||
return {
|
||||
hacking_chance: player.mults.hacking_chance * nerf,
|
||||
hacking_speed: player.mults.hacking_speed * nerf,
|
||||
hacking_money: player.mults.hacking_money * nerf,
|
||||
hacking_grow: player.mults.hacking_grow * nerf,
|
||||
|
||||
hacking: player.mults.hacking,
|
||||
strength: player.mults.strength,
|
||||
defense: player.mults.defense,
|
||||
dexterity: player.mults.dexterity,
|
||||
agility: player.mults.agility,
|
||||
charisma: player.mults.charisma,
|
||||
hacking: player.mults.hacking * nerf,
|
||||
strength: player.mults.strength * nerf,
|
||||
defense: player.mults.defense * nerf,
|
||||
dexterity: player.mults.dexterity * nerf,
|
||||
agility: player.mults.agility * nerf,
|
||||
charisma: player.mults.charisma * nerf,
|
||||
|
||||
hacking_exp: player.mults.hacking_exp,
|
||||
strength_exp: player.mults.strength_exp,
|
||||
defense_exp: player.mults.defense_exp,
|
||||
dexterity_exp: player.mults.dexterity_exp,
|
||||
agility_exp: player.mults.agility_exp,
|
||||
charisma_exp: player.mults.charisma_exp,
|
||||
hacking_exp: player.mults.hacking_exp * nerf,
|
||||
strength_exp: player.mults.strength_exp * nerf,
|
||||
defense_exp: player.mults.defense_exp * nerf,
|
||||
dexterity_exp: player.mults.dexterity_exp * nerf,
|
||||
agility_exp: player.mults.agility_exp * nerf,
|
||||
charisma_exp: player.mults.charisma_exp * nerf,
|
||||
|
||||
company_rep: player.mults.company_rep,
|
||||
faction_rep: player.mults.faction_rep,
|
||||
company_rep: player.mults.company_rep * nerf,
|
||||
faction_rep: player.mults.faction_rep * nerf,
|
||||
|
||||
crime_money: player.mults.crime_money,
|
||||
crime_success: player.mults.crime_success,
|
||||
crime_money: player.mults.crime_money * nerf,
|
||||
crime_success: player.mults.crime_success * nerf,
|
||||
|
||||
hacknet_node_money: player.mults.hacknet_node_money,
|
||||
hacknet_node_purchase_cost: player.mults.hacknet_node_purchase_cost,
|
||||
hacknet_node_ram_cost: player.mults.hacknet_node_ram_cost,
|
||||
hacknet_node_core_cost: player.mults.hacknet_node_core_cost,
|
||||
hacknet_node_level_cost: player.mults.hacknet_node_level_cost,
|
||||
hacknet_node_money: player.mults.hacknet_node_money * nerf,
|
||||
hacknet_node_purchase_cost: player.mults.hacknet_node_purchase_cost * nerf,
|
||||
hacknet_node_ram_cost: player.mults.hacknet_node_ram_cost * nerf,
|
||||
hacknet_node_core_cost: player.mults.hacknet_node_core_cost * nerf,
|
||||
hacknet_node_level_cost: player.mults.hacknet_node_level_cost * nerf,
|
||||
|
||||
work_money: player.mults.work_money,
|
||||
work_money: player.mults.work_money * nerf,
|
||||
|
||||
bladeburner_max_stamina: player.mults.bladeburner_max_stamina,
|
||||
bladeburner_stamina_gain: player.mults.bladeburner_stamina_gain,
|
||||
bladeburner_analysis: player.mults.bladeburner_analysis,
|
||||
bladeburner_success_chance: player.mults.bladeburner_success_chance,
|
||||
bladeburner_max_stamina: player.mults.bladeburner_max_stamina * nerf,
|
||||
bladeburner_stamina_gain: player.mults.bladeburner_stamina_gain * nerf,
|
||||
bladeburner_analysis: player.mults.bladeburner_analysis * nerf,
|
||||
bladeburner_success_chance: player.mults.bladeburner_success_chance * nerf,
|
||||
};
|
||||
|
||||
for (const [mult, val] of Object.entries(multipliers)) {
|
||||
multipliers[mult] = val * CONSTANTS.EntropyEffect ** stacks;
|
||||
}
|
||||
|
||||
return multipliers;
|
||||
};
|
||||
|
@ -32,8 +32,5 @@ export function applyEntropy(this: IPlayer, stacks = 1): void {
|
||||
this.reapplyAllAugmentations();
|
||||
this.reapplyAllSourceFiles();
|
||||
|
||||
const newMultipliers = calculateEntropy(this, stacks);
|
||||
for (const [mult, val] of Object.entries(newMultipliers)) {
|
||||
this.setMult(mult, val);
|
||||
}
|
||||
this.mults = calculateEntropy(this, stacks);
|
||||
}
|
||||
|
@ -53,6 +53,7 @@ import { Player } from "../../Player";
|
||||
|
||||
import { isCompanyWork } from "../../Work/CompanyWork";
|
||||
import { defaultMultipliers } from "../Multipliers";
|
||||
import { serverMetadata } from "../../Server/data/servers";
|
||||
|
||||
export function init(this: IPlayer): void {
|
||||
/* Initialize Player's home computer */
|
||||
@ -842,8 +843,13 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] {
|
||||
// the requirements for the specified company. There are two requirements:
|
||||
// 1. High enough reputation
|
||||
// 2. Player is employed at the company
|
||||
function checkMegacorpRequirements(companyName: string, repNeeded = CONSTANTS.CorpFactionRepRequirement): boolean {
|
||||
return allCompanies.includes(companyName) && getCompanyRep(companyName) > repNeeded;
|
||||
function checkMegacorpRequirements(companyName: string): boolean {
|
||||
const serverMeta = serverMetadata.find((s) => s.specialName === companyName);
|
||||
const server = GetServer(serverMeta ? serverMeta.hostname : "");
|
||||
const bonus = (server as Server).backdoorInstalled ? -100e3 : 0;
|
||||
return (
|
||||
allCompanies.includes(companyName) && getCompanyRep(companyName) > CONSTANTS.CorpFactionRepRequirement + bonus
|
||||
);
|
||||
}
|
||||
|
||||
//Illuminati
|
||||
|
@ -250,6 +250,7 @@ const Engine: {
|
||||
startExploits();
|
||||
setupUncaughtPromiseHandler();
|
||||
// Load game from save or create new game
|
||||
|
||||
if (loadGame(saveString)) {
|
||||
ThemeEvents.emit();
|
||||
|
||||
|
@ -232,7 +232,6 @@ export function CharacterStats(): React.ReactElement {
|
||||
const mults = getBitNodeMultipliers(n, Math.min(player.sourceFileLvl(n) + 1, maxSfLevel));
|
||||
showBitNodeMults = !isEqual(mults, defaultMultipliers);
|
||||
}
|
||||
|
||||
return (
|
||||
<Container maxWidth="lg" disableGutters sx={{ mx: 0 }}>
|
||||
<Typography variant="h4">Stats</Typography>
|
||||
|
Loading…
Reference in New Issue
Block a user