mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-22 17:23:00 +02:00
See description
Reverted ToastVariant back to an enum internally. Still exposed to player as just possible strings. Changed all 1-line documentation comments to actually be 1-line. Moved some because they were not providing documentation for the thing they were trying to.
This commit is contained in:
@@ -159,16 +159,12 @@ export class PlayerObject extends Person {
|
||||
return "Player";
|
||||
}
|
||||
|
||||
/**
|
||||
* Serialize the current object to a JSON save state.
|
||||
*/
|
||||
/** Serialize the current object to a JSON save state. */
|
||||
toJSON(): IReviverValue {
|
||||
return Generic_toJSON("PlayerObject", this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiatizes a PlayerObject object from a JSON save state.
|
||||
*/
|
||||
/** Initiatizes a PlayerObject object from a JSON save state. */
|
||||
static fromJSON(value: IReviverValue): PlayerObject {
|
||||
return Generic_fromJSON(PlayerObject, value.data);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
/**
|
||||
* Augmentation-related methods for the Player class (PlayerObject)
|
||||
*/
|
||||
/** Augmentation-related methods for the Player class (PlayerObject) */
|
||||
import { PlayerObject } from "./PlayerObject";
|
||||
import { calculateEntropy } from "../Grafting/EntropyAccumulation";
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ import { numeralWrapper } from "../../ui/numeralFormat";
|
||||
import { MoneySourceTracker } from "../../utils/MoneySourceTracker";
|
||||
import { dialogBoxCreate } from "../../ui/React/DialogBox";
|
||||
|
||||
import { SnackbarEvents } from "../../ui/React/Snackbar";
|
||||
import { SnackbarEvents, ToastVariant } from "../../ui/React/Snackbar";
|
||||
import { achievements } from "../../Achievements/Achievements";
|
||||
import { FactionNames } from "../../Faction/data/FactionNames";
|
||||
|
||||
@@ -257,7 +257,7 @@ export function takeDamage(this: PlayerObject, amt: number): boolean {
|
||||
|
||||
export function hospitalize(this: PlayerObject): number {
|
||||
const cost = getHospitalizationCost();
|
||||
SnackbarEvents.emit(`You've been Hospitalized for ${numeralWrapper.formatMoney(cost)}`, "warning", 2000);
|
||||
SnackbarEvents.emit(`You've been Hospitalized for ${numeralWrapper.formatMoney(cost)}`, ToastVariant.SUCCESS, 2000);
|
||||
|
||||
this.loseMoney(cost, "hospitalization");
|
||||
this.hp.current = this.hp.max;
|
||||
@@ -1193,7 +1193,7 @@ export function canAccessGrafting(this: PlayerObject): boolean {
|
||||
export function giveExploit(this: PlayerObject, exploit: Exploit): void {
|
||||
if (!this.exploits.includes(exploit)) {
|
||||
this.exploits.push(exploit);
|
||||
SnackbarEvents.emit("SF -1 acquired!", "success", 2000);
|
||||
SnackbarEvents.emit("SF -1 acquired!", ToastVariant.SUCCESS, 2000);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1202,7 +1202,7 @@ export function giveAchievement(this: PlayerObject, achievementId: string): void
|
||||
if (!achievement) return;
|
||||
if (!this.achievements.map((a) => a.ID).includes(achievementId)) {
|
||||
this.achievements.push({ ID: achievementId, unlockedOn: new Date().getTime() });
|
||||
SnackbarEvents.emit(`Unlocked Achievement: "${achievement.Name}"`, "success", 2000);
|
||||
SnackbarEvents.emit(`Unlocked Achievement: "${achievement.Name}"`, ToastVariant.SUCCESS, 2000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
/**
|
||||
* Server and HacknetServer-related methods for the Player class (PlayerObject)
|
||||
*/
|
||||
// Server and HacknetServer-related methods for the Player class (PlayerObject)
|
||||
import { PlayerObject } from "./PlayerObject";
|
||||
|
||||
import { CONSTANTS } from "../../Constants";
|
||||
|
||||
Reference in New Issue
Block a user