Convert crime to new work model

This commit is contained in:
Olivier Gagnon
2022-07-07 02:00:23 -04:00
parent 7d263e4223
commit 3ee7d593d0
12 changed files with 238 additions and 292 deletions
+8 -5
View File
@@ -96,7 +96,11 @@ const Engine: {
Terminal.process(Router, Player, numCycles);
Player.process(Router, numCycles);
if (Player.currentWork !== null) {
Player.processNEWWork(numCycles);
} else {
Player.process(Router, numCycles);
}
// Update stock prices
if (Player.hasWseAccount) {
@@ -293,7 +297,9 @@ const Engine: {
Player.gainMoney(offlineHackingIncome, "hacking");
// Process offline progress
loadAllRunningScripts(Player); // This also takes care of offline production for those scripts
if (Player.isWorking) {
if (Player.currentWork !== null) {
Player.processNEWWork(numCyclesOffline);
} else if (Player.isWorking) {
Player.focus = true;
switch (Player.workType) {
case WorkType.Faction:
@@ -305,9 +311,6 @@ const Engine: {
case WorkType.StudyClass:
Player.takeClass(numCyclesOffline);
break;
case WorkType.Crime:
Player.commitCrime(numCyclesOffline);
break;
case WorkType.CompanyPartTime:
Player.workPartTime(numCyclesOffline);
break;