From c68dc15c3ef234537de8ff1962322975856ac92e Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 14 Jun 2026 05:56:41 +0100 Subject: [PATCH] Use typed item rows for blueprint pricing --- .voidbot/state/aetheria.cc | Bin 68462 -> 68616 bytes Assets/Scripts/ServerShared/ItemManager.cs | 16 ++++++++++ .../RuntimeEntityBlueprintProjector.cs | 30 ++++++------------ docs/aetheria-perfect-machine-map.md | 8 ++++- 4 files changed, 32 insertions(+), 22 deletions(-) diff --git a/.voidbot/state/aetheria.cc b/.voidbot/state/aetheria.cc index 5e52af41c4646282917c7493413e4274cbc17762..25f64bdbeb0d5880c2d86f9ab6e6440e18d6b7f1 100644 GIT binary patch delta 1170 zcmZvcO=uHQ5XVgus4Z%>s8tVT1i@6=O)8{`9x83)N1?T)iiaY|>+W>3c6VR;-rLl8 zuoW+Ypp?arn`r$24}K7-cu@pBcqk}%DfHsWiwGik)!E%7ZK0=yc{6YR|KH5pUw0DM z?Hobk_#i76Ya63%E5&GId;>3vA8=2 zMPca(%rpg>Oj+Co<{F@L*YI>@l`K^Tfl_gSU?O)=i88o+#vjS|3|I;s$e$gN+GE{j zmb3hGkRrp(WhM&1OGPeGf+`o$fRm_3gI38PWzdz1xjJ@q`p*~J4r$>@T|`h*5Zp5h z^koVPXctj*2Er&ETC}mMAnGre@-Mt@&nD4Tq*XiR*>(p^asiT+sO?5Zw5JMPNmiHN z1q^1%pu;RzQUkEuE(aY>CaF>?5kTN>%I3`Ao+4WOB8H(5lT?;%gU*DoNc032SjnQ+ zq*hvzn&_Ak9tm?0LRNetsFoTGDzGGRR8YpG0tPOzFJYCHv>eZlhC!SZLR9C^9p5?o zJ-^%dI3Y0oM;L_S3bOrA2hK4rOPfR4Fkw{vog+R7(ZuR#sn`qd zlG-y`jRF^AI4M^)9k{k2aB_KQl<8BnR(`V7;%~pd&A&Chr?T(svF5(M!0*O87cwWy zwBR=9Q(iG#4Ca06_J{%v~rbbpM~`GovR^+41Abme%U4 z@97?Yq?k#F(v=5)9yYYTs;cd(tE~+D-P+Vt&-cH?_g4Q0*>pPmAI$%Izd1V3rv2aX gw%a`B)l;%T%H4P@cC{Aj4y)cQ#9|+s>aooDf4`QlH2?qr delta 1133 zcmaJ=J!lj`6n2wCli(kcm=H0(sGvc;#M~)4LB*ID0x4o*m2PhL?cJE&oy+X(#RDOV z7J`My5+jI2)F@~pTp`$qg@uh8yMtI*X(b3^Vdb0MyG#7RW?|oaGw=Jp_q}Vk6JKv7 zo;_-4NoS578A$eLGE+B=w(xbs^$l?)HUG`%3WG*fMWoW{2+@@2GE(Jz3G+?U(nR1X z?qc}qLwlnqX2YH7U9K&K3o4Ir3h6630~w>hWQsW=2i)@&G7E$a%%A374)P^SGKCh5 zDs+bk1_de3qp7&?e6WQCT}%#Qo)x)}esall7G&^c3_V3Dwzu3j>ae6YAAYn<@j&$hW2Ln3-gBKMROR$$^ElhpLr zB!r$=Ui9i-Nj6H_=2EBFZ7&$Bu#v7xp? z3CPU+s`h-;I+hTdR8TI3(Z?-@bskvT>s$cbhlC{i28D1J2Z=W0#Rta2IprR?HMPt>mq221(OL5TGCAy4z zdSQM`OE#Kp_*C@JI_wTBty{}iS9nYL&gY98w^i4Bpl|A-VmXr1TkiROzoGo`$EN0{ z+Tr|rqqDl^>AsX+^Z5hD%X;N#wD_WN{lXT*5Vi8*eqCO;YZ#a7r3m@_c!Tk(xn9dm F{Q`0tovr`? 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