Added Prestiging

This commit is contained in:
Daniel Xie 2017-02-20 16:06:16 -06:00
parent 4a60874a3a
commit fa456c48b6
6 changed files with 380 additions and 123 deletions

@ -50,8 +50,6 @@ AddToAugmentations = function(aug) {
//TODO Set descriptions for all
//TODO Something that decreases RAM usage of scripts
//TODO SOmething that increases rate at which you gain faction respect
// Similarly. something that helps you gain company reputation
initAugmentations = function() {
//Combat stat augmentations
var Targeting1 = new Augmentation("Augmented Targeting I");
@ -171,7 +169,7 @@ initAugmentations = function() {
ArtificialSynapticPotentiation.addToFactions("The Black Hand", "NiteSec");
AddToAugmentations(ArtificialSynapticPotentiation);
var EnhancedMyelinSheathing = new Augmentation("Enhanced Myelin Sheating");
var EnhancedMyelinSheathing = new Augmentation("Enhanced Myelin Sheathing");
EnhancedMyelinSheathing.setRequirements(900000, 850000000);)
EnhancedMyelinSheating.addToFactions("Fulcrum Secret Technologies", "BitRunners", "The Black Hand");
AddToAugmentations(EnhancedMyelinSheathing);
@ -187,7 +185,7 @@ initAugmentations = function() {
AddToAugmentations(NeuralRetentionEnhancement);
var DataJack = new Augmentation("DataJack");
DataJack.setRequirements(750000, 750000000);
DataJack.setRequirements(750000, 75000000);
DataJack.addToFactions("BitRunners", "The Black Hand", "NiteSec", "Chongqing", "New Tokyo");
AddToAugmentations(DataJack);
@ -294,141 +292,202 @@ applyAugmentation = function(aug, faction) {
switch(aug.name) {
//Combat stat augmentations
case "Augmented Targeting I":
//Dex 5%
Player.dexterity_mult *= 1.1;
break;
case "Augmented Targeting II":
//Dex 5%
Player.dexterity_mult *= 1.2;
break;
case "Augmented Targeting III":
//Dex 5%
Player.dexterity_mult *= 1.5;
break;
case "Synthetic Heart":
//Agi and Str - HIGH LEVEL
case "Synthetic Heart": //High level
Player.agility_mult *= 2.0;
Player.strength_mult *= 2.0;
break;
case "Synfibril Muscle":
//Strength and Defense - MED HIGH LEVEL
case "Synfibril Muscle": //Medium-high level
Player.strength_mult *= 1.5;
Player.defense_mult *= 1.5;
break;
case "Combat Rib I":
//Str and Defense 5%
Player.strength_mult *= 1.1;
Player.defense_mult *= 1.1;
break;
case "Combat Rib II":
Player.strength_mult *= 1.2;
Player.defense_mult *= 1.2;
break;
case "Combat Rib III":
Player.strength_mult *= 1.3;
Player.defense_mult *= 1.3;
break;
case "Nanofiber Weave":
//str + Defense - MED LEVEL
case "Nanofiber Weave": //Med level
Player.strength_mult *= 1.3;
Player.defense_mult *= 1.3;
break;
case "NEMEAN Subdermal Weave":
//Defense - HIGH LEVEL
case "NEMEAN Subdermal Weave": //High level
Player.defense_mult *= 2.5;
break;
case "Wired Reflexes":
//Agility - Low level
case "Wired Reflexes": //Low level
Player.agility_mult *= 1.05;
break;
case "Graphene Bone Lacings":
//Strength defense - HIGH level
case "Graphene Bone Lacings": //High level
Player.strength_mult *= 2;
Player.defense_mult *= 2;
break;
case "Bionic Spine":
//Everything - Medium level
case "Bionic Spine": //Med level
Player.strength_mult *= 1.2;
Player.defense_mult *= 1.2;
Player.agility_mult *= 1.2;
Player.dexterity_mult *= 1.2;
break;
case "Graphene Bionic Spine Upgrade":
//Everything - high level
case "Graphene Bionic Spine Upgrade": //High level
Player.strength_mult *= 2;
Player.defense_mult *= 2;
Player.agility_mult *= 2;
Player.dexterity_mult *= 2;
break;
case "Bionic Legs":
//Agi - Med level
case "Bionic Legs": //Med level
Player.agility_mult *= 1.5;
break;
case "Graphene Bionic Legs Upgrade":
//Agi - HIGH level
case "Graphene Bionic Legs Upgrade": //High level
player.agility_mult *= 3.0;
break;
//Labor stats augmentations
case "Enhanced Social Interaction Implant":
//Charisma 10% - Med high level
case "Enhanced Social Interaction Implant": //Med-high level
Player.charisma_mult *= 1.5;
Player.charisma_exp_mult *= 1.5;
break;
case "Speech Processor Implant":
//Charisma 5% - Med level
case "Speech Processor Implant": //Med level
Player.charisma_mult *= 1.2;
break;
//Hacking augmentations
case "Artificial Bio-neural Network Implant":
//Hacking speed and money gained - MED Level
case "Artificial Bio-neural Network Implant": //Med level
Player.hacking_speed_mult *= .98;
Player.hacking_money_mult *= 1.1;
Player.hacking_mult *= 1.1;
break;
case "Artificial Synaptic Potentiation":
//Hacking speed - MED Level
case "Artificial Synaptic Potentiation": //Med level
Player.hacking_speed_mult *= .99;
Player.hacking_chance_mult *= 1.01;
break;
case "Enhanced Myelin Sheating":
//Hacking speed and exp gain - MED Level
case "Enhanced Myelin Sheathing": //Med level
Player.hacking_speed_mult *= .99;
Player.hacking_exp_mult *= 1.05;
Player.hacking_mult *= 1.05;
break;
case "Synaptic Enhancement Implant":
//Hacking speed - LOw level
case "Synaptic Enhancement Implant": //Low Level
Player.hacking_speed_mult *= .99;
break;
case "Neural-Retention Enhancement":
//Gain 10% more hacking exp - med level
case "Neural-Retention Enhancement": //Med level
Player.hacking_exp_mult *= 1.4;
break;
case "DataJack":
//5% more money from hacking - med low level
case "DataJack": //Med low level
Player.hacking_money_mult *= 1.2;
break;
case "Embedded Netburner Module":
//Doesn't give anyhting itself but allows user to install
//ENM upgrades in the future, which are very powerful
//Med level
case "Embedded Netburner Module": //Medium level
Player.hacking_mult *= 1.01;
break;
case "Embedded Netburner Module Core Implant":
//Hacking speed, money gained, and exp gained - Med level
case "Embedded Netburner Module Core Implant": //Medium level
Player.hacking_speed_mult *= .98;
Player.hacking_money_mult *= 1.1;
Player.hacking_chance_mult *= 1.02;
Player.hacking_exp_mult *= 1.1;
Player.hacking_mult *= 1.01;
break;
case "Embedded Netburner Module Core V2 Upgrade":
//Hacking speed, money gained, and exp gained - Med High Level
case "Embedded Netburner Module Core V2 Upgrade": //Medium high level
Player.hacking_speed_mult *= .95;
Player.hacking_money_mult *= 1.5;
Player.hacking_chance_mult *= 1.05;
Player.hacking_exp_mult *= 1.5;
Player.hacking_mult *= 1.05;
break;
case "Embedded Netburner Module Core V3 Upgrade":
//Hacking speed, money gained, and exp gained - High level
case "Embedded Netburner Module Core V3 Upgrade": //High level
Player.hacking_speed_mult *= .95;
Player.hacking_money_mult *= 1.5;
Player.hacking_chance_mult *= 1.1;
Player.hacking_exp_mult *= 2.0;
Player.hacking_mult *= 1.1;
break;
case "Embedded Netburner Module Analyze Engine":
case "Embedded Netburner Module Analyze Engine": //High level
//Hacking speed 20% - High level
Player.hacking_speed_mult *= 0.9;
break;
case "Embedded Netburner Module Direct Memory Access Upgrade":
case "Embedded Netburner Module Direct Memory Access Upgrade": //High level
//Money hacked 20% - High level
Player.hacking_money_mult *= 1.5;
Player.hacking_chance_mult *= 1.2;
break;
case "Neuralstimulator":
//Hacking speed, money gained, and exp gained - Med level
break;
case "PC Direct-Neural Interface NeuroNet Injector":
//Hacking speed increases
case "Neuralstimulator": //Medium Level
Player.hacking_speed_mult *= .99;
Player.hacking_chance_mult *= 1.1;
Player.hacking_exp_mult *= 1.2;
break;
//Work augmentations
case "Nuoptimal Nootropic Injector Implant":
//Increase in gains for software, IT, and Business jobs - Low Med Level
case "Nuoptimal Nootropic Injector Implant": //Low medium level
Player.company_rep_mult *= 1.1;
break;
case "Speech Enhancement":
//Increase in business jobs and reputation gained - Low Level
case "Speech Enhancement": //Low level
Player.company_rep_mult *= 1.05;
Player.charisma_mult *= 1.05;
break;
case "FocusWire":
//Increase in all gains and reputation gained - Med Level
case "FocusWire": //Med level
Player.hacking_exp_mult *= 1.1;
Player.strength_exp_mult *= 1.1;
Player.defense_exp_mult *= 1.1;
Player.dexterity_exp_mult *= 1.1;
Player.agility_exp_mult *= 1.1;
Player.charisma_exp_mult *= 1.1;
Player.company_rep_mult *= 1.05;
Player.work_money_mult *= 1.05;
break;
case "PC Direct-Neural Interface":
//Allows people to directly communicate interface with PCs..which helps with Software and IT jobs
//Med level
case "PC Direct-Neural Interface": //Med level
Player.company_rep_mult *= 1.1;
Player.hacking_mult *= 1.1;
break;
case "PC Direct-Neural Interface Optimization Submodule":
case "PC Direct-Neural Interface Optimization Submodule": //High level
//Allows u to better optimize code/pc when connecting with PC DNI..helps with software/IT jobs
//High level
Player.company_rep_mult *= 1.2;
Player.hacking_mult *= 1.2;
break;
case "PC Direct-Neural Interface NeuroNet Injector":
//Allow you to use ur brain as aneural net on a computer lol...increases everything
//High Level
case "PC Direct-Neural Interface NeuroNet Injector": //High level
Player.company_rep_mult *= 1.1;
Player.hacking_mult *= 1.1;
Player.hacking_speed_mult *= .98;
break;
//Misc augmentations
case "Neurotrainer I":
//Increase all exp gains - Low level
case "Neurotrainer I": //Low Level
Player.hacking_exp_mult *= 1.05;
Player.strength_exp_mult *= 1.05;
Player.defense_exp_mult *= 1.05;
Player.dexterity_exp_mult *= 1.05;
Player.agility_exp_mult *= 1.05;
this.charisma_exp_mult *= 1.05;
break;
case "Neurotrainer II":
//Increase all exp gains - Med level
case "Neurotrainer II": //Medium level
Player.hacking_exp_mult *= 1.1;
Player.strength_exp_mult *= 1.1;
Player.defense_exp_mult *= 1.1;
Player.dexterity_exp_mult *= 1.1;
Player.agility_exp_mult *= 1.1;
Player.charisma_exp_mult *= 1.1;
break;
case "Neurotrainer III":
//Increase all exp gains - High Level
case "Neurotrainer III": //High Level
Player.hacking_exp_mult *= 1.2;
Player.strength_exp_mult *= 1.2;
Player.defense_exp_mult *= 1.2;
Player.dexterity_exp_mult *= 1.2;
Player.agility_exp_mult *= 1.2;
Player.charisma_exp_mult *= 1.2;
break;
case "HyperSight Corneal Implant":
//Increases sight..which increases dex..hacking speed + money? - Med high level
case "HyperSight Corneal Implant": //Medium high level
Player.dexterity_mult *= 1.5;
Player.hacking_speed_mult *= .99;
Player.hacking_money_mult *= 1.1;
break;
default:
@ -438,4 +497,6 @@ applyAugmentation = function(aug, faction) {
aug.owned = true;
aug.factionInstalledBy = faction.name;
Player.augmentations.push(aug.name);
++Player.numAugmentations;
}

@ -522,7 +522,7 @@ function apply_op(op, a, b) {
//The same as Player's calculateHackingChance() function but takes in the server as an argument
function scriptCalculateHackingChance(server) {
var difficultyMult = (100 - server.hackDifficulty) / 100;
var skillMult = (Player.hacking_chance_multiplier * Player.hacking_skill);
var skillMult = (Player.hacking_chance_mult * Player.hacking_skill);
var skillChance = (skillMult - server.requiredHackingSkill) / skillMult;
return (skillChance * difficultyMult);
}
@ -531,7 +531,7 @@ function scriptCalculateHackingChance(server) {
function scriptCalculateHackingTime(server) {
var difficultyMult = server.requiredHackingSkill * server.hackDifficulty;
var skillFactor = (difficultyMult + 500) / (Player.hacking_skill + 50);
var hackingTime = skillFactor * Player.hacking_speed_multiplier; //This is in seconds
var hackingTime = skillFactor * Player.hacking_speed_mult; //This is in seconds
return hackingTime;
}
@ -544,7 +544,7 @@ function scriptCalculateExpGain(server) {
function scriptCalculatePercentMoneyHacked(server) {
var difficultyMult = (100 - server.hackDifficulty) / 100;
var skillMult = (Player.hacking_skill - (server.requiredHackingSkill - 1)) / Player.hacking_skill;
var percentMoneyHacked = difficultyMult * skillMult * Player.hacking_money_multiplier;
var percentMoneyHacked = difficultyMult * skillMult * Player.hacking_money_mult;
console.log("Percent money hacked calculated to be: " + percentMoneyHacked);
return percentMoneyHacked;
}

@ -14,10 +14,10 @@ function PlayerObject() {
//Intelligence, perhaps?
//Hacking multipliers
this.hacking_chance_multiplier = 2; //Increase through ascensions/augmentations
//this.hacking_speed_multiplier = 5; //Decrease through ascensions/augmentations
this.hacking_speed_multiplier = 1; //Make it faster for debugging
this.hacking_money_multiplier = .001; //Increase through ascensions/augmentations. Can't go above 1
this.hacking_chance_mult = 2; //Increase through ascensions/augmentations
//this.hacking_speed_mult = 5; //Decrease through ascensions/augmentations
this.hacking_speed_mult = 1; //Make it faster for debugging
this.hacking_money_mult = .001; //Increase through ascensions/augmentations. Can't go above 1
//Note: "Lifetime" refers to current ascension, "total" refers to the entire game history
//Accumulative stats and skills
@ -42,6 +42,13 @@ function PlayerObject() {
this.agility_exp = 0;
this.charisma_exp = 0;
this.hacking_mult = 1;
this.strength_mult = 1;
this.defense_mult = 1;
this.dexterity_mult = 1;
this.agility_mult = 1;
this.charisma_mult = 1;
this.hacking_exp_mult = 1;
this.strength_exp_mult = 1;
this.defense_exp_mult = 1;
@ -151,12 +158,12 @@ PlayerObject.prototype.calculateSkill = function(exp) {
PlayerObject.prototype.updateSkillLevels = function() {
//TODO Account for total and lifetime stats for achievements and stuff
this.hacking_skill = this.calculateSkill(this.hacking_exp);
this.strength = this.calculateSkill(this.strength_exp);
this.defense = this.calculateSkill(this.defense_exp);
this.dexterity = this.calculateSkill(this.dexterity_exp);
this.agility = this.calculateSkill(this.agility_exp);
this.charisma = this.calculateSkill(this.charisma_exp);
this.hacking_skill = Math.floor(this.calculateSkill(this.hacking_exp) * this.hacking_mult);
this.strength = Math.floor(this.calculateSkill(this.strength_exp) * this.strength_mult);
this.defense = Math.floor(this.calculateSkill(this.defense_exp) * this.defense_mult);
this.dexterity = Math.floor(this.calculateSkill(this.dexterity_exp) * this.dexterity_mult);
this.agility = Math.floor(this.calculateSkill(this.agility_exp) * this.agility_mult);
this.charisma = Math.floor(this.calculateSkill(this.charisma_exp) * this.charisma_mult);
}
//Calculates the chance of hacking a server
@ -166,7 +173,7 @@ PlayerObject.prototype.updateSkillLevels = function() {
// (hacking_chance_multiplier * hacking_skill) 100
PlayerObject.prototype.calculateHackingChance = function() {
var difficultyMult = (100 - this.getCurrentServer().hackDifficulty) / 100;
var skillMult = (this.hacking_chance_multiplier * this.hacking_skill);
var skillMult = (this.hacking_chance_mult * this.hacking_skill);
var skillChance = (skillMult - this.getCurrentServer().requiredHackingSkill) / skillMult;
return (skillChance * difficultyMult);
}
@ -179,7 +186,7 @@ PlayerObject.prototype.calculateHackingChance = function() {
PlayerObject.prototype.calculateHackingTime = function() {
var difficultyMult = this.getCurrentServer().requiredHackingSkill * this.getCurrentServer().hackDifficulty;
var skillFactor = (difficultyMult + 500) / (this.hacking_skill + 100);
return skillFactor * this.hacking_speed_multiplier;
return skillFactor * this.hacking_speed_mult;
}
//Calculates the PERCENTAGE of a server's money that the player will hack from the server if successful
@ -190,7 +197,7 @@ PlayerObject.prototype.calculateHackingTime = function() {
PlayerObject.prototype.calculatePercentMoneyHacked = function() {
var difficultyMult = (100 - this.getCurrentServer().hackDifficulty) / 100;
var skillMult = (this.hacking_skill - (this.getCurrentServer().requiredHackingSkill - 1)) / this.hacking_skill;
var percentMoneyHacked = difficultyMult * skillMult * this.hacking_money_multiplier;
var percentMoneyHacked = difficultyMult * skillMult * this.hacking_money_mult;
console.log("Percent money hacked calculated to be: " + percentMoneyHacked);
return percentMoneyHacked;
}
@ -384,20 +391,20 @@ PlayerObject.prototype.finishFactionWork = function(cancelled, faction) {
var faction = Factions[this.currentWorkFactionName];
faction.playerReputation += (this.workRepGained);
this.gainMoney(this.workMoneyGained / cancMult);
this.gainMoney(this.workMoneyGained);
this.updateSkillLevels();
var txt = "You worked for your faction " + faction.name + " for a total of " + convertTimeMsToTimeElapsedString(this.timeWorked) + " <br><br> " +
"You earned a total of: <br>" +
"$" + (this.workMoneyGained / cancMult).toFixed(2) + "<br>" +
(this.workRepGained / cancMult).toFixed(3) + " reputation for the company <br>" +
(this.workHackExpGained / cancMult).toFixed(3) + " hacking exp <br>" +
(this.workStrExpGained / cancMult).toFixed(3) + " strength exp <br>" +
(this.workDefExpGained / cancMult).toFixed(3) + " defense exp <br>" +
(this.workDexExpGained / cancMult).toFixed(3) + " dexterity exp <br>" +
(this.workAgiExpGained / cancMult).toFixed(3) + " agility exp <br>" +
(this.workChaExpGained / cancMult).toFixed(3) + " charisma exp<br>";
"$" + (this.workMoneyGained).toFixed(2) + "<br>" +
(this.workRepGained).toFixed(3) + " reputation for the company <br>" +
(this.workHackExpGained).toFixed(3) + " hacking exp <br>" +
(this.workStrExpGained).toFixed(3) + " strength exp <br>" +
(this.workDefExpGained).toFixed(3) + " defense exp <br>" +
(this.workDexExpGained).toFixed(3) + " dexterity exp <br>" +
(this.workAgiExpGained).toFixed(3) + " agility exp <br>" +
(this.workChaExpGained).toFixed(3) + " charisma exp<br>";
dialogBoxCreate(txt);
var mainMenu = document.getElementById("mainmenu-container");

110
src/Prestige.js Normal file

@ -0,0 +1,110 @@
/* Prestige functions */
//Prestige by purchasing augmentation
function prestigeAugmentation() {
Player.total_hacking += Player.hacking_skill;
Player.lifetime_hacking += Player.hacking_skill;
Player.total_strength += Player.strength;
Player.lifetime_strength += Player.strength;
Player.total_defense += Player.defense;
Player.lifetime_defense += Player.defense;
Player.total_dexterity += Player.dexterity;
Player.lifetime_dexterity += Player.dexterity;
Player.total_agility += Player.agility;
Player.lifetime_agility += Player.agility;
Player.total_charisma += Player.charisma;
Player.lifetime_charisma += Player.charisma;
Player.hacking_skill = 1;
Player.strength = 1;
Player.defense = 1;
Player.dexterity = 1;
Player.agility = 1;
Player.charisma = 1;
Player.hacking_exp = 0;
Player.strength_exp = 0;
Player.defense_exp = 0;
Player.dexterity_exp = 0;
Player.agility_exp = 0;
Player.charisma_exp = 0;
Player.money = 0;
Player.homeComputer = "";
Player.city = Locations.Sector12;
Player.location = "";
Player.companyName = "";
Player.companyPosition = "";
Player.currentServer = "";
Player.discoveredServers = [];
Player.purchasedServers = [];
Player.factions = [];
Player.startAction = false;
Player.actionTime = 0;
Player.isWorking = false;
Player.currentWorkFactionName = "";
Player.currentWorkFactionDescription = "";
Player.workHackExpGainRate = 0;
Player.workStrExpGainRate = 0;
Player.workDefExpGainRate = 0;
Player.workDexExpGainRate = 0;
Player.workAgiExpGainRate = 0;
Player.workChaExpGainRate = 0;
Player.workRepGainRate = 0;
Player.workMoneyGainRate = 0;
Player.workHackExpGained = 0;
Player.workStrExpGained = 0;
Player.workDefExpGained = 0;
Player.workDexExpGained = 0;
Player.workAgiExpGained = 0;
Player.workChaExpGained = 0;
Player.workRepGained = 0;
Player.workMoneyGained = 0;
Player.timeWorked = 0;
Player.lastUpdate = new Date().getTime();
//Delete all servers
for (var member in AllServers) {
delete AllServers[member];
}
AllServers = {};
//Delete Special Server IPs
for (var member in SpecialServerIps) {
delete SpecialServerIps[member];
}
SpecialServersIps = null;
//Delete Companies
for (var member in Companies) {
delete Companies[member];
}
Companies = {};
//Delete Factions
for (var member in Factions) {
delete Factions[member];
}
Factions = {};
//Inititialization
SpecialServerIps = new SpecialServerIpsMap();
Player.init();
initForeignServers();
initCompanies();
initFactions();
CompanyPositions.init();
}

@ -77,12 +77,14 @@ var Engine = {
var CompaniesSave = JSON.stringify(Companies);
var FactionsSave = JSON.stringify(Factions);
var SpecialServerIpsSave = JSON.stringify(SpecialServerIps);
var AugmentationsSave = JSON.stringify(Augmentations);
window.localStorage.setItem("netburnerPlayerSave", PlayerSave);
window.localStorage.setItem("netburnerAllServersSave", AllServersSave);
window.localStorage.setItem("netburnerCompaniesSave", CompaniesSave);
window.localStorage.setItem("netburnerFactionsSave", FactionsSave);
window.localStorage.setItem("netburnerSpecialServerIpsSave", SpecialServerIpsSave);
window.localStorage.setItem("netburnerAugmentationsSave", AugmentationsSave);
console.log("Game saved to local storage");
},
@ -105,18 +107,23 @@ var Engine = {
} else if (!window.localStorage.getItem("netburnerSpecialServerIpsSave")) {
console.log("No Special Server Ips save to load");
return false;
} else if (!window.localStorage.getItem("netburnerAugmentationsSave")) {
console.log("No Augmentations save to load");
return false;
} else {
var PlayerSave = window.localStorage.getItem("netburnerPlayerSave");
var AllServersSave = window.localStorage.getItem("netburnerAllServersSave");
var CompaniesSave = window.localStorage.getItem("netburnerCompaniesSave");
var FactionsSave = window.localStorage.getItem("netburnerFactionsSave");
var SpecialServerIpsSave = window.localStorage.getItem("netburnerSpecialServerIpsSave");
var AugmentationsSave = window.localStorage.getItem("netburnerAugmentationsSave");
Player = JSON.parse(PlayerSave, Reviver);
AllServers = JSON.parse(AllServersSave, Reviver);
Companies = JSON.parse(CompaniesSave, Reviver);
Factions = JSON.parse(FactionsSave, Reviver);
SpecialServerIps = JSON.parse(SpecialServerIpsSave, Reviver);
Augmentations = JSON.parse(AugmentationsSave, Reviver);
return true;
}
},
@ -144,6 +151,10 @@ var Engine = {
if (window.localStorage.getItem("netburnerSpecialServerIpsSave")) {
window.localStorage.removeItem("netburnerSpecialServerIpsSave");
}
if (window.localStorage.getItem("netburnerAugmentationsSave")) {
window.localStorage.removeItem("netburnerAugmentationsSave");
}
},
/* Load content when a main menu button is clicked */
@ -274,20 +285,20 @@ var Engine = {
Engine.Display.characterInfo.innerHTML = 'Current City: ' + Player.city + '<br><br>' +
'Employer: ' + Player.companyName + '<br><br>' +
'Job Title: ' + companyPosition + '<br><br><br><br>' +
'Money: $' + Player.money.toFixed(2) + '<br><br>' +
'Hacking Level: ' + Player.hacking_skill + '<br><br>' +
'Strength: ' + Player.strength + '<br><br>' +
'Defense: ' + Player.defense + '<br><br>' +
'Dexterity: ' + Player.dexterity + '<br><br>' +
'Agility: ' + Player.agility + '<br><br>' +
'Charisma: ' + Player.charisma + '<br><br>' +
'Money: $' + (Player.money.toFixed(2)).toLocaleString() + '<br><br>' +
'Hacking Level: ' + (Player.hacking_skill).toLocaleString() + '<br><br>' +
'Strength: ' + (Player.strength.toLocaleString() + '<br><br>' +
'Defense: ' + (Player.defense).toLocaleString() + '<br><br>' +
'Dexterity: ' + (Player.dexterity).toLocaleString() + '<br><br>' +
'Agility: ' + (Player.agility).toLocaleString() + '<br><br>' +
'Charisma: ' + (Player.charisma).toLocaleString() + '<br><br>' +
'Servers owned: ' + Player.purchasedServers.length + '<br><br>' +
'Hacking experience: ' + Player.hacking_exp.toFixed(4) + '<br><br>' +
'Strength experience: ' + Player.strength_exp.toFixed(4) + '<br><br>' +
'Defense experience: ' + Player.defense_exp.toFixed(4) + '<br><br>' +
'Dexterity experience: ' + Player.dexterity_exp.toFixed(4) + '<br><br>' +
'Agility experience: ' + Player.agility_exp.toFixed(4) + '<br><br>' +
'Charisma experience: ' + Player.charisma_exp.toFixed(4) + '<br><br>';
'Hacking experience: ' + (Player.hacking_exp.toFixed(4)).toLocaleString() + '<br><br>' +
'Strength experience: ' + (Player.strength_exp.toFixed(4)).toLocaleString() + '<br><br>' +
'Defense experience: ' + (Player.defense_exp.toFixed(4)).toLocaleString() + '<br><br>' +
'Dexterity experience: ' + (Player.dexterity_exp.toFixed(4)).toLocaleString() + '<br><br>' +
'Agility experience: ' + (Player.agility_exp.toFixed(4)).toLocaleString() + '<br><br>' +
'Charisma experience: ' + (Player.charisma_exp.toFixed(4)).toLocaleString() + '<br><br>';
},
/* Display locations in the world*/
@ -709,7 +720,7 @@ var Engine = {
initCompanies();
initFactions();
CompanyPositions.init();
initAugmentations();
}
//Message at the top of terminal

@ -40,7 +40,75 @@ purchaseAugmentationBoxCreate = function(aug, fac) {
confirmButton.parentNode.replaceChild(newConfirmButton, confirmButton);
newConfirmButton.addEventListener("click", function() {
if (Player.money >= (aug.baseCost * fac.augmentationPriceMult)) {
//TODO Requirements for specific augmentations (e.g Embedded Netburner Module b4 its upgrades)
if (aug.name == "Augmented Targeting II") {
var targeting1 = Augmentations["Augmented Targeting I"];
if (targeting1 == null) {
console.log("ERROR: Could not find Augmented Targeting I");
return;
}
if (targeting1.owned == false) {
dialogBoxCreate("You must first install Augmented Targeting I before you can upgrade it to Augmented Targeting II");
}
} else if (aug.name == "Augmented Targeting III") {
var targeting2 = Augmentations["Augmented Targeting II"];
if (targeting2 == null) {
console.log("ERROR: Could not find Augmented Targeting II");
return;
}
if (targeting2.owned == false) {
dialogBoxCreate("You must first install Augmented Targeting II before you can upgrade it to Augmented Targeting III");
}
} else if (aug.name == "Combat Rib II") {
var combatRib1 = Augmentations["Combat Rib I"];
if (combatRib1 == null) {
console.log("ERROR: Could not find Combat Rib I");
return;
}
if (combatRib1.owned == false) {
dialogBoxCreate("You must first install Combat Rib I before you can upgrade it to Combat Rib II");
}
} else if (aug.name == "Combat Rib III") {
var combatRib2 = Augmentations["Combat Rib II"];
if (combatRib2 == null) {
console.log("ERROR: Could not find Combat Rib II");
return;
}
if (combatRib2.owned == false) {
dialogBoxCreate("You must first install Combat Rib II before you can upgrade it to Combat Rib III");
}
} else if (aug.name == "Embedded Netburner Module Core V2 Upgrade") {
var coreImplant = Augmentations["Embedded Netburner Module Core Implant"];
if (coreImplant == null) {
console.log("ERROR: Could not find ENM Core Implant");
return;
}
if (coreImplant.owned == false) {
dialogBoxCreate("You must first install Embedded Netburner Module Core Implant before you can upgrade it to V2");
}
} else if (aug.name == "Embedded Netburner Module Core V3 Upgrade") {
var v2Upgrade = Augmentations["Embedded Netburner Module Core V2 Upgrade"];
if (v2Upgrade == null) {
console.log("ERROR: Could not find ENM Core V2 upgrade");
return;
}
if (v2Upgrade.owned == false) {
dialogBoxCreate("you must first install Embedded Netburner Module Core V2 Upgrade before you can upgrade it to V3");
}
} else if (aug.name == "Embedded Netburner Module Core Implant" ||
aug.name == "Embedded Netburner Module Analyze Engine" ||
aug.name == "Embedded Netburner Module Direct Memory Access Upgrade") {
var enm = Augmentations["Embedded Netburner Module"];
if (enm == null) {
console.log("ERROR: Could not find ENM");
return;
}
if (enm.owned == false) {
dialogBoxCreate("You must first install the Embedded Netburner Module before installing any upgrades to it");
}
} else if (Player.money >= (aug.baseCost * fac.augmentationPriceMult)) {
applyAugmentation(aug, fac);
//TODO Make this text better
dialogBoxCreate("You slowly drift to sleep as " + fac.name + "'s scientists put you under <br>" +