Test entries for running nights and crackdowns; night logging; changelog with in-game verification

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
ZHU MINCHAOandClaude Sonnet 5.5 committed 2026-11-03 17:20:08 +08:00
1 parent c295e72a48
commit ad12918511
3 files changed
+25 -3

No files matched your search

+18 -1
View File
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Linq;
using Decentralized.Domain;
namespace Decentralized
@@ -15,6 +16,22 @@ namespace Decentralized
public static void Subscribe()
{
ModHook.OnGenerateCustomerLate += OnGenerate;
ModHelper.AddDebugFunction(ModInfo.Id, ModInfo.Name, "Run night (test)", () => Log.Guard("过夜(测试)", () =>
{
// 走游戏自己的夜间流程(EndNight 会触发本 mod 的夜间结算),再进下一天并开门前的日程
// 游戏过夜会清空前柜台,先把自己的东西收进物品栏
foreach (var it in EmporiumEntry.Instance.frontInvinvElement.childItems.ToList())
if (GeneralHelper.IsItemOwned(it)) GraphUtils.TryAcceptAll(EmporiumEntry.Instance.invElement, it);
PlayerStore.Instance.EndNight();
StoreStation.Instance.storeEventManager.OnDayEnd(); // 让事件按天数过期
StoreStation.Instance.StartDay();
Log.Info($"过夜完成,现在是第 {StoreStation.GetDayCounter()} 天");
}));
ModHelper.AddDebugFunction(ModInfo.Id, ModInfo.Name, "Start crackdown (test)", () => Log.Guard("镇压(测试)", () =>
{
StoreStation.Instance.storeEventManager.ActivateEvent(OperationListSec.Crackdown());
Log.Info("镇压事件已激活");
}));
ModHelper.AddDebugFunction(ModInfo.Id, ModInfo.Name, "Frozen CRT (test)", () => Log.Guard("冻结 CRT(测试)", () =>
{
var w = Session.Data.Hot;
@@ -25,7 +42,7 @@ namespace Decentralized
ModHelper.AddDebugFunction(ModInfo.Id, ModInfo.Name, "Tainted wallet (test)", () => Log.Guard("带污点的钱包(测试)", () =>
{
var w = Session.Data.Hot;
w.Add(Assets.PSC, 100); w.Taint += 3000; w.Basis += 2000;
w.Add(Assets.PSC, 100); w.Add(Assets.CRT, 1000); w.Taint += 3000; w.Basis += 2000;
Log.Info($"钱包:PSC {w.Get(Assets.PSC):0.##},污点 {w.Taint:0}");
}));
ModHelper.AddDebugFunction(ModInfo.Id, ModInfo.Name, "Coin buyer (test)", () => Log.Guard("用币付款顾客(测试)", () =>