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:
1 parent
96e91a4884
commit
62bd641283
15 files changed
+240
-17
No files matched your search
@@ -0,0 +1,88 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Decentralized.Domain
|
||||
{
|
||||
/// <summary>
|
||||
/// 游戏剧情选择对本 mod 世界的影响:一组倍率和期限,随存档保存。各处的概率读 <see cref="Current"/>(接入层读档时指向存档里的这一份)。
|
||||
/// 每个选择只生效一次(Applied 记下键)。
|
||||
/// </summary>
|
||||
public sealed class StoryMods
|
||||
{
|
||||
/// <summary>当前生效的那一份。接入层读档时设成存档里的;测试里可以换。</summary>
|
||||
public static StoryMods Current = new StoryMods();
|
||||
|
||||
public List<string> Applied = new List<string>();
|
||||
/// <summary>CRC 脱锚、CRC 托管银行减记、CRT 脱锚、镇压时 CRT 被出卖的概率倍率(永久)。</summary>
|
||||
public double CrcDepeg = 1, CrcHaircut = 1, CrtDepeg = 1, CrtFreeze = 1;
|
||||
/// <summary>到这一天之前 CRA 螺旋概率减半。</summary>
|
||||
public int CraSafeUntil = -1;
|
||||
/// <summary>治安部整顿到这一天:出金审查命中率、混币器制裁概率、操纵与内幕查处概率上调。</summary>
|
||||
public int SecUntil = -1;
|
||||
/// <summary>伦警官被捕后的立威期到这一天:出金审查、操纵、内幕查处概率上调。</summary>
|
||||
public int LunUntil = -1;
|
||||
/// <summary>SPARK 每晚额外乘的倍数,还剩几晚。</summary>
|
||||
public double SparkPush = 1;
|
||||
public int SparkPushNights;
|
||||
|
||||
public bool Has(string key) => Applied.Contains(key);
|
||||
|
||||
public double CraSpiral(int day) => day < CraSafeUntil ? Tuning.StoryCraSpiralMult : 1;
|
||||
public double Aml(int day) => (day < SecUntil ? Tuning.StorySecAmlMult : 1) * (day < LunUntil ? Tuning.StoryLunMult : 1);
|
||||
public double Sanction(int day) => day < SecUntil ? Tuning.StorySecSanctionMult : 1;
|
||||
/// <summary>操纵检出、内幕查处的概率倍率。</summary>
|
||||
public double Enforce(int day) => (day < SecUntil ? Tuning.StorySecEnforceMult : 1) * (day < LunUntil ? Tuning.StoryLunMult : 1);
|
||||
|
||||
/// <summary>每晚取 SPARK 的额外倍数(推完就是 1)。</summary>
|
||||
public double TakeSparkPush()
|
||||
{
|
||||
if (SparkPushNights <= 0) return 1;
|
||||
SparkPushNights--;
|
||||
return SparkPush;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 记下一个剧情选择并设置倍率。返回 false 表示已经生效过。CRA 补贴池的注资由接入层做(这里只管倍率)。
|
||||
/// key:serpico_rev / serpico_bm / serpico_sec / eleanor_leak / eleanor_return / lun_arrested。
|
||||
/// </summary>
|
||||
public bool Apply(string key, int day)
|
||||
{
|
||||
if (Has(key)) return false;
|
||||
Applied.Add(key);
|
||||
switch (key)
|
||||
{
|
||||
case "serpico_rev":
|
||||
CraSafeUntil = day + Tuning.StorySecDays;
|
||||
PushSpark(Tuning.StorySerpicoSpark);
|
||||
break;
|
||||
case "serpico_bm":
|
||||
CrtDepeg *= Tuning.StoryBmCrtMult; CrtFreeze *= Tuning.StoryBmCrtMult;
|
||||
break;
|
||||
case "serpico_sec":
|
||||
SecUntil = day + Tuning.StorySecDays;
|
||||
break;
|
||||
case "eleanor_leak":
|
||||
CrcHaircut *= Tuning.StoryLeakHaircutMult;
|
||||
PushSpark(Tuning.StoryLeakSpark);
|
||||
break;
|
||||
case "eleanor_return":
|
||||
CrcDepeg *= Tuning.StoryReturnCrcMult;
|
||||
break;
|
||||
case "lun_arrested":
|
||||
LunUntil = day + Tuning.StoryLunDays;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>SPARK 在接下来几晚里一共涨到 total 倍(每晚乘相同的倍数)。</summary>
|
||||
private void PushSpark(double total)
|
||||
{
|
||||
int n = Tuning.StorySparkNights;
|
||||
// 已经在推:把剩下的叠上去
|
||||
double left = SparkPushNights > 0 ? Math.Pow(SparkPush, SparkPushNights) : 1;
|
||||
SparkPush = Math.Pow(left * total, 1.0 / n);
|
||||
SparkPushNights = n;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user