mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-23 17:53:00 +02:00
Adding more directory-related unit tests. Several more bug fixes and QoL improvements
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import * as augmentationMethods from "./PlayerObjectAugmentationMethods";
|
||||
import * as bladeburnerMethods from "./PlayerObjectBladeburnerMethods";
|
||||
import * as corporationMethods from "./PlayerObjectCorporationMethods";
|
||||
import * as gangMethods from "./PlayerObjectGangMethods";
|
||||
@@ -209,7 +210,8 @@ Object.assign(
|
||||
serverMethods,
|
||||
bladeburnerMethods,
|
||||
corporationMethods,
|
||||
gangMethods
|
||||
gangMethods,
|
||||
augmentationMethods
|
||||
);
|
||||
|
||||
PlayerObject.prototype.toJSON = function() {
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Augmentation-related methods for the Player class (PlayerObject)
|
||||
*/
|
||||
import { IPlayer } from "../IPlayer";
|
||||
|
||||
import { Augmentation } from "../../Augmentation/Augmentation";
|
||||
|
||||
export function hasAugmentation(this: IPlayer, aug: string | Augmentation): boolean {
|
||||
const augName: string = (aug instanceof Augmentation) ? aug.name : aug;
|
||||
|
||||
for (const owned of this.augmentations) {
|
||||
if (owned.name === augName) { return true; }
|
||||
}
|
||||
|
||||
for (const owned of this.queuedAugmentations) {
|
||||
if (owned.name === augName) { return true; }
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -219,6 +219,11 @@ export function prestigeSourceFile() {
|
||||
}
|
||||
}
|
||||
|
||||
const characterMenuHeader = document.getElementById("character-menu-header");
|
||||
if (characterMenuHeader instanceof HTMLElement) {
|
||||
characterMenuHeader.click(); characterMenuHeader.click();
|
||||
}
|
||||
|
||||
this.isWorking = false;
|
||||
this.currentWorkFactionName = "";
|
||||
this.currentWorkFactionDescription = "";
|
||||
@@ -1567,7 +1572,9 @@ export function hospitalize() {
|
||||
);
|
||||
}
|
||||
|
||||
this.loseMoney(this.max_hp * CONSTANTS.HospitalCostPerHp);
|
||||
const cost = this.max_hp * CONSTANTS.HospitalCostPerHp
|
||||
this.loseMoney(cost);
|
||||
this.recordMoneySource(-1 * cost, "hospitalization");
|
||||
this.hp = this.max_hp;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user