mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-21 00:32:51 +02:00
TYPESAFETY: Strict internal typing for AugmentationName (#608)
This commit is contained in:
@@ -1,168 +1,173 @@
|
||||
import { defaultMultipliers } from "./BitNode";
|
||||
import { PartialRecord, getRecordEntries } from "../Types/Record";
|
||||
|
||||
/**
|
||||
* Bitnode multipliers influence the difficulty of different aspects of the game.
|
||||
* Each Bitnode has a different theme/strategy to achieving the end goal, so these multipliers will can help drive the
|
||||
* player toward the intended strategy. Unless they really want to play the long, slow game of waiting...
|
||||
*/
|
||||
export interface IBitNodeMultipliers {
|
||||
export class BitNodeMultipliers {
|
||||
/** Influences how quickly the player's agility level (not exp) scales */
|
||||
AgilityLevelMultiplier: number;
|
||||
AgilityLevelMultiplier = 1;
|
||||
|
||||
/** Influences the base cost to purchase an augmentation. */
|
||||
AugmentationMoneyCost: number;
|
||||
AugmentationMoneyCost = 1;
|
||||
|
||||
/** Influences the base rep the player must have with a faction to purchase an augmentation. */
|
||||
AugmentationRepCost: number;
|
||||
AugmentationRepCost = 1;
|
||||
|
||||
/** Influences how quickly the player can gain rank within Bladeburner. */
|
||||
BladeburnerRank: number;
|
||||
BladeburnerRank = 1;
|
||||
|
||||
/** Influences the cost of skill levels from Bladeburner. */
|
||||
BladeburnerSkillCost: number;
|
||||
BladeburnerSkillCost = 1;
|
||||
|
||||
/** Influences how quickly the player's charisma level (not exp) scales */
|
||||
CharismaLevelMultiplier: number;
|
||||
CharismaLevelMultiplier = 1;
|
||||
|
||||
/** Influences the experience gained for each ability when a player completes a class. */
|
||||
ClassGymExpGain: number;
|
||||
ClassGymExpGain = 1;
|
||||
|
||||
/**Influences the amount of money gained from completing Coding Contracts. */
|
||||
CodingContractMoney: number;
|
||||
CodingContractMoney = 1;
|
||||
|
||||
/** Influences the experience gained for each ability when the player completes working their job. */
|
||||
CompanyWorkExpGain: number;
|
||||
CompanyWorkExpGain = 1;
|
||||
|
||||
/** Influences how much money the player earns when completing working their job. */
|
||||
CompanyWorkMoney: number;
|
||||
CompanyWorkMoney = 1;
|
||||
|
||||
/** Influences the valuation of corporations created by the player. */
|
||||
CorporationValuation: number;
|
||||
CorporationValuation = 1;
|
||||
|
||||
/** Influences the base experience gained for each ability when the player commits a crime. */
|
||||
CrimeExpGain: number;
|
||||
CrimeExpGain = 1;
|
||||
|
||||
/** Influences the base money gained when the player commits a crime. */
|
||||
CrimeMoney: number;
|
||||
CrimeMoney = 1;
|
||||
|
||||
/** Influences how many Augmentations you need in order to get invited to the Daedalus faction */
|
||||
DaedalusAugsRequirement: number;
|
||||
DaedalusAugsRequirement = 30;
|
||||
|
||||
/** Influences how quickly the player's defense level (not exp) scales */
|
||||
DefenseLevelMultiplier: number;
|
||||
DefenseLevelMultiplier = 1;
|
||||
|
||||
/** Influences how quickly the player's dexterity level (not exp) scales */
|
||||
DexterityLevelMultiplier: number;
|
||||
DexterityLevelMultiplier = 1;
|
||||
|
||||
/** Influences how much rep the player gains in each faction simply by being a member. */
|
||||
FactionPassiveRepGain: number;
|
||||
FactionPassiveRepGain = 1;
|
||||
|
||||
/** Influences the experience gained for each ability when the player completes work for a Faction. */
|
||||
FactionWorkExpGain: number;
|
||||
FactionWorkExpGain = 1;
|
||||
|
||||
/** Influences how much rep the player gains when performing work for a faction. */
|
||||
FactionWorkRepGain: number;
|
||||
FactionWorkRepGain = 1;
|
||||
|
||||
/** Influences how much it costs to unlock the stock market's 4S Market Data API */
|
||||
FourSigmaMarketDataApiCost: number;
|
||||
FourSigmaMarketDataApiCost = 1;
|
||||
|
||||
/** Influences how much it costs to unlock the stock market's 4S Market Data (NOT API) */
|
||||
FourSigmaMarketDataCost: number;
|
||||
FourSigmaMarketDataCost = 1;
|
||||
|
||||
/** Reduces gangs earning. */
|
||||
GangSoftcap: number;
|
||||
GangSoftcap = 1;
|
||||
|
||||
/** Percentage of unique augs that the gang has. */
|
||||
GangUniqueAugs: number;
|
||||
GangUniqueAugs = 1;
|
||||
|
||||
/** Influences the experienced gained when hacking a server. */
|
||||
HackExpGain: number;
|
||||
HackExpGain = 1;
|
||||
|
||||
/** Influences how quickly the player's hacking level (not experience) scales */
|
||||
HackingLevelMultiplier: number;
|
||||
HackingLevelMultiplier = 1;
|
||||
|
||||
/**
|
||||
* Influences how much money is produced by Hacknet Nodes.
|
||||
* Influences the hash rate of Hacknet Servers (unlocked in BitNode-9)
|
||||
*/
|
||||
HacknetNodeMoney: number;
|
||||
HacknetNodeMoney = 1;
|
||||
|
||||
/** Influences how much money it costs to upgrade your home computer's RAM */
|
||||
HomeComputerRamCost: number;
|
||||
HomeComputerRamCost = 1;
|
||||
|
||||
/** Influences how much money is gained when the player infiltrates a company. */
|
||||
InfiltrationMoney: number;
|
||||
InfiltrationMoney = 1;
|
||||
|
||||
/** Influences how much rep the player can gain from factions when selling stolen documents and secrets */
|
||||
InfiltrationRep: number;
|
||||
InfiltrationRep = 1;
|
||||
|
||||
/**
|
||||
* Influences how much money can be stolen from a server when the player performs a hack against it through
|
||||
* the Terminal.
|
||||
*/
|
||||
ManualHackMoney: number;
|
||||
ManualHackMoney = 1;
|
||||
|
||||
/** Influence how much it costs to purchase a server */
|
||||
PurchasedServerCost: number;
|
||||
PurchasedServerCost = 1;
|
||||
|
||||
/** Influence how much it costs to purchase a server */
|
||||
PurchasedServerSoftcap: number;
|
||||
PurchasedServerSoftcap = 1;
|
||||
|
||||
/** Influences the maximum number of purchased servers you can have */
|
||||
PurchasedServerLimit: number;
|
||||
PurchasedServerLimit = 1;
|
||||
|
||||
/** Influences the maximum allowed RAM for a purchased server */
|
||||
PurchasedServerMaxRam: number;
|
||||
PurchasedServerMaxRam = 1;
|
||||
|
||||
/** Influences the minimum favor the player must have with a faction before they can donate to gain rep. */
|
||||
RepToDonateToFaction: number;
|
||||
RepToDonateToFaction = 1;
|
||||
|
||||
/** Influences how much money can be stolen from a server when a script performs a hack against it. */
|
||||
ScriptHackMoney: number;
|
||||
ScriptHackMoney = 1;
|
||||
|
||||
/**
|
||||
* The amount of money actually gained when script hack a server. This is
|
||||
* different than the above because you can reduce the amount of money but
|
||||
* not gain that same amount.
|
||||
*/
|
||||
ScriptHackMoneyGain: number;
|
||||
ScriptHackMoneyGain = 1;
|
||||
|
||||
/** Influences the growth percentage per cycle against a server. */
|
||||
ServerGrowthRate: number;
|
||||
ServerGrowthRate = 1;
|
||||
|
||||
/** Influences the maximum money that a server can grow to. */
|
||||
ServerMaxMoney: number;
|
||||
ServerMaxMoney = 1;
|
||||
|
||||
/** Influences the initial money that a server starts with. */
|
||||
ServerStartingMoney: number;
|
||||
ServerStartingMoney = 1;
|
||||
|
||||
/** Influences the initial security level (hackDifficulty) of a server. */
|
||||
ServerStartingSecurity: number;
|
||||
ServerStartingSecurity = 1;
|
||||
|
||||
/** Influences the weaken amount per invocation against a server. */
|
||||
ServerWeakenRate: number;
|
||||
ServerWeakenRate = 1;
|
||||
|
||||
/** Influences how quickly the player's strength level (not exp) scales */
|
||||
StrengthLevelMultiplier: number;
|
||||
StrengthLevelMultiplier = 1;
|
||||
|
||||
/** Influences the power of the gift. */
|
||||
StaneksGiftPowerMultiplier: number;
|
||||
StaneksGiftPowerMultiplier = 1;
|
||||
|
||||
/** Influences the size of the gift. */
|
||||
StaneksGiftExtraSize: number;
|
||||
StaneksGiftExtraSize = 0;
|
||||
|
||||
/** Influences the hacking skill required to backdoor the world daemon. */
|
||||
WorldDaemonDifficulty: number;
|
||||
WorldDaemonDifficulty = 1;
|
||||
|
||||
/** Influences profits from corporation dividends and selling shares. */
|
||||
CorporationSoftcap: number;
|
||||
CorporationSoftcap = 1;
|
||||
|
||||
/** Influences number of divisions a corporation can have. */
|
||||
CorporationDivisions: number;
|
||||
CorporationDivisions = 1;
|
||||
|
||||
// Index signature
|
||||
[key: string]: number;
|
||||
constructor(a: PartialRecord<keyof BitNodeMultipliers, number> = {}) {
|
||||
for (const [key, value] of getRecordEntries(a)) this[key] = value;
|
||||
}
|
||||
}
|
||||
|
||||
/** The multipliers that are influenced by current Bitnode progression. */
|
||||
export const BitNodeMultipliers = Object.assign({}, defaultMultipliers);
|
||||
/** The multipliers currently in effect */
|
||||
export let currentNodeMults = new BitNodeMultipliers();
|
||||
|
||||
export function replaceCurrentNodeMults(mults: BitNodeMultipliers) {
|
||||
currentNodeMults = mults;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user