mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-08 16:53:54 +01:00
API: Add karma to ns.getPlayer() & document ns.heart.break() (#1131)
This commit is contained in:
parent
65082f677e
commit
a5f5c81912
@ -1683,6 +1683,7 @@ export const ns: InternalAPI<NSFull> = {
|
||||
jobs: structuredClone(Player.jobs),
|
||||
factions: Player.factions.slice(),
|
||||
entropy: Player.entropy,
|
||||
karma: Player.karma,
|
||||
};
|
||||
setDeprecatedProperties(data, {
|
||||
playtimeSinceLastAug: {
|
||||
|
@ -108,6 +108,7 @@ export function NetscriptFormulas(): InternalAPI<IFormulas> {
|
||||
jobs: {},
|
||||
factions: [],
|
||||
entropy: 0,
|
||||
karma: 0,
|
||||
}),
|
||||
mockPerson: () => (): IPerson => ({
|
||||
hp: { current: 0, max: 0 },
|
||||
|
10
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
10
src/ScriptEditor/NetscriptDefinitions.d.ts
vendored
@ -48,6 +48,7 @@ interface Player extends Person {
|
||||
factions: string[];
|
||||
totalPlaytime: number;
|
||||
location: string;
|
||||
karma: number;
|
||||
}
|
||||
|
||||
/** @public */
|
||||
@ -5513,6 +5514,15 @@ export interface NS {
|
||||
*/
|
||||
growthAnalyzeSecurity(threads: number, hostname?: string, cores?: number): number;
|
||||
|
||||
readonly heart: {
|
||||
/**
|
||||
* Get your current karma.
|
||||
* @remarks
|
||||
* RAM cost: 0 GB
|
||||
*/
|
||||
break(): number;
|
||||
};
|
||||
|
||||
/**
|
||||
* Suspends the script for n milliseconds.
|
||||
* @remarks
|
||||
|
Loading…
Reference in New Issue
Block a user