This commit is contained in:
danielyxie 2019-02-27 10:38:16 -08:00
commit af3323a111
5 changed files with 60 additions and 51 deletions

File diff suppressed because one or more lines are too long

54
dist/vendor.bundle.js vendored

File diff suppressed because one or more lines are too long

@ -236,6 +236,29 @@ function displayFactionContent(factionName) {
donateDivWrapper.appendChild(donateRepGain); donateDivWrapper.appendChild(donateRepGain);
elements.push(donateDiv); elements.push(donateDiv);
//Purchase Augmentations
const purchaseAugmentationsDiv = createElement("div", { class: "faction-work-div", display: "inline" });
const purchaseAugmentationsDivWrapper = createElement("div", { class: "faction-work-div-wrapper" });
purchaseAugmentationsDiv.appendChild(purchaseAugmentationsDivWrapper);
purchaseAugmentationsDivWrapper.appendChild(createElement("a", {
class:"std-button",
innerText:"Purchase Augmentations",
margin: "5px",
clickListener:()=>{
Engine.hideAllContent();
Engine.Display.factionAugmentationsContent.style.display = "block";
displayFactionAugmentations(factionName);
return false;
}
}));
purchaseAugmentationsDivWrapper.appendChild(createElement("pre", {
innerHTML: "<br>As your reputation with this faction rises, you will " +
"unlock Augmentations, which you can purchase to enhance " +
"your abilities.<br><br>"
}));
elements.push(purchaseAugmentationsDiv);
//Gang (BitNode-2) //Gang (BitNode-2)
if (Player.bitNodeN == 2 && (factionName == "Slum Snakes" || factionName == "Tetrads" || if (Player.bitNodeN == 2 && (factionName == "Slum Snakes" || factionName == "Tetrads" ||
factionName == "The Syndicate" || factionName == "The Dark Army" || factionName == "Speakers for the Dead" || factionName == "The Syndicate" || factionName == "The Dark Army" || factionName == "Speakers for the Dead" ||
@ -335,29 +358,6 @@ function displayFactionContent(factionName) {
elements.push(covenantPurchaseSleevesDiv); elements.push(covenantPurchaseSleevesDiv);
} }
//Purchase Augmentations
const purchaseAugmentationsDiv = createElement("div", { class: "faction-work-div", display: "inline" });
const purchaseAugmentationsDivWrapper = createElement("div", { class: "faction-work-div-wrapper" });
purchaseAugmentationsDiv.appendChild(purchaseAugmentationsDivWrapper);
purchaseAugmentationsDivWrapper.appendChild(createElement("a", {
class:"std-button",
innerText:"Purchase Augmentations",
margin: "5px",
clickListener:()=>{
Engine.hideAllContent();
Engine.Display.factionAugmentationsContent.style.display = "block";
displayFactionAugmentations(factionName);
return false;
}
}));
purchaseAugmentationsDivWrapper.appendChild(createElement("pre", {
innerHTML: "<br>As your reputation with this faction rises, you will " +
"unlock Augmentations, which you can purchase to enhance " +
"your abilities.<br><br>"
}));
elements.push(purchaseAugmentationsDiv);
// Determine if actions should be possible // Determine if actions should be possible
donateDiv.style.display = faction.favor >= Math.floor(CONSTANTS.BaseFavorToDonate * BitNodeMultipliers.RepToDonateToFaction) ? "inline" : "none"; donateDiv.style.display = faction.favor >= Math.floor(CONSTANTS.BaseFavorToDonate * BitNodeMultipliers.RepToDonateToFaction) ? "inline" : "none";

@ -442,6 +442,7 @@ function displayHacknetNodesContent() {
createHacknetNodeDomElement(Player.hacknetNodes[i]); createHacknetNodeDomElement(Player.hacknetNodes[i]);
} }
updateTotalHacknetProduction();
updateHacknetNodesContent(); updateHacknetNodesContent();
} }

@ -562,6 +562,14 @@ PlayerObject.prototype.canAfford = function(cost) {
} }
PlayerObject.prototype.recordMoneySource = function(amt, source) { PlayerObject.prototype.recordMoneySource = function(amt, source) {
if (!(this.moneySourceA instanceof MoneySourceTracker)) {
console.warn(`Player.moneySourceA was not properly initialized. Resetting`);
this.moneySourceA = new MoneySourceTracker();
}
if (!(this.moneySourceB instanceof MoneySourceTracker)) {
console.warn(`Player.moneySourceB was not properly initialized. Resetting`);
this.moneySourceB = new MoneySourceTracker();
}
this.moneySourceA.record(amt, source); this.moneySourceA.record(amt, source);
this.moneySourceB.record(amt, source); this.moneySourceB.record(amt, source);
} }