2016-11-03 22:36:01 +01:00
|
|
|
//Netburner Faction class
|
|
|
|
function Faction(name) {
|
|
|
|
this.name = name;
|
|
|
|
this.augmentations = [];
|
|
|
|
|
|
|
|
//Player-related properties for faction
|
|
|
|
this.isMember = false; //Whether player is member
|
|
|
|
this.playerReputation = 0; //"Reputation" within faction
|
|
|
|
};
|
|
|
|
|
2016-11-17 23:25:40 +01:00
|
|
|
Faction.prototype.setAugmentations = function(augs) {
|
2016-11-03 22:36:01 +01:00
|
|
|
for (var i = 0; i < augs.length; i++) {
|
|
|
|
this.augmentations.push(augs[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
initFactions = function() {
|
2016-11-03 22:36:01 +01:00
|
|
|
//Endgame
|
2016-12-20 21:31:41 +01:00
|
|
|
var Illuminati = new Faction("Illuminati");
|
|
|
|
AddToFactions(Illuminati);
|
|
|
|
var Daedalus = new Faction("Daedalus");
|
|
|
|
AddToFactions(Daedalus);
|
|
|
|
var Covenant = new Faction("The Covenant");
|
|
|
|
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");
|
|
|
|
AddToFactions(ECorp);
|
|
|
|
var MegaCorp = new Faction("MegaCorp");
|
|
|
|
AddToFactions(MegaCorp);
|
|
|
|
var BachmanAndAssociates = new Faction("Bachman & Associates");
|
|
|
|
AddToFactions(BachmanAndAssociates);
|
|
|
|
var BladeIndustries = new Faction("Blade Industries");
|
|
|
|
AddToFactions(BladeIndustries);
|
|
|
|
var NWO = new Faction("NWO");
|
|
|
|
AddToFactions(NWO);
|
|
|
|
var ClarkeIncorporated = new Faction("Clarke Incorporated");
|
|
|
|
AddToFactions(ClarkeIncorporated);
|
|
|
|
var OmniTekIncorporated = new Faction("OmniTek Incorporated");
|
|
|
|
AddToFactions(OmniTekIncorporated);
|
|
|
|
var FourSigma = new Faction("Four Sigma");
|
|
|
|
AddToFactions(FourSigma);
|
|
|
|
var KuaiGongInternational = new Faction("KuaiGong International");
|
|
|
|
AddToFactions(KuaiGongInternational);
|
2016-11-03 22:36:01 +01:00
|
|
|
|
|
|
|
//Hacker groups
|
2016-12-20 21:31:41 +01:00
|
|
|
var BitRunners = new Faction("BitRunners");
|
|
|
|
AddToFactions(BitRunners);
|
|
|
|
var BlackHand = new Faction("The Black Hand");
|
|
|
|
AddToFactions(BlackHand);
|
|
|
|
var NiteSec = new Faction("NiteSec");
|
|
|
|
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");
|
|
|
|
AddToFactions(Chongqing);
|
|
|
|
var Sector12 = new Faction("Sector-12");
|
|
|
|
AddToFactions(Sector12);
|
|
|
|
var HongKong = new Faction("New Tokyo");
|
|
|
|
AddToFactions(HongKong);
|
|
|
|
var Aevum = new Faction("Aevum");
|
|
|
|
AddToFactions(Aevum);
|
|
|
|
var Ishima = new Faction("Ishima");
|
|
|
|
AddToFactions(Ishima);
|
|
|
|
var Volhaven = new Faction("Volhaven");
|
|
|
|
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");
|
2016-12-22 16:56:15 +01:00
|
|
|
AddToFactions(SpeakersForTheDead);
|
|
|
|
var DarkArmy = new Faction("The Dark Army");
|
|
|
|
AddToFactions(DarkArmy);
|
|
|
|
var TheSyndicate = new Faction("The Syndicate");
|
|
|
|
AddToFactions(TheSyndicate);
|
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
|
2016-12-22 16:56:15 +01:00
|
|
|
var TianDiHui = new Faction("Tian Di Hui"); //Society of the Heaven and Earth
|
|
|
|
AddToFactions(TianDiHui);
|
2016-12-22 17:19:02 +01:00
|
|
|
var CyberSec = new Faction("CyberSec");
|
|
|
|
AddToFactions(CyberSec);
|
2016-11-03 22:36:01 +01:00
|
|
|
}
|