mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-27 11:27:04 +02:00
0.27.0 2nd Tier Prestige + Gangs
This commit is contained in:
+200
-30
@@ -2,44 +2,16 @@
|
||||
|
||||
//Prestige by purchasing augmentation
|
||||
function prestigeAugmentation() {
|
||||
//Sum up lifetime/total statistics
|
||||
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;
|
||||
initBitNodeMultipliers();
|
||||
|
||||
//Crime statistics
|
||||
Player.numTimesShopliftedTotal += Player.numTimesShoplifted;
|
||||
Player.numTimesShopliftedLifetime += Player.numTimesShoplifted;
|
||||
Player.numTimesShoplifted = 0;
|
||||
Player.numPeopleMuggedTotal += Player.numPeopleMugged;
|
||||
Player.numPeopleMuggedLifetime += Player.numPeopleMugged;
|
||||
Player.numPeopleMugged = 0;
|
||||
Player.numTimesDealtDrugsTotal += Player.numTimesDealtDrugs;
|
||||
Player.numTimesDealtDrugsLifetime += Player.numTimesDealtDrugs;
|
||||
Player.numTimesDealtDrugs = 0;
|
||||
Player.numTimesTraffickArmsTotal += Player.numTimesTraffickArms;
|
||||
Player.numTimesTraffickArmsLifetime += Player.numTimesTraffickArms;
|
||||
Player.numTimesTraffickArms = 0;
|
||||
Player.numPeopleKilledTotal += Player.numPeopleKilled;
|
||||
Player.numPeopleKilledLifetime += Player.numPeopleKilled;
|
||||
Player.numPeopleKilled = 0;
|
||||
Player.numTimesGrandTheftAutoTotal += Player.numTimesGrandTheftAuto;
|
||||
Player.numTimesGrandTheftAutoLifetime += Player.numTimesGrandTheftAuto;
|
||||
Player.numTimesGrandTheftAuto = 0;
|
||||
Player.numTimesKidnappedTotal += Player.numTimesKidnapped;
|
||||
Player.numTimesKidnappedLifetime += Player.numTimesKidnapped;
|
||||
Player.numTimesKidnapped = 0;
|
||||
Player.numTimesHeistTotal += Player.numTimesHeist;
|
||||
Player.numTimesHeistLifetime += Player.numTimesHeist;
|
||||
Player.numTimesHeist = 0;
|
||||
|
||||
Player.karma = 0;
|
||||
@@ -190,7 +162,8 @@ function prestigeAugmentation() {
|
||||
|
||||
//Re-initialize things - This will update any changes
|
||||
initFactions(); //Factions must be initialized before augmentations
|
||||
initAugmentations();
|
||||
initAugmentations(); //Calls reapplyAllAugmentations() and resets Player multipliers
|
||||
Player.reapplyAllSourceFiles();
|
||||
initCompanies();
|
||||
|
||||
//Clear terminal
|
||||
@@ -211,6 +184,14 @@ function prestigeAugmentation() {
|
||||
}
|
||||
}
|
||||
|
||||
//Gang, in BitNode 2
|
||||
if (Player.bitNodeN == 2 && Player.inGang()) {
|
||||
var faction = Factions[Player.gang.facName];
|
||||
if (faction instanceof Faction) {
|
||||
joinFaction(faction);
|
||||
}
|
||||
}
|
||||
|
||||
Player.playtimeSinceLastAug = 0;
|
||||
|
||||
var mainMenu = document.getElementById("mainmenu-container");
|
||||
@@ -228,3 +209,192 @@ function prestigeAugmentation() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Prestige by destroying Bit Node and gaining a Source File
|
||||
function prestigeSourceFile() {
|
||||
initBitNodeMultipliers();
|
||||
|
||||
//Crime statistics
|
||||
Player.numTimesShoplifted = 0;
|
||||
Player.numPeopleMugged = 0;
|
||||
Player.numTimesDealtDrugs = 0;
|
||||
Player.numTimesTraffickArms = 0;
|
||||
Player.numPeopleKilled = 0;
|
||||
Player.numTimesGrandTheftAuto = 0;
|
||||
Player.numTimesKidnapped = 0;
|
||||
Player.numTimesHeist = 0;
|
||||
|
||||
Player.karma = 0;
|
||||
|
||||
//Reset stats
|
||||
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 = new Decimal(1000);
|
||||
|
||||
Player.city = Locations.Sector12;
|
||||
Player.location = "";
|
||||
|
||||
Player.companyName = "";
|
||||
Player.companyPosition = "";
|
||||
|
||||
Player.currentServer = "";
|
||||
Player.discoveredServers = [];
|
||||
Player.purchasedServers = [];
|
||||
|
||||
Player.factions = [];
|
||||
Player.factionInvitations = [];
|
||||
|
||||
Player.queuedAugmentations = [];
|
||||
Player.augmentations = [];
|
||||
|
||||
Player.startAction = false;
|
||||
Player.actionTime = 0;
|
||||
|
||||
Player.isWorking = false;
|
||||
Player.currentWorkFactionName = "";
|
||||
Player.currentWorkFactionDescription = "";
|
||||
this.createProgramName = "";
|
||||
this.className = "";
|
||||
this.crimeType = "";
|
||||
|
||||
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 Worker Scripts objects
|
||||
for (var i = 0; i < workerScripts.length; ++i) {
|
||||
deleteActiveScriptsItem(workerScripts[i]);
|
||||
workerScripts[i].env.stopFlag = true;
|
||||
}
|
||||
workerScripts.length = 0;
|
||||
|
||||
var homeComp = Player.getHomeComputer();
|
||||
//Delete all servers except home computer
|
||||
for (var member in AllServers) {
|
||||
delete AllServers[member];
|
||||
}
|
||||
AllServers = {};
|
||||
//Delete Special Server IPs
|
||||
for (var member in SpecialServerIps) {
|
||||
delete SpecialServerIps[member];
|
||||
}
|
||||
SpecialServersIps = null;
|
||||
|
||||
//Reset home computer (only the programs) and add to AllServers
|
||||
homeComp.programs.length = 0;
|
||||
homeComp.runningScripts = [];
|
||||
homeComp.serversOnNetwork = [];
|
||||
homeComp.isConnectedTo = true;
|
||||
homeComp.ramUsed = 0;
|
||||
homeComp.programs.push(Programs.NukeProgram);
|
||||
var srcFile1Owned = false;
|
||||
for (var i = 0; i < Player.sourceFiles.length; ++i) {
|
||||
if (Player.sourceFiles[i].n == 1) {
|
||||
srcFile1Owned = true;
|
||||
}
|
||||
}
|
||||
if (srcFile1Owned) {
|
||||
homeComp.maxRam = 32;
|
||||
} else {
|
||||
homeComp.maxRam = 8;
|
||||
}
|
||||
Player.currentServer = homeComp.ip;
|
||||
Player.homeComputer = homeComp.ip;
|
||||
AddToAllServers(homeComp);
|
||||
|
||||
//Re-create foreign servers
|
||||
SpecialServerIps = new SpecialServerIpsMap(); //Must be done before initForeignServers()
|
||||
initForeignServers();
|
||||
|
||||
//Darkweb is purchase-able
|
||||
document.getElementById("location-purchase-tor").setAttribute("class", "a-link-button");
|
||||
|
||||
//Reset statistics of all scripts on home computer
|
||||
for (var i = 0; i < homeComp.scripts.length; ++i) {
|
||||
var s = homeComp.scripts[i];
|
||||
}
|
||||
//Delete messages on home computer
|
||||
homeComp.messages.length = 0;
|
||||
|
||||
//Delete Hacknet Nodes
|
||||
Player.hacknetNodes.length = 0;
|
||||
Player.totalHacknetNodeProduction = 0;
|
||||
|
||||
//Reset favor for Companies
|
||||
for (var member in Companies) {
|
||||
if (Companies.hasOwnProperty(member)) {
|
||||
Companies[member].favor = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//Reset favor for factions
|
||||
for (var member in Factions) {
|
||||
if (Factions.hasOwnProperty(member)) {
|
||||
Factions[member].favor = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//Stop a Terminal action if there is one
|
||||
if (Engine._actionInProgress) {
|
||||
Engine._actionInProgress = false;
|
||||
Terminal.finishAction(true);
|
||||
}
|
||||
|
||||
//Re-initialize things - This will update any changes
|
||||
initFactions(); //Factions must be initialized before augmentations
|
||||
initAugmentations(); //Calls reapplyAllAugmentations() and resets Player multipliers
|
||||
Player.reapplyAllSourceFiles();
|
||||
initCompanies();
|
||||
|
||||
//Clear terminal
|
||||
$("#terminal tr:not(:last)").remove();
|
||||
postNetburnerText();
|
||||
|
||||
//Messages
|
||||
initMessages();
|
||||
|
||||
//Gang
|
||||
Player.gang = null;
|
||||
|
||||
//Reset Stock market
|
||||
Player.hasWseAccount = false;
|
||||
|
||||
Player.playtimeSinceLastAug = 0;
|
||||
|
||||
var mainMenu = document.getElementById("mainmenu-container");
|
||||
mainMenu.style.visibility = "visible";
|
||||
Engine.loadTerminalContent();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user