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

59 lines
2.1 KiB

import { ActionSkill, Attack, PassiveSkill, SufPassiveSkill } from './base';
import i18n from '../i18n';
import { replace, BattleRole } from '@/tool';
import { ControlAbnormal, LiuXue } 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 ActionSkill {
name: string = 'seeRed';
layer: number = 5;
cd: number = 5;
last: number = 5;
desc(): string {
return replace(t('skill.seeRed.1'), [this.layer, this.last]) + replace(t('skill.seeRed.2'), [this.cd]);
}
use(owner: BattleRole, target: BattleRole): void {
owner.skillPercent = 0;
const liuxue = new LiuXue(this.layer, this.last);
target.putBuff(liuxue);
owner.battleLog(replace(t('skill.user'), [t(owner.type), t('skill.' + this.name + '.0')]) + replace(t('skill.seeRed.1'), [this.layer, this.last]));
}
}
//鳍刺
export class QiCi extends SufPassiveSkill {
name: string = 'qici';
rate: number = 30;
layer: number = 3;
last: number = 4;
desc(): string {
return replace(t('skill.qici.1'), [this.rate, this.layer, this.last]);
}
trigger(owner: BattleRole, target: BattleRole): boolean {
return owner.dmg > 0 && Math.random() < this.rate / 100;
}
takeEffect(owner: BattleRole, target: BattleRole): void {
const liuxue = new LiuXue(this.layer, this.last);
target.putBuff(liuxue);
owner.battleLog(replace(t('skill.qici.2'), [t(target.type), this.layer, this.last]));
}
}