ASIC 矿机去掉修理槽:电子元件拖到机器上修

This commit is contained in:
ZHU MINCHAO committed 2026-11-05 01:46:34 +08:00
1 parent 59dd3c05bc
commit 75fb6d6b2a
11 files changed
+58 -60

No files matched your search

+3 -2
View File
@@ -515,7 +515,7 @@ namespace Decentralized
{
try
{
foreach (var id in new[] { "common_electronic", "rare_electronic" })
foreach (var id in new[] { "common_electronic", "rare_electronic", "hypertech_electronic" })
{
var vanilla = DirectoryMaster.GetFactory<GameItem>(id);
if (vanilla == null) { Log.Warn($"[Rig] 找不到原版 {id}"); continue; }
@@ -523,12 +523,13 @@ namespace Decentralized
dir.Set(id, () =>
{
var it = make();
Func<GameItem, GameItem, bool> can = (src, t) => t != null && t.identifier == Rig && CanUpgradeWith(t, src);
Func<GameItem, GameItem, bool> can = (src, t) => t != null && ((t.identifier == Rig && CanUpgradeWith(t, src)) || AsicItems.CanRepairWith(t, src));
it.mayThisTargetItemFunc = (Func<GameItem, GameItem, bool>)Delegate.Combine(it.mayThisTargetItemFunc, can);
it.canThisTargetItemFunc = (Func<GameItem, GameItem, bool>)Delegate.Combine(it.canThisTargetItemFunc, can);
it.onThisTargetItemFunc = (Action<GameItem, GameItem>)Delegate.Combine(it.onThisTargetItemFunc, (Action<GameItem, GameItem>)((src, t) =>
{
if (t != null && t.identifier == Rig && CanUpgradeWith(t, src)) Log.Guard("矿架升级槽位", () => TakeUpgrade(t, src));
else if (AsicItems.CanRepairWith(t, src)) Log.Guard("矿机修理", () => AsicItems.TakeRepair(t, src));
}));
return it;
});