mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-13 03:03:54 +01:00
rm aug woned
This commit is contained in:
parent
0d11a18ca9
commit
c76602a5df
@ -380,9 +380,6 @@ export class Augmentation {
|
|||||||
// Name of Augmentation
|
// Name of Augmentation
|
||||||
name = "";
|
name = "";
|
||||||
|
|
||||||
// Whether the player owns this Augmentation
|
|
||||||
owned = false;
|
|
||||||
|
|
||||||
// Array of names of all prerequisites
|
// Array of names of all prerequisites
|
||||||
prereqs: string[] = [];
|
prereqs: string[] = [];
|
||||||
|
|
||||||
|
@ -118,8 +118,6 @@ function resetAugmentation(aug: Augmentation): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function applyAugmentation(aug: IPlayerOwnedAugmentation, reapply = false): void {
|
function applyAugmentation(aug: IPlayerOwnedAugmentation, reapply = false): void {
|
||||||
Augmentations[aug.name].owned = true;
|
|
||||||
|
|
||||||
const augObj = Augmentations[aug.name];
|
const augObj = Augmentations[aug.name];
|
||||||
|
|
||||||
// Apply multipliers
|
// Apply multipliers
|
||||||
|
@ -1920,7 +1920,7 @@ export class Bladeburner implements IBladeburner {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If the Player starts doing some other actions, set action to idle and alert
|
// If the Player starts doing some other actions, set action to idle and alert
|
||||||
if (Augmentations[AugmentationNames.BladesSimulacrum].owned === false && player.isWorking) {
|
if (player.hasAugmentation(AugmentationNames.BladesSimulacrum) === false && player.isWorking) {
|
||||||
if (this.action.type !== ActionTypes["Idle"]) {
|
if (this.action.type !== ActionTypes["Idle"]) {
|
||||||
let msg = "Your Bladeburner action was cancelled because you started doing something else.";
|
let msg = "Your Bladeburner action was cancelled because you started doing something else.";
|
||||||
if (this.automateEnabled) {
|
if (this.automateEnabled) {
|
||||||
|
@ -63,7 +63,8 @@ export function hasAugmentationPrereqs(aug: Augmentation): boolean {
|
|||||||
console.error(`Invalid prereq Augmentation ${aug.prereqs[i]}`);
|
console.error(`Invalid prereq Augmentation ${aug.prereqs[i]}`);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (prereqAug.owned === false) {
|
|
||||||
|
if (Player.hasAugmentation(prereqAug, true) === false) {
|
||||||
hasPrereqs = false;
|
hasPrereqs = false;
|
||||||
|
|
||||||
// Check if the aug is purchased
|
// Check if the aug is purchased
|
||||||
|
@ -7,7 +7,7 @@ import { Augmentation } from "../../Augmentation/Augmentation";
|
|||||||
|
|
||||||
import { calculateEntropy } from "../Grafting/EntropyAccumulation";
|
import { calculateEntropy } from "../Grafting/EntropyAccumulation";
|
||||||
|
|
||||||
export function hasAugmentation(this: IPlayer, aug: string | Augmentation, installed = false): boolean {
|
export function hasAugmentation(this: IPlayer, aug: string | Augmentation, includeQueued = false): boolean {
|
||||||
const augName: string = aug instanceof Augmentation ? aug.name : aug;
|
const augName: string = aug instanceof Augmentation ? aug.name : aug;
|
||||||
|
|
||||||
for (const owned of this.augmentations) {
|
for (const owned of this.augmentations) {
|
||||||
@ -16,7 +16,7 @@ export function hasAugmentation(this: IPlayer, aug: string | Augmentation, insta
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!installed) {
|
if (!includeQueued) {
|
||||||
for (const owned of this.queuedAugmentations) {
|
for (const owned of this.queuedAugmentations) {
|
||||||
if (owned.name === augName) {
|
if (owned.name === augName) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -2084,12 +2084,7 @@ export function reapplyAllAugmentations(this: IPlayer, resetMultipliers = true):
|
|||||||
|
|
||||||
const playerAug = this.augmentations[i];
|
const playerAug = this.augmentations[i];
|
||||||
const augName = playerAug.name;
|
const augName = playerAug.name;
|
||||||
const aug = Augmentations[augName];
|
|
||||||
if (aug == null) {
|
|
||||||
console.warn(`Invalid augmentation name in Player.reapplyAllAugmentations(). Aug ${augName} will be skipped`);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
aug.owned = true;
|
|
||||||
if (augName == AugmentationNames.NeuroFluxGovernor) {
|
if (augName == AugmentationNames.NeuroFluxGovernor) {
|
||||||
for (let j = 0; j < playerAug.level; ++j) {
|
for (let j = 0; j < playerAug.level; ++j) {
|
||||||
applyAugmentation(this.augmentations[i], true);
|
applyAugmentation(this.augmentations[i], true);
|
||||||
|
@ -55,15 +55,15 @@ export function prestigeAugmentation(): void {
|
|||||||
AddToAllServers(homeComp);
|
AddToAllServers(homeComp);
|
||||||
prestigeHomeComputer(Player, homeComp);
|
prestigeHomeComputer(Player, homeComp);
|
||||||
|
|
||||||
if (augmentationExists(AugmentationNames.Neurolink) && Augmentations[AugmentationNames.Neurolink].owned) {
|
if (augmentationExists(AugmentationNames.Neurolink) && Player.hasAugmentation(AugmentationNames.Neurolink)) {
|
||||||
homeComp.programs.push(Programs.FTPCrackProgram.name);
|
homeComp.programs.push(Programs.FTPCrackProgram.name);
|
||||||
homeComp.programs.push(Programs.RelaySMTPProgram.name);
|
homeComp.programs.push(Programs.RelaySMTPProgram.name);
|
||||||
}
|
}
|
||||||
if (augmentationExists(AugmentationNames.CashRoot) && Augmentations[AugmentationNames.CashRoot].owned) {
|
if (augmentationExists(AugmentationNames.CashRoot) && Player.hasAugmentation(AugmentationNames.CashRoot)) {
|
||||||
Player.setMoney(1e6);
|
Player.setMoney(1e6);
|
||||||
homeComp.programs.push(Programs.BruteSSHProgram.name);
|
homeComp.programs.push(Programs.BruteSSHProgram.name);
|
||||||
}
|
}
|
||||||
if (augmentationExists(AugmentationNames.PCMatrix) && Augmentations[AugmentationNames.PCMatrix].owned) {
|
if (augmentationExists(AugmentationNames.PCMatrix) && Player.hasAugmentation(AugmentationNames.PCMatrix)) {
|
||||||
homeComp.programs.push(Programs.DeepscanV1.name);
|
homeComp.programs.push(Programs.DeepscanV1.name);
|
||||||
homeComp.programs.push(Programs.AutoLink.name);
|
homeComp.programs.push(Programs.AutoLink.name);
|
||||||
}
|
}
|
||||||
@ -151,7 +151,7 @@ export function prestigeAugmentation(): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Red Pill
|
// Red Pill
|
||||||
if (augmentationExists(AugmentationNames.TheRedPill) && Augmentations[AugmentationNames.TheRedPill].owned) {
|
if (augmentationExists(AugmentationNames.TheRedPill) && Player.hasAugmentation(AugmentationNames.TheRedPill)) {
|
||||||
const WorldDaemon = GetServer(SpecialServers.WorldDaemon);
|
const WorldDaemon = GetServer(SpecialServers.WorldDaemon);
|
||||||
const DaedalusServer = GetServer(SpecialServers.DaedalusServer);
|
const DaedalusServer = GetServer(SpecialServers.DaedalusServer);
|
||||||
if (WorldDaemon && DaedalusServer) {
|
if (WorldDaemon && DaedalusServer) {
|
||||||
@ -160,7 +160,7 @@ export function prestigeAugmentation(): void {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (augmentationExists(AugmentationNames.StaneksGift1) && Augmentations[AugmentationNames.StaneksGift1].owned) {
|
if (augmentationExists(AugmentationNames.StaneksGift1) && Player.hasAugmentation(AugmentationNames.StaneksGift1)) {
|
||||||
joinFaction(Factions[FactionNames.ChurchOfTheMachineGod]);
|
joinFaction(Factions[FactionNames.ChurchOfTheMachineGod]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -214,7 +214,7 @@ const Engine: {
|
|||||||
|
|
||||||
if (Engine.Counters.messages <= 0) {
|
if (Engine.Counters.messages <= 0) {
|
||||||
checkForMessagesToSend();
|
checkForMessagesToSend();
|
||||||
if (Augmentations[AugmentationNames.TheRedPill].owned) {
|
if (Player.hasAugmentation(AugmentationNames.TheRedPill)) {
|
||||||
Engine.Counters.messages = 4500; // 15 minutes for Red pill message
|
Engine.Counters.messages = 4500; // 15 minutes for Red pill message
|
||||||
} else {
|
} else {
|
||||||
Engine.Counters.messages = 150;
|
Engine.Counters.messages = 150;
|
||||||
|
Loading…
Reference in New Issue
Block a user