@shipload/sdk 1.0.0-next.2 → 1.0.0-next.21
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/lib/shipload.d.ts +1731 -1044
- package/lib/shipload.js +6758 -4523
- package/lib/shipload.js.map +1 -1
- package/lib/shipload.m.js +6649 -4479
- package/lib/shipload.m.js.map +1 -1
- package/lib/testing.d.ts +833 -0
- package/lib/testing.js +3647 -0
- package/lib/testing.js.map +1 -0
- package/lib/testing.m.js +3641 -0
- package/lib/testing.m.js.map +1 -0
- package/package.json +15 -2
- package/src/capabilities/gathering.ts +17 -7
- package/src/capabilities/modules.ts +9 -0
- package/src/capabilities/storage.ts +1 -1
- package/src/contracts/platform.ts +211 -3
- package/src/contracts/server.ts +723 -438
- package/src/data/capabilities.ts +9 -329
- package/src/data/capability-formulas.ts +76 -0
- package/src/data/catalog.ts +0 -5
- package/src/data/colors.ts +14 -28
- package/src/data/entities.json +46 -10
- package/src/data/item-ids.ts +17 -13
- package/src/data/items.json +308 -37
- package/src/data/kind-registry.json +85 -0
- package/src/data/kind-registry.ts +150 -0
- package/src/data/metadata.ts +99 -24
- package/src/data/recipes-runtime.ts +3 -23
- package/src/data/recipes.json +265 -96
- package/src/derivation/build-methods.ts +45 -0
- package/src/derivation/capabilities.ts +414 -0
- package/src/derivation/capability-mappings.ts +117 -0
- package/src/derivation/crafting.ts +23 -24
- package/src/derivation/index.ts +8 -2
- package/src/derivation/reserve-regen.ts +34 -0
- package/src/derivation/resources.ts +125 -38
- package/src/derivation/stats.ts +1 -2
- package/src/derivation/stratum.ts +15 -19
- package/src/derivation/tiers.ts +28 -7
- package/src/entities/entity.ts +98 -0
- package/src/entities/gamestate.ts +3 -28
- package/src/entities/makers.ts +75 -129
- package/src/entities/slot-multiplier.ts +37 -0
- package/src/errors.ts +10 -15
- package/src/format.ts +26 -4
- package/src/index-module.ts +151 -40
- package/src/managers/actions.ts +184 -82
- package/src/managers/base.ts +2 -2
- package/src/managers/construction-types.ts +68 -0
- package/src/managers/construction.ts +292 -0
- package/src/managers/context.ts +9 -0
- package/src/managers/entities.ts +18 -66
- package/src/managers/epochs.ts +40 -0
- package/src/managers/index.ts +16 -1
- package/src/managers/locations.ts +2 -20
- package/src/managers/nft.ts +28 -0
- package/src/managers/plot.ts +123 -0
- package/src/nft/atomicassets.ts +231 -0
- package/src/nft/atomicdata.ts +130 -0
- package/src/nft/buildImmutableData.ts +319 -0
- package/src/nft/description.ts +45 -13
- package/src/nft/index.ts +3 -0
- package/src/resolution/describe-module.ts +5 -8
- package/src/resolution/display-name.ts +38 -10
- package/src/resolution/resolve-item.ts +20 -12
- package/src/scheduling/accessor.ts +4 -0
- package/src/scheduling/projection.ts +79 -27
- package/src/scheduling/schedule.ts +15 -1
- package/src/scheduling/task-cargo.ts +46 -0
- package/src/shipload.ts +5 -0
- package/src/subscriptions/manager.ts +40 -6
- package/src/subscriptions/mappers.ts +3 -8
- package/src/subscriptions/types.ts +3 -2
- package/src/testing/catalog-hash.ts +19 -0
- package/src/testing/index.ts +2 -0
- package/src/testing/projection-parity.ts +143 -0
- package/src/travel/travel.ts +61 -2
- package/src/types/index.ts +0 -1
- package/src/types.ts +17 -12
- package/src/utils/cargo.ts +27 -0
- package/src/utils/system.ts +25 -24
- package/src/entities/container.ts +0 -108
- package/src/entities/ship-deploy.ts +0 -258
- package/src/entities/ship.ts +0 -204
- package/src/entities/warehouse.ts +0 -119
- package/src/types/entity-traits.ts +0 -69
package/src/data/recipes.json
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
3
|
"outputItemId": 10001,
|
|
4
|
-
"outputMass":
|
|
4
|
+
"outputMass": 4000,
|
|
5
5
|
"inputs": [
|
|
6
6
|
{
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"quantity": 15
|
|
7
|
+
"itemId": 101,
|
|
8
|
+
"quantity": 10
|
|
10
9
|
}
|
|
11
10
|
],
|
|
12
11
|
"statSlots": [
|
|
@@ -31,17 +30,15 @@
|
|
|
31
30
|
},
|
|
32
31
|
{
|
|
33
32
|
"outputItemId": 10002,
|
|
34
|
-
"outputMass":
|
|
33
|
+
"outputMass": 6000,
|
|
35
34
|
"inputs": [
|
|
36
35
|
{
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"quantity": 10
|
|
36
|
+
"itemId": 401,
|
|
37
|
+
"quantity": 6
|
|
40
38
|
},
|
|
41
39
|
{
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"quantity": 20
|
|
40
|
+
"itemId": 501,
|
|
41
|
+
"quantity": 9
|
|
45
42
|
}
|
|
46
43
|
],
|
|
47
44
|
"statSlots": [
|
|
@@ -66,12 +63,11 @@
|
|
|
66
63
|
},
|
|
67
64
|
{
|
|
68
65
|
"outputItemId": 10003,
|
|
69
|
-
"outputMass":
|
|
66
|
+
"outputMass": 4000,
|
|
70
67
|
"inputs": [
|
|
71
68
|
{
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"quantity": 32
|
|
69
|
+
"itemId": 301,
|
|
70
|
+
"quantity": 10
|
|
75
71
|
}
|
|
76
72
|
],
|
|
77
73
|
"statSlots": [
|
|
@@ -96,12 +92,15 @@
|
|
|
96
92
|
},
|
|
97
93
|
{
|
|
98
94
|
"outputItemId": 10004,
|
|
99
|
-
"outputMass":
|
|
95
|
+
"outputMass": 6000,
|
|
100
96
|
"inputs": [
|
|
101
97
|
{
|
|
102
|
-
"
|
|
103
|
-
"
|
|
104
|
-
|
|
98
|
+
"itemId": 201,
|
|
99
|
+
"quantity": 6
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"itemId": 501,
|
|
103
|
+
"quantity": 9
|
|
105
104
|
}
|
|
106
105
|
],
|
|
107
106
|
"statSlots": [
|
|
@@ -109,7 +108,7 @@
|
|
|
109
108
|
"sources": [
|
|
110
109
|
{
|
|
111
110
|
"inputIndex": 0,
|
|
112
|
-
"statIndex":
|
|
111
|
+
"statIndex": 1
|
|
113
112
|
}
|
|
114
113
|
]
|
|
115
114
|
},
|
|
@@ -126,12 +125,15 @@
|
|
|
126
125
|
},
|
|
127
126
|
{
|
|
128
127
|
"outputItemId": 10005,
|
|
129
|
-
"outputMass":
|
|
128
|
+
"outputMass": 6000,
|
|
130
129
|
"inputs": [
|
|
131
130
|
{
|
|
132
|
-
"
|
|
133
|
-
"
|
|
134
|
-
|
|
131
|
+
"itemId": 101,
|
|
132
|
+
"quantity": 6
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"itemId": 301,
|
|
136
|
+
"quantity": 9
|
|
135
137
|
}
|
|
136
138
|
],
|
|
137
139
|
"statSlots": [
|
|
@@ -156,11 +158,10 @@
|
|
|
156
158
|
},
|
|
157
159
|
{
|
|
158
160
|
"outputItemId": 10006,
|
|
159
|
-
"outputMass":
|
|
161
|
+
"outputMass": 4000,
|
|
160
162
|
"inputs": [
|
|
161
163
|
{
|
|
162
|
-
"
|
|
163
|
-
"tier": 1,
|
|
164
|
+
"itemId": 201,
|
|
164
165
|
"quantity": 10
|
|
165
166
|
}
|
|
166
167
|
],
|
|
@@ -186,12 +187,11 @@
|
|
|
186
187
|
},
|
|
187
188
|
{
|
|
188
189
|
"outputItemId": 10007,
|
|
189
|
-
"outputMass":
|
|
190
|
+
"outputMass": 4000,
|
|
190
191
|
"inputs": [
|
|
191
192
|
{
|
|
192
|
-
"
|
|
193
|
-
"
|
|
194
|
-
"quantity": 32
|
|
193
|
+
"itemId": 501,
|
|
194
|
+
"quantity": 10
|
|
195
195
|
}
|
|
196
196
|
],
|
|
197
197
|
"statSlots": [
|
|
@@ -216,12 +216,11 @@
|
|
|
216
216
|
},
|
|
217
217
|
{
|
|
218
218
|
"outputItemId": 10008,
|
|
219
|
-
"outputMass":
|
|
219
|
+
"outputMass": 4000,
|
|
220
220
|
"inputs": [
|
|
221
221
|
{
|
|
222
|
-
"
|
|
223
|
-
"
|
|
224
|
-
"quantity": 20
|
|
222
|
+
"itemId": 401,
|
|
223
|
+
"quantity": 10
|
|
225
224
|
}
|
|
226
225
|
],
|
|
227
226
|
"statSlots": [
|
|
@@ -246,12 +245,15 @@
|
|
|
246
245
|
},
|
|
247
246
|
{
|
|
248
247
|
"outputItemId": 10009,
|
|
249
|
-
"outputMass":
|
|
248
|
+
"outputMass": 6000,
|
|
250
249
|
"inputs": [
|
|
251
250
|
{
|
|
252
|
-
"
|
|
253
|
-
"
|
|
254
|
-
|
|
251
|
+
"itemId": 301,
|
|
252
|
+
"quantity": 6
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
"itemId": 401,
|
|
256
|
+
"quantity": 9
|
|
255
257
|
}
|
|
256
258
|
],
|
|
257
259
|
"statSlots": [
|
|
@@ -276,12 +278,15 @@
|
|
|
276
278
|
},
|
|
277
279
|
{
|
|
278
280
|
"outputItemId": 10010,
|
|
279
|
-
"outputMass":
|
|
281
|
+
"outputMass": 6000,
|
|
280
282
|
"inputs": [
|
|
281
283
|
{
|
|
282
|
-
"
|
|
283
|
-
"
|
|
284
|
-
|
|
284
|
+
"itemId": 201,
|
|
285
|
+
"quantity": 6
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"itemId": 101,
|
|
289
|
+
"quantity": 9
|
|
285
290
|
}
|
|
286
291
|
],
|
|
287
292
|
"statSlots": [
|
|
@@ -306,11 +311,11 @@
|
|
|
306
311
|
},
|
|
307
312
|
{
|
|
308
313
|
"outputItemId": 10100,
|
|
309
|
-
"outputMass":
|
|
314
|
+
"outputMass": 900000,
|
|
310
315
|
"inputs": [
|
|
311
316
|
{
|
|
312
317
|
"itemId": 10003,
|
|
313
|
-
"quantity":
|
|
318
|
+
"quantity": 600
|
|
314
319
|
}
|
|
315
320
|
],
|
|
316
321
|
"statSlots": [
|
|
@@ -335,11 +340,11 @@
|
|
|
335
340
|
},
|
|
336
341
|
{
|
|
337
342
|
"outputItemId": 10101,
|
|
338
|
-
"outputMass":
|
|
343
|
+
"outputMass": 1400000,
|
|
339
344
|
"inputs": [
|
|
340
345
|
{
|
|
341
346
|
"itemId": 10004,
|
|
342
|
-
"quantity":
|
|
347
|
+
"quantity": 600
|
|
343
348
|
}
|
|
344
349
|
],
|
|
345
350
|
"statSlots": [
|
|
@@ -364,15 +369,15 @@
|
|
|
364
369
|
},
|
|
365
370
|
{
|
|
366
371
|
"outputItemId": 10102,
|
|
367
|
-
"outputMass":
|
|
372
|
+
"outputMass": 1200000,
|
|
368
373
|
"inputs": [
|
|
369
374
|
{
|
|
370
375
|
"itemId": 10005,
|
|
371
|
-
"quantity":
|
|
376
|
+
"quantity": 300
|
|
372
377
|
},
|
|
373
378
|
{
|
|
374
379
|
"itemId": 10006,
|
|
375
|
-
"quantity":
|
|
380
|
+
"quantity": 300
|
|
376
381
|
}
|
|
377
382
|
],
|
|
378
383
|
"statSlots": [
|
|
@@ -392,14 +397,6 @@
|
|
|
392
397
|
}
|
|
393
398
|
]
|
|
394
399
|
},
|
|
395
|
-
{
|
|
396
|
-
"sources": [
|
|
397
|
-
{
|
|
398
|
-
"inputIndex": 1,
|
|
399
|
-
"statIndex": 1
|
|
400
|
-
}
|
|
401
|
-
]
|
|
402
|
-
},
|
|
403
400
|
{
|
|
404
401
|
"sources": [
|
|
405
402
|
{
|
|
@@ -421,15 +418,11 @@
|
|
|
421
418
|
},
|
|
422
419
|
{
|
|
423
420
|
"outputItemId": 10103,
|
|
424
|
-
"outputMass":
|
|
421
|
+
"outputMass": 1000000,
|
|
425
422
|
"inputs": [
|
|
426
|
-
{
|
|
427
|
-
"itemId": 10002,
|
|
428
|
-
"quantity": 3
|
|
429
|
-
},
|
|
430
423
|
{
|
|
431
424
|
"itemId": 10007,
|
|
432
|
-
"quantity":
|
|
425
|
+
"quantity": 600
|
|
433
426
|
}
|
|
434
427
|
],
|
|
435
428
|
"statSlots": [
|
|
@@ -437,14 +430,14 @@
|
|
|
437
430
|
"sources": [
|
|
438
431
|
{
|
|
439
432
|
"inputIndex": 0,
|
|
440
|
-
"statIndex":
|
|
433
|
+
"statIndex": 1
|
|
441
434
|
}
|
|
442
435
|
]
|
|
443
436
|
},
|
|
444
437
|
{
|
|
445
438
|
"sources": [
|
|
446
439
|
{
|
|
447
|
-
"inputIndex":
|
|
440
|
+
"inputIndex": 0,
|
|
448
441
|
"statIndex": 0
|
|
449
442
|
}
|
|
450
443
|
]
|
|
@@ -454,15 +447,15 @@
|
|
|
454
447
|
},
|
|
455
448
|
{
|
|
456
449
|
"outputItemId": 10104,
|
|
457
|
-
"outputMass":
|
|
450
|
+
"outputMass": 1200000,
|
|
458
451
|
"inputs": [
|
|
459
452
|
{
|
|
460
453
|
"itemId": 10008,
|
|
461
|
-
"quantity":
|
|
454
|
+
"quantity": 300
|
|
462
455
|
},
|
|
463
456
|
{
|
|
464
457
|
"itemId": 10009,
|
|
465
|
-
"quantity":
|
|
458
|
+
"quantity": 300
|
|
466
459
|
}
|
|
467
460
|
],
|
|
468
461
|
"statSlots": [
|
|
@@ -487,15 +480,15 @@
|
|
|
487
480
|
},
|
|
488
481
|
{
|
|
489
482
|
"outputItemId": 10105,
|
|
490
|
-
"outputMass":
|
|
483
|
+
"outputMass": 1200000,
|
|
491
484
|
"inputs": [
|
|
492
485
|
{
|
|
493
486
|
"itemId": 10001,
|
|
494
|
-
"quantity":
|
|
487
|
+
"quantity": 300
|
|
495
488
|
},
|
|
496
489
|
{
|
|
497
490
|
"itemId": 10002,
|
|
498
|
-
"quantity":
|
|
491
|
+
"quantity": 300
|
|
499
492
|
}
|
|
500
493
|
],
|
|
501
494
|
"statSlots": [
|
|
@@ -536,15 +529,15 @@
|
|
|
536
529
|
},
|
|
537
530
|
{
|
|
538
531
|
"outputItemId": 10106,
|
|
539
|
-
"outputMass":
|
|
532
|
+
"outputMass": 1400000,
|
|
540
533
|
"inputs": [
|
|
541
534
|
{
|
|
542
535
|
"itemId": 10004,
|
|
543
|
-
"quantity":
|
|
536
|
+
"quantity": 300
|
|
544
537
|
},
|
|
545
538
|
{
|
|
546
539
|
"itemId": 10010,
|
|
547
|
-
"quantity":
|
|
540
|
+
"quantity": 300
|
|
548
541
|
}
|
|
549
542
|
],
|
|
550
543
|
"statSlots": [
|
|
@@ -571,6 +564,79 @@
|
|
|
571
564
|
"statIndex": 1
|
|
572
565
|
}
|
|
573
566
|
]
|
|
567
|
+
}
|
|
568
|
+
],
|
|
569
|
+
"blendWeights": []
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
"outputItemId": 10107,
|
|
573
|
+
"outputMass": 1400000,
|
|
574
|
+
"inputs": [
|
|
575
|
+
{
|
|
576
|
+
"itemId": 10010,
|
|
577
|
+
"quantity": 300
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
"itemId": 10009,
|
|
581
|
+
"quantity": 300
|
|
582
|
+
}
|
|
583
|
+
],
|
|
584
|
+
"statSlots": [
|
|
585
|
+
{
|
|
586
|
+
"sources": [
|
|
587
|
+
{
|
|
588
|
+
"inputIndex": 0,
|
|
589
|
+
"statIndex": 1
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
"inputIndex": 1,
|
|
593
|
+
"statIndex": 1
|
|
594
|
+
}
|
|
595
|
+
]
|
|
596
|
+
}
|
|
597
|
+
],
|
|
598
|
+
"blendWeights": [
|
|
599
|
+
1,
|
|
600
|
+
1
|
|
601
|
+
]
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
"outputItemId": 10108,
|
|
605
|
+
"outputMass": 1000000,
|
|
606
|
+
"inputs": [
|
|
607
|
+
{
|
|
608
|
+
"itemId": 10003,
|
|
609
|
+
"quantity": 300
|
|
610
|
+
},
|
|
611
|
+
{
|
|
612
|
+
"itemId": 10007,
|
|
613
|
+
"quantity": 300
|
|
614
|
+
}
|
|
615
|
+
],
|
|
616
|
+
"statSlots": [
|
|
617
|
+
{
|
|
618
|
+
"sources": [
|
|
619
|
+
{
|
|
620
|
+
"inputIndex": 0,
|
|
621
|
+
"statIndex": 0
|
|
622
|
+
}
|
|
623
|
+
]
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
"sources": [
|
|
627
|
+
{
|
|
628
|
+
"inputIndex": 0,
|
|
629
|
+
"statIndex": 1
|
|
630
|
+
}
|
|
631
|
+
]
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
"sources": [
|
|
635
|
+
{
|
|
636
|
+
"inputIndex": 1,
|
|
637
|
+
"statIndex": 0
|
|
638
|
+
}
|
|
639
|
+
]
|
|
574
640
|
},
|
|
575
641
|
{
|
|
576
642
|
"sources": [
|
|
@@ -585,15 +651,15 @@
|
|
|
585
651
|
},
|
|
586
652
|
{
|
|
587
653
|
"outputItemId": 10200,
|
|
588
|
-
"outputMass":
|
|
654
|
+
"outputMass": 1500000,
|
|
589
655
|
"inputs": [
|
|
590
656
|
{
|
|
591
657
|
"itemId": 10001,
|
|
592
|
-
"quantity":
|
|
658
|
+
"quantity": 600
|
|
593
659
|
},
|
|
594
660
|
{
|
|
595
661
|
"itemId": 10002,
|
|
596
|
-
"quantity":
|
|
662
|
+
"quantity": 200
|
|
597
663
|
}
|
|
598
664
|
],
|
|
599
665
|
"statSlots": [
|
|
@@ -634,15 +700,15 @@
|
|
|
634
700
|
},
|
|
635
701
|
{
|
|
636
702
|
"outputItemId": 10201,
|
|
637
|
-
"outputMass":
|
|
703
|
+
"outputMass": 2300000,
|
|
638
704
|
"inputs": [
|
|
639
705
|
{
|
|
640
706
|
"itemId": 10001,
|
|
641
|
-
"quantity":
|
|
707
|
+
"quantity": 800
|
|
642
708
|
},
|
|
643
709
|
{
|
|
644
710
|
"itemId": 10002,
|
|
645
|
-
"quantity":
|
|
711
|
+
"quantity": 400
|
|
646
712
|
}
|
|
647
713
|
],
|
|
648
714
|
"statSlots": [
|
|
@@ -683,15 +749,121 @@
|
|
|
683
749
|
},
|
|
684
750
|
{
|
|
685
751
|
"outputItemId": 10202,
|
|
686
|
-
"outputMass":
|
|
752
|
+
"outputMass": 5800000,
|
|
687
753
|
"inputs": [
|
|
688
754
|
{
|
|
689
755
|
"itemId": 10001,
|
|
690
|
-
"quantity":
|
|
756
|
+
"quantity": 2000
|
|
691
757
|
},
|
|
692
758
|
{
|
|
693
759
|
"itemId": 10002,
|
|
694
|
-
"quantity":
|
|
760
|
+
"quantity": 1000
|
|
761
|
+
}
|
|
762
|
+
],
|
|
763
|
+
"statSlots": [
|
|
764
|
+
{
|
|
765
|
+
"sources": [
|
|
766
|
+
{
|
|
767
|
+
"inputIndex": 0,
|
|
768
|
+
"statIndex": 0
|
|
769
|
+
}
|
|
770
|
+
]
|
|
771
|
+
},
|
|
772
|
+
{
|
|
773
|
+
"sources": [
|
|
774
|
+
{
|
|
775
|
+
"inputIndex": 0,
|
|
776
|
+
"statIndex": 1
|
|
777
|
+
}
|
|
778
|
+
]
|
|
779
|
+
},
|
|
780
|
+
{
|
|
781
|
+
"sources": [
|
|
782
|
+
{
|
|
783
|
+
"inputIndex": 1,
|
|
784
|
+
"statIndex": 0
|
|
785
|
+
}
|
|
786
|
+
]
|
|
787
|
+
},
|
|
788
|
+
{
|
|
789
|
+
"sources": [
|
|
790
|
+
{
|
|
791
|
+
"inputIndex": 1,
|
|
792
|
+
"statIndex": 1
|
|
793
|
+
}
|
|
794
|
+
]
|
|
795
|
+
}
|
|
796
|
+
],
|
|
797
|
+
"blendWeights": []
|
|
798
|
+
},
|
|
799
|
+
{
|
|
800
|
+
"outputItemId": 10203,
|
|
801
|
+
"outputMass": 4400000,
|
|
802
|
+
"inputs": [
|
|
803
|
+
{
|
|
804
|
+
"itemId": 10001,
|
|
805
|
+
"quantity": 1500
|
|
806
|
+
},
|
|
807
|
+
{
|
|
808
|
+
"itemId": 10002,
|
|
809
|
+
"quantity": 800
|
|
810
|
+
}
|
|
811
|
+
],
|
|
812
|
+
"statSlots": [
|
|
813
|
+
{
|
|
814
|
+
"sources": [
|
|
815
|
+
{
|
|
816
|
+
"inputIndex": 0,
|
|
817
|
+
"statIndex": 0
|
|
818
|
+
}
|
|
819
|
+
]
|
|
820
|
+
},
|
|
821
|
+
{
|
|
822
|
+
"sources": [
|
|
823
|
+
{
|
|
824
|
+
"inputIndex": 0,
|
|
825
|
+
"statIndex": 1
|
|
826
|
+
}
|
|
827
|
+
]
|
|
828
|
+
},
|
|
829
|
+
{
|
|
830
|
+
"sources": [
|
|
831
|
+
{
|
|
832
|
+
"inputIndex": 1,
|
|
833
|
+
"statIndex": 0
|
|
834
|
+
}
|
|
835
|
+
]
|
|
836
|
+
},
|
|
837
|
+
{
|
|
838
|
+
"sources": [
|
|
839
|
+
{
|
|
840
|
+
"inputIndex": 1,
|
|
841
|
+
"statIndex": 1
|
|
842
|
+
}
|
|
843
|
+
]
|
|
844
|
+
}
|
|
845
|
+
],
|
|
846
|
+
"blendWeights": []
|
|
847
|
+
},
|
|
848
|
+
{
|
|
849
|
+
"outputItemId": 10204,
|
|
850
|
+
"outputMass": 5500000,
|
|
851
|
+
"inputs": [
|
|
852
|
+
{
|
|
853
|
+
"itemId": 10001,
|
|
854
|
+
"quantity": 1500
|
|
855
|
+
},
|
|
856
|
+
{
|
|
857
|
+
"itemId": 10002,
|
|
858
|
+
"quantity": 600
|
|
859
|
+
},
|
|
860
|
+
{
|
|
861
|
+
"itemId": 10008,
|
|
862
|
+
"quantity": 400
|
|
863
|
+
},
|
|
864
|
+
{
|
|
865
|
+
"itemId": 10009,
|
|
866
|
+
"quantity": 400
|
|
695
867
|
}
|
|
696
868
|
],
|
|
697
869
|
"statSlots": [
|
|
@@ -732,15 +904,14 @@
|
|
|
732
904
|
},
|
|
733
905
|
{
|
|
734
906
|
"outputItemId": 20001,
|
|
735
|
-
"outputMass":
|
|
907
|
+
"outputMass": 500,
|
|
736
908
|
"inputs": [
|
|
737
909
|
{
|
|
738
910
|
"itemId": 10001,
|
|
739
|
-
"quantity":
|
|
911
|
+
"quantity": 200
|
|
740
912
|
},
|
|
741
913
|
{
|
|
742
|
-
"
|
|
743
|
-
"tier": 2,
|
|
914
|
+
"itemId": 102,
|
|
744
915
|
"quantity": 15
|
|
745
916
|
}
|
|
746
917
|
],
|
|
@@ -777,20 +948,18 @@
|
|
|
777
948
|
},
|
|
778
949
|
{
|
|
779
950
|
"outputItemId": 20002,
|
|
780
|
-
"outputMass":
|
|
951
|
+
"outputMass": 300,
|
|
781
952
|
"inputs": [
|
|
782
953
|
{
|
|
783
954
|
"itemId": 10002,
|
|
784
|
-
"quantity":
|
|
955
|
+
"quantity": 200
|
|
785
956
|
},
|
|
786
957
|
{
|
|
787
|
-
"
|
|
788
|
-
"tier": 2,
|
|
958
|
+
"itemId": 402,
|
|
789
959
|
"quantity": 10
|
|
790
960
|
},
|
|
791
961
|
{
|
|
792
|
-
"
|
|
793
|
-
"tier": 2,
|
|
962
|
+
"itemId": 502,
|
|
794
963
|
"quantity": 20
|
|
795
964
|
}
|
|
796
965
|
],
|
|
@@ -832,11 +1001,11 @@
|
|
|
832
1001
|
"inputs": [
|
|
833
1002
|
{
|
|
834
1003
|
"itemId": 20001,
|
|
835
|
-
"quantity":
|
|
1004
|
+
"quantity": 600
|
|
836
1005
|
},
|
|
837
1006
|
{
|
|
838
1007
|
"itemId": 20002,
|
|
839
|
-
"quantity":
|
|
1008
|
+
"quantity": 200
|
|
840
1009
|
}
|
|
841
1010
|
],
|
|
842
1011
|
"statSlots": [
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {EntityClass, getKindMeta, getTemplateMeta} from '../data/kind-registry'
|
|
2
|
+
import {getRecipe} from '../data/recipes-runtime'
|
|
3
|
+
import {getItems} from '../data/catalog'
|
|
4
|
+
import type {Item} from '../types'
|
|
5
|
+
|
|
6
|
+
export type BuildMethod = 'craft+deploy' | 'plot'
|
|
7
|
+
|
|
8
|
+
export function availableBuildMethods(itemId: number): BuildMethod[] {
|
|
9
|
+
const recipe = getRecipe(itemId)
|
|
10
|
+
if (!recipe) return []
|
|
11
|
+
|
|
12
|
+
const template = getTemplateMeta(itemId)
|
|
13
|
+
if (!template) return ['craft+deploy']
|
|
14
|
+
|
|
15
|
+
const kindMeta = getKindMeta(template.kind)
|
|
16
|
+
if (!kindMeta) return ['craft+deploy']
|
|
17
|
+
|
|
18
|
+
if (kindMeta.classification === EntityClass.PlanetaryStructure) {
|
|
19
|
+
return ['craft+deploy', 'plot']
|
|
20
|
+
}
|
|
21
|
+
return ['craft+deploy']
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function isBuildable(itemId: number): boolean {
|
|
25
|
+
return availableBuildMethods(itemId).length > 0
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function isPlotBuildable(itemId: number): boolean {
|
|
29
|
+
return availableBuildMethods(itemId).includes('plot')
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function filterByBuildMethod<T extends {itemId: number}>(
|
|
33
|
+
items: T[],
|
|
34
|
+
method: BuildMethod
|
|
35
|
+
): T[] {
|
|
36
|
+
return items.filter((i) => availableBuildMethods(i.itemId).includes(method))
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function allBuildableItems(): Item[] {
|
|
40
|
+
return getItems().filter((item) => isBuildable(item.id))
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function allPlotBuildableItems(): Item[] {
|
|
44
|
+
return getItems().filter((item) => isPlotBuildable(item.id))
|
|
45
|
+
}
|