From 9165c9edf4f006b0c9618f983ddcd4ddcb9b83b1 Mon Sep 17 00:00:00 2001 From: ZHU MINCHAO <48154958+MinchaoZhu@users.noreply.github.com> Date: Tue, 3 Nov 2026 15:03:52 +0800 Subject: [PATCH] Reputation loss when a buyer catches a false label scales with the price gap (per weekly rent, 1 to 25); drop old-save model fallback Co-Authored-By: Claude Sonnet 5.5 --- src/Decentralized/Items.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Decentralized/Items.cs b/src/Decentralized/Items.cs index 568a12f..4f4de35 100644 --- a/src/Decentralized/Items.cs +++ b/src/Decentralized/Items.cs @@ -124,6 +124,10 @@ namespace Decentralized private static object checkedClient; private static readonly HashSet checkedItems = new HashSet(); public const double CustomerSpotChance = 0.35; + public const int RepLossMax = 25; + + /// 被顾客看穿时的信誉损失:骗的价差每满一周房租扣 1 点,最少 1,最多 25。 + public static int RepLoss(long gap) => (int)Math.Max(1, Math.Min(RepLossMax, Math.Round(gap / (double)Math.Max(1, PlayerStore.Instance.rentValue)))); /// /// 自己的卡摆给想买的顾客:说法里隐瞒的每一项,顾客有 35% 的概率看出来;看出来就拆穿这一项(价格回到真实情况), @@ -154,12 +158,14 @@ namespace Decentralized if (r != CardLabels.RowSpec && CardLabels.IsEvidence(r, claim.Value, Claim.Truth(u))) found |= CardLabels.RowSpec | CardLabels.RowBuild; } if (found == 0) return; + long before = item.unitValue; item.ModifyTag(ExposedTag, t => t.Enable().SetInt(exposed | found)); Refresh(item); + int rep = RepLoss(before - item.unitValue); string faction = string.IsNullOrEmpty(client.clientFaction) || StoreReputation.GetStoreReputation(client.clientFaction) == null ? "FACTION_LOWER_LEVEL" : client.clientFaction; - StoreReputation.ModReputation(faction, -2); + StoreReputation.ModReputation(faction, -rep); EmporiumAudioPlayer.Instance?.audioFail?.Play(); - Log.Info($"顾客看出标签不实:{found},价格 {item.unitValue},信誉 −2"); + Log.Info($"顾客看出标签不实:{found},价格 {item.unitValue},信誉 −{rep}"); DialogUIManager.Instance.StartDialogue(new Dialogue().SetText("CLIENT", L.T((found & CardLabels.RowSpec) != 0 ? "cust.fake." + rng.Range(1, 2) : "cust.worn." + rng.Range(1, 2)))); } @@ -253,7 +259,7 @@ namespace Decentralized public static Unit ToUnit(GameItem item) { string model = item.identifier.Substring(GpuPrefix.Length); - model = Hardware.Specs.Keys.FirstOrDefault(k => k.ToLowerInvariant() == model) ?? "RZX60"; // 旧版本存档里的型号已改名,当作低端卡 + model = Hardware.Specs.Keys.FirstOrDefault(k => k.ToLowerInvariant() == model) ?? "RZX60"; var u = new Unit { Model = model, Health = 100 }; if (item.IsTag(HealthTag)) u.Health = item.GetTagReadonly(HealthTag).GetDouble(); if (item.IsTag(FakeTag)) u.FakeOf = item.GetTagReadonly(FakeTag).GetString();