Phase 2: customers paying in coin (CRC/CRT/CRA/PSC), taint from stolen goods
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1ba0652705
commit
090a973d23
10 files changed
+149
No files matched your search
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
|
||||
namespace Decentralized.Domain
|
||||
{
|
||||
/// <summary>
|
||||
/// 顾客用币付款:成交的信用点在店里扣回,按当前币价换成币进热钱包。
|
||||
/// 收赃物的款项不再记销赃,改为币带污点:货值 × 赃物热度%。
|
||||
/// </summary>
|
||||
public static class CoinPayment
|
||||
{
|
||||
/// <summary>各派系用什么币付款(其余派系不用币)。</summary>
|
||||
public static string AssetFor(string faction)
|
||||
{
|
||||
switch (faction)
|
||||
{
|
||||
case "FACTION_UPPER_LEVEL": return Assets.CRC;
|
||||
case "FACTION_BLACK_MARKET": return Assets.CRT;
|
||||
case "FACTION_REVOLUTION": return Assets.CRA;
|
||||
case "FACTION_LOWER_LEVEL": return Assets.PSC;
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>一位顾客用币付款的概率。</summary>
|
||||
public static double Chance(string asset)
|
||||
{
|
||||
switch (asset)
|
||||
{
|
||||
case Assets.CRC: return Tuning.CoinPayCrc;
|
||||
case Assets.CRT: return Tuning.CoinPayCrt;
|
||||
case Assets.CRA: return Tuning.CoinPayCra;
|
||||
default: return Tuning.CoinPayPsc;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>收款:返回收到的币数。heatPct 是物品的赃物热度(0–100)。</summary>
|
||||
public static double Receive(Wallet w, string asset, double credits, double price, double heatPct)
|
||||
{
|
||||
if (credits <= 0 || price <= 0) return 0;
|
||||
double qty = credits / price;
|
||||
w.Add(asset, qty);
|
||||
w.Taint += credits * Math.Max(0, Math.Min(100, heatPct)) / 100.0;
|
||||
w.Basis += credits;
|
||||
return qty;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -57,6 +57,8 @@ namespace Decentralized.Domain
|
||||
public const int AmlWindowDays = 7;
|
||||
public const double AmlTaintRatio = 0.10, AmlHeavyRatio = 0.30, AmlMixerBonus = 0.30, AmlMaxChance = 0.9;
|
||||
public const double TaxRate = 0.08;
|
||||
/// <summary>各派系顾客用币付款的概率。</summary>
|
||||
public const double CoinPayCrc = 0.12, CoinPayCrt = 0.25, CoinPayCra = 0.25, CoinPayPsc = 0.10;
|
||||
/// <summary>单个金融违规事件记入的罪证上限。</summary>
|
||||
public const double CrimeEventCap = 400;
|
||||
|
||||
|
||||
Reference in new issue
Block a user