一个全随机的刷装备小游戏
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.

35 lines
1.1 KiB

import { Attack, SufPassiveSkill } from './base';
import i18n from '../i18n';
import { replace, BattleRole } from '@/tool';
import { ControlAbnormal } from './buff';
const { t } = i18n;
export class IceBlade extends SufPassiveSkill {
name: string = 'iceBlade';
rate: number = 10;
percent: number = 1000;
last: number = 1;
desc(): string {
return replace(t('skill.iceBlade.1'), [this.rate, this.percent, this.last]);
}
trigger(owner: BattleRole, target: BattleRole): boolean {
return owner.crit && Math.random() < this.rate / 100;
}
takeEffect(owner: BattleRole, target: BattleRole): void {
const additional = Math.ceil((owner.atk * this.percent) / 100);
target.addHp(-1 * additional);
target.putBuff(new ControlAbnormal(this.name, this.last));
owner.battleLog(replace(t('skill.iceBlade.2'), [additional, t(target.type), this.last]));
}
}
export class SeeRed extends Attack {
order: number = 99;
name: string = 'seeRed';
cd: number = 4;
precent: number = 200;
desc(): string {
return replace(t('skill.seeRed.1'), [this.precent, this.cd]);
}
}