11. 定制枪械改装委托单 (BuildCustomGunOrder)
《深空当铺:可能是偷的》内置了完整的枪械零件拆装与属性评估系统(GunOrderData)。当顾客的 clientIntent = StoreClient.ClientIntent.GUNSMITH 时,可通过 NpcFrameworkSdk.BuildCustomGunOrder 构建包含 必修指标(mandatoryRequirements) 与 加分指标(bonusRequirements) 的定制改枪委托单。
SDK 方法签名与 18 项枪械属性标签
csharp
public static GunOrderData BuildCustomGunOrder(
int tier,
int baseReward,
string dialogText,
bool isBestOrder,
IList<(string statTag, int minVal, int bonusReward, bool isMandatory)> requirements)支持的枪械属性标签(statTag)
"GUN_CALIBER_TAG":口径要求"GUN_SUPPRESSED_TAG":是否安装消音器(minVal = 1表示要求消音)"GUN_FIREPOWER_TAG"/"GUN_CURRENT_FIREPOWER_TAG":火力值"GUN_ACCURACY_TAG"/"GUN_CURRENT_ACCURACY_TAG":精准度"GUN_RELIABILITY_TAG"/"GUN_CURRENT_RELIABILITY_TAG":可靠性"GUN_ERGONOMICS_TAG"/"GUN_CURRENT_ERGONOMICS_TAG":人机工效"GUN_RECOIL_TAG"/"GUN_CURRENT_RECOIL_TAG":后坐力控制"GUN_REPAIRBILITY_TAG"/"GUN_CURRENT_REPAIRBILITY_TAG":可维修性"GUN_STYLE_TAG"/"GUN_CURRENT_STYLE_TAG":外观风格"GUN_FRAME_TAG"/"GUN_SIZE_TAG":枪身框架与尺寸
代码示例:消音高精准度暗杀手枪委托
csharp
private static StoreClient CreateGunsmithClient()
{
var sc = new StoreClient
{
identifier = "hitman_gunsmith",
displayName = NpcFrameworkSdk.T("契约杀手", "Contract Hitman"),
spriteName = SpriteDict.GetRandomMercSpriteName(),
clientFaction = "FACTION_BLACK_MARKET",
clientIntent = StoreClient.ClientIntent.GUNSMITH
};
sc.gunOrderData = NpcFrameworkSdk.BuildCustomGunOrder(
tier: 2,
baseReward: 380,
dialogText: NpcFrameworkSdk.T("帮我改一把带消音器、高火力且精准可靠的潜行武器。", "Build me a suppressed, high-firepower sidearm with clean accuracy."),
isBestOrder: true,
requirements: new List<(string statTag, int minVal, int bonusReward, bool isMandatory)>
{
("GUN_SUPPRESSED_TAG", 1, 80, true), // 必修:消音器 (+80)
("GUN_FIREPOWER_TAG", 45, 100, true), // 必修:火力 >= 45 (+100)
("GUN_ACCURACY_TAG", 60, 120, false), // 加分项:精准度 >= 60 (+120)
("GUN_RELIABILITY_TAG", 70, 90, false) // 加分项:可靠性 >= 70 (+90)
}
);
sc.CompleteClientCreation(false);
return sc;
}