@shipload/sdk 2.0.0-rc5 → 2.0.0-rc6

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.
Files changed (44) hide show
  1. package/lib/shipload.d.ts +376 -1008
  2. package/lib/shipload.js +712 -1948
  3. package/lib/shipload.js.map +1 -1
  4. package/lib/shipload.m.js +694 -1924
  5. package/lib/shipload.m.js.map +1 -1
  6. package/package.json +1 -1
  7. package/src/capabilities/crafting.ts +10 -0
  8. package/src/capabilities/guards.ts +0 -5
  9. package/src/capabilities/index.ts +1 -0
  10. package/src/capabilities/storage.ts +0 -8
  11. package/src/contracts/server.ts +103 -220
  12. package/src/data/items.json +15 -15
  13. package/src/data/recipes.ts +129 -0
  14. package/src/derivation/crafting.ts +120 -0
  15. package/src/derivation/index.ts +1 -0
  16. package/src/derivation/stats.ts +91 -15
  17. package/src/derivation/stratum.ts +2 -2
  18. package/src/entities/cargo-utils.ts +6 -64
  19. package/src/entities/container.ts +18 -0
  20. package/src/entities/entity-inventory.ts +0 -4
  21. package/src/entities/inventory-accessor.ts +0 -4
  22. package/src/entities/location.ts +2 -197
  23. package/src/entities/player.ts +1 -274
  24. package/src/entities/ship.ts +0 -21
  25. package/src/entities/warehouse.ts +0 -4
  26. package/src/index-module.ts +34 -41
  27. package/src/managers/actions.ts +38 -90
  28. package/src/managers/context.ts +0 -9
  29. package/src/managers/index.ts +0 -1
  30. package/src/managers/locations.ts +2 -85
  31. package/src/market/items.ts +0 -1
  32. package/src/scheduling/projection.ts +0 -10
  33. package/src/shipload.ts +0 -5
  34. package/src/types/capabilities.ts +1 -9
  35. package/src/types/entity-traits.ts +3 -4
  36. package/src/types/entity.ts +0 -1
  37. package/src/types.ts +5 -25
  38. package/src/utils/system.ts +5 -4
  39. package/src/managers/trades.ts +0 -119
  40. package/src/market/market.ts +0 -195
  41. package/src/market/rolls.ts +0 -8
  42. package/src/trading/collect.ts +0 -938
  43. package/src/trading/deal.ts +0 -207
  44. package/src/trading/trade.ts +0 -203
package/lib/shipload.js CHANGED
@@ -213,7 +213,7 @@ var platform = /*#__PURE__*/Object.freeze({
213
213
  Contract: Contract$1
214
214
  });
215
215
 
216
- const abiBlob = antelope.Blob.from('DmVvc2lvOjphYmkvMS4yAhVCX3ZlY3Rvcl9lbnRpdHlfcmVmX0UMZW50aXR5X3JlZltdDWxvY2F0aW9uX3R5cGUFdWludDhaB2FkdmFuY2UAAgZyZXZlYWwGc3RyaW5nBmNvbW1pdAtjaGVja3N1bTI1NgxidXljb250YWluZXIAAwdhY2NvdW50BG5hbWUHc2hpcF9pZAZ1aW50NjQEbmFtZQZzdHJpbmcIYnV5aXRlbXMABAtlbnRpdHlfdHlwZQRuYW1lAmlkBnVpbnQ2NAdpdGVtX2lkBnVpbnQxNghxdWFudGl0eQZ1aW50MzIHYnV5c2hpcAACB2FjY291bnQEbmFtZQRuYW1lBnN0cmluZwxidXl3YXJlaG91c2UAAwdhY2NvdW50BG5hbWUHc2hpcF9pZAZ1aW50NjQEbmFtZQZzdHJpbmcGY2FuY2VsAAMLZW50aXR5X3R5cGUEbmFtZQJpZAZ1aW50NjQFY291bnQGdWludDY0DmNhbmNlbF9yZXN1bHRzAAYJZW50aXR5X2lkBnVpbnQ2NAtlbnRpdHlfdHlwZQRuYW1lD2NhbmNlbGxlZF9jb3VudAV1aW50OBBzY2hlZHVsZV9zdGFydGVkC3RpbWVfcG9pbnQ/C2VudGl0eWdyb3VwB3VpbnQ2ND8NZ3JvdXBfbWVtYmVycxZCX3ZlY3Rvcl9lbnRpdHlfcmVmX0U/CmNhcmdvX2l0ZW0ABAdpdGVtX2lkBnVpbnQxNghxdWFudGl0eQZ1aW50MzIJdW5pdF9jb3N0BnVpbnQ2NARzZWVkB3VpbnQ2ND8JY2FyZ29fcm93AAYCaWQGdWludDY0CWVudGl0eV9pZAZ1aW50NjQHaXRlbV9pZAZ1aW50NjQIcXVhbnRpdHkGdWludDY0CXVuaXRfY29zdAZ1aW50NjQEc2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Sgx0YXNrX3Jlc3VsdHMAAAAgI3NzVwx0YXNrX3Jlc3VsdHMAAGBuTYqyYgtnYW1lX2NvbmZpZwCwctnlqbJiDWVudGl0eV9pbmZvW10AAPDZ5amyYgtlbnRpdHlfaW5mbwAAAFiq7LJiCml0ZW1zX2luZm8AJnXZIBqzYg1sb2NhdGlvbl9pbmZvAIDJJiEas2IQbG9jYXRpb25fZGVyaXZlZAAA8OcaNbNiC25lYXJieV9pbmZvAAC4yptYs2ILcGxheWVyX2luZm8AwFX5moyzYgxzdGFydGVyX2luZm8AgNTZ3IyzYgxzdHJhdHVtX2RhdGGAlbtGSo2zYhBlbnRpdHlfc3VtbWFyeVtdAKLa5uaq6WUMdGFza19yZXN1bHRzAAAAAADQsGkLY2hlY2tzdW0yNTYAAABAhNKwaQtjaGVja3N1bTUxMgAAAIpd05C6DHRhc2tfcmVzdWx0cwAAAEDtSLG6D3Jlc29sdmVfcmVzdWx0cwAAAFctPM3NDHRhc2tfcmVzdWx0cwAAAABEtc3NDHRhc2tfcmVzdWx0cwAAAAAAUK/hDHRhc2tfcmVzdWx0cw==');
217
217
  const abi = antelope.ABI.from(abiBlob);
218
218
  var Types;
219
219
  (function (Types) {
@@ -229,66 +229,6 @@ var Types;
229
229
  antelope.Struct.type('advance')
230
230
  ], advance);
231
231
  Types.advance = advance;
232
- let buycontainer = class buycontainer extends antelope.Struct {
233
- };
234
- tslib.__decorate([
235
- antelope.Struct.field(antelope.Name)
236
- ], buycontainer.prototype, "account", void 0);
237
- tslib.__decorate([
238
- antelope.Struct.field(antelope.UInt64)
239
- ], buycontainer.prototype, "ship_id", void 0);
240
- tslib.__decorate([
241
- antelope.Struct.field('string')
242
- ], buycontainer.prototype, "name", void 0);
243
- buycontainer = tslib.__decorate([
244
- antelope.Struct.type('buycontainer')
245
- ], buycontainer);
246
- Types.buycontainer = buycontainer;
247
- let buyitems = class buyitems extends antelope.Struct {
248
- };
249
- tslib.__decorate([
250
- antelope.Struct.field(antelope.Name)
251
- ], buyitems.prototype, "entity_type", void 0);
252
- tslib.__decorate([
253
- antelope.Struct.field(antelope.UInt64)
254
- ], buyitems.prototype, "id", void 0);
255
- tslib.__decorate([
256
- antelope.Struct.field(antelope.UInt16)
257
- ], buyitems.prototype, "item_id", void 0);
258
- tslib.__decorate([
259
- antelope.Struct.field(antelope.UInt32)
260
- ], buyitems.prototype, "quantity", void 0);
261
- buyitems = tslib.__decorate([
262
- antelope.Struct.type('buyitems')
263
- ], buyitems);
264
- Types.buyitems = buyitems;
265
- let buyship = class buyship extends antelope.Struct {
266
- };
267
- tslib.__decorate([
268
- antelope.Struct.field(antelope.Name)
269
- ], buyship.prototype, "account", void 0);
270
- tslib.__decorate([
271
- antelope.Struct.field('string')
272
- ], buyship.prototype, "name", void 0);
273
- buyship = tslib.__decorate([
274
- antelope.Struct.type('buyship')
275
- ], buyship);
276
- Types.buyship = buyship;
277
- let buywarehouse = class buywarehouse extends antelope.Struct {
278
- };
279
- tslib.__decorate([
280
- antelope.Struct.field(antelope.Name)
281
- ], buywarehouse.prototype, "account", void 0);
282
- tslib.__decorate([
283
- antelope.Struct.field(antelope.UInt64)
284
- ], buywarehouse.prototype, "ship_id", void 0);
285
- tslib.__decorate([
286
- antelope.Struct.field('string')
287
- ], buywarehouse.prototype, "name", void 0);
288
- buywarehouse = tslib.__decorate([
289
- antelope.Struct.type('buywarehouse')
290
- ], buywarehouse);
291
- Types.buywarehouse = buywarehouse;
292
232
  let cancel = class cancel extends antelope.Struct {
293
233
  };
294
234
  tslib.__decorate([
@@ -348,9 +288,6 @@ var Types;
348
288
  tslib.__decorate([
349
289
  antelope.Struct.field(antelope.UInt32)
350
290
  ], cargo_item.prototype, "quantity", void 0);
351
- tslib.__decorate([
352
- antelope.Struct.field(antelope.UInt64)
353
- ], cargo_item.prototype, "unit_cost", void 0);
354
291
  tslib.__decorate([
355
292
  antelope.Struct.field(antelope.UInt64, { optional: true })
356
293
  ], cargo_item.prototype, "seed", void 0);
@@ -372,9 +309,6 @@ var Types;
372
309
  tslib.__decorate([
373
310
  antelope.Struct.field(antelope.UInt64)
374
311
  ], cargo_row.prototype, "quantity", void 0);
375
- tslib.__decorate([
376
- antelope.Struct.field(antelope.UInt64)
377
- ], cargo_row.prototype, "unit_cost", void 0);
378
312
  tslib.__decorate([
379
313
  antelope.Struct.field(antelope.UInt64)
380
314
  ], cargo_row.prototype, "seed", void 0);
@@ -457,15 +391,6 @@ var Types;
457
391
  antelope.Struct.type('loader_stats')
458
392
  ], loader_stats);
459
393
  Types.loader_stats = loader_stats;
460
- let trade_stats = class trade_stats extends antelope.Struct {
461
- };
462
- tslib.__decorate([
463
- antelope.Struct.field(antelope.UInt16)
464
- ], trade_stats.prototype, "margin", void 0);
465
- trade_stats = tslib.__decorate([
466
- antelope.Struct.type('trade_stats')
467
- ], trade_stats);
468
- Types.trade_stats = trade_stats;
469
394
  let extractor_stats = class extractor_stats extends antelope.Struct {
470
395
  };
471
396
  tslib.__decorate([
@@ -496,6 +421,18 @@ var Types;
496
421
  antelope.Struct.type('warp_stats')
497
422
  ], warp_stats);
498
423
  Types.warp_stats = warp_stats;
424
+ let crafter_stats = class crafter_stats extends antelope.Struct {
425
+ };
426
+ tslib.__decorate([
427
+ antelope.Struct.field(antelope.UInt16)
428
+ ], crafter_stats.prototype, "speed", void 0);
429
+ tslib.__decorate([
430
+ antelope.Struct.field(antelope.UInt16)
431
+ ], crafter_stats.prototype, "drain", void 0);
432
+ crafter_stats = tslib.__decorate([
433
+ antelope.Struct.type('crafter_stats')
434
+ ], crafter_stats);
435
+ Types.crafter_stats = crafter_stats;
499
436
  let entity_defaults = class entity_defaults extends antelope.Struct {
500
437
  };
501
438
  tslib.__decorate([
@@ -519,15 +456,15 @@ var Types;
519
456
  tslib.__decorate([
520
457
  antelope.Struct.field(loader_stats)
521
458
  ], entity_defaults.prototype, "ship_loaders", void 0);
522
- tslib.__decorate([
523
- antelope.Struct.field(trade_stats)
524
- ], entity_defaults.prototype, "ship_trade", void 0);
525
459
  tslib.__decorate([
526
460
  antelope.Struct.field(extractor_stats)
527
461
  ], entity_defaults.prototype, "ship_extractor", void 0);
528
462
  tslib.__decorate([
529
463
  antelope.Struct.field(warp_stats)
530
464
  ], entity_defaults.prototype, "ship_warp", void 0);
465
+ tslib.__decorate([
466
+ antelope.Struct.field(crafter_stats)
467
+ ], entity_defaults.prototype, "ship_crafter", void 0);
531
468
  tslib.__decorate([
532
469
  antelope.Struct.field(antelope.UInt32)
533
470
  ], entity_defaults.prototype, "warehouse_capacity", void 0);
@@ -555,9 +492,6 @@ var Types;
555
492
  tslib.__decorate([
556
493
  antelope.Struct.field(antelope.UInt16)
557
494
  ], item_def.prototype, "id", void 0);
558
- tslib.__decorate([
559
- antelope.Struct.field(antelope.UInt32)
560
- ], item_def.prototype, "base_price", void 0);
561
495
  tslib.__decorate([
562
496
  antelope.Struct.field(antelope.UInt32)
563
497
  ], item_def.prototype, "mass", void 0);
@@ -627,9 +561,6 @@ var Types;
627
561
  tslib.__decorate([
628
562
  antelope.Struct.field(antelope.UInt64, { optional: true })
629
563
  ], task.prototype, "entitygroup", void 0);
630
- tslib.__decorate([
631
- antelope.Struct.field(antelope.Int64, { optional: true })
632
- ], task.prototype, "credits", void 0);
633
564
  tslib.__decorate([
634
565
  antelope.Struct.field(antelope.UInt16, { optional: true })
635
566
  ], task.prototype, "energy_cost", void 0);
@@ -679,6 +610,69 @@ var Types;
679
610
  antelope.Struct.type('container_row')
680
611
  ], container_row);
681
612
  Types.container_row = container_row;
613
+ let craft = class craft extends antelope.Struct {
614
+ };
615
+ tslib.__decorate([
616
+ antelope.Struct.field(antelope.Name)
617
+ ], craft.prototype, "entity_type", void 0);
618
+ tslib.__decorate([
619
+ antelope.Struct.field(antelope.UInt64)
620
+ ], craft.prototype, "id", void 0);
621
+ tslib.__decorate([
622
+ antelope.Struct.field(antelope.UInt16)
623
+ ], craft.prototype, "recipe_id", void 0);
624
+ tslib.__decorate([
625
+ antelope.Struct.field(antelope.UInt32)
626
+ ], craft.prototype, "quantity", void 0);
627
+ tslib.__decorate([
628
+ antelope.Struct.field(cargo_item, { array: true })
629
+ ], craft.prototype, "inputs", void 0);
630
+ craft = tslib.__decorate([
631
+ antelope.Struct.type('craft')
632
+ ], craft);
633
+ Types.craft = craft;
634
+ let createentity = class createentity extends antelope.Struct {
635
+ };
636
+ tslib.__decorate([
637
+ antelope.Struct.field(antelope.Name)
638
+ ], createentity.prototype, "owner", void 0);
639
+ tslib.__decorate([
640
+ antelope.Struct.field(antelope.Name)
641
+ ], createentity.prototype, "entity_type", void 0);
642
+ tslib.__decorate([
643
+ antelope.Struct.field('string')
644
+ ], createentity.prototype, "entity_name", void 0);
645
+ tslib.__decorate([
646
+ antelope.Struct.field(antelope.Int64)
647
+ ], createentity.prototype, "x", void 0);
648
+ tslib.__decorate([
649
+ antelope.Struct.field(antelope.Int64)
650
+ ], createentity.prototype, "y", void 0);
651
+ createentity = tslib.__decorate([
652
+ antelope.Struct.type('createentity')
653
+ ], createentity);
654
+ Types.createentity = createentity;
655
+ let deploy = class deploy extends antelope.Struct {
656
+ };
657
+ tslib.__decorate([
658
+ antelope.Struct.field(antelope.Name)
659
+ ], deploy.prototype, "entity_type", void 0);
660
+ tslib.__decorate([
661
+ antelope.Struct.field(antelope.UInt64)
662
+ ], deploy.prototype, "id", void 0);
663
+ tslib.__decorate([
664
+ antelope.Struct.field(antelope.UInt16)
665
+ ], deploy.prototype, "packed_item_id", void 0);
666
+ tslib.__decorate([
667
+ antelope.Struct.field(antelope.UInt64)
668
+ ], deploy.prototype, "seed", void 0);
669
+ tslib.__decorate([
670
+ antelope.Struct.field('string')
671
+ ], deploy.prototype, "entity_name", void 0);
672
+ deploy = tslib.__decorate([
673
+ antelope.Struct.type('deploy')
674
+ ], deploy);
675
+ Types.deploy = deploy;
682
676
  let enable = class enable extends antelope.Struct {
683
677
  };
684
678
  tslib.__decorate([
@@ -747,6 +741,9 @@ var Types;
747
741
  tslib.__decorate([
748
742
  antelope.Struct.field(warp_stats, { optional: true })
749
743
  ], entity_info.prototype, "warp", void 0);
744
+ tslib.__decorate([
745
+ antelope.Struct.field(crafter_stats, { optional: true })
746
+ ], entity_info.prototype, "crafter", void 0);
750
747
  tslib.__decorate([
751
748
  antelope.Struct.field('bool')
752
749
  ], entity_info.prototype, "is_idle", void 0);
@@ -1081,27 +1078,6 @@ var Types;
1081
1078
  antelope.Struct.type('location_derived')
1082
1079
  ], location_derived);
1083
1080
  Types.location_derived = location_derived;
1084
- let location_item = class location_item extends antelope.Struct {
1085
- };
1086
- tslib.__decorate([
1087
- antelope.Struct.field(antelope.UInt16)
1088
- ], location_item.prototype, "id", void 0);
1089
- tslib.__decorate([
1090
- antelope.Struct.field(antelope.UInt32)
1091
- ], location_item.prototype, "price", void 0);
1092
- tslib.__decorate([
1093
- antelope.Struct.field(antelope.UInt16)
1094
- ], location_item.prototype, "supply", void 0);
1095
- tslib.__decorate([
1096
- antelope.Struct.field(antelope.UInt32)
1097
- ], location_item.prototype, "rarity_multiplier", void 0);
1098
- tslib.__decorate([
1099
- antelope.Struct.field(antelope.UInt32)
1100
- ], location_item.prototype, "location_multiplier", void 0);
1101
- location_item = tslib.__decorate([
1102
- antelope.Struct.type('location_item')
1103
- ], location_item);
1104
- Types.location_item = location_item;
1105
1081
  let location_info = class location_info extends antelope.Struct {
1106
1082
  };
1107
1083
  tslib.__decorate([
@@ -1110,9 +1086,6 @@ var Types;
1110
1086
  tslib.__decorate([
1111
1087
  antelope.Struct.field('bool')
1112
1088
  ], location_info.prototype, "is_system", void 0);
1113
- tslib.__decorate([
1114
- antelope.Struct.field(location_item, { array: true })
1115
- ], location_info.prototype, "items", void 0);
1116
1089
  location_info = tslib.__decorate([
1117
1090
  antelope.Struct.type('location_info')
1118
1091
  ], location_info);
@@ -1222,18 +1195,6 @@ var Types;
1222
1195
  antelope.Struct.type('notify')
1223
1196
  ], notify);
1224
1197
  Types.notify = notify;
1225
- let payloan = class payloan extends antelope.Struct {
1226
- };
1227
- tslib.__decorate([
1228
- antelope.Struct.field(antelope.Name)
1229
- ], payloan.prototype, "account", void 0);
1230
- tslib.__decorate([
1231
- antelope.Struct.field(antelope.UInt64)
1232
- ], payloan.prototype, "amount", void 0);
1233
- payloan = tslib.__decorate([
1234
- antelope.Struct.type('payloan')
1235
- ], payloan);
1236
- Types.payloan = payloan;
1237
1198
  let player_info = class player_info extends antelope.Struct {
1238
1199
  };
