Used cards: counter quote tag instead of client-temporary feature; item type Material
Client-temporary features are stripped when an item sits on the front counter, so the scam markup never applied. The quote now lives in a tag and counts only while the item is not owned. GPU item type ELECTRONIC has no translation in the game, so cards are typed as Material. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9b48d7bf0e
commit
de7d5caafe
4 files changed
+30
-22
No files matched your search
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Decentralized.Domain;
|
||||
|
||||
@@ -5,7 +6,7 @@ namespace Decentralized
|
||||
{
|
||||
/// <summary>
|
||||
/// 二手显卡贩子:偶尔上门,把几张卡摆上柜台,玩家按外观自己判断(翻面看背面)。
|
||||
/// 老实人按真实价值卖,中间商加价,骗子夹带假卡并按标称型号报价;价格是柜台上的临时加价,买下之后卡只值真实价值。
|
||||
/// 老实人按真实价值卖,中间商加价,骗子夹带假卡并按标称型号报价;柜台价写在物品的报价标签上,物品归玩家之后只值真实价值。
|
||||
/// 另外把显卡登记为鉴定公会的鉴定物品,正确价值与实际售价是同一个数。
|
||||
/// </summary>
|
||||
public static class UsedDealerClient
|
||||
@@ -19,7 +20,12 @@ namespace Decentralized
|
||||
ModHook.OnGenerateCustomerNormal += OnGenerate;
|
||||
ModHelper.AddAppraisalItem(ModInfo.Id, Appraisal, Items.GpuId("RZX50"), 2, CreateForAppraisal, u => (int)CardValue.True(Items.ToUnit(u)),
|
||||
Items.IsGpu, null, () => L.T("appraisal.gpu"));
|
||||
ModHelper.AddDebugFunction(ModInfo.Id, ModInfo.Name, "Used dealer visit (test)", () => PlayerStore.Instance.storeClientManager?.AddClient(Create(DealerKind.Scammer)));
|
||||
ModHelper.AddDebugFunction(ModInfo.Id, ModInfo.Name, "Used dealer visit (test)", () => Log.Guard("二手贩子(测试)", () =>
|
||||
{
|
||||
var m = PlayerStore.Instance.storeClientManager;
|
||||
m.AddNextClient(Create(DealerKind.Scammer, 40));
|
||||
Log.Info($"二手贩子(测试)已排入,队列 {m.clientStack.Count} 人");
|
||||
}));
|
||||
}
|
||||
|
||||
public static void Unsubscribe()
|
||||
@@ -52,9 +58,9 @@ namespace Decentralized
|
||||
return item;
|
||||
}
|
||||
|
||||
private static StoreClient Create(DealerKind kind)
|
||||
private static StoreClient Create(DealerKind kind, int? atDay = null)
|
||||
{
|
||||
int day = StoreStation.GetDayCounter();
|
||||
int day = atDay ?? StoreStation.GetDayCounter();
|
||||
var rng = Session.Data.Rng;
|
||||
var cards = UsedDealers.Cards(kind, day, rng);
|
||||
var client = new StoreClient
|
||||
@@ -73,9 +79,9 @@ namespace Decentralized
|
||||
foreach (var c in cards)
|
||||
{
|
||||
var item = Items.NewCard(c.Model, c.Health, c.FakeOf, rng);
|
||||
if (c.MarkupPct != 0) item.AddItemFeature(Markup(c.MarkupPct));
|
||||
if (c.MarkupPct != 0) Items.SetQuote(item, (long)Math.Round(CardValue.True(Items.ToUnit(item)) * (1 + c.MarkupPct / 100.0)));
|
||||
PlayerStore.Instance.AddDirectSellingItemToTable(item);
|
||||
placed.Add($"{c.Model}{(c.FakeOf != null ? "←" + c.FakeOf : "")} {c.Health:0}% {c.MarkupPct:+0;-0}%");
|
||||
placed.Add($"{c.Model}{(c.FakeOf != null ? "←" + c.FakeOf : "")} {c.Health:0}% {c.MarkupPct:+0;-0}% 柜台价 {item.unitValue}(真实 {CardValue.True(Items.ToUnit(item))})");
|
||||
}
|
||||
Log.Info($"二手贩子({kind}):{string.Join(",", placed)}");
|
||||
}));
|
||||
@@ -83,17 +89,5 @@ namespace Decentralized
|
||||
client.CompleteClientCreation();
|
||||
return client;
|
||||
}
|
||||
|
||||
/// <summary>柜台上的临时加价:离开贩子之后自动去掉(游戏按客户临时特征处理)。</summary>
|
||||
private static ItemFeature Markup(int pct)
|
||||
{
|
||||
var f = new ItemFeature(ItemFeature.FeatureType.ClientTemporary) { identifier = "pd_used_markup", category = "markup", valueStage = ItemFeature.ValueStage.Market };
|
||||
string text = L.T("dealer.markup");
|
||||
f.SetPublicDisplay(text);
|
||||
f.SetActualDisplay(text);
|
||||
f.isFeatureMatch = true;
|
||||
f.SetPreExposedValueMod(pct);
|
||||
return f;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user