From df54f98920f8d3f426cf5b2cedb8e7ba3f32b4b7 Mon Sep 17 00:00:00 2001 From: Nick Condron Date: Thu, 16 Mar 2023 22:29:15 -0400 Subject: [PATCH] Parse instance id info --- src/types.ts | 3 +++ src/utils/slpReader.ts | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/types.ts b/src/types.ts index 1808394a..486ca488 100644 --- a/src/types.ts +++ b/src/types.ts @@ -206,6 +206,8 @@ export type PostFrameUpdateType = { selfInducedSpeeds: SelfInducedSpeedsType | null; hitlagRemaining: number | null; animationIndex: number | null; + instanceHitBy: number | null; + instanceId: number | null; }; export type SelfInducedSpeedsType = { @@ -233,6 +235,7 @@ export type ItemUpdateType = { chargeShotLaunched: number | null; chargePower: number | null; owner: number | null; + instanceId: number | null; }; export type FrameBookendType = { diff --git a/src/utils/slpReader.ts b/src/utils/slpReader.ts index 00e61221..2db26dc5 100644 --- a/src/utils/slpReader.ts +++ b/src/utils/slpReader.ts @@ -512,6 +512,8 @@ export function parseMessage(command: Command, payload: Uint8Array): EventPayloa selfInducedSpeeds: selfInducedSpeeds, hitlagRemaining: readFloat(view, 0x49), animationIndex: readUint32(view, 0x4d), + instanceHitBy: readUint16(view, 0x51), + instanceId: readUint16(view, 0x53), }; case Command.ITEM_UPDATE: return { @@ -531,6 +533,7 @@ export function parseMessage(command: Command, payload: Uint8Array): EventPayloa chargeShotLaunched: readUint8(view, 0x28), chargePower: readUint8(view, 0x29), owner: readInt8(view, 0x2a), + instanceId: readUint16(view, 0x2b), }; case Command.FRAME_BOOKEND: return {