01. 常规买家与求购清单 (ClientIntent.BUY)
常规买家是《深空当铺:可能是偷的》中最基础的顾客类型。顾客进入店铺后提出求购特定类别(Tag)或特定物品 ID 的需求,玩家从货架或后仓取出匹配的商品摆上柜台,在顾客预算范围内完成议价与交付。
核心字段与方法
| 字段 / 方法 | 类型 | 说明 |
|---|---|---|
sc.clientIntent | StoreClient.ClientIntent | 设为 StoreClient.ClientIntent.BUY(枚举值 1)。 |
sc.SetBudget(int amount) | void | 设置顾客本次进店携带的现金预算上限。 |
sc.useClientBudget | bool | 是否启用预算限制(默认 true)。 |
sc.clientBuyingTagList | List<string> | 顾客愿意收购的物品分类标签列表(如 "MEDICAL", "FIREARM")。满足任一标签即可放到柜台交易。 |
sc.clientBuyingIdList | List<string> | 顾客指定收购的具体物品 itemID 列表(如 "blood_bag", "aug_chip")。 |
sc.clientBlackTagList | List<string> | 顾客明确拒收的物品分类标签黑名单。 |
sc.clientBlackIdList | List<string> | 顾客明确拒收的具体物品 itemID 黑名单。 |
sc.SetVariety() | void | 调用后,顾客在单次交易中要求多件不同种类的商品,拒绝重复收同一件商品。 |
代码示例:高预算专项买家
csharp
private static StoreClient CreateMedicalBuyer()
{
var sc = new StoreClient
{
identifier = "clinic_runner",
displayName = NpcFrameworkSdk.T("诊所跑腿员", "Clinic Runner"),
spriteName = SpriteDict.GetRandomMedSpriteName(),
clientFaction = "FACTION_LOWER_LEVEL",
clientIntent = StoreClient.ClientIntent.BUY,
buyPriceModifier = 25
};
// 1. 设置携带预算 360 信用点
sc.SetBudget(360);
// 2. 添加求购标签与具体物品 ID
sc.clientBuyingTagList.Add("MEDICAL");
sc.clientBuyingIdList.Add("blood_bag");
sc.clientBuyingIdList.Add("hemostatic_bandage_item");
// 3. 排除违禁致幻剂
sc.clientBlackTagList.Add("NARCOTIC");
sc.mainDialogue.SetText(sc.displayName,
NpcFrameworkSdk.T("下层区诊所急需一批医疗物资,你有血袋或者止血绷带吗?", "The clinic needs medical supplies. Got any blood bags or hemostatic bandages?"));
sc.placeRightItemWhenSellingToDialogue = new Dialogue()
.SetText(sc.displayName, NpcFrameworkSdk.T("太好了,正是我们需要的。", "Great, that's exactly what we need."));
sc.acceptDealDialogue = new Dialogue()
.SetText(sc.displayName, NpcFrameworkSdk.T("多谢,这就送回诊所。", "Thanks, taking these straight back to the clinic."));
sc.CompleteClientCreation(false);
return sc;
}