mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-21 08:42:53 +02:00
FIxed issue with purchasing Augmentations that require previous Augmentations. Buffed hacking slightly. FIxed UI issues:
This commit is contained in:
@@ -39,119 +39,45 @@ purchaseAugmentationBoxCreate = function(aug, fac) {
|
||||
newConfirmButton.addEventListener("click", function() {
|
||||
|
||||
//TODO Requirements for specific augmentations (e.g Embedded Netburner Module b4 its upgrades)
|
||||
if (aug.name == AugmentationNames.Targeting2) {
|
||||
var targeting1 = Augmentations[AugmentationNames.Targeting1];
|
||||
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 == AugmentationNames.Targeting3) {
|
||||
var targeting2 = Augmentations[AugmentationNames.Targeting2];
|
||||
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 == AugmentationNames.CombatRib2) {
|
||||
var combatRib1 = Augmentations[AugmentationNames.CombatRib1];
|
||||
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 == AugmentationNames.CombatRib3) {
|
||||
var combatRib2 = Augmentations[AugmentationNames.CombatRib2];
|
||||
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 == AugmentationNames.GrapheneBionicSpine) {
|
||||
var bionicSpine = Augmentations[AugmentationNames.BionicSpine];
|
||||
if (bionicSpine == null) {
|
||||
console.log("ERROR: Could not find Bionic Spine");
|
||||
return;
|
||||
}
|
||||
if (bionicSpine.owned == false) {
|
||||
dialogBoxCreate("You must first install a Bionic Spine before you can upgrade it to a Graphene Bionic Spine");
|
||||
}
|
||||
} else if (aug.name == AugmentationNames.GrapheneBionicLegs) {
|
||||
var bionicLegs = Augmentations[AugmentationNames.BionicLegs];
|
||||
if (bionicLegs == null) {
|
||||
console.log("ERROR: Could not find Bionic Legs");
|
||||
return;
|
||||
}
|
||||
if (bionicLegs.owned == false ) {
|
||||
dialogBoxCreate("You must first install Bionic Legs before you can upgrade it to Graphene Bionic Legs");
|
||||
}
|
||||
} else if (aug.name == AugmentationNames.ENMCoreV2) {
|
||||
var coreImplant = Augmentations[AugmentationNames.ENMCore];
|
||||
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 == AugmentationNames.ENMCoreV3) {
|
||||
var v2Upgrade = Augmentations[AugmentationNames.ENMCoreV2];
|
||||
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 == AugmentationNames.ENMCore ||
|
||||
if (aug.name == AugmentationNames.Targeting2 &&
|
||||
Augmentations[AugmentationNames.Targeting1].owned == false) {
|
||||
dialogBoxCreate("You must first install Augmented Targeting I before you can upgrade it to Augmented Targeting II");
|
||||
} else if (aug.name == AugmentationNames.Targeting3 &&
|
||||
Augmentations[AugmentationNames.Targeting2].owned == false) {
|
||||
dialogBoxCreate("You must first install Augmented Targeting II before you can upgrade it to Augmented Targeting III");
|
||||
} else if (aug.name == AugmentationNames.CombatRib2 &&
|
||||
Augmentations[AugmentationNames.CombatRib1].owned == false) {
|
||||
dialogBoxCreate("You must first install Combat Rib I before you can upgrade it to Combat Rib II");
|
||||
} else if (aug.name == AugmentationNames.CombatRib3 &&
|
||||
Augmentations[AugmentationNames.CombatRib2].owned == false) {
|
||||
dialogBoxCreate("You must first install Combat Rib II before you can upgrade it to Combat Rib III");
|
||||
} else if (aug.name == AugmentationNames.GrapheneBionicSpine &&
|
||||
Augmentations[AugmentationNames.BionicSpine].owned == false) {
|
||||
dialogBoxCreate("You must first install a Bionic Spine before you can upgrade it to a Graphene Bionic Spine");
|
||||
} else if (aug.name == AugmentationNames.GrapheneBionicLegs &&
|
||||
Augmentations[AugmentationNames.BionicLegs].owned == false) {
|
||||
dialogBoxCreate("You must first install Bionic Legs before you can upgrade it to Graphene Bionic Legs");
|
||||
} else if (aug.name == AugmentationNames.ENMCoreV2 &&
|
||||
Augmentations[AugmentationNames.ENMCore].owned == false) {
|
||||
dialogBoxCreate("You must first install Embedded Netburner Module Core Implant before you can upgrade it to V2");
|
||||
} else if (aug.name == AugmentationNames.ENMCoreV3 &&
|
||||
Augmentations[AugmentationNames.ENMCoreV2].owned == false) {
|
||||
dialogBoxCreate("You must first install Embedded Netburner Module Core V2 Upgrade before you can upgrade it to V3");
|
||||
} else if ((aug.name == AugmentationNames.ENMCore ||
|
||||
aug.name == AugmentationNames.ENMAnalyzeEngine ||
|
||||
aug.name == AugmentationNames.ENMDMA) {
|
||||
var enm = Augmentations[AugmentationNames.ENM];
|
||||
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 (aug.name == AugmentationNames.PCDNIOptimizer ||
|
||||
aug.name == AugmentationNames.PCDNINeuralNetwork) {
|
||||
var pcdni = Augmentations[AugmentationNames.PCDNI];
|
||||
if (pcdni == null) {
|
||||
console.log("ERROR: Could not find PC Direct Neural Interface");
|
||||
return;
|
||||
}
|
||||
if (pcdni.owned == false) {
|
||||
dialogBoxCreate("You must first install the Pc Direct-Neural Interface before installing this upgrade");
|
||||
}
|
||||
|
||||
} else if (aug.name == AugmentationNames.GrapheneBrachiBlades) {
|
||||
var brachiblades = Augmentations[AugmentationNames.BrachiBlades];
|
||||
if (brachiblades == null) {
|
||||
console.log("ERROR: Could not find Brachi Blades aug");
|
||||
return;
|
||||
}
|
||||
if (brachiblades.owned == false) {
|
||||
dialogBoxCreate("You must first install the Brachi Blades augmentation before installing this upgrade");
|
||||
}
|
||||
} else if (aug.name == AugmentationNames.GrapheneBionicArms) {
|
||||
var bionicarms = Augmentations[AugmentationNames.BionicArms];
|
||||
if (bionicarms == null) {
|
||||
console.log("ERORR: Could not find Bionic Arms aug");
|
||||
return;
|
||||
}
|
||||
if (bionicarms.owned == false) {
|
||||
dialogBoxCreate("You must first install the Bionic Arms augmentation before installing this upgrade");
|
||||
}
|
||||
aug.name == AugmentationNames.ENMDMA) &&
|
||||
Augmentations[AugmentationNames.ENM].owned == false) {
|
||||
dialogBoxCreate("You must first install the Embedded Netburner Module before installing any upgrades to it");
|
||||
} else if ((aug.name == AugmentationNames.PCDNIOptimizer ||
|
||||
aug.name == AugmentationNames.PCDNINeuralNetwork) &&
|
||||
Augmentations[AugmentationNames.PCDNI].owned == false) {
|
||||
dialogBoxCreate("You must first install the Pc Direct-Neural Interface before installing this upgrade");
|
||||
} else if (aug.name == AugmentationNames.GrapheneBrachiBlades &&
|
||||
Augmentations[AugmentationNames.BrachiBlades].owned == false) {
|
||||
dialogBoxCreate("You must first install the Brachi Blades augmentation before installing this upgrade");
|
||||
} else if (aug.name == AugmentationNames.GrapheneBionicArms &&
|
||||
Augmentations[AugmentationNames.BionicArms].owned == false) {
|
||||
dialogBoxCreate("You must first install the Bionic Arms augmentation before installing this upgrade");
|
||||
} else if (Player.money >= (aug.baseCost * fac.augmentationPriceMult)) {
|
||||
applyAugmentation(aug);
|
||||
dialogBoxCreate("You slowly drift to sleep as " + fac.name + "'s scientists put you under " +
|
||||
|
||||
Reference in New Issue
Block a user