> For the complete documentation index, see [llms.txt](https://eurekabusiness.caiziii.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://eurekabusiness.caiziii.com/wan-jia-zhi-nan/customer-behaviors.md).

# 顾客行为、变体与连购机制

本文档面向玩家与店主，介绍顾客 NPC (Customer) 的生成规则、职业变体、购物偏好以及连续购买机制。

***

## 1. 顾客生成与入店流程

1. **店铺营业**：只要店铺钥匙设备中插入了有效的商店钥匙，店铺即处于 `OPEN` 状态。
2. **生成频率与出入口**：
   * 顾客会在设置好的店铺 **入口 (Entrance)** 附近生成。
   * 顾客具有独立的行为树驱动，入店后会环顾店内所有可售基座。
3. **购物篮上限**：
   * 每位顾客随身携带一个最多容纳 5 种不同商品的虚拟购物篮。

***

## 2. 顾客变体与职业偏好 (Customer Variants)

顾客不再是千篇一律的外观与需求，而是拥有不同的 **变体 (Variant)** 与 **皮肤着色 (Tint)**：

### 常见职业变体

| 变体名称 (Variant)                 | 核心要素偏好                                               | 出现条件与特性                  |
| ------------------------------ | ---------------------------------------------------- | ------------------------ |
| **普通顾客 (Villager / Commoner)** | 通用商品                                                 | 基础概率出现，购买店内常见的日常物品。      |
| **探险家 (Explorer)**             | `iter` (旅行), `alienis` (异域), `perfodio` (采掘)         | 店内有探险类矿物或地牢产物时概率提升。      |
| **炼金术士 (Alchemist)**           | `praecantatio` (魔法), `alkimia` (炼金), `potentia` (能量) | 店内陈列高等级魔法或药水材料时大幅增加出现概率。 |

### 6 色 Tint 换皮系统

即使是相同模型骨骼的顾客变体，系统也会赋予 6 种不同的服装着色 Tint（如经典棕、天青蓝、翡翠绿、绯红、琥珀金、深邃紫），使店铺内的客流视觉更加丰富生动。

***

## 3. 店铺元素画像与稀有顾客吸引

* **店铺元素画像 (Shop Element Profile)**：
  * 服务端会在顾客刷新时，快照统计店内所有陈列商品中所包含的要素及其最高等级。
  * 例如：若店内摆放了 `魔法 4 级` 的附魔书和 `能量 3 级` 的烈焰棒，店铺的画像即包含 `praecantatio=4` 与 `potentia=3`。
* **动态稀有度采样**：
  * 稀有变体（如炼金术士）的生成概率算法由店铺元素画像驱动： $$\text{生成概率} = \text{基础概率} (10%) + 5% \times \text{魔法要素等级}$$
  * 当店铺充斥着高阶神秘要素时，高端魔法学者与炼金专家将被大量吸引而来！

***

## 4. 连续购买机制 (Continue Purchase)

顾客在成功买下一件心仪的商品后，并不一定会立刻离开！

```
                     ┌──────────────────┐
                     │ 成功购买当前商品 │
                     └────────┬─────────┘
                              ▼
                     ┌──────────────────┐
                     │ 触发连购算法抽样 │
                     └────────┬─────────┘
                              │
             ┌────────────────┴────────────────┐
             ▼ (命中概率)                      ▼ (未命中或达上限)
    ┌─────────────────┐               ┌─────────────────┐
    │ 寻找下一个基座   │               │ 前往收银台排队   │
    │  (继续浏览购买) │               │   (准备结账)    │
    └─────────────────┘               └─────────────────┘
```

* **连购算法 (CustomerContinuePurchaseAlgorithm)**：
  * 每次交易成功后，系统会根据顾客变体与所购商品的要素计算“继续购买概率”。
  * **满意度刺激**：如果买到超值或契合其职业偏好的商品，连购概率显著上升（例如贪婪要素商品可提供高达 +20% 的连购意愿）。
  * **连购上限**：每位顾客有最大连购数量保护，达到上限后必去收银台排队。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://eurekabusiness.caiziii.com/wan-jia-zhi-nan/customer-behaviors.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
