Mod: mining rig, graphics cards, trading terminal, nightly settlement
First playable slice, tested in game on the test save: - Network upgrade "Mining Access" (300) delivers a trading terminal, a mining rig and an RZX 50. - The rig is a machine with a battery slot and four card slots; each night it draws its total power from the battery and its cards mine PSCoin. Cards show hashrate, power draw and condition, wear every night and can burn out. All state lives on item tags or in the mod save data. - Trading terminal with wallet, trade (four pairs, deposit credits as CRC, withdraw CRC through the compliance desk) and report pages. - Nightly log lines; exchange opening and halving news on the paper. - English and Chinese text; sprites generated by art/sprites.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
efc58888f3
commit
750b26e4b3
21 files changed
+1040
No files matched your search
@@ -0,0 +1,37 @@
|
||||
using System;
|
||||
|
||||
namespace Decentralized
|
||||
{
|
||||
/// <summary>人脉网络里的"矿业渠道":买下后交付交易终端和一个矿架,并开始每天的行情与挖矿结算。</summary>
|
||||
public static class Unlock
|
||||
{
|
||||
public const string Id = "PD_MINING_ACCESS";
|
||||
public const int Price = 300;
|
||||
|
||||
public static bool IsUnlocked => PlayerStore.Instance != null && ModHelper.IsNetworkUpgradeUnlocked(Id);
|
||||
|
||||
public static void Register()
|
||||
{
|
||||
try
|
||||
{
|
||||
// 文字都用回调:OnEnable 时 mod 本地化表还没加载
|
||||
ModHelper.AddNetworkUpgrade(ModInfo.Id, Id, Price, "",
|
||||
() => L.T("upgrade.title"), () => L.T("upgrade.desc"), OnPurchased,
|
||||
iconKey: ModInfo.Id + ":rig", subtitleLabel: () => L.T("upgrade.card"));
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
{
|
||||
// 登记定义后游戏会访问 PlayerStore.Instance,主菜单阶段为空会抛异常;定义已登记,读档时游戏会把升级补进这一局。
|
||||
Log.Info("人脉升级已登记(主菜单阶段访问 PlayerStore 失败,已忽略)");
|
||||
}
|
||||
}
|
||||
|
||||
private static void OnPurchased()
|
||||
{
|
||||
Items.Give(ModHelper.SpawnItem(Items.Terminal));
|
||||
Items.Give(ModHelper.SpawnItem(Items.Rig));
|
||||
Items.Give(ModHelper.SpawnItem(Items.GpuId("RZX50")));
|
||||
Log.Info("已解锁矿业渠道");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user