Stage 6.3: RatDigg ASIC miners, miner dealers on the black market, miner era event
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b249747855
commit
7d13ae2fe8
18 files changed
+395
-19
No files matched your search
@@ -33,12 +33,12 @@ namespace Decentralized
|
||||
}
|
||||
|
||||
/// <summary>货架上的货对应的游戏物品 id:显卡是 "gpu:型号",对应本 mod 的显卡物品。</summary>
|
||||
public static string GameId(string id) => id.StartsWith("gpu:") ? Items.GpuId(id.Substring(4)) : id;
|
||||
public static string GameId(string id) => id.StartsWith("gpu:") ? (Hardware.Specs.TryGetValue(id.Substring(4), out var sp) && sp.Asic ? AsicItems.Id(sp.Model) : Items.GpuId(id.Substring(4))) : id;
|
||||
|
||||
/// <summary>造出这件货:显卡按成色与(可能的)假卡真身造,不带卖家的说法;其余直接造。</summary>
|
||||
public static GameItem Make(string id, string model, string fakeOf, double health)
|
||||
{
|
||||
if (id.StartsWith("gpu:")) return Items.NewCard(model, health, fakeOf, Session.Data.Rng);
|
||||
if (id.StartsWith("gpu:")) return Hardware.Specs[model].Asic ? AsicItems.New(model, health) : Items.NewCard(model, health, fakeOf, Session.Data.Rng);
|
||||
if (id == Items.HwWallet) return Items.NewHwWallet(Session.Data.Rng.Chance(Tuning.WalletPoisonShare));
|
||||
return ModHelper.SpawnItem(id);
|
||||
}
|
||||
@@ -61,7 +61,7 @@ namespace Decentralized
|
||||
public static string SellId(GameItem it)
|
||||
{
|
||||
if (it == null || it.identifier == null) return null;
|
||||
if (Items.IsGpu(it)) return "gpu:" + Items.ToUnit(it).Model;
|
||||
if (Items.IsGpu(it) || AsicItems.Is(it)) return "gpu:" + Items.ToUnit(it).Model;
|
||||
string id = it.identifier;
|
||||
return Merchants.IsGood(id) ? id : null;
|
||||
}
|
||||
@@ -70,14 +70,14 @@ namespace Decentralized
|
||||
private static readonly System.Collections.Generic.HashSet<string> StorageIds = new System.Collections.Generic.HashSet<string>(Merchants.Table[MerchantType.Storage].Select(e => e.Id));
|
||||
|
||||
public static System.Collections.Generic.List<GameItem> Sellable() =>
|
||||
GraphUtils.FindAllChildrenType<GameItem>(EmporiumEntry.Instance.invElement, i => GeneralHelper.IsItemOwned(i) && SellId(i) != null && !StorageIds.Contains(i.identifier) && i.FindAllChildItems().Count == 0, i => i.identifier != Items.Rig);
|
||||
GraphUtils.FindAllChildrenType<GameItem>(EmporiumEntry.Instance.invElement, i => GeneralHelper.IsItemOwned(i) && SellId(i) != null && !i.IsTag(Items.DeadTag) && !StorageIds.Contains(i.identifier) && i.FindAllChildItems().Count == 0, i => i.identifier != Items.Rig);
|
||||
|
||||
/// <summary>参考价:显卡按标称型号与成色,其余按游戏基础价。</summary>
|
||||
public static long RefValue(GameItem it)
|
||||
{
|
||||
string id = SellId(it);
|
||||
if (id == null) return 0;
|
||||
if (Items.IsGpu(it)) { var u = Items.ToUnit(it); return CardValue.Of(u.Model, u.Health); }
|
||||
if (Items.IsGpu(it) || AsicItems.Is(it)) { var u = Items.ToUnit(it); return CardValue.Of(u.Model, u.Health); }
|
||||
return Value(id);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user