@shipload/sdk 1.0.0-next.3 → 1.0.0-next.4
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 +14 -7
- package/lib/shipload.js +192 -380
- package/lib/shipload.js.map +1 -1
- package/lib/shipload.m.js +190 -380
- package/lib/shipload.m.js.map +1 -1
- package/package.json +1 -1
- package/src/data/capabilities.ts +5 -330
- package/src/data/capability-formulas.ts +68 -0
- package/src/data/recipes.json +6 -16
- package/src/derivation/capability-mappings.ts +120 -0
- package/src/entities/container.ts +8 -8
- package/src/entities/ship-deploy.ts +36 -35
- package/src/index-module.ts +9 -3
- package/src/nft/description.ts +4 -4
- package/src/resolution/resolve-item.ts +5 -4
|
@@ -13,10 +13,10 @@ export function computeShipHullCapabilities(stats: Record<string, number>): {
|
|
|
13
13
|
hullmass: number
|
|
14
14
|
capacity: number
|
|
15
15
|
} {
|
|
16
|
-
const density = stats.density
|
|
17
|
-
const strength = stats.strength
|
|
18
|
-
const hardness = stats.hardness
|
|
19
|
-
const saturation = stats.saturation
|
|
16
|
+
const density = stats.density
|
|
17
|
+
const strength = stats.strength
|
|
18
|
+
const hardness = stats.hardness
|
|
19
|
+
const saturation = stats.saturation
|
|
20
20
|
|
|
21
21
|
const hullmass = 25000 + 75 * density
|
|
22
22
|
const statSum = strength + hardness + saturation
|
|
@@ -30,8 +30,8 @@ export function computeEngineCapabilities(stats: Record<string, number>): {
|
|
|
30
30
|
thrust: number
|
|
31
31
|
drain: number
|
|
32
32
|
} {
|
|
33
|
-
const vol = stats.volatility
|
|
34
|
-
const thm = stats.thermal
|
|
33
|
+
const vol = stats.volatility
|
|
34
|
+
const thm = stats.thermal
|
|
35
35
|
|
|
36
36
|
return {
|
|
37
37
|
thrust: 400 + Math.floor((vol * 3) / 4),
|
|
@@ -43,12 +43,12 @@ export function computeGeneratorCapabilities(stats: Record<string, number>): {
|
|
|
43
43
|
capacity: number
|
|
44
44
|
recharge: number
|
|
45
45
|
} {
|
|
46
|
-
const
|
|
47
|
-
const
|
|
46
|
+
const com = stats.composition
|
|
47
|
+
const fin = stats.fineness
|
|
48
48
|
|
|
49
49
|
return {
|
|
50
|
-
capacity: 300 + Math.floor(
|
|
51
|
-
recharge: 1 + Math.floor((
|
|
50
|
+
capacity: 300 + Math.floor(com / 6),
|
|
51
|
+
recharge: 1 + Math.floor((fin * 3) / 1000),
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -58,10 +58,10 @@ export function computeGathererCapabilities(stats: Record<string, number>): {
|
|
|
58
58
|
depth: number
|
|
59
59
|
speed: number
|
|
60
60
|
} {
|
|
61
|
-
const str = stats.strength
|
|
62
|
-
const con = stats.conductivity
|
|
63
|
-
const ref = stats.reflectivity
|
|
64
|
-
const tol = stats.tolerance
|
|
61
|
+
const str = stats.strength
|
|
62
|
+
const con = stats.conductivity
|
|
63
|
+
const ref = stats.reflectivity
|
|
64
|
+
const tol = stats.tolerance
|
|
65
65
|
|
|
66
66
|
return {
|
|
67
67
|
yield: 200 + str,
|
|
@@ -76,12 +76,12 @@ export function computeLoaderCapabilities(stats: Record<string, number>): {
|
|
|
76
76
|
thrust: number
|
|
77
77
|
quantity: number
|
|
78
78
|
} {
|
|
79
|
-
const
|
|
80
|
-
const
|
|
79
|
+
const insulation = stats.insulation
|
|
80
|
+
const plasticity = stats.plasticity
|
|
81
81
|
|
|
82
82
|
return {
|
|
83
|
-
mass: Math.max(200, 2000 - Math.floor(
|
|
84
|
-
thrust: 1 + Math.floor(
|
|
83
|
+
mass: Math.max(200, 2000 - Math.floor(insulation * 2)),
|
|
84
|
+
thrust: 1 + Math.floor(plasticity / 500),
|
|
85
85
|
quantity: 1,
|
|
86
86
|
}
|
|
87
87
|
}
|
|
@@ -90,12 +90,12 @@ export function computeCrafterCapabilities(stats: Record<string, number>): {
|
|
|
90
90
|
speed: number
|
|
91
91
|
drain: number
|
|
92
92
|
} {
|
|
93
|
-
const rea = stats.reactivity
|
|
94
|
-
const
|
|
93
|
+
const rea = stats.reactivity
|
|
94
|
+
const fin = stats.fineness
|
|
95
95
|
|
|
96
96
|
return {
|
|
97
97
|
speed: 100 + Math.floor((rea * 4) / 5),
|
|
98
|
-
drain: Math.max(5, 30 - Math.floor(
|
|
98
|
+
drain: Math.max(5, 30 - Math.floor(fin / 33)),
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
|
|
@@ -104,14 +104,14 @@ export function computeHaulerCapabilities(stats: Record<string, number>): {
|
|
|
104
104
|
efficiency: number
|
|
105
105
|
drain: number
|
|
106
106
|
} {
|
|
107
|
-
const
|
|
108
|
-
const
|
|
109
|
-
const
|
|
107
|
+
const fineness = stats.fineness
|
|
108
|
+
const conductivity = stats.conductivity
|
|
109
|
+
const composition = stats.composition
|
|
110
110
|
|
|
111
111
|
return {
|
|
112
|
-
capacity: Math.max(1, 1 + Math.floor(
|
|
113
|
-
efficiency: 2000 +
|
|
114
|
-
drain: Math.max(3, 15 - Math.floor(
|
|
112
|
+
capacity: Math.max(1, 1 + Math.floor(fineness / 400)),
|
|
113
|
+
efficiency: 2000 + conductivity * 6,
|
|
114
|
+
drain: Math.max(3, 15 - Math.floor(composition / 80)),
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
|
|
@@ -121,11 +121,12 @@ export function computeStorageCapabilities(
|
|
|
121
121
|
): {
|
|
122
122
|
capacityBonus: number
|
|
123
123
|
} {
|
|
124
|
-
const strength = stats.strength
|
|
125
|
-
const
|
|
126
|
-
const
|
|
124
|
+
const strength = stats.strength
|
|
125
|
+
const density = stats.density
|
|
126
|
+
const hardness = stats.hardness
|
|
127
|
+
const saturation = stats.saturation
|
|
127
128
|
|
|
128
|
-
const statSum = strength + hardness + saturation
|
|
129
|
+
const statSum = strength + density + hardness + saturation
|
|
129
130
|
const capacityBonus = Math.floor(
|
|
130
131
|
(baseCapacity * (10 + Math.floor((statSum * 10) / 2997))) / 100
|
|
131
132
|
)
|
|
@@ -137,10 +138,10 @@ export function computeWarehouseHullCapabilities(stats: Record<string, number>):
|
|
|
137
138
|
hullmass: number
|
|
138
139
|
capacity: number
|
|
139
140
|
} {
|
|
140
|
-
const density = stats.density
|
|
141
|
-
const strength = stats.strength
|
|
142
|
-
const hardness = stats.hardness
|
|
143
|
-
const saturation = stats.saturation
|
|
141
|
+
const density = stats.density
|
|
142
|
+
const strength = stats.strength
|
|
143
|
+
const hardness = stats.hardness
|
|
144
|
+
const saturation = stats.saturation
|
|
144
145
|
|
|
145
146
|
const hullmass = 25000 + 75 * density
|
|
146
147
|
const statSum = strength + hardness + saturation
|
package/src/index-module.ts
CHANGED
|
@@ -202,14 +202,19 @@ export type {PlanetSubtypeInfo} from './data/locations'
|
|
|
202
202
|
export {
|
|
203
203
|
capabilityNames,
|
|
204
204
|
capabilityAttributes,
|
|
205
|
-
statMappings,
|
|
206
205
|
isInvertedAttribute,
|
|
207
206
|
getCapabilityAttributes,
|
|
207
|
+
} from './data/capabilities'
|
|
208
|
+
export type {CapabilityAttribute, StatMapping} from './data/capabilities'
|
|
209
|
+
|
|
210
|
+
export {
|
|
211
|
+
deriveStatMappings,
|
|
208
212
|
getStatMappings,
|
|
209
213
|
getStatMappingsForStat,
|
|
210
214
|
getStatMappingsForCapability,
|
|
211
|
-
} from './
|
|
212
|
-
export
|
|
215
|
+
} from './derivation/capability-mappings'
|
|
216
|
+
export {SLOT_FORMULAS} from './data/capability-formulas'
|
|
217
|
+
export type {SlotConsumer, SlotConsumerKind} from './data/capability-formulas'
|
|
213
218
|
|
|
214
219
|
export {
|
|
215
220
|
encodeStats,
|
|
@@ -302,6 +307,7 @@ export {
|
|
|
302
307
|
computeLoaderThrust,
|
|
303
308
|
computeCrafterSpeed,
|
|
304
309
|
computeCrafterDrain,
|
|
310
|
+
computeWarpRange,
|
|
305
311
|
} from './nft/description'
|
|
306
312
|
|
|
307
313
|
export {
|
package/src/nft/description.ts
CHANGED
|
@@ -44,17 +44,17 @@ export function computeBaseCapacityWarehouse(stats: bigint): number {
|
|
|
44
44
|
|
|
45
45
|
export const computeEngineThrust = (vol: number): number => 400 + idiv(vol * 3, 4)
|
|
46
46
|
export const computeEngineDrain = (thm: number): number => Math.max(30, 50 - idiv(thm, 70))
|
|
47
|
-
export const computeGeneratorCap = (
|
|
48
|
-
export const computeGeneratorRech = (
|
|
47
|
+
export const computeGeneratorCap = (com: number): number => 300 + idiv(com, 6)
|
|
48
|
+
export const computeGeneratorRech = (fin: number): number => 1 + idiv(fin * 3, 1000)
|
|
49
49
|
export const computeGathererYield = (str: number): number => 200 + str
|
|
50
50
|
export const computeGathererDrain = (con: number): number =>
|
|
51
51
|
Math.max(250, 1250 - idiv(con * 25, 20))
|
|
52
52
|
export const computeGathererDepth = (tol: number): number => 200 + idiv(tol * 3, 2)
|
|
53
53
|
export const computeGathererSpeed = (ref: number): number => 100 + idiv(ref * 4, 5)
|
|
54
|
-
export const computeLoaderMass = (
|
|
54
|
+
export const computeLoaderMass = (ins: number): number => Math.max(200, 2000 - ins * 2)
|
|
55
55
|
export const computeLoaderThrust = (pla: number): number => 1 + idiv(pla, 500)
|
|
56
56
|
export const computeCrafterSpeed = (rea: number): number => 100 + idiv(rea * 4, 5)
|
|
57
|
-
export const computeCrafterDrain = (
|
|
57
|
+
export const computeCrafterDrain = (fin: number): number => Math.max(5, 30 - idiv(fin, 33))
|
|
58
58
|
export const computeWarpRange = (stat: number): number => 100 + stat * 3
|
|
59
59
|
|
|
60
60
|
export function entityDisplayName(itemId: number): string {
|
|
@@ -223,10 +223,11 @@ function computeCapabilityGroup(
|
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
225
|
case MODULE_STORAGE: {
|
|
226
|
-
const str = stats.strength
|
|
227
|
-
const
|
|
228
|
-
const
|
|
229
|
-
const
|
|
226
|
+
const str = stats.strength
|
|
227
|
+
const den = stats.density
|
|
228
|
+
const hrd = stats.hardness
|
|
229
|
+
const sat = stats.saturation
|
|
230
|
+
const statSum = str + den + hrd + sat
|
|
230
231
|
const pct = 10 + Math.floor((statSum * 10) / 2997)
|
|
231
232
|
return {capability: 'Storage', attributes: [{label: 'Capacity Bonus', value: pct}]}
|
|
232
233
|
}
|