You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
690 B
23 lines
690 B
2 weeks ago
|
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);
|
||
|
}
|
||
|
}
|