import { SufPassiveSkill, PrePassiveSkill } from './base'; import i18n from '../i18n'; import { BattleRole, replace } from '@/tool'; const { t } = i18n; export class Duan extends SufPassiveSkill { name: string = 'duan'; rate: number = 10; order: number = 999; dmg: number = 999999999; desc(): string { return replace(t('skill.duan.1'), [this.rate]); } trigger(owner: BattleRole, target: BattleRole): boolean { return target.attr.curHp / target.attr.hp < this.rate / 100; } takeEffect(owner: BattleRole, target: BattleRole): void { target.addHp(-1 * this.dmg); const log = replace(t('skill.duan.2'), [this.rate, this.dmg]); owner.battleLog(log); } }