Minor UI improvements and bug fixes

This commit is contained in:
Daniel Xie 2017-05-10 15:21:15 -05:00
parent f2287b5696
commit 3808fe5a3f
13 changed files with 72 additions and 60 deletions

@ -27,6 +27,8 @@ TESTING TODO:
Seems to work fine Seems to work fine
Gyms - Later..don't need for MVP
Tasks TODO: Tasks TODO:
Adding augmentations for Silhouette fac Adding augmentations for Silhouette fac
@ -42,11 +44,7 @@ Tasks TODO:
Create new menu page for purchased servers Create new menu page for purchased servers
Gyms - Later..don't need for MVP
Update CONSTANTS.HelpText
Account for Max possible int when gaining exp (it will overflow) Account for Max possible int when gaining exp (it will overflow)
Text in script editor that says ("ctrl + x" to save and quit)
OPTIMIZATION OPTIMIZATION
https://gamealchemist.wordpress.com/2013/05/01/lets-get-those-javascript-arrays-to-work-fast/ https://gamealchemist.wordpress.com/2013/05/01/lets-get-those-javascript-arrays-to-work-fast/

@ -149,7 +149,7 @@ tr:focus {
.tooltip .tooltiptext { .tooltip .tooltiptext {
visibility: hidden; visibility: hidden;
width: 200px; width: 300px;
background-color: black; background-color: black;
border: 2px solid white; border: 2px solid white;
color: white; color: white;

@ -32,9 +32,6 @@ CONSTANTS = {
//Time (ms) it takes to run one operation in Netscript. //Time (ms) it takes to run one operation in Netscript.
CodeInstructionRunTime: 1500, CodeInstructionRunTime: 1500,
//Time (seconds) it takes to run one operation in Netscript OFFLINE
CodeOfflineExecutionTime: 10,
//Server growth rate //Server growth rate
ServerGrowthRate: 1.00075, ServerGrowthRate: 1.00075,

@ -92,7 +92,7 @@ function determineCrimeChanceShoplift() {
var chance = ((Player.strength / CONSTANTS.MaxSkillLevel + var chance = ((Player.strength / CONSTANTS.MaxSkillLevel +
Player.defense / CONSTANTS.MaxSkillLevel + Player.defense / CONSTANTS.MaxSkillLevel +
Player.dexterity / CONSTANTS.MaxSkillLevel + Player.dexterity / CONSTANTS.MaxSkillLevel +
Player.agility / CONSTANTS.MaxSkillLevel)) * 8; Player.agility / CONSTANTS.MaxSkillLevel)) * 10;
return Math.min(chance, 1); return Math.min(chance, 1);
} }
@ -101,12 +101,12 @@ function determineCrimeChanceMug() {
var chance = ((Player.strength / CONSTANTS.MaxSkillLevel + var chance = ((Player.strength / CONSTANTS.MaxSkillLevel +
Player.defense / CONSTANTS.MaxSkillLevel + Player.defense / CONSTANTS.MaxSkillLevel +
Player.dexterity / CONSTANTS.MaxSkillLevel + Player.dexterity / CONSTANTS.MaxSkillLevel +
Player.agility / CONSTANTS.MaxSkillLevel)) * 4; Player.agility / CONSTANTS.MaxSkillLevel)) * 5;
return Math.min(chance, 1); return Math.min(chance, 1);
} }
function determineCrimeChanceDealDrugs() { function determineCrimeChanceDealDrugs() {
var chance = ((1.5*Player.charisma / CONSTANTS.MaxSkillLevel + var chance = ((2*Player.charisma / CONSTANTS.MaxSkillLevel +
Player.strength / CONSTANTS.MaxSkillLevel + Player.strength / CONSTANTS.MaxSkillLevel +
Player.defense / CONSTANTS.MaxSkillLevel + Player.defense / CONSTANTS.MaxSkillLevel +
Player.dexterity / CONSTANTS.MaxSkillLevel + Player.dexterity / CONSTANTS.MaxSkillLevel +

@ -747,13 +747,13 @@ displayFactionAugmentations = function(factionName) {
aElem.setAttribute("href", "#"); aElem.setAttribute("href", "#");
var req = aug.baseRepRequirement * faction.augmentationRepRequirementMult; var req = aug.baseRepRequirement * faction.augmentationRepRequirementMult;
if (aug.name != AugmentationNames.NeuroFluxGovernor && aug.owned) { if (aug.name != AugmentationNames.NeuroFluxGovernor && aug.owned) {
aElem.setAttribute("class", "a-link-button-inactive"); aElem.setAttribute("class", "a-link-button-inactive tooltip");
pElem.innerHTML = "ALREADY OWNED"; pElem.innerHTML = "ALREADY OWNED";
} else if (faction.playerReputation >= req) { } else if (faction.playerReputation >= req) {
aElem.setAttribute("class", "a-link-button tooltip"); aElem.setAttribute("class", "a-link-button tooltip");
pElem.innerHTML = "UNLOCKED - $" + formatNumber(aug.baseCost * faction.augmentationPriceMult, 2); pElem.innerHTML = "UNLOCKED - $" + formatNumber(aug.baseCost * faction.augmentationPriceMult, 2);
} else { } else {
aElem.setAttribute("class", "a-link-button-inactive"); aElem.setAttribute("class", "a-link-button-inactive tooltip");
pElem.innerHTML = "LOCKED (Requires " + formatNumber(req, 4) + " faction reputation)"; pElem.innerHTML = "LOCKED (Requires " + formatNumber(req, 4) + " faction reputation)";
pElem.style.color = "red"; pElem.style.color = "red";
} }
@ -764,7 +764,7 @@ displayFactionAugmentations = function(factionName) {
aElem.innerHTML += " - Level " + (aug.level + 1); aElem.innerHTML += " - Level " + (aug.level + 1);
} }
aElem.innerHTML += "<span class='tooltiptext'>" + aug.info + " </span>"; aElem.innerHTML += '<span class="tooltiptext">' + aug.info + " </span>";
aElem.addEventListener("click", function() { aElem.addEventListener("click", function() {
purchaseAugmentationBoxCreate(aug, faction); purchaseAugmentationBoxCreate(aug, faction);

@ -27,7 +27,8 @@ FactionInfo = {
"transporation on an unprecendented scale, in ways that no other company can.\n\n" + "transporation on an unprecendented scale, in ways that no other company can.\n\n" +
"In our labs and factories and on the ground with customers, MegaCorp is ushering in a new era for the world.", "In our labs and factories and on the ground with customers, MegaCorp is ushering in a new era for the world.",
BachmanAndAssociatesInfo: "TODO", BachmanAndAssociatesInfo: "Where Law and Business meet - thats where we are. <br><br>" +
"Legal Insight - Business Instinct - Experience Innovation",
BladeIndustriesInfo: "TODO", BladeIndustriesInfo: "TODO",
@ -39,7 +40,7 @@ FactionInfo = {
FourSigmaInfo: "TODO", FourSigmaInfo: "TODO",
KuaiGongInternationalInfo: "TODO", KuaiGongInternationalInfo: "Dream big. Work hard. Make history.",
//Other Corporations //Other Corporations
FulcrumSecretTechnologiesInfo: "TODO", FulcrumSecretTechnologiesInfo: "TODO",
@ -116,6 +117,7 @@ FactionInfo = {
//Earlygame factions - factions the player will prestige with early on that don't //Earlygame factions - factions the player will prestige with early on that don't
//belong in other categories //belong in other categories
NetburnersInfo: "~~//*><H4CK|\|3T 8URN3R5**>?>\\~~", NetburnersInfo: "~~//*><H4CK|\|3T 8URN3R5**>?>\\~~",
TianDiHuiInfo: "Obey Heaven and Work Righteousness", TianDiHuiInfo: "Obey Heaven and Work Righteousness",
CyberSecInfo: "The Internet is the first thing that humanity has built that humanity doesnt understand,\n" + CyberSecInfo: "The Internet is the first thing that humanity has built that humanity doesnt understand,\n" +

@ -900,7 +900,7 @@ displayLocationContent = function() {
employeeJob.style.display = "none"; employeeJob.style.display = "none";
} else if (currPos.positionName == CompanyPositions.Waiter.positionName) { } else if (currPos.positionName == CompanyPositions.Waiter.positionName) {
waiterJob.style.display = "none"; waiterJob.style.display = "none";
} else if (currPos.positionName == CompanyPositions.PartTimeEmploye.positionName) { } else if (currPos.positionName == CompanyPositions.PartTimeEmployee.positionName) {
employeePartTimeJob.style.display = "none"; employeePartTimeJob.style.display = "none";
} else if (currPos.positionName == CompanyPositions.PartTimeWaiter.positionName) { } else if (currPos.positionName == CompanyPositions.PartTimeWaiter.positionName) {
waiterPartTimeJob.style.display = "none"; waiterPartTimeJob.style.display = "none";

@ -562,24 +562,24 @@ PlayerObject.prototype.workPartTime = function(numCycles) {
} }
PlayerObject.prototype.finishWorkPartTime = function() { PlayerObject.prototype.finishWorkPartTime = function() {
this.gainWorkExp(cancMult); this.gainWorkExp();
var company = Companies[this.companyName]; var company = Companies[this.companyName];
company.playerReputation += (this.workRepGained / cancMult); company.playerReputation += (this.workRepGained);
this.gainMoney(this.workMoneyGained / cancMult); this.gainMoney(this.workMoneyGained);
this.updateSkillLevels(); this.updateSkillLevels();
var txt = "You earned a total of: <br>" + var txt = "You earned a total of: <br>" +
"$" + formatNumber(this.workMoneyGained / cancMult, 2) + "<br>" + "$" + formatNumber(this.workMoneyGained, 2) + "<br>" +
formatNumber(this.workRepGained / cancMult, 4) + " reputation for the company <br>" + formatNumber(this.workRepGained, 4) + " reputation for the company <br>" +
formatNumber(this.workHackExpGained / cancMult, 4) + " hacking exp <br>" + formatNumber(this.workHackExpGained, 4) + " hacking exp <br>" +
formatNumber(this.workStrExpGained / cancMult, 4) + " strength exp <br>" + formatNumber(this.workStrExpGained, 4) + " strength exp <br>" +
formatNumber(this.workDefExpGained / cancMult, 4) + " defense exp <br>" + formatNumber(this.workDefExpGained, 4) + " defense exp <br>" +
formatNumber(this.workDexExpGained / cancMult, 4) + " dexterity exp <br>" + formatNumber(this.workDexExpGained, 4) + " dexterity exp <br>" +
formatNumber(this.workAgiExpGained / cancMult, 4) + " agility exp <br>" + formatNumber(this.workAgiExpGained, 4) + " agility exp <br>" +
formatNumber(this.workChaExpGained / cancMult, 4) + " charisma exp<br>"; formatNumber(this.workChaExpGained, 4) + " charisma exp<br>";
txt = "You worked for " + convertTimeMsToTimeElapsedString(this.timeWorked) + ".<br><br> " + txt; txt = "You worked for " + convertTimeMsToTimeElapsedString(this.timeWorked) + ".<br><br> " + txt;
dialogBoxCreate(txt); dialogBoxCreate(txt);

@ -128,12 +128,7 @@ function prestigeAugmentation() {
//Reset statistics of all scripts on home computer //Reset statistics of all scripts on home computer
for (var i = 0; i < homeComp.scripts.length; ++i) { for (var i = 0; i < homeComp.scripts.length; ++i) {
var s = homeComp.scripts[i]; var s = homeComp.scripts[i];
s.offlineRunningTime = 0.01; //Seconds s.reset();
s.offlineMoneyMade = 0;
s.offlineExpGained = 0;
s.onlineRunningTime = 0.01; //Seconds
s.onlineMoneyMade = 0;
s.onlineExpGained = 0;
} }
//Delete all running scripts objects //Delete all running scripts objects
@ -159,13 +154,17 @@ function prestigeAugmentation() {
//Delete Companies //Delete Companies
for (var member in Companies) { for (var member in Companies) {
delete Companies[member]; if (Companies.hasOwnProperty(member)) {
delete Companies[member];
}
} }
Companies = {}; Companies = {};
//Reset Factions //Reset Factions
for (var member in Factions) { for (var member in Factions) {
Factions[member].reset(); if (Factions.hasOwnProperty(member)) {
Factions[member].reset();
}
} }
//Re-initialize Augmentations - This will update any changes //Re-initialize Augmentations - This will update any changes

@ -139,6 +139,17 @@ Script.prototype.saveScript = function() {
} }
} }
Script.prototype.reset = function() {
this.offlineRunningTime = 0.01; //Seconds
this.offlineMoneyMade = 0;
this.offlineExpGained = 0;
this.onlineRunningTime = 0.01; //Seconds
this.onlineMoneyMade = 0;
this.onlineExpGained = 0;
this.moneyStolenMap = new AllServersToMoneyMap();
}
//Calculates the number of instructions, which is just determined by number of semicolons //Calculates the number of instructions, which is just determined by number of semicolons
Script.prototype.updateNumInstructions = function() { Script.prototype.updateNumInstructions = function() {
var numSemicolons = this.code.split(";").length - 1; var numSemicolons = this.code.split(";").length - 1;
@ -146,9 +157,6 @@ Script.prototype.updateNumInstructions = function() {
} }
//Updates how much RAM the script uses when it is running. //Updates how much RAM the script uses when it is running.
//Right now, it is determined solely by the number of instructions
//Ideally, I would want it to be based on type of instructions as well
// (e.g. hack() costs a lot but others dont)
Script.prototype.updateRamUsage = function() { Script.prototype.updateRamUsage = function() {
this.ramUsage = this.numInstructions * 0.5; this.ramUsage = this.numInstructions * 0.5;
} }
@ -225,8 +233,9 @@ scriptCalculateOfflineProduction = function(script) {
var totalOfflineProduction = 0; var totalOfflineProduction = 0;
for (var ip in script.moneyStolenMap) { for (var ip in script.moneyStolenMap) {
if (script.moneyStolenMap.hasOwnProperty(ip)) { if (script.moneyStolenMap.hasOwnProperty(ip)) {
if (script.moneyStolenMap[ip] == 0) {continue;} if (script.moneyStolenMap[ip] == 0 || script.moneyStolenMap[ip] == null) {continue;}
var serv = AllServers[ip]; var serv = AllServers[ip];
if (serv == null) {continue;}
var production = 0.5 * script.moneyStolenMap[ip] / script.onlineRunningTime * timePassed; var production = 0.5 * script.moneyStolenMap[ip] / script.onlineRunningTime * timePassed;
production *= confidence; production *= confidence;
if (production > serv.moneyAvailable) { if (production > serv.moneyAvailable) {

@ -415,92 +415,92 @@ initForeignServers = function() {
var JoesGunsServer = new Server(); var JoesGunsServer = new Server();
JoesGunsServer.init(createRandomIp(), "joesguns", "Joe's Guns", true, false, false, false, 2); JoesGunsServer.init(createRandomIp(), "joesguns", "Joe's Guns", true, false, false, false, 2);
JoesGunsServer.setHackingParameters(10, 600000, 20, 20); JoesGunsServer.setHackingParameters(10, 1000000, 20, 20);
JoesGunsServer.setPortProperties(0); JoesGunsServer.setPortProperties(0);
AddToAllServers(JoesGunsServer); AddToAllServers(JoesGunsServer);
var Zer0NightclubServer = new Server(); var Zer0NightclubServer = new Server();
Zer0NightclubServer.init(createRandomIp(), "zer0", "ZER0 Nightclub", true, false, false, false, 2); Zer0NightclubServer.init(createRandomIp(), "zer0", "ZER0 Nightclub", true, false, false, false, 2);
Zer0NightclubServer.setHackingParameters(75, 750000, 25, 40); Zer0NightclubServer.setHackingParameters(75, 5000000, 25, 40);
Zer0NightclubServer.setPortProperties(1); Zer0NightclubServer.setPortProperties(1);
AddToAllServers(Zer0NightclubServer); AddToAllServers(Zer0NightclubServer);
var NectarNightclubServer = new Server(); var NectarNightclubServer = new Server();
NectarNightclubServer.init(createRandomIp(), "nectar-net", "Nectar Nightclub Network", true, false, false, false, 2); NectarNightclubServer.init(createRandomIp(), "nectar-net", "Nectar Nightclub Network", true, false, false, false, 2);
NectarNightclubServer.setHackingParameters(20, 650000, 20, 25); NectarNightclubServer.setHackingParameters(20, 1200000, 20, 25);
NectarNightclubServer.setPortProperties(0); NectarNightclubServer.setPortProperties(0);
AddToAllServers(NectarNightclubServer); AddToAllServers(NectarNightclubServer);
var NeoNightclubServer = new Server(); var NeoNightclubServer = new Server();
NeoNightclubServer.init(createRandomIp(), "neo-net", "Neo Nightclub Network", true, false, false, false, 2); NeoNightclubServer.init(createRandomIp(), "neo-net", "Neo Nightclub Network", true, false, false, false, 2);
NeoNightclubServer.setHackingParameters(50, 900000, 25, 25); NeoNightclubServer.setHackingParameters(50, 2500000, 25, 25);
NeoNightclubServer.setPortProperties(1); NeoNightclubServer.setPortProperties(1);
AddToAllServers(NeoNightclubServer); AddToAllServers(NeoNightclubServer);
var SilverHelixServer = new Server(); var SilverHelixServer = new Server();
SilverHelixServer.init(createRandomIp(), "silver-helix", "Silver Helix", true, false, false, false, 2); SilverHelixServer.init(createRandomIp(), "silver-helix", "Silver Helix", true, false, false, false, 2);
SilverHelixServer.setHackingParameters(150, 5000000, 30, 30); SilverHelixServer.setHackingParameters(150, 50000000, 30, 30);
SilverHelixServer.setPortProperties(2); SilverHelixServer.setPortProperties(2);
AddToAllServers(SilverHelixServer); AddToAllServers(SilverHelixServer);
var HongFangTeaHouseServer = new Server(); var HongFangTeaHouseServer = new Server();
HongFangTeaHouseServer.init(createRandomIp(), "hong-fang-tea", "HongFang Teahouse", true, false, false, false, 0); HongFangTeaHouseServer.init(createRandomIp(), "hong-fang-tea", "HongFang Teahouse", true, false, false, false, 0);
HongFangTeaHouseServer.setHackingParameters(30, 800000, 15, 15); HongFangTeaHouseServer.setHackingParameters(30, 1500000, 15, 15);
HongFangTeaHouseServer.setPortProperties(0); HongFangTeaHouseServer.setPortProperties(0);
AddToAllServers(HongFangTeaHouseServer); AddToAllServers(HongFangTeaHouseServer);
var HaraKiriSushiBarServer = new Server(); var HaraKiriSushiBarServer = new Server();
HaraKiriSushiBarServer.setHackingParameters(40, 800000, 15, 40); HaraKiriSushiBarServer.setHackingParameters(40, 2000000, 15, 40);
HaraKiriSushiBarServer.init(createRandomIp(), "harakiri-sushi", "HaraKiri Sushi Bar Network", true, false, false, false, 0); HaraKiriSushiBarServer.init(createRandomIp(), "harakiri-sushi", "HaraKiri Sushi Bar Network", true, false, false, false, 0);
HaraKiriSushiBarServer.setPortProperties(1); HaraKiriSushiBarServer.setPortProperties(1);
AddToAllServers(HaraKiriSushiBarServer); AddToAllServers(HaraKiriSushiBarServer);
var PhantasyServer = new Server(); var PhantasyServer = new Server();
PhantasyServer.init(createRandomIp(), "phantasy", "Phantasy Club", true, false, false, false, 4); PhantasyServer.init(createRandomIp(), "phantasy", "Phantasy Club", true, false, false, false, 4);
PhantasyServer.setHackingParameters(100, 1500000, 20, 35); PhantasyServer.setHackingParameters(100, 25000000, 20, 35);
PhantasyServer.setPortProperties(2); PhantasyServer.setPortProperties(2);
AddToAllServers(PhantasyServer); AddToAllServers(PhantasyServer);
var MaxHardwareServer = new Server(); var MaxHardwareServer = new Server();
MaxHardwareServer.init(createRandomIp(), "max-hardware", "Max Hardware Store", true, false, false, false, 0); MaxHardwareServer.init(createRandomIp(), "max-hardware", "Max Hardware Store", true, false, false, false, 0);
MaxHardwareServer.setHackingParameters(80, 800000, 15, 25); MaxHardwareServer.setHackingParameters(80, 10000000, 15, 25);
MaxHardwareServer.setPortProperties(1); MaxHardwareServer.setPortProperties(1);
AddToAllServers(MaxHardwareServer); AddToAllServers(MaxHardwareServer);
var OmegaSoftwareServer = new Server(); var OmegaSoftwareServer = new Server();
OmegaSoftwareServer.init(createRandomIp(), "omega-net", "Omega Software", true, false, false, false, 8); OmegaSoftwareServer.init(createRandomIp(), "omega-net", "Omega Software", true, false, false, false, 8);
OmegaSoftwareServer.setHackingParameters(200, 10000000, 30, 35); OmegaSoftwareServer.setHackingParameters(200, 80000000, 30, 35);
OmegaSoftwareServer.setPortProperties(2); OmegaSoftwareServer.setPortProperties(2);
AddToAllServers(OmegaSoftwareServer); AddToAllServers(OmegaSoftwareServer);
//Gyms //Gyms
var CrushFitnessGymServer = new Server(); var CrushFitnessGymServer = new Server();
CrushFitnessGymServer.init(createRandomIp(), "crush-fitness", "Crush Fitness", true, false, false, false, 0); CrushFitnessGymServer.init(createRandomIp(), "crush-fitness", "Crush Fitness", true, false, false, false, 0);
CrushFitnessGymServer.setHackingParameters(250, 5000000, 40, 25); CrushFitnessGymServer.setHackingParameters(250, 10000000, 40, 25);
CrushFitnessGymServer.setPortProperties(2); CrushFitnessGymServer.setPortProperties(2);
AddToAllServers(CrushFitnessGymServer); AddToAllServers(CrushFitnessGymServer);
var IronGymServer = new Server(); var IronGymServer = new Server();
IronGymServer.init(createRandomIp(), "iron-gym", "Iron Gym Network", true, false, false, false, 0); IronGymServer.init(createRandomIp(), "iron-gym", "Iron Gym Network", true, false, false, false, 0);
IronGymServer.setHackingParameters(100, 2500000, 30, 15); IronGymServer.setHackingParameters(100, 5000000, 30, 15);
IronGymServer.setPortProperties(1); IronGymServer.setPortProperties(1);
AddToAllServers(IronGymServer); AddToAllServers(IronGymServer);
var MilleniumFitnessGymServer = new Server(); var MilleniumFitnessGymServer = new Server();
MilleniumFitnessGymServer.init(createRandomIp(), "millenium-fitness", "Millenium Fitness Network", true, false, false, false, 0); MilleniumFitnessGymServer.init(createRandomIp(), "millenium-fitness", "Millenium Fitness Network", true, false, false, false, 0);
MilleniumFitnessGymServer.setHackingParameters(500, 7500000, 50, 30); MilleniumFitnessGymServer.setHackingParameters(500, 2500000, 50, 30);
MilleniumFitnessGymServer.setPortProperties(3); MilleniumFitnessGymServer.setPortProperties(3);
AddToAllServers(MilleniumFitnessGymServer); AddToAllServers(MilleniumFitnessGymServer);
var PowerhouseGymServer = new Server(); var PowerhouseGymServer = new Server();
PowerhouseGymServer.init(createRandomIp(), "powerhouse-fitness", "Powerhouse Fitness", true, false, false, false, 0); PowerhouseGymServer.init(createRandomIp(), "powerhouse-fitness", "Powerhouse Fitness", true, false, false, false, 0);
PowerhouseGymServer.setHackingParameters(1000, 20000000, 60, 50); PowerhouseGymServer.setHackingParameters(1000, 100000000, 60, 50);
PowerhouseGymServer.setPortProperties(5); PowerhouseGymServer.setPortProperties(5);
AddToAllServers(PowerhouseGymServer); AddToAllServers(PowerhouseGymServer);
var SnapFitnessGymServer = new Server(); var SnapFitnessGymServer = new Server();
SnapFitnessGymServer.init(createRandomIp(), "snap-fitness", "Snap Fitness", true, false, false, false, 0); SnapFitnessGymServer.init(createRandomIp(), "snap-fitness", "Snap Fitness", true, false, false, false, 0);
SnapFitnessGymServer.setHackingParameters(750, 750000, 50, 45); SnapFitnessGymServer.setHackingParameters(750, 75000000, 50, 45);
SnapFitnessGymServer.setPortProperties(4); SnapFitnessGymServer.setPortProperties(4);
AddToAllServers(SnapFitnessGymServer); AddToAllServers(SnapFitnessGymServer);

@ -543,6 +543,8 @@ var Engine = {
Player.takeClass(numCycles); Player.takeClass(numCycles);
} else if (Player.workType == CONSTANTS.WorkTypeCrime) { } else if (Player.workType == CONSTANTS.WorkTypeCrime) {
Player.commitCrime(numCycles); Player.commitCrime(numCycles);
} else if (Player.workType == CONSTANTS.WorkTypeCompanyPartTime) {
Player.workPartTime(numCycles);
} else { } else {
Player.work(numCycles); Player.work(numCycles);
} }
@ -703,6 +705,10 @@ var Engine = {
Player.createProgramWork(numCyclesOffline); Player.createProgramWork(numCyclesOffline);
} else if (Player.workType == CONSTANTS.WorkTypeStudyClass) { } else if (Player.workType == CONSTANTS.WorkTypeStudyClass) {
Player.takeClass(numCyclesOffline); Player.takeClass(numCyclesOffline);
} else if (Player.workType == CONSTANTS.WorkTypeCrime) {
Player.commitCrime(numCyclesOffline);
} else if (Player.workType == CONSTANTS.WorkTypeCompanyPartTime) {
Player.workPartTime(numCycles);
} else { } else {
Player.work(numCyclesOffline); Player.work(numCyclesOffline);
} }
@ -960,7 +966,7 @@ var Engine = {
//Message at the top of terminal //Message at the top of terminal
postNetburnerText(); postNetburnerText();
//Player was working //Player was working cancel button
if (Player.isWorking) { if (Player.isWorking) {
var cancelButton = document.getElementById("work-in-progress-cancel-button"); var cancelButton = document.getElementById("work-in-progress-cancel-button");
cancelButton.addEventListener("click", function() { cancelButton.addEventListener("click", function() {
@ -971,6 +977,10 @@ var Engine = {
Player.finishCreateProgramWork(true, Player.createProgramName); Player.finishCreateProgramWork(true, Player.createProgramName);
} else if (Player.workType == CONSTANTS.WorkTypeStudyClass) { } else if (Player.workType == CONSTANTS.WorkTypeStudyClass) {
Player.finishClass(); Player.finishClass();
} else if (Player.workType == CONSTANTS.WorkTypeCrime) {
Player.finishCrime(true);
} else if (Player.workType == CONSTANTS.WorkTypeCompanyPartTime) {
Player.finishWorkPartTime();
} else { } else {
Player.finishWork(true); Player.finishWork(true);
} }

@ -13,9 +13,6 @@ function dialogBoxInit() {
document.addEventListener("DOMContentLoaded", dialogBoxInit, false); document.addEventListener("DOMContentLoaded", dialogBoxInit, false);
dialogBoxClose = function() { dialogBoxClose = function() {
if (Engine.Debug) {
console.log("Dialog Box Close called");
}
var dialogBox = document.getElementById("dialog-box-container"); var dialogBox = document.getElementById("dialog-box-container");
dialogBox.style.display = "none"; dialogBox.style.display = "none";
} }