Implemented a money tracker that keeps record where all of the player's money comes from. Players can see a breakdown in the 'Stats' page

This commit is contained in:
danielyxie
2019-02-21 18:26:28 -08:00
committed by danielyxie
parent 107977e6f4
commit b7157b63e0
16 changed files with 321 additions and 142 deletions
+3 -1
View File
@@ -8,7 +8,7 @@ import { augmentationExists,
installAugmentations } from "./Augmentation/AugmentationHelpers";
import { AugmentationNames } from "./Augmentation/data/AugmentationNames";
import { BitNodeMultipliers } from "./BitNode/BitNodeMultipliers";
import { determineCrimeSuccess, findCrime } from "./Crime/CrimeHelpers";
import { findCrime } from "./Crime/CrimeHelpers";
import {Bladeburner} from "./Bladeburner";
import {Company} from "./Company/Company";
import {Companies, companyExists} from "./Company/Companies";
@@ -381,6 +381,7 @@ function NetscriptFunctions(workerScript) {
Player.gainMoney(moneyGained);
workerScript.scriptRef.onlineMoneyMade += moneyGained;
Player.scriptProdSinceLastAug += moneyGained;
Player.recordMoneySource(moneyGained, "hacking");
workerScript.scriptRef.recordHack(server.ip, moneyGained, threads);
Player.gainHackingExp(expGainedOnSuccess);
workerScript.scriptRef.onlineExpGained += expGainedOnSuccess;
@@ -1621,6 +1622,7 @@ function NetscriptFunctions(workerScript) {
if (isNaN(netProfit)) {netProfit = 0;}
workerScript.scriptRef.onlineMoneyMade += netProfit;
Player.scriptProdSinceLastAug += netProfit;
Player.recordMoneySource(netProfit, "stock");
stock.playerShares -= shares;
if (stock.playerShares == 0) {