From 2045e77e7aa2e267076c8513c368055f98cf0383 Mon Sep 17 00:00:00 2001 From: danielyxie Date: Sat, 23 Feb 2019 20:27:06 -0800 Subject: [PATCH] Bladeburner contracts give more money. Fixed a bug with recording player money --- src/Bladeburner.js | 62 +++++++++++++++++++--------------- src/Constants.ts | 2 ++ src/StockMarket/StockMarket.js | 2 +- 3 files changed, 37 insertions(+), 29 deletions(-) diff --git a/src/Bladeburner.js b/src/Bladeburner.js index 65fb82ce7..4df1b0a88 100644 --- a/src/Bladeburner.js +++ b/src/Bladeburner.js @@ -32,48 +32,51 @@ import { removeElement } from "../utils/uiHelpers/rem import { removeElementById } from "../utils/uiHelpers/removeElementById"; -var CityNames = ["Aevum", "Chongqing", "Sector-12", "New Tokyo", "Ishima", "Volhaven"]; +const CityNames = ["Aevum", "Chongqing", "Sector-12", "New Tokyo", "Ishima", "Volhaven"]; -var CyclesPerSecond = 5; //Game cycle is 200 ms +const CyclesPerSecond = 5; //Game cycle is 200 ms -var StaminaGainPerSecond = 0.0085; -var BaseStaminaLoss = 0.285; //Base stamina loss per action. Increased based on difficulty -var MaxStaminaToGainFactor = 70000; //Max Stamina is divided by this to get bonus stamina gain +const StaminaGainPerSecond = 0.0085; +const BaseStaminaLoss = 0.285; //Base stamina loss per action. Increased based on difficulty +const MaxStaminaToGainFactor = 70000; //Max Stamina is divided by this to get bonus stamina gain -var DifficultyToTimeFactor = 10; //Action Difficulty divided by this to get base action time +const DifficultyToTimeFactor = 10; //Action Difficulty divided by this to get base action time //The difficulty multiplier affects stamina loss and hp loss of an action. Also affects //experience gain. Its formula is: //difficulty ^ exponentialFactor + difficulty / linearFactor -var DiffMultExponentialFactor = 0.28; -var DiffMultLinearFactor = 650; +const DiffMultExponentialFactor = 0.28; +const DiffMultLinearFactor = 650; // These factors are used to calculate action time. // They affect how much action time is reduced based on your agility and dexterity -var EffAgiLinearFactor = 38e3; -var EffDexLinearFactor = 38e3; -var EffAgiExponentialFactor = 0.033; -var EffDexExponentialFactor = 0.03; +const EffAgiLinearFactor = 38e3; +const EffDexLinearFactor = 38e3; +const EffAgiExponentialFactor = 0.033; +const EffDexExponentialFactor = 0.03; -var BaseRecruitmentTimeNeeded = 300; //Base time needed (s) to complete a Recruitment action +const BaseRecruitmentTimeNeeded = 300; //Base time needed (s) to complete a Recruitment action -var PopulationThreshold = 1e9; //Population at which success rates start being affected -var ChaosThreshold = 50; //City chaos level after which it starts making tasks harder +const PopulationThreshold = 1e9; //Population at which success rates start being affected +const ChaosThreshold = 50; //City chaos level after which it starts making tasks harder -var BaseStatGain = 1; //Base stat gain per second -var BaseIntGain = 0.001; //Base intelligence stat gain +const BaseStatGain = 1; //Base stat gain per second +const BaseIntGain = 0.001; //Base intelligence stat gain -var ActionCountGrowthPeriod = 300; //Time (s) it takes for action count to grow by its specified value +const ActionCountGrowthPeriod = 480; //Time (s) it takes for action count to grow by its specified value -var RankToFactionRepFactor = 2; //Delta Faction Rep = this * Delta Rank -var RankNeededForFaction = 25; +const RankToFactionRepFactor = 2; //Delta Faction Rep = this * Delta Rank +const RankNeededForFaction = 25; -var ContractSuccessesPerLevel = 3; //How many successes you need to level up a contract -var OperationSuccessesPerLevel = 2.5; //How many successes you need to level up an op +const ContractSuccessesPerLevel = 3; //How many successes you need to level up a contract +const OperationSuccessesPerLevel = 2.5; //How many successes you need to level up an op -var RanksPerSkillPoint = 3.5; //How many ranks needed to get 1 Skill Point +const RanksPerSkillPoint = 3; //How many ranks needed to get 1 Skill Point -var ContractBaseMoneyGain = 50e3; //Base Money Gained per contract +const ContractBaseMoneyGain = 100e3; //Base Money Gained per contract + +const HrcHpGain = 2; // HP gained from Hyperbolic Regeneration Chamber +const HrcStaminaGain = 0.1; // Stamina gained from Hyperbolic Regeneration Chamber //DOM related variables var ActiveActionCssClass = "bladeburner-active-action"; @@ -1413,9 +1416,12 @@ Bladeburner.prototype.completeAction = function() { this.startAction(this.action); // Repeat Action break; case ActionTypes["Hyperbolic Regeneration Chamber"]: - Player.regenerateHp(1); - this.stamina += 0.05; // TODO Turn this into a const and adjust value + Player.regenerateHp(HrcHpGain); + this.stamina = Math.max(this.maxStamina, this.stamina + HrcStaminaGain); // TODO Turn this into a const and adjust value this.startAction(this.action); + if (this.logging.general) { + this.log(`Rested in Hyperbolic Regeneration Chamber. Restored ${HrcHpGain} HP and gained ${HrcStaminaGain} stamina`); + } break; default: console.error(`Bladeburner.completeAction() called for invalid action: ${this.action.type}`); @@ -1541,8 +1547,8 @@ Bladeburner.prototype.getRecruitmentSuccessChance = function() { Bladeburner.prototype.getDiplomacyEffectiveness = function() { // Returns a decimal by which the city's chaos level should be multiplied (e.g. 0.98) - const CharismaLinearFactor = 5e3; - const CharismaExponentialFactor = 0.04; + const CharismaLinearFactor = 4e3; + const CharismaExponentialFactor = 0.045; const charismaEff = Math.pow(Player.charisma, CharismaExponentialFactor) + Player.charisma / CharismaLinearFactor; return (100 - charismaEff) / 100; diff --git a/src/Constants.ts b/src/Constants.ts index b9e627e7c..60c26af1e 100644 --- a/src/Constants.ts +++ b/src/Constants.ts @@ -517,9 +517,11 @@ export let CONSTANTS: IMap = { ** Increased the effect of the "Hyperdrive" and "Hands of Midas" skills ** Slightly increased the rate which the skill point cost rises for almost all skills ** The "Overlock" Skill now has a maximum level of 90 instead of 95 + ** Money earned from Contracts increased by 100% ** Added two new General Actions: Diplomacy and Hyperbolic Regeneration Chamber ** Lowered the rep cost of the "Blade's Simulacrum" augmentation, but increased the price ** Significantly decreased the initial amount of Contracts/Operations (the "Contracts/Operations remaining" value) + ** Decreased the rate at which the amount of Contracts/Operations increases over time ** Decreased the number of successes you need to increase the max level of a Contract/Operation ** Increased the average number of Synthoid communities each city has ** Reduced the amount by which a successful raid will decrease the population of a city diff --git a/src/StockMarket/StockMarket.js b/src/StockMarket/StockMarket.js index c6f0f4d51..8b9f756b1 100644 --- a/src/StockMarket/StockMarket.js +++ b/src/StockMarket/StockMarket.js @@ -454,7 +454,7 @@ function sellStock(stock, shares) { if (shares === 0) {return false;} var gains = stock.price * shares - CONSTANTS.StockMarketCommission; Player.gainMoney(gains); - Player.recordMoneySource(profit, "stock"); + Player.recordMoneySource(gains, "stock"); stock.playerShares = Math.round(stock.playerShares - shares); if (stock.playerShares == 0) { stock.playerAvgPx = 0;