宝石定义
宝石定义描述一颗宝石能提供哪些效果、可以镶嵌到哪些插槽、费用配置以及升级路径。文件位于 gems/*.yml,文件名即为宝石的内部标识。
顶层字段
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | string | 是 | 宝石唯一 ID。 |
display_name | string | 是 | 宝石显示名(MiniMessage 格式)。 |
gem_type | string | 是 | 宝石类型,用于插槽兼容性匹配(如 attack、defense、utility、universal)。 |
level | integer | 否 | 宝石基础等级,升级后递增。默认 1。 |
item_sources | list | 是 | 宝石物品来源(格式 "提供者-物品ID")。 |
custom_model_data | integer | 否 | 自定义模型数据。 |
effects | list | 否 | 宝石效果列表(统一格式,见下方说明)。 |
socket_compatibility | list | 否 | 允许镶嵌的插槽类型列表。 |
inlay_cost | object | 否 | 镶嵌费用配置。 |
extract_cost | object | 否 | 拆卸费用配置。 |
extract_return | object | 否 | 拆卸返还模式。 |
upgrade | object | 否 | 升级配置。 |
actions | object | 否 | 镶嵌/拆卸成功时的动作。 |
效果系统(effects)
宝石效果统一使用 effects 列表,通过 type 字段区分类型:
| type | 说明 |
|---|---|
variables | 表达式引擎变量,用于 Lore 占位符渲染。 |
ea_attribute | EmakiAttribute PDC 属性,写入装备 PDC。 |
es_skill | EmakiSkills 技能附加。 |
name_action | 镶嵌后对装备名称的修改。 |
lore_action | 镶嵌后对装备 Lore 的修改。 |
yaml
effects:
- type: "variables"
variables:
physical_attack: 8
physical_crit_rate: 3
- type: "ea_attribute"
ea_attributes:
physical_attack: 8.0
physical_crit_rate: 3.0
- type: "name_action"
name_actions:
- action: "append_suffix"
value: " <red>[%display_name%]</red>"
- type: "lore_action"
lore_actions:
- action: "append"
content:
- "<red>◆ %display_name%: 物理攻击+%physical_attack% 暴击率+%physical_crit_rate%%</red>"最小示例
yaml
id: "ruby_basic"
display_name: "<red>红宝石</red>"
gem_type: "attack"
level: 1
item_sources:
- "minecraft-redstone"
socket_compatibility:
- "attack"
- "universal"
effects:
- type: "variables"
variables:
physical_attack: 5
- type: "ea_attribute"
ea_attributes:
physical_attack: 5.0费用配置
镶嵌费用
yaml
inlay_cost:
currencies:
- provider: "vault"
currency_id: ""
base_cost: 1000
cost_formula: "%base_cost% * %level%"
display_name: "<gold>金币</gold>"
materials:
- item_sources:
- "minecraft-gold_nugget"
amount: 1拆卸费用
yaml
extract_cost:
currencies:
- provider: "vault"
currency_id: ""
base_cost: 500
cost_formula: "%base_cost% * %level%"
display_name: "<gold>金币</gold>"拆卸返还模式
| 字段 | 说明 |
|---|---|
mode | "original"(原样返还)、"destroy"(销毁)、"downgrade"(降级返还)。 |
downgrade_levels | 降级时降低的等级数。 |
degraded_chance | 降级概率(0.0 = 必定降级,1.0 = 必定不降级)。 |
yaml
extract_return:
mode: "original"
downgrade_levels: 1
degraded_chance: 0.0升级系统
宝石支持内置升级系统,通过消耗材料和金币提升等级,解锁更强效果。
升级顶层字段
| 字段 | 说明 |
|---|---|
enabled | 是否启用升级。 |
max_level | 最大等级。 |
gui_template | 升级 GUI 模板。 |
failure_penalty | 升级失败惩罚:"none"、"downgrade"、"destroy"。 |
economy | 全局默认经济配置(各等级可单独覆盖)。 |
success_rates | 各等级升级成功率。 |
levels | 各等级详细配置。 |
等级配置
每个等级可包含:
| 字段 | 说明 |
|---|---|
display_name | 该等级的显示名称。 |
effects | 升级后的效果(覆盖基础 effects)。 |
materials | 升级所需材料。 |
economy | 单独覆盖此等级的经济配置。 |
success_rate | 单独覆盖此等级的成功率。 |
failure_penalty | 单独覆盖此等级的失败惩罚。 |
actions | 升级成功/失败时的动作。 |
升级示例
yaml
upgrade:
enabled: true
max_level: 4
gui_template: "upgrade/default"
failure_penalty: "none"
economy:
enabled: true
currencies:
- provider: "vault"
currency_id: ""
base_cost: 2000
cost_formula: "%base_cost% * %target_level%"
display_name: "<gold>金币</gold>"
success_rates:
2: 100.0
3: 80.0
4: 60.0
levels:
2:
display_name: "<red>红宝石 II</red>"
effects:
- type: "variables"
variables:
physical_attack: 12
physical_crit_rate: 4
- type: "ea_attribute"
ea_attributes:
physical_attack: 12.0
physical_crit_rate: 4.0
- type: "lore_action"
lore_actions:
- action: "append"
content:
- "<red>◆ 红宝石 II: 物理攻击+12 暴击率+4%</red>"
materials:
- item_sources:
- "minecraft-gold_nugget"
amount: 3
actions:
success:
- 'sendmessage text="<gold>红宝石升级至 II!</gold>"'
failure: []
4:
display_name: "<red>红宝石 IV</red>"
effects:
- type: "variables"
variables:
physical_attack: 22
physical_crit_rate: 7
- type: "ea_attribute"
ea_attributes:
physical_attack: 22.0
physical_crit_rate: 7.0
- type: "es_skill"
es_skills:
- "ruby_burst"
- type: "lore_action"
lore_actions:
- action: "append"
content:
- "<red>◆ 红宝石 IV: 物理攻击+22 暴击率+7%</red>"
- "<gold> ★ 解锁技能: 红宝石爆发</gold>"
materials:
- item_sources:
- "minecraft-netherite_ingot"
amount: 1
economy:
enabled: true
currencies:
- provider: "vault"
currency_id: ""
base_cost: 5000
cost_formula: "%base_cost%"
display_name: "<gold>金币</gold>"
success_rate: 60.0
failure_penalty: "downgrade"
actions:
success:
- 'sendmessage text="<gold>成功将红宝石升级至 IV!</gold>"'
failure:
- 'sendmessage text="<red>升级失败,宝石降级了...</red>"'全局升级默认值
如果单颗宝石没有单独配置 success_rate、success_rates 或 failure_penalty,系统会使用 config.yml 中的全局升级配置:
yaml
upgrade:
global_success_rates:
2: 100.0
3: 80.0
4: 60.0
5: 45.0
6: 30.0
global_failure_penalty: "none"| 字段 | 说明 |
|---|---|
global_success_rates | 按目标等级配置升级成功率。key 为升级后的等级。 |
global_failure_penalty | 全局失败惩罚,支持 none、downgrade、destroy。 |
失败惩罚说明:
| 值 | 行为 | 适合场景 |
|---|---|---|
none | 失败不改变宝石等级。 | 新手服、低风险养成。 |
downgrade | 失败降低 1 级,最低保留 1 级。 | 中高阶成长线。 |
destroy | 失败销毁宝石。 | 高价值、强消耗玩法。 |
单颗宝石或单个等级中的 failure_penalty 优先级高于全局配置。设计高阶宝石时,可以低等级使用 none,高等级逐步改为 downgrade,只在极高阶使用 destroy。
插槽类型设计
常见插槽类型分类:
| 类型 | 适用装备 | 推荐宝石方向 |
|---|---|---|
attack | 武器 | 攻击、暴击、穿透。 |
defense | 防具 | 防御、生命、减伤。 |
utility | 饰品 | 功能性属性(速度、吸血、冷却)。 |
universal | 所有装备 | 通用属性(经验加成、掉落率)。 |
建议不超过 4 种插槽类型,否则玩家理解成本过高。