Stage 7.2: high-yield scheme (Ponzi), prediction/manipulation docs

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
ZHU MINCHAOandClaude Sonnet 5.5 committed 2026-11-04 08:11:03 +08:00
1 parent 786de325da
commit 5b0af9af8f
9 files changed
+272 -5

No files matched your search

+72 -2
View File
@@ -349,6 +349,74 @@ namespace Decentralized
});
}
private static bool PonziVisible => Session.Data != null && (Session.Data.Ponzi.Open || Session.Data.Ponzi.Done || StoreStation.GetDayCounter() >= Tuning.PonziMinDay);
private static double _ponziRate = 0.04;
private static bool _ponziConfirm;
private static int LowerRep() => StoreReputation.GetStoreReputation(StoreReputation.FACTION_LOWER_LEVEL)?.GetReputation() ?? 0;
/// <summary>理财页:开一个高息理财产品,下层的人往里存钱;池子随时可以卷走,但每晚都有被举报的风险。用 Poinbase 账户的 CRC,不用签名。</summary>
private static void PonziPage(CustomUIBuilder b)
{
var d = Session.Data;
var pz = d.Ponzi;
int day = StoreStation.GetDayCounter();
Columns(b, l =>
{
l.AddHeader(L.T("ponzi.h"));
l.AddLabel(L.T("ponzi.acct", Fmt.Num(d.Poinbase.Avail(Assets.CRC))));
l.AddSeparator();
if (pz.Open)
{
l.AddLabel(L.T("ponzi.rate", (pz.Rate * 100).ToString("0", CultureInfo.InvariantCulture)));
l.AddLabel(L.T("ponzi.pool", Fmt.Num(pz.Pool), Fmt.Num(Ponzi.Cap(day))));
l.AddLabel(L.T("ponzi.inflow", Fmt.Num(pz.Inflow)));
l.AddLabel(L.T("ponzi.interest", Fmt.Num(pz.Pool * pz.Rate)));
l.AddLabel(L.T("ponzi.own", Fmt.Num(pz.OwnPaid)));
double risk = Ponzi.ReportChance(pz.Rate, pz.Pool, day);
l.AddLabel(L.T("ponzi.wind", L.T(risk < 0.05 ? "ponzi.wind.low" : risk < 0.10 ? "ponzi.wind.mid" : "ponzi.wind.high")));
}
else l.AddLabel(L.T(pz.Done ? "ponzi.done" : "ponzi.idle", Tuning.PonziMinDay));
}, r =>
{
if (pz.Open)
{
r.AddHeader(L.T("ponzi.ops"));
r.AddButton(_ponziConfirm ? L.T("ponzi.rug.confirm", Fmt.Num(pz.Pool)) : L.T("ponzi.rug", Fmt.Num(pz.Pool)), () =>
{
if (!_ponziConfirm) { _ponziConfirm = true; Open(); return; }
_ponziConfirm = false;
double take = pz.Rug(d.Poinbase);
PlayerStore.Instance.secData.CommitCrime("FRAUD", (int)Tuning.PonziCrime);
StoreReputation.GetStoreReputation(StoreReputation.FACTION_LOWER_LEVEL)?.SetReputation(0);
News.Show("pd_news_ponzi_rug_" + day, L.T("news.ponzi.rug.title"), L.T("news.ponzi.rug.desc"), 4);
Log.Info($"卷走理财池 {take:0},自己垫的利息 {pz.OwnPaid:0}");
_message = L.T("ponzi.rugged", Fmt.Num(take));
Session.Save();
Open();
});
return;
}
if (pz.Done) return;
r.AddHeader(L.T("ponzi.open"));
r.BeginRow();
foreach (double rate in Tuning.PonziRates)
{
double rt = rate;
string t = (rate * 100).ToString("0", CultureInfo.InvariantCulture) + "%";
r.AddButton(Math.Abs(rt - _ponziRate) < 1e-9 ? "[" + t + "]" : t, () => { _ponziRate = rt; Open(); });
}
r.End();
r.AddLabel(L.T("ponzi.ad", Fmt.Num(Tuning.PonziAdCost)));
r.AddButton(L.T("ponzi.start"), () =>
{
_message = pz.Start(d.Poinbase, _ponziRate, day) ? L.T("ponzi.started") : L.T("ponzi.err");
Session.Save();
Open();
});
});
}
private static int _predPick;
private enum PredTab { Markets, Intel }
private static PredTab _predTab = PredTab.Markets;
@@ -737,10 +805,11 @@ namespace Decentralized
if (_web3Tab == Web3Tab.Mixer && !Unlock.MixerUnlocked) _web3Tab = Web3Tab.Trade;
if (_web3Tab == Web3Tab.Black && !Unlock.BlackUnlocked) _web3Tab = Web3Tab.Trade;
if (_web3Tab == Web3Tab.Predict && !PredictGame.Available(StoreStation.GetDayCounter())) _web3Tab = Web3Tab.Trade;
if (_web3Tab == Web3Tab.Ponzi && !PonziVisible) _web3Tab = Web3Tab.Trade;
b.BeginRow();
foreach (Web3Tab t in Enum.GetValues(typeof(Web3Tab)))
{
if ((t == Web3Tab.Mixer && !Unlock.MixerUnlocked) || (t == Web3Tab.Black && !Unlock.BlackUnlocked) || (t == Web3Tab.Predict && !PredictGame.Available(StoreStation.GetDayCounter()))) continue;
if ((t == Web3Tab.Mixer && !Unlock.MixerUnlocked) || (t == Web3Tab.Black && !Unlock.BlackUnlocked) || (t == Web3Tab.Predict && !PredictGame.Available(StoreStation.GetDayCounter())) || (t == Web3Tab.Ponzi && !PonziVisible)) continue;
var tab = t;
string name = L.T("web3.sub." + t.ToString().ToLowerInvariant());
b.AddButton(tab == _web3Tab ? $"[{name}]" : name, () => { _web3Tab = tab; _message = null; _edit = null; Open(); });
@@ -748,6 +817,7 @@ namespace Decentralized
b.End();
if (_web3Tab == Web3Tab.Stake) { StakePage(b); return; }
if (_web3Tab == Web3Tab.Predict) { PredictPage(b); return; }
if (_web3Tab == Web3Tab.Ponzi) { PonziPage(b); return; }
if (_web3Tab == Web3Tab.Mining) { ReportPage(b); return; }
if (_web3Tab == Web3Tab.Mixer) { MixerPage(b); return; }
if (_web3Tab == Web3Tab.Black) { BlackPage(b); return; }
@@ -1212,7 +1282,7 @@ namespace Decentralized
Open();
}
private enum Web3Tab { Trade, Stake, Predict, Mining, Mixer, Black }
private enum Web3Tab { Trade, Stake, Predict, Ponzi, Mining, Mixer, Black }
private static Web3Tab _web3Tab = Web3Tab.Trade;
private static string _mixAsset = Assets.PSC;
private static int _mixRounds = 2;