Ponzi via signed wallet calls; counter informants guarantee prediction markets
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9484de2f1f
commit
4279d48374
8 files changed
+102
-29
No files matched your search
@@ -46,12 +46,12 @@ namespace Decentralized
|
||||
return c == 0 ? 0.50 : c == 1 ? 0.35 : c == 2 ? 0.25 : 0;
|
||||
}
|
||||
|
||||
private static double EventProb(StoreEventManager mgr, string id, int days)
|
||||
private static double EventProb(StoreEventManager mgr, string id, int days, bool ignoreCooldown = false)
|
||||
{
|
||||
var pool = StoreEventManager.normalEventBlueprints.Where(e => !mgr.IsEventOnCooldown(e.identifier)).ToList();
|
||||
var pool = StoreEventManager.normalEventBlueprints.Where(e => ignoreCooldown || !mgr.IsEventOnCooldown(e.identifier)).ToList();
|
||||
var bp = pool.Find(e => e.identifier == id);
|
||||
if (bp == null) return 0;
|
||||
return PredictMath.EventProb(DayChance(mgr), bp.odd, pool.Sum(e => (double)e.odd), days);
|
||||
return PredictMath.EventProb(ignoreCooldown ? 0.35 : DayChance(mgr), bp.odd, pool.Sum(e => (double)e.odd), days);
|
||||
}
|
||||
|
||||
/// <summary>已经排进日程的事件 / 派系行动在窗口里的开始日(known = 只看玩家已知的)。</summary>
|
||||
@@ -133,10 +133,39 @@ namespace Decentralized
|
||||
public static void Morning(SaveData d, int day)
|
||||
{
|
||||
if (!Available(day)) return;
|
||||
ForceKnown(d, day);
|
||||
var made = d.Predict.Refill(day, d.Rng, Candidates(day));
|
||||
foreach (var m in made) Log.Info($"预测盘口 #{m.Id}:{m.Kind} {m.Key} {m.Title} 阈值 {m.Param} 窗口 {m.FromDay}-{m.ToDay} 先验 {m.P0:0.000}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 柜台线人(游戏里卖消息的顾客)、传闻纸条和派系特权会把事件排进日程且标为已知:每个这样的事件保证有一个盘口(窗口 = 开始那天),
|
||||
/// 开盘价按公开信息下的基础概率,不因为已经排期而抬高——知道的人能赚到价格追上来之前的差。开始日是明天的来不及,不开。
|
||||
/// </summary>
|
||||
private static void ForceKnown(SaveData d, int day)
|
||||
{
|
||||
var mgr = StoreStation.Instance?.storeEventManager;
|
||||
if (mgr == null) return;
|
||||
var bk = d.Predict;
|
||||
for (int i = 0; i < mgr.futurEvents.Count; i++)
|
||||
{
|
||||
var e = mgr.futurEvents[i];
|
||||
int start = day + mgr.futurEventsDay[i];
|
||||
if (!e.IsKnown || start < day + 2 || e.eventType == StoreEvent.EventType.COSMETIC) continue;
|
||||
bool op = e.isFactionOperation;
|
||||
var kind = op ? PredictKind.Faction : PredictKind.Event;
|
||||
string key = op ? e.sourceFaction : e.identifier;
|
||||
if (!op && !StoreEventManager.normalEventBlueprints.Any(b => b.identifier == key)) continue;
|
||||
if (bk.Markets.Any(m => m.Outcome < 0 && m.Kind == kind && m.Key == key && m.FromDay <= start && m.ToDay >= start)) continue;
|
||||
if (bk.Markets.Count(m => m.Outcome < 0) >= Tuning.PredictOpenMax + 2) break;
|
||||
double p = op ? PredictMath.FactionProb(1) : EventProb(mgr, key, 1, true);
|
||||
string title = op ? L.T("predict.faction." + key) : e.GetDisplayName();
|
||||
var m2 = PredictMarket.Create(++bk.Seq, kind, key, title, 0, day, start, start, p);
|
||||
bk.Markets.Add(m2);
|
||||
Log.Info($"线人情报开盘 #{m2.Id}:{kind} {key} 第 {start} 天,先验 {p:0.000}");
|
||||
}
|
||||
}
|
||||
|
||||
// ——— 公开信息下的合理概率(盘口夜里向它靠拢) ———
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in new issue
Block a user