fix exp not loading, kinda

This commit is contained in:
Olivier Gagnon 2022-07-19 13:09:56 -04:00
parent c977a9def7
commit b409e58447
6 changed files with 45 additions and 47 deletions

@ -104,7 +104,7 @@ export const CONSTANTS: {
MilliPerCycle: 200, MilliPerCycle: 200,
// How much reputation is needed to join a megacorporation's faction // How much reputation is needed to join a megacorporation's faction
CorpFactionRepRequirement: 200e3, CorpFactionRepRequirement: 400e3,
// Base RAM costs // Base RAM costs
BaseCostFor1GBOfRamHome: 32000, BaseCostFor1GBOfRamHome: 32000,

@ -1,52 +1,47 @@
import { IMap } from "../../types";
import { CONSTANTS } from "../../Constants"; import { CONSTANTS } from "../../Constants";
import { IPlayer } from "../IPlayer"; import { IPlayer } from "../IPlayer";
import { Multipliers } from "../Multipliers";
export const calculateEntropy = (player: IPlayer, stacks = 1): IMap<number> => { export const calculateEntropy = (player: IPlayer, stacks = 1): Multipliers => {
const multipliers: Record<string, number> = { const nerf = CONSTANTS.EntropyEffect ** stacks;
hacking_chance: player.mults.hacking_chance, return {
hacking_speed: player.mults.hacking_speed, hacking_chance: player.mults.hacking_chance * nerf,
hacking_money: player.mults.hacking_money, hacking_speed: player.mults.hacking_speed * nerf,
hacking_grow: player.mults.hacking_grow, hacking_money: player.mults.hacking_money * nerf,
hacking_grow: player.mults.hacking_grow * nerf,
hacking: player.mults.hacking, hacking: player.mults.hacking * nerf,
strength: player.mults.strength, strength: player.mults.strength * nerf,
defense: player.mults.defense, defense: player.mults.defense * nerf,
dexterity: player.mults.dexterity, dexterity: player.mults.dexterity * nerf,
agility: player.mults.agility, agility: player.mults.agility * nerf,
charisma: player.mults.charisma, charisma: player.mults.charisma * nerf,
hacking_exp: player.mults.hacking_exp, hacking_exp: player.mults.hacking_exp * nerf,
strength_exp: player.mults.strength_exp, strength_exp: player.mults.strength_exp * nerf,
defense_exp: player.mults.defense_exp, defense_exp: player.mults.defense_exp * nerf,
dexterity_exp: player.mults.dexterity_exp, dexterity_exp: player.mults.dexterity_exp * nerf,
agility_exp: player.mults.agility_exp, agility_exp: player.mults.agility_exp * nerf,
charisma_exp: player.mults.charisma_exp, charisma_exp: player.mults.charisma_exp * nerf,
company_rep: player.mults.company_rep, company_rep: player.mults.company_rep * nerf,
faction_rep: player.mults.faction_rep, faction_rep: player.mults.faction_rep * nerf,
crime_money: player.mults.crime_money, crime_money: player.mults.crime_money * nerf,
crime_success: player.mults.crime_success, crime_success: player.mults.crime_success * nerf,
hacknet_node_money: player.mults.hacknet_node_money, hacknet_node_money: player.mults.hacknet_node_money * nerf,
hacknet_node_purchase_cost: player.mults.hacknet_node_purchase_cost, hacknet_node_purchase_cost: player.mults.hacknet_node_purchase_cost * nerf,
hacknet_node_ram_cost: player.mults.hacknet_node_ram_cost, hacknet_node_ram_cost: player.mults.hacknet_node_ram_cost * nerf,
hacknet_node_core_cost: player.mults.hacknet_node_core_cost, hacknet_node_core_cost: player.mults.hacknet_node_core_cost * nerf,
hacknet_node_level_cost: player.mults.hacknet_node_level_cost, 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_max_stamina: player.mults.bladeburner_max_stamina * nerf,
bladeburner_stamina_gain: player.mults.bladeburner_stamina_gain, bladeburner_stamina_gain: player.mults.bladeburner_stamina_gain * nerf,
bladeburner_analysis: player.mults.bladeburner_analysis, bladeburner_analysis: player.mults.bladeburner_analysis * nerf,
bladeburner_success_chance: player.mults.bladeburner_success_chance, 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.reapplyAllAugmentations();
this.reapplyAllSourceFiles(); this.reapplyAllSourceFiles();
const newMultipliers = calculateEntropy(this, stacks); this.mults = calculateEntropy(this, stacks);
for (const [mult, val] of Object.entries(newMultipliers)) {
this.setMult(mult, val);
}
} }

@ -53,6 +53,7 @@ import { Player } from "../../Player";
import { isCompanyWork } from "../../Work/CompanyWork"; import { isCompanyWork } from "../../Work/CompanyWork";
import { defaultMultipliers } from "../Multipliers"; import { defaultMultipliers } from "../Multipliers";
import { serverMetadata } from "../../Server/data/servers";
export function init(this: IPlayer): void { export function init(this: IPlayer): void {
/* Initialize Player's home computer */ /* 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: // the requirements for the specified company. There are two requirements:
// 1. High enough reputation // 1. High enough reputation
// 2. Player is employed at the company // 2. Player is employed at the company
function checkMegacorpRequirements(companyName: string, repNeeded = CONSTANTS.CorpFactionRepRequirement): boolean { function checkMegacorpRequirements(companyName: string): boolean {
return allCompanies.includes(companyName) && getCompanyRep(companyName) > repNeeded; 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 //Illuminati

@ -250,6 +250,7 @@ const Engine: {
startExploits(); startExploits();
setupUncaughtPromiseHandler(); setupUncaughtPromiseHandler();
// Load game from save or create new game // Load game from save or create new game
if (loadGame(saveString)) { if (loadGame(saveString)) {
ThemeEvents.emit(); ThemeEvents.emit();

@ -232,7 +232,6 @@ export function CharacterStats(): React.ReactElement {
const mults = getBitNodeMultipliers(n, Math.min(player.sourceFileLvl(n) + 1, maxSfLevel)); const mults = getBitNodeMultipliers(n, Math.min(player.sourceFileLvl(n) + 1, maxSfLevel));
showBitNodeMults = !isEqual(mults, defaultMultipliers); showBitNodeMults = !isEqual(mults, defaultMultipliers);
} }
return ( return (
<Container maxWidth="lg" disableGutters sx={{ mx: 0 }}> <Container maxWidth="lg" disableGutters sx={{ mx: 0 }}>
<Typography variant="h4">Stats</Typography> <Typography variant="h4">Stats</Typography>