mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-18 05:33:54 +01:00
Offline hacking income now shown for scripts (#873)
This commit is contained in:
parent
36a8b35cfb
commit
445c0c3134
@ -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,
|
||||
|
||||
|
@ -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)) {
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user