diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index 5e52af41c..25f64bdbe 100644 Binary files a/.voidbot/state/aetheria.cc and b/.voidbot/state/aetheria.cc differ diff --git a/Assets/Scripts/ServerShared/ItemManager.cs b/Assets/Scripts/ServerShared/ItemManager.cs index ff72d8e07..393c7c11c 100644 --- a/Assets/Scripts/ServerShared/ItemManager.cs +++ b/Assets/Scripts/ServerShared/ItemManager.cs @@ -199,6 +199,22 @@ public class ItemManager : (int) (GameplaySettings.QualityPriceModifier.Evaluate(item.Quality) * typedItem.Price); } + public int GetPrice(ItemInstance item) + { + var typedItem = GetRuntimeItem(item); + if (typedItem == null) + { + return 0; + } + + return item switch + { + CraftedItemInstance crafted => (int)(GameplaySettings.QualityPriceModifier.Evaluate(crafted.Quality) * typedItem.Price), + SimpleCommodity commodity => typedItem.Price * commodity.Quantity, + _ => typedItem.Price + }; + } + public SimpleCommodity CreateInstance(SimpleCommodityData item, int count) { if (item != null) diff --git a/Assets/Scripts/ServerShared/RuntimeEntityBlueprintProjector.cs b/Assets/Scripts/ServerShared/RuntimeEntityBlueprintProjector.cs index 7d1ce7015..4f3dac1cb 100644 --- a/Assets/Scripts/ServerShared/RuntimeEntityBlueprintProjector.cs +++ b/Assets/Scripts/ServerShared/RuntimeEntityBlueprintProjector.cs @@ -133,9 +133,9 @@ public static class RuntimeEntityBlueprintProjector if(!instantiate) entity.Armor = blueprint.Armor; - var hullData = itemManager.GetData(entity.Hull); - - foreach(var v in hullData.Shape.Coordinates) + var hullShape = itemManager.GetRuntimeShape(entity.Hull); + + foreach(var v in hullShape.Coordinates) entity.HullConductivity[v.x,v.y] = blueprint.Conductivity[v.x,v.y]; entity.WeaponGroups = blueprint.WeaponGroups.Select(itemIndices => @@ -186,34 +186,26 @@ public abstract class RuntimeEntityBlueprint { if (_price != 0) return _price; - var hullData = itemManager.GetData(Hull); - _price = hullData.Price; + _price = itemManager.GetPrice(Hull); foreach (var (_, item) in Equipment) { - var itemData = itemManager.GetData(item); - _price += itemData.Price; + _price += itemManager.GetPrice(item); } foreach (var (_, item) in CargoBays) { - var itemData = itemManager.GetData(item); - _price += itemData.Price; + _price += itemManager.GetPrice(item); } foreach (var (_, item) in DockingBays) { - var itemData = itemManager.GetData(item); - _price += itemData.Price; + _price += itemManager.GetPrice(item); } foreach (var t in CargoContents) { foreach (var (_, item) in t) { - var itemData = itemManager.GetData(item); - if (item is SimpleCommodity s) - _price += itemData.Price * s.Quantity; - else - _price += itemData.Price; + _price += itemManager.GetPrice(item); } } @@ -221,11 +213,7 @@ public abstract class RuntimeEntityBlueprint { foreach (var (_, item) in t) { - var itemData = itemManager.GetData(item); - if (item is SimpleCommodity s) - _price += itemData.Price * s.Quantity; - else - _price += itemData.Price; + _price += itemManager.GetPrice(item); } } diff --git a/docs/aetheria-perfect-machine-map.md b/docs/aetheria-perfect-machine-map.md index 84c0f7716..6bafb18ea 100644 --- a/docs/aetheria-perfect-machine-map.md +++ b/docs/aetheria-perfect-machine-map.md @@ -113,7 +113,10 @@ legacy catalog cache, and legacy UI paths should be migration-only or deleted. now queues current-zone/current-entity-collection snapshots through the runtime commit log during run checkpoints; `RuntimeZoneBlueprint` and `RuntimeEntityBlueprint` remain runtime construction/loadout projections - rather than durable file formats. + rather than durable file formats. Runtime blueprint restore now iterates typed + hull shape rows when restoring saved conductivity, and blueprint price + aggregation uses typed runtime item prices through `ItemManager` instead of + hydrating `HullData.Shape` or `ItemData.Price`. - `Aetheria.State` now defines `AetheriaLoadoutTemplate` as the typed Verse replacement for bespoke `.loadout` files. It stores structured hull, equipment, cargo bay, docking bay, child-entity, assignment, and weapon-group @@ -714,6 +717,9 @@ First Aetheria surfaces to publish: - Done: move `EquippedItem` and `ConsumableItemEffect` behavior construction off `Data.Behaviors` and onto typed runtime behavior payload projection; `BehaviorData` remains only the temporary behavior-class config bridge. + - Done: move runtime blueprint price aggregation and conductivity restore + geometry onto typed runtime item price and hull shape rows; legacy + `ItemData.Price` and `HullData.Shape` no longer own those blueprint paths. - Done: move final `Entity.ItemFits`, `TryFindSpace`, `TryEquip`, and `TryUnequip` gear occupancy/mass deltas onto typed catalog rows for item shape, hull shape/interior, hardpoint masks, cargo/docking category, and