@shipload/sdk 1.0.0-next.21 → 1.0.0-next.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/shipload.d.ts +3 -1
- package/lib/shipload.js +52 -19
- package/lib/shipload.js.map +1 -1
- package/lib/shipload.m.js +52 -20
- package/lib/shipload.m.js.map +1 -1
- package/package.json +1 -1
- package/src/capabilities/crafting.ts +1 -1
- package/src/derivation/capabilities.ts +4 -4
- package/src/index-module.ts +2 -0
- package/src/managers/construction.ts +3 -4
- package/src/nft/description.ts +4 -4
- package/src/scheduling/energy.ts +41 -0
- package/src/scheduling/projection.ts +10 -11
package/lib/shipload.d.ts
CHANGED
|
@@ -3198,6 +3198,8 @@ interface TaskCargoChange {
|
|
|
3198
3198
|
}
|
|
3199
3199
|
declare function taskCargoChanges(task: Types.task): TaskCargoChange[];
|
|
3200
3200
|
|
|
3201
|
+
declare function energyAtTime(entity: Projectable, now: Date): number;
|
|
3202
|
+
|
|
3201
3203
|
interface Entity {
|
|
3202
3204
|
id: UInt64;
|
|
3203
3205
|
type: Name;
|
|
@@ -3847,4 +3849,4 @@ type gatherer_stats = Types.gatherer_stats;
|
|
|
3847
3849
|
type location_static = Types.location_static;
|
|
3848
3850
|
type location_derived = Types.location_derived;
|
|
3849
3851
|
|
|
3850
|
-
export { ALL_ENTITY_TYPES, ATOMICASSETS_ACCOUNT, AckMessage, ActionsManager, AnyEntity, AtomicAssetRow, AtomicAttributeType, AtomicSchemaRow, BASE_ORBITAL_MASS, BLEND_INPUTS_MUST_MATCH, BLEND_REQUIRES_MULTIPLE, BLEND_STAT_LESS_NOT_SUPPORTED, BoundingBox, BoundsDeltaMessage, BoundsSubscriptionHandle, BuildMethod, BuildState, BuildableTarget, CANCEL_CONTAINS_GROUPED_TASK, CANCEL_PAIRED_HAS_PENDING, CAP_DEMOLISH, CAP_MODULES, CAP_UNDEPLOY, CAP_WRAP, CATEGORY_LABELS, COMMIT_ALREADY_SET, COMMIT_CANNOT_MATCH, COMMIT_NOT_SET, COMPANY_NOT_FOUND, COMPONENT_TIER_PREFIXES, CONTAINER_NOT_FOUND, CONTAINER_Z, CRAFT_ENERGY_DIVISOR, CRAFT_EXCEEDS_ENERGY_CAPACITY, CRAFT_NOT_ENOUGH_ENERGY, CapabilityAttribute, CapabilityInput, CargoData, CargoMassInfo, CargoStack, CategoryIconShape, CategoryInfo, CategoryStacks, ClientMessage, ComputedCapabilities, ConnectionState, ConstructionManager, Container, ContainerEntity, Coordinates, CoordinatesType, CraftedItemCategory, CrafterCapability, DEPLOY_ENTITY_HAS_SCHEDULE, DEPTH_THRESHOLD_T1, DEPTH_THRESHOLD_T2, DEPTH_THRESHOLD_T3, DEPTH_THRESHOLD_T4, DEPTH_THRESHOLD_T5, DESTINATION_CAPACITY_EXCEEDED, DecodedAtomicAsset, DerivedStratum, DescribeOptions, Distance, ENTITY_ALREADY_THERE, ENTITY_CAPACITY_EXCEEDED, ENTITY_CARGO_NOT_LOADED, ENTITY_CARGO_NOT_OWNED, ENTITY_CONTAINER, ENTITY_EXTRACTOR, ENTITY_FACTORY, ENTITY_INVALID_CARGO, ENTITY_INVALID_DESTINATION, ENTITY_INVALID_TRAVEL_DURATION, ENTITY_NEXUS, ENTITY_NOT_ENOUGH_ENERGY, ENTITY_NOT_ENOUGH_ENERGY_CAPACITY, ENTITY_NO_CRAFTER, ENTITY_SHIP, ENTITY_WAREHOUSE, EPOCH_NON_ZERO, EPOCH_NOT_READY, ERROR_SYSTEM_ALREADY_INITIALIZED, ERROR_SYSTEM_DISABLED, ERROR_SYSTEM_NOT_INITIALIZED, EffectiveReserveInput, EnergyCapability, EntitiesManager, Entity$1 as Entity, EntityCapabilities, EntityClass, EntityInfo, EntityInstance, EntityInventory, EntityLayout, EntityRefInput, EntitySlot, EntityState, EntityStateInput, EntitySubscriptionHandle, EntityTypeName, EpochInfo, EpochsManager, ErrorMessage, EstimateTravelTimeOptions, EstimatedTravelTime, EventCatchupCompleteMessage, EventMessage, Extractor, Factory, FetchAssetsOptions, FinalizerCapability, FinalizerEntityRef, FloatPosition, GAME_NOT_FOUND, GAME_SEED_NOT_SET, GATHERER_DEPTH_MAX_TIER, GATHERER_DEPTH_TABLE, GATHER_EXCEEDS_ENERGY_CAPACITY, GATHER_NOT_ENOUGH_ENERGY, GROUP_DUPLICATE_ENTITY, GROUP_EMPTY, GROUP_ENTITY_NOT_MOVABLE, GROUP_HAUL_CAPACITY_EXCEEDED, GROUP_NOT_FOUND, GROUP_NOT_SAME_LOCATION, GROUP_NOT_SAME_OWNER, GROUP_NO_THRUST, GameState, GathererCapability, GathererDepthParams, HasCapacity, HasCargo, HasCargomass, HasScheduleAndLocation, INSUFFICIENT_BALANCE, INSUFFICIENT_ITEM_QUANTITY, INSUFFICIENT_ITEM_SUPPLY, INVALID_AMOUNT, ITEM_BATTERY_T1, ITEM_BEAM, ITEM_BIOMASS_T1, ITEM_BIOMASS_T10, ITEM_BIOMASS_T2, ITEM_BIOMASS_T3, ITEM_BIOMASS_T4, ITEM_BIOMASS_T5, ITEM_BIOMASS_T6, ITEM_BIOMASS_T7, ITEM_BIOMASS_T8, ITEM_BIOMASS_T9, ITEM_CERAMIC, ITEM_CONTAINER_T1_PACKED, ITEM_CONTAINER_T2_PACKED, ITEM_CRAFTER_T1, ITEM_CRYSTAL_T1, ITEM_CRYSTAL_T10, ITEM_CRYSTAL_T2, ITEM_CRYSTAL_T3, ITEM_CRYSTAL_T4, ITEM_CRYSTAL_T5, ITEM_CRYSTAL_T6, ITEM_CRYSTAL_T7, ITEM_CRYSTAL_T8, ITEM_CRYSTAL_T9, ITEM_DOES_NOT_EXIST, ITEM_EMITTER, ITEM_ENGINE_T1, ITEM_EXTRACTOR_T1_PACKED, ITEM_FACTORY_T1_PACKED, ITEM_FRAME, ITEM_FRAME_T2, ITEM_GAS_T1, ITEM_GAS_T10, ITEM_GAS_T2, ITEM_GAS_T3, ITEM_GAS_T4, ITEM_GAS_T5, ITEM_GAS_T6, ITEM_GAS_T7, ITEM_GAS_T8, ITEM_GAS_T9, ITEM_GATHERER_T1, ITEM_GENERATOR_T1, ITEM_HAULER_T1, ITEM_LOADER_T1, ITEM_NOT_AVAILABLE_AT_LOCATION, ITEM_NOT_DEPLOYABLE, ITEM_NOT_PACKED_ENTITY, ITEM_ORE_T1, ITEM_ORE_T10, ITEM_ORE_T2, ITEM_ORE_T3, ITEM_ORE_T4, ITEM_ORE_T5, ITEM_ORE_T6, ITEM_ORE_T7, ITEM_ORE_T8, ITEM_ORE_T9, ITEM_PLASMA_CELL, ITEM_PLATE, ITEM_PLATE_T2, ITEM_POLYMER, ITEM_REACTOR, ITEM_REGOLITH_T1, ITEM_REGOLITH_T10, ITEM_REGOLITH_T2, ITEM_REGOLITH_T3, ITEM_REGOLITH_T4, ITEM_REGOLITH_T5, ITEM_REGOLITH_T6, ITEM_REGOLITH_T7, ITEM_REGOLITH_T8, ITEM_REGOLITH_T9, ITEM_RESONATOR, ITEM_SENSOR, ITEM_SHIP_T1_PACKED, ITEM_STORAGE_T1, ITEM_TYPE_COMPONENT, ITEM_TYPE_ENTITY, ITEM_TYPE_MODULE, ITEM_TYPE_RESOURCE, ITEM_WAREHOUSE_T1_PACKED, ITEM_WARP_T1, ImmutableEntry, ImmutableModuleSlot, InboundTransfer, InstalledModule, InventoryAccessor, Item, ItemType, KindMeta, LOCATION_MAX_DEPTH, LOCATION_MIN_DEPTH, LoadTimeBreakdown, LoaderCapability, Location, LocationStratum, LocationType, LocationsManager, MAX_ORBITAL_ALTITUDE, MIN_ORBITAL_ALTITUDE, MIN_TRANSFER_DISTANCE, MODULE_ANY, MODULE_BATTERY, MODULE_CARGO_NOT_FOUND, MODULE_CRAFTER, MODULE_ENGINE, MODULE_ENTITY_BUSY, MODULE_GATHERER, MODULE_GENERATOR, MODULE_HAULER, MODULE_LAUNCHER, MODULE_LOADER, MODULE_NOT_MODULE, MODULE_SLOT_EMPTY, MODULE_SLOT_INVALID, MODULE_SLOT_OCCUPIED, MODULE_STORAGE, MODULE_TIER_PREFIXES, MODULE_TYPE_MISMATCH, MODULE_WARP, MassCapability, MintAssetParams, ModuleDescription, ModuleEntry, ModuleType, MovementCapability, index as NFT, NFTCargoItem, NFTCommonBase, NFTInstalledModule, NFTModuleSlot, NO_SCHEDULE, NamedStats, Nexus, NftConfigForItem, NftManager, OwnerSubscriptionHandle, PLANETARY_STRUCTURE_Z, PLANET_SUBTYPE_GAS_GIANT, PLANET_SUBTYPE_ICY, PLANET_SUBTYPE_INDUSTRIAL, PLANET_SUBTYPE_OCEAN, PLANET_SUBTYPE_ROCKY, PLANET_SUBTYPE_TERRESTRIAL, PLAYER_ALREADY_JOINED, PLAYER_NOT_FOUND, PLAYER_NOT_JOINED, PRECISION, PackedModule, PackedModuleInput, PingMessage, PlanetSubtypeInfo, platform as PlatformContract, Types$1 as PlatformTypes, Player, PlayerStateInput, PlayersManager, PongMessage, Projectable, ProjectableSnapshot, ProjectedEntity, ProjectionOptions, RECIPE_INPUTS_EXCESS, RECIPE_INPUTS_INSUFFICIENT, RECIPE_INPUTS_INVALID, RECIPE_INPUTS_MIXED, RECIPE_NOT_FOUND, REQUIRES_MORE_THAN_ONE, REQUIRES_POSITIVE_VALUE, RESERVE_TIERS, RESOLVE_COUNT_EXCEEDS_COMPLETED, RESOURCE_TIER_ADJECTIVES, RawData, Recipe, RecipeInput, RecipeSlotInput, RenderDescriptionOptions, Reservation, ReserveTier, ResolvedAttributeGroup, ResolvedItem, ResolvedItemStat, ResolvedItemType, ResolvedModuleSlot, ResourceCategory, ResourceStats, SHIPLOAD_COLLECTION, SHIP_ALREADY_TRAVELING, SHIP_CANNOT_BUY_TRAVELING, SHIP_CANNOT_CANCEL_TASK, SHIP_CANNOT_UPDATE_TRAVELING, SHIP_NOT_ARRIVED, SHIP_NOT_FOUND, SHIP_NOT_IDLE, SHIP_NOT_OWNED, SHIP_NO_COMPLETED_TASKS, SHIP_NO_TASKS_TO_CANCEL, SLOT_FORMULAS, ScheduleAccessor, ScheduleCapability, ScheduleData, Scheduleable, SchemaField, server as ServerContract, ServerMessage, Types as ServerTypes, Ship, ShipEntity, ShipLike, Shipload, SlotConsumer, SlotConsumerKind, SnapshotMessage, SourceCargoStack, SourceEntityRef, StackInput, StatDefinition, StatMapping, StatSlot, StorageCapability, StratumInfo, SubscribeEntityMessage, SubscribeEventsMessage, SubscribeMessage, SubscriptionEntityType, SubscriptionsManager, SubscriptionsOptions, TIER_ROLL_MAX, TRAVEL_MAX_DURATION, TaskCancelable, TaskCargoChange, TaskCargoDirection, TaskType, TemplateMeta, TextSpan, TierRange, TransferEntity, UnsubscribeEntityMessage, UnsubscribeEventsMessage, UnsubscribeMessage, UpdateBoundsMessage, UpdateMessage, WAREHOUSE_ALREADY_AT_LOCATION, WAREHOUSE_NOT_FOUND, WARP_HAS_CARGO, WARP_HAS_SCHEDULE, WARP_NOT_FULL_ENERGY, WARP_NO_CAPABILITY, WARP_OUT_OF_RANGE, Warehouse, WarehouseEntity, WebSocketConnection, WebSocketConnectionOptions, WireCoordinates, WireEntity, YIELD_FRACTION_DEEP, YIELD_FRACTION_SHALLOW, allBuildableItems, allPlotBuildableItems, availableBuildMethods, availableCapacity$1 as availableCapacity, availableCapacityFromMass, baseName, blendCargoStacks, blendComponentStacks, blendCrossGroup, blendStacks, buildComponentImmutable, buildEntityDescription, buildEntityImmutable, buildImmutableData, buildMintAssetAction, buildModuleImmutable, buildResourceImmutable, calcCargoItemMass, calcCargoMass, calcEnergyUsage, calcLoadDuration, calcStacksMass, calc_acceleration, calc_craft_duration, calc_craft_energy, calc_energyusage, calc_flighttime, calc_gather_duration, calc_gather_energy, calc_gather_rate, calc_loader_acceleration, calc_loader_flighttime, calc_orbital_altitude, calc_rechargetime, calc_ship_acceleration, calc_ship_flighttime, calc_ship_mass, calc_ship_rechargetime, calc_transfer_duration, calculateFlightTime, calculateLoadTimeBreakdown, calculateRefuelingTime, calculateTransferTime, canMove, capabilityAttributes, capabilityNames, capsHasCrafter, capsHasGatherer, capsHasHauler, capsHasLoaders, capsHasMass, capsHasMovement, capsHasStorage, cargoItem, cargoItemToStack, cargoRef, cargoUtils, cargo_item, categoryColors, categoryFromIndex, categoryIconShapes, categoryIcons, categoryLabel, categoryLabelFromIndex, componentIcon, computeBaseCapacity, computeBaseCapacityShip, computeBaseCapacityWarehouse, computeBaseHullmass, computeComponentStats, computeContainerCapabilities, computeContainerT2Capabilities, computeCraftedOutputStats, computeCrafterCapabilities, computeCrafterDrain, computeCrafterSpeed, computeEngineCapabilities, computeEngineDrain, computeEngineThrust, computeEntityCapabilities, computeEntityStats, computeGathererCapabilities, computeGathererDepth, computeGathererDrain, computeGathererYield, computeGeneratorCap, computeGeneratorCapabilities, computeGeneratorRech, computeHaulPenalty, computeHaulerCapabilities, computeHaulerCapacity, computeHaulerDrain$1 as computeHaulerDrain, computeHaulerEfficiency, computeInputMass, computeLoaderCapabilities, computeLoaderMass, computeLoaderThrust, computeNftImageUrl, computeShipHullCapabilities, computeStorageCapabilities, computeWarehouseHullCapabilities, computeWarpCapabilities, computeWarpRange, coordsToLocationId, createInventoryAccessor, createProjectedEntity, createScheduleAccessor, decodeAtomicAsset, decodeCraftedItemStats, decodeStat, decodeStats, Shipload as default, deriveLocation, deriveLocationSize, deriveLocationStatic, deriveResourceStats, deriveStatMappings, deriveStrata, deriveStratum, describeItem, describeModule, describeModuleForItem, describeModuleForSlot, deserializeAsset, deserializeAtomicData, deserializeComponent, deserializeEntity, deserializeModule, deserializeResource, displayName, distanceBetweenCoordinates, distanceBetweenPoints, easeFlightProgress, encodeGatheredCargoStats, encodeStats, energyPercent, energy_stats, entityDisplayName, entity_row, estimateDealTravelTime, estimateTravelTime, fetchAtomicAssetsForOwner, fetchAtomicSchemas, filterByBuildMethod, findNearbyPlanets, flightSpeedFactor, formatLocation, formatMass, formatMassDelta, formatMassScaled, formatModuleLine, formatTier, gathererDepthForTier, gatherer_stats, getCapabilityAttributes, getCategoryInfo, getComponents, getCurrentEpoch, getDepthThreshold, getDestinationLocation, getEffectiveReserve, getEligibleResources, getEntityClass, getEntityItems, getEntityLayout, getEpochInfo, getFlightOrigin, getInterpolatedPosition, getItem, getItems, getKindMeta, getLocationCandidates, getLocationProfile, getLocationType, getLocationTypeName, getModuleCapabilityType, getModules, getPackedEntityType, getPlanetSubtype, getPlanetSubtypes, getPositionAt, getRecipe, getResourceTier, getResourceWeight, getResources, getStatDefinitions, getStatMappings, getStatMappingsForCapability, getStatMappingsForStat, getStatName, getSystemName, getTemplateMeta, hasEnergy, hasEnergyForDistance, hasGatherer, hasLoaders, hasMass, hasSchedule, hasSpace$1 as hasSpace, hasSpaceForMass, hasStorage, hasSystem, hash, hash512, interpolateFlightPosition, isBuildable, isContainer, isCraftedItem, isExtractor, isFactory, isFull$1 as isFull, isFullFromMass, isGatherableLocation, isInvertedAttribute, isLocationBuildable, isModuleItem, isNexus, isPlot, isPlotBuildable, isRelatedItem, isShip, isSubscriptionsDebugEnabled, isWarehouse, itemAbbreviations, itemCategory, itemIds, itemOffset, itemTier, itemTypeCode, kindCan, lerp, loader_stats, location_derived, location_static, makeEntity, mapEntity, maxTravelDistance, mergeStacks, moduleAccepts, moduleDisplayName, moduleIcon, moduleSlotTypeToCode, movement_stats, needsRecharge, parseWireEntity, projectEntity, projectEntityAt, projectFromCurrentState, projectFromCurrentStateAt, readCommonBase, removeFromStacks, renderDescription, resolveItem, resolveItemCategory, resolveStats, rollTier, rollWithinTier, rotation, schedule, setSubscriptionsDebug, stackKey, stackToCargoItem, stacksEqual, task, taskCargoChanges, tierAdjective, tierColors, tierOfReserve, toLocation, typeLabel, validateSchedule, yieldThresholdAt };
|
|
3852
|
+
export { ALL_ENTITY_TYPES, ATOMICASSETS_ACCOUNT, AckMessage, ActionsManager, AnyEntity, AtomicAssetRow, AtomicAttributeType, AtomicSchemaRow, BASE_ORBITAL_MASS, BLEND_INPUTS_MUST_MATCH, BLEND_REQUIRES_MULTIPLE, BLEND_STAT_LESS_NOT_SUPPORTED, BoundingBox, BoundsDeltaMessage, BoundsSubscriptionHandle, BuildMethod, BuildState, BuildableTarget, CANCEL_CONTAINS_GROUPED_TASK, CANCEL_PAIRED_HAS_PENDING, CAP_DEMOLISH, CAP_MODULES, CAP_UNDEPLOY, CAP_WRAP, CATEGORY_LABELS, COMMIT_ALREADY_SET, COMMIT_CANNOT_MATCH, COMMIT_NOT_SET, COMPANY_NOT_FOUND, COMPONENT_TIER_PREFIXES, CONTAINER_NOT_FOUND, CONTAINER_Z, CRAFT_ENERGY_DIVISOR, CRAFT_EXCEEDS_ENERGY_CAPACITY, CRAFT_NOT_ENOUGH_ENERGY, CapabilityAttribute, CapabilityInput, CargoData, CargoMassInfo, CargoStack, CategoryIconShape, CategoryInfo, CategoryStacks, ClientMessage, ComputedCapabilities, ConnectionState, ConstructionManager, Container, ContainerEntity, Coordinates, CoordinatesType, CraftedItemCategory, CrafterCapability, DEPLOY_ENTITY_HAS_SCHEDULE, DEPTH_THRESHOLD_T1, DEPTH_THRESHOLD_T2, DEPTH_THRESHOLD_T3, DEPTH_THRESHOLD_T4, DEPTH_THRESHOLD_T5, DESTINATION_CAPACITY_EXCEEDED, DecodedAtomicAsset, DerivedStratum, DescribeOptions, Distance, ENTITY_ALREADY_THERE, ENTITY_CAPACITY_EXCEEDED, ENTITY_CARGO_NOT_LOADED, ENTITY_CARGO_NOT_OWNED, ENTITY_CONTAINER, ENTITY_EXTRACTOR, ENTITY_FACTORY, ENTITY_INVALID_CARGO, ENTITY_INVALID_DESTINATION, ENTITY_INVALID_TRAVEL_DURATION, ENTITY_NEXUS, ENTITY_NOT_ENOUGH_ENERGY, ENTITY_NOT_ENOUGH_ENERGY_CAPACITY, ENTITY_NO_CRAFTER, ENTITY_SHIP, ENTITY_WAREHOUSE, EPOCH_NON_ZERO, EPOCH_NOT_READY, ERROR_SYSTEM_ALREADY_INITIALIZED, ERROR_SYSTEM_DISABLED, ERROR_SYSTEM_NOT_INITIALIZED, EffectiveReserveInput, EnergyCapability, EntitiesManager, Entity$1 as Entity, EntityCapabilities, EntityClass, EntityInfo, EntityInstance, EntityInventory, EntityLayout, EntityRefInput, EntitySlot, EntityState, EntityStateInput, EntitySubscriptionHandle, EntityTypeName, EpochInfo, EpochsManager, ErrorMessage, EstimateTravelTimeOptions, EstimatedTravelTime, EventCatchupCompleteMessage, EventMessage, Extractor, Factory, FetchAssetsOptions, FinalizerCapability, FinalizerEntityRef, FloatPosition, GAME_NOT_FOUND, GAME_SEED_NOT_SET, GATHERER_DEPTH_MAX_TIER, GATHERER_DEPTH_TABLE, GATHER_EXCEEDS_ENERGY_CAPACITY, GATHER_NOT_ENOUGH_ENERGY, GROUP_DUPLICATE_ENTITY, GROUP_EMPTY, GROUP_ENTITY_NOT_MOVABLE, GROUP_HAUL_CAPACITY_EXCEEDED, GROUP_NOT_FOUND, GROUP_NOT_SAME_LOCATION, GROUP_NOT_SAME_OWNER, GROUP_NO_THRUST, GameState, GathererCapability, GathererDepthParams, HasCapacity, HasCargo, HasCargomass, HasScheduleAndLocation, INSUFFICIENT_BALANCE, INSUFFICIENT_ITEM_QUANTITY, INSUFFICIENT_ITEM_SUPPLY, INVALID_AMOUNT, ITEM_BATTERY_T1, ITEM_BEAM, ITEM_BIOMASS_T1, ITEM_BIOMASS_T10, ITEM_BIOMASS_T2, ITEM_BIOMASS_T3, ITEM_BIOMASS_T4, ITEM_BIOMASS_T5, ITEM_BIOMASS_T6, ITEM_BIOMASS_T7, ITEM_BIOMASS_T8, ITEM_BIOMASS_T9, ITEM_CERAMIC, ITEM_CONTAINER_T1_PACKED, ITEM_CONTAINER_T2_PACKED, ITEM_CRAFTER_T1, ITEM_CRYSTAL_T1, ITEM_CRYSTAL_T10, ITEM_CRYSTAL_T2, ITEM_CRYSTAL_T3, ITEM_CRYSTAL_T4, ITEM_CRYSTAL_T5, ITEM_CRYSTAL_T6, ITEM_CRYSTAL_T7, ITEM_CRYSTAL_T8, ITEM_CRYSTAL_T9, ITEM_DOES_NOT_EXIST, ITEM_EMITTER, ITEM_ENGINE_T1, ITEM_EXTRACTOR_T1_PACKED, ITEM_FACTORY_T1_PACKED, ITEM_FRAME, ITEM_FRAME_T2, ITEM_GAS_T1, ITEM_GAS_T10, ITEM_GAS_T2, ITEM_GAS_T3, ITEM_GAS_T4, ITEM_GAS_T5, ITEM_GAS_T6, ITEM_GAS_T7, ITEM_GAS_T8, ITEM_GAS_T9, ITEM_GATHERER_T1, ITEM_GENERATOR_T1, ITEM_HAULER_T1, ITEM_LOADER_T1, ITEM_NOT_AVAILABLE_AT_LOCATION, ITEM_NOT_DEPLOYABLE, ITEM_NOT_PACKED_ENTITY, ITEM_ORE_T1, ITEM_ORE_T10, ITEM_ORE_T2, ITEM_ORE_T3, ITEM_ORE_T4, ITEM_ORE_T5, ITEM_ORE_T6, ITEM_ORE_T7, ITEM_ORE_T8, ITEM_ORE_T9, ITEM_PLASMA_CELL, ITEM_PLATE, ITEM_PLATE_T2, ITEM_POLYMER, ITEM_REACTOR, ITEM_REGOLITH_T1, ITEM_REGOLITH_T10, ITEM_REGOLITH_T2, ITEM_REGOLITH_T3, ITEM_REGOLITH_T4, ITEM_REGOLITH_T5, ITEM_REGOLITH_T6, ITEM_REGOLITH_T7, ITEM_REGOLITH_T8, ITEM_REGOLITH_T9, ITEM_RESONATOR, ITEM_SENSOR, ITEM_SHIP_T1_PACKED, ITEM_STORAGE_T1, ITEM_TYPE_COMPONENT, ITEM_TYPE_ENTITY, ITEM_TYPE_MODULE, ITEM_TYPE_RESOURCE, ITEM_WAREHOUSE_T1_PACKED, ITEM_WARP_T1, ImmutableEntry, ImmutableModuleSlot, InboundTransfer, InstalledModule, InventoryAccessor, Item, ItemType, KindMeta, LOCATION_MAX_DEPTH, LOCATION_MIN_DEPTH, LoadTimeBreakdown, LoaderCapability, Location, LocationStratum, LocationType, LocationsManager, MAX_ORBITAL_ALTITUDE, MIN_ORBITAL_ALTITUDE, MIN_TRANSFER_DISTANCE, MODULE_ANY, MODULE_BATTERY, MODULE_CARGO_NOT_FOUND, MODULE_CRAFTER, MODULE_ENGINE, MODULE_ENTITY_BUSY, MODULE_GATHERER, MODULE_GENERATOR, MODULE_HAULER, MODULE_LAUNCHER, MODULE_LOADER, MODULE_NOT_MODULE, MODULE_SLOT_EMPTY, MODULE_SLOT_INVALID, MODULE_SLOT_OCCUPIED, MODULE_STORAGE, MODULE_TIER_PREFIXES, MODULE_TYPE_MISMATCH, MODULE_WARP, MassCapability, MintAssetParams, ModuleDescription, ModuleEntry, ModuleType, MovementCapability, index as NFT, NFTCargoItem, NFTCommonBase, NFTInstalledModule, NFTModuleSlot, NO_SCHEDULE, NamedStats, Nexus, NftConfigForItem, NftManager, OwnerSubscriptionHandle, PLANETARY_STRUCTURE_Z, PLANET_SUBTYPE_GAS_GIANT, PLANET_SUBTYPE_ICY, PLANET_SUBTYPE_INDUSTRIAL, PLANET_SUBTYPE_OCEAN, PLANET_SUBTYPE_ROCKY, PLANET_SUBTYPE_TERRESTRIAL, PLAYER_ALREADY_JOINED, PLAYER_NOT_FOUND, PLAYER_NOT_JOINED, PRECISION, PackedModule, PackedModuleInput, PingMessage, PlanetSubtypeInfo, platform as PlatformContract, Types$1 as PlatformTypes, Player, PlayerStateInput, PlayersManager, PongMessage, Projectable, ProjectableSnapshot, ProjectedEntity, ProjectionOptions, RECIPE_INPUTS_EXCESS, RECIPE_INPUTS_INSUFFICIENT, RECIPE_INPUTS_INVALID, RECIPE_INPUTS_MIXED, RECIPE_NOT_FOUND, REQUIRES_MORE_THAN_ONE, REQUIRES_POSITIVE_VALUE, RESERVE_TIERS, RESOLVE_COUNT_EXCEEDS_COMPLETED, RESOURCE_TIER_ADJECTIVES, RawData, Recipe, RecipeInput, RecipeSlotInput, RenderDescriptionOptions, Reservation, ReserveTier, ResolvedAttributeGroup, ResolvedItem, ResolvedItemStat, ResolvedItemType, ResolvedModuleSlot, ResourceCategory, ResourceStats, SHIPLOAD_COLLECTION, SHIP_ALREADY_TRAVELING, SHIP_CANNOT_BUY_TRAVELING, SHIP_CANNOT_CANCEL_TASK, SHIP_CANNOT_UPDATE_TRAVELING, SHIP_NOT_ARRIVED, SHIP_NOT_FOUND, SHIP_NOT_IDLE, SHIP_NOT_OWNED, SHIP_NO_COMPLETED_TASKS, SHIP_NO_TASKS_TO_CANCEL, SLOT_FORMULAS, ScheduleAccessor, ScheduleCapability, ScheduleData, Scheduleable, SchemaField, server as ServerContract, ServerMessage, Types as ServerTypes, Ship, ShipEntity, ShipLike, Shipload, SlotConsumer, SlotConsumerKind, SnapshotMessage, SourceCargoStack, SourceEntityRef, StackInput, StatDefinition, StatMapping, StatSlot, StorageCapability, StratumInfo, SubscribeEntityMessage, SubscribeEventsMessage, SubscribeMessage, SubscriptionEntityType, SubscriptionsManager, SubscriptionsOptions, TIER_ROLL_MAX, TRAVEL_MAX_DURATION, TaskCancelable, TaskCargoChange, TaskCargoDirection, TaskType, TemplateMeta, TextSpan, TierRange, TransferEntity, UnsubscribeEntityMessage, UnsubscribeEventsMessage, UnsubscribeMessage, UpdateBoundsMessage, UpdateMessage, WAREHOUSE_ALREADY_AT_LOCATION, WAREHOUSE_NOT_FOUND, WARP_HAS_CARGO, WARP_HAS_SCHEDULE, WARP_NOT_FULL_ENERGY, WARP_NO_CAPABILITY, WARP_OUT_OF_RANGE, Warehouse, WarehouseEntity, WebSocketConnection, WebSocketConnectionOptions, WireCoordinates, WireEntity, YIELD_FRACTION_DEEP, YIELD_FRACTION_SHALLOW, allBuildableItems, allPlotBuildableItems, availableBuildMethods, availableCapacity$1 as availableCapacity, availableCapacityFromMass, baseName, blendCargoStacks, blendComponentStacks, blendCrossGroup, blendStacks, buildComponentImmutable, buildEntityDescription, buildEntityImmutable, buildImmutableData, buildMintAssetAction, buildModuleImmutable, buildResourceImmutable, calcCargoItemMass, calcCargoMass, calcEnergyUsage, calcLoadDuration, calcStacksMass, calc_acceleration, calc_craft_duration, calc_craft_energy, calc_energyusage, calc_flighttime, calc_gather_duration, calc_gather_energy, calc_gather_rate, calc_loader_acceleration, calc_loader_flighttime, calc_orbital_altitude, calc_rechargetime, calc_ship_acceleration, calc_ship_flighttime, calc_ship_mass, calc_ship_rechargetime, calc_transfer_duration, calculateFlightTime, calculateLoadTimeBreakdown, calculateRefuelingTime, calculateTransferTime, canMove, capabilityAttributes, capabilityNames, capsHasCrafter, capsHasGatherer, capsHasHauler, capsHasLoaders, capsHasMass, capsHasMovement, capsHasStorage, cargoItem, cargoItemToStack, cargoRef, cargoUtils, cargo_item, categoryColors, categoryFromIndex, categoryIconShapes, categoryIcons, categoryLabel, categoryLabelFromIndex, componentIcon, computeBaseCapacity, computeBaseCapacityShip, computeBaseCapacityWarehouse, computeBaseHullmass, computeComponentStats, computeContainerCapabilities, computeContainerT2Capabilities, computeCraftedOutputStats, computeCrafterCapabilities, computeCrafterDrain, computeCrafterSpeed, computeEngineCapabilities, computeEngineDrain, computeEngineThrust, computeEntityCapabilities, computeEntityStats, computeGathererCapabilities, computeGathererDepth, computeGathererDrain, computeGathererYield, computeGeneratorCap, computeGeneratorCapabilities, computeGeneratorRech, computeHaulPenalty, computeHaulerCapabilities, computeHaulerCapacity, computeHaulerDrain$1 as computeHaulerDrain, computeHaulerEfficiency, computeInputMass, computeLoaderCapabilities, computeLoaderMass, computeLoaderThrust, computeNftImageUrl, computeShipHullCapabilities, computeStorageCapabilities, computeWarehouseHullCapabilities, computeWarpCapabilities, computeWarpRange, coordsToLocationId, createInventoryAccessor, createProjectedEntity, createScheduleAccessor, decodeAtomicAsset, decodeCraftedItemStats, decodeStat, decodeStats, Shipload as default, deriveLocation, deriveLocationSize, deriveLocationStatic, deriveResourceStats, deriveStatMappings, deriveStrata, deriveStratum, describeItem, describeModule, describeModuleForItem, describeModuleForSlot, deserializeAsset, deserializeAtomicData, deserializeComponent, deserializeEntity, deserializeModule, deserializeResource, displayName, distanceBetweenCoordinates, distanceBetweenPoints, easeFlightProgress, encodeGatheredCargoStats, encodeStats, energyAtTime, energyPercent, energy_stats, entityDisplayName, entity_row, estimateDealTravelTime, estimateTravelTime, fetchAtomicAssetsForOwner, fetchAtomicSchemas, filterByBuildMethod, findNearbyPlanets, flightSpeedFactor, formatLocation, formatMass, formatMassDelta, formatMassScaled, formatModuleLine, formatTier, gathererDepthForTier, gatherer_stats, getCapabilityAttributes, getCategoryInfo, getComponents, getCurrentEpoch, getDepthThreshold, getDestinationLocation, getEffectiveReserve, getEligibleResources, getEntityClass, getEntityItems, getEntityLayout, getEpochInfo, getFlightOrigin, getInterpolatedPosition, getItem, getItems, getKindMeta, getLocationCandidates, getLocationProfile, getLocationType, getLocationTypeName, getModuleCapabilityType, getModules, getPackedEntityType, getPlanetSubtype, getPlanetSubtypes, getPositionAt, getRecipe, getResourceTier, getResourceWeight, getResources, getStatDefinitions, getStatMappings, getStatMappingsForCapability, getStatMappingsForStat, getStatName, getSystemName, getTemplateMeta, hasEnergy, hasEnergyForDistance, hasGatherer, hasLoaders, hasMass, hasSchedule, hasSpace$1 as hasSpace, hasSpaceForMass, hasStorage, hasSystem, hash, hash512, interpolateFlightPosition, isBuildable, isContainer, isCraftedItem, isExtractor, isFactory, isFull$1 as isFull, isFullFromMass, isGatherableLocation, isInvertedAttribute, isLocationBuildable, isModuleItem, isNexus, isPlot, isPlotBuildable, isRelatedItem, isShip, isSubscriptionsDebugEnabled, isWarehouse, itemAbbreviations, itemCategory, itemIds, itemOffset, itemTier, itemTypeCode, kindCan, lerp, loader_stats, location_derived, location_static, makeEntity, mapEntity, maxTravelDistance, mergeStacks, moduleAccepts, moduleDisplayName, moduleIcon, moduleSlotTypeToCode, movement_stats, needsRecharge, parseWireEntity, projectEntity, projectEntityAt, projectFromCurrentState, projectFromCurrentStateAt, readCommonBase, removeFromStacks, renderDescription, resolveItem, resolveItemCategory, resolveStats, rollTier, rollWithinTier, rotation, schedule, setSubscriptionsDebug, stackKey, stackToCargoItem, stacksEqual, task, taskCargoChanges, tierAdjective, tierColors, tierOfReserve, toLocation, typeLabel, validateSchedule, yieldThresholdAt };
|
package/lib/shipload.js
CHANGED
|
@@ -10228,15 +10228,15 @@ function computeEngineCapabilities(stats) {
|
|
|
10228
10228
|
const thm = stats.thermal;
|
|
10229
10229
|
return {
|
|
10230
10230
|
thrust: 400 + Math.floor((vol * 3) / 4),
|
|
10231
|
-
drain: Math.max(30, 50 - Math.floor(thm / 70)),
|
|
10231
|
+
drain: 2 * Math.max(30, 50 - Math.floor(thm / 70)),
|
|
10232
10232
|
};
|
|
10233
10233
|
}
|
|
10234
10234
|
function computeGeneratorCapabilities(stats) {
|
|
10235
10235
|
const res = stats.resonance;
|
|
10236
10236
|
const ref = stats.reflectivity;
|
|
10237
10237
|
return {
|
|
10238
|
-
capacity:
|
|
10239
|
-
recharge: 1 + Math.floor((ref * 3) / 1000),
|
|
10238
|
+
capacity: 950 + Math.floor(res / 2),
|
|
10239
|
+
recharge: 2 * (1 + Math.floor((ref * 3) / 1000)),
|
|
10240
10240
|
};
|
|
10241
10241
|
}
|
|
10242
10242
|
const GATHERER_DEPTH_TABLE = [
|
|
@@ -10265,7 +10265,7 @@ function computeGathererCapabilities(stats, tier) {
|
|
|
10265
10265
|
const tol = stats.tolerance;
|
|
10266
10266
|
return {
|
|
10267
10267
|
yield: 200 + str,
|
|
10268
|
-
drain: Math.max(250, 1250 - Math.floor((con * 25) / 20)),
|
|
10268
|
+
drain: 2 * Math.max(250, 1250 - Math.floor((con * 25) / 20)),
|
|
10269
10269
|
depth: gathererDepthForTier(tol, tier),
|
|
10270
10270
|
};
|
|
10271
10271
|
}
|
|
@@ -10606,7 +10606,7 @@ function calc_craft_duration(speed, totalInputMass) {
|
|
|
10606
10606
|
}
|
|
10607
10607
|
function calc_craft_energy(drain, totalInputMass) {
|
|
10608
10608
|
const raw = Math.floor((totalInputMass * drain) / CRAFT_ENERGY_DIVISOR);
|
|
10609
|
-
return antelope.UInt16.from(Math.min(raw, 65535));
|
|
10609
|
+
return antelope.UInt16.from(Math.min(Math.max(raw, 1), 65535));
|
|
10610
10610
|
}
|
|
10611
10611
|
|
|
10612
10612
|
class PlotManager extends BaseManager {
|
|
@@ -10750,8 +10750,11 @@ class ConstructionManager extends BaseManager {
|
|
|
10750
10750
|
continue;
|
|
10751
10751
|
if (!task.entitytarget)
|
|
10752
10752
|
continue;
|
|
10753
|
+
const projectedEndMs = startedMs + cumulativeSec * 1000;
|
|
10754
|
+
if (projectedEndMs < nowMs)
|
|
10755
|
+
continue;
|
|
10753
10756
|
const targetIdStr = task.entitytarget.entity_id.toString();
|
|
10754
|
-
const etaSeconds = Math.max(0, Math.round((
|
|
10757
|
+
const etaSeconds = Math.max(0, Math.round((projectedEndMs - nowMs) / 1000));
|
|
10755
10758
|
let perTarget = buckets.get(targetIdStr);
|
|
10756
10759
|
if (!perTarget) {
|
|
10757
10760
|
perTarget = new Map();
|
|
@@ -11233,25 +11236,20 @@ function applyRechargeTask(projected, _task, options) {
|
|
|
11233
11236
|
}
|
|
11234
11237
|
}
|
|
11235
11238
|
function applyFlightTask(projected, task, options) {
|
|
11236
|
-
if (!task.coordinates
|
|
11239
|
+
if (!task.coordinates)
|
|
11237
11240
|
return;
|
|
11238
|
-
const origin = projected.location;
|
|
11239
11241
|
const destination = Coordinates.from(task.coordinates);
|
|
11240
|
-
const distance = distanceBetweenCoordinates(origin, task.coordinates);
|
|
11241
|
-
const energyUsage = distance.dividing(PRECISION$1).multiplying(projected.engines.drain);
|
|
11242
11242
|
if (options.complete) {
|
|
11243
|
-
projected
|
|
11244
|
-
? antelope.UInt16.from(projected.energy.subtracting(energyUsage))
|
|
11245
|
-
: antelope.UInt16.from(0);
|
|
11243
|
+
applyEnergyCost(projected, task);
|
|
11246
11244
|
projected.location = destination;
|
|
11247
11245
|
}
|
|
11248
11246
|
else if (options.progress !== undefined) {
|
|
11249
|
-
const interpolated = lerp$1(
|
|
11247
|
+
const interpolated = lerp$1(projected.location, destination, options.progress);
|
|
11250
11248
|
projected.location = Coordinates.from({
|
|
11251
11249
|
x: Math.round(interpolated.x),
|
|
11252
11250
|
y: Math.round(interpolated.y),
|
|
11253
11251
|
});
|
|
11254
|
-
const partialEnergy = antelope.UInt64.from(Math.floor(Number(
|
|
11252
|
+
const partialEnergy = antelope.UInt64.from(Math.floor(Number(task.energy_cost ?? 0) * options.progress));
|
|
11255
11253
|
projected.energy = projected.energy.gt(partialEnergy)
|
|
11256
11254
|
? antelope.UInt16.from(projected.energy.subtracting(partialEnergy))
|
|
11257
11255
|
: antelope.UInt16.from(0);
|
|
@@ -11310,6 +11308,7 @@ function applyTask(projected, task) {
|
|
|
11310
11308
|
applyRechargeTask(projected, task, { complete: true });
|
|
11311
11309
|
break;
|
|
11312
11310
|
case exports.TaskType.TRAVEL:
|
|
11311
|
+
case exports.TaskType.WARP:
|
|
11313
11312
|
applyFlightTask(projected, task, { complete: true });
|
|
11314
11313
|
break;
|
|
11315
11314
|
case exports.TaskType.LOAD:
|
|
@@ -11462,6 +11461,7 @@ function projectEntityAt(entity, now) {
|
|
|
11462
11461
|
applyRechargeTask(projected, task, { complete: taskComplete, progress });
|
|
11463
11462
|
break;
|
|
11464
11463
|
case exports.TaskType.TRAVEL:
|
|
11464
|
+
case exports.TaskType.WARP:
|
|
11465
11465
|
applyFlightTask(projected, task, { complete: taskComplete, progress });
|
|
11466
11466
|
break;
|
|
11467
11467
|
case exports.TaskType.LOAD:
|
|
@@ -11528,6 +11528,38 @@ function taskCargoChanges(task) {
|
|
|
11528
11528
|
}
|
|
11529
11529
|
}
|
|
11530
11530
|
|
|
11531
|
+
function energyAtTime(entity, now) {
|
|
11532
|
+
const projected = createProjectedEntity(entity);
|
|
11533
|
+
const capacity = projected.generator ? Number(projected.generator.capacity) : undefined;
|
|
11534
|
+
const clamp = (value) => {
|
|
11535
|
+
const floored = Math.max(0, value);
|
|
11536
|
+
return capacity !== undefined ? Math.min(capacity, floored) : floored;
|
|
11537
|
+
};
|
|
11538
|
+
let running = Number(projected.energy);
|
|
11539
|
+
const tasks = entity.schedule?.tasks;
|
|
11540
|
+
if (!tasks || tasks.length === 0)
|
|
11541
|
+
return clamp(running);
|
|
11542
|
+
const activeIndex = currentTaskIndex(entity, now);
|
|
11543
|
+
const activeProgress = currentTaskProgressFloat(entity, now);
|
|
11544
|
+
for (let i = 0; i < tasks.length; i++) {
|
|
11545
|
+
const complete = isTaskComplete(entity, i, now);
|
|
11546
|
+
if (!complete && i !== activeIndex)
|
|
11547
|
+
break;
|
|
11548
|
+
const fraction = complete ? 1 : activeProgress;
|
|
11549
|
+
if (tasks[i].type.toNumber() === exports.TaskType.RECHARGE) {
|
|
11550
|
+
if (capacity !== undefined) {
|
|
11551
|
+
running = complete ? capacity : running + (capacity - running) * fraction;
|
|
11552
|
+
}
|
|
11553
|
+
}
|
|
11554
|
+
else {
|
|
11555
|
+
const cost = Number(tasks[i].energy_cost ?? 0);
|
|
11556
|
+
running -= cost * fraction;
|
|
11557
|
+
}
|
|
11558
|
+
running = clamp(running);
|
|
11559
|
+
}
|
|
11560
|
+
return clamp(running);
|
|
11561
|
+
}
|
|
11562
|
+
|
|
11531
11563
|
function canMove(e) {
|
|
11532
11564
|
return 'engines' in e && 'generator' in e && 'energy' in e;
|
|
11533
11565
|
}
|
|
@@ -12495,11 +12527,11 @@ function computeBaseCapacityWarehouse(stats) {
|
|
|
12495
12527
|
return Math.floor(100000000 * 6 ** (s / 2997));
|
|
12496
12528
|
}
|
|
12497
12529
|
const computeEngineThrust = (vol) => 400 + idiv(vol * 3, 4);
|
|
12498
|
-
const computeEngineDrain = (thm) => Math.max(30, 50 - idiv(thm, 70));
|
|
12499
|
-
const computeGeneratorCap = (com) =>
|
|
12500
|
-
const computeGeneratorRech = (fin) => 1 + idiv(fin * 3, 1000);
|
|
12530
|
+
const computeEngineDrain = (thm) => 2 * Math.max(30, 50 - idiv(thm, 70));
|
|
12531
|
+
const computeGeneratorCap = (com) => 950 + idiv(com, 2);
|
|
12532
|
+
const computeGeneratorRech = (fin) => 2 * (1 + idiv(fin * 3, 1000));
|
|
12501
12533
|
const computeGathererYield = (str) => 200 + str;
|
|
12502
|
-
const computeGathererDrain = (con) => Math.max(250, 1250 - idiv(con * 25, 20));
|
|
12534
|
+
const computeGathererDrain = (con) => 2 * Math.max(250, 1250 - idiv(con * 25, 20));
|
|
12503
12535
|
const computeGathererDepth = (tol, tier) => gathererDepthForTier(tol, tier);
|
|
12504
12536
|
const computeLoaderMass = (ins) => Math.max(200, 2000 - ins * 2);
|
|
12505
12537
|
const computeLoaderThrust = (pla) => 1 + idiv(pla, 500);
|
|
@@ -13605,6 +13637,7 @@ exports.distanceBetweenPoints = distanceBetweenPoints;
|
|
|
13605
13637
|
exports.easeFlightProgress = easeFlightProgress;
|
|
13606
13638
|
exports.encodeGatheredCargoStats = encodeGatheredCargoStats;
|
|
13607
13639
|
exports.encodeStats = encodeStats;
|
|
13640
|
+
exports.energyAtTime = energyAtTime;
|
|
13608
13641
|
exports.energyPercent = energyPercent;
|
|
13609
13642
|
exports.entityDisplayName = entityDisplayName;
|
|
13610
13643
|
exports.estimateDealTravelTime = estimateDealTravelTime;
|