diff --git a/doc/source/v1.0.0_migration.rst b/doc/source/v1.0.0_migration.rst index 2d6cd04ee..6ad6d2659 100644 --- a/doc/source/v1.0.0_migration.rst +++ b/doc/source/v1.0.0_migration.rst @@ -16,6 +16,8 @@ migrated (only for ns2): not migrated (require manual changes sometimes): +* getPlayer().hacking_skill renamed `hacking` +* same thing in sleeves * getPurchasedServers won't let you query for ips instead of hostnames. * getStats is deprecated in favor getPlayer * getCharacterInformation is deprecated in favor getPlayer diff --git a/src/Bladeburner/Action.tsx b/src/Bladeburner/Action.tsx index 3b88dd196..f59d97ade 100644 --- a/src/Bladeburner/Action.tsx +++ b/src/Bladeburner/Action.tsx @@ -224,7 +224,7 @@ export class Action implements IAction { let high = real + diff; const city = inst.getCurrentCity(); const r = city.pop / city.popEst; - + console.log(`${est} ${real}`); if (r < 1) low *= r; else high *= r; return [clamp(low), clamp(high)]; diff --git a/src/Bladeburner/Bladeburner.tsx b/src/Bladeburner/Bladeburner.tsx index 6f1b2148c..d97d55ee1 100644 --- a/src/Bladeburner/Bladeburner.tsx +++ b/src/Bladeburner/Bladeburner.tsx @@ -1424,7 +1424,7 @@ export class Bladeburner implements IBladeburner { case ActionTypes["Field Analysis"]: { // Does not use stamina. Effectiveness depends on hacking, int, and cha let eff = - 0.04 * Math.pow(player.hacking_skill, 0.3) + + 0.04 * Math.pow(player.hacking, 0.3) + 0.04 * Math.pow(player.intelligence, 0.9) + 0.02 * Math.pow(player.charisma, 0.3); eff *= player.bladeburner_analysis_mult; diff --git a/src/Crime/Crime.ts b/src/Crime/Crime.ts index 7f18c505c..4551677a2 100644 --- a/src/Crime/Crime.ts +++ b/src/Crime/Crime.ts @@ -110,7 +110,7 @@ export class Crime { successRate(p: IPlayerOrSleeve): number { let chance: number = - this.hacking_success_weight * p.hacking_skill + + this.hacking_success_weight * p.hacking + this.strength_success_weight * p.strength + this.defense_success_weight * p.defense + this.dexterity_success_weight * p.dexterity + diff --git a/src/Crime/formulas/crime.ts b/src/Crime/formulas/crime.ts index 1e3bb9da2..0a896028b 100644 --- a/src/Crime/formulas/crime.ts +++ b/src/Crime/formulas/crime.ts @@ -12,7 +12,7 @@ export interface ICrime { } export interface IPerson { - hacking_skill: number; + hacking: number; strength: number; defense: number; dexterity: number; @@ -24,7 +24,7 @@ export interface IPerson { export function calculateCrimeSuccessChance(crime: ICrime, person: IPerson): number { let chance: number = - crime.hacking_success_weight * person.hacking_skill + + crime.hacking_success_weight * person.hacking + crime.strength_success_weight * person.strength + crime.defense_success_weight * person.defense + crime.dexterity_success_weight * person.dexterity + diff --git a/src/Hacking.ts b/src/Hacking.ts index 237d98438..adb6ef44e 100644 --- a/src/Hacking.ts +++ b/src/Hacking.ts @@ -9,7 +9,7 @@ import { Server } from "./Server/Server"; export function calculateHackingChance(server: Server, player: IPlayer): number { const hackFactor = 1.75; const difficultyMult = (100 - server.hackDifficulty) / 100; - const skillMult = hackFactor * player.hacking_skill; + const skillMult = hackFactor * player.hacking; const skillChance = (skillMult - server.requiredHackingSkill) / skillMult; const chance = skillChance * difficultyMult * player.hacking_chance_mult * calculateIntelligenceBonus(player.intelligence, 1); @@ -48,7 +48,7 @@ export function calculatePercentMoneyHacked(server: Server, player: IPlayer): nu const balanceFactor = 240; const difficultyMult = (100 - server.hackDifficulty) / 100; - const skillMult = (player.hacking_skill - (server.requiredHackingSkill - 1)) / player.hacking_skill; + const skillMult = (player.hacking - (server.requiredHackingSkill - 1)) / player.hacking; const percentMoneyHacked = (difficultyMult * skillMult * player.hacking_money_mult) / balanceFactor; if (percentMoneyHacked < 0) { return 0; @@ -71,7 +71,7 @@ export function calculateHackingTime(server: Server, player: IPlayer): number { const diffFactor = 2.5; let skillFactor = diffFactor * difficultyMult + baseDiff; // tslint:disable-next-line - skillFactor /= player.hacking_skill + baseSkill; + skillFactor /= player.hacking + baseSkill; const hackTimeMultiplier = 5; const hackingTime = diff --git a/src/Hacking/netscriptCanHack.ts b/src/Hacking/netscriptCanHack.ts index 12035232e..ec47aaed9 100644 --- a/src/Hacking/netscriptCanHack.ts +++ b/src/Hacking/netscriptCanHack.ts @@ -36,7 +36,7 @@ export function netscriptCanHack(server: Server, p: IPlayer): IReturnStatus { } const s = server; - if (s.requiredHackingSkill > p.hacking_skill) { + if (s.requiredHackingSkill > p.hacking) { return { res: false, msg: `Cannot hack ${server.hostname} server because your hacking skill is not high enough`, diff --git a/src/Message/MessageHelpers.ts b/src/Message/MessageHelpers.ts index 8635ff25c..8493f1f2e 100644 --- a/src/Message/MessageHelpers.ts +++ b/src/Message/MessageHelpers.ts @@ -73,26 +73,26 @@ function checkForMessagesToSend(): void { if (!redPillFlag) { sendMessage(redpill); } - } else if (jumper0 && !jumper0.recvd && Player.hacking_skill >= 25) { + } else if (jumper0 && !jumper0.recvd && Player.hacking >= 25) { sendMessage(jumper0); const flightName = Programs.Flight.name; const homeComp = Player.getHomeComputer(); if (!homeComp.programs.includes(flightName)) { homeComp.programs.push(flightName); } - } else if (jumper1 && !jumper1.recvd && Player.hacking_skill >= 40) { + } else if (jumper1 && !jumper1.recvd && Player.hacking >= 40) { sendMessage(jumper1); - } else if (cybersecTest && !cybersecTest.recvd && Player.hacking_skill >= 50) { + } else if (cybersecTest && !cybersecTest.recvd && Player.hacking >= 50) { sendMessage(cybersecTest); - } else if (jumper2 && !jumper2.recvd && Player.hacking_skill >= 175) { + } else if (jumper2 && !jumper2.recvd && Player.hacking >= 175) { sendMessage(jumper2); - } else if (nitesecTest && !nitesecTest.recvd && Player.hacking_skill >= 200) { + } else if (nitesecTest && !nitesecTest.recvd && Player.hacking >= 200) { sendMessage(nitesecTest); - } else if (jumper3 && !jumper3.recvd && Player.hacking_skill >= 350) { + } else if (jumper3 && !jumper3.recvd && Player.hacking >= 350) { sendMessage(jumper3); - } else if (jumper4 && !jumper4.recvd && Player.hacking_skill >= 490) { + } else if (jumper4 && !jumper4.recvd && Player.hacking >= 490) { sendMessage(jumper4); - } else if (bitrunnersTest && !bitrunnersTest.recvd && Player.hacking_skill >= 500) { + } else if (bitrunnersTest && !bitrunnersTest.recvd && Player.hacking >= 500) { sendMessage(bitrunnersTest); } } diff --git a/src/NetscriptFunctions.ts b/src/NetscriptFunctions.ts index 027fbe9de..9f3b94e53 100644 --- a/src/NetscriptFunctions.ts +++ b/src/NetscriptFunctions.ts @@ -1229,8 +1229,8 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS { getHackingLevel: function (): any { updateDynamicRam("getHackingLevel", getRamCost("getHackingLevel")); Player.updateSkillLevels(); - workerScript.log("getHackingLevel", `returned ${Player.hacking_skill}`); - return Player.hacking_skill; + workerScript.log("getHackingLevel", `returned ${Player.hacking}`); + return Player.hacking; }, getHackingMultipliers: function (): any { updateDynamicRam("getHackingMultipliers", getRamCost("getHackingMultipliers")); @@ -2085,7 +2085,7 @@ export function NetscriptFunctions(workerScript: WorkerScript): NS { helper.updateDynamicRam("getPlayer", getRamCost("getPlayer")); const data = { - hacking_skill: Player.hacking_skill, + hacking: Player.hacking, hp: Player.hp, max_hp: Player.max_hp, strength: Player.strength, diff --git a/src/NetscriptFunctions/Singularity.ts b/src/NetscriptFunctions/Singularity.ts index e81c8bf14..e7e48e144 100644 --- a/src/NetscriptFunctions/Singularity.ts +++ b/src/NetscriptFunctions/Singularity.ts @@ -630,7 +630,7 @@ export function NetscriptSingularity( workerScript.log("getStats", `getStats is deprecated, please use getplayer`); return { - hacking: player.hacking_skill, + hacking: player.hacking, strength: player.strength, defense: player.defense, dexterity: player.dexterity, diff --git a/src/NetscriptFunctions/Sleeve.ts b/src/NetscriptFunctions/Sleeve.ts index ff173eefe..904cb800f 100644 --- a/src/NetscriptFunctions/Sleeve.ts +++ b/src/NetscriptFunctions/Sleeve.ts @@ -139,7 +139,7 @@ export function NetscriptSleeve(player: IPlayer, workerScript: WorkerScript, hel getSleeveStats: function (asleeveNumber: any = 0): { shock: number; sync: number; - hacking_skill: number; + hacking: number; strength: number; defense: number; dexterity: number; @@ -155,7 +155,7 @@ export function NetscriptSleeve(player: IPlayer, workerScript: WorkerScript, hel return { shock: 100 - sl.shock, sync: sl.sync, - hacking_skill: sl.hacking_skill, + hacking: sl.hacking, strength: sl.strength, defense: sl.defense, dexterity: sl.dexterity, diff --git a/src/PersonObjects/IPlayer.ts b/src/PersonObjects/IPlayer.ts index 2cb61d4b6..85b028e5b 100644 --- a/src/PersonObjects/IPlayer.ts +++ b/src/PersonObjects/IPlayer.ts @@ -73,7 +73,7 @@ export interface IPlayer { totalPlaytime: number; // Stats - hacking_skill: number; + hacking: number; strength: number; defense: number; dexterity: number; diff --git a/src/PersonObjects/IPlayerOrSleeve.ts b/src/PersonObjects/IPlayerOrSleeve.ts index 8d25d39ea..366c31dde 100644 --- a/src/PersonObjects/IPlayerOrSleeve.ts +++ b/src/PersonObjects/IPlayerOrSleeve.ts @@ -3,7 +3,7 @@ export interface IPlayerOrSleeve { // Stats - hacking_skill: number; + hacking: number; strength: number; defense: number; dexterity: number; diff --git a/src/PersonObjects/Person.ts b/src/PersonObjects/Person.ts index 78f1a560a..1367590d9 100644 --- a/src/PersonObjects/Person.ts +++ b/src/PersonObjects/Person.ts @@ -35,7 +35,7 @@ export abstract class Person { /** * Stats */ - hacking_skill = 1; + hacking = 1; strength = 1; defense = 1; dexterity = 1; @@ -136,7 +136,7 @@ export abstract class Person { getFactionFieldWorkRepGain(): number { const t = (0.9 * - (this.hacking_skill / CONSTANTS.MaxSkillLevel + + (this.hacking / CONSTANTS.MaxSkillLevel + this.strength / CONSTANTS.MaxSkillLevel + this.defense / CONSTANTS.MaxSkillLevel + this.dexterity / CONSTANTS.MaxSkillLevel + @@ -151,7 +151,7 @@ export abstract class Person { * when doing Hacking Work for a faction */ getFactionHackingWorkRepGain(): number { - return (this.hacking_skill / CONSTANTS.MaxSkillLevel) * this.faction_rep_mult; + return (this.hacking / CONSTANTS.MaxSkillLevel) * this.faction_rep_mult; } /** @@ -161,7 +161,7 @@ export abstract class Person { getFactionSecurityWorkRepGain(): number { const t = (0.9 * - (this.hacking_skill / CONSTANTS.MaxSkillLevel + + (this.hacking / CONSTANTS.MaxSkillLevel + this.strength / CONSTANTS.MaxSkillLevel + this.defense / CONSTANTS.MaxSkillLevel + this.dexterity / CONSTANTS.MaxSkillLevel + @@ -201,7 +201,7 @@ export abstract class Person { * Update all stat levels */ updateStatLevels(): void { - this.hacking_skill = Math.max( + this.hacking = Math.max( 1, Math.floor(this.calculateStat(this.hacking_exp, this.hacking_mult * BitNodeMultipliers.HackingLevelMultiplier)), ); diff --git a/src/PersonObjects/Player/PlayerObject.ts b/src/PersonObjects/Player/PlayerObject.ts index 580b5182b..62d5b3f3f 100644 --- a/src/PersonObjects/Player/PlayerObject.ts +++ b/src/PersonObjects/Player/PlayerObject.ts @@ -80,7 +80,7 @@ export class PlayerObject implements IPlayer { totalPlaytime: number; // Stats - hacking_skill: number; + hacking: number; strength: number; defense: number; dexterity: number; @@ -287,7 +287,7 @@ export class PlayerObject implements IPlayer { constructor() { //Skills and stats - this.hacking_skill = 1; + this.hacking = 1; //Combat stats this.hp = 10; diff --git a/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx b/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx index e8f44ecec..c7d1bd21f 100644 --- a/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx +++ b/src/PersonObjects/Player/PlayerObjectGeneralMethods.tsx @@ -86,7 +86,7 @@ export function prestigeAugmentation(this: PlayerObject): void { this.karma = 0; //Reset stats - this.hacking_skill = 1; + this.hacking = 1; this.strength = 1; this.defense = 1; @@ -228,7 +228,7 @@ export function calculateSkill(this: IPlayer, exp: number, mult = 1): number { } export function updateSkillLevels(this: IPlayer): void { - this.hacking_skill = Math.max( + this.hacking = Math.max( 1, Math.floor(this.calculateSkill(this.hacking_exp, this.hacking_mult * BitNodeMultipliers.HackingLevelMultiplier)), ); @@ -378,7 +378,7 @@ export function gainHackingExp(this: IPlayer, exp: number): void { this.hacking_exp = 0; } - this.hacking_skill = calculateSkillF(this.hacking_exp, this.hacking_mult * BitNodeMultipliers.HackingLevelMultiplier); + this.hacking = calculateSkillF(this.hacking_exp, this.hacking_mult * BitNodeMultipliers.HackingLevelMultiplier); } export function gainStrengthExp(this: IPlayer, exp: number): void { @@ -464,7 +464,7 @@ export function gainIntelligenceExp(this: IPlayer, exp: number): void { export function queryStatFromString(this: IPlayer, str: string): number { const tempStr = str.toLowerCase(); if (tempStr.includes("hack")) { - return this.hacking_skill; + return this.hacking; } if (tempStr.includes("str")) { return this.strength; @@ -856,7 +856,7 @@ export function startFactionHackWork(this: IPlayer, router: IRouter, faction: Fa this.workHackExpGainRate = 0.15 * this.hacking_exp_mult * BitNodeMultipliers.FactionWorkExpGain; this.workRepGainRate = - ((this.hacking_skill + this.intelligence) / CONSTANTS.MaxSkillLevel) * + ((this.hacking + this.intelligence) / CONSTANTS.MaxSkillLevel) * this.faction_rep_mult * this.getIntelligenceBonus(0.5); @@ -1180,7 +1180,7 @@ export function getWorkRepGain(this: IPlayer): number { } let jobPerformance = companyPosition.calculateJobPerformance( - this.hacking_skill, + this.hacking, this.strength, this.defense, this.dexterity, @@ -1200,7 +1200,7 @@ export function getWorkRepGain(this: IPlayer): number { } // export function getFactionSecurityWorkRepGain(this: IPlayer) { -// var t = 0.9 * (this.hacking_skill / CONSTANTS.MaxSkillLevel + +// var t = 0.9 * (this.hacking / CONSTANTS.MaxSkillLevel + // this.strength / CONSTANTS.MaxSkillLevel + // this.defense / CONSTANTS.MaxSkillLevel + // this.dexterity / CONSTANTS.MaxSkillLevel + @@ -1209,7 +1209,7 @@ export function getWorkRepGain(this: IPlayer): number { // } // export function getFactionFieldWorkRepGain(this: IPlayer) { -// var t = 0.9 * (this.hacking_skill / CONSTANTS.MaxSkillLevel + +// var t = 0.9 * (this.hacking / CONSTANTS.MaxSkillLevel + // this.strength / CONSTANTS.MaxSkillLevel + // this.defense / CONSTANTS.MaxSkillLevel + // this.dexterity / CONSTANTS.MaxSkillLevel + @@ -1234,7 +1234,7 @@ export function startCreateProgramWork( //Time needed to complete work affected by hacking skill (linearly based on //ratio of (your skill - required level) to MAX skill) - //var timeMultiplier = (CONSTANTS.MaxSkillLevel - (this.hacking_skill - reqLevel)) / CONSTANTS.MaxSkillLevel; + //var timeMultiplier = (CONSTANTS.MaxSkillLevel - (this.hacking - reqLevel)) / CONSTANTS.MaxSkillLevel; //if (timeMultiplier > 1) {timeMultiplier = 1;} //if (timeMultiplier < 0.01) {timeMultiplier = 0.01;} this.createProgramReqLvl = reqLevel; @@ -1264,7 +1264,7 @@ export function startCreateProgramWork( export function createProgramWork(this: IPlayer, numCycles: number): boolean { //Higher hacking skill will allow you to create programs faster const reqLvl = this.createProgramReqLvl; - let skillMult = (this.hacking_skill / reqLvl) * this.getIntelligenceBonus(3); //This should always be greater than 1; + let skillMult = (this.hacking / reqLvl) * this.getIntelligenceBonus(3); //This should always be greater than 1; skillMult = 1 + (skillMult - 1) / 5; //The divider constant can be adjusted as necessary //Skill multiplier directly applied to "time worked" @@ -1293,7 +1293,7 @@ export function finishCreateProgramWork(this: IPlayer, cancelled: boolean): stri } if (!cancelled) { - this.gainIntelligenceExp(CONSTANTS.IntelligenceProgramBaseExpGain * this.timeWorked/1000); + this.gainIntelligenceExp((CONSTANTS.IntelligenceProgramBaseExpGain * this.timeWorked) / 1000); } this.isWorking = false; @@ -1977,7 +1977,7 @@ export function isQualified(this: IPlayer, company: Company, position: CompanyPo const reqCharisma = position.requiredCharisma > 0 ? position.requiredCharisma + offset : 0; if ( - this.hacking_skill >= reqHacking && + this.hacking >= reqHacking && this.strength >= reqStrength && this.defense >= reqDefense && this.dexterity >= reqDexterity && @@ -2035,6 +2035,7 @@ export function reapplyAllSourceFiles(this: IPlayer): void { applySourceFile(this.sourceFiles[i]); } applyExploit(); + this.updateSkillLevels(); } /*************** Check for Faction Invitations *************/ @@ -2075,7 +2076,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { !illuminatiFac.alreadyInvited && numAugmentations >= 30 && this.money.gte(150000000000) && - this.hacking_skill >= 1500 && + this.hacking >= 1500 && this.strength >= 1200 && this.defense >= 1200 && this.dexterity >= 1200 && @@ -2092,7 +2093,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { !daedalusFac.alreadyInvited && numAugmentations >= Math.round(30 * BitNodeMultipliers.DaedalusAugsRequirement) && this.money.gte(100000000000) && - (this.hacking_skill >= 2500 || + (this.hacking >= 2500 || (this.strength >= 1500 && this.defense >= 1500 && this.dexterity >= 1500 && this.agility >= 1500)) ) { invitedFactions.push(daedalusFac); @@ -2106,7 +2107,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { !covenantFac.alreadyInvited && numAugmentations >= 20 && this.money.gte(75000000000) && - this.hacking_skill >= 850 && + this.hacking >= 850 && this.strength >= 850 && this.defense >= 850 && this.dexterity >= 850 && @@ -2356,7 +2357,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { !speakersforthedeadFac.isBanned && !speakersforthedeadFac.isMember && !speakersforthedeadFac.alreadyInvited && - this.hacking_skill >= 100 && + this.hacking >= 100 && this.strength >= 300 && this.defense >= 300 && this.dexterity >= 300 && @@ -2375,7 +2376,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { !thedarkarmyFac.isBanned && !thedarkarmyFac.isMember && !thedarkarmyFac.alreadyInvited && - this.hacking_skill >= 300 && + this.hacking >= 300 && this.strength >= 300 && this.defense >= 300 && this.dexterity >= 300 && @@ -2395,7 +2396,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { !thesyndicateFac.isBanned && !thesyndicateFac.isMember && !thesyndicateFac.alreadyInvited && - this.hacking_skill >= 200 && + this.hacking >= 200 && this.strength >= 200 && this.defense >= 200 && this.dexterity >= 200 && @@ -2480,7 +2481,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { !netburnersFac.isBanned && !netburnersFac.isMember && !netburnersFac.alreadyInvited && - this.hacking_skill >= 80 && + this.hacking >= 80 && totalHacknetRam >= 8 && totalHacknetCores >= 4 && totalHacknetLevels >= 100 @@ -2495,7 +2496,7 @@ export function checkForFactionInvitations(this: IPlayer): Faction[] { !tiandihuiFac.isMember && !tiandihuiFac.alreadyInvited && this.money.gte(1000000) && - this.hacking_skill >= 50 && + this.hacking >= 50 && (this.city == CityName.Chongqing || this.city == CityName.NewTokyo || this.city == CityName.Ishima) ) { invitedFactions.push(tiandihuiFac); diff --git a/src/PersonObjects/Resleeving/ui/ResleeveElem.tsx b/src/PersonObjects/Resleeving/ui/ResleeveElem.tsx index 4f2f0b7e6..69d58961b 100644 --- a/src/PersonObjects/Resleeving/ui/ResleeveElem.tsx +++ b/src/PersonObjects/Resleeving/ui/ResleeveElem.tsx @@ -123,7 +123,7 @@ export function ResleeveElem(props: IProps): React.ReactElement { - Hacking: {numeralWrapper.formatSkill(props.resleeve.hacking_skill)} ( + Hacking: {numeralWrapper.formatSkill(props.resleeve.hacking)} ( {numeralWrapper.formatExp(props.resleeve.hacking_exp)} exp)
Strength: {numeralWrapper.formatSkill(props.resleeve.strength)} ( diff --git a/src/PersonObjects/Resleeving/ui/ResleeveRoot.tsx b/src/PersonObjects/Resleeving/ui/ResleeveRoot.tsx index 7fb47048e..5e0a7d139 100644 --- a/src/PersonObjects/Resleeving/ui/ResleeveRoot.tsx +++ b/src/PersonObjects/Resleeving/ui/ResleeveRoot.tsx @@ -58,7 +58,7 @@ const SortFunctions: { TotalNumAugmentations: (a: Resleeve, b: Resleeve) => number; } = { Cost: (a: Resleeve, b: Resleeve): number => a.getCost() - b.getCost(), - Hacking: (a: Resleeve, b: Resleeve): number => a.hacking_skill - b.hacking_skill, + Hacking: (a: Resleeve, b: Resleeve): number => a.hacking - b.hacking, Strength: (a: Resleeve, b: Resleeve): number => a.strength - b.strength, Defense: (a: Resleeve, b: Resleeve): number => a.defense - b.defense, Dexterity: (a: Resleeve, b: Resleeve): number => a.dexterity - b.dexterity, @@ -68,8 +68,8 @@ const SortFunctions: { getAverage(a.strength, a.defense, a.dexterity, a.agility) - getAverage(b.strength, b.defense, b.dexterity, b.agility), AverageAllStats: (a: Resleeve, b: Resleeve): number => - getAverage(a.hacking_skill, a.strength, a.defense, a.dexterity, a.agility, a.charisma) - - getAverage(b.hacking_skill, b.strength, b.defense, b.dexterity, b.agility, b.charisma), + getAverage(a.hacking, a.strength, a.defense, a.dexterity, a.agility, a.charisma) - + getAverage(b.hacking, b.strength, b.defense, b.dexterity, b.agility, b.charisma), TotalNumAugmentations: (a: Resleeve, b: Resleeve): number => a.augmentations.length - b.augmentations.length, }; diff --git a/src/PersonObjects/Sleeve/Sleeve.ts b/src/PersonObjects/Sleeve/Sleeve.ts index 2b71c1de7..1a10fed60 100644 --- a/src/PersonObjects/Sleeve/Sleeve.ts +++ b/src/PersonObjects/Sleeve/Sleeve.ts @@ -397,7 +397,7 @@ export class Sleeve extends Person { } const jobPerformance: number = companyPosition.calculateJobPerformance( - this.hacking_skill, + this.hacking, this.strength, this.defense, this.dexterity, diff --git a/src/PersonObjects/Sleeve/ui/MoreStatsModal.tsx b/src/PersonObjects/Sleeve/ui/MoreStatsModal.tsx index 5e27cf00f..62e680faf 100644 --- a/src/PersonObjects/Sleeve/ui/MoreStatsModal.tsx +++ b/src/PersonObjects/Sleeve/ui/MoreStatsModal.tsx @@ -17,7 +17,7 @@ export function MoreStatsModal(props: IProps): React.ReactElement { rows={[ [ <>Hacking: , - props.sleeve.hacking_skill, + props.sleeve.hacking, <> ({numeralWrapper.formatExp(props.sleeve.hacking_exp)} exp), ], [ diff --git a/src/PersonObjects/Sleeve/ui/StatsElement.tsx b/src/PersonObjects/Sleeve/ui/StatsElement.tsx index 60538ee09..9e51214fc 100644 --- a/src/PersonObjects/Sleeve/ui/StatsElement.tsx +++ b/src/PersonObjects/Sleeve/ui/StatsElement.tsx @@ -17,7 +17,7 @@ export function StatsElement(props: IProps): React.ReactElement { , ], ["City: ", <>{props.sleeve.city}], - ["Hacking: ", <>{numeralWrapper.formatSkill(props.sleeve.hacking_skill)}], + ["Hacking: ", <>{numeralWrapper.formatSkill(props.sleeve.hacking)}], ["Strength: ", <>{numeralWrapper.formatSkill(props.sleeve.strength)}], ["Defense: ", <>{numeralWrapper.formatSkill(props.sleeve.defense)}], ["Dexterity: ", <>{numeralWrapper.formatSkill(props.sleeve.dexterity)}], diff --git a/src/PersonObjects/formulas/reputation.ts b/src/PersonObjects/formulas/reputation.ts index b73391df6..f3995a31c 100644 --- a/src/PersonObjects/formulas/reputation.ts +++ b/src/PersonObjects/formulas/reputation.ts @@ -13,7 +13,7 @@ function mult(f: Faction): number { export function getHackingWorkRepGain(p: IPlayer, f: Faction): number { return ( - ((p.hacking_skill + p.intelligence / 3) / CONSTANTS.MaxSkillLevel) * + ((p.hacking + p.intelligence / 3) / CONSTANTS.MaxSkillLevel) * p.faction_rep_mult * p.getIntelligenceBonus(1) * mult(f) @@ -23,7 +23,7 @@ export function getHackingWorkRepGain(p: IPlayer, f: Faction): number { export function getFactionSecurityWorkRepGain(p: IPlayer, f: Faction): number { const t = (0.9 * - (p.hacking_skill / CONSTANTS.MaxSkillLevel + + (p.hacking / CONSTANTS.MaxSkillLevel + p.strength / CONSTANTS.MaxSkillLevel + p.defense / CONSTANTS.MaxSkillLevel + p.dexterity / CONSTANTS.MaxSkillLevel + @@ -36,7 +36,7 @@ export function getFactionSecurityWorkRepGain(p: IPlayer, f: Faction): number { export function getFactionFieldWorkRepGain(p: IPlayer, f: Faction): number { const t = (0.9 * - (p.hacking_skill / CONSTANTS.MaxSkillLevel + + (p.hacking / CONSTANTS.MaxSkillLevel + p.strength / CONSTANTS.MaxSkillLevel + p.defense / CONSTANTS.MaxSkillLevel + p.dexterity / CONSTANTS.MaxSkillLevel + diff --git a/src/Programs/data/ProgramsMetadata.ts b/src/Programs/data/ProgramsMetadata.ts index 66fe5c88b..5f6cd2678 100644 --- a/src/Programs/data/ProgramsMetadata.ts +++ b/src/Programs/data/ProgramsMetadata.ts @@ -14,13 +14,13 @@ import { calculateHackingTime, calculateGrowTime, calculateWeakenTime } from ".. function requireHackingLevel(lvl: number) { return function (p: IPlayer) { - return p.hacking_skill >= lvl; + return p.hacking >= lvl; }; } function bitFlumeRequirements() { return function (p: IPlayer) { - return p.sourceFiles.length > 0 && p.hacking_skill >= 1; + return p.sourceFiles.length > 0 && p.hacking >= 1; }; } @@ -306,12 +306,11 @@ export const programsMetadata: IProgramCreationParams[] = [ create: null, run: (router: IRouter, terminal: ITerminal, player: IPlayer): void => { const numAugReq = Math.round(BitNodeMultipliers.DaedalusAugsRequirement * 30); - const fulfilled = - player.augmentations.length >= numAugReq && player.money.gt(1e11) && player.hacking_skill >= 2500; + const fulfilled = player.augmentations.length >= numAugReq && player.money.gt(1e11) && player.hacking >= 2500; if (!fulfilled) { terminal.print(`Augmentations: ${player.augmentations.length} / ${numAugReq}`); terminal.print(`Money: ${numeralWrapper.formatMoney(player.money.toNumber())} / $100b`); - terminal.print(`Hacking skill: ${player.hacking_skill} / 2500`); + terminal.print(`Hacking skill: ${player.hacking} / 2500`); return; } diff --git a/src/SaveObject.tsx b/src/SaveObject.tsx index 0aebe95b4..b46d69888 100755 --- a/src/SaveObject.tsx +++ b/src/SaveObject.tsx @@ -293,7 +293,6 @@ function loadGame(saveString: string): boolean { if (saveObj.hasOwnProperty("VersionSave")) { try { const ver = JSON.parse(saveObj.VersionSave, Reviver); - console.log(ver); evaluateVersionCompatibility(ver); if (window.location.href.toLowerCase().includes("bitburner-beta")) { diff --git a/src/ScriptEditor/NetscriptDefinitions.d.ts b/src/ScriptEditor/NetscriptDefinitions.d.ts index d9e8f3fc9..15f447ae3 100644 --- a/src/ScriptEditor/NetscriptDefinitions.d.ts +++ b/src/ScriptEditor/NetscriptDefinitions.d.ts @@ -2,7 +2,7 @@ * @public */ interface Player { - hacking_skill: number; + hacking: number; hp: number; max_hp: number; strength: number; @@ -815,7 +815,7 @@ export interface SleeveSkills { /** current sync of the sleeve [0-100] */ sync: number; /** current hacking skill of the sleeve */ - hacking_skill: number; + hacking: number; /** current strength of the sleeve */ strength: number; /** current defense of the sleeve */ diff --git a/src/Terminal/commands/backdoor.ts b/src/Terminal/commands/backdoor.ts index 7c0736fdd..ce9ca785e 100644 --- a/src/Terminal/commands/backdoor.ts +++ b/src/Terminal/commands/backdoor.ts @@ -29,7 +29,7 @@ export function backdoor( ); } else if (!normalServer.hasAdminRights) { terminal.error("You do not have admin rights for this machine! Cannot backdoor"); - } else if (normalServer.requiredHackingSkill > player.hacking_skill) { + } else if (normalServer.requiredHackingSkill > player.hacking) { terminal.error( "Your hacking skill is not high enough to use backdoor on this machine. Try analyzing the machine to determine the required hacking skill", ); diff --git a/src/Terminal/commands/grow.ts b/src/Terminal/commands/grow.ts index 8ef66bebb..39797fc60 100644 --- a/src/Terminal/commands/grow.ts +++ b/src/Terminal/commands/grow.ts @@ -34,7 +34,7 @@ export function grow( terminal.error("You do not have admin rights for this machine! Cannot grow"); return; } - if (normalServer.requiredHackingSkill > player.hacking_skill) { + if (normalServer.requiredHackingSkill > player.hacking) { terminal.error( "Your hacking skill is not high enough to attempt hacking this machine. Try analyzing the machine to determine the required hacking skill", ); diff --git a/src/Terminal/commands/hack.ts b/src/Terminal/commands/hack.ts index 4fb0a6c6f..32e886b3a 100644 --- a/src/Terminal/commands/hack.ts +++ b/src/Terminal/commands/hack.ts @@ -34,7 +34,7 @@ export function hack( terminal.error("You do not have admin rights for this machine! Cannot hack"); return; } - if (normalServer.requiredHackingSkill > player.hacking_skill) { + if (normalServer.requiredHackingSkill > player.hacking) { terminal.error( "Your hacking skill is not high enough to attempt hacking this machine. Try analyzing the machine to determine the required hacking skill", ); diff --git a/src/Terminal/commands/weaken.ts b/src/Terminal/commands/weaken.ts index 3cf9f3f28..41d738152 100644 --- a/src/Terminal/commands/weaken.ts +++ b/src/Terminal/commands/weaken.ts @@ -34,7 +34,7 @@ export function weaken( terminal.error("You do not have admin rights for this machine! Cannot weaken"); return; } - if (normalServer.requiredHackingSkill > player.hacking_skill) { + if (normalServer.requiredHackingSkill > player.hacking) { terminal.error( "Your hacking skill is not high enough to attempt hacking this machine. Try analyzing the machine to determine the required hacking skill", ); diff --git a/src/ui/CharacterStats.tsx b/src/ui/CharacterStats.tsx index 4297e97a2..b738aac67 100644 --- a/src/ui/CharacterStats.tsx +++ b/src/ui/CharacterStats.tsx @@ -303,7 +303,7 @@ export function CharacterStats(): React.ReactElement { Hacking:  - {numeralWrapper.formatSkill(player.hacking_skill)}  + {numeralWrapper.formatSkill(player.hacking)}  ({numeralWrapper.formatExp(player.hacking_exp)} exp) diff --git a/src/ui/React/CharacterOverview.tsx b/src/ui/React/CharacterOverview.tsx index 6056c3a97..b2c3725d4 100644 --- a/src/ui/React/CharacterOverview.tsx +++ b/src/ui/React/CharacterOverview.tsx @@ -192,9 +192,7 @@ export function CharacterOverview({ save, killScripts }: IProps): React.ReactEle Hack  - - {numeralWrapper.formatSkill(player.hacking_skill)} - + {numeralWrapper.formatSkill(player.hacking)} diff --git a/src/ui/React/ThemeEditorModal.tsx b/src/ui/React/ThemeEditorModal.tsx index 5abfb80b3..4af6ca956 100644 --- a/src/ui/React/ThemeEditorModal.tsx +++ b/src/ui/React/ThemeEditorModal.tsx @@ -63,6 +63,14 @@ export function ThemeEditorModal(props: IProps): React.ReactElement { ...Settings.theme, }); + function resetTheme(): void { + setCustomTheme({ + ...defaultSettings.theme, + }); + Object.assign(Settings.theme, defaultSettings.theme); + ThemeEvents.emit(); + } + function onThemeChange(event: React.ChangeEvent): void { try { const importedTheme = JSON.parse(event.target.value); @@ -299,7 +307,18 @@ export function ThemeEditorModal(props: IProps): React.ReactElement { />

- + + + + ), + }} + /> ); }