1239
1200
  tslib.__decorate([
@@ -1245,27 +1206,6 @@ var Types;
1245
1206
  tslib.__decorate([
1246
1207
  antelope.Struct.field('string')
1247
1208
  ], player_info.prototype, "company_name", void 0);
1248
- tslib.__decorate([
1249
- antelope.Struct.field(antelope.UInt64)
1250
- ], player_info.prototype, "balance", void 0);
1251
- tslib.__decorate([
1252
- antelope.Struct.field(antelope.UInt32)
1253
- ], player_info.prototype, "debt", void 0);
1254
- tslib.__decorate([
1255
- antelope.Struct.field(antelope.Int64)
1256
- ], player_info.prototype, "networth", void 0);
1257
- tslib.__decorate([
1258
- antelope.Struct.field(antelope.UInt64)
1259
- ], player_info.prototype, "available_loan", void 0);
1260
- tslib.__decorate([
1261
- antelope.Struct.field(antelope.UInt64)
1262
- ], player_info.prototype, "next_ship_price", void 0);
1263
- tslib.__decorate([
1264
- antelope.Struct.field(antelope.UInt64)
1265
- ], player_info.prototype, "next_warehouse_price", void 0);
1266
- tslib.__decorate([
1267
- antelope.Struct.field(antelope.UInt64)
1268
- ], player_info.prototype, "next_container_price", void 0);
1269
1209
  tslib.__decorate([
1270
1210
  antelope.Struct.field(antelope.UInt64)
1271
1211
  ], player_info.prototype, "ship_count", void 0);
@@ -1284,28 +1224,10 @@ var Types;
1284
1224
  tslib.__decorate([
1285
1225
  antelope.Struct.field(antelope.Name)
1286
1226
  ], player_row.prototype, "owner", void 0);
1287
- tslib.__decorate([
1288
- antelope.Struct.field(antelope.UInt64)
1289
- ], player_row.prototype, "balance", void 0);
1290
- tslib.__decorate([
1291
- antelope.Struct.field(antelope.UInt32)
1292
- ], player_row.prototype, "debt", void 0);
1293
- tslib.__decorate([
1294
- antelope.Struct.field(antelope.Int64)
1295
- ], player_row.prototype, "networth", void 0);
1296
1227
  player_row = tslib.__decorate([
1297
1228
  antelope.Struct.type('player_row')
1298
1229
  ], player_row);
1299
1230
  Types.player_row = player_row;
1300
- let purgesupply = class purgesupply extends antelope.Struct {
1301
- };
1302
- tslib.__decorate([
1303
- antelope.Struct.field(antelope.UInt64, { optional: true })
1304
- ], purgesupply.prototype, "max_rows", void 0);
1305
- purgesupply = tslib.__decorate([
1306
- antelope.Struct.type('purgesupply')
1307
- ], purgesupply);
1308
- Types.purgesupply = purgesupply;
1309
1231
  let recharge = class recharge extends antelope.Struct {
1310
1232
  };
1311
1233
  tslib.__decorate([
@@ -1393,24 +1315,6 @@ var Types;
1393
1315
  antelope.Struct.type('salt')
1394
1316
  ], salt);
1395
1317
  Types.salt = salt;
1396
- let sellitems = class sellitems extends antelope.Struct {
1397
- };
1398
- tslib.__decorate([
1399
- antelope.Struct.field(antelope.Name)
1400
- ], sellitems.prototype, "entity_type", void 0);
1401
- tslib.__decorate([
1402
- antelope.Struct.field(antelope.UInt64)
1403
- ], sellitems.prototype, "id", void 0);
1404
- tslib.__decorate([
1405
- antelope.Struct.field(antelope.UInt16)
1406
- ], sellitems.prototype, "item_id", void 0);
1407
- tslib.__decorate([
1408
- antelope.Struct.field(antelope.UInt32)
1409
- ], sellitems.prototype, "quantity", void 0);
1410
- sellitems = tslib.__decorate([
1411
- antelope.Struct.type('sellitems')
1412
- ], sellitems);
1413
- Types.sellitems = sellitems;
1414
1318
  let sequence_row = class sequence_row extends antelope.Struct {
1415
1319
  };
1416
1320
  tslib.__decorate([
@@ -1458,15 +1362,15 @@ var Types;
1458
1362
  tslib.__decorate([
1459
1363
  antelope.Struct.field(loader_stats)
1460
1364
  ], ship_row.prototype, "loaders", void 0);
1461
- tslib.__decorate([
1462
- antelope.Struct.field(trade_stats, { optional: true })
1463
- ], ship_row.prototype, "trade", void 0);
1464
1365
  tslib.__decorate([
1465
1366
  antelope.Struct.field(extractor_stats, { optional: true })
1466
1367
  ], ship_row.prototype, "extractor", void 0);
1467
1368
  tslib.__decorate([
1468
1369
  antelope.Struct.field(warp_stats, { optional: true })
1469
1370
  ], ship_row.prototype, "warp", void 0);
1371
+ tslib.__decorate([
1372
+ antelope.Struct.field(crafter_stats, { optional: true })
1373
+ ], ship_row.prototype, "crafter", void 0);
1470
1374
  tslib.__decorate([
1471
1375
  antelope.Struct.field(schedule, { optional: true })
1472
1376
  ], ship_row.prototype, "schedule", void 0);
@@ -1474,14 +1378,23 @@ var Types;
1474
1378
  antelope.Struct.type('ship_row')
1475
1379
  ], ship_row);
1476
1380
  Types.ship_row = ship_row;
1477
- let starter_info = class starter_info extends antelope.Struct {
1381
+ let spawncargo = class spawncargo extends antelope.Struct {
1478
1382
  };
1479
1383
  tslib.__decorate([
1480
1384
  antelope.Struct.field(antelope.UInt64)
1481
- ], starter_info.prototype, "balance", void 0);
1385
+ ], spawncargo.prototype, "entity_id", void 0);
1386
+ tslib.__decorate([
1387
+ antelope.Struct.field(antelope.UInt64)
1388
+ ], spawncargo.prototype, "item_id", void 0);
1482
1389
  tslib.__decorate([
1483
1390
  antelope.Struct.field(antelope.UInt64)
1484
- ], starter_info.prototype, "debt", void 0);
1391
+ ], spawncargo.prototype, "quantity", void 0);
1392
+ spawncargo = tslib.__decorate([
1393
+ antelope.Struct.type('spawncargo')
1394
+ ], spawncargo);
1395
+ Types.spawncargo = spawncargo;
1396
+ let starter_info = class starter_info extends antelope.Struct {
1397
+ };
1485
1398
  tslib.__decorate([
1486
1399
  antelope.Struct.field(entity_info)
1487
1400
  ], starter_info.prototype, "ship", void 0);
@@ -1543,39 +1456,6 @@ var Types;
1543
1456
  antelope.Struct.type('stratum_data')
1544
1457
  ], stratum_data);
1545
1458
  Types.stratum_data = stratum_data;
1546
- let supply_row = class supply_row extends antelope.Struct {
1547
- };
1548
- tslib.__decorate([
1549
- antelope.Struct.field(antelope.UInt64)
1550
- ], supply_row.prototype, "id", void 0);
1551
- tslib.__decorate([
1552
- antelope.Struct.field(coordinates)
1553
- ], supply_row.prototype, "coordinates", void 0);
1554
- tslib.__decorate([
1555
- antelope.Struct.field(antelope.UInt64)
1556
- ], supply_row.prototype, "epoch", void 0);
1557
- tslib.__decorate([
1558
- antelope.Struct.field(antelope.UInt16)
1559
- ], supply_row.prototype, "item_id", void 0);
1560
- tslib.__decorate([
1561
- antelope.Struct.field(antelope.UInt16)
1562
- ], supply_row.prototype, "supply", void 0);
1563
- supply_row = tslib.__decorate([
1564
- antelope.Struct.type('supply_row')
1565
- ], supply_row);
1566
- Types.supply_row = supply_row;
1567
- let takeloan = class takeloan extends antelope.Struct {
1568
- };
1569
- tslib.__decorate([
1570
- antelope.Struct.field(antelope.Name)
1571
- ], takeloan.prototype, "account", void 0);
1572
- tslib.__decorate([
1573
- antelope.Struct.field(antelope.UInt64)
1574
- ], takeloan.prototype, "amount", void 0);
1575
- takeloan = tslib.__decorate([
1576
- antelope.Struct.type('takeloan')
1577
- ], takeloan);
1578
- Types.takeloan = takeloan;
1579
1459
  let task_results = class task_results extends antelope.Struct {
1580
1460
  };
1581
1461
  tslib.__decorate([
@@ -1648,30 +1528,6 @@ var Types;
1648
1528
  antelope.Struct.type('types_row')
1649
1529
  ], types_row);
1650
1530
  Types.types_row = types_row;
1651
- let updatecredit = class updatecredit extends antelope.Struct {
1652
- };
1653
- tslib.__decorate([
1654
- antelope.Struct.field(antelope.Name)
1655
- ], updatecredit.prototype, "account", void 0);
1656
- tslib.__decorate([
1657
- antelope.Struct.field(antelope.Int64)
1658
- ], updatecredit.prototype, "amount", void 0);
1659
- updatecredit = tslib.__decorate([
1660
- antelope.Struct.type('updatecredit')
1661
- ], updatecredit);
1662
- Types.updatecredit = updatecredit;
1663
- let updatedebt = class updatedebt extends antelope.Struct {
1664
- };
1665
- tslib.__decorate([
1666
- antelope.Struct.field(antelope.Name)
1667
- ], updatedebt.prototype, "account", void 0);
1668
- tslib.__decorate([
1669
- antelope.Struct.field(antelope.Int64)
1670
- ], updatedebt.prototype, "amount", void 0);
1671
- updatedebt = tslib.__decorate([
1672
- antelope.Struct.type('updatedebt')
1673
- ], updatedebt);
1674
- Types.updatedebt = updatedebt;
1675
1531
  let warehouse_row = class warehouse_row extends antelope.Struct {
1676
1532
  };
1677
1533
  tslib.__decorate([
@@ -1743,7 +1599,6 @@ const TableMap = {
1743
1599
  sequence: Types.sequence_row,
1744
1600
  ship: Types.ship_row,
1745
1601
  state: Types.state_row,
1746
- supply: Types.supply_row,
1747
1602
  types: Types.types_row,
1748
1603
  warehouse: Types.warehouse_row,
1749
1604
  };
@@ -1852,6 +1707,8 @@ exports.TaskType = void 0;
1852
1707
  TaskType[TaskType["UNLOAD"] = 4] = "UNLOAD";
1853
1708
  TaskType[TaskType["EXTRACT"] = 5] = "EXTRACT";
1854
1709
  TaskType[TaskType["WARP"] = 6] = "WARP";
1710
+ TaskType[TaskType["CRAFT"] = 7] = "CRAFT";
1711
+ TaskType[TaskType["DEPLOY"] = 8] = "DEPLOY";
1855
1712
  })(exports.TaskType || (exports.TaskType = {}));
1856
1713
  exports.LocationType = void 0;
