Stage 9.2: mixer operator Tumbler storyline with key drive item
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
62bd641283
commit
a5f9639970
15 files changed
+386
-6
No files matched your search
@@ -44,7 +44,10 @@ namespace Decentralized.Domain
|
||||
public bool RecentlyMixed(int day) => day - LastReturnDay <= Tuning.AmlWindowDays;
|
||||
|
||||
/// <summary>一轮的清洗率:基准 × 匿名集系数。</summary>
|
||||
public static double RoundRate(double depositValue) => Tuning.MixerCleanRate * Tuning.MixerNpcVolume / (Tuning.MixerNpcVolume + Math.Max(0, depositValue));
|
||||
/// <summary>每轮手续费(剧情可能改动)。</summary>
|
||||
public static double Fee => Math.Min(0.5, Tuning.MixerFee * StoryMods.Current.MixerFee);
|
||||
|
||||
public static double RoundRate(double depositValue) => Tuning.MixerCleanRate * Tuning.MixerNpcVolume * StoryMods.Current.MixerVolume / (Tuning.MixerNpcVolume * StoryMods.Current.MixerVolume + Math.Max(0, depositValue));
|
||||
|
||||
/// <summary>存入:从钱包按价值比例带走污点与成本。轮数超出范围或余额不足返回 null。</summary>
|
||||
public MixDeposit Deposit(Wallet w, string asset, double amount, int rounds, int day, Func<string, double> price)
|
||||
@@ -78,7 +81,7 @@ namespace Decentralized.Domain
|
||||
var results = new List<MixResult>();
|
||||
foreach (var d in Pending.ToList())
|
||||
{
|
||||
if (rng.Chance(Tuning.MixerRugChance))
|
||||
if (rng.Chance(Math.Min(1, Tuning.MixerRugChance * StoryMods.Current.MixerRug)))
|
||||
{
|
||||
Pending.Remove(d);
|
||||
results.Add(new MixResult { Rugged = true, Asset = d.Asset, Amount = d.Amount });
|
||||
@@ -88,7 +91,7 @@ namespace Decentralized.Domain
|
||||
Pending.Remove(d);
|
||||
double rate = RoundRate(d.Amount * price(d.Asset));
|
||||
double taint = d.Taint * Math.Pow(1 - rate, d.Rounds);
|
||||
double amount = d.Amount * Math.Pow(1 - Tuning.MixerFee, d.Rounds);
|
||||
double amount = d.Amount * Math.Pow(1 - Fee, d.Rounds);
|
||||
bool flagged = Sanctioned(day);
|
||||
var w = wallet(d.Wallet);
|
||||
w.Add(d.Asset, amount);
|
||||
|
||||
Reference in new issue
Block a user