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.
83 lines
2.4 KiB
83 lines
2.4 KiB
|
7 months ago
|
import { CounterSkill, Attack, Control, GainsSkill, SufPassiveSkill, Vampire } from './base';
|
||
|
|
import i18n from '../i18n';
|
||
|
|
import { BattleRole, replace } from '@/tool';
|
||
|
|
const { t } = i18n;
|
||
|
|
|
||
|
|
//化缘
|
||
|
|
export class Fate extends GainsSkill {
|
||
|
|
percent = 20;
|
||
|
|
name: string = 'fate';
|
||
|
|
desc(): string {
|
||
|
|
return replace(t('skill.fate.1'), [this.percent]);
|
||
|
|
}
|
||
|
|
afterBattle(owner: BattleRole, target: BattleRole): void {
|
||
|
|
target.attr.coins = Math.round(target.attr.coins * (1 + this.percent / 100));
|
||
|
|
}
|
||
|
|
}
|
||
|
|
//1%生命偷取
|
||
|
|
export class Vampire1 extends Vampire {
|
||
|
|
percent: number = 1;
|
||
|
|
}
|
||
|
|
//现原形
|
||
|
|
export class Prototype extends Control {
|
||
|
|
cd: number = 10;
|
||
|
|
last: number = 2;
|
||
|
|
rate: number = 100;
|
||
|
|
bossRate: number = 10;
|
||
|
|
name: string = 'prototype';
|
||
|
|
desc(): string {
|
||
|
|
return replace(t('skill.prototype.1'), [this.last, this.cd, this.bossRate]);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
//暴击恐惧
|
||
|
|
export class CritFear extends SufPassiveSkill {
|
||
|
|
name: string = 'critFear';
|
||
|
|
percent: number = 200;
|
||
|
|
desc(): string {
|
||
|
|
return replace(t('skill.critFear.1'), [this.percent]);
|
||
|
|
}
|
||
|
|
trigger(owner: BattleRole, target: BattleRole): boolean {
|
||
|
|
return owner.crit;
|
||
|
|
}
|
||
|
|
takeEffect(owner: BattleRole, target: BattleRole): void {
|
||
|
|
const additional = Math.ceil((owner.attr.atk * this.percent) / 100);
|
||
|
|
owner.dmg += additional;
|
||
|
|
target.addHp(-1 * additional);
|
||
|
|
const log = replace(t('skill.critFear.2'), [additional]);
|
||
|
|
owner.battleLog(log);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
//琉璃盘
|
||
|
|
export class Liulipan extends Attack {
|
||
|
|
order: number = 10;
|
||
|
|
lv?: number;
|
||
|
|
name: string = 'liulipan';
|
||
|
|
atk: number = 20;
|
||
|
|
cd: number = 5;
|
||
|
|
desc(): string {
|
||
|
|
return replace(t('skill.liulipan.1'), [(this.lv || 1) * this.atk, this.cd]);
|
||
|
|
}
|
||
|
|
beforeAtk(owner: BattleRole, target: BattleRole): void {
|
||
|
|
this.extraAtk = (this.lv || 1) * this.atk;
|
||
|
|
super.beforeAtk(owner, target);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
//镜花水月
|
||
|
|
export class JHSY extends CounterSkill {
|
||
|
|
name: string = 'JHSY';
|
||
|
|
rate: number = 100;
|
||
|
|
percent: number = 100;
|
||
|
|
desc(): string {
|
||
|
|
return replace(t('skill.JHSY.1'), [this.rate, this.percent, this.cd]);
|
||
|
|
}
|
||
|
|
trigger(owner: BattleRole, target: BattleRole): boolean {
|
||
|
|
return Math.random() < this.rate / 100;
|
||
|
|
}
|
||
|
|
takeEffect(owner: BattleRole, target: BattleRole): void {
|
||
|
|
const reflected = Math.ceil((target.dmg * this.percent) / 100);
|
||
|
|
target.addHp(-1 * reflected);
|
||
|
|
const log = replace(t('skill.JHSY.2'), [t(owner.type), reflected]);
|
||
|
|
owner.battleLog(log);
|
||
|
|
}
|
||
|
|
}
|