From f311b0b84f309fe83f90cfc7c00a0446ff7b7cf6 Mon Sep 17 00:00:00 2001 From: Daniel Xie Date: Thu, 3 Nov 2016 16:36:01 -0500 Subject: [PATCH] Began deining the Faction class --- src/Faction.js | 46 ++++++++++++++++++++++++++++++++++++++++++++++ src/Server.js | 5 +++++ 2 files changed, 51 insertions(+) create mode 100644 src/Faction.js diff --git a/src/Faction.js b/src/Faction.js new file mode 100644 index 000000000..263fe29a2 --- /dev/null +++ b/src/Faction.js @@ -0,0 +1,46 @@ +//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 +}; + +//TODO +Faction.prototype.init() { + +} + +Faction.prototype.setAugmentations(augs) { + for (var i = 0; i < augs.length; i++) { + this.augmentations.push(augs[i]); + } +} + +Factions = { + //Endgame + Illuminati: new Faction("Illuminati"); + Daedalus: new Faction("Daedalus"); + Covenant: new Faction("The Covenant"); + + //Megacorporations, each forms its own faction + ECorp: new Faction("ECorp"); + MegaCorp: new Faction("MegaCorp"); + BachmanAndAssociates: new Faction("Bachman & Associates"); + BladeIndustries: new Faction("Blade Industries"); + NWO: new Faction("NWO"); + ClarkeIncorporated: new Faction("Clarke Incorporated"); + OmniTekIncorporated: new Faction("OmniTek Incorporated"); + FourSigma: new Faction("Four Sigma"); + KuaiGongInternational: new Faction("KuaiGong International"); + + //Hacker groups + BitRunners: new Faction("BitRunners"); + BlackHand: new Faction("The Black Hand"); + NiteSec: new Faction("NiteSec"); + + //City factions, essentially governments + Newerth: new Faction("Newerth"); +} \ No newline at end of file diff --git a/src/Server.js b/src/Server.js index 02d411c74..5c9f08876 100644 --- a/src/Server.js +++ b/src/Server.js @@ -92,6 +92,11 @@ createRandomByte = function() { //Create all "foreign" servers that exist in the game. This does not include //servers that the player can purchase or the player's starting computer ForeignServers = { + //TODO add "secret" servers for factions and anything else? These are servers + //that do not get connected to anything in the createNetwork() function + //Secret Servers + + //Megacorporations (each one forms its own faction?) ECorp: new Server(), //Group15 MegaCorp: new Server(), //Group15