diff --git a/src/Constants.ts b/src/Constants.ts index f5715c92f..a473d9995 100644 --- a/src/Constants.ts +++ b/src/Constants.ts @@ -88,8 +88,8 @@ export const CONSTANTS: { Donations: number; // number of blood/plasma/palette donation the dev have verified., boosts NFG LatestUpdate: string; } = { - VersionString: "2.0.1", - VersionNumber: 24, + VersionString: "2.0.2", + VersionNumber: 25, // Speed (in ms) at which the main loop is updated _idleSpeed: 200, diff --git a/src/PersonObjects/Player/PlayerObjectGeneralMethods.ts b/src/PersonObjects/Player/PlayerObjectGeneralMethods.ts index 1af8e7398..1f46cb368 100644 --- a/src/PersonObjects/Player/PlayerObjectGeneralMethods.ts +++ b/src/PersonObjects/Player/PlayerObjectGeneralMethods.ts @@ -410,7 +410,7 @@ export function gainIntelligenceExp(this: IPerson, exp: number): void { console.error("ERROR: NaN passed into Player.gainIntelligenceExp()"); return; } - if (Player.sourceFileLvl(5) > 0 || this.skills.intelligence > 0) { + if (Player.sourceFileLvl(5) > 0 || this.skills.intelligence > 0 || Player.bitNodeN === 5) { this.exp.intelligence += exp; this.skills.intelligence = Math.floor(this.calculateSkill(this.exp.intelligence, 1)); } diff --git a/src/SaveObject.tsx b/src/SaveObject.tsx index 8cabb475d..5113d210c 100755 --- a/src/SaveObject.tsx +++ b/src/SaveObject.tsx @@ -494,6 +494,168 @@ function evaluateVersionCompatibility(ver: string | number): void { if (ver < 24) { Player.getHomeComputer().scripts.forEach((s) => s.filename.endsWith(".ns") && (s.filename += ".js")); } + if (ver < 25) { + const removePlayerFields = [ + "hacking_chance_mult", + "hacking_speed_mult", + "hacking_money_mult", + "hacking_grow_mult", + "hacking_mult", + "strength_mult", + "defense_mult", + "dexterity_mult", + "agility_mult", + "charisma_mult", + "hacking_exp_mult", + "strength_exp_mult", + "defense_exp_mult", + "dexterity_exp_mult", + "agility_exp_mult", + "charisma_exp_mult", + "company_rep_mult", + "faction_rep_mult", + "crime_money_mult", + "crime_success_mult", + "work_money_mult", + "hacknet_node_money_mult", + "hacknet_node_purchase_cost_mult", + "hacknet_node_ram_cost_mult", + "hacknet_node_core_cost_mult", + "hacknet_node_level_cost_mult", + "bladeburner_max_stamina_mult", + "bladeburner_stamina_gain_mult", + "bladeburner_analysis_mult", + "bladeburner_success_chance_mult", + "hacking_exp", + "strength_exp", + "defense_exp", + "dexterity_exp", + "agility_exp", + "charisma_exp", + "intelligence_exp", + "companyName", + "isWorking", + "workType", + "workCostMult", + "workExpMult", + "currentWorkFactionName", + "currentWorkFactionDescription", + "workHackExpGainRate", + "workStrExpGainRate", + "workDefExpGainRate", + "workDexExpGainRate", + "workAgiExpGainRate", + "workChaExpGainRate", + "workRepGainRate", + "workMoneyGainRate", + "workMoneyLossRate", + "workHackExpGained", + "workStrExpGained", + "workDefExpGained", + "workDexExpGained", + "workAgiExpGained", + "workChaExpGained", + "workRepGained", + "workMoneyGained", + "createProgramName", + "createProgramReqLvl", + "graftAugmentationName", + "timeWorkedGraftAugmentation", + "className", + "crimeType", + "timeWorked", + "timeWorkedCreateProgram", + "timeNeededToCompleteWork", + "factionWorkType", + "committingCrimeThruSingFn", + "singFnCrimeWorkerScript", + "hacking", + "max_hp", + "strength", + "defense", + "dexterity", + "agility", + "charisma", + "intelligence", + ]; + const removeSleeveFields = [ + "gymStatType", + "bbAction", + "bbContract", + "hacking", + "strength", + "defense", + "dexterity", + "agility", + "charisma", + "intelligence", + "max_hp", + "hacking_exp", + "strength_exp", + "defense_exp", + "dexterity_exp", + "agility_exp", + "charisma_exp", + "intelligence_exp", + "hacking_mult", + "strength_mult", + "defense_mult", + "dexterity_mult", + "agility_mult", + "charisma_mult", + "hacking_exp_mult", + "strength_exp_mult", + "defense_exp_mult", + "dexterity_exp_mult", + "agility_exp_mult", + "charisma_exp_mult", + "hacking_chance_mult", + "hacking_speed_mult", + "hacking_money_mult", + "hacking_grow_mult", + "company_rep_mult", + "faction_rep_mult", + "crime_money_mult", + "crime_success_mult", + "work_money_mult", + "hacknet_node_money_mult", + "hacknet_node_purchase_cost_mult", + "hacknet_node_ram_cost_mult", + "hacknet_node_core_cost_mult", + "hacknet_node_level_cost_mult", + "bladeburner_max_stamina_mult", + "bladeburner_stamina_gain_mult", + "bladeburner_analysis_mult", + "bladeburner_success_chance_mult", + "className", + "crimeType", + "currentTask", + "currentTaskLocation", + "currentTaskMaxTime", + "currentTaskTime", + "earningsForSleeves", + "earningsForPlayer", + "earningsForTask", + "factionWorkType", + "gainRatesForTask", + "logs", + ]; + let intExp = Number(anyPlayer.intelligence_exp); + if (isNaN(intExp)) intExp = 0; + anyPlayer.exp.intelligence += intExp; + for (const field of removePlayerFields) { + delete anyPlayer[field]; + } + for (const sleeve of anyPlayer.sleeves) { + const anySleeve = sleeve as any; + let intExp = Number(anySleeve.intelligence_exp); + if (isNaN(intExp)) intExp = 0; + anySleeve.exp.intelligence += intExp; + for (const field of removeSleeveFields) { + delete sleeve[field]; + } + } + } } }