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.
36 lines
1.1 KiB
36 lines
1.1 KiB
1 month ago
|
import { Attack, SufPassiveSkill } from './base';
|
||
|
import i18n from '../i18n';
|
||
|
import { replace, BattleRole } from '@/tool';
|
||
|
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.attr.atk * this.percent) / 100);
|
||
|
owner.dmg += additional;
|
||
|
target.addHp(-1 * additional);
|
||
|
target.control = target.control > this.last ? target.control : this.last;
|
||
|
const log = replace(t('skill.iceBlade.2'), [additional, t(target.type), this.last]);
|
||
|
owner.battleLog(log);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export class SeeRed extends Attack {
|
||
|
order: number = 100;
|
||
|
name: string = 'seeRed';
|
||
|
cd: number = 4;
|
||
|
precent: number = 200;
|
||
|
desc(): string {
|
||
|
return replace(t('skill.seeRed.1'), [this.precent, this.cd]);
|
||
|
}
|
||
|
}
|