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

24 lines
885 B

import { CounterSkill, Attack, Control, GainsSkill, SufPassiveSkill, Vampire, PrePassiveSkill } from './base';
import i18n from '../i18n';
import { BattleRole, replace } from '@/tool';
const { t } = i18n;
export class BHXDJC extends PrePassiveSkill {
name: string = 'bhxdjc';
hpPercent: number = 60;
shieldPercentOfHp: number = 80;
triggered: boolean = false;
desc(): string {
return replace(t('skill.bhxdjc.1'), [this.hpPercent, this.shieldPercentOfHp]);
}
trigger(owner: BattleRole, target: BattleRole): boolean {
return !this.triggered && owner.attr.curHp / owner.attr.hp < this.hpPercent / 100;
}
takeEffect(owner: BattleRole, target: BattleRole): void {
this.triggered = true;
owner.shield = Math.ceil((owner.attr.hp * this.shieldPercentOfHp) / 100);
const log = replace(t('skill.bhxdjc.2'), [owner.shield]);
owner.battleLog(log);
}
}