MythicMobs 集成
EmakiAttribute 与 MythicMobs 深度集成,提供属性伤害技能机制、属性条件判断和怪物属性配置。
MythicMobs 为软依赖,未安装时相关功能静默跳过。
技能机制:emaki_damage
注册名:emaki_damage(别名:emakiattribute_damage、attribute_damage)
在 MythicMobs 技能中使用属性伤害系统对目标造成伤害。
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
damage / base | double | skill power | 基础伤害值。 |
damage_type | string | — | 伤害类型 ID(如 physical、spell)。 |
allow_critical | boolean | true | 是否允许暴击判定。 |
allow_target_dodge | boolean | false | 是否允许目标闪避。 |
calculate_target_defense | boolean | true | 是否计算目标防御。 |
trigger_mythic_on_damaged | boolean | false | 是否触发 MythicMobs 的 on_damaged 事件。 |
使用示例
yaml
# MythicMobs 技能配置
FireBlast:
Skills:
- emaki_damage{damage=50;damage_type=spell;allow_critical=true} @target条件:emaki_attribute
注册名:emaki_attribute(别名:emakiattribute_attribute、attribute_value、attribute_resource)
检查实体的属性值或资源值。
| 参数 | 类型 | 说明 |
|---|---|---|
attribute | string | 属性 ID(检查属性值时使用)。 |
resource | string | 资源 ID(检查资源值时使用)。 |
field | string | 资源字段:current/max/default/bonus/percent。 |
operator | string | 比较运算符。 |
value | double | 比较值。 |
value_2 | double | between 运算符时的第二个值。 |
运算符
| 运算符 | 别名 | 说明 |
|---|---|---|
> | gt | 大于。 |
>= | gte | 大于等于。 |
< | lt | 小于。 |
<= | lte | 小于等于。 |
!= | ne | 不等于。 |
between | — | 在 value 和 value_2 之间。 |
使用示例
yaml
# 当目标生命低于 30% 时触发
Conditions:
- emaki_attribute{resource=health;field=percent;operator=<;value=30} true怪物属性配置
在 MythicMobs 怪物配置文件中,通过 EmakiAttribute 节为怪物设置属性:
yaml
# MythicMobs 怪物配置
FireDragon:
Type: ENDER_DRAGON
Health: 500
EmakiAttribute:
- physical_attack: 100
- physical_defense: 50
- spell_attack: 80
- health: 500- 属性值支持数学表达式(通过 ExpressionEngine 解析)。
- 怪物生成时自动同步属性。
- MythicMobs 重载后自动 resync 所有活跃怪物。
生命周期同步
| 事件 | 行为 |
|---|---|
MythicMobSpawnEvent | 怪物生成时读取 EmakiAttribute 节并同步属性。 |
MythicPostReloadedEvent | MythicMobs 重载后自动 resync 所有活跃的 MythicMobs 怪物。 |