> For the complete documentation index, see [llms.txt](https://hamsterbaron.gitbook.io/hamsterbaron/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hamsterbaron.gitbook.io/hamsterbaron/overview/mechanic.md).

# 机制模块 - "Mechanic."

## 运作原理

Arcana 技能机制组件是高度模块化且十分易于上手的，它由四个最核心的部分组成：Trigger（触发器），Flags（属性组），Condition（条件块），Action（动作块）。通过这四个基础元素，您便能够让您的武器与游戏环境进行深度互动，构建从简单的击杀技能到复杂的全局环境成长等一系列独特机制。整个技能机制组件的运作步骤如下图所示：

![](/files/RIKUkNAl0qWf4gENeEDK)

此处将简要说明各个单元的具体含义，以便您更好的了解这套系统的运作过程。

* **Trigger \[触发器]** : 该单元包括了一系列监听器，通过监听类似持枪，奔跑，跳跃等主动交互以及受伤，全局信号等被动环境事件，来激活一个机制的执行。
* **Flags \[属性组]** : 这部分规定了机制块的基本属性，例如触发概率，触发冷却，满足条件重复触发次数，每次触发的间隔；对一些特殊的触发器，持续触发时长以及缓存释放等也在此处配置、
* **Condition \[条件块]** : 条件块是判断机制是否应该被激活的区域。当触发器传入一个触发信号后，条件块就开始匹配每一行条件是否满足，并根据条件表达式来决策后续控制流程。
* **Action \[动作块]** : 一个机制的核心构成。在机制被触发且条件均满足时，动作块将会根据配置好的属性来进行执行指令，激活事件，召唤生物，播放动画等一系列操作。

***

## 绑定机制

您可能好奇，在技能制作完备之后，如何把他与一个枪械绑定在一起？Arcana 提供了非常灵活的方式将您自创的独特机制应用到您的武器上，充分考虑了拓展包开发者，整合包制作者与服务器制作者等多种需求。每一个机制都将拥有一个内部名和数个匹配条件。具体的检测有如下几种：

* **Lore 检测匹配** : 这个模式常用于机制的开发测试，整合包内容以及服务器制作。拥有该机制所对应 Lore 物品描述检测字段的 TacZ 模组枪械则会运行您所设计的机制。
* **Attachment 检测匹配** : 这个模式适合服务器丰富玩法与 TacZ 拓展资源包的制作。可将机制与一个或多个枪械配件所绑定，安装对应配件的枪械将被自动运用上相关机制。
* **Dictionary 字典匹配** : 最适合 TacZ 拓展资源包的独特武器机制开发的模式。通过一个索引字典文件指定特定 ID 的枪械物品将拥有哪些机制，该索引文件将处于您的 TacZ 拓展资源包中。

有关将您所制作的机制应用至具体的 Timeless and Classic:Zero Mod 物品上的详细说明，请查阅章节[制作机制](/hamsterbaron/mechanic-guides/getting-started.md)以及设定技能索引。如有其他疑问请查阅[机制组件向导](/hamsterbaron/mechanic-guides/getting-started.md)章节。

{% content-ref url="/pages/wpdgoaun5FYkyHiR710H" %}
[Mechanic Guides](/hamsterbaron/mechanic-guides/getting-started.md)
{% endcontent-ref %}


---

# 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://hamsterbaron.gitbook.io/hamsterbaron/overview/mechanic.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.
