mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-20 21:25:47 +01:00
Fixed bug with new Bladeburner skills. Added faction reputation increaser in Dev Menu
This commit is contained in:
parent
0d43ed9c61
commit
00e8655ef9
@ -2199,6 +2199,12 @@ Bladeburner.prototype.createSkillsContent = function() {
|
||||
case "stamina":
|
||||
DomElems.actionsAndSkillsDesc.innerHTML += "Stamina: x" + mult + "<br>";
|
||||
break;
|
||||
case "money":
|
||||
DomElems.actionsAndSkillsDesc.innerHTML += "Contract Money: x" + mult + "<br>";
|
||||
break;
|
||||
case "expGain":
|
||||
DomElems.actionsAndSkillsDesc.innerHTML += "Exp Gain: x" + mult + "<br>";
|
||||
break;
|
||||
case "weaponAbility":
|
||||
//DomElems.actionsAndSkillsDesc.innerHTML +=
|
||||
break;
|
||||
@ -3852,11 +3858,11 @@ function initBladeburner() {
|
||||
name: SkillNames.HandsOfMidas,
|
||||
desc: "Each level of this skill increases the amount of money you receive from Contracts by 5%",
|
||||
baseCost: 2, costInc: 2.5,
|
||||
money: 2,
|
||||
money: 5,
|
||||
});
|
||||
Skills[SkillNames.Hyperdrive] = new Skill({
|
||||
name: SkillNames.Hyperdrive,
|
||||
esc: "Each level of this skill increases the experience earned from Contracts, Operations, and BlackOps by 4%",
|
||||
desc: "Each level of this skill increases the experience earned from Contracts, Operations, and BlackOps by 4%",
|
||||
baseCost: 1, costInc: 3,
|
||||
expGain: 4,
|
||||
});
|
||||
|
@ -229,6 +229,24 @@ export function createDevMenu() {
|
||||
innerText: "Receive Invite to Faction",
|
||||
});
|
||||
|
||||
const factionsReputationInput = createElement("input", {
|
||||
placeholder: "Rep to add to faction",
|
||||
type: "number",
|
||||
});
|
||||
|
||||
const factionsReputationButton = createElement("button", {
|
||||
class: "std-button",
|
||||
innerText: "Add rep to faction",
|
||||
clickListener: () => {
|
||||
const facName = getSelectText(factionsDropdown);
|
||||
const fac = Factions[facName];
|
||||
const rep = parseFloat(factionsReputationInput.value);
|
||||
if (fac != null && !isNaN(rep)) {
|
||||
fac.playerReputation += rep;
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
// Augmentations
|
||||
const augmentationsHeader = createElement("h2", {innerText: "Augmentations"});
|
||||
|
||||
@ -563,6 +581,9 @@ export function createDevMenu() {
|
||||
devMenuContainer.appendChild(factionsHeader);
|
||||
devMenuContainer.appendChild(factionsDropdown);
|
||||
devMenuContainer.appendChild(factionsAddButton);
|
||||
devMenuContainer.appendChild(createElement("br"));
|
||||
devMenuContainer.appendChild(factionsReputationInput);
|
||||
devMenuContainer.appendChild(factionsReputationButton);
|
||||
devMenuContainer.appendChild(augmentationsHeader);
|
||||
devMenuContainer.appendChild(augmentationsDropdown);
|
||||
devMenuContainer.appendChild(augmentationsQueueButton);
|
||||
|
@ -24,6 +24,7 @@ export interface IPlayer {
|
||||
queuedAugmentations: IPlayerOwnedAugmentation[];
|
||||
resleeves: Resleeve[];
|
||||
sleeves: Sleeve[];
|
||||
sleevesFromCovenant: number;
|
||||
sourceFiles: IPlayerOwnedSourceFile[];
|
||||
|
||||
// Stats
|
||||
|
48
src/PersonObjects/Sleeve/SleeveCovenantPurchases.ts
Normal file
48
src/PersonObjects/Sleeve/SleeveCovenantPurchases.ts
Normal file
@ -0,0 +1,48 @@
|
||||
/**
|
||||
* Implements the purchasing of extra Duplicate Sleeves from The Covenant
|
||||
*/
|
||||
import { Sleeve } from "./Sleeve";
|
||||
import { IPlayer } from "../IPlayer";
|
||||
|
||||
import { numeralWrapper } from "../../ui/numeralFormat";
|
||||
|
||||
import { dialogBoxCreate } from "../../../utils/DialogBox";
|
||||
import { yesNoBoxCreate,
|
||||
yesNoBoxClose,
|
||||
yesNoBoxGetYesButton,
|
||||
yesNoBoxGetNoButton } from "../../../utils/YesNoBox";
|
||||
|
||||
export const MaxSleevesFromCovenant: number = 5;
|
||||
|
||||
export function createPurchaseSleevesFromCovenantPopup(p: IPlayer) {
|
||||
if (p.sleevesFromCovenant >= MaxSleevesFromCovenant) { return; }
|
||||
|
||||
// First sleeve purchased costs the base amount. Then, the price of
|
||||
// each successive one increases by the same amount
|
||||
const baseCostPerExtraSleeve: number = 10e12;
|
||||
const cost: number = (p.sleevesFromCovenant + 1) * baseCostPerExtraSleeve;
|
||||
|
||||
const yesBtn = yesNoBoxGetYesButton();
|
||||
const noBtn = yesNoBoxGetNoButton();
|
||||
|
||||
yesBtn!.addEventListener("click", () => {
|
||||
if (p.canAfford(cost)) {
|
||||
p.loseMoney(cost);
|
||||
p.sleevesFromCovenant += 1;
|
||||
p.sleeves.push(new Sleeve());
|
||||
yesNoBoxClose();
|
||||
} else {
|
||||
dialogBoxCreate("You cannot afford to purchase a Duplicate Sleeve", false);
|
||||
}
|
||||
});
|
||||
|
||||
noBtn!.addEventListener("click", () => {
|
||||
yesNoBoxClose();
|
||||
});
|
||||
|
||||
const txt = `Would you like to purchase an additional Duplicate Sleeve from The Covenant for ` +
|
||||
`${numeralWrapper.formatMoney(cost)}?<br><br>` +
|
||||
`These Duplicate Sleeves are permanent. You can purchase a total of 5 Duplicate ` +
|
||||
`Sleeves from The Covenant`;
|
||||
yesNoBoxCreate(txt);
|
||||
}
|
Loading…
Reference in New Issue
Block a user