import { CotycPlugin } from '../../src/renderer/game/engine/kernel/plugin' /** 示例内容插件:注入事件池 + 一个护山能力(开发范本) */ export const examplePlugin: CotycPlugin = { id: 'demo-peaks', name: '护山妖兽', version: '0.1.0', author: 'demo', description: '示例插件:山鬼妖气事件与护山之力(+2% 战力)。', kind: 'content', install(ctx) { ctx.addCapability({ id: 'demo-guardian', name: '护山之力', version: '0.1.0', desc: '示例:年首山灵庇佑,全族修为小幅精进。' }) ctx.onYearStart((w) => { if (w.sysEnabled('demo-guardian')) { for (const c of w.aliveMembers()) { c.realmProgress = Math.min(100, c.realmProgress + 1.5) } } }) ctx.addEventPool('demo-peaks', [ { id: 'ev-demo-guardian', name: '山鬼怒吼', category: 'daily', weight: 3, text: '夜半山鸣,护山兽影现身墙外——莫非是山中精怪在拜望?', options: [{ label: '蒸饼供奉', hint: '声望+2', eff: { rep: 2 } }] } ]) }, uninstall(ctx) { ctx.removeEventPool('demo-peaks') ctx.removeCapability('demo-guardian') } } /** 依赖缺失的坏插件:应被拒绝安装 */ export const brokenPlugin: CotycPlugin = { id: 'demo-broken', name: '依赖断链的插件', version: '0.1.0', kind: 'events', dependencies: ['demo-not-exists'], install() {} }