Stage 9.1: story links (Serpico, Eleanor, Officer Lun) and newspaper importance fix

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ZHU MINCHAOandClaude Opus 5.5 committed 2026-11-04 09:04:50 +08:00
1 parent 96e91a4884
commit 62bd641283
15 files changed
+240 -17

No files matched your search

@@ -1434,6 +1434,47 @@ internal static class Program
Check(cb.Of("SPARK").Count == 0, "没有的币种是空的");
});
Test("剧情联动:各选择的倍率与期限、只生效一次、SPARK 推涨", () =>
{
var saved = StoryMods.Current;
try
{
var sm = new StoryMods(); StoryMods.Current = sm;
Check(sm.Apply("serpico_sec", 50) && !sm.Apply("serpico_sec", 51), "只生效一次");
Check(sm.Aml(60) == Tuning.StorySecAmlMult && sm.Aml(50 + Tuning.StorySecDays) == 1, "治安部整顿期内出金审查加重,到期恢复");
Check(sm.Sanction(60) == Tuning.StorySecSanctionMult && sm.Enforce(60) == Tuning.StorySecEnforceMult, "制裁与查处倍率");
sm.Apply("lun_arrested", 55);
Check(Math.Abs(sm.Enforce(60) - Tuning.StorySecEnforceMult * Tuning.StoryLunMult) < 1e-12 && sm.Enforce(55 + Tuning.StoryLunDays) == Tuning.StorySecEnforceMult, "伦警官立威期叠加,先到期");
// 出金审查真的变严
var ex = new Exchange(); var ex2 = new Exchange();
var w = new Wallet { Address = "p" }; w.Add(Assets.CRC, 10000); w.Taint = 3000;
var w2 = new Wallet { Address = "p" }; w2.Add(Assets.CRC, 10000); w2.Taint = 3000;
double hit = ex.Cashout(w, 2000, a => 1, 60, 300, false, new Rng(1)).HitChance;
StoryMods.Current = new StoryMods();
double hit0 = ex2.Cashout(w2, 2000, a => 1, 60, 300, false, new Rng(1)).HitChance;
Check(hit > hit0 && hit <= 1, $"命中率 {hit0:0.000} → {hit:0.000}");
// CRT 脱锚减半:镇压开始时脱锚的频率
int dep0 = 0, dep1 = 0;
for (ulong sd = 1; sd <= 2000; sd++)
{
StoryMods.Current = new StoryMods(); var s0 = new Stablecoins(); s0.OnEventStart(MarketEvent.Crackdown, 10, new Rng(sd)); if (s0.Crt < 1) dep0++;
var bm = new StoryMods(); bm.Apply("serpico_bm", 1); StoryMods.Current = bm;
var s1 = new Stablecoins(); s1.OnEventStart(MarketEvent.Crackdown, 10, new Rng(sd)); if (s1.Crt < 1) dep1++;
}
Check(dep1 < dep0 * 0.65 && dep1 > dep0 * 0.35, $"CRT 脱锚约减半:{dep0} → {dep1}");
// SPARK 推涨:几晚内一共涨到设定倍数
var rv = new StoryMods(); StoryMods.Current = rv; rv.Apply("serpico_rev", 10);
Check(rv.CraSpiral(20) == Tuning.StoryCraSpiralMult, "螺旋概率减半");
double prod = 1; for (int i = 0; i < 10; i++) prod *= rv.TakeSparkPush();
Check(Math.Abs(prod - Tuning.StorySerpicoSpark) < 1e-9 && rv.SparkPushNights == 0, $"SPARK 推涨合计 {prod:0.000}");
var lk = new StoryMods(); lk.Apply("serpico_rev", 1); lk.TakeSparkPush(); lk.Apply("eleanor_leak", 2);
double p2 = 1; for (int i = 0; i < 10; i++) p2 *= lk.TakeSparkPush();
Check(Math.Abs(p2 - Math.Pow(Tuning.StorySerpicoSpark, 1 - 1.0 / Tuning.StorySparkNights) * Tuning.StoryLeakSpark) < 1e-9, "两次推涨叠加");
Check(lk.CrcHaircut == Tuning.StoryLeakHaircutMult, "泄露数据盘:CRC 减记概率翻倍");
}
finally { StoryMods.Current = saved; }
});
Test("预测市场:先验概率", () =>
{
Check(Math.Abs(PredictMath.PurityAtLeast(8500, 8000, 8999) - 0.5) < 1e-9, "纯度 8500 以上一半");