MythicMobs 集成
EmakiAttribute 与 MythicMobs 深度集成,提供属性伤害技能机制、属性条件判断和怪物属性配置。
NOTE
MythicMobs 为软依赖,未安装时相关功能静默跳过。
技能机制:emaki_damage
注册名:emaki_damage(别名:emakiattribute_damage、attribute_damage)
在 MythicMobs 技能中使用属性伤害系统对目标造成伤害。
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
damage | 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 事件。 |
使用示例
# MythicMobs 技能配置
FireBlast:
Skills:
- emaki_damage{damage=50;damage_type=spell;allow_critical=true} @target技能机制:临时属性
以下机制作用于技能目标(@target、@self 等),对玩家和怪物均生效。临时属性到期后自动移除;不持久化,服务器重启即失效。
升级须知:限时属性行为变化
emaki_attribute_add_tag的复合效果 ID 已消失。 过去effect_prefix=poison会为每个命中属性各写一条poison:属性id的独立记录,现在全部归入poison一个效果组。按复合 ID 精确删除的旧配置会失效,改用emaki_attribute_remove{effect_id=poison};而过去删不掉东西的这条写法现在才真正生效。- 多个效果组对同一属性 SET(
set=true)时的胜者已确定为最后写入的那一条,不再依赖内部哈希表迭代顺序。
单属性技能配置不受影响,行为逐字不变。另:底层拒绝(未注册属性、非法 stack_mode、NaN)过去仍返回 SUCCESS,现在返回 INVALID_CONFIG 并在控制台输出告警。
emaki_attribute_add
注册名:emaki_attribute_add(别名:emakiattribute_add)
给目标添加一个临时属性。
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
effect_id | string | — | 效果组 ID。同一个 ID 下可放多个属性,互不覆盖、能被 emaki_attribute_remove 整组清掉;同 ID 同属性重复施加时才按叠加模式处理。别名:effectid、id。 |
attribute | string | — | 属性 ID。未注册时返回 INVALID_CONFIG 并输出告警。别名:attribute_id、attributeid。 |
value | double | 0 | 临时属性数值。NaN / ±Inf 返回 INVALID_CONFIG。别名:amount、v。 |
duration | int | — | 持续时间(tick),必须大于 0。别名:duration_ticks、ticks、d。 |
stack_mode | string | 属性默认 | 叠加模式 REPLACE / STACK。留空则使用属性定义的 temporary_stack_mode;写成其它值返回 INVALID_CONFIG 而不再静默回落。别名:stackmode、mode。 |
set | boolean | false | 为 true 时使用覆盖式赋值(SET)而非叠加式(ADD)。别名:override_value。 |
目标不是生物实体(LivingEntity)时返回 INVALID_TARGET。
emaki_attribute_remove
注册名:emaki_attribute_remove(别名:emakiattribute_remove)
清除目标身上指定 effect_id 效果组内的全部临时属性。
| 参数 | 类型 | 说明 |
|---|---|---|
effect_id | string | 要清理的效果组 ID;该组内全部属性一起移除。目标没有该组时返回 CONDITION_FAILED,目标不是生物实体时返回 INVALID_TARGET。别名:effectid、id。 |
emaki_attribute_add_tag
注册名:emaki_attribute_add_tag(别名:emakiattribute_add_tag)
给目标添加所有带指定标签的临时属性。会遍历所有 tags 含该标签的属性,并把它们全部归入同一个效果组,因此可以用 emaki_attribute_remove 传该组 ID 一次清掉整套。
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
tag | string | — | 属性标签(如 DEBUFF),不区分大小写。别名:tags、t。 |
value | double | 0 | 统一施加给每个属性的数值。别名:amount、v。 |
duration | int | — | 持续时间(tick),必须大于 0。别名:duration_ticks、ticks、d。 |
effect_prefix | string | tag:<tag> | 整套属性归入的效果组 ID。别名:effectprefix、prefix。 |
stack_mode | string | 各属性默认 | 叠加模式 REPLACE / STACK。留空则各属性使用自身的 temporary_stack_mode;写成其它值返回 INVALID_CONFIG。别名:stackmode、mode。 |
目标不是生物实体时返回 INVALID_TARGET。
emaki_attribute_clear_tag
注册名:emaki_attribute_clear_tag(别名:emakiattribute_clear_tag)
清除目标身上所有「属性带指定标签」的临时属性。
| 参数 | 类型 | 说明 |
|---|---|---|
tag | string | 属性标签,不区分大小写。别名:tags、t。目标不是生物实体时返回 INVALID_TARGET。 |
使用示例
# 命中目标附加 5 秒减速 debuff,并统一施加所有 DEBUFF 标签属性
CurseStrike:
Skills:
- emaki_attribute_add{effect_id=curse_slow;attribute=movement_speed;value=-2;duration=100} @target
- emaki_attribute_add_tag{tag=DEBUFF;value=-10;duration=100;stack_mode=STACK} @target
# 净化:清除目标所有 DEBUFF 临时属性
Purify:
Skills:
- emaki_attribute_clear_tag{tag=DEBUFF} @target条件:emaki_attribute
注册名:emaki_attribute(别名:emakiattribute_attribute、attribute_value、attribute_resource)
检查实体的属性值或资源值。
| 参数 | 类型 | 说明 |
|---|---|---|
attribute | string | 属性 ID(检查属性值时使用)。 |
resource | string | 资源 ID(检查资源值时使用)。仅对玩家生效。 |
field | string | 资源字段:current(别名 current_value、value)、max(别名 current_max)、default(别名 default_max)、bonus(别名 bonus_max)、percent。默认 current。 |
operator | string | 比较运算符。 |
value | double | 比较值。 |
value_2 | double | between 运算符时的第二个值。 |
运算符
| 运算符 | 别名 | 说明 |
|---|---|---|
> | gt | 大于。 |
>= | gte | 大于等于(默认值)。 |
< | lt | 小于。 |
<= | lte | 小于等于。 |
!= | <>、ne | 不等于。 |
between | — | 在 value 和 value_2 之间(含端点,自动按大小排序)。 |
NOTE
不填 operator 或填写无法识别的运算符时,都按 >= 处理。没有独立的等于运算符。
使用示例
# 当目标生命低于 30% 时触发
Conditions:
- emaki_attribute{resource=health;field=percent;operator=<;value=30} true怪物属性配置
在 MythicMobs 怪物配置文件中,通过 EmakiAttribute 节为怪物设置属性:
# MythicMobs 怪物配置
FireDragon:
Type: ENDER_DRAGON
Health: 500
EmakiAttribute:
- "physical_attack: 100"
- "physical_defense: 50"
- "spell_attack: 80"
- "health: 500"每一行必须加引号
EmakiAttribute 是字符串列表。写成 - physical_attack: 100(不加引号)时,YAML 会把它解析成映射而不是字符串,该节会被整段跳过,怪物拿不到任何属性,且不会有任何报错或警告。
判断方式:进战斗后开 /ea debug on,看攻击者快照里有没有你配的属性 ID。只有 default_profile 的默认项说明这一节没被读到。
- 属性值支持数学表达式(通过 ExpressionEngine 解析)。
- 怪物生成时自动同步属性。
- MythicMobs 重载后自动 resync 所有活跃怪物。
生命周期同步
| 事件 | 行为 |
|---|---|
MythicMobSpawnEvent | 怪物生成时读取 EmakiAttribute 节并同步属性。 |
MythicPostReloadedEvent | MythicMobs 重载后自动 resync 所有活跃的 MythicMobs 怪物。 |