1857
1714
  (function (LocationType) {
@@ -1902,9 +1759,6 @@ tslib.__decorate([
1902
1759
  tslib.__decorate([
1903
1760
  antelope.Struct.field('string')
1904
1761
  ], exports.Item.prototype, "description", void 0);
1905
- tslib.__decorate([
1906
- antelope.Struct.field(antelope.UInt32)
1907
- ], exports.Item.prototype, "base_price", void 0);
1908
1762
  tslib.__decorate([
1909
1763
  antelope.Struct.field(antelope.UInt32)
1910
1764
  ], exports.Item.prototype, "mass", void 0);
@@ -1920,23 +1774,6 @@ tslib.__decorate([
1920
1774
  exports.Item = tslib.__decorate([
1921
1775
  antelope.Struct.type('item')
1922
1776
  ], exports.Item);
1923
- exports.ItemPrice = class ItemPrice extends antelope.Struct {
1924
- };
1925
- tslib.__decorate([
1926
- antelope.Struct.field(antelope.UInt16)
1927
- ], exports.ItemPrice.prototype, "id", void 0);
1928
- tslib.__decorate([
1929
- antelope.Struct.field(exports.Item)
1930
- ], exports.ItemPrice.prototype, "item", void 0);
1931
- tslib.__decorate([
1932
- antelope.Struct.field(antelope.UInt32)
1933
- ], exports.ItemPrice.prototype, "price", void 0);
1934
- tslib.__decorate([
1935
- antelope.Struct.field(antelope.UInt16)
1936
- ], exports.ItemPrice.prototype, "supply", void 0);
1937
- exports.ItemPrice = tslib.__decorate([
1938
- antelope.Struct.type('ItemPrice')
1939
- ], exports.ItemPrice);
1940
1777
 
1941
1778
  function getCurrentEpoch(game) {
1942
1779
  const current = new Date().getTime();
@@ -1965,91 +1802,233 @@ function hash512(seed, string) {
1965
1802
  return antelope.Checksum512.hash(bytes);
1966
1803
  }
1967
1804
 
1968
- var syllables = [
1969
- "A",
1970
- "Ab",
1971
- "Abl",
1972
- "Abr",
1973
- "Ach",
1974
- "Acr",
1975
- "Ad",
1976
- "Ae",
1977
- "Aed",
1978
- "Aeg",
1979
- "Aek",
1980
- "Ael",
1981
- "Aem",
1982
- "Aen",
1983
- "Aeon",
1984
- "Aep",
1985
- "Aer",
1986
- "Aes",
1987
- "Aesk",
1988
- "Aet",
1989
- "Aev",
1990
- "Ag",
1991
- "Agr",
1992
- "Ahl",
1993
- "Ai",
1994
- "Ail",
1995
- "Ain",
1996
- "Ais",
1997
- "Ak",
1998
- "Aka",
1999
- "Al",
2000
- "Alb",
2001
- "Ald",
2002
- "Alg",
2003
- "Alk",
2004
- "Alm",
2005
- "Alt",
2006
- "Alv",
2007
- "Am",
2008
- "Amb",
2009
- "Ami",
2010
- "Amp",
2011
- "An",
2012
- "Anc",
2013
- "Ang",
2014
- "Ank",
2015
- "Ann",
2016
- "Ant",
2017
- "Ap",
2018
- "Aph",
2019
- "Aqu",
2020
- "Ar",
2021
- "Ara",
2022
- "Arb",
2023
- "Arc",
2024
- "Ard",
2025
- "Arg",
2026
- "Ari",
2027
- "Arl",
2028
- "Arm",
2029
- "Arn",
2030
- "Arr",
2031
- "Ars",
2032
- "Art",
2033
- "As",
2034
- "Asa",
2035
- "Ash",
2036
- "Asp",
2037
- "Ast",
2038
- "Astr",
2039
- "At",
2040
- "Ath",
2041
- "Atr",
2042
- "Aud",
2043
- "Aug",
2044
- "Aul",
2045
- "Aum",
2046
- "Aun",
2047
- "Aur",
2048
- "Aus",
2049
- "Av",
2050
- "Avn",
2051
- "Ax",
2052
- "Ayn",
1805
+ const DEPTH_THRESHOLD_T1 = 0;
1806
+ const DEPTH_THRESHOLD_T2 = 2000;
1807
+ const DEPTH_THRESHOLD_T3 = 10000;
1808
+ const DEPTH_THRESHOLD_T4 = 30000;
1809
+ const DEPTH_THRESHOLD_T5 = 55000;
1810
+ const LOCATION_MIN_DEPTH = 500;
1811
+ const LOCATION_MAX_DEPTH = 65535;
1812
+ const YIELD_THRESHOLD = Math.floor(0.003 * 0xffffffff);
1813
+ const PLANET_SUBTYPE_GAS_GIANT = 0;
1814
+ const PLANET_SUBTYPE_ROCKY = 1;
1815
+ const PLANET_SUBTYPE_TERRESTRIAL = 2;
1816
+ const PLANET_SUBTYPE_ICY = 3;
1817
+ const PLANET_SUBTYPE_OCEAN = 4;
1818
+ const PLANET_SUBTYPE_INDUSTRIAL = 5;
1819
+ const RESOURCE_CATALOG = [
1820
+ { id: 26, tier: 't1' },
1821
+ { id: 13, tier: 't2' },
1822
+ { id: 24, tier: 't3' },
1823
+ { id: 29, tier: 't1' },
1824
+ { id: 47, tier: 't2' },
1825
+ { id: 79, tier: 't3' },
1826
+ { id: 1, tier: 't1' },
1827
+ { id: 2, tier: 't2' },
1828
+ { id: 18, tier: 't3' },
1829
+ { id: 14, tier: 't1' },
1830
+ { id: 1000, tier: 't2' },
1831
+ { id: 1001, tier: 't3' },
1832
+ { id: 6, tier: 't1' },
1833
+ { id: 1003, tier: 't2' },
1834
+ { id: 1002, tier: 't3' },
1835
+ ];
1836
+ function getDepthThreshold(tier) {
1837
+ switch (tier) {
1838
+ case 't1':
1839
+ return DEPTH_THRESHOLD_T1;
1840
+ case 't2':
1841
+ return DEPTH_THRESHOLD_T2;
1842
+ case 't3':
1843
+ return DEPTH_THRESHOLD_T3;
1844
+ case 't4':
1845
+ return DEPTH_THRESHOLD_T4;
1846
+ case 't5':
1847
+ return DEPTH_THRESHOLD_T5;
1848
+ }
1849
+ }
1850
+ function getResourceTier(itemId) {
1851
+ const entry = RESOURCE_CATALOG.find((r) => r.id === itemId);
1852
+ return entry ? entry.tier : 't5';
1853
+ }
1854
+ function getResourceWeight(itemId, stratum) {
1855
+ const tier = getResourceTier(itemId);
1856
+ const threshold = getDepthThreshold(tier);
1857
+ if (stratum < threshold)
1858
+ return 0;
1859
+ const depthAbove = stratum - threshold;
1860
+ switch (tier) {
1861
+ case 't1':
1862
+ if (stratum < 2000)
1863
+ return 100;
1864
+ if (stratum < 10000)
1865
+ return 80;
1866
+ if (stratum < 30000)
1867
+ return 50;
1868
+ return 30;
1869
+ case 't2':
1870
+ if (depthAbove < 3000)
1871
+ return 40;
1872
+ if (depthAbove < 8000)
1873
+ return 60;
1874
+ return 50;
1875
+ case 't3':
1876
+ if (depthAbove < 5000)
1877
+ return 20;
1878
+ if (depthAbove < 15000)
1879
+ return 35;
1880
+ return 40;
1881
+ case 't4':
1882
+ if (depthAbove < 10000)
1883
+ return 10;
1884
+ if (depthAbove < 25000)
1885
+ return 20;
1886
+ return 30;
1887
+ case 't5':
1888
+ return 10;
1889
+ }
1890
+ }
1891
+ const ASTEROID_RESOURCES = [26, 13, 24, 29, 47];
1892
+ const NEBULA_RESOURCES = [47, 79, 1, 2, 18];
1893
+ const GAS_GIANT_RESOURCES = [1, 2, 18, 14, 6];
1894
+ const ROCKY_RESOURCES = [26, 13, 24, 14, 1000, 1001, 1002];
1895
+ const TERRESTRIAL_RESOURCES = [29, 47, 14, 1000, 6, 1003, 1002];
1896
+ const ICY_RESOURCES = [26, 1, 2, 14, 1001, 6, 1003];
1897
+ const OCEAN_RESOURCES = [29, 79, 1, 18, 6, 1003, 1002];
1898
+ const INDUSTRIAL_RESOURCES = [26, 13, 24, 29, 79, 1000, 1001];
1899
+ function getLocationCandidates(locationType, subtype) {
1900
+ if (locationType === 2)
1901
+ return ASTEROID_RESOURCES;
1902
+ if (locationType === 3)
1903
+ return NEBULA_RESOURCES;
1904
+ if (locationType === 1) {
1905
+ switch (subtype) {
1906
+ case PLANET_SUBTYPE_GAS_GIANT:
1907
+ return GAS_GIANT_RESOURCES;
1908
+ case PLANET_SUBTYPE_ROCKY:
1909
+ return ROCKY_RESOURCES;
1910
+ case PLANET_SUBTYPE_TERRESTRIAL:
1911
+ return TERRESTRIAL_RESOURCES;
1912
+ case PLANET_SUBTYPE_ICY:
1913
+ return ICY_RESOURCES;
1914
+ case PLANET_SUBTYPE_OCEAN:
1915
+ return OCEAN_RESOURCES;
1916
+ case PLANET_SUBTYPE_INDUSTRIAL:
1917
+ return INDUSTRIAL_RESOURCES;
1918
+ }
1919
+ }
1920
+ return [];
1921
+ }
1922
+ function getEligibleResources(locationType, subtype, stratum) {
1923
+ const candidates = getLocationCandidates(locationType, subtype);
1924
+ return candidates.filter((itemId) => {
1925
+ const tier = getResourceTier(itemId);
1926
+ const threshold = getDepthThreshold(tier);
1927
+ return stratum >= threshold;
1928
+ });
1929
+ }
1930
+ function depthScaleFactor(stratum) {
1931
+ if (stratum <= 1)
1932
+ return 1.0;
1933
+ const logScale = Math.log(stratum) / Math.log(65535);
1934
+ return 1.0 + logScale * 2.0;
1935
+ }
1936
+
1937
+ function deriveLocationSize(loc) {
1938
+ if (loc.type.toNumber() === exports.LocationType.EMPTY)
1939
+ return 0;
1940
+ const raw = (loc.seed0.toNumber() << 8) | loc.seed1.toNumber();
1941
+ const normalized = raw / 65535;
1942
+ const curved = Math.pow(normalized, 3.0);
1943
+ const range = LOCATION_MAX_DEPTH - LOCATION_MIN_DEPTH;
1944
+ return Math.floor(LOCATION_MIN_DEPTH + curved * range);
1945
+ }
1946
+
1947
+ var syllables = [
1948
+ "A",
1949
+ "Ab",
1950
+ "Abl",
1951
+ "Abr",
1952
+ "Ach",
1953
+ "Acr",
1954
+ "Ad",
1955
+ "Ae",
1956
+ "Aed",
1957
+ "Aeg",
1958
+ "Aek",
1959
+ "Ael",
1960
+ "Aem",
1961
+ "Aen",
1962
+ "Aeon",
1963
+ "Aep",
1964
+ "Aer",
1965
+ "Aes",
1966
+ "Aesk",
1967
+ "Aet",
1968
+ "Aev",
1969
+ "Ag",
1970
+ "Agr",
1971
+ "Ahl",
1972
+ "Ai",
1973
+ "Ail",
1974
+ "Ain",
1975
+ "Ais",
1976
+ "Ak",
1977
+ "Aka",
1978
+ "Al",
1979
+ "Alb",
1980
+ "Ald",
1981
+ "Alg",
1982
+ "Alk",
1983
+ "Alm",
1984
+ "Alt",
1985
+ "Alv",
1986
+ "Am",
1987
+ "Amb",
1988
+ "Ami",
1989
+ "Amp",
1990
+ "An",
1991
+ "Anc",
1992
+ "Ang",
1993
+ "Ank",
1994
+ "Ann",
1995
+ "Ant",
1996
+ "Ap",
1997
+ "Aph",
1998
+ "Aqu",
1999
+ "Ar",
2000
+ "Ara",
2001
+ "Arb",
2002
+ "Arc",
2003
+ "Ard",
2004
+ "Arg",
2005
+ "Ari",
2006
+ "Arl",
2007
+ "Arm",
2008
+ "Arn",
2009
+ "Arr",
2010
+ "Ars",
2011
+ "Art",
2012
+ "As",
2013
+ "Asa",
2014
+ "Ash",
2015
+ "Asp",
2016
+ "Ast",
2017
+ "Astr",
2018
+ "At",
2019
+ "Ath",
2020
+ "Atr",
2021
+ "Aud",
2022
+ "Aug",
2023
+ "Aul",
2024
+ "Aum",
2025
+ "Aun",
2026
+ "Aur",
2027
+ "Aus",
2028
+ "Av",
2029
+ "Avn",
2030
+ "Ax",
2031
+ "Ayn",
2053
2032
  "Az",
2054
2033
  "Aza",
2055
2034
  "Ba",
@@ -4211,9 +4190,7 @@ function deriveLocationStatic(gameSeed, coordinates) {
4211
4190
  else {
4212
4191
  loc.type = antelope.UInt8.from(exports.LocationType.NEBULA);
4213
4192
  }
4214
- loc.subtype = antelope.UInt8.from(Number(loc.type) === exports.LocationType.PLANET
4215
- ? hashResult.array[2] % 6
4216
- : hashResult.array[2]);
4193
+ loc.subtype = antelope.UInt8.from(Number(loc.type) === exports.LocationType.PLANET ? hashResult.array[2] % 6 : hashResult.array[2]);
4217
4194
  loc.seed0 = antelope.UInt8.from(hashResult.array[3]);
4218
4195
  loc.seed1 = antelope.UInt8.from(hashResult.array[4]);
4219
4196
  return loc;
@@ -4230,9 +4207,11 @@ function deriveLocationEpoch(epochSeed, coordinates) {
4230
4207
  });
4231
4208
  }
4232
4209
  function deriveLocation(gameSeed, epochSeed, coordinates) {
4210
+ const staticProps = deriveLocationStatic(gameSeed, coordinates);
4233
4211
  return Types.location_derived.from({
4234
- static_props: deriveLocationStatic(gameSeed, coordinates),
4212
+ static_props: staticProps,
4235
4213
  epoch_props: deriveLocationEpoch(epochSeed, coordinates),
4214
+ size: deriveLocationSize(staticProps),
4236
4215
  });
4237
4216
  }
4238
4217
 
@@ -4334,7 +4313,6 @@ var itemsData = [
4334
4313
  id: 26,
4335
4314
  name: "Iron",
4336
4315
  description: "A versatile metal used in hulls and structures.",
4337
- base_price: 125,
4338
4316
  mass: 40000,
4339
4317
  category: "metal",
4340
4318
  tier: "t1",
@@ -4344,7 +4322,6 @@ var itemsData = [
4344
4322
  id: 13,
4345
4323
  name: "Aluminum",
4346
4324
  description: "A lightweight metal for structural components.",
4347
- base_price: 175,
4348
4325
  mass: 27000,
4349
4326
  category: "metal",
4350
4327
  tier: "t2",
@@ -4354,7 +4331,6 @@ var itemsData = [
4354
4331
  id: 24,
4355
4332
  name: "Chromium",
4356
4333
  description: "A hard, corrosion-resistant alloy metal.",
4357
- base_price: 350,
4358
4334
  mass: 52000,
4359
4335
  category: "metal",
4360
4336
  tier: "t3",
@@ -4364,7 +4340,6 @@ var itemsData = [
4364
4340
  id: 29,
4365
4341
  name: "Copper",
4366
4342
  description: "A conductive metal for electronics and wiring.",
4367
- base_price: 100,
4368
4343
  mass: 60000,
4369
4344
  category: "precious",
4370
4345
  tier: "t1",
@@ -4374,7 +4349,6 @@ var itemsData = [
4374
4349
  id: 47,
4375
4350
  name: "Silver",
4376
4351
  description: "A high-conductivity metal for precision components.",
4377
- base_price: 300,
4378
4352
  mass: 55000,
4379
4353
  category: "precious",
4380
4354
  tier: "t2",
@@ -4384,7 +4358,6 @@ var itemsData = [
4384
4358
  id: 79,
4385
4359
  name: "Gold",
4386
4360
  description: "A corrosion-proof metal for advanced electronics.",
4387
- base_price: 500,
4388
4361
  mass: 70000,
4389
4362
  category: "precious",
4390
4363
  tier: "t3",
@@ -4394,7 +4367,6 @@ var itemsData = [
4394
4367
  id: 1,
4395
4368
  name: "Hydrogen",
4396
4369
  description: "A lightweight gas used for fuel cells and propulsion.",
4397
- base_price: 50,
4398
4370
  mass: 15000,
4399
4371
  category: "gas",
4400
4372
  tier: "t1",
@@ -4404,7 +4376,6 @@ var itemsData = [
4404
4376
  id: 2,
4405
4377
  name: "Helium",
4406
4378
  description: "An inert noble gas used in energy systems.",
4407
- base_price: 75,
4408
4379
  mass: 2000,
4409
4380
  category: "gas",
4410
4381
  tier: "t2",
@@ -4414,7 +4385,6 @@ var itemsData = [
4414
4385
  id: 18,
4415
4386
  name: "Argon",
4416
4387
  description: "A noble gas used in industrial and energy applications.",
4417
- base_price: 250,
4418
4388
  mass: 8000,
4419
4389
  category: "gas",
4420
4390
  tier: "t3",
@@ -4424,7 +4394,6 @@ var itemsData = [
4424
4394
  id: 14,
4425
4395
  name: "Silicon",
4426
4396
  description: "A semiconductor used in sensors and computing.",
4427
- base_price: 150,
4428
4397
  mass: 28000,
4429
4398
  category: "mineral",
4430
4399
  tier: "t1",
@@ -4434,7 +4403,6 @@ var itemsData = [
4434
4403
  id: 1000,
4435
4404
  name: "Quartz",
4436
4405
  description: "A crystalline mineral for sensors and optics.",
4437
- base_price: 200,
4438
4406
  mass: 35000,
4439
4407
  category: "mineral",
4440
4408
  tier: "t2",
@@ -4444,7 +4412,6 @@ var itemsData = [
4444
4412
  id: 1001,
4445
4413
  name: "Sapphire",
4446
4414
  description: "A precious crystal for precision instruments.",
4447
- base_price: 400,
4448
4415
  mass: 45000,
4449
4416
  category: "mineral",
4450
4417
  tier: "t3",
@@ -4454,7 +4421,6 @@ var itemsData = [
4454
4421
  id: 6,
4455
4422
  name: "Carbon",
4456
4423
  description: "A versatile element for life support and coatings.",
4457
- base_price: 100,
4458
4424
  mass: 12000,
4459
4425
  category: "organic",
4460
4426
  tier: "t1",
@@ -4464,7 +4430,6 @@ var itemsData = [
4464
4430
  id: 1003,
4465
4431
  name: "Biomass",
4466
4432
  description: "Organic matter for life support systems.",
4467
- base_price: 100,
4468
4433
  mass: 30000,
4469
4434
  category: "organic",
4470
4435
  tier: "t2",
@@ -4474,7 +4439,6 @@ var itemsData = [
4474
4439
  id: 1002,
4475
4440
  name: "Resin",
4476
4441
  description: "A fossilized organic compound for coatings and sealants.",
4477
- base_price: 300,
4478
4442
  mass: 25000,
4479
4443
  category: "organic",
4480
4444
  tier: "t3",
@@ -4486,7 +4450,6 @@ const items = itemsData.map((g) => exports.Item.from({
4486
4450
  id: g.id,
4487
4451
  name: g.name,
4488
4452
  description: g.description,
4489
- base_price: g.base_price,
4490
4453
  mass: g.mass,
4491
4454
  category: g.category,
4492
4455
  tier: g.tier,
@@ -4797,9 +4760,6 @@ function capsHasStorage(caps) {
4797
4760
  function capsHasLoaders(caps) {
4798
4761
  return caps.loaders !== undefined;
4799
4762
  }
4800
- function capsHasTrade(caps) {
4801
- return caps.trade !== undefined;
4802
- }
4803
4763
  function capsHasExtractor(caps) {
4804
4764
  return caps.extractor !== undefined;
4805
4765
  }
@@ -4815,13 +4775,6 @@ function calcCargoMass(entity) {
4815
4775
  }
4816
4776
  return mass;
4817
4777
  }
4818
- function calcCargoValue(entity) {
4819
- let value = antelope.UInt64.from(0);
4820
- for (const item of entity.cargo) {
4821
- value = value.adding(item.unit_cost.multiplying(item.quantity));
4822
- }
4823
- return value;
4824
- }
4825
4778
  function availableCapacity$1(entity) {
4826
4779
  const cargoMass = calcCargoMass(entity);
4827
4780
  return entity.capacity.gt(cargoMass)
@@ -5018,7 +4971,6 @@ function createProjectedEntity(entity) {
5018
4971
  const loaders = entity.loaders;
5019
4972
  const engines = entity.engines;
5020
4973
  const generator = entity.generator;
5021
- const trade = entity.trade;
5022
4974
  const capacity = entity.capacity;
5023
4975
  const projected = {
5024
4976
  location: Coordinates.from(entity.coordinates),
@@ -5029,7 +4981,6 @@ function createProjectedEntity(entity) {
5029
4981
  engines,
5030
4982
  generator,
5031
4983
  loaders,
5032
- trade,
5033
4984
  get totalMass() {
5034
4985
  let mass = antelope.UInt64.from(this.shipMass).adding(this.cargoMass);
5035
4986
  if (this.loaders) {
@@ -5046,9 +4997,6 @@ function createProjectedEntity(entity) {
5046
4997
  hasLoaders() {
5047
4998
  return capsHasLoaders(this.capabilities());
5048
4999
  },
5049
- hasTrade() {
5050
- return this.trade !== undefined;
5051
- },
5052
5000
  capabilities() {
5053
5001
  return {
5054
5002
  hullmass: this.shipMass,
@@ -5056,7 +5004,6 @@ function createProjectedEntity(entity) {
5056
5004
  engines: this.engines,
5057
5005
  generator: this.generator,
5058
5006
  loaders: this.loaders,
5059
- trade: this.trade,
5060
5007
  };
5061
5008
  },
5062
5009
  state() {
@@ -5231,17 +5178,6 @@ class Location {
5231
5178
  isExtractableAt(gameSeed) {
5232
5179
  return isExtractableLocation(this.getLocationTypeAt(gameSeed));
5233
5180
  }
5234
- setMarketPrices(prices) {
5235
- this._marketPrices = prices;
5236
- }
5237
- get marketPrices() {
5238
- return this._marketPrices;
5239
- }
5240
- getPrice(goodId) {
5241
- if (!this._marketPrices)
5242
- return undefined;
5243
- return this._marketPrices.find((p) => p.id.equals(goodId));
5244
- }
5245
5181
  findNearby(gameSeed, maxDistance = 20) {
5246
5182
  return findNearbyPlanets(antelope.Checksum256.from(gameSeed), this.coordinates, maxDistance);
5247
5183
  }
@@ -5249,90 +5185,12 @@ class Location {
5249
5185
  const otherCoords = other instanceof Location ? other.coordinates : Coordinates.from(other);
5250
5186
  return this.coordinates.equals(otherCoords);
5251
5187
  }
5252
- setLocationRows(rows, epoch) {
5253
- this._locationRows = rows;
5254
- this._epoch = epoch;
5255
- }
5256
- get locationRows() {
5257
- return this._locationRows;
5258
- }
5259
- getSupply(goodId) {
5260
- if (!this._locationRows)
5261
- return undefined;
5262
- const row = this._locationRows.find((r) => r.item_id.equals(goodId) && this._epoch && r.epoch.equals(this._epoch));
5263
- return row ? row.supply : undefined;
5264
- }
5265
- get availableGoods() {
5266
- if (!this._locationRows)
5267
- return undefined;
5268
- return this._locationRows.filter((r) => this._epoch && r.epoch.equals(this._epoch) && r.supply.gt(antelope.UInt16.from(0)));
5269
- }
5270
- hasGood(goodId) {
5271
- const supply = this.getSupply(goodId);
5272
- return supply !== undefined && supply.gt(antelope.UInt16.from(0));
5273
- }
5274
5188
  get epoch() {
5275
5189
  return this._epoch;
5276
5190
  }
5277
- get hasCachedData() {
5278
- return this._marketPrices !== undefined || this._locationRows !== undefined;
5279
- }
5280
- get hasSupplyData() {
5281
- return this._locationRows !== undefined;
5282
- }
5283
5191
  clearCache() {
5284
- this._marketPrices = undefined;
5285
- this._locationRows = undefined;
5286
5192
  this._epoch = undefined;
5287
5193
  }
5288
- withUpdatedSupply(goodId, quantityDelta) {
5289
- const newLocation = Location.from(this.coordinates);
5290
- if (this._marketPrices) {
5291
- newLocation._marketPrices = this._marketPrices.map((price) => {
5292
- if (price.id.equals(goodId)) {
5293
- const currentSupply = antelope.UInt16.from(price.supply);
5294
- const delta = antelope.UInt16.from(Math.abs(quantityDelta));
5295
- const newSupply = quantityDelta < 0
5296
- ? currentSupply.gte(delta)
5297
- ? currentSupply.subtracting(delta)
5298
- : antelope.UInt16.from(0)
5299
- : currentSupply.adding(quantityDelta);
5300
- return exports.ItemPrice.from({
5301
- id: price.id,
5302
- item: price.item,
5303
- price: price.price,
5304
- supply: newSupply,
5305
- });
5306
- }
5307
- return price;
5308
- });
5309
- }
5310
- if (this._locationRows && this._epoch) {
5311
- newLocation._locationRows = this._locationRows.map((row) => {
5312
- if (row.item_id.equals(goodId) && row.epoch.equals(this._epoch)) {
5313
- const currentSupply = antelope.UInt16.from(row.supply);
5314
- const delta = antelope.UInt16.from(Math.abs(quantityDelta));
5315
- const newSupply = quantityDelta < 0
5316
- ? currentSupply.gte(delta)
5317
- ? currentSupply.subtracting(delta)
5318
- : antelope.UInt16.from(0)
5319
- : currentSupply.adding(quantityDelta);
5320
- return Types.supply_row.from({
5321
- id: row.id,
5322
- coordinates: row.coordinates,
5323
- epoch: row.epoch,
5324
- item_id: row.item_id,
5325
- supply: newSupply,
5326
- });
5327
- }
5328
- return row;
5329
- });
5330
- newLocation._epoch = this._epoch;
5331
- }
5332
- newLocation._gameSeed = this._gameSeed;
5333
- newLocation._hasSystem = this._hasSystem;
5334
- return newLocation;
5335
- }
5336
5194
  }
5337
5195
  function toLocation(coords) {
5338
5196
  if (coords instanceof Location) {
@@ -5420,9 +5278,6 @@ class EntityInventory extends Types.cargo_item {
5420
5278
  get totalMass() {
5421
5279
  return antelope.UInt64.from(this.unitMass).multiplying(this.quantity);
5422
5280
  }
5423
- get totalCost() {
5424
- return this.unit_cost.multiplying(this.quantity);
5425
- }
5426
5281
  get hasCargo() {
5427
5282
  return antelope.UInt32.from(this.quantity).gt(antelope.UInt32.from(0));
5428
5283
  }
@@ -5444,9 +5299,6 @@ class InventoryAccessor {
5444
5299
  get totalMass() {
5445
5300
  return this.items.reduce((sum, c) => sum.adding(c.totalMass), antelope.UInt64.from(0));
5446
5301
  }
5447
- get totalValue() {
5448
- return this.items.reduce((sum, c) => sum.adding(c.totalCost), antelope.UInt64.from(0));
5449
- }
5450
5302
  forItem(goodId) {
5451
5303
  return this.items.find((c) => c.item_id.equals(goodId));
5452
5304
  }
@@ -5483,106 +5335,6 @@ function needsRecharge(entity) {
5483
5335
  return antelope.UInt64.from(entity.energy).lt(entity.generator.capacity);
5484
5336
  }
5485
5337
 
5486
- function totalCargoMass(cargo) {
5487
- return cargo.reduce((sum, c) => {
5488
- return sum.adding(c.totalMass);
5489
- }, antelope.UInt64.from(0));
5490
- }
5491
- function cargoValue(cargo) {
5492
- return cargo.reduce((sum, c) => {
5493
- return sum.adding(c.totalCost);
5494
- }, antelope.UInt64.from(0));
5495
- }
5496
- function getCargoForItem(cargo, goodId) {
5497
- return cargo.find((c) => c.item_id.equals(goodId));
5498
- }
5499
- function hasSpace(currentMass, maxCapacity, goodMass, quantity) {
5500
- const additionalMass = goodMass.multiplying(quantity);
5501
- const totalMass = currentMass.adding(additionalMass);
5502
- return totalMass.lte(maxCapacity);
5503
- }
5504
- function availableCapacity(currentMass, maxCapacity) {
5505
- if (currentMass.gte(maxCapacity)) {
5506
- return antelope.UInt64.from(0);
5507
- }
5508
- return maxCapacity.subtracting(currentMass);
5509
- }
5510
- function isFull(currentMass, maxCapacity) {
5511
- return currentMass.gte(maxCapacity);
5512
- }
5513
- function calculateSaleValue(cargo, prices) {
5514
- if (cargo.length === 0) {
5515
- return { revenue: antelope.UInt64.from(0), profit: antelope.UInt64.from(0), cost: antelope.UInt64.from(0) };
5516
- }
5517
- let revenue = antelope.UInt64.from(0);
5518
- let cost = antelope.UInt64.from(0);
5519
- for (const item of cargo) {
5520
- if (antelope.UInt32.from(item.quantity).equals(antelope.UInt32.from(0)))
5521
- continue;
5522
- const goodId = Number(item.item_id);
5523
- const salePrice = prices.get(goodId);
5524
- if (salePrice) {
5525
- revenue = revenue.adding(salePrice.multiplying(item.quantity));
5526
- }
5527
- cost = cost.adding(item.unit_cost.multiplying(item.quantity));
5528
- }
5529
- const profit = revenue.gte(cost) ? revenue.subtracting(cost) : antelope.UInt64.from(0);
5530
- return {
5531
- revenue,
5532
- profit,
5533
- cost,
5534
- };
5535
- }
5536
- function calculateSaleValueFromArray(cargo, prices) {
5537
- const priceMap = new Map();
5538
- prices.forEach((price, index) => {
5539
- priceMap.set(index, price);
5540
- });
5541
- return calculateSaleValue(cargo, priceMap);
5542
- }
5543
- function afterSellItems(cargo, goodsToSell) {
5544
- if (cargo.length === 0) {
5545
- return [];
5546
- }
5547
- return cargo.map((item) => {
5548
- const saleItem = goodsToSell.find((s) => Number(item.item_id) === s.goodId);
5549
- if (!saleItem) {
5550
- return new EntityInventory(item);
5551
- }
5552
- const currentQty = Number(item.quantity);
5553
- const newQty = Math.max(0, currentQty - saleItem.quantity);
5554
- return new EntityInventory(Types.cargo_item.from({
5555
- item_id: item.item_id,
5556
- quantity: antelope.UInt32.from(newQty),
5557
- unit_cost: item.unit_cost,
5558
- }));
5559
- });
5560
- }
5561
- function afterSellAllItems(cargo) {
5562
- if (cargo.length === 0) {
5563
- return [];
5564
- }
5565
- return cargo.map((item) => new EntityInventory(Types.cargo_item.from({
5566
- item_id: item.item_id,
5567
- quantity: antelope.UInt32.from(0),
5568
- unit_cost: item.unit_cost,
5569
- })));
5570
- }
5571
-
5572
- var cargoUtils = /*#__PURE__*/Object.freeze({
5573
- __proto__: null,
5574
- totalCargoMass: totalCargoMass,
5575
- cargoValue: cargoValue,
5576
- getCargoForItem: getCargoForItem,
5577
- hasSpace: hasSpace,
5578
- availableCapacity: availableCapacity,
5579
- isFull: isFull,
5580
- calculateSaleValue: calculateSaleValue,
5581
- calculateSaleValueFromArray: calculateSaleValueFromArray,
5582
- afterSellItems: afterSellItems,
5583
- afterSellAllItems: afterSellAllItems
5584
- });
5585
-
5586
5338
  class Ship extends Types.entity_info {
5587
5339
  get name() {
5588
5340
  return this.entity_name;
@@ -5649,9 +5401,6 @@ class Ship extends Types.entity_info {
5649
5401
  get totalCargoMass() {
5650
5402
  return this.inv.totalMass;
5651
5403
  }
5652
- get cargoValue() {
5653
- return this.inv.totalValue;
5654
- }
5655
5404
  get totalMass() {
5656
5405
  let mass = antelope.UInt64.from(this.hullmass ?? 0).adding(this.totalCargoMass);
5657
5406
  if (this.loaders) {
@@ -5700,18 +5449,6 @@ class Ship extends Types.entity_info {
5700
5449
  return false;
5701
5450
  return hasEnergyForDistance(this, distance);
5702
5451
  }
5703
- calculateSaleValue(prices) {
5704
- return calculateSaleValue(this.cargo, prices);
5705
- }
5706
- calculateSaleValueFromArray(prices) {
5707
- return calculateSaleValueFromArray(this.cargo, prices);
5708
- }
5709
- afterSellItems(goodsToSell) {
5710
- return afterSellItems(this.cargo, goodsToSell);
5711
- }
5712
- afterSellAllItems() {
5713
- return afterSellAllItems(this.cargo);
5714
- }
5715
5452
  }
5716
5453
 
5717
5454
  class Warehouse extends Types.entity_info {
@@ -5742,9 +5479,6 @@ class Warehouse extends Types.entity_info {
5742
5479
  get totalCargoMass() {
5743
5480
  return this.inv.totalMass;
5744
5481
  }
5745
- get cargoValue() {
5746
- return this.inv.totalValue;
5747
- }
5748
5482
  get maxCapacity() {
5749
5483
  return antelope.UInt64.from(this.capacity);
5750
5484
  }
@@ -5805,6 +5539,17 @@ class Container extends Types.entity_info {
5805
5539
  return this.coordinates.z?.toNumber() || 0;
5806
5540
  }
5807
5541
  }
5542
+ function computeContainerCapabilities(stats) {
5543
+ const density = stats['density'] ?? 500;
5544
+ const strength = stats['strength'] ?? 500;
5545
+ const ductility = stats['ductility'] ?? 500;
5546
+ const purity = stats['purity'] ?? 500;
5547
+ const hullmass = 25000 + 75 * density;
5548
+ const statSum = strength + ductility + purity;
5549
+ const exponent = statSum / 2997;
5550
+ const capacity = Math.floor(1000000 * Math.pow(10, exponent));
5551
+ return { hullmass, capacity };
5552
+ }
5808
5553
 
5809
5554
  class EntitiesManager extends BaseManager {
5810
5555
  async getEntity(type, id) {
@@ -5882,134 +5627,10 @@ class Player extends Types.player_row {
5882
5627
  static fromState(state) {
5883
5628
  const playerRow = Types.player_row.from({
5884
5629
  owner: antelope.Name.from(state.owner),
5885
- balance: antelope.UInt64.from(state.balance),
5886
- debt: antelope.UInt32.from(state.debt),
5887
- networth: antelope.Int64.from(state.networth),
5888
5630
  });
5889
5631
  return new Player(playerRow);
5890
5632
  }
5891
- setShipCount(count) {
5892
- this._shipCount = count;
5893
- }
5894
- get shipCount() {
5895
- return this._shipCount;
5896
- }
5897
- getNextShipCost(shipCount) {
5898
- const count = shipCount ?? this._shipCount ?? 0;
5899
- const cost = Math.pow(Player.SHIP_COST_MULTIPLIER, count) * Player.BASE_SHIP_COST;
5900
- return antelope.UInt64.from(Math.floor(cost));
5901
- }
5902
- get nextShipCost() {
5903
- return this.getNextShipCost();
5904
- }
5905
- canBuyShip(shipCount) {
5906
- return antelope.UInt64.from(this.balance).gte(this.getNextShipCost(shipCount));
5907
- }
5908
- get availableLoan() {
5909
- const maxLoan = antelope.UInt64.from(Player.MAX_LOAN);
5910
- if (antelope.UInt64.from(this.debt).gte(maxLoan)) {
5911
- return antelope.UInt64.from(0);
5912
- }
5913
- return maxLoan.subtracting(this.debt);
5914
- }
5915
- get canTakeLoan() {
5916
- return this.availableLoan.gt(antelope.UInt64.zero);
5917
- }
5918
- get canPayLoan() {
5919
- return antelope.UInt64.from(this.debt).gt(antelope.UInt64.zero) && antelope.UInt64.from(this.balance).gt(antelope.UInt64.zero);
5920
- }
5921
- get maxPayback() {
5922
- return antelope.UInt64.from(this.debt).lt(this.balance) ? this.debt : this.balance;
5923
- }
5924
- static get MAX_LOAN_LIMIT() {
5925
- return Player.MAX_LOAN;
5926
- }
5927
- get hasDebt() {
5928
- return antelope.UInt64.from(this.debt).gt(antelope.UInt64.zero);
5929
- }
5930
- get isSolvent() {
5931
- return this.networth.gte(antelope.Int64.zero);
5932
- }
5933
- withBalanceChange(delta) {
5934
- const newPlayer = Player.from(this);
5935
- const amount = typeof delta === 'number' ? antelope.UInt64.from(Math.abs(delta)) : delta;
5936
- if (typeof delta === 'number' && delta < 0) {
5937
- newPlayer.balance = antelope.UInt64.from(this.balance).gte(amount)
5938
- ? this.balance.subtracting(amount)
5939
- : antelope.UInt64.from(0);
5940
- }
5941
- else {
5942
- newPlayer.balance = this.balance.adding(amount);
5943
- }
5944
- const balanceInt = antelope.Int64.from(newPlayer.balance);
5945
- const debtInt = antelope.Int64.from(newPlayer.debt);
5946
- newPlayer.networth = balanceInt.subtracting(debtInt);
5947
- return newPlayer;
5948
- }
5949
- withDebtChange(delta) {
5950
- const newPlayer = Player.from(this);
5951
- const amount = typeof delta === 'number' ? antelope.UInt64.from(Math.abs(delta)) : delta;
5952
- if (typeof delta === 'number' && delta < 0) {
5953
- newPlayer.debt = antelope.UInt64.from(this.debt).gte(amount)
5954
- ? this.debt.subtracting(amount)
5955
- : antelope.UInt64.from(0);
5956
- }
5957
- else {
5958
- newPlayer.debt = this.debt.adding(amount);
5959
- }
5960
- const balanceInt = antelope.Int64.from(newPlayer.balance);
5961
- const debtInt = antelope.Int64.from(newPlayer.debt);
5962
- newPlayer.networth = balanceInt.subtracting(debtInt);
5963
- return newPlayer;
5964
- }
5965
- withLoan(amount) {
5966
- const newPlayer = Player.from(this);
5967
- newPlayer.balance = this.balance.adding(amount);
5968
- newPlayer.debt = this.debt.adding(amount);
5969
- const balanceInt = antelope.Int64.from(newPlayer.balance);
5970
- const debtInt = antelope.Int64.from(newPlayer.debt);
5971
- newPlayer.networth = balanceInt.subtracting(debtInt);
5972
- return newPlayer;
5973
- }
5974
- withLoanPayment(amount) {
5975
- const actualPayment = this.maxPayback.lt(amount) ? this.maxPayback : amount;
5976
- const newPlayer = Player.from(this);
5977
- newPlayer.balance = this.balance.subtracting(actualPayment);
5978
- newPlayer.debt = this.debt.subtracting(actualPayment);
5979
- const balanceInt = antelope.Int64.from(newPlayer.balance);
5980
- const debtInt = antelope.Int64.from(newPlayer.debt);
5981
- newPlayer.networth = balanceInt.subtracting(debtInt);
5982
- return newPlayer;
5983
- }
5984
- withSaleNetworth(sellPrice, paidPerUnit, quantity) {
5985
- const cost = paidPerUnit.multiplying(quantity);
5986
- const profit = sellPrice.gte(cost) ? sellPrice.subtracting(cost) : antelope.Int64.from(0);
5987
- const newPlayer = Player.from(this);
5988
- newPlayer.networth = antelope.Int64.from(this.networth).adding(profit);
5989
- return newPlayer;
5990
- }
5991
- withSellGoods(sellPrice, paidPerUnit, quantity) {
5992
- const cost = paidPerUnit.multiplying(quantity);
5993
- const profit = sellPrice.gte(cost) ? sellPrice.subtracting(cost) : antelope.Int64.from(0);
5994
- const newPlayer = Player.from(this);
5995
- newPlayer.balance = this.balance.adding(sellPrice);
5996
- newPlayer.networth = antelope.Int64.from(this.networth).adding(profit);
5997
- return newPlayer;
5998
- }
5999
- withBuyGoods(purchaseCost) {
6000
- const newPlayer = Player.from(this);
6001
- newPlayer.balance = antelope.UInt64.from(this.balance).gte(purchaseCost)
6002
- ? this.balance.subtracting(purchaseCost)
6003
- : antelope.UInt64.from(0);
6004
- const balanceInt = antelope.Int64.from(newPlayer.balance);
6005
- const debtInt = antelope.Int64.from(newPlayer.debt);
6006
- newPlayer.networth = balanceInt.subtracting(debtInt);
6007
- return newPlayer;
6008
- }
6009
5633
  }
6010
- Player.MAX_LOAN = 1000000;
6011
- Player.BASE_SHIP_COST = 500;
6012
- Player.SHIP_COST_MULTIPLIER = 5;
6013
5634
 
6014
5635
  class PlayersManager extends BaseManager {
6015
5636
  async getPlayer(account) {
@@ -6021,211 +5642,7 @@ class PlayersManager extends BaseManager {
6021
5642
  }
6022
5643
  }
6023
5644
 
6024
- function roll(gameSeed, rollSeed) {
6025
- const hash = hash512(gameSeed, rollSeed);
6026
- return (hash.array[0] << 8) | hash.array[1];
6027
- }
6028
-
6029
- exports.Rarities = void 0;
6030
- (function (Rarities) {
6031
- Rarities["legendary"] = "LEGENDARY";
6032
- Rarities["epic"] = "EPIC";
6033
- Rarities["rare"] = "RARE";
6034
- Rarities["uncommon"] = "UNCOMMON";
6035
- Rarities["common"] = "COMMON";
6036
- Rarities["trash"] = "TRASH";
6037
- })(exports.Rarities || (exports.Rarities = {}));
6038
- function getRarity(gameSeed, epochSeed, location, goodId) {
6039
- const seed = `${epochSeed}${location.x}${location.y}${goodId}rarity`;
6040
- const rarityRoll = roll(gameSeed, seed);
6041
- if (rarityRoll < 13) {
6042
- return {
6043
- rarity: exports.Rarities.legendary,
6044
- minMultiplier: 2.25,
6045
- maxMultiplier: 3.0,
6046
- };
6047
- }
6048
- else if (rarityRoll < 176) {
6049
- return {
6050
- rarity: exports.Rarities.epic,
6051
- minMultiplier: 1.75,
6052
- maxMultiplier: 2.25,
6053
- };
6054
- }
6055
- else if (rarityRoll < 996) {
6056
- return {
6057
- rarity: exports.Rarities.rare,
6058
- minMultiplier: 1.4,
6059
- maxMultiplier: 1.75,
6060
- };
6061
- }
6062
- else if (rarityRoll < 2966) {
6063
- return {
6064
- rarity: exports.Rarities.uncommon,
6065
- minMultiplier: 1.225,
6066
- maxMultiplier: 1.4,
6067
- };
6068
- }
6069
- else if (rarityRoll < 19568) {
6070
- return {
6071
- rarity: exports.Rarities.common,
6072
- minMultiplier: 1.07,
6073
- maxMultiplier: 1.225,
6074
- };
6075
- }
6076
- else if (rarityRoll < 45988) {
6077
- return {
6078
- rarity: exports.Rarities.trash,
6079
- minMultiplier: 1,
6080
- maxMultiplier: 1.07,
6081
- };
6082
- }
6083
- else if (rarityRoll < 62508) {
6084
- return {
6085
- rarity: exports.Rarities.common,
6086
- minMultiplier: 0.925,
6087
- maxMultiplier: 1,
6088
- };
6089
- }
6090
- else if (rarityRoll < 64518) {
6091
- return {
6092
- rarity: exports.Rarities.uncommon,
6093
- minMultiplier: 0.77,
6094
- maxMultiplier: 0.925,
6095
- };
6096
- }
6097
- else if (rarityRoll < 65437) {
6098
- return {
6099
- rarity: exports.Rarities.rare,
6100
- minMultiplier: 0.595,
6101
- maxMultiplier: 0.77,
6102
- };
6103
- }
6104
- else if (rarityRoll < 65523) {
6105
- return {
6106
- rarity: exports.Rarities.epic,
6107
- minMultiplier: 0.41,
6108
- maxMultiplier: 0.595,
6109
- };
6110
- }
6111
- else {
6112
- return {
6113
- rarity: exports.Rarities.legendary,
6114
- minMultiplier: 0.285,
6115
- maxMultiplier: 0.41,
6116
- };
6117
- }
6118
- }
6119
- function getRarityMultiplier(gameSeed, epochSeed, location, goodId) {
6120
- const rarity = getRarity(gameSeed, epochSeed, location, goodId);
6121
- const range = rarity.maxMultiplier - rarity.minMultiplier;
6122
- const seed = `${epochSeed}${location.x}${location.y}${goodId}raritymultiplier`;
6123
- const r = roll(gameSeed, seed);
6124
- return rarity.minMultiplier + (r / 65535) * range;
6125
- }
6126
- function getLocationMultiplier(gameSeed, location, goodId) {
6127
- const seed = `${location.x}${location.y}${goodId}locationmultiplier`;
6128
- const r = roll(gameSeed, seed);
6129
- if (r < 13) {
6130
- return 0.75;
6131
- }
6132
- else if (r < 176) {
6133
- return 0.8;
6134
- }
6135
- else if (r < 996) {
6136
- return 0.85;
6137
- }
6138
- else if (r < 2966) {
6139
- return 0.9;
6140
- }
6141
- else if (r < 19568) {
6142
- return 0.95;
6143
- }
6144
- else if (r < 45988) {
6145
- return 1;
6146
- }
6147
- else if (r < 62508) {
6148
- return 1.05;
6149
- }
6150
- else if (r < 64518) {
6151
- return 1.1;
6152
- }
6153
- else if (r < 65437) {
6154
- return 1.15;
6155
- }
6156
- else if (r < 65523) {
6157
- return 1.2;
6158
- }
6159
- else {
6160
- return 1.25;
6161
- }
6162
- }
6163
- function getSupply(gameSeed, state, location, goodId) {
6164
- const seed = `${state.seed}${location.x}${location.y}${goodId}supply`;
6165
- const r = roll(gameSeed, seed);
6166
- const percent = r / 65535;
6167
- const epoch = 1 + Number(state.epoch) / 90;
6168
- const ship = 1;
6169
- const goodIdNum = Number(goodId);
6170
- const base = Math.floor(128 / goodIdNum);
6171
- return Math.floor(base * percent * ship * epoch);
6172
- }
6173
- function marketPrice(location, goodId, gameSeed, state) {
6174
- const item = getItem(goodId);
6175
- let price = Number(item.base_price);
6176
- const rarityMultiplier = getRarityMultiplier(gameSeed, state.seed, location, goodId);
6177
- price *= rarityMultiplier;
6178
- const locationMultiplier = getLocationMultiplier(gameSeed, location, goodId);
6179
- price *= locationMultiplier;
6180
- const supply = getSupply(gameSeed, state, location, goodId);
6181
- return exports.ItemPrice.from({
6182
- id: goodId,
6183
- item,
6184
- price: antelope.UInt32.from(price),
6185
- supply: antelope.UInt16.from(supply),
6186
- });
6187
- }
6188
- function marketPrices(location, gameSeed, state) {
6189
- return getItems().map((item) => marketPrice(location, item.id, gameSeed, state));
6190
- }
6191
-
6192
5645
  class LocationsManager extends BaseManager {
6193
- async getMarketPrice(location, goodId) {
6194
- const game = await this.getGame();
6195
- const state = await this.getState();
6196
- return marketPrice(location, goodId, game.config.seed, state);
6197
- }
6198
- async getMarketPrices(location) {
6199
- const game = await this.getGame();
6200
- const state = await this.getState();
6201
- return marketPrices(location, game.config.seed, state);
6202
- }
6203
- async getMarketPricesWithSupply(location) {
6204
- const [game, state, supplyRows] = await Promise.all([
6205
- this.getGame(),
6206
- this.getState(),
6207
- this.getSupplyRows(location),
6208
- ]);
6209
- const prices = marketPrices(location, game.config.seed, state);
6210
- const supplyMap = new Map();
6211
- for (const row of supplyRows) {
6212
- if (antelope.UInt64.from(row.epoch).equals(state.epoch)) {
6213
- supplyMap.set(Number(row.item_id), Number(row.supply));
6214
- }
6215
- }
6216
- return prices.map((price) => {
6217
- const actualSupply = supplyMap.get(Number(price.id));
6218
- if (actualSupply !== undefined) {
6219
- return exports.ItemPrice.from({
6220
- id: price.id,
6221
- item: price.item,
6222
- price: price.price,
6223
- supply: antelope.UInt64.from(actualSupply),
6224
- });
6225
- }
6226
- return price;
6227
- });
6228
- }
6229
5646
  async hasSystem(location) {
6230
5647
  const game = await this.getGame();
6231
5648
  return hasSystem(game.config.seed, location);
@@ -6234,40 +5651,6 @@ class LocationsManager extends BaseManager {
6234
5651
  const game = await this.getGame();
6235
5652
  return findNearbyPlanets(game.config.seed, origin, maxDistance);
6236
5653
  }
6237
- async getSupplyRows(location) {
6238
- const hash = antelope.Checksum256.hash(antelope.Bytes.from(`${location.x}-${location.y}`, 'utf8'));
6239
- return this.server.table('supply').all({
6240
- index_position: 'secondary',
6241
- from: hash,
6242
- to: hash,
6243
- });
6244
- }
6245
- async getLocationWithPrices(coords) {
6246
- const location = toLocation(coords);
6247
- const prices = await this.getMarketPrices(location.coordinates);
6248
- location.setMarketPrices(prices);
6249
- return location;
6250
- }
6251
- async getLocationWithSupply(coords) {
6252
- const location = toLocation(coords);
6253
- const [rows, state] = await Promise.all([
6254
- this.getSupplyRows(location.coordinates),
6255
- this.getState(),
6256
- ]);
6257
- location.setLocationRows(rows, state.epoch);
6258
- return location;
6259
- }
6260
- async getLocationComplete(coords) {
6261
- const location = toLocation(coords);
6262
- const [prices, rows, state] = await Promise.all([
6263
- this.getMarketPrices(location.coordinates),
6264
- this.getSupplyRows(location.coordinates),
6265
- this.getState(),
6266
- ]);
6267
- location.setMarketPrices(prices);
6268
- location.setLocationRows(rows, state.epoch);
6269
- return location;
6270
- }
6271
5654
  async getLocationEntity(id) {
6272
5655
  const row = await this.server.table('location').get(antelope.UInt64.from(id));
6273
5656
  return row ?? undefined;
@@ -6281,729 +5664,6 @@ class LocationsManager extends BaseManager {
6281
5664
  }
6282
5665
  }
6283
5666
 
6284
- function calculateUpdatedCargoCost(currentPaid, currentOwned, purchaseCost, purchaseQuantity) {
6285
- const numerator = currentPaid.multiplying(currentOwned).adding(purchaseCost);
6286
- const denominator = antelope.UInt32.from(currentOwned).adding(purchaseQuantity);
6287
- return numerator.dividing(denominator);
6288
- }
6289
- function calculateMaxTradeQuantity(ship, player, goodPrice) {
6290
- const pricePerUnit = antelope.UInt32.from(goodPrice.price);
6291
- const massPerUnit = antelope.UInt32.from(goodPrice.item.mass);
6292
- const spaceForQuantity = ship.availableCapacity.dividing(massPerUnit);
6293
- const affordableQuantity = player.balance.dividing(pricePerUnit);
6294
- const maxQuantity = spaceForQuantity.lt(affordableQuantity)
6295
- ? spaceForQuantity
6296
- : affordableQuantity;
6297
- return {
6298
- maxQuantity: Number(maxQuantity),
6299
- totalCost: Number(maxQuantity.multiplying(pricePerUnit)),
6300
- totalMass: antelope.UInt64.from(maxQuantity.multiplying(massPerUnit)),
6301
- affordableQuantity: Number(affordableQuantity),
6302
- spaceForQuantity: Number(spaceForQuantity),
6303
- };
6304
- }
6305
- function calculateTradeProfit(quantity, buyPrice, sellPrice) {
6306
- const qty = antelope.UInt32.from(quantity);
6307
- const buy = antelope.UInt32.from(buyPrice);
6308
- const sell = antelope.UInt32.from(sellPrice);
6309
- const cost = antelope.UInt64.from(qty).multiplying(buy);
6310
- const revenue = antelope.UInt64.from(qty).multiplying(sell);
6311
- const profit = antelope.Int64.from(revenue).subtracting(cost);
6312
- const margin = cost.gt(antelope.UInt64.zero) ? (Number(profit) / Number(cost)) * 100 : 0;
6313
- return { revenue, cost, profit, margin };
6314
- }
6315
- function calculateProfitPerMass(quantity, buyPrice, sellPrice, massPerUnit) {
6316
- const profit = (sellPrice - buyPrice) * quantity;
6317
- const totalMass = quantity * massPerUnit;
6318
- return totalMass > 0 ? profit / totalMass : 0;
6319
- }
6320
- function calculateProfitPerSecond(profit, travelTimeSeconds) {
6321
- const t = antelope.UInt32.from(travelTimeSeconds);
6322
- return t.gt(antelope.UInt32.zero) ? Number(profit) / Number(t) : 0;
6323
- }
6324
- function findBestItemToTrade(ship, player, originPrices, destPrices, travelTimeSeconds) {
6325
- let bestTrade = null;
6326
- let bestProfitPerSecond = 0;
6327
- for (const originPrice of originPrices) {
6328
- const destPrice = destPrices.find((p) => p.id.equals(originPrice.id));
6329
- if (!destPrice)
6330
- continue;
6331
- if (!isProfitable(originPrice.price, destPrice.price))
6332
- continue;
6333
- const calc = calculateMaxTradeQuantity(ship, player, originPrice);
6334
- if (calc.maxQuantity === 0)
6335
- continue;
6336
- const tradeResult = calculateTradeProfit(calc.maxQuantity, originPrice.price, destPrice.price);
6337
- const profitPerSecond = calculateProfitPerSecond(tradeResult.profit, travelTimeSeconds);
6338
- if (profitPerSecond > bestProfitPerSecond) {
6339
- bestProfitPerSecond = profitPerSecond;
6340
- bestTrade = {
6341
- item: originPrice,
6342
- quantity: calc.maxQuantity,
6343
- profit: Number(tradeResult.profit),
6344
- profitPerSecond,
6345
- margin: tradeResult.margin,
6346
- };
6347
- }
6348
- }
6349
- return bestTrade;
6350
- }
6351
- function calculateBreakEvenPrice(costPaid, quantity) {
6352
- return quantity > 0 ? costPaid / quantity : 0;
6353
- }
6354
- function isProfitable(buyPrice, sellPrice) {
6355
- return antelope.UInt32.from(sellPrice).gt(antelope.UInt32.from(buyPrice));
6356
- }
6357
- function calculateROI(cost, profit) {
6358
- return cost > 0 ? (profit / cost) * 100 : 0;
6359
- }
6360
-
6361
- async function findDealsForShip(ship, originLocation, getNearbyLocations, getMarketPrices, options = {}) {
6362
- const { maxDeals = 10, maxDistance = 20 * PRECISION, playerBalance, minProfitPerSecond = 0, minMarginPercent = 0, availableSpace, } = options;
6363
- const balance = playerBalance !== undefined ? antelope.UInt64.from(playerBalance) : undefined;
6364
- const origin = Location.from(originLocation);
6365
- const originPrices = await getMarketPrices(originLocation);
6366
- origin.setMarketPrices(originPrices);
6367
- const nearbyLocations = await getNearbyLocations(originLocation, maxDistance);
6368
- const deals = [];
6369
- const currentMass = ship.totalMass;
6370
- const shipCapacity = ship.maxCapacity;
6371
- const effectiveAvailableMass = availableSpace !== undefined
6372
- ? antelope.UInt64.from(availableSpace)
6373
- : currentMass.lt(shipCapacity)
6374
- ? shipCapacity.subtracting(currentMass)
6375
- : antelope.UInt64.zero;
6376
- for (const destLocation of nearbyLocations) {
6377
- const destinationPrices = await getMarketPrices(destLocation.coordinates);
6378
- destLocation.setMarketPrices(destinationPrices);
6379
- const distance = distanceBetweenCoordinates(originLocation, destLocation.coordinates);
6380
- for (const originGood of originPrices) {
6381
- const destGood = destinationPrices.find((g) => g.id.equals(originGood.id));
6382
- if (!destGood)
6383
- continue;
6384
- if (!isProfitable(originGood.price, destGood.price) ||
6385
- originGood.supply.equals(antelope.UInt16.from(0))) {
6386
- continue;
6387
- }
6388
- const canAfford = balance !== undefined
6389
- ? balance.dividing(originGood.price)
6390
- : antelope.UInt64.from(Number.MAX_SAFE_INTEGER);
6391
- const canHaul = effectiveAvailableMass.dividing(originGood.item.mass);
6392
- const supplyLimit = antelope.UInt64.from(originGood.supply);
6393
- let maxQuantity = canAfford;
6394
- if (canHaul.lt(maxQuantity))
6395
- maxQuantity = canHaul;
6396
- if (supplyLimit.lt(maxQuantity))
6397
- maxQuantity = supplyLimit;
6398
- if (maxQuantity.equals(antelope.UInt64.zero))
6399
- continue;
6400
- const cargoMass = originGood.item.mass.multiplying(maxQuantity);
6401
- const availableSpaceUInt = antelope.UInt64.from(availableSpace);
6402
- const baseMass = availableSpace !== undefined
6403
- ? shipCapacity.gte(availableSpaceUInt)
6404
- ? shipCapacity.subtracting(availableSpaceUInt)
6405
- : antelope.UInt64.zero
6406
- : currentMass;
6407
- const totalMass = baseMass.adding(cargoMass);
6408
- const needsRecharge = !ship.hasEnergyFor(distance);
6409
- const travelEstimate = estimateTravelTime(ship, totalMass, distance, {
6410
- needsRecharge,
6411
- loadMass: Number(cargoMass),
6412
- });
6413
- const tradeCalc = calculateTradeProfit(maxQuantity, originGood.price, destGood.price);
6414
- const profitPerUnit = destGood.price.subtracting(originGood.price);
6415
- const profitPerSecond = calculateProfitPerSecond(tradeCalc.profit, travelEstimate.total);
6416
- if (profitPerSecond < minProfitPerSecond)
6417
- continue;
6418
- if (tradeCalc.margin < minMarginPercent)
6419
- continue;
6420
- deals.push({
6421
- origin,
6422
- destination: destLocation,
6423
- item: originGood,
6424
- distance,
6425
- supply: originGood.supply,
6426
- buyPrice: originGood.price,
6427
- sellPrice: destGood.price,
6428
- profitPerUnit,
6429
- maxQuantity: antelope.UInt32.from(maxQuantity),
6430
- totalProfit: tradeCalc.profit,
6431
- travelTime: travelEstimate.total,
6432
- travelTimeBreakdown: travelEstimate,
6433
- profitPerSecond,
6434
- marginPercent: tradeCalc.margin,
6435
- });
6436
- }
6437
- }
6438
- deals.sort((a, b) => b.profitPerSecond - a.profitPerSecond);
6439
- return deals.slice(0, maxDeals);
6440
- }
6441
- async function findBestDeal(ship, originLocation, getNearbyLocations, getMarketPrices, options = {}) {
6442
- const deals = await findDealsForShip(ship, originLocation, getNearbyLocations, getMarketPrices, {
6443
- ...options,
6444
- maxDeals: 1,
6445
- });
6446
- return deals[0];
6447
- }
6448
-
6449
- function calculateCargoMass(cargo) {
6450
- let mass = antelope.UInt32.from(0);
6451
- for (const c of cargo) {
6452
- if (antelope.UInt64.from(c.quantity).gt(antelope.UInt64.zero)) {
6453
- const goodMass = getItem(c.item_id).mass;
6454
- mass = mass.adding(goodMass.multiplying(c.quantity));
6455
- }
6456
- }
6457
- return mass;
6458
- }
6459
- function calculateUnloadTime(ship, cargo) {
6460
- const unloadMass = calculateCargoMass(cargo);
6461
- if (unloadMass.equals(antelope.UInt32.zero) ||
6462
- !ship.loaders ||
6463
- ship.loaders.quantity.equals(antelope.UInt32.zero)) {
6464
- return antelope.UInt32.zero;
6465
- }
6466
- const totalMass = antelope.UInt64.from(unloadMass).adding(ship.loaders.mass);
6467
- return calc_loader_flighttime(ship, totalMass).dividing(ship.loaders.quantity);
6468
- }
6469
- function analyzeCargoSale(cargo, prices) {
6470
- let revenue = antelope.UInt64.zero;
6471
- let cost = antelope.UInt64.zero;
6472
- for (const c of cargo) {
6473
- if (antelope.UInt64.from(c.quantity).equals(antelope.UInt64.zero))
6474
- continue;
6475
- const goodId = Number(c.item_id);
6476
- const salePrice = prices.get(goodId);
6477
- if (salePrice) {
6478
- revenue = revenue.adding(antelope.UInt64.from(salePrice).multiplying(c.quantity));
6479
- }
6480
- cost = cost.adding(c.unit_cost.multiplying(c.quantity));
6481
- }
6482
- return {
6483
- revenue,
6484
- cost,
6485
- profit: antelope.Int64.from(revenue).subtracting(cost),
6486
- };
6487
- }
6488
- function buildCargoSaleItems(cargo, prices) {
6489
- const items = [];
6490
- for (const c of cargo) {
6491
- if (antelope.UInt64.from(c.quantity).equals(antelope.UInt64.zero))
6492
- continue;
6493
- const goodId = Number(c.item_id);
6494
- const salePrice = prices.get(goodId);
6495
- const pricePerUnit = salePrice ? antelope.UInt32.from(salePrice) : antelope.UInt32.zero;
6496
- const revenue = antelope.UInt64.from(pricePerUnit).multiplying(c.quantity);
6497
- const cost = c.unit_cost.multiplying(c.quantity);
6498
- const profit = antelope.Int64.from(revenue).subtracting(cost);
6499
- items.push({
6500
- goodId: c.item_id,
6501
- goodName: c.item?.name ?? `Item #${goodId}`,
6502
- quantity: antelope.UInt32.from(c.quantity),
6503
- pricePerUnit,
6504
- revenue,
6505
- costPerUnit: c.unit_cost,
6506
- profit,
6507
- });
6508
- }
6509
- return items;
6510
- }
6511
- function createSellAndTradeOption(saleRevenue, saleCost, deal, cargoSale, unloadTime) {
6512
- const saleProfit = antelope.Int64.from(saleRevenue).subtracting(saleCost);
6513
- const totalProfit = saleProfit.adding(deal.totalProfit);
6514
- const profitPerSecond = deal.travelTime.gt(antelope.UInt32.zero)
6515
- ? Number(totalProfit) / Number(deal.travelTime)
6516
- : Number(totalProfit);
6517
- const unload = unloadTime ?? antelope.UInt32.zero;
6518
- const breakdown = deal.travelTimeBreakdown
6519
- ? {
6520
- unloadTime: unload,
6521
- loadTime: deal.travelTimeBreakdown.loadTime,
6522
- rechargeTime: deal.travelTimeBreakdown.rechargeTime,
6523
- flightTime: deal.travelTimeBreakdown.flightTime,
6524
- total: unload
6525
- .adding(deal.travelTimeBreakdown.loadTime)
6526
- .adding(deal.travelTimeBreakdown.rechargeTime)
6527
- .adding(deal.travelTimeBreakdown.flightTime),
6528
- }
6529
- : undefined;
6530
- return {
6531
- id: `sell-trade-${deal.destination.coordinates.x}-${deal.destination.coordinates.y}-${deal.item.id}`,
6532
- type: 'sell-and-trade',
6533
- title: `Trade ${deal.item.item.name}`,
6534
- description: `Sell cargo, buy ${deal.maxQuantity} ${deal.item.item.name}, deliver to (${deal.destination.coordinates.x}, ${deal.destination.coordinates.y})`,
6535
- reason: `${deal.marginPercent.toFixed(0)}% margin, ${deal.profitPerSecond.toFixed(1)}/s profit rate`,
6536
- recommended: false,
6537
- highestProfit: false,
6538
- estimatedProfit: saleProfit,
6539
- saleRevenue,
6540
- purchaseCost: antelope.UInt64.from(deal.buyPrice).multiplying(deal.maxQuantity),
6541
- nextTradeProfit: deal.totalProfit,
6542
- profitPerSecond,
6543
- marginPercent: deal.marginPercent,
6544
- destination: deal.destination,
6545
- deal,
6546
- travelTime: breakdown?.total ?? deal.travelTime,
6547
- travelTimeBreakdown: breakdown,
6548
- cargoSale,
6549
- cargoProfitLoss: saleProfit,
6550
- };
6551
- }
6552
- function createTravelToSellOption(currentRevenue, cargoCost, betterSale, cargo, destPrices) {
6553
- const totalQuantity = cargo.reduce((s, c) => s.adding(antelope.UInt64.from(c.quantity)), antelope.UInt64.zero);
6554
- const currentPrice = totalQuantity.gt(antelope.UInt64.zero)
6555
- ? antelope.UInt32.from(currentRevenue.dividing(totalQuantity))
6556
- : antelope.UInt32.zero;
6557
- const priceIncrease = betterSale.price.gte(currentPrice)
6558
- ? betterSale.price.subtracting(currentPrice)
6559
- : antelope.UInt32.zero;
6560
- const hasDealAfter = !!betterSale.bestDealAfterSale;
6561
- const cargoSale = destPrices ? buildCargoSaleItems(cargo, destPrices) : undefined;
6562
- const cargoProfitLoss = cargoSale?.reduce((sum, item) => sum.adding(item.profit), antelope.Int64.zero);
6563
- const saleProfit = antelope.Int64.from(betterSale.revenue).subtracting(cargoCost);
6564
- const profitPerSecond = betterSale.travelTime.gt(antelope.UInt32.zero)
6565
- ? Number(saleProfit) / Number(betterSale.travelTime)
6566
- : Number(saleProfit);
6567
- return {
6568
- id: `travel-sell-${betterSale.location.coordinates.x}-${betterSale.location.coordinates.y}`,
6569
- type: 'travel-to-sell',
6570
- title: 'Move to Sell Nearby',
6571
- description: `Keep cargo, travel to better market${hasDealAfter ? ', then trade' : ''}`,
6572
- reason: `+${Number(priceIncrease).toLocaleString()}/unit better price${hasDealAfter ? ', good deals available there' : ''}`,
6573
- recommended: false,
6574
- highestProfit: false,
6575
- estimatedProfit: betterSale.improvement,
6576
- saleRevenue: betterSale.revenue,
6577
- profitPerSecond,
6578
- saleLocation: betterSale.location,
6579
- salePrice: betterSale.price,
6580
- currentPrice,
6581
- destination: betterSale.location,
6582
- deal: betterSale.bestDealAfterSale,
6583
- travelTime: betterSale.travelTime,
6584
- travelTimeBreakdown: betterSale.travelTimeBreakdown,
6585
- cargoSale,
6586
- cargoProfitLoss,
6587
- };
6588
- }
6589
- function createSellAndRepositionOption(saleRevenue, saleCost, reposition, cargoSale) {
6590
- const saleProfit = antelope.Int64.from(saleRevenue).subtracting(saleCost);
6591
- const deal = reposition.bestDeal;
6592
- return {
6593
- id: `sell-reposition-${reposition.location.coordinates.x}-${reposition.location.coordinates.y}`,
6594
- type: 'sell-and-reposition',
6595
- title: 'Sell & Move',
6596
- description: `Sell cargo here, travel empty to buy ${deal.item.item.name}`,
6597
- reason: `No good trades here — ${deal.marginPercent.toFixed(0)}% margin trade available at destination`,
6598
- recommended: false,
6599
- highestProfit: false,
6600
- estimatedProfit: saleProfit,
6601
- saleRevenue,
6602
- nextTradeProfit: deal.totalProfit,
6603
- profitPerSecond: deal.profitPerSecond,
6604
- marginPercent: deal.marginPercent,
6605
- destination: reposition.location,
6606
- deal: reposition.bestDeal,
6607
- travelTime: reposition.travelTime,
6608
- travelTimeBreakdown: reposition.travelTimeBreakdown,
6609
- cargoSale,
6610
- cargoProfitLoss: saleProfit,
6611
- };
6612
- }
6613
- function createOrbitOption() {
6614
- return {
6615
- id: 'orbit',
6616
- type: 'orbit',
6617
- title: 'Enter Orbit',
6618
- description: 'Arrive at this location, keep cargo',
6619
- reason: 'Keep cargo, decide later',
6620
- recommended: false,
6621
- highestProfit: false,
6622
- estimatedProfit: antelope.UInt64.zero,
6623
- };
6624
- }
6625
- function createSellAndStayOption(saleRevenue, saleCost, cargoSale, unloadTime) {
6626
- const saleProfit = antelope.Int64.from(saleRevenue).subtracting(saleCost);
6627
- return {
6628
- id: 'sell-stay',
6629
- type: 'sell-and-stay',
6630
- title: 'Sell & Enter Orbit',
6631
- description: `Sell cargo, remain docked at this location`,
6632
- reason: 'Collect profits now, decide next move later',
6633
- recommended: false,
6634
- highestProfit: false,
6635
- estimatedProfit: saleProfit,
6636
- saleRevenue,
6637
- cargoSale,
6638
- cargoProfitLoss: saleProfit,
6639
- travelTimeBreakdown: unloadTime !== undefined
6640
- ? {
6641
- unloadTime,
6642
- loadTime: antelope.UInt32.zero,
6643
- rechargeTime: antelope.UInt32.zero,
6644
- flightTime: antelope.UInt32.zero,
6645
- total: unloadTime,
6646
- }
6647
- : undefined,
6648
- };
6649
- }
6650
- function createExploreOption(destination, travelTime, discountedGood, travelTimeBreakdown, potentialDeals) {
6651
- let description = 'Travel to look for trading opportunities';
6652
- let reason = 'No profitable trades found nearby';
6653
- if (potentialDeals && potentialDeals.length > 0) {
6654
- const bestDeal = potentialDeals[0];
6655
- description = `${potentialDeals.length} deal${potentialDeals.length > 1 ? 's' : ''} available — best: ${bestDeal.goodName}`;
6656
- reason = `${bestDeal.marginPercent.toFixed(0)}% margin, ${bestDeal.profitPerSecond.toFixed(1)}/s`;
6657
- }
6658
- else if (discountedGood) {
6659
- const { name, discountPercent } = discountedGood;
6660
- if (discountPercent >= 60) {
6661
- description = `${name} at ${discountPercent}% off`;
6662
- reason = 'Legendary find — extremely rare opportunity';
6663
- }
6664
- else if (discountPercent >= 40) {
6665
- description = `${name} at ${discountPercent}% off`;
6666
- reason = 'Epic deal — exceptional prices';
6667
- }
6668
- else if (discountPercent >= 23) {
6669
- description = `${name} at ${discountPercent}% off`;
6670
- reason = 'Rare discount — well below market';
6671
- }
6672
- else if (discountPercent >= 8) {
6673
- description = `${name} at ${discountPercent}% off`;
6674
- reason = `Good prices on ${name}`;
6675
- }
6676
- else {
6677
- description = `${name} slightly discounted`;
6678
- reason = 'Minor savings available';
6679
- }
6680
- }
6681
- return {
6682
- id: `explore-${destination.coordinates.x}-${destination.coordinates.y}`,
6683
- type: 'explore',
6684
- title: 'Move',
6685
- description,
6686
- reason,
6687
- recommended: false,
6688
- highestProfit: false,
6689
- estimatedProfit: antelope.UInt64.zero,
6690
- destination,
6691
- travelTime,
6692
- travelTimeBreakdown,
6693
- discountedGood,
6694
- potentialDeals,
6695
- };
6696
- }
6697
- async function analyzeCollectOptions(ship, arrivedAt, callbacks, options = {}) {
6698
- const { playerBalance = Infinity, minSaleImprovement = 100 } = options;
6699
- const cargo = ship.sellableCargo;
6700
- const hasCargo = cargo.length > 0;
6701
- const originPrices = await callbacks.getMarketPrices(arrivedAt);
6702
- const priceMap = new Map(originPrices.map((p) => [Number(p.id), p.price]));
6703
- const { revenue: cargoValueHere, cost: cargoCost } = analyzeCargoSale(cargo, priceMap);
6704
- const cargoSaleHere = buildCargoSaleItems(cargo, priceMap);
6705
- const collectOptions = [];
6706
- const maxDistance = options.maxDistance ?? Number(ship.maxDistance);
6707
- const nearbyLocations = await callbacks.getNearbyLocations(arrivedAt, maxDistance);
6708
- const dealsAtOrigin = await findDealsForShip(ship, arrivedAt, callbacks.getNearbyLocations, callbacks.getMarketPrices, {
6709
- maxDeals: 5,
6710
- maxDistance,
6711
- playerBalance: playerBalance + Number(cargoValueHere),
6712
- availableSpace: Number(ship.maxCapacity),
6713
- });
6714
- if (hasCargo && dealsAtOrigin.length > 0) {
6715
- const cargoGoodIds = new Set(cargo.map((c) => Number(c.item_id)));
6716
- for (const deal of dealsAtOrigin.slice(0, 3)) {
6717
- const dealGoodId = Number(deal.item.id);
6718
- if (cargoGoodIds.has(dealGoodId)) {
6719
- continue;
6720
- }
6721
- const unloadTime = calculateUnloadTime(ship, cargo);
6722
- const option = createSellAndTradeOption(cargoValueHere, cargoCost, deal, cargoSaleHere, unloadTime);
6723
- collectOptions.push(option);
6724
- }
6725
- }
6726
- if (hasCargo) {
6727
- const locationsToCheck = nearbyLocations.slice(0, 10);
6728
- const allDestPrices = await Promise.all(locationsToCheck.map((loc) => callbacks.getMarketPrices(loc.coordinates)));
6729
- const candidateLocations = [];
6730
- for (let i = 0; i < locationsToCheck.length; i++) {
6731
- const destLocation = locationsToCheck[i];
6732
- const destPrices = allDestPrices[i];
6733
- const destPriceMap = new Map(destPrices.map((p) => [Number(p.id), p.price]));
6734
- const { revenue: destRevenue } = analyzeCargoSale(cargo, destPriceMap);
6735
- const improvement = antelope.Int64.from(destRevenue).subtracting(cargoValueHere);
6736
- if (improvement.gt(antelope.Int64.from(minSaleImprovement))) {
6737
- candidateLocations.push({ destLocation, destPriceMap, destRevenue, improvement });
6738
- }
6739
- }
6740
- const betterSaleResults = await Promise.all(candidateLocations.map(async ({ destLocation, destPriceMap, destRevenue, improvement }) => {
6741
- const distance = distanceBetweenCoordinates(arrivedAt, destLocation.coordinates);
6742
- const needsRecharge = !ship.hasEnergyFor(distance);
6743
- const travelEstimate = estimateTravelTime(ship, ship.totalMass, distance, {
6744
- needsRecharge,
6745
- });
6746
- const dealsAfterSale = await findDealsForShip(ship, destLocation.coordinates, callbacks.getNearbyLocations, callbacks.getMarketPrices, {
6747
- maxDeals: 1,
6748
- maxDistance,
6749
- playerBalance: destRevenue,
6750
- availableSpace: Number(ship.maxCapacity),
6751
- });
6752
- return {
6753
- better: {
6754
- location: destLocation,
6755
- price: antelope.UInt32.from(destRevenue.dividing(cargo.reduce((s, c) => s.adding(c.quantity), antelope.UInt64.zero))),
6756
- revenue: destRevenue,
6757
- improvement,
6758
- bestDealAfterSale: dealsAfterSale[0],
6759
- distance,
6760
- travelTime: travelEstimate.total,
6761
- travelTimeBreakdown: travelEstimate,
6762
- },
6763
- destPriceMap,
6764
- };
6765
- }));
6766
- const betterSaleLocations = betterSaleResults.sort((a, b) => Number(b.better.improvement) - Number(a.better.improvement));
6767
- for (const { better, destPriceMap } of betterSaleLocations.slice(0, 2)) {
6768
- const option = createTravelToSellOption(cargoValueHere, cargoCost, better, cargo, destPriceMap);
6769
- collectOptions.push(option);
6770
- }
6771
- }
6772
- if (hasCargo && dealsAtOrigin.length === 0) {
6773
- const locationsToCheck = nearbyLocations.slice(0, 10);
6774
- const allDealsAtDest = await Promise.all(locationsToCheck.map((destLocation) => findDealsForShip(ship, destLocation.coordinates, callbacks.getNearbyLocations, callbacks.getMarketPrices, {
6775
- maxDeals: 1,
6776
- maxDistance,
6777
- playerBalance: antelope.UInt64.from(playerBalance).adding(cargoValueHere),
6778
- availableSpace: Number(ship.maxCapacity),
6779
- })));
6780
- const repositionLocations = [];
6781
- for (let i = 0; i < locationsToCheck.length; i++) {
6782
- const destLocation = locationsToCheck[i];
6783
- const dealsAtDest = allDealsAtDest[i];
6784
- if (dealsAtDest.length > 0) {
6785
- const distance = distanceBetweenCoordinates(arrivedAt, destLocation.coordinates);
6786
- const needsRecharge = !ship.hasEnergyFor(distance);
6787
- const travelEstimate = estimateTravelTime(ship, ship.totalMass, distance, {
6788
- needsRecharge,
6789
- unloadMass: calculateCargoMass(cargo),
6790
- });
6791
- repositionLocations.push({
6792
- location: destLocation,
6793
- bestDeal: dealsAtDest[0],
6794
- distance,
6795
- travelTime: travelEstimate.total,
6796
- travelTimeBreakdown: travelEstimate,
6797
- });
6798
- }
6799
- }
6800
- repositionLocations.sort((a, b) => b.bestDeal.profitPerSecond - a.bestDeal.profitPerSecond);
6801
- for (const reposition of repositionLocations.slice(0, 2)) {
6802
- const option = createSellAndRepositionOption(cargoValueHere, cargoCost, reposition, cargoSaleHere);
6803
- collectOptions.push(option);
6804
- }
6805
- }
6806
- if (hasCargo) {
6807
- const unloadTime = calculateUnloadTime(ship, cargo);
6808
- const sellAndStay = createSellAndStayOption(cargoValueHere, cargoCost, cargoSaleHere, unloadTime);
6809
- collectOptions.push(sellAndStay);
6810
- }
6811
- if (!hasCargo && dealsAtOrigin.length > 0) {
6812
- for (const deal of dealsAtOrigin.slice(0, 3)) {
6813
- const option = {
6814
- id: `trade-${deal.destination.coordinates.x}-${deal.destination.coordinates.y}-${deal.item.id}`,
6815
- type: 'sell-and-trade',
6816
- title: `Trade ${deal.item.item.name}`,
6817
- description: `Buy ${deal.maxQuantity} ${deal.item.item.name}, deliver to (${deal.destination.coordinates.x}, ${deal.destination.coordinates.y})`,
6818
- reason: `${deal.marginPercent.toFixed(0)}% margin, ${deal.profitPerSecond.toFixed(1)}/s profit rate`,
6819
- recommended: false,
6820
- highestProfit: false,
6821
- estimatedProfit: deal.totalProfit,
6822
- purchaseCost: antelope.UInt64.from(deal.buyPrice).multiplying(deal.maxQuantity),
6823
- nextTradeProfit: deal.totalProfit,
6824
- profitPerSecond: deal.profitPerSecond,
6825
- marginPercent: deal.marginPercent,
6826
- destination: deal.destination,
6827
- deal,
6828
- travelTime: deal.travelTime,
6829
- travelTimeBreakdown: {
6830
- unloadTime: antelope.UInt32.zero,
6831
- loadTime: deal.travelTimeBreakdown.loadTime,
6832
- rechargeTime: deal.travelTimeBreakdown.rechargeTime,
6833
- flightTime: deal.travelTimeBreakdown.flightTime,
6834
- total: deal.travelTimeBreakdown.total,
6835
- },
6836
- };
6837
- collectOptions.push(option);
6838
- }
6839
- }
6840
- if (collectOptions.length === 0) {
6841
- const gameSeed = callbacks.getGameSeed?.();
6842
- const state = callbacks.getState?.();
6843
- const exploreCandidates = [];
6844
- for (const dest of nearbyLocations.slice(0, 10)) {
6845
- const distance = distanceBetweenCoordinates(arrivedAt, dest.coordinates);
6846
- const needsRecharge = !ship.hasEnergyFor(distance);
6847
- const unloadMass = hasCargo ? calculateCargoMass(cargo) : antelope.UInt32.zero;
6848
- const travelEstimate = estimateTravelTime(ship, ship.totalMass, distance, {
6849
- needsRecharge,
6850
- unloadMass,
6851
- });
6852
- let discountedGood;
6853
- let bestDiscount = 0;
6854
- if (gameSeed && state) {
6855
- const allGoods = getItems();
6856
- for (const good of allGoods) {
6857
- const rarity = getRarity(gameSeed, state.seed, dest.coordinates, good.id);
6858
- if (rarity.minMultiplier < 1.0) {
6859
- const discountPercent = Math.round((1 - rarity.minMultiplier) * 100);
6860
- if (discountPercent > bestDiscount) {
6861
- bestDiscount = discountPercent;
6862
- const rarityName = rarity.rarity === exports.Rarities.legendary
6863
- ? 'Legendary'
6864
- : rarity.rarity === exports.Rarities.epic
6865
- ? 'Epic'
6866
- : rarity.rarity === exports.Rarities.rare
6867
- ? 'Rare'
6868
- : rarity.rarity === exports.Rarities.uncommon
6869
- ? 'Uncommon'
6870
- : 'Common';
6871
- discountedGood = {
6872
- goodId: Number(good.id),
6873
- name: good.name,
6874
- rarity: rarityName,
6875
- discountPercent,
6876
- };
6877
- }
6878
- }
6879
- }
6880
- }
6881
- const destDeals = await findDealsForShip(ship, dest.coordinates, callbacks.getNearbyLocations, callbacks.getMarketPrices, { maxDeals: 2 });
6882
- const potentialDeals = destDeals.map((d) => ({
6883
- goodId: Number(d.item.id),
6884
- goodName: d.item.item.name,
6885
- destinationCoords: d.destination.coordinates,
6886
- marginPercent: d.marginPercent,
6887
- profitPerSecond: d.profitPerSecond,
6888
- }));
6889
- let score = 0;
6890
- if (potentialDeals.length > 0) {
6891
- score = potentialDeals[0].profitPerSecond;
6892
- }
6893
- else if (bestDiscount > 0) {
6894
- score = bestDiscount * 0.01;
6895
- }
6896
- exploreCandidates.push({
6897
- dest,
6898
- travelTime: travelEstimate.total,
6899
- travelTimeBreakdown: travelEstimate,
6900
- discountedGood,
6901
- bestDiscount,
6902
- potentialDeals: potentialDeals.length > 0 ? potentialDeals : undefined,
6903
- score,
6904
- });
6905
- }
6906
- exploreCandidates.sort((a, b) => b.score - a.score);
6907
- for (const candidate of exploreCandidates.slice(0, 3)) {
6908
- const option = createExploreOption(candidate.dest, candidate.travelTime, candidate.discountedGood, candidate.travelTimeBreakdown, candidate.potentialDeals);
6909
- collectOptions.push(option);
6910
- }
6911
- }
6912
- const orbitOption = createOrbitOption();
6913
- collectOptions.push(orbitOption);
6914
- const MIN_MARGIN_THRESHOLD = 15;
6915
- const MIN_PROFIT_PER_SECOND_THRESHOLD = 0.5;
6916
- collectOptions.sort((a, b) => (b.profitPerSecond ?? 0) - (a.profitPerSecond ?? 0));
6917
- if (collectOptions.length > 0) {
6918
- const bestByProfitPerSecond = collectOptions[0];
6919
- const meetsQualityThreshold = (bestByProfitPerSecond.marginPercent ?? 0) > MIN_MARGIN_THRESHOLD ||
6920
- (bestByProfitPerSecond.profitPerSecond ?? 0) > MIN_PROFIT_PER_SECOND_THRESHOLD;
6921
- if (meetsQualityThreshold) {
6922
- bestByProfitPerSecond.recommended = true;
6923
- }
6924
- const bestByProfit = collectOptions.reduce((best, opt) => opt.estimatedProfit > best.estimatedProfit ? opt : best);
6925
- if (bestByProfit.id !== bestByProfitPerSecond.id || !meetsQualityThreshold) {
6926
- bestByProfit.highestProfit = true;
6927
- }
6928
- }
6929
- return {
6930
- arrivedAt,
6931
- ship,
6932
- cargo,
6933
- cargoValueHere,
6934
- options: collectOptions,
6935
- hasProfitableOptions: collectOptions.some((o) => o.estimatedProfit.gt(antelope.UInt64.zero)),
6936
- };
6937
- }
6938
-
6939
- class TradesManager extends BaseManager {
6940
- constructor() {
6941
- super(...arguments);
6942
- this.priceCache = new Map();
6943
- }
6944
- makePriceCacheKey(location) {
6945
- return `${location.x},${location.y}`;
6946
- }
6947
- async createCallbacks() {
6948
- const game = await this.getGame();
6949
- const serverState = await this.getState();
6950
- const currentEpoch = getCurrentEpoch(game);
6951
- if (!this.priceCacheEpoch || !this.priceCacheEpoch.equals(currentEpoch)) {
6952
- this.priceCache.clear();
6953
- this.priceCacheEpoch = currentEpoch;
6954
- }
6955
- const getNearbyLocations = async (origin, maxDistance) => {
6956
- const nearby = findNearbyPlanets(game.config.seed, origin, maxDistance);
6957
- return nearby.map((d) => toLocation(d.destination));
6958
- };
6959
- const getMarketPrices = async (location) => {
6960
- const cacheKey = this.makePriceCacheKey(location);
6961
- const cached = this.priceCache.get(cacheKey);
6962
- if (cached) {
6963
- return cached;
6964
- }
6965
- const locationWithSupply = await this.context.locations.getLocationComplete(location);
6966
- const prices = locationWithSupply.marketPrices || [];
6967
- const result = prices.map((price) => {
6968
- const actualSupply = locationWithSupply.getSupply(price.id);
6969
- if (actualSupply !== undefined) {
6970
- return exports.ItemPrice.from({
6971
- id: price.id,
6972
- item: price.item,
6973
- price: price.price,
6974
- supply: actualSupply,
6975
- });
6976
- }
6977
- return price;
6978
- });
6979
- this.priceCache.set(cacheKey, result);
6980
- return result;
6981
- };
6982
- const getGameSeed = () => game.config.seed;
6983
- const getState = () => serverState;
6984
- return { getNearbyLocations, getMarketPrices, getGameSeed, getState };
6985
- }
6986
- clearPriceCache() {
6987
- this.priceCache.clear();
6988
- this.priceCacheEpoch = undefined;
6989
- }
6990
- async findDeals(ship, originLocation, options = {}) {
6991
- const origin = originLocation || Coordinates.from(ship.coordinates);
6992
- const callbacks = await this.createCallbacks();
6993
- const deals = await findDealsForShip(ship, origin, callbacks.getNearbyLocations, callbacks.getMarketPrices, options);
6994
- return deals;
6995
- }
6996
- async findBestDeal(ship, originLocation, options = {}) {
6997
- const deals = await this.findDeals(ship, originLocation, { ...options, maxDeals: 1 });
6998
- return deals[0];
6999
- }
7000
- async getCollectOptions(ship, arrivedAt, options = {}) {
7001
- const location = arrivedAt || Coordinates.from(ship.coordinates);
7002
- const callbacks = await this.createCallbacks();
7003
- return analyzeCollectOptions(ship, location, callbacks, options);
7004
- }
7005
- }
7006
-
7007
5667
  class EpochsManager extends BaseManager {
7008
5668
  async getCurrentHeight() {
7009
5669
  const game = await this.getGame();
@@ -7089,61 +5749,13 @@ class ActionsManager extends BaseManager {
7089
5749
  });
7090
5750
  }
7091
5751
  transfer(sourceType, sourceId, destType, destId, goodId, quantity) {
7092
- return this.server.action('transfer', {
7093
- source_type: sourceType,
7094
- source_id: antelope.UInt64.from(sourceId),
7095
- dest_type: destType,
7096
- dest_id: antelope.UInt64.from(destId),
7097
- item_id: antelope.UInt16.from(goodId),
7098
- quantity: antelope.UInt32.from(quantity),
7099
- });
7100
- }
7101
- buyItems(entityId, goodId, quantity, entityType = EntityType.SHIP) {
7102
- return this.server.action('buyitems', {
7103
- entity_type: entityType,
7104
- id: antelope.UInt64.from(entityId),
7105
- item_id: antelope.UInt16.from(goodId),
7106
- quantity: antelope.UInt32.from(quantity),
7107
- });
7108
- }
7109
- sellItems(entityId, goodId, quantity, entityType = EntityType.SHIP) {
7110
- return this.server.action('sellitems', {
7111
- entity_type: entityType,
7112
- id: antelope.UInt64.from(entityId),
7113
- item_id: antelope.UInt16.from(goodId),
7114
- quantity: antelope.UInt32.from(quantity),
7115
- });
7116
- }
7117
- buyShip(account, name) {
7118
- return this.server.action('buyship', {
7119
- account: antelope.Name.from(account),
7120
- name,
7121
- });
7122
- }
7123
- buyWarehouse(account, shipId, name) {
7124
- return this.server.action('buywarehouse', {
7125
- account: antelope.Name.from(account),
7126
- ship_id: antelope.UInt64.from(shipId),
7127
- name,
7128
- });
7129
- }
7130
- buyContainer(account, shipId, name) {
7131
- return this.server.action('buycontainer', {
7132
- account: antelope.Name.from(account),
7133
- ship_id: antelope.UInt64.from(shipId),
7134
- name,
7135
- });
7136
- }
7137
- takeLoan(account, amount) {
7138
- return this.server.action('takeloan', {
7139
- account: antelope.Name.from(account),
7140
- amount: antelope.UInt64.from(amount),
7141
- });
7142
- }
7143
- payLoan(account, amount) {
7144
- return this.server.action('payloan', {
7145
- account: antelope.Name.from(account),
7146
- amount: antelope.UInt64.from(amount),
5752
+ return this.server.action('transfer', {
5753
+ source_type: sourceType,
5754
+ source_id: antelope.UInt64.from(sourceId),
5755
+ dest_type: destType,
5756
+ dest_id: antelope.UInt64.from(destId),
5757
+ item_id: antelope.UInt16.from(goodId),
5758
+ quantity: antelope.UInt32.from(quantity),
7147
5759
  });
7148
5760
  }
7149
5761
  foundCompany(account, name) {
@@ -7172,25 +5784,32 @@ class ActionsManager extends BaseManager {
7172
5784
  y,
7173
5785
  });
7174
5786
  }
5787
+ craft(entityType, entityId, recipeId, quantity, inputs) {
5788
+ const cargoInputs = inputs.map((i) => Types.cargo_item.from({
5789
+ item_id: antelope.UInt16.from(i.itemId),
5790
+ quantity: antelope.UInt32.from(i.quantity),
5791
+ seed: i.seed !== undefined ? antelope.UInt64.from(i.seed) : null,
5792
+ }));
5793
+ return this.server.action('craft', {
5794
+ entity_type: entityType,
5795
+ id: antelope.UInt64.from(entityId),
5796
+ recipe_id: antelope.UInt16.from(recipeId),
5797
+ quantity: antelope.UInt32.from(quantity),
5798
+ inputs: cargoInputs,
5799
+ });
5800
+ }
5801
+ deploy(entityType, entityId, packedItemId, seed, entityName) {
5802
+ return this.server.action('deploy', {
5803
+ entity_type: entityType,
5804
+ id: antelope.UInt64.from(entityId),
5805
+ packed_item_id: antelope.UInt16.from(packedItemId),
5806
+ seed: antelope.UInt64.from(seed),
5807
+ entity_name: entityName,
5808
+ });
5809
+ }
7175
5810
  joinGame(account, companyName) {
7176
5811
  return [this.foundCompany(account, companyName), this.join(account)];
7177
5812
  }
7178
- sellAllCargo(ship, cargo) {
7179
- let shipCargo;
7180
- if (ship instanceof Ship) {
7181
- shipCargo = cargo || ship.inventory;
7182
- }
7183
- else {
7184
- if (!cargo) {
7185
- throw new Error('cargo parameter required when ship is a UInt64Type');
7186
- }
7187
- shipCargo = cargo;
7188
- }
7189
- const shipId = ship instanceof Ship ? ship.id : antelope.UInt64.from(ship);
7190
- return shipCargo
7191
- .filter((c) => c.hasCargo)
7192
- .map((c) => this.sellItems(shipId, c.item_id, c.quantity, EntityType.SHIP));
7193
- }
7194
5813
  }
7195
5814
 
7196
5815
  class GameContext {
@@ -7217,12 +5836,6 @@ class GameContext {
7217
5836
  }
7218
5837
  return this._locations;
7219
5838
  }
7220
- get trades() {
7221
- if (!this._trades) {
7222
- this._trades = new TradesManager(this);
7223
- }
7224
- return this._trades;
7225
- }
7226
5839
  get epochs() {
7227
5840
  if (!this._epochs) {
7228
5841
  this._epochs = new EpochsManager(this);
@@ -7319,9 +5932,6 @@ class Shipload {
7319
5932
  get locations() {
7320
5933
  return this._context.locations;
7321
5934
  }
7322
- get trades() {
7323
- return this._context.trades;
7324
- }
7325
5935
  get epochs() {
7326
5936
  return this._context.epochs;
7327
5937
  }
@@ -7398,138 +6008,6 @@ function makeContainer(state) {
7398
6008
  return new Container(entityInfo);
7399
6009
  }
7400
6010
 
7401
- const DEPTH_THRESHOLD_T1 = 0;
7402
- const DEPTH_THRESHOLD_T2 = 2000;
7403
- const DEPTH_THRESHOLD_T3 = 10000;
7404
- const DEPTH_THRESHOLD_T4 = 30000;
7405
- const DEPTH_THRESHOLD_T5 = 55000;
7406
- const LOCATION_MIN_DEPTH = 500;
7407
- const LOCATION_MAX_DEPTH = 65535;
7408
- const YIELD_THRESHOLD = Math.floor(0.003 * 0xffffffff);
7409
- const PLANET_SUBTYPE_GAS_GIANT = 0;
7410
- const PLANET_SUBTYPE_ROCKY = 1;
7411
- const PLANET_SUBTYPE_TERRESTRIAL = 2;
7412
- const PLANET_SUBTYPE_ICY = 3;
7413
- const PLANET_SUBTYPE_OCEAN = 4;
7414
- const PLANET_SUBTYPE_INDUSTRIAL = 5;
7415
- const RESOURCE_CATALOG = [
7416
- { id: 26, tier: 't1' },
7417
- { id: 13, tier: 't2' },
7418
- { id: 24, tier: 't3' },
7419
- { id: 29, tier: 't1' },
7420
- { id: 47, tier: 't2' },
7421
- { id: 79, tier: 't3' },
7422
- { id: 1, tier: 't1' },
7423
- { id: 2, tier: 't2' },
7424
- { id: 18, tier: 't3' },
7425
- { id: 14, tier: 't1' },
7426
- { id: 1000, tier: 't2' },
7427
- { id: 1001, tier: 't3' },
7428
- { id: 6, tier: 't1' },
7429
- { id: 1003, tier: 't2' },
7430
- { id: 1002, tier: 't3' },
7431
- ];
7432
- function getDepthThreshold(tier) {
7433
- switch (tier) {
7434
- case 't1':
7435
- return DEPTH_THRESHOLD_T1;
7436
- case 't2':
7437
- return DEPTH_THRESHOLD_T2;
7438
- case 't3':
7439
- return DEPTH_THRESHOLD_T3;
7440
- case 't4':
7441
- return DEPTH_THRESHOLD_T4;
7442
- case 't5':
7443
- return DEPTH_THRESHOLD_T5;
7444
- }
7445
- }
7446
- function getResourceTier(itemId) {
7447
- const entry = RESOURCE_CATALOG.find((r) => r.id === itemId);
7448
- return entry ? entry.tier : 't5';
7449
- }
7450
- function getResourceWeight(itemId, stratum) {
7451
- const tier = getResourceTier(itemId);
7452
- const threshold = getDepthThreshold(tier);
7453
- if (stratum < threshold)
7454
- return 0;
7455
- const depthAbove = stratum - threshold;
7456
- switch (tier) {
7457
- case 't1':
7458
- if (stratum < 2000)
7459
- return 100;
7460
- if (stratum < 10000)
7461
- return 80;
7462
- if (stratum < 30000)
7463
- return 50;
7464
- return 30;
7465
- case 't2':
7466
- if (depthAbove < 3000)
7467
- return 40;
7468
- if (depthAbove < 8000)
7469
- return 60;
7470
- return 50;
7471
- case 't3':
7472
- if (depthAbove < 5000)
7473
- return 20;
7474
- if (depthAbove < 15000)
7475
- return 35;
7476
- return 40;
7477
- case 't4':
7478
- if (depthAbove < 10000)
7479
- return 10;
7480
- if (depthAbove < 25000)
7481
- return 20;
7482
- return 30;
7483
- case 't5':
7484
- return 10;
7485
- }
7486
- }
7487
- const ASTEROID_RESOURCES = [26, 13, 24, 29, 47];
7488
- const NEBULA_RESOURCES = [47, 79, 1, 2, 18];
7489
- const GAS_GIANT_RESOURCES = [1, 2, 18, 14, 6];
7490
- const ROCKY_RESOURCES = [26, 13, 24, 14, 1000, 1001, 1002];
7491
- const TERRESTRIAL_RESOURCES = [29, 47, 14, 1000, 6, 1003, 1002];
7492
- const ICY_RESOURCES = [26, 1, 2, 14, 1001, 6, 1003];
7493
- const OCEAN_RESOURCES = [29, 79, 1, 18, 6, 1003, 1002];
7494
- const INDUSTRIAL_RESOURCES = [26, 13, 24, 29, 79, 1000, 1001];
7495
- function getLocationCandidates(locationType, subtype) {
7496
- if (locationType === 2)
7497
- return ASTEROID_RESOURCES;
7498
- if (locationType === 3)
7499
- return NEBULA_RESOURCES;
7500
- if (locationType === 1) {
7501
- switch (subtype) {
7502
- case PLANET_SUBTYPE_GAS_GIANT:
7503
- return GAS_GIANT_RESOURCES;
7504
- case PLANET_SUBTYPE_ROCKY:
7505
- return ROCKY_RESOURCES;
7506
- case PLANET_SUBTYPE_TERRESTRIAL:
7507
- return TERRESTRIAL_RESOURCES;
7508
- case PLANET_SUBTYPE_ICY:
7509
- return ICY_RESOURCES;
7510
- case PLANET_SUBTYPE_OCEAN:
7511
- return OCEAN_RESOURCES;
7512
- case PLANET_SUBTYPE_INDUSTRIAL:
7513
- return INDUSTRIAL_RESOURCES;
7514
- }
7515
- }
7516
- return [];
7517
- }
7518
- function getEligibleResources(locationType, subtype, stratum) {
7519
- const candidates = getLocationCandidates(locationType, subtype);
7520
- return candidates.filter((itemId) => {
7521
- const tier = getResourceTier(itemId);
7522
- const threshold = getDepthThreshold(tier);
7523
- return stratum >= threshold;
7524
- });
7525
- }
7526
- function depthScaleFactor(stratum) {
7527
- if (stratum <= 1)
7528
- return 1.0;
7529
- const logScale = Math.log(stratum) / Math.log(65535);
7530
- return 1.0 + logScale * 2.0;
7531
- }
7532
-
7533
6011
  function deriveStratum(epochSeed, coords, stratum, locationType, subtype, _maxDepth) {
7534
6012
  const seed = antelope.Checksum256.from(epochSeed);
7535
6013
  const c = Coordinates.from(coords);
@@ -7578,7 +6056,7 @@ function deriveStratum(epochSeed, coords, stratum, locationType, subtype, _maxDe
7578
6056
  const baseRichness = Math.floor(normalized * normalized * 999) + 1;
7579
6057
  let depthBonus = 0;
7580
6058
  if (stratum > 1) {
7581
- depthBonus = 50 * Math.log(stratum) / Math.log(65535);
6059
+ depthBonus = (50 * Math.log(stratum)) / Math.log(65535);
7582
6060
  }
7583
6061
  const richness = Math.min(Math.floor(baseRichness + depthBonus), 1000);
7584
6062
  return { itemId: selectedItemId, seed: seedBigInt, richness, reserve };
@@ -7606,40 +6084,106 @@ function deriveResourceStats(seed) {
7606
6084
  };
7607
6085
  }
7608
6086
 
7609
- function deriveLocationSize(loc) {
7610
- if (loc.type.toNumber() === exports.LocationType.EMPTY)
7611
- return 0;
7612
- const raw = (loc.seed0.toNumber() << 8) | loc.seed1.toNumber();
7613
- const normalized = raw / 65535;
7614
- const curved = Math.pow(normalized, 3.0);
7615
- const range = LOCATION_MAX_DEPTH - LOCATION_MIN_DEPTH;
7616
- return Math.floor(LOCATION_MIN_DEPTH + curved * range);
7617
- }
7618
-
7619
6087
  const METAL_STATS = [
7620
- { key: 'strength', label: 'Strength', abbreviation: 'STR', purpose: 'Raw structural/mechanical force' },
7621
- { key: 'tolerance', label: 'Tolerance', abbreviation: 'TOL', purpose: 'Ability to withstand heat, pressure, and stress extremes' },
7622
- { key: 'density', label: 'Density', abbreviation: 'DEN', purpose: 'Mass per unit', inverted: true },
6088
+ {
6089
+ key: 'strength',
6090
+ label: 'Strength',
6091
+ abbreviation: 'STR',
6092
+ purpose: 'Raw structural/mechanical force',
6093
+ },
6094
+ {
6095
+ key: 'tolerance',
6096
+ label: 'Tolerance',
6097
+ abbreviation: 'TOL',
6098
+ purpose: 'Ability to withstand heat, pressure, and stress extremes',
6099
+ },
6100
+ {
6101
+ key: 'density',
6102
+ label: 'Density',
6103
+ abbreviation: 'DEN',
6104
+ purpose: 'Mass per unit',
6105
+ inverted: true,
6106
+ },
7623
6107
  ];
7624
6108
  const PRECIOUS_STATS = [
7625
- { key: 'conductivity', label: 'Conductivity', abbreviation: 'CON', purpose: 'Efficiency of energy/signal transfer' },
7626
- { key: 'ductility', label: 'Ductility', abbreviation: 'DUC', purpose: 'Ability to be worked into fine, precise shapes' },
7627
- { key: 'reflectivity', label: 'Reflectivity', abbreviation: 'REF', purpose: 'Surface quality for heat management and precision optics' },
6109
+ {
6110
+ key: 'conductivity',
6111
+ label: 'Conductivity',
6112
+ abbreviation: 'CON',
6113
+ purpose: 'Efficiency of energy/signal transfer',
6114
+ },
6115
+ {
6116
+ key: 'ductility',
6117
+ label: 'Ductility',
6118
+ abbreviation: 'DUC',
6119
+ purpose: 'Ability to be worked into fine, precise shapes',
6120
+ },
6121
+ {
6122
+ key: 'reflectivity',
6123
+ label: 'Reflectivity',
6124
+ abbreviation: 'REF',
6125
+ purpose: 'Surface quality for heat management and precision optics',
6126
+ },
7628
6127
  ];
7629
6128
  const GAS_STATS = [
7630
- { key: 'volatility', label: 'Volatility', abbreviation: 'VOL', purpose: 'Energy release potential for propulsion and force' },
7631
- { key: 'reactivity', label: 'Reactivity', abbreviation: 'REA', purpose: 'Chemical interaction speed for processing and penetration' },
7632
- { key: 'thermal', label: 'Thermal', abbreviation: 'THM', purpose: 'Heat capacity for thermal management' },
6129
+ {
6130
+ key: 'volatility',
6131
+ label: 'Volatility',
6132
+ abbreviation: 'VOL',
6133
+ purpose: 'Energy release potential for propulsion and force',
6134
+ },
6135
+ {
6136
+ key: 'reactivity',
6137
+ label: 'Reactivity',
6138
+ abbreviation: 'REA',
6139
+ purpose: 'Chemical interaction speed for processing and penetration',
6140
+ },
6141
+ {
6142
+ key: 'thermal',
6143
+ label: 'Thermal',
6144
+ abbreviation: 'THM',
6145
+ purpose: 'Heat capacity for thermal management',
6146
+ },
7633
6147
  ];
7634
6148
  const MINERAL_STATS = [
7635
- { key: 'resonance', label: 'Resonance', abbreviation: 'RES', purpose: 'Energy field interaction — storage, focusing, projection' },
7636
- { key: 'hardness', label: 'Hardness', abbreviation: 'HRD', purpose: 'Resistance to wear — cutting surfaces, penetration' },
7637
- { key: 'clarity', label: 'Clarity', abbreviation: 'CLR', purpose: 'Crystalline perfection — precision optics' },
6149
+ {
6150
+ key: 'resonance',
6151
+ label: 'Resonance',
6152
+ abbreviation: 'RES',
6153
+ purpose: 'Energy field interaction — storage, focusing, projection',
6154
+ },
6155
+ {
6156
+ key: 'hardness',
6157
+ label: 'Hardness',
6158
+ abbreviation: 'HRD',
6159
+ purpose: 'Resistance to wear — cutting surfaces, penetration',
6160
+ },
6161
+ {
6162
+ key: 'clarity',
6163
+ label: 'Clarity',
6164
+ abbreviation: 'CLR',
6165
+ purpose: 'Crystalline perfection — precision optics',
6166
+ },
7638
6167
  ];
7639
6168
  const ORGANIC_STATS = [
7640
- { key: 'plasticity', label: 'Plasticity', abbreviation: 'PLA', purpose: 'Ease of reshaping — speeds processing' },
7641
- { key: 'insulation', label: 'Insulation', abbreviation: 'INS', purpose: 'Energy containment — reduces energy loss' },
7642
- { key: 'purity', label: 'Purity', abbreviation: 'PUR', purpose: 'Biological cleanliness — better composites and lubricants' },
6169
+ {
6170
+ key: 'plasticity',
6171
+ label: 'Plasticity',
6172
+ abbreviation: 'PLA',
6173
+ purpose: 'Ease of reshaping — speeds processing',
6174
+ },
6175
+ {
6176
+ key: 'insulation',
6177
+ label: 'Insulation',
6178
+ abbreviation: 'INS',
6179
+ purpose: 'Energy containment — reduces energy loss',
6180
+ },
6181
+ {
6182
+ key: 'purity',
6183
+ label: 'Purity',
6184
+ abbreviation: 'PUR',
6185
+ purpose: 'Biological cleanliness — better composites and lubricants',
6186
+ },
7643
6187
  ];
7644
6188
  const STAT_MAP = {
7645
6189
  metal: METAL_STATS,
@@ -7661,6 +6205,231 @@ function resolveStats(category, stats) {
7661
6205
  };
7662
6206
  }
7663
6207
 
6208
+ const ITEM_HULL_PLATES = 10001;
6209
+ const ITEM_CARGO_LINING = 10002;
6210
+ const ITEM_CONTAINER_PACKED = 10003;
6211
+ const components = [
6212
+ {
6213
+ id: ITEM_HULL_PLATES,
6214
+ name: 'Hull Plates',
6215
+ description: 'Structural plating formed from metal. Used in hulls, containers, and frames.',
6216
+ color: '#7B8D9E',
6217
+ mass: 50000,
6218
+ stats: [
6219
+ { key: 'strength', source: 'metal' },
6220
+ { key: 'density', source: 'metal' },
6221
+ ],
6222
+ recipe: [{ category: 'metal', quantity: 40 }],
6223
+ usedIn: [{ type: 'entity', name: 'Container' }],
6224
+ },
6225
+ {
6226
+ id: ITEM_CARGO_LINING,
6227
+ name: 'Cargo Lining',
6228
+ description: 'Precision-formed composite lining for cargo storage. Combines precious metal shaping with organic sealing.',
6229
+ color: '#D4A843',
6230
+ mass: 30000,
6231
+ stats: [
6232
+ { key: 'ductility', source: 'precious' },
6233
+ { key: 'purity', source: 'organic' },
6234
+ ],
6235
+ recipe: [
6236
+ { category: 'precious', quantity: 10 },
6237
+ { category: 'organic', quantity: 20 },
6238
+ ],
6239
+ usedIn: [{ type: 'entity', name: 'Container' }],
6240
+ },
6241
+ ];
6242
+ const entityRecipes = [
6243
+ {
6244
+ id: 'container',
6245
+ name: 'Container',
6246
+ description: 'Passive floating cargo storage in space. Towed by ships.',
6247
+ color: '#7B8D9E',
6248
+ packedItemId: ITEM_CONTAINER_PACKED,
6249
+ recipe: [
6250
+ { itemId: ITEM_HULL_PLATES, quantity: 6 },
6251
+ { itemId: ITEM_CARGO_LINING, quantity: 2 },
6252
+ ],
6253
+ stats: [
6254
+ { key: 'strength', sourceComponentId: ITEM_HULL_PLATES, sourceStatKey: 'strength' },
6255
+ { key: 'density', sourceComponentId: ITEM_HULL_PLATES, sourceStatKey: 'density' },
6256
+ { key: 'ductility', sourceComponentId: ITEM_CARGO_LINING, sourceStatKey: 'ductility' },
6257
+ { key: 'purity', sourceComponentId: ITEM_CARGO_LINING, sourceStatKey: 'purity' },
6258
+ ],
6259
+ },
6260
+ ];
6261
+ function getComponentById(id) {
6262
+ return components.find((c) => c.id === id);
6263
+ }
6264
+ function getEntityRecipe(id) {
6265
+ return entityRecipes.find((r) => r.id === id);
6266
+ }
6267
+ function getEntityRecipeByItemId(itemId) {
6268
+ return entityRecipes.find((r) => r.packedItemId === itemId);
6269
+ }
6270
+ function getAllCraftableItems() {
6271
+ const items = [];
6272
+ for (const comp of components) {
6273
+ items.push({ type: 'component', id: comp.id, name: comp.name, description: comp.description, color: comp.color });
6274
+ }
6275
+ for (const entity of entityRecipes) {
6276
+ items.push({ type: 'entity', id: entity.id, name: entity.name, description: entity.description, color: entity.color });
6277
+ }
6278
+ return items;
6279
+ }
6280
+ function getComponentsForCategory(category) {
6281
+ return components.filter((c) => c.recipe.some((r) => r.category === category));
6282
+ }
6283
+ function getComponentsForStat(statKey) {
6284
+ return components.filter((c) => c.stats.some((s) => s.key === statKey));
6285
+ }
6286
+
6287
+ function encodeStats(values) {
6288
+ let seed = 0n;
6289
+ for (let i = 0; i < values.length && i < 6; i++) {
6290
+ seed |= BigInt(values[i] & 0x3ff) << BigInt(i * 10);
6291
+ }
6292
+ return seed;
6293
+ }
6294
+ function decodeStats(seed, count) {
6295
+ const stats = [];
6296
+ for (let i = 0; i < count; i++) {
6297
+ stats.push(Number((seed >> BigInt(i * 10)) & 0x3ffn));
6298
+ }
6299
+ return stats;
6300
+ }
6301
+ function decodeCraftedItemStats(itemId, seed) {
6302
+ const comp = getComponentById(itemId);
6303
+ if (comp) {
6304
+ const values = decodeStats(seed, comp.stats.length);
6305
+ const result = {};
6306
+ for (let i = 0; i < comp.stats.length; i++) {
6307
+ result[comp.stats[i].key] = values[i];
6308
+ }
6309
+ return result;
6310
+ }
6311
+ const entityRecipe = entityRecipes.find((r) => r.packedItemId === itemId);
6312
+ if (entityRecipe) {
6313
+ const values = decodeStats(seed, entityRecipe.stats.length);
6314
+ const result = {};
6315
+ for (let i = 0; i < entityRecipe.stats.length; i++) {
6316
+ result[entityRecipe.stats[i].key] = values[i];
6317
+ }
6318
+ return result;
6319
+ }
6320
+ return {};
6321
+ }
6322
+ function blendStacks(stacks, statKey) {
6323
+ let totalQty = 0;
6324
+ let weightedSum = 0;
6325
+ for (const stack of stacks) {
6326
+ const val = stack.stats[statKey] ?? 0;
6327
+ weightedSum += val * stack.quantity;
6328
+ totalQty += stack.quantity;
6329
+ }
6330
+ if (totalQty === 0)
6331
+ return 0;
6332
+ return Math.round(weightedSum / totalQty);
6333
+ }
6334
+ function computeComponentStats(componentId, categoryStacks) {
6335
+ const comp = getComponentById(componentId);
6336
+ if (!comp)
6337
+ return [];
6338
+ return comp.stats.map((statDef) => {
6339
+ const matching = categoryStacks.find((cs) => cs.category === statDef.source);
6340
+ const value = matching ? blendStacks(matching.stacks, statDef.key) : 0;
6341
+ return { key: statDef.key, value: Math.max(1, Math.min(999, value)) };
6342
+ });
6343
+ }
6344
+ function blendComponentStacks(stacks) {
6345
+ if (stacks.length === 0)
6346
+ return {};
6347
+ const allKeys = new Set();
6348
+ for (const s of stacks) {
6349
+ for (const k of Object.keys(s.stats))
6350
+ allKeys.add(k);
6351
+ }
6352
+ const result = {};
6353
+ for (const key of allKeys) {
6354
+ result[key] = blendStacks(stacks.map((s) => ({ quantity: s.quantity, stats: s.stats })), key);
6355
+ }
6356
+ return result;
6357
+ }
6358
+ function computeEntityStats(entityRecipeId, componentStacks) {
6359
+ const recipe = getEntityRecipe(entityRecipeId);
6360
+ if (!recipe)
6361
+ return [];
6362
+ const blendedByComponent = {};
6363
+ for (const [compId, stacks] of Object.entries(componentStacks)) {
6364
+ blendedByComponent[Number(compId)] = blendComponentStacks(stacks);
6365
+ }
6366
+ return recipe.stats.map((stat) => {
6367
+ const blended = blendedByComponent[stat.sourceComponentId] ?? {};
6368
+ const value = blended[stat.sourceStatKey] ?? 0;
6369
+ return { key: stat.key, value: Math.max(1, Math.min(999, value)) };
6370
+ });
6371
+ }
6372
+
6373
+ function totalCargoMass(cargo) {
6374
+ return cargo.reduce((sum, c) => {
6375
+ return sum.adding(c.totalMass);
6376
+ }, antelope.UInt64.from(0));
6377
+ }
6378
+ function getCargoForItem(cargo, goodId) {
6379
+ return cargo.find((c) => c.item_id.equals(goodId));
6380
+ }
6381
+ function hasSpace(currentMass, maxCapacity, goodMass, quantity) {
6382
+ const additionalMass = goodMass.multiplying(quantity);
6383
+ const totalMass = currentMass.adding(additionalMass);
6384
+ return totalMass.lte(maxCapacity);
6385
+ }
6386
+ function availableCapacity(currentMass, maxCapacity) {
6387
+ if (currentMass.gte(maxCapacity)) {
6388
+ return antelope.UInt64.from(0);
6389
+ }
6390
+ return maxCapacity.subtracting(currentMass);
6391
+ }
6392
+ function isFull(currentMass, maxCapacity) {
6393
+ return currentMass.gte(maxCapacity);
6394
+ }
6395
+ function afterRemoveItems(cargo, goodsToRemove) {
6396
+ if (cargo.length === 0) {
6397
+ return [];
6398
+ }
6399
+ return cargo.map((item) => {
6400
+ const removeItem = goodsToRemove.find((s) => Number(item.item_id) === s.goodId);
6401
+ if (!removeItem) {
6402
+ return new EntityInventory(item);
6403
+ }
6404
+ const currentQty = Number(item.quantity);
6405
+ const newQty = Math.max(0, currentQty - removeItem.quantity);
6406
+ return new EntityInventory(Types.cargo_item.from({
6407
+ item_id: item.item_id,
6408
+ quantity: antelope.UInt32.from(newQty),
6409
+ }));
6410
+ });
6411
+ }
6412
+ function afterRemoveAllItems(cargo) {
6413
+ if (cargo.length === 0) {
6414
+ return [];
6415
+ }
6416
+ return cargo.map((item) => new EntityInventory(Types.cargo_item.from({
6417
+ item_id: item.item_id,
6418
+ quantity: antelope.UInt32.from(0),
6419
+ })));
6420
+ }
6421
+
6422
+ var cargoUtils = /*#__PURE__*/Object.freeze({
6423
+ __proto__: null,
6424
+ totalCargoMass: totalCargoMass,
6425
+ getCargoForItem: getCargoForItem,
6426
+ hasSpace: hasSpace,
6427
+ availableCapacity: availableCapacity,
6428
+ isFull: isFull,
6429
+ afterRemoveItems: afterRemoveItems,
6430
+ afterRemoveAllItems: afterRemoveAllItems
6431
+ });
6432
+
7664
6433
  function canMove(e) {
7665
6434
  return 'engines' in e && 'generator' in e && 'energy' in e;
7666
6435
  }
@@ -7673,9 +6442,6 @@ function hasStorage(e) {
7673
6442
  function hasLoaders(e) {
7674
6443
  return 'loaders' in e && e.loaders !== undefined;
7675
6444
  }
7676
- function hasTrade(e) {
7677
- return 'trade' in e && e.trade !== undefined;
7678
- }
7679
6445
  function hasMass(e) {
7680
6446
  return 'hullmass' in e;
7681
6447
  }
@@ -7709,6 +6475,10 @@ function calc_extraction_energy(extractor, duration) {
7709
6475
  return antelope.UInt16.from(energy);
7710
6476
  }
7711
6477
 
6478
+ function capsHasCrafter(caps) {
6479
+ return caps.crafter !== undefined;
6480
+ }
6481
+
7712
6482
  exports.ActionsManager = ActionsManager;
7713
6483
  exports.COMMIT_ALREADY_SET = COMMIT_ALREADY_SET;
7714
6484
  exports.COMMIT_CANNOT_MATCH = COMMIT_CANNOT_MATCH;
@@ -7756,7 +6526,10 @@ exports.INSUFFICIENT_BALANCE = INSUFFICIENT_BALANCE;
7756
6526
  exports.INSUFFICIENT_ITEM_QUANTITY = INSUFFICIENT_ITEM_QUANTITY;
7757
6527
  exports.INSUFFICIENT_ITEM_SUPPLY = INSUFFICIENT_ITEM_SUPPLY;
7758
6528
  exports.INVALID_AMOUNT = INVALID_AMOUNT;
6529
+ exports.ITEM_CARGO_LINING = ITEM_CARGO_LINING;
6530
+ exports.ITEM_CONTAINER_PACKED = ITEM_CONTAINER_PACKED;
7759
6531
  exports.ITEM_DOES_NOT_EXIST = ITEM_DOES_NOT_EXIST;
6532
+ exports.ITEM_HULL_PLATES = ITEM_HULL_PLATES;
7760
6533
  exports.ITEM_NOT_AVAILABLE_AT_LOCATION = ITEM_NOT_AVAILABLE_AT_LOCATION;
7761
6534
  exports.InventoryAccessor = InventoryAccessor;
7762
6535
  exports.LOCATION_MAX_DEPTH = LOCATION_MAX_DEPTH;
@@ -7803,18 +6576,16 @@ exports.ServerContract = server;
7803
6576
  exports.Ship = Ship;
7804
6577
  exports.Shipload = Shipload;
7805
6578
  exports.TRAVEL_MAX_DURATION = TRAVEL_MAX_DURATION;
7806
- exports.TradesManager = TradesManager;
7807
6579
  exports.WAREHOUSE_ALREADY_AT_LOCATION = WAREHOUSE_ALREADY_AT_LOCATION;
7808
6580
  exports.WAREHOUSE_CAPACITY_EXCEEDED = WAREHOUSE_CAPACITY_EXCEEDED;
7809
6581
  exports.WAREHOUSE_NOT_FOUND = WAREHOUSE_NOT_FOUND;
7810
6582
  exports.WAREHOUSE_Z = WAREHOUSE_Z;
7811
6583
  exports.Warehouse = Warehouse;
7812
- exports.analyzeCargoSale = analyzeCargoSale;
7813
- exports.analyzeCollectOptions = analyzeCollectOptions;
7814
6584
  exports.availableCapacity = availableCapacity$1;
7815
6585
  exports.availableCapacityFromMass = availableCapacityFromMass;
6586
+ exports.blendComponentStacks = blendComponentStacks;
6587
+ exports.blendStacks = blendStacks;
7816
6588
  exports.calcCargoMass = calcCargoMass;
7817
- exports.calcCargoValue = calcCargoValue;
7818
6589
  exports.calcEnergyUsage = calcEnergyUsage;
7819
6590
  exports.calcLoadDuration = calcLoadDuration;
7820
6591
  exports.calc_acceleration = calc_acceleration;
@@ -7831,34 +6602,28 @@ exports.calc_ship_flighttime = calc_ship_flighttime;
7831
6602
  exports.calc_ship_mass = calc_ship_mass;
7832
6603
  exports.calc_ship_rechargetime = calc_ship_rechargetime;
7833
6604
  exports.calc_transfer_duration = calc_transfer_duration;
7834
- exports.calculateBreakEvenPrice = calculateBreakEvenPrice;
7835
6605
  exports.calculateFlightTime = calculateFlightTime;
7836
6606
  exports.calculateLoadTimeBreakdown = calculateLoadTimeBreakdown;
7837
- exports.calculateMaxTradeQuantity = calculateMaxTradeQuantity;
7838
- exports.calculateProfitPerMass = calculateProfitPerMass;
7839
- exports.calculateProfitPerSecond = calculateProfitPerSecond;
7840
- exports.calculateROI = calculateROI;
7841
6607
  exports.calculateRefuelingTime = calculateRefuelingTime;
7842
- exports.calculateTradeProfit = calculateTradeProfit;
7843
6608
  exports.calculateTransferTime = calculateTransferTime;
7844
- exports.calculateUpdatedCargoCost = calculateUpdatedCargoCost;
7845
6609
  exports.canMove = canMove;
6610
+ exports.capsHasCrafter = capsHasCrafter;
7846
6611
  exports.capsHasExtractor = capsHasExtractor;
7847
6612
  exports.capsHasLoaders = capsHasLoaders;
7848
6613
  exports.capsHasMass = capsHasMass;
7849
6614
  exports.capsHasMovement = capsHasMovement;
7850
6615
  exports.capsHasStorage = capsHasStorage;
7851
- exports.capsHasTrade = capsHasTrade;
7852
6616
  exports.cargoUtils = cargoUtils;
6617
+ exports.components = components;
6618
+ exports.computeComponentStats = computeComponentStats;
6619
+ exports.computeContainerCapabilities = computeContainerCapabilities;
6620
+ exports.computeEntityStats = computeEntityStats;
7853
6621
  exports.coordsToLocationId = coordsToLocationId;
7854
- exports.createExploreOption = createExploreOption;
7855
6622
  exports.createInventoryAccessor = createInventoryAccessor;
7856
6623
  exports.createProjectedEntity = createProjectedEntity;
7857
6624
  exports.createScheduleAccessor = createScheduleAccessor;
7858
- exports.createSellAndRepositionOption = createSellAndRepositionOption;
7859
- exports.createSellAndStayOption = createSellAndStayOption;
7860
- exports.createSellAndTradeOption = createSellAndTradeOption;
7861
- exports.createTravelToSellOption = createTravelToSellOption;
6625
+ exports.decodeCraftedItemStats = decodeCraftedItemStats;
6626
+ exports.decodeStats = decodeStats;
7862
6627
  exports["default"] = Shipload;
7863
6628
  exports.depthScaleFactor = depthScaleFactor;
7864
6629
  exports.deriveLocation = deriveLocation;
@@ -7869,17 +6634,22 @@ exports.deriveResourceStats = deriveResourceStats;
7869
6634
  exports.deriveStratum = deriveStratum;
7870
6635
  exports.distanceBetweenCoordinates = distanceBetweenCoordinates;
7871
6636
  exports.distanceBetweenPoints = distanceBetweenPoints;
6637
+ exports.encodeStats = encodeStats;
7872
6638
  exports.energyPercent = energyPercent;
6639
+ exports.entityRecipes = entityRecipes;
7873
6640
  exports.estimateDealTravelTime = estimateDealTravelTime;
7874
6641
  exports.estimateTravelTime = estimateTravelTime;
7875
- exports.findBestDeal = findBestDeal;
7876
- exports.findBestItemToTrade = findBestItemToTrade;
7877
- exports.findDealsForShip = findDealsForShip;
7878
6642
  exports.findNearbyPlanets = findNearbyPlanets;
6643
+ exports.getAllCraftableItems = getAllCraftableItems;
6644
+ exports.getComponentById = getComponentById;
6645
+ exports.getComponentsForCategory = getComponentsForCategory;
6646
+ exports.getComponentsForStat = getComponentsForStat;
7879
6647
  exports.getCurrentEpoch = getCurrentEpoch;
7880
6648
  exports.getDepthThreshold = getDepthThreshold;
7881
6649
  exports.getDestinationLocation = getDestinationLocation;
7882
6650
  exports.getEligibleResources = getEligibleResources;
6651
+ exports.getEntityRecipe = getEntityRecipe;
6652
+ exports.getEntityRecipeByItemId = getEntityRecipeByItemId;
7883
6653
  exports.getEpochInfo = getEpochInfo;
7884
6654
  exports.getFlightOrigin = getFlightOrigin;
7885
6655
  exports.getItem = getItem;
@@ -7887,8 +6657,6 @@ exports.getItems = getItems;
7887
6657
  exports.getLocationCandidates = getLocationCandidates;
7888
6658
  exports.getLocationType = getLocationType;
7889
6659
  exports.getPositionAt = getPositionAt;
7890
- exports.getRarity = getRarity;
7891
- exports.getRarityMultiplier = getRarityMultiplier;
7892
6660
  exports.getResourceTier = getResourceTier;
7893
6661
  exports.getResourceWeight = getResourceWeight;
7894
6662
  exports.getStatDefinitions = getStatDefinitions;
@@ -7904,20 +6672,16 @@ exports.hasSpace = hasSpace$1;
7904
6672
  exports.hasSpaceForMass = hasSpaceForMass;
7905
6673
  exports.hasStorage = hasStorage;
7906
6674
  exports.hasSystem = hasSystem;
7907
- exports.hasTrade = hasTrade;
7908
6675
  exports.hash = hash;
7909
6676
  exports.hash512 = hash512;
7910
6677
  exports.isExtractableLocation = isExtractableLocation;
7911
6678
  exports.isFull = isFull$1;
7912
6679
  exports.isFullFromMass = isFullFromMass;
7913
- exports.isProfitable = isProfitable;
7914
6680
  exports.itemIds = itemIds;
7915
6681
  exports.lerp = lerp;
7916
6682
  exports.makeContainer = makeContainer;
7917
6683
  exports.makeShip = makeShip;
7918
6684
  exports.makeWarehouse = makeWarehouse;
7919
- exports.marketPrice = marketPrice;
7920
- exports.marketPrices = marketPrices;
7921
6685
  exports.maxTravelDistance = maxTravelDistance;
7922
6686
  exports.needsRecharge = needsRecharge;
7923
6687
  exports.projectEntity = projectEntity;