mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-29 19:13:49 +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),
|
jobs: structuredClone(Player.jobs),
|
||||||
factions: Player.factions.slice(),
|
factions: Player.factions.slice(),
|
||||||
entropy: Player.entropy,
|
entropy: Player.entropy,
|
||||||
|
karma: Player.karma,
|
||||||
};
|
};
|
||||||
setDeprecatedProperties(data, {
|
setDeprecatedProperties(data, {
|
||||||
playtimeSinceLastAug: {
|
playtimeSinceLastAug: {
|
||||||
|
@ -108,6 +108,7 @@ export function NetscriptFormulas(): InternalAPI<IFormulas> {
|
|||||||
jobs: {},
|
jobs: {},
|
||||||
factions: [],
|
factions: [],
|
||||||
entropy: 0,
|
entropy: 0,
|
||||||
|
karma: 0,
|
||||||
}),
|
}),
|
||||||
mockPerson: () => (): IPerson => ({
|
mockPerson: () => (): IPerson => ({
|
||||||
hp: { current: 0, max: 0 },
|
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[];
|
factions: string[];
|
||||||
totalPlaytime: number;
|
totalPlaytime: number;
|
||||||
location: string;
|
location: string;
|
||||||
|
karma: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @public */
|
/** @public */
|
||||||
@ -5513,6 +5514,15 @@ export interface NS {
|
|||||||
*/
|
*/
|
||||||
growthAnalyzeSecurity(threads: number, hostname?: string, cores?: number): number;
|
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.
|
* Suspends the script for n milliseconds.
|
||||||
* @remarks
|
* @remarks
|
||||||
|
Loading…
Reference in New Issue
Block a user