motely-wasm 18.1.1 → 18.2.1
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 +35 -29
- package/bin/dotnet.native.wasm +0 -0
- package/dist/dotnet/dotnet.native.js +1 -1
- package/dist/generated/imports.g.mjs +4 -2
- package/dist/generated/index.g.d.mts +7 -15
- package/dist/generated/index.g.mjs +6 -15
- package/dist/generated/instances.g.mjs +0 -5
- package/dist/generated/motely/analysis.g.d.mts +9 -8
- package/dist/generated/motely/enums.g.d.mts +448 -0
- package/dist/generated/motely/enums.g.mjs +18 -0
- package/dist/generated/motely/filters/jaml/converters.g.mjs +6 -0
- package/dist/generated/motely/filters/jaml.g.d.mts +10 -0
- package/dist/generated/motely/filters/jaml.g.mjs +1 -0
- package/dist/generated/motely/filters.g.d.mts +0 -9
- package/dist/generated/motely/filters.g.mjs +0 -1
- package/dist/generated/motely.g.d.mts +6 -457
- package/dist/generated/motely.g.mjs +3 -19
- package/dist/generated/serialization.g.mjs +31 -31
- package/jaml.schema.json +5843 -1219
- package/motely-item-formats.d.ts +535 -0
- package/motely-item-formats.mjs +525 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -211,48 +211,52 @@ console.log(search.isCompleted, search.totalSeedsSearched, search.matchingSeeds)
|
|
|
211
211
|
search.cancel(); // stop early
|
|
212
212
|
```
|
|
213
213
|
|
|
214
|
-
## Stream
|
|
214
|
+
## Stream cursor
|
|
215
215
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
216
|
+
`Motely.createStreamCursor(seed, deck, stake, ante, kind)` returns a stateful cursor over
|
|
217
|
+
one of Balatro's per-ante PRNG streams — one packed int per item, no JAML filter needed.
|
|
218
|
+
The `kind` argument selects which stream; one factory + one enum arg covers every stream
|
|
219
|
+
type:
|
|
219
220
|
|
|
220
221
|
```js
|
|
221
|
-
import { Motely
|
|
222
|
+
import { Motely } from "motely-wasm";
|
|
223
|
+
import { MotelyStreamKind } from "motely-wasm/motely";
|
|
224
|
+
import { MotelyDeck, MotelyStake } from "motely-wasm/motely/enums";
|
|
222
225
|
|
|
223
|
-
const
|
|
224
|
-
const items =
|
|
226
|
+
const cursor = Motely.createStreamCursor("AAAAAAAA", MotelyDeck.Red, MotelyStake.White, 1, MotelyStreamKind.Shop);
|
|
227
|
+
const items = cursor.getNextChunk(6); // 6 packed ints, one WASM crossing
|
|
225
228
|
```
|
|
226
229
|
|
|
227
|
-
|
|
228
|
-
|
|
230
|
+
**Always prefer `getNextChunk(n)` over repeated `getNext()` calls** — each call is a WASM
|
|
231
|
+
interop crossing, so batching is the right default.
|
|
229
232
|
|
|
230
|
-
|
|
|
231
|
-
|
|
232
|
-
| `
|
|
233
|
-
| `
|
|
234
|
-
| `
|
|
235
|
-
| `
|
|
236
|
-
| `
|
|
237
|
-
| `
|
|
238
|
-
| `
|
|
239
|
-
| `
|
|
240
|
-
| `
|
|
233
|
+
| `MotelyStreamKind` value | Stream | Returned int |
|
|
234
|
+
|---|---|---|
|
|
235
|
+
| `Shop` | Mixed shop (jokers, tarots, planets, spectrals on Ghost, standard cards with MagicTrick) | Packed item (`decodeItemType`, `decodeItemCategory`, …) |
|
|
236
|
+
| `Joker` | Shop jokers — includes edition + sticker bits | Packed item |
|
|
237
|
+
| `Tarot` | Shop tarots | Packed item |
|
|
238
|
+
| `Planet` | Shop planets | Packed item |
|
|
239
|
+
| `Spectral` | Shop spectrals (non-Ghost returns `SpectralExcludedByStream`) | Packed item |
|
|
240
|
+
| `LegendaryJoker` | Legendary fixed-rarity joker stream | Packed item |
|
|
241
|
+
| `RareTagJoker` | Rare Tag hand-out joker stream | Packed item |
|
|
242
|
+
| `Tag` | Tags — raw `MotelyTag` enum cast to int. Decoders do not apply; use `MotelyTag[value]`. | `(int)MotelyTag` |
|
|
243
|
+
| `Voucher` | Vouchers — raw `MotelyVoucher` enum cast to int. Uses an empty run state, so odd-indexed (prerequisite-required) vouchers are skipped by the engine. Use `MotelyVoucher[value]`. | `(int)MotelyVoucher` |
|
|
241
244
|
|
|
242
245
|
## Packed-int decoders
|
|
243
246
|
|
|
244
|
-
|
|
245
|
-
|
|
247
|
+
Stream cursors return packed integers. Bit fields are extracted with the decode helpers
|
|
248
|
+
on `Motely`:
|
|
246
249
|
|
|
247
250
|
```js
|
|
251
|
+
import { Motely } from "motely-wasm";
|
|
252
|
+
import { MotelyStreamKind } from "motely-wasm/motely";
|
|
248
253
|
import {
|
|
249
|
-
Motely,
|
|
250
254
|
MotelyItemType, MotelyItemTypeCategory, MotelyJokerRarity,
|
|
251
255
|
MotelyItemEdition, MotelyItemSeal, MotelyItemEnhancement,
|
|
252
|
-
} from "motely-wasm";
|
|
256
|
+
} from "motely-wasm/motely/enums";
|
|
253
257
|
|
|
254
|
-
const
|
|
255
|
-
const v =
|
|
258
|
+
const cursor = Motely.createStreamCursor("AAAAAAAA", 0, 0, 1, MotelyStreamKind.Joker);
|
|
259
|
+
const v = cursor.getNext();
|
|
256
260
|
|
|
257
261
|
const type = Motely.decodeItemType(v); // → MotelyItemType value
|
|
258
262
|
const category = Motely.decodeItemCategory(v); // → MotelyItemTypeCategory value
|
|
@@ -271,8 +275,9 @@ console.log(MotelyJokerRarity[rarity]); // e.g. "Common"
|
|
|
271
275
|
|
|
272
276
|
All enum tables (`MotelyItemType`, `MotelyItemTypeCategory`, `MotelyJokerRarity`,
|
|
273
277
|
`MotelyItemEdition`, `MotelyItemSeal`, `MotelyItemEnhancement`, `MotelyTag`,
|
|
274
|
-
`MotelyVoucher`, `MotelyBoosterPack`, `MotelyDeck`, `MotelyStake`)
|
|
275
|
-
`motely-wasm` and can be used for reverse-lookup by numeric value or
|
|
278
|
+
`MotelyVoucher`, `MotelyBoosterPack`, `MotelyDeck`, `MotelyStake`) live at
|
|
279
|
+
`motely-wasm/motely/enums` and can be used for reverse-lookup by numeric value or
|
|
280
|
+
forward-lookup by name. `MotelyStreamKind` lives at `motely-wasm/motely`.
|
|
276
281
|
|
|
277
282
|
## Events
|
|
278
283
|
|
|
@@ -296,7 +301,8 @@ Motely.onScoredResult.unsubscribe(handler);
|
|
|
296
301
|
| Import path | Contents |
|
|
297
302
|
|---|---|
|
|
298
303
|
| `motely-wasm` | Default export: `boot`, `getStatus`, `BootStatus`. Named export: `Motely` (main API) |
|
|
299
|
-
| `motely-wasm/motely` |
|
|
304
|
+
| `motely-wasm/motely` | `IMotelySearch`, `IMotelySearchSettingsInterop`, `IMotelyStreamCursor`, `MotelyProgress`, `MotelyScoredSeedResult`, `MotelyStreamKind` |
|
|
305
|
+
| `motely-wasm/motely/enums` | All Balatro enums — `MotelyItemType`, `MotelyItemTypeCategory`, `MotelyJokerRarity`, `MotelyItemEdition`, `MotelyItemSeal`, `MotelyItemEnhancement`, `MotelyTag`, `MotelyVoucher`, `MotelyBoosterPack`, `MotelyDeck`, `MotelyStake`, `MotelyBossBlind`, etc. |
|
|
300
306
|
| `motely-wasm/motely/filters` | `JamlAesthetic`, `JamlSearchPlan` |
|
|
301
307
|
| `motely-wasm/motely/analysis` | `MotelyJamlyzerResult`, `MotelySeedAnalysis` |
|
|
302
308
|
| `motely-wasm/bootsharp/file-system` | File-system interop (browser OPFS) — `PermissionMode`, `IFileMounter` |
|
package/bin/dotnet.native.wasm
CHANGED
|
Binary file
|