@shipload/sdk 1.0.0-next.4 → 1.0.0-next.40
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 +2473 -973
- package/lib/shipload.js +11529 -5211
- package/lib/shipload.js.map +1 -1
- package/lib/shipload.m.js +11338 -5162
- package/lib/shipload.m.js.map +1 -1
- package/lib/testing.d.ts +970 -0
- package/lib/testing.js +4013 -0
- package/lib/testing.js.map +1 -0
- package/lib/testing.m.js +4007 -0
- package/lib/testing.m.js.map +1 -0
- package/package.json +15 -2
- package/src/capabilities/craftable.ts +51 -0
- package/src/capabilities/crafting.test.ts +7 -0
- package/src/capabilities/crafting.ts +5 -6
- package/src/capabilities/gathering.test.ts +16 -0
- package/src/capabilities/gathering.ts +35 -18
- package/src/capabilities/index.ts +0 -1
- package/src/capabilities/modules.ts +9 -0
- package/src/capabilities/storage.ts +16 -1
- package/src/contracts/platform.ts +231 -3
- package/src/contracts/server.ts +1021 -481
- package/src/coordinates/address.ts +88 -0
- package/src/coordinates/constants.test.ts +15 -0
- package/src/coordinates/constants.ts +23 -0
- package/src/coordinates/index.ts +15 -0
- package/src/coordinates/memo.test.ts +47 -0
- package/src/coordinates/memo.ts +20 -0
- package/src/coordinates/permutation.ts +77 -0
- package/src/coordinates/regions.ts +48 -0
- package/src/coordinates/sectors.ts +115 -0
- package/src/data/capabilities.ts +12 -5
- package/src/data/capability-formulas.ts +14 -7
- package/src/data/catalog.ts +0 -5
- package/src/data/colors.ts +14 -47
- package/src/data/entities.json +76 -10
- package/src/data/item-ids.ts +18 -12
- package/src/data/items.json +321 -38
- package/src/data/kind-registry.json +109 -0
- package/src/data/kind-registry.ts +165 -0
- package/src/data/metadata.ts +119 -33
- package/src/data/recipes-runtime.ts +3 -23
- package/src/data/recipes.json +238 -117
- package/src/derivation/build-methods.ts +45 -0
- package/src/derivation/capabilities.test.ts +151 -0
- package/src/derivation/capabilities.ts +512 -0
- package/src/derivation/capability-mappings.ts +9 -12
- package/src/derivation/crafting.ts +23 -24
- package/src/derivation/index.ts +25 -2
- package/src/derivation/recipe-usage.test.ts +78 -0
- package/src/derivation/recipe-usage.ts +141 -0
- package/src/derivation/reserve-regen.ts +34 -0
- package/src/derivation/resources.ts +125 -38
- package/src/derivation/rollups.test.ts +55 -0
- package/src/derivation/rollups.ts +56 -0
- package/src/derivation/stars.test.ts +51 -0
- package/src/derivation/stars.ts +15 -0
- package/src/derivation/stats.ts +6 -6
- package/src/derivation/stratum.ts +17 -20
- package/src/derivation/tiers.ts +40 -7
- package/src/derivation/wormhole.ts +136 -0
- package/src/entities/entity.ts +98 -0
- package/src/entities/gamestate.ts +3 -28
- package/src/entities/makers.ts +124 -134
- package/src/entities/slot-multiplier.ts +43 -0
- package/src/errors.ts +12 -16
- package/src/format.ts +26 -4
- package/src/index-module.ts +267 -47
- package/src/managers/actions.ts +528 -95
- package/src/managers/base.ts +6 -2
- package/src/managers/construction-types.ts +80 -0
- package/src/managers/construction.ts +412 -0
- package/src/managers/context.ts +20 -1
- package/src/managers/coordinates.ts +14 -0
- package/src/managers/entities.ts +18 -66
- package/src/managers/epochs.ts +40 -0
- package/src/managers/index.ts +17 -1
- package/src/managers/locations.ts +25 -29
- package/src/managers/nft.test.ts +14 -0
- package/src/managers/nft.ts +70 -0
- package/src/managers/plot.ts +122 -0
- package/src/nft/atomicassets.abi.json +1342 -0
- package/src/nft/atomicassets.ts +237 -0
- package/src/nft/atomicdata.ts +130 -0
- package/src/nft/buildImmutableData.ts +338 -0
- package/src/nft/description.ts +98 -24
- package/src/nft/index.ts +3 -0
- package/src/planner/index.ts +127 -0
- package/src/planner/planner.test.ts +319 -0
- package/src/resolution/describe-module.ts +18 -13
- package/src/resolution/display-name.ts +38 -10
- package/src/resolution/resolve-item.test.ts +37 -0
- package/src/resolution/resolve-item.ts +55 -24
- package/src/scheduling/accessor.ts +68 -22
- package/src/scheduling/availability.ts +108 -0
- package/src/scheduling/cancel.test.ts +348 -0
- package/src/scheduling/cancel.ts +209 -0
- package/src/scheduling/energy.ts +47 -0
- package/src/scheduling/idle-resolve.ts +45 -0
- package/src/scheduling/lane-core.ts +128 -0
- package/src/scheduling/lanes.test.ts +249 -0
- package/src/scheduling/lanes.ts +198 -0
- package/src/scheduling/projection.ts +209 -105
- package/src/scheduling/schedule.ts +241 -104
- package/src/scheduling/task-cargo.ts +46 -0
- package/src/shipload.ts +21 -1
- package/src/subscriptions/manager.ts +229 -142
- package/src/subscriptions/mappers.ts +5 -8
- package/src/subscriptions/types.ts +11 -3
- package/src/testing/catalog-hash.ts +19 -0
- package/src/testing/index.ts +2 -0
- package/src/testing/projection-parity.ts +167 -0
- package/src/travel/reach.ts +23 -0
- package/src/travel/route-planner.ts +196 -0
- package/src/travel/travel.ts +200 -112
- package/src/types/capabilities.ts +29 -6
- package/src/types/entity.ts +3 -3
- package/src/types/index.ts +0 -1
- package/src/types.ts +28 -13
- package/src/utils/cargo.ts +27 -0
- package/src/utils/display-name.ts +70 -0
- package/src/utils/system.ts +36 -24
- package/src/capabilities/loading.ts +0 -8
- package/src/entities/container.ts +0 -108
- package/src/entities/ship-deploy.ts +0 -259
- package/src/entities/ship.ts +0 -204
- package/src/entities/warehouse.ts +0 -119
- package/src/types/entity-traits.ts +0 -69
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import {Name, type NameType} from '@wharfkit/antelope'
|
|
2
|
+
import kindRegistryJson from './kind-registry.json'
|
|
3
|
+
|
|
4
|
+
export const CAP_WRAP = 0x01
|
|
5
|
+
export const CAP_UNDEPLOY = 0x02
|
|
6
|
+
export const CAP_DEMOLISH = 0x04
|
|
7
|
+
export const CAP_CATCH = 0x08
|
|
8
|
+
export const CAP_MODULES = 0x10
|
|
9
|
+
|
|
10
|
+
export enum EntityClass {
|
|
11
|
+
OrbitalVessel = 0,
|
|
12
|
+
PlanetaryStructure = 1,
|
|
13
|
+
Plot = 2,
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const CLASSIFICATION_BY_NAME: Record<string, EntityClass> = {
|
|
17
|
+
OrbitalVessel: EntityClass.OrbitalVessel,
|
|
18
|
+
PlanetaryStructure: EntityClass.PlanetaryStructure,
|
|
19
|
+
Plot: EntityClass.Plot,
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type EntityTypeName =
|
|
23
|
+
| 'ship'
|
|
24
|
+
| 'warehouse'
|
|
25
|
+
| 'extractor'
|
|
26
|
+
| 'factory'
|
|
27
|
+
| 'container'
|
|
28
|
+
| 'nexus'
|
|
29
|
+
| 'plot'
|
|
30
|
+
| 'mdriver'
|
|
31
|
+
| 'mcatcher'
|
|
32
|
+
|
|
33
|
+
export interface KindMeta {
|
|
34
|
+
kind: Name
|
|
35
|
+
classification: EntityClass
|
|
36
|
+
capabilityFlags: number
|
|
37
|
+
zCoord: number
|
|
38
|
+
defaultLabel: string
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface TemplateMeta {
|
|
42
|
+
itemId: number
|
|
43
|
+
kind: Name
|
|
44
|
+
displayLabel: string
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
interface RawKindEntry {
|
|
48
|
+
kind: string
|
|
49
|
+
classification: string
|
|
50
|
+
capabilityFlags: number
|
|
51
|
+
zCoord: number
|
|
52
|
+
defaultLabel: string
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
interface RawTemplateEntry {
|
|
56
|
+
itemId: number
|
|
57
|
+
kind: string
|
|
58
|
+
displayLabel: string
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const KIND_META: Map<string, KindMeta> = (() => {
|
|
62
|
+
const m = new Map<string, KindMeta>()
|
|
63
|
+
for (const r of kindRegistryJson.kinds as RawKindEntry[]) {
|
|
64
|
+
const cls = CLASSIFICATION_BY_NAME[r.classification]
|
|
65
|
+
if (cls === undefined) {
|
|
66
|
+
throw new Error(
|
|
67
|
+
`kind-registry: unknown classification "${r.classification}" for kind ${r.kind}`
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
m.set(r.kind, {
|
|
71
|
+
kind: Name.from(r.kind),
|
|
72
|
+
classification: cls,
|
|
73
|
+
capabilityFlags: r.capabilityFlags,
|
|
74
|
+
zCoord: r.zCoord,
|
|
75
|
+
defaultLabel: r.defaultLabel,
|
|
76
|
+
})
|
|
77
|
+
}
|
|
78
|
+
return m
|
|
79
|
+
})()
|
|
80
|
+
|
|
81
|
+
export const ALL_ENTITY_TYPES: readonly EntityTypeName[] = Object.freeze([
|
|
82
|
+
...KIND_META.keys(),
|
|
83
|
+
] as EntityTypeName[])
|
|
84
|
+
|
|
85
|
+
const TEMPLATE_BY_ITEM_ID: Map<number, TemplateMeta> = (() => {
|
|
86
|
+
const m = new Map<number, TemplateMeta>()
|
|
87
|
+
for (const r of kindRegistryJson.templates as RawTemplateEntry[]) {
|
|
88
|
+
m.set(r.itemId, {
|
|
89
|
+
itemId: r.itemId,
|
|
90
|
+
kind: Name.from(r.kind),
|
|
91
|
+
displayLabel: r.displayLabel,
|
|
92
|
+
})
|
|
93
|
+
}
|
|
94
|
+
return m
|
|
95
|
+
})()
|
|
96
|
+
|
|
97
|
+
function nameKey(kind: NameType | EntityTypeName): string {
|
|
98
|
+
if (typeof kind === 'string') return kind
|
|
99
|
+
return Name.from(kind).toString()
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export function getKindMeta(kind: NameType | EntityTypeName): KindMeta | undefined {
|
|
103
|
+
return KIND_META.get(nameKey(kind))
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export function getTemplateMeta(itemId: number): TemplateMeta | undefined {
|
|
107
|
+
return TEMPLATE_BY_ITEM_ID.get(itemId)
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export function getPackedEntityType(itemId: number): Name | null {
|
|
111
|
+
return TEMPLATE_BY_ITEM_ID.get(itemId)?.kind ?? null
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export function kindCan(kind: NameType | EntityTypeName, cap: number): boolean {
|
|
115
|
+
const m = KIND_META.get(nameKey(kind))
|
|
116
|
+
return m !== undefined && (m.capabilityFlags & cap) !== 0
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export function canCatch(kind: NameType | EntityTypeName): boolean {
|
|
120
|
+
return kindCan(kind, CAP_CATCH)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export function getEntityClass(kind: NameType | EntityTypeName): EntityClass {
|
|
124
|
+
const m = KIND_META.get(nameKey(kind))
|
|
125
|
+
if (!m) throw new Error(`Entity type has no class: ${nameKey(kind)}`)
|
|
126
|
+
return m.classification
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export const ENTITY_SHIP = Name.from('ship')
|
|
130
|
+
export const ENTITY_WAREHOUSE = Name.from('warehouse')
|
|
131
|
+
export const ENTITY_EXTRACTOR = Name.from('extractor')
|
|
132
|
+
export const ENTITY_FACTORY = Name.from('factory')
|
|
133
|
+
export const ENTITY_CONTAINER = Name.from('container')
|
|
134
|
+
export const ENTITY_NEXUS = Name.from('nexus')
|
|
135
|
+
export const ENTITY_PLOT = Name.from('plot')
|
|
136
|
+
export const ENTITY_MASS_DRIVER = Name.from('mdriver')
|
|
137
|
+
export const ENTITY_MASS_CATCHER = Name.from('mcatcher')
|
|
138
|
+
|
|
139
|
+
export function isShip(entity: {type?: Name}): boolean {
|
|
140
|
+
return entity.type?.equals(ENTITY_SHIP) ?? false
|
|
141
|
+
}
|
|
142
|
+
export function isWarehouse(entity: {type?: Name}): boolean {
|
|
143
|
+
return entity.type?.equals(ENTITY_WAREHOUSE) ?? false
|
|
144
|
+
}
|
|
145
|
+
export function isExtractor(entity: {type?: Name}): boolean {
|
|
146
|
+
return entity.type?.equals(ENTITY_EXTRACTOR) ?? false
|
|
147
|
+
}
|
|
148
|
+
export function isFactory(entity: {type?: Name}): boolean {
|
|
149
|
+
return entity.type?.equals(ENTITY_FACTORY) ?? false
|
|
150
|
+
}
|
|
151
|
+
export function isContainer(entity: {type?: Name}): boolean {
|
|
152
|
+
return entity.type?.equals(ENTITY_CONTAINER) ?? false
|
|
153
|
+
}
|
|
154
|
+
export function isNexus(entity: {type?: Name}): boolean {
|
|
155
|
+
return entity.type?.equals(ENTITY_NEXUS) ?? false
|
|
156
|
+
}
|
|
157
|
+
export function isPlot(entity: {type?: Name}): boolean {
|
|
158
|
+
return entity.type?.equals(ENTITY_PLOT) ?? false
|
|
159
|
+
}
|
|
160
|
+
export function isMassDriver(entity: {type?: Name}): boolean {
|
|
161
|
+
return entity.type?.equals(ENTITY_MASS_DRIVER) ?? false
|
|
162
|
+
}
|
|
163
|
+
export function isMassCatcher(entity: {type?: Name}): boolean {
|
|
164
|
+
return entity.type?.equals(ENTITY_MASS_CATCHER) ?? false
|
|
165
|
+
}
|
package/src/data/metadata.ts
CHANGED
|
@@ -11,7 +11,7 @@ export interface EntityMetadata {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export const itemMetadata: Record<number, ItemMetadata> = {
|
|
14
|
-
// === Resources
|
|
14
|
+
// === Resources / Ore ===
|
|
15
15
|
101: {name: 'Ore', description: 'Crude metallic ore.', color: '#C26D3F'},
|
|
16
16
|
102: {name: 'Ore', description: 'Refined metallic ore with improved purity.', color: '#C26D3F'},
|
|
17
17
|
103: {
|
|
@@ -19,6 +19,15 @@ export const itemMetadata: Record<number, ItemMetadata> = {
|
|
|
19
19
|
description: 'High-grade metallic ore with exceptional density.',
|
|
20
20
|
color: '#C26D3F',
|
|
21
21
|
},
|
|
22
|
+
104: {name: 'Ore', description: '', color: '#C26D3F'},
|
|
23
|
+
105: {name: 'Ore', description: '', color: '#C26D3F'},
|
|
24
|
+
106: {name: 'Ore', description: '', color: '#C26D3F'},
|
|
25
|
+
107: {name: 'Ore', description: '', color: '#C26D3F'},
|
|
26
|
+
108: {name: 'Ore', description: '', color: '#C26D3F'},
|
|
27
|
+
109: {name: 'Ore', description: '', color: '#C26D3F'},
|
|
28
|
+
110: {name: 'Ore', description: '', color: '#C26D3F'},
|
|
29
|
+
|
|
30
|
+
// === Resources / Crystal ===
|
|
22
31
|
201: {name: 'Crystal', description: 'Raw resonant crystal.', color: '#4ADBFF'},
|
|
23
32
|
202: {
|
|
24
33
|
name: 'Crystal',
|
|
@@ -30,17 +39,35 @@ export const itemMetadata: Record<number, ItemMetadata> = {
|
|
|
30
39
|
description: 'High-grade resonant crystal with exceptional purity.',
|
|
31
40
|
color: '#4ADBFF',
|
|
32
41
|
},
|
|
33
|
-
|
|
42
|
+
204: {name: 'Crystal', description: '', color: '#4ADBFF'},
|
|
43
|
+
205: {name: 'Crystal', description: '', color: '#4ADBFF'},
|
|
44
|
+
206: {name: 'Crystal', description: '', color: '#4ADBFF'},
|
|
45
|
+
207: {name: 'Crystal', description: '', color: '#4ADBFF'},
|
|
46
|
+
208: {name: 'Crystal', description: '', color: '#4ADBFF'},
|
|
47
|
+
209: {name: 'Crystal', description: '', color: '#4ADBFF'},
|
|
48
|
+
210: {name: 'Crystal', description: '', color: '#4ADBFF'},
|
|
49
|
+
|
|
50
|
+
// === Resources / Gas ===
|
|
51
|
+
301: {name: 'Gas', description: 'Raw volatile gas.', color: '#B877FF'},
|
|
34
52
|
302: {
|
|
35
53
|
name: 'Gas',
|
|
36
54
|
description: 'Refined volatile gas with improved reactivity.',
|
|
37
|
-
color: '#
|
|
55
|
+
color: '#B877FF',
|
|
38
56
|
},
|
|
39
57
|
303: {
|
|
40
58
|
name: 'Gas',
|
|
41
59
|
description: 'High-grade volatile gas with exceptional energy density.',
|
|
42
|
-
color: '#
|
|
43
|
-
},
|
|
60
|
+
color: '#B877FF',
|
|
61
|
+
},
|
|
62
|
+
304: {name: 'Gas', description: '', color: '#B877FF'},
|
|
63
|
+
305: {name: 'Gas', description: '', color: '#B877FF'},
|
|
64
|
+
306: {name: 'Gas', description: '', color: '#B877FF'},
|
|
65
|
+
307: {name: 'Gas', description: '', color: '#B877FF'},
|
|
66
|
+
308: {name: 'Gas', description: '', color: '#B877FF'},
|
|
67
|
+
309: {name: 'Gas', description: '', color: '#B877FF'},
|
|
68
|
+
310: {name: 'Gas', description: '', color: '#B877FF'},
|
|
69
|
+
|
|
70
|
+
// === Resources / Regolith ===
|
|
44
71
|
401: {name: 'Regolith', description: 'Crude regolith dust.', color: '#C4A57B'},
|
|
45
72
|
402: {
|
|
46
73
|
name: 'Regolith',
|
|
@@ -52,6 +79,15 @@ export const itemMetadata: Record<number, ItemMetadata> = {
|
|
|
52
79
|
description: 'High-grade regolith with exceptional uniformity.',
|
|
53
80
|
color: '#C4A57B',
|
|
54
81
|
},
|
|
82
|
+
404: {name: 'Regolith', description: '', color: '#C4A57B'},
|
|
83
|
+
405: {name: 'Regolith', description: '', color: '#C4A57B'},
|
|
84
|
+
406: {name: 'Regolith', description: '', color: '#C4A57B'},
|
|
85
|
+
407: {name: 'Regolith', description: '', color: '#C4A57B'},
|
|
86
|
+
408: {name: 'Regolith', description: '', color: '#C4A57B'},
|
|
87
|
+
409: {name: 'Regolith', description: '', color: '#C4A57B'},
|
|
88
|
+
410: {name: 'Regolith', description: '', color: '#C4A57B'},
|
|
89
|
+
|
|
90
|
+
// === Resources / Biomass ===
|
|
55
91
|
501: {name: 'Biomass', description: 'Crude organic biomass.', color: '#5A8B3E'},
|
|
56
92
|
502: {
|
|
57
93
|
name: 'Biomass',
|
|
@@ -63,60 +99,74 @@ export const itemMetadata: Record<number, ItemMetadata> = {
|
|
|
63
99
|
description: 'High-grade biomass with exceptional saturation.',
|
|
64
100
|
color: '#5A8B3E',
|
|
65
101
|
},
|
|
102
|
+
504: {name: 'Biomass', description: '', color: '#5A8B3E'},
|
|
103
|
+
505: {name: 'Biomass', description: '', color: '#5A8B3E'},
|
|
104
|
+
506: {name: 'Biomass', description: '', color: '#5A8B3E'},
|
|
105
|
+
507: {name: 'Biomass', description: '', color: '#5A8B3E'},
|
|
106
|
+
508: {name: 'Biomass', description: '', color: '#5A8B3E'},
|
|
107
|
+
509: {name: 'Biomass', description: '', color: '#5A8B3E'},
|
|
108
|
+
510: {name: 'Biomass', description: '', color: '#5A8B3E'},
|
|
66
109
|
|
|
67
110
|
// === Components (T1) ===
|
|
68
111
|
10001: {
|
|
69
|
-
name: '
|
|
70
|
-
description:
|
|
112
|
+
name: 'Plate',
|
|
113
|
+
description:
|
|
114
|
+
'Structural plating formed from ore. Used in hulls, containers, and storage modules.',
|
|
71
115
|
color: '#7B8D9E',
|
|
72
116
|
},
|
|
73
117
|
10002: {
|
|
74
|
-
name: '
|
|
118
|
+
name: 'Frame',
|
|
75
119
|
description:
|
|
76
|
-
'Composite
|
|
120
|
+
'Composite framing formed from fine regolith bound in biomass polymer. Dense enough to seal cargo holds, flexible enough to absorb vibration.',
|
|
77
121
|
color: '#C4A57B',
|
|
78
122
|
},
|
|
79
123
|
10003: {
|
|
80
|
-
name: '
|
|
81
|
-
description:
|
|
124
|
+
name: 'Plasma Cell',
|
|
125
|
+
description:
|
|
126
|
+
'High-energy gaseous storage cell. Volatile gas held under controlled thermal conditions.',
|
|
82
127
|
color: '#E86344',
|
|
83
128
|
},
|
|
84
129
|
10004: {
|
|
85
|
-
name: '
|
|
130
|
+
name: 'Resonator',
|
|
86
131
|
description:
|
|
87
|
-
'Crystalline
|
|
132
|
+
'Crystalline resonance lattice. Stores and releases charge through coherent oscillation.',
|
|
88
133
|
color: '#4ADBFF',
|
|
89
134
|
},
|
|
90
135
|
10005: {
|
|
91
|
-
name: '
|
|
92
|
-
description:
|
|
136
|
+
name: 'Beam',
|
|
137
|
+
description:
|
|
138
|
+
'Heavy-duty structural beam machined from refined ore. Strong enough to bear load, tolerant enough to survive harsh environments.',
|
|
93
139
|
color: '#7B8D9E',
|
|
94
140
|
},
|
|
95
141
|
10006: {
|
|
96
|
-
name: '
|
|
97
|
-
description:
|
|
142
|
+
name: 'Sensor',
|
|
143
|
+
description:
|
|
144
|
+
'Crystal-lattice sensing element with conductive and reflective properties. Reads signal and surface alike.',
|
|
98
145
|
color: '#4ADBFF',
|
|
99
146
|
},
|
|
100
147
|
10007: {
|
|
101
|
-
name: '
|
|
102
|
-
description:
|
|
148
|
+
name: 'Polymer',
|
|
149
|
+
description:
|
|
150
|
+
'Pliable biomass-derived polymer with high insulation. Flexible, durable, electrically inert.',
|
|
103
151
|
color: '#5A8B3E',
|
|
104
152
|
},
|
|
105
153
|
10008: {
|
|
106
|
-
name: '
|
|
107
|
-
description:
|
|
154
|
+
name: 'Ceramic',
|
|
155
|
+
description:
|
|
156
|
+
'Hardened fine-grained ceramic refined from regolith. Hard enough to cut, fine enough to finish.',
|
|
108
157
|
color: '#C4A57B',
|
|
109
158
|
},
|
|
110
159
|
10009: {
|
|
111
|
-
name: '
|
|
112
|
-
description:
|
|
113
|
-
|
|
160
|
+
name: 'Reactor',
|
|
161
|
+
description:
|
|
162
|
+
'Gas-pressurized vessel for controlled reactions. Vents heat and contains volatility.',
|
|
163
|
+
color: '#B877FF',
|
|
114
164
|
},
|
|
115
165
|
10010: {
|
|
116
|
-
name: '
|
|
166
|
+
name: 'Resin',
|
|
117
167
|
description:
|
|
118
|
-
|
|
119
|
-
color: '#
|
|
168
|
+
'Saturated organic binder cured from biomass. A pliable matrix for haulage and field components.',
|
|
169
|
+
color: '#5A8B3E',
|
|
120
170
|
},
|
|
121
171
|
|
|
122
172
|
// === Modules (T1) ===
|
|
@@ -144,11 +194,11 @@ export const itemMetadata: Record<number, ItemMetadata> = {
|
|
|
144
194
|
name: 'Crafter',
|
|
145
195
|
description:
|
|
146
196
|
'Basic crafting system. Processes materials using reaction chambers and cutting tools.',
|
|
147
|
-
color: '#
|
|
197
|
+
color: '#B877FF',
|
|
148
198
|
},
|
|
149
199
|
10105: {
|
|
150
|
-
name: '
|
|
151
|
-
description: '
|
|
200
|
+
name: 'Cargo Bay',
|
|
201
|
+
description: 'Expanded cargo storage with reinforced internal holds.',
|
|
152
202
|
color: '#8B7355',
|
|
153
203
|
},
|
|
154
204
|
10106: {
|
|
@@ -163,6 +213,16 @@ export const itemMetadata: Record<number, ItemMetadata> = {
|
|
|
163
213
|
'Folds local space-time around the hull, projecting the ship across vast distances in a single discharge of the entire energy reserve.',
|
|
164
214
|
color: '#9be4ff',
|
|
165
215
|
},
|
|
216
|
+
10108: {
|
|
217
|
+
name: 'Battery Bank',
|
|
218
|
+
description: 'Stores additional charge produced by generators.',
|
|
219
|
+
color: '#4ADBFF',
|
|
220
|
+
},
|
|
221
|
+
10109: {
|
|
222
|
+
name: 'Drive Coil',
|
|
223
|
+
description: 'Accelerates and launches cargo payloads toward a remote mass catcher.',
|
|
224
|
+
color: '#E86344',
|
|
225
|
+
},
|
|
166
226
|
|
|
167
227
|
// === Entities (packed, T1) ===
|
|
168
228
|
10200: {
|
|
@@ -180,17 +240,39 @@ export const itemMetadata: Record<number, ItemMetadata> = {
|
|
|
180
240
|
description: 'Massive stationary storage facility with a single loader module slot.',
|
|
181
241
|
color: '#EAB308',
|
|
182
242
|
},
|
|
243
|
+
10203: {
|
|
244
|
+
name: 'Extractor',
|
|
245
|
+
description:
|
|
246
|
+
'Planetary resource extraction facility with generator and gatherer module slots.',
|
|
247
|
+
color: '#D4726F',
|
|
248
|
+
},
|
|
249
|
+
10204: {
|
|
250
|
+
name: 'Factory',
|
|
251
|
+
description: 'Planetary fabrication facility with generator and crafter module slots.',
|
|
252
|
+
color: '#7BA7D4',
|
|
253
|
+
},
|
|
254
|
+
10205: {
|
|
255
|
+
name: 'Mass Driver',
|
|
256
|
+
description: 'Planetary launch platform with generator and drive coil module slots.',
|
|
257
|
+
color: '#E86344',
|
|
258
|
+
},
|
|
259
|
+
10206: {
|
|
260
|
+
name: 'Mass Catcher',
|
|
261
|
+
description:
|
|
262
|
+
'Planetary receiving platform with storage module slots; catches launched payloads.',
|
|
263
|
+
color: '#4AE898',
|
|
264
|
+
},
|
|
183
265
|
|
|
184
266
|
// === Components (T2) ===
|
|
185
267
|
20001: {
|
|
186
|
-
name: '
|
|
268
|
+
name: 'Plate',
|
|
187
269
|
description: 'Advanced structural plating reinforced with tier 2 ore.',
|
|
188
270
|
color: '#9BADB8',
|
|
189
271
|
},
|
|
190
272
|
20002: {
|
|
191
|
-
name: '
|
|
273
|
+
name: 'Frame',
|
|
192
274
|
description:
|
|
193
|
-
'Advanced composite
|
|
275
|
+
'Advanced composite framing reinforced with tier 2 regolith and biomass polymer.',
|
|
194
276
|
color: '#C4A57B',
|
|
195
277
|
},
|
|
196
278
|
|
|
@@ -205,6 +287,10 @@ export const itemMetadata: Record<number, ItemMetadata> = {
|
|
|
205
287
|
export const entityMetadata: Record<number, EntityMetadata> = {
|
|
206
288
|
10201: {moduleSlotLabels: ['Engine', 'Generator', 'Gatherer', 'Loader', 'Storage']},
|
|
207
289
|
10202: {moduleSlotLabels: ['Loader', 'Storage', 'Storage', 'Storage', 'Storage']},
|
|
290
|
+
10203: {moduleSlotLabels: ['Generator', 'Gatherer']},
|
|
291
|
+
10204: {moduleSlotLabels: ['Generator', 'Crafter']},
|
|
292
|
+
10205: {moduleSlotLabels: ['Generator', 'Drive Coil']},
|
|
293
|
+
10206: {moduleSlotLabels: ['Storage', 'Storage', 'Storage']},
|
|
208
294
|
}
|
|
209
295
|
|
|
210
296
|
for (const item of items as Array<{id: number}>) {
|
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
import items from './items.json'
|
|
2
1
|
import recipes from './recipes.json'
|
|
3
2
|
import entities from './entities.json'
|
|
4
3
|
|
|
5
|
-
import {
|
|
6
|
-
import type {Item, ModuleType, ResourceCategory} from '../types'
|
|
4
|
+
import type {ModuleType} from '../types'
|
|
7
5
|
|
|
8
|
-
export interface
|
|
6
|
+
export interface RecipeInput {
|
|
9
7
|
itemId: number
|
|
10
8
|
quantity: number
|
|
11
9
|
}
|
|
12
|
-
export interface RecipeInputCategory {
|
|
13
|
-
category: ResourceCategory
|
|
14
|
-
tier: number
|
|
15
|
-
quantity: number
|
|
16
|
-
}
|
|
17
|
-
export type RecipeInput = RecipeInputItemId | RecipeInputCategory
|
|
18
10
|
|
|
19
11
|
export interface StatSlot {
|
|
20
12
|
sources: {inputIndex: number; statIndex: number}[]
|
|
@@ -30,6 +22,7 @@ export interface Recipe {
|
|
|
30
22
|
|
|
31
23
|
export interface EntitySlot {
|
|
32
24
|
type: ModuleType
|
|
25
|
+
outputPct: number
|
|
33
26
|
}
|
|
34
27
|
|
|
35
28
|
export interface EntityLayout {
|
|
@@ -43,13 +36,6 @@ for (const r of recipes as any[]) recipesById.set(r.outputItemId, r as Recipe)
|
|
|
43
36
|
const entitiesById = new Map<number, EntityLayout>()
|
|
44
37
|
for (const e of entities as any[]) entitiesById.set(e.entityItemId, e as EntityLayout)
|
|
45
38
|
|
|
46
|
-
const resourceByCategoryTier = new Map<string, Item>()
|
|
47
|
-
for (const raw of items as any[]) {
|
|
48
|
-
if (raw.type === 'resource') {
|
|
49
|
-
resourceByCategoryTier.set(`${raw.category}:${raw.tier}`, getItem(raw.id))
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
39
|
export function getRecipe(outputItemId: number): Recipe | undefined {
|
|
54
40
|
return recipesById.get(outputItemId)
|
|
55
41
|
}
|
|
@@ -57,9 +43,3 @@ export function getRecipe(outputItemId: number): Recipe | undefined {
|
|
|
57
43
|
export function getEntityLayout(entityItemId: number): EntityLayout | undefined {
|
|
58
44
|
return entitiesById.get(entityItemId)
|
|
59
45
|
}
|
|
60
|
-
|
|
61
|
-
export function findItemByCategoryAndTier(category: ResourceCategory, tier: number): Item {
|
|
62
|
-
const item = resourceByCategoryTier.get(`${category}:${tier}`)
|
|
63
|
-
if (!item) throw new Error(`No resource found for category=${category} tier=${tier}`)
|
|
64
|
-
return item
|
|
65
|
-
}
|