Black market: 18 merchant types from the game's items and player professions
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
378203d04d
commit
61ec91b34d
11 files changed
+132
-52
No files matched your search
@@ -56,7 +56,7 @@ namespace Decentralized
|
||||
if (it == null || it.identifier == null) return null;
|
||||
if (Items.IsGpu(it)) return "gpu:" + Items.ToUnit(it).Model;
|
||||
string id = it.identifier;
|
||||
return BlackMarket.Pool.Any(x => x.Key == id) || BlackMarket.PharmaPool.Any(x => x.Key == id) || BlackMarket.TechPool.Contains(id) ? id : null;
|
||||
return Merchants.IsGood(id) ? id : null;
|
||||
}
|
||||
|
||||
public static System.Collections.Generic.List<GameItem> Sellable() =>
|
||||
@@ -71,7 +71,7 @@ namespace Decentralized
|
||||
return Value(id);
|
||||
}
|
||||
|
||||
public static GoodKind KindOf(string id) => id.StartsWith("gpu:") ? GoodKind.Gpu : BlackMarket.TechPool.Contains(id) ? GoodKind.Tech : GoodKind.Contraband;
|
||||
public static GoodKind KindOf(string id) => id.StartsWith("gpu:") ? GoodKind.Gpu : Merchants.Info(id).Kind;
|
||||
|
||||
/// <summary>每周刷新:现货与订单目录一起。返回是否刷新了。</summary>
|
||||
public static bool Restock(SaveData d, int day, bool force = false)
|
||||
|
||||
@@ -69,6 +69,10 @@ namespace Decentralized
|
||||
BlackDelivery.Restock(d, day, true);
|
||||
vals.Add(d.Black.CatalogValue);
|
||||
}
|
||||
var missing = Merchants.Table.SelectMany(kv => kv.Value.Select(e => (kv.Key, e.Id))).Where(x => BlackDelivery.Value(x.Item2) <= 0).Select(x => x.Item1 + ":" + x.Item2).ToList();
|
||||
var costs = Merchants.Table.SelectMany(kv => kv.Value.Select(e => (kv.Key, e.Id))).Select(x => BlackDelivery.Value(x.Item2)).Where(v => v > 0).OrderBy(v => v).ToList();
|
||||
Log.Info("黑市抽样:基础价 >2500 的货:" + string.Join(", ", Merchants.Table.SelectMany(kv => kv.Value.Select(e => (kv.Key, e.Id))).Select(x => (id: x.Item2, v: BlackDelivery.Value(x.Item2))).Where(x => x.v > 2500).Select(x => x.id + "=" + x.v)));
|
||||
Log.Info($"黑市抽样:无法造出或价格为 0 的货 {missing.Count} 个:{string.Join(", ", missing)};基础价中位 {costs[costs.Count / 2]},最高 {costs.Last()}");
|
||||
Log.Info($"黑市抽样:60 周货架总值 平均 {vals.Average():0},最小 {vals.Min():0},最大 {vals.Max():0}");
|
||||
}));
|
||||
ModHelper.AddDebugFunction(ModInfo.Id, ModInfo.Name, "Black market events (test)", () => Log.Guard("黑市事件(测试)", () =>
|
||||
|
||||
@@ -310,7 +310,6 @@ black.sale.Delisted.fake,buyer spotted the fake and returned it
|
||||
black.kind.gpunew,GPU brand new
|
||||
merchant.GpuNew,New GPUs
|
||||
merchant.GpuUsed,Used GPUs
|
||||
merchant.Mods,Mods & tech
|
||||
merchant.Arms,Arms
|
||||
merchant.Docs,Keycards & chips
|
||||
merchant.Pharma,Pharma
|
||||
@@ -320,3 +319,16 @@ black.sell.all,List all
|
||||
black.sell.listedall,"Listed {0} items."
|
||||
black.sell.slots,"Listed {0}/{1}"
|
||||
black.sell.full,"At most {0} listings at a time."
|
||||
merchant.Rigs,Rigs & power
|
||||
merchant.Modules,Modules
|
||||
merchant.GunMods,Gunsmith parts
|
||||
merchant.Chem,Chemicals
|
||||
merchant.Brewer,Brewing
|
||||
merchant.Farm,Hydroponics
|
||||
merchant.Husbandry,Husbandry
|
||||
merchant.Miner,Mining supplies
|
||||
merchant.Water,Water
|
||||
merchant.Storage,Storage
|
||||
merchant.Tools,Tools
|
||||
merchant.Luxury,Luxury
|
||||
black.kind.Goods,Goods
|
||||
|
@@ -309,7 +309,6 @@ black.sale.Delisted.fake,买家看穿假卡退货
|
||||
black.kind.gpunew,显卡 全新
|
||||
merchant.GpuNew,全新矿卡
|
||||
merchant.GpuUsed,二手矿卡
|
||||
merchant.Mods,模组高科技
|
||||
merchant.Arms,军火
|
||||
merchant.Docs,证件芯片
|
||||
merchant.Pharma,药物
|
||||
@@ -319,3 +318,16 @@ black.sell.all,全部上架
|
||||
black.sell.listedall,"已上架 {0} 件。"
|
||||
black.sell.slots,"上架 {0}/{1}"
|
||||
black.sell.full,"最多同时上架 {0} 件。"
|
||||
merchant.Rigs,矿架与能源
|
||||
merchant.Modules,模组
|
||||
merchant.GunMods,枪匠配件
|
||||
merchant.Chem,化学品
|
||||
merchant.Brewer,酿酒
|
||||
merchant.Farm,水培农场
|
||||
merchant.Husbandry,养殖
|
||||
merchant.Miner,矿工
|
||||
merchant.Water,水务
|
||||
merchant.Storage,仓储
|
||||
merchant.Tools,工具
|
||||
merchant.Luxury,奢侈品
|
||||
black.kind.Goods,商品
|
||||
|
@@ -370,7 +370,7 @@ namespace Decentralized
|
||||
{
|
||||
string id = BlackDelivery.SellId(it);
|
||||
var kind = BlackDelivery.KindOf(id);
|
||||
var g = new BmGood { Item = id, Kind = kind, Level = kind == GoodKind.Contraband ? BlackMarket.Pool.Concat(BlackMarket.PharmaPool).First(x => x.Key == id).Value : 3 };
|
||||
var g = new BmGood { Item = id, Kind = kind, Level = kind == GoodKind.Gpu ? 2 : Merchants.Info(id).Level };
|
||||
if (kind == GoodKind.Gpu) g.Health = Items.ToUnit(it).Health;
|
||||
g.Price = BlackMarket.ListPriceOf(BlackDelivery.RefValue(it), _sellMult);
|
||||
return new { g, it };
|
||||
|
||||
Reference in new issue
Block a user