diff --git a/src/Constants.ts b/src/Constants.ts index dd4e4fc4a..612dd9861 100644 --- a/src/Constants.ts +++ b/src/Constants.ts @@ -9,6 +9,7 @@ export const CONSTANTS: { VersionNumber: number; MaxSkillLevel: number; MilliPerCycle: number; + OfflineHackingIncome: number; CorpFactionRepRequirement: number; BaseFocusBonus: number; BaseCostFor1GBOfRamHome: number; @@ -96,6 +97,9 @@ export const CONSTANTS: { // Milliseconds per game cycle MilliPerCycle: 200, + // Multiplier for hacking income earned from offline scripts + OfflineHackingIncome: 0.75, + // How much reputation is needed to join a megacorporation's faction CorpFactionRepRequirement: 400e3, diff --git a/src/Script/ScriptHelpers.ts b/src/Script/ScriptHelpers.ts index d25aa8fc8..edc6cbe8c 100644 --- a/src/Script/ScriptHelpers.ts +++ b/src/Script/ScriptHelpers.ts @@ -54,9 +54,15 @@ export function scriptCalculateOfflineProduction(runningScript: RunningScript): const expGain = confidence * (runningScript.onlineExpGained / runningScript.onlineRunningTime) * timePassed; Player.gainHackingExp(expGain); + const moneyGain = + (runningScript.onlineMoneyMade / runningScript.onlineRunningTime) * timePassed * CONSTANTS.OfflineHackingIncome; + // money is given to player during engine load + Player.scriptProdSinceLastAug += moneyGain; + // Update script stats runningScript.offlineRunningTime += timePassed; runningScript.offlineExpGained += expGain; + runningScript.offlineMoneyMade += moneyGain; // Weaken for (const hostname of Object.keys(runningScript.dataMap)) { diff --git a/src/engine.tsx b/src/engine.tsx index 96287782f..361a6f02a 100644 --- a/src/engine.tsx +++ b/src/engine.tsx @@ -262,7 +262,8 @@ const Engine: { } let offlineReputation = 0; - const offlineHackingIncome = (Player.moneySourceA.hacking / Player.playtimeSinceLastAug) * timeOffline * 0.75; + const offlineHackingIncome = + (Player.moneySourceA.hacking / Player.playtimeSinceLastAug) * timeOffline * CONSTANTS.OfflineHackingIncome; Player.gainMoney(offlineHackingIncome, "hacking"); // Process offline progress