@shipload/sdk 1.0.0-next.52 → 1.0.0-next.53
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 +3 -3
- package/lib/shipload.js +41 -23
- package/lib/shipload.js.map +1 -1
- package/lib/shipload.m.js +41 -23
- package/lib/shipload.m.js.map +1 -1
- package/package.json +1 -1
- package/src/data/capabilities.ts +7 -0
- package/src/data/capability-formulas.ts +5 -0
- package/src/data/recipes.json +12 -5
- package/src/derivation/capabilities.test.ts +24 -0
- package/src/derivation/capabilities.ts +4 -4
- package/src/derivation/capability-mappings.ts +2 -0
- package/src/nft/buildImmutableData.ts +6 -6
- package/src/nft/description.ts +6 -6
- package/src/scheduling/lanes.ts +4 -4
package/lib/shipload.d.ts
CHANGED
|
@@ -4633,7 +4633,7 @@ interface SlotConsumer {
|
|
|
4633
4633
|
capability: string;
|
|
4634
4634
|
attribute: string;
|
|
4635
4635
|
}
|
|
4636
|
-
type SlotConsumerKind = 'engine' | 'generator' | 'gatherer' | 'loader' | 'crafter' | 'storage' | 'hauler' | 'warp' | 'battery' | 'ship-t1' | 'container-t1' | 'warehouse-t1' | 'extractor-t1' | 'container-t2';
|
|
4636
|
+
type SlotConsumerKind = 'engine' | 'generator' | 'gatherer' | 'loader' | 'crafter' | 'builder' | 'storage' | 'hauler' | 'warp' | 'battery' | 'ship-t1' | 'container-t1' | 'warehouse-t1' | 'extractor-t1' | 'container-t2';
|
|
4637
4637
|
declare const SLOT_FORMULAS: Record<SlotConsumerKind, Record<number, SlotConsumer>>;
|
|
4638
4638
|
|
|
4639
4639
|
declare function sourceLabelForOutput(itemId: number): string;
|
|
@@ -5016,8 +5016,8 @@ declare const computeLoaderMass: (ins: number) => number;
|
|
|
5016
5016
|
declare const computeLoaderThrust: (pla: number) => number;
|
|
5017
5017
|
declare const computeCrafterSpeed: (rea: number) => number;
|
|
5018
5018
|
declare const computeCrafterDrain: (fin: number) => number;
|
|
5019
|
-
declare const computeBuilderSpeed: (
|
|
5020
|
-
declare const computeBuilderDrain: (
|
|
5019
|
+
declare const computeBuilderSpeed: (resonance: number) => number;
|
|
5020
|
+
declare const computeBuilderDrain: (fineness: number) => number;
|
|
5021
5021
|
declare const computeHaulerCapacity: (fin: number, tier: number) => number;
|
|
5022
5022
|
declare const computeHaulerEfficiency: (con: number) => number;
|
|
5023
5023
|
declare const supportDrainTierPercent: (tier: number) => number;
|
package/lib/shipload.js
CHANGED
|
@@ -4641,33 +4641,39 @@ var recipes = [
|
|
|
4641
4641
|
outputMass: 960000,
|
|
4642
4642
|
inputs: [
|
|
4643
4643
|
{
|
|
4644
|
-
itemId:
|
|
4644
|
+
itemId: 10006,
|
|
4645
4645
|
quantity: 300
|
|
4646
4646
|
},
|
|
4647
4647
|
{
|
|
4648
|
-
itemId:
|
|
4648
|
+
itemId: 10008,
|
|
4649
4649
|
quantity: 300
|
|
4650
4650
|
}
|
|
4651
4651
|
],
|
|
4652
4652
|
statSlots: [
|
|
4653
4653
|
{
|
|
4654
4654
|
sources: [
|
|
4655
|
+
{
|
|
4656
|
+
inputIndex: 0,
|
|
4657
|
+
statIndex: 2
|
|
4658
|
+
},
|
|
4655
4659
|
{
|
|
4656
4660
|
inputIndex: 1,
|
|
4657
|
-
statIndex:
|
|
4661
|
+
statIndex: 0
|
|
4658
4662
|
}
|
|
4659
4663
|
]
|
|
4660
4664
|
},
|
|
4661
4665
|
{
|
|
4662
4666
|
sources: [
|
|
4663
4667
|
{
|
|
4664
|
-
inputIndex:
|
|
4668
|
+
inputIndex: 1,
|
|
4665
4669
|
statIndex: 1
|
|
4666
4670
|
}
|
|
4667
4671
|
]
|
|
4668
4672
|
}
|
|
4669
4673
|
],
|
|
4670
4674
|
blendWeights: [
|
|
4675
|
+
1,
|
|
4676
|
+
1
|
|
4671
4677
|
]
|
|
4672
4678
|
},
|
|
4673
4679
|
{
|
|
@@ -16312,8 +16318,8 @@ const computeLoaderMass = (ins) => Math.max(200, 2000 - ins * 2);
|
|
|
16312
16318
|
const computeLoaderThrust = (pla) => 1 + idiv(pla * pla, 10000);
|
|
16313
16319
|
const computeCrafterSpeed = (rea) => 100 + idiv(rea * 4, 5);
|
|
16314
16320
|
const computeCrafterDrain = (fin) => Math.max(5000, 30000 - idiv(fin * 1000, 33));
|
|
16315
|
-
const computeBuilderSpeed = (
|
|
16316
|
-
const computeBuilderDrain = (
|
|
16321
|
+
const computeBuilderSpeed = (resonance) => 100 + idiv(resonance * 4, 5);
|
|
16322
|
+
const computeBuilderDrain = (fineness) => Math.max(5000, 30000 - idiv(fineness * 1000, 33));
|
|
16317
16323
|
const computeHaulerCapacity = (fin, tier) => Math.max(tier, tier + idiv(fin, 400));
|
|
16318
16324
|
const computeHaulerEfficiency = (con) => 2000 + con * 6;
|
|
16319
16325
|
const supportDrainTierPercent = (tier) => {
|
|
@@ -16434,9 +16440,9 @@ function formatModuleLine(slot, itemId, stats) {
|
|
|
16434
16440
|
break;
|
|
16435
16441
|
}
|
|
16436
16442
|
case MODULE_BUILDER: {
|
|
16437
|
-
const
|
|
16438
|
-
const
|
|
16439
|
-
out += ` Speed ${computeBuilderSpeed(
|
|
16443
|
+
const res = decodeStat(stats, 0);
|
|
16444
|
+
const fin = decodeStat(stats, 1);
|
|
16445
|
+
out += ` Speed ${computeBuilderSpeed(res)} Drain ${toWholeEnergy$1(computeBuilderDrain(fin))}`;
|
|
16440
16446
|
break;
|
|
16441
16447
|
}
|
|
16442
16448
|
case MODULE_STORAGE: {
|
|
@@ -16589,11 +16595,11 @@ function computeCrafterCapabilities(stats) {
|
|
|
16589
16595
|
};
|
|
16590
16596
|
}
|
|
16591
16597
|
function computeBuilderCapabilities(stats) {
|
|
16592
|
-
const
|
|
16593
|
-
const
|
|
16598
|
+
const resonance = stats.resonance;
|
|
16599
|
+
const fineness = stats.fineness;
|
|
16594
16600
|
return {
|
|
16595
|
-
speed: 100 + Math.floor((
|
|
16596
|
-
drain: Math.max(5000, 30000 - Math.floor((
|
|
16601
|
+
speed: 100 + Math.floor((resonance * 4) / 5),
|
|
16602
|
+
drain: Math.max(5000, 30000 - Math.floor((fineness * 1000) / 33)),
|
|
16597
16603
|
};
|
|
16598
16604
|
}
|
|
16599
16605
|
function computeHaulerCapabilities(stats, tier) {
|
|
@@ -17904,12 +17910,12 @@ function resolveLaneBuilder(modules, entityItemId, laneKey) {
|
|
|
17904
17910
|
if (item.moduleType !== 'builder')
|
|
17905
17911
|
throw new Error('lane module is not a builder');
|
|
17906
17912
|
const stats = BigInt(installed.stats.toString());
|
|
17907
|
-
const
|
|
17908
|
-
const
|
|
17913
|
+
const res = decodeStat(stats, 0);
|
|
17914
|
+
const fin = decodeStat(stats, 1);
|
|
17909
17915
|
const layout = getEntityLayout(entityItemId)?.slots ?? [];
|
|
17910
17916
|
const amp = getSlotAmp(layout, idx);
|
|
17911
|
-
const speed = applySlotMultiplier(computeBuilderSpeed(
|
|
17912
|
-
const drain = computeBuilderDrain(
|
|
17917
|
+
const speed = applySlotMultiplier(computeBuilderSpeed(res), amp);
|
|
17918
|
+
const drain = computeBuilderDrain(fin);
|
|
17913
17919
|
return { slotIndex: idx, speed, drain, outputPct: amp };
|
|
17914
17920
|
}
|
|
17915
17921
|
function resolveLaneLoader(modules, entityItemId, laneKey) {
|
|
@@ -19322,6 +19328,7 @@ const capabilityNames = [
|
|
|
19322
19328
|
'Gathering',
|
|
19323
19329
|
'Warp',
|
|
19324
19330
|
'Crafting',
|
|
19331
|
+
'Build',
|
|
19325
19332
|
'Launch',
|
|
19326
19333
|
'Hauling',
|
|
19327
19334
|
];
|
|
@@ -19367,6 +19374,12 @@ const capabilityAttributes = [
|
|
|
19367
19374
|
description: 'Energy consumed per second while crafting',
|
|
19368
19375
|
},
|
|
19369
19376
|
{ capability: 'Crafting', attribute: 'quality', description: 'Modifier on output quality' },
|
|
19377
|
+
{ capability: 'Build', attribute: 'speed', description: 'Build progress per second' },
|
|
19378
|
+
{
|
|
19379
|
+
capability: 'Build',
|
|
19380
|
+
attribute: 'drain',
|
|
19381
|
+
description: 'Energy consumed per second while building',
|
|
19382
|
+
},
|
|
19370
19383
|
{ capability: 'Launch', attribute: 'range', description: 'Maximum launch distance' },
|
|
19371
19384
|
{ capability: 'Launch', attribute: 'capacity', description: 'Maximum mass per launch' },
|
|
19372
19385
|
{ capability: 'Launch', attribute: 'drain', description: 'Energy consumed per launch' },
|
|
@@ -19424,6 +19437,10 @@ const SLOT_FORMULAS = {
|
|
|
19424
19437
|
0: { capability: 'Crafting', attribute: 'speed' },
|
|
19425
19438
|
1: { capability: 'Crafting', attribute: 'drain' },
|
|
19426
19439
|
},
|
|
19440
|
+
builder: {
|
|
19441
|
+
0: { capability: 'Build', attribute: 'speed' },
|
|
19442
|
+
1: { capability: 'Build', attribute: 'drain' },
|
|
19443
|
+
},
|
|
19427
19444
|
storage: {
|
|
19428
19445
|
0: { capability: 'Storage', attribute: 'capacity' },
|
|
19429
19446
|
1: { capability: 'Storage', attribute: 'capacity' },
|
|
@@ -19457,6 +19474,7 @@ const KIND_TO_ITEM_ID = {
|
|
|
19457
19474
|
gatherer: ITEM_GATHERER_T1,
|
|
19458
19475
|
loader: ITEM_LOADER_T1,
|
|
19459
19476
|
crafter: ITEM_CRAFTER_T1,
|
|
19477
|
+
builder: ITEM_BUILDER_T1,
|
|
19460
19478
|
storage: ITEM_STORAGE_T1,
|
|
19461
19479
|
hauler: ITEM_HAULER_T1,
|
|
19462
19480
|
warp: ITEM_WARP_T1,
|
|
@@ -20380,12 +20398,12 @@ function buildModuleImmutable(itemId, quantity, stats, originX, originY) {
|
|
|
20380
20398
|
break;
|
|
20381
20399
|
}
|
|
20382
20400
|
case MODULE_BUILDER: {
|
|
20383
|
-
const
|
|
20384
|
-
const
|
|
20385
|
-
base.push({ first: '
|
|
20386
|
-
base.push({ first: '
|
|
20387
|
-
base.push({ first: 'speed', second: ['uint16', computeBuilderSpeed(
|
|
20388
|
-
base.push({ first: 'drain', second: ['uint16', toWholeEnergy(computeBuilderDrain(
|
|
20401
|
+
const res = decodeStat(stats, 0);
|
|
20402
|
+
const fin = decodeStat(stats, 1);
|
|
20403
|
+
base.push({ first: 'resonance', second: ['uint16', res] });
|
|
20404
|
+
base.push({ first: 'fineness', second: ['uint16', fin] });
|
|
20405
|
+
base.push({ first: 'speed', second: ['uint16', computeBuilderSpeed(res)] });
|
|
20406
|
+
base.push({ first: 'drain', second: ['uint16', toWholeEnergy(computeBuilderDrain(fin))] });
|
|
20389
20407
|
break;
|
|
20390
20408
|
}
|
|
20391
20409
|
case MODULE_STORAGE: {
|