鉴定改版:风扇数、供电口、丝印、序列号四项真伪依据在前,假卡依据各自独立(平均 1.5 项);指南去档次、去卖家说法
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a8d7bc3427
commit
f40436b7d2
57 files changed
+451
-261
No files matched your search
@@ -23,6 +23,11 @@ namespace Decentralized.Domain
|
||||
/// 2 档次码与标称型号不符(贴的是原芯片的序列号)。后两种只出现在假卡上。</summary>
|
||||
public int Serial;
|
||||
|
||||
/// <summary>风扇数对不上标称型号(实物是真实芯片的风扇数):0 对得上,1 对不上。只出现在假卡上。</summary>
|
||||
public int CountBad;
|
||||
/// <summary>供电口对不上标称型号(实物是真实芯片的供电口):0 对得上,1 对不上。只出现在假卡上。</summary>
|
||||
public int PinBad;
|
||||
|
||||
public const int Variants = 3;
|
||||
|
||||
/// <summary>每张卡自己的随机种子:老化类维度(风扇、金手指、挡板划痕)由它和当前健康度决定,每晚损耗后重新算,
|
||||
@@ -56,13 +61,14 @@ namespace Decentralized.Domain
|
||||
public double HashFactor => FanHash[Fan] * FingerHash[Fingers];
|
||||
|
||||
/// <summary>六位数字,存在物品标签上:风扇、金手指、挡板、丝印、封条、序列号。</summary>
|
||||
public string Encode() => $"{Fan}{Fingers}{Bracket}{Print}{Sticker}{Serial}";
|
||||
public string Encode() => $"{Fan}{Fingers}{Bracket}{Print}{Sticker}{Serial}{CountBad}{PinBad}";
|
||||
|
||||
public static CardLook Decode(string s)
|
||||
{
|
||||
if (s == null || (s.Length != 5 && s.Length != 6)) return default;
|
||||
if (s == null || s.Length < 5 || s.Length > 8) return default;
|
||||
int D(int i) => Math.Max(0, Math.Min(Variants - 1, s[i] - '0'));
|
||||
return new CardLook { Fan = D(0), Fingers = D(1), Bracket = D(2), Print = D(3), Sticker = D(4), Serial = s.Length > 5 ? D(5) : 0 };
|
||||
int B(int i) => s.Length > i && s[i] == '1' ? 1 : 0;
|
||||
return new CardLook { Fan = D(0), Fingers = D(1), Bracket = D(2), Print = D(3), Sticker = D(4), Serial = s.Length > 5 ? D(5) : 0, CountBad = B(6), PinBad = B(7) };
|
||||
}
|
||||
|
||||
// 外观维度对应卡的真实状态:损耗、暴毙概率随之变化,价值走标签(见 CardLabels)
|
||||
@@ -76,20 +82,28 @@ namespace Decentralized.Domain
|
||||
public double DeathFactor => FanDeath[Fan] * FingerDeath[Fingers];
|
||||
|
||||
/// <summary>只在假卡上出现的取值:玩家一旦看到,就能肯定是假的。</summary>
|
||||
public bool HasFakeSign => Print != 0 || Serial != 0;
|
||||
public bool HasFakeSign => Print != 0 || Serial != 0 || CountBad != 0 || PinBad != 0;
|
||||
|
||||
/// <summary>
|
||||
/// 生成外观。真卡:老化维度按健康度出现,封条缺失在二手卡上很常见,不会出现破绽类取值。
|
||||
/// 假卡:在三类破绽(接口数、丝印、手写序列号)里随机挑 1–3 处,再叠加老化与封条缺失。
|
||||
/// </summary>
|
||||
public static CardLook Generate(Rng rng, double health, bool fake)
|
||||
public static CardLook Generate(Rng rng, double health, bool fake, int labelTier = 3, int chipTier = 0)
|
||||
{
|
||||
var look = new CardLook { Seed = rng.NextUInt() | 1, Sticker = rng.Chance(fake ? 0.35 : 0.15 + 0.30 * (1 - Math.Max(0, Math.Min(100, health)) / 100.0)) ? 2 : 0 };
|
||||
if (fake)
|
||||
{
|
||||
// 假卡本身就带着实物上的破绽(低档次的板子:供电口和风扇数对不上),此外骗子还可能重印丝印、补贴序列号
|
||||
if (rng.Chance(0.55)) look.Print = rng.Chance(0.6) ? 1 : 2;
|
||||
if (rng.Chance(0.65)) look.Serial = rng.Chance(0.55) ? 2 : 1;
|
||||
// 四项真伪依据(风扇数、供电口、背面丝印、序列号)各自独立地露出破绽,至少一项;平均每张假卡约 1.5 项
|
||||
bool countCan = Hardware.FanCount[chipTier] != Hardware.FanCount[labelTier], pinCan = Hardware.PinClass[chipTier] != Hardware.PinClass[labelTier];
|
||||
double p = Tuning.FakeSignChance;
|
||||
for (int tries = 0; tries < 30 && !look.HasFakeSign; tries++)
|
||||
{
|
||||
look.CountBad = countCan && rng.Chance(p) ? 1 : 0;
|
||||
look.PinBad = pinCan && rng.Chance(p) ? 1 : 0;
|
||||
look.Print = rng.Chance(p) ? (rng.Chance(0.6) ? 1 : 2) : 0;
|
||||
look.Serial = rng.Chance(p) ? (rng.Chance(0.55) ? 2 : 1) : 0;
|
||||
}
|
||||
if (!look.HasFakeSign) look.Serial = 1;
|
||||
}
|
||||
return look.Appearance(health);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user