dredless 1.2.1 → 1.3.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.
@@ -123,7 +123,13 @@ export const MODEL_TABLE_SPECS = new Map([
123
123
  [2, {name: "numeric_pair", ...TWO_FIELD_SPEC}],
124
124
  [3, {name: "gate_width", fields: numericFields({1: 20, 2: 24, 4: 28, 8: 32, 16: 36, 32: 40})}],
125
125
  [4, {name: "motion_aux", packedBits: [{bit: 8, offset: 33}], fields: numericFields({1: 20, 2: 24, 4: 28})}],
126
- [5, {name: "entity_health", fields: numericFields({1: 20, 2: 24, 4: 28, 8: 32})}],
126
+ [5, {
127
+ name: "entity_health",
128
+ // The official table starts both bar dimensions at 10 (one world unit).
129
+ // Field values on the wire are deltas relative to these defaults.
130
+ defaults: {q28: 10, q32: 10},
131
+ fields: numericFields({1: 20, 2: 24, 4: 28, 8: 32})
132
+ }],
127
133
  [6, {name: "item_holder", ...TWO_FIELD_SPEC}],
128
134
  [7, {
129
135
  name: "entity_type",
@@ -228,6 +234,25 @@ export const MODEL_TABLE_SPECS = new Map([
228
234
  }],
229
235
  [26, {name: "numeric_single", fields: numericFields({1: 20})}],
230
236
  [31, {name: "numeric_single", fields: numericFields({1: 20})}],
237
+ [32, {
238
+ // Wire 95 has values; treating it as a marker swallows following removals.
239
+ name: "numeric_triplet",
240
+ defaults: {q28: 10},
241
+ fields: numericFields({1: 20, 2: 24, 4: 28})
242
+ }],
243
+ [33, {
244
+ name: "pvp_event",
245
+ fields: numericFields({2: 20, 4: 24, 8: 28, 16: 32, 32: 36, 64: 40, 128: 44, 256: 48, 512: 52})
246
+ }],
247
+ [34, {name: "pvp_party_config", fields: numericFields({2: 20})}],
248
+ [35, {
249
+ name: "pvp_party_entry",
250
+ packedBeforeValues: true,
251
+ orderedValues: true,
252
+ packedBits: [{bit: 4, offset: 37}],
253
+ blobs: [{bit: 1, offset: 24}],
254
+ fields: numericFields({2: 20})
255
+ }],
231
256
  [37, {name: "loose_item_marker", packedBits: [{bit: 2, offset: 29}], fields: numericFields({1: 20, 4: 24})}],
232
257
  [38, {name: "flag_state", packedBits: [{bit: 1, offset: 21}], fields: []}],
233
258
  [39, {name: "comms_transmit", ...TWO_FIELD_SPEC}],
@@ -254,6 +279,8 @@ export const MODEL_TABLE_SPECS = new Map([
254
279
  }],
255
280
  [54, {
256
281
  name: "starter_cannon",
282
+ // Wire deltas start with both barrels fully extended and capacity 16.
283
+ defaults: {q36: 50, q44: 16, q48: 50},
257
284
  fields: numericFields({1: 20, 2: 32, 4: 24, 8: 28, 16: 44, 32: 36, 64: 48, 128: 52, 256: 40, 512: 56, 1024: 60})
258
285
  }],
259
286
  [55, {
@@ -381,6 +408,9 @@ export const WIRE_TAG_TABLES = new Map([
381
408
  [93, 30],
382
409
  [94, 31],
383
410
  [95, 32],
411
+ [96, 33],
412
+ [97, 34],
413
+ [98, 35],
384
414
  [99, 36],
385
415
  [120, 37],
386
416
  [121, 38],
@@ -428,7 +458,7 @@ export const WIRE_TAG_TABLES = new Map([
428
458
  [169, 77]
429
459
  ]);
430
460
 
431
- export const MASK_ONLY_TABLES = new Set([13, 22, 23, 27, 28, 30, 32, 36, 40, 46, 48, 52, 58, 64, 65, 66, 68, 73, 74]);
461
+ export const MASK_ONLY_TABLES = new Set([13, 22, 23, 27, 28, 30, 36, 40, 46, 48, 52, 58, 64, 65, 66, 68, 73, 74]);
432
462
 
433
463
  export const ENTITY_FOOTPRINTS = new Map([
434
464
  [240, {width: 2, height: 2}],
@@ -936,7 +966,7 @@ export function botClassFromState({health, table2Record, smallRecord, combatReco
936
966
  }
937
967
 
938
968
  export function isCowardBossState({health}) {
939
- return health?.state?.q28 === 70 && health?.state?.q32 === 78;
969
+ return health?.state?.q28 === 80 && health?.state?.q32 === 88;
940
970
  }
941
971
 
942
972
  export function isOrangeFoolBotState({combatRecord}) {
@@ -946,8 +976,8 @@ export function isOrangeFoolBotState({combatRecord}) {
946
976
  export function isZombieBossBotState({health, table2Record, combatRecord}) {
947
977
  return (
948
978
  combatRecord?.q20 === -430233088 &&
949
- health?.state?.q28 === 30 &&
950
- health?.state?.q32 === 166 &&
979
+ health?.state?.q28 === 40 &&
980
+ health?.state?.q32 === 176 &&
951
981
  table2Record?.q20 === 320 &&
952
982
  table2Record?.q24 === -900
953
983
  );
@@ -956,39 +986,39 @@ export function isZombieBossBotState({health, table2Record, combatRecord}) {
956
986
  export function isRedSentryBotState({health, table2Record, combatRecord}) {
957
987
  return (
958
988
  combatRecord?.q20 === 508251904 && combatRecord?.q72 === 2 ||
959
- health?.state?.q28 === 70 && health?.state?.q32 === 166 && table2Record?.q20 === 320 && table2Record?.q24 === -900
989
+ health?.state?.q28 === 80 && health?.state?.q32 === 176 && table2Record?.q20 === 320 && table2Record?.q24 === -900
960
990
  );
961
991
  }
962
992
 
963
993
  export function isBlueRusherBotState({health, table2Record, combatRecord}) {
964
994
  return (
965
995
  combatRecord?.q20 === 1113052928 && combatRecord?.q72 === 2 ||
966
- health?.state?.q28 === 30 && health?.state?.q32 === 34 && table2Record?.q20 === 80 && table2Record?.q24 === -900
996
+ health?.state?.q28 === 40 && health?.state?.q32 === 44 && table2Record?.q20 === 80 && table2Record?.q24 === -900
967
997
  );
968
998
  }
969
999
 
970
1000
  export function isRedSniperBotState({health, table2Record}) {
971
- return health?.state?.q28 === 35 && health?.state?.q32 === 89 && table2Record?.q20 === 180 && table2Record?.q24 === -900;
1001
+ return health?.state?.q28 === 45 && health?.state?.q32 === 99 && table2Record?.q20 === 180 && table2Record?.q24 === -900;
972
1002
  }
973
1003
 
974
1004
  export function isYellowHunterBotState({health, table2Record, combatRecord}) {
975
1005
  return (
976
1006
  combatRecord?.q20 === -775665152 && combatRecord?.q72 === 4 && combatRecord?.q44 === -944515328 ||
977
- health?.state?.q28 === 30 && health?.state?.q32 === 56 && table2Record?.q20 === 120 && table2Record?.q24 === -900
1007
+ health?.state?.q28 === 40 && health?.state?.q32 === 66 && table2Record?.q20 === 120 && table2Record?.q24 === -900
978
1008
  );
979
1009
  }
980
1010
 
981
1011
  export function isAquaShielderBotState({health, table2Record, combatRecord}) {
982
1012
  return (
983
1013
  combatRecord?.q20 === 13697024 && combatRecord?.q24 === 1 ||
984
- health?.state?.q28 === 50 && health?.state?.q32 === 122 && table2Record?.q20 === 240 && table2Record?.q24 === -900
1014
+ health?.state?.q28 === 60 && health?.state?.q32 === 132 && table2Record?.q20 === 240 && table2Record?.q24 === -900
985
1015
  );
986
1016
  }
987
1017
 
988
1018
  export function isLazerEnthusiastBotState({health, table2Record, table10Record, beamRecord}) {
989
1019
  return (
990
- health?.state?.q28 === 140 &&
991
- health?.state?.q32 === 155 &&
1020
+ health?.state?.q28 === 150 &&
1021
+ health?.state?.q32 === 165 &&
992
1022
  table2Record?.q20 === 300 &&
993
1023
  table2Record?.q24 === -900 &&
994
1024
  Boolean(table10Record) &&
@@ -998,8 +1028,8 @@ export function isLazerEnthusiastBotState({health, table2Record, table10Record,
998
1028
 
999
1029
  export function isYellowMineGuardBotState({health, smallRecord, combatRecord, table2Record}) {
1000
1030
  return (
1001
- health?.state?.q28 === 30 &&
1002
- health?.state?.q32 === 33 &&
1031
+ health?.state?.q28 === 40 &&
1032
+ health?.state?.q32 === 43 &&
1003
1033
  smallRecord?.q20 === 78 &&
1004
1034
  smallRecord?.q24 === 78 &&
1005
1035
  combatRecord?.q24 === -995542016 &&
@@ -1008,11 +1038,11 @@ export function isYellowMineGuardBotState({health, smallRecord, combatRecord, ta
1008
1038
  }
1009
1039
 
1010
1040
  export function isShieldHelperBotState({health, table2Record}) {
1011
- return health?.state?.q28 === 30 && health?.state?.q32 === 33 && health?.maxHp === 1000 && !table2Record;
1041
+ return health?.state?.q28 === 40 && health?.state?.q32 === 43 && health?.maxHp === 1000 && !table2Record;
1012
1042
  }
1013
1043
 
1014
1044
  export function isShieldMasterBotState({health, table2Record}) {
1015
- return health?.state?.q28 === 190 && health?.state?.q32 === 210 && health?.maxHp === 15000 && Boolean(table2Record);
1045
+ return health?.state?.q28 === 200 && health?.state?.q32 === 220 && health?.maxHp === 15000 && Boolean(table2Record);
1016
1046
  }
1017
1047
 
1018
1048
  export function botIdentifierFromState({combatRecord, motionRecord, smallRecord}) {
@@ -1104,6 +1134,38 @@ export function summarizeShipControl(entity, record) {
1104
1134
  };
1105
1135
  }
1106
1136
 
1137
+ export function summarizePvpEvent(entity, record, shipsLeft) {
1138
+ if (!record) return null;
1139
+ const damageBonusPercent = record.q52 ?? 0;
1140
+ return {
1141
+ entity,
1142
+ active: (record.q44 ?? 0) >= 0,
1143
+ bounds: {
1144
+ minX: (record.q20 ?? 0) / 10,
1145
+ minY: (record.q24 ?? 0) / 10,
1146
+ maxX: (record.q28 ?? 0) / 10,
1147
+ maxY: (record.q32 ?? 0) / 10
1148
+ },
1149
+ worldBounds: {minX: 0, minY: 0, maxX: record.q36 ?? 0, maxY: record.q40 ?? 0},
1150
+ timeSeconds: record.q44 ?? 0,
1151
+ damageBonusPercent,
1152
+ damagePercent: damageBonusPercent + 100,
1153
+ damageMultiplier: (damageBonusPercent + 100) / 100,
1154
+ shipsLeft,
1155
+ state: cloneRecord(record)
1156
+ };
1157
+ }
1158
+
1159
+ export function summarizePvpPartyEntry(entity, record) {
1160
+ return {
1161
+ entity,
1162
+ partyId: record.q20 ?? 0,
1163
+ hexCode: decodeText(record.blob24),
1164
+ kind: record.q37 ? "join-request" : "invitation",
1165
+ state: cloneRecord(record)
1166
+ };
1167
+ }
1168
+
1107
1169
  export function summarizeShipSize(entity, record) {
1108
1170
  if (!record) return null;
1109
1171
  return {
@@ -9,6 +9,10 @@ export {
9
9
  type RcdSummary,
10
10
  type BallSummary,
11
11
  type RecyclerSummary,
12
+ type PvpEventSummary,
13
+ type PvpEventBounds,
14
+ type PvpPartiesSummary,
15
+ type PvpPartyEntrySummary,
12
16
  type ModelRecord,
13
17
  type ModelSnapshot,
14
18
  type EntitySummary,
@@ -83,6 +83,8 @@ const {
83
83
  botIdentifierFromState,
84
84
  summarizeShieldGenerator,
85
85
  summarizeShipControl,
86
+ summarizePvpEvent,
87
+ summarizePvpPartyEntry,
86
88
  summarizeShipSize,
87
89
  summarizeShipWorldMetadata,
88
90
  summarizeItemCrate,
@@ -278,6 +280,8 @@ export class ModelState {
278
280
  balls: derived.specialEntities.balls.slice(),
279
281
  recyclers: derived.specialEntities.recyclers.slice(),
280
282
  shipControls: derived.shipControls.slice(),
283
+ pvpEvent: this.pvpEvent(),
284
+ pvpParties: this.pvpParties(),
281
285
  machines: this.#machinesSnapshot(derived.machines),
282
286
  tables: includeTables ? this.tablesSnapshot() : derived.tableSummaries.slice()
283
287
  };
@@ -331,6 +335,29 @@ export class ModelState {
331
335
  return this.#derivedState().shipControls.slice();
332
336
  }
333
337
 
338
+ pvpEvent() {
339
+ const entry = this.table(33).entries().next().value;
340
+ if (!entry) return null;
341
+ let shipsLeft = 0;
342
+ // The HUD excludes ships whose replicated exclusion flag is set.
343
+ for (const ship of this.table(20).values()) {
344
+ if (!ship.q153) shipsLeft += 1;
345
+ }
346
+ return summarizePvpEvent(entry[0], entry[1], shipsLeft);
347
+ }
348
+
349
+ pvpParties() {
350
+ const config = this.table(34).entries().next().value;
351
+ const entries = this.table(35);
352
+ if (!config && entries.size === 0) return null;
353
+ return {
354
+ configEntity: config?.[0] ?? null,
355
+ maxShips: config ? config[1].q20 ?? 0 : 35,
356
+ entries: [...entries].map(([entity, record]) => summarizePvpPartyEntry(entity, record)),
357
+ configState: config ? cloneRecord(config[1]) : null
358
+ };
359
+ }
360
+
334
361
  shipMetadata() {
335
362
  if (this.isOverworld) return null;
336
363
  const lockdownRecord = firstRecord(this.table(11));
@@ -16,6 +16,10 @@ export {
16
16
  type RcdSummary,
17
17
  type BallSummary,
18
18
  type RecyclerSummary,
19
+ type PvpEventSummary,
20
+ type PvpEventBounds,
21
+ type PvpPartiesSummary,
22
+ type PvpPartyEntrySummary,
19
23
  type ModelRecord,
20
24
  type ModelSnapshot,
21
25
  type TransformSummary,
@@ -266,6 +266,8 @@ export class WorldState {
266
266
  balls: model.balls,
267
267
  recyclers: model.recyclers,
268
268
  shipControls: model.shipControls,
269
+ pvpEvent: model.pvpEvent,
270
+ pvpParties: model.pvpParties,
269
271
  commsBubbles: this.commsBubbles.slice(),
270
272
  tiles: includeTiles ? [...this.tiles.values()] : undefined
271
273
  };