Skip to content

16. 通缉悬赏、治安官逮捕演出与盘查事件 ​

本子系统涵盖两大警务交互机制:把顾客设为可抓捕的通缉犯(SetWanted + customOnArrestDialogue),以及 制作不可打发、不可枪击的治安官/内务官上门盘查事件(ClientIntent.DIALOGUE + CompleteSecClient)。


1. 通缉悬赏与自定义逮捕演出 ​

调用 sc.SetWanted(int bountyCash, string wantedName, bool isWanted = true) 后,玩家可以在交易途中按下柜台下的报警按钮召唤治安官抓捕该顾客并领取赏金。

关键规则:自定义 sc.customOnArrestDialogue 的最后一句话必须在 SetEndAction 中调用 StoreUIManager.Instance?.OnArrestDialoguePlayed(),否则逮捕过场动画会停留在原地等待。

csharp
sc.SetWanted(120, "Vincent (V)", true);

sc.customOnArrestDialogue = new Dialogue()
    .SetText("CLIENT", NpcFrameworkSdk.T("靠,你跟德克斯特那肥猪一样背后捅刀子?!", "Damn it, you're just another backstabbing fixer like Dex?!"))
    .NextDialogue()
    .SetText("SEC", NpcFrameworkSdk.T("发现目标!启动斯安威斯坦抑制器,压制他!", "Target located! Activate Sandevistan dampeners and pin him down!"))
    .SetEndAction(() =>
    {
        NpcFrameworkSdk.SetSaveInt("v_stage", 5);
        StoreUIManager.Instance?.OnArrestDialoguePlayed();
    });

2. 治安官 / 企业特勤上门盘查事件 ​

当制作类似 billy3Officier(内务部调查官)或 v_act3_corpo_sec(企业特勤追缉官)的纯剧情盘查事件时:

  1. 设置 clientIntent = StoreClient.ClientIntent.DIALOGUE(枚举值 5);
  2. 设置 nonShootable = true, dismissable = false(禁止玩家开枪击杀或按门铃逃避盘查);
  3. 在 sc.CompleteClientCreation(false) 之后紧接着调用 sc.CompleteSecClient()。
csharp
var sc = new StoreClient
{
    identifier = "v_act3_corpo_sec",
    displayName = NpcFrameworkSdk.T("企业特勤追缉官", "Corpo Spec-Ops Investigator"),
    spriteName = SpriteDict.GetRandomSecCorpoSpriteName(),
    clientFaction = "FACTION_SECURITY",
    clientIntent = StoreClient.ClientIntent.DIALOGUE,
    nonShootable = true,
    dismissable = false
};
// ... 挂载 AddChoice 盘查分支 ...
sc.CompleteClientCreation(false);
sc.CompleteSecClient();

Custom NPC Framework Documentation