为 RepoForm 添加出售功能,ShopNode 只承载玩家购买组件的逻辑

This commit is contained in:
2026-03-16 17:52:23 +08:00
parent dc2aa59d58
commit 2e54acbc85
33 changed files with 3198 additions and 91 deletions
@@ -123,18 +123,7 @@ namespace GeometryTD.CustomComponent
private int ResolveRandomPrice(RarityType rarity, Random random)
{
for (int i = 0; i < _shopPriceRows.Count; i++)
{
DRShopPrice row = _shopPriceRows[i];
if (row != null && row.Rarity == rarity)
{
int min = Mathf.Max(0, row.MinPrice);
int max = Mathf.Max(min, row.MaxPrice);
return random.Next(min, max + 1);
}
}
return 0;
return ShopPriceRuleService.ResolveRandomBuyPrice(_shopPriceRows, rarity, random);
}
private static IconAreaContext BuildIconAreaContext(TowerCompItemData item)