Home Computer now has max RAM

This commit is contained in:
danielyxie 2019-01-09 02:43:59 -08:00
parent d5a2b9e0a1
commit ad1df00889
3 changed files with 22 additions and 44 deletions

@ -104,10 +104,11 @@ export let CONSTANTS: IMap<any> = {
NumNetscriptPorts: 20, NumNetscriptPorts: 20,
//Server constants //Server constants
ServerBaseGrowthRate: 1.03, //Unadjusted Growth rate HomeComputerMaxRam: 1073741824, // 2 ^ 30
ServerMaxGrowthRate: 1.0035, //Maximum possible growth rate (max rate accounting for server security) ServerBaseGrowthRate: 1.03, // Unadjusted Growth rate
ServerFortifyAmount: 0.002, //Amount by which server's security increases when its hacked/grown ServerMaxGrowthRate: 1.0035, // Maximum possible growth rate (max rate accounting for server security)
ServerWeakenAmount: 0.05, //Amount by which server's security decreases when weakened ServerFortifyAmount: 0.002, // Amount by which server's security increases when its hacked/grown
ServerWeakenAmount: 0.05, // Amount by which server's security decreases when weakened
PurchasedServerLimit: 25, PurchasedServerLimit: 25,
PurchasedServerMaxRam: 1048576, //2^20 PurchasedServerMaxRam: 1048576, //2^20
@ -506,40 +507,8 @@ export let CONSTANTS: IMap<any> = {
LatestUpdate: LatestUpdate:
` `
v0.42.0 v0.43.0
* Corporation Changes: * Home Computer RAM is now capped at 2 ^ 30 GB (1073741824 GB)
** Corporation can now be self-funded with $150b or using seed money in exchange for 500m newly-issued shares `
** In BitNode-3, you no longer start with $150b
** Changed initial market prices for many materials
** Changed the way a material's demand, competition, and market price change over time
** The sale price of materials can no longer be marked-up as high
** Added a Research Tree mechanic. Spend Scientific Research on permanent upgrades for each industry
** You can now redistribute earnings to shareholders (including yourself) as dividends
** Cost of "Smart Supply" upgraded reduced from $50b to $25b
** Now has offline progress, which works similarly to the Gang/Bladeburner mechanics
** Slightly reduced the amount of money offered to you by investment firms
** Employee salaries now slowly increase over time
** Slightly reduced the effect "Real Estate" has on the Production Multiplier for the Agriculture industry
** Changed the way your Corporation's value is calculated (this is what determines stock price)
** After taking your corporation public, it is now possible to issue new shares to raise capital
** Issuing new shares can only be done once every 12 hours
** Buying back shares must now be done at a premium
** Selling shares can now only be done once per hour
** Selling large amounts of shares now immediately impacts stock price (during the transaction)
** Reduced the initial cost of the DreamSense upgrade from $8b to $4b, but increased its price multiplier
** Reduced the price multiplier for ABC SalesBots upgrade
* Added getOrders() Netscript function to the TIX API
* Added getAugmentationPrereq() Singularity function (by havocmayhem)
* Added hackAnalyzePercent() and hackAnalyzeThreads() Netscript functions
* Stock Market, Travel, and Corporation main menu links are now properly styled
* Many pop-up/dialog boxes now support the 'Enter' and 'Esc' hotkeys. If you find a pop-up/dialog box that doesnt support this, let me know specifically which one ('Enter' for the default option, 'Esc' for cancelling and closing the pop-up box)
* Added "brace_style = preserve_inline" configuration to Script Editor Beautifier
* ServerProfiler.exe can now be purchased from the Dark Web
* Added an option to copy save data to clipboard
* Added total multiplier information on the "Augmentations" page
* Bug Fix: gymWorkout() Singularity function should now work properly with Millenium Fitness Gym
* Began migrating gameplay information to the ReadTheDocs documentation
`
} }

@ -2992,16 +2992,20 @@ function NetscriptFunctions(workerScript) {
} }
} }
const cost = Player.getUpgradeHomeRamCost(); // Check if we're at max RAM
const homeComputer = Player.getHomeComputer();
if (homeComputer.maxRam >= CONSTANTS.HomeComputerMaxRam) {
workerScript.log(`ERROR: upgradeHomeRam() failed because your home computer is at max RAM`);
return false;
}
const cost = Player.getUpgradeHomeRamCost();
if (Player.money.lt(cost)) { if (Player.money.lt(cost)) {
workerScript.scriptRef.log("ERROR: upgradeHomeRam() failed because you don't have enough money"); workerScript.scriptRef.log("ERROR: upgradeHomeRam() failed because you don't have enough money");
return false; return false;
} }
var homeComputer = Player.getHomeComputer();
homeComputer.maxRam *= 2; homeComputer.maxRam *= 2;
Player.loseMoney(cost); Player.loseMoney(cost);
Player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain); Player.gainIntelligenceExp(CONSTANTS.IntelligenceSingFnBaseExpGain);

@ -58,9 +58,14 @@ function purchaseRamForHomeComputer(cost) {
return; return;
} }
var homeComputer = Player.getHomeComputer(); const homeComputer = Player.getHomeComputer();
homeComputer.maxRam *= 2; if (homeComputer.maxRam >= CONSTANTS.HomeComputerMaxRam) {
dialogBoxCreate(`You cannot upgrade your home computer RAM because it is at its maximum possible value`);
return;
}
homeComputer.maxRam *= 2;
Player.loseMoney(cost); Player.loseMoney(cost);
dialogBoxCreate("Purchased additional RAM for home computer! It now has " + homeComputer.maxRam + "GB of RAM."); dialogBoxCreate("Purchased additional RAM for home computer! It now has " + homeComputer.maxRam + "GB of RAM.");