@kar-mi/spirit-vale-tools-character 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -0
- package/dist/decoder.d.ts +16 -0
- package/dist/decoder.d.ts.map +1 -0
- package/dist/formulas.d.ts +18 -0
- package/dist/formulas.d.ts.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1290 -0
- package/dist/inspect-roster.d.ts +26 -0
- package/dist/inspect-roster.d.ts.map +1 -0
- package/dist/record-decoder.d.ts +6 -0
- package/dist/record-decoder.d.ts.map +1 -0
- package/dist/stat-names.d.ts +3 -0
- package/dist/stat-names.d.ts.map +1 -0
- package/dist/synthetic-character.test-helper.d.ts +32 -0
- package/dist/synthetic-character.test-helper.d.ts.map +1 -0
- package/dist/tracker.d.ts +67 -0
- package/dist/tracker.d.ts.map +1 -0
- package/dist/types.d.ts +144 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +30 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { CapturedFishNetPacket } from "@kar-mi/spirit-vale-tools-capture";
|
|
2
|
+
import type { CharacterSnapshot } from "./types.ts";
|
|
3
|
+
export interface InspectedCharacter {
|
|
4
|
+
snapshot: CharacterSnapshot;
|
|
5
|
+
/** When this inspect arrived. Later inspects of the same player replace the earlier one. */
|
|
6
|
+
inspectedAt: string;
|
|
7
|
+
}
|
|
8
|
+
/** Characters seen by inspecting other players, most recent per player. */
|
|
9
|
+
export declare class FishNetInspectRoster {
|
|
10
|
+
private readonly limit;
|
|
11
|
+
private readonly characters;
|
|
12
|
+
private readonly listeners;
|
|
13
|
+
private localName?;
|
|
14
|
+
constructor(limit?: number);
|
|
15
|
+
/** The local player's name. */
|
|
16
|
+
setLocalName(name: string | undefined): void;
|
|
17
|
+
/** Returns true when the packet was an inspect reply this roster consumed. */
|
|
18
|
+
consume(packet: CapturedFishNetPacket, now?: Date): boolean;
|
|
19
|
+
/** Most recently inspected first. */
|
|
20
|
+
list(): InspectedCharacter[];
|
|
21
|
+
get(name: string): CharacterSnapshot | undefined;
|
|
22
|
+
clear(): void;
|
|
23
|
+
subscribe(listener: (roster: InspectedCharacter[]) => void): () => void;
|
|
24
|
+
private publish;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=inspect-roster.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspect-roster.d.ts","sourceRoot":"","sources":["../src/inspect-roster.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAE/E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAQpD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,4FAA4F;IAC5F,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,2EAA2E;AAC3E,qBAAa,oBAAoB;IAKnB,OAAO,CAAC,QAAQ,CAAC,KAAK;IAJlC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAyC;IACpE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAqD;IAC/E,OAAO,CAAC,SAAS,CAAC,CAAS;IAE3B,YAA6B,KAAK,GAAE,MAAsB,EAAI;IAE9D,+BAA+B;IAC/B,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAE3C;IAED,8EAA8E;IAC9E,OAAO,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,OAAa,GAAG,OAAO,CAwBhE;IAED,qCAAqC;IACrC,IAAI,IAAI,kBAAkB,EAAE,CAI3B;IAED,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAG/C;IAED,KAAK,IAAI,IAAI,CAIZ;IAED,SAAS,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,kBAAkB,EAAE,KAAK,IAAI,GAAG,MAAM,IAAI,CAGtE;IAED,OAAO,CAAC,OAAO;CAIhB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CapturedFishNetPacket, FishNetSpawnSyncEntry } from "@kar-mi/spirit-vale-tools-capture";
|
|
2
|
+
import type { CharacterRecordValues } from "./types.ts";
|
|
3
|
+
export declare function decodeCharacterRecordSync(packet: CapturedFishNetPacket): Partial<CharacterRecordValues> | undefined;
|
|
4
|
+
/** Reads exact, map-decoded resource SyncTypes embedded in an ObjectSpawn. */
|
|
5
|
+
export declare function decodeCharacterSpawnRecords(entries: readonly FishNetSpawnSyncEntry[] | undefined): Partial<CharacterRecordValues> | undefined;
|
|
6
|
+
//# sourceMappingURL=record-decoder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-decoder.d.ts","sourceRoot":"","sources":["../src/record-decoder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AACtG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAC,GAAG,SAAS,CAgBnH;AAED,8EAA8E;AAC9E,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,SAAS,qBAAqB,EAAE,GAAG,SAAS,GAAG,OAAO,CAAC,qBAAqB,CAAC,GAAG,SAAS,CAiB7I"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stat-names.d.ts","sourceRoot":"","sources":["../src/stat-names.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAc7C,CAAC;AAEF,eAAO,MAAM,aAAa,aAAyT,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** Options exist so the positional/chaos/qualifier fields can be exercised. */
|
|
2
|
+
export interface SyntheticCharacterOptions {
|
|
3
|
+
/** `EquipData.ChaosType` on the worn weapon. -1 = no chaos substat. */
|
|
4
|
+
chaosType?: number;
|
|
5
|
+
/** Worn-weapon substats in wire order; `null` writes an absent entry (a hole). */
|
|
6
|
+
substats?: Array<{
|
|
7
|
+
type: number;
|
|
8
|
+
roll: number;
|
|
9
|
+
valueStr?: string;
|
|
10
|
+
} | null>;
|
|
11
|
+
/** Worn-weapon cards in wire order; `null` writes an empty socket. */
|
|
12
|
+
cards?: Array<string | null>;
|
|
13
|
+
/** Stored weapon loadouts (Normal, Secondary, Heavy). */
|
|
14
|
+
loadouts?: Array<Array<{
|
|
15
|
+
slot: number;
|
|
16
|
+
itemId: string;
|
|
17
|
+
}>>;
|
|
18
|
+
/** Equipped grimoires in wire order; `null` writes an empty slot. */
|
|
19
|
+
grimoires?: Array<string | null>;
|
|
20
|
+
/** `SkillSystemData.Skills` — the skill-tree allocation. */
|
|
21
|
+
skills?: Array<{
|
|
22
|
+
id: string;
|
|
23
|
+
level: number;
|
|
24
|
+
}>;
|
|
25
|
+
/** `SkillSystemData.Assigned` — the action bar. Must never reach `snapshot.skills`. */
|
|
26
|
+
assigned?: Array<{
|
|
27
|
+
id: string;
|
|
28
|
+
level: number;
|
|
29
|
+
}>;
|
|
30
|
+
}
|
|
31
|
+
export declare function syntheticCharacter(update: boolean, includeHistory?: boolean, characterName?: string, options?: SyntheticCharacterOptions): Buffer;
|
|
32
|
+
//# sourceMappingURL=synthetic-character.test-helper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"synthetic-character.test-helper.d.ts","sourceRoot":"","sources":["../src/synthetic-character.test-helper.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,MAAM,WAAW,yBAAyB;IACxC,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kFAAkF;IAClF,QAAQ,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC,CAAC;IAC3E,sEAAsE;IACtE,KAAK,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC7B,yDAAyD;IACzD,QAAQ,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,CAAC;IAC1D,qEAAqE;IACrE,SAAS,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACjC,4DAA4D;IAC5D,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9C,uFAAuF;IACvF,QAAQ,CAAC,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACjD;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,OAAO,EACf,cAAc,UAAO,EACrB,aAAa,SAAiB,EAC9B,OAAO,GAAE,yBAA8B,GACtC,MAAM,CAyER"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import type { CapturedFishNetPacket } from "@kar-mi/spirit-vale-tools-capture";
|
|
2
|
+
import type { CharacterSnapshot, CharacterViewState } from "./types.ts";
|
|
3
|
+
interface CharacterTrackerTiming {
|
|
4
|
+
now?: () => number;
|
|
5
|
+
schedule?: (callback: () => void, delayMs: number) => unknown;
|
|
6
|
+
cancel?: (handle: unknown) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare class FishNetCharacterTracker {
|
|
9
|
+
private snapshot?;
|
|
10
|
+
private identity?;
|
|
11
|
+
private unsupportedDetail?;
|
|
12
|
+
private currentWeight?;
|
|
13
|
+
private localObjectId?;
|
|
14
|
+
/** Transport connection that owns {@link localObjectId}; object ids only mean anything within one. */
|
|
15
|
+
private localConnectionId?;
|
|
16
|
+
private records;
|
|
17
|
+
private pendingRecords;
|
|
18
|
+
private listeners;
|
|
19
|
+
private healthRegen?;
|
|
20
|
+
private manaRegen?;
|
|
21
|
+
private readonly now;
|
|
22
|
+
private readonly schedule;
|
|
23
|
+
private readonly cancel;
|
|
24
|
+
constructor(initial?: CharacterSnapshot, timing?: CharacterTrackerTiming);
|
|
25
|
+
consume(packet: CapturedFishNetPacket): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* `StatusComponent`'s `Data`/`Level`/`JobLevel` SyncVars are the only live wire source for your
|
|
28
|
+
* own name/level right now - the game never sends `LoadCharacter_T`/`CharacterCallback_T` in
|
|
29
|
+
* practice, which is what a full {@link CharacterSnapshot} needs. This only ever updates
|
|
30
|
+
* {@link identity}, deliberately never merged into `snapshot`.
|
|
31
|
+
*/
|
|
32
|
+
private consumeIdentitySync;
|
|
33
|
+
private consumeRecordSync;
|
|
34
|
+
private pendingRecordsFor;
|
|
35
|
+
/** True only for the pinned unit object on the connection that pinned it. */
|
|
36
|
+
private isLocalObject;
|
|
37
|
+
/**
|
|
38
|
+
* Drops the pinned object and every buffered candidate at a connection boundary. Carried weight is
|
|
39
|
+
* character-scoped and the snapshot it belongs to survives these boundaries, so it is deliberately
|
|
40
|
+
* kept: blanking it left the panel weightless until the next complete callback happened to arrive.
|
|
41
|
+
* Records are kept only for the gap until the next pin, which replaces them.
|
|
42
|
+
*/
|
|
43
|
+
private releaseLocalObject;
|
|
44
|
+
setCached(snapshot: CharacterSnapshot | undefined): void;
|
|
45
|
+
current(): CharacterSnapshot | undefined;
|
|
46
|
+
currentObjectId(): number | undefined;
|
|
47
|
+
/**
|
|
48
|
+
* Moves a pre-pin candidate when a caller represents one physical object with a stable logical
|
|
49
|
+
* object id. This changes no values and promotes nothing; the following serverRpc remains the
|
|
50
|
+
* proof that pins the destination object.
|
|
51
|
+
*/
|
|
52
|
+
rekeyPendingObject(connectionId: string, fromObjectId: number, toObjectId: number): void;
|
|
53
|
+
private applyLocalRecordUpdate;
|
|
54
|
+
private applyAuthoritativeMaxima;
|
|
55
|
+
private observeRegen;
|
|
56
|
+
private settleRegen;
|
|
57
|
+
private clearRegen;
|
|
58
|
+
private clearRegenTimer;
|
|
59
|
+
private resetRegenSequences;
|
|
60
|
+
currentArchetypeId(): number | undefined;
|
|
61
|
+
state(): CharacterViewState;
|
|
62
|
+
private applyRecords;
|
|
63
|
+
subscribe(listener: (state: CharacterViewState) => void): () => void;
|
|
64
|
+
private publish;
|
|
65
|
+
}
|
|
66
|
+
export {};
|
|
67
|
+
//# sourceMappingURL=tracker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tracker.d.ts","sourceRoot":"","sources":["../src/tracker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAI/E,OAAO,KAAK,EAA4C,iBAAiB,EAA0B,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAa1I,UAAU,sBAAsB;IAC9B,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IAC9D,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CACpC;AASD,qBAAa,uBAAuB;IAClC,OAAO,CAAC,QAAQ,CAAC,CAAoB;IACrC,OAAO,CAAC,QAAQ,CAAC,CAAoB;IACrC,OAAO,CAAC,iBAAiB,CAAC,CAAS;IACnC,OAAO,CAAC,aAAa,CAAC,CAAS;IAC/B,OAAO,CAAC,aAAa,CAAC,CAAS;IAC/B,sGAAsG;IACtG,OAAO,CAAC,iBAAiB,CAAC,CAAS;IACnC,OAAO,CAAC,OAAO,CAA6B;IAC5C,OAAO,CAA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;IAED,OAAO,CAAC,OAAO;CAIhB"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
export declare const ATTRIBUTE_NAMES: readonly ["STR", "VIT", "AGI", "DEX", "INT", "LUK"];
|
|
2
|
+
export type CharacterAttributeName = typeof ATTRIBUTE_NAMES[number];
|
|
3
|
+
export interface CharacterAttributes {
|
|
4
|
+
STR: number;
|
|
5
|
+
VIT: number;
|
|
6
|
+
AGI: number;
|
|
7
|
+
DEX: number;
|
|
8
|
+
INT: number;
|
|
9
|
+
LUK: number;
|
|
10
|
+
}
|
|
11
|
+
export interface CharacterSnapshot {
|
|
12
|
+
schemaVersion: 1;
|
|
13
|
+
buildFingerprint: string;
|
|
14
|
+
name: string;
|
|
15
|
+
title?: string;
|
|
16
|
+
archetypes: string[];
|
|
17
|
+
level: number;
|
|
18
|
+
experience: number;
|
|
19
|
+
jobLevel: number;
|
|
20
|
+
jobExperience: number;
|
|
21
|
+
attributes: CharacterAttributes;
|
|
22
|
+
activeLoadout: "Normal" | "Secondary" | "Heavy";
|
|
23
|
+
equipment: CharacterEquipment[];
|
|
24
|
+
artifacts: CharacterArtifact[];
|
|
25
|
+
/** The skill-TREE allocation: what the player actually spent points on. */
|
|
26
|
+
skills: CharacterSkill[];
|
|
27
|
+
/** The action bar (`SkillSystemData.Assigned`, 40 slots). */
|
|
28
|
+
assignedSkills?: CharacterSkill[];
|
|
29
|
+
/** The three stored weapon loadouts (Normal, Secondary, Heavy) in wire order, when the payload carried them. */
|
|
30
|
+
loadouts?: CharacterEquipment[][];
|
|
31
|
+
/** Equipped grimoires in wire order. Absent when the payload ended before the build section. */
|
|
32
|
+
grimoires?: CharacterEquipment[];
|
|
33
|
+
playtimeSeconds?: number;
|
|
34
|
+
monsterKills?: number;
|
|
35
|
+
bossKills?: number;
|
|
36
|
+
deaths?: number;
|
|
37
|
+
updatedAt: string;
|
|
38
|
+
source: "live" | "cached";
|
|
39
|
+
}
|
|
40
|
+
export interface CharacterSubstat {
|
|
41
|
+
type: number;
|
|
42
|
+
name: string;
|
|
43
|
+
roll: number;
|
|
44
|
+
value?: number;
|
|
45
|
+
percent: boolean;
|
|
46
|
+
/** `StatData.ValueStr` — the qualifier scoping this stat to one skill or element (e.g. a damage bonus that only applies to a single skill). */
|
|
47
|
+
qualifier?: string;
|
|
48
|
+
/** Position of this substat in the item's wire array. */
|
|
49
|
+
index?: number;
|
|
50
|
+
}
|
|
51
|
+
export interface CharacterEquipment {
|
|
52
|
+
slot: string;
|
|
53
|
+
itemId: string;
|
|
54
|
+
refine: number;
|
|
55
|
+
cards: string[];
|
|
56
|
+
substats: CharacterSubstat[];
|
|
57
|
+
/** `EquipData.ChaosType` — the `EquipType` whose substat pool the chaos roll was drawn from, or -1 when the item has no chaos substat. */
|
|
58
|
+
chaosType?: number;
|
|
59
|
+
/** Cards by socket position; `null` is an empty socket. */
|
|
60
|
+
cardsBySlot?: Array<string | null>;
|
|
61
|
+
}
|
|
62
|
+
export interface CharacterArtifact {
|
|
63
|
+
slot: string;
|
|
64
|
+
itemId: string;
|
|
65
|
+
refine: number;
|
|
66
|
+
gems: CharacterRefinableItem[];
|
|
67
|
+
substats: CharacterSubstat[];
|
|
68
|
+
}
|
|
69
|
+
export interface CharacterRefinableItem {
|
|
70
|
+
id: string;
|
|
71
|
+
refine: number;
|
|
72
|
+
}
|
|
73
|
+
/** A learned skill as sent by the character callback. */
|
|
74
|
+
export interface CharacterSkill {
|
|
75
|
+
id: string;
|
|
76
|
+
displayName: string;
|
|
77
|
+
level: number;
|
|
78
|
+
effects: CharacterSkillEffect[];
|
|
79
|
+
}
|
|
80
|
+
export interface CharacterSkillEffect {
|
|
81
|
+
type: number;
|
|
82
|
+
label: string;
|
|
83
|
+
value: number;
|
|
84
|
+
percent: boolean;
|
|
85
|
+
}
|
|
86
|
+
export interface CharacterStatBreakdown {
|
|
87
|
+
id: string;
|
|
88
|
+
label: string;
|
|
89
|
+
category: "Offense" | "Accuracy" | "Defense" | "Resources" | "Recovery" | "Speed" | "Sustain" | "Mitigation" | "Utility";
|
|
90
|
+
tab: "basic" | "advanced";
|
|
91
|
+
base: number;
|
|
92
|
+
gear: number;
|
|
93
|
+
value: number;
|
|
94
|
+
/** Server-actual value captured from the wire, when the protocol surfaces one. */
|
|
95
|
+
record?: number;
|
|
96
|
+
unit?: "%";
|
|
97
|
+
formula: string;
|
|
98
|
+
inputs: Record<string, number>;
|
|
99
|
+
}
|
|
100
|
+
/** Server-actual values synced for the local player's unit components. */
|
|
101
|
+
export interface CharacterRecordValues {
|
|
102
|
+
currentHealth?: number;
|
|
103
|
+
/** Effective HP ceiling: authoritative `maxHealth` when present, otherwise a settled regen inference. */
|
|
104
|
+
normalizedMaxHp?: number;
|
|
105
|
+
maxHealth?: number;
|
|
106
|
+
currentMana?: number;
|
|
107
|
+
/** Effective MP ceiling: authoritative `maxMana` when present, otherwise a settled regen inference. */
|
|
108
|
+
normalizedMaxMp?: number;
|
|
109
|
+
maxMana?: number;
|
|
110
|
+
moveSpeed?: number;
|
|
111
|
+
updatedAt?: string;
|
|
112
|
+
}
|
|
113
|
+
/** Live inventory weight reconstructed from the same character payload used by the game UI. */
|
|
114
|
+
export interface CharacterWeight {
|
|
115
|
+
current: number;
|
|
116
|
+
maximum: number;
|
|
117
|
+
}
|
|
118
|
+
export interface GearStatTotal {
|
|
119
|
+
type: number;
|
|
120
|
+
name: string;
|
|
121
|
+
total: number;
|
|
122
|
+
percent: boolean;
|
|
123
|
+
unresolvedRolls: number;
|
|
124
|
+
}
|
|
125
|
+
export interface CharacterIdentity {
|
|
126
|
+
name: string;
|
|
127
|
+
level?: number;
|
|
128
|
+
jobLevel?: number;
|
|
129
|
+
}
|
|
130
|
+
export interface CharacterViewState {
|
|
131
|
+
snapshot?: CharacterSnapshot;
|
|
132
|
+
identity?: CharacterIdentity;
|
|
133
|
+
stats: CharacterStatBreakdown[];
|
|
134
|
+
gearTotals: GearStatTotal[];
|
|
135
|
+
records?: CharacterRecordValues;
|
|
136
|
+
weight?: CharacterWeight;
|
|
137
|
+
status: "waiting" | "cached" | "live" | "unsupported";
|
|
138
|
+
statusDetail: string;
|
|
139
|
+
}
|
|
140
|
+
export interface CharacterHealingTraits {
|
|
141
|
+
hasSiphonHealth: boolean;
|
|
142
|
+
hasHealthLeech: boolean;
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,YAAI,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAU,CAAC;AACnF,MAAM,MAAM,sBAAsB,GAAG,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC;AAEpE,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,iBAAiB;IAChC,aAAa,EAAE,CAAC,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,mBAAmB,CAAC;IAChC,aAAa,EAAE,QAAQ,GAAG,WAAW,GAAG,OAAO,CAAC;IAChD,SAAS,EAAE,kBAAkB,EAAE,CAAC;IAChC,SAAS,EAAE,iBAAiB,EAAE,CAAC;IAC/B,2EAA2E;IAC3E,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AAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,+FAA+F;AAC/F,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,KAAK,EAAE,sBAAsB,EAAE,CAAC;IAChC,UAAU,EAAE,aAAa,EAAE,CAAC;IAC5B,OAAO,CAAC,EAAE,qBAAqB,CAAC;IAChC,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,MAAM,EAAE,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,aAAa,CAAC;IACtD,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,sBAAsB;IACrC,eAAe,EAAE,OAAO,CAAC;IACzB,cAAc,EAAE,OAAO,CAAC;CACzB"}
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@kar-mi/spirit-vale-tools-character",
|
|
3
|
+
"version": "0.5.0",
|
|
4
|
+
"description": "Spirit Vale character decoding and stat calculation utilities.",
|
|
5
|
+
"license": "AGPL-3.0-only",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/kar-mi/spirit-vale-tools.git",
|
|
9
|
+
"directory": "packages/character"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"README.md"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "bun build ./src/index.ts --outdir ./dist --target bun --format esm --external '@kar-mi/spirit-vale-tools-*' && bunx tsc --project ./tsconfig.build.json"
|
|
18
|
+
},
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"default": "./dist/index.js"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@kar-mi/spirit-vale-tools-capture": "^2.4.0",
|
|
27
|
+
"@kar-mi/spirit-vale-tools-items": "^0.1.8",
|
|
28
|
+
"@kar-mi/spirit-vale-tools-skills": "^0.2.1"
|
|
29
|
+
}
|
|
30
|
+
}
|