Added Deepscan to darkweb. Cannot get invited to faction if you decline

This commit is contained in:
Daniel Xie 2017-06-07 18:35:56 -05:00
parent 598efda098
commit ac3e5c8c9e
5 changed files with 87 additions and 63 deletions

@ -749,6 +749,8 @@
<br> <br>
<a id="changelog-link" class="a-link-button" style="display:block;"> Changelog </a> <a id="changelog-link" class="a-link-button" style="display:block;"> Changelog </a>
<a id="save-game-link" class="a-link-button" style="display:block;"> Save Game </a> <a id="save-game-link" class="a-link-button" style="display:block;"> Save Game </a>
<a id="export-game-link" class="a-link-button" style="display:block;"> Export Game </a>
<a id="import-game-link" class="a-link-button" style="display:block;"> Import Game </a>
<a id="delete-game-link" class="a-link-button" style="display:block;"> Delete Game </a> <a id="delete-game-link" class="a-link-button" style="display:block;"> Delete Game </a>
<a id="debug-delete-scripts-link" class="a-link-button tooltip" style="display:block;"> <a id="debug-delete-scripts-link" class="a-link-button tooltip" style="display:block;">
(DEBUG) Delete Active Scripts (DEBUG) Delete Active Scripts

@ -47,7 +47,7 @@ listAllDarkwebItems = function() {
} }
buyDarkwebItem = function(itemName) { buyDarkwebItem = function(itemName) {
if (itemName.toLowerCase() == "brutessh.exe") { if (itemName.toLowerCase() == Programs.BruteSSHProgram.toLowerCase()) {
var price = parseDarkwebItemPrice(DarkWebItems.BruteSSHProgram); var price = parseDarkwebItemPrice(DarkWebItems.BruteSSHProgram);
if (price > 0 && Player.money >= price) { if (price > 0 && Player.money >= price) {
Player.loseMoney(price); Player.loseMoney(price);
@ -57,7 +57,7 @@ buyDarkwebItem = function(itemName) {
} else { } else {
post("Not enough money to purchase " + itemName); post("Not enough money to purchase " + itemName);
} }
} else if (itemName.toLowerCase() == "ftpcrack.exe") { } else if (itemName.toLowerCase() == Programs.FTPCrackProgram.toLowerCase()) {
var price = parseDarkwebItemPrice(DarkWebItems.FTPCrackProgram); var price = parseDarkwebItemPrice(DarkWebItems.FTPCrackProgram);
if (price > 0 && Player.money >= price) { if (price > 0 && Player.money >= price) {
Player.loseMoney(price); Player.loseMoney(price);
@ -67,7 +67,7 @@ buyDarkwebItem = function(itemName) {
} else { } else {
post("Not enough money to purchase " + itemName); post("Not enough money to purchase " + itemName);
} }
} else if (itemName.toLowerCase() == "relaysmtp.exe") { } else if (itemName.toLowerCase() == Programs.RelaySMTPProgram.toLowerCase()) {
var price = parseDarkwebItemPrice(DarkWebItems.RelaySMTPProgram); var price = parseDarkwebItemPrice(DarkWebItems.RelaySMTPProgram);
if (price > 0 && Player.money >= price) { if (price > 0 && Player.money >= price) {
Player.loseMoney(price); Player.loseMoney(price);
@ -77,7 +77,7 @@ buyDarkwebItem = function(itemName) {
} else { } else {
post("Not enough money to purchase " + itemName); post("Not enough money to purchase " + itemName);
} }
} else if (itemName.toLowerCase() == "httpworm.exe") { } else if (itemName.toLowerCase() == Programs.HTTPWormProgram.toLowerCase()) {
var price = parseDarkwebItemPrice(DarkWebItems.HTTPWormProgram); var price = parseDarkwebItemPrice(DarkWebItems.HTTPWormProgram);
if (price > 0 && Player.money >= price) { if (price > 0 && Player.money >= price) {
Player.loseMoney(price); Player.loseMoney(price);
@ -87,7 +87,7 @@ buyDarkwebItem = function(itemName) {
} else { } else {
post("Not enough money to purchase " + itemName); post("Not enough money to purchase " + itemName);
} }
} else if (itemName.toLowerCase() == "sqlinject.exe") { } else if (itemName.toLowerCase() == Programs.SQLInjectProgram.toLowerCase()) {
var price = parseDarkwebItemPrice(DarkWebItems.SQLInjectProgram); var price = parseDarkwebItemPrice(DarkWebItems.SQLInjectProgram);
if (price > 0 && Player.money >= price) { if (price > 0 && Player.money >= price) {
Player.loseMoney(price); Player.loseMoney(price);
@ -97,6 +97,26 @@ buyDarkwebItem = function(itemName) {
} else { } else {
post("Not enough money to purchase " + itemName); post("Not enough money to purchase " + itemName);
} }
} else if (itemName.toLowerCase() == Programs.DeepscanV1.toLowerCase()) {
var price = parseDarkwebItemPrice(DarkWebItems.DeepScanV1Program);
if (price > 0 && Player.money >= price) {
Player.loseMoney(price);
Player.getHomeComputer().programs.push(Programs.DeepscanV1);
post("You have purchased the DeepscanV1.exe program. The new program " +
"can be found on your home computer.");
} else {
post("Not enough money to purchase " + itemName);
}
} else if (itemName.toLowerCase() == Programs.DeepscanV2.toLowerCase()) {
var price = parseDarkwebItemPrice(DarkWebItems.DeepScanV2Program);
if (price > 0 && Player.money >= price) {
Player.loseMoney(price);
Player.getHomeComputer().programs.push(Programs.DeepscanV2);
post("You have purchased the DeepscanV2.exe program. The new program " +
"can be found on your home computer.");
} else {
post("Not enough money to purchase " + itemName);
}
} else { } else {
post("Unrecognized item"); post("Unrecognized item");
} }
@ -129,4 +149,6 @@ DarkWebItems = {
RelaySMTPProgram: Programs.RelaySMTPProgram + " - $5,000,000 - Opens up SMTP Ports", RelaySMTPProgram: Programs.RelaySMTPProgram + " - $5,000,000 - Opens up SMTP Ports",
HTTPWormProgram: Programs.HTTPWormProgram + " - $30,000,000 - Opens up HTTP Ports", HTTPWormProgram: Programs.HTTPWormProgram + " - $30,000,000 - Opens up HTTP Ports",
SQLInjectProgram: Programs.SQLInjectProgram + " - $250,000,000 - Opens up SQL Ports", SQLInjectProgram: Programs.SQLInjectProgram + " - $250,000,000 - Opens up SQL Ports",
DeepScanV1Program: Programs.DeepscanV1 + " - $500,000 - Enables 'scan-analyze' with a depth up to 5",
DeepScanV2Program: Programs.DeepscanV2 + " - $25,000,000 - Enables 'scan-analyze' with a depth up to 10",
} }

@ -189,7 +189,7 @@ PlayerObject.prototype.checkForFactionInvitations = function() {
//Illuminati //Illuminati
var illuminatiFac = Factions["Illuminati"]; var illuminatiFac = Factions["Illuminati"];
if (illuminatiFac.isBanned == false && illuminatiFac.isMember == false && if (!illuminatiFac.isBanned && !illuminatiFac.isMember && !illuminatiFac.alreadyInvited &&
this.numAugmentations >= 10 && this.numAugmentations >= 10 &&
this.money >= 10000000000 && this.total_money >= 20000000000 && this.money >= 10000000000 && this.total_money >= 20000000000 &&
this.hacking_skill >= 800 && this.total_hacking >= 7000 && this.hacking_skill >= 800 && this.total_hacking >= 7000 &&
@ -202,7 +202,7 @@ PlayerObject.prototype.checkForFactionInvitations = function() {
//Daedalus //Daedalus
var daedalusFac = Factions["Daedalus"]; var daedalusFac = Factions["Daedalus"];
if (daedalusFac.isBanned == false && daedalusFac.isMember == false && if (!daedalusFac.isBanned && !daedalusFac.isMember && !daedalusFac.alreadyInvited &&
this.numAugmentations >= 15 && this.numAugmentations >= 15 &&
this.money >= 1000000000 && this.total_money >= 10000000000 && this.money >= 1000000000 && this.total_money >= 10000000000 &&
this.hacking_skill >= 1000 && this.total_hacking >= 10000 && this.hacking_skill >= 1000 && this.total_hacking >= 10000 &&
@ -215,7 +215,7 @@ PlayerObject.prototype.checkForFactionInvitations = function() {
//The Covenant //The Covenant
var covenantFac = Factions["The Covenant"]; var covenantFac = Factions["The Covenant"];
if (covenantFac.isBanned == false && covenantFac.isMember == false && if (!covenantFac.isBanned && !covenantFac.isMember && !covenantFac.alreadyInvited &&
this.numAugmentations >= 12 && this.numAugmentations >= 12 &&
this.money >= 5000000000 && this.total_money >= 10000000000 && this.money >= 5000000000 && this.total_money >= 10000000000 &&
this.hacking_skill >= 850 && this.total_hack >= 5000 && this.hacking_skill >= 850 && this.total_hack >= 5000 &&
@ -228,63 +228,65 @@ PlayerObject.prototype.checkForFactionInvitations = function() {
//ECorp //ECorp
var ecorpFac = Factions["ECorp"]; var ecorpFac = Factions["ECorp"];
if (ecorpFac.isBanned == false && ecorpFac.isMember == false && if (!ecorpFac.isBanned && !ecorpFac.isMember && !ecorpFac.alreadyInvited &&
this.companyName == Locations.AevumECorp && companyRep >= CONSTANTS.CorpFactionRepRequirement) { this.companyName == Locations.AevumECorp && companyRep >= CONSTANTS.CorpFactionRepRequirement) {
invitedFactions.push(ecorpFac); invitedFactions.push(ecorpFac);
} }
//MegaCorp //MegaCorp
var megacorpFac = Factions["MegaCorp"]; var megacorpFac = Factions["MegaCorp"];
if (megacorpFac.isBanned == false && megacorpFac.isMember == false && if (!megacorpFac.isBanned && !megacorpFac.isMember && !megacorpFac.alreadyInvited &&
this.companyName == Locations.Sector12MegaCorp && companyRep >= CONSTANTS.CorpFactionRepRequirement) { this.companyName == Locations.Sector12MegaCorp && companyRep >= CONSTANTS.CorpFactionRepRequirement) {
invitedFactions.push(megacorpFac); invitedFactions.push(megacorpFac);
} }
//Bachman & Associates //Bachman & Associates
var bachmanandassociatesFac = Factions["Bachman & Associates"]; var bachmanandassociatesFac = Factions["Bachman & Associates"];
if (bachmanandassociatesFac.isBanned == false && bachmanandassociatesFac.isMember == false && if (!bachmanandassociatesFac.isBanned && !bachmanandassociatesFac.isMember &&
!bachmanandassociatesFac.alreadyInvited &&
this.companyName == Locations.AevumBachmanAndAssociates && companyRep >= CONSTANTS.CorpFactionRepRequirement) { this.companyName == Locations.AevumBachmanAndAssociates && companyRep >= CONSTANTS.CorpFactionRepRequirement) {
invitedFactions.push(bachmanandassociatesFac); invitedFactions.push(bachmanandassociatesFac);
} }
//Blade Industries //Blade Industries
var bladeindustriesFac = Factions["Blade Industries"]; var bladeindustriesFac = Factions["Blade Industries"];
if (bladeindustriesFac.isBanned == false && bladeindustriesFac.isMember == false && if (!bladeindustriesFac.isBanned && !bladeindustriesFac.isMember && !bladeindustriesFac.alreadyInvited &&
this.companyName == Locations.Sector12BladeIndustries && companyRep >= CONSTANTS.CorpFactionRepRequirement) { this.companyName == Locations.Sector12BladeIndustries && companyRep >= CONSTANTS.CorpFactionRepRequirement) {
invitedFactions.push(bladeindustriesFac); invitedFactions.push(bladeindustriesFac);
} }
//NWO //NWO
var nwoFac = Factions["NWO"]; var nwoFac = Factions["NWO"];
if (nwoFac.isBanned == false && nwoFac.isMember == false && if (!nwoFac.isBanned && !nwoFac.isMember && !nwoFac.alreadyInvited &&
this.companyName == Locations.VolhavenNWO && companyRep >= CONSTANTS.CorpFactionRepRequirement) { this.companyName == Locations.VolhavenNWO && companyRep >= CONSTANTS.CorpFactionRepRequirement) {
invitedFactions.push(nwoFac); invitedFactions.push(nwoFac);
} }
//Clarke Incorporated //Clarke Incorporated
var clarkeincorporatedFac = Factions["Clarke Incorporated"]; var clarkeincorporatedFac = Factions["Clarke Incorporated"];
if (clarkeincorporatedFac.isBanned == false && clarkeincorporatedFac.isMember == false && if (!clarkeincorporatedFac.isBanned && !clarkeincorporatedFac.isMember && !clarkeincorporatedFac.alreadyInvited &&
this.companyName == Locations.AevumClarkeIncorporated && companyRep >= CONSTANTS.CorpFactionRepRequirement) { this.companyName == Locations.AevumClarkeIncorporated && companyRep >= CONSTANTS.CorpFactionRepRequirement) {
invitedFactions.push(clarkeincorporatedFac); invitedFactions.push(clarkeincorporatedFac);
} }
//OmniTek Incorporated //OmniTek Incorporated
var omnitekincorporatedFac = Factions["OmniTek Incorporated"]; var omnitekincorporatedFac = Factions["OmniTek Incorporated"];
if (omnitekincorporatedFac.isBanned == false && omnitekincorporatedFac.isMember == false && if (!omnitekincorporatedFac.isBanned && !omnitekincorporatedFac.isMember && !omnitekincorporatedFac.alreadyInvited &&
this.companyName == Locations.VolhavenOmniTekIncorporated && companyRep >= CONSTANTS.CorpFactionRepRequirement) { this.companyName == Locations.VolhavenOmniTekIncorporated && companyRep >= CONSTANTS.CorpFactionRepRequirement) {
invitedFactions.push(omnitekincorporatedFac); invitedFactions.push(omnitekincorporatedFac);
} }
//Four Sigma //Four Sigma
var foursigmaFac = Factions["Four Sigma"]; var foursigmaFac = Factions["Four Sigma"];
if (foursigmaFac.isBanned == false && foursigmaFac.isMember == false && if (!foursigmaFac.isBanned && !foursigmaFac.isMember && !foursigmaFac.alreadyInvited &&
this.companyName == Locations.Sector12FourSigma && companyRep >= CONSTANTS.CorpFactionRepRequirement) { this.companyName == Locations.Sector12FourSigma && companyRep >= CONSTANTS.CorpFactionRepRequirement) {
invitedFactions.push(foursigmaFac); invitedFactions.push(foursigmaFac);
} }
//KuaiGong International //KuaiGong International
var kuaigonginternationalFac = Factions["KuaiGong International"]; var kuaigonginternationalFac = Factions["KuaiGong International"];
if (kuaigonginternationalFac.isBanned == false && kuaigonginternationalFac.isMember == false && if (!kuaigonginternationalFac.isBanned && !kuaigonginternationalFac.isMember &&
!kuaigonginternationalFac.alreadyInvited &&
this.companyName == Locations.ChongqingKuaiGongInternational && companyRep >= CONSTANTS.CorpFactionRepRequirement) { this.companyName == Locations.ChongqingKuaiGongInternational && companyRep >= CONSTANTS.CorpFactionRepRequirement) {
invitedFactions.push(kuaigonginternationalFac); invitedFactions.push(kuaigonginternationalFac);
} }
@ -295,7 +297,8 @@ PlayerObject.prototype.checkForFactionInvitations = function() {
if (fulcrumSecretServer == null) { if (fulcrumSecretServer == null) {
console.log("ERROR: Could not find Fulcrum Secret Technologies Server"); console.log("ERROR: Could not find Fulcrum Secret Technologies Server");
} else { } else {
if (fulcrumsecrettechonologiesFac.isBanned == false && fulcrumsecrettechonologiesFac.isMember == false && if (!fulcrumsecrettechonologiesFac.isBanned && !fulcrumsecrettechonologiesFac.isMember &&
!fulcrumsecrettechonologiesFac.alreadyInvited &&
fulcrumSecretServer.manuallyHacked && fulcrumSecretServer.manuallyHacked &&
this.companyName == Locations.AevumFulcrumTechnologies && companyRep >= 250000) { this.companyName == Locations.AevumFulcrumTechnologies && companyRep >= 250000) {
invitedFactions.push(fulcrumsecrettechonologiesFac); invitedFactions.push(fulcrumsecrettechonologiesFac);
@ -308,8 +311,8 @@ PlayerObject.prototype.checkForFactionInvitations = function() {
var bitrunnersServer = AllServers[SpecialServerIps[SpecialServerNames.BitRunnersServer]]; var bitrunnersServer = AllServers[SpecialServerIps[SpecialServerNames.BitRunnersServer]];
if (bitrunnersServer == null) { if (bitrunnersServer == null) {
console.log("ERROR: Could not find BitRunners Server"); console.log("ERROR: Could not find BitRunners Server");
} else if (bitrunnersFac.isBanned == false && bitrunnersFac.isMember == false && bitrunnersServer.manuallyHacked && } else if (!bitrunnersFac.isBanned && !bitrunnersFac.isMember && bitrunnersServer.manuallyHacked &&
this.hacking_skill >= 500 && homeComp.maxRam >= 128) { !bitrunnersFac.alreadyInvited && this.hacking_skill >= 500 && homeComp.maxRam >= 128) {
invitedFactions.push(bitrunnersFac); invitedFactions.push(bitrunnersFac);
} }
@ -319,7 +322,7 @@ PlayerObject.prototype.checkForFactionInvitations = function() {
if (blackhandServer == null) { if (blackhandServer == null) {
console.log("ERROR: Could not find The Black Hand Server"); console.log("ERROR: Could not find The Black Hand Server");
} else if (!theblackhandFac.isBanned && !theblackhandFac.isMember && blackhandServer.manuallyHacked && } else if (!theblackhandFac.isBanned && !theblackhandFac.isMember && blackhandServer.manuallyHacked &&
this.hacking_skill >= 350 && homeComp.maxRam >= 64) { !theblackhandFac.alreadyInvited && this.hacking_skill >= 350 && homeComp.maxRam >= 64) {
invitedFactions.push(theblackhandFac); invitedFactions.push(theblackhandFac);
} }
@ -329,55 +332,55 @@ PlayerObject.prototype.checkForFactionInvitations = function() {
if (nitesecServer == null) { if (nitesecServer == null) {
console.log("ERROR: Could not find NiteSec Server"); console.log("ERROR: Could not find NiteSec Server");
} else if (!nitesecFac.isBanned && !nitesecFac.isMember && nitesecServer.manuallyHacked && } else if (!nitesecFac.isBanned && !nitesecFac.isMember && nitesecServer.manuallyHacked &&
this.hacking_skill >= 200 && homeComp.maxRam >= 32) { !nitesecFac.alreadyInvited && this.hacking_skill >= 200 && homeComp.maxRam >= 32) {
invitedFactions.push(nitesecFac); invitedFactions.push(nitesecFac);
} }
//Chongqing //Chongqing
var chongqingFac = Factions["Chongqing"]; var chongqingFac = Factions["Chongqing"];
if (chongqingFac.isBanned == false && chongqingFac.isMember == false && if (!chongqingFac.isBanned && !chongqingFac.isMember && !chongqingFac.alreadyInvited &&
this.money >= 20000000 && this.city == Locations.Chongqing) { this.money >= 20000000 && this.city == Locations.Chongqing) {
invitedFactions.push(chongqingFac); invitedFactions.push(chongqingFac);
} }
//Sector-12 //Sector-12
var sector12Fac = Factions["Sector-12"]; var sector12Fac = Factions["Sector-12"];
if (sector12Fac.isBanned == false && sector12Fac.isMember == false && if (!sector12Fac.isBanned && !sector12Fac.isMember && !sector12Fac.alreadyInvited &&
this.money >= 15000000 && this.city == Locations.Sector12) { this.money >= 15000000 && this.city == Locations.Sector12) {
invitedFactions.push(sector12Fac); invitedFactions.push(sector12Fac);
} }
//New Tokyo //New Tokyo
var newtokyoFac = Factions["New Tokyo"]; var newtokyoFac = Factions["New Tokyo"];
if (newtokyoFac.isBanned == false && newtokyoFac.isMember == false && if (!newtokyoFac.isBanned && !newtokyoFac.isMember && !newtokyoFac.alreadyInvited &&
this.money >= 20000000 && this.city == Locations.NewTokyo) { this.money >= 20000000 && this.city == Locations.NewTokyo) {
invitedFactions.push(newtokyoFac); invitedFactions.push(newtokyoFac);
} }
//Aevum //Aevum
var aevumFac = Factions["Aevum"]; var aevumFac = Factions["Aevum"];
if (aevumFac.isBanned == false && aevumFac.isMember == false && if (!aevumFac.isBanned && !aevumFac.isMember && !aevumFac.alreadyInvited &&
this.money >= 40000000 && this.city == Locations.Aevum) { this.money >= 40000000 && this.city == Locations.Aevum) {
invitedFactions.push(aevumFac); invitedFactions.push(aevumFac);
} }
//Ishima //Ishima
var ishimaFac = Factions["Ishima"]; var ishimaFac = Factions["Ishima"];
if (ishimaFac.isBanned == false && ishimaFac.isMember == false && if (!ishimaFac.isBanned && !ishimaFac.isMember && !ishimaFac.alreadyInvited &&
this.money >= 30000000 && this.city == Locations.Ishima) { this.money >= 30000000 && this.city == Locations.Ishima) {
invitedFactions.push(ishimaFac); invitedFactions.push(ishimaFac);
} }
//Volhaven //Volhaven
var volhavenFac = Factions["Volhaven"]; var volhavenFac = Factions["Volhaven"];
if (volhavenFac.isBanned == false && volhavenFac.isMember == false && if (!volhavenFac.isBanned && !volhavenFac.isMember && !volhavenFac.alreadyInvited &&
this.money >= 50000000 && this.city == Locations.Volhaven) { this.money >= 50000000 && this.city == Locations.Volhaven) {
invitedFactions.push(volhavenFac); invitedFactions.push(volhavenFac);
} }
//Speakers for the Dead //Speakers for the Dead
var speakersforthedeadFac = Factions["Speakers for the Dead"]; var speakersforthedeadFac = Factions["Speakers for the Dead"];
if (speakersforthedeadFac.isBanned == false && speakersforthedeadFac.isMember == false && if (!speakersforthedeadFac.isBanned && !speakersforthedeadFac.isMember && !speakersforthedeadFac.alreadyInvited &&
this.hacking_skill >= 100 && this.strength >= 300 && this.defense >= 300 && this.hacking_skill >= 100 && this.strength >= 300 && this.defense >= 300 &&
this.dexterity >= 300 && this.agility >= 300 && this.numPeopleKilled >= 10 && this.dexterity >= 300 && this.agility >= 300 && this.numPeopleKilled >= 10 &&
this.numPeopleKilledTotal >= 100 && this.karma <= -45 && this.companyName != Locations.Sector12CIA && this.numPeopleKilledTotal >= 100 && this.karma <= -45 && this.companyName != Locations.Sector12CIA &&
@ -387,7 +390,7 @@ PlayerObject.prototype.checkForFactionInvitations = function() {
//The Dark Army //The Dark Army
var thedarkarmyFac = Factions["The Dark Army"]; var thedarkarmyFac = Factions["The Dark Army"];
if (thedarkarmyFac.isBanned == false && thedarkarmyFac.isMember == false && if (!thedarkarmyFac.isBanned && !thedarkarmyFac.isMember && !thedarkarmyFac.alreadyInvited &&
this.hacking_skill >= 300 && this.strength >= 300 && this.defense >= 300 && this.hacking_skill >= 300 && this.strength >= 300 && this.defense >= 300 &&
this.dexterity >= 300 && this.agility >= 300 && this.city == Locations.Chongqing && this.dexterity >= 300 && this.agility >= 300 && this.city == Locations.Chongqing &&
this.numPeopleKilled >= 5 && this.karma <= -45 && this.companyName != Locations.Sector12CIA && this.numPeopleKilled >= 5 && this.karma <= -45 && this.companyName != Locations.Sector12CIA &&
@ -397,7 +400,7 @@ PlayerObject.prototype.checkForFactionInvitations = function() {
//The Syndicate //The Syndicate
var thesyndicateFac = Factions["The Syndicate"]; var thesyndicateFac = Factions["The Syndicate"];
if (thesyndicateFac.isBanned == false && thesyndicateFac.isMember == false && if (!thesyndicateFac.isBanned && !thesyndicateFac.isMember && !thesyndicateFac.alreadyInvited &&
this.hacking_skill >= 200 && this.strength >= 200 && this.defense >= 200 && this.hacking_skill >= 200 && this.strength >= 200 && this.defense >= 200 &&
this.dexterity >= 200 && this.agility >= 200 && this.dexterity >= 200 && this.agility >= 200 &&
(this.city == Locations.Aevum || this.city == Locations.Sector12) && (this.city == Locations.Aevum || this.city == Locations.Sector12) &&
@ -408,7 +411,7 @@ PlayerObject.prototype.checkForFactionInvitations = function() {
//Silhouette //Silhouette
var silhouetteFac = Factions["Silhouette"]; var silhouetteFac = Factions["Silhouette"];
if (silhouetteFac.isBanned == false && silhouetteFac.isMember == false && if (!silhouetteFac.isBanned && !silhouetteFac.isMember && !silhouetteFac.alreadyInvited &&
(this.companyPosition.positionName == CompanyPositions.CTO.positionName || (this.companyPosition.positionName == CompanyPositions.CTO.positionName ||
this.companyPosition.positionName == CompanyPositions.CFO.positionName || this.companyPosition.positionName == CompanyPositions.CFO.positionName ||
this.companyPosition.positionName == CompanyPositions.CEO.positionName) && this.companyPosition.positionName == CompanyPositions.CEO.positionName) &&
@ -418,7 +421,7 @@ PlayerObject.prototype.checkForFactionInvitations = function() {
//Tetrads //Tetrads
var tetradsFac = Factions["Tetrads"]; var tetradsFac = Factions["Tetrads"];
if (tetradsFac.isBanned == false && tetradsFac.isMember == false && if (!tetradsFac.isBanned && !tetradsFac.isMember && !tetradsFac.alreadyInvited &&
(this.city == Locations.Chongqing || this.city == Locations.NewTokyo || (this.city == Locations.Chongqing || this.city == Locations.NewTokyo ||
this.city == Locations.Ishima) && this.strength >= 75 && this.defense >= 75 && this.city == Locations.Ishima) && this.strength >= 75 && this.defense >= 75 &&
this.dexterity >= 75 && this.agility >= 75 && this.karma <= -18) { this.dexterity >= 75 && this.agility >= 75 && this.karma <= -18) {
@ -427,7 +430,7 @@ PlayerObject.prototype.checkForFactionInvitations = function() {
//SlumSnakes //SlumSnakes
var slumsnakesFac = Factions["Slum Snakes"]; var slumsnakesFac = Factions["Slum Snakes"];
if (slumsnakesFac.isBanned == false && slumsnakesFac.isMember == false && if (!slumsnakesFac.isBanned && !slumsnakesFac.isMember && !slumsnakesFac.alreadyInvited &&
this.strength >= 30 && this.defense >= 30 && this.dexterity >= 30 && this.strength >= 30 && this.defense >= 30 && this.dexterity >= 30 &&
this.agility >= 30 && this.karma <= -9 && this.money >= 1000000) { this.agility >= 30 && this.karma <= -9 && this.money >= 1000000) {
invitedFactions.push(slumsnakesFac); invitedFactions.push(slumsnakesFac);
@ -443,7 +446,7 @@ PlayerObject.prototype.checkForFactionInvitations = function() {
totalHacknetRam += Player.hacknetNodes[i].ram; totalHacknetRam += Player.hacknetNodes[i].ram;
totalHacknetCores += Player.hacknetNodes[i].numCores; totalHacknetCores += Player.hacknetNodes[i].numCores;
} }
if (netburnersFac.isBanned == false && netburnersFac.isMember == false && if (!netburnersFac.isBanned && !netburnersFac.isMember && !netburnersFac.alreadyInvited &&
this.hacking_skill >= 80 && totalHacknetRam >= 8 && this.hacking_skill >= 80 && totalHacknetRam >= 8 &&
totalHacknetCores >= 4 && totalHacknetLevels >= 100) { totalHacknetCores >= 4 && totalHacknetLevels >= 100) {
invitedFactions.push(netburnersFac); invitedFactions.push(netburnersFac);
@ -451,7 +454,7 @@ PlayerObject.prototype.checkForFactionInvitations = function() {
//Tian Di Hui //Tian Di Hui
var tiandihuiFac = Factions["Tian Di Hui"]; var tiandihuiFac = Factions["Tian Di Hui"];
if (tiandihuiFac.isBanned == false && tiandihuiFac.isMember == false && if (!tiandihuiFac.isBanned && !tiandihuiFac.isMember && !tiandihuiFac.alreadyInvited &&
this.money >= 1000000 && this.hacking_skill >= 50 && this.money >= 1000000 && this.hacking_skill >= 50 &&
(this.city == Locations.Chongqing || this.city == Locations.NewTokyo || (this.city == Locations.Chongqing || this.city == Locations.NewTokyo ||
this.city == Locations.Ishima)) { this.city == Locations.Ishima)) {
@ -464,18 +467,14 @@ PlayerObject.prototype.checkForFactionInvitations = function() {
if (cybersecServer == null) { if (cybersecServer == null) {
console.log("ERROR: Could not find CyberSec Server"); console.log("ERROR: Could not find CyberSec Server");
} else if (!cybersecFac.isBanned && !cybersecFac.isMember && cybersecServer.manuallyHacked && } else if (!cybersecFac.isBanned && !cybersecFac.isMember && cybersecServer.manuallyHacked &&
this.hacking_skill >= 50) { !cybersecFac.alreadyInvited && this.hacking_skill >= 50) {
invitedFactions.push(cybersecFac); invitedFactions.push(cybersecFac);
} }
console.log("invited factions: " + invitedFactions);
return invitedFactions; return invitedFactions;
} }
inviteToFaction = function(faction) { inviteToFaction = function(faction) {
if (Engine.Debug) {
console.log("inviteToFaction() called with faction: " + faction.name);
}
factionInvitationBoxCreate(faction); factionInvitationBoxCreate(faction);
} }

@ -33,13 +33,19 @@ BitburnerSaveObject.prototype.saveGame = function() {
Engine.createStatusText("Game saved!"); Engine.createStatusText("Game saved!");
} }
loadGame = function(saveObj) { loadGame = function(saveObj, imported=false) {
if (!window.localStorage.getItem("bitburnerSave")) { var saveString = "";
console.log("No save file to load"); if (imported) {
return false;
} else {
if (!window.localStorage.getItem("bitburnerSave")) {
console.log("No save file to load");
return false;
}
var saveString = decodeURIComponent(escape(atob(window.localStorage.getItem("bitburnerSave"))));
} }
var saveString = decodeURIComponent(escape(atob(window.localStorage.getItem("bitburnerSave"))));
saveObj = JSON.parse(saveString, Reviver); saveObj = JSON.parse(saveString, Reviver);
Player = JSON.parse(saveObj.PlayerSave, Reviver); Player = JSON.parse(saveObj.PlayerSave, Reviver);
AllServers = JSON.parse(saveObj.AllServersSave, Reviver); AllServers = JSON.parse(saveObj.AllServersSave, Reviver);
@ -81,6 +87,10 @@ loadGame = function(saveObj) {
return true; return true;
} }
BitburnerSaveObject.prototype.exportGame = function() {
}
BitburnerSaveObject.prototype.deleteGame = function() { BitburnerSaveObject.prototype.deleteGame = function() {
if (window.localStorage.getItem("bitburnerSave")) { if (window.localStorage.getItem("bitburnerSave")) {
window.localStorage.removeItem("bitburnerSave"); window.localStorage.removeItem("bitburnerSave");

@ -1,16 +1,4 @@
/* Faction Invitation Pop-up box */ /* Faction Invitation Pop-up box */
function factionInvitationBoxInit() {
var cancelButton = document.getElementById("faction-invitation-box-no");
//Close Dialog box
cancelButton.addEventListener("click", function() {
factionInvitationBoxClose();
return false;
});
};
document.addEventListener("DOMContentLoaded", factionInvitationBoxInit, false);
factionInvitationBoxClose = function() { factionInvitationBoxClose = function() {
var factionInvitationBox = document.getElementById("faction-invitation-box-container"); var factionInvitationBox = document.getElementById("faction-invitation-box-container");
factionInvitationBox.style.display = "none"; factionInvitationBox.style.display = "none";
@ -37,15 +25,18 @@ factionInvitationBoxCreate = function(faction) {
//TODO Faction invitation message //TODO Faction invitation message
var newYesButton = clearEventListeners("faction-invitation-box-yes"); var newYesButton = clearEventListeners("faction-invitation-box-yes");
//var yesButton = document.getElementById("faction-invitation-box-yes");
//var newYesButton = yesButton.cloneNode(true);
//yesButton.parentNode.replaceChild(newYesButton, yesButton);
newYesButton.addEventListener("click", function() { newYesButton.addEventListener("click", function() {
joinFaction(faction); joinFaction(faction);
factionInvitationBoxClose(); factionInvitationBoxClose();
return false; return false;
}); });
var noButton = clearEventListeners("faction-invitation-box-no");
noButton.addEventListener("click", function() {
factionInvitationBoxClose();
faction.alreadyInvited = true;
return false;
});
factionInvitationBoxOpen(); factionInvitationBoxOpen();
} }