From 7232a786ed9b93cbbaef25cc2aab6505e9effe04 Mon Sep 17 00:00:00 2001 From: Olivier Gagnon Date: Sat, 20 Mar 2021 05:29:53 -0400 Subject: [PATCH] Intelligence rework, most intelligence gain have been multiplied by at least 100, if not more. All intelligence use have been reviewed and often boosted but by a percentage. Typically this means intelligence gives a 2-6% boost to everything for normal players and around 13% for int farmers. --- doc/source/changelog.rst | 50 ++++++++++++++----- .../getHackGrowWeakenTimes.rst | 15 ------ .../netscript/netscriptadvancedfunctions.rst | 1 - .../getAugmentationStats.rst | 14 ++++-- src/Bladeburner/Action.ts | 1 + src/Bladeburner/data/Constants.ts | 2 +- src/Constants.ts | 24 ++++++--- src/Crime/Crime.ts | 1 + src/Crime/Crimes.ts | 14 +++--- src/Hacking.ts | 21 ++++---- src/PersonObjects/IPlayer.ts | 1 + src/PersonObjects/IPlayerOrSleeve.ts | 2 + src/PersonObjects/Person.ts | 9 ++++ .../Player/PlayerObjectGeneralMethods.js | 15 ++++-- src/PersonObjects/Sleeve/Sleeve.ts | 2 +- src/Prestige.js | 2 +- src/RedPill.js | 6 +-- src/engine.jsx | 7 --- 18 files changed, 111 insertions(+), 76 deletions(-) delete mode 100644 doc/source/netscript/advancedfunctions/getHackGrowWeakenTimes.rst diff --git a/doc/source/changelog.rst b/doc/source/changelog.rst index 7d54ab04d..26c111755 100644 --- a/doc/source/changelog.rst +++ b/doc/source/changelog.rst @@ -3,39 +3,65 @@ Changelog ========= +v0.50.0 - 2021-03-20 Intelligence (hydroflame) +---------------------------------------------- + +**Intelligence** + +* int exp gain and effect has been reworked. It is now much more easy to + acquire and far more powerful. The goal here is to feel like players have + another tool in their arsenal. + +**Factions** + +* Hacking factions no longer have hacking level requirements since their associated servers do. + +**Misc.** + +* Sleeve styling. +* number formatting +* remove wiki button in Hacking Missions. +* Fix NaN displayed when very very large numbers are reached. v0.49.2 - 2021-03-13 (hydroflame) -------- +--------------------------------- + +**BN8** -BN8 * A new bitnode multipler has been added, it lets you reduce money from a server without gaining actually any money. This is important for BN8 where hack/grow can influence the stock market. No money can be gained from hacking but server money can still be reduced. -Documentation +**Documentation** + * readthedocs should now be more consistent and many examples were added. -Netscript +**Netscript** + * Ace editor will now correctly highlight all functions. * 'tFormat' is a new netscript function that returns a human readable representation of milliseconds. eg. "2 hours 15 minute 43 seconds" -Gang +**Gang** + * style improvements -Bladeburner +**Bladeburner** + * style improvements * fix bug where 'skill list SKILL' would crash if skill is level 0. -Sleeve +**Sleeve** + * karma gain now scales with sync. -Misc. -Fix issue where the effective stats under Character>Stats were being calculated. +**Misc.** + +* Fix issue where the effective stats under Character>Stats were being calculated. v0.49.0 - 2021-03-11 Source-File -1 (hydroflame) -------- +------------------------------------------------ **Source-File -1** @@ -63,7 +89,7 @@ v0.49.0 - 2021-03-11 Source-File -1 (hydroflame) v0.48.0 - ASCII - 2021-03-07 (hydroflame) -------- +----------------------------------------- **ASCII** @@ -135,7 +161,7 @@ v0.47.2 - 7/15/2019 * Added 'Solarized Dark' theme to CodeMirror editor * After Infiltration, you will now return to the company page rather than the city page * Bug fix: Stock Market UI should no longer crash for certain locale settings -* Bug fix: You can now properly remove unfinished programs (the *.exe-N%-INC files) +* Bug fix: You can now properly remove unfinished programs (the `*.exe-N%-INC` files) * Bug fix: Fixed an issue that allowed you to increase money on servers with a 'maxMoney' of 0 (like CSEC) * Bug fix: Scripts no longer persist if they were started with syntax/import errors * Bug fix: 'hack' and 'analyze' Terminal commands are now blocking diff --git a/doc/source/netscript/advancedfunctions/getHackGrowWeakenTimes.rst b/doc/source/netscript/advancedfunctions/getHackGrowWeakenTimes.rst deleted file mode 100644 index d07130126..000000000 --- a/doc/source/netscript/advancedfunctions/getHackGrowWeakenTimes.rst +++ /dev/null @@ -1,15 +0,0 @@ -getHackTime(), getGrowTime(), & getWeakenTime() -=============================================== - -The :js:func:`getHackTime`, :js:func:`getGrowTime`, and :js:func:`getWeakenTime` -all take an additional third optional parameter for specifying a specific intelligence -level to see how that would affect the hack/grow/weaken times. This parameter -defaults to your current intelligence level. - -(Intelligence is unlocked after obtaining Source-File 5). - -The function signatures are then:: - - getHackTime(hostname/ip[, hackLvl=current level, intLvl=current level]) - getGrowTime(hostname/ip[, hackLvl=current level, intLvl=current level]) - getWeakenTime(hostname/ip[, hackLvl=current level, intLvl=current level]) diff --git a/doc/source/netscript/netscriptadvancedfunctions.rst b/doc/source/netscript/netscriptadvancedfunctions.rst index 796494851..93c2323cb 100644 --- a/doc/source/netscript/netscriptadvancedfunctions.rst +++ b/doc/source/netscript/netscriptadvancedfunctions.rst @@ -9,4 +9,3 @@ they contain spoilers for the game. .. toctree:: getBitNodeMultipliers() - getHackTime(), getGrowTime(), & getWeakenTime() diff --git a/doc/source/netscript/singularityfunctions/getAugmentationStats.rst b/doc/source/netscript/singularityfunctions/getAugmentationStats.rst index 384b568a5..a73a073a4 100644 --- a/doc/source/netscript/singularityfunctions/getAugmentationStats.rst +++ b/doc/source/netscript/singularityfunctions/getAugmentationStats.rst @@ -9,8 +9,12 @@ getAugmentationStats() Netscript Function If you are not in BitNode-4, then you must have Level 3 of Source-File 4 in order to use this function. - ns.getAugmentationStats("Synfibril Muscle") - { - strength_mult: 1.3, - defense_mult: 1.3, - } + Examples: + + .. code-block:: javascript + + ns.getAugmentationStats("Synfibril Muscle") + { + strength_mult: 1.3, + defense_mult: 1.3, + } diff --git a/src/Bladeburner/Action.ts b/src/Bladeburner/Action.ts index 64ea44627..d2b78a011 100644 --- a/src/Bladeburner/Action.ts +++ b/src/Bladeburner/Action.ts @@ -214,6 +214,7 @@ export class Action { competence += (this.weights[stat] * Math.pow(effMultiplier*playerStatLvl, this.decays[stat])); } } + competence *= Player.getIntelligenceBonus(0.75); competence *= inst.calculateStaminaPenalty(); competence *= this.getTeamSuccessBonus(inst); diff --git a/src/Bladeburner/data/Constants.ts b/src/Bladeburner/data/Constants.ts index 62a0ddb3a..33b3d3d69 100644 --- a/src/Bladeburner/data/Constants.ts +++ b/src/Bladeburner/data/Constants.ts @@ -60,7 +60,7 @@ export const BladeburnerConstants: { ChaosThreshold: 50, // City chaos level after which it starts making tasks harder BaseStatGain: 1, // Base stat gain per second - BaseIntGain: 0.001, // Base intelligence stat gain + BaseIntGain: 0.003, // Base intelligence stat gain ActionCountGrowthPeriod: 480, // Time (s) it takes for action count to grow by its specified value diff --git a/src/Constants.ts b/src/Constants.ts index cf7a811c6..88b1c8c7f 100644 --- a/src/Constants.ts +++ b/src/Constants.ts @@ -6,7 +6,7 @@ import { IMap } from "./types"; export let CONSTANTS: IMap = { - Version: "0.49.2", + Version: "0.50.0", /** Max level for any skill, assuming no multipliers. Determined by max numerical value in javascript for experience * and the skill level formula in Player.js. Note that all this means it that when experience hits MAX_INT, then @@ -75,14 +75,14 @@ export let CONSTANTS: IMap = { HospitalCostPerHp: 100e3, // Intelligence-related constants - IntelligenceCrimeWeight: 0.05, // Weight for how much int affects crime success rates + IntelligenceCrimeWeight: 0.025, // Weight for how much int affects crime success rates IntelligenceInfiltrationWeight: 0.1, // Weight for how much int affects infiltration success rates - IntelligenceCrimeBaseExpGain: 0.001, - IntelligenceProgramBaseExpGain: 500, // Program required hack level divided by this to determine int exp gain + IntelligenceCrimeBaseExpGain: 0.05, + IntelligenceProgramBaseExpGain: 2.5, // Program required hack level divided by this to determine int exp gain IntelligenceTerminalHackBaseExpGain: 200, // Hacking exp divided by this to determine int exp gain - IntelligenceSingFnBaseExpGain: 0.002, - IntelligenceClassBaseExpGain: 0.000001, - IntelligenceHackingMissionBaseExpGain: 0.03, // Hacking Mission difficulty multiplied by this to get exp gain + IntelligenceSingFnBaseExpGain: 1.5, + IntelligenceClassBaseExpGain: 0.01, + IntelligenceHackingMissionBaseExpGain: 3, // Hacking Mission difficulty multiplied by this to get exp gain // Hacking Missions // TODO Move this into Hacking Mission implementation @@ -228,12 +228,20 @@ export let CONSTANTS: IMap = { LatestUpdate: ` - v0.49.2 - 2021-03-13 + v0.50.0 - 2021-03-20 Intelligence (hydroflame) ------- + Intelligence + * int exp gain and effect has been reworked. It is now much more easy to + acquire and far more powerful. The goal here is to feel like players have + another tool in their arsenal. + Factions * Hacking factions no longer have hacking level requirements since their associated servers do. Misc. * Sleeve styling. + * number formatting + * remove wiki button in Hacking Missions. + * Fix NaN displayed when very very large numbers are reached. ` } diff --git a/src/Crime/Crime.ts b/src/Crime/Crime.ts index fa54abeb1..176069cf7 100644 --- a/src/Crime/Crime.ts +++ b/src/Crime/Crime.ts @@ -120,6 +120,7 @@ export class Crime { chance /= CONSTANTS.MaxSkillLevel; chance /= this.difficulty; chance *= p.crime_success_mult; + chance *= p.getIntelligenceBonus(1); return Math.min(chance, 1); } diff --git a/src/Crime/Crimes.ts b/src/Crime/Crimes.ts index bb8125127..79e9c7119 100644 --- a/src/Crime/Crimes.ts +++ b/src/Crime/Crimes.ts @@ -21,7 +21,7 @@ export const Crimes: IMap = { dexterity_success_weight: 2, agility_success_weight: 1, - intelligence_exp: 0.25 * CONSTANTS.IntelligenceCrimeBaseExpGain, + intelligence_exp: 7.5 * CONSTANTS.IntelligenceCrimeBaseExpGain, }), Mug: new Crime("Mug", CONSTANTS.CrimeMug, 4e3, 36e3, 1/5, 0.25, { @@ -45,7 +45,7 @@ export const Crimes: IMap = { dexterity_success_weight: 1, agility_success_weight: 1, - intelligence_exp: 0.5 * CONSTANTS.IntelligenceCrimeBaseExpGain, + intelligence_exp: 15 * CONSTANTS.IntelligenceCrimeBaseExpGain, }), DealDrugs: new Crime("Deal Drugs", CONSTANTS.CrimeDrugs, 10e3, 120e3, 1, 0.5, { @@ -66,7 +66,7 @@ export const Crimes: IMap = { hacking_success_weight: 0.05, dexterity_success_weight: 1.25, - intelligence_exp: 2 * CONSTANTS.IntelligenceCrimeBaseExpGain, + intelligence_exp: 60 * CONSTANTS.IntelligenceCrimeBaseExpGain, }), TraffickArms: new Crime("Traffick Arms", CONSTANTS.CrimeTraffickArms, 40e3, 600e3, 2, 1, { @@ -110,7 +110,7 @@ export const Crimes: IMap = { agility_success_weight: 2, charisma_success_weight: 2, - intelligence_exp: CONSTANTS.IntelligenceCrimeBaseExpGain, + intelligence_exp: 16 * CONSTANTS.IntelligenceCrimeBaseExpGain, }), Kidnap: new Crime("Kidnap", CONSTANTS.CrimeKidnap, 120e3, 3.6e6, 5, 6, { @@ -125,7 +125,7 @@ export const Crimes: IMap = { dexterity_success_weight: 1, agility_success_weight: 1, - intelligence_exp: 2 * CONSTANTS.IntelligenceCrimeBaseExpGain, + intelligence_exp: 26 * CONSTANTS.IntelligenceCrimeBaseExpGain, }), Assassination: new Crime("Assassination", CONSTANTS.CrimeAssassination, 300e3, 12e6, 8, 10, { @@ -138,7 +138,7 @@ export const Crimes: IMap = { dexterity_success_weight: 2, agility_success_weight: 1, - intelligence_exp: 5 * CONSTANTS.IntelligenceCrimeBaseExpGain, + intelligence_exp: 65 * CONSTANTS.IntelligenceCrimeBaseExpGain, kills: 1, }), @@ -158,6 +158,6 @@ export const Crimes: IMap = { agility_success_weight: 1, charisma_success_weight: 1, - intelligence_exp: 10 * CONSTANTS.IntelligenceCrimeBaseExpGain, + intelligence_exp: 130 * CONSTANTS.IntelligenceCrimeBaseExpGain, }), }; diff --git a/src/Hacking.ts b/src/Hacking.ts index fc3681e0d..61bca59a4 100644 --- a/src/Hacking.ts +++ b/src/Hacking.ts @@ -8,11 +8,10 @@ import { HacknetServer } from "./Hacknet/HacknetServer"; */ export function calculateHackingChance(server: Server): number { const hackFactor = 1.75; - const intFactor = 0.2; const difficultyMult = (100 - server.hackDifficulty) / 100; - const skillMult = (hackFactor * Player.hacking_skill) + (intFactor * Player.intelligence); + const skillMult = hackFactor * Player.hacking_skill; const skillChance = (skillMult - server.requiredHackingSkill) / skillMult; - const chance = skillChance * difficultyMult * Player.hacking_chance_mult; + const chance = skillChance * difficultyMult * Player.hacking_chance_mult * Player.getIntelligenceBonus(1); if (chance > 1) { return 1; } if (chance < 0) { return 0; } @@ -55,21 +54,19 @@ export function calculatePercentMoneyHacked(server: Server): number { /** * Returns time it takes to complete a hack on a server, in seconds */ -export function calculateHackingTime(server: Server, hack: number, int: number): number { +export function calculateHackingTime(server: Server, hack: number): number { const difficultyMult = server.requiredHackingSkill * server.hackDifficulty; const baseDiff = 500; const baseSkill = 50; const diffFactor = 2.5; - const intFactor = 0.1; if (hack == null) {hack = Player.hacking_skill;} - if (int == null) {int = Player.intelligence;} let skillFactor = (diffFactor * difficultyMult + baseDiff); // tslint:disable-next-line - skillFactor /= (hack + baseSkill + (intFactor * int)); + skillFactor /= (hack + baseSkill); const hackTimeMultiplier = 5; - const hackingTime = hackTimeMultiplier * skillFactor / Player.hacking_speed_mult; + const hackingTime = hackTimeMultiplier * skillFactor / (Player.hacking_speed_mult * Player.getIntelligenceBonus(1)); return hackingTime; } @@ -77,17 +74,17 @@ export function calculateHackingTime(server: Server, hack: number, int: number): /** * Returns time it takes to complete a grow operation on a server, in seconds */ -export function calculateGrowTime(server: Server, hack: number, int: number): number { +export function calculateGrowTime(server: Server, hack: number): number { const growTimeMultiplier = 3.2; // Relative to hacking time. 16/5 = 3.2 - return growTimeMultiplier * calculateHackingTime(server, hack, int); + return growTimeMultiplier * calculateHackingTime(server, hack); } /** * Returns time it takes to complete a weaken operation on a server, in seconds */ -export function calculateWeakenTime(server: Server, hack: number, int: number): number { +export function calculateWeakenTime(server: Server, hack: number): number { const weakenTimeMultiplier = 4; // Relative to hacking time - return weakenTimeMultiplier * calculateHackingTime(server, hack, int); + return weakenTimeMultiplier * calculateHackingTime(server, hack); } diff --git a/src/PersonObjects/IPlayer.ts b/src/PersonObjects/IPlayer.ts index 680973e31..f8de56873 100644 --- a/src/PersonObjects/IPlayer.ts +++ b/src/PersonObjects/IPlayer.ts @@ -178,4 +178,5 @@ export interface IPlayer { travel(to: CityName): boolean; giveExploit(exploit: Exploit): void; queryStatFromString(str: string): number; + getIntelligenceBonus(weight: number): number; } diff --git a/src/PersonObjects/IPlayerOrSleeve.ts b/src/PersonObjects/IPlayerOrSleeve.ts index 5271f7830..54cbbb22a 100644 --- a/src/PersonObjects/IPlayerOrSleeve.ts +++ b/src/PersonObjects/IPlayerOrSleeve.ts @@ -21,4 +21,6 @@ export interface IPlayerOrSleeve { // Multipliers crime_success_mult: number; + + getIntelligenceBonus(weight: number): number; } diff --git a/src/PersonObjects/Person.ts b/src/PersonObjects/Person.ts index 3e4dddd73..ec72f26c9 100644 --- a/src/PersonObjects/Person.ts +++ b/src/PersonObjects/Person.ts @@ -209,4 +209,13 @@ export abstract class Person { this.max_hp = Math.floor(10 + this.defense / 10); this.hp = Math.round(this.max_hp * ratio); } + + + getIntelligenceBonus(weight: number): number { + // 15 => +1.4% when you initially acquire int + // 50 => +3.8% mid game + // 100 => +6.6% late game + // 250 => +13.4% realistic best possible + return 1+(weight*Math.pow(this.intelligence, 0.8)/600); + } } diff --git a/src/PersonObjects/Player/PlayerObjectGeneralMethods.js b/src/PersonObjects/Player/PlayerObjectGeneralMethods.js index 050de0318..48fdeab0f 100644 --- a/src/PersonObjects/Player/PlayerObjectGeneralMethods.js +++ b/src/PersonObjects/Player/PlayerObjectGeneralMethods.js @@ -821,7 +821,7 @@ export function startFactionHackWork(faction) { this.resetWorkStatus(); this.workHackExpGainRate = .15 * this.hacking_exp_mult * BitNodeMultipliers.FactionWorkExpGain; - this.workRepGainRate = this.workRepGainRate = (this.hacking_skill + this.intelligence) / CONSTANTS.MaxSkillLevel * this.faction_rep_mult; + this.workRepGainRate = (this.hacking_skill + this.intelligence) / CONSTANTS.MaxSkillLevel * this.faction_rep_mult * this.getIntelligenceBonus(0.5); this.factionWorkType = CONSTANTS.FactionWorkHacking; this.currentWorkFactionDescription = "carrying out hacking contracts"; @@ -869,7 +869,7 @@ export function workForFaction(numCycles) { //Constantly update the rep gain rate switch (this.factionWorkType) { case CONSTANTS.FactionWorkHacking: - this.workRepGainRate = (this.hacking_skill + this.intelligence) / CONSTANTS.MaxSkillLevel * this.faction_rep_mult; + this.workRepGainRate = (this.hacking_skill + this.intelligence) / CONSTANTS.MaxSkillLevel * this.faction_rep_mult * this.getIntelligenceBonus(0.5); break; case CONSTANTS.FactionWorkField: this.workRepGainRate = this.getFactionFieldWorkRepGain(); @@ -1157,7 +1157,7 @@ export function startCreateProgramWork(programName, time, reqLevel) { export function createProgramWork(numCycles) { //Higher hacking skill will allow you to create programs faster var reqLvl = this.createProgramReqLvl; - var skillMult = (this.hacking_skill / reqLvl); //This should always be greater than 1; + var skillMult = (this.hacking_skill / 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" @@ -2305,4 +2305,13 @@ export function giveExploit(exploit) { if(!this.exploits.includes(exploit)) { this.exploits.push(exploit); } +} + + +export function getIntelligenceBonus(weight) { + // 15 => +1.4% when you initially acquire int + // 50 => +3.8% mid game + // 100 => +6.6% late game + // 250 => +13.4% realistic best possible + return 1+(weight*Math.pow(this.intelligence, 0.8)/600); } \ No newline at end of file diff --git a/src/PersonObjects/Sleeve/Sleeve.ts b/src/PersonObjects/Sleeve/Sleeve.ts index 53c7f9ff9..34f63312d 100644 --- a/src/PersonObjects/Sleeve/Sleeve.ts +++ b/src/PersonObjects/Sleeve/Sleeve.ts @@ -533,7 +533,7 @@ export class Sleeve extends Person { this.shock = Math.min(100, this.shock + (0.0002 * cyclesUsed)); break; case SleeveTaskType.Sync: - this.sync = Math.min(100, this.sync + (0.0002 * cyclesUsed)); + this.sync = Math.min(100, this.sync + (p.getIntelligenceBonus(0.5) * 0.0002 * cyclesUsed)); break; default: break; diff --git a/src/Prestige.js b/src/Prestige.js index 9dc2b5b7c..19bc56089 100755 --- a/src/Prestige.js +++ b/src/Prestige.js @@ -348,7 +348,7 @@ function prestigeSourceFile() { document.getElementById("world-menu-header").click(); // Gain int exp - Player.gainIntelligenceExp(5); + Player.gainIntelligenceExp(300); resetPidCounter(); } diff --git a/src/RedPill.js b/src/RedPill.js index 761db5f72..a1eb229a3 100644 --- a/src/RedPill.js +++ b/src/RedPill.js @@ -298,9 +298,9 @@ function createBitNodeYesNoEventListener(newBitNode, destroyedBitNode, flume=fal if (!flume) { giveSourceFile(destroyedBitNode); } else { - // If player used flume, subtract 5 int exp. The prestigeSourceFile() - // function below grants 5 int exp, so this allows sets net gain to 0 - Player.gainIntelligenceExp(-5); + // If player used flume, subtract 300 int exp. The prestigeSourceFile() + // function below grants 300 int exp, so this allows sets net gain to 0 + Player.gainIntelligenceExp(-300); } redPillFlag = false; var container = document.getElementById("red-pill-content"); diff --git a/src/engine.jsx b/src/engine.jsx index bffaec2bd..2cf46009b 100644 --- a/src/engine.jsx +++ b/src/engine.jsx @@ -196,13 +196,6 @@ const Engine = { // Display objects // TODO-Refactor this into its own component Display: { - // Progress bar - progress: null, - - // Display for status text (such as "Saved" or "Loaded") - statusText: null, - - hacking_skill: null, // Main menu content terminalContent: null,