2016-11-03 22:36:01 +01:00
|
|
|
//Netburner Faction class
|
2017-05-20 10:19:13 +02:00
|
|
|
function factionInit() {
|
|
|
|
$('#faction-donate-input').on('input', function() {
|
|
|
|
if (Engine.currentPage == Engine.Page.Faction) {
|
|
|
|
var val = document.getElementById("faction-donate-input").value;
|
|
|
|
if (isPositiveNumber(val)) {
|
|
|
|
var numMoneyDonate = Number(val);
|
|
|
|
document.getElementById("faction-donate-rep-gain").innerHTML =
|
2017-06-01 03:57:49 +02:00
|
|
|
"This donation will result in " + formatNumber(numMoneyDonate/1000000 * Player.faction_rep_mult, 3) + " reputation gain";
|
2017-05-20 10:19:13 +02:00
|
|
|
} else {
|
|
|
|
document.getElementById("faction-donate-rep-gain").innerHTML =
|
|
|
|
"This donation will result in 0 reputation gain";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
document.addEventListener("DOMContentLoaded", factionInit, false);
|
|
|
|
|
2016-11-03 22:36:01 +01:00
|
|
|
function Faction(name) {
|
|
|
|
this.name = name;
|
2017-01-31 04:41:42 +01:00
|
|
|
this.augmentations = []; //Name of augmentation only
|
2017-04-19 21:19:33 +02:00
|
|
|
this.info = ""; //Introductory/informational text about the faction
|
2016-11-03 22:36:01 +01:00
|
|
|
|
|
|
|
//Player-related properties for faction
|
|
|
|
this.isMember = false; //Whether player is member
|
2017-01-31 04:41:42 +01:00
|
|
|
this.isBanned = false; //Whether or not player is banned from joining this faction
|
2016-11-03 22:36:01 +01:00
|
|
|
this.playerReputation = 0; //"Reputation" within faction
|
2017-02-17 23:19:25 +01:00
|
|
|
|
|
|
|
//Multipliers for unlocking and purchasing augmentations
|
|
|
|
this.augmentationPriceMult = 1;
|
|
|
|
this.augmentationRepRequirementMult = 1;
|
2016-11-03 22:36:01 +01:00
|
|
|
};
|
|
|
|
|
2017-02-17 23:19:25 +01:00
|
|
|
Faction.prototype.setAugmentationMultipliers = function(price, rep) {
|
|
|
|
this.augmentationPriceMult = price;
|
|
|
|
this.augmentationRepRequirementMult = rep;
|
|
|
|
}
|
|
|
|
|
2017-04-19 21:19:33 +02:00
|
|
|
Faction.prototype.setInfo = function(inf) {
|
|
|
|
this.info = inf;
|
2016-12-22 18:13:00 +01:00
|
|
|
}
|
|
|
|
|
2016-12-21 19:36:42 +01:00
|
|
|
Faction.prototype.toJSON = function() {
|
|
|
|
return Generic_toJSON("Faction", this);
|
|
|
|
}
|
|
|
|
|
|
|
|
Faction.fromJSON = function(value) {
|
|
|
|
return Generic_fromJSON(Faction, value.data);
|
|
|
|
}
|
|
|
|
|
|
|
|
Reviver.constructors.Faction = Faction;
|
|
|
|
|
2016-12-20 21:31:41 +01:00
|
|
|
//Map of factions indexed by faction name
|
2016-12-20 21:18:34 +01:00
|
|
|
Factions = {}
|
2016-12-20 21:31:41 +01:00
|
|
|
|
|
|
|
AddToFactions = function(faction) {
|
|
|
|
var name = faction.name;
|
|
|
|
Factions[name] = faction;
|
|
|
|
}
|
|
|
|
|
2017-02-17 23:19:25 +01:00
|
|
|
//TODO Augmentation price and rep requirement mult are 1 for everything right now,
|
|
|
|
// This might change in the future for balance
|
2016-12-20 21:31:41 +01:00
|
|
|
initFactions = function() {
|
2016-11-03 22:36:01 +01:00
|
|
|
//Endgame
|
2016-12-20 21:31:41 +01:00
|
|
|
var Illuminati = new Faction("Illuminati");
|
2017-04-19 21:19:33 +02:00
|
|
|
Illuminati.setInfo(FactionInfo.IlluminatiInfo);
|
2016-12-20 21:31:41 +01:00
|
|
|
AddToFactions(Illuminati);
|
|
|
|
var Daedalus = new Faction("Daedalus");
|
2017-04-19 21:19:33 +02:00
|
|
|
Daedalus.setInfo(FactionInfo.DaedalusInfo);
|
2016-12-20 21:31:41 +01:00
|
|
|
AddToFactions(Daedalus);
|
|
|
|
var Covenant = new Faction("The Covenant");
|
2017-04-19 21:19:33 +02:00
|
|
|
Covenant.setInfo(FactionInfo.CovenantInfo);
|
2016-12-20 21:31:41 +01:00
|
|
|
AddToFactions(Covenant);
|
2016-11-03 22:36:01 +01:00
|
|
|
|
|
|
|
//Megacorporations, each forms its own faction
|
2016-12-20 21:31:41 +01:00
|
|
|
var ECorp = new Faction("ECorp");
|
2017-04-19 21:19:33 +02:00
|
|
|
ECorp.setInfo(FactionInfo.ECorpInfo);
|
2016-12-20 21:31:41 +01:00
|
|
|
AddToFactions(ECorp);
|
|
|
|
var MegaCorp = new Faction("MegaCorp");
|
2017-04-19 21:19:33 +02:00
|
|
|
MegaCorp.setInfo(FactionInfo.MegaCorpInfo);
|
2016-12-20 21:31:41 +01:00
|
|
|
AddToFactions(MegaCorp);
|
|
|
|
var BachmanAndAssociates = new Faction("Bachman & Associates");
|
2017-04-19 21:19:33 +02:00
|
|
|
BachmanAndAssociates.setInfo(FactionInfo.BachmanAndAssociatesInfo);
|
2016-12-20 21:31:41 +01:00
|
|
|
AddToFactions(BachmanAndAssociates);
|
|
|
|
var BladeIndustries = new Faction("Blade Industries");
|
2017-04-19 21:19:33 +02:00
|
|
|
BladeIndustries.setInfo(FactionInfo.BladeIndustriesInfo);
|
2016-12-20 21:31:41 +01:00
|
|
|
AddToFactions(BladeIndustries);
|
|
|
|
var NWO = new Faction("NWO");
|
2017-04-19 21:19:33 +02:00
|
|
|
NWO.setInfo(FactionInfo.NWOInfo);
|
2016-12-20 21:31:41 +01:00
|
|
|
AddToFactions(NWO);
|
|
|
|
var ClarkeIncorporated = new Faction("Clarke Incorporated");
|
2017-04-19 21:19:33 +02:00
|
|
|
ClarkeIncorporated.setInfo(FactionInfo.ClarkeIncorporatedInfo);
|
2016-12-20 21:31:41 +01:00
|
|
|
AddToFactions(ClarkeIncorporated);
|
|
|
|
var OmniTekIncorporated = new Faction("OmniTek Incorporated");
|
2017-04-19 21:19:33 +02:00
|
|
|
OmniTekIncorporated.setInfo(FactionInfo.OmniTekIncorporatedInfo);
|
2016-12-20 21:31:41 +01:00
|
|
|
AddToFactions(OmniTekIncorporated);
|
|
|
|
var FourSigma = new Faction("Four Sigma");
|
2017-04-19 21:19:33 +02:00
|
|
|
FourSigma.setInfo(FactionInfo.FourSigmaInfo);
|
2016-12-20 21:31:41 +01:00
|
|
|
AddToFactions(FourSigma);
|
|
|
|
var KuaiGongInternational = new Faction("KuaiGong International");
|
2017-04-19 21:19:33 +02:00
|
|
|
KuaiGongInternational.setInfo(FactionInfo.KuaiGongInternationalInfo);
|
2016-12-20 21:31:41 +01:00
|
|
|
AddToFactions(KuaiGongInternational);
|
2017-02-09 19:35:28 +01:00
|
|
|
|
|
|
|
//Other corporations
|
|
|
|
var FulcrumTechnologies = new Faction("Fulcrum Secret Technologies");
|
2017-04-19 21:19:33 +02:00
|
|
|
FulcrumTechnologies.setInfo(FactionInfo.FulcrumSecretTechnologiesInfo);
|
2017-02-09 19:35:28 +01:00
|
|
|
AddToFactions(FulcrumTechnologies);
|
2016-11-03 22:36:01 +01:00
|
|
|
|
|
|
|
//Hacker groups
|
2016-12-20 21:31:41 +01:00
|
|
|
var BitRunners = new Faction("BitRunners");
|
2017-04-19 21:19:33 +02:00
|
|
|
BitRunners.setInfo(FactionInfo.BitRunnersInfo);
|
2016-12-20 21:31:41 +01:00
|
|
|
AddToFactions(BitRunners);
|
|
|
|
var BlackHand = new Faction("The Black Hand");
|
2017-04-19 21:19:33 +02:00
|
|
|
BlackHand.setInfo(FactionInfo.BlackHandInfo);
|
2016-12-20 21:31:41 +01:00
|
|
|
AddToFactions(BlackHand);
|
|
|
|
var NiteSec = new Faction("NiteSec");
|
2017-04-19 21:19:33 +02:00
|
|
|
NiteSec.setInfo(FactionInfo.NiteSecInfo);
|
2016-12-20 21:31:41 +01:00
|
|
|
AddToFactions(NiteSec);
|
2016-11-03 22:36:01 +01:00
|
|
|
|
|
|
|
//City factions, essentially governments
|
2016-12-20 21:31:41 +01:00
|
|
|
var Chongqing = new Faction("Chongqing");
|
2017-04-19 21:19:33 +02:00
|
|
|
Chongqing.setInfo(FactionInfo.ChongqingInfo);
|
2016-12-20 21:31:41 +01:00
|
|
|
AddToFactions(Chongqing);
|
|
|
|
var Sector12 = new Faction("Sector-12");
|
2017-04-19 21:19:33 +02:00
|
|
|
Sector12.setInfo(FactionInfo.Sector12Info);
|
2016-12-20 21:31:41 +01:00
|
|
|
AddToFactions(Sector12);
|
2017-01-11 21:00:51 +01:00
|
|
|
var NewTokyo = new Faction("New Tokyo");
|
2017-04-19 21:19:33 +02:00
|
|
|
NewTokyo.setInfo(FactionInfo.NewTokyoInfo);
|
2017-01-11 21:00:51 +01:00
|
|
|
AddToFactions(NewTokyo);
|
2016-12-20 21:31:41 +01:00
|
|
|
var Aevum = new Faction("Aevum");
|
2017-04-19 21:19:33 +02:00
|
|
|
Aevum.setInfo(FactionInfo.AevumInfo);
|
2016-12-20 21:31:41 +01:00
|
|
|
AddToFactions(Aevum);
|
|
|
|
var Ishima = new Faction("Ishima");
|
2017-04-19 21:19:33 +02:00
|
|
|
Ishima.setInfo(FactionInfo.IshimaInfo);
|
2016-12-20 21:31:41 +01:00
|
|
|
AddToFactions(Ishima);
|
|
|
|
var Volhaven = new Faction("Volhaven");
|
2017-04-19 21:19:33 +02:00
|
|
|
Volhaven.setInfo(FactionInfo.VolhavenInfo);
|
2016-12-20 21:31:41 +01:00
|
|
|
AddToFactions(Volhaven);
|
2016-11-17 16:31:52 +01:00
|
|
|
|
|
|
|
//Criminal Organizations/Gangs
|
2016-12-22 17:19:02 +01:00
|
|
|
var SpeakersForTheDead = new Faction("Speakers for the Dead");
|
2017-04-19 21:19:33 +02:00
|
|
|
SpeakersForTheDead.setInfo(FactionInfo.SpeakersForTheDeadInfo);
|
2016-12-22 16:56:15 +01:00
|
|
|
AddToFactions(SpeakersForTheDead);
|
|
|
|
var DarkArmy = new Faction("The Dark Army");
|
2017-04-19 21:19:33 +02:00
|
|
|
DarkArmy.setInfo(FactionInfo.DarkArmyInfo);
|
2016-12-22 16:56:15 +01:00
|
|
|
AddToFactions(DarkArmy);
|
|
|
|
var TheSyndicate = new Faction("The Syndicate");
|
2017-04-19 21:19:33 +02:00
|
|
|
TheSyndicate.setInfo(FactionInfo.TheSyndicateInfo);
|
2016-12-22 16:56:15 +01:00
|
|
|
AddToFactions(TheSyndicate);
|
2017-04-19 23:54:01 +02:00
|
|
|
var Silhouette = new Faction("Silhouette");
|
|
|
|
Silhouette.setInfo(FactionInfo.SilhouetteInfo);
|
|
|
|
AddToFactions(Silhouette);
|
2017-05-12 20:12:32 +02:00
|
|
|
var Tetrads = new Faction("Tetrads"); //Low-medium level asian crime gang
|
|
|
|
Tetrads.setInfo(FactionInfo.TetradsInfo);
|
|
|
|
AddToFactions(Tetrads);
|
|
|
|
var SlumSnakes = new Faction("Slum Snakes"); //Low level crime gang
|
|
|
|
SlumSnakes.setInfo(FactionInfo.SlumSnakesInfo);
|
|
|
|
AddToFactions(SlumSnakes);
|
2016-11-17 16:31:52 +01:00
|
|
|
|
|
|
|
//Earlygame factions - factions the player will prestige with early on that don't
|
|
|
|
//belong in other categories
|
2017-05-02 18:28:54 +02:00
|
|
|
var Netburners = new Faction("Netburners");
|
|
|
|
Netburners.setInfo(FactionInfo.NetburnersInfo);
|
|
|
|
AddToFactions(Netburners);
|
2016-12-22 16:56:15 +01:00
|
|
|
var TianDiHui = new Faction("Tian Di Hui"); //Society of the Heaven and Earth
|
2017-04-19 21:19:33 +02:00
|
|
|
TianDiHui.setInfo(FactionInfo.TianDiHuiInfo);
|
2016-12-22 16:56:15 +01:00
|
|
|
AddToFactions(TianDiHui);
|
2016-12-22 17:19:02 +01:00
|
|
|
var CyberSec = new Faction("CyberSec");
|
2017-04-19 21:19:33 +02:00
|
|
|
CyberSec.setInfo(FactionInfo.CyberSecInfo);
|
2016-12-22 17:19:02 +01:00
|
|
|
AddToFactions(CyberSec);
|
2016-12-22 18:13:00 +01:00
|
|
|
}
|
|
|
|
|
2017-02-09 23:40:55 +01:00
|
|
|
//This function sets the requirements to join a Faction. It checks whether the Player meets
|
|
|
|
//those requirements and will return an array of all factions that the Player should
|
|
|
|
//receive an invitation to
|
2017-02-16 19:52:11 +01:00
|
|
|
PlayerObject.prototype.checkForFactionInvitations = function() {
|
|
|
|
if (Engine.Debug) {
|
|
|
|
console.log("checkForFactionInvitations() called");
|
2017-05-12 20:12:32 +02:00
|
|
|
console.log("karma: " + this.karma);
|
2017-02-16 19:52:11 +01:00
|
|
|
}
|
|
|
|
invitedFactions = []; //Array which will hold all Factions th eplayer should be invited to
|
2017-02-09 23:40:55 +01:00
|
|
|
|
2017-02-28 18:10:35 +01:00
|
|
|
var company = Companies[this.companyName];
|
2017-04-19 07:02:40 +02:00
|
|
|
var companyRep = 0;
|
|
|
|
if (company != null) {
|
|
|
|
companyRep = company.playerReputation;
|
2017-02-28 18:10:35 +01:00
|
|
|
}
|
2017-02-09 23:40:55 +01:00
|
|
|
|
|
|
|
//Illuminati
|
|
|
|
var illuminatiFac = Factions["Illuminati"];
|
|
|
|
if (illuminatiFac.isBanned == false && illuminatiFac.isMember == false &&
|
|
|
|
this.numAugmentations >= 10 &&
|
|
|
|
this.money >= 10000000000 && this.total_money >= 20000000000 &&
|
|
|
|
this.hacking_skill >= 800 && this.total_hacking >= 7000 &&
|
|
|
|
this.strength >= 900 && this.total_strength >= 10000 &&
|
|
|
|
this.defense >= 900 && this.total_defense >= 10000 &&
|
|
|
|
this.dexterity >= 900 && this.total_dexterity >= 10000 &&
|
|
|
|
this.agility >= 900 && this.total_agility >= 10000) {
|
2017-02-16 19:52:11 +01:00
|
|
|
invitedFactions.push(illuminatiFac);
|
2017-02-09 23:40:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//Daedalus
|
|
|
|
var daedalusFac = Factions["Daedalus"];
|
|
|
|
if (daedalusFac.isBanned == false && daedalusFac.isMember == false &&
|
|
|
|
this.numAugmentations >= 15 &&
|
|
|
|
this.money >= 1000000000 && this.total_money >= 10000000000 &&
|
|
|
|
this.hacking_skill >= 1000 && this.total_hacking >= 10000 &&
|
|
|
|
this.strength >= 500 && this.total_strength >= 8000 &&
|
|
|
|
this.defense >= 500 && this.total_defense >= 8000 &&
|
|
|
|
this.dexterity >= 500 && this.total_dexterity >= 8000 &&
|
|
|
|
this.agility >= 500 && this.total_agility >= 8000) {
|
2017-02-16 19:52:11 +01:00
|
|
|
invitedFactions.push(daedalusFac);
|
2017-02-09 23:40:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//The Covenant
|
|
|
|
var covenantFac = Factions["The Covenant"];
|
|
|
|
if (covenantFac.isBanned == false && covenantFac.isMember == false &&
|
|
|
|
this.numAugmentations >= 12 &&
|
|
|
|
this.money >= 5000000000 && this.total_money >= 10000000000 &&
|
|
|
|
this.hacking_skill >= 850 && this.total_hack >= 5000 &&
|
|
|
|
this.strength >= 850 && this.total_strength >= 5000 &&
|
|
|
|
this.defense >= 850 && this.total_defense >= 5000 &&
|
|
|
|
this.dexterity >= 850 && this.total_dexterity >= 5000 &&
|
|
|
|
this.agility >= 850 && this.total_agility >= 5000) {
|
2017-02-16 19:52:11 +01:00
|
|
|
invitedFactions.push(covenantFac);
|
2017-02-09 23:40:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//ECorp
|
|
|
|
var ecorpFac = Factions["ECorp"];
|
|
|
|
if (ecorpFac.isBanned == false && ecorpFac.isMember == false &&
|
|
|
|
this.companyName == Locations.AevumECorp && companyRep >= CONSTANTS.CorpFactionRepRequirement) {
|
2017-02-16 19:52:11 +01:00
|
|
|
invitedFactions.push(ecorpFac);
|
2017-02-09 23:40:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//MegaCorp
|
|
|
|
var megacorpFac = Factions["MegaCorp"];
|
|
|
|
if (megacorpFac.isBanned == false && megacorpFac.isMember == false &&
|
|
|
|
this.companyName == Locations.Sector12MegaCorp && companyRep >= CONSTANTS.CorpFactionRepRequirement) {
|
2017-02-16 19:52:11 +01:00
|
|
|
invitedFactions.push(megacorpFac);
|
2017-02-09 23:40:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//Bachman & Associates
|
|
|
|
var bachmanandassociatesFac = Factions["Bachman & Associates"];
|
|
|
|
if (bachmanandassociatesFac.isBanned == false && bachmanandassociatesFac.isMember == false &&
|
|
|
|
this.companyName == Locations.AevumBachmanAndAssociates && companyRep >= CONSTANTS.CorpFactionRepRequirement) {
|
2017-02-16 19:52:11 +01:00
|
|
|
invitedFactions.push(bachmanandassociatesFac);
|
2017-02-09 23:40:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//Blade Industries
|
|
|
|
var bladeindustriesFac = Factions["Blade Industries"];
|
|
|
|
if (bladeindustriesFac.isBanned == false && bladeindustriesFac.isMember == false &&
|
|
|
|
this.companyName == Locations.Sector12BladeIndustries && companyRep >= CONSTANTS.CorpFactionRepRequirement) {
|
2017-02-16 19:52:11 +01:00
|
|
|
invitedFactions.push(bladeindustriesFac);
|
2017-02-09 23:40:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//NWO
|
|
|
|
var nwoFac = Factions["NWO"];
|
|
|
|
if (nwoFac.isBanned == false && nwoFac.isMember == false &&
|
|
|
|
this.companyName == Locations.VolhavenNWO && companyRep >= CONSTANTS.CorpFactionRepRequirement) {
|
2017-02-16 19:52:11 +01:00
|
|
|
invitedFactions.push(nwoFac);
|
2017-02-09 23:40:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//Clarke Incorporated
|
|
|
|
var clarkeincorporatedFac = Factions["Clarke Incorporated"];
|
|
|
|
if (clarkeincorporatedFac.isBanned == false && clarkeincorporatedFac.isMember == false &&
|
|
|
|
this.companyName == Locations.AevumClarkeIncorporated && companyRep >= CONSTANTS.CorpFactionRepRequirement) {
|
2017-02-16 19:52:11 +01:00
|
|
|
invitedFactions.push(clarkeincorporatedFac);
|
2017-02-09 23:40:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//OmniTek Incorporated
|
|
|
|
var omnitekincorporatedFac = Factions["OmniTek Incorporated"];
|
|
|
|
if (omnitekincorporatedFac.isBanned == false && omnitekincorporatedFac.isMember == false &&
|
|
|
|
this.companyName == Locations.VolhavenOmniTekIncorporated && companyRep >= CONSTANTS.CorpFactionRepRequirement) {
|
2017-02-16 19:52:11 +01:00
|
|
|
invitedFactions.push(omnitekincorporatedFac);
|
2017-02-09 23:40:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//Four Sigma
|
|
|
|
var foursigmaFac = Factions["Four Sigma"];
|
|
|
|
if (foursigmaFac.isBanned == false && foursigmaFac.isMember == false &&
|
|
|
|
this.companyName == Locations.Sector12FourSigma && companyRep >= CONSTANTS.CorpFactionRepRequirement) {
|
2017-02-16 19:52:11 +01:00
|
|
|
invitedFactions.push(foursigmaFac);
|
2017-02-09 23:40:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//KuaiGong International
|
|
|
|
var kuaigonginternationalFac = Factions["KuaiGong International"];
|
|
|
|
if (kuaigonginternationalFac.isBanned == false && kuaigonginternationalFac.isMember == false &&
|
|
|
|
this.companyName == Locations.ChongqingKuaiGongInternational && companyRep >= CONSTANTS.CorpFactionRepRequirement) {
|
2017-02-16 19:52:11 +01:00
|
|
|
invitedFactions.push(kuaigonginternationalFac);
|
2017-02-09 23:40:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//Fulcrum Secret Technologies - If u've unlocked fulcrum secret technolgoies server and have a high rep with the company
|
|
|
|
var fulcrumsecrettechonologiesFac = Factions["Fulcrum Secret Technologies"];
|
2017-06-02 06:15:45 +02:00
|
|
|
var fulcrumSecretServer = AllServers[SpecialServerIps[SpecialServerNames.FulcrumSecretTechnologies]];
|
2017-02-09 23:40:55 +01:00
|
|
|
if (fulcrumSecretServer == null) {
|
2017-06-02 06:15:45 +02:00
|
|
|
console.log("ERROR: Could not find Fulcrum Secret Technologies Server");
|
2017-05-12 20:52:02 +02:00
|
|
|
} else {
|
|
|
|
if (fulcrumsecrettechonologiesFac.isBanned == false && fulcrumsecrettechonologiesFac.isMember == false &&
|
2017-06-02 06:15:45 +02:00
|
|
|
fulcrumSecretServer.manuallyHacked &&
|
2017-05-12 20:52:02 +02:00
|
|
|
this.companyName == Locations.AevumFulcrumTechnologies && companyRep >= 250000) {
|
|
|
|
invitedFactions.push(fulcrumsecrettechonologiesFac);
|
|
|
|
}
|
2017-02-09 23:40:55 +01:00
|
|
|
}
|
2017-05-12 20:52:02 +02:00
|
|
|
|
2017-02-09 23:40:55 +01:00
|
|
|
//BitRunners
|
|
|
|
var bitrunnersFac = Factions["BitRunners"];
|
2017-06-02 06:15:45 +02:00
|
|
|
var homeComp = this.getHomeComputer();
|
|
|
|
var bitrunnersServer = AllServers[SpecialServerIps[SpecialServerNames.BitRunnersServer]];
|
|
|
|
if (bitrunnersServer == null) {
|
|
|
|
console.log("ERROR: Could not find BitRunners Server");
|
|
|
|
} else if (bitrunnersFac.isBanned == false && bitrunnersFac.isMember == false && bitrunnersServer.manuallyHacked &&
|
|
|
|
this.hacking_skill >= 500 && homeComp.maxRam >= 128) {
|
2017-02-16 19:52:11 +01:00
|
|
|
invitedFactions.push(bitrunnersFac);
|
2017-02-09 23:40:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//The Black Hand
|
|
|
|
var theblackhandFac = Factions["The Black Hand"];
|
2017-06-02 06:15:45 +02:00
|
|
|
var blackhandServer = AllServers[SpecialServerIps[SpecialServerNames.TheBlackHandServer]];
|
|
|
|
if (blackhandServer == null) {
|
|
|
|
console.log("ERROR: Could not find The Black Hand Server");
|
|
|
|
} else if (!theblackhandFac.isBanned && !theblackhandFac.isMember && blackhandServer.manuallyHacked &&
|
|
|
|
this.hacking_skill >= 350 && homeComp.maxRam >= 64) {
|
2017-02-16 19:52:11 +01:00
|
|
|
invitedFactions.push(theblackhandFac);
|
2017-02-09 23:40:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//NiteSec
|
|
|
|
var nitesecFac = Factions["NiteSec"];
|
2017-06-02 06:15:45 +02:00
|
|
|
var nitesecServer = AllServers[SpecialServerIps[SpecialServerNames.NiteSecServer]];
|
|
|
|
if (nitesecServer == null) {
|
|
|
|
console.log("ERROR: Could not find NiteSec Server");
|
|
|
|
} else if (!nitesecFac.isBanned && !nitesecFac.isMember && nitesecServer.manuallyHacked &&
|
2017-05-24 17:32:45 +02:00
|
|
|
this.hacking_skill >= 200 && homeComp.maxRam >= 32) {
|
2017-02-16 19:52:11 +01:00
|
|
|
invitedFactions.push(nitesecFac);
|
2017-02-09 23:40:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
//Chongqing
|
2017-02-16 19:52:11 +01:00
|
|
|
var chongqingFac = Factions["Chongqing"];
|
|
|
|
if (chongqingFac.isBanned == false && chongqingFac.isMember == false &&
|
2017-05-10 19:42:46 +02:00
|
|
|
this.money >= 20000000 && this.city == Locations.Chongqing) {
|
2017-02-16 19:52:11 +01:00
|
|
|
invitedFactions.push(chongqingFac);
|
|
|
|
}
|
|
|
|
|
2017-02-09 23:40:55 +01:00
|
|
|
//Sector-12
|
2017-02-16 19:52:11 +01:00
|
|
|
var sector12Fac = Factions["Sector-12"];
|
|
|
|
if (sector12Fac.isBanned == false && sector12Fac.isMember == false &&
|
2017-05-10 19:42:46 +02:00
|
|
|
this.money >= 15000000 && this.city == Locations.Sector12) {
|
2017-02-16 19:52:11 +01:00
|
|
|
invitedFactions.push(sector12Fac);
|
|
|
|
}
|
|
|
|
|
2017-02-09 23:40:55 +01:00
|
|
|
//New Tokyo
|
2017-02-16 19:52:11 +01:00
|
|
|
var newtokyoFac = Factions["New Tokyo"];
|
|
|
|
if (newtokyoFac.isBanned == false && newtokyoFac.isMember == false &&
|
2017-05-10 19:42:46 +02:00
|
|
|
this.money >= 20000000 && this.city == Locations.NewTokyo) {
|
2017-02-16 19:52:11 +01:00
|
|
|
invitedFactions.push(newtokyoFac);
|
|
|
|
}
|
|
|
|
|
2017-02-09 23:40:55 +01:00
|
|
|
//Aevum
|
2017-02-16 19:52:11 +01:00
|
|
|
var aevumFac = Factions["Aevum"];
|
|
|
|
if (aevumFac.isBanned == false && aevumFac.isMember == false &&
|
2017-05-10 19:42:46 +02:00
|
|
|
this.money >= 40000000 && this.city == Locations.Aevum) {
|
2017-02-16 19:52:11 +01:00
|
|
|
invitedFactions.push(aevumFac);
|
|
|
|
}
|
|
|
|
|
2017-02-09 23:40:55 +01:00
|
|
|
//Ishima
|
2017-02-16 19:52:11 +01:00
|
|
|
var ishimaFac = Factions["Ishima"];
|
|
|
|
if (ishimaFac.isBanned == false && ishimaFac.isMember == false &&
|
2017-05-10 19:42:46 +02:00
|
|
|
this.money >= 30000000 && this.city == Locations.Ishima) {
|
2017-02-16 19:52:11 +01:00
|
|
|
invitedFactions.push(ishimaFac);
|
|
|
|
}
|
|
|
|
|
2017-02-09 23:40:55 +01:00
|
|
|
//Volhaven
|
2017-02-16 19:52:11 +01:00
|
|
|
var volhavenFac = Factions["Volhaven"];
|
|
|
|
if (volhavenFac.isBanned == false && volhavenFac.isMember == false &&
|
2017-05-10 19:42:46 +02:00
|
|
|
this.money >= 50000000 && this.city == Locations.Volhaven) {
|
2017-02-16 19:52:11 +01:00
|
|
|
invitedFactions.push(volhavenFac);
|
|
|
|
}
|
|
|
|
|
2017-02-09 23:40:55 +01:00
|
|
|
//Speakers for the Dead
|
2017-02-16 19:52:11 +01:00
|
|
|
var speakersforthedeadFac = Factions["Speakers for the Dead"];
|
|
|
|
if (speakersforthedeadFac.isBanned == false && speakersforthedeadFac.isMember == false &&
|
|
|
|
this.hacking_skill >= 100 && this.strength >= 300 && this.defense >= 300 &&
|
|
|
|
this.dexterity >= 300 && this.agility >= 300 && this.numPeopleKilled >= 10 &&
|
2017-05-30 00:37:38 +02:00
|
|
|
this.numPeopleKilledTotal >= 100 && this.karma <= -45 && this.companyName != Locations.Sector12CIA &&
|
2017-02-16 19:52:11 +01:00
|
|
|
this.companyName != Locations.Sector12NSA) {
|
|
|
|
invitedFactions.push(speakersforthedeadFac);
|
2017-05-18 20:01:18 +02:00
|
|
|
}
|
2017-02-16 19:52:11 +01:00
|
|
|
|
2017-02-09 23:40:55 +01:00
|
|
|
//The Dark Army
|
2017-02-16 19:52:11 +01:00
|
|
|
var thedarkarmyFac = Factions["The Dark Army"];
|
|
|
|
if (thedarkarmyFac.isBanned == false && thedarkarmyFac.isMember == false &&
|
|
|
|
this.hacking_skill >= 300 && this.strength >= 300 && this.defense >= 300 &&
|
2017-05-10 19:42:46 +02:00
|
|
|
this.dexterity >= 300 && this.agility >= 300 && this.city == Locations.Chongqing &&
|
2017-05-30 00:37:38 +02:00
|
|
|
this.numPeopleKilled >= 5 && this.karma <= -45 && this.companyName != Locations.Sector12CIA &&
|
2017-02-16 19:52:11 +01:00
|
|
|
this.companyName != Locations.Sector12NSA) {
|
|
|
|
invitedFactions.push(thedarkarmyFac);
|
|
|
|
}
|
|
|
|
|
2017-02-09 23:40:55 +01:00
|
|
|
//The Syndicate
|
2017-02-16 19:52:11 +01:00
|
|
|
var thesyndicateFac = Factions["The Syndicate"];
|
|
|
|
if (thesyndicateFac.isBanned == false && thesyndicateFac.isMember == false &&
|
|
|
|
this.hacking_skill >= 200 && this.strength >= 200 && this.defense >= 200 &&
|
|
|
|
this.dexterity >= 200 && this.agility >= 200 &&
|
2017-05-10 19:42:46 +02:00
|
|
|
(this.city == Locations.Aevum || this.city == Locations.Sector12) &&
|
2017-05-30 00:37:38 +02:00
|
|
|
this.money >= 10000000 && this.karma <= -90 &&
|
2017-05-03 19:52:54 +02:00
|
|
|
this.companyName != Locations.Sector12CIA && this.companyName != Locations.Sector12NSA) {
|
2017-02-16 19:52:11 +01:00
|
|
|
invitedFactions.push(thesyndicateFac);
|
|
|
|
}
|
|
|
|
|
2017-04-21 21:06:41 +02:00
|
|
|
//Silhouette
|
2017-04-19 23:54:01 +02:00
|
|
|
var silhouetteFac = Factions["Silhouette"];
|
|
|
|
if (silhouetteFac.isBanned == false && silhouetteFac.isMember == false &&
|
|
|
|
(this.companyPosition.positionName == CompanyPositions.CTO.positionName ||
|
|
|
|
this.companyPosition.positionName == CompanyPositions.CFO.positionName ||
|
|
|
|
this.companyPosition.positionName == CompanyPositions.CEO.positionName) &&
|
2017-05-30 00:37:38 +02:00
|
|
|
this.money >= 15000000 && this.karma <= -22) {
|
2017-04-19 23:54:01 +02:00
|
|
|
invitedFactions.push(silhouetteFac);
|
2017-05-02 18:28:54 +02:00
|
|
|
}
|
|
|
|
|
2017-05-12 20:12:32 +02:00
|
|
|
//Tetrads
|
|
|
|
var tetradsFac = Factions["Tetrads"];
|
|
|
|
if (tetradsFac.isBanned == false && tetradsFac.isMember == false &&
|
|
|
|
(this.city == Locations.Chongqing || this.city == Locations.NewTokyo ||
|
|
|
|
this.city == Locations.Ishima) && this.strength >= 75 && this.defense >= 75 &&
|
2017-05-30 00:37:38 +02:00
|
|
|
this.dexterity >= 75 && this.agility >= 75 && this.karma <= -18) {
|
2017-05-12 20:12:32 +02:00
|
|
|
invitedFactions.push(tetradsFac);
|
|
|
|
}
|
|
|
|
|
|
|
|
//SlumSnakes
|
|
|
|
var slumsnakesFac = Factions["Slum Snakes"];
|
|
|
|
if (slumsnakesFac.isBanned == false && slumsnakesFac.isMember == false &&
|
|
|
|
this.strength >= 30 && this.defense >= 30 && this.dexterity >= 30 &&
|
2017-05-30 00:37:38 +02:00
|
|
|
this.agility >= 30 && this.karma <= -9 && this.money >= 1000000) {
|
2017-05-12 20:12:32 +02:00
|
|
|
invitedFactions.push(slumsnakesFac);
|
|
|
|
}
|
|
|
|
|
2017-05-02 18:28:54 +02:00
|
|
|
//Netburners
|
|
|
|
var netburnersFac = Factions["Netburners"];
|
|
|
|
var totalHacknetRam = 0;
|
|
|
|
var totalHacknetCores = 0;
|
|
|
|
var totalHacknetLevels = 0;
|
|
|
|
for (var i = 0; i < Player.hacknetNodes.length; ++i) {
|
|
|
|
totalHacknetLevels += Player.hacknetNodes[i].level;
|
|
|
|
totalHacknetRam += Player.hacknetNodes[i].ram;
|
|
|
|
totalHacknetCores += Player.hacknetNodes[i].numCores;
|
|
|
|
}
|
|
|
|
if (netburnersFac.isBanned == false && netburnersFac.isMember == false &&
|
2017-05-05 16:21:08 +02:00
|
|
|
this.hacking_skill >= 80 && totalHacknetRam >= 8 &&
|
|
|
|
totalHacknetCores >= 4 && totalHacknetLevels >= 100) {
|
2017-05-02 18:28:54 +02:00
|
|
|
invitedFactions.push(netburnersFac);
|
2017-05-03 19:58:09 +02:00
|
|
|
}
|
2017-04-19 23:54:01 +02:00
|
|
|
|
2017-02-09 23:40:55 +01:00
|
|
|
//Tian Di Hui
|
2017-02-16 19:52:11 +01:00
|
|
|
var tiandihuiFac = Factions["Tian Di Hui"];
|
|
|
|
if (tiandihuiFac.isBanned == false && tiandihuiFac.isMember == false &&
|
|
|
|
this.money >= 1000000 && this.hacking_skill >= 50 &&
|
2017-05-10 19:42:46 +02:00
|
|
|
(this.city == Locations.Chongqing || this.city == Locations.NewTokyo ||
|
|
|
|
this.city == Locations.Ishima)) {
|
2017-02-16 19:52:11 +01:00
|
|
|
invitedFactions.push(tiandihuiFac);
|
|
|
|
}
|
|
|
|
|
2017-02-09 23:40:55 +01:00
|
|
|
//CyberSec
|
2017-02-16 19:52:11 +01:00
|
|
|
var cybersecFac = Factions["CyberSec"];
|
2017-06-02 06:15:45 +02:00
|
|
|
var cybersecServer = AllServers[SpecialServerIps[SpecialServerNames.CyberSecServer]];
|
|
|
|
if (cybersecServer == null) {
|
|
|
|
console.log("ERROR: Could not find CyberSec Server");
|
|
|
|
} else if (!cybersecFac.isBanned && !cybersecFac.isMember && cybersecServer.manuallyHacked &&
|
2017-04-19 21:19:33 +02:00
|
|
|
this.hacking_skill >= 50) {
|
2017-02-16 19:52:11 +01:00
|
|
|
invitedFactions.push(cybersecFac);
|
|
|
|
}
|
|
|
|
|
2017-05-30 00:37:38 +02:00
|
|
|
console.log("invited factions: " + invitedFactions);
|
2017-02-16 19:52:11 +01:00
|
|
|
return invitedFactions;
|
|
|
|
}
|
|
|
|
|
|
|
|
inviteToFaction = function(faction) {
|
|
|
|
if (Engine.Debug) {
|
|
|
|
console.log("inviteToFaction() called with faction: " + faction.name);
|
|
|
|
}
|
|
|
|
factionInvitationBoxCreate(faction);
|
2017-02-09 23:40:55 +01:00
|
|
|
}
|
|
|
|
|
2017-01-10 23:23:17 +01:00
|
|
|
joinFaction = function(faction) {
|
|
|
|
faction.isMember = true;
|
2017-02-17 23:19:25 +01:00
|
|
|
Player.factions.push(faction.name);
|
2017-02-16 19:52:11 +01:00
|
|
|
|
|
|
|
//Determine what factions you are banned from now that you have joined this faction
|
2017-05-22 21:42:06 +02:00
|
|
|
if (faction.name == "Chongqing") {
|
2017-02-16 19:52:11 +01:00
|
|
|
Factions["Sector-12"].isBanned = true;
|
|
|
|
Factions["Aevum"].isBanned = true;
|
|
|
|
Factions["Volhaven"].isBanned = true;
|
|
|
|
} else if (faction.name == "Sector-12") {
|
|
|
|
Factions["Chongqing"].isBanned = true;
|
|
|
|
Factions["New Tokyo"].isBanned = true;
|
|
|
|
Factions["Ishima"].isBanned = true;
|
|
|
|
Factions["Volhaven"].isBanned = true;
|
|
|
|
} else if (faction.name == "New Tokyo") {
|
|
|
|
Factions["Sector-12"].isBanned = true;
|
|
|
|
Factions["Aevum"].isBanned = true;
|
|
|
|
Factions["Volhaven"].isBanned = true;
|
|
|
|
} else if (faction.name == "Aevum") {
|
|
|
|
Factions["Chongqing"].isBanned = true;
|
|
|
|
Factions["New Tokyo"].isBanned = true;
|
|
|
|
Factions["Ishima"].isBanned = true;
|
|
|
|
Factions["Volhaven"].isBanned = true;
|
|
|
|
} else if (faction.name == "Ishima") {
|
|
|
|
Factions["Sector-12"].isBanned = true;
|
|
|
|
Factions["Aevum"].isBanned = true;
|
|
|
|
Factions["Volhaven"].isBanned = true;
|
|
|
|
} else if (faction.name == "Volhaven") {
|
|
|
|
Factions["Chongqing"].isBanned = true;
|
|
|
|
Factions["Sector-12"].isBanned = true;
|
|
|
|
Factions["New Tokyo"].isBanned = true;
|
|
|
|
Factions["Aevum"].isBanned = true;
|
|
|
|
Factions["Ishima"].isBanned = true;
|
|
|
|
}
|
2017-01-10 23:23:17 +01:00
|
|
|
}
|
|
|
|
|
2017-04-21 22:56:44 +02:00
|
|
|
leaveFaction = function(faction) {
|
|
|
|
faction.isMember = false;
|
|
|
|
var i = Player.factions.indexOf(faction.name);
|
|
|
|
if (i > -1) {
|
|
|
|
Player.factions.splice(i, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
//Unban from faction
|
2017-05-22 21:42:06 +02:00
|
|
|
if (faction.name == "Chongqing") {
|
2017-04-21 22:56:44 +02:00
|
|
|
Factions["Sector-12"].isBanned = false;
|
|
|
|
Factions["Aevum"].isBanned = false;
|
|
|
|
Factions["Volhaven"].isBanned = false;
|
|
|
|
} else if (faction.name == "Sector-12") {
|
|
|
|
Factions["Chongqing"].isBanned = false;
|
|
|
|
Factions["New Tokyo"].isBanned = false;
|
|
|
|
Factions["Ishima"].isBanned = false;
|
|
|
|
Factions["Volhaven"].isBanned = false;
|
|
|
|
} else if (faction.name == "New Tokyo") {
|
|
|
|
Factions["Sector-12"].isBanned = false;
|
|
|
|
Factions["Aevum"].isBanned = false;
|
|
|
|
Factions["Volhaven"].isBanned = false;
|
|
|
|
} else if (faction.name == "Aevum") {
|
|
|
|
Factions["Chongqing"].isBanned = false;
|
|
|
|
Factions["New Tokyo"].isBanned = false;
|
|
|
|
Factions["Ishima"].isBanned = false;
|
|
|
|
Factions["Volhaven"].isBanned = false;
|
|
|
|
} else if (faction.name == "Ishima") {
|
|
|
|
Factions["Sector-12"].isBanned = false;
|
|
|
|
Factions["Aevum"].isBanned = false;
|
|
|
|
Factions["Volhaven"].isBanned = false;
|
|
|
|
} else if (faction.name == "Volhaven") {
|
|
|
|
Factions["Chongqing"].isBanned = false;
|
|
|
|
Factions["Sector-12"].isBanned = false;
|
|
|
|
Factions["New Tokyo"].isBanned = false;
|
|
|
|
Factions["Aevum"].isBanned = false;
|
|
|
|
Factions["Ishima"].isBanned = false;
|
|
|
|
}
|
|
|
|
}
|
2017-02-16 19:52:11 +01:00
|
|
|
|
2017-02-20 23:45:36 +01:00
|
|
|
//Displays the HTML content for a specific faction
|
2017-01-10 23:23:17 +01:00
|
|
|
displayFactionContent = function(factionName) {
|
|
|
|
var faction = Factions[factionName];
|
2017-04-19 21:19:33 +02:00
|
|
|
document.getElementById("faction-name").innerHTML = factionName;
|
2017-05-06 21:12:45 +02:00
|
|
|
document.getElementById("faction-info").innerHTML = "<i>" + faction.info + "</i>";
|
2017-05-04 22:50:17 +02:00
|
|
|
document.getElementById("faction-reputation").innerHTML = "Reputation: " + formatNumber(faction.playerReputation, 4);
|
2017-01-10 23:23:17 +01:00
|
|
|
|
2017-01-09 23:14:18 +01:00
|
|
|
var hackDiv = document.getElementById("faction-hack-div");
|
|
|
|
var fieldWorkDiv = document.getElementById("faction-fieldwork-div");
|
|
|
|
var securityWorkDiv = document.getElementById("faction-securitywork-div");
|
2017-05-20 10:19:13 +02:00
|
|
|
var donateDiv = document.getElementById("faction-donate-div");
|
2017-01-09 23:14:18 +01:00
|
|
|
|
2017-02-17 23:19:25 +01:00
|
|
|
//Set new event listener for all of the work buttons
|
|
|
|
//The old buttons need to be replaced to clear the old event listeners
|
2017-05-06 21:12:45 +02:00
|
|
|
var newHackButton = clearEventListeners("faction-hack-button");
|
|
|
|
var newFieldWorkButton = clearEventListeners("faction-fieldwork-button");
|
|
|
|
var newSecurityWorkButton = clearEventListeners("faction-securitywork-button");
|
2017-05-20 10:19:13 +02:00
|
|
|
var newDonateWorkButton = clearEventListeners("faction-donate-button");
|
2017-02-17 23:19:25 +01:00
|
|
|
|
|
|
|
newHackButton.addEventListener("click", function() {
|
|
|
|
Player.startFactionHackWork(faction);
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
|
|
|
|
newFieldWorkButton.addEventListener("click", function() {
|
|
|
|
Player.startFactionFieldWork(faction);
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
|
2017-04-19 07:02:40 +02:00
|
|
|
newSecurityWorkButton.addEventListener("click", function() {
|
2017-02-17 23:19:25 +01:00
|
|
|
Player.startFactionSecurityWork(faction);
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
|
2017-05-20 10:19:13 +02:00
|
|
|
newDonateWorkButton.addEventListener("click", function() {
|
|
|
|
var donateAmountVal = document.getElementById("faction-donate-input").value;
|
|
|
|
if (isPositiveNumber(donateAmountVal)) {
|
|
|
|
var numMoneyDonate = Number(donateAmountVal);
|
|
|
|
if (Player.money < numMoneyDonate) {
|
|
|
|
dialogBoxCreate("You cannot afford to donate this much money!");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
Player.loseMoney(numMoneyDonate);
|
2017-06-01 01:39:03 +02:00
|
|
|
var repGain = numMoneyDonate / 1000000 * Player.faction_rep_mult;
|
2017-05-20 10:19:13 +02:00
|
|
|
faction.playerReputation += repGain;
|
|
|
|
dialogBoxCreate("You just donated $" + formatNumber(numMoneyDonate, 2) + " to " +
|
|
|
|
faction.name + " to gain " + formatNumber(repGain, 3) + " reputation");
|
2017-05-21 07:39:18 +02:00
|
|
|
displayFactionContent(factionName);
|
2017-05-20 10:19:13 +02:00
|
|
|
} else {
|
|
|
|
dialogBoxCreate("Invalid amount entered!");
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
});
|
2017-02-17 23:19:25 +01:00
|
|
|
|
|
|
|
//Set new event listener for the purchase augmentation buttons
|
|
|
|
//The old button needs to be replaced to clear the old event listeners
|
2017-05-06 21:12:45 +02:00
|
|
|
var newPurchaseAugmentationsButton = clearEventListeners("faction-purchase-augmentations");
|
2017-02-17 23:19:25 +01:00
|
|
|
|
|
|
|
newPurchaseAugmentationsButton.addEventListener("click", function() {
|
2017-02-28 18:10:35 +01:00
|
|
|
Engine.hideAllContent();
|
2017-04-19 21:19:33 +02:00
|
|
|
Engine.Display.factionAugmentationsContent.style.visibility = "visible";
|
|
|
|
|
2017-05-06 21:12:45 +02:00
|
|
|
var newBackButton = clearEventListeners("faction-augmentations-back-button");
|
2017-04-19 21:19:33 +02:00
|
|
|
newBackButton.addEventListener("click", function() {
|
|
|
|
Engine.loadFactionContent();
|
2017-02-28 18:10:35 +01:00
|
|
|
displayFactionContent(factionName);
|
|
|
|
return false;
|
|
|
|
});
|
2017-02-17 23:19:25 +01:00
|
|
|
displayFactionAugmentations(factionName);
|
|
|
|
return false;
|
|
|
|
});
|
2017-01-09 23:14:18 +01:00
|
|
|
|
2016-12-22 18:13:00 +01:00
|
|
|
if (faction.isMember) {
|
2017-05-20 10:19:13 +02:00
|
|
|
donateDiv.style.display = "inline";
|
2017-01-09 23:14:18 +01:00
|
|
|
switch(faction.name) {
|
|
|
|
case "Illuminati":
|
2017-01-11 21:00:51 +01:00
|
|
|
hackDiv.style.display = "inline";
|
|
|
|
fieldWorkDiv.style.display = "inline";
|
|
|
|
securityWorkDiv.style.display = "none";
|
2017-01-09 23:14:18 +01:00
|
|
|
break;
|
|
|
|
case "Daedalus":
|
2017-01-11 21:00:51 +01:00
|
|
|
hackDiv.style.display = "inline";
|
|
|
|
fieldWorkDiv.style.display = "inline";
|
|
|
|
securityWorkDiv.style.display = "none";
|
2017-01-09 23:14:18 +01:00
|
|
|
break;
|
|
|
|
case "The Covenant":
|
2017-01-11 21:00:51 +01:00
|
|
|
hackDiv.style.display = "inline";
|
|
|
|
fieldWorkDiv.style.display = "inline";
|
|
|
|
securityWorkDiv.style.display = "none";
|
2017-01-09 23:14:18 +01:00
|
|
|
break;
|
|
|
|
case "ECorp":
|
2017-01-11 21:00:51 +01:00
|
|
|
hackDiv.style.display = "inline";
|
|
|
|
fieldWorkDiv.style.display = "inline";
|
|
|
|
securityWorkDiv.style.display = "inline";
|
2017-01-09 23:14:18 +01:00
|
|
|
break;
|
|
|
|
case "MegaCorp":
|
2017-01-11 21:00:51 +01:00
|
|
|
hackDiv.style.display = "inline";
|
|
|
|
fieldWorkDiv.style.display = "inline";
|
|
|
|
securityWorkDiv.style.display = "inline";
|
2017-01-09 23:14:18 +01:00
|
|
|
break;
|
|
|
|
case "Bachman & Associates":
|
2017-01-11 21:00:51 +01:00
|
|
|
hackDiv.style.display = "inline";
|
|
|
|
fieldWorkDiv.style.display = "inline";
|
|
|
|
securityWorkDiv.style.display = "inline";
|
2017-01-09 23:14:18 +01:00
|
|
|
break;
|
|
|
|
case "Blade Industries":
|
2017-01-11 21:00:51 +01:00
|
|
|
hackDiv.style.display = "inline";
|
|
|
|
fieldWorkDiv.style.display = "inline";
|
|
|
|
securityWorkDiv.style.display = "inline";
|
2017-01-09 23:14:18 +01:00
|
|
|
break;
|
|
|
|
case "NWO":
|
2017-01-11 21:00:51 +01:00
|
|
|
hackDiv.style.display = "inline";
|
|
|
|
fieldWorkDiv.style.display = "inline";
|
|
|
|
securityWorkDiv.style.display = "inline";
|
2017-01-09 23:14:18 +01:00
|
|
|
break;
|
|
|
|
case "Clarke Incorporated":
|
2017-01-11 21:00:51 +01:00
|
|
|
hackDiv.style.display = "inline";
|
|
|
|
fieldWorkDiv.style.display = "inline";
|
|
|
|
securityWorkDiv.style.display = "inline";
|
2017-01-09 23:14:18 +01:00
|
|
|
break;
|
|
|
|
case "OmniTek Incorporated":
|
2017-01-11 21:00:51 +01:00
|
|
|
hackDiv.style.display = "inline";
|
|
|
|
fieldWorkDiv.style.display = "inline";
|
|
|
|
securityWorkDiv.style.display = "inline";
|
2017-01-09 23:14:18 +01:00
|
|
|
break;
|
|
|
|
case "Four Sigma":
|
2017-01-11 21:00:51 +01:00
|
|
|
hackDiv.style.display = "inline";
|
|
|
|
fieldWorkDiv.style.display = "inline";
|
|
|
|
securityWorkDiv.style.display = "inline";
|
2017-01-09 23:14:18 +01:00
|
|
|
break;
|
|
|
|
case "KuaiGong International":
|
2017-01-11 21:00:51 +01:00
|
|
|
hackDiv.style.display = "inline";
|
|
|
|
fieldWorkDiv.style.display = "inline";
|
|
|
|
securityWorkDiv.style.display = "inline";
|
2017-01-09 23:14:18 +01:00
|
|
|
break;
|
|
|
|
case "BitRunners":
|
2017-01-11 21:00:51 +01:00
|
|
|
hackDiv.style.display = "inline";
|
|
|
|
fieldWorkDiv.style.display = "none";
|
|
|
|
securityWorkDiv.style.display = "none";
|
2017-01-09 23:14:18 +01:00
|
|
|
break;
|
|
|
|
case "The Black Hand":
|
2017-01-11 21:00:51 +01:00
|
|
|
hackDiv.style.display = "inline";
|
|
|
|
fieldWorkDiv.style.display = "inline";
|
|
|
|
securityWorkDiv.style.display = "none";
|
2017-01-09 23:14:18 +01:00
|
|
|
break;
|
|
|
|
case "NiteSec":
|
2017-01-11 21:00:51 +01:00
|
|
|
hackDiv.style.display = "inline";
|
|
|
|
fieldWorkDiv.style.display = "none";
|
|
|
|
securityWorkDiv.style.display = "none";
|
2017-01-09 23:14:18 +01:00
|
|
|
break;
|
|
|
|
case "Chongqing":
|
2017-01-11 21:00:51 +01:00
|
|
|
hackDiv.style.display = "inline";
|
|
|
|
fieldWorkDiv.style.display = "inline";
|
|
|
|
securityWorkDiv.style.display = "inline";
|
2017-01-09 23:14:18 +01:00
|
|
|
break;
|
|
|
|
case "Sector-12":
|
2017-01-11 21:00:51 +01:00
|
|
|
hackDiv.style.display = "inline";
|
|
|
|
fieldWorkDiv.style.display = "inline";
|
|
|
|
securityWorkDiv.style.display = "inline";
|
2017-01-09 23:14:18 +01:00
|
|
|
break;
|
|
|
|
case "New Tokyo":
|
2017-01-11 21:00:51 +01:00
|
|
|
hackDiv.style.display = "inline";
|
|
|
|
fieldWorkDiv.style.display = "inline";
|
|
|
|
securityWorkDiv.style.display = "inline";
|
2017-01-09 23:14:18 +01:00
|
|
|
break;
|
|
|
|
case "Aevum":
|
2017-01-11 21:00:51 +01:00
|
|
|
hackDiv.style.display = "inline";
|
|
|
|
fieldWorkDiv.style.display = "inline";
|
|
|
|
securityWorkDiv.style.display = "inline";
|
2017-01-09 23:14:18 +01:00
|
|
|
break;
|
|
|
|
case "Ishima":
|
2017-01-11 21:00:51 +01:00
|
|
|
hackDiv.style.display = "inline";
|
|
|
|
fieldWorkDiv.style.display = "inline";
|
|
|
|
securityWorkDiv.style.display = "inline";
|
2017-01-09 23:14:18 +01:00
|
|
|
break;
|
|
|
|
case "Volhaven":
|
2017-01-11 21:00:51 +01:00
|
|
|
hackDiv.style.display = "inline";
|
|
|
|
fieldWorkDiv.style.display = "inline";
|
|
|
|
securityWorkDiv.style.display = "inline";
|
2017-01-09 23:14:18 +01:00
|
|
|
break;
|
|
|
|
case "Speakers for the Dead":
|
2017-01-11 21:00:51 +01:00
|
|
|
hackDiv.style.display = "inline";
|
|
|
|
fieldWorkDiv.style.display = "inline";
|
|
|
|
securityWorkDiv.style.display = "inline";
|
2017-01-09 23:14:18 +01:00
|
|
|
break;
|
|
|
|
case "The Dark Army":
|
2017-01-11 21:00:51 +01:00
|
|
|
hackDiv.style.display = "inline";
|
|
|
|
fieldWorkDiv.style.display = "inline";
|
|
|
|
securityWorkDiv.style.display = "none";
|
2017-01-09 23:14:18 +01:00
|
|
|
break;
|
|
|
|
case "The Syndicate":
|
2017-01-11 21:00:51 +01:00
|
|
|
hackDiv.style.display = "inline";
|
|
|
|
fieldWorkDiv.style.display = "inline";
|
|
|
|
securityWorkDiv.style.display = "inline";
|
2017-01-09 23:14:18 +01:00
|
|
|
break;
|
2017-04-19 23:54:01 +02:00
|
|
|
case "Silhouette":
|
|
|
|
hackDiv.style.display = "inline";
|
|
|
|
fieldWorkDiv.style.display = "inline";
|
2017-05-03 19:58:09 +02:00
|
|
|
securityWorkDiv.style.display = "none";
|
2017-05-12 22:01:23 +02:00
|
|
|
break;
|
|
|
|
case "Tetrads":
|
|
|
|
hackDiv.style.display = "none";
|
|
|
|
fieldWorkDiv.style.display = "inline";
|
|
|
|
securityWorkDiv.style.display = "inline";
|
|
|
|
break;
|
|
|
|
case "Slum Snakes":
|
|
|
|
hackDiv.style.display = "none";
|
|
|
|
fieldWorkDiv.style.display = "inline";
|
|
|
|
securityWorkDiv.style.display = "inline";
|
|
|
|
break;
|
2017-05-03 19:58:09 +02:00
|
|
|
case "Netburners":
|
|
|
|
hackDiv.style.display = "inline";
|
|
|
|
fieldWorkDiv.style.display = "none";
|
2017-04-19 23:54:01 +02:00
|
|
|
securityWorkDiv.style.display = "none";
|
2017-05-12 22:01:23 +02:00
|
|
|
break;
|
2017-01-09 23:14:18 +01:00
|
|
|
case "Tian Di Hui":
|
2017-01-11 21:00:51 +01:00
|
|
|
hackDiv.style.display = "inline";
|
|
|
|
fieldWorkDiv.style.display = "none";
|
|
|
|
securityWorkDiv.style.display = "inline";
|
2017-01-09 23:14:18 +01:00
|
|
|
break;
|
|
|
|
case "CyberSec":
|
2017-01-11 21:00:51 +01:00
|
|
|
hackDiv.style.display = "inline";
|
|
|
|
fieldWorkDiv.style.display = "none";
|
|
|
|
securityWorkDiv.style.display = "none";
|
2017-01-09 23:14:18 +01:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
console.log("Faction does not exist");
|
|
|
|
break;
|
|
|
|
}
|
2016-12-22 18:13:00 +01:00
|
|
|
} else {
|
|
|
|
console.log("Not a member of this faction, cannot display faction information");
|
|
|
|
}
|
2017-02-17 23:19:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
displayFactionAugmentations = function(factionName) {
|
2017-05-05 23:27:35 +02:00
|
|
|
document.getElementById("faction-augmentations-page-desc").innerHTML = "Lists all augmentations that are available to purchase from " + factionName;
|
2017-02-17 23:19:25 +01:00
|
|
|
var faction = Factions[factionName];
|
|
|
|
|
|
|
|
var augmentationsList = document.getElementById("faction-augmentations-list");
|
2017-04-19 23:39:25 +02:00
|
|
|
while (augmentationsList.firstChild) {
|
|
|
|
augmentationsList.removeChild(augmentationsList.firstChild);
|
|
|
|
}
|
2017-02-17 23:19:25 +01:00
|
|
|
|
2017-04-19 21:19:33 +02:00
|
|
|
for (var i = 0; i < faction.augmentations.length; ++i) {
|
2017-05-04 21:42:27 +02:00
|
|
|
(function () {
|
|
|
|
var aug = Augmentations[faction.augmentations[i]];
|
|
|
|
var item = document.createElement("li");
|
|
|
|
var span = document.createElement("span");
|
2017-05-23 21:26:52 +02:00
|
|
|
var aDiv = document.createElement("div");
|
2017-05-04 21:42:27 +02:00
|
|
|
var aElem = document.createElement("a");
|
|
|
|
var pElem = document.createElement("p");
|
|
|
|
aElem.setAttribute("href", "#");
|
|
|
|
var req = aug.baseRepRequirement * faction.augmentationRepRequirementMult;
|
2017-05-07 12:04:54 +02:00
|
|
|
if (aug.name != AugmentationNames.NeuroFluxGovernor && aug.owned) {
|
2017-05-23 21:26:52 +02:00
|
|
|
aElem.setAttribute("class", "a-link-button-inactive");
|
2017-05-05 17:50:55 +02:00
|
|
|
pElem.innerHTML = "ALREADY OWNED";
|
|
|
|
} else if (faction.playerReputation >= req) {
|
2017-05-23 21:26:52 +02:00
|
|
|
aElem.setAttribute("class", "a-link-button");
|
2017-05-04 22:50:17 +02:00
|
|
|
pElem.innerHTML = "UNLOCKED - $" + formatNumber(aug.baseCost * faction.augmentationPriceMult, 2);
|
2017-05-04 21:42:27 +02:00
|
|
|
} else {
|
2017-05-23 21:26:52 +02:00
|
|
|
aElem.setAttribute("class", "a-link-button-inactive");
|
2017-06-06 23:22:57 +02:00
|
|
|
pElem.innerHTML = "LOCKED (Requires " + formatNumber(req, 1) + " faction reputation) - $" + formatNumber(aug.baseCost * faction.augmentationPriceMult, 2);
|
2017-05-04 21:42:27 +02:00
|
|
|
pElem.style.color = "red";
|
|
|
|
}
|
2017-05-21 07:39:18 +02:00
|
|
|
aElem.style.display = "inline";
|
|
|
|
pElem.style.display = "inline";
|
2017-05-04 21:42:27 +02:00
|
|
|
aElem.innerHTML = aug.name;
|
2017-05-07 12:04:54 +02:00
|
|
|
if (aug.name == AugmentationNames.NeuroFluxGovernor) {
|
|
|
|
aElem.innerHTML += " - Level " + (aug.level + 1);
|
|
|
|
}
|
2017-05-21 07:39:18 +02:00
|
|
|
span.style.display = "inline-block"
|
2017-05-04 21:42:27 +02:00
|
|
|
|
2017-05-23 21:26:52 +02:00
|
|
|
//The div will have the tooltip.
|
|
|
|
aDiv.setAttribute("class", "tooltip");
|
|
|
|
aDiv.innerHTML = '<span class="tooltiptext">' + aug.info + " </span>";
|
|
|
|
aDiv.appendChild(aElem);
|
2017-05-10 19:42:46 +02:00
|
|
|
|
2017-05-04 21:42:27 +02:00
|
|
|
aElem.addEventListener("click", function() {
|
|
|
|
purchaseAugmentationBoxCreate(aug, faction);
|
|
|
|
});
|
|
|
|
|
2017-05-23 21:26:52 +02:00
|
|
|
span.appendChild(aDiv);
|
2017-05-04 21:42:27 +02:00
|
|
|
span.appendChild(pElem);
|
|
|
|
|
|
|
|
item.appendChild(span);
|
|
|
|
|
|
|
|
augmentationsList.appendChild(item);
|
|
|
|
}()); //Immediate invocation closure
|
2017-02-17 23:19:25 +01:00
|
|
|
}
|
2017-05-04 07:05:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function processPassiveFactionRepGain(numCycles) {
|
2017-05-07 10:22:50 +02:00
|
|
|
var numTimesGain = (numCycles / 600) * Player.faction_rep_mult;
|
2017-05-04 07:05:48 +02:00
|
|
|
for (var name in Factions) {
|
|
|
|
if (Factions.hasOwnProperty(name)) {
|
|
|
|
var faction = Factions[name];
|
|
|
|
|
|
|
|
//TODO Get hard value of 1 rep per "rep gain cycle"" for now..
|
|
|
|
//maybe later make this based on
|
|
|
|
//a player's 'status' like how powerful they are and how much money they have
|
|
|
|
if (faction.isMember) {faction.playerReputation += numTimesGain;}
|
|
|
|
}
|
|
|
|
}
|
2016-11-03 22:36:01 +01:00
|
|
|
}